summaryrefslogtreecommitdiff
path: root/java/openjdk8/files/patch-8u60-b23
diff options
context:
space:
mode:
Diffstat (limited to 'java/openjdk8/files/patch-8u60-b23')
-rw-r--r--java/openjdk8/files/patch-8u60-b23280156
1 files changed, 280156 insertions, 0 deletions
diff --git a/java/openjdk8/files/patch-8u60-b23 b/java/openjdk8/files/patch-8u60-b23
new file mode 100644
index 000000000000..0ad2330eeac0
--- /dev/null
+++ b/java/openjdk8/files/patch-8u60-b23
@@ -0,0 +1,280156 @@
+--- ./.hgtags Mon Jun 01 11:40:12 2015 -0700
++++ ./.hgtags Wed Jul 01 21:51:50 2015 -0700
+@@ -354,7 +354,6 @@
+ fde671d8b2537b6be61f67e583164b5b8b33ac5b jdk8u31-b13
+ a198f93b1e0be5edce7a351b1399cb5c4e64c8f4 jdk8u31-b31
+ 99c79d83152585991682bd86e21fdcfe6f6ab9b2 jdk8u31-b32
+-cf4ebf47413902376f66d2cddaf0282d49699ba7 jdk8u31-b33
+ 0dccc4aca1859b1ff7dca9db214f7f38c4ddbbce jdk8u40-b00
+ f8736a40a35df0c8055c8a94b96e5381b381ad33 jdk8u40-b01
+ b6a148730f2b14193c308bc9c866c36ee6c08ed3 jdk8u40-b02
+@@ -383,8 +382,6 @@
+ e26f15704e37f28acebb22378c4785891aaec637 jdk8u40-b25
+ 7a552439756eaad0618ae82a94c034edb65f5d7e jdk8u40-b26
+ 12deacac825756e266e91a906db9edab73c4c90b jdk8u40-b27
+-eee2ebbb97f136cd458d4f3a825ee40d0046f425 jdk8u40-b31
+-b92f3d486e47d29dfb1ea2096db295077328368e jdk8u40-b32
+ ec4bcc6e4dcf190a165106627ed3eef1e7d94d0c jdk8u45-b00
+ 635ba0c81b894a88ff737fefc9d7af398f761643 jdk8u45-b01
+ 801c65bb74b770600a2d48189764e416e5cfe265 jdk8u45-b02
+@@ -400,22 +397,26 @@
+ 54709b761404dd3bc1b58acf5582fa9bd70ff59a jdk8u45-b12
+ 6b2f1bf5c72873d01b37103fc20ac7a63e7881dd jdk8u45-b13
+ 15b679d327da9ee99c05d7ddd75512ce335d5994 jdk8u45-b14
+-438cc91b51330a61a790f0a0ac64816b565d25f0 jdk8u45-b15
+-5a4ccc33ab26b635f91ddd424742b0009a37bcc0 jdk8u45-b31
+-4597cb5171773416c4b2e1843db8592a69ff7a99 jdk8u45-b32
+-a1682688c9aec33c172146ce4be8d3969e7d76bb jdk8u51-b00
+-e04f2ee2d03d9927d2012286a9bcbf511eb887ae jdk8u51-b01
+-4dee64570ad013eb5e1cb16304f9eff558c1c5e9 jdk8u51-b02
+-df8e9cbe5a8a7ce9cf2e0a78910302d08e2dbb53 jdk8u51-b03
+-1d29a8f9bd262c4f3556e0250db80d8dc64d95d3 jdk8u51-b04
+-046d1cfaedc892bfd49570d42dd655338278d476 jdk8u51-b05
+-7875bd6e35fb6af4b150dda213d7812bdb9fcba1 jdk8u51-b06
+-2c7a34442763e809d2cf1459d5b8d6d5528f6494 jdk8u51-b07
+-a96b442d99131e87c7c974a0fa277a5f971732c6 jdk8u51-b08
+-3a95f1e13da9720a6243c0bd41688544b037e182 jdk8u51-b09
+-d99f3f935397fdc65dcb776a97110e8ff5cc519c jdk8u51-b10
+-29612174658436601ba833993227ae96117f632c jdk8u51-b11
+-f07a9ef02d513435e19fd70abcce2871d1c91342 jdk8u51-b12
+-6ef21f3e0946aaab8dc1f4e9cad21dacb97c4f8c jdk8u51-b13
+-5a2078b398485d21fa6577cf9481aa488d2e28d0 jdk8u51-b14
+-54b6481aa9e2f39699a96a4572b825b6d81f434f jdk8u51-b15
++ae4980d195b64eec58884b233d7efd312205bac8 jdk8u60-b00
++acf81f6fb265c1564b16fd8202a324a9022e204b jdk8u60-b01
++2ca2e2430370d441cbe7999b76b57cadf0060327 jdk8u60-b02
++590cc3ca1fec083de3543b18b0062651b597e376 jdk8u60-b03
++d8d408861c2094c24e9757a67bf2941ed37ce01f jdk8u60-b04
++e532f3672f635bd83c673c349b7563db6dd470bb jdk8u60-b05
++74dbdbcb6aac9fd62f3599ad4e0a1f930b1e9ac1 jdk8u60-b06
++ea714a39e902fb8729f71f2d0f634855646e297d jdk8u60-b07
++0785e45b19c864264f2054a8130c49fe6f70925c jdk8u60-b08
++da6d0717c74a1e2ae4498bf4dc230e20686517ed jdk8u60-b09
++39cd90aa447ae87ed3b2968dcf1a90d08fff964d jdk8u60-b10
++db15b96c78126b2c8a8e19dcc65cdd0b246bd12b jdk8u60-b11
++ba0772198525025803b0fddd6a628fc2416b3b85 jdk8u60-b12
++6ff963c0dd414da5973a00c59b9ce7feb327a8ed jdk8u60-b13
++455a74ebdf59e91116e58d1545b15fd143624e36 jdk8u60-b14
++7ed130e10665ae5bed82aa8c4cdc18373292a6d7 jdk8u60-b15
++08a417ec9b3eea2f02eb02c7b7635f9701813f65 jdk8u60-b16
++ec24cc303a2cfeb10ff0a5fb7b3d49ef47bb66f7 jdk8u60-b17
++d1d9eb953fbbe1f63a6badb0742508ae5f0d3ab5 jdk8u60-b18
++ff2ddaa4ea3292e2f0931a9a0c3feb33288d7d7f jdk8u60-b19
++c641f979dff0d28dcdc4f303e9d93dda3079a456 jdk8u60-b20
++99d323d5830fad8551038da15113639d8518a8e6 jdk8u60-b21
++01bb22b4ebb6348efa14726ba139858d6defefcd jdk8u60-b22
+--- ./THIRD_PARTY_README Mon Jun 01 11:40:12 2015 -0700
++++ ./THIRD_PARTY_README Wed Jul 01 21:51:50 2015 -0700
+@@ -1140,37 +1140,6 @@
+
+ --------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to JSON, which may be included
+-with JRE 8 & JDK 8.
+-
+---- begin of LICENSE ---
+-
+-Copyright (c) 2002 JSON.org
+-
+-Permission is hereby granted, free of charge, to any person obtaining a copy
+-of this software and associated documentation files (the "Software"), to deal
+-in the Software without restriction, including without limitation the rights
+-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-copies of the Software, and to permit persons to whom the Software is
+-furnished to do so, subject to the following conditions:
+-
+-The above copyright notice and this permission notice shall be included in all
+-copies or substantial portions of the Software.
+-
+-The Software shall be used for Good, not Evil.
+-
+-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-SOFTWARE.
+-
+---- end of LICENSE ---
+-
+--------------------------------------------------------------------------------
+-
+ %% This notice is provided with respect to Kerberos functionality, which
+ which may be included with JRE 8, JDK 8, and OpenJDK 8.
+
+@@ -1250,7 +1219,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libpng 1.6.16, which may be
++%% This notice is provided with respect to libpng 1.6.16, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1370,7 +1339,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libungif 4.1.3, which may be
++%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1399,13 +1368,13 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to Little CMS 2.5, which may be
++%% This notice is provided with respect to Little CMS 2.7, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+
+ Little CMS
+-Copyright (c) 1998-2011 Marti Maria Saguer
++Copyright (c) 1998-2015 Marti Maria Saguer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+--- ./common/autoconf/basics.m4 Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/basics.m4 Wed Jul 01 21:51:50 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -386,6 +386,12 @@
+ [TOOLS_DIR=$with_tools_dir]
+ )
+
++ # Xcode version will be validated later
++ AC_ARG_WITH([xcode-path], [AS_HELP_STRING([--with-xcode-path],
++ [explicit path to Xcode 4 (generally for building on 10.9 and later)])],
++ [XCODE_PATH=$with_xcode_path]
++ )
++
+ AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
+ [use this directory as base for tools-dir and sys-root (for cross-compiling)])],
+ [
+@@ -634,10 +640,6 @@
+ # We can build without it.
+ LDD="true"
+ fi
+- AC_PATH_PROG(OTOOL, otool)
+- if test "x$OTOOL" = "x"; then
+- OTOOL="true"
+- fi
+ AC_PATH_PROGS(READELF, [readelf greadelf])
+ AC_PATH_PROG(HG, hg)
+ AC_PATH_PROG(STAT, stat)
+--- ./common/autoconf/basics_windows.m4 Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/basics_windows.m4 Wed Jul 01 21:51:50 2015 -0700
+@@ -312,8 +312,8 @@
+ WINDOWS_ENV_VENDOR='cygwin'
+ WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
+
+- CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.`
+- if test "x$CYGWIN_VERSION_OK" = x; then
++ CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.[0-6]'`
++ if test "x$CYGWIN_VERSION_OLD" != x; then
+ AC_MSG_NOTICE([Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade.])
+ AC_MSG_ERROR([Cannot continue])
+ fi
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./common/autoconf/build-aux/autoconf-config.sub Wed Jul 01 21:51:50 2015 -0700
+@@ -0,0 +1,1684 @@
++#! /bin/sh
++
++#
++# Copyright (c) 2012, 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. 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.
++#
++
++# Configuration validation subroutine script.
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
++# Free Software Foundation, Inc.
++
++timestamp='2008-01-16'
++
++# This file is (in principle) common to ALL GNU software.
++# The presence of a machine in this file suggests that SOME GNU software
++# can handle that machine. It does not imply ALL GNU software can.
++#
++# This file is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program 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 for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
++# 02110-1301, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
++#
++# Configuration subroutine to validate and canonicalize a configuration type.
++# Supply the specified configuration type as an argument.
++# If it is invalid, we print an error message on stderr and exit with code 1.
++# Otherwise, we print the canonical config type on stdout and succeed.
++
++# This file is supposed to be the same for all GNU packages
++# and recognize all the CPU types, system types and aliases
++# that are meaningful with *any* GNU software.
++# Each package is responsible for reporting which valid configurations
++# it does not support. The user should be able to distinguish
++# a failure to support a valid configuration from a meaningless
++# configuration.
++
++# The goal of this file is to map all the various variations of a given
++# machine specification into a single specification in the form:
++# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
++# or in some cases, the newer four-part form:
++# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
++# It is wrong to echo any other type of specification.
++
++me=`echo "$0" | sed -e 's,.*/,,'`
++
++usage="\
++Usage: $0 [OPTION] CPU-MFR-OPSYS
++ $0 [OPTION] ALIAS
++
++Canonicalize a configuration name.
++
++Operation modes:
++ -h, --help print this help, then exit
++ -t, --time-stamp print date of last modification, then exit
++ -v, --version print version number, then exit
++
++Report bugs and patches to <config-patches@gnu.org>."
++
++version="\
++GNU config.sub ($timestamp)
++
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
++2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++ case $1 in
++ --time-stamp | --time* | -t )
++ echo "$timestamp" ; exit ;;
++ --version | -v )
++ echo "$version" ; exit ;;
++ --help | --h* | -h )
++ echo "$usage"; exit ;;
++ -- ) # Stop option processing
++ shift; break ;;
++ - ) # Use stdin as input.
++ break ;;
++ -* )
++ echo "$me: invalid option $1$help"
++ exit 1 ;;
++
++ *local*)
++ # First pass through any local machine types.
++ echo $1
++ exit ;;
++
++ * )
++ break ;;
++ esac
++done
++
++case $# in
++ 0) echo "$me: missing argument$help" >&2
++ exit 1;;
++ 1) ;;
++ *) echo "$me: too many arguments$help" >&2
++ exit 1;;
++esac
++
++# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
++# Here we must recognize all the valid KERNEL-OS combinations.
++maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
++case $maybe_os in
++ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
++ storm-chaos* | os2-emx* | rtmk-nova*)
++ os=-$maybe_os
++ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
++ ;;
++ *)
++ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
++ if [ $basic_machine != $1 ]
++ then os=`echo $1 | sed 's/.*-/-/'`
++ else os=; fi
++ ;;
++esac
++
++### Let's recognize common machines as not being operating systems so
++### that things like config.sub decstation-3100 work. We also
++### recognize some manufacturers as not being operating systems, so we
++### can provide default operating systems below.
++case $os in
++ -sun*os*)
++ # Prevent following clause from handling this invalid input.
++ ;;
++ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
++ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
++ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
++ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
++ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
++ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
++ -apple | -axis | -knuth | -cray)
++ os=
++ basic_machine=$1
++ ;;
++ -sim | -cisco | -oki | -wec | -winbond)
++ os=
++ basic_machine=$1
++ ;;
++ -scout)
++ ;;
++ -wrs)
++ os=-vxworks
++ basic_machine=$1
++ ;;
++ -chorusos*)
++ os=-chorusos
++ basic_machine=$1
++ ;;
++ -chorusrdb)
++ os=-chorusrdb
++ basic_machine=$1
++ ;;
++ -hiux*)
++ os=-hiuxwe2
++ ;;
++ -sco6)
++ os=-sco5v6
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -sco5)
++ os=-sco3.2v5
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -sco4)
++ os=-sco3.2v4
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -sco3.2.[4-9]*)
++ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -sco3.2v[4-9]*)
++ # Don't forget version if it is 3.2v4 or newer.
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -sco5v6*)
++ # Don't forget version if it is 3.2v4 or newer.
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -sco*)
++ os=-sco3.2v2
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -udk*)
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -isc)
++ os=-isc2.2
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -clix*)
++ basic_machine=clipper-intergraph
++ ;;
++ -isc*)
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
++ -lynx*)
++ os=-lynxos
++ ;;
++ -ptx*)
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
++ ;;
++ -windowsnt*)
++ os=`echo $os | sed -e 's/windowsnt/winnt/'`
++ ;;
++ -psos*)
++ os=-psos
++ ;;
++ -mint | -mint[0-9]*)
++ basic_machine=m68k-atari
++ os=-mint
++ ;;
++esac
++
++# Decode aliases for certain CPU-COMPANY combinations.
++case $basic_machine in
++ # Recognize the basic CPU types without company name.
++ # Some are omitted here because they have special meanings below.
++ 1750a | 580 \
++ | a29k \
++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
++ | am33_2.0 \
++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
++ | bfin \
++ | c4x | clipper \
++ | d10v | d30v | dlx | dsp16xx \
++ | fido | fr30 | frv \
++ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | i370 | i860 | i960 | ia64 \
++ | ip2k | iq2000 \
++ | m32c | m32r | m32rle | m68000 | m68k | m88k \
++ | maxq | mb | microblaze | mcore | mep \
++ | mips | mipsbe | mipseb | mipsel | mipsle \
++ | mips16 \
++ | mips64 | mips64el \
++ | mips64vr | mips64vrel \
++ | mips64orion | mips64orionel \
++ | mips64vr4100 | mips64vr4100el \
++ | mips64vr4300 | mips64vr4300el \
++ | mips64vr5000 | mips64vr5000el \
++ | mips64vr5900 | mips64vr5900el \
++ | mipsisa32 | mipsisa32el \
++ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa64 | mipsisa64el \
++ | mipsisa64r2 | mipsisa64r2el \
++ | mipsisa64sb1 | mipsisa64sb1el \
++ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipstx39 | mipstx39el \
++ | mn10200 | mn10300 \
++ | mt \
++ | msp430 \
++ | nios | nios2 \
++ | ns16k | ns32k \
++ | or32 \
++ | pdp10 | pdp11 | pj | pjl \
++ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++ | pyramid \
++ | score \
++ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
++ | sh64 | sh64le \
++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
++ | spu | strongarm \
++ | tahoe | thumb | tic4x | tic80 | tron \
++ | v850 | v850e \
++ | we32k \
++ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
++ | z8k)
++ basic_machine=$basic_machine-unknown
++ ;;
++ m6811 | m68hc11 | m6812 | m68hc12)
++ # Motorola 68HC11/12.
++ basic_machine=$basic_machine-unknown
++ os=-none
++ ;;
++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
++ ;;
++ ms1)
++ basic_machine=mt-unknown
++ ;;
++
++ # We use `pc' rather than `unknown'
++ # because (1) that's what they normally are, and
++ # (2) the word "unknown" tends to confuse beginning users.
++ i*86 | x86_64)
++ basic_machine=$basic_machine-pc
++ ;;
++ # Object if more than one company name word.
++ *-*-*)
++ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
++ exit 1
++ ;;
++ # Recognize the basic CPU types with company name.
++ 580-* \
++ | a29k-* \
++ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
++ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
++ | avr-* | avr32-* \
++ | bfin-* | bs2000-* \
++ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
++ | clipper-* | craynv-* | cydra-* \
++ | d10v-* | d30v-* | dlx-* \
++ | elxsi-* \
++ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
++ | h8300-* | h8500-* \
++ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
++ | i*86-* | i860-* | i960-* | ia64-* \
++ | ip2k-* | iq2000-* \
++ | m32c-* | m32r-* | m32rle-* \
++ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
++ | m88110-* | m88k-* | maxq-* | mcore-* \
++ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
++ | mips16-* \
++ | mips64-* | mips64el-* \
++ | mips64vr-* | mips64vrel-* \
++ | mips64orion-* | mips64orionel-* \
++ | mips64vr4100-* | mips64vr4100el-* \
++ | mips64vr4300-* | mips64vr4300el-* \
++ | mips64vr5000-* | mips64vr5000el-* \
++ | mips64vr5900-* | mips64vr5900el-* \
++ | mipsisa32-* | mipsisa32el-* \
++ | mipsisa32r2-* | mipsisa32r2el-* \
++ | mipsisa64-* | mipsisa64el-* \
++ | mipsisa64r2-* | mipsisa64r2el-* \
++ | mipsisa64sb1-* | mipsisa64sb1el-* \
++ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
++ | mipstx39-* | mipstx39el-* \
++ | mmix-* \
++ | mt-* \
++ | msp430-* \
++ | nios-* | nios2-* \
++ | none-* | np1-* | ns16k-* | ns32k-* \
++ | orion-* \
++ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
++ | pyramid-* \
++ | romp-* | rs6000-* \
++ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
++ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
++ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
++ | sparclite-* \
++ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
++ | tahoe-* | thumb-* \
++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
++ | tron-* \
++ | v850-* | v850e-* | vax-* \
++ | we32k-* \
++ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
++ | xstormy16-* | xtensa*-* \
++ | ymp-* \
++ | z8k-*)
++ ;;
++ # Recognize the basic CPU types without company name, with glob match.
++ xtensa*)
++ basic_machine=$basic_machine-unknown
++ ;;
++ # Recognize the various machine names and aliases which stand
++ # for a CPU type and a company and sometimes even an OS.
++ 386bsd)
++ basic_machine=i386-unknown
++ os=-bsd
++ ;;
++ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
++ basic_machine=m68000-att
++ ;;
++ 3b*)
++ basic_machine=we32k-att
++ ;;
++ a29khif)
++ basic_machine=a29k-amd
++ os=-udi
++ ;;
++ abacus)
++ basic_machine=abacus-unknown
++ ;;
++ adobe68k)
++ basic_machine=m68010-adobe
++ os=-scout
++ ;;
++ alliant | fx80)
++ basic_machine=fx80-alliant
++ ;;
++ altos | altos3068)
++ basic_machine=m68k-altos
++ ;;
++ am29k)
++ basic_machine=a29k-none
++ os=-bsd
++ ;;
++ amd64)
++ basic_machine=x86_64-pc
++ ;;
++ amd64-*)
++ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ amdahl)
++ basic_machine=580-amdahl
++ os=-sysv
++ ;;
++ amiga | amiga-*)
++ basic_machine=m68k-unknown
++ ;;
++ amigaos | amigados)
++ basic_machine=m68k-unknown
++ os=-amigaos
++ ;;
++ amigaunix | amix)
++ basic_machine=m68k-unknown
++ os=-sysv4
++ ;;
++ apollo68)
++ basic_machine=m68k-apollo
++ os=-sysv
++ ;;
++ apollo68bsd)
++ basic_machine=m68k-apollo
++ os=-bsd
++ ;;
++ aux)
++ basic_machine=m68k-apple
++ os=-aux
++ ;;
++ balance)
++ basic_machine=ns32k-sequent
++ os=-dynix
++ ;;
++ blackfin)
++ basic_machine=bfin-unknown
++ os=-linux
++ ;;
++ blackfin-*)
++ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
++ os=-linux
++ ;;
++ c90)
++ basic_machine=c90-cray
++ os=-unicos
++ ;;
++ convex-c1)
++ basic_machine=c1-convex
++ os=-bsd
++ ;;
++ convex-c2)
++ basic_machine=c2-convex
++ os=-bsd
++ ;;
++ convex-c32)
++ basic_machine=c32-convex
++ os=-bsd
++ ;;
++ convex-c34)
++ basic_machine=c34-convex
++ os=-bsd
++ ;;
++ convex-c38)
++ basic_machine=c38-convex
++ os=-bsd
++ ;;
++ cray | j90)
++ basic_machine=j90-cray
++ os=-unicos
++ ;;
++ craynv)
++ basic_machine=craynv-cray
++ os=-unicosmp
++ ;;
++ cr16)
++ basic_machine=cr16-unknown
++ os=-elf
++ ;;
++ crds | unos)
++ basic_machine=m68k-crds
++ ;;
++ crisv32 | crisv32-* | etraxfs*)
++ basic_machine=crisv32-axis
++ ;;
++ cris | cris-* | etrax*)
++ basic_machine=cris-axis
++ ;;
++ crx)
++ basic_machine=crx-unknown
++ os=-elf
++ ;;
++ da30 | da30-*)
++ basic_machine=m68k-da30
++ ;;
++ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
++ basic_machine=mips-dec
++ ;;
++ decsystem10* | dec10*)
++ basic_machine=pdp10-dec
++ os=-tops10
++ ;;
++ decsystem20* | dec20*)
++ basic_machine=pdp10-dec
++ os=-tops20
++ ;;
++ delta | 3300 | motorola-3300 | motorola-delta \
++ | 3300-motorola | delta-motorola)
++ basic_machine=m68k-motorola
++ ;;
++ delta88)
++ basic_machine=m88k-motorola
++ os=-sysv3
++ ;;
++ djgpp)
++ basic_machine=i586-pc
++ os=-msdosdjgpp
++ ;;
++ dpx20 | dpx20-*)
++ basic_machine=rs6000-bull
++ os=-bosx
++ ;;
++ dpx2* | dpx2*-bull)
++ basic_machine=m68k-bull
++ os=-sysv3
++ ;;
++ ebmon29k)
++ basic_machine=a29k-amd
++ os=-ebmon
++ ;;
++ elxsi)
++ basic_machine=elxsi-elxsi
++ os=-bsd
++ ;;
++ encore | umax | mmax)
++ basic_machine=ns32k-encore
++ ;;
++ es1800 | OSE68k | ose68k | ose | OSE)
++ basic_machine=m68k-ericsson
++ os=-ose
++ ;;
++ fx2800)
++ basic_machine=i860-alliant
++ ;;
++ genix)
++ basic_machine=ns32k-ns
++ ;;
++ gmicro)
++ basic_machine=tron-gmicro
++ os=-sysv
++ ;;
++ go32)
++ basic_machine=i386-pc
++ os=-go32
++ ;;
++ h3050r* | hiux*)
++ basic_machine=hppa1.1-hitachi
++ os=-hiuxwe2
++ ;;
++ h8300hms)
++ basic_machine=h8300-hitachi
++ os=-hms
++ ;;
++ h8300xray)
++ basic_machine=h8300-hitachi
++ os=-xray
++ ;;
++ h8500hms)
++ basic_machine=h8500-hitachi
++ os=-hms
++ ;;
++ harris)
++ basic_machine=m88k-harris
++ os=-sysv3
++ ;;
++ hp300-*)
++ basic_machine=m68k-hp
++ ;;
++ hp300bsd)
++ basic_machine=m68k-hp
++ os=-bsd
++ ;;
++ hp300hpux)
++ basic_machine=m68k-hp
++ os=-hpux
++ ;;
++ hp3k9[0-9][0-9] | hp9[0-9][0-9])
++ basic_machine=hppa1.0-hp
++ ;;
++ hp9k2[0-9][0-9] | hp9k31[0-9])
++ basic_machine=m68000-hp
++ ;;
++ hp9k3[2-9][0-9])
++ basic_machine=m68k-hp
++ ;;
++ hp9k6[0-9][0-9] | hp6[0-9][0-9])
++ basic_machine=hppa1.0-hp
++ ;;
++ hp9k7[0-79][0-9] | hp7[0-79][0-9])
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k78[0-9] | hp78[0-9])
++ # FIXME: really hppa2.0-hp
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
++ # FIXME: really hppa2.0-hp
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k8[0-9][13679] | hp8[0-9][13679])
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k8[0-9][0-9] | hp8[0-9][0-9])
++ basic_machine=hppa1.0-hp
++ ;;
++ hppa-next)
++ os=-nextstep3
++ ;;
++ hppaosf)
++ basic_machine=hppa1.1-hp
++ os=-osf
++ ;;
++ hppro)
++ basic_machine=hppa1.1-hp
++ os=-proelf
++ ;;
++ i370-ibm* | ibm*)
++ basic_machine=i370-ibm
++ ;;
++# I'm not sure what "Sysv32" means. Should this be sysv3.2?
++ i*86v32)
++ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++ os=-sysv32
++ ;;
++ i*86v4*)
++ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++ os=-sysv4
++ ;;
++ i*86v)
++ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++ os=-sysv
++ ;;
++ i*86sol2)
++ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++ os=-solaris2
++ ;;
++ i386mach)
++ basic_machine=i386-mach
++ os=-mach
++ ;;
++ i386-vsta | vsta)
++ basic_machine=i386-unknown
++ os=-vsta
++ ;;
++ iris | iris4d)
++ basic_machine=mips-sgi
++ case $os in
++ -irix*)
++ ;;
++ *)
++ os=-irix4
++ ;;
++ esac
++ ;;
++ isi68 | isi)
++ basic_machine=m68k-isi
++ os=-sysv
++ ;;
++ m68knommu)
++ basic_machine=m68k-unknown
++ os=-linux
++ ;;
++ m68knommu-*)
++ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
++ os=-linux
++ ;;
++ m88k-omron*)
++ basic_machine=m88k-omron
++ ;;
++ magnum | m3230)
++ basic_machine=mips-mips
++ os=-sysv
++ ;;
++ merlin)
++ basic_machine=ns32k-utek
++ os=-sysv
++ ;;
++ mingw32)
++ basic_machine=i386-pc
++ os=-mingw32
++ ;;
++ mingw32ce)
++ basic_machine=arm-unknown
++ os=-mingw32ce
++ ;;
++ miniframe)
++ basic_machine=m68000-convergent
++ ;;
++ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
++ basic_machine=m68k-atari
++ os=-mint
++ ;;
++ mips3*-*)
++ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
++ ;;
++ mips3*)
++ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
++ ;;
++ monitor)
++ basic_machine=m68k-rom68k
++ os=-coff
++ ;;
++ morphos)
++ basic_machine=powerpc-unknown
++ os=-morphos
++ ;;
++ msdos)
++ basic_machine=i386-pc
++ os=-msdos
++ ;;
++ ms1-*)
++ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
++ ;;
++ mvs)
++ basic_machine=i370-ibm
++ os=-mvs
++ ;;
++ ncr3000)
++ basic_machine=i486-ncr
++ os=-sysv4
++ ;;
++ netbsd386)
++ basic_machine=i386-unknown
++ os=-netbsd
++ ;;
++ netwinder)
++ basic_machine=armv4l-rebel
++ os=-linux
++ ;;
++ news | news700 | news800 | news900)
++ basic_machine=m68k-sony
++ os=-newsos
++ ;;
++ news1000)
++ basic_machine=m68030-sony
++ os=-newsos
++ ;;
++ news-3600 | risc-news)
++ basic_machine=mips-sony
++ os=-newsos
++ ;;
++ necv70)
++ basic_machine=v70-nec
++ os=-sysv
++ ;;
++ next | m*-next )
++ basic_machine=m68k-next
++ case $os in
++ -nextstep* )
++ ;;
++ -ns2*)
++ os=-nextstep2
++ ;;
++ *)
++ os=-nextstep3
++ ;;
++ esac
++ ;;
++ nh3000)
++ basic_machine=m68k-harris
++ os=-cxux
++ ;;
++ nh[45]000)
++ basic_machine=m88k-harris
++ os=-cxux
++ ;;
++ nindy960)
++ basic_machine=i960-intel
++ os=-nindy
++ ;;
++ mon960)
++ basic_machine=i960-intel
++ os=-mon960
++ ;;
++ nonstopux)
++ basic_machine=mips-compaq
++ os=-nonstopux
++ ;;
++ np1)
++ basic_machine=np1-gould
++ ;;
++ nsr-tandem)
++ basic_machine=nsr-tandem
++ ;;
++ op50n-* | op60c-*)
++ basic_machine=hppa1.1-oki
++ os=-proelf
++ ;;
++ openrisc | openrisc-*)
++ basic_machine=or32-unknown
++ ;;
++ os400)
++ basic_machine=powerpc-ibm
++ os=-os400
++ ;;
++ OSE68000 | ose68000)
++ basic_machine=m68000-ericsson
++ os=-ose
++ ;;
++ os68k)
++ basic_machine=m68k-none
++ os=-os68k
++ ;;
++ pa-hitachi)
++ basic_machine=hppa1.1-hitachi
++ os=-hiuxwe2
++ ;;
++ paragon)
++ basic_machine=i860-intel
++ os=-osf
++ ;;
++ parisc)
++ basic_machine=hppa-unknown
++ os=-linux
++ ;;
++ parisc-*)
++ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
++ os=-linux
++ ;;
++ pbd)
++ basic_machine=sparc-tti
++ ;;
++ pbb)
++ basic_machine=m68k-tti
++ ;;
++ pc532 | pc532-*)
++ basic_machine=ns32k-pc532
++ ;;
++ pc98)
++ basic_machine=i386-pc
++ ;;
++ pc98-*)
++ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ pentium | p5 | k5 | k6 | nexgen | viac3)
++ basic_machine=i586-pc
++ ;;
++ pentiumpro | p6 | 6x86 | athlon | athlon_*)
++ basic_machine=i686-pc
++ ;;
++ pentiumii | pentium2 | pentiumiii | pentium3)
++ basic_machine=i686-pc
++ ;;
++ pentium4)
++ basic_machine=i786-pc
++ ;;
++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
++ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ pentiumpro-* | p6-* | 6x86-* | athlon-*)
++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ pentium4-*)
++ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ pn)
++ basic_machine=pn-gould
++ ;;
++ power) basic_machine=power-ibm
++ ;;
++ ppc) basic_machine=powerpc-unknown
++ ;;
++ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ppcle | powerpclittle | ppc-le | powerpc-little)
++ basic_machine=powerpcle-unknown
++ ;;
++ ppcle-* | powerpclittle-*)
++ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ppc64) basic_machine=powerpc64-unknown
++ ;;
++ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
++ basic_machine=powerpc64le-unknown
++ ;;
++ ppc64le-* | powerpc64little-*)
++ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ps2)
++ basic_machine=i386-ibm
++ ;;
++ pw32)
++ basic_machine=i586-unknown
++ os=-pw32
++ ;;
++ rdos)
++ basic_machine=i386-pc
++ os=-rdos
++ ;;
++ rom68k)
++ basic_machine=m68k-rom68k
++ os=-coff
++ ;;
++ rm[46]00)
++ basic_machine=mips-siemens
++ ;;
++ rtpc | rtpc-*)
++ basic_machine=romp-ibm
++ ;;
++ s390 | s390-*)
++ basic_machine=s390-ibm
++ ;;
++ s390x | s390x-*)
++ basic_machine=s390x-ibm
++ ;;
++ sa29200)
++ basic_machine=a29k-amd
++ os=-udi
++ ;;
++ sb1)
++ basic_machine=mipsisa64sb1-unknown
++ ;;
++ sb1el)
++ basic_machine=mipsisa64sb1el-unknown
++ ;;
++ sde)
++ basic_machine=mipsisa32-sde
++ os=-elf
++ ;;
++ sei)
++ basic_machine=mips-sei
++ os=-seiux
++ ;;
++ sequent)
++ basic_machine=i386-sequent
++ ;;
++ sh)
++ basic_machine=sh-hitachi
++ os=-hms
++ ;;
++ sh5el)
++ basic_machine=sh5le-unknown
++ ;;
++ sh64)
++ basic_machine=sh64-unknown
++ ;;
++ sparclite-wrs | simso-wrs)
++ basic_machine=sparclite-wrs
++ os=-vxworks
++ ;;
++ sps7)
++ basic_machine=m68k-bull
++ os=-sysv2
++ ;;
++ spur)
++ basic_machine=spur-unknown
++ ;;
++ st2000)
++ basic_machine=m68k-tandem
++ ;;
++ stratus)
++ basic_machine=i860-stratus
++ os=-sysv4
++ ;;
++ sun2)
++ basic_machine=m68000-sun
++ ;;
++ sun2os3)
++ basic_machine=m68000-sun
++ os=-sunos3
++ ;;
++ sun2os4)
++ basic_machine=m68000-sun
++ os=-sunos4
++ ;;
++ sun3os3)
++ basic_machine=m68k-sun
++ os=-sunos3
++ ;;
++ sun3os4)
++ basic_machine=m68k-sun
++ os=-sunos4
++ ;;
++ sun4os3)
++ basic_machine=sparc-sun
++ os=-sunos3
++ ;;
++ sun4os4)
++ basic_machine=sparc-sun
++ os=-sunos4
++ ;;
++ sun4sol2)
++ basic_machine=sparc-sun
++ os=-solaris2
++ ;;
++ sun3 | sun3-*)
++ basic_machine=m68k-sun
++ ;;
++ sun4)
++ basic_machine=sparc-sun
++ ;;
++ sun386 | sun386i | roadrunner)
++ basic_machine=i386-sun
++ ;;
++ sv1)
++ basic_machine=sv1-cray
++ os=-unicos
++ ;;
++ symmetry)
++ basic_machine=i386-sequent
++ os=-dynix
++ ;;
++ t3e)
++ basic_machine=alphaev5-cray
++ os=-unicos
++ ;;
++ t90)
++ basic_machine=t90-cray
++ os=-unicos
++ ;;
++ tic54x | c54x*)
++ basic_machine=tic54x-unknown
++ os=-coff
++ ;;
++ tic55x | c55x*)
++ basic_machine=tic55x-unknown
++ os=-coff
++ ;;
++ tic6x | c6x*)
++ basic_machine=tic6x-unknown
++ os=-coff
++ ;;
++ tile*)
++ basic_machine=tile-unknown
++ os=-linux-gnu
++ ;;
++ tx39)
++ basic_machine=mipstx39-unknown
++ ;;
++ tx39el)
++ basic_machine=mipstx39el-unknown
++ ;;
++ toad1)
++ basic_machine=pdp10-xkl
++ os=-tops20
++ ;;
++ tower | tower-32)
++ basic_machine=m68k-ncr
++ ;;
++ tpf)
++ basic_machine=s390x-ibm
++ os=-tpf
++ ;;
++ udi29k)
++ basic_machine=a29k-amd
++ os=-udi
++ ;;
++ ultra3)
++ basic_machine=a29k-nyu
++ os=-sym1
++ ;;
++ v810 | necv810)
++ basic_machine=v810-nec
++ os=-none
++ ;;
++ vaxv)
++ basic_machine=vax-dec
++ os=-sysv
++ ;;
++ vms)
++ basic_machine=vax-dec
++ os=-vms
++ ;;
++ vpp*|vx|vx-*)
++ basic_machine=f301-fujitsu
++ ;;
++ vxworks960)
++ basic_machine=i960-wrs
++ os=-vxworks
++ ;;
++ vxworks68)
++ basic_machine=m68k-wrs
++ os=-vxworks
++ ;;
++ vxworks29k)
++ basic_machine=a29k-wrs
++ os=-vxworks
++ ;;
++ w65*)
++ basic_machine=w65-wdc
++ os=-none
++ ;;
++ w89k-*)
++ basic_machine=hppa1.1-winbond
++ os=-proelf
++ ;;
++ xbox)
++ basic_machine=i686-pc
++ os=-mingw32
++ ;;
++ xps | xps100)
++ basic_machine=xps100-honeywell
++ ;;
++ ymp)
++ basic_machine=ymp-cray
++ os=-unicos
++ ;;
++ z8k-*-coff)
++ basic_machine=z8k-unknown
++ os=-sim
++ ;;
++ none)
++ basic_machine=none-none
++ os=-none
++ ;;
++
++# Here we handle the default manufacturer of certain CPU types. It is in
++# some cases the only manufacturer, in others, it is the most popular.
++ w89k)
++ basic_machine=hppa1.1-winbond
++ ;;
++ op50n)
++ basic_machine=hppa1.1-oki
++ ;;
++ op60c)
++ basic_machine=hppa1.1-oki
++ ;;
++ romp)
++ basic_machine=romp-ibm
++ ;;
++ mmix)
++ basic_machine=mmix-knuth
++ ;;
++ rs6000)
++ basic_machine=rs6000-ibm
++ ;;
++ vax)
++ basic_machine=vax-dec
++ ;;
++ pdp10)
++ # there are many clones, so DEC is not a safe bet
++ basic_machine=pdp10-unknown
++ ;;
++ pdp11)
++ basic_machine=pdp11-dec
++ ;;
++ we32k)
++ basic_machine=we32k-att
++ ;;
++ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
++ basic_machine=sh-unknown
++ ;;
++ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
++ basic_machine=sparc-sun
++ ;;
++ cydra)
++ basic_machine=cydra-cydrome
++ ;;
++ orion)
++ basic_machine=orion-highlevel
++ ;;
++ orion105)
++ basic_machine=clipper-highlevel
++ ;;
++ mac | mpw | mac-mpw)
++ basic_machine=m68k-apple
++ ;;
++ pmac | pmac-mpw)
++ basic_machine=powerpc-apple
++ ;;
++ *-unknown)
++ # Make sure to match an already-canonicalized machine name.
++ ;;
++ *)
++ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
++ exit 1
++ ;;
++esac
++
++# Here we canonicalize certain aliases for manufacturers.
++case $basic_machine in
++ *-digital*)
++ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
++ ;;
++ *-commodore*)
++ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
++ ;;
++ *)
++ ;;
++esac
++
++# Decode manufacturer-specific aliases for certain operating systems.
++
++if [ x"$os" != x"" ]
++then
++case $os in
++ # First match some system type aliases
++ # that might get confused with valid system types.
++ # -solaris* is a basic system type, with this one exception.
++ -solaris1 | -solaris1.*)
++ os=`echo $os | sed -e 's|solaris1|sunos4|'`
++ ;;
++ -solaris)
++ os=-solaris2
++ ;;
++ -svr4*)
++ os=-sysv4
++ ;;
++ -unixware*)
++ os=-sysv4.2uw
++ ;;
++ -gnu/linux*)
++ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
++ ;;
++ # First accept the basic system types.
++ # The portable systems comes first.
++ # Each alternative MUST END IN A *, to match a version number.
++ # -sysv* is not here because it comes later, after sysvr4.
++ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
++ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
++ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
++ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
++ | -aos* \
++ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
++ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
++ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
++ | -openbsd* | -solidbsd* \
++ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
++ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
++ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
++ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
++ | -chorusos* | -chorusrdb* \
++ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
++ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
++ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
++ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
++ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
++ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
++ # Remember, each alternative MUST END IN *, to match a version number.
++ ;;
++ -qnx*)
++ case $basic_machine in
++ x86-* | i*86-*)
++ ;;
++ *)
++ os=-nto$os
++ ;;
++ esac
++ ;;
++ -nto-qnx*)
++ ;;
++ -nto*)
++ os=`echo $os | sed -e 's|nto|nto-qnx|'`
++ ;;
++ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
++ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
++ ;;
++ -mac*)
++ os=`echo $os | sed -e 's|mac|macos|'`
++ ;;
++ -linux-dietlibc)
++ os=-linux-dietlibc
++ ;;
++ -linux*)
++ os=`echo $os | sed -e 's|linux|linux-gnu|'`
++ ;;
++ -sunos5*)
++ os=`echo $os | sed -e 's|sunos5|solaris2|'`
++ ;;
++ -sunos6*)
++ os=`echo $os | sed -e 's|sunos6|solaris3|'`
++ ;;
++ -opened*)
++ os=-openedition
++ ;;
++ -os400*)
++ os=-os400
++ ;;
++ -wince*)
++ os=-wince
++ ;;
++ -osfrose*)
++ os=-osfrose
++ ;;
++ -osf*)
++ os=-osf
++ ;;
++ -utek*)
++ os=-bsd
++ ;;
++ -dynix*)
++ os=-bsd
++ ;;
++ -acis*)
++ os=-aos
++ ;;
++ -atheos*)
++ os=-atheos
++ ;;
++ -syllable*)
++ os=-syllable
++ ;;
++ -386bsd)
++ os=-bsd
++ ;;
++ -ctix* | -uts*)
++ os=-sysv
++ ;;
++ -nova*)
++ os=-rtmk-nova
++ ;;
++ -ns2 )
++ os=-nextstep2
++ ;;
++ -nsk*)
++ os=-nsk
++ ;;
++ # Preserve the version number of sinix5.
++ -sinix5.*)
++ os=`echo $os | sed -e 's|sinix|sysv|'`
++ ;;
++ -sinix*)
++ os=-sysv4
++ ;;
++ -tpf*)
++ os=-tpf
++ ;;
++ -triton*)
++ os=-sysv3
++ ;;
++ -oss*)
++ os=-sysv3
++ ;;
++ -svr4)
++ os=-sysv4
++ ;;
++ -svr3)
++ os=-sysv3
++ ;;
++ -sysvr4)
++ os=-sysv4
++ ;;
++ # This must come after -sysvr4.
++ -sysv*)
++ ;;
++ -ose*)
++ os=-ose
++ ;;
++ -es1800*)
++ os=-ose
++ ;;
++ -xenix)
++ os=-xenix
++ ;;
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ os=-mint
++ ;;
++ -aros*)
++ os=-aros
++ ;;
++ -kaos*)
++ os=-kaos
++ ;;
++ -zvmoe)
++ os=-zvmoe
++ ;;
++ -none)
++ ;;
++ *)
++ # Get rid of the `-' at the beginning of $os.
++ os=`echo $os | sed 's/[^-]*-//'`
++ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
++ exit 1
++ ;;
++esac
++else
++
++# Here we handle the default operating systems that come with various machines.
++# The value should be what the vendor currently ships out the door with their
++# machine or put another way, the most popular os provided with the machine.
++
++# Note that if you're going to try to match "-MANUFACTURER" here (say,
++# "-sun"), then you have to tell the case statement up towards the top
++# that MANUFACTURER isn't an operating system. Otherwise, code above
++# will signal an error saying that MANUFACTURER isn't an operating
++# system, and we'll never get to this point.
++
++case $basic_machine in
++ score-*)
++ os=-elf
++ ;;
++ spu-*)
++ os=-elf
++ ;;
++ *-acorn)
++ os=-riscix1.2
++ ;;
++ arm*-rebel)
++ os=-linux
++ ;;
++ arm*-semi)
++ os=-aout
++ ;;
++ c4x-* | tic4x-*)
++ os=-coff
++ ;;
++ # This must come before the *-dec entry.
++ pdp10-*)
++ os=-tops20
++ ;;
++ pdp11-*)
++ os=-none
++ ;;
++ *-dec | vax-*)
++ os=-ultrix4.2
++ ;;
++ m68*-apollo)
++ os=-domain
++ ;;
++ i386-sun)
++ os=-sunos4.0.2
++ ;;
++ m68000-sun)
++ os=-sunos3
++ # This also exists in the configure program, but was not the
++ # default.
++ # os=-sunos4
++ ;;
++ m68*-cisco)
++ os=-aout
++ ;;
++ mep-*)
++ os=-elf
++ ;;
++ mips*-cisco)
++ os=-elf
++ ;;
++ mips*-*)
++ os=-elf
++ ;;
++ or32-*)
++ os=-coff
++ ;;
++ *-tti) # must be before sparc entry or we get the wrong os.
++ os=-sysv3
++ ;;
++ sparc-* | *-sun)
++ os=-sunos4.1.1
++ ;;
++ *-be)
++ os=-beos
++ ;;
++ *-haiku)
++ os=-haiku
++ ;;
++ *-ibm)
++ os=-aix
++ ;;
++ *-knuth)
++ os=-mmixware
++ ;;
++ *-wec)
++ os=-proelf
++ ;;
++ *-winbond)
++ os=-proelf
++ ;;
++ *-oki)
++ os=-proelf
++ ;;
++ *-hp)
++ os=-hpux
++ ;;
++ *-hitachi)
++ os=-hiux
++ ;;
++ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
++ os=-sysv
++ ;;
++ *-cbm)
++ os=-amigaos
++ ;;
++ *-dg)
++ os=-dgux
++ ;;
++ *-dolphin)
++ os=-sysv3
++ ;;
++ m68k-ccur)
++ os=-rtu
++ ;;
++ m88k-omron*)
++ os=-luna
++ ;;
++ *-next )
++ os=-nextstep
++ ;;
++ *-sequent)
++ os=-ptx
++ ;;
++ *-crds)
++ os=-unos
++ ;;
++ *-ns)
++ os=-genix
++ ;;
++ i370-*)
++ os=-mvs
++ ;;
++ *-next)
++ os=-nextstep3
++ ;;
++ *-gould)
++ os=-sysv
++ ;;
++ *-highlevel)
++ os=-bsd
++ ;;
++ *-encore)
++ os=-bsd
++ ;;
++ *-sgi)
++ os=-irix
++ ;;
++ *-siemens)
++ os=-sysv4
++ ;;
++ *-masscomp)
++ os=-rtu
++ ;;
++ f30[01]-fujitsu | f700-fujitsu)
++ os=-uxpv
++ ;;
++ *-rom68k)
++ os=-coff
++ ;;
++ *-*bug)
++ os=-coff
++ ;;
++ *-apple)
++ os=-macos
++ ;;
++ *-atari*)
++ os=-mint
++ ;;
++ *)
++ os=-none
++ ;;
++esac
++fi
++
++# Here we handle the case where we know the os, and the CPU type, but not the
++# manufacturer. We pick the logical manufacturer.
++vendor=unknown
++case $basic_machine in
++ *-unknown)
++ case $os in
++ -riscix*)
++ vendor=acorn
++ ;;
++ -sunos*)
++ vendor=sun
++ ;;
++ -aix*)
++ vendor=ibm
++ ;;
++ -beos*)
++ vendor=be
++ ;;
++ -hpux*)
++ vendor=hp
++ ;;
++ -mpeix*)
++ vendor=hp
++ ;;
++ -hiux*)
++ vendor=hitachi
++ ;;
++ -unos*)
++ vendor=crds
++ ;;
++ -dgux*)
++ vendor=dg
++ ;;
++ -luna*)
++ vendor=omron
++ ;;
++ -genix*)
++ vendor=ns
++ ;;
++ -mvs* | -opened*)
++ vendor=ibm
++ ;;
++ -os400*)
++ vendor=ibm
++ ;;
++ -ptx*)
++ vendor=sequent
++ ;;
++ -tpf*)
++ vendor=ibm
++ ;;
++ -vxsim* | -vxworks* | -windiss*)
++ vendor=wrs
++ ;;
++ -aux*)
++ vendor=apple
++ ;;
++ -hms*)
++ vendor=hitachi
++ ;;
++ -mpw* | -macos*)
++ vendor=apple
++ ;;
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ vendor=atari
++ ;;
++ -vos*)
++ vendor=stratus
++ ;;
++ esac
++ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
++ ;;
++esac
++
++echo $basic_machine$os
++exit
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
+--- ./common/autoconf/build-aux/config.sub Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/build-aux/config.sub Wed Jul 01 21:51:50 2015 -0700
+@@ -1,14 +1,11 @@
+-#! /bin/sh
+-
++#!/bin/sh
+ #
+-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 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. Oracle designates this
+-# particular file as subject to the "Classpath" exception as provided
+-# by Oracle in the LICENSE file that accompanied this code.
++# 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
+@@ -25,1660 +22,43 @@
+ # questions.
+ #
+
+-# Configuration validation subroutine script.
+-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+-# Free Software Foundation, Inc.
++# This is a wrapper for the config.guess from autoconf. The latter
++# does not know about all of our platforms. Instead of patching the
++# autoconf system (which might easily get lost in a future update), we
++# wrap it and fix the broken property, if needed.
+
+-timestamp='2008-01-16'
++DIR=`dirname $0`
+
+-# This file is (in principle) common to ALL GNU software.
+-# The presence of a machine in this file suggests that SOME GNU software
+-# can handle that machine. It does not imply ALL GNU software can.
+-#
+-# This file is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
+-# (at your option) any later version.
+-#
+-# This program 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 for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
+-#
+-# As a special exception to the GNU General Public License, if you
+-# distribute this file as part of a program that contains a
+-# configuration script generated by Autoconf, you may include it under
+-# the same distribution terms that you use for the rest of that program.
++# First, filter out everything that doesn't begin with "aarch64-"
++if ! echo $* | grep '^aarch64-' >/dev/null ; then
++ . $DIR/autoconf-config.sub "$@"
++ # autoconf-config.sub exits, so we never reach here, but just in
++ # case we do:
++ exit
++fi
+
+-
+-# Please send patches to <config-patches@gnu.org>. Submit a context
+-# diff and a properly formatted ChangeLog entry.
+-#
+-# Configuration subroutine to validate and canonicalize a configuration type.
+-# Supply the specified configuration type as an argument.
+-# If it is invalid, we print an error message on stderr and exit with code 1.
+-# Otherwise, we print the canonical config type on stdout and succeed.
+-
+-# This file is supposed to be the same for all GNU packages
+-# and recognize all the CPU types, system types and aliases
+-# that are meaningful with *any* GNU software.
+-# Each package is responsible for reporting which valid configurations
+-# it does not support. The user should be able to distinguish
+-# a failure to support a valid configuration from a meaningless
+-# configuration.
+-
+-# The goal of this file is to map all the various variations of a given
+-# machine specification into a single specification in the form:
+-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+-# or in some cases, the newer four-part form:
+-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+-# It is wrong to echo any other type of specification.
+-
+-me=`echo "$0" | sed -e 's,.*/,,'`
+-
+-usage="\
+-Usage: $0 [OPTION] CPU-MFR-OPSYS
+- $0 [OPTION] ALIAS
+-
+-Canonicalize a configuration name.
+-
+-Operation modes:
+- -h, --help print this help, then exit
+- -t, --time-stamp print date of last modification, then exit
+- -v, --version print version number, then exit
+-
+-Report bugs and patches to <config-patches@gnu.org>."
+-
+-version="\
+-GNU config.sub ($timestamp)
+-
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+-
+-This is free software; see the source for copying conditions. There is NO
+-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+-
+-help="
+-Try \`$me --help' for more information."
+-
+-# Parse command line
+ while test $# -gt 0 ; do
+- case $1 in
+- --time-stamp | --time* | -t )
+- echo "$timestamp" ; exit ;;
+- --version | -v )
+- echo "$version" ; exit ;;
+- --help | --h* | -h )
+- echo "$usage"; exit ;;
+- -- ) # Stop option processing
+- shift; break ;;
+- - ) # Use stdin as input.
+- break ;;
+- -* )
+- echo "$me: invalid option $1$help"
+- exit 1 ;;
+-
+- *local*)
+- # First pass through any local machine types.
+- echo $1
+- exit ;;
+-
+- * )
+- break ;;
+- esac
++ case $1 in
++ -- ) # Stop option processing
++ shift; break ;;
++ aarch64-* )
++ config=`echo $1 | sed 's/^aarch64-/arm-/'`
++ sub_args="$sub_args $config"
++ shift; ;;
++ - ) # Use stdin as input.
++ sub_args="$sub_args $1"
++ shift; break ;;
++ * )
++ sub_args="$sub_args $1"
++ shift; ;;
++ esac
+ done
+
+-case $# in
+- 0) echo "$me: missing argument$help" >&2
+- exit 1;;
+- 1) ;;
+- *) echo "$me: too many arguments$help" >&2
+- exit 1;;
+-esac
++result=`. $DIR/autoconf-config.sub $sub_args "$@"`
++exitcode=$?
+
+-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+-# Here we must recognize all the valid KERNEL-OS combinations.
+-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+-case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+- storm-chaos* | os2-emx* | rtmk-nova*)
+- os=-$maybe_os
+- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+- ;;
+- *)
+- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+- if [ $basic_machine != $1 ]
+- then os=`echo $1 | sed 's/.*-/-/'`
+- else os=; fi
+- ;;
+-esac
++result=`echo $result | sed "s/^arm-/aarch64-/"`
+
+-### Let's recognize common machines as not being operating systems so
+-### that things like config.sub decstation-3100 work. We also
+-### recognize some manufacturers as not being operating systems, so we
+-### can provide default operating systems below.
+-case $os in
+- -sun*os*)
+- # Prevent following clause from handling this invalid input.
+- ;;
+- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple | -axis | -knuth | -cray)
+- os=
+- basic_machine=$1
+- ;;
+- -sim | -cisco | -oki | -wec | -winbond)
+- os=
+- basic_machine=$1
+- ;;
+- -scout)
+- ;;
+- -wrs)
+- os=-vxworks
+- basic_machine=$1
+- ;;
+- -chorusos*)
+- os=-chorusos
+- basic_machine=$1
+- ;;
+- -chorusrdb)
+- os=-chorusrdb
+- basic_machine=$1
+- ;;
+- -hiux*)
+- os=-hiuxwe2
+- ;;
+- -sco6)
+- os=-sco5v6
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco5)
+- os=-sco3.2v5
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco4)
+- os=-sco3.2v4
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco3.2.[4-9]*)
+- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco3.2v[4-9]*)
+- # Don't forget version if it is 3.2v4 or newer.
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco5v6*)
+- # Don't forget version if it is 3.2v4 or newer.
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -sco*)
+- os=-sco3.2v2
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -udk*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -isc)
+- os=-isc2.2
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -clix*)
+- basic_machine=clipper-intergraph
+- ;;
+- -isc*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+- ;;
+- -lynx*)
+- os=-lynxos
+- ;;
+- -ptx*)
+- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+- ;;
+- -windowsnt*)
+- os=`echo $os | sed -e 's/windowsnt/winnt/'`
+- ;;
+- -psos*)
+- os=-psos
+- ;;
+- -mint | -mint[0-9]*)
+- basic_machine=m68k-atari
+- os=-mint
+- ;;
+-esac
++echo $result
++exit $exitcode
+
+-# Decode aliases for certain CPU-COMPANY combinations.
+-case $basic_machine in
+- # Recognize the basic CPU types without company name.
+- # Some are omitted here because they have special meanings below.
+- 1750a | 580 \
+- | a29k \
+- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+- | am33_2.0 \
+- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+- | bfin \
+- | c4x | clipper \
+- | d10v | d30v | dlx | dsp16xx \
+- | fido | fr30 | frv \
+- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+- | i370 | i860 | i960 | ia64 \
+- | ip2k | iq2000 \
+- | m32c | m32r | m32rle | m68000 | m68k | m88k \
+- | maxq | mb | microblaze | mcore | mep \
+- | mips | mipsbe | mipseb | mipsel | mipsle \
+- | mips16 \
+- | mips64 | mips64el \
+- | mips64vr | mips64vrel \
+- | mips64orion | mips64orionel \
+- | mips64vr4100 | mips64vr4100el \
+- | mips64vr4300 | mips64vr4300el \
+- | mips64vr5000 | mips64vr5000el \
+- | mips64vr5900 | mips64vr5900el \
+- | mipsisa32 | mipsisa32el \
+- | mipsisa32r2 | mipsisa32r2el \
+- | mipsisa64 | mipsisa64el \
+- | mipsisa64r2 | mipsisa64r2el \
+- | mipsisa64sb1 | mipsisa64sb1el \
+- | mipsisa64sr71k | mipsisa64sr71kel \
+- | mipstx39 | mipstx39el \
+- | mn10200 | mn10300 \
+- | mt \
+- | msp430 \
+- | nios | nios2 \
+- | ns16k | ns32k \
+- | or32 \
+- | pdp10 | pdp11 | pj | pjl \
+- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+- | pyramid \
+- | score \
+- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+- | sh64 | sh64le \
+- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+- | spu | strongarm \
+- | tahoe | thumb | tic4x | tic80 | tron \
+- | v850 | v850e \
+- | we32k \
+- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+- | z8k)
+- basic_machine=$basic_machine-unknown
+- ;;
+- m6811 | m68hc11 | m6812 | m68hc12)
+- # Motorola 68HC11/12.
+- basic_machine=$basic_machine-unknown
+- os=-none
+- ;;
+- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+- ;;
+- ms1)
+- basic_machine=mt-unknown
+- ;;
+-
+- # We use `pc' rather than `unknown'
+- # because (1) that's what they normally are, and
+- # (2) the word "unknown" tends to confuse beginning users.
+- i*86 | x86_64)
+- basic_machine=$basic_machine-pc
+- ;;
+- # Object if more than one company name word.
+- *-*-*)
+- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+- exit 1
+- ;;
+- # Recognize the basic CPU types with company name.
+- 580-* \
+- | a29k-* \
+- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+- | avr-* | avr32-* \
+- | bfin-* | bs2000-* \
+- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+- | clipper-* | craynv-* | cydra-* \
+- | d10v-* | d30v-* | dlx-* \
+- | elxsi-* \
+- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+- | h8300-* | h8500-* \
+- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+- | i*86-* | i860-* | i960-* | ia64-* \
+- | ip2k-* | iq2000-* \
+- | m32c-* | m32r-* | m32rle-* \
+- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+- | m88110-* | m88k-* | maxq-* | mcore-* \
+- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+- | mips16-* \
+- | mips64-* | mips64el-* \
+- | mips64vr-* | mips64vrel-* \
+- | mips64orion-* | mips64orionel-* \
+- | mips64vr4100-* | mips64vr4100el-* \
+- | mips64vr4300-* | mips64vr4300el-* \
+- | mips64vr5000-* | mips64vr5000el-* \
+- | mips64vr5900-* | mips64vr5900el-* \
+- | mipsisa32-* | mipsisa32el-* \
+- | mipsisa32r2-* | mipsisa32r2el-* \
+- | mipsisa64-* | mipsisa64el-* \
+- | mipsisa64r2-* | mipsisa64r2el-* \
+- | mipsisa64sb1-* | mipsisa64sb1el-* \
+- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+- | mipstx39-* | mipstx39el-* \
+- | mmix-* \
+- | mt-* \
+- | msp430-* \
+- | nios-* | nios2-* \
+- | none-* | np1-* | ns16k-* | ns32k-* \
+- | orion-* \
+- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+- | pyramid-* \
+- | romp-* | rs6000-* \
+- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+- | sparclite-* \
+- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+- | tahoe-* | thumb-* \
+- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+- | tron-* \
+- | v850-* | v850e-* | vax-* \
+- | we32k-* \
+- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+- | xstormy16-* | xtensa*-* \
+- | ymp-* \
+- | z8k-*)
+- ;;
+- # Recognize the basic CPU types without company name, with glob match.
+- xtensa*)
+- basic_machine=$basic_machine-unknown
+- ;;
+- # Recognize the various machine names and aliases which stand
+- # for a CPU type and a company and sometimes even an OS.
+- 386bsd)
+- basic_machine=i386-unknown
+- os=-bsd
+- ;;
+- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+- basic_machine=m68000-att
+- ;;
+- 3b*)
+- basic_machine=we32k-att
+- ;;
+- a29khif)
+- basic_machine=a29k-amd
+- os=-udi
+- ;;
+- abacus)
+- basic_machine=abacus-unknown
+- ;;
+- adobe68k)
+- basic_machine=m68010-adobe
+- os=-scout
+- ;;
+- alliant | fx80)
+- basic_machine=fx80-alliant
+- ;;
+- altos | altos3068)
+- basic_machine=m68k-altos
+- ;;
+- am29k)
+- basic_machine=a29k-none
+- os=-bsd
+- ;;
+- amd64)
+- basic_machine=x86_64-pc
+- ;;
+- amd64-*)
+- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- amdahl)
+- basic_machine=580-amdahl
+- os=-sysv
+- ;;
+- amiga | amiga-*)
+- basic_machine=m68k-unknown
+- ;;
+- amigaos | amigados)
+- basic_machine=m68k-unknown
+- os=-amigaos
+- ;;
+- amigaunix | amix)
+- basic_machine=m68k-unknown
+- os=-sysv4
+- ;;
+- apollo68)
+- basic_machine=m68k-apollo
+- os=-sysv
+- ;;
+- apollo68bsd)
+- basic_machine=m68k-apollo
+- os=-bsd
+- ;;
+- aux)
+- basic_machine=m68k-apple
+- os=-aux
+- ;;
+- balance)
+- basic_machine=ns32k-sequent
+- os=-dynix
+- ;;
+- blackfin)
+- basic_machine=bfin-unknown
+- os=-linux
+- ;;
+- blackfin-*)
+- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
+- ;;
+- c90)
+- basic_machine=c90-cray
+- os=-unicos
+- ;;
+- convex-c1)
+- basic_machine=c1-convex
+- os=-bsd
+- ;;
+- convex-c2)
+- basic_machine=c2-convex
+- os=-bsd
+- ;;
+- convex-c32)
+- basic_machine=c32-convex
+- os=-bsd
+- ;;
+- convex-c34)
+- basic_machine=c34-convex
+- os=-bsd
+- ;;
+- convex-c38)
+- basic_machine=c38-convex
+- os=-bsd
+- ;;
+- cray | j90)
+- basic_machine=j90-cray
+- os=-unicos
+- ;;
+- craynv)
+- basic_machine=craynv-cray
+- os=-unicosmp
+- ;;
+- cr16)
+- basic_machine=cr16-unknown
+- os=-elf
+- ;;
+- crds | unos)
+- basic_machine=m68k-crds
+- ;;
+- crisv32 | crisv32-* | etraxfs*)
+- basic_machine=crisv32-axis
+- ;;
+- cris | cris-* | etrax*)
+- basic_machine=cris-axis
+- ;;
+- crx)
+- basic_machine=crx-unknown
+- os=-elf
+- ;;
+- da30 | da30-*)
+- basic_machine=m68k-da30
+- ;;
+- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+- basic_machine=mips-dec
+- ;;
+- decsystem10* | dec10*)
+- basic_machine=pdp10-dec
+- os=-tops10
+- ;;
+- decsystem20* | dec20*)
+- basic_machine=pdp10-dec
+- os=-tops20
+- ;;
+- delta | 3300 | motorola-3300 | motorola-delta \
+- | 3300-motorola | delta-motorola)
+- basic_machine=m68k-motorola
+- ;;
+- delta88)
+- basic_machine=m88k-motorola
+- os=-sysv3
+- ;;
+- djgpp)
+- basic_machine=i586-pc
+- os=-msdosdjgpp
+- ;;
+- dpx20 | dpx20-*)
+- basic_machine=rs6000-bull
+- os=-bosx
+- ;;
+- dpx2* | dpx2*-bull)
+- basic_machine=m68k-bull
+- os=-sysv3
+- ;;
+- ebmon29k)
+- basic_machine=a29k-amd
+- os=-ebmon
+- ;;
+- elxsi)
+- basic_machine=elxsi-elxsi
+- os=-bsd
+- ;;
+- encore | umax | mmax)
+- basic_machine=ns32k-encore
+- ;;
+- es1800 | OSE68k | ose68k | ose | OSE)
+- basic_machine=m68k-ericsson
+- os=-ose
+- ;;
+- fx2800)
+- basic_machine=i860-alliant
+- ;;
+- genix)
+- basic_machine=ns32k-ns
+- ;;
+- gmicro)
+- basic_machine=tron-gmicro
+- os=-sysv
+- ;;
+- go32)
+- basic_machine=i386-pc
+- os=-go32
+- ;;
+- h3050r* | hiux*)
+- basic_machine=hppa1.1-hitachi
+- os=-hiuxwe2
+- ;;
+- h8300hms)
+- basic_machine=h8300-hitachi
+- os=-hms
+- ;;
+- h8300xray)
+- basic_machine=h8300-hitachi
+- os=-xray
+- ;;
+- h8500hms)
+- basic_machine=h8500-hitachi
+- os=-hms
+- ;;
+- harris)
+- basic_machine=m88k-harris
+- os=-sysv3
+- ;;
+- hp300-*)
+- basic_machine=m68k-hp
+- ;;
+- hp300bsd)
+- basic_machine=m68k-hp
+- os=-bsd
+- ;;
+- hp300hpux)
+- basic_machine=m68k-hp
+- os=-hpux
+- ;;
+- hp3k9[0-9][0-9] | hp9[0-9][0-9])
+- basic_machine=hppa1.0-hp
+- ;;
+- hp9k2[0-9][0-9] | hp9k31[0-9])
+- basic_machine=m68000-hp
+- ;;
+- hp9k3[2-9][0-9])
+- basic_machine=m68k-hp
+- ;;
+- hp9k6[0-9][0-9] | hp6[0-9][0-9])
+- basic_machine=hppa1.0-hp
+- ;;
+- hp9k7[0-79][0-9] | hp7[0-79][0-9])
+- basic_machine=hppa1.1-hp
+- ;;
+- hp9k78[0-9] | hp78[0-9])
+- # FIXME: really hppa2.0-hp
+- basic_machine=hppa1.1-hp
+- ;;
+- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+- # FIXME: really hppa2.0-hp
+- basic_machine=hppa1.1-hp
+- ;;
+- hp9k8[0-9][13679] | hp8[0-9][13679])
+- basic_machine=hppa1.1-hp
+- ;;
+- hp9k8[0-9][0-9] | hp8[0-9][0-9])
+- basic_machine=hppa1.0-hp
+- ;;
+- hppa-next)
+- os=-nextstep3
+- ;;
+- hppaosf)
+- basic_machine=hppa1.1-hp
+- os=-osf
+- ;;
+- hppro)
+- basic_machine=hppa1.1-hp
+- os=-proelf
+- ;;
+- i370-ibm* | ibm*)
+- basic_machine=i370-ibm
+- ;;
+-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+- i*86v32)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv32
+- ;;
+- i*86v4*)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv4
+- ;;
+- i*86v)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-sysv
+- ;;
+- i*86sol2)
+- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+- os=-solaris2
+- ;;
+- i386mach)
+- basic_machine=i386-mach
+- os=-mach
+- ;;
+- i386-vsta | vsta)
+- basic_machine=i386-unknown
+- os=-vsta
+- ;;
+- iris | iris4d)
+- basic_machine=mips-sgi
+- case $os in
+- -irix*)
+- ;;
+- *)
+- os=-irix4
+- ;;
+- esac
+- ;;
+- isi68 | isi)
+- basic_machine=m68k-isi
+- os=-sysv
+- ;;
+- m68knommu)
+- basic_machine=m68k-unknown
+- os=-linux
+- ;;
+- m68knommu-*)
+- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
+- ;;
+- m88k-omron*)
+- basic_machine=m88k-omron
+- ;;
+- magnum | m3230)
+- basic_machine=mips-mips
+- os=-sysv
+- ;;
+- merlin)
+- basic_machine=ns32k-utek
+- os=-sysv
+- ;;
+- mingw32)
+- basic_machine=i386-pc
+- os=-mingw32
+- ;;
+- mingw32ce)
+- basic_machine=arm-unknown
+- os=-mingw32ce
+- ;;
+- miniframe)
+- basic_machine=m68000-convergent
+- ;;
+- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+- basic_machine=m68k-atari
+- os=-mint
+- ;;
+- mips3*-*)
+- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+- ;;
+- mips3*)
+- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+- ;;
+- monitor)
+- basic_machine=m68k-rom68k
+- os=-coff
+- ;;
+- morphos)
+- basic_machine=powerpc-unknown
+- os=-morphos
+- ;;
+- msdos)
+- basic_machine=i386-pc
+- os=-msdos
+- ;;
+- ms1-*)
+- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+- ;;
+- mvs)
+- basic_machine=i370-ibm
+- os=-mvs
+- ;;
+- ncr3000)
+- basic_machine=i486-ncr
+- os=-sysv4
+- ;;
+- netbsd386)
+- basic_machine=i386-unknown
+- os=-netbsd
+- ;;
+- netwinder)
+- basic_machine=armv4l-rebel
+- os=-linux
+- ;;
+- news | news700 | news800 | news900)
+- basic_machine=m68k-sony
+- os=-newsos
+- ;;
+- news1000)
+- basic_machine=m68030-sony
+- os=-newsos
+- ;;
+- news-3600 | risc-news)
+- basic_machine=mips-sony
+- os=-newsos
+- ;;
+- necv70)
+- basic_machine=v70-nec
+- os=-sysv
+- ;;
+- next | m*-next )
+- basic_machine=m68k-next
+- case $os in
+- -nextstep* )
+- ;;
+- -ns2*)
+- os=-nextstep2
+- ;;
+- *)
+- os=-nextstep3
+- ;;
+- esac
+- ;;
+- nh3000)
+- basic_machine=m68k-harris
+- os=-cxux
+- ;;
+- nh[45]000)
+- basic_machine=m88k-harris
+- os=-cxux
+- ;;
+- nindy960)
+- basic_machine=i960-intel
+- os=-nindy
+- ;;
+- mon960)
+- basic_machine=i960-intel
+- os=-mon960
+- ;;
+- nonstopux)
+- basic_machine=mips-compaq
+- os=-nonstopux
+- ;;
+- np1)
+- basic_machine=np1-gould
+- ;;
+- nsr-tandem)
+- basic_machine=nsr-tandem
+- ;;
+- op50n-* | op60c-*)
+- basic_machine=hppa1.1-oki
+- os=-proelf
+- ;;
+- openrisc | openrisc-*)
+- basic_machine=or32-unknown
+- ;;
+- os400)
+- basic_machine=powerpc-ibm
+- os=-os400
+- ;;
+- OSE68000 | ose68000)
+- basic_machine=m68000-ericsson
+- os=-ose
+- ;;
+- os68k)
+- basic_machine=m68k-none
+- os=-os68k
+- ;;
+- pa-hitachi)
+- basic_machine=hppa1.1-hitachi
+- os=-hiuxwe2
+- ;;
+- paragon)
+- basic_machine=i860-intel
+- os=-osf
+- ;;
+- parisc)
+- basic_machine=hppa-unknown
+- os=-linux
+- ;;
+- parisc-*)
+- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+- os=-linux
+- ;;
+- pbd)
+- basic_machine=sparc-tti
+- ;;
+- pbb)
+- basic_machine=m68k-tti
+- ;;
+- pc532 | pc532-*)
+- basic_machine=ns32k-pc532
+- ;;
+- pc98)
+- basic_machine=i386-pc
+- ;;
+- pc98-*)
+- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentium | p5 | k5 | k6 | nexgen | viac3)
+- basic_machine=i586-pc
+- ;;
+- pentiumpro | p6 | 6x86 | athlon | athlon_*)
+- basic_machine=i686-pc
+- ;;
+- pentiumii | pentium2 | pentiumiii | pentium3)
+- basic_machine=i686-pc
+- ;;
+- pentium4)
+- basic_machine=i786-pc
+- ;;
+- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentiumpro-* | p6-* | 6x86-* | athlon-*)
+- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pentium4-*)
+- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- pn)
+- basic_machine=pn-gould
+- ;;
+- power) basic_machine=power-ibm
+- ;;
+- ppc) basic_machine=powerpc-unknown
+- ;;
+- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ppcle | powerpclittle | ppc-le | powerpc-little)
+- basic_machine=powerpcle-unknown
+- ;;
+- ppcle-* | powerpclittle-*)
+- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ppc64) basic_machine=powerpc64-unknown
+- ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+- basic_machine=powerpc64le-unknown
+- ;;
+- ppc64le-* | powerpc64little-*)
+- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+- ;;
+- ps2)
+- basic_machine=i386-ibm
+- ;;
+- pw32)
+- basic_machine=i586-unknown
+- os=-pw32
+- ;;
+- rdos)
+- basic_machine=i386-pc
+- os=-rdos
+- ;;
+- rom68k)
+- basic_machine=m68k-rom68k
+- os=-coff
+- ;;
+- rm[46]00)
+- basic_machine=mips-siemens
+- ;;
+- rtpc | rtpc-*)
+- basic_machine=romp-ibm
+- ;;
+- s390 | s390-*)
+- basic_machine=s390-ibm
+- ;;
+- s390x | s390x-*)
+- basic_machine=s390x-ibm
+- ;;
+- sa29200)
+- basic_machine=a29k-amd
+- os=-udi
+- ;;
+- sb1)
+- basic_machine=mipsisa64sb1-unknown
+- ;;
+- sb1el)
+- basic_machine=mipsisa64sb1el-unknown
+- ;;
+- sde)
+- basic_machine=mipsisa32-sde
+- os=-elf
+- ;;
+- sei)
+- basic_machine=mips-sei
+- os=-seiux
+- ;;
+- sequent)
+- basic_machine=i386-sequent
+- ;;
+- sh)
+- basic_machine=sh-hitachi
+- os=-hms
+- ;;
+- sh5el)
+- basic_machine=sh5le-unknown
+- ;;
+- sh64)
+- basic_machine=sh64-unknown
+- ;;
+- sparclite-wrs | simso-wrs)
+- basic_machine=sparclite-wrs
+- os=-vxworks
+- ;;
+- sps7)
+- basic_machine=m68k-bull
+- os=-sysv2
+- ;;
+- spur)
+- basic_machine=spur-unknown
+- ;;
+- st2000)
+- basic_machine=m68k-tandem
+- ;;
+- stratus)
+- basic_machine=i860-stratus
+- os=-sysv4
+- ;;
+- sun2)
+- basic_machine=m68000-sun
+- ;;
+- sun2os3)
+- basic_machine=m68000-sun
+- os=-sunos3
+- ;;
+- sun2os4)
+- basic_machine=m68000-sun
+- os=-sunos4
+- ;;
+- sun3os3)
+- basic_machine=m68k-sun
+- os=-sunos3
+- ;;
+- sun3os4)
+- basic_machine=m68k-sun
+- os=-sunos4
+- ;;
+- sun4os3)
+- basic_machine=sparc-sun
+- os=-sunos3
+- ;;
+- sun4os4)
+- basic_machine=sparc-sun
+- os=-sunos4
+- ;;
+- sun4sol2)
+- basic_machine=sparc-sun
+- os=-solaris2
+- ;;
+- sun3 | sun3-*)
+- basic_machine=m68k-sun
+- ;;
+- sun4)
+- basic_machine=sparc-sun
+- ;;
+- sun386 | sun386i | roadrunner)
+- basic_machine=i386-sun
+- ;;
+- sv1)
+- basic_machine=sv1-cray
+- os=-unicos
+- ;;
+- symmetry)
+- basic_machine=i386-sequent
+- os=-dynix
+- ;;
+- t3e)
+- basic_machine=alphaev5-cray
+- os=-unicos
+- ;;
+- t90)
+- basic_machine=t90-cray
+- os=-unicos
+- ;;
+- tic54x | c54x*)
+- basic_machine=tic54x-unknown
+- os=-coff
+- ;;
+- tic55x | c55x*)
+- basic_machine=tic55x-unknown
+- os=-coff
+- ;;
+- tic6x | c6x*)
+- basic_machine=tic6x-unknown
+- os=-coff
+- ;;
+- tile*)
+- basic_machine=tile-unknown
+- os=-linux-gnu
+- ;;
+- tx39)
+- basic_machine=mipstx39-unknown
+- ;;
+- tx39el)
+- basic_machine=mipstx39el-unknown
+- ;;
+- toad1)
+- basic_machine=pdp10-xkl
+- os=-tops20
+- ;;
+- tower | tower-32)
+- basic_machine=m68k-ncr
+- ;;
+- tpf)
+- basic_machine=s390x-ibm
+- os=-tpf
+- ;;
+- udi29k)
+- basic_machine=a29k-amd
+- os=-udi
+- ;;
+- ultra3)
+- basic_machine=a29k-nyu
+- os=-sym1
+- ;;
+- v810 | necv810)
+- basic_machine=v810-nec
+- os=-none
+- ;;
+- vaxv)
+- basic_machine=vax-dec
+- os=-sysv
+- ;;
+- vms)
+- basic_machine=vax-dec
+- os=-vms
+- ;;
+- vpp*|vx|vx-*)
+- basic_machine=f301-fujitsu
+- ;;
+- vxworks960)
+- basic_machine=i960-wrs
+- os=-vxworks
+- ;;
+- vxworks68)
+- basic_machine=m68k-wrs
+- os=-vxworks
+- ;;
+- vxworks29k)
+- basic_machine=a29k-wrs
+- os=-vxworks
+- ;;
+- w65*)
+- basic_machine=w65-wdc
+- os=-none
+- ;;
+- w89k-*)
+- basic_machine=hppa1.1-winbond
+- os=-proelf
+- ;;
+- xbox)
+- basic_machine=i686-pc
+- os=-mingw32
+- ;;
+- xps | xps100)
+- basic_machine=xps100-honeywell
+- ;;
+- ymp)
+- basic_machine=ymp-cray
+- os=-unicos
+- ;;
+- z8k-*-coff)
+- basic_machine=z8k-unknown
+- os=-sim
+- ;;
+- none)
+- basic_machine=none-none
+- os=-none
+- ;;
+-
+-# Here we handle the default manufacturer of certain CPU types. It is in
+-# some cases the only manufacturer, in others, it is the most popular.
+- w89k)
+- basic_machine=hppa1.1-winbond
+- ;;
+- op50n)
+- basic_machine=hppa1.1-oki
+- ;;
+- op60c)
+- basic_machine=hppa1.1-oki
+- ;;
+- romp)
+- basic_machine=romp-ibm
+- ;;
+- mmix)
+- basic_machine=mmix-knuth
+- ;;
+- rs6000)
+- basic_machine=rs6000-ibm
+- ;;
+- vax)
+- basic_machine=vax-dec
+- ;;
+- pdp10)
+- # there are many clones, so DEC is not a safe bet
+- basic_machine=pdp10-unknown
+- ;;
+- pdp11)
+- basic_machine=pdp11-dec
+- ;;
+- we32k)
+- basic_machine=we32k-att
+- ;;
+- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+- basic_machine=sh-unknown
+- ;;
+- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+- basic_machine=sparc-sun
+- ;;
+- cydra)
+- basic_machine=cydra-cydrome
+- ;;
+- orion)
+- basic_machine=orion-highlevel
+- ;;
+- orion105)
+- basic_machine=clipper-highlevel
+- ;;
+- mac | mpw | mac-mpw)
+- basic_machine=m68k-apple
+- ;;
+- pmac | pmac-mpw)
+- basic_machine=powerpc-apple
+- ;;
+- *-unknown)
+- # Make sure to match an already-canonicalized machine name.
+- ;;
+- *)
+- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+- exit 1
+- ;;
+-esac
+-
+-# Here we canonicalize certain aliases for manufacturers.
+-case $basic_machine in
+- *-digital*)
+- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+- ;;
+- *-commodore*)
+- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+- ;;
+- *)
+- ;;
+-esac
+-
+-# Decode manufacturer-specific aliases for certain operating systems.
+-
+-if [ x"$os" != x"" ]
+-then
+-case $os in
+- # First match some system type aliases
+- # that might get confused with valid system types.
+- # -solaris* is a basic system type, with this one exception.
+- -solaris1 | -solaris1.*)
+- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+- ;;
+- -solaris)
+- os=-solaris2
+- ;;
+- -svr4*)
+- os=-sysv4
+- ;;
+- -unixware*)
+- os=-sysv4.2uw
+- ;;
+- -gnu/linux*)
+- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+- ;;
+- # First accept the basic system types.
+- # The portable systems comes first.
+- # Each alternative MUST END IN A *, to match a version number.
+- # -sysv* is not here because it comes later, after sysvr4.
+- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+- | -aos* \
+- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+- | -openbsd* | -solidbsd* \
+- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+- | -chorusos* | -chorusrdb* \
+- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+- | -uxpv* | -beos* | -mpeix* | -udk* \
+- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+- # Remember, each alternative MUST END IN *, to match a version number.
+- ;;
+- -qnx*)
+- case $basic_machine in
+- x86-* | i*86-*)
+- ;;
+- *)
+- os=-nto$os
+- ;;
+- esac
+- ;;
+- -nto-qnx*)
+- ;;
+- -nto*)
+- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+- ;;
+- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+- ;;
+- -mac*)
+- os=`echo $os | sed -e 's|mac|macos|'`
+- ;;
+- -linux-dietlibc)
+- os=-linux-dietlibc
+- ;;
+- -linux*)
+- os=`echo $os | sed -e 's|linux|linux-gnu|'`
+- ;;
+- -sunos5*)
+- os=`echo $os | sed -e 's|sunos5|solaris2|'`
+- ;;
+- -sunos6*)
+- os=`echo $os | sed -e 's|sunos6|solaris3|'`
+- ;;
+- -opened*)
+- os=-openedition
+- ;;
+- -os400*)
+- os=-os400
+- ;;
+- -wince*)
+- os=-wince
+- ;;
+- -osfrose*)
+- os=-osfrose
+- ;;
+- -osf*)
+- os=-osf
+- ;;
+- -utek*)
+- os=-bsd
+- ;;
+- -dynix*)
+- os=-bsd
+- ;;
+- -acis*)
+- os=-aos
+- ;;
+- -atheos*)
+- os=-atheos
+- ;;
+- -syllable*)
+- os=-syllable
+- ;;
+- -386bsd)
+- os=-bsd
+- ;;
+- -ctix* | -uts*)
+- os=-sysv
+- ;;
+- -nova*)
+- os=-rtmk-nova
+- ;;
+- -ns2 )
+- os=-nextstep2
+- ;;
+- -nsk*)
+- os=-nsk
+- ;;
+- # Preserve the version number of sinix5.
+- -sinix5.*)
+- os=`echo $os | sed -e 's|sinix|sysv|'`
+- ;;
+- -sinix*)
+- os=-sysv4
+- ;;
+- -tpf*)
+- os=-tpf
+- ;;
+- -triton*)
+- os=-sysv3
+- ;;
+- -oss*)
+- os=-sysv3
+- ;;
+- -svr4)
+- os=-sysv4
+- ;;
+- -svr3)
+- os=-sysv3
+- ;;
+- -sysvr4)
+- os=-sysv4
+- ;;
+- # This must come after -sysvr4.
+- -sysv*)
+- ;;
+- -ose*)
+- os=-ose
+- ;;
+- -es1800*)
+- os=-ose
+- ;;
+- -xenix)
+- os=-xenix
+- ;;
+- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+- os=-mint
+- ;;
+- -aros*)
+- os=-aros
+- ;;
+- -kaos*)
+- os=-kaos
+- ;;
+- -zvmoe)
+- os=-zvmoe
+- ;;
+- -none)
+- ;;
+- *)
+- # Get rid of the `-' at the beginning of $os.
+- os=`echo $os | sed 's/[^-]*-//'`
+- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+- exit 1
+- ;;
+-esac
+-else
+-
+-# Here we handle the default operating systems that come with various machines.
+-# The value should be what the vendor currently ships out the door with their
+-# machine or put another way, the most popular os provided with the machine.
+-
+-# Note that if you're going to try to match "-MANUFACTURER" here (say,
+-# "-sun"), then you have to tell the case statement up towards the top
+-# that MANUFACTURER isn't an operating system. Otherwise, code above
+-# will signal an error saying that MANUFACTURER isn't an operating
+-# system, and we'll never get to this point.
+-
+-case $basic_machine in
+- score-*)
+- os=-elf
+- ;;
+- spu-*)
+- os=-elf
+- ;;
+- *-acorn)
+- os=-riscix1.2
+- ;;
+- arm*-rebel)
+- os=-linux
+- ;;
+- arm*-semi)
+- os=-aout
+- ;;
+- c4x-* | tic4x-*)
+- os=-coff
+- ;;
+- # This must come before the *-dec entry.
+- pdp10-*)
+- os=-tops20
+- ;;
+- pdp11-*)
+- os=-none
+- ;;
+- *-dec | vax-*)
+- os=-ultrix4.2
+- ;;
+- m68*-apollo)
+- os=-domain
+- ;;
+- i386-sun)
+- os=-sunos4.0.2
+- ;;
+- m68000-sun)
+- os=-sunos3
+- # This also exists in the configure program, but was not the
+- # default.
+- # os=-sunos4
+- ;;
+- m68*-cisco)
+- os=-aout
+- ;;
+- mep-*)
+- os=-elf
+- ;;
+- mips*-cisco)
+- os=-elf
+- ;;
+- mips*-*)
+- os=-elf
+- ;;
+- or32-*)
+- os=-coff
+- ;;
+- *-tti) # must be before sparc entry or we get the wrong os.
+- os=-sysv3
+- ;;
+- sparc-* | *-sun)
+- os=-sunos4.1.1
+- ;;
+- *-be)
+- os=-beos
+- ;;
+- *-haiku)
+- os=-haiku
+- ;;
+- *-ibm)
+- os=-aix
+- ;;
+- *-knuth)
+- os=-mmixware
+- ;;
+- *-wec)
+- os=-proelf
+- ;;
+- *-winbond)
+- os=-proelf
+- ;;
+- *-oki)
+- os=-proelf
+- ;;
+- *-hp)
+- os=-hpux
+- ;;
+- *-hitachi)
+- os=-hiux
+- ;;
+- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+- os=-sysv
+- ;;
+- *-cbm)
+- os=-amigaos
+- ;;
+- *-dg)
+- os=-dgux
+- ;;
+- *-dolphin)
+- os=-sysv3
+- ;;
+- m68k-ccur)
+- os=-rtu
+- ;;
+- m88k-omron*)
+- os=-luna
+- ;;
+- *-next )
+- os=-nextstep
+- ;;
+- *-sequent)
+- os=-ptx
+- ;;
+- *-crds)
+- os=-unos
+- ;;
+- *-ns)
+- os=-genix
+- ;;
+- i370-*)
+- os=-mvs
+- ;;
+- *-next)
+- os=-nextstep3
+- ;;
+- *-gould)
+- os=-sysv
+- ;;
+- *-highlevel)
+- os=-bsd
+- ;;
+- *-encore)
+- os=-bsd
+- ;;
+- *-sgi)
+- os=-irix
+- ;;
+- *-siemens)
+- os=-sysv4
+- ;;
+- *-masscomp)
+- os=-rtu
+- ;;
+- f30[01]-fujitsu | f700-fujitsu)
+- os=-uxpv
+- ;;
+- *-rom68k)
+- os=-coff
+- ;;
+- *-*bug)
+- os=-coff
+- ;;
+- *-apple)
+- os=-macos
+- ;;
+- *-atari*)
+- os=-mint
+- ;;
+- *)
+- os=-none
+- ;;
+-esac
+-fi
+-
+-# Here we handle the case where we know the os, and the CPU type, but not the
+-# manufacturer. We pick the logical manufacturer.
+-vendor=unknown
+-case $basic_machine in
+- *-unknown)
+- case $os in
+- -riscix*)
+- vendor=acorn
+- ;;
+- -sunos*)
+- vendor=sun
+- ;;
+- -aix*)
+- vendor=ibm
+- ;;
+- -beos*)
+- vendor=be
+- ;;
+- -hpux*)
+- vendor=hp
+- ;;
+- -mpeix*)
+- vendor=hp
+- ;;
+- -hiux*)
+- vendor=hitachi
+- ;;
+- -unos*)
+- vendor=crds
+- ;;
+- -dgux*)
+- vendor=dg
+- ;;
+- -luna*)
+- vendor=omron
+- ;;
+- -genix*)
+- vendor=ns
+- ;;
+- -mvs* | -opened*)
+- vendor=ibm
+- ;;
+- -os400*)
+- vendor=ibm
+- ;;
+- -ptx*)
+- vendor=sequent
+- ;;
+- -tpf*)
+- vendor=ibm
+- ;;
+- -vxsim* | -vxworks* | -windiss*)
+- vendor=wrs
+- ;;
+- -aux*)
+- vendor=apple
+- ;;
+- -hms*)
+- vendor=hitachi
+- ;;
+- -mpw* | -macos*)
+- vendor=apple
+- ;;
+- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+- vendor=atari
+- ;;
+- -vos*)
+- vendor=stratus
+- ;;
+- esac
+- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+- ;;
+-esac
+-
+-echo $basic_machine$os
+-exit
+-
+-# Local variables:
+-# eval: (add-hook 'write-file-hooks 'time-stamp)
+-# time-stamp-start: "timestamp='"
+-# time-stamp-format: "%:y-%02m-%02d"
+-# time-stamp-end: "'"
+-# End:
+--- ./common/autoconf/configure Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/configure Wed Jul 01 21:51:50 2015 -0700
+@@ -28,6 +28,10 @@
+ exit 1
+ fi
+
++# Force autoconf to use bash. This also means we must disable autoconf re-exec.
++export CONFIG_SHELL=$BASH
++export _as_can_reexec=no
++
+ CONFIGURE_COMMAND_LINE="$@"
+ conf_script_dir=`dirname $0`
+
+--- ./common/autoconf/configure.ac Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/configure.ac Wed Jul 01 21:51:50 2015 -0700
+@@ -53,6 +53,7 @@
+
+ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
+ AC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
++AC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
+
+ # This line needs to be here, verbatim, after all includes and the dummy hook
+ # definitions. It is replaced with custom functionality when building
+@@ -237,6 +238,7 @@
+
+ # Create the actual output files. Now the main work of configure is done.
+ AC_OUTPUT
++CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
+
+ # Try to move the config.log file to the output directory.
+ if test -e ./config.log; then
+--- ./common/autoconf/generated-configure.sh Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/generated-configure.sh Wed Jul 01 21:51:50 2015 -0700
+@@ -711,11 +711,11 @@
+ COMPILER_NAME
+ JT_HOME
+ JTREGEXE
+-LIPO
+ ac_ct_OBJDUMP
+ OBJDUMP
+ ac_ct_OBJCOPY
+ OBJCOPY
++OTOOL
+ MCS
+ STRIP
+ GNM
+@@ -762,6 +762,9 @@
+ PROPER_COMPILER_CC
+ POTENTIAL_CC
+ TOOLS_DIR_CC
++SDKPATH
++XCODEBUILD
++SET_DEVELOPER_DIR
+ BUILD_LD
+ BUILD_CXX
+ BUILD_CC
+@@ -797,6 +800,7 @@
+ JAVA_CHECK
+ JAVAC_CHECK
+ COOKED_BUILD_NUMBER
++COOKED_JDK_UPDATE_VERSION
+ JDK_VERSION
+ COPYRIGHT_YEAR
+ MACOSX_BUNDLE_ID_BASE
+@@ -834,7 +838,6 @@
+ STAT
+ HG
+ READELF
+-OTOOL
+ LDD
+ ZIP
+ UNZIP
+@@ -1006,6 +1009,7 @@
+ with_target_bits
+ with_sys_root
+ with_tools_dir
++with_xcode_path
+ with_devkit
+ enable_openjdk_only
+ with_jdk_variant
+@@ -1752,6 +1756,8 @@
+ cross-compiling)
+ --with-tools-dir search this directory for compilers and tools (for
+ cross-compiling)
++ --with-xcode-path explicit path to Xcode 4 (generally for building on
++ 10.9 and later)
+ --with-devkit use this directory as base for tools-dir and
+ sys-root (for cross-compiling)
+ --with-jdk-variant JDK variant to build (normal) [normal]
+@@ -3108,7 +3114,7 @@
+
+ # Include these first...
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -3624,7 +3630,7 @@
+
+
+ #
+-# Copyright (c) 2011, 2012, 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
+@@ -3764,7 +3770,7 @@
+
+
+ #
+-# Copyright (c) 2011, 2012, 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
+@@ -3866,13 +3872,14 @@
+
+
+
++
+ # This line needs to be here, verbatim, after all includes and the dummy hook
+ # definitions. It is replaced with custom functionality when building
+ # custom sources.
+ #CUSTOM_AUTOCONF_INCLUDE
+
+ # Do not change or remove the following line, it is needed for consistency checks:
+-DATE_WHEN_GENERATED=1416326200
++DATE_WHEN_GENERATED=1433258489
+
+ ###############################################################################
+ #
+@@ -6822,6 +6829,12 @@
+ VAR_CPU_BITS=32
+ VAR_CPU_ENDIAN=little
+ ;;
++ aarch64)
++ VAR_CPU=aarch64
++ VAR_CPU_ARCH=aarch64
++ VAR_CPU_BITS=64
++ VAR_CPU_ENDIAN=little
++ ;;
+ powerpc)
+ VAR_CPU=ppc
+ VAR_CPU_ARCH=ppc
+@@ -6953,6 +6966,12 @@
+ VAR_CPU_BITS=32
+ VAR_CPU_ENDIAN=little
+ ;;
++ aarch64)
++ VAR_CPU=aarch64
++ VAR_CPU_ARCH=aarch64
++ VAR_CPU_BITS=64
++ VAR_CPU_ENDIAN=little
++ ;;
+ powerpc)
+ VAR_CPU=ppc
+ VAR_CPU_ARCH=ppc
+@@ -7207,7 +7226,8 @@
+
+ # ZERO_ARCHDEF is used to enable architecture-specific code
+ case "${OPENJDK_TARGET_CPU}" in
+- ppc*) ZERO_ARCHDEF=PPC ;;
++ ppc) ZERO_ARCHDEF=PPC32 ;;
++ ppc64) ZERO_ARCHDEF=PPC64 ;;
+ s390*) ZERO_ARCHDEF=S390 ;;
+ sparc*) ZERO_ARCHDEF=SPARC ;;
+ x86_64*) ZERO_ARCHDEF=AMD64 ;;
+@@ -7246,8 +7266,8 @@
+ WINDOWS_ENV_VENDOR='cygwin'
+ WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
+
+- CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.`
+- if test "x$CYGWIN_VERSION_OK" = x; then
++ CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.0-6'`
++ if test "x$CYGWIN_VERSION_OLD" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&5
+ $as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&6;}
+ as_fn_error $? "Cannot continue" "$LINENO" 5
+@@ -7603,6 +7623,15 @@
+ fi
+
+
++ # Xcode version will be validated later
++
++# Check whether --with-xcode-path was given.
++if test "${with_xcode_path+set}" = set; then :
++ withval=$with_xcode_path; XCODE_PATH=$with_xcode_path
++
++fi
++
++
+
+ # Check whether --with-devkit was given.
+ if test "${with_devkit+set}" = set; then :
+@@ -7957,10 +7986,13 @@
+ if test "x$VAR_CPU" = xppc64 ; then
+ INCLUDE_SA=false
+ fi
++ if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
++ INCLUDE_SA=false
++ fi
+
+
+ if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+- MACOSX_UNIVERSAL="true"
++ MACOSX_UNIVERSAL="false"
+ fi
+
+
+@@ -10321,49 +10353,6 @@
+ # We can build without it.
+ LDD="true"
+ fi
+- # Extract the first word of "otool", so it can be a program name with args.
+-set dummy otool; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_path_OTOOL+:} false; then :
+- $as_echo_n "(cached) " >&6
+-else
+- case $OTOOL in
+- [\\/]* | ?:[\\/]*)
+- ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path.
+- ;;
+- *)
+- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- for ac_exec_ext in '' $ac_executable_extensions; do
+- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext"
+- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
+- fi
+-done
+- done
+-IFS=$as_save_IFS
+-
+- ;;
+-esac
+-fi
+-OTOOL=$ac_cv_path_OTOOL
+-if test -n "$OTOOL"; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+-$as_echo "$OTOOL" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+- if test "x$OTOOL" = "x"; then
+- OTOOL="true"
+- fi
+ for ac_prog in readelf greadelf
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+@@ -11306,6 +11295,12 @@
+ fi
+
+
++# The cooked update version used to encode trailing letters in the update
++ # version into a trailing number. That is no longer needed, but need to
++ # keep the format in 8u for compatibility.
++ COOKED_JDK_UPDATE_VERSION="${JDK_UPDATE_VERSION}0"
++
++
+ COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
+
+
+@@ -16791,7 +16786,7 @@
+
+
+ # jtreg win32 script works for everybody
+- JTREGEXE="$JT_HOME/win32/bin/jtreg"
++ JTREGEXE="$JT_HOME/bin/jtreg"
+
+ if test ! -f "$JTREGEXE"; then
+ as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
+@@ -19247,6 +19242,132 @@
+ PATH=$TOOLS_DIR:$PATH
+ fi
+
++ # Before we locate the compilers, we need to sanitize the Xcode build environment
++ if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
++ # determine path to Xcode developer directory
++ # can be empty in which case all the tools will rely on a sane Xcode 4 installation
++ SET_DEVELOPER_DIR=
++
++ if test -n "$XCODE_PATH"; then
++ DEVELOPER_DIR="$XCODE_PATH"/Contents/Developer
++ fi
++
++ # DEVELOPER_DIR could also be provided directly
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining if we need to set DEVELOPER_DIR" >&5
++$as_echo_n "checking Determining if we need to set DEVELOPER_DIR... " >&6; }
++ if test -n "$DEVELOPER_DIR"; then
++ if test ! -d "$DEVELOPER_DIR"; then
++ as_fn_error $? "Xcode Developer path does not exist: $DEVELOPER_DIR, please provide a path to the Xcode 4 application bundle using --with-xcode-path" "$LINENO" 5
++ fi
++ if test ! -f "$DEVELOPER_DIR"/usr/bin/xcodebuild; then
++ as_fn_error $? "Xcode Developer path is not valid: $DEVELOPER_DIR, it must point to Contents/Developer inside an Xcode application bundle" "$LINENO" 5
++ fi
++ # make it visible to all the tools immediately
++ export DEVELOPER_DIR
++ SET_DEVELOPER_DIR="export DEVELOPER_DIR := $DEVELOPER_DIR"
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEVELOPER_DIR)" >&5
++$as_echo "yes ($DEVELOPER_DIR)" >&6; }
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ fi
++
++
++ # Extract the first word of "xcodebuild", so it can be a program name with args.
++set dummy xcodebuild; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_XCODEBUILD+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $XCODEBUILD in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_path_XCODEBUILD="$as_dir/$ac_word$ac_exec_ext"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++ ;;
++esac
++fi
++XCODEBUILD=$ac_cv_path_XCODEBUILD
++if test -n "$XCODEBUILD"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5
++$as_echo "$XCODEBUILD" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++ if test -z "$XCODEBUILD"; then
++ as_fn_error $? "The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X" "$LINENO" 5
++ fi
++
++ # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later
++ XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'`
++ XC_VERSION_PARTS=( ${XCODE_VERSION//./ } )
++ if test ! "${XC_VERSION_PARTS[0]}" = "4"; then
++ as_fn_error $? "Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select." "$LINENO" 5
++ fi
++
++ # Some versions of Xcode 5 command line tools install gcc and g++ as symlinks to
++ # clang and clang++, which will break the build. So handle that here if we need to.
++ if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then
++ # use xcrun to find the real gcc and add it's directory to PATH
++ # then autoconf magic will find it
++ { $as_echo "$as_me:${as_lineno-$LINENO}: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&5
++$as_echo "$as_me: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&6;}
++ XCODE_BIN_PATH=$(dirname `xcrun -find gcc`)
++ PATH="$XCODE_BIN_PATH":$PATH
++ fi
++
++ # Determine appropriate SDKPATH, don't use SDKROOT as it interferes with the stub tools
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining Xcode SDK path" >&5
++$as_echo_n "checking Determining Xcode SDK path... " >&6; }
++ # allow SDKNAME to be set to override the default SDK selection
++ SDKPATH=`"$XCODEBUILD" -sdk ${SDKNAME:-macosx} -version | grep '^Path: ' | sed 's/Path: //'`
++ if test -n "$SDKPATH"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKPATH" >&5
++$as_echo "$SDKPATH" >&6; }
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: (none, will use system headers and frameworks)" >&5
++$as_echo "(none, will use system headers and frameworks)" >&6; }
++ fi
++
++
++ # Perform a basic sanity test
++ if test ! -f "$SDKPATH/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
++ as_fn_error $? "Unable to find required framework headers, provide a valid path to Xcode 4 using --with-xcode-path" "$LINENO" 5
++ fi
++
++ # if SDKPATH is non-empty then we need to add -isysroot and -iframework for gcc and g++
++ if test -n "$SDKPATH"; then
++ # We need -isysroot <path> and -iframework<path>/System/Library/Frameworks
++ CFLAGS_JDK="${CFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\""
++ CXXFLAGS_JDK="${CXXFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\""
++ LDFLAGS_JDK="${LDFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\""
++ fi
++
++ # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
++ # setting this here means it doesn't have to be peppered throughout the forest
++ CFLAGS_JDK="$CFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\""
++ CXXFLAGS_JDK="$CXXFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\""
++ LDFLAGS_JDK="$LDFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\""
++ fi
+
+ ### Locate C compiler (CC)
+
+@@ -24080,10 +24201,10 @@
+ -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
+ -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
+ -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
+- -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
++ -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(COOKED_JDK_UPDATE_VERSION).\$(COOKED_BUILD_NUMBER)\" \
+ -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
+ -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
+- -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
++ -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(COOKED_JDK_UPDATE_VERSION),\$(COOKED_BUILD_NUMBER)\""
+
+ # lib.exe is used to create static libraries.
+ # Extract the first word of "lib", so it can be a program name with args.
+@@ -27066,6 +27187,49 @@
+ fi
+
+ elif test "x$OPENJDK_TARGET_OS" != xwindows; then
++ # Extract the first word of "otool", so it can be a program name with args.
++set dummy otool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_OTOOL+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $OTOOL in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++ ;;
++esac
++fi
++OTOOL=$ac_cv_path_OTOOL
++if test -n "$OTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
++$as_echo "$OTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++ if test "x$OTOOL" = "x"; then
++ OTOOL="true"
++ fi
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}nm; ac_word=$2
+@@ -28530,315 +28694,6 @@
+
+ fi
+
+- if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+- # Extract the first word of "lipo", so it can be a program name with args.
+-set dummy lipo; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_path_LIPO+:} false; then :
+- $as_echo_n "(cached) " >&6
+-else
+- case $LIPO in
+- [\\/]* | ?:[\\/]*)
+- ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path.
+- ;;
+- *)
+- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- for ac_exec_ext in '' $ac_executable_extensions; do
+- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext"
+- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
+- fi
+-done
+- done
+-IFS=$as_save_IFS
+-
+- ;;
+-esac
+-fi
+-LIPO=$ac_cv_path_LIPO
+-if test -n "$LIPO"; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+-$as_echo "$LIPO" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-
+- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+-
+- # First separate the path from the arguments. This will split at the first
+- # space.
+- complete="$LIPO"
+- path="${complete%% *}"
+- tmp="$complete EOL"
+- arguments="${tmp#* }"
+-
+- # Input might be given as Windows format, start by converting to
+- # unix format.
+- new_path=`$CYGPATH -u "$path"`
+-
+- # Now try to locate executable using which
+- new_path=`$WHICH "$new_path" 2> /dev/null`
+- # bat and cmd files are not always considered executable in cygwin causing which
+- # to not find them
+- if test "x$new_path" = x \
+- && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+- && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+- new_path=`$CYGPATH -u "$path"`
+- fi
+- if test "x$new_path" = x; then
+- # Oops. Which didn't find the executable.
+- # The splitting of arguments from the executable at a space might have been incorrect,
+- # since paths with space are more likely in Windows. Give it another try with the whole
+- # argument.
+- path="$complete"
+- arguments="EOL"
+- new_path=`$CYGPATH -u "$path"`
+- new_path=`$WHICH "$new_path" 2> /dev/null`
+- # bat and cmd files are not always considered executable in cygwin causing which
+- # to not find them
+- if test "x$new_path" = x \
+- && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+- && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+- new_path=`$CYGPATH -u "$path"`
+- fi
+- if test "x$new_path" = x; then
+- # It's still not found. Now this is an unrecoverable error.
+- { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
+-$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
+- has_space=`$ECHO "$complete" | $GREP " "`
+- if test "x$has_space" != x; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+- fi
+- as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+- fi
+- fi
+-
+- # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+- # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+- # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+- # "foo.exe" is OK but "foo" is an error.
+- #
+- # This test is therefore slightly more accurate than "test -f" to check for file presence.
+- # It is also a way to make sure we got the proper file name for the real test later on.
+- test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+- if test "x$test_shortpath" = x; then
+- # Short path failed, file does not exist as specified.
+- # Try adding .exe or .cmd
+- if test -f "${new_path}.exe"; then
+- input_to_shortpath="${new_path}.exe"
+- elif test -f "${new_path}.cmd"; then
+- input_to_shortpath="${new_path}.cmd"
+- else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$new_path\", is invalid." >&5
+-$as_echo "$as_me: The path of LIPO, which resolves as \"$new_path\", is invalid." >&6;}
+- { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+-$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
+- as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+- fi
+- else
+- input_to_shortpath="$new_path"
+- fi
+-
+- # Call helper function which possibly converts this using DOS-style short mode.
+- # If so, the updated path is stored in $new_path.
+- new_path="$input_to_shortpath"
+-
+- input_path="$input_to_shortpath"
+- # Check if we need to convert this using DOS-style short mode. If the path
+- # contains just simple characters, use it. Otherwise (spaces, weird characters),
+- # take no chances and rewrite it.
+- # Note: m4 eats our [], so we need to use [ and ] instead.
+- has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+- if test "x$has_forbidden_chars" != x; then
+- # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+- shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+- path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+- if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+- # Going to short mode and back again did indeed matter. Since short mode is
+- # case insensitive, let's make it lowercase to improve readability.
+- shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- # Now convert it back to Unix-stile (cygpath)
+- input_path=`$CYGPATH -u "$shortmode_path"`
+- new_path="$input_path"
+- fi
+- fi
+-
+- test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+- if test "x$test_cygdrive_prefix" = x; then
+- # As a simple fix, exclude /usr/bin since it's not a real path.
+- if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then
+- # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+- # a path prefixed by /cygdrive for fixpath to work.
+- new_path="$CYGWIN_ROOT_PATH$input_path"
+- fi
+- fi
+-
+- # remove trailing .exe if any
+- new_path="${new_path/%.exe/}"
+-
+- elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+-
+- # First separate the path from the arguments. This will split at the first
+- # space.
+- complete="$LIPO"
+- path="${complete%% *}"
+- tmp="$complete EOL"
+- arguments="${tmp#* }"
+-
+- # Input might be given as Windows format, start by converting to
+- # unix format.
+- new_path="$path"
+-
+- windows_path="$new_path"
+- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+- unix_path=`$CYGPATH -u "$windows_path"`
+- new_path="$unix_path"
+- elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+- unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+- new_path="$unix_path"
+- fi
+-
+-
+- # Now try to locate executable using which
+- new_path=`$WHICH "$new_path" 2> /dev/null`
+-
+- if test "x$new_path" = x; then
+- # Oops. Which didn't find the executable.
+- # The splitting of arguments from the executable at a space might have been incorrect,
+- # since paths with space are more likely in Windows. Give it another try with the whole
+- # argument.
+- path="$complete"
+- arguments="EOL"
+- new_path="$path"
+-
+- windows_path="$new_path"
+- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+- unix_path=`$CYGPATH -u "$windows_path"`
+- new_path="$unix_path"
+- elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+- unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+- new_path="$unix_path"
+- fi
+-
+-
+- new_path=`$WHICH "$new_path" 2> /dev/null`
+-
+- if test "x$new_path" = x; then
+- # It's still not found. Now this is an unrecoverable error.
+- { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
+-$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
+- has_space=`$ECHO "$complete" | $GREP " "`
+- if test "x$has_space" != x; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+- fi
+- as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+- fi
+- fi
+-
+- # Now new_path has a complete unix path to the binary
+- if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then
+- # Keep paths in /bin as-is, but remove trailing .exe if any
+- new_path="${new_path/%.exe/}"
+- # Do not save /bin paths to all_fixpath_prefixes!
+- else
+- # Not in mixed or Windows style, start by that.
+- new_path=`cmd //c echo $new_path`
+-
+- input_path="$new_path"
+- # Check if we need to convert this using DOS-style short mode. If the path
+- # contains just simple characters, use it. Otherwise (spaces, weird characters),
+- # take no chances and rewrite it.
+- # Note: m4 eats our [], so we need to use [ and ] instead.
+- has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+- if test "x$has_forbidden_chars" != x; then
+- # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+- new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- fi
+-
+- # Output is in $new_path
+-
+- windows_path="$new_path"
+- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+- unix_path=`$CYGPATH -u "$windows_path"`
+- new_path="$unix_path"
+- elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+- unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+- new_path="$unix_path"
+- fi
+-
+- # remove trailing .exe if any
+- new_path="${new_path/%.exe/}"
+-
+- # Save the first 10 bytes of this path to the storage, so fixpath can work.
+- all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+- fi
+-
+- else
+- # We're on a posix platform. Hooray! :)
+- # First separate the path from the arguments. This will split at the first
+- # space.
+- complete="$LIPO"
+- path="${complete%% *}"
+- tmp="$complete EOL"
+- arguments="${tmp#* }"
+-
+- # Cannot rely on the command "which" here since it doesn't always work.
+- is_absolute_path=`$ECHO "$path" | $GREP ^/`
+- if test -z "$is_absolute_path"; then
+- # Path to executable is not absolute. Find it.
+- IFS_save="$IFS"
+- IFS=:
+- for p in $PATH; do
+- if test -f "$p/$path" && test -x "$p/$path"; then
+- new_path="$p/$path"
+- break
+- fi
+- done
+- IFS="$IFS_save"
+- else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving LIPO (as $path) failed, using $path directly." >&5
+-$as_echo "$as_me: Resolving LIPO (as $path) failed, using $path directly." >&6;}
+- new_path="$path"
+- fi
+-
+- if test "x$new_path" = x; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
+-$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
+- has_space=`$ECHO "$complete" | $GREP " "`
+- if test "x$has_space" != x; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+-$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
+- fi
+- as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+- fi
+- fi
+-
+- # Now join together the path and the arguments once again
+- if test "x$arguments" != xEOL; then
+- new_complete="$new_path ${arguments% *}"
+- else
+- new_complete="$new_path"
+- fi
+-
+- if test "x$complete" != "x$new_complete"; then
+- LIPO="$new_complete"
+- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5
+-$as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;}
+- fi
+-
+- fi
+-
+
+
+ # Restore old path without tools dir
+@@ -30388,8 +30243,6 @@
+ ALSA_NOT_NEEDED=yes
+ PULSE_NOT_NEEDED=yes
+ X11_NOT_NEEDED=yes
+- # If the java runtime framework is disabled, then we need X11.
+- # This will be adjusted below.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse x11" >&5
+ $as_echo "alsa pulse x11" >&6; }
+ fi
+@@ -30410,11 +30263,7 @@
+ X11_NOT_NEEDED=yes
+ fi
+
+- ###############################################################################
+- #
+- # Check for MacOSX support for OpenJDK.
+- #
+-
++ # Deprecated and now ignored
+
+ # Check whether --enable-macosx-runtime-support was given.
+ if test "${enable_macosx_runtime_support+set}" = set; then :
+@@ -30427,16 +30276,6 @@
+ fi
+
+
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Java Framework" >&5
+-$as_echo_n "checking for Mac OS X Java Framework... " >&6; }
+- if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: /System/Library/Frameworks/JavaVM.framework" >&5
+-$as_echo "/System/Library/Frameworks/JavaVM.framework" >&6; }
+- else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+- fi
+-
+
+
+ ###############################################################################
+@@ -37651,6 +37490,7 @@
+ fi
+
+
++
+ # Try to move the config.log file to the output directory.
+ if test -e ./config.log; then
+ $MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null
+--- ./common/autoconf/hotspot-spec.gmk.in Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/hotspot-spec.gmk.in Wed Jul 01 21:51:50 2015 -0700
+@@ -115,6 +115,9 @@
+
+ USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@
+
++# Universal binaries on macosx, mirror MACOSX_UNIVERSAL
++ALT_MACOSX_UNIVERSAL=@MACOSX_UNIVERSAL@
++
+ # Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols
+ # creation.
+ ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
+--- ./common/autoconf/jdk-options.m4 Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/jdk-options.m4 Wed Jul 01 21:51:50 2015 -0700
+@@ -161,10 +161,13 @@
+ if test "x$VAR_CPU" = xppc64 ; then
+ INCLUDE_SA=false
+ fi
++ if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
++ INCLUDE_SA=false
++ fi
+ AC_SUBST(INCLUDE_SA)
+
+ if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+- MACOSX_UNIVERSAL="true"
++ MACOSX_UNIVERSAL="false"
+ fi
+
+ AC_SUBST(MACOSX_UNIVERSAL)
+@@ -528,6 +531,12 @@
+ fi
+ AC_SUBST(JDK_VERSION)
+
++ # The cooked update version used to encode trailing letters in the update
++ # version into a trailing number. That is no longer needed, but need to
++ # keep the format in 8u for compatibility.
++ COOKED_JDK_UPDATE_VERSION="${JDK_UPDATE_VERSION}0"
++ AC_SUBST(COOKED_JDK_UPDATE_VERSION)
++
+ COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
+ AC_SUBST(COOKED_BUILD_NUMBER)
+ ])
+--- ./common/autoconf/libraries.m4 Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/libraries.m4 Wed Jul 01 21:51:50 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2012, 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
+@@ -65,8 +65,6 @@
+ ALSA_NOT_NEEDED=yes
+ PULSE_NOT_NEEDED=yes
+ X11_NOT_NEEDED=yes
+- # If the java runtime framework is disabled, then we need X11.
+- # This will be adjusted below.
+ AC_MSG_RESULT([alsa pulse x11])
+ fi
+
+@@ -84,19 +82,8 @@
+ X11_NOT_NEEDED=yes
+ fi
+
+- ###############################################################################
+- #
+- # Check for MacOSX support for OpenJDK.
+- #
+-
++ # Deprecated and now ignored
+ BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support)
+-
+- AC_MSG_CHECKING([for Mac OS X Java Framework])
+- if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
+- AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework])
+- else
+- AC_MSG_RESULT([no])
+- fi
+ ])
+
+ AC_DEFUN_ONCE([LIB_SETUP_X11],
+--- ./common/autoconf/platform.m4 Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/platform.m4 Wed Jul 01 21:51:50 2015 -0700
+@@ -48,6 +48,12 @@
+ VAR_CPU_BITS=32
+ VAR_CPU_ENDIAN=little
+ ;;
++ aarch64)
++ VAR_CPU=aarch64
++ VAR_CPU_ARCH=aarch64
++ VAR_CPU_BITS=64
++ VAR_CPU_ENDIAN=little
++ ;;
+ powerpc)
+ VAR_CPU=ppc
+ VAR_CPU_ARCH=ppc
+@@ -365,7 +371,8 @@
+
+ # ZERO_ARCHDEF is used to enable architecture-specific code
+ case "${OPENJDK_TARGET_CPU}" in
+- ppc*) ZERO_ARCHDEF=PPC ;;
++ ppc) ZERO_ARCHDEF=PPC32 ;;
++ ppc64) ZERO_ARCHDEF=PPC64 ;;
+ s390*) ZERO_ARCHDEF=S390 ;;
+ sparc*) ZERO_ARCHDEF=SPARC ;;
+ x86_64*) ZERO_ARCHDEF=AMD64 ;;
+--- ./common/autoconf/spec.gmk.in Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/spec.gmk.in Wed Jul 01 21:51:50 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -167,6 +167,7 @@
+ # Different version strings generated from the above information.
+ JDK_VERSION:=@JDK_VERSION@
+ RUNTIME_NAME=$(PRODUCT_NAME) $(PRODUCT_SUFFIX)
++COOKED_JDK_UPDATE_VERSION:=@COOKED_JDK_UPDATE_VERSION@
+ COOKED_BUILD_NUMBER:=@COOKED_BUILD_NUMBER@
+ # These variables need to be generated here so that MILESTONE and
+ # JDK_BUILD_NUMBER can be overridden on the make command line.
+@@ -342,6 +343,12 @@
+ # The linker can be gcc or ld on posix systems, or link.exe on windows systems.
+ LD:=@FIXPATH@ @LD@
+
++ifeq ($(OPENJDK_TARGET_OS), macosx)
++ # Xcode SDK and tools path
++ SDKPATH:=@SDKPATH@
++ @SET_DEVELOPER_DIR@
++endif
++
+ # The linker on older SuSE distros (e.g. on SLES 10) complains with:
+ # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
+ # if feeded with a version script which contains named tags.
+@@ -386,8 +393,6 @@
+ STRIP:=@STRIP@
+ MCS:=@MCS@
+
+-LIPO:=@LIPO@
+-
+ # Command to create a shared library
+ SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
+
+@@ -539,6 +544,7 @@
+ JT_HOME:=@JT_HOME@
+ JTREGEXE:=@JTREGEXE@
+
++XCODEBUILD=@XCODEBUILD@
+ FIXPATH:=@FIXPATH@
+
+ # Where the build output is stored for your convenience.
+--- ./common/autoconf/toolchain.m4 Mon Jun 01 11:40:12 2015 -0700
++++ ./common/autoconf/toolchain.m4 Wed Jul 01 21:51:50 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2012, 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
+@@ -254,6 +254,86 @@
+ PATH=$TOOLS_DIR:$PATH
+ fi
+
++ # Before we locate the compilers, we need to sanitize the Xcode build environment
++ if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
++ # determine path to Xcode developer directory
++ # can be empty in which case all the tools will rely on a sane Xcode 4 installation
++ SET_DEVELOPER_DIR=
++
++ if test -n "$XCODE_PATH"; then
++ DEVELOPER_DIR="$XCODE_PATH"/Contents/Developer
++ fi
++
++ # DEVELOPER_DIR could also be provided directly
++ AC_MSG_CHECKING([Determining if we need to set DEVELOPER_DIR])
++ if test -n "$DEVELOPER_DIR"; then
++ if test ! -d "$DEVELOPER_DIR"; then
++ AC_MSG_ERROR([Xcode Developer path does not exist: $DEVELOPER_DIR, please provide a path to the Xcode 4 application bundle using --with-xcode-path])
++ fi
++ if test ! -f "$DEVELOPER_DIR"/usr/bin/xcodebuild; then
++ AC_MSG_ERROR([Xcode Developer path is not valid: $DEVELOPER_DIR, it must point to Contents/Developer inside an Xcode application bundle])
++ fi
++ # make it visible to all the tools immediately
++ export DEVELOPER_DIR
++ SET_DEVELOPER_DIR="export DEVELOPER_DIR := $DEVELOPER_DIR"
++ AC_MSG_RESULT([yes ($DEVELOPER_DIR)])
++ else
++ AC_MSG_RESULT([no])
++ fi
++ AC_SUBST(SET_DEVELOPER_DIR)
++
++ AC_PATH_PROG(XCODEBUILD, xcodebuild)
++ if test -z "$XCODEBUILD"; then
++ AC_MSG_ERROR([The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X])
++ fi
++
++ # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later
++ XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'`
++ XC_VERSION_PARTS=( ${XCODE_VERSION//./ } )
++ if test ! "${XC_VERSION_PARTS[[0]]}" = "4"; then
++ AC_MSG_ERROR([Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select.])
++ fi
++
++ # Some versions of Xcode 5 command line tools install gcc and g++ as symlinks to
++ # clang and clang++, which will break the build. So handle that here if we need to.
++ if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then
++ # use xcrun to find the real gcc and add it's directory to PATH
++ # then autoconf magic will find it
++ AC_MSG_NOTICE([Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH])
++ XCODE_BIN_PATH=$(dirname `xcrun -find gcc`)
++ PATH="$XCODE_BIN_PATH":$PATH
++ fi
++
++ # Determine appropriate SDKPATH, don't use SDKROOT as it interferes with the stub tools
++ AC_MSG_CHECKING([Determining Xcode SDK path])
++ # allow SDKNAME to be set to override the default SDK selection
++ SDKPATH=`"$XCODEBUILD" -sdk ${SDKNAME:-macosx} -version | grep '^Path: ' | sed 's/Path: //'`
++ if test -n "$SDKPATH"; then
++ AC_MSG_RESULT([$SDKPATH])
++ else
++ AC_MSG_RESULT([(none, will use system headers and frameworks)])
++ fi
++ AC_SUBST(SDKPATH)
++
++ # Perform a basic sanity test
++ if test ! -f "$SDKPATH/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
++ AC_MSG_ERROR([Unable to find required framework headers, provide a valid path to Xcode 4 using --with-xcode-path])
++ fi
++
++ # if SDKPATH is non-empty then we need to add -isysroot and -iframework for gcc and g++
++ if test -n "$SDKPATH"; then
++ # We need -isysroot <path> and -iframework<path>/System/Library/Frameworks
++ CFLAGS_JDK="${CFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\""
++ CXXFLAGS_JDK="${CXXFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\""
++ LDFLAGS_JDK="${LDFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\""
++ fi
++
++ # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
++ # setting this here means it doesn't have to be peppered throughout the forest
++ CFLAGS_JDK="$CFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\""
++ CXXFLAGS_JDK="$CXXFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\""
++ LDFLAGS_JDK="$LDFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\""
++ fi
+
+ ### Locate C compiler (CC)
+
+@@ -412,10 +492,10 @@
+ -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
+ -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
+ -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
+- -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
++ -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(COOKED_JDK_UPDATE_VERSION).\$(COOKED_BUILD_NUMBER)\" \
+ -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
+ -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
+- -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
++ -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(COOKED_JDK_UPDATE_VERSION),\$(COOKED_BUILD_NUMBER)\""
+
+ # lib.exe is used to create static libraries.
+ AC_CHECK_PROG([WINAR], [lib],[lib],,,)
+@@ -477,6 +557,10 @@
+ AC_PATH_PROG(MCS, mcs)
+ BASIC_FIXUP_EXECUTABLE(MCS)
+ elif test "x$OPENJDK_TARGET_OS" != xwindows; then
++ AC_PATH_PROG(OTOOL, otool)
++ if test "x$OTOOL" = "x"; then
++ OTOOL="true"
++ fi
+ AC_CHECK_TOOL(NM, nm)
+ BASIC_FIXUP_EXECUTABLE(NM)
+ GNM="$NM"
+@@ -501,11 +585,6 @@
+ BASIC_FIXUP_EXECUTABLE(OBJDUMP)
+ fi
+
+- if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+- AC_PATH_PROG(LIPO, lipo)
+- BASIC_FIXUP_EXECUTABLE(LIPO)
+- fi
+-
+ TOOLCHAIN_SETUP_JTREG
+
+ # Restore old path without tools dir
+@@ -1215,7 +1294,7 @@
+ BASIC_FIXUP_PATH([JT_HOME])
+
+ # jtreg win32 script works for everybody
+- JTREGEXE="$JT_HOME/win32/bin/jtreg"
++ JTREGEXE="$JT_HOME/bin/jtreg"
+
+ if test ! -f "$JTREGEXE"; then
+ AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
+--- ./make/Javadoc.gmk Mon Jun 01 11:40:12 2015 -0700
++++ ./make/Javadoc.gmk Wed Jul 01 21:51:50 2015 -0700
+@@ -1,4 +1,4 @@
+-# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 1997, 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
+@@ -74,6 +74,7 @@
+ JNLP_FIRST_COPYRIGHT_YEAR = 1998
+ PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007
+ JDKNET_FIRST_COPYRIGHT_YEAR = 2014
++JACCESSAPI_FIRST_COPYRIGHT_YEAR = 2002
+
+ # Oracle name
+ FULL_COMPANY_NAME = Oracle and/or its affiliates
+@@ -1208,6 +1209,56 @@
+
+ #############################################################
+ #
++# jaccessdocs - Java Accessibility Utilities
++#
++
++ALL_OTHER_TARGETS += jaccessdocs
++
++JACCESSAPI_DOCDIR := $(JRE_API_DOCSDIR)/accessibility/jaccess/spec
++JACCESSAPI2COREAPI := ../../../$(JDKJRE2COREAPI)
++JACCESSAPI_DOCTITLE := JACCESS API
++JACCESSAPI_WINDOWTITLE := JACCESS API
++JACCESSAPI_HEADER := <strong>JACCESS API</strong>
++JACCESSAPI_BOTTOM := $(call CommonBottom,$(JACCESSAPI_FIRST_COPYRIGHT_YEAR))
++# JACCESSAPI_PKGS is located in NON_CORE_PKGS.gmk
++
++JACCESSAPI_INDEX_HTML = $(JACCESSAPI_DOCDIR)/index.html
++JACCESSAPI_OPTIONS_FILE = $(DOCSTMPDIR)/jaccess.options
++JACCESSAPI_PACKAGES_FILE = $(DOCSTMPDIR)/jaccess.packages
++
++jaccessdocs: $(JACCESSAPI_INDEX_HTML)
++
++# Set relative location to core api document root
++$(JACCESSAPI_INDEX_HTML): GET2DOCSDIR=$(JACCESSAPI2COREAPI)/..
++
++# Run javadoc if the index file is out of date or missing
++$(JACCESSAPI_INDEX_HTML): $(JACCESSAPI_OPTIONS_FILE) $(JACCESSAPI_PACKAGES_FILE) coredocs
++ $(prep-javadoc)
++ $(call JavadocSummary,$(JACCESSAPI_OPTIONS_FILE),$(JACCESSAPI_PACKAGES_FILE))
++ $(JAVADOC_CMD) -d $(@D) \
++ @$(JACCESSAPI_OPTIONS_FILE) @$(JACCESSAPI_PACKAGES_FILE)
++
++# Create file with javadoc options in it
++$(JACCESSAPI_OPTIONS_FILE):
++ $(prep-target)
++ @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
++ $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
++ $(call OptionPair,-encoding,ascii) ; \
++ $(call OptionOnly,-nodeprecatedlist) ; \
++ $(call OptionPair,-doctitle,$(JACCESSAPI_DOCTITLE)) ; \
++ $(call OptionPair,-windowtitle,$(JACCESSAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \
++ $(call OptionPair,-header,$(JACCESSAPI_HEADER)$(DRAFT_HEADER)) ; \
++ $(call OptionPair,-bottom,$(JACCESSAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
++ $(call OptionTrip,-linkoffline,$(JACCESSAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
++ ) >> $@
++
++# Create a file with the package names in it
++$(JACCESSAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JACCESSAPI_PKGS))
++ $(prep-target)
++ $(call PackageFilter,$(JACCESSAPI_PKGS))
++
++#############################################################
++#
+ # jdk.net docs
+ #
+
+--- ./make/Main.gmk Mon Jun 01 11:40:12 2015 -0700
++++ ./make/Main.gmk Wed Jul 01 21:51:50 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2011, 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
+@@ -142,17 +142,12 @@
+ @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images)
+ @$(call TargetExit)
+
+-profiles: profiles-oscheck source-tips jdk hotspot profiles-only
++profiles: source-tips jdk hotspot profiles-only
+ profiles-only: start-make
+ @$(call TargetEnter)
+ @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles)
+ @$(call TargetExit)
+
+-profiles-oscheck:
+- ifneq ($(OPENJDK_TARGET_OS), linux)
+- @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1
+- endif
+-
+ install: images install-only
+ install-only: start-make
+ @$(call TargetEnter)
+@@ -240,7 +235,7 @@
+ .PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only
+ .PHONY: default all clean dist-clean bootcycle-images start-make
+ .PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-test clean-overlay-images clean-bootcycle-build
+-.PHONY: profiles profiles-only profiles-oscheck
++.PHONY: profiles profiles-only
+
+ include $(root_dir)/make/Jprt.gmk
+
+--- ./make/common/NON_CORE_PKGS.gmk Mon Jun 01 11:40:12 2015 -0700
++++ ./make/common/NON_CORE_PKGS.gmk Wed Jul 01 21:51:50 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2002, 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
+@@ -100,6 +100,8 @@
+ jdk.net \
+ jdk.management.cmm
+
++JACCESSAPI_PKGS = com.sun.java.accessibility.util
++
+ # non-core packages in rt.jar
+ NON_CORE_PKGS = $(DOMAPI_PKGS) \
+ $(MGMT_PKGS) \
+@@ -111,4 +113,5 @@
+ $(SMARTCARDIO_PKGS) \
+ $(SCTPAPI_PKGS) \
+ $(APPLE_EXT_PKGS) \
+- $(JDK_PKGS)
++ $(JDK_PKGS) \
++ $(JACCESSAPI_PKGS)
+--- ./make/common/NativeCompilation.gmk Mon Jun 01 11:40:12 2015 -0700
++++ ./make/common/NativeCompilation.gmk Wed Jul 01 21:51:50 2015 -0700
+@@ -323,6 +323,13 @@
+ $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
+ endif
+
++ ifeq ($$($1_CXXFLAGS),)
++ $1_CXXFLAGS:=$$($1_CFLAGS)
++ endif
++ ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),)
++ $1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
++ endif
++
+ ifneq (,$$($1_DEBUG_SYMBOLS))
+ ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
+ ifdef OPENJDK
+@@ -340,13 +347,6 @@
+ endif
+ endif
+
+- ifeq ($$($1_CXXFLAGS),)
+- $1_CXXFLAGS:=$$($1_CFLAGS)
+- endif
+- ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),)
+- $1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
+- endif
+-
+ ifneq (,$$($1_REORDER))
+ $1_EXTRA_CFLAGS += $$(C_FLAG_REORDER)
+ $1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
+--- ./make/jprt.properties Mon Jun 01 11:40:12 2015 -0700
++++ ./make/jprt.properties Wed Jul 01 21:51:50 2015 -0700
+@@ -29,7 +29,7 @@
+ #
+
+ # The current release name
+-my.jdk.update.version=40
++my.jdk.update.version=60
+ jprt.tools.default.release=jdk8u${my.jdk.update.version}
+
+ # Check if this is the equivalent of a hotspot push job
+--- ./test/Makefile Mon Jun 01 11:40:12 2015 -0700
++++ ./test/Makefile Wed Jul 01 21:51:50 2015 -0700
+@@ -66,6 +66,32 @@
+ hotspot_%:
+ @$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), TEST="$@" $@)
+
++#
++# jtreg_tests
++#
++# Invocation:
++#
++# make jtreg_tests TESTDIRS=<test-dirs>
++#
++# where <test-dirs> is something like '../<component>/test/runtime',
++# <component> in turn being one of the top level directories (for
++# example 'hotspot').
++#
++# The below will strip the path prefix and delegate to the
++# corresponding ../<component>/test/Makefile.
++
++ifneq ($(TESTDIRS),)
++# Extract the component from ../<component>/...
++COMPONENT=$(word 2,$(subst /, ,$(TESTDIRS)))
++
++# Strip off the ../<component>/test prefix and pass the rest as TESTDIRS
++# to the delegate Makefile
++TESTDIRS_TESTS=$(patsubst ../$(COMPONENT)/test/%,%,$(TESTDIRS))
++endif
++
++jtreg_tests:
++ @$(NO_STOPPING)$(call SUBDIR_TEST, $(TOPDIR)/$(COMPONENT), TESTDIRS=$(TESTDIRS_TESTS) $@)
++
+ ################################################################
+
+ # Phony targets (e.g. these are not filenames)
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./test/projects/mac/javaws/javaws.xcodeproj/project.pbxproj Wed Jul 01 21:51:50 2015 -0700
+@@ -0,0 +1,476 @@
++// !$*UTF8*$!
++{
++ archiveVersion = 1;
++ classes = {
++ };
++ objectVersion = 46;
++ objects = {
++
++/* Begin PBXBuildFile section */
++ DE113B7C1A365449007808D0 /* javaws.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE113B7B1A365449007808D0 /* javaws.1 */; };
++ DE6DD4481A3654F200B8A465 /* applicationIcon.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD43C1A3654F100B8A465 /* applicationIcon.c */; };
++ DE6DD4491A3654F200B8A465 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD43E1A3654F100B8A465 /* base64.c */; };
++ DE6DD44A1A3654F200B8A465 /* configurationFile.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4401A3654F100B8A465 /* configurationFile.c */; };
++ DE6DD44B1A3654F200B8A465 /* jfx_runtime.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4421A3654F100B8A465 /* jfx_runtime.c */; };
++ DE6DD44C1A3654F200B8A465 /* launcher.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4441A3654F200B8A465 /* launcher.c */; };
++ DE6DD44D1A3654F200B8A465 /* launchFile.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4461A3654F200B8A465 /* launchFile.c */; };
++ DE6DD4581A3654FA00B8A465 /* msgString.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD44E1A3654FA00B8A465 /* msgString.c */; };
++ DE6DD4591A3654FA00B8A465 /* propertyParser.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4501A3654FA00B8A465 /* propertyParser.c */; };
++ DE6DD45A1A3654FA00B8A465 /* splashFile.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4521A3654FA00B8A465 /* splashFile.c */; };
++ DE6DD45B1A3654FA00B8A465 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4541A3654FA00B8A465 /* system.c */; };
++ DE6DD45C1A3654FA00B8A465 /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4561A3654FA00B8A465 /* util.c */; };
++ DE6DD4611A36550100B8A465 /* versionId.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD45D1A36550100B8A465 /* versionId.c */; };
++ DE6DD4621A36550100B8A465 /* xmlparser.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD45F1A36550100B8A465 /* xmlparser.c */; };
++ DE6DD4681A36555100B8A465 /* launcher_md.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4631A36555100B8A465 /* launcher_md.c */; };
++ DE6DD4691A36555100B8A465 /* splash_md.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4641A36555100B8A465 /* splash_md.c */; };
++ DE6DD46B1A36555100B8A465 /* system_md.c in Sources */ = {isa = PBXBuildFile; fileRef = DE6DD4661A36555100B8A465 /* system_md.c */; };
++ DE8B3C7A1A37A51900316F1D /* config.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C621A37A51900316F1D /* config.c */; };
++ DE8B3C7B1A37A51900316F1D /* configcache_pd.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C641A37A51900316F1D /* configcache_pd.c */; };
++ DE8B3C7C1A37A51900316F1D /* console.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C661A37A51900316F1D /* console.c */; };
++ DE8B3C7D1A37A51900316F1D /* dialogutils.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C681A37A51900316F1D /* dialogutils.c */; };
++ DE8B3C7E1A37A51900316F1D /* expirationdialog.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C6A1A37A51900316F1D /* expirationdialog.c */; };
++ DE8B3C811A37A51900316F1D /* MSystemProxyHandler.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C711A37A51900316F1D /* MSystemProxyHandler.c */; };
++ DE8B3C821A37A51900316F1D /* NetworkUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C721A37A51900316F1D /* NetworkUtil.c */; };
++ DE8B3C831A37A51900316F1D /* Platform.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C741A37A51900316F1D /* Platform.c */; };
++ DE8B3C841A37A51900316F1D /* UnixDomainSocket.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C761A37A51900316F1D /* UnixDomainSocket.c */; };
++ DE8B3C851A37A51900316F1D /* UnixTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C771A37A51900316F1D /* UnixTime.cpp */; };
++ DE8B3C861A37A51900316F1D /* webstartblockdialog.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C791A37A51900316F1D /* webstartblockdialog.c */; };
++ DE8B3C961A37A7BF00316F1D /* BasicPerfStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C881A37A7BF00316F1D /* BasicPerfStore.cpp */; };
++ DE8B3C971A37A7BF00316F1D /* DeployPerf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C8B1A37A7BF00316F1D /* DeployPerf.cpp */; };
++ DE8B3C981A37A7BF00316F1D /* PerfHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C901A37A7BF00316F1D /* PerfHelper.cpp */; };
++ DE8B3C991A37A7BF00316F1D /* PerfLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C921A37A7BF00316F1D /* PerfLabel.cpp */; };
++ DE8B3C9D1A37A7C600316F1D /* secureArgs.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C9A1A37A7C600316F1D /* secureArgs.c */; };
++ DE8B3CA01A37A81000316F1D /* jfx_runtime.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3C9E1A37A81000316F1D /* jfx_runtime.c */; };
++ DE8B3CA21A37BFA300316F1D /* jfx_runtime_md.c in Sources */ = {isa = PBXBuildFile; fileRef = DE8B3CA11A37BFA300316F1D /* jfx_runtime_md.c */; };
++ DE8B3CA41A37C10000316F1D /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DE8B3CA31A37C10000316F1D /* SystemConfiguration.framework */; };
++ DE8B3CA61A37D04900316F1D /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DE8B3CA51A37D04900316F1D /* Security.framework */; };
++ DE8B3CA81A37D05300316F1D /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DE8B3CA71A37D05300316F1D /* ServiceManagement.framework */; };
++ DE8B3CAA1A38C48B00316F1D /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DE8B3CA91A38C48B00316F1D /* libiconv.dylib */; };
++/* End PBXBuildFile section */
++
++/* Begin PBXCopyFilesBuildPhase section */
++ DE113B741A365449007808D0 /* CopyFiles */ = {
++ isa = PBXCopyFilesBuildPhase;
++ buildActionMask = 2147483647;
++ dstPath = /usr/share/man/man1/;
++ dstSubfolderSpec = 0;
++ files = (
++ DE113B7C1A365449007808D0 /* javaws.1 in CopyFiles */,
++ );
++ runOnlyForDeploymentPostprocessing = 1;
++ };
++/* End PBXCopyFilesBuildPhase section */
++
++/* Begin PBXFileReference section */
++ DE113B761A365449007808D0 /* javaws */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = javaws; sourceTree = BUILT_PRODUCTS_DIR; };
++ DE113B7B1A365449007808D0 /* javaws.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = javaws.1; sourceTree = "<group>"; };
++ DE6DD43C1A3654F100B8A465 /* applicationIcon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = applicationIcon.c; path = ../../../../../src/javaws/share/native/applicationIcon.c; sourceTree = "<group>"; };
++ DE6DD43D1A3654F100B8A465 /* applicationIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = applicationIcon.h; path = ../../../../../src/javaws/share/native/applicationIcon.h; sourceTree = "<group>"; };
++ DE6DD43E1A3654F100B8A465 /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = base64.c; path = ../../../../../src/javaws/share/native/base64.c; sourceTree = "<group>"; };
++ DE6DD43F1A3654F100B8A465 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = ../../../../../src/javaws/share/native/base64.h; sourceTree = "<group>"; };
++ DE6DD4401A3654F100B8A465 /* configurationFile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = configurationFile.c; path = ../../../../../src/javaws/share/native/configurationFile.c; sourceTree = "<group>"; };
++ DE6DD4411A3654F100B8A465 /* configurationFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = configurationFile.h; path = ../../../../../src/javaws/share/native/configurationFile.h; sourceTree = "<group>"; };
++ DE6DD4421A3654F100B8A465 /* jfx_runtime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jfx_runtime.c; path = ../../../../../src/javaws/share/native/jfx_runtime.c; sourceTree = "<group>"; };
++ DE6DD4431A3654F200B8A465 /* jfx_runtime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jfx_runtime.h; path = ../../../../../src/javaws/share/native/jfx_runtime.h; sourceTree = "<group>"; };
++ DE6DD4441A3654F200B8A465 /* launcher.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = launcher.c; path = ../../../../../src/javaws/share/native/launcher.c; sourceTree = "<group>"; };
++ DE6DD4451A3654F200B8A465 /* launcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = launcher.h; path = ../../../../../src/javaws/share/native/launcher.h; sourceTree = "<group>"; };
++ DE6DD4461A3654F200B8A465 /* launchFile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = launchFile.c; path = ../../../../../src/javaws/share/native/launchFile.c; sourceTree = "<group>"; };
++ DE6DD4471A3654F200B8A465 /* launchFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = launchFile.h; path = ../../../../../src/javaws/share/native/launchFile.h; sourceTree = "<group>"; };
++ DE6DD44E1A3654FA00B8A465 /* msgString.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = msgString.c; path = ../../../../../src/javaws/share/native/msgString.c; sourceTree = "<group>"; };
++ DE6DD44F1A3654FA00B8A465 /* msgString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msgString.h; path = ../../../../../src/javaws/share/native/msgString.h; sourceTree = "<group>"; };
++ DE6DD4501A3654FA00B8A465 /* propertyParser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = propertyParser.c; path = ../../../../../src/javaws/share/native/propertyParser.c; sourceTree = "<group>"; };
++ DE6DD4511A3654FA00B8A465 /* propertyParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = propertyParser.h; path = ../../../../../src/javaws/share/native/propertyParser.h; sourceTree = "<group>"; };
++ DE6DD4521A3654FA00B8A465 /* splashFile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = splashFile.c; path = ../../../../../src/javaws/share/native/splashFile.c; sourceTree = "<group>"; };
++ DE6DD4531A3654FA00B8A465 /* splashFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = splashFile.h; path = ../../../../../src/javaws/share/native/splashFile.h; sourceTree = "<group>"; };
++ DE6DD4541A3654FA00B8A465 /* system.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = system.c; path = ../../../../../src/javaws/share/native/system.c; sourceTree = "<group>"; };
++ DE6DD4551A3654FA00B8A465 /* system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = system.h; path = ../../../../../src/javaws/share/native/system.h; sourceTree = "<group>"; };
++ DE6DD4561A3654FA00B8A465 /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = util.c; path = ../../../../../src/javaws/share/native/util.c; sourceTree = "<group>"; };
++ DE6DD4571A3654FA00B8A465 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = util.h; path = ../../../../../src/javaws/share/native/util.h; sourceTree = "<group>"; };
++ DE6DD45D1A36550100B8A465 /* versionId.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = versionId.c; path = ../../../../../src/javaws/share/native/versionId.c; sourceTree = "<group>"; };
++ DE6DD45E1A36550100B8A465 /* versionId.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = versionId.h; path = ../../../../../src/javaws/share/native/versionId.h; sourceTree = "<group>"; };
++ DE6DD45F1A36550100B8A465 /* xmlparser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xmlparser.c; path = ../../../../../src/javaws/share/native/xmlparser.c; sourceTree = "<group>"; };
++ DE6DD4601A36550100B8A465 /* xmlparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xmlparser.h; path = ../../../../../src/javaws/share/native/xmlparser.h; sourceTree = "<group>"; };
++ DE6DD4631A36555100B8A465 /* launcher_md.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = launcher_md.c; path = ../../../../../src/javaws/macosx/native/launcher_md.c; sourceTree = "<group>"; };
++ DE6DD4641A36555100B8A465 /* splash_md.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = splash_md.c; path = ../../../../../src/javaws/macosx/native/splash_md.c; sourceTree = "<group>"; };
++ DE6DD4661A36555100B8A465 /* system_md.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = system_md.c; path = ../../../../../src/javaws/macosx/native/system_md.c; sourceTree = "<group>"; };
++ DE6DD4671A36555100B8A465 /* system_md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = system_md.h; path = ../../../../../src/javaws/macosx/native/system_md.h; sourceTree = "<group>"; };
++ DE8B3C5F1A3760E700316F1D /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; };
++ DE8B3C611A37A51900316F1D /* com_sun_deploy_net_proxy_MSystemProxyHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = com_sun_deploy_net_proxy_MSystemProxyHandler.h; path = ../../../../../src/common/unix/native/com_sun_deploy_net_proxy_MSystemProxyHandler.h; sourceTree = "<group>"; };
++ DE8B3C621A37A51900316F1D /* config.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = config.c; path = ../../../../../src/common/unix/native/config.c; sourceTree = "<group>"; };
++ DE8B3C631A37A51900316F1D /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../../../../../src/common/unix/native/config.h; sourceTree = "<group>"; };
++ DE8B3C641A37A51900316F1D /* configcache_pd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = configcache_pd.c; path = ../../../../../src/common/unix/native/configcache_pd.c; sourceTree = "<group>"; };
++ DE8B3C651A37A51900316F1D /* configcache_pd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = configcache_pd.h; path = ../../../../../src/common/unix/native/configcache_pd.h; sourceTree = "<group>"; };
++ DE8B3C661A37A51900316F1D /* console.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = console.c; path = ../../../../../src/common/unix/native/console.c; sourceTree = "<group>"; };
++ DE8B3C671A37A51900316F1D /* DeployPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeployPlatform.h; path = ../../../../../src/common/unix/native/DeployPlatform.h; sourceTree = "<group>"; };
++ DE8B3C681A37A51900316F1D /* dialogutils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dialogutils.c; path = ../../../../../src/common/unix/native/dialogutils.c; sourceTree = "<group>"; };
++ DE8B3C691A37A51900316F1D /* dialogutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dialogutils.h; path = ../../../../../src/common/unix/native/dialogutils.h; sourceTree = "<group>"; };
++ DE8B3C6A1A37A51900316F1D /* expirationdialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = expirationdialog.c; path = ../../../../../src/common/unix/native/expirationdialog.c; sourceTree = "<group>"; };
++ DE8B3C6B1A37A51900316F1D /* gnomevfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gnomevfs.h; path = ../../../../../src/common/unix/native/gnomevfs.h; sourceTree = "<group>"; };
++ DE8B3C711A37A51900316F1D /* MSystemProxyHandler.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = MSystemProxyHandler.c; path = ../../../../../src/common/unix/native/MSystemProxyHandler.c; sourceTree = "<group>"; };
++ DE8B3C721A37A51900316F1D /* NetworkUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = NetworkUtil.c; path = ../../../../../src/common/unix/native/NetworkUtil.c; sourceTree = "<group>"; };
++ DE8B3C731A37A51900316F1D /* NetworkUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkUtil.h; path = ../../../../../src/common/unix/native/NetworkUtil.h; sourceTree = "<group>"; };
++ DE8B3C741A37A51900316F1D /* Platform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Platform.c; path = ../../../../../src/common/unix/native/Platform.c; sourceTree = "<group>"; };
++ DE8B3C751A37A51900316F1D /* SharedMemPerfHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedMemPerfHelper.h; path = ../../../../../src/common/unix/native/SharedMemPerfHelper.h; sourceTree = "<group>"; };
++ DE8B3C761A37A51900316F1D /* UnixDomainSocket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = UnixDomainSocket.c; path = ../../../../../src/common/unix/native/UnixDomainSocket.c; sourceTree = "<group>"; };
++ DE8B3C771A37A51900316F1D /* UnixTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnixTime.cpp; path = ../../../../../src/common/unix/native/UnixTime.cpp; sourceTree = "<group>"; };
++ DE8B3C781A37A51900316F1D /* UnixTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnixTime.h; path = ../../../../../src/common/unix/native/UnixTime.h; sourceTree = "<group>"; };
++ DE8B3C791A37A51900316F1D /* webstartblockdialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = webstartblockdialog.c; path = ../../../../../src/common/unix/native/webstartblockdialog.c; sourceTree = "<group>"; };
++ DE8B3C871A37A7BF00316F1D /* BasicPerfHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicPerfHelper.h; path = ../../../../../src/common/share/native/BasicPerfHelper.h; sourceTree = "<group>"; };
++ DE8B3C881A37A7BF00316F1D /* BasicPerfStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicPerfStore.cpp; path = ../../../../../src/common/share/native/BasicPerfStore.cpp; sourceTree = "<group>"; };
++ DE8B3C891A37A7BF00316F1D /* BasicPerfStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicPerfStore.h; path = ../../../../../src/common/share/native/BasicPerfStore.h; sourceTree = "<group>"; };
++ DE8B3C8A1A37A7BF00316F1D /* configcache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = configcache.h; path = ../../../../../src/common/share/native/configcache.h; sourceTree = "<group>"; };
++ DE8B3C8B1A37A7BF00316F1D /* DeployPerf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeployPerf.cpp; path = ../../../../../src/common/share/native/DeployPerf.cpp; sourceTree = "<group>"; };
++ DE8B3C8C1A37A7BF00316F1D /* DeployPerf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeployPerf.h; path = ../../../../../src/common/share/native/DeployPerf.h; sourceTree = "<group>"; };
++ DE8B3C8D1A37A7BF00316F1D /* DeployVersion.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = DeployVersion.hpp; path = ../../../../../src/common/share/native/DeployVersion.hpp; sourceTree = "<group>"; };
++ DE8B3C8E1A37A7BF00316F1D /* NativeLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeLock.h; path = ../../../../../src/common/share/native/NativeLock.h; sourceTree = "<group>"; };
++ DE8B3C8F1A37A7BF00316F1D /* NativeLocker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeLocker.h; path = ../../../../../src/common/share/native/NativeLocker.h; sourceTree = "<group>"; };
++ DE8B3C901A37A7BF00316F1D /* PerfHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PerfHelper.cpp; path = ../../../../../src/common/share/native/PerfHelper.cpp; sourceTree = "<group>"; };
++ DE8B3C911A37A7BF00316F1D /* PerfHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerfHelper.h; path = ../../../../../src/common/share/native/PerfHelper.h; sourceTree = "<group>"; };
++ DE8B3C921A37A7BF00316F1D /* PerfLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PerfLabel.cpp; path = ../../../../../src/common/share/native/PerfLabel.cpp; sourceTree = "<group>"; };
++ DE8B3C931A37A7BF00316F1D /* PerfLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerfLabel.h; path = ../../../../../src/common/share/native/PerfLabel.h; sourceTree = "<group>"; };
++ DE8B3C941A37A7BF00316F1D /* PerfLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerfLib.h; path = ../../../../../src/common/share/native/PerfLib.h; sourceTree = "<group>"; };
++ DE8B3C951A37A7BF00316F1D /* PerfStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerfStore.h; path = ../../../../../src/common/share/native/PerfStore.h; sourceTree = "<group>"; };
++ DE8B3C9A1A37A7C600316F1D /* secureArgs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = secureArgs.c; path = ../../../../../src/common/share/native/secureArgs.c; sourceTree = "<group>"; };
++ DE8B3C9B1A37A7C600316F1D /* secureArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = secureArgs.h; path = ../../../../../src/common/share/native/secureArgs.h; sourceTree = "<group>"; };
++ DE8B3C9C1A37A7C600316F1D /* SystemTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SystemTime.h; path = ../../../../../src/common/share/native/SystemTime.h; sourceTree = "<group>"; };
++ DE8B3C9E1A37A81000316F1D /* jfx_runtime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jfx_runtime.c; path = ../../../../../src/javaws/share/native/jfx_runtime.c; sourceTree = "<group>"; };
++ DE8B3C9F1A37A81000316F1D /* jfx_runtime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jfx_runtime.h; path = ../../../../../src/javaws/share/native/jfx_runtime.h; sourceTree = "<group>"; };
++ DE8B3CA11A37BFA300316F1D /* jfx_runtime_md.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jfx_runtime_md.c; path = ../../../../../src/javaws/unix/native/jfx_runtime_md.c; sourceTree = "<group>"; };
++ DE8B3CA31A37C10000316F1D /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
++ DE8B3CA51A37D04900316F1D /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
++ DE8B3CA71A37D05300316F1D /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
++ DE8B3CA91A38C48B00316F1D /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; };
++/* End PBXFileReference section */
++
++/* Begin PBXFrameworksBuildPhase section */
++ DE113B731A365449007808D0 /* Frameworks */ = {
++ isa = PBXFrameworksBuildPhase;
++ buildActionMask = 2147483647;
++ files = (
++ DE8B3CAA1A38C48B00316F1D /* libiconv.dylib in Frameworks */,
++ DE8B3CA81A37D05300316F1D /* ServiceManagement.framework in Frameworks */,
++ DE8B3CA61A37D04900316F1D /* Security.framework in Frameworks */,
++ DE8B3CA41A37C10000316F1D /* SystemConfiguration.framework in Frameworks */,
++ );
++ runOnlyForDeploymentPostprocessing = 0;
++ };
++/* End PBXFrameworksBuildPhase section */
++
++/* Begin PBXGroup section */
++ DE113B6D1A365449007808D0 = {
++ isa = PBXGroup;
++ children = (
++ DE8B3CA91A38C48B00316F1D /* libiconv.dylib */,
++ DE8B3CA71A37D05300316F1D /* ServiceManagement.framework */,
++ DE8B3CA51A37D04900316F1D /* Security.framework */,
++ DE8B3CA31A37C10000316F1D /* SystemConfiguration.framework */,
++ DE8B3C5F1A3760E700316F1D /* ApplicationServices.framework */,
++ DE113B781A365449007808D0 /* javaws */,
++ DE113B771A365449007808D0 /* Products */,
++ );
++ sourceTree = "<group>";
++ };
++ DE113B771A365449007808D0 /* Products */ = {
++ isa = PBXGroup;
++ children = (
++ DE113B761A365449007808D0 /* javaws */,
++ );
++ name = Products;
++ sourceTree = "<group>";
++ };
++ DE113B781A365449007808D0 /* javaws */ = {
++ isa = PBXGroup;
++ children = (
++ DE8B3C611A37A51900316F1D /* com_sun_deploy_net_proxy_MSystemProxyHandler.h */,
++ DE8B3C621A37A51900316F1D /* config.c */,
++ DE8B3C631A37A51900316F1D /* config.h */,
++ DE8B3C641A37A51900316F1D /* configcache_pd.c */,
++ DE8B3C651A37A51900316F1D /* configcache_pd.h */,
++ DE8B3C661A37A51900316F1D /* console.c */,
++ DE8B3C671A37A51900316F1D /* DeployPlatform.h */,
++ DE8B3C681A37A51900316F1D /* dialogutils.c */,
++ DE8B3C691A37A51900316F1D /* dialogutils.h */,
++ DE8B3C6A1A37A51900316F1D /* expirationdialog.c */,
++ DE8B3C6B1A37A51900316F1D /* gnomevfs.h */,
++ DE8B3C9A1A37A7C600316F1D /* secureArgs.c */,
++ DE8B3C9B1A37A7C600316F1D /* secureArgs.h */,
++ DE8B3C9C1A37A7C600316F1D /* SystemTime.h */,
++ DE8B3C711A37A51900316F1D /* MSystemProxyHandler.c */,
++ DE8B3C721A37A51900316F1D /* NetworkUtil.c */,
++ DE8B3C9E1A37A81000316F1D /* jfx_runtime.c */,
++ DE8B3C9F1A37A81000316F1D /* jfx_runtime.h */,
++ DE8B3C731A37A51900316F1D /* NetworkUtil.h */,
++ DE8B3C741A37A51900316F1D /* Platform.c */,
++ DE8B3C751A37A51900316F1D /* SharedMemPerfHelper.h */,
++ DE8B3C761A37A51900316F1D /* UnixDomainSocket.c */,
++ DE8B3C771A37A51900316F1D /* UnixTime.cpp */,
++ DE8B3C781A37A51900316F1D /* UnixTime.h */,
++ DE8B3C791A37A51900316F1D /* webstartblockdialog.c */,
++ DE6DD4631A36555100B8A465 /* launcher_md.c */,
++ DE6DD4641A36555100B8A465 /* splash_md.c */,
++ DE6DD4661A36555100B8A465 /* system_md.c */,
++ DE6DD4671A36555100B8A465 /* system_md.h */,
++ DE6DD45D1A36550100B8A465 /* versionId.c */,
++ DE6DD45E1A36550100B8A465 /* versionId.h */,
++ DE6DD45F1A36550100B8A465 /* xmlparser.c */,
++ DE6DD4601A36550100B8A465 /* xmlparser.h */,
++ DE6DD44E1A3654FA00B8A465 /* msgString.c */,
++ DE6DD44F1A3654FA00B8A465 /* msgString.h */,
++ DE6DD4501A3654FA00B8A465 /* propertyParser.c */,
++ DE6DD4511A3654FA00B8A465 /* propertyParser.h */,
++ DE6DD4521A3654FA00B8A465 /* splashFile.c */,
++ DE6DD4531A3654FA00B8A465 /* splashFile.h */,
++ DE6DD4541A3654FA00B8A465 /* system.c */,
++ DE6DD4551A3654FA00B8A465 /* system.h */,
++ DE6DD4561A3654FA00B8A465 /* util.c */,
++ DE6DD4571A3654FA00B8A465 /* util.h */,
++ DE6DD43C1A3654F100B8A465 /* applicationIcon.c */,
++ DE6DD43D1A3654F100B8A465 /* applicationIcon.h */,
++ DE6DD43E1A3654F100B8A465 /* base64.c */,
++ DE6DD43F1A3654F100B8A465 /* base64.h */,
++ DE6DD4401A3654F100B8A465 /* configurationFile.c */,
++ DE6DD4411A3654F100B8A465 /* configurationFile.h */,
++ DE8B3CA11A37BFA300316F1D /* jfx_runtime_md.c */,
++ DE6DD4421A3654F100B8A465 /* jfx_runtime.c */,
++ DE6DD4431A3654F200B8A465 /* jfx_runtime.h */,
++ DE6DD4441A3654F200B8A465 /* launcher.c */,
++ DE6DD4451A3654F200B8A465 /* launcher.h */,
++ DE6DD4461A3654F200B8A465 /* launchFile.c */,
++ DE6DD4471A3654F200B8A465 /* launchFile.h */,
++ DE8B3C871A37A7BF00316F1D /* BasicPerfHelper.h */,
++ DE8B3C881A37A7BF00316F1D /* BasicPerfStore.cpp */,
++ DE8B3C891A37A7BF00316F1D /* BasicPerfStore.h */,
++ DE8B3C8A1A37A7BF00316F1D /* configcache.h */,
++ DE8B3C8B1A37A7BF00316F1D /* DeployPerf.cpp */,
++ DE8B3C8C1A37A7BF00316F1D /* DeployPerf.h */,
++ DE8B3C8D1A37A7BF00316F1D /* DeployVersion.hpp */,
++ DE8B3C8E1A37A7BF00316F1D /* NativeLock.h */,
++ DE8B3C8F1A37A7BF00316F1D /* NativeLocker.h */,
++ DE8B3C901A37A7BF00316F1D /* PerfHelper.cpp */,
++ DE8B3C911A37A7BF00316F1D /* PerfHelper.h */,
++ DE8B3C921A37A7BF00316F1D /* PerfLabel.cpp */,
++ DE8B3C931A37A7BF00316F1D /* PerfLabel.h */,
++ DE8B3C941A37A7BF00316F1D /* PerfLib.h */,
++ DE8B3C951A37A7BF00316F1D /* PerfStore.h */,
++ DE113B7B1A365449007808D0 /* javaws.1 */,
++ );
++ path = javaws;
++ sourceTree = "<group>";
++ };
++/* End PBXGroup section */
++
++/* Begin PBXNativeTarget section */
++ DE113B751A365449007808D0 /* javaws */ = {
++ isa = PBXNativeTarget;
++ buildConfigurationList = DE113B7F1A365449007808D0 /* Build configuration list for PBXNativeTarget "javaws" */;
++ buildPhases = (
++ DE113B721A365449007808D0 /* Sources */,
++ DE113B731A365449007808D0 /* Frameworks */,
++ DE113B741A365449007808D0 /* CopyFiles */,
++ );
++ buildRules = (
++ );
++ dependencies = (
++ );
++ name = javaws;
++ productName = javaws;
++ productReference = DE113B761A365449007808D0 /* javaws */;
++ productType = "com.apple.product-type.tool";
++ };
++/* End PBXNativeTarget section */
++
++/* Begin PBXProject section */
++ DE113B6E1A365449007808D0 /* Project object */ = {
++ isa = PBXProject;
++ attributes = {
++ LastUpgradeCheck = 0510;
++ ORGANIZATIONNAME = "___FULLUSERNAME___";
++ };
++ buildConfigurationList = DE113B711A365449007808D0 /* Build configuration list for PBXProject "javaws" */;
++ compatibilityVersion = "Xcode 3.2";
++ developmentRegion = English;
++ hasScannedForEncodings = 0;
++ knownRegions = (
++ en,
++ );
++ mainGroup = DE113B6D1A365449007808D0;
++ productRefGroup = DE113B771A365449007808D0 /* Products */;
++ projectDirPath = "";
++ projectRoot = "";
++ targets = (
++ DE113B751A365449007808D0 /* javaws */,
++ );
++ };
++/* End PBXProject section */
++
++/* Begin PBXSourcesBuildPhase section */
++ DE113B721A365449007808D0 /* Sources */ = {
++ isa = PBXSourcesBuildPhase;
++ buildActionMask = 2147483647;
++ files = (
++ DE8B3C851A37A51900316F1D /* UnixTime.cpp in Sources */,
++ DE8B3C831A37A51900316F1D /* Platform.c in Sources */,
++ DE6DD4491A3654F200B8A465 /* base64.c in Sources */,
++ DE8B3C7E1A37A51900316F1D /* expirationdialog.c in Sources */,
++ DE6DD45A1A3654FA00B8A465 /* splashFile.c in Sources */,
++ DE6DD4581A3654FA00B8A465 /* msgString.c in Sources */,
++ DE8B3C971A37A7BF00316F1D /* DeployPerf.cpp in Sources */,
++ DE6DD4611A36550100B8A465 /* versionId.c in Sources */,
++ DE6DD46B1A36555100B8A465 /* system_md.c in Sources */,
++ DE6DD44C1A3654F200B8A465 /* launcher.c in Sources */,
++ DE6DD4591A3654FA00B8A465 /* propertyParser.c in Sources */,
++ DE8B3C7D1A37A51900316F1D /* dialogutils.c in Sources */,
++ DE8B3C861A37A51900316F1D /* webstartblockdialog.c in Sources */,
++ DE6DD4621A36550100B8A465 /* xmlparser.c in Sources */,
++ DE6DD44B1A3654F200B8A465 /* jfx_runtime.c in Sources */,
++ DE6DD44A1A3654F200B8A465 /* configurationFile.c in Sources */,
++ DE8B3CA21A37BFA300316F1D /* jfx_runtime_md.c in Sources */,
++ DE8B3C7C1A37A51900316F1D /* console.c in Sources */,
++ DE8B3C9D1A37A7C600316F1D /* secureArgs.c in Sources */,
++ DE8B3CA01A37A81000316F1D /* jfx_runtime.c in Sources */,
++ DE6DD44D1A3654F200B8A465 /* launchFile.c in Sources */,
++ DE8B3C841A37A51900316F1D /* UnixDomainSocket.c in Sources */,
++ DE8B3C811A37A51900316F1D /* MSystemProxyHandler.c in Sources */,
++ DE6DD4681A36555100B8A465 /* launcher_md.c in Sources */,
++ DE6DD45C1A3654FA00B8A465 /* util.c in Sources */,
++ DE6DD4691A36555100B8A465 /* splash_md.c in Sources */,
++ DE8B3C7B1A37A51900316F1D /* configcache_pd.c in Sources */,
++ DE8B3C981A37A7BF00316F1D /* PerfHelper.cpp in Sources */,
++ DE8B3C961A37A7BF00316F1D /* BasicPerfStore.cpp in Sources */,
++ DE8B3C821A37A51900316F1D /* NetworkUtil.c in Sources */,
++ DE8B3C991A37A7BF00316F1D /* PerfLabel.cpp in Sources */,
++ DE8B3C7A1A37A51900316F1D /* config.c in Sources */,
++ DE6DD45B1A3654FA00B8A465 /* system.c in Sources */,
++ DE6DD4481A3654F200B8A465 /* applicationIcon.c in Sources */,
++ );
++ runOnlyForDeploymentPostprocessing = 0;
++ };
++/* End PBXSourcesBuildPhase section */
++
++/* Begin XCBuildConfiguration section */
++ DE113B7D1A365449007808D0 /* Debug */ = {
++ isa = XCBuildConfiguration;
++ buildSettings = {
++ ALWAYS_SEARCH_USER_PATHS = NO;
++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
++ CLANG_CXX_LIBRARY = "libc++";
++ CLANG_ENABLE_MODULES = YES;
++ CLANG_ENABLE_OBJC_ARC = YES;
++ CLANG_WARN_BOOL_CONVERSION = YES;
++ CLANG_WARN_CONSTANT_CONVERSION = YES;
++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
++ CLANG_WARN_EMPTY_BODY = YES;
++ CLANG_WARN_ENUM_CONVERSION = YES;
++ CLANG_WARN_INT_CONVERSION = YES;
++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
++ COPY_PHASE_STRIP = NO;
++ GCC_C_LANGUAGE_STANDARD = gnu99;
++ GCC_DYNAMIC_NO_PIC = NO;
++ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
++ GCC_OPTIMIZATION_LEVEL = 0;
++ GCC_PREPROCESSOR_DEFINITIONS = (
++ "DEBUG=1",
++ "$(inherited)",
++ );
++ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
++ GCC_WARN_UNDECLARED_SELECTOR = YES;
++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
++ GCC_WARN_UNUSED_FUNCTION = YES;
++ GCC_WARN_UNUSED_VARIABLE = YES;
++ MACOSX_DEPLOYMENT_TARGET = 10.9;
++ ONLY_ACTIVE_ARCH = YES;
++ SDKROOT = macosx;
++ };
++ name = Debug;
++ };
++ DE113B7E1A365449007808D0 /* Release */ = {
++ isa = XCBuildConfiguration;
++ buildSettings = {
++ ALWAYS_SEARCH_USER_PATHS = NO;
++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
++ CLANG_CXX_LIBRARY = "libc++";
++ CLANG_ENABLE_MODULES = YES;
++ CLANG_ENABLE_OBJC_ARC = YES;
++ CLANG_WARN_BOOL_CONVERSION = YES;
++ CLANG_WARN_CONSTANT_CONVERSION = YES;
++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
++ CLANG_WARN_EMPTY_BODY = YES;
++ CLANG_WARN_ENUM_CONVERSION = YES;
++ CLANG_WARN_INT_CONVERSION = YES;
++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
++ COPY_PHASE_STRIP = YES;
++ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
++ ENABLE_NS_ASSERTIONS = NO;
++ GCC_C_LANGUAGE_STANDARD = gnu99;
++ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
++ GCC_WARN_UNDECLARED_SELECTOR = YES;
++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
++ GCC_WARN_UNUSED_FUNCTION = YES;
++ GCC_WARN_UNUSED_VARIABLE = YES;
++ MACOSX_DEPLOYMENT_TARGET = 10.9;
++ SDKROOT = macosx;
++ };
++ name = Release;
++ };
++ DE113B801A365449007808D0 /* Debug */ = {
++ isa = XCBuildConfiguration;
++ buildSettings = {
++ CONFIGURATION_BUILD_DIR = "../../../../../build/macosx-x86_64-normal-server-fastdebug/deploy/jre/bin";
++ FRAMEWORK_SEARCH_PATHS = "";
++ HEADER_SEARCH_PATHS = (
++ "$(inherited)",
++ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
++ /System/Library/Frameworks/JavaVM.framework/Headers,
++ );
++ LIBRARY_SEARCH_PATHS = /System/Library/Frameworks/JavaVM.framework/Headers;
++ PRODUCT_NAME = "$(TARGET_NAME)";
++ USER_HEADER_SEARCH_PATHS = "../../../../src/common/macosx/native ../../../../src/javaws/share/native/version ../../../../src/common/share/native ../../../../../build/macosx-x86_64-normal-server-fastdebug/deploy/headers/common";
++ };
++ name = Debug;
++ };
++ DE113B811A365449007808D0 /* Release */ = {
++ isa = XCBuildConfiguration;
++ buildSettings = {
++ FRAMEWORK_SEARCH_PATHS = "";
++ HEADER_SEARCH_PATHS = (
++ "$(inherited)",
++ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
++ /System/Library/Frameworks/JavaVM.framework/Headers,
++ );
++ LIBRARY_SEARCH_PATHS = /System/Library/Frameworks/JavaVM.framework/Headers;
++ PRODUCT_NAME = "$(TARGET_NAME)";
++ USER_HEADER_SEARCH_PATHS = "../../../../src/common/macosx/native ../../../../src/javaws/share/native/version ../../../../src/common/share/native ../../../../../build/macosx-x86_64-normal-server-fastdebug/deploy/headers/common";
++ };
++ name = Release;
++ };
++/* End XCBuildConfiguration section */
++
++/* Begin XCConfigurationList section */
++ DE113B711A365449007808D0 /* Build configuration list for PBXProject "javaws" */ = {
++ isa = XCConfigurationList;
++ buildConfigurations = (
++ DE113B7D1A365449007808D0 /* Debug */,
++ DE113B7E1A365449007808D0 /* Release */,
++ );
++ defaultConfigurationIsVisible = 0;
++ defaultConfigurationName = Release;
++ };
++ DE113B7F1A365449007808D0 /* Build configuration list for PBXNativeTarget "javaws" */ = {
++ isa = XCConfigurationList;
++ buildConfigurations = (
++ DE113B801A365449007808D0 /* Debug */,
++ DE113B811A365449007808D0 /* Release */,
++ );
++ defaultConfigurationIsVisible = 0;
++ defaultConfigurationName = Release;
++ };
++/* End XCConfigurationList section */
++ };
++ rootObject = DE113B6E1A365449007808D0 /* Project object */;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./test/projects/mac/javaws/javaws.xcodeproj/project.xcworkspace/contents.xcworkspacedata Wed Jul 01 21:51:50 2015 -0700
+@@ -0,0 +1,7 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<Workspace
++ version = "1.0">
++ <FileRef
++ location = "self:javaws.xcodeproj">
++ </FileRef>
++</Workspace>
+--- ./corba/.hgtags Mon Jun 01 11:40:22 2015 -0700
++++ ./corba/.hgtags Wed Jul 01 21:51:57 2015 -0700
+@@ -352,7 +352,6 @@
+ f89b454638d89ee5f44422b7a5b8e5651260e68f jdk8u31-b13
+ 705d3a4298f44f0a14925bfee5017f5824b6c0ca jdk8u31-b31
+ 072d325a052a5894019b74118803bf5fb9e30692 jdk8u31-b32
+-bfd820cde577ba687222196e6c5159d9763df887 jdk8u31-b33
+ 7d1e0f0b63f1d66c77924d8b2a1accdf8f7480db jdk8u40-b00
+ c5d9822a3c18cd9e274dfe99e91c33e02bd8f8f4 jdk8u40-b01
+ 504b4455570e14b7fc0a837a09c6401c603516d9 jdk8u40-b02
+@@ -381,8 +380,6 @@
+ 2220744100b8487976debff79e5d0c7d70738bda jdk8u40-b25
+ cab2b99c6bb2e15165a58eaa36157788f82592f1 jdk8u40-b26
+ bd0186cd2419129357b110fe3f13519f68b29774 jdk8u40-b27
+-28a1dbd4bb9ec97427790c88d21514af2f878c94 jdk8u40-b31
+-663a3151c688bc3f4c092bcad21cc81e29139d62 jdk8u40-b32
+ 5761efbc739fdedcbff224e22f920e88b29af4cf jdk8u45-b00
+ 6a52852476c9ccb2d52153d1b94b675e863bb28c jdk8u45-b01
+ 3b9d342f9f584465ea5976e06357b45682f9681d jdk8u45-b02
+@@ -398,22 +395,26 @@
+ c9bf2543c0c045ef31f0296bc355381e1a4bd4ac jdk8u45-b12
+ 326f02235e7a9a6da78428410320dcc980827d40 jdk8u45-b13
+ 50fb9bed64c9366b7bf68bddcdc553cd7295d905 jdk8u45-b14
+-4afc048fe6ff7fc3fdbdadd8027549805c426d0d jdk8u45-b15
+-e67045c893eaf5e3336c4fd849786fa15b81b601 jdk8u45-b31
+-f2aeb52cb7cef1f984661a583baac67402f633a5 jdk8u45-b32
+-72d116eea419824044f8dd4ae9d3a012946f72a4 jdk8u51-b00
+-b9638b9fe23876fd2413f336ee1d4e05d409e6a9 jdk8u51-b01
+-bc5562ed3c2d69ffbff357e96d9e383479042000 jdk8u51-b02
+-75c09ffd6c62f90153e4b043e0b40db4fa03954d jdk8u51-b03
+-66908961baaec267141b1e80d04feed0c93f68fe jdk8u51-b04
+-1c0a26d561f3a6b2d5a4c91161d7c92409d5f227 jdk8u51-b05
+-dba5c9ee56abce73e1f6ed99a36a99d6907266c6 jdk8u51-b06
+-00d57e68b59879ee59352ae18c7e40216d9e2243 jdk8u51-b07
+-47492841bb10e6c995c68be533d2b4905856a17e jdk8u51-b08
+-b9e5fa1d3f251d5cce02d1e7ff97279064aecdb1 jdk8u51-b09
+-0011162b38bf4dab36c72bf25640c59d7128274a jdk8u51-b10
+-4d59046bdb8a05cfb9e07d8e18d44956f700fe29 jdk8u51-b11
+-e51a2deadf774452d98b339d65d33c72a466a453 jdk8u51-b12
+-4886143e8749caf2ec42a6e77c70a98516e140a3 jdk8u51-b13
+-1fbfa02e524872a75e98ee3a80e2472fa7012fde jdk8u51-b14
+-d6e1f914c954f98caa31edd0037837830774dfb6 jdk8u51-b15
++8bbc2bb414b7e9331c2014c230553d72c9d161c5 jdk8u60-b00
++15ae8298b34beb30f2bd7baa7ff895af2bec13f6 jdk8u60-b01
++a98524c04cbd24bbc3029b21c033abf9108e92b4 jdk8u60-b02
++50cef81aa68539d0af7c5c48e370108a5b0d5a4f jdk8u60-b03
++d0e7c0ba4671c6a20ba5885e075ffa7196b738a1 jdk8u60-b04
++983825f6835055c24ed7580b6d4bd2f4e17e5425 jdk8u60-b05
++587b011966468537b1ff40a007aa51e52c823bc8 jdk8u60-b06
++058a6dd8d04cbb3d3bcc0b9d60dd05111fb37b22 jdk8u60-b07
++b184ceca742eb1a6469442af91f918ac1e1cf95c jdk8u60-b08
++e8af97f98cad81672e713c1af68d9059792a4ef2 jdk8u60-b09
++bd691208dfd6c97ffd10e2314f457d7badc47dab jdk8u60-b10
++43892f96d79eea91e67c193141f76ec31eb351d8 jdk8u60-b11
++449f9a900771900310a3f49e034c4cca478c6aff jdk8u60-b12
++b4e22b44d44664a3aa4fc2737cd63115328084b1 jdk8u60-b13
++c4108e15fbde9c67f5085aa60cd9f03e69d245dd jdk8u60-b14
++68b50073c52a2c77aa35f90d6cfdec966effc4ef jdk8u60-b15
++3b19c17ea11c3831a8a0099d6d7a1a3c7e4897c4 jdk8u60-b16
++7ef66778231f234b69515202b2dc2287143ecb49 jdk8u60-b17
++cf83b578af1935db8474d01b8642e4803a534d3a jdk8u60-b18
++eb0caffe34c6bea2ff40966757142b3dcd3a2a4c jdk8u60-b19
++4f3a29adbf4cfa2127e1108d82aaaa0d29f3c583 jdk8u60-b20
++d68de92de3bad991546b11d77de6e9c17edf7ec2 jdk8u60-b21
++3a04901d83880634ecd70c8be992189228ccd746 jdk8u60-b22
+--- ./corba/THIRD_PARTY_README Mon Jun 01 11:40:22 2015 -0700
++++ ./corba/THIRD_PARTY_README Wed Jul 01 21:51:57 2015 -0700
+@@ -1140,37 +1140,6 @@
+
+ --------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to JSON, which may be included
+-with JRE 8 & JDK 8.
+-
+---- begin of LICENSE ---
+-
+-Copyright (c) 2002 JSON.org
+-
+-Permission is hereby granted, free of charge, to any person obtaining a copy
+-of this software and associated documentation files (the "Software"), to deal
+-in the Software without restriction, including without limitation the rights
+-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-copies of the Software, and to permit persons to whom the Software is
+-furnished to do so, subject to the following conditions:
+-
+-The above copyright notice and this permission notice shall be included in all
+-copies or substantial portions of the Software.
+-
+-The Software shall be used for Good, not Evil.
+-
+-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-SOFTWARE.
+-
+---- end of LICENSE ---
+-
+--------------------------------------------------------------------------------
+-
+ %% This notice is provided with respect to Kerberos functionality, which
+ which may be included with JRE 8, JDK 8, and OpenJDK 8.
+
+@@ -1250,7 +1219,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libpng 1.6.16, which may be
++%% This notice is provided with respect to libpng 1.6.16, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1370,7 +1339,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libungif 4.1.3, which may be
++%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1399,13 +1368,13 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to Little CMS 2.5, which may be
++%% This notice is provided with respect to Little CMS 2.7, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+
+ Little CMS
+-Copyright (c) 1998-2011 Marti Maria Saguer
++Copyright (c) 1998-2015 Marti Maria Saguer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+--- ./corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Mon Jun 01 11:40:22 2015 -0700
++++ ./corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Wed Jul 01 21:51:57 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -1768,43 +1768,59 @@
+ switch (field.getTypeCode()) {
+ case 'B':
+ byte byteValue = orbStream.read_octet();
+- bridge.putByte( o, field.getFieldID(), byteValue ) ;
+- //reflective code: field.getField().setByte( o, byteValue ) ;
++ if (field.getField() != null) {
++ bridge.putByte( o, field.getFieldID(), byteValue ) ;
++ //reflective code: field.getField().setByte( o, byteValue ) ;
++ }
+ break;
+ case 'Z':
+ boolean booleanValue = orbStream.read_boolean();
+- bridge.putBoolean( o, field.getFieldID(), booleanValue ) ;
+- //reflective code: field.getField().setBoolean( o, booleanValue ) ;
++ if (field.getField() != null) {
++ bridge.putBoolean( o, field.getFieldID(), booleanValue ) ;
++ //reflective code: field.getField().setBoolean( o, booleanValue ) ;
++ }
+ break;
+ case 'C':
+ char charValue = orbStream.read_wchar();
+- bridge.putChar( o, field.getFieldID(), charValue ) ;
+- //reflective code: field.getField().setChar( o, charValue ) ;
++ if (field.getField() != null) {
++ bridge.putChar( o, field.getFieldID(), charValue ) ;
++ //reflective code: field.getField().setChar( o, charValue ) ;
++ }
+ break;
+ case 'S':
+ short shortValue = orbStream.read_short();
+- bridge.putShort( o, field.getFieldID(), shortValue ) ;
+- //reflective code: field.getField().setShort( o, shortValue ) ;
++ if (field.getField() != null) {
++ bridge.putShort( o, field.getFieldID(), shortValue ) ;
++ //reflective code: field.getField().setShort( o, shortValue ) ;
++ }
+ break;
+ case 'I':
+ int intValue = orbStream.read_long();
+- bridge.putInt( o, field.getFieldID(), intValue ) ;
+- //reflective code: field.getField().setInt( o, intValue ) ;
++ if (field.getField() != null) {
++ bridge.putInt( o, field.getFieldID(), intValue ) ;
++ //reflective code: field.getField().setInt( o, intValue ) ;
++ }
+ break;
+ case 'J':
+ long longValue = orbStream.read_longlong();
+- bridge.putLong( o, field.getFieldID(), longValue ) ;
+- //reflective code: field.getField().setLong( o, longValue ) ;
++ if (field.getField() != null) {
++ bridge.putLong( o, field.getFieldID(), longValue ) ;
++ //reflective code: field.getField().setLong( o, longValue ) ;
++ }
+ break;
+ case 'F' :
+ float floatValue = orbStream.read_float();
+- bridge.putFloat( o, field.getFieldID(), floatValue ) ;
+- //reflective code: field.getField().setFloat( o, floatValue ) ;
++ if (field.getField() != null) {
++ bridge.putFloat( o, field.getFieldID(), floatValue ) ;
++ //reflective code: field.getField().setFloat( o, floatValue ) ;
++ }
+ break;
+ case 'D' :
+ double doubleValue = orbStream.read_double();
+- bridge.putDouble( o, field.getFieldID(), doubleValue ) ;
+- //reflective code: field.getField().setDouble( o, doubleValue ) ;
++ if (field.getField() != null) {
++ bridge.putDouble( o, field.getFieldID(), doubleValue ) ;
++ //reflective code: field.getField().setDouble( o, doubleValue ) ;
++ }
+ break;
+ default:
+ // XXX I18N, logging needed.
+@@ -2217,9 +2233,6 @@
+
+ if (o != null) {
+ for (int i = 0; i < primFields; ++i) {
+- if (fields[i].getField() == null)
+- continue;
+-
+ inputPrimitiveField(o, cl, fields[i]);
+ }
+ }
+@@ -2417,8 +2430,8 @@
+ private void throwAwayData(ValueMember[] fields,
+ com.sun.org.omg.SendingContext.CodeBase sender)
+ throws InvalidClassException, StreamCorruptedException,
+- ClassNotFoundException, IOException {
+-
++ ClassNotFoundException, IOException
++ {
+ for (int i = 0; i < fields.length; ++i) {
+
+ try {
+@@ -2553,7 +2566,8 @@
+
+ }
+
+- private static void setObjectField(Object o, Class c, String fieldName, Object v) {
++ private static void setObjectField(Object o, Class c, String fieldName, Object v)
++ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+ Class fieldCl = fld.getType();
+@@ -2563,15 +2577,9 @@
+ long key = bridge.objectFieldOffset( fld ) ;
+ bridge.putObject( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+- throw utilWrapper.errorSetObjectField( e, fieldName,
+- o.toString(),
+- v.toString() ) ;
+- } else {
+- throw utilWrapper.errorSetObjectField( e, fieldName,
+- "null " + c.getName() + " object",
+- v.toString() ) ;
+- }
++ throw utilWrapper.errorSetObjectField( e, fieldName,
++ o.toString(),
++ v.toString() ) ;
+ }
+ }
+
+@@ -2579,22 +2587,12 @@
+ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+- if ((fld != null) && (fld.getType() == Boolean.TYPE)) {
+- long key = bridge.objectFieldOffset( fld ) ;
+- bridge.putBoolean( o, key, v ) ;
+- } else {
+- throw new InvalidObjectException("Field Type mismatch");
+- }
++ long key = bridge.objectFieldOffset( fld ) ;
++ bridge.putBoolean( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+ throw utilWrapper.errorSetBooleanField( e, fieldName,
+ o.toString(),
+ new Boolean(v) ) ;
+- } else {
+- throw utilWrapper.errorSetBooleanField( e, fieldName,
+- "null " + c.getName() + " object",
+- new Boolean(v) ) ;
+- }
+ }
+ }
+
+@@ -2602,22 +2600,12 @@
+ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+- if ((fld != null) && (fld.getType() == Byte.TYPE)) {
+- long key = bridge.objectFieldOffset( fld ) ;
+- bridge.putByte( o, key, v ) ;
+- } else {
+- throw new InvalidObjectException("Field Type mismatch");
+- }
++ long key = bridge.objectFieldOffset( fld ) ;
++ bridge.putByte( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+- throw utilWrapper.errorSetByteField( e, fieldName,
+- o.toString(),
+- new Byte(v) ) ;
+- } else {
+- throw utilWrapper.errorSetByteField( e, fieldName,
+- "null " + c.getName() + " object",
+- new Byte(v) ) ;
+- }
++ throw utilWrapper.errorSetByteField( e, fieldName,
++ o.toString(),
++ new Byte(v) ) ;
+ }
+ }
+
+@@ -2625,22 +2613,12 @@
+ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+- if ((fld != null) && (fld.getType() == Character.TYPE)) {
+- long key = bridge.objectFieldOffset( fld ) ;
+- bridge.putChar( o, key, v ) ;
+- } else {
+- throw new InvalidObjectException("Field Type mismatch");
+- }
++ long key = bridge.objectFieldOffset( fld ) ;
++ bridge.putChar( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+- throw utilWrapper.errorSetCharField( e, fieldName,
+- o.toString(),
+- new Character(v) ) ;
+- } else {
+- throw utilWrapper.errorSetCharField( e, fieldName,
+- "null " + c.getName() + " object",
+- new Character(v) ) ;
+- }
++ throw utilWrapper.errorSetCharField( e, fieldName,
++ o.toString(),
++ new Character(v) ) ;
+ }
+ }
+
+@@ -2648,22 +2626,12 @@
+ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+- if ((fld != null) && (fld.getType() == Short.TYPE)) {
+- long key = bridge.objectFieldOffset( fld ) ;
+- bridge.putShort( o, key, v ) ;
+- } else {
+- throw new InvalidObjectException("Field Type mismatch");
+- }
++ long key = bridge.objectFieldOffset( fld ) ;
++ bridge.putShort( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+ throw utilWrapper.errorSetShortField( e, fieldName,
+ o.toString(),
+ new Short(v) ) ;
+- } else {
+- throw utilWrapper.errorSetShortField( e, fieldName,
+- "null " + c.getName() + " object",
+- new Short(v) ) ;
+- }
+ }
+ }
+
+@@ -2671,22 +2639,12 @@
+ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+- if ((fld != null) && (fld.getType() == Integer.TYPE)) {
+- long key = bridge.objectFieldOffset( fld ) ;
+- bridge.putInt( o, key, v ) ;
+- } else {
+- throw new InvalidObjectException("Field Type mismatch");
+- }
++ long key = bridge.objectFieldOffset( fld ) ;
++ bridge.putInt( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+- throw utilWrapper.errorSetIntField( e, fieldName,
+- o.toString(),
+- new Integer(v) ) ;
+- } else {
+- throw utilWrapper.errorSetIntField( e, fieldName,
+- "null " + c.getName() + " object",
+- new Integer(v) ) ;
+- }
++ throw utilWrapper.errorSetIntField( e, fieldName,
++ o.toString(),
++ new Integer(v) ) ;
+ }
+ }
+
+@@ -2694,22 +2652,12 @@
+ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+- if ((fld != null) && (fld.getType() == Long.TYPE)) {
+- long key = bridge.objectFieldOffset( fld ) ;
+- bridge.putLong( o, key, v ) ;
+- } else {
+- throw new InvalidObjectException("Field Type mismatch");
+- }
++ long key = bridge.objectFieldOffset( fld ) ;
++ bridge.putLong( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+- throw utilWrapper.errorSetLongField( e, fieldName,
+- o.toString(),
+- new Long(v) ) ;
+- } else {
+- throw utilWrapper.errorSetLongField( e, fieldName,
+- "null " + c.getName() + " object",
+- new Long(v) ) ;
+- }
++ throw utilWrapper.errorSetLongField( e, fieldName,
++ o.toString(),
++ new Long(v) ) ;
+ }
+ }
+
+@@ -2717,22 +2665,12 @@
+ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+- if ((fld != null) && (fld.getType() == Float.TYPE)) {
+- long key = bridge.objectFieldOffset( fld ) ;
+- bridge.putFloat( o, key, v ) ;
+- } else {
+- throw new InvalidObjectException("Field Type mismatch");
+- }
++ long key = bridge.objectFieldOffset( fld ) ;
++ bridge.putFloat( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+- throw utilWrapper.errorSetFloatField( e, fieldName,
+- o.toString(),
+- new Float(v) ) ;
+- } else {
+- throw utilWrapper.errorSetFloatField( e, fieldName,
+- "null " + c.getName() + " object",
+- new Float(v) ) ;
+- }
++ throw utilWrapper.errorSetFloatField( e, fieldName,
++ o.toString(),
++ new Float(v) ) ;
+ }
+ }
+
+@@ -2740,22 +2678,12 @@
+ {
+ try {
+ Field fld = c.getDeclaredField( fieldName ) ;
+- if ((fld != null) && (fld.getType() == Double.TYPE)) {
+- long key = bridge.objectFieldOffset( fld ) ;
+- bridge.putDouble( o, key, v ) ;
+- } else {
+- throw new InvalidObjectException("Field Type mismatch");
+- }
++ long key = bridge.objectFieldOffset( fld ) ;
++ bridge.putDouble( o, key, v ) ;
+ } catch (Exception e) {
+- if (o != null) {
+- throw utilWrapper.errorSetDoubleField( e, fieldName,
+- o.toString(),
+- new Double(v) ) ;
+- } else {
+- throw utilWrapper.errorSetDoubleField( e, fieldName,
+- "null " + c.getName() + " object",
+- new Double(v) ) ;
+- }
++ throw utilWrapper.errorSetDoubleField( e, fieldName,
++ o.toString(),
++ new Double(v) ) ;
+ }
+ }
+
+--- ./corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java Mon Jun 01 11:40:22 2015 -0700
++++ ./corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java Wed Jul 01 21:51:57 2015 -0700
+@@ -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
+@@ -32,6 +32,7 @@
+ package com.sun.corba.se.impl.io;
+
+ import java.io.IOException;
++import java.io.NotActiveException;
+ import java.io.OutputStream;
+ import java.io.ObjectOutputStream;
+ import java.io.ObjectOutput;
+@@ -154,7 +155,9 @@
+
+ public ObjectOutputStream.PutField putFields()
+ throws IOException {
+- putFields = new HookPutFields();
++ if (putFields == null) {
++ putFields = new HookPutFields();
++ }
+ return putFields;
+ }
+
+@@ -175,8 +178,11 @@
+ throws IOException {
+
+ writeObjectState.defaultWriteObject(this);
+-
+- putFields.write(this);
++ if (putFields != null) {
++ putFields.write(this);
++ } else {
++ throw new NotActiveException("no current PutField object");
++ }
+ }
+
+ abstract org.omg.CORBA_2_3.portable.OutputStream getOrbStream();
+--- ./corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties Mon Jun 01 11:40:22 2015 -0700
++++ ./corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties Wed Jul 01 21:51:57 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2000, 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
+@@ -100,7 +100,7 @@
+ tnameserv.orbinitialport0=ORBInitialPort 0 \u00E4r inte ett giltigt alternativ f\u00F6r NameService
+ tnameserv.hs1=Ursprunglig namngivningskontext:\n{0}
+ tnameserv.hs2=TransientNameServer: st\u00E4ller in port f\u00F6r ursprungliga objektreferenser till: {0}
+-tnameserv.hs3=Redo.
++tnameserv.hs3=Klar.
+
+ orbd.commfailure=\nKunde inte starta ORBD eftersom ORBinitialport redan anv\u00E4nds
+ orbd.internalexception=\nKunde inte starta ORBD p\u00E5 grund av internt undantag. \nM\u00F6jliga orsaker: \n1. Angivet ORBInitialPort eller ORBActivationPort anv\u00E4ndas redan \n2. Ingen beh\u00F6righet att skriva till orb.db
+--- ./corba/src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java Mon Jun 01 11:40:22 2015 -0700
++++ ./corba/src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java Wed Jul 01 21:51:57 2015 -0700
+@@ -77,7 +77,7 @@
+ *
+ * throw SecurityException if SecurityManager is installed and
+ * enableSubclassImplementation SerializablePermission
+- * is not granted or jdk.corba.allowOutputStreamSubclass system
++ * is not granted or jdk.corba.allowInputStreamSubclass system
+ * property is either not set or is set to 'false'
+ */
+ public InputStream() {
+--- ./hotspot/.hgtags Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/.hgtags Wed Jul 01 21:52:18 2015 -0700
+@@ -565,7 +565,6 @@
+ 4206e725d584be942c25ff46ff23d8e299ca4a4c jdk8u31-b13
+ b517d3a9aebf0fee64808f9a7c0ef8e0b82d5ed3 jdk8u31-b31
+ 15d8108258cb60a58bdd03b9ff8e77dd6727a804 jdk8u31-b32
+-26b1dc6891c4fae03575a9090f7d04bd631d9164 jdk8u31-b33
+ 1b3abbeee961dee49780c0e4af5337feb918c555 jdk8u40-b10
+ f10fe402dfb1543723b4b117a7cba3ea3d4159f1 hs25.40-b15
+ 99372b2fee0eb8b3452f47230e84aa6e97003184 jdk8u40-b11
+@@ -595,8 +594,6 @@
+ 698dd28ecc785ffc43e3f12266b13e85382c26a8 jdk8u40-b25
+ f39b6944ad447269b81e06ca5da9edff9e9e67c8 jdk8u40-b26
+ 6824e2475e0432e27f9cc51838bc34ea5fbf5113 jdk8u40-b27
+-8220f68a195f6eeed2f5fb6e8a303726b512e899 jdk8u40-b31
+-850a290eb1088a61178d1910c500e170ef4f4386 jdk8u40-b32
+ b95f13f05f553309cd74d6ccf8fcedb259c6716c jdk8u45-b00
+ 41c3c456e326185053f0654be838f4b0bfb38078 jdk8u45-b01
+ 626fd8c2eec63e2a2dff3839bfe12c0431bf00a4 jdk8u45-b02
+@@ -612,22 +609,49 @@
+ dc29108bcbcbfcd49eaa9135368306dc85db73a6 jdk8u45-b12
+ efbf340fc7f56e49735111c23cef030413146409 jdk8u45-b13
+ 5321d26956b283b7cb73b04b91db41c7c9fe9158 jdk8u45-b14
+-a5ba7c9a0b916ea088aaac5d40e17b4675c2b026 jdk8u45-b15
+-894b92a02c533bcd1203c4beb5b6ec067b63466e jdk8u45-b31
+-1428b6aa09c4e17202b801530c3c4993c7ce8e5b jdk8u45-b32
+-b22b01407a8140041545afe1f2d6335db4d94ba5 jdk8u51-b00
+-c1de2652a48c1d4a0c96707acc73db3cd317df2a jdk8u51-b01
+-8f03c2f5fc170da5fca2cf65734941efb619feca jdk8u51-b02
+-cf295659243009ded76b6c14307c177a02f9fe82 jdk8u51-b03
+-0b3f449553884d88f6c9d7ab067fa858f18cc3f1 jdk8u51-b04
+-6ce994385353023e6b3f9c5ef331f390b324a355 jdk8u51-b05
+-3816de51b5e7d6050584057fae5f2262dae53d7e jdk8u51-b06
+-5c017acbaf015fb8ecca6f00870965f3deb4e1ac jdk8u51-b07
+-631d4029d851b59613e6748e17447001a682276e jdk8u51-b08
+-ce81c4487dd1e9f89d4570a8cd25e349f6bae00d jdk8u51-b09
+-928e1994ad43272f808ca22b9cc1b08a7ce2824f jdk8u51-b10
+-1a122beb9dc6881850ef1d1250f40a83709b8b72 jdk8u51-b11
+-05c80f1060f0c0d5720de9eadd09162af1168eab jdk8u51-b12
+-07e103f3f43886a3b47945e5295eb5accad505de jdk8u51-b13
+-a4eea4bee2d4fdb05f1a8358d70ec6adb1135526 jdk8u51-b14
+-9a70cba6a3c3e44486f9c199d03a16b2b09d0a13 jdk8u51-b15
++d9349fa8822336e0244da0a8448f3e6b2d62741d jdk8u60-b00
++d9349fa8822336e0244da0a8448f3e6b2d62741d hs25.60-b00
++ebf89088c08ab0508b9002b48dd3d68a340259af hs25.60-b01
++5fa73007ceb92a13742fc4a24ec935a6494f8045 hs25.60-b02
++702cc6067686acaa45f7b455b7490edc056c2ae0 jdk8u60-b01
++1f6ba0d2923dadba87aac4ed779dd1ed0161ec2b hs25.60-b03
++38f6080523831ae9a6907c780f2042b82f3213ca jdk8u60-b02
++9d6eb2757167744a17ea71f8b860430d70941eda jdk8u60-b03
++0fb1ac49ae7764c5d7c6dfb9fe046d0e1a4eb5aa hs25.60-b04
++586a449cd30332dd53c0f74bf2ead6f3d4724bfc jdk8u60-b04
++74931e85352be8556eaa511ca0dd7c38fe272ec3 hs25.60-b05
++b13f1890afb8abc31ecb9c21fd2ba95aba3e33f8 jdk8u60-b05
++b17a8a22a0344e3c93e2e4677de20d35f99cf4f5 hs25.60-b06
++7b70923c8e04920b60278f90ad23a63c773cee7b jdk8u60-b06
++d51ef6da82b486e7b2b3c08eef9ca0a186935ded hs25.60-b07
++353e580ce6878d80c7b7cd27f8ad24609b12c58b jdk8u60-b07
++a72a4192a36d6d84766d6135fe6515346c742007 hs25.60-b08
++bf68e15dc8fe73eeb1eb3c656df51fdb1f707a97 jdk8u60-b08
++d937e6a0674841d670232ecf1611f52e1ae998e7 hs25.60-b09
++f1058b5c6294235d8ad032dcc72c8f8bc202cb5a jdk8u60-b09
++57a14c3927eba6372d909ae164fa90bb9b6a6ce4 hs25.60-b10
++8e4518dc2b38957072704ffe4cbf29f046dc9325 jdk8u60-b10
++64a32bc18e88eed6131ed036dc3e10e566ef339b hs25.60-b11
++d8f133adf05d310bd7e1d9adf32cbeb71ff33c37 jdk8u60-b11
++4390345de45c7768c04bfafabf006a401824c5b5 hs25.60-b12
++ccca7162738eee1be74890342c67d3b26540dcf6 jdk8u60-b12
++ced08ed4924fc6581626c7ce2d769fc18d7b23e0 jdk8u60-b13
++30e04eba9e298cc5094793e279306535239187cc hs25.60-b13
++1f0d760ccac1ff82a03a9b7d6bd5c697ef0a7c4a hs25.60-b14
++c9f8b7319d0a5ab07310cf53507642a8fd91589b jdk8u60-b14
++4187dc92e90b16b4097627b8af4f5e6e63f3b497 hs25.60-b15
++b99f1bf208f385277b03a985d35b6614b4095f3e jdk8u60-b15
++f5800068c61d0627c14e99836e9ce5cf0ef00075 hs25.60-b16
++ab2353694ea7fd4907c5c88b8334f8feaafca8c7 jdk8u60-b16
++5efc25c367164b6856554b0d625f3c422fdf9558 hs25.60-b17
++c26d09f1065cd26bd8b926efc5d3938b71e09eb5 jdk8u60-b17
++624f4cc05e7e95dd2103f343c54d7bdea6a81919 hs25.60-b18
++3fa5c654c143fe309e5ddda92adc5fb132365bcf jdk8u60-b18
++b852350a2bc6d5f43006e2be53fb74d148290708 hs25.60-b19
++bd9221771f6e34e63b3b340ffcf9906ccf882dae jdk8u60-b19
++e01a710549a962cee94728271248a7d89fb56c49 hs25.60-b20
++3b6c97747ccc61d189bca64b4afa3ffc13680810 jdk8u60-b20
++4b6687a4f2fe84211b8b3b5afb34b5186afbddf6 hs25.60-b21
++e0d75c284bd1c09fd7d9ef09627d8a99b88d468d jdk8u60-b21
++ff8fdeb2fb6d6f3348597339c53412f8f6202c3f hs25.60-b22
++878cb0df27c22c6b1e9f4add1eb3da3edc8ab51d jdk8u60-b22
+--- ./hotspot/THIRD_PARTY_README Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/THIRD_PARTY_README Wed Jul 01 21:52:18 2015 -0700
+@@ -1140,37 +1140,6 @@
+
+ --------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to JSON, which may be included
+-with JRE 8 & JDK 8.
+-
+---- begin of LICENSE ---
+-
+-Copyright (c) 2002 JSON.org
+-
+-Permission is hereby granted, free of charge, to any person obtaining a copy
+-of this software and associated documentation files (the "Software"), to deal
+-in the Software without restriction, including without limitation the rights
+-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-copies of the Software, and to permit persons to whom the Software is
+-furnished to do so, subject to the following conditions:
+-
+-The above copyright notice and this permission notice shall be included in all
+-copies or substantial portions of the Software.
+-
+-The Software shall be used for Good, not Evil.
+-
+-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-SOFTWARE.
+-
+---- end of LICENSE ---
+-
+--------------------------------------------------------------------------------
+-
+ %% This notice is provided with respect to Kerberos functionality, which
+ which may be included with JRE 8, JDK 8, and OpenJDK 8.
+
+@@ -1250,7 +1219,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libpng 1.6.16, which may be
++%% This notice is provided with respect to libpng 1.6.16, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1370,7 +1339,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libungif 4.1.3, which may be
++%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1399,13 +1368,13 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to Little CMS 2.5, which may be
++%% This notice is provided with respect to Little CMS 2.7, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+
+ Little CMS
+-Copyright (c) 1998-2011 Marti Maria Saguer
++Copyright (c) 1998-2015 Marti Maria Saguer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+--- ./hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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,7 +26,7 @@
+ #import <Foundation/Foundation.h>
+ #import <JavaNativeFoundation/JavaNativeFoundation.h>
+
+-#include <JavaVM/jni.h>
++#include <jni.h>
+
+ #import <mach/mach.h>
+ #import <mach/mach_types.h>
+--- ./hotspot/agent/src/os/bsd/Makefile Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/os/bsd/Makefile Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2002, 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
+@@ -50,9 +50,9 @@
+ ps_core.c
+ OBJS = $(SOURCES:.c=.o)
+ OBJSPLUS = MacosxDebuggerLocal.o sadis.o $(OBJS)
+-EXTINCLUDE = -I/System/Library/Frameworks/JavaVM.framework/Headers -I.
++EXTINCLUDE = -I.
+ EXTCFLAGS = -m64 -D__APPLE__ -framework JavaNativeFoundation
+-FOUNDATIONFLAGS = -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
++FOUNDATIONFLAGS = -framework Foundation -framework JavaNativeFoundation -framework Security -framework CoreFoundation
+ LIBSA = $(ARCH)/libsaproc.dylib
+ endif # Darwin
+
+--- ./hotspot/agent/src/os/linux/libproc.h Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/os/linux/libproc.h Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2013, 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
+@@ -30,7 +30,7 @@
+ #include <stdint.h>
+ #include "proc_service.h"
+
+-#if defined(arm) || defined(ppc)
++#ifdef ALT_SASRCDIR
+ #include "libproc_md.h"
+ #endif
+
+--- ./hotspot/agent/src/os/linux/ps_proc.c Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/os/linux/ps_proc.c Wed Jul 01 21:52:18 2015 -0700
+@@ -27,9 +27,11 @@
+ #include <string.h>
+ #include <signal.h>
+ #include <errno.h>
++#include <elf.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/ptrace.h>
++#include <sys/uio.h>
+ #include "libproc_impl.h"
+
+ #if defined(x86_64) && !defined(amd64)
+@@ -138,6 +140,15 @@
+ return false;
+ }
+ return true;
++#elif defined(PTRACE_GETREGSET)
++ struct iovec iov;
++ iov.iov_base = user;
++ iov.iov_len = sizeof(*user);
++ if (ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, (void*) &iov) < 0) {
++ print_debug("ptrace(PTRACE_GETREGSET, ...) failed for lwp %d\n", pid);
++ return false;
++ }
++ return true;
+ #else
+ print_debug("ptrace(PTRACE_GETREGS, ...) not supported\n");
+ return false;
+--- ./hotspot/agent/src/os/solaris/proc/saproc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/os/solaris/proc/saproc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -314,7 +314,7 @@
+ handle = dlopen(name, mode);
+ }
+ if (_libsaproc_debug) {
+- printf("libsaproc DEBUG: pathmap_dlopen %s return 0x%x\n", name, handle);
++ printf("libsaproc DEBUG: pathmap_dlopen %s return 0x%lx\n", name, (unsigned long) handle);
+ }
+ return handle;
+ }
+@@ -661,30 +661,30 @@
+ // read FileMapHeader
+ size_t n = read(fd, pheader, sizeof(struct FileMapHeader));
+ if (n != sizeof(struct FileMapHeader)) {
+- free(pheader);
+- close(fd);
+ char errMsg[ERR_MSG_SIZE];
+ sprintf(errMsg, "unable to read shared archive file map header from %s", classes_jsa);
++ close(fd);
++ free(pheader);
+ THROW_NEW_DEBUGGER_EXCEPTION_(errMsg, 1);
+ }
+
+ // check file magic
+ if (pheader->_magic != 0xf00baba2) {
+- free(pheader);
+- close(fd);
+ char errMsg[ERR_MSG_SIZE];
+ sprintf(errMsg, "%s has bad shared archive magic 0x%x, expecting 0xf00baba2",
+ classes_jsa, pheader->_magic);
++ close(fd);
++ free(pheader);
+ THROW_NEW_DEBUGGER_EXCEPTION_(errMsg, 1);
+ }
+
+ // check version
+ if (pheader->_version != CURRENT_ARCHIVE_VERSION) {
+- free(pheader);
+- close(fd);
+ char errMsg[ERR_MSG_SIZE];
+ sprintf(errMsg, "%s has wrong shared archive version %d, expecting %d",
+ classes_jsa, pheader->_version, CURRENT_ARCHIVE_VERSION);
++ close(fd);
++ free(pheader);
+ THROW_NEW_DEBUGGER_EXCEPTION_(errMsg, 1);
+ }
+
+--- ./hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java Wed Jul 01 21:52:18 2015 -0700
+@@ -46,6 +46,11 @@
+ return manager;
+ }
+
++ protected static void setInstance(ActionManager m)
++ {
++ manager = m;
++ }
++
+ protected abstract void addActions();
+
+ protected void addAction(String cmdname, Action action)
+@@ -90,6 +95,6 @@
+
+ private HashMap actions;
+ private static ActionUtilities utilities = new ActionUtilities();
+- protected static ActionManager manager;
++ private static ActionManager manager;
+
+ }
+--- ./hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java Wed Jul 01 21:52:18 2015 -0700
+@@ -46,7 +46,7 @@
+ {
+ this.manager = manager;
+ statusBar = status;
+- buttonSize = new Dimension(CommonUI.buttconPrefSize);
++ buttonSize = new Dimension(CommonUI.getButtconPrefSize());
+ buttonInsets = new Insets(0, 0, 0, 0);
+ addComponents();
+ }
+--- ./hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java Wed Jul 01 21:52:18 2015 -0700
+@@ -373,20 +373,25 @@
+ comp.setCursor(Cursor.getPredefinedCursor(0));
+ }
+
+- public static final int BUTTON_WIDTH = 100;
+- public static final int BUTTON_HEIGHT = 26;
+- public static final int BUTTCON_WIDTH = 28;
+- public static final int BUTTCON_HEIGHT = 28;
+- public static final int SM_BUTTON_WIDTH = 72;
+- public static final int SM_BUTTON_HEIGHT = 26;
+- public static final int LABEL_WIDTH = 100;
+- public static final int LABEL_HEIGHT = 20;
+- public static final int TEXT_WIDTH = 150;
+- public static final int TEXT_HEIGHT = 20;
+- public static Dimension buttonPrefSize = new Dimension(100, 26);
+- public static Dimension buttconPrefSize = new Dimension(28, 28);
+- public static Dimension smbuttonPrefSize = new Dimension(72, 26);
+- public static Dimension labelPrefSize = new Dimension(100, 20);
+- public static Dimension textPrefSize = new Dimension(150, 20);
++ public static Dimension getButtconPrefSize()
++ {
++ return buttconPrefSize;
++ }
++
++ private static final int BUTTON_WIDTH = 100;
++ private static final int BUTTON_HEIGHT = 26;
++ private static final int BUTTCON_WIDTH = 28;
++ private static final int BUTTCON_HEIGHT = 28;
++ private static final int SM_BUTTON_WIDTH = 72;
++ private static final int SM_BUTTON_HEIGHT = 26;
++ private static final int LABEL_WIDTH = 100;
++ private static final int LABEL_HEIGHT = 20;
++ private static final int TEXT_WIDTH = 150;
++ private static final int TEXT_HEIGHT = 20;
++ private static final Dimension buttonPrefSize = new Dimension(100, 26);
++ private static final Dimension buttconPrefSize = new Dimension(28, 28);
++ private static final Dimension smbuttonPrefSize = new Dimension(72, 26);
++ private static final Dimension labelPrefSize = new Dimension(100, 20);
++ private static final Dimension textPrefSize = new Dimension(150, 20);
+
+ }
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java Wed Jul 01 21:52:18 2015 -0700
+@@ -51,6 +51,9 @@
+ private static final int C_INT32_SIZE = 4;
+ private static final int C_INT64_SIZE = 8;
+ private static int pointerSize = UNINITIALIZED_SIZE;
++ // Counter to ensure read loops terminate:
++ private static final int MAX_DUPLICATE_DEFINITIONS = 100;
++ private int duplicateDefCount = 0;
+
+ private static final boolean DEBUG;
+ static {
+@@ -166,6 +169,10 @@
+ typeEntrySizeOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySizeOffset");
+ typeEntryArrayStride = getLongValueFromProcess("gHotSpotVMTypeEntryArrayStride");
+
++ if (typeEntryArrayStride == 0L) {
++ throw new RuntimeException("zero stride: cannot read types.");
++ }
++
+ // Start iterating down it until we find an entry with no name
+ Address typeNameAddr = null;
+ do {
+@@ -192,7 +199,11 @@
+ }
+
+ entryAddr = entryAddr.addOffsetTo(typeEntryArrayStride);
+- } while (typeNameAddr != null);
++ } while (typeNameAddr != null && duplicateDefCount < MAX_DUPLICATE_DEFINITIONS);
++
++ if (duplicateDefCount >= MAX_DUPLICATE_DEFINITIONS) {
++ throw new RuntimeException("too many duplicate definitions");
++ }
+ }
+
+ private void initializePrimitiveTypes() {
+@@ -395,6 +406,10 @@
+ structEntryAddressOffset = getLongValueFromProcess("gHotSpotVMStructEntryAddressOffset");
+ structEntryArrayStride = getLongValueFromProcess("gHotSpotVMStructEntryArrayStride");
+
++ if (structEntryArrayStride == 0L) {
++ throw new RuntimeException("zero stride: cannot read types.");
++ }
++
+ // Fetch the address of the VMStructEntry*
+ Address entryAddr = lookupInProcess("gHotSpotVMStructs");
+ // Dereference this once to get the pointer to the first VMStructEntry
+@@ -472,6 +487,11 @@
+ intConstantEntryValueOffset = getLongValueFromProcess("gHotSpotVMIntConstantEntryValueOffset");
+ intConstantEntryArrayStride = getLongValueFromProcess("gHotSpotVMIntConstantEntryArrayStride");
+
++ if (intConstantEntryArrayStride == 0L) {
++ throw new RuntimeException("zero stride: cannot read types.");
++ }
++
++
+ // Fetch the address of the VMIntConstantEntry*
+ Address entryAddr = lookupInProcess("gHotSpotVMIntConstants");
+ // Dereference this once to get the pointer to the first VMIntConstantEntry
+@@ -501,12 +521,17 @@
+ } else {
+ System.err.println("Warning: the int constant \"" + name + "\" (declared in the remote VM in VMStructs::localHotSpotVMIntConstants) " +
+ "had its value declared as " + value + " twice. Continuing.");
++ duplicateDefCount++;
+ }
+ }
+ }
+
+ entryAddr = entryAddr.addOffsetTo(intConstantEntryArrayStride);
+- } while (nameAddr != null);
++ } while (nameAddr != null && duplicateDefCount < MAX_DUPLICATE_DEFINITIONS);
++
++ if (duplicateDefCount >= MAX_DUPLICATE_DEFINITIONS) {
++ throw new RuntimeException("too many duplicate definitions");
++ }
+ }
+
+ private void readVMLongConstants() {
+@@ -519,6 +544,10 @@
+ longConstantEntryValueOffset = getLongValueFromProcess("gHotSpotVMLongConstantEntryValueOffset");
+ longConstantEntryArrayStride = getLongValueFromProcess("gHotSpotVMLongConstantEntryArrayStride");
+
++ if (longConstantEntryArrayStride == 0L) {
++ throw new RuntimeException("zero stride: cannot read types.");
++ }
++
+ // Fetch the address of the VMLongConstantEntry*
+ Address entryAddr = lookupInProcess("gHotSpotVMLongConstants");
+ // Dereference this once to get the pointer to the first VMLongConstantEntry
+@@ -548,12 +577,17 @@
+ } else {
+ System.err.println("Warning: the long constant \"" + name + "\" (declared in the remote VM in VMStructs::localHotSpotVMLongConstants) " +
+ "had its value declared as " + value + " twice. Continuing.");
++ duplicateDefCount++;
+ }
+ }
+ }
+
+ entryAddr = entryAddr.addOffsetTo(longConstantEntryArrayStride);
+- } while (nameAddr != null);
++ } while (nameAddr != null && duplicateDefCount < MAX_DUPLICATE_DEFINITIONS);
++
++ if (duplicateDefCount >= MAX_DUPLICATE_DEFINITIONS) {
++ throw new RuntimeException("too many duplicate definitions.");
++ }
+ }
+
+ private BasicType lookupOrFail(String typeName) {
+@@ -740,9 +774,10 @@
+ }
+
+ if (!typeNameIsPointerType(typeName)) {
+- System.err.println("Warning: the type \"" + typeName + "\" (declared in the remote VM in VMStructs::localHotSpotVMTypes) " +
+- "had its size declared as " + size + " twice. Continuing.");
+- }
++ System.err.println("Warning: the type \"" + typeName + "\" (declared in the remote VM in VMStructs::localHotSpotVMTypes) " +
++ "had its size declared as " + size + " twice. Continuing.");
++ duplicateDefCount++;
++ }
+ }
+
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/G1YCType.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,45 @@
++/*
++ * 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.jvm.hotspot.gc_interface;
++
++//These definitions should be kept in sync with the definitions in the HotSpot
++//code.
++
++public enum G1YCType {
++ Normal ("Normal"),
++ InitialMark ("Initial Mark"),
++ DuringMark ("During Mark"),
++ Mixed ("Mixed"),
++ G1YCTypeEndSentinel ("Unknown");
++
++ private final String value;
++
++ G1YCType(String val) {
++ this.value = val;
++ }
++ public String value() {
++ return value;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/GCCause.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,69 @@
++/*
++ * 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.jvm.hotspot.gc_interface;
++
++//These definitions should be kept in sync with the definitions in the HotSpot code.
++
++public enum GCCause {
++ _java_lang_system_gc ("System.gc()"),
++ _full_gc_alot ("FullGCAlot"),
++ _scavenge_alot ("ScavengeAlot"),
++ _allocation_profiler ("Allocation Profiler"),
++ _jvmti_force_gc ("JvmtiEnv ForceGarbageCollection"),
++ _gc_locker ("GCLocker Initiated GC"),
++ _heap_inspection ("Heap Inspection Initiated GC"),
++ _heap_dump ("Heap Dump Initiated GC"),
++
++ _no_gc ("No GC"),
++ _no_cause_specified ("Unknown GCCause"),
++ _allocation_failure ("Allocation Failure"),
++
++ _tenured_generation_full ("Tenured Generation Full"),
++ _metadata_GC_threshold ("Metadata GC Threshold"),
++
++ _cms_generation_full ("CMS Generation Full"),
++ _cms_initial_mark ("CMS Initial Mark"),
++ _cms_final_remark ("CMS Final Remark"),
++ _cms_concurrent_mark ("CMS Concurrent Mark"),
++
++ _old_generation_expanded_on_last_scavenge ("Old Generation Expanded On Last Scavenge"),
++ _old_generation_too_full_to_scavenge ("Old Generation Too Full To Scavenge"),
++ _adaptive_size_policy ("Ergonomics"),
++
++ _g1_inc_collection_pause ("G1 Evacuation Pause"),
++ _g1_humongous_allocation ("G1 Humongous Allocation"),
++
++ _last_ditch_collection ("Last ditch collection"),
++ _last_gc_cause ("ILLEGAL VALUE - last gc cause - ILLEGAL VALUE");
++
++ private final String value;
++
++ GCCause(String val) {
++ this.value = val;
++ }
++ public String value() {
++ return value;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/GCName.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,50 @@
++/*
++ * 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.jvm.hotspot.gc_interface;
++
++//These definitions should be kept in sync with the definitions in the HotSpot code.
++
++public enum GCName {
++ ParallelOld ("ParallelOld"),
++ SerialOld ("SerialOld"),
++ PSMarkSweep ("PSMarkSweep"),
++ ParallelScavenge ("ParallelScavenge"),
++ DefNew ("DefNew"),
++ ParNew ("ParNew"),
++ G1New ("G1New"),
++ ConcurrentMarkSweep ("ConcurrentMarkSweep"),
++ G1Old ("G1Old"),
++ GCNameEndSentinel ("GCNameEndSentinel");
++
++ private final String value;
++
++ GCName(String val) {
++ this.value = val;
++ }
++ public String value() {
++ return value;
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/GCWhen.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,45 @@
++/*
++ * 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.jvm.hotspot.gc_interface;
++
++//These definitions should be kept in sync with the definitions in the HotSpot code.
++
++public enum GCWhen {
++ BeforeGC ("Before GC"),
++ AfterGC ("After GC"),
++ GCWhenEndSentinel ("GCWhenEndSentinel");
++
++ private final String value;
++
++ GCWhen(String val) {
++ this.value = val;
++ }
++ public String value() {
++ return value;
++ }
++}
++
++
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/ReferenceType.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,45 @@
++/*
++ * 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.jvm.hotspot.gc_interface;
++
++//These definitions should be kept in sync with the definitions in the HotSpot code.
++
++public enum ReferenceType {
++ REF_NONE ("None reference"), // Regular class
++ REF_OTHER ("Other reference"), // Subclass of java/lang/ref/Reference, but not subclass of one of the classes below
++ REF_SOFT ("Soft reference"), // Subclass of java/lang/ref/SoftReference
++ REF_WEAK ("Weak reference"), // Subclass of java/lang/ref/WeakReference
++ REF_FINAL ("Final reference"), // Subclass of java/lang/ref/FinalReference
++ REF_PHANTOM ("Phantom reference"); // Subclass of java/lang/ref/PhantomReference
++
++ private final String value;
++
++ ReferenceType(String val) {
++ this.value = val;
++ }
++ public String value() {
++ return value;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/AdaptiveFreeList.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,77 @@
++/*
++ * @(#)AdaptiveFreeList.java
++ *
++ * Copyright (c) 2000, 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.
++ *
++ */
++
++package sun.jvm.hotspot.memory;
++
++import java.util.Observable;
++import java.util.Observer;
++
++import sun.jvm.hotspot.debugger.Address;
++import sun.jvm.hotspot.runtime.VM;
++import sun.jvm.hotspot.runtime.VMObject;
++import sun.jvm.hotspot.types.CIntegerField;
++import sun.jvm.hotspot.types.Type;
++import sun.jvm.hotspot.types.TypeDataBase;
++
++public class AdaptiveFreeList extends VMObject {
++ static {
++ VM.registerVMInitializedObserver(new Observer() {
++ public void update(Observable o, Object data) {
++ initialize(VM.getVM().getTypeDataBase());
++ }
++ });
++ }
++
++ private static synchronized void initialize(TypeDataBase db) {
++ Type type = db.lookupType("AdaptiveFreeList<FreeChunk>");
++ sizeField = type.getCIntegerField("_size");
++ countField = type.getCIntegerField("_count");
++ headerSize = type.getSize();
++ }
++
++ // Fields
++ private static CIntegerField sizeField;
++ private static CIntegerField countField;
++ private static long headerSize;
++
++ //Constructor
++ public AdaptiveFreeList(Address address) {
++ super(address);
++ }
++
++ // Accessors
++ public long size() {
++ return sizeField.getValue(addr);
++ }
++
++ public long count() {
++ return countField.getValue(addr);
++ }
++
++ public static long sizeOf() {
++ return headerSize;
++ }
++}
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 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
+@@ -24,25 +24,29 @@
+
+ package sun.jvm.hotspot.memory;
+
+-import java.io.*;
+-import java.util.*;
+-import sun.jvm.hotspot.debugger.*;
+-import sun.jvm.hotspot.oops.*;
+-import sun.jvm.hotspot.runtime.*;
+-import sun.jvm.hotspot.types.*;
+-import sun.jvm.hotspot.utilities.*;
++import java.io.PrintStream;
++import java.util.ArrayList;
++import java.util.Iterator;
++import java.util.List;
++import java.util.Observable;
++import java.util.Observer;
++
++import sun.jvm.hotspot.debugger.Address;
++import sun.jvm.hotspot.debugger.Debugger;
++import sun.jvm.hotspot.oops.ObjectHeap;
++import sun.jvm.hotspot.oops.Oop;
++import sun.jvm.hotspot.runtime.VM;
++import sun.jvm.hotspot.runtime.VMObjectFactory;
++import sun.jvm.hotspot.types.AddressField;
++import sun.jvm.hotspot.types.Type;
++import sun.jvm.hotspot.types.TypeDataBase;
++import sun.jvm.hotspot.utilities.Assert;
+
+ public class CompactibleFreeListSpace extends CompactibleSpace {
+ private static AddressField collectorField;
+-
+- // for free size, three fields
+- // FreeBlockDictionary* _dictionary; // ptr to dictionary for large size blocks
+- // FreeList _indexedFreeList[IndexSetSize]; // indexed array for small size blocks
+- // LinearAllocBlock _smallLinearAllocBlock; // small linear alloc in TLAB
+ private static AddressField indexedFreeListField;
+ private static AddressField dictionaryField;
+ private static long smallLinearAllocBlockFieldOffset;
+- private static long indexedFreeListSizeOf;
+
+ private int heapWordSize; // 4 for 32bit, 8 for 64 bits
+ private int IndexSetStart; // for small indexed list
+@@ -109,11 +113,11 @@
+ // small chunks
+ long size = 0;
+ Address cur = addr.addOffsetTo( indexedFreeListField.getOffset() );
+- cur = cur.addOffsetTo(IndexSetStart*FreeList.sizeOf());
++ cur = cur.addOffsetTo(IndexSetStart*AdaptiveFreeList.sizeOf());
+ for (int i=IndexSetStart; i<IndexSetSize; i += IndexSetStride) {
+- FreeList freeList = (FreeList) VMObjectFactory.newObject(FreeList.class, cur);
++ AdaptiveFreeList freeList = (AdaptiveFreeList) VMObjectFactory.newObject(AdaptiveFreeList.class, cur);
+ size += i*freeList.count();
+- cur= cur.addOffsetTo(IndexSetStride*FreeList.sizeOf());
++ cur= cur.addOffsetTo(IndexSetStride*AdaptiveFreeList.sizeOf());
+ }
+
+ // large block
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeList.java Mon Jun 01 11:40:55 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,72 +0,0 @@
+-/*
+- * @(#)FreeList.java
+- *
+- * Copyright (c) 2000, 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.
+- *
+- */
+-
+-package sun.jvm.hotspot.memory;
+-
+-import java.util.*;
+-import sun.jvm.hotspot.debugger.*;
+-import sun.jvm.hotspot.types.*;
+-import sun.jvm.hotspot.runtime.*;
+-
+-public class FreeList extends VMObject {
+- static {
+- VM.registerVMInitializedObserver(new Observer() {
+- public void update(Observable o, Object data) {
+- initialize(VM.getVM().getTypeDataBase());
+- }
+- });
+- }
+-
+- private static synchronized void initialize(TypeDataBase db) {
+- Type type = db.lookupType("FreeList<FreeChunk>");
+- sizeField = type.getCIntegerField("_size");
+- countField = type.getCIntegerField("_count");
+- headerSize = type.getSize();
+- }
+-
+- // Fields
+- private static CIntegerField sizeField;
+- private static CIntegerField countField;
+- private static long headerSize;
+-
+- //Constructor
+- public FreeList(Address address) {
+- super(address);
+- }
+-
+- // Accessors
+- public long size() {
+- return sizeField.getValue(addr);
+- }
+-
+- public long count() {
+- return countField.getValue(addr);
+- }
+-
+- public static long sizeOf() {
+- return headerSize;
+- }
+-}
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -56,6 +56,12 @@
+ private static AddressField narrowKlassBaseField;
+ private static CIntegerField narrowKlassShiftField;
+
++ public enum NARROW_OOP_MODE {
++ UnscaledNarrowOop,
++ ZeroBasedNarrowOop,
++ HeapBasedNarrowOop
++ }
++
+ static {
+ VM.registerVMInitializedObserver(new Observer() {
+ public void update(Observable o, Object data) {
+@@ -94,7 +100,17 @@
+
+ public Universe() {
+ }
+-
++ public static String narrowOopModeToString(NARROW_OOP_MODE mode) {
++ switch (mode) {
++ case UnscaledNarrowOop:
++ return "32-bits Oops";
++ case ZeroBasedNarrowOop:
++ return "zero based Compressed Oops";
++ case HeapBasedNarrowOop:
++ return "Compressed Oops with base";
++ }
++ return "";
++ }
+ public CollectedHeap heap() {
+ try {
+ return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue());
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -55,6 +55,10 @@
+ layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0);
+ name = type.getAddressField("_name");
+ accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
++ try {
++ traceIDField = type.getField("_trace_id");
++ } catch(Exception e) {
++ }
+ subklass = new MetadataField(type.getAddressField("_subklass"), 0);
+ nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0);
+
+@@ -86,6 +90,7 @@
+ private static CIntField accessFlags;
+ private static MetadataField subklass;
+ private static MetadataField nextSibling;
++ private static sun.jvm.hotspot.types.Field traceIDField;
+
+ private Address getValue(AddressField field) {
+ return addr.getAddressAt(field.getOffset());
+@@ -107,6 +112,11 @@
+ public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); }
+ public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); }
+
++ public long traceID() {
++ if (traceIDField == null) return 0;
++ return traceIDField.getJLong(addr);
++ }
++
+ // computed access flags - takes care of inner classes etc.
+ // This is closer to actual source level than getAccessFlags() etc.
+ public long computeModifierFlags() {
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -54,6 +54,8 @@
+ private static OopField threadNameField;
+ private static OopField threadGroupField;
+ private static LongField threadEETopField;
++ //tid field is new since 1.5
++ private static LongField threadTIDField;
+ // threadStatus field is new since 1.5
+ private static IntField threadStatusField;
+ // parkBlocker field is new since 1.6
+@@ -220,6 +222,7 @@
+ threadNameField = (OopField) k.findField("name", "[C");
+ threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");
+ threadEETopField = (LongField) k.findField("eetop", "J");
++ threadTIDField = (LongField) k.findField("tid", "J");
+ threadStatusField = (IntField) k.findField("threadStatus", "I");
+ threadParkBlockerField = (OopField) k.findField("parkBlocker",
+ "Ljava/lang/Object;");
+@@ -268,6 +271,15 @@
+ return VM.getVM().getThreads().createJavaThreadWrapper(addr);
+ }
+
++ public static long threadOopGetTID(Oop threadOop) {
++ initThreadFields();
++ if (threadTIDField != null) {
++ return threadTIDField.getValue(threadOop);
++ } else {
++ return 0;
++ }
++ }
++
+ /** returns value of java.lang.Thread.threadStatus field */
+ public static int threadOopGetThreadStatus(Oop threadOop) {
+ initThreadFields();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java Wed Jul 01 21:52:18 2015 -0700
+@@ -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.
++ *
++ */
++
++package sun.jvm.hotspot.opto;
++
++//These definitions should be kept in sync with the definitions in the HotSpot code.
++
++public enum CompilerPhaseType {
++ PHASE_BEFORE_STRINGOPTS ("Before StringOpts"),
++ PHASE_AFTER_STRINGOPTS ("After StringOpts"),
++ PHASE_BEFORE_REMOVEUSELESS ("Before RemoveUseless"),
++ PHASE_AFTER_PARSING ("After Parsing"),
++ PHASE_ITER_GVN1 ("Iter GVN 1"),
++ PHASE_PHASEIDEAL_BEFORE_EA ("PhaseIdealLoop before EA"),
++ PHASE_ITER_GVN_AFTER_EA ("Iter GVN after EA"),
++ PHASE_ITER_GVN_AFTER_ELIMINATION ("Iter GVN after eliminating allocations and locks"),
++ PHASE_PHASEIDEALLOOP1 ("PhaseIdealLoop 1"),
++ PHASE_PHASEIDEALLOOP2 ("PhaseIdealLoop 2"),
++ PHASE_PHASEIDEALLOOP3 ("PhaseIdealLoop 3"),
++ PHASE_CPP1 ("PhaseCPP 1"),
++ PHASE_ITER_GVN2 ("Iter GVN 2"),
++ PHASE_PHASEIDEALLOOP_ITERATIONS ("PhaseIdealLoop iterations"),
++ PHASE_OPTIMIZE_FINISHED ("Optimize finished"),
++ PHASE_GLOBAL_CODE_MOTION ("Global code motion"),
++ PHASE_FINAL_CODE ("Final Code"),
++ PHASE_AFTER_EA ("After Escape Analysis"),
++ PHASE_BEFORE_CLOOPS ("Before CountedLoop"),
++ PHASE_AFTER_CLOOPS ("After CountedLoop"),
++ PHASE_BEFORE_BEAUTIFY_LOOPS ("Before beautify loops"),
++ PHASE_AFTER_BEAUTIFY_LOOPS ("After beautify loops"),
++ PHASE_BEFORE_MATCHING ("Before Matching"),
++ PHASE_INCREMENTAL_INLINE ("Incremental Inline"),
++ PHASE_INCREMENTAL_BOXING_INLINE ("Incremental Boxing Inline"),
++ PHASE_END ("End"),
++ PHASE_FAILURE ("Failure"),
++ PHASE_NUM_TYPES ("Number of Phase Types");
++
++ private final String value;
++
++ CompilerPhaseType(String val) {
++ this.value = val;
++ }
++ public String value() {
++ return value;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Flags.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,48 @@
++/*
++ * 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.jvm.hotspot.runtime;
++
++//These definitions should be kept in sync with the definitions in the HotSpot code.
++
++public enum Flags {
++ // value origin
++ DEFAULT ("Default"),
++ COMMAND_LINE ("Command line"),
++ ENVIRON_VAR ("Environment variable"),
++ CONFIG_FILE ("Config file"),
++ MANAGEMENT ("Management"),
++ ERGONOMIC ("Ergonomic"),
++ ATTACH_ON_DEMAND ("Attach on demand"),
++ INTERNAL ("Internal");
++
++ private final String value;
++
++ Flags(String val) {
++ this.value = val;
++ }
++ public String value() {
++ return value;
++ }
++}
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -41,6 +41,8 @@
+ private static AddressField currentPendingMonitorField;
+ private static AddressField currentWaitingMonitorField;
+
++ private static JLongField allocatedBytesField;
++
+ static {
+ VM.registerVMInitializedObserver(new Observer() {
+ public void update(Observable o, Object data) {
+@@ -61,6 +63,7 @@
+ activeHandlesField = type.getAddressField("_active_handles");
+ currentPendingMonitorField = type.getAddressField("_current_pending_monitor");
+ currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor");
++ allocatedBytesField = type.getJLongField("_allocated_bytes");
+ }
+
+ public Thread(Address addr) {
+@@ -104,6 +107,10 @@
+ return new JNIHandleBlock(a);
+ }
+
++ public long allocatedBytes() {
++ return allocatedBytesField.getValue(addr);
++ }
++
+ public boolean isVMThread() { return false; }
+ public boolean isJavaThread() { return false; }
+ public boolean isCompilerThread() { return false; }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMOps.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,86 @@
++/*
++ * 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.jvm.hotspot.runtime;
++
++//These definitions should be kept in sync with the definitions in the HotSpot code.
++
++public enum VMOps {
++ Dummy,
++ ThreadStop,
++ ThreadDump,
++ PrintThreads,
++ FindDeadlocks,
++ ForceSafepoint,
++ ForceAsyncSafepoint,
++ Deoptimize,
++ DeoptimizeFrame,
++ DeoptimizeAll,
++ ZombieAll,
++ UnlinkSymbols,
++ Verify,
++ PrintJNI,
++ HeapDumper,
++ DeoptimizeTheWorld,
++ CollectForMetadataAllocation,
++ GC_HeapInspection,
++ GenCollectFull,
++ GenCollectFullConcurrent,
++ GenCollectForAllocation,
++ ParallelGCFailedAllocation,
++ ParallelGCSystemGC,
++ CGC_Operation,
++ CMS_Initial_Mark,
++ CMS_Final_Remark,
++ G1CollectFull,
++ G1CollectForAllocation,
++ G1IncCollectionPause,
++ EnableBiasedLocking,
++ RevokeBias,
++ BulkRevokeBias,
++ PopulateDumpSharedSpace,
++ JNIFunctionTableCopier,
++ RedefineClasses,
++ GetOwnedMonitorInfo,
++ GetObjectMonitorUsage,
++ GetCurrentContendedMonitor,
++ GetStackTrace,
++ GetMultipleStackTraces,
++ GetAllStackTraces,
++ GetThreadListStackTraces,
++ GetFrameCount,
++ GetFrameLocation,
++ ChangeBreakpoints,
++ GetOrSetLocal,
++ GetCurrentLocation,
++ EnterInterpOnlyMode,
++ ChangeSingleStep,
++ HeapWalkOperation,
++ HeapIterateOperation,
++ ReportJavaOutOfMemory,
++ JFRCheckpoint,
++ Exit,
++ LinuxDllLoad,
++ Terminating
++}
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java Wed Jul 01 21:52:18 2015 -0700
+@@ -317,26 +317,17 @@
+ //------------------------------------------------------------------------------
+ // frame::adjust_unextended_sp
+ private void adjustUnextendedSP() {
+- // If we are returning to a compiled MethodHandle call site, the
+- // saved_fp will in fact be a saved value of the unextended SP. The
+- // simplest way to tell whether we are returning to such a call site
+- // is as follows:
++ // On x86, sites calling method handle intrinsics and lambda forms are treated
++ // as any other call site. Therefore, no special action is needed when we are
++ // returning to any of these call sites.
+
+ CodeBlob cb = cb();
+ NMethod senderNm = (cb == null) ? null : cb.asNMethodOrNull();
+ if (senderNm != null) {
+- // If the sender PC is a deoptimization point, get the original
+- // PC. For MethodHandle call site the unextended_sp is stored in
+- // saved_fp.
+- if (senderNm.isDeoptMhEntry(getPC())) {
+- // DEBUG_ONLY(verifyDeoptMhOriginalPc(senderNm, getFP()));
+- raw_unextendedSP = getFP();
+- }
+- else if (senderNm.isDeoptEntry(getPC())) {
+- // DEBUG_ONLY(verifyDeoptOriginalPc(senderNm, raw_unextendedSp));
+- }
+- else if (senderNm.isMethodHandleReturn(getPC())) {
+- raw_unextendedSP = getFP();
++ // If the sender PC is a deoptimization point, get the original PC.
++ if (senderNm.isDeoptEntry(getPC()) ||
++ senderNm.isDeoptMhEntry(getPC())) {
++ // DEBUG_ONLY(verifyDeoptriginalPc(senderNm, raw_unextendedSp));
+ }
+ }
+ }
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java Wed Jul 01 21:52:18 2015 -0700
+@@ -32,10 +32,12 @@
+ public class HSDBActionManager extends ActionManager {
+
+ public static ActionManager getInstance() {
+- if (manager == null) {
+- manager = new HSDBActionManager();
++ ActionManager m = ActionManager.getInstance();
++ if (m == null) {
++ m = new HSDBActionManager();
++ ActionManager.setInstance(m);
+ }
+- return manager;
++ return m;
+ }
+
+ protected void addActions() {
+--- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2004, 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
+@@ -799,6 +799,18 @@
+ writeObjectID(klass.getJavaMirror());
+
+ ClassData cd = (ClassData) classDataCache.get(klass);
++ if (cd == null) {
++ // The class is not present in the system dictionary, probably Lambda.
++ // Add it to cache here
++ if (klass instanceof InstanceKlass) {
++ InstanceKlass ik = (InstanceKlass) klass;
++ List fields = getInstanceFields(ik);
++ int instSize = getSizeForFields(fields);
++ cd = new ClassData(instSize, fields);
++ classDataCache.put(ik, cd);
++ }
++ }
++
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(cd != null, "can not get class data for " + klass.getName().asString() + klass.getAddress());
+ }
+--- ./hotspot/make/aix/makefiles/adlc.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/aix/makefiles/adlc.make Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -140,13 +140,7 @@
+ # Note "+="; it is a hook so flags.make can add more flags, like -g or -DFOO.
+ ADLCFLAGS += -q -T
+
+-# Normally, debugging is done directly on the ad_<arch>*.cpp files.
+-# But -g will put #line directives in those files pointing back to <arch>.ad.
+-# Some builds of gcc 3.2 have a bug that gets tickled by the extra #line directives
+-# so skip it for 3.2 and ealier.
+-ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ ADLCFLAGS += -g
+-endif
+
+ ifdef LP64
+ ADLCFLAGS += -D_LP64
+--- ./hotspot/make/aix/makefiles/ppc64.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/aix/makefiles/ppc64.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,6 +1,6 @@
+ #
+-# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-# Copyright 2012, 2013 SAP AG. All rights reserved.
++# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
++# Copyright 2012, 2015 SAP AG. All rights reserved.
+ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ #
+ # This code is free software; you can redistribute it and/or modify it
+@@ -46,7 +46,9 @@
+ # - 1540-1090 (I) The destructor of "..." might not be called.
+ # - 1500-010: (W) WARNING in ...: Infinite loop. Program may not stop.
+ # There are several infinite loops in the vm, suppress.
+-CFLAGS += -qsuppress=1540-1090 -qsuppress=1500-010
++# - 1540-1639 (I) The behavior of long type bit fields has changed ...
++# ... long type bit fields now default to long, not int.
++CFLAGS += -qsuppress=1540-1090 -qsuppress=1500-010 -qsuppress=1540-1639
+
+ # Suppress
+ # - 540-1088 (W) The exception specification is being ignored.
+@@ -69,9 +71,6 @@
+ OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
+ OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
+
+-# xlc 10.01 parameters for ipa compile.
+-QIPA_COMPILE=$(if $(CXX_IS_V10),-qipa)
+-
+ # Xlc 10.1 parameters for aggressive optimization:
+ # - qhot=level=1: Most aggressive loop optimizations.
+ # - qignerrno: Assume errno is not modified by system calls.
+@@ -86,7 +85,7 @@
+ OPT_CFLAGS/synchronizer.o = $(OPT_CFLAGS) -qnoinline
+
+ # Set all the xlC V10.1 options here.
+-OPT_CFLAGS += $(QIPA_COMPILE) $(QV10_OPT) $(QV10_OPT_AGGRESSIVE)
++OPT_CFLAGS += $(QV10_OPT) $(QV10_OPT_AGGRESSIVE)
+
+ export OBJECT_MODE=64
+
+--- ./hotspot/make/aix/makefiles/xlc.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/aix/makefiles/xlc.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,6 +1,6 @@
+ #
+-# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+-# Copyright (c) 2012, 2013 SAP. All rights reserved.
++# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2012, 2015 SAP. All rights reserved.
+ # 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,13 +34,17 @@
+
+ AS = $(CC) -c
+
+-# get xlc version
+-CXX_VERSION := $(shell $(CXX) -qversion 2>&1 | sed -n 's/.*Version: \([0-9.]*\)/\1/p')
++# get xlc version which comes as VV.RR.MMMM.LLLL where 'VV' is the version,
++# 'RR' is the release, 'MMMM' is the modification and 'LLLL' is the level.
++# We only use 'VV.RR.LLLL' to avoid integer overflows in bash when comparing
++# the version numbers (some shells only support 32-bit integer compares!).
++CXX_VERSION := $(shell $(CXX) -qversion 2>&1 | \
++ sed -n 's/.*Version: \([0-9]\{2\}\).\([0-9]\{2\}\).[0-9]\{4\}.\([0-9]\{4\}\)/\1\2\3/p')
+
+ # xlc 08.00.0000.0023 and higher supports -qtune=balanced
+-CXX_SUPPORTS_BALANCED_TUNING=$(shell if [ $(subst .,,$(CXX_VERSION)) -ge 080000000023 ] ; then echo "true" ; fi)
++CXX_SUPPORTS_BALANCED_TUNING := $(shell if [ $(CXX_VERSION) -ge 08000023 ] ; then echo "true" ; fi)
+ # xlc 10.01 is used with aggressive optimizations to boost performance
+-CXX_IS_V10=$(shell if [ $(subst .,,$(CXX_VERSION)) -ge 100100000000 ] ; then echo "true" ; fi)
++CXX_IS_V10 := $(shell if [ $(CXX_VERSION) -ge 10010000 ] ; then echo "true" ; fi)
+
+ # check for precompiled headers support
+
+@@ -130,7 +134,7 @@
+ # MAPFLAG = -Xlinker --version-script=FILENAME
+
+ # Build shared library
+-SHARED_FLAG = -q64 -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath
++SHARED_FLAG = -q64 -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath -bernotok
+
+ #------------------------------------------------------------------------
+ # Debug flags
+--- ./hotspot/make/bsd/makefiles/gcc.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/bsd/makefiles/gcc.make Wed Jul 01 21:52:18 2015 -0700
+@@ -349,7 +349,7 @@
+ # The macro takes the version with no dots, ex: 1070
+ CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
+ -mmacosx-version-min=$(MACOSX_VERSION_MIN)
+- LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
++ LFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
+ endif
+
+
+--- ./hotspot/make/bsd/makefiles/sa.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/bsd/makefiles/sa.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2003, 2012, 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
+@@ -34,6 +34,8 @@
+
+ include $(GAMMADIR)/make/sa.files
+
++-include $(HS_ALT_MAKE)/bsd/makefiles/sa.make
++
+ TOPDIR = $(shell echo `pwd`)
+ GENERATED = $(TOPDIR)/../generated
+
+--- ./hotspot/make/bsd/makefiles/saproc.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/bsd/makefiles/saproc.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++# 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
+@@ -64,9 +64,22 @@
+ else
+ ifeq ($(OS_VENDOR), Darwin)
+ SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES)
+- SALIBS = -g -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
++ SALIBS = -g \
++ -framework Foundation \
++ -framework JavaNativeFoundation \
++ -framework Security \
++ -framework CoreFoundation
+ #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles?
+ SAARCH = $(subst -march=i586,,$(ARCHFLAG))
++
++ # This is needed to locate JavaNativeFoundation.framework
++ # JDK 8 doesn't have SYSROOT_CFLAGS, so we'll cobble it together here
++ SA_SYSROOT_FLAGS=
++ ifneq ($(SDKPATH),)
++ SA_SYSROOT_FLAGS += -isysroot "$(SDKPATH)" -iframework"$(SDKPATH)/System/Library/Frameworks"
++ endif
++ # always needed, even if SDKPATH is empty
++ SA_SYSROOT_FLAGS += -F"$(SDKPATH)/System/Library/Frameworks/JavaVM.framework/Frameworks"
+ else
+ SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c
+ SALIBS =
+@@ -97,17 +110,14 @@
+
+ ifneq ($(OS_VENDOR), Darwin)
+ SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
++else
++# bring in minimum version argument or we'll fail on OSX 10.10
++SA_LFLAGS = $(LFLAGS)
+ endif
+ SA_LFLAGS += $(LDFLAGS_HASH_STYLE)
+
+-ifeq ($(OS_VENDOR), Darwin)
+- BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
+- -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") \
+- -I/System/Library/Frameworks/JavaVM.framework/Headers
+-else
+- BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
+- -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
+-endif
++BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
++ -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
+
+ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
+ $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
+@@ -116,6 +126,7 @@
+ fi
+ @echo Making SA debugger back-end...
+ $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
++ $(SA_SYSROOT_FLAGS) \
+ $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \
+ -I$(SASRCDIR) \
+ -I$(GENERATED) \
+--- ./hotspot/make/defs.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/defs.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2006, 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
+@@ -273,7 +273,7 @@
+
+ # Use uname output for SRCARCH, but deal with platform differences. If ARCH
+ # is not explicitly listed below, it is treated as x86.
+- SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc ppc64 zero,$(ARCH)))
++ SRCARCH ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc64 zero,$(ARCH)))
+ ARCH/ = x86
+ ARCH/sparc = sparc
+ ARCH/sparc64= sparc
+@@ -281,12 +281,10 @@
+ ARCH/amd64 = x86
+ ARCH/x86_64 = x86
+ ARCH/ppc64 = ppc
+- ARCH/ppc = ppc
+- ARCH/arm = arm
+ ARCH/zero = zero
+
+ # BUILDARCH is usually the same as SRCARCH, except for sparcv9
+- BUILDARCH = $(SRCARCH)
++ BUILDARCH ?= $(SRCARCH)
+ ifeq ($(BUILDARCH), x86)
+ ifdef LP64
+ BUILDARCH = amd64
+@@ -306,18 +304,16 @@
+ endif
+
+ # LIBARCH is 1:1 mapping from BUILDARCH
+- LIBARCH = $(LIBARCH/$(BUILDARCH))
++ LIBARCH ?= $(LIBARCH/$(BUILDARCH))
+ LIBARCH/i486 = i386
+ LIBARCH/amd64 = amd64
+ LIBARCH/sparc = sparc
+ LIBARCH/sparcv9 = sparcv9
+ LIBARCH/ia64 = ia64
+ LIBARCH/ppc64 = ppc64
+- LIBARCH/ppc = ppc
+- LIBARCH/arm = arm
+ LIBARCH/zero = $(ZERO_LIBARCH)
+
+- LP64_ARCH = sparcv9 amd64 ia64 ppc64 zero
++ LP64_ARCH += sparcv9 amd64 ia64 ppc64 zero
+ endif
+
+ # Required make macro settings for all platforms
+--- ./hotspot/make/hotspot_version Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/hotspot_version Wed Jul 01 21:52:18 2015 -0700
+@@ -34,8 +34,8 @@
+ HOTSPOT_VM_COPYRIGHT=Copyright 2015
+
+ HS_MAJOR_VER=25
+-HS_MINOR_VER=51
+-HS_BUILD_NUMBER=03
++HS_MINOR_VER=60
++HS_BUILD_NUMBER=22
+
+ JDK_MAJOR_VER=1
+ JDK_MINOR_VER=8
+--- ./hotspot/make/linux/Makefile Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/linux/Makefile Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -229,7 +229,7 @@
+ # Solaris 2.5.1, 2.6).
+ # Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
+
+-SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3%
++SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 4%
+ OS_VERSION := $(shell uname -r)
+ EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
+
+--- ./hotspot/make/linux/makefiles/arm.make Mon Jun 01 11:40:55 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,31 +0,0 @@
+-#
+-# Copyright (c) 2008, 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.
+-#
+-#
+-
+-Obj_Files += linux_arm.o
+-
+-ifneq ($(EXT_LIBS_PATH),)
+- LIBS += $(EXT_LIBS_PATH)/sflt_glibc.a
+-endif
+-
+-CFLAGS += -DVM_LITTLE_ENDIAN
+--- ./hotspot/make/linux/makefiles/build_vm_def.sh Mon Jun 01 11:40:55 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,16 +0,0 @@
+-#!/bin/sh
+-
+-# If we're cross compiling use that path for nm
+-if [ "$CROSS_COMPILE_ARCH" != "" ]; then
+-NM=$ALT_COMPILER_PATH/nm
+-else
+-NM=nm
+-fi
+-
+-$NM --defined-only $* \
+- | awk '{
+- if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";"
+- if ($3 ~ /^UseSharedSpaces$/) print "\t" $3 ";"
+- if ($3 ~ /^_ZN9Arguments17SharedArchivePathE$/) print "\t" $3 ";"
+- }' \
+- | sort -u
+--- ./hotspot/make/linux/makefiles/buildtree.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/linux/makefiles/buildtree.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++# 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
+@@ -70,6 +70,8 @@
+ PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc
+ else
+ PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH)
++ ALT_PLATFORM_FILE = $(HS_ALT_MAKE)/$(OS_FAMILY)/platform_$(BUILDARCH)
++ PLATFORM_FILE := $(if $(wildcard $(ALT_PLATFORM_FILE)),$(ALT_PLATFORM_FILE),$(PLATFORM_FILE))
+ endif
+ endif
+
+@@ -202,7 +204,7 @@
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo; \
+- echo "Platform_file = $(PLATFORM_FILE)" | sed 's|$(GAMMADIR)|$$(GAMMADIR)|'; \
++ echo "Platform_file = $(PLATFORM_FILE)" | sed -e 's|$(HS_ALT_MAKE)|$$(HS_ALT_MAKE)|' -e 's|$(GAMMADIR)|$$(GAMMADIR)|'; \
+ sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \
+ echo; \
+ echo "GAMMADIR = $(GAMMADIR)"; \
+--- ./hotspot/make/linux/makefiles/defs.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/linux/makefiles/defs.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2006, 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
+@@ -109,22 +109,6 @@
+ HS_ARCH = x86
+ endif
+
+-# ARM
+-ifeq ($(ARCH), arm)
+- ARCH_DATA_MODEL = 32
+- PLATFORM = linux-arm
+- VM_PLATFORM = linux_arm
+- HS_ARCH = arm
+-endif
+-
+-# PPC
+-ifeq ($(ARCH), ppc)
+- ARCH_DATA_MODEL = 32
+- PLATFORM = linux-ppc
+- VM_PLATFORM = linux_ppc
+- HS_ARCH = ppc
+-endif
+-
+ # PPC64
+ ifeq ($(ARCH), ppc64)
+ ARCH_DATA_MODEL = 64
+--- ./hotspot/make/linux/makefiles/dtrace.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/linux/makefiles/dtrace.make Wed Jul 01 21:52:18 2015 -0700
+@@ -31,8 +31,8 @@
+ REASON = "This JDK does not support SDT probes"
+ else
+
+-# We need a recent GCC for the default
+-ifeq "$(shell expr \( $(CC_VER_MAJOR) \>= 4 \) \& \( $(CC_VER_MINOR) \>= 4 \) )" "0"
++# We need a recent GCC for the default (4.4 or later)
++ifeq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 4 \) \) \| \( $(CC_VER_MAJOR) \>= 5 \) )" "0"
+ REASON = "gcc version is too old"
+ else
+
+--- ./hotspot/make/linux/makefiles/gcc.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/linux/makefiles/gcc.make Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -176,11 +176,7 @@
+ ARCHFLAG/ia64 =
+ ARCHFLAG/sparc = -m32 -mcpu=v9
+ ARCHFLAG/sparcv9 = -m64 -mcpu=v9
+-ARCHFLAG/arm = -fsigned-char
+ ARCHFLAG/zero = $(ZERO_ARCHFLAG)
+-ifndef E500V2
+-ARCHFLAG/ppc = -mcpu=powerpc
+-endif
+ ARCHFLAG/ppc64 = -m64
+
+ CFLAGS += $(ARCHFLAG)
+@@ -188,10 +184,6 @@
+ LFLAGS += $(ARCHFLAG)
+ ASFLAGS += $(ARCHFLAG)
+
+-ifdef E500V2
+-CFLAGS += -DE500V2
+-endif
+-
+ # Use C++ Interpreter
+ ifdef CC_INTERP
+ CFLAGS += -DCC_INTERP
+@@ -345,47 +337,41 @@
+ # Note: The Itanium gcc compiler crashes when using -gstabs.
+ DEBUG_CFLAGS/ia64 = -g
+ DEBUG_CFLAGS/amd64 = -g
+- DEBUG_CFLAGS/arm = -g
+- DEBUG_CFLAGS/ppc = -g
+ DEBUG_CFLAGS/ppc64 = -g
+ DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
+ ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
+ ifeq ($(USE_CLANG), true)
+ # Clang doesn't understand -gstabs
+- DEBUG_CFLAGS += -g
++ DEBUG_CFLAGS/$(BUILDARCH) = -g
+ else
+- DEBUG_CFLAGS += -gstabs
++ DEBUG_CFLAGS/$(BUILDARCH) = -gstabs
+ endif
+ endif
+
+ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ FASTDEBUG_CFLAGS/ia64 = -g
+ FASTDEBUG_CFLAGS/amd64 = -g
+- FASTDEBUG_CFLAGS/arm = -g
+- FASTDEBUG_CFLAGS/ppc = -g
+ FASTDEBUG_CFLAGS/ppc64 = -g
+- FASTDEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
++ FASTDEBUG_CFLAGS += $(FASTDEBUG_CFLAGS/$(BUILDARCH))
+ ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),)
+ ifeq ($(USE_CLANG), true)
+ # Clang doesn't understand -gstabs
+- FASTDEBUG_CFLAGS += -g
++ FASTDEBUG_CFLAGS/$(BUILDARCH) = -g
+ else
+- FASTDEBUG_CFLAGS += -gstabs
++ FASTDEBUG_CFLAGS/$(BUILDARCH) = -gstabs
+ endif
+ endif
+
+ OPT_CFLAGS/ia64 = -g
+ OPT_CFLAGS/amd64 = -g
+- OPT_CFLAGS/arm = -g
+- OPT_CFLAGS/ppc = -g
+ OPT_CFLAGS/ppc64 = -g
+ OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH))
+ ifeq ($(OPT_CFLAGS/$(BUILDARCH)),)
+ ifeq ($(USE_CLANG), true)
+ # Clang doesn't understand -gstabs
+- OPT_CFLAGS += -g
++ OPT_CFLAGS/$(BUILDARCH) = -g
+ else
+- OPT_CFLAGS += -gstabs
++ OPT_CFLAGS/$(BUILDARCH) = -gstabs
+ endif
+ endif
+ endif
+@@ -409,3 +395,5 @@
+ ifndef USE_SUNCC
+ CFLAGS += -fno-omit-frame-pointer
+ endif
++
++-include $(HS_ALT_MAKE)/linux/makefiles/gcc.make
+--- ./hotspot/make/linux/makefiles/ppc.make Mon Jun 01 11:40:55 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,33 +0,0 @@
+-#
+-# Copyright (c) 2004, 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.
+-#
+-#
+-
+-# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
+-OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
+-
+-# Must also specify if CPU is big endian
+-CFLAGS += -DVM_BIG_ENDIAN
+-
+-ifdef E500V2
+-ASFLAGS += -Wa,-mspe -Wa,--defsym -Wa,E500V2=1
+-endif
+--- ./hotspot/make/linux/makefiles/saproc.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/linux/makefiles/saproc.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++# 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
+@@ -69,19 +69,21 @@
+ endif
+
+ ifneq ($(ALT_SASRCDIR),)
+-ALT_SAINCDIR=-I$(ALT_SASRCDIR)
++ALT_SAINCDIR=-I$(ALT_SASRCDIR) -DALT_SASRCDIR
+ else
+ ALT_SAINCDIR=
+ endif
+ SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
+
++SAARCH ?= $(BUILDARCH)
++
+ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
+ $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
+ echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
+ exit 1; \
+ fi
+ @echo Making SA debugger back-end...
+- $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
++ $(QUIETLY) $(CC) -D$(SAARCH) -D_GNU_SOURCE \
+ -D_FILE_OFFSET_BITS=64 \
+ $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
+ -I$(SASRCDIR) \
+--- ./hotspot/make/linux/makefiles/vm.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/linux/makefiles/vm.make Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -45,8 +45,9 @@
+ ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
+ include $(MAKEFILES_DIR)/zeroshark.make
+ else
+- include $(MAKEFILES_DIR)/$(BUILDARCH).make
+- -include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
++ BUILDARCH_MAKE = $(MAKEFILES_DIR)/$(BUILDARCH).make
++ ALT_BUILDARCH_MAKE = $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
++ include $(if $(wildcard $(ALT_BUILDARCH_MAKE)),$(ALT_BUILDARCH_MAKE),$(BUILDARCH_MAKE))
+ endif
+
+ # set VPATH so make knows where to look for source files
+@@ -245,8 +246,14 @@
+ rm -f $@
+ cat $^ > $@
+
++VMDEF_PAT = ^_ZTV
++VMDEF_PAT := ^gHotSpotVM|$(VMDEF_PAT)
++VMDEF_PAT := ^UseSharedSpaces$$|$(VMDEF_PAT)
++VMDEF_PAT := ^_ZN9Arguments17SharedArchivePathE$$|$(VMDEF_PAT)
++
+ vm.def: $(Res_Files) $(Obj_Files)
+- sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
++ $(QUIETLY) $(NM) --defined-only $(Obj_Files) | sort -k3 -u | \
++ awk '$$3 ~ /$(VMDEF_PAT)/ { print "\t" $$3 ";" }' > $@
+
+ mapfile_ext:
+ rm -f $@
+--- ./hotspot/make/linux/platform_arm Mon Jun 01 11:40:55 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,17 +0,0 @@
+-os_family = linux
+-
+-arch = arm
+-
+-arch_model = arm
+-
+-os_arch = linux_arm
+-
+-os_arch_model = linux_arm
+-
+-lib_arch = arm
+-
+-compiler = gcc
+-
+-gnu_dis_arch = arm
+-
+-sysdefs = -DLINUX -D_GNU_SOURCE -DARM
+--- ./hotspot/make/linux/platform_ppc Mon Jun 01 11:40:55 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,17 +0,0 @@
+-os_family = linux
+-
+-arch = ppc
+-
+-arch_model = ppc_32
+-
+-os_arch = linux_ppc
+-
+-os_arch_model = linux_ppc_32
+-
+-lib_arch = ppc
+-
+-compiler = gcc
+-
+-gnu_dis_arch = ppc
+-
+-sysdefs = -DLINUX -D_GNU_SOURCE -DPPC32
+--- ./hotspot/make/solaris/makefiles/sa.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/solaris/makefiles/sa.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2003, 2012, 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
+@@ -29,8 +29,12 @@
+ # and generate JNI header file for native methods.
+
+ include $(GAMMADIR)/make/solaris/makefiles/rules.make
++include $(GAMMADIR)/make/defs.make
+ AGENT_DIR = $(GAMMADIR)/agent
+ include $(GAMMADIR)/make/sa.files
++
++-include $(HS_ALT_MAKE)/solaris/makefiles/sa.make
++
+ GENERATED = ../generated
+
+ # tools.jar is needed by the JDI - SA binding
+--- ./hotspot/make/windows/makefiles/sa.make Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/make/windows/makefiles/sa.make Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2003, 2013, 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
+@@ -38,6 +38,22 @@
+
+ GENERATED = ../generated
+
++HS_COMMON_SRC_REL = src
++
++!if "$(OPENJDK)" != "true"
++HS_ALT_SRC_REL=src/closed
++HS_ALT_SRC = $(WorkSpace)/$(HS_ALT_SRC_REL)
++!ifndef HS_ALT_MAKE
++HS_ALT_MAKE=$(WorkSpace)/make/closed
++!endif
++!endif
++
++HS_COMMON_SRC = $(WorkSpace)/$(HS_COMMON_SRC_REL)
++
++!ifdef HS_ALT_MAKE
++!include $(HS_ALT_MAKE)/windows/makefiles/sa.make
++!endif
++
+ # tools.jar is needed by the JDI - SA binding
+ SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
+
+--- ./hotspot/src/cpu/ppc/vm/frame_ppc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/ppc/vm/frame_ppc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -318,3 +318,10 @@
+ // unused... but returns fp() to minimize changes introduced by 7087445
+ return fp();
+ }
++
++#ifndef PRODUCT
++// This is a generic constructor which is only used by pns() in debug.cpp.
++frame::frame(void* sp, void* fp, void* pc) : _sp((intptr_t*)sp), _unextended_sp((intptr_t*)sp) {
++ find_codeblob_and_set_pc_and_deopt_state((address)pc); // also sets _fp and adjusts _unextended_sp
++}
++#endif
+--- ./hotspot/src/cpu/ppc/vm/globals_ppc.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/ppc/vm/globals_ppc.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -55,6 +55,8 @@
+
+ define_pd_global(bool, UseMembar, false);
+
++define_pd_global(bool, PreserveFramePointer, false);
++
+ // GC Ergo Flags
+ define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // Default max size of CMS young gen, per GC worker thread.
+
+--- ./hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,6 +1,6 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+- * Copyright 2012, 2014 SAP AG. All rights reserved.
++ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright 2012, 2015 SAP AG. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -459,7 +459,8 @@
+
+ // This is not a leaf but we have a JavaFrameAnchor now and we will
+ // check (create) exceptions afterward so this is ok.
+- __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
++ __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError),
++ R16_thread);
+
+ // Pop the C frame and restore LR.
+ __ pop_frame();
+--- ./hotspot/src/cpu/ppc/vm/ppc.ad Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/ppc/vm/ppc.ad Wed Jul 01 21:52:18 2015 -0700
+@@ -2264,9 +2264,8 @@
+
+ // Do we need to mask the count passed to shift instructions or does
+ // the cpu only look at the lower 5/6 bits anyway?
+-// Off, as masks are generated in expand rules where required.
+-// Constant shift counts are handled in Ideal phase.
+-const bool Matcher::need_masked_shift_count = false;
++// PowerPC requires masked shift counts.
++const bool Matcher::need_masked_shift_count = true;
+
+ // This affects two different things:
+ // - how Decode nodes are matched
+@@ -4418,11 +4417,11 @@
+ interface(CONST_INTER);
+ %}
+
+-// constant 'float +0.0'.
++// Float Immediate: +0.0f.
+ operand immF_0() %{
+- predicate((n->getf() == 0) &&
+- (fpclassify(n->getf()) == FP_ZERO) && (signbit(n->getf()) == 0));
++ predicate(jint_cast(n->getf()) == 0);
+ match(ConF);
++
+ op_cost(0);
+ format %{ %}
+ interface(CONST_INTER);
+--- ./hotspot/src/cpu/sparc/vm/frame_sparc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/sparc/vm/frame_sparc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -342,7 +342,7 @@
+ // constructors
+
+ // Construct an unpatchable, deficient frame
+-frame::frame(intptr_t* sp, unpatchable_t, address pc, CodeBlob* cb) {
++void frame::init(intptr_t* sp, address pc, CodeBlob* cb) {
+ #ifdef _LP64
+ assert( (((intptr_t)sp & (wordSize-1)) == 0), "frame constructor passed an invalid sp");
+ #endif
+@@ -364,6 +364,10 @@
+ #endif // ASSERT
+ }
+
++frame::frame(intptr_t* sp, unpatchable_t, address pc, CodeBlob* cb) {
++ init(sp, pc, cb);
++}
++
+ frame::frame(intptr_t* sp, intptr_t* younger_sp, bool younger_frame_is_interpreted) :
+ _sp(sp),
+ _younger_sp(younger_sp),
+@@ -418,6 +422,13 @@
+ }
+ }
+
++#ifndef PRODUCT
++// This is a generic constructor which is only used by pns() in debug.cpp.
++frame::frame(void* sp, void* fp, void* pc) {
++ init((intptr_t*)sp, (address)pc, NULL);
++}
++#endif
++
+ bool frame::is_interpreted_frame() const {
+ return Interpreter::contains(pc());
+ }
+--- ./hotspot/src/cpu/sparc/vm/frame_sparc.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/sparc/vm/frame_sparc.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -164,6 +164,8 @@
+ enum unpatchable_t { unpatchable };
+ frame(intptr_t* sp, unpatchable_t, address pc = NULL, CodeBlob* cb = NULL);
+
++ void init(intptr_t* sp, address pc, CodeBlob* cb);
++
+ // Walk from sp outward looking for old_sp, and return old_sp's predecessor
+ // (i.e. return the sp from the frame where old_sp is the fp).
+ // Register windows are assumed to be flushed for the stack in question.
+--- ./hotspot/src/cpu/sparc/vm/globals_sparc.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/sparc/vm/globals_sparc.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -74,6 +74,8 @@
+
+ define_pd_global(bool, UseMembar, false);
+
++define_pd_global(bool, PreserveFramePointer, false);
++
+ // GC Ergo Flags
+ define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
+
+--- ./hotspot/src/cpu/sparc/vm/sparc.ad Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/sparc/vm/sparc.ad Wed Jul 01 21:52:18 2015 -0700
+@@ -3760,13 +3760,9 @@
+ interface(CONST_INTER);
+ %}
+
++// Double Immediate: +0.0d
+ operand immD0() %{
+-#ifdef _LP64
+- // on 64-bit architectures this comparision is faster
+ predicate(jlong_cast(n->getd()) == 0);
+-#else
+- predicate((n->getd() == 0) && (fpclass(n->getd()) == FP_PZERO));
+-#endif
+ match(ConD);
+
+ op_cost(0);
+@@ -3783,9 +3779,9 @@
+ interface(CONST_INTER);
+ %}
+
+-// Float Immediate: 0
+-operand immF0() %{
+- predicate((n->getf() == 0) && (fpclass(n->getf()) == FP_PZERO));
++// Float Immediate: +0.0f
++operand immF0() %{
++ predicate(jint_cast(n->getf()) == 0);
+ match(ConF);
+
+ op_cost(0);
+--- ./hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -37,7 +37,7 @@
+
+ int VM_Version::_features = VM_Version::unknown_m;
+ const char* VM_Version::_features_str = "";
+-unsigned int VM_Version::_L2_cache_line_size = 0;
++unsigned int VM_Version::_L2_data_cache_line_size = 0;
+
+ void VM_Version::initialize() {
+ _features = determine_features();
+@@ -363,7 +363,7 @@
+
+ #ifndef PRODUCT
+ if (PrintMiscellaneous && Verbose) {
+- tty->print_cr("L2 cache line size: %u", L2_cache_line_size());
++ tty->print_cr("L2 data cache line size: %u", L2_data_cache_line_size());
+ tty->print("Allocation");
+ if (AllocatePrefetchStyle <= 0) {
+ tty->print_cr(": no prefetching");
+--- ./hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -96,8 +96,8 @@
+ static int _features;
+ static const char* _features_str;
+
+- static unsigned int _L2_cache_line_size;
+- static unsigned int L2_cache_line_size() { return _L2_cache_line_size; }
++ static unsigned int _L2_data_cache_line_size;
++ static unsigned int L2_data_cache_line_size() { return _L2_data_cache_line_size; }
+
+ static void print_features();
+ static int determine_features();
+@@ -171,7 +171,7 @@
+ static const char* cpu_features() { return _features_str; }
+
+ // default prefetch block size on sparc
+- static intx prefetch_data_size() { return L2_cache_line_size(); }
++ static intx prefetch_data_size() { return L2_data_cache_line_size(); }
+
+ // Prefetch
+ static intx prefetch_copy_interval_in_bytes() {
+--- ./hotspot/src/cpu/x86/vm/assembler_x86.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/assembler_x86.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -141,8 +141,10 @@
+
+ #endif // _LP64
+
+-// JSR 292 fixed register usages:
+-REGISTER_DECLARATION(Register, rbp_mh_SP_save, rbp);
++// JSR 292
++// On x86, the SP does not have to be saved when invoking method handle intrinsics
++// or compiled lambda forms. We indicate that by setting rbp_mh_SP_save to noreg.
++REGISTER_DECLARATION(Register, rbp_mh_SP_save, noreg);
+
+ // Address is an abstraction used to represent a memory location
+ // using any of the amd64 addressing modes with one object.
+--- ./hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -343,14 +343,13 @@
+ return FrameMap::rsp_opr;
+ }
+
+-
+ // JSR 292
++// On x86, there is no need to save the SP, because neither
++// method handle intrinsics, nor compiled lambda forms modify it.
+ LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
+- assert(rbp == rbp_mh_SP_save, "must be same register");
+- return rbp_opr;
++ return LIR_OprFact::illegalOpr;
+ }
+
+-
+ bool FrameMap::validate_frame() {
+ return true;
+ }
+--- ./hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -359,6 +359,9 @@
+ generate_stack_overflow_check(bang_size_in_bytes);
+
+ push(rbp);
++ if (PreserveFramePointer) {
++ mov(rbp, rsp);
++ }
+ #ifdef TIERED
+ // c2 leaves fpu stack dirty. Clean it on entry
+ if (UseSSE < 2 ) {
+--- ./hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -754,14 +754,9 @@
+ // WIN64_ONLY: No need to add frame::arg_reg_save_area_bytes to SP
+ // since we do a leave anyway.
+
+- // Pop the return address since we are possibly changing SP (restoring from BP).
++ // Pop the return address.
+ __ leave();
+ __ pop(rcx);
+-
+- // Restore SP from BP if the exception PC is a method handle call site.
+- NOT_LP64(__ get_thread(thread);)
+- __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0);
+- __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save);
+ __ jmp(rcx); // jump to exception handler
+ break;
+ default: ShouldNotReachHere();
+@@ -832,11 +827,6 @@
+ // the pop is also necessary to simulate the effect of a ret(0)
+ __ pop(exception_pc);
+
+- // Restore SP from BP if the exception PC is a method handle call site.
+- NOT_LP64(__ get_thread(thread);)
+- __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0);
+- __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save);
+-
+ // continue at exception handler (return address removed)
+ // note: do *not* remove arguments when unwinding the
+ // activation since the caller assumes having
+--- ./hotspot/src/cpu/x86/vm/frame_x86.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/frame_x86.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -216,7 +216,8 @@
+ if (sender_blob->is_nmethod()) {
+ nmethod* nm = sender_blob->as_nmethod_or_null();
+ if (nm != NULL) {
+- if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc)) {
++ if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) ||
++ nm->method()->is_method_handle_intrinsic()) {
+ return false;
+ }
+ }
+@@ -383,10 +384,9 @@
+ // frame::verify_deopt_original_pc
+ //
+ // Verifies the calculated original PC of a deoptimization PC for the
+-// given unextended SP. The unextended SP might also be the saved SP
+-// for MethodHandle call sites.
++// given unextended SP.
+ #ifdef ASSERT
+-void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) {
++void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp) {
+ frame fr;
+
+ // This is ugly but it's better than to change {get,set}_original_pc
+@@ -396,33 +396,23 @@
+
+ address original_pc = nm->get_original_pc(&fr);
+ assert(nm->insts_contains(original_pc), "original PC must be in nmethod");
+- assert(nm->is_method_handle_return(original_pc) == is_method_handle_return, "must be");
+ }
+ #endif
+
+ //------------------------------------------------------------------------------
+ // frame::adjust_unextended_sp
+ void frame::adjust_unextended_sp() {
+- // If we are returning to a compiled MethodHandle call site, the
+- // saved_fp will in fact be a saved value of the unextended SP. The
+- // simplest way to tell whether we are returning to such a call site
+- // is as follows:
++ // On x86, sites calling method handle intrinsics and lambda forms are treated
++ // as any other call site. Therefore, no special action is needed when we are
++ // returning to any of these call sites.
+
+ nmethod* sender_nm = (_cb == NULL) ? NULL : _cb->as_nmethod_or_null();
+ if (sender_nm != NULL) {
+- // If the sender PC is a deoptimization point, get the original
+- // PC. For MethodHandle call site the unextended_sp is stored in
+- // saved_fp.
+- if (sender_nm->is_deopt_mh_entry(_pc)) {
+- DEBUG_ONLY(verify_deopt_mh_original_pc(sender_nm, _fp));
+- _unextended_sp = _fp;
+- }
+- else if (sender_nm->is_deopt_entry(_pc)) {
++ // If the sender PC is a deoptimization point, get the original PC.
++ if (sender_nm->is_deopt_entry(_pc) ||
++ sender_nm->is_deopt_mh_entry(_pc)) {
+ DEBUG_ONLY(verify_deopt_original_pc(sender_nm, _unextended_sp));
+ }
+- else if (sender_nm->is_method_handle_return(_pc)) {
+- _unextended_sp = _fp;
+- }
+ }
+ }
+
+@@ -717,3 +707,10 @@
+ assert(! is_compiled_frame(), "unknown compiled frame size");
+ return fp();
+ }
++
++#ifndef PRODUCT
++// This is a generic constructor which is only used by pns() in debug.cpp.
++frame::frame(void* sp, void* fp, void* pc) {
++ init((intptr_t*)sp, (intptr_t*)fp, (address)pc);
++}
++#endif
+--- ./hotspot/src/cpu/x86/vm/frame_x86.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/frame_x86.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -76,11 +76,11 @@
+ // [locals and parameters ]
+ // <- sender sp
+
+-// [1] When the c++ interpreter calls a new method it returns to the frame
++// [1] When the C++ interpreter calls a new method it returns to the frame
+ // manager which allocates a new frame on the stack. In that case there
+ // is no real callee of this newly allocated frame. The frame manager is
+-// aware of the additional frame(s) and will pop them as nested calls
+-// complete. Howevers tTo make it look good in the debugger the frame
++// aware of the additional frame(s) and will pop them as nested calls
++// complete. However, to make it look good in the debugger the frame
+ // manager actually installs a dummy pc pointing to RecursiveInterpreterActivation
+ // with a fake interpreter_state* parameter to make it easy to debug
+ // nested calls.
+@@ -88,7 +88,7 @@
+ // Note that contrary to the layout for the assembly interpreter the
+ // expression stack allocated for the C++ interpreter is full sized.
+ // However this is not as bad as it seems as the interpreter frame_manager
+-// will truncate the unused space on succesive method calls.
++// will truncate the unused space on successive method calls.
+ //
+ // ------------------------------ C++ interpreter ----------------------------------------
+
+@@ -172,10 +172,7 @@
+
+ #ifdef ASSERT
+ // Used in frame::sender_for_{interpreter,compiled}_frame
+- static void verify_deopt_original_pc( nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false);
+- static void verify_deopt_mh_original_pc(nmethod* nm, intptr_t* unextended_sp) {
+- verify_deopt_original_pc(nm, unextended_sp, true);
+- }
++ static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp);
+ #endif
+
+ public:
+@@ -187,6 +184,8 @@
+
+ frame(intptr_t* sp, intptr_t* fp);
+
++ void init(intptr_t* sp, intptr_t* fp, address pc);
++
+ // accessors for the instance variables
+ // Note: not necessarily the real 'frame pointer' (see real_fp)
+ intptr_t* fp() const { return _fp; }
+--- ./hotspot/src/cpu/x86/vm/frame_x86.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/frame_x86.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -40,7 +40,7 @@
+ _deopt_state = unknown;
+ }
+
+-inline frame::frame(intptr_t* sp, intptr_t* fp, address pc) {
++inline void frame::init(intptr_t* sp, intptr_t* fp, address pc) {
+ _sp = sp;
+ _unextended_sp = sp;
+ _fp = fp;
+@@ -58,6 +58,10 @@
+ }
+ }
+
++inline frame::frame(intptr_t* sp, intptr_t* fp, address pc) {
++ init(sp, fp, pc);
++}
++
+ inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) {
+ _sp = sp;
+ _unextended_sp = unextended_sp;
+@@ -89,7 +93,7 @@
+ // find_blob call. This is also why we can have no asserts on the validity
+ // of the pc we find here. AsyncGetCallTrace -> pd_get_top_frame_for_signal_handler
+ // -> pd_last_frame should use a specialized version of pd_last_frame which could
+- // call a specilaized frame constructor instead of this one.
++ // call a specialized frame constructor instead of this one.
+ // Then we could use the assert below. However this assert is of somewhat dubious
+ // value.
+ // assert(_pc != NULL, "no pc?");
+--- ./hotspot/src/cpu/x86/vm/globals_x86.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/globals_x86.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -82,6 +82,8 @@
+
+ define_pd_global(uintx, TypeProfileLevel, 111);
+
++define_pd_global(bool, PreserveFramePointer, false);
++
+ #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \
+ \
+ develop(bool, IEEEPrecision, true, \
+--- ./hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -6122,6 +6122,10 @@
+ // We always push rbp, so that on return to interpreter rbp, will be
+ // restored correctly and we can correct the stack.
+ push(rbp);
++ // Save caller's stack pointer into RBP if the frame pointer is preserved.
++ if (PreserveFramePointer) {
++ mov(rbp, rsp);
++ }
+ // Remove word for ebp
+ framesize -= wordSize;
+
+@@ -6136,6 +6140,11 @@
+ // Save RBP register now.
+ framesize -= wordSize;
+ movptr(Address(rsp, framesize), rbp);
++ // Save caller's stack pointer into RBP if the frame pointer is preserved.
++ if (PreserveFramePointer) {
++ movptr(rbp, rsp);
++ addptr(rbp, framesize + wordSize);
++ }
+ }
+
+ if (VerifyStackAtCalls) { // Majik cookie to verify stack depth
+@@ -6690,7 +6699,7 @@
+ subl(cnt2, stride2);
+ jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP);
+ // clean upper bits of YMM registers
+- vzeroupper();
++ vpxor(vec1, vec1);
+
+ // compare wide vectors tail
+ bind(COMPARE_WIDE_TAIL);
+@@ -6705,7 +6714,7 @@
+ // Identifies the mismatching (higher or lower)16-bytes in the 32-byte vectors.
+ bind(VECTOR_NOT_EQUAL);
+ // clean upper bits of YMM registers
+- vzeroupper();
++ vpxor(vec1, vec1);
+ lea(str1, Address(str1, result, scale));
+ lea(str2, Address(str2, result, scale));
+ jmp(COMPARE_16_CHARS);
+@@ -6964,7 +6973,8 @@
+ bind(DONE);
+ if (UseAVX >= 2) {
+ // clean upper bits of YMM registers
+- vzeroupper();
++ vpxor(vec1, vec1);
++ vpxor(vec2, vec2);
+ }
+ }
+
+@@ -7098,7 +7108,8 @@
+
+ BIND(L_check_fill_8_bytes);
+ // clean upper bits of YMM registers
+- vzeroupper();
++ movdl(xtmp, value);
++ pshufd(xtmp, xtmp, 0);
+ } else {
+ // Fill 32-byte chunks
+ pshufd(xtmp, xtmp, 0);
+@@ -7261,7 +7272,11 @@
+ bind(L_copy_16_chars_exit);
+ if (UseAVX >= 2) {
+ // clean upper bits of YMM registers
+- vzeroupper();
++ vpxor(tmp2Reg, tmp2Reg);
++ vpxor(tmp3Reg, tmp3Reg);
++ vpxor(tmp4Reg, tmp4Reg);
++ movdl(tmp1Reg, tmp5);
++ pshufd(tmp1Reg, tmp1Reg, 0);
+ }
+ subptr(len, 8);
+ jccb(Assembler::greater, L_copy_8_chars_exit);
+--- ./hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -373,7 +373,7 @@
+ // member_reg - MemberName that was the trailing argument
+ // temp1_recv_klass - klass of stacked receiver, if needed
+ // rsi/r13 - interpreter linkage (if interpreted)
+- // rcx, rdx, rsi, rdi, r8, r8 - compiler arguments (if compiled)
++ // rcx, rdx, rsi, rdi, r8 - compiler arguments (if compiled)
+
+ Label L_incompatible_class_change_error;
+ switch (iid) {
+--- ./hotspot/src/cpu/x86/vm/runtime_x86_32.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/runtime_x86_32.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -126,10 +126,6 @@
+
+ // rax: exception handler for given <exception oop/exception pc>
+
+- // Restore SP from BP if the exception PC is a MethodHandle call site.
+- __ cmpl(Address(rcx, JavaThread::is_method_handle_return_offset()), 0);
+- __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save);
+-
+ // We have a handler in rax, (could be deopt blob)
+ // rdx - throwing pc, deopt blob will need it.
+
+--- ./hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -4017,8 +4017,8 @@
+
+ // Save callee-saved registers. See x86_64.ad.
+
+- // rbp is an implicitly saved callee saved register (i.e. the calling
+- // convention will save restore it in prolog/epilog) Other than that
++ // rbp is an implicitly saved callee saved register (i.e., the calling
++ // convention will save/restore it in the prolog/epilog). Other than that
+ // there are no callee save registers now that adapter frames are gone.
+
+ __ movptr(Address(rsp, SimpleRuntimeFrame::rbp_off << LogBytesPerInt), rbp);
+@@ -4060,9 +4060,9 @@
+
+ // Restore callee-saved registers
+
+- // rbp is an implicitly saved callee saved register (i.e. the calling
++ // rbp is an implicitly saved callee-saved register (i.e., the calling
+ // convention will save restore it in prolog/epilog) Other than that
+- // there are no callee save registers no that adapter frames are gone.
++ // there are no callee save registers now that adapter frames are gone.
+
+ __ movptr(rbp, Address(rsp, SimpleRuntimeFrame::rbp_off << LogBytesPerInt));
+
+@@ -4071,10 +4071,6 @@
+
+ // rax: exception handler
+
+- // Restore SP from BP if the exception PC is a MethodHandle call site.
+- __ cmpl(Address(r15_thread, JavaThread::is_method_handle_return_offset()), 0);
+- __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save);
+-
+ // We have a handler in rax (could be deopt blob).
+ __ mov(r8, rax);
+
+--- ./hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -837,7 +837,8 @@
+
+ if (UseUnalignedLoadStores && (UseAVX >= 2)) {
+ // clean upper bits of YMM registers
+- __ vzeroupper();
++ __ vpxor(xmm0, xmm0);
++ __ vpxor(xmm1, xmm1);
+ }
+ __ addl(qword_count, 8);
+ __ jccb(Assembler::zero, L_exit);
+--- ./hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1328,7 +1328,8 @@
+ __ BIND(L_end);
+ if (UseAVX >= 2) {
+ // clean upper bits of YMM registers
+- __ vzeroupper();
++ __ vpxor(xmm0, xmm0);
++ __ vpxor(xmm1, xmm1);
+ }
+ } else {
+ // Copy 32-bytes per iteration
+@@ -1405,7 +1406,8 @@
+ __ BIND(L_end);
+ if (UseAVX >= 2) {
+ // clean upper bits of YMM registers
+- __ vzeroupper();
++ __ vpxor(xmm0, xmm0);
++ __ vpxor(xmm1, xmm1);
+ }
+ } else {
+ // Copy 32-bytes per iteration
+--- ./hotspot/src/cpu/x86/vm/vm_version_x86.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/vm_version_x86.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -570,10 +570,12 @@
+ static uint cores_per_cpu() {
+ uint result = 1;
+ if (is_intel()) {
+- if (supports_processor_topology()) {
++ bool supports_topology = supports_processor_topology();
++ if (supports_topology) {
+ result = _cpuid_info.tpl_cpuidB1_ebx.bits.logical_cpus /
+ _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus;
+- } else {
++ }
++ if (!supports_topology || result == 0) {
+ result = (_cpuid_info.dcp_cpuid4_eax.bits.cores_per_cpu + 1);
+ }
+ } else if (is_amd()) {
+--- ./hotspot/src/cpu/x86/vm/x86.ad Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/x86.ad Wed Jul 01 21:52:18 2015 -0700
+@@ -912,21 +912,6 @@
+
+ encode %{
+
+- enc_class preserve_SP %{
+- debug_only(int off0 = cbuf.insts_size());
+- MacroAssembler _masm(&cbuf);
+- // RBP is preserved across all calls, even compiled calls.
+- // Use it to preserve RSP in places where the callee might change the SP.
+- __ movptr(rbp_mh_SP_save, rsp);
+- debug_only(int off1 = cbuf.insts_size());
+- assert(off1 - off0 == preserve_SP_size(), "correct size prediction");
+- %}
+-
+- enc_class restore_SP %{
+- MacroAssembler _masm(&cbuf);
+- __ movptr(rsp, rbp_mh_SP_save);
+- %}
+-
+ enc_class call_epilog %{
+ if (VerifyStackAtCalls) {
+ // Check that stack depth is unchanged: find majik cookie on stack
+--- ./hotspot/src/cpu/x86/vm/x86_32.ad Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/x86_32.ad Wed Jul 01 21:52:18 2015 -0700
+@@ -123,50 +123,94 @@
+ // 2) reg_class interpreter_method_oop_reg ( /* as def'd in frame section */ )
+ // 3) reg_class stack_slots( /* one chunk of stack-based "registers" */ )
+ //
++// Class for no registers (empty set).
++reg_class no_reg();
++
+ // Class for all registers
+-reg_class any_reg(EAX, EDX, EBP, EDI, ESI, ECX, EBX, ESP);
++reg_class any_reg_with_ebp(EAX, EDX, EBP, EDI, ESI, ECX, EBX, ESP);
++// Class for all registers (excluding EBP)
++reg_class any_reg_no_ebp(EAX, EDX, EDI, ESI, ECX, EBX, ESP);
++// Dynamic register class that selects at runtime between register classes
++// any_reg and any_no_ebp_reg (depending on the value of the flag PreserveFramePointer).
++// Equivalent to: return PreserveFramePointer ? any_no_ebp_reg : any_reg;
++reg_class_dynamic any_reg(any_reg_no_ebp, any_reg_with_ebp, %{ PreserveFramePointer %});
++
+ // Class for general registers
+-reg_class int_reg(EAX, EDX, EBP, EDI, ESI, ECX, EBX);
+-// Class for general registers which may be used for implicit null checks on win95
+-// Also safe for use by tailjump. We don't want to allocate in rbp,
+-reg_class int_reg_no_rbp(EAX, EDX, EDI, ESI, ECX, EBX);
++reg_class int_reg_with_ebp(EAX, EDX, EBP, EDI, ESI, ECX, EBX);
++// Class for general registers (excluding EBP).
++// This register class can be used for implicit null checks on win95.
++// It is also safe for use by tailjumps (we don't want to allocate in ebp).
++// Used also if the PreserveFramePointer flag is true.
++reg_class int_reg_no_ebp(EAX, EDX, EDI, ESI, ECX, EBX);
++// Dynamic register class that selects between int_reg and int_reg_no_ebp.
++reg_class_dynamic int_reg(int_reg_no_ebp, int_reg_with_ebp, %{ PreserveFramePointer %});
++
+ // Class of "X" registers
+ reg_class int_x_reg(EBX, ECX, EDX, EAX);
++
+ // Class of registers that can appear in an address with no offset.
+ // EBP and ESP require an extra instruction byte for zero offset.
+ // Used in fast-unlock
+ reg_class p_reg(EDX, EDI, ESI, EBX);
+-// Class for general registers not including ECX
+-reg_class ncx_reg(EAX, EDX, EBP, EDI, ESI, EBX);
+-// Class for general registers not including EAX
++
++// Class for general registers excluding ECX
++reg_class ncx_reg_with_ebp(EAX, EDX, EBP, EDI, ESI, EBX);
++// Class for general registers excluding ECX (and EBP)
++reg_class ncx_reg_no_ebp(EAX, EDX, EDI, ESI, EBX);
++// Dynamic register class that selects between ncx_reg and ncx_reg_no_ebp.
++reg_class_dynamic ncx_reg(ncx_reg_no_ebp, ncx_reg_with_ebp, %{ PreserveFramePointer %});
++
++// Class for general registers excluding EAX
+ reg_class nax_reg(EDX, EDI, ESI, ECX, EBX);
+-// Class for general registers not including EAX or EBX.
+-reg_class nabx_reg(EDX, EDI, ESI, ECX, EBP);
++
++// Class for general registers excluding EAX and EBX.
++reg_class nabx_reg_with_ebp(EDX, EDI, ESI, ECX, EBP);
++// Class for general registers excluding EAX and EBX (and EBP)
++reg_class nabx_reg_no_ebp(EDX, EDI, ESI, ECX);
++// Dynamic register class that selects between nabx_reg and nabx_reg_no_ebp.
++reg_class_dynamic nabx_reg(nabx_reg_no_ebp, nabx_reg_with_ebp, %{ PreserveFramePointer %});
++
+ // Class of EAX (for multiply and divide operations)
+ reg_class eax_reg(EAX);
++
+ // Class of EBX (for atomic add)
+ reg_class ebx_reg(EBX);
++
+ // Class of ECX (for shift and JCXZ operations and cmpLTMask)
+ reg_class ecx_reg(ECX);
++
+ // Class of EDX (for multiply and divide operations)
+ reg_class edx_reg(EDX);
++
+ // Class of EDI (for synchronization)
+ reg_class edi_reg(EDI);
++
+ // Class of ESI (for synchronization)
+ reg_class esi_reg(ESI);
+-// Singleton class for interpreter's stack pointer
+-reg_class ebp_reg(EBP);
++
+ // Singleton class for stack pointer
+ reg_class sp_reg(ESP);
++
+ // Singleton class for instruction pointer
+ // reg_class ip_reg(EIP);
++
+ // Class of integer register pairs
+-reg_class long_reg( EAX,EDX, ECX,EBX, EBP,EDI );
++reg_class long_reg_with_ebp( EAX,EDX, ECX,EBX, EBP,EDI );
++// Class of integer register pairs (excluding EBP and EDI);
++reg_class long_reg_no_ebp( EAX,EDX, ECX,EBX );
++// Dynamic register class that selects between long_reg and long_reg_no_ebp.
++reg_class_dynamic long_reg(long_reg_no_ebp, long_reg_with_ebp, %{ PreserveFramePointer %});
++
+ // Class of integer register pairs that aligns with calling convention
+ reg_class eadx_reg( EAX,EDX );
+ reg_class ebcx_reg( ECX,EBX );
++
+ // Not AX or DX, used in divides
+-reg_class nadx_reg( EBX,ECX,ESI,EDI,EBP );
++reg_class nadx_reg_with_ebp(EBX, ECX, ESI, EDI, EBP);
++// Not AX or DX (and neither EBP), used in divides
++reg_class nadx_reg_no_ebp(EBX, ECX, ESI, EDI);
++// Dynamic register class that selects between nadx_reg and nadx_reg_no_ebp.
++reg_class_dynamic nadx_reg(nadx_reg_no_ebp, nadx_reg_with_ebp, %{ PreserveFramePointer %});
+
+ // Floating point registers. Notice FPR0 is not a choice.
+ // FPR0 is not ever allocated; we use clever encodings to fake
+@@ -240,18 +284,11 @@
+ return size;
+ }
+
+-static int preserve_SP_size() {
+- return 2; // op, rm(reg/reg)
+-}
+-
+ // !!!!! Special hack to get all type of calls to specify the byte offset
+ // from the start of the call to the point where the return address
+ // will point.
+ int MachCallStaticJavaNode::ret_addr_offset() {
+- int offset = 5 + pre_call_resets_size(); // 5 bytes from start of call to where return address points
+- if (_method_handle_invoke)
+- offset += preserve_SP_size();
+- return offset;
++ return 5 + pre_call_resets_size(); // 5 bytes from start of call to where return address points
+ }
+
+ int MachCallDynamicJavaNode::ret_addr_offset() {
+@@ -285,15 +322,6 @@
+
+ // The address of the call instruction needs to be 4-byte aligned to
+ // ensure that it does not span a cache line so that it can be patched.
+-int CallStaticJavaHandleNode::compute_padding(int current_offset) const {
+- current_offset += pre_call_resets_size(); // skip fldcw, if any
+- current_offset += preserve_SP_size(); // skip mov rbp, rsp
+- current_offset += 1; // skip call opcode byte
+- return round_to(current_offset, alignment_required()) - current_offset;
+-}
+-
+-// The address of the call instruction needs to be 4-byte aligned to
+-// ensure that it does not span a cache line so that it can be patched.
+ int CallDynamicJavaDirectNode::compute_padding(int current_offset) const {
+ current_offset += pre_call_resets_size(); // skip fldcw, if any
+ current_offset += 5; // skip MOV instruction
+@@ -523,6 +551,10 @@
+ st->print("# stack bang (%d bytes)", bangsize);
+ st->print("\n\t");
+ st->print("PUSH EBP\t# Save EBP");
++ if (PreserveFramePointer) {
++ st->print("\n\t");
++ st->print("MOV EBP, ESP\t# Save the caller's SP into EBP");
++ }
+ if (framesize) {
+ st->print("\n\t");
+ st->print("SUB ESP, #%d\t# Create frame",framesize);
+@@ -532,6 +564,10 @@
+ st->print("\n\t");
+ framesize -= wordSize;
+ st->print("MOV [ESP + #%d], EBP\t# Save EBP",framesize);
++ if (PreserveFramePointer) {
++ st->print("\n\t");
++ st->print("MOV EBP, [ESP + #%d]\t# Save the caller's SP into EBP", (framesize + wordSize));
++ }
+ }
+
+ if (VerifyStackAtCalls) {
+@@ -1488,7 +1524,7 @@
+ }
+
+ const RegMask Matcher::method_handle_invoke_SP_save_mask() {
+- return EBP_REG_mask();
++ return NO_REG_mask();
+ }
+
+ // Returns true if the high 32 bits of the value is known to be zero.
+@@ -3734,7 +3770,7 @@
+
+ // On windows95, EBP is not safe to use for implicit null tests.
+ operand eRegP_no_EBP() %{
+- constraint(ALLOC_IN_RC(int_reg_no_rbp));
++ constraint(ALLOC_IN_RC(int_reg_no_ebp));
+ match(RegP);
+ match(eAXRegP);
+ match(eBXRegP);
+@@ -3823,13 +3859,6 @@
+ interface(REG_INTER);
+ %}
+
+-operand eBPRegP() %{
+- constraint(ALLOC_IN_RC(ebp_reg));
+- match(RegP);
+- format %{ "EBP" %}
+- interface(REG_INTER);
+-%}
+-
+ operand eRegL() %{
+ constraint(ALLOC_IN_RC(long_reg));
+ match(RegL);
+@@ -12708,7 +12737,6 @@
+ // compute_padding() functions will have to be adjusted.
+ instruct CallStaticJavaDirect(method meth) %{
+ match(CallStaticJava);
+- predicate(! ((CallStaticJavaNode*)n)->is_method_handle_invoke());
+ effect(USE meth);
+
+ ins_cost(300);
+@@ -12722,29 +12750,6 @@
+ ins_alignment(4);
+ %}
+
+-// Call Java Static Instruction (method handle version)
+-// Note: If this code changes, the corresponding ret_addr_offset() and
+-// compute_padding() functions will have to be adjusted.
+-instruct CallStaticJavaHandle(method meth, eBPRegP ebp_mh_SP_save) %{
+- match(CallStaticJava);
+- predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke());
+- effect(USE meth);
+- // EBP is saved by all callees (for interpreter stack correction).
+- // We use it here for a similar purpose, in {preserve,restore}_SP.
+-
+- ins_cost(300);
+- format %{ "CALL,static/MethodHandle " %}
+- opcode(0xE8); /* E8 cd */
+- ins_encode( pre_call_resets,
+- preserve_SP,
+- Java_Static_Call( meth ),
+- restore_SP,
+- call_epilog,
+- post_call_FPU );
+- ins_pipe( pipe_slow );
+- ins_alignment(4);
+-%}
+-
+ // Call Java Dynamic Instruction
+ // Note: If this code changes, the corresponding ret_addr_offset() and
+ // compute_padding() functions will have to be adjusted.
+--- ./hotspot/src/cpu/x86/vm/x86_64.ad Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/x86/vm/x86_64.ad Wed Jul 01 21:52:18 2015 -0700
+@@ -166,42 +166,67 @@
+ // 3) reg_class stack_slots( /* one chunk of stack-based "registers" */ )
+ //
+
+-// Class for all pointer registers (including RSP)
+-reg_class any_reg(RAX, RAX_H,
+- RDX, RDX_H,
+- RBP, RBP_H,
+- RDI, RDI_H,
+- RSI, RSI_H,
+- RCX, RCX_H,
+- RBX, RBX_H,
+- RSP, RSP_H,
+- R8, R8_H,
+- R9, R9_H,
+- R10, R10_H,
+- R11, R11_H,
+- R12, R12_H,
+- R13, R13_H,
+- R14, R14_H,
+- R15, R15_H);
+-
+-// Class for all pointer registers except RSP
+-reg_class ptr_reg(RAX, RAX_H,
+- RDX, RDX_H,
+- RBP, RBP_H,
+- RDI, RDI_H,
+- RSI, RSI_H,
+- RCX, RCX_H,
+- RBX, RBX_H,
+- R8, R8_H,
+- R9, R9_H,
+- R10, R10_H,
+- R11, R11_H,
+- R13, R13_H,
+- R14, R14_H);
+-
+-// Class for all pointer registers except RAX and RSP
+-reg_class ptr_no_rax_reg(RDX, RDX_H,
+- RBP, RBP_H,
++// Empty register class.
++reg_class no_reg();
++
++// Class for all pointer registers (including RSP and RBP)
++reg_class any_reg_with_rbp(RAX, RAX_H,
++ RDX, RDX_H,
++ RBP, RBP_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ RBX, RBX_H,
++ RSP, RSP_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R12, R12_H,
++ R13, R13_H,
++ R14, R14_H,
++ R15, R15_H);
++
++// Class for all pointer registers (including RSP, but excluding RBP)
++reg_class any_reg_no_rbp(RAX, RAX_H,
++ RDX, RDX_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ RBX, RBX_H,
++ RSP, RSP_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R12, R12_H,
++ R13, R13_H,
++ R14, R14_H,
++ R15, R15_H);
++
++// Dynamic register class that selects at runtime between register classes
++// any_reg_no_rbp and any_reg_with_rbp (depending on the value of the flag PreserveFramePointer).
++// Equivalent to: return PreserveFramePointer ? any_reg_no_rbp : any_reg_with_rbp;
++reg_class_dynamic any_reg(any_reg_no_rbp, any_reg_with_rbp, %{ PreserveFramePointer %});
++
++// Class for all pointer registers (excluding RSP)
++reg_class ptr_reg_with_rbp(RAX, RAX_H,
++ RDX, RDX_H,
++ RBP, RBP_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ RBX, RBX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Class for all pointer registers (excluding RSP and RBP)
++reg_class ptr_reg_no_rbp(RAX, RAX_H,
++ RDX, RDX_H,
+ RDI, RDI_H,
+ RSI, RSI_H,
+ RCX, RCX_H,
+@@ -213,31 +238,66 @@
+ R13, R13_H,
+ R14, R14_H);
+
+-reg_class ptr_no_rbp_reg(RDX, RDX_H,
+- RAX, RAX_H,
+- RDI, RDI_H,
+- RSI, RSI_H,
+- RCX, RCX_H,
+- RBX, RBX_H,
+- R8, R8_H,
+- R9, R9_H,
+- R10, R10_H,
+- R11, R11_H,
+- R13, R13_H,
+- R14, R14_H);
+-
+-// Class for all pointer registers except RAX, RBX and RSP
+-reg_class ptr_no_rax_rbx_reg(RDX, RDX_H,
+- RBP, RBP_H,
+- RDI, RDI_H,
+- RSI, RSI_H,
+- RCX, RCX_H,
+- R8, R8_H,
+- R9, R9_H,
+- R10, R10_H,
+- R11, R11_H,
+- R13, R13_H,
+- R14, R14_H);
++// Dynamic register class that selects between ptr_reg_no_rbp and ptr_reg_with_rbp.
++reg_class_dynamic ptr_reg(ptr_reg_no_rbp, ptr_reg_with_rbp, %{ PreserveFramePointer %});
++
++// Class for all pointer registers (excluding RAX and RSP)
++reg_class ptr_no_rax_reg_with_rbp(RDX, RDX_H,
++ RBP, RBP_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ RBX, RBX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Class for all pointer registers (excluding RAX, RSP, and RBP)
++reg_class ptr_no_rax_reg_no_rbp(RDX, RDX_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ RBX, RBX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Dynamic register class that selects between ptr_no_rax_reg_no_rbp and ptr_no_rax_reg_with_rbp.
++reg_class_dynamic ptr_no_rax_reg(ptr_no_rax_reg_no_rbp, ptr_no_rax_reg_with_rbp, %{ PreserveFramePointer %});
++
++// Class for all pointer registers (excluding RAX, RBX, and RSP)
++reg_class ptr_no_rax_rbx_reg_with_rbp(RDX, RDX_H,
++ RBP, RBP_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Class for all pointer registers (excluding RAX, RBX, RSP, and RBP)
++reg_class ptr_no_rax_rbx_reg_no_rbp(RDX, RDX_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Dynamic register class that selects between ptr_no_rax_rbx_reg_no_rbp and ptr_no_rax_rbx_reg_with_rbp.
++reg_class_dynamic ptr_no_rax_rbx_reg(ptr_no_rax_rbx_reg_no_rbp, ptr_no_rax_rbx_reg_with_rbp, %{ PreserveFramePointer %});
+
+ // Singleton class for RAX pointer register
+ reg_class ptr_rax_reg(RAX, RAX_H);
+@@ -251,59 +311,29 @@
+ // Singleton class for RDI pointer register
+ reg_class ptr_rdi_reg(RDI, RDI_H);
+
+-// Singleton class for RBP pointer register
+-reg_class ptr_rbp_reg(RBP, RBP_H);
+-
+ // Singleton class for stack pointer
+ reg_class ptr_rsp_reg(RSP, RSP_H);
+
+ // Singleton class for TLS pointer
+ reg_class ptr_r15_reg(R15, R15_H);
+
+-// Class for all long registers (except RSP)
+-reg_class long_reg(RAX, RAX_H,
+- RDX, RDX_H,
+- RBP, RBP_H,
+- RDI, RDI_H,
+- RSI, RSI_H,
+- RCX, RCX_H,
+- RBX, RBX_H,
+- R8, R8_H,
+- R9, R9_H,
+- R10, R10_H,
+- R11, R11_H,
+- R13, R13_H,
+- R14, R14_H);
+-
+-// Class for all long registers except RAX, RDX (and RSP)
+-reg_class long_no_rax_rdx_reg(RBP, RBP_H,
+- RDI, RDI_H,
+- RSI, RSI_H,
+- RCX, RCX_H,
+- RBX, RBX_H,
+- R8, R8_H,
+- R9, R9_H,
+- R10, R10_H,
+- R11, R11_H,
+- R13, R13_H,
+- R14, R14_H);
+-
+-// Class for all long registers except RCX (and RSP)
+-reg_class long_no_rcx_reg(RBP, RBP_H,
+- RDI, RDI_H,
+- RSI, RSI_H,
+- RAX, RAX_H,
+- RDX, RDX_H,
+- RBX, RBX_H,
+- R8, R8_H,
+- R9, R9_H,
+- R10, R10_H,
+- R11, R11_H,
+- R13, R13_H,
+- R14, R14_H);
+-
+-// Class for all long registers except RAX (and RSP)
+-reg_class long_no_rax_reg(RBP, RBP_H,
++// Class for all long registers (excluding RSP)
++reg_class long_reg_with_rbp(RAX, RAX_H,
++ RDX, RDX_H,
++ RBP, RBP_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ RBX, RBX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Class for all long registers (excluding RSP and RBP)
++reg_class long_reg_no_rbp(RAX, RAX_H,
+ RDX, RDX_H,
+ RDI, RDI_H,
+ RSI, RSI_H,
+@@ -316,6 +346,67 @@
+ R13, R13_H,
+ R14, R14_H);
+
++// Dynamic register class that selects between long_reg_no_rbp and long_reg_with_rbp.
++reg_class_dynamic long_reg(long_reg_no_rbp, long_reg_with_rbp, %{ PreserveFramePointer %});
++
++// Class for all long registers (excluding RAX, RDX and RSP)
++reg_class long_no_rax_rdx_reg_with_rbp(RBP, RBP_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ RBX, RBX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Class for all long registers (excluding RAX, RDX, RSP, and RBP)
++reg_class long_no_rax_rdx_reg_no_rbp(RDI, RDI_H,
++ RSI, RSI_H,
++ RCX, RCX_H,
++ RBX, RBX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Dynamic register class that selects between long_no_rax_rdx_reg_no_rbp and long_no_rax_rdx_reg_with_rbp.
++reg_class_dynamic long_no_rax_rdx_reg(long_no_rax_rdx_reg_no_rbp, long_no_rax_rdx_reg_with_rbp, %{ PreserveFramePointer %});
++
++// Class for all long registers (excluding RCX and RSP)
++reg_class long_no_rcx_reg_with_rbp(RBP, RBP_H,
++ RDI, RDI_H,
++ RSI, RSI_H,
++ RAX, RAX_H,
++ RDX, RDX_H,
++ RBX, RBX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Class for all long registers (excluding RCX, RSP, and RBP)
++reg_class long_no_rcx_reg_no_rbp(RDI, RDI_H,
++ RSI, RSI_H,
++ RAX, RAX_H,
++ RDX, RDX_H,
++ RBX, RBX_H,
++ R8, R8_H,
++ R9, R9_H,
++ R10, R10_H,
++ R11, R11_H,
++ R13, R13_H,
++ R14, R14_H);
++
++// Dynamic register class that selects between long_no_rcx_reg_no_rbp and long_no_rcx_reg_with_rbp.
++reg_class_dynamic long_no_rcx_reg(long_no_rcx_reg_no_rbp, long_no_rcx_reg_with_rbp, %{ PreserveFramePointer %});
++
+ // Singleton class for RAX long register
+ reg_class long_rax_reg(RAX, RAX_H);
+
+@@ -325,27 +416,27 @@
+ // Singleton class for RDX long register
+ reg_class long_rdx_reg(RDX, RDX_H);
+
+-// Class for all int registers (except RSP)
+-reg_class int_reg(RAX,
+- RDX,
+- RBP,
+- RDI,
+- RSI,
+- RCX,
+- RBX,
+- R8,
+- R9,
+- R10,
+- R11,
+- R13,
+- R14);
+-
+-// Class for all int registers except RCX (and RSP)
+-reg_class int_no_rcx_reg(RAX,
++// Class for all int registers (excluding RSP)
++reg_class int_reg_with_rbp(RAX,
++ RDX,
++ RBP,
++ RDI,
++ RSI,
++ RCX,
++ RBX,
++ R8,
++ R9,
++ R10,
++ R11,
++ R13,
++ R14);
++
++// Class for all int registers (excluding RSP and RBP)
++reg_class int_reg_no_rbp(RAX,
+ RDX,
+- RBP,
+ RDI,
+ RSI,
++ RCX,
+ RBX,
+ R8,
+ R9,
+@@ -354,18 +445,66 @@
+ R13,
+ R14);
+
+-// Class for all int registers except RAX, RDX (and RSP)
+-reg_class int_no_rax_rdx_reg(RBP,
+- RDI,
+- RSI,
+- RCX,
+- RBX,
+- R8,
+- R9,
+- R10,
+- R11,
+- R13,
+- R14);
++// Dynamic register class that selects between int_reg_no_rbp and int_reg_with_rbp.
++reg_class_dynamic int_reg(int_reg_no_rbp, int_reg_with_rbp, %{ PreserveFramePointer %});
++
++// Class for all int registers (excluding RCX and RSP)
++reg_class int_no_rcx_reg_with_rbp(RAX,
++ RDX,
++ RBP,
++ RDI,
++ RSI,
++ RBX,
++ R8,
++ R9,
++ R10,
++ R11,
++ R13,
++ R14);
++
++// Class for all int registers (excluding RCX, RSP, and RBP)
++reg_class int_no_rcx_reg_no_rbp(RAX,
++ RDX,
++ RDI,
++ RSI,
++ RBX,
++ R8,
++ R9,
++ R10,
++ R11,
++ R13,
++ R14);
++
++// Dynamic register class that selects between int_no_rcx_reg_no_rbp and int_no_rcx_reg_with_rbp.
++reg_class_dynamic int_no_rcx_reg(int_no_rcx_reg_no_rbp, int_no_rcx_reg_with_rbp, %{ PreserveFramePointer %});
++
++// Class for all int registers (excluding RAX, RDX, and RSP)
++reg_class int_no_rax_rdx_reg_with_rbp(RBP,
++ RDI,
++ RSI,
++ RCX,
++ RBX,
++ R8,
++ R9,
++ R10,
++ R11,
++ R13,
++ R14);
++
++// Class for all int registers (excluding RAX, RDX, RSP, and RBP)
++reg_class int_no_rax_rdx_reg_no_rbp(RDI,
++ RSI,
++ RCX,
++ RBX,
++ R8,
++ R9,
++ R10,
++ R11,
++ R13,
++ R14);
++
++// Dynamic register class that selects between int_no_rax_rdx_reg_no_rbp and int_no_rax_rdx_reg_with_rbp.
++reg_class_dynamic int_no_rax_rdx_reg(int_no_rax_rdx_reg_no_rbp, int_no_rax_rdx_reg_with_rbp, %{ PreserveFramePointer %});
+
+ // Singleton class for RAX int register
+ reg_class int_rax_reg(RAX);
+@@ -396,9 +535,6 @@
+
+ #define __ _masm.
+
+-static int preserve_SP_size() {
+- return 3; // rex.w, op, rm(reg/reg)
+-}
+ static int clear_avx_size() {
+ return (Compile::current()->max_vector_size() > 16) ? 3 : 0; // vzeroupper
+ }
+@@ -409,9 +545,7 @@
+ int MachCallStaticJavaNode::ret_addr_offset()
+ {
+ int offset = 5; // 5 bytes from start of call to where return address points
+- offset += clear_avx_size();
+- if (_method_handle_invoke)
+- offset += preserve_SP_size();
++ offset += clear_avx_size();
+ return offset;
+ }
+
+@@ -450,16 +584,6 @@
+
+ // The address of the call instruction needs to be 4-byte aligned to
+ // ensure that it does not span a cache line so that it can be patched.
+-int CallStaticJavaHandleNode::compute_padding(int current_offset) const
+-{
+- current_offset += preserve_SP_size(); // skip mov rbp, rsp
+- current_offset += clear_avx_size(); // skip vzeroupper
+- current_offset += 1; // skip call opcode byte
+- return round_to(current_offset, alignment_required()) - current_offset;
+-}
+-
+-// The address of the call instruction needs to be 4-byte aligned to
+-// ensure that it does not span a cache line so that it can be patched.
+ int CallDynamicJavaDirectNode::compute_padding(int current_offset) const
+ {
+ current_offset += clear_avx_size(); // skip vzeroupper
+@@ -724,6 +848,10 @@
+ st->print("# stack bang (%d bytes)", bangsize);
+ st->print("\n\t");
+ st->print("pushq rbp\t# Save rbp");
++ if (PreserveFramePointer) {
++ st->print("\n\t");
++ st->print("movq rbp, rsp\t# Save the caller's SP into rbp");
++ }
+ if (framesize) {
+ st->print("\n\t");
+ st->print("subq rsp, #%d\t# Create frame",framesize);
+@@ -732,7 +860,11 @@
+ st->print("subq rsp, #%d\t# Create frame",framesize);
+ st->print("\n\t");
+ framesize -= wordSize;
+- st->print("movq [rsp + #%d], rbp\t# Save rbp",framesize);
++ st->print("movq [rsp + #%d], rbp\t# Save rbp",framesize);
++ if (PreserveFramePointer) {
++ st->print("\n\t");
++ st->print("movq rbp, [rsp + #%d]\t# Save the caller's SP into rbp", (framesize + wordSize));
++ }
+ }
+
+ if (VerifyStackAtCalls) {
+@@ -1598,8 +1730,9 @@
+ return LONG_RDX_REG_mask();
+ }
+
++// Register for saving SP into on method handle invokes. Not used on x86_64.
+ const RegMask Matcher::method_handle_invoke_SP_save_mask() {
+- return PTR_RBP_REG_mask();
++ return NO_REG_mask();
+ }
+
+ %}
+@@ -3202,7 +3335,7 @@
+ // Pointer Register
+ operand any_RegP()
+ %{
+- constraint(ALLOC_IN_RC(any_reg));
++ constraint(ALLOC_IN_RC(any_reg));
+ match(RegP);
+ match(rax_RegP);
+ match(rbx_RegP);
+@@ -3224,8 +3357,8 @@
+ match(rbx_RegP);
+ match(rdi_RegP);
+ match(rsi_RegP);
+- match(rbp_RegP);
+- match(r15_RegP); // See Q&A below about r15_RegP.
++ match(rbp_RegP); // See Q&A below about
++ match(r15_RegP); // r15_RegP and rbp_RegP.
+
+ format %{ %}
+ interface(REG_INTER);
+@@ -3241,11 +3374,14 @@
+
+ // Question: Why is r15_RegP (the read-only TLS register) a match for rRegP?
+ // Answer: Operand match rules govern the DFA as it processes instruction inputs.
+-// It's fine for an instruction input which expects rRegP to match a r15_RegP.
++// It's fine for an instruction input that expects rRegP to match a r15_RegP.
+ // The output of an instruction is controlled by the allocator, which respects
+ // register class masks, not match rules. Unless an instruction mentions
+ // r15_RegP or any_RegP explicitly as its output, r15 will not be considered
+ // by the allocator as an input.
++// The same logic applies to rbp_RegP being a match for rRegP: If PreserveFramePointer==true,
++// the RBP is used as a proper frame pointer and is not included in ptr_reg. As a
++// result, RBP is not included in the output of the instruction either.
+
+ operand no_rax_RegP()
+ %{
+@@ -3259,9 +3395,11 @@
+ interface(REG_INTER);
+ %}
+
++// This operand is not allowed to use RBP even if
++// RBP is not used to hold the frame pointer.
+ operand no_rbp_RegP()
+ %{
+- constraint(ALLOC_IN_RC(ptr_no_rbp_reg));
++ constraint(ALLOC_IN_RC(ptr_reg_no_rbp));
+ match(RegP);
+ match(rbx_RegP);
+ match(rsi_RegP);
+@@ -3338,16 +3476,6 @@
+ interface(REG_INTER);
+ %}
+
+-operand rbp_RegP()
+-%{
+- constraint(ALLOC_IN_RC(ptr_rbp_reg));
+- match(RegP);
+- match(rRegP);
+-
+- format %{ %}
+- interface(REG_INTER);
+-%}
+-
+ operand r15_RegP()
+ %{
+ constraint(ALLOC_IN_RC(ptr_r15_reg));
+@@ -11414,7 +11542,6 @@
+ // compute_padding() functions will have to be adjusted.
+ instruct CallStaticJavaDirect(method meth) %{
+ match(CallStaticJava);
+- predicate(!((CallStaticJavaNode*) n)->is_method_handle_invoke());
+ effect(USE meth);
+
+ ins_cost(300);
+@@ -11425,27 +11552,6 @@
+ ins_alignment(4);
+ %}
+
+-// Call Java Static Instruction (method handle version)
+-// Note: If this code changes, the corresponding ret_addr_offset() and
+-// compute_padding() functions will have to be adjusted.
+-instruct CallStaticJavaHandle(method meth, rbp_RegP rbp_mh_SP_save) %{
+- match(CallStaticJava);
+- predicate(((CallStaticJavaNode*) n)->is_method_handle_invoke());
+- effect(USE meth);
+- // RBP is saved by all callees (for interpreter stack correction).
+- // We use it here for a similar purpose, in {preserve,restore}_SP.
+-
+- ins_cost(300);
+- format %{ "call,static/MethodHandle " %}
+- opcode(0xE8); /* E8 cd */
+- ins_encode(clear_avx, preserve_SP,
+- Java_Static_Call(meth),
+- restore_SP,
+- call_epilog);
+- ins_pipe(pipe_slow);
+- ins_alignment(4);
+-%}
+-
+ // Call Java Dynamic Instruction
+ // Note: If this code changes, the corresponding ret_addr_offset() and
+ // compute_padding() functions will have to be adjusted.
+--- ./hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -730,7 +730,7 @@
+ if (method->is_static())
+ object = method->constants()->pool_holder()->java_mirror();
+ else
+- object = (oop) locals[0];
++ object = (oop) (void*)locals[0];
+ monitor->set_obj(object);
+ }
+
+--- ./hotspot/src/cpu/zero/vm/frame_zero.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/zero/vm/frame_zero.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -441,3 +441,10 @@
+ // unused... but returns fp() to minimize changes introduced by 7087445
+ return fp();
+ }
++
++#ifndef PRODUCT
++// This is a generic constructor which is only used by pns() in debug.cpp.
++frame::frame(void* sp, void* fp, void* pc) {
++ Unimplemented();
++}
++#endif
+--- ./hotspot/src/cpu/zero/vm/frame_zero.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/zero/vm/frame_zero.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -26,6 +26,8 @@
+ #ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
+ #define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
+
++#include "code/codeCache.hpp"
++
+ // Constructors
+
+ inline frame::frame() {
+--- ./hotspot/src/cpu/zero/vm/globals_zero.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/zero/vm/globals_zero.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -61,6 +61,8 @@
+
+ define_pd_global(uintx, TypeProfileLevel, 0);
+
++define_pd_global(bool, PreserveFramePointer, false);
++
+ #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct)
+
+ #endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP
+--- ./hotspot/src/cpu/zero/vm/stack_zero.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/zero/vm/stack_zero.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -30,7 +30,9 @@
+
+ int ZeroStack::suggest_size(Thread *thread) const {
+ assert(needs_setup(), "already set up");
+- return align_size_down(abi_stack_available(thread) / 2, wordSize);
++ int abi_available = abi_stack_available(thread);
++ assert(abi_available >= 0, "available abi stack must be >= 0");
++ return align_size_down(abi_available / 2, wordSize);
+ }
+
+ void ZeroStack::handle_overflow(TRAPS) {
+--- ./hotspot/src/cpu/zero/vm/stack_zero.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/cpu/zero/vm/stack_zero.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -48,9 +48,11 @@
+ // to use under normal circumstances. Note that the returned
+ // value can be negative.
+ inline int ZeroStack::abi_stack_available(Thread *thread) const {
+- int stack_used = thread->stack_base() - (address) &stack_used;
++ guarantee(Thread::current() == thread, "should run in the same thread");
++ int stack_used = thread->stack_base() - (address) &stack_used
++ + (StackYellowPages+StackRedPages+StackShadowPages) * os::vm_page_size();
+ int stack_free = thread->stack_size() - stack_used;
+- return stack_free - shadow_pages_size();
++ return stack_free;
+ }
+
+ #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
+--- ./hotspot/src/os/aix/vm/os_aix.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os/aix/vm/os_aix.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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.
+ * Copyright 2012, 2014 SAP AG. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+@@ -3727,6 +3727,11 @@
+ tty->print_cr(" found:%s", get_signal_handler_name(thisHandler, buf, O_BUFLEN));
+ // No need to check this sig any longer
+ sigaddset(&check_signal_done, sig);
++ // Running under non-interactive shell, SHUTDOWN2_SIGNAL will be reassigned SIG_IGN
++ if (sig == SHUTDOWN2_SIGNAL && !isatty(fileno(stdin))) {
++ tty->print_cr("Running in non-interactive shell, %s handler is replaced by shell",
++ exception_name(sig, buf, O_BUFLEN));
++ }
+ } else if (os::Aix::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Aix::get_our_sigflags(sig)) {
+ tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
+ tty->print("expected:" PTR32_FORMAT, os::Aix::get_our_sigflags(sig));
+@@ -3987,11 +3992,6 @@
+ return JNI_OK;
+ }
+
+-// this is called at the end of vm_initialization
+-void os::init_3(void) {
+- return;
+-}
+-
+ // Mark the polling page as unreadable
+ void os::make_polling_page_unreadable(void) {
+ if (!guard_memory((char*)_polling_page, Aix::page_size())) {
+--- ./hotspot/src/os/bsd/vm/os_bsd.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os/bsd/vm/os_bsd.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -1197,12 +1197,18 @@
+ guarantee(retval != 0, "just checking");
+ return retval;
+
+-#elif __FreeBSD__
++#else
++ #ifdef __FreeBSD__
+ retval = syscall(SYS_thr_self);
+-#elif __OpenBSD__
++ #else
++ #ifdef __OpenBSD__
+ retval = syscall(SYS_getthrid);
+-#elif __NetBSD__
++ #else
++ #ifdef __NetBSD__
+ retval = (pid_t) syscall(SYS__lwp_self);
++ #endif
++ #endif
++ #endif
+ #endif
+
+ if (retval == -1) {
+@@ -3545,6 +3551,11 @@
+ tty->print_cr(" found:%s", get_signal_handler_name(thisHandler, buf, O_BUFLEN));
+ // No need to check this sig any longer
+ sigaddset(&check_signal_done, sig);
++ // Running under non-interactive shell, SHUTDOWN2_SIGNAL will be reassigned SIG_IGN
++ if (sig == SHUTDOWN2_SIGNAL && !isatty(fileno(stdin))) {
++ tty->print_cr("Running in non-interactive shell, %s handler is replaced by shell",
++ exception_name(sig, buf, O_BUFLEN));
++ }
+ } else if(os::Bsd::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Bsd::get_our_sigflags(sig)) {
+ tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
+ tty->print("expected:" PTR32_FORMAT, os::Bsd::get_our_sigflags(sig));
+@@ -3745,9 +3756,6 @@
+ return JNI_OK;
+ }
+
+-// this is called at the end of vm_initialization
+-void os::init_3(void) { }
+-
+ // Mark the polling page as unreadable
+ void os::make_polling_page_unreadable(void) {
+ if( !guard_memory((char*)_polling_page, Bsd::page_size()) )
+--- ./hotspot/src/os/linux/vm/os_linux.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os/linux/vm/os_linux.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -160,35 +160,6 @@
+ // Declarations
+ static void unpackTime(timespec* absTime, bool isAbsolute, jlong time);
+
+-#ifdef JAVASE_EMBEDDED
+-class MemNotifyThread: public Thread {
+- friend class VMStructs;
+- public:
+- virtual void run();
+-
+- private:
+- static MemNotifyThread* _memnotify_thread;
+- int _fd;
+-
+- public:
+-
+- // Constructor
+- MemNotifyThread(int fd);
+-
+- // Tester
+- bool is_memnotify_thread() const { return true; }
+-
+- // Printing
+- char* name() const { return (char*)"Linux MemNotify Thread"; }
+-
+- // Returns the single instance of the MemNotifyThread
+- static MemNotifyThread* memnotify_thread() { return _memnotify_thread; }
+-
+- // Create and start the single instance of MemNotifyThread
+- static void start();
+-};
+-#endif // JAVASE_EMBEDDED
+-
+ // utility functions
+
+ static int SR_initialize();
+@@ -238,44 +209,27 @@
+
+ #ifndef SYS_gettid
+ // i386: 224, ia64: 1105, amd64: 186, sparc 143
+-#ifdef __ia64__
+-#define SYS_gettid 1105
+-#elif __i386__
+-#define SYS_gettid 224
+-#elif __amd64__
+-#define SYS_gettid 186
+-#elif __sparc__
+-#define SYS_gettid 143
+-#else
+-#error define gettid for the arch
++ #ifdef __ia64__
++ #define SYS_gettid 1105
++ #else
++ #ifdef __i386__
++ #define SYS_gettid 224
++ #else
++ #ifdef __amd64__
++ #define SYS_gettid 186
++ #else
++ #ifdef __sparc__
++ #define SYS_gettid 143
++ #else
++ #error define gettid for the arch
++ #endif
++ #endif
++ #endif
++ #endif
+ #endif
+-#endif
+
+ // Cpu architecture string
+-#if defined(ZERO)
+-static char cpu_arch[] = ZERO_LIBARCH;
+-#elif defined(IA64)
+-static char cpu_arch[] = "ia64";
+-#elif defined(IA32)
+-static char cpu_arch[] = "i386";
+-#elif defined(AMD64)
+-static char cpu_arch[] = "amd64";
+-#elif defined(ARM)
+-static char cpu_arch[] = "arm";
+-#elif defined(PPC32)
+-static char cpu_arch[] = "ppc";
+-#elif defined(PPC64)
+-static char cpu_arch[] = "ppc64";
+-#elif defined(SPARC)
+-# ifdef _LP64
+-static char cpu_arch[] = "sparcv9";
+-# else
+-static char cpu_arch[] = "sparc";
+-# endif
+-#else
+-#error Add appropriate cpu_arch setting
+-#endif
+-
++static char cpu_arch[] = HOTSPOT_LIB_ARCH;
+
+ // pid_t gettid()
+ //
+@@ -4681,6 +4635,11 @@
+ tty->print_cr(" found:%s", get_signal_handler_name(thisHandler, buf, O_BUFLEN));
+ // No need to check this sig any longer
+ sigaddset(&check_signal_done, sig);
++ // Running under non-interactive shell, SHUTDOWN2_SIGNAL will be reassigned SIG_IGN
++ if (sig == SHUTDOWN2_SIGNAL && !isatty(fileno(stdin))) {
++ tty->print_cr("Running in non-interactive shell, %s handler is replaced by shell",
++ exception_name(sig, buf, O_BUFLEN));
++ }
+ } else if(os::Linux::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Linux::get_our_sigflags(sig)) {
+ tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
+ tty->print("expected:" PTR32_FORMAT, os::Linux::get_our_sigflags(sig));
+@@ -4936,17 +4895,6 @@
+ return JNI_OK;
+ }
+
+-// this is called at the end of vm_initialization
+-void os::init_3(void) {
+-#ifdef JAVASE_EMBEDDED
+- // Start the MemNotifyThread
+- if (LowMemoryProtection) {
+- MemNotifyThread::start();
+- }
+- return;
+-#endif
+-}
+-
+ // Mark the polling page as unreadable
+ void os::make_polling_page_unreadable(void) {
+ if( !guard_memory((char*)_polling_page, Linux::page_size()) )
+@@ -5992,14 +5940,6 @@
+
+ extern char** environ;
+
+-#ifndef __NR_fork
+-#define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57)
+-#endif
+-
+-#ifndef __NR_execve
+-#define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59)
+-#endif
+-
+ // Run the specified command in a separate process. Return its exit value,
+ // or -1 on failure (e.g. can't fork a new process).
+ // Unlike system(), this function can be called from signal handler. It
+@@ -6007,13 +5947,7 @@
+ int os::fork_and_exec(char* cmd) {
+ const char * argv[4] = {"sh", "-c", cmd, NULL};
+
+- // fork() in LinuxThreads/NPTL is not async-safe. It needs to run
+- // pthread_atfork handlers and reset pthread library. All we need is a
+- // separate process to execve. Make a direct syscall to fork process.
+- // On IA64 there's no fork syscall, we have to use fork() and hope for
+- // the best...
+- pid_t pid = NOT_IA64(syscall(__NR_fork);)
+- IA64_ONLY(fork();)
++ pid_t pid = fork();
+
+ if (pid < 0) {
+ // fork failed
+@@ -6022,15 +5956,7 @@
+ } else if (pid == 0) {
+ // child process
+
+- // execve() in LinuxThreads will call pthread_kill_other_threads_np()
+- // first to kill every thread on the thread list. Because this list is
+- // not reset by fork() (see notes above), execve() will instead kill
+- // every thread in the parent process. We know this is the only thread
+- // in the new process, so make a system call directly.
+- // IA64 should use normal execve() from glibc to match the glibc fork()
+- // above.
+- NOT_IA64(syscall(__NR_execve, "/bin/sh", argv, environ);)
+- IA64_ONLY(execve("/bin/sh", (char* const*)argv, environ);)
++ execve("/bin/sh", (char* const*)argv, environ);
+
+ // execve failed
+ _exit(-1);
+@@ -6123,83 +6049,6 @@
+ return strlen(buffer);
+ }
+
+-#ifdef JAVASE_EMBEDDED
+-//
+-// A thread to watch the '/dev/mem_notify' device, which will tell us when the OS is running low on memory.
+-//
+-MemNotifyThread* MemNotifyThread::_memnotify_thread = NULL;
+-
+-// ctor
+-//
+-MemNotifyThread::MemNotifyThread(int fd): Thread() {
+- assert(memnotify_thread() == NULL, "we can only allocate one MemNotifyThread");
+- _fd = fd;
+-
+- if (os::create_thread(this, os::os_thread)) {
+- _memnotify_thread = this;
+- os::set_priority(this, NearMaxPriority);
+- os::start_thread(this);
+- }
+-}
+-
+-// Where all the work gets done
+-//
+-void MemNotifyThread::run() {
+- assert(this == memnotify_thread(), "expected the singleton MemNotifyThread");
+-
+- // Set up the select arguments
+- fd_set rfds;
+- if (_fd != -1) {
+- FD_ZERO(&rfds);
+- FD_SET(_fd, &rfds);
+- }
+-
+- // Now wait for the mem_notify device to wake up
+- while (1) {
+- // Wait for the mem_notify device to signal us..
+- int rc = select(_fd+1, _fd != -1 ? &rfds : NULL, NULL, NULL, NULL);
+- if (rc == -1) {
+- perror("select!\n");
+- break;
+- } else if (rc) {
+- //ssize_t free_before = os::available_memory();
+- //tty->print ("Notified: Free: %dK \n",os::available_memory()/1024);
+-
+- // The kernel is telling us there is not much memory left...
+- // try to do something about that
+-
+- // If we are not already in a GC, try one.
+- if (!Universe::heap()->is_gc_active()) {
+- Universe::heap()->collect(GCCause::_allocation_failure);
+-
+- //ssize_t free_after = os::available_memory();
+- //tty->print ("Post-Notify: Free: %dK\n",free_after/1024);
+- //tty->print ("GC freed: %dK\n", (free_after - free_before)/1024);
+- }
+- // We might want to do something like the following if we find the GC's are not helping...
+- // Universe::heap()->size_policy()->set_gc_time_limit_exceeded(true);
+- }
+- }
+-}
+-
+-//
+-// See if the /dev/mem_notify device exists, and if so, start a thread to monitor it.
+-//
+-void MemNotifyThread::start() {
+- int fd;
+- fd = open ("/dev/mem_notify", O_RDONLY, 0);
+- if (fd < 0) {
+- return;
+- }
+-
+- if (memnotify_thread() == NULL) {
+- new MemNotifyThread(fd);
+- }
+-}
+-
+-#endif // JAVASE_EMBEDDED
+-
+-
+ /////////////// Unit tests ///////////////
+
+ #ifndef PRODUCT
+--- ./hotspot/src/os/solaris/vm/jvm_solaris.h Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os/solaris/vm/jvm_solaris.h Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -41,7 +41,9 @@
+ * JNI conversion, which should be sorted out later.
+ */
+
++#define __USE_LEGACY_PROTOTYPES__
+ #include <dirent.h> /* For DIR */
++#undef __USE_LEGACY_PROTOTYPES__
+ #include <sys/param.h> /* For MAXPATHLEN */
+ #include <sys/socket.h> /* For socklen_t */
+ #include <unistd.h> /* For F_OK, R_OK, W_OK */
+--- ./hotspot/src/os/solaris/vm/os_solaris.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os/solaris/vm/os_solaris.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -2696,29 +2696,30 @@
+ }
+ }
+
++size_t os::Solaris::page_size_for_alignment(size_t alignment) {
++ assert(is_size_aligned(alignment, (size_t) vm_page_size()),
++ err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT,
++ alignment, (size_t) vm_page_size()));
++
++ for (int i = 0; _page_sizes[i] != 0; i++) {
++ if (is_size_aligned(alignment, _page_sizes[i])) {
++ return _page_sizes[i];
++ }
++ }
++
++ return (size_t) vm_page_size();
++}
++
+ int os::Solaris::commit_memory_impl(char* addr, size_t bytes,
+ size_t alignment_hint, bool exec) {
+ int err = Solaris::commit_memory_impl(addr, bytes, exec);
+- if (err == 0) {
+- if (UseLargePages && (alignment_hint > (size_t)vm_page_size())) {
+- // If the large page size has been set and the VM
+- // is using large pages, use the large page size
+- // if it is smaller than the alignment hint. This is
+- // a case where the VM wants to use a larger alignment size
+- // for its own reasons but still want to use large pages
+- // (which is what matters to setting the mpss range.
+- size_t page_size = 0;
+- if (large_page_size() < alignment_hint) {
+- assert(UseLargePages, "Expected to be here for large page use only");
+- page_size = large_page_size();
+- } else {
+- // If the alignment hint is less than the large page
+- // size, the VM wants a particular alignment (thus the hint)
+- // for internal reasons. Try to set the mpss range using
+- // the alignment_hint.
+- page_size = alignment_hint;
+- }
+- // Since this is a hint, ignore any failures.
++ if (err == 0 && UseLargePages && alignment_hint > 0) {
++ assert(is_size_aligned(bytes, alignment_hint),
++ err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, alignment_hint));
++
++ // The syscall memcntl requires an exact page size (see man memcntl for details).
++ size_t page_size = page_size_for_alignment(alignment_hint);
++ if (page_size > (size_t) vm_page_size()) {
+ (void)Solaris::setup_large_pages(addr, bytes, page_size);
+ }
+ }
+@@ -3251,7 +3252,22 @@
+ }
+ }
+
++bool os::Solaris::is_valid_page_size(size_t bytes) {
++ for (int i = 0; _page_sizes[i] != 0; i++) {
++ if (_page_sizes[i] == bytes) {
++ return true;
++ }
++ }
++ return false;
++}
++
+ bool os::Solaris::setup_large_pages(caddr_t start, size_t bytes, size_t align) {
++ assert(is_valid_page_size(align), err_msg(SIZE_FORMAT " is not a valid page size", align));
++ assert(is_ptr_aligned((void*) start, align),
++ err_msg(PTR_FORMAT " is not aligned to " SIZE_FORMAT, p2i((void*) start), align));
++ assert(is_size_aligned(bytes, align),
++ err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, align));
++
+ // Signal to OS that we want large pages for addresses
+ // from addr, addr + bytes
+ struct memcntl_mha mpss_struct;
+@@ -4577,6 +4593,11 @@
+ tty->print_cr(" found:%s", get_signal_handler_name(thisHandler, buf, O_BUFLEN));
+ // No need to check this sig any longer
+ sigaddset(&check_signal_done, sig);
++ // Running under non-interactive shell, SHUTDOWN2_SIGNAL will be reassigned SIG_IGN
++ if (sig == SHUTDOWN2_SIGNAL && !isatty(fileno(stdin))) {
++ tty->print_cr("Running in non-interactive shell, %s handler is replaced by shell",
++ exception_name(sig, buf, O_BUFLEN));
++ }
+ } else if(os::Solaris::get_our_sigflags(sig) != 0 && act.sa_flags != os::Solaris::get_our_sigflags(sig)) {
+ tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
+ tty->print("expected:" PTR32_FORMAT, os::Solaris::get_our_sigflags(sig));
+@@ -5194,10 +5215,6 @@
+ return JNI_OK;
+ }
+
+-void os::init_3(void) {
+- return;
+-}
+-
+ // Mark the polling page as unreadable
+ void os::make_polling_page_unreadable(void) {
+ if( mprotect((char *)_polling_page, page_size, PROT_NONE) != 0 )
+--- ./hotspot/src/os/solaris/vm/os_solaris.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os/solaris/vm/os_solaris.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -110,6 +110,8 @@
+ static meminfo_func_t _meminfo;
+
+ // Large Page Support
++ static bool is_valid_page_size(size_t bytes);
++ static size_t page_size_for_alignment(size_t alignment);
+ static bool setup_large_pages(caddr_t start, size_t bytes, size_t align);
+
+ static void init_thread_fpu_state(void);
+--- ./hotspot/src/os/windows/vm/os_windows.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os/windows/vm/os_windows.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -110,11 +110,13 @@
+ static FILETIME process_kernel_time;
+
+ #ifdef _M_IA64
+-#define __CPU__ ia64
+-#elif _M_AMD64
+-#define __CPU__ amd64
++ #define __CPU__ ia64
+ #else
+-#define __CPU__ i486
++ #ifdef _M_AMD64
++ #define __CPU__ amd64
++ #else
++ #define __CPU__ i486
++ #endif
+ #endif
+
+ // save DLL module handle, used by GetModuleFileName
+@@ -2138,20 +2140,22 @@
+ // at the beginning of the target bundle.
+ exceptionInfo->ContextRecord->StIPSR &= 0xFFFFF9FFFFFFFFFF;
+ assert(((DWORD64)handler & 0xF) == 0, "Target address must point to the beginning of a bundle!");
+-#elif _M_AMD64
++#else
++ #ifdef _M_AMD64
+ // Do not blow up if no thread info available.
+ if (thread) {
+ thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Rip);
+ }
+ // Set pc to handler
+ exceptionInfo->ContextRecord->Rip = (DWORD64)handler;
+-#else
++ #else
+ // Do not blow up if no thread info available.
+ if (thread) {
+ thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Eip);
+ }
+ // Set pc to handler
+ exceptionInfo->ContextRecord->Eip = (DWORD)(DWORD_PTR)handler;
++ #endif
+ #endif
+
+ // Continue the execution
+@@ -2250,7 +2254,8 @@
+ // (division by zero is handled explicitly)
+ #ifdef _M_IA64
+ assert(0, "Fix Handle_IDiv_Exception");
+-#elif _M_AMD64
++#else
++ #ifdef _M_AMD64
+ PCONTEXT ctx = exceptionInfo->ContextRecord;
+ address pc = (address)ctx->Rip;
+ assert(pc[0] == 0xF7, "not an idiv opcode");
+@@ -2261,7 +2266,7 @@
+ ctx->Rax = (DWORD)min_jint; // result
+ ctx->Rdx = (DWORD)0; // remainder
+ // Continue the execution
+-#else
++ #else
+ PCONTEXT ctx = exceptionInfo->ContextRecord;
+ address pc = (address)ctx->Eip;
+ assert(pc[0] == 0xF7, "not an idiv opcode");
+@@ -2272,6 +2277,7 @@
+ ctx->Eax = (DWORD)min_jint; // result
+ ctx->Edx = (DWORD)0; // remainder
+ // Continue the execution
++ #endif
+ #endif
+ return EXCEPTION_CONTINUE_EXECUTION;
+ }
+@@ -2351,10 +2357,12 @@
+ // This is needed for IA64 because "relocation" / "implicit null check" / "poll instruction"
+ // information is saved in the Unix format.
+ address pc_unix_format = (address) ((((uint64_t)pc) & 0xFFFFFFFFFFFFFFF0) | ((((uint64_t)pc) & 0xF) >> 2));
+-#elif _M_AMD64
++#else
++ #ifdef _M_AMD64
+ address pc = (address) exceptionInfo->ContextRecord->Rip;
+-#else
++ #else
+ address pc = (address) exceptionInfo->ContextRecord->Eip;
++ #endif
+ #endif
+ Thread* t = ThreadLocalStorage::get_thread_slow(); // slow & steady
+
+@@ -4062,10 +4070,6 @@
+ return JNI_OK;
+ }
+
+-void os::init_3(void) {
+- return;
+-}
+-
+ // Mark the polling page as unreadable
+ void os::make_polling_page_unreadable(void) {
+ DWORD old_status;
+--- ./hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -238,7 +238,13 @@
+ // operation. Note that some platforms only support this with the
+ // limitation that the only valid value to store is the immediate
+ // constant 1. There is a test for this in JNI_CreateJavaVM().
+- return __sync_lock_test_and_set (dest, exchange_value);
++ jint result = __sync_lock_test_and_set (dest, exchange_value);
++ // All atomic operations are expected to be full memory barriers
++ // (see atomic.hpp). However, __sync_lock_test_and_set is not
++ // a full memory barrier, but an acquire barrier. Hence, this added
++ // barrier.
++ __sync_synchronize();
++ return result;
+ #endif // M68K
+ #endif // ARM
+ }
+@@ -251,7 +257,9 @@
+ #ifdef M68K
+ return m68k_lock_test_and_set(dest, exchange_value);
+ #else
+- return __sync_lock_test_and_set (dest, exchange_value);
++ intptr_t result = __sync_lock_test_and_set (dest, exchange_value);
++ __sync_synchronize();
++ return result;
+ #endif // M68K
+ #endif // ARM
+ }
+--- ./hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,6 +1,6 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+- * Copyright 2012, 2014 SAP AG. All rights reserved.
++ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright 2012, 2015 SAP AG. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -10,7 +10,7 @@
+ * 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 hat
++ * 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
+@@ -290,6 +290,7 @@
+ goto report_and_die;
+ }
+
++ CodeBlob *cb = NULL;
+ // Handle signal from NativeJump::patch_verified_entry().
+ if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
+ (!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
+@@ -305,7 +306,10 @@
+ // especially when we try to read from the safepoint polling page. So the check
+ // (address)info->si_addr == os::get_standard_polling_page()
+ // doesn't work for us. We use:
+- ((NativeInstruction*)pc)->is_safepoint_poll()) {
++ ((NativeInstruction*)pc)->is_safepoint_poll() &&
++ CodeCache::contains((void*) pc) &&
++ ((cb = CodeCache::find_blob(pc)) != NULL) &&
++ cb->is_nmethod()) {
+ if (TraceTraps) {
+ tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
+ }
+--- ./hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -26,8 +26,8 @@
+ #include "runtime/os.hpp"
+ #include "vm_version_sparc.hpp"
+
+-static bool detect_niagara() {
+- char cpu[128];
++static bool cpuinfo_field_contains(const char* field, const char* value) {
++ char line[1024];
+ bool rv = false;
+
+ FILE* fp = fopen("/proc/cpuinfo", "r");
+@@ -35,9 +35,10 @@
+ return rv;
+ }
+
+- while (!feof(fp)) {
+- if (fscanf(fp, "cpu\t\t: %100[^\n]", &cpu) == 1) {
+- if (strstr(cpu, "Niagara") != NULL) {
++ while (fgets(line, sizeof(line), fp) != NULL) {
++ assert(strlen(line) < sizeof(line) - 1, "buffer line[1024] is too small.");
++ if (strncmp(line, field, strlen(field)) == 0) {
++ if (strstr(line, value) != NULL) {
+ rv = true;
+ }
+ break;
+@@ -45,8 +46,15 @@
+ }
+
+ fclose(fp);
++ return rv;
++}
+
+- return rv;
++static bool detect_niagara() {
++ return cpuinfo_field_contains("cpu", "Niagara");
++}
++
++static bool detect_blkinit() {
++ return cpuinfo_field_contains("cpucaps", "blkinit");
+ }
+
+ int VM_Version::platform_features(int features) {
+@@ -58,5 +66,9 @@
+ features = niagara1_m | T_family_m;
+ }
+
++ if (detect_blkinit()) {
++ features |= blk_init_instructions_m;
++ }
++
+ return features;
+ }
+--- ./hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,6 +1,6 @@
+ /*
+- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+- * Copyright 2007, 2008, 2011 Red Hat, Inc.
++ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright 2007, 2008, 2011, 2015, Red Hat, Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -232,7 +232,13 @@
+ // operation. Note that some platforms only support this with the
+ // limitation that the only valid value to store is the immediate
+ // constant 1. There is a test for this in JNI_CreateJavaVM().
+- return __sync_lock_test_and_set (dest, exchange_value);
++ jint result = __sync_lock_test_and_set (dest, exchange_value);
++ // All atomic operations are expected to be full memory barriers
++ // (see atomic.hpp). However, __sync_lock_test_and_set is not
++ // a full memory barrier, but an acquire barrier. Hence, this added
++ // barrier.
++ __sync_synchronize();
++ return result;
+ #endif // M68K
+ #endif // ARM
+ }
+@@ -245,7 +251,9 @@
+ #ifdef M68K
+ return m68k_lock_test_and_set(dest, exchange_value);
+ #else
+- return __sync_lock_test_and_set (dest, exchange_value);
++ intptr_t result = __sync_lock_test_and_set (dest, exchange_value);
++ __sync_synchronize();
++ return result;
+ #endif // M68K
+ #endif // ARM
+ }
+--- ./hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -264,7 +264,7 @@
+ CAST_FROM_FN_PTR(address, os::current_frame));
+ if (os::is_first_C_frame(&myframe)) {
+ // stack is not walkable
+- return frame(NULL, NULL, NULL);
++ return frame(NULL, NULL, false);
+ } else {
+ return os::get_sender_for_C_frame(&myframe);
+ }
+--- ./hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -34,8 +34,7 @@
+ #include <dlfcn.h>
+ #include <link.h>
+
+-extern "C" static int PICL_get_l1_data_cache_line_size_helper(picl_nodehdl_t nodeh, void *result);
+-extern "C" static int PICL_get_l2_cache_line_size_helper(picl_nodehdl_t nodeh, void *result);
++extern "C" static int PICL_visit_cpu_helper(picl_nodehdl_t nodeh, void *result);
+
+ // Functions from the library we need (signatures should match those in picl.h)
+ extern "C" {
+@@ -128,60 +127,87 @@
+ bool is_inconsistent() { return _state == INCONSISTENT; }
+ void set_inconsistent() { _state = INCONSISTENT; }
+
+- static int visit(picl_nodehdl_t nodeh, const char* name, void *arg) {
+- UniqueValueVisitor *state = static_cast<UniqueValueVisitor*>(arg);
+- PICL* picl = state->_picl;
+- assert(!state->is_inconsistent(), "Precondition");
++ bool visit(picl_nodehdl_t nodeh, const char* name) {
++ assert(!is_inconsistent(), "Precondition");
+ int curr;
+- if (picl->get_int_property(nodeh, name, &curr) == PICL_SUCCESS) {
+- if (!state->is_assigned()) { // first iteration
+- state->set_value(curr);
+- } else if (curr != state->value()) { // following iterations
+- state->set_inconsistent();
++ if (_picl->get_int_property(nodeh, name, &curr) == PICL_SUCCESS) {
++ if (!is_assigned()) { // first iteration
++ set_value(curr);
++ } else if (curr != value()) { // following iterations
++ set_inconsistent();
++ }
++ return true;
++ }
++ return false;
++ }
++ };
++
++ class CPUVisitor {
++ UniqueValueVisitor _l1_visitor;
++ UniqueValueVisitor _l2_visitor;
++ int _limit; // number of times visit() can be run
++ public:
++ CPUVisitor(PICL *picl, int limit) : _l1_visitor(picl), _l2_visitor(picl), _limit(limit) {}
++ static int visit(picl_nodehdl_t nodeh, void *arg) {
++ CPUVisitor *cpu_visitor = static_cast<CPUVisitor*>(arg);
++ UniqueValueVisitor* l1_visitor = cpu_visitor->l1_visitor();
++ UniqueValueVisitor* l2_visitor = cpu_visitor->l2_visitor();
++ if (!l1_visitor->is_inconsistent()) {
++ l1_visitor->visit(nodeh, "l1-dcache-line-size");
++ }
++ static const char* l2_data_cache_line_property_name = NULL;
++ // On the first visit determine the name of the l2 cache line size property and memoize it.
++ if (l2_data_cache_line_property_name == NULL) {
++ assert(!l2_visitor->is_inconsistent(), "First iteration cannot be inconsistent");
++ l2_data_cache_line_property_name = "l2-cache-line-size";
++ if (!l2_visitor->visit(nodeh, l2_data_cache_line_property_name)) {
++ l2_data_cache_line_property_name = "l2-dcache-line-size";
++ l2_visitor->visit(nodeh, l2_data_cache_line_property_name);
++ }
++ } else {
++ if (!l2_visitor->is_inconsistent()) {
++ l2_visitor->visit(nodeh, l2_data_cache_line_property_name);
+ }
+ }
+- if (state->is_inconsistent()) {
++
++ if (l1_visitor->is_inconsistent() && l2_visitor->is_inconsistent()) {
++ return PICL_WALK_TERMINATE;
++ }
++ cpu_visitor->_limit--;
++ if (cpu_visitor->_limit <= 0) {
+ return PICL_WALK_TERMINATE;
+ }
+ return PICL_WALK_CONTINUE;
+ }
++ UniqueValueVisitor* l1_visitor() { return &_l1_visitor; }
++ UniqueValueVisitor* l2_visitor() { return &_l2_visitor; }
+ };
+-
+ int _L1_data_cache_line_size;
+- int _L2_cache_line_size;
++ int _L2_data_cache_line_size;
+ public:
+- static int get_l1_data_cache_line_size(picl_nodehdl_t nodeh, void *state) {
+- return UniqueValueVisitor::visit(nodeh, "l1-dcache-line-size", state);
+- }
+- static int get_l2_cache_line_size(picl_nodehdl_t nodeh, void *state) {
+- return UniqueValueVisitor::visit(nodeh, "l2-cache-line-size", state);
++ static int visit_cpu(picl_nodehdl_t nodeh, void *state) {
++ return CPUVisitor::visit(nodeh, state);
+ }
+
+- PICL() : _L1_data_cache_line_size(0), _L2_cache_line_size(0), _dl_handle(NULL) {
++ PICL(bool is_fujitsu) : _L1_data_cache_line_size(0), _L2_data_cache_line_size(0), _dl_handle(NULL) {
+ if (!open_library()) {
+ return;
+ }
+ if (_picl_initialize() == PICL_SUCCESS) {
+ picl_nodehdl_t rooth;
+ if (_picl_get_root(&rooth) == PICL_SUCCESS) {
+- UniqueValueVisitor L1_state(this);
+- // Visit all "cpu" class instances
+- _picl_walk_tree_by_class(rooth, "cpu", &L1_state, PICL_get_l1_data_cache_line_size_helper);
+- if (L1_state.is_initial()) { // Still initial, iteration found no values
+- // Try walk all "core" class instances, it might be a Fujitsu machine
+- _picl_walk_tree_by_class(rooth, "core", &L1_state, PICL_get_l1_data_cache_line_size_helper);
++ const char* cpu_class = "cpu";
++ // If it's a Fujitsu machine, it's a "core"
++ if (is_fujitsu) {
++ cpu_class = "core";
+ }
+- if (L1_state.is_assigned()) { // Is there a value?
+- _L1_data_cache_line_size = L1_state.value();
++ CPUVisitor cpu_visitor(this, os::processor_count());
++ _picl_walk_tree_by_class(rooth, cpu_class, &cpu_visitor, PICL_visit_cpu_helper);
++ if (cpu_visitor.l1_visitor()->is_assigned()) { // Is there a value?
++ _L1_data_cache_line_size = cpu_visitor.l1_visitor()->value();
+ }
+-
+- UniqueValueVisitor L2_state(this);
+- _picl_walk_tree_by_class(rooth, "cpu", &L2_state, PICL_get_l2_cache_line_size_helper);
+- if (L2_state.is_initial()) {
+- _picl_walk_tree_by_class(rooth, "core", &L2_state, PICL_get_l2_cache_line_size_helper);
+- }
+- if (L2_state.is_assigned()) {
+- _L2_cache_line_size = L2_state.value();
++ if (cpu_visitor.l2_visitor()->is_assigned()) {
++ _L2_data_cache_line_size = cpu_visitor.l2_visitor()->value();
+ }
+ }
+ _picl_shutdown();
+@@ -190,14 +216,12 @@
+ }
+
+ unsigned int L1_data_cache_line_size() const { return _L1_data_cache_line_size; }
+- unsigned int L2_cache_line_size() const { return _L2_cache_line_size; }
++ unsigned int L2_data_cache_line_size() const { return _L2_data_cache_line_size; }
+ };
+
+-extern "C" static int PICL_get_l1_data_cache_line_size_helper(picl_nodehdl_t nodeh, void *result) {
+- return PICL::get_l1_data_cache_line_size(nodeh, result);
+-}
+-extern "C" static int PICL_get_l2_cache_line_size_helper(picl_nodehdl_t nodeh, void *result) {
+- return PICL::get_l2_cache_line_size(nodeh, result);
++
++extern "C" static int PICL_visit_cpu_helper(picl_nodehdl_t nodeh, void *result) {
++ return PICL::visit_cpu(nodeh, result);
+ }
+
+ template<typename FuncType>
+@@ -470,8 +494,8 @@
+ }
+
+ // Figure out cache line sizes using PICL
+- PICL picl;
+- _L2_cache_line_size = picl.L2_cache_line_size();
++ PICL picl((features & sparc64_family_m) != 0);
++ _L2_data_cache_line_size = picl.L2_data_cache_line_size();
+
+ return features;
+ }
+--- ./hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2009, 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
+@@ -24,12 +24,12 @@
+
+ /**
+ * A SAX based parser of LogCompilation output from HotSpot. It takes a complete
+- * @author never
+ */
+
+ package com.sun.hotspot.tools.compiler;
+
+ import java.io.FileReader;
++import java.io.PrintStream;
+ import java.io.Reader;
+ import java.util.ArrayList;
+ import java.util.Collections;
+@@ -133,6 +133,44 @@
+ }
+ };
+
++ class Jvms {
++ Jvms(Method method, int bci) {
++ this.method = method;
++ this.bci = bci;
++ }
++ final public Method method;
++ final public int bci;
++ final public String toString() {
++ return "@" + bci + " " + method;
++ }
++ }
++
++ class LockElimination extends BasicLogEvent {
++
++ ArrayList<Jvms> jvms = new ArrayList<Jvms>(1);
++ final String kind;
++ final String classId;
++ final String tagName;
++ LockElimination(String tagName, double start, String id, String kind, String classId) {
++ super(start, id);
++ this.kind = kind;
++ this.classId = classId;
++ this.tagName = tagName;
++ }
++
++ @Override
++ public void print(PrintStream stream) {
++ stream.printf("%s %s %s %s %.3f ", getId(), tagName, kind, classId, getStart());
++ stream.print(jvms.toString());
++ stream.print("\n");
++ }
++
++ void addJVMS(Method method, int bci) {
++ jvms.add(new Jvms(method, bci));
++ }
++
++ }
++
+ private ArrayList<LogEvent> events = new ArrayList<LogEvent>();
+
+ private HashMap<String, String> types = new HashMap<String, String>();
+@@ -145,6 +183,7 @@
+ private Compilation compile;
+ private CallSite site;
+ private Stack<Phase> phaseStack = new Stack<Phase>();
++ private LockElimination currentLockElimination;
+ private UncommonTrapEvent currentTrap;
+ private Stack<CallSite> late_inline_scope;
+
+@@ -188,7 +227,12 @@
+ }
+
+ LogParser log = new LogParser();
+- p.parse(new InputSource(reader), log);
++ try {
++ p.parse(new InputSource(reader), log);
++ } catch (Throwable th) {
++ th.printStackTrace();
++ // Carry on with what we've got...
++ }
+
+ // Associate compilations with their NMethods
+ for (NMethod nm : log.nmethods.values()) {
+@@ -370,6 +414,15 @@
+ // uncommon trap inserted during parsing.
+ // ignore for now
+ }
++ } else if (qname.startsWith("eliminate_lock")) {
++ String id = atts.getValue("compile_id");
++ if (id != null) {
++ id = makeId(atts);
++ String kind = atts.getValue("kind");
++ String classId = atts.getValue("class_id");
++ currentLockElimination = new LockElimination(qname, Double.parseDouble(search(atts, "stamp")), id, kind, classId);
++ events.add(currentLockElimination);
++ }
+ } else if (qname.equals("late_inline")) {
+ late_inline_scope = new Stack<CallSite>();
+ site = new CallSite(-999, method(search(atts, "method")));
+@@ -378,13 +431,14 @@
+ // <jvms bci='4' method='java/io/DataInputStream readChar ()C' bytes='40' count='5815' iicount='20815'/>
+ if (currentTrap != null) {
+ currentTrap.addJVMS(atts.getValue("method"), Integer.parseInt(atts.getValue("bci")));
++ } else if (currentLockElimination != null) {
++ currentLockElimination.addJVMS(method(atts.getValue("method")), Integer.parseInt(atts.getValue("bci")));
+ } else if (late_inline_scope != null) {
+ bci = Integer.parseInt(search(atts, "bci"));
+ site = new CallSite(bci, method(search(atts, "method")));
+ late_inline_scope.push(site);
+ } else {
+ // Ignore <eliminate_allocation type='667'>,
+- // <eliminate_lock lock='1'>,
+ // <replace_string_concat arguments='2' string_alloc='0' multiple='0'>
+ }
+ } else if (qname.equals("nmethod")) {
+@@ -437,6 +491,8 @@
+ scopes.pop();
+ } else if (qname.equals("uncommon_trap")) {
+ currentTrap = null;
++ } else if (qname.startsWith("eliminate_lock")) {
++ currentLockElimination = null;
+ } else if (qname.equals("late_inline")) {
+ // Populate late inlining info.
+
+@@ -445,8 +501,8 @@
+ CallSite caller = late_inline_scope.pop();
+ Method m = compile.getMethod();
+ if (m != caller.getMethod()) {
+- System.out.println(m);
+- System.out.println(caller.getMethod() + " bci: " + bci);
++ System.err.println(m);
++ System.err.println(caller.getMethod() + " bci: " + bci);
+ throw new InternalError("call site and late_inline info don't match");
+ }
+
+--- ./hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/UncommonTrapEvent.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/UncommonTrapEvent.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2009, 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
+@@ -50,7 +50,7 @@
+ }
+
+ public void print(PrintStream stream) {
+- stream.printf("%s uncommon trap %s %s\n", getId(), getReason(), getAction());
++ stream.printf("%s uncommon trap %.3f %s %s\n", getId(), getStart(), getReason(), getAction());
+ stream.print(getJvms());
+ }
+
+--- ./hotspot/src/share/vm/adlc/adlparse.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/adlc/adlparse.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -800,6 +800,7 @@
+ }
+ if (strcmp(token,"reg_def")==0) { reg_def_parse(); }
+ else if (strcmp(token,"reg_class")==0) { reg_class_parse(); }
++ else if (strcmp(token, "reg_class_dynamic") == 0) { reg_class_dynamic_parse(); }
+ else if (strcmp(token,"alloc_class")==0) { alloc_class_parse(); }
+ else if (strcmp(token,"#define")==0) { preproc_define(); }
+ else { parse_err(SYNERR, "bad token %s inside register block.\n", token); break; }
+@@ -2323,11 +2324,12 @@
+ // Debug Stuff
+ if (_AD._adl_debug >1) fprintf(stderr,"Register Class: %s\n", cname);
+
+- RegClass *reg_class = _AD._register->addRegClass(cname);
+-
+- // Collect registers in class
+ skipws();
+ if (_curchar == '(') {
++ // A register list is defined for the register class.
++ // Collect registers into a generic RegClass register class.
++ RegClass* reg_class = _AD._register->addRegClass<RegClass>(cname);
++
+ next_char(); // Skip '('
+ skipws();
+ while (_curchar != ')') {
+@@ -2352,12 +2354,15 @@
+ }
+ next_char(); // Skip closing ')'
+ } else if (_curchar == '%') {
++ // A code snippet is defined for the register class.
++ // Collect the code snippet into a CodeSnippetRegClass register class.
++ CodeSnippetRegClass* reg_class = _AD._register->addRegClass<CodeSnippetRegClass>(cname);
+ char *code = find_cpp_block("reg class");
+ if (code == NULL) {
+ parse_err(SYNERR, "missing code declaration for reg class.\n");
+ return;
+ }
+- reg_class->_user_defined = code;
++ reg_class->set_code_snippet(code);
+ return;
+ }
+
+@@ -2374,6 +2379,87 @@
+ return;
+ }
+
++//------------------------------reg_class_dynamic_parse------------------------
++void ADLParser::reg_class_dynamic_parse(void) {
++ char *cname; // Name of dynamic register class being defined
++
++ // Get register class name
++ skipws();
++ cname = get_ident();
++ if (cname == NULL) {
++ parse_err(SYNERR, "missing dynamic register class name after 'reg_class_dynamic'\n");
++ return;
++ }
++
++ if (_AD._adl_debug > 1) {
++ fprintf(stdout, "Dynamic Register Class: %s\n", cname);
++ }
++
++ skipws();
++ if (_curchar != '(') {
++ parse_err(SYNERR, "missing '(' at the beginning of reg_class_dynamic definition\n");
++ return;
++ }
++ next_char();
++ skipws();
++
++ // Collect two register classes and the C++ code representing the condition code used to
++ // select between the two classes into a ConditionalRegClass register class.
++ ConditionalRegClass* reg_class = _AD._register->addRegClass<ConditionalRegClass>(cname);
++ int i;
++ for (i = 0; i < 2; i++) {
++ char* name = get_ident();
++ if (name == NULL) {
++ parse_err(SYNERR, "missing class identifier inside reg_class_dynamic list.\n");
++ return;
++ }
++ RegClass* rc = _AD._register->getRegClass(name);
++ if (rc == NULL) {
++ parse_err(SEMERR, "unknown identifier %s inside reg_class_dynamic list.\n", name);
++ } else {
++ reg_class->set_rclass_at_index(i, rc);
++ }
++
++ skipws();
++ if (_curchar == ',') {
++ next_char();
++ skipws();
++ } else {
++ parse_err(SYNERR, "missing separator ',' inside reg_class_dynamic list.\n");
++ }
++ }
++
++ // Collect the condition code.
++ skipws();
++ if (_curchar == '%') {
++ char* code = find_cpp_block("reg class dynamic");
++ if (code == NULL) {
++ parse_err(SYNERR, "missing code declaration for reg_class_dynamic.\n");
++ return;
++ }
++ reg_class->set_condition_code(code);
++ } else {
++ parse_err(SYNERR, "missing %% at the beginning of code block in reg_class_dynamic definition\n");
++ return;
++ }
++
++ skipws();
++ if (_curchar != ')') {
++ parse_err(SYNERR, "missing ')' at the end of reg_class_dynamic definition\n");
++ return;
++ }
++ next_char();
++
++ skipws();
++ if (_curchar != ';') {
++ parse_err(SYNERR, "missing ';' at the end of reg_class_dynamic definition.\n");
++ return;
++ }
++ next_char(); // Skip trailing ';'
++
++ return;
++}
++
+ //------------------------------alloc_class_parse------------------------------
+ void ADLParser::alloc_class_parse(void) {
+ char *name; // Name of allocation class being defined
+--- ./hotspot/src/share/vm/adlc/adlparse.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/adlc/adlparse.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -53,6 +53,8 @@
+ // ***** Register Section *****
+ class RegDef;
+ class RegClass;
++class CodeSnippetRegClass;
++class ConditionalRegClass;
+ class AllocClass;
+ class ResourceForm;
+ // ***** Pipeline Section *****
+@@ -127,6 +129,7 @@
+ // Parse components of the register section
+ void reg_def_parse(void); // Parse register definition
+ void reg_class_parse(void); // Parse register class definition
++ void reg_class_dynamic_parse(void); // Parse dynamic register class definition
+ void alloc_class_parse(void); // Parse allocation class definition
+
+ // Parse components of the definition section
+--- ./hotspot/src/share/vm/adlc/archDesc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/adlc/archDesc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -934,7 +934,7 @@
+ void ArchDesc::set_stack_or_reg(const char *reg_class_name) {
+ if( _register ) {
+ RegClass *reg_class = _register->getRegClass(reg_class_name);
+- reg_class->_stack_or_reg = true;
++ reg_class->set_stack_version(true);
+ }
+ }
+
+--- ./hotspot/src/share/vm/adlc/forms.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/adlc/forms.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -68,6 +68,8 @@
+ class InsEncode;
+ class RegDef;
+ class RegClass;
++class CodeSnippetRegClass;
++class ConditionalRegClass;
+ class AllocClass;
+ class ResourceForm;
+ class PipeClassForm;
+--- ./hotspot/src/share/vm/adlc/formsopt.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/adlc/formsopt.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -47,13 +47,19 @@
+ }
+
+ // record a new register class
+-RegClass *RegisterForm::addRegClass(const char *className) {
+- RegClass *regClass = new RegClass(className);
++template <typename T>
++T* RegisterForm::addRegClass(const char* className) {
++ T* regClass = new T(className);
+ _rclasses.addName(className);
+- _regClass.Insert(className,regClass);
++ _regClass.Insert(className, regClass);
+ return regClass;
+ }
+
++// Explicit instantiation for all supported register classes.
++template RegClass* RegisterForm::addRegClass<RegClass>(const char* className);
++template CodeSnippetRegClass* RegisterForm::addRegClass<CodeSnippetRegClass>(const char* className);
++template ConditionalRegClass* RegisterForm::addRegClass<ConditionalRegClass>(const char* className);
++
+ // record a new register class
+ AllocClass *RegisterForm::addAllocClass(char *className) {
+ AllocClass *allocClass = new AllocClass(className);
+@@ -67,9 +73,9 @@
+ void RegisterForm::addSpillRegClass() {
+ // Stack slots start at the next available even register number.
+ _reg_ctr = (_reg_ctr+7) & ~7;
+- const char *rc_name = "stack_slots";
+- RegClass *reg_class = new RegClass(rc_name);
+- reg_class->_stack_or_reg = true;
++ const char *rc_name = "stack_slots";
++ RegClass* reg_class = new RegClass(rc_name);
++ reg_class->set_stack_version(true);
+ _rclasses.addName(rc_name);
+ _regClass.Insert(rc_name,reg_class);
+ }
+@@ -224,9 +230,11 @@
+
+ //------------------------------RegClass---------------------------------------
+ // Construct a register class into which registers will be inserted
+-RegClass::RegClass(const char *classid) : _stack_or_reg(false), _classid(classid), _regDef(cmpstr,hashstr, Form::arena),
+- _user_defined(NULL)
+-{
++RegClass::RegClass(const char* classid) : _stack_or_reg(false), _classid(classid), _regDef(cmpstr, hashstr, Form::arena) {
++}
++
++RegClass::~RegClass() {
++ delete _classid;
+ }
+
+ // record a register in this class
+@@ -305,6 +313,91 @@
+ fprintf(fp,"--- done with entries for reg_class %s\n\n",_classid);
+ }
+
++void RegClass::declare_register_masks(FILE* fp) {
++ const char* prefix = "";
++ const char* rc_name_to_upper = toUpper(_classid);
++ fprintf(fp, "extern const RegMask _%s%s_mask;\n", prefix, rc_name_to_upper);
++ fprintf(fp, "inline const RegMask &%s%s_mask() { return _%s%s_mask; }\n", prefix, rc_name_to_upper, prefix, rc_name_to_upper);
++ if (_stack_or_reg) {
++ fprintf(fp, "extern const RegMask _%sSTACK_OR_%s_mask;\n", prefix, rc_name_to_upper);
++ fprintf(fp, "inline const RegMask &%sSTACK_OR_%s_mask() { return _%sSTACK_OR_%s_mask; }\n", prefix, rc_name_to_upper, prefix, rc_name_to_upper);
++ }
++ delete[] rc_name_to_upper;
++}
++
++void RegClass::build_register_masks(FILE* fp) {
++ int len = RegisterForm::RegMask_Size();
++ const char *prefix = "";
++ const char* rc_name_to_upper = toUpper(_classid);
++ fprintf(fp, "const RegMask _%s%s_mask(", prefix, rc_name_to_upper);
++
++ int i;
++ for(i = 0; i < len - 1; i++) {
++ fprintf(fp," 0x%x,", regs_in_word(i, false));
++ }
++ fprintf(fp," 0x%x );\n", regs_in_word(i, false));
++
++ if (_stack_or_reg) {
++ fprintf(fp, "const RegMask _%sSTACK_OR_%s_mask(", prefix, rc_name_to_upper);
++ for(i = 0; i < len - 1; i++) {
++ fprintf(fp," 0x%x,", regs_in_word(i, true));
++ }
++ fprintf(fp," 0x%x );\n", regs_in_word(i, true));
++ }
++ delete[] rc_name_to_upper;
++}
++
++//------------------------------CodeSnippetRegClass---------------------------
++CodeSnippetRegClass::CodeSnippetRegClass(const char* classid) : RegClass(classid), _code_snippet(NULL) {
++}
++
++CodeSnippetRegClass::~CodeSnippetRegClass() {
++ delete _code_snippet;
++}
++
++void CodeSnippetRegClass::declare_register_masks(FILE* fp) {
++ const char* prefix = "";
++ const char* rc_name_to_upper = toUpper(_classid);
++ fprintf(fp, "inline const RegMask &%s%s_mask() { %s }\n", prefix, rc_name_to_upper, _code_snippet);
++ delete[] rc_name_to_upper;
++}
++
++//------------------------------ConditionalRegClass---------------------------
++ConditionalRegClass::ConditionalRegClass(const char *classid) : RegClass(classid), _condition_code(NULL) {
++}
++
++ConditionalRegClass::~ConditionalRegClass() {
++ delete _condition_code;
++}
++
++void ConditionalRegClass::declare_register_masks(FILE* fp) {
++ const char* prefix = "";
++ const char* rc_name_to_upper = toUpper(_classid);
++ const char* rclass_0_to_upper = toUpper(_rclasses[0]->_classid);
++ const char* rclass_1_to_upper = toUpper(_rclasses[1]->_classid);
++ fprintf(fp, "inline const RegMask &%s%s_mask() {"
++ " return (%s) ?"
++ " %s%s_mask() :"
++ " %s%s_mask(); }\n",
++ prefix, rc_name_to_upper,
++ _condition_code,
++ prefix, rclass_0_to_upper,
++ prefix, rclass_1_to_upper);
++ if (_stack_or_reg) {
++ fprintf(fp, "inline const RegMask &%sSTACK_OR_%s_mask() {"
++ " return (%s) ?"
++ " %sSTACK_OR_%s_mask() :"
++ " %sSTACK_OR_%s_mask(); }\n",
++ prefix, rc_name_to_upper,
++ _condition_code,
++ prefix, rclass_0_to_upper,
++ prefix, rclass_1_to_upper);
++ }
++ delete[] rc_name_to_upper;
++ delete[] rclass_0_to_upper;
++ delete[] rclass_1_to_upper;
++ return;
++}
+
+ //------------------------------AllocClass-------------------------------------
+ AllocClass::AllocClass(char *classid) : _classid(classid), _regDef(cmpstr,hashstr, Form::arena) {
+--- ./hotspot/src/share/vm/adlc/formsopt.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/adlc/formsopt.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -60,6 +60,8 @@
+ class InsEncode;
+ class RegDef;
+ class RegClass;
++class CodeSnippetRegClass;
++class ConditionalRegClass;
+ class AllocClass;
+ class ResourceForm;
+ class PipeClassForm;
+@@ -98,7 +100,8 @@
+
+ void addRegDef(char *regName, char *callingConv, char *c_conv,
+ char * idealtype, char *encoding, char* concreteName);
+- RegClass *addRegClass(const char *className);
++ template<typename T> T* addRegClass(const char* className);
++
+ AllocClass *addAllocClass(char *allocName);
+ void addSpillRegClass();
+
+@@ -154,17 +157,28 @@
+ };
+
+ //------------------------------RegClass---------------------------------------
++// Generic register class. This register class is the internal representation
++// for the following .ad file format:
++//
++// reg_class ptr(RAX, RBX, ...);
++//
++// where ptr is the name of the register class, RAX and RBX are registers.
++//
++// This register class allows registers to be spilled onto the stack. Spilling
++// is allowed is field _stack_or_reg is true.
+ class RegClass : public Form {
+ public:
+ // Public Data
+ const char *_classid; // Name of class
+ NameList _regDefs; // List of registers in class
+ Dict _regDef; // Dictionary of registers in class
++protected:
+ bool _stack_or_reg; // Allowed on any stack slot
+- char* _user_defined;
+
++public:
+ // Public Methods
+ RegClass(const char *classid);// Constructor
++ virtual ~RegClass();
+
+ void addReg(RegDef *regDef); // Add a register to this class
+
+@@ -183,6 +197,115 @@
+
+ void dump(); // Debug printer
+ void output(FILE *fp); // Write info to output files
++
++ virtual bool has_stack_version() {
++ return _stack_or_reg;
++ }
++ virtual void set_stack_version(bool flag) {
++ _stack_or_reg = flag;
++ }
++
++ virtual void declare_register_masks(FILE* fp);
++ virtual void build_register_masks(FILE* fp);
++};
++
++//------------------------------CodeSnippetRegClass----------------------------
++// Register class that has an user-defined C++ code snippet attached to it
++// to determine at runtime which register class to use. This register class is
++// the internal representation for the following .ad file format:
++//
++// reg_class actual_dflt_reg %{
++// if (VM_Version::has_vfp3_32()) {
++// return DFLT_REG_mask();
++// } else {
++// return DFLT_LOW_REG_mask();
++// }
++// %}
++//
++// where DFLT_REG_mask() and DFLT_LOW_REG_mask() are the internal names of the
++// masks of register classes dflt_reg and dflt_low_reg.
++//
++// The attached code snippet can select also between more than two register classes.
++// This register class can be, however, used only if the register class is not
++// cisc-spillable (i.e., the registers of this class are not allowed on the stack,
++// which is equivalent with _stack_or_reg being false).
++class CodeSnippetRegClass : public RegClass {
++protected:
++ char* _code_snippet;
++public:
++ CodeSnippetRegClass(const char* classid);// Constructor
++ ~CodeSnippetRegClass();
++
++ void set_code_snippet(char* code) {
++ _code_snippet = code;
++ }
++ char* code_snippet() {
++ return _code_snippet;
++ }
++ void set_stack_version(bool flag) {
++ assert(false, "User defined register classes are not allowed to spill to the stack.");
++ }
++ void declare_register_masks(FILE* fp);
++ void build_register_masks(FILE* fp) {
++ // We do not need to generate register masks because we select at runtime
++ // between register masks generated for other register classes.
++ return;
++ }
++};
++
++//------------------------------ConditionalRegClass----------------------------
++// Register class that has two register classes and a runtime condition attached
++// to it. The condition is evaluated at runtime and either one of the register
++// attached register classes is selected. This register class is the internal
++// representation for the following .ad format:
++//
++// reg_class_dynamic actual_dflt_reg(dflt_reg, low_reg,
++// %{ VM_Version::has_vfp3_32() }%
++// );
++//
++// This example is equivalent to the example used with the CodeSnippetRegClass
++// register class. A ConditionalRegClass works also if a register class is cisc-spillable
++// (i.e., _stack_or_reg is true), but if can select only between two register classes.
++class ConditionalRegClass : public RegClass {
++protected:
++ // reference to condition code
++ char* _condition_code; // C++ condition code to dynamically determine which register class to use.
++
++ // Example syntax (equivalent to previous example):
++ //
++ // reg_class actual_dflt_reg(dflt_reg, low_reg,
++ // %{ VM_Version::has_vfp3_32() }%
++ // );
++ // reference to conditional register classes
++ RegClass* _rclasses[2]; // 0 is the register class selected if the condition code returns true
++ // 1 is the register class selected if the condition code returns false
++public:
++ ConditionalRegClass(const char* classid);// Constructor
++ ~ConditionalRegClass();
++
++ virtual void set_stack_version(bool flag) {
++ RegClass::set_stack_version(flag);
++ assert((_rclasses[0] != NULL), "Register class NULL for condition code == true");
++ assert((_rclasses[1] != NULL), "Register class NULL for condition code == false");
++ _rclasses[0]->set_stack_version(flag);
++ _rclasses[1]->set_stack_version(flag);
++ }
++ void declare_register_masks(FILE* fp);
++ void build_register_masks(FILE* fp) {
++ // We do not need to generate register masks because we select at runtime
++ // between register masks generated for other register classes.
++ return;
++ }
++ void set_rclass_at_index(int index, RegClass* rclass) {
++ assert((0 <= index && index < 2), "Condition code can select only between two register classes");
++ _rclasses[index] = rclass;
++ }
++ void set_condition_code(char* code) {
++ _condition_code = code;
++ }
++ char* condition_code() {
++ return _condition_code;
++ }
+ };
+
+ //------------------------------AllocClass-------------------------------------
+--- ./hotspot/src/share/vm/adlc/formssel.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/adlc/formssel.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -59,6 +59,8 @@
+ class InsEncode;
+ class RegDef;
+ class RegClass;
++class CodeSnippetRegClass;
++class ConditionalRegClass;
+ class AllocClass;
+ class ResourceForm;
+ class PipeDesc;
+--- ./hotspot/src/share/vm/adlc/output_c.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/adlc/output_c.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -155,26 +155,9 @@
+ fprintf(fp_hpp,"// Register masks, one for each register class.\n");
+ _register->_rclasses.reset();
+ for (rc_name = NULL; (rc_name = _register->_rclasses.iter()) != NULL;) {
+- const char *prefix = "";
+ RegClass *reg_class = _register->getRegClass(rc_name);
+ assert(reg_class, "Using an undefined register class");
+-
+- const char* rc_name_to_upper = toUpper(rc_name);
+-
+- if (reg_class->_user_defined == NULL) {
+- fprintf(fp_hpp, "extern const RegMask _%s%s_mask;\n", prefix, rc_name_to_upper);
+- fprintf(fp_hpp, "inline const RegMask &%s%s_mask() { return _%s%s_mask; }\n", prefix, rc_name_to_upper, prefix, rc_name_to_upper);
+- } else {
+- fprintf(fp_hpp, "inline const RegMask &%s%s_mask() { %s }\n", prefix, rc_name_to_upper, reg_class->_user_defined);
+- }
+-
+- if (reg_class->_stack_or_reg) {
+- assert(reg_class->_user_defined == NULL, "no user defined reg class here");
+- fprintf(fp_hpp, "extern const RegMask _%sSTACK_OR_%s_mask;\n", prefix, rc_name_to_upper);
+- fprintf(fp_hpp, "inline const RegMask &%sSTACK_OR_%s_mask() { return _%sSTACK_OR_%s_mask; }\n", prefix, rc_name_to_upper, prefix, rc_name_to_upper);
+- }
+- delete[] rc_name_to_upper;
+-
++ reg_class->declare_register_masks(fp_hpp);
+ }
+ }
+ }
+@@ -190,35 +173,9 @@
+ fprintf(fp_cpp,"// Register masks, one for each register class.\n");
+ _register->_rclasses.reset();
+ for (rc_name = NULL; (rc_name = _register->_rclasses.iter()) != NULL;) {
+- const char *prefix = "";
+ RegClass *reg_class = _register->getRegClass(rc_name);
+ assert(reg_class, "Using an undefined register class");
+-
+- if (reg_class->_user_defined != NULL) {
+- continue;
+- }
+-
+- int len = RegisterForm::RegMask_Size();
+- const char* rc_name_to_upper = toUpper(rc_name);
+- fprintf(fp_cpp, "const RegMask _%s%s_mask(", prefix, rc_name_to_upper);
+-
+- {
+- int i;
+- for(i = 0; i < len - 1; i++) {
+- fprintf(fp_cpp," 0x%x,", reg_class->regs_in_word(i, false));
+- }
+- fprintf(fp_cpp," 0x%x );\n", reg_class->regs_in_word(i, false));
+- }
+-
+- if (reg_class->_stack_or_reg) {
+- int i;
+- fprintf(fp_cpp, "const RegMask _%sSTACK_OR_%s_mask(", prefix, rc_name_to_upper);
+- for(i = 0; i < len - 1; i++) {
+- fprintf(fp_cpp," 0x%x,",reg_class->regs_in_word(i, true));
+- }
+- fprintf(fp_cpp," 0x%x );\n",reg_class->regs_in_word(i, true));
+- }
+- delete[] rc_name_to_upper;
++ reg_class->build_register_masks(fp_cpp);
+ }
+ }
+ }
+--- ./hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -4064,7 +4064,7 @@
+ ValueType* type = apop()->type();
+ if (type->is_constant()) {
+ ciMethod* target = type->as_ObjectType()->constant_value()->as_member_name()->get_vmtarget();
+- // If the target is another method handle invoke try recursivly to get
++ // If the target is another method handle invoke, try to recursively get
+ // a better target.
+ if (target->is_method_handle_intrinsic()) {
+ if (try_method_handle_inline(target)) {
+--- ./hotspot/src/share/vm/c1/c1_LIR.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/c1/c1_LIR.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -142,16 +142,11 @@
+
+
+ #ifndef PRODUCT
+-void LIR_Address::verify() const {
++void LIR_Address::verify0() const {
+ #if defined(SPARC) || defined(PPC)
+ assert(scale() == times_1, "Scaled addressing mode not available on SPARC/PPC and should not be used");
+ assert(disp() == 0 || index()->is_illegal(), "can't have both");
+ #endif
+-#ifdef ARM
+- assert(disp() == 0 || index()->is_illegal(), "can't have both");
+- // Note: offsets higher than 4096 must not be rejected here. They can
+- // be handled by the back-end or will be rejected if not.
+-#endif
+ #ifdef _LP64
+ assert(base()->is_cpu_register(), "wrong base operand");
+ assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
+@@ -459,7 +454,7 @@
+ //-------------------visits--------------------------
+
+ // complete rework of LIR instruction visitor.
+-// The virtual calls for each instruction type is replaced by a big
++// The virtual call for each instruction type is replaced by a big
+ // switch that adds the operands for each instruction
+
+ void LIR_OpVisitState::visit(LIR_Op* op) {
+@@ -828,7 +823,8 @@
+ }
+
+ if (opJavaCall->_info) do_info(opJavaCall->_info);
+- if (opJavaCall->is_method_handle_invoke()) {
++ if (FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr &&
++ opJavaCall->is_method_handle_invoke()) {
+ opJavaCall->_method_handle_invoke_SP_save_opr = FrameMap::method_handle_invoke_SP_save_opr();
+ do_temp(opJavaCall->_method_handle_invoke_SP_save_opr);
+ }
+--- ./hotspot/src/share/vm/c1/c1_LIR.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/c1/c1_LIR.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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,6 +25,7 @@
+ #ifndef SHARE_VM_C1_C1_LIR_HPP
+ #define SHARE_VM_C1_C1_LIR_HPP
+
++#include "c1/c1_Defs.hpp"
+ #include "c1/c1_ValueType.hpp"
+ #include "oops/method.hpp"
+
+@@ -561,7 +562,13 @@
+ virtual BasicType type() const { return _type; }
+ virtual void print_value_on(outputStream* out) const PRODUCT_RETURN;
+
+- void verify() const PRODUCT_RETURN;
++ void verify0() const PRODUCT_RETURN;
++#if defined(LIR_ADDRESS_PD_VERIFY) && !defined(PRODUCT)
++ void pd_verify() const;
++ void verify() const { pd_verify(); }
++#else
++ void verify() const { verify0(); }
++#endif
+
+ static Scale scale(BasicType type);
+ };
+@@ -610,19 +617,15 @@
+ LIR_OprDesc::float_type |
+ LIR_OprDesc::fpu_register |
+ LIR_OprDesc::single_size); }
+-#if defined(ARM)
+- static LIR_Opr double_fpu(int reg1, int reg2) { return (LIR_Opr)((reg1 << LIR_OprDesc::reg1_shift) | (reg2 << LIR_OprDesc::reg2_shift) | LIR_OprDesc::double_type | LIR_OprDesc::fpu_register | LIR_OprDesc::double_size); }
+- static LIR_Opr single_softfp(int reg) { return (LIR_Opr)((reg << LIR_OprDesc::reg1_shift) | LIR_OprDesc::float_type | LIR_OprDesc::cpu_register | LIR_OprDesc::single_size); }
+- static LIR_Opr double_softfp(int reg1, int reg2) { return (LIR_Opr)((reg1 << LIR_OprDesc::reg1_shift) | (reg2 << LIR_OprDesc::reg2_shift) | LIR_OprDesc::double_type | LIR_OprDesc::cpu_register | LIR_OprDesc::double_size); }
+-#endif
+-#ifdef SPARC
++#if defined(C1_LIR_MD_HPP)
++# include C1_LIR_MD_HPP
++#elif defined(SPARC)
+ static LIR_Opr double_fpu(int reg1, int reg2) { return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
+ (reg2 << LIR_OprDesc::reg2_shift) |
+ LIR_OprDesc::double_type |
+ LIR_OprDesc::fpu_register |
+ LIR_OprDesc::double_size); }
+-#endif
+-#ifdef X86
++#elif defined(X86)
+ static LIR_Opr double_fpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) |
+ (reg << LIR_OprDesc::reg2_shift) |
+ LIR_OprDesc::double_type |
+@@ -640,8 +643,7 @@
+ LIR_OprDesc::fpu_register |
+ LIR_OprDesc::double_size |
+ LIR_OprDesc::is_xmm_mask); }
+-#endif // X86
+-#ifdef PPC
++#elif defined(PPC)
+ static LIR_Opr double_fpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) |
+ (reg << LIR_OprDesc::reg2_shift) |
+ LIR_OprDesc::double_type |
+@@ -1214,10 +1216,8 @@
+ // JSR 292 support.
+ bool is_invokedynamic() const { return code() == lir_dynamic_call; }
+ bool is_method_handle_invoke() const {
+- return
+- method()->is_compiled_lambda_form() // Java-generated adapter
+- ||
+- method()->is_method_handle_intrinsic(); // JVM-generated MH intrinsic
++ return method()->is_compiled_lambda_form() || // Java-generated lambda form
++ method()->is_method_handle_intrinsic(); // JVM-generated MH intrinsic
+ }
+
+ intptr_t vtable_offset() const {
+--- ./hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -23,6 +23,7 @@
+ */
+
+ #include "precompiled.hpp"
++#include "c1/c1_Defs.hpp"
+ #include "c1/c1_Compilation.hpp"
+ #include "c1/c1_FrameMap.hpp"
+ #include "c1/c1_Instruction.hpp"
+@@ -46,10 +47,7 @@
+ #define __ gen()->lir()->
+ #endif
+
+-// TODO: ARM - Use some recognizable constant which still fits architectural constraints
+-#ifdef ARM
+-#define PATCHED_ADDR (204)
+-#else
++#ifndef PATCHED_ADDR
+ #define PATCHED_ADDR (max_jint)
+ #endif
+
+@@ -1599,25 +1597,9 @@
+ }
+ assert(addr->is_register(), "must be a register at this point");
+
+-#ifdef ARM
+- // TODO: ARM - move to platform-dependent code
+- LIR_Opr tmp = FrameMap::R14_opr;
+- if (VM_Version::supports_movw()) {
+- __ move((LIR_Opr)card_table_base, tmp);
+- } else {
+- __ move(new LIR_Address(FrameMap::Rthread_opr, in_bytes(JavaThread::card_table_base_offset()), T_ADDRESS), tmp);
+- }
+-
+- CardTableModRefBS* ct = (CardTableModRefBS*)_bs;
+- LIR_Address *card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTableModRefBS::card_shift, 0, T_BYTE);
+- if(((int)ct->byte_map_base & 0xff) == 0) {
+- __ move(tmp, card_addr);
+- } else {
+- LIR_Opr tmp_zero = new_register(T_INT);
+- __ move(LIR_OprFact::intConst(0), tmp_zero);
+- __ move(tmp_zero, card_addr);
+- }
+-#else // ARM
++#ifdef CARDTABLEMODREF_POST_BARRIER_HELPER
++ CardTableModRef_post_barrier_helper(addr, card_table_base);
++#else
+ LIR_Opr tmp = new_pointer_register();
+ if (TwoOperandLIRForm) {
+ __ move(addr, tmp);
+@@ -1633,7 +1615,7 @@
+ new LIR_Address(tmp, load_constant(card_table_base),
+ T_BYTE));
+ }
+-#endif // ARM
++#endif
+ }
+
+
+@@ -2121,7 +2103,7 @@
+ } else {
+ #ifdef X86
+ addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type);
+-#elif defined(ARM)
++#elif defined(GENERATE_ADDRESS_IS_PREFERRED)
+ addr = generate_address(base_op, index_op, log2_scale, 0, dst_type);
+ #else
+ if (index_op->is_illegal() || log2_scale == 0) {
+@@ -2175,6 +2157,9 @@
+ LIR_Opr base_op = base.result();
+ LIR_Opr index_op = idx.result();
+
++#ifdef GENERATE_ADDRESS_IS_PREFERRED
++ LIR_Address* addr = generate_address(base_op, index_op, log2_scale, 0, x->basic_type());
++#else
+ #ifndef _LP64
+ if (base_op->type() == T_LONG) {
+ base_op = new_register(T_INT);
+@@ -2204,18 +2189,11 @@
+ if (log2_scale != 0) {
+ // temporary fix (platform dependent code without shift on Intel would be better)
+ // TODO: ARM also allows embedded shift in the address
+- LIR_Opr tmp = new_pointer_register();
+- if (TwoOperandLIRForm) {
+- __ move(index_op, tmp);
+- index_op = tmp;
+- }
+- __ shift_left(index_op, log2_scale, tmp);
+- if (!TwoOperandLIRForm) {
+- index_op = tmp;
+- }
++ __ shift_left(index_op, log2_scale, index_op);
+ }
+
+ LIR_Address* addr = new LIR_Address(base_op, index_op, x->basic_type());
++#endif // !GENERATE_ADDRESS_IS_PREFERRED
+ __ move(value.result(), addr);
+ }
+
+@@ -2569,7 +2547,7 @@
+ // need to free up storage used for OSR entry point
+ LIR_Opr osrBuffer = block()->next()->operand();
+ BasicTypeList signature;
+- signature.append(T_INT);
++ signature.append(NOT_LP64(T_INT) LP64_ONLY(T_LONG)); // pass a pointer to osrBuffer
+ CallingConvention* cc = frame_map()->c_calling_convention(&signature);
+ __ move(osrBuffer, cc->args()->at(0));
+ __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::OSR_migration_end),
+@@ -2909,7 +2887,7 @@
+ // g) lock result registers and emit call operation
+ //
+ // Before issuing a call, we must spill-save all values on stack
+-// that are in caller-save register. "spill-save" moves thos registers
++// that are in caller-save register. "spill-save" moves those registers
+ // either in a free callee-save register or spills them if no free
+ // callee save register is available.
+ //
+@@ -2917,7 +2895,7 @@
+ // - if invoked between e) and f), we may lock callee save
+ // register in "spill-save" that destroys the receiver register
+ // before f) is executed
+-// - if we rearange the f) to be earlier, by loading %o0, it
++// - if we rearrange f) to be earlier (by loading %o0) it
+ // may destroy a value on the stack that is currently in %o0
+ // and is waiting to be spilled
+ // - if we keep the receiver locked while doing spill-save,
+@@ -2950,14 +2928,16 @@
+ assert(receiver->is_illegal() || receiver->is_equal(LIR_Assembler::receiverOpr()), "must match");
+
+ // JSR 292
+- // Preserve the SP over MethodHandle call sites.
++ // Preserve the SP over MethodHandle call sites, if needed.
+ ciMethod* target = x->target();
+ bool is_method_handle_invoke = (// %%% FIXME: Are both of these relevant?
+ target->is_method_handle_intrinsic() ||
+ target->is_compiled_lambda_form());
+ if (is_method_handle_invoke) {
+ info->set_is_method_handle_invoke(true);
+- __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr());
++ if(FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr) {
++ __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr());
++ }
+ }
+
+ switch (x->code()) {
+@@ -2997,8 +2977,9 @@
+ }
+
+ // JSR 292
+- // Restore the SP after MethodHandle call sites.
+- if (is_method_handle_invoke) {
++ // Restore the SP after MethodHandle call sites, if needed.
++ if (is_method_handle_invoke
++ && FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr) {
+ __ move(FrameMap::method_handle_invoke_SP_save_opr(), FrameMap::stack_pointer());
+ }
+
+--- ./hotspot/src/share/vm/c1/c1_LIRGenerator.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/c1/c1_LIRGenerator.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -277,6 +277,9 @@
+
+ void G1SATBCardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
+ void CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
++#ifdef CARDTABLEMODREF_POST_BARRIER_HELPER
++ void CardTableModRef_post_barrier_helper(LIR_OprDesc* addr, LIR_Const* card_table_base);
++#endif
+
+
+ static LIR_Opr result_register_for(ValueType* type, bool callee = false);
+@@ -550,6 +553,10 @@
+ #ifdef ASSERT
+ virtual void do_Assert (Assert* x);
+ #endif
++
++#ifdef C1_LIRGENERATOR_MD_HPP
++#include C1_LIRGENERATOR_MD_HPP
++#endif
+ };
+
+
+--- ./hotspot/src/share/vm/c1/c1_LinearScan.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/c1/c1_LinearScan.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -2138,7 +2138,7 @@
+ assert(interval->assigned_regHi() >= pd_first_fpu_reg && interval->assigned_regHi() <= pd_last_fpu_reg, "no fpu register");
+ assert(assigned_reg % 2 == 0 && assigned_reg + 1 == interval->assigned_regHi(), "must be sequential and even");
+ LIR_Opr result = LIR_OprFact::double_fpu(interval->assigned_regHi() - pd_first_fpu_reg, assigned_reg - pd_first_fpu_reg);
+-#elif defined(ARM)
++#elif defined(ARM32)
+ assert(assigned_reg >= pd_first_fpu_reg && assigned_reg <= pd_last_fpu_reg, "no fpu register");
+ assert(interval->assigned_regHi() >= pd_first_fpu_reg && interval->assigned_regHi() <= pd_last_fpu_reg, "no fpu register");
+ assert(assigned_reg % 2 == 0 && assigned_reg + 1 == interval->assigned_regHi(), "must be sequential and even");
+@@ -2727,7 +2727,7 @@
+ #ifdef SPARC
+ assert(opr->fpu_regnrLo() == opr->fpu_regnrHi() + 1, "assumed in calculation (only fpu_regnrHi is used)");
+ #endif
+-#ifdef ARM
++#ifdef ARM32
+ assert(opr->fpu_regnrHi() == opr->fpu_regnrLo() + 1, "assumed in calculation (only fpu_regnrLo is used)");
+ #endif
+ #ifdef PPC
+--- ./hotspot/src/share/vm/c1/c1_Runtime1.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/c1/c1_Runtime1.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -1085,7 +1085,7 @@
+ #ifdef ARM
+ if((load_klass_or_mirror_patch_id ||
+ stub_id == Runtime1::load_appendix_patching_id) &&
+- !VM_Version::supports_movw()) {
++ nativeMovConstReg_at(copy_buff)->is_pc_relative()) {
+ nmethod* nm = CodeCache::find_nmethod(instr_pc);
+ address addr = NULL;
+ assert(nm != NULL, "invalid nmethod_pc");
+--- ./hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -42,7 +42,7 @@
+ #define TRACE_BCEA(level, code)
+ #endif
+
+-// Maintain a map of which aguments a local variable or
++// Maintain a map of which arguments a local variable or
+ // stack slot may contain. In addition to tracking
+ // arguments, it tracks two special values, "allocated"
+ // which represents any object allocated in the current
+@@ -318,14 +318,16 @@
+ bool must_record_dependencies = false;
+ for (i = arg_size - 1; i >= 0; i--) {
+ ArgumentMap arg = state.raw_pop();
+- if (!is_argument(arg))
++ // Check if callee arg is a caller arg or an allocated object
++ bool allocated = arg.contains_allocated();
++ if (!(is_argument(arg) || allocated))
+ continue;
+ for (int j = 0; j < _arg_size; j++) {
+ if (arg.contains(j)) {
+ _arg_modified[j] |= analyzer._arg_modified[i];
+ }
+ }
+- if (!is_arg_stack(arg)) {
++ if (!(is_arg_stack(arg) || allocated)) {
+ // arguments have already been recognized as escaping
+ } else if (analyzer.is_arg_stack(i) && !analyzer.is_arg_returned(i)) {
+ set_method_escape(arg);
+--- ./hotspot/src/share/vm/ci/ciMethod.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/ci/ciMethod.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -689,7 +689,8 @@
+ // via assert_unique_concrete_method or assert_leaf_type.
+ ciMethod* ciMethod::find_monomorphic_target(ciInstanceKlass* caller,
+ ciInstanceKlass* callee_holder,
+- ciInstanceKlass* actual_recv) {
++ ciInstanceKlass* actual_recv,
++ bool check_access) {
+ check_is_loaded();
+
+ if (actual_recv->is_interface()) {
+@@ -697,7 +698,7 @@
+ return NULL;
+ }
+
+- ciMethod* root_m = resolve_invoke(caller, actual_recv);
++ ciMethod* root_m = resolve_invoke(caller, actual_recv, check_access);
+ if (root_m == NULL) {
+ // Something went wrong looking up the actual receiver method.
+ return NULL;
+@@ -776,7 +777,7 @@
+ //
+ // Given a known receiver klass, find the target for the call.
+ // Return NULL if the call has no target or the target is abstract.
+-ciMethod* ciMethod::resolve_invoke(ciKlass* caller, ciKlass* exact_receiver) {
++ciMethod* ciMethod::resolve_invoke(ciKlass* caller, ciKlass* exact_receiver, bool check_access) {
+ check_is_loaded();
+ VM_ENTRY_MARK;
+
+@@ -793,9 +794,9 @@
+ ||
+ InstanceKlass::cast(h_recv())->is_linked() && !exact_receiver->is_interface()) {
+ if (holder()->is_interface()) {
+- m = LinkResolver::resolve_interface_call_or_null(h_recv, h_resolved, h_name, h_signature, caller_klass);
++ m = LinkResolver::resolve_interface_call_or_null(h_recv, h_resolved, h_name, h_signature, caller_klass, check_access);
+ } else {
+- m = LinkResolver::resolve_virtual_call_or_null(h_recv, h_resolved, h_name, h_signature, caller_klass);
++ m = LinkResolver::resolve_virtual_call_or_null(h_recv, h_resolved, h_name, h_signature, caller_klass, check_access);
+ }
+ }
+
+--- ./hotspot/src/share/vm/ci/ciMethod.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/ci/ciMethod.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -172,9 +172,9 @@
+ // Code size for inlining decisions.
+ int code_size_for_inlining();
+
+- bool caller_sensitive() { return get_Method()->caller_sensitive(); }
+- bool force_inline() { return get_Method()->force_inline(); }
+- bool dont_inline() { return get_Method()->dont_inline(); }
++ bool caller_sensitive() const { return get_Method()->caller_sensitive(); }
++ bool force_inline() const { return get_Method()->force_inline(); }
++ bool dont_inline() const { return get_Method()->dont_inline(); }
+
+ int comp_level();
+ int highest_osr_comp_level();
+@@ -248,11 +248,12 @@
+ // its calling environment.
+ ciMethod* find_monomorphic_target(ciInstanceKlass* caller,
+ ciInstanceKlass* callee_holder,
+- ciInstanceKlass* actual_receiver);
++ ciInstanceKlass* actual_receiver,
++ bool check_access = true);
+
+ // Given a known receiver klass, find the target for the call.
+ // Return NULL if the call has no target or is abstract.
+- ciMethod* resolve_invoke(ciKlass* caller, ciKlass* exact_receiver);
++ ciMethod* resolve_invoke(ciKlass* caller, ciKlass* exact_receiver, bool check_access = true);
+
+ // Find the proper vtable index to invoke this method.
+ int resolve_vtable_index(ciKlass* caller, ciKlass* receiver);
+--- ./hotspot/src/share/vm/ci/ciTypeFlow.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/ci/ciTypeFlow.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -36,6 +36,7 @@
+ #include "interpreter/bytecodes.hpp"
+ #include "memory/allocation.inline.hpp"
+ #include "opto/compile.hpp"
++#include "opto/node.hpp"
+ #include "runtime/deoptimization.hpp"
+ #include "utilities/growableArray.hpp"
+
+--- ./hotspot/src/share/vm/classfile/classFileParser.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/classFileParser.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1783,6 +1783,10 @@
+ if (_location != _in_method) break; // only allow for methods
+ if (!privileged) break; // only allow in privileged code
+ return _method_DontInline;
++ case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_InjectedProfile_signature):
++ if (_location != _in_method) break; // only allow for methods
++ if (!privileged) break; // only allow in privileged code
++ return _method_InjectedProfile;
+ case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_LambdaForm_Compiled_signature):
+ if (_location != _in_method) break; // only allow for methods
+ if (!privileged) break; // only allow in privileged code
+@@ -1824,6 +1828,8 @@
+ m->set_force_inline(true);
+ if (has_annotation(_method_DontInline))
+ m->set_dont_inline(true);
++ if (has_annotation(_method_InjectedProfile))
++ m->set_has_injected_profile(true);
+ if (has_annotation(_method_LambdaForm_Compiled) && m->intrinsic_id() == vmIntrinsics::_none)
+ m->set_intrinsic_id(vmIntrinsics::_compiledLambdaForm);
+ if (has_annotation(_method_LambdaForm_Hidden))
+--- ./hotspot/src/share/vm/classfile/classFileParser.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/classFileParser.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -126,6 +126,7 @@
+ _method_CallerSensitive,
+ _method_ForceInline,
+ _method_DontInline,
++ _method_InjectedProfile,
+ _method_LambdaForm_Compiled,
+ _method_LambdaForm_Hidden,
+ _sun_misc_Contended,
+--- ./hotspot/src/share/vm/classfile/classLoaderData.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/classLoaderData.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -320,27 +320,6 @@
+ }
+ }
+
+-#ifdef ASSERT
+-class AllAliveClosure : public OopClosure {
+- BoolObjectClosure* _is_alive_closure;
+- bool _found_dead;
+- public:
+- AllAliveClosure(BoolObjectClosure* is_alive_closure) : _is_alive_closure(is_alive_closure), _found_dead(false) {}
+- template <typename T> 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 (!_is_alive_closure->do_object_b(obj)) {
+- _found_dead = true;
+- }
+- }
+- }
+- void do_oop(oop* p) { do_oop_work<oop>(p); }
+- void do_oop(narrowOop* p) { do_oop_work<narrowOop>(p); }
+- bool found_dead() { return _found_dead; }
+-};
+-#endif
+-
+ oop ClassLoaderData::keep_alive_object() const {
+ assert(!keep_alive(), "Don't use with CLDs that are artificially kept alive");
+ return is_anonymous() ? _klasses->java_mirror() : class_loader();
+@@ -350,15 +329,6 @@
+ bool alive = keep_alive() // null class loader and incomplete anonymous klasses.
+ || is_alive_closure->do_object_b(keep_alive_object());
+
+-#ifdef ASSERT
+- if (alive) {
+- AllAliveClosure all_alive_closure(is_alive_closure);
+- KlassToOopClosure klass_closure(&all_alive_closure);
+- const_cast<ClassLoaderData*>(this)->oops_do(&all_alive_closure, &klass_closure, false);
+- assert(!all_alive_closure.found_dead(), err_msg("Found dead oop in alive cld: " PTR_FORMAT, p2i(this)));
+- }
+-#endif
+-
+ return alive;
+ }
+
+@@ -912,7 +882,7 @@
+ }
+
+ Klass* ClassLoaderDataGraphKlassIteratorAtomic::next_klass() {
+- Klass* head = (Klass*)_next_klass;
++ Klass* head = _next_klass;
+
+ while (head != NULL) {
+ Klass* next = next_klass_in_cldg(head);
+--- ./hotspot/src/share/vm/classfile/classLoaderData.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/classLoaderData.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -307,7 +307,7 @@
+
+ // An iterator that distributes Klasses to parallel worker threads.
+ class ClassLoaderDataGraphKlassIteratorAtomic : public StackObj {
+- volatile Klass* _next_klass;
++ Klass* volatile _next_klass;
+ public:
+ ClassLoaderDataGraphKlassIteratorAtomic();
+ Klass* next_klass();
+--- ./hotspot/src/share/vm/classfile/defaultMethods.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/defaultMethods.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -1096,6 +1096,7 @@
+ }
+ // update idnum for new location
+ merged_methods->at(i)->set_method_idnum(i);
++ merged_methods->at(i)->set_orig_method_idnum(i);
+ }
+
+ // Verify correct order
+--- ./hotspot/src/share/vm/classfile/javaClasses.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/javaClasses.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -124,7 +124,7 @@
+ 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
+- fatal("Invalid layout of preloaded class");
++ vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class");
+ }
+ dest_offset = fd.offset();
+ }
+@@ -1278,7 +1278,8 @@
+ }
+
+ static inline bool version_matches(Method* method, int version) {
+- return (method->constants()->version() == version && version < MAX_VERSION);
++ assert(version < MAX_VERSION, "version is too big");
++ return method != NULL && (method->constants()->version() == version);
+ }
+
+ static inline int get_line_number(Method* method, int bci) {
+@@ -1308,6 +1309,7 @@
+ typeArrayOop _methods;
+ typeArrayOop _bcis;
+ objArrayOop _mirrors;
++ typeArrayOop _cprefs; // needed to insulate method name against redefinition
+ int _index;
+ No_Safepoint_Verifier _nsv;
+
+@@ -1315,8 +1317,9 @@
+
+ enum {
+ trace_methods_offset = java_lang_Throwable::trace_methods_offset,
+- trace_bcis_offset = java_lang_Throwable::trace_bcis_offset,
++ trace_bcis_offset = java_lang_Throwable::trace_bcis_offset,
+ trace_mirrors_offset = java_lang_Throwable::trace_mirrors_offset,
++ trace_cprefs_offset = java_lang_Throwable::trace_cprefs_offset,
+ trace_next_offset = java_lang_Throwable::trace_next_offset,
+ trace_size = java_lang_Throwable::trace_size,
+ trace_chunk_size = java_lang_Throwable::trace_chunk_size
+@@ -1338,9 +1341,14 @@
+ assert(mirrors != NULL, "mirror array should be initialized in backtrace");
+ return mirrors;
+ }
++ static typeArrayOop get_cprefs(objArrayHandle chunk) {
++ typeArrayOop cprefs = typeArrayOop(chunk->obj_at(trace_cprefs_offset));
++ assert(cprefs != NULL, "cprefs array should be initialized in backtrace");
++ return cprefs;
++ }
+
+ // constructor for new backtrace
+- BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL), _mirrors(NULL) {
++ BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL), _mirrors(NULL), _cprefs(NULL) {
+ expand(CHECK);
+ _backtrace = _head;
+ _index = 0;
+@@ -1350,6 +1358,7 @@
+ _methods = get_methods(backtrace);
+ _bcis = get_bcis(backtrace);
+ _mirrors = get_mirrors(backtrace);
++ _cprefs = get_cprefs(backtrace);
+ assert(_methods->length() == _bcis->length() &&
+ _methods->length() == _mirrors->length(),
+ "method and source information arrays should match");
+@@ -1375,17 +1384,22 @@
+ objArrayOop mirrors = oopFactory::new_objectArray(trace_chunk_size, CHECK);
+ objArrayHandle new_mirrors(THREAD, mirrors);
+
++ typeArrayOop cprefs = oopFactory::new_shortArray(trace_chunk_size, CHECK);
++ typeArrayHandle new_cprefs(THREAD, cprefs);
++
+ if (!old_head.is_null()) {
+ old_head->obj_at_put(trace_next_offset, new_head());
+ }
+ new_head->obj_at_put(trace_methods_offset, new_methods());
+ new_head->obj_at_put(trace_bcis_offset, new_bcis());
+ new_head->obj_at_put(trace_mirrors_offset, new_mirrors());
++ new_head->obj_at_put(trace_cprefs_offset, new_cprefs());
+
+ _head = new_head();
+ _methods = new_methods();
+ _bcis = new_bcis();
+ _mirrors = new_mirrors();
++ _cprefs = new_cprefs();
+ _index = 0;
+ }
+
+@@ -1405,8 +1419,9 @@
+ method = mhandle();
+ }
+
+- _methods->short_at_put(_index, method->method_idnum());
++ _methods->short_at_put(_index, method->orig_method_idnum());
+ _bcis->int_at_put(_index, merge_bci_and_version(bci, method->constants()->version()));
++ _cprefs->short_at_put(_index, method->name_index());
+
+ // We need to save the mirrors in the backtrace to keep the class
+ // from being unloaded while we still have this stack trace.
+@@ -1419,27 +1434,26 @@
+
+ // Print stack trace element to resource allocated buffer
+ char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror,
+- int method_id, int version, int bci) {
++ int method_id, int version, int bci, int cpref) {
+
+ // Get strings and string lengths
+ InstanceKlass* holder = InstanceKlass::cast(java_lang_Class::as_Klass(mirror()));
+ const char* klass_name = holder->external_name();
+ int buf_len = (int)strlen(klass_name);
+
+- // The method id may point to an obsolete method, can't get more stack information
+- Method* method = holder->method_with_idnum(method_id);
+- if (method == NULL) {
+- char* buf = NEW_RESOURCE_ARRAY(char, buf_len + 64);
+- // This is what the java code prints in this case - added Redefined
+- sprintf(buf, "\tat %s.null (Redefined)", klass_name);
+- return buf;
+- }
+-
+- char* method_name = method->name()->as_C_string();
++ Method* method = holder->method_with_orig_idnum(method_id, version);
++
++ // The method can be NULL if the requested class version is gone
++ Symbol* sym = (method != NULL) ? method->name() : holder->constants()->symbol_at(cpref);
++ char* method_name = sym->as_C_string();
+ buf_len += (int)strlen(method_name);
+
++ // Use a specific ik version as a holder since the mirror might
++ // refer to a version that is now obsolete and no longer accessible
++ // via the previous versions list.
++ holder = holder->get_klass_version(version);
+ char* source_file_name = NULL;
+- if (version_matches(method, version)) {
++ if (holder != NULL) {
+ Symbol* source = holder->source_file_name();
+ if (source != NULL) {
+ source_file_name = source->as_C_string();
+@@ -1481,17 +1495,18 @@
+ }
+
+ void java_lang_Throwable::print_stack_element(outputStream *st, Handle mirror,
+- int method_id, int version, int bci) {
++ int method_id, int version, int bci, int cpref) {
+ ResourceMark rm;
+- char* buf = print_stack_element_to_buffer(mirror, method_id, version, bci);
++ char* buf = print_stack_element_to_buffer(mirror, method_id, version, bci, cpref);
+ st->print_cr("%s", buf);
+ }
+
+ void java_lang_Throwable::print_stack_element(outputStream *st, methodHandle method, int bci) {
+ Handle mirror = method->method_holder()->java_mirror();
+- int method_id = method->method_idnum();
++ int method_id = method->orig_method_idnum();
+ int version = method->constants()->version();
+- print_stack_element(st, mirror, method_id, version, bci);
++ int cpref = method->name_index();
++ print_stack_element(st, mirror, method_id, version, bci, cpref);
+ }
+
+ const char* java_lang_Throwable::no_stack_trace_message() {
+@@ -1516,6 +1531,7 @@
+ typeArrayHandle methods (THREAD, BacktraceBuilder::get_methods(result));
+ typeArrayHandle bcis (THREAD, BacktraceBuilder::get_bcis(result));
+ objArrayHandle mirrors (THREAD, BacktraceBuilder::get_mirrors(result));
++ typeArrayHandle cprefs (THREAD, BacktraceBuilder::get_cprefs(result));
+
+ int length = methods()->length();
+ for (int index = 0; index < length; index++) {
+@@ -1525,7 +1541,8 @@
+ int method = methods->short_at(index);
+ int version = version_at(bcis->int_at(index));
+ int bci = bci_at(bcis->int_at(index));
+- print_stack_element(st, mirror, method, version, bci);
++ int cpref = cprefs->short_at(index);
++ print_stack_element(st, mirror, method, version, bci, cpref);
+ }
+ result = objArrayHandle(THREAD, objArrayOop(result->obj_at(trace_next_offset)));
+ }
+@@ -1809,29 +1826,30 @@
+ if (chunk == NULL) {
+ THROW_(vmSymbols::java_lang_IndexOutOfBoundsException(), NULL);
+ }
+- // Get method id, bci, version and mirror from chunk
++ // Get method id, bci, version, mirror and cpref from chunk
+ typeArrayOop methods = BacktraceBuilder::get_methods(chunk);
+ typeArrayOop bcis = BacktraceBuilder::get_bcis(chunk);
+ objArrayOop mirrors = BacktraceBuilder::get_mirrors(chunk);
++ typeArrayOop cprefs = BacktraceBuilder::get_cprefs(chunk);
+
+ assert(methods != NULL && bcis != NULL && mirrors != NULL, "sanity check");
+
+ int method = methods->short_at(chunk_index);
+ int version = version_at(bcis->int_at(chunk_index));
+ int bci = bci_at(bcis->int_at(chunk_index));
++ int cpref = cprefs->short_at(chunk_index);
+ Handle mirror(THREAD, mirrors->obj_at(chunk_index));
+
+ // Chunk can be partial full
+ if (mirror.is_null()) {
+ THROW_(vmSymbols::java_lang_IndexOutOfBoundsException(), NULL);
+ }
+-
+- oop element = java_lang_StackTraceElement::create(mirror, method, version, bci, CHECK_0);
++ oop element = java_lang_StackTraceElement::create(mirror, method, version, bci, cpref, CHECK_0);
+ return element;
+ }
+
+ oop java_lang_StackTraceElement::create(Handle mirror, int method_id,
+- int version, int bci, TRAPS) {
++ int version, int bci, int cpref, TRAPS) {
+ // Allocate java.lang.StackTraceElement instance
+ Klass* k = SystemDictionary::StackTraceElement_klass();
+ assert(k != NULL, "must be loaded in 1.4+");
+@@ -1848,17 +1866,13 @@
+ oop classname = StringTable::intern((char*) str, CHECK_0);
+ java_lang_StackTraceElement::set_declaringClass(element(), classname);
+
+- Method* method = holder->method_with_idnum(method_id);
+- // Method on stack may be obsolete because it was redefined so cannot be
+- // found by idnum.
+- if (method == NULL) {
+- // leave name and fileName null
+- java_lang_StackTraceElement::set_lineNumber(element(), -1);
+- return element();
+- }
++ Method* method = holder->method_with_orig_idnum(method_id, version);
++
++ // The method can be NULL if the requested class version is gone
++ Symbol* sym = (method != NULL) ? method->name() : holder->constants()->symbol_at(cpref);
+
+ // Fill in method name
+- oop methodname = StringTable::intern(method->name(), CHECK_0);
++ oop methodname = StringTable::intern(sym, CHECK_0);
+ java_lang_StackTraceElement::set_methodName(element(), methodname);
+
+ if (!version_matches(method, version)) {
+@@ -1867,6 +1881,11 @@
+ java_lang_StackTraceElement::set_lineNumber(element(), -1);
+ } else {
+ // Fill in source file name and line number.
++ // Use a specific ik version as a holder since the mirror might
++ // refer to a version that is now obsolete and no longer accessible
++ // via the previous versions list.
++ holder = holder->get_klass_version(version);
++ assert(holder != NULL, "sanity check");
+ Symbol* source = holder->source_file_name();
+ if (ShowHiddenFrames && source == NULL)
+ source = vmSymbols::unknown_class_name();
+@@ -1881,8 +1900,9 @@
+
+ oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) {
+ Handle mirror (THREAD, method->method_holder()->java_mirror());
+- int method_id = method->method_idnum();
+- return create(mirror, method_id, method->constants()->version(), bci, THREAD);
++ int method_id = method->orig_method_idnum();
++ int cpref = method->name_index();
++ return create(mirror, method_id, method->constants()->version(), bci, cpref, THREAD);
+ }
+
+ void java_lang_reflect_AccessibleObject::compute_offsets() {
+@@ -2781,33 +2801,6 @@
+ return (flags(mname) & (MN_IS_METHOD | MN_IS_CONSTRUCTOR)) > 0;
+ }
+
+-#if INCLUDE_JVMTI
+-// Can be executed on VM thread only
+-void java_lang_invoke_MemberName::adjust_vmtarget(oop mname, Method* old_method,
+- Method* new_method, bool* trace_name_printed) {
+- assert(is_method(mname), "wrong type");
+- assert(Thread::current()->is_VM_thread(), "not VM thread");
+-
+- Method* target = (Method*)mname->address_field(_vmtarget_offset);
+- if (target == old_method) {
+- mname->address_field_put(_vmtarget_offset, (address)new_method);
+-
+- if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+- if (!(*trace_name_printed)) {
+- // RC_TRACE_MESG macro has an embedded ResourceMark
+- RC_TRACE_MESG(("adjust: name=%s",
+- old_method->method_holder()->external_name()));
+- *trace_name_printed = true;
+- }
+- // RC_TRACE macro has an embedded ResourceMark
+- RC_TRACE(0x00400000, ("MemberName method update: %s(%s)",
+- new_method->name()->as_C_string(),
+- new_method->signature()->as_C_string()));
+- }
+- }
+-}
+-#endif // INCLUDE_JVMTI
+-
+ void java_lang_invoke_MemberName::set_vmtarget(oop mname, Metadata* ref) {
+ assert(is_instance(mname), "wrong type");
+ // check the type of the vmtarget
+@@ -3581,7 +3574,7 @@
+ 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
+- fatal("Invalid layout of preloaded class");
++ vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class");
+ return -1;
+ }
+
+--- ./hotspot/src/share/vm/classfile/javaClasses.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/javaClasses.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -484,8 +484,9 @@
+ trace_methods_offset = 0,
+ trace_bcis_offset = 1,
+ trace_mirrors_offset = 2,
+- trace_next_offset = 3,
+- trace_size = 4,
++ trace_cprefs_offset = 3,
++ trace_next_offset = 4,
++ trace_size = 5,
+ trace_chunk_size = 32
+ };
+
+@@ -496,7 +497,7 @@
+ static int static_unassigned_stacktrace_offset;
+
+ // Printing
+- static char* print_stack_element_to_buffer(Handle mirror, int method, int version, int bci);
++ static char* print_stack_element_to_buffer(Handle mirror, int method, int version, int bci, int cpref);
+ // StackTrace (programmatic access, new since 1.4)
+ static void clear_stacktrace(oop throwable);
+ // No stack trace available
+@@ -517,7 +518,7 @@
+ static oop message(Handle throwable);
+ static void set_message(oop throwable, oop value);
+ static void print_stack_element(outputStream *st, Handle mirror, int method,
+- int version, int bci);
++ int version, int bci, int cpref);
+ static void print_stack_element(outputStream *st, methodHandle method, int bci);
+ static void print_stack_usage(Handle stream);
+
+@@ -1095,10 +1096,6 @@
+
+ static Metadata* vmtarget(oop mname);
+ static void set_vmtarget(oop mname, Metadata* target);
+-#if INCLUDE_JVMTI
+- static void adjust_vmtarget(oop mname, Method* old_method, Method* new_method,
+- bool* trace_name_printed);
+-#endif // INCLUDE_JVMTI
+
+ static intptr_t vmindex(oop mname);
+ static void set_vmindex(oop mname, intptr_t index);
+@@ -1326,7 +1323,7 @@
+ static void set_lineNumber(oop element, int value);
+
+ // Create an instance of StackTraceElement
+- static oop create(Handle mirror, int method, int version, int bci, TRAPS);
++ static oop create(Handle mirror, int method, int version, int bci, int cpref, TRAPS);
+ static oop create(methodHandle method, int bci, TRAPS);
+
+ // Debugging
+--- ./hotspot/src/share/vm/classfile/systemDictionary.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/systemDictionary.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -2349,6 +2349,9 @@
+ assert(!THREAD->is_Compiler_thread(), "");
+ Handle method_type =
+ SystemDictionary::find_method_handle_type(signature, accessing_klass, CHECK_(empty));
++ if (false) { // FIXME: Decide if the Java upcall should resolve signatures.
++ method_type = java_lang_String::create_from_symbol(signature, CHECK_(empty));
++ }
+
+ KlassHandle mh_klass = SystemDictionary::MethodHandle_klass();
+ int ref_kind = JVM_REF_invokeVirtual;
+@@ -2380,24 +2383,6 @@
+ return unpack_method_and_appendix(mname, accessing_klass, appendix_box, appendix_result, THREAD);
+ }
+
+-// Decide if we can globally cache a lookup of this class, to be returned to any client that asks.
+-// We must ensure that all class loaders everywhere will reach this class, for any client.
+-// This is a safe bet for public classes in java.lang, such as Object and String.
+-// We also include public classes in java.lang.invoke, because they appear frequently in system-level method types.
+-// Out of an abundance of caution, we do not include any other classes, not even for packages like java.util.
+-static bool is_always_visible_class(oop mirror) {
+- Klass* klass = java_lang_Class::as_Klass(mirror);
+- if (klass->oop_is_objArray()) {
+- klass = ObjArrayKlass::cast(klass)->bottom_klass(); // check element type
+- }
+- if (klass->oop_is_typeArray()) {
+- return true; // primitive array
+- }
+- assert(klass->oop_is_instance(), klass->external_name());
+- return klass->is_public() &&
+- (InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::Object_klass()) || // java.lang
+- InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::MethodHandle_klass())); // java.lang.invoke
+-}
+
+ // Ask Java code to find or construct a java.lang.invoke.MethodType for the given
+ // signature, as interpreted relative to the given class loader.
+@@ -2420,33 +2405,32 @@
+ }
+
+ Handle class_loader, protection_domain;
+- if (accessing_klass.not_null()) {
+- class_loader = Handle(THREAD, InstanceKlass::cast(accessing_klass())->class_loader());
+- protection_domain = Handle(THREAD, InstanceKlass::cast(accessing_klass())->protection_domain());
+- }
+- bool can_be_cached = true;
++ bool is_on_bcp = true; // keep this true as long as we can materialize from the boot classloader
+ int npts = ArgumentCount(signature).size();
+ objArrayHandle pts = oopFactory::new_objArray(SystemDictionary::Class_klass(), npts, CHECK_(empty));
+ int arg = 0;
+- Handle rt; // the return type from the signature
++ Handle rt; // the return type from the signature
+ ResourceMark rm(THREAD);
+ for (SignatureStream ss(signature); !ss.is_done(); ss.next()) {
+ oop mirror = NULL;
+- if (can_be_cached) {
+- // Use neutral class loader to lookup candidate classes to be placed in the cache.
+- mirror = ss.as_java_mirror(Handle(), Handle(),
++ if (is_on_bcp) {
++ // Note: class_loader & protection_domain are both null at this point.
++ mirror = ss.as_java_mirror(class_loader, protection_domain,
+ SignatureStream::ReturnNull, CHECK_(empty));
+- if (mirror == NULL || (ss.is_object() && !is_always_visible_class(mirror))) {
+- // Fall back to accessing_klass context.
+- can_be_cached = false;
++ if (mirror == NULL) {
++ // fall back from BCP to accessing_klass
++ if (accessing_klass.not_null()) {
++ class_loader = Handle(THREAD, InstanceKlass::cast(accessing_klass())->class_loader());
++ protection_domain = Handle(THREAD, InstanceKlass::cast(accessing_klass())->protection_domain());
++ }
++ is_on_bcp = false;
+ }
+ }
+- if (!can_be_cached) {
++ if (!is_on_bcp) {
+ // Resolve, throwing a real error if it doesn't work.
+ mirror = ss.as_java_mirror(class_loader, protection_domain,
+ SignatureStream::NCDFError, CHECK_(empty));
+ }
+- assert(!oopDesc::is_null(mirror), ss.as_symbol(THREAD)->as_C_string());
+ if (ss.at_return_type())
+ rt = Handle(THREAD, mirror);
+ else
+@@ -2478,7 +2462,7 @@
+ &args, CHECK_(empty));
+ Handle method_type(THREAD, (oop) result.get_jobject());
+
+- if (can_be_cached) {
++ if (is_on_bcp) {
+ // We can cache this MethodType inside the JVM.
+ MutexLocker ml(SystemDictionary_lock, THREAD);
+ spe = invoke_method_table()->find_entry(index, hash, signature, null_iid);
+--- ./hotspot/src/share/vm/classfile/verifier.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/verifier.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -655,6 +655,7 @@
+
+
+ bool this_uninit = false; // Set to true when invokespecial <init> initialized 'this'
++ bool verified_exc_handlers = false;
+
+ // Merge with the next instruction
+ {
+@@ -686,6 +687,18 @@
+ }
+ }
+
++ // Look for possible jump target in exception handlers and see if it
++ // matches current_frame. Do this check here for astore*, dstore*,
++ // fstore*, istore*, and lstore* opcodes because they can change the type
++ // state by adding a local. JVM Spec says that the incoming type state
++ // 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) {
++ verify_exception_handler_targets(
++ bci, this_uninit, &current_frame, &stackmap_table, CHECK_VERIFY(this));
++ verified_exc_handlers = true;
++ }
++
+ switch (opcode) {
+ case Bytecodes::_nop :
+ no_control_flow = false; break;
+@@ -1662,9 +1675,13 @@
+ } // end switch
+ } // end Merge with the next instruction
+
+- // Look for possible jump target in exception handlers and see if it
+- // matches current_frame
+- if (bci >= ex_min && bci < ex_max) {
++ // Look for possible jump target in exception handlers and see if it matches
++ // current_frame. Don't do this check if it has already been done (for
++ // ([a,d,f,i,l]store* opcodes). This check cannot be done earlier because
++ // opcodes, such as invokespecial, may set the this_uninit flag.
++ 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) {
+ verify_exception_handler_targets(
+ bci, this_uninit, &current_frame, &stackmap_table, CHECK_VERIFY(this));
+ }
+@@ -2232,14 +2249,20 @@
+ }
+
+ // Look at the method's handlers. If the bci is in the handler's try block
+-// then check if the handler_pc is already on the stack. If not, push it.
++// then check if the handler_pc is already on the stack. If not, push it
++// unless the handler has already been scanned.
+ void ClassVerifier::push_handlers(ExceptionTable* exhandlers,
++ GrowableArray<u4>* handler_list,
+ GrowableArray<u4>* handler_stack,
+ u4 bci) {
+ int exlength = exhandlers->length();
+ for(int x = 0; x < exlength; x++) {
+ if (bci >= exhandlers->start_pc(x) && bci < exhandlers->end_pc(x)) {
+- handler_stack->append_if_missing(exhandlers->handler_pc(x));
++ u4 exhandler_pc = exhandlers->handler_pc(x);
++ if (!handler_list->contains(exhandler_pc)) {
++ handler_stack->append_if_missing(exhandler_pc);
++ handler_list->append(exhandler_pc);
++ }
+ }
+ }
+ }
+@@ -2257,6 +2280,10 @@
+ GrowableArray<u4>* bci_stack = new GrowableArray<u4>(30);
+ // Create stack for handlers for try blocks containing this handler.
+ GrowableArray<u4>* handler_stack = new GrowableArray<u4>(30);
++ // Create list of handlers that have been pushed onto the handler_stack
++ // so that handlers embedded inside of their own TRY blocks only get
++ // scanned once.
++ GrowableArray<u4>* handler_list = new GrowableArray<u4>(30);
+ // Create list of visited branch opcodes (goto* and if*).
+ GrowableArray<u4>* visited_branches = new GrowableArray<u4>(30);
+ ExceptionTable exhandlers(_method());
+@@ -2275,7 +2302,7 @@
+
+ // If the bytecode is in a TRY block, push its handlers so they
+ // will get parsed.
+- push_handlers(&exhandlers, handler_stack, bci);
++ push_handlers(&exhandlers, handler_list, handler_stack, bci);
+
+ switch (opcode) {
+ case Bytecodes::_if_icmpeq:
+@@ -2488,8 +2515,7 @@
+ // of the current class.
+ 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_VERIFY(this));
++ Klass* ref_klass = load_class(ref_class_type.name(), CHECK);
+ Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
+ vmSymbols::object_initializer_name(),
+ cp->signature_ref_at(bcs->get_index_u2()), Klass::normal);
+--- ./hotspot/src/share/vm/classfile/verifier.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/verifier.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -305,9 +305,10 @@
+ bool* this_uninit, constantPoolHandle cp, StackMapTable* stackmap_table,
+ TRAPS);
+
+- // Used by ends_in_athrow() to push all handlers that contain bci onto
+- // the handler_stack, if the handler is not already on the stack.
++ // Used by ends_in_athrow() to push all handlers that contain bci onto the
++ // handler_stack, if the handler has not already been pushed on the stack.
+ void push_handlers(ExceptionTable* exhandlers,
++ GrowableArray<u4>* handler_list,
+ GrowableArray<u4>* handler_stack,
+ u4 bci);
+
+--- ./hotspot/src/share/vm/classfile/vmSymbols.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/classfile/vmSymbols.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -244,7 +244,6 @@
+ template(returnType_name, "returnType") \
+ template(signature_name, "signature") \
+ template(slot_name, "slot") \
+- template(selectAlternative_name, "selectAlternative") \
+ \
+ /* Support for annotations (JDK 1.5 and above) */ \
+ \
+@@ -279,6 +278,7 @@
+ template(java_lang_invoke_LambdaForm, "java/lang/invoke/LambdaForm") \
+ template(java_lang_invoke_ForceInline_signature, "Ljava/lang/invoke/ForceInline;") \
+ template(java_lang_invoke_DontInline_signature, "Ljava/lang/invoke/DontInline;") \
++ template(java_lang_invoke_InjectedProfile_signature, "Ljava/lang/invoke/InjectedProfile;") \
+ template(java_lang_invoke_Stable_signature, "Ljava/lang/invoke/Stable;") \
+ template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \
+ template(java_lang_invoke_LambdaForm_Hidden_signature, "Ljava/lang/invoke/LambdaForm$Hidden;") \
+@@ -296,8 +296,7 @@
+ template(setTarget_signature, "(Ljava/lang/invoke/MethodHandle;)V") \
+ NOT_LP64( do_alias(intptr_signature, int_signature) ) \
+ LP64_ONLY( do_alias(intptr_signature, long_signature) ) \
+- template(selectAlternative_signature, "(ZLjava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;") \
+- \
++ \
+ /* common method and field names */ \
+ template(object_initializer_name, "<init>") \
+ template(class_initializer_name, "<clinit>") \
+@@ -868,6 +867,12 @@
+ do_name( fullFence_name, "fullFence") \
+ do_alias( fullFence_signature, void_method_signature) \
+ \
++ /* Custom branch frequencies profiling support for JSR292 */ \
++ do_class(java_lang_invoke_MethodHandleImpl, "java/lang/invoke/MethodHandleImpl") \
++ do_intrinsic(_profileBoolean, java_lang_invoke_MethodHandleImpl, profileBoolean_name, profileBoolean_signature, F_S) \
++ do_name( profileBoolean_name, "profileBoolean") \
++ do_signature(profileBoolean_signature, "(Z[I)Z") \
++ \
+ /* unsafe memory references (there are a lot of them...) */ \
+ do_signature(getObject_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \
+ do_signature(putObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)V") \
+--- ./hotspot/src/share/vm/code/dependencies.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/code/dependencies.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -811,7 +811,13 @@
+ assert((uint)n <= (uint)_num_participants, "oob");
+ Method* fm = _found_methods[n];
+ assert(n == _num_participants || fm != NULL, "proper usage");
+- assert(fm == NULL || fm->method_holder() == _participants[n], "sanity");
++ if (fm != NULL && fm->method_holder() != _participants[n]) {
++ // Default methods from interfaces can be added to classes. In
++ // that case the holder of the method is not the class but the
++ // interface where it's defined.
++ assert(fm->is_default_method(), "sanity");
++ return NULL;
++ }
+ return fm;
+ }
+
+--- ./hotspot/src/share/vm/code/vmreg.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/code/vmreg.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -32,25 +32,17 @@
+ #ifdef COMPILER2
+ #include "opto/adlcVMDeps.hpp"
+ #include "utilities/ostream.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined ADGLOBALS_MD_HPP
++# include ADGLOBALS_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/adGlobals_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/adGlobals_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/adGlobals_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/adGlobals_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/adGlobals_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/adGlobals_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/adGlobals_ppc_64.hpp"
+ #endif
+ #endif
+--- ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -598,7 +598,7 @@
+ _collector_policy(cp),
+ _should_unload_classes(CMSClassUnloadingEnabled),
+ _concurrent_cycles_since_last_unload(0),
+- _roots_scanning_options(SharedHeap::SO_None),
++ _roots_scanning_options(GenCollectedHeap::SO_None),
+ _inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
+ _intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
+ _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
+@@ -3068,7 +3068,7 @@
+ gch->gen_process_roots(_cmsGen->level(),
+ true, // younger gens are roots
+ true, // activate StrongRootsScope
+- SharedHeap::ScanningOption(roots_scanning_options()),
++ GenCollectedHeap::ScanningOption(roots_scanning_options()),
+ should_unload_classes(),
+ &notOlder,
+ NULL,
+@@ -3136,7 +3136,7 @@
+ gch->gen_process_roots(_cmsGen->level(),
+ true, // younger gens are roots
+ true, // activate StrongRootsScope
+- SharedHeap::ScanningOption(roots_scanning_options()),
++ GenCollectedHeap::ScanningOption(roots_scanning_options()),
+ should_unload_classes(),
+ &notOlder,
+ NULL,
+@@ -3327,7 +3327,7 @@
+ void CMSCollector::setup_cms_unloading_and_verification_state() {
+ const bool should_verify = VerifyBeforeGC || VerifyAfterGC || VerifyDuringGC
+ || VerifyBeforeExit;
+- const int rso = SharedHeap::SO_AllCodeCache;
++ const int rso = GenCollectedHeap::SO_AllCodeCache;
+
+ // We set the proper root for this CMS cycle here.
+ if (should_unload_classes()) { // Should unload classes this cycle
+@@ -3753,7 +3753,7 @@
+ gch->gen_process_roots(_cmsGen->level(),
+ true, // younger gens are roots
+ true, // activate StrongRootsScope
+- SharedHeap::ScanningOption(roots_scanning_options()),
++ GenCollectedHeap::ScanningOption(roots_scanning_options()),
+ should_unload_classes(),
+ &notOlder,
+ NULL,
+@@ -5254,13 +5254,13 @@
+ gch->gen_process_roots(_collector->_cmsGen->level(),
+ false, // yg was scanned above
+ false, // this is parallel code
+- SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
++ GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
+ _collector->should_unload_classes(),
+ &par_mri_cl,
+ NULL,
+ &cld_closure);
+ assert(_collector->should_unload_classes()
+- || (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
++ || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
+ "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
+ _timer.stop();
+ if (PrintCMSStatistics != 0) {
+@@ -5390,14 +5390,14 @@
+ gch->gen_process_roots(_collector->_cmsGen->level(),
+ false, // yg was scanned above
+ false, // this is parallel code
+- SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
++ GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
+ _collector->should_unload_classes(),
+ &par_mrias_cl,
+ NULL,
+ NULL); // The dirty klasses will be handled below
+
+ assert(_collector->should_unload_classes()
+- || (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
++ || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
+ "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
+ _timer.stop();
+ if (PrintCMSStatistics != 0) {
+@@ -5982,14 +5982,14 @@
+ gch->gen_process_roots(_cmsGen->level(),
+ true, // younger gens as roots
+ false, // use the local StrongRootsScope
+- SharedHeap::ScanningOption(roots_scanning_options()),
++ GenCollectedHeap::ScanningOption(roots_scanning_options()),
+ should_unload_classes(),
+ &mrias_cl,
+ NULL,
+ NULL); // The dirty klasses will be handled below
+
+ assert(should_unload_classes()
+- || (roots_scanning_options() & SharedHeap::SO_AllCodeCache),
++ || (roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
+ "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
+ }
+
+@@ -6634,7 +6634,6 @@
+ }
+
+ void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
+- gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
+ TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
+ GCTraceTime t(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer_cm->gc_id());
+ TraceCollectorStats tcs(counters());
+--- ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -130,8 +130,8 @@
+ class VM_GenCollectFullConcurrent: public VM_GC_Operation {
+ bool _disabled_icms;
+ public:
+- VM_GenCollectFullConcurrent(unsigned int gc_count_before,
+- unsigned int full_gc_count_before,
++ VM_GenCollectFullConcurrent(uint gc_count_before,
++ uint full_gc_count_before,
+ GCCause::Cause gc_cause)
+ : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
+ _disabled_icms(false)
+--- ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2007, 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
+@@ -41,7 +41,7 @@
+ nonstatic_field(LinearAllocBlock, _word_size, size_t) \
+ nonstatic_field(AFLBinaryTreeDictionary, _total_size, size_t) \
+ nonstatic_field(CompactibleFreeListSpace, _dictionary, AFLBinaryTreeDictionary*) \
+- nonstatic_field(CompactibleFreeListSpace, _indexedFreeList[0], FreeList<FreeChunk>) \
++ nonstatic_field(CompactibleFreeListSpace, _indexedFreeList[0], AdaptiveFreeList<FreeChunk>) \
+ nonstatic_field(CompactibleFreeListSpace, _smallLinearAllocBlock, LinearAllocBlock)
+
+
+--- ./hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -114,7 +114,7 @@
+ }
+
+ size_t CMBitMap::compute_size(size_t heap_size) {
+- return heap_size / mark_distance();
++ return ReservedSpace::allocation_align_size_up(heap_size / mark_distance());
+ }
+
+ size_t CMBitMap::mark_distance() {
+@@ -2640,24 +2640,41 @@
+ _nextMarkBitMap = (CMBitMap*) temp;
+ }
+
+-class CMObjectClosure;
+-
+-// Closure for iterating over objects, currently only used for
+-// processing SATB buffers.
+-class CMObjectClosure : public ObjectClosure {
++// Closure for marking entries in SATB buffers.
++class CMSATBBufferClosure : public SATBBufferClosure {
+ private:
+ CMTask* _task;
++ G1CollectedHeap* _g1h;
++
++ // This is very similar to CMTask::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 {
++ _task->increment_refs_reached();
++ HeapRegion* hr = _g1h->heap_region_containing_raw(entry);
++ if (entry < hr->next_top_at_mark_start()) {
++ // Until we get here, we don't know whether entry refers to a valid
++ // object; it could instead have been a stale reference.
++ oop obj = static_cast<oop>(entry);
++ assert(obj->is_oop(true /* ignore mark word */),
++ err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(obj)));
++ _task->make_reference_grey(obj, hr);
++ }
++ }
+
+ public:
+- void do_object(oop obj) {
+- _task->deal_with_reference(obj);
++ CMSATBBufferClosure(CMTask* task, G1CollectedHeap* g1h)
++ : _task(task), _g1h(g1h) { }
++
++ virtual void do_buffer(void** buffer, size_t size) {
++ for (size_t i = 0; i < size; ++i) {
++ do_entry(buffer[i]);
++ }
+ }
+-
+- CMObjectClosure(CMTask* task) : _task(task) { }
+ };
+
+ class G1RemarkThreadsClosure : public ThreadClosure {
+- CMObjectClosure _cm_obj;
++ CMSATBBufferClosure _cm_satb_cl;
+ G1CMOopClosure _cm_cl;
+ MarkingCodeBlobClosure _code_cl;
+ int _thread_parity;
+@@ -2665,7 +2682,9 @@
+
+ public:
+ G1RemarkThreadsClosure(G1CollectedHeap* g1h, CMTask* task, bool is_par) :
+- _cm_obj(task), _cm_cl(g1h, g1h->concurrent_mark(), task), _code_cl(&_cm_cl, !CodeBlobToOopClosure::FixRelocations),
++ _cm_satb_cl(task, g1h),
++ _cm_cl(g1h, g1h->concurrent_mark(), task),
++ _code_cl(&_cm_cl, !CodeBlobToOopClosure::FixRelocations),
+ _thread_parity(SharedHeap::heap()->strong_roots_parity()), _is_par(is_par) {}
+
+ void do_thread(Thread* thread) {
+@@ -2681,11 +2700,11 @@
+ // live by the SATB invariant but other oops recorded in nmethods may behave differently.
+ jt->nmethods_do(&_code_cl);
+
+- jt->satb_mark_queue().apply_closure_and_empty(&_cm_obj);
++ jt->satb_mark_queue().apply_closure_and_empty(&_cm_satb_cl);
+ }
+ } else if (thread->is_VM_thread()) {
+ if (thread->claim_oops_do(_is_par, _thread_parity)) {
+- JavaThread::satb_mark_queue_set().shared_satb_queue()->apply_closure_and_empty(&_cm_obj);
++ JavaThread::satb_mark_queue_set().shared_satb_queue()->apply_closure_and_empty(&_cm_satb_cl);
+ }
+ }
+ }
+@@ -3059,9 +3078,7 @@
+ #ifndef PRODUCT
+ enum VerifyNoCSetOopsPhase {
+ VerifyNoCSetOopsStack,
+- VerifyNoCSetOopsQueues,
+- VerifyNoCSetOopsSATBCompleted,
+- VerifyNoCSetOopsSATBThread
++ VerifyNoCSetOopsQueues
+ };
+
+ class VerifyNoCSetOopsClosure : public OopClosure, public ObjectClosure {
+@@ -3074,8 +3091,6 @@
+ switch (_phase) {
+ case VerifyNoCSetOopsStack: return "Stack";
+ case VerifyNoCSetOopsQueues: return "Queue";
+- case VerifyNoCSetOopsSATBCompleted: return "Completed SATB Buffers";
+- case VerifyNoCSetOopsSATBThread: return "Thread SATB Buffers";
+ default: ShouldNotReachHere();
+ }
+ return NULL;
+@@ -3102,7 +3117,7 @@
+
+ virtual void do_oop(narrowOop* p) {
+ // We should not come across narrow oops while scanning marking
+- // stacks and SATB buffers.
++ // stacks
+ ShouldNotReachHere();
+ }
+
+@@ -3111,10 +3126,7 @@
+ }
+ };
+
+-void ConcurrentMark::verify_no_cset_oops(bool verify_stacks,
+- bool verify_enqueued_buffers,
+- bool verify_thread_buffers,
+- bool verify_fingers) {
++void ConcurrentMark::verify_no_cset_oops() {
+ assert(SafepointSynchronize::is_at_safepoint(), "should be at a safepoint");
+ if (!G1CollectedHeap::heap()->mark_in_progress()) {
+ return;
+@@ -3122,65 +3134,47 @@
+
+ VerifyNoCSetOopsClosure cl;
+
+- if (verify_stacks) {
+- // Verify entries on the global mark stack
+- cl.set_phase(VerifyNoCSetOopsStack);
+- _markStack.oops_do(&cl);
+-
+- // Verify entries on the task queues
+- for (uint i = 0; i < _max_worker_id; i += 1) {
+- cl.set_phase(VerifyNoCSetOopsQueues, i);
+- CMTaskQueue* queue = _task_queues->queue(i);
+- queue->oops_do(&cl);
+- }
++ // Verify entries on the global mark stack
++ cl.set_phase(VerifyNoCSetOopsStack);
++ _markStack.oops_do(&cl);
++
++ // Verify entries on the task queues
++ for (uint i = 0; i < _max_worker_id; i += 1) {
++ cl.set_phase(VerifyNoCSetOopsQueues, i);
++ CMTaskQueue* queue = _task_queues->queue(i);
++ queue->oops_do(&cl);
+ }
+
+- SATBMarkQueueSet& satb_qs = JavaThread::satb_mark_queue_set();
+-
+- // Verify entries on the enqueued SATB buffers
+- if (verify_enqueued_buffers) {
+- cl.set_phase(VerifyNoCSetOopsSATBCompleted);
+- satb_qs.iterate_completed_buffers_read_only(&cl);
++ // Verify the global finger
++ HeapWord* global_finger = finger();
++ if (global_finger != NULL && global_finger < _heap_end) {
++ // The global finger always points to a heap region boundary. We
++ // use heap_region_containing_raw() to get the containing region
++ // given that the global finger could be pointing to a free region
++ // which subsequently becomes continues humongous. If that
++ // happens, heap_region_containing() will return the bottom of the
++ // corresponding starts humongous region and the check below will
++ // not hold any more.
++ // Since we always iterate over all regions, we might get a NULL HeapRegion
++ // here.
++ HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger);
++ guarantee(global_hr == NULL || global_finger == global_hr->bottom(),
++ err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT,
++ p2i(global_finger), HR_FORMAT_PARAMS(global_hr)));
+ }
+
+- // Verify entries on the per-thread SATB buffers
+- if (verify_thread_buffers) {
+- cl.set_phase(VerifyNoCSetOopsSATBThread);
+- satb_qs.iterate_thread_buffers_read_only(&cl);
+- }
+-
+- if (verify_fingers) {
+- // Verify the global finger
+- HeapWord* global_finger = finger();
+- if (global_finger != NULL && global_finger < _heap_end) {
+- // The global finger always points to a heap region boundary. We
+- // use heap_region_containing_raw() to get the containing region
+- // given that the global finger could be pointing to a free region
+- // which subsequently becomes continues humongous. If that
+- // happens, heap_region_containing() will return the bottom of the
+- // corresponding starts humongous region and the check below will
+- // not hold any more.
+- // Since we always iterate over all regions, we might get a NULL HeapRegion
+- // here.
+- HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger);
+- guarantee(global_hr == NULL || global_finger == global_hr->bottom(),
+- err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT,
+- p2i(global_finger), HR_FORMAT_PARAMS(global_hr)));
+- }
+-
+- // Verify the task fingers
+- assert(parallel_marking_threads() <= _max_worker_id, "sanity");
+- for (int i = 0; i < (int) parallel_marking_threads(); i += 1) {
+- CMTask* task = _tasks[i];
+- HeapWord* task_finger = task->finger();
+- if (task_finger != NULL && task_finger < _heap_end) {
+- // See above note on the global finger verification.
+- HeapRegion* task_hr = _g1h->heap_region_containing_raw(task_finger);
+- guarantee(task_hr == NULL || task_finger == task_hr->bottom() ||
+- !task_hr->in_collection_set(),
+- err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT,
+- p2i(task_finger), HR_FORMAT_PARAMS(task_hr)));
+- }
++ // Verify the task fingers
++ assert(parallel_marking_threads() <= _max_worker_id, "sanity");
++ for (int i = 0; i < (int) parallel_marking_threads(); i += 1) {
++ CMTask* task = _tasks[i];
++ HeapWord* task_finger = task->finger();
++ if (task_finger != NULL && task_finger < _heap_end) {
++ // See above note on the global finger verification.
++ HeapRegion* task_hr = _g1h->heap_region_containing_raw(task_finger);
++ guarantee(task_hr == NULL || task_finger == task_hr->bottom() ||
++ !task_hr->in_collection_set(),
++ err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT,
++ p2i(task_finger), HR_FORMAT_PARAMS(task_hr)));
+ }
+ }
+ }
+@@ -3510,22 +3504,29 @@
+ }
+ #endif
+
+-void CMTask::scan_object(oop obj) {
++template<bool scan>
++inline void CMTask::process_grey_object(oop obj) {
++ assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray");
+ assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant");
+
+ if (_cm->verbose_high()) {
+- gclog_or_tty->print_cr("[%u] we're scanning object "PTR_FORMAT,
++ gclog_or_tty->print_cr("[%u] processing grey object " PTR_FORMAT,
+ _worker_id, p2i((void*) obj));
+ }
+
+ size_t obj_size = obj->size();
+ _words_scanned += obj_size;
+
+- obj->oop_iterate(_cm_oop_closure);
++ if (scan) {
++ obj->oop_iterate(_cm_oop_closure);
++ }
+ statsOnly( ++_objs_scanned );
+ check_limits();
+ }
+
++template void CMTask::process_grey_object<true>(oop);
++template void CMTask::process_grey_object<false>(oop);
++
+ // Closure for iteration over bitmaps
+ class CMBitMapClosure : public BitMapClosure {
+ private:
+@@ -3994,34 +3995,18 @@
+ // very counter productive if it did that. :-)
+ _draining_satb_buffers = true;
+
+- CMObjectClosure oc(this);
++ CMSATBBufferClosure satb_cl(this, _g1h);
+ SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
+- if (G1CollectedHeap::use_parallel_gc_threads()) {
+- satb_mq_set.set_par_closure(_worker_id, &oc);
+- } else {
+- satb_mq_set.set_closure(&oc);
+- }
+
+ // This keeps claiming and applying the closure to completed buffers
+ // until we run out of buffers or we need to abort.
+- if (G1CollectedHeap::use_parallel_gc_threads()) {
+- while (!has_aborted() &&
+- satb_mq_set.par_apply_closure_to_completed_buffer(_worker_id)) {
+- if (_cm->verbose_medium()) {
+- gclog_or_tty->print_cr("[%u] processed an SATB buffer", _worker_id);
+- }
+- statsOnly( ++_satb_buffers_processed );
+- regular_clock_call();
++ while (!has_aborted() &&
++ satb_mq_set.apply_closure_to_completed_buffer(&satb_cl)) {
++ if (_cm->verbose_medium()) {
++ gclog_or_tty->print_cr("[%u] processed an SATB buffer", _worker_id);
+ }
+- } else {
+- while (!has_aborted() &&
+- satb_mq_set.apply_closure_to_completed_buffer()) {
+- if (_cm->verbose_medium()) {
+- gclog_or_tty->print_cr("[%u] processed an SATB buffer", _worker_id);
+- }
+- statsOnly( ++_satb_buffers_processed );
+- regular_clock_call();
+- }
++ statsOnly( ++_satb_buffers_processed );
++ regular_clock_call();
+ }
+
+ _draining_satb_buffers = false;
+@@ -4030,12 +4015,6 @@
+ concurrent() ||
+ satb_mq_set.completed_buffers_num() == 0, "invariant");
+
+- if (G1CollectedHeap::use_parallel_gc_threads()) {
+- satb_mq_set.set_par_closure(_worker_id, NULL);
+- } else {
+- satb_mq_set.set_closure(NULL);
+- }
+-
+ // again, this was a potentially expensive operation, decrease the
+ // limits to get the regular clock call early
+ decrease_limits();
+--- ./hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -793,14 +793,9 @@
+ }
+
+ // Verify that there are no CSet oops on the stacks (taskqueues /
+- // global mark stack), enqueued SATB buffers, per-thread SATB
+- // buffers, and fingers (global / per-task). The boolean parameters
+- // decide which of the above data structures to verify. If marking
+- // is not in progress, it's a no-op.
+- void verify_no_cset_oops(bool verify_stacks,
+- bool verify_enqueued_buffers,
+- bool verify_thread_buffers,
+- bool verify_fingers) PRODUCT_RETURN;
++ // global mark stack) and fingers (global / per-task).
++ // 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");
+@@ -1108,6 +1103,12 @@
+ void regular_clock_call();
+ bool concurrent() { return _concurrent; }
+
++ // Test whether obj might have already been passed over by the
++ // mark bitmap scan, and so needs to be pushed onto the mark stack.
++ bool is_below_finger(oop obj, HeapWord* global_finger) const;
++
++ template<bool scan> void process_grey_object(oop obj);
++
+ public:
+ // It resets the task; it should be called right at the beginning of
+ // a marking phase.
+@@ -1155,12 +1156,22 @@
+
+ void set_cm_oop_closure(G1CMOopClosure* cm_oop_closure);
+
+- // It grays the object by marking it and, if necessary, pushing it
+- // on the local queue
++ // Increment the number of references this task has visited.
++ void increment_refs_reached() { ++_refs_reached; }
++
++ // Grey the object by marking it. If not already marked, push it on
++ // the local queue if below the finger.
++ // Precondition: obj is in region.
++ // Precondition: obj is below region's NTAMS.
++ inline void make_reference_grey(oop obj, HeapRegion* region);
++
++ // Grey the object (by calling make_grey_reference) if required,
++ // e.g. obj is below its containing region's NTAMS.
++ // Precondition: obj is a valid heap object.
+ inline void deal_with_reference(oop obj);
+
+ // It scans an object and visits its children.
+- void scan_object(oop obj);
++ void scan_object(oop obj) { process_grey_object<true>(obj); }
+
+ // It pushes an object on the local queue.
+ inline void push(oop obj);
+--- ./hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -259,14 +259,87 @@
+ ++_local_pushes );
+ }
+
+-// This determines whether the method below will check both the local
+-// and global fingers when determining whether to push on the stack a
+-// gray object (value 1) or whether it will only check the global one
+-// (value 0). The tradeoffs are that the former will be a bit more
+-// accurate and possibly push less on the stack, but it might also be
+-// a little bit slower.
++inline bool CMTask::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
++ // end of the current region, then no push is needed. The tradeoff
++ // of checking both vs only checking the global finger is that the
++ // local check will be more accurate and so result in fewer pushes,
++ // but may also be a little slower.
++ HeapWord* objAddr = (HeapWord*)obj;
++ if (_finger != NULL) {
++ // We have a current region.
+
+-#define _CHECK_BOTH_FINGERS_ 1
++ // Finger and region values are all NULL or all non-NULL. We
++ // use _finger to check since we immediately use its value.
++ assert(_curr_region != NULL, "invariant");
++ assert(_region_limit != NULL, "invariant");
++ assert(_region_limit <= global_finger, "invariant");
++
++ // True if obj is less than the local finger, or is between
++ // the region limit and the global finger.
++ if (objAddr < _finger) {
++ return true;
++ } else if (objAddr < _region_limit) {
++ return false;
++ } // Else check global finger.
++ }
++ // Check global finger.
++ return objAddr < global_finger;
++}
++
++inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) {
++ if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
++
++ if (_cm->verbose_high()) {
++ gclog_or_tty->print_cr("[%u] marked object " PTR_FORMAT,
++ _worker_id, p2i(obj));
++ }
++
++ // No OrderAccess:store_load() is needed. It is implicit in the
++ // CAS done in CMBitMap::parMark() call in the routine above.
++ HeapWord* global_finger = _cm->finger();
++
++ // We only need to push a newly grey object on the mark
++ // stack if it is in a section of memory the mark bitmap
++ // scan has already examined. Mark bitmap scanning
++ // maintains progress "fingers" for determining that.
++ //
++ // Notice that the global finger might be moving forward
++ // concurrently. This is not a problem. In the worst case, we
++ // mark the object while it is above the global finger and, by
++ // the time we read the global finger, it has moved forward
++ // past this object. In this case, the object will probably
++ // be visited when a task is scanning the region and will also
++ // be pushed on the stack. So, some duplicate work, but no
++ // correctness problems.
++ if (is_below_finger(obj, global_finger)) {
++ if (obj->is_typeArray()) {
++ // Immediately process arrays of primitive types, rather
++ // than pushing on the mark stack. This keeps us from
++ // adding humongous objects to the mark stack that might
++ // be reclaimed before the entry is processed - see
++ // selection of candidates for eager reclaim of humongous
++ // objects. The cost of the additional type test is
++ // mitigated by avoiding a trip through the mark stack,
++ // by only doing a bookkeeping update and avoiding the
++ // actual scan of the object - a typeArray contains no
++ // references, and the metadata is built-in.
++ process_grey_object<false>(obj);
++ } else {
++ if (_cm->verbose_high()) {
++ gclog_or_tty->print_cr("[%u] below a finger (local: " PTR_FORMAT
++ ", global: " PTR_FORMAT ") pushing "
++ PTR_FORMAT " on mark stack",
++ _worker_id, p2i(_finger),
++ p2i(global_finger), p2i(obj));
++ }
++ push(obj);
++ }
++ }
++ }
++}
+
+ inline void CMTask::deal_with_reference(oop obj) {
+ if (_cm->verbose_high()) {
+@@ -274,7 +347,7 @@
+ _worker_id, p2i((void*) obj));
+ }
+
+- ++_refs_reached;
++ increment_refs_reached();
+
+ HeapWord* objAddr = (HeapWord*) obj;
+ assert(obj->is_oop_or_null(true /* ignore mark word */), "Error");
+@@ -286,62 +359,7 @@
+ // anything with it).
+ HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
+ if (!hr->obj_allocated_since_next_marking(obj)) {
+- if (_cm->verbose_high()) {
+- gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
+- _worker_id, p2i((void*) obj));
+- }
+-
+- // we need to mark it first
+- 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.
+- HeapWord* global_finger = _cm->finger();
+-
+-#if _CHECK_BOTH_FINGERS_
+- // we will check both the local and global fingers
+-
+- if (_finger != NULL && objAddr < _finger) {
+- if (_cm->verbose_high()) {
+- gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
+- "pushing it", _worker_id, p2i(_finger));
+- }
+- push(obj);
+- } else if (_curr_region != NULL && objAddr < _region_limit) {
+- // do nothing
+- } else if (objAddr < global_finger) {
+- // Notice that the global finger might be moving forward
+- // concurrently. This is not a problem. In the worst case, we
+- // mark the object while it is above the global finger and, by
+- // the time we read the global finger, it has moved forward
+- // passed this object. In this case, the object will probably
+- // be visited when a task is scanning the region and will also
+- // be pushed on the stack. So, some duplicate work, but no
+- // correctness problems.
+-
+- if (_cm->verbose_high()) {
+- gclog_or_tty->print_cr("[%u] below the global finger "
+- "("PTR_FORMAT"), pushing it",
+- _worker_id, p2i(global_finger));
+- }
+- push(obj);
+- } else {
+- // do nothing
+- }
+-#else // _CHECK_BOTH_FINGERS_
+- // we will only check the global finger
+-
+- if (objAddr < global_finger) {
+- // see long comment above
+-
+- if (_cm->verbose_high()) {
+- gclog_or_tty->print_cr("[%u] below the global finger "
+- "("PTR_FORMAT"), pushing it",
+- _worker_id, p2i(global_finger));
+- }
+- push(obj);
+- }
+-#endif // _CHECK_BOTH_FINGERS_
+- }
++ make_reference_grey(obj, hr);
+ }
+ }
+ }
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -254,25 +254,23 @@
+ HeapRegion* SurvivorGCAllocRegion::allocate_new_region(size_t word_size,
+ bool force) {
+ assert(!force, "not supported for GC alloc regions");
+- return _g1h->new_gc_alloc_region(word_size, count(), GCAllocForSurvived);
++ return _g1h->new_gc_alloc_region(word_size, count(), InCSetState::Young);
+ }
+
+ void SurvivorGCAllocRegion::retire_region(HeapRegion* alloc_region,
+ size_t allocated_bytes) {
+- _g1h->retire_gc_alloc_region(alloc_region, allocated_bytes,
+- GCAllocForSurvived);
++ _g1h->retire_gc_alloc_region(alloc_region, allocated_bytes, InCSetState::Young);
+ }
+
+ HeapRegion* OldGCAllocRegion::allocate_new_region(size_t word_size,
+ bool force) {
+ assert(!force, "not supported for GC alloc regions");
+- return _g1h->new_gc_alloc_region(word_size, count(), GCAllocForTenured);
++ return _g1h->new_gc_alloc_region(word_size, count(), InCSetState::Old);
+ }
+
+ void OldGCAllocRegion::retire_region(HeapRegion* alloc_region,
+ size_t allocated_bytes) {
+- _g1h->retire_gc_alloc_region(alloc_region, allocated_bytes,
+- GCAllocForTenured);
++ _g1h->retire_gc_alloc_region(alloc_region, allocated_bytes, InCSetState::Old);
+ }
+
+ HeapRegion* OldGCAllocRegion::release() {
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1Allocator.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1Allocator.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -59,7 +59,7 @@
+ !(retained_region->top() == retained_region->end()) &&
+ !retained_region->is_empty() &&
+ !retained_region->isHumongous()) {
+- retained_region->record_top_and_timestamp();
++ retained_region->record_timestamp();
+ // The retained region was added to the old region set when it was
+ // retired. We have to remove it now, since we don't allow regions
+ // we allocate to in the region sets. We'll re-add it later, when
+@@ -94,6 +94,9 @@
+ // want either way so no reason to check explicitly for either
+ // condition.
+ _retained_old_gc_alloc_region = old_gc_alloc_region(context)->release();
++ if (_retained_old_gc_alloc_region != NULL) {
++ _retained_old_gc_alloc_region->record_retained_region();
++ }
+
+ if (ResizePLAB) {
+ _g1h->_survivor_plab_stats.adjust_desired_plab_sz(no_of_gc_workers);
+@@ -110,15 +113,16 @@
+ G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) :
+ ParGCAllocBuffer(gclab_word_size), _retired(true) { }
+
+-HeapWord* G1ParGCAllocator::allocate_slow(GCAllocPurpose purpose, size_t word_sz, AllocationContext_t context) {
+- HeapWord* obj = NULL;
+- size_t gclab_word_size = _g1h->desired_plab_sz(purpose);
++HeapWord* G1ParGCAllocator::allocate_direct_or_new_plab(InCSetState dest,
++ size_t word_sz,
++ AllocationContext_t context) {
++ size_t gclab_word_size = _g1h->desired_plab_sz(dest);
+ if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) {
+- G1ParGCAllocBuffer* alloc_buf = alloc_buffer(purpose, context);
++ G1ParGCAllocBuffer* alloc_buf = alloc_buffer(dest, context);
+ add_to_alloc_buffer_waste(alloc_buf->words_remaining());
+ alloc_buf->retire(false /* end_of_gc */, false /* retain */);
+
+- HeapWord* buf = _g1h->par_allocate_during_gc(purpose, gclab_word_size, context);
++ HeapWord* buf = _g1h->par_allocate_during_gc(dest, gclab_word_size, context);
+ if (buf == NULL) {
+ return NULL; // Let caller handle allocation failure.
+ }
+@@ -126,30 +130,33 @@
+ alloc_buf->set_word_size(gclab_word_size);
+ alloc_buf->set_buf(buf);
+
+- obj = alloc_buf->allocate(word_sz);
++ HeapWord* const obj = alloc_buf->allocate(word_sz);
+ assert(obj != NULL, "buffer was definitely big enough...");
++ return obj;
+ } else {
+- obj = _g1h->par_allocate_during_gc(purpose, word_sz, context);
++ return _g1h->par_allocate_during_gc(dest, word_sz, context);
+ }
+- return obj;
+ }
+
+ G1DefaultParGCAllocator::G1DefaultParGCAllocator(G1CollectedHeap* g1h) :
+- G1ParGCAllocator(g1h),
+- _surviving_alloc_buffer(g1h->desired_plab_sz(GCAllocForSurvived)),
+- _tenured_alloc_buffer(g1h->desired_plab_sz(GCAllocForTenured)) {
+-
+- _alloc_buffers[GCAllocForSurvived] = &_surviving_alloc_buffer;
+- _alloc_buffers[GCAllocForTenured] = &_tenured_alloc_buffer;
+-
++ G1ParGCAllocator(g1h),
++ _surviving_alloc_buffer(g1h->desired_plab_sz(InCSetState::Young)),
++ _tenured_alloc_buffer(g1h->desired_plab_sz(InCSetState::Old)) {
++ for (uint state = 0; state < InCSetState::Num; state++) {
++ _alloc_buffers[state] = NULL;
++ }
++ _alloc_buffers[InCSetState::Young] = &_surviving_alloc_buffer;
++ _alloc_buffers[InCSetState::Old] = &_tenured_alloc_buffer;
+ }
+
+ void G1DefaultParGCAllocator::retire_alloc_buffers() {
+- for (int ap = 0; ap < GCAllocPurposeCount; ++ap) {
+- size_t waste = _alloc_buffers[ap]->words_remaining();
+- add_to_alloc_buffer_waste(waste);
+- _alloc_buffers[ap]->flush_stats_and_retire(_g1h->stats_for_purpose((GCAllocPurpose)ap),
+- true /* end_of_gc */,
+- false /* retain */);
++ for (uint state = 0; state < InCSetState::Num; state++) {
++ G1ParGCAllocBuffer* const buf = _alloc_buffers[state];
++ if (buf != NULL) {
++ add_to_alloc_buffer_waste(buf->words_remaining());
++ buf->flush_stats_and_retire(_g1h->alloc_buffer_stats(state),
++ true /* end_of_gc */,
++ false /* retain */);
++ }
+ }
+ }
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1Allocator.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1Allocator.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -27,14 +27,9 @@
+
+ #include "gc_implementation/g1/g1AllocationContext.hpp"
+ #include "gc_implementation/g1/g1AllocRegion.hpp"
++#include "gc_implementation/g1/g1InCSetState.hpp"
+ #include "gc_implementation/shared/parGCAllocBuffer.hpp"
+
+-enum GCAllocPurpose {
+- GCAllocForTenured,
+- GCAllocForSurvived,
+- GCAllocPurposeCount
+-};
+-
+ // Base class for G1 allocators.
+ class G1Allocator : public CHeapObj<mtGC> {
+ friend class VMStructs;
+@@ -178,20 +173,40 @@
+ protected:
+ G1CollectedHeap* _g1h;
+
++ // The survivor alignment in effect in bytes.
++ // == 0 : don't align survivors
++ // != 0 : align survivors to that alignment
++ // These values were chosen to favor the non-alignment case since some
++ // architectures have a special compare against zero instructions.
++ const uint _survivor_alignment_bytes;
++
+ size_t _alloc_buffer_waste;
+ size_t _undo_waste;
+
+ void add_to_alloc_buffer_waste(size_t waste) { _alloc_buffer_waste += waste; }
+ void add_to_undo_waste(size_t waste) { _undo_waste += waste; }
+
+- HeapWord* allocate_slow(GCAllocPurpose purpose, size_t word_sz, AllocationContext_t context);
++ virtual void retire_alloc_buffers() = 0;
++ virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) = 0;
+
+- virtual void retire_alloc_buffers() = 0;
+- virtual G1ParGCAllocBuffer* alloc_buffer(GCAllocPurpose purpose, AllocationContext_t context) = 0;
++ // Calculate the survivor space object alignment in bytes. Returns that or 0 if
++ // there are no restrictions on survivor alignment.
++ static uint calc_survivor_alignment_bytes() {
++ assert(SurvivorAlignmentInBytes >= ObjectAlignmentInBytes, "sanity");
++ if (SurvivorAlignmentInBytes == ObjectAlignmentInBytes) {
++ // No need to align objects in the survivors differently, return 0
++ // which means "survivor alignment is not used".
++ return 0;
++ } else {
++ assert(SurvivorAlignmentInBytes > 0, "sanity");
++ return SurvivorAlignmentInBytes;
++ }
++ }
+
+ public:
+ G1ParGCAllocator(G1CollectedHeap* g1h) :
+- _g1h(g1h), _alloc_buffer_waste(0), _undo_waste(0) {
++ _g1h(g1h), _survivor_alignment_bytes(calc_survivor_alignment_bytes()),
++ _alloc_buffer_waste(0), _undo_waste(0) {
+ }
+
+ static G1ParGCAllocator* create_allocator(G1CollectedHeap* g1h);
+@@ -199,24 +214,40 @@
+ size_t alloc_buffer_waste() { return _alloc_buffer_waste; }
+ size_t undo_waste() {return _undo_waste; }
+
+- HeapWord* allocate(GCAllocPurpose purpose, size_t word_sz, AllocationContext_t context) {
+- HeapWord* obj = NULL;
+- if (purpose == GCAllocForSurvived) {
+- obj = alloc_buffer(purpose, context)->allocate_aligned(word_sz, SurvivorAlignmentInBytes);
++ // Allocate word_sz words in dest, either directly into the regions or by
++ // allocating a new PLAB. Returns the address of the allocated memory, NULL if
++ // not successful.
++ HeapWord* allocate_direct_or_new_plab(InCSetState dest,
++ size_t word_sz,
++ AllocationContext_t context);
++
++ // Allocate word_sz words in the PLAB of dest. Returns the address of the
++ // allocated memory, NULL if not successful.
++ HeapWord* plab_allocate(InCSetState dest,
++ size_t word_sz,
++ AllocationContext_t context) {
++ G1ParGCAllocBuffer* buffer = alloc_buffer(dest, context);
++ if (_survivor_alignment_bytes == 0) {
++ return buffer->allocate(word_sz);
+ } else {
+- obj = alloc_buffer(purpose, context)->allocate(word_sz);
++ return buffer->allocate_aligned(word_sz, _survivor_alignment_bytes);
+ }
++ }
++
++ HeapWord* allocate(InCSetState dest, size_t word_sz,
++ AllocationContext_t context) {
++ HeapWord* const obj = plab_allocate(dest, word_sz, context);
+ if (obj != NULL) {
+ return obj;
+ }
+- return allocate_slow(purpose, word_sz, context);
++ return allocate_direct_or_new_plab(dest, word_sz, context);
+ }
+
+- void undo_allocation(GCAllocPurpose purpose, HeapWord* obj, size_t word_sz, AllocationContext_t context) {
+- if (alloc_buffer(purpose, context)->contains(obj)) {
+- assert(alloc_buffer(purpose, context)->contains(obj + word_sz - 1),
++ void undo_allocation(InCSetState dest, HeapWord* obj, size_t word_sz, AllocationContext_t context) {
++ if (alloc_buffer(dest, context)->contains(obj)) {
++ assert(alloc_buffer(dest, context)->contains(obj + word_sz - 1),
+ "should contain whole object");
+- alloc_buffer(purpose, context)->undo_allocation(obj, word_sz);
++ alloc_buffer(dest, context)->undo_allocation(obj, word_sz);
+ } else {
+ CollectedHeap::fill_with_object(obj, word_sz);
+ add_to_undo_waste(word_sz);
+@@ -227,13 +258,17 @@
+ class G1DefaultParGCAllocator : public G1ParGCAllocator {
+ G1ParGCAllocBuffer _surviving_alloc_buffer;
+ G1ParGCAllocBuffer _tenured_alloc_buffer;
+- G1ParGCAllocBuffer* _alloc_buffers[GCAllocPurposeCount];
++ G1ParGCAllocBuffer* _alloc_buffers[InCSetState::Num];
+
+ public:
+ G1DefaultParGCAllocator(G1CollectedHeap* g1h);
+
+- virtual G1ParGCAllocBuffer* alloc_buffer(GCAllocPurpose purpose, AllocationContext_t context) {
+- return _alloc_buffers[purpose];
++ virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) {
++ assert(dest.is_valid(),
++ err_msg("Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value()));
++ assert(_alloc_buffers[dest.value()] != NULL,
++ err_msg("Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value()));
++ return _alloc_buffers[dest.value()];
+ }
+
+ virtual void retire_alloc_buffers() ;
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -75,7 +75,7 @@
+ assert((uintptr_t)end % mapping_granularity_in_bytes == 0,
+ err_msg("end mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT,
+ mapping_granularity_in_bytes, p2i(end)));
+- size_t num_target_elems = (end - bottom) / (mapping_granularity_in_bytes / HeapWordSize);
++ size_t num_target_elems = pointer_delta(end, bottom, mapping_granularity_in_bytes);
+ idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes;
+ address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes);
+ initialize_base(base, num_target_elems, bias, target_elem_size_in_bytes, log2_intptr(mapping_granularity_in_bytes));
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -46,6 +46,7 @@
+ #include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
+ #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
+ #include "gc_implementation/g1/g1RemSet.inline.hpp"
++#include "gc_implementation/g1/g1RootProcessor.hpp"
+ #include "gc_implementation/g1/g1StringDedup.hpp"
+ #include "gc_implementation/g1/g1YCTypes.hpp"
+ #include "gc_implementation/g1/heapRegion.inline.hpp"
+@@ -85,18 +86,6 @@
+ // apply to TLAB allocation, which is not part of this interface: it
+ // is done by clients of this interface.)
+
+-// Notes on implementation of parallelism in different tasks.
+-//
+-// G1ParVerifyTask uses heap_region_par_iterate_chunked() for parallelism.
+-// The number of GC workers is passed to heap_region_par_iterate_chunked().
+-// It does use run_task() which sets _n_workers in the task.
+-// G1ParTask executes g1_process_roots() ->
+-// SharedHeap::process_roots() which calls eventually to
+-// CardTableModRefBS::par_non_clean_card_iterate_work() which uses
+-// SequentialSubTasksDone. SharedHeap::process_roots() also
+-// directly uses SubTasksDone (_process_strong_tasks field in SharedHeap).
+-//
+-
+ // Local to this file.
+
+ class RefineCardTableEntryClosure: public CardTableEntryClosure {
+@@ -364,7 +353,7 @@
+ HeapRegion* lists[] = {_head, _survivor_head};
+ const char* names[] = {"YOUNG", "SURVIVOR"};
+
+- for (unsigned int list = 0; list < ARRAY_SIZE(lists); ++list) {
++ for (uint list = 0; list < ARRAY_SIZE(lists); ++list) {
+ gclog_or_tty->print_cr("%s LIST CONTENTS", names[list]);
+ HeapRegion *curr = lists[list];
+ if (curr == NULL)
+@@ -838,8 +827,8 @@
+ assert_heap_not_locked_and_not_at_safepoint();
+ assert(!isHumongous(word_size), "we do not allow humongous TLABs");
+
+- unsigned int dummy_gc_count_before;
+- int dummy_gclocker_retry_count = 0;
++ uint dummy_gc_count_before;
++ uint dummy_gclocker_retry_count = 0;
+ return attempt_allocation(word_size, &dummy_gc_count_before, &dummy_gclocker_retry_count);
+ }
+
+@@ -849,8 +838,8 @@
+ assert_heap_not_locked_and_not_at_safepoint();
+
+ // Loop until the allocation is satisfied, or unsatisfied after GC.
+- for (int try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) {
+- unsigned int gc_count_before;
++ for (uint try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) {
++ uint gc_count_before;
+
+ HeapWord* result = NULL;
+ if (!isHumongous(word_size)) {
+@@ -902,8 +891,8 @@
+
+ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size,
+ AllocationContext_t context,
+- unsigned int *gc_count_before_ret,
+- int* gclocker_retry_count_ret) {
++ uint* gc_count_before_ret,
++ uint* gclocker_retry_count_ret) {
+ // Make sure you read the note in attempt_allocation_humongous().
+
+ assert_heap_not_locked_and_not_at_safepoint();
+@@ -920,7 +909,7 @@
+ HeapWord* result = NULL;
+ for (int try_count = 1; /* we'll return */; try_count += 1) {
+ bool should_try_gc;
+- unsigned int gc_count_before;
++ uint gc_count_before;
+
+ {
+ MutexLockerEx x(Heap_lock);
+@@ -964,7 +953,7 @@
+ if (should_try_gc) {
+ bool succeeded;
+ result = do_collection_pause(word_size, gc_count_before, &succeeded,
+- GCCause::_g1_inc_collection_pause);
++ GCCause::_g1_inc_collection_pause);
+ if (result != NULL) {
+ assert(succeeded, "only way to get back a non-NULL result");
+ return result;
+@@ -1018,8 +1007,8 @@
+ }
+
+ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size,
+- unsigned int * gc_count_before_ret,
+- int* gclocker_retry_count_ret) {
++ uint* gc_count_before_ret,
++ uint* gclocker_retry_count_ret) {
+ // The structure of this method has a lot of similarities to
+ // attempt_allocation_slow(). The reason these two were not merged
+ // into a single one is that such a method would require several "if
+@@ -1052,7 +1041,7 @@
+ HeapWord* result = NULL;
+ for (int try_count = 1; /* we'll return */; try_count += 1) {
+ bool should_try_gc;
+- unsigned int gc_count_before;
++ uint gc_count_before;
+
+ {
+ MutexLockerEx x(Heap_lock);
+@@ -1090,7 +1079,7 @@
+
+ bool succeeded;
+ result = do_collection_pause(word_size, gc_count_before, &succeeded,
+- GCCause::_g1_humongous_allocation);
++ GCCause::_g1_humongous_allocation);
+ if (result != NULL) {
+ assert(succeeded, "only way to get back a non-NULL result");
+ return result;
+@@ -1297,7 +1286,6 @@
+
+ // Timing
+ assert(gc_cause() != GCCause::_java_lang_system_gc || explicit_gc, "invariant");
+- gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps);
+ TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
+
+ {
+@@ -1855,7 +1843,6 @@
+ _is_alive_closure_stw(this),
+ _ref_processor_cm(NULL),
+ _ref_processor_stw(NULL),
+- _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)),
+ _bot_shared(NULL),
+ _evac_failure_scan_stack(NULL),
+ _mark_in_progress(false),
+@@ -1866,7 +1853,7 @@
+ _secondary_free_list("Secondary Free List", new SecondaryFreeRegionListMtSafeChecker()),
+ _old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
+ _humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
+- _humongous_is_live(),
++ _humongous_reclaim_candidates(),
+ _has_humongous_reclaim_candidates(false),
+ _free_regions_coming(false),
+ _young_list(new YoungList(this)),
+@@ -1878,6 +1865,7 @@
+ _old_marking_cycles_started(0),
+ _old_marking_cycles_completed(0),
+ _concurrent_cycle_started(false),
++ _heap_summary_sent(false),
+ _in_cset_fast_test(),
+ _dirty_cards_region_list(NULL),
+ _worker_cset_start_region(NULL),
+@@ -1888,9 +1876,6 @@
+ _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) G1OldTracer()) {
+
+ _g1h = this;
+- if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
+- vm_exit_during_initialization("Failed necessary allocation.");
+- }
+
+ _allocator = G1Allocator::create_allocator(_g1h);
+ _humongous_object_threshold_in_words = HeapRegion::GrainWords / 2;
+@@ -1902,7 +1887,7 @@
+ assert(n_rem_sets > 0, "Invariant.");
+
+ _worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC);
+- _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(unsigned int, n_queues, mtGC);
++ _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
+ _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
+
+ for (int i = 0; i < n_queues; i++) {
+@@ -1919,6 +1904,26 @@
+ guarantee(_task_queues != NULL, "task_queues allocation failure.");
+ }
+
++G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description,
++ size_t size,
++ size_t translation_factor) {
++ size_t preferred_page_size = os::page_size_for_region_unaligned(size, 1);
++ // Allocate a new reserved space, preferring to use large pages.
++ ReservedSpace rs(size, preferred_page_size);
++ G1RegionToSpaceMapper* result =
++ G1RegionToSpaceMapper::create_mapper(rs,
++ size,
++ rs.alignment(),
++ HeapRegion::GrainBytes,
++ translation_factor,
++ mtGC);
++ if (TracePageSizes) {
++ gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT,
++ description, preferred_page_size, p2i(rs.base()), rs.size(), rs.alignment(), size);
++ }
++ return result;
++}
++
+ jint G1CollectedHeap::initialize() {
+ CollectedHeap::pre_initialize();
+ os::enable_vtime();
+@@ -1992,57 +1997,35 @@
+ ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
+ G1RegionToSpaceMapper* heap_storage =
+ G1RegionToSpaceMapper::create_mapper(g1_rs,
++ g1_rs.size(),
+ UseLargePages ? os::large_page_size() : os::vm_page_size(),
+ HeapRegion::GrainBytes,
+ 1,
+ mtJavaHeap);
+ heap_storage->set_mapping_changed_listener(&_listener);
+
+- // Reserve space for the block offset table. We do not support automatic uncommit
+- // for the card table at this time. BOT only.
+- ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize));
++ // Create storage for the BOT, card table, card counts table (hot card cache) and the bitmaps.
+ G1RegionToSpaceMapper* bot_storage =
+- G1RegionToSpaceMapper::create_mapper(bot_rs,
+- os::vm_page_size(),
+- HeapRegion::GrainBytes,
+- G1BlockOffsetSharedArray::N_bytes,
+- mtGC);
++ create_aux_memory_mapper("Block offset table",
++ G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize),
++ G1BlockOffsetSharedArray::N_bytes);
+
+ ReservedSpace cardtable_rs(G1SATBCardTableLoggingModRefBS::compute_size(g1_rs.size() / HeapWordSize));
+ G1RegionToSpaceMapper* cardtable_storage =
+- G1RegionToSpaceMapper::create_mapper(cardtable_rs,
+- os::vm_page_size(),
+- HeapRegion::GrainBytes,
+- G1BlockOffsetSharedArray::N_bytes,
+- mtGC);
+-
+- // Reserve space for the card counts table.
+- ReservedSpace card_counts_rs(G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize));
++ create_aux_memory_mapper("Card table",
++ G1SATBCardTableLoggingModRefBS::compute_size(g1_rs.size() / HeapWordSize),
++ G1BlockOffsetSharedArray::N_bytes);
++
+ G1RegionToSpaceMapper* card_counts_storage =
+- G1RegionToSpaceMapper::create_mapper(card_counts_rs,
+- os::vm_page_size(),
+- HeapRegion::GrainBytes,
+- G1BlockOffsetSharedArray::N_bytes,
+- mtGC);
+-
+- // Reserve space for prev and next bitmap.
++ create_aux_memory_mapper("Card counts table",
++ G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize),
++ G1BlockOffsetSharedArray::N_bytes);
++
+ size_t bitmap_size = CMBitMap::compute_size(g1_rs.size());
+-
+- ReservedSpace prev_bitmap_rs(ReservedSpace::allocation_align_size_up(bitmap_size));
+ G1RegionToSpaceMapper* prev_bitmap_storage =
+- G1RegionToSpaceMapper::create_mapper(prev_bitmap_rs,
+- os::vm_page_size(),
+- HeapRegion::GrainBytes,
+- CMBitMap::mark_distance(),
+- mtGC);
+-
+- ReservedSpace next_bitmap_rs(ReservedSpace::allocation_align_size_up(bitmap_size));
++ create_aux_memory_mapper("Prev Bitmap", bitmap_size, CMBitMap::mark_distance());
+ G1RegionToSpaceMapper* next_bitmap_storage =
+- G1RegionToSpaceMapper::create_mapper(next_bitmap_rs,
+- os::vm_page_size(),
+- HeapRegion::GrainBytes,
+- CMBitMap::mark_distance(),
+- mtGC);
++ create_aux_memory_mapper("Next Bitmap", bitmap_size, CMBitMap::mark_distance());
+
+ _hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage);
+ g1_barrier_set()->initialize(cardtable_storage);
+@@ -2065,8 +2048,14 @@
+
+ _g1h = this;
+
+- _in_cset_fast_test.initialize(_hrm.reserved().start(), _hrm.reserved().end(), HeapRegion::GrainBytes);
+- _humongous_is_live.initialize(_hrm.reserved().start(), _hrm.reserved().end(), HeapRegion::GrainBytes);
++ {
++ HeapWord* start = _hrm.reserved().start();
++ HeapWord* end = _hrm.reserved().end();
++ size_t granularity = HeapRegion::GrainBytes;
++
++ _in_cset_fast_test.initialize(start, end, granularity);
++ _humongous_reclaim_candidates.initialize(start, end, granularity);
++ }
+
+ // Create the ConcurrentMark data structure and thread.
+ // (Must do this late, so that "max_regions" is defined.)
+@@ -2158,11 +2147,6 @@
+ }
+ }
+
+-void G1CollectedHeap::clear_humongous_is_live_table() {
+- guarantee(G1ReclaimDeadHumongousObjectsAtYoungGC, "Should only be called if true");
+- _humongous_is_live.clear();
+-}
+-
+ size_t G1CollectedHeap::conservative_max_heap_alignment() {
+ return HeapRegion::max_region_size();
+ }
+@@ -2299,11 +2283,11 @@
+ hot_card_cache->drain(worker_i, g1_rem_set(), into_cset_dcq);
+
+ DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
+- int n_completed_buffers = 0;
++ size_t n_completed_buffers = 0;
+ while (dcqs.apply_closure_to_completed_buffer(cl, worker_i, 0, true)) {
+ n_completed_buffers++;
+ }
+- g1_policy()->phase_times()->record_update_rs_processed_buffers(worker_i, n_completed_buffers);
++ g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers);
+ dcqs.clear_n_completed_buffers();
+ assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
+ }
+@@ -2448,13 +2432,24 @@
+ _gc_timer_cm->register_gc_end();
+ _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions());
+
++ // Clear state variables to prepare for the next concurrent cycle.
+ _concurrent_cycle_started = false;
++ _heap_summary_sent = false;
+ }
+ }
+
+ void G1CollectedHeap::trace_heap_after_concurrent_cycle() {
+ if (_concurrent_cycle_started) {
+- trace_heap_after_gc(_gc_tracer_cm);
++ // This function can be called when:
++ // the cleanup pause is run
++ // the concurrent cycle is aborted before the cleanup pause.
++ // the concurrent cycle is aborted after the cleanup pause,
++ // but before the concurrent cycle end has been registered.
++ // Make sure that we only send the heap information once.
++ if (!_heap_summary_sent) {
++ trace_heap_after_gc(_gc_tracer_cm);
++ _heap_summary_sent = true;
++ }
+ }
+ }
+
+@@ -2477,9 +2472,9 @@
+ void G1CollectedHeap::collect(GCCause::Cause cause) {
+ assert_heap_not_locked();
+
+- unsigned int gc_count_before;
+- unsigned int old_marking_count_before;
+- unsigned int full_gc_count_before;
++ uint gc_count_before;
++ uint old_marking_count_before;
++ uint full_gc_count_before;
+ bool retry_gc;
+
+ do {
+@@ -3292,11 +3287,12 @@
+ G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
+ G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
+
+- process_all_roots(true, // activate StrongRootsScope
+- SO_AllCodeCache, // roots scanning options
+- &rootsCl,
+- &cldCl,
+- &blobsCl);
++ {
++ G1RootProcessor root_processor(this);
++ root_processor.process_all_roots(&rootsCl,
++ &cldCl,
++ &blobsCl);
++ }
+
+ bool failures = rootsCl.failures() || codeRootsCl.failures();
+
+@@ -3616,7 +3612,7 @@
+ }
+
+ HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size,
+- unsigned int gc_count_before,
++ uint gc_count_before,
+ bool* succeeded,
+ GCCause::Cause gc_cause) {
+ assert_heap_not_locked_and_not_at_safepoint();
+@@ -3671,18 +3667,73 @@
+ return g1_rem_set()->cardsScanned();
+ }
+
+-bool G1CollectedHeap::humongous_region_is_always_live(uint index) {
+- HeapRegion* region = region_at(index);
+- assert(region->startsHumongous(), "Must start a humongous object");
+- return oop(region->bottom())->is_objArray() || !region->rem_set()->is_empty();
+-}
+-
+ class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure {
+ private:
+ size_t _total_humongous;
+ size_t _candidate_humongous;
++
++ DirtyCardQueue _dcq;
++
++ // We don't nominate objects with many remembered set entries, on
++ // the assumption that such objects are likely still live.
++ bool is_remset_small(HeapRegion* region) const {
++ HeapRegionRemSet* const rset = region->rem_set();
++ return G1EagerReclaimHumongousObjectsWithStaleRefs
++ ? rset->occupancy_less_or_equal_than(G1RSetSparseRegionEntries)
++ : rset->is_empty();
++ }
++
++ bool is_typeArray_region(HeapRegion* region) const {
++ return oop(region->bottom())->is_typeArray();
++ }
++
++ bool humongous_region_is_candidate(G1CollectedHeap* heap, HeapRegion* region) const {
++ assert(region->startsHumongous(), "Must start a humongous object");
++
++ // Candidate selection must satisfy the following constraints
++ // while concurrent marking is in progress:
++ //
++ // * In order to maintain SATB invariants, an object must not be
++ // reclaimed if it was allocated before the start of marking and
++ // has not had its references scanned. Such an object must have
++ // its references (including type metadata) scanned to ensure no
++ // live objects are missed by the marking process. Objects
++ // allocated after the start of concurrent marking don't need to
++ // be scanned.
++ //
++ // * An object must not be reclaimed if it is on the concurrent
++ // mark stack. Objects allocated after the start of concurrent
++ // marking are never pushed on the mark stack.
++ //
++ // Nominating only objects allocated after the start of concurrent
++ // marking is sufficient to meet both constraints. This may miss
++ // some objects that satisfy the constraints, but the marking data
++ // structures don't support efficiently performing the needed
++ // additional tests or scrubbing of the mark stack.
++ //
++ // However, we presently only nominate is_typeArray() objects.
++ // A humongous object containing references induces remembered
++ // set entries on other regions. In order to reclaim such an
++ // object, those remembered sets would need to be cleaned up.
++ //
++ // We also treat is_typeArray() objects specially, allowing them
++ // to be reclaimed even if allocated before the start of
++ // concurrent mark. For this we rely on mark stack insertion to
++ // exclude is_typeArray() objects, preventing reclaiming an object
++ // that is in the mark stack. We also rely on the metadata for
++ // such objects to be built-in and so ensured to be kept live.
++ // Frequent allocation and drop of large binary blobs is an
++ // important use case for eager reclaim, and this special handling
++ // may reduce needed headroom.
++
++ return is_typeArray_region(region) && is_remset_small(region);
++ }
++
+ public:
+- RegisterHumongousWithInCSetFastTestClosure() : _total_humongous(0), _candidate_humongous(0) {
++ RegisterHumongousWithInCSetFastTestClosure()
++ : _total_humongous(0),
++ _candidate_humongous(0),
++ _dcq(&JavaThread::dirty_card_queue_set()) {
+ }
+
+ virtual bool doHeapRegion(HeapRegion* r) {
+@@ -3691,14 +3742,33 @@
+ }
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+
+- uint region_idx = r->hrm_index();
+- bool is_candidate = !g1h->humongous_region_is_always_live(region_idx);
+- // Is_candidate already filters out humongous regions with some remembered set.
+- // This will not lead to humongous object that we mistakenly keep alive because
+- // during young collection the remembered sets will only be added to.
++ bool is_candidate = humongous_region_is_candidate(g1h, r);
++ uint rindex = r->hrm_index();
++ g1h->set_humongous_reclaim_candidate(rindex, is_candidate);
+ if (is_candidate) {
+- g1h->register_humongous_region_with_in_cset_fast_test(region_idx);
+ _candidate_humongous++;
++ g1h->register_humongous_region_with_in_cset_fast_test(rindex);
++ // Is_candidate already filters out humongous object with large remembered sets.
++ // If we have a humongous object with a few remembered sets, we simply flush these
++ // remembered set entries into the DCQS. That will result in automatic
++ // re-evaluation of their remembered set entries during the following evacuation
++ // phase.
++ if (!r->rem_set()->is_empty()) {
++ guarantee(r->rem_set()->occupancy_less_or_equal_than(G1RSetSparseRegionEntries),
++ "Found a not-small remembered set here. This is inconsistent with previous assumptions.");
++ G1SATBCardTableLoggingModRefBS* bs = g1h->g1_barrier_set();
++ HeapRegionRemSetIterator hrrs(r->rem_set());
++ size_t card_index;
++ while (hrrs.has_next(card_index)) {
++ jbyte* card_ptr = (jbyte*)bs->byte_for_index(card_index);
++ if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
++ *card_ptr = CardTableModRefBS::dirty_card_val();
++ _dcq.enqueue(card_ptr);
++ }
++ }
++ r->rem_set()->clear_locked();
++ }
++ assert(r->rem_set()->is_empty(), "At this point any humongous candidate remembered set must be empty.");
+ }
+ _total_humongous++;
+
+@@ -3707,23 +3777,29 @@
+
+ size_t total_humongous() const { return _total_humongous; }
+ size_t candidate_humongous() const { return _candidate_humongous; }
++
++ void flush_rem_set_entries() { _dcq.flush(); }
+ };
+
+ void G1CollectedHeap::register_humongous_regions_with_in_cset_fast_test() {
+- if (!G1ReclaimDeadHumongousObjectsAtYoungGC) {
+- g1_policy()->phase_times()->record_fast_reclaim_humongous_stats(0, 0);
++ if (!G1EagerReclaimHumongousObjects) {
++ g1_policy()->phase_times()->record_fast_reclaim_humongous_stats(0.0, 0, 0);
+ return;
+ }
+-
++ double time = os::elapsed_counter();
++
++ // Collect reclaim candidate information and register candidates with cset.
+ RegisterHumongousWithInCSetFastTestClosure cl;
+ heap_region_iterate(&cl);
+- g1_policy()->phase_times()->record_fast_reclaim_humongous_stats(cl.total_humongous(),
++
++ time = ((double)(os::elapsed_counter() - time) / os::elapsed_frequency()) * 1000.0;
++ g1_policy()->phase_times()->record_fast_reclaim_humongous_stats(time,
++ cl.total_humongous(),
+ cl.candidate_humongous());
+ _has_humongous_reclaim_candidates = cl.candidate_humongous() > 0;
+
+- if (_has_humongous_reclaim_candidates) {
+- clear_humongous_is_live_table();
+- }
++ // Finally flush all remembered set entries to re-check into the global DCQS.
++ cl.flush_rem_set_entries();
+ }
+
+ void
+@@ -3901,10 +3977,10 @@
+
+ TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
+
+- int active_workers = (G1CollectedHeap::use_parallel_gc_threads() ?
++ uint active_workers = (G1CollectedHeap::use_parallel_gc_threads() ?
+ workers()->active_workers() : 1);
+ double pause_start_sec = os::elapsedTime();
+- g1_policy()->phase_times()->note_gc_start(active_workers);
++ g1_policy()->phase_times()->note_gc_start(active_workers, mark_in_progress());
+ log_gc_header();
+
+ TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
+@@ -4014,15 +4090,12 @@
+
+ register_humongous_regions_with_in_cset_fast_test();
+
++ assert(check_cset_fast_test(), "Inconsistency in the InCSetState table.");
++
+ _cm->note_start_of_gc();
+- // We should not verify the per-thread SATB buffers given that
+- // we have not filtered them yet (we'll do so during the
+- // GC). We also call this after finalize_cset() to
++ // We call this after finalize_cset() to
+ // ensure that the CSet has been finalized.
+- _cm->verify_no_cset_oops(true /* verify_stacks */,
+- true /* verify_enqueued_buffers */,
+- false /* verify_thread_buffers */,
+- true /* verify_fingers */);
++ _cm->verify_no_cset_oops();
+
+ if (_hr_printer.is_active()) {
+ HeapRegion* hr = g1_policy()->collection_set();
+@@ -4045,16 +4118,6 @@
+ // Actually do the work...
+ evacuate_collection_set(evacuation_info);
+
+- // We do this to mainly verify the per-thread SATB buffers
+- // (which have been filtered by now) since we didn't verify
+- // them earlier. No point in re-checking the stacks / enqueued
+- // buffers given that the CSet has not changed since last time
+- // we checked.
+- _cm->verify_no_cset_oops(false /* verify_stacks */,
+- false /* verify_enqueued_buffers */,
+- true /* verify_thread_buffers */,
+- true /* verify_fingers */);
+-
+ free_collection_set(g1_policy()->collection_set(), evacuation_info);
+
+ eagerly_reclaim_humongous_regions();
+@@ -4137,10 +4200,7 @@
+
+ // We redo the verification but now wrt to the new CSet which
+ // has just got initialized after the previous CSet was freed.
+- _cm->verify_no_cset_oops(true /* verify_stacks */,
+- true /* verify_enqueued_buffers */,
+- true /* verify_thread_buffers */,
+- true /* verify_fingers */);
++ _cm->verify_no_cset_oops();
+ _cm->note_end_of_gc();
+
+ // This timing is only used by the ergonomics to handle our pause target.
+@@ -4243,29 +4303,6 @@
+ return true;
+ }
+
+-size_t G1CollectedHeap::desired_plab_sz(GCAllocPurpose purpose)
+-{
+- size_t gclab_word_size;
+- switch (purpose) {
+- case GCAllocForSurvived:
+- gclab_word_size = _survivor_plab_stats.desired_plab_sz();
+- break;
+- case GCAllocForTenured:
+- gclab_word_size = _old_plab_stats.desired_plab_sz();
+- break;
+- default:
+- assert(false, "unknown GCAllocPurpose");
+- gclab_word_size = _old_plab_stats.desired_plab_sz();
+- break;
+- }
+-
+- // Prevent humongous PLAB sizes for two reasons:
+- // * PLABs are allocated using a similar paths as oops, but should
+- // never be in a humongous region
+- // * Allowing humongous PLABs needlessly churns the region free lists
+- return MIN2(_humongous_object_threshold_in_words, gclab_word_size);
+-}
+-
+ void G1CollectedHeap::init_for_evac_failure(OopsInHeapRegionClosure* cl) {
+ _drain_in_progress = false;
+ set_evac_failure_closure(cl);
+@@ -4405,35 +4442,6 @@
+ }
+ }
+
+-HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose,
+- size_t word_size,
+- AllocationContext_t context) {
+- if (purpose == GCAllocForSurvived) {
+- HeapWord* result = survivor_attempt_allocation(word_size, context);
+- if (result != NULL) {
+- return result;
+- } else {
+- // Let's try to allocate in the old gen in case we can fit the
+- // object there.
+- return old_attempt_allocation(word_size, context);
+- }
+- } else {
+- assert(purpose == GCAllocForTenured, "sanity");
+- HeapWord* result = old_attempt_allocation(word_size, context);
+- if (result != NULL) {
+- return result;
+- } else {
+- // Let's try to allocate in the survivors in case we can fit the
+- // object there.
+- return survivor_attempt_allocation(word_size, context);
+- }
+- }
+-
+- ShouldNotReachHere();
+- // Trying to keep some compilers happy.
+- return NULL;
+-}
+-
+ void G1ParCopyHelper::mark_object(oop obj) {
+ assert(!_g1->heap_region_containing(obj)->in_collection_set(), "should not mark objects in the CSet");
+
+@@ -4476,14 +4484,14 @@
+
+ assert(_worker_id == _par_scan_state->queue_num(), "sanity");
+
+- G1CollectedHeap::in_cset_state_t state = _g1->in_cset_state(obj);
+-
+- if (state == G1CollectedHeap::InCSet) {
++ const InCSetState state = _g1->in_cset_state(obj);
++ if (state.is_in_cset()) {
+ oop forwardee;
+- if (obj->is_forwarded()) {
+- forwardee = obj->forwardee();
++ markOop m = obj->mark();
++ if (m->is_marked()) {
++ forwardee = (oop) m->decode_pointer();
+ } else {
+- forwardee = _par_scan_state->copy_to_survivor_space(obj);
++ forwardee = _par_scan_state->copy_to_survivor_space(state, obj, m);
+ }
+ assert(forwardee != NULL, "forwardee should not be NULL");
+ oopDesc::encode_store_heap_oop(p, forwardee);
+@@ -4497,7 +4505,7 @@
+ do_klass_barrier(p, forwardee);
+ }
+ } else {
+- if (state == G1CollectedHeap::IsHumongous) {
++ if (state.is_humongous()) {
+ _g1->set_humongous_is_live(obj);
+ }
+ // The object is not in collection set. If we're a root scanning
+@@ -4582,60 +4590,11 @@
+ }
+ };
+
+-class G1CodeBlobClosure : public CodeBlobClosure {
+- class HeapRegionGatheringOopClosure : public OopClosure {
+- G1CollectedHeap* _g1h;
+- OopClosure* _work;
+- nmethod* _nm;
+-
+- template <typename T>
+- void do_oop_work(T* p) {
+- _work->do_oop(p);
+- T oop_or_narrowoop = oopDesc::load_heap_oop(p);
+- if (!oopDesc::is_null(oop_or_narrowoop)) {
+- oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
+- HeapRegion* hr = _g1h->heap_region_containing_raw(o);
+- assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
+- hr->add_strong_code_root(_nm);
+- }
+- }
+-
+- public:
+- HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
+-
+- void do_oop(oop* o) {
+- do_oop_work(o);
+- }
+-
+- void do_oop(narrowOop* o) {
+- do_oop_work(o);
+- }
+-
+- void set_nm(nmethod* nm) {
+- _nm = nm;
+- }
+- };
+-
+- HeapRegionGatheringOopClosure _oc;
+-public:
+- G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
+-
+- void do_code_blob(CodeBlob* cb) {
+- nmethod* nm = cb->as_nmethod_or_null();
+- if (nm != NULL) {
+- if (!nm->test_set_oops_do_mark()) {
+- _oc.set_nm(nm);
+- nm->oops_do(&_oc);
+- nm->fix_oop_relocations();
+- }
+- }
+- }
+-};
+-
+ class G1ParTask : public AbstractGangTask {
+ protected:
+ G1CollectedHeap* _g1h;
+ RefToScanQueueSet *_queues;
++ G1RootProcessor* _root_processor;
+ ParallelTaskTerminator _terminator;
+ uint _n_workers;
+
+@@ -4643,10 +4602,11 @@
+ Mutex* stats_lock() { return &_stats_lock; }
+
+ public:
+- G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues)
++ G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor)
+ : AbstractGangTask("G1 collection"),
+ _g1h(g1h),
+ _queues(task_queues),
++ _root_processor(root_processor),
+ _terminator(0, _queues),
+ _stats_lock(Mutex::leaf, "parallel G1 stats lock", true)
+ {}
+@@ -4660,13 +4620,7 @@
+ ParallelTaskTerminator* terminator() { return &_terminator; }
+
+ virtual void set_for_termination(int active_workers) {
+- // This task calls set_n_termination() in par_non_clean_card_iterate_work()
+- // in the young space (_par_seq_tasks) in the G1 heap
+- // for SequentialSubTasksDone.
+- // This task also uses SubTasksDone in SharedHeap and G1CollectedHeap
+- // both of which need setting by set_n_termination().
+- _g1h->SharedHeap::set_n_termination(active_workers);
+- _g1h->set_n_termination(active_workers);
++ _root_processor->set_num_workers(active_workers);
+ terminator()->reset_for_reuse(active_workers);
+ _n_workers = active_workers;
+ }
+@@ -4703,8 +4657,7 @@
+ void work(uint worker_id) {
+ if (worker_id >= _n_workers) return; // no work needed this round
+
+- double start_time_ms = os::elapsedTime() * 1000.0;
+- _g1h->g1_policy()->phase_times()->record_gc_worker_start_time(worker_id, start_time_ms);
++ _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, os::elapsedTime());
+
+ {
+ ResourceMark rm;
+@@ -4736,24 +4689,21 @@
+ false, // Process all klasses.
+ true); // Need to claim CLDs.
+
+- G1CodeBlobClosure scan_only_code_cl(&scan_only_root_cl);
+- G1CodeBlobClosure scan_mark_code_cl(&scan_mark_root_cl);
+- // IM Weak code roots are handled later.
+-
+ OopClosure* strong_root_cl;
+ OopClosure* weak_root_cl;
+ CLDClosure* strong_cld_cl;
+ CLDClosure* weak_cld_cl;
+- CodeBlobClosure* strong_code_cl;
++
++ bool trace_metadata = false;
+
+ if (_g1h->g1_policy()->during_initial_mark_pause()) {
+ // We also need to mark copied objects.
+ strong_root_cl = &scan_mark_root_cl;
+ strong_cld_cl = &scan_mark_cld_cl;
+- strong_code_cl = &scan_mark_code_cl;
+ if (ClassUnloadingWithConcurrentMark) {
+ weak_root_cl = &scan_mark_weak_root_cl;
+ weak_cld_cl = &scan_mark_weak_cld_cl;
++ trace_metadata = true;
+ } else {
+ weak_root_cl = &scan_mark_root_cl;
+ weak_cld_cl = &scan_mark_cld_cl;
+@@ -4763,31 +4713,32 @@
+ weak_root_cl = &scan_only_root_cl;
+ strong_cld_cl = &scan_only_cld_cl;
+ weak_cld_cl = &scan_only_cld_cl;
+- strong_code_cl = &scan_only_code_cl;
+ }
+
+-
+- G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
+-
+ pss.start_strong_roots();
+- _g1h->g1_process_roots(strong_root_cl,
+- weak_root_cl,
+- &push_heap_rs_cl,
+- strong_cld_cl,
+- weak_cld_cl,
+- strong_code_cl,
+- worker_id);
+-
++
++ _root_processor->evacuate_roots(strong_root_cl,
++ weak_root_cl,
++ strong_cld_cl,
++ weak_cld_cl,
++ trace_metadata,
++ worker_id);
++
++ G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
++ _root_processor->scan_remembered_sets(&push_heap_rs_cl,
++ weak_root_cl,
++ worker_id);
+ pss.end_strong_roots();
+
+ {
+ double start = os::elapsedTime();
+ G1ParEvacuateFollowersClosure evac(_g1h, &pss, _queues, &_terminator);
+ evac.do_void();
+- double elapsed_ms = (os::elapsedTime()-start)*1000.0;
+- double term_ms = pss.term_time()*1000.0;
+- _g1h->g1_policy()->phase_times()->add_obj_copy_time(worker_id, elapsed_ms-term_ms);
+- _g1h->g1_policy()->phase_times()->record_termination(worker_id, term_ms, pss.term_attempts());
++ double elapsed_sec = os::elapsedTime() - start;
++ double term_sec = pss.term_time();
++ _g1h->g1_policy()->phase_times()->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec);
++ _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec);
++ _g1h->g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, pss.term_attempts());
+ }
+ _g1h->g1_policy()->record_thread_age_table(pss.age_table());
+ _g1h->update_surviving_young_words(pss.surviving_young_words()+1);
+@@ -4803,100 +4754,10 @@
+ // destructors are executed here and are included as part of the
+ // "GC Worker Time".
+ }
+-
+- double end_time_ms = os::elapsedTime() * 1000.0;
+- _g1h->g1_policy()->phase_times()->record_gc_worker_end_time(worker_id, end_time_ms);
++ _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerEnd, worker_id, os::elapsedTime());
+ }
+ };
+
+-// *** Common G1 Evacuation Stuff
+-
+-// This method is run in a GC worker.
+-
+-void
+-G1CollectedHeap::
+-g1_process_roots(OopClosure* scan_non_heap_roots,
+- OopClosure* scan_non_heap_weak_roots,
+- OopsInHeapRegionClosure* scan_rs,
+- CLDClosure* scan_strong_clds,
+- CLDClosure* scan_weak_clds,
+- CodeBlobClosure* scan_strong_code,
+- uint worker_i) {
+-
+- // First scan the shared roots.
+- double ext_roots_start = os::elapsedTime();
+- double closure_app_time_sec = 0.0;
+-
+- bool during_im = _g1h->g1_policy()->during_initial_mark_pause();
+- bool trace_metadata = during_im && ClassUnloadingWithConcurrentMark;
+-
+- BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
+- BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
+-
+- process_roots(false, // no scoping; this is parallel code
+- SharedHeap::SO_None,
+- &buf_scan_non_heap_roots,
+- &buf_scan_non_heap_weak_roots,
+- scan_strong_clds,
+- // Unloading Initial Marks handle the weak CLDs separately.
+- (trace_metadata ? NULL : scan_weak_clds),
+- scan_strong_code);
+-
+- // Now the CM ref_processor roots.
+- if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) {
+- // We need to treat the discovered reference lists of the
+- // concurrent mark ref processor as roots and keep entries
+- // (which are added by the marking threads) on them live
+- // until they can be processed at the end of marking.
+- ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
+- }
+-
+- if (trace_metadata) {
+- // Barrier to make sure all workers passed
+- // the strong CLD and strong nmethods phases.
+- active_strong_roots_scope()->wait_until_all_workers_done_with_threads(n_par_threads());
+-
+- // Now take the complement of the strong CLDs.
+- ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
+- }
+-
+- // Finish up any enqueued closure apps (attributed as object copy time).
+- buf_scan_non_heap_roots.done();
+- buf_scan_non_heap_weak_roots.done();
+-
+- double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
+- + buf_scan_non_heap_weak_roots.closure_app_seconds();
+-
+- g1_policy()->phase_times()->record_obj_copy_time(worker_i, obj_copy_time_sec * 1000.0);
+-
+- double ext_root_time_ms =
+- ((os::elapsedTime() - ext_roots_start) - obj_copy_time_sec) * 1000.0;
+-
+- g1_policy()->phase_times()->record_ext_root_scan_time(worker_i, ext_root_time_ms);
+-
+- // During conc marking we have to filter the per-thread SATB buffers
+- // to make sure we remove any oops into the CSet (which will show up
+- // as implicitly live).
+- double satb_filtering_ms = 0.0;
+- if (!_process_strong_tasks->is_task_claimed(G1H_PS_filter_satb_buffers)) {
+- if (mark_in_progress()) {
+- double satb_filter_start = os::elapsedTime();
+-
+- JavaThread::satb_mark_queue_set().filter_thread_buffers();
+-
+- satb_filtering_ms = (os::elapsedTime() - satb_filter_start) * 1000.0;
+- }
+- }
+- g1_policy()->phase_times()->record_satb_filtering_time(worker_i, satb_filtering_ms);
+-
+- // Now scan the complement of the collection set.
+- G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots);
+-
+- g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
+-
+- _process_strong_tasks->all_tasks_completed();
+-}
+-
+ class G1StringSymbolTableUnlinkTask : public AbstractGangTask {
+ private:
+ BoolObjectClosure* _is_alive;
+@@ -5310,7 +5171,8 @@
+ G1RedirtyLoggedCardsTask(DirtyCardQueueSet* queue) : AbstractGangTask("Redirty Cards"), _queue(queue) { }
+
+ virtual void work(uint worker_id) {
+- double start_time = os::elapsedTime();
++ G1GCPhaseTimes* phase_times = G1CollectedHeap::heap()->g1_policy()->phase_times();
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::RedirtyCards, worker_id);
+
+ RedirtyLoggedCardTableEntryClosure cl;
+ if (G1CollectedHeap::heap()->use_parallel_gc_threads()) {
+@@ -5319,9 +5181,7 @@
+ _queue->apply_closure_to_all_completed_buffers(&cl);
+ }
+
+- G1GCPhaseTimes* timer = G1CollectedHeap::heap()->g1_policy()->phase_times();
+- timer->record_redirty_logged_cards_time_ms(worker_id, (os::elapsedTime() - start_time) * 1000.0);
+- timer->record_redirty_logged_cards_processed_cards(worker_id, cl.num_processed());
++ phase_times->record_thread_work_item(G1GCPhaseTimes::RedirtyCards, worker_id, cl.num_processed());
+ }
+ };
+
+@@ -5382,17 +5242,17 @@
+ oop obj = *p;
+ assert(obj != NULL, "the caller should have filtered out NULL values");
+
+- G1CollectedHeap::in_cset_state_t cset_state = _g1->in_cset_state(obj);
+- if (cset_state == G1CollectedHeap::InNeither) {
++ const InCSetState cset_state = _g1->in_cset_state(obj);
++ if (!cset_state.is_in_cset_or_humongous()) {
+ return;
+ }
+- if (cset_state == G1CollectedHeap::InCSet) {
++ if (cset_state.is_in_cset()) {
+ assert( obj->is_forwarded(), "invariant" );
+ *p = obj->forwardee();
+ } else {
+ assert(!obj->is_forwarded(), "invariant" );
+- assert(cset_state == G1CollectedHeap::IsHumongous,
+- err_msg("Only allowed InCSet state is IsHumongous, but is %d", cset_state));
++ assert(cset_state.is_humongous(),
++ err_msg("Only allowed InCSet state is IsHumongous, but is %d", cset_state.value()));
+ _g1->set_humongous_is_live(obj);
+ }
+ }
+@@ -5885,7 +5745,6 @@
+ n_workers = 1;
+ }
+
+- G1ParTask g1_par_task(this, _task_queues);
+
+ init_for_evac_failure(NULL);
+
+@@ -5896,7 +5755,8 @@
+ double end_par_time_sec;
+
+ {
+- StrongRootsScope srs(this);
++ G1RootProcessor root_processor(this);
++ G1ParTask g1_par_task(this, _task_queues, &root_processor);
+ // InitialMark needs claim bits to keep track of the marked-through CLDs.
+ if (g1_policy()->during_initial_mark_pause()) {
+ ClassLoaderDataGraph::clear_claimed_marks();
+@@ -5917,18 +5777,20 @@
+ end_par_time_sec = os::elapsedTime();
+
+ // Closing the inner scope will execute the destructor
+- // for the StrongRootsScope object. We record the current
++ // for the G1RootProcessor object. We record the current
+ // elapsed time before closing the scope so that time
+- // taken for the SRS destructor is NOT included in the
++ // taken for the destructor is NOT included in the
+ // reported parallel time.
+ }
+
++ G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
++
+ double par_time_ms = (end_par_time_sec - start_par_time_sec) * 1000.0;
+- g1_policy()->phase_times()->record_par_time(par_time_ms);
++ phase_times->record_par_time(par_time_ms);
+
+ double code_root_fixup_time_ms =
+ (os::elapsedTime() - end_par_time_sec) * 1000.0;
+- g1_policy()->phase_times()->record_code_root_fixup_time(code_root_fixup_time_ms);
++ phase_times->record_code_root_fixup_time(code_root_fixup_time_ms);
+
+ set_par_threads(0);
+
+@@ -5939,14 +5801,15 @@
+ // not copied during the pause.
+ process_discovered_references(n_workers);
+
+- // Weak root processing.
+- {
++ if (G1StringDedup::is_enabled()) {
++ double fixup_start = os::elapsedTime();
++
+ G1STWIsAliveClosure is_alive(this);
+ G1KeepAliveClosure keep_alive(this);
+- JNIHandles::weak_oops_do(&is_alive, &keep_alive);
+- if (G1StringDedup::is_enabled()) {
+- G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive);
+- }
++ G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive, true, phase_times);
++
++ double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
++ phase_times->record_string_dedup_fixup_time(fixup_time_ms);
+ }
+
+ _allocator->release_gc_alloc_regions(n_workers, evacuation_info);
+@@ -6214,6 +6077,70 @@
+ 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->isHumongous()) {
++ if (hr->in_collection_set()) {
++ gclog_or_tty->print_cr("\n## humongous region %u in CSet", i);
++ _failures = true;
++ return true;
++ }
++ if (cset_state.is_in_cset()) {
++ gclog_or_tty->print_cr("\n## inconsistent cset state %d for humongous region %u", cset_state.value(), i);
++ _failures = true;
++ return true;
++ }
++ if (hr->continuesHumongous() && cset_state.is_humongous()) {
++ gclog_or_tty->print_cr("\n## inconsistent cset state %d for continues humongous region %u", cset_state.value(), i);
++ _failures = true;
++ return true;
++ }
++ } else {
++ if (cset_state.is_humongous()) {
++ gclog_or_tty->print_cr("\n## inconsistent cset state %d for non-humongous region %u", cset_state.value(), i);
++ _failures = true;
++ return true;
++ }
++ if (hr->in_collection_set() != cset_state.is_in_cset()) {
++ gclog_or_tty->print_cr("\n## in CSet %d / cset state %d 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())) {
++ gclog_or_tty->print_cr("\n## is_young %d / cset state %d inconsistency for region %u",
++ hr->is_young(), cset_state.value(), i);
++ _failures = true;
++ return true;
++ }
++ if (hr->is_old() != (cset_state.is_old())) {
++ gclog_or_tty->print_cr("\n## is_old %d / cset state %d 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
+
+ void G1CollectedHeap::cleanUpCardTable() {
+@@ -6409,47 +6336,47 @@
+ // are completely up-to-date wrt to references to the humongous object.
+ //
+ // Other implementation considerations:
+- // - never consider object arrays: while they are a valid target, they have not
+- // been observed to be used as temporary objects.
+- // - they would also pose considerable effort for cleaning up the the remembered
+- // sets.
+- // While this cleanup is not strictly necessary to be done (or done instantly),
+- // given that their occurrence is very low, this saves us this additional
+- // complexity.
++ // - never consider object arrays at this time because they would pose
++ // considerable effort for cleaning up the the remembered sets. This is
++ // required because stale remembered sets might reference locations that
++ // are currently allocated into.
+ uint region_idx = r->hrm_index();
+- if (g1h->humongous_is_live(region_idx) ||
+- g1h->humongous_region_is_always_live(region_idx)) {
+-
+- if (G1TraceReclaimDeadHumongousObjectsAtYoungGC) {
+- gclog_or_tty->print_cr("Live humongous %d region %d with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d",
+- r->isHumongous(),
++ if (!g1h->is_humongous_reclaim_candidate(region_idx) ||
++ !r->rem_set()->is_empty()) {
++
++ if (G1TraceEagerReclaimHumongousObjects) {
++ gclog_or_tty->print_cr("Live humongous region %u size "SIZE_FORMAT" start "PTR_FORMAT" length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d reclaim candidate %d type array %d",
+ region_idx,
++ obj->size()*HeapWordSize,
++ r->bottom(),
++ r->region_num(),
+ r->rem_set()->occupied(),
+ r->rem_set()->strong_code_roots_list_length(),
+ next_bitmap->isMarked(r->bottom()),
+- g1h->humongous_is_live(region_idx),
+- obj->is_objArray()
++ g1h->is_humongous_reclaim_candidate(region_idx),
++ obj->is_typeArray()
+ );
+ }
+
+ return false;
+ }
+
+- guarantee(!obj->is_objArray(),
+- err_msg("Eagerly reclaiming object arrays is not supported, but the object "PTR_FORMAT" is.",
++ guarantee(obj->is_typeArray(),
++ err_msg("Only eagerly reclaiming type arrays is supported, but the object "
++ PTR_FORMAT " is not.",
+ r->bottom()));
+
+- if (G1TraceReclaimDeadHumongousObjectsAtYoungGC) {
+- gclog_or_tty->print_cr("Reclaim humongous region %d start "PTR_FORMAT" region %d length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d",
+- r->isHumongous(),
++ if (G1TraceEagerReclaimHumongousObjects) {
++ gclog_or_tty->print_cr("Dead humongous region %u size "SIZE_FORMAT" start "PTR_FORMAT" length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d reclaim candidate %d type array %d",
++ region_idx,
++ obj->size()*HeapWordSize,
+ r->bottom(),
+- region_idx,
+ r->region_num(),
+ r->rem_set()->occupied(),
+ r->rem_set()->strong_code_roots_list_length(),
+ next_bitmap->isMarked(r->bottom()),
+- g1h->humongous_is_live(region_idx),
+- obj->is_objArray()
++ g1h->is_humongous_reclaim_candidate(region_idx),
++ obj->is_typeArray()
+ );
+ }
+ // Need to clear mark bit of the humongous object if already set.
+@@ -6480,7 +6407,8 @@
+ void G1CollectedHeap::eagerly_reclaim_humongous_regions() {
+ assert_at_safepoint(true);
+
+- if (!G1ReclaimDeadHumongousObjectsAtYoungGC || !_has_humongous_reclaim_candidates) {
++ if (!G1EagerReclaimHumongousObjects ||
++ (!_has_humongous_reclaim_candidates && !G1TraceEagerReclaimHumongousObjects)) {
+ g1_policy()->phase_times()->record_fast_reclaim_humongous_time_ms(0.0, 0);
+ return;
+ }
+@@ -6793,20 +6721,20 @@
+
+ HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size,
+ uint count,
+- GCAllocPurpose ap) {
++ InCSetState dest) {
+ assert(FreeList_lock->owned_by_self(), "pre-condition");
+
+- if (count < g1_policy()->max_regions(ap)) {
+- bool survivor = (ap == GCAllocForSurvived);
++ if (count < g1_policy()->max_regions(dest)) {
++ const bool is_survivor = (dest.is_young());
+ HeapRegion* new_alloc_region = new_region(word_size,
+- !survivor,
++ !is_survivor,
+ true /* do_expand */);
+ if (new_alloc_region != NULL) {
+ // We really only need to do this for old regions given that we
+ // should never scan survivors. But it doesn't hurt to do it
+ // for survivors too.
+- new_alloc_region->record_top_and_timestamp();
+- if (survivor) {
++ new_alloc_region->record_timestamp();
++ if (is_survivor) {
+ new_alloc_region->set_survivor();
+ _hr_printer.alloc(new_alloc_region, G1HRPrinter::Survivor);
+ check_bitmaps("Survivor Region Allocation", new_alloc_region);
+@@ -6818,8 +6746,6 @@
+ bool during_im = g1_policy()->during_initial_mark_pause();
+ new_alloc_region->note_start_of_copying(during_im);
+ return new_alloc_region;
+- } else {
+- g1_policy()->note_alloc_region_limit_reached(ap);
+ }
+ }
+ return NULL;
+@@ -6827,11 +6753,11 @@
+
+ void G1CollectedHeap::retire_gc_alloc_region(HeapRegion* alloc_region,
+ size_t allocated_bytes,
+- GCAllocPurpose ap) {
++ InCSetState dest) {
+ bool during_im = g1_policy()->during_initial_mark_pause();
+ alloc_region->note_end_of_copying(during_im);
+ g1_policy()->record_bytes_copied_during_gc(allocated_bytes);
+- if (ap == GCAllocForSurvived) {
++ if (dest.is_young()) {
+ young_list()->add_survivor_region(alloc_region);
+ } else {
+ _old_set.add(alloc_region);
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -32,6 +32,7 @@
+ #include "gc_implementation/g1/g1AllocRegion.hpp"
+ #include "gc_implementation/g1/g1BiasedArray.hpp"
+ #include "gc_implementation/g1/g1HRPrinter.hpp"
++#include "gc_implementation/g1/g1InCSetState.hpp"
+ #include "gc_implementation/g1/g1MonitoringSupport.hpp"
+ #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+ #include "gc_implementation/g1/g1YCTypes.hpp"
+@@ -212,6 +213,9 @@
+ // Other related classes.
+ friend class G1MarkSweep;
+
++ // Testing classes.
++ friend class G1CheckCSetFastTableClosure;
++
+ private:
+ // The one and only G1CollectedHeap, so static functions can find it.
+ static G1CollectedHeap* _g1h;
+@@ -229,7 +233,6 @@
+ // It keeps track of the humongous regions.
+ HeapRegionSet _humongous_set;
+
+- void clear_humongous_is_live_table();
+ void eagerly_reclaim_humongous_regions();
+
+ // The number of regions we could create by expansion.
+@@ -299,22 +302,26 @@
+ // Helper for monitoring and management support.
+ G1MonitoringSupport* _g1mm;
+
+- // Records whether the region at the given index is kept live by roots or
+- // references from the young generation.
+- class HumongousIsLiveBiasedMappedArray : public G1BiasedMappedArray<bool> {
++ // Records whether the region at the given index is (still) a
++ // candidate for eager reclaim. Only valid for humongous start
++ // regions; other regions have unspecified values. Humongous start
++ // regions are initialized at start of collection pause, with
++ // candidates removed from the set as they are found reachable from
++ // roots or the young generation.
++ class HumongousReclaimCandidates : public G1BiasedMappedArray<bool> {
+ protected:
+ bool default_value() const { return false; }
+ public:
+ void clear() { G1BiasedMappedArray<bool>::clear(); }
+- void set_live(uint region) {
+- set_by_index(region, true);
++ void set_candidate(uint region, bool value) {
++ set_by_index(region, value);
+ }
+- bool is_live(uint region) {
++ bool is_candidate(uint region) {
+ return get_by_index(region);
+ }
+ };
+
+- HumongousIsLiveBiasedMappedArray _humongous_is_live;
++ HumongousReclaimCandidates _humongous_reclaim_candidates;
+ // Stores whether during humongous object registration we found candidate regions.
+ // If not, we can skip a few steps.
+ bool _has_humongous_reclaim_candidates;
+@@ -339,13 +346,14 @@
+
+ // Keeps track of how many "old marking cycles" (i.e., Full GCs or
+ // concurrent cycles) we have started.
+- volatile unsigned int _old_marking_cycles_started;
++ volatile uint _old_marking_cycles_started;
+
+ // Keeps track of how many "old marking cycles" (i.e., Full GCs or
+ // concurrent cycles) we have completed.
+- volatile unsigned int _old_marking_cycles_completed;
++ volatile uint _old_marking_cycles_completed;
+
+ bool _concurrent_cycle_started;
++ bool _heap_summary_sent;
+
+ // This is a non-product method that is helpful for testing. It is
+ // called at the end of a GC and artificially expands the heap by
+@@ -362,6 +370,12 @@
+ // heap after a compaction.
+ void print_hrm_post_compaction();
+
++ // Create a memory mapper for auxiliary data structures of the given size and
++ // translation factor.
++ static G1RegionToSpaceMapper* create_aux_memory_mapper(const char* description,
++ size_t size,
++ size_t translation_factor);
++
+ double verify(bool guard, const char* msg);
+ void verify_before_gc();
+ void verify_after_gc();
+@@ -510,22 +524,22 @@
+ // the mutator alloc region without taking the Heap_lock. This
+ // should only be used for non-humongous allocations.
+ inline HeapWord* attempt_allocation(size_t word_size,
+- unsigned int* gc_count_before_ret,
+- int* gclocker_retry_count_ret);
++ uint* gc_count_before_ret,
++ uint* gclocker_retry_count_ret);
+
+ // Second-level mutator allocation attempt: take the Heap_lock and
+ // retry the allocation attempt, potentially scheduling a GC
+ // pause. This should only be used for non-humongous allocations.
+ HeapWord* attempt_allocation_slow(size_t word_size,
+ AllocationContext_t context,
+- unsigned int* gc_count_before_ret,
+- int* gclocker_retry_count_ret);
++ uint* gc_count_before_ret,
++ uint* gclocker_retry_count_ret);
+
+ // Takes the Heap_lock and attempts a humongous allocation. It can
+ // potentially schedule a GC pause.
+ HeapWord* attempt_allocation_humongous(size_t word_size,
+- unsigned int* gc_count_before_ret,
+- int* gclocker_retry_count_ret);
++ uint* gc_count_before_ret,
++ uint* gclocker_retry_count_ret);
+
+ // Allocation attempt that should be called during safepoints (e.g.,
+ // at the end of a successful GC). expect_null_mutator_alloc_region
+@@ -545,15 +559,9 @@
+ // allocation region, either by picking one or expanding the
+ // heap, and then allocate a block of the given size. The block
+ // may not be a humongous - it must fit into a single heap region.
+- HeapWord* par_allocate_during_gc(GCAllocPurpose purpose,
+- size_t word_size,
+- AllocationContext_t context);
+-
+- HeapWord* allocate_during_gc_slow(GCAllocPurpose purpose,
+- HeapRegion* alloc_region,
+- bool par,
+- size_t word_size);
+-
++ inline HeapWord* par_allocate_during_gc(InCSetState dest,
++ size_t word_size,
++ AllocationContext_t context);
+ // Ensure that no further allocations can happen in "r", bearing in mind
+ // that parallel threads might be attempting allocations.
+ void par_allocate_remaining_space(HeapRegion* r);
+@@ -575,9 +583,9 @@
+
+ // For GC alloc regions.
+ HeapRegion* new_gc_alloc_region(size_t word_size, uint count,
+- GCAllocPurpose ap);
++ InCSetState dest);
+ void retire_gc_alloc_region(HeapRegion* alloc_region,
+- size_t allocated_bytes, GCAllocPurpose ap);
++ size_t allocated_bytes, InCSetState dest);
+
+ // - if explicit_gc is true, the GC is for a System.gc() or a heap
+ // inspection request and should collect the entire heap
+@@ -638,26 +646,11 @@
+ // (Rounds up to a HeapRegion boundary.)
+ bool expand(size_t expand_bytes);
+
+- // Returns the PLAB statistics given a purpose.
+- PLABStats* stats_for_purpose(GCAllocPurpose purpose) {
+- PLABStats* stats = NULL;
++ // Returns the PLAB statistics for a given destination.
++ inline PLABStats* alloc_buffer_stats(InCSetState dest);
+
+- switch (purpose) {
+- case GCAllocForSurvived:
+- stats = &_survivor_plab_stats;
+- break;
+- case GCAllocForTenured:
+- stats = &_old_plab_stats;
+- break;
+- default:
+- assert(false, "unrecognized GCAllocPurpose");
+- }
+-
+- return stats;
+- }
+-
+- // Determines PLAB size for a particular allocation purpose.
+- size_t desired_plab_sz(GCAllocPurpose purpose);
++ // Determines PLAB size for a given destination.
++ inline size_t desired_plab_sz(InCSetState dest);
+
+ inline AllocationContextStats& allocation_context_stats();
+
+@@ -665,15 +658,15 @@
+ virtual void gc_prologue(bool full);
+ virtual void gc_epilogue(bool full);
+
++ // Modify the reclaim candidate set and test for presence.
++ // These are only valid for starts_humongous regions.
++ inline void set_humongous_reclaim_candidate(uint region, bool value);
++ inline bool is_humongous_reclaim_candidate(uint region);
++
++ // Remove from the reclaim candidate set. Also remove from the
++ // collection set so that later encounters avoid the slow path.
+ inline void set_humongous_is_live(oop obj);
+
+- bool humongous_is_live(uint region) {
+- return _humongous_is_live.is_live(region);
+- }
+-
+- // Returns whether the given region (which must be a humongous (start) region)
+- // is to be considered conservatively live regardless of any other conditions.
+- bool humongous_region_is_always_live(uint index);
+ // Register the given region to be part of the collection set.
+ inline void register_humongous_region_with_in_cset_fast_test(uint index);
+ // Register regions with humongous objects (actually on the start region) in
+@@ -681,8 +674,11 @@
+ void register_humongous_regions_with_in_cset_fast_test();
+ // We register a region with the fast "in collection set" test. We
+ // simply set to true the array slot corresponding to this region.
+- void register_region_with_in_cset_fast_test(HeapRegion* r) {
+- _in_cset_fast_test.set_in_cset(r->hrm_index());
++ void register_young_region_with_in_cset_fast_test(HeapRegion* r) {
++ _in_cset_fast_test.set_in_young(r->hrm_index());
++ }
++ void register_old_region_with_in_cset_fast_test(HeapRegion* r) {
++ _in_cset_fast_test.set_in_old(r->hrm_index());
+ }
+
+ // This is a fast test on whether a reference points into the
+@@ -714,7 +710,7 @@
+ // +ExplicitGCInvokesConcurrent).
+ void increment_old_marking_cycles_completed(bool concurrent);
+
+- unsigned int old_marking_cycles_completed() {
++ uint old_marking_cycles_completed() {
+ return _old_marking_cycles_completed;
+ }
+
+@@ -773,7 +769,7 @@
+ // methods that call do_collection_pause() release the Heap_lock
+ // before the call, so it's easy to read gc_count_before just before.
+ HeapWord* do_collection_pause(size_t word_size,
+- unsigned int gc_count_before,
++ uint gc_count_before,
+ bool* succeeded,
+ GCCause::Cause gc_cause);
+
+@@ -812,22 +808,6 @@
+ // statistics or updating free lists.
+ void abandon_collection_set(HeapRegion* cs_head);
+
+- // Applies "scan_non_heap_roots" to roots outside the heap,
+- // "scan_rs" to roots inside the heap (having done "set_region" to
+- // indicate the region in which the root resides),
+- // and does "scan_metadata" If "scan_rs" is
+- // NULL, then this step is skipped. The "worker_i"
+- // param is for use with parallel roots processing, and should be
+- // the "i" of the calling parallel worker thread's work(i) function.
+- // In the sequential case this param will be ignored.
+- void g1_process_roots(OopClosure* scan_non_heap_roots,
+- OopClosure* scan_non_heap_weak_roots,
+- OopsInHeapRegionClosure* scan_rs,
+- CLDClosure* scan_strong_clds,
+- CLDClosure* scan_weak_clds,
+- CodeBlobClosure* scan_strong_code,
+- uint worker_i);
+-
+ // The concurrent marker (and the thread it runs in.)
+ ConcurrentMark* _cm;
+ ConcurrentMarkThread* _cmThread;
+@@ -1012,23 +992,12 @@
+ // The heap region entry for a given worker is valid iff
+ // the associated time stamp value matches the current value
+ // of G1CollectedHeap::_gc_time_stamp.
+- unsigned int* _worker_cset_start_region_time_stamp;
+-
+- enum G1H_process_roots_tasks {
+- G1H_PS_filter_satb_buffers,
+- G1H_PS_refProcessor_oops_do,
+- // Leave this one last.
+- G1H_PS_NumElements
+- };
+-
+- SubTasksDone* _process_strong_tasks;
++ uint* _worker_cset_start_region_time_stamp;
+
+ volatile bool _free_regions_coming;
+
+ public:
+
+- SubTasksDone* process_strong_tasks() { return _process_strong_tasks; }
+-
+ void set_refine_cte_cl_concurrency(bool concurrent);
+
+ RefToScanQueue *task_queue(int i) const;
+@@ -1061,21 +1030,11 @@
+ // Initialize weak reference processing.
+ virtual void ref_processing_init();
+
+- void set_par_threads(uint t) {
+- SharedHeap::set_par_threads(t);
+- // Done in SharedHeap but oddly there are
+- // two _process_strong_tasks's in a G1CollectedHeap
+- // so do it here too.
+- _process_strong_tasks->set_n_threads(t);
+- }
+-
++ // Explicitly import set_par_threads into this scope
++ using SharedHeap::set_par_threads;
+ // Set _n_par_threads according to a policy TBD.
+ void set_par_threads();
+
+- void set_n_termination(int t) {
+- _process_strong_tasks->set_n_threads(t);
+- }
+-
+ virtual CollectedHeap::Name kind() const {
+ return CollectedHeap::G1CollectedHeap;
+ }
+@@ -1150,6 +1109,10 @@
+ // The number of regions that are completely free.
+ uint num_free_regions() const { return _hrm.num_free_regions(); }
+
++ MemoryUsage get_auxiliary_data_memory_usage() const {
++ return _hrm.get_auxiliary_data_memory_usage();
++ }
++
+ // The number of regions that are not completely free.
+ uint num_used_regions() const { return num_regions() - num_free_regions(); }
+
+@@ -1182,6 +1145,9 @@
+ // 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).
+@@ -1277,53 +1243,15 @@
+
+ inline bool is_in_cset_or_humongous(const oop obj);
+
+- enum in_cset_state_t {
+- InNeither, // neither in collection set nor humongous
+- InCSet, // region is in collection set only
+- IsHumongous // region is a humongous start region
+- };
+ private:
+- // Instances of this class are used for quick tests on whether a reference points
+- // into the collection set or is a humongous object (points into a humongous
+- // object).
+- // Each of the array's elements denotes whether the corresponding region is in
+- // the collection set or a humongous region.
+- // We use this to quickly reclaim humongous objects: by making a humongous region
+- // succeed this test, we sort-of add it to the collection set. During the reference
+- // iteration closures, when we see a humongous region, we simply mark it as
+- // referenced, i.e. live.
+- class G1FastCSetBiasedMappedArray : public G1BiasedMappedArray<char> {
+- protected:
+- char default_value() const { return G1CollectedHeap::InNeither; }
+- public:
+- void set_humongous(uintptr_t index) {
+- assert(get_by_index(index) != InCSet, "Should not overwrite InCSet values");
+- set_by_index(index, G1CollectedHeap::IsHumongous);
+- }
+-
+- void clear_humongous(uintptr_t index) {
+- set_by_index(index, G1CollectedHeap::InNeither);
+- }
+-
+- void set_in_cset(uintptr_t index) {
+- assert(get_by_index(index) != G1CollectedHeap::IsHumongous, "Should not overwrite IsHumongous value");
+- set_by_index(index, G1CollectedHeap::InCSet);
+- }
+-
+- bool is_in_cset_or_humongous(HeapWord* addr) const { return get_by_address(addr) != G1CollectedHeap::InNeither; }
+- bool is_in_cset(HeapWord* addr) const { return get_by_address(addr) == G1CollectedHeap::InCSet; }
+- G1CollectedHeap::in_cset_state_t at(HeapWord* addr) const { return (G1CollectedHeap::in_cset_state_t)get_by_address(addr); }
+- void clear() { G1BiasedMappedArray<char>::clear(); }
+- };
+-
+ // This array is used for a quick test on whether a reference points into
+ // the collection set or not. Each of the array's elements denotes whether the
+ // corresponding region is in the collection set or not.
+- G1FastCSetBiasedMappedArray _in_cset_fast_test;
++ G1InCSetStateFastTestBiasedMappedArray _in_cset_fast_test;
+
+ public:
+
+- inline in_cset_state_t in_cset_state(const oop obj);
++ inline InCSetState in_cset_state(const oop obj);
+
+ // Return "TRUE" iff the given object address is in the reserved
+ // region of g1.
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -35,6 +35,41 @@
+ #include "runtime/orderAccess.inline.hpp"
+ #include "utilities/taskqueue.hpp"
+
++PLABStats* G1CollectedHeap::alloc_buffer_stats(InCSetState dest) {
++ switch (dest.value()) {
++ case InCSetState::Young:
++ return &_survivor_plab_stats;
++ case InCSetState::Old:
++ return &_old_plab_stats;
++ default:
++ ShouldNotReachHere();
++ return NULL; // Keep some compilers happy
++ }
++}
++
++size_t G1CollectedHeap::desired_plab_sz(InCSetState dest) {
++ size_t gclab_word_size = alloc_buffer_stats(dest)->desired_plab_sz();
++ // Prevent humongous PLAB sizes for two reasons:
++ // * PLABs are allocated using a similar paths as oops, but should
++ // never be in a humongous region
++ // * Allowing humongous PLABs needlessly churns the region free lists
++ return MIN2(_humongous_object_threshold_in_words, gclab_word_size);
++}
++
++HeapWord* G1CollectedHeap::par_allocate_during_gc(InCSetState dest,
++ size_t word_size,
++ AllocationContext_t context) {
++ switch (dest.value()) {
++ case InCSetState::Young:
++ return survivor_attempt_allocation(word_size, context);
++ case InCSetState::Old:
++ return old_attempt_allocation(word_size, context);
++ default:
++ ShouldNotReachHere();
++ return NULL; // Keep some compilers happy
++ }
++}
++
+ // Inline functions for G1CollectedHeap
+
+ inline AllocationContextStats& G1CollectedHeap::allocation_context_stats() {
+@@ -96,8 +131,8 @@
+ }
+
+ inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size,
+- unsigned int* gc_count_before_ret,
+- int* gclocker_retry_count_ret) {
++ uint* gc_count_before_ret,
++ uint* gclocker_retry_count_ret) {
+ assert_heap_not_locked_and_not_at_safepoint();
+ assert(!isHumongous(word_size), "attempt_allocation() should not "
+ "be called for humongous allocation requests");
+@@ -203,7 +238,7 @@
+ return _in_cset_fast_test.is_in_cset_or_humongous((HeapWord*)obj);
+ }
+
+-G1CollectedHeap::in_cset_state_t G1CollectedHeap::in_cset_state(const oop obj) {
++InCSetState G1CollectedHeap::in_cset_state(const oop obj) {
+ return _in_cset_fast_test.at((HeapWord*)obj);
+ }
+
+@@ -313,20 +348,30 @@
+ return is_obj_ill(obj, heap_region_containing(obj));
+ }
+
++inline void G1CollectedHeap::set_humongous_reclaim_candidate(uint region, bool value) {
++ assert(_hrm.at(region)->startsHumongous(), "Must start a humongous object");
++ _humongous_reclaim_candidates.set_candidate(region, value);
++}
++
++inline bool G1CollectedHeap::is_humongous_reclaim_candidate(uint region) {
++ assert(_hrm.at(region)->startsHumongous(), "Must start a humongous object");
++ return _humongous_reclaim_candidates.is_candidate(region);
++}
++
+ inline void G1CollectedHeap::set_humongous_is_live(oop obj) {
+ uint region = addr_to_region((HeapWord*)obj);
+- // We not only set the "live" flag in the humongous_is_live table, but also
++ // Clear the flag in the humongous_reclaim_candidates table. Also
+ // reset the entry in the _in_cset_fast_test table so that subsequent references
+ // to the same humongous object do not go into the slow path again.
+ // This is racy, as multiple threads may at the same time enter here, but this
+ // is benign.
+- // During collection we only ever set the "live" flag, and only ever clear the
++ // During collection we only ever clear the "candidate" flag, and only ever clear the
+ // entry in the in_cset_fast_table.
+ // We only ever evaluate the contents of these tables (in the VM thread) after
+ // having synchronized the worker threads with the VM thread, or in the same
+ // thread (i.e. within the VM thread).
+- if (!_humongous_is_live.is_live(region)) {
+- _humongous_is_live.set_live(region);
++ if (is_humongous_reclaim_candidate(region)) {
++ set_humongous_reclaim_candidate(region, false);
+ _in_cset_fast_test.clear_humongous(region);
+ }
+ }
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1084,7 +1084,7 @@
+ if (update_stats) {
+ double cost_per_card_ms = 0.0;
+ if (_pending_cards > 0) {
+- cost_per_card_ms = phase_times()->average_last_update_rs_time() / (double) _pending_cards;
++ cost_per_card_ms = phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS) / (double) _pending_cards;
+ _cost_per_card_ms_seq->add(cost_per_card_ms);
+ }
+
+@@ -1092,7 +1092,7 @@
+
+ double cost_per_entry_ms = 0.0;
+ if (cards_scanned > 10) {
+- cost_per_entry_ms = phase_times()->average_last_scan_rs_time() / (double) cards_scanned;
++ cost_per_entry_ms = phase_times()->average_time_ms(G1GCPhaseTimes::ScanRS) / (double) cards_scanned;
+ if (_last_gc_was_young) {
+ _cost_per_entry_ms_seq->add(cost_per_entry_ms);
+ } else {
+@@ -1134,7 +1134,7 @@
+ double cost_per_byte_ms = 0.0;
+
+ if (copied_bytes > 0) {
+- cost_per_byte_ms = phase_times()->average_last_obj_copy_time() / (double) copied_bytes;
++ cost_per_byte_ms = phase_times()->average_time_ms(G1GCPhaseTimes::ObjCopy) / (double) copied_bytes;
+ if (_in_marking_window) {
+ _cost_per_byte_ms_during_cm_seq->add(cost_per_byte_ms);
+ } else {
+@@ -1143,8 +1143,8 @@
+ }
+
+ double all_other_time_ms = pause_time_ms -
+- (phase_times()->average_last_update_rs_time() + phase_times()->average_last_scan_rs_time()
+- + phase_times()->average_last_obj_copy_time() + phase_times()->average_last_termination_time());
++ (phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS) + phase_times()->average_time_ms(G1GCPhaseTimes::ScanRS) +
++ phase_times()->average_time_ms(G1GCPhaseTimes::ObjCopy) + phase_times()->average_time_ms(G1GCPhaseTimes::Termination));
+
+ double young_other_time_ms = 0.0;
+ if (young_cset_region_length() > 0) {
+@@ -1185,8 +1185,8 @@
+
+ // Note that _mmu_tracker->max_gc_time() returns the time in seconds.
+ double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
+- adjust_concurrent_refinement(phase_times()->average_last_update_rs_time(),
+- phase_times()->sum_last_update_rs_processed_buffers(), update_rs_time_goal_ms);
++ adjust_concurrent_refinement(phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS),
++ phase_times()->sum_thread_work_items(G1GCPhaseTimes::UpdateRS), update_rs_time_goal_ms);
+
+ _collectionSetChooser->verify();
+ }
+@@ -1437,18 +1437,6 @@
+ return young_list_length < young_list_max_length;
+ }
+
+-uint G1CollectorPolicy::max_regions(int purpose) {
+- switch (purpose) {
+- case GCAllocForSurvived:
+- return _max_survivor_regions;
+- case GCAllocForTenured:
+- return REGIONS_UNLIMITED;
+- default:
+- ShouldNotReachHere();
+- return REGIONS_UNLIMITED;
+- };
+-}
+-
+ void G1CollectorPolicy::update_max_gc_locker_expansion() {
+ uint expansion_region_num = 0;
+ if (GCLockerEdenExpansionPercent > 0) {
+@@ -1683,7 +1671,7 @@
+ hr->set_next_in_collection_set(_collection_set);
+ _collection_set = hr;
+ _collection_set_bytes_used_before += hr->used();
+- _g1->register_region_with_in_cset_fast_test(hr);
++ _g1->register_old_region_with_in_cset_fast_test(hr);
+ size_t rs_length = hr->rem_set()->occupied();
+ _recorded_rs_lengths += rs_length;
+ _old_cset_region_length += 1;
+@@ -1816,7 +1804,7 @@
+ hr->set_in_collection_set(true);
+ assert( hr->next_in_collection_set() == NULL, "invariant");
+
+- _g1->register_region_with_in_cset_fast_test(hr);
++ _g1->register_young_region_with_in_cset_fast_test(hr);
+ }
+
+ // Add the region at the RHS of the incremental cset
+@@ -2189,19 +2177,19 @@
+ _other.add(pause_time_ms - phase_times->accounted_time_ms());
+ _root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms());
+ _parallel.add(phase_times->cur_collection_par_time_ms());
+- _ext_root_scan.add(phase_times->average_last_ext_root_scan_time());
+- _satb_filtering.add(phase_times->average_last_satb_filtering_times_ms());
+- _update_rs.add(phase_times->average_last_update_rs_time());
+- _scan_rs.add(phase_times->average_last_scan_rs_time());
+- _obj_copy.add(phase_times->average_last_obj_copy_time());
+- _termination.add(phase_times->average_last_termination_time());
++ _ext_root_scan.add(phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan));
++ _satb_filtering.add(phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering));
++ _update_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS));
++ _scan_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::ScanRS));
++ _obj_copy.add(phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy));
++ _termination.add(phase_times->average_time_ms(G1GCPhaseTimes::Termination));
+
+- double parallel_known_time = phase_times->average_last_ext_root_scan_time() +
+- phase_times->average_last_satb_filtering_times_ms() +
+- phase_times->average_last_update_rs_time() +
+- phase_times->average_last_scan_rs_time() +
+- phase_times->average_last_obj_copy_time() +
+- + phase_times->average_last_termination_time();
++ double parallel_known_time = phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan) +
++ phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering) +
++ phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS) +
++ phase_times->average_time_ms(G1GCPhaseTimes::ScanRS) +
++ phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy) +
++ phase_times->average_time_ms(G1GCPhaseTimes::Termination);
+
+ double parallel_other_time = phase_times->cur_collection_par_time_ms() - parallel_known_time;
+ _parallel_other.add(parallel_other_time);
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -877,28 +877,20 @@
+ public:
+ uint tenuring_threshold() const { return _tenuring_threshold; }
+
+- inline GCAllocPurpose
+- evacuation_destination(HeapRegion* src_region, uint age, size_t word_sz) {
+- if (age < _tenuring_threshold && src_region->is_young()) {
+- return GCAllocForSurvived;
+- } else {
+- return GCAllocForTenured;
+- }
+- }
+-
+- inline bool track_object_age(GCAllocPurpose purpose) {
+- return purpose == GCAllocForSurvived;
+- }
+-
+ static const uint REGIONS_UNLIMITED = (uint) -1;
+
+- uint max_regions(int purpose);
+-
+- // The limit on regions for a particular purpose is reached.
+- void note_alloc_region_limit_reached(int purpose) {
+- if (purpose == GCAllocForSurvived) {
+- _tenuring_threshold = 0;
++ uint max_regions(InCSetState dest) {
++ switch (dest.value()) {
++ case InCSetState::Young:
++ return _max_survivor_regions;
++ case InCSetState::Old:
++ return REGIONS_UNLIMITED;
++ default:
++ assert(false, err_msg("Unknown dest state: " CSETSTATE_FORMAT, dest.value()));
++ break;
+ }
++ // keep some compilers happy
++ return 0;
+ }
+
+ void note_start_adding_survivor_regions() {
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -22,12 +22,13 @@
+ *
+ */
+
+-
+ #include "precompiled.hpp"
+ #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+ #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
+ #include "gc_implementation/g1/g1Log.hpp"
+ #include "gc_implementation/g1/g1StringDedup.hpp"
++#include "memory/allocation.hpp"
++#include "runtime/os.hpp"
+
+ // Helper class for avoiding interleaved logging
+ class LineBuffer: public StackObj {
+@@ -70,184 +71,258 @@
+ va_end(ap);
+ }
+
++ void print_cr() {
++ gclog_or_tty->print_cr("%s", _buffer);
++ _cur = _indent_level * INDENT_CHARS;
++ }
++
+ void append_and_print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
+ va_list ap;
+ va_start(ap, format);
+ vappend(format, ap);
+ va_end(ap);
+- gclog_or_tty->print_cr("%s", _buffer);
+- _cur = _indent_level * INDENT_CHARS;
++ print_cr();
+ }
+ };
+
+-PRAGMA_DIAG_PUSH
+-PRAGMA_FORMAT_NONLITERAL_IGNORED
+ template <class T>
+-void WorkerDataArray<T>::print(int level, const char* title) {
+- if (_length == 1) {
+- // No need for min, max, average and sum for only one worker
+- LineBuffer buf(level);
+- buf.append("[%s: ", title);
+- buf.append(_print_format, _data[0]);
+- buf.append_and_print_cr("]");
+- return;
++class WorkerDataArray : public CHeapObj<mtGC> {
++ friend class G1GCParPhasePrinter;
++ T* _data;
++ uint _length;
++ const char* _title;
++ bool _print_sum;
++ int _log_level;
++ uint _indent_level;
++ bool _enabled;
++
++ WorkerDataArray<size_t>* _thread_work_items;
++
++ NOT_PRODUCT(T uninitialized();)
++
++ // We are caching the sum and average to only have to calculate them once.
++ // This is not done in an MT-safe way. It is intended to allow single
++ // threaded code to call sum() and average() multiple times in any order
++ // without having to worry about the cost.
++ bool _has_new_data;
++ T _sum;
++ T _min;
++ T _max;
++ double _average;
++
++ public:
++ WorkerDataArray(uint length, const char* title, bool print_sum, int log_level, uint indent_level) :
++ _title(title), _length(0), _print_sum(print_sum), _log_level(log_level), _indent_level(indent_level),
++ _has_new_data(true), _thread_work_items(NULL), _enabled(true) {
++ assert(length > 0, "Must have some workers to store data for");
++ _length = length;
++ _data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
+ }
+
+- T min = _data[0];
+- T max = _data[0];
+- T sum = 0;
+-
+- LineBuffer buf(level);
+- buf.append("[%s:", title);
+- for (uint i = 0; i < _length; ++i) {
+- T val = _data[i];
+- min = MIN2(val, min);
+- max = MAX2(val, max);
+- sum += val;
+- if (G1Log::finest()) {
+- buf.append(" ");
+- buf.append(_print_format, val);
+- }
++ ~WorkerDataArray() {
++ FREE_C_HEAP_ARRAY(T, _data, mtGC);
+ }
+
+- if (G1Log::finest()) {
+- buf.append_and_print_cr("%s", "");
++ void link_thread_work_items(WorkerDataArray<size_t>* thread_work_items) {
++ _thread_work_items = thread_work_items;
+ }
+
+- double avg = (double)sum / (double)_length;
+- buf.append(" Min: ");
+- buf.append(_print_format, min);
+- buf.append(", Avg: ");
+- buf.append("%.1lf", avg); // Always print average as a double
+- buf.append(", Max: ");
+- buf.append(_print_format, max);
+- buf.append(", Diff: ");
+- buf.append(_print_format, max - min);
+- if (_print_sum) {
+- // for things like the start and end times the sum is not
+- // that relevant
+- buf.append(", Sum: ");
+- buf.append(_print_format, sum);
++ WorkerDataArray<size_t>* thread_work_items() { return _thread_work_items; }
++
++ void set(uint worker_i, T value) {
++ assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
++ assert(_data[worker_i] == WorkerDataArray<T>::uninitialized(), err_msg("Overwriting data for worker %d in %s", worker_i, _title));
++ _data[worker_i] = value;
++ _has_new_data = true;
+ }
+- buf.append_and_print_cr("]");
+-}
+-PRAGMA_DIAG_POP
++
++ void set_thread_work_item(uint worker_i, size_t value) {
++ assert(_thread_work_items != NULL, "No sub count");
++ _thread_work_items->set(worker_i, value);
++ }
++
++ T get(uint worker_i) {
++ assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
++ assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data added for worker %d", worker_i));
++ return _data[worker_i];
++ }
++
++ void add(uint worker_i, T value) {
++ assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
++ assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data to add to for worker %d", worker_i));
++ _data[worker_i] += value;
++ _has_new_data = true;
++ }
++
++ double average(){
++ calculate_totals();
++ return _average;
++ }
++
++ T sum() {
++ calculate_totals();
++ return _sum;
++ }
++
++ T minimum() {
++ calculate_totals();
++ return _min;
++ }
++
++ T maximum() {
++ calculate_totals();
++ return _max;
++ }
++
++ void reset() PRODUCT_RETURN;
++ void verify() PRODUCT_RETURN;
++
++ void set_enabled(bool enabled) { _enabled = enabled; }
++
++ int log_level() { return _log_level; }
++
++ private:
++
++ void calculate_totals(){
++ if (!_has_new_data) {
++ return;
++ }
++
++ _sum = (T)0;
++ _min = _data[0];
++ _max = _min;
++ for (uint i = 0; i < _length; ++i) {
++ T val = _data[i];
++ _sum += val;
++ _min = MIN2(_min, val);
++ _max = MAX2(_max, val);
++ }
++ _average = (double)_sum / (double)_length;
++ _has_new_data = false;
++ }
++};
++
+
+ #ifndef PRODUCT
+
+-template <> const int WorkerDataArray<int>::_uninitialized = -1;
+-template <> const double WorkerDataArray<double>::_uninitialized = -1.0;
+-template <> const size_t WorkerDataArray<size_t>::_uninitialized = (size_t)-1;
++template <>
++size_t WorkerDataArray<size_t>::uninitialized() {
++ return (size_t)-1;
++}
++
++template <>
++double WorkerDataArray<double>::uninitialized() {
++ return -1.0;
++}
+
+ template <class T>
+ void WorkerDataArray<T>::reset() {
+ for (uint i = 0; i < _length; i++) {
+- _data[i] = (T)_uninitialized;
++ _data[i] = WorkerDataArray<T>::uninitialized();
++ }
++ if (_thread_work_items != NULL) {
++ _thread_work_items->reset();
+ }
+ }
+
+ template <class T>
+ void WorkerDataArray<T>::verify() {
++ if (!_enabled) {
++ return;
++ }
++
+ for (uint i = 0; i < _length; i++) {
+- assert(_data[i] != _uninitialized,
+- err_msg("Invalid data for worker " UINT32_FORMAT ", data: %lf, uninitialized: %lf",
+- i, (double)_data[i], (double)_uninitialized));
++ assert(_data[i] != WorkerDataArray<T>::uninitialized(),
++ err_msg("Invalid data for worker %u in '%s'", i, _title));
++ }
++ if (_thread_work_items != NULL) {
++ _thread_work_items->verify();
+ }
+ }
+
+ #endif
+
+ G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) :
+- _max_gc_threads(max_gc_threads),
+- _last_gc_worker_start_times_ms(_max_gc_threads, "%.1lf", false),
+- _last_ext_root_scan_times_ms(_max_gc_threads, "%.1lf"),
+- _last_satb_filtering_times_ms(_max_gc_threads, "%.1lf"),
+- _last_update_rs_times_ms(_max_gc_threads, "%.1lf"),
+- _last_update_rs_processed_buffers(_max_gc_threads, "%d"),
+- _last_scan_rs_times_ms(_max_gc_threads, "%.1lf"),
+- _last_strong_code_root_scan_times_ms(_max_gc_threads, "%.1lf"),
+- _last_obj_copy_times_ms(_max_gc_threads, "%.1lf"),
+- _last_termination_times_ms(_max_gc_threads, "%.1lf"),
+- _last_termination_attempts(_max_gc_threads, SIZE_FORMAT),
+- _last_gc_worker_end_times_ms(_max_gc_threads, "%.1lf", false),
+- _last_gc_worker_times_ms(_max_gc_threads, "%.1lf"),
+- _last_gc_worker_other_times_ms(_max_gc_threads, "%.1lf"),
+- _last_redirty_logged_cards_time_ms(_max_gc_threads, "%.1lf"),
+- _last_redirty_logged_cards_processed_cards(_max_gc_threads, SIZE_FORMAT),
+- _cur_string_dedup_queue_fixup_worker_times_ms(_max_gc_threads, "%.1lf"),
+- _cur_string_dedup_table_fixup_worker_times_ms(_max_gc_threads, "%.1lf")
++ _max_gc_threads(max_gc_threads)
+ {
+ assert(max_gc_threads > 0, "Must have some GC threads");
++
++ _gc_par_phases[GCWorkerStart] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Start (ms)", false, G1Log::LevelFiner, 2);
++ _gc_par_phases[ExtRootScan] = new WorkerDataArray<double>(max_gc_threads, "Ext Root Scanning (ms)", true, G1Log::LevelFiner, 2);
++
++ // Root scanning phases
++ _gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[StringTableRoots] = new WorkerDataArray<double>(max_gc_threads, "StringTable Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[FlatProfilerRoots] = new WorkerDataArray<double>(max_gc_threads, "FlatProfiler Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[CLDGRoots] = new WorkerDataArray<double>(max_gc_threads, "CLDG Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[JVMTIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMTI Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[CodeCacheRoots] = new WorkerDataArray<double>(max_gc_threads, "CodeCache Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[CMRefRoots] = new WorkerDataArray<double>(max_gc_threads, "CM RefProcessor Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong CLD (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[WeakCLDRoots] = new WorkerDataArray<double>(max_gc_threads, "Weak CLD Roots (ms)", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[SATBFiltering] = new WorkerDataArray<double>(max_gc_threads, "SATB Filtering (ms)", true, G1Log::LevelFinest, 3);
++
++ _gc_par_phases[UpdateRS] = new WorkerDataArray<double>(max_gc_threads, "Update RS (ms)", true, G1Log::LevelFiner, 2);
++ _gc_par_phases[ScanRS] = new WorkerDataArray<double>(max_gc_threads, "Scan RS (ms)", true, G1Log::LevelFiner, 2);
++ _gc_par_phases[CodeRoots] = new WorkerDataArray<double>(max_gc_threads, "Code Root Scanning (ms)", true, G1Log::LevelFiner, 2);
++ _gc_par_phases[ObjCopy] = new WorkerDataArray<double>(max_gc_threads, "Object Copy (ms)", true, G1Log::LevelFiner, 2);
++ _gc_par_phases[Termination] = new WorkerDataArray<double>(max_gc_threads, "Termination (ms)", true, G1Log::LevelFiner, 2);
++ _gc_par_phases[GCWorkerTotal] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Total (ms)", true, G1Log::LevelFiner, 2);
++ _gc_par_phases[GCWorkerEnd] = new WorkerDataArray<double>(max_gc_threads, "GC Worker End (ms)", false, G1Log::LevelFiner, 2);
++ _gc_par_phases[Other] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Other (ms)", true, G1Log::LevelFiner, 2);
++
++ _update_rs_processed_buffers = new WorkerDataArray<size_t>(max_gc_threads, "Processed Buffers", true, G1Log::LevelFiner, 3);
++ _gc_par_phases[UpdateRS]->link_thread_work_items(_update_rs_processed_buffers);
++
++ _termination_attempts = new WorkerDataArray<size_t>(max_gc_threads, "Termination Attempts", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[Termination]->link_thread_work_items(_termination_attempts);
++
++ _gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray<double>(max_gc_threads, "Queue Fixup (ms)", true, G1Log::LevelFiner, 2);
++ _gc_par_phases[StringDedupTableFixup] = new WorkerDataArray<double>(max_gc_threads, "Table Fixup (ms)", true, G1Log::LevelFiner, 2);
++
++ _gc_par_phases[RedirtyCards] = new WorkerDataArray<double>(max_gc_threads, "Parallel Redirty", true, G1Log::LevelFinest, 3);
++ _redirtied_cards = new WorkerDataArray<size_t>(max_gc_threads, "Redirtied Cards", true, G1Log::LevelFinest, 3);
++ _gc_par_phases[RedirtyCards]->link_thread_work_items(_redirtied_cards);
+ }
+
+-void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) {
++void G1GCPhaseTimes::note_gc_start(uint active_gc_threads, bool mark_in_progress) {
+ 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 nubmer of threads");
++ assert(active_gc_threads <= _max_gc_threads, "The number of active threads must be <= the max number of threads");
+ _active_gc_threads = active_gc_threads;
+
+- _last_gc_worker_start_times_ms.reset();
+- _last_ext_root_scan_times_ms.reset();
+- _last_satb_filtering_times_ms.reset();
+- _last_update_rs_times_ms.reset();
+- _last_update_rs_processed_buffers.reset();
+- _last_scan_rs_times_ms.reset();
+- _last_strong_code_root_scan_times_ms.reset();
+- _last_obj_copy_times_ms.reset();
+- _last_termination_times_ms.reset();
+- _last_termination_attempts.reset();
+- _last_gc_worker_end_times_ms.reset();
+- _last_gc_worker_times_ms.reset();
+- _last_gc_worker_other_times_ms.reset();
++ for (int i = 0; i < GCParPhasesSentinel; i++) {
++ _gc_par_phases[i]->reset();
++ }
+
+- _last_redirty_logged_cards_time_ms.reset();
+- _last_redirty_logged_cards_processed_cards.reset();
+-
++ _gc_par_phases[StringDedupQueueFixup]->set_enabled(G1StringDedup::is_enabled());
++ _gc_par_phases[StringDedupTableFixup]->set_enabled(G1StringDedup::is_enabled());
+ }
+
+ void G1GCPhaseTimes::note_gc_end() {
+- _last_gc_worker_start_times_ms.verify();
+- _last_ext_root_scan_times_ms.verify();
+- _last_satb_filtering_times_ms.verify();
+- _last_update_rs_times_ms.verify();
+- _last_update_rs_processed_buffers.verify();
+- _last_scan_rs_times_ms.verify();
+- _last_strong_code_root_scan_times_ms.verify();
+- _last_obj_copy_times_ms.verify();
+- _last_termination_times_ms.verify();
+- _last_termination_attempts.verify();
+- _last_gc_worker_end_times_ms.verify();
++ 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);
+
+- for (uint i = 0; i < _active_gc_threads; i++) {
+- double worker_time = _last_gc_worker_end_times_ms.get(i) - _last_gc_worker_start_times_ms.get(i);
+- _last_gc_worker_times_ms.set(i, worker_time);
++ double worker_known_time =
++ _gc_par_phases[ExtRootScan]->get(i) +
++ _gc_par_phases[SATBFiltering]->get(i) +
++ _gc_par_phases[UpdateRS]->get(i) +
++ _gc_par_phases[ScanRS]->get(i) +
++ _gc_par_phases[CodeRoots]->get(i) +
++ _gc_par_phases[ObjCopy]->get(i) +
++ _gc_par_phases[Termination]->get(i);
+
+- double worker_known_time = _last_ext_root_scan_times_ms.get(i) +
+- _last_satb_filtering_times_ms.get(i) +
+- _last_update_rs_times_ms.get(i) +
+- _last_scan_rs_times_ms.get(i) +
+- _last_strong_code_root_scan_times_ms.get(i) +
+- _last_obj_copy_times_ms.get(i) +
+- _last_termination_times_ms.get(i);
+-
+- double worker_other_time = worker_time - worker_known_time;
+- _last_gc_worker_other_times_ms.set(i, worker_other_time);
++ record_time_secs(Other, i, worker_time - worker_known_time);
+ }
+
+- _last_gc_worker_times_ms.verify();
+- _last_gc_worker_other_times_ms.verify();
+-
+- _last_redirty_logged_cards_time_ms.verify();
+- _last_redirty_logged_cards_processed_cards.verify();
+-}
+-
+-void G1GCPhaseTimes::note_string_dedup_fixup_start() {
+- _cur_string_dedup_queue_fixup_worker_times_ms.reset();
+- _cur_string_dedup_table_fixup_worker_times_ms.reset();
+-}
+-
+-void G1GCPhaseTimes::note_string_dedup_fixup_end() {
+- _cur_string_dedup_queue_fixup_worker_times_ms.verify();
+- _cur_string_dedup_table_fixup_worker_times_ms.verify();
++ for (int i = 0; i < GCParPhasesSentinel; i++) {
++ _gc_par_phases[i]->verify();
++ }
+ }
+
+ void G1GCPhaseTimes::print_stats(int level, const char* str, double value) {
+@@ -259,7 +334,7 @@
+ }
+
+ void G1GCPhaseTimes::print_stats(int level, const char* str, double value, uint workers) {
+- LineBuffer(level).append_and_print_cr("[%s: %.1lf ms, GC Workers: " UINT32_FORMAT "]", str, value, workers);
++ LineBuffer(level).append_and_print_cr("[%s: %.1lf ms, GC Workers: %u]", str, value, workers);
+ }
+
+ double G1GCPhaseTimes::accounted_time_ms() {
+@@ -287,46 +362,172 @@
+ return misc_time_ms;
+ }
+
++// record the time a phase took in seconds
++void G1GCPhaseTimes::record_time_secs(GCParPhases phase, uint worker_i, double secs) {
++ _gc_par_phases[phase]->set(worker_i, secs);
++}
++
++// add a number of seconds to a phase
++void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_i, double secs) {
++ _gc_par_phases[phase]->add(worker_i, secs);
++}
++
++void G1GCPhaseTimes::record_thread_work_item(GCParPhases phase, uint worker_i, size_t count) {
++ _gc_par_phases[phase]->set_thread_work_item(worker_i, count);
++}
++
++// return the average time for a phase in milliseconds
++double G1GCPhaseTimes::average_time_ms(GCParPhases phase) {
++ return _gc_par_phases[phase]->average() * 1000.0;
++}
++
++double G1GCPhaseTimes::get_time_ms(GCParPhases phase, uint worker_i) {
++ return _gc_par_phases[phase]->get(worker_i) * 1000.0;
++}
++
++double G1GCPhaseTimes::sum_time_ms(GCParPhases phase) {
++ return _gc_par_phases[phase]->sum() * 1000.0;
++}
++
++double G1GCPhaseTimes::min_time_ms(GCParPhases phase) {
++ return _gc_par_phases[phase]->minimum() * 1000.0;
++}
++
++double G1GCPhaseTimes::max_time_ms(GCParPhases phase) {
++ return _gc_par_phases[phase]->maximum() * 1000.0;
++}
++
++size_t G1GCPhaseTimes::get_thread_work_item(GCParPhases phase, uint worker_i) {
++ assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
++ return _gc_par_phases[phase]->thread_work_items()->get(worker_i);
++}
++
++size_t G1GCPhaseTimes::sum_thread_work_items(GCParPhases phase) {
++ assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
++ return _gc_par_phases[phase]->thread_work_items()->sum();
++}
++
++double G1GCPhaseTimes::average_thread_work_items(GCParPhases phase) {
++ assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
++ return _gc_par_phases[phase]->thread_work_items()->average();
++}
++
++size_t G1GCPhaseTimes::min_thread_work_items(GCParPhases phase) {
++ assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
++ return _gc_par_phases[phase]->thread_work_items()->minimum();
++}
++
++size_t G1GCPhaseTimes::max_thread_work_items(GCParPhases phase) {
++ assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
++ return _gc_par_phases[phase]->thread_work_items()->maximum();
++}
++
++class G1GCParPhasePrinter : public StackObj {
++ G1GCPhaseTimes* _phase_times;
++ public:
++ G1GCParPhasePrinter(G1GCPhaseTimes* phase_times) : _phase_times(phase_times) {}
++
++ void print(G1GCPhaseTimes::GCParPhases phase_id) {
++ WorkerDataArray<double>* phase = _phase_times->_gc_par_phases[phase_id];
++
++ if (phase->_log_level > G1Log::level() || !phase->_enabled) {
++ return;
++ }
++
++ if (phase->_length == 1) {
++ print_single_length(phase_id, phase);
++ } else {
++ print_multi_length(phase_id, phase);
++ }
++ }
++
++ private:
++
++ void print_single_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
++ // No need for min, max, average and sum for only one worker
++ LineBuffer buf(phase->_indent_level);
++ buf.append_and_print_cr("[%s: %.1lf]", phase->_title, _phase_times->get_time_ms(phase_id, 0));
++
++ if (phase->_thread_work_items != NULL) {
++ LineBuffer buf2(phase->_thread_work_items->_indent_level);
++ buf2.append_and_print_cr("[%s: "SIZE_FORMAT"]", phase->_thread_work_items->_title, _phase_times->sum_thread_work_items(phase_id));
++ }
++ }
++
++ void print_time_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
++ for (uint i = 0; i < phase->_length; ++i) {
++ buf.append(" %.1lf", _phase_times->get_time_ms(phase_id, i));
++ }
++ buf.print_cr();
++ }
++
++ void print_count_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<size_t>* thread_work_items) {
++ for (uint i = 0; i < thread_work_items->_length; ++i) {
++ buf.append(" " SIZE_FORMAT, _phase_times->get_thread_work_item(phase_id, i));
++ }
++ buf.print_cr();
++ }
++
++ void print_thread_work_items(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<size_t>* thread_work_items) {
++ LineBuffer buf(thread_work_items->_indent_level);
++ buf.append("[%s:", thread_work_items->_title);
++
++ if (G1Log::finest()) {
++ print_count_values(buf, phase_id, thread_work_items);
++ }
++
++ assert(thread_work_items->_print_sum, err_msg("%s does not have print sum true even though it is a count", thread_work_items->_title));
++
++ buf.append_and_print_cr(" Min: " SIZE_FORMAT ", Avg: %.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT "]",
++ _phase_times->min_thread_work_items(phase_id), _phase_times->average_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id),
++ _phase_times->max_thread_work_items(phase_id) - _phase_times->min_thread_work_items(phase_id), _phase_times->sum_thread_work_items(phase_id));
++ }
++
++ void print_multi_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
++ LineBuffer buf(phase->_indent_level);
++ buf.append("[%s:", phase->_title);
++
++ if (G1Log::finest()) {
++ print_time_values(buf, phase_id, phase);
++ }
++
++ buf.append(" Min: %.1lf, Avg: %.1lf, Max: %.1lf, Diff: %.1lf",
++ _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id),
++ _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id));
++
++ if (phase->_print_sum) {
++ // for things like the start and end times the sum is not
++ // that relevant
++ buf.append(", Sum: %.1lf", _phase_times->sum_time_ms(phase_id));
++ }
++
++ buf.append_and_print_cr("]");
++
++ if (phase->_thread_work_items != NULL) {
++ print_thread_work_items(phase_id, phase->_thread_work_items);
++ }
++ }
++};
++
+ void G1GCPhaseTimes::print(double pause_time_sec) {
++ G1GCParPhasePrinter par_phase_printer(this);
++
+ if (_root_region_scan_wait_time_ms > 0.0) {
+ print_stats(1, "Root Region Scan Waiting", _root_region_scan_wait_time_ms);
+ }
+- if (G1CollectedHeap::use_parallel_gc_threads()) {
+- print_stats(1, "Parallel Time", _cur_collection_par_time_ms, _active_gc_threads);
+- _last_gc_worker_start_times_ms.print(2, "GC Worker Start (ms)");
+- _last_ext_root_scan_times_ms.print(2, "Ext Root Scanning (ms)");
+- if (_last_satb_filtering_times_ms.sum() > 0.0) {
+- _last_satb_filtering_times_ms.print(2, "SATB Filtering (ms)");
+- }
+- _last_update_rs_times_ms.print(2, "Update RS (ms)");
+- _last_update_rs_processed_buffers.print(3, "Processed Buffers");
+- _last_scan_rs_times_ms.print(2, "Scan RS (ms)");
+- _last_strong_code_root_scan_times_ms.print(2, "Code Root Scanning (ms)");
+- _last_obj_copy_times_ms.print(2, "Object Copy (ms)");
+- _last_termination_times_ms.print(2, "Termination (ms)");
+- if (G1Log::finest()) {
+- _last_termination_attempts.print(3, "Termination Attempts");
+- }
+- _last_gc_worker_other_times_ms.print(2, "GC Worker Other (ms)");
+- _last_gc_worker_times_ms.print(2, "GC Worker Total (ms)");
+- _last_gc_worker_end_times_ms.print(2, "GC Worker End (ms)");
+- } else {
+- _last_ext_root_scan_times_ms.print(1, "Ext Root Scanning (ms)");
+- if (_last_satb_filtering_times_ms.sum() > 0.0) {
+- _last_satb_filtering_times_ms.print(1, "SATB Filtering (ms)");
+- }
+- _last_update_rs_times_ms.print(1, "Update RS (ms)");
+- _last_update_rs_processed_buffers.print(2, "Processed Buffers");
+- _last_scan_rs_times_ms.print(1, "Scan RS (ms)");
+- _last_strong_code_root_scan_times_ms.print(1, "Code Root Scanning (ms)");
+- _last_obj_copy_times_ms.print(1, "Object Copy (ms)");
++
++ print_stats(1, "Parallel Time", _cur_collection_par_time_ms, _active_gc_threads);
++ for (int i = 0; i <= GCMainParPhasesLast; i++) {
++ par_phase_printer.print((GCParPhases) i);
+ }
++
+ print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms);
+ print_stats(1, "Code Root Purge", _cur_strong_code_root_purge_time_ms);
+ if (G1StringDedup::is_enabled()) {
+ print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads);
+- _cur_string_dedup_queue_fixup_worker_times_ms.print(2, "Queue Fixup (ms)");
+- _cur_string_dedup_table_fixup_worker_times_ms.print(2, "Table Fixup (ms)");
++ for (int i = StringDedupPhasesFirst; i <= StringDedupPhasesLast; i++) {
++ par_phase_printer.print((GCParPhases) i);
++ }
+ }
+ print_stats(1, "Clear CT", _cur_clear_ct_time_ms);
+ double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms();
+@@ -350,15 +551,16 @@
+ print_stats(2, "Ref Proc", _cur_ref_proc_time_ms);
+ print_stats(2, "Ref Enq", _cur_ref_enq_time_ms);
+ print_stats(2, "Redirty Cards", _recorded_redirty_logged_cards_time_ms);
+- if (G1Log::finest()) {
+- _last_redirty_logged_cards_time_ms.print(3, "Parallel Redirty");
+- _last_redirty_logged_cards_processed_cards.print(3, "Redirtied Cards");
+- }
+- if (G1ReclaimDeadHumongousObjectsAtYoungGC) {
+- print_stats(2, "Humongous Reclaim", _cur_fast_reclaim_humongous_time_ms);
++ par_phase_printer.print(RedirtyCards);
++
++ if (G1EagerReclaimHumongousObjects) {
++ print_stats(2, "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms);
+ if (G1Log::finest()) {
+ print_stats(3, "Humongous Total", _cur_fast_reclaim_humongous_total);
+ print_stats(3, "Humongous Candidate", _cur_fast_reclaim_humongous_candidates);
++ }
++ print_stats(2, "Humongous Reclaim", _cur_fast_reclaim_humongous_time_ms);
++ if (G1Log::finest()) {
+ print_stats(3, "Humongous Reclaimed", _cur_fast_reclaim_humongous_reclaimed);
+ }
+ }
+@@ -373,3 +575,17 @@
+ print_stats(2, "Verify After", _cur_verify_after_time_ms);
+ }
+ }
++
++G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
++ _phase_times(phase_times), _phase(phase), _worker_id(worker_id) {
++ if (_phase_times != NULL) {
++ _start_time = os::elapsedTime();
++ }
++}
++
++G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() {
++ if (_phase_times != NULL) {
++ _phase_times->record_time_secs(_phase, _worker_id, os::elapsedTime() - _start_time);
++ }
++}
++
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -26,106 +26,60 @@
+ #define SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
+
+ #include "memory/allocation.hpp"
+-#include "gc_interface/gcCause.hpp"
+
+-template <class T>
+-class WorkerDataArray : public CHeapObj<mtGC> {
+- T* _data;
+- uint _length;
+- const char* _print_format;
+- bool _print_sum;
++class LineBuffer;
+
+- NOT_PRODUCT(static const T _uninitialized;)
+-
+- // We are caching the sum and average to only have to calculate them once.
+- // This is not done in an MT-safe way. It is intended to allow single
+- // threaded code to call sum() and average() multiple times in any order
+- // without having to worry about the cost.
+- bool _has_new_data;
+- T _sum;
+- double _average;
+-
+- public:
+- WorkerDataArray(uint length, const char* print_format, bool print_sum = true) :
+- _length(length), _print_format(print_format), _print_sum(print_sum), _has_new_data(true) {
+- assert(length > 0, "Must have some workers to store data for");
+- _data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
+- }
+-
+- ~WorkerDataArray() {
+- FREE_C_HEAP_ARRAY(T, _data, mtGC);
+- }
+-
+- void set(uint worker_i, T value) {
+- assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+- assert(_data[worker_i] == (T)-1, err_msg("Overwriting data for worker %d", worker_i));
+- _data[worker_i] = value;
+- _has_new_data = true;
+- }
+-
+- T get(uint worker_i) {
+- assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+- assert(_data[worker_i] != (T)-1, err_msg("No data to add to for worker %d", worker_i));
+- return _data[worker_i];
+- }
+-
+- void add(uint worker_i, T value) {
+- assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
+- assert(_data[worker_i] != (T)-1, err_msg("No data to add to for worker %d", worker_i));
+- _data[worker_i] += value;
+- _has_new_data = true;
+- }
+-
+- double average(){
+- if (_has_new_data) {
+- calculate_totals();
+- }
+- return _average;
+- }
+-
+- T sum() {
+- if (_has_new_data) {
+- calculate_totals();
+- }
+- return _sum;
+- }
+-
+- void print(int level, const char* title);
+-
+- void reset() PRODUCT_RETURN;
+- void verify() PRODUCT_RETURN;
+-
+- private:
+-
+- void calculate_totals(){
+- _sum = (T)0;
+- for (uint i = 0; i < _length; ++i) {
+- _sum += _data[i];
+- }
+- _average = (double)_sum / (double)_length;
+- _has_new_data = false;
+- }
+-};
++template <class T> class WorkerDataArray;
+
+ class G1GCPhaseTimes : public CHeapObj<mtGC> {
++ friend class G1GCParPhasePrinter;
+
+- private:
+ uint _active_gc_threads;
+ uint _max_gc_threads;
+
+- WorkerDataArray<double> _last_gc_worker_start_times_ms;
+- WorkerDataArray<double> _last_ext_root_scan_times_ms;
+- WorkerDataArray<double> _last_satb_filtering_times_ms;
+- WorkerDataArray<double> _last_update_rs_times_ms;
+- WorkerDataArray<int> _last_update_rs_processed_buffers;
+- WorkerDataArray<double> _last_scan_rs_times_ms;
+- WorkerDataArray<double> _last_strong_code_root_scan_times_ms;
+- WorkerDataArray<double> _last_obj_copy_times_ms;
+- WorkerDataArray<double> _last_termination_times_ms;
+- WorkerDataArray<size_t> _last_termination_attempts;
+- WorkerDataArray<double> _last_gc_worker_end_times_ms;
+- WorkerDataArray<double> _last_gc_worker_times_ms;
+- WorkerDataArray<double> _last_gc_worker_other_times_ms;
++ public:
++ enum GCParPhases {
++ GCWorkerStart,
++ ExtRootScan,
++ ThreadRoots,
++ StringTableRoots,
++ UniverseRoots,
++ JNIRoots,
++ ObjectSynchronizerRoots,
++ FlatProfilerRoots,
++ ManagementRoots,
++ SystemDictionaryRoots,
++ CLDGRoots,
++ JVMTIRoots,
++ CodeCacheRoots,
++ CMRefRoots,
++ WaitForStrongCLD,
++ WeakCLDRoots,
++ SATBFiltering,
++ UpdateRS,
++ ScanRS,
++ CodeRoots,
++ ObjCopy,
++ Termination,
++ Other,
++ GCWorkerTotal,
++ GCWorkerEnd,
++ StringDedupQueueFixup,
++ StringDedupTableFixup,
++ RedirtyCards,
++ GCParPhasesSentinel
++ };
++
++ private:
++ // Markers for grouping the phases in the GCPhases enum above
++ static const int GCMainParPhasesLast = GCWorkerEnd;
++ static const int StringDedupPhasesFirst = StringDedupQueueFixup;
++ static const int StringDedupPhasesLast = StringDedupTableFixup;
++
++ WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
++ WorkerDataArray<size_t>* _update_rs_processed_buffers;
++ WorkerDataArray<size_t>* _termination_attempts;
++ WorkerDataArray<size_t>* _redirtied_cards;
+
+ double _cur_collection_par_time_ms;
+ double _cur_collection_code_root_fixup_time_ms;
+@@ -135,9 +89,7 @@
+ double _cur_evac_fail_restore_remsets;
+ double _cur_evac_fail_remove_self_forwards;
+
+- double _cur_string_dedup_fixup_time_ms;
+- WorkerDataArray<double> _cur_string_dedup_queue_fixup_worker_times_ms;
+- WorkerDataArray<double> _cur_string_dedup_table_fixup_worker_times_ms;
++ double _cur_string_dedup_fixup_time_ms;
+
+ double _cur_clear_ct_time_ms;
+ double _cur_ref_proc_time_ms;
+@@ -149,14 +101,13 @@
+ double _recorded_young_cset_choice_time_ms;
+ double _recorded_non_young_cset_choice_time_ms;
+
+- WorkerDataArray<double> _last_redirty_logged_cards_time_ms;
+- WorkerDataArray<size_t> _last_redirty_logged_cards_processed_cards;
+ double _recorded_redirty_logged_cards_time_ms;
+
+ double _recorded_young_free_cset_time_ms;
+ double _recorded_non_young_free_cset_time_ms;
+
+ double _cur_fast_reclaim_humongous_time_ms;
++ double _cur_fast_reclaim_humongous_register_time_ms;
+ size_t _cur_fast_reclaim_humongous_total;
+ size_t _cur_fast_reclaim_humongous_candidates;
+ size_t _cur_fast_reclaim_humongous_reclaimed;
+@@ -171,54 +122,34 @@
+
+ public:
+ G1GCPhaseTimes(uint max_gc_threads);
+- void note_gc_start(uint active_gc_threads);
++ void note_gc_start(uint active_gc_threads, bool mark_in_progress);
+ void note_gc_end();
+ void print(double pause_time_sec);
+
+- void record_gc_worker_start_time(uint worker_i, double ms) {
+- _last_gc_worker_start_times_ms.set(worker_i, ms);
+- }
++ // record the time a phase took in seconds
++ void record_time_secs(GCParPhases phase, uint worker_i, double secs);
+
+- void record_ext_root_scan_time(uint worker_i, double ms) {
+- _last_ext_root_scan_times_ms.set(worker_i, ms);
+- }
++ // add a number of seconds to a phase
++ void add_time_secs(GCParPhases phase, uint worker_i, double secs);
+
+- void record_satb_filtering_time(uint worker_i, double ms) {
+- _last_satb_filtering_times_ms.set(worker_i, ms);
+- }
++ void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count);
+
+- void record_update_rs_time(uint worker_i, double ms) {
+- _last_update_rs_times_ms.set(worker_i, ms);
+- }
++ // return the average time for a phase in milliseconds
++ double average_time_ms(GCParPhases phase);
+
+- void record_update_rs_processed_buffers(uint worker_i, int processed_buffers) {
+- _last_update_rs_processed_buffers.set(worker_i, processed_buffers);
+- }
++ size_t sum_thread_work_items(GCParPhases phase);
+
+- void record_scan_rs_time(uint worker_i, double ms) {
+- _last_scan_rs_times_ms.set(worker_i, ms);
+- }
++ private:
++ double get_time_ms(GCParPhases phase, uint worker_i);
++ double sum_time_ms(GCParPhases phase);
++ double min_time_ms(GCParPhases phase);
++ double max_time_ms(GCParPhases phase);
++ size_t get_thread_work_item(GCParPhases phase, uint worker_i);
++ double average_thread_work_items(GCParPhases phase);
++ size_t min_thread_work_items(GCParPhases phase);
++ size_t max_thread_work_items(GCParPhases phase);
+
+- void record_strong_code_root_scan_time(uint worker_i, double ms) {
+- _last_strong_code_root_scan_times_ms.set(worker_i, ms);
+- }
+-
+- void record_obj_copy_time(uint worker_i, double ms) {
+- _last_obj_copy_times_ms.set(worker_i, ms);
+- }
+-
+- void add_obj_copy_time(uint worker_i, double ms) {
+- _last_obj_copy_times_ms.add(worker_i, ms);
+- }
+-
+- void record_termination(uint worker_i, double ms, size_t attempts) {
+- _last_termination_times_ms.set(worker_i, ms);
+- _last_termination_attempts.set(worker_i, attempts);
+- }
+-
+- void record_gc_worker_end_time(uint worker_i, double ms) {
+- _last_gc_worker_end_times_ms.set(worker_i, ms);
+- }
++ public:
+
+ void record_clear_ct_time(double ms) {
+ _cur_clear_ct_time_ms = ms;
+@@ -248,21 +179,10 @@
+ _cur_evac_fail_remove_self_forwards = ms;
+ }
+
+- void note_string_dedup_fixup_start();
+- void note_string_dedup_fixup_end();
+-
+ void record_string_dedup_fixup_time(double ms) {
+ _cur_string_dedup_fixup_time_ms = ms;
+ }
+
+- void record_string_dedup_queue_fixup_worker_time(uint worker_id, double ms) {
+- _cur_string_dedup_queue_fixup_worker_times_ms.set(worker_id, ms);
+- }
+-
+- void record_string_dedup_table_fixup_worker_time(uint worker_id, double ms) {
+- _cur_string_dedup_table_fixup_worker_times_ms.set(worker_id, ms);
+- }
+-
+ void record_ref_proc_time(double ms) {
+ _cur_ref_proc_time_ms = ms;
+ }
+@@ -283,7 +203,8 @@
+ _recorded_non_young_free_cset_time_ms = time_ms;
+ }
+
+- void record_fast_reclaim_humongous_stats(size_t total, size_t candidates) {
++ void record_fast_reclaim_humongous_stats(double time_ms, size_t total, size_t candidates) {
++ _cur_fast_reclaim_humongous_register_time_ms = time_ms;
+ _cur_fast_reclaim_humongous_total = total;
+ _cur_fast_reclaim_humongous_candidates = candidates;
+ }
+@@ -301,14 +222,6 @@
+ _recorded_non_young_cset_choice_time_ms = time_ms;
+ }
+
+- void record_redirty_logged_cards_time_ms(uint worker_i, double time_ms) {
+- _last_redirty_logged_cards_time_ms.set(worker_i, time_ms);
+- }
+-
+- void record_redirty_logged_cards_processed_cards(uint worker_i, size_t processed_buffers) {
+- _last_redirty_logged_cards_processed_cards.set(worker_i, processed_buffers);
+- }
+-
+ void record_redirty_logged_cards_time_ms(double time_ms) {
+ _recorded_redirty_logged_cards_time_ms = time_ms;
+ }
+@@ -362,38 +275,16 @@
+ double fast_reclaim_humongous_time_ms() {
+ return _cur_fast_reclaim_humongous_time_ms;
+ }
++};
+
+- double average_last_update_rs_time() {
+- return _last_update_rs_times_ms.average();
+- }
+-
+- int sum_last_update_rs_processed_buffers() {
+- return _last_update_rs_processed_buffers.sum();
+- }
+-
+- double average_last_scan_rs_time(){
+- return _last_scan_rs_times_ms.average();
+- }
+-
+- double average_last_strong_code_root_scan_time(){
+- return _last_strong_code_root_scan_times_ms.average();
+- }
+-
+- double average_last_obj_copy_time() {
+- return _last_obj_copy_times_ms.average();
+- }
+-
+- double average_last_termination_time() {
+- return _last_termination_times_ms.average();
+- }
+-
+- double average_last_ext_root_scan_time() {
+- return _last_ext_root_scan_times_ms.average();
+- }
+-
+- double average_last_satb_filtering_times_ms() {
+- return _last_satb_filtering_times_ms.average();
+- }
++class G1GCParPhaseTimesTracker : public StackObj {
++ double _start_time;
++ G1GCPhaseTimes::GCParPhases _phase;
++ G1GCPhaseTimes* _phase_times;
++ uint _worker_id;
++public:
++ G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
++ ~G1GCParPhaseTimesTracker();
+ };
+
+ #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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,16 +36,13 @@
+ if (default_use_cache()) {
+ _use_cache = true;
+
+- _hot_cache_size = (1 << G1ConcRSLogCacheSize);
++ _hot_cache_size = (size_t)1 << G1ConcRSLogCacheSize;
+ _hot_cache = NEW_C_HEAP_ARRAY(jbyte*, _hot_cache_size, mtGC);
+
+- _n_hot = 0;
+- _hot_cache_idx = 0;
++ reset_hot_cache_internal();
+
+ // For refining the cards in the hot cache in parallel
+- uint n_workers = (ParallelGCThreads > 0 ?
+- _g1h->workers()->total_workers() : 1);
+- _hot_cache_par_chunk_size = MAX2(1, _hot_cache_size / (int)n_workers);
++ _hot_cache_par_chunk_size = (int)(ParallelGCThreads > 0 ? ClaimChunkSize : _hot_cache_size);
+ _hot_cache_par_claimed_idx = 0;
+
+ _card_counts.initialize(card_counts_storage);
+@@ -66,26 +63,21 @@
+ // return it for immediate refining.
+ return card_ptr;
+ }
++ // Otherwise, the card is hot.
++ size_t index = Atomic::add_ptr((intptr_t)1, (volatile intptr_t*)&_hot_cache_idx) - 1;
++ size_t masked_index = index & (_hot_cache_size - 1);
++ jbyte* current_ptr = _hot_cache[masked_index];
+
+- // Otherwise, the card is hot.
+- jbyte* res = NULL;
+- MutexLockerEx x(HotCardCache_lock, Mutex::_no_safepoint_check_flag);
+- if (_n_hot == _hot_cache_size) {
+- res = _hot_cache[_hot_cache_idx];
+- _n_hot--;
+- }
+-
+- // Now _n_hot < _hot_cache_size, and we can insert at _hot_cache_idx.
+- _hot_cache[_hot_cache_idx] = card_ptr;
+- _hot_cache_idx++;
+-
+- if (_hot_cache_idx == _hot_cache_size) {
+- // Wrap around
+- _hot_cache_idx = 0;
+- }
+- _n_hot++;
+-
+- return res;
++ // Try to store the new card pointer into the cache. Compare-and-swap to guard
++ // against the unlikely event of a race resulting in another card pointer to
++ // have already been written to the cache. In this case we will return
++ // card_ptr in favor of the other option, which would be starting over. This
++ // should be OK since card_ptr will likely be the older card already when/if
++ // this ever happens.
++ jbyte* previous_ptr = (jbyte*)Atomic::cmpxchg_ptr(card_ptr,
++ &_hot_cache[masked_index],
++ current_ptr);
++ return (previous_ptr == current_ptr) ? previous_ptr : card_ptr;
+ }
+
+ void G1HotCardCache::drain(uint worker_i,
+@@ -98,38 +90,37 @@
+
+ assert(_hot_cache != NULL, "Logic");
+ assert(!use_cache(), "cache should be disabled");
+- int start_idx;
++ while (_hot_cache_par_claimed_idx < _hot_cache_size) {
++ size_t end_idx = Atomic::add_ptr((intptr_t)_hot_cache_par_chunk_size,
++ (volatile intptr_t*)&_hot_cache_par_claimed_idx);
++ size_t start_idx = end_idx - _hot_cache_par_chunk_size;
++ // The current worker has successfully claimed the chunk [start_idx..end_idx)
++ end_idx = MIN2(end_idx, _hot_cache_size);
++ for (size_t i = start_idx; i < end_idx; i++) {
++ jbyte* card_ptr = _hot_cache[i];
++ if (card_ptr != NULL) {
++ if (g1rs->refine_card(card_ptr, worker_i, true)) {
++ // The part of the heap spanned by the card contains references
++ // that point into the current collection set.
++ // We need to record the card pointer in the DirtyCardQueueSet
++ // that we use for such cards.
++ //
++ // The only time we care about recording cards that contain
++ // references that point into the collection set is during
++ // RSet updating while within an evacuation pause.
++ // In this case worker_i should be the id of a GC worker thread
++ assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
++ assert(worker_i < ParallelGCThreads,
++ err_msg("incorrect worker id: %u", worker_i));
+
+- while ((start_idx = _hot_cache_par_claimed_idx) < _n_hot) { // read once
+- int end_idx = start_idx + _hot_cache_par_chunk_size;
+-
+- if (start_idx ==
+- Atomic::cmpxchg(end_idx, &_hot_cache_par_claimed_idx, start_idx)) {
+- // The current worker has successfully claimed the chunk [start_idx..end_idx)
+- end_idx = MIN2(end_idx, _n_hot);
+- for (int i = start_idx; i < end_idx; i++) {
+- jbyte* card_ptr = _hot_cache[i];
+- if (card_ptr != NULL) {
+- if (g1rs->refine_card(card_ptr, worker_i, true)) {
+- // The part of the heap spanned by the card contains references
+- // that point into the current collection set.
+- // We need to record the card pointer in the DirtyCardQueueSet
+- // that we use for such cards.
+- //
+- // The only time we care about recording cards that contain
+- // references that point into the collection set is during
+- // RSet updating while within an evacuation pause.
+- // In this case worker_i should be the id of a GC worker thread
+- assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
+- assert(worker_i < (ParallelGCThreads == 0 ? 1 : ParallelGCThreads),
+- err_msg("incorrect worker id: "UINT32_FORMAT, worker_i));
+-
+- into_cset_dcq->enqueue(card_ptr);
+- }
++ into_cset_dcq->enqueue(card_ptr);
+ }
++ } else {
++ break;
+ }
+ }
+ }
++
+ // The existing entries in the hot card cache, which were just refined
+ // above, are discarded prior to re-enabling the cache near the end of the GC.
+ }
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -54,21 +54,33 @@
+ // code, increasing throughput.
+
+ class G1HotCardCache: public CHeapObj<mtGC> {
+- G1CollectedHeap* _g1h;
++
++ G1CollectedHeap* _g1h;
++
++ bool _use_cache;
++
++ G1CardCounts _card_counts;
+
+ // The card cache table
+- jbyte** _hot_cache;
++ jbyte** _hot_cache;
+
+- int _hot_cache_size;
+- int _n_hot;
+- int _hot_cache_idx;
++ size_t _hot_cache_size;
+
+- int _hot_cache_par_chunk_size;
+- volatile int _hot_cache_par_claimed_idx;
++ int _hot_cache_par_chunk_size;
+
+- bool _use_cache;
++ // Avoids false sharing when concurrently updating _hot_cache_idx or
++ // _hot_cache_par_claimed_idx. These are never updated at the same time
++ // thus it's not necessary to separate them as well
++ char _pad_before[DEFAULT_CACHE_LINE_SIZE];
+
+- G1CardCounts _card_counts;
++ volatile size_t _hot_cache_idx;
++
++ volatile size_t _hot_cache_par_claimed_idx;
++
++ char _pad_after[DEFAULT_CACHE_LINE_SIZE];
++
++ // The number of cached cards a thread claims when flushing the cache
++ static const int ClaimChunkSize = 32;
+
+ bool default_use_cache() const {
+ return (G1ConcRSLogCacheSize > 0);
+@@ -110,16 +122,25 @@
+ void reset_hot_cache() {
+ assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
+ assert(Thread::current()->is_VM_thread(), "Current thread should be the VMthread");
+- _hot_cache_idx = 0; _n_hot = 0;
++ if (default_use_cache()) {
++ reset_hot_cache_internal();
++ }
+ }
+
+- bool hot_cache_is_empty() { return _n_hot == 0; }
+-
+ // Zeros the values in the card counts table for entire committed heap
+ void reset_card_counts();
+
+ // Zeros the values in the card counts table for the given region
+ void reset_card_counts(HeapRegion* hr);
++
++ private:
++ void reset_hot_cache_internal() {
++ assert(_hot_cache != NULL, "Logic");
++ _hot_cache_idx = 0;
++ for (size_t i = 0; i < _hot_cache_size; i++) {
++ _hot_cache[i] = NULL;
++ }
++ }
+ };
+
+ #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1HOTCARDCACHE_HPP
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1InCSetState.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,132 @@
++/*
++ * Copyright (c) 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.
++ *
++ */
++
++#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1INCSETSTATE_HPP
++#define SHARE_VM_GC_IMPLEMENTATION_G1_G1INCSETSTATE_HPP
++
++#include "gc_implementation/g1/g1BiasedArray.hpp"
++#include "memory/allocation.hpp"
++
++// Per-region state during garbage collection.
++struct InCSetState {
++ public:
++ // We use different types to represent the state value. Particularly SPARC puts
++ // values in structs from "left to right", i.e. MSB to LSB. This results in many
++ // unnecessary shift operations when loading and storing values of this type.
++ // This degrades performance significantly (>10%) on that platform.
++ // Other tested ABIs do not seem to have this problem, and actually tend to
++ // favor smaller types, so we use the smallest usable type there.
++#ifdef SPARC
++ #define CSETSTATE_FORMAT INTPTR_FORMAT
++ typedef intptr_t in_cset_state_t;
++#else
++ #define CSETSTATE_FORMAT "%d"
++ typedef int8_t in_cset_state_t;
++#endif
++ private:
++ in_cset_state_t _value;
++ public:
++ enum {
++ // Selection of the values were driven to micro-optimize the encoding and
++ // frequency of the checks.
++ // The most common check is whether the region is in the collection set or not.
++ // This encoding allows us to use an != 0 check which in some architectures
++ // (x86*) can be encoded slightly more efficently than a normal comparison
++ // against zero.
++ // The same situation occurs when checking whether the region is humongous
++ // or not, which is encoded by values < 0.
++ // The other values are simply encoded in increasing generation order, which
++ // makes getting the next generation fast by a simple increment.
++ Humongous = -1, // The region is humongous - note that actually any value < 0 would be possible here.
++ NotInCSet = 0, // The region is not in the collection set.
++ Young = 1, // The region is in the collection set and a young region.
++ Old = 2, // The region is in the collection set and an old region.
++ Num
++ };
++
++ InCSetState(in_cset_state_t value = NotInCSet) : _value(value) {
++ assert(is_valid(), err_msg("Invalid state %d", _value));
++ }
++
++ in_cset_state_t value() const { return _value; }
++
++ void set_old() { _value = Old; }
++
++ bool is_in_cset_or_humongous() const { return _value != NotInCSet; }
++ bool is_in_cset() const { return _value > NotInCSet; }
++ bool is_humongous() const { return _value < NotInCSet; }
++ bool is_young() const { return _value == Young; }
++ bool is_old() const { return _value == Old; }
++
++#ifdef ASSERT
++ bool is_default() const { return !is_in_cset_or_humongous(); }
++ bool is_valid() const { return (_value >= Humongous) && (_value < Num); }
++ bool is_valid_gen() const { return (_value >= Young && _value <= Old); }
++#endif
++};
++
++// Instances of this class are used for quick tests on whether a reference points
++// into the collection set and into which generation or is a humongous object
++//
++// Each of the array's elements indicates whether the corresponding region is in
++// the collection set and if so in which generation, or a humongous region.
++//
++// We use this to speed up reference processing during young collection and
++// quickly reclaim humongous objects. For the latter, by making a humongous region
++// succeed this test, we sort-of add it to the collection set. During the reference
++// iteration closures, when we see a humongous region, we then simply mark it as
++// referenced, i.e. live.
++class G1InCSetStateFastTestBiasedMappedArray : public G1BiasedMappedArray<InCSetState> {
++ protected:
++ InCSetState default_value() const { return InCSetState::NotInCSet; }
++ public:
++ void set_humongous(uintptr_t index) {
++ assert(get_by_index(index).is_default(),
++ err_msg("State at index " INTPTR_FORMAT" should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()));
++ set_by_index(index, InCSetState::Humongous);
++ }
++
++ void clear_humongous(uintptr_t index) {
++ set_by_index(index, InCSetState::NotInCSet);
++ }
++
++ void set_in_young(uintptr_t index) {
++ assert(get_by_index(index).is_default(),
++ err_msg("State at index " INTPTR_FORMAT" should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()));
++ set_by_index(index, InCSetState::Young);
++ }
++
++ void set_in_old(uintptr_t index) {
++ assert(get_by_index(index).is_default(),
++ err_msg("State at index " INTPTR_FORMAT" should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()));
++ set_by_index(index, InCSetState::Old);
++ }
++
++ bool is_in_cset_or_humongous(HeapWord* addr) const { return at(addr).is_in_cset_or_humongous(); }
++ bool is_in_cset(HeapWord* addr) const { return at(addr).is_in_cset(); }
++ InCSetState at(HeapWord* addr) const { return get_by_address(addr); }
++ void clear() { G1BiasedMappedArray<InCSetState>::clear(); }
++};
++
++#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1INCSETSTATE_HPP
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1Log.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1Log.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -28,6 +28,7 @@
+ #include "memory/allocation.hpp"
+
+ class G1Log : public AllStatic {
++ public:
+ typedef enum {
+ LevelNone,
+ LevelFine,
+@@ -35,6 +36,7 @@
+ LevelFinest
+ } LogLevel;
+
++ private:
+ static LogLevel _level;
+
+ public:
+@@ -50,6 +52,10 @@
+ return _level == LevelFinest;
+ }
+
++ static LogLevel level() {
++ return _level;
++ }
++
+ static void init();
+ };
+
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -31,6 +31,7 @@
+ #include "code/icBuffer.hpp"
+ #include "gc_implementation/g1/g1Log.hpp"
+ #include "gc_implementation/g1/g1MarkSweep.hpp"
++#include "gc_implementation/g1/g1RootProcessor.hpp"
+ #include "gc_implementation/g1/g1StringDedup.hpp"
+ #include "gc_implementation/shared/gcHeapSummary.hpp"
+ #include "gc_implementation/shared/gcTimer.hpp"
+@@ -126,21 +127,22 @@
+ GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
+ GenMarkSweep::trace(" 1");
+
+- SharedHeap* sh = SharedHeap::heap();
++ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+
+ // Need cleared claim bits for the roots processing
+ ClassLoaderDataGraph::clear_claimed_marks();
+
+ MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
+- sh->process_strong_roots(true, // activate StrongRootsScope
+- SharedHeap::SO_None,
+- &GenMarkSweep::follow_root_closure,
+- &GenMarkSweep::follow_cld_closure,
+- &follow_code_closure);
++ {
++ G1RootProcessor root_processor(g1h);
++ root_processor.process_strong_roots(&GenMarkSweep::follow_root_closure,
++ &GenMarkSweep::follow_cld_closure,
++ &follow_code_closure);
++ }
+
+ // Process reference objects found during marking
+ ReferenceProcessor* rp = GenMarkSweep::ref_processor();
+- assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Sanity");
++ assert(rp == g1h->ref_processor_stw(), "Sanity");
+
+ rp->setup_policy(clear_all_softrefs);
+ const ReferenceProcessorStats& stats =
+@@ -226,6 +228,12 @@
+ }
+ };
+
++class G1AlwaysTrueClosure: public BoolObjectClosure {
++public:
++ bool do_object_b(oop p) { return true; }
++};
++static G1AlwaysTrueClosure always_true;
++
+ void G1MarkSweep::mark_sweep_phase3() {
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+
+@@ -233,24 +241,23 @@
+ GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
+ GenMarkSweep::trace("3");
+
+- SharedHeap* sh = SharedHeap::heap();
+-
+ // Need cleared claim bits for the roots processing
+ ClassLoaderDataGraph::clear_claimed_marks();
+
+ CodeBlobToOopClosure adjust_code_closure(&GenMarkSweep::adjust_pointer_closure, CodeBlobToOopClosure::FixRelocations);
+- sh->process_all_roots(true, // activate StrongRootsScope
+- SharedHeap::SO_AllCodeCache,
+- &GenMarkSweep::adjust_pointer_closure,
+- &GenMarkSweep::adjust_cld_closure,
+- &adjust_code_closure);
++ {
++ G1RootProcessor root_processor(g1h);
++ root_processor.process_all_roots(&GenMarkSweep::adjust_pointer_closure,
++ &GenMarkSweep::adjust_cld_closure,
++ &adjust_code_closure);
++ }
+
+ assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
+ g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
+
+ // Now adjust pointers in remaining weak roots. (All of which should
+ // have been cleared if they pointed to non-surviving objects.)
+- sh->process_weak_roots(&GenMarkSweep::adjust_pointer_closure);
++ JNIHandles::weak_oops_do(&always_true, &GenMarkSweep::adjust_pointer_closure);
+
+ if (G1StringDedup::is_enabled()) {
+ G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -26,6 +26,7 @@
+ #define SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP
+
+ #include "memory/iterator.hpp"
++#include "oops/markOop.hpp"
+
+ class HeapRegion;
+ class G1CollectedHeap;
+@@ -239,14 +240,14 @@
+ G1CollectedHeap* _g1;
+ G1RemSet* _g1_rem_set;
+ HeapRegion* _from;
+- OopsInHeapRegionClosure* _push_ref_cl;
++ G1ParPushHeapRSClosure* _push_ref_cl;
+ bool _record_refs_into_cset;
+ uint _worker_i;
+
+ public:
+ G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
+ G1RemSet* rs,
+- OopsInHeapRegionClosure* push_ref_cl,
++ G1ParPushHeapRSClosure* push_ref_cl,
+ bool record_refs_into_cset,
+ uint worker_i = 0);
+
+@@ -256,7 +257,8 @@
+ }
+
+ bool self_forwarded(oop obj) {
+- bool result = (obj->is_forwarded() && (obj->forwardee()== obj));
++ markOop m = obj->mark();
++ bool result = (m->is_marked() && ((oop)m->decode_pointer() == obj));
+ return result;
+ }
+
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -67,8 +67,8 @@
+
+ if (!oopDesc::is_null(heap_oop)) {
+ oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
+- G1CollectedHeap::in_cset_state_t state = _g1->in_cset_state(obj);
+- if (state == G1CollectedHeap::InCSet) {
++ const InCSetState state = _g1->in_cset_state(obj);
++ if (state.is_in_cset()) {
+ // We're not going to even bother checking whether the object is
+ // already forwarded or not, as this usually causes an immediate
+ // stall. We'll try to prefetch the object (for write, given that
+@@ -87,7 +87,7 @@
+
+ _par_scan_state->push_on_queue(p);
+ } else {
+- if (state == G1CollectedHeap::IsHumongous) {
++ if (state.is_humongous()) {
+ _g1->set_humongous_is_live(obj);
+ }
+ _par_scan_state->update_rs(_from, p, _worker_id);
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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,20 +44,29 @@
+ #endif
+ #include "utilities/bitMap.inline.hpp"
+
+-G1PageBasedVirtualSpace::G1PageBasedVirtualSpace() : _low_boundary(NULL),
+- _high_boundary(NULL), _committed(), _page_size(0), _special(false),
++G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size) :
++ _low_boundary(NULL), _high_boundary(NULL), _committed(), _page_size(0), _special(false),
+ _dirty(), _executable(false) {
++ initialize_with_page_size(rs, used_size, page_size);
+ }
+
+-bool G1PageBasedVirtualSpace::initialize_with_granularity(ReservedSpace rs, size_t page_size) {
+- if (!rs.is_reserved()) {
+- return false; // Allocation failed.
+- }
++void G1PageBasedVirtualSpace::initialize_with_page_size(ReservedSpace rs, size_t used_size, size_t page_size) {
++ guarantee(rs.is_reserved(), "Given reserved space must have been reserved already.");
++
+ assert(_low_boundary == NULL, "VirtualSpace already initialized");
+- assert(page_size > 0, "Granularity must be non-zero.");
++ assert(page_size > 0, "Page size must be non-zero.");
++
++ guarantee(is_ptr_aligned(rs.base(), page_size),
++ err_msg("Reserved space base " PTR_FORMAT " is not aligned to requested page size " SIZE_FORMAT, p2i(rs.base()), page_size));
++ guarantee(is_size_aligned(used_size, os::vm_page_size()),
++ err_msg("Given used reserved space size needs to be OS page size aligned (%d bytes) but is " SIZE_FORMAT, os::vm_page_size(), used_size));
++ guarantee(used_size <= rs.size(),
++ err_msg("Used size of reserved space " SIZE_FORMAT " bytes is smaller than reservation at " SIZE_FORMAT " bytes", used_size, rs.size()));
++ guarantee(is_size_aligned(rs.size(), page_size),
++ err_msg("Expected that the virtual space is size aligned, but " SIZE_FORMAT " is not aligned to page size " SIZE_FORMAT, rs.size(), page_size));
+
+ _low_boundary = rs.base();
+- _high_boundary = _low_boundary + rs.size();
++ _high_boundary = _low_boundary + used_size;
+
+ _special = rs.special();
+ _executable = rs.executable();
+@@ -65,16 +74,15 @@
+ _page_size = page_size;
+
+ assert(_committed.size() == 0, "virtual space initialized more than once");
+- uintx size_in_bits = rs.size() / page_size;
+- _committed.resize(size_in_bits, /* in_resource_area */ false);
++ BitMap::idx_t size_in_pages = rs.size() / page_size;
++ _committed.resize(size_in_pages, /* in_resource_area */ false);
+ if (_special) {
+- _dirty.resize(size_in_bits, /* in_resource_area */ false);
++ _dirty.resize(size_in_pages, /* in_resource_area */ false);
+ }
+
+- return true;
++ _tail_size = used_size % _page_size;
+ }
+
+-
+ G1PageBasedVirtualSpace::~G1PageBasedVirtualSpace() {
+ release();
+ }
+@@ -87,12 +95,18 @@
+ _special = false;
+ _executable = false;
+ _page_size = 0;
++ _tail_size = 0;
+ _committed.resize(0, false);
+ _dirty.resize(0, false);
+ }
+
+ size_t G1PageBasedVirtualSpace::committed_size() const {
+- return _committed.count_one_bits() * _page_size;
++ size_t result = _committed.count_one_bits() * _page_size;
++ // The last page might not be in full.
++ if (is_last_page_partial() && _committed.at(_committed.size() - 1)) {
++ result -= _page_size - _tail_size;
++ }
++ return result;
+ }
+
+ size_t G1PageBasedVirtualSpace::reserved_size() const {
+@@ -103,62 +117,134 @@
+ return reserved_size() - committed_size();
+ }
+
+-uintptr_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const {
++size_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const {
+ return (addr - _low_boundary) / _page_size;
+ }
+
+-bool G1PageBasedVirtualSpace::is_area_committed(uintptr_t start, size_t size_in_pages) const {
+- uintptr_t end = start + size_in_pages;
+- return _committed.get_next_zero_offset(start, end) >= end;
++bool G1PageBasedVirtualSpace::is_area_committed(size_t start_page, size_t size_in_pages) const {
++ size_t end_page = start_page + size_in_pages;
++ return _committed.get_next_zero_offset(start_page, end_page) >= end_page;
+ }
+
+-bool G1PageBasedVirtualSpace::is_area_uncommitted(uintptr_t start, size_t size_in_pages) const {
+- uintptr_t end = start + size_in_pages;
+- return _committed.get_next_one_offset(start, end) >= end;
++bool G1PageBasedVirtualSpace::is_area_uncommitted(size_t start_page, size_t size_in_pages) const {
++ size_t end_page = start_page + size_in_pages;
++ return _committed.get_next_one_offset(start_page, end_page) >= end_page;
+ }
+
+-char* G1PageBasedVirtualSpace::page_start(uintptr_t index) {
++char* G1PageBasedVirtualSpace::page_start(size_t index) const {
+ return _low_boundary + index * _page_size;
+ }
+
+-size_t G1PageBasedVirtualSpace::byte_size_for_pages(size_t num) {
+- return num * _page_size;
++bool G1PageBasedVirtualSpace::is_after_last_page(size_t index) const {
++ guarantee(index <= _committed.size(),
++ err_msg("Given boundary page " SIZE_FORMAT " is beyond managed page count " SIZE_FORMAT, index, _committed.size()));
++ return index == _committed.size();
+ }
+
+-bool G1PageBasedVirtualSpace::commit(uintptr_t start, size_t size_in_pages) {
++void G1PageBasedVirtualSpace::commit_preferred_pages(size_t start, size_t num_pages) {
++ assert(num_pages > 0, "No full pages to commit");
++ assert(start + num_pages <= _committed.size(),
++ err_msg("Tried to commit area from page " SIZE_FORMAT " to page " SIZE_FORMAT " "
++ "that is outside of managed space of " SIZE_FORMAT " pages",
++ start, start + num_pages, _committed.size()));
++
++ char* start_addr = page_start(start);
++ size_t size = num_pages * _page_size;
++
++ os::commit_memory_or_exit(start_addr, size, _page_size, _executable,
++ err_msg("Failed to commit area from " PTR_FORMAT " to " PTR_FORMAT " of length " SIZE_FORMAT ".",
++ p2i(start_addr), p2i(start_addr + size), size));
++}
++
++void G1PageBasedVirtualSpace::commit_tail() {
++ assert(_tail_size > 0, "The size of the tail area must be > 0 when reaching here");
++
++ char* const aligned_end_address = (char*)align_ptr_down(_high_boundary, _page_size);
++ os::commit_memory_or_exit(aligned_end_address, _tail_size, os::vm_page_size(), _executable,
++ err_msg("Failed to commit tail area from " PTR_FORMAT " to " PTR_FORMAT " of length " SIZE_FORMAT ".",
++ p2i(aligned_end_address), p2i(_high_boundary), _tail_size));
++}
++
++void G1PageBasedVirtualSpace::commit_internal(size_t start_page, size_t end_page) {
++ guarantee(start_page < end_page,
++ err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page));
++ guarantee(end_page <= _committed.size(),
++ err_msg("Given end page " SIZE_FORMAT " is beyond end of managed page amount of " SIZE_FORMAT, end_page, _committed.size()));
++
++ size_t pages = end_page - start_page;
++ bool need_to_commit_tail = is_after_last_page(end_page) && is_last_page_partial();
++
++ // If we have to commit some (partial) tail area, decrease the amount of pages to avoid
++ // committing that in the full-page commit code.
++ if (need_to_commit_tail) {
++ pages--;
++ }
++
++ if (pages > 0) {
++ commit_preferred_pages(start_page, pages);
++ }
++
++ if (need_to_commit_tail) {
++ commit_tail();
++ }
++}
++
++char* G1PageBasedVirtualSpace::bounded_end_addr(size_t end_page) const {
++ return MIN2(_high_boundary, page_start(end_page));
++}
++
++void G1PageBasedVirtualSpace::pretouch_internal(size_t start_page, size_t end_page) {
++ guarantee(start_page < end_page,
++ err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page));
++
++ os::pretouch_memory(page_start(start_page), bounded_end_addr(end_page));
++}
++
++bool G1PageBasedVirtualSpace::commit(size_t start_page, size_t size_in_pages) {
+ // We need to make sure to commit all pages covered by the given area.
+- guarantee(is_area_uncommitted(start, size_in_pages), "Specified area is not uncommitted");
++ guarantee(is_area_uncommitted(start_page, size_in_pages), "Specified area is not uncommitted");
+
+ bool zero_filled = true;
+- uintptr_t end = start + size_in_pages;
++ size_t end_page = start_page + size_in_pages;
+
+ if (_special) {
+ // Check for dirty pages and update zero_filled if any found.
+- if (_dirty.get_next_one_offset(start,end) < end) {
++ if (_dirty.get_next_one_offset(start_page, end_page) < end_page) {
+ zero_filled = false;
+- _dirty.clear_range(start, end);
++ _dirty.clear_range(start_page, end_page);
+ }
+ } else {
+- os::commit_memory_or_exit(page_start(start), byte_size_for_pages(size_in_pages), _executable,
+- err_msg("Failed to commit pages from "SIZE_FORMAT" of length "SIZE_FORMAT, start, size_in_pages));
++ commit_internal(start_page, end_page);
+ }
+- _committed.set_range(start, end);
++ _committed.set_range(start_page, end_page);
+
++ if (AlwaysPreTouch) {
++ pretouch_internal(start_page, end_page);
++ }
+ return zero_filled;
+ }
+
+-void G1PageBasedVirtualSpace::uncommit(uintptr_t start, size_t size_in_pages) {
+- guarantee(is_area_committed(start, size_in_pages), "checking");
++void G1PageBasedVirtualSpace::uncommit_internal(size_t start_page, size_t end_page) {
++ guarantee(start_page < end_page,
++ err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page));
+
++ char* start_addr = page_start(start_page);
++ os::uncommit_memory(start_addr, pointer_delta(bounded_end_addr(end_page), start_addr, sizeof(char)));
++}
++
++void G1PageBasedVirtualSpace::uncommit(size_t start_page, size_t size_in_pages) {
++ guarantee(is_area_committed(start_page, size_in_pages), "checking");
++
++ size_t end_page = start_page + size_in_pages;
+ if (_special) {
+ // Mark that memory is dirty. If committed again the memory might
+ // need to be cleared explicitly.
+- _dirty.set_range(start, start + size_in_pages);
++ _dirty.set_range(start_page, end_page);
+ } else {
+- os::uncommit_memory(page_start(start), byte_size_for_pages(size_in_pages));
++ uncommit_internal(start_page, end_page);
+ }
+
+- _committed.clear_range(start, start + size_in_pages);
++ _committed.clear_range(start_page, end_page);
+ }
+
+ bool G1PageBasedVirtualSpace::contains(const void* p) const {
+@@ -172,7 +258,8 @@
+ out->cr();
+ out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
+ out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size());
+- out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]", p2i(_low_boundary), p2i(_high_boundary));
++ out->print_cr(" - preferred page size: " SIZE_FORMAT, _page_size);
++ out->print_cr(" - [low_b, high_b]: [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(_low_boundary), p2i(_high_boundary));
+ }
+
+ void G1PageBasedVirtualSpace::print() {
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -34,6 +34,12 @@
+ // granularity.
+ // (De-)Allocation requests are always OS page aligned by passing a page index
+ // and multiples of pages.
++// For systems that only commits of memory in a given size (always greater than
++// page size) the base address is required to be aligned to that page size.
++// The actual size requested need not be aligned to that page size, but the size
++// of the reservation passed may be rounded up to this page size. Any fragment
++// (less than the page size) of the actual size at the tail of the request will
++// be committed using OS small pages.
+ // The implementation gives an error when trying to commit or uncommit pages that
+ // have already been committed or uncommitted.
+ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
+@@ -43,7 +49,11 @@
+ char* _low_boundary;
+ char* _high_boundary;
+
+- // The commit/uncommit granularity in bytes.
++ // The size of the tail in bytes of the handled space that needs to be committed
++ // using small pages.
++ size_t _tail_size;
++
++ // The preferred page size used for commit/uncommit in bytes.
+ size_t _page_size;
+
+ // Bitmap used for verification of commit/uncommit operations.
+@@ -62,30 +72,55 @@
+ // Indicates whether the committed space should be executable.
+ bool _executable;
+
++ // Helper function for committing memory. Commit the given memory range by using
++ // _page_size pages as much as possible and the remainder with small sized pages.
++ void commit_internal(size_t start_page, size_t end_page);
++ // Commit num_pages pages of _page_size size starting from start. All argument
++ // checking has been performed.
++ void commit_preferred_pages(size_t start_page, size_t end_page);
++ // Commit space at the high end of the space that needs to be committed with small
++ // sized pages.
++ void commit_tail();
++
++ // Uncommit the given memory range.
++ void uncommit_internal(size_t start_page, size_t end_page);
++
++ // Pretouch the given memory range.
++ void pretouch_internal(size_t start_page, size_t end_page);
++
+ // Returns the index of the page which contains the given address.
+ uintptr_t addr_to_page_index(char* addr) const;
+ // Returns the address of the given page index.
+- char* page_start(uintptr_t index);
+- // Returns the byte size of the given number of pages.
+- size_t byte_size_for_pages(size_t num);
++ char* page_start(size_t index) const;
++
++ // Is the given page index the last page?
++ bool is_last_page(size_t index) const { return index == (_committed.size() - 1); }
++ // Is the given page index the first after last page?
++ bool is_after_last_page(size_t index) const;
++ // Is the last page only partially covered by this space?
++ bool is_last_page_partial() const { return !is_ptr_aligned(_high_boundary, _page_size); }
++ // Returns the end address of the given page bounded by the reserved space.
++ char* bounded_end_addr(size_t end_page) const;
+
+ // Returns true if the entire area is backed by committed memory.
+- bool is_area_committed(uintptr_t start, size_t size_in_pages) const;
++ bool is_area_committed(size_t start_page, size_t size_in_pages) const;
+ // Returns true if the entire area is not backed by committed memory.
+- bool is_area_uncommitted(uintptr_t start, size_t size_in_pages) const;
++ bool is_area_uncommitted(size_t start_page, size_t size_in_pages) const;
+
++ void initialize_with_page_size(ReservedSpace rs, size_t used_size, size_t page_size);
+ public:
+
+ // Commit the given area of pages starting at start being size_in_pages large.
+ // Returns true if the given area is zero filled upon completion.
+- bool commit(uintptr_t start, size_t size_in_pages);
++ bool commit(size_t start_page, size_t size_in_pages);
+
+ // Uncommit the given area of pages starting at start being size_in_pages large.
+- void uncommit(uintptr_t start, size_t size_in_pages);
++ void uncommit(size_t start_page, size_t size_in_pages);
+
+- // Initialization
+- G1PageBasedVirtualSpace();
+- bool initialize_with_granularity(ReservedSpace rs, size_t page_size);
++ // Initialize the given reserved space with the given base address and the size
++ // actually used.
++ // Prefer to commit in page_size chunks.
++ G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size);
+
+ // Destruction
+ ~G1PageBasedVirtualSpace();
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -38,6 +38,7 @@
+ _g1_rem(g1h->g1_rem_set()),
+ _hash_seed(17), _queue_num(queue_num),
+ _term_attempts(0),
++ _tenuring_threshold(g1h->g1_policy()->tenuring_threshold()),
+ _age_table(false), _scanner(g1h, rp),
+ _strong_roots_time(0), _term_time(0) {
+ _scanner.set_par_scan_thread_state(this);
+@@ -59,6 +60,12 @@
+
+ _g1_par_allocator = G1ParGCAllocator::create_allocator(_g1h);
+
++ _dest[InCSetState::NotInCSet] = InCSetState::NotInCSet;
++ // The dest for Young is used when the objects are aged enough to
++ // need to be moved to the next space.
++ _dest[InCSetState::Young] = InCSetState::Old;
++ _dest[InCSetState::Old] = InCSetState::Old;
++
+ _start = os::elapsedTime();
+ }
+
+@@ -150,86 +157,126 @@
+ } while (!_refs->is_empty());
+ }
+
+-oop G1ParScanThreadState::copy_to_survivor_space(oop const old) {
+- size_t word_sz = old->size();
+- HeapRegion* from_region = _g1h->heap_region_containing_raw(old);
++HeapWord* G1ParScanThreadState::allocate_in_next_plab(InCSetState const state,
++ InCSetState* dest,
++ size_t word_sz,
++ AllocationContext_t const context) {
++ assert(state.is_in_cset_or_humongous(), err_msg("Unexpected state: " CSETSTATE_FORMAT, state.value()));
++ assert(dest->is_in_cset_or_humongous(), err_msg("Unexpected dest: " CSETSTATE_FORMAT, dest->value()));
++
++ // Right now we only have two types of regions (young / old) so
++ // let's keep the logic here simple. We can generalize it when necessary.
++ if (dest->is_young()) {
++ HeapWord* const obj_ptr = _g1_par_allocator->allocate(InCSetState::Old,
++ word_sz, context);
++ if (obj_ptr == NULL) {
++ return NULL;
++ }
++ // Make sure that we won't attempt to copy any other objects out
++ // of a survivor region (given that apparently we cannot allocate
++ // any new ones) to avoid coming into this slow path.
++ _tenuring_threshold = 0;
++ dest->set_old();
++ return obj_ptr;
++ } else {
++ assert(dest->is_old(), err_msg("Unexpected dest: " CSETSTATE_FORMAT, dest->value()));
++ // no other space to try.
++ return NULL;
++ }
++}
++
++InCSetState G1ParScanThreadState::next_state(InCSetState const state, markOop const m, uint& age) {
++ if (state.is_young()) {
++ age = !m->has_displaced_mark_helper() ? m->age()
++ : m->displaced_mark_helper()->age();
++ if (age < _tenuring_threshold) {
++ return state;
++ }
++ }
++ return dest(state);
++}
++
++oop G1ParScanThreadState::copy_to_survivor_space(InCSetState const state,
++ oop const old,
++ markOop const old_mark) {
++ const size_t word_sz = old->size();
++ HeapRegion* const from_region = _g1h->heap_region_containing_raw(old);
+ // +1 to make the -1 indexes valid...
+- int young_index = from_region->young_index_in_cset()+1;
++ const int young_index = from_region->young_index_in_cset()+1;
+ assert( (from_region->is_young() && young_index > 0) ||
+ (!from_region->is_young() && young_index == 0), "invariant" );
+- G1CollectorPolicy* g1p = _g1h->g1_policy();
+- markOop m = old->mark();
+- int age = m->has_displaced_mark_helper() ? m->displaced_mark_helper()->age()
+- : m->age();
+- GCAllocPurpose alloc_purpose = g1p->evacuation_destination(from_region, age,
+- word_sz);
+- AllocationContext_t context = from_region->allocation_context();
+- HeapWord* obj_ptr = _g1_par_allocator->allocate(alloc_purpose, word_sz, context);
++ const AllocationContext_t context = from_region->allocation_context();
++
++ uint age = 0;
++ InCSetState dest_state = next_state(state, old_mark, age);
++ HeapWord* obj_ptr = _g1_par_allocator->plab_allocate(dest_state, word_sz, context);
++
++ // PLAB allocations should succeed most of the time, so we'll
++ // normally check against NULL once and that's it.
++ if (obj_ptr == NULL) {
++ obj_ptr = _g1_par_allocator->allocate_direct_or_new_plab(dest_state, word_sz, context);
++ if (obj_ptr == NULL) {
++ obj_ptr = allocate_in_next_plab(state, &dest_state, word_sz, context);
++ if (obj_ptr == NULL) {
++ // This will either forward-to-self, or detect that someone else has
++ // installed a forwarding pointer.
++ return _g1h->handle_evacuation_failure_par(this, old);
++ }
++ }
++ }
++
++ assert(obj_ptr != NULL, "when we get here, allocation should have succeeded");
+ #ifndef PRODUCT
+ // Should this evacuation fail?
+ if (_g1h->evacuation_should_fail()) {
+- if (obj_ptr != NULL) {
+- _g1_par_allocator->undo_allocation(alloc_purpose, obj_ptr, word_sz, context);
+- obj_ptr = NULL;
+- }
++ // Doing this after all the allocation attempts also tests the
++ // undo_allocation() method too.
++ _g1_par_allocator->undo_allocation(dest_state, obj_ptr, word_sz, context);
++ return _g1h->handle_evacuation_failure_par(this, old);
+ }
+ #endif // !PRODUCT
+
+- if (obj_ptr == NULL) {
+- // This will either forward-to-self, or detect that someone else has
+- // installed a forwarding pointer.
+- return _g1h->handle_evacuation_failure_par(this, old);
+- }
+-
+- oop obj = oop(obj_ptr);
+-
+ // We're going to allocate linearly, so might as well prefetch ahead.
+ Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
+
+- oop forward_ptr = old->forward_to_atomic(obj);
++ const oop obj = oop(obj_ptr);
++ const oop forward_ptr = old->forward_to_atomic(obj);
+ if (forward_ptr == NULL) {
+ Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz);
+
+- // alloc_purpose is just a hint to allocate() above, recheck the type of region
+- // we actually allocated from and update alloc_purpose accordingly
+- HeapRegion* to_region = _g1h->heap_region_containing_raw(obj_ptr);
+- alloc_purpose = to_region->is_young() ? GCAllocForSurvived : GCAllocForTenured;
+-
+- if (g1p->track_object_age(alloc_purpose)) {
+- // We could simply do obj->incr_age(). However, this causes a
+- // performance issue. obj->incr_age() will first check whether
+- // the object has a displaced mark by checking its mark word;
+- // getting the mark word from the new location of the object
+- // stalls. So, given that we already have the mark word and we
+- // are about to install it anyway, it's better to increase the
+- // age on the mark word, when the object does not have a
+- // displaced mark word. We're not expecting many objects to have
+- // a displaced marked word, so that case is not optimized
+- // further (it could be...) and we simply call obj->incr_age().
+-
+- if (m->has_displaced_mark_helper()) {
+- // in this case, we have to install the mark word first,
++ if (dest_state.is_young()) {
++ if (age < markOopDesc::max_age) {
++ age++;
++ }
++ if (old_mark->has_displaced_mark_helper()) {
++ // In this case, we have to install the mark word first,
+ // otherwise obj looks to be forwarded (the old mark word,
+ // which contains the forward pointer, was copied)
+- obj->set_mark(m);
+- obj->incr_age();
++ obj->set_mark(old_mark);
++ markOop new_mark = old_mark->displaced_mark_helper()->set_age(age);
++ old_mark->set_displaced_mark_helper(new_mark);
+ } else {
+- m = m->incr_age();
+- obj->set_mark(m);
++ obj->set_mark(old_mark->set_age(age));
+ }
+- age_table()->add(obj, word_sz);
++ age_table()->add(age, word_sz);
+ } else {
+- obj->set_mark(m);
++ obj->set_mark(old_mark);
+ }
+
+ if (G1StringDedup::is_enabled()) {
+- G1StringDedup::enqueue_from_evacuation(from_region->is_young(),
+- to_region->is_young(),
++ const bool is_from_young = state.is_young();
++ const bool is_to_young = dest_state.is_young();
++ assert(is_from_young == _g1h->heap_region_containing_raw(old)->is_young(),
++ "sanity");
++ assert(is_to_young == _g1h->heap_region_containing_raw(obj)->is_young(),
++ "sanity");
++ G1StringDedup::enqueue_from_evacuation(is_from_young,
++ is_to_young,
+ queue_num(),
+ obj);
+ }
+
+- size_t* surv_young_words = surviving_young_words();
++ size_t* const surv_young_words = surviving_young_words();
+ surv_young_words[young_index] += word_sz;
+
+ if (obj->is_objArray() && arrayOop(obj)->length() >= ParGCArrayScanChunk) {
+@@ -240,14 +287,13 @@
+ oop* old_p = set_partial_array_mask(old);
+ push_on_queue(old_p);
+ } else {
+- // No point in using the slower heap_region_containing() method,
+- // given that we know obj is in the heap.
+- _scanner.set_region(_g1h->heap_region_containing_raw(obj));
++ HeapRegion* const to_region = _g1h->heap_region_containing_raw(obj_ptr);
++ _scanner.set_region(to_region);
+ obj->oop_iterate_backwards(&_scanner);
+ }
++ return obj;
+ } else {
+- _g1_par_allocator->undo_allocation(alloc_purpose, obj_ptr, word_sz, context);
+- obj = forward_ptr;
++ _g1_par_allocator->undo_allocation(dest_state, obj_ptr, word_sz, context);
++ return forward_ptr;
+ }
+- return obj;
+ }
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -46,14 +46,16 @@
+ G1SATBCardTableModRefBS* _ct_bs;
+ G1RemSet* _g1_rem;
+
+- G1ParGCAllocator* _g1_par_allocator;
++ G1ParGCAllocator* _g1_par_allocator;
+
+- ageTable _age_table;
++ ageTable _age_table;
++ InCSetState _dest[InCSetState::Num];
++ // Local tenuring threshold.
++ uint _tenuring_threshold;
++ G1ParScanClosure _scanner;
+
+- G1ParScanClosure _scanner;
+-
+- size_t _alloc_buffer_waste;
+- size_t _undo_waste;
++ size_t _alloc_buffer_waste;
++ size_t _undo_waste;
+
+ OopsInHeapRegionClosure* _evac_failure_cl;
+
+@@ -82,6 +84,14 @@
+ DirtyCardQueue& dirty_card_queue() { return _dcq; }
+ G1SATBCardTableModRefBS* ctbs() { return _ct_bs; }
+
++ InCSetState dest(InCSetState original) const {
++ assert(original.is_valid(),
++ err_msg("Original state invalid: " CSETSTATE_FORMAT, original.value()));
++ assert(_dest[original.value()].is_valid_gen(),
++ err_msg("Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value()));
++ return _dest[original.value()];
++ }
++
+ public:
+ G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp);
+ ~G1ParScanThreadState();
+@@ -112,7 +122,6 @@
+ }
+ }
+ }
+- public:
+
+ void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) {
+ _evac_failure_cl = evac_failure_cl;
+@@ -193,9 +202,20 @@
+ template <class T> inline void deal_with_reference(T* ref_to_scan);
+
+ inline void dispatch_reference(StarTask ref);
++
++ // Tries to allocate word_sz in the PLAB of the next "generation" after trying to
++ // allocate into dest. State is the original (source) cset state for the object
++ // that is allocated for.
++ // Returns a non-NULL pointer if successful, and updates dest if required.
++ HeapWord* allocate_in_next_plab(InCSetState const state,
++ InCSetState* dest,
++ size_t word_sz,
++ AllocationContext_t const context);
++
++ inline InCSetState next_state(InCSetState const state, markOop const m, uint& age);
+ public:
+
+- oop copy_to_survivor_space(oop const obj);
++ oop copy_to_survivor_space(InCSetState const state, oop const obj, markOop const old_mark);
+
+ void trim_queue();
+
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -38,20 +38,21 @@
+ // set, due to (benign) races in the claim mechanism during RSet scanning more
+ // than one thread might claim the same card. So the same card may be
+ // processed multiple times. So redo this check.
+- G1CollectedHeap::in_cset_state_t in_cset_state = _g1h->in_cset_state(obj);
+- if (in_cset_state == G1CollectedHeap::InCSet) {
++ const InCSetState in_cset_state = _g1h->in_cset_state(obj);
++ if (in_cset_state.is_in_cset()) {
+ oop forwardee;
+- if (obj->is_forwarded()) {
+- forwardee = obj->forwardee();
++ markOop m = obj->mark();
++ if (m->is_marked()) {
++ forwardee = (oop) m->decode_pointer();
+ } else {
+- forwardee = copy_to_survivor_space(obj);
++ forwardee = copy_to_survivor_space(in_cset_state, obj, m);
+ }
+ oopDesc::encode_store_heap_oop(p, forwardee);
+- } else if (in_cset_state == G1CollectedHeap::IsHumongous) {
++ } else if (in_cset_state.is_humongous()) {
+ _g1h->set_humongous_is_live(obj);
+ } else {
+- assert(in_cset_state == G1CollectedHeap::InNeither,
+- err_msg("In_cset_state must be InNeither here, but is %d", in_cset_state));
++ assert(!in_cset_state.is_in_cset_or_humongous(),
++ err_msg("In_cset_state must be NotInCSet here, but is " CSETSTATE_FORMAT, in_cset_state.value()));
+ }
+
+ assert(obj != NULL, "Must be");
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2013, 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
+@@ -31,17 +31,16 @@
+ #include "utilities/bitMap.inline.hpp"
+
+ G1RegionToSpaceMapper::G1RegionToSpaceMapper(ReservedSpace rs,
+- size_t commit_granularity,
++ size_t used_size,
++ size_t page_size,
+ size_t region_granularity,
+ MemoryType type) :
+- _storage(),
+- _commit_granularity(commit_granularity),
++ _storage(rs, used_size, page_size),
+ _region_granularity(region_granularity),
+ _listener(NULL),
+ _commit_map() {
+- guarantee(is_power_of_2(commit_granularity), "must be");
++ guarantee(is_power_of_2(page_size), "must be");
+ guarantee(is_power_of_2(region_granularity), "must be");
+- _storage.initialize_with_granularity(rs, commit_granularity);
+
+ MemTracker::record_virtual_memory_type((address)rs.base(), type);
+ }
+@@ -55,25 +54,26 @@
+
+ public:
+ G1RegionsLargerThanCommitSizeMapper(ReservedSpace rs,
+- size_t os_commit_granularity,
++ size_t actual_size,
++ size_t page_size,
+ size_t alloc_granularity,
+ size_t commit_factor,
+ MemoryType type) :
+- G1RegionToSpaceMapper(rs, os_commit_granularity, alloc_granularity, type),
+- _pages_per_region(alloc_granularity / (os_commit_granularity * commit_factor)) {
++ G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, type),
++ _pages_per_region(alloc_granularity / (page_size * commit_factor)) {
+
+- guarantee(alloc_granularity >= os_commit_granularity, "allocation granularity smaller than commit granularity");
++ guarantee(alloc_granularity >= page_size, "allocation granularity smaller than commit granularity");
+ _commit_map.resize(rs.size() * commit_factor / alloc_granularity, /* in_resource_area */ false);
+ }
+
+- virtual void commit_regions(uintptr_t start_idx, size_t num_regions) {
+- bool zero_filled = _storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region);
++ virtual void commit_regions(uint start_idx, size_t num_regions) {
++ bool zero_filled = _storage.commit((size_t)start_idx * _pages_per_region, num_regions * _pages_per_region);
+ _commit_map.set_range(start_idx, start_idx + num_regions);
+ fire_on_commit(start_idx, num_regions, zero_filled);
+ }
+
+- virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) {
+- _storage.uncommit(start_idx * _pages_per_region, num_regions * _pages_per_region);
++ virtual void uncommit_regions(uint start_idx, size_t num_regions) {
++ _storage.uncommit((size_t)start_idx * _pages_per_region, num_regions * _pages_per_region);
+ _commit_map.clear_range(start_idx, start_idx + num_regions);
+ }
+ };
+@@ -98,22 +98,23 @@
+
+ public:
+ G1RegionsSmallerThanCommitSizeMapper(ReservedSpace rs,
+- size_t os_commit_granularity,
++ size_t actual_size,
++ size_t page_size,
+ size_t alloc_granularity,
+ size_t commit_factor,
+ MemoryType type) :
+- G1RegionToSpaceMapper(rs, os_commit_granularity, alloc_granularity, type),
+- _regions_per_page((os_commit_granularity * commit_factor) / alloc_granularity), _refcounts() {
++ G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, type),
++ _regions_per_page((page_size * commit_factor) / alloc_granularity), _refcounts() {
+
+- guarantee((os_commit_granularity * commit_factor) >= alloc_granularity, "allocation granularity smaller than commit granularity");
+- _refcounts.initialize((HeapWord*)rs.base(), (HeapWord*)(rs.base() + rs.size()), os_commit_granularity);
++ guarantee((page_size * commit_factor) >= alloc_granularity, "allocation granularity smaller than commit granularity");
++ _refcounts.initialize((HeapWord*)rs.base(), (HeapWord*)(rs.base() + align_size_up(rs.size(), page_size)), page_size);
+ _commit_map.resize(rs.size() * commit_factor / alloc_granularity, /* in_resource_area */ false);
+ }
+
+- virtual void commit_regions(uintptr_t start_idx, size_t num_regions) {
+- for (uintptr_t i = start_idx; i < start_idx + num_regions; i++) {
+- assert(!_commit_map.at(i), err_msg("Trying to commit storage at region "INTPTR_FORMAT" that is already committed", i));
+- uintptr_t idx = region_idx_to_page_idx(i);
++ virtual void commit_regions(uint start_idx, size_t num_regions) {
++ for (uint i = start_idx; i < start_idx + num_regions; i++) {
++ assert(!_commit_map.at(i), err_msg("Trying to commit storage at region %u that is already committed", i));
++ size_t idx = region_idx_to_page_idx(i);
+ uint old_refcount = _refcounts.get_by_index(idx);
+ bool zero_filled = false;
+ if (old_refcount == 0) {
+@@ -125,10 +126,10 @@
+ }
+ }
+
+- virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) {
+- for (uintptr_t i = start_idx; i < start_idx + num_regions; i++) {
+- assert(_commit_map.at(i), err_msg("Trying to uncommit storage at region "INTPTR_FORMAT" that is not committed", i));
+- uintptr_t idx = region_idx_to_page_idx(i);
++ virtual void uncommit_regions(uint start_idx, size_t num_regions) {
++ for (uint i = start_idx; i < start_idx + num_regions; i++) {
++ assert(_commit_map.at(i), err_msg("Trying to uncommit storage at region %u that is not committed", i));
++ size_t idx = region_idx_to_page_idx(i);
+ uint old_refcount = _refcounts.get_by_index(idx);
+ assert(old_refcount > 0, "must be");
+ if (old_refcount == 1) {
+@@ -147,14 +148,15 @@
+ }
+
+ G1RegionToSpaceMapper* G1RegionToSpaceMapper::create_mapper(ReservedSpace rs,
+- size_t os_commit_granularity,
++ size_t actual_size,
++ size_t page_size,
+ size_t region_granularity,
+ size_t commit_factor,
+ MemoryType type) {
+
+- if (region_granularity >= (os_commit_granularity * commit_factor)) {
+- return new G1RegionsLargerThanCommitSizeMapper(rs, os_commit_granularity, region_granularity, commit_factor, type);
++ if (region_granularity >= (page_size * commit_factor)) {
++ return new G1RegionsLargerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, type);
+ } else {
+- return new G1RegionsSmallerThanCommitSizeMapper(rs, os_commit_granularity, region_granularity, commit_factor, type);
++ return new G1RegionsSmallerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, type);
+ }
+ }
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -46,17 +46,20 @@
+ protected:
+ // Backing storage.
+ G1PageBasedVirtualSpace _storage;
+- size_t _commit_granularity;
++
+ size_t _region_granularity;
+ // Mapping management
+ BitMap _commit_map;
+
+- G1RegionToSpaceMapper(ReservedSpace rs, size_t commit_granularity, size_t region_granularity, MemoryType type);
++ G1RegionToSpaceMapper(ReservedSpace rs, size_t used_size, size_t page_size, size_t region_granularity, MemoryType type);
+
+ void fire_on_commit(uint start_idx, size_t num_regions, bool zero_filled);
+ public:
+ MemRegion reserved() { return _storage.reserved(); }
+
++ size_t reserved_size() { return _storage.reserved_size(); }
++ size_t committed_size() { return _storage.committed_size(); }
++
+ void set_mapping_changed_listener(G1MappingChangedListener* listener) { _listener = listener; }
+
+ virtual ~G1RegionToSpaceMapper() {
+@@ -67,16 +70,20 @@
+ return _commit_map.at(idx);
+ }
+
+- virtual void commit_regions(uintptr_t start_idx, size_t num_regions = 1) = 0;
+- virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions = 1) = 0;
++ virtual void commit_regions(uint start_idx, size_t num_regions = 1) = 0;
++ virtual void uncommit_regions(uint start_idx, size_t num_regions = 1) = 0;
+
+ // Creates an appropriate G1RegionToSpaceMapper for the given parameters.
++ // The actual space to be used within the given reservation is given by actual_size.
++ // This is because some OSes need to round up the reservation size to guarantee
++ // alignment of page_size.
+ // The byte_translation_factor defines how many bytes in a region correspond to
+ // a single byte in the data structure this mapper is for.
+ // Eg. in the card table, this value corresponds to the size a single card
+- // table entry corresponds to.
++ // table entry corresponds to in the heap.
+ static G1RegionToSpaceMapper* create_mapper(ReservedSpace rs,
+- size_t os_commit_granularity,
++ size_t actual_size,
++ size_t page_size,
+ size_t region_granularity,
+ size_t byte_translation_factor,
+ MemoryType type);
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -78,9 +78,8 @@
+ _cards_scanned(NULL), _total_cards_scanned(0),
+ _prev_period_summary()
+ {
+- _seq_task = new SubTasksDone(NumSeqTasks);
+ guarantee(n_workers() > 0, "There should be some workers");
+- _cset_rs_update_cl = NEW_C_HEAP_ARRAY(OopsInHeapRegionClosure*, n_workers(), mtGC);
++ _cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC);
+ for (uint i = 0; i < n_workers(); i++) {
+ _cset_rs_update_cl[i] = NULL;
+ }
+@@ -90,11 +89,10 @@
+ }
+
+ G1RemSet::~G1RemSet() {
+- delete _seq_task;
+ for (uint i = 0; i < n_workers(); i++) {
+ assert(_cset_rs_update_cl[i] == NULL, "it should be");
+ }
+- FREE_C_HEAP_ARRAY(OopsInHeapRegionClosure*, _cset_rs_update_cl, mtGC);
++ FREE_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, _cset_rs_update_cl, mtGC);
+ }
+
+ void CountNonCleanMemRegionClosure::do_MemRegion(MemRegion mr) {
+@@ -108,7 +106,7 @@
+ size_t _cards_done, _cards;
+ G1CollectedHeap* _g1h;
+
+- OopsInHeapRegionClosure* _oc;
++ G1ParPushHeapRSClosure* _oc;
+ CodeBlobClosure* _code_root_cl;
+
+ G1BlockOffsetSharedArray* _bot_shared;
+@@ -120,7 +118,7 @@
+ bool _try_claimed;
+
+ public:
+- ScanRSClosure(OopsInHeapRegionClosure* oc,
++ ScanRSClosure(G1ParPushHeapRSClosure* oc,
+ CodeBlobClosure* code_root_cl,
+ uint worker_i) :
+ _oc(oc),
+@@ -142,16 +140,13 @@
+ void scanCard(size_t index, HeapRegion *r) {
+ // Stack allocate the DirtyCardToOopClosure instance
+ HeapRegionDCTOC cl(_g1h, r, _oc,
+- CardTableModRefBS::Precise,
+- HeapRegionDCTOC::IntoCSFilterKind);
++ CardTableModRefBS::Precise);
+
+ // Set the "from" region in the closure.
+ _oc->set_region(r);
+- HeapWord* card_start = _bot_shared->address_for_index(index);
+- HeapWord* card_end = card_start + G1BlockOffsetSharedArray::N_words;
+- Space *sp = SharedHeap::heap()->space_containing(card_start);
+- MemRegion sm_region = sp->used_region_at_save_marks();
+- MemRegion mr = sm_region.intersection(MemRegion(card_start,card_end));
++ MemRegion card_region(_bot_shared->address_for_index(index), G1BlockOffsetSharedArray::N_words);
++ MemRegion pre_gc_allocated(r->bottom(), r->scan_top());
++ MemRegion mr = pre_gc_allocated.intersection(card_region);
+ if (!mr.is_empty() && !_ct_bs->is_card_claimed(index)) {
+ // We make the card as "claimed" lazily (so races are possible
+ // but they're benign), which reduces the number of duplicate
+@@ -240,7 +235,7 @@
+ size_t cards_looked_up() { return _cards;}
+ };
+
+-void G1RemSet::scanRS(OopsInHeapRegionClosure* oc,
++void G1RemSet::scanRS(G1ParPushHeapRSClosure* oc,
+ CodeBlobClosure* code_root_cl,
+ uint worker_i) {
+ double rs_time_start = os::elapsedTime();
+@@ -258,9 +253,8 @@
+ assert(_cards_scanned != NULL, "invariant");
+ _cards_scanned[worker_i] = scanRScl.cards_done();
+
+- _g1p->phase_times()->record_scan_rs_time(worker_i, scan_rs_time_sec * 1000.0);
+- _g1p->phase_times()->record_strong_code_root_scan_time(worker_i,
+- scanRScl.strong_code_root_scan_time_sec() * 1000.0);
++ _g1p->phase_times()->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, scan_rs_time_sec);
++ _g1p->phase_times()->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, scanRScl.strong_code_root_scan_time_sec());
+ }
+
+ // Closure used for updating RSets and recording references that
+@@ -297,29 +291,18 @@
+ };
+
+ void G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, uint worker_i) {
+- double start = os::elapsedTime();
++ G1GCParPhaseTimesTracker x(_g1p->phase_times(), G1GCPhaseTimes::UpdateRS, worker_i);
+ // Apply the given closure to all remaining log entries.
+ RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq);
+
+ _g1->iterate_dirty_card_closure(&into_cset_update_rs_cl, into_cset_dcq, false, worker_i);
+-
+- // Now there should be no dirty cards.
+- if (G1RSLogCheckCardTable) {
+- CountNonCleanMemRegionClosure cl(_g1);
+- _ct_bs->mod_card_iterate(&cl);
+- // XXX This isn't true any more: keeping cards of young regions
+- // marked dirty broke it. Need some reasonable fix.
+- guarantee(cl.n() == 0, "Card table should be clean.");
+- }
+-
+- _g1p->phase_times()->record_update_rs_time(worker_i, (os::elapsedTime() - start) * 1000.0);
+ }
+
+ void G1RemSet::cleanupHRRS() {
+ HeapRegionRemSet::cleanup();
+ }
+
+-void G1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure* oc,
++void G1RemSet::oops_into_collection_set_do(G1ParPushHeapRSClosure* oc,
+ CodeBlobClosure* code_root_cl,
+ uint worker_i) {
+ #if CARD_REPEAT_HISTO
+@@ -344,23 +327,8 @@
+
+ assert((ParallelGCThreads > 0) || worker_i == 0, "invariant");
+
+- // The two flags below were introduced temporarily to serialize
+- // the updating and scanning of remembered sets. There are some
+- // race conditions when these two operations are done in parallel
+- // and they are causing failures. When we resolve said race
+- // conditions, we'll revert back to parallel remembered set
+- // updating and scanning. See CRs 6677707 and 6677708.
+- if (G1UseParallelRSetUpdating || (worker_i == 0)) {
+- updateRS(&into_cset_dcq, worker_i);
+- } else {
+- _g1p->phase_times()->record_update_rs_processed_buffers(worker_i, 0);
+- _g1p->phase_times()->record_update_rs_time(worker_i, 0.0);
+- }
+- if (G1UseParallelRSetScanning || (worker_i == 0)) {
+- scanRS(oc, code_root_cl, worker_i);
+- } else {
+- _g1p->phase_times()->record_scan_rs_time(worker_i, 0.0);
+- }
++ updateRS(&into_cset_dcq, worker_i);
++ scanRS(oc, code_root_cl, worker_i);
+
+ // We now clear the cached values of _cset_rs_update_cl for this worker
+ _cset_rs_update_cl[worker_i] = NULL;
+@@ -461,7 +429,7 @@
+ G1UpdateRSOrPushRefOopClosure::
+ G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
+ G1RemSet* rs,
+- OopsInHeapRegionClosure* push_ref_cl,
++ G1ParPushHeapRSClosure* push_ref_cl,
+ bool record_refs_into_cset,
+ uint worker_i) :
+ _g1(g1h), _g1_rem_set(rs), _from(NULL),
+@@ -562,7 +530,7 @@
+ ct_freq_note_card(_ct_bs->index_for(start));
+ #endif
+
+- OopsInHeapRegionClosure* oops_in_heap_closure = NULL;
++ G1ParPushHeapRSClosure* oops_in_heap_closure = NULL;
+ if (check_for_refs_into_cset) {
+ // ConcurrentG1RefineThreads have worker numbers larger than what
+ // _cset_rs_update_cl[] is set up to handle. But those threads should
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -33,6 +33,7 @@
+ class G1CollectedHeap;
+ class CardTableModRefBarrierSet;
+ class ConcurrentG1Refine;
++class G1ParPushHeapRSClosure;
+
+ // A G1RemSet in which each heap region has a rem set that records the
+ // external heap references into it. Uses a mod ref bs to track updates,
+@@ -58,7 +59,6 @@
+ };
+
+ CardTableModRefBS* _ct_bs;
+- SubTasksDone* _seq_task;
+ G1CollectorPolicy* _g1p;
+
+ ConcurrentG1Refine* _cg1r;
+@@ -68,7 +68,7 @@
+
+ // Used for caching the closure that is responsible for scanning
+ // references into the collection set.
+- OopsInHeapRegionClosure** _cset_rs_update_cl;
++ G1ParPushHeapRSClosure** _cset_rs_update_cl;
+
+ // Print the given summary info
+ virtual void print_summary_info(G1RemSetSummary * summary, const char * header = NULL);
+@@ -95,7 +95,7 @@
+ // partitioning the work to be done. It should be the same as
+ // the "i" passed to the calling thread's work(i) function.
+ // In the sequential case this param will be ignored.
+- void oops_into_collection_set_do(OopsInHeapRegionClosure* blk,
++ void oops_into_collection_set_do(G1ParPushHeapRSClosure* blk,
+ CodeBlobClosure* code_root_cl,
+ uint worker_i);
+
+@@ -107,7 +107,7 @@
+ void prepare_for_oops_into_collection_set_do();
+ void cleanup_after_oops_into_collection_set_do();
+
+- void scanRS(OopsInHeapRegionClosure* oc,
++ void scanRS(G1ParPushHeapRSClosure* oc,
+ CodeBlobClosure* code_root_cl,
+ uint worker_i);
+
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,339 @@
++/*
++ * 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.
++ *
++ */
++
++#include "precompiled.hpp"
++
++#include "classfile/symbolTable.hpp"
++#include "classfile/systemDictionary.hpp"
++#include "code/codeCache.hpp"
++#include "gc_implementation/g1/bufferingOopClosure.hpp"
++#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
++#include "gc_implementation/g1/g1CollectorPolicy.hpp"
++#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
++#include "gc_implementation/g1/g1RemSet.inline.hpp"
++#include "gc_implementation/g1/g1RootProcessor.hpp"
++#include "memory/allocation.inline.hpp"
++#include "runtime/fprofiler.hpp"
++#include "runtime/mutex.hpp"
++#include "services/management.hpp"
++
++class G1CodeBlobClosure : public CodeBlobClosure {
++ class HeapRegionGatheringOopClosure : public OopClosure {
++ G1CollectedHeap* _g1h;
++ OopClosure* _work;
++ nmethod* _nm;
++
++ template <typename T>
++ void do_oop_work(T* p) {
++ _work->do_oop(p);
++ T oop_or_narrowoop = oopDesc::load_heap_oop(p);
++ if (!oopDesc::is_null(oop_or_narrowoop)) {
++ oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
++ HeapRegion* hr = _g1h->heap_region_containing_raw(o);
++ assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
++ hr->add_strong_code_root(_nm);
++ }
++ }
++
++ public:
++ HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
++
++ void do_oop(oop* o) {
++ do_oop_work(o);
++ }
++
++ void do_oop(narrowOop* o) {
++ do_oop_work(o);
++ }
++
++ void set_nm(nmethod* nm) {
++ _nm = nm;
++ }
++ };
++
++ HeapRegionGatheringOopClosure _oc;
++public:
++ G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
++
++ void do_code_blob(CodeBlob* cb) {
++ nmethod* nm = cb->as_nmethod_or_null();
++ if (nm != NULL) {
++ if (!nm->test_set_oops_do_mark()) {
++ _oc.set_nm(nm);
++ nm->oops_do(&_oc);
++ nm->fix_oop_relocations();
++ }
++ }
++ }
++};
++
++
++void G1RootProcessor::worker_has_discovered_all_strong_classes() {
++ uint n_workers = _g1h->n_par_threads();
++ assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
++
++ if (n_workers > 0) {
++ uint new_value = (uint)Atomic::add(1, &_n_workers_discovered_strong_classes);
++ if (new_value == n_workers) {
++ // This thread is last. Notify the others.
++ MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
++ _lock.notify_all();
++ }
++ }
++}
++
++void G1RootProcessor::wait_until_all_strong_classes_discovered() {
++ uint n_workers = _g1h->n_par_threads();
++ assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
++
++ if (n_workers > 0 && (uint)_n_workers_discovered_strong_classes != n_workers) {
++ MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
++ while ((uint)_n_workers_discovered_strong_classes != n_workers) {
++ _lock.wait(Mutex::_no_safepoint_check_flag, 0, false);
++ }
++ }
++}
++
++G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) :
++ _g1h(g1h),
++ _process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)),
++ _srs(g1h),
++ _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false),
++ _n_workers_discovered_strong_classes(0) {}
++
++void G1RootProcessor::evacuate_roots(OopClosure* scan_non_heap_roots,
++ OopClosure* scan_non_heap_weak_roots,
++ CLDClosure* scan_strong_clds,
++ CLDClosure* scan_weak_clds,
++ bool trace_metadata,
++ uint worker_i) {
++ // First scan the shared roots.
++ double ext_roots_start = os::elapsedTime();
++ G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
++
++ BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
++ BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
++
++ OopClosure* const weak_roots = &buf_scan_non_heap_weak_roots;
++ OopClosure* const strong_roots = &buf_scan_non_heap_roots;
++
++ // CodeBlobClosures are not interoperable with BufferingOopClosures
++ G1CodeBlobClosure root_code_blobs(scan_non_heap_roots);
++
++ process_java_roots(strong_roots,
++ trace_metadata ? scan_strong_clds : NULL,
++ scan_strong_clds,
++ trace_metadata ? NULL : scan_weak_clds,
++ &root_code_blobs,
++ phase_times,
++ worker_i);
++
++ // This is the point where this worker thread will not find more strong CLDs/nmethods.
++ // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
++ if (trace_metadata) {
++ worker_has_discovered_all_strong_classes();
++ }
++
++ process_vm_roots(strong_roots, weak_roots, phase_times, worker_i);
++
++ {
++ // Now the CM ref_processor roots.
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CMRefRoots, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_refProcessor_oops_do)) {
++ // We need to treat the discovered reference lists of the
++ // concurrent mark ref processor as roots and keep entries
++ // (which are added by the marking threads) on them live
++ // until they can be processed at the end of marking.
++ _g1h->ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
++ }
++ }
++
++ if (trace_metadata) {
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WaitForStrongCLD, worker_i);
++ // Barrier to make sure all workers passed
++ // the strong CLD and strong nmethods phases.
++ wait_until_all_strong_classes_discovered();
++ }
++
++ // Now take the complement of the strong CLDs.
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WeakCLDRoots, worker_i);
++ ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
++ } else {
++ phase_times->record_time_secs(G1GCPhaseTimes::WaitForStrongCLD, worker_i, 0.0);
++ phase_times->record_time_secs(G1GCPhaseTimes::WeakCLDRoots, worker_i, 0.0);
++ }
++
++ // Finish up any enqueued closure apps (attributed as object copy time).
++ buf_scan_non_heap_roots.done();
++ buf_scan_non_heap_weak_roots.done();
++
++ double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
++ + buf_scan_non_heap_weak_roots.closure_app_seconds();
++
++ phase_times->record_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, obj_copy_time_sec);
++
++ double ext_root_time_sec = os::elapsedTime() - ext_roots_start - obj_copy_time_sec;
++
++ phase_times->record_time_secs(G1GCPhaseTimes::ExtRootScan, worker_i, ext_root_time_sec);
++
++ // During conc marking we have to filter the per-thread SATB buffers
++ // to make sure we remove any oops into the CSet (which will show up
++ // as implicitly live).
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SATBFiltering, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_filter_satb_buffers) && _g1h->mark_in_progress()) {
++ JavaThread::satb_mark_queue_set().filter_thread_buffers();
++ }
++ }
++
++ _process_strong_tasks->all_tasks_completed();
++}
++
++void G1RootProcessor::process_strong_roots(OopClosure* oops,
++ CLDClosure* clds,
++ CodeBlobClosure* blobs) {
++
++ process_java_roots(oops, clds, clds, NULL, blobs, NULL, 0);
++ process_vm_roots(oops, NULL, NULL, 0);
++
++ _process_strong_tasks->all_tasks_completed();
++}
++
++void G1RootProcessor::process_all_roots(OopClosure* oops,
++ CLDClosure* clds,
++ CodeBlobClosure* blobs) {
++
++ process_java_roots(oops, NULL, clds, clds, NULL, NULL, 0);
++ process_vm_roots(oops, oops, NULL, 0);
++
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_CodeCache_oops_do)) {
++ CodeCache::blobs_do(blobs);
++ }
++
++ _process_strong_tasks->all_tasks_completed();
++}
++
++void G1RootProcessor::process_java_roots(OopClosure* strong_roots,
++ CLDClosure* thread_stack_clds,
++ CLDClosure* strong_clds,
++ CLDClosure* weak_clds,
++ CodeBlobClosure* strong_code,
++ G1GCPhaseTimes* phase_times,
++ uint worker_i) {
++ assert(thread_stack_clds == NULL || weak_clds == NULL, "There is overlap between those, only one may be set");
++ // Iterating over the CLDG and the Threads are done early to allow us to
++ // first process the strong CLDs and nmethods and then, after a barrier,
++ // let the thread process the weak CLDs and nmethods.
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
++ ClassLoaderDataGraph::roots_cld_do(strong_clds, weak_clds);
++ }
++ }
++
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i);
++ Threads::possibly_parallel_oops_do(strong_roots, thread_stack_clds, strong_code);
++ }
++}
++
++void G1RootProcessor::process_vm_roots(OopClosure* strong_roots,
++ OopClosure* weak_roots,
++ G1GCPhaseTimes* phase_times,
++ uint worker_i) {
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::UniverseRoots, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Universe_oops_do)) {
++ Universe::oops_do(strong_roots);
++ }
++ }
++
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JNIRoots, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_JNIHandles_oops_do)) {
++ JNIHandles::oops_do(strong_roots);
++ }
++ }
++
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ObjectSynchronizerRoots, worker_i);
++ if (!_process_strong_tasks-> is_task_claimed(G1RP_PS_ObjectSynchronizer_oops_do)) {
++ ObjectSynchronizer::oops_do(strong_roots);
++ }
++ }
++
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::FlatProfilerRoots, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_FlatProfiler_oops_do)) {
++ FlatProfiler::oops_do(strong_roots);
++ }
++ }
++
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ManagementRoots, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Management_oops_do)) {
++ Management::oops_do(strong_roots);
++ }
++ }
++
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JVMTIRoots, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_jvmti_oops_do)) {
++ JvmtiExport::oops_do(strong_roots);
++ }
++ }
++
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SystemDictionaryRoots, worker_i);
++ if (!_process_strong_tasks->is_task_claimed(G1RP_PS_SystemDictionary_oops_do)) {
++ SystemDictionary::roots_oops_do(strong_roots, weak_roots);
++ }
++ }
++
++ {
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
++ // All threads execute the following. A specific chunk of buckets
++ // from the StringTable are the individual tasks.
++ if (weak_roots != NULL) {
++ StringTable::possibly_parallel_oops_do(weak_roots);
++ }
++ }
++}
++
++void G1RootProcessor::scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
++ OopClosure* scan_non_heap_weak_roots,
++ uint worker_i) {
++ G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
++ G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CodeCacheRoots, worker_i);
++
++ // Now scan the complement of the collection set.
++ G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots);
++
++ _g1h->g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
++}
++
++void G1RootProcessor::set_num_workers(int active_workers) {
++ _process_strong_tasks->set_n_threads(active_workers);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,121 @@
++/*
++ * 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.
++ *
++ */
++
++#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
++#define SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
++
++#include "memory/allocation.hpp"
++#include "memory/sharedHeap.hpp"
++#include "runtime/mutex.hpp"
++
++class CLDClosure;
++class CodeBlobClosure;
++class G1CollectedHeap;
++class G1GCPhaseTimes;
++class G1ParPushHeapRSClosure;
++class Monitor;
++class OopClosure;
++class SubTasksDone;
++
++// Scoped object to assist in applying oop, CLD and code blob closures to
++// root locations. Handles claiming of different root scanning tasks
++// and takes care of global state for root scanning via a StrongRootsScope.
++// In the parallel case there is a shared G1RootProcessor object where all
++// worker thread call the process_roots methods.
++class G1RootProcessor : public StackObj {
++ G1CollectedHeap* _g1h;
++ SubTasksDone* _process_strong_tasks;
++ SharedHeap::StrongRootsScope _srs;
++
++ // Used to implement the Thread work barrier.
++ Monitor _lock;
++ volatile jint _n_workers_discovered_strong_classes;
++
++ enum G1H_process_roots_tasks {
++ G1RP_PS_Universe_oops_do,
++ G1RP_PS_JNIHandles_oops_do,
++ G1RP_PS_ObjectSynchronizer_oops_do,
++ G1RP_PS_FlatProfiler_oops_do,
++ G1RP_PS_Management_oops_do,
++ G1RP_PS_SystemDictionary_oops_do,
++ G1RP_PS_ClassLoaderDataGraph_oops_do,
++ G1RP_PS_jvmti_oops_do,
++ G1RP_PS_CodeCache_oops_do,
++ G1RP_PS_filter_satb_buffers,
++ G1RP_PS_refProcessor_oops_do,
++ // Leave this one last.
++ G1RP_PS_NumElements
++ };
++
++ void worker_has_discovered_all_strong_classes();
++ void wait_until_all_strong_classes_discovered();
++
++ void process_java_roots(OopClosure* scan_non_heap_roots,
++ CLDClosure* thread_stack_clds,
++ CLDClosure* scan_strong_clds,
++ CLDClosure* scan_weak_clds,
++ CodeBlobClosure* scan_strong_code,
++ G1GCPhaseTimes* phase_times,
++ uint worker_i);
++
++ void process_vm_roots(OopClosure* scan_non_heap_roots,
++ OopClosure* scan_non_heap_weak_roots,
++ G1GCPhaseTimes* phase_times,
++ uint worker_i);
++
++public:
++ G1RootProcessor(G1CollectedHeap* g1h);
++
++ // Apply closures to the strongly and weakly reachable roots in the system
++ // in a single pass.
++ // Record and report timing measurements for sub phases using the worker_i
++ void evacuate_roots(OopClosure* scan_non_heap_roots,
++ OopClosure* scan_non_heap_weak_roots,
++ CLDClosure* scan_strong_clds,
++ CLDClosure* scan_weak_clds,
++ bool trace_metadata,
++ uint worker_i);
++
++ // Apply oops, clds and blobs to all strongly reachable roots in the system
++ void process_strong_roots(OopClosure* oops,
++ CLDClosure* clds,
++ CodeBlobClosure* blobs);
++
++ // Apply oops, clds and blobs to strongly and weakly reachable roots in the system
++ void process_all_roots(OopClosure* oops,
++ CLDClosure* clds,
++ CodeBlobClosure* blobs);
++
++ // Apply scan_rs to all locations in the union of the remembered sets for all
++ // regions in the collection set
++ // (having done "set_region" to indicate the region in which the root resides),
++ void scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
++ OopClosure* scan_non_heap_weak_roots,
++ uint worker_i);
++
++ // Inform the root processor about the number of worker threads
++ void set_num_workers(int active_workers);
++};
++
++#endif // SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -105,7 +105,7 @@
+
+ void G1StringDedup::oops_do(OopClosure* keep_alive) {
+ assert(is_enabled(), "String deduplication not enabled");
+- unlink_or_oops_do(NULL, keep_alive);
++ unlink_or_oops_do(NULL, keep_alive, true /* allow_resize_and_rehash */);
+ }
+
+ void G1StringDedup::unlink(BoolObjectClosure* is_alive) {
+@@ -122,37 +122,35 @@
+ class G1StringDedupUnlinkOrOopsDoTask : public AbstractGangTask {
+ private:
+ G1StringDedupUnlinkOrOopsDoClosure _cl;
++ G1GCPhaseTimes* _phase_times;
+
+ public:
+ G1StringDedupUnlinkOrOopsDoTask(BoolObjectClosure* is_alive,
+ OopClosure* keep_alive,
+- bool allow_resize_and_rehash) :
++ bool allow_resize_and_rehash,
++ G1GCPhaseTimes* phase_times) :
+ AbstractGangTask("G1StringDedupUnlinkOrOopsDoTask"),
+- _cl(is_alive, keep_alive, allow_resize_and_rehash) {
+- }
++ _cl(is_alive, keep_alive, allow_resize_and_rehash), _phase_times(phase_times) { }
+
+ virtual void work(uint worker_id) {
+- double queue_fixup_start = os::elapsedTime();
+- G1StringDedupQueue::unlink_or_oops_do(&_cl);
+-
+- double table_fixup_start = os::elapsedTime();
+- G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
+-
+- double queue_fixup_time_ms = (table_fixup_start - queue_fixup_start) * 1000.0;
+- double table_fixup_time_ms = (os::elapsedTime() - table_fixup_start) * 1000.0;
+- G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
+- g1p->phase_times()->record_string_dedup_queue_fixup_worker_time(worker_id, queue_fixup_time_ms);
+- g1p->phase_times()->record_string_dedup_table_fixup_worker_time(worker_id, table_fixup_time_ms);
++ {
++ G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupQueueFixup, worker_id);
++ G1StringDedupQueue::unlink_or_oops_do(&_cl);
++ }
++ {
++ G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupTableFixup, worker_id);
++ G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
++ }
+ }
+ };
+
+-void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool allow_resize_and_rehash) {
++void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive,
++ OopClosure* keep_alive,
++ bool allow_resize_and_rehash,
++ G1GCPhaseTimes* phase_times) {
+ assert(is_enabled(), "String deduplication not enabled");
+- G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
+- g1p->phase_times()->note_string_dedup_fixup_start();
+- double fixup_start = os::elapsedTime();
+
+- G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash);
++ G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash, phase_times);
+ if (G1CollectedHeap::use_parallel_gc_threads()) {
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+ g1h->set_par_threads();
+@@ -161,10 +159,6 @@
+ } else {
+ task.work(0);
+ }
+-
+- double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
+- g1p->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
+- g1p->phase_times()->note_string_dedup_fixup_end();
+ }
+
+ void G1StringDedup::threads_do(ThreadClosure* tc) {
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -90,6 +90,7 @@
+ class ThreadClosure;
+ class outputStream;
+ class G1StringDedupTable;
++class G1GCPhaseTimes;
+
+ //
+ // Main interface for interacting with string deduplication.
+@@ -130,7 +131,7 @@
+ static void oops_do(OopClosure* keep_alive);
+ static void unlink(BoolObjectClosure* is_alive);
+ static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive,
+- bool allow_resize_and_rehash = true);
++ bool allow_resize_and_rehash, G1GCPhaseTimes* phase_times = NULL);
+
+ static void threads_do(ThreadClosure* tc);
+ static void print_worker_threads_on(outputStream* st);
+--- ./hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -217,14 +217,6 @@
+ product(uintx, G1HeapRegionSize, 0, \
+ "Size of the G1 regions.") \
+ \
+- experimental(bool, G1UseParallelRSetUpdating, true, \
+- "Enables the parallelization of remembered set updating " \
+- "during evacuation pauses") \
+- \
+- experimental(bool, G1UseParallelRSetScanning, true, \
+- "Enables the parallelization of remembered set scanning " \
+- "during evacuation pauses") \
+- \
+ product(uintx, G1ConcRefinementThreads, 0, \
+ "If non-0 is the number of parallel rem set update threads, " \
+ "otherwise the value is determined ergonomically.") \
+@@ -282,10 +274,14 @@
+ product(uintx, G1MixedGCCountTarget, 8, \
+ "The target number of mixed GCs after a marking cycle.") \
+ \
+- experimental(bool, G1ReclaimDeadHumongousObjectsAtYoungGC, true, \
++ experimental(bool, G1EagerReclaimHumongousObjects, true, \
+ "Try to reclaim dead large objects at every young GC.") \
+ \
+- experimental(bool, G1TraceReclaimDeadHumongousObjectsAtYoungGC, false, \
++ experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true, \
++ "Try to reclaim dead large objects that have a few stale " \
++ "references at every young GC.") \
++ \
++ experimental(bool, G1TraceEagerReclaimHumongousObjects, false, \
+ "Print some information about large object liveness " \
+ "at every young GC.") \
+ \
+--- ./hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -47,93 +47,55 @@
+ size_t HeapRegion::CardsPerRegion = 0;
+
+ HeapRegionDCTOC::HeapRegionDCTOC(G1CollectedHeap* g1,
+- HeapRegion* hr, ExtendedOopClosure* cl,
+- CardTableModRefBS::PrecisionStyle precision,
+- FilterKind fk) :
++ HeapRegion* hr,
++ G1ParPushHeapRSClosure* cl,
++ CardTableModRefBS::PrecisionStyle precision) :
+ DirtyCardToOopClosure(hr, cl, precision, NULL),
+- _hr(hr), _fk(fk), _g1(g1) { }
++ _hr(hr), _rs_scan(cl), _g1(g1) { }
+
+ FilterOutOfRegionClosure::FilterOutOfRegionClosure(HeapRegion* r,
+ OopClosure* oc) :
+ _r_bottom(r->bottom()), _r_end(r->end()), _oc(oc) { }
+
+-template<class ClosureType>
+-HeapWord* walk_mem_region_loop(ClosureType* cl, G1CollectedHeap* g1h,
+- HeapRegion* hr,
+- HeapWord* cur, HeapWord* top) {
+- oop cur_oop = oop(cur);
+- size_t oop_size = hr->block_size(cur);
+- HeapWord* next_obj = cur + oop_size;
+- while (next_obj < top) {
+- // Keep filtering the remembered set.
+- if (!g1h->is_obj_dead(cur_oop, hr)) {
+- // Bottom lies entirely below top, so we can call the
+- // non-memRegion version of oop_iterate below.
+- cur_oop->oop_iterate(cl);
+- }
+- cur = next_obj;
+- cur_oop = oop(cur);
+- oop_size = hr->block_size(cur);
+- next_obj = cur + oop_size;
+- }
+- return cur;
+-}
+-
+ void HeapRegionDCTOC::walk_mem_region(MemRegion mr,
+ HeapWord* bottom,
+ HeapWord* top) {
+ G1CollectedHeap* g1h = _g1;
+ size_t oop_size;
+- ExtendedOopClosure* cl2 = NULL;
+-
+- FilterIntoCSClosure intoCSFilt(this, g1h, _cl);
+- FilterOutOfRegionClosure outOfRegionFilt(_hr, _cl);
+-
+- switch (_fk) {
+- case NoFilterKind: cl2 = _cl; break;
+- case IntoCSFilterKind: cl2 = &intoCSFilt; break;
+- case OutOfRegionFilterKind: cl2 = &outOfRegionFilt; break;
+- default: ShouldNotReachHere();
+- }
++ HeapWord* cur = bottom;
+
+ // Start filtering what we add to the remembered set. If the object is
+ // not considered dead, either because it is marked (in the mark bitmap)
+ // or it was allocated after marking finished, then we add it. Otherwise
+ // we can safely ignore the object.
+- if (!g1h->is_obj_dead(oop(bottom), _hr)) {
+- oop_size = oop(bottom)->oop_iterate(cl2, mr);
++ if (!g1h->is_obj_dead(oop(cur), _hr)) {
++ oop_size = oop(cur)->oop_iterate(_rs_scan, mr);
+ } else {
+- oop_size = _hr->block_size(bottom);
++ oop_size = _hr->block_size(cur);
+ }
+
+- bottom += oop_size;
++ cur += oop_size;
+
+- if (bottom < top) {
+- // We replicate the loop below for several kinds of possible filters.
+- switch (_fk) {
+- case NoFilterKind:
+- bottom = walk_mem_region_loop(_cl, g1h, _hr, bottom, top);
+- break;
+-
+- case IntoCSFilterKind: {
+- FilterIntoCSClosure filt(this, g1h, _cl);
+- bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
+- break;
+- }
+-
+- case OutOfRegionFilterKind: {
+- FilterOutOfRegionClosure filt(_hr, _cl);
+- bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
+- break;
+- }
+-
+- default:
+- ShouldNotReachHere();
++ if (cur < top) {
++ oop cur_oop = oop(cur);
++ oop_size = _hr->block_size(cur);
++ HeapWord* next_obj = cur + oop_size;
++ while (next_obj < top) {
++ // Keep filtering the remembered set.
++ if (!g1h->is_obj_dead(cur_oop, _hr)) {
++ // Bottom lies entirely below top, so we can call the
++ // non-memRegion version of oop_iterate below.
++ cur_oop->oop_iterate(_rs_scan);
++ }
++ cur = next_obj;
++ cur_oop = oop(cur);
++ oop_size = _hr->block_size(cur);
++ next_obj = cur + oop_size;
+ }
+
+ // Last object. Need to do dead-obj filtering here too.
+- if (!g1h->is_obj_dead(oop(bottom), _hr)) {
+- oop(bottom)->oop_iterate(cl2, mr);
++ if (!g1h->is_obj_dead(oop(cur), _hr)) {
++ oop(cur)->oop_iterate(_rs_scan, mr);
+ }
+ }
+ }
+@@ -338,7 +300,7 @@
+ _orig_end = mr.end();
+ hr_clear(false /*par*/, false /*clear_space*/);
+ set_top(bottom());
+- record_top_and_timestamp();
++ record_timestamp();
+ }
+
+ CompactibleSpace* HeapRegion::next_compaction_space() const {
+@@ -426,9 +388,9 @@
+
+ // If we're within a stop-world GC, then we might look at a card in a
+ // GC alloc region that extends onto a GC LAB, which may not be
+- // parseable. Stop such at the "saved_mark" of the region.
++ // parseable. Stop such at the "scan_top" of the region.
+ if (g1h->is_gc_active()) {
+- mr = mr.intersection(used_region_at_save_marks());
++ mr = mr.intersection(MemRegion(bottom(), scan_top()));
+ } else {
+ mr = mr.intersection(used_region());
+ }
+@@ -468,7 +430,7 @@
+ oop obj;
+
+ HeapWord* next = cur;
+- while (next <= start) {
++ do {
+ cur = next;
+ obj = oop(cur);
+ if (obj->klass_or_null() == NULL) {
+@@ -477,45 +439,38 @@
+ }
+ // Otherwise...
+ next = cur + block_size(cur);
+- }
++ } while (next <= start);
+
+ // If we finish the above loop...We have a parseable object that
+ // begins on or before the start of the memory region, and ends
+ // inside or spans the entire region.
+-
+- assert(obj == oop(cur), "sanity");
+ assert(cur <= start, "Loop postcondition");
+ assert(obj->klass_or_null() != NULL, "Loop postcondition");
+- assert((cur + block_size(cur)) > start, "Loop postcondition");
+
+- if (!g1h->is_obj_dead(obj)) {
+- obj->oop_iterate(cl, mr);
+- }
+-
+- while (cur < end) {
++ do {
+ obj = oop(cur);
++ assert((cur + block_size(cur)) > (HeapWord*)obj, "Loop invariant");
+ if (obj->klass_or_null() == NULL) {
+ // Ran into an unparseable point.
+ return cur;
+- };
++ }
+
+- // Otherwise:
+- next = cur + block_size(cur);
++ // Advance the current pointer. "obj" still points to the object to iterate.
++ cur = cur + block_size(cur);
+
+ if (!g1h->is_obj_dead(obj)) {
+- if (next < end || !obj->is_objArray()) {
+- // This object either does not span the MemRegion
+- // boundary, or if it does it's not an array.
+- // Apply closure to whole object.
++ // Non-objArrays are sometimes marked imprecise at the object start. We
++ // always need to iterate over them in full.
++ // We only iterate over object arrays in full if they are completely contained
++ // in the memory region.
++ if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur <= end)) {
+ obj->oop_iterate(cl);
+ } else {
+- // This obj is an array that spans the boundary.
+- // Stop at the boundary.
+ obj->oop_iterate(cl, mr);
+ }
+ }
+- cur = next;
+- }
++ } while (cur < end);
++
+ return NULL;
+ }
+
+@@ -980,7 +935,7 @@
+
+ void G1OffsetTableContigSpace::clear(bool mangle_space) {
+ set_top(bottom());
+- set_saved_mark_word(bottom());
++ _scan_top = bottom();
+ CompactibleSpace::clear(mangle_space);
+ reset_bot();
+ }
+@@ -1012,41 +967,42 @@
+ return _offsets.threshold();
+ }
+
+-HeapWord* G1OffsetTableContigSpace::saved_mark_word() const {
++HeapWord* G1OffsetTableContigSpace::scan_top() const {
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+- assert( _gc_time_stamp <= g1h->get_gc_time_stamp(), "invariant" );
+ HeapWord* local_top = top();
+ OrderAccess::loadload();
+- if (_gc_time_stamp < g1h->get_gc_time_stamp()) {
++ const unsigned local_time_stamp = _gc_time_stamp;
++ assert(local_time_stamp <= g1h->get_gc_time_stamp(), "invariant");
++ if (local_time_stamp < g1h->get_gc_time_stamp()) {
+ return local_top;
+ } else {
+- return Space::saved_mark_word();
++ return _scan_top;
+ }
+ }
+
+-void G1OffsetTableContigSpace::record_top_and_timestamp() {
++void G1OffsetTableContigSpace::record_timestamp() {
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+ unsigned curr_gc_time_stamp = g1h->get_gc_time_stamp();
+
+ if (_gc_time_stamp < curr_gc_time_stamp) {
+- // The order of these is important, as another thread might be
+- // about to start scanning this region. If it does so after
+- // set_saved_mark and before _gc_time_stamp = ..., then the latter
+- // will be false, and it will pick up top() as the high water mark
+- // of region. If it does so after _gc_time_stamp = ..., then it
+- // will pick up the right saved_mark_word() as the high water mark
+- // of the region. Either way, the behaviour will be correct.
+- Space::set_saved_mark_word(top());
+- OrderAccess::storestore();
++ // Setting the time stamp here tells concurrent readers to look at
++ // scan_top to know the maximum allowed address to look at.
++
++ // scan_top should be bottom for all regions except for the
++ // retained old alloc region which should have scan_top == top
++ HeapWord* st = _scan_top;
++ guarantee(st == _bottom || st == _top, "invariant");
++
+ _gc_time_stamp = curr_gc_time_stamp;
+- // No need to do another barrier to flush the writes above. If
+- // this is called in parallel with other threads trying to
+- // allocate into the region, the caller should call this while
+- // holding a lock and when the lock is released the writes will be
+- // flushed.
+ }
+ }
+
++void G1OffsetTableContigSpace::record_retained_region() {
++ // scan_top is the maximum address where it's safe for the next gc to
++ // scan this region.
++ _scan_top = top();
++}
++
+ void G1OffsetTableContigSpace::safe_object_iterate(ObjectClosure* blk) {
+ object_iterate(blk);
+ }
+@@ -1080,6 +1036,8 @@
+ void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
+ CompactibleSpace::initialize(mr, clear_space, mangle_space);
+ _top = bottom();
++ _scan_top = bottom();
++ set_saved_mark_word(NULL);
+ reset_bot();
+ }
+
+--- ./hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -67,17 +67,9 @@
+ // sets.
+
+ class HeapRegionDCTOC : public DirtyCardToOopClosure {
+-public:
+- // Specification of possible DirtyCardToOopClosure filtering.
+- enum FilterKind {
+- NoFilterKind,
+- IntoCSFilterKind,
+- OutOfRegionFilterKind
+- };
+-
+-protected:
++private:
+ HeapRegion* _hr;
+- FilterKind _fk;
++ G1ParPushHeapRSClosure* _rs_scan;
+ G1CollectedHeap* _g1;
+
+ // Walk the given memory region from bottom to (actual) top
+@@ -90,9 +82,9 @@
+
+ public:
+ HeapRegionDCTOC(G1CollectedHeap* g1,
+- HeapRegion* hr, ExtendedOopClosure* cl,
+- CardTableModRefBS::PrecisionStyle precision,
+- FilterKind fk);
++ HeapRegion* hr,
++ G1ParPushHeapRSClosure* cl,
++ CardTableModRefBS::PrecisionStyle precision);
+ };
+
+ // The complicating factor is that BlockOffsetTable diverged
+@@ -101,28 +93,25 @@
+ // OffsetTableContigSpace. If the two versions of BlockOffsetTable could
+ // be reconciled, then G1OffsetTableContigSpace could go away.
+
+-// The idea behind time stamps is the following. Doing a save_marks on
+-// all regions at every GC pause is time consuming (if I remember
+-// well, 10ms or so). So, we would like to do that only for regions
+-// that are GC alloc regions. To achieve this, we use time
+-// stamps. For every evacuation pause, G1CollectedHeap generates a
+-// unique time stamp (essentially a counter that gets
+-// incremented). Every time we want to call save_marks on a region,
+-// we set the saved_mark_word to top and also copy the current GC
+-// time stamp to the time stamp field of the space. Reading the
+-// saved_mark_word involves checking the time stamp of the
+-// region. If it is the same as the current GC time stamp, then we
+-// can safely read the saved_mark_word field, as it is valid. If the
+-// time stamp of the region is not the same as the current GC time
+-// stamp, then we instead read top, as the saved_mark_word field is
+-// invalid. Time stamps (on the regions and also on the
+-// G1CollectedHeap) are reset at every cleanup (we iterate over
+-// the regions anyway) and at the end of a Full GC. The current scheme
+-// that uses sequential unsigned ints will fail only if we have 4b
++// The idea behind time stamps is the following. We want to keep track of
++// the highest address where it's safe to scan objects for each region.
++// This is only relevant for current GC alloc regions so we keep a time stamp
++// per region to determine if the region has been allocated during the current
++// GC or not. If the time stamp is current we report a scan_top value which
++// was saved at the end of the previous GC for retained alloc regions and which is
++// equal to the bottom for all other regions.
++// There is a race between card scanners and allocating gc workers where we must ensure
++// that card scanners do not read the memory allocated by the gc workers.
++// In order to enforce that, we must not return a value of _top which is more recent than the
++// time stamp. This is due to the fact that a region may become a gc alloc region at
++// some point after we've read the timestamp value as being < the current time stamp.
++// The time stamps are re-initialized to zero at cleanup and at Full GCs.
++// The current scheme that uses sequential unsigned ints will fail only if we have 4b
+ // evacuation pauses between two cleanups, which is _highly_ unlikely.
+ class G1OffsetTableContigSpace: public CompactibleSpace {
+ friend class VMStructs;
+ HeapWord* _top;
++ HeapWord* volatile _scan_top;
+ protected:
+ G1BlockOffsetArrayContigSpace _offsets;
+ Mutex _par_alloc_lock;
+@@ -166,10 +155,11 @@
+ void set_bottom(HeapWord* value);
+ void set_end(HeapWord* value);
+
+- virtual HeapWord* saved_mark_word() const;
+- void record_top_and_timestamp();
++ HeapWord* scan_top() const;
++ void record_timestamp();
+ void reset_gc_time_stamp() { _gc_time_stamp = 0; }
+ unsigned get_gc_time_stamp() { return _gc_time_stamp; }
++ void record_retained_region();
+
+ // See the comment above in the declaration of _pre_dummy_top for an
+ // explanation of what it is.
+@@ -193,6 +183,8 @@
+ virtual HeapWord* allocate(size_t word_size);
+ HeapWord* par_allocate(size_t word_size);
+
++ HeapWord* saved_mark_word() const { ShouldNotReachHere(); return NULL; }
++
+ // MarkSweep support phase3
+ virtual HeapWord* initialize_threshold();
+ virtual HeapWord* cross_threshold(HeapWord* start, HeapWord* end);
+--- ./hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -145,6 +145,24 @@
+ }
+ }
+
++MemoryUsage HeapRegionManager::get_auxiliary_data_memory_usage() const {
++ size_t used_sz =
++ _prev_bitmap_mapper->committed_size() +
++ _next_bitmap_mapper->committed_size() +
++ _bot_mapper->committed_size() +
++ _cardtable_mapper->committed_size() +
++ _card_counts_mapper->committed_size();
++
++ size_t committed_sz =
++ _prev_bitmap_mapper->reserved_size() +
++ _next_bitmap_mapper->reserved_size() +
++ _bot_mapper->reserved_size() +
++ _cardtable_mapper->reserved_size() +
++ _card_counts_mapper->reserved_size();
++
++ return MemoryUsage(0, used_sz, committed_sz, committed_sz);
++}
++
+ uint HeapRegionManager::expand_by(uint num_regions) {
+ return expand_at(0, num_regions);
+ }
+--- ./hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2013, 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
+@@ -28,6 +28,7 @@
+ #include "gc_implementation/g1/g1BiasedArray.hpp"
+ #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
+ #include "gc_implementation/g1/heapRegionSet.hpp"
++#include "services/memoryUsage.hpp"
+
+ class HeapRegion;
+ class HeapRegionClosure;
+@@ -197,6 +198,8 @@
+ // Return the maximum number of regions in the heap.
+ uint max_length() const { return (uint)_regions.length(); }
+
++ MemoryUsage get_auxiliary_data_memory_usage() const;
++
+ MemRegion reserved() const { return MemRegion(heap_bottom(), heap_end()); }
+
+ // Expand the sequence to reflect that the heap has grown. Either create new
+--- ./hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -694,6 +694,18 @@
+ clear_fcc();
+ }
+
++bool OtherRegionsTable::occupancy_less_or_equal_than(size_t limit) const {
++ if (limit <= (size_t)G1RSetSparseRegionEntries) {
++ return occ_coarse() == 0 && _first_all_fine_prts == NULL && occ_sparse() <= limit;
++ } else {
++ // Current uses of this method may only use values less than G1RSetSparseRegionEntries
++ // for the limit. The solution, comparing against occupied() would be too slow
++ // at this time.
++ Unimplemented();
++ return false;
++ }
++}
++
+ bool OtherRegionsTable::is_empty() const {
+ return occ_sparse() == 0 && occ_coarse() == 0 && _first_all_fine_prts == NULL;
+ }
+--- ./hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -181,6 +181,10 @@
+ // sense.
+ void add_reference(OopOrNarrowOopStar from, int tid);
+
++ // Returns whether this remembered set (and all sub-sets) have an occupancy
++ // that is less or equal than the given occupancy.
++ bool occupancy_less_or_equal_than(size_t limit) const;
++
+ // Removes any entries shown by the given bitmaps to contain only dead
+ // objects.
+ void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
+@@ -276,6 +280,10 @@
+ return (strong_code_roots_list_length() == 0) && _other_regions.is_empty();
+ }
+
++ bool occupancy_less_or_equal_than(size_t occ) const {
++ return (strong_code_roots_list_length() == 0) && _other_regions.occupancy_less_or_equal_than(occ);
++ }
++
+ size_t occupied() {
+ MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag);
+ return occupied_locked();
+--- ./hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -420,6 +420,7 @@
+ ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(heap.word_size()));
+ G1RegionToSpaceMapper* bot_storage =
+ G1RegionToSpaceMapper::create_mapper(bot_rs,
++ bot_rs.size(),
+ os::vm_page_size(),
+ HeapRegion::GrainBytes,
+ G1BlockOffsetSharedArray::N_bytes,
+--- ./hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -29,36 +29,74 @@
+ #include "memory/sharedHeap.hpp"
+ #include "oops/oop.inline.hpp"
+ #include "runtime/mutexLocker.hpp"
++#include "runtime/safepoint.hpp"
+ #include "runtime/thread.hpp"
+ #include "runtime/vmThread.hpp"
+
+ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
+ void ObjPtrQueue::flush() {
+- // The buffer might contain refs into the CSet. We have to filter it
+- // first before we flush it, otherwise we might end up with an
+- // enqueued buffer with refs into the CSet which breaks our invariants.
++ // Filter now to possibly save work later. If filtering empties the
++ // buffer then flush_impl can deallocate the buffer.
+ filter();
+ flush_impl();
+ }
+
+-// This method removes entries from an SATB buffer that will not be
+-// useful to the concurrent marking threads. An entry is removed if it
+-// satisfies one of the following conditions:
++// Return true if a SATB buffer entry refers to an object that
++// requires marking.
+ //
+-// * it points to an object outside the G1 heap (G1's concurrent
+-// marking only visits objects inside the G1 heap),
+-// * it points to an object that has been allocated since marking
+-// started (according to SATB those objects do not need to be
+-// visited during marking), or
+-// * it points to an object that has already been marked (no need to
+-// process it again).
++// The entry must point into the G1 heap. In particular, it must not
++// be a NULL pointer. NULL pointers are pre-filtered and never
++// inserted into a SATB buffer.
+ //
+-// The rest of the entries will be retained and are compacted towards
+-// the top of the buffer. Note that, because we do not allow old
+-// regions in the CSet during marking, all objects on the CSet regions
+-// are young (eden or survivors) and therefore implicitly live. So any
+-// references into the CSet will be removed during filtering.
++// An entry that is below the NTAMS pointer for the containing heap
++// region requires marking. Such an entry must point to a valid object.
++//
++// An entry that is at least the NTAMS pointer for the containing heap
++// region might be any of the following, none of which should be marked.
++//
++// * A reference to an object allocated since marking started.
++// According to SATB, such objects are implicitly kept live and do
++// not need to be dealt with via SATB buffer processing.
++//
++// * A reference to a young generation object. Young objects are
++// handled separately and are not marked by concurrent marking.
++//
++// * A stale reference to a young generation object. If a young
++// generation object reference is recorded and not filtered out
++// before being moved by a young collection, the reference becomes
++// stale.
++//
++// * A stale reference to an eagerly reclaimed humongous object. If a
++// humongous object is recorded and then reclaimed, the reference
++// becomes stale.
++//
++// The stale reference cases are implicitly handled by the NTAMS
++// comparison. Because of the possibility of stale references, buffer
++// processing must be somewhat circumspect and not assume entries
++// in an unfiltered buffer refer to valid objects.
++
++inline bool requires_marking(const void* entry, G1CollectedHeap* heap) {
++ // Includes rejection of NULL pointers.
++ assert(heap->is_in_reserved(entry),
++ err_msg("Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry)));
++
++ HeapRegion* region = heap->heap_region_containing_raw(entry);
++ assert(region != NULL, err_msg("No region for " PTR_FORMAT, p2i(entry)));
++ if (entry >= region->next_top_at_mark_start()) {
++ return false;
++ }
++
++ assert(((oop)entry)->is_oop(true /* ignore mark word */),
++ err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry)));
++
++ return true;
++}
++
++// This method removes entries from a SATB buffer that will not be
++// useful to the concurrent marking threads. Entries are retained if
++// they require marking and are not already marked. Retained entries
++// are compacted toward the top of the buffer.
+
+ void ObjPtrQueue::filter() {
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+@@ -80,26 +118,25 @@
+ assert(i > 0, "we should have at least one more entry to process");
+ i -= oopSize;
+ debug_only(entries += 1;)
+- oop* p = (oop*) &buf[byte_index_to_index((int) i)];
+- oop obj = *p;
++ void** p = &buf[byte_index_to_index((int) i)];
++ void* entry = *p;
+ // NULL the entry so that unused parts of the buffer contain NULLs
+ // at the end. If we are going to retain it we will copy it to its
+ // final place. If we have retained all entries we have visited so
+ // far, we'll just end up copying it to the same place.
+ *p = NULL;
+
+- bool retain = g1h->is_obj_ill(obj);
+- if (retain) {
++ if (requires_marking(entry, g1h) && !g1h->isMarkedNext((oop)entry)) {
+ assert(new_index > 0, "we should not have already filled up the buffer");
+ new_index -= oopSize;
+ assert(new_index >= i,
+ "new_index should never be below i, as we alwaysr compact 'up'");
+- oop* new_p = (oop*) &buf[byte_index_to_index((int) new_index)];
++ void** new_p = &buf[byte_index_to_index((int) new_index)];
+ assert(new_p >= p, "the destination location should never be below "
+ "the source as we always compact 'up'");
+ assert(*new_p == NULL,
+ "we should have already cleared the destination location");
+- *new_p = obj;
++ *new_p = entry;
+ debug_only(retained += 1;)
+ }
+ }
+@@ -126,10 +163,7 @@
+ assert(_lock == NULL || _lock->owned_by_self(),
+ "we should have taken the lock before calling this");
+
+- // Even if G1SATBBufferEnqueueingThresholdPercent == 0 we have to
+- // filter the buffer given that this will remove any references into
+- // the CSet as we currently assume that no such refs will appear in
+- // enqueued buffers.
++ // If G1SATBBufferEnqueueingThresholdPercent == 0 we could skip filtering.
+
+ // This method should only be called if there is a non-NULL buffer
+ // that is full.
+@@ -146,31 +180,19 @@
+ return should_enqueue;
+ }
+
+-void ObjPtrQueue::apply_closure(ObjectClosure* cl) {
++void ObjPtrQueue::apply_closure_and_empty(SATBBufferClosure* cl) {
++ assert(SafepointSynchronize::is_at_safepoint(),
++ "SATB queues must only be processed at safepoints");
+ if (_buf != NULL) {
+- apply_closure_to_buffer(cl, _buf, _index, _sz);
+- }
+-}
+-
+-void ObjPtrQueue::apply_closure_and_empty(ObjectClosure* cl) {
+- if (_buf != NULL) {
+- apply_closure_to_buffer(cl, _buf, _index, _sz);
++ assert(_index % sizeof(void*) == 0, "invariant");
++ assert(_sz % sizeof(void*) == 0, "invariant");
++ assert(_index <= _sz, "invariant");
++ cl->do_buffer(_buf + byte_index_to_index((int)_index),
++ byte_index_to_index((int)(_sz - _index)));
+ _index = _sz;
+ }
+ }
+
+-void ObjPtrQueue::apply_closure_to_buffer(ObjectClosure* cl,
+- void** buf, size_t index, size_t sz) {
+- if (cl == NULL) return;
+- for (size_t i = index; i < sz; i += oopSize) {
+- oop obj = (oop)buf[byte_index_to_index((int)i)];
+- // There can be NULL entries because of destructors.
+- if (obj != NULL) {
+- cl->do_object(obj);
+- }
+- }
+-}
+-
+ #ifndef PRODUCT
+ // Helpful for debugging
+
+@@ -186,23 +208,12 @@
+ }
+ #endif // PRODUCT
+
+-#ifdef ASSERT
+-void ObjPtrQueue::verify_oops_in_buffer() {
+- if (_buf == NULL) return;
+- for (size_t i = _index; i < _sz; i += oopSize) {
+- oop obj = (oop)_buf[byte_index_to_index((int)i)];
+- assert(obj != NULL && obj->is_oop(true /* ignore mark word */),
+- "Not an oop");
+- }
+-}
+-#endif
+-
+ #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
+ #pragma warning( disable:4355 ) // 'this' : used in base member initializer list
+ #endif // _MSC_VER
+
+ SATBMarkQueueSet::SATBMarkQueueSet() :
+- PtrQueueSet(), _closure(NULL), _par_closures(NULL),
++ PtrQueueSet(),
+ _shared_satb_queue(this, true /*perm*/) { }
+
+ void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock,
+@@ -210,13 +221,9 @@
+ Mutex* lock) {
+ PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1);
+ _shared_satb_queue.set_lock(lock);
+- if (ParallelGCThreads > 0) {
+- _par_closures = NEW_C_HEAP_ARRAY(ObjectClosure*, ParallelGCThreads, mtGC);
+- }
+ }
+
+ void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) {
+- DEBUG_ONLY(t->satb_mark_queue().verify_oops_in_buffer();)
+ t->satb_mark_queue().handle_zero_index();
+ }
+
+@@ -276,17 +283,7 @@
+ shared_satb_queue()->filter();
+ }
+
+-void SATBMarkQueueSet::set_closure(ObjectClosure* closure) {
+- _closure = closure;
+-}
+-
+-void SATBMarkQueueSet::set_par_closure(int i, ObjectClosure* par_closure) {
+- assert(ParallelGCThreads > 0 && _par_closures != NULL, "Precondition");
+- _par_closures[i] = par_closure;
+-}
+-
+-bool SATBMarkQueueSet::apply_closure_to_completed_buffer_work(bool par,
+- uint worker) {
++bool SATBMarkQueueSet::apply_closure_to_completed_buffer(SATBBufferClosure* cl) {
+ BufferNode* nd = NULL;
+ {
+ MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
+@@ -298,10 +295,20 @@
+ if (_n_completed_buffers == 0) _process_completed = false;
+ }
+ }
+- ObjectClosure* cl = (par ? _par_closures[worker] : _closure);
+ if (nd != NULL) {
+ void **buf = BufferNode::make_buffer_from_node(nd);
+- ObjPtrQueue::apply_closure_to_buffer(cl, buf, 0, _sz);
++ // Skip over NULL entries at beginning (e.g. push end) of buffer.
++ // Filtering can result in non-full completed buffers; see
++ // should_enqueue_buffer.
++ assert(_sz % sizeof(void*) == 0, "invariant");
++ size_t limit = ObjPtrQueue::byte_index_to_index((int)_sz);
++ for (size_t i = 0; i < limit; ++i) {
++ if (buf[i] != NULL) {
++ // Found the end of the block of NULLs; process the remainder.
++ cl->do_buffer(buf + i, limit - i);
++ break;
++ }
++ }
+ deallocate_buffer(buf);
+ return true;
+ } else {
+@@ -309,28 +316,6 @@
+ }
+ }
+
+-void SATBMarkQueueSet::iterate_completed_buffers_read_only(ObjectClosure* cl) {
+- assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
+- assert(cl != NULL, "pre-condition");
+-
+- BufferNode* nd = _completed_buffers_head;
+- while (nd != NULL) {
+- void** buf = BufferNode::make_buffer_from_node(nd);
+- ObjPtrQueue::apply_closure_to_buffer(cl, buf, 0, _sz);
+- nd = nd->next();
+- }
+-}
+-
+-void SATBMarkQueueSet::iterate_thread_buffers_read_only(ObjectClosure* cl) {
+- assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
+- assert(cl != NULL, "pre-condition");
+-
+- for (JavaThread* t = Threads::first(); t; t = t->next()) {
+- t->satb_mark_queue().apply_closure(cl);
+- }
+- shared_satb_queue()->apply_closure(cl);
+-}
+-
+ #ifndef PRODUCT
+ // Helpful for debugging
+
+--- ./hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -25,32 +25,30 @@
+ #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_SATBQUEUE_HPP
+ #define SHARE_VM_GC_IMPLEMENTATION_G1_SATBQUEUE_HPP
+
++#include "memory/allocation.hpp"
+ #include "gc_implementation/g1/ptrQueue.hpp"
+
+-class ObjectClosure;
+ class JavaThread;
+ class SATBMarkQueueSet;
+
++// Base class for processing the contents of a SATB buffer.
++class SATBBufferClosure : public StackObj {
++protected:
++ ~SATBBufferClosure() { }
++
++public:
++ // Process the SATB entries in the designated buffer range.
++ virtual void do_buffer(void** buffer, size_t size) = 0;
++};
++
+ // A ptrQueue whose elements are "oops", pointers to object heads.
+ class ObjPtrQueue: public PtrQueue {
+- friend class Threads;
+ friend class SATBMarkQueueSet;
+- friend class G1RemarkThreadsClosure;
+
+ private:
+ // Filter out unwanted entries from the buffer.
+ void filter();
+
+- // Apply the closure to all elements.
+- void apply_closure(ObjectClosure* cl);
+-
+- // Apply the closure to all elements and empty the buffer;
+- void apply_closure_and_empty(ObjectClosure* cl);
+-
+- // Apply the closure to all elements of "buf", down to "index" (inclusive.)
+- static void apply_closure_to_buffer(ObjectClosure* cl,
+- void** buf, size_t index, size_t sz);
+-
+ public:
+ ObjPtrQueue(PtrQueueSet* qset, bool perm = false) :
+ // SATB queues are only active during marking cycles. We create
+@@ -63,6 +61,10 @@
+ // Process queue entries and free resources.
+ void flush();
+
++ // Apply cl to the active part of the buffer.
++ // Prerequisite: Must be at a safepoint.
++ void apply_closure_and_empty(SATBBufferClosure* cl);
++
+ // Overrides PtrQueue::should_enqueue_buffer(). See the method's
+ // definition for more information.
+ virtual bool should_enqueue_buffer();
+@@ -72,21 +74,11 @@
+ void print(const char* name);
+ static void print(const char* name, void** buf, size_t index, size_t sz);
+ #endif // PRODUCT
+-
+- void verify_oops_in_buffer() NOT_DEBUG_RETURN;
+ };
+
+ class SATBMarkQueueSet: public PtrQueueSet {
+- ObjectClosure* _closure;
+- ObjectClosure** _par_closures; // One per ParGCThread.
+-
+ ObjPtrQueue _shared_satb_queue;
+
+- // Utility function to support sequential and parallel versions. If
+- // "par" is true, then "worker" is the par thread id; if "false", worker
+- // is ignored.
+- bool apply_closure_to_completed_buffer_work(bool par, uint worker);
+-
+ #ifdef ASSERT
+ void dump_active_states(bool expected_active);
+ void verify_active_states(bool expected_active);
+@@ -110,32 +102,12 @@
+ // Filter all the currently-active SATB buffers.
+ void filter_thread_buffers();
+
+- // Register "blk" as "the closure" for all queues. Only one such closure
+- // is allowed. The "apply_closure_to_completed_buffer" method will apply
+- // this closure to a completed buffer, and "iterate_closure_all_threads"
+- // applies it to partially-filled buffers (the latter should only be done
+- // with the world stopped).
+- void set_closure(ObjectClosure* closure);
+- // Set the parallel closures: pointer is an array of pointers to
+- // closures, one for each parallel GC thread.
+- void set_par_closure(int i, ObjectClosure* closure);
+-
+- // If there exists some completed buffer, pop it, then apply the
+- // registered closure to all its elements, and return true. If no
+- // completed buffers exist, return false.
+- bool apply_closure_to_completed_buffer() {
+- return apply_closure_to_completed_buffer_work(false, 0);
+- }
+- // Parallel version of the above.
+- bool par_apply_closure_to_completed_buffer(uint worker) {
+- return apply_closure_to_completed_buffer_work(true, worker);
+- }
+-
+- // Apply the given closure on enqueued and currently-active buffers
+- // respectively. Both methods are read-only, i.e., they do not
+- // modify any of the buffers.
+- void iterate_completed_buffers_read_only(ObjectClosure* cl);
+- void iterate_thread_buffers_read_only(ObjectClosure* cl);
++ // If there exists some completed buffer, pop and process it, and
++ // return true. Otherwise return false. Processing a buffer
++ // consists of applying the closure to the buffer range starting
++ // with the first non-NULL entry to the end of the buffer; the
++ // leading entries may be NULL due to filtering.
++ bool apply_closure_to_completed_buffer(SATBBufferClosure* cl);
+
+ #ifndef PRODUCT
+ // Helpful for debugging
+--- ./hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2013, 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
+@@ -34,12 +34,11 @@
+ #include "gc_implementation/g1/vm_operations_g1.hpp"
+ #include "runtime/interfaceSupport.hpp"
+
+-VM_G1CollectForAllocation::VM_G1CollectForAllocation(
+- unsigned int gc_count_before,
+- size_t word_size)
++VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before,
++ size_t word_size)
+ : VM_G1OperationWithAllocRequest(gc_count_before, word_size,
+ GCCause::_allocation_failure) {
+- guarantee(word_size > 0, "an allocation should always be requested");
++ guarantee(word_size != 0, "An allocation should always be requested with this operation.");
+ }
+
+ void VM_G1CollectForAllocation::doit() {
+@@ -57,12 +56,11 @@
+ g1h->do_full_collection(false /* clear_all_soft_refs */);
+ }
+
+-VM_G1IncCollectionPause::VM_G1IncCollectionPause(
+- unsigned int gc_count_before,
+- size_t word_size,
+- bool should_initiate_conc_mark,
+- double target_pause_time_ms,
+- GCCause::Cause gc_cause)
++VM_G1IncCollectionPause::VM_G1IncCollectionPause(uint gc_count_before,
++ size_t word_size,
++ bool should_initiate_conc_mark,
++ double target_pause_time_ms,
++ GCCause::Cause gc_cause)
+ : VM_G1OperationWithAllocRequest(gc_count_before, word_size, gc_cause),
+ _should_initiate_conc_mark(should_initiate_conc_mark),
+ _target_pause_time_ms(target_pause_time_ms),
+@@ -75,7 +73,7 @@
+ }
+
+ bool VM_G1IncCollectionPause::doit_prologue() {
+- bool res = VM_GC_Operation::doit_prologue();
++ bool res = VM_G1OperationWithAllocRequest::doit_prologue();
+ if (!res) {
+ if (_should_initiate_conc_mark) {
+ // The prologue can fail for a couple of reasons. The first is that another GC
+@@ -169,7 +167,7 @@
+ }
+
+ void VM_G1IncCollectionPause::doit_epilogue() {
+- VM_GC_Operation::doit_epilogue();
++ VM_G1OperationWithAllocRequest::doit_epilogue();
+
+ // If the pause was initiated by a System.gc() and
+ // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
+@@ -230,7 +228,6 @@
+ }
+
+ void VM_CGC_Operation::doit() {
+- gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps);
+ TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
+ GCTraceTime t(_printGCMessage, G1Log::fine(), true, G1CollectedHeap::heap()->gc_timer_cm(), G1CollectedHeap::heap()->concurrent_mark()->concurrent_gc_id());
+ SharedHeap* sh = SharedHeap::heap();
+--- ./hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2012, 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
+@@ -36,20 +36,17 @@
+ // - VM_G1CollectForAllocation
+ // - VM_G1IncCollectionPause
+
+-class VM_G1OperationWithAllocRequest: public VM_GC_Operation {
++class VM_G1OperationWithAllocRequest : public VM_CollectForAllocation {
+ protected:
+- size_t _word_size;
+- HeapWord* _result;
+ bool _pause_succeeded;
+ AllocationContext_t _allocation_context;
+
+ public:
+- VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
+- size_t word_size,
++ VM_G1OperationWithAllocRequest(uint gc_count_before,
++ size_t word_size,
+ GCCause::Cause gc_cause)
+- : VM_GC_Operation(gc_count_before, gc_cause),
+- _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
+- HeapWord* result() { return _result; }
++ : VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
++ _pause_succeeded(false) {}
+ bool pause_succeeded() { return _pause_succeeded; }
+ void set_allocation_context(AllocationContext_t context) { _allocation_context = context; }
+ AllocationContext_t allocation_context() { return _allocation_context; }
+@@ -57,8 +54,8 @@
+
+ class VM_G1CollectFull: public VM_GC_Operation {
+ public:
+- VM_G1CollectFull(unsigned int gc_count_before,
+- unsigned int full_gc_count_before,
++ VM_G1CollectFull(uint gc_count_before,
++ uint full_gc_count_before,
+ GCCause::Cause cause)
+ : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
+ virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
+@@ -70,7 +67,7 @@
+
+ class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
+ public:
+- VM_G1CollectForAllocation(unsigned int gc_count_before,
++ VM_G1CollectForAllocation(uint gc_count_before,
+ size_t word_size);
+ virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
+ virtual void doit();
+@@ -84,9 +81,9 @@
+ bool _should_initiate_conc_mark;
+ bool _should_retry_gc;
+ double _target_pause_time_ms;
+- unsigned int _old_marking_cycles_completed_before;
++ uint _old_marking_cycles_completed_before;
+ public:
+- VM_G1IncCollectionPause(unsigned int gc_count_before,
++ VM_G1IncCollectionPause(uint gc_count_before,
+ size_t word_size,
+ bool should_initiate_conc_mark,
+ double target_pause_time_ms,
+--- ./hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -622,7 +622,7 @@
+ true, // Process younger gens, if any,
+ // as strong roots.
+ false, // no scope; this is parallel code
+- SharedHeap::SO_ScavengeCodeCache,
++ GenCollectedHeap::SO_ScavengeCodeCache,
+ GenCollectedHeap::StrongAndWeakRoots,
+ &par_scan_state.to_space_root_closure(),
+ &par_scan_state.older_gen_closure(),
+@@ -1197,8 +1197,10 @@
+ return real_forwardee(old);
+ }
+
+- new_obj = _next_gen->par_promote(par_scan_state->thread_num(),
+- old, m, sz);
++ if (!_promotion_failed) {
++ new_obj = _next_gen->par_promote(par_scan_state->thread_num(),
++ old, m, sz);
++ }
+
+ if (new_obj == NULL) {
+ // promotion failed, forward to self
+--- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -66,9 +66,10 @@
+
+ void GenerationSizer::initialize_size_info() {
+ trace_gen_sizes("ps heap raw");
+- const size_t page_sz = os::page_size_for_region(_min_heap_byte_size,
+- _max_heap_byte_size,
+- 8);
++ const size_t max_page_sz = os::page_size_for_region_aligned(_max_heap_byte_size, 8);
++ const size_t min_pages = 4; // 1 for eden + 1 for each survivor + 1 for old
++ const size_t min_page_sz = os::page_size_for_region_aligned(_min_heap_byte_size, min_pages);
++ const size_t page_sz = MIN2(max_page_sz, min_page_sz);
+
+ // Can a page size be something else than a power of two?
+ assert(is_power_of_2((intptr_t)page_sz), "must be a power of 2");
+--- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -55,7 +55,7 @@
+
+ const size_t words = bits / BitsPerWord;
+ const size_t raw_bytes = words * sizeof(idx_t);
+- const size_t page_sz = os::page_size_for_region(raw_bytes, raw_bytes, 10);
++ const size_t page_sz = os::page_size_for_region_aligned(raw_bytes, 10);
+ const size_t granularity = os::vm_allocation_granularity();
+ _reserved_byte_size = align_size_up(raw_bytes, MAX2(page_sz, granularity));
+
+--- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -261,7 +261,7 @@
+
+ uint loop_count = 0;
+ uint gc_count = 0;
+- int gclocker_stalled_count = 0;
++ uint gclocker_stalled_count = 0;
+
+ while (result == NULL) {
+ // We don't want to have multiple collections for a single filled generation.
+@@ -521,8 +521,8 @@
+ assert(!Heap_lock->owned_by_self(),
+ "this thread should not own the Heap_lock");
+
+- unsigned int gc_count = 0;
+- unsigned int full_gc_count = 0;
++ uint gc_count = 0;
++ uint full_gc_count = 0;
+ {
+ MutexLocker ml(Heap_lock);
+ // This value is guarded by the Heap_lock
+--- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -167,7 +167,6 @@
+ {
+ HandleMark hm;
+
+- gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
+ TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
+ GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer->gc_id());
+ TraceCollectorStats tcs(counters());
+--- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -401,7 +401,7 @@
+ ParallelCompactData::create_vspace(size_t count, size_t element_size)
+ {
+ const size_t raw_bytes = count * element_size;
+- const size_t page_sz = os::page_size_for_region(raw_bytes, raw_bytes, 10);
++ const size_t page_sz = os::page_size_for_region_aligned(raw_bytes, 10);
+ const size_t granularity = os::vm_allocation_granularity();
+ _reserved_byte_size = align_size_up(raw_bytes, MAX2(page_sz, granularity));
+
+@@ -2054,7 +2054,6 @@
+ gc_task_manager()->task_idle_workers();
+ heap->set_par_threads(gc_task_manager()->active_workers());
+
+- gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
+ TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
+ GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer.gc_id());
+ TraceCollectorStats tcs(counters());
+--- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -329,7 +329,6 @@
+ ResourceMark rm;
+ HandleMark hm;
+
+- gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
+ TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
+ GCTraceTime t1(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer.gc_id());
+ TraceCollectorStats tcs(counters());
+--- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2012, 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
+@@ -32,12 +32,10 @@
+ #include "utilities/dtrace.hpp"
+
+ // The following methods are used by the parallel scavenge collector
+-VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
+- unsigned int gc_count) :
+- VM_GC_Operation(gc_count, GCCause::_allocation_failure),
+- _size(size),
+- _result(NULL)
+-{
++VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t word_size,
++ uint gc_count) :
++ VM_CollectForAllocation(word_size, gc_count, GCCause::_allocation_failure) {
++ assert(word_size != 0, "An allocation should always be requested with this operation.");
+ }
+
+ void VM_ParallelGCFailedAllocation::doit() {
+@@ -47,7 +45,7 @@
+ assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap");
+
+ GCCauseSetter gccs(heap, _gc_cause);
+- _result = heap->failed_mem_allocate(_size);
++ _result = heap->failed_mem_allocate(_word_size);
+
+ if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
+ set_gc_locked();
+@@ -55,8 +53,8 @@
+ }
+
+ // Only used for System.gc() calls
+-VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count,
+- unsigned int full_gc_count,
++VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(uint gc_count,
++ uint full_gc_count,
+ GCCause::Cause gc_cause) :
+ VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */)
+ {
+--- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2012, 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
+@@ -29,26 +29,19 @@
+ #include "gc_implementation/shared/vmGCOperations.hpp"
+ #include "gc_interface/gcCause.hpp"
+
+-class VM_ParallelGCFailedAllocation: public VM_GC_Operation {
+- private:
+- size_t _size;
+- HeapWord* _result;
+-
++class VM_ParallelGCFailedAllocation : public VM_CollectForAllocation {
+ public:
+- VM_ParallelGCFailedAllocation(size_t size, unsigned int gc_count);
++ VM_ParallelGCFailedAllocation(size_t word_size, uint gc_count);
+
+ virtual VMOp_Type type() const {
+ return VMOp_ParallelGCFailedAllocation;
+ }
+ virtual void doit();
+-
+- HeapWord* result() const { return _result; }
+ };
+
+ class VM_ParallelGCSystemGC: public VM_GC_Operation {
+ public:
+- VM_ParallelGCSystemGC(unsigned int gc_count, unsigned int full_gc_count,
+- GCCause::Cause gc_cause);
++ VM_ParallelGCSystemGC(uint gc_count, uint full_gc_count, GCCause::Cause gc_cause);
+ virtual VMOp_Type type() const { return VMOp_ParallelGCSystemGC; }
+ virtual void doit();
+ };
+--- ./hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -55,7 +55,10 @@
+
+ // add entry
+ void add(oop p, size_t oop_size) {
+- uint age = p->age();
++ add(p->age(), oop_size);
++ }
++
++ void add(uint age, size_t oop_size) {
+ assert(age > 0 && age < table_size, "invalid age of object");
+ sizes[age] += oop_size;
+ }
+--- ./hotspot/src/share/vm/gc_implementation/shared/gcTraceTime.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/shared/gcTraceTime.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -49,10 +49,8 @@
+ }
+
+ if (_doit) {
+- if (PrintGCTimeStamps) {
+- gclog_or_tty->stamp();
+- gclog_or_tty->print(": ");
+- }
++ gclog_or_tty->date_stamp(PrintGCDateStamps);
++ gclog_or_tty->stamp(PrintGCTimeStamps);
+ if (PrintGCID) {
+ gclog_or_tty->print("#%u: ", gc_id.id());
+ }
+--- ./hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -62,9 +62,7 @@
+ }
+
+ void MutableSpace::pretouch_pages(MemRegion mr) {
+- for (volatile char *p = (char*)mr.start(); p < (char*)mr.end(); p += os::vm_page_size()) {
+- char t = *p; *p = t;
+- }
++ os::pretouch_memory((char*)mr.start(), (char*)mr.end());
+ }
+
+ void MutableSpace::initialize(MemRegion mr,
+--- ./hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -193,10 +193,10 @@
+
+ GenCollectedHeap* gch = GenCollectedHeap::heap();
+ GCCauseSetter gccs(gch, _gc_cause);
+- _res = gch->satisfy_failed_allocation(_size, _tlab);
+- assert(gch->is_in_reserved_or_null(_res), "result not in heap");
++ _result = gch->satisfy_failed_allocation(_word_size, _tlab);
++ assert(gch->is_in_reserved_or_null(_result), "result not in heap");
+
+- if (_res == NULL && GC_locker::is_active_and_needs_gc()) {
++ if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
+ set_gc_locked();
+ }
+ }
+@@ -209,6 +209,18 @@
+ gch->do_full_collection(gch->must_clear_all_soft_refs(), _max_level);
+ }
+
++VM_CollectForMetadataAllocation::VM_CollectForMetadataAllocation(ClassLoaderData* loader_data,
++ size_t size,
++ Metaspace::MetadataType mdtype,
++ uint gc_count_before,
++ uint full_gc_count_before,
++ GCCause::Cause gc_cause)
++ : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true),
++ _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) {
++ assert(_size != 0, "An allocation should always be requested with this operation.");
++ AllocTracer::send_allocation_requiring_gc_event(_size * HeapWordSize, GCId::peek());
++}
++
+ // Returns true iff concurrent GCs unloads metadata.
+ bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() {
+ #if INCLUDE_ALL_GCS
+@@ -313,3 +325,11 @@
+ set_gc_locked();
+ }
+ }
++
++VM_CollectForAllocation::VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause)
++ : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {
++ // Only report if operation was really caused by an allocation.
++ if (_word_size != 0) {
++ AllocTracer::send_allocation_requiring_gc_event(_word_size * HeapWordSize, GCId::peek());
++ }
++}
+--- ./hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -25,6 +25,7 @@
+ #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
+ #define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
+
++#include "gc_implementation/shared/gcId.hpp"
+ #include "memory/heapInspection.hpp"
+ #include "runtime/handles.hpp"
+ #include "runtime/jniHandles.hpp"
+@@ -38,11 +39,12 @@
+ // VM_Operation
+ // VM_GC_Operation
+ // VM_GC_HeapInspection
+-// VM_GenCollectForAllocation
+ // VM_GenCollectFull
+ // VM_GenCollectFullConcurrent
+-// VM_ParallelGCFailedAllocation
+ // VM_ParallelGCSystemGC
++// VM_CollectForAllocation
++// VM_GenCollectForAllocation
++// VM_ParallelGCFailedAllocation
+ // VM_GC_Operation
+ // - implements methods common to all classes in the hierarchy:
+ // prevents multiple gc requests and manages lock on heap;
+@@ -51,6 +53,7 @@
+ // - prints class histogram on SIGBREAK if PrintClassHistogram
+ // is specified; and also the attach "inspectheap" operation
+ //
++// VM_CollectForAllocation
+ // VM_GenCollectForAllocation
+ // VM_ParallelGCFailedAllocation
+ // - this operation is invoked when allocation is failed;
+@@ -66,13 +69,13 @@
+
+ class VM_GC_Operation: public VM_Operation {
+ protected:
+- BasicLock _pending_list_basic_lock; // for refs pending list notification (PLL)
+- unsigned int _gc_count_before; // gc count before acquiring PLL
+- unsigned int _full_gc_count_before; // full gc count before acquiring PLL
+- bool _full; // whether a "full" collection
+- bool _prologue_succeeded; // whether doit_prologue succeeded
++ BasicLock _pending_list_basic_lock; // for refs pending list notification (PLL)
++ uint _gc_count_before; // gc count before acquiring PLL
++ uint _full_gc_count_before; // full gc count before acquiring PLL
++ bool _full; // whether a "full" collection
++ bool _prologue_succeeded; // whether doit_prologue succeeded
+ GCCause::Cause _gc_cause; // the putative cause for this gc op
+- bool _gc_locked; // will be set if gc was locked
++ bool _gc_locked; // will be set if gc was locked
+
+ virtual bool skip_operation() const;
+
+@@ -81,9 +84,9 @@
+ void release_and_notify_pending_list_lock();
+
+ public:
+- VM_GC_Operation(unsigned int gc_count_before,
++ VM_GC_Operation(uint gc_count_before,
+ GCCause::Cause _cause,
+- unsigned int full_gc_count_before = 0,
++ uint full_gc_count_before = 0,
+ bool full = false) {
+ _full = full;
+ _prologue_succeeded = false;
+@@ -160,38 +163,45 @@
+ bool collect();
+ };
+
++class VM_CollectForAllocation : public VM_GC_Operation {
++ protected:
++ size_t _word_size; // Size of object to be allocated (in number of words)
++ HeapWord* _result; // Allocation result (NULL if allocation failed)
+
+-class VM_GenCollectForAllocation: public VM_GC_Operation {
++ public:
++ VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause);
++
++ HeapWord* result() const {
++ return _result;
++ }
++};
++
++class VM_GenCollectForAllocation : public VM_CollectForAllocation {
+ private:
+- HeapWord* _res;
+- size_t _size; // size of object to be allocated.
+ bool _tlab; // alloc is of a tlab.
+ public:
+- VM_GenCollectForAllocation(size_t size,
++ VM_GenCollectForAllocation(size_t word_size,
+ bool tlab,
+- unsigned int gc_count_before)
+- : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure),
+- _size(size),
++ uint gc_count_before)
++ : VM_CollectForAllocation(word_size, gc_count_before, GCCause::_allocation_failure),
+ _tlab(tlab) {
+- _res = NULL;
++ assert(word_size != 0, "An allocation should always be requested with this operation.");
+ }
+ ~VM_GenCollectForAllocation() {}
+ virtual VMOp_Type type() const { return VMOp_GenCollectForAllocation; }
+ virtual void doit();
+- HeapWord* result() const { return _res; }
+ };
+
+-
+ // VM operation to invoke a collection of the heap as a
+ // GenCollectedHeap heap.
+ class VM_GenCollectFull: public VM_GC_Operation {
+ private:
+ int _max_level;
+ public:
+- VM_GenCollectFull(unsigned int gc_count_before,
+- unsigned int full_gc_count_before,
++ VM_GenCollectFull(uint gc_count_before,
++ uint full_gc_count_before,
+ GCCause::Cause gc_cause,
+- int max_level)
++ int max_level)
+ : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
+ _max_level(max_level) { }
+ ~VM_GenCollectFull() {}
+@@ -208,12 +218,9 @@
+ public:
+ VM_CollectForMetadataAllocation(ClassLoaderData* loader_data,
+ size_t size, Metaspace::MetadataType mdtype,
+- unsigned int gc_count_before,
+- unsigned int full_gc_count_before,
+- GCCause::Cause gc_cause)
+- : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true),
+- _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) {
+- }
++ uint gc_count_before,
++ uint full_gc_count_before,
++ GCCause::Cause gc_cause);
+ virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; }
+ virtual void doit();
+ MetaWord* result() const { return _result; }
+--- ./hotspot/src/share/vm/gc_interface/allocTracer.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_interface/allocTracer.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -23,6 +23,7 @@
+ */
+
+ #include "precompiled.hpp"
++#include "gc_implementation/shared/gcId.hpp"
+ #include "gc_interface/allocTracer.hpp"
+ #include "trace/tracing.hpp"
+ #include "runtime/handles.hpp"
+@@ -46,3 +47,12 @@
+ event.commit();
+ }
+ }
++
++void AllocTracer::send_allocation_requiring_gc_event(size_t size, const GCId& gcId) {
++ EventAllocationRequiringGC event;
++ if (event.should_commit()) {
++ event.set_gcId(gcId.id());
++ event.set_size(size);
++ event.commit();
++ }
++}
+--- ./hotspot/src/share/vm/gc_interface/allocTracer.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/gc_interface/allocTracer.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -32,6 +32,7 @@
+ public:
+ static void send_allocation_outside_tlab_event(KlassHandle klass, size_t alloc_size);
+ static void send_allocation_in_new_tlab_event(KlassHandle klass, size_t tlab_size, size_t alloc_size);
++ static void send_allocation_requiring_gc_event(size_t size, const GCId& gcId);
+ };
+
+ #endif /* SHARE_VM_GC_INTERFACE_ALLOCTRACER_HPP */
+--- ./hotspot/src/share/vm/interpreter/abstractInterpreter.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/abstractInterpreter.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -30,22 +30,15 @@
+ #include "runtime/thread.inline.hpp"
+ #include "runtime/vmThread.hpp"
+ #include "utilities/top.hpp"
+-#ifdef TARGET_ARCH_x86
++#if defined INTERP_MASM_MD_HPP
++# include INTERP_MASM_MD_HPP
++#elif defined TARGET_ARCH_x86
+ # include "interp_masm_x86.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "interp_masm_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "interp_masm_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "interp_masm_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "interp_masm_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "interp_masm_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -3432,7 +3432,7 @@
+ tty->print_cr("osr._osr_buf: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_buf);
+ tty->print_cr("osr._osr_entry: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_entry);
+ tty->print_cr("prev_link: " INTPTR_FORMAT, (uintptr_t) this->_prev_link);
+- tty->print_cr("native_mirror: " INTPTR_FORMAT, (uintptr_t) this->_oop_temp);
++ tty->print_cr("native_mirror: " INTPTR_FORMAT, (uintptr_t) p2i(this->_oop_temp));
+ tty->print_cr("stack_base: " INTPTR_FORMAT, (uintptr_t) this->_stack_base);
+ tty->print_cr("stack_limit: " INTPTR_FORMAT, (uintptr_t) this->_stack_limit);
+ tty->print_cr("monitor_base: " INTPTR_FORMAT, (uintptr_t) this->_monitor_base);
+--- ./hotspot/src/share/vm/interpreter/bytecodes.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/bytecodes.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -420,6 +420,7 @@
+ static bool is_astore (Code code) { return (code == _astore || code == _astore_0 || code == _astore_1
+ || code == _astore_2 || code == _astore_3); }
+
++ static bool is_store_into_local(Code code){ return (_istore <= code && code <= _astore_3); }
+ static bool is_const (Code code) { return (_aconst_null <= code && code <= _ldc2_w); }
+ static bool is_zero_const (Code code) { return (code == _aconst_null || code == _iconst_0
+ || code == _fconst_0 || code == _dconst_0); }
+--- ./hotspot/src/share/vm/interpreter/interpreterRuntime.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/interpreterRuntime.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -407,7 +407,11 @@
+ // during deoptimization so the interpreter needs to skip it when
+ // the frame is popped.
+ thread->set_do_not_unlock_if_synchronized(true);
++#ifdef CC_INTERP
++ return (address) -1;
++#else
+ return Interpreter::remove_activation_entry();
++#endif
+ }
+
+ // Need to do this check first since when _do_not_unlock_if_synchronized
+@@ -1302,6 +1306,8 @@
+ member_name_oop = java_lang_invoke_DirectMethodHandle::member(member_name_oop);
+ }
+ thread->set_vm_result(member_name_oop);
++ } else {
++ thread->set_vm_result(NULL);
+ }
+ IRT_END
+ #endif // INCLUDE_JVMTI
+--- ./hotspot/src/share/vm/interpreter/linkResolver.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/linkResolver.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1410,10 +1410,11 @@
+ KlassHandle resolved_klass,
+ Symbol* name,
+ Symbol* signature,
+- KlassHandle current_klass) {
++ KlassHandle current_klass,
++ bool check_access) {
+ EXCEPTION_MARK;
+ CallInfo info;
+- resolve_virtual_call(info, Handle(), receiver_klass, resolved_klass, name, signature, current_klass, true, false, THREAD);
++ resolve_virtual_call(info, Handle(), receiver_klass, resolved_klass, name, signature, current_klass, check_access, false, THREAD);
+ if (HAS_PENDING_EXCEPTION) {
+ CLEAR_PENDING_EXCEPTION;
+ return methodHandle();
+@@ -1426,10 +1427,11 @@
+ KlassHandle resolved_klass,
+ Symbol* name,
+ Symbol* signature,
+- KlassHandle current_klass) {
++ KlassHandle current_klass,
++ bool check_access) {
+ EXCEPTION_MARK;
+ CallInfo info;
+- resolve_interface_call(info, Handle(), receiver_klass, resolved_klass, name, signature, current_klass, true, false, THREAD);
++ resolve_interface_call(info, Handle(), receiver_klass, resolved_klass, name, signature, current_klass, check_access, false, THREAD);
+ if (HAS_PENDING_EXCEPTION) {
+ CLEAR_PENDING_EXCEPTION;
+ return methodHandle();
+@@ -1457,10 +1459,11 @@
+ KlassHandle resolved_klass,
+ Symbol* name,
+ Symbol* signature,
+- KlassHandle current_klass) {
++ KlassHandle current_klass,
++ bool check_access) {
+ EXCEPTION_MARK;
+ CallInfo info;
+- resolve_static_call(info, resolved_klass, name, signature, current_klass, true, false, THREAD);
++ resolve_static_call(info, resolved_klass, name, signature, current_klass, check_access, false, THREAD);
+ if (HAS_PENDING_EXCEPTION) {
+ CLEAR_PENDING_EXCEPTION;
+ return methodHandle();
+@@ -1468,11 +1471,15 @@
+ return info.selected_method();
+ }
+
+-methodHandle LinkResolver::resolve_special_call_or_null(KlassHandle resolved_klass, Symbol* name, Symbol* signature,
+- KlassHandle current_klass) {
++methodHandle LinkResolver::resolve_special_call_or_null(
++ KlassHandle resolved_klass,
++ Symbol* name,
++ Symbol* signature,
++ KlassHandle current_klass,
++ bool check_access) {
+ EXCEPTION_MARK;
+ CallInfo info;
+- resolve_special_call(info, resolved_klass, name, signature, current_klass, true, THREAD);
++ resolve_special_call(info, resolved_klass, name, signature, current_klass, check_access, THREAD);
+ if (HAS_PENDING_EXCEPTION) {
+ CLEAR_PENDING_EXCEPTION;
+ return methodHandle();
+@@ -1585,6 +1592,26 @@
+ result.set_handle(resolved_method, resolved_appendix, resolved_method_type, CHECK);
+ }
+
++static void wrap_invokedynamic_exception(TRAPS) {
++ if (HAS_PENDING_EXCEPTION) {
++ if (TraceMethodHandles) {
++ tty->print_cr("invokedynamic throws BSME for " INTPTR_FORMAT, p2i((void *)PENDING_EXCEPTION));
++ PENDING_EXCEPTION->print();
++ }
++ if (PENDING_EXCEPTION->is_a(SystemDictionary::BootstrapMethodError_klass())) {
++ // throw these guys, since they are already wrapped
++ return;
++ }
++ if (!PENDING_EXCEPTION->is_a(SystemDictionary::LinkageError_klass())) {
++ // intercept only LinkageErrors which might have failed to wrap
++ return;
++ }
++ // See the "Linking Exceptions" section for the invokedynamic instruction in the JVMS.
++ Handle nested_exception(THREAD, PENDING_EXCEPTION);
++ CLEAR_PENDING_EXCEPTION;
++ THROW_CAUSE(vmSymbols::java_lang_BootstrapMethodError(), nested_exception)
++ }
++}
+
+ void LinkResolver::resolve_invokedynamic(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
+ assert(EnableInvokeDynamic, "");
+@@ -1600,7 +1627,8 @@
+ ConstantPoolCacheEntry* cpce = pool->invokedynamic_cp_cache_entry_at(index);
+ if (cpce->is_f1_null()) {
+ int pool_index = cpce->constant_pool_index();
+- oop bsm_info = pool->resolve_bootstrap_specifier_at(pool_index, CHECK);
++ oop bsm_info = pool->resolve_bootstrap_specifier_at(pool_index, THREAD);
++ wrap_invokedynamic_exception(CHECK);
+ assert(bsm_info != NULL, "");
+ // FIXME: Cache this once per BootstrapMethods entry, not once per CONSTANT_InvokeDynamic.
+ bootstrap_specifier = Handle(THREAD, bsm_info);
+@@ -1609,7 +1637,8 @@
+ methodHandle method( THREAD, cpce->f1_as_method());
+ Handle appendix( THREAD, cpce->appendix_if_resolved(pool));
+ Handle method_type(THREAD, cpce->method_type_if_resolved(pool));
+- result.set_handle(method, appendix, method_type, CHECK);
++ result.set_handle(method, appendix, method_type, THREAD);
++ wrap_invokedynamic_exception(CHECK);
+ return;
+ }
+
+@@ -1640,25 +1669,9 @@
+ &resolved_appendix,
+ &resolved_method_type,
+ THREAD);
+- if (HAS_PENDING_EXCEPTION) {
+- if (TraceMethodHandles) {
+- tty->print_cr("invokedynamic throws BSME for " INTPTR_FORMAT, p2i((void *)PENDING_EXCEPTION));
+- PENDING_EXCEPTION->print();
+- }
+- if (PENDING_EXCEPTION->is_a(SystemDictionary::BootstrapMethodError_klass())) {
+- // throw these guys, since they are already wrapped
+- return;
+- }
+- if (!PENDING_EXCEPTION->is_a(SystemDictionary::LinkageError_klass())) {
+- // intercept only LinkageErrors which might have failed to wrap
+- return;
+- }
+- // See the "Linking Exceptions" section for the invokedynamic instruction in the JVMS.
+- Handle nested_exception(THREAD, PENDING_EXCEPTION);
+- CLEAR_PENDING_EXCEPTION;
+- THROW_CAUSE(vmSymbols::java_lang_BootstrapMethodError(), nested_exception)
+- }
+- result.set_handle(resolved_method, resolved_appendix, resolved_method_type, CHECK);
++ wrap_invokedynamic_exception(CHECK);
++ result.set_handle(resolved_method, resolved_appendix, resolved_method_type, THREAD);
++ wrap_invokedynamic_exception(CHECK);
+ }
+
+ //------------------------------------------------------------------------------------------------------------------------
+--- ./hotspot/src/share/vm/interpreter/linkResolver.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/linkResolver.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -181,10 +181,10 @@
+
+ // same as above for compile-time resolution; but returns null handle instead of throwing an exception on error
+ // also, does not initialize klass (i.e., no side effects)
+- static methodHandle resolve_virtual_call_or_null (KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass);
+- static methodHandle resolve_interface_call_or_null(KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass);
+- static methodHandle resolve_static_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass);
+- static methodHandle resolve_special_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass);
++ static methodHandle resolve_virtual_call_or_null (KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access = true);
++ static methodHandle resolve_interface_call_or_null(KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access = true);
++ static methodHandle resolve_static_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access = true);
++ static methodHandle resolve_special_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access = true);
+ static int vtable_index_of_interface_method(KlassHandle klass, methodHandle resolved_method);
+
+ // same as above for compile-time resolution; returns vtable_index if current_klass if linked
+--- ./hotspot/src/share/vm/interpreter/oopMapCache.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/oopMapCache.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -244,10 +244,8 @@
+ method()->print_value();
+ tty->print(" @ %d = [%d] { ", bci(), n);
+ for (int i = 0; i < n; i++) {
+-#ifdef ENABLE_ZAP_DEAD_LOCALS
+ if (is_dead(i)) tty->print("%d+ ", i);
+ else
+-#endif
+ if (is_oop(i)) tty->print("%d ", i);
+ }
+ tty->print_cr("}");
+@@ -402,13 +400,11 @@
+ value |= (mask << oop_bit_number );
+ }
+
+- #ifdef ENABLE_ZAP_DEAD_LOCALS
+ // set dead bit
+ if (!cell->is_live()) {
+ value |= (mask << dead_bit_number);
+ assert(!cell->is_reference(), "dead value marked as oop");
+ }
+- #endif
+ }
+
+ // make sure last word is stored
+--- ./hotspot/src/share/vm/interpreter/oopMapCache.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/oopMapCache.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -66,19 +66,15 @@
+
+ public:
+ enum {
+- N = 2, // the number of words reserved
++ N = 4, // the number of words reserved
+ // for inlined mask storage
+ small_mask_limit = N * BitsPerWord, // the maximum number of bits
+ // available for small masks,
+ // small_mask_limit can be set to 0
+ // for testing bit_mask allocation
+
+-#ifdef ENABLE_ZAP_DEAD_LOCALS
+ bits_per_entry = 2,
+ dead_bit_number = 1,
+-#else
+- bits_per_entry = 1,
+-#endif
+ oop_bit_number = 0
+ };
+
+@@ -119,10 +115,6 @@
+
+ void set_expression_stack_size(int sz) { _expression_stack_size = sz; }
+
+-#ifdef ENABLE_ZAP_DEAD_LOCALS
+- bool is_dead(int offset) const { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
+-#endif
+-
+ // Lookup
+ bool match(methodHandle method, int bci) const { return _method == method() && _bci == bci; }
+ bool is_empty() const;
+@@ -144,6 +136,7 @@
+ void print() const;
+
+ int number_of_entries() const { return mask_size() / bits_per_entry; }
++ bool is_dead(int offset) const { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
+ bool is_oop (int offset) const { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
+
+ int expression_stack_size() const { return _expression_stack_size; }
+--- ./hotspot/src/share/vm/interpreter/templateTable.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/interpreter/templateTable.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -28,22 +28,15 @@
+ #include "interpreter/bytecodes.hpp"
+ #include "memory/allocation.hpp"
+ #include "runtime/frame.hpp"
+-#ifdef TARGET_ARCH_x86
++#if defined INTERP_MASM_MD_HPP
++# include INTERP_MASM_MD_HPP
++#elif defined TARGET_ARCH_x86
+ # include "interp_masm_x86.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "interp_masm_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "interp_masm_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "interp_masm_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "interp_masm_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "interp_masm_ppc_64.hpp"
+ #endif
+
+@@ -358,25 +351,17 @@
+ static Template* template_for_wide(Bytecodes::Code code) { Bytecodes::wide_check(code); return &_template_table_wide[code]; }
+
+ // Platform specifics
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined TEMPLATETABLE_MD_HPP
++# include TEMPLATETABLE_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "templateTable_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "templateTable_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "templateTable_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "templateTable_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "templateTable_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "templateTable_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "templateTable_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/memory/allocation.inline.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/allocation.inline.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -62,11 +62,18 @@
+ }
+ return p;
+ }
++
++#ifdef __GNUC__
++__attribute__((always_inline))
++#endif
+ inline char* AllocateHeap(size_t size, MEMFLAGS flags,
+ AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
+ return AllocateHeap(size, flags, CURRENT_PC, alloc_failmode);
+ }
+
++#ifdef __GNUC__
++__attribute__((always_inline))
++#endif
+ inline char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag,
+ AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
+ char* p = (char*) os::realloc(old, size, flag, CURRENT_PC);
+--- ./hotspot/src/share/vm/memory/collectorPolicy.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/collectorPolicy.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -656,7 +656,7 @@
+
+ // Loop until the allocation is satisified,
+ // or unsatisfied after GC.
+- for (int try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
++ for (uint try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
+ HandleMark hm; // discard any handles allocated in each iteration
+
+ // First allocation attempt is lock-free.
+@@ -670,7 +670,7 @@
+ return result;
+ }
+ }
+- unsigned int gc_count_before; // read inside the Heap_lock locked region
++ uint gc_count_before; // read inside the Heap_lock locked region
+ {
+ MutexLocker ml(Heap_lock);
+ if (PrintGC && Verbose) {
+--- ./hotspot/src/share/vm/memory/defNewGeneration.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/defNewGeneration.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -629,7 +629,7 @@
+ true, // Process younger gens, if any,
+ // as strong roots.
+ true, // activate StrongRootsScope
+- SharedHeap::SO_ScavengeCodeCache,
++ GenCollectedHeap::SO_ScavengeCodeCache,
+ GenCollectedHeap::StrongAndWeakRoots,
+ &fsc_with_no_gc_barrier,
+ &fsc_with_gc_barrier,
+--- ./hotspot/src/share/vm/memory/genCollectedHeap.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/genCollectedHeap.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -26,6 +26,7 @@
+ #include "classfile/symbolTable.hpp"
+ #include "classfile/systemDictionary.hpp"
+ #include "classfile/vmSymbols.hpp"
++#include "code/codeCache.hpp"
+ #include "code/icBuffer.hpp"
+ #include "gc_implementation/shared/collectorCounters.hpp"
+ #include "gc_implementation/shared/gcTrace.hpp"
+@@ -49,6 +50,7 @@
+ #include "runtime/handles.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "runtime/vmThread.hpp"
++#include "services/management.hpp"
+ #include "services/memoryService.hpp"
+ #include "utilities/vmError.hpp"
+ #include "utilities/workgroup.hpp"
+@@ -63,7 +65,15 @@
+
+ // The set of potentially parallel tasks in root scanning.
+ enum GCH_strong_roots_tasks {
+- // We probably want to parallelize both of these internally, but for now...
++ GCH_PS_Universe_oops_do,
++ GCH_PS_JNIHandles_oops_do,
++ GCH_PS_ObjectSynchronizer_oops_do,
++ GCH_PS_FlatProfiler_oops_do,
++ GCH_PS_Management_oops_do,
++ GCH_PS_SystemDictionary_oops_do,
++ GCH_PS_ClassLoaderDataGraph_oops_do,
++ GCH_PS_jvmti_oops_do,
++ GCH_PS_CodeCache_oops_do,
+ GCH_PS_younger_gens,
+ // Leave this one last.
+ GCH_PS_NumElements
+@@ -72,13 +82,9 @@
+ GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) :
+ SharedHeap(policy),
+ _gen_policy(policy),
+- _gen_process_roots_tasks(new SubTasksDone(GCH_PS_NumElements)),
++ _process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)),
+ _full_collections_completed(0)
+ {
+- if (_gen_process_roots_tasks == NULL ||
+- !_gen_process_roots_tasks->valid()) {
+- vm_exit_during_initialization("Failed necessary allocation.");
+- }
+ assert(policy != NULL, "Sanity check");
+ }
+
+@@ -384,7 +390,6 @@
+
+ bool complete = full && (max_level == (n_gens()-1));
+ const char* gc_cause_prefix = complete ? "Full GC" : "GC";
+- gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
+ TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
+ // The PrintGCDetails logging starts before we have incremented the GC id. We will do that later
+ // so we can assume here that the next GC id is what we want.
+@@ -590,29 +595,137 @@
+
+ void GenCollectedHeap::set_par_threads(uint t) {
+ SharedHeap::set_par_threads(t);
+- _gen_process_roots_tasks->set_n_threads(t);
++ set_n_termination(t);
+ }
+
+-void GenCollectedHeap::
+-gen_process_roots(int level,
+- bool younger_gens_as_roots,
+- bool activate_scope,
+- SharedHeap::ScanningOption so,
+- OopsInGenClosure* not_older_gens,
+- OopsInGenClosure* weak_roots,
+- OopsInGenClosure* older_gens,
+- CLDClosure* cld_closure,
+- CLDClosure* weak_cld_closure,
+- CodeBlobClosure* code_closure) {
++void GenCollectedHeap::set_n_termination(uint t) {
++ _process_strong_tasks->set_n_threads(t);
++}
++
++#ifdef ASSERT
++class AssertNonScavengableClosure: public OopClosure {
++public:
++ virtual void do_oop(oop* p) {
++ assert(!Universe::heap()->is_in_partial_collection(*p),
++ "Referent should not be scavengable."); }
++ virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
++};
++static AssertNonScavengableClosure assert_is_non_scavengable_closure;
++#endif
++
++void GenCollectedHeap::process_roots(bool activate_scope,
++ ScanningOption so,
++ OopClosure* strong_roots,
++ OopClosure* weak_roots,
++ CLDClosure* strong_cld_closure,
++ CLDClosure* weak_cld_closure,
++ CodeBlobClosure* code_roots) {
++ StrongRootsScope srs(this, activate_scope);
+
+ // General roots.
+- SharedHeap::process_roots(activate_scope, so,
+- not_older_gens, weak_roots,
+- cld_closure, weak_cld_closure,
+- code_closure);
++ assert(_strong_roots_parity != 0, "must have called prologue code");
++ assert(code_roots != NULL, "code root closure should always be set");
++ // _n_termination for _process_strong_tasks should be set up stream
++ // in a method not running in a GC worker. Otherwise the GC worker
++ // could be trying to change the termination condition while the task
++ // is executing in another GC worker.
++
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_ClassLoaderDataGraph_oops_do)) {
++ ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
++ }
++
++ // Some CLDs contained in the thread frames should be considered strong.
++ // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
++ CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
++ // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
++ CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
++
++ Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
++
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {
++ Universe::oops_do(strong_roots);
++ }
++ // Global (strong) JNI handles
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_JNIHandles_oops_do)) {
++ JNIHandles::oops_do(strong_roots);
++ }
++
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_ObjectSynchronizer_oops_do)) {
++ ObjectSynchronizer::oops_do(strong_roots);
++ }
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_FlatProfiler_oops_do)) {
++ FlatProfiler::oops_do(strong_roots);
++ }
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_Management_oops_do)) {
++ Management::oops_do(strong_roots);
++ }
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_jvmti_oops_do)) {
++ JvmtiExport::oops_do(strong_roots);
++ }
++
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_SystemDictionary_oops_do)) {
++ SystemDictionary::roots_oops_do(strong_roots, weak_roots);
++ }
++
++ // All threads execute the following. A specific chunk of buckets
++ // from the StringTable are the individual tasks.
++ if (weak_roots != NULL) {
++ if (CollectedHeap::use_parallel_gc_threads()) {
++ StringTable::possibly_parallel_oops_do(weak_roots);
++ } else {
++ StringTable::oops_do(weak_roots);
++ }
++ }
++
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_CodeCache_oops_do)) {
++ if (so & SO_ScavengeCodeCache) {
++ assert(code_roots != NULL, "must supply closure for code cache");
++
++ // We only visit parts of the CodeCache when scavenging.
++ CodeCache::scavenge_root_nmethods_do(code_roots);
++ }
++ if (so & SO_AllCodeCache) {
++ assert(code_roots != NULL, "must supply closure for code cache");
++
++ // CMSCollector uses this to do intermediate-strength collections.
++ // We scan the entire code cache, since CodeCache::do_unloading is not called.
++ CodeCache::blobs_do(code_roots);
++ }
++ // Verify that the code cache contents are not subject to
++ // movement by a scavenging collection.
++ DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
++ DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
++ }
++
++}
++
++void GenCollectedHeap::gen_process_roots(int level,
++ bool younger_gens_as_roots,
++ bool activate_scope,
++ ScanningOption so,
++ bool only_strong_roots,
++ OopsInGenClosure* not_older_gens,
++ OopsInGenClosure* older_gens,
++ CLDClosure* cld_closure) {
++ const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
++
++ bool is_moving_collection = false;
++ if (level == 0 || is_adjust_phase) {
++ // young collections are always moving
++ is_moving_collection = true;
++ }
++
++ MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
++ OopsInGenClosure* weak_roots = only_strong_roots ? NULL : not_older_gens;
++ CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
++
++ process_roots(activate_scope, so,
++ not_older_gens, weak_roots,
++ cld_closure, weak_cld_closure,
++ &mark_code_closure);
+
+ if (younger_gens_as_roots) {
+- if (!_gen_process_roots_tasks->is_task_claimed(GCH_PS_younger_gens)) {
++ if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
+ for (int i = 0; i < level; i++) {
+ not_older_gens->set_generation(_gens[i]);
+ _gens[i]->oop_iterate(not_older_gens);
+@@ -628,43 +741,18 @@
+ older_gens->reset_generation();
+ }
+
+- _gen_process_roots_tasks->all_tasks_completed();
++ _process_strong_tasks->all_tasks_completed();
+ }
+
+-void GenCollectedHeap::
+-gen_process_roots(int level,
+- bool younger_gens_as_roots,
+- bool activate_scope,
+- SharedHeap::ScanningOption so,
+- bool only_strong_roots,
+- OopsInGenClosure* not_older_gens,
+- OopsInGenClosure* older_gens,
+- CLDClosure* cld_closure) {
+
+- const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
+-
+- bool is_moving_collection = false;
+- if (level == 0 || is_adjust_phase) {
+- // young collections are always moving
+- is_moving_collection = true;
+- }
+-
+- MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
+- CodeBlobClosure* code_closure = &mark_code_closure;
+-
+- gen_process_roots(level,
+- younger_gens_as_roots,
+- activate_scope, so,
+- not_older_gens, only_strong_roots ? NULL : not_older_gens,
+- older_gens,
+- cld_closure, only_strong_roots ? NULL : cld_closure,
+- code_closure);
+-
+-}
++class AlwaysTrueClosure: public BoolObjectClosure {
++public:
++ bool do_object_b(oop p) { return true; }
++};
++static AlwaysTrueClosure always_true;
+
+ void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
+- SharedHeap::process_weak_roots(root_closure);
+- // "Local" "weak" refs
++ JNIHandles::weak_oops_do(&always_true, root_closure);
+ for (int i = 0; i < _n_gens; i++) {
+ _gens[i]->ref_processor()->weak_oops_do(root_closure);
+ }
+--- ./hotspot/src/share/vm/memory/genCollectedHeap.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/genCollectedHeap.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -79,8 +79,7 @@
+
+ // Data structure for claiming the (potentially) parallel tasks in
+ // (gen-specific) roots processing.
+- SubTasksDone* _gen_process_roots_tasks;
+- SubTasksDone* gen_process_roots_tasks() { return _gen_process_roots_tasks; }
++ SubTasksDone* _process_strong_tasks;
+
+ // In block contents verification, the number of header words to skip
+ NOT_PRODUCT(static size_t _skip_header_HeapWords;)
+@@ -390,6 +389,7 @@
+ static GenCollectedHeap* heap();
+
+ void set_par_threads(uint t);
++ void set_n_termination(uint t);
+
+ // Invoke the "do_oop" method of one of the closures "not_older_gens"
+ // or "older_gens" on root locations for the generation at
+@@ -403,11 +403,25 @@
+ // The "so" argument determines which of the roots
+ // the closure is applied to:
+ // "SO_None" does none;
++ enum ScanningOption {
++ SO_None = 0x0,
++ SO_AllCodeCache = 0x8,
++ SO_ScavengeCodeCache = 0x10
++ };
++
+ private:
++ void process_roots(bool activate_scope,
++ ScanningOption so,
++ OopClosure* strong_roots,
++ OopClosure* weak_roots,
++ CLDClosure* strong_cld_closure,
++ CLDClosure* weak_cld_closure,
++ CodeBlobClosure* code_roots);
++
+ void gen_process_roots(int level,
+ bool younger_gens_as_roots,
+ bool activate_scope,
+- SharedHeap::ScanningOption so,
++ ScanningOption so,
+ OopsInGenClosure* not_older_gens,
+ OopsInGenClosure* weak_roots,
+ OopsInGenClosure* older_gens,
+@@ -422,7 +436,7 @@
+ void gen_process_roots(int level,
+ bool younger_gens_as_roots,
+ bool activate_scope,
+- SharedHeap::ScanningOption so,
++ ScanningOption so,
+ bool only_strong_roots,
+ OopsInGenClosure* not_older_gens,
+ OopsInGenClosure* older_gens,
+--- ./hotspot/src/share/vm/memory/genMarkSweep.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/genMarkSweep.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -210,8 +210,8 @@
+ gch->gen_process_roots(level,
+ false, // Younger gens are not roots.
+ true, // activate StrongRootsScope
+- SharedHeap::SO_None,
+- GenCollectedHeap::StrongRootsOnly,
++ GenCollectedHeap::SO_None,
++ ClassUnloading,
+ &follow_root_closure,
+ &follow_root_closure,
+ &follow_cld_closure);
+@@ -295,7 +295,7 @@
+ gch->gen_process_roots(level,
+ false, // Younger gens are not roots.
+ true, // activate StrongRootsScope
+- SharedHeap::SO_AllCodeCache,
++ GenCollectedHeap::SO_AllCodeCache,
+ GenCollectedHeap::StrongAndWeakRoots,
+ &adjust_pointer_closure,
+ &adjust_pointer_closure,
+--- ./hotspot/src/share/vm/memory/generation.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/generation.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -145,7 +145,7 @@
+ // GenGrain.
+ // Note: on ARM we add 1 bit for card_table_base to be properly aligned
+ // (we expect its low byte to be zero - see implementation of post_barrier)
+- LogOfGenGrain = 16 ARM_ONLY(+1),
++ LogOfGenGrain = 16 ARM32_ONLY(+1),
+ GenGrain = 1 << LogOfGenGrain
+ };
+
+--- ./hotspot/src/share/vm/memory/guardedMemory.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/guardedMemory.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -235,7 +235,7 @@
+ * @return the size of the user data.
+ */
+ size_t get_user_size() const {
+- assert(_base_addr, "Not wrapping any memory");
++ assert(_base_addr != NULL, "Not wrapping any memory");
+ return get_head_guard()->get_user_size();
+ }
+
+@@ -245,7 +245,7 @@
+ * @return the user data pointer.
+ */
+ u_char* get_user_ptr() const {
+- assert(_base_addr, "Not wrapping any memory");
++ assert(_base_addr != NULL, "Not wrapping any memory");
+ return _base_addr + sizeof(GuardHeader);
+ }
+
+@@ -281,7 +281,7 @@
+ memset(get_user_ptr(), ch, get_user_size());
+ }
+
+-public:
++ public:
+ /**
+ * Return the total size required for wrapping the given user size.
+ *
+--- ./hotspot/src/share/vm/memory/heap.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/heap.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -97,9 +97,11 @@
+ _log2_segment_size = exact_log2(segment_size);
+
+ // Reserve and initialize space for _memory.
+- const size_t page_size = os::can_execute_large_page_memory() ?
+- os::page_size_for_region(committed_size, reserved_size, 8) :
+- os::vm_page_size();
++ size_t page_size = os::vm_page_size();
++ if (os::can_execute_large_page_memory()) {
++ page_size = os::page_size_for_region_unaligned(reserved_size, 8);
++ }
++
+ const size_t granularity = os::vm_allocation_granularity();
+ const size_t r_align = MAX2(page_size, granularity);
+ const size_t r_size = align_size_up(reserved_size, r_align);
+--- ./hotspot/src/share/vm/memory/sharedHeap.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/sharedHeap.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -32,7 +32,6 @@
+ #include "runtime/atomic.inline.hpp"
+ #include "runtime/fprofiler.hpp"
+ #include "runtime/java.hpp"
+-#include "services/management.hpp"
+ #include "utilities/copy.hpp"
+ #include "utilities/workgroup.hpp"
+
+@@ -40,33 +39,13 @@
+
+ SharedHeap* SharedHeap::_sh;
+
+-// The set of potentially parallel tasks in root scanning.
+-enum SH_process_roots_tasks {
+- SH_PS_Universe_oops_do,
+- SH_PS_JNIHandles_oops_do,
+- SH_PS_ObjectSynchronizer_oops_do,
+- SH_PS_FlatProfiler_oops_do,
+- SH_PS_Management_oops_do,
+- SH_PS_SystemDictionary_oops_do,
+- SH_PS_ClassLoaderDataGraph_oops_do,
+- SH_PS_jvmti_oops_do,
+- SH_PS_CodeCache_oops_do,
+- // Leave this one last.
+- SH_PS_NumElements
+-};
+-
+ SharedHeap::SharedHeap(CollectorPolicy* policy_) :
+ CollectedHeap(),
+ _collector_policy(policy_),
+ _rem_set(NULL),
+- _strong_roots_scope(NULL),
+ _strong_roots_parity(0),
+- _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
+ _workers(NULL)
+ {
+- if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
+- vm_exit_during_initialization("Failed necessary allocation.");
+- }
+ _sh = this; // ch is static, should be set only once.
+ if ((UseParNewGC ||
+ (UseConcMarkSweepGC && (CMSParallelInitialMarkEnabled ||
+@@ -84,14 +63,6 @@
+ }
+ }
+
+-int SharedHeap::n_termination() {
+- return _process_strong_tasks->n_threads();
+-}
+-
+-void SharedHeap::set_n_termination(int t) {
+- _process_strong_tasks->set_n_threads(t);
+-}
+-
+ bool SharedHeap::heap_lock_held_for_gc() {
+ Thread* t = Thread::current();
+ return Heap_lock->owned_by_self()
+@@ -102,31 +73,6 @@
+ void SharedHeap::set_par_threads(uint t) {
+ assert(t == 0 || !UseSerialGC, "Cannot have parallel threads");
+ _n_par_threads = t;
+- _process_strong_tasks->set_n_threads(t);
+-}
+-
+-#ifdef ASSERT
+-class AssertNonScavengableClosure: public OopClosure {
+-public:
+- virtual void do_oop(oop* p) {
+- assert(!Universe::heap()->is_in_partial_collection(*p),
+- "Referent should not be scavengable."); }
+- virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
+-};
+-static AssertNonScavengableClosure assert_is_non_scavengable_closure;
+-#endif
+-
+-SharedHeap::StrongRootsScope* SharedHeap::active_strong_roots_scope() const {
+- return _strong_roots_scope;
+-}
+-void SharedHeap::register_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
+- assert(_strong_roots_scope == NULL, "Should only have one StrongRootsScope active");
+- assert(scope != NULL, "Illegal argument");
+- _strong_roots_scope = scope;
+-}
+-void SharedHeap::unregister_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
+- assert(_strong_roots_scope == scope, "Wrong scope unregistered");
+- _strong_roots_scope = NULL;
+ }
+
+ void SharedHeap::change_strong_roots_parity() {
+@@ -140,174 +86,15 @@
+ }
+
+ SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
+- : MarkScope(activate), _sh(heap), _n_workers_done_with_threads(0)
++ : MarkScope(activate), _sh(heap)
+ {
+ if (_active) {
+- _sh->register_strong_roots_scope(this);
+ _sh->change_strong_roots_parity();
+ // Zero the claimed high water mark in the StringTable
+ StringTable::clear_parallel_claimed_index();
+ }
+ }
+
+-SharedHeap::StrongRootsScope::~StrongRootsScope() {
+- if (_active) {
+- _sh->unregister_strong_roots_scope(this);
+- }
+-}
+-
+-Monitor* SharedHeap::StrongRootsScope::_lock = new Monitor(Mutex::leaf, "StrongRootsScope lock", false);
+-
+-void SharedHeap::StrongRootsScope::mark_worker_done_with_threads(uint n_workers) {
+- // The Thread work barrier is only needed by G1 Class Unloading.
+- // No need to use the barrier if this is single-threaded code.
+- if (UseG1GC && ClassUnloadingWithConcurrentMark && n_workers > 0) {
+- uint new_value = (uint)Atomic::add(1, &_n_workers_done_with_threads);
+- if (new_value == n_workers) {
+- // This thread is last. Notify the others.
+- MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
+- _lock->notify_all();
+- }
+- }
+-}
+-
+-void SharedHeap::StrongRootsScope::wait_until_all_workers_done_with_threads(uint n_workers) {
+- assert(UseG1GC, "Currently only used by G1");
+- assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
+-
+- // No need to use the barrier if this is single-threaded code.
+- if (n_workers > 0 && (uint)_n_workers_done_with_threads != n_workers) {
+- MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
+- while ((uint)_n_workers_done_with_threads != n_workers) {
+- _lock->wait(Mutex::_no_safepoint_check_flag, 0, false);
+- }
+- }
+-}
+-
+-void SharedHeap::process_roots(bool activate_scope,
+- ScanningOption so,
+- OopClosure* strong_roots,
+- OopClosure* weak_roots,
+- CLDClosure* strong_cld_closure,
+- CLDClosure* weak_cld_closure,
+- CodeBlobClosure* code_roots) {
+- StrongRootsScope srs(this, activate_scope);
+-
+- // General roots.
+- assert(_strong_roots_parity != 0, "must have called prologue code");
+- assert(code_roots != NULL, "code root closure should always be set");
+- // _n_termination for _process_strong_tasks should be set up stream
+- // in a method not running in a GC worker. Otherwise the GC worker
+- // could be trying to change the termination condition while the task
+- // is executing in another GC worker.
+-
+- // Iterating over the CLDG and the Threads are done early to allow G1 to
+- // first process the strong CLDs and nmethods and then, after a barrier,
+- // let the thread process the weak CLDs and nmethods.
+-
+- if (!_process_strong_tasks->is_task_claimed(SH_PS_ClassLoaderDataGraph_oops_do)) {
+- ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
+- }
+-
+- // Some CLDs contained in the thread frames should be considered strong.
+- // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
+- CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
+- // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
+- CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
+-
+- Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
+-
+- // This is the point where this worker thread will not find more strong CLDs/nmethods.
+- // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
+- active_strong_roots_scope()->mark_worker_done_with_threads(n_par_threads());
+-
+- if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) {
+- Universe::oops_do(strong_roots);
+- }
+- // Global (strong) JNI handles
+- if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
+- JNIHandles::oops_do(strong_roots);
+-
+- if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
+- ObjectSynchronizer::oops_do(strong_roots);
+- if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do))
+- FlatProfiler::oops_do(strong_roots);
+- if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do))
+- Management::oops_do(strong_roots);
+- if (!_process_strong_tasks->is_task_claimed(SH_PS_jvmti_oops_do))
+- JvmtiExport::oops_do(strong_roots);
+-
+- if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) {
+- SystemDictionary::roots_oops_do(strong_roots, weak_roots);
+- }
+-
+- // All threads execute the following. A specific chunk of buckets
+- // from the StringTable are the individual tasks.
+- if (weak_roots != NULL) {
+- if (CollectedHeap::use_parallel_gc_threads()) {
+- StringTable::possibly_parallel_oops_do(weak_roots);
+- } else {
+- StringTable::oops_do(weak_roots);
+- }
+- }
+-
+- if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) {
+- if (so & SO_ScavengeCodeCache) {
+- assert(code_roots != NULL, "must supply closure for code cache");
+-
+- // We only visit parts of the CodeCache when scavenging.
+- CodeCache::scavenge_root_nmethods_do(code_roots);
+- }
+- if (so & SO_AllCodeCache) {
+- assert(code_roots != NULL, "must supply closure for code cache");
+-
+- // CMSCollector uses this to do intermediate-strength collections.
+- // We scan the entire code cache, since CodeCache::do_unloading is not called.
+- CodeCache::blobs_do(code_roots);
+- }
+- // Verify that the code cache contents are not subject to
+- // movement by a scavenging collection.
+- DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
+- DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
+- }
+-
+- _process_strong_tasks->all_tasks_completed();
+-}
+-
+-void SharedHeap::process_all_roots(bool activate_scope,
+- ScanningOption so,
+- OopClosure* roots,
+- CLDClosure* cld_closure,
+- CodeBlobClosure* code_closure) {
+- process_roots(activate_scope, so,
+- roots, roots,
+- cld_closure, cld_closure,
+- code_closure);
+-}
+-
+-void SharedHeap::process_strong_roots(bool activate_scope,
+- ScanningOption so,
+- OopClosure* roots,
+- CLDClosure* cld_closure,
+- CodeBlobClosure* code_closure) {
+- process_roots(activate_scope, so,
+- roots, NULL,
+- cld_closure, NULL,
+- code_closure);
+-}
+-
+-
+-class AlwaysTrueClosure: public BoolObjectClosure {
+-public:
+- bool do_object_b(oop p) { return true; }
+-};
+-static AlwaysTrueClosure always_true;
+-
+-void SharedHeap::process_weak_roots(OopClosure* root_closure) {
+- // Global (weak) JNI handles
+- JNIHandles::weak_oops_do(&always_true, root_closure);
+-}
+-
+ void SharedHeap::set_barrier_set(BarrierSet* bs) {
+ _barrier_set = bs;
+ // Cached barrier set for fast access in oops
+--- ./hotspot/src/share/vm/memory/sharedHeap.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/sharedHeap.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -61,18 +61,18 @@
+ // counts the number of tasks that have been done and then reset
+ // the SubTasksDone so that it can be used again. When the number of
+ // tasks is set to the number of GC workers, then _n_threads must
+-// be set to the number of active GC workers. G1CollectedHeap,
+-// HRInto_G1RemSet, GenCollectedHeap and SharedHeap have SubTasksDone.
+-// This seems too many.
++// be set to the number of active GC workers. G1RootProcessor and
++// GenCollectedHeap have SubTasksDone.
+ // 3) SequentialSubTasksDone has an _n_threads that is used in
+ // a way similar to SubTasksDone and has the same dependency on the
+ // number of active GC workers. CompactibleFreeListSpace and Space
+ // have SequentialSubTasksDone's.
+-// Example of using SubTasksDone and SequentialSubTasksDone
+-// G1CollectedHeap::g1_process_roots()
+-// to SharedHeap::process_roots() and uses
+-// SubTasksDone* _process_strong_tasks to claim tasks.
+-// process_roots() calls
++//
++// Examples of using SubTasksDone and SequentialSubTasksDone:
++// G1RootProcessor and GenCollectedHeap::process_roots() use
++// SubTasksDone* _process_strong_tasks to claim tasks for workers
++//
++// GenCollectedHeap::gen_process_roots() calls
+ // rem_set()->younger_refs_iterate()
+ // to scan the card table and which eventually calls down into
+ // CardTableModRefBS::par_non_clean_card_iterate_work(). This method
+@@ -104,10 +104,6 @@
+ friend class VM_GC_Operation;
+ friend class VM_CGC_Operation;
+
+-private:
+- // For claiming strong_roots tasks.
+- SubTasksDone* _process_strong_tasks;
+-
+ protected:
+ // There should be only a single instance of "SharedHeap" in a program.
+ // This is enforced with the protected constructor below, which will also
+@@ -144,7 +140,6 @@
+ static SharedHeap* heap() { return _sh; }
+
+ void set_barrier_set(BarrierSet* bs);
+- SubTasksDone* process_strong_tasks() { return _process_strong_tasks; }
+
+ // Does operations required after initialization has been done.
+ virtual void post_initialize();
+@@ -201,69 +196,19 @@
+ // strong_roots_prologue calls change_strong_roots_parity, if
+ // parallel tasks are enabled.
+ class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope {
+- // Used to implement the Thread work barrier.
+- static Monitor* _lock;
+-
+ SharedHeap* _sh;
+- volatile jint _n_workers_done_with_threads;
+
+ public:
+ StrongRootsScope(SharedHeap* heap, bool activate = true);
+- ~StrongRootsScope();
+-
+- // Mark that this thread is done with the Threads work.
+- void mark_worker_done_with_threads(uint n_workers);
+- // Wait until all n_workers are done with the Threads work.
+- void wait_until_all_workers_done_with_threads(uint n_workers);
+ };
+ friend class StrongRootsScope;
+
+- // The current active StrongRootScope
+- StrongRootsScope* _strong_roots_scope;
+-
+- StrongRootsScope* active_strong_roots_scope() const;
+-
+ private:
+- void register_strong_roots_scope(StrongRootsScope* scope);
+- void unregister_strong_roots_scope(StrongRootsScope* scope);
+ void change_strong_roots_parity();
+
+ public:
+- enum ScanningOption {
+- SO_None = 0x0,
+- SO_AllCodeCache = 0x8,
+- SO_ScavengeCodeCache = 0x10
+- };
+-
+ FlexibleWorkGang* workers() const { return _workers; }
+
+- // Invoke the "do_oop" method the closure "roots" on all root locations.
+- // The "so" argument determines which roots the closure is applied to:
+- // "SO_None" does none;
+- // "SO_AllCodeCache" applies the closure to all elements of the CodeCache.
+- // "SO_ScavengeCodeCache" applies the closure to elements on the scavenge root list in the CodeCache.
+- void process_roots(bool activate_scope,
+- ScanningOption so,
+- OopClosure* strong_roots,
+- OopClosure* weak_roots,
+- CLDClosure* strong_cld_closure,
+- CLDClosure* weak_cld_closure,
+- CodeBlobClosure* code_roots);
+- void process_all_roots(bool activate_scope,
+- ScanningOption so,
+- OopClosure* roots,
+- CLDClosure* cld_closure,
+- CodeBlobClosure* code_roots);
+- void process_strong_roots(bool activate_scope,
+- ScanningOption so,
+- OopClosure* roots,
+- CLDClosure* cld_closure,
+- CodeBlobClosure* code_roots);
+-
+-
+- // Apply "root_closure" to the JNI weak roots..
+- void process_weak_roots(OopClosure* root_closure);
+-
+ // The functions below are helper functions that a subclass of
+ // "SharedHeap" can use in the implementation of its virtual
+ // functions.
+@@ -278,9 +223,6 @@
+ // (such as process roots) subsequently.
+ virtual void set_par_threads(uint t);
+
+- int n_termination();
+- void set_n_termination(int t);
+-
+ //
+ // New methods from CollectedHeap
+ //
+@@ -292,8 +234,4 @@
+ size_t capacity);
+ };
+
+-inline SharedHeap::ScanningOption operator|(SharedHeap::ScanningOption so0, SharedHeap::ScanningOption so1) {
+- return static_cast<SharedHeap::ScanningOption>(static_cast<int>(so0) | static_cast<int>(so1));
+-}
+-
+ #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP
+--- ./hotspot/src/share/vm/memory/tenuredGeneration.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/memory/tenuredGeneration.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2013, 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
+@@ -24,7 +24,6 @@
+
+ #include "precompiled.hpp"
+ #include "gc_implementation/shared/collectorCounters.hpp"
+-#include "gc_implementation/shared/parGCAllocBuffer.hpp"
+ #include "memory/allocation.inline.hpp"
+ #include "memory/blockOffsetTable.inline.hpp"
+ #include "memory/generation.inline.hpp"
+@@ -34,6 +33,9 @@
+ #include "oops/oop.inline.hpp"
+ #include "runtime/java.hpp"
+ #include "utilities/macros.hpp"
++#if INCLUDE_ALL_GCS
++#include "gc_implementation/shared/parGCAllocBuffer.hpp"
++#endif
+
+ TenuredGeneration::TenuredGeneration(ReservedSpace rs,
+ size_t initial_byte_size, int level,
+--- ./hotspot/src/share/vm/oops/constMethod.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/constMethod.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2013, 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
+@@ -222,6 +222,7 @@
+ u2 _max_stack; // Maximum number of entries on the expression stack
+ u2 _max_locals; // Number of local variables used by this method
+ u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
++ u2 _orig_method_idnum; // Original unique identification number for the method
+
+ // Constructor
+ ConstMethod(int byte_code_size,
+@@ -475,6 +476,9 @@
+ u2 method_idnum() const { return _method_idnum; }
+ void set_method_idnum(u2 idnum) { _method_idnum = idnum; }
+
++ u2 orig_method_idnum() const { return _orig_method_idnum; }
++ void set_orig_method_idnum(u2 idnum) { _orig_method_idnum = idnum; }
++
+ // max stack
+ int max_stack() const { return _max_stack; }
+ void set_max_stack(int size) { _max_stack = size; }
+--- ./hotspot/src/share/vm/oops/cpCache.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/cpCache.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -449,7 +449,6 @@
+ new_method->name()->as_C_string(),
+ new_method->signature()->as_C_string()));
+ }
+-
+ return true;
+ }
+
+@@ -477,7 +476,6 @@
+ new_method->name()->as_C_string(),
+ new_method->signature()->as_C_string()));
+ }
+-
+ return true;
+ }
+
+@@ -498,41 +496,39 @@
+ // _f1 == NULL || !_f1->is_method() are OK here
+ return true;
+ }
+- // return false if _f1 refers to an old or an obsolete method
++ // return false if _f1 refers to a non-deleted old or obsolete method
+ return (NOT_PRODUCT(_f1->is_valid() &&) _f1->is_method() &&
+- !((Method*)_f1)->is_old() && !((Method*)_f1)->is_obsolete());
++ (f1_as_method()->is_deleted() ||
++ (!f1_as_method()->is_old() && !f1_as_method()->is_obsolete())));
+ }
+
+-bool ConstantPoolCacheEntry::is_interesting_method_entry(Klass* k) {
++Method* ConstantPoolCacheEntry::get_interesting_method_entry(Klass* k) {
+ if (!is_method_entry()) {
+ // not a method entry so not interesting by default
+- return false;
++ return NULL;
+ }
+-
+ Method* m = NULL;
+ if (is_vfinal()) {
+ // virtual and final so _f2 contains method ptr instead of vtable index
+ m = f2_as_vfinal_method();
+ } else if (is_f1_null()) {
+ // NULL _f1 means this is a virtual entry so also not interesting
+- return false;
++ return NULL;
+ } else {
+ if (!(_f1->is_method())) {
+ // _f1 can also contain a Klass* for an interface
+- return false;
++ return NULL;
+ }
+ m = f1_as_method();
+ }
+-
+ assert(m != NULL && m->is_method(), "sanity check");
+ if (m == NULL || !m->is_method() || (k != NULL && m->method_holder() != k)) {
+ // robustness for above sanity checks or method is not in
+ // the interesting class
+- return false;
++ return NULL;
+ }
+-
+ // the method is in the interesting class so the entry is interesting
+- return true;
++ return m;
+ }
+ #endif // INCLUDE_JVMTI
+
+@@ -608,46 +604,31 @@
+ // RedefineClasses() API support:
+ // If any entry of this ConstantPoolCache points to any of
+ // old_methods, replace it with the corresponding new_method.
+-void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new_methods,
+- int methods_length, bool * trace_name_printed) {
+-
+- if (methods_length == 0) {
+- // nothing to do if there are no methods
+- return;
+- }
+-
+- // get shorthand for the interesting class
+- Klass* old_holder = old_methods[0]->method_holder();
+-
++void ConstantPoolCache::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
+ for (int i = 0; i < length(); i++) {
+- if (!entry_at(i)->is_interesting_method_entry(old_holder)) {
+- // skip uninteresting methods
++ ConstantPoolCacheEntry* entry = entry_at(i);
++ Method* old_method = entry->get_interesting_method_entry(holder);
++ if (old_method == NULL || !old_method->is_old()) {
++ continue; // skip uninteresting entries
++ }
++ if (old_method->is_deleted()) {
++ // clean up entries with deleted methods
++ entry->initialize_entry(entry->constant_pool_index());
+ continue;
+ }
++ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
+
+- // The ConstantPoolCache contains entries for several different
+- // things, but we only care about methods. In fact, we only care
+- // about methods in the same class as the one that contains the
+- // old_methods. At this point, we have an interesting entry.
++ assert(new_method != NULL, "method_with_idnum() should not be NULL");
++ assert(old_method != new_method, "sanity check");
+
+- for (int j = 0; j < methods_length; j++) {
+- Method* old_method = old_methods[j];
+- Method* new_method = new_methods[j];
+-
+- if (entry_at(i)->adjust_method_entry(old_method, new_method,
+- trace_name_printed)) {
+- // current old_method matched this entry and we updated it so
+- // break out and get to the next interesting entry if there one
+- break;
+- }
+- }
++ entry_at(i)->adjust_method_entry(old_method, new_method, trace_name_printed);
+ }
+ }
+
+ // the constant pool cache should never contain old or obsolete methods
+ bool ConstantPoolCache::check_no_old_or_obsolete_entries() {
+ for (int i = 1; i < length(); i++) {
+- if (entry_at(i)->is_interesting_method_entry(NULL) &&
++ if (entry_at(i)->get_interesting_method_entry(NULL) != NULL &&
+ !entry_at(i)->check_no_old_or_obsolete_entries()) {
+ return false;
+ }
+@@ -657,7 +638,7 @@
+
+ void ConstantPoolCache::dump_cache() {
+ for (int i = 1; i < length(); i++) {
+- if (entry_at(i)->is_interesting_method_entry(NULL)) {
++ if (entry_at(i)->get_interesting_method_entry(NULL) != NULL) {
+ entry_at(i)->print(tty, i);
+ }
+ }
+--- ./hotspot/src/share/vm/oops/cpCache.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/cpCache.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -378,9 +378,9 @@
+ // printed the klass name so that other routines in the adjust_*
+ // group don't print the klass name.
+ bool adjust_method_entry(Method* old_method, Method* new_method,
+- bool * trace_name_printed);
++ bool* trace_name_printed);
+ bool check_no_old_or_obsolete_entries();
+- bool is_interesting_method_entry(Klass* k);
++ Method* get_interesting_method_entry(Klass* k);
+ #endif // INCLUDE_JVMTI
+
+ // Debugging & Printing
+@@ -476,8 +476,7 @@
+ // trace_name_printed is set to true if the current call has
+ // printed the klass name so that other routines in the adjust_*
+ // group don't print the klass name.
+- void adjust_method_entries(Method** old_methods, Method** new_methods,
+- int methods_length, bool * trace_name_printed);
++ void adjust_method_entries(InstanceKlass* holder, bool* trace_name_printed);
+ bool check_no_old_or_obsolete_entries();
+ void dump_cache();
+ #endif // INCLUDE_JVMTI
+--- ./hotspot/src/share/vm/oops/instanceKlass.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/instanceKlass.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -50,6 +50,7 @@
+ #include "prims/jvmtiExport.hpp"
+ #include "prims/jvmtiRedefineClassesTrace.hpp"
+ #include "prims/jvmtiRedefineClasses.hpp"
++#include "prims/jvmtiThreadState.hpp"
+ #include "prims/methodComparator.hpp"
+ #include "runtime/fieldDescriptor.hpp"
+ #include "runtime/handles.inline.hpp"
+@@ -110,7 +111,7 @@
+ len = name->utf8_length(); \
+ } \
+ HS_DTRACE_PROBE4(hotspot, class__initialization__##type, \
+- data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), thread_type); \
++ data, len, (void *)(clss)->class_loader(), thread_type); \
+ }
+
+ #define DTRACE_CLASSINIT_PROBE_WAIT(type, clss, thread_type, wait) \
+@@ -123,7 +124,7 @@
+ len = name->utf8_length(); \
+ } \
+ HS_DTRACE_PROBE5(hotspot, class__initialization__##type, \
+- data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), thread_type, wait); \
++ data, len, (void *)(clss)->class_loader(), thread_type, wait); \
+ }
+ #else /* USDT2 */
+
+@@ -928,10 +929,16 @@
+ // Step 10 and 11
+ Handle e(THREAD, PENDING_EXCEPTION);
+ CLEAR_PENDING_EXCEPTION;
++ // JVMTI has already reported the pending exception
++ // JVMTI internal flag reset is needed in order to report ExceptionInInitializerError
++ JvmtiExport::clear_detected_exception((JavaThread*)THREAD);
+ {
+ EXCEPTION_MARK;
+ this_oop->set_initialization_state_and_notify(initialization_error, THREAD);
+ CLEAR_PENDING_EXCEPTION; // ignore any exception thrown, class initialization error is thrown below
++ // JVMTI has already reported the pending exception
++ // JVMTI internal flag reset is needed in order to report ExceptionInInitializerError
++ JvmtiExport::clear_detected_exception((JavaThread*)THREAD);
+ }
+ DTRACE_CLASSINIT_PROBE_WAIT(error, InstanceKlass::cast(this_oop()), -1,wait);
+ if (e->is_a(SystemDictionary::Error_klass())) {
+@@ -2798,30 +2805,33 @@
+ // not yet in the vtable due to concurrent subclass define and superinterface
+ // redefinition
+ // Note: those in the vtable, should have been updated via adjust_method_entries
+-void InstanceKlass::adjust_default_methods(Method** old_methods, Method** new_methods,
+- int methods_length, bool* trace_name_printed) {
++void InstanceKlass::adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed) {
+ // search the default_methods for uses of either obsolete or EMCP methods
+ if (default_methods() != NULL) {
+- for (int j = 0; j < methods_length; j++) {
+- Method* old_method = old_methods[j];
+- Method* new_method = new_methods[j];
+-
+- for (int index = 0; index < default_methods()->length(); index ++) {
+- if (default_methods()->at(index) == old_method) {
+- default_methods()->at_put(index, new_method);
+- if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+- if (!(*trace_name_printed)) {
+- // RC_TRACE_MESG macro has an embedded ResourceMark
+- RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
+- external_name(),
+- old_method->method_holder()->external_name()));
+- *trace_name_printed = true;
+- }
+- RC_TRACE(0x00100000, ("default method update: %s(%s) ",
+- new_method->name()->as_C_string(),
+- new_method->signature()->as_C_string()));
+- }
++ for (int index = 0; index < default_methods()->length(); index ++) {
++ Method* old_method = default_methods()->at(index);
++ if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
++ continue; // skip uninteresting entries
++ }
++ assert(!old_method->is_deleted(), "default methods may not be deleted");
++
++ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
++
++ assert(new_method != NULL, "method_with_idnum() should not be NULL");
++ assert(old_method != new_method, "sanity check");
++
++ default_methods()->at_put(index, new_method);
++ if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
++ if (!(*trace_name_printed)) {
++ // RC_TRACE_MESG macro has an embedded ResourceMark
++ RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
++ external_name(),
++ old_method->method_holder()->external_name()));
++ *trace_name_printed = true;
+ }
++ RC_TRACE(0x00100000, ("default method update: %s(%s) ",
++ new_method->name()->as_C_string(),
++ new_method->signature()->as_C_string()));
+ }
+ }
+ }
+@@ -3744,6 +3754,22 @@
+ } // end has_previous_version()
+
+
++InstanceKlass* InstanceKlass::get_klass_version(int version) {
++ if (constants()->version() == version) {
++ return this;
++ }
++ PreviousVersionWalker pvw(Thread::current(), (InstanceKlass*)this);
++ for (PreviousVersionNode * pv_node = pvw.next_previous_version();
++ pv_node != NULL; pv_node = pvw.next_previous_version()) {
++ ConstantPool* prev_cp = pv_node->prev_constant_pool();
++ if (prev_cp->version() == version) {
++ return prev_cp->pool_holder();
++ }
++ }
++ return NULL; // None found
++}
++
++
+ Method* InstanceKlass::method_with_idnum(int idnum) {
+ Method* m = NULL;
+ if (idnum < methods()->length()) {
+@@ -3762,6 +3788,37 @@
+ return m;
+ }
+
++
++Method* InstanceKlass::method_with_orig_idnum(int idnum) {
++ if (idnum >= methods()->length()) {
++ return NULL;
++ }
++ Method* m = methods()->at(idnum);
++ if (m != NULL && m->orig_method_idnum() == idnum) {
++ return m;
++ }
++ // Obsolete method idnum does not match the original idnum
++ for (int index = 0; index < methods()->length(); ++index) {
++ m = methods()->at(index);
++ if (m->orig_method_idnum() == idnum) {
++ return m;
++ }
++ }
++ // None found, return null for the caller to handle.
++ return NULL;
++}
++
++
++Method* InstanceKlass::method_with_orig_idnum(int idnum, int version) {
++ InstanceKlass* holder = get_klass_version(version);
++ if (holder == NULL) {
++ return NULL; // The version of klass is gone, no method is found
++ }
++ Method* method = holder->method_with_orig_idnum(idnum);
++ return method;
++}
++
++
+ jint InstanceKlass::get_cached_class_file_len() {
+ return VM_RedefineClasses::get_cached_class_file_len(_cached_class_file);
+ }
+--- ./hotspot/src/share/vm/oops/instanceKlass.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/instanceKlass.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -358,6 +358,8 @@
+ Array<Method*>* methods() const { return _methods; }
+ void set_methods(Array<Method*>* a) { _methods = a; }
+ Method* method_with_idnum(int idnum);
++ Method* method_with_orig_idnum(int idnum);
++ Method* method_with_orig_idnum(int idnum, int version);
+
+ // method ordering
+ Array<int>* method_ordering() const { return _method_ordering; }
+@@ -658,6 +660,7 @@
+ return _previous_versions;
+ }
+
++ InstanceKlass* get_klass_version(int version);
+ static void purge_previous_versions(InstanceKlass* ik);
+
+ // JVMTI: Support for caching a class file before it is modified by an agent that can do retransformation
+@@ -959,8 +962,7 @@
+ Method* method_at_itable(Klass* holder, int index, TRAPS);
+
+ #if INCLUDE_JVMTI
+- void adjust_default_methods(Method** old_methods, Method** new_methods,
+- int methods_length, bool* trace_name_printed);
++ void adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed);
+ #endif // INCLUDE_JVMTI
+
+ // Garbage collection
+--- ./hotspot/src/share/vm/oops/klassVtable.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/klassVtable.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -881,44 +881,43 @@
+ }
+ return updated;
+ }
+-void klassVtable::adjust_method_entries(Method** old_methods, Method** new_methods,
+- int methods_length, bool * trace_name_printed) {
+- // search the vtable for uses of either obsolete or EMCP methods
+- for (int j = 0; j < methods_length; j++) {
+- Method* old_method = old_methods[j];
+- Method* new_method = new_methods[j];
+
+- // In the vast majority of cases we could get the vtable index
+- // by using: old_method->vtable_index()
+- // However, there are rare cases, eg. sun.awt.X11.XDecoratedPeer.getX()
+- // in sun.awt.X11.XFramePeer where methods occur more than once in the
+- // vtable, so, alas, we must do an exhaustive search.
+- for (int index = 0; index < length(); index++) {
+- if (unchecked_method_at(index) == old_method) {
+- put_method_at(new_method, index);
+- // For default methods, need to update the _default_methods array
+- // which can only have one method entry for a given signature
+- bool updated_default = false;
+- if (old_method->is_default_method()) {
+- updated_default = adjust_default_method(index, old_method, new_method);
+- }
++// search the vtable for uses of either obsolete or EMCP methods
++void klassVtable::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
++ int prn_enabled = 0;
++ for (int index = 0; index < length(); index++) {
++ Method* old_method = unchecked_method_at(index);
++ if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
++ continue; // skip uninteresting entries
++ }
++ assert(!old_method->is_deleted(), "vtable methods may not be deleted");
+
+- if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+- if (!(*trace_name_printed)) {
+- // RC_TRACE_MESG macro has an embedded ResourceMark
+- RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s",
+- klass()->external_name(),
+- old_method->method_holder()->external_name()));
+- *trace_name_printed = true;
+- }
+- // RC_TRACE macro has an embedded ResourceMark
+- RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s",
+- new_method->name()->as_C_string(),
+- new_method->signature()->as_C_string(),
+- updated_default ? "true" : "false"));
+- }
+- // cannot 'break' here; see for-loop comment above.
++ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
++
++ assert(new_method != NULL, "method_with_idnum() should not be NULL");
++ assert(old_method != new_method, "sanity check");
++
++ put_method_at(new_method, index);
++ // For default methods, need to update the _default_methods array
++ // which can only have one method entry for a given signature
++ bool updated_default = false;
++ if (old_method->is_default_method()) {
++ updated_default = adjust_default_method(index, old_method, new_method);
++ }
++
++ if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
++ if (!(*trace_name_printed)) {
++ // RC_TRACE_MESG macro has an embedded ResourceMark
++ RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s",
++ klass()->external_name(),
++ old_method->method_holder()->external_name()));
++ *trace_name_printed = true;
+ }
++ // RC_TRACE macro has an embedded ResourceMark
++ RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s",
++ new_method->name()->as_C_string(),
++ new_method->signature()->as_C_string(),
++ updated_default ? "true" : "false"));
+ }
+ }
+ }
+@@ -1211,37 +1210,35 @@
+ }
+
+ #if INCLUDE_JVMTI
+-void klassItable::adjust_method_entries(Method** old_methods, Method** new_methods,
+- int methods_length, bool * trace_name_printed) {
+- // search the itable for uses of either obsolete or EMCP methods
+- for (int j = 0; j < methods_length; j++) {
+- Method* old_method = old_methods[j];
+- Method* new_method = new_methods[j];
+- itableMethodEntry* ime = method_entry(0);
++// search the itable for uses of either obsolete or EMCP methods
++void klassItable::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
+
+- // The itable can describe more than one interface and the same
+- // method signature can be specified by more than one interface.
+- // This means we have to do an exhaustive search to find all the
+- // old_method references.
+- for (int i = 0; i < _size_method_table; i++) {
+- if (ime->method() == old_method) {
+- ime->initialize(new_method);
++ itableMethodEntry* ime = method_entry(0);
++ for (int i = 0; i < _size_method_table; i++, ime++) {
++ Method* old_method = ime->method();
++ if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
++ continue; // skip uninteresting entries
++ }
++ assert(!old_method->is_deleted(), "itable methods may not be deleted");
+
+- if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+- if (!(*trace_name_printed)) {
+- // RC_TRACE_MESG macro has an embedded ResourceMark
+- RC_TRACE_MESG(("adjust: name=%s",
+- old_method->method_holder()->external_name()));
+- *trace_name_printed = true;
+- }
+- // RC_TRACE macro has an embedded ResourceMark
+- RC_TRACE(0x00200000, ("itable method update: %s(%s)",
+- new_method->name()->as_C_string(),
+- new_method->signature()->as_C_string()));
+- }
+- // cannot 'break' here; see for-loop comment above.
++ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
++
++ assert(new_method != NULL, "method_with_idnum() should not be NULL");
++ assert(old_method != new_method, "sanity check");
++
++ ime->initialize(new_method);
++
++ if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
++ if (!(*trace_name_printed)) {
++ // RC_TRACE_MESG macro has an embedded ResourceMark
++ RC_TRACE_MESG(("adjust: name=%s",
++ old_method->method_holder()->external_name()));
++ *trace_name_printed = true;
+ }
+- ime++;
++ // RC_TRACE macro has an embedded ResourceMark
++ RC_TRACE(0x00200000, ("itable method update: %s(%s)",
++ new_method->name()->as_C_string(),
++ new_method->signature()->as_C_string()));
+ }
+ }
+ }
+--- ./hotspot/src/share/vm/oops/klassVtable.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/klassVtable.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -98,8 +98,7 @@
+ // printed the klass name so that other routines in the adjust_*
+ // group don't print the klass name.
+ bool adjust_default_method(int vtable_index, Method* old_method, Method* new_method);
+- void adjust_method_entries(Method** old_methods, Method** new_methods,
+- int methods_length, bool * trace_name_printed);
++ void adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed);
+ bool check_no_old_or_obsolete_entries();
+ void dump_vtable();
+ #endif // INCLUDE_JVMTI
+@@ -288,8 +287,7 @@
+ // trace_name_printed is set to true if the current call has
+ // printed the klass name so that other routines in the adjust_*
+ // group don't print the klass name.
+- void adjust_method_entries(Method** old_methods, Method** new_methods,
+- int methods_length, bool * trace_name_printed);
++ void adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed);
+ bool check_no_old_or_obsolete_entries();
+ void dump_itable();
+ #endif // INCLUDE_JVMTI
+--- ./hotspot/src/share/vm/oops/markOop.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/markOop.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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,17 +25,40 @@
+ #include "precompiled.hpp"
+ #include "oops/markOop.hpp"
+ #include "runtime/thread.inline.hpp"
++#include "runtime/objectMonitor.inline.hpp"
+
+ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
+ void markOopDesc::print_on(outputStream* st) const {
+- if (is_locked()) {
+- st->print("locked(" INTPTR_FORMAT ")->", value());
+- markOop(*(markOop*)value())->print_on(st);
++ if (is_marked()) {
++ st->print(" marked(" INTPTR_FORMAT ")", value());
++ } else if (is_locked()) {
++ st->print(" locked(" INTPTR_FORMAT ")->", value());
++ if (is_neutral()) {
++ st->print("is_neutral");
++ if (has_no_hash()) st->print(" no_hash");
++ else st->print(" hash=" INTPTR_FORMAT, hash());
++ st->print(" age=%d", age());
++ } else if (has_bias_pattern()) {
++ st->print("is_biased");
++ JavaThread* jt = biased_locker();
++ st->print(" biased_locker=" INTPTR_FORMAT, p2i(jt));
++ } else if (has_monitor()) {
++ ObjectMonitor* mon = monitor();
++ if (mon == NULL)
++ st->print("monitor=NULL");
++ else {
++ BasicLock * bl = (BasicLock *) mon->owner();
++ st->print("monitor={count="INTPTR_FORMAT",waiters="INTPTR_FORMAT",recursions="INTPTR_FORMAT",owner="INTPTR_FORMAT"}",
++ mon->count(), mon->waiters(), mon->recursions(), p2i(bl));
++ }
++ } else {
++ st->print("??");
++ }
+ } else {
+ assert(is_unlocked() || has_bias_pattern(), "just checking");
+ st->print("mark(");
+- if (has_bias_pattern()) st->print("biased,");
++ if (has_bias_pattern()) st->print("biased,");
+ st->print("hash %#lx,", hash());
+ st->print("age %d)", age());
+ }
+--- ./hotspot/src/share/vm/oops/method.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/method.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -92,6 +92,7 @@
+ set_force_inline(false);
+ set_hidden(false);
+ set_dont_inline(false);
++ set_has_injected_profile(false);
+ set_method_data(NULL);
+ clear_method_counters();
+ set_vtable_index(Method::garbage_vtable_index);
+@@ -1419,6 +1420,7 @@
+ for (int i = 0; i < length; i++) {
+ Method* m = methods->at(i);
+ m->set_method_idnum(i);
++ m->set_orig_method_idnum(i);
+ }
+ }
+ }
+--- ./hotspot/src/share/vm/oops/method.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/oops/method.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -110,12 +110,13 @@
+ #endif
+ u2 _method_size; // size of this object
+ u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
+- u1 _jfr_towrite : 1, // Flags
+- _caller_sensitive : 1,
+- _force_inline : 1,
+- _hidden : 1,
+- _dont_inline : 1,
+- : 3;
++ u1 _jfr_towrite : 1, // Flags
++ _caller_sensitive : 1,
++ _force_inline : 1,
++ _hidden : 1,
++ _dont_inline : 1,
++ _has_injected_profile : 1,
++ : 2;
+
+ #ifndef PRODUCT
+ int _compiled_invocation_count; // Number of nmethod invocations so far (for perf. debugging)
+@@ -265,6 +266,9 @@
+ u2 method_idnum() const { return constMethod()->method_idnum(); }
+ void set_method_idnum(u2 idnum) { constMethod()->set_method_idnum(idnum); }
+
++ u2 orig_method_idnum() const { return constMethod()->orig_method_idnum(); }
++ void set_orig_method_idnum(u2 idnum) { constMethod()->set_orig_method_idnum(idnum); }
++
+ // code size
+ int code_size() const { return constMethod()->code_size(); }
+
+@@ -714,6 +718,8 @@
+ void set_is_old() { _access_flags.set_is_old(); }
+ bool is_obsolete() const { return access_flags().is_obsolete(); }
+ void set_is_obsolete() { _access_flags.set_is_obsolete(); }
++ bool is_deleted() const { return access_flags().is_deleted(); }
++ void set_is_deleted() { _access_flags.set_is_deleted(); }
+ bool on_stack() const { return access_flags().on_stack(); }
+ void set_on_stack(const bool value);
+
+@@ -776,16 +782,19 @@
+ void init_intrinsic_id(); // updates from _none if a match
+ static vmSymbols::SID klass_id_for_intrinsics(Klass* holder);
+
+- bool jfr_towrite() { return _jfr_towrite; }
+- void set_jfr_towrite(bool x) { _jfr_towrite = x; }
+- bool caller_sensitive() { return _caller_sensitive; }
+- void set_caller_sensitive(bool x) { _caller_sensitive = x; }
+- bool force_inline() { return _force_inline; }
+- void set_force_inline(bool x) { _force_inline = x; }
+- bool dont_inline() { return _dont_inline; }
+- void set_dont_inline(bool x) { _dont_inline = x; }
+- bool is_hidden() { return _hidden; }
+- void set_hidden(bool x) { _hidden = x; }
++ bool jfr_towrite() { return _jfr_towrite; }
++ void set_jfr_towrite(bool x) { _jfr_towrite = x; }
++ bool caller_sensitive() { return _caller_sensitive; }
++ void set_caller_sensitive(bool x) { _caller_sensitive = x; }
++ bool force_inline() { return _force_inline; }
++ void set_force_inline(bool x) { _force_inline = x; }
++ bool dont_inline() { return _dont_inline; }
++ void set_dont_inline(bool x) { _dont_inline = x; }
++ bool is_hidden() { return _hidden; }
++ void set_hidden(bool x) { _hidden = x; }
++ bool has_injected_profile() { return _has_injected_profile; }
++ void set_has_injected_profile(bool x) { _has_injected_profile = x; }
++
+ ConstMethod::MethodType method_type() const {
+ return _constMethod->method_type();
+ }
+--- ./hotspot/src/share/vm/opto/bytecodeInfo.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/bytecodeInfo.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -608,11 +608,11 @@
+ }
+ int max_inline_level_adjust = 0;
+ if (caller_jvms->method() != NULL) {
+- if (caller_jvms->method()->is_compiled_lambda_form())
++ if (caller_jvms->method()->is_compiled_lambda_form()) {
+ max_inline_level_adjust += 1; // don't count actions in MH or indy adapter frames
+- else if (callee_method->is_method_handle_intrinsic() ||
+- callee_method->is_compiled_lambda_form()) {
+- max_inline_level_adjust += 1; // don't count method handle calls from java.lang.invoke implem
++ } else if (callee_method->is_method_handle_intrinsic() ||
++ callee_method->is_compiled_lambda_form()) {
++ max_inline_level_adjust += 1; // don't count method handle calls from java.lang.invoke implementation
+ }
+ if (max_inline_level_adjust != 0 && C->print_inlining() && (Verbose || WizardMode)) {
+ CompileTask::print_inline_indent(inline_level());
+--- ./hotspot/src/share/vm/opto/c2compiler.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/c2compiler.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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,25 +25,17 @@
+ #include "precompiled.hpp"
+ #include "opto/c2compiler.hpp"
+ #include "opto/runtime.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/opto/callGenerator.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/callGenerator.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -859,7 +859,8 @@
+ // Parse::do_call())
+ target = C->optimize_virtual_call(caller, jvms->bci(), klass, klass,
+ target, receiver_type, is_virtual,
+- call_does_dispatch, vtable_index); // out-parameters
++ call_does_dispatch, vtable_index, // out-parameters
++ /*check_access=*/false);
+ // We lack profiling at this call but type speculation may
+ // provide us with a type
+ speculative_receiver_type = (receiver_type != NULL) ? receiver_type->speculative_type() : NULL;
+--- ./hotspot/src/share/vm/opto/callnode.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/callnode.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -23,6 +23,7 @@
+ */
+
+ #include "precompiled.hpp"
++#include "compiler/compileLog.hpp"
+ #include "ci/bcEscapeAnalyzer.hpp"
+ #include "compiler/oopMap.hpp"
+ #include "opto/callGenerator.hpp"
+@@ -1670,6 +1671,9 @@
+ // The lock could be marked eliminated by lock coarsening
+ // code during first IGVN before EA. Replace coarsened flag
+ // to eliminate all associated locks/unlocks.
++#ifdef ASSERT
++ this->log_lock_optimization(phase->C,"eliminate_lock_set_non_esc1");
++#endif
+ this->set_non_esc_obj();
+ return result;
+ }
+@@ -1731,6 +1735,9 @@
+ AbstractLockNode* lock = lock_ops.at(i);
+
+ // Mark it eliminated by coarsening and update any counters
++#ifdef ASSERT
++ lock->log_lock_optimization(phase->C, "eliminate_lock_set_coarsened");
++#endif
+ lock->set_coarsened();
+ }
+ } else if (ctrl->is_Region() &&
+@@ -1749,16 +1756,33 @@
+
+ //=============================================================================
+ bool LockNode::is_nested_lock_region() {
++ return is_nested_lock_region(NULL);
++}
++
++// p is used for access to compilation log; no logging if NULL
++bool LockNode::is_nested_lock_region(Compile * c) {
+ BoxLockNode* box = box_node()->as_BoxLock();
+ int stk_slot = box->stack_slot();
+- if (stk_slot <= 0)
++ if (stk_slot <= 0) {
++#ifdef ASSERT
++ this->log_lock_optimization(c, "eliminate_lock_INLR_1");
++#endif
+ return false; // External lock or it is not Box (Phi node).
++ }
+
+ // Ignore complex cases: merged locks or multiple locks.
+ Node* obj = obj_node();
+ LockNode* unique_lock = NULL;
+- if (!box->is_simple_lock_region(&unique_lock, obj) ||
+- (unique_lock != this)) {
++ if (!box->is_simple_lock_region(&unique_lock, obj)) {
++#ifdef ASSERT
++ this->log_lock_optimization(c, "eliminate_lock_INLR_2a");
++#endif
++ return false;
++ }
++ if (unique_lock != this) {
++#ifdef ASSERT
++ this->log_lock_optimization(c, "eliminate_lock_INLR_2b");
++#endif
+ return false;
+ }
+
+@@ -1778,6 +1802,9 @@
+ }
+ }
+ }
++#ifdef ASSERT
++ this->log_lock_optimization(c, "eliminate_lock_INLR_3");
++#endif
+ return false;
+ }
+
+@@ -1809,8 +1836,40 @@
+ // The lock could be marked eliminated by lock coarsening
+ // code during first IGVN before EA. Replace coarsened flag
+ // to eliminate all associated locks/unlocks.
++#ifdef ASSERT
++ this->log_lock_optimization(phase->C, "eliminate_lock_set_non_esc2");
++#endif
+ this->set_non_esc_obj();
+ }
+ }
+ return result;
+ }
++
++const char * AbstractLockNode::kind_as_string() const {
++ return is_coarsened() ? "coarsened" :
++ is_nested() ? "nested" :
++ is_non_esc_obj() ? "non_escaping" :
++ "?";
++}
++
++void AbstractLockNode::log_lock_optimization(Compile *C, const char * tag) const {
++ if (C == NULL) {
++ return;
++ }
++ CompileLog* log = C->log();
++ if (log != NULL) {
++ log->begin_head("%s lock='%d' compile_id='%d' class_id='%s' kind='%s'",
++ tag, is_Lock(), C->compile_id(),
++ is_Unlock() ? "unlock" : is_Lock() ? "lock" : "?",
++ kind_as_string());
++ log->stamp();
++ log->end_head();
++ JVMState* p = is_Unlock() ? (as_Unlock()->dbg_jvms()) : jvms();
++ while (p != NULL) {
++ log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
++ p = p->caller();
++ }
++ log->tail(tag);
++ }
++}
++
+--- ./hotspot/src/share/vm/opto/callnode.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/callnode.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -985,6 +985,9 @@
+ bool is_coarsened() const { return (_kind == Coarsened); }
+ bool is_nested() const { return (_kind == Nested); }
+
++ const char * kind_as_string() const;
++ void log_lock_optimization(Compile* c, const char * tag) const;
++
+ void set_non_esc_obj() { _kind = NonEscObj; set_eliminated_lock_counter(); }
+ void set_coarsened() { _kind = Coarsened; set_eliminated_lock_counter(); }
+ void set_nested() { _kind = Nested; set_eliminated_lock_counter(); }
+@@ -1045,15 +1048,24 @@
+ }
+
+ bool is_nested_lock_region(); // Is this Lock nested?
++ bool is_nested_lock_region(Compile * c); // Why isn't this Lock nested?
+ };
+
+ //------------------------------Unlock---------------------------------------
+ // High-level unlock operation
+ class UnlockNode : public AbstractLockNode {
++private:
++#ifdef ASSERT
++ JVMState* const _dbg_jvms; // Pointer to list of JVM State objects
++#endif
+ public:
+ virtual int Opcode() const;
+ virtual uint size_of() const; // Size is bigger
+- UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf ) {
++ UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf )
++#ifdef ASSERT
++ , _dbg_jvms(NULL)
++#endif
++ {
+ init_class_id(Class_Unlock);
+ init_flags(Flag_is_macro);
+ C->add_macro_node(this);
+@@ -1061,6 +1073,14 @@
+ virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
+ // unlock is never a safepoint
+ virtual bool guaranteed_safepoint() { return false; }
++#ifdef ASSERT
++ void set_dbg_jvms(JVMState* s) {
++ *(JVMState**)&_dbg_jvms = s; // override const attribute in the accessor
++ }
++ JVMState* dbg_jvms() const { return _dbg_jvms; }
++#else
++ JVMState* dbg_jvms() const { return NULL; }
++#endif
+ };
+
+ #endif // SHARE_VM_OPTO_CALLNODE_HPP
+--- ./hotspot/src/share/vm/opto/chaitin.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/chaitin.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -575,6 +575,9 @@
+ // Peephole remove copies
+ post_allocate_copy_removal();
+
++ // Merge multidefs if multiple defs representing the same value are used in a single block.
++ merge_multidefs();
++
+ #ifdef ASSERT
+ // Veify the graph after RA.
+ verify(&live_arena);
+@@ -837,7 +840,7 @@
+ case Op_RegD:
+ lrg.set_num_regs(2);
+ // Define platform specific register pressure
+-#if defined(SPARC) || defined(ARM)
++#if defined(SPARC) || defined(ARM32)
+ lrg.set_reg_pressure(2);
+ #elif defined(IA32)
+ if( ireg == Op_RegL ) {
+--- ./hotspot/src/share/vm/opto/chaitin.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/chaitin.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -578,6 +578,32 @@
+ // Extend the node to LRG mapping
+ void add_reference( const Node *node, const Node *old_node);
+
++ // Record the first use of a def in the block for a register.
++ class RegDefUse {
++ Node* _def;
++ Node* _first_use;
++ public:
++ RegDefUse() : _def(NULL), _first_use(NULL) { }
++ Node* def() const { return _def; }
++ Node* first_use() const { return _first_use; }
++
++ void update(Node* def, Node* use) {
++ if (_def != def) {
++ _def = def;
++ _first_use = use;
++ }
++ }
++ void clear() {
++ _def = NULL;
++ _first_use = NULL;
++ }
++ };
++ typedef GrowableArray<RegDefUse> RegToDefUseMap;
++ int possibly_merge_multidef(Node *n, uint k, Block *block, RegToDefUseMap& reg2defuse);
++
++ // Merge nodes that are a part of a multidef lrg and produce the same value within a block.
++ void merge_multidefs();
++
+ private:
+
+ static int _final_loads, _final_stores, _final_copies, _final_memoves;
+--- ./hotspot/src/share/vm/opto/classes.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/classes.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -199,6 +199,7 @@
+ macro(Opaque1)
+ macro(Opaque2)
+ macro(Opaque3)
++macro(ProfileBoolean)
+ macro(OrI)
+ macro(OrL)
+ macro(OverflowAddI)
+--- ./hotspot/src/share/vm/opto/compile.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/compile.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -67,25 +67,17 @@
+ #include "runtime/timer.hpp"
+ #include "trace/tracing.hpp"
+ #include "utilities/copy.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+@@ -3083,6 +3075,7 @@
+ default:
+ assert( !n->is_Call(), "" );
+ assert( !n->is_Mem(), "" );
++ assert( nop != Op_ProfileBoolean, "should be eliminated during IGVN");
+ break;
+ }
+
+--- ./hotspot/src/share/vm/opto/compile.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/compile.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -861,9 +861,11 @@
+ ciMethod* optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,
+ ciKlass* holder, ciMethod* callee,
+ const TypeOopPtr* receiver_type, bool is_virtual,
+- bool &call_does_dispatch, int &vtable_index);
++ bool &call_does_dispatch, int &vtable_index,
++ bool check_access = true);
+ ciMethod* optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass,
+- ciMethod* callee, const TypeOopPtr* receiver_type);
++ ciMethod* callee, const TypeOopPtr* receiver_type,
++ bool check_access = true);
+
+ // Report if there were too many traps at a current method and bci.
+ // Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded.
+--- ./hotspot/src/share/vm/opto/connode.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/connode.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1338,6 +1338,30 @@
+ return (&n == this); // Always fail except on self
+ }
+
++//=============================================================================
++
++uint ProfileBooleanNode::hash() const { return NO_HASH; }
++uint ProfileBooleanNode::cmp( const Node &n ) const {
++ return (&n == this);
++}
++
++Node *ProfileBooleanNode::Ideal(PhaseGVN *phase, bool can_reshape) {
++ if (can_reshape && _delay_removal) {
++ _delay_removal = false;
++ return this;
++ } else {
++ return NULL;
++ }
++}
++
++Node *ProfileBooleanNode::Identity( PhaseTransform *phase ) {
++ if (_delay_removal) {
++ return this;
++ } else {
++ assert(_consumed, "profile should be consumed before elimination");
++ return in(1);
++ }
++}
+
+ //------------------------------Value------------------------------------------
+ const Type *MoveL2DNode::Value( PhaseTransform *phase ) const {
+--- ./hotspot/src/share/vm/opto/connode.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/connode.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -669,6 +669,31 @@
+ bool rtm_opt() const { return (_opt == RTM_OPT); }
+ };
+
++//------------------------------ProfileBooleanNode-------------------------------
++// A node represents value profile for a boolean during parsing.
++// Once parsing is over, the node goes away (during IGVN).
++// It is used to override branch frequencies from MDO (see has_injected_profile in parse2.cpp).
++class ProfileBooleanNode : public Node {
++ uint _false_cnt;
++ uint _true_cnt;
++ bool _consumed;
++ bool _delay_removal;
++ virtual uint hash() const ; // { return NO_HASH; }
++ virtual uint cmp( const Node &n ) const;
++ public:
++ ProfileBooleanNode(Node *n, uint false_cnt, uint true_cnt) : Node(0, n),
++ _false_cnt(false_cnt), _true_cnt(true_cnt), _delay_removal(true), _consumed(false) {}
++
++ uint false_count() const { return _false_cnt; }
++ uint true_count() const { return _true_cnt; }
++
++ void consume() { _consumed = true; }
++
++ virtual int Opcode() const;
++ virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
++ virtual Node *Identity(PhaseTransform *phase);
++ virtual const Type *bottom_type() const { return TypeInt::BOOL; }
++};
+
+ //----------------------PartialSubtypeCheckNode--------------------------------
+ // The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass
+--- ./hotspot/src/share/vm/opto/doCall.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/doCall.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -956,13 +956,15 @@
+ ciMethod* Compile::optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,
+ ciKlass* holder, ciMethod* callee,
+ const TypeOopPtr* receiver_type, bool is_virtual,
+- bool& call_does_dispatch, int& vtable_index) {
++ bool& call_does_dispatch, int& vtable_index,
++ bool check_access) {
+ // Set default values for out-parameters.
+ call_does_dispatch = true;
+ vtable_index = Method::invalid_vtable_index;
+
+ // Choose call strategy.
+- ciMethod* optimized_virtual_method = optimize_inlining(caller, bci, klass, callee, receiver_type);
++ ciMethod* optimized_virtual_method = optimize_inlining(caller, bci, klass, callee,
++ receiver_type, check_access);
+
+ // Have the call been sufficiently improved such that it is no longer a virtual?
+ if (optimized_virtual_method != NULL) {
+@@ -977,7 +979,8 @@
+
+ // Identify possible target method and inlining style
+ ciMethod* Compile::optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass,
+- ciMethod* callee, const TypeOopPtr* receiver_type) {
++ ciMethod* callee, const TypeOopPtr* receiver_type,
++ bool check_access) {
+ // only use for virtual or interface calls
+
+ // If it is obviously final, do not bother to call find_monomorphic_target,
+@@ -1017,7 +1020,7 @@
+ }
+
+ ciInstanceKlass* calling_klass = caller->holder();
+- ciMethod* cha_monomorphic_target = callee->find_monomorphic_target(calling_klass, klass, actual_receiver);
++ ciMethod* cha_monomorphic_target = callee->find_monomorphic_target(calling_klass, klass, actual_receiver, check_access);
+ if (cha_monomorphic_target != NULL) {
+ assert(!cha_monomorphic_target->is_abstract(), "");
+ // Look at the method-receiver type. Does it add "too much information"?
+--- ./hotspot/src/share/vm/opto/escape.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/escape.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -205,6 +205,11 @@
+ _verify = false;
+ }
+ #endif
++ // Bytecode analyzer BCEscapeAnalyzer, used for Call nodes
++ // processing, calls to CI to resolve symbols (types, fields, methods)
++ // referenced in bytecode. During symbol resolution VM may throw
++ // an exception which CI cleans and converts to compilation failure.
++ if (C->failing()) return false;
+
+ // 2. Finish Graph construction by propagating references to all
+ // java objects through graph.
+@@ -1789,6 +1794,9 @@
+ // The lock could be marked eliminated by lock coarsening
+ // code during first IGVN before EA. Replace coarsened flag
+ // to eliminate all associated locks/unlocks.
++#ifdef ASSERT
++ alock->log_lock_optimization(C, "eliminate_lock_set_non_esc3");
++#endif
+ alock->set_non_esc_obj();
+ }
+ }
+--- ./hotspot/src/share/vm/opto/gcm.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/gcm.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -35,25 +35,17 @@
+ #include "opto/rootnode.hpp"
+ #include "opto/runtime.hpp"
+ #include "runtime/deoptimization.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/opto/graphKit.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/graphKit.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2013, 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
+@@ -1452,16 +1452,18 @@
+ // factory methods in "int adr_idx"
+ Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
+ int adr_idx,
+- MemNode::MemOrd mo, bool require_atomic_access) {
++ MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency, bool require_atomic_access) {
+ assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
+ const TypePtr* adr_type = NULL; // debug-mode-only argument
+ debug_only(adr_type = C->get_adr_type(adr_idx));
+ Node* mem = memory(adr_idx);
+ Node* ld;
+ if (require_atomic_access && bt == T_LONG) {
+- ld = LoadLNode::make_atomic(C, ctl, mem, adr, adr_type, t, mo);
++ ld = LoadLNode::make_atomic(C, ctl, mem, adr, adr_type, t, mo, control_dependency);
++ } else if (require_atomic_access && bt == T_DOUBLE) {
++ ld = LoadDNode::make_atomic(C, ctl, mem, adr, adr_type, t, mo, control_dependency);
+ } else {
+- ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo);
++ ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency);
+ }
+ ld = _gvn.transform(ld);
+ if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {
+@@ -1482,6 +1484,8 @@
+ Node* st;
+ if (require_atomic_access && bt == T_LONG) {
+ st = StoreLNode::make_atomic(C, ctl, mem, adr, adr_type, val, mo);
++ } else if (require_atomic_access && bt == T_DOUBLE) {
++ st = StoreDNode::make_atomic(C, ctl, mem, adr, adr_type, val, mo);
+ } else {
+ st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo);
+ }
+@@ -1980,6 +1984,11 @@
+ Deoptimization::trap_request_index(trap_request) < 0 &&
+ too_many_recompiles(reason)) {
+ // This BCI is causing too many recompilations.
++ if (C->log() != NULL) {
++ C->log()->elem("observe that='trap_action_change' reason='%s' from='%s' to='none'",
++ Deoptimization::trap_reason_name(reason),
++ Deoptimization::trap_action_name(action));
++ }
+ action = Deoptimization::Action_none;
+ trap_request = Deoptimization::make_trap_request(reason, action);
+ } else {
+@@ -2742,7 +2751,7 @@
+ Deoptimization::DeoptReason reason = spec_klass == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check;
+
+ // Make sure we haven't already deoptimized from this tactic.
+- if (too_many_traps(reason))
++ if (too_many_traps(reason) || too_many_recompiles(reason))
+ return NULL;
+
+ // (No, this isn't a call, but it's enough like a virtual call
+@@ -2764,8 +2773,7 @@
+ &exact_obj);
+ { PreserveJVMState pjvms(this);
+ set_control(slow_ctl);
+- uncommon_trap(reason,
+- Deoptimization::Action_maybe_recompile);
++ uncommon_trap_exact(reason, Deoptimization::Action_maybe_recompile);
+ }
+ if (safe_for_replace) {
+ replace_in_map(not_null_obj, exact_obj);
+@@ -2793,8 +2801,8 @@
+ if (type != NULL) {
+ Deoptimization::DeoptReason class_reason = Deoptimization::Reason_speculate_class_check;
+ Deoptimization::DeoptReason null_reason = Deoptimization::Reason_null_check;
+- if (!too_many_traps(null_reason) &&
+- !too_many_traps(class_reason)) {
++ if (!too_many_traps(null_reason) && !too_many_recompiles(null_reason) &&
++ !too_many_traps(class_reason) && !too_many_recompiles(class_reason)) {
+ Node* not_null_obj = NULL;
+ // not_null is true if we know the object is not null and
+ // there's no need for a null check
+@@ -2813,14 +2821,14 @@
+ {
+ PreserveJVMState pjvms(this);
+ set_control(slow_ctl);
+- uncommon_trap(class_reason,
+- Deoptimization::Action_maybe_recompile);
++ uncommon_trap_exact(class_reason, Deoptimization::Action_maybe_recompile);
+ }
+ replace_in_map(not_null_obj, exact_obj);
+ obj = exact_obj;
+ }
+ } else {
+- if (!too_many_traps(Deoptimization::Reason_null_assert)) {
++ if (!too_many_traps(Deoptimization::Reason_null_assert) &&
++ !too_many_recompiles(Deoptimization::Reason_null_assert)) {
+ Node* exact_obj = null_assert(obj);
+ replace_in_map(obj, exact_obj);
+ obj = exact_obj;
+@@ -3211,6 +3219,9 @@
+
+ const TypeFunc *tf = OptoRuntime::complete_monitor_exit_Type();
+ UnlockNode *unlock = new (C) UnlockNode(C, tf);
++#ifdef ASSERT
++ unlock->set_dbg_jvms(sync_jvms());
++#endif
+ uint raw_idx = Compile::AliasIdxRaw;
+ unlock->init_req( TypeFunc::Control, control() );
+ unlock->init_req( TypeFunc::Memory , memory(raw_idx) );
+--- ./hotspot/src/share/vm/opto/graphKit.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/graphKit.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -516,21 +516,24 @@
+ // adapted the `do_put_xxx' and `do_get_xxx' procedures for the case
+ // of volatile fields.
+ Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
+- MemNode::MemOrd mo, bool require_atomic_access = false) {
++ MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
++ bool require_atomic_access = false) {
+ // This version computes alias_index from bottom_type
+ return make_load(ctl, adr, t, bt, adr->bottom_type()->is_ptr(),
+- mo, require_atomic_access);
++ mo, control_dependency, require_atomic_access);
+ }
+ Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, const TypePtr* adr_type,
+- MemNode::MemOrd mo, bool require_atomic_access = false) {
++ MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
++ bool require_atomic_access = false) {
+ // This version computes alias_index from an address type
+ assert(adr_type != NULL, "use other make_load factory");
+ return make_load(ctl, adr, t, bt, C->get_alias_index(adr_type),
+- mo, require_atomic_access);
++ mo, control_dependency, require_atomic_access);
+ }
+ // This is the base version which is given an alias index.
+ Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, int adr_idx,
+- MemNode::MemOrd mo, bool require_atomic_access = false);
++ MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
++ bool require_atomic_access = false);
+
+ // Create & transform a StoreNode and store the effect into the
+ // parser's memory state.
+@@ -708,6 +711,15 @@
+ klass, reason_string, must_throw, keep_exact_action);
+ }
+
++ // Bail out to the interpreter and keep exact action (avoid switching to Action_none).
++ void uncommon_trap_exact(Deoptimization::DeoptReason reason,
++ Deoptimization::DeoptAction action,
++ ciKlass* klass = NULL, const char* reason_string = NULL,
++ bool must_throw = false) {
++ uncommon_trap(Deoptimization::make_trap_request(reason, action),
++ klass, reason_string, must_throw, /*keep_exact_action=*/true);
++ }
++
+ // SP when bytecode needs to be reexecuted.
+ virtual int reexecute_sp() { return sp(); }
+
+--- ./hotspot/src/share/vm/opto/lcm.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/lcm.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -30,25 +30,17 @@
+ #include "opto/cfgnode.hpp"
+ #include "opto/machnode.hpp"
+ #include "opto/runtime.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+@@ -437,8 +429,15 @@
+ for (DUIterator_Last i2min, i2 = old_tst->last_outs(i2min); i2 >= i2min; --i2)
+ old_tst->last_out(i2)->set_req(0, nul_chk);
+ // Clean-up any dead code
+- for (uint i3 = 0; i3 < old_tst->req(); i3++)
++ for (uint i3 = 0; i3 < old_tst->req(); i3++) {
++ Node* in = old_tst->in(i3);
+ old_tst->set_req(i3, NULL);
++ if (in->outcnt() == 0) {
++ // Remove dead input node
++ in->disconnect_inputs(NULL, C);
++ block->find_remove(in);
++ }
++ }
+
+ latency_from_uses(nul_chk);
+ latency_from_uses(best);
+--- ./hotspot/src/share/vm/opto/library_call.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/library_call.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -31,6 +31,7 @@
+ #include "opto/addnode.hpp"
+ #include "opto/callGenerator.hpp"
+ #include "opto/cfgnode.hpp"
++#include "opto/connode.hpp"
+ #include "opto/idealKit.hpp"
+ #include "opto/mathexactnode.hpp"
+ #include "opto/mulnode.hpp"
+@@ -323,6 +324,8 @@
+ bool inline_updateBytesCRC32();
+ bool inline_updateByteBufferCRC32();
+ bool inline_multiplyToLen();
++
++ bool inline_profileBoolean();
+ };
+
+
+@@ -934,6 +937,9 @@
+ case vmIntrinsics::_updateByteBufferCRC32:
+ return inline_updateByteBufferCRC32();
+
++ case vmIntrinsics::_profileBoolean:
++ return inline_profileBoolean();
++
+ default:
+ // If you get here, it may be that someone has added a new intrinsic
+ // to the list in vmSymbols.hpp without implementing it here.
+@@ -2663,7 +2669,9 @@
+
+ if (!is_store) {
+ MemNode::MemOrd mo = is_volatile ? MemNode::acquire : MemNode::unordered;
+- Node* p = make_load(control(), adr, value_type, type, adr_type, mo, is_volatile);
++ // To be valid, unsafe loads may depend on other conditions than
++ // the one that guards them: pin the Load node
++ Node* p = make_load(control(), adr, value_type, type, adr_type, mo, LoadNode::Pinned, is_volatile);
+ // load value
+ switch (type) {
+ case T_BOOLEAN:
+@@ -6032,7 +6040,7 @@
+ }
+ // Build the load.
+ MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;
+- Node* loadedField = make_load(NULL, adr, type, bt, adr_type, mo, is_vol);
++ Node* loadedField = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol);
+ // If reference is volatile, prevent following memory ops from
+ // floating up past the volatile read. Also prevents commoning
+ // another volatile read.
+@@ -6544,3 +6552,79 @@
+
+ return instof_false; // even if it is NULL
+ }
++
++bool LibraryCallKit::inline_profileBoolean() {
++ Node* counts = argument(1);
++ const TypeAryPtr* ary = NULL;
++ ciArray* aobj = NULL;
++ if (counts->is_Con()
++ && (ary = counts->bottom_type()->isa_aryptr()) != NULL
++ && (aobj = ary->const_oop()->as_array()) != NULL
++ && (aobj->length() == 2)) {
++ // Profile is int[2] where [0] and [1] correspond to false and true value occurrences respectively.
++ jint false_cnt = aobj->element_value(0).as_int();
++ jint true_cnt = aobj->element_value(1).as_int();
++
++ if (C->log() != NULL) {
++ C->log()->elem("observe source='profileBoolean' false='%d' true='%d'",
++ false_cnt, true_cnt);
++ }
++
++ if (false_cnt + true_cnt == 0) {
++ // According to profile, never executed.
++ uncommon_trap_exact(Deoptimization::Reason_intrinsic,
++ Deoptimization::Action_reinterpret);
++ return true;
++ }
++
++ // result is a boolean (0 or 1) and its profile (false_cnt & true_cnt)
++ // is a number of each value occurrences.
++ Node* result = argument(0);
++ if (false_cnt == 0 || true_cnt == 0) {
++ // According to profile, one value has been never seen.
++ int expected_val = (false_cnt == 0) ? 1 : 0;
++
++ Node* cmp = _gvn.transform(new (C) CmpINode(result, intcon(expected_val)));
++ Node* test = _gvn.transform(new (C) BoolNode(cmp, BoolTest::eq));
++
++ IfNode* check = create_and_map_if(control(), test, PROB_ALWAYS, COUNT_UNKNOWN);
++ Node* fast_path = _gvn.transform(new (C) IfTrueNode(check));
++ Node* slow_path = _gvn.transform(new (C) IfFalseNode(check));
++
++ { // Slow path: uncommon trap for never seen value and then reexecute
++ // MethodHandleImpl::profileBoolean() to bump the count, so JIT knows
++ // the value has been seen at least once.
++ PreserveJVMState pjvms(this);
++ PreserveReexecuteState preexecs(this);
++ jvms()->set_should_reexecute(true);
++
++ set_control(slow_path);
++ set_i_o(i_o());
++
++ uncommon_trap_exact(Deoptimization::Reason_intrinsic,
++ Deoptimization::Action_reinterpret);
++ }
++ // The guard for never seen value enables sharpening of the result and
++ // returning a constant. It allows to eliminate branches on the same value
++ // later on.
++ set_control(fast_path);
++ result = intcon(expected_val);
++ }
++ // Stop profiling.
++ // MethodHandleImpl::profileBoolean() has profiling logic in its bytecode.
++ // By replacing method body with profile data (represented as ProfileBooleanNode
++ // on IR level) we effectively disable profiling.
++ // It enables full speed execution once optimized code is generated.
++ Node* profile = _gvn.transform(new (C) ProfileBooleanNode(result, false_cnt, true_cnt));
++ C->record_for_igvn(profile);
++ set_result(profile);
++ return true;
++ } else {
++ // Continue profiling.
++ // Profile data isn't available at the moment. So, execute method's bytecode version.
++ // Usually, when GWT LambdaForms are profiled it means that a stand-alone nmethod
++ // is compiled and counters aren't available since corresponding MethodHandle
++ // isn't a compile-time constant.
++ return false;
++ }
++}
+--- ./hotspot/src/share/vm/opto/locknode.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/locknode.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2012, 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
+@@ -28,25 +28,17 @@
+ #include "opto/node.hpp"
+ #include "opto/opcodes.hpp"
+ #include "opto/subnode.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/opto/loopPredicate.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/loopPredicate.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -438,7 +438,13 @@
+ }
+ }
+ if (all_inputs_invariant) {
+- _invariant.set(n->_idx); // I am a invariant too
++ // If n's control is a predicate that was moved out of the
++ // loop, it was marked invariant but n is only invariant if
++ // it depends only on that test. Otherwise, unless that test
++ // is out of the loop, it's not invariant.
++ if (n->is_CFG() || n->depends_only_on_test() || n->in(0) == NULL || !_phase->is_member(_lpt, n->in(0))) {
++ _invariant.set(n->_idx); // I am a invariant too
++ }
+ }
+ } else { // process next input
+ _stack.set_index(idx + 1);
+--- ./hotspot/src/share/vm/opto/loopTransform.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/loopTransform.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1821,7 +1821,10 @@
+ // Find the pre-loop limit; we will expand it's iterations to
+ // not ever trip low tests.
+ Node *p_f = iffm->in(0);
+- assert(p_f->Opcode() == Op_IfFalse, "");
++ // pre loop may have been optimized out
++ if (p_f->Opcode() != Op_IfFalse) {
++ return;
++ }
+ CountedLoopEndNode *pre_end = p_f->in(0)->as_CountedLoopEnd();
+ assert(pre_end->loopnode()->is_pre_loop(), "");
+ Node *pre_opaq1 = pre_end->limit();
+--- ./hotspot/src/share/vm/opto/loopnode.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/loopnode.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -436,6 +436,19 @@
+ return false; // cyclic loop or this loop trips only once
+ }
+
++ if (phi_incr != NULL) {
++ // check if there is a possiblity of IV overflowing after the first increment
++ if (stride_con > 0) {
++ if (init_t->_hi > max_jint - stride_con) {
++ return false;
++ }
++ } else {
++ if (init_t->_lo < min_jint - stride_con) {
++ return false;
++ }
++ }
++ }
++
+ // =================================================
+ // ---- SUCCESS! Found A Trip-Counted Loop! -----
+ //
+--- ./hotspot/src/share/vm/opto/machnode.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/machnode.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -558,6 +558,29 @@
+ #endif
+ };
+
++// MachMergeNode is similar to a PhiNode in a sense it merges multiple values,
++// however it doesn't have a control input and is more like a MergeMem.
++// It is inserted after the register allocation is done to ensure that nodes use single
++// definition of a multidef lrg in a block.
++class MachMergeNode : public MachIdealNode {
++public:
++ MachMergeNode(Node *n1) {
++ init_class_id(Class_MachMerge);
++ add_req(NULL);
++ add_req(n1);
++ }
++ virtual const RegMask &out_RegMask() const { return in(1)->out_RegMask(); }
++ virtual const RegMask &in_RegMask(uint idx) const { return in(1)->in_RegMask(idx); }
++ virtual const class Type *bottom_type() const { return in(1)->bottom_type(); }
++ virtual uint ideal_reg() const { return bottom_type()->ideal_reg(); }
++ virtual uint oper_input_base() const { return 1; }
++ virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { }
++ virtual uint size(PhaseRegAlloc *ra_) const { return 0; }
++#ifndef PRODUCT
++ virtual const char *Name() const { return "MachMerge"; }
++#endif
++};
++
+ //------------------------------MachBranchNode--------------------------------
+ // Abstract machine branch Node
+ class MachBranchNode : public MachIdealNode {
+--- ./hotspot/src/share/vm/opto/macro.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/macro.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -1890,7 +1890,7 @@
+ // Box is used only in one lock region. Mark this box as eliminated.
+ _igvn.hash_delete(oldbox);
+ oldbox->as_BoxLock()->set_eliminated(); // This changes box's hash value
+- _igvn.hash_insert(oldbox);
++ _igvn.hash_insert(oldbox);
+
+ for (uint i = 0; i < oldbox->outcnt(); i++) {
+ Node* u = oldbox->raw_out(i);
+@@ -1899,6 +1899,9 @@
+ // Check lock's box since box could be referenced by Lock's debug info.
+ if (alock->box_node() == oldbox) {
+ // Mark eliminated all related locks and unlocks.
++#ifdef ASSERT
++ alock->log_lock_optimization(C, "eliminate_lock_set_non_esc4");
++#endif
+ alock->set_non_esc_obj();
+ }
+ }
+@@ -1925,6 +1928,9 @@
+ AbstractLockNode* alock = u->as_AbstractLock();
+ if (alock->box_node() == oldbox && alock->obj_node()->eqv_uncast(obj)) {
+ // Replace Box and mark eliminated all related locks and unlocks.
++#ifdef ASSERT
++ alock->log_lock_optimization(C, "eliminate_lock_set_non_esc5");
++#endif
+ alock->set_non_esc_obj();
+ _igvn.rehash_node_delayed(alock);
+ alock->set_box_node(newbox);
+@@ -1971,26 +1977,38 @@
+ return;
+ } else if (!alock->is_non_esc_obj()) { // Not eliminated or coarsened
+ // Only Lock node has JVMState needed here.
+- if (alock->jvms() != NULL && alock->as_Lock()->is_nested_lock_region()) {
+- // Mark eliminated related nested locks and unlocks.
+- Node* obj = alock->obj_node();
+- BoxLockNode* box_node = alock->box_node()->as_BoxLock();
+- assert(!box_node->is_eliminated(), "should not be marked yet");
+- // Note: BoxLock node is marked eliminated only here
+- // and it is used to indicate that all associated lock
+- // and unlock nodes are marked for elimination.
+- box_node->set_eliminated(); // Box's hash is always NO_HASH here
+- for (uint i = 0; i < box_node->outcnt(); i++) {
+- Node* u = box_node->raw_out(i);
+- if (u->is_AbstractLock()) {
+- alock = u->as_AbstractLock();
+- if (alock->box_node() == box_node) {
+- // Verify that this Box is referenced only by related locks.
+- assert(alock->obj_node()->eqv_uncast(obj), "");
+- // Mark all related locks and unlocks.
+- alock->set_nested();
++ // Not that preceding claim is documented anywhere else.
++ if (alock->jvms() != NULL) {
++ if (alock->as_Lock()->is_nested_lock_region()) {
++ // Mark eliminated related nested locks and unlocks.
++ Node* obj = alock->obj_node();
++ BoxLockNode* box_node = alock->box_node()->as_BoxLock();
++ assert(!box_node->is_eliminated(), "should not be marked yet");
++ // Note: BoxLock node is marked eliminated only here
++ // and it is used to indicate that all associated lock
++ // and unlock nodes are marked for elimination.
++ box_node->set_eliminated(); // Box's hash is always NO_HASH here
++ for (uint i = 0; i < box_node->outcnt(); i++) {
++ Node* u = box_node->raw_out(i);
++ if (u->is_AbstractLock()) {
++ alock = u->as_AbstractLock();
++ if (alock->box_node() == box_node) {
++ // Verify that this Box is referenced only by related locks.
++ assert(alock->obj_node()->eqv_uncast(obj), "");
++ // Mark all related locks and unlocks.
++#ifdef ASSERT
++ alock->log_lock_optimization(C, "eliminate_lock_set_nested");
++#endif
++ alock->set_nested();
++ }
+ }
+ }
++ } else {
++#ifdef ASSERT
++ alock->log_lock_optimization(C, "eliminate_lock_NOT_nested_lock_region");
++ if (C->log() != NULL)
++ alock->as_Lock()->is_nested_lock_region(C); // rerun for debugging output
++#endif
+ }
+ }
+ return;
+@@ -2035,19 +2053,10 @@
+ assert(oldbox->is_eliminated(), "should be done already");
+ }
+ #endif
+- CompileLog* log = C->log();
+- if (log != NULL) {
+- log->head("eliminate_lock lock='%d'",
+- alock->is_Lock());
+- JVMState* p = alock->jvms();
+- while (p != NULL) {
+- log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
+- p = p->caller();
+- }
+- log->tail("eliminate_lock");
+- }
+
+- #ifndef PRODUCT
++ alock->log_lock_optimization(C, "eliminate_lock");
++
++#ifndef PRODUCT
+ if (PrintEliminateLocks) {
+ if (alock->is_Lock()) {
+ tty->print_cr("++++ Eliminated: %d Lock", alock->_idx);
+@@ -2055,7 +2064,7 @@
+ tty->print_cr("++++ Eliminated: %d Unlock", alock->_idx);
+ }
+ }
+- #endif
++#endif
+
+ Node* mem = alock->in(TypeFunc::Memory);
+ Node* ctrl = alock->in(TypeFunc::Control);
+--- ./hotspot/src/share/vm/opto/matcher.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/matcher.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -38,25 +38,17 @@
+ #include "opto/vectornode.hpp"
+ #include "runtime/atomic.hpp"
+ #include "runtime/os.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+@@ -848,7 +840,7 @@
+ MachNode *spillCP = match_tree(new (C) LoadNNode(NULL,mem,fp,atp,TypeInstPtr::BOTTOM,MemNode::unordered));
+ #endif
+ MachNode *spillI = match_tree(new (C) LoadINode(NULL,mem,fp,atp,TypeInt::INT,MemNode::unordered));
+- MachNode *spillL = match_tree(new (C) LoadLNode(NULL,mem,fp,atp,TypeLong::LONG,MemNode::unordered,false));
++ MachNode *spillL = match_tree(new (C) LoadLNode(NULL,mem,fp,atp,TypeLong::LONG,MemNode::unordered, LoadNode::DependsOnlyOnTest,false));
+ MachNode *spillF = match_tree(new (C) LoadFNode(NULL,mem,fp,atp,Type::FLOAT,MemNode::unordered));
+ MachNode *spillD = match_tree(new (C) LoadDNode(NULL,mem,fp,atp,Type::DOUBLE,MemNode::unordered));
+ MachNode *spillP = match_tree(new (C) LoadPNode(NULL,mem,fp,atp,TypeInstPtr::BOTTOM,MemNode::unordered));
+--- ./hotspot/src/share/vm/opto/memnode.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/memnode.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -878,6 +878,9 @@
+ // standard dump does this in Verbose and WizardMode
+ st->print(" #"); _type->dump_on(st);
+ }
++ if (!_depends_only_on_test) {
++ st->print(" (does not depend only on test)");
++ }
+ }
+ #endif
+
+@@ -894,7 +897,7 @@
+
+ //----------------------------LoadNode::make-----------------------------------
+ // Polymorphic factory method:
+-Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypePtr* adr_type, const Type *rt, BasicType bt, MemOrd mo) {
++Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypePtr* adr_type, const Type *rt, BasicType bt, MemOrd mo, ControlDependency control_dependency) {
+ Compile* C = gvn.C;
+
+ // sanity check the alias category against the created node type
+@@ -910,36 +913,40 @@
+ rt->isa_oopptr() || is_immutable_value(adr),
+ "raw memory operations should have control edge");
+ switch (bt) {
+- case T_BOOLEAN: return new (C) LoadUBNode(ctl, mem, adr, adr_type, rt->is_int(), mo);
+- case T_BYTE: return new (C) LoadBNode (ctl, mem, adr, adr_type, rt->is_int(), mo);
+- case T_INT: return new (C) LoadINode (ctl, mem, adr, adr_type, rt->is_int(), mo);
+- case T_CHAR: return new (C) LoadUSNode(ctl, mem, adr, adr_type, rt->is_int(), mo);
+- case T_SHORT: return new (C) LoadSNode (ctl, mem, adr, adr_type, rt->is_int(), mo);
+- case T_LONG: return new (C) LoadLNode (ctl, mem, adr, adr_type, rt->is_long(), mo);
+- case T_FLOAT: return new (C) LoadFNode (ctl, mem, adr, adr_type, rt, mo);
+- case T_DOUBLE: return new (C) LoadDNode (ctl, mem, adr, adr_type, rt, mo);
+- case T_ADDRESS: return new (C) LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr(), mo);
++ case T_BOOLEAN: return new (C) LoadUBNode(ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
++ case T_BYTE: return new (C) LoadBNode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
++ case T_INT: return new (C) LoadINode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
++ case T_CHAR: return new (C) LoadUSNode(ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
++ case T_SHORT: return new (C) LoadSNode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
++ case T_LONG: return new (C) LoadLNode (ctl, mem, adr, adr_type, rt->is_long(), mo, control_dependency);
++ case T_FLOAT: return new (C) LoadFNode (ctl, mem, adr, adr_type, rt, mo, control_dependency);
++ case T_DOUBLE: return new (C) LoadDNode (ctl, mem, adr, adr_type, rt, mo, control_dependency);
++ case T_ADDRESS: return new (C) LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr(), mo, control_dependency);
+ case T_OBJECT:
+ #ifdef _LP64
+ if (adr->bottom_type()->is_ptr_to_narrowoop()) {
+- Node* load = gvn.transform(new (C) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop(), mo));
++ Node* load = gvn.transform(new (C) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop(), mo, control_dependency));
+ return new (C) DecodeNNode(load, load->bottom_type()->make_ptr());
+ } else
+ #endif
+ {
+ assert(!adr->bottom_type()->is_ptr_to_narrowoop() && !adr->bottom_type()->is_ptr_to_narrowklass(), "should have got back a narrow oop");
+- return new (C) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr(), mo);
++ return new (C) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr(), mo, control_dependency);
+ }
+ }
+ ShouldNotReachHere();
+ return (LoadNode*)NULL;
+ }
+
+-LoadLNode* LoadLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo) {
++LoadLNode* LoadLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo, ControlDependency control_dependency) {
+ bool require_atomic = true;
+- return new (C) LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), mo, require_atomic);
++ return new (C) LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), mo, control_dependency, require_atomic);
+ }
+
++LoadDNode* LoadDNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo, ControlDependency control_dependency) {
++ bool require_atomic = true;
++ return new (C) LoadDNode(ctl, mem, adr, adr_type, rt, mo, control_dependency, require_atomic);
++}
+
+
+
+@@ -2398,6 +2405,11 @@
+ return new (C) StoreLNode(ctl, mem, adr, adr_type, val, mo, require_atomic);
+ }
+
++StoreDNode* StoreDNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, MemOrd mo) {
++ bool require_atomic = true;
++ return new (C) StoreDNode(ctl, mem, adr, adr_type, val, mo, require_atomic);
++}
++
+
+ //--------------------------bottom_type----------------------------------------
+ const Type *StoreNode::bottom_type() const {
+--- ./hotspot/src/share/vm/opto/memnode.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/memnode.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -138,7 +138,33 @@
+ //------------------------------LoadNode---------------------------------------
+ // Load value; requires Memory and Address
+ class LoadNode : public MemNode {
++public:
++ // Some loads (from unsafe) should be pinned: they don't depend only
++ // on the dominating test. The boolean field _depends_only_on_test
++ // below records whether that node depends only on the dominating
++ // test.
++ // Methods used to build LoadNodes pass an argument of type enum
++ // ControlDependency instead of a boolean because those methods
++ // typically have multiple boolean parameters with default values:
++ // passing the wrong boolean to one of these parameters by mistake
++ // goes easily unnoticed. Using an enum, the compiler can check that
++ // the type of a value and the type of the parameter match.
++ enum ControlDependency {
++ Pinned,
++ DependsOnlyOnTest
++ };
+ private:
++ // LoadNode::hash() doesn't take the _depends_only_on_test field
++ // into account: If the graph already has a non-pinned LoadNode and
++ // we add a pinned LoadNode with the same inputs, it's safe for GVN
++ // to replace the pinned LoadNode with the non-pinned LoadNode,
++ // otherwise it wouldn't be safe to have a non pinned LoadNode with
++ // those inputs in the first place. If the graph already has a
++ // pinned LoadNode and we add a non pinned LoadNode with the same
++ // inputs, it's safe (but suboptimal) for GVN to replace the
++ // non-pinned LoadNode by the pinned LoadNode.
++ bool _depends_only_on_test;
++
+ // On platforms with weak memory ordering (e.g., PPC, Ia64) we distinguish
+ // loads that can be reordered, and such requiring acquire semantics to
+ // adhere to the Java specification. The required behaviour is stored in
+@@ -153,8 +179,8 @@
+ const Type* const _type; // What kind of value is loaded?
+ public:
+
+- LoadNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *rt, MemOrd mo)
+- : MemNode(c,mem,adr,at), _type(rt), _mo(mo) {
++ LoadNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *rt, MemOrd mo, ControlDependency control_dependency)
++ : MemNode(c,mem,adr,at), _type(rt), _mo(mo), _depends_only_on_test(control_dependency == DependsOnlyOnTest) {
+ init_class_id(Class_Load);
+ }
+ inline bool is_unordered() const { return !is_acquire(); }
+@@ -165,7 +191,8 @@
+
+ // Polymorphic factory method:
+ static Node* make(PhaseGVN& gvn, Node *c, Node *mem, Node *adr,
+- const TypePtr* at, const Type *rt, BasicType bt, MemOrd mo);
++ const TypePtr* at, const Type *rt, BasicType bt,
++ MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest);
+
+ virtual uint hash() const; // Check the type
+
+@@ -233,16 +260,15 @@
+ // which produce results (new raw memory state) inside of loops preventing all
+ // manner of other optimizations). Basically, it's ugly but so is the alternative.
+ // See comment in macro.cpp, around line 125 expand_allocate_common().
+- virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
+-
++ virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM && _depends_only_on_test; }
+ };
+
+ //------------------------------LoadBNode--------------------------------------
+ // Load a byte (8bits signed) from memory
+ class LoadBNode : public LoadNode {
+ public:
+- LoadBNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo)
+- : LoadNode(c, mem, adr, at, ti, mo) {}
++ LoadBNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegI; }
+ virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
+@@ -255,8 +281,8 @@
+ // Load a unsigned byte (8bits unsigned) from memory
+ class LoadUBNode : public LoadNode {
+ public:
+- LoadUBNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt* ti, MemOrd mo)
+- : LoadNode(c, mem, adr, at, ti, mo) {}
++ LoadUBNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt* ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegI; }
+ virtual Node* Ideal(PhaseGVN *phase, bool can_reshape);
+@@ -269,8 +295,8 @@
+ // Load an unsigned short/char (16bits unsigned) from memory
+ class LoadUSNode : public LoadNode {
+ public:
+- LoadUSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo)
+- : LoadNode(c, mem, adr, at, ti, mo) {}
++ LoadUSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegI; }
+ virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
+@@ -283,8 +309,8 @@
+ // Load a short (16bits signed) from memory
+ class LoadSNode : public LoadNode {
+ public:
+- LoadSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo)
+- : LoadNode(c, mem, adr, at, ti, mo) {}
++ LoadSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegI; }
+ virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
+@@ -297,8 +323,8 @@
+ // Load an integer from memory
+ class LoadINode : public LoadNode {
+ public:
+- LoadINode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo)
+- : LoadNode(c, mem, adr, at, ti, mo) {}
++ LoadINode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegI; }
+ virtual int store_Opcode() const { return Op_StoreI; }
+@@ -330,15 +356,15 @@
+
+ public:
+ LoadLNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeLong *tl,
+- MemOrd mo, bool require_atomic_access = false)
+- : LoadNode(c, mem, adr, at, tl, mo), _require_atomic_access(require_atomic_access) {}
++ MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest, bool require_atomic_access = false)
++ : LoadNode(c, mem, adr, at, tl, mo, control_dependency), _require_atomic_access(require_atomic_access) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegL; }
+ virtual int store_Opcode() const { return Op_StoreL; }
+ virtual BasicType memory_type() const { return T_LONG; }
+- bool require_atomic_access() { return _require_atomic_access; }
++ bool require_atomic_access() const { return _require_atomic_access; }
+ static LoadLNode* make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type,
+- const Type* rt, MemOrd mo);
++ const Type* rt, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest);
+ #ifndef PRODUCT
+ virtual void dump_spec(outputStream *st) const {
+ LoadNode::dump_spec(st);
+@@ -351,8 +377,8 @@
+ // Load a long from unaligned memory
+ class LoadL_unalignedNode : public LoadLNode {
+ public:
+- LoadL_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, MemOrd mo)
+- : LoadLNode(c, mem, adr, at, TypeLong::LONG, mo) {}
++ LoadL_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadLNode(c, mem, adr, at, TypeLong::LONG, mo, control_dependency) {}
+ virtual int Opcode() const;
+ };
+
+@@ -360,8 +386,8 @@
+ // Load a float (64 bits) from memory
+ class LoadFNode : public LoadNode {
+ public:
+- LoadFNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t, MemOrd mo)
+- : LoadNode(c, mem, adr, at, t, mo) {}
++ LoadFNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, t, mo, control_dependency) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegF; }
+ virtual int store_Opcode() const { return Op_StoreF; }
+@@ -371,21 +397,39 @@
+ //------------------------------LoadDNode--------------------------------------
+ // Load a double (64 bits) from memory
+ class LoadDNode : public LoadNode {
++ virtual uint hash() const { return LoadNode::hash() + _require_atomic_access; }
++ virtual uint cmp( const Node &n ) const {
++ return _require_atomic_access == ((LoadDNode&)n)._require_atomic_access
++ && LoadNode::cmp(n);
++ }
++ virtual uint size_of() const { return sizeof(*this); }
++ const bool _require_atomic_access; // is piecewise load forbidden?
++
+ public:
+- LoadDNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t, MemOrd mo)
+- : LoadNode(c, mem, adr, at, t, mo) {}
++ LoadDNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t,
++ MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest, bool require_atomic_access = false)
++ : LoadNode(c, mem, adr, at, t, mo, control_dependency), _require_atomic_access(require_atomic_access) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegD; }
+ virtual int store_Opcode() const { return Op_StoreD; }
+ virtual BasicType memory_type() const { return T_DOUBLE; }
++ bool require_atomic_access() const { return _require_atomic_access; }
++ static LoadDNode* make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type,
++ const Type* rt, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest);
++#ifndef PRODUCT
++ virtual void dump_spec(outputStream *st) const {
++ LoadNode::dump_spec(st);
++ if (_require_atomic_access) st->print(" Atomic!");
++ }
++#endif
+ };
+
+ //------------------------------LoadD_unalignedNode----------------------------
+ // Load a double from unaligned memory
+ class LoadD_unalignedNode : public LoadDNode {
+ public:
+- LoadD_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, MemOrd mo)
+- : LoadDNode(c, mem, adr, at, Type::DOUBLE, mo) {}
++ LoadD_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadDNode(c, mem, adr, at, Type::DOUBLE, mo, control_dependency) {}
+ virtual int Opcode() const;
+ };
+
+@@ -393,8 +437,8 @@
+ // Load a pointer from memory (either object or array)
+ class LoadPNode : public LoadNode {
+ public:
+- LoadPNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypePtr* t, MemOrd mo)
+- : LoadNode(c, mem, adr, at, t, mo) {}
++ LoadPNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypePtr* t, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, t, mo, control_dependency) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegP; }
+ virtual int store_Opcode() const { return Op_StoreP; }
+@@ -406,8 +450,8 @@
+ // Load a narrow oop from memory (either object or array)
+ class LoadNNode : public LoadNode {
+ public:
+- LoadNNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const Type* t, MemOrd mo)
+- : LoadNode(c, mem, adr, at, t, mo) {}
++ LoadNNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const Type* t, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, t, mo, control_dependency) {}
+ virtual int Opcode() const;
+ virtual uint ideal_reg() const { return Op_RegN; }
+ virtual int store_Opcode() const { return Op_StoreN; }
+@@ -582,7 +626,7 @@
+ : StoreNode(c, mem, adr, at, val, mo), _require_atomic_access(require_atomic_access) {}
+ virtual int Opcode() const;
+ virtual BasicType memory_type() const { return T_LONG; }
+- bool require_atomic_access() { return _require_atomic_access; }
++ bool require_atomic_access() const { return _require_atomic_access; }
+ static StoreLNode* make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, MemOrd mo);
+ #ifndef PRODUCT
+ virtual void dump_spec(outputStream *st) const {
+@@ -605,11 +649,28 @@
+ //------------------------------StoreDNode-------------------------------------
+ // Store double to memory
+ class StoreDNode : public StoreNode {
++ virtual uint hash() const { return StoreNode::hash() + _require_atomic_access; }
++ virtual uint cmp( const Node &n ) const {
++ return _require_atomic_access == ((StoreDNode&)n)._require_atomic_access
++ && StoreNode::cmp(n);
++ }
++ virtual uint size_of() const { return sizeof(*this); }
++ const bool _require_atomic_access; // is piecewise store forbidden?
+ public:
+- StoreDNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, MemOrd mo)
+- : StoreNode(c, mem, adr, at, val, mo) {}
++ StoreDNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val,
++ MemOrd mo, bool require_atomic_access = false)
++ : StoreNode(c, mem, adr, at, val, mo), _require_atomic_access(require_atomic_access) {}
+ virtual int Opcode() const;
+ virtual BasicType memory_type() const { return T_DOUBLE; }
++ bool require_atomic_access() const { return _require_atomic_access; }
++ static StoreDNode* make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, MemOrd mo);
++#ifndef PRODUCT
++ virtual void dump_spec(outputStream *st) const {
++ StoreNode::dump_spec(st);
++ if (_require_atomic_access) st->print(" Atomic!");
++ }
++#endif
++
+ };
+
+ //------------------------------StorePNode-------------------------------------
+--- ./hotspot/src/share/vm/opto/node.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/node.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -98,6 +98,7 @@
+ class MachSafePointNode;
+ class MachSpillCopyNode;
+ class MachTempNode;
++class MachMergeNode;
+ class Matcher;
+ class MemBarNode;
+ class MemBarStoreStoreNode;
+@@ -591,6 +592,7 @@
+ DEFINE_CLASS_ID(MachTemp, Mach, 3)
+ DEFINE_CLASS_ID(MachConstantBase, Mach, 4)
+ DEFINE_CLASS_ID(MachConstant, Mach, 5)
++ DEFINE_CLASS_ID(MachMerge, Mach, 6)
+
+ DEFINE_CLASS_ID(Type, Node, 2)
+ DEFINE_CLASS_ID(Phi, Type, 0)
+@@ -761,6 +763,7 @@
+ DEFINE_CLASS_QUERY(MachSafePoint)
+ DEFINE_CLASS_QUERY(MachSpillCopy)
+ DEFINE_CLASS_QUERY(MachTemp)
++ DEFINE_CLASS_QUERY(MachMerge)
+ DEFINE_CLASS_QUERY(Mem)
+ DEFINE_CLASS_QUERY(MemBar)
+ DEFINE_CLASS_QUERY(MemBarStoreStore)
+--- ./hotspot/src/share/vm/opto/output.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/output.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -2473,7 +2473,7 @@
+ if( iop == Op_Con ) continue; // Do not schedule Top
+ if( iop == Op_Node && // Do not schedule PhiNodes, ProjNodes
+ mach->pipeline() == MachNode::pipeline_class() &&
+- !n->is_SpillCopy() ) // Breakpoints, Prolog, etc
++ !n->is_SpillCopy() && !n->is_MachMerge() ) // Breakpoints, Prolog, etc
+ continue;
+ break; // Funny loop structure to be sure...
+ }
+--- ./hotspot/src/share/vm/opto/output.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/output.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -27,25 +27,17 @@
+
+ #include "opto/block.hpp"
+ #include "opto/node.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/opto/parse.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/parse.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -549,8 +549,8 @@
+ void do_jsr();
+ void do_ret();
+
+- float dynamic_branch_prediction(float &cnt);
+- float branch_prediction(float &cnt, BoolTest::mask btest, int target_bci);
++ float dynamic_branch_prediction(float &cnt, BoolTest::mask btest, Node* test);
++ float branch_prediction(float &cnt, BoolTest::mask btest, int target_bci, Node* test);
+ bool seems_never_taken(float prob) const;
+ bool path_is_suitable_for_uncommon_trap(float prob) const;
+ bool seems_stable_comparison() const;
+--- ./hotspot/src/share/vm/opto/parse2.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/parse2.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -761,35 +761,64 @@
+ merge_common(target, pnum);
+ }
+
++static bool has_injected_profile(BoolTest::mask btest, Node* test, int& taken, int& not_taken) {
++ if (btest != BoolTest::eq && btest != BoolTest::ne) {
++ // Only ::eq and ::ne are supported for profile injection.
++ return false;
++ }
++ if (test->is_Cmp() &&
++ test->in(1)->Opcode() == Op_ProfileBoolean) {
++ ProfileBooleanNode* profile = (ProfileBooleanNode*)test->in(1);
++ int false_cnt = profile->false_count();
++ int true_cnt = profile->true_count();
++
++ // Counts matching depends on the actual test operation (::eq or ::ne).
++ // No need to scale the counts because profile injection was designed
++ // to feed exact counts into VM.
++ taken = (btest == BoolTest::eq) ? false_cnt : true_cnt;
++ not_taken = (btest == BoolTest::eq) ? true_cnt : false_cnt;
++
++ profile->consume();
++ return true;
++ }
++ return false;
++}
+ //--------------------------dynamic_branch_prediction--------------------------
+ // Try to gather dynamic branch prediction behavior. Return a probability
+ // of the branch being taken and set the "cnt" field. Returns a -1.0
+ // if we need to use static prediction for some reason.
+-float Parse::dynamic_branch_prediction(float &cnt) {
++float Parse::dynamic_branch_prediction(float &cnt, BoolTest::mask btest, Node* test) {
+ ResourceMark rm;
+
+ cnt = COUNT_UNKNOWN;
+
+- // Use MethodData information if it is available
+- // FIXME: free the ProfileData structure
+- ciMethodData* methodData = method()->method_data();
+- if (!methodData->is_mature()) return PROB_UNKNOWN;
+- ciProfileData* data = methodData->bci_to_data(bci());
+- if (!data->is_JumpData()) return PROB_UNKNOWN;
++ int taken = 0;
++ int not_taken = 0;
+
+- // get taken and not taken values
+- int taken = data->as_JumpData()->taken();
+- int not_taken = 0;
+- if (data->is_BranchData()) {
+- not_taken = data->as_BranchData()->not_taken();
++ bool use_mdo = !has_injected_profile(btest, test, taken, not_taken);
++
++ if (use_mdo) {
++ // Use MethodData information if it is available
++ // FIXME: free the ProfileData structure
++ ciMethodData* methodData = method()->method_data();
++ if (!methodData->is_mature()) return PROB_UNKNOWN;
++ ciProfileData* data = methodData->bci_to_data(bci());
++ if (!data->is_JumpData()) return PROB_UNKNOWN;
++
++ // get taken and not taken values
++ taken = data->as_JumpData()->taken();
++ not_taken = 0;
++ if (data->is_BranchData()) {
++ not_taken = data->as_BranchData()->not_taken();
++ }
++
++ // scale the counts to be commensurate with invocation counts:
++ taken = method()->scale_count(taken);
++ not_taken = method()->scale_count(not_taken);
+ }
+
+- // scale the counts to be commensurate with invocation counts:
+- taken = method()->scale_count(taken);
+- not_taken = method()->scale_count(not_taken);
+-
+ // Give up if too few (or too many, in which case the sum will overflow) counts to be meaningful.
+- // We also check that individual counters are positive first, overwise the sum can become positive.
++ // We also check that individual counters are positive first, otherwise the sum can become positive.
+ if (taken < 0 || not_taken < 0 || taken + not_taken < 40) {
+ if (C->log() != NULL) {
+ C->log()->elem("branch target_bci='%d' taken='%d' not_taken='%d'", iter().get_dest(), taken, not_taken);
+@@ -839,8 +868,9 @@
+ //-----------------------------branch_prediction-------------------------------
+ float Parse::branch_prediction(float& cnt,
+ BoolTest::mask btest,
+- int target_bci) {
+- float prob = dynamic_branch_prediction(cnt);
++ int target_bci,
++ Node* test) {
++ float prob = dynamic_branch_prediction(cnt, btest, test);
+ // If prob is unknown, switch to static prediction
+ if (prob != PROB_UNKNOWN) return prob;
+
+@@ -930,7 +960,7 @@
+ Block* next_block = successor_for_bci(iter().next_bci());
+
+ float cnt;
+- float prob = branch_prediction(cnt, btest, target_bci);
++ float prob = branch_prediction(cnt, btest, target_bci, c);
+ if (prob == PROB_UNKNOWN) {
+ // (An earlier version of do_ifnull omitted this trap for OSR methods.)
+ #ifndef PRODUCT
+@@ -1011,7 +1041,7 @@
+ Block* next_block = successor_for_bci(iter().next_bci());
+
+ float cnt;
+- float prob = branch_prediction(cnt, btest, target_bci);
++ float prob = branch_prediction(cnt, btest, target_bci, c);
+ float untaken_prob = 1.0 - prob;
+
+ if (prob == PROB_UNKNOWN) {
+--- ./hotspot/src/share/vm/opto/parse3.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/parse3.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -233,7 +233,7 @@
+ // Build the load.
+ //
+ MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;
+- Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, is_vol);
++ Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol);
+
+ // Adjust Java stack
+ if (type2size[bt] == 1)
+--- ./hotspot/src/share/vm/opto/phase.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/phase.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -74,6 +74,7 @@
+ elapsedTimer Phase::_t_computeLive;
+ elapsedTimer Phase::_t_regAllocSplit;
+ elapsedTimer Phase::_t_postAllocCopyRemoval;
++elapsedTimer Phase::_t_mergeMultidefs;
+ elapsedTimer Phase::_t_fixupSpills;
+
+ // Subtimers for _t_output
+@@ -136,11 +137,12 @@
+ tty->print_cr (" computeLive : %3.3f sec", Phase::_t_computeLive.seconds());
+ tty->print_cr (" regAllocSplit : %3.3f sec", Phase::_t_regAllocSplit.seconds());
+ tty->print_cr (" postAllocCopyRemoval: %3.3f sec", Phase::_t_postAllocCopyRemoval.seconds());
++ tty->print_cr (" mergeMultidefs: %3.3f sec", Phase::_t_mergeMultidefs.seconds());
+ tty->print_cr (" fixupSpills : %3.3f sec", Phase::_t_fixupSpills.seconds());
+ double regalloc_subtotal = Phase::_t_ctorChaitin.seconds() +
+ Phase::_t_buildIFGphysical.seconds() + Phase::_t_computeLive.seconds() +
+ Phase::_t_regAllocSplit.seconds() + Phase::_t_fixupSpills.seconds() +
+- Phase::_t_postAllocCopyRemoval.seconds();
++ Phase::_t_postAllocCopyRemoval.seconds() + Phase::_t_mergeMultidefs.seconds();
+ double percent_of_regalloc = ((regalloc_subtotal == 0.0) ? 0.0 : (regalloc_subtotal / Phase::_t_registerAllocation.seconds() * 100.0));
+ tty->print_cr (" subtotal : %3.3f sec, %3.2f %%", regalloc_subtotal, percent_of_regalloc);
+ }
+--- ./hotspot/src/share/vm/opto/phase.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/phase.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -109,6 +109,7 @@
+ static elapsedTimer _t_computeLive;
+ static elapsedTimer _t_regAllocSplit;
+ static elapsedTimer _t_postAllocCopyRemoval;
++ static elapsedTimer _t_mergeMultidefs;
+ static elapsedTimer _t_fixupSpills;
+
+ // Subtimers for _t_output
+--- ./hotspot/src/share/vm/opto/phaseX.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/phaseX.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1521,11 +1521,12 @@
+ set_type(n, t);
+ for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
+ Node* m = n->fast_out(i); // Get user
+- if( m->is_Region() ) { // New path to Region? Must recheck Phis too
++ if (m->is_Region()) { // New path to Region? Must recheck Phis too
+ for (DUIterator_Fast i2max, i2 = m->fast_outs(i2max); i2 < i2max; i2++) {
+ Node* p = m->fast_out(i2); // Propagate changes to uses
+- if( p->bottom_type() != type(p) ) // If not already bottomed out
++ if (p->bottom_type() != type(p)) { // If not already bottomed out
+ worklist.push(p); // Propagate change to user
++ }
+ }
+ }
+ // If we changed the receiver type to a call, we need to revisit
+@@ -1535,12 +1536,31 @@
+ if (m->is_Call()) {
+ for (DUIterator_Fast i2max, i2 = m->fast_outs(i2max); i2 < i2max; i2++) {
+ Node* p = m->fast_out(i2); // Propagate changes to uses
+- if (p->is_Proj() && p->as_Proj()->_con == TypeFunc::Control && p->outcnt() == 1)
++ if (p->is_Proj() && p->as_Proj()->_con == TypeFunc::Control && p->outcnt() == 1) {
+ worklist.push(p->unique_out());
++ }
+ }
+ }
+- if( m->bottom_type() != type(m) ) // If not already bottomed out
++ if (m->bottom_type() != type(m)) { // If not already bottomed out
+ worklist.push(m); // Propagate change to user
++ }
++
++ // CmpU nodes can get their type information from two nodes up in the
++ // graph (instead of from the nodes immediately above). Make sure they
++ // are added to the worklist if nodes they depend on are updated, since
++ // they could be missed and get wrong types otherwise.
++ uint m_op = m->Opcode();
++ if (m_op == Op_AddI || m_op == Op_SubI) {
++ for (DUIterator_Fast i2max, i2 = m->fast_outs(i2max); i2 < i2max; i2++) {
++ Node* p = m->fast_out(i2); // Propagate changes to uses
++ if (p->Opcode() == Op_CmpU) {
++ // Got a CmpU which might need the new type information from node n.
++ if(p->bottom_type() != type(p)) { // If not already bottomed out
++ worklist.push(p); // Propagate change to user
++ }
++ }
++ }
++ }
+ }
+ }
+ }
+--- ./hotspot/src/share/vm/opto/postaloc.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/postaloc.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -263,20 +263,6 @@
+ // intermediate copies might be illegal, i.e., value is stored down to stack
+ // then reloaded BUT survives in a register the whole way.
+ Node *val = skip_copies(n->in(k));
+-
+- if (val == x && nk_idx != 0 &&
+- regnd[nk_reg] != NULL && regnd[nk_reg] != x &&
+- _lrg_map.live_range_id(x) == _lrg_map.live_range_id(regnd[nk_reg])) {
+- // When rematerialzing nodes and stretching lifetimes, the
+- // allocator will reuse the original def for multidef LRG instead
+- // of the current reaching def because it can't know it's safe to
+- // do so. After allocation completes if they are in the same LRG
+- // then it should use the current reaching def instead.
+- n->set_req(k, regnd[nk_reg]);
+- blk_adjust += yank_if_dead(val, current_block, &value, &regnd);
+- val = skip_copies(n->in(k));
+- }
+-
+ if (val == x) return blk_adjust; // No progress?
+
+ int n_regs = RegMask::num_registers(val->ideal_reg());
+@@ -382,6 +368,95 @@
+ return false;
+ }
+
++// The algorithms works as follows:
++// We traverse the block top to bottom. possibly_merge_multidef() is invoked for every input edge k
++// of the instruction n. We check to see if the input is a multidef lrg. If it is, we record the fact that we've
++// seen a definition (coming as an input) and add that fact to the reg2defuse array. The array maps registers to their
++// current reaching definitions (we track only multidefs though). With each definition we also associate the first
++// instruction we saw use it. If we encounter the situation when we observe an def (an input) that is a part of the
++// same lrg but is different from the previous seen def we merge the two with a MachMerge node and substitute
++// all the uses that we've seen so far to use the merge. After that we keep replacing the new defs in the same lrg
++// as they get encountered with the merge node and keep adding these defs to the merge inputs.
++void PhaseChaitin::merge_multidefs() {
++ NOT_PRODUCT( Compile::TracePhase t3("mergeMultidefs", &_t_mergeMultidefs, TimeCompiler); )
++ ResourceMark rm;
++ // Keep track of the defs seen in registers and collect their uses in the block.
++ RegToDefUseMap reg2defuse(_max_reg, _max_reg, RegDefUse());
++ for (uint i = 0; i < _cfg.number_of_blocks(); i++) {
++ Block* block = _cfg.get_block(i);
++ for (uint j = 1; j < block->number_of_nodes(); j++) {
++ Node* n = block->get_node(j);
++ if (n->is_Phi()) continue;
++ for (uint k = 1; k < n->req(); k++) {
++ j += possibly_merge_multidef(n, k, block, reg2defuse);
++ }
++ // Null out the value produced by the instruction itself, since we're only interested in defs
++ // implicitly defined by the uses. We are actually interested in tracking only redefinitions
++ // of the multidef lrgs in the same register. For that matter it's enough to track changes in
++ // the base register only and ignore other effects of multi-register lrgs and fat projections.
++ // It is also ok to ignore defs coming from singledefs. After an implicit overwrite by one of
++ // those our register is guaranteed to be used by another lrg and we won't attempt to merge it.
++ uint lrg = _lrg_map.live_range_id(n);
++ if (lrg > 0 && lrgs(lrg).is_multidef()) {
++ OptoReg::Name reg = lrgs(lrg).reg();
++ reg2defuse.at(reg).clear();
++ }
++ }
++ // Clear reg->def->use tracking for the next block
++ for (int j = 0; j < reg2defuse.length(); j++) {
++ reg2defuse.at(j).clear();
++ }
++ }
++}
++
++int PhaseChaitin::possibly_merge_multidef(Node *n, uint k, Block *block, RegToDefUseMap& reg2defuse) {
++ int blk_adjust = 0;
++
++ uint lrg = _lrg_map.live_range_id(n->in(k));
++ if (lrg > 0 && lrgs(lrg).is_multidef()) {
++ OptoReg::Name reg = lrgs(lrg).reg();
++
++ Node* def = reg2defuse.at(reg).def();
++ if (def != NULL && lrg == _lrg_map.live_range_id(def) && def != n->in(k)) {
++ // Same lrg but different node, we have to merge.
++ MachMergeNode* merge;
++ if (def->is_MachMerge()) { // is it already a merge?
++ merge = def->as_MachMerge();
++ } else {
++ merge = new (C) MachMergeNode(def);
++
++ // Insert the merge node into the block before the first use.
++ uint use_index = block->find_node(reg2defuse.at(reg).first_use());
++ block->insert_node(merge, use_index++);
++ _cfg.map_node_to_block(merge, block);
++
++ // Let the allocator know about the new node, use the same lrg
++ _lrg_map.extend(merge->_idx, lrg);
++ blk_adjust++;
++
++ // Fixup all the uses (there is at least one) that happened between the first
++ // use and before the current one.
++ for (; use_index < block->number_of_nodes(); use_index++) {
++ Node* use = block->get_node(use_index);
++ if (use == n) {
++ break;
++ }
++ use->replace_edge(def, merge);
++ }
++ }
++ if (merge->find_edge(n->in(k)) == -1) {
++ merge->add_req(n->in(k));
++ }
++ n->set_req(k, merge);
++ }
++
++ // update the uses
++ reg2defuse.at(reg).update(n->in(k), n);
++ }
++
++ return blk_adjust;
++}
++
+
+ //------------------------------post_allocate_copy_removal---------------------
+ // Post-Allocation peephole copy removal. We do this in 1 pass over the
+--- ./hotspot/src/share/vm/opto/regmask.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/regmask.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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,25 +25,17 @@
+ #include "precompiled.hpp"
+ #include "opto/compile.hpp"
+ #include "opto/regmask.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/opto/regmask.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/regmask.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -28,25 +28,17 @@
+ #include "code/vmreg.hpp"
+ #include "libadt/port.hpp"
+ #include "opto/optoreg.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined ADGLOBALS_MD_HPP
++# include ADGLOBALS_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/adGlobals_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/adGlobals_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/adGlobals_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/adGlobals_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/adGlobals_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/adGlobals_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/adGlobals_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/opto/runtime.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/runtime.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -68,25 +68,17 @@
+ #include "runtime/vframe_hp.hpp"
+ #include "utilities/copy.hpp"
+ #include "utilities/preserveException.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+
+--- ./hotspot/src/share/vm/opto/stringopts.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/stringopts.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1507,10 +1507,12 @@
+ }
+ case StringConcat::StringMode: {
+ const Type* type = kit.gvn().type(arg);
++ Node* count = NULL;
+ if (type == TypePtr::NULL_PTR) {
+ // replace the argument with the null checked version
+ arg = null_string;
+ sc->set_argument(argi, arg);
++ count = kit.load_String_length(kit.control(), arg);
+ } else if (!type->higher_equal(TypeInstPtr::NOTNULL)) {
+ // s = s != null ? s : "null";
+ // length = length + (s.count - s.offset);
+@@ -1533,10 +1535,13 @@
+ // replace the argument with the null checked version
+ arg = phi;
+ sc->set_argument(argi, arg);
++ count = kit.load_String_length(kit.control(), arg);
++ } else {
++ // A corresponding nullcheck will be connected during IGVN MemNode::Ideal_common_DU_postCCP
++ // kit.control might be a different test, that can be hoisted above the actual nullcheck
++ // in case, that the control input is not null, Ideal_common_DU_postCCP will not look for a nullcheck.
++ count = kit.load_String_length(NULL, arg);
+ }
+-
+- Node* count = kit.load_String_length(kit.control(), arg);
+-
+ length = __ AddI(length, count);
+ string_sizes->init_req(argi, NULL);
+ break;
+--- ./hotspot/src/share/vm/opto/superword.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/superword.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -232,6 +232,13 @@
+ // if unaligned memory access is not allowed because number of
+ // iterations in pre-loop will be not enough to align it.
+ create_pack = false;
++ } else {
++ SWPointer p2(best_align_to_mem_ref, this);
++ if (align_to_ref_p.invar() != p2.invar()) {
++ // Do not vectorize memory accesses with different invariants
++ // if unaligned memory accesses are not allowed.
++ create_pack = false;
++ }
+ }
+ }
+ } else {
+@@ -445,29 +452,57 @@
+ int preloop_stride = pre_end->stride_con();
+
+ int span = preloop_stride * p.scale_in_bytes();
+-
+- // Stride one accesses are alignable.
+- if (ABS(span) == p.memory_size())
++ int mem_size = p.memory_size();
++ int offset = p.offset_in_bytes();
++ // Stride one accesses are alignable if offset is aligned to memory operation size.
++ // Offset can be unaligned when UseUnalignedAccesses is used.
++ if (ABS(span) == mem_size && (ABS(offset) % mem_size) == 0) {
+ return true;
+-
+- // If initial offset from start of object is computable,
+- // compute alignment within the vector.
++ }
++ // If the initial offset from start of the object is computable,
++ // check if the pre-loop can align the final offset accordingly.
++ //
++ // In other words: Can we find an i such that the offset
++ // after i pre-loop iterations is aligned to vw?
++ // (init_offset + pre_loop) % vw == 0 (1)
++ // where
++ // pre_loop = i * span
++ // is the number of bytes added to the offset by i pre-loop iterations.
++ //
++ // For this to hold we need pre_loop to increase init_offset by
++ // pre_loop = vw - (init_offset % vw)
++ //
++ // This is only possible if pre_loop is divisible by span because each
++ // pre-loop iteration increases the initial offset by 'span' bytes:
++ // (vw - (init_offset % vw)) % span == 0
++ //
+ int vw = vector_width_in_bytes(p.mem());
+ assert(vw > 1, "sanity");
+- if (vw % span == 0) {
+- Node* init_nd = pre_end->init_trip();
+- if (init_nd->is_Con() && p.invar() == NULL) {
+- int init = init_nd->bottom_type()->is_int()->get_con();
+-
+- int init_offset = init * p.scale_in_bytes() + p.offset_in_bytes();
+- assert(init_offset >= 0, "positive offset from object start");
+-
++ Node* init_nd = pre_end->init_trip();
++ if (init_nd->is_Con() && p.invar() == NULL) {
++ int init = init_nd->bottom_type()->is_int()->get_con();
++ int init_offset = init * p.scale_in_bytes() + offset;
++ assert(init_offset >= 0, "positive offset from object start");
++ if (vw % span == 0) {
++ // If vm is a multiple of span, we use formula (1).
+ if (span > 0) {
+ return (vw - (init_offset % vw)) % span == 0;
+ } else {
+ assert(span < 0, "nonzero stride * scale");
+ return (init_offset % vw) % -span == 0;
+ }
++ } else if (span % vw == 0) {
++ // If span is a multiple of vw, we can simplify formula (1) to:
++ // (init_offset + i * span) % vw == 0
++ // =>
++ // (init_offset % vw) + ((i * span) % vw) == 0
++ // =>
++ // init_offset % vw == 0
++ //
++ // Because we add a multiple of vw to the initial offset, the final
++ // offset is a multiple of vw if and only if init_offset is a multiple.
++ //
++ return (init_offset % vw) == 0;
+ }
+ }
+ return false;
+@@ -479,17 +514,23 @@
+ SWPointer align_to_ref_p(mem_ref, this);
+ int offset = align_to_ref_p.offset_in_bytes();
+ int scale = align_to_ref_p.scale_in_bytes();
++ int elt_size = align_to_ref_p.memory_size();
+ int vw = vector_width_in_bytes(mem_ref);
+ assert(vw > 1, "sanity");
+- int stride_sign = (scale * iv_stride()) > 0 ? 1 : -1;
+- // At least one iteration is executed in pre-loop by default. As result
+- // several iterations are needed to align memory operations in main-loop even
+- // if offset is 0.
+- int iv_adjustment_in_bytes = (stride_sign * vw - (offset % vw));
+- int elt_size = align_to_ref_p.memory_size();
+- assert(((ABS(iv_adjustment_in_bytes) % elt_size) == 0),
+- err_msg_res("(%d) should be divisible by (%d)", iv_adjustment_in_bytes, elt_size));
+- int iv_adjustment = iv_adjustment_in_bytes/elt_size;
++ int iv_adjustment;
++ if (scale != 0) {
++ int stride_sign = (scale * iv_stride()) > 0 ? 1 : -1;
++ // At least one iteration is executed in pre-loop by default. As result
++ // several iterations are needed to align memory operations in main-loop even
++ // if offset is 0.
++ int iv_adjustment_in_bytes = (stride_sign * vw - (offset % vw));
++ assert(((ABS(iv_adjustment_in_bytes) % elt_size) == 0),
++ err_msg_res("(%d) should be divisible by (%d)", iv_adjustment_in_bytes, elt_size));
++ iv_adjustment = iv_adjustment_in_bytes/elt_size;
++ } else {
++ // This memory op is not dependent on iv (scale == 0)
++ iv_adjustment = 0;
++ }
+
+ #ifndef PRODUCT
+ if (TraceSuperWord)
+@@ -1390,7 +1431,7 @@
+ }
+ Node* adr = low_adr->in(MemNode::Address);
+ const TypePtr* atyp = n->adr_type();
+- vn = LoadVectorNode::make(C, opc, ctl, mem, adr, atyp, vlen, velt_basic_type(n));
++ vn = LoadVectorNode::make(C, opc, ctl, mem, adr, atyp, vlen, velt_basic_type(n), control_dependency(p));
+ vlen_in_bytes = vn->as_LoadVector()->memory_size();
+ } else if (n->is_Store()) {
+ // Promote value to be stored to vector
+@@ -1988,6 +2029,19 @@
+ return n;
+ }
+
++LoadNode::ControlDependency SuperWord::control_dependency(Node_List* p) {
++ LoadNode::ControlDependency dep = LoadNode::DependsOnlyOnTest;
++ for (uint i = 0; i < p->size(); i++) {
++ Node* n = p->at(i);
++ assert(n->is_Load(), "only meaningful for loads");
++ if (!n->depends_only_on_test()) {
++ dep = LoadNode::Pinned;
++ }
++ }
++ return dep;
++}
++
++
+ //----------------------------align_initial_loop_index---------------------------
+ // Adjust pre-loop limit so that in main loop, a load/store reference
+ // to align_to_ref will be a position zero in the vector.
+@@ -2247,6 +2301,11 @@
+ }
+ // Match AddP(base, AddP(ptr, k*iv [+ invariant]), constant)
+ Node* base = adr->in(AddPNode::Base);
++ // The base address should be loop invariant
++ if (!invariant(base)) {
++ assert(!valid(), "base address is loop variant");
++ return;
++ }
+ //unsafe reference could not be aligned appropriately without runtime checking
+ if (base == NULL || base->bottom_type() == Type::TOP) {
+ assert(!valid(), "unsafe access");
+--- ./hotspot/src/share/vm/opto/superword.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/superword.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -41,7 +41,7 @@
+ // Exploiting SuperWord Level Parallelism with
+ // Multimedia Instruction Sets
+ // by
+-// Samuel Larsen and Saman Amarasighe
++// Samuel Larsen and Saman Amarasinghe
+ // MIT Laboratory for Computer Science
+ // date
+ // May 2000
+@@ -399,6 +399,7 @@
+ Node* executed_first(Node_List* p);
+ // Return the node executed last in pack p.
+ Node* executed_last(Node_List* p);
++ static LoadNode::ControlDependency control_dependency(Node_List* p);
+ // Alignment within a vector memory reference
+ int memory_alignment(MemNode* s, int iv_adjust);
+ // (Start, end] half-open range defining which operands are vector
+@@ -432,7 +433,7 @@
+
+ Node* _base; // NULL if unsafe nonheap reference
+ Node* _adr; // address pointer
+- jint _scale; // multipler for iv (in bytes), 0 if no loop iv
++ jint _scale; // multiplier for iv (in bytes), 0 if no loop iv
+ jint _offset; // constant offset (in bytes)
+ Node* _invar; // invariant offset (in bytes), NULL if none
+ bool _negate_invar; // if true then use: (0 - _invar)
+--- ./hotspot/src/share/vm/opto/type.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/type.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1180,11 +1180,11 @@
+ // Certain normalizations keep us sane when comparing types.
+ // The 'SMALLINT' covers constants and also CC and its relatives.
+ if (lo <= hi) {
+- if ((juint)(hi - lo) <= SMALLINT) w = Type::WidenMin;
+- if ((juint)(hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT
++ if (((juint)hi - lo) <= SMALLINT) w = Type::WidenMin;
++ if (((juint)hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT
+ } else {
+- if ((juint)(lo - hi) <= SMALLINT) w = Type::WidenMin;
+- if ((juint)(lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT
++ if (((juint)lo - hi) <= SMALLINT) w = Type::WidenMin;
++ if (((juint)lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT
+ }
+ return w;
+ }
+@@ -1438,11 +1438,11 @@
+ // Certain normalizations keep us sane when comparing types.
+ // The 'SMALLINT' covers constants.
+ if (lo <= hi) {
+- if ((julong)(hi - lo) <= SMALLINT) w = Type::WidenMin;
+- if ((julong)(hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG
++ if (((julong)hi - lo) <= SMALLINT) w = Type::WidenMin;
++ if (((julong)hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG
+ } else {
+- if ((julong)(lo - hi) <= SMALLINT) w = Type::WidenMin;
+- if ((julong)(lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG
++ if (((julong)lo - hi) <= SMALLINT) w = Type::WidenMin;
++ if (((julong)lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG
+ }
+ return w;
+ }
+@@ -3950,7 +3950,9 @@
+ (tap->_klass_is_exact && !tap->klass()->is_subtype_of(klass())) ||
+ // 'this' is exact and super or unrelated:
+ (this->_klass_is_exact && !klass()->is_subtype_of(tap->klass())))) {
+- tary = TypeAry::make(Type::BOTTOM, tary->_size, tary->_stable);
++ if (above_centerline(ptr)) {
++ tary = TypeAry::make(Type::BOTTOM, tary->_size, tary->_stable);
++ }
+ return make(NotNull, NULL, tary, lazy_klass, false, off, InstanceBot);
+ }
+
+--- ./hotspot/src/share/vm/opto/vectornode.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/vectornode.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -403,9 +403,10 @@
+
+ // Return the vector version of a scalar load node.
+ LoadVectorNode* LoadVectorNode::make(Compile* C, int opc, Node* ctl, Node* mem,
+- Node* adr, const TypePtr* atyp, uint vlen, BasicType bt) {
++ Node* adr, const TypePtr* atyp, uint vlen, BasicType bt,
++ ControlDependency control_dependency) {
+ const TypeVect* vt = TypeVect::make(bt, vlen);
+- return new (C) LoadVectorNode(ctl, mem, adr, atyp, vt);
++ return new (C) LoadVectorNode(ctl, mem, adr, atyp, vt, control_dependency);
+ }
+
+ // Return the vector version of a scalar store node.
+--- ./hotspot/src/share/vm/opto/vectornode.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/opto/vectornode.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -355,8 +355,8 @@
+ // Load Vector from memory
+ class LoadVectorNode : public LoadNode {
+ public:
+- LoadVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt)
+- : LoadNode(c, mem, adr, at, vt, MemNode::unordered) {
++ LoadVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt, ControlDependency control_dependency = LoadNode::DependsOnlyOnTest)
++ : LoadNode(c, mem, adr, at, vt, MemNode::unordered, control_dependency) {
+ init_class_id(Class_LoadVector);
+ }
+
+@@ -372,7 +372,8 @@
+ virtual int store_Opcode() const { return Op_StoreVector; }
+
+ static LoadVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem,
+- Node* adr, const TypePtr* atyp, uint vlen, BasicType bt);
++ Node* adr, const TypePtr* atyp, uint vlen, BasicType bt,
++ ControlDependency control_dependency = LoadNode::DependsOnlyOnTest);
+ };
+
+ //------------------------------StoreVectorNode--------------------------------
+--- ./hotspot/src/share/vm/prims/forte.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/forte.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -172,8 +172,27 @@
+ // Now do we have a useful PcDesc?
+ if (pc_desc == NULL ||
+ pc_desc->scope_decode_offset() == DebugInformationRecorder::serialized_null) {
+- // No debug information available for this pc
+- // vframeStream would explode if we try and walk the frames.
++ // No debug information is available for this PC.
++ //
++ // vframeStreamCommon::fill_from_frame() will decode the frame depending
++ // on the state of the thread.
++ //
++ // Case #1: If the thread is in Java (state == _thread_in_Java), then
++ // the vframeStreamCommon object will be filled as if the frame were a native
++ // compiled frame. Therefore, no debug information is needed.
++ //
++ // Case #2: If the thread is in any other state, then two steps will be performed:
++ // - if asserts are enabled, found_bad_method_frame() will be called and
++ // the assert in found_bad_method_frame() will be triggered;
++ // - if asserts are disabled, the vframeStreamCommon object will be filled
++ // as if it were a native compiled frame.
++ //
++ // Case (2) is similar to the way interpreter frames are processed in
++ // vframeStreamCommon::fill_from_interpreter_frame in case no valid BCI
++ // was found for an interpreted frame. If asserts are enabled, the assert
++ // in found_bad_method_frame() will be triggered. If asserts are disabled,
++ // the vframeStreamCommon object will be filled afterwards as if the
++ // interpreter were at the point of entering into the method.
+ return false;
+ }
+
+@@ -230,9 +249,10 @@
+ // a valid method. Then again we may have caught an interpreter
+ // frame in the middle of construction and the bci field is
+ // not yet valid.
+-
+- *method_p = method;
+ if (!method->is_valid_method()) return false;
++ *method_p = method; // If the Method* found is invalid, it is
++ // ignored by forte_fill_call_trace_given_top().
++ // So set method_p only if the Method is valid.
+
+ intptr_t bcx = fr->interpreter_frame_bcx();
+
+@@ -247,18 +267,33 @@
+ }
+
+
+-// Determine if 'fr' can be used to find an initial Java frame.
+-// Return false if it can not find a fully decipherable Java frame
+-// (in other words a frame that isn't safe to use in a vframe stream).
+-// Obviously if it can't even find a Java frame false will also be returned.
++// Determine if a Java frame can be found starting with the frame 'fr'.
+ //
+-// If we find a Java frame decipherable or not then by definition we have
+-// identified a method and that will be returned to the caller via method_p.
+-// If we can determine a bci that is returned also. (Hmm is it possible
+-// to return a method and bci and still return false? )
++// Check the return value of find_initial_Java_frame and the value of
++// 'method_p' to decide on how use the results returned by this method.
+ //
+-// The initial Java frame we find (if any) is return via initial_frame_p.
++// If 'method_p' is not NULL, an initial Java frame has been found and
++// the stack can be walked starting from that initial frame. In this case,
++// 'method_p' points to the Method that the initial frame belongs to and
++// the initial Java frame is returned in initial_frame_p.
+ //
++// find_initial_Java_frame() returns true if a Method has been found (i.e.,
++// 'method_p' is not NULL) and the initial frame that belongs to that Method
++// is decipherable.
++//
++// A frame is considered to be decipherable:
++//
++// - if the frame is a compiled frame and a PCDesc is available;
++//
++// - if the frame is an interpreter frame that is valid or the thread is
++// state (_thread_in_native || state == _thread_in_vm || state == _thread_blocked).
++//
++// Note that find_initial_Java_frame() can return false even if an initial
++// Java method was found (e.g., there is no PCDesc available for the method).
++//
++// If 'method_p' is NULL, it was not possible to find a Java frame when
++// walking the stack starting from 'fr'. In this case find_initial_Java_frame
++// returns false.
+
+ static bool find_initial_Java_frame(JavaThread* thread,
+ frame* fr,
+@@ -278,8 +313,6 @@
+ // recognizable to us. This should only happen if we are in a JRT_LEAF
+ // or something called by a JRT_LEAF method.
+
+-
+-
+ frame candidate = *fr;
+
+ // If the starting frame we were given has no codeBlob associated with
+@@ -334,9 +367,11 @@
+ nmethod* nm = (nmethod*) candidate.cb();
+ *method_p = nm->method();
+
+- // If the frame isn't fully decipherable then the default
+- // value for the bci is a signal that we don't have a bci.
+- // If we have a decipherable frame this bci value will
++ // If the frame is not decipherable, then the value of -1
++ // for the BCI is used to signal that no BCI is available.
++ // Furthermore, the method returns false in this case.
++ //
++ // If a decipherable frame is available, the BCI value will
+ // not be used.
+
+ *bci_p = -1;
+@@ -347,9 +382,9 @@
+
+ if (nm->is_native_method()) return true;
+
+- // If it isn't decipherable then we have found a pc that doesn't
+- // have a PCDesc that can get us a bci however we did find
+- // a method
++ // If the frame is not decipherable, then a PC was found
++ // that does not have a PCDesc from which a BCI can be obtained.
++ // Nevertheless, a Method was found.
+
+ if (!is_decipherable_compiled_frame(thread, &candidate, nm)) {
+ return false;
+@@ -358,7 +393,7 @@
+ // is_decipherable_compiled_frame may modify candidate's pc
+ *initial_frame_p = candidate;
+
+- assert(nm->pc_desc_at(candidate.pc()) != NULL, "if it's decipherable then pc must be valid");
++ assert(nm->pc_desc_at(candidate.pc()) != NULL, "debug information must be available if the frame is decipherable");
+
+ return true;
+ }
+@@ -388,17 +423,17 @@
+
+ frame initial_Java_frame;
+ Method* method;
+- int bci;
++ int bci = -1; // assume BCI is not available for method
++ // update with correct information if available
+ int count;
+
+ count = 0;
+ assert(trace->frames != NULL, "trace->frames must be non-NULL");
+
+- bool fully_decipherable = find_initial_Java_frame(thd, &top_frame, &initial_Java_frame, &method, &bci);
++ // Walk the stack starting from 'top_frame' and search for an initial Java frame.
++ find_initial_Java_frame(thd, &top_frame, &initial_Java_frame, &method, &bci);
+
+- // The frame might not be walkable but still recovered a method
+- // (e.g. an nmethod with no scope info for the pc)
+-
++ // Check if a Java Method has been found.
+ if (method == NULL) return;
+
+ if (!method->is_valid_method()) {
+@@ -406,29 +441,6 @@
+ return;
+ }
+
+- // We got a Java frame however it isn't fully decipherable
+- // so it won't necessarily be safe to use it for the
+- // initial frame in the vframe stream.
+-
+- if (!fully_decipherable) {
+- // Take whatever method the top-frame decoder managed to scrape up.
+- // We look further at the top frame only if non-safepoint
+- // debugging information is available.
+- count++;
+- trace->num_frames = count;
+- trace->frames[0].method_id = method->find_jmethod_id_or_null();
+- if (!method->is_native()) {
+- trace->frames[0].lineno = bci;
+- } else {
+- trace->frames[0].lineno = -3;
+- }
+-
+- if (!initial_Java_frame.safe_for_sender(thd)) return;
+-
+- RegisterMap map(thd, false);
+- initial_Java_frame = initial_Java_frame.sender(&map);
+- }
+-
+ vframeStreamForte st(thd, initial_Java_frame, false);
+
+ for (; !st.at_end() && count < depth; st.forte_next(), count++) {
+--- ./hotspot/src/share/vm/prims/jni.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/jni.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1325,39 +1325,32 @@
+ Method* m = Method::resolve_jmethod_id(method_id);
+ number_of_parameters = m->size_of_parameters();
+ Klass* holder = m->method_holder();
+- if (!(holder)->is_interface()) {
++ if (call_type != JNI_VIRTUAL) {
++ selected_method = m;
++ } else if (!m->has_itable_index()) {
+ // non-interface call -- for that little speed boost, don't handlize
+ debug_only(No_Safepoint_Verifier nosafepoint;)
+- if (call_type == JNI_VIRTUAL) {
+- // jni_GetMethodID makes sure class is linked and initialized
+- // so m should have a valid vtable index.
+- assert(!m->has_itable_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);
+- } else {
+- // final method
+- selected_method = m;
+- }
++ // jni_GetMethodID makes sure class is linked and initialized
++ // so m should have a valid vtable index.
++ 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);
+ } else {
+- // JNI_NONVIRTUAL call
++ // final method
+ selected_method = m;
+ }
+ } else {
+ // interface call
+ KlassHandle h_holder(THREAD, holder);
+
+- if (call_type == JNI_VIRTUAL) {
+- int itbl_index = m->itable_index();
+- Klass* k = h_recv->klass();
+- selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK);
+- } else {
+- selected_method = m;
+- }
++ int itbl_index = m->itable_index();
++ Klass* k = h_recv->klass();
++ selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK);
+ }
+ }
+
+@@ -5071,6 +5064,7 @@
+ unit_test_function_call
+
+ // Forward declaration
++void TestOS_test();
+ void TestReservedSpace_test();
+ void TestReserveMemorySpecial_test();
+ void TestVirtualSpace_test();
+@@ -5092,6 +5086,7 @@
+ void execute_internal_vm_tests() {
+ if (ExecuteInternalVMTests) {
+ tty->print_cr("Running internal VM tests");
++ run_unit_test(TestOS_test());
+ run_unit_test(TestReservedSpace_test());
+ run_unit_test(TestReserveMemorySpecial_test());
+ run_unit_test(TestVirtualSpace_test());
+--- ./hotspot/src/share/vm/prims/jniCheck.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/jniCheck.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -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
+@@ -53,6 +53,8 @@
+ # include "jniTypes_ppc.hpp"
+ #endif
+
++// Complain every extra number of unplanned local refs
++#define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32
+
+ // Heap objects are allowed to be directly referenced only in VM code,
+ // not in native code.
+@@ -168,12 +170,55 @@
+ * SUPPORT FUNCTIONS
+ */
+
++/**
++ * Check whether or not a programmer has actually checked for exceptions. According
++ * to the JNI Specification ("jni/spec/design.html#java_exceptions"):
++ *
++ * There are two cases where the programmer needs to check for exceptions without
++ * being able to first check an error code:
++ *
++ * - The JNI functions that invoke a Java method return the result of the Java method.
++ * The programmer must call ExceptionOccurred() to check for possible exceptions
++ * that occurred during the execution of the Java method.
++ *
++ * - Some of the JNI array access functions do not return an error code, but may
++ * throw an ArrayIndexOutOfBoundsException or ArrayStoreException.
++ *
++ * In all other cases, a non-error return value guarantees that no exceptions have been thrown.
++ *
++ * Programmers often defend against ArrayIndexOutOfBoundsException, so warning
++ * for these functions would be pedantic.
++ */
++static inline void
++check_pending_exception(JavaThread* thr) {
++ if (thr->has_pending_exception()) {
++ NativeReportJNIWarning(thr, "JNI call made with exception pending");
++ }
++ if (thr->is_pending_jni_exception_check()) {
++ IN_VM(
++ tty->print_cr("WARNING in native method: JNI call made without checking exceptions when required to from %s",
++ thr->get_pending_jni_exception_check());
++ thr->print_stack();
++ )
++ thr->clear_pending_jni_exception_check(); // Just complain once
++ }
++}
++
++/**
++ * Add to the planned number of handles. I.e. plus current live & warning threshold
++ */
++static inline void
++add_planned_handle_capacity(JNIHandleBlock* handles, size_t capacity) {
++ handles->set_planned_capacity(capacity +
++ handles->get_number_of_live_handles() +
++ CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD);
++}
++
++
+ static inline void
+ functionEnterCritical(JavaThread* thr)
+ {
+- if (thr->has_pending_exception()) {
+- NativeReportJNIWarning(thr, "JNI call made with exception pending");
+- }
++ check_pending_exception(thr);
+ }
+
+ static inline void
+@@ -187,9 +232,7 @@
+ if (thr->in_critical()) {
+ tty->print_cr("%s", warn_other_function_in_critical);
+ }
+- if (thr->has_pending_exception()) {
+- NativeReportJNIWarning(thr, "JNI call made with exception pending");
+- }
++ check_pending_exception(thr);
+ }
+
+ static inline void
+@@ -201,9 +244,20 @@
+ }
+
+ static inline void
+-functionExit(JNIEnv *env)
++functionExit(JavaThread* thr)
+ {
+- /* nothing to do at this time */
++ JNIHandleBlock* handles = thr->active_handles();
++ size_t planned_capacity = handles->get_planned_capacity();
++ size_t live_handles = handles->get_number_of_live_handles();
++ if (live_handles > planned_capacity) {
++ IN_VM(
++ tty->print_cr("WARNING: JNI local refs: %zu, exceeds capacity: %zu",
++ live_handles, planned_capacity);
++ thr->print_stack();
++ )
++ // Complain just the once, reset to current + warn threshold
++ add_planned_handle_capacity(handles, 0);
++ }
+ }
+
+ static inline void
+@@ -508,7 +562,7 @@
+ jniCheck::validate_object(thr, loader);
+ )
+ jclass result = UNCHECKED()->DefineClass(env, name, loader, buf, len);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -520,7 +574,7 @@
+ jniCheck::validate_class_descriptor(thr, name);
+ )
+ jclass result = UNCHECKED()->FindClass(env, name);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -532,7 +586,7 @@
+ jniCheck::validate_object(thr, method);
+ )
+ jmethodID result = UNCHECKED()->FromReflectedMethod(env, method);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -544,7 +598,7 @@
+ jniCheck::validate_object(thr, field);
+ )
+ jfieldID result = UNCHECKED()->FromReflectedField(env, field);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -560,7 +614,7 @@
+ )
+ jobject result = UNCHECKED()->ToReflectedMethod(env, cls, methodID,
+ isStatic);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -572,7 +626,7 @@
+ jniCheck::validate_class(thr, sub, true);
+ )
+ jclass result = UNCHECKED()->GetSuperclass(env, sub);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -586,7 +640,7 @@
+ jniCheck::validate_class(thr, sup, true);
+ )
+ jboolean result = UNCHECKED()->IsAssignableFrom(env, sub, sup);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -601,7 +655,7 @@
+ )
+ jobject result = UNCHECKED()->ToReflectedField(env, cls, fieldID,
+ isStatic);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -619,7 +673,7 @@
+ }
+ )
+ jint result = UNCHECKED()->Throw(env, obj);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -634,15 +688,16 @@
+ jniCheck::validate_throwable_klass(thr, k);
+ )
+ jint result = UNCHECKED()->ThrowNew(env, clazz, msg);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jthrowable,
+ checked_jni_ExceptionOccurred(JNIEnv *env))
++ thr->clear_pending_jni_exception_check();
+ functionEnterExceptionAllowed(thr);
+ jthrowable result = UNCHECKED()->ExceptionOccurred(env);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -650,22 +705,24 @@
+ checked_jni_ExceptionDescribe(JNIEnv *env))
+ functionEnterExceptionAllowed(thr);
+ UNCHECKED()->ExceptionDescribe(env);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+ checked_jni_ExceptionClear(JNIEnv *env))
++ thr->clear_pending_jni_exception_check();
+ functionEnterExceptionAllowed(thr);
+ UNCHECKED()->ExceptionClear(env);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+ checked_jni_FatalError(JNIEnv *env,
+ const char *msg))
++ thr->clear_pending_jni_exception_check();
+ functionEnter(thr);
+ UNCHECKED()->FatalError(env, msg);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jint,
+@@ -675,7 +732,10 @@
+ if (capacity < 0)
+ NativeReportJNIFatalError(thr, "negative capacity");
+ jint result = UNCHECKED()->PushLocalFrame(env, capacity);
+- functionExit(env);
++ if (result == JNI_OK) {
++ add_planned_handle_capacity(thr->active_handles(), capacity);
++ }
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -684,7 +744,7 @@
+ jobject result))
+ functionEnterExceptionAllowed(thr);
+ jobject res = UNCHECKED()->PopLocalFrame(env, result);
+- functionExit(env);
++ functionExit(thr);
+ return res;
+ JNI_END
+
+@@ -698,7 +758,7 @@
+ }
+ )
+ jobject result = UNCHECKED()->NewGlobalRef(env,lobj);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -714,7 +774,7 @@
+ }
+ )
+ UNCHECKED()->DeleteGlobalRef(env,gref);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+@@ -729,7 +789,7 @@
+ "Invalid local JNI handle passed to DeleteLocalRef");
+ )
+ UNCHECKED()->DeleteLocalRef(env, obj);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jboolean,
+@@ -750,7 +810,7 @@
+ }
+ )
+ jboolean result = UNCHECKED()->IsSameObject(env,obj1,obj2);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -764,7 +824,7 @@
+ }
+ )
+ jobject result = UNCHECKED()->NewLocalRef(env, ref);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -776,7 +836,10 @@
+ NativeReportJNIFatalError(thr, "negative capacity");
+ }
+ jint result = UNCHECKED()->EnsureLocalCapacity(env, capacity);
+- functionExit(env);
++ if (result == JNI_OK) {
++ add_planned_handle_capacity(thr->active_handles(), capacity);
++ }
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -788,7 +851,7 @@
+ jniCheck::validate_class(thr, clazz, false);
+ )
+ jobject result = UNCHECKED()->AllocObject(env,clazz);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -806,7 +869,7 @@
+ va_start(args, methodID);
+ jobject result = UNCHECKED()->NewObjectV(env,clazz,methodID,args);
+ va_end(args);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -821,7 +884,7 @@
+ jniCheck::validate_jmethod_id(thr, methodID);
+ )
+ jobject result = UNCHECKED()->NewObjectV(env,clazz,methodID,args);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -836,7 +899,7 @@
+ jniCheck::validate_jmethod_id(thr, methodID);
+ )
+ jobject result = UNCHECKED()->NewObjectA(env,clazz,methodID,args);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -848,7 +911,7 @@
+ jniCheck::validate_object(thr, obj);
+ )
+ jclass result = UNCHECKED()->GetObjectClass(env,obj);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -862,7 +925,7 @@
+ jniCheck::validate_class(thr, clazz, true);
+ )
+ jboolean result = UNCHECKED()->IsInstanceOf(env,obj,clazz);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -876,7 +939,7 @@
+ jniCheck::validate_class(thr, clazz, false);
+ )
+ jmethodID result = UNCHECKED()->GetMethodID(env,clazz,name,sig);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -895,7 +958,8 @@
+ ResultType result =UNCHECKED()->Call##Result##MethodV(env, obj, methodID, \
+ args); \
+ va_end(args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("Call"#Result"Method"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END \
+ \
+@@ -910,7 +974,8 @@
+ ) \
+ ResultType result = UNCHECKED()->Call##Result##MethodV(env, obj, methodID,\
+ args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("Call"#Result"MethodV"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END \
+ \
+@@ -925,7 +990,8 @@
+ ) \
+ ResultType result = UNCHECKED()->Call##Result##MethodA(env, obj, methodID,\
+ args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("Call"#Result"MethodA"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END
+
+@@ -952,7 +1018,8 @@
+ va_start(args,methodID);
+ UNCHECKED()->CallVoidMethodV(env,obj,methodID,args);
+ va_end(args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallVoidMethod");
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+@@ -965,7 +1032,8 @@
+ jniCheck::validate_call_object(thr, obj, methodID);
+ )
+ UNCHECKED()->CallVoidMethodV(env,obj,methodID,args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallVoidMethodV");
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+@@ -978,7 +1046,8 @@
+ jniCheck::validate_call_object(thr, obj, methodID);
+ )
+ UNCHECKED()->CallVoidMethodA(env,obj,methodID,args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallVoidMethodA");
++ functionExit(thr);
+ JNI_END
+
+ #define WRAPPER_CallNonvirtualMethod(ResultType, Result) \
+@@ -1001,7 +1070,8 @@
+ methodID,\
+ args); \
+ va_end(args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("CallNonvirtual"#Result"Method"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END \
+ \
+@@ -1021,7 +1091,8 @@
+ clazz, \
+ methodID,\
+ args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("CallNonvirtual"#Result"MethodV"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END \
+ \
+@@ -1041,7 +1112,8 @@
+ clazz, \
+ methodID,\
+ args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("CallNonvirtual"#Result"MethodA"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END
+
+@@ -1070,7 +1142,8 @@
+ va_start(args,methodID);
+ UNCHECKED()->CallNonvirtualVoidMethodV(env,obj,clazz,methodID,args);
+ va_end(args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallNonvirtualVoidMethod");
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+@@ -1085,7 +1158,8 @@
+ jniCheck::validate_call_class(thr, clazz, methodID);
+ )
+ UNCHECKED()->CallNonvirtualVoidMethodV(env,obj,clazz,methodID,args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallNonvirtualVoidMethodV");
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+@@ -1100,7 +1174,8 @@
+ jniCheck::validate_call_class(thr, clazz, methodID);
+ )
+ UNCHECKED()->CallNonvirtualVoidMethodA(env,obj,clazz,methodID,args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallNonvirtualVoidMethodA");
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jfieldID,
+@@ -1113,7 +1188,7 @@
+ jniCheck::validate_class(thr, clazz, false);
+ )
+ jfieldID result = UNCHECKED()->GetFieldID(env,clazz,name,sig);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1127,7 +1202,7 @@
+ checkInstanceFieldID(thr, fieldID, obj, FieldType); \
+ ) \
+ ReturnType result = UNCHECKED()->Get##Result##Field(env,obj,fieldID); \
+- functionExit(env); \
++ functionExit(thr); \
+ return result; \
+ JNI_END
+
+@@ -1152,7 +1227,7 @@
+ checkInstanceFieldID(thr, fieldID, obj, FieldType); \
+ ) \
+ UNCHECKED()->Set##Result##Field(env,obj,fieldID,val); \
+- functionExit(env); \
++ functionExit(thr); \
+ JNI_END
+
+ WRAPPER_SetField(jobject, Object, T_OBJECT)
+@@ -1176,7 +1251,7 @@
+ jniCheck::validate_class(thr, clazz, false);
+ )
+ jmethodID result = UNCHECKED()->GetStaticMethodID(env,clazz,name,sig);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1198,7 +1273,8 @@
+ methodID, \
+ args); \
+ va_end(args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("CallStatic"#Result"Method"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END \
+ \
+@@ -1216,7 +1292,8 @@
+ clazz, \
+ methodID, \
+ args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("CallStatic"#Result"MethodV"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END \
+ \
+@@ -1234,7 +1311,8 @@
+ clazz, \
+ methodID, \
+ args); \
+- functionExit(env); \
++ thr->set_pending_jni_exception_check("CallStatic"#Result"MethodA"); \
++ functionExit(thr); \
+ return result; \
+ JNI_END
+
+@@ -1262,7 +1340,8 @@
+ va_start(args,methodID);
+ UNCHECKED()->CallStaticVoidMethodV(env,cls,methodID,args);
+ va_end(args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallStaticVoidMethod");
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+@@ -1276,7 +1355,8 @@
+ jniCheck::validate_class(thr, cls, false);
+ )
+ UNCHECKED()->CallStaticVoidMethodV(env,cls,methodID,args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallStaticVoidMethodV");
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+@@ -1290,7 +1370,8 @@
+ jniCheck::validate_class(thr, cls, false);
+ )
+ UNCHECKED()->CallStaticVoidMethodA(env,cls,methodID,args);
+- functionExit(env);
++ thr->set_pending_jni_exception_check("CallStaticVoidMethodA");
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jfieldID,
+@@ -1303,7 +1384,7 @@
+ jniCheck::validate_class(thr, clazz, false);
+ )
+ jfieldID result = UNCHECKED()->GetStaticFieldID(env,clazz,name,sig);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1320,7 +1401,7 @@
+ ReturnType result = UNCHECKED()->GetStatic##Result##Field(env, \
+ clazz, \
+ fieldID); \
+- functionExit(env); \
++ functionExit(thr); \
+ return result; \
+ JNI_END
+
+@@ -1346,7 +1427,7 @@
+ checkStaticFieldID(thr, fieldID, clazz, FieldType); \
+ ) \
+ UNCHECKED()->SetStatic##Result##Field(env,clazz,fieldID,value); \
+- functionExit(env); \
++ functionExit(thr); \
+ JNI_END
+
+ WRAPPER_SetStaticField(jobject, Object, T_OBJECT)
+@@ -1366,7 +1447,7 @@
+ jsize len))
+ functionEnter(thr);
+ jstring result = UNCHECKED()->NewString(env,unicode,len);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1378,7 +1459,7 @@
+ checkString(thr, str);
+ )
+ jsize result = UNCHECKED()->GetStringLength(env,str);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1407,7 +1488,7 @@
+ // Note that the dtrace arguments for the allocated memory will not match up with this solution.
+ FreeHeap((char*)result);
+ }
+- functionExit(env);
++ functionExit(thr);
+ return new_result;
+ JNI_END
+
+@@ -1442,7 +1523,7 @@
+ UNCHECKED()->ReleaseStringChars(env, str,
+ (const jchar*) guarded.release_for_freeing());
+ }
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jstring,
+@@ -1450,7 +1531,7 @@
+ const char *utf))
+ functionEnter(thr);
+ jstring result = UNCHECKED()->NewStringUTF(env,utf);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1462,7 +1543,7 @@
+ checkString(thr, str);
+ )
+ jsize result = UNCHECKED()->GetStringUTFLength(env,str);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1490,7 +1571,7 @@
+ // Note that the dtrace arguments for the allocated memory will not match up with this solution.
+ FreeHeap((char*)result, mtInternal);
+ }
+- functionExit(env);
++ functionExit(thr);
+ return new_result;
+ JNI_END
+
+@@ -1525,7 +1606,7 @@
+ UNCHECKED()->ReleaseStringUTFChars(env, str,
+ (const char*) guarded.release_for_freeing());
+ }
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jsize,
+@@ -1536,7 +1617,7 @@
+ check_is_array(thr, array);
+ )
+ jsize result = UNCHECKED()->GetArrayLength(env,array);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1547,7 +1628,7 @@
+ jobject init))
+ functionEnter(thr);
+ jobjectArray result = UNCHECKED()->NewObjectArray(env,len,clazz,init);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1560,7 +1641,7 @@
+ check_is_obj_array(thr, array);
+ )
+ jobject result = UNCHECKED()->GetObjectArrayElement(env,array,index);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1574,7 +1655,7 @@
+ check_is_obj_array(thr, array);
+ )
+ UNCHECKED()->SetObjectArrayElement(env,array,index,val);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ #define WRAPPER_NewScalarArray(Return, Result) \
+@@ -1583,7 +1664,7 @@
+ jsize len)) \
+ functionEnter(thr); \
+ Return result = UNCHECKED()->New##Result##Array(env,len); \
+- functionExit(env); \
++ functionExit(thr); \
+ return (Return) result; \
+ JNI_END
+
+@@ -1611,7 +1692,7 @@
+ if (result != NULL) { \
+ result = (ElementType *) check_jni_wrap_copy_array(thr, array, result); \
+ } \
+- functionExit(env); \
++ functionExit(thr); \
+ return result; \
+ JNI_END
+
+@@ -1639,7 +1720,7 @@
+ ElementType* orig_result = (ElementType *) check_wrapped_array_release( \
+ thr, "checked_jni_Release"#Result"ArrayElements", array, elems, mode); \
+ UNCHECKED()->Release##Result##ArrayElements(env, array, orig_result, mode); \
+- functionExit(env); \
++ functionExit(thr); \
+ JNI_END
+
+ WRAPPER_ReleaseScalarArrayElements(T_BOOLEAN,jboolean, Boolean, bool)
+@@ -1663,7 +1744,7 @@
+ check_primitive_array_type(thr, array, ElementTag); \
+ ) \
+ UNCHECKED()->Get##Result##ArrayRegion(env,array,start,len,buf); \
+- functionExit(env); \
++ functionExit(thr); \
+ JNI_END
+
+ WRAPPER_GetScalarArrayRegion(T_BOOLEAN, jboolean, Boolean)
+@@ -1687,7 +1768,7 @@
+ check_primitive_array_type(thr, array, ElementTag); \
+ ) \
+ UNCHECKED()->Set##Result##ArrayRegion(env,array,start,len,buf); \
+- functionExit(env); \
++ functionExit(thr); \
+ JNI_END
+
+ WRAPPER_SetScalarArrayRegion(T_BOOLEAN, jboolean, Boolean)
+@@ -1706,7 +1787,7 @@
+ jint nMethods))
+ functionEnter(thr);
+ jint result = UNCHECKED()->RegisterNatives(env,clazz,methods,nMethods);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1715,7 +1796,7 @@
+ jclass clazz))
+ functionEnter(thr);
+ jint result = UNCHECKED()->UnregisterNatives(env,clazz);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1727,7 +1808,7 @@
+ jniCheck::validate_object(thr, obj);
+ )
+ jint result = UNCHECKED()->MonitorEnter(env,obj);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1739,7 +1820,7 @@
+ jniCheck::validate_object(thr, obj);
+ )
+ jint result = UNCHECKED()->MonitorExit(env,obj);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1748,7 +1829,7 @@
+ JavaVM **vm))
+ functionEnter(thr);
+ jint result = UNCHECKED()->GetJavaVM(env,vm);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1763,7 +1844,7 @@
+ checkString(thr, str);
+ )
+ UNCHECKED()->GetStringRegion(env, str, start, len, buf);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void,
+@@ -1777,7 +1858,7 @@
+ checkString(thr, str);
+ )
+ UNCHECKED()->GetStringUTFRegion(env, str, start, len, buf);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(void *,
+@@ -1792,7 +1873,7 @@
+ if (result != NULL) {
+ result = check_jni_wrap_copy_array(thr, array, result);
+ }
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1808,7 +1889,7 @@
+ // Check the element array...
+ void* orig_result = check_wrapped_array_release(thr, "ReleasePrimitiveArrayCritical", array, carray, mode);
+ UNCHECKED()->ReleasePrimitiveArrayCritical(env, array, orig_result, mode);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(const jchar*,
+@@ -1820,7 +1901,7 @@
+ checkString(thr, string);
+ )
+ const jchar *result = UNCHECKED()->GetStringCritical(env, string, isCopy);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1836,7 +1917,7 @@
+ * string parameter as a minor sanity check
+ */
+ UNCHECKED()->ReleaseStringCritical(env, str, chars);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jweak,
+@@ -1849,7 +1930,7 @@
+ }
+ )
+ jweak result = UNCHECKED()->NewWeakGlobalRef(env, obj);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1858,14 +1939,15 @@
+ jweak ref))
+ functionEnterExceptionAllowed(thr);
+ UNCHECKED()->DeleteWeakGlobalRef(env, ref);
+- functionExit(env);
++ functionExit(thr);
+ JNI_END
+
+ JNI_ENTRY_CHECKED(jboolean,
+ checked_jni_ExceptionCheck(JNIEnv *env))
++ thr->clear_pending_jni_exception_check();
+ functionEnterExceptionAllowed(thr);
+ jboolean result = UNCHECKED()->ExceptionCheck(env);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1875,7 +1957,7 @@
+ jlong capacity))
+ functionEnter(thr);
+ jobject result = UNCHECKED()->NewDirectByteBuffer(env, address, capacity);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1884,7 +1966,7 @@
+ jobject buf))
+ functionEnter(thr);
+ void* result = UNCHECKED()->GetDirectBufferAddress(env, buf);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1893,7 +1975,7 @@
+ jobject buf))
+ functionEnter(thr);
+ jlong result = UNCHECKED()->GetDirectBufferCapacity(env, buf);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1906,7 +1988,7 @@
+ jniCheck::validate_object(thr, obj);
+ )
+ jobjectRefType result = UNCHECKED()->GetObjectRefType(env, obj);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+@@ -1915,7 +1997,7 @@
+ checked_jni_GetVersion(JNIEnv *env))
+ functionEnter(thr);
+ jint result = UNCHECKED()->GetVersion(env);
+- functionExit(env);
++ functionExit(thr);
+ return result;
+ JNI_END
+
+--- ./hotspot/src/share/vm/prims/jvm.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/jvm.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1372,7 +1372,11 @@
+ if (HAS_PENDING_EXCEPTION) {
+ pending_exception = Handle(THREAD, PENDING_EXCEPTION);
+ CLEAR_PENDING_EXCEPTION;
+-
++ // JVMTI has already reported the pending exception
++ // JVMTI internal flag reset is needed in order to report PrivilegedActionException
++ if (THREAD->is_Java_thread()) {
++ JvmtiExport::clear_detected_exception((JavaThread*) THREAD);
++ }
+ if ( pending_exception->is_a(SystemDictionary::Exception_klass()) &&
+ !pending_exception->is_a(SystemDictionary::RuntimeException_klass())) {
+ // Throw a java.security.PrivilegedActionException(Exception e) exception
+--- ./hotspot/src/share/vm/prims/jvmtiExport.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/jvmtiExport.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -2163,6 +2163,15 @@
+ }
+ }
+
++void JvmtiExport::clear_detected_exception(JavaThread* thread) {
++ assert(JavaThread::current() == thread, "thread is not current");
++
++ JvmtiThreadState* state = thread->jvmti_thread_state();
++ if (state != NULL) {
++ state->clear_exception_detected();
++ }
++}
++
+ void JvmtiExport::oops_do(OopClosure* f) {
+ JvmtiCurrentBreakpoints::oops_do(f);
+ JvmtiVMObjectAllocEventCollector::oops_do_for_all_threads(f);
+--- ./hotspot/src/share/vm/prims/jvmtiExport.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/jvmtiExport.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -363,6 +363,7 @@
+ }
+
+ static void cleanup_thread (JavaThread* thread) NOT_JVMTI_RETURN;
++ static void clear_detected_exception (JavaThread* thread) NOT_JVMTI_RETURN;
+
+ static void oops_do(OopClosure* f) NOT_JVMTI_RETURN;
+ static void weak_oops_do(BoolObjectClosure* b, OopClosure* f) NOT_JVMTI_RETURN;
+--- ./hotspot/src/share/vm/prims/jvmtiImpl.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/jvmtiImpl.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -25,6 +25,7 @@
+ #include "precompiled.hpp"
+ #include "classfile/systemDictionary.hpp"
+ #include "interpreter/interpreter.hpp"
++#include "interpreter/oopMapCache.hpp"
+ #include "jvmtifiles/jvmtiEnv.hpp"
+ #include "memory/resourceArea.hpp"
+ #include "oops/instanceKlass.hpp"
+@@ -744,6 +745,13 @@
+ }
+
+ void VM_GetOrSetLocal::doit() {
++ InterpreterOopMap oop_mask;
++ _jvf->method()->mask_for(_jvf->bci(), &oop_mask);
++ if (oop_mask.is_dead(_index)) {
++ // The local can be invalid and uninitialized in the scope of current bci
++ _result = JVMTI_ERROR_INVALID_SLOT;
++ return;
++ }
+ if (_set) {
+ // Force deoptimization of frame if compiled because it's
+ // possible the compiler emitted some locals as constant values,
+--- ./hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2014, 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
+@@ -777,9 +777,13 @@
+ Method* idnum_owner = scratch_class->method_with_idnum(old_num);
+ if (idnum_owner != NULL) {
+ // There is already a method assigned this idnum -- switch them
++ // Take current and original idnum from the new_method
+ idnum_owner->set_method_idnum(new_num);
++ idnum_owner->set_orig_method_idnum(k_new_method->orig_method_idnum());
+ }
++ // Take current and original idnum from the old_method
+ k_new_method->set_method_idnum(old_num);
++ k_new_method->set_orig_method_idnum(k_old_method->orig_method_idnum());
+ if (thread->has_pending_exception()) {
+ return JVMTI_ERROR_OUT_OF_MEMORY;
+ }
+@@ -812,9 +816,12 @@
+ Method* idnum_owner = scratch_class->method_with_idnum(num);
+ if (idnum_owner != NULL) {
+ // There is already a method assigned this idnum -- switch them
++ // Take current and original idnum from the new_method
+ idnum_owner->set_method_idnum(new_num);
++ idnum_owner->set_orig_method_idnum(k_new_method->orig_method_idnum());
+ }
+ k_new_method->set_method_idnum(num);
++ k_new_method->set_orig_method_idnum(num);
+ if (thread->has_pending_exception()) {
+ return JVMTI_ERROR_OUT_OF_MEMORY;
+ }
+@@ -3322,6 +3329,7 @@
+ // This is a very busy routine. We don't want too much tracing
+ // printed out.
+ bool trace_name_printed = false;
++ InstanceKlass *the_class = InstanceKlass::cast(_the_class_oop);
+
+ // Very noisy: only enable this call if you are trying to determine
+ // that a specific class gets found by this routine.
+@@ -3333,10 +3341,8 @@
+ // If the class being redefined is java.lang.Object, we need to fix all
+ // array class vtables also
+ if (k->oop_is_array() && _the_class_oop == SystemDictionary::Object_klass()) {
+- k->vtable()->adjust_method_entries(_matching_old_methods,
+- _matching_new_methods,
+- _matching_methods_length,
+- &trace_name_printed);
++ k->vtable()->adjust_method_entries(the_class, &trace_name_printed);
++
+ } else if (k->oop_is_instance()) {
+ HandleMark hm(_thread);
+ InstanceKlass *ik = InstanceKlass::cast(k);
+@@ -3376,14 +3382,9 @@
+ || ik->is_subtype_of(_the_class_oop))) {
+ // ik->vtable() creates a wrapper object; rm cleans it up
+ ResourceMark rm(_thread);
+- ik->vtable()->adjust_method_entries(_matching_old_methods,
+- _matching_new_methods,
+- _matching_methods_length,
+- &trace_name_printed);
+- ik->adjust_default_methods(_matching_old_methods,
+- _matching_new_methods,
+- _matching_methods_length,
+- &trace_name_printed);
++
++ ik->vtable()->adjust_method_entries(the_class, &trace_name_printed);
++ ik->adjust_default_methods(the_class, &trace_name_printed);
+ }
+
+ // If the current class has an itable and we are either redefining an
+@@ -3396,10 +3397,8 @@
+ || ik->is_subclass_of(_the_class_oop))) {
+ // ik->itable() creates a wrapper object; rm cleans it up
+ ResourceMark rm(_thread);
+- ik->itable()->adjust_method_entries(_matching_old_methods,
+- _matching_new_methods,
+- _matching_methods_length,
+- &trace_name_printed);
++
++ ik->itable()->adjust_method_entries(the_class, &trace_name_printed);
+ }
+
+ // The constant pools in other classes (other_cp) can refer to
+@@ -3423,10 +3422,7 @@
+ other_cp = constantPoolHandle(ik->constants());
+ cp_cache = other_cp->cache();
+ if (cp_cache != NULL) {
+- cp_cache->adjust_method_entries(_matching_old_methods,
+- _matching_new_methods,
+- _matching_methods_length,
+- &trace_name_printed);
++ cp_cache->adjust_method_entries(the_class, &trace_name_printed);
+ }
+ }
+
+@@ -3437,10 +3433,7 @@
+ other_cp = pv_node->prev_constant_pool();
+ cp_cache = other_cp->cache();
+ if (cp_cache != NULL) {
+- cp_cache->adjust_method_entries(_matching_old_methods,
+- _matching_new_methods,
+- _matching_methods_length,
+- &trace_name_printed);
++ cp_cache->adjust_method_entries(other_cp->pool_holder(), &trace_name_printed);
+ }
+ }
+ }
+@@ -3555,6 +3548,7 @@
+
+ // obsolete methods need a unique idnum so they become new entries in
+ // the jmethodID cache in InstanceKlass
++ assert(old_method->method_idnum() == new_method->method_idnum(), "must match");
+ u2 num = InstanceKlass::cast(_the_class_oop)->next_method_idnum();
+ if (num != ConstMethod::UNSET_IDNUM) {
+ old_method->set_method_idnum(num);
+@@ -3575,7 +3569,8 @@
+ assert(!old_method->has_vtable_index(),
+ "cannot delete methods with vtable entries");;
+
+- // Mark all deleted methods as old and obsolete
++ // Mark all deleted methods as old, obsolete and deleted
++ old_method->set_is_deleted();
+ old_method->set_is_old();
+ old_method->set_is_obsolete();
+ ++obsolete_count;
+@@ -3981,14 +3976,13 @@
+ // the_class doesn't have a cache yet so copy it
+ the_class->set_cached_class_file(scratch_class->get_cached_class_file());
+ }
+-#ifndef PRODUCT
+- else {
+- assert(the_class->get_cached_class_file_bytes() ==
+- scratch_class->get_cached_class_file_bytes(), "cache ptrs must match");
+- assert(the_class->get_cached_class_file_len() ==
+- scratch_class->get_cached_class_file_len(), "cache lens must match");
++ else if (scratch_class->get_cached_class_file_bytes() !=
++ the_class->get_cached_class_file_bytes()) {
++ // The same class can be present twice in the scratch classes list or there
++ // are multiple concurrent RetransformClasses calls on different threads.
++ // In such cases we have to deallocate scratch_class cached_class_file.
++ os::free(scratch_class->get_cached_class_file());
+ }
+-#endif
+
+ // NULL out in scratch class to not delete twice. The class to be redefined
+ // always owns these bytes.
+@@ -4074,10 +4068,7 @@
+ MemberNameTable* mnt = the_class->member_names();
+ if (mnt != NULL) {
+ bool trace_name_printed = false;
+- mnt->adjust_method_entries(_matching_old_methods,
+- _matching_new_methods,
+- _matching_methods_length,
+- &trace_name_printed);
++ mnt->adjust_method_entries(the_class(), &trace_name_printed);
+ }
+
+ // Fix Resolution Error table also to remove old constant pools
+@@ -4164,7 +4155,7 @@
+ no_old_methods = false;
+ }
+
+- // the constant pool cache should never contain old or obsolete methods
++ // the constant pool cache should never contain non-deleted old or obsolete methods
+ if (ik->constants() != NULL &&
+ ik->constants()->cache() != NULL &&
+ !ik->constants()->cache()->check_no_old_or_obsolete_entries()) {
+--- ./hotspot/src/share/vm/prims/jvmtiTagMap.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/jvmtiTagMap.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1045,10 +1045,16 @@
+ {
+ assert(str->klass() == SystemDictionary::String_klass(), "not a string");
+
++ typeArrayOop s_value = java_lang_String::value(str);
++
++ // JDK-6584008: the value field may be null if a String instance is
++ // partially constructed.
++ if (s_value == NULL) {
++ return 0;
++ }
+ // get the string value and length
+ // (string value may be offset from the base)
+ int s_len = java_lang_String::length(str);
+- typeArrayOop s_value = java_lang_String::value(str);
+ int s_offset = java_lang_String::offset(str);
+ jchar* value;
+ if (s_len > 0) {
+--- ./hotspot/src/share/vm/prims/methodHandles.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/methodHandles.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -30,6 +30,7 @@
+ #include "memory/allocation.inline.hpp"
+ #include "memory/oopFactory.hpp"
+ #include "prims/methodHandles.hpp"
++#include "prims/jvmtiRedefineClassesTrace.hpp"
+ #include "runtime/compilationPolicy.hpp"
+ #include "runtime/javaCalls.hpp"
+ #include "runtime/reflection.hpp"
+@@ -955,21 +956,41 @@
+
+ #if INCLUDE_JVMTI
+ // It is called at safepoint only for RedefineClasses
+-void MemberNameTable::adjust_method_entries(Method** old_methods, Method** new_methods,
+- int methods_length, bool *trace_name_printed) {
++void MemberNameTable::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
+ assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
+ // For each redefined method
+- for (int j = 0; j < methods_length; j++) {
+- Method* old_method = old_methods[j];
+- Method* new_method = new_methods[j];
++ for (int idx = 0; idx < length(); idx++) {
++ oop mem_name = JNIHandles::resolve(this->at(idx));
++ if (mem_name == NULL) {
++ continue;
++ }
++ Method* old_method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name);
+
+- // search the MemberNameTable for uses of either obsolete or EMCP methods
+- for (int idx = 0; idx < length(); idx++) {
+- oop mem_name = JNIHandles::resolve(this->at(idx));
+- if (mem_name != NULL) {
+- java_lang_invoke_MemberName::adjust_vmtarget(mem_name, old_method, new_method,
+- trace_name_printed);
++ if (old_method == NULL || !old_method->is_old()) {
++ continue; // skip uninteresting entries
++ }
++ if (old_method->is_deleted()) {
++ // skip entries with deleted methods
++ continue;
++ }
++ Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
++
++ assert(new_method != NULL, "method_with_idnum() should not be NULL");
++ assert(old_method != new_method, "sanity check");
++
++ java_lang_invoke_MemberName::set_vmtarget(mem_name, new_method);
++
++ if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
++ if (!(*trace_name_printed)) {
++ // RC_TRACE_MESG macro has an embedded ResourceMark
++ RC_TRACE_MESG(("adjust: name=%s",
++ old_method->method_holder()->external_name()));
++ *trace_name_printed = true;
+ }
++ // RC_TRACE macro has an embedded ResourceMark
++ RC_TRACE(0x00400000, ("MemberName method update: %s(%s)",
++ new_method->name()->as_C_string(),
++ new_method->signature()->as_C_string()));
+ }
+ }
+ }
+--- ./hotspot/src/share/vm/prims/methodHandles.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/methodHandles.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -240,10 +240,8 @@
+
+ #if INCLUDE_JVMTI
+ // RedefineClasses() API support:
+- // If a MemberName refers to old_method then update it
+- // to refer to new_method.
+- void adjust_method_entries(Method** old_methods, Method** new_methods,
+- int methods_length, bool *trace_name_printed);
++ // If a MemberName refers to old_method then update it to refer to new_method.
++ void adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed);
+ #endif // INCLUDE_JVMTI
+ };
+
+--- ./hotspot/src/share/vm/prims/unsafe.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/unsafe.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -322,10 +322,33 @@
+ UNSAFE_END
+
+ #ifndef SUPPORTS_NATIVE_CX8
+-// Keep old code for platforms which may not have atomic jlong (8 bytes) instructions
+
+-// Volatile long versions must use locks if !VM_Version::supports_cx8().
+-// support_cx8 is a surrogate for 'supports atomic long memory ops'.
++// VM_Version::supports_cx8() is a surrogate for 'supports atomic long memory ops'.
++//
++// On platforms which do not support atomic compare-and-swap of jlong (8 byte)
++// values we have to use a lock-based scheme to enforce atomicity. This has to be
++// applied to all Unsafe operations that set the value of a jlong field. Even so
++// the compareAndSwapLong operation will not be atomic with respect to direct stores
++// to the field from Java code. It is important therefore that any Java code that
++// utilizes these Unsafe jlong operations does not perform direct stores. To permit
++// direct loads of the field from Java code we must also use Atomic::store within the
++// locked regions. And for good measure, in case there are direct stores, we also
++// employ Atomic::load within those regions. Note that the field in question must be
++// volatile and so must have atomic load/store accesses applied at the Java level.
++//
++// The locking scheme could utilize a range of strategies for controlling the locking
++// granularity: from a lock per-field through to a single global lock. The latter is
++// the simplest and is used for the current implementation. Note that the Java object
++// that contains the field, can not, in general, be used for locking. To do so can lead
++// to deadlocks as we may introduce locking into what appears to the Java code to be a
++// lock-free path.
++//
++// As all the locked-regions are very short and themselves non-blocking we can treat
++// them as leaf routines and elide safepoint checks (ie we don't perform any thread
++// state transitions even when blocking for the lock). Note that if we do choose to
++// add safepoint checks and thread state transitions, we must ensure that we calculate
++// the address of the field _after_ we have acquired the lock, else the object may have
++// been moved by the GC
+
+ UNSAFE_ENTRY(jlong, Unsafe_GetLongVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset))
+ UnsafeWrapper("Unsafe_GetLongVolatile");
+@@ -337,8 +360,8 @@
+ else {
+ Handle p (THREAD, JNIHandles::resolve(obj));
+ jlong* addr = (jlong*)(index_oop_from_field_offset_long(p(), offset));
+- ObjectLocker ol(p, THREAD);
+- jlong value = *addr;
++ MutexLockerEx mu(UnsafeJlong_lock, Mutex::_no_safepoint_check_flag);
++ jlong value = Atomic::load(addr);
+ return value;
+ }
+ }
+@@ -353,8 +376,8 @@
+ else {
+ Handle p (THREAD, JNIHandles::resolve(obj));
+ jlong* addr = (jlong*)(index_oop_from_field_offset_long(p(), offset));
+- ObjectLocker ol(p, THREAD);
+- *addr = x;
++ MutexLockerEx mu(UnsafeJlong_lock, Mutex::_no_safepoint_check_flag);
++ Atomic::store(x, addr);
+ }
+ }
+ UNSAFE_END
+@@ -463,8 +486,8 @@
+ else {
+ Handle p (THREAD, JNIHandles::resolve(obj));
+ jlong* addr = (jlong*)(index_oop_from_field_offset_long(p(), offset));
+- ObjectLocker ol(p, THREAD);
+- *addr = x;
++ MutexLockerEx mu(UnsafeJlong_lock, Mutex::_no_safepoint_check_flag);
++ Atomic::store(x, addr);
+ }
+ }
+ #endif
+@@ -1213,14 +1236,19 @@
+ UnsafeWrapper("Unsafe_CompareAndSwapLong");
+ Handle p (THREAD, JNIHandles::resolve(obj));
+ jlong* addr = (jlong*)(index_oop_from_field_offset_long(p(), offset));
++#ifdef SUPPORTS_NATIVE_CX8
++ return (jlong)(Atomic::cmpxchg(x, addr, e)) == e;
++#else
+ if (VM_Version::supports_cx8())
+ return (jlong)(Atomic::cmpxchg(x, addr, e)) == e;
+ else {
+ jboolean success = false;
+- ObjectLocker ol(p, THREAD);
+- if (*addr == e) { *addr = x; success = true; }
++ MutexLockerEx mu(UnsafeJlong_lock, Mutex::_no_safepoint_check_flag);
++ jlong val = Atomic::load(addr);
++ if (val == e) { Atomic::store(x, addr); success = true; }
+ return success;
+ }
++#endif
+ UNSAFE_END
+
+ UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute, jlong time))
+--- ./hotspot/src/share/vm/prims/whitebox.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/prims/whitebox.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -73,6 +73,13 @@
+ return heapOopSize;
+ WB_END
+
++WB_ENTRY(jint, WB_GetVMPageSize(JNIEnv* env, jobject o))
++ return os::vm_page_size();
++WB_END
++
++WB_ENTRY(jlong, WB_GetVMLargePageSize(JNIEnv* env, jobject o))
++ return os::large_page_size();
++WB_END
+
+ class WBIsKlassAliveClosure : public KlassClosure {
+ Symbol* _name;
+@@ -302,6 +309,12 @@
+ return hr->isHumongous();
+ WB_END
+
++WB_ENTRY(jlong, WB_G1NumMaxRegions(JNIEnv* env, jobject o))
++ G1CollectedHeap* g1 = G1CollectedHeap::heap();
++ size_t nr = g1->max_regions();
++ return (jlong)nr;
++WB_END
++
+ WB_ENTRY(jlong, WB_G1NumFreeRegions(JNIEnv* env, jobject o))
+ G1CollectedHeap* g1 = G1CollectedHeap::heap();
+ size_t nr = g1->num_free_regions();
+@@ -317,6 +330,14 @@
+ WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
+ return (jint)HeapRegion::GrainBytes;
+ WB_END
++
++WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
++ ResourceMark rm(THREAD);
++ G1CollectedHeap* g1h = G1CollectedHeap::heap();
++ MemoryUsage usage = g1h->get_auxiliary_data_memory_usage();
++ Handle h = MemoryService::create_MemoryUsage_obj(usage, CHECK_NULL);
++ return JNIHandles::make_local(env, h());
++WB_END
+ #endif // INCLUDE_ALL_GCS
+
+ #if INCLUDE_NMT
+@@ -884,6 +905,16 @@
+ return (jlong) MetaspaceGC::capacity_until_GC();
+ WB_END
+
++WB_ENTRY(jboolean, WB_IsMonitorInflated(JNIEnv* env, jobject wb, jobject obj))
++ oop obj_oop = JNIHandles::resolve(obj);
++ return (jboolean) obj_oop->mark()->has_monitor();
++WB_END
++
++WB_ENTRY(void, WB_ForceSafepoint(JNIEnv* env, jobject wb))
++ VM_ForceSafepoint force_safepoint_op;
++ VMThread::execute(&force_safepoint_op);
++WB_END
++
+ //Some convenience methods to deal with objects from java
+ int WhiteBox::offset_for_field(const char* field_name, oop object,
+ Symbol* signature_symbol) {
+@@ -906,7 +937,7 @@
+ if (res == NULL) {
+ tty->print_cr("Invalid layout of %s at %s", ik->external_name(),
+ name_symbol->as_C_string());
+- fatal("Invalid layout of preloaded class");
++ vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class");
+ }
+
+ //fetch the field at the offset we've found
+@@ -972,6 +1003,8 @@
+ {CC"getObjectSize", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize },
+ {CC"isObjectInOldGen", CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen },
+ {CC"getHeapOopSize", CC"()I", (void*)&WB_GetHeapOopSize },
++ {CC"getVMPageSize", CC"()I", (void*)&WB_GetVMPageSize },
++ {CC"getVMLargePageSize", CC"()J", (void*)&WB_GetVMLargePageSize},
+ {CC"isClassAlive0", CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive },
+ {CC"classKnownToNotExist",
+ CC"(Ljava/lang/ClassLoader;Ljava/lang/String;)Z",(void*)&WB_ClassKnownToNotExist},
+@@ -995,8 +1028,11 @@
+ #if INCLUDE_ALL_GCS
+ {CC"g1InConcurrentMark", CC"()Z", (void*)&WB_G1InConcurrentMark},
+ {CC"g1IsHumongous", CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous },
++ {CC"g1NumMaxRegions", CC"()J", (void*)&WB_G1NumMaxRegions },
+ {CC"g1NumFreeRegions", CC"()J", (void*)&WB_G1NumFreeRegions },
+ {CC"g1RegionSize", CC"()I", (void*)&WB_G1RegionSize },
++ {CC"g1AuxiliaryMemoryUsage", CC"()Ljava/lang/management/MemoryUsage;",
++ (void*)&WB_G1AuxiliaryMemoryUsage },
+ #endif // INCLUDE_ALL_GCS
+ #if INCLUDE_NMT
+ {CC"NMTMalloc", CC"(J)J", (void*)&WB_NMTMalloc },
+@@ -1067,6 +1103,8 @@
+ {CC"getCPUFeatures", CC"()Ljava/lang/String;", (void*)&WB_GetCPUFeatures },
+ {CC"getNMethod", CC"(Ljava/lang/reflect/Executable;Z)[Ljava/lang/Object;",
+ (void*)&WB_GetNMethod },
++ {CC"isMonitorInflated", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsMonitorInflated },
++ {CC"forceSafepoint", CC"()V", (void*)&WB_ForceSafepoint },
+ };
+
+ #undef CC
+--- ./hotspot/src/share/vm/runtime/arguments.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/arguments.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1372,6 +1372,12 @@
+ if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
+ CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight);
+ }
++
++ if (!ClassUnloading) {
++ FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
++ FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false);
++ }
++
+ if (PrintGCDetails && Verbose) {
+ tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
+ (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
+@@ -1572,7 +1578,7 @@
+
+ void Arguments::select_gc() {
+ if (!gc_selected()) {
+- ArgumentsExt::select_gc_ergonomically();
++ select_gc_ergonomically();
+ }
+ }
+
+@@ -2067,7 +2073,7 @@
+ }
+
+ // Check consistency of GC selection
+-bool Arguments::check_gc_consistency_user() {
++bool Arguments::check_gc_consistency() {
+ check_gclog_consistency();
+ bool status = true;
+ // Ensure that the user has not selected conflicting sets
+@@ -2233,7 +2239,7 @@
+ FLAG_SET_DEFAULT(UseGCOverheadLimit, false);
+ }
+
+- status = status && check_gc_consistency_user();
++ status = status && check_gc_consistency();
+ status = status && check_stack_pages();
+
+ if (CMSIncrementalMode) {
+@@ -3837,8 +3843,8 @@
+ CommandLineFlags::printFlags(tty, false);
+ vm_exit(0);
+ }
++ if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
+ #if INCLUDE_NMT
+- if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
+ // The launcher did not setup nmt environment variable properly.
+ if (!MemTracker::check_launcher_nmt_support(tail)) {
+ warning("Native Memory Tracking did not setup properly, using wrong launcher?");
+@@ -3853,8 +3859,12 @@
+ } else {
+ vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
+ }
++#else
++ jio_fprintf(defaultStream::error_stream(),
++ "Native Memory Tracking is not supported in this VM\n");
++ return JNI_ERR;
++#endif
+ }
+-#endif
+
+
+ #ifndef PRODUCT
+@@ -4006,7 +4016,7 @@
+ set_shared_spaces_flags();
+
+ // Check the GC selections again.
+- if (!ArgumentsExt::check_gc_consistency_ergo()) {
++ if (!check_gc_consistency()) {
+ return JNI_EINVAL;
+ }
+
+--- ./hotspot/src/share/vm/runtime/arguments.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/arguments.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -466,8 +466,7 @@
+ static bool verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio);
+
+ // Check for consistency in the selection of the garbage collector.
+- static bool check_gc_consistency_user(); // Check user-selected gc
+- static inline bool check_gc_consistency_ergo(); // Check ergonomic-selected gc
++ static bool check_gc_consistency(); // Check user-selected gc
+ static void check_deprecated_gcs();
+ static void check_deprecated_gc_flags();
+ // Check consistecy or otherwise of VM argument settings
+@@ -615,8 +614,4 @@
+ UseParNewGC || UseSerialGC;
+ }
+
+-bool Arguments::check_gc_consistency_ergo() {
+- return check_gc_consistency_user();
+-}
+-
+ #endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP
+--- ./hotspot/src/share/vm/runtime/arguments_ext.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/arguments_ext.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -30,22 +30,12 @@
+
+ class ArgumentsExt: AllStatic {
+ public:
+- static inline void select_gc_ergonomically();
+ static inline void set_gc_specific_flags();
+- static inline bool check_gc_consistency_ergo();
+ static void process_options(const JavaVMInitArgs* args) {}
+ };
+
+-void ArgumentsExt::select_gc_ergonomically() {
+- Arguments::select_gc_ergonomically();
+-}
+-
+ void ArgumentsExt::set_gc_specific_flags() {
+ Arguments::set_gc_specific_flags();
+ }
+
+-bool ArgumentsExt::check_gc_consistency_ergo() {
+- return Arguments::check_gc_consistency_ergo();
+-}
+-
+ #endif // SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
+--- ./hotspot/src/share/vm/runtime/basicLock.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/basicLock.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -28,6 +28,9 @@
+
+ void BasicLock::print_on(outputStream* st) const {
+ st->print("monitor");
++ markOop moop = displaced_header();
++ if (moop != NULL)
++ moop->print_on(st);
+ }
+
+ void BasicLock::move_to(oop obj, BasicLock* dest) {
+--- ./hotspot/src/share/vm/runtime/deoptimization.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/deoptimization.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -66,25 +66,17 @@
+ # include "vmreg_ppc.inline.hpp"
+ #endif
+ #ifdef COMPILER2
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined AD_MD_HPP
++# include AD_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/ad_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/ad_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/ad_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/ad_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/ad_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/ad_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/ad_ppc_64.hpp"
+ #endif
+ #endif // COMPILER2
+@@ -1477,7 +1469,10 @@
+ //
+ // The other actions cause immediate removal of the present code.
+
+- bool update_trap_state = true;
++ // Traps caused by injected profile shouldn't pollute trap counts.
++ bool injected_profile_trap = trap_method->has_injected_profile() &&
++ (reason == Reason_intrinsic || reason == Reason_unreached);
++ bool update_trap_state = !injected_profile_trap;
+ bool make_not_entrant = false;
+ bool make_not_compilable = false;
+ bool reprofile = false;
+--- ./hotspot/src/share/vm/runtime/frame.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/frame.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -31,25 +31,17 @@
+ #include "runtime/registerMap.hpp"
+ #include "utilities/top.hpp"
+ #ifdef COMPILER2
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined ADGLOBALS_MD_HPP
++# include ADGLOBALS_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/adGlobals_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/adGlobals_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/adGlobals_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/adGlobals_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/adGlobals_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/adGlobals_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/adGlobals_ppc_64.hpp"
+ #endif
+ #endif // COMPILER2
+@@ -91,6 +83,15 @@
+ // Constructors
+ frame();
+
++#ifndef PRODUCT
++ // This is a generic constructor which is only used by pns() in debug.cpp.
++ // pns (i.e. print native stack) uses this constructor to create a starting
++ // frame for stack walking. The implementation of this constructor is platform
++ // dependent (i.e. SPARC doesn't need an 'fp' argument an will ignore it) but
++ // we want to keep the signature generic because pns() is shared code.
++ frame(void* sp, void* fp, void* pc);
++#endif
++
+ // Accessors
+
+ // pc: Returns the pc at which this frame will continue normally.
+--- ./hotspot/src/share/vm/runtime/globals.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/globals.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1494,7 +1494,7 @@
+ "How much the GC can expand the eden by while the GC locker " \
+ "is active (as a percentage)") \
+ \
+- diagnostic(intx, GCLockerRetryAllocationCount, 2, \
++ diagnostic(uintx, GCLockerRetryAllocationCount, 2, \
+ "Number of times to retry allocations when " \
+ "blocked by the GC locker") \
+ \
+@@ -2048,9 +2048,6 @@
+ "Provide more detailed and expensive TLAB statistics " \
+ "(with PrintTLAB)") \
+ \
+- EMBEDDED_ONLY(product(bool, LowMemoryProtection, true, \
+- "Enable LowMemoryProtection")) \
+- \
+ product_pd(bool, NeverActAsServerClassMachine, \
+ "Never act like a server-class machine") \
+ \
+@@ -3943,7 +3940,11 @@
+ "Enable event-based tracing") \
+ \
+ product(bool, UseLockedTracing, false, \
+- "Use locked-tracing when doing event-based tracing")
++ "Use locked-tracing when doing event-based tracing") \
++ \
++ product_pd(bool, PreserveFramePointer, \
++ "Use the FP register for holding the frame pointer " \
++ "and not as a general purpose register.")
+
+ /*
+ * Macros for factoring of globals
+--- ./hotspot/src/share/vm/runtime/interfaceSupport.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/interfaceSupport.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -185,19 +185,22 @@
+
+ # endif
+
+-
++// invocation counter for InterfaceSupport::deoptimizeAll/zombieAll functions
+ int deoptimizeAllCounter = 0;
+ int zombieAllCounter = 0;
+
+-
+ void InterfaceSupport::zombieAll() {
+- if (is_init_completed() && zombieAllCounter > ZombieALotInterval) {
++ // This method is called by all threads when a thread make
++ // transition to VM state (for example, runtime calls).
++ // Divide number of calls by number of threads to avoid
++ // dependence of ZombieAll events frequency on number of threads.
++ int value = zombieAllCounter / Threads::number_of_threads();
++ if (is_init_completed() && value > ZombieALotInterval) {
+ zombieAllCounter = 0;
+ VM_ZombieAll op;
+ VMThread::execute(&op);
+- } else {
+- zombieAllCounter++;
+ }
++ zombieAllCounter++;
+ }
+
+ void InterfaceSupport::unlinkSymbols() {
+@@ -206,12 +209,17 @@
+ }
+
+ void InterfaceSupport::deoptimizeAll() {
+- if (is_init_completed() ) {
+- if (DeoptimizeALot && deoptimizeAllCounter > DeoptimizeALotInterval) {
++ // This method is called by all threads when a thread make
++ // transition to VM state (for example, runtime calls).
++ // Divide number of calls by number of threads to avoid
++ // dependence of DeoptimizeAll events frequency on number of threads.
++ int value = deoptimizeAllCounter / Threads::number_of_threads();
++ if (is_init_completed()) {
++ if (DeoptimizeALot && value > DeoptimizeALotInterval) {
+ deoptimizeAllCounter = 0;
+ VM_DeoptimizeAll op;
+ VMThread::execute(&op);
+- } else if (DeoptimizeRandom && (deoptimizeAllCounter & 0x1f) == (os::random() & 0x1f)) {
++ } else if (DeoptimizeRandom && (value & 0x1F) == (os::random() & 0x1F)) {
+ VM_DeoptimizeAll op;
+ VMThread::execute(&op);
+ }
+--- ./hotspot/src/share/vm/runtime/jniHandles.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/jniHandles.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -296,6 +296,7 @@
+ block->_top = 0;
+ block->_next = NULL;
+ block->_pop_frame_link = NULL;
++ block->_planned_capacity = block_size_in_oops;
+ // _last, _free_list & _allocate_before_rebuild initialized in allocate_handle
+ debug_only(block->_last = NULL);
+ debug_only(block->_free_list = NULL);
+@@ -529,6 +530,12 @@
+ return result;
+ }
+
++const size_t JNIHandleBlock::get_number_of_live_handles() {
++ CountHandleClosure counter;
++ oops_do(&counter);
++ return counter.count();
++}
++
+ // This method is not thread-safe, i.e., must be called whule holding a lock on the
+ // structure.
+ long JNIHandleBlock::memory_usage() const {
+--- ./hotspot/src/share/vm/runtime/jniHandles.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/jniHandles.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -112,6 +112,9 @@
+ oop* _free_list; // Handle free list
+ int _allocate_before_rebuild; // Number of blocks to allocate before rebuilding free list
+
++ // Check JNI, "planned capacity" for current frame (or push/ensure)
++ size_t _planned_capacity;
++
+ #ifndef PRODUCT
+ JNIHandleBlock* _block_list_link; // Link for list below
+ static JNIHandleBlock* _block_list; // List of all allocated blocks (for debugging only)
+@@ -152,6 +155,11 @@
+ // Traversal of weak handles. Unreachable oops are cleared.
+ void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
+
++ // Checked JNI support
++ void set_planned_capacity(size_t planned_capacity) { _planned_capacity = planned_capacity; }
++ const size_t get_planned_capacity() { return _planned_capacity; }
++ const size_t get_number_of_live_handles();
++
+ // Debugging
+ bool chain_contains(jobject handle) const; // Does this block or following blocks contain handle
+ bool contains(jobject handle) const; // Does this block contain handle
+--- ./hotspot/src/share/vm/runtime/mutexLocker.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/mutexLocker.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -119,7 +119,6 @@
+ Mutex* OldSets_lock = NULL;
+ Monitor* RootRegionScan_lock = NULL;
+ Mutex* MMUTracker_lock = NULL;
+-Mutex* HotCardCache_lock = NULL;
+
+ Monitor* GCTaskManager_lock = NULL;
+
+@@ -135,6 +134,10 @@
+ Mutex* JfrThreadGroups_lock = NULL;
+ #endif
+
++#ifndef SUPPORTS_NATIVE_CX8
++Mutex* UnsafeJlong_lock = NULL;
++#endif
++
+ #define MAX_NUM_MUTEX 128
+ static Monitor * _mutex_array[MAX_NUM_MUTEX];
+ static int _num_mutex;
+@@ -196,7 +199,6 @@
+ def(OldSets_lock , Mutex , leaf , true );
+ def(RootRegionScan_lock , Monitor, leaf , true );
+ def(MMUTracker_lock , Mutex , leaf , true );
+- def(HotCardCache_lock , Mutex , special , true );
+ def(EvacFailureStack_lock , Mutex , nonleaf , true );
+
+ def(StringDedupQueue_lock , Monitor, leaf, true );
+@@ -280,12 +282,15 @@
+
+ #ifdef INCLUDE_TRACE
+ def(JfrMsg_lock , Monitor, leaf, true);
+- def(JfrBuffer_lock , Mutex, nonleaf+1, true);
+- def(JfrThreadGroups_lock , Mutex, nonleaf+1, true);
+- def(JfrStream_lock , Mutex, nonleaf+2, true);
+- def(JfrStacktrace_lock , Mutex, special, true );
++ def(JfrBuffer_lock , Mutex, leaf, true);
++ def(JfrThreadGroups_lock , Mutex, leaf, true);
++ def(JfrStream_lock , Mutex, nonleaf, true);
++ def(JfrStacktrace_lock , Mutex, special, true);
+ #endif
+
++#ifndef SUPPORTS_NATIVE_CX8
++ def(UnsafeJlong_lock , Mutex, special, false);
++#endif
+ }
+
+ GCMutexLocker::GCMutexLocker(Monitor * mutex) {
+--- ./hotspot/src/share/vm/runtime/mutexLocker.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/mutexLocker.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -137,7 +137,6 @@
+ extern Monitor* RootRegionScan_lock; // used to notify that the CM threads have finished scanning the IM snapshot regions
+ extern Mutex* MMUTracker_lock; // protects the MMU
+ // tracker data structures
+-extern Mutex* HotCardCache_lock; // protects the hot card cache
+
+ extern Mutex* Management_lock; // a lock used to serialize JVM management
+ extern Monitor* Service_lock; // a lock used for service thread operation
+@@ -151,6 +150,10 @@
+ extern Mutex* JfrThreadGroups_lock; // protects JFR access to Thread Groups
+ #endif
+
++#ifndef SUPPORTS_NATIVE_CX8
++extern Mutex* UnsafeJlong_lock; // provides Unsafe atomic updates to jlongs on platforms that don't support cx8
++#endif
++
+ // A MutexLocker provides mutual exclusion with respect to a given mutex
+ // for the scope which contains the locker. The lock is an OS lock, not
+ // an object lock, and the two do not interoperate. Do not use Mutex-based
+--- ./hotspot/src/share/vm/runtime/os.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/os.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1315,24 +1315,17 @@
+ return (sp > (stack_limit + reserved_area));
+ }
+
+-size_t os::page_size_for_region(size_t region_min_size, size_t region_max_size,
+- uint min_pages)
+-{
++size_t os::page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned) {
+ assert(min_pages > 0, "sanity");
+ if (UseLargePages) {
+- const size_t max_page_size = region_max_size / min_pages;
++ const size_t max_page_size = region_size / min_pages;
+
+- for (unsigned int i = 0; _page_sizes[i] != 0; ++i) {
+- const size_t sz = _page_sizes[i];
+- const size_t mask = sz - 1;
+- if ((region_min_size & mask) == 0 && (region_max_size & mask) == 0) {
+- // The largest page size with no fragmentation.
+- return sz;
+- }
+-
+- if (sz <= max_page_size) {
+- // The largest page size that satisfies the min_pages requirement.
+- return sz;
++ for (size_t i = 0; _page_sizes[i] != 0; ++i) {
++ const size_t page_size = _page_sizes[i];
++ if (page_size <= max_page_size) {
++ if (!must_be_aligned || is_size_aligned(region_size, page_size)) {
++ return page_size;
++ }
+ }
+ }
+ }
+@@ -1340,6 +1333,14 @@
+ return vm_page_size();
+ }
+
++size_t os::page_size_for_region_aligned(size_t region_size, size_t min_pages) {
++ return page_size_for_region(region_size, min_pages, true);
++}
++
++size_t os::page_size_for_region_unaligned(size_t region_size, size_t min_pages) {
++ return page_size_for_region(region_size, min_pages, false);
++}
++
+ #ifndef PRODUCT
+ void os::trace_page_sizes(const char* str, const size_t* page_sizes, int count)
+ {
+@@ -1513,6 +1514,11 @@
+ return res;
+ }
+
++void os::pretouch_memory(char* start, char* end) {
++ for (volatile char *p = start; p < end; p += os::vm_page_size()) {
++ *p = 0;
++ }
++}
+
+ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
+ char *addr, size_t bytes, bool read_only,
+@@ -1569,3 +1575,95 @@
+ return result;
+ }
+ #endif
++
++/////////////// Unit tests ///////////////
++
++#ifndef PRODUCT
++
++#define assert_eq(a,b) assert(a == b, err_msg(SIZE_FORMAT " != " SIZE_FORMAT, a, b))
++
++class TestOS : AllStatic {
++ static size_t small_page_size() {
++ return os::vm_page_size();
++ }
++
++ static size_t large_page_size() {
++ const size_t large_page_size_example = 4 * M;
++ return os::page_size_for_region_aligned(large_page_size_example, 1);
++ }
++
++ static void test_page_size_for_region_aligned() {
++ if (UseLargePages) {
++ const size_t small_page = small_page_size();
++ const size_t large_page = large_page_size();
++
++ if (large_page > small_page) {
++ size_t num_small_pages_in_large = large_page / small_page;
++ size_t page = os::page_size_for_region_aligned(large_page, num_small_pages_in_large);
++
++ assert_eq(page, small_page);
++ }
++ }
++ }
++
++ static void test_page_size_for_region_alignment() {
++ if (UseLargePages) {
++ const size_t small_page = small_page_size();
++ const size_t large_page = large_page_size();
++ if (large_page > small_page) {
++ const size_t unaligned_region = large_page + 17;
++ size_t page = os::page_size_for_region_aligned(unaligned_region, 1);
++ assert_eq(page, small_page);
++
++ const size_t num_pages = 5;
++ const size_t aligned_region = large_page * num_pages;
++ page = os::page_size_for_region_aligned(aligned_region, num_pages);
++ assert_eq(page, large_page);
++ }
++ }
++ }
++
++ static void test_page_size_for_region_unaligned() {
++ if (UseLargePages) {
++ // Given exact page size, should return that page size.
++ for (size_t i = 0; os::_page_sizes[i] != 0; i++) {
++ size_t expected = os::_page_sizes[i];
++ size_t actual = os::page_size_for_region_unaligned(expected, 1);
++ assert_eq(expected, actual);
++ }
++
++ // Given slightly larger size than a page size, return the page size.
++ for (size_t i = 0; os::_page_sizes[i] != 0; i++) {
++ size_t expected = os::_page_sizes[i];
++ size_t actual = os::page_size_for_region_unaligned(expected + 17, 1);
++ assert_eq(expected, actual);
++ }
++
++ // Given a slightly smaller size than a page size,
++ // return the next smaller page size.
++ if (os::_page_sizes[1] > os::_page_sizes[0]) {
++ size_t expected = os::_page_sizes[0];
++ size_t actual = os::page_size_for_region_unaligned(os::_page_sizes[1] - 17, 1);
++ assert_eq(actual, expected);
++ }
++
++ // Return small page size for values less than a small page.
++ size_t small_page = small_page_size();
++ size_t actual = os::page_size_for_region_unaligned(small_page - 17, 1);
++ assert_eq(small_page, actual);
++ }
++ }
++
++ public:
++ static void run_tests() {
++ test_page_size_for_region_aligned();
++ test_page_size_for_region_alignment();
++ test_page_size_for_region_unaligned();
++ }
++};
++
++void TestOS_test() {
++ TestOS::run_tests();
++}
++
++#endif // PRODUCT
+--- ./hotspot/src/share/vm/runtime/os.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/os.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -149,6 +149,7 @@
+ static void pd_free_memory(char *addr, size_t bytes, size_t alignment_hint);
+ static void pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint);
+
++ static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned);
+
+ public:
+ static void init(void); // Called before command line parsing
+@@ -159,7 +160,6 @@
+ static void init_globals(void) { // Called from init_globals() in init.cpp
+ init_globals_ext();
+ }
+- static void init_3(void); // Called at the end of vm init
+
+ // File names are case-insensitive on windows only
+ // Override me as needed
+@@ -266,19 +266,16 @@
+ // Return the default page size.
+ static int vm_page_size();
+
+- // Return the page size to use for a region of memory. The min_pages argument
+- // is a hint intended to limit fragmentation; it says the returned page size
+- // should be <= region_max_size / min_pages. Because min_pages is a hint,
+- // this routine may return a size larger than region_max_size / min_pages.
+- //
+- // The current implementation ignores min_pages if a larger page size is an
+- // exact multiple of both region_min_size and region_max_size. This allows
+- // larger pages to be used when doing so would not cause fragmentation; in
+- // particular, a single page can be used when region_min_size ==
+- // region_max_size == a supported page size.
+- static size_t page_size_for_region(size_t region_min_size,
+- size_t region_max_size,
+- uint min_pages);
++ // Returns the page size to use for a region of memory.
++ // region_size / min_pages will always be greater than or equal to the
++ // returned value. The returned value will divide region_size.
++ static size_t page_size_for_region_aligned(size_t region_size, size_t min_pages);
++
++ // Returns the page size to use for a region of memory.
++ // region_size / min_pages will always be greater than or equal to the
++ // returned value. The returned value might not divide region_size.
++ static size_t page_size_for_region_unaligned(size_t region_size, size_t min_pages);
++
+ // Return the largest page size that can be used
+ static size_t max_page_size() {
+ // The _page_sizes array is sorted in descending order.
+@@ -320,6 +317,12 @@
+ static bool uncommit_memory(char* addr, size_t bytes);
+ static bool release_memory(char* addr, size_t bytes);
+
++ // Touch memory pages that cover the memory range from start to end (exclusive)
++ // to make the OS back the memory range with actual memory.
++ // Current implementation may not touch the last page if unaligned addresses
++ // are passed.
++ static void pretouch_memory(char* start, char* end);
++
+ enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX };
+ static bool protect_memory(char* addr, size_t bytes, ProtType prot,
+ bool is_committed = true);
+--- ./hotspot/src/share/vm/runtime/reflection.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/reflection.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -36,6 +36,7 @@
+ #include "oops/objArrayKlass.hpp"
+ #include "oops/objArrayOop.hpp"
+ #include "prims/jvm.h"
++#include "prims/jvmtiExport.hpp"
+ #include "runtime/arguments.hpp"
+ #include "runtime/handles.inline.hpp"
+ #include "runtime/javaCalls.hpp"
+@@ -942,6 +943,11 @@
+ // Method resolution threw an exception; wrap it in an InvocationTargetException
+ oop resolution_exception = PENDING_EXCEPTION;
+ CLEAR_PENDING_EXCEPTION;
++ // JVMTI has already reported the pending exception
++ // JVMTI internal flag reset is needed in order to report InvocationTargetException
++ if (THREAD->is_Java_thread()) {
++ JvmtiExport::clear_detected_exception((JavaThread*) THREAD);
++ }
+ JavaCallArguments args(Handle(THREAD, resolution_exception));
+ THROW_ARG_0(vmSymbols::java_lang_reflect_InvocationTargetException(),
+ vmSymbols::throwable_void_signature(),
+@@ -1074,6 +1080,12 @@
+ // Method threw an exception; wrap it in an InvocationTargetException
+ oop target_exception = PENDING_EXCEPTION;
+ CLEAR_PENDING_EXCEPTION;
++ // JVMTI has already reported the pending exception
++ // JVMTI internal flag reset is needed in order to report InvocationTargetException
++ if (THREAD->is_Java_thread()) {
++ JvmtiExport::clear_detected_exception((JavaThread*) THREAD);
++ }
++
+ JavaCallArguments args(Handle(THREAD, target_exception));
+ THROW_ARG_0(vmSymbols::java_lang_reflect_InvocationTargetException(),
+ vmSymbols::throwable_void_signature(),
+--- ./hotspot/src/share/vm/runtime/sharedRuntime.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/sharedRuntime.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1230,7 +1230,7 @@
+ #endif
+
+ // JSR 292 key invariant:
+- // If the resolved method is a MethodHandle invoke target the call
++ // If the resolved method is a MethodHandle invoke target, the call
+ // site must be a MethodHandle call site, because the lambda form might tail-call
+ // leaving the stack in a state unknown to either caller or callee
+ // TODO detune for now but we might need it again
+--- ./hotspot/src/share/vm/runtime/stubRoutines.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/stubRoutines.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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,29 +99,20 @@
+
+ // Dependencies
+ friend class StubGenerator;
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined STUBROUTINES_MD_HPP
++# include STUBROUTINES_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "stubRoutines_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "stubRoutines_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "stubRoutines_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "stubRoutines_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "stubRoutines_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "stubRoutines_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "stubRoutines_ppc_64.hpp"
+ #endif
+
+-
+ static jint _verify_oop_count;
+ static address _verify_oop_subroutine_entry;
+
+--- ./hotspot/src/share/vm/runtime/thread.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/thread.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -1465,6 +1465,7 @@
+ _thread_stat = new ThreadStatistics();
+ _blocked_on_compilation = false;
+ _jni_active_critical = 0;
++ _pending_jni_exception_check_fn = NULL;
+ _do_not_unlock_if_synchronized = false;
+ _cached_monitor_info = NULL;
+ _parker = Parker::Allocate(this) ;
+@@ -3689,9 +3690,6 @@
+ }
+ }
+
+- // Give os specific code one last chance to start
+- os::init_3();
+-
+ create_vm_timer.end();
+ #ifdef ASSERT
+ _vm_complete = true;
+--- ./hotspot/src/share/vm/runtime/thread.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/thread.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -926,6 +926,9 @@
+ // support for JNI critical regions
+ jint _jni_active_critical; // count of entries into JNI critical region
+
++ // Checked JNI: function name requires exception check
++ char* _pending_jni_exception_check_fn;
++
+ // For deadlock detection.
+ int _depth_first_number;
+
+@@ -1408,6 +1411,12 @@
+ assert(_jni_active_critical >= 0,
+ "JNI critical nesting problem?"); }
+
++ // Checked JNI, is the programmer required to check for exceptions, specify which function name
++ bool is_pending_jni_exception_check() const { return _pending_jni_exception_check_fn != NULL; }
++ void clear_pending_jni_exception_check() { _pending_jni_exception_check_fn = NULL; }
++ const char* get_pending_jni_exception_check() const { return _pending_jni_exception_check_fn; }
++ void set_pending_jni_exception_check(const char* fn_name) { _pending_jni_exception_check_fn = (char*) fn_name; }
++
+ // For deadlock detection
+ int depth_first_number() { return _depth_first_number; }
+ void set_depth_first_number(int dfn) { _depth_first_number = dfn; }
+--- ./hotspot/src/share/vm/runtime/vframe.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/vframe.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -189,6 +189,7 @@
+ if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code
+ if (monitor->owner_is_scalar_replaced()) {
+ Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
++ // format below for lockbits matches this one.
+ st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name());
+ } else {
+ oop obj = monitor->owner();
+@@ -206,9 +207,10 @@
+ // see if we have completed the lock or we are blocked trying to
+ // acquire it - we can only be blocked if the monitor is inflated
+
++ markOop mark = NULL;
+ const char *lock_state = "locked"; // assume we have the monitor locked
+ if (!found_first_monitor && frame_count == 0) {
+- markOop mark = monitor->owner()->mark();
++ mark = monitor->owner()->mark();
+ if (mark->has_monitor() &&
+ ( // we have marked ourself as pending on this monitor
+ mark->monitor() == thread()->current_pending_monitor() ||
+@@ -216,11 +218,19 @@
+ !mark->monitor()->is_entered(thread())
+ )) {
+ lock_state = "waiting to lock";
++ } else {
++ mark = NULL; // Disable printing below
+ }
+ }
++ print_locked_object_class_name(st, monitor->owner(), lock_state);
++ if (Verbose && mark != NULL) {
++ // match with format above, replacing "-" with " ".
++ st->print("\t lockbits=");
++ mark->print_on(st);
++ st->cr();
++ }
+
+ found_first_monitor = true;
+- print_locked_object_class_name(st, monitor->owner(), lock_state);
+ }
+ }
+ }
+@@ -578,10 +588,15 @@
+ tty->print("( null )");
+ } else {
+ monitor->owner()->print_value();
+- tty->print("(" INTPTR_FORMAT ")", (address)monitor->owner());
++ tty->print("(owner=" INTPTR_FORMAT ")", (address)monitor->owner());
+ }
+- if (monitor->eliminated() && is_compiled_frame())
+- tty->print(" ( lock is eliminated )");
++ if (monitor->eliminated()) {
++ if(is_compiled_frame()) {
++ tty->print(" ( lock is eliminated in compiled frame )");
++ } else {
++ tty->print(" ( lock is eliminated, frame not compiled )");
++ }
++ }
+ tty->cr();
+ tty->print("\t ");
+ monitor->lock()->print_on(tty);
+--- ./hotspot/src/share/vm/runtime/vframe.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/vframe.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -389,12 +389,12 @@
+ decode_offset < 0 ||
+ decode_offset >= nm()->scopes_data_size()) {
+ // 6379830 AsyncGetCallTrace sometimes feeds us wild frames.
+- // If we attempt to read nmethod::scopes_data at serialized_null (== 0),
+- // or if we read some at other crazy offset,
+- // we will decode garbage and make wild references into the heap,
+- // leading to crashes in product mode.
+- // (This isn't airtight, of course, since there are internal
+- // offsets which are also crazy.)
++ // If we read nmethod::scopes_data at serialized_null (== 0)
++ // or if read some at other invalid offset, invalid values will be decoded.
++ // Based on these values, invalid heap locations could be referenced
++ // that could lead to crashes in product mode.
++ // Therefore, do not use the decode offset if invalid, but fill the frame
++ // as it were a native compiled frame (no Java-level assumptions).
+ #ifdef ASSERT
+ if (WizardMode) {
+ tty->print_cr("Error in fill_from_frame: pc_desc for "
+@@ -514,9 +514,15 @@
+ intptr_t bcx = _frame.interpreter_frame_bcx();
+ int bci = method->validate_bci_from_bcx(bcx);
+ // 6379830 AsyncGetCallTrace sometimes feeds us wild frames.
++ // AsyncGetCallTrace interrupts the VM asynchronously. As a result
++ // it is possible to access an interpreter frame for which
++ // no Java-level information is yet available (e.g., becasue
++ // the frame was being created when the VM interrupted it).
++ // In this scenario, pretend that the interpreter is at the point
++ // of entering the method.
+ if (bci < 0) {
+ found_bad_method_frame();
+- bci = 0; // pretend it's on the point of entering
++ bci = 0;
+ }
+ _mode = interpreted_mode;
+ _method = method;
+--- ./hotspot/src/share/vm/runtime/virtualspace.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/virtualspace.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -52,12 +52,22 @@
+ _alignment(0), _special(false), _executable(false) {
+ }
+
+-ReservedSpace::ReservedSpace(size_t size) {
+- size_t page_size = os::page_size_for_region(size, size, 1);
++ReservedSpace::ReservedSpace(size_t size, size_t preferred_page_size) {
++ bool has_preferred_page_size = preferred_page_size != 0;
++ // Want to use large pages where possible and pad with small pages.
++ size_t page_size = has_preferred_page_size ? preferred_page_size : os::page_size_for_region_unaligned(size, 1);
+ bool large_pages = page_size != (size_t)os::vm_page_size();
+- // Don't force the alignment to be large page aligned,
+- // since that will waste memory.
+- size_t alignment = os::vm_allocation_granularity();
++ size_t alignment;
++ if (large_pages && has_preferred_page_size) {
++ alignment = MAX2(page_size, (size_t)os::vm_allocation_granularity());
++ // ReservedSpace initialization requires size to be aligned to the given
++ // alignment. Align the size up.
++ size = align_size_up(size, alignment);
++ } else {
++ // Don't force the alignment to be large page aligned,
++ // since that will waste memory.
++ alignment = os::vm_allocation_granularity();
++ }
+ initialize(size, alignment, large_pages, NULL, 0, false);
+ }
+
+@@ -372,7 +382,7 @@
+
+
+ bool VirtualSpace::initialize(ReservedSpace rs, size_t committed_size) {
+- const size_t max_commit_granularity = os::page_size_for_region(rs.size(), rs.size(), 1);
++ const size_t max_commit_granularity = os::page_size_for_region_unaligned(rs.size(), 1);
+ return initialize_with_granularity(rs, committed_size, max_commit_granularity);
+ }
+
+@@ -630,19 +640,7 @@
+ }
+
+ if (pre_touch || AlwaysPreTouch) {
+- int vm_ps = os::vm_page_size();
+- for (char* curr = previous_high;
+- curr < unaligned_new_high;
+- curr += vm_ps) {
+- // Note the use of a write here; originally we tried just a read, but
+- // since the value read was unused, the optimizer removed the read.
+- // If we ever have a concurrent touchahead thread, we'll want to use
+- // a read, to avoid the potential of overwriting data (if a mutator
+- // thread beats the touchahead thread to a page). There are various
+- // ways of making sure this read is not optimized away: for example,
+- // generating the code for a read procedure at runtime.
+- *curr = 0;
+- }
++ os::pretouch_memory(previous_high, unaligned_new_high);
+ }
+
+ _high += bytes;
+@@ -1007,7 +1005,7 @@
+ case Disable:
+ return vs.initialize_with_granularity(rs, 0, os::vm_page_size());
+ case Commit:
+- return vs.initialize_with_granularity(rs, 0, os::page_size_for_region(rs.size(), rs.size(), 1));
++ return vs.initialize_with_granularity(rs, 0, os::page_size_for_region_unaligned(rs.size(), 1));
+ }
+ }
+
+--- ./hotspot/src/share/vm/runtime/virtualspace.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/virtualspace.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -54,7 +54,11 @@
+ public:
+ // Constructor
+ ReservedSpace();
+- ReservedSpace(size_t size);
++ // Initialize the reserved space with the given size. If preferred_page_size
++ // is set, use this as minimum page size/alignment. This may waste some space
++ // if the given size is not aligned to that value, as the reservation will be
++ // aligned up to the final alignment in this case.
++ ReservedSpace(size_t size, size_t preferred_page_size = 0);
+ ReservedSpace(size_t size, size_t alignment, bool large,
+ char* requested_address = NULL,
+ const size_t noaccess_prefix = 0);
+--- ./hotspot/src/share/vm/runtime/vmStructs.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/vmStructs.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -103,6 +103,7 @@
+ #include "utilities/globalDefinitions.hpp"
+ #include "utilities/hashtable.hpp"
+ #include "utilities/macros.hpp"
++
+ #ifdef TARGET_ARCH_x86
+ # include "vmStructs_x86.hpp"
+ #endif
+@@ -167,6 +168,11 @@
+ #include "gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp"
+ #include "gc_implementation/g1/vmStructs_g1.hpp"
+ #endif // INCLUDE_ALL_GCS
++
++#if INCLUDE_TRACE
++ #include "runtime/vmStructs_trace.hpp"
++#endif
++
+ #ifdef COMPILER2
+ #include "opto/addnode.hpp"
+ #include "opto/block.hpp"
+@@ -186,25 +192,17 @@
+ #include "opto/rootnode.hpp"
+ #include "opto/subnode.hpp"
+ #include "opto/vectornode.hpp"
+-#ifdef TARGET_ARCH_MODEL_x86_32
++#if defined ADGLOBALS_MD_HPP
++# include ADGLOBALS_MD_HPP
++#elif defined TARGET_ARCH_MODEL_x86_32
+ # include "adfiles/adGlobals_x86_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_x86_64
++#elif defined TARGET_ARCH_MODEL_x86_64
+ # include "adfiles/adGlobals_x86_64.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_sparc
++#elif defined TARGET_ARCH_MODEL_sparc
+ # include "adfiles/adGlobals_sparc.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_zero
++#elif defined TARGET_ARCH_MODEL_zero
+ # include "adfiles/adGlobals_zero.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_arm
+-# include "adfiles/adGlobals_arm.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_32
+-# include "adfiles/adGlobals_ppc_32.hpp"
+-#endif
+-#ifdef TARGET_ARCH_MODEL_ppc_64
++#elif defined TARGET_ARCH_MODEL_ppc_64
+ # include "adfiles/adGlobals_ppc_64.hpp"
+ #endif
+ #endif // COMPILER2
+@@ -248,7 +246,6 @@
+ typedef Hashtable<Klass*, mtClass> KlassHashtable;
+ typedef HashtableEntry<Klass*, mtClass> KlassHashtableEntry;
+ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
+-typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > MetablockTreeDictionary;
+
+ //--------------------------------------------------------------------------------
+ // VM_STRUCTS
+@@ -1290,11 +1287,8 @@
+ volatile_nonstatic_field(FreeChunk, _size, size_t) \
+ nonstatic_field(FreeChunk, _next, FreeChunk*) \
+ nonstatic_field(FreeChunk, _prev, FreeChunk*) \
+- nonstatic_field(FreeList<FreeChunk>, _size, size_t) \
+- nonstatic_field(FreeList<Metablock>, _size, size_t) \
+- nonstatic_field(FreeList<FreeChunk>, _count, ssize_t) \
+- nonstatic_field(FreeList<Metablock>, _count, ssize_t) \
+- nonstatic_field(MetablockTreeDictionary, _total_size, size_t)
++ nonstatic_field(AdaptiveFreeList<FreeChunk>, _size, size_t) \
++ nonstatic_field(AdaptiveFreeList<FreeChunk>, _count, ssize_t)
+
+
+ //--------------------------------------------------------------------------------
+@@ -1386,6 +1380,8 @@
+ /* unsigned short on Win32 */ \
+ declare_unsigned_integer_type(u1) \
+ declare_unsigned_integer_type(u2) \
++ declare_unsigned_integer_type(u4) \
++ declare_unsigned_integer_type(u8) \
+ declare_unsigned_integer_type(unsigned) \
+ \
+ /*****************************/ \
+@@ -2166,14 +2162,8 @@
+ \
+ /* freelist */ \
+ declare_toplevel_type(FreeChunk*) \
+- declare_toplevel_type(Metablock*) \
+- declare_toplevel_type(FreeBlockDictionary<FreeChunk>*) \
+- declare_toplevel_type(FreeList<FreeChunk>*) \
+- declare_toplevel_type(FreeList<FreeChunk>) \
+- declare_toplevel_type(FreeBlockDictionary<Metablock>*) \
+- declare_toplevel_type(FreeList<Metablock>*) \
+- declare_toplevel_type(FreeList<Metablock>) \
+- declare_type(MetablockTreeDictionary, FreeBlockDictionary<Metablock>)
++ declare_toplevel_type(AdaptiveFreeList<FreeChunk>*) \
++ declare_toplevel_type(AdaptiveFreeList<FreeChunk>)
+
+
+ //--------------------------------------------------------------------------------
+@@ -2915,6 +2905,11 @@
+ GENERATE_STATIC_VM_STRUCT_ENTRY)
+ #endif // INCLUDE_ALL_GCS
+
++#if INCLUDE_TRACE
++ VM_STRUCTS_TRACE(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
++ GENERATE_STATIC_VM_STRUCT_ENTRY)
++#endif
++
+ VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
+ GENERATE_STATIC_VM_STRUCT_ENTRY,
+ GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY,
+@@ -2960,6 +2955,11 @@
+ GENERATE_TOPLEVEL_VM_TYPE_ENTRY)
+ #endif // INCLUDE_ALL_GCS
+
++#if INCLUDE_TRACE
++ VM_TYPES_TRACE(GENERATE_VM_TYPE_ENTRY,
++ GENERATE_TOPLEVEL_VM_TYPE_ENTRY)
++#endif
++
+ VM_TYPES_CPU(GENERATE_VM_TYPE_ENTRY,
+ GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
+ GENERATE_OOP_VM_TYPE_ENTRY,
+@@ -2995,6 +2995,10 @@
+ VM_INT_CONSTANTS_PARNEW(GENERATE_VM_INT_CONSTANT_ENTRY)
+ #endif // INCLUDE_ALL_GCS
+
++#if INCLUDE_TRACE
++ VM_INT_CONSTANTS_TRACE(GENERATE_VM_INT_CONSTANT_ENTRY)
++#endif
++
+ VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY,
+ GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
+ GENERATE_C1_VM_INT_CONSTANT_ENTRY,
+@@ -3057,8 +3061,14 @@
+
+ VM_STRUCTS_G1(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
+ CHECK_STATIC_VM_STRUCT_ENTRY);
++
+ #endif // INCLUDE_ALL_GCS
+
++#if INCLUDE_TRACE
++ VM_STRUCTS_TRACE(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
++ CHECK_STATIC_VM_STRUCT_ENTRY);
++#endif
++
+ VM_STRUCTS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
+ CHECK_STATIC_VM_STRUCT_ENTRY,
+ CHECK_NO_OP,
+@@ -3097,8 +3107,14 @@
+
+ VM_TYPES_G1(CHECK_VM_TYPE_ENTRY,
+ CHECK_SINGLE_ARG_VM_TYPE_NO_OP);
++
+ #endif // INCLUDE_ALL_GCS
+
++#if INCLUDE_TRACE
++ VM_TYPES_TRACE(CHECK_VM_TYPE_ENTRY,
++ CHECK_SINGLE_ARG_VM_TYPE_NO_OP);
++#endif
++
+ VM_TYPES_CPU(CHECK_VM_TYPE_ENTRY,
+ CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
+ CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
+@@ -3161,6 +3177,12 @@
+ debug_only(VM_STRUCTS_G1(ENSURE_FIELD_TYPE_PRESENT,
+ ENSURE_FIELD_TYPE_PRESENT));
+ #endif // INCLUDE_ALL_GCS
++
++#if INCLUDE_TRACE
++ debug_only(VM_STRUCTS_TRACE(ENSURE_FIELD_TYPE_PRESENT,
++ ENSURE_FIELD_TYPE_PRESENT));
++#endif
++
+ debug_only(VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT,
+ ENSURE_FIELD_TYPE_PRESENT,
+ CHECK_NO_OP,
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/src/share/vm/runtime/vmStructs_trace.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * 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.
++ *
++ */
++
++#ifndef SHARE_VM_RUNTIME_VMSTRUCTS_TRACE_HPP
++#define SHARE_VM_RUNTIME_VMSTRUCTS_TRACE_HPP
++
++#define VM_INT_CONSTANTS_TRACE(a)
++
++#define VM_STRUCTS_TRACE(a, b)
++
++#define VM_TYPES_TRACE(a, b)
++
++
++#endif // SHARE_VM_RUNTIME_VMSTRUCTS_TRACE_HPP
+--- ./hotspot/src/share/vm/runtime/vm_version.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/runtime/vm_version.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -180,17 +180,17 @@
+ AIX_ONLY("aix") \
+ BSD_ONLY("bsd")
+
++#ifndef CPU
+ #ifdef ZERO
+ #define CPU ZERO_LIBARCH
+ #else
+ #define CPU IA32_ONLY("x86") \
+ IA64_ONLY("ia64") \
+ AMD64_ONLY("amd64") \
+- ARM_ONLY("arm") \
+- PPC32_ONLY("ppc") \
+ PPC64_ONLY("ppc64") \
+ SPARC_ONLY("sparc")
+ #endif // ZERO
++#endif
+
+ const char *Abstract_VM_Version::vm_platform_string() {
+ return OS "-" CPU;
+@@ -251,12 +251,6 @@
+ #ifndef FLOAT_ARCH
+ #if defined(__SOFTFP__)
+ #define FLOAT_ARCH_STR "-sflt"
+- #elif defined(E500V2)
+- #define FLOAT_ARCH_STR "-e500v2"
+- #elif defined(ARM)
+- #define FLOAT_ARCH_STR "-vfp"
+- #elif defined(PPC32)
+- #define FLOAT_ARCH_STR "-hflt"
+ #else
+ #define FLOAT_ARCH_STR ""
+ #endif
+--- ./hotspot/src/share/vm/services/classLoadingService.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/services/classLoadingService.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2014, 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
+@@ -52,7 +52,7 @@
+ len = name->utf8_length(); \
+ } \
+ HS_DTRACE_PROBE4(hotspot, class__##type, \
+- data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), (shared)); \
++ data, len, (void *)(clss)->class_loader(), (shared)); \
+ }
+
+ #else /* USDT2 */
+--- ./hotspot/src/share/vm/services/management.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/services/management.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -155,11 +155,14 @@
+ // Load and initialize the sun.management.Agent class
+ // invoke startAgent method to start the management server
+ Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
+- Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(),
++ Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_management_Agent(),
+ loader,
+ Handle(),
+- true,
+- CHECK);
++ THREAD);
++ if (k == NULL) {
++ vm_exit_during_initialization("Management agent initialization failure: "
++ "class sun.management.Agent not found.");
++ }
+ instanceKlassHandle ik (THREAD, k);
+
+ JavaValue result(T_VOID);
+--- ./hotspot/src/share/vm/trace/trace.xml Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/trace/trace.xml Wed Jul 01 21:52:18 2015 -0700
+@@ -1,6 +1,6 @@
+ <?xml version="1.0" encoding="utf-8"?>
+ <!--
+- Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2012, 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
+@@ -352,6 +352,12 @@
+ <value type="UTF8" field="name" label="Name" />
+ </event>
+
++ <event id="AllocationRequiringGC" path="vm/gc/detailed/allocation_requiring_gc" label="Allocation Requiring GC"
++ has_thread="true" has_stacktrace="true" is_instant="true">
++ <value type="UINT" field="gcId" label="Pending GC ID" relation="GC_ID" />
++ <value type="BYTES64" field="size" label="Allocation Size" />
++ </event>
++
+ <!-- Compiler events -->
+
+ <event id="Compilation" path="vm/compiler/compilation" label="Compilation"
+--- ./hotspot/src/share/vm/utilities/accessFlags.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/accessFlags.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -54,7 +54,8 @@
+ JVM_ACC_IS_OLD = 0x00010000, // RedefineClasses() has replaced this method
+ JVM_ACC_IS_OBSOLETE = 0x00020000, // RedefineClasses() has made method obsolete
+ JVM_ACC_IS_PREFIXED_NATIVE = 0x00040000, // JVMTI has prefixed this native method
+- JVM_ACC_ON_STACK = 0x00080000, // RedefinedClasses() is used on the stack
++ JVM_ACC_ON_STACK = 0x00080000, // RedefineClasses() was used on the stack
++ JVM_ACC_IS_DELETED = 0x00008000, // RedefineClasses() has deleted this method
+
+ // Klass* flags
+ JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000, // True if this class has miranda methods in it's vtable
+@@ -131,6 +132,7 @@
+ bool has_jsrs () const { return (_flags & JVM_ACC_HAS_JSRS ) != 0; }
+ bool is_old () const { return (_flags & JVM_ACC_IS_OLD ) != 0; }
+ bool is_obsolete () const { return (_flags & JVM_ACC_IS_OBSOLETE ) != 0; }
++ bool is_deleted () const { return (_flags & JVM_ACC_IS_DELETED ) != 0; }
+ bool is_prefixed_native () const { return (_flags & JVM_ACC_IS_PREFIXED_NATIVE ) != 0; }
+
+ // Klass* flags
+@@ -196,6 +198,7 @@
+ void set_has_jsrs() { atomic_set_bits(JVM_ACC_HAS_JSRS); }
+ void set_is_old() { atomic_set_bits(JVM_ACC_IS_OLD); }
+ void set_is_obsolete() { atomic_set_bits(JVM_ACC_IS_OBSOLETE); }
++ void set_is_deleted() { atomic_set_bits(JVM_ACC_IS_DELETED); }
+ void set_is_prefixed_native() { atomic_set_bits(JVM_ACC_IS_PREFIXED_NATIVE); }
+
+ void clear_not_c1_compilable() { atomic_clear_bits(JVM_ACC_NOT_C1_COMPILABLE); }
+--- ./hotspot/src/share/vm/utilities/debug.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/debug.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -666,6 +666,13 @@
+ tty->print_cr(" pm(int pc) - print Method* given compiled PC");
+ tty->print_cr(" findm(intptr_t pc) - finds Method*");
+ tty->print_cr(" find(intptr_t x) - finds & prints nmethod/stub/bytecode/oop based on pointer into it");
++ tty->print_cr(" pns(void* sp, void* fp, void* pc) - print native (i.e. mixed) stack trace. E.g.");
++ tty->print_cr(" pns($sp, $rbp, $pc) on Linux/amd64 and Solaris/amd64 or");
++ tty->print_cr(" pns($sp, $ebp, $pc) on Linux/x86 or");
++ tty->print_cr(" pns($sp, 0, $pc) on Linux/ppc64 or");
++ tty->print_cr(" pns($sp + 0x7ff, 0, $pc) on Solaris/SPARC");
++ tty->print_cr(" - in gdb do 'set overload-resolution off' before calling pns()");
++ tty->print_cr(" - in dbx do 'frame 1' before calling pns()");
+
+ tty->print_cr("misc.");
+ tty->print_cr(" flush() - flushes the log file");
+@@ -678,3 +685,56 @@
+ }
+
+ #endif // !PRODUCT
++
++void print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size) {
++
++ // see if it's a valid frame
++ if (fr.pc()) {
++ st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)");
++
++ int count = 0;
++ while (count++ < StackPrintLimit) {
++ fr.print_on_error(st, buf, buf_size);
++ st->cr();
++ // Compiled code may use EBP register on x86 so it looks like
++ // non-walkable C frame. Use frame.sender() for java frames.
++ if (t && t->is_Java_thread()) {
++ // Catch very first native frame by using stack address.
++ // For JavaThread stack_base and stack_size should be set.
++ if (!t->on_local_stack((address)(fr.real_fp() + 1))) {
++ break;
++ }
++ if (fr.is_java_frame() || fr.is_native_frame() || fr.is_runtime_frame()) {
++ RegisterMap map((JavaThread*)t, false); // No update
++ fr = fr.sender(&map);
++ } else {
++ fr = os::get_sender_for_C_frame(&fr);
++ }
++ } else {
++ // is_first_C_frame() does only simple checks for frame pointer,
++ // it will pass if java compiled code has a pointer in EBP.
++ if (os::is_first_C_frame(&fr)) break;
++ fr = os::get_sender_for_C_frame(&fr);
++ }
++ }
++
++ if (count > StackPrintLimit) {
++ st->print_cr("...<more frames>...");
++ }
++
++ st->cr();
++ }
++}
++
++#ifndef PRODUCT
++
++extern "C" void pns(void* sp, void* fp, void* pc) { // print native stack
++ Command c("pns");
++ static char buf[O_BUFLEN];
++ Thread* t = ThreadLocalStorage::get_thread_slow();
++ // Call generic frame constructor (certain arguments may be ignored)
++ frame fr(sp, fp, pc);
++ print_native_stack(tty, fr, t, buf, sizeof(buf));
++}
++
++#endif // !PRODUCT
+--- ./hotspot/src/share/vm/utilities/debug.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/debug.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -265,4 +265,7 @@
+ void pd_ps(frame f);
+ void pd_obfuscate_location(char *buf, size_t buflen);
+
++class outputStream;
++void print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size);
++
+ #endif // SHARE_VM_UTILITIES_DEBUG_HPP
+--- ./hotspot/src/share/vm/utilities/elfFile.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/elfFile.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -261,7 +261,12 @@
+ }
+ }
+ }
++// AARCH64 defaults to noexecstack. All others default to execstack.
++#ifdef AARCH64
++ return true;
++#else
+ return false;
++#endif
+ }
+ #endif
+
+--- ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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,14 +44,6 @@
+ #endif // SOLARIS
+
+ #include <math.h>
+-#ifndef FP_PZERO
+-// Linux doesn't have positive/negative zero
+-#define FP_PZERO FP_ZERO
+-#endif
+-#if (!defined fpclass) && ((!defined SPARC) || (!defined SOLARIS))
+-#define fpclass fpclassify
+-#endif
+-
+ #include <time.h>
+ #include <fcntl.h>
+ #include <dlfcn.h>
+@@ -220,7 +212,7 @@
+
+ #define DEBUG_EXCEPTION ::abort();
+
+-#ifdef ARM
++#ifdef ARM32
+ #ifdef SOLARIS
+ #define BREAKPOINT __asm__ volatile (".long 0xe1200070")
+ #else
+--- ./hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -33,7 +33,9 @@
+
+
+ # include <ctype.h>
++#define __USE_LEGACY_PROTOTYPES__
+ # include <dirent.h>
++#undef __USE_LEGACY_PROTOTYPES__
+ # include <string.h>
+ # include <strings.h> // for bsd'isms
+ # include <stdarg.h>
+@@ -46,15 +48,6 @@
+ # include <ieeefp.h>
+ #endif
+ # include <math.h>
+-#ifdef LINUX
+-#ifndef FP_PZERO
+- // Linux doesn't have positive/negative zero
+- #define FP_PZERO FP_ZERO
+-#endif
+-#ifndef fpclass
+- #define fpclass fpclassify
+-#endif
+-#endif
+ # include <time.h>
+ # include <fcntl.h>
+ # include <dlfcn.h>
+--- ./hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -41,14 +41,6 @@
+ #include <wchar.h>
+
+ #include <math.h>
+-#ifndef FP_PZERO
+-// Linux doesn't have positive/negative zero
+-#define FP_PZERO FP_ZERO
+-#endif
+-#if (!defined fpclass)
+-#define fpclass fpclassify
+-#endif
+-
+ #include <time.h>
+ #include <fcntl.h>
+ #include <dlfcn.h>
+--- ./hotspot/src/share/vm/utilities/macros.hpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/macros.hpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -392,7 +392,6 @@
+ #define NOT_E500V2(code) code
+ #endif
+
+-
+ #ifdef ARM
+ #define ARM_ONLY(code) code
+ #define NOT_ARM(code)
+@@ -401,6 +400,14 @@
+ #define NOT_ARM(code) code
+ #endif
+
++#ifdef ARM32
++#define ARM32_ONLY(code) code
++#define NOT_ARM32(code)
++#else
++#define ARM32_ONLY(code)
++#define NOT_ARM32(code) code
++#endif
++
+ #ifdef JAVASE_EMBEDDED
+ #define EMBEDDED_ONLY(code) code
+ #define NOT_EMBEDDED(code)
+--- ./hotspot/src/share/vm/utilities/vmError.cpp Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/src/share/vm/utilities/vmError.cpp Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2014, 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
+@@ -576,7 +576,7 @@
+
+ STEP(120, "(printing native stack)" )
+
+- if (_verbose) {
++ if (_verbose) {
+ if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) {
+ // We have printed the native stack in platform-specific code
+ // Windows/x64 needs special handling.
+@@ -584,43 +584,7 @@
+ frame fr = _context ? os::fetch_frame_from_context(_context)
+ : os::current_frame();
+
+- // see if it's a valid frame
+- if (fr.pc()) {
+- st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)");
+-
+-
+- int count = 0;
+- while (count++ < StackPrintLimit) {
+- fr.print_on_error(st, buf, sizeof(buf));
+- st->cr();
+- // Compiled code may use EBP register on x86 so it looks like
+- // non-walkable C frame. Use frame.sender() for java frames.
+- if (_thread && _thread->is_Java_thread()) {
+- // Catch very first native frame by using stack address.
+- // For JavaThread stack_base and stack_size should be set.
+- if (!_thread->on_local_stack((address)(fr.sender_sp() + 1))) {
+- break;
+- }
+- if (fr.is_java_frame()) {
+- RegisterMap map((JavaThread*)_thread, false); // No update
+- fr = fr.sender(&map);
+- } else {
+- fr = os::get_sender_for_C_frame(&fr);
+- }
+- } else {
+- // is_first_C_frame() does only simple checks for frame pointer,
+- // it will pass if java compiled code has a pointer in EBP.
+- if (os::is_first_C_frame(&fr)) break;
+- fr = os::get_sender_for_C_frame(&fr);
+- }
+- }
+-
+- if (count > StackPrintLimit) {
+- st->print_cr("...<more frames>...");
+- }
+-
+- st->cr();
+- }
++ print_native_stack(st, fr, _thread, buf, sizeof(buf));
+ }
+ }
+
+@@ -1049,7 +1013,9 @@
+ out.print_raw (cmd);
+ out.print_raw_cr("\" ...");
+
+- os::fork_and_exec(cmd);
++ if (os::fork_and_exec(cmd) < 0) {
++ out.print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno);
++ }
+ }
+
+ // done with OnError
+@@ -1134,7 +1100,9 @@
+ #endif
+ tty->print_cr("\"%s\"...", cmd);
+
+- os::fork_and_exec(cmd);
++ if (os::fork_and_exec(cmd) < 0) {
++ tty->print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno);
++ }
+ }
+ }
+
+--- ./hotspot/test/TEST.groups Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/TEST.groups Wed Jul 01 21:52:18 2015 -0700
+@@ -132,7 +132,8 @@
+ sanity/ExecuteInternalVMTests.java
+
+ hotspot_gc = \
+- sanity/ExecuteInternalVMTests.java
++ sanity/ExecuteInternalVMTests.java \
++ -gc/g1/TestGreyReclaimedHumongousObjects.java
+
+ hotspot_runtime = \
+ sanity/ExecuteInternalVMTests.java
+@@ -148,6 +149,8 @@
+ # Tests that require compact3 API's
+ #
+ needs_compact3 = \
++ compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java \
++ compiler/rangechecks/TestRangeCheckSmearing.java \
+ compiler/whitebox/DeoptimizeMethodTest.java \
+ compiler/whitebox/SetForceInlineMethodTest.java \
+ compiler/whitebox/SetDontInlineMethodTest.java \
+@@ -158,6 +161,7 @@
+ compiler/whitebox/IsMethodCompilableTest.java \
+ gc/6581734/Test6581734.java \
+ gc/7072527/TestFullGCCount.java \
++ gc/TestGCLogRotationViaJcmd.java \
+ gc/g1/TestHumongousAllocInitialMark.java \
+ gc/g1/TestHumongousShrinkHeap.java \
+ gc/arguments/TestG1HeapRegionSize.java \
+@@ -176,6 +180,7 @@
+ serviceability/threads/TestFalseDeadLock.java \
+ serviceability/jvmti/GetObjectSizeOverflow.java \
+ serviceability/jvmti/TestRedefineWithUnresolvedClass.java \
++ serviceability/sa/jmap-hashcode/Test8028623.java \
+ compiler/tiered/NonTieredLevelsTest.java \
+ compiler/tiered/TieredLevelsTest.java \
+ compiler/intrinsics/bmi/verifycode
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/codegen/IntRotateWithImmediate.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,64 @@
++/*
++ * Copyright 2015 SAP AG. All Rights Reserved.
++ * 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 8080190
++ * @key regression
++ * @summary Test that the rotate distance used in the rotate instruction is properly masked with 0x1f
++ * @run main/othervm -Xbatch -XX:-UseOnStackReplacement IntRotateWithImmediate
++ * @author volker.simonis@gmail.com
++ */
++
++public class IntRotateWithImmediate {
++
++ // This is currently the same as Integer.rotateRight()
++ static int rotateRight(int i, int distance) {
++ // On some architectures (i.e. x86_64 and ppc64) the following computation is
++ // matched in the .ad file into a single MachNode which emmits a single rotate
++ // machine instruction. It is important that the shift amount is masked to match
++ // corresponding immediate width in the native instruction. On x86_64 the rotate
++ // left instruction ('rol') encodes an 8-bit immediate while the corresponding
++ // 'rotlwi' instruction on Power only encodes a 5-bit immediate.
++ return ((i >>> distance) | (i << -distance));
++ }
++
++ static int compute(int x) {
++ return rotateRight(x, 3);
++ }
++
++ public static void main(String args[]) {
++ int val = 4096;
++
++ int firstResult = compute(val);
++
++ for (int i = 0; i < 100000; i++) {
++ int newResult = compute(val);
++ if (firstResult != newResult) {
++ throw new InternalError(firstResult + " != " + newResult);
++ }
++ }
++ System.out.println("OK");
++ }
++
++}
+--- ./hotspot/test/compiler/codegen/LoadWithMask.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/codegen/LoadWithMask.java Wed Jul 01 21:52:18 2015 -0700
+@@ -25,7 +25,7 @@
+ * @test
+ * @bug 8032207
+ * @summary Invalid node sizing for loadUS2L_immI16 and loadI2L_immI
+- * @run main/othervm -server -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,LoadWithMask.foo LoadWithMask
++ * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,LoadWithMask.foo LoadWithMask
+ *
+ */
+ public class LoadWithMask {
+--- ./hotspot/test/compiler/codegen/LoadWithMask2.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/codegen/LoadWithMask2.java Wed Jul 01 21:52:18 2015 -0700
+@@ -25,7 +25,7 @@
+ * @test
+ * @bug 8031743
+ * @summary loadI2L_immI broken for negative memory values
+- * @run main/othervm -server -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,*.foo* LoadWithMask2
++ * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,*.foo* LoadWithMask2
+ *
+ */
+ public class LoadWithMask2 {
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,74 @@
++/*
++ * 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 8073956
++ * @summary Tests C2 EA with allocated object escaping through a call.
++ * @run main/othervm -XX:CompileCommand=dontinline,TestEscapeThroughInvoke::create TestEscapeThroughInvoke
++ */
++public class TestEscapeThroughInvoke {
++ private A a;
++
++ public static void main(String[] args) {
++ TestEscapeThroughInvoke test = new TestEscapeThroughInvoke();
++ test.a = new A(42);
++ // Make sure run gets compiled by C2
++ for (int i = 0; i < 100_000; ++i) {
++ test.run();
++ }
++ }
++
++ private void run() {
++ // Allocate something to trigger EA
++ new Object();
++ // Create a new escaping instance of A and
++ // verify that it is always equal to 'a.saved'.
++ A escapingA = create(42);
++ a.check(escapingA);
++ }
++
++ // Create and return a new instance of A that escaped through 'A::saveInto'.
++ // The 'dummy' parameters are needed to avoid EA skipping the methods.
++ private A create(Integer dummy) {
++ A result = new A(dummy);
++ result.saveInto(a, dummy); // result escapes into 'a' here
++ return result;
++ }
++}
++
++class A {
++ private A saved;
++
++ public A(Integer dummy) { }
++
++ public void saveInto(A other, Integer dummy) {
++ other.saved = this;
++ }
++
++ public void check(A other) {
++ if (this.saved != other) {
++ throw new RuntimeException("TEST FAILED: Objects not equal.");
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/inlining/DefaultMethodsDependencies.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,63 @@
++/*
++ * 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 8069263
++ * @summary Deoptimization between array allocation and arraycopy may result in non initialized array
++ * @run main/othervm -XX:-BackgroundCompilation -XX:CompileOnly=DefaultMethodsDependencies::test -XX:CompileOnly=DefaultMethodsDependencies$I2::m1 DefaultMethodsDependencies
++ *
++ */
++
++public class DefaultMethodsDependencies {
++
++ interface I1 {
++ void m1();
++ // triggers processing of default methods in C1
++ default void m2() {
++ }
++ }
++
++ interface I2 extends I1 {
++ // added to C2 as default method
++ default void m1() {
++ }
++ }
++
++ static abstract class C1 implements I1 {
++ }
++
++ static class C2 extends C1 implements I2 {
++ }
++
++ static void test(C1 obj) {
++ obj.m1();
++ }
++
++ static public void main(String[] args) {
++ C2 obj = new C2();
++ for (int i = 0; i < 20000; i++) {
++ test(obj);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/jsr292/MHInlineTest.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,207 @@
++/*
++ * 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 8062280
++ * @summary C2: inlining failure due to access checks being too strict
++ * @library /testlibrary
++ * @run main/othervm MHInlineTest
++ */
++import java.lang.invoke.*;
++import com.oracle.java.testlibrary.*;
++import static com.oracle.java.testlibrary.Asserts.*;
++
++public class MHInlineTest {
++ public static void main(String[] args) throws Exception {
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
++ "-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
++ "-server", "-XX:-TieredCompilation", "-Xbatch",
++ "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
++ "-XX:CompileCommand=dontinline,MHInlineTest::test*",
++ "MHInlineTest$Launcher");
++
++ OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
++
++ analyzer.shouldHaveExitValue(0);
++
++ // The test is applicable only to C2 (present in Server VM).
++ if (analyzer.getStderr().contains("Server VM")) {
++ analyzer.shouldContain("MHInlineTest$B::public_x (3 bytes) inline (hot)");
++ analyzer.shouldContain( "MHInlineTest$B::protected_x (3 bytes) inline (hot)");
++ analyzer.shouldContain( "MHInlineTest$B::package_x (3 bytes) inline (hot)");
++ analyzer.shouldContain("MHInlineTest$A::package_final_x (3 bytes) inline (hot)");
++ analyzer.shouldContain("MHInlineTest$B::private_x (3 bytes) inline (hot)");
++ analyzer.shouldContain("MHInlineTest$B::private_static_x (3 bytes) inline (hot)");
++ analyzer.shouldContain("MHInlineTest$A::package_static_x (3 bytes) inline (hot)");
++
++ analyzer.shouldNotContain("MHInlineTest$A::protected_x (3 bytes) virtual call");
++ analyzer.shouldNotContain("MHInlineTest$A::package_x (3 bytes) virtual call");
++ }
++ }
++
++ static class A {
++ public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
++
++ public Class<?> public_x() { return A.class; }
++ protected Class<?> protected_x() { return A.class; }
++ Class<?> package_x() { return A.class; }
++ final Class<?> package_final_x() { return A.class; }
++
++ static Class<?> package_static_x() { return A.class; }
++ }
++
++ static class B extends A {
++ public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
++
++ @Override public Class<?> public_x() { return B.class; }
++ @Override protected Class<?> protected_x() { return B.class; }
++ @Override Class<?> package_x() { return B.class; }
++
++ private Class<?> private_x() { return B.class; }
++ static Class<?> private_static_x() { return B.class; }
++ }
++
++ static final MethodHandle A_PUBLIC_X;
++ static final MethodHandle A_PROTECTED_X;
++ static final MethodHandle A_PACKAGE_X;
++ static final MethodHandle A_PACKAGE_STATIC_X;
++ static final MethodHandle A_PACKAGE_FINAL_X;
++
++ static final MethodHandle B_PRIVATE_X;
++ static final MethodHandle B_PRIVATE_STATIC_X;
++
++ static {
++ try {
++ MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
++
++ A_PUBLIC_X = LOOKUP.findVirtual(
++ A.class, "public_x", MethodType.methodType(Class.class));
++ A_PROTECTED_X = LOOKUP.findVirtual(
++ A.class, "protected_x", MethodType.methodType(Class.class));
++ A_PACKAGE_X = LOOKUP.findVirtual(
++ A.class, "package_x", MethodType.methodType(Class.class));
++ A_PACKAGE_FINAL_X = LOOKUP.findVirtual(
++ A.class, "package_final_x", MethodType.methodType(Class.class));
++ A_PACKAGE_STATIC_X = LOOKUP.findStatic(
++ A.class, "package_static_x", MethodType.methodType(Class.class));
++
++ B_PRIVATE_X = B.LOOKUP.findVirtual(
++ B.class, "private_x", MethodType.methodType(Class.class));
++ B_PRIVATE_STATIC_X = B.LOOKUP.findStatic(
++ B.class, "private_static_x", MethodType.methodType(Class.class));
++ } catch (Exception e) {
++ throw new Error(e);
++ }
++ }
++
++ static final A a = new B();
++
++ private static void testPublicMH() {
++ try {
++ Class<?> r = (Class<?>)A_PUBLIC_X.invokeExact(a);
++ assertEquals(r, B.class);
++ } catch (Throwable throwable) {
++ throw new Error(throwable);
++ }
++ }
++
++ private static void testProtectedMH() {
++ try {
++ Class<?> r = (Class<?>)A_PROTECTED_X.invokeExact(a);
++ assertEquals(r, B.class);
++ } catch (Throwable throwable) {
++ throw new Error(throwable);
++ }
++ }
++
++ private static void testPackageMH() {
++ try {
++ Class<?> r = (Class<?>)A_PACKAGE_X.invokeExact(a);
++ assertEquals(r, B.class);
++ } catch (Throwable throwable) {
++ throw new Error(throwable);
++ }
++ }
++
++ private static void testPackageFinalMH() {
++ try {
++ Class<?> r = (Class<?>)A_PACKAGE_FINAL_X.invokeExact(a);
++ assertEquals(r, A.class);
++ } catch (Throwable throwable) {
++ throw new Error(throwable);
++ }
++ }
++
++ private static void testPackageStaticMH() {
++ try {
++ Class<?> r = (Class<?>)A_PACKAGE_STATIC_X.invokeExact();
++ assertEquals(r, A.class);
++ } catch (Throwable throwable) {
++ throw new Error(throwable);
++ }
++ }
++
++ private static void testPrivateMH() {
++ try {
++ Class<?> r = (Class<?>)B_PRIVATE_X.invokeExact((B)a);
++ assertEquals(r, B.class);
++ } catch (Throwable throwable) {
++ throw new Error(throwable);
++ }
++ }
++
++ private static void testPrivateStaticMH() {
++ try {
++ Class<?> r = (Class<?>)B_PRIVATE_STATIC_X.invokeExact();
++ assertEquals(r, B.class);
++ } catch (Throwable throwable) {
++ throw new Error(throwable);
++ }
++ }
++ static class Launcher {
++ public static void main(String[] args) throws Exception {
++ for (int i = 0; i < 20_000; i++) {
++ testPublicMH();
++ }
++ for (int i = 0; i < 20_000; i++) {
++ testProtectedMH();
++ }
++ for (int i = 0; i < 20_000; i++) {
++ testPackageMH();
++ }
++ for (int i = 0; i < 20_000; i++) {
++ testPackageFinalMH();
++ }
++ for (int i = 0; i < 20_000; i++) {
++ testPackageStaticMH();
++ }
++ for (int i = 0; i < 20_000; i++) {
++ testPrivateMH();
++ }
++ for (int i = 0; i < 20_000; i++) {
++ testPrivateStaticMH();
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/jsr292/PollutedTrapCounts.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,109 @@
++/*
++ * 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 8074551
++ * @library /testlibrary
++ * @run main PollutedTrapCounts
++ */
++import java.lang.invoke.*;
++import com.oracle.java.testlibrary.*;
++
++public class PollutedTrapCounts {
++ public static void main(String[] args) throws Exception {
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
++ "-XX:+IgnoreUnrecognizedVMOptions",
++ "-XX:-TieredCompilation", "-Xbatch",
++ "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
++ "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
++ "PollutedTrapCounts$Test");
++
++ OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
++
++ analyzer.shouldHaveExitValue(0);
++
++ analyzer.shouldNotContain("not compilable (disabled)");
++ }
++
++ static class Test {
++ public static final MethodHandle test1;
++ public static final MethodHandle test2;
++ public static final MethodHandle empty;
++
++ static {
++ try {
++ Class<?> THIS_CLASS = Test.class;
++ MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
++ test1 = LOOKUP.findStatic(THIS_CLASS, "test1", MethodType.methodType(boolean.class, boolean.class));
++ test2 = LOOKUP.findStatic(THIS_CLASS, "test2", MethodType.methodType(boolean.class, boolean.class));
++ empty = LOOKUP.findStatic(THIS_CLASS, "empty", MethodType.methodType(void.class, boolean.class));
++ } catch(Throwable e) {
++ throw new Error(e);
++ }
++ }
++
++ static boolean test1(boolean b) {
++ return b;
++ }
++ static boolean test2(boolean b) {
++ return true;
++ }
++ static void empty(boolean b) {}
++
++ static void test(boolean freqValue, boolean removeInlineBlocker) throws Throwable {
++ MethodHandle innerGWT = MethodHandles.guardWithTest(test1, empty, empty);
++ MethodHandle outerGWT = MethodHandles.guardWithTest(test2, innerGWT, innerGWT);
++
++ // Trigger compilation
++ for (int i = 0; i < 20_000; i++) {
++ outerGWT.invokeExact(freqValue);
++ }
++
++ // Trigger deopt & nmethod invalidation
++ outerGWT.invokeExact(!freqValue);
++
++ // Force inline blocker removal on rare-taken path
++ if (removeInlineBlocker) {
++ for (int i = 0; i < 100; i++) {
++ outerGWT.invokeExact(!freqValue);
++ }
++ }
++
++ // Trigger recompilation
++ for (int i = 0; i < 20_000; i++) {
++ outerGWT.invokeExact(freqValue);
++ }
++ }
++
++ public static void main(String[] args) throws Throwable {
++ boolean freqValue = true;
++ boolean removeInlineBlocker = false;
++ for (int i = 0; i < 20; i++) {
++ test(freqValue, removeInlineBlocker);
++ freqValue = !freqValue;
++ removeInlineBlocker = !removeInlineBlocker;
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/loopopts/ConstFPVectorization.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,63 @@
++/*
++ * 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 8074869
++ * @summary C2 code generator can replace -0.0f with +0.0f on Linux
++ * @run main ConstFPVectorization 8
++ * @author volker.simonis@gmail.com
++ *
++ */
++
++public class ConstFPVectorization {
++
++ static float[] f = new float[16];
++ static double[] d = new double[16];
++
++ static void floatLoop(int count) {
++ for (int i = 0; i < count; i++) {
++ f[i] = -0.0f;
++ }
++ }
++
++ static void doubleLoop(int count) {
++ for (int i = 0; i < count; i++) {
++ d[i] = -0.0d;
++ }
++ }
++
++ public static void main(String args[]) {
++ for (int i = 0; i < 10_000; i++) {
++ floatLoop(Integer.parseInt(args[0]));
++ doubleLoop(Integer.parseInt(args[0]));
++ }
++ for (int i = 0; i < Integer.parseInt(args[0]); i++) {
++ if (Float.floatToRawIntBits(f[i]) != Float.floatToRawIntBits(-0.0f))
++ throw new Error("Float error at index " + i);
++ if (Double.doubleToRawLongBits(d[i]) != Double.doubleToRawLongBits(-0.0d))
++ throw new Error("Double error at index " + i);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/loopopts/CountedLoopProblem.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,54 @@
++/*
++ * 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 8072753
++ * @summary Inner loop induction variable increment occurs before compare which causes integer overflow
++ * @run main/othervm CountedLoopProblem
++ *
++ */
++
++import java.util.*;
++
++public class CountedLoopProblem {
++ public static void main(String[] args) throws Exception {
++ Random r = new Random(42);
++ int x = 0;
++ StringBuilder sb = new StringBuilder();
++ for(int i = 0; i < 1000000; ++i) {
++ int v = Math.abs(r.nextInt());
++ sb.append('+').append(v).append('\n');
++ x += v;
++ // To trigger the problem we must OSR in the following loop
++ // To make the problem 100% reproducible run with -XX:-TieredCompilation -XX:OSROnlyBCI=62
++ while(x < 0) x += 1000000000;
++ sb.append('=').append(x).append('\n');
++ }
++ if (sb.toString().hashCode() != 0xaba94591) {
++ throw new Exception("Unexpected result");
++ }
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,144 @@
++/*
++ * 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 com.oracle.java.testlibrary.*;
++import sun.misc.Unsafe;
++
++/**
++ * @test
++ * @bug 8078497
++ * @summary Tests correct alignment of vectors with loop invariant offset.
++ * @library /testlibrary
++ * @run main TestVectorizationWithInvariant
++ */
++public class TestVectorizationWithInvariant {
++
++ private static Unsafe unsafe;
++ private static final long BYTE_ARRAY_OFFSET;
++ private static final long CHAR_ARRAY_OFFSET;
++
++ static {
++ unsafe = Utils.getUnsafe();
++ BYTE_ARRAY_OFFSET = unsafe.arrayBaseOffset(byte[].class);
++ CHAR_ARRAY_OFFSET = unsafe.arrayBaseOffset(char[].class);
++ }
++
++ public static void main(String[] args) throws Exception {
++ byte[] byte_array1 = new byte[1000];
++ byte[] byte_array2 = new byte[1000];
++ char[] char_array = new char[1000];
++
++ for (int i = 0; i < 20_000; ++i) {
++ copyByteToChar(byte_array1, byte_array2, char_array, 1);
++ copyCharToByte(char_array, byte_array1, 1);
++ copyCharToByteAligned(char_array, byte_array1);
++ copyCharToByteUnaligned(char_array, byte_array1);
++ }
++ }
++
++ /*
++ * Copy multiple consecutive chars from a byte array to a given offset in a char array
++ * to trigger C2's superword optimization. The offset in the byte array is independent
++ * of the loop induction variable and can be set to an arbitrary value. It may then not
++ * be possible to both align the LoadUS and the StoreC operations. Therefore, vectorization
++ * should only be done in this case if unaligned memory accesses are allowed.
++ */
++ public static void copyByteToChar(byte[] src1, byte[] src2, char[] dst, int off) {
++ off = (int) BYTE_ARRAY_OFFSET + (off << 1);
++ byte[] src = src1;
++ for (int i = (int) CHAR_ARRAY_OFFSET; i < 100; i = i + 8) {
++ // Copy 8 chars from src to dst
++ unsafe.putChar(dst, i + 0, unsafe.getChar(src, off + 0));
++ unsafe.putChar(dst, i + 2, unsafe.getChar(src, off + 2));
++ unsafe.putChar(dst, i + 4, unsafe.getChar(src, off + 4));
++ unsafe.putChar(dst, i + 6, unsafe.getChar(src, off + 6));
++ unsafe.putChar(dst, i + 8, unsafe.getChar(src, off + 8));
++ unsafe.putChar(dst, i + 10, unsafe.getChar(src, off + 10));
++ unsafe.putChar(dst, i + 12, unsafe.getChar(src, off + 12));
++ unsafe.putChar(dst, i + 14, unsafe.getChar(src, off + 14));
++
++ // Prevent loop invariant code motion of char read.
++ src = (src == src1) ? src2 : src1;
++ }
++ }
++
++ /*
++ * Copy multiple consecutive chars from a char array to a given offset in a byte array
++ * to trigger C2's superword optimization. Checks for similar problems as 'copyByteToChar'.
++ */
++ public static void copyCharToByte(char[] src, byte[] dst, int off) {
++ off = (int) BYTE_ARRAY_OFFSET + (off << 1);
++ for (int i = 0; i < 100; i = i + 8) {
++ // Copy 8 chars from src to dst
++ unsafe.putChar(dst, off + 0, src[i + 0]);
++ unsafe.putChar(dst, off + 2, src[i + 1]);
++ unsafe.putChar(dst, off + 4, src[i + 2]);
++ unsafe.putChar(dst, off + 6, src[i + 3]);
++ unsafe.putChar(dst, off + 8, src[i + 4]);
++ unsafe.putChar(dst, off + 10, src[i + 5]);
++ unsafe.putChar(dst, off + 12, src[i + 6]);
++ unsafe.putChar(dst, off + 14, src[i + 7]);
++ }
++ }
++
++ /*
++ * Variant of copyCharToByte with a constant destination array offset.
++ * The loop should always be vectorized because both the LoadUS and StoreC
++ * operations can be aligned.
++ */
++ public static void copyCharToByteAligned(char[] src, byte[] dst) {
++ final int off = (int) BYTE_ARRAY_OFFSET;
++ for (int i = 8; i < 100; i = i + 8) {
++ // Copy 8 chars from src to dst
++ unsafe.putChar(dst, off + 0, src[i + 0]);
++ unsafe.putChar(dst, off + 2, src[i + 1]);
++ unsafe.putChar(dst, off + 4, src[i + 2]);
++ unsafe.putChar(dst, off + 6, src[i + 3]);
++ unsafe.putChar(dst, off + 8, src[i + 4]);
++ unsafe.putChar(dst, off + 10, src[i + 5]);
++ unsafe.putChar(dst, off + 12, src[i + 6]);
++ unsafe.putChar(dst, off + 14, src[i + 7]);
++ }
++ }
++
++ /*
++ * Variant of copyCharToByte with a constant destination array offset. The
++ * loop should only be vectorized if unaligned memory operations are allowed
++ * because not both the LoadUS and the StoreC can be aligned.
++ */
++ public static void copyCharToByteUnaligned(char[] src, byte[] dst) {
++ final int off = (int) BYTE_ARRAY_OFFSET + 2;
++ for (int i = 0; i < 100; i = i + 8) {
++ // Copy 8 chars from src to dst
++ unsafe.putChar(dst, off + 0, src[i + 0]);
++ unsafe.putChar(dst, off + 2, src[i + 1]);
++ unsafe.putChar(dst, off + 4, src[i + 2]);
++ unsafe.putChar(dst, off + 6, src[i + 3]);
++ unsafe.putChar(dst, off + 8, src[i + 4]);
++ unsafe.putChar(dst, off + 10, src[i + 5]);
++ unsafe.putChar(dst, off + 12, src[i + 6]);
++ unsafe.putChar(dst, off + 14, src[i + 7]);
++ }
++ }
++}
+--- ./hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -24,6 +24,7 @@
+ /*
+ * @test
+ * @bug 8027751
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill
+ * @run main/othervm -XX:+UseG1GC C1ObjectSpillInLogicOp
+ *
+--- ./hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java Wed Jul 01 21:52:18 2015 -0700
+@@ -126,10 +126,7 @@
+
+ @Override
+ public String[] getMethodsToCompileNames() {
+- return new String[] {
+- getMethodWithLockName(),
+- Unsafe.class.getName() + "::addressSize"
+- };
++ return new String[] { getMethodWithLockName() };
+ }
+
+ public void lock(boolean abort) {
+@@ -147,10 +144,12 @@
+ public static void main(String args[]) throws Throwable {
+ Asserts.assertGTE(args.length, 1, "One argument required.");
+ Test t = new Test();
+- if (Boolean.valueOf(args[0])) {
++ boolean shouldBeInflated = Boolean.valueOf(args[0]);
++ if (shouldBeInflated) {
+ AbortProvoker.inflateMonitor(t.monitor);
+ }
+ for (int i = 0; i < Test.TOTAL_ITERATIONS; i++) {
++ AbortProvoker.verifyMonitorState(t.monitor, shouldBeInflated);
+ t.lock(i >= Test.WARMUP_ITERATIONS);
+ }
+ }
+--- ./hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java Wed Jul 01 21:52:18 2015 -0700
+@@ -156,10 +156,7 @@
+
+ @Override
+ public String[] getMethodsToCompileNames() {
+- return new String[] {
+- getMethodWithLockName(),
+- sun.misc.Unsafe.class.getName() + "::forceAbort"
+- };
++ return new String[] { getMethodWithLockName() };
+ }
+
+ public void forceAbort(int a[], boolean abort) {
+@@ -182,13 +179,15 @@
+ public static void main(String args[]) throws Throwable {
+ Test t = new Test();
+
+- if (Boolean.valueOf(args[0])) {
++ boolean shouldBeInflated = Boolean.valueOf(args[0]);
++ if (shouldBeInflated) {
+ AbortProvoker.inflateMonitor(t.monitor);
+ }
+
+ int tmp[] = new int[1];
+
+ for (int i = 0; i < Test.ITERATIONS; i++ ) {
++ AbortProvoker.verifyMonitorState(t.monitor, shouldBeInflated);
+ if (i == Test.RANGE_CHECK_AT) {
+ t.forceAbort(new int[0], false);
+ } else {
+--- ./hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java Wed Jul 01 21:52:18 2015 -0700
+@@ -129,10 +129,7 @@
+
+ @Override
+ public String[] getMethodsToCompileNames() {
+- return new String[] {
+- getMethodWithLockName(),
+- sun.misc.Unsafe.class.getName() + "::addressSize"
+- };
++ return new String[] { getMethodWithLockName() };
+ }
+
+ public void forceAbort(boolean abort) {
+@@ -150,11 +147,12 @@
+ public static void main(String args[]) throws Throwable {
+ Asserts.assertGTE(args.length, 1, "One argument required.");
+ Test t = new Test();
+-
+- if (Boolean.valueOf(args[0])) {
++ boolean shouldBeInflated = Boolean.valueOf(args[0]);
++ if (shouldBeInflated) {
+ AbortProvoker.inflateMonitor(t.monitor);
+ }
+ for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) {
++ AbortProvoker.verifyMonitorState(t.monitor, shouldBeInflated);
+ t.forceAbort(
+ i == TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD);
+ }
+--- ./hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java Wed Jul 01 21:52:18 2015 -0700
+@@ -142,10 +142,7 @@
+
+ @Override
+ public String[] getMethodsToCompileNames() {
+- return new String[] {
+- getMethodWithLockName(),
+- sun.misc.Unsafe.class.getName() + "::addressSize"
+- };
++ return new String[] { getMethodWithLockName() };
+ }
+
+ public void lock(boolean abort) {
+@@ -163,11 +160,12 @@
+ public static void main(String args[]) throws Throwable {
+ Asserts.assertGTE(args.length, 1, "One argument required.");
+ Test t = new Test();
+-
+- if (Boolean.valueOf(args[0])) {
++ boolean shouldBeInflated = Boolean.valueOf(args[0]);
++ if (shouldBeInflated) {
+ AbortProvoker.inflateMonitor(t.monitor);
+ }
+ for (int i = 0; i < Test.TOTAL_ITERATIONS; i++) {
++ AbortProvoker.verifyMonitorState(t.monitor, shouldBeInflated);
+ t.lock(i % 2 == 1);
+ }
+ }
+--- ./hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java Wed Jul 01 21:52:18 2015 -0700
+@@ -116,9 +116,7 @@
+
+ @Override
+ public String[] getMethodsToCompileNames() {
+- return new String[] {
+- getMethodWithLockName()
+- };
++ return new String[] { getMethodWithLockName() };
+ }
+
+ public void lock() {
+@@ -134,11 +132,13 @@
+ public static void main(String args[]) throws Throwable {
+ Asserts.assertGTE(args.length, 1, "One argument required.");
+ Test test = new Test();
+-
+- if (Boolean.valueOf(args[0])) {
++ boolean shouldBeInflated = Boolean.valueOf(args[0]);
++ if (shouldBeInflated) {
+ AbortProvoker.inflateMonitor(test.monitor);
+ }
+ for (long i = 0L; i < Test.TOTAL_ITERATIONS; i++) {
++ AbortProvoker.verifyMonitorState(test.monitor,
++ shouldBeInflated);
+ test.lock();
+ }
+ }
+--- ./hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java Wed Jul 01 21:52:18 2015 -0700
+@@ -51,7 +51,7 @@
+ * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times before
+ * lock inflation and the same amount of times after inflation.
+ * As a result total locks count should be equal to
+- * {@code 2*AbortProvoker.DEFAULT_ITERATIONS}.
++ * {@code 2 * AbortProvoker.DEFAULT_ITERATIONS}.
+ * It is a pretty strict assertion which could fail if some retriable abort
+ * happened: it could be {@code AbortType.RETRIABLE} or
+ * {@code AbortType.MEM_CONFLICT}, but unfortunately abort can has both these
+@@ -100,7 +100,6 @@
+ }
+
+ public static class Test {
+-
+ /**
+ * Usage:
+ * Test &lt;provoker type&gt;
+@@ -112,10 +111,12 @@
+ AbortProvoker provoker
+ = AbortType.lookup(Integer.valueOf(args[0])).provoker();
+ for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) {
++ AbortProvoker.verifyMonitorState(provoker, false /*deflated*/);
+ provoker.forceAbort();
+ }
+ provoker.inflateMonitor();
+ for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) {
++ AbortProvoker.verifyMonitorState(provoker, true /*inflated*/);
+ provoker.forceAbort();
+ }
+ }
+--- ./hotspot/test/compiler/stable/TestStableBoolean.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableBoolean.java Wed Jul 01 21:52:18 2015 -0700
+@@ -53,44 +53,32 @@
+ * java/lang/invoke/TestStableBoolean$DefaultStaticValue
+ * java/lang/invoke/TestStableBoolean$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableBoolean
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableBoolean
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableBoolean
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableBoolean
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableBoolean
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableBoolean
+ */
+ package java.lang.invoke;
+
+--- ./hotspot/test/compiler/stable/TestStableByte.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableByte.java Wed Jul 01 21:52:18 2015 -0700
+@@ -53,44 +53,32 @@
+ * java/lang/invoke/TestStableByte$DefaultStaticValue
+ * java/lang/invoke/TestStableByte$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableByte
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableByte
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableByte
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableByte
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableByte
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableByte
+ */
+ package java.lang.invoke;
+
+--- ./hotspot/test/compiler/stable/TestStableChar.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableChar.java Wed Jul 01 21:52:18 2015 -0700
+@@ -53,44 +53,32 @@
+ * java/lang/invoke/TestStableChar$DefaultStaticValue
+ * java/lang/invoke/TestStableChar$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableChar
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableChar
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableChar
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableChar
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableChar
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableChar
+ */
+ package java.lang.invoke;
+
+--- ./hotspot/test/compiler/stable/TestStableDouble.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableDouble.java Wed Jul 01 21:52:18 2015 -0700
+@@ -53,44 +53,32 @@
+ * java/lang/invoke/TestStableDouble$DefaultStaticValue
+ * java/lang/invoke/TestStableDouble$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableDouble
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableDouble
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableDouble
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableDouble
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableDouble
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableDouble
+ */
+ package java.lang.invoke;
+
+--- ./hotspot/test/compiler/stable/TestStableFloat.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableFloat.java Wed Jul 01 21:52:18 2015 -0700
+@@ -53,44 +53,32 @@
+ * java/lang/invoke/TestStableFloat$DefaultStaticValue
+ * java/lang/invoke/TestStableFloat$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableFloat
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableFloat
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableFloat
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableFloat
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableFloat
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableFloat
+ */
+ package java.lang.invoke;
+
+--- ./hotspot/test/compiler/stable/TestStableInt.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableInt.java Wed Jul 01 21:52:18 2015 -0700
+@@ -53,44 +53,32 @@
+ * java/lang/invoke/TestStableInt$DefaultStaticValue
+ * java/lang/invoke/TestStableInt$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableInt
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableInt
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableInt
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableInt
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableInt
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableInt
+ */
+ package java.lang.invoke;
+
+--- ./hotspot/test/compiler/stable/TestStableLong.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableLong.java Wed Jul 01 21:52:18 2015 -0700
+@@ -53,44 +53,32 @@
+ * java/lang/invoke/TestStableLong$DefaultStaticValue
+ * java/lang/invoke/TestStableLong$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableLong
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableLong
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableLong
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableLong
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableLong
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableLong
+ */
+ package java.lang.invoke;
+
+--- ./hotspot/test/compiler/stable/TestStableObject.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableObject.java Wed Jul 01 21:52:18 2015 -0700
+@@ -54,44 +54,32 @@
+ * java/lang/invoke/TestStableObject$DefaultStaticValue
+ * java/lang/invoke/TestStableObject$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableObject
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableObject
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableObject
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableObject
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableObject
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableObject
+ */
+ package java.lang.invoke;
+
+--- ./hotspot/test/compiler/stable/TestStableShort.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/stable/TestStableShort.java Wed Jul 01 21:52:18 2015 -0700
+@@ -53,44 +53,32 @@
+ * java/lang/invoke/TestStableShort$DefaultStaticValue
+ * java/lang/invoke/TestStableShort$ObjectArrayLowerDim2
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableShort
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:-TieredCompilation
++ * -XX:-TieredCompilation
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableShort
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:+FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableShort
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
++ * @run main/othervm -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -server -XX:+TieredCompilation -XX:TieredStopAtLevel=1
++ * -XX:+TieredCompilation -XX:TieredStopAtLevel=1
+ * -XX:-FoldStableValues
+ * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ * java.lang.invoke.TestStableShort
+ *
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:+FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableShort
+- * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
+- * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+- * -client -XX:-TieredCompilation
+- * -XX:-FoldStableValues
+- * -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+- * java.lang.invoke.TestStableShort
+ */
+ package java.lang.invoke;
+
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,89 @@
++/*
++ * Copyright 2015 SAP AG. All Rights Reserved.
++ * 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 8068909
++ * @key regression
++ * @summary test that string optimizations produce code, that doesn't lead to a crash.
++ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestOptimizeStringConcat
++ * @author axel.siebenborn@sap.com
++ */
++public class TestOptimizeStringConcat {
++
++ static boolean checkArgumentSyntax(String value, String allowedchars, String notallowedchars, String logmsg) {
++ String rc = null;
++
++ int maxchar = 99999;
++ int minchar = 1;
++ if ((allowedchars != null && notallowedchars != null) || minchar > maxchar) {
++ rc = "internal error";
++ } else {
++ if (value == null) {
++ rc = "the value null is not allowed, it is missing";
++ } else if (value != null && minchar > 0 && value.trim().equals("")) {
++ rc = "the value must not be empty";
++ } else if (value != null) {
++ if (value.length() < minchar || value.length() > maxchar) {
++ if (rc == null) {
++ rc = "the value length must be between +minchar+ and +maxchar";
++ }
++ }
++ char[] _value = value.toCharArray();
++ boolean dotfound = false;
++ int i = 1;
++ if (_value[i] == '.' && !dotfound) {
++ dotfound = true;
++ } else if (allowedchars != null && allowedchars.indexOf(_value[i]) == -1) {
++ if (rc == null) {
++ rc = "the value contains an illegal character: '" + _value[i] + "', only following characters are allowed: '+allowedchars+'";
++ } else {
++ rc += " / the value contains an illegal character: '" + _value[i] + "', only following characters are allowed: '+allowedchars+'";
++ }
++ } else if (notallowedchars != null && notallowedchars.indexOf(_value[i]) != -1) {
++ if (rc == null) {
++ rc = "the value contains an illegal character: '" + _value[i] + "', following characters are not allowed '+notallowedchars+'";
++ } else {
++ rc += " / the value contains an illegal character: '" + _value[i] + "', following characters are not allowed '+notallowedchars+'";
++ }
++ }
++ }
++ }
++
++ if (rc != null) {
++ System.out.println(logmsg + " ==> " + rc);
++ return false;
++ }
++ return true;
++ }
++
++ public static void main(String[] args) {
++ boolean failed = false;
++ for (int i = 0; i < 10000; i++) {
++ failed |= !checkArgumentSyntax("theName", null, "\"<&", "Error consistencyCheck: name in component definition");
++ failed |= !checkArgumentSyntax(null, null, "\"<&", "Error consistencyCheck: name in component definition");
++ failed |= !checkArgumentSyntax("42", "0123456789.", null, "Error consistencyCheck: counter in component definition");
++ }
++ System.out.println(failed);
++ }
++}
+--- ./hotspot/test/compiler/testlibrary/rtm/AbortProvoker.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/testlibrary/rtm/AbortProvoker.java Wed Jul 01 21:52:18 2015 -0700
+@@ -29,8 +29,7 @@
+ import java.util.concurrent.CyclicBarrier;
+
+ import com.oracle.java.testlibrary.Asserts;
+-import com.oracle.java.testlibrary.Utils;
+-import sun.misc.Unsafe;
++import sun.hotspot.WhiteBox;
+
+ /**
+ * Base class for different transactional execution abortion
+@@ -38,6 +37,9 @@
+ */
+ public abstract class AbortProvoker implements CompilableTest {
+ public static final long DEFAULT_ITERATIONS = 10000L;
++ private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
++ @SuppressWarnings("unused")
++ private static int sharedState = 0;
+ /**
+ * Inflates monitor associated with object {@code monitor}.
+ * Inflation is forced by entering the same monitor from
+@@ -48,36 +50,76 @@
+ * @throws Exception if something went wrong.
+ */
+ public static Object inflateMonitor(Object monitor) throws Exception {
+- Unsafe unsafe = Utils.getUnsafe();
+ CyclicBarrier barrier = new CyclicBarrier(2);
+
+ Runnable inflatingRunnable = () -> {
+- unsafe.monitorEnter(monitor);
+- try {
+- barrier.await();
+- barrier.await();
+- } catch (InterruptedException | BrokenBarrierException e) {
+- throw new RuntimeException(
+- "Synchronization issue occurred.", e);
+- } finally {
+- unsafe.monitorExit(monitor);
++ synchronized (monitor) {
++ try {
++ barrier.await();
++ } catch (BrokenBarrierException | InterruptedException e) {
++ throw new RuntimeException(
++ "Synchronization issue occurred.", e);
++ }
++ try {
++ monitor.wait();
++ } catch (InterruptedException e) {
++ throw new AssertionError("The thread waiting on an"
++ + " inflated monitor was interrupted, thus test"
++ + " results may be incorrect.", e);
++ }
+ }
+ };
+
+ Thread t = new Thread(inflatingRunnable);
++ t.setDaemon(true);
+ t.start();
+ // Wait until thread t enters the monitor.
+ barrier.await();
+- // At this point monitor will be owned by thread t,
+- // so our attempt to enter the same monitor will force
+- // monitor inflation.
+- Asserts.assertFalse(unsafe.tryMonitorEnter(monitor),
+- "Not supposed to enter the monitor first");
+- barrier.await();
+- t.join();
++ synchronized (monitor) {
++ // At this point thread t is already waiting on the monitor.
++ // Modifying static field just to avoid lock's elimination.
++ sharedState++;
++ }
++ verifyMonitorState(monitor, true /* inflated */);
+ return monitor;
+ }
+
++ /**
++ * Verifies that {@code monitor} is a stack-lock or inflated lock depending
++ * on {@code shouldBeInflated} value. If {@code monitor} is inflated while
++ * it is expected that it should be a stack-lock, then this method attempts
++ * to deflate it by forcing a safepoint and then verifies the state once
++ * again.
++ *
++ * @param monitor monitor to be verified.
++ * @param shouldBeInflated flag indicating whether or not monitor is
++ * expected to be inflated.
++ * @throws RuntimeException if the {@code monitor} in a wrong state.
++ */
++ public static void verifyMonitorState(Object monitor,
++ boolean shouldBeInflated) {
++ if (!shouldBeInflated && WHITE_BOX.isMonitorInflated(monitor)) {
++ WHITE_BOX.forceSafepoint();
++ }
++ Asserts.assertEQ(WHITE_BOX.isMonitorInflated(monitor), shouldBeInflated,
++ "Monitor in a wrong state.");
++ }
++ /**
++ * Verifies that monitor used by the {@code provoker} is a stack-lock or
++ * inflated lock depending on {@code shouldBeInflated} value. If such
++ * monitor is inflated while it is expected that it should be a stack-lock,
++ * then this method attempts to deflate it by forcing a safepoint and then
++ * verifies the state once again.
++ *
++ * @param provoker AbortProvoker whose monitor's state should be verified.
++ * @param shouldBeInflated flag indicating whether or not monitor is
++ * expected to be inflated.
++ * @throws RuntimeException if the {@code monitor} in a wrong state.
++ */
++ public static void verifyMonitorState(AbortProvoker provoker,
++ boolean shouldBeInflated) {
++ verifyMonitorState(provoker.monitor, shouldBeInflated);
++ }
+
+ /**
+ * Get instance of specified AbortProvoker, inflate associated monitor
+@@ -120,6 +162,7 @@
+ }
+
+ for (long i = 0; i < iterations; i++) {
++ AbortProvoker.verifyMonitorState(provoker, monitorShouldBeInflated);
+ provoker.forceAbort();
+ }
+ }
+--- ./hotspot/test/compiler/testlibrary/rtm/BusyLock.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/testlibrary/rtm/BusyLock.java Wed Jul 01 21:52:18 2015 -0700
+@@ -77,7 +77,7 @@
+ }
+ }
+
+- public void test() {
++ public void syncAndTest() {
+ try {
+ barrier.await();
+ // wait until monitor is locked by a ::run method
+@@ -85,6 +85,10 @@
+ } catch (InterruptedException | BrokenBarrierException e) {
+ throw new RuntimeException("Synchronization error happened.", e);
+ }
++ test();
++ }
++
++ public void test() {
+ synchronized(monitor) {
+ BusyLock.field++;
+ }
+@@ -130,7 +134,7 @@
+
+ Thread t = new Thread(busyLock);
+ t.start();
+- busyLock.test();
++ busyLock.syncAndTest();
+ t.join();
+ }
+ }
+--- ./hotspot/test/compiler/testlibrary/rtm/MemoryConflictProvoker.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/testlibrary/rtm/MemoryConflictProvoker.java Wed Jul 01 21:52:18 2015 -0700
+@@ -69,11 +69,6 @@
+ * Accesses and modifies memory region from within the transaction.
+ */
+ public void transactionalRegion() {
+- try {
+- barrier.await();
+- } catch (InterruptedException | BrokenBarrierException e) {
+- throw new RuntimeException(e);
+- }
+ for (int i = 0; i < MemoryConflictProvoker.INNER_ITERATIONS; i++) {
+ synchronized(monitor) {
+ MemoryConflictProvoker.field--;
+@@ -86,6 +81,11 @@
+ try {
+ Thread t = new Thread(conflictingThread);
+ t.start();
++ try {
++ barrier.await();
++ } catch (InterruptedException | BrokenBarrierException e) {
++ throw new RuntimeException(e);
++ }
+ transactionalRegion();
+ t.join();
+ } catch (Exception e) {
+--- ./hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java Wed Jul 01 21:52:18 2015 -0700
+@@ -238,10 +238,10 @@
+ String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
+ Collections.addAll(finalVMOpts, filteredVMOpts);
+ Collections.addAll(finalVMOpts, "-Xcomp", "-server",
+- "-XX:-TieredCompilation",
++ "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
+ CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
+ CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+- "-XX:+UseRTMLocking");
++ "-Xbootclasspath/a:.", "-XX:+WhiteBoxAPI");
+
+ if (test != null) {
+ for (String method : test.getMethodsToCompileNames()) {
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/types/TestMeetExactConstantArrays.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,70 @@
++/*
++ * 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 8075587
++ * @summary meet of 2 constant arrays result in bottom
++ * @run main/othervm TestMeetExactConstantArrays
++ *
++ */
++
++public class TestMeetExactConstantArrays {
++ public abstract static class NumbersHolder {
++ public Number[] getNumbers() {
++ return null;
++ }
++ }
++
++ public static class IntegersHolder extends NumbersHolder {
++ private final static Integer integers[] = { new Integer(1) };
++
++ public Number[] getNumbers() {
++ return integers;
++ }
++ }
++
++ public static class LongsHolder extends NumbersHolder {
++ private final static Long longs[] = { new Long(1) };
++
++ public Number[] getNumbers() {
++ return longs;
++ }
++ }
++
++ public static final void loopNumbers(NumbersHolder numbersHolder) {
++ Number[] numbers = numbersHolder.getNumbers();
++ for (int i = 0; i < numbers.length; i++) {
++ numbers[i].longValue();
++ }
++ }
++
++ public static void main(String[] args) throws Exception {
++ for (int i = 0; i < 10000; i++) {
++ IntegersHolder integersHolder = new IntegersHolder();
++ LongsHolder longsHolder = new LongsHolder();
++ loopNumbers(integersHolder);
++ loopNumbers(longsHolder);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/types/TestTypePropagationToCmpU.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,59 @@
++/*
++ * 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 8080156 8060036
++ * @summary Test correctness of type propagation to CmpUNodes.
++ * @run main TestTypePropagationToCmpU
++ */
++public class TestTypePropagationToCmpU {
++ public static void main(String[] args) {
++ try {
++ // Trigger compilation
++ for (int i = 0; i < 100_000; ++i) {
++ test();
++ }
++ } catch (NullPointerException e) {
++ // Test should never throw a NullPointerException
++ throw new RuntimeException("Test failed");
++ }
++ }
++
++ static int global = 42;
++
++ public static void test() {
++ int a = Integer.MIN_VALUE;
++ int b = global;
++ char[] buf = { 0 };
++ for (int i = 0; i <= b; ++i) {
++ a = i - b;
++ }
++ // C2 adds a range check and an uncommon trap here to ensure that the array index
++ // is in bounds. If type information is not propagated correctly to the corresponding
++ // CmpUNode, this trap may be always taken. Because C2 also removes the unnecessary
++ // allocation of 'buf', a NullPointerException is thrown in this case.
++ char c = buf[(a * 11) / 2 - a]; // a is 0 here if global >= 0
++ buf[0] = 0;
++ }
++}
+--- ./hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -27,9 +27,7 @@
+ * @bug 8026775
+ * @summary Uncommon trap blob did not bang all the stack shadow pages
+ *
+- * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:+TieredCompilation UncommonTrapStackBang
+- * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation UncommonTrapStackBang
+- *
++ * @run main/othervm UncommonTrapStackBang
+ *
+ * Note: This test does not reproduce the problem with absolute
+ * certainty. Empirically the bug reproduces on Windows some 80+% of
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/compiler/unsafe/TestUnsafeLoadControl.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,103 @@
++/*
++ * 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 8077504
++ * @summary Unsafe load can loose control dependency and cause crash
++ * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestUnsafeLoadControl
++ *
++ */
++
++import java.lang.reflect.Field;
++import sun.misc.Unsafe;
++
++public class TestUnsafeLoadControl {
++
++ private static final Unsafe UNSAFE;
++
++ static {
++ try {
++ Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
++ unsafeField.setAccessible(true);
++ UNSAFE = (Unsafe) unsafeField.get(null);
++ } catch(Exception e) {
++ throw new RuntimeException(e);
++ }
++ }
++
++ static int val;
++ static void test1(int[] a, boolean[] flags, boolean flag, long j) {
++ for (int i = 0; i < 10; i++) {
++ if (flags[i]) {
++ if (flag) {
++ long address = (j << 2) + UNSAFE.ARRAY_INT_BASE_OFFSET;
++ int v = UNSAFE.getInt(a, address);
++ val = v;
++ }
++ }
++ }
++ }
++
++ static int test2(int[] a, boolean[] flags, boolean flag, long j) {
++ int sum = 0;
++ for (int i = 0; i < 10; i++) {
++ if (flags[i]) {
++ if (flag) {
++ long address = (j << 2) + UNSAFE.ARRAY_INT_BASE_OFFSET;
++ int v = UNSAFE.getInt(a, address);
++ if (v == 0) {
++ sum++;
++ }
++ }
++ }
++ }
++ return sum;
++ }
++
++ static public void main(String[] args) {
++ boolean[] flags = new boolean[10];
++ for (int i = 0; i < flags.length; i++) {
++ flags[i] = true;
++ }
++ int[] array = new int[10];
++ for (int i = 0; i < 20000; i++) {
++ test1(array, flags, true, 0);
++ }
++ for (int i = 0; i < flags.length; i++) {
++ flags[i] = false;
++ }
++ test1(array, flags, true, Long.MAX_VALUE/4);
++
++ for (int i = 0; i < flags.length; i++) {
++ flags[i] = true;
++ }
++ for (int i = 0; i < 20000; i++) {
++ test2(array, flags, true, 0);
++ }
++ for (int i = 0; i < flags.length; i++) {
++ flags[i] = false;
++ }
++ test2(array, flags, true, Long.MAX_VALUE/4);
++ }
++}
+--- ./hotspot/test/gc/6581734/Test6581734.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/6581734/Test6581734.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -24,6 +24,7 @@
+ /*
+ * @test Test6581734.java
+ * @bug 6581734
++ * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
+ * @summary CMS Old Gen's collection usage is zero after GC which is incorrect
+ * @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC Test6581734
+ *
+--- ./hotspot/test/gc/TestSystemGC.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/TestSystemGC.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++* Copyright (c) 2013, 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
+@@ -24,6 +24,7 @@
+ /*
+ * @test TestSystemGC
+ * @key gc
++ * @requires vm.gc=="null"
+ * @summary Runs System.gc() with different flags.
+ * @run main/othervm TestSystemGC
+ * @run main/othervm -XX:+UseSerialGC TestSystemGC
+--- ./hotspot/test/gc/arguments/TestAlignmentToUseLargePages.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/arguments/TestAlignmentToUseLargePages.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -28,6 +28,7 @@
+ * @bug 8024396
+ * @key gc
+ * @key regression
++ * @requires vm.gc=="null"
+ * @run main/othervm -Xms7M -Xmx9M -XX:+UseParallelGC -XX:-UseParallelOldGC -XX:+UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms7M -Xmx9M -XX:+UseParallelGC -XX:-UseParallelOldGC -XX:-UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms7M -Xmx9M -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+UseLargePages TestAlignmentToUseLargePages
+--- ./hotspot/test/gc/arguments/TestG1HeapRegionSize.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/arguments/TestG1HeapRegionSize.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++* Copyright (c) 2013, 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
+@@ -25,11 +25,12 @@
+ * @test TestG1HeapRegionSize
+ * @key gc
+ * @bug 8021879
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @summary Verify that the flag G1HeapRegionSize is updated properly
+ * @run main/othervm -Xmx64m TestG1HeapRegionSize 1048576
+- * @run main/othervm -XX:G1HeapRegionSize=2m -Xmx64m TestG1HeapRegionSize 2097152
+- * @run main/othervm -XX:G1HeapRegionSize=3m -Xmx64m TestG1HeapRegionSize 2097152
+- * @run main/othervm -XX:G1HeapRegionSize=64m -Xmx256m TestG1HeapRegionSize 33554432
++ * @run main/othervm -XX:G1HeapRegionSize=2m -Xmx64m -XX:+UseG1GC TestG1HeapRegionSize 2097152
++ * @run main/othervm -XX:G1HeapRegionSize=3m -Xmx64m -XX:+UseG1GC TestG1HeapRegionSize 2097152
++ * @run main/othervm -XX:G1HeapRegionSize=64m -Xmx256m -XX:+UseG1GC TestG1HeapRegionSize 33554432
+ */
+
+ import sun.management.ManagementFactoryHelper;
+@@ -41,14 +42,8 @@
+ public static void main(String[] args) {
+ HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean();
+
+- VMOption option = diagnostic.getVMOption("UseG1GC");
+- if (option.getValue().equals("false")) {
+- System.out.println("Skipping this test. It is only a G1 test.");
+- return;
+- }
+-
+ String expectedValue = getExpectedValue(args);
+- option = diagnostic.getVMOption("G1HeapRegionSize");
++ VMOption option = diagnostic.getVMOption("G1HeapRegionSize");
+ if (!expectedValue.equals(option.getValue())) {
+ throw new RuntimeException("Wrong value for G1HeapRegionSize. Expected " + expectedValue + " but got " + option.getValue());
+ }
+--- ./hotspot/test/gc/concurrentMarkSweep/DisableResizePLAB.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/concurrentMarkSweep/DisableResizePLAB.java Wed Jul 01 21:52:18 2015 -0700
+@@ -26,6 +26,7 @@
+ * @key gc
+ * @bug 8060467
+ * @author filipp.zhinkin@oracle.com, john.coomes@oracle.com
++ * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
+ * @summary Run CMS with PLAB resizing disabled and a small OldPLABSize
+ * @run main/othervm -XX:+UseConcMarkSweepGC -XX:-ResizePLAB -XX:OldPLABSize=1k -Xmx256m -XX:+PrintGCDetails DisableResizePLAB
+ */
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/gc/g1/Test2GbHeap.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/*
++ * @test Test2GbHeap
++ * @bug 8031686
++ * @summary Regression test to ensure we can start G1 with 2gb heap.
++ * @key gc
++ * @key regression
++ * @library /testlibrary
++ */
++
++import java.util.ArrayList;
++
++import com.oracle.java.testlibrary.OutputAnalyzer;
++import com.oracle.java.testlibrary.ProcessTools;
++
++public class Test2GbHeap {
++ public static void main(String[] args) throws Exception {
++ ArrayList<String> testArguments = new ArrayList<String>();
++
++ testArguments.add("-XX:+UseG1GC");
++ testArguments.add("-Xmx2g");
++ testArguments.add("-version");
++
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testArguments.toArray(new String[0]));
++
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++
++ // Avoid failing test for setups not supported.
++ if (output.getOutput().contains("Could not reserve enough space for 2097152KB object heap")) {
++ // Will fail on machines with too little memory (and Windows 32-bit VM), ignore such failures.
++ output.shouldHaveExitValue(1);
++ } else if (output.getOutput().contains("G1 GC is disabled in this release")) {
++ // G1 is not supported on embedded, ignore such failures.
++ output.shouldHaveExitValue(1);
++ } else {
++ // Normally everything should be fine.
++ output.shouldHaveExitValue(0);
++ }
++ }
++}
+--- ./hotspot/test/gc/g1/TestEagerReclaimHumongousRegions2.java Mon Jun 01 11:40:55 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,131 +0,0 @@
+-/*
+- * Copyright (c) 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.
+- */
+-
+-/*
+- * @test TestEagerReclaimHumongousRegions2
+- * @bug 8051973
+- * @summary Test to make sure that eager reclaim of humongous objects correctly clears
+- * mark bitmaps at reclaim.
+- * @key gc
+- * @library /testlibrary
+- */
+-
+-import java.util.ArrayList;
+-import java.util.LinkedList;
+-import java.util.Random;
+-
+-import com.oracle.java.testlibrary.OutputAnalyzer;
+-import com.oracle.java.testlibrary.ProcessTools;
+-
+-// An object that has a few references to other instances to slow down marking.
+-class ObjectWithSomeRefs {
+- public ObjectWithSomeRefs other1;
+- public ObjectWithSomeRefs other2;
+- public ObjectWithSomeRefs other3;
+- public ObjectWithSomeRefs other4;
+-}
+-
+-class ReclaimRegionFast {
+- public static final long MAX_MILLIS_FOR_RUN = 50 * 1000; // The maximum runtime for the actual test.
+-
+- public static final int M = 1024*1024;
+-
+- public static LinkedList<Object> garbageList = new LinkedList<Object>();
+-
+- public static void genGarbage(Object large) {
+- for (int i = 0; i < 64*1024; i++) {
+- Object[] garbage = new Object[50];
+- garbage[0] = large;
+- garbageList.add(garbage);
+- }
+- garbageList.clear();
+- }
+-
+- public static ArrayList<ObjectWithSomeRefs> longList = new ArrayList<ObjectWithSomeRefs>();
+-
+- public static void main(String[] args) {
+-
+- for (int i = 0; i < 16*1024; i++) {
+- longList.add(new ObjectWithSomeRefs());
+- }
+-
+- Random rnd = new Random();
+- for (int i = 0; i < longList.size(); i++) {
+- int len = longList.size();
+- longList.get(i).other1 = longList.get(rnd.nextInt(len));
+- longList.get(i).other2 = longList.get(rnd.nextInt(len));
+- longList.get(i).other3 = longList.get(rnd.nextInt(len));
+- longList.get(i).other4 = longList.get(rnd.nextInt(len));
+- }
+-
+- int[] large1 = new int[M];
+- int[] large2 = null;
+- int[] large3 = null;
+- int[] large4 = null;
+-
+- Object ref_from_stack = large1;
+-
+- long start_millis = System.currentTimeMillis();
+-
+- for (int i = 0; i < 20; i++) {
+- long current_millis = System.currentTimeMillis();
+- if ((current_millis - start_millis) > MAX_MILLIS_FOR_RUN) {
+- System.out.println("Finishing test because maximum runtime exceeded");
+- break;
+- }
+- // A set of large objects that will be reclaimed eagerly - and hopefully marked.
+- large1 = new int[M - 20];
+- large2 = new int[M - 20];
+- large3 = new int[M - 20];
+- large4 = new int[M - 20];
+- genGarbage(large1);
+- // Make sure that the compiler cannot completely remove
+- // the allocation of the large object until here.
+- System.out.println(large1 + " " + large2 + " " + large3 + " " + large4);
+- }
+-
+- // Keep the reference to the first object alive.
+- System.out.println(ref_from_stack);
+- }
+-}
+-
+-public class TestEagerReclaimHumongousRegions2 {
+- public static void main(String[] args) throws Exception {
+- ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+- "-XX:+UseG1GC",
+- "-Xms128M",
+- "-Xmx128M",
+- "-Xmn2M",
+- "-XX:G1HeapRegionSize=1M",
+- "-XX:InitiatingHeapOccupancyPercent=0", // Want to have as much as possible initial marks.
+- "-XX:+PrintGC",
+- "-XX:+VerifyAfterGC",
+- "-XX:ConcGCThreads=1", // Want to make marking as slow as possible.
+- "-XX:+IgnoreUnrecognizedVMOptions", // G1VerifyBitmaps is develop only.
+- "-XX:+G1VerifyBitmaps",
+- ReclaimRegionFast.class.getName());
+- OutputAnalyzer output = new OutputAnalyzer(pb.start());
+- output.shouldHaveExitValue(0);
+- }
+-}
+-
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,131 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/*
++ * @test TestEagerReclaimHumongousRegionsClearMarkBits
++ * @bug 8051973
++ * @summary Test to make sure that eager reclaim of humongous objects correctly clears
++ * mark bitmaps at reclaim.
++ * @key gc
++ * @library /testlibrary
++ */
++
++import java.util.ArrayList;
++import java.util.LinkedList;
++import java.util.Random;
++
++import com.oracle.java.testlibrary.OutputAnalyzer;
++import com.oracle.java.testlibrary.ProcessTools;
++
++// An object that has a few references to other instances to slow down marking.
++class ObjectWithSomeRefs {
++ public ObjectWithSomeRefs other1;
++ public ObjectWithSomeRefs other2;
++ public ObjectWithSomeRefs other3;
++ public ObjectWithSomeRefs other4;
++}
++
++class ReclaimRegionFast {
++ public static final long MAX_MILLIS_FOR_RUN = 50 * 1000; // The maximum runtime for the actual test.
++
++ public static final int M = 1024*1024;
++
++ public static LinkedList<Object> garbageList = new LinkedList<Object>();
++
++ public static void genGarbage(Object large) {
++ for (int i = 0; i < 64*1024; i++) {
++ Object[] garbage = new Object[50];
++ garbage[0] = large;
++ garbageList.add(garbage);
++ }
++ garbageList.clear();
++ }
++
++ public static ArrayList<ObjectWithSomeRefs> longList = new ArrayList<ObjectWithSomeRefs>();
++
++ public static void main(String[] args) {
++
++ for (int i = 0; i < 16*1024; i++) {
++ longList.add(new ObjectWithSomeRefs());
++ }
++
++ Random rnd = new Random();
++ for (int i = 0; i < longList.size(); i++) {
++ int len = longList.size();
++ longList.get(i).other1 = longList.get(rnd.nextInt(len));
++ longList.get(i).other2 = longList.get(rnd.nextInt(len));
++ longList.get(i).other3 = longList.get(rnd.nextInt(len));
++ longList.get(i).other4 = longList.get(rnd.nextInt(len));
++ }
++
++ int[] large1 = new int[M];
++ int[] large2 = null;
++ int[] large3 = null;
++ int[] large4 = null;
++
++ Object ref_from_stack = large1;
++
++ long start_millis = System.currentTimeMillis();
++
++ for (int i = 0; i < 20; i++) {
++ long current_millis = System.currentTimeMillis();
++ if ((current_millis - start_millis) > MAX_MILLIS_FOR_RUN) {
++ System.out.println("Finishing test because maximum runtime exceeded");
++ break;
++ }
++ // A set of large objects that will be reclaimed eagerly - and hopefully marked.
++ large1 = new int[M - 20];
++ large2 = new int[M - 20];
++ large3 = new int[M - 20];
++ large4 = new int[M - 20];
++ genGarbage(large1);
++ // Make sure that the compiler cannot completely remove
++ // the allocation of the large object until here.
++ System.out.println(large1 + " " + large2 + " " + large3 + " " + large4);
++ }
++
++ // Keep the reference to the first object alive.
++ System.out.println(ref_from_stack);
++ }
++}
++
++public class TestEagerReclaimHumongousRegionsClearMarkBits {
++ public static void main(String[] args) throws Exception {
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
++ "-XX:+UseG1GC",
++ "-Xms128M",
++ "-Xmx128M",
++ "-Xmn2M",
++ "-XX:G1HeapRegionSize=1M",
++ "-XX:InitiatingHeapOccupancyPercent=0", // Want to have as much as possible initial marks.
++ "-XX:+PrintGC",
++ "-XX:+VerifyAfterGC",
++ "-XX:ConcGCThreads=1", // Want to make marking as slow as possible.
++ "-XX:+IgnoreUnrecognizedVMOptions", // G1VerifyBitmaps is develop only.
++ "-XX:+G1VerifyBitmaps",
++ ReclaimRegionFast.class.getName());
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++ output.shouldHaveExitValue(0);
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,113 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/*
++ * @test TestEagerReclaimHumongousRegionsWithRefs
++ * @bug 8048179
++ * @summary Test to make sure that eager reclaim of humongous objects that have previously
++ * been referenced by other old gen regions work. We simply try to fill
++ * up the heap with humongous objects and create a remembered set entry from an object by
++ * referencing that we know is in the old gen. After changing this reference, the object
++ * should still be eagerly reclaimable to avoid Full GC.
++ * @key gc
++ * @library /testlibrary
++ */
++
++import java.util.regex.Pattern;
++import java.util.regex.Matcher;
++import java.util.LinkedList;
++
++import com.oracle.java.testlibrary.OutputAnalyzer;
++import com.oracle.java.testlibrary.ProcessTools;
++import static com.oracle.java.testlibrary.Asserts.*;
++
++class RefHolder {
++ Object ref;
++}
++
++class ReclaimRegionFast {
++
++ public static final int M = 1024*1024;
++
++ public static LinkedList<Object> garbageList = new LinkedList<Object>();
++
++ public static void genGarbage() {
++ for (int i = 0; i < 32*1024; i++) {
++ garbageList.add(new int[100]);
++ }
++ garbageList.clear();
++ }
++
++
++ // A large object referenced by a static.
++ static int[] filler = new int[10 * M];
++
++ // Old gen object referencing the large object, generating remembered
++ // set entries.
++ static RefHolder fromOld = new RefHolder();
++
++ public static void main(String[] args) {
++
++ int[] large = new int[M];
++
++ Object ref_from_stack = large;
++
++ for (int i = 0; i < 100; i++) {
++ // A large object that will be reclaimed eagerly.
++ large = new int[6*M];
++ fromOld.ref = large;
++ genGarbage();
++ }
++
++ // Keep the reference to the first object alive.
++ System.out.println(ref_from_stack);
++ }
++}
++
++public class TestEagerReclaimHumongousRegionsWithRefs {
++
++ public static void main(String[] args) throws Exception {
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
++ "-XX:+UseG1GC",
++ "-Xms128M",
++ "-Xmx128M",
++ "-Xmn16M",
++ "-XX:+PrintGC",
++ ReclaimRegionFast.class.getName());
++
++ Pattern p = Pattern.compile("Full GC");
++
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++
++ int found = 0;
++ Matcher m = p.matcher(output.getStdout());
++ while (m.find()) {
++ found++;
++ }
++ System.out.println("Issued " + found + " Full GCs");
++
++ assertLessThan(found, 10, "Found that " + found + " Full GCs were issued. This is larger than the bound. Eager reclaim of objects once referenced from old gen seems to not work at all");
++ output.shouldHaveExitValue(0);
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,142 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/*
++ * @test TestG1TraceEagerReclaimHumongousObjects
++ * @bug 8058801 8048179
++ * @summary Ensure that the output for a G1TraceEagerReclaimHumongousObjects
++ * includes the expected necessary messages.
++ * @key gc
++ * @library /testlibrary
++ */
++
++import com.oracle.java.testlibrary.ProcessTools;
++import com.oracle.java.testlibrary.OutputAnalyzer;
++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",
++ "-XX:+PrintGC",
++ "-XX:+UnlockExperimentalVMOptions",
++ "-XX:G1LogLevel=finest",
++ "-XX:+G1TraceEagerReclaimHumongousObjects",
++ 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",
++ "-Xmn16M",
++ "-XX:G1HeapRegionSize=1M",
++ "-XX:+PrintGC",
++ "-XX:+UnlockExperimentalVMOptions",
++ "-XX:G1LogLevel=finest",
++ "-XX:+G1TraceEagerReclaimHumongousObjects",
++ GCWithHumongousObjectTest.class.getName());
++
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++
++ // As G1ReclaimDeadHumongousObjectsAtYoungGC is set(default), below logs should be displayed.
++ output.shouldContain("[Humongous Reclaim");
++ output.shouldContain("[Humongous Total");
++ output.shouldContain("[Humongous Candidate");
++ output.shouldContain("[Humongous Reclaimed");
++
++ // As G1TraceReclaimDeadHumongousObjectsAtYoungGC is set and GCWithHumongousObjectTest has humongous objects,
++ // these logs should be displayed.
++ output.shouldContain("Live humongous");
++ output.shouldContain("Dead humongous region");
++ 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;
++ public static LinkedList<Object> garbageList = new LinkedList<Object>();
++ // A large object referenced by a static.
++ static int[] filler = new int[10 * M];
++
++ public static void genGarbage() {
++ for (int i = 0; i < 32*1024; i++) {
++ garbageList.add(new int[100]);
++ }
++ garbageList.clear();
++ }
++
++ public static void main(String[] args) {
++
++ int[] large = new int[M];
++ Object ref = large;
++
++ System.out.println("Creating garbage");
++ for (int i = 0; i < 100; i++) {
++ // A large object that will be reclaimed eagerly.
++ large = new int[6*M];
++ genGarbage();
++ // Make sure that the compiler cannot completely remove
++ // the allocation of the large object until here.
++ System.out.println(large);
++ }
++
++ // Keep the reference to the first object alive.
++ System.out.println(ref);
++ System.out.println("Done");
++ }
++ }
++}
+--- ./hotspot/test/gc/g1/TestGCLogMessages.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestGCLogMessages.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,7 +23,7 @@
+
+ /*
+ * @test TestGCLogMessages
+- * @bug 8035406 8027295 8035398 8019342 8027959
++ * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962
+ * @summary Ensure that the PrintGCDetails output for a minor GC with G1
+ * includes the expected necessary messages.
+ * @key gc
+@@ -34,128 +34,159 @@
+ import com.oracle.java.testlibrary.OutputAnalyzer;
+
+ public class TestGCLogMessages {
+- public static void main(String[] args) throws Exception {
+- testNormalLogs();
+- testWithToSpaceExhaustionLogs();
+- }
+
+- private static void testNormalLogs() throws Exception {
++ private enum Level {
++ OFF, FINER, FINEST;
++ public boolean lessOrEqualTo(Level other) {
++ return this.compareTo(other) < 0;
++ }
++ }
+
+- ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+- "-Xmx10M",
+- GCTest.class.getName());
++ private class LogMessageWithLevel {
++ String message;
++ Level level;
+
+- OutputAnalyzer output = new OutputAnalyzer(pb.start());
++ public LogMessageWithLevel(String message, Level level) {
++ this.message = message;
++ this.level = level;
++ }
++ };
+
+- output.shouldNotContain("[Redirty Cards");
+- output.shouldNotContain("[Parallel Redirty");
+- output.shouldNotContain("[Redirtied Cards");
+- output.shouldNotContain("[Code Root Purge");
+- output.shouldNotContain("[String Dedup Fixup");
+- output.shouldNotContain("[Young Free CSet");
+- output.shouldNotContain("[Non-Young Free CSet");
+- output.shouldNotContain("[Humongous Reclaim");
+- output.shouldHaveExitValue(0);
++ private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] {
++ // Ext Root Scan
++ new LogMessageWithLevel("Thread Roots (ms)", Level.FINEST),
++ new LogMessageWithLevel("StringTable Roots (ms)", Level.FINEST),
++ new LogMessageWithLevel("Universe Roots (ms)", Level.FINEST),
++ new LogMessageWithLevel("JNI Handles Roots (ms)", Level.FINEST),
++ new LogMessageWithLevel("ObjectSynchronizer Roots (ms)", Level.FINEST),
++ new LogMessageWithLevel("FlatProfiler Roots", Level.FINEST),
++ new LogMessageWithLevel("Management Roots", Level.FINEST),
++ new LogMessageWithLevel("SystemDictionary Roots", Level.FINEST),
++ new LogMessageWithLevel("CLDG Roots", Level.FINEST),
++ new LogMessageWithLevel("JVMTI Roots", Level.FINEST),
++ new LogMessageWithLevel("CodeCache Roots", Level.FINEST),
++ new LogMessageWithLevel("SATB Filtering", Level.FINEST),
++ new LogMessageWithLevel("CM RefProcessor Roots", Level.FINEST),
++ new LogMessageWithLevel("Wait For Strong CLD", Level.FINEST),
++ new LogMessageWithLevel("Weak CLD Roots", Level.FINEST),
++ // Redirty Cards
++ new LogMessageWithLevel("Redirty Cards", Level.FINER),
++ new LogMessageWithLevel("Parallel Redirty", Level.FINEST),
++ new LogMessageWithLevel("Redirtied Cards", Level.FINEST),
++ // Misc Top-level
++ new LogMessageWithLevel("Code Root Purge", Level.FINER),
++ new LogMessageWithLevel("String Dedup Fixup", Level.FINER),
++ // Free CSet
++ new LogMessageWithLevel("Young Free CSet", Level.FINEST),
++ new LogMessageWithLevel("Non-Young Free CSet", Level.FINEST),
++ // Humongous Eager Reclaim
++ new LogMessageWithLevel("Humongous Reclaim", Level.FINER),
++ new LogMessageWithLevel("Humongous Register", Level.FINER),
++ };
+
+- pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+- "-XX:+UseStringDeduplication",
+- "-Xmx10M",
+- "-XX:+PrintGCDetails",
+- GCTest.class.getName());
++ void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception {
++ for (LogMessageWithLevel l : messages) {
++ if (level.lessOrEqualTo(l.level)) {
++ output.shouldNotContain(l.message);
++ } else {
++ output.shouldContain(l.message);
++ }
++ }
++ }
+
+- output = new OutputAnalyzer(pb.start());
++ public static void main(String[] args) throws Exception {
++ new TestGCLogMessages().testNormalLogs();
++ new TestGCLogMessages().testWithToSpaceExhaustionLogs();
++ }
+
+- output.shouldContain("[Redirty Cards");
+- output.shouldNotContain("[Parallel Redirty");
+- output.shouldNotContain("[Redirtied Cards");
+- output.shouldContain("[Code Root Purge");
+- output.shouldContain("[String Dedup Fixup");
+- output.shouldNotContain("[Young Free CSet");
+- output.shouldNotContain("[Non-Young Free CSet");
+- output.shouldContain("[Humongous Reclaim");
+- output.shouldNotContain("[Humongous Total");
+- output.shouldNotContain("[Humongous Candidate");
+- output.shouldNotContain("[Humongous Reclaimed");
+- output.shouldHaveExitValue(0);
++ private void testNormalLogs() throws Exception {
+
+- pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+- "-XX:+UseStringDeduplication",
+- "-Xmx10M",
+- "-XX:+PrintGCDetails",
+- "-XX:+UnlockExperimentalVMOptions",
+- "-XX:G1LogLevel=finest",
+- GCTest.class.getName());
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
++ "-Xmx10M",
++ GCTest.class.getName());
+
+- output = new OutputAnalyzer(pb.start());
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++ checkMessagesAtLevel(output, allLogMessages, Level.OFF);
++ output.shouldHaveExitValue(0);
+
+- output.shouldContain("[Redirty Cards");
+- output.shouldContain("[Parallel Redirty");
+- output.shouldContain("[Redirtied Cards");
+- output.shouldContain("[Code Root Purge");
+- output.shouldContain("[String Dedup Fixup");
+- output.shouldContain("[Young Free CSet");
+- output.shouldContain("[Non-Young Free CSet");
+- output.shouldContain("[Humongous Reclaim");
+- output.shouldContain("[Humongous Total");
+- output.shouldContain("[Humongous Candidate");
+- output.shouldContain("[Humongous Reclaimed");
+- output.shouldHaveExitValue(0);
+- }
++ pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
++ "-XX:+UseStringDeduplication",
++ "-Xmx10M",
++ "-XX:+PrintGCDetails",
++ GCTest.class.getName());
+
+- private static void testWithToSpaceExhaustionLogs() throws Exception {
+- ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+- "-Xmx10M",
+- "-Xmn5M",
+- "-XX:+PrintGCDetails",
+- GCTestWithToSpaceExhaustion.class.getName());
++ output = new OutputAnalyzer(pb.start());
++ checkMessagesAtLevel(output, allLogMessages, Level.FINER);
+
+- OutputAnalyzer output = new OutputAnalyzer(pb.start());
+- output.shouldContain("[Evacuation Failure");
+- output.shouldNotContain("[Recalculate Used");
+- output.shouldNotContain("[Remove Self Forwards");
+- output.shouldNotContain("[Restore RemSet");
+- output.shouldHaveExitValue(0);
++ pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
++ "-XX:+UseStringDeduplication",
++ "-Xmx10M",
++ "-XX:+PrintGCDetails",
++ "-XX:+UnlockExperimentalVMOptions",
++ "-XX:G1LogLevel=finest",
++ GCTest.class.getName());
+
+- pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+- "-Xmx10M",
+- "-Xmn5M",
+- "-XX:+PrintGCDetails",
+- "-XX:+UnlockExperimentalVMOptions",
+- "-XX:G1LogLevel=finest",
+- GCTestWithToSpaceExhaustion.class.getName());
++ output = new OutputAnalyzer(pb.start());
++ checkMessagesAtLevel(output, allLogMessages, Level.FINEST);
++ output.shouldHaveExitValue(0);
++ }
+
+- output = new OutputAnalyzer(pb.start());
+- output.shouldContain("[Evacuation Failure");
+- output.shouldContain("[Recalculate Used");
+- output.shouldContain("[Remove Self Forwards");
+- output.shouldContain("[Restore RemSet");
+- output.shouldHaveExitValue(0);
+- }
++ LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] {
++ new LogMessageWithLevel("Evacuation Failure", Level.FINER),
++ new LogMessageWithLevel("Recalculate Used", Level.FINEST),
++ new LogMessageWithLevel("Remove Self Forwards", Level.FINEST),
++ new LogMessageWithLevel("Restore RemSet", Level.FINEST),
++ };
+
+- 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");
++ private void testWithToSpaceExhaustionLogs() throws Exception {
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
++ "-Xmx32M",
++ "-Xmn16M",
++ "-XX:+PrintGCDetails",
++ GCTestWithToSpaceExhaustion.class.getName());
++
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++ checkMessagesAtLevel(output, exhFailureMessages, Level.FINER);
++ output.shouldHaveExitValue(0);
++
++ pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
++ "-Xmx32M",
++ "-Xmn16M",
++ "-XX:+PrintGCDetails",
++ "-XX:+UnlockExperimentalVMOptions",
++ "-XX:G1LogLevel=finest",
++ GCTestWithToSpaceExhaustion.class.getName());
++
++ output = new OutputAnalyzer(pb.start());
++ checkMessagesAtLevel(output, exhFailureMessages, Level.FINEST);
++ output.shouldHaveExitValue(0);
+ }
+- }
+
+- static class GCTestWithToSpaceExhaustion {
+- private static byte[] garbage;
+- private static byte[] largeObject;
+- public static void main(String [] args) {
+- largeObject = new byte[5*1024*1024];
+- System.out.println("Creating garbage");
+- // create 128MB of garbage. This should result in at least one GC,
+- // some of them with to-space exhaustion.
+- for (int i = 0; i < 1024; i++) {
+- garbage = new byte[128 * 1024];
+- }
+- System.out.println("Done");
++ 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 GCTestWithToSpaceExhaustion {
++ private static byte[] garbage;
++ private static byte[] largeObject;
++ public static void main(String [] args) {
++ largeObject = new byte[16*1024*1024];
++ System.out.println("Creating garbage");
++ // create 128MB of garbage. This should result in at least one GC,
++ // some of them with to-space exhaustion.
++ for (int i = 0; i < 1024; i++) {
++ garbage = new byte[128 * 1024];
++ }
++ System.out.println("Done");
++ }
++ }
+ }
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/gc/g1/TestGreyReclaimedHumongousObjects.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,176 @@
++/*
++ * 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 TestGreyReclaimedHumongousObjects.java
++ * @bug 8069367
++ * @requires vm.gc == "G1" | vm.gc == "null"
++ * @summary Test handling of marked but unscanned reclaimed humongous objects.
++ * @key gc
++ * @run main/othervm -XX:+UseG1GC -Xss32m -Xmx128m -XX:G1HeapRegionSize=1m
++ * -XX:+UnlockExperimentalVMOptions
++ * -XX:+G1EagerReclaimHumongousObjects
++ * -XX:+G1EagerReclaimHumongousObjectsWithStaleRefs
++ * TestGreyReclaimedHumongousObjects 1048576 90
++ */
++
++// This test spawns a bunch of threads, each of them rapidly
++// allocating large objects and storing them into a circular buffer
++// associated with the thread. The circular buffer results in these
++// objects becoming dead in fairly short order.
++//
++// The situation we're trying to provoke is
++//
++// (1) A humongous object H is marked and added to the mark stack.
++//
++// (2) An evacuation pause determines H is no longer live, and
++// reclaims it. This occurs before concurrent marking has gotten
++// around to processing the mark stack entry for H.
++//
++// (3) Concurrent marking processes the mark stack entry for H. The
++// bug is that it would attempt to scan the now dead object.
++//
++// Unfortunately, this test is *very* sensitive to configuration.
++// Among the parameters that affect whether / how often we'll get into
++// the desired situation within a reasonable amount of time are:
++//
++// - THREAD_COUNT: The number of allocating threads.
++//
++// - OLD_COUNT: The number of objects each thread keeps.
++//
++// - MAX_MEMORY: The maximum heap size.
++//
++// - G1HeapRegionSize
++//
++// - The size of the objects being allocated.
++//
++// The parameter values specified here:
++//
++// - THREAD_COUNT = 12
++// - OLD_COUNT == 4
++// - MAX_MEMORY == 128m
++// - G1HeapRegionSize = 1m
++// - Object size = 1048576 (2 regions after header overhead and roundup)
++//
++// seems to work well at provoking the desired state fairly quickly.
++// Even relatively small perturbations may change that. The key
++// factors seem to be keeping the heap mostly full of live objects but
++// having them become dead fairly quickly.
++
++import java.util.Date;
++import java.util.concurrent.ExecutorService;
++import java.util.concurrent.Executors;
++import java.util.concurrent.ThreadFactory;
++import java.util.concurrent.TimeUnit;
++import sun.management.ManagementFactoryHelper;
++import com.sun.management.HotSpotDiagnosticMXBean;
++import com.sun.management.VMOption;
++
++public class TestGreyReclaimedHumongousObjects {
++
++ static class NamedThreadFactory implements ThreadFactory {
++ private int threadNum = 0;
++
++ @Override
++ public Thread newThread(Runnable r) {
++ return new Thread(r, THREAD_NAME + (threadNum++));
++ }
++ }
++
++ static class Runner extends Thread {
++ private final Date startDate = new Date();
++ private final int obj_size;
++ private final Object[] old_garbage;
++ private int old_index = 0;
++
++ public Runner(int obj_size) {
++ this.obj_size = obj_size;
++ old_garbage = new Object[OLD_COUNT];
++ }
++
++ private void allocate_garbage() {
++ byte[] garbage = new byte[obj_size];
++ old_garbage[Math.abs(++old_index % OLD_COUNT)] = garbage;
++ }
++
++ @Override
++ public void run() {
++ try {
++ while (!isInterrupted()) {
++ allocate_garbage();
++ Thread.sleep(0); // Yield, to ensure interruptable.
++ }
++ } catch (InterruptedException e) {
++ System.out.println("Aborted after "
++ + (new Date().getTime() - startDate.getTime())
++ + " ms");
++ interrupt();
++ }
++ }
++ }
++
++ public static void main(String[] args) throws Exception {
++ HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean();
++
++ System.out.println("Max memory= " + MAX_MEMORY + " bytes");
++
++ int obj_size = 0;
++ long seconds_to_run = 0;
++ if (args.length != 2) {
++ throw new RuntimeException("Object size argument must be supplied");
++ } else {
++ obj_size = Integer.parseInt(args[0]);
++ seconds_to_run = Integer.parseInt(args[1]);
++ }
++ System.out.println("Objects size= " + obj_size + " bytes");
++ System.out.println("Seconds to run=" + seconds_to_run);
++
++ int region_size =
++ Integer.parseInt(diagnostic.getVMOption("G1HeapRegionSize").getValue());
++ if (obj_size < (region_size / 2)) {
++ throw new RuntimeException("Object size " + obj_size +
++ " is not humongous with region size " + region_size);
++ }
++
++ ExecutorService executor =
++ Executors.newFixedThreadPool(THREAD_COUNT, new NamedThreadFactory());
++ System.out.println("Starting " + THREAD_COUNT + " threads");
++
++ for (int i = 0; i < THREAD_COUNT; i++) {
++ executor.execute(new Runner(obj_size));
++ }
++
++ Thread.sleep(seconds_to_run * 1000);
++ executor.shutdownNow();
++
++ if (!executor.awaitTermination(10, TimeUnit.SECONDS)) {
++ System.err.println("Thread pool did not terminate after 10 seconds after shutdown");
++ }
++ }
++
++ private static final long MAX_MEMORY = Runtime.getRuntime().maxMemory();
++ private static final int OLD_COUNT = 4;
++ private static final int THREAD_COUNT = 12;
++ private static final String THREAD_NAME = "TestGreyRH-";
++}
++
+--- ./hotspot/test/gc/g1/TestHumongousShrinkHeap.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestHumongousShrinkHeap.java Wed Jul 01 21:52:18 2015 -0700
+@@ -24,6 +24,7 @@
+ /**
+ * @test TestHumongousShrinkHeap
+ * @bug 8036025 8056043
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @summary Verify that heap shrinks after GC in the presence of fragmentation
+ * due to humongous objects
+ * @library /testlibrary
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,129 @@
++/*
++ * 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 TestLargePageUseForAuxMemory.java
++ * @bug 8058354
++ * @key gc
++ * @library /testlibrary /testlibrary/whitebox
++ * @requires (vm.gc=="G1" | vm.gc=="null")
++ * @build TestLargePageUseForAuxMemory
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * sun.hotspot.WhiteBox$WhiteBoxPermission
++ * @summary Test that auxiliary data structures are allocated using large pages if available.
++ * @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages TestLargePageUseForAuxMemory
++ */
++
++import com.oracle.java.testlibrary.*;
++import sun.hotspot.WhiteBox;
++
++public class TestLargePageUseForAuxMemory {
++ static final int HEAP_REGION_SIZE = 4 * 1024 * 1024;
++ static long largePageSize;
++ static long smallPageSize;
++
++ static void checkSmallTables(OutputAnalyzer output, long expectedPageSize) throws Exception {
++ output.shouldContain("G1 'Block offset table': pg_sz=" + expectedPageSize);
++ output.shouldContain("G1 'Card counts table': pg_sz=" + expectedPageSize);
++ }
++
++ static void checkBitmaps(OutputAnalyzer output, long expectedPageSize) throws Exception {
++ output.shouldContain("G1 'Prev Bitmap': pg_sz=" + expectedPageSize);
++ output.shouldContain("G1 'Next Bitmap': pg_sz=" + expectedPageSize);
++ }
++
++ static void testVM(long heapsize, boolean cardsShouldUseLargePages, boolean bitmapShouldUseLargePages) throws Exception {
++ ProcessBuilder pb;
++ // Test with large page enabled.
++ pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
++ "-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE,
++ "-Xms" + 10 * HEAP_REGION_SIZE,
++ "-Xmx" + heapsize,
++ "-XX:+TracePageSizes",
++ "-XX:+UseLargePages",
++ "-XX:+IgnoreUnrecognizedVMOptions", // there is on ObjectAlignmentInBytes in 32 bit builds
++ "-XX:ObjectAlignmentInBytes=8",
++ "-version");
++
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++ checkSmallTables(output, (cardsShouldUseLargePages ? largePageSize : smallPageSize));
++ checkBitmaps(output, (bitmapShouldUseLargePages ? largePageSize : smallPageSize));
++ output.shouldHaveExitValue(0);
++
++ // Test with large page disabled.
++ pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
++ "-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE,
++ "-Xms" + 10 * HEAP_REGION_SIZE,
++ "-Xmx" + heapsize,
++ "-XX:+TracePageSizes",
++ "-XX:-UseLargePages",
++ "-XX:+IgnoreUnrecognizedVMOptions", // there is on ObjectAlignmentInBytes in 32 bit builds
++ "-XX:ObjectAlignmentInBytes=8",
++ "-version");
++
++ output = new OutputAnalyzer(pb.start());
++ checkSmallTables(output, smallPageSize);
++ checkBitmaps(output, smallPageSize);
++ output.shouldHaveExitValue(0);
++ }
++
++ public static void main(String[] args) throws Exception {
++ if (!Platform.isDebugBuild()) {
++ System.out.println("Skip tests on non-debug builds because the required option TracePageSizes is a debug-only option.");
++ return;
++ }
++
++ WhiteBox wb = WhiteBox.getWhiteBox();
++ smallPageSize = wb.getVMPageSize();
++ largePageSize = wb.getVMLargePageSize();
++
++ if (largePageSize == 0) {
++ System.out.println("Skip tests because large page support does not seem to be available on this platform.");
++ return;
++ }
++
++ // To get large pages for the card table etc. we need at least a 1G heap (with 4k page size).
++ // 32 bit systems will have problems reserving such an amount of contiguous space, so skip the
++ // test there.
++ if (!Platform.is32bit()) {
++ // Size that a single card covers.
++ final int cardSize = 512;
++
++ final long heapSizeForCardTableUsingLargePages = largePageSize * cardSize;
++
++ testVM(heapSizeForCardTableUsingLargePages, true, true);
++ testVM(heapSizeForCardTableUsingLargePages + HEAP_REGION_SIZE, true, true);
++ testVM(heapSizeForCardTableUsingLargePages - HEAP_REGION_SIZE, false, true);
++ }
++
++ // Minimum heap requirement to get large pages for bitmaps is 128M heap. This seems okay to test
++ // everywhere.
++ final int bitmapTranslationFactor = 8 * 8; // ObjectAlignmentInBytes * BitsPerByte
++ final long heapSizeForBitmapUsingLargePages = largePageSize * bitmapTranslationFactor;
++
++ testVM(heapSizeForBitmapUsingLargePages, false, true);
++ testVM(heapSizeForBitmapUsingLargePages + HEAP_REGION_SIZE, false, true);
++ testVM(heapSizeForBitmapUsingLargePages - HEAP_REGION_SIZE, false, false);
++ }
++}
++
+--- ./hotspot/test/gc/g1/TestRegionAlignment.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestRegionAlignment.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -24,6 +24,7 @@
+ /*
+ * @test TestRegionAlignment.java
+ * @bug 8013791
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @summary Make sure that G1 ergonomics pick a heap size that is aligned with the region size
+ * @run main/othervm -XX:+UseG1GC -XX:G1HeapRegionSize=32m -XX:MaxRAM=555m TestRegionAlignment
+ *
+--- ./hotspot/test/gc/g1/TestShrinkAuxiliaryData.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkAuxiliaryData.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -21,7 +21,7 @@
+ * questions.
+ */
+
+-import static com.oracle.java.testlibrary.Asserts.assertLessThanOrEqual;
++import com.oracle.java.testlibrary.Asserts;
+ import com.oracle.java.testlibrary.OutputAnalyzer;
+ import com.oracle.java.testlibrary.Platform;
+ import com.oracle.java.testlibrary.ProcessTools;
+@@ -36,23 +36,29 @@
+ import java.util.Collections;
+ import java.util.LinkedList;
+ import java.util.List;
+-import sun.misc.Unsafe;
++import sun.misc.Unsafe; // for ADDRESS_SIZE
++import sun.hotspot.WhiteBox;
+
+ public class TestShrinkAuxiliaryData {
+
++ private static final int REGION_SIZE = 1024 * 1024;
++
+ private final static String[] initialOpts = new String[]{
+ "-XX:MinHeapFreeRatio=10",
+ "-XX:MaxHeapFreeRatio=11",
+ "-XX:+UseG1GC",
+- "-XX:G1HeapRegionSize=1m",
++ "-XX:G1HeapRegionSize=" + REGION_SIZE,
+ "-XX:-ExplicitGCInvokesConcurrent",
+- "-XX:+PrintGCDetails"
++ "-XX:+PrintGCDetails",
++ "-XX:+UnlockDiagnosticVMOptions",
++ "-XX:+WhiteBoxAPI",
++ "-Xbootclasspath/a:.",
+ };
+
+- private final int RSetCacheSize;
++ private final int hotCardTableSize;
+
+- protected TestShrinkAuxiliaryData(int RSetCacheSize) {
+- this.RSetCacheSize = RSetCacheSize;
++ protected TestShrinkAuxiliaryData(int hotCardTableSize) {
++ this.hotCardTableSize = hotCardTableSize;
+ }
+
+ protected void test() throws Exception {
+@@ -60,19 +66,17 @@
+ Collections.addAll(vmOpts, initialOpts);
+
+ int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
+- if (maxCacheSize < RSetCacheSize) {
++ if (maxCacheSize < hotCardTableSize) {
+ System.out.format("Skiping test for %d cache size due max cache size %d",
+- RSetCacheSize, maxCacheSize
++ hotCardTableSize, maxCacheSize
+ );
+ return;
+ }
+
+ printTestInfo(maxCacheSize);
+
+- vmOpts.add("-XX:G1ConcRSLogCacheSize=" + RSetCacheSize);
+-
+- vmOpts.addAll(Arrays.asList(Utils.getFilteredTestJavaOpts(
+- ShrinkAuxiliaryDataTest.prohibitedVmOptions)));
++ vmOpts.add("-XX:G1ConcRSLogCacheSize=" + hotCardTableSize);
++ vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));
+
+ // for 32 bits ObjectAlignmentInBytes is not a option
+ if (Platform.is32bit()) {
+@@ -94,11 +98,13 @@
+
+ private void performTest(List<String> opts) throws Exception {
+ ProcessBuilder pb
+- = ProcessTools.createJavaProcessBuilder(
+- opts.toArray(new String[opts.size()])
+- );
++ = ProcessTools.createJavaProcessBuilder(
++ opts.toArray(new String[opts.size()])
++ );
+
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++ System.out.println(output.getStdout());
++ System.err.println(output.getStderr());
+ output.shouldHaveExitValue(0);
+ }
+
+@@ -109,12 +115,13 @@
+ formatSymbols.setGroupingSeparator(' ');
+ grouped.setDecimalFormatSymbols(formatSymbols);
+
+- System.out.format("Test will use %s bytes of memory of %s available%n"
++ System.out.format(
++ "Test will use %s bytes of memory of %s available%n"
+ + "Available memory is %s with %d bytes pointer size - can save %s pointers%n"
+ + "Max cache size: 2^%d = %s elements%n",
+ grouped.format(ShrinkAuxiliaryDataTest.getMemoryUsedByTest()),
+- grouped.format(Runtime.getRuntime().freeMemory()),
+- grouped.format(Runtime.getRuntime().freeMemory()
++ grouped.format(Runtime.getRuntime().maxMemory()),
++ grouped.format(Runtime.getRuntime().maxMemory()
+ - ShrinkAuxiliaryDataTest.getMemoryUsedByTest()),
+ Unsafe.ADDRESS_SIZE,
+ grouped.format((Runtime.getRuntime().freeMemory()
+@@ -137,6 +144,7 @@
+ if (availableMemory <= 0) {
+ return 0;
+ }
++
+ long availablePointersCount = availableMemory / Unsafe.ADDRESS_SIZE;
+ return (63 - (int) Long.numberOfLeadingZeros(availablePointersCount));
+ }
+@@ -144,17 +152,48 @@
+ static class ShrinkAuxiliaryDataTest {
+
+ public static void main(String[] args) throws IOException {
+- int iterateCount = DEFAULT_ITERATION_COUNT;
+
+- if (args.length > 0) {
+- try {
+- iterateCount = Integer.parseInt(args[0]);
+- } catch (NumberFormatException e) {
+- //num_iterate remains default
+- }
++ ShrinkAuxiliaryDataTest testCase = new ShrinkAuxiliaryDataTest();
++
++ if (!testCase.checkEnvApplicability()) {
++ return;
+ }
+
+- new ShrinkAuxiliaryDataTest().test(iterateCount);
++ testCase.test();
++ }
++
++ /**
++ * Checks is this environment suitable to run this test
++ * - memory is enough to decommit (page size is not big)
++ * - RSet cache size is not too big
++ *
++ * @return true if test could run, false if test should be skipped
++ */
++ protected boolean checkEnvApplicability() {
++
++ int pageSize = WhiteBox.getWhiteBox().getVMPageSize();
++ System.out.println( "Page size = " + pageSize
++ + " region size = " + REGION_SIZE
++ + " aux data ~= " + (REGION_SIZE * 3 / 100));
++ // If auxdata size will be less than page size it wouldn't decommit.
++ // Auxiliary data size is about ~3.6% of heap size.
++ if (pageSize >= REGION_SIZE * 3 / 100) {
++ System.out.format("Skipping test for too large page size = %d",
++ pageSize
++ );
++ return false;
++ }
++
++ if (REGION_SIZE * REGIONS_TO_ALLOCATE > Runtime.getRuntime().maxMemory()) {
++ System.out.format("Skipping test for too low available memory. "
++ + "Need %d, available %d",
++ REGION_SIZE * REGIONS_TO_ALLOCATE,
++ Runtime.getRuntime().maxMemory()
++ );
++ return false;
++ }
++
++ return true;
+ }
+
+ class GarbageObject {
+@@ -179,41 +218,54 @@
+
+ private final List<GarbageObject> garbage = new ArrayList();
+
+- public void test(int num_iterate) throws IOException {
++ public void test() throws IOException {
++
++ MemoryUsage muFull, muFree, muAuxDataFull, muAuxDataFree;
++ float auxFull, auxFree;
+
+ allocate();
+ link();
+ mutate();
++
++ muFull = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
++ long numUsedRegions = WhiteBox.getWhiteBox().g1NumMaxRegions()
++ - WhiteBox.getWhiteBox().g1NumFreeRegions();
++ muAuxDataFull = WhiteBox.getWhiteBox().g1AuxiliaryMemoryUsage();
++ auxFull = (float)muAuxDataFull.getUsed() / numUsedRegions;
++
++ System.out.format("Full aux data ratio= %f, regions max= %d, used= %d\n",
++ auxFull, WhiteBox.getWhiteBox().g1NumMaxRegions(), numUsedRegions
++ );
++
+ deallocate();
++ System.gc();
+
+- MemoryUsage muBeforeHeap
+- = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
+- MemoryUsage muBeforeNonHeap
+- = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
++ muFree = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
++ muAuxDataFree = WhiteBox.getWhiteBox().g1AuxiliaryMemoryUsage();
+
+- for (int i = 0; i < num_iterate; i++) {
+- allocate();
+- link();
+- mutate();
+- deallocate();
+- }
++ numUsedRegions = WhiteBox.getWhiteBox().g1NumMaxRegions()
++ - WhiteBox.getWhiteBox().g1NumFreeRegions();
++ auxFree = (float)muAuxDataFree.getUsed() / numUsedRegions;
+
+- System.gc();
+- MemoryUsage muAfterHeap
+- = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
+- MemoryUsage muAfterNonHeap
+- = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
++ System.out.format("Free aux data ratio= %f, regions max= %d, used= %d\n",
++ auxFree, WhiteBox.getWhiteBox().g1NumMaxRegions(), numUsedRegions
++ );
+
+- assertLessThanOrEqual(muAfterHeap.getCommitted(), muBeforeHeap.getCommitted(),
+- String.format("heap decommit failed - after > before: %d > %d",
+- muAfterHeap.getCommitted(), muBeforeHeap.getCommitted()
++ Asserts.assertLessThanOrEqual(muFree.getCommitted(), muFull.getCommitted(),
++ String.format("heap decommit failed - full > free: %d > %d",
++ muFree.getCommitted(), muFull.getCommitted()
+ )
+ );
+
+- if (muAfterHeap.getCommitted() < muBeforeHeap.getCommitted()) {
+- assertLessThanOrEqual(muAfterNonHeap.getCommitted(), muBeforeNonHeap.getCommitted(),
+- String.format("non-heap decommit failed - after > before: %d > %d",
+- muAfterNonHeap.getCommitted(), muBeforeNonHeap.getCommitted()
++ System.out.format("State used committed\n");
++ System.out.format("Full aux data: %10d %10d\n", muAuxDataFull.getUsed(), muAuxDataFull.getCommitted());
++ System.out.format("Free aux data: %10d %10d\n", muAuxDataFree.getUsed(), muAuxDataFree.getCommitted());
++
++ // if decommited check that aux data has same ratio
++ if (muFree.getCommitted() < muFull.getCommitted()) {
++ Asserts.assertLessThanOrEqual(auxFree, auxFull,
++ String.format("auxiliary data decommit failed - full > free: %f > %f",
++ auxFree, auxFull
+ )
+ );
+ }
+@@ -240,8 +292,7 @@
+ for (int i = 0; i < NUM_LINKS; i++) {
+ int regionToLink;
+ do {
+- regionToLink = (int) (Math.random()
+- * REGIONS_TO_ALLOCATE);
++ regionToLink = (int) (Math.random() * REGIONS_TO_ALLOCATE);
+ } while (regionToLink == regionNumber);
+
+ // get random garbage object from random region
+@@ -267,21 +318,8 @@
+ return REGIONS_TO_ALLOCATE * REGION_SIZE;
+ }
+
+- private static final int REGION_SIZE = 1024 * 1024;
+- private static final int DEFAULT_ITERATION_COUNT = 1; // iterate main scenario
+- private static final int REGIONS_TO_ALLOCATE = 5;
++ private static final int REGIONS_TO_ALLOCATE = 100;
+ private static final int NUM_OBJECTS_PER_REGION = 10;
+ private static final int NUM_LINKS = 20; // how many links create for each object
+-
+- private static final String[] prohibitedVmOptions = {
+- // remove this when @requires option will be on duty
+- "-XX:\\+UseParallelGC",
+- "-XX:\\+UseSerialGC",
+- "-XX:\\+UseConcMarkSweepGC",
+- "-XX:\\+UseParallelOldGC",
+- "-XX:\\+UseParNewGC",
+- "-Xconcgc",
+- "-Xincgc"
+- };
+ }
+ }
+--- ./hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,11 +23,15 @@
+
+ /**
+ * @test TestShrinkAuxiliaryData00
+- * @bug 8038423
++ * @bug 8038423 8061715
+ * @summary Checks that decommitment occurs for JVM with different
+ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @library /testlibrary /testlibrary/whitebox
+- * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
++ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
++ * TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=720 TestShrinkAuxiliaryData00
+ */
+ public class TestShrinkAuxiliaryData00 {
+--- ./hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,11 +23,15 @@
+
+ /**
+ * @test TestShrinkAuxiliaryData05
+- * @bug 8038423
++ * @bug 8038423 8061715
+ * @summary Checks that decommitment occurs for JVM with different
+ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @library /testlibrary /testlibrary/whitebox
+- * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
++ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
++ * TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=720 TestShrinkAuxiliaryData05
+ */
+ public class TestShrinkAuxiliaryData05 {
+--- ./hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,11 +23,15 @@
+
+ /**
+ * @test TestShrinkAuxiliaryData10
+- * @bug 8038423
++ * @bug 8038423 8061715
+ * @summary Checks that decommitment occurs for JVM with different
+ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @library /testlibrary /testlibrary/whitebox
++ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData10
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=720 TestShrinkAuxiliaryData10
+ */
+ public class TestShrinkAuxiliaryData10 {
+--- ./hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,11 +23,15 @@
+
+ /**
+ * @test TestShrinkAuxiliaryData15
+- * @bug 8038423
++ * @bug 8038423 8061715
+ * @summary Checks that decommitment occurs for JVM with different
+ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @library /testlibrary /testlibrary/whitebox
++ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData15
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=720 TestShrinkAuxiliaryData15
+ */
+ public class TestShrinkAuxiliaryData15 {
+--- ./hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,11 +23,15 @@
+
+ /**
+ * @test TestShrinkAuxiliaryData20
+- * @bug 8038423
++ * @bug 8038423 8061715
+ * @summary Checks that decommitment occurs for JVM with different
+ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @library /testlibrary /testlibrary/whitebox
++ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData20
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=720 TestShrinkAuxiliaryData20
+ */
+ public class TestShrinkAuxiliaryData20 {
+--- ./hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,11 +23,15 @@
+
+ /**
+ * @test TestShrinkAuxiliaryData25
+- * @bug 8038423
++ * @bug 8038423 8061715
+ * @summary Checks that decommitment occurs for JVM with different
+ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @library /testlibrary /testlibrary/whitebox
++ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData25
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=720 TestShrinkAuxiliaryData25
+ */
+ public class TestShrinkAuxiliaryData25 {
+--- ./hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,11 +23,15 @@
+
+ /**
+ * @test TestShrinkAuxiliaryData30
+- * @bug 8038423
++ * @bug 8038423 8061715
+ * @summary Checks that decommitment occurs for JVM with different
+ * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @library /testlibrary /testlibrary/whitebox
++ * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData30
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run driver/timeout=720 TestShrinkAuxiliaryData30
+ */
+ public class TestShrinkAuxiliaryData30 {
+--- ./hotspot/test/gc/g1/TestShrinkToOneRegion.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/g1/TestShrinkToOneRegion.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -24,6 +24,7 @@
+ /*
+ * @test TestShrinkToOneRegion.java
+ * @bug 8013872
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @summary Shrinking the heap down to one region used to hit an assert
+ * @run main/othervm -XX:+UseG1GC -XX:G1HeapRegionSize=32m -Xmx256m TestShrinkToOneRegion
+ *
+--- ./hotspot/test/gc/metaspace/G1AddMetaspaceDependency.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/metaspace/G1AddMetaspaceDependency.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -24,6 +24,7 @@
+ /*
+ * @test G1AddMetaspaceDependency
+ * @bug 8010196
++ * @requires vm.gc=="G1" | vm.gc=="null"
+ * @summary Checks that we don't get locking problems when adding metaspace dependencies with the G1 update buffer monitor
+ * @run main/othervm -XX:+UseG1GC -XX:G1UpdateBufferSize=1 G1AddMetaspaceDependency
+ */
+--- ./hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -29,6 +29,7 @@
+
+ /* @test TestMetaspacePerfCounters
+ * @bug 8014659
++ * @requires vm.gc=="null"
+ * @library /testlibrary
+ * @summary Tests that performance counters for metaspace and compressed class
+ * space exists and works.
+--- ./hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -30,6 +30,7 @@
+ /* @test TestPerfCountersAndMemoryPools
+ * @bug 8023476
+ * @library /testlibrary
++ * @requires vm.gc=="Serial" | vm.gc=="null"
+ * @summary Tests that a MemoryPoolMXBeans and PerfCounters for metaspace
+ * report the same data.
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint TestPerfCountersAndMemoryPools
+--- ./hotspot/test/runtime/6888954/vmerrors.sh Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/runtime/6888954/vmerrors.sh Wed Jul 01 21:52:18 2015 -0700
+@@ -1,4 +1,4 @@
+-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2013, 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
+@@ -61,11 +61,12 @@
+ # EXCEPTION_ACCESS_VIOLATION - Win-*
+ # SIGBUS - Solaris SPARC-64
+ # SIGSEGV - Linux-*, Solaris SPARC-32, Solaris X86-*
++# SIGILL - Aix
+ #
+ # Note: would like to use "pc=0x00*0f," in the pattern, but Solaris SPARC-*
+ # gets its signal at a PC in test_error_handler().
+ #
+-bad_func_ptr_re='(SIGBUS|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc='
++bad_func_ptr_re='(SIGBUS|SIGSEGV|SIGILL|EXCEPTION_ACCESS_VIOLATION).* at pc='
+ guarantee_re='guarantee[(](str|num).*failed: *'
+ fatal_re='fatal error: *'
+ tail_1='.*expected null'
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/ErrorHandling/TestOnError.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,66 @@
++/*
++ * 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 TestOnError
++ * @summary Test using -XX:OnError=<cmd>
++ * @library /testlibrary
++ * @build TestOnError com.oracle.java.testlibrary.*
++ * @run main TestOnError
++ * @bug 8078470
++ */
++
++import com.oracle.java.testlibrary.*;
++
++public class TestOnError {
++
++ public static void main(String[] args) throws Exception {
++ if (!Platform.isDebugBuild()) {
++ System.out.println("Test requires a non-product build - skipping");
++ return;
++ }
++
++ String msg = "Test Succeeded";
++
++ // Execute the VM so that a
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
++ "-XX:-TransmitErrorReport",
++ "-XX:ErrorHandlerTest=12", // trigger potential SEGV
++ "-XX:OnError=echo " + msg,
++ TestOnError.class.getName());
++
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++
++ /* Actual output will include:
++ #
++ # -XX:OnError="echo Test Succeeded"
++ # Executing /bin/sh -c "echo Test Succeeded"...
++ Test Succeeded
++
++ So we don't want to match on the "# Executing ..." line, and they
++ both get written to stdout.
++ */
++ output.stdoutShouldMatch("^" + msg); // match start of line only
++ System.out.println("PASSED");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/ErrorHandling/TestOnOutOfMemoryError.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,70 @@
++/*
++ * 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 TestOnOutOfMemoryError
++ * @summary Test using -XX:OnOutOfMemoryError=<cmd>
++ * @library /testlibrary
++ * @build TestOnOutOfMemoryError com.oracle.java.testlibrary.*
++ * @run main TestOnOutOfMemoryError
++ * @bug 8078470
++ */
++
++import com.oracle.java.testlibrary.*;
++
++public class TestOnOutOfMemoryError {
++
++ public static void main(String[] args) throws Exception {
++ if (args.length == 1) {
++ // This should guarantee to throw:
++ // java.lang.OutOfMemoryError: Requested array size exceeds VM limit
++ Object[] oa = new Object[Integer.MAX_VALUE];
++ return;
++ }
++
++ // else this is the main test
++ String msg = "Test Succeeded";
++ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
++ "-XX:OnOutOfMemoryError=echo " + msg,
++ TestOnOutOfMemoryError.class.getName(),
++ "throwOOME");
++
++ OutputAnalyzer output = new OutputAnalyzer(pb.start());
++
++ /* Actual output should look like this:
++ #
++ # java.lang.OutOfMemoryError: Requested array size exceeds VM limit
++ # -XX:OnOutOfMemoryError="echo Test Succeeded"
++ # Executing /bin/sh -c "echo Test Succeeded"...
++ Test Succeeded
++ Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
++ at OOME.main(OOME.java:3)
++
++ So we don't want to match on the "# Executing ..." line, and they
++ both get written to stdout.
++ */
++ output.shouldContain("Requested array size exceeds VM limit");
++ output.stdoutShouldMatch("^" + msg); // match start of line only
++ System.out.println("PASSED");
++ }
++}
+--- ./hotspot/test/runtime/InitialThreadOverflow/testme.sh Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/runtime/InitialThreadOverflow/testme.sh Wed Jul 01 21:52:18 2015 -0700
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+
+-# Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 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
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/handlerInTry/HandlerInTry.jasm Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,115 @@
++/*
++ * 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.
++ */
++
++/*
++ * HandlerInTry contains a try block in a ctor whose handler is inside
++ * the same try block. The try block starts at line 74 (try t2;), ends at
++ * line 106 (endtry t2;), but its handler starts at line 101 (catch t2 #0;).
++ */
++super public class HandlerInTry
++ version 51:0
++{
++
++public static final synthetic Field ___transactionFactory_2002349702336125:"Ljava/lang/Object;";
++
++public Method "<init>":"(Ljava/lang/Object;)V"
++ stack 5 locals 5
++{
++ invokestatic Method ThreadLocalTransaction.getThreadLocalTransaction:"()Ljava/lang/Object;";
++ checkcast class java/lang/Object;
++ astore_2;
++ aload_2;
++ invokestatic Method TransactionLogicDonor.isActiveTransaction:"(Ljava/lang/Object;)Z";
++ ifeq L21;
++ aload_0;
++ aload_1;
++ aload_2;
++ invokespecial Method "<init>":"(Ljava/lang/Object;Ljava/lang/Object;)V";
++ return;
++ L21: stack_frame_type append;
++ locals_map class java/lang/Object;
++ aload_2;
++ getstatic Field ___transactionFactory_2002349702336125:"Ljava/lang/Object;";
++ invokestatic Method TransactionLogicDonor.createTransaction:"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;";
++ astore_2;
++ aload_2;
++ iconst_1;
++ pop;
++ aload_2;
++ invokestatic Method ThreadLocalTransaction.setThreadLocalTransaction:"(Ljava/lang/Object;)V";
++ try t0, t1;
++ aload_0;
++ aload_1;
++ aload_2;
++ invokespecial Method "<init>":"(Ljava/lang/Object;Ljava/lang/Object;)V";
++ aload_2;
++ pop;
++ aconst_null;
++ astore_2;
++ endtry t0, t1;
++ invokestatic Method ThreadLocalTransaction.clearThreadLocalTransaction:"()V";
++ pop;
++ goto L107;
++ catch t0 java/lang/Throwable;
++ try t2;
++ stack_frame_type full;
++ locals_map bogus, class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Throwable;
++ astore_3;
++ aload_2;
++ pop;
++ aload_3;
++ instanceof class ControlFlowError;
++ ifeq L82;
++ new class java/lang/NullPointerException;
++ dup;
++ invokespecial Method java/lang/NullPointerException."<init>":"()V";
++ athrow;
++ L82: stack_frame_type append;
++ locals_map class java/lang/Throwable;
++ aload_3;
++ instanceof class java/lang/Error;
++ ifeq L94;
++ aload_3;
++ checkcast class java/lang/Error;
++ athrow;
++ L94: stack_frame_type same;
++ aload_3;
++ checkcast class java/lang/Exception;
++ athrow;
++ catch t1 #0;
++ catch t2 #0;
++ stack_frame_type full;
++ locals_map bogus, class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Throwable;
++ astore 4;
++ endtry t2;
++ invokestatic Method ThreadLocalTransaction.clearThreadLocalTransaction:"()V";
++ aload 4;
++ athrow;
++ L107: stack_frame_type full;
++ locals_map class HandlerInTry, class java/lang/Object, null;
++ return;
++}
++
++} // end Class HandlerInTry
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/handlerInTry/IsolatedHandlerInTry.jasm Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,124 @@
++/*
++ * 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.
++ */
++
++/*
++ * IsolatedHandlerInTry contains a try block in a ctor whose handler is inside
++ * the same try block but the handler can only be reached if an exception
++ * occurs. The handler does a return. So, a VerifyException should be thrown.
++ * The try block starts at line 77 (try t2;) and ends at line 113 (endtry t2;).
++ * Its handler starts at line 107 (catch t2 #0;). The handler can only be reached
++ * by exception because of the athrow at line 106.
++ */
++super public class IsolatedHandlerInTry
++ version 51:0
++{
++
++public static final synthetic Field ___transactionFactory_2002349702336125:"Ljava/lang/Object;";
++
++public Method "<init>":"(Ljava/lang/Object;)V"
++ stack 5 locals 5
++{
++ invokestatic Method ThreadLocalTransaction.getThreadLocalTransaction:"()Ljava/lang/Object;";
++ checkcast class java/lang/Object;
++ astore_2;
++ aload_2;
++ invokestatic Method TransactionLogicDonor.isActiveTransaction:"(Ljava/lang/Object;)Z";
++ ifeq L21;
++ aload_0;
++ aload_1;
++ aload_2;
++ invokespecial Method "<init>":"(Ljava/lang/Object;Ljava/lang/Object;)V";
++ return;
++ L21: stack_frame_type append;
++ locals_map class java/lang/Object;
++ aload_2;
++ getstatic Field ___transactionFactory_2002349702336125:"Ljava/lang/Object;";
++ invokestatic Method TransactionLogicDonor.createTransaction:"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;";
++ astore_2;
++ aload_2;
++ iconst_1;
++ pop;
++ aload_2;
++ invokestatic Method ThreadLocalTransaction.setThreadLocalTransaction:"(Ljava/lang/Object;)V";
++ try t0, t1;
++ aload_0;
++ aload_1;
++ aload_2;
++ invokespecial Method "<init>":"(Ljava/lang/Object;Ljava/lang/Object;)V";
++ aload_2;
++ pop;
++ aconst_null;
++ astore_2;
++ endtry t0, t1;
++ invokestatic Method ThreadLocalTransaction.clearThreadLocalTransaction:"()V";
++ pop;
++ goto L107;
++ catch t0 java/lang/Throwable;
++ try t2;
++ stack_frame_type full;
++ locals_map bogus, class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Throwable;
++ astore_3;
++ aload_2;
++ pop;
++ aload_3;
++ instanceof class ControlFlowError;
++ ifeq L82;
++ new class java/lang/NullPointerException;
++ dup;
++ invokespecial Method java/lang/NullPointerException."<init>":"()V";
++ athrow;
++ L82: stack_frame_type append;
++ locals_map class java/lang/Throwable;
++ aload_3;
++ instanceof class java/lang/Error;
++ ifeq L94;
++ aload_3;
++ checkcast class java/lang/Error;
++ athrow;
++ L94: stack_frame_type same;
++ aload_3;
++ checkcast class java/lang/Exception;
++ catch t1 #0;
++ stack_frame_type full;
++ locals_map bogus, class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Throwable;
++ athrow;
++ catch t2 #0;
++ stack_frame_type full;
++ locals_map bogus, class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Throwable;
++ astore 4;
++ return;
++ endtry t2;
++ stack_frame_type full;
++ locals_map bogus, class java/lang/Object, class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Throwable;
++ invokestatic Method ThreadLocalTransaction.clearThreadLocalTransaction:"()V";
++ athrow;
++ L107: stack_frame_type full;
++ locals_map class IsolatedHandlerInTry, class java/lang/Object, null;
++ return;
++}
++
++} // end Class IsolatedHandlerInTry
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/handlerInTry/LoadHandlerInTry.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,86 @@
++/*
++ * 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 8075118
++ * @summary Allow a ctor to call super() from a switch bytecode.
++ * @compile HandlerInTry.jasm
++ * @compile IsolatedHandlerInTry.jasm
++ * @run main/othervm -Xverify:all LoadHandlerInTry
++ */
++
++/*
++ * This test has two cases:
++ *
++ * 1. class HandlerInTry: Class HandlerInTry contains a TRY block in a
++ * constructor whose handler is inside the same TRY block. The last
++ * few bytecodes and exception table look like this:
++ *
++ * ...
++ * 87: athrow
++ * 88: astore 4
++ * 90: invokestatic #9
++ * 93: aload 4
++ * 95: athrow
++ * 96: return
++ * Exception table:
++ * from to target type
++ * 36 46 53 Class java/lang/Throwable
++ * 36 46 88 any
++ * 53 90 88 any
++ *
++ * Note that the target for the third handler in the Exception table is
++ * inside its TRY block.
++ * Without the fix for bug JDK-8075118, this test will time out.
++ *
++ *
++ * 2. class IsolatedHandlerInTry: Class IsolatedHandlerInTry also contains
++ * a TRY block in a constructoer whose handler is inside its TRY block.
++ * But the handler is only reachable if an exception is thrown. The
++ * handler's bytecodes will not get parsed as part of parsing the TRY
++ * block. They will only get parsed as a handler for the TRY block.
++ * Since the isolated handler does a 'return', a VerifyError exception
++ * should get thrown.
++ */
++
++public class LoadHandlerInTry {
++
++ public static void main(String[] args) throws Exception {
++ System.out.println("Regression test for bug 8075118");
++ try {
++ Class newClass = Class.forName("HandlerInTry");
++ } catch (Exception e) {
++ System.out.println("Failed: Exception was thrown: " + e.toString());
++ throw e;
++ }
++
++ try {
++ Class newClass = Class.forName("IsolatedHandlerInTry");
++ throw new RuntimeException(
++ "Failed to throw VerifyError for IsolatedHandlerInTry");
++ } catch (java.lang.VerifyError e) {
++ System.out.println("Passed: VerifyError exception was thrown");
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/invokedynamic/BootstrapMethodErrorTest.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,115 @@
++/*
++ * 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 8051045
++ * @summary Test that exceptions from invokedynamic are wrapped in BootstrapMethodError
++ * @modules java.base/jdk.internal.org.objectweb.asm
++ * @run main BootstrapMethodErrorTest
++ */
++
++import java.lang.reflect.Method;
++import java.lang.invoke.MethodHandle;
++import java.lang.invoke.MethodHandles;
++import static java.lang.invoke.MethodHandles.*;
++import static java.lang.invoke.MethodType.*;
++
++import jdk.internal.org.objectweb.asm.ClassWriter;
++import jdk.internal.org.objectweb.asm.Handle;
++import jdk.internal.org.objectweb.asm.MethodVisitor;
++import jdk.internal.org.objectweb.asm.Opcodes;
++
++public class BootstrapMethodErrorTest extends ClassLoader implements Opcodes {
++
++ @Override
++ public Class findClass(String name) throws ClassNotFoundException {
++ byte[] b;
++ try {
++ b = loadClassData(name);
++ } catch (Throwable th) {
++ throw new ClassNotFoundException("Loading error", th);
++ }
++ return defineClass(name, b, 0, b.length);
++ }
++
++ private byte[] loadClassData(String name) throws Exception {
++ ClassWriter cw = new ClassWriter(0);
++ MethodVisitor mv;
++
++ if (name.equals("C")) {
++ cw.visit(52, ACC_SUPER | ACC_PUBLIC, "C", null, "java/lang/Object", null);
++ {
++ mv = cw.visitMethod(ACC_PRIVATE | ACC_STATIC, "m", "()V", null, null);
++ mv.visitCode();
++ mv.visitInsn(RETURN);
++ mv.visitMaxs(0, 1);
++ mv.visitEnd();
++ }
++ cw.visitEnd();
++ return cw.toByteArray();
++ } else if (name.equals("Exec")) {
++ cw.visit(52, ACC_SUPER | ACC_PUBLIC, "Exec", null, "java/lang/Object", null);
++ {
++ mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "invokeRef", "()V", null, null);
++ mv.visitCode();
++ Handle h = new Handle(H_INVOKESTATIC, "C", "m", "()V");
++ mv.visitInvokeDynamicInsn("C", "()V", h);
++ mv.visitInsn(RETURN);
++ mv.visitMaxs(0, 0);
++ mv.visitEnd();
++ }
++ cw.visitEnd();
++ return cw.toByteArray();
++ }
++ return null;
++ }
++
++ public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, NoSuchMethodException {
++ new BootstrapMethodErrorTest().test();
++ }
++
++ public void test() throws ClassNotFoundException, IllegalAccessException, NoSuchMethodException {
++ Class.forName("C", true, this);
++ Class<?> exec = Class.forName("Exec", true, this);
++
++ try {
++ exec.getMethod("invokeRef").invoke(null);
++ } catch (Throwable e) {
++ Throwable c = e.getCause();
++ if (c == null) {
++ throw new RuntimeException(
++ "Expected BootstrapMethodError wrapped in an InvocationTargetException but it wasn't wrapped", e);
++ } else if (c instanceof BootstrapMethodError) {
++ // Only way to pass test, all else should throw
++ return;
++ } else {
++ throw new RuntimeException(
++ "Expected BootstrapMethodError but got another Error: "
++ + c.getClass().getName(),
++ c);
++ }
++ }
++ throw new RuntimeException("Expected BootstrapMethodError but no Error at all was thrown");
++ }
++}
+--- ./hotspot/test/runtime/lambda-features/InvokespecialInterface.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/runtime/lambda-features/InvokespecialInterface.java Wed Jul 01 21:52:18 2015 -0700
+@@ -28,7 +28,7 @@
+ * @bug 8025937
+ * @bug 8033528
+ * @summary [JDK 8] Test invokespecial and invokeinterface with the same JVM_CONSTANT_InterfaceMethodref
+- * @run main/othervm -XX:+StressRewriter InvokespecialInterface
++ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+StressRewriter InvokespecialInterface
+ */
+ import java.util.function.*;
+ import java.util.*;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,61 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/* @test TestLargePageSizeInBytes
++ * @summary Tests that the flag -XX:LargePageSizeInBytes does not cause warnings on Solaris
++ * @bug 8049536
++ * @library /testlibrary
++ * @run driver TestLargePageSizeInBytes
++ */
++
++import com.oracle.java.testlibrary.OutputAnalyzer;
++import com.oracle.java.testlibrary.Platform;
++import com.oracle.java.testlibrary.ProcessTools;
++
++public class TestLargePageSizeInBytes {
++ private static long M = 1024L * 1024L;
++ private static long G = 1024L * M;
++
++ public static void main(String[] args) throws Exception {
++ if (!Platform.isSolaris()) {
++ // We only use the syscall mencntl on Solaris
++ return;
++ }
++
++ testLargePageSizeInBytes(4 * M);
++ testLargePageSizeInBytes(256 * M);
++ testLargePageSizeInBytes(512 * M);
++ testLargePageSizeInBytes(2 * G);
++ }
++
++ private static void testLargePageSizeInBytes(long size) throws Exception {
++ ProcessBuilder pb =
++ ProcessTools.createJavaProcessBuilder("-XX:+UseLargePages",
++ "-XX:LargePageSizeInBytes=" + size,
++ "-version");
++
++ OutputAnalyzer out = new OutputAnalyzer(pb.start());
++ out.shouldNotContain("Attempt to use MPSS failed.");
++ out.shouldHaveExitValue(0);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/memory/ReadVMPageSize.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,46 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/*
++ * @test
++ * @summary Using WhiteBox to get VM page size
++ * @library /testlibrary /testlibrary/whitebox
++ * @build ReadVMPageSize
++ * @run main ClassFileInstaller sun.hotspot.WhiteBox
++ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ReadVMPageSize
++ */
++
++import com.oracle.java.testlibrary.*;
++import sun.hotspot.WhiteBox;
++
++public class ReadVMPageSize {
++ public static void main(String args[]) throws Exception {
++ WhiteBox wb = WhiteBox.getWhiteBox();
++ int pageSize = wb.getVMPageSize();
++ if (pageSize < 0) {
++ throw new Exception("pageSize < 0");
++ } else {
++ System.out.println("Page size = " + pageSize);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/stackMapCheck/BadMap.jasm Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,152 @@
++ /*
++ * 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.
++ *
++ */
++
++/*
++ * This class should throw VerifyError because the StackMap for bytecode index
++ * 45 (astore_2, line 123) is incorrect. The stack maps for bytecode indexes 45
++ * and 49 (astore, line 133) do not match because 45 does not supply enough
++ * locals to satisfy 49.
++ *
++ * The astore_2 bytecode at bytecode index 45 changes the type state,
++ * preventing the stackmap mismatch. But, if the incoming type state is used,
++ * as required by JVM Spec 8, then the verifier will detected the stackmap
++ * mismatch, and throw VerifyError.
++ */
++
++super public class BadMap
++ version 51:0
++{
++
++
++public Method "<init>":"()V"
++ stack 1 locals 1
++{
++ aload_0;
++ invokespecial Method java/lang/Object."<init>":"()V";
++ return;
++}
++
++public static Method main:"([Ljava/lang/String;)V"
++ throws java/lang/Throwable
++ stack 0 locals 1
++{
++ return;
++}
++
++public static Method foo:"()V"
++ stack 3 locals 5
++{
++ iconst_0;
++ ifne L5;
++ nop;
++ try t7;
++ L5: stack_frame_type full;
++ aconst_null;
++ dup;
++ astore_0;
++ astore_1;
++ try t0;
++ aconst_null;
++ astore_0;
++ endtry t0;
++ goto L19;
++ catch t0 java/io/IOException;
++ stack_frame_type full;
++ locals_map class java/lang/Object, null;
++ stack_map class java/io/IOException;
++ astore_2;
++ aconst_null;
++ dup;
++ astore_1;
++ astore_0;
++ try t1;
++ L19: stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object;
++ aconst_null;
++ astore_2;
++ endtry t1;
++ aload_1;
++ ifnonnull L37;
++ nop;
++ goto L37;
++ catch t1 #0;
++ catch t2 #0;
++ try t2;
++ stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Throwable;
++ astore_3;
++ endtry t2;
++ aload_1;
++ ifnonnull L35;
++ nop;
++ L35: stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object, bogus, class java/lang/Throwable;
++ aload_3;
++ athrow;
++ try t3, t4;
++ L37: stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
++ aload_1;
++ ifnonnull L42;
++ nop;
++ endtry t3, t4;
++ L42: stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
++ goto L54;
++ catch t3 java/lang/Exception;
++ try t5;
++ stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Exception;
++ astore_2; // astore_2, at bci 45, that changes the type state.
++ endtry t5;
++ goto L54;
++ catch t4 #0;
++ catch t5 #0;
++ catch t6 #0;
++ try t6;
++ stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
++ stack_map class java/lang/Throwable;
++ astore 4;
++ endtry t6;
++ aload 4;
++ athrow;
++ L54: stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
++ goto L57;
++ L57: stack_frame_type full;
++ locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object;
++ nop;
++ endtry t7;
++ return;
++ catch t7 #0;
++ stack_frame_type full;
++ stack_map class java/lang/Throwable;
++ nop;
++ athrow;
++}
++
++} // end Class BadMap
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/stackMapCheck/BadMapDstore.jasm Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,79 @@
++ /*
++ * 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.
++ *
++ */
++
++/*
++ * This class should throw VerifyError because the StackMap for bytecode index
++ * 9 (dstore_2, line 60) is incorrect. The stack maps for bytecode indexes 9
++ * and 18 (astore_2, line 70) do not match because 9 does not supply enough
++ * locals to satisfy 18.
++ *
++ * The dstore_2 bytecode at bytecode index 9 changes the type state,
++ * preventing the stackmap mismatch. But, if the incoming type state is used,
++ * as required by JVM Spec 8, then the verifier will detected the stackmap
++ * mismatch, and throw VerifyError.
++ */
++
++super public class BadMapDstore
++ version 51:0
++{
++
++Field blah:I;
++
++public Method "<init>":"()V"
++ stack 1 locals 1
++{
++ aload_0;
++ invokespecial Method java/lang/Object."<init>":"()V";
++ return;
++}
++
++public static Method main:"([Ljava/lang/String;)V"
++ stack 4 locals 4
++{
++ new class BadMapDstore;
++ dup;
++ invokespecial Method "<init>":"()V";
++ astore_1;
++ dconst_1;
++ try t0;
++ dstore_2;
++ aload_1;
++ iconst_5;
++ putfield Field blah:"I";
++ endtry t0;
++ goto L22;
++ catch t0 java/lang/Throwable;
++ stack_frame_type full;
++ locals_map class "[Ljava/lang/String;", class BadMapDstore, double;
++ stack_map class java/lang/Throwable;
++ astore_2;
++ aload_1;
++ dconst_0;
++ dstore_2;
++ pop;
++ L22: stack_frame_type same;
++ return;
++}
++
++} // end Class BadMapDstore
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/stackMapCheck/BadMapIstore.jasm Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,79 @@
++ /*
++ * 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.
++ *
++ */
++
++/*
++ * This class should throw VerifyError because the StackMap for bytecode index
++ * 9 (istore_2, line 60) is incorrect. The stack maps for bytecode indexes 9
++ * and 18 (astore_2, line 70) do not match because 9 does not supply enough
++ * locals to satisfy 18.
++ *
++ * The istore_2 bytecode at bytecode index 9 changes the type state,
++ * preventing the stackmap mismatch. But, if the incoming type state is used,
++ * as required by JVM Spec 8, then the verifier will detected the stackmap
++ * mismatch, and throw VerifyError.
++ */
++
++super public class BadMapIstore
++ version 51:0
++{
++
++Field blah:I;
++
++public Method "<init>":"()V"
++ stack 1 locals 1
++{
++ aload_0;
++ invokespecial Method java/lang/Object."<init>":"()V";
++ return;
++}
++
++public static Method main:"([Ljava/lang/String;)V"
++ stack 2 locals 3
++{
++ new class BadMapIstore;
++ dup;
++ invokespecial Method "<init>":"()V";
++ astore_1;
++ iconst_2;
++ try t0;
++ istore_2;
++ aload_1;
++ iconst_5;
++ putfield Field blah:"I";
++ endtry t0;
++ goto L22;
++ catch t0 java/lang/Throwable;
++ stack_frame_type full;
++ locals_map class "[Ljava/lang/String;", class BadMapIstore, int;
++ stack_map class java/lang/Throwable;
++ astore_2;
++ aload_1;
++ iconst_4;
++ istore_2;
++ pop;
++ L22: stack_frame_type same;
++ return;
++}
++
++} // end Class BadMapIstore
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/runtime/stackMapCheck/StackMapCheck.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,63 @@
++ /*
++ * 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 7127066
++ * @summary Class verifier accepts an invalid class file
++ * @compile BadMap.jasm
++ * @compile BadMapDstore.jasm
++ * @compile BadMapIstore.jasm
++ * @run main/othervm -Xverify:all StackMapCheck
++ */
++
++public class StackMapCheck {
++ public static void main(String args[]) throws Throwable {
++
++ System.out.println("Regression test for bug 7127066");
++ try {
++ Class newClass = Class.forName("BadMap");
++ throw new RuntimeException(
++ "StackMapCheck failed, BadMap did not throw VerifyError");
++ } catch (java.lang.VerifyError e) {
++ System.out.println("BadMap passed, VerifyError was thrown");
++ }
++
++ try {
++ Class newClass = Class.forName("BadMapDstore");
++ throw new RuntimeException(
++ "StackMapCheck failed, BadMapDstore did not throw VerifyError");
++ } catch (java.lang.VerifyError e) {
++ System.out.println("BadMapDstore passed, VerifyError was thrown");
++ }
++
++ try {
++ Class newClass = Class.forName("BadMapIstore");
++ throw new RuntimeException(
++ "StackMapCheck failed, BadMapIstore did not throw VerifyError");
++ } catch (java.lang.VerifyError e) {
++ System.out.println("BadMapIstore passed, VerifyError was thrown");
++ }
++ }
++}
+--- ./hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 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
+--- ./hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java Wed Jul 01 21:52:18 2015 -0700
+@@ -33,20 +33,25 @@
+
+ import com.oracle.java.testlibrary.JDKToolLauncher;
+ import com.oracle.java.testlibrary.OutputBuffer;
++import com.oracle.java.testlibrary.Platform;
+ import com.oracle.java.testlibrary.ProcessTools;
+
+ import java.io.File;
+
+ public class Test8028623 {
+
+- public static int à = 1;
++ public static int \u00CB = 1;
+ public static String dumpFile = "heap.out";
+
+ public static void main (String[] args) {
+
+- System.out.println(Ã);
++ System.out.println(\u00CB);
+
+ try {
++ if (!Platform.shouldSAAttach()) {
++ System.out.println("SA attach not expected to work - test skipped.");
++ return;
++ }
+ int pid = ProcessTools.getProcessId();
+ JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
+ .addToolArg("-F")
+--- ./hotspot/test/test_env.sh Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/test_env.sh Wed Jul 01 21:52:18 2015 -0700
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ #
+-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2013, 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
+@@ -53,7 +53,7 @@
+ # set platform-dependent variables
+ OS=`uname -s`
+ case "$OS" in
+- SunOS | Linux | Darwin )
++ AIX | Darwin | Linux | SunOS )
+ NULL=/dev/null
+ PS=":"
+ FS="/"
+@@ -130,26 +130,31 @@
+ fi
+
+ VM_OS="unknown"
+-grep "solaris" vm_version.out > ${NULL}
++grep "aix" vm_version.out > ${NULL}
+ if [ $? = 0 ]
+ then
+- VM_OS="solaris"
++ VM_OS="aix"
++fi
++grep "bsd" vm_version.out > ${NULL}
++if [ $? = 0 ]
++then
++ VM_OS="bsd"
+ fi
+ grep "linux" vm_version.out > ${NULL}
+ if [ $? = 0 ]
+ then
+ VM_OS="linux"
+ fi
++grep "solaris" vm_version.out > ${NULL}
++if [ $? = 0 ]
++then
++ VM_OS="solaris"
++fi
+ grep "windows" vm_version.out > ${NULL}
+ if [ $? = 0 ]
+ then
+ VM_OS="windows"
+ fi
+-grep "bsd" vm_version.out > ${NULL}
+-if [ $? = 0 ]
+-then
+- VM_OS="bsd"
+-fi
+
+ VM_CPU="unknown"
+ grep "sparc" vm_version.out > ${NULL}
+@@ -186,6 +191,11 @@
+ then
+ VM_CPU="ia64"
+ fi
++grep "aarch64" vm_version.out > ${NULL}
++if [ $? = 0 ]
++then
++ VM_CPU="aarch64"
++fi
+ export VM_TYPE VM_BITS VM_OS VM_CPU
+ echo "VM_TYPE=${VM_TYPE}"
+ echo "VM_BITS=${VM_BITS}"
+--- ./hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -23,12 +23,17 @@
+
+ package com.oracle.java.testlibrary;
+
++import java.util.regex.Pattern;
++
++import com.oracle.java.testlibrary.Utils;
++
+ public class Platform {
+ private static final String osName = System.getProperty("os.name");
+ private static final String dataModel = System.getProperty("sun.arch.data.model");
+ private static final String vmVersion = System.getProperty("java.vm.version");
+ private static final String osArch = System.getProperty("os.arch");
+ private static final String vmName = System.getProperty("java.vm.name");
++ private static final String userName = System.getProperty("user.name");
+
+ public static boolean isClient() {
+ return vmName.endsWith(" Client VM");
+@@ -58,6 +63,18 @@
+ return dataModel.equals("64");
+ }
+
++ public static boolean isAix() {
++ return isOs("aix");
++ }
++
++ public static boolean isLinux() {
++ return isOs("linux");
++ }
++
++ public static boolean isOSX() {
++ return isOs("mac");
++ }
++
+ public static boolean isSolaris() {
+ return isOs("sunos");
+ }
+@@ -66,14 +83,6 @@
+ return isOs("win");
+ }
+
+- public static boolean isOSX() {
+- return isOs("mac");
+- }
+-
+- public static boolean isLinux() {
+- return isOs("linux");
+- }
+-
+ private static boolean isOs(String osname) {
+ return osName.toLowerCase().startsWith(osname.toLowerCase());
+ }
+@@ -92,33 +101,93 @@
+
+ // Returns true for sparc and sparcv9.
+ public static boolean isSparc() {
+- return isArch("sparc");
++ return isArch("sparc.*");
+ }
+
+ public static boolean isARM() {
+- return isArch("arm");
++ return isArch("arm.*");
+ }
+
+ public static boolean isPPC() {
+- return isArch("ppc");
++ return isArch("ppc.*");
+ }
+
+ public static boolean isX86() {
+- // On Linux it's 'i386', Windows 'x86'
+- return (isArch("i386") || isArch("x86"));
++ // On Linux it's 'i386', Windows 'x86' without '_64' suffix.
++ return isArch("(i386)|(x86(?!_64))");
+ }
+
+ public static boolean isX64() {
+ // On OSX it's 'x86_64' and on other (Linux, Windows and Solaris) platforms it's 'amd64'
+- return (isArch("amd64") || isArch("x86_64"));
++ return isArch("(amd64)|(x86_64)");
+ }
+
+- private static boolean isArch(String archname) {
+- return osArch.toLowerCase().startsWith(archname.toLowerCase());
++ public static boolean isAArch64() {
++ return isArch("aarch64");
++ }
++
++ private static boolean isArch(String archnameRE) {
++ return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
++ .matcher(osArch)
++ .matches();
+ }
+
+ public static String getOsArch() {
+ return osArch;
+ }
+
++ /**
++ * Return a boolean for whether we expect to be able to attach
++ * the SA to our own processes on this system.
++ */
++ public static boolean shouldSAAttach() throws Exception {
++
++ if (isAix()) {
++ return false; // SA not implemented.
++ } else if (isLinux()) {
++ return canPtraceAttachLinux();
++ } else if (isOSX()) {
++ return canAttachOSX();
++ } else {
++ // Other platforms expected to work:
++ return true;
++ }
++ }
++
++ /**
++ * On Linux, first check the SELinux boolean "deny_ptrace" and return false
++ * as we expect to be denied if that is "1". Then expect permission to attach
++ * if we are root, so return true. Then return false for an expected denial
++ * if "ptrace_scope" is 1, and true otherwise.
++ */
++ public static boolean canPtraceAttachLinux() throws Exception {
++
++ // SELinux deny_ptrace:
++ String deny_ptrace = Utils.fileAsString("/sys/fs/selinux/booleans/deny_ptrace");
++ if (deny_ptrace != null && deny_ptrace.contains("1")) {
++ // ptrace will be denied:
++ return false;
++ }
++
++ if (userName.equals("root")) {
++ return true;
++ }
++
++ // ptrace_scope:
++ String ptrace_scope = Utils.fileAsString("/proc/sys/kernel/yama/ptrace_scope");
++ if (ptrace_scope != null && ptrace_scope.contains("1")) {
++ // ptrace will be denied:
++ return false;
++ }
++
++ // Otherwise expect to be permitted:
++ return true;
++ }
++
++ /**
++ * On OSX, expect permission to attach only if we are root.
++ */
++ public static boolean canAttachOSX() throws Exception {
++ return userName.equals("root");
++ }
+ }
+--- ./hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java Wed Jul 01 21:52:18 2015 -0700
+@@ -299,6 +299,35 @@
+ }
+
+ /**
++ * Return the contents of the named file as a single String,
++ * or null if not found.
++ * @param filename name of the file to read
++ * @return String contents of file, or null if file not found.
++ */
++ public static String fileAsString(String filename) {
++ StringBuilder result = new StringBuilder();
++ try {
++ File file = new File(filename);
++ if (file.exists()) {
++ BufferedReader reader = new BufferedReader(new FileReader(file));
++ while (true) {
++ String line = reader.readLine();
++ if (line == null) {
++ break;
++ }
++ result.append(line).append("\n");
++ }
++ } else {
++ // Does not exist:
++ return null;
++ }
++ } catch (Exception e) {
++ e.printStackTrace();
++ }
++ return result.toString();
++ }
++
++ /**
+ * @return Unsafe instance.
+ */
+ public static synchronized Unsafe getUnsafe() {
+--- ./hotspot/test/testlibrary/ctw/Makefile Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/testlibrary/ctw/Makefile Wed Jul 01 21:52:18 2015 -0700
+@@ -8,7 +8,7 @@
+ #
+ # 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
++# 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).
+ #
+--- ./hotspot/test/testlibrary/ctw/README Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/testlibrary/ctw/README Wed Jul 01 21:52:18 2015 -0700
+@@ -1,26 +1,26 @@
+-#
+-# Copyright (c) 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.
+-#
+-#
++
++Copyright (c) 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.
++
++
+
+ DESCRIPTION
+
+--- ./hotspot/test/testlibrary/whitebox/Makefile Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/testlibrary/whitebox/Makefile Wed Jul 01 21:52:18 2015 -0700
+@@ -8,7 +8,7 @@
+ #
+ # 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
++# 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).
+ #
+--- ./hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java Mon Jun 01 11:40:55 2015 -0700
++++ ./hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java Wed Jul 01 21:52:18 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -24,6 +24,7 @@
+
+ package sun.hotspot;
+
++import java.lang.management.MemoryUsage;
+ import java.lang.reflect.Executable;
+ import java.util.Arrays;
+ import java.util.List;
+@@ -75,6 +76,9 @@
+ // Memory
+ public native long getObjectAddress(Object o);
+ public native int getHeapOopSize();
++ public native int getVMPageSize();
++ public native long getVMLargePageSize();
++
+ public native boolean isObjectInOldGen(Object o);
+ public native long getObjectSize(Object o);
+
+@@ -84,6 +88,8 @@
+ return isClassAlive0(name.replace('.', '/'));
+ }
+ private native boolean isClassAlive0(String name);
++ public native boolean isMonitorInflated(Object obj);
++ public native void forceSafepoint();
+
+ // Resource/Class Lookup Cache
+ public native boolean classKnownToNotExist(ClassLoader loader, String name);
+@@ -97,8 +103,10 @@
+ // G1
+ public native boolean g1InConcurrentMark();
+ public native boolean g1IsHumongous(Object o);
++ public native long g1NumMaxRegions();
+ public native long g1NumFreeRegions();
+ public native int g1RegionSize();
++ public native MemoryUsage g1AuxiliaryMemoryUsage();
+ public native Object[] parseCommandLine(String commandline, DiagnosticCommand[] args);
+
+ // NMT
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java Wed Jul 01 21:52:18 2015 -0700
+@@ -0,0 +1,135 @@
++/*
++ * Copyright (c) 2014, 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 com.oracle.java.testlibrary.Asserts;
++import com.oracle.java.testlibrary.Platform;
++
++import java.lang.reflect.InvocationTargetException;
++import java.lang.reflect.Method;
++import java.util.Arrays;
++import java.util.Collections;
++import java.util.EnumSet;
++import java.util.HashSet;
++import java.util.List;
++import java.util.Set;
++
++/**
++ * @test
++ * @summary Verify that for each group of mutually exclusive predicates defined
++ * in com.oracle.java.testlibrary.Platform one and only one predicate
++ * evaluates to true.
++ * @library /testlibrary
++ * @run main TestMutuallyExclusivePlatformPredicates
++ */
++public class TestMutuallyExclusivePlatformPredicates {
++ private static enum MethodGroup {
++ ARCH("isARM", "isPPC", "isSparc", "isX86", "isX64", "isAArch64"),
++ BITNESS("is32bit", "is64bit"),
++ OS("isAix", "isLinux", "isSolaris", "isWindows", "isOSX"),
++ VM_TYPE("isClient", "isServer", "isGraal", "isMinimal"),
++ IGNORED("isEmbedded", "isDebugBuild", "shouldSAAttach",
++ "canPtraceAttachLinux", "canAttachOSX");
++
++ public final List<String> methodNames;
++
++ private MethodGroup(String... methodNames) {
++ this.methodNames = Collections.unmodifiableList(
++ Arrays.asList(methodNames));
++ }
++ }
++
++ public static void main(String args[]) {
++ EnumSet<MethodGroup> notIgnoredMethodGroups
++ = EnumSet.complementOf(EnumSet.of(MethodGroup.IGNORED));
++
++ notIgnoredMethodGroups.forEach(
++ TestMutuallyExclusivePlatformPredicates::verifyPredicates);
++
++ TestMutuallyExclusivePlatformPredicates.verifyCoverage();
++ }
++
++ /**
++ * Verifies that one and only one predicate method defined in
++ * {@link com.oracle.java.testlibrary.Platform}, whose name included into
++ * methodGroup will return {@code true}.
++ * @param methodGroup The group of methods that should be tested.
++ */
++ private static void verifyPredicates(MethodGroup methodGroup) {
++ System.out.println("Verifying method group: " + methodGroup.name());
++ long truePredicatesCount = methodGroup.methodNames.stream()
++ .filter(TestMutuallyExclusivePlatformPredicates
++ ::evaluatePredicate)
++ .count();
++
++ Asserts.assertEQ(truePredicatesCount, 1L, String.format(
++ "Only one predicate from group %s should be evaluated to true "
++ + "(Actually %d predicates were evaluated to true).",
++ methodGroup.name(), truePredicatesCount));
++ }
++
++ /**
++ * Verifies that all predicates defined in
++ * {@link com.oracle.java.testlibrary.Platform} were either tested or
++ * explicitly ignored.
++ */
++ private static void verifyCoverage() {
++ Set<String> allMethods = new HashSet<>();
++ for (MethodGroup group : MethodGroup.values()) {
++ allMethods.addAll(group.methodNames);
++ }
++
++ for (Method m : Platform.class.getMethods()) {
++ if (m.getParameterCount() == 0
++ && m.getReturnType() == boolean.class) {
++ Asserts.assertTrue(allMethods.contains(m.getName()),
++ "All Platform's methods with signature '():Z' should "
++ + "be tested ");
++ }
++ }
++ }
++
++ /**
++ * Evaluates predicate method with name {@code name} defined in
++ * {@link com.oracle.java.testlibrary.Platform}.
++ *
++ * @param name The name of a predicate to be evaluated.
++ * @return evaluated predicate's value.
++ * @throws java.lang.Error if predicate is not defined or could not be
++ * evaluated.
++ */
++ private static boolean evaluatePredicate(String name) {
++ try {
++ System.out.printf("Trying to evaluate predicate with name %s%n",
++ name);
++ boolean value
++ = (Boolean) Platform.class.getMethod(name).invoke(null);
++ System.out.printf("Predicate evaluated to: %s%n", value);
++ return value;
++ } catch (NoSuchMethodException e) {
++ throw new Error("Predicate with name " + name
++ + " is not defined in " + Platform.class.getName(), e);
++ } catch (IllegalAccessException | InvocationTargetException e) {
++ throw new Error("Unable to evaluate predicate " + name, e);
++ }
++ }
++}
+--- ./jaxp/.hgtags Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/.hgtags Wed Jul 01 21:53:10 2015 -0700
+@@ -354,7 +354,6 @@
+ 1dd828fd98f1b84de5dcadb904322b711e7489ff jdk8u31-b13
+ dcc563c9db9ef290a0783378d43a039cd92a08e3 jdk8u31-b31
+ 119f4ae3151f4134a5e62034e66a4c17f524838b jdk8u31-b32
+-d8a594fd8507343dc23fa18c01b17c96fced47fd jdk8u31-b33
+ 3a1bba8076da4e54882123e98e219eab1c31ccef jdk8u40-b00
+ f219da378d0768ff042d77221e5d20676ecc16f0 jdk8u40-b01
+ 16ef2134c32a4e60b5a60105b371163aa5936278 jdk8u40-b02
+@@ -383,8 +382,6 @@
+ 4c0d4c38279c5790aa5b61b03c4cfa9b2a58bc72 jdk8u40-b25
+ f693ef62c207dd0290957c95bd62ab653afe4626 jdk8u40-b26
+ 56f6ca79467d04eb95383102046836b6ac7d2811 jdk8u40-b27
+-7e43d4e20a33b8b6bd06112e39d367b51de921a7 jdk8u40-b31
+-8facbe662ec106f1aae271f5c59909e124938c40 jdk8u40-b32
+ 9286acc600a779acb8bcfab38e82d4f50704afe3 jdk8u45-b00
+ 9fded65e1d36e3388111955d50ebf8511dd0345e jdk8u45-b01
+ 62566a3dbe5982565ce3e468ee3980b7937a86cc jdk8u45-b02
+@@ -400,22 +397,26 @@
+ 91d1102264e9b58b2ada4b5f112d472f0d86092b jdk8u45-b12
+ a15025742f201f05ead3d731780a4ad437524491 jdk8u45-b13
+ e0167ec9d7596ab9ac52a8c3b85c1aef5d3fbd92 jdk8u45-b14
+-bf813e10d0bac17866ef2389baa8a1e6494e7800 jdk8u45-b15
+-74452b827b62c31220709d14a65e71f37795199a jdk8u45-b31
+-90fe13eb35388e095383bcb81eeb6d24875e3054 jdk8u45-b32
+-ef437e576e3654f6f9c0cc116a0a824f382b9007 jdk8u51-b00
+-d6ddc9950ff55dc9be44704ed59555e221a8fcc9 jdk8u51-b01
+-da0ad0f75f08d8fbb4ee4d395e4386a4660b854e jdk8u51-b02
+-34737dfadd630afba60b6ad63a696ae335d7e960 jdk8u51-b03
+-75f055aeee9f9cab28a58e1deea9ecb8885b63d0 jdk8u51-b04
+-5e57ca784de9ce92547c12d0bc3795c42794b962 jdk8u51-b05
+-36c97b41563b7bed72014da6e497398c78616d5b jdk8u51-b06
+-046bcf8f8e0059fa53136b06547112933d5284d6 jdk8u51-b07
+-710b56801de0147716d91be7226b125b5a64c2ef jdk8u51-b08
+-3b4c837abdf678ea2e60efcd2d20cc9ff1123c06 jdk8u51-b09
+-7aacd8c67160af67f7c9d81974d021eeb229929e jdk8u51-b10
+-04005432fba4982e5c073be55b917f8a11c838f0 jdk8u51-b11
+-966c04d5702882603a02f5ba4a4e5d19d47960f6 jdk8u51-b12
+-3f5353208a226a31d9ad86018a17fe5f3b102d4b jdk8u51-b13
+-361ad9121468776eee1d647044481d80e8334ffa jdk8u51-b14
+-14975d905d764c5a18b60b991b97375d42dcecd7 jdk8u51-b15
++3b73732d6886dc8155f0c1fbb125ca60d9e2fd2b jdk8u60-b00
++b0e15cd169a93080c4e30e9eb3061d0b329bf38c jdk8u60-b01
++0b64e727bdb06c82caa02ef25ac2552ce3314537 jdk8u60-b02
++0c3f4e5092d20ed76754fdb3002bebb46952375e jdk8u60-b03
++bd05a145e589b5bc200898a34d2d0f78372e9ed0 jdk8u60-b04
++13a5799e90e958eea7c72bc93829d709a1053995 jdk8u60-b05
++b265b39444379ccd9d4038a8f10c0527f12ba06f jdk8u60-b06
++51eab6899806b399bcca4533ab01362a306e4d0b jdk8u60-b07
++0ef3e20f1d48ddf8b1845039f97dc1174d0701ad jdk8u60-b08
++566ff4ee50bbfbb9f414289b8206be077f07294e jdk8u60-b09
++497d106d476db2eaa0e0ca2756e211fdf9f0d34e jdk8u60-b10
++c8c6e549d1a6e454aa9fd5965a966f5e3a870e60 jdk8u60-b11
++412597b17df8a4109b4fcf32687785c2c93ac536 jdk8u60-b12
++c61fbe5729d4d6ce5522f357b95f285bada8b440 jdk8u60-b13
++ddb4bf8a306a8b0d94ca639994b2b420632d40b3 jdk8u60-b14
++040ce4bf5a41047116a0be643d791b9c76c412b3 jdk8u60-b15
++3cb841defba069c891f80fb03e2c71dad995ae6a jdk8u60-b16
++e882f38df713cac5cec98e18a013a81ce9fad0d3 jdk8u60-b17
++ee389d2cb785317ae0b8bb2c73e72daf9435824d jdk8u60-b18
++a86893381fbb1c03ee743b691a7b7d6a90903eca jdk8u60-b19
++7d03050620d74e6e6b60c9e64b5b8cbe557c8201 jdk8u60-b20
++def8014e497099d6f1b1fc64554b15345a574a96 jdk8u60-b21
++bc1ad5d83a65339c40a17406ea38d2ea8cbb9807 jdk8u60-b22
+--- ./jaxp/THIRD_PARTY_README Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/THIRD_PARTY_README Wed Jul 01 21:53:10 2015 -0700
+@@ -1140,37 +1140,6 @@
+
+ --------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to JSON, which may be included
+-with JRE 8 & JDK 8.
+-
+---- begin of LICENSE ---
+-
+-Copyright (c) 2002 JSON.org
+-
+-Permission is hereby granted, free of charge, to any person obtaining a copy
+-of this software and associated documentation files (the "Software"), to deal
+-in the Software without restriction, including without limitation the rights
+-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-copies of the Software, and to permit persons to whom the Software is
+-furnished to do so, subject to the following conditions:
+-
+-The above copyright notice and this permission notice shall be included in all
+-copies or substantial portions of the Software.
+-
+-The Software shall be used for Good, not Evil.
+-
+-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-SOFTWARE.
+-
+---- end of LICENSE ---
+-
+--------------------------------------------------------------------------------
+-
+ %% This notice is provided with respect to Kerberos functionality, which
+ which may be included with JRE 8, JDK 8, and OpenJDK 8.
+
+@@ -1250,7 +1219,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libpng 1.6.16, which may be
++%% This notice is provided with respect to libpng 1.6.16, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1370,7 +1339,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libungif 4.1.3, which may be
++%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1399,13 +1368,13 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to Little CMS 2.5, which may be
++%% This notice is provided with respect to Little CMS 2.7, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+
+ Little CMS
+-Copyright (c) 1998-2011 Marti Maria Saguer
++Copyright (c) 1998-2015 Marti Maria Saguer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+--- ./jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java Wed Jul 01 21:53:10 2015 -0700
+@@ -1283,10 +1283,10 @@
+ "xsl:stylesheet kr\u00E4ver ett 'version'-attribut!"},
+
+ { WG_ILLEGAL_ATTRIBUTE_NAME,
+- "Ogiltigt attributnamn: {0}"},
++ "Otill\u00E5tet attributnamn: {0}"},
+
+ { WG_ILLEGAL_ATTRIBUTE_VALUE,
+- "Ogiltigt v\u00E4rde anv\u00E4nds f\u00F6r attributet {0}: {1}"},
++ "Otill\u00E5tet v\u00E4rde anv\u00E4nds f\u00F6r attributet {0}: {1}"},
+
+ { WG_EMPTY_SECOND_ARG,
+ "Resulterande nodupps\u00E4ttning fr\u00E5n dokumentfunktionens andra argumentet \u00E4r tomt. En tom nodupps\u00E4ttning anv\u00E4nds."},
+--- ./jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java Wed Jul 01 21:53:10 2015 -0700
+@@ -369,7 +369,7 @@
+ * element of a type that it was not permitted to contain.
+ */
+ {ErrorMsg.ILLEGAL_CHILD_ERR,
+- "Ogiltigt underordnat element."},
++ "Otill\u00E5tet underordnat element."},
+
+ /*
+ * Note to translators: The stylesheet tried to create an element with
+--- ./jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java Wed Jul 01 21:53:10 2015 -0700
+@@ -567,8 +567,12 @@
+ }
+
+ public NodeList makeNodeList(DTMAxisIterator iter) {
+- // TODO: gather nodes from all DOMs ?
+- return _main.makeNodeList(iter);
++ int index = iter.next();
++ if (index == DTM.NULL) {
++ return null;
++ }
++ iter.reset();
++ return _adapters[getDTMId(index)].makeNodeList(iter);
+ }
+
+ public String getLanguage(int node) {
+--- ./jaxp/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java Wed Jul 01 21:53:10 2015 -0700
+@@ -529,6 +529,16 @@
+ invalidByte(4, 4, b2);
+ }
+
++ // check if output buffer is large enough to hold 2 surrogate chars
++ if (out + 1 >= ch.length) {
++ fBuffer[0] = (byte)b0;
++ fBuffer[1] = (byte)b1;
++ fBuffer[2] = (byte)b2;
++ fBuffer[3] = (byte)b3;
++ fOffset = 4;
++ return out - offset;
++ }
++
+ // decode bytes into surrogate characters
+ int uuuuu = ((b0 << 2) & 0x001C) | ((b1 >> 4) & 0x0003);
+ if (uuuuu > 0x10) {
+--- ./jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties Wed Jul 01 21:53:10 2015 -0700
+@@ -16,8 +16,8 @@
+ # feature messages
+ feature-not-supported = Funktionen ''{0}'' st\u00F6ds inte.
+ feature-not-recognized = Funktionen ''{0}'' \u00E4r ok\u00E4nd.
+-true-not-supported = True-status f\u00F6r funktionen ''{0}'' st\u00F6ds inte.
+-false-not-supported = False-status f\u00F6r funktionen ''{0}'' st\u00F6ds inte.
++true-not-supported = True-tillst\u00E5nd f\u00F6r funktionen ''{0}'' st\u00F6ds inte.
++false-not-supported = False-tillst\u00E5nd f\u00F6r funktionen ''{0}'' st\u00F6ds inte.
+ feature-read-only = Funktionen ''{0}'' \u00E4r skrivskyddad.
+ jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: Funktionen kan inte anges till false om s\u00E4kerhetshanteraren anv\u00E4nds.
+
+--- ./jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties Wed Jul 01 21:53:10 2015 -0700
+@@ -8,240 +8,240 @@
+ # For internal use
+
+ Internal-Error = Interner Fehler: {0}.
+- dt-whitespace = Leerstellen-Facet-Wert ist nicht f\u00FCr Vereinigungsmenge simpleType "{0}" verf\u00FCgbar
++ dt-whitespace = Leerstellen-Facet-Wert ist nicht f\u00FCr Vereinigungsmenge simpleType ''{0}'' verf\u00FCgbar
+ GrammarConflict = Eine vom Grammatikpool des Benutzers zur\u00FCckgegebene Grammatik steht im Konflikt mit einer anderen Grammatik.
+
+ # Identity constraints
+
+- AbsentKeyValue = Identity Constraint-Fehler (cvc-identity-constraint.4.2.1): Element "{0}" hat einen Schl\u00FCssel ohne Wert.
+- DuplicateField = Doppelte \u00DCbereinstimmung in Geltungsbereich f\u00FCr Feld "{0}".
+- DuplicateKey = Doppelter Schl\u00FCsselwert [{0}] f\u00FCr Identity Constraint des Elements "{1}" deklariert.
+- DuplicateUnique = Doppelter eindeutiger Wert [{0}] f\u00FCr Identity Constraint des Elements "{1}" deklariert.
+- FieldMultipleMatch = Identity Constraint-Fehler: Feld "{0}" entspricht mehreren Werten im Geltungsbereich seines Selectors. Felder m\u00FCssen eindeutigen Werten entsprechen.
+- FixedDiffersFromActual = Content dieses Elements entspricht nicht dem Wert des "fixed"-Attributs in der Elementdeklaration im Schema.
+- KeyMatchesNillable = Identity Constraint-Fehler (cvc-identity-constraint.4.2.3): Element "{0}" hat einen Schl\u00FCssel, der einem Element entspricht, bei dem "nillable" auf "true" gesetzt wurde.
+- KeyNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <key name="{1}"> Identity Constraint f\u00FCr Element "{0}".
+- KeyNotFound = Schl\u00FCssel "{0}" mit Wert "{1}" nicht gefunden f\u00FCr Identity Constraint des Elements "{2}".
+- KeyRefNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <keyref name="{1}"> Identity Constraint f\u00FCr Element "{0}".
+- KeyRefOutOfScope = Identity Constraint-Fehler: Identity Constraint "{0}" hat eine keyref, die zu einem Key- oder Unique-Constraint au\u00DFerhalb des Geltungsbereichs verweist.
+- KeyRefReferNotFound = Schl\u00FCsselreferenzdeklaration "{0}" verweist auf einen unbekannten Schl\u00FCssel mit dem Namen "{1}".
+- UniqueNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <unique> Identity Constraint f\u00FCr Element "{0}".
+- UnknownField = Interner Identity Constraint-Fehler. Unbekanntes Feld "{0}".
++ AbsentKeyValue = Identity Constraint-Fehler (cvc-identity-constraint.4.2.1): Element ''{0}'' hat einen Schl\u00FCssel ohne Wert.
++ DuplicateField = Doppelte \u00DCbereinstimmung in Geltungsbereich f\u00FCr Feld ''{0}''.
++ DuplicateKey = Doppelter Schl\u00FCsselwert [{0}] f\u00FCr Identity Constraint des Elements ''{1}''deklariert.
++ DuplicateUnique = Doppelter eindeutiger Wert [{0}] f\u00FCr Identity Constraint des Elements ''{1}'' deklariert.
++ FieldMultipleMatch = Identity Constraint-Fehler: Feld ''{0}'' entspricht mehreren Werten im Geltungsbereich seines Selectors. Felder m\u00FCssen eindeutigen Werten entsprechen.
++ FixedDiffersFromActual = Content dieses Elements entspricht nicht dem Wert des 'fixed'-Attributs in der Elementdeklaration im Schema.
++ KeyMatchesNillable = Identity Constraint-Fehler (cvc-identity-constraint.4.2.3): Element ''{0}'' hat einen Schl\u00FCssel, der einem Element entspricht, bei dem ''nillable'' auf ''true'' gesetzt wurde.
++ KeyNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <key name=''{1}''> Identity Constraint f\u00FCr Element ''{0}''.
++ KeyNotFound = Schl\u00FCssel ''{0}'' mit Wert ''{1}'' nicht gefunden f\u00FCr Identity Constraint des Elements ''{2}''.
++ KeyRefNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <keyref name=''{1}''> Identity Constraint f\u00FCr Element ''{0}''.
++ KeyRefOutOfScope = Identity Constraint-Fehler: Identity Constraint ''{0}'' hat eine keyref, die zu einem Key- oder Unique-Constraint au\u00DFerhalb des Geltungsbereichs verweist.
++ KeyRefReferNotFound = Schl\u00FCsselreferenzdeklaration ''{0}'' verweist auf einen unbekannten Schl\u00FCssel mit dem Namen ''{1}''.
++ UniqueNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <unique> Identity Constraint f\u00FCr Element ''{0}''.
++ UnknownField = Interner Identity Constraint-Fehler. Unbekanntes Feld ''{0}''.
+
+ # Ideally, we should only use the following error keys, not the ones under
+ # "Identity constraints". And we should cover all of the following errors.
+
+ #validation (3.X.4)
+
+- cvc-attribute.3 = cvc-attribute.3: Wert "{2}" des Attributs "{1}" bei Element "{0}" hat keinen g\u00FCltigen Typ "{3}".
+- cvc-attribute.4 = cvc-attribute.4: Wert "{2}" des Attributs "{1}" bei Element "{0}" hat keinen g\u00FCltigen festen "{''value constraint''}". Attribute muss den Wert "{3}" haben.
+- cvc-complex-type.2.1 = cvc-complex-type.2.1: Element "{0}" darf kein Zeichen- oder Elementinformationselement [untergeordnete Elemente] haben, da der Contenttyp des Typs leer ist.
+- cvc-complex-type.2.2 = cvc-complex-type.2.2: Element "{0}" darf kein Element [untergeordnete Elemente] haben, und der Wert muss g\u00FCltig sein.
+- cvc-complex-type.2.3 = cvc-complex-type.2.3: Element "{0}" darf keine Zeichen [untergeordnete Elemente] haben, da der Contenttyp des Typs "element-only" ist.
+- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Ung\u00FCltiger Content wurde beginnend mit Element "{0}" gefunden. "{1}" wird erwartet.
+- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: Content des Elements "{0}" ist nicht vollst\u00E4ndig. "{1}" wird erwartet.
+- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \u00DCbereinstimmungsplatzhalter ist streng, aber es kann keine Deklaration f\u00FCr Element "{0}" gefunden werden.
+- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element "{0}" gefunden. An dieser Stelle wird kein untergeordnetes Element erwartet.
+- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element "{0}" gefunden. An dieser Stelle wird kein untergeordnetes Element "{1}" erwartet.
+- cvc-complex-type.3.1 = cvc-complex-type.3.1: Wert "{2}" des Attributs "{1}" des Elements "{0}" ist ung\u00FCltig in Bezug auf die entsprechende Attributverwendung. Attribut "{1}" hat den festen Wert "{3}".
+- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: Element "{0}" hat keinen Attributplatzhalter f\u00FCr Attribut "{1}".
+- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: Attribut "{1}" darf nicht in Element "{0}" vorkommen.
+- cvc-complex-type.4 = cvc-complex-type.4: Attribut "{1}" muss in Element "{0}" vorkommen.
+- cvc-complex-type.5.1 = cvc-complex-type.5.1: In Element "{0}" ist Attribut "{1}" ein Platzhalter. Es ist aber bereits ein Platzhalter "{2}" vorhanden. Nur ein Platzhalter ist zul\u00E4ssig.
+- cvc-complex-type.5.2 = cvc-complex-type.5.2: In Element "{0}" ist Attribut "{1}" ein Platzhalter. Es ist aber bereits ein Attribut "{2}" vorhanden, das von einer ID unter den "{''attribute uses''}" abgeleitet wurde.
+- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: "{0}" ist kein g\u00FCltiger Wert f\u00FCr "{1}".
+- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: "{0}" ist kein g\u00FCltiger Wert des Listentyps "{1}".
+- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: "{0}" ist kein g\u00FCltiger Wert des Vereinigungsmengentyps "{1}".
+- cvc-elt.1 = cvc-elt.1: Deklaration des Elements "{0}" kann nicht gefunden werden.
+- cvc-elt.2 = cvc-elt.2: Wert von "{"abstract"}" in der Elementdeklaration f\u00FCr "{0}" muss "false" sein.
+- cvc-elt.3.1 = cvc-elt.3.1: Attribut "{1}" darf nicht in Element "{0}" vorkommen, da die die Eigenschaft "{''nillable''}" von "{0}" "false" ist.
+- cvc-elt.3.2.1 = cvc-elt.3.2.1: Element "{0}" darf keine Zeichen- oder Elementinformationen [untergeordnete Elemente] haben, da "{1}" angegeben wurde.
+- cvc-elt.3.2.2 = cvc-elt.3.2.2: Es darf kein fester "{"value constraint"}" f\u00FCr Element "{0}" vorhanden sein, da "{1}" angegeben wurde.
+- cvc-elt.4.1 = cvc-elt.4.1: Wert "{2}" des Attributs "{1}" von Element "{0}" ist kein g\u00FCltiger QName.
+- cvc-elt.4.2 = cvc-elt.4.2: "{1}" kann nicht als Typdefinition f\u00FCr Element "{0}" aufgel\u00F6st werden.
+- cvc-elt.4.3 = cvc-elt.4.3: Typ "{1}" wurde nicht auf g\u00FCltige Weise von der Typdefinition "{2}" des Elements "{0}" abgeleitet.
+- cvc-elt.5.1.1 = cvc-elt.5.1.1: "{"value constraint"}" "{2}" des Elements "{0}" ist kein g\u00FCltiger Standardwert f\u00FCr Typ "{1}".
+- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: Element "{0}" darf keine Elementinformationselemente [untergeordnete Elemente] haben.
+- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: Wert "{1}" des Elements "{0}" stimmt nicht mit dem festen "{''value constraint''}"-Wert "{2}" \u00FCberein.
+- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: Wert "{1}" des Elements "{0}" stimmt nicht mit dem "{''value constraint''}"-Wert "{2}" \u00FCberein.
+- cvc-enumeration-valid = cvc-enumeration-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf Enumeration "{1}". Er muss ein Wert aus der Enumeration sein.
+- cvc-fractionDigits-valid = cvc-fractionDigits-valid: Wert "{0}" enth\u00E4lt {1} Bruchziffern, die Anzahl an Bruchziffern wurde aber auf {2} beschr\u00E4nkt.
+- cvc-id.1 = cvc-id.1: Kein ID/IDREF-Binding f\u00FCr IDREF "{0}" vorhanden.
+- cvc-id.2 = cvc-id.2: ID-Wert "{0}" kommt mehrmals vor.
+- cvc-id.3 = cvc-id.3: Ein Feld von Identity Constraint "{0}" entsprach Element "{1}". Dieses Element hat aber keinen Simple Type.
+- cvc-length-valid = cvc-length-valid: Wert "{0}" mit L\u00E4nge = "{1}" ist nicht Facet-g\u00FCltig in Bezug auf die L\u00E4nge "{2}" f\u00FCr Typ "{3}".
+- cvc-maxExclusive-valid = cvc-maxExclusive-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf maxExclusive "{1}" f\u00FCr Typ "{2}".
+- cvc-maxInclusive-valid = cvc-maxInclusive-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf maxInclusive "{1}" f\u00FCr Typ "{2}".
+- cvc-maxLength-valid = cvc-maxLength-valid: Wert "{0}" mit L\u00E4nge = "{1}" ist nicht Facet-g\u00FCltig in Bezug auf maxLength "{2}" f\u00FCr Typ "{3}".
+- cvc-minExclusive-valid = cvc-minExclusive-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf minExclusive "{1}" f\u00FCr Typ "{2}".
+- cvc-minInclusive-valid = cvc-minInclusive-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf minInclusive "{1}" f\u00FCr Typ "{2}".
+- cvc-minLength-valid = cvc-minLength-valid: Wert "{0}" mit L\u00E4nge = "{1}" ist nicht Facet-g\u00FCltig in Bezug auf minLength "{2}" f\u00FCr Typ "{3}".
+- cvc-pattern-valid = cvc-pattern-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf Muster "{1}" f\u00FCr Typ "{2}".
+- cvc-totalDigits-valid = cvc-totalDigits-valid: Wert "{0}" enth\u00E4lt {1} Gesamtziffern, die Anzahl an Gesamtziffern wurde aber auf {2} beschr\u00E4nkt.
++ cvc-attribute.3 = cvc-attribute.3: Wert ''{2}'' des Attributs ''{1}'' bei Element ''{0}'' hat keinen g\u00FCltigen Typ ''{3}''.
++ cvc-attribute.4 = cvc-attribute.4: Wert ''{2}'' des Attributs ''{1}'' bei Element ''{0}'' hat keinen g\u00FCltigen festen '{'value constraint'}'. Attribute muss den Wert ''{3}'' haben.
++ cvc-complex-type.2.1 = cvc-complex-type.2.1: Element ''{0}'' darf kein Zeichen- oder Elementinformationselement [untergeordnete Elemente] haben, da der Contenttyp des Typs leer ist.
++ cvc-complex-type.2.2 = cvc-complex-type.2.2: Element ''{0}'' darf kein Element [untergeordnete Elemente] haben, und der Wert muss g\u00FCltig sein.
++ cvc-complex-type.2.3 = cvc-complex-type.2.3: Element ''{0}'' darf keine Zeichen [untergeordnete Elemente] haben, da der Contenttyp des Typs ''element-only'' ist.
++ cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. ''{1}'' wird erwartet.
++ cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: Content des Elements ''{0}'' ist nicht vollst\u00E4ndig. ''{1}'' wird erwartet.
++ cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \u00DCbereinstimmungsplatzhalter ist streng, aber es kann keine Deklaration f\u00FCr Element ''{0}'' gefunden werden.
++ cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. An dieser Stelle wird kein untergeordnetes Element erwartet.
++ cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. An dieser Stelle wird kein untergeordnetes Element ''{1}'' erwartet.
++ cvc-complex-type.3.1 = cvc-complex-type.3.1: Wert ''{2}'' des Attributs ''{1}'' des Elements ''{0}'' ist ung\u00FCltig in Bezug auf die entsprechende Attributverwendung. Attribut ''{1}'' hat den festen Wert ''{3}''.
++ cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: Element ''{0}'' hat keinen Attributplatzhalter f\u00FCr Attribut ''{1}''.
++ cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen.
++ cvc-complex-type.4 = cvc-complex-type.4: Attribut ''{1}'' muss in Element ''{0}'' vorkommen.
++ cvc-complex-type.5.1 = cvc-complex-type.5.1: In Element ''{0}'' ist Attribut ''{1}'' ein Platzhalter. Es ist aber bereits ein Platzhalter ''{2}'' vorhanden. Nur ein Platzhalter ist zul\u00E4ssig.
++ cvc-complex-type.5.2 = cvc-complex-type.5.2: In Element ''{0}'' ist Attribut ''{1}'' ein Platzhalter. Es ist aber bereits ein Attribut ''{2}'' vorhanden, das von einer ID unter den '{'attribute uses'}' abgeleitet wurde.
++ cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' ist kein g\u00FCltiger Wert f\u00FCr ''{1}''.
++ cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' ist kein g\u00FCltiger Wert des Listentyps ''{1}''.
++ cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' ist kein g\u00FCltiger Wert des Vereinigungsmengentyps ''{1}''.
++ cvc-elt.1 = cvc-elt.1: Deklaration des Elements ''{0}'' kann nicht gefunden werden.
++ cvc-elt.2 = cvc-elt.2: Wert von '{'abstract'}' in der Elementdeklaration f\u00FCr ''{0}'' muss ''false'' sein.
++ cvc-elt.3.1 = cvc-elt.3.1: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen, da die die Eigenschaft '{'nillable'}' von ''{0}'' ''false'' ist.
++ cvc-elt.3.2.1 = cvc-elt.3.2.1: Element ''{0}'' darf keine Zeichen- oder Elementinformationen [untergeordnete Elemente] haben, da ''{1}'' angegeben wurde.
++ cvc-elt.3.2.2 = cvc-elt.3.2.2: Es darf kein fester '{'value constraint'}' f\u00FCr Element ''{0}'' vorhanden sein, da ''{1}'' angegeben wurde.
++ cvc-elt.4.1 = cvc-elt.4.1: Wert ''{2}'' des Attributs ''{1}'' von Element ''{0}'' ist kein g\u00FCltiger QName.
++ cvc-elt.4.2 = cvc-elt.4.2: ''{1}'' kann nicht als Typdefinition f\u00FCr Element ''{0}'' aufgel\u00F6st werden.
++ cvc-elt.4.3 = cvc-elt.4.3: Typ ''{1}'' wurde nicht auf g\u00FCltige Weise von der Typdefinition ''{2}'' des Elements ''{0}'' abgeleitet.
++ cvc-elt.5.1.1 = cvc-elt.5.1.1: '{'value constraint'}' ''{2}'' des Elements ''{0}'' ist kein g\u00FCltiger Standardwert f\u00FCr Typ ''{1}''.
++ cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: Element ''{0}'' darf keine Elementinformationselemente [untergeordnete Elemente] haben.
++ cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: Wert ''{1}'' des Elements ''{0}'' stimmt nicht mit dem festen '{'value constraint'}'-Wert ''{2}'' \u00FCberein.
++ cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: Wert ''{1}'' des Elements ''{0}'' stimmt nicht mit dem '{'value constraint'}'-Wert ''{2}'' \u00FCberein.
++ cvc-enumeration-valid = cvc-enumeration-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf Enumeration ''{1}''. Er muss ein Wert aus der Enumeration sein.
++ cvc-fractionDigits-valid = cvc-fractionDigits-valid: Wert ''{0}'' enth\u00E4lt {1} Bruchziffern, die Anzahl an Bruchziffern wurde aber auf {2} beschr\u00E4nkt.
++ cvc-id.1 = cvc-id.1: Kein ID/IDREF-Binding f\u00FCr IDREF ''{0}'' vorhanden.
++ cvc-id.2 = cvc-id.2: ID-Wert ''{0}'' kommt mehrmals vor.
++ cvc-id.3 = cvc-id.3: Ein Feld von Identity Constraint ''{0}'' entsprach Element ''{1}''. Dieses Element hat aber keinen Simple Type.
++ cvc-length-valid = cvc-length-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf die L\u00E4nge ''{2}'' f\u00FCr Typ ''{3}''.
++ cvc-maxExclusive-valid = cvc-maxExclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf maxExclusive ''{1}'' f\u00FCr Typ ''{2}''.
++ cvc-maxInclusive-valid = cvc-maxInclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf maxInclusive ''{1}'' f\u00FCr Typ ''{2}''.
++ cvc-maxLength-valid = cvc-maxLength-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf maxLength ''{2}'' f\u00FCr Typ ''{3}''.
++ cvc-minExclusive-valid = cvc-minExclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf minExclusive ''{1}'' f\u00FCr Typ ''{2}''.
++ cvc-minInclusive-valid = cvc-minInclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf minInclusive ''{1}'' f\u00FCr Typ ''{2}''.
++ cvc-minLength-valid = cvc-minLength-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf minLength ''{2}'' f\u00FCr Typ ''{3}''.
++ cvc-pattern-valid = cvc-pattern-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf Muster ''{1}'' f\u00FCr Typ ''{2}''.
++ cvc-totalDigits-valid = cvc-totalDigits-valid: Wert ''{0}'' enth\u00E4lt {1} Gesamtziffern, die Anzahl an Gesamtziffern wurde aber auf {2} beschr\u00E4nkt.
+ cvc-type.2 = cvc-type.2: Typdefinition kann nicht abstrakt f\u00FCr Element {0} sein.
+- cvc-type.3.1.1 = cvc-type.3.1.1: Element "{0}" ist Simple Type und kann daher keine Attribute haben, mit Ausnahme der Attribute, deren Namespace-Name mit "http://www.w3.org/2001/XMLSchema-instance" identisch ist und deren [lokaler Name] "type", "nil", "schemaLocation" oder "noNamespaceSchemaLocation" lautet. Es wurde allerdings das Attribut "{1}" gefunden.
+- cvc-type.3.1.2 = cvc-type.3.1.2: Element "{0}" ist Simple Type und darf daher keine Elementinformationselemente [untergeordnete Elemente] haben.
+- cvc-type.3.1.3 = cvc-type.3.1.3: Wert "{1}" des Elements "{0}" ist ung\u00FCltig.
++ cvc-type.3.1.1 = cvc-type.3.1.1: Element ''{0}'' ist Simple Type und kann daher keine Attribute haben, mit Ausnahme der Attribute, deren Namespace-Name mit ''http://www.w3.org/2001/XMLSchema-instance'' identisch ist und deren [lokaler Name] ''type'', ''nil'', ''schemaLocation'' oder ''noNamespaceSchemaLocation'' lautet. Es wurde allerdings das Attribut ''{1}'' gefunden.
++ cvc-type.3.1.2 = cvc-type.3.1.2: Element ''{0}'' ist Simple Type und darf daher keine Elementinformationselemente [untergeordnete Elemente] haben.
++ cvc-type.3.1.3 = cvc-type.3.1.3: Wert ''{1}'' des Elements ''{0}'' ist ung\u00FCltig.
+
+ #schema valid (3.X.3)
+
+- schema_reference.access = schema_reference: Schemadokument "{0}" konnte nicht gelesen werden, weil der "{1}"-Zugriff wegen der von der Eigenschaft accessExternalSchema festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist.
+- schema_reference.4 = schema_reference.4: Schemadokument "{0}" konnte nicht gelesen werden, da 1) das Dokument nicht gefunden werden konnte; 2) das Dokument nicht gelesen werden konnte; 3) das Root-Element des Dokuments nicht <xsd:schema> ist.
+- src-annotation = src-annotation: <annotation>-Elemente k\u00F6nnen nur <appinfo>- und <documentation>-Elemente enthalten, aber es wurde "{0}" gefunden.
+- src-attribute.1 = src-attribute.1: Die Eigenschaften "default" und "fixed" k\u00F6nnen nicht beide in der Attributdeklaration "{0}" vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften.
+- src-attribute.2 = src-attribute.2: : Eigenschaft "default" ist im Attribut "{0}" vorhanden. Daher muss der Wert von "use" "optional" lauten.
+- src-attribute.3.1 = src-attribute.3.1: "ref" oder "name" muss in einer lokalen Attributdeklaration vorhanden sein.
+- src-attribute.3.2 = src-attribute.3.2: Content muss mit (annotation?) f\u00FCr die Attributreferenz "{0}" \u00FCbereinstimmen.
+- src-attribute.4 = src-attribute.4: Attribut "{0}" hat sowohl das Attribut "type" als auch ein anonymes untergeordnetes Element "simpleType". Nur eins davon ist f\u00FCr Attribute zul\u00E4ssig.
+- src-attribute_group.2 = src-attribute_group.2: Schnittmenge von Platzhaltern kann nicht f\u00FCr Attributgruppe "{0}" ausgedr\u00FCckt werden.
+- src-attribute_group.3 = src-attribute_group.3: Zyklische Definitionen f\u00FCr Attributgruppe "{0}" ermittelt. Das rekursive Folgen von Attributgruppenreferenzen f\u00FChrt schlie\u00DFlich zu sich selbst zur\u00FCck.
+- src-ct.1 = src-ct.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Wenn <complexContent> verwendet wird, muss der Basistyp ein complexType sein. "{1}" ist ein simpleType.
+- src-ct.2.1 = src-ct.2.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Wenn <simpleContent> verwendet wird, muss der Basistyp ein complexType sein, dessen Contenttyp "simple" ist, oder, wenn eine Einschr\u00E4nkung angegeben wurde, ein "complex"-Typ mit gemischtem Content und einem Partikel, das geleert werden kann, oder, wenn eine Erweiterung angegeben wurde, ein "simple"-Typ. "{1}" erf\u00FCllt keine dieser Bedingungen.
+- src-ct.2.2 = src-ct.2.2: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Wenn ein complexType mit simpleContent einen complexType mit gemischtem Content und einem Partikel, das geleert werden kann, einschr\u00E4nkt, muss ein <simpleType> in den untergeordneten Elementen von <restriction> enthalten sein.
+- src-ct.4 = src-ct.4: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Die Schnittmenge der Platzhalter kann nicht ausgedr\u00FCckt werden.
+- src-ct.5 = src-ct.5: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Die Vereinigungsmenge der Platzhalter kann nicht ausgedr\u00FCckt werden.
+- src-element.1 = src-element.1: Die Eigenschaften "default" und "fixed" k\u00F6nnen nicht beide in der Elementdeklaration "{0}" vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften.
+- src-element.2.1 = src-element.2.1: : "ref" oder "name" muss in einer lokalen Elementdeklaration vorhanden sein.
+- src-element.2.2 = src-element.2.2: Da "{0}" das Attribut "ref" enth\u00E4lt, muss der Content (annotation?) entsprechen. Es wurde allerdings "{1}" gefunden.
+- src-element.3 = src-element.3: Element "{0}" hat sowohl das Attribut "type" als auch ein untergeordnetes Element "anonymous type". Nur eins davon ist f\u00FCr Elemente zul\u00E4ssig.
+- src-import.1.1 = src-import.1.1: Namespace-Attribut "{0}" eines <import>-Elementinformationselements darf nicht mit dem targetNamespace des Schemas identisch sein, in dem es vorhanden ist.
++ schema_reference.access = schema_reference: Schemadokument ''{0}'' konnte nicht gelesen werden, weil der ''{1}''-Zugriff wegen der von der Eigenschaft accessExternalSchema festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist.
++ schema_reference.4 = schema_reference.4: Schemadokument ''{0}'' konnte nicht gelesen werden, da 1) das Dokument nicht gefunden werden konnte; 2) das Dokument nicht gelesen werden konnte; 3) das Root-Element des Dokuments nicht <xsd:schema> ist.
++ src-annotation = src-annotation: <annotation>-Elemente k\u00F6nnen nur <appinfo>- und <documentation>-Elemente enthalten, aber es wurde ''{0}'' gefunden.
++ src-attribute.1 = src-attribute.1: Die Eigenschaften ''default'' und ''fixed'' k\u00F6nnen nicht beide in der Attributdeklaration ''{0}'' vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften.
++ src-attribute.2 = src-attribute.2: : Eigenschaft ''default'' ist im Attribut ''{0}'' vorhanden. Daher muss der Wert von ''use'' ''optional'' lauten.
++ src-attribute.3.1 = src-attribute.3.1: 'ref' oder 'name' muss in einer lokalen Attributdeklaration vorhanden sein.
++ src-attribute.3.2 = src-attribute.3.2: Content muss mit (annotation?) f\u00FCr die Attributreferenz ''{0}'' \u00FCbereinstimmen.
++ src-attribute.4 = src-attribute.4: Attribut ''{0}'' hat sowohl das Attribut ''type'' als auch ein anonymes untergeordnetes Element ''simpleType''. Nur eins davon ist f\u00FCr Attribute zul\u00E4ssig.
++ src-attribute_group.2 = src-attribute_group.2: Schnittmenge von Platzhaltern kann nicht f\u00FCr Attributgruppe ''{0}'' ausgedr\u00FCckt werden.
++ src-attribute_group.3 = src-attribute_group.3: Zyklische Definitionen f\u00FCr Attributgruppe ''{0}'' ermittelt. Das rekursive Folgen von Attributgruppenreferenzen f\u00FChrt schlie\u00DFlich zu sich selbst zur\u00FCck.
++ src-ct.1 = src-ct.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn <complexContent> verwendet wird, muss der Basistyp ein complexType sein. ''{1}'' ist ein simpleType.
++ src-ct.2.1 = src-ct.2.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn <simpleContent> verwendet wird, muss der Basistyp ein complexType sein, dessen Contenttyp ''simple'' ist, oder, wenn eine Einschr\u00E4nkung angegeben wurde, ein ''complex''-Typ mit gemischtem Content und einem Partikel, das geleert werden kann, oder, wenn eine Erweiterung angegeben wurde, ein ''simple''-Typ. ''{1}'' erf\u00FCllt keine dieser Bedingungen.
++ src-ct.2.2 = src-ct.2.2: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn ein complexType mit simpleContent einen complexType mit gemischtem Content und einem Partikel, das geleert werden kann, einschr\u00E4nkt, muss ein <simpleType> in den untergeordneten Elementen von <restriction> enthalten sein.
++ src-ct.4 = src-ct.4: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Die Schnittmenge der Platzhalter kann nicht ausgedr\u00FCckt werden.
++ src-ct.5 = src-ct.5: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Die Vereinigungsmenge der Platzhalter kann nicht ausgedr\u00FCckt werden.
++ src-element.1 = src-element.1: Die Eigenschaften ''default'' und ''fixed'' k\u00F6nnen nicht beide in der Elementdeklaration ''{0}'' vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften.
++ src-element.2.1 = src-element.2.1: : 'ref' oder 'name' muss in einer lokalen Elementdeklaration vorhanden sein.
++ src-element.2.2 = src-element.2.2: Da ''{0}'' das Attribut ''ref'' enth\u00E4lt, muss der Content (annotation?) entsprechen. Es wurde allerdings ''{1}'' gefunden.
++ src-element.3 = src-element.3: Element ''{0}'' hat sowohl das Attribut ''type'' als auch ein untergeordnetes Element ''anonymous type''. Nur eins davon ist f\u00FCr Elemente zul\u00E4ssig.
++ src-import.1.1 = src-import.1.1: Namespace-Attribut ''{0}'' eines <import>-Elementinformationselements darf nicht mit dem targetNamespace des Schemas identisch sein, in dem es vorhanden ist.
+ src-import.1.2 = src-import.1.2: Wenn das Namespace-Attribut nicht bei einem <import>-Elementinformationselement vorhanden ist, muss das einschlie\u00DFende Schema einen targetNamespace haben.
+- src-import.2 = src-import.2: Das Root-Element des Dokuments "{0}" muss den Namespace-Namen "http://www.w3.org/2001/XMLSchema" und den lokalen Namen "schema" haben.
+- src-import.3.1 = src-import.3.1: Namespace-Attribut "{0}" eines <import>-Elementinformationselements muss mit dem targetNamespace-Attribut "{1}" des importierten Dokuments identisch sein.
+- src-import.3.2 = src-import.3.2: Es wurde ein <import>-Elementinformationselement ohne Namespace-Attribut gefunden. Daher kann das importierte Dokument kein targetNamespace-Attribut haben. targetNamespace "{1}" wurde aber im importierten Dokument gefunden.
+- src-include.1 = src-include.1: Das Root-Element des Dokuments "{0}" muss den Namespace-Namen "http://www.w3.org/2001/XMLSchema" und den lokalen Namen "schema" haben.
+- src-include.2.1 = src-include.2.1: targetNamespace des referenzierten Schemas (derzeit "{1}") muss mit dem im umfassenden Schema (derzeit "{0}") identisch sein.
+- src-redefine.2 = src-redefine.2: Das Root-Element des Dokuments "{0}" muss den Namespace-Namen "http://www.w3.org/2001/XMLSchema" und den lokalen Namen "schema" haben.
+- src-redefine.3.1 = src-redefine.3.1: targetNamespace des referenzierten Schemas (derzeit "{1}") muss mit dem im neu definierenden Schema (derzeit "{0}") identisch sein.
+- src-redefine.5.a.a = src-redefine.5.a.a: Keine untergeordneten Nicht-Annotationselemente von <simpleType> gefunden. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen.
+- src-redefine.5.a.b = src-redefine.5.a.b: "{0}" ist kein g\u00FCltiges untergeordnetes Element. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen.
+- src-redefine.5.a.c = src-redefine.5.a.c: "{0}" hat kein "base"-Attribut, das auf das neu definierte Element "{1}" verweist. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen.
+- src-redefine.5.b.a = src-redefine.5.b.a: Keine untergeordneten Nicht-Annotationselemente von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen.
+- src-redefine.5.b.b = src-redefine.5.b.b: Keine untergeordneten Nicht-Annotationselemente der zweiten Generation von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen.
+- src-redefine.5.b.c = src-redefine.5.b.c: "{0}" ist kein g\u00FCltiges untergeordnetes Element der zweiten Generation. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen.
+- src-redefine.5.b.d = src-redefine.5.b.d: "{0}" hat kein "base"-Attribut, das auf das neu definierte Element "{1}" verweist. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen.
+- src-redefine.6.1.1 = src-redefine.6.1.1: Wenn ein untergeordnetes Gruppenelement eines <redefine>-Elements eine Gruppe enth\u00E4lt, die auf sich selbst verweist, muss genau 1 vorhanden sein. Hier sind "{0}" vorhanden.
+- src-redefine.6.1.2 = src-redefine.6.1.2: Bei Gruppe "{0}", die eine Referenz zu einer Gruppe enth\u00E4lt, die neu definiert wird, muss "minOccurs" = "maxOccurs" = 1 gelten.
+- src-redefine.6.2.1 = src-redefine.6.2.1: Keine Gruppe im neu definierten Schema hat einen Namen, der "{0}" entspricht.
+- src-redefine.6.2.2 = src-redefine.6.2.2: Gruppe "{0}" schr\u00E4nkt die Gruppe, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: "{1}".
++ src-import.2 = src-import.2: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben.
++ src-import.3.1 = src-import.3.1: Namespace-Attribut ''{0}'' eines <import>-Elementinformationselements muss mit dem targetNamespace-Attribut ''{1}'' des importierten Dokuments identisch sein.
++ src-import.3.2 = src-import.3.2: Es wurde ein <import>-Elementinformationselement ohne Namespace-Attribut gefunden. Daher kann das importierte Dokument kein targetNamespace-Attribut haben. targetNamespace ''{1}'' wurde aber im importierten Dokument gefunden.
++ src-include.1 = src-include.1: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben.
++ src-include.2.1 = src-include.2.1: targetNamespace des referenzierten Schemas, derzeit ''{1}'', muss mit dem im umfassenden Schema, derzeit ''{0}'', identisch sein.
++ src-redefine.2 = src-redefine.2: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben.
++ src-redefine.3.1 = src-redefine.3.1: targetNamespace des referenzierten Schemas, derzeit ''{1}'', muss mit dem im neu definierenden Schema, derzeit ''{0}'', identisch sein.
++ src-redefine.5.a.a = src-redefine.5.a.a: Keine untergeordneten Nicht-Annotationselemente von <simpleType> gefunden. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen.
++ src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' ist kein g\u00FCltiges untergeordnetes Element. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen.
++ src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' hat kein ''base''-Attribut, das auf das neu definierte Element ''{1}'' verweist. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen.
++ src-redefine.5.b.a = src-redefine.5.b.a: Keine untergeordneten Nicht-Annotationselemente von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen.
++ src-redefine.5.b.b = src-redefine.5.b.b: Keine untergeordneten Nicht-Annotationselemente der zweiten Generation von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen.
++ src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' ist kein g\u00FCltiges untergeordnetes Element der zweiten Generation. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen.
++ src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' hat kein ''base''-Attribut, das auf das neu definierte Element ''{1}'' verweist. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen.
++ src-redefine.6.1.1 = src-redefine.6.1.1: Wenn ein untergeordnetes Gruppenelement eines <redefine>-Elements eine Gruppe enth\u00E4lt, die auf sich selbst verweist, muss genau 1 vorhanden sein. Hier sind ''{0}'' vorhanden.
++ src-redefine.6.1.2 = src-redefine.6.1.2: Bei Gruppe ''{0}'', die eine Referenz zu einer Gruppe enth\u00E4lt, die neu definiert wird, muss ''minOccurs'' = ''maxOccurs'' = 1 gelten.
++ src-redefine.6.2.1 = src-redefine.6.2.1: Keine Gruppe im neu definierten Schema hat einen Namen, der ''{0}'' entspricht.
++ src-redefine.6.2.2 = src-redefine.6.2.2: Gruppe ''{0}'' schr\u00E4nkt die Gruppe, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: ''{1}''.
+ src-redefine.7.1 = src-redefine.7.1: Wenn ein untergeordnetes attributeGroup-Element eines <redefine>-Elements eine attributeGroup enth\u00E4lt, die auf sich selbst verweist, muss genau 1 vorhanden sein. Hier sind {0} vorhanden.
+- src-redefine.7.2.1 = src-redefine.7.2.1: Keine attributeGroup im neu definierten Schema hat einen Namen, der "{0}" entspricht.
+- src-redefine.7.2.2 = src-redefine.7.2.2: attributeGroup "{0}" schr\u00E4nkt die attributeGroup, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: "{1}".
+- src-resolve = src-resolve: Name "{0}" kann nicht als "{1}"-Komponente aufgel\u00F6st werden.
+- src-resolve.4.1 = src-resolve.4.1: Fehler beim Aufl\u00F6sen von Komponente "{2}". Es wurde ermittelt, dass "{2}" keinen Namespace hat, aber Komponenten ohne Ziel-Namespace k\u00F6nnen nicht aus Schemadokument "{0}" referenziert werden. Wenn "{2}" einen Namespace haben soll, muss m\u00F6glicherweise ein Pr\u00E4fix angegeben werden. Wenn "{2}" keinen Namespace haben soll, muss ein "import" ohne "namespace"-Attribut zu "{0}" hinzugef\u00FCgt werden.
+- src-resolve.4.2 = src-resolve.4.2: Fehler beim Aufl\u00F6sen von Komponente "{2}". Es wurde ermittelt, dass "{2}" in Namespace "{1}" vorhanden ist, aber Komponenten aus diesem Namespace k\u00F6nnen nicht aus Schemadokument "{0}" referenziert werden. Wenn dies der falsche Namespace ist, muss m\u00F6glicherweise das Pr\u00E4fix von "{2}" ge\u00E4ndert werden. Wenn dies der richtige Namespace ist, muss ein entsprechendes "import"-Tag zu "{0}" hinzugef\u00FCgt werden.
+- src-simple-type.2.a = src-simple-type.2.a: Es wurde ein <restriction>-Element gefunden, das sowohl ein "base"-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig.
+- src-simple-type.2.b = src-simple-type.2.b: Es wurde ein <restriction>-Element gefunden, das weder ein "base"-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich.
+- src-simple-type.3.a = src-simple-type.3.a: Es wurde ein <list>-Element gefunden, das sowohl ein "itemType"-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig.
+- src-simple-type.3.b = src-simple-type.3.b: Es wurde ein <list>-Element gefunden, das weder ein "itemType"-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich.
+- src-single-facet-value = src-single-facet-value: Facet "{0}" ist mehrmals definiert.
++ src-redefine.7.2.1 = src-redefine.7.2.1: Keine attributeGroup im neu definierten Schema hat einen Namen, der ''{0}'' entspricht.
++ src-redefine.7.2.2 = src-redefine.7.2.2: attributeGroup ''{0}'' schr\u00E4nkt die attributeGroup, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: ''{1}''.
++ src-resolve = src-resolve: Name ''{0}'' kann nicht als ''{1}''-Komponente aufgel\u00F6st werden.
++ src-resolve.4.1 = src-resolve.4.1: Fehler beim Aufl\u00F6sen von Komponente ''{2}''. Es wurde ermittelt, dass ''{2}'' keinen Namespace hat, aber Komponenten ohne Ziel-Namespace k\u00F6nnen nicht aus Schemadokument ''{0}'' referenziert werden. Wenn ''{2}'' einen Namespace haben soll, muss m\u00F6glicherweise ein Pr\u00E4fix angegeben werden. Wenn ''{2}'' keinen Namespace haben soll, muss ein ''import'' ohne ''namespace''-Attribut zu ''{0}'' hinzugef\u00FCgt werden.
++ src-resolve.4.2 = src-resolve.4.2: Fehler beim Aufl\u00F6sen von Komponente ''{2}''. Es wurde ermittelt, dass ''{2}'' in Namespace ''{1}'' vorhanden ist, aber Komponenten aus diesem Namespace k\u00F6nnen nicht aus Schemadokument ''{0}'' referenziert werden. Wenn dies der falsche Namespace ist, muss m\u00F6glicherweise das Pr\u00E4fix von ''{2}'' ge\u00E4ndert werden. Wenn dies der richtige Namespace ist, muss ein entsprechendes ''import''-Tag zu ''{0}'' hinzugef\u00FCgt werden.
++ src-simple-type.2.a = src-simple-type.2.a: Es wurde ein <restriction>-Element gefunden, das sowohl ein 'base'-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig.
++ src-simple-type.2.b = src-simple-type.2.b: Es wurde ein <restriction>-Element gefunden, das weder ein 'base'-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich.
++ src-simple-type.3.a = src-simple-type.3.a: Es wurde ein <list>-Element gefunden, das sowohl ein 'itemType'-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig.
++ src-simple-type.3.b = src-simple-type.3.b: Es wurde ein <list>-Element gefunden, das weder ein 'itemType'-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich.
++ src-single-facet-value = src-single-facet-value: Facet ''{0}'' ist mehrmals definiert.
+ src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: Ein <union>-Element muss entweder ein nicht leeres memberTypes-[Attribut] oder mindestens ein <simpleType>-Element in seinen [untergeordneten Elementen] enthalten.
+
+ #constraint valid (3.X.6)
+
+- ag-props-correct.2 = ag-props-correct.2: Fehler bei Attributgruppe "{0}". Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet "{1}".
+- ag-props-correct.3 = ag-props-correct.3: Fehler bei Attributgruppe "{0}". Zwei Attributdeklarationen ("{1}" und "{2}") haben Typen, die aus ID abgeleitet wurden.
+- a-props-correct.2 = a-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert "{1}" in Attribut "{0}".
+- a-props-correct.3 = a-props-correct.3: Bei Attribut "{0}" kann "fixed" oder "default" nicht verwendet werden, da die "{''type definition''}" des Attributs "ID" ist oder aus ID abgeleitet wurde.
+- au-props-correct.2 = au-props-correct.2: In der Attributdeklaration von "{0}" wurde der feste Wert "{1}" angegeben. Wenn also die Attributverwendung, die auf "{0}" verweist, auch einen "{''value constraint''}" hat, muss sie fest sein, und der Wert muss "{1}" lauten.
+- cos-all-limited.1.2 = cos-all-limited.1.2: Eine "all"-Modellgruppe muss in einem Partikel mit "{'min occurs'}" = "{'max occurs'}" = 1 vorkommen, und dieses Partikel muss zu einem Paar geh\u00F6ren, das den "{'content type'}" einer Complex Type-Definition darstellt.
+- cos-all-limited.2 = cos-all-limited.2: "{"max occurs"}" eines Elements in einer "all"-Modellgruppe muss 0 oder 1 sein. Der Wert "{0}" f\u00FCr Element "{1}" ist ung\u00FCltig.
+- cos-applicable-facets = cos-applicable-facets: Facet "{0}" ist nicht zul\u00E4ssig f\u00FCr Typ {1}.
+- cos-ct-extends.1.1 = cos-ct-extends.1.1: Typ "{0}" wurde durch die Erweiterung von Typ "{1}" abgeleitet. Das Attribut "final" von "{1}" l\u00E4sst die Ableitung durch Erweiterung aber nicht zu.
+- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide "mixed" oder "element-only" sein. Typ "{0}" ist "element only", aber sein Basistyp nicht.
+- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide "mixed" oder "element-only" sein. Typ "{0}" ist "mixed", aber sein Basistyp nicht.
+- cos-element-consistent = cos-element-consistent: Fehler bei Typ "{0}". Mehrere Elemente mit Namen "{1}" und unterschiedlichen Typen kommen in der Modellgruppe vor.
+- cos-list-of-atomic = cos-list-of-atomic: In der Definition von Listentyp "{0}" ist Typ "{1}" ein ung\u00FCltiger Listenelementtyp, da er nicht atomar ist ("{1}" ist entweder ein Listentyp oder ein Vereinigungsmengentyp, der eine Liste enth\u00E4lt).
+- cos-nonambig = cos-nonambig: {0} und {1} (oder Elemente aus ihrer Substitutionsgruppe) verletzen "Unique Particle Attribution". Bei der Validierung f\u00FCr dieses Schema w\u00FCrde eine Mehrdeutigkeit f\u00FCr diese beiden Partikel erstellt.
++ ag-props-correct.2 = ag-props-correct.2: Fehler bei Attributgruppe ''{0}''. Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet ''{1}''.
++ ag-props-correct.3 = ag-props-correct.3: Fehler bei Attributgruppe ''{0}''. Zwei Attributdeklarationen (''{1}'' und ''{2}'') haben Typen, die aus ID abgeleitet wurden.
++ a-props-correct.2 = a-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert ''{1}'' in Attribut ''{0}''.
++ a-props-correct.3 = a-props-correct.3: Bei Attribut ''{0}'' kann ''fixed'' oder ''default'' nicht verwendet werden, da die '{'type definition'}' des Attributs ''ID'' ist oder aus ID abgeleitet wurde.
++ au-props-correct.2 = au-props-correct.2: In der Attributdeklaration von ''{0}'' wurde der feste Wert ''{1}'' angegeben. Wenn also die Attributverwendung, die auf ''{0}'' verweist, auch einen '{'value constraint'}' hat, muss sie fest sein, und der Wert muss ''{1}'' lauten.
++ cos-all-limited.1.2 = cos-all-limited.1.2: Eine 'all'-Modellgruppe muss in einem Partikel mit '{'min occurs'}' = '{'max occurs'}' = 1 vorkommen, und dieses Partikel muss zu einem Paar geh\u00F6ren, das den '{'content type'}' einer Complex Type-Definition darstellt.
++ cos-all-limited.2 = cos-all-limited.2: '{'max occurs'}' eines Elements in einer ''all''-Modellgruppe muss 0 oder 1 sein. Der Wert ''{0}'' f\u00FCr Element ''{1}'' ist ung\u00FCltig.
++ cos-applicable-facets = cos-applicable-facets: Facet ''{0}'' ist nicht zul\u00E4ssig f\u00FCr Typ {1}.
++ cos-ct-extends.1.1 = cos-ct-extends.1.1: Typ ''{0}'' wurde durch die Erweiterung von Typ ''{1}'' abgeleitet. Das Attribut ''final'' von ''{1}'' l\u00E4sst die Ableitung durch Erweiterung aber nicht zu.
++ cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide ''mixed'' oder ''element-only'' sein. Typ ''{0}'' ist ''element only'', aber sein Basistyp nicht.
++ cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide ''mixed'' oder ''element-only'' sein. Typ ''{0}'' ist ''mixed'', aber sein Basistyp nicht.
++ cos-element-consistent = cos-element-consistent: Fehler bei Typ ''{0}''. Mehrere Elemente mit Namen ''{1}'' und unterschiedlichen Typen kommen in der Modellgruppe vor.
++ cos-list-of-atomic = cos-list-of-atomic: In der Definition von Listentyp ''{0}'' ist Typ ''{1}'' ein ung\u00FCltiger Listenelementtyp, da er nicht atomar ist (''{1}'' ist entweder ein Listentyp oder ein Vereinigungsmengentyp, der eine Liste enth\u00E4lt).
++ cos-nonambig = cos-nonambig: {0} und {1} (oder Elemente aus ihrer Substitutionsgruppe) verletzen ''Unique Particle Attribution''. Bei der Validierung f\u00FCr dieses Schema w\u00FCrde eine Mehrdeutigkeit f\u00FCr diese beiden Partikel erstellt.
+ cos-particle-restrict.a = cos-particle-restrict.a: Abgeleitetes Partikel ist leer, und die Basis kann nicht geleert werden.
+ cos-particle-restrict.b = cos-particle-restrict.b: Basispartikel ist leer, aber das abgeleitete Partikel ist nicht leer.
+- cos-particle-restrict.2 = cos-particle-restrict.2: Unzul\u00E4ssige Partikeleinschr\u00E4nkung: "{0}".
+- cos-st-restricts.1.1 = cos-st-restricts.1.1: Typ "{1}" ist atomar. Daher muss die zugeh\u00F6rige "{''base type definition''}" "{0}" eine atomare Simple Type-Definition oder ein integrierter primitiver Datentyp sein.
+- cos-st-restricts.2.1 = cos-st-restricts.2.1: In der Definition von Listentyp "{0}" ist Typ "{1}" ein ung\u00FCltiger Elementtyp, da er entweder ein Listentyp oder ein Vereinigungsmengentyp ist, der eine Liste enth\u00E4lt.
+- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: Komponente "{"final"}" der "{"item type definition"}" "{0}" enth\u00E4lt "list". Dies bedeutet, dass "{0}" nicht als Elementtyp f\u00FCr Listentyp "{1}" verwendet werden kann.
+- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: Komponente "{"final"}" der "{"member type definitions"}" "{0}" enth\u00E4lt "union". Dies bedeutet, dass "{0}" nicht als Mitgliedstyp f\u00FCr Vereinigungsmengentyp "{1}" verwendet werden kann.
+- cos-valid-default.2.1 = cos-valid-default.2.1: Element "{0}" hat einen Werte-Constraint und muss ein Misch- oder ein einfaches Contentmodell haben.
+- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Da Element "{0}" einen "{''value constraint''}" hat und seine Typdefinition einen gemischten "{''content type''}" hat, muss das Partikel des "{''content type''}" geleert werden k\u00F6nnen.
+- c-props-correct.2 = c-props-correct.2: Kardinalit\u00E4t von Feldern f\u00FCr keyref "{0}" und Schl\u00FCssel "{1}" muss sich gegenseitig entsprechen.
+- ct-props-correct.3 = ct-props-correct.3: Zyklische Definitionen f\u00FCr Complex Type "{0}" ermittelt. Dies bedeutet, dass "{0}" in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler.
+- ct-props-correct.4 = ct-props-correct.4: Fehler bei Typ "{0}". Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet "{1}".
+- ct-props-correct.5 = ct-props-correct.5: Fehler bei Typ "{0}". Zwei Attributdeklarationen ("{1}" und "{2}") haben Typen, die aus ID abgeleitet wurden.
+- derivation-ok-restriction.1 = derivation-ok-restriction.1: Typ "{0}" wurde durch die Einschr\u00E4nkung von Typ "{1}" abgeleitet. "{1}" hat aber eine "{''final''}"-Eigenschaft, die die Ableitung durch Einschr\u00E4nkung nicht zul\u00E4sst.
+- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat den "use"-Wert "{2}", der nicht mit dem Wert von "required" in einer \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent ist.
+- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat den Typ "{2}", der nicht auf g\u00FCltige Weise von "{3}" abgeleitet wurde, dem Typ der \u00FCbereinstimmenden Attributverwendung im Basistyp.
+- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat einen effektiven Werte-Constraint, der nicht fest ist, und der effektive Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp ist fest.
+- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat einen effektiven festen Werte-Constraint mit dem Wert "{2}". Dies ist nicht mit dem Wert "{3}" f\u00FCr den festen effektiven Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent.
+- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Basistyp hat kein Platzhalterattribut.
+- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Platzhalter im Basistyp l\u00E4sst den Namespace "{2}" dieser Attributverwendung nicht zu.
+- derivation-ok-restriction.3 = derivation-ok-restriction.3: Fehler bei Typ "{0}". Bei Attributverwendung "{1}" im Basistyp ist REQUIRED "true", aber es ist keine \u00FCbereinstimmende Attributverwendung im abgeleiteten Typ vorhanden.
+- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Fehler bei Typ "{0}". Ableitung hat einen Attributplatzhalter, aber die Basis hat keinen.
+- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Fehler bei Typ "{0}". Platzhalter in der Ableitung ist keine g\u00FCltige Platzhalter-Teilmenge des Platzhalters in der Basis.
+- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Fehler bei Typ "{0}". Prozesscontent des Platzhalters in der Ableitung ({1}) ist schw\u00E4cher als der Content in der Basis ({2}).
+- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Fehler bei Typ "{0}". Einfacher Contenttyp dieses Typs "{1}" ist keine g\u00FCltige Einschr\u00E4nkung des einfachen Contenttyps der Basis "{2}".
+- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Fehler bei Typ "{0}". Contenttyp dieses Typs ist leer, aber der Contenttyps der Basis "{1}" ist nicht leer oder kann nicht geleert werden.
+- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Fehler bei Typ "{0}". Contenttyp dieses Typs ist "mixed", aber der Contenttyps der Basis "{1}" nicht.
+- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Fehler bei Typ "{0}". Partikel des Typs ist keine g\u00FCltige Einschr\u00E4nkung des Partikels der Basis.
+- enumeration-required-notation = enumeration-required-notation: NOTATION-Typ "{0}", der von {2} "{1}" verwendet wird, muss einen Enumerations-Facet-Wert haben, der die von diesem Typ verwendeten Notationselemente angibt.
+- enumeration-valid-restriction = enumeration-valid-restriction: Enumerationswert "{0}" ist nicht im Wertebereich des Basistyps {1} vorhanden.
+- e-props-correct.2 = e-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert "{1}" in Element "{0}".
+- e-props-correct.4 = e-props-correct.4: "{"type definition"}" von Element "{0}" wurde nicht auf g\u00FCltige Weise von der "{"type definition"}" von substitutionHead "{1}" abgeleitet, oder die "{"substitution group exclusions"}"-Eigenschaft von "{1}" l\u00E4sst diese Ableitung nicht zu.
+- e-props-correct.5 = e-props-correct.5: "{"value constraint"}" darf nicht bei Element "{0}" vorhanden sein, da die "{"type definition"}" des Elements oder der "{"content type"}" der "{"type definition"}" "ID" ist oder von ID abgeleitet wurde.
+- e-props-correct.6 = e-props-correct.6: Zyklische Substitutionsgruppe f\u00FCr Element "{0}" ermittelt.
+- fractionDigits-valid-restriction = fractionDigits-valid-restriction: In der Definition von {2} ist der Wert "{0}" f\u00FCr Facet "fractionDigits" ung\u00FCltig, da er <= dem Wert f\u00FCr "fractionDigits" sein muss, der in einem der Vorg\u00E4ngertypen auf "{1}" gesetzt wurde.
+- fractionDigits-totalDigits = fractionDigits-totalDigits: In der Definition von {2} ist der Wert "{0}" f\u00FCr Facet "fractionDigits" ung\u00FCltig, da der Wert <= dem Wert f\u00FCr "totalDigits" sein muss, der "{1}" ist.
+- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length "{1}" kleiner als der Wert von minLength "{2}" ist.
++ cos-particle-restrict.2 = cos-particle-restrict.2: Unzul\u00E4ssige Partikeleinschr\u00E4nkung: ''{0}''.
++ cos-st-restricts.1.1 = cos-st-restricts.1.1: Typ ''{1}'' ist atomar. Daher muss die zugeh\u00F6rige '{'base type definition'}' ''{0}'' eine atomare Simple Type-Definition oder ein integrierter primitiver Datentyp sein.
++ cos-st-restricts.2.1 = cos-st-restricts.2.1: In der Definition von Listentyp ''{0}'' ist Typ ''{1}'' ein ung\u00FCltiger Elementtyp, da er entweder ein Listentyp oder ein Vereinigungsmengentyp ist, der eine Liste enth\u00E4lt.
++ cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: Komponente '{'final'}' der '{'item type definition'}' ''{0}'' enth\u00E4lt ''list''. Dies bedeutet, dass ''{0}'' nicht als Elementtyp f\u00FCr Listentyp ''{1}'' verwendet werden kann.
++ cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: Komponente '{'final'}' der '{'member type definitions'}' ''{0}'' enth\u00E4lt ''union''. Dies bedeutet, dass ''{0}'' nicht als Mitgliedstyp f\u00FCr Vereinigungsmengentyp ''{1}'' verwendet werden kann.
++ cos-valid-default.2.1 = cos-valid-default.2.1: Element ''{0}'' hat einen Werte-Constraint und muss ein Misch- oder ein einfaches Contentmodell haben.
++ cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Da Element ''{0}'' einen '{'value constraint'}' hat und seine Typdefinition einen gemischten '{'content type'}' hat, muss das Partikel des '{'content type'}' geleert werden k\u00F6nnen.
++ c-props-correct.2 = c-props-correct.2: Kardinalit\u00E4t von Feldern f\u00FCr keyref ''{0}'' und Schl\u00FCssel ''{1}'' muss sich gegenseitig entsprechen.
++ ct-props-correct.3 = ct-props-correct.3: Zyklische Definitionen f\u00FCr Complex Type ''{0}'' ermittelt. Dies bedeutet, dass ''{0}'' in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler.
++ ct-props-correct.4 = ct-props-correct.4: Fehler bei Typ ''{0}''. Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet ''{1}''.
++ ct-props-correct.5 = ct-props-correct.5: Fehler bei Typ ''{0}''. Zwei Attributdeklarationen (''{1}'' und ''{2}'') haben Typen, die aus ID abgeleitet wurden.
++ derivation-ok-restriction.1 = derivation-ok-restriction.1: Typ ''{0}'' wurde durch die Einschr\u00E4nkung von Typ ''{1}'' abgeleitet. ''{1}'' hat aber eine '{'final'}'-Eigenschaft, die die Ableitung durch Einschr\u00E4nkung nicht zul\u00E4sst.
++ derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat den ''use''-Wert ''{2}'', der nicht mit dem Wert von ''required'' in einer \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent ist.
++ derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat den Typ ''{2}'', der nicht auf g\u00FCltige Weise von ''{3}'' abgeleitet wurde, dem Typ der \u00FCbereinstimmenden Attributverwendung im Basistyp.
++ derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat einen effektiven Werte-Constraint, der nicht fest ist, und der effektive Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp ist fest.
++ derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat einen effektiven festen Werte-Constraint mit dem Wert ''{2}''. Dies ist nicht mit dem Wert ''{3}'' f\u00FCr den festen effektiven Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent.
++ derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Basistyp hat kein Platzhalterattribut.
++ derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Platzhalter im Basistyp l\u00E4sst den Namespace ''{2}'' dieser Attributverwendung nicht zu.
++ derivation-ok-restriction.3 = derivation-ok-restriction.3: Fehler bei Typ ''{0}''. Bei Attributverwendung ''{1}'' im Basistyp ist REQUIRED ''true'', aber es ist keine \u00FCbereinstimmende Attributverwendung im abgeleiteten Typ vorhanden.
++ derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Fehler bei Typ ''{0}''. Ableitung hat einen Attributplatzhalter, aber die Basis hat keinen.
++ derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Fehler bei Typ ''{0}''. Platzhalter in der Ableitung ist keine g\u00FCltige Platzhalter-Teilmenge des Platzhalters in der Basis.
++ derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Fehler bei Typ ''{0}''. Prozesscontent des Platzhalters in der Ableitung ({1}) ist schw\u00E4cher als der Content in der Basis ({2}).
++ derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Fehler bei Typ ''{0}''. Einfacher Contenttyp dieses Typs ''{1}'' ist keine g\u00FCltige Einschr\u00E4nkung des einfachen Contenttyps der Basis ''{2}''.
++ derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Fehler bei Typ ''{0}''. Contenttyp dieses Typs ist leer, aber der Contenttyps der Basis ''{1}'' ist nicht leer oder kann nicht geleert werden.
++ derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Fehler bei Typ ''{0}''. Contenttyp dieses Typs ist ''mixed'', aber der Contenttyps der Basis ''{1}'' nicht.
++ derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Fehler bei Typ ''{0}''. Partikel des Typs ist keine g\u00FCltige Einschr\u00E4nkung des Partikels der Basis.
++ enumeration-required-notation = enumeration-required-notation: NOTATION-Typ ''{0}'', der von {2} ''{1}'' verwendet wird, muss einen Enumerations-Facet-Wert haben, der die von diesem Typ verwendeten Notationselemente angibt.
++ enumeration-valid-restriction = enumeration-valid-restriction: Enumerationswert ''{0}'' ist nicht im Wertebereich des Basistyps {1} vorhanden.
++ e-props-correct.2 = e-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert ''{1}'' in Element ''{0}''.
++ e-props-correct.4 = e-props-correct.4: '{'type definition'}' von Element ''{0}'' wurde nicht auf g\u00FCltige Weise von der '{'type definition'}' von substitutionHead ''{1}'' abgeleitet, oder die '{'substitution group exclusions'}'-Eigenschaft von ''{1}'' l\u00E4sst diese Ableitung nicht zu.
++ e-props-correct.5 = e-props-correct.5: '{'value constraint'}' darf nicht bei Element ''{0}'' vorhanden sein, da die '{'type definition'}' des Elements oder der '{'content type'}' der '{'type definition'}' ID ist oder von ID abgeleitet wurde.
++ e-props-correct.6 = e-props-correct.6: Zyklische Substitutionsgruppe f\u00FCr Element ''{0}'' ermittelt.
++ fractionDigits-valid-restriction = fractionDigits-valid-restriction: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''fractionDigits'' ung\u00FCltig, da er <= dem Wert f\u00FCr ''fractionDigits'' sein muss, der in einem der Vorg\u00E4ngertypen auf ''{1}'' gesetzt wurde.
++ fractionDigits-totalDigits = fractionDigits-totalDigits: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''fractionDigits'' ung\u00FCltig, da der Wert <= dem Wert f\u00FCr ''totalDigits'' sein muss, der ''{1}'' ist.
++ length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length ''{1}'' kleiner als der Wert von minLength ''{2}'' ist.
+ length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: Bei Typ {0} gilt es als Fehler, wenn die Basis kein minLength-Facet hat, wenn die aktuelle Einschr\u00E4nkung das minLength-Facet und die aktuelle Einschr\u00E4nkung oder Basis das length-Facet hat.
+- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle minLength "{1}" nicht mit der Basis-minLength "{2}" identisch ist.
+- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length "{1}" gr\u00F6\u00DFer als der Wert von maxLength "{2}" ist.
++ length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle minLength ''{1}'' nicht mit der Basis-minLength ''{2}'' identisch ist.
++ length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length ''{1}'' gr\u00F6\u00DFer als der Wert von maxLength ''{2}'' ist.
+ length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: Bei Typ {0} gilt es als Fehler, wenn die Basis kein maxLength-Facet hat, wenn die aktuelle Einschr\u00E4nkung das maxLength-Facet und die aktuelle Einschr\u00E4nkung oder Basis das length-Facet hat.
+- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle maxLength "{1}" nicht mit der Basis-maxLength "{2}" identisch ist.
+- length-valid-restriction = length-valid-restriction: Fehler bei Typ "{2}". Der Wert von length = "{0}" muss mit dem Wert des Basistyps "{1}" identisch sein.
+- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Fehler bei Typ "{2}". maxExclusive-Wert ="{0}" muss <= maxExclusive des Basistyps "{1}" sein.
+- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Fehler bei Typ "{2}". maxExclusive-Wert ="{0}" muss <= maxInclusive des Basistyps "{1}" sein.
+- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Fehler bei Typ "{2}". maxExclusive-Wert ="{0}" muss > minInclusive des Basistyps "{1}" sein.
+- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Fehler bei Typ "{2}". maxExclusive-Wert ="{0}" muss > minExclusive des Basistyps "{1}" sein.
+- maxInclusive-maxExclusive = maxInclusive-maxExclusive: Es gilt als Fehler, wenn sowohl maxInclusive als auch maxExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: maxInclusive = "{0}" und maxExclusive = "{1}".
+- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Fehler bei Typ "{2}". maxInclusive-Wert ="{0}" muss <= maxInclusive des Basistyps "{1}" sein.
+- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Fehler bei Typ "{2}". maxInclusive-Wert ="{0}" muss < maxExclusive des Basistyps "{1}" sein.
+- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Fehler bei Typ "{2}". maxInclusive-Wert ="{0}" muss >= maxInclusive des Basistyps "{1}" sein.
+- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Fehler bei Typ "{2}". maxInclusive-Wert ="{0}" muss > minExclusive des Basistyps "{1}" sein.
+- maxLength-valid-restriction = maxLength-valid-restriction: In der Definition von {2} muss maxLength-Wert = "{0}" <= dem Wert des Basistyps "{1}" sein.
+- mg-props-correct.2 = mg-props-correct.2: Zyklische Definitionen f\u00FCr Gruppe "{0}" ermittelt. Rekursives Folgen der "{''term''}"-Werte der Partikel f\u00FChrt zu einem Partikel, dessen "{''term''}" die Gruppe selbst ist.
+- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: In der Definition von {2} muss minExclusive-Wert = "{0}" <= maxExclusive-Wert = "{1}" sein.
+- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: In der Definition von {2} muss minExclusive-Wert = "{0}" < maxInclusive-Wert = "{1}" sein.
+- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Fehler bei Typ "{2}". minExclusive-Wert ="{0}" muss >= minExclusive des Basistyps "{1}" sein.
+- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Fehler bei Typ "{2}". minExclusive-Wert ="{0}" muss <= maxInclusive des Basistyps "{1}" sein.
+- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Fehler bei Typ "{2}". minExclusive-Wert ="{0}" muss >= minInclusive des Basistyps "{1}" sein.
+- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Fehler bei Typ "{2}". minExclusive-Wert ="{0}" muss < maxExclusive des Basistyps "{1}" sein.
+- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: In der Definition von {2} muss minInclusive-Wert = "{0}" <= maxInclusive-Wert = "{1}" sein.
+- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: In der Definition von {2} muss minInclusive-Wert = "{0}" < maxExclusive-Wert = "{1}" sein.
+- minInclusive-minExclusive = minInclusive-minExclusive: Es gilt als Fehler, wenn sowohl minInclusive als auch minExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: minInclusive = "{0}" und minExclusive = "{1}".
+- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Fehler bei Typ "{2}". minInclusive-Wert ="{0}" muss >= minInclusive des Basistyps "{1}" sein.
+- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Fehler bei Typ "{2}". minInclusive-Wert ="{0}" muss <= maxInclusive des Basistyps "{1}" sein.
+- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Fehler bei Typ "{2}". minInclusive-Wert ="{0}" muss > minExclusive des Basistyps "{1}" sein.
+- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Fehler bei Typ "{2}". minInclusive-Wert ="{0}" muss < maxExclusive des Basistyps "{1}" sein.
+- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: In der Definition von {2} muss der Wert von minLength = "{0}" < dem Wert von maxLength = "{1}" sein.
+- minLength-valid-restriction = minLength-valid-restriction: In der Definition von {2} muss minLength = "{0}" >= dem Wert des Basistyps "{1}" sein.
+- no-xmlns = no-xmlns: {name} einer Attributdeklaration darf nicht mit "xmlns" \u00FCbereinstimmen.
+- no-xsi = no-xsi: "{"target namespace"}" einer Attributdeklaration darf nicht mit "{0}" \u00FCbereinstimmen.
+- p-props-correct.2.1 = p-props-correct.2.1: In der Deklaration von "{0}" ist der Wert von "minOccurs" "{1}", er darf aber nicht gr\u00F6\u00DFer als der Wert von "maxOccurs" sein, der "{2}" lautet.
++ length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle maxLength ''{1}'' nicht mit der Basis-maxLength ''{2}'' identisch ist.
++ length-valid-restriction = length-valid-restriction: Fehler bei Typ ''{2}''. Der Wert von length = ''{0}'' muss mit dem Wert des Basistyps ''{1}'' identisch sein.
++ maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss <= maxExclusive des Basistyps ''{1}'' sein.
++ maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein.
++ maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss > minInclusive des Basistyps ''{1}'' sein.
++ maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein.
++ maxInclusive-maxExclusive = maxInclusive-maxExclusive: Es gilt als Fehler, wenn sowohl maxInclusive als auch maxExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: maxInclusive = ''{0}'' und maxExclusive = ''{1}''.
++ maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein.
++ maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein.
++ maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss >= maxInclusive des Basistyps ''{1}'' sein.
++ maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein.
++ maxLength-valid-restriction = maxLength-valid-restriction: In der Definition von {2} muss maxLength-Wert = ''{0}'' <= dem Wert des Basistyps ''{1}'' sein.
++ mg-props-correct.2 = mg-props-correct.2: Zyklische Definitionen f\u00FCr Gruppe ''{0}'' ermittelt. Rekursives Folgen der '{'term'}'-Werte der Partikel f\u00FChrt zu einem Partikel, dessen '{'term'}' die Gruppe selbst ist.
++ minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: In der Definition von {2} muss minExclusive-Wert = ''{0}'' <= maxExclusive-Wert = ''{1}'' sein.
++ minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: In der Definition von {2} muss minExclusive-Wert = ''{0}'' < maxInclusive-Wert = ''{1}'' sein.
++ minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss >= minExclusive des Basistyps ''{1}'' sein.
++ minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein.
++ minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss >= minInclusive des Basistyps ''{1}'' sein.
++ minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein.
++ minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: In der Definition von {2} muss minInclusive-Wert = ''{0}'' <= maxInclusive-Wert = ''{1}'' sein.
++ minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: In der Definition von {2} muss minInclusive-Wert = ''{0}'' < maxExclusive-Wert = ''{1}'' sein.
++ minInclusive-minExclusive = minInclusive-minExclusive: Es gilt als Fehler, wenn sowohl minInclusive als auch minExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: minInclusive = ''{0}'' und minExclusive = ''{1}''.
++ minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss >= minInclusive des Basistyps ''{1}'' sein.
++ minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein.
++ minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein.
++ minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein.
++ minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: In der Definition von {2} muss der Wert von minLength = ''{0}'' < dem Wert von maxLength = ''{1}'' sein.
++ minLength-valid-restriction = minLength-valid-restriction: In der Definition von {2} muss minLength = ''{0}'' >= dem Wert des Basistyps ''{1}'' sein.
++ no-xmlns = no-xmlns: {name} einer Attributdeklaration darf nicht mit 'xmlns' \u00FCbereinstimmen.
++ no-xsi = no-xsi: '{'target namespace'}' einer Attributdeklaration darf nicht mit ''{0}'' \u00FCbereinstimmen.
++ p-props-correct.2.1 = p-props-correct.2.1: In der Deklaration von ''{0}'' ist der Wert von ''minOccurs'' ''{1}'', er darf aber nicht gr\u00F6\u00DFer als der Wert von ''maxOccurs'' sein, der ''{2}'' lautet.
+ rcase-MapAndSum.1 = rcase-MapAndSum.1: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
+ rcase-MapAndSum.2 = rcase-MapAndSum.2: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}).
+- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Elemente haben Namen und Ziel-Namespaces, die nicht identisch sind: Element "{0}" in Namespace "{1}" und Element "{2}" in Namespace "{3}".
+- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Fehler beim Partikel, dessen "{"term"}" die Elementdeklaration "{0}" ist. "{"nillable"}" ist bei der Elementdeklaration "true", aber das entsprechende Partikel im Basistyp hat eine Elementdeklaration, bei der "{"nillable"}" "false" ist.
+- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Fehler beim Partikel, dessen "{"term"}" die Elementdeklaration "{0}" ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp.
+- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: Element "{0}" ist nicht fest, aber das entsprechende Element im Basistyp ist fest mit Wert "{1}".
+- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: Element "{0}" ist fest mit dem Wert "{1}", aber das entsprechende Element im Basistyp ist fest mit Wert "{2}".
+- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Identity Constraints f\u00FCr Element "{0}" sind keine Teilmenge der Constraints in der Basis.
+- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: Die unzul\u00E4ssigen Substitutionen f\u00FCr Element "{0}" sind keine Obermenge der Substitutionen in der Basis.
+- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: Typ des Elements "{0}" "{1}" wurde nicht vom Typ des Basiselements "{2}" abgeleitet.
+- rcase-NSCompat.1 = rcase-NSCompat.1: Element "{0}" hat den Namespace "{1}". Dies wird vom Platzhalter in der Basis nicht zugelassen.
+- rcase-NSCompat.2 = rcase-NSCompat.2: Fehler beim Partikel, dessen "{"term"}" die Elementdeklaration "{0}" ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp.
++ rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Elemente haben Namen und Ziel-Namespaces, die nicht identisch sind: Element ''{0}'' in Namespace ''{1}'' und Element ''{2}'' in Namespace ''{3}''.
++ rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. '{'nillable'}' ist bei der Elementdeklaration ''true'', aber das entsprechende Partikel im Basistyp hat eine Elementdeklaration, bei der '{'nillable'}' ''false'' ist.
++ rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp.
++ rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: Element ''{0}'' ist nicht fest, aber das entsprechende Element im Basistyp ist fest mit Wert ''{1}''.
++ rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: Element ''{0}'' ist fest mit dem Wert ''{1}'', aber das entsprechende Element im Basistyp ist fest mit Wert ''{2}''.
++ rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Identity Constraints f\u00FCr Element ''{0}'' sind keine Teilmenge der Constraints in der Basis.
++ rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: Die unzul\u00E4ssigen Substitutionen f\u00FCr Element ''{0}'' sind keine Obermenge der Substitutionen in der Basis.
++ rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: Typ des Elements ''{0}'' ''{1}'' wurde nicht vom Typ des Basiselements ''{2}'' abgeleitet.
++ rcase-NSCompat.1 = rcase-NSCompat.1: Element ''{0}'' hat den Namespace ''{1}''. Dies wird vom Platzhalter in der Basis nicht zugelassen.
++ rcase-NSCompat.2 = rcase-NSCompat.2: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp.
+ rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
+ rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs des Basisplatzhalters ({2},{3}).
+ rcase-NSSubset.1 = rcase-NSSubset.1: Platzhalter ist keine Teilmenge des entsprechenden Platzhalters in der Basis.
+ rcase-NSSubset.2 = rcase-NSSubset.2: Vorkommensbereich des Platzhalters ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs in der Basis ({2},{3}).
+- rcase-NSSubset.3 = rcase-NSSubset.3: Prozesscontent des Platzhalters ("{0}") ist schw\u00E4cher als der in der Basis "{1}".
++ rcase-NSSubset.3 = rcase-NSSubset.3: Prozesscontent des Platzhalters (''{0}'') ist schw\u00E4cher als der in der Basis ''{1}''.
+ rcase-Recurse.1 = rcase-Recurse.1: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}).
+ rcase-Recurse.2 = rcase-Recurse.2: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
+ rcase-RecurseLax.1 = rcase-RecurseLax.1: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}).
+@@ -250,42 +250,42 @@
+ rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
+ # We're using sch-props-correct.2 instead of the old src-redefine.1
+ # src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
+- sch-props-correct.2 = sch-props-correct.2: Ein Schema kann nicht zwei globale Komponenten mit demselben Namen enthalten. Dieses Schema enth\u00E4lt zwei Vorkommen von "{0}".
+- st-props-correct.2 = st-props-correct.2: Zyklische Definitionen wurden f\u00FCr Simple Type "{0}" ermittelt. Dies bedeutet, dass "{0}" in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler.
+- st-props-correct.3 = st-props-correct.3: Fehler bei Typ "{0}". Der Wert von "{''final''}" der "{''base type definition''}" "{1}" l\u00E4sst keine Ableitung durch Einschr\u00E4nkung zu.
+- totalDigits-valid-restriction = totalDigits-valid-restriction: In der Definition von {2} ist der Wert "{0}" f\u00FCr Facet "totalDigits" ung\u00FCltig, da er <= dem Wert f\u00FCr "totalDigits" sein muss, der in einem der Vorg\u00E4ngertypen auf "{1}" gesetzt wurde.
+- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: In der Definition von {0} ist der Wert "{1}" f\u00FCr Facet "whitespace" ung\u00FCltig, da der Wert f\u00FCr "whitespace" in einem der Vorg\u00E4ngertypen auf "collapse" gesetzt wurde.
+- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: In der Definition von {0} ist der Wert "preserve" f\u00FCr Facet "whitespace" ung\u00FCltig, da der Wert f\u00FCr "whitespace" in einem der Vorg\u00E4ngertypen auf "replace" gesetzt wurde.
++ sch-props-correct.2 = sch-props-correct.2: Ein Schema kann nicht zwei globale Komponenten mit demselben Namen enthalten. Dieses Schema enth\u00E4lt zwei Vorkommen von ''{0}''.
++ st-props-correct.2 = st-props-correct.2: Zyklische Definitionen wurden f\u00FCr Simple Type ''{0}'' ermittelt. Dies bedeutet, dass ''{0}'' in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler.
++ st-props-correct.3 = st-props-correct.3: Fehler bei Typ ''{0}''. Der Wert von '{'final'}' der '{'base type definition'}' ''{1}'' l\u00E4sst keine Ableitung durch Einschr\u00E4nkung zu.
++ totalDigits-valid-restriction = totalDigits-valid-restriction: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''totalDigits'' ung\u00FCltig, da er <= dem Wert f\u00FCr ''totalDigits'' sein muss, der in einem der Vorg\u00E4ngertypen auf ''{1}'' gesetzt wurde.
++ whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: In der Definition von {0} ist der Wert ''{1}'' f\u00FCr Facet ''whitespace'' ung\u00FCltig, da der Wert f\u00FCr ''whitespace'' in einem der Vorg\u00E4ngertypen auf ''collapse'' gesetzt wurde.
++ whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: In der Definition von {0} ist der Wert ''preserve'' f\u00FCr Facet ''whitespace'' ung\u00FCltig, da der Wert f\u00FCr ''whitespace'' in einem der Vorg\u00E4ngertypen auf ''replace'' gesetzt wurde.
+
+ #schema for Schemas
+
+- s4s-att-invalid-value = s4s-att-invalid-value: Ung\u00FCltiger Attributwert f\u00FCr "{1}" in Element "{0}". Aufgezeichneter Grund: {2}
+- s4s-att-must-appear = s4s-att-must-appear: Attribut "{1}" muss in Element "{0}" vorkommen.
+- s4s-att-not-allowed = s4s-att-not-allowed: Attribut "{1}" darf nicht in Element "{0}" vorkommen.
+- s4s-elt-invalid = s4s-elt-invalid: Element "{0}" ist kein g\u00FCltiges Element in einem Schemadokument.
+- s4s-elt-must-match.1 = s4s-elt-must-match.1: Content von "{0}" muss {1} entsprechen. Beim Start bei {2} ist ein Problem aufgetreten.
+- s4s-elt-must-match.2 = s4s-elt-must-match.2: Content von "{0}" muss {1} entsprechen. Nicht gen\u00FCgend Elemente gefunden.
++ s4s-att-invalid-value = s4s-att-invalid-value: Ung\u00FCltiger Attributwert f\u00FCr ''{1}'' in Element ''{0}''. Aufgezeichneter Grund: {2}
++ s4s-att-must-appear = s4s-att-must-appear: Attribut ''{1}'' muss in Element ''{0}'' vorkommen.
++ s4s-att-not-allowed = s4s-att-not-allowed: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen.
++ s4s-elt-invalid = s4s-elt-invalid: Element ''{0}'' ist kein g\u00FCltiges Element in einem Schemadokument.
++ s4s-elt-must-match.1 = s4s-elt-must-match.1: Content von ''{0}'' muss {1} entsprechen. Beim Start bei {2} ist ein Problem aufgetreten.
++ s4s-elt-must-match.2 = s4s-elt-must-match.2: Content von ''{0}'' muss {1} entsprechen. Nicht gen\u00FCgend Elemente gefunden.
+ # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
+- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: Content von "{0}" ist ung\u00FCltig. Element "{1}" ist ung\u00FCltig, nicht an der erwarteten Stelle oder kommt zu oft vor.
+- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: Content von "{0}" ist ung\u00FCltig. Element "{1}" darf nicht leer sein.
+- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Elemente mit dem Typ "{0}" k\u00F6nnen nicht nach Deklarationen als untergeordnete Elemente eines <schema>-Elements vorkommen.
+- s4s-elt-schema-ns = s4s-elt-schema-ns: Namespace des Elements "{0}" muss aus dem Schema-Namespace "http://www.w3.org/2001/XMLSchema" stammen.
+- s4s-elt-character = s4s-elt-character: In anderen Schemaelementen als "xs:appinfo" und "xs:documentation" sind nur Leerstellen zul\u00E4ssig. "{0}" gefunden.
++ s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: Content von ''{0}'' ist ung\u00FCltig. Element ''{1}'' ist ung\u00FCltig, nicht an der erwarteten Stelle oder kommt zu oft vor.
++ s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: Content von ''{0}'' ist ung\u00FCltig. Element ''{1}'' darf nicht leer sein.
++ s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Elemente mit dem Typ ''{0}'' k\u00F6nnen nicht nach Deklarationen als untergeordnete Elemente eines <schema>-Elements vorkommen.
++ s4s-elt-schema-ns = s4s-elt-schema-ns: Namespace des Elements ''{0}'' muss aus dem Schema-Namespace ''http://www.w3.org/2001/XMLSchema'' stammen.
++ s4s-elt-character = s4s-elt-character: In anderen Schemaelementen als ''xs:appinfo'' und ''xs:documentation'' sind nur Leerstellen zul\u00E4ssig. ''{0}'' gefunden.
+
+ # codes not defined by the spec
+
+- c-fields-xpaths = c-fields-xpaths: Feldwert = "{0}" ist ung\u00FCltig.
+- c-general-xpath = c-general-xpath: Ausdruck "{0}" ist ung\u00FCltig in Bezug auf die vom XML-Schema unterst\u00FCtzte XPath-Teilmenge.
+- c-general-xpath-ns = c-general-xpath-ns: Namespace-Pr\u00E4fix in XPath-Ausdruck "{0}" war an einen Namespace gebunden.
+- c-selector-xpath = c-selector-xpath: Selector-Wert = "{0}" ist ung\u00FCltig. Selector-XPaths k\u00F6nnen keine Attribute enthalten.
+- EmptyTargetNamespace = EmptyTargetNamespace: In Schemadokument "{0}" kann der Wert des "targetNamespace"-Attributs keine leere Zeichenfolge sein.
+- FacetValueFromBase = FacetValueFromBase: In der Deklaration von Typ "{0}" muss der Wert "{1}" von Facet "{2}" aus dem Wertebereich des Basistyps "{3}" stammen.
+- FixedFacetValue = FixedFacetValue: In der Definition von {3} ist der Wert "{1}" f\u00FCr Facet "{0}" ung\u00FCltig, da der Wert f\u00FCr "{0}" in einem der Vorg\u00E4ngertypen auf "{2}" gesetzt wurde und "{''fixed''}" = "true" ist.
+- InvalidRegex = InvalidRegex: Musterwert "{0}" ist kein g\u00FCltiger regul\u00E4rer Ausdruck. Der gemeldete Fehler war: "{1}" bei Spalte "{2}".
++ c-fields-xpaths = c-fields-xpaths: Feldwert = ''{0}'' ist ung\u00FCltig.
++ c-general-xpath = c-general-xpath: Ausdruck ''{0}'' ist ung\u00FCltig in Bezug auf die vom XML-Schema unterst\u00FCtzte XPath-Teilmenge.
++ c-general-xpath-ns = c-general-xpath-ns: Namespace-Pr\u00E4fix in XPath-Ausdruck ''{0}'' war an einen Namespace gebunden.
++ c-selector-xpath = c-selector-xpath: Selector-Wert = ''{0}'' ist ung\u00FCltig. Selector-XPaths k\u00F6nnen keine Attribute enthalten.
++ EmptyTargetNamespace = EmptyTargetNamespace: In Schemadokument ''{0}'' kann der Wert des ''targetNamespace''-Attributs keine leere Zeichenfolge sein.
++ FacetValueFromBase = FacetValueFromBase: In der Deklaration von Typ ''{0}'' muss der Wert ''{1}'' von Facet ''{2}'' aus dem Wertebereich des Basistyps ''{3}'' stammen.
++ FixedFacetValue = FixedFacetValue: In der Definition von {3} ist der Wert ''{1}'' f\u00FCr Facet ''{0}'' ung\u00FCltig, da der Wert f\u00FCr ''{0}'' in einem der Vorg\u00E4ngertypen auf ''{2}'' gesetzt wurde und ''{''fixed'}''' = true ist.
++ InvalidRegex = InvalidRegex: Musterwert ''{0}'' ist kein g\u00FCltiger regul\u00E4rer Ausdruck. Der gemeldete Fehler war: ''{1}'' bei Spalte ''{2}''.
+ maxOccurLimit = Aktuelle Konfiguration des Parsers l\u00E4sst nicht zu, dass ein maxOccurs-Attributwert auf einen h\u00F6heren Wert als {0} gesetzt wird.
+- PublicSystemOnNotation = PublicSystemOnNotation: Mindestens eines der Elemente "public" und "system" muss im Element "notation" vorkommen.
+- SchemaLocation = SchemaLocation: schemaLocation-Wert = "{0}" muss eine gerade Anzahl an URIs haben.
+- TargetNamespace.1 = TargetNamespace.1: Namespace "{0}" wird erwartet, aber der Ziel-Namespace des Schemadokuments ist "{1}".
+- TargetNamespace.2 = TargetNamespace.2: Kein Namespace wird erwartet, aber das Schemadokument hat den Ziel-Namespace "{1}".
+- UndeclaredEntity = UndeclaredEntity: Entit\u00E4t "{0}" ist nicht deklariert.
+- UndeclaredPrefix = UndeclaredPrefix: "{0}" kann nicht als QName aufgel\u00F6st werden: Pr\u00E4fix "{1}" ist nicht deklariert.
++ PublicSystemOnNotation = PublicSystemOnNotation: Mindestens eines der Elemente 'public' und 'system' muss im Element 'notation' vorkommen.
++ SchemaLocation = SchemaLocation: schemaLocation-Wert = ''{0}'' muss eine gerade Anzahl an URIs haben.
++ TargetNamespace.1 = TargetNamespace.1: Namespace ''{0}'' wird erwartet, aber der Ziel-Namespace des Schemadokuments ist ''{1}''.
++ TargetNamespace.2 = TargetNamespace.2: Kein Namespace wird erwartet, aber das Schemadokument hat den Ziel-Namespace ''{1}''.
++ UndeclaredEntity = UndeclaredEntity: Entit\u00E4t ''{0}'' ist nicht deklariert.
++ UndeclaredPrefix = UndeclaredPrefix: ''{0}'' kann nicht als QName aufgel\u00F6st werden: Pr\u00E4fix ''{1}'' ist nicht deklariert.
+--- ./jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties Wed Jul 01 21:53:10 2015 -0700
+@@ -13,7 +13,7 @@
+ NoWriterSupplied = Det finns ingen skrivare f\u00F6r serializer.
+ MethodNotSupported = Metoden ''{0}'' st\u00F6ds inte i denna fabriksinst\u00E4llning.
+ ResetInMiddle = Serializer kan inte \u00E5terst\u00E4llas under p\u00E5g\u00E5ende serialisering.
+- Internal = Internt fel: elementstatus \u00E4r noll.
++ Internal = Internt fel: elementtillst\u00E5nd \u00E4r noll.
+ NoName = Det finns inget rawName och localName \u00E4r null.
+ ElementQName = Elementnamnet ''{0}'' \u00E4r inte n\u00E5got QName.
+ ElementPrefix = Elementet ''{0}'' tillh\u00F6r inte n\u00E5gon namnrymd: prefixet kanske inte har deklarerats eller \u00E4r bundet till annan namnrymd.
+--- ./jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java Wed Jul 01 21:53:10 2015 -0700
+@@ -1,7 +1,7 @@
+ /*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+--- ./jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java Wed Jul 01 21:53:10 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 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
+--- ./jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java Wed Jul 01 21:53:10 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 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
+--- ./jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java Wed Jul 01 21:53:10 2015 -0700
+@@ -2116,7 +2116,7 @@
+ */
+ @Override
+ public String getTextContent() throws DOMException {
+- return getNodeValue(); // overriden in some subclasses
++ return dtm.getStringValue(node).toString();
+ }
+
+ /**
+--- ./jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java Wed Jul 01 21:53:10 2015 -0700
+@@ -3145,11 +3145,7 @@
+ m_data.elementAt(-dataIndex+1));
+ }
+ }
+- else if (DTM.ELEMENT_NODE == type)
+- {
+- return getStringValueX(nodeHandle);
+- }
+- else if (DTM.DOCUMENT_FRAGMENT_NODE == type
++ else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type
+ || DTM.DOCUMENT_NODE == type)
+ {
+ return null;
+--- ./jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java Wed Jul 01 21:53:10 2015 -0700
+@@ -3,7 +3,7 @@
+ * DO NOT REMOVE OR ALTER!
+ */
+ /*
+- * Copyright 1999-2004 The Apache Software Foundation.
++ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+--- ./jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java Wed Jul 01 21:53:10 2015 -0700
+@@ -3,7 +3,7 @@
+ * DO NOT REMOVE OR ALTER!
+ */
+ /*
+- * Copyright 1999-2004 The Apache Software Foundation.
++ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+--- ./jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java Mon Jun 01 11:41:52 2015 -0700
++++ ./jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java Wed Jul 01 21:53:10 2015 -0700
+@@ -3,7 +3,7 @@
+ * DO NOT REMOVE OR ALTER!
+ */
+ /*
+- * Copyright 1999-2004 The Apache Software Foundation.
++ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+--- ./jaxws/.hgtags Mon Jun 01 11:42:03 2015 -0700
++++ ./jaxws/.hgtags Wed Jul 01 21:53:18 2015 -0700
+@@ -352,7 +352,6 @@
+ 9d0c737694ece23547c0a27dcd0ba6cbcdf577f2 jdk8u31-b13
+ 49e91817cbe1b14f856c26f6e55b7151e3f8c3a8 jdk8u31-b31
+ 9e20c5acb448c5f9b05a4e9b4efc222b3b616c23 jdk8u31-b32
+-ea23d583e36301301612946d34ff6aa90d795dd9 jdk8u31-b33
+ 31d43d250c836c13fcc87025837783788c5cd0de jdk8u40-b00
+ 262fb5353ffa661f88b4a9cf2581fcad8c2a43f7 jdk8u40-b01
+ 8043f77ef8a4ded9505269a356c4e2f4f9604cd9 jdk8u40-b02
+@@ -381,8 +380,6 @@
+ b6120aaf2aeef7c5608d578e15e82db7eb24fb2e jdk8u40-b25
+ 1bcb30bdd9883cc7fc1bf70800ea03a4429eaa80 jdk8u40-b26
+ a5f2cdedb940511674e153dce8d3cbc3a0598c9e jdk8u40-b27
+-a342e6841e8d3bbef44d4158c980be2ab903e10a jdk8u40-b31
+-8960bce00f1abecad665291b0077d6e673c0ff64 jdk8u40-b32
+ 667a4aee3720373f5c286a50f537afd0ff4b65ae jdk8u45-b00
+ cb6added4913f4899bd1689e77be1fe4efcff4f1 jdk8u45-b01
+ 855a7b9302053546e4da94b67cc3b8956f5b4985 jdk8u45-b02
+@@ -398,22 +395,26 @@
+ 3f6c3f48179ac8bab98509be8708edcea32727b6 jdk8u45-b12
+ 15fb2359f5f86dbacc1bc120f663853b5292cd14 jdk8u45-b13
+ bad02ac45d59b5096032cf42bb880dcddffa84b4 jdk8u45-b14
+-cc7d796b8f12cc11d415f8ae0ef2d952274fc069 jdk8u45-b15
+-8a7494ab96913de396a8f38dd324ac52c44b1a80 jdk8u45-b31
+-1c022144b99b859336914740e571c672e51ee1b9 jdk8u45-b32
+-74aae7549ef8c6e9f394b75c840bf293e2664858 jdk8u51-b00
+-78d8cafb17e46dd2453704f679ca1e431e4df0ba jdk8u51-b01
+-9bd6f57d97e5423d5f25774b095124cbe1eeb9c1 jdk8u51-b02
+-a9ed1bcefec1ee0d30ea8cf700cf0813d8588eb0 jdk8u51-b03
+-3d07c26d5012f47ef274043a6204db686769d65d jdk8u51-b04
+-834da1120e80f17356475a5d3f06a678355dbbf6 jdk8u51-b05
+-243ba3774d18cfe2e56fa0e0474255787c360d07 jdk8u51-b06
+-13d1721eae3bdea08dcd7b84e0856e6769caafc9 jdk8u51-b07
+-cbba234a2b481b236e2bf78c892111b86f6bba81 jdk8u51-b08
+-9116c6bb2ffa6bb624ad39f7a98b7b9bed4512dc jdk8u51-b09
+-783b917616ab6977f9b3157667d1493636ba66d1 jdk8u51-b10
+-5a69995912aae8bd61758e95a3b5edac167b6acc jdk8u51-b11
+-1a855f69de645c4bd485d5fb6d9a524994278a16 jdk8u51-b12
+-880b67345f557d5613071d09c1cf234a7e1b8759 jdk8u51-b13
+-4a6824c3fd8d74f83daac1a79952786837a9848c jdk8u51-b14
+-dde8e5b2366b9a08d7448c3cef2cabc710cc9da5 jdk8u51-b15
++c8b402c28fe51e25f3298e1266f2ae48bda8d3e0 jdk8u60-b00
++7a0dacd12a9e42f581c11edeb51a69af9a8ab16d jdk8u60-b01
++5eb3236cc4a7075baf80fc8a258a1f9612e52cf0 jdk8u60-b02
++3e52068e8b9df8a9bb7a0594fab7f4132817ac3d jdk8u60-b03
++02b1d3c68132b14a36e5d1df9b4a53c7981469b4 jdk8u60-b04
++4dfd5dbd3014db59f92d54cf215f7e7ed4508044 jdk8u60-b05
++a22a9460d53fb519b00e118c98ee0cb5e981b659 jdk8u60-b06
++6f0885023e43fe44cade86e3dd77350d9ecbc4b4 jdk8u60-b07
++078fde829e878595fcd9122a52ea5cfafe6685a8 jdk8u60-b08
++fbb7b2d1321fdb7345e163bbc8c01a307f9d9d38 jdk8u60-b09
++3e7a28ca602befafcd6329a60c00e5b36c4e69c6 jdk8u60-b10
++334320b978e06d309d9a9ec67097f982128fad91 jdk8u60-b11
++fab06c192b0b246656e47aacab2fb555e3ca2cb7 jdk8u60-b12
++4390fe716719a6966e10bf9cce4b8752f9cf5d96 jdk8u60-b13
++feb70717506da80f712f0b942d77527d2cc4cde5 jdk8u60-b14
++8c0018c9c533126cf3f7e912936f6e227bd1e96c jdk8u60-b15
++1c9eb173022b4b95ef6c93685b62b3039ccf8d92 jdk8u60-b16
++d6a80a0a3e9aca2b40f80709c9ce6c471b8902cf jdk8u60-b17
++53361b1cead8fc5ab1619a0b3baec8d4b411319d jdk8u60-b18
++5b422975b71def8c5a16a4f303c8fb8b108dc0cf jdk8u60-b19
++1a4b2888aa98ea70aad849e35e05b48e1c107503 jdk8u60-b20
++a414aec2d19cf692310587518546842070b80cb8 jdk8u60-b21
++6079c26a3b8fa1ead3d26a9de6ade2af71f1fb94 jdk8u60-b22
+--- ./jaxws/THIRD_PARTY_README Mon Jun 01 11:42:03 2015 -0700
++++ ./jaxws/THIRD_PARTY_README Wed Jul 01 21:53:18 2015 -0700
+@@ -1140,37 +1140,6 @@
+
+ --------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to JSON, which may be included
+-with JRE 8 & JDK 8.
+-
+---- begin of LICENSE ---
+-
+-Copyright (c) 2002 JSON.org
+-
+-Permission is hereby granted, free of charge, to any person obtaining a copy
+-of this software and associated documentation files (the "Software"), to deal
+-in the Software without restriction, including without limitation the rights
+-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-copies of the Software, and to permit persons to whom the Software is
+-furnished to do so, subject to the following conditions:
+-
+-The above copyright notice and this permission notice shall be included in all
+-copies or substantial portions of the Software.
+-
+-The Software shall be used for Good, not Evil.
+-
+-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-SOFTWARE.
+-
+---- end of LICENSE ---
+-
+--------------------------------------------------------------------------------
+-
+ %% This notice is provided with respect to Kerberos functionality, which
+ which may be included with JRE 8, JDK 8, and OpenJDK 8.
+
+@@ -1250,7 +1219,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libpng 1.6.16, which may be
++%% This notice is provided with respect to libpng 1.6.16, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1370,7 +1339,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libungif 4.1.3, which may be
++%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1399,13 +1368,13 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to Little CMS 2.5, which may be
++%% This notice is provided with respect to Little CMS 2.7, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+
+ Little CMS
+-Copyright (c) 1998-2011 Marti Maria Saguer
++Copyright (c) 1998-2015 Marti Maria Saguer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+--- ./jdk/.hgtags Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/.hgtags Wed Jul 01 21:53:30 2015 -0700
+@@ -353,11 +353,9 @@
+ a21dd7999d1e4ba612c951c2c78504d23eb7243a jdk8u31-b11
+ 6a12f34816d2ee12368274fc21225384a8893426 jdk8u31-b12
+ 1fbdd5d80d0671decd8acb5adb64866f609e986f jdk8u31-b13
++ced84cf3eebc69f7e04b0098d85dcb3a6b872586 jdk8u31-b31
+ 367c7f061c5831ee54cd197f727e06109a67875b jdk8u31-b14
+ 287e3219f3f531b2f20b50b180802a563a782b26 jdk8u31-b15
+-ced84cf3eebc69f7e04b0098d85dcb3a6b872586 jdk8u31-b31
+-46338075c4262057099e57638e0758817052da0d jdk8u31-b32
+-a1c3099e1b90230435e890ca56adc8a5aa5149ff jdk8u31-b33
+ e6ed015afbbf3459ba3297e270b4f3170e989c80 jdk8u40-b00
+ 6e223d48080ef40f4ec11ecbcd19b4a20813b9eb jdk8u40-b01
+ 4797cd0713b44b009525f1276d571ade7e24f3f5 jdk8u40-b02
+@@ -386,8 +384,6 @@
+ f0d5cb59b0e6a67fa102465458cc4725c6e59089 jdk8u40-b25
+ 97f258823d7d8ee0ec7d774b79cd30492520cc10 jdk8u40-b26
+ d4453d784fb6c52e4ed998b167588551e2fd43c5 jdk8u40-b27
+-5a45234e0fc14ff943e13dc1f8966818acaeb4de jdk8u40-b31
+-d8ac13c5eafe422d3425dc1aebebfcdf8ca67e2d jdk8u40-b32
+ 1ecc234bd38950a2bc047aa253a5e803f0836a4e jdk8u45-b00
+ e0c7864bbca3f76cde680722f2ae58dff2bff61d jdk8u45-b01
+ 9505c0392cddbfb905401e9fccc23262edc3254f jdk8u45-b02
+@@ -403,22 +399,26 @@
+ 6a8f9512afa687632f0a0d881bbdb446d984a74c jdk8u45-b12
+ 55a75b0db87693e1e186752f553c337cb035a38e jdk8u45-b13
+ 20e6cadfac43717a81d99daff5e769de695992cd jdk8u45-b14
+-7087623dfa7033f8738d537864e4bac6b8528172 jdk8u45-b15
+-c7fbbf6133c339fb56f03241de28666774023d5d jdk8u45-b31
+-ea547c5a1217fe7916f366950d0e3156e4225aa5 jdk8u45-b32
+-ac97b69b88e37c18c1b077be8b1f100b6803fea5 jdk8u51-b00
+-2e0732282470f7a02d57af5fc8542efa9db7b3e4 jdk8u51-b01
+-cc75137936f9a8e97017e7e18b1064b76238116f jdk8u51-b02
+-f732971e3d20664164a3797cf0b1a4cb80470959 jdk8u51-b03
+-6d6c0c93e822dc0e37d657060488de934ac2eb4c jdk8u51-b04
+-7d9a58baae72804f0852890cf9fc75e6a759b608 jdk8u51-b05
+-93e6b2bbc9ff46b3fea1fe89b810259d150a9fc4 jdk8u51-b06
+-286b9a885fcc6245fdf2b20697473ec3b35f2538 jdk8u51-b07
+-f7da0b943b9381aaf378d0c7b337dd7654335293 jdk8u51-b08
+-7e8459e7a45cb5b49de376893e3a95bfa92d0325 jdk8u51-b09
+-dcc75a75d3a30270fbf52d0d0b0504319882e419 jdk8u51-b10
+-3ed614d4eee7c3225d48ed7c90622dd888cd143e jdk8u51-b11
+-0010682d9a2b81daf7c08239161f7c2a91977299 jdk8u51-b12
+-217fa7205549d196c60f814bf3fc9795d756f493 jdk8u51-b13
+-b7403e15864dc0c1f9740d66af91bddb3e2215e8 jdk8u51-b14
+-192bda44c0c463104c96058bb815a546b282ca43 jdk8u51-b15
++5c31204d19e5976f025026db3d5c17331e8c44db jdk8u60-b00
++c46daef6edb5385d11876ed40f292a4b62e96867 jdk8u60-b01
++c10fd784956cc7099657181029ac3e790267b678 jdk8u60-b02
++87c95759b92b9c2933e439f0f7e4897635af16e0 jdk8u60-b03
++81e87652146b74c4ffeb1862e3e0eb3ace2374e4 jdk8u60-b04
++433942aab113e7eeecbe086b346219536738b0b6 jdk8u60-b05
++3a8ecea921f65bc1aef108b657c718348e152b9a jdk8u60-b06
++e48ca20d8943854c878e3b8d86d6d5387b047996 jdk8u60-b07
++478602cc17e212571cd0bec8979d5adc6d5c456e jdk8u60-b08
++fc3f69854e7d28416168eee07859c06fe90fa6f5 jdk8u60-b09
++ae448eca6b545670656c505bdc830b6dabaf1be3 jdk8u60-b10
++bdcb84f205482c7aea48a1403e843f5fd689d849 jdk8u60-b11
++87d4b7551d321c473d97afd75c1b71f6cedda4e2 jdk8u60-b12
++4e2206aa336c312ee180421387b7a6e7cdd0a3ca jdk8u60-b13
++3ad03712ea43feb5d4cd8cb216e6d295d09b8457 jdk8u60-b14
++a006fa0a9e8f18dee6daf8984bd11625c4c4860c jdk8u60-b15
++6ed3821c212a93ffc6bfcc292ef7aca3b7165139 jdk8u60-b16
++c30db4c968f63dce1bf2f9df240fb75a8f27f922 jdk8u60-b17
++57336c319de8a141d0bcd04265ce36734fb51380 jdk8u60-b18
++b2c55ff77112321472ec97c3a6931a999837d183 jdk8u60-b19
++cc6c74b164dfd0636d9dba8f9865baa18a6f2338 jdk8u60-b20
++63c9cedeeb9d0de656969f3deed7ddafae11754a jdk8u60-b21
++e9f82302d5fdef8a0976640e09363895e9dcde3c jdk8u60-b22
+--- ./jdk/THIRD_PARTY_README Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/THIRD_PARTY_README Wed Jul 01 21:53:30 2015 -0700
+@@ -1140,37 +1140,6 @@
+
+ --------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to JSON, which may be included
+-with JRE 8 & JDK 8.
+-
+---- begin of LICENSE ---
+-
+-Copyright (c) 2002 JSON.org
+-
+-Permission is hereby granted, free of charge, to any person obtaining a copy
+-of this software and associated documentation files (the "Software"), to deal
+-in the Software without restriction, including without limitation the rights
+-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-copies of the Software, and to permit persons to whom the Software is
+-furnished to do so, subject to the following conditions:
+-
+-The above copyright notice and this permission notice shall be included in all
+-copies or substantial portions of the Software.
+-
+-The Software shall be used for Good, not Evil.
+-
+-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-SOFTWARE.
+-
+---- end of LICENSE ---
+-
+--------------------------------------------------------------------------------
+-
+ %% This notice is provided with respect to Kerberos functionality, which
+ which may be included with JRE 8, JDK 8, and OpenJDK 8.
+
+@@ -1250,7 +1219,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libpng 1.6.16, which may be
++%% This notice is provided with respect to libpng 1.6.16, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1370,7 +1339,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libungif 4.1.3, which may be
++%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1399,13 +1368,13 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to Little CMS 2.5, which may be
++%% This notice is provided with respect to Little CMS 2.7, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+
+ Little CMS
+-Copyright (c) 1998-2011 Marti Maria Saguer
++Copyright (c) 1998-2015 Marti Maria Saguer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+--- ./jdk/make/CompileJavaClasses.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/CompileJavaClasses.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -64,17 +64,15 @@
+ # This gets built on unix platforms implicitly in the old build even though
+ # it's excluded in the closed build.
+ EXCLUDES += sun/java2d/pisces
++ endif
++endif
+
++ifeq ($(OPENJDK_TARGET_OS), windows)
+ # AccessBridge is compiled separately below.
+ EXFILES += AccessBridge.java \
+- AccessBridgeLoader.java \
+- com/sun/java/accessibility/util/java/awt/ChoiceTranslator.java
+- # This seems to never be built
+- EXCLUDES += com/sun/java/accessibility/extensions
++ AccessBridgeLoader.java
+ endif
+
+-endif
+-
+ ifneq ($(OPENJDK_TARGET_OS), solaris)
+ # Exclude Solaris nio and two security related files in src/share/classes
+ EXFILES += SolarisAclFileAttributeView.java \
+@@ -272,7 +270,7 @@
+
+ ifndef OPENJDK
+ CLOSED_SRC_DIRS := $(JDK_TOPDIR)/src/closed/share/classes \
+- $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
++ $(wildcard $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes)
+ endif
+
+ MACOSX_SRC_DIRS :=
+@@ -379,7 +377,6 @@
+
+ ##########################################################################################
+
+-ifndef OPENJDK
+ ifeq ($(OPENJDK_TARGET_OS), windows)
+ ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+ $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32, \
+@@ -387,7 +384,7 @@
+ JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
+ SRC := $(JDK_OUTPUTDIR)/gensrc_ab/32bit, \
+ BIN := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
+- HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
++ HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/32))
+
+ $(BUILD_ACCESSBRIDGE_32): $(BUILD_JDK)
+
+@@ -396,7 +393,7 @@
+ JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
+ SRC := $(JDK_OUTPUTDIR)/gensrc_ab/legacy, \
+ BIN := $(JDK_OUTPUTDIR)/classes_ab/legacy, \
+- HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
++ HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/legacy))
+
+ $(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
+
+@@ -407,13 +404,12 @@
+ JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
+ SRC := $(JDK_OUTPUTDIR)/gensrc_ab/64bit, \
+ BIN := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
+- HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
++ HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/64))
+
+ $(BUILD_ACCESSBRIDGE_64): $(BUILD_JDK)
+
+ endif
+ endif
+-endif
+
+ ##########################################################################################
+
+--- ./jdk/make/CompileLaunchers.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/CompileLaunchers.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -659,11 +659,10 @@
+ ##########################################################################################
+ # jabswitch
+
+-ifndef OPENJDK
+ ifeq ($(OPENJDK_TARGET_OS), windows)
+
+ $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH, \
+- SRC := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge, \
++ SRC := $(JDK_TOPDIR)/src/windows/native/sun/bridge, \
+ INCLUDE_FILES := jabswitch.cpp, \
+ LANG := C++, \
+ CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
+@@ -675,17 +674,16 @@
+ OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
+ PROGRAM := jabswitch, \
+ DEBUG_SYMBOLS := true, \
+- VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
++ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
+ RC_FLAGS := $(RC_FLAGS) \
+ -D "JDK_FNAME=jabswitch.exe" \
+ -D "JDK_INTERNAL_NAME=jabswitch" \
+ -D "JDK_FTYPE=0x01L", \
+- MANIFEST := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
++ MANIFEST := $(JDK_TOPDIR)/src/windows/native/sun/bridge/jabswitch.manifest))
+
+ BUILD_LAUNCHERS += $(BUILD_JABSWITCH)
+
+ endif
+-endif
+
+ ##########################################################################################
+
+--- ./jdk/make/CopyFiles.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/CopyFiles.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -55,7 +55,6 @@
+
+ ##########################################################################################
+
+-ifndef OPENJDK
+ ifeq ($(OPENJDK_TARGET_OS), windows)
+ COPY_FILES += $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCallbacks.h \
+ $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.h \
+@@ -64,14 +63,12 @@
+ $(JDK_OUTPUTDIR)/lib/accessibility.properties
+
+ $(OPENJDK_TARGET_OS_INCLUDE)/bridge/%: \
+- $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/%
++ $(JDK_TOPDIR)/src/windows/native/sun/bridge/%
+ $(install-file)
+
+ $(JDK_OUTPUTDIR)/lib/accessibility.properties: \
+- $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/accessibility.properties
++ $(JDK_TOPDIR)/src/windows/native/sun/bridge/accessibility.properties
+ $(install-file)
+-
+- endif
+ endif
+
+ ##########################################################################################
+@@ -285,7 +282,10 @@
+ ifeq ($(OPENJDK_TARGET_OS), macosx)
+ JVMCFG_SRC := $(JDK_TOPDIR)/src/macosx/bin/$(JVMCFG_ARCH)/jvm.cfg
+ else
+- JVMCFG_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(JVMCFG_ARCH)/jvm.cfg
++ JVMCFG_BASE := $(OPENJDK_TARGET_OS_API_DIR)/bin/$(JVMCFG_ARCH)/jvm.cfg
++ ALT_JVMCFG_SRC := $(JDK_TOPDIR)/src/closed/$(JVMCFG_BASE)
++ # Use the ALT file if it exists
++ JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JDK_TOPDIR)/src/$(JVMCFG_BASE))
+ endif
+ JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
+ JVMCFG := $(JVMCFG_DIR)/jvm.cfg
+--- ./jdk/make/CreateJars.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/CreateJars.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -267,10 +267,12 @@
+ $(RM) $@ $@.tmp
+ $(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
+ ifneq ($(PROFILE), )
+- # # Add back classes from excluded packages (fixing the $ substitution in the process)
+- for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
+- $(ECHO) $$type >> $@.tmp ; \
+- done
++ ifneq ($(strip $(RT_JAR_INCLUDE_TYPES)), )
++ # Add back classes from excluded packages (fixing the $ substitution in the process)
++ for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
++ $(ECHO) $$type >> $@.tmp ; \
++ done
++ endif
+ endif
+ $(MV) $@.tmp $@
+
+@@ -281,14 +283,14 @@
+ -e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
+ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
+ ifneq ($(PROFILE), )
+- # # Strip out all META-INF/services/ entries
++ # Strip out all META-INF/services/ entries
+ $(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
+- # # Add back the required services
+- # # FIXME: On Solaris if PROFILE_INCLUDE_METAINF_SERVICES is not defined
+- # # we get a syntax error from sh. That doesn't happen on linux
+- for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
+- $(ECHO) $$service >> $@.tmp2; \
+- done
++ ifneq ($(strip $(PROFILE_INCLUDE_METAINF_SERVICES)), )
++ # Add back the required services
++ for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
++ $(ECHO) $$service >> $@.tmp2; \
++ done
++ endif
+ $(MV) $@.tmp2 $@.tmp
+ endif
+ $(MV) $@.tmp $@
+@@ -309,6 +311,15 @@
+ $(MKDIR) -p $(@D)
+ $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
+
++# Code these targets explicitly because the target "%" expansion does
++# not work with the inline "$" in the file name.
++$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Packer.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Packer.class
++ $(MKDIR) -p $(@D)
++ $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
++$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Unpacker.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Unpacker.class
++ $(MKDIR) -p $(@D)
++ $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
++
+ CLASSES_TO_DEBEAN = \
+ java/util/logging/LogManager.class \
+ java/util/jar/Pack200\$$Packer.class \
+@@ -639,18 +650,8 @@
+
+ ##########################################################################################
+
+-ifndef OPENJDK
+- ifeq ($(OPENJDK_TARGET_OS), windows)
+-
+- $(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
+- SRCS := $(JDK_OUTPUTDIR)/classes, \
+- INCLUDES := com/sun/java/accessibility/util, \
+- JAR := $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar, \
+- SKIP_METAINF := true))
+-
+- JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
+-
+- ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
++ifeq ($(OPENJDK_TARGET_OS), windows)
++ ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+ $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_32_JAR, , \
+ SRCS := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
+ INCLUDES := com/sun/java/accessibility, \
+@@ -665,7 +666,7 @@
+
+ JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar \
+ $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar
+- else
++ else
+ $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_64_JAR, , \
+ SRCS := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
+ INCLUDES := com/sun/java/accessibility, \
+@@ -673,10 +674,17 @@
+ SKIP_METAINF := true))
+
+ JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
+- endif
+ endif
+ endif
+
++$(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
++ SRCS := $(JDK_OUTPUTDIR)/classes, \
++ INCLUDES := com/sun/java/accessibility/util, \
++ JAR := $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar, \
++ SKIP_METAINF := true))
++
++JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
++
+ ##########################################################################################
+
+ #
+--- ./jdk/make/Images.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/Images.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2011, 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
+@@ -161,11 +161,13 @@
+
+ ifeq ($(OPENJDK_TARGET_OS), windows)
+ JDK_BIN_LIST := $(filter $(addprefix %, $(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
+- # On windows x86, the server jvm is filtered out from the j2re image. This could possibly
+- # be handled by profiles in the future. If no client jvm is built, leave server in.
++ # On windows x86, the server jvm is filtered out from the j2re image. This is historical
++ # and is not applied to compact profiles. If no client jvm is built, leave server in.
+ ifeq ($(OPENJDK_TARGET_CPU), x86)
+ ifeq ($(JVM_VARIANT_CLIENT), true)
+- JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
++ ifeq ($(PROFILE), )
++ JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
++ endif
+ endif
+ endif
+ else
+--- ./jdk/make/Import.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/Import.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++# 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
+@@ -116,6 +116,12 @@
+ #
+ HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
+ Xusage.txt sa-jdi.jar
++
++ifeq ($(OPENJDK_TARGET_OS), macosx)
++ # additional debug file
++ HOTSPOT_IMPORT_FILES += Info.plist
++endif
++
+ $(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $(HOTSPOT_IMPORT_FILES)))
+ $(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
+
+--- ./jdk/make/Profiles.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/Profiles.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -47,7 +47,6 @@
+ # Note that some jars may be optional depending on the type of build (jdk vs.
+ # openjdk) and the platform.
+ #
+-# WARNING: incoming lists are currently validated for linux only!
+ ###############################################################################
+
+ # These are jar files for which the contents vary depending on the profile
+--- ./jdk/make/Tools.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/Tools.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -124,11 +124,11 @@
+ build.tools.cldrconverter.CLDRConverter
+
+ TOOL_REMOVEMETHODS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
+- -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
++ -cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
+ build.tools.classfile.RemoveMethods
+
+ TOOL_CHECKDEPS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
+- -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
++ -cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
+ build.tools.deps.CheckDeps
+
+ TOOL_ADDTORESTRICTEDPKGS=$(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/make/data/charsetmapping/IBM1166.c2b Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1 @@
++0x15 U+0085
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/make/data/charsetmapping/IBM1166.map Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,256 @@
++0x00 U+0000
++0x01 U+0001
++0x02 U+0002
++0x03 U+0003
++0x04 U+009c
++0x05 U+0009
++0x06 U+0086
++0x07 U+007f
++0x08 U+0097
++0x09 U+008d
++0x0a U+008e
++0x0b U+000b
++0x0c U+000c
++0x0d U+000d
++0x0e U+000e
++0x0f U+000f
++0x10 U+0010
++0x11 U+0011
++0x12 U+0012
++0x13 U+0013
++0x14 U+009d
++0x15 U+000a
++0x16 U+0008
++0x17 U+0087
++0x18 U+0018
++0x19 U+0019
++0x1a U+0092
++0x1b U+008f
++0x1c U+001c
++0x1d U+001d
++0x1e U+001e
++0x1f U+001f
++0x20 U+0080
++0x21 U+0081
++0x22 U+0082
++0x23 U+0083
++0x24 U+0084
++0x25 U+000a
++0x26 U+0017
++0x27 U+001b
++0x28 U+0088
++0x29 U+0089
++0x2a U+008a
++0x2b U+008b
++0x2c U+008c
++0x2d U+0005
++0x2e U+0006
++0x2f U+0007
++0x30 U+0090
++0x31 U+0091
++0x32 U+0016
++0x33 U+0093
++0x34 U+0094
++0x35 U+0095
++0x36 U+0096
++0x37 U+0004
++0x38 U+0098
++0x39 U+0099
++0x3a U+009a
++0x3b U+009b
++0x3c U+0014
++0x3d U+0015
++0x3e U+009e
++0x3f U+001a
++0x40 U+0020
++0x41 U+00a0
++0x42 U+04d9
++0x43 U+0493
++0x44 U+0451
++0x45 U+0454
++0x46 U+0455
++0x47 U+0456
++0x48 U+049b
++0x49 U+0458
++0x4a U+005b
++0x4b U+002e
++0x4c U+003c
++0x4d U+0028
++0x4e U+002b
++0x4f U+0021
++0x50 U+0026
++0x51 U+04a3
++0x52 U+04e9
++0x53 U+04b1
++0x54 U+04af
++0x55 U+045e
++0x56 U+04bb
++0x57 U+042a
++0x58 U+2116
++0x59 U+04d8
++0x5a U+005d
++0x5b U+0024
++0x5c U+002a
++0x5d U+0029
++0x5e U+003b
++0x5f U+005e
++0x60 U+002d
++0x61 U+002f
++0x62 U+0492
++0x63 U+0401
++0x64 U+0404
++0x65 U+0405
++0x66 U+0406
++0x67 U+049a
++0x68 U+0408
++0x69 U+04a2
++0x6a U+007c
++0x6b U+002c
++0x6c U+0025
++0x6d U+005f
++0x6e U+003e
++0x6f U+003f
++0x70 U+04e8
++0x71 U+04b0
++0x72 U+04ae
++0x73 U+00ad
++0x74 U+040e
++0x75 U+04ba
++0x76 U+044e
++0x77 U+0430
++0x78 U+0431
++0x79 U+0060
++0x7a U+003a
++0x7b U+0023
++0x7c U+0040
++0x7d U+0027
++0x7e U+003d
++0x7f U+0022
++0x80 U+0446
++0x81 U+0061
++0x82 U+0062
++0x83 U+0063
++0x84 U+0064
++0x85 U+0065
++0x86 U+0066
++0x87 U+0067
++0x88 U+0068
++0x89 U+0069
++0x8a U+0434
++0x8b U+0435
++0x8c U+0444
++0x8d U+0433
++0x8e U+0445
++0x8f U+0438
++0x90 U+0439
++0x91 U+006a
++0x92 U+006b
++0x93 U+006c
++0x94 U+006d
++0x95 U+006e
++0x96 U+006f
++0x97 U+0070
++0x98 U+0071
++0x99 U+0072
++0x9a U+043a
++0x9b U+043b
++0x9c U+043c
++0x9d U+043d
++0x9e U+043e
++0x9f U+043f
++0xa0 U+044f
++0xa1 U+007e
++0xa2 U+0073
++0xa3 U+0074
++0xa4 U+0075
++0xa5 U+0076
++0xa6 U+0077
++0xa7 U+0078
++0xa8 U+0079
++0xa9 U+007a
++0xaa U+0440
++0xab U+0441
++0xac U+0442
++0xad U+0443
++0xae U+0436
++0xaf U+0432
++0xb0 U+044c
++0xb1 U+044b
++0xb2 U+0437
++0xb3 U+0448
++0xb4 U+044d
++0xb5 U+0449
++0xb6 U+0447
++0xb7 U+044a
++0xb8 U+042e
++0xb9 U+0410
++0xba U+0411
++0xbb U+0426
++0xbc U+0414
++0xbd U+0415
++0xbe U+0424
++0xbf U+0413
++0xc0 U+007b
++0xc1 U+0041
++0xc2 U+0042
++0xc3 U+0043
++0xc4 U+0044
++0xc5 U+0045
++0xc6 U+0046
++0xc7 U+0047
++0xc8 U+0048
++0xc9 U+0049
++0xca U+0425
++0xcb U+0418
++0xcc U+0419
++0xcd U+041a
++0xce U+041b
++0xcf U+041c
++0xd0 U+007d
++0xd1 U+004a
++0xd2 U+004b
++0xd3 U+004c
++0xd4 U+004d
++0xd5 U+004e
++0xd6 U+004f
++0xd7 U+0050
++0xd8 U+0051
++0xd9 U+0052
++0xda U+041d
++0xdb U+041e
++0xdc U+041f
++0xdd U+042f
++0xde U+0420
++0xdf U+0421
++0xe0 U+005c
++0xe1 U+20ac
++0xe2 U+0053
++0xe3 U+0054
++0xe4 U+0055
++0xe5 U+0056
++0xe6 U+0057
++0xe7 U+0058
++0xe8 U+0059
++0xe9 U+005a
++0xea U+0422
++0xeb U+0423
++0xec U+0416
++0xed U+0412
++0xee U+042c
++0xef U+042b
++0xf0 U+0030
++0xf1 U+0031
++0xf2 U+0032
++0xf3 U+0033
++0xf4 U+0034
++0xf5 U+0035
++0xf6 U+0036
++0xf7 U+0037
++0xf8 U+0038
++0xf9 U+0039
++0xfa U+0417
++0xfb U+0428
++0xfc U+042d
++0xfd U+0429
++0xfe U+0427
++0xff U+009f
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/make/data/charsetmapping/IBM1166.nr Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1 @@
++0x25 U+000a
+--- ./jdk/make/data/charsetmapping/extsbcs Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/data/charsetmapping/extsbcs Wed Jul 01 21:53:30 2015 -0700
+@@ -22,6 +22,7 @@
+ IBM1147 IBM01147 Cp1147 false sun.nio.cs.ext
+ IBM1148 IBM01148 Cp1148 false sun.nio.cs.ext
+ IBM1149 IBM01149 Cp1149 false sun.nio.cs.ext
++IBM1166 x-IBM1166 Cp1166 false sun.nio.cs.ext
+ IBM273 IBM273 Cp273 false sun.nio.cs.ext
+ IBM277 IBM277 Cp277 false sun.nio.cs.ext
+ IBM278 IBM278 Cp278 false sun.nio.cs.ext
+--- ./jdk/make/data/tzdata/VERSION Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/data/tzdata/VERSION Wed Jul 01 21:53:30 2015 -0700
+@@ -21,4 +21,4 @@
+ # or visit www.oracle.com if you need additional information or have any
+ # questions.
+ #
+-tzdata2015d
++tzdata2015e
+--- ./jdk/make/data/tzdata/africa Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/data/tzdata/africa Wed Jul 01 21:53:30 2015 -0700
+@@ -361,9 +361,10 @@
+ # time this summer, and carry out studies on the possibility of canceling the
+ # practice altogether in future years."
+ #
+-# From Paul Eggert (2015-04-20):
+-# For now, assume DST will be canceled. Any resumption would likely
+-# use different rules anyway.
++# From Paul Eggert (2015-04-24):
++# Yesterday the office of Egyptian President El-Sisi announced his
++# decision to abandon DST permanently. See Ahram Online 2015-04-24.
++# http://english.ahram.org.eg/NewsContent/1/64/128509/Egypt/Politics-/Sisi-cancels-daylight-saving-time-in-Egypt.aspx
+
+ Rule Egypt 2008 only - Aug lastThu 24:00 0 -
+ Rule Egypt 2009 only - Aug 20 24:00 0 -
+@@ -810,20 +811,41 @@
+ # will resume again at 02:00 on Saturday, August 2, 2014....
+ # http://www.mmsp.gov.ma/fr/actualites.aspx?id=586
+
+-# From Paul Eggert (2014-06-05):
+-# For now, guess that later spring and fall transitions will use 2014's rules,
++# From Milamber (2015-06-08):
++# (Google Translation) The hour will thus be delayed 60 minutes
++# Sunday, June 14 at 3:00, the ministry said in a statement, adding
++# that the time will be advanced again 60 minutes Sunday, July 19,
++# 2015 at 2:00. The move comes under 2.12.126 Decree of 26 Jumada I
++# 1433 (18 April 2012) and the decision of the Head of Government of
++# 16 N. 3-29-15 Chaaban 1435 (4 June 2015).
++# Source (french):
++# http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
++#
++# From Milamber (2015-06-09):
++# http://www.mmsp.gov.ma/fr/actualites.aspx?id=863
++#
++# From Michael Deckers (2015-06-09):
++# [The gov.ma announcement] would (probably) make the switch on 2015-07-19 go
++# from 03:00 to 04:00 rather than from 02:00 to 03:00, as in the patch....
++# I think the patch is correct and the quoted text is wrong; the text in
++# <http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
++# with the patch.
++
++# From Paul Eggert (2015-06-08):
++# For now, guess that later spring and fall transitions will use 2015's rules,
+ # and guess that Morocco will switch to standard time at 03:00 the last
+-# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after
+-# Ramadan. To implement this, transition dates for 2015 through 2037 were
++# Sunday before Ramadan, and back to DST at 02:00 the first Sunday after
++# Ramadan. To implement this, transition dates for 2016 through 2037 were
+ # determined by running the following program under GNU Emacs 24.3, with the
+ # results integrated by hand into the table below.
+-# (let ((islamic-year 1436))
++# (let ((islamic-year 1437))
++# (require 'cal-islam)
+ # (while (< islamic-year 1460)
+ # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
+ # (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
+-# (saturday 6))
+-# (while (/= saturday (mod (setq a (1- a)) 7)))
+-# (while (/= saturday (mod b 7))
++# (sunday 0))
++# (while (/= sunday (mod (setq a (1- a)) 7)))
++# (while (/= sunday (mod b 7))
+ # (setq b (1+ b)))
+ # (setq a (calendar-gregorian-from-absolute a))
+ # (setq b (calendar-gregorian-from-absolute b))
+@@ -867,32 +889,30 @@
+ Rule Morocco 2013 only - Jul 7 3:00 0 -
+ Rule Morocco 2013 only - Aug 10 2:00 1:00 S
+ Rule Morocco 2013 max - Oct lastSun 3:00 0 -
+-Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S
++Rule Morocco 2014 2021 - Mar lastSun 2:00 1:00 S
+ Rule Morocco 2014 only - Jun 28 3:00 0 -
+ Rule Morocco 2014 only - Aug 2 2:00 1:00 S
+-Rule Morocco 2015 only - Jun 13 3:00 0 -
+-Rule Morocco 2015 only - Jul 18 2:00 1:00 S
+-Rule Morocco 2016 only - Jun 4 3:00 0 -
+-Rule Morocco 2016 only - Jul 9 2:00 1:00 S
+-Rule Morocco 2017 only - May 20 3:00 0 -
+-Rule Morocco 2017 only - Jul 1 2:00 1:00 S
+-Rule Morocco 2018 only - May 12 3:00 0 -
+-Rule Morocco 2018 only - Jun 16 2:00 1:00 S
+-Rule Morocco 2019 only - May 4 3:00 0 -
+-Rule Morocco 2019 only - Jun 8 2:00 1:00 S
+-Rule Morocco 2020 only - Apr 18 3:00 0 -
+-Rule Morocco 2020 only - May 30 2:00 1:00 S
+-Rule Morocco 2021 only - Apr 10 3:00 0 -
+-Rule Morocco 2021 only - May 15 2:00 1:00 S
+-Rule Morocco 2022 only - Apr 2 3:00 0 -
+-Rule Morocco 2022 only - May 7 2:00 1:00 S
+-Rule Morocco 2023 only - Apr 22 2:00 1:00 S
+-Rule Morocco 2024 only - Apr 13 2:00 1:00 S
+-Rule Morocco 2025 only - Apr 5 2:00 1:00 S
++Rule Morocco 2015 only - Jun 14 3:00 0 -
++Rule Morocco 2015 only - Jul 19 2:00 1:00 S
++Rule Morocco 2016 only - Jun 5 3:00 0 -
++Rule Morocco 2016 only - Jul 10 2:00 1:00 S
++Rule Morocco 2017 only - May 21 3:00 0 -
++Rule Morocco 2017 only - Jul 2 2:00 1:00 S
++Rule Morocco 2018 only - May 13 3:00 0 -
++Rule Morocco 2018 only - Jun 17 2:00 1:00 S
++Rule Morocco 2019 only - May 5 3:00 0 -
++Rule Morocco 2019 only - Jun 9 2:00 1:00 S
++Rule Morocco 2020 only - Apr 19 3:00 0 -
++Rule Morocco 2020 only - May 24 2:00 1:00 S
++Rule Morocco 2021 only - Apr 11 3:00 0 -
++Rule Morocco 2021 only - May 16 2:00 1:00 S
++Rule Morocco 2022 only - May 8 2:00 1:00 S
++Rule Morocco 2023 only - Apr 23 2:00 1:00 S
++Rule Morocco 2024 only - Apr 14 2:00 1:00 S
++Rule Morocco 2025 only - Apr 6 2:00 1:00 S
+ Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S
+-Rule Morocco 2035 only - Oct 27 3:00 0 -
+-Rule Morocco 2036 only - Oct 18 3:00 0 -
+-Rule Morocco 2037 only - Oct 10 3:00 0 -
++Rule Morocco 2036 only - Oct 19 3:00 0 -
++Rule Morocco 2037 only - Oct 4 3:00 0 -
+
+ # Zone NAME GMTOFF RULES FORMAT [UNTIL]
+ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
+--- ./jdk/make/data/tzdata/iso3166.tab Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/data/tzdata/iso3166.tab Wed Jul 01 21:53:30 2015 -0700
+@@ -26,11 +26,10 @@
+ # This file is in the public domain, so clarified as of
+ # 2009-05-17 by Arthur David Olson.
+ #
+-# From Paul Eggert (2014-07-18):
++# From Paul Eggert (2015-05-02):
+ # This file contains a table of two-letter country codes. Columns are
+ # separated by a single tab. Lines beginning with '#' are comments.
+-# Although all text currently uses ASCII encoding, this is planned to
+-# change to UTF-8 soon. The columns of the table are as follows:
++# All text uses UTF-8 encoding. The columns of the table are as follows:
+ #
+ # 1. ISO 3166-1 alpha-2 country code, current as of
+ # ISO 3166-1 Newsletter VI-16 (2013-07-11). See: Updates on ISO 3166
+@@ -61,7 +60,7 @@
+ AT Austria
+ AU Australia
+ AW Aruba
+-AX Aaland Islands
++AX Ã…land Islands
+ AZ Azerbaijan
+ BA Bosnia & Herzegovina
+ BB Barbados
+@@ -90,7 +89,7 @@
+ CF Central African Rep.
+ CG Congo (Rep.)
+ CH Switzerland
+-CI Cote d'Ivoire
++CI Côte d'Ivoire
+ CK Cook Islands
+ CL Chile
+ CM Cameroon
+@@ -234,7 +233,7 @@
+ PW Palau
+ PY Paraguay
+ QA Qatar
+-RE Reunion
++RE Réunion
+ RO Romania
+ RS Serbia
+ RU Russia
+--- ./jdk/make/data/tzdata/northamerica Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/data/tzdata/northamerica Wed Jul 01 21:53:30 2015 -0700
+@@ -2684,7 +2684,17 @@
+ -4:00 US A%sT
+
+ # Cayman Is
+-# See America/Panama.
++
++# From Paul Eggert (2015-05-15):
++# The Cayman government has decided to introduce DST in 2016, the idea being
++# to keep in sync with New York. The legislation hasn't passed but the change
++# seems quite likely. See: Meade B. Cayman 27.
++# http://www.cayman27.com.ky/2015/05/15/clock-ticks-toward-daylight-saving-time-in-cayman
++
++Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
++ -5:07:11 - KMT 1912 Feb # Kingston Mean Time
++ -5:00 - EST 2016
++ -5:00 US E%sT
+
+ # Costa Rica
+
+@@ -3207,7 +3217,6 @@
+ Zone America/Panama -5:18:08 - LMT 1890
+ -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time
+ -5:00 - EST
+-Link America/Panama America/Cayman
+
+ # Puerto Rico
+ # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
+--- ./jdk/make/data/tzdata/southamerica Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/data/tzdata/southamerica Wed Jul 01 21:53:30 2015 -0700
+@@ -53,7 +53,7 @@
+ # I suggest the use of _Summer time_ instead of the more cumbersome
+ # _daylight-saving time_. _Summer time_ seems to be in general use
+ # in Europe and South America.
+-# -- E O Cutler, _New York Times_ (1937-02-14), quoted in
++# -- E O Cutler, _New York Times_ (1937-02-14), quoted in
+ # H L Mencken, _The American Language: Supplement I_ (1960), p 466
+ #
+ # Earlier editions of these tables also used the North American style
+--- ./jdk/make/gensrc/GensrcLocaleDataMetaInfo.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/gensrc/GensrcLocaleDataMetaInfo.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -34,7 +34,8 @@
+ -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
+ -name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
+ -name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
+- -name "CalendarData_*.java" -o -name "CalendarData_*.properties")
++ -name "CalendarData_*.java" -o -name "CalendarData_*.properties" -o \
++ -name "BreakIteratorInfo_*.java" -o -name "BreakIteratorRules_*.java")
+
+ # Then translate the locale files into for example: FormatData_sv
+ LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
+@@ -79,6 +80,12 @@
+ #sun.text.resources.CollationData
+ $(eval $(call CaptureLocale,CollationData))
+
++#sun.text.resources.BreakIteratorInfo
++$(eval $(call CaptureLocale,BreakIteratorInfo))
++
++#sun.text.resources.BreakIteratorRules
++$(eval $(call CaptureLocale,BreakIteratorRules))
++
+ #sun.util.resources.TimeZoneNames
+ $(eval $(call CaptureLocale,TimeZoneNames))
+
+--- ./jdk/make/gensrc/GensrcMisc.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/gensrc/GensrcMisc.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -174,11 +174,10 @@
+
+ ##########################################################################################
+
+-ifndef OPENJDK
+ ifeq ($(OPENJDK_TARGET_OS), windows)
+
+ AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
+- AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
++ AB_SRC_DIR := $(JDK_TOPDIR)/src/windows/classes/com/sun/java/accessibility
+
+ ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+ $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
+@@ -216,6 +215,5 @@
+
+ endif
+ endif
+-endif
+
+ ##########################################################################################
+--- ./jdk/make/lib/Awt2dLibraries.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/lib/Awt2dLibraries.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -319,7 +319,6 @@
+
+ ifeq ($(OPENJDK_TARGET_OS), macosx)
+ LIBAWT_FILES += awt_LoadLibrary.c
+- LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
+ endif
+
+ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
+@@ -485,7 +484,6 @@
+ LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
+ -framework Cocoa \
+ -framework OpenGL \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+ -framework JavaNativeFoundation \
+ -framework JavaRuntimeSupport \
+ -framework ApplicationServices \
+@@ -827,8 +825,8 @@
+ $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
+ LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
+- LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
+- LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\
++ LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
++ LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
+ LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
+ -ljava -ljvm, \
+ LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
+@@ -1120,12 +1118,6 @@
+ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
+ $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
+
+- ifeq ($(OPENJDK_TARGET_OS), macosx)
+- LIBAWT_HEADLESS_CFLAGS += \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+- -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
+- endif
+-
+ LIBAWT_HEADLESS_FILES := \
+ awt_Font.c \
+ HeadlessToolkit.c \
+@@ -1217,8 +1209,7 @@
+
+ ifeq ($(OPENJDK_TARGET_OS), macosx)
+ LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
+- $(LIBSPLASHSCREEN_CFLAGS) \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks
++ $(LIBSPLASHSCREEN_CFLAGS)
+ LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
+ LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
+
+@@ -1250,7 +1241,6 @@
+ -framework ApplicationServices \
+ -framework Foundation \
+ -framework Cocoa \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+ -framework JavaNativeFoundation
+ else ifeq ($(OPENJDK_TARGET_OS), windows)
+ LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
+@@ -1436,9 +1426,7 @@
+ -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
+ -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
+ -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
+- -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+- -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
++ -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) \
+ $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
+@@ -1449,7 +1437,6 @@
+ -framework Cocoa \
+ -framework Security \
+ -framework ExceptionHandling \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+ -framework JavaNativeFoundation \
+ -framework JavaRuntimeSupport \
+ -framework OpenGL \
+@@ -1482,8 +1469,7 @@
+ CFLAGS := $(CFLAGS_JDKLIB) \
+ -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
+ -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
+- -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
++ -I$(JDK_TOPDIR)/src/macosx/native/sun/awt, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) \
+ $(call SET_SHARED_LIBRARY_ORIGIN) \
+ -Xlinker -rpath -Xlinker @loader_path, \
+@@ -1491,7 +1477,6 @@
+ -framework Cocoa \
+ -framework Carbon \
+ -framework ApplicationServices \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+ -framework JavaNativeFoundation \
+ -framework JavaRuntimeSupport \
+ -ljava -ljvm, \
+--- ./jdk/make/lib/CoreLibraries.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/lib/CoreLibraries.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -207,7 +207,7 @@
+ LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
+ jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
+ shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
+- advapi32.lib, \
++ advapi32.lib version.lib, \
+ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
+ RC_FLAGS := $(RC_FLAGS) \
+ -D "JDK_FNAME=java.dll" \
+--- ./jdk/make/lib/PlatformLibraries.gmk Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/lib/PlatformLibraries.gmk Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -32,14 +32,11 @@
+ LANG := C, \
+ OPTIMIZATION := LOW, \
+ CFLAGS := $(CFLAGS_JDKLIB) \
+- -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+- -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
++ -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) \
+ $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LDFLAGS_SUFFIX := -framework Cocoa \
+ -framework Carbon \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+ -framework JavaNativeFoundation \
+ $(LDFLAGS_JDKLIB_SUFFIX), \
+ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \
+@@ -63,9 +60,7 @@
+ OPTIMIZATION := LOW, \
+ CFLAGS := $(CFLAGS_JDKLIB) \
+ -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
+- -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+- -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
++ -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) \
+ $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LDFLAGS_SUFFIX_macosx := \
+@@ -76,7 +71,6 @@
+ -framework Cocoa \
+ -framework Security \
+ -framework ExceptionHandling \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+ -framework JavaNativeFoundation \
+ -framework JavaRuntimeSupport \
+ -framework OpenGL \
+@@ -108,16 +102,13 @@
+ OPTIMIZATION := LOW, \
+ CFLAGS := $(CFLAGS_JDKLIB) \
+ $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
+- -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+- -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
++ -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) \
+ $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LDFLAGS_SUFFIX_macosx := \
+ -losxapp \
+ -framework Cocoa \
+ -framework ApplicationServices \
+- -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+ -framework JavaNativeFoundation \
+ -framework JavaRuntimeSupport \
+ -framework Security \
+@@ -136,15 +127,15 @@
+
+ ##########################################################################################
+
+-ifndef OPENJDK
+ ifeq ($(OPENJDK_TARGET_OS), windows)
+
+- ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
++ ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/windows/native/sun/bridge
+
+ define SetupAccessBridge
+ # Parameter 1 Suffix
+ # Parameter 2 Machine
+- # Parameter 3 ACCESSBRIDGE_ARCH_ suffix
++ # Parameter 3 ACCESSBRIDGE_ARCH_ suffix and name of directory where gensrc headers
++ # are found.
+
+ $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \
+ LIBRARY = JAWTAccessBridge$1, \
+@@ -154,12 +145,12 @@
+ LANG := C++, \
+ OPTIMIZATION := LOW, \
+ CFLAGS := $(CFLAGS_JDKLIB) \
+- -DACCESSBRIDGE_ARCH_$3, \
++ -DACCESSBRIDGE_ARCH_$3 \
++ -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
+ winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
+ ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
+- -subsystem:windows -machine:$2 \
+- -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \
++ -subsystem:windows -machine:$2, \
+ VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
+ RC_FLAGS := $(RC_FLAGS) \
+ -D "JDK_FNAME=JAWTAccessBridge$1.dll" \
+@@ -168,7 +159,8 @@
+ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \
+ DEBUG_SYMBOLS := true)
+
+- $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
++ $$(BUILD_JAWTACCESSBRIDGE$1): \
++ $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
+
+ $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
+ LIBRARY = JavaAccessBridge$1, \
+@@ -180,12 +172,12 @@
+ LANG := C++, \
+ OPTIMIZATION := LOW, \
+ CFLAGS := $(CFLAGS_JDKLIB) \
+- -DACCESSBRIDGE_ARCH_$3, \
++ -DACCESSBRIDGE_ARCH_$3 \
++ -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
+ winspool.lib comdlg32.lib advapi32.lib shell32.lib \
+ ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
+- -subsystem:windows -machine:$2 \
+- -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \
++ -subsystem:windows -machine:$2, \
+ VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
+ RC_FLAGS := $(RC_FLAGS) \
+ -D "JDK_FNAME=JavaAccessBridge$1.dll" \
+@@ -205,7 +197,8 @@
+ LANG := C++, \
+ OPTIMIZATION := LOW, \
+ CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
+- -DACCESSBRIDGE_ARCH_$3, \
++ -DACCESSBRIDGE_ARCH_$3 \
++ -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
+ winspool.lib comdlg32.lib advapi32.lib shell32.lib \
+ ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
+@@ -226,9 +219,9 @@
+
+ ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+ $(eval $(call SetupAccessBridge,-32,I386,32))
+- $(eval $(call SetupAccessBridge,,I386,LEGACY))
++ $(eval $(call SetupAccessBridge,,I386,legacy))
+ else
+ $(eval $(call SetupAccessBridge,-64,X64,64))
+ endif
++
+ endif
+-endif
+--- ./jdk/make/mapfiles/libjava/mapfile-vers Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/mapfiles/libjava/mapfile-vers Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 1997, 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
+@@ -128,12 +128,12 @@
+ Java_java_lang_ClassLoader_defineClass0;
+ Java_java_lang_ClassLoader_defineClass1;
+ Java_java_lang_ClassLoader_defineClass2;
++ Java_java_lang_ClassLoader_findBuiltinLib;
+ Java_java_lang_ClassLoader_findLoadedClass0;
+ Java_java_lang_ClassLoader_resolveClass0;
+ Java_java_lang_ClassLoader_00024NativeLibrary_find;
+ Java_java_lang_ClassLoader_00024NativeLibrary_load;
+ Java_java_lang_ClassLoader_00024NativeLibrary_unload;
+- Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib;
+ Java_java_lang_ClassLoader_registerNatives;
+ Java_java_lang_Compiler_registerNatives;
+ Java_java_lang_Double_longBitsToDouble;
+--- ./jdk/make/mapfiles/libnet/mapfile-vers Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/mapfiles/libnet/mapfile-vers Wed Jul 01 21:53:30 2015 -0700
+@@ -42,7 +42,7 @@
+ Java_java_net_Inet4Address_init;
+ Java_java_net_Inet6Address_init;
+ Java_java_net_PlainDatagramSocketImpl_setTTL;
+- Java_java_net_PlainDatagramSocketImpl_socketSetOption;
++ Java_java_net_PlainDatagramSocketImpl_socketSetOption0;
+ Java_java_net_PlainDatagramSocketImpl_bind0;
+ Java_java_net_PlainSocketImpl_socketAccept;
+ Java_java_net_DatagramPacket_init;
+@@ -73,7 +73,7 @@
+ Java_java_net_SocketOutputStream_init;
+ Java_java_net_PlainDatagramSocketImpl_peek;
+ Java_java_net_PlainDatagramSocketImpl_peekData;
+- Java_java_net_PlainSocketImpl_socketSetOption;
++ Java_java_net_PlainSocketImpl_socketSetOption0;
+ Java_java_net_PlainSocketImpl_socketSendUrgentData;
+ Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate;
+ Java_java_net_PlainSocketImpl_socketGetOption;
+@@ -110,6 +110,8 @@
+ NET_Bind;
+ NET_MapSocketOption;
+ NET_Wait;
++ NET_EnableFastTcpLoopback;
++ NET_ThrowNew;
+ ipv6_available;
+
+ local:
+--- ./jdk/make/profile-includes.txt Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/profile-includes.txt Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++# 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
+@@ -22,38 +22,150 @@
+ # or visit www.oracle.com if you need additional information or have any
+ # questions.
+ #
++
++# These lists define where a file belongs if it exists. It is perfectly fine
++# if a file does not exist on some platforms - we do not have to produce exact
++# per-platform lists. However, for clarity, platform-unique files are handled
++# in platform-specific conditionals.
++
++# On different platforms the libraries are placed into different locations in the
++# JRE:
++ifeq (, $(findstring $(OPENJDK_TARGET_OS), windows macosx))
++ # On non-windows/OSX libraries go into jre/lib/<arch>
++ LIBS_PREFIX := $(OPENJDK_TARGET_CPU_LEGACY_LIB)/
++else
++ # On OSX they go into jre/lib/ - on Windows they go into jre/bin/ and we won't use this
++ LIBS_PREFIX :=
++endif
++
++# Debug info files are tricky to deal with due to all the different platform variants
++# and because they can be zipped.
++ifeq ($(ZIP_DEBUGINFO_FILES), true)
++ # Common case and 'just works' on all platforms
++ DEBUG_SUFFIX := .diz
++else
++ # It gets complicated ...
++ ifeq ($(OPENJDK_TARGET_OS), macosx)
++ # This is a directory, not a simple file, so
++ # it needs expanding explicitly later on
++ DEBUG_SUFFIX := $(SHARED_LIBRARY_SUFFIX).dSYM
++ else
++ ifeq ($(OPENJDK_TARGET_OS), windows)
++ DEBUG_SUFFIX := .map .pdb
++ else
++ DEBUG_SUFFIX := .debuginfo
++ endif
++ endif
++endif
++
++# Expand the contents of the .dSYM directories on macosx.
++# Param 1 - debug files list eg libFoo.dylib.dSYM or libFoo.diz (if zipped)
++# Param 2 - libraries list eg Foo
++# On macosx if not zipping debuginfo files we expand the contents of the .dSYM directories,
++# else we return the original list of .diz files.
++# On other OS we return the original list of debuginfo files (whether zipped or not)
++#
++define expand-debuginfo
++ $(if $(and $(filter-out true, $(ZIP_DEBUGINFO_FILES)), $(filter macosx, $(OPENJDK_TARGET_OS))), \
++ $(foreach i, $1, $(addsuffix /Contents/Info.plist, $i)) \
++ $(foreach i, $2, $(addsuffix /Contents/Resources/DWARF/$i, $(filter $i.%, $1))), \
++ $1)
++endef
++
++# Common executable files
+ PROFILE_1_JRE_BIN_FILES := \
+ java$(EXE_SUFFIX) \
+ keytool$(EXE_SUFFIX)
+
+-PROFILE_1_JRE_LIB_FILES := \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2pkcs11$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsig.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sunec$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jsig.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jvm.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/Xusage.txt \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/jvm.cfg \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jsig.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jvm.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/Xusage.txt \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jsig.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jvm.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/Xusage.txt \
++ifeq ($(OPENJDK_TARGET_OS), windows)
++ PROFILE_1_JRE_BIN_FILES += javaw$(EXE_SUFFIX)
++endif
++
++PROFILE_1_LIBRARIES := \
++ j2pkcs11 \
++ java \
++ jsig \
++ net \
++ nio \
++ sunec \
++ verify \
++ zip
++
++ifeq ($(OPENJDK_TARGET_OS), windows)
++ PROFILE_1_LIBRARIES += msvcrt100
++endif
++
++PROFILE_1_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(PROFILE_1_LIBRARIES))
++PROFILE_1_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(PROFILE_1_LIBRARIES)))
++PROFILE_1_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(PROFILE_1_LIBRARIES))
++PROFILE_1_DEBUG_FILES := $(call expand-debuginfo, $(PROFILE_1_DEBUG_FILES), $(PROFILE_1_LIBRARIES))
++PROFILE_1_LIBRARIES += $(PROFILE_1_DEBUG_FILES)
++
++# Note: libjsig exists as both the real file and a symlink in the VM directory
++# so we have to treat it with care when looking for the debuginfo files
++VM_LIBRARIES := \
++ jvm
++
++ifeq ($(OPENJDK_TARGET_OS), solaris)
++ VM_LIBRARIES += jvm_db jvm_dtrace
++endif
++
++VM_SYMLINKS := \
++ jsig
++
++VM_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(VM_LIBRARIES))
++VM_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(VM_LIBRARIES)))
++VM_SYMLINKS := $(addprefix $(LIBRARY_PREFIX), $(VM_SYMLINKS))
++VM_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(VM_LIBRARIES))
++VM_DEBUG_FILES := $(call expand-debuginfo, $(VM_DEBUG_FILES), $(VM_LIBRARIES))
++VM_DEBUG_FILES += $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(VM_SYMLINKS)))
++VM_SYMLINKS := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(VM_SYMLINKS))
++VM_LIBRARIES += $(VM_SYMLINKS)
++
++VM_FILES := \
++ Xusage.txt
++
++VM_DIRS := client server minimal
++
++VM_FILES := $(foreach i, $(VM_DIRS), $(addprefix $i/, $(VM_LIBRARIES) $(VM_FILES) $(VM_DEBUG_FILES)))
++
++JLI_LIBRARIES := \
++ jli
++
++ifneq ($(OPENJDK_TARGET_OS), windows)
++ JLI_SUBDIR := jli/
++else
++ JLI_SUBDIR :=
++endif
++
++JLI_LIBRARIES := $(addprefix $(JLI_SUBDIR)$(LIBRARY_PREFIX), $(JLI_LIBRARIES))
++JLI_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(JLI_LIBRARIES)))
++JLI_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(JLI_LIBRARIES))
++JLI_DEBUG_FILES := $(call expand-debuginfo, $(JLI_DEBUG_FILES), $(JLI_LIBRARIES))
++JLI_LIBRARIES += $(JLI_DEBUG_FILES)
++
++ifneq ($(OPENJDK_TARGET_OS), windows)
++ PROFILE_1_JRE_LIB_FILES := \
++ $(addprefix $(LIBS_PREFIX), $(PROFILE_1_LIBRARIES) $(VM_FILES) $(JLI_LIBRARIES))
++else
++ # On windows libraries go into jre/bin
++ PROFILE_1_JRE_BIN_FILES += $(PROFILE_1_LIBRARIES) $(VM_FILES) $(JLI_LIBRARIES)
++endif
++
++# Remaining jre/lib contents
++# OSX doesn't use <arch> directory
++#
++ifeq ($(OPENJDK_TARGET_OS), macosx)
++ PROFILE_1_JRE_LIB_FILES += \
++ jvm.cfg \
++ jspawnhelper
++else
++ PROFILE_1_JRE_LIB_FILES += \
++ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/jvm.cfg \
++ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/jspawnhelper
++endif
++
++PROFILE_1_JRE_LIB_FILES += \
+ calendars.properties \
+ classlist \
+ content-types.properties \
+@@ -81,6 +193,14 @@
+ security/trusted.libraries \
+ tzdb.dat
+
++ifeq ($(OPENJDK_TARGET_OS), windows)
++ PROFILE_1_JRE_LIB_FILES += tzmappings
++else
++ ifeq ($(OPENJDK_TARGET_OS), solaris)
++ PROFILE_1_JRE_LIB_FILES += sdp/sdp.conf
++ endif
++endif
++
+ PROFILE_1_JRE_OTHER_FILES := \
+ COPYRIGHT \
+ LICENSE \
+@@ -106,32 +226,63 @@
+ rmid$(EXE_SUFFIX) \
+ rmiregistry$(EXE_SUFFIX)
+
++ifeq ($(OPENJDK_TARGET_OS), windows)
++ PROFILE_2_JRE_BIN_FILES += java-rmi$(EXE_SUFFIX)
++endif
++
++# If you add libraries here, make sure you use the same techniques
++# as used for the other profile's libraries regarding debug files etc
+ PROFILE_2_JRE_LIB_FILES :=
+
+ PROFILE_2_JRE_OTHER_FILES :=
+
+ PROFILE_2_JRE_JAR_FILES :=
+
++ifeq ($(OPENJDK_TARGET_OS), windows)
++ PROFILE_3_JRE_BIN_FILES := \
++ kinit$(EXE_SUFFIX) \
++ klist$(EXE_SUFFIX) \
++ ktab$(EXE_SUFFIX)
++else
++ PROFILE_3_JRE_BIN_FILES :=
++endif
+
+-PROFILE_3_JRE_BIN_FILES :=
++PROFILE_3_LIBRARIES := \
++ hprof \
++ instrument \
++ j2gss \
++ j2pcsc \
++ jaas_unix \
++ jaas_nt \
++ java_crw_demo \
++ jsdt \
++ management \
++ npt \
++ sctp
+
+-PROFILE_3_JRE_LIB_FILES := \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)hprof$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)hprof.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)instrument$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)instrument.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2gss$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2pcsc$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jaas_unix$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) \
++ifeq ($(OPENJDK_TARGET_OS), windows)
++ PROFILE_3_LIBRARIES += w2k_lsa_auth
++else
++ ifeq ($(OPENJDK_TARGET_OS), macosx)
++ PROFILE_3_LIBRARIES += osxkrb5
++ endif
++endif
++
++PROFILE_3_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(PROFILE_3_LIBRARIES))
++PROFILE_3_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(PROFILE_3_LIBRARIES)))
++PROFILE_3_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(PROFILE_3_LIBRARIES))
++PROFILE_3_DEBUG_FILES := $(call expand-debuginfo, $(PROFILE_3_DEBUG_FILES), $(PROFILE_3_LIBRARIES))
++PROFILE_3_LIBRARIES += $(PROFILE_3_DEBUG_FILES)
++
++ifneq ($(OPENJDK_TARGET_OS), windows)
++ PROFILE_3_JRE_LIB_FILES := \
++ $(addprefix $(LIBS_PREFIX), $(PROFILE_3_LIBRARIES))
++else
++ # On windows libraries go into jre/bin
++ PROFILE_3_JRE_BIN_FILES += $(PROFILE_3_LIBRARIES)
++endif
++
++PROFILE_3_JRE_LIB_FILES += \
+ jvm.hprof.txt \
+ management-agent.jar \
+ management/jmxremote.access \
+@@ -153,25 +304,40 @@
+ tnameserv$(EXE_SUFFIX) \
+ unpack200$(EXE_SUFFIX)
+
+-FULL_JRE_LIB_FILES := \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dcpr$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dt_socket.diz \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsound$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsoundalsa$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)kcms$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)mlib_image$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)splashscreen$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX) \
+- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX) \
++JRE_LIBRARIES := \
++ awt \
++ awt_headless \
++ awt_xawt \
++ dcpr \
++ dt_socket \
++ fontmanager \
++ jawt \
++ jdwp \
++ jfr \
++ jpeg \
++ jsound \
++ jsoundalsa \
++ kcms \
++ mlib_image \
++ splashscreen \
++ t2k \
++ unpack
++
++JRE_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(JRE_LIBRARIES))
++JRE_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(JRE_LIBRARIES)))
++JRE_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(JRE_LIBRARIES))
++JRE_DEBUG_FILES := $(call expand-debuginfo, $(JRE_DEBUG_FILES), $(JRE_LIBRARIES))
++JRE_LIBRARIES += $(JRE_DEBUG_FILES)
++
++ifneq ($(OPENJDK_TARGET_OS), windows)
++ FULL_JRE_LIB_FILES := \
++ $(addprefix $(LIBS_PREFIX), $(JRE_LIBRARIES))
++else
++ # On windows libraries go into jre/bin
++ FULL_JRE_BIN_FILES += $(JRE_LIBRARIES)
++endif
++
++FULL_JRE_LIB_FILES += \
+ charsets.jar \
+ cmm/CIEXYZ.pf \
+ cmm/GRAY.pf \
+@@ -254,3 +420,4 @@
+ ext/nashorn.jar \
+ ext/zipfs.jar \
+ jfr.jar
++
+--- ./jdk/make/profile-rtjar-includes.txt Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/profile-rtjar-includes.txt Wed Jul 01 21:53:30 2015 -0700
+@@ -162,6 +162,8 @@
+ javax/management/remote/rmi/_RMIServer_Stub.class
+
+ FULL_JRE_RTJAR_INCLUDE_PACKAGES := \
++ apple \
++ com/apple \
+ com/oracle \
+ com/sun/accessibility/internal/resources \
+ com/sun/activation/registries \
+@@ -213,6 +215,7 @@
+ sun/dc \
+ sun/font \
+ sun/java2d \
++ sun/lwawt \
+ sun/net/ftp \
+ sun/net/smtp \
+ sun/net/www/content/audio \
+--- ./jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2013, 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
+@@ -72,10 +72,6 @@
+ private static String formatVersion;
+ private static String dataVersion;
+ private static String validCurrencyCodes;
+- private static String currenciesWith0MinorUnitDecimals;
+- private static String currenciesWith1MinorUnitDecimal;
+- private static String currenciesWith3MinorUnitDecimal;
+- private static String currenciesWithMinorUnitsUndefined;
+
+ // handy constants - must match definitions in java.util.Currency
+ // magic number
+@@ -83,29 +79,31 @@
+ // number of characters from A to Z
+ private static final int A_TO_Z = ('Z' - 'A') + 1;
+ // entry for invalid country codes
+- private static final int INVALID_COUNTRY_ENTRY = 0x007F;
++ private static final int INVALID_COUNTRY_ENTRY = 0x0000007F;
+ // entry for countries without currency
+- private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x0080;
++ private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x00000200;
+ // mask for simple case country entries
+- private static final int SIMPLE_CASE_COUNTRY_MASK = 0x0000;
++ private static final int SIMPLE_CASE_COUNTRY_MASK = 0x00000000;
+ // mask for simple case country entry final character
+- private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x001F;
++ private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x0000001F;
+ // mask for simple case country entry default currency digits
+- private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x0060;
++ private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x000001E0;
+ // shift count for simple case country entry default currency digits
+ private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_SHIFT = 5;
++ // maximum number for simple case country entry default currency digits
++ private static final int SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS = 9;
+ // mask for special case country entries
+- private static final int SPECIAL_CASE_COUNTRY_MASK = 0x0080;
++ private static final int SPECIAL_CASE_COUNTRY_MASK = 0x00000200;
+ // mask for special case country index
+- private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x001F;
++ private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x0000001F;
+ // delta from entry index component in main table to index into special case tables
+ private static final int SPECIAL_CASE_COUNTRY_INDEX_DELTA = 1;
+ // mask for distinguishing simple and special case countries
+ private static final int COUNTRY_TYPE_MASK = SIMPLE_CASE_COUNTRY_MASK | SPECIAL_CASE_COUNTRY_MASK;
+ // mask for the numeric code of the currency
+- private static final int NUMERIC_CODE_MASK = 0x0003FF00;
++ private static final int NUMERIC_CODE_MASK = 0x000FFC00;
+ // shift count for the numeric code of the currency
+- private static final int NUMERIC_CODE_SHIFT = 8;
++ private static final int NUMERIC_CODE_SHIFT = 10;
+
+ // generated data
+ private static int[] mainTable = new int[A_TO_Z * A_TO_Z];
+@@ -120,7 +118,7 @@
+ private static int[] specialCaseOldCurrenciesNumericCode = new int[maxSpecialCases];
+ private static int[] specialCaseNewCurrenciesNumericCode = new int[maxSpecialCases];
+
+- private static final int maxOtherCurrencies = 70;
++ private static final int maxOtherCurrencies = 128;
+ private static int otherCurrenciesCount = 0;
+ private static StringBuffer otherCurrencies = new StringBuffer();
+ private static int[] otherCurrenciesDefaultFractionDigits = new int[maxOtherCurrencies];
+@@ -129,6 +127,11 @@
+ // date format for parsing cut-over times
+ private static SimpleDateFormat format;
+
++ // Minor Units
++ private static String[] currenciesWithDefinedMinorUnitDecimals =
++ new String[SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS + 1];
++ private static String currenciesWithMinorUnitsUndefined;
++
+ public static void main(String[] args) {
+
+ // Look for "-o outputfilename" option
+@@ -171,16 +174,14 @@
+ formatVersion = (String) currencyData.get("formatVersion");
+ dataVersion = (String) currencyData.get("dataVersion");
+ validCurrencyCodes = (String) currencyData.get("all");
+- currenciesWith0MinorUnitDecimals = (String) currencyData.get("minor0");
+- currenciesWith1MinorUnitDecimal = (String) currencyData.get("minor1");
+- currenciesWith3MinorUnitDecimal = (String) currencyData.get("minor3");
++ for (int i = 0; i <= SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS; i++) {
++ currenciesWithDefinedMinorUnitDecimals[i]
++ = (String) currencyData.get("minor"+i);
++ }
+ currenciesWithMinorUnitsUndefined = (String) currencyData.get("minorUndefined");
+ if (formatVersion == null ||
+ dataVersion == null ||
+ validCurrencyCodes == null ||
+- currenciesWith0MinorUnitDecimals == null ||
+- currenciesWith1MinorUnitDecimal == null ||
+- currenciesWith3MinorUnitDecimal == null ||
+ currenciesWithMinorUnitsUndefined == null) {
+ throw new NullPointerException("not all required data is defined in input");
+ }
+@@ -207,7 +208,7 @@
+ if (currencyInfo.charAt(0) == firstChar && currencyInfo.charAt(1) == secondChar) {
+ checkCurrencyCode(currencyInfo);
+ int digits = getDefaultFractionDigits(currencyInfo);
+- if (digits < 0 || digits > 3) {
++ if (digits < 0 || digits > SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS) {
+ throw new RuntimeException("fraction digits out of range for " + currencyInfo);
+ }
+ int numericCode= getNumericCode(currencyInfo);
+@@ -231,13 +232,14 @@
+ }
+
+ private static int getDefaultFractionDigits(String currencyCode) {
+- if (currenciesWith0MinorUnitDecimals.indexOf(currencyCode) != -1) {
+- return 0;
+- } else if (currenciesWith1MinorUnitDecimal.indexOf(currencyCode) != -1) {
+- return 1;
+- } else if (currenciesWith3MinorUnitDecimal.indexOf(currencyCode) != -1) {
+- return 3;
+- } else if (currenciesWithMinorUnitsUndefined.indexOf(currencyCode) != -1) {
++ for (int i = 0; i <= SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS; i++) {
++ if (currenciesWithDefinedMinorUnitDecimals[i] != null &&
++ currenciesWithDefinedMinorUnitDecimals[i].indexOf(currencyCode) != -1) {
++ return i;
++ }
++ }
++
++ if (currenciesWithMinorUnitsUndefined.indexOf(currencyCode) != -1) {
+ return -1;
+ } else {
+ return 2;
+--- ./jdk/make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -491,10 +491,10 @@
+ TZRule rule = new TZRule(year, month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefinition, savingAmountSecs);
+ if (lastRule) {
+ lastRuleList.add(rule);
+- maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
+ } else {
+ ruleList.add(rule);
+ }
++ maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
+ year++;
+ }
+ }
+--- ./jdk/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java Wed Jul 01 21:53:30 2015 -0700
+@@ -43,7 +43,7 @@
+ static native UnixMountEntry[] getmntctl() throws UnixException;
+
+ // initialize
+- private static native int init();
++ private static native void init();
+
+ static {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+--- ./jdk/src/aix/classes/sun/tools/attach/AixVirtualMachine.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/aix/classes/sun/tools/attach/AixVirtualMachine.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,6 @@
+ /*
+- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+- * Copyright 2013 SAP AG. All rights reserved.
++ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright 2015 SAP AG. All rights reserved.
+ * 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,14 @@
+ */
+ package sun.tools.attach;
+
+-import com.sun.tools.attach.VirtualMachine;
++import com.sun.tools.attach.AttachOperationFailedException;
+ import com.sun.tools.attach.AgentLoadException;
+ import com.sun.tools.attach.AttachNotSupportedException;
+ import com.sun.tools.attach.spi.AttachProvider;
++
+ import java.io.InputStream;
+ import java.io.IOException;
+ import java.io.File;
+-import java.util.Properties;
+
+ // Based on 'LinuxVirtualMachine.java'. All occurrences of the string
+ // "Linux" have been textually replaced by "Aix" to avoid confusion.
+@@ -192,6 +192,8 @@
+ }
+
+ if (completionStatus != 0) {
++ // read from the stream and use that as the error message
++ String message = readErrorMessage(sis);
+ sis.close();
+
+ // In the event of a protocol mismatch then the target VM
+@@ -206,7 +208,11 @@
+ if (cmd.equals("load")) {
+ throw new AgentLoadException("Failed to load agent library");
+ } else {
+- throw new IOException("Command failed in target VM");
++ if (message == null) {
++ throw new AttachOperationFailedException("Command failed in target VM");
++ } else {
++ throw new AttachOperationFailedException(message);
++ }
+ }
+ }
+
+--- ./jdk/src/aix/native/sun/nio/fs/AixNativeDispatcher.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/aix/native/sun/nio/fs/AixNativeDispatcher.c Wed Jul 01 21:53:30 2015 -0700
+@@ -56,23 +56,26 @@
+ /**
+ * Initialization
+ */
+-JNIEXPORT jint JNICALL
++JNIEXPORT void JNICALL
+ Java_sun_nio_fs_AixNativeDispatcher_init(JNIEnv* env, jclass this)
+ {
+- jint flags = 0;
+ jclass clazz;
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+- if (clazz == NULL) {
+- return 0;
++ CHECK_NULL(clazz);
++ entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
++ CHECK_NULL(entry_name);
++ entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
++ CHECK_NULL(entry_dir);
++ entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
++ CHECK_NULL(entry_fstype);
++ entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
++ CHECK_NULL(entry_options);
++ entry_cls = (*env)->NewGlobalRef(env, clazz);
++ if (entry_cls == NULL) {
++ JNU_ThrowOutOfMemoryError(env, NULL);
++ return;
+ }
+- entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
+- entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
+- entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
+- entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
+- entry_cls = (*env)->NewGlobalRef(env, clazz);
+-
+- return 0;
+ }
+
+ /**
+--- ./jdk/src/aix/native/sun/tools/attach/AixVirtualMachine.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/aix/native/sun/tools/attach/AixVirtualMachine.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,6 @@
+ /*
+- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+- * Copyright 2013 SAP AG. All rights reserved.
++ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright 2015 SAP AG. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -238,14 +238,14 @@
+ len = remaining;
+ }
+
+- RESTARTABLE(read(fd, buf+off, len), n);
++ RESTARTABLE(read(fd, buf, len), n);
+ if (n == -1) {
+ JNU_ThrowIOExceptionWithLastError(env, "read");
+ } else {
+ if (n == 0) {
+ n = -1; // EOF
+ } else {
+- (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf+off));
++ (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf));
+ }
+ }
+ return n;
+--- ./jdk/src/bsd/doc/man/appletviewer.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/appletviewer.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1995, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: appletviewer.1
+-.\"
+-.if n .pl 99999
+-.TH appletviewer 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: appletviewer.1
++.\"
++.if n .pl 99999
++.TH appletviewer 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,42 +47,42 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-appletviewer \- Runs applets outside of a web browser\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBappletviewer\fR [\fIoptions\fR] \fIurl\fR\&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options separated by spaces\&. See Options\&.
+-.TP
+-\fIurl\fR
+-The location of the documents or resources to be displayed\&. You can specify multiple URLs separated by spaces\&.
+-.SH DESCRIPTION
+-The \f3appletviewer\fR command connects to the documents or resources designated by \fIurls\fR and displays each applet referenced by the documents in its own window\&. If the documents referred to by urls do not reference any applets with the \f3OBJECT\fR, \f3EMBED\fR, or \f3APPLET\fR tag, then the \f3appletviewer\fR command does nothing\&. For details about the HTML tags that the \f3appletviewer\fR command supports, see AppletViewer Tags at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.html
+-.PP
+-The \f3appletviewer\fR command requires encoded URLs according to the escaping mechanism defined in RFC2396\&. Only encoded URLs are supported\&. However, file names must be unencoded, as specified in RFC2396\&.
+-.PP
+-\fINote:\fR The \f3appletviewer\fR command is intended for development purposes only\&. For more information, see About Sample/Test Applications and Code at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.html
+-.SH OPTIONS
+-.TP
+--debug
+-.br
+-Starts the Applet Viewer in the Java debugger with the \f3jdb\fR command to debug the applets in the document\&.
+-.TP
+--encoding \fIencoding-name\fR
+-.br
+-Specifies the input HTML file encoding name\&.
+-.TP
+--J\fIjavaoption\fR
+-.br
+-Passes the string \f3javaoption\fR as a single argument to the Java interpreter, which runs the Applet Viewer\&. The argument should not contain spaces\&. Multiple argument words must all begin with the prefix \f3-J\fR\&. This is useful for adjusting the compiler\&'s execution environment or memory usage\&.
+-.PP
++
++.SH NAME
++appletviewer \- Runs applets outside of a web browser\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBappletviewer\fR [\fIoptions\fR] \fIurl\fR\&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options separated by spaces\&. See Options\&.
++.TP
++\fIurl\fR
++The location of the documents or resources to be displayed\&. You can specify multiple URLs separated by spaces\&.
++.SH DESCRIPTION
++The \f3appletviewer\fR command connects to the documents or resources designated by \fIurls\fR and displays each applet referenced by the documents in its own window\&. If the documents referred to by urls do not reference any applets with the \f3OBJECT\fR, \f3EMBED\fR, or \f3APPLET\fR tag, then the \f3appletviewer\fR command does nothing\&. For details about the HTML tags that the \f3appletviewer\fR command supports, see AppletViewer Tags at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.html
++.PP
++The \f3appletviewer\fR command requires encoded URLs according to the escaping mechanism defined in RFC2396\&. Only encoded URLs are supported\&. However, file names must be unencoded, as specified in RFC2396\&.
++.PP
++\fINote:\fR The \f3appletviewer\fR command is intended for development purposes only\&. For more information, see About Sample/Test Applications and Code at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.html
++.SH OPTIONS
++.TP
++-debug
++.br
++Starts the Applet Viewer in the Java debugger with the \f3jdb\fR command to debug the applets in the document\&.
++.TP
++-encoding \fIencoding-name\fR
++.br
++Specifies the input HTML file encoding name\&.
++.TP
++-J\fIjavaoption\fR
++.br
++Passes the string \f3javaoption\fR as a single argument to the Java interpreter, which runs the Applet Viewer\&. The argument should not contain spaces\&. Multiple argument words must all begin with the prefix \f3-J\fR\&. This is useful for adjusting the compiler\&'s execution environment or memory usage\&.
++.PP
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/extcheck.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/extcheck.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: extcheck.1
+-.\"
+-.if n .pl 99999
+-.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: extcheck.1
++.\"
++.if n .pl 99999
++.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,43 +47,43 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fItargetfile\&.jar\fR
+-The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
+-.SH DESCRIPTION
+-The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
+-.PP
+-The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
+-.PP
+-If no conflict is detected, then the return code is 0\&.
+-.PP
+-If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
+-.SH OPTIONS
+-.TP
+--verbose
+-.br
+-Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
++
++.SH NAME
++extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fItargetfile\&.jar\fR
++The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
++.SH DESCRIPTION
++The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
++.PP
++The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
++.PP
++If no conflict is detected, then the return code is 0\&.
++.PP
++If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
++.SH OPTIONS
++.TP
++-verbose
++.br
++Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/idlj.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/idlj.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: idlj.1
+-.\"
+-.if n .pl 99999
+-.TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: idlj.1
++.\"
++.if n .pl 99999
++.TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,520 +47,520 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBidlj\fR [ \fIoptions\fR ] \fIidlfile\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&. Options can appear in any order, but must precede the \f3idlfile\fR\&.
+-.TP
+-\fIidlfile\fR
+-The name of a file that contains Interface Definition Language (IDL) definitions\&.
+-.SH DESCRIPTION
+-The IDL-to-Java Compiler generates the Java bindings for a specified IDL file\&. For binding details, see Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
+-.PP
+-Some earlier releases of the IDL-to-Java compiler were named \f3idltojava\fR\&.
+-.SS EMIT\ CLIENT\ AND\ SERVER\ BINDINGS
+-The following \f3idlj\fR command generates an IDL file named \f3My\&.idl\fR with client-side bindings\&.
+-.sp
+-.nf
+-\f3idlj My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The previous syntax is equivalent to the following:
+-.sp
+-.nf
+-\f3idlj \-fclient My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The next example generates the server-side bindings, and includes the client-side bindings plus the skeleton, all of which are POA (Inheritance Model)\&.
+-.sp
+-.nf
+-\f3idlg \-fserver My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you want to generate both client and server-side bindings, then use one of the following (equivalent) commands:
+-.sp
+-.nf
+-\f3idlj \-fclient \-fserver My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There are two possible server-side models: the Portal Servant Inheritance Model and the Tie Model\&. See Tie Delegation Model\&.
+-.PP
+-\f3Portable Servant Inheritance Model\fR\&. The default server-side model is the Portable Servant Inheritance Model\&. Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3MyPOA\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3MyPOA\fR class\&. \f3MyPOA\&.java\fR is a stream-based skeleton that extends the \f3org\&.omg\&.PortableServer\&.Servant\fR class at http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.html The \f3My\fR interface implements the \f3callHandler\fR interface and the operations interface associated with the IDL interface the skeleton implements\&.The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. See Portable Object Adapter (POA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.html In the Java programming language, the \f3Servant\fR type is mapped to the Java \f3org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&.Another option for the Inheritance Model is to use the \f3-oldImplBase\fR flag to generate server-side bindings that are compatible with releases of the Java programming language before Java SE 1\&.4\&. The -\f3oldImplBase\fR flag is nonstandard, and these APIs are deprecated\&. You would use this flag only for compatibility with existing servers written in Java SE 1\&.3\&. In that case, you would need to modify an existing make file to add the \f3-oldImplBase\fR flag to the \f3idlj\fR compiler\&. Otherwise POA-based server-side mappings are generated\&. To generate server-side bindings that are backward compatible, do the following:
+-.sp
+-.nf
+-\f3idlj \-fclient \-fserver \-oldImplBase My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fall \-oldImplBase My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3_MyImplBase\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3_MyImplBase\fR class\&.
+-.PP
+-\f3Tie Delegation Model\fR\&. The other server-side model is called the Tie Model\&. This is a delegation model\&. Because it is not possible to generate ties and skeletons at the same time, they must be generated separately\&. The following commands generate the bindings for the Tie Model:
+-.sp
+-.nf
+-\f3idlj \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fallTIE My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-For the \f3My\fR interface, the second command generates \f3MyPOATie\&.java\fR\&. The constructor to the \f3MyPOATie\fR class takes a delegate\&. In this example, using the default POA model, the constructor also needs a POA\&. You must provide the implementation for the delegate, but it does not have to inherit from any other class, only the interface \f3MyOperations\fR\&. To use it with the ORB, you must wrap your implementation within the \f3MyPOATie\fR class, for example:
+-.sp
+-.nf
+-\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// Get reference to rootpoa & activate the POAManager\fP
+-.fi
+-.nf
+-\f3POA rootpoa = (POA)orb\&.resolve_initial_references("RootPOA");\fP
+-.fi
+-.nf
+-\f3rootpoa\&.the_POAManager()\&.activate();\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create servant and register it with the ORB\fP
+-.fi
+-.nf
+-\f3MyServant myDelegate = new MyServant();\fP
+-.fi
+-.nf
+-\f3myDelegate\&.setORB(orb); \fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create a tie, with servant being the delegate\&.\fP
+-.fi
+-.nf
+-\f3MyPOATie tie = new MyPOATie(myDelegate, rootpoa);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// obtain the objectRef for the tie\fP
+-.fi
+-.nf
+-\f3My ref = tie\&._this(orb);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-You might want to use the Tie model instead of the typical Inheritance model when your implementation must inherit from some other implementation\&. Java allows any number of interface inheritance, but there is only one slot for class inheritance\&. If you use the inheritance model, then that slot is used up\&. With the Tie Model, that slot is freed up for your own use\&. The drawback is that it introduces a level of indirection: one extra method call occurs when a method is called\&.
+-.PP
+-For server-side generation, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions earlier than Java SE 1\&.4\&.
+-.sp
+-.nf
+-\f3idlj \-oldImplBase \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-oldImplBase \-fallTIE My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-For the \f3My\fR interface, the this generates \f3My_Tie\&.java\fR\&. The constructor to the \f3My_Tie\fR class takes an \f3impl\fR object\&. You must provide the implementation for \f3impl\fR, but it does not have to inherit from any other class, only the interface \f3HelloOperations\fR\&. But to use it with the ORB, you must wrap your implementation within \f3My_Tie\fR, for example:
+-.sp
+-.nf
+-\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create servant and register it with the ORB\fP
+-.fi
+-.nf
+-\f3MyServant myDelegate = new MyServant();\fP
+-.fi
+-.nf
+-\f3myDelegate\&.setORB(orb); \fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create a tie, with servant being the delegate\&.\fP
+-.fi
+-.nf
+-\f3MyPOATie tie = new MyPOATie(myDelegate);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// obtain the objectRef for the tie\fP
+-.fi
+-.nf
+-\f3My ref = tie\&._this(orb);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ EMITTED\ FILES
+-If you want to direct the emitted files to a directory other than the current directory, then call the compiler this way: \f3i\fR\f3dlj -td /altdir My\&.idl\fR\&.
+-.PP
+-For the \f3My\fR interface, the bindings are emitted to \f3/altdir/My\&.java\fR, etc\&., instead of \f3\&./My\&.java\fR\&.
+-.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ INCLUDE\ FILES
+-If the \f3My\&.idl\fR file includes another \f3idl\fR file, \f3MyOther\&.idl\fR, then the compiler assumes that the \f3MyOther\&.idl\fR file resides in the local directory\&. If it resides in \f3/includes\fR, for example, then you call the compiler with the following command:
+-.sp
+-.nf
+-\f3idlj \-i /includes My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If \f3My\&.idl\fR also included \f3Another\&.idl\fR that resided in \f3/moreIncludes\fR, for example, then you call the compiler with the following command:
+-.sp
+-.nf
+-\f3idlj \-i /includes \-i /moreIncludes My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Because this form of \f3include\fR can become long, another way to indicate to the compiler where to search for included files is provided\&. This technique is similar to the idea of an environment variable\&. Create a file named idl\&.config in a directory that is listed in your \f3CLASSPATH\fR variable\&. Inside of \f3idl\&.config\fR, provide a line with the following form:
+-.sp
+-.nf
+-\f3includes=/includes;/moreIncludes\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The compiler will find this file and read in the includes list\&. Note that in this example the separator character between the two directories is a semicolon (;)\&. This separator character is platform dependent\&. On the Windows platform, use a semicolon, on the Unix platform, use a colon, and so on\&.
+-.SS EMIT\ BINDINGS\ FOR\ INCLUDE\ FILES
+-By default, only those interfaces, structures, and so on, that are defined in the \f3idl\fR file on the command line have Java bindings generated for them\&. The types defined in included files are not generated\&. For example, assume the following two \f3idl\fR files:
+-.sp
+-.nf
+-\f3My\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3#include <MyOther\&.idl>\fP
+-.fi
+-.nf
+-\f3interface My\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3MyOther\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3interface MyOther\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There is a caveat to the default rule\&. Any \f3#include\fR statements that appear at the global scope are treated as described\&. These \f3#include\fR statements can be thought of as import statements\&. The \f3#include\fR statements that appear within an enclosed scope are treated as true \f3#include\fR statements, which means that the code within the included file is treated as though it appeared in the original file and, therefore, Java bindings are emitted for it\&. Here is an example:
+-.sp
+-.nf
+-\f3My\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3#include <MyOther\&.idl>\fP
+-.fi
+-.nf
+-\f3interface My\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 #include <Embedded\&.idl>\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3MyOther\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3interface MyOther\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3Embedded\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3enum E {one, two, three};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Run\f3idlj My\&.idl\fRto generate the following list of Java files\&. Notice that \f3MyOther\&.java\fR is not generated because it is defined in an import-like \f3#include\fR\&. But \f3E\&.java\fR was generated because it was defined in a true \f3#include\fR\&. Notice that because the \f3Embedded\&.idl\fR file is included within the scope of the interface \f3My\fR, it appears within the scope of \f3My\fR (in \f3MyPackage\fR)\&. If the \f3-emitAll\fR flag had been used, then all types in all included files would have been emitted\&.
+-.sp
+-.nf
+-\f3\&./MyHolder\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyHelper\&.java\fP
+-.fi
+-.nf
+-\f3\&./_MyStub\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/EHolder\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/EHelper\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/E\&.java\fP
+-.fi
+-.nf
+-\f3\&./My\&.java\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS INSERT\ PACKAGE\ PREFIXES
+-Suppose that you work for a company named ABC that has constructed the following IDL file:
+-.sp
+-.nf
+-\f3Widgets\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3module Widgets\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 interface W1 {\&.\&.\&.};\fP
+-.fi
+-.nf
+-\f3 interface W2 {\&.\&.\&.};\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you run this file through the IDL-to-Java compiler, then the Java bindings for W1 and W2 are placed within the \f3Widgets\fR package\&. There is an industry convention that states that a company\&'s packages should reside within a package named \f3com\&.<company name>\fR\&. To follow this convention, the package name should be \f3com\&.abc\&.Widgets\fR\&. To place this package prefix onto the Widgets module, execute the following:
+-.sp
+-.nf
+-\f3idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you have an IDL file that includes Widgets\&.idl, then the \f3-pkgPrefix\fR flag must appear in that command also\&. If it does not, then your IDL file will be looking for a \f3Widgets\fR package rather than a \f3com\&.abc\&.Widgets\fR package\&.
+-.PP
+-If you have a number of these packages that require prefixes, then it might be easier to place them into the idl\&.config file described previously\&. Each package prefix line should be of the form: \f3PkgPrefix\&.<type>=<prefix>\fR\&. The line for the previous example would be \f3PkgPrefix\&.Widgets=com\&.abc\fR\&. This option does not affect the Repository ID\&.
+-.SS DEFINE\ SYMBOLS\ BEFORE\ COMPILATION
+-You might need to define a symbol for compilation that is not defined within the IDL file, perhaps to include debugging code in the bindings\&. The command \f3idlj -d MYDEF My\&.idl\fRis equivalent to putting the line \f3#define MYDEF\fR inside My\&.idl\&.
+-.SS PRESERVE\ PREEXISTING\ BINDINGS
+-If the Java binding files already exist, then the \f3-keep\fR flag keeps the compiler from overwriting them\&. The default is to generate all files without considering that they already exist\&. If you have customized those files (which you should not do unless you are very comfortable with their contents), then the \f3-keep\fR option is very useful\&. The command \f3idlj -keep My\&.idl\fR emits all client-side bindings that do not already exist\&.
+-.SS VIEW\ COMPILATION\ PROGRESS
+-The IDL-to-Java compiler generates status messages as it progresses through its phases of execution\&. Use the \f3-v\fR option to activate the verbose mode: \f3idlj -v My\&.idl\fR\&.
+-.PP
+-By default the compiler does not operate in verbose mode
+-.SS DISPLAY\ VERSION\ INFORMATION
+-To display the build version of the IDL-to-Java compiler, specify the \f3-version\fR option on the command-line: \f3idlj -version\fR\&.
+-.PP
+-Version information also appears within the bindings generated by the compiler\&. Any additional options appearing on the command-line are ignored\&.
+-.SH OPTIONS
+-.TP
+--d \fIsymbol\fR
+-.br
+-This is equivalent to the following line in an IDL file:
+-.sp
+-.nf
+-\f3#define \fIsymbol\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--demitAll
+-.br
+-Emit all types, including those found in \f3#include\fR files\&.
+-.TP
+--fside
+-.br
+-Defines what bindings to emit\&. The \f3side\fR parameter can be \f3client\fR, \f3server\fR, \f3serverTIE\fR, \f3all\fR, or \f3allTIE\fR\&. The \f3-fserverTIE\fR and \f3-fallTIE\fR options cause delegate model skeletons to be emitted\&. Defaults to \f3-fclient\fR when the flag is not specified\&.
+-.TP
+--i \fIinclude-path\fR
+-.br
+-By default, the current directory is scanned for included files\&. This option adds another directory\&.
+-.TP
+--i \fIkeep\fR
+-.br
+-If a file to be generated already exists, then do not overwrite it\&. By default it is overwritten\&.
+-.TP
+--noWarn
+-.br
+-Suppress warning messages\&.
+-.TP
+--oldImplBase
+-.br
+-Generates skeletons compatible with pre-1\&.4 JDK ORBs\&. By default, the POA Inheritance Model server-side bindings are generated\&. This option provides backward-compatibility with earlier releases of the Java programming language by generating server-side bindings that are \f3ImplBase\fR Inheritance Model classes\&.
+-.TP
+--pkgPrefix \fItype\fR\fIprefix\fR
+-.br
+-Wherever \f3type\fR is encountered at file scope, prefix the generated Java package name with \f3prefix\fR for all files generated for that type\&. The type is the simple name of either a top-level module, or an IDL type defined outside of any module\&.
+-.TP
+--pkgTranslate \fItype\fR\fIpackage\fR
+-.br
+-Whenever the module name type is encountered in an identifier, replace it in the identifier with package for all files in the generated Java package\&. Note that \f3pkgPrefix\fR changes are made first\&. The type value is the simple name of either a top-level module, or an IDL type defined outside of any module and must match the full package name exactly\&.
+-
+-If more than one translation matches an identifier, then the longest match is chosen as shown in the following example:
+-
+-\fICommand\fR:
+-.sp
+-.nf
+-\f3pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-\fIResulting Translation\fR:
+-.sp
+-.nf
+-\f3type => pkg\fP
+-.fi
+-.nf
+-\f3type\&.ext => pkg\&.ext\fP
+-.fi
+-.nf
+-\f3type\&.baz => pkg2\&.fizz\fP
+-.fi
+-.nf
+-\f3type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-The following package names \f3org\fR, \f3org\fR\&.o\f3mg\fR, or any subpackages of \f3org\&.omg\fR cannot be translated\&. Any attempt to translate these packages results in uncompilable code, and the use of these packages as the first argument after \f3-pkgTranslate\fR is treated as an error\&.
+-.TP
+--skeletonName \fIxxx%yyy\fR
+-.br
+-Use \f3xxx%yyy\fR as the pattern for naming the skeleton\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserver\fR or \f3-fall\fR), and \f3_%ImplBase\fR for the \f3oldImplBase\fR class (-\f3oldImplBase\fR) and (\f3-fserver\fR or \f3-fall\fR))\&.
+-.TP
+--td \fIdir\fR
+-.br
+-Use \fIdir\fR for the output directory instead of the current directory\&.
+-.TP
+--tieName \fIxxx%yyy\fR
+-.br
+-Use \f3xxx%yyy\fR according to the pattern\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserverTie or -fallTie\fR), and \f3_%Tie\fR for the \f3oldImplBase\fR tie class (-\f3oldImplBase\fR) and (\f3-fserverTie\fR or \f3-fallTie\fR))
+-.TP
+--nowarn, -verbose
+-.br
+-Displays release information and terminates\&.
+-.TP
+--version
+-.br
+-Displays release information and terminates\&.
+-.SH RESTRICTIONS
+-Escaped identifiers in the global scope cannot have the same spelling as IDL primitive types, \f3Object\fR, or \f3ValueBase\fR\&. This is because the symbol table is preloaded with these identifiers\&. Allowing them to be redefined would overwrite their original definitions\&. Possible permanent restriction\&.
+-.PP
+-The \f3fixed\fR IDL type is not supported\&.
+-.SH KNOWN\ PROBLEMS
+-No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&.
++
++.SH NAME
++idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBidlj\fR [ \fIoptions\fR ] \fIidlfile\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&. Options can appear in any order, but must precede the \f3idlfile\fR\&.
++.TP
++\fIidlfile\fR
++The name of a file that contains Interface Definition Language (IDL) definitions\&.
++.SH DESCRIPTION
++The IDL-to-Java Compiler generates the Java bindings for a specified IDL file\&. For binding details, see Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
++.PP
++Some earlier releases of the IDL-to-Java compiler were named \f3idltojava\fR\&.
++.SS EMIT\ CLIENT\ AND\ SERVER\ BINDINGS
++The following \f3idlj\fR command generates an IDL file named \f3My\&.idl\fR with client-side bindings\&.
++.sp
++.nf
++\f3idlj My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The previous syntax is equivalent to the following:
++.sp
++.nf
++\f3idlj \-fclient My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The next example generates the server-side bindings, and includes the client-side bindings plus the skeleton, all of which are POA (Inheritance Model)\&.
++.sp
++.nf
++\f3idlg \-fserver My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you want to generate both client and server-side bindings, then use one of the following (equivalent) commands:
++.sp
++.nf
++\f3idlj \-fclient \-fserver My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fall My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There are two possible server-side models: the Portal Servant Inheritance Model and the Tie Model\&. See Tie Delegation Model\&.
++.PP
++\f3Portable Servant Inheritance Model\fR\&. The default server-side model is the Portable Servant Inheritance Model\&. Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3MyPOA\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3MyPOA\fR class\&. \f3MyPOA\&.java\fR is a stream-based skeleton that extends the \f3org\&.omg\&.PortableServer\&.Servant\fR class at http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.html The \f3My\fR interface implements the \f3callHandler\fR interface and the operations interface associated with the IDL interface the skeleton implements\&.The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. See Portable Object Adapter (POA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.html In the Java programming language, the \f3Servant\fR type is mapped to the Java \f3org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&.Another option for the Inheritance Model is to use the \f3-oldImplBase\fR flag to generate server-side bindings that are compatible with releases of the Java programming language before Java SE 1\&.4\&. The -\f3oldImplBase\fR flag is nonstandard, and these APIs are deprecated\&. You would use this flag only for compatibility with existing servers written in Java SE 1\&.3\&. In that case, you would need to modify an existing make file to add the \f3-oldImplBase\fR flag to the \f3idlj\fR compiler\&. Otherwise POA-based server-side mappings are generated\&. To generate server-side bindings that are backward compatible, do the following:
++.sp
++.nf
++\f3idlj \-fclient \-fserver \-oldImplBase My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fall \-oldImplBase My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3_MyImplBase\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3_MyImplBase\fR class\&.
++.PP
++\f3Tie Delegation Model\fR\&. The other server-side model is called the Tie Model\&. This is a delegation model\&. Because it is not possible to generate ties and skeletons at the same time, they must be generated separately\&. The following commands generate the bindings for the Tie Model:
++.sp
++.nf
++\f3idlj \-fall My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fallTIE My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++For the \f3My\fR interface, the second command generates \f3MyPOATie\&.java\fR\&. The constructor to the \f3MyPOATie\fR class takes a delegate\&. In this example, using the default POA model, the constructor also needs a POA\&. You must provide the implementation for the delegate, but it does not have to inherit from any other class, only the interface \f3MyOperations\fR\&. To use it with the ORB, you must wrap your implementation within the \f3MyPOATie\fR class, for example:
++.sp
++.nf
++\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// Get reference to rootpoa & activate the POAManager\fP
++.fi
++.nf
++\f3POA rootpoa = (POA)orb\&.resolve_initial_references("RootPOA");\fP
++.fi
++.nf
++\f3rootpoa\&.the_POAManager()\&.activate();\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create servant and register it with the ORB\fP
++.fi
++.nf
++\f3MyServant myDelegate = new MyServant();\fP
++.fi
++.nf
++\f3myDelegate\&.setORB(orb); \fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create a tie, with servant being the delegate\&.\fP
++.fi
++.nf
++\f3MyPOATie tie = new MyPOATie(myDelegate, rootpoa);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// obtain the objectRef for the tie\fP
++.fi
++.nf
++\f3My ref = tie\&._this(orb);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++You might want to use the Tie model instead of the typical Inheritance model when your implementation must inherit from some other implementation\&. Java allows any number of interface inheritance, but there is only one slot for class inheritance\&. If you use the inheritance model, then that slot is used up\&. With the Tie Model, that slot is freed up for your own use\&. The drawback is that it introduces a level of indirection: one extra method call occurs when a method is called\&.
++.PP
++For server-side generation, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions earlier than Java SE 1\&.4\&.
++.sp
++.nf
++\f3idlj \-oldImplBase \-fall My\&.idl\fP
++.fi
++.nf
++\f3idlj \-oldImplBase \-fallTIE My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++For the \f3My\fR interface, the this generates \f3My_Tie\&.java\fR\&. The constructor to the \f3My_Tie\fR class takes an \f3impl\fR object\&. You must provide the implementation for \f3impl\fR, but it does not have to inherit from any other class, only the interface \f3HelloOperations\fR\&. But to use it with the ORB, you must wrap your implementation within \f3My_Tie\fR, for example:
++.sp
++.nf
++\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create servant and register it with the ORB\fP
++.fi
++.nf
++\f3MyServant myDelegate = new MyServant();\fP
++.fi
++.nf
++\f3myDelegate\&.setORB(orb); \fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create a tie, with servant being the delegate\&.\fP
++.fi
++.nf
++\f3MyPOATie tie = new MyPOATie(myDelegate);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// obtain the objectRef for the tie\fP
++.fi
++.nf
++\f3My ref = tie\&._this(orb);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ EMITTED\ FILES
++If you want to direct the emitted files to a directory other than the current directory, then call the compiler this way: \f3i\fR\f3dlj -td /altdir My\&.idl\fR\&.
++.PP
++For the \f3My\fR interface, the bindings are emitted to \f3/altdir/My\&.java\fR, etc\&., instead of \f3\&./My\&.java\fR\&.
++.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ INCLUDE\ FILES
++If the \f3My\&.idl\fR file includes another \f3idl\fR file, \f3MyOther\&.idl\fR, then the compiler assumes that the \f3MyOther\&.idl\fR file resides in the local directory\&. If it resides in \f3/includes\fR, for example, then you call the compiler with the following command:
++.sp
++.nf
++\f3idlj \-i /includes My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If \f3My\&.idl\fR also included \f3Another\&.idl\fR that resided in \f3/moreIncludes\fR, for example, then you call the compiler with the following command:
++.sp
++.nf
++\f3idlj \-i /includes \-i /moreIncludes My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Because this form of \f3include\fR can become long, another way to indicate to the compiler where to search for included files is provided\&. This technique is similar to the idea of an environment variable\&. Create a file named idl\&.config in a directory that is listed in your \f3CLASSPATH\fR variable\&. Inside of \f3idl\&.config\fR, provide a line with the following form:
++.sp
++.nf
++\f3includes=/includes;/moreIncludes\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The compiler will find this file and read in the includes list\&. Note that in this example the separator character between the two directories is a semicolon (;)\&. This separator character is platform dependent\&. On the Windows platform, use a semicolon, on the Unix platform, use a colon, and so on\&.
++.SS EMIT\ BINDINGS\ FOR\ INCLUDE\ FILES
++By default, only those interfaces, structures, and so on, that are defined in the \f3idl\fR file on the command line have Java bindings generated for them\&. The types defined in included files are not generated\&. For example, assume the following two \f3idl\fR files:
++.sp
++.nf
++\f3My\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3#include <MyOther\&.idl>\fP
++.fi
++.nf
++\f3interface My\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3MyOther\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3interface MyOther\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There is a caveat to the default rule\&. Any \f3#include\fR statements that appear at the global scope are treated as described\&. These \f3#include\fR statements can be thought of as import statements\&. The \f3#include\fR statements that appear within an enclosed scope are treated as true \f3#include\fR statements, which means that the code within the included file is treated as though it appeared in the original file and, therefore, Java bindings are emitted for it\&. Here is an example:
++.sp
++.nf
++\f3My\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3#include <MyOther\&.idl>\fP
++.fi
++.nf
++\f3interface My\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 #include <Embedded\&.idl>\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3MyOther\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3interface MyOther\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3Embedded\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3enum E {one, two, three};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Run\f3idlj My\&.idl\fRto generate the following list of Java files\&. Notice that \f3MyOther\&.java\fR is not generated because it is defined in an import-like \f3#include\fR\&. But \f3E\&.java\fR was generated because it was defined in a true \f3#include\fR\&. Notice that because the \f3Embedded\&.idl\fR file is included within the scope of the interface \f3My\fR, it appears within the scope of \f3My\fR (in \f3MyPackage\fR)\&. If the \f3-emitAll\fR flag had been used, then all types in all included files would have been emitted\&.
++.sp
++.nf
++\f3\&./MyHolder\&.java\fP
++.fi
++.nf
++\f3\&./MyHelper\&.java\fP
++.fi
++.nf
++\f3\&./_MyStub\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage\fP
++.fi
++.nf
++\f3\&./MyPackage/EHolder\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage/EHelper\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage/E\&.java\fP
++.fi
++.nf
++\f3\&./My\&.java\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS INSERT\ PACKAGE\ PREFIXES
++Suppose that you work for a company named ABC that has constructed the following IDL file:
++.sp
++.nf
++\f3Widgets\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3module Widgets\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 interface W1 {\&.\&.\&.};\fP
++.fi
++.nf
++\f3 interface W2 {\&.\&.\&.};\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you run this file through the IDL-to-Java compiler, then the Java bindings for W1 and W2 are placed within the \f3Widgets\fR package\&. There is an industry convention that states that a company\&'s packages should reside within a package named \f3com\&.<company name>\fR\&. To follow this convention, the package name should be \f3com\&.abc\&.Widgets\fR\&. To place this package prefix onto the Widgets module, execute the following:
++.sp
++.nf
++\f3idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you have an IDL file that includes Widgets\&.idl, then the \f3-pkgPrefix\fR flag must appear in that command also\&. If it does not, then your IDL file will be looking for a \f3Widgets\fR package rather than a \f3com\&.abc\&.Widgets\fR package\&.
++.PP
++If you have a number of these packages that require prefixes, then it might be easier to place them into the idl\&.config file described previously\&. Each package prefix line should be of the form: \f3PkgPrefix\&.<type>=<prefix>\fR\&. The line for the previous example would be \f3PkgPrefix\&.Widgets=com\&.abc\fR\&. This option does not affect the Repository ID\&.
++.SS DEFINE\ SYMBOLS\ BEFORE\ COMPILATION
++You might need to define a symbol for compilation that is not defined within the IDL file, perhaps to include debugging code in the bindings\&. The command \f3idlj -d MYDEF My\&.idl\fRis equivalent to putting the line \f3#define MYDEF\fR inside My\&.idl\&.
++.SS PRESERVE\ PREEXISTING\ BINDINGS
++If the Java binding files already exist, then the \f3-keep\fR flag keeps the compiler from overwriting them\&. The default is to generate all files without considering that they already exist\&. If you have customized those files (which you should not do unless you are very comfortable with their contents), then the \f3-keep\fR option is very useful\&. The command \f3idlj -keep My\&.idl\fR emits all client-side bindings that do not already exist\&.
++.SS VIEW\ COMPILATION\ PROGRESS
++The IDL-to-Java compiler generates status messages as it progresses through its phases of execution\&. Use the \f3-v\fR option to activate the verbose mode: \f3idlj -v My\&.idl\fR\&.
++.PP
++By default the compiler does not operate in verbose mode
++.SS DISPLAY\ VERSION\ INFORMATION
++To display the build version of the IDL-to-Java compiler, specify the \f3-version\fR option on the command-line: \f3idlj -version\fR\&.
++.PP
++Version information also appears within the bindings generated by the compiler\&. Any additional options appearing on the command-line are ignored\&.
++.SH OPTIONS
++.TP
++-d \fIsymbol\fR
++.br
++This is equivalent to the following line in an IDL file:
++.sp
++.nf
++\f3#define \fIsymbol\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-demitAll
++.br
++Emit all types, including those found in \f3#include\fR files\&.
++.TP
++-fside
++.br
++Defines what bindings to emit\&. The \f3side\fR parameter can be \f3client\fR, \f3server\fR, \f3serverTIE\fR, \f3all\fR, or \f3allTIE\fR\&. The \f3-fserverTIE\fR and \f3-fallTIE\fR options cause delegate model skeletons to be emitted\&. Defaults to \f3-fclient\fR when the flag is not specified\&.
++.TP
++-i \fIinclude-path\fR
++.br
++By default, the current directory is scanned for included files\&. This option adds another directory\&.
++.TP
++-i \fIkeep\fR
++.br
++If a file to be generated already exists, then do not overwrite it\&. By default it is overwritten\&.
++.TP
++-noWarn
++.br
++Suppress warning messages\&.
++.TP
++-oldImplBase
++.br
++Generates skeletons compatible with pre-1\&.4 JDK ORBs\&. By default, the POA Inheritance Model server-side bindings are generated\&. This option provides backward-compatibility with earlier releases of the Java programming language by generating server-side bindings that are \f3ImplBase\fR Inheritance Model classes\&.
++.TP
++-pkgPrefix \fItype\fR\fIprefix\fR
++.br
++Wherever \f3type\fR is encountered at file scope, prefix the generated Java package name with \f3prefix\fR for all files generated for that type\&. The type is the simple name of either a top-level module, or an IDL type defined outside of any module\&.
++.TP
++-pkgTranslate \fItype\fR\fIpackage\fR
++.br
++Whenever the module name type is encountered in an identifier, replace it in the identifier with package for all files in the generated Java package\&. Note that \f3pkgPrefix\fR changes are made first\&. The type value is the simple name of either a top-level module, or an IDL type defined outside of any module and must match the full package name exactly\&.
++
++If more than one translation matches an identifier, then the longest match is chosen as shown in the following example:
++
++\fICommand\fR:
++.sp
++.nf
++\f3pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++\fIResulting Translation\fR:
++.sp
++.nf
++\f3type => pkg\fP
++.fi
++.nf
++\f3type\&.ext => pkg\&.ext\fP
++.fi
++.nf
++\f3type\&.baz => pkg2\&.fizz\fP
++.fi
++.nf
++\f3type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++The following package names \f3org\fR, \f3org\fR\&.o\f3mg\fR, or any subpackages of \f3org\&.omg\fR cannot be translated\&. Any attempt to translate these packages results in uncompilable code, and the use of these packages as the first argument after \f3-pkgTranslate\fR is treated as an error\&.
++.TP
++-skeletonName \fIxxx%yyy\fR
++.br
++Use \f3xxx%yyy\fR as the pattern for naming the skeleton\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserver\fR or \f3-fall\fR), and \f3_%ImplBase\fR for the \f3oldImplBase\fR class (-\f3oldImplBase\fR) and (\f3-fserver\fR or \f3-fall\fR))\&.
++.TP
++-td \fIdir\fR
++.br
++Use \fIdir\fR for the output directory instead of the current directory\&.
++.TP
++-tieName \fIxxx%yyy\fR
++.br
++Use \f3xxx%yyy\fR according to the pattern\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserverTie or -fallTie\fR), and \f3_%Tie\fR for the \f3oldImplBase\fR tie class (-\f3oldImplBase\fR) and (\f3-fserverTie\fR or \f3-fallTie\fR))
++.TP
++-nowarn, -verbose
++.br
++Displays release information and terminates\&.
++.TP
++-version
++.br
++Displays release information and terminates\&.
++.SH RESTRICTIONS
++Escaped identifiers in the global scope cannot have the same spelling as IDL primitive types, \f3Object\fR, or \f3ValueBase\fR\&. This is because the symbol table is preloaded with these identifiers\&. Allowing them to be redefined would overwrite their original definitions\&. Possible permanent restriction\&.
++.PP
++The \f3fixed\fR IDL type is not supported\&.
++.SH KNOWN\ PROBLEMS
++No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&.
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jar.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jar.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jar.1
+-.\"
+-.if n .pl 99999
+-.TH jar 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jar.1
++.\"
++.if n .pl 99999
++.TH jar 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,437 +47,437 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jar \- Manipulates Java Archive (JAR) files\&.
+-.SH SYNOPSIS
+-Create JAR file
+-.sp
+-.nf
+-
+-\fBjar c\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Update JAR file
+-.sp
+-.nf
+-
+-\fBjar u\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Extract JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBx\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-List Contents of JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBt\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Add Index to JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBi\fR \fIjarfile\fR [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-.SH DESCRIPTION
+-The \f3jar\fR command is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format\&. However, the \f3jar\fR command was designed mainly to package Java applets or applications into a single archive\&. When the components of an applet or application (files, images and sounds) are combined into a single archive, they can be downloaded by a Java agent (such as a browser) in a single HTTP transaction, rather than requiring a new connection for each piece\&. This dramatically improves download times\&. The \f3jar\fR command also compresses files, which further improves download time\&. The \f3jar\fR command also allows individual entries in a file to be signed by the applet author so that their origin can be authenticated\&. A JAR file can be used as a class path entry, whether or not it is compressed\&.
+-.PP
+-The syntax for the \f3jar\fR command resembles the syntax for the \f3tar\fR command\&. It has several operation modes, defined by one of the mandatory \fIoperation arguments\fR\&. Other arguments are either \fIoptions\fR that modify the behavior of the operation, or \fIoperands\fR required to perform the operation\&.
+-.SH OPERATION\ ARGUMENTS
+-When using the \f3jar\fR command, you have to select an operation to be performed by specifying one of the following operation arguments\&. You can mix them up with other one-letter options on the command line, but usually the operation argument is the first argument specified\&.
+-.TP
+-c
+-Create a new JAR archive\&.
+-.TP
+-i
+-Generate index information for a JAR archive\&.
+-.TP
+-t
+-List the contents of a JAR archive\&.
+-.TP
+-u
+-Update a JAR archive\&.
+-.TP
+-x
+-Extract files from a JAR archive\&.
+-.SH OPTIONS
+-Use the following options to customize how the JAR file is created, updated, extracted, or viewed:
+-.TP
+-e
+-Sets the class specified by the \fIentrypoint\fR operand to be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The use of this option creates or overrides the \f3Main-Class\fR attribute value in the manifest file\&. The \f3e\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-
+-For example, the following command creates the \f3Main\&.jar\fR archive with the \f3Main\&.class\fR file where the \f3Main-Clas\fRs attribute value in the manifest is set to \f3Main\fR:
+-.sp
+-.nf
+-\f3jar cfe Main\&.jar Main Main\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The Java Runtime Environment (JRE) can directly call this application by running the following command:
+-.sp
+-.nf
+-\f3java \-jar Main\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the entry point class name is in a package, then it could use either the dot (\&.) or slash (/) as the delimiter\&. For example, if \f3Main\&.class\fR is in a package called \f3mydir\fR, then the entry point can be specified in one of the following ways:
+-.sp
+-.nf
+-\f3jar \-cfe Main\&.jar mydir/Main mydir/Main\&.class\fP
+-.fi
+-.nf
+-\f3jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Note
+-
+-Specifying both \f3m\fR and \f3e\fR options together when a particular manifest also contains the \f3Main-Class\fR attribute results in an ambiguous \f3Main-Class\fR specification\&. The ambiguity leads to an error and the \f3jar\fR command creation or update operation is terminated\&.
+-.TP
+-f
+-Sets the file specified by the \fI\fR\fIjarfile\fR operand to be the name of the JAR file that is created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR) from, or viewed (\f3t\fR)\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
+-.TP
+-m
+-Includes names and values of attributes from the file specified by the \f3manifest\fR operand in the manifest file of the \f3jar\fR command (located in the archive at \f3META-INF/MANIFEST\&.MF\fR)\&. The \f3jar\fR command adds the attribute\(cqs name and value to the JAR file unless an entry already exists with the same name, in which case the \f3jar\fR command updates the value of the attribute\&. The \f3m\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-
+-You can add special-purpose name-value attribute pairs to the manifest that are not contained in the default manifest file\&. For example, you can add attributes that specify vendor information, release information, package sealing, or to make JAR-bundled applications executable\&. For examples of using the \f3m\fR option, see Packaging Programs at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
+-.TP
+-M
+-Does not create a manifest file entry (for \f3c\fR and \f3u\fR), or delete a manifest file entry when one exists (for \f3u\fR)\&. The \f3M\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-.TP
+-n
+-When creating (\f3c\fR) a JAR file, this option normalizes the archive so that the content is not affected by the packing and unpacking operations of the pack200(1) command\&. Without this normalization, the signature of a signed JAR can become invalid\&.
+-.TP
+-v
+-Generates verbose output to standard output\&. See Examples\&.
+-.TP
+-0
+-(Zero) Creates (\f3c\fR) or updates (\f3u\fR) the JAR file without using ZIP compression\&.
+-.TP
+--C \fIdir\fR
+-.br
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, this option temporarily changes the directory while processing files specified by the \fIfile\fR operands\&. Its operation is intended to be similar to the \f3-C\fR option of the UNIX \f3tar\fR utility\&.For example, the following command changes to the \f3classes\fR directory and adds the \f3Bar\&.class\fR file from that directory to \f3my\&.jar\fR:
+-.sp
+-.nf
+-\f3jar uf my\&.jar \-C classes Bar\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following command changes to the \f3classes\fR directory and adds to \f3my\&.jar\fR all files within the classes directory (without creating a \f3classes\fR directory in the JAR file), then changes back to the original directory before changing to the \f3bin\fR directory to add \f3Xyz\&.class\fR to \f3my\&.jar\fR\&.
+-.sp
+-.nf
+-\f3jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If \f3classes\fR contained files \f3bar1\fR and \f3bar2\fR, then the JAR file will contain the following after running the previous command:
+-.sp
+-.nf
+-\f3% \fIjar tf my\&.jar\fR\fP
+-.fi
+-.nf
+-\f3META\-INF/\fP
+-.fi
+-.nf
+-\f3META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3bar1\fP
+-.fi
+-.nf
+-\f3bar2\fP
+-.fi
+-.nf
+-\f3Xyz\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-\fI\fR-J\fIoption\fR
+-Sets the specified JVM option to be used when the JRE runs the JAR file\&. JVM options are described on the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
+-.SH OPERANDS
+-The following operands are recognized by the \f3jar\fR command\&.
+-.TP
+-\fIfile\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIfile\fR operand defines the path and name of the file or directory that should be added to the archive\&. When extracting (\f3x\fR) or listing the contents (\f3t\fR) of a JAR file, the \fIfile\fR operand defines the path and name of the file to be extrated or listed\&. At least one valid file or directory must be specified\&. Separate multiple \fIfile\fR operands with spaces\&. If the \fIentrypoint\fR, \fIjarfile\fR, or \fImanifest\fR operands are used, the \fIfile\fR operands must be specified after them\&.
+-.TP
+-\fIentrypoint\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIentrypoint\fR operand defines the name of the class that should be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The \fIentrypoint\fR operand must be specified if the \f3e\fR option is present\&.
+-.TP
+-\fIjarfile\fR
+-Defines the name of the file to be created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR), or viewed (\f3t\fR)\&. The \fIjarfile\fR operand must be specified if the \f3f\fR option is present\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
+-
+-When indexing (\f3i\fR) a JAR file, specify the \fIjarfile\fR operand without the \f3f\fR option\&.
+-.TP
+-\fImanifest\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fImanifest\fR operand defines the preexisting manifest files with names and values of attributes to be included in \f3MANIFEST\&.MF\fR in the JAR file\&. The \fImanifest\fR operand must be specified if the \f3f\fR option is present\&.
+-.TP
+-\fI@arg-file\fR
+-To shorten or simplify the \f3jar\fR command, you can specify arguments in a separate text file and pass it to the \f3jar\fR command with the at sign (@) as a prefix\&. When the \f3jar\fR command encounters an argument beginning with the at sign, it expands the contents of that file into the argument list\&.
+-
+-An argument file can include options and arguments of the \f3jar\fR command (except the \f3-J\fR options, because they are passed to the launcher, which does not support argument files)\&. The arguments within a file can be separated by spaces or newline characters\&. File names within an argument file are relative to the current directory from which you run the \f3jar\fR command, not relative to the location of the argument file\&. Wild cards, such as the asterisk (*), that might otherwise be expanded by the operating system shell, are not expanded\&.
+-
+-The following example, shows how to create a \f3classes\&.list\fR file with names of files from the current directory output by the \f3find\fR command:
+-.sp
+-.nf
+-\f3find \&. \-name \&'*\&.class\&' \-print > classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-You can then execute the \f3jar\fR command and pass the \f3classes\&.list\fR file to it using the \fI@arg-file\fR syntax:
+-.sp
+-.nf
+-\f3jar cf my\&.jar @classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-An argument file can be specified with a path, but any file names inside the argument file that have relative paths are relative to the current working directory of the \f3jar\fR command, not to the path passed in, for example:
+-.sp
+-.nf
+-\f3jar @dir/classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.SH NOTES
+-The \f3e\fR, \f3f\fR, and \f3m\fR options must appear in the same order on the command line as the \fIentrypoint\fR, \fIjarfile\fR, and \fImanifest\fR operands, for example:
+-.sp
+-.nf
+-\f3jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH EXAMPLES
+-\f3Example 1 Adding All Files From the Current Directory With Verbose Output\fR
+-.sp
+-.nf
+-\f3% ls\fP
+-.fi
+-.nf
+-\f31\&.au Animator\&.class monkey\&.jpg\fP
+-.fi
+-.nf
+-\f32\&.au Wave\&.class spacemusic\&.au\fP
+-.fi
+-.nf
+-\f33\&.au at_work\&.gif\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3% jar cvf bundle\&.jar *\fP
+-.fi
+-.nf
+-\f3added manifest\fP
+-.fi
+-.nf
+-\f3adding: 1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: 2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: 3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
+-.fi
+-.nf
+-\f3adding: Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Adding Files From Subdirectories\fR
+-.sp
+-.nf
+-\f3% ls \-F\fP
+-.fi
+-.nf
+-\f3audio/ classes/ images/\fP
+-.fi
+-.nf
+-\f3% jar cvf bundle\&.jar audio classes images\fP
+-.fi
+-.nf
+-\f3added manifest\fP
+-.fi
+-.nf
+-\f3adding: audio/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: audio/1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: audio/2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: audio/3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
+-.fi
+-.nf
+-\f3adding: audio/spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: classes/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: classes/Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: classes/Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: images/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: images/monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: images/at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3% ls \-F\fP
+-.fi
+-.nf
+-\f3audio/ bundle\&.jar classes/ images/\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Listing the Contents of JAR\fR
+-.sp
+-.nf
+-\f3% jar tf bundle\&.jar\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3META\-INF/\fP
+-.fi
+-.nf
+-\f3META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3audio/1\&.au\fP
+-.fi
+-.nf
+-\f3audio/2\&.au\fP
+-.fi
+-.nf
+-\f3audio/3\&.au\fP
+-.fi
+-.nf
+-\f3audio/spacemusic\&.au\fP
+-.fi
+-.nf
+-\f3classes/Animator\&.class\fP
+-.fi
+-.nf
+-\f3classes/Wave\&.class\fP
+-.fi
+-.nf
+-\f3images/monkey\&.jpg\fP
+-.fi
+-.nf
+-\f3images/at_work\&.gif\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Adding an Index\fR
+-.PP
+-Use the \f3i\fR option when you split the interdependent classes for a stock trade application into three JAR files: \f3main\&.jar\fR, \f3buy\&.jar\fR, and \f3sell\&.jar\fR\&. If you specify the \f3Class-Path\fR attribute in the \f3main\&.jar\fR manifest, then you can use the \f3i\fR option to speed up the class loading time for your application:
+-.sp
+-.nf
+-\f3Class\-Path: buy\&.jar sell\&.jar\fP
+-.fi
+-.nf
+-\f3jar i main\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-An \f3INDEX\&.LIST\fR file is inserted to the \f3META-INF\fR directory\&. This enables the application class loader to download the specified JAR files when it is searching for classes or resources\&.
+-.PP
+-The application class loader uses the information stored in this file for efficient class loading\&. To copy directories, first compress files in \f3dir1\fR to \f3stdout\fR, then pipeline and extract from \f3stdin\fR to \f3dir2\fR (omitting the \f3-f\fR option from both \f3jar\fR commands):
+-.sp
+-.nf
+-\f3(cd dir1; jar c \&.) | (cd dir2; jar x)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pack200(1)\&.
+-.TP 0.2i
+-\(bu
+-The JAR section of The Java Tutorials at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
++
++.SH NAME
++jar \- Manipulates Java Archive (JAR) files\&.
++.SH SYNOPSIS
++Create JAR file
++.sp
++.nf
++
++\fBjar c\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Update JAR file
++.sp
++.nf
++
++\fBjar u\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Extract JAR file
++.sp
++.nf
++
++\fBjar\fR \fBx\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++List Contents of JAR file
++.sp
++.nf
++
++\fBjar\fR \fBt\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Add Index to JAR file
++.sp
++.nf
++
++\fBjar\fR \fBi\fR \fIjarfile\fR [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++.SH DESCRIPTION
++The \f3jar\fR command is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format\&. However, the \f3jar\fR command was designed mainly to package Java applets or applications into a single archive\&. When the components of an applet or application (files, images and sounds) are combined into a single archive, they can be downloaded by a Java agent (such as a browser) in a single HTTP transaction, rather than requiring a new connection for each piece\&. This dramatically improves download times\&. The \f3jar\fR command also compresses files, which further improves download time\&. The \f3jar\fR command also allows individual entries in a file to be signed by the applet author so that their origin can be authenticated\&. A JAR file can be used as a class path entry, whether or not it is compressed\&.
++.PP
++The syntax for the \f3jar\fR command resembles the syntax for the \f3tar\fR command\&. It has several operation modes, defined by one of the mandatory \fIoperation arguments\fR\&. Other arguments are either \fIoptions\fR that modify the behavior of the operation, or \fIoperands\fR required to perform the operation\&.
++.SH OPERATION\ ARGUMENTS
++When using the \f3jar\fR command, you have to select an operation to be performed by specifying one of the following operation arguments\&. You can mix them up with other one-letter options on the command line, but usually the operation argument is the first argument specified\&.
++.TP
++c
++Create a new JAR archive\&.
++.TP
++i
++Generate index information for a JAR archive\&.
++.TP
++t
++List the contents of a JAR archive\&.
++.TP
++u
++Update a JAR archive\&.
++.TP
++x
++Extract files from a JAR archive\&.
++.SH OPTIONS
++Use the following options to customize how the JAR file is created, updated, extracted, or viewed:
++.TP
++e
++Sets the class specified by the \fIentrypoint\fR operand to be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The use of this option creates or overrides the \f3Main-Class\fR attribute value in the manifest file\&. The \f3e\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++
++For example, the following command creates the \f3Main\&.jar\fR archive with the \f3Main\&.class\fR file where the \f3Main-Clas\fRs attribute value in the manifest is set to \f3Main\fR:
++.sp
++.nf
++\f3jar cfe Main\&.jar Main Main\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The Java Runtime Environment (JRE) can directly call this application by running the following command:
++.sp
++.nf
++\f3java \-jar Main\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the entry point class name is in a package, then it could use either the dot (\&.) or slash (/) as the delimiter\&. For example, if \f3Main\&.class\fR is in a package called \f3mydir\fR, then the entry point can be specified in one of the following ways:
++.sp
++.nf
++\f3jar \-cfe Main\&.jar mydir/Main mydir/Main\&.class\fP
++.fi
++.nf
++\f3jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Note
++
++Specifying both \f3m\fR and \f3e\fR options together when a particular manifest also contains the \f3Main-Class\fR attribute results in an ambiguous \f3Main-Class\fR specification\&. The ambiguity leads to an error and the \f3jar\fR command creation or update operation is terminated\&.
++.TP
++f
++Sets the file specified by the \fI\fR\fIjarfile\fR operand to be the name of the JAR file that is created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR) from, or viewed (\f3t\fR)\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
++.TP
++m
++Includes names and values of attributes from the file specified by the \f3manifest\fR operand in the manifest file of the \f3jar\fR command (located in the archive at \f3META-INF/MANIFEST\&.MF\fR)\&. The \f3jar\fR command adds the attribute\(cqs name and value to the JAR file unless an entry already exists with the same name, in which case the \f3jar\fR command updates the value of the attribute\&. The \f3m\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++
++You can add special-purpose name-value attribute pairs to the manifest that are not contained in the default manifest file\&. For example, you can add attributes that specify vendor information, release information, package sealing, or to make JAR-bundled applications executable\&. For examples of using the \f3m\fR option, see Packaging Programs at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
++.TP
++M
++Does not create a manifest file entry (for \f3c\fR and \f3u\fR), or delete a manifest file entry when one exists (for \f3u\fR)\&. The \f3M\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++.TP
++n
++When creating (\f3c\fR) a JAR file, this option normalizes the archive so that the content is not affected by the packing and unpacking operations of the pack200(1) command\&. Without this normalization, the signature of a signed JAR can become invalid\&.
++.TP
++v
++Generates verbose output to standard output\&. See Examples\&.
++.TP
++0
++(Zero) Creates (\f3c\fR) or updates (\f3u\fR) the JAR file without using ZIP compression\&.
++.TP
++-C \fIdir\fR
++.br
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, this option temporarily changes the directory while processing files specified by the \fIfile\fR operands\&. Its operation is intended to be similar to the \f3-C\fR option of the UNIX \f3tar\fR utility\&.For example, the following command changes to the \f3classes\fR directory and adds the \f3Bar\&.class\fR file from that directory to \f3my\&.jar\fR:
++.sp
++.nf
++\f3jar uf my\&.jar \-C classes Bar\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following command changes to the \f3classes\fR directory and adds to \f3my\&.jar\fR all files within the classes directory (without creating a \f3classes\fR directory in the JAR file), then changes back to the original directory before changing to the \f3bin\fR directory to add \f3Xyz\&.class\fR to \f3my\&.jar\fR\&.
++.sp
++.nf
++\f3jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If \f3classes\fR contained files \f3bar1\fR and \f3bar2\fR, then the JAR file will contain the following after running the previous command:
++.sp
++.nf
++\f3% \fIjar tf my\&.jar\fR\fP
++.fi
++.nf
++\f3META\-INF/\fP
++.fi
++.nf
++\f3META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3bar1\fP
++.fi
++.nf
++\f3bar2\fP
++.fi
++.nf
++\f3Xyz\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++\fI\fR-J\fIoption\fR
++Sets the specified JVM option to be used when the JRE runs the JAR file\&. JVM options are described on the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
++.SH OPERANDS
++The following operands are recognized by the \f3jar\fR command\&.
++.TP
++\fIfile\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIfile\fR operand defines the path and name of the file or directory that should be added to the archive\&. When extracting (\f3x\fR) or listing the contents (\f3t\fR) of a JAR file, the \fIfile\fR operand defines the path and name of the file to be extrated or listed\&. At least one valid file or directory must be specified\&. Separate multiple \fIfile\fR operands with spaces\&. If the \fIentrypoint\fR, \fIjarfile\fR, or \fImanifest\fR operands are used, the \fIfile\fR operands must be specified after them\&.
++.TP
++\fIentrypoint\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIentrypoint\fR operand defines the name of the class that should be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The \fIentrypoint\fR operand must be specified if the \f3e\fR option is present\&.
++.TP
++\fIjarfile\fR
++Defines the name of the file to be created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR), or viewed (\f3t\fR)\&. The \fIjarfile\fR operand must be specified if the \f3f\fR option is present\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
++
++When indexing (\f3i\fR) a JAR file, specify the \fIjarfile\fR operand without the \f3f\fR option\&.
++.TP
++\fImanifest\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fImanifest\fR operand defines the preexisting manifest files with names and values of attributes to be included in \f3MANIFEST\&.MF\fR in the JAR file\&. The \fImanifest\fR operand must be specified if the \f3f\fR option is present\&.
++.TP
++\fI@arg-file\fR
++To shorten or simplify the \f3jar\fR command, you can specify arguments in a separate text file and pass it to the \f3jar\fR command with the at sign (@) as a prefix\&. When the \f3jar\fR command encounters an argument beginning with the at sign, it expands the contents of that file into the argument list\&.
++
++An argument file can include options and arguments of the \f3jar\fR command (except the \f3-J\fR options, because they are passed to the launcher, which does not support argument files)\&. The arguments within a file can be separated by spaces or newline characters\&. File names within an argument file are relative to the current directory from which you run the \f3jar\fR command, not relative to the location of the argument file\&. Wild cards, such as the asterisk (*), that might otherwise be expanded by the operating system shell, are not expanded\&.
++
++The following example, shows how to create a \f3classes\&.list\fR file with names of files from the current directory output by the \f3find\fR command:
++.sp
++.nf
++\f3find \&. \-name \&'*\&.class\&' \-print > classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++You can then execute the \f3jar\fR command and pass the \f3classes\&.list\fR file to it using the \fI@arg-file\fR syntax:
++.sp
++.nf
++\f3jar cf my\&.jar @classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++An argument file can be specified with a path, but any file names inside the argument file that have relative paths are relative to the current working directory of the \f3jar\fR command, not to the path passed in, for example:
++.sp
++.nf
++\f3jar @dir/classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.SH NOTES
++The \f3e\fR, \f3f\fR, and \f3m\fR options must appear in the same order on the command line as the \fIentrypoint\fR, \fIjarfile\fR, and \fImanifest\fR operands, for example:
++.sp
++.nf
++\f3jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH EXAMPLES
++\f3Example 1 Adding All Files From the Current Directory With Verbose Output\fR
++.sp
++.nf
++\f3% ls\fP
++.fi
++.nf
++\f31\&.au Animator\&.class monkey\&.jpg\fP
++.fi
++.nf
++\f32\&.au Wave\&.class spacemusic\&.au\fP
++.fi
++.nf
++\f33\&.au at_work\&.gif\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3% jar cvf bundle\&.jar *\fP
++.fi
++.nf
++\f3added manifest\fP
++.fi
++.nf
++\f3adding: 1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: 2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: 3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
++.fi
++.nf
++\f3adding: Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Adding Files From Subdirectories\fR
++.sp
++.nf
++\f3% ls \-F\fP
++.fi
++.nf
++\f3audio/ classes/ images/\fP
++.fi
++.nf
++\f3% jar cvf bundle\&.jar audio classes images\fP
++.fi
++.nf
++\f3added manifest\fP
++.fi
++.nf
++\f3adding: audio/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: audio/1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: audio/2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: audio/3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
++.fi
++.nf
++\f3adding: audio/spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: classes/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: classes/Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: classes/Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: images/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: images/monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: images/at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3% ls \-F\fP
++.fi
++.nf
++\f3audio/ bundle\&.jar classes/ images/\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Listing the Contents of JAR\fR
++.sp
++.nf
++\f3% jar tf bundle\&.jar\fP
++.fi
++.sp
++.sp
++.nf
++\f3META\-INF/\fP
++.fi
++.nf
++\f3META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3audio/1\&.au\fP
++.fi
++.nf
++\f3audio/2\&.au\fP
++.fi
++.nf
++\f3audio/3\&.au\fP
++.fi
++.nf
++\f3audio/spacemusic\&.au\fP
++.fi
++.nf
++\f3classes/Animator\&.class\fP
++.fi
++.nf
++\f3classes/Wave\&.class\fP
++.fi
++.nf
++\f3images/monkey\&.jpg\fP
++.fi
++.nf
++\f3images/at_work\&.gif\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Adding an Index\fR
++.PP
++Use the \f3i\fR option when you split the interdependent classes for a stock trade application into three JAR files: \f3main\&.jar\fR, \f3buy\&.jar\fR, and \f3sell\&.jar\fR\&. If you specify the \f3Class-Path\fR attribute in the \f3main\&.jar\fR manifest, then you can use the \f3i\fR option to speed up the class loading time for your application:
++.sp
++.nf
++\f3Class\-Path: buy\&.jar sell\&.jar\fP
++.fi
++.nf
++\f3jar i main\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++An \f3INDEX\&.LIST\fR file is inserted to the \f3META-INF\fR directory\&. This enables the application class loader to download the specified JAR files when it is searching for classes or resources\&.
++.PP
++The application class loader uses the information stored in this file for efficient class loading\&. To copy directories, first compress files in \f3dir1\fR to \f3stdout\fR, then pipeline and extract from \f3stdin\fR to \f3dir2\fR (omitting the \f3-f\fR option from both \f3jar\fR commands):
++.sp
++.nf
++\f3(cd dir1; jar c \&.) | (cd dir2; jar x)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pack200(1)\&.
++.TP 0.2i
++\(bu
++The JAR section of The Java Tutorials at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jarsigner.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jarsigner.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Security Tools
+-.\" Title: jarsigner.1
+-.\"
+-.if n .pl 99999
+-.TH jarsigner 1 "21 November 2013" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Security Tools
++.\" Title: jarsigner.1
++.\"
++.if n .pl 99999
++.TH jarsigner 1 "21 November 2013" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,761 +47,761 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jarsigner \- Signs and verifies Java Archive (JAR) files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjarsigner\fR [ \fIoptions\fR ] \fIjar\-file\fR \fIalias\fR
+-.fi
+-.nf
+-
+-\fBjarsigner\fR \fB\-verify\fR [ \fIoptions\fR ] \fIjar\-file\fR [\fIalias \&.\&.\&.\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+--verify
+-.br
+-The \f3-verify\fR option can take zero or more keystore alias names after the JAR file name\&. When the \f3-verify\fR option is specified, the \f3jarsigner\fR command checks that the certificate used to verify each signed entry in the JAR file matches one of the keystore aliases\&. The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
+-
+-If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar verified, with signer errors" is displayed\&.
+-.TP
+-\fIjar-file\fR
+-The JAR file to be signed\&.
+-
+-If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar signed, with signer errors" is displayed\&.
+-.TP
+-\fIalias\fR
+-The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
+-.SH DESCRIPTION
+-The \f3jarsigner\fR tool has two purposes:
+-.TP 0.2i
+-\(bu
+-To sign Java Archive (JAR) files\&.
+-.TP 0.2i
+-\(bu
+-To verify the signatures and integrity of signed JAR files\&.
+-.PP
+-The JAR feature enables the packaging of class files, images, sounds, and other digital data in a single file for faster and easier distribution\&. A tool named \f3jar\fR enables developers to produce JAR files\&. (Technically, any zip file can also be considered a JAR file, although when created by the \f3jar\fR command or processed by the \f3jarsigner\fR command, JAR files also contain a \f3META-INF/MANIFEST\&.MF\fR file\&.)
+-.PP
+-A digital signature is a string of bits that is computed from some data (the data being signed) and the private key of an entity (a person, company, and so on)\&. Similar to a handwritten signature, a digital signature has many useful characteristics:
+-.TP 0.2i
+-\(bu
+-Its authenticity can be verified by a computation that uses the public key corresponding to the private key used to generate the signature\&.
+-.TP 0.2i
+-\(bu
+-It cannot be forged, assuming the private key is kept secret\&.
+-.TP 0.2i
+-\(bu
+-It is a function of the data signed and thus cannot be claimed to be the signature for other data as well\&.
+-.TP 0.2i
+-\(bu
+-The signed data cannot be changed\&. If the data is changed, then the signature cannot be verified as authentic\&.
+-.PP
+-To generate an entity\&'s signature for a file, the entity must first have a public/private key pair associated with it and one or more certificates that authenticate its public key\&. A certificate is a digitally signed statement from one entity that says that the public key of another entity has a particular value\&.
+-.PP
+-The \f3jarsigner\fR command uses key and certificate information from a keystore to generate digital signatures for JAR files\&. A keystore is a database of private keys and their associated X\&.509 certificate chains that authenticate the corresponding public keys\&. The \f3keytool\fR command is used to create and administer keystores\&.
+-.PP
+-The \f3jarsigner\fR command uses an entity\&'s private key to generate a signature\&. The signed JAR file contains, among other things, a copy of the certificate from the keystore for the public key corresponding to the private key used to sign the file\&. The \f3jarsigner\fR command can verify the digital signature of the signed JAR file using the certificate inside it (in its signature block file)\&.
+-.PP
+-The \f3jarsigner\fR command can generate signatures that include a time stamp that lets a systems or deployer (including Java Plug-in) to check whether the JAR file was signed while the signing certificate was still valid\&. In addition, APIs allow applications to obtain the timestamp information\&.
+-.PP
+-At this time, the \f3jarsigner\fR command can only sign JAR files created by the \f3jar\fR command or zip files\&. JAR files are the same as zip files, except they also have a \f3META-INF/MANIFEST\&.MF\fR file\&. A \f3META-INF/MANIFEST\&.MF\fR file is created when the \f3jarsigner\fR command signs a zip file\&.
+-.PP
+-The default \f3jarsigner\fR command behavior is to sign a JAR or zip file\&. Use the \f3-verify\fR option to verify a signed JAR file\&.
+-.PP
+-The \f3jarsigner\fR command also attempts to validate the signer\&'s certificate after signing or verifying\&. If there is a validation error or any other problem, the command generates warning messages\&. If you specify the \f3-strict\fR option, then the command treats severe warnings as errors\&. See Errors and Warnings\&.
+-.SS KEYSTORE\ ALIASES
+-All keystore entities are accessed with unique aliases\&.
+-.PP
+-When you use the \f3jarsigner\fR command to sign a JAR file, you must specify the alias for the keystore entry that contains the private key needed to generate the signature\&. For example, the following command signs the JAR file named \f3MyJARFile\&.jar\fR with the private key associated with the alias \f3duke\fR in the keystore named \f3mystore\fR in the \f3working\fR directory\&. Because no output file is specified, it overwrites \f3MyJARFile\&.jar\fR with the signed JAR file\&.
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore \-storepass <keystore password>\fP
+-.fi
+-.nf
+-\f3 \-keypass <private key password> MyJARFile\&.jar duke\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Keystores are protected with a password, so the store password must be specified\&. You are prompted for it when you do not specify it on the command line\&. Similarly, private keys are protected in a keystore with a password, so the private key\&'s password must be specified, and you are prompted for the password when you do not specify it on the command line and it is not the same as the store password\&.
+-.SS KEYSTORE\ LOCATION
+-The \f3jarsigner\fR command has a \f3-keystore\fR option for specifying the URL of the keystore to be used\&. The keystore is by default stored in a file named \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
+-.PP
+-On Oracle Solaris systems, \f3user\&.home\fR defaults to the user\&'s home directory\&.
+-.PP
+-The input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified when the \f3KeyStore\fR class is not file based, for example, when it resides on a hardware token device\&.
+-.SS KEYSTORE\ IMPLEMENTATION
+-The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies a number of well-defined interfaces to access and modify the information in a keystore\&. You can have multiple different concrete implementations, where each implementation is for a particular type of keystore\&.
+-.PP
+-Currently, there are two command-line tools that use keystore implementations (\f3keytool\fR and \f3jarsigner\fR), and a GUI-based tool named Policy Tool\&. Because the \f3KeyStore\fR class is publicly available, JDK users can write additional security applications that use it\&.
+-.PP
+-There is a built-in default implementation provided by Oracle that implements the keystore as a file, that uses a proprietary keystore type (format) named JKS\&. The built-in implementation protects each private key with its individual password and protects the integrity of the entire keystore with a (possibly different) password\&.
+-.PP
+-Keystore implementations are provider-based, which means the application interfaces supplied by the \f3KeyStore\fR class are implemented in terms of a Service Provider Interface (SPI)\&. There is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, that defines the Service Provider Interface methods that providers must implement\&. The term provider refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
+-.PP
+-Applications can choose different types of keystore implementations from different providers, with the \f3getInstance\fR factory method in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself\&. Keystore implementations of different types are not compatible\&.
+-.PP
+-The \f3jarsigner\fR and \f3policytool\fR commands can read file-based keystores from any location that can be specified using a URL\&. In addition, these commands can read non-file-based keystores such as those provided by MSCAPI on Windows and PKCS11 on all platforms\&.
+-.PP
+-For the \f3jarsigner\fR and \f3keytool\fR commands, you can specify a keystore type at the command line with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIEdit\fR command in the \fIKeyStore\fR menu\&.
+-.PP
+-If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and it resides in the JDK security properties directory, \f3java\&.home/lib/security\fR, where \f3java\&.home\fR is the runtime environment\&'s directory\&. The \f3jre\fR directory in the JDK or the top-level directory of the Java Runtime Environment (JRE)\&.
+-.PP
+-Each tool gets the \f3keystore\&.type\fR value and then examines all the installed providers until it finds one that implements keystores of that type\&. It then uses the keystore implementation from that provider\&.
+-.PP
+-The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type property\fR:
+-.sp
+-.nf
+-\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The default keystore type is \f3jks\fR (the proprietary type of the keystore implementation provided by Oracle)\&. This is specified by the following line in the security properties file:
+-.sp
+-.nf
+-\f3keystore\&.type=jks\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Case does not matter in keystore type designations\&. For example, \f3JKS\fR is the same as \f3jks\fR\&.
+-.PP
+-To have the tools use a keystore implementation other than the default, change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
+-.sp
+-.nf
+-\f3keystore\&.type=pkcs12\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-\fINote:\fR If you use the PKCS 11 provider package, then see "KeyTool" and "JarSigner" in Java PKCS #11 Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.html
+-.SS SUPPORTED\ ALGORITHMS
+-By default, the \f3jarsigner\fR command signs a JAR file using one of the following algorithms:
+-.TP 0.2i
+-\(bu
+-Digital Signature Algorithm (DSA) with the SHA1 digest algorithm
+-.TP 0.2i
+-\(bu
+-RSA algorithm with the SHA256 digest algorithm
+-.TP 0.2i
+-\(bu
+-Elliptic Curve (EC) cryptography algorithm with the SHA256 with Elliptic Curve Digital Signature Algorithm (ECDSA)\&.
+-.PP
+-If the signer\&'s public and private keys are DSA keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA1withDSA\fR algorithm\&. If the signer\&'s keys are RSA keys, then \f3jarsigner\fR attempts to sign the JAR file with the \f3SHA256withRSA\fR algorithm\&. If the signer\&'s keys are EC keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA256withECDSA\fR algorithm\&.
+-.PP
+-These default signature algorithms can be overridden using the \f3-sigalg\fR option\&.
+-.SS THE\ SIGNED\ JAR\ FILE
+-When the \f3jarsigner\fR command is used to sign a JAR file, the output signed JAR file is exactly the same as the input JAR file, except that it has two additional files placed in the META-INF directory:
+-.TP 0.2i
+-\(bu
+-A signature file with an \f3\&.SF\fR extension
+-.TP 0.2i
+-\(bu
+-A signature block file with a \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR extension
+-.PP
+-The base file names for these two files come from the value of the \f3-sigFile\fR option\&. For example, when the option is \f3-sigFile MKSIGN\fR, the files are named \f3MKSIGN\&.SF\fR and \f3MKSIGN\&.DSA\fR
+-.PP
+-If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to uppercase\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not allowed in a signature file name, then each such character is converted to an underscore (_) character in forming the file name\&. Valid characters include letters, digits, underscores, and hyphens\&.
+-.PP
+-Signature File
+-
+-A signature file (\f3\&.SF\fR file) looks similar to the manifest file that is always included in a JAR file when the \f3jarsigner\fR command is used to sign the file\&. For each source file included in the JAR file, the \f3\&.SF\fR file has three lines, such as in the manifest file, that list the following:
+-.TP 0.2i
+-\(bu
+-File name
+-.TP 0.2i
+-\(bu
+-Name of the digest algorithm (SHA)
+-.TP 0.2i
+-\(bu
+-SHA digest value
+-.PP
+-In the manifest file, the SHA digest value for each source file is the digest (hash) of the binary data in the source file\&. In the \f3\&.SF\fR file, the digest value for a specified source file is the hash of the three lines in the manifest file for the source file\&.
+-.PP
+-The signature file, by default, includes a header with a hash of the whole manifest file\&. The header also contains a hash of the manifest header\&. The presence of the header enables verification optimization\&. See JAR File Verification\&.
+-.PP
+-Signature Block File
+-
+-The \f3\&.SF\fR file is signed and the signature is placed in the signature block file\&. This file also contains, encoded inside it, the certificate or certificate chain from the keystore that authenticates the public key corresponding to the private key used for signing\&. The file has the extension \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR, depending on the digest algorithm used\&.
+-.SS SIGNATURE\ TIME\ STAMP
+-The \f3jarsigner\fR command can generate and store a signature time stamp when signing a JAR file\&. In addition, \f3jarsigner\fR supports alternative signing mechanisms\&. This behavior is optional and is controlled by the user at the time of signing through these options\&. See Options\&.
+-.sp
+-.nf
+-\f3\-tsa \fIurl\fR\fP
+-.fi
+-.nf
+-\f3\-tsacert \fIalias\fR\fP
+-.fi
+-.nf
+-\f3\-altsigner \fIclass\fR\fP
+-.fi
+-.nf
+-\f3\-altsignerpath \fIclasspathlist\fR\fP
+-.fi
+-.nf
+-\f3\-tsapolicyid \fIpolicyid\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS JAR\ FILE\ VERIFICATION
+-A successful JAR file verification occurs when the signatures are valid, and none of the files that were in the JAR file when the signatures were generated have changed since then\&. JAR file verification involves the following steps:
+-.TP 0.4i
+-1\&.
+-Verify the signature of the \f3\&.SF\fR file\&.
+-
+-The verification ensures that the signature stored in each signature block (\f3\&.DSA\fR) file was generated using the private key corresponding to the public key whose certificate (or certificate chain) also appears in the \f3\&.DSA\fR file\&. It also ensures that the signature is a valid signature of the corresponding signature (\f3\&.SF\fR) file, and thus the \f3\&.SF\fR file was not tampered with\&.
+-.TP 0.4i
+-2\&.
+-Verify the digest listed in each entry in the \f3\&.SF\fR file with each corresponding section in the manifest\&.
+-
+-The \f3\&.SF\fR file by default includes a header that contains a hash of the entire manifest file\&. When the header is present, the verification can check to see whether or not the hash in the header matches the hash of the manifest file\&. If there is a match, then verification proceeds to the next step\&.
+-
+-If there is no match, then a less optimized verification is required to ensure that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See Signature File\&.
+-
+-One reason the hash of the manifest file that is stored in the \f3\&.SF\fR file header might not equal the hash of the current manifest file is that one or more files were added to the JAR file (with the \f3jar\fR tool) after the signature and \f3\&.SF\fR file were generated\&. When the \f3jar\fR tool is used to add files, the manifest file is changed by adding sections to it for the new files, but the \f3\&.SF\fR file is not changed\&. A verification is still considered successful when none of the files that were in the JAR file when the signature was generated have been changed since then\&. This happens when the hashes in the non-header sections of the \f3\&.SF\fR file equal the hashes of the corresponding sections in the manifest file\&.
+-.TP 0.4i
+-3\&.
+-Read each file in the JAR file that has an entry in the \f3\&.SF\fR file\&. While reading, compute the file\&'s digest and compare the result with the digest for this file in the manifest section\&. The digests should be the same or verification fails\&.
+-
+-If any serious verification failures occur during the verification process, then the process is stopped and a security exception is thrown\&. The \f3jarsigner\fR command catches and displays the exception\&.
+-.PP
+-\fINote:\fR You should read any addition warnings (or errors if you specified the \f3-strict\fR option), as well as the content of the certificate (by specifying the \f3-verbose\fR and \f3-certs\fR options) to determine if the signature can be trusted\&.
+-.SS MULTIPLE\ SIGNATURES\ FOR\ A\ JAR\ FILE
+-A JAR file can be signed by multiple people by running the \f3jarsigner\fR command on the file multiple times and specifying the alias for a different person each time, as follows:
+-.sp
+-.nf
+-\f3jarsigner myBundle\&.jar susan\fP
+-.fi
+-.nf
+-\f3jarsigner myBundle\&.jar kevin\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-When a JAR file is signed multiple times, there are multiple \f3\&.SF\fR and \f3\&.DSA\fR files in the resulting JAR file, one pair for each signature\&. In the previous example, the output JAR file includes files with the following names:
+-.sp
+-.nf
+-\f3SUSAN\&.SF\fP
+-.fi
+-.nf
+-\f3SUSAN\&.DSA\fP
+-.fi
+-.nf
+-\f3KEVIN\&.SF\fP
+-.fi
+-.nf
+-\f3KEVIN\&.DSA\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-The following sections describe the various \f3jarsigner\fR options\&. Be aware of the following standards:
+-.TP 0.2i
+-\(bu
+-All option names are preceded by a minus sign (-)\&.
+-.TP 0.2i
+-\(bu
+-The options can be provided in any order\&.
+-.TP 0.2i
+-\(bu
+-Items that are in italics or underlined (option values) represent the actual values that must be supplied\&.
+-.TP 0.2i
+-\(bu
+-The \f3-storepass\fR, \f3-keypass\fR, \f3-sigfile\fR, \f3-sigalg\fR, \f3-digestalg\fR, \f3-signedjar\fR, and TSA-related options are only relevant when signing a JAR file; they are not relevant when verifying a signed JAR file\&. The \f3-keystore\fR option is relevant for signing and verifying a JAR file\&. In addition, aliases are specified when signing and verifying a JAR file\&.
+-.TP
+--keystore \fIurl\fR
+-.br
+-Specifies the URL that tells the keystore location\&. This defaults to the file \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
+-
+-A keystore is required when signing\&. You must explicitly specify a keystore when the default keystore does not exist or if you want to use one other than the default\&.
+-
+-A keystore is not required when verifying, but if one is specified or the default exists and the \f3-verbose\fR option was also specified, then additional information is output regarding whether or not any of the certificates used to verify the JAR file are contained in that keystore\&.
+-
+-The \f3-keystore\fR argument can be a file name and path specification rather than a URL, in which case it is treated the same as a file: URL, for example, the following are equivalent:
+-.sp
+-.nf
+-\f3\-keystore \fIfilePathAndName\fR\fP
+-.fi
+-.nf
+-\f3\-keystore file:\fIfilePathAndName\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-If the Sun PKCS #11 provider was configured in the \f3java\&.security\fR security properties file (located in the JRE\&'s \f3$JAVA_HOME/lib/security directory\fR), then the \f3keytool\fR and \f3jarsigner\fR tools can operate on the PKCS #11 token by specifying these options:
+-.sp
+-.nf
+-\f3\-keystore NONE\fP
+-.fi
+-.nf
+-\f3\-storetype PKCS11\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-For example, the following command lists the contents of the configured PKCS#11 token:
+-.sp
+-.nf
+-\f3keytool \-keystore NONE \-storetype PKCS11 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--storetype \fIstoretype\fR
+-.br
+-Specifies the type of keystore to be instantiated\&. The default keystore type is the one that is specified as the value of the \f3keystore\&.type\fR property in the security properties file, which is returned by the static \f3getDefaultType\fR method in \f3java\&.security\&.KeyStore\fR\&.
+-
+-The PIN for a PCKS #11 token can also be specified with the \f3-storepass\fR option\&. If none is specified, then the \f3keytool\fR and \f3jarsigner\fR commands prompt for the token PIN\&. If the token has a protected authentication path (such as a dedicated PIN-pad or a biometric reader), then the \f3-protected\fR option must be specified and no password options can be specified\&.
+-.TP
+--storepass[:env | :file] \fIargument\fR
+-.br
+-Specifies the password that is required to access the keystore\&. This is only needed when signing (not verifying) a JAR file\&. In that case, if a \f3-storepass\fR option is not provided at the command line, then the user is prompted for the password\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \fIargument\fR\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
+-.RE
+-
+-
+-\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
+-.TP
+--keypass [:env | :file] \fIargument\fR
+-.br
+-Specifies the password used to protect the private key of the keystore entry addressed by the alias specified on the command line\&. The password is required when using \f3jarsigner\fR to sign a JAR file\&. If no password is provided on the command line, and the required password is different from the store password, then the user is prompted for it\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \f3argument\fR\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
+-.RE
+-
+-
+-\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
+-.TP
+--sigfile \fIfile\fR
+-.br
+-Specifies the base file name to be used for the generated \f3\&.SF\fR and \f3\&.DSA\fR files\&. For example, if file is \f3DUKESIGN\fR, then the generated \f3\&.SF\fR and \f3\&.DSA\fR files are named \f3DUKESIGN\&.SF\fR and \f3DUKESIGN\&.DSA\fR, and placed in the \f3META-INF\fR directory of the signed JAR file\&.
+-
+-The characters in the file must come from the set \f3a-zA-Z0-9_-\fR\&. Only letters, numbers, underscore, and hyphen characters are allowed\&. All lowercase characters are converted to uppercase for the \f3\&.SF\fR and \f3\&.DSA\fR file names\&.
+-
+-If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to upper case\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not valid in a signature file name, then each such character is converted to an underscore (_) character to form the file name\&.
+-.TP
+--sigalg \fIalgorithm\fR
+-.br
+-Specifies the name of the signature algorithm to use to sign the JAR file\&.
+-
+-For a list of standard signature algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-
+-This algorithm must be compatible with the private key used to sign the JAR file\&. If this option is not specified, then \f3SHA1withDSA\fR, \f3SHA256withRSA\fR, or \f3SHA256withECDSA\fR are used depending on the type of private key\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
+-.TP
+--digestalg \fIalgorithm\fR
+-.br
+-Specifies the name of the message digest algorithm to use when digesting the entries of a JAR file\&.
+-
+-For a list of standard message digest algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-
+-If this option is not specified, then \f3SHA256\fR is used\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
+-.TP
+--certs
+-.br
+-If the \f3-certs\fR option appears on the command line with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. This information includes the name of the type of certificate (stored in the \f3\&.DSA\fR file) that certifies the signer\&'s public key, and if the certificate is an X\&.509 certificate (an instance of the \f3java\&.security\&.cert\&.X509Certificate\fR), then the distinguished name of the signer\&.
+-
+-The keystore is also examined\&. If no keystore value is specified on the command line, then the default keystore file (if any) is checked\&. If the public key certificate for a signer matches an entry in the keystore, then the alias name for the keystore entry for that signer is displayed in parentheses\&.
+-.TP
+--certchain \fIfile\fR
+-.br
+-Specifies the certificate chain to be used when the certificate chain associated with the private key of the keystore entry that is addressed by the alias specified on the command line is not complete\&. This can happen when the keystore is located on a hardware token where there is not enough capacity to hold a complete certificate chain\&. The file can be a sequence of concatenated X\&.509 certificates, or a single PKCS#7 formatted data block, either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. See Internet RFC 1421 Certificate Encoding Standard and http://tools\&.ietf\&.org/html/rfc1421\&.
+-.TP
+--verbose
+-.br
+-When the \f3-verbose\fR option appears on the command line, it indicates verbose mode, which causes \f3jarsigner\fR to output extra information about the progress of the JAR signing or verification\&.
+-.TP
+--internalsf
+-.br
+-In the past, the \f3\&.DSA\fR (signature block) file generated when a JAR file was signed included a complete encoded copy of the \f3\&.SF\fR file (signature file) also generated\&. This behavior has been changed\&. To reduce the overall size of the output JAR file, the \f3\&.DSA\fR file by default does not contain a copy of the \f3\&.SF\fR file anymore\&. If \f3-internalsf\fR appears on the command line, then the old behavior is utilized\&. This option is useful for testing\&. In practice, do not use the \f3-internalsf\fR option because it incurs higher overhead\&.
+-.TP
+--sectionsonly
+-.br
+-If the \f3-sectionsonly\fR option appears on the command line, then the \f3\&.SF\fR file (signature file) generated when a JAR file is signed does not include a header that contains a hash of the whole manifest file\&. It contains only the information and hashes related to each individual source file included in the JAR file\&. See Signature File\&.
+-
+-By default, this header is added, as an optimization\&. When the header is present, whenever the JAR file is verified, the verification can first check to see whether the hash in the header matches the hash of the whole manifest file\&. When there is a match, verification proceeds to the next step\&. When there is no match, it is necessary to do a less optimized verification that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See JAR File Verification\&.
+-
+-The \f3-sectionsonly\fR option is primarily used for testing\&. It should not be used other than for testing because using it incurs higher overhead\&.
+-.TP
+--protected
+-.br
+-Values can be either \f3true\fR or \f3false\fR\&. Specify \f3true\fR when a password must be specified through a protected authentication path such as a dedicated PIN reader\&.
+-.TP
+--providerClass \fIprovider-class-name\fR
+-.br
+-Used to specify the name of cryptographic service provider\&'s master class file when the service provider is not listed in the \f3java\&.security\fR security properties file\&.
+-
+-Used with the \f3-providerArg ConfigFilePath\fR option, the \f3keytool\fR and \f3jarsigner\fR tools install the provider dynamically and use \fIConfigFilePath\fR for the path to the token configuration file\&. The following example shows a command to list a \f3PKCS #11\fR keystore when the Oracle PKCS #11 provider was not configured in the security properties file\&.
+-.sp
+-.nf
+-\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerClass sun\&.security\&.pkcs11\&.SunPKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerArg /mydir1/mydir2/token\&.config \e\fP
+-.fi
+-.nf
+-\f3 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--providerName \fIproviderName\fR
+-.br
+-If more than one provider was configured in the \f3java\&.security\fR security properties file, then you can use the \f3-providerName\fR option to target a specific provider instance\&. The argument to this option is the name of the provider\&.
+-
+-For the Oracle PKCS #11 provider, \fIproviderName\fR is of the form \f3SunPKCS11-\fR\fITokenName\fR, where \fITokenName\fR is the name suffix that the provider instance has been configured with, as detailed in the configuration attributes table\&. For example, the following command lists the contents of the \f3PKCS #11\fR keystore provider instance with name suffix \f3SmartCard\fR:
+-.sp
+-.nf
+-\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerName SunPKCS11\-SmartCard \e\fP
+-.fi
+-.nf
+-\f3 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--J\fIjavaoption\fR
+-.br
+-Passes through the specified \fIjavaoption\fR string directly to the Java interpreter\&. The \f3jarsigner\fR command is a wrapper around the interpreter\&. This option should not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
+-.TP
+--tsa \fIurl\fR
+-.br
+-If \f3-tsa http://example\&.tsa\&.url\fR appears on the command line when signing a JAR file then a time stamp is generated for the signature\&. The URL, \f3http://example\&.tsa\&.url\fR, identifies the location of the Time Stamping Authority (TSA) and overrides any URL found with the \f3-tsacert\fR option\&. The \f3-tsa\fR option does not require the TSA public key certificate to be present in the keystore\&.
+-
+-To generate the time stamp, \f3jarsigner\fR communicates with the TSA with the Time-Stamp Protocol (TSP) defined in RFC 3161\&. When successful, the time stamp token returned by the TSA is stored with the signature in the signature block file\&.
+-.TP
+--tsacert \fIalias\fR
+-.br
+-When \f3-tsacert alias\fR appears on the command line when signing a JAR file, a time stamp is generated for the signature\&. The alias identifies the TSA public key certificate in the keystore that is in effect\&. The entry\&'s certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA\&.
+-
+-The TSA public key certificate must be present in the keystore when using the \f3-tsacert\fR option\&.
+-.TP
+--tsapolicyid \fIpolicyid\fR
+-.br
+-Specifies the object identifier (OID) that identifies the policy ID to be sent to the TSA server\&. If this option is not specified, no policy ID is sent and the TSA server will choose a default policy ID\&.
+-
+-Object identifiers are defined by X\&.696, which is an ITU Telecommunication Standardization Sector (ITU-T) standard\&. These identifiers are typically period-separated sets of non-negative digits like \f31\&.2\&.3\&.4\fR, for example\&.
+-.TP
+--altsigner \fIclass\fR
+-.br
+-This option specifies an alternative signing mechanism\&. The fully qualified class name identifies a class file that extends the \f3com\&.sun\&.jarsigner\&.ContentSigner\fR abstract class\&. The path to this class file is defined by the \f3-altsignerpath\fR option\&. If the \f3-altsigner\fR option is used, then the \f3jarsigner\fR command uses the signing mechanism provided by the specified class\&. Otherwise, the \f3jarsigner\fR command uses its default signing mechanism\&.
+-
+-For example, to use the signing mechanism provided by a class named \f3com\&.sun\&.sun\&.jarsigner\&.AuthSigner\fR, use the jarsigner option \f3-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fR\&.
+-.TP
+--altsignerpath \fIclasspathlist\fR
+-.br
+-Specifies the path to the class file and any JAR file it depends on\&. The class file name is specified with the \f3-altsigner\fR option\&. If the class file is in a JAR file, then this option specifies the path to that JAR file\&.
+-
+-An absolute path or a path relative to the current directory can be specified\&. If \fIclasspathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semicolon (;) on Windows\&. This option is not necessary when the class is already in the search path\&.
+-
+-The following example shows how to specify the path to a JAR file that contains the class file\&. The JAR file name is included\&.
+-.sp
+-.nf
+-\f3\-altsignerpath /home/user/lib/authsigner\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-The following example shows how to specify the path to the JAR file that contains the class file\&. The JAR file name is omitted\&.
+-.sp
+-.nf
+-\f3\-altsignerpath /home/user/classes/com/sun/tools/jarsigner/\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--strict
+-.br
+-During the signing or verifying process, the command may issue warning messages\&. If you specify this option, the exit code of the tool reflects the severe warning messages that this command found\&. See Errors and Warnings\&.
+-.TP
+--verbose \fIsuboptions\fR
+-.br
+-For the verifying process, the \f3-verbose\fR option takes suboptions to determine how much information is shown\&. If the \f3-certs\fR option is also specified, then the default mode (or suboption \f3all\fR) displays each entry as it is being processed, and after that, the certificate information for each signer of the JAR file\&. If the \f3-certs\fR and the \f3-verbose:grouped\fR suboptions are specified, then entries with the same signer info are grouped and displayed together with their certificate information\&. If \f3-certs\fR and the \f3-verbose:summary\fR suboptions are specified, then entries with the same signer information are grouped and displayed together with their certificate information\&. Details about each entry are summarized and displayed as \fIone entry (and more)\fR\&. See Examples\&.
+-.SH ERRORS\ AND\ WARNINGS
+-During the signing or verifying process, the \f3jarsigner\fR command may issue various errors or warnings\&.
+-.PP
+-If there is a failure, the \f3jarsigner\fR command exits with code 1\&. If there is no failure, but there are one or more severe warnings, the \f3jarsigner\fR command exits with code 0 when the \f3-strict\fR option is \fInot\fR specified, or exits with the OR-value of the warning codes when the \f3-strict\fR is specified\&. If there is only informational warnings or no warning at all, the command always exits with code 0\&.
+-.PP
+-For example, if a certificate used to sign an entry is expired and has a KeyUsage extension that does not allow it to sign a file, the \f3jarsigner\fR command exits with code 12 (=4+8) when the \f3-strict\fR option is specified\&.
+-.PP
+-\fINote:\fR Exit codes are reused because only the values from 0 to 255 are legal on Unix-based operating systems\&.
+-.PP
+-The following sections describes the names, codes, and descriptions of the errors and warnings that the \f3jarsigner\fR command can issue\&.
+-.SS FAILURE
+-Reasons why the \f3jarsigner\fR command fails include (but are not limited to) a command line parsing error, the inability to find a keypair to sign the JAR file, or the verification of a signed JAR fails\&.
+-.TP
+-failure
+-Code 1\&. The signing or verifying fails\&.
+-.SS SEVERE\ WARNINGS
+-\fINote:\fR Severe warnings are reported as errors if you specify the \f3-strict\fR option\&.
+-.PP
+-Reasons why the \f3jarsigner\fR command issues a severe warning include the certificate used to sign the JAR file has an error or the signed JAR file has other problems\&.
+-.TP
+-hasExpiredCert
+-Code 4\&. This jar contains entries whose signer certificate has expired\&.
+-.TP
+-notYetValidCert
+-Code 4\&. This jar contains entries whose signer certificate is not yet valid\&.
+-.TP
+-chainNotValidated
+-Code 4\&. This jar contains entries whose certificate chain cannot be correctly validated\&.
+-.TP
+-badKeyUsage
+-Code 8\&. This jar contains entries whose signer certificate\&'s KeyUsage extension doesn\&'t allow code signing\&.
+-.TP
+-badExtendedKeyUsage
+-Code 8\&. This jar contains entries whose signer certificate\&'s ExtendedKeyUsage extension doesn\&'t allow code signing\&.
+-.TP
+-badNetscapeCertType
+-Code 8\&. This jar contains entries whose signer certificate\&'s NetscapeCertType extension doesn\&'t allow code signing\&.
+-.TP
+-hasUnsignedEntry
+-Code 16\&. This jar contains unsigned entries which have not been integrity-checked\&.
+-.TP
+-notSignedByAlias
+-Code 32\&. This jar contains signed entries which are not signed by the specified alias(es)\&.
+-.TP
+-aliasNotInStore
+-Code 32\&. This jar contains signed entries that are not signed by alias in this keystore\&.
+-.SS INFORMATIONAL\ WARNINGS
+-Informational warnings include those that are not errors but regarded as bad practice\&. They do not have a code\&.
+-.TP
+-hasExpiringCert
+-This jar contains entries whose signer certificate will expire within six months\&.
+-.TP
+-noTimestamp
+-This jar contains signatures that does not include a timestamp\&. Without a timestamp, users may not be able to validate this JAR file after the signer certificate\&'s expiration date (\f3YYYY-MM-DD\fR) or after any future revocation date\&.
+-.SH EXAMPLES
+-.SS SIGN\ A\ JAR\ FILE
+-Use the following command to sign bundle\&.jar with the private key of a user whose keystore alias is \f3jane\fR in a keystore named \f3mystore\fR in the \f3working\fR directory and name the signed JAR file \f3sbundle\&.jar\fR:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore\fP
+-.fi
+-.nf
+-\f3 \-storepass <keystore password>\fP
+-.fi
+-.nf
+-\f3 \-keypass <private key password>\fP
+-.fi
+-.nf
+-\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There is no \f3-sigfile\fR specified in the previous command so the generated \f3\&.SF\fR and \f3\&.DSA\fR files to be placed in the signed JAR file have default names based on the alias name\&. They are named \f3JANE\&.SF\fR and \f3JANE\&.DSA\fR\&.
+-.PP
+-If you want to be prompted for the store password and the private key password, then you could shorten the previous command to the following:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore\fP
+-.fi
+-.nf
+-\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If the keystore is the default keystore (\&.keystore in your home directory), then you do not need to specify a keystore, as follows:
+-.sp
+-.nf
+-\f3jarsigner \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you want the signed JAR file to overwrite the input JAR file (bundle\&.jar), then you do not need to specify a \f3-signedjar\fR option, as follows:
+-.sp
+-.nf
+-\f3jarsigner bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS VERIFY\ A\ SIGNED\ JAR\ FILE
+-To verify a signed JAR file to ensure that the signature is valid and the JAR file was not been tampered with, use a command such as the following:
+-.sp
+-.nf
+-\f3jarsigner \-verify sbundle\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-When the verification is successful, \f3jar verified\fR is displayed\&. Otherwise, an error message is displayed\&. You can get more information when you use the \f3-verbose\fR option\&. A sample use of \f3jarsigner\fR with the\f3-verbose\fR option follows:
+-.sp
+-.nf
+-\f3jarsigner \-verify \-verbose sbundle\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
+-.fi
+-.nf
+-\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
+-.fi
+-.nf
+-\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 AclEx\&.class\fP
+-.fi
+-.nf
+-\f3 smk 849 Fri Sep 26 16:12:46 PDT 1997 test\&.class\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 s = signature was verified\fP
+-.fi
+-.nf
+-\f3 m = entry is listed in manifest\fP
+-.fi
+-.nf
+-\f3 k = at least one certificate was found in keystore\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 jar verified\&.\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS VERIFICATION\ WITH\ CERTIFICATE\ INFORMATION
+-If you specify the \f3-certs\fR option with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. The information includes the certificate type, the signer distinguished name information (when it is an X\&.509 certificate), and in parentheses, the keystore alias for the signer when the public key certificate in the JAR file matches the one in a keystore entry, for example:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore \-verify \-verbose \-certs myTest\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
+-.fi
+-.nf
+-\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
+-.fi
+-.nf
+-\f3 208 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.SF\fP
+-.fi
+-.nf
+-\f3 1087 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.DSA\fP
+-.fi
+-.nf
+-\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 Tst\&.class\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 X\&.509, CN=Test Group, OU=Java Software, O=Oracle, L=CUP, S=CA, C=US (javatest)\fP
+-.fi
+-.nf
+-\f3 X\&.509, CN=Jane Smith, OU=Java Software, O=Oracle, L=cup, S=ca, C=us (jane)\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 s = signature was verified\fP
+-.fi
+-.nf
+-\f3 m = entry is listed in manifest\fP
+-.fi
+-.nf
+-\f3 k = at least one certificate was found in keystore\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 jar verified\&.\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If the certificate for a signer is not an X\&.509 certificate, then there is no distinguished name information\&. In that case, just the certificate type and the alias are shown\&. For example, if the certificate is a PGP certificate, and the alias is \f3bob\fR, then you would get: \f3PGP, (bob)\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-keytool(1)
+-.TP 0.2i
+-\(bu
+-Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
++
++.SH NAME
++jarsigner \- Signs and verifies Java Archive (JAR) files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjarsigner\fR [ \fIoptions\fR ] \fIjar\-file\fR \fIalias\fR
++.fi
++.nf
++
++\fBjarsigner\fR \fB\-verify\fR [ \fIoptions\fR ] \fIjar\-file\fR [\fIalias \&.\&.\&.\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++-verify
++.br
++The \f3-verify\fR option can take zero or more keystore alias names after the JAR file name\&. When the \f3-verify\fR option is specified, the \f3jarsigner\fR command checks that the certificate used to verify each signed entry in the JAR file matches one of the keystore aliases\&. The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
++
++If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar verified, with signer errors" is displayed\&.
++.TP
++\fIjar-file\fR
++The JAR file to be signed\&.
++
++If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar signed, with signer errors" is displayed\&.
++.TP
++\fIalias\fR
++The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
++.SH DESCRIPTION
++The \f3jarsigner\fR tool has two purposes:
++.TP 0.2i
++\(bu
++To sign Java Archive (JAR) files\&.
++.TP 0.2i
++\(bu
++To verify the signatures and integrity of signed JAR files\&.
++.PP
++The JAR feature enables the packaging of class files, images, sounds, and other digital data in a single file for faster and easier distribution\&. A tool named \f3jar\fR enables developers to produce JAR files\&. (Technically, any zip file can also be considered a JAR file, although when created by the \f3jar\fR command or processed by the \f3jarsigner\fR command, JAR files also contain a \f3META-INF/MANIFEST\&.MF\fR file\&.)
++.PP
++A digital signature is a string of bits that is computed from some data (the data being signed) and the private key of an entity (a person, company, and so on)\&. Similar to a handwritten signature, a digital signature has many useful characteristics:
++.TP 0.2i
++\(bu
++Its authenticity can be verified by a computation that uses the public key corresponding to the private key used to generate the signature\&.
++.TP 0.2i
++\(bu
++It cannot be forged, assuming the private key is kept secret\&.
++.TP 0.2i
++\(bu
++It is a function of the data signed and thus cannot be claimed to be the signature for other data as well\&.
++.TP 0.2i
++\(bu
++The signed data cannot be changed\&. If the data is changed, then the signature cannot be verified as authentic\&.
++.PP
++To generate an entity\&'s signature for a file, the entity must first have a public/private key pair associated with it and one or more certificates that authenticate its public key\&. A certificate is a digitally signed statement from one entity that says that the public key of another entity has a particular value\&.
++.PP
++The \f3jarsigner\fR command uses key and certificate information from a keystore to generate digital signatures for JAR files\&. A keystore is a database of private keys and their associated X\&.509 certificate chains that authenticate the corresponding public keys\&. The \f3keytool\fR command is used to create and administer keystores\&.
++.PP
++The \f3jarsigner\fR command uses an entity\&'s private key to generate a signature\&. The signed JAR file contains, among other things, a copy of the certificate from the keystore for the public key corresponding to the private key used to sign the file\&. The \f3jarsigner\fR command can verify the digital signature of the signed JAR file using the certificate inside it (in its signature block file)\&.
++.PP
++The \f3jarsigner\fR command can generate signatures that include a time stamp that lets a systems or deployer (including Java Plug-in) to check whether the JAR file was signed while the signing certificate was still valid\&. In addition, APIs allow applications to obtain the timestamp information\&.
++.PP
++At this time, the \f3jarsigner\fR command can only sign JAR files created by the \f3jar\fR command or zip files\&. JAR files are the same as zip files, except they also have a \f3META-INF/MANIFEST\&.MF\fR file\&. A \f3META-INF/MANIFEST\&.MF\fR file is created when the \f3jarsigner\fR command signs a zip file\&.
++.PP
++The default \f3jarsigner\fR command behavior is to sign a JAR or zip file\&. Use the \f3-verify\fR option to verify a signed JAR file\&.
++.PP
++The \f3jarsigner\fR command also attempts to validate the signer\&'s certificate after signing or verifying\&. If there is a validation error or any other problem, the command generates warning messages\&. If you specify the \f3-strict\fR option, then the command treats severe warnings as errors\&. See Errors and Warnings\&.
++.SS KEYSTORE\ ALIASES
++All keystore entities are accessed with unique aliases\&.
++.PP
++When you use the \f3jarsigner\fR command to sign a JAR file, you must specify the alias for the keystore entry that contains the private key needed to generate the signature\&. For example, the following command signs the JAR file named \f3MyJARFile\&.jar\fR with the private key associated with the alias \f3duke\fR in the keystore named \f3mystore\fR in the \f3working\fR directory\&. Because no output file is specified, it overwrites \f3MyJARFile\&.jar\fR with the signed JAR file\&.
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore \-storepass <keystore password>\fP
++.fi
++.nf
++\f3 \-keypass <private key password> MyJARFile\&.jar duke\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Keystores are protected with a password, so the store password must be specified\&. You are prompted for it when you do not specify it on the command line\&. Similarly, private keys are protected in a keystore with a password, so the private key\&'s password must be specified, and you are prompted for the password when you do not specify it on the command line and it is not the same as the store password\&.
++.SS KEYSTORE\ LOCATION
++The \f3jarsigner\fR command has a \f3-keystore\fR option for specifying the URL of the keystore to be used\&. The keystore is by default stored in a file named \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
++.PP
++On Oracle Solaris systems, \f3user\&.home\fR defaults to the user\&'s home directory\&.
++.PP
++The input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified when the \f3KeyStore\fR class is not file based, for example, when it resides on a hardware token device\&.
++.SS KEYSTORE\ IMPLEMENTATION
++The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies a number of well-defined interfaces to access and modify the information in a keystore\&. You can have multiple different concrete implementations, where each implementation is for a particular type of keystore\&.
++.PP
++Currently, there are two command-line tools that use keystore implementations (\f3keytool\fR and \f3jarsigner\fR), and a GUI-based tool named Policy Tool\&. Because the \f3KeyStore\fR class is publicly available, JDK users can write additional security applications that use it\&.
++.PP
++There is a built-in default implementation provided by Oracle that implements the keystore as a file, that uses a proprietary keystore type (format) named JKS\&. The built-in implementation protects each private key with its individual password and protects the integrity of the entire keystore with a (possibly different) password\&.
++.PP
++Keystore implementations are provider-based, which means the application interfaces supplied by the \f3KeyStore\fR class are implemented in terms of a Service Provider Interface (SPI)\&. There is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, that defines the Service Provider Interface methods that providers must implement\&. The term provider refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
++.PP
++Applications can choose different types of keystore implementations from different providers, with the \f3getInstance\fR factory method in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself\&. Keystore implementations of different types are not compatible\&.
++.PP
++The \f3jarsigner\fR and \f3policytool\fR commands can read file-based keystores from any location that can be specified using a URL\&. In addition, these commands can read non-file-based keystores such as those provided by MSCAPI on Windows and PKCS11 on all platforms\&.
++.PP
++For the \f3jarsigner\fR and \f3keytool\fR commands, you can specify a keystore type at the command line with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIEdit\fR command in the \fIKeyStore\fR menu\&.
++.PP
++If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and it resides in the JDK security properties directory, \f3java\&.home/lib/security\fR, where \f3java\&.home\fR is the runtime environment\&'s directory\&. The \f3jre\fR directory in the JDK or the top-level directory of the Java Runtime Environment (JRE)\&.
++.PP
++Each tool gets the \f3keystore\&.type\fR value and then examines all the installed providers until it finds one that implements keystores of that type\&. It then uses the keystore implementation from that provider\&.
++.PP
++The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type property\fR:
++.sp
++.nf
++\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The default keystore type is \f3jks\fR (the proprietary type of the keystore implementation provided by Oracle)\&. This is specified by the following line in the security properties file:
++.sp
++.nf
++\f3keystore\&.type=jks\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Case does not matter in keystore type designations\&. For example, \f3JKS\fR is the same as \f3jks\fR\&.
++.PP
++To have the tools use a keystore implementation other than the default, change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
++.sp
++.nf
++\f3keystore\&.type=pkcs12\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++\fINote:\fR If you use the PKCS 11 provider package, then see "KeyTool" and "JarSigner" in Java PKCS #11 Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.html
++.SS SUPPORTED\ ALGORITHMS
++By default, the \f3jarsigner\fR command signs a JAR file using one of the following algorithms:
++.TP 0.2i
++\(bu
++Digital Signature Algorithm (DSA) with the SHA1 digest algorithm
++.TP 0.2i
++\(bu
++RSA algorithm with the SHA256 digest algorithm
++.TP 0.2i
++\(bu
++Elliptic Curve (EC) cryptography algorithm with the SHA256 with Elliptic Curve Digital Signature Algorithm (ECDSA)\&.
++.PP
++If the signer\&'s public and private keys are DSA keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA1withDSA\fR algorithm\&. If the signer\&'s keys are RSA keys, then \f3jarsigner\fR attempts to sign the JAR file with the \f3SHA256withRSA\fR algorithm\&. If the signer\&'s keys are EC keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA256withECDSA\fR algorithm\&.
++.PP
++These default signature algorithms can be overridden using the \f3-sigalg\fR option\&.
++.SS THE\ SIGNED\ JAR\ FILE
++When the \f3jarsigner\fR command is used to sign a JAR file, the output signed JAR file is exactly the same as the input JAR file, except that it has two additional files placed in the META-INF directory:
++.TP 0.2i
++\(bu
++A signature file with an \f3\&.SF\fR extension
++.TP 0.2i
++\(bu
++A signature block file with a \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR extension
++.PP
++The base file names for these two files come from the value of the \f3-sigFile\fR option\&. For example, when the option is \f3-sigFile MKSIGN\fR, the files are named \f3MKSIGN\&.SF\fR and \f3MKSIGN\&.DSA\fR
++.PP
++If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to uppercase\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not allowed in a signature file name, then each such character is converted to an underscore (_) character in forming the file name\&. Valid characters include letters, digits, underscores, and hyphens\&.
++.PP
++Signature File
++
++A signature file (\f3\&.SF\fR file) looks similar to the manifest file that is always included in a JAR file when the \f3jarsigner\fR command is used to sign the file\&. For each source file included in the JAR file, the \f3\&.SF\fR file has three lines, such as in the manifest file, that list the following:
++.TP 0.2i
++\(bu
++File name
++.TP 0.2i
++\(bu
++Name of the digest algorithm (SHA)
++.TP 0.2i
++\(bu
++SHA digest value
++.PP
++In the manifest file, the SHA digest value for each source file is the digest (hash) of the binary data in the source file\&. In the \f3\&.SF\fR file, the digest value for a specified source file is the hash of the three lines in the manifest file for the source file\&.
++.PP
++The signature file, by default, includes a header with a hash of the whole manifest file\&. The header also contains a hash of the manifest header\&. The presence of the header enables verification optimization\&. See JAR File Verification\&.
++.PP
++Signature Block File
++
++The \f3\&.SF\fR file is signed and the signature is placed in the signature block file\&. This file also contains, encoded inside it, the certificate or certificate chain from the keystore that authenticates the public key corresponding to the private key used for signing\&. The file has the extension \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR, depending on the digest algorithm used\&.
++.SS SIGNATURE\ TIME\ STAMP
++The \f3jarsigner\fR command can generate and store a signature time stamp when signing a JAR file\&. In addition, \f3jarsigner\fR supports alternative signing mechanisms\&. This behavior is optional and is controlled by the user at the time of signing through these options\&. See Options\&.
++.sp
++.nf
++\f3\-tsa \fIurl\fR\fP
++.fi
++.nf
++\f3\-tsacert \fIalias\fR\fP
++.fi
++.nf
++\f3\-altsigner \fIclass\fR\fP
++.fi
++.nf
++\f3\-altsignerpath \fIclasspathlist\fR\fP
++.fi
++.nf
++\f3\-tsapolicyid \fIpolicyid\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS JAR\ FILE\ VERIFICATION
++A successful JAR file verification occurs when the signatures are valid, and none of the files that were in the JAR file when the signatures were generated have changed since then\&. JAR file verification involves the following steps:
++.TP 0.4i
++1\&.
++Verify the signature of the \f3\&.SF\fR file\&.
++
++The verification ensures that the signature stored in each signature block (\f3\&.DSA\fR) file was generated using the private key corresponding to the public key whose certificate (or certificate chain) also appears in the \f3\&.DSA\fR file\&. It also ensures that the signature is a valid signature of the corresponding signature (\f3\&.SF\fR) file, and thus the \f3\&.SF\fR file was not tampered with\&.
++.TP 0.4i
++2\&.
++Verify the digest listed in each entry in the \f3\&.SF\fR file with each corresponding section in the manifest\&.
++
++The \f3\&.SF\fR file by default includes a header that contains a hash of the entire manifest file\&. When the header is present, the verification can check to see whether or not the hash in the header matches the hash of the manifest file\&. If there is a match, then verification proceeds to the next step\&.
++
++If there is no match, then a less optimized verification is required to ensure that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See Signature File\&.
++
++One reason the hash of the manifest file that is stored in the \f3\&.SF\fR file header might not equal the hash of the current manifest file is that one or more files were added to the JAR file (with the \f3jar\fR tool) after the signature and \f3\&.SF\fR file were generated\&. When the \f3jar\fR tool is used to add files, the manifest file is changed by adding sections to it for the new files, but the \f3\&.SF\fR file is not changed\&. A verification is still considered successful when none of the files that were in the JAR file when the signature was generated have been changed since then\&. This happens when the hashes in the non-header sections of the \f3\&.SF\fR file equal the hashes of the corresponding sections in the manifest file\&.
++.TP 0.4i
++3\&.
++Read each file in the JAR file that has an entry in the \f3\&.SF\fR file\&. While reading, compute the file\&'s digest and compare the result with the digest for this file in the manifest section\&. The digests should be the same or verification fails\&.
++
++If any serious verification failures occur during the verification process, then the process is stopped and a security exception is thrown\&. The \f3jarsigner\fR command catches and displays the exception\&.
++.PP
++\fINote:\fR You should read any addition warnings (or errors if you specified the \f3-strict\fR option), as well as the content of the certificate (by specifying the \f3-verbose\fR and \f3-certs\fR options) to determine if the signature can be trusted\&.
++.SS MULTIPLE\ SIGNATURES\ FOR\ A\ JAR\ FILE
++A JAR file can be signed by multiple people by running the \f3jarsigner\fR command on the file multiple times and specifying the alias for a different person each time, as follows:
++.sp
++.nf
++\f3jarsigner myBundle\&.jar susan\fP
++.fi
++.nf
++\f3jarsigner myBundle\&.jar kevin\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++When a JAR file is signed multiple times, there are multiple \f3\&.SF\fR and \f3\&.DSA\fR files in the resulting JAR file, one pair for each signature\&. In the previous example, the output JAR file includes files with the following names:
++.sp
++.nf
++\f3SUSAN\&.SF\fP
++.fi
++.nf
++\f3SUSAN\&.DSA\fP
++.fi
++.nf
++\f3KEVIN\&.SF\fP
++.fi
++.nf
++\f3KEVIN\&.DSA\fP
++.fi
++.sp
++.SH OPTIONS
++The following sections describe the various \f3jarsigner\fR options\&. Be aware of the following standards:
++.TP 0.2i
++\(bu
++All option names are preceded by a minus sign (-)\&.
++.TP 0.2i
++\(bu
++The options can be provided in any order\&.
++.TP 0.2i
++\(bu
++Items that are in italics or underlined (option values) represent the actual values that must be supplied\&.
++.TP 0.2i
++\(bu
++The \f3-storepass\fR, \f3-keypass\fR, \f3-sigfile\fR, \f3-sigalg\fR, \f3-digestalg\fR, \f3-signedjar\fR, and TSA-related options are only relevant when signing a JAR file; they are not relevant when verifying a signed JAR file\&. The \f3-keystore\fR option is relevant for signing and verifying a JAR file\&. In addition, aliases are specified when signing and verifying a JAR file\&.
++.TP
++-keystore \fIurl\fR
++.br
++Specifies the URL that tells the keystore location\&. This defaults to the file \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
++
++A keystore is required when signing\&. You must explicitly specify a keystore when the default keystore does not exist or if you want to use one other than the default\&.
++
++A keystore is not required when verifying, but if one is specified or the default exists and the \f3-verbose\fR option was also specified, then additional information is output regarding whether or not any of the certificates used to verify the JAR file are contained in that keystore\&.
++
++The \f3-keystore\fR argument can be a file name and path specification rather than a URL, in which case it is treated the same as a file: URL, for example, the following are equivalent:
++.sp
++.nf
++\f3\-keystore \fIfilePathAndName\fR\fP
++.fi
++.nf
++\f3\-keystore file:\fIfilePathAndName\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++If the Sun PKCS #11 provider was configured in the \f3java\&.security\fR security properties file (located in the JRE\&'s \f3$JAVA_HOME/lib/security directory\fR), then the \f3keytool\fR and \f3jarsigner\fR tools can operate on the PKCS #11 token by specifying these options:
++.sp
++.nf
++\f3\-keystore NONE\fP
++.fi
++.nf
++\f3\-storetype PKCS11\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++For example, the following command lists the contents of the configured PKCS#11 token:
++.sp
++.nf
++\f3keytool \-keystore NONE \-storetype PKCS11 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-storetype \fIstoretype\fR
++.br
++Specifies the type of keystore to be instantiated\&. The default keystore type is the one that is specified as the value of the \f3keystore\&.type\fR property in the security properties file, which is returned by the static \f3getDefaultType\fR method in \f3java\&.security\&.KeyStore\fR\&.
++
++The PIN for a PCKS #11 token can also be specified with the \f3-storepass\fR option\&. If none is specified, then the \f3keytool\fR and \f3jarsigner\fR commands prompt for the token PIN\&. If the token has a protected authentication path (such as a dedicated PIN-pad or a biometric reader), then the \f3-protected\fR option must be specified and no password options can be specified\&.
++.TP
++-storepass[:env | :file] \fIargument\fR
++.br
++Specifies the password that is required to access the keystore\&. This is only needed when signing (not verifying) a JAR file\&. In that case, if a \f3-storepass\fR option is not provided at the command line, then the user is prompted for the password\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \fIargument\fR\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
++.RE
++
++
++\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
++.TP
++-keypass [:env | :file] \fIargument\fR
++.br
++Specifies the password used to protect the private key of the keystore entry addressed by the alias specified on the command line\&. The password is required when using \f3jarsigner\fR to sign a JAR file\&. If no password is provided on the command line, and the required password is different from the store password, then the user is prompted for it\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \f3argument\fR\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
++.RE
++
++
++\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
++.TP
++-sigfile \fIfile\fR
++.br
++Specifies the base file name to be used for the generated \f3\&.SF\fR and \f3\&.DSA\fR files\&. For example, if file is \f3DUKESIGN\fR, then the generated \f3\&.SF\fR and \f3\&.DSA\fR files are named \f3DUKESIGN\&.SF\fR and \f3DUKESIGN\&.DSA\fR, and placed in the \f3META-INF\fR directory of the signed JAR file\&.
++
++The characters in the file must come from the set \f3a-zA-Z0-9_-\fR\&. Only letters, numbers, underscore, and hyphen characters are allowed\&. All lowercase characters are converted to uppercase for the \f3\&.SF\fR and \f3\&.DSA\fR file names\&.
++
++If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to upper case\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not valid in a signature file name, then each such character is converted to an underscore (_) character to form the file name\&.
++.TP
++-sigalg \fIalgorithm\fR
++.br
++Specifies the name of the signature algorithm to use to sign the JAR file\&.
++
++For a list of standard signature algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++
++This algorithm must be compatible with the private key used to sign the JAR file\&. If this option is not specified, then \f3SHA1withDSA\fR, \f3SHA256withRSA\fR, or \f3SHA256withECDSA\fR are used depending on the type of private key\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
++.TP
++-digestalg \fIalgorithm\fR
++.br
++Specifies the name of the message digest algorithm to use when digesting the entries of a JAR file\&.
++
++For a list of standard message digest algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++
++If this option is not specified, then \f3SHA256\fR is used\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
++.TP
++-certs
++.br
++If the \f3-certs\fR option appears on the command line with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. This information includes the name of the type of certificate (stored in the \f3\&.DSA\fR file) that certifies the signer\&'s public key, and if the certificate is an X\&.509 certificate (an instance of the \f3java\&.security\&.cert\&.X509Certificate\fR), then the distinguished name of the signer\&.
++
++The keystore is also examined\&. If no keystore value is specified on the command line, then the default keystore file (if any) is checked\&. If the public key certificate for a signer matches an entry in the keystore, then the alias name for the keystore entry for that signer is displayed in parentheses\&.
++.TP
++-certchain \fIfile\fR
++.br
++Specifies the certificate chain to be used when the certificate chain associated with the private key of the keystore entry that is addressed by the alias specified on the command line is not complete\&. This can happen when the keystore is located on a hardware token where there is not enough capacity to hold a complete certificate chain\&. The file can be a sequence of concatenated X\&.509 certificates, or a single PKCS#7 formatted data block, either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. See Internet RFC 1421 Certificate Encoding Standard and http://tools\&.ietf\&.org/html/rfc1421\&.
++.TP
++-verbose
++.br
++When the \f3-verbose\fR option appears on the command line, it indicates verbose mode, which causes \f3jarsigner\fR to output extra information about the progress of the JAR signing or verification\&.
++.TP
++-internalsf
++.br
++In the past, the \f3\&.DSA\fR (signature block) file generated when a JAR file was signed included a complete encoded copy of the \f3\&.SF\fR file (signature file) also generated\&. This behavior has been changed\&. To reduce the overall size of the output JAR file, the \f3\&.DSA\fR file by default does not contain a copy of the \f3\&.SF\fR file anymore\&. If \f3-internalsf\fR appears on the command line, then the old behavior is utilized\&. This option is useful for testing\&. In practice, do not use the \f3-internalsf\fR option because it incurs higher overhead\&.
++.TP
++-sectionsonly
++.br
++If the \f3-sectionsonly\fR option appears on the command line, then the \f3\&.SF\fR file (signature file) generated when a JAR file is signed does not include a header that contains a hash of the whole manifest file\&. It contains only the information and hashes related to each individual source file included in the JAR file\&. See Signature File\&.
++
++By default, this header is added, as an optimization\&. When the header is present, whenever the JAR file is verified, the verification can first check to see whether the hash in the header matches the hash of the whole manifest file\&. When there is a match, verification proceeds to the next step\&. When there is no match, it is necessary to do a less optimized verification that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See JAR File Verification\&.
++
++The \f3-sectionsonly\fR option is primarily used for testing\&. It should not be used other than for testing because using it incurs higher overhead\&.
++.TP
++-protected
++.br
++Values can be either \f3true\fR or \f3false\fR\&. Specify \f3true\fR when a password must be specified through a protected authentication path such as a dedicated PIN reader\&.
++.TP
++-providerClass \fIprovider-class-name\fR
++.br
++Used to specify the name of cryptographic service provider\&'s master class file when the service provider is not listed in the \f3java\&.security\fR security properties file\&.
++
++Used with the \f3-providerArg ConfigFilePath\fR option, the \f3keytool\fR and \f3jarsigner\fR tools install the provider dynamically and use \fIConfigFilePath\fR for the path to the token configuration file\&. The following example shows a command to list a \f3PKCS #11\fR keystore when the Oracle PKCS #11 provider was not configured in the security properties file\&.
++.sp
++.nf
++\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerClass sun\&.security\&.pkcs11\&.SunPKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerArg /mydir1/mydir2/token\&.config \e\fP
++.fi
++.nf
++\f3 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-providerName \fIproviderName\fR
++.br
++If more than one provider was configured in the \f3java\&.security\fR security properties file, then you can use the \f3-providerName\fR option to target a specific provider instance\&. The argument to this option is the name of the provider\&.
++
++For the Oracle PKCS #11 provider, \fIproviderName\fR is of the form \f3SunPKCS11-\fR\fITokenName\fR, where \fITokenName\fR is the name suffix that the provider instance has been configured with, as detailed in the configuration attributes table\&. For example, the following command lists the contents of the \f3PKCS #11\fR keystore provider instance with name suffix \f3SmartCard\fR:
++.sp
++.nf
++\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerName SunPKCS11\-SmartCard \e\fP
++.fi
++.nf
++\f3 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-J\fIjavaoption\fR
++.br
++Passes through the specified \fIjavaoption\fR string directly to the Java interpreter\&. The \f3jarsigner\fR command is a wrapper around the interpreter\&. This option should not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
++.TP
++-tsa \fIurl\fR
++.br
++If \f3-tsa http://example\&.tsa\&.url\fR appears on the command line when signing a JAR file then a time stamp is generated for the signature\&. The URL, \f3http://example\&.tsa\&.url\fR, identifies the location of the Time Stamping Authority (TSA) and overrides any URL found with the \f3-tsacert\fR option\&. The \f3-tsa\fR option does not require the TSA public key certificate to be present in the keystore\&.
++
++To generate the time stamp, \f3jarsigner\fR communicates with the TSA with the Time-Stamp Protocol (TSP) defined in RFC 3161\&. When successful, the time stamp token returned by the TSA is stored with the signature in the signature block file\&.
++.TP
++-tsacert \fIalias\fR
++.br
++When \f3-tsacert alias\fR appears on the command line when signing a JAR file, a time stamp is generated for the signature\&. The alias identifies the TSA public key certificate in the keystore that is in effect\&. The entry\&'s certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA\&.
++
++The TSA public key certificate must be present in the keystore when using the \f3-tsacert\fR option\&.
++.TP
++-tsapolicyid \fIpolicyid\fR
++.br
++Specifies the object identifier (OID) that identifies the policy ID to be sent to the TSA server\&. If this option is not specified, no policy ID is sent and the TSA server will choose a default policy ID\&.
++
++Object identifiers are defined by X\&.696, which is an ITU Telecommunication Standardization Sector (ITU-T) standard\&. These identifiers are typically period-separated sets of non-negative digits like \f31\&.2\&.3\&.4\fR, for example\&.
++.TP
++-altsigner \fIclass\fR
++.br
++This option specifies an alternative signing mechanism\&. The fully qualified class name identifies a class file that extends the \f3com\&.sun\&.jarsigner\&.ContentSigner\fR abstract class\&. The path to this class file is defined by the \f3-altsignerpath\fR option\&. If the \f3-altsigner\fR option is used, then the \f3jarsigner\fR command uses the signing mechanism provided by the specified class\&. Otherwise, the \f3jarsigner\fR command uses its default signing mechanism\&.
++
++For example, to use the signing mechanism provided by a class named \f3com\&.sun\&.sun\&.jarsigner\&.AuthSigner\fR, use the jarsigner option \f3-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fR\&.
++.TP
++-altsignerpath \fIclasspathlist\fR
++.br
++Specifies the path to the class file and any JAR file it depends on\&. The class file name is specified with the \f3-altsigner\fR option\&. If the class file is in a JAR file, then this option specifies the path to that JAR file\&.
++
++An absolute path or a path relative to the current directory can be specified\&. If \fIclasspathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semicolon (;) on Windows\&. This option is not necessary when the class is already in the search path\&.
++
++The following example shows how to specify the path to a JAR file that contains the class file\&. The JAR file name is included\&.
++.sp
++.nf
++\f3\-altsignerpath /home/user/lib/authsigner\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++The following example shows how to specify the path to the JAR file that contains the class file\&. The JAR file name is omitted\&.
++.sp
++.nf
++\f3\-altsignerpath /home/user/classes/com/sun/tools/jarsigner/\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-strict
++.br
++During the signing or verifying process, the command may issue warning messages\&. If you specify this option, the exit code of the tool reflects the severe warning messages that this command found\&. See Errors and Warnings\&.
++.TP
++-verbose \fIsuboptions\fR
++.br
++For the verifying process, the \f3-verbose\fR option takes suboptions to determine how much information is shown\&. If the \f3-certs\fR option is also specified, then the default mode (or suboption \f3all\fR) displays each entry as it is being processed, and after that, the certificate information for each signer of the JAR file\&. If the \f3-certs\fR and the \f3-verbose:grouped\fR suboptions are specified, then entries with the same signer info are grouped and displayed together with their certificate information\&. If \f3-certs\fR and the \f3-verbose:summary\fR suboptions are specified, then entries with the same signer information are grouped and displayed together with their certificate information\&. Details about each entry are summarized and displayed as \fIone entry (and more)\fR\&. See Examples\&.
++.SH ERRORS\ AND\ WARNINGS
++During the signing or verifying process, the \f3jarsigner\fR command may issue various errors or warnings\&.
++.PP
++If there is a failure, the \f3jarsigner\fR command exits with code 1\&. If there is no failure, but there are one or more severe warnings, the \f3jarsigner\fR command exits with code 0 when the \f3-strict\fR option is \fInot\fR specified, or exits with the OR-value of the warning codes when the \f3-strict\fR is specified\&. If there is only informational warnings or no warning at all, the command always exits with code 0\&.
++.PP
++For example, if a certificate used to sign an entry is expired and has a KeyUsage extension that does not allow it to sign a file, the \f3jarsigner\fR command exits with code 12 (=4+8) when the \f3-strict\fR option is specified\&.
++.PP
++\fINote:\fR Exit codes are reused because only the values from 0 to 255 are legal on Unix-based operating systems\&.
++.PP
++The following sections describes the names, codes, and descriptions of the errors and warnings that the \f3jarsigner\fR command can issue\&.
++.SS FAILURE
++Reasons why the \f3jarsigner\fR command fails include (but are not limited to) a command line parsing error, the inability to find a keypair to sign the JAR file, or the verification of a signed JAR fails\&.
++.TP
++failure
++Code 1\&. The signing or verifying fails\&.
++.SS SEVERE\ WARNINGS
++\fINote:\fR Severe warnings are reported as errors if you specify the \f3-strict\fR option\&.
++.PP
++Reasons why the \f3jarsigner\fR command issues a severe warning include the certificate used to sign the JAR file has an error or the signed JAR file has other problems\&.
++.TP
++hasExpiredCert
++Code 4\&. This jar contains entries whose signer certificate has expired\&.
++.TP
++notYetValidCert
++Code 4\&. This jar contains entries whose signer certificate is not yet valid\&.
++.TP
++chainNotValidated
++Code 4\&. This jar contains entries whose certificate chain cannot be correctly validated\&.
++.TP
++badKeyUsage
++Code 8\&. This jar contains entries whose signer certificate\&'s KeyUsage extension doesn\&'t allow code signing\&.
++.TP
++badExtendedKeyUsage
++Code 8\&. This jar contains entries whose signer certificate\&'s ExtendedKeyUsage extension doesn\&'t allow code signing\&.
++.TP
++badNetscapeCertType
++Code 8\&. This jar contains entries whose signer certificate\&'s NetscapeCertType extension doesn\&'t allow code signing\&.
++.TP
++hasUnsignedEntry
++Code 16\&. This jar contains unsigned entries which have not been integrity-checked\&.
++.TP
++notSignedByAlias
++Code 32\&. This jar contains signed entries which are not signed by the specified alias(es)\&.
++.TP
++aliasNotInStore
++Code 32\&. This jar contains signed entries that are not signed by alias in this keystore\&.
++.SS INFORMATIONAL\ WARNINGS
++Informational warnings include those that are not errors but regarded as bad practice\&. They do not have a code\&.
++.TP
++hasExpiringCert
++This jar contains entries whose signer certificate will expire within six months\&.
++.TP
++noTimestamp
++This jar contains signatures that does not include a timestamp\&. Without a timestamp, users may not be able to validate this JAR file after the signer certificate\&'s expiration date (\f3YYYY-MM-DD\fR) or after any future revocation date\&.
++.SH EXAMPLES
++.SS SIGN\ A\ JAR\ FILE
++Use the following command to sign bundle\&.jar with the private key of a user whose keystore alias is \f3jane\fR in a keystore named \f3mystore\fR in the \f3working\fR directory and name the signed JAR file \f3sbundle\&.jar\fR:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore\fP
++.fi
++.nf
++\f3 \-storepass <keystore password>\fP
++.fi
++.nf
++\f3 \-keypass <private key password>\fP
++.fi
++.nf
++\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There is no \f3-sigfile\fR specified in the previous command so the generated \f3\&.SF\fR and \f3\&.DSA\fR files to be placed in the signed JAR file have default names based on the alias name\&. They are named \f3JANE\&.SF\fR and \f3JANE\&.DSA\fR\&.
++.PP
++If you want to be prompted for the store password and the private key password, then you could shorten the previous command to the following:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore\fP
++.fi
++.nf
++\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If the keystore is the default keystore (\&.keystore in your home directory), then you do not need to specify a keystore, as follows:
++.sp
++.nf
++\f3jarsigner \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you want the signed JAR file to overwrite the input JAR file (bundle\&.jar), then you do not need to specify a \f3-signedjar\fR option, as follows:
++.sp
++.nf
++\f3jarsigner bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS VERIFY\ A\ SIGNED\ JAR\ FILE
++To verify a signed JAR file to ensure that the signature is valid and the JAR file was not been tampered with, use a command such as the following:
++.sp
++.nf
++\f3jarsigner \-verify sbundle\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++When the verification is successful, \f3jar verified\fR is displayed\&. Otherwise, an error message is displayed\&. You can get more information when you use the \f3-verbose\fR option\&. A sample use of \f3jarsigner\fR with the\f3-verbose\fR option follows:
++.sp
++.nf
++\f3jarsigner \-verify \-verbose sbundle\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
++.fi
++.nf
++\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
++.fi
++.nf
++\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 AclEx\&.class\fP
++.fi
++.nf
++\f3 smk 849 Fri Sep 26 16:12:46 PDT 1997 test\&.class\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 s = signature was verified\fP
++.fi
++.nf
++\f3 m = entry is listed in manifest\fP
++.fi
++.nf
++\f3 k = at least one certificate was found in keystore\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 jar verified\&.\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS VERIFICATION\ WITH\ CERTIFICATE\ INFORMATION
++If you specify the \f3-certs\fR option with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. The information includes the certificate type, the signer distinguished name information (when it is an X\&.509 certificate), and in parentheses, the keystore alias for the signer when the public key certificate in the JAR file matches the one in a keystore entry, for example:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore \-verify \-verbose \-certs myTest\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
++.fi
++.nf
++\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
++.fi
++.nf
++\f3 208 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.SF\fP
++.fi
++.nf
++\f3 1087 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.DSA\fP
++.fi
++.nf
++\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 Tst\&.class\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 X\&.509, CN=Test Group, OU=Java Software, O=Oracle, L=CUP, S=CA, C=US (javatest)\fP
++.fi
++.nf
++\f3 X\&.509, CN=Jane Smith, OU=Java Software, O=Oracle, L=cup, S=ca, C=us (jane)\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 s = signature was verified\fP
++.fi
++.nf
++\f3 m = entry is listed in manifest\fP
++.fi
++.nf
++\f3 k = at least one certificate was found in keystore\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 jar verified\&.\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If the certificate for a signer is not an X\&.509 certificate, then there is no distinguished name information\&. In that case, just the certificate type and the alias are shown\&. For example, if the certificate is a PGP certificate, and the alias is \f3bob\fR, then you would get: \f3PGP, (bob)\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++keytool(1)
++.TP 0.2i
++\(bu
++Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/java.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/java.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/bsd/doc/man/javac.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/javac.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Basic Tools
+-.\" Title: javac.1
+-.\"
+-.if n .pl 99999
+-.TH javac 1 "03 March 2015" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Basic Tools
++.\" Title: javac.1
++.\"
++.if n .pl 99999
++.TH javac 1 "03 March 2015" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,1322 +47,1322 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javac \- Reads Java class and interface definitions and compiles them into bytecode and class files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavac\fR [ \fIoptions\fR ] [ \fIsourcefiles\fR ] [ \fIclasses\fR] [ \fI@argfiles\fR ]
+-.fi
+-.sp
+-Arguments can be in any order:
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIsourcefiles\fR
+-One or more source files to be compiled (such as \f3MyClass\&.java\fR)\&.
+-.TP
+-\fIclasses\fR
+-One or more classes to be processed for annotations (such as \f3MyPackage\&.MyClass\fR)\&.
+-.TP
+-\fI@argfiles\fR
+-One or more files that list options and source files\&. The \f3-J\fR options are not allowed in these files\&. See Command-Line Argument Files\&.
+-.SH DESCRIPTION
+-The \f3javac\fR command reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files\&. The \f3javac\fR command can also process annotations in Java source files and classes\&.
+-.PP
+-There are two ways to pass source code file names to \f3javac\fR\&.
+-.TP 0.2i
+-\(bu
+-For a small number of source files, list the file names on the command line\&.
+-.TP 0.2i
+-\(bu
+-For a large number of source files, list the file names in a file that is separated by blanks or line breaks\&. Use the list file name preceded by an at sign (@) with the \f3javac\fR command\&.
+-.PP
+-Source code file names must have \&.java suffixes, class file names must have \&.class suffixes, and both source and class files must have root names that identify the class\&. For example, a class called \f3MyClass\fR would be written in a source file called \f3MyClass\&.java\fR and compiled into a bytecode class file called \f3MyClass\&.class\fR\&.
+-.PP
+-Inner class definitions produce additional class files\&. These class files have names that combine the inner and outer class names, such as \f3MyClass$MyInnerClass\&.class\fR\&.
+-.PP
+-Arrange source files in a directory tree that reflects their package tree\&. For example, if all of your source files are in \f3/workspace\fR, then put the source code for \f3com\&.mysoft\&.mypack\&.MyClass\fR in \f3/workspace/com/mysoft/mypack/MyClass\&.java\fR\&.
+-.PP
+-By default, the compiler puts each class file in the same directory as its source file\&. You can specify a separate destination directory with the \f3-d\fR option\&.
+-.SH OPTIONS
+-The compiler has a set of standard options that are supported on the current development environment\&. An additional set of nonstandard options are specific to the current virtual machine and compiler implementations and are subject to change in the future\&. Nonstandard options begin with the \f3-X\fR option\&.
+-.TP 0.2i
+-\(bu
+-See also Cross-Compilation Options
+-.TP 0.2i
+-\(bu
+-See also Nonstandard Options
+-.SS STANDARD\ OPTIONS
+-.TP
+--A\fIkey\fR[\fI=value\fR]
+-.br
+-Specifies options to pass to annotation processors\&. These options are not interpreted by \f3javac\fR directly, but are made available for use by individual processors\&. The \f3key\fR value should be one or more identifiers separated by a dot (\&.)\&.
+-.TP
+--cp \fIpath\fR or -classpath \fIpath\fR
+-.br
+-Specifies where to find user class files, and (optionally) annotation processors and source files\&. This class path overrides the user class path in the \f3CLASSPATH\fR environment variable\&. If neither \f3CLASSPATH\fR, \f3-cp\fR nor \f3-classpath\fR is specified, then the user \fIclass path\fR is the current directory\&. See Setting the Class Path\&.
+-
+-If the \f3-sourcepath\fR option is not specified, then the user class path is also searched for source files\&.
+-
+-If the \f3-processorpath\fR option is not specified, then the class path is also searched for annotation processors\&.
+-.TP
+--Djava\&.ext\&.dirs=\fIdirectories\fR
+-.br
+-Overrides the location of installed extensions\&.
+-.TP
+--Djava\&.endorsed\&.dirs=\fIdirectories\fR
+-.br
+-Overrides the location of the endorsed standards path\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Sets the destination directory for class files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then \f3javac\fR puts the class file in a subdirectory that reflects the package name and creates directories as needed\&.
+-
+-If you specify \f3-d\fR\f3/home/myclasses\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the class file is \f3/home/myclasses/com/mypackage/MyClass\&.class\fR\&.
+-
+-If the \fI-d\fR option is not specified, then \f3javac\fR puts each class file in the same directory as the source file from which it was generated\&.
+-
+-\fINote:\fR The directory specified by the \fI-d\fR option is not automatically added to your user class path\&.
+-.TP
+--deprecation
+-.br
+-Shows a description of each use or override of a deprecated member or class\&. Without the \f3-deprecation\fR option, \f3javac\fR shows a summary of the source files that use or override deprecated members or classes\&. The \f3-deprecation\fR option is shorthand for \f3-Xlint:deprecation\fR\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Sets the source file encoding name, such as EUC-JP and UTF-8\&. If the \f3-encoding\fR option is not specified, then the platform default converter is used\&.
+-.TP
+--endorseddirs \fIdirectories\fR
+-.br
+-Overrides the location of the endorsed standards path\&.
+-.TP
+--extdirs \fIdirectories\fR
+-.br
+-Overrides the location of the \f3ext\fR directory\&. The directories variable is a colon-separated list of directories\&. Each JAR file in the specified directories is searched for class files\&. All JAR files found become part of the class path\&.
+-
+-If you are cross-compiling (compiling classes against bootstrap and extension classes of a different Java platform implementation), then this option specifies the directories that contain the extension classes\&. See Cross-Compilation Options for more information\&.
+-.TP
+--g
+-.br
+-Generates all debugging information, including local variables\&. By default, only line number and source file information is generated\&.
+-.TP
+--g:none
+-.br
+-Does not generate any debugging information\&.
+-.TP
+--g:[\fIkeyword list\fR]
+-.br
+-Generates only some kinds of debugging information, specified by a comma separated list of keywords\&. Valid keywords are:
+-.RS
+-.TP
+-source
+-Source file debugging information\&.
+-.TP
+-lines
+-Line number debugging information\&.
+-.TP
+-vars
+-Local variable debugging information\&.
+-.RE
+-
+-.TP
+--help
+-.br
+-Prints a synopsis of standard options\&.
+-.TP
+--implicit:[\fIclass, none\fR]
+-.br
+-Controls the generation of class files for implicitly loaded source files\&. To automatically generate class files, use \f3-implicit:class\fR\&. To suppress class file generation, use \f3-implicit:none\fR\&. If this option is not specified, then the default is to automatically generate class files\&. In this case, the compiler issues a warning if any such class files are generated when also doing annotation processing\&. The warning is not issued when the \f3-implicit\fR option is set explicitly\&. See Searching for Types\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-
+-\fINote:\fR The \fICLASSPATH\fR, \f3-classpath\fR, \f3-bootclasspath\fR, and \f3-extdirs\fR options do not specify the classes used to run \f3javac\fR\&. Trying to customize the compiler implementation with these options and variables is risky and often does not accomplish what you want\&. If you must customize the complier implementation, then use the \f3-J\fR option to pass options through to the underlying \f3\fRJava launcher\&.
+-.TP
+--nowarn
+-.br
+-Disables warning messages\&. This option operates the same as the \f3-Xlint:none\fR option\&.
+-.TP
+--parameters
+-.br
+-Stores formal parameter names of constructors and methods in the generated class file so that the method \f3java\&.lang\&.reflect\&.Executable\&.getParameters\fR from the Reflection API can retrieve them\&.
+-.TP
+--proc: [\fInone\fR, \fIonly\fR]
+-.br
+-Controls whether annotation processing and compilation are done\&. \f3-proc:none\fR means that compilation takes place without annotation processing\&. \f3-proc:only\fR means that only annotation processing is done, without any subsequent compilation\&.
+-.TP
+--processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.]
+-.br
+-Names of the annotation processors to run\&. This bypasses the default discovery process\&.
+-.TP
+--processorpath \fIpath\fR
+-.br
+-Specifies where to find annotation processors\&. If this option is not used, then the class path is searched for processors\&.
+-.TP
+--s \fIdir\fR
+-.br
+-Specifies the directory where to place the generated source files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then the compiler puts the source file in a subdirectory that reflects the package name and creates directories as needed\&.
+-
+-If you specify \f3-s /home/mysrc\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the source file is put in \f3/home/mysrc/com/mypackage/MyClass\&.java\fR\&.
+-.TP
+--source \fIrelease\fR
+-.br
+-Specifies the version of source code accepted\&. The following values for \f3release\fR are allowed:
+-.RS
+-.TP
+-1\&.3
+-The compiler does not support assertions, generics, or other language features introduced after Java SE 1\&.3\&.
+-.TP
+-1\&.4
+-The compiler accepts code containing assertions, which were introduced in Java SE 1\&.4\&.
+-.TP
+-1\&.5
+-The compiler accepts code containing generics and other language features introduced in Java SE 5\&.
+-.TP
+-5
+-Synonym for 1\&.5\&.
+-.TP
+-1\&.6
+-No language changes were introduced in Java SE 6\&. However, encoding errors in source files are now reported as errors instead of warnings as in earlier releases of Java Platform, Standard Edition\&.
+-.TP
+-6
+-Synonym for 1\&.6\&.
+-.TP
+-1\&.7
+-The compiler accepts code with features introduced in Java SE 7\&.
+-.TP
+-7
+-Synonym for 1\&.7\&.
+-.TP
+-1\&.8
+-This is the default value\&. The compiler accepts code with features introduced in Java SE 8\&.
+-.TP
+-8
+-Synonym for 1\&.8\&.
+-.RE
+-
+-.TP
+--sourcepath \fIsourcepath\fR
+-.br
+-Specifies the source code path to search for class or interface definitions\&. As with the user class path, source path entries are separated by colons (:) on Oracle Solaris and semicolons on Windows and can be directories, JAR archives, or ZIP archives\&. If packages are used, then the local path name within the directory or archive must reflect the package name\&.
+-
+-\fINote:\fR Classes found through the class path might be recompiled when their source files are also found\&. See Searching for Types\&.
+-.TP
+--verbose
+-.br
+-Uses verbose output, which includes information about each class loaded and each source file compiled\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--werror
+-.br
+-Terminates compilation when warnings occur\&.
+-.TP
+--X
+-.br
+-Displays information about nonstandard options and exits\&.
+-.SS CROSS-COMPILATION\ OPTIONS
+-By default, classes are compiled against the bootstrap and extension classes of the platform that \f3javac\fR shipped with\&. But \f3javac\fR also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation\&. It is important to use the \f3-bootclasspath\fR and \f3-extdirs\fR options when cross-compiling\&.
+-.TP
+--target \fIversion\fR
+-.br
+-Generates class files that target a specified release of the virtual machine\&. Class files will run on the specified target and on later releases, but not on earlier releases of the JVM\&. Valid targets are 1\&.1, 1\&.2, 1\&.3, 1\&.4, 1\&.5 (also 5), 1\&.6 (also 6), 1\&.7 (also 7), and 1\&.8 (also 8)\&.
+-
+-The default for the \f3-target\fR option depends on the value of the \f3-source\fR option:
+-.RS
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is not specified, then the value of the \f3-target\fR option is 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.2, then the value of the \f3-target\fR option is 1\&.4
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.3, then the value of the \f3-target\fR option is 1\&.4
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.5, then the value of the \f3-target\fR option is 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.6, then the value of the \f3-target\fR is option 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.7, then the value of the \f3-target\fR is option 1\&.8
+-.TP 0.2i
+-\(bu
+-For all other values of the \f3-source\fR option, the value of the \f3-target\fR option is the value of the \f3-source\fR option\&.
+-.RE
+-
+-.TP
+--bootclasspath \fIbootclasspath\fR
+-.br
+-Cross-compiles against the specified set of boot classes\&. As with the user class path, boot class path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives\&.
+-.SS COMPACT\ PROFILE\ OPTION
+-Beginning with JDK 8, the \f3javac\fR compiler supports compact profiles\&. With compact profiles, applications that do not require the entire Java platform can be deployed and run with a smaller footprint\&. The compact profiles feature could be used to shorten the download time for applications from app stores\&. This feature makes for more compact deployment of Java applications that bundle the JRE\&. This feature is also useful in small devices\&.
+-.PP
+-The supported profile values are \f3compact1\fR, \f3compact2\fR, and \f3compact3\fR\&. These are additive layers\&. Each higher-numbered compact profile contains all of the APIs in profiles with smaller number names\&.
+-.TP
+--profile
+-.br
+-When using compact profiles, this option specifies the profile name when compiling\&. For example:
+-.sp
+-.nf
+-\f3javac \-profile compact1 Hello\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-javac does not compile source code that uses any Java SE APIs that is not in the specified profile\&. Here is an example of the error message that results from attempting to compile such source code:
+-.sp
+-.nf
+-\f3cd jdk1\&.8\&.0/bin\fP
+-.fi
+-.nf
+-\f3\&./javac \-profile compact1 Paint\&.java\fP
+-.fi
+-.nf
+-\f3Paint\&.java:5: error: Applet is not available in profile \&'compact1\&'\fP
+-.fi
+-.nf
+-\f3import java\&.applet\&.Applet;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-In this example, you can correct the error by modifying the source to not use the \f3Applet\fR class\&. You could also correct the error by compiling without the -profile option\&. Then the compilation would be run against the full set of Java SE APIs\&. (None of the compact profiles include the \f3Applet\fR class\&.)
+-
+-An alternative way to compile with compact profiles is to use the \f3-bootclasspath\fR option to specify a path to an \f3rt\&.jar\fR file that specifies a profile\&'s image\&. Using the \f3-profile\fR option instead does not require a profile image to be present on the system at compile time\&. This is useful when cross-compiling\&.
+-.SS NONSTANDARD\ OPTIONS
+-.TP
+--Xbootclasspath/p:\fIpath\fR
+-.br
+-Adds a suffix to the bootstrap class path\&.
+-.TP
+--Xbootclasspath/a:\fIpath\fR
+-.br
+-Adds a prefix to the bootstrap class path\&.
+-.TP
+--Xbootclasspath/:\fIpath\fR
+-.br
+-Overrides the location of the bootstrap class files\&.
+-.TP
+--Xdoclint:[-]\fIgroup\fR [\fI/access\fR]
+-.br
+-Enables or disables specific groups of checks, where \fIgroup\fR is one of the following values: \f3accessibility\fR, \f3syntax\fR, \f3reference\fR, \f3html\fR or \f3missing\fR\&. For more information about these groups of checks see the \f3-Xdoclint\fR option of the \f3javadoc\fR command\&. The \f3-Xdoclint\fR option is disabled by default in the \f3javac\fR command\&.
+-
+-The variable \fIaccess\fR specifies the minimum visibility level of classes and members that the \f3-Xdoclint\fR option checks\&. It can have one of the following values (in order of most to least visible) : \f3public\fR, \f3protected\fR, \f3package\fR and \f3private\fR\&. For example, the following option checks classes and members (with all groups of checks) that have the access level protected and higher (which includes protected, package and public):
+-.sp
+-.nf
+-\f3\-Xdoclint:all/protected\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following option enables all groups of checks for all access levels, except it will not check for HTML errors for classes and members that have access level package and higher (which includes package and public):
+-.sp
+-.nf
+-\f3\-Xdoclint:all,\-html/package\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--Xdoclint:none
+-.br
+-Disables all groups of checks\&.
+-.TP
+--Xdoclint:all[\fI/access\fR]
+-.br
+-Enables all groups of checks\&.
+-.TP
+--Xlint
+-.br
+-\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
+-.TP
+--Xlint:all
+-.br
+-\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
+-.TP
+--Xlint:none
+-.br
+-Disables all warnings\&.
+-.TP
+--Xlint:\fIname\fR
+-.br
+-Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option for a list of warnings you can disable with this option\&.
+-.TP
+--Xlint:\fI-name\fR
+-.br
+-Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option with the \f3-Xlint\fR option to get a list of warnings that you can disable with this option\&.
+-.TP
+--Xmaxerrs \fInumber\fR
+-.br
+-Sets the maximum number of errors to print\&.
+-.TP
+--Xmaxwarns \fInumber\fR
+-.br
+-Sets the maximum number of warnings to print\&.
+-.TP
+--Xstdout \fIfilename\fR
+-.br
+-Sends compiler messages to the named file\&. By default, compiler messages go to \f3System\&.err\fR\&.
+-.TP
+--Xprefer:[\fInewer,source\fR]
+-.br
+-Specifies which file to read when both a source file and class file are found for a type\&. (See Searching for Types)\&. If the \f3-Xprefer:newer\fR option is used, then it reads the newer of the source or class file for a type (default)\&. If the \f3-Xprefer:source\fR option is used, then it reads the source file\&. Use -\f3Xprefer:source\fR when you want to be sure that any annotation processors can access annotations declared with a retention policy of \f3SOURCE\fR\&.
+-.TP
+--Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR]
+-.br
+-Control whether javac generates \f3package-info\&.class\fR files from package-info\&.java files\&. Possible mode arguments for this option include the following\&.
+-.RS
+-.TP
+-always
+-Always generate a \f3package-info\&.class\fR file for every \f3package-info\&.java\fR file\&. This option may be useful if you use a build system such as Ant, which checks that each \f3\&.java\fR file has a corresponding \f3\&.class\fR file\&.
+-.TP
+-legacy
+-Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations\&. Don\&'t generate a \f3package-info\&.class\fR file if package-info\&.java only contains comments\&.
+-
+-\fINote:\fR A \f3package-info\&.class\fR file might be generated but be empty if all the annotations in the package-info\&.java file have \f3RetentionPolicy\&.SOURCE\fR\&.
+-.TP
+-nonempty
+-Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations with \f3RetentionPolicy\&.CLASS\fR or \f3RetentionPolicy\&.RUNTIME\fR\&.
+-.RE
+-
+-.TP
+--Xprint
+-.br
+-Prints a textual representation of specified types for debugging purposes\&. Perform neither annotation processing nor compilation\&. The format of the output could change\&.
+-.TP
+--XprintProcessorInfo
+-.br
+-Prints information about which annotations a processor is asked to process\&.
+-.TP
+--XprintRounds
+-.br
+-Prints information about initial and subsequent annotation processing rounds\&.
+-.SH ENABLE\ OR\ DISABLE\ WARNINGS\ WITH\ THE\ -XLINT\ OPTION
+-Enable warning \fIname\fR with the \f3-Xlint:name\fR option, where \f3name\fR is one of the following warning names\&. Note that you can disable a warning with the \f3-Xlint:-name:\fR option\&.
+-.TP
+-cast
+-Warns about unnecessary and redundant casts, for example:
+-.sp
+-.nf
+-\f3String s = (String) "Hello!"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-classfile
+-Warns about issues related to class file contents\&.
+-.TP
+-deprecation
+-Warns about the use of deprecated items, for example:
+-.sp
+-.nf
+-\f3java\&.util\&.Date myDate = new java\&.util\&.Date();\fP
+-.fi
+-.nf
+-\f3int currentDay = myDate\&.getDay();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The method \f3java\&.util\&.Date\&.getDay\fR has been deprecated since JDK 1\&.1
+-.TP
+-dep-ann
+-Warns about items that are documented with an \f3@deprecated\fR Javadoc comment, but do not have a \f3@Deprecated\fR annotation, for example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @deprecated As of Java SE 7, replaced by {@link #newMethod()}\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public static void deprecatedMethood() { }\fP
+-.fi
+-.nf
+-\f3public static void newMethod() { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-divzero
+-Warns about division by the constant integer 0, for example:
+-.sp
+-.nf
+-\f3int divideByZero = 42 / 0;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-empty
+-Warns about empty statements after \f3if\fRstatements, for example:
+-.sp
+-.nf
+-\f3class E {\fP
+-.fi
+-.nf
+-\f3 void m() {\fP
+-.fi
+-.nf
+-\f3 if (true) ;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-fallthrough
+-Checks the switch blocks for fall-through cases and provides a warning message for any that are found\&. Fall-through cases are cases in a switch block, other than the last case in the block, whose code does not include a break statement, allowing code execution to fall through from that case to the next case\&. For example, the code following the case 1 label in this switch block does not end with a break statement:
+-.sp
+-.nf
+-\f3switch (x) {\fP
+-.fi
+-.nf
+-\f3case 1:\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("1");\fP
+-.fi
+-.nf
+-\f3 // No break statement here\&.\fP
+-.fi
+-.nf
+-\f3case 2:\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("2");\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the \f3-Xlint:fallthrough\fR option was used when compiling this code, then the compiler emits a warning about possible fall-through into case, with the line number of the case in question\&.
+-.TP
+-finally
+-Warns about \f3finally\fR clauses that cannot complete normally, for example:
+-.sp
+-.nf
+-\f3public static int m() {\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3 throw new NullPointerException();\fP
+-.fi
+-.nf
+-\f3 } catch (NullPointerException(); {\fP
+-.fi
+-.nf
+-\f3 System\&.err\&.println("Caught NullPointerException\&.");\fP
+-.fi
+-.nf
+-\f3 return 1;\fP
+-.fi
+-.nf
+-\f3 } finally {\fP
+-.fi
+-.nf
+-\f3 return 0;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates a warning for the \f3finally\fR block in this example\&. When the \f3int\fR method is called, it returns a value of 0\&. A \f3finally\fR block executes when the \f3try\fR block exits\&. In this example, when control is transferred to the \f3catch\fR block, the \f3int\fR method exits\&. However, the \f3finally\fR block must execute, so it is executed, even though control was transferred outside the method\&.
+-.TP
+-options
+-Warns about issues that related to the use of command-line options\&. See Cross-Compilation Options\&.
+-.TP
+-overrides
+-Warns about issues regarding method overrides\&. For example, consider the following two classes:
+-.sp
+-.nf
+-\f3public class ClassWithVarargsMethod {\fP
+-.fi
+-.nf
+-\f3 void varargsMethod(String\&.\&.\&. s) { }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class ClassWithOverridingMethod extends ClassWithVarargsMethod {\fP
+-.fi
+-.nf
+-\f3 @Override\fP
+-.fi
+-.nf
+-\f3 void varargsMethod(String[] s) { }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates a warning similar to the following:\&.
+-.sp
+-.nf
+-\f3warning: [override] varargsMethod(String[]) in ClassWithOverridingMethod \fP
+-.fi
+-.nf
+-\f3overrides varargsMethod(String\&.\&.\&.) in ClassWithVarargsMethod; overriding\fP
+-.fi
+-.nf
+-\f3method is missing \&'\&.\&.\&.\&'\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler encounters a \f3varargs\fR method, it translates the \f3varargs\fR formal parameter into an array\&. In the method \f3ClassWithVarargsMethod\&.varargsMethod\fR, the compiler translates the \f3varargs\fR formal parameter \f3String\&.\&.\&. s\fR to the formal parameter \f3String[] s\fR, an array, which matches the formal parameter of the method \f3ClassWithOverridingMethod\&.varargsMethod\fR\&. Consequently, this example compiles\&.
+-.TP
+-path
+-Warns about invalid path elements and nonexistent path directories on the command line (with regard to the class path, the source path, and other paths)\&. Such warnings cannot be suppressed with the \f3@SuppressWarnings\fR annotation, for example:
+-.sp
+-.nf
+-\f3javac \-Xlint:path \-classpath /nonexistentpath Example\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-processing
+-Warn about issues regarding annotation processing\&. The compiler generates this warning when you have a class that has an annotation, and you use an annotation processor that cannot handle that type of exception\&. For example, the following is a simple annotation processor:
+-
+-\fISource file AnnocProc\&.java\fR:
+-.sp
+-.nf
+-\f3import java\&.util\&.*;\fP
+-.fi
+-.nf
+-\f3import javax\&.annotation\&.processing\&.*;\fP
+-.fi
+-.nf
+-\f3import javax\&.lang\&.model\&.*;\fP
+-.fi
+-.nf
+-\f3import\&.javaz\&.lang\&.model\&.element\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@SupportedAnnotationTypes("NotAnno")\fP
+-.fi
+-.nf
+-\f3public class AnnoProc extends AbstractProcessor {\fP
+-.fi
+-.nf
+-\f3 public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv){\fP
+-.fi
+-.nf
+-\f3 return true;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public SourceVersion getSupportedSourceVersion() {\fP
+-.fi
+-.nf
+-\f3 return SourceVersion\&.latest();\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fISource file AnnosWithoutProcessors\&.java\fR:
+-.sp
+-.nf
+-\f3@interface Anno { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@Anno\fP
+-.fi
+-.nf
+-\f3class AnnosWithoutProcessors { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following commands compile the annotation processor \f3AnnoProc\fR, then run this annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR:
+-.sp
+-.nf
+-\f3javac AnnoProc\&.java\fP
+-.fi
+-.nf
+-\f3javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutProcessors\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler runs the annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR, it generates the following warning:
+-.sp
+-.nf
+-\f3warning: [processing] No processor claimed any of these annotations: Anno\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To resolve this issue, you can rename the annotation defined and used in the class \f3AnnosWithoutProcessors\fR from \f3Anno\fR to \f3NotAnno\fR\&.
+-.TP
+-rawtypes
+-Warns about unchecked operations on raw types\&. The following statement generates a \f3rawtypes\fR warning:
+-.sp
+-.nf
+-\f3void countElements(List l) { \&.\&.\&. }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following example does not generate a \f3rawtypes\fR warning
+-.sp
+-.nf
+-\f3void countElements(List<?> l) { \&.\&.\&. }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\f3List\fR is a raw type\&. However, \f3List<?>\fR is an unbounded wildcard parameterized type\&. Because \f3List\fR is a parameterized interface, always specify its type argument\&. In this example, the \f3List\fR formal argument is specified with an unbounded wildcard (\f3?\fR) as its formal type parameter, which means that the \f3countElements\fR method can accept any instantiation of the \f3List\fR interface\&.
+-.TP
+-Serial
+-Warns about missing \f3serialVersionUID\fR definitions on serializable classes, for example:
+-.sp
+-.nf
+-\f3public class PersistentTime implements Serializable\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 private Date time;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public PersistentTime() {\fP
+-.fi
+-.nf
+-\f3 time = Calendar\&.getInstance()\&.getTime();\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public Date getTime() {\fP
+-.fi
+-.nf
+-\f3 return time;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates the following warning:
+-.sp
+-.nf
+-\f3warning: [serial] serializable class PersistentTime has no definition of\fP
+-.fi
+-.nf
+-\f3serialVersionUID\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If a serializable class does not explicitly declare a field named \f3serialVersionUID\fR, then the serialization runtime environment calculates a default \f3serialVersionUID\fR value for that class based on various aspects of the class, as described in the Java Object Serialization Specification\&. However, it is strongly recommended that all serializable classes explicitly declare \f3serialVersionUID\fR values because the default process of computing \f3serialVersionUID\fR vales is highly sensitive to class details that can vary depending on compiler implementations, and as a result, might cause an unexpected \f3InvalidClassExceptions\fR during deserialization\&. To guarantee a consistent \f3serialVersionUID\fR value across different Java compiler implementations, a serializable class must declare an explicit \f3serialVersionUID\fR value\&.
+-.TP
+-static
+-Warns about issues relating to the use of statics, for example:
+-.sp
+-.nf
+-\f3class XLintStatic {\fP
+-.fi
+-.nf
+-\f3 static void m1() { }\fP
+-.fi
+-.nf
+-\f3 void m2() { this\&.m1(); }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates the following warning:
+-.sp
+-.nf
+-\f3warning: [static] static method should be qualified by type name, \fP
+-.fi
+-.nf
+-\f3XLintStatic, instead of by an expression\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To resolve this issue, you can call the \f3static\fR method \f3m1\fR as follows:
+-.sp
+-.nf
+-\f3XLintStatic\&.m1();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Alternately, you can remove the \f3static\fR keyword from the declaration of the method \f3m1\fR\&.
+-.TP
+-try
+-Warns about issues relating to use of \f3try\fR blocks, including try-with-resources statements\&. For example, a warning is generated for the following statement because the resource \f3ac\fR declared in the \f3try\fR block is not used:
+-.sp
+-.nf
+-\f3try ( AutoCloseable ac = getResource() ) { // do nothing}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-unchecked
+-Gives more detail for unchecked conversion warnings that are mandated by the Java Language Specification, for example:
+-.sp
+-.nf
+-\f3List l = new ArrayList<Number>();\fP
+-.fi
+-.nf
+-\f3List<String> ls = l; // unchecked warning\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-During type erasure, the types \f3ArrayList<Number>\fR and \f3List<String>\fR become \f3ArrayList\fR and \f3List\fR, respectively\&.
+-
+-The \f3ls\fR command has the parameterized type \f3List<String>\fR\&. When the \f3List\fR referenced by \f3l\fR is assigned to \f3ls\fR, the compiler generates an unchecked warning\&. At compile time, the compiler and JVM cannot determine whether \f3l\fR refers to a \f3List<String>\fR type\&. In this case, \f3l\fR does not refer to a \f3List<String>\fR type\&. As a result, heap pollution occurs\&.
+-
+-A heap pollution situation occurs when the \f3List\fR object \f3l\fR, whose static type is \f3List<Number>\fR, is assigned to another \f3List\fR object, \f3ls\fR, that has a different static type, \f3List<String>\fR\&. However, the compiler still allows this assignment\&. It must allow this assignment to preserve backward compatibility with releases of Java SE that do not support generics\&. Because of type erasure, \f3List<Number>\fR and \f3List<String>\fR both become \f3List\fR\&. Consequently, the compiler allows the assignment of the object \f3l\fR\f3,\fR which has a raw type of \f3List\fR, to the object \f3ls\fR\&.
+-.TP
+-varargs
+-Warns about unsafe usages of variable arguments (\f3varargs\fR) methods, in particular, those that contain non-reifiable arguments, for example:
+-.sp
+-.nf
+-\f3public class ArrayBuilder {\fP
+-.fi
+-.nf
+-\f3 public static <T> void addToList (List<T> listArg, T\&.\&.\&. elements) {\fP
+-.fi
+-.nf
+-\f3 for (T x : elements) {\fP
+-.fi
+-.nf
+-\f3 listArg\&.add(x);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR A non-reifiable type is a type whose type information is not fully available at runtime\&.
+-
+-The compiler generates the following warning for the definition of the method \f3ArrayBuilder\&.addToList\fR
+-.sp
+-.nf
+-\f3warning: [varargs] Possible heap pollution from parameterized vararg type T\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler encounters a varargs method, it translates the \f3varargs\fR formal parameter into an array\&. However, the Java programming language does not permit the creation of arrays of parameterized types\&. In the method \f3ArrayBuilder\&.addToList\fR, the compiler translates the \f3varargs\fR formal parameter \f3T\&.\&.\&.\fR elements to the formal parameter \f3T[]\fR elements, an array\&. However, because of type erasure, the compiler converts the \f3varargs\fR formal parameter to \f3Object[]\fR elements\&. Consequently, there is a possibility of heap pollution\&.
+-.SH COMMAND-LINE\ ARGUMENT\ FILES
+-To shorten or simplify the \f3javac\fR command, you can specify one or more files that contain arguments to the \f3javac\fR command (except \f3-J\fR options)\&. This enables you to create \f3javac\fR commands of any length on any operating system\&.
+-.PP
+-An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be separated by spaces or new line characters\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
+-.PP
+-File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (*) are not allowed in these lists (such as for specifying \f3*\&.java\fR)\&. Use of the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
+-.PP
+-When executing the \f3javac\fR command, pass in the path and name of each argument file with the at sign (@) leading character\&. When the \f3javac\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
+-.PP
+-\f3Example 1 Single Argument File\fR
+-.PP
+-You could use a single argument file named \f3argfile\fR to hold all \f3javac\fR arguments:
+-.sp
+-.nf
+-\f3javac @argfile\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This argument file could contain the contents of both files shown in Example 2
+-.PP
+-\f3Example 2 Two Argument Files\fR
+-.PP
+-You can create two argument files: one for the \f3javac\fR options and the other for the source file names\&. Note that the following lists have no line-continuation characters\&.
+-.PP
+-Create a file named options that contains the following:
+-.sp
+-.nf
+-\f3\-d classes\fP
+-.fi
+-.nf
+-\f3\-g\fP
+-.fi
+-.nf
+-\f3\-sourcepath /java/pubs/ws/1\&.3/src/share/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Create a file named classes that contains the following:
+-.sp
+-.nf
+-\f3MyClass1\&.java\fP
+-.fi
+-.nf
+-\f3MyClass2\&.java\fP
+-.fi
+-.nf
+-\f3MyClass3\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Then, run the \f3javac\fR command as follows:
+-.sp
+-.nf
+-\f3javac @options @classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Argument Files with Paths\fR
+-.PP
+-The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
+-.sp
+-.nf
+-\f3javac @path1/options @path2/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH ANNOTATION\ PROCESSING
+-The \f3javac\fR command provides direct support for annotation processing, superseding the need for the separate annotation processing command, \f3apt\fR\&.
+-.PP
+-The API for annotation processors is defined in the \f3javax\&.annotation\&.processing\fR and j\f3avax\&.lang\&.model\fR packages and subpackages\&.
+-.SS HOW\ ANNOTATION\ PROCESSING\ WORKS
+-Unless annotation processing is disabled with the \f3-proc:none\fR option, the compiler searches for any annotation processors that are available\&. The search path can be specified with the \f3-processorpath\fR option\&. If no path is specified, then the user class path is used\&. Processors are located by means of service provider-configuration files named \f3META-INF/services/javax\&.annotation\&.processing\fR\&.Processor on the search path\&. Such files should contain the names of any annotation processors to be used, listed one per line\&. Alternatively, processors can be specified explicitly, using the \f3-processor\fR option\&.
+-.PP
+-After scanning the source files and classes on the command line to determine what annotations are present, the compiler queries the processors to determine what annotations they process\&. When a match is found, the processor is called\&. A processor can claim the annotations it processes, in which case no further attempt is made to find any processors for those annotations\&. After all of the annotations are claimed, the compiler does not search for additional processors\&.
+-.PP
+-If any processors generate new source files, then another round of annotation processing occurs: Any newly generated source files are scanned, and the annotations processed as before\&. Any processors called on previous rounds are also called on all subsequent rounds\&. This continues until no new source files are generated\&.
+-.PP
+-After a round occurs where no new source files are generated, the annotation processors are called one last time, to give them a chance to complete any remaining work\&. Finally, unless the \f3-proc:only\fR option is used, the compiler compiles the original and all generated source files\&.
+-.SS IMPLICITLY\ LOADED\ SOURCE\ FILES
+-To compile a set of source files, the compiler might need to implicitly load additional source files\&. See Searching for Types\&. Such files are currently not subject to annotation processing\&. By default, the compiler gives a warning when annotation processing occurred and any implicitly loaded source files are compiled\&. The \f3-implicit\fR option provides a way to suppress the warning\&.
+-.SH SEARCHING\ FOR\ TYPES
+-To compile a source file, the compiler often needs information about a type, but the type definition is not in the source files specified on the command line\&. The compiler needs type information for every class or interface used, extended, or implemented in the source file\&. This includes classes and interfaces not explicitly mentioned in the source file, but that provide information through inheritance\&.
+-.PP
+-For example, when you create a subclass \f3java\&.applet\&.Applet\fR, you are also using the ancestor classes of \f3Applet\fR: \f3java\&.awt\&.Panel\fR, \f3java\&.awt\&.Container\fR, \f3java\&.awt\&.Component\fR, and \f3java\&.lang\&.Object\fR\&.
+-.PP
+-When the compiler needs type information, it searches for a source file or class file that defines the type\&. The compiler searches for class files first in the bootstrap and extension classes, then in the user class path (which by default is the current directory)\&. The user class path is defined by setting the \f3CLASSPATH\fR environment variable or by using the \f3-classpath\fR option\&.
+-.PP
+-If you set the \f3-sourcepath\fR option, then the compiler searches the indicated path for source files\&. Otherwise, the compiler searches the user class path for both class files and source files\&.
+-.PP
+-You can specify different bootstrap or extension classes with the \f3-bootclasspath\fR and the \f3-extdirs\fR options\&. See Cross-Compilation Options\&.
+-.PP
+-A successful type search may produce a class file, a source file, or both\&. If both are found, then you can use the \f3-Xprefer\fR option to instruct the compiler which to use\&. If \f3newer\fR is specified, then the compiler uses the newer of the two files\&. If \f3source\fR is specified, the compiler uses the source file\&. The default is \f3newer\fR\&.
+-.PP
+-If a type search finds a source file for a required type, either by itself, or as a result of the setting for the \f3-Xprefer\fR option, then the compiler reads the source file to get the information it needs\&. By default the compiler also compiles the source file\&. You can use the \f3-implicit\fR option to specify the behavior\&. If \f3none\fR is specified, then no class files are generated for the source file\&. If \f3class\fR is specified, then class files are generated for the source file\&.
+-.PP
+-The compiler might not discover the need for some type information until after annotation processing completes\&. When the type information is found in a source file and no \f3-implicit\fR option is specified, the compiler gives a warning that the file is being compiled without being subject to annotation processing\&. To disable the warning, either specify the file on the command line (so that it will be subject to annotation processing) or use the \f3-implicit\fR option to specify whether or not class files should be generated for such source files\&.
+-.SH PROGRAMMATIC\ INTERFACE
+-The \f3javac\fR command supports the new Java Compiler API defined by the classes and interfaces in the \f3javax\&.tools\fR package\&.
+-.SS EXAMPLE
+-To compile as though providing command-line arguments, use the following syntax:
+-.sp
+-.nf
+-\f3JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The example writes diagnostics to the standard output stream and returns the exit code that \f3javac\fR would give when called from the command line\&.
+-.PP
+-You can use other methods in the \f3javax\&.tools\&.JavaCompiler\fR interface to handle diagnostics, control where files are read from and written to, and more\&.
+-.SS OLD\ INTERFACE
+-\fINote:\fR This API is retained for backward compatibility only\&. All new code should use the newer Java Compiler API\&.
+-.PP
+-The \f3com\&.sun\&.tools\&.javac\&.Main\fR class provides two static methods to call the compiler from a program:
+-.sp
+-.nf
+-\f3public static int compile(String[] args);\fP
+-.fi
+-.nf
+-\f3public static int compile(String[] args, PrintWriter out);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3args\fR parameter represents any of the command-line arguments that would typically be passed to the compiler\&.
+-.PP
+-The \f3out\fR parameter indicates where the compiler diagnostic output is directed\&.
+-.PP
+-The \f3return\fR value is equivalent to the \f3exit\fR value from \f3javac\fR\&.
+-.PP
+-\fINote:\fR All other classes and methods found in a package with names that start with \f3com\&.sun\&.tools\&.javac\fR (subpackages of \f3com\&.sun\&.tools\&.javac\fR) are strictly internal and subject to change at any time\&.
+-.SH EXAMPLES
+-\f3Example 1 Compile a Simple Program\fR
+-.PP
+-This example shows how to compile the \f3Hello\&.java\fR source file in the greetings directory\&. The class defined in \f3Hello\&.java\fR is called \f3greetings\&.Hello\fR\&. The greetings directory is the package directory both for the source file and the class file and is underneath the current directory\&. This makes it possible to use the default user class path\&. It also makes it unnecessary to specify a separate destination directory with the \f3-d\fR option\&.
+-.PP
+-The source code in \f3Hello\&.java\fR:
+-.sp
+-.nf
+-\f3package greetings;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class Hello {\fP
+-.fi
+-.nf
+-\f3 public static void main(String[] args) {\fP
+-.fi
+-.nf
+-\f3 for (int i=0; i < args\&.length; i++) {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Hello " + args[i]);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Compile greetings\&.Hello:
+-.sp
+-.nf
+-\f3javac greetings/Hello\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run \f3greetings\&.Hello\fR:
+-.sp
+-.nf
+-\f3java greetings\&.Hello World Universe Everyone\fP
+-.fi
+-.nf
+-\f3Hello World\fP
+-.fi
+-.nf
+-\f3Hello Universe\fP
+-.fi
+-.nf
+-\f3Hello Everyone\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Compile Multiple Source Files\fR
+-.PP
+-This example compiles the \f3Aloha\&.java\fR, \f3GutenTag\&.java\fR, \f3Hello\&.java\fR, and \f3Hi\&.java\fR source files in the \f3greetings\fR package\&.
+-.sp
+-.nf
+-\f3% javac greetings/*\&.java\fP
+-.fi
+-.nf
+-\f3% ls greetings\fP
+-.fi
+-.nf
+-\f3Aloha\&.class GutenTag\&.class Hello\&.class Hi\&.class\fP
+-.fi
+-.nf
+-\f3Aloha\&.java GutenTag\&.java Hello\&.java Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Specify a User Class Path\fR
+-.PP
+-After changing one of the source files in the previous example, recompile it:
+-.sp
+-.nf
+-\f3pwd\fP
+-.fi
+-.nf
+-\f3/examples\fP
+-.fi
+-.nf
+-\f3javac greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Because \f3greetings\&.Hi\fR refers to other classes in the \f3greetings\fR package, the compiler needs to find these other classes\&. The previous example works because the default user class path is the directory that contains the package directory\&. If you want to recompile this file without concern for which directory you are in, then add the examples directory to the user class path by setting \f3CLASSPATH\fR\&. This example uses the \f3-classpath\fR option\&.
+-.sp
+-.nf
+-\f3javac \-classpath /examples /examples/greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you change \f3greetings\&.Hi\fR to use a banner utility, then that utility also needs to be accessible through the user class path\&.
+-.sp
+-.nf
+-\f3javac \-classpath /examples:/lib/Banners\&.jar \e\fP
+-.fi
+-.nf
+-\f3 /examples/greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To execute a class in the \f3greetings\fR package, the program needs access to the \f3greetings\fR package, and to the classes that the \f3greetings\fR classes use\&.
+-.sp
+-.nf
+-\f3java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Separate Source Files and Class Files\fR
+-.PP
+-The following example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e \fP
+-.fi
+-.nf
+-\f3\-extdirs "" OldCode\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language be used to compile \f3OldCode\&.java\fR\&. The option \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&. Note that in most cases, the value of the \f3-target\fR option is the value of the \f3-source\fR option; in this example, you can omit the \f3-target\fR option\&.
+-.PP
+-You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 OldCode\&.java\fP
+-.fi
+-.nf
+-\f3warning: [options] bootstrap class path not set in conjunction with \fP
+-.fi
+-.nf
+-\f3\-source 1\&.7\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules (in this example, it uses version 1\&.7 of the Java programming language) combined with the new bootstrap classes, which can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&.
+-.PP
+-\f3Example 5 Cross Compile\fR
+-.PP
+-This example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e\fP
+-.fi
+-.nf
+-\f3 \-extdirs "" OldCode\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The\f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language to be used to compile OldCode\&.java\&. The \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&.
+-.PP
+-You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 OldCode\&.java\fP
+-.fi
+-.nf
+-\f3warning: [options] bootstrap class path not set in conjunction with \-source 1\&.7\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules combined with the new bootstrap classes\&. This combination can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&. In this example, the compiler uses release 1\&.7 of the Java programming language\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javadoc(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
++
++.SH NAME
++javac \- Reads Java class and interface definitions and compiles them into bytecode and class files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavac\fR [ \fIoptions\fR ] [ \fIsourcefiles\fR ] [ \fIclasses\fR] [ \fI@argfiles\fR ]
++.fi
++.sp
++Arguments can be in any order:
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIsourcefiles\fR
++One or more source files to be compiled (such as \f3MyClass\&.java\fR)\&.
++.TP
++\fIclasses\fR
++One or more classes to be processed for annotations (such as \f3MyPackage\&.MyClass\fR)\&.
++.TP
++\fI@argfiles\fR
++One or more files that list options and source files\&. The \f3-J\fR options are not allowed in these files\&. See Command-Line Argument Files\&.
++.SH DESCRIPTION
++The \f3javac\fR command reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files\&. The \f3javac\fR command can also process annotations in Java source files and classes\&.
++.PP
++There are two ways to pass source code file names to \f3javac\fR\&.
++.TP 0.2i
++\(bu
++For a small number of source files, list the file names on the command line\&.
++.TP 0.2i
++\(bu
++For a large number of source files, list the file names in a file that is separated by blanks or line breaks\&. Use the list file name preceded by an at sign (@) with the \f3javac\fR command\&.
++.PP
++Source code file names must have \&.java suffixes, class file names must have \&.class suffixes, and both source and class files must have root names that identify the class\&. For example, a class called \f3MyClass\fR would be written in a source file called \f3MyClass\&.java\fR and compiled into a bytecode class file called \f3MyClass\&.class\fR\&.
++.PP
++Inner class definitions produce additional class files\&. These class files have names that combine the inner and outer class names, such as \f3MyClass$MyInnerClass\&.class\fR\&.
++.PP
++Arrange source files in a directory tree that reflects their package tree\&. For example, if all of your source files are in \f3/workspace\fR, then put the source code for \f3com\&.mysoft\&.mypack\&.MyClass\fR in \f3/workspace/com/mysoft/mypack/MyClass\&.java\fR\&.
++.PP
++By default, the compiler puts each class file in the same directory as its source file\&. You can specify a separate destination directory with the \f3-d\fR option\&.
++.SH OPTIONS
++The compiler has a set of standard options that are supported on the current development environment\&. An additional set of nonstandard options are specific to the current virtual machine and compiler implementations and are subject to change in the future\&. Nonstandard options begin with the \f3-X\fR option\&.
++.TP 0.2i
++\(bu
++See also Cross-Compilation Options
++.TP 0.2i
++\(bu
++See also Nonstandard Options
++.SS STANDARD\ OPTIONS
++.TP
++-A\fIkey\fR[\fI=value\fR]
++.br
++Specifies options to pass to annotation processors\&. These options are not interpreted by \f3javac\fR directly, but are made available for use by individual processors\&. The \f3key\fR value should be one or more identifiers separated by a dot (\&.)\&.
++.TP
++-cp \fIpath\fR or -classpath \fIpath\fR
++.br
++Specifies where to find user class files, and (optionally) annotation processors and source files\&. This class path overrides the user class path in the \f3CLASSPATH\fR environment variable\&. If neither \f3CLASSPATH\fR, \f3-cp\fR nor \f3-classpath\fR is specified, then the user \fIclass path\fR is the current directory\&. See Setting the Class Path\&.
++
++If the \f3-sourcepath\fR option is not specified, then the user class path is also searched for source files\&.
++
++If the \f3-processorpath\fR option is not specified, then the class path is also searched for annotation processors\&.
++.TP
++-Djava\&.ext\&.dirs=\fIdirectories\fR
++.br
++Overrides the location of installed extensions\&.
++.TP
++-Djava\&.endorsed\&.dirs=\fIdirectories\fR
++.br
++Overrides the location of the endorsed standards path\&.
++.TP
++-d \fIdirectory\fR
++.br
++Sets the destination directory for class files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then \f3javac\fR puts the class file in a subdirectory that reflects the package name and creates directories as needed\&.
++
++If you specify \f3-d\fR\f3/home/myclasses\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the class file is \f3/home/myclasses/com/mypackage/MyClass\&.class\fR\&.
++
++If the \fI-d\fR option is not specified, then \f3javac\fR puts each class file in the same directory as the source file from which it was generated\&.
++
++\fINote:\fR The directory specified by the \fI-d\fR option is not automatically added to your user class path\&.
++.TP
++-deprecation
++.br
++Shows a description of each use or override of a deprecated member or class\&. Without the \f3-deprecation\fR option, \f3javac\fR shows a summary of the source files that use or override deprecated members or classes\&. The \f3-deprecation\fR option is shorthand for \f3-Xlint:deprecation\fR\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Sets the source file encoding name, such as EUC-JP and UTF-8\&. If the \f3-encoding\fR option is not specified, then the platform default converter is used\&.
++.TP
++-endorseddirs \fIdirectories\fR
++.br
++Overrides the location of the endorsed standards path\&.
++.TP
++-extdirs \fIdirectories\fR
++.br
++Overrides the location of the \f3ext\fR directory\&. The directories variable is a colon-separated list of directories\&. Each JAR file in the specified directories is searched for class files\&. All JAR files found become part of the class path\&.
++
++If you are cross-compiling (compiling classes against bootstrap and extension classes of a different Java platform implementation), then this option specifies the directories that contain the extension classes\&. See Cross-Compilation Options for more information\&.
++.TP
++-g
++.br
++Generates all debugging information, including local variables\&. By default, only line number and source file information is generated\&.
++.TP
++-g:none
++.br
++Does not generate any debugging information\&.
++.TP
++-g:[\fIkeyword list\fR]
++.br
++Generates only some kinds of debugging information, specified by a comma separated list of keywords\&. Valid keywords are:
++.RS
++.TP
++source
++Source file debugging information\&.
++.TP
++lines
++Line number debugging information\&.
++.TP
++vars
++Local variable debugging information\&.
++.RE
++
++.TP
++-help
++.br
++Prints a synopsis of standard options\&.
++.TP
++-implicit:[\fIclass, none\fR]
++.br
++Controls the generation of class files for implicitly loaded source files\&. To automatically generate class files, use \f3-implicit:class\fR\&. To suppress class file generation, use \f3-implicit:none\fR\&. If this option is not specified, then the default is to automatically generate class files\&. In this case, the compiler issues a warning if any such class files are generated when also doing annotation processing\&. The warning is not issued when the \f3-implicit\fR option is set explicitly\&. See Searching for Types\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++
++\fINote:\fR The \fICLASSPATH\fR, \f3-classpath\fR, \f3-bootclasspath\fR, and \f3-extdirs\fR options do not specify the classes used to run \f3javac\fR\&. Trying to customize the compiler implementation with these options and variables is risky and often does not accomplish what you want\&. If you must customize the complier implementation, then use the \f3-J\fR option to pass options through to the underlying \f3\fRJava launcher\&.
++.TP
++-nowarn
++.br
++Disables warning messages\&. This option operates the same as the \f3-Xlint:none\fR option\&.
++.TP
++-parameters
++.br
++Stores formal parameter names of constructors and methods in the generated class file so that the method \f3java\&.lang\&.reflect\&.Executable\&.getParameters\fR from the Reflection API can retrieve them\&.
++.TP
++-proc: [\fInone\fR, \fIonly\fR]
++.br
++Controls whether annotation processing and compilation are done\&. \f3-proc:none\fR means that compilation takes place without annotation processing\&. \f3-proc:only\fR means that only annotation processing is done, without any subsequent compilation\&.
++.TP
++-processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.]
++.br
++Names of the annotation processors to run\&. This bypasses the default discovery process\&.
++.TP
++-processorpath \fIpath\fR
++.br
++Specifies where to find annotation processors\&. If this option is not used, then the class path is searched for processors\&.
++.TP
++-s \fIdir\fR
++.br
++Specifies the directory where to place the generated source files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then the compiler puts the source file in a subdirectory that reflects the package name and creates directories as needed\&.
++
++If you specify \f3-s /home/mysrc\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the source file is put in \f3/home/mysrc/com/mypackage/MyClass\&.java\fR\&.
++.TP
++-source \fIrelease\fR
++.br
++Specifies the version of source code accepted\&. The following values for \f3release\fR are allowed:
++.RS
++.TP
++1\&.3
++The compiler does not support assertions, generics, or other language features introduced after Java SE 1\&.3\&.
++.TP
++1\&.4
++The compiler accepts code containing assertions, which were introduced in Java SE 1\&.4\&.
++.TP
++1\&.5
++The compiler accepts code containing generics and other language features introduced in Java SE 5\&.
++.TP
++5
++Synonym for 1\&.5\&.
++.TP
++1\&.6
++No language changes were introduced in Java SE 6\&. However, encoding errors in source files are now reported as errors instead of warnings as in earlier releases of Java Platform, Standard Edition\&.
++.TP
++6
++Synonym for 1\&.6\&.
++.TP
++1\&.7
++The compiler accepts code with features introduced in Java SE 7\&.
++.TP
++7
++Synonym for 1\&.7\&.
++.TP
++1\&.8
++This is the default value\&. The compiler accepts code with features introduced in Java SE 8\&.
++.TP
++8
++Synonym for 1\&.8\&.
++.RE
++
++.TP
++-sourcepath \fIsourcepath\fR
++.br
++Specifies the source code path to search for class or interface definitions\&. As with the user class path, source path entries are separated by colons (:) on Oracle Solaris and semicolons on Windows and can be directories, JAR archives, or ZIP archives\&. If packages are used, then the local path name within the directory or archive must reflect the package name\&.
++
++\fINote:\fR Classes found through the class path might be recompiled when their source files are also found\&. See Searching for Types\&.
++.TP
++-verbose
++.br
++Uses verbose output, which includes information about each class loaded and each source file compiled\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-werror
++.br
++Terminates compilation when warnings occur\&.
++.TP
++-X
++.br
++Displays information about nonstandard options and exits\&.
++.SS CROSS-COMPILATION\ OPTIONS
++By default, classes are compiled against the bootstrap and extension classes of the platform that \f3javac\fR shipped with\&. But \f3javac\fR also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation\&. It is important to use the \f3-bootclasspath\fR and \f3-extdirs\fR options when cross-compiling\&.
++.TP
++-target \fIversion\fR
++.br
++Generates class files that target a specified release of the virtual machine\&. Class files will run on the specified target and on later releases, but not on earlier releases of the JVM\&. Valid targets are 1\&.1, 1\&.2, 1\&.3, 1\&.4, 1\&.5 (also 5), 1\&.6 (also 6), 1\&.7 (also 7), and 1\&.8 (also 8)\&.
++
++The default for the \f3-target\fR option depends on the value of the \f3-source\fR option:
++.RS
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is not specified, then the value of the \f3-target\fR option is 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.2, then the value of the \f3-target\fR option is 1\&.4
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.3, then the value of the \f3-target\fR option is 1\&.4
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.5, then the value of the \f3-target\fR option is 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.6, then the value of the \f3-target\fR is option 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.7, then the value of the \f3-target\fR is option 1\&.8
++.TP 0.2i
++\(bu
++For all other values of the \f3-source\fR option, the value of the \f3-target\fR option is the value of the \f3-source\fR option\&.
++.RE
++
++.TP
++-bootclasspath \fIbootclasspath\fR
++.br
++Cross-compiles against the specified set of boot classes\&. As with the user class path, boot class path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives\&.
++.SS COMPACT\ PROFILE\ OPTION
++Beginning with JDK 8, the \f3javac\fR compiler supports compact profiles\&. With compact profiles, applications that do not require the entire Java platform can be deployed and run with a smaller footprint\&. The compact profiles feature could be used to shorten the download time for applications from app stores\&. This feature makes for more compact deployment of Java applications that bundle the JRE\&. This feature is also useful in small devices\&.
++.PP
++The supported profile values are \f3compact1\fR, \f3compact2\fR, and \f3compact3\fR\&. These are additive layers\&. Each higher-numbered compact profile contains all of the APIs in profiles with smaller number names\&.
++.TP
++-profile
++.br
++When using compact profiles, this option specifies the profile name when compiling\&. For example:
++.sp
++.nf
++\f3javac \-profile compact1 Hello\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++javac does not compile source code that uses any Java SE APIs that is not in the specified profile\&. Here is an example of the error message that results from attempting to compile such source code:
++.sp
++.nf
++\f3cd jdk1\&.8\&.0/bin\fP
++.fi
++.nf
++\f3\&./javac \-profile compact1 Paint\&.java\fP
++.fi
++.nf
++\f3Paint\&.java:5: error: Applet is not available in profile \&'compact1\&'\fP
++.fi
++.nf
++\f3import java\&.applet\&.Applet;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++In this example, you can correct the error by modifying the source to not use the \f3Applet\fR class\&. You could also correct the error by compiling without the -profile option\&. Then the compilation would be run against the full set of Java SE APIs\&. (None of the compact profiles include the \f3Applet\fR class\&.)
++
++An alternative way to compile with compact profiles is to use the \f3-bootclasspath\fR option to specify a path to an \f3rt\&.jar\fR file that specifies a profile\&'s image\&. Using the \f3-profile\fR option instead does not require a profile image to be present on the system at compile time\&. This is useful when cross-compiling\&.
++.SS NONSTANDARD\ OPTIONS
++.TP
++-Xbootclasspath/p:\fIpath\fR
++.br
++Adds a suffix to the bootstrap class path\&.
++.TP
++-Xbootclasspath/a:\fIpath\fR
++.br
++Adds a prefix to the bootstrap class path\&.
++.TP
++-Xbootclasspath/:\fIpath\fR
++.br
++Overrides the location of the bootstrap class files\&.
++.TP
++-Xdoclint:[-]\fIgroup\fR [\fI/access\fR]
++.br
++Enables or disables specific groups of checks, where \fIgroup\fR is one of the following values: \f3accessibility\fR, \f3syntax\fR, \f3reference\fR, \f3html\fR or \f3missing\fR\&. For more information about these groups of checks see the \f3-Xdoclint\fR option of the \f3javadoc\fR command\&. The \f3-Xdoclint\fR option is disabled by default in the \f3javac\fR command\&.
++
++The variable \fIaccess\fR specifies the minimum visibility level of classes and members that the \f3-Xdoclint\fR option checks\&. It can have one of the following values (in order of most to least visible) : \f3public\fR, \f3protected\fR, \f3package\fR and \f3private\fR\&. For example, the following option checks classes and members (with all groups of checks) that have the access level protected and higher (which includes protected, package and public):
++.sp
++.nf
++\f3\-Xdoclint:all/protected\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following option enables all groups of checks for all access levels, except it will not check for HTML errors for classes and members that have access level package and higher (which includes package and public):
++.sp
++.nf
++\f3\-Xdoclint:all,\-html/package\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-Xdoclint:none
++.br
++Disables all groups of checks\&.
++.TP
++-Xdoclint:all[\fI/access\fR]
++.br
++Enables all groups of checks\&.
++.TP
++-Xlint
++.br
++\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
++.TP
++-Xlint:all
++.br
++\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
++.TP
++-Xlint:none
++.br
++Disables all warnings\&.
++.TP
++-Xlint:\fIname\fR
++.br
++Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option for a list of warnings you can disable with this option\&.
++.TP
++-Xlint:\fI-name\fR
++.br
++Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option with the \f3-Xlint\fR option to get a list of warnings that you can disable with this option\&.
++.TP
++-Xmaxerrs \fInumber\fR
++.br
++Sets the maximum number of errors to print\&.
++.TP
++-Xmaxwarns \fInumber\fR
++.br
++Sets the maximum number of warnings to print\&.
++.TP
++-Xstdout \fIfilename\fR
++.br
++Sends compiler messages to the named file\&. By default, compiler messages go to \f3System\&.err\fR\&.
++.TP
++-Xprefer:[\fInewer,source\fR]
++.br
++Specifies which file to read when both a source file and class file are found for a type\&. (See Searching for Types)\&. If the \f3-Xprefer:newer\fR option is used, then it reads the newer of the source or class file for a type (default)\&. If the \f3-Xprefer:source\fR option is used, then it reads the source file\&. Use -\f3Xprefer:source\fR when you want to be sure that any annotation processors can access annotations declared with a retention policy of \f3SOURCE\fR\&.
++.TP
++-Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR]
++.br
++Control whether javac generates \f3package-info\&.class\fR files from package-info\&.java files\&. Possible mode arguments for this option include the following\&.
++.RS
++.TP
++always
++Always generate a \f3package-info\&.class\fR file for every \f3package-info\&.java\fR file\&. This option may be useful if you use a build system such as Ant, which checks that each \f3\&.java\fR file has a corresponding \f3\&.class\fR file\&.
++.TP
++legacy
++Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations\&. Don\&'t generate a \f3package-info\&.class\fR file if package-info\&.java only contains comments\&.
++
++\fINote:\fR A \f3package-info\&.class\fR file might be generated but be empty if all the annotations in the package-info\&.java file have \f3RetentionPolicy\&.SOURCE\fR\&.
++.TP
++nonempty
++Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations with \f3RetentionPolicy\&.CLASS\fR or \f3RetentionPolicy\&.RUNTIME\fR\&.
++.RE
++
++.TP
++-Xprint
++.br
++Prints a textual representation of specified types for debugging purposes\&. Perform neither annotation processing nor compilation\&. The format of the output could change\&.
++.TP
++-XprintProcessorInfo
++.br
++Prints information about which annotations a processor is asked to process\&.
++.TP
++-XprintRounds
++.br
++Prints information about initial and subsequent annotation processing rounds\&.
++.SH ENABLE\ OR\ DISABLE\ WARNINGS\ WITH\ THE\ -XLINT\ OPTION
++Enable warning \fIname\fR with the \f3-Xlint:name\fR option, where \f3name\fR is one of the following warning names\&. Note that you can disable a warning with the \f3-Xlint:-name:\fR option\&.
++.TP
++cast
++Warns about unnecessary and redundant casts, for example:
++.sp
++.nf
++\f3String s = (String) "Hello!"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++classfile
++Warns about issues related to class file contents\&.
++.TP
++deprecation
++Warns about the use of deprecated items, for example:
++.sp
++.nf
++\f3java\&.util\&.Date myDate = new java\&.util\&.Date();\fP
++.fi
++.nf
++\f3int currentDay = myDate\&.getDay();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The method \f3java\&.util\&.Date\&.getDay\fR has been deprecated since JDK 1\&.1
++.TP
++dep-ann
++Warns about items that are documented with an \f3@deprecated\fR Javadoc comment, but do not have a \f3@Deprecated\fR annotation, for example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @deprecated As of Java SE 7, replaced by {@link #newMethod()}\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public static void deprecatedMethood() { }\fP
++.fi
++.nf
++\f3public static void newMethod() { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++divzero
++Warns about division by the constant integer 0, for example:
++.sp
++.nf
++\f3int divideByZero = 42 / 0;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++empty
++Warns about empty statements after \f3if\fRstatements, for example:
++.sp
++.nf
++\f3class E {\fP
++.fi
++.nf
++\f3 void m() {\fP
++.fi
++.nf
++\f3 if (true) ;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++fallthrough
++Checks the switch blocks for fall-through cases and provides a warning message for any that are found\&. Fall-through cases are cases in a switch block, other than the last case in the block, whose code does not include a break statement, allowing code execution to fall through from that case to the next case\&. For example, the code following the case 1 label in this switch block does not end with a break statement:
++.sp
++.nf
++\f3switch (x) {\fP
++.fi
++.nf
++\f3case 1:\fP
++.fi
++.nf
++\f3 System\&.out\&.println("1");\fP
++.fi
++.nf
++\f3 // No break statement here\&.\fP
++.fi
++.nf
++\f3case 2:\fP
++.fi
++.nf
++\f3 System\&.out\&.println("2");\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the \f3-Xlint:fallthrough\fR option was used when compiling this code, then the compiler emits a warning about possible fall-through into case, with the line number of the case in question\&.
++.TP
++finally
++Warns about \f3finally\fR clauses that cannot complete normally, for example:
++.sp
++.nf
++\f3public static int m() {\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3 throw new NullPointerException();\fP
++.fi
++.nf
++\f3 } catch (NullPointerException(); {\fP
++.fi
++.nf
++\f3 System\&.err\&.println("Caught NullPointerException\&.");\fP
++.fi
++.nf
++\f3 return 1;\fP
++.fi
++.nf
++\f3 } finally {\fP
++.fi
++.nf
++\f3 return 0;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates a warning for the \f3finally\fR block in this example\&. When the \f3int\fR method is called, it returns a value of 0\&. A \f3finally\fR block executes when the \f3try\fR block exits\&. In this example, when control is transferred to the \f3catch\fR block, the \f3int\fR method exits\&. However, the \f3finally\fR block must execute, so it is executed, even though control was transferred outside the method\&.
++.TP
++options
++Warns about issues that related to the use of command-line options\&. See Cross-Compilation Options\&.
++.TP
++overrides
++Warns about issues regarding method overrides\&. For example, consider the following two classes:
++.sp
++.nf
++\f3public class ClassWithVarargsMethod {\fP
++.fi
++.nf
++\f3 void varargsMethod(String\&.\&.\&. s) { }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class ClassWithOverridingMethod extends ClassWithVarargsMethod {\fP
++.fi
++.nf
++\f3 @Override\fP
++.fi
++.nf
++\f3 void varargsMethod(String[] s) { }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates a warning similar to the following:\&.
++.sp
++.nf
++\f3warning: [override] varargsMethod(String[]) in ClassWithOverridingMethod \fP
++.fi
++.nf
++\f3overrides varargsMethod(String\&.\&.\&.) in ClassWithVarargsMethod; overriding\fP
++.fi
++.nf
++\f3method is missing \&'\&.\&.\&.\&'\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler encounters a \f3varargs\fR method, it translates the \f3varargs\fR formal parameter into an array\&. In the method \f3ClassWithVarargsMethod\&.varargsMethod\fR, the compiler translates the \f3varargs\fR formal parameter \f3String\&.\&.\&. s\fR to the formal parameter \f3String[] s\fR, an array, which matches the formal parameter of the method \f3ClassWithOverridingMethod\&.varargsMethod\fR\&. Consequently, this example compiles\&.
++.TP
++path
++Warns about invalid path elements and nonexistent path directories on the command line (with regard to the class path, the source path, and other paths)\&. Such warnings cannot be suppressed with the \f3@SuppressWarnings\fR annotation, for example:
++.sp
++.nf
++\f3javac \-Xlint:path \-classpath /nonexistentpath Example\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++processing
++Warn about issues regarding annotation processing\&. The compiler generates this warning when you have a class that has an annotation, and you use an annotation processor that cannot handle that type of exception\&. For example, the following is a simple annotation processor:
++
++\fISource file AnnocProc\&.java\fR:
++.sp
++.nf
++\f3import java\&.util\&.*;\fP
++.fi
++.nf
++\f3import javax\&.annotation\&.processing\&.*;\fP
++.fi
++.nf
++\f3import javax\&.lang\&.model\&.*;\fP
++.fi
++.nf
++\f3import\&.javaz\&.lang\&.model\&.element\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@SupportedAnnotationTypes("NotAnno")\fP
++.fi
++.nf
++\f3public class AnnoProc extends AbstractProcessor {\fP
++.fi
++.nf
++\f3 public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv){\fP
++.fi
++.nf
++\f3 return true;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public SourceVersion getSupportedSourceVersion() {\fP
++.fi
++.nf
++\f3 return SourceVersion\&.latest();\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fISource file AnnosWithoutProcessors\&.java\fR:
++.sp
++.nf
++\f3@interface Anno { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@Anno\fP
++.fi
++.nf
++\f3class AnnosWithoutProcessors { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following commands compile the annotation processor \f3AnnoProc\fR, then run this annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR:
++.sp
++.nf
++\f3javac AnnoProc\&.java\fP
++.fi
++.nf
++\f3javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutProcessors\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler runs the annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR, it generates the following warning:
++.sp
++.nf
++\f3warning: [processing] No processor claimed any of these annotations: Anno\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To resolve this issue, you can rename the annotation defined and used in the class \f3AnnosWithoutProcessors\fR from \f3Anno\fR to \f3NotAnno\fR\&.
++.TP
++rawtypes
++Warns about unchecked operations on raw types\&. The following statement generates a \f3rawtypes\fR warning:
++.sp
++.nf
++\f3void countElements(List l) { \&.\&.\&. }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following example does not generate a \f3rawtypes\fR warning
++.sp
++.nf
++\f3void countElements(List<?> l) { \&.\&.\&. }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\f3List\fR is a raw type\&. However, \f3List<?>\fR is an unbounded wildcard parameterized type\&. Because \f3List\fR is a parameterized interface, always specify its type argument\&. In this example, the \f3List\fR formal argument is specified with an unbounded wildcard (\f3?\fR) as its formal type parameter, which means that the \f3countElements\fR method can accept any instantiation of the \f3List\fR interface\&.
++.TP
++Serial
++Warns about missing \f3serialVersionUID\fR definitions on serializable classes, for example:
++.sp
++.nf
++\f3public class PersistentTime implements Serializable\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 private Date time;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public PersistentTime() {\fP
++.fi
++.nf
++\f3 time = Calendar\&.getInstance()\&.getTime();\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public Date getTime() {\fP
++.fi
++.nf
++\f3 return time;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates the following warning:
++.sp
++.nf
++\f3warning: [serial] serializable class PersistentTime has no definition of\fP
++.fi
++.nf
++\f3serialVersionUID\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If a serializable class does not explicitly declare a field named \f3serialVersionUID\fR, then the serialization runtime environment calculates a default \f3serialVersionUID\fR value for that class based on various aspects of the class, as described in the Java Object Serialization Specification\&. However, it is strongly recommended that all serializable classes explicitly declare \f3serialVersionUID\fR values because the default process of computing \f3serialVersionUID\fR vales is highly sensitive to class details that can vary depending on compiler implementations, and as a result, might cause an unexpected \f3InvalidClassExceptions\fR during deserialization\&. To guarantee a consistent \f3serialVersionUID\fR value across different Java compiler implementations, a serializable class must declare an explicit \f3serialVersionUID\fR value\&.
++.TP
++static
++Warns about issues relating to the use of statics, for example:
++.sp
++.nf
++\f3class XLintStatic {\fP
++.fi
++.nf
++\f3 static void m1() { }\fP
++.fi
++.nf
++\f3 void m2() { this\&.m1(); }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates the following warning:
++.sp
++.nf
++\f3warning: [static] static method should be qualified by type name, \fP
++.fi
++.nf
++\f3XLintStatic, instead of by an expression\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To resolve this issue, you can call the \f3static\fR method \f3m1\fR as follows:
++.sp
++.nf
++\f3XLintStatic\&.m1();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Alternately, you can remove the \f3static\fR keyword from the declaration of the method \f3m1\fR\&.
++.TP
++try
++Warns about issues relating to use of \f3try\fR blocks, including try-with-resources statements\&. For example, a warning is generated for the following statement because the resource \f3ac\fR declared in the \f3try\fR block is not used:
++.sp
++.nf
++\f3try ( AutoCloseable ac = getResource() ) { // do nothing}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++unchecked
++Gives more detail for unchecked conversion warnings that are mandated by the Java Language Specification, for example:
++.sp
++.nf
++\f3List l = new ArrayList<Number>();\fP
++.fi
++.nf
++\f3List<String> ls = l; // unchecked warning\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++During type erasure, the types \f3ArrayList<Number>\fR and \f3List<String>\fR become \f3ArrayList\fR and \f3List\fR, respectively\&.
++
++The \f3ls\fR command has the parameterized type \f3List<String>\fR\&. When the \f3List\fR referenced by \f3l\fR is assigned to \f3ls\fR, the compiler generates an unchecked warning\&. At compile time, the compiler and JVM cannot determine whether \f3l\fR refers to a \f3List<String>\fR type\&. In this case, \f3l\fR does not refer to a \f3List<String>\fR type\&. As a result, heap pollution occurs\&.
++
++A heap pollution situation occurs when the \f3List\fR object \f3l\fR, whose static type is \f3List<Number>\fR, is assigned to another \f3List\fR object, \f3ls\fR, that has a different static type, \f3List<String>\fR\&. However, the compiler still allows this assignment\&. It must allow this assignment to preserve backward compatibility with releases of Java SE that do not support generics\&. Because of type erasure, \f3List<Number>\fR and \f3List<String>\fR both become \f3List\fR\&. Consequently, the compiler allows the assignment of the object \f3l\fR\f3,\fR which has a raw type of \f3List\fR, to the object \f3ls\fR\&.
++.TP
++varargs
++Warns about unsafe usages of variable arguments (\f3varargs\fR) methods, in particular, those that contain non-reifiable arguments, for example:
++.sp
++.nf
++\f3public class ArrayBuilder {\fP
++.fi
++.nf
++\f3 public static <T> void addToList (List<T> listArg, T\&.\&.\&. elements) {\fP
++.fi
++.nf
++\f3 for (T x : elements) {\fP
++.fi
++.nf
++\f3 listArg\&.add(x);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR A non-reifiable type is a type whose type information is not fully available at runtime\&.
++
++The compiler generates the following warning for the definition of the method \f3ArrayBuilder\&.addToList\fR
++.sp
++.nf
++\f3warning: [varargs] Possible heap pollution from parameterized vararg type T\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler encounters a varargs method, it translates the \f3varargs\fR formal parameter into an array\&. However, the Java programming language does not permit the creation of arrays of parameterized types\&. In the method \f3ArrayBuilder\&.addToList\fR, the compiler translates the \f3varargs\fR formal parameter \f3T\&.\&.\&.\fR elements to the formal parameter \f3T[]\fR elements, an array\&. However, because of type erasure, the compiler converts the \f3varargs\fR formal parameter to \f3Object[]\fR elements\&. Consequently, there is a possibility of heap pollution\&.
++.SH COMMAND-LINE\ ARGUMENT\ FILES
++To shorten or simplify the \f3javac\fR command, you can specify one or more files that contain arguments to the \f3javac\fR command (except \f3-J\fR options)\&. This enables you to create \f3javac\fR commands of any length on any operating system\&.
++.PP
++An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be separated by spaces or new line characters\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
++.PP
++File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (*) are not allowed in these lists (such as for specifying \f3*\&.java\fR)\&. Use of the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
++.PP
++When executing the \f3javac\fR command, pass in the path and name of each argument file with the at sign (@) leading character\&. When the \f3javac\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
++.PP
++\f3Example 1 Single Argument File\fR
++.PP
++You could use a single argument file named \f3argfile\fR to hold all \f3javac\fR arguments:
++.sp
++.nf
++\f3javac @argfile\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This argument file could contain the contents of both files shown in Example 2
++.PP
++\f3Example 2 Two Argument Files\fR
++.PP
++You can create two argument files: one for the \f3javac\fR options and the other for the source file names\&. Note that the following lists have no line-continuation characters\&.
++.PP
++Create a file named options that contains the following:
++.sp
++.nf
++\f3\-d classes\fP
++.fi
++.nf
++\f3\-g\fP
++.fi
++.nf
++\f3\-sourcepath /java/pubs/ws/1\&.3/src/share/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Create a file named classes that contains the following:
++.sp
++.nf
++\f3MyClass1\&.java\fP
++.fi
++.nf
++\f3MyClass2\&.java\fP
++.fi
++.nf
++\f3MyClass3\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Then, run the \f3javac\fR command as follows:
++.sp
++.nf
++\f3javac @options @classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Argument Files with Paths\fR
++.PP
++The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
++.sp
++.nf
++\f3javac @path1/options @path2/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH ANNOTATION\ PROCESSING
++The \f3javac\fR command provides direct support for annotation processing, superseding the need for the separate annotation processing command, \f3apt\fR\&.
++.PP
++The API for annotation processors is defined in the \f3javax\&.annotation\&.processing\fR and j\f3avax\&.lang\&.model\fR packages and subpackages\&.
++.SS HOW\ ANNOTATION\ PROCESSING\ WORKS
++Unless annotation processing is disabled with the \f3-proc:none\fR option, the compiler searches for any annotation processors that are available\&. The search path can be specified with the \f3-processorpath\fR option\&. If no path is specified, then the user class path is used\&. Processors are located by means of service provider-configuration files named \f3META-INF/services/javax\&.annotation\&.processing\fR\&.Processor on the search path\&. Such files should contain the names of any annotation processors to be used, listed one per line\&. Alternatively, processors can be specified explicitly, using the \f3-processor\fR option\&.
++.PP
++After scanning the source files and classes on the command line to determine what annotations are present, the compiler queries the processors to determine what annotations they process\&. When a match is found, the processor is called\&. A processor can claim the annotations it processes, in which case no further attempt is made to find any processors for those annotations\&. After all of the annotations are claimed, the compiler does not search for additional processors\&.
++.PP
++If any processors generate new source files, then another round of annotation processing occurs: Any newly generated source files are scanned, and the annotations processed as before\&. Any processors called on previous rounds are also called on all subsequent rounds\&. This continues until no new source files are generated\&.
++.PP
++After a round occurs where no new source files are generated, the annotation processors are called one last time, to give them a chance to complete any remaining work\&. Finally, unless the \f3-proc:only\fR option is used, the compiler compiles the original and all generated source files\&.
++.SS IMPLICITLY\ LOADED\ SOURCE\ FILES
++To compile a set of source files, the compiler might need to implicitly load additional source files\&. See Searching for Types\&. Such files are currently not subject to annotation processing\&. By default, the compiler gives a warning when annotation processing occurred and any implicitly loaded source files are compiled\&. The \f3-implicit\fR option provides a way to suppress the warning\&.
++.SH SEARCHING\ FOR\ TYPES
++To compile a source file, the compiler often needs information about a type, but the type definition is not in the source files specified on the command line\&. The compiler needs type information for every class or interface used, extended, or implemented in the source file\&. This includes classes and interfaces not explicitly mentioned in the source file, but that provide information through inheritance\&.
++.PP
++For example, when you create a subclass \f3java\&.applet\&.Applet\fR, you are also using the ancestor classes of \f3Applet\fR: \f3java\&.awt\&.Panel\fR, \f3java\&.awt\&.Container\fR, \f3java\&.awt\&.Component\fR, and \f3java\&.lang\&.Object\fR\&.
++.PP
++When the compiler needs type information, it searches for a source file or class file that defines the type\&. The compiler searches for class files first in the bootstrap and extension classes, then in the user class path (which by default is the current directory)\&. The user class path is defined by setting the \f3CLASSPATH\fR environment variable or by using the \f3-classpath\fR option\&.
++.PP
++If you set the \f3-sourcepath\fR option, then the compiler searches the indicated path for source files\&. Otherwise, the compiler searches the user class path for both class files and source files\&.
++.PP
++You can specify different bootstrap or extension classes with the \f3-bootclasspath\fR and the \f3-extdirs\fR options\&. See Cross-Compilation Options\&.
++.PP
++A successful type search may produce a class file, a source file, or both\&. If both are found, then you can use the \f3-Xprefer\fR option to instruct the compiler which to use\&. If \f3newer\fR is specified, then the compiler uses the newer of the two files\&. If \f3source\fR is specified, the compiler uses the source file\&. The default is \f3newer\fR\&.
++.PP
++If a type search finds a source file for a required type, either by itself, or as a result of the setting for the \f3-Xprefer\fR option, then the compiler reads the source file to get the information it needs\&. By default the compiler also compiles the source file\&. You can use the \f3-implicit\fR option to specify the behavior\&. If \f3none\fR is specified, then no class files are generated for the source file\&. If \f3class\fR is specified, then class files are generated for the source file\&.
++.PP
++The compiler might not discover the need for some type information until after annotation processing completes\&. When the type information is found in a source file and no \f3-implicit\fR option is specified, the compiler gives a warning that the file is being compiled without being subject to annotation processing\&. To disable the warning, either specify the file on the command line (so that it will be subject to annotation processing) or use the \f3-implicit\fR option to specify whether or not class files should be generated for such source files\&.
++.SH PROGRAMMATIC\ INTERFACE
++The \f3javac\fR command supports the new Java Compiler API defined by the classes and interfaces in the \f3javax\&.tools\fR package\&.
++.SS EXAMPLE
++To compile as though providing command-line arguments, use the following syntax:
++.sp
++.nf
++\f3JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The example writes diagnostics to the standard output stream and returns the exit code that \f3javac\fR would give when called from the command line\&.
++.PP
++You can use other methods in the \f3javax\&.tools\&.JavaCompiler\fR interface to handle diagnostics, control where files are read from and written to, and more\&.
++.SS OLD\ INTERFACE
++\fINote:\fR This API is retained for backward compatibility only\&. All new code should use the newer Java Compiler API\&.
++.PP
++The \f3com\&.sun\&.tools\&.javac\&.Main\fR class provides two static methods to call the compiler from a program:
++.sp
++.nf
++\f3public static int compile(String[] args);\fP
++.fi
++.nf
++\f3public static int compile(String[] args, PrintWriter out);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3args\fR parameter represents any of the command-line arguments that would typically be passed to the compiler\&.
++.PP
++The \f3out\fR parameter indicates where the compiler diagnostic output is directed\&.
++.PP
++The \f3return\fR value is equivalent to the \f3exit\fR value from \f3javac\fR\&.
++.PP
++\fINote:\fR All other classes and methods found in a package with names that start with \f3com\&.sun\&.tools\&.javac\fR (subpackages of \f3com\&.sun\&.tools\&.javac\fR) are strictly internal and subject to change at any time\&.
++.SH EXAMPLES
++\f3Example 1 Compile a Simple Program\fR
++.PP
++This example shows how to compile the \f3Hello\&.java\fR source file in the greetings directory\&. The class defined in \f3Hello\&.java\fR is called \f3greetings\&.Hello\fR\&. The greetings directory is the package directory both for the source file and the class file and is underneath the current directory\&. This makes it possible to use the default user class path\&. It also makes it unnecessary to specify a separate destination directory with the \f3-d\fR option\&.
++.PP
++The source code in \f3Hello\&.java\fR:
++.sp
++.nf
++\f3package greetings;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class Hello {\fP
++.fi
++.nf
++\f3 public static void main(String[] args) {\fP
++.fi
++.nf
++\f3 for (int i=0; i < args\&.length; i++) {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Hello " + args[i]);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Compile greetings\&.Hello:
++.sp
++.nf
++\f3javac greetings/Hello\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run \f3greetings\&.Hello\fR:
++.sp
++.nf
++\f3java greetings\&.Hello World Universe Everyone\fP
++.fi
++.nf
++\f3Hello World\fP
++.fi
++.nf
++\f3Hello Universe\fP
++.fi
++.nf
++\f3Hello Everyone\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Compile Multiple Source Files\fR
++.PP
++This example compiles the \f3Aloha\&.java\fR, \f3GutenTag\&.java\fR, \f3Hello\&.java\fR, and \f3Hi\&.java\fR source files in the \f3greetings\fR package\&.
++.sp
++.nf
++\f3% javac greetings/*\&.java\fP
++.fi
++.nf
++\f3% ls greetings\fP
++.fi
++.nf
++\f3Aloha\&.class GutenTag\&.class Hello\&.class Hi\&.class\fP
++.fi
++.nf
++\f3Aloha\&.java GutenTag\&.java Hello\&.java Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Specify a User Class Path\fR
++.PP
++After changing one of the source files in the previous example, recompile it:
++.sp
++.nf
++\f3pwd\fP
++.fi
++.nf
++\f3/examples\fP
++.fi
++.nf
++\f3javac greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Because \f3greetings\&.Hi\fR refers to other classes in the \f3greetings\fR package, the compiler needs to find these other classes\&. The previous example works because the default user class path is the directory that contains the package directory\&. If you want to recompile this file without concern for which directory you are in, then add the examples directory to the user class path by setting \f3CLASSPATH\fR\&. This example uses the \f3-classpath\fR option\&.
++.sp
++.nf
++\f3javac \-classpath /examples /examples/greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you change \f3greetings\&.Hi\fR to use a banner utility, then that utility also needs to be accessible through the user class path\&.
++.sp
++.nf
++\f3javac \-classpath /examples:/lib/Banners\&.jar \e\fP
++.fi
++.nf
++\f3 /examples/greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To execute a class in the \f3greetings\fR package, the program needs access to the \f3greetings\fR package, and to the classes that the \f3greetings\fR classes use\&.
++.sp
++.nf
++\f3java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Separate Source Files and Class Files\fR
++.PP
++The following example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
++.sp
++.nf
++\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e \fP
++.fi
++.nf
++\f3\-extdirs "" OldCode\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language be used to compile \f3OldCode\&.java\fR\&. The option \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&. Note that in most cases, the value of the \f3-target\fR option is the value of the \f3-source\fR option; in this example, you can omit the \f3-target\fR option\&.
++.PP
++You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
++.sp
++.nf
++\f3javac \-source 1\&.7 OldCode\&.java\fP
++.fi
++.nf
++\f3warning: [options] bootstrap class path not set in conjunction with \fP
++.fi
++.nf
++\f3\-source 1\&.7\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules (in this example, it uses version 1\&.7 of the Java programming language) combined with the new bootstrap classes, which can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&.
++.PP
++\f3Example 5 Cross Compile\fR
++.PP
++This example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
++.sp
++.nf
++\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e\fP
++.fi
++.nf
++\f3 \-extdirs "" OldCode\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The\f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language to be used to compile OldCode\&.java\&. The \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&.
++.PP
++You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
++.sp
++.nf
++\f3javac \-source 1\&.7 OldCode\&.java\fP
++.fi
++.nf
++\f3warning: [options] bootstrap class path not set in conjunction with \-source 1\&.7\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules combined with the new bootstrap classes\&. This combination can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&. In this example, the compiler uses release 1\&.7 of the Java programming language\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javadoc(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jdb(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/javadoc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/javadoc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Basic Tools
+-.\" Title: javadoc.1
+-.\"
+-.if n .pl 99999
+-.TH javadoc 1 "03 March 2015" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Basic Tools
++.\" Title: javadoc.1
++.\"
++.if n .pl 99999
++.TH javadoc 1 "03 March 2015" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,2957 +47,2957 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javadoc \- Generates HTML pages of API documentation from Java source files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavadoc\fR {\fIpackages\fR|\fIsource\-files\fR} [\fIoptions\fR] [\fI@argfiles\fR]
+-.fi
+-.sp
+-.TP
+-\fIpackages\fR
+-Names of packages that you want to document, separated by spaces, for example \f3java\&.lang java\&.lang\&.reflect java\&.awt\fR\&. If you want to also document the subpackages, use the \f3-subpackages\fR option to specify the packages\&.
+-
+-By default, \f3javadoc\fR looks for the specified packages in the current directory and subdirectories\&. Use the \f3-sourcepath\fR option to specify the list of directories where to look for packages\&.
+-.TP
+-\fIsource-files\fR
+-Names of Java source files that you want to document, separated by spaces, for example \f3Class\&.java Object\&.java Button\&.java\fR\&. By default, \f3javadoc\fR looks for the specified classes in the current directory\&. However, you can specify the full path to the class file and use wildcard characters, for example \f3/home/src/java/awt/Graphics*\&.java\fR\&. You can also specify the path relative to the current directory\&.
+-.TP
+-\fIoptions\fR
+-Command-line options, separated by spaces\&. See Options\&.
+-.TP
+-\fI@argfiles\fR
+-Names of files that contain a list of \f3javadoc\fR command options, package names and source file names in any order\&.
+-.SH DESCRIPTION
+-The \f3javadoc\fR command parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages that describe (by default) the public and protected classes, nested classes (but not anonymous inner classes), interfaces, constructors, methods, and fields\&. You can use the \f3javadoc\fR command to generate the API documentation or the implementation documentation for a set of source files\&.
+-.PP
+-You can run the \f3javadoc\fR command on entire packages, individual source files, or both\&. When documenting entire packages, you can either use the \f3-subpackages\fR option to recursively traverse a directory and its subdirectories, or to pass in an explicit list of package names\&. When you document individual source files, pass in a list of Java source file names\&. See Simple Examples\&.
+-.SS PROCESS\ SOURCE\ FILES
+-The \f3javadoc\fR command processes files that end in source and other files described in Source Files\&. If you run the \f3javadoc\fR command by passing in individual source file names, then you can determine exactly which source files are processed\&. However, that is not how most developers want to work, because it is simpler to pass in package names\&. The \f3javadoc\fR command can be run three ways without explicitly specifying the source file names\&. You can pass in package names, use the \f3-subpackages\fR option, or use wild cards with source file names\&. In these cases, the \f3javadoc\fR command processes a source file only when the file fulfills all of the following requirements:
+-.TP 0.2i
+-\(bu
+-The file name prefix (with \f3\&.java\fR removed) is a valid class name\&.
+-.TP 0.2i
+-\(bu
+-The path name relative to the root of the source tree is a valid package name after the separators are converted to dots\&.
+-.TP 0.2i
+-\(bu
+-The package statement contains the valid package name\&.
+-.PP
+-Processing Links
+-
+-During a run, the \f3javadoc\fR command adds cross-reference links to package, class, and member names that are being documented as part of that run\&. Links appear in the following places\&. See Javadoc Tags for a description of the @ tags\&.
+-.TP 0.2i
+-\(bu
+-Declarations (return types, argument types, and field types)\&.
+-.TP 0.2i
+-\(bu
+-\fISee Also\fR sections that are generated from \f3@see\fR tags\&.
+-.TP 0.2i
+-\(bu
+-Inline text generated from \f3{@link}\fR tags\&.
+-.TP 0.2i
+-\(bu
+-Exception names generated from \f3@throws\fR tags\&.
+-.TP 0.2i
+-\(bu
+-\fISpecified by\fR links to interface members and \fIOverrides\fR links to class members\&. See Method Comment Inheritance\&.
+-.TP 0.2i
+-\(bu
+-Summary tables listing packages, classes and members\&.
+-.TP 0.2i
+-\(bu
+-Package and class inheritance trees\&.
+-.TP 0.2i
+-\(bu
+-The index\&.
+-.PP
+-You can add links to existing text for classes not included on the command line (but generated separately) by way of the \f3-link\fR and \f3-linkoffline\fR options\&.
+-.PP
+-Processing Details
+-
+-The \f3javadoc\fR command produces one complete document every time it runs\&. It does not do incremental builds that modify or directly incorporate the results from earlier runs\&. However, the \f3javadoc\fR command can link to results from other runs\&.
+-.PP
+-The \f3javadoc\fR command implementation requires and relies on the Java compiler\&. The \f3javadoc\fR command calls part of the \f3javac\fR command to compile the declarations and ignore the member implementations\&. The \f3javadoc\fR command builds a rich internal representation of the classes that includes the class hierarchy and use relationships to generate the HTML\&. The \f3javadoc\fR command also picks up user-supplied documentation from documentation comments in the source code\&. See Documentation Comments\&.
+-.PP
+-The \f3javadoc\fR command runs on source files that are pure stub files with no method bodies\&. This means you can write documentation comments and run the \f3javadoc\fR command in the early stages of design before API implementation\&.
+-.PP
+-Relying on the compiler ensures that the HTML output corresponds exactly with the actual implementation, which may rely on implicit, rather than explicit, source code\&. For example, the \f3javadoc\fR command documents default constructors that are present in the compiled class files but not in the source code\&.
+-.PP
+-In many cases, the \f3javadoc\fR command lets you generate documentation for source files with incomplete or erroneous code\&. You can generate documentation before all debugging and troubleshooting is done\&. The \f3javadoc\fR command does primitive checking of documentation comments\&.
+-.PP
+-When the \f3javadoc\fR command builds its internal structure for the documentation, it loads all referenced classes\&. Because of this, the \f3javadoc\fR command must be able to find all referenced classes, whether bootstrap classes, extensions, or user classes\&. See How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-.PP
+-Typically, classes you create must either be loaded as an extension or in the \f3javadoc\fR command class path\&.
+-.SS JAVADOC\ DOCLETS
+-You can customize the content and format of the \f3javadoc\fR command output with doclets\&. The \f3javadoc\fR command has a default built-in doclet, called the standard doclet, that generates HTML-formatted API documentation\&. You can modify or make a subclass of the standard doclet, or write your own doclet to generate HTML, XML, MIF, RTF or whatever output format you want\&.
+-.PP
+-When a custom doclet is not specified with the \f3-doclet\fR option, the \f3javadoc\fR command uses the default standard doclet\&. The \f3javadoc\fR command has several options that are available regardless of which doclet is being used\&. The standard doclet adds a supplementary set of command-line options\&. See Options\&.
+-.SH SOURCE\ FILES
+-The \f3javadoc\fR command generates output that originates from the following types of source files: Java language source files for classes (\f3\&.java\fR), package comment files, overview comment files, and miscellaneous unprocessed files\&. This section also describes test files and template files that can also be in the source tree, but that you want to be sure not to document\&.
+-.SS CLASS\ SOURCE\ FILES
+-Each class or interface and its members can have their own documentation comments contained in a source file\&. See Documentation Comments\&.
+-.SS PACKAGE\ COMMENT\ FILES
+-Each package can have its own documentation comment, contained in its own source file, that the \f3javadoc\fR command merges into the generated package summary page\&. You typically include in this comment any documentation that applies to the entire package\&.
+-.PP
+-To create a package comment file, you can place your comments in one of the following files:
+-.TP 0.2i
+-\(bu
+-The \f3package-info\&.java\fR file can contain the package declaration, package annotations, package comments, and Javadoc tags\&. This file is preferred\&.
+-.TP 0.2i
+-\(bu
+-The \f3package\&.html\fR file contains only package comments and Javadoc tags\&. No package annotations\&.
+-.PP
+-A package can have a single \f3package\&.html\fR file or a single \f3package-info\&.java\fR file, but not both\&. Place either file in the package directory in the source tree with your source files\&.
+-.PP
+-The package-info\&.java File
+-
+-The \f3package-info\&.java\fR file can contain a package comment of the following structure\&. The comment is placed before the package declaration\&.
+-.PP
+-\fINote:\fR The comment separators \f3/**\fR and \f3*/\fR must be present, but the leading asterisks on the intermediate lines can be left off\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Provides the classes necessary to create an \fP
+-.fi
+-.nf
+-\f3 * applet and the classes an applet uses \fP
+-.fi
+-.nf
+-\f3 * to communicate with its applet context\&.\fP
+-.fi
+-.nf
+-\f3 * <p>\fP
+-.fi
+-.nf
+-\f3 * The applet framework involves two entities:\fP
+-.fi
+-.nf
+-\f3 * the applet and the applet context\&.\fP
+-.fi
+-.nf
+-\f3 * An applet is an embeddable window (see the\fP
+-.fi
+-.nf
+-\f3 * {@link java\&.awt\&.Panel} class) with a few extra\fP
+-.fi
+-.nf
+-\f3 * methods that the applet context can use to \fP
+-.fi
+-.nf
+-\f3 * initialize, start, and stop the applet\&.\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @since 1\&.0\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3package java\&.lang\&.applet;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-The package\&.html File
+-
+-The \f3package\&.html\fR file can contain a package comment of the following structure\&. The comment is placed in the \f3<body>\fR element\&.
+-.PP
+-File: \f3java/applet/package\&.html\fR
+-.sp
+-.nf
+-\f3<HTML>\fP
+-.fi
+-.nf
+-\f3<BODY>\fP
+-.fi
+-.nf
+-\f3Provides the classes necessary to create an applet and the \fP
+-.fi
+-.nf
+-\f3classes an applet uses to communicate with its applet context\&.\fP
+-.fi
+-.nf
+-\f3<p>\fP
+-.fi
+-.nf
+-\f3The applet framework involves two entities: the applet\fP
+-.fi
+-.nf
+-\f3and the applet context\&. An applet is an embeddable\fP
+-.fi
+-.nf
+-\f3window (see the {@link java\&.awt\&.Panel} class) with a\fP
+-.fi
+-.nf
+-\f3few extra methods that the applet context can use to\fP
+-.fi
+-.nf
+-\f3initialize, start, and stop the applet\&. \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@since 1\&.0 \fP
+-.fi
+-.nf
+-\f3@see java\&.awt\fP
+-.fi
+-.nf
+-\f3</BODY>\fP
+-.fi
+-.nf
+-\f3</HTML>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3package\&.html\fR file is a typical HTML file and does not include a package declaration\&. The content of the package comment file is written in HTML with one exception\&. The documentation comment should not include the comment separators \f3/**\fR and \f3*/\fR or leading asterisks\&. When writing the comment, make the first sentence a summary about the package, and do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. You can include package tags\&. All block tags must appear after the main description\&. If you add an \f3@see\fR tag in a package comment file, then it must have a fully qualified name\&.
+-.PP
+-Processing the Comment File
+-
+-When the \f3javadoc\fR command runs, it searches for the package comment file\&. If the package comment file is found, then the \f3javadoc\fR command does the following:
+-.TP 0.2i
+-\(bu
+-Copies the comment for processing\&. For package\&.html, the \f3javadoc\fR command copies all content between the \f3<body>\fR and \f3</body>\fR HTML tags\&. You can include a \f3<head>\fR section to put a \f3<title>\fR tag, source file copyright statement, or other information, but none of these appear in the generated documentation\&.
+-.TP 0.2i
+-\(bu
+-Processes the package tags\&. See Package Tags\&.
+-.TP 0.2i
+-\(bu
+-Inserts the processed text at the bottom of the generated package summary page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-.TP 0.2i
+-\(bu
+-Copies the first sentence of the package comment to the top of the package summary page\&. The \f3javadoc\fR command also adds the package name and this first sentence to the list of packages on the overview page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-
+-The end of the sentence is determined by the same rules used for the end of the first sentence of class and member main descriptions\&.
+-.SS OVERVIEW\ COMMENT\ FILES
+-Each application or set of packages that you are documenting can have its own overview documentation comment that is kept in its own source file, that the \f3javadoc\fR command merges into the generated overview page\&. You typically include in this comment any documentation that applies to the entire application or set of packages\&.
+-.PP
+-You can name the file anything you want such as overview\&.html and place it anywhere\&. A typical location is at the top of the source tree\&.
+-.PP
+-For example, if the source files for the \f3java\&.applet\fR package are contained in the /home/user/src/java/applet directory, then you could create an overview comment file at /home/user/src/overview\&.html\&.
+-.PP
+-You can have multiple overview comment files for the same set of source files in case you want to run the \f3javadoc\fR command multiple times on different sets of packages\&. For example, you could run the \f3javadoc\fR command once with \f3-private\fR for internal documentation and again without that option for public documentation\&. In this case, you could describe the documentation as public or internal in the first sentence of each overview comment file\&.
+-.PP
+-The content of the overview comment file is one big documentation comment that is written in HTML\&. Make the first sentence a summary about the application or set of packages\&. Do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. All tags except inline tags, such as an {\f3@link}\fR tag, must appear after the main description\&. If you add an \f3@see\fR tag, then it must have a fully qualified name\&.
+-.PP
+-When you run the \f3javadoc\fR command, specify the overview comment file name with the \f3-overview\fR option\&. The file is then processed similarly to that of a package comment file\&. The \f3javadoc\fR command does the following:
+-.TP 0.2i
+-\(bu
+-Copies all content between the \f3<body>\fR and \f3</body>\fR tags for processing\&.
+-.TP 0.2i
+-\(bu
+-Processes the overview tags that are present\&. See Overview Tags\&.
+-.TP 0.2i
+-\(bu
+-Inserts the processed text at the bottom of the generated overview page\&. See Java Platform Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-.TP 0.2i
+-\(bu
+-Copies the first sentence of the overview comment to the top of the overview summary page\&.
+-.SS UNPROCESSED\ FILES
+-Your source files can include any files that you want the \f3javadoc\fR command to copy to the destination directory\&. These files usually include graphic files, example Java source and class files, and self-standing HTML files with a lot of content that would overwhelm the documentation comment of a typical Java source file\&.
+-.PP
+-To include unprocessed files, put them in a directory called doc-files\&. The doc-files directory can be a subdirectory of any package directory that contains source files\&. You can have one doc-files subdirectory for each package\&.
+-.PP
+-For example, if you want to include the image of a button in the \f3java\&.awt\&.Button\fR class documentation, then place the image file in the /home/user/src/java/awt/doc-files/ directory\&. Do not place the doc-files directory at /home/user/src/java/doc-files, because java is not a package\&. It does not contain any source files\&.
+-.PP
+-All links to the unprocessed files must be included in the code because the \f3javadoc\fR command does not look at the files\&. The \f3javadoc\fR command copies the directory and all of its contents to the destination\&. The following example shows how the link in the Button\&.java documentation comment might look:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This button looks like this: \fP
+-.fi
+-.nf
+-\f3 * <img src="doc\-files/Button\&.gif">\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS TEST\ AND\ TEMPLATE\ FILES
+-You can store test and template files in the source tree in the same directory with or in a subdirectory of the directory where the source files reside\&. To prevent test and template files from being processed, run the \f3javadoc\fR command and explicitly pass in individual source file names\&.
+-.PP
+-Test files are valid, compilable source files\&. Template files are not valid, compatible source files, but they often have the \f3\&.java\fR suffix\&.
+-.PP
+-Test Files
+-
+-If you want your test files to belong to either an unnamed package or to a package other than the package that the source files are in, then put the test files in a subdirectory underneath the source files and give the directory an invalid name\&. If you put the test files in the same directory with the source and call the \f3javadoc\fR command with a command-line argument that indicates its package name, then the test files cause warnings or errors\&. If the files are in a subdirectory with an invalid name, then the test file directory is skipped and no errors or warnings are issued\&. For example, to add test files for source files in com\&.package1, put them in a subdirectory in an invalid package name\&. The following directory name is invalid because it contains a hyphen:
+-.sp
+-.nf
+-\f3com/package1/test\-files/\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If your test files contain documentation comments, then you can set up a separate run of the \f3javadoc\fR command to produce test file documentation by passing in their test source file names with wild cards, such as \f3com/package1/test-files/*\&.java\fR\&.
+-.PP
+-Template Files
+-
+-If you want a template file to be in the source directory, but not generate errors when you execute the \f3javadoc\fR command, then give it an invalid file name such as \f3Buffer-Template\&.java\fR to prevent it from being processed\&. The \f3javadoc\fR command only processes source files with names, when stripped of the \f3\&.java\fR suffix, that are valid class names\&.
+-.SH GENERATED\ FILES
+-By default, the \f3javadoc\fR command uses a standard doclet that generates HTML-formatted documentation\&. The standard doclet generates basic content, cross-reference, and support pages described here\&. Each HTML page corresponds to a separate file\&. The \f3javadoc\fR command generates two types of files\&. The first type is named after classes and interfaces\&. The second type contain hyphens (such as package-summary\&.html) to prevent conflicts with the first type of file\&.
+-.SS BASIC\ CONTENT\ PAGES
+-.TP 0.2i
+-\(bu
+-One class or interface page (classname\&.html) for each class or interface being documented\&.
+-.TP 0.2i
+-\(bu
+-One package page (package-summary\&.html) for each package being documented\&. The \f3javadoc\fR command includes any HTML text provided in a file with the name package\&.html or package-info\&.java in the package directory of the source tree\&.
+-.TP 0.2i
+-\(bu
+-One overview page (overview-summary\&.html) for the entire set of packages\&. The overview page is the front page of the generated document\&. The \f3javadoc\fR command includes any HTML text provided in a file specified by the \f3-overview\fR option\&. The Overview page is created only when you pass two or more package names into the \f3javadoc\fR command\&. See HTML Frames and Options\&.
+-.SS CROSS-REFERENCE\ PAGES
+-.TP 0.2i
+-\(bu
+-One class hierarchy page for the entire set of packages (overview-tree\&.html)\&. To view the hierarchy page, click \fIOverview\fR in the navigation bar and click \fITree\fR\&.
+-.TP 0.2i
+-\(bu
+-One class hierarchy page for each package (package-tree\&.html) To view the hierarchy page, go to a particular package, class, or interface page, and click \fITree\fR to display the hierarchy for that package\&.
+-.TP 0.2i
+-\(bu
+-One use page for each package (package-use\&.html) and a separate use page for each class and interface (class-use/classname\&.html)\&. The use page describes what packages, classes, methods, constructors and fields use any part of the specified class, interface, or package\&. For example, given a class or interface A, its use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A\&. To view the use page, go to the package, class, or interface and click the \fIUse\fR link in the navigation bar\&.
+-.TP 0.2i
+-\(bu
+-A deprecated API page (deprecated-list\&.html) that lists all deprecated APIs and their suggested replacements\&. Avoid deprecated APIs because they can be removed in future implementations\&.
+-.TP 0.2i
+-\(bu
+-A constant field values page (constant-values\&.html) for the values of static fields\&.
+-.TP 0.2i
+-\(bu
+-A serialized form page (serialized-form\&.html) that provides information about serializable and externalizable classes with field and method descriptions\&. The information on this page is of interest to reimplementors, and not to developers who want to use the API\&. To access the serialized form page, go to any serialized class and click \fISerialized Form\fR in the See Also section of the class comment\&. The standard doclet generates a serialized form page that lists any class (public or non-public) that implements Serializable with its \f3readObject\fR and \f3writeObject\fR methods, the fields that are serialized, and the documentation comments from the \f3@serial\fR, \f3@serialField\fR, and \f3@serialData\fR tags\&. Public serializable classes can be excluded by marking them (or their package) with \f3@serial\fR exclude, and package-private serializable classes can be included by marking them (or their package) with an \f3@serial\fR include\&. As of Release 1\&.4, you can generate the complete serialized form for public and private classes by running the \f3javadoc\fR command without specifying the \f3-private\fR option\&. See Options\&.
+-.TP 0.2i
+-\(bu
+-An index page (\f3index-*\&.html\fR) of all class, interface, constructor, field and method names, in alphabetical order\&. The index page is internationalized for Unicode and can be generated as a single file or as a separate file for each starting character (such as A\(enZ for English)\&.
+-.SS SUPPORT\ PAGES
+-.TP 0.2i
+-\(bu
+-A help page (help-doc\&.html) that describes the navigation bar and the previous pages\&. Use \f3-helpfile\fR to override the default help file with your own custom help file\&.
+-.TP 0.2i
+-\(bu
+-One index\&.html file that creates the HTML frames for display\&. Load this file to display the front page with frames\&. The index\&.html file contains no text content\&.
+-.TP 0.2i
+-\(bu
+-Several frame files (\f3*-frame\&.html\fR) that contains lists of packages, classes, and interfaces\&. The frame files display the HTML frames\&.
+-.TP 0.2i
+-\(bu
+-A package list file (package-list) that is used by the \f3-link\fR and \f3-linkoffline\fR options\&. The package list file is a text file that is not reachable through links\&.
+-.TP 0.2i
+-\(bu
+-A style sheet file (stylesheet\&.css) that controls a limited amount of color, font family, font size, font style, and positioning information on the generated pages\&.
+-.TP 0.2i
+-\(bu
+-A doc-files directory that holds image, example, source code, or other files that you want copied to the destination directory\&. These files are not processed by the \f3javadoc\fR command\&. This directory is not processed unless it exists in the source tree\&.
+-.PP
+-See Options\&.
+-.SS HTML\ FRAMES
+-The \f3javadoc\fR command generates the minimum number of frames (two or three) necessary based on the values passed to the command\&. It omits the list of packages when you pass a single package name or source files that belong to a single package as an argument to the \f3javadoc\fR command\&. Instead, the \f3javadoc\fR command creates one frame in the left-hand column that displays the list of classes\&. When you pass two or more package names, the \f3javadoc\fR command creates a third frame that lists all packages and an overview page (overview-summary\&.html)\&. To bypass frames, click the \fINo Frames\fR link or enter the page set from the overview-summary\&.html page\&.
+-.SS GENERATED\ FILE\ STRUCTURE
+-The generated class and interface files are organized in the same directory hierarchy that Java source files and class files are organized\&. This structure is one directory per subpackage\&.
+-.PP
+-For example, the document generated for the \f3java\&.applet\&.Applet\fR class would be located at java/applet/Applet\&.html\&.
+-.PP
+-The file structure for the \f3java\&.applet\fR package follows, assuming that the destination directory is named \f3apidocs\fR\&. All files that contain the word \fIframe\fR appear in the upper-left or lower-left frames, as noted\&. All other HTML files appear in the right-hand frame\&.
+-.PP
+-Directories are bold\&. The asterisks (*) indicate the files and directories that are omitted when the arguments to the \f3javadoc\fR command are source file names rather than package names\&. When arguments are source file names, an empty package list is created\&. The doc-files directory is not created in the destination unless it exists in the source tree\&. See Generated Files\&.
+-.TP 0.2i
+-\(bu
+-\fIapidocs\fR: Top-level directory
+-.RS
+-.TP 0.2i
+-\(bu
+-index\&.html: Initial Page that sets up HTML frames
+-.TP 0.2i
+-\(bu
+-*overview-summary\&.html: Package list with summaries
+-.TP 0.2i
+-\(bu
+-overview-tree\&.html: Class hierarchy for all packages
+-.TP 0.2i
+-\(bu
+-deprecated-list\&.html: Deprecated APIs for all packages
+-.TP 0.2i
+-\(bu
+-constant-values\&.html: Static field values for all packages
+-.TP 0.2i
+-\(bu
+-serialized-form\&.html: Serialized forms for all packages
+-.TP 0.2i
+-\(bu
+-*overview-frame\&.html: All packages for display in upper-left frame
+-.TP 0.2i
+-\(bu
+-allclasses-frame\&.html: All classes for display in lower-left frame
+-.TP 0.2i
+-\(bu
+-help-doc\&.html: Help about Javadoc page organization
+-.TP 0.2i
+-\(bu
+-index-all\&.html: Default index created without \f3-splitindex\fR option
+-.TP 0.2i
+-\(bu
+-\fIindex-files\fR: Directory created with \f3-splitindex\fR option
+-.RS
+-.TP 0.2i
+-\(bu
+-index-<number>\&.html: Index files created with \f3-splitindex\fR option
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-package-list: Package names for resolving external references
+-.TP 0.2i
+-\(bu
+-stylesheet\&.css: Defines fonts, colors, positions, and so on
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-\fIjava\fR: Package directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIapplet\fR: Subpackage directory
+-.RS
+-.TP 0.2i
+-\(bu
+-Applet\&.html: \f3Applet\fR class page
+-.TP 0.2i
+-\(bu
+-AppletContext\&.html: \f3AppletContext\fR interface
+-.TP 0.2i
+-\(bu
+-AppletStub\&.html: \f3AppletStub\fR interface
+-.TP 0.2i
+-\(bu
+-AudioClip\&.html: \f3AudioClip\fR interface
+-.TP 0.2i
+-\(bu
+-package-summary\&.html: Classes with summaries
+-.TP 0.2i
+-\(bu
+-package-frame\&.html: Package classes for display in lower-left frame
+-.TP 0.2i
+-\(bu
+-package-tree\&.html: Class hierarchy for this package
+-.TP 0.2i
+-\(bu
+-package-use\&.html: Where this package is used
+-.TP 0.2i
+-\(bu
+-\fIdoc-files\fR: Image and example files directory
+-.TP 0.2i
+-\(bu
+-\fIclass-use\fR: Image and examples file location
+-
+-- Applet\&.html: Uses of the Applet class
+-
+-- AppletContext\&.html: Uses of the \f3AppletContext\fR interface
+-
+-- AppletStub\&.html: Uses of the \f3AppletStub\fR interface
+-
+-- AudioClip\&.html: Uses of the \f3AudioClip\fR interface
+-.RE
+-
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-\fIsrc-html\fR: Source code directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIjava\fR: Package directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIapplet\fR: Subpackage directory
+-
+-- Applet\&.html: Applet source code
+-
+-- AppletContext\&.html: \f3AppletContext\fR source code
+-
+-- AppletStub\&.html: \f3AppletStub\fR source code
+-
+-- AudioClip\&.html: \f3AudioClip\fR source code
+-.RE
+-
+-.RE
+-
+-.SS GENERATED\ API\ DECLARATIONS
+-The \f3javadoc\fR command generates a declaration at the start of each class, interface, field, constructor, and method description for that API item\&. For example, the declaration for the \f3Boolean\fR class is:
+-.sp
+-.nf
+-\f3public final class Boolean\fP
+-.fi
+-.nf
+-\f3extends Object\fP
+-.fi
+-.nf
+-\f3implements Serializable\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The declaration for the \f3Boolean\&.valueOf\fR method is:
+-.sp
+-.nf
+-\f3public static Boolean valueOf(String s)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3javadoc\fR command can include the modifiers \f3public\fR, \f3protected\fR, \f3private\fR, \f3abstract\fR, \f3final\fR, \f3static\fR, \f3transient\fR, and \f3volatile\fR, but not \f3synchronized\fR or \f3native\fR\&. The \f3synchronized\fR and \f3native\fR modifiers are considered implementation detail and not part of the API specification\&.
+-.PP
+-Rather than relying on the keyword \f3synchronized\fR, APIs should document their concurrency semantics in the main description of the comment\&. For example, a description might be: A single enumeration cannot be used by multiple threads concurrently\&. The document should not describe how to achieve these semantics\&. As another example, while the \f3Hashtable\fR option should be thread-safe, there is no reason to specify that it is achieved by synchronizing all of its exported methods\&. It is better to reserve the right to synchronize internally at the bucket level for higher concurrency\&.
+-.SH DOCUMENTATION\ COMMENTS
+-This section describes source code comments and comment inheritance\&.
+-.SS SOURCE\ CODE\ COMMENTS
+-You can include documentation comments in the source code, ahead of declarations for any class, interface, method, constructor, or field\&. You can also create documentation comments for each package and another one for the overview, though their syntax is slightly different\&. A documentation comment consists of the characters between \f3/**\fR and \f3*/\fR that end it\&. Leading asterisks are allowed on each line and are described further in the following section\&. The text in a comment can continue onto multiple lines\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is the typical format of a simple documentation comment\fP
+-.fi
+-.nf
+-\f3 * that spans two lines\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To save space you can put a comment on one line:
+-.sp
+-.nf
+-\f3/** This comment takes up only one line\&. */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Placement of Comments
+-
+-Documentation comments are recognized only when placed immediately before class, interface, constructor, method, or field declarations\&. Documentation comments placed in the body of a method are ignored\&. The \f3javadoc\fR command recognizes only one documentation comment per declaration statement\&. See Where Tags Can Be Used\&.
+-.PP
+-A common mistake is to put an \f3import\fR statement between the class comment and the class declaration\&. Do not put an \f3import\fR statement at this location because the \f3javadoc\fR command ignores the class comment\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is the class comment for the class Whatever\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3import com\&.example; // MISTAKE \- Important not to put import statement here\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class Whatever{ }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Parts of Comments
+-
+-A documentation comment has a main description followed by a tag section\&. The main description begins after the starting delimiter \f3/**\fR and continues until the tag section\&. The tag section starts with the first block tag, which is defined by the first \f3@\fR character that begins a line (ignoring leading asterisks, white space, and leading separator \f3/**\fR)\&. It is possible to have a comment with only a tag section and no main description\&. The main description cannot continue after the tag section begins\&. The argument to a tag can span multiple lines\&. There can be any number of tags, and some types of tags can be repeated while others cannot\&. For example, this \f3@see\fR tag starts the tag section:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This sentence holds the main description for this documentation comment\&.\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Object\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Block and inline Tags
+-
+-A tag is a special keyword within a documentation comment that the \f3javadoc\fR command processes\&. There are two kinds of tags: block tags, which appear as an \f3@tag\fR tag (also known as standalone tags), and inline tags, which appear within braces, as an \f3{@tag}\fR tag\&. To be interpreted, a block tag must appear at the beginning of a line, ignoring leading asterisks, white space, and the separator (\f3/**\fR)\&. This means you can use the \f3@\fR character elsewhere in the text and it will not be interpreted as the start of a tag\&. If you want to start a line with the \f3@\fR character and not have it be interpreted, then use the HTML entity \f3&#064;\fR\&. Each block tag has associated text, which includes any text following the tag up to, but not including, either the next tag, or the end of the documentation comment\&. This associated text can span multiple lines\&. An inline tag is allowed and interpreted anywhere that text is allowed\&. The following example contains the \f3@deprecated\fR block tag and the \f3{@link}\fR inline tag\&. See Javadoc Tags\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @deprecated As of JDK 1\&.1, replaced by {@link #setBounds(int,int,int,int)}\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Write Comments in HTML
+-
+-The text must be written in HTML with HTML entities and HTML tags\&. You can use whichever version of HTML your browser supports\&. The standard doclet generates HTML 3\&.2-compliant code elsewhere (outside of the documentation comments) with the inclusion of cascading style sheets and frames\&. HTML 4\&.0 is preferred for generated files because of the frame sets\&.
+-.PP
+-For example, entities for the less than symbol (<) and the greater than symbol (>) should be written as \f3&lt;\fR and \f3&gt;\fR\&. Similarly, the ampersand (&) should be written as \f3&amp;\fR\&. The bold HTML tag \f3<b>\fR is shown in the following example\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is a <b>doc</b> comment\&.\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Object\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Leading Asterisks
+-
+-When the \f3javadoc\fR command parses a documentation comment, leading asterisks (*) on each line are discarded, and blanks and tabs that precede the initial asterisks (*) are also discarded\&. If you omit the leading asterisk on a line, then the leading white space is no longer removed so that you can paste code examples directly into a documentation comment inside a \f3<PRE>\fR tag with its indentation preserved\&. Spaces are interpreted by browsers more uniformly than tabs\&. Indentation is relative to the left margin (rather than the separator \f3/**\fR or \f3<PRE>\fR tag)\&.
+-.PP
+-First Sentence
+-
+-The first sentence of each documentation comment should be a summary sentence that contains a concise but complete description of the declared entity\&. This sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first block tag\&. The \f3javadoc\fR command copies this first sentence to the member summary at the top of the HTML page\&.
+-.PP
+-Multiple-Field Declarations
+-
+-The Java platform lets you declare multiple fields in a single statement, but this statement can have only one documentation comment that is copied for all fields\&. If you want individual documentation comments for each field, then declare each field in a separate statement\&. For example, the following documentation comment does not make sense written as a single declaration and would be better handled as two declarations:
+-.sp
+-.nf
+-\f3/** \fP
+-.fi
+-.nf
+-\f3 * The horizontal and vertical distances of point (x,y)\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public int x, y; // Avoid this \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3javadoc\fR command generates the following documentation from the previous code:
+-.sp
+-.nf
+-\f3public int x\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The horizontal and vertical distances of point (x, y)\&.
+-.sp
+-.nf
+-\f3public int y\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The horizontal and vertical distances of point (x, y)\&.
+-.PP
+-Use of Header Tags
+-
+-When writing documentation comments for members, it is best not to use HTML heading tags such as \f3<H1>\fR and \f3<H2>\fR, because the \f3javadoc\fR command creates an entire structured document, and these structural tags might interfere with the formatting of the generated document\&. However, you can use these headings in class and package comments to provide your own structure\&.
+-.SS METHOD\ COMMENT\ INHERITANCE
+-The \f3javadoc\fR command allows method comment inheritance in classes and interfaces to fill in missing text or to explicitly inherit method comments\&. Constructors, fields, and nested classes do not inherit documentation comments\&.
+-.PP
+-\fINote:\fR The source file for an inherited method must be on the path specified by the \f3-sourcepath\fR option for the documentation comment to be available to copy\&. Neither the class nor its package needs to be passed in on the command line\&. This contrasts with Release 1\&.3\&.\fIn\fR and earlier releases, where the class had to be a documented class\&.
+-.PP
+-Fill in Missing Text
+-
+-When a main description, or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag is missing from a method comment, the \f3javadoc\fR command copies the corresponding main description or tag comment from the method it overrides or implements (if any)\&. See Method Comment Inheritance\&.
+-.PP
+-When an \f3@param\fR tag for a particular parameter is missing, the comment for that parameter is copied from the method further up the inheritance hierarchy\&. When an \f3@throws\fR tag for a particular exception is missing, the \f3@throws\fR tag is copied only when that exception is declared\&.
+-.PP
+-This behavior contrasts with Release 1\&.3 and earlier, where the presence of any main description or tag would prevent all comments from being inherited\&.
+-.PP
+-See Javadoc Tags and Options\&.
+-.PP
+-Explicit Inheritance
+-
+-Insert the \f3{@inheritDoc}\fR inline tag in a method main description or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag comment\&. The corresponding inherited main description or tag comment is copied into that spot\&.
+-.SS CLASS\ AND\ INTERFACE\ INHERITANCE
+-Comment inheritance occurs in all possible cases of inheritance from classes and interfaces:
+-.TP 0.2i
+-\(bu
+-When a method in a class overrides a method in a superclass
+-.TP 0.2i
+-\(bu
+-When a method in an interface overrides a method in a superinterface
+-.TP 0.2i
+-\(bu
+-When a method in a class implements a method in an interface
+-.PP
+-In the first two cases, the \f3javadoc\fR command generates the subheading \fIOverrides\fR in the documentation for the overriding method\&. A link to the method being overridden is included, whether or not the comment is inherited\&.
+-.PP
+-In the third case, when a method in a specified class implements a method in an interface, the \f3javadoc\fR command generates the subheading \fISpecified by\fR in the documentation for the overriding method\&. A link to the method being implemented is included, whether or not the comment is inherited\&.
+-.SS METHOD\ COMMENTS\ ALGORITHM
+-If a method does not have a documentation comment, or has an \f3{@inheritDoc}\fR tag, then the \f3javadoc\fR command uses the following algorithm to search for an applicable comment\&. The algorithm is designed to find the most specific applicable documentation comment, and to give preference to interfaces over superclasses:
+-.TP 0.4i
+-1\&.
+-Look in each directly implemented (or extended) interface in the order they appear following the word \f3implements\fR (or \f3extends\fR) in the method declaration\&. Use the first documentation comment found for this method\&.
+-.TP 0.4i
+-2\&.
+-If Step 1 failed to find a documentation comment, then recursively apply this entire algorithm to each directly implemented (or extended) interface in the same order they were examined in Step 1\&.
+-.TP 0.4i
+-3\&.
+-When Step 2 fails to find a documentation comment and this is a class other than the \f3Object\fR class, but not an interface:
+-.RS
+-.TP 0.4i
+-1\&.
+-If the superclass has a documentation comment for this method, then use it\&.
+-.TP 0.4i
+-2\&.
+-If Step 3a failed to find a documentation comment, then recursively apply this entire algorithm to the superclass\&.
+-.RE
+-
+-.SH JAVADOC\ TAGS
+-The \f3javadoc\fR command parses special tags when they are embedded within a Java documentation comment\&. The \f3javadoc\fR tags let you autogenerate a complete, well-formatted API from your source code\&. The tags start with an at sign (\f3@\fR) and are case-sensitive\&. They must be typed with the uppercase and lowercase letters as shown\&. A tag must start at the beginning of a line (after any leading spaces and an optional asterisk), or it is treated as text\&. By convention, tags with the same name are grouped together\&. For example, put all \f3@see\fR tags together\&. For more information, see Where Tags Can Be Used\&.
+-.PP
+-Tags have the following types:
+-.TP 0.2i
+-\(bu
+-Bock tags: Place block tags only in the tag section that follows the description\&. Block tags have the form: \fI@tag\fR\&.
+-.TP 0.2i
+-\(bu
+-Inline tags: Place inline tags anywhere in the main description or in the comments for block tags\&. Inline tags are enclosed within braces: \fI{@tag}\fR\&.
+-.PP
+-For custom tags, see -tag tagname:Xaoptcmf:"taghead"\&. See also Where Tags Can Be Used\&.
+-.SS TAG\ DESCRIPTIONS
+-.TP
+-@author \fIname-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds an Author entry with the specified name text to the generated documents when the \f3-author\fR option is used\&. A documentation comment can contain multiple \f3@author\fR tags\&. You can specify one name per \f3@author\fR tag or multiple names per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and space between names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line if you want a localized name separator other than a comma\&. See @author in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@author
+-.TP
+-{@code \fItext\fR}
+-Introduced in JDK 1\&.5
+-
+-Equivalent to \f3<code>{@literal}</code>\fR\&.
+-
+-Displays text in code font without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use regular angle brackets (< and >) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (\f3<-\fR)\&. For example, the documentation comment text \f3{@code A<B>C}\fR displayed in the generated HTML page unchanged as \f3A<B>C\fR\&. This means that the \f3<B>\fR is not interpreted as bold and is in code font\&. If you want the same functionality without the code font, then use the \f3{@literal}\fR tag\&.
+-.TP
+-@deprecated \fIdeprecated-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a comment indicating that this API should no longer be used (even though it may continue to work)\&. The \f3javadoc\fR command moves \f3deprecated-text\fRahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field\&.
+-
+-The first sentence of deprecated text should tell the user when the API was deprecated and what to use as a replacement\&. The \f3javadoc\fR command copies the first sentence to the summary section and index\&. Subsequent sentences can also explain why it was deprecated\&. You should include an \f3{@link}\fR tag (for Javadoc 1\&.2 or later) that points to the replacement API\&.
+-
+-Use the \fI@deprecated annotation\fR tag to deprecate a program element\&. See How and When to Deprecate APIs at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html
+-
+-See also @deprecated in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@deprecated
+-.TP
+-{@docRoot}
+-Introduced in JDK 1\&.3
+-
+-Represents the relative path to the generated document\&'s (destination) root directory from any generated page\&. This tag is useful when you want to include a file, such as a copyright page or company logo, that you want to reference from all generated pages\&. Linking to the copyright page from the bottom of each page is common\&.
+-
+-This \f3{@docRoot}\fR tag can be used both on the command line and in a documentation comment\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, and includes the text portion of any tag (such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags)\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-On the command line, where the header, footer, or bottom are defined: \f3javadoc -bottom \&'<a href="{@docRoot}/copyright\&.html">Copyright</a>\&'\fR\&.
+-
+-When you use the \f3{@docRoot}\fR tag this way in a make file, some \f3makefile\fR programs require a special way to escape for the brace \f3{}\fR characters\&. For example, the Inprise MAKE version 5\&.2 running on Windows requires double braces: \f3{{@docRoot}}\fR\&. It also requires double (rather than single) quotation marks to enclose arguments to options such as the \f3-bottom\fR option (with the quotation marks around the \f3href\fR argument omitted)\&.
+-.TP 0.2i
+-\(bu
+-In a documentation comment:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * See the <a href="{@docRoot}/copyright\&.html">Copyright</a>\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This tag is needed because the generated documents are in hierarchical directories, as deep as the number of subpackages\&. The expression: \f3<a href="{@docRoot}/copyright\&.html">\fR resolves to \f3<a href="\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/Object\&.java\fR and \f3<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/ref/Reference\&.java\fR\&.
+-.RE
+-
+-.TP
+-@exception \fIclass-name description\fR
+-Introduced in JDK 1\&.0
+-
+-Identical to the \f3@throws\fR tag\&. See @throws class-name description\&.
+-.TP
+-{@inheritDoc}
+-Introduced in JDK 1\&.4
+-
+-Inherits (copies) documentation from the nearest inheritable class or implementable interface into the current documentation comment at this tag\&'s location\&. This enables you to write more general comments higher up the inheritance tree and to write around the copied text\&.
+-
+-This tag is valid only in these places in a documentation comment:
+-.RS
+-.TP 0.2i
+-\(bu
+-In the main description block of a method\&. In this case, the main description is copied from a class or interface up the hierarchy\&.
+-.TP 0.2i
+-\(bu
+-In the text arguments of the \f3@return\fR, \f3@param,\fR and \f3@throws\fR tags of a method\&. In this case, the tag text is copied from the corresponding tag up the hierarchy\&.
+-.RE
+-
+-
+-See Method Comment Inheritance for a description of how comments are found in the inheritance hierarchy\&. Note that if this tag is missing, then the comment is or is not automatically inherited according to rules described in that section\&.
+-.TP
+-{@link \fIpackage\&.class#member label\fR}
+-Introduced in JDK 1\&.2
+-
+-Inserts an inline link with a visible text label that points to the documentation for the specified package, class, or member name of a referenced class\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, including the text portion of any tag, such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags\&. See @link in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#{@link
+-
+-This tag is similar to the \f3@see\fR tag\&. Both tags require the same references and accept the same syntax for \f3package\&.class#member\fR and \f3label\fR\&. The main difference is that the \f3{@link}\fR tag generates an inline link rather than placing the link in the See Also section\&. The \f3{@link}\fR tag begins and ends with braces to separate it from the rest of the inline text\&. If you need to use the right brace (\f3}\fR) inside the label, then use the HTML entity notation \f3&#125;\fR\&.
+-
+-There is no limit to the number of \f3{@link}\fR tags allowed in a sentence\&. You can use this tag in the main description part of any documentation comment or in the text portion of any tag, such as the \f3@deprecated\fR, \f3@return\fR or \f3@param\fR tags\&.
+-
+-For example, here is a comment that refers to the \f3getComponentAt(int, int)\fR method:
+-.sp
+-.nf
+-\f3Use the {@link #getComponentAt(int, int) getComponentAt} method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-From this code, the standard doclet generates the following HTML (assuming it refers to another class in the same package):
+-.sp
+-.nf
+-\f3Use the <a href="Component\&.html#getComponentAt(int, int)">getComponentAt</a> method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The previous line appears on the web page as:
+-.sp
+-.nf
+-\f3Use the getComponentAt method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-{@linkplain \fIpackage\&.class#member label\fR}
+-Introduced in JDK 1\&.4
+-
+-Behaves the same as the \f3{@link}\fR tag, except the link label is displayed in plain text rather than code font\&. Useful when the label is plain text\&. For example, \f3Refer to {@linkplain add() the overridden method}\fR\&. displays as: Refer to the overridden method\&.
+-.TP
+-{@literal \fItext\fR}
+-Introduced in JDK 1\&.5
+-
+-Displays text without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use angle brackets (\f3< and >\fR) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (<-)\&. For example, the documentation comment text \f3{@literal A<B>C}\fR displays unchanged in the generated HTML page in your browser, as \f3A<B>C\fR\&. The \f3<B>\fR is not interpreted as bold (and it is not in code font)\&. If you want the same functionality with the text in code font, then use the \f3{@code}\fR tag\&.
+-.TP
+-@param \fIparameter-name description\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a parameter with the specified \f3parameter-name\fR followed by the specified description to the Parameters section\&. When writing the documentation comment, you can continue the description onto multiple lines\&. This tag is valid only in a documentation comment for a method, constructor, or class\&. See @param in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@param
+-
+-The \f3parameter-name\fR can be the name of a parameter in a method or constructor, or the name of a type parameter of a class, method, or constructor\&. Use angle brackets around this parameter name to specify the use of a type parameter\&.
+-
+-Example of a type parameter of a class:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @param <E> Type of element stored in a list\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public interface List<E> extends Collection<E> {\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Example of a type parameter of a method:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @param string the string to be converted\fP
+-.fi
+-.nf
+-\f3 * @param type the type to convert the string to\fP
+-.fi
+-.nf
+-\f3 * @param <T> the type of the element\fP
+-.fi
+-.nf
+-\f3 * @param <V> the value of the element\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3<T, V extends T> V convert(String string, Class<T> type) {\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-@return \fIdescription\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a Returns section with the description text\&. This text should describe the return type and permissible range of values\&. This tag is valid only in a documentation comment for a method\&. See @return in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@return
+-.TP
+-@see \fIreference\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a \fISee Also\fR heading with a link or text entry that points to a reference\&. A documentation comment can contain any number of \f3@see\fR tags, which are all grouped under the same heading\&. The \f3@see\fR tag has three variations\&. The form is the most common\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. For inserting an inline link within a sentence to a package, class, or member, see \f3{@link}\fR\&.
+-
+-\fIForm 1\fR\&. The @see \f3string\fR tag form adds a text entry for \fIstring\fR\&. No link is generated\&. The string is a book or other reference to information not available by URL\&. The \f3javadoc\fR command distinguishes this from the previous cases by searching for a double quotation mark (") as the first character\&. For example, \f3@see "The Java Programming Language"\fR that generates the following text:
+-
+-\fISee Also\fR:
+-
+-"The Java Programming Language"
+-
+-\fIForm 2\fR\&. The \f3@see <a href="URL#value">label</a>\fR form adds a link as defined by \f3URL#value\fR\&. The \f3URL#value\fR parameter is a relative or absolute URL\&. The \f3javadoc\fR command distinguishes this from other cases by searching for a less-than symbol (\f3<\fR) as the first character\&. For example, \f3@see <a href="spec\&.html#section">Java Spec</a>\fR generates the following link:
+-
+-\fISee Also\fR:
+-
+-Java Spec
+-
+-\fIForm 3\fR\&. The \f3@see package\&.class#member label\fR form adds a link with a visible text label that points to the documentation for the specified name in the Java Language that is referenced\&. The label is optional\&. If the label is omitted, then the name appears instead as visible text, suitably shortened\&. Use the \f3-noqualifier\fR option to globally remove the package name from this visible text\&. Use the label when you want the visible text to be different from the autogenerated visible text\&. See How a Name Appears\&.
+-
+-In Java SE 1\&.2 only, the name but not the label automatically appears in \f3<code>\fR HTML tags\&. Starting with Java SE 1\&.2\&.2, the \f3<code>\fR tag is always included around the visible text, whether or not a label is used\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3package\&.class#member\fR is any valid program element name that is referenced, such as a package, class, interface, constructor, method or field name, except that the character ahead of the member name should be a number sign (\f3#\fR)\&. The class represents any top-level or nested class or interface\&. The member represents any constructor, method, or field (not a nested class or interface)\&. If this name is in the documented classes, then the \f3javadoc\fR command create a link to it\&. To create links to external referenced classes, use the \f3-link\fR option\&. Use either of the other two \f3@see\fR tag forms to refer to the documentation of a name that does not belong to a referenced class\&. See Specify a Name\&.
+-
+-\fINote:\fR External referenced classes are classes that are not passed into the \f3javadoc\fR command on the command line\&. Links in the generated documentation to external referenced classes are called external references or external links\&. For example, if you run the \f3javadoc\fR command on only the \f3java\&.awt package\fR, then any class in \f3java\&.lang\fR, such as \f3Object\fR, is an external referenced class\&. Use the \f3-link\fR and \f3-linkoffline\fR options to link to external referenced classes\&. The source comments of external referenced classes are not available to the \f3javadoc\fR command run\&.
+-.TP 0.2i
+-\(bu
+-\f3label\fR is optional text that is visible as the link label\&. The label can contain white space\&. If \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears, suitably shortened relative to the current class and package\&. See How a Name Appears\&.
+-.TP 0.2i
+-\(bu
+-A space is the delimiter between \f3package\&.class#member\fR and \f3label\fR\&. A space inside parentheses does not indicate the start of a label, so spaces can be used between parameters in a method\&.
+-.RE
+-
+-
+-\fI\fRIn the following example, an \f3@see\fR tag (in the \f3Character\fR class) refers to the equals method in the \f3String\fR class\&. The tag includes both arguments: the name \f3String#equals(Object)\fR and the label \f3equals\fR\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @see String#equals(Object) equals\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The standard doclet produces HTML that is similar to:
+-.sp
+-.nf
+-\f3<dl>\fP
+-.fi
+-.nf
+-\f3<dt><b>See Also:</b>\fP
+-.fi
+-.nf
+-\f3<dd><a href="\&.\&./\&.\&./java/lang/String#equals(java\&.lang\&.Object)"><code>equals<code></a>\fP
+-.fi
+-.nf
+-\f3</dl>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The previous code looks similar to the following in a browser, where the label is the visible link text:
+-
+-\fISee Also\fR:
+-
+-equals
+-.PP
+-Specify a Name
+-
+-\fI\fRThis \f3package\&.class#member\fR name can be either fully qualified, such as \f3java\&.lang\&.String#toUpperCase()\fR or not, such as \f3String#toUpperCase()\fR or \f3#toUpperCase()\fR\&. If the name is less than fully qualified, then the \f3javadoc\fR command uses the standard Java compiler search order to find it\&. See Search Order for the @see Tag\&. The name can contain white space within parentheses, such as between method arguments\&.The advantage to providing shorter, partially qualified names is that they are shorter to type and there is less clutter in the source code\&. The following listing shows the different forms of the name, where \f3Class\fR can be a class or interface; Type can be a class, interface, array, or primitive; and method can be a method or constructor\&.
+-.sp
+-.nf
+-\f3\fITypical forms for\fR\fI @see package\&.class#member\fR\fP
+-.fi
+-.nf
+-\f3\fIReferencing a member of the current class\fR\fP
+-.fi
+-.nf
+-\f3@see #field\fP
+-.fi
+-.nf
+-\f3@see #method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #constructor(Type argname, Type argname,\&.\&.\&.) \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\fIReferencing another class in the current or imported packages\fR\fP
+-.fi
+-.nf
+-\f3@see Class#field\fP
+-.fi
+-.nf
+-\f3@see Class#method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class\&.NestedClass\fP
+-.fi
+-.nf
+-\f3@see Class \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\fIReferencing an element in another package (fully qualified)\fR\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#field\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class\&.NestedClass\fP
+-.fi
+-.nf
+-\f3@see package\&.Class\fP
+-.fi
+-.nf
+-\f3@see package\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3\fRNotes about the previous listing:
+-.TP 0.2i
+-\(bu
+-The first set of forms with no class or package causes the \f3javadoc\fR command to search only through the current class hierarchy\&. It finds a member of the current class or interface, one of its superclasses or superinterfaces, or one of its enclosing classes or interfaces (search Items 1\(en3)\&. It does not search the rest of the current package or other packages (search Items 4\(en5)\&. See Search Order for the @see Tag\&.
+-.TP 0.2i
+-\(bu
+-If any method or constructor is entered as a name with no parentheses, such as \f3getValue\fR, and if there is no field with the same name, then the \f3javadoc\fR command still creates a link to the method\&. If this method is overloaded, then the \f3javadoc\fR command links to the first method its search encounters, which is unspecified\&.
+-.TP 0.2i
+-\(bu
+-Nested classes must be specified as \f3outer\&.inner\fR, not simply \f3inner\fR, for all forms\&.
+-.TP 0.2i
+-\(bu
+-As stated, the number sign (\f3#\fR), rather than a dot (\f3\&.\fR) separates a member from its class\&. This enables the \f3javadoc\fR command to resolve ambiguities, because the dot also separates classes, nested classes, packages, and subpackages\&. However, the \f3javadoc\fR command properly parses a dot when there is no ambiguity, but prints a warning to alert you\&.
+-.PP
+-Search Order for the @see Tag
+-
+-\fI\fRThe \f3javadoc\fR command processes an \f3@see\fR tag that appears in a source file, package file, or overview file\&. In the latter two files, you must fully qualify the name you supply with the \f3@see\fR tag\&. In a source file, you can specify a name that is fully qualified or partially qualified\&.
+-.PP
+-The following is the search order for the \f3@see\fR tag\&.
+-.TP 0.4i
+-1\&.
+-The current class or interface\&.
+-.TP 0.4i
+-2\&.
+-Any enclosing classes and interfaces searching the closest first\&.
+-.TP 0.4i
+-3\&.
+-Any superclasses and superinterfaces, searching the closest first\&.
+-.TP 0.4i
+-4\&.
+-The current package\&.
+-.TP 0.4i
+-5\&.
+-Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statement\&.
+-.PP
+-The \f3javadoc\fR command continues to search recursively through Items 1-3 for each class it encounters until it finds a match\&. That is, after it searches through the current class and its enclosing class E, it searches through the superclasses of E before the enclosing classes of E\&. In Items 4 and 5, the \f3javadoc\fR command does not search classes or interfaces within a package in any specified order (that order depends on the particular compiler)\&. In Item 5, the \f3javadoc\fR command searches in \fIjava\&.lang\fR because that is imported by all programs\&.
+-.PP
+-When the \f3javadoc\fR command encounters an \f3@see\fR tag in a source file that is not fully qualified, it searches for the specified name in the same order as the Java compiler would, except the \f3javadoc\fR command does not detect certain name space ambiguities because it assumes the source code is free of these errors\&. This search order is formally defined in the Java Language Specification\&. The \f3javadoc\fR command searches for that name through all related and imported classes and packages\&. In particular, it searches in this order:
+-.TP 0.4i
+-1\&.
+-The current class or interface\&.
+-.TP 0.4i
+-2\&.
+-Any enclosing classes and interfaces, searching the closest first\&.
+-.TP 0.4i
+-3\&.
+-Any superclasses and superinterfaces, searching the closest first\&.
+-.TP 0.4i
+-4\&.
+-The current package\&.
+-.TP 0.4i
+-5\&.
+-Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statements\&.
+-.PP
+-The \f3javadoc\fR command does not necessarily look in subclasses, nor will it look in other packages even when their documentation is being generated in the same run\&. For example, if the \f3@see\fR tag is in the \f3java\&.awt\&.event\&.KeyEvent\fR class and refers to a name in the \f3java\&.awt package\fR, then the \f3javadoc\fR command does not look in that package unless that class imports it\&.
+-.PP
+-How a Name Appears
+-
+-\fI\fRIf \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears\&. In general, it is suitably shortened relative to the current class and package\&. Shortened means the \f3javadoc\fR command displays only the minimum name necessary\&. For example, if the \f3String\&.toUpperCase()\fR method contains references to a member of the same class and to a member of a different class, then the class name is displayed only in the latter case, as shown in the following listing\&. Use the \f3-noqualifier\fR option to globally remove the package names\&.
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of the same class, same package
+-.br
+-\fIExample in\fR: \f3@see String#toLowerCase()\fR
+-.br
+-\fIAppears as\fR: \f3toLowerCase()\fR - omits the package and class names
+-.br
+-
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, same package
+-.br
+-\fIExample in\fR: \f3@see Character#toLowerCase(char)\fR
+-.br
+-\fIAppears as\fR: \f3Character\&.toLowerCase(char)\fR - omits the package name, includes the class name
+-.br
+-
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, different package
+-.br
+-\fIExample in\fR: \f3@see java\&.io\&.File#exists()\fR
+-.br
+-\fIAppears as\fR: \f3java\&.io\&.File\&.exists()\fR - includes the package and class names
+-.br
+-
+-.PP
+-Examples of the @see Tag
+-
+-The comment to the right shows how the name appears when the \f3@see\fR tag is in a class in another package, such as \f3java\&.applet\&.Applet\fR\&. See @see in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@see
+-.sp
+-.nf
+-\f3 See also:\fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.String // String \fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.String The String class // The String class \fP
+-.fi
+-.nf
+-\f3@see String // String \fP
+-.fi
+-.nf
+-\f3@see String#equals(Object) // String\&.equals(Object) \fP
+-.fi
+-.nf
+-\f3@see String#equals // String\&.equals(java\&.lang\&.Object) \fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.Object#wait(long) // java\&.lang\&.Object\&.wait(long) \fP
+-.fi
+-.nf
+-\f3@see Character#MAX_RADIX // Character\&.MAX_RADIX \fP
+-.fi
+-.nf
+-\f3@see <a href="spec\&.html">Java Spec</a> // Java Spec \fP
+-.fi
+-.nf
+-\f3@see "The Java Programming Language" // "The Java Programming Language" \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fINote:\fR You can extend the \f3@se\fR\f3e\fR tag to link to classes not being documented with the \f3-link\fR option\&.
+-.TP
+-@serial \fIfield-description\fR | include | exclude
+-Introduced in JDK 1\&.2
+-
+-Used in the documentation comment for a default serializable field\&. See Documenting Serializable Fields and Data for a Class at http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial-arch\&.html#5251
+-
+-See also Oracle\(cqs Criteria for Including Classes in the Serialized Form Specification at http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized-criteria-137781\&.html
+-
+-An optional \f3field-description\fR should explain the meaning of the field and list the acceptable values\&. When needed, the description can span multiple lines\&. The standard doclet adds this information to the serialized form page\&. See Cross-Reference Pages\&.
+-
+-If a serializable field was added to a class after the class was made serializable, then a statement should be added to its main description to identify at which version it was added\&.
+-
+-The \f3include\fR and \f3exclude\fR arguments identify whether a class or package should be included or excluded from the serialized form page\&. They work as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-A public or protected class that implements \f3Serializable\fR is included unless that class (or its package) is marked with the \f3@serial exclude\fR tag\&.
+-.TP 0.2i
+-\(bu
+-A private or package-private class that implements \f3Serializable\fR is excluded unless that class (or its package) is marked with the \f3@serial include\fR tag\&.
+-.RE
+-
+-
+-For example, the \f3javax\&.swing\fR package is marked with the \f3@serial\fR\f3exclude\fR tag in package\&.html or package-info\&.java\&. The public class \f3java\&.security\&.BasicPermission\fR is marked with the \f3@serial exclude\fR tag\&. The package-private class \f3java\&.util\&.PropertyPermissionCollection\fR is marked with the \f3@serial include\fR tag\&.
+-
+-The \f3@serial\fR tag at the class level overrides the \f3@serial\fR tag at the package level\&.
+-.TP
+-@serialData \fIdata-description\fR
+-Introduced in JDK 1\&.2
+-
+-Uses the data description value to document the types and order of data in the serialized form\&. This data includes the optional data written by the \f3writeObject\fR method and all data (including base classes) written by the \f3Externalizable\&.writeExternal\fR method\&.
+-
+-The \f3@serialData\fR tag can be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
+-.TP
+-@serialField \fIfield-name\fR\fIfield-type\fR\fIfield-description\fR
+-Introduced in JDK 1\&.2
+-
+-Documents an \f3ObjectStreamField\fR component of the \f3serialPersistentFields\fR member of a \f3Serializable\fR class\&. Use one \f3@serialField\fR tag for each \f3ObjectStreamField\fR component\&.
+-.TP
+-@since \fIsince-text\fR
+-Introduced in JDK 1\&.1
+-
+-Adds a \fISince\fR heading with the specified \f3since-text\fR value to the generated documentation\&. The text has no special internal structure\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. This tag means that this change or feature has existed since the software release specified by the \f3since-text\fR value, for example: \f3@since 1\&.5\fR\&.
+-
+-For Java platform source code, the \f3@since\fR tag indicates the version of the Java platform API specification, which is not necessarily when the source code was added to the reference implementation\&. Multiple \f3@since\fR tags are allowed and are treated like multiple \f3@author\fR tags\&. You could use multiple tags when the program element is used by more than one API\&.
+-.TP
+-@throws \fIclass-name\fR\fIdescription\fR
+-Introduced in JDK 1\&.2
+-
+-Behaves the same as the \f3@exception\fR tag\&. See @throws in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@exception
+-
+-The \f3@throws\fR tag adds a \fIThrows\fR subheading to the generated documentation, with the \f3class-name\fR and \f3description\fR text\&. The \fIclass-name\fR is the name of the exception that might be thrown by the method\&. This tag is valid only in the documentation comment for a method or constructor\&. If this class is not fully specified, then the \f3javadoc\fR command uses the search order to look up this class\&. Multiple \f3@throws\fR tags can be used in a specified documentation comment for the same or different exceptions\&. See Search Order for the @see Tag\&.
+-
+-To ensure that all checked exceptions are documented, when an \f3@throws\fR tag does not exist for an exception in the throws clause, the \f3javadoc\fR command adds that exception to the HTML output (with no description) as though it were documented with the \f3@throws\fR tag\&.
+-
+-The \f3@throws\fR documentation is copied from an overridden method to a subclass only when the exception is explicitly declared in the overridden method\&. The same is true for copying from an interface method to an implementing method\&. You can use the \f3{@inheritDoc}\fR tag to force the \f3@throws\fR tag to inherit documentation\&.
+-.TP
+-{@value \fIpackage\&.class#field\fR}
+-Introduced in JDK 1\&.4
+-
+-Displays constant values\&. When the \f3{@value}\fR tag is used without an argument in the documentation comment of a static field, it displays the value of that constant:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * The value of this constant is {@value}\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public static final String SCRIPT_START = "<script>"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When used with the argument \f3package\&.class#field\fR in any documentation comment, he \f3{@value}\fR tag displays the value of the specified constant:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Evaluates the script starting with {@value #SCRIPT_START}\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public String evalScript(String script) {}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The argument \f3package\&.class#field\fR takes a form similar to that of the \f3@see\fR tag argument, except that the member must be a static field\&.
+-
+-The values of these constants are also displayed in Constant Field Values at http://docs\&.oracle\&.com/javase/8/docs/api/constant-values\&.html
+-.TP
+-@version \fIversion-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a \fIVersion\fR subheading with the specified \f3version-text\fR value to the generated documents when the \f3-version\fR option is used\&. This tag is intended to hold the current release number of the software that this code is part of, as opposed to the\f3@since\fR tag, which holds the release number where this code was introduced\&. The \f3version-text\fR value has no special internal structure\&. See @version in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@version
+-
+-A documentation comment can contain multiple \f3@version\fR tags\&. When it makes sense, you can specify one release number per \f3@version\fR tag or multiple release numbers per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and a space between the names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line when you want a localized name separator other than a comma\&.
+-.SH WHERE\ TAGS\ CAN\ BE\ USED
+-The following sections describe where tags can be used\&. Note that the following tags can be used in all documentation comments: \f3@see\fR, \f3@since\fR, \f3@deprecated\fR, \f3{@link}\fR, \f3{@linkplain}\fR, and \f3{@docroot}\fR\&.
+-.SS OVERVIEW\ TAGS
+-Overview tags are tags that can appear in the documentation comment for the overview page (which resides in the source file typically named overview\&.html)\&. Similar to any other documentation comments, these tags must appear after the main description
+-.PP
+-\fINote:\fR The \f3{@link}\fR tag has a bug in overview documents in Java SE 1\&.2\&. The text appears correctly but has no link\&. The \f3{@docRoot}\fR tag does not currently work in overview documents\&.
+-.PP
+-The overview tags are the following:
+-.PP
+-@see reference || @since since-text || @serialField field-name field-type field-description || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.SS PACKAGE\ TAGS
+-Package tags are tags that can appear in the documentation comment for a package, that resides in the source file named package\&.html or package-info\&.java\&. The \f3@serial\fR tag can only be used here with the \f3include\fR or \f3exclude\fR argument\&.
+-.PP
+-The package tags are the following:
+-.PP
+-@see reference || @since since-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@linkplain package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.SS CLASS\ AND\ INTERFACE\ TAGS
+-The following are tags that can appear in the documentation comment for a class or interface\&. The \f3@serial\fR tag can only be used within the documentation for a class or interface with an \f3include\fR or \f3exclude\fR argument\&.
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.PP
+-Class comment example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * A class representing a window on the screen\&.\fP
+-.fi
+-.nf
+-\f3 * For example:\fP
+-.fi
+-.nf
+-\f3 * <pre>\fP
+-.fi
+-.nf
+-\f3 * Window win = new Window(parent);\fP
+-.fi
+-.nf
+-\f3 * win\&.show();\fP
+-.fi
+-.nf
+-\f3 * </pre>\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @author Sami Shaio\fP
+-.fi
+-.nf
+-\f3 * @version 1\&.13, 06/08/06\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\&.BaseWindow\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\&.Button\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3class Window extends BaseWindow {\fP
+-.fi
+-.nf
+-\f3 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS FIELD\ TAGS
+-These tags can appear in fields:
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @serialField field-name field-type field-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || {@value package\&.class#field}
+-.PP
+-Field comment example:
+-.sp
+-.nf
+-\f3 /**\fP
+-.fi
+-.nf
+-\f3 * The X\-coordinate of the component\&.\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @see #getLocation()\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3 int x = 1263732;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS CONSTRUCTOR\ AND\ METHOD\ TAGS
+-The following tags can appear in the documentation comment for a constructor or a method, except for the \f3@return\fR tag, which cannot appear in a constructor, and the \f3{@inheritDoc}\fR tag, which has restrictions\&.
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @param parameter-name description || @return description || @throws class-name description || @exception class-name description || @serialData data-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@inheritDoc} || {@docRoot}
+-.PP
+-\fINote:\fR The \f3@serialData\fR tag can only be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
+-.PP
+-Method comment example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Returns the character at the specified index\&. An index \fP
+-.fi
+-.nf
+-\f3 * ranges from <code>0</code> to <code>length() \- 1</code>\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @param index the index of the desired character\&.\fP
+-.fi
+-.nf
+-\f3 * @return the desired character\&.\fP
+-.fi
+-.nf
+-\f3 * @exception StringIndexOutOfRangeException \fP
+-.fi
+-.nf
+-\f3 * if the index is not in the range <code>0</code> \fP
+-.fi
+-.nf
+-\f3 * to <code>length()\-1</code>\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Character#charValue()\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3 public char charAt(int index) {\fP
+-.fi
+-.nf
+-\f3 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-The \f3javadoc\fR command uses doclets to determine its output\&. The \f3javadoc\fR command uses the default standard doclet unless a custom doclet is specified with the \f3-doclet\fR option\&. The \f3javadoc\fR command provides a set of command-line options that can be used with any doclet\&. These options are described in Javadoc Options\&. The standard doclet provides an additional set of command-line options that are described in Standard Doclet Options\&. All option names are not case-sensitive, but their arguments are case-sensitive\&.
+-.TP 0.2i
+-\(bu
+-See also Javadoc Options
+-.TP 0.2i
+-\(bu
+-See also Standard Doclet Options
+-.PP
+-The options are:
+-.PP
+--1\&.1 || -author || -bootclasspath classpathlist || -bottom text || -breakiterator || -charset name || -classpath classpathlist || -d directory || -docencoding name || -docfilesubdirs || -doclet class || -docletpath classpathlist || -doctitle title || -encoding || -exclude packagename1:packagename2:\&.\&.\&. || -excludedocfilessubdir name1:name2 || -extdirs dirist || -footer footer || -group groupheading packagepattern:packagepattern || -header header || -help || -helpfile path\efilename || -Jflag || -javafx ||-keywords || -link extdocURL || -linkoffline extdocURL packagelistLoc || -linksource || -locale language_country_variant || -nocomment || -nodeprecated || -nodeprecatedlist || -nohelp || -noindex || -nonavbar || -noqualifier all | packagename1:packagename2\&.\&.\&. || -nosince || -notimestamp || -notree || -overview path/filename || -package || -private || -protected || -public || -quiet || -serialwarn || -source release || -sourcepath sourcepathlist || -sourcetab tablength || -splitindex || -stylesheet path/filename || -subpackages package1:package2:\&.\&.\&. || -tag tagname:Xaoptcmf:"taghead" || -taglet class || -tagletpath tagletpathlist || -title title || -top || -use || -verbose || -version || -windowtitle title
+-.PP
+-The following options are the core Javadoc options that are available to all doclets\&. The standard doclet provides the rest of the doclets: \f3-bootclasspath\fR, \f3-breakiterator\fR, \f3-classpath\fR, \f3-doclet\fR, \f3-docletpath\fR, \f3-encoding\fR, -\f3exclude\fR, \f3-extdirs\fR, \f3-help\fR, \f3-locale\fR, \f3-\fR\f3overview\fR, \f3-package\fR, \f3-private\fR, \f3-protected\fR, \f3-public\fR, \f3-quiet\fR, \f3-source\fR, \f3-sourcepath\fR, \f3-subpackages\fR, and \f3-verbose\fR\&.
+-.SS JAVADOC\ OPTIONS
+-.TP
+--overview \fIpath/filename\fR
+-.br
+-Specifies that the \f3javadoc\fR command should retrieve the text for the overview documentation from the source file specified by the \fIpath/filename\fRand place it on the Overview page (overview-summary\&.html)\&. The \fIpath/filename\fRis relative to the current directory\&.
+-
+-While you can use any name you want for the \f3filename\fR value and place it anywhere you want for the path, it is typical to name it overview\&.html and place it in the source tree at the directory that contains the topmost package directories\&. In this location, no path is needed when documenting packages, because the \f3-sourcepath\fR option points to this file\&.
+-
+-For example, if the source tree for the \f3java\&.lang\fR package is /src/classes/java/lang/, then you could place the overview file at /src/classes/overview\&.html
+-
+-See Real-World Examples\&.
+-
+-For information about the file specified by \fIpath/filename,\fRsee Overview Comment Files\&.
+-
+-The overview page is created only when you pass two or more package names to the \f3javadoc\fR command\&. For a further explanation, see HTML Frames\&. The title on the overview page is set by \f3-doctitle\fR\&.
+-.TP
+--Xdoclint:(all|none|[-]\fI<group>\fR)
+-.br
+-Reports warnings for bad references, lack of accessibility and missing Javadoc comments, and reports errors for invalid Javadoc syntax and missing HTML tags\&.
+-
+-This option enables the \f3javadoc\fR command to check for all documentation comments included in the generated output\&. As always, you can select which items to include in the generated output with the standard options \f3-public\fR, \f3-protected\fR, \f3-package\fR and \f3-private\fR\&.
+-
+-When the \f3-Xdoclint\fR is enabled, it reports issues with messages similar to the \f3javac\fR command\&. The \f3javadoc\fR command prints a message, a copy of the source line, and a caret pointing at the exact position where the error was detected\&. Messages may be either warnings or errors, depending on their severity and the likelihood to cause an error if the generated documentation were run through a validator\&. For example, bad references or missing Javadoc comments do not cause the \f3javadoc\fR command to generate invalid HTML, so these issues are reported as warnings\&. Syntax errors or missing HTML end tags cause the \f3javadoc\fR command to generate invalid output, so these issues are reported as errors\&.
+-
+-By default, the \f3-Xdoclint\fR option is enabled\&. Disable it with the option \f3-Xdoclint:none\fR\&.
+-
+-Change what the \f3-Xdoclint\fR option reports with the following options:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint none\fR : disable the \f3-Xdoclint\fR option
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint\fR\fIgroup\fR : enable \fIgroup\fR checks
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint all\fR : enable all groups of checks
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint all,\fR\fI-group\fR : enable all except \fIgroup\fR checks
+-.RE
+-
+-
+-The variable \fIgroup\fR has one of the following values:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3accessibility\fR : Checks for the issues to be detected by an accessibility checker (for example, no caption or summary attributes specified in a \f3<table>\fR tag)\&.
+-.TP 0.2i
+-\(bu
+-\f3html\fR : Detects high-level HTML issues, like putting block elements inside inline elements, or not closing elements that require an end tag\&. The rules are derived from theHTML 4\&.01 Specification\&. This type of check enables the \f3javadoc\fR command to detect HTML issues that many browsers might accept\&.
+-.TP 0.2i
+-\(bu
+-\f3missing\fR : Checks for missing Javadoc comments or tags (for example, a missing comment or class, or a missing \f3@return\fR tag or similar tag on a method)\&.
+-.TP 0.2i
+-\(bu
+-\f3reference\fR : Checks for issues relating to the references to Java API elements from Javadoc tags (for example, item not found in \f3@see\fR , or a bad name after \f3@param)\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3syntax\fR : Checks for low level issues like unescaped angle brackets (\f3<\fR and \f3>\fR) and ampersands (\f3&\fR) and invalid Javadoc tags\&.
+-.RE
+-
+-
+-You can specify the \f3-Xdoclint\fR option multiple times to enable the option to check errors and warnings in multiple categories\&. Alternatively, you can specify multiple error and warning categories by using the preceding options\&. For example, use either of the following commands to check for the HTML, syntax, and accessibility issues in the file \fIfilename\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-Xdoclint:html \-Xdoclint:syntax \-Xdoclint:accessibility \fIfilename\fR\fP
+-.fi
+-.nf
+-\f3javadoc \-Xdoclint:html,syntax,accessibility \fIfilename\fR\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR The \f3javadoc\fR command does not guarantee the completeness of these checks\&. In particular, it is not a full HTML compliance checker\&. The goal of the -\f3Xdoclint\fR option is to enable the \f3javadoc\fR command to report majority of common errors\&.
+-
+-The \f3javadoc\fR command does not attempt to fix invalid input, it just reports it\&.
+-.TP
+--public
+-.br
+-Shows only public classes and members\&.
+-.TP
+--protected
+-.br
+-Shows only protected and public classes and members\&. This is the default\&.
+-.TP
+--package
+-.br
+-Shows only package, protected, and public classes and members\&.
+-.TP
+--private
+-.br
+-Shows all classes and members\&.
+-.TP
+--help
+-.br
+-Displays the online help, which lists all of the \f3javadoc\fR and \f3doclet\fR command-line options\&.
+-.TP
+--doclet \fIclass\fR
+-.br
+-Specifies the class file that starts the doclet used in generating the documentation\&. Use the fully qualified name\&. This doclet defines the content and formats the output\&. If the \f3-doclet\fR option is not used, then the \f3javadoc\fR command uses the standard doclet for generating the default HTML format\&. This class must contain the \f3start(Root)\fR method\&. The path to this starting class is defined by the \f3-docletpath\fR option\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.TP
+--docletpath \fIclasspathlist\fR
+-.br
+-Specifies the path to the doclet starting class file (specified with the \f3-doclet\fR option) and any JAR files it depends on\&. If the starting class file is in a JAR file, then this option specifies the path to that JAR file\&. You can specify an absolute path or a path relative to the current directory\&. If \f3classpathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semi-colon (;) on Windows\&. This option is not necessary when the doclet starting class is already in the search path\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.TP
+--1\&.1
+-.br
+-Removed from Javadoc 1\&.4 with no replacement\&. This option created documentation with the appearance and functionality of documentation generated by Javadoc 1\&.1 (it never supported nested classes)\&. If you need this option, then use Javadoc 1\&.2 or 1\&.3 instead\&.
+-.TP
+--source \fIrelease\fR
+-.br
+-Specifies the release of source code accepted\&. The following values for the \f3release\fR parameter are allowed\&. Use the value of \f3release\fR that corresponds to the value used when you compile code with the \f3javac\fR command\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.5\fR\&. The \f3javadoc\fR command accepts code containing generics and other language features introduced in JDK 1\&.5\&. The compiler defaults to the 1\&.5 behavior when the \f3-source\fR option is not used\&.
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.4\fR\&. The \f3javadoc\fR command accepts code containing assertions, which were introduced in JDK 1\&.4\&.
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.3\fR\&. The \f3javadoc\fR command does not support assertions, generics, or other language features introduced after JDK 1\&.3\&.
+-.RE
+-
+-.TP
+--sourcepath \fIsourcepathlist\fR
+-.br
+-Specifies the search paths for finding source files when passing package names or the \f3-subpackages\fR option into the \f3javadoc\fR command\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Note that this option is not only used to locate the source files being documented, but also to find source files that are not being documented, but whose comments are inherited by the source files being documented\&.
+-
+-You can use the \f3-sourcepath\fR option only when passing package names into the \f3javadoc\fR command\&. This will not locate source files passed into the \f3javadoc\fR command\&. To locate source files, \f3\fRchange to that directory or include the path ahead of each file, as shown at Document One or More Classes\&. If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses the class path to find the source files (see \f3-classpath\fR)\&. The default \f3-sourcepath\fR is the value of class path\&. If \f3-classpath\fR is omitted and you pass package names into the \f3javadoc\fR command, then the \f3javadoc\fR command searches in the current directory and subdirectories for the source files\&.
+-
+-Set \f3sourcepathlist\fR to the root directory of the source tree for the package you are documenting\&.
+-
+-For example, suppose you want to document a package called \f3com\&.mypackage\fR, whose source files are located at:/home/user/src/com/mypackage/*\&.java\&. Specify the sourcepath to /home/user/src, the directory that contains com\emypackage, and then supply the package name, as follows:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/src/ com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Notice that if you concatenate the value of sourcepath and the package name together and change the dot to a slash (/), then you have the full path to the package:
+-
+-/home/user/src/com/mypackage
+-
+-To point to two source paths:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user1/src:/home/user2/src com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--classpath \fIclasspathlist\fR
+-.br
+-Specifies the paths where the \f3javadoc\fR command searches for referenced classes These are the documented classes plus any classes referenced by those classes\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Follow the instructions in the class path documentation for specifying the \f3classpathlist\fR value\&.
+-
+-If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses \f3-classpath\fR to find the source files and class files (for backward compatibility)\&. If you want to search for source and class files in separate paths, then use both \f3-sourcepath\fR and \f3-classpath\fR\&.
+-
+-For example, if you want to document \f3com\&.mypackage\fR, whose source files reside in the directory /home/user/src/com/mypackage, and if this package relies on a library in /home/user/lib, then you would use the following command:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/lib \-classpath /home/user/src com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Similar to other tools, if you do not specify \f3-classpath\fR, then the \f3javadoc\fR command uses the \f3CLASSPATH\fR environment variable when it is set\&. If both are not set, then the \f3javadoc\fR command searches for classes from the current directory\&.
+-
+-For an in-depth description of how the \f3javadoc\fR command uses \f3-classpath\fR to find user classes as it relates to extension classes and bootstrap classes, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-
+-A class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
+-
+-For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JA\fRR, then the class path element \f3foo/*\fR is expanded to a \f3A\&.jar:b\&.JAR\fR, except that the order of JAR files is unspecified\&. All JAR files in the specified directory including hidden files are included in the list\&. A class path entry that consists of * expands to a list of all the jar files in the current directory\&. The \f3CLASSPATH\fR environment variable is similarly expanded\&. Any class path wildcard expansion occurs before the Java Virtual Machine (JVM) starts\&. No Java program ever sees unexpanded wild cards except by querying the environment, for example, by calling System\&.getenv(\f3"CLASSPATH"\fR)\&.
+-.TP
+--subpackages \fIpackage1:package2:\&.\&.\&.\fR
+-.br
+-Generates documentation from source files in the specified packages and recursively in their subpackages\&. This option is useful when adding new subpackages to the source code because they are automatically included\&. Each package argument is any top-level subpackage (such as \f3java\fR) or fully qualified package (such as \f3javax\&.swing\fR) that does not need to contain source files\&. Arguments are separated by colons on all operating systems\&. Wild cards are not allowed\&. Use \f3-sourcepath\fR to specify where to find the packages\&. This option does not process source files that are in the source tree but do not belong to the packages\&. See Process Source Files\&.
+-
+-For example, the following command generates documentation for packages named \f3java\fR and \f3javax\&.swing\fR and all of their subpackages\&.
+-.sp
+-.nf
+-\f3javadoc \-d docs \-sourcepath /home/user/src \-subpackages java:javax\&.swing \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--exclude \fIpackagename1:packagename2:\&.\&.\&.\fR
+-.br
+-Unconditionally excludes the specified packages and their subpackages from the list formed by \f3-subpackages\fR\&. It excludes those packages even when they would otherwise be included by some earlier or later \f3-subpackages\fR option\&.
+-
+-The following example would include \f3java\&.io\fR, \f3java\&.util\fR, and \f3java\&.math\fR (among others), but would exclude packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice that this example excludes \f3java\&.lang\&.ref\fR, which is a subpackage of \f3java\&.lang\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/src \-subpackages java \-exclude \fP
+-.fi
+-.nf
+-\f3 java\&.net:java\&.lang\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--bootclasspath \fIclasspathlist\fR
+-.br
+-Specifies the paths where the boot classes reside\&. These are typically the Java platform classes\&. The \f3bootclasspath\fR is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. For more information, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-
+-Separate directories in the \f3classpathlist\fR parameters with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
+-.TP
+--extdirs \fIdirist\fR
+-.br
+-Specifies the directories where extension classes reside\&. These are any classes that use the Java Extension mechanism\&. The \f3extdirs\fR option is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. See the \f3-classpath\fR option for more information\&. Separate directories in \f3dirlist\fR with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
+-.TP
+--verbose
+-.br
+-Provides more detailed messages while the \f3javadoc\fR command runs\&. Without the \f3verbose\fR option, messages appear for loading the source files, generating the documentation (one message per source file), and sorting\&. The verbose option causes the printing of additional messages that specify the number of milliseconds to parse each Java source file\&.
+-.TP
+--quiet
+-.br
+-Shuts off messages so that only the warnings and errors appear to make them easier to view\&. It also suppresses the \f3version\fR string\&.
+-.TP
+--breakiterator
+-.br
+-Uses the internationalized sentence boundary of \f3java\&.text\&.BreakIterator\fR to determine the end of the first sentence in the main description of a package, class, or member for English\&. All other locales already use the \f3BreakIterator\fR class, rather than an English language, locale-specific algorithm\&. The first sentence is copied to the package, class, or member summary and to the alphabetic index\&. From JDK 1\&.2 and later, the \f3BreakIterator\fR class is used to determine the end of a sentence for all languages except for English\&. Therefore, the \f3-breakiterator\fR option has no effect except for English from 1\&.2 and later\&. English has its own default algorithm:
+-.RS
+-.TP 0.2i
+-\(bu
+-English default sentence-break algorithm\&. Stops at a period followed by a space or an HTML block tag, such as \f3<P>\fR\&.
+-.TP 0.2i
+-\(bu
+-Breakiterator sentence-break algorithm\&. Stops at a period, question mark, or exclamation point followed by a space when the next word starts with a capital letter\&. This is meant to handle most abbreviations (such as "The serial no\&. is valid", but will not handle "Mr\&. Smith")\&. The \f3-breakiterator\fR option does not stop at HTML tags or sentences that begin with numbers or symbols\&. The algorithm stops at the last period in \&.\&./filename, even when embedded in an HTML tag\&.
+-.RE
+-
+-
+-In Java SE 1\&.5 the \f3-breakiterator\fR option warning messages are removed, and the default sentence-break algorithm is unchanged\&. If you have not modified your source code to eliminate the \f3-breakiterator\fR option warnings in Java SE 1\&.4\&.x, then you do not have to do anything\&. The warnings go away starting with Java SE 1\&.5\&.0\&.
+-.TP
+--locale \fIlanguage_country_variant\fR
+-.br
+-Specifies the locale that the \f3javadoc\fR command uses when it generates documentation\&. The argument is the name of the locale, as described in \f3j\fR\f3ava\&.util\&.Locale\fR documentation, such as \f3en_US\fR (English, United States) or \f3en_US_WIN\fR (Windows variant)\&.
+-
+-\fINote:\fR The \f3-locale\fR option must be placed ahead (to the left) of any options provided by the standard doclet or any other doclet\&. Otherwise, the navigation bars appear in English\&. This is the only command-line option that depends on order\&. See Standard Doclet Options\&.
+-
+-Specifying a locale causes the \f3javadoc\fR command to choose the resource files of that locale for messages such as strings in the navigation bar, headings for lists and tables, help file contents, comments in the stylesheet\&.css file, and so on\&. It also specifies the sorting order for lists sorted alphabetically, and the sentence separator to determine the end of the first sentence\&. The \f3-locale\fR option does not determine the locale of the documentation comment text specified in the source files of the documented classes\&.
+-.TP
+--encoding
+-.br
+-Specifies the encoding name of the source files, such as \f3EUCJIS/SJIS\fR\&. If this option is not specified, then the platform default converter is used\&. See also the\f3-docencoding name\fR and \f3-charset name\fR options\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR directly to the Java Runtime Environment (JRE) that runs the \f3javadoc\fR command\&. For example, if you must ensure that the system sets aside 32 MB of memory in which to process the generated documentation, then you would call the \f3-Xmx\fR option as follows: \f3javadoc -J-Xmx32m -J-Xms32m com\&.mypackage\fR\&. Be aware that \f3-Xms\fR is optional because it only sets the size of initial memory, which is useful when you know the minimum amount of memory required\&.
+-
+-There is no space between the \f3J\fR and the \f3flag\fR\&.
+-
+-Use the \f3-version\fR option to find out what version of the \f3javadoc\fR command you are using\&. The version number of the standard doclet appears in its output stream\&. See Running the Javadoc Command\&.
+-.sp
+-.nf
+-\f3javadoc \-J\-version\fP
+-.fi
+-.nf
+-\f3java version "1\&.7\&.0_09"\fP
+-.fi
+-.nf
+-\f3Java(TM) SE Runtime Environment (build 1\&.7\&.0_09\-b05)\fP
+-.fi
+-.nf
+-\f3Java HotSpot(TM) 64\-Bit Server VM (build 23\&.5\-b02, mixed mode)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--javafx
+-.br
+-Generates HTML documentation using the JavaFX extensions to the standard doclet\&. The generated documentation includes a Property Summary section in addition to the other summary sections generated by the standard Java doclet\&. The listed properties are linked to the sections for the getter and setter methods of each property\&.
+-
+-If there are no documentation comments written explicitly for getter and setter methods, the documentation comments from the property method are automatically copied to the generated documentation for these methods\&. This option also adds a new \f3@defaultValue\fR tag that allows documenting the default value for a property\&.
+-
+-Example:
+-.sp
+-.nf
+-\f3javadoc \-javafx MyClass\&.java \-d testdir\fP
+-.fi
+-.sp
+-
+-.SS STANDARD\ DOCLET\ OPTIONS
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies the destination directory where the \f3javadoc\fR command saves the generated HTML files\&. If you omit the \f3-d\fR option, then the files are saved to the current directory\&. The \f3directory\fR value can be absolute or relative to the current working directory\&. As of Java SE 1\&.4, the destination directory is automatically created when the \f3javadoc\fR command runs\&.
+-
+-For example, the following command generates the documentation for the package \f3com\&.mypackage\fR and saves the results in the /user/doc/ directory: \f3javadoc -d\fR\f3/user/doc/\fR\f3com\&.mypackage\fR\&.
+-.TP
+--use
+-.br
+-Includes one Use page for each documented class and package\&. The page describes what packages, classes, methods, constructors and fields use any API of the specified class or package\&. Given class C, things that use class C would include subclasses of C, fields declared as C, methods that return C, and methods and constructors with parameters of type C\&. For example, you can look at the Use page for the \f3String\fR type\&. Because the \f3getName\fR method in the \f3java\&.awt\&.Font\fR class returns type \f3String\fR, the \f3getName\fR method uses \f3String\fR and so the \f3getName\fR method appears on the Use page for \f3String\fR\&.This documents only uses of the API, not the implementation\&. When a method uses \f3String\fR in its implementation, but does not take a string as an argument or return a string, that is not considered a use of \f3String\fR\&.To access the generated Use page, go to the class or package and click the \fIUse link\fR in the navigation bar\&.
+-.TP
+--version
+-.br
+-Includes the @version text in the generated docs\&. This text is omitted by default\&. To find out what version of the \f3javadoc\fR command you are using, use the \f3-J-version\fR option\&.
+-.TP
+--author
+-.br
+-Includes the \f3@author\fR text in the generated docs\&.
+-.TP
+--splitindex
+-.br
+-Splits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical symbols\&.
+-.TP
+--windowtitle \fItitle\fR
+-.br
+-Specifies the title to be placed in the HTML \f3<title>\fR tag\&. The text specified in the \f3title\fR tag appears in the window title and in any browser bookmarks (favorite places) that someone creates for this page\&. This title should not contain any HTML tags because the browser does not interpret them correctly\&. Use escape characters on any internal quotation marks within the \f3title\fR tag\&. If the \f3-windowtitle\fR option is omitted, then the \f3javadoc\fR command uses the value of the \f3-doctitle\fR option for the \f3-windowtitle\fR option\&. For example, \f3javadoc -windowtitle "Java SE Platform" com\&.mypackage\fR\&.
+-.TP
+--doctitle \fItitle\fR
+-.br
+-Specifies the title to place near the top of the overview summary file\&. The text specified in the \f3title\fR tag is placed as a centered, level-one heading directly beneath the top navigation bar\&. The \f3title\fR tag can contain HTML tags and white space, but when it does, you must enclose the title in quotation marks\&. Internal quotation marks within the \f3title\fR tag must be escaped\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
+-.TP
+--title \fItitle\fR
+-.br
+-No longer exists\&. It existed only in Beta releases of Javadoc 1\&.2\&. It was renamed to \f3-doctitle\fR\&. This option was renamed to make it clear that it defines the document title, rather than the window title\&.
+-.TP
+--header \fIheader\fR
+-.br
+-Specifies the header text to be placed at the top of each output file\&. The header is placed to the right of the upper navigation bar\&. The \f3header\fR can contain HTML tags and white space, but when it does, the \f3header\fR must be enclosed in quotation marks\&. Use escape characters for internal quotation marks within a header\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
+-.TP
+--footer \fIfooter\fR
+-.br
+-Specifies the footer text to be placed at the bottom of each output file\&. The \fIfooter\fR value is placed to the right of the lower navigation bar\&. The \f3footer\fR value can contain HTML tags and white space, but when it does, the \f3footer\fR value must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within a footer\&.
+-.TP
+--top
+-.br
+-Specifies the text to be placed at the top of each output file\&.
+-.TP
+--bottom \fItext\fR
+-.br
+-Specifies the text to be placed at the bottom of each output file\&. The text is placed at the bottom of the page, underneath the lower navigation bar\&. The text can contain HTML tags and white space, but when it does, the text must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within text\&.
+-.TP
+--link \fIextdocURL\fR
+-.br
+-Creates links to existing Javadoc-generated documentation of externally referenced classes\&. The \fIextdocURL\fR argument is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. You can specify multiple \f3-link\fR options in a specified \f3javadoc\fR command run to link to multiple documents\&.
+-
+-The package-list file must be found in this directory (otherwise, use the \f3-linkoffline\fR option)\&. The \f3javadoc\fR command reads the package names from the package-list file and links to those packages at that URL\&. When the \f3javadoc\fR command runs, the \f3extdocURL\fR value is copied into the \f3<A HREF>\fR links that are created\&. Therefore, \f3extdocURL\fR must be the URL to the directory, and not to a file\&. You can use an absolute link for \fIextdocURL\fR to enable your documents to link to a document on any web site, or you can use a relative link to link only to a relative location\&. If you use a relative link, then the value you pass in should be the relative path from the destination directory (specified with the \f3-d\fR option) to the directory containing the packages being linked to\&.When you specify an absolute link, you usually use an HTTP link\&. However, if you want to link to a file system that has no web server, then you can use a file link\&. Use a file link only when everyone who wants to access the generated documentation shares the same file system\&.In all cases, and on all operating systems, use a slash as the separator, whether the URL is absolute or relative, and \f3h\fR\f3ttp:\fR or \f3f\fR\f3ile:\fR as specified in the URL Memo: Uniform Resource Locators at http://www\&.ietf\&.org/rfc/rfc1738\&.txt
+-.sp
+-.nf
+-\f3\-link http://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\-link file://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\-link <directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Differences between the -linkoffline and -link options
+-
+-Use the \f3-link\fR option in the following cases:
+-.TP 0.2i
+-\(bu
+-When you use a relative path to the external API document\&.
+-.TP 0.2i
+-\(bu
+-When you use an absolute URL to the external API document if your shell lets you open a connection to that URL for reading\&.
+-.PP
+-Use the \f3-linkoffline\fR option when you use an absolute URL to the external API document, if your shell does not allow a program to open a connection to that URL for reading\&. This can occur when you are behind a firewall and the document you want to link to is on the other side\&.
+-.PP
+-\f3Example 1 Absolute Link to External Documents\fR
+-.PP
+-Use the following command if you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java platform packages, shown at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
+-.sp
+-.nf
+-\f3javadoc \-link http://docs\&.oracle\&.com/javase/8/docs/api/ com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The command generates documentation for the package \f3com\&.mypackage\fR with links to the Java SE packages\&. The generated documentation contains links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other options, such as the \f3-sourcepath\fR and \f3-d\fR options, are not shown\&.
+-.PP
+-\f3Example 2 Relative Link to External Documents\fR
+-.PP
+-In this example, there are two packages with documents that are generated in different runs of the \f3javadoc\fR command, and those documents are separated by a relative path\&. The packages are \f3com\&.apipackage\fR, an API, and c\f3om\&.spipackage\fR, an Service Provide Interface (SPI)\&. You want the documentation to reside in docs/api/com/apipackage and docs/spi/com/spipackage\&. Assuming that the API package documentation is already generated, and that docs is the current directory, you document the SPI package with links to the API documentation by running: \f3javadoc -d \&./spi -link \&.\&./api com\&.spipackage\fR\&.
+-.PP
+-Notice the \f3-link\fR option is relative to the destination directory (docs/spi)\&.
+-.PP
+-Notes
+-
+-The \f3-link\fR option lets you link to classes referenced to by your code, but not documented in the current \f3javadoc\fR command run\&. For these links to go to valid pages, you must know where those HTML pages are located and specify that location with \f3extdocURL\fR\&. This allows third-party documentation to link to java\&.* documentation at http://docs\&.oracle\&.com\&.Omit the \f3-link\fR option when you want the \f3javadoc\fR command to create links only to APIs within the documentation it is generating in the current run\&. Without the \f3-link\fR option, the \f3javadoc\fR command does not create links to documentation for external references because it does not know whether or where that documentation exists\&.The \f3-link\fR option can create links in several places in the generated documentation\&. See Process Source Files\&. Another use is for cross-links between sets of packages: Execute the \f3javadoc\fR command on one set of packages, then run the \f3javadoc\fR command again on another set of packages, creating links both ways between both sets\&.
+-.PP
+-How to Reference a Class
+-
+-For a link to an externally referenced class to appear (and not just its text label), the class must be referenced in the following way\&. It is not sufficient for it to be referenced in the body of a method\&. It must be referenced in either an \f3import\fR statement or in a declaration\&. Here are examples of how the class \f3java\&.io\&.File\fR can be referenced:
+-.PP
+-\fI\fRIn any kind of import statement\&. By wildcard import, import explicitly by name, or automatically import for \f3java\&.lang\&.*\fR\&.
+-.PP
+-In Java SE 1\&.3\&.\fIn\fR and 1\&.2\&.\fIn\fR, only an explicit import by name works\&. A wildcard \f3import\fR statement does not work, nor does the automatic \f3import java\&.lang\&.*\fR\&.
+-.PP
+-\fI\fRIn a declaration: \f3void mymethod(File f) {}\fR
+-.PP
+-The reference can be in the return type or parameter type of a method, constructor, field, class, or interface, or in an implements, extends, or throws statement\&.
+-.PP
+-An important corollary is that when you use the \f3-link\fR option, there can be many links that unintentionally do not appear due to this constraint\&. The text would appear without being a link\&. You can detect these by the warnings they emit\&. The simplest way to properly reference a class and add the link would be to import that class\&.
+-.PP
+-Package List
+-
+-The \f3-link\fR option requires that a file named package-list, which is generated by the \f3javadoc\fR command, exists at the URL you specify with the \f3-link\fR option\&. The package-list file is a simple text file that lists the names of packages documented at that location\&. In the earlier example, the \f3javadoc\fR command searches for a file named package-list at the specified URL, reads in the package names, and links to those packages at that URL\&.
+-.PP
+-For example, the package list for the Java SE API is located at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
+-.PP
+-The package list starts as follows:
+-.sp
+-.nf
+-\f3java\&.applet\fP
+-.fi
+-.nf
+-\f3java\&.awt\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.color\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.datatransfer\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.dnd\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.font\fP
+-.fi
+-.nf
+-\f3and so on \&.\&.\&.\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When \f3javadoc\fR is run without the \f3-link\fR option and encounters a name that belongs to an externally referenced class, it prints the name with no link\&. However, when the \f3-link\fR option is used, the \f3javadoc\fR command searches the package-list file at the specified \fIextdocURL\fR location for that package name\&. When it finds the package name, it prefixes the name with \fIextdocURL\fR\&.
+-.PP
+-For there to be no broken links, all of the documentation for the external references must exist at the specified URLs\&. The \f3javadoc\fR command does not check that these pages exist, but only that the package-list exists\&.
+-.PP
+-Multiple Links
+-
+-You can supply multiple \f3-link\fR options to link to any number of externally generated documents\&. Javadoc 1\&.2 has a known bug that prevents you from supplying more than one \f3-link\fR options\&. This was fixed in Javadoc 1\&.2\&.2\&. Specify a different link option for each external document to link to \f3javadoc -link extdocURL1 -link extdocURL2 \&.\&.\&. -link extdocURLn com\&.mypackage\fR where \fIextdocURL1\fR, \fIextdocURL2\fR, \&.\f3\&.\&. extdocURLn\fR point respectively to the roots of external documents, each of which contains a file named package-list\&.
+-.PP
+-Cross Links
+-
+-Note that bootstrapping might be required when cross-linking two or more documents that were previously generated\&. If package-list does not exist for either document when you run the \f3javadoc\fR command on the first document, then the package-list does not yet exist for the second document\&. Therefore, to create the external links, you must regenerate the first document after you generate the second document\&.
+-.PP
+-In this case, the purpose of first generating a document is to create its package-list (or you can create it by hand if you are certain of the package names)\&. Then, generate the second document with its external links\&. The \f3javadoc\fR command prints a warning when a needed external package-list file does not exist\&.
+-.TP
+--linkoffline \fIextdocURL packagelistLoc\fR
+-.br
+-This option is a variation of the \f3-link\fR option\&. They both create links to Javadoc-generated documentation for externally referenced classes\&. Use the \f3-link\fRo\f3ffline\fR option when linking to a document on the web when the \f3javadoc\fR command cannot access the document through a web connection\&. Use the \f3-linkoffline\fR option when package-list file of the external document is not accessible or does not exist at the \f3extdocURL\fR location, but does exist at a different location that can be specified by \f3packageListLoc\fR (typically local)\&. If \f3extdocURL\fR is accessible only on the World Wide Web, then the \f3-linkoffline\fR option removes the constraint that the \f3javadoc\fR command must have a web connection to generate documentation\&. Another use is as a work-around to update documents: After you have run the \f3javadoc\fR command on a full set of packages, you can run the \f3javadoc\fR command again on a smaller set of changed packages, so that the updated files can be inserted back into the original set\&. Examples follow\&. The \f3-linkoffline\fR option takes two arguments\&. The first is for the string to be embedded in the \f3<a href>\fR links, and the second tells the \f3-linkoffline\fR option where to find package-list:
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3extdocURL\fR value is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. When relative, the value should be the relative path from the destination directory (specified with the \f3-d\fR option) to the root of the packages being linked to\&. For more information, see \fIextdocURL\fR in the \f3-link\fR option\&.
+-.TP 0.2i
+-\(bu
+-The \f3packagelistLoc\fR value is the path or URL to the directory that contains the package-list file for the external documentation\&. This can be a URL (http: or file:) or file path, and can be absolute or relative\&. When relative, make it relative to the current directory from where the \f3javadoc\fR command was run\&. Do not include the package-list file name\&.
+-
+-You can specify multiple \f3-linkoffline\fR options in a specified \f3javadoc\fR command run\&. Before Javadoc 1\&.2\&.2, the \f3-linkfile\fR options could be specified once\&.
+-.RE
+-
+-.PP
+-Absolute Links to External Documents
+-
+-You might have a situation where you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java SE packages at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
+-.PP
+-However, your shell does not have web access\&. In this case, do the following:
+-.TP 0.4i
+-1\&.
+-Open the package-list file in a browser at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
+-.TP 0.4i
+-2\&.
+-Save the file to a local directory, and point to this local copy with the second argument, \f3packagelistLoc\fR\&. In this example, the package list file was saved to the current directory (\&.)\&.
+-.PP
+-The following command generates documentation for the package c\f3om\&.mypackage\fR with links to the Java SE packages\&. The generated documentation will contain links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other necessary options, such as \f3-sourcepath\fR, are not shown\&.
+-.sp
+-.nf
+-\f3javadoc \-linkoffline http://docs\&.oracle\&.com/javase/8/docs/api/ \&. com\&.mypackage \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Relative Links to External Documents
+-
+-It is not very common to use \f3-linkoffline\fR with relative paths, for the simple reason that the \f3-link\fR option is usually enough\&. When you use the \f3-linkoffline\fR option, the package-list file is usually local, and when you use relative links, the file you are linking to is also local, so it is usually unnecessary to give a different path for the two arguments to the \f3-linkoffline\fR option When the two arguments are identical, you can use the \f3-link\fR option\&.
+-.PP
+-Create a package-list File Manually
+-
+-If a package-list file does not exist yet, but you know what package names your document will link to, then you can manually create your own copy of this file and specify its path with \f3packagelistLoc\fR\&. An example would be the previous case where the package list for \f3com\&.spipackage\fR did not exist when \f3com\&.apipackage\fR was first generated\&. This technique is useful when you need to generate documentation that links to new external documentation whose package names you know, but which is not yet published\&. This is also a way of creating package-list files for packages generated with Javadoc 1\&.0 or 1\&.1, where package-list files were not generated\&. Similarly, two companies can share their unpublished package-list files so they can release their cross-linked documentation simultaneously\&.
+-.PP
+-Link to Multiple Documents
+-
+-You can include the \f3-linkoffline\fR option once for each generated document you want to refer to:
+-.sp
+-.nf
+-\f3javadoc \-linkoffline extdocURL1 packagelistLoc1 \-linkoffline extdocURL2\fP
+-.fi
+-.nf
+-\f3packagelistLoc2 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Update Documents
+-
+-You can also use the \f3-linkoffline\fR option when your project has dozens or hundreds of packages\&. If you have already run the \f3javadoc\fR command on the entire source tree, then you can quickly make small changes to documentation comments and rerun the \f3javadoc\fR command on a portion of the source tree\&. Be aware that the second run works properly only when your changes are to documentation comments and not to declarations\&. If you were to add, remove, or change any declarations from the source code, then broken links could show up in the index, package tree, inherited member lists, Use page, and other places\&.
+-.PP
+-First, create a new destination directory, such as update, for this new small run\&. In this example, the original destination directory is named html\&. In the simplest example, change directory to the parent of html\&. Set the first argument of the \f3-linkoffline\fR option to the current directory (\&.) and set the second argument to the relative path to html, where it can find package-list and pass in only the package names of the packages you want to update:
+-.sp
+-.nf
+-\f3javadoc \-d update \-linkoffline \&. html com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When the \f3javadoc\fR command completes, copy these generated class pages in update/com/package (not the overview or index) to the original files in html/com/package\&.
+-.TP
+--linksource
+-.br
+-Creates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation\&. Links are created for classes, interfaces, constructors, methods, and fields whose declarations are in a source file\&. Otherwise, links are not created, such as for default constructors and generated classes\&.
+-
+-This option exposes all private implementation details in the included source files, including private classes, private fields, and the bodies of private methods, regardless of the \f3-public\fR, \f3-package\fR, \f3-protected\fR, and \f3-private\fR options\&. Unless you also use the \f3-private\fR option, not all private classes or interfaces are accessible through links\&.
+-
+-Each link appears on the name of the identifier in its declaration\&. For example, the link to the source code of the \f3Button\fR class would be on the word \f3Button\fR:
+-.sp
+-.nf
+-\f3public class Button extends Component implements Accessible\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The link to the source code of the \f3getLabel\fR method in the \f3Button\fR class is on the word \f3getLabel\fR:
+-.sp
+-.nf
+-\f3public String getLabel()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--group groupheading \fIpackagepattern:packagepattern\fR
+-.br
+-Separates packages on the overview page into whatever groups you specify, one group per table\&. You specify each group with a different \f3-group\fR option\&. The groups appear on the page in the order specified on the command line\&. Packages are alphabetized within a group\&. For a specified \f3-group\fR option, the packages matching the list of \f3packagepattern\fR expressions appear in a table with the heading \fIgroupheading\fR\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3groupheading\fR can be any text and can include white space\&. This text is placed in the table heading for the group\&.
+-.TP 0.2i
+-\(bu
+-The \f3packagepattern\fR value can be any package name at the start of any package name followed by an asterisk (*)\&. The asterisk is the only wildcard allowed and means match any characters\&. Multiple patterns can be included in a group by separating them with colons (:)\&. If you use an asterisk in a pattern or pattern list, then the pattern list must be inside quotation marks, such as \f3"java\&.lang*:java\&.util"\fR\&.
+-.RE
+-
+-
+-When you do not supply a \f3-group\fR option, all packages are placed in one group with the heading \fIPackages\fR and appropriate subheadings\&. If the subheadings do not include all documented packages (all groups), then the remaining packages appear in a separate group with the subheading Other Packages\&.
+-
+-For example, the following \f3javadoc\fR command separates the three documented packages into \fICore\fR, \fIExtension\fR, and \fIOther Packages\fR\&. The trailing dot (\&.) does not appear in \f3java\&.lang*\fR\&. Including the dot, such as \f3java\&.lang\&.*\fR omits the\f3java\&.lang\fR package\&.
+-.sp
+-.nf
+-\f3javadoc \-group "Core Packages" "java\&.lang*:java\&.util"\fP
+-.fi
+-.nf
+-\f3 \-group "Extension Packages" "javax\&.*"\fP
+-.fi
+-.nf
+-\f3 java\&.lang java\&.lang\&.reflect java\&.util javax\&.servlet java\&.new\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fICore Packages\fR
+-
+-\f3java\&.lang\fR
+-
+-\f3java\&.lang\&.reflect\fR
+-
+-\f3java\&.util\fR
+-
+-\fIExtension Packages\fR
+-
+-\f3javax\&.servlet\fR
+-
+-\fIOther Packages\fR
+-
+-\f3java\&.new\fR
+-.TP
+--nodeprecated
+-.br
+-Prevents the generation of any deprecated API in the documentation\&. This does what the \f3-nodeprecatedlist\fR option does, and it does not generate any deprecated API throughout the rest of the documentation\&. This is useful when writing code when you do not want to be distracted by the deprecated code\&.
+-.TP
+--nodeprecatedlist
+-.br
+-Prevents the generation of the file that contains the list of deprecated APIs (deprecated-list\&.html) and the link in the navigation bar to that page\&. The \f3javadoc\fR command continues to generate the deprecated API throughout the rest of the document\&. This is useful when your source code contains no deprecated APIs, and you want to make the navigation bar cleaner\&.
+-.TP
+--nosince
+-.br
+-Omits from the generated documents the \f3Since\fR sections associated with the \f3@since\fR tags\&.
+-.TP
+--notree
+-.br
+-Omits the class/interface hierarchy pages from the generated documents\&. These are the pages you reach using the Tree button in the navigation bar\&. The hierarchy is produced by default\&.
+-.TP
+--noindex
+-.br
+-Omits the index from the generated documents\&. The index is produced by default\&.
+-.TP
+--nohelp
+-.br
+-Omits the HELP link in the navigation bars at the top and bottom of each page of output\&.
+-.TP
+--nonavbar
+-.br
+-Prevents the generation of the navigation bar, header, and footer, that are usually found at the top and bottom of the generated pages\&. The \f3-nonavbar\fR option has no affect on the \f3-bottom\fR option\&. The \f3-nonavbar\fR option is useful when you are interested only in the content and have no need for navigation, such as when you are converting the files to PostScript or PDF for printing only\&.
+-.TP
+--helpfile \fIpath\efilename\fR
+-.br
+-Specifies the path of an alternate help file path\efilename that the HELP link in the top and bottom navigation bars link to\&. Without this option, the \f3javadoc\fR command creates a help file help-doc\&.html that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to help-doc\&.html\&. The \f3javadoc\fR command adjusts the links in the navigation bar accordingly, for example:
+-.sp
+-.nf
+-\f3javadoc \-helpfile /home/user/myhelp\&.html java\&.awt\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--stylesheet \fIpath/filename\fR
+-.br
+-Specifies the path of an alternate HTML stylesheet file\&. Without this option, the \f3javadoc\fR command automatically creates a stylesheet file stylesheet\&.css that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to stylesheet\&.css, for example:
+-.sp
+-.nf
+-\f3javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--serialwarn
+-.br
+-Generates compile-time warnings for missing \f3@serial\fR tags\&. By default, Javadoc 1\&.2\&.2 and later versions generate no serial warnings\&. This is a reversal from earlier releases\&. Use this option to display the serial warnings, which helps to properly document default serializable fields and \f3writeExternal\fR methods\&.
+-.TP
+--charset \fIname\fR
+-.br
+-Specifies the HTML character set for this document\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
+-
+-For example, \f3javadoc -charset "iso-8859-1" mypackage\fR inserts the following line in the head of every generated page:
+-.sp
+-.nf
+-\f3<META http\-equiv="Content\-Type" content="text/html; charset=ISO\-8859\-1">\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This \f3META\fR tag is described in the HTML standard (4197265 and 4137321), HTML Document Representation, at http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
+-
+-See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
+-.TP
+--docencoding \fIname\fR
+-.br
+-Specifies the encoding of the generated HTML files\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
+-
+-If you omit the \f3-docencoding\fR option but use the \f3-encoding\fR option, then the encoding of the generated HTML files is determined by the \f3-encoding\fR option, for example: \f3javadoc -docencoding "iso-8859-1" mypackage\fR\&. See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
+-.TP
+--keywords
+-.br
+-Adds HTML keyword <META> tags to the generated file for each class\&. These tags can help search engines that look for <META> tags find the pages\&. Most search engines that search the entire Internet do not look at <META> tags, because pages can misuse them\&. Search engines offered by companies that confine their searches to their own website can benefit by looking at <META> tags\&. The <META> tags include the fully qualified name of the class and the unqualified names of the fields and methods\&. Constructors are not included because they are identical to the class name\&. For example, the class \f3String\fR starts with these keywords:
+-.sp
+-.nf
+-\f3<META NAME="keywords" CONTENT="java\&.lang\&.String class">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="CASE_INSENSITIVE_ORDER">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="length()">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="charAt()">\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--tag \fItagname\fR:Xaoptcmf:"\fItaghead\fR"
+-.br
+-Enables the \f3javadoc\fR command to interpret a simple, one-argument \f3@tagname\fR custom block tag in documentation comments\&. For the \f3javadoc\fR command to spell-check tag names, it is important to include a \f3-tag\fR option for every custom tag that is present in the source code, disabling (with \f3X\fR) those that are not being output in the current run\&.The colon (:) is always the separator\&. The \f3-tag\fR option outputs the tag heading \fItaghead\fR in bold, followed on the next line by the text from its single argument\&. Similar to any block tag, the argument text can contain inline tags, which are also interpreted\&. The output is similar to standard one-argument tags, such as the \f3@return\fR and \f3@author\fR tags\&. Omitting a value for \fItaghead\fR causes \f3tagname\fR to be the heading\&.
+-
+-\fIPlacement of tags\fR: The \f3Xaoptcmf\fR arguments determine where in the source code the tag is allowed to be placed, and whether the tag can be disabled (using \f3X\fR)\&. You can supply either \f3a\fR, to allow the tag in all places, or any combination of the other letters:
+-
+-\f3X\fR (disable tag)
+-
+-\f3a\fR (all)
+-
+-\f3o\fR (overview)
+-
+-\f3p\fR (packages)
+-
+-\f3t\fR (types, that is classes and interfaces)
+-
+-\f3c\fR (constructors)
+-
+-\f3m\fR (methods)
+-
+-\f3f\fR (fields)
+-
+-\fIExamples of single tags\fR: An example of a tag option for a tag that can be used anywhere in the source code is: \f3-tag todo:a:"To Do:"\fR\&.
+-
+-If you want the \f3@todo\fR tag to be used only with constructors, methods, and fields, then you use: \f3-tag todo:cmf:"To Do:"\fR\&.
+-
+-Notice the last colon (:) is not a parameter separator, but is part of the heading text\&. You would use either tag option for source code that contains the \f3@todo\fR tag, such as: \f3@todo The documentation for this method needs work\fR\&.
+-
+-\fIColons in tag names\fR: Use a backslash to escape a colon that you want to use in a tag name\&. Use the \f3-tag ejb\e\e:bean:a:"EJB Bean:"\fR option for the following documentation comment:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @ejb:bean\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fISpell-checking tag names\fR: Some developers put custom tags in the source code that they do not always want to output\&. In these cases, it is important to list all tags that are in the source code, enabling the ones you want to output and disabling the ones you do not want to output\&. The presence of \f3X\fR disables the tag, while its absence enables the tag\&. This gives the \f3javadoc\fR command enough information to know whether a tag it encounters is unknown, which is probably the results of a typographical error or a misspelling\&. The \f3javadoc\fR command prints a warning in these cases\&. You can add \f3X\fR to the placement values already present, so that when you want to enable the tag, you can simply delete the \f3X\fR\&. For example, if the \f3@todo\fR tag is a tag that you want to suppress on output, then you would use: \f3-tag todo:Xcmf:"To Do:"\fR\&. If you would rather keep it simple, then use this: \f3-tag todo:X\fR\&. The syntax \f3-tag todo:X\fR works even when the \f3@todo\fR tag is defined by a taglet\&.
+-
+-\fIOrder of tags\fR: The order of the \f3-ta\fR\f3g\fR and \f3-taglet\fR options determines the order the tags are output\&. You can mix the custom tags with the standard tags to intersperse them\&. The tag options for standard tags are placeholders only for determining the order\&. They take only the standard tag\&'s name\&. Subheadings for standard tags cannot be altered\&. This is illustrated in the following example\&.If the \f3-tag\fR option is missing, then the position of the \f3-tagle\fR\f3t\fR option determines its order\&. If they are both present, then whichever appears last on the command line determines its order\&. This happens because the tags and taglets are processed in the order that they appear on the command line\&. For example, if the \f3-taglet\fR and \f3-tag\fR options have the name \f3todo\fR value, then the one that appears last on the command line determines the order\&.
+-
+-\fIExample of a complete set of tags\fR: This example inserts To Do after Parameters and before Throws in the output\&. By using \f3X\fR, it also specifies that the \f3@example\fR tag might be encountered in the source code that should not be output during this run\&. If you use the \f3@argfile\fR tag, then you can put the tags on separate lines in an argument file similar to this (no line continuation characters needed):
+-.sp
+-.nf
+-\f3\-tag param\fP
+-.fi
+-.nf
+-\f3\-tag return\fP
+-.fi
+-.nf
+-\f3\-tag todo:a:"To Do:"\fP
+-.fi
+-.nf
+-\f3\-tag throws\fP
+-.fi
+-.nf
+-\f3\-tag see\fP
+-.fi
+-.nf
+-\f3\-tag example:X\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the \f3javadoc\fR command parses the documentation comments, any tag encountered that is neither a standard tag nor passed in with the \f3-tag\fR or \f3-taglet\fR options is considered unknown, and a warning is thrown\&.
+-
+-The standard tags are initially stored internally in a list in their default order\&. Whenever the \f3-tag\fR options are used, those tags get appended to this list\&. Standard tags are moved from their default position\&. Therefore, if a \f3-tag\fR option is omitted for a standard tag, then it remains in its default position\&.
+-
+-\fIAvoiding conflicts\fR: If you want to create your own namespace, then you can use a dot-separated naming convention similar to that used for packages: \f3com\&.mycompany\&.todo\fR\&. Oracle will continue to create standard tags whose names do not contain dots\&. Any tag you create will override the behavior of a tag by the same name defined by Oracle\&. If you create a \f3@todo\fR tag or taglet, then it always has the same behavior you define, even when Oracle later creates a standard tag of the same name\&.
+-
+-\fIAnnotations vs\&. Javadoc tags\fR: In general, if the markup you want to add is intended to affect or produce documentation, then it should be a Javadoc tag\&. Otherwise, it should be an annotation\&. See Custom Tags and Annotations in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#annotations
+-
+-You can also create more complex block tags or custom inline tags with the \f3-taglet\fR option\&.
+-.TP
+--taglet \fIclass\fR
+-.br
+-Specifies the class file that starts the taglet used in generating the documentation for that tag\&. Use the fully qualified name for the \f3class\fR value\&. This taglet also defines the number of text arguments that the custom tag has\&. The taglet accepts those arguments, processes them, and generates the output\&. For extensive documentation with example taglets, see: Taglet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html
+-
+-Taglets are useful for block or inline tags\&. They can have any number of arguments and implement custom behavior, such as making text bold, formatting bullets, writing out the text to a file, or starting other processes\&. Taglets can only determine where a tag should appear and in what form\&. All other decisions are made by the doclet\&. A taglet cannot do things such as remove a class name from the list of included classes\&. However, it can execute side effects, such as printing the tag\&'s text to a file or triggering another process\&. Use the \f3-tagletpath\fR option to specify the path to the taglet\&. The following example inserts the To Do taglet after Parameters and ahead of Throws in the generated pages\&. Alternately, you can use the \f3-taglet\fR option in place of its \f3-tag\fR option, but that might be difficult to read\&.
+-.sp
+-.nf
+-\f3\-taglet com\&.sun\&.tools\&.doclets\&.ToDoTaglet\fP
+-.fi
+-.nf
+-\f3\-tagletpath /home/taglets \fP
+-.fi
+-.nf
+-\f3\-tag return\fP
+-.fi
+-.nf
+-\f3\-tag param\fP
+-.fi
+-.nf
+-\f3\-tag todo\fP
+-.fi
+-.nf
+-\f3\-tag throws\fP
+-.fi
+-.nf
+-\f3\-tag see\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--tagletpath \fItagletpathlist\fR
+-.br
+-Specifies the search paths for finding taglet class files\&. The \f3tagletpathlist\fR can contain multiple paths by separating them with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&.
+-.TP
+--docfilesubdirs
+-.br
+-Enables deep copying of doc-files directories\&. Subdirectories and all contents are recursively copied to the destination\&. For example, the directory doc-files/example/images and all of its contents would be copied\&. There is also an option to exclude subdirectories\&.
+-.TP
+--excludedocfilessubdir \fIname1:name2\fR
+-.br
+-Excludes any doc-files subdirectories with the specified names\&. This prevents the copying of SCCS and other source-code-control subdirectories\&.
+-.TP
+--noqualifier all | \fIpackagename1\fR:\fIpackagename2\&.\&.\&.\fR
+-.br
+-Omits qualifying package names from class names in output\&. The argument to the \f3-noqualifier\fR option is either \f3all\fR (all package qualifiers are omitted) or a colon-separate list of packages, with wild cards, to be removed as qualifiers\&. The package name is removed from places where class or interface names appear\&. See Process Source Files\&.
+-
+-The following example omits all package qualifiers: \f3-noqualifier all\fR\&.
+-
+-The following example omits \f3java\&.lang\fR and \f3java\&.io\fR package qualifiers: \f3-noqualifier java\&.lang:java\&.io\fR\&.
+-
+-The following example omits package qualifiers starting with \f3java\fR, and \f3com\&.sun\fR subpackages, but not \f3javax\fR: \f3-noqualifier java\&.*:com\&.sun\&.*\fR\&.
+-
+-Where a package qualifier would appear due to the previous behavior, the name can be suitably shortened\&. See How a Name Appears\&. This rule is in effect whether or not the \f3-noqualifier\fR option is used\&.
+-.TP
+--notimestamp
+-.br
+-Suppresses the time stamp, which is hidden in an HTML comment in the generated HTML near the top of each page\&. The \f3-notimestamp\fR option is useful when you want to run the \f3javadoc\fR command on two source bases and get the differences between \f3diff\fR them, because it prevents time stamps from causing a \f3diff\fR (which would otherwise be a \f3diff\fR on every page)\&. The time stamp includes the \f3javadoc\fR command release number, and currently appears similar to this: \f3<!-- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 -->\fR\&.
+-.TP
+--nocomment
+-.br
+-Suppresses the entire comment body, including the main description and all tags, and generate only declarations\&. This option lets you reuse source files that were originally intended for a different purpose so that you can produce skeleton HTML documentation at the early stages of a new project\&.
+-.TP
+--sourcetab \fItablength\fR
+-.br
+-Specifies the number of spaces each tab uses in the source\&.
+-.SH COMMAND-LINE\ ARGUMENT\ FILES
+-To shorten or simplify the \f3javadoc\fR command, you can specify one or more files that contain arguments to the \f3javadoc\fR command (except \f3-J\fR options)\&. This enables you to create \f3javadoc\fR commands of any length on any operating system\&.
+-.PP
+-An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be space-separated or newline-separated\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
+-.PP
+-File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (\f3*\fR) are not allowed in these lists (such as for specifying *\&.java)\&. Using the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
+-.PP
+-When you run the \f3javadoc\fR command, pass in the path and name of each argument file with the @ leading character\&. When the \f3javadoc\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
+-.PP
+-\f3Example 1 Single Argument File\fR
+-.PP
+-You could use a single argument file named \f3argfile\fR to hold all \f3javadoc\fR command arguments: \f3javadoc @argfile\fR\&. The argument file \f3\fRcontains the contents of both files, as shown in the next example\&.
+-.PP
+-\f3Example 2 Two Argument Files\fR
+-.PP
+-You can create two argument files: One for the \f3javadoc\fR command options and the other for the package names or source file names\&. Notice the following lists have no line-continuation characters\&.
+-.PP
+-Create a file named options that contains:
+-.sp
+-.nf
+-\f3\-d docs\-filelist \fP
+-.fi
+-.nf
+-\f3\-use \fP
+-.fi
+-.nf
+-\f3\-splitindex\fP
+-.fi
+-.nf
+-\f3\-windowtitle \&'Java SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3\-doctitle \&'Java SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3\-header \&'<b>Java\(tm SE 7</b>\&'\fP
+-.fi
+-.nf
+-\f3\-bottom \&'Copyright &copy; 1993\-2011 Oracle and/or its affiliates\&. All rights reserved\&.\&'\fP
+-.fi
+-.nf
+-\f3\-group "Core Packages" "java\&.*"\fP
+-.fi
+-.nf
+-\f3\-overview /java/pubs/ws/1\&.7\&.0/src/share/classes/overview\-core\&.html\fP
+-.fi
+-.nf
+-\f3\-sourcepath /java/pubs/ws/1\&.7\&.0/src/share/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Create a file named packages that contains:
+-.sp
+-.nf
+-\f3com\&.mypackage1\fP
+-.fi
+-.nf
+-\f3com\&.mypackage2\fP
+-.fi
+-.nf
+-\f3com\&.mypackage3\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3javadoc\fR command as follows:
+-.sp
+-.nf
+-\f3javadoc @options @packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Argument Files with Paths\fR
+-.PP
+-The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
+-.sp
+-.nf
+-\f3javadoc @path1/options @path2/packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Option Arguments\fR
+-.PP
+-The following example saves an argument to a \f3javadoc\fR command option in an argument file\&. The \f3-bottom\fR option is used because it can have a lengthy argument\&. You could create a file named bottom to contain the text argument:
+-.sp
+-.nf
+-\f3<font size="\-1">\fP
+-.fi
+-.nf
+-\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&. <br/>\fP
+-.fi
+-.nf
+-\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3 Other names may be trademarks of their respective owners\&.</font>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3javadoc\fR command as follows:\f3javadoc -bottom @bottom @packages\fR\&.
+-.PP
+-You can also include the \f3-bottom\fR option at the start of the argument file and run the \f3javadoc\fR command as follows: \f3javadoc @bottom @packages\fR\&.
+-.SH RUNNING\ THE\ JAVADOC\ COMMAND
+-The release number of the \f3javadoc\fR command can be determined with the \f3javadoc -J-version\fR option\&. The release number of the standard doclet appears in the output stream\&. It can be turned off with the \f3-quiet\fR option\&.
+-.PP
+-Use the public programmatic interface to call the \f3javadoc\fR command from within programs written in the Java language\&. This interface is in \f3com\&.sun\&.tools\&.javadoc\&.Main\fR (and the \f3javadoc\fR command is reentrant)\&. For more information, see The Standard Doclet at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard-doclet\&.html#runningprogrammatically
+-.PP
+-The following instructions call the standard HTML doclet\&. To call a custom doclet, use the \f3-doclet\fR and \f3-docletpath\fR options\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.SS SIMPLE\ EXAMPLES
+-You can run the \f3javadoc\fR command on entire packages or individual source files\&. Each package name has a corresponding directory name\&.
+-.PP
+-In the following examples, the source files are located at /home/src/java/awt/*\&.java\&. The destination directory is /home/html\&.
+-.PP
+-Document One or More Packages
+-
+-To document a package, the source files for that package must be located in a directory that has the same name as the package\&.
+-.PP
+-If a package name has several identifiers (separated by dots, such as \f3java\&.awt\&.color\fR), then each subsequent identifier must correspond to a deeper subdirectory (such as java/awt/color)\&.
+-.PP
+-You can split the source files for a single package among two such directory trees located at different places, as long as \f3-sourcepath\fR points to them both\&. For example, src1/java/awt/color and src2/java/awt/color\&.
+-.PP
+-You can run the \f3javadoc\fR command either by changing directories (with the \f3cd\fR command) or by using the \f3-sourcepath\fR option\&. The following examples illustrate both alternatives\&.
+-.PP
+-\f3Example 1 Recursive Run from One or More Packages\fR
+-.PP
+-This example uses \f3-sourcepath\fR so the \f3javadoc\fR command can be run from any directory and \f3-subpackages\fR (a new 1\&.4 option) for recursion\&. It traverses the subpackages of the java directory excluding packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice this excludes \f3java\&.lang\&.ref\fR, a subpackage of \f3java\&.lang\fR\&. To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as \f3java:javax:org\&.xml\&.sax\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Change to Root and Run Explicit Packages\fR
+-.PP
+-Change to the parent directory of the fully qualified package\&. Then, run the \f3javadoc\fR command with the names of one or more packages that you want to document:
+-.sp
+-.nf
+-\f3cd /home/src/\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as j\f3ava:javax:org\&.xml\&.sax\fR\&.
+-.PP
+-\f3Example 3 Run from Any Directory on Explicit Packages in One Tree\fR
+-.PP
+-In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with the parent directory of the top-level package\&. Provide the names of one or more packages that you want to document:
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Run from Any Directory on Explicit Packages in Multiple Trees\fR
+-.PP
+-Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with a colon-separated list of the paths to each tree\&'s root\&. Provide the names of one or more packages that you want to document\&. All source files for a specified package do not need to be located under a single root directory, but they must be found somewhere along the source path\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src1:/home/src2 java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The result is that all cases generate HTML-formatted documentation for the \f3public\fR and \f3protected\fR classes and interfaces in packages j\f3ava\&.awt\fR and \f3java\&.awt\&.even\fRt and save the HTML files in the specified destination directory\&. Because two or more packages are being generated, the document has three HTML frames: one for the list of packages, another for the list of classes, and the third for the main class pages\&.
+-.PP
+-Document One or More Classes
+-
+-The second way to run the \f3javadoc\fR command is to pass one or more source files\&. You can run \f3javadoc\fR either of the following two ways: by changing directories (with the \f3cd\fR command) or by fully specifying the path to the source files\&. Relative paths are relative to the current directory\&. The \f3-sourcepath\fR option is ignored when passing source files\&. You can use command-line wild cards, such as an asterisk (*), to specify groups of classes\&.
+-.PP
+-\f3Example 1 Change to the Source Directory\fR
+-.PP
+-Change to the directory that holds the source files\&. Then run the \f3javadoc\fR command with the names of one or more source files you want to document\&.
+-.PP
+-This example generates HTML-formatted documentation for the classes \f3Button\fR, \f3Canvas,\fR and classes that begin with \f3Graphics\fR\&. Because source files rather than package names were passed in as arguments to the \f3javadoc\fR command, the document has two frames: one for the list of classes and the other for the main page\&.
+-.sp
+-.nf
+-\f3cd /home/src/java/awt\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html Button\&.java Canvas\&.java Graphics*\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Change to the Root Directory of the Package\fR
+-.PP
+-This is useful for documenting individual source files from different subpackages off of the same root\&. Change to the package root directory, and supply the source files with paths from the root\&.
+-.sp
+-.nf
+-\f3cd /home/src/\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html java/awt/Button\&.java java/applet/Applet\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Document Files from Any Directory\fR
+-.PP
+-In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command with the absolute path (or path relative to the current directory) to the source files you want to document\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html /home/src/java/awt/Button\&.java\fP
+-.fi
+-.nf
+-\f3/home/src/java/awt/Graphics*\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Document Packages and Classes
+-
+-You can document entire packages and individual classes at the same time\&. Here is an example that mixes two of the previous examples\&. You can use the \f3-sourcepath\fR option for the path to the packages but not for the path to the individual classes\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt\fP
+-.fi
+-.nf
+-\f3/home/src/java/applet/Applet\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS REAL-WORLD\ EXAMPLES
+-The following command-line and \f3makefile\fR versions of the \f3javadoc\fR command run on the Java platform APIs\&. It uses 180 MB of memory to generate the documentation for the 1500 (approximately) public and protected classes in the Java SE 1\&.2\&. Both examples use absolute paths in the option arguments, so that the same \f3javadoc\fR command can be run from any directory\&.
+-.PP
+-Command-Line Example
+-
+-The following command might be too long for some shells\&. You can use a command-line argument file (or write a shell script) to overcome this limitation\&.
+-.PP
+-In the example, \f3packages\fR is the name of a file that contains the packages to process, such as \f3java\&.applet\fR\f3java\&.lang\fR\&. None of the options should contain any newline characters between the single quotation marks\&. For example, if you copy and paste this example, then delete the newline characters from the \f3-bottom\fR option\&.
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /java/jdk/src/share/classes \e\fP
+-.fi
+-.nf
+-\f3\-overview /java/jdk/src/share/classes/overview\&.html \e\fP
+-.fi
+-.nf
+-\f3\-d /java/jdk/build/api \e\fP
+-.fi
+-.nf
+-\f3\-use \e\fP
+-.fi
+-.nf
+-\f3\-splitIndex \e\fP
+-.fi
+-.nf
+-\f3\-windowtitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
+-.fi
+-.nf
+-\f3\-doctitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
+-.fi
+-.nf
+-\f3\-header \&'<b>Java\(tm SE 7</b>\&' \e\fP
+-.fi
+-.nf
+-\f3\-bottom \&'<font size="\-1">\fP
+-.fi
+-.nf
+-\f3<a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
+-.fi
+-.nf
+-\f3Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3Other names may be trademarks of their respective owners\&.</font>\&' \e\fP
+-.fi
+-.nf
+-\f3\-group "Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*" \e\fP
+-.fi
+-.nf
+-\f3\-group "Extension Packages" "javax\&.*" \e\fP
+-.fi
+-.nf
+-\f3\-J\-Xmx180m \e \fP
+-.fi
+-.nf
+-\f3@packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Programmatic Interface
+-
+-The Javadoc Access API enables the user to invoke the Javadoc tool directly from a Java application without executing a new process\&.
+-.PP
+-For example, the following statements are equivalent to the command \f3javadoc -d /home/html -sourcepath /home/src -subpackages java -exclude java\&.net:java\&.lang com\&.example\fR:
+-.sp
+-.nf
+-\f3import javax\&.tools\&.DocumentationTool;\fP
+-.fi
+-.nf
+-\f3import javax\&.tools\&.ToolProvider;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class JavaAccessSample{\fP
+-.fi
+-.nf
+-\f3 public static void main(String[] args){\fP
+-.fi
+-.nf
+-\f3 DocumentationTool javadoc = ToolProvider\&.getSystemDocumentationTool();\fP
+-.fi
+-.nf
+-\f3 int rc = javadoc\&.run( null, null, null,\fP
+-.fi
+-.nf
+-\f3 "\-d", "/home/html",\fP
+-.fi
+-.nf
+-\f3 "\-sourcepath", "home/src",\fP
+-.fi
+-.nf
+-\f3 "\-subpackages", "java",\fP
+-.fi
+-.nf
+-\f3 "\-exclude", "java\&.net:java\&.lang",\fP
+-.fi
+-.nf
+-\f3 "com\&.example");\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The first three arguments of the \f3run\fR method specify input, standard output, and standard error streams\&. \f3Null\fR is the default value for \f3System\&.in\fR, \f3System\&.out\fR, and \f3System\&.err\fR, respectively\&.
+-.SS THE\ MAKEFILE\ EXAMPLE
+-This is an example of a GNU \f3makefile\fR\&. Single quotation marks surround \f3makefile\fR arguments\&. For an example of a Windows \f3makefile\fR, see the \f3makefiles\fR section of the Javadoc FAQ at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html#makefiles
+-.sp
+-.nf
+-\f3javadoc \-sourcepath $(SRCDIR) \e /* Sets path for source files */\fP
+-.fi
+-.nf
+-\f3 \-overview $(SRCDIR)/overview\&.html \e /* Sets file for overview text */\fP
+-.fi
+-.nf
+-\f3 \-d /java/jdk/build/api \e /* Sets destination directory */\fP
+-.fi
+-.nf
+-\f3 \-use \e /* Adds "Use" files */\fP
+-.fi
+-.nf
+-\f3 \-splitIndex \e /* Splits index A\-Z */\fP
+-.fi
+-.nf
+-\f3 \-windowtitle $(WINDOWTITLE) \e /* Adds a window title */\fP
+-.fi
+-.nf
+-\f3 \-doctitle $(DOCTITLE) \e /* Adds a doc title */\fP
+-.fi
+-.nf
+-\f3 \-header $(HEADER) \e /* Adds running header text */\fP
+-.fi
+-.nf
+-\f3 \-bottom $(BOTTOM) \e /* Adds text at bottom */\fP
+-.fi
+-.nf
+-\f3 \-group $(GROUPCORE) \e /* 1st subhead on overview page */\fP
+-.fi
+-.nf
+-\f3 \-group $(GROUPEXT) \e /* 2nd subhead on overview page */\fP
+-.fi
+-.nf
+-\f3 \-J\-Xmx180m \e /* Sets memory to 180MB */\fP
+-.fi
+-.nf
+-\f3 java\&.lang java\&.lang\&.reflect \e /* Sets packages to document */\fP
+-.fi
+-.nf
+-\f3 java\&.util java\&.io java\&.net \e\fP
+-.fi
+-.nf
+-\f3 java\&.applet\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3WINDOWTITLE = \&'Java\(tm SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3DOCTITLE = \&'Java\(tm Platform Standard Edition 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3HEADER = \&'<b>Java\(tm SE 7</font>\&'\fP
+-.fi
+-.nf
+-\f3BOTTOM = \&'<font size="\-1">\fP
+-.fi
+-.nf
+-\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
+-.fi
+-.nf
+-\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3 Other names may be trademarks of their respective owners\&.</font>\&'\fP
+-.fi
+-.nf
+-\f3GROUPCORE = \&'"Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*"\&'\fP
+-.fi
+-.nf
+-\f3GROUPEXT = \&'"Extension Packages" "javax\&.*"\&'\fP
+-.fi
+-.nf
+-\f3SRCDIR = \&'/java/jdk/1\&.7\&.0/src/share/classes\&'\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS NOTES
+-.TP 0.2i
+-\(bu
+-If you omit the \f3-windowtitle\fR option, then the \f3javadoc\fR command copies the document title to the window title\&. The \f3-windowtitle\fR option text is similar to the the \f3-doctitle\fR option, but without HTML tags to prevent those tags from appearing as raw text in the window title\&.
+-.TP 0.2i
+-\(bu
+-If you omit the \f3-footer\fR option, then the \f3javadoc\fR command copies the header text to the footer\&.
+-.TP 0.2i
+-\(bu
+-Other important options you might want to use, but were not needed in the previous example, are the \f3-classpath\fR and \f3-link\fR options\&.
+-.SH GENERAL\ TROUBLESHOOTING
+-.TP 0.2i
+-\(bu
+-The \f3javadoc\fR command reads only files that contain valid class names\&. If the \f3javadoc\fR command is not correctly reading the contents of a file, then verify that the class names are valid\&. See Process Source Files\&.
+-.TP 0.2i
+-\(bu
+-See the Javadoc FAQ for information about common bugs and for troubleshooting tips at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html
+-.SH ERRORS\ AND\ WARNINGS
+-Error and warning messages contain the file name and line number to the declaration line rather than to the particular line in the documentation comment\&.
+-.PP
+-For example, this message \f3error: cannot read: Class1\&.java\fR means that the \f3javadoc\fR command is trying to load \f3Class1\&.jav\fR\f3a\fR in the current directory\&. The class name is shown with its path (absolute or relative)\&.
+-.SH ENVIRONMENT
+-.TP
+-CLASSPATH
+-\f3CLASSPATH\fR is the environment variable that provides the path that the \f3javadoc\fR command uses to find user class files\&. This environment variable is overridden by the \f3-classpath\fR option\&. Separate directories with a semicolon for Windows or a colon for Oracle Solaris\&.
+-
+-\fIWindows example\fR: \f3\&.;C:\eclasses;C:\ehome\ejava\eclasses\fR
+-
+-\fIOracle Solaris example\fR: \f3\&.:/home/classes:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
+-.SH RELATED\ DOCUMENTS
+-.TP 0.2i
+-\(bu
+-Javadoc Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/index\&.html
+-.TP 0.2i
+-\(bu
+-How Classes Are Found http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-.TP 0.2i
+-\(bu
+-How to Write Doc Comments for the Javadoc Tool http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html
+-.TP 0.2i
+-\(bu
+-URL Memo, Uniform Resource Locators http://www\&.ietf\&.org/rfc/rfc1738\&.txt
+-.TP 0.2i
+-\(bu
+-HTML standard, HTML Document Representation (4197265 and 4137321) http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
++
++.SH NAME
++javadoc \- Generates HTML pages of API documentation from Java source files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavadoc\fR {\fIpackages\fR|\fIsource\-files\fR} [\fIoptions\fR] [\fI@argfiles\fR]
++.fi
++.sp
++.TP
++\fIpackages\fR
++Names of packages that you want to document, separated by spaces, for example \f3java\&.lang java\&.lang\&.reflect java\&.awt\fR\&. If you want to also document the subpackages, use the \f3-subpackages\fR option to specify the packages\&.
++
++By default, \f3javadoc\fR looks for the specified packages in the current directory and subdirectories\&. Use the \f3-sourcepath\fR option to specify the list of directories where to look for packages\&.
++.TP
++\fIsource-files\fR
++Names of Java source files that you want to document, separated by spaces, for example \f3Class\&.java Object\&.java Button\&.java\fR\&. By default, \f3javadoc\fR looks for the specified classes in the current directory\&. However, you can specify the full path to the class file and use wildcard characters, for example \f3/home/src/java/awt/Graphics*\&.java\fR\&. You can also specify the path relative to the current directory\&.
++.TP
++\fIoptions\fR
++Command-line options, separated by spaces\&. See Options\&.
++.TP
++\fI@argfiles\fR
++Names of files that contain a list of \f3javadoc\fR command options, package names and source file names in any order\&.
++.SH DESCRIPTION
++The \f3javadoc\fR command parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages that describe (by default) the public and protected classes, nested classes (but not anonymous inner classes), interfaces, constructors, methods, and fields\&. You can use the \f3javadoc\fR command to generate the API documentation or the implementation documentation for a set of source files\&.
++.PP
++You can run the \f3javadoc\fR command on entire packages, individual source files, or both\&. When documenting entire packages, you can either use the \f3-subpackages\fR option to recursively traverse a directory and its subdirectories, or to pass in an explicit list of package names\&. When you document individual source files, pass in a list of Java source file names\&. See Simple Examples\&.
++.SS PROCESS\ SOURCE\ FILES
++The \f3javadoc\fR command processes files that end in source and other files described in Source Files\&. If you run the \f3javadoc\fR command by passing in individual source file names, then you can determine exactly which source files are processed\&. However, that is not how most developers want to work, because it is simpler to pass in package names\&. The \f3javadoc\fR command can be run three ways without explicitly specifying the source file names\&. You can pass in package names, use the \f3-subpackages\fR option, or use wild cards with source file names\&. In these cases, the \f3javadoc\fR command processes a source file only when the file fulfills all of the following requirements:
++.TP 0.2i
++\(bu
++The file name prefix (with \f3\&.java\fR removed) is a valid class name\&.
++.TP 0.2i
++\(bu
++The path name relative to the root of the source tree is a valid package name after the separators are converted to dots\&.
++.TP 0.2i
++\(bu
++The package statement contains the valid package name\&.
++.PP
++Processing Links
++
++During a run, the \f3javadoc\fR command adds cross-reference links to package, class, and member names that are being documented as part of that run\&. Links appear in the following places\&. See Javadoc Tags for a description of the @ tags\&.
++.TP 0.2i
++\(bu
++Declarations (return types, argument types, and field types)\&.
++.TP 0.2i
++\(bu
++\fISee Also\fR sections that are generated from \f3@see\fR tags\&.
++.TP 0.2i
++\(bu
++Inline text generated from \f3{@link}\fR tags\&.
++.TP 0.2i
++\(bu
++Exception names generated from \f3@throws\fR tags\&.
++.TP 0.2i
++\(bu
++\fISpecified by\fR links to interface members and \fIOverrides\fR links to class members\&. See Method Comment Inheritance\&.
++.TP 0.2i
++\(bu
++Summary tables listing packages, classes and members\&.
++.TP 0.2i
++\(bu
++Package and class inheritance trees\&.
++.TP 0.2i
++\(bu
++The index\&.
++.PP
++You can add links to existing text for classes not included on the command line (but generated separately) by way of the \f3-link\fR and \f3-linkoffline\fR options\&.
++.PP
++Processing Details
++
++The \f3javadoc\fR command produces one complete document every time it runs\&. It does not do incremental builds that modify or directly incorporate the results from earlier runs\&. However, the \f3javadoc\fR command can link to results from other runs\&.
++.PP
++The \f3javadoc\fR command implementation requires and relies on the Java compiler\&. The \f3javadoc\fR command calls part of the \f3javac\fR command to compile the declarations and ignore the member implementations\&. The \f3javadoc\fR command builds a rich internal representation of the classes that includes the class hierarchy and use relationships to generate the HTML\&. The \f3javadoc\fR command also picks up user-supplied documentation from documentation comments in the source code\&. See Documentation Comments\&.
++.PP
++The \f3javadoc\fR command runs on source files that are pure stub files with no method bodies\&. This means you can write documentation comments and run the \f3javadoc\fR command in the early stages of design before API implementation\&.
++.PP
++Relying on the compiler ensures that the HTML output corresponds exactly with the actual implementation, which may rely on implicit, rather than explicit, source code\&. For example, the \f3javadoc\fR command documents default constructors that are present in the compiled class files but not in the source code\&.
++.PP
++In many cases, the \f3javadoc\fR command lets you generate documentation for source files with incomplete or erroneous code\&. You can generate documentation before all debugging and troubleshooting is done\&. The \f3javadoc\fR command does primitive checking of documentation comments\&.
++.PP
++When the \f3javadoc\fR command builds its internal structure for the documentation, it loads all referenced classes\&. Because of this, the \f3javadoc\fR command must be able to find all referenced classes, whether bootstrap classes, extensions, or user classes\&. See How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++.PP
++Typically, classes you create must either be loaded as an extension or in the \f3javadoc\fR command class path\&.
++.SS JAVADOC\ DOCLETS
++You can customize the content and format of the \f3javadoc\fR command output with doclets\&. The \f3javadoc\fR command has a default built-in doclet, called the standard doclet, that generates HTML-formatted API documentation\&. You can modify or make a subclass of the standard doclet, or write your own doclet to generate HTML, XML, MIF, RTF or whatever output format you want\&.
++.PP
++When a custom doclet is not specified with the \f3-doclet\fR option, the \f3javadoc\fR command uses the default standard doclet\&. The \f3javadoc\fR command has several options that are available regardless of which doclet is being used\&. The standard doclet adds a supplementary set of command-line options\&. See Options\&.
++.SH SOURCE\ FILES
++The \f3javadoc\fR command generates output that originates from the following types of source files: Java language source files for classes (\f3\&.java\fR), package comment files, overview comment files, and miscellaneous unprocessed files\&. This section also describes test files and template files that can also be in the source tree, but that you want to be sure not to document\&.
++.SS CLASS\ SOURCE\ FILES
++Each class or interface and its members can have their own documentation comments contained in a source file\&. See Documentation Comments\&.
++.SS PACKAGE\ COMMENT\ FILES
++Each package can have its own documentation comment, contained in its own source file, that the \f3javadoc\fR command merges into the generated package summary page\&. You typically include in this comment any documentation that applies to the entire package\&.
++.PP
++To create a package comment file, you can place your comments in one of the following files:
++.TP 0.2i
++\(bu
++The \f3package-info\&.java\fR file can contain the package declaration, package annotations, package comments, and Javadoc tags\&. This file is preferred\&.
++.TP 0.2i
++\(bu
++The \f3package\&.html\fR file contains only package comments and Javadoc tags\&. No package annotations\&.
++.PP
++A package can have a single \f3package\&.html\fR file or a single \f3package-info\&.java\fR file, but not both\&. Place either file in the package directory in the source tree with your source files\&.
++.PP
++The package-info\&.java File
++
++The \f3package-info\&.java\fR file can contain a package comment of the following structure\&. The comment is placed before the package declaration\&.
++.PP
++\fINote:\fR The comment separators \f3/**\fR and \f3*/\fR must be present, but the leading asterisks on the intermediate lines can be left off\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Provides the classes necessary to create an \fP
++.fi
++.nf
++\f3 * applet and the classes an applet uses \fP
++.fi
++.nf
++\f3 * to communicate with its applet context\&.\fP
++.fi
++.nf
++\f3 * <p>\fP
++.fi
++.nf
++\f3 * The applet framework involves two entities:\fP
++.fi
++.nf
++\f3 * the applet and the applet context\&.\fP
++.fi
++.nf
++\f3 * An applet is an embeddable window (see the\fP
++.fi
++.nf
++\f3 * {@link java\&.awt\&.Panel} class) with a few extra\fP
++.fi
++.nf
++\f3 * methods that the applet context can use to \fP
++.fi
++.nf
++\f3 * initialize, start, and stop the applet\&.\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @since 1\&.0\fP
++.fi
++.nf
++\f3 * @see java\&.awt\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3package java\&.lang\&.applet;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++The package\&.html File
++
++The \f3package\&.html\fR file can contain a package comment of the following structure\&. The comment is placed in the \f3<body>\fR element\&.
++.PP
++File: \f3java/applet/package\&.html\fR
++.sp
++.nf
++\f3<HTML>\fP
++.fi
++.nf
++\f3<BODY>\fP
++.fi
++.nf
++\f3Provides the classes necessary to create an applet and the \fP
++.fi
++.nf
++\f3classes an applet uses to communicate with its applet context\&.\fP
++.fi
++.nf
++\f3<p>\fP
++.fi
++.nf
++\f3The applet framework involves two entities: the applet\fP
++.fi
++.nf
++\f3and the applet context\&. An applet is an embeddable\fP
++.fi
++.nf
++\f3window (see the {@link java\&.awt\&.Panel} class) with a\fP
++.fi
++.nf
++\f3few extra methods that the applet context can use to\fP
++.fi
++.nf
++\f3initialize, start, and stop the applet\&. \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@since 1\&.0 \fP
++.fi
++.nf
++\f3@see java\&.awt\fP
++.fi
++.nf
++\f3</BODY>\fP
++.fi
++.nf
++\f3</HTML>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3package\&.html\fR file is a typical HTML file and does not include a package declaration\&. The content of the package comment file is written in HTML with one exception\&. The documentation comment should not include the comment separators \f3/**\fR and \f3*/\fR or leading asterisks\&. When writing the comment, make the first sentence a summary about the package, and do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. You can include package tags\&. All block tags must appear after the main description\&. If you add an \f3@see\fR tag in a package comment file, then it must have a fully qualified name\&.
++.PP
++Processing the Comment File
++
++When the \f3javadoc\fR command runs, it searches for the package comment file\&. If the package comment file is found, then the \f3javadoc\fR command does the following:
++.TP 0.2i
++\(bu
++Copies the comment for processing\&. For package\&.html, the \f3javadoc\fR command copies all content between the \f3<body>\fR and \f3</body>\fR HTML tags\&. You can include a \f3<head>\fR section to put a \f3<title>\fR tag, source file copyright statement, or other information, but none of these appear in the generated documentation\&.
++.TP 0.2i
++\(bu
++Processes the package tags\&. See Package Tags\&.
++.TP 0.2i
++\(bu
++Inserts the processed text at the bottom of the generated package summary page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++.TP 0.2i
++\(bu
++Copies the first sentence of the package comment to the top of the package summary page\&. The \f3javadoc\fR command also adds the package name and this first sentence to the list of packages on the overview page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++
++The end of the sentence is determined by the same rules used for the end of the first sentence of class and member main descriptions\&.
++.SS OVERVIEW\ COMMENT\ FILES
++Each application or set of packages that you are documenting can have its own overview documentation comment that is kept in its own source file, that the \f3javadoc\fR command merges into the generated overview page\&. You typically include in this comment any documentation that applies to the entire application or set of packages\&.
++.PP
++You can name the file anything you want such as overview\&.html and place it anywhere\&. A typical location is at the top of the source tree\&.
++.PP
++For example, if the source files for the \f3java\&.applet\fR package are contained in the /home/user/src/java/applet directory, then you could create an overview comment file at /home/user/src/overview\&.html\&.
++.PP
++You can have multiple overview comment files for the same set of source files in case you want to run the \f3javadoc\fR command multiple times on different sets of packages\&. For example, you could run the \f3javadoc\fR command once with \f3-private\fR for internal documentation and again without that option for public documentation\&. In this case, you could describe the documentation as public or internal in the first sentence of each overview comment file\&.
++.PP
++The content of the overview comment file is one big documentation comment that is written in HTML\&. Make the first sentence a summary about the application or set of packages\&. Do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. All tags except inline tags, such as an {\f3@link}\fR tag, must appear after the main description\&. If you add an \f3@see\fR tag, then it must have a fully qualified name\&.
++.PP
++When you run the \f3javadoc\fR command, specify the overview comment file name with the \f3-overview\fR option\&. The file is then processed similarly to that of a package comment file\&. The \f3javadoc\fR command does the following:
++.TP 0.2i
++\(bu
++Copies all content between the \f3<body>\fR and \f3</body>\fR tags for processing\&.
++.TP 0.2i
++\(bu
++Processes the overview tags that are present\&. See Overview Tags\&.
++.TP 0.2i
++\(bu
++Inserts the processed text at the bottom of the generated overview page\&. See Java Platform Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++.TP 0.2i
++\(bu
++Copies the first sentence of the overview comment to the top of the overview summary page\&.
++.SS UNPROCESSED\ FILES
++Your source files can include any files that you want the \f3javadoc\fR command to copy to the destination directory\&. These files usually include graphic files, example Java source and class files, and self-standing HTML files with a lot of content that would overwhelm the documentation comment of a typical Java source file\&.
++.PP
++To include unprocessed files, put them in a directory called doc-files\&. The doc-files directory can be a subdirectory of any package directory that contains source files\&. You can have one doc-files subdirectory for each package\&.
++.PP
++For example, if you want to include the image of a button in the \f3java\&.awt\&.Button\fR class documentation, then place the image file in the /home/user/src/java/awt/doc-files/ directory\&. Do not place the doc-files directory at /home/user/src/java/doc-files, because java is not a package\&. It does not contain any source files\&.
++.PP
++All links to the unprocessed files must be included in the code because the \f3javadoc\fR command does not look at the files\&. The \f3javadoc\fR command copies the directory and all of its contents to the destination\&. The following example shows how the link in the Button\&.java documentation comment might look:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This button looks like this: \fP
++.fi
++.nf
++\f3 * <img src="doc\-files/Button\&.gif">\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS TEST\ AND\ TEMPLATE\ FILES
++You can store test and template files in the source tree in the same directory with or in a subdirectory of the directory where the source files reside\&. To prevent test and template files from being processed, run the \f3javadoc\fR command and explicitly pass in individual source file names\&.
++.PP
++Test files are valid, compilable source files\&. Template files are not valid, compatible source files, but they often have the \f3\&.java\fR suffix\&.
++.PP
++Test Files
++
++If you want your test files to belong to either an unnamed package or to a package other than the package that the source files are in, then put the test files in a subdirectory underneath the source files and give the directory an invalid name\&. If you put the test files in the same directory with the source and call the \f3javadoc\fR command with a command-line argument that indicates its package name, then the test files cause warnings or errors\&. If the files are in a subdirectory with an invalid name, then the test file directory is skipped and no errors or warnings are issued\&. For example, to add test files for source files in com\&.package1, put them in a subdirectory in an invalid package name\&. The following directory name is invalid because it contains a hyphen:
++.sp
++.nf
++\f3com/package1/test\-files/\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If your test files contain documentation comments, then you can set up a separate run of the \f3javadoc\fR command to produce test file documentation by passing in their test source file names with wild cards, such as \f3com/package1/test-files/*\&.java\fR\&.
++.PP
++Template Files
++
++If you want a template file to be in the source directory, but not generate errors when you execute the \f3javadoc\fR command, then give it an invalid file name such as \f3Buffer-Template\&.java\fR to prevent it from being processed\&. The \f3javadoc\fR command only processes source files with names, when stripped of the \f3\&.java\fR suffix, that are valid class names\&.
++.SH GENERATED\ FILES
++By default, the \f3javadoc\fR command uses a standard doclet that generates HTML-formatted documentation\&. The standard doclet generates basic content, cross-reference, and support pages described here\&. Each HTML page corresponds to a separate file\&. The \f3javadoc\fR command generates two types of files\&. The first type is named after classes and interfaces\&. The second type contain hyphens (such as package-summary\&.html) to prevent conflicts with the first type of file\&.
++.SS BASIC\ CONTENT\ PAGES
++.TP 0.2i
++\(bu
++One class or interface page (classname\&.html) for each class or interface being documented\&.
++.TP 0.2i
++\(bu
++One package page (package-summary\&.html) for each package being documented\&. The \f3javadoc\fR command includes any HTML text provided in a file with the name package\&.html or package-info\&.java in the package directory of the source tree\&.
++.TP 0.2i
++\(bu
++One overview page (overview-summary\&.html) for the entire set of packages\&. The overview page is the front page of the generated document\&. The \f3javadoc\fR command includes any HTML text provided in a file specified by the \f3-overview\fR option\&. The Overview page is created only when you pass two or more package names into the \f3javadoc\fR command\&. See HTML Frames and Options\&.
++.SS CROSS-REFERENCE\ PAGES
++.TP 0.2i
++\(bu
++One class hierarchy page for the entire set of packages (overview-tree\&.html)\&. To view the hierarchy page, click \fIOverview\fR in the navigation bar and click \fITree\fR\&.
++.TP 0.2i
++\(bu
++One class hierarchy page for each package (package-tree\&.html) To view the hierarchy page, go to a particular package, class, or interface page, and click \fITree\fR to display the hierarchy for that package\&.
++.TP 0.2i
++\(bu
++One use page for each package (package-use\&.html) and a separate use page for each class and interface (class-use/classname\&.html)\&. The use page describes what packages, classes, methods, constructors and fields use any part of the specified class, interface, or package\&. For example, given a class or interface A, its use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A\&. To view the use page, go to the package, class, or interface and click the \fIUse\fR link in the navigation bar\&.
++.TP 0.2i
++\(bu
++A deprecated API page (deprecated-list\&.html) that lists all deprecated APIs and their suggested replacements\&. Avoid deprecated APIs because they can be removed in future implementations\&.
++.TP 0.2i
++\(bu
++A constant field values page (constant-values\&.html) for the values of static fields\&.
++.TP 0.2i
++\(bu
++A serialized form page (serialized-form\&.html) that provides information about serializable and externalizable classes with field and method descriptions\&. The information on this page is of interest to reimplementors, and not to developers who want to use the API\&. To access the serialized form page, go to any serialized class and click \fISerialized Form\fR in the See Also section of the class comment\&. The standard doclet generates a serialized form page that lists any class (public or non-public) that implements Serializable with its \f3readObject\fR and \f3writeObject\fR methods, the fields that are serialized, and the documentation comments from the \f3@serial\fR, \f3@serialField\fR, and \f3@serialData\fR tags\&. Public serializable classes can be excluded by marking them (or their package) with \f3@serial\fR exclude, and package-private serializable classes can be included by marking them (or their package) with an \f3@serial\fR include\&. As of Release 1\&.4, you can generate the complete serialized form for public and private classes by running the \f3javadoc\fR command without specifying the \f3-private\fR option\&. See Options\&.
++.TP 0.2i
++\(bu
++An index page (\f3index-*\&.html\fR) of all class, interface, constructor, field and method names, in alphabetical order\&. The index page is internationalized for Unicode and can be generated as a single file or as a separate file for each starting character (such as A\(enZ for English)\&.
++.SS SUPPORT\ PAGES
++.TP 0.2i
++\(bu
++A help page (help-doc\&.html) that describes the navigation bar and the previous pages\&. Use \f3-helpfile\fR to override the default help file with your own custom help file\&.
++.TP 0.2i
++\(bu
++One index\&.html file that creates the HTML frames for display\&. Load this file to display the front page with frames\&. The index\&.html file contains no text content\&.
++.TP 0.2i
++\(bu
++Several frame files (\f3*-frame\&.html\fR) that contains lists of packages, classes, and interfaces\&. The frame files display the HTML frames\&.
++.TP 0.2i
++\(bu
++A package list file (package-list) that is used by the \f3-link\fR and \f3-linkoffline\fR options\&. The package list file is a text file that is not reachable through links\&.
++.TP 0.2i
++\(bu
++A style sheet file (stylesheet\&.css) that controls a limited amount of color, font family, font size, font style, and positioning information on the generated pages\&.
++.TP 0.2i
++\(bu
++A doc-files directory that holds image, example, source code, or other files that you want copied to the destination directory\&. These files are not processed by the \f3javadoc\fR command\&. This directory is not processed unless it exists in the source tree\&.
++.PP
++See Options\&.
++.SS HTML\ FRAMES
++The \f3javadoc\fR command generates the minimum number of frames (two or three) necessary based on the values passed to the command\&. It omits the list of packages when you pass a single package name or source files that belong to a single package as an argument to the \f3javadoc\fR command\&. Instead, the \f3javadoc\fR command creates one frame in the left-hand column that displays the list of classes\&. When you pass two or more package names, the \f3javadoc\fR command creates a third frame that lists all packages and an overview page (overview-summary\&.html)\&. To bypass frames, click the \fINo Frames\fR link or enter the page set from the overview-summary\&.html page\&.
++.SS GENERATED\ FILE\ STRUCTURE
++The generated class and interface files are organized in the same directory hierarchy that Java source files and class files are organized\&. This structure is one directory per subpackage\&.
++.PP
++For example, the document generated for the \f3java\&.applet\&.Applet\fR class would be located at java/applet/Applet\&.html\&.
++.PP
++The file structure for the \f3java\&.applet\fR package follows, assuming that the destination directory is named \f3apidocs\fR\&. All files that contain the word \fIframe\fR appear in the upper-left or lower-left frames, as noted\&. All other HTML files appear in the right-hand frame\&.
++.PP
++Directories are bold\&. The asterisks (*) indicate the files and directories that are omitted when the arguments to the \f3javadoc\fR command are source file names rather than package names\&. When arguments are source file names, an empty package list is created\&. The doc-files directory is not created in the destination unless it exists in the source tree\&. See Generated Files\&.
++.TP 0.2i
++\(bu
++\fIapidocs\fR: Top-level directory
++.RS
++.TP 0.2i
++\(bu
++index\&.html: Initial Page that sets up HTML frames
++.TP 0.2i
++\(bu
++*overview-summary\&.html: Package list with summaries
++.TP 0.2i
++\(bu
++overview-tree\&.html: Class hierarchy for all packages
++.TP 0.2i
++\(bu
++deprecated-list\&.html: Deprecated APIs for all packages
++.TP 0.2i
++\(bu
++constant-values\&.html: Static field values for all packages
++.TP 0.2i
++\(bu
++serialized-form\&.html: Serialized forms for all packages
++.TP 0.2i
++\(bu
++*overview-frame\&.html: All packages for display in upper-left frame
++.TP 0.2i
++\(bu
++allclasses-frame\&.html: All classes for display in lower-left frame
++.TP 0.2i
++\(bu
++help-doc\&.html: Help about Javadoc page organization
++.TP 0.2i
++\(bu
++index-all\&.html: Default index created without \f3-splitindex\fR option
++.TP 0.2i
++\(bu
++\fIindex-files\fR: Directory created with \f3-splitindex\fR option
++.RS
++.TP 0.2i
++\(bu
++index-<number>\&.html: Index files created with \f3-splitindex\fR option
++.RE
++
++.TP 0.2i
++\(bu
++package-list: Package names for resolving external references
++.TP 0.2i
++\(bu
++stylesheet\&.css: Defines fonts, colors, positions, and so on
++.RE
++
++.TP 0.2i
++\(bu
++\fIjava\fR: Package directory
++.RS
++.TP 0.2i
++\(bu
++\fIapplet\fR: Subpackage directory
++.RS
++.TP 0.2i
++\(bu
++Applet\&.html: \f3Applet\fR class page
++.TP 0.2i
++\(bu
++AppletContext\&.html: \f3AppletContext\fR interface
++.TP 0.2i
++\(bu
++AppletStub\&.html: \f3AppletStub\fR interface
++.TP 0.2i
++\(bu
++AudioClip\&.html: \f3AudioClip\fR interface
++.TP 0.2i
++\(bu
++package-summary\&.html: Classes with summaries
++.TP 0.2i
++\(bu
++package-frame\&.html: Package classes for display in lower-left frame
++.TP 0.2i
++\(bu
++package-tree\&.html: Class hierarchy for this package
++.TP 0.2i
++\(bu
++package-use\&.html: Where this package is used
++.TP 0.2i
++\(bu
++\fIdoc-files\fR: Image and example files directory
++.TP 0.2i
++\(bu
++\fIclass-use\fR: Image and examples file location
++
++- Applet\&.html: Uses of the Applet class
++
++- AppletContext\&.html: Uses of the \f3AppletContext\fR interface
++
++- AppletStub\&.html: Uses of the \f3AppletStub\fR interface
++
++- AudioClip\&.html: Uses of the \f3AudioClip\fR interface
++.RE
++
++.RE
++
++.TP 0.2i
++\(bu
++\fIsrc-html\fR: Source code directory
++.RS
++.TP 0.2i
++\(bu
++\fIjava\fR: Package directory
++.RS
++.TP 0.2i
++\(bu
++\fIapplet\fR: Subpackage directory
++
++- Applet\&.html: Applet source code
++
++- AppletContext\&.html: \f3AppletContext\fR source code
++
++- AppletStub\&.html: \f3AppletStub\fR source code
++
++- AudioClip\&.html: \f3AudioClip\fR source code
++.RE
++
++.RE
++
++.SS GENERATED\ API\ DECLARATIONS
++The \f3javadoc\fR command generates a declaration at the start of each class, interface, field, constructor, and method description for that API item\&. For example, the declaration for the \f3Boolean\fR class is:
++.sp
++.nf
++\f3public final class Boolean\fP
++.fi
++.nf
++\f3extends Object\fP
++.fi
++.nf
++\f3implements Serializable\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The declaration for the \f3Boolean\&.valueOf\fR method is:
++.sp
++.nf
++\f3public static Boolean valueOf(String s)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3javadoc\fR command can include the modifiers \f3public\fR, \f3protected\fR, \f3private\fR, \f3abstract\fR, \f3final\fR, \f3static\fR, \f3transient\fR, and \f3volatile\fR, but not \f3synchronized\fR or \f3native\fR\&. The \f3synchronized\fR and \f3native\fR modifiers are considered implementation detail and not part of the API specification\&.
++.PP
++Rather than relying on the keyword \f3synchronized\fR, APIs should document their concurrency semantics in the main description of the comment\&. For example, a description might be: A single enumeration cannot be used by multiple threads concurrently\&. The document should not describe how to achieve these semantics\&. As another example, while the \f3Hashtable\fR option should be thread-safe, there is no reason to specify that it is achieved by synchronizing all of its exported methods\&. It is better to reserve the right to synchronize internally at the bucket level for higher concurrency\&.
++.SH DOCUMENTATION\ COMMENTS
++This section describes source code comments and comment inheritance\&.
++.SS SOURCE\ CODE\ COMMENTS
++You can include documentation comments in the source code, ahead of declarations for any class, interface, method, constructor, or field\&. You can also create documentation comments for each package and another one for the overview, though their syntax is slightly different\&. A documentation comment consists of the characters between \f3/**\fR and \f3*/\fR that end it\&. Leading asterisks are allowed on each line and are described further in the following section\&. The text in a comment can continue onto multiple lines\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is the typical format of a simple documentation comment\fP
++.fi
++.nf
++\f3 * that spans two lines\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To save space you can put a comment on one line:
++.sp
++.nf
++\f3/** This comment takes up only one line\&. */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Placement of Comments
++
++Documentation comments are recognized only when placed immediately before class, interface, constructor, method, or field declarations\&. Documentation comments placed in the body of a method are ignored\&. The \f3javadoc\fR command recognizes only one documentation comment per declaration statement\&. See Where Tags Can Be Used\&.
++.PP
++A common mistake is to put an \f3import\fR statement between the class comment and the class declaration\&. Do not put an \f3import\fR statement at this location because the \f3javadoc\fR command ignores the class comment\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is the class comment for the class Whatever\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3import com\&.example; // MISTAKE \- Important not to put import statement here\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class Whatever{ }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Parts of Comments
++
++A documentation comment has a main description followed by a tag section\&. The main description begins after the starting delimiter \f3/**\fR and continues until the tag section\&. The tag section starts with the first block tag, which is defined by the first \f3@\fR character that begins a line (ignoring leading asterisks, white space, and leading separator \f3/**\fR)\&. It is possible to have a comment with only a tag section and no main description\&. The main description cannot continue after the tag section begins\&. The argument to a tag can span multiple lines\&. There can be any number of tags, and some types of tags can be repeated while others cannot\&. For example, this \f3@see\fR tag starts the tag section:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This sentence holds the main description for this documentation comment\&.\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Object\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Block and inline Tags
++
++A tag is a special keyword within a documentation comment that the \f3javadoc\fR command processes\&. There are two kinds of tags: block tags, which appear as an \f3@tag\fR tag (also known as standalone tags), and inline tags, which appear within braces, as an \f3{@tag}\fR tag\&. To be interpreted, a block tag must appear at the beginning of a line, ignoring leading asterisks, white space, and the separator (\f3/**\fR)\&. This means you can use the \f3@\fR character elsewhere in the text and it will not be interpreted as the start of a tag\&. If you want to start a line with the \f3@\fR character and not have it be interpreted, then use the HTML entity \f3&#064;\fR\&. Each block tag has associated text, which includes any text following the tag up to, but not including, either the next tag, or the end of the documentation comment\&. This associated text can span multiple lines\&. An inline tag is allowed and interpreted anywhere that text is allowed\&. The following example contains the \f3@deprecated\fR block tag and the \f3{@link}\fR inline tag\&. See Javadoc Tags\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @deprecated As of JDK 1\&.1, replaced by {@link #setBounds(int,int,int,int)}\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Write Comments in HTML
++
++The text must be written in HTML with HTML entities and HTML tags\&. You can use whichever version of HTML your browser supports\&. The standard doclet generates HTML 3\&.2-compliant code elsewhere (outside of the documentation comments) with the inclusion of cascading style sheets and frames\&. HTML 4\&.0 is preferred for generated files because of the frame sets\&.
++.PP
++For example, entities for the less than symbol (<) and the greater than symbol (>) should be written as \f3&lt;\fR and \f3&gt;\fR\&. Similarly, the ampersand (&) should be written as \f3&amp;\fR\&. The bold HTML tag \f3<b>\fR is shown in the following example\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is a <b>doc</b> comment\&.\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Object\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Leading Asterisks
++
++When the \f3javadoc\fR command parses a documentation comment, leading asterisks (*) on each line are discarded, and blanks and tabs that precede the initial asterisks (*) are also discarded\&. If you omit the leading asterisk on a line, then the leading white space is no longer removed so that you can paste code examples directly into a documentation comment inside a \f3<PRE>\fR tag with its indentation preserved\&. Spaces are interpreted by browsers more uniformly than tabs\&. Indentation is relative to the left margin (rather than the separator \f3/**\fR or \f3<PRE>\fR tag)\&.
++.PP
++First Sentence
++
++The first sentence of each documentation comment should be a summary sentence that contains a concise but complete description of the declared entity\&. This sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first block tag\&. The \f3javadoc\fR command copies this first sentence to the member summary at the top of the HTML page\&.
++.PP
++Multiple-Field Declarations
++
++The Java platform lets you declare multiple fields in a single statement, but this statement can have only one documentation comment that is copied for all fields\&. If you want individual documentation comments for each field, then declare each field in a separate statement\&. For example, the following documentation comment does not make sense written as a single declaration and would be better handled as two declarations:
++.sp
++.nf
++\f3/** \fP
++.fi
++.nf
++\f3 * The horizontal and vertical distances of point (x,y)\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public int x, y; // Avoid this \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3javadoc\fR command generates the following documentation from the previous code:
++.sp
++.nf
++\f3public int x\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The horizontal and vertical distances of point (x, y)\&.
++.sp
++.nf
++\f3public int y\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The horizontal and vertical distances of point (x, y)\&.
++.PP
++Use of Header Tags
++
++When writing documentation comments for members, it is best not to use HTML heading tags such as \f3<H1>\fR and \f3<H2>\fR, because the \f3javadoc\fR command creates an entire structured document, and these structural tags might interfere with the formatting of the generated document\&. However, you can use these headings in class and package comments to provide your own structure\&.
++.SS METHOD\ COMMENT\ INHERITANCE
++The \f3javadoc\fR command allows method comment inheritance in classes and interfaces to fill in missing text or to explicitly inherit method comments\&. Constructors, fields, and nested classes do not inherit documentation comments\&.
++.PP
++\fINote:\fR The source file for an inherited method must be on the path specified by the \f3-sourcepath\fR option for the documentation comment to be available to copy\&. Neither the class nor its package needs to be passed in on the command line\&. This contrasts with Release 1\&.3\&.\fIn\fR and earlier releases, where the class had to be a documented class\&.
++.PP
++Fill in Missing Text
++
++When a main description, or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag is missing from a method comment, the \f3javadoc\fR command copies the corresponding main description or tag comment from the method it overrides or implements (if any)\&. See Method Comment Inheritance\&.
++.PP
++When an \f3@param\fR tag for a particular parameter is missing, the comment for that parameter is copied from the method further up the inheritance hierarchy\&. When an \f3@throws\fR tag for a particular exception is missing, the \f3@throws\fR tag is copied only when that exception is declared\&.
++.PP
++This behavior contrasts with Release 1\&.3 and earlier, where the presence of any main description or tag would prevent all comments from being inherited\&.
++.PP
++See Javadoc Tags and Options\&.
++.PP
++Explicit Inheritance
++
++Insert the \f3{@inheritDoc}\fR inline tag in a method main description or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag comment\&. The corresponding inherited main description or tag comment is copied into that spot\&.
++.SS CLASS\ AND\ INTERFACE\ INHERITANCE
++Comment inheritance occurs in all possible cases of inheritance from classes and interfaces:
++.TP 0.2i
++\(bu
++When a method in a class overrides a method in a superclass
++.TP 0.2i
++\(bu
++When a method in an interface overrides a method in a superinterface
++.TP 0.2i
++\(bu
++When a method in a class implements a method in an interface
++.PP
++In the first two cases, the \f3javadoc\fR command generates the subheading \fIOverrides\fR in the documentation for the overriding method\&. A link to the method being overridden is included, whether or not the comment is inherited\&.
++.PP
++In the third case, when a method in a specified class implements a method in an interface, the \f3javadoc\fR command generates the subheading \fISpecified by\fR in the documentation for the overriding method\&. A link to the method being implemented is included, whether or not the comment is inherited\&.
++.SS METHOD\ COMMENTS\ ALGORITHM
++If a method does not have a documentation comment, or has an \f3{@inheritDoc}\fR tag, then the \f3javadoc\fR command uses the following algorithm to search for an applicable comment\&. The algorithm is designed to find the most specific applicable documentation comment, and to give preference to interfaces over superclasses:
++.TP 0.4i
++1\&.
++Look in each directly implemented (or extended) interface in the order they appear following the word \f3implements\fR (or \f3extends\fR) in the method declaration\&. Use the first documentation comment found for this method\&.
++.TP 0.4i
++2\&.
++If Step 1 failed to find a documentation comment, then recursively apply this entire algorithm to each directly implemented (or extended) interface in the same order they were examined in Step 1\&.
++.TP 0.4i
++3\&.
++When Step 2 fails to find a documentation comment and this is a class other than the \f3Object\fR class, but not an interface:
++.RS
++.TP 0.4i
++1\&.
++If the superclass has a documentation comment for this method, then use it\&.
++.TP 0.4i
++2\&.
++If Step 3a failed to find a documentation comment, then recursively apply this entire algorithm to the superclass\&.
++.RE
++
++.SH JAVADOC\ TAGS
++The \f3javadoc\fR command parses special tags when they are embedded within a Java documentation comment\&. The \f3javadoc\fR tags let you autogenerate a complete, well-formatted API from your source code\&. The tags start with an at sign (\f3@\fR) and are case-sensitive\&. They must be typed with the uppercase and lowercase letters as shown\&. A tag must start at the beginning of a line (after any leading spaces and an optional asterisk), or it is treated as text\&. By convention, tags with the same name are grouped together\&. For example, put all \f3@see\fR tags together\&. For more information, see Where Tags Can Be Used\&.
++.PP
++Tags have the following types:
++.TP 0.2i
++\(bu
++Bock tags: Place block tags only in the tag section that follows the description\&. Block tags have the form: \fI@tag\fR\&.
++.TP 0.2i
++\(bu
++Inline tags: Place inline tags anywhere in the main description or in the comments for block tags\&. Inline tags are enclosed within braces: \fI{@tag}\fR\&.
++.PP
++For custom tags, see -tag tagname:Xaoptcmf:"taghead"\&. See also Where Tags Can Be Used\&.
++.SS TAG\ DESCRIPTIONS
++.TP
++@author \fIname-text\fR
++Introduced in JDK 1\&.0
++
++Adds an Author entry with the specified name text to the generated documents when the \f3-author\fR option is used\&. A documentation comment can contain multiple \f3@author\fR tags\&. You can specify one name per \f3@author\fR tag or multiple names per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and space between names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line if you want a localized name separator other than a comma\&. See @author in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@author
++.TP
++{@code \fItext\fR}
++Introduced in JDK 1\&.5
++
++Equivalent to \f3<code>{@literal}</code>\fR\&.
++
++Displays text in code font without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use regular angle brackets (< and >) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (\f3<-\fR)\&. For example, the documentation comment text \f3{@code A<B>C}\fR displayed in the generated HTML page unchanged as \f3A<B>C\fR\&. This means that the \f3<B>\fR is not interpreted as bold and is in code font\&. If you want the same functionality without the code font, then use the \f3{@literal}\fR tag\&.
++.TP
++@deprecated \fIdeprecated-text\fR
++Introduced in JDK 1\&.0
++
++Adds a comment indicating that this API should no longer be used (even though it may continue to work)\&. The \f3javadoc\fR command moves \f3deprecated-text\fRahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field\&.
++
++The first sentence of deprecated text should tell the user when the API was deprecated and what to use as a replacement\&. The \f3javadoc\fR command copies the first sentence to the summary section and index\&. Subsequent sentences can also explain why it was deprecated\&. You should include an \f3{@link}\fR tag (for Javadoc 1\&.2 or later) that points to the replacement API\&.
++
++Use the \fI@deprecated annotation\fR tag to deprecate a program element\&. See How and When to Deprecate APIs at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html
++
++See also @deprecated in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@deprecated
++.TP
++{@docRoot}
++Introduced in JDK 1\&.3
++
++Represents the relative path to the generated document\&'s (destination) root directory from any generated page\&. This tag is useful when you want to include a file, such as a copyright page or company logo, that you want to reference from all generated pages\&. Linking to the copyright page from the bottom of each page is common\&.
++
++This \f3{@docRoot}\fR tag can be used both on the command line and in a documentation comment\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, and includes the text portion of any tag (such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags)\&.
++.RS
++.TP 0.2i
++\(bu
++On the command line, where the header, footer, or bottom are defined: \f3javadoc -bottom \&'<a href="{@docRoot}/copyright\&.html">Copyright</a>\&'\fR\&.
++
++When you use the \f3{@docRoot}\fR tag this way in a make file, some \f3makefile\fR programs require a special way to escape for the brace \f3{}\fR characters\&. For example, the Inprise MAKE version 5\&.2 running on Windows requires double braces: \f3{{@docRoot}}\fR\&. It also requires double (rather than single) quotation marks to enclose arguments to options such as the \f3-bottom\fR option (with the quotation marks around the \f3href\fR argument omitted)\&.
++.TP 0.2i
++\(bu
++In a documentation comment:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * See the <a href="{@docRoot}/copyright\&.html">Copyright</a>\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This tag is needed because the generated documents are in hierarchical directories, as deep as the number of subpackages\&. The expression: \f3<a href="{@docRoot}/copyright\&.html">\fR resolves to \f3<a href="\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/Object\&.java\fR and \f3<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/ref/Reference\&.java\fR\&.
++.RE
++
++.TP
++@exception \fIclass-name description\fR
++Introduced in JDK 1\&.0
++
++Identical to the \f3@throws\fR tag\&. See @throws class-name description\&.
++.TP
++{@inheritDoc}
++Introduced in JDK 1\&.4
++
++Inherits (copies) documentation from the nearest inheritable class or implementable interface into the current documentation comment at this tag\&'s location\&. This enables you to write more general comments higher up the inheritance tree and to write around the copied text\&.
++
++This tag is valid only in these places in a documentation comment:
++.RS
++.TP 0.2i
++\(bu
++In the main description block of a method\&. In this case, the main description is copied from a class or interface up the hierarchy\&.
++.TP 0.2i
++\(bu
++In the text arguments of the \f3@return\fR, \f3@param,\fR and \f3@throws\fR tags of a method\&. In this case, the tag text is copied from the corresponding tag up the hierarchy\&.
++.RE
++
++
++See Method Comment Inheritance for a description of how comments are found in the inheritance hierarchy\&. Note that if this tag is missing, then the comment is or is not automatically inherited according to rules described in that section\&.
++.TP
++{@link \fIpackage\&.class#member label\fR}
++Introduced in JDK 1\&.2
++
++Inserts an inline link with a visible text label that points to the documentation for the specified package, class, or member name of a referenced class\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, including the text portion of any tag, such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags\&. See @link in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#{@link
++
++This tag is similar to the \f3@see\fR tag\&. Both tags require the same references and accept the same syntax for \f3package\&.class#member\fR and \f3label\fR\&. The main difference is that the \f3{@link}\fR tag generates an inline link rather than placing the link in the See Also section\&. The \f3{@link}\fR tag begins and ends with braces to separate it from the rest of the inline text\&. If you need to use the right brace (\f3}\fR) inside the label, then use the HTML entity notation \f3&#125;\fR\&.
++
++There is no limit to the number of \f3{@link}\fR tags allowed in a sentence\&. You can use this tag in the main description part of any documentation comment or in the text portion of any tag, such as the \f3@deprecated\fR, \f3@return\fR or \f3@param\fR tags\&.
++
++For example, here is a comment that refers to the \f3getComponentAt(int, int)\fR method:
++.sp
++.nf
++\f3Use the {@link #getComponentAt(int, int) getComponentAt} method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++From this code, the standard doclet generates the following HTML (assuming it refers to another class in the same package):
++.sp
++.nf
++\f3Use the <a href="Component\&.html#getComponentAt(int, int)">getComponentAt</a> method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The previous line appears on the web page as:
++.sp
++.nf
++\f3Use the getComponentAt method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++{@linkplain \fIpackage\&.class#member label\fR}
++Introduced in JDK 1\&.4
++
++Behaves the same as the \f3{@link}\fR tag, except the link label is displayed in plain text rather than code font\&. Useful when the label is plain text\&. For example, \f3Refer to {@linkplain add() the overridden method}\fR\&. displays as: Refer to the overridden method\&.
++.TP
++{@literal \fItext\fR}
++Introduced in JDK 1\&.5
++
++Displays text without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use angle brackets (\f3< and >\fR) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (<-)\&. For example, the documentation comment text \f3{@literal A<B>C}\fR displays unchanged in the generated HTML page in your browser, as \f3A<B>C\fR\&. The \f3<B>\fR is not interpreted as bold (and it is not in code font)\&. If you want the same functionality with the text in code font, then use the \f3{@code}\fR tag\&.
++.TP
++@param \fIparameter-name description\fR
++Introduced in JDK 1\&.0
++
++Adds a parameter with the specified \f3parameter-name\fR followed by the specified description to the Parameters section\&. When writing the documentation comment, you can continue the description onto multiple lines\&. This tag is valid only in a documentation comment for a method, constructor, or class\&. See @param in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@param
++
++The \f3parameter-name\fR can be the name of a parameter in a method or constructor, or the name of a type parameter of a class, method, or constructor\&. Use angle brackets around this parameter name to specify the use of a type parameter\&.
++
++Example of a type parameter of a class:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @param <E> Type of element stored in a list\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public interface List<E> extends Collection<E> {\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Example of a type parameter of a method:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @param string the string to be converted\fP
++.fi
++.nf
++\f3 * @param type the type to convert the string to\fP
++.fi
++.nf
++\f3 * @param <T> the type of the element\fP
++.fi
++.nf
++\f3 * @param <V> the value of the element\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3<T, V extends T> V convert(String string, Class<T> type) {\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++@return \fIdescription\fR
++Introduced in JDK 1\&.0
++
++Adds a Returns section with the description text\&. This text should describe the return type and permissible range of values\&. This tag is valid only in a documentation comment for a method\&. See @return in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@return
++.TP
++@see \fIreference\fR
++Introduced in JDK 1\&.0
++
++Adds a \fISee Also\fR heading with a link or text entry that points to a reference\&. A documentation comment can contain any number of \f3@see\fR tags, which are all grouped under the same heading\&. The \f3@see\fR tag has three variations\&. The form is the most common\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. For inserting an inline link within a sentence to a package, class, or member, see \f3{@link}\fR\&.
++
++\fIForm 1\fR\&. The @see \f3string\fR tag form adds a text entry for \fIstring\fR\&. No link is generated\&. The string is a book or other reference to information not available by URL\&. The \f3javadoc\fR command distinguishes this from the previous cases by searching for a double quotation mark (") as the first character\&. For example, \f3@see "The Java Programming Language"\fR that generates the following text:
++
++\fISee Also\fR:
++
++"The Java Programming Language"
++
++\fIForm 2\fR\&. The \f3@see <a href="URL#value">label</a>\fR form adds a link as defined by \f3URL#value\fR\&. The \f3URL#value\fR parameter is a relative or absolute URL\&. The \f3javadoc\fR command distinguishes this from other cases by searching for a less-than symbol (\f3<\fR) as the first character\&. For example, \f3@see <a href="spec\&.html#section">Java Spec</a>\fR generates the following link:
++
++\fISee Also\fR:
++
++Java Spec
++
++\fIForm 3\fR\&. The \f3@see package\&.class#member label\fR form adds a link with a visible text label that points to the documentation for the specified name in the Java Language that is referenced\&. The label is optional\&. If the label is omitted, then the name appears instead as visible text, suitably shortened\&. Use the \f3-noqualifier\fR option to globally remove the package name from this visible text\&. Use the label when you want the visible text to be different from the autogenerated visible text\&. See How a Name Appears\&.
++
++In Java SE 1\&.2 only, the name but not the label automatically appears in \f3<code>\fR HTML tags\&. Starting with Java SE 1\&.2\&.2, the \f3<code>\fR tag is always included around the visible text, whether or not a label is used\&.
++.RS
++.TP 0.2i
++\(bu
++\f3package\&.class#member\fR is any valid program element name that is referenced, such as a package, class, interface, constructor, method or field name, except that the character ahead of the member name should be a number sign (\f3#\fR)\&. The class represents any top-level or nested class or interface\&. The member represents any constructor, method, or field (not a nested class or interface)\&. If this name is in the documented classes, then the \f3javadoc\fR command create a link to it\&. To create links to external referenced classes, use the \f3-link\fR option\&. Use either of the other two \f3@see\fR tag forms to refer to the documentation of a name that does not belong to a referenced class\&. See Specify a Name\&.
++
++\fINote:\fR External referenced classes are classes that are not passed into the \f3javadoc\fR command on the command line\&. Links in the generated documentation to external referenced classes are called external references or external links\&. For example, if you run the \f3javadoc\fR command on only the \f3java\&.awt package\fR, then any class in \f3java\&.lang\fR, such as \f3Object\fR, is an external referenced class\&. Use the \f3-link\fR and \f3-linkoffline\fR options to link to external referenced classes\&. The source comments of external referenced classes are not available to the \f3javadoc\fR command run\&.
++.TP 0.2i
++\(bu
++\f3label\fR is optional text that is visible as the link label\&. The label can contain white space\&. If \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears, suitably shortened relative to the current class and package\&. See How a Name Appears\&.
++.TP 0.2i
++\(bu
++A space is the delimiter between \f3package\&.class#member\fR and \f3label\fR\&. A space inside parentheses does not indicate the start of a label, so spaces can be used between parameters in a method\&.
++.RE
++
++
++\fI\fRIn the following example, an \f3@see\fR tag (in the \f3Character\fR class) refers to the equals method in the \f3String\fR class\&. The tag includes both arguments: the name \f3String#equals(Object)\fR and the label \f3equals\fR\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @see String#equals(Object) equals\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The standard doclet produces HTML that is similar to:
++.sp
++.nf
++\f3<dl>\fP
++.fi
++.nf
++\f3<dt><b>See Also:</b>\fP
++.fi
++.nf
++\f3<dd><a href="\&.\&./\&.\&./java/lang/String#equals(java\&.lang\&.Object)"><code>equals<code></a>\fP
++.fi
++.nf
++\f3</dl>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The previous code looks similar to the following in a browser, where the label is the visible link text:
++
++\fISee Also\fR:
++
++equals
++.PP
++Specify a Name
++
++\fI\fRThis \f3package\&.class#member\fR name can be either fully qualified, such as \f3java\&.lang\&.String#toUpperCase()\fR or not, such as \f3String#toUpperCase()\fR or \f3#toUpperCase()\fR\&. If the name is less than fully qualified, then the \f3javadoc\fR command uses the standard Java compiler search order to find it\&. See Search Order for the @see Tag\&. The name can contain white space within parentheses, such as between method arguments\&.The advantage to providing shorter, partially qualified names is that they are shorter to type and there is less clutter in the source code\&. The following listing shows the different forms of the name, where \f3Class\fR can be a class or interface; Type can be a class, interface, array, or primitive; and method can be a method or constructor\&.
++.sp
++.nf
++\f3\fITypical forms for\fR\fI @see package\&.class#member\fR\fP
++.fi
++.nf
++\f3\fIReferencing a member of the current class\fR\fP
++.fi
++.nf
++\f3@see #field\fP
++.fi
++.nf
++\f3@see #method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #constructor(Type argname, Type argname,\&.\&.\&.) \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\fIReferencing another class in the current or imported packages\fR\fP
++.fi
++.nf
++\f3@see Class#field\fP
++.fi
++.nf
++\f3@see Class#method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class\&.NestedClass\fP
++.fi
++.nf
++\f3@see Class \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\fIReferencing an element in another package (fully qualified)\fR\fP
++.fi
++.nf
++\f3@see package\&.Class#field\fP
++.fi
++.nf
++\f3@see package\&.Class#method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class\&.NestedClass\fP
++.fi
++.nf
++\f3@see package\&.Class\fP
++.fi
++.nf
++\f3@see package\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3\fRNotes about the previous listing:
++.TP 0.2i
++\(bu
++The first set of forms with no class or package causes the \f3javadoc\fR command to search only through the current class hierarchy\&. It finds a member of the current class or interface, one of its superclasses or superinterfaces, or one of its enclosing classes or interfaces (search Items 1\(en3)\&. It does not search the rest of the current package or other packages (search Items 4\(en5)\&. See Search Order for the @see Tag\&.
++.TP 0.2i
++\(bu
++If any method or constructor is entered as a name with no parentheses, such as \f3getValue\fR, and if there is no field with the same name, then the \f3javadoc\fR command still creates a link to the method\&. If this method is overloaded, then the \f3javadoc\fR command links to the first method its search encounters, which is unspecified\&.
++.TP 0.2i
++\(bu
++Nested classes must be specified as \f3outer\&.inner\fR, not simply \f3inner\fR, for all forms\&.
++.TP 0.2i
++\(bu
++As stated, the number sign (\f3#\fR), rather than a dot (\f3\&.\fR) separates a member from its class\&. This enables the \f3javadoc\fR command to resolve ambiguities, because the dot also separates classes, nested classes, packages, and subpackages\&. However, the \f3javadoc\fR command properly parses a dot when there is no ambiguity, but prints a warning to alert you\&.
++.PP
++Search Order for the @see Tag
++
++\fI\fRThe \f3javadoc\fR command processes an \f3@see\fR tag that appears in a source file, package file, or overview file\&. In the latter two files, you must fully qualify the name you supply with the \f3@see\fR tag\&. In a source file, you can specify a name that is fully qualified or partially qualified\&.
++.PP
++The following is the search order for the \f3@see\fR tag\&.
++.TP 0.4i
++1\&.
++The current class or interface\&.
++.TP 0.4i
++2\&.
++Any enclosing classes and interfaces searching the closest first\&.
++.TP 0.4i
++3\&.
++Any superclasses and superinterfaces, searching the closest first\&.
++.TP 0.4i
++4\&.
++The current package\&.
++.TP 0.4i
++5\&.
++Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statement\&.
++.PP
++The \f3javadoc\fR command continues to search recursively through Items 1-3 for each class it encounters until it finds a match\&. That is, after it searches through the current class and its enclosing class E, it searches through the superclasses of E before the enclosing classes of E\&. In Items 4 and 5, the \f3javadoc\fR command does not search classes or interfaces within a package in any specified order (that order depends on the particular compiler)\&. In Item 5, the \f3javadoc\fR command searches in \fIjava\&.lang\fR because that is imported by all programs\&.
++.PP
++When the \f3javadoc\fR command encounters an \f3@see\fR tag in a source file that is not fully qualified, it searches for the specified name in the same order as the Java compiler would, except the \f3javadoc\fR command does not detect certain name space ambiguities because it assumes the source code is free of these errors\&. This search order is formally defined in the Java Language Specification\&. The \f3javadoc\fR command searches for that name through all related and imported classes and packages\&. In particular, it searches in this order:
++.TP 0.4i
++1\&.
++The current class or interface\&.
++.TP 0.4i
++2\&.
++Any enclosing classes and interfaces, searching the closest first\&.
++.TP 0.4i
++3\&.
++Any superclasses and superinterfaces, searching the closest first\&.
++.TP 0.4i
++4\&.
++The current package\&.
++.TP 0.4i
++5\&.
++Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statements\&.
++.PP
++The \f3javadoc\fR command does not necessarily look in subclasses, nor will it look in other packages even when their documentation is being generated in the same run\&. For example, if the \f3@see\fR tag is in the \f3java\&.awt\&.event\&.KeyEvent\fR class and refers to a name in the \f3java\&.awt package\fR, then the \f3javadoc\fR command does not look in that package unless that class imports it\&.
++.PP
++How a Name Appears
++
++\fI\fRIf \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears\&. In general, it is suitably shortened relative to the current class and package\&. Shortened means the \f3javadoc\fR command displays only the minimum name necessary\&. For example, if the \f3String\&.toUpperCase()\fR method contains references to a member of the same class and to a member of a different class, then the class name is displayed only in the latter case, as shown in the following listing\&. Use the \f3-noqualifier\fR option to globally remove the package names\&.
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of the same class, same package
++.br
++\fIExample in\fR: \f3@see String#toLowerCase()\fR
++.br
++\fIAppears as\fR: \f3toLowerCase()\fR - omits the package and class names
++.br
++
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, same package
++.br
++\fIExample in\fR: \f3@see Character#toLowerCase(char)\fR
++.br
++\fIAppears as\fR: \f3Character\&.toLowerCase(char)\fR - omits the package name, includes the class name
++.br
++
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, different package
++.br
++\fIExample in\fR: \f3@see java\&.io\&.File#exists()\fR
++.br
++\fIAppears as\fR: \f3java\&.io\&.File\&.exists()\fR - includes the package and class names
++.br
++
++.PP
++Examples of the @see Tag
++
++The comment to the right shows how the name appears when the \f3@see\fR tag is in a class in another package, such as \f3java\&.applet\&.Applet\fR\&. See @see in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@see
++.sp
++.nf
++\f3 See also:\fP
++.fi
++.nf
++\f3@see java\&.lang\&.String // String \fP
++.fi
++.nf
++\f3@see java\&.lang\&.String The String class // The String class \fP
++.fi
++.nf
++\f3@see String // String \fP
++.fi
++.nf
++\f3@see String#equals(Object) // String\&.equals(Object) \fP
++.fi
++.nf
++\f3@see String#equals // String\&.equals(java\&.lang\&.Object) \fP
++.fi
++.nf
++\f3@see java\&.lang\&.Object#wait(long) // java\&.lang\&.Object\&.wait(long) \fP
++.fi
++.nf
++\f3@see Character#MAX_RADIX // Character\&.MAX_RADIX \fP
++.fi
++.nf
++\f3@see <a href="spec\&.html">Java Spec</a> // Java Spec \fP
++.fi
++.nf
++\f3@see "The Java Programming Language" // "The Java Programming Language" \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fINote:\fR You can extend the \f3@se\fR\f3e\fR tag to link to classes not being documented with the \f3-link\fR option\&.
++.TP
++@serial \fIfield-description\fR | include | exclude
++Introduced in JDK 1\&.2
++
++Used in the documentation comment for a default serializable field\&. See Documenting Serializable Fields and Data for a Class at http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial-arch\&.html#5251
++
++See also Oracle\(cqs Criteria for Including Classes in the Serialized Form Specification at http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized-criteria-137781\&.html
++
++An optional \f3field-description\fR should explain the meaning of the field and list the acceptable values\&. When needed, the description can span multiple lines\&. The standard doclet adds this information to the serialized form page\&. See Cross-Reference Pages\&.
++
++If a serializable field was added to a class after the class was made serializable, then a statement should be added to its main description to identify at which version it was added\&.
++
++The \f3include\fR and \f3exclude\fR arguments identify whether a class or package should be included or excluded from the serialized form page\&. They work as follows:
++.RS
++.TP 0.2i
++\(bu
++A public or protected class that implements \f3Serializable\fR is included unless that class (or its package) is marked with the \f3@serial exclude\fR tag\&.
++.TP 0.2i
++\(bu
++A private or package-private class that implements \f3Serializable\fR is excluded unless that class (or its package) is marked with the \f3@serial include\fR tag\&.
++.RE
++
++
++For example, the \f3javax\&.swing\fR package is marked with the \f3@serial\fR\f3exclude\fR tag in package\&.html or package-info\&.java\&. The public class \f3java\&.security\&.BasicPermission\fR is marked with the \f3@serial exclude\fR tag\&. The package-private class \f3java\&.util\&.PropertyPermissionCollection\fR is marked with the \f3@serial include\fR tag\&.
++
++The \f3@serial\fR tag at the class level overrides the \f3@serial\fR tag at the package level\&.
++.TP
++@serialData \fIdata-description\fR
++Introduced in JDK 1\&.2
++
++Uses the data description value to document the types and order of data in the serialized form\&. This data includes the optional data written by the \f3writeObject\fR method and all data (including base classes) written by the \f3Externalizable\&.writeExternal\fR method\&.
++
++The \f3@serialData\fR tag can be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
++.TP
++@serialField \fIfield-name\fR\fIfield-type\fR\fIfield-description\fR
++Introduced in JDK 1\&.2
++
++Documents an \f3ObjectStreamField\fR component of the \f3serialPersistentFields\fR member of a \f3Serializable\fR class\&. Use one \f3@serialField\fR tag for each \f3ObjectStreamField\fR component\&.
++.TP
++@since \fIsince-text\fR
++Introduced in JDK 1\&.1
++
++Adds a \fISince\fR heading with the specified \f3since-text\fR value to the generated documentation\&. The text has no special internal structure\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. This tag means that this change or feature has existed since the software release specified by the \f3since-text\fR value, for example: \f3@since 1\&.5\fR\&.
++
++For Java platform source code, the \f3@since\fR tag indicates the version of the Java platform API specification, which is not necessarily when the source code was added to the reference implementation\&. Multiple \f3@since\fR tags are allowed and are treated like multiple \f3@author\fR tags\&. You could use multiple tags when the program element is used by more than one API\&.
++.TP
++@throws \fIclass-name\fR\fIdescription\fR
++Introduced in JDK 1\&.2
++
++Behaves the same as the \f3@exception\fR tag\&. See @throws in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@exception
++
++The \f3@throws\fR tag adds a \fIThrows\fR subheading to the generated documentation, with the \f3class-name\fR and \f3description\fR text\&. The \fIclass-name\fR is the name of the exception that might be thrown by the method\&. This tag is valid only in the documentation comment for a method or constructor\&. If this class is not fully specified, then the \f3javadoc\fR command uses the search order to look up this class\&. Multiple \f3@throws\fR tags can be used in a specified documentation comment for the same or different exceptions\&. See Search Order for the @see Tag\&.
++
++To ensure that all checked exceptions are documented, when an \f3@throws\fR tag does not exist for an exception in the throws clause, the \f3javadoc\fR command adds that exception to the HTML output (with no description) as though it were documented with the \f3@throws\fR tag\&.
++
++The \f3@throws\fR documentation is copied from an overridden method to a subclass only when the exception is explicitly declared in the overridden method\&. The same is true for copying from an interface method to an implementing method\&. You can use the \f3{@inheritDoc}\fR tag to force the \f3@throws\fR tag to inherit documentation\&.
++.TP
++{@value \fIpackage\&.class#field\fR}
++Introduced in JDK 1\&.4
++
++Displays constant values\&. When the \f3{@value}\fR tag is used without an argument in the documentation comment of a static field, it displays the value of that constant:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * The value of this constant is {@value}\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public static final String SCRIPT_START = "<script>"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When used with the argument \f3package\&.class#field\fR in any documentation comment, he \f3{@value}\fR tag displays the value of the specified constant:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Evaluates the script starting with {@value #SCRIPT_START}\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public String evalScript(String script) {}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The argument \f3package\&.class#field\fR takes a form similar to that of the \f3@see\fR tag argument, except that the member must be a static field\&.
++
++The values of these constants are also displayed in Constant Field Values at http://docs\&.oracle\&.com/javase/8/docs/api/constant-values\&.html
++.TP
++@version \fIversion-text\fR
++Introduced in JDK 1\&.0
++
++Adds a \fIVersion\fR subheading with the specified \f3version-text\fR value to the generated documents when the \f3-version\fR option is used\&. This tag is intended to hold the current release number of the software that this code is part of, as opposed to the\f3@since\fR tag, which holds the release number where this code was introduced\&. The \f3version-text\fR value has no special internal structure\&. See @version in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@version
++
++A documentation comment can contain multiple \f3@version\fR tags\&. When it makes sense, you can specify one release number per \f3@version\fR tag or multiple release numbers per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and a space between the names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line when you want a localized name separator other than a comma\&.
++.SH WHERE\ TAGS\ CAN\ BE\ USED
++The following sections describe where tags can be used\&. Note that the following tags can be used in all documentation comments: \f3@see\fR, \f3@since\fR, \f3@deprecated\fR, \f3{@link}\fR, \f3{@linkplain}\fR, and \f3{@docroot}\fR\&.
++.SS OVERVIEW\ TAGS
++Overview tags are tags that can appear in the documentation comment for the overview page (which resides in the source file typically named overview\&.html)\&. Similar to any other documentation comments, these tags must appear after the main description
++.PP
++\fINote:\fR The \f3{@link}\fR tag has a bug in overview documents in Java SE 1\&.2\&. The text appears correctly but has no link\&. The \f3{@docRoot}\fR tag does not currently work in overview documents\&.
++.PP
++The overview tags are the following:
++.PP
++@see reference || @since since-text || @serialField field-name field-type field-description || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.SS PACKAGE\ TAGS
++Package tags are tags that can appear in the documentation comment for a package, that resides in the source file named package\&.html or package-info\&.java\&. The \f3@serial\fR tag can only be used here with the \f3include\fR or \f3exclude\fR argument\&.
++.PP
++The package tags are the following:
++.PP
++@see reference || @since since-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@linkplain package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.SS CLASS\ AND\ INTERFACE\ TAGS
++The following are tags that can appear in the documentation comment for a class or interface\&. The \f3@serial\fR tag can only be used within the documentation for a class or interface with an \f3include\fR or \f3exclude\fR argument\&.
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.PP
++Class comment example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * A class representing a window on the screen\&.\fP
++.fi
++.nf
++\f3 * For example:\fP
++.fi
++.nf
++\f3 * <pre>\fP
++.fi
++.nf
++\f3 * Window win = new Window(parent);\fP
++.fi
++.nf
++\f3 * win\&.show();\fP
++.fi
++.nf
++\f3 * </pre>\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @author Sami Shaio\fP
++.fi
++.nf
++\f3 * @version 1\&.13, 06/08/06\fP
++.fi
++.nf
++\f3 * @see java\&.awt\&.BaseWindow\fP
++.fi
++.nf
++\f3 * @see java\&.awt\&.Button\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3class Window extends BaseWindow {\fP
++.fi
++.nf
++\f3 \&.\&.\&.\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS FIELD\ TAGS
++These tags can appear in fields:
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @serialField field-name field-type field-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || {@value package\&.class#field}
++.PP
++Field comment example:
++.sp
++.nf
++\f3 /**\fP
++.fi
++.nf
++\f3 * The X\-coordinate of the component\&.\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @see #getLocation()\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3 int x = 1263732;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS CONSTRUCTOR\ AND\ METHOD\ TAGS
++The following tags can appear in the documentation comment for a constructor or a method, except for the \f3@return\fR tag, which cannot appear in a constructor, and the \f3{@inheritDoc}\fR tag, which has restrictions\&.
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @param parameter-name description || @return description || @throws class-name description || @exception class-name description || @serialData data-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@inheritDoc} || {@docRoot}
++.PP
++\fINote:\fR The \f3@serialData\fR tag can only be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
++.PP
++Method comment example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Returns the character at the specified index\&. An index \fP
++.fi
++.nf
++\f3 * ranges from <code>0</code> to <code>length() \- 1</code>\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @param index the index of the desired character\&.\fP
++.fi
++.nf
++\f3 * @return the desired character\&.\fP
++.fi
++.nf
++\f3 * @exception StringIndexOutOfRangeException \fP
++.fi
++.nf
++\f3 * if the index is not in the range <code>0</code> \fP
++.fi
++.nf
++\f3 * to <code>length()\-1</code>\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Character#charValue()\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3 public char charAt(int index) {\fP
++.fi
++.nf
++\f3 \&.\&.\&.\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++The \f3javadoc\fR command uses doclets to determine its output\&. The \f3javadoc\fR command uses the default standard doclet unless a custom doclet is specified with the \f3-doclet\fR option\&. The \f3javadoc\fR command provides a set of command-line options that can be used with any doclet\&. These options are described in Javadoc Options\&. The standard doclet provides an additional set of command-line options that are described in Standard Doclet Options\&. All option names are not case-sensitive, but their arguments are case-sensitive\&.
++.TP 0.2i
++\(bu
++See also Javadoc Options
++.TP 0.2i
++\(bu
++See also Standard Doclet Options
++.PP
++The options are:
++.PP
++-1\&.1 || -author || -bootclasspath classpathlist || -bottom text || -breakiterator || -charset name || -classpath classpathlist || -d directory || -docencoding name || -docfilesubdirs || -doclet class || -docletpath classpathlist || -doctitle title || -encoding || -exclude packagename1:packagename2:\&.\&.\&. || -excludedocfilessubdir name1:name2 || -extdirs dirist || -footer footer || -group groupheading packagepattern:packagepattern || -header header || -help || -helpfile path\efilename || -Jflag || -javafx ||-keywords || -link extdocURL || -linkoffline extdocURL packagelistLoc || -linksource || -locale language_country_variant || -nocomment || -nodeprecated || -nodeprecatedlist || -nohelp || -noindex || -nonavbar || -noqualifier all | packagename1:packagename2\&.\&.\&. || -nosince || -notimestamp || -notree || -overview path/filename || -package || -private || -protected || -public || -quiet || -serialwarn || -source release || -sourcepath sourcepathlist || -sourcetab tablength || -splitindex || -stylesheet path/filename || -subpackages package1:package2:\&.\&.\&. || -tag tagname:Xaoptcmf:"taghead" || -taglet class || -tagletpath tagletpathlist || -title title || -top || -use || -verbose || -version || -windowtitle title
++.PP
++The following options are the core Javadoc options that are available to all doclets\&. The standard doclet provides the rest of the doclets: \f3-bootclasspath\fR, \f3-breakiterator\fR, \f3-classpath\fR, \f3-doclet\fR, \f3-docletpath\fR, \f3-encoding\fR, -\f3exclude\fR, \f3-extdirs\fR, \f3-help\fR, \f3-locale\fR, \f3-\fR\f3overview\fR, \f3-package\fR, \f3-private\fR, \f3-protected\fR, \f3-public\fR, \f3-quiet\fR, \f3-source\fR, \f3-sourcepath\fR, \f3-subpackages\fR, and \f3-verbose\fR\&.
++.SS JAVADOC\ OPTIONS
++.TP
++-overview \fIpath/filename\fR
++.br
++Specifies that the \f3javadoc\fR command should retrieve the text for the overview documentation from the source file specified by the \fIpath/filename\fRand place it on the Overview page (overview-summary\&.html)\&. The \fIpath/filename\fRis relative to the current directory\&.
++
++While you can use any name you want for the \f3filename\fR value and place it anywhere you want for the path, it is typical to name it overview\&.html and place it in the source tree at the directory that contains the topmost package directories\&. In this location, no path is needed when documenting packages, because the \f3-sourcepath\fR option points to this file\&.
++
++For example, if the source tree for the \f3java\&.lang\fR package is /src/classes/java/lang/, then you could place the overview file at /src/classes/overview\&.html
++
++See Real-World Examples\&.
++
++For information about the file specified by \fIpath/filename,\fRsee Overview Comment Files\&.
++
++The overview page is created only when you pass two or more package names to the \f3javadoc\fR command\&. For a further explanation, see HTML Frames\&. The title on the overview page is set by \f3-doctitle\fR\&.
++.TP
++-Xdoclint:(all|none|[-]\fI<group>\fR)
++.br
++Reports warnings for bad references, lack of accessibility and missing Javadoc comments, and reports errors for invalid Javadoc syntax and missing HTML tags\&.
++
++This option enables the \f3javadoc\fR command to check for all documentation comments included in the generated output\&. As always, you can select which items to include in the generated output with the standard options \f3-public\fR, \f3-protected\fR, \f3-package\fR and \f3-private\fR\&.
++
++When the \f3-Xdoclint\fR is enabled, it reports issues with messages similar to the \f3javac\fR command\&. The \f3javadoc\fR command prints a message, a copy of the source line, and a caret pointing at the exact position where the error was detected\&. Messages may be either warnings or errors, depending on their severity and the likelihood to cause an error if the generated documentation were run through a validator\&. For example, bad references or missing Javadoc comments do not cause the \f3javadoc\fR command to generate invalid HTML, so these issues are reported as warnings\&. Syntax errors or missing HTML end tags cause the \f3javadoc\fR command to generate invalid output, so these issues are reported as errors\&.
++
++By default, the \f3-Xdoclint\fR option is enabled\&. Disable it with the option \f3-Xdoclint:none\fR\&.
++
++Change what the \f3-Xdoclint\fR option reports with the following options:
++.RS
++.TP 0.2i
++\(bu
++\f3-Xdoclint none\fR : disable the \f3-Xdoclint\fR option
++.TP 0.2i
++\(bu
++\f3-Xdoclint\fR\fIgroup\fR : enable \fIgroup\fR checks
++.TP 0.2i
++\(bu
++\f3-Xdoclint all\fR : enable all groups of checks
++.TP 0.2i
++\(bu
++\f3-Xdoclint all,\fR\fI-group\fR : enable all except \fIgroup\fR checks
++.RE
++
++
++The variable \fIgroup\fR has one of the following values:
++.RS
++.TP 0.2i
++\(bu
++\f3accessibility\fR : Checks for the issues to be detected by an accessibility checker (for example, no caption or summary attributes specified in a \f3<table>\fR tag)\&.
++.TP 0.2i
++\(bu
++\f3html\fR : Detects high-level HTML issues, like putting block elements inside inline elements, or not closing elements that require an end tag\&. The rules are derived from theHTML 4\&.01 Specification\&. This type of check enables the \f3javadoc\fR command to detect HTML issues that many browsers might accept\&.
++.TP 0.2i
++\(bu
++\f3missing\fR : Checks for missing Javadoc comments or tags (for example, a missing comment or class, or a missing \f3@return\fR tag or similar tag on a method)\&.
++.TP 0.2i
++\(bu
++\f3reference\fR : Checks for issues relating to the references to Java API elements from Javadoc tags (for example, item not found in \f3@see\fR , or a bad name after \f3@param)\fR\&.
++.TP 0.2i
++\(bu
++\f3syntax\fR : Checks for low level issues like unescaped angle brackets (\f3<\fR and \f3>\fR) and ampersands (\f3&\fR) and invalid Javadoc tags\&.
++.RE
++
++
++You can specify the \f3-Xdoclint\fR option multiple times to enable the option to check errors and warnings in multiple categories\&. Alternatively, you can specify multiple error and warning categories by using the preceding options\&. For example, use either of the following commands to check for the HTML, syntax, and accessibility issues in the file \fIfilename\fR\&.
++.sp
++.nf
++\f3javadoc \-Xdoclint:html \-Xdoclint:syntax \-Xdoclint:accessibility \fIfilename\fR\fP
++.fi
++.nf
++\f3javadoc \-Xdoclint:html,syntax,accessibility \fIfilename\fR\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR The \f3javadoc\fR command does not guarantee the completeness of these checks\&. In particular, it is not a full HTML compliance checker\&. The goal of the -\f3Xdoclint\fR option is to enable the \f3javadoc\fR command to report majority of common errors\&.
++
++The \f3javadoc\fR command does not attempt to fix invalid input, it just reports it\&.
++.TP
++-public
++.br
++Shows only public classes and members\&.
++.TP
++-protected
++.br
++Shows only protected and public classes and members\&. This is the default\&.
++.TP
++-package
++.br
++Shows only package, protected, and public classes and members\&.
++.TP
++-private
++.br
++Shows all classes and members\&.
++.TP
++-help
++.br
++Displays the online help, which lists all of the \f3javadoc\fR and \f3doclet\fR command-line options\&.
++.TP
++-doclet \fIclass\fR
++.br
++Specifies the class file that starts the doclet used in generating the documentation\&. Use the fully qualified name\&. This doclet defines the content and formats the output\&. If the \f3-doclet\fR option is not used, then the \f3javadoc\fR command uses the standard doclet for generating the default HTML format\&. This class must contain the \f3start(Root)\fR method\&. The path to this starting class is defined by the \f3-docletpath\fR option\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.TP
++-docletpath \fIclasspathlist\fR
++.br
++Specifies the path to the doclet starting class file (specified with the \f3-doclet\fR option) and any JAR files it depends on\&. If the starting class file is in a JAR file, then this option specifies the path to that JAR file\&. You can specify an absolute path or a path relative to the current directory\&. If \f3classpathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semi-colon (;) on Windows\&. This option is not necessary when the doclet starting class is already in the search path\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.TP
++-1\&.1
++.br
++Removed from Javadoc 1\&.4 with no replacement\&. This option created documentation with the appearance and functionality of documentation generated by Javadoc 1\&.1 (it never supported nested classes)\&. If you need this option, then use Javadoc 1\&.2 or 1\&.3 instead\&.
++.TP
++-source \fIrelease\fR
++.br
++Specifies the release of source code accepted\&. The following values for the \f3release\fR parameter are allowed\&. Use the value of \f3release\fR that corresponds to the value used when you compile code with the \f3javac\fR command\&.
++.RS
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.5\fR\&. The \f3javadoc\fR command accepts code containing generics and other language features introduced in JDK 1\&.5\&. The compiler defaults to the 1\&.5 behavior when the \f3-source\fR option is not used\&.
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.4\fR\&. The \f3javadoc\fR command accepts code containing assertions, which were introduced in JDK 1\&.4\&.
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.3\fR\&. The \f3javadoc\fR command does not support assertions, generics, or other language features introduced after JDK 1\&.3\&.
++.RE
++
++.TP
++-sourcepath \fIsourcepathlist\fR
++.br
++Specifies the search paths for finding source files when passing package names or the \f3-subpackages\fR option into the \f3javadoc\fR command\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Note that this option is not only used to locate the source files being documented, but also to find source files that are not being documented, but whose comments are inherited by the source files being documented\&.
++
++You can use the \f3-sourcepath\fR option only when passing package names into the \f3javadoc\fR command\&. This will not locate source files passed into the \f3javadoc\fR command\&. To locate source files, \f3\fRchange to that directory or include the path ahead of each file, as shown at Document One or More Classes\&. If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses the class path to find the source files (see \f3-classpath\fR)\&. The default \f3-sourcepath\fR is the value of class path\&. If \f3-classpath\fR is omitted and you pass package names into the \f3javadoc\fR command, then the \f3javadoc\fR command searches in the current directory and subdirectories for the source files\&.
++
++Set \f3sourcepathlist\fR to the root directory of the source tree for the package you are documenting\&.
++
++For example, suppose you want to document a package called \f3com\&.mypackage\fR, whose source files are located at:/home/user/src/com/mypackage/*\&.java\&. Specify the sourcepath to /home/user/src, the directory that contains com\emypackage, and then supply the package name, as follows:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/src/ com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Notice that if you concatenate the value of sourcepath and the package name together and change the dot to a slash (/), then you have the full path to the package:
++
++/home/user/src/com/mypackage
++
++To point to two source paths:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user1/src:/home/user2/src com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-classpath \fIclasspathlist\fR
++.br
++Specifies the paths where the \f3javadoc\fR command searches for referenced classes These are the documented classes plus any classes referenced by those classes\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Follow the instructions in the class path documentation for specifying the \f3classpathlist\fR value\&.
++
++If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses \f3-classpath\fR to find the source files and class files (for backward compatibility)\&. If you want to search for source and class files in separate paths, then use both \f3-sourcepath\fR and \f3-classpath\fR\&.
++
++For example, if you want to document \f3com\&.mypackage\fR, whose source files reside in the directory /home/user/src/com/mypackage, and if this package relies on a library in /home/user/lib, then you would use the following command:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/lib \-classpath /home/user/src com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Similar to other tools, if you do not specify \f3-classpath\fR, then the \f3javadoc\fR command uses the \f3CLASSPATH\fR environment variable when it is set\&. If both are not set, then the \f3javadoc\fR command searches for classes from the current directory\&.
++
++For an in-depth description of how the \f3javadoc\fR command uses \f3-classpath\fR to find user classes as it relates to extension classes and bootstrap classes, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++
++A class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
++
++For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JA\fRR, then the class path element \f3foo/*\fR is expanded to a \f3A\&.jar:b\&.JAR\fR, except that the order of JAR files is unspecified\&. All JAR files in the specified directory including hidden files are included in the list\&. A class path entry that consists of * expands to a list of all the jar files in the current directory\&. The \f3CLASSPATH\fR environment variable is similarly expanded\&. Any class path wildcard expansion occurs before the Java Virtual Machine (JVM) starts\&. No Java program ever sees unexpanded wild cards except by querying the environment, for example, by calling System\&.getenv(\f3"CLASSPATH"\fR)\&.
++.TP
++-subpackages \fIpackage1:package2:\&.\&.\&.\fR
++.br
++Generates documentation from source files in the specified packages and recursively in their subpackages\&. This option is useful when adding new subpackages to the source code because they are automatically included\&. Each package argument is any top-level subpackage (such as \f3java\fR) or fully qualified package (such as \f3javax\&.swing\fR) that does not need to contain source files\&. Arguments are separated by colons on all operating systems\&. Wild cards are not allowed\&. Use \f3-sourcepath\fR to specify where to find the packages\&. This option does not process source files that are in the source tree but do not belong to the packages\&. See Process Source Files\&.
++
++For example, the following command generates documentation for packages named \f3java\fR and \f3javax\&.swing\fR and all of their subpackages\&.
++.sp
++.nf
++\f3javadoc \-d docs \-sourcepath /home/user/src \-subpackages java:javax\&.swing \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-exclude \fIpackagename1:packagename2:\&.\&.\&.\fR
++.br
++Unconditionally excludes the specified packages and their subpackages from the list formed by \f3-subpackages\fR\&. It excludes those packages even when they would otherwise be included by some earlier or later \f3-subpackages\fR option\&.
++
++The following example would include \f3java\&.io\fR, \f3java\&.util\fR, and \f3java\&.math\fR (among others), but would exclude packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice that this example excludes \f3java\&.lang\&.ref\fR, which is a subpackage of \f3java\&.lang\fR\&.
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/src \-subpackages java \-exclude \fP
++.fi
++.nf
++\f3 java\&.net:java\&.lang\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-bootclasspath \fIclasspathlist\fR
++.br
++Specifies the paths where the boot classes reside\&. These are typically the Java platform classes\&. The \f3bootclasspath\fR is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. For more information, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++
++Separate directories in the \f3classpathlist\fR parameters with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
++.TP
++-extdirs \fIdirist\fR
++.br
++Specifies the directories where extension classes reside\&. These are any classes that use the Java Extension mechanism\&. The \f3extdirs\fR option is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. See the \f3-classpath\fR option for more information\&. Separate directories in \f3dirlist\fR with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
++.TP
++-verbose
++.br
++Provides more detailed messages while the \f3javadoc\fR command runs\&. Without the \f3verbose\fR option, messages appear for loading the source files, generating the documentation (one message per source file), and sorting\&. The verbose option causes the printing of additional messages that specify the number of milliseconds to parse each Java source file\&.
++.TP
++-quiet
++.br
++Shuts off messages so that only the warnings and errors appear to make them easier to view\&. It also suppresses the \f3version\fR string\&.
++.TP
++-breakiterator
++.br
++Uses the internationalized sentence boundary of \f3java\&.text\&.BreakIterator\fR to determine the end of the first sentence in the main description of a package, class, or member for English\&. All other locales already use the \f3BreakIterator\fR class, rather than an English language, locale-specific algorithm\&. The first sentence is copied to the package, class, or member summary and to the alphabetic index\&. From JDK 1\&.2 and later, the \f3BreakIterator\fR class is used to determine the end of a sentence for all languages except for English\&. Therefore, the \f3-breakiterator\fR option has no effect except for English from 1\&.2 and later\&. English has its own default algorithm:
++.RS
++.TP 0.2i
++\(bu
++English default sentence-break algorithm\&. Stops at a period followed by a space or an HTML block tag, such as \f3<P>\fR\&.
++.TP 0.2i
++\(bu
++Breakiterator sentence-break algorithm\&. Stops at a period, question mark, or exclamation point followed by a space when the next word starts with a capital letter\&. This is meant to handle most abbreviations (such as "The serial no\&. is valid", but will not handle "Mr\&. Smith")\&. The \f3-breakiterator\fR option does not stop at HTML tags or sentences that begin with numbers or symbols\&. The algorithm stops at the last period in \&.\&./filename, even when embedded in an HTML tag\&.
++.RE
++
++
++In Java SE 1\&.5 the \f3-breakiterator\fR option warning messages are removed, and the default sentence-break algorithm is unchanged\&. If you have not modified your source code to eliminate the \f3-breakiterator\fR option warnings in Java SE 1\&.4\&.x, then you do not have to do anything\&. The warnings go away starting with Java SE 1\&.5\&.0\&.
++.TP
++-locale \fIlanguage_country_variant\fR
++.br
++Specifies the locale that the \f3javadoc\fR command uses when it generates documentation\&. The argument is the name of the locale, as described in \f3j\fR\f3ava\&.util\&.Locale\fR documentation, such as \f3en_US\fR (English, United States) or \f3en_US_WIN\fR (Windows variant)\&.
++
++\fINote:\fR The \f3-locale\fR option must be placed ahead (to the left) of any options provided by the standard doclet or any other doclet\&. Otherwise, the navigation bars appear in English\&. This is the only command-line option that depends on order\&. See Standard Doclet Options\&.
++
++Specifying a locale causes the \f3javadoc\fR command to choose the resource files of that locale for messages such as strings in the navigation bar, headings for lists and tables, help file contents, comments in the stylesheet\&.css file, and so on\&. It also specifies the sorting order for lists sorted alphabetically, and the sentence separator to determine the end of the first sentence\&. The \f3-locale\fR option does not determine the locale of the documentation comment text specified in the source files of the documented classes\&.
++.TP
++-encoding
++.br
++Specifies the encoding name of the source files, such as \f3EUCJIS/SJIS\fR\&. If this option is not specified, then the platform default converter is used\&. See also the\f3-docencoding name\fR and \f3-charset name\fR options\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR directly to the Java Runtime Environment (JRE) that runs the \f3javadoc\fR command\&. For example, if you must ensure that the system sets aside 32 MB of memory in which to process the generated documentation, then you would call the \f3-Xmx\fR option as follows: \f3javadoc -J-Xmx32m -J-Xms32m com\&.mypackage\fR\&. Be aware that \f3-Xms\fR is optional because it only sets the size of initial memory, which is useful when you know the minimum amount of memory required\&.
++
++There is no space between the \f3J\fR and the \f3flag\fR\&.
++
++Use the \f3-version\fR option to find out what version of the \f3javadoc\fR command you are using\&. The version number of the standard doclet appears in its output stream\&. See Running the Javadoc Command\&.
++.sp
++.nf
++\f3javadoc \-J\-version\fP
++.fi
++.nf
++\f3java version "1\&.7\&.0_09"\fP
++.fi
++.nf
++\f3Java(TM) SE Runtime Environment (build 1\&.7\&.0_09\-b05)\fP
++.fi
++.nf
++\f3Java HotSpot(TM) 64\-Bit Server VM (build 23\&.5\-b02, mixed mode)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-javafx
++.br
++Generates HTML documentation using the JavaFX extensions to the standard doclet\&. The generated documentation includes a Property Summary section in addition to the other summary sections generated by the standard Java doclet\&. The listed properties are linked to the sections for the getter and setter methods of each property\&.
++
++If there are no documentation comments written explicitly for getter and setter methods, the documentation comments from the property method are automatically copied to the generated documentation for these methods\&. This option also adds a new \f3@defaultValue\fR tag that allows documenting the default value for a property\&.
++
++Example:
++.sp
++.nf
++\f3javadoc \-javafx MyClass\&.java \-d testdir\fP
++.fi
++.sp
++
++.SS STANDARD\ DOCLET\ OPTIONS
++.TP
++-d \fIdirectory\fR
++.br
++Specifies the destination directory where the \f3javadoc\fR command saves the generated HTML files\&. If you omit the \f3-d\fR option, then the files are saved to the current directory\&. The \f3directory\fR value can be absolute or relative to the current working directory\&. As of Java SE 1\&.4, the destination directory is automatically created when the \f3javadoc\fR command runs\&.
++
++For example, the following command generates the documentation for the package \f3com\&.mypackage\fR and saves the results in the /user/doc/ directory: \f3javadoc -d\fR\f3/user/doc/\fR\f3com\&.mypackage\fR\&.
++.TP
++-use
++.br
++Includes one Use page for each documented class and package\&. The page describes what packages, classes, methods, constructors and fields use any API of the specified class or package\&. Given class C, things that use class C would include subclasses of C, fields declared as C, methods that return C, and methods and constructors with parameters of type C\&. For example, you can look at the Use page for the \f3String\fR type\&. Because the \f3getName\fR method in the \f3java\&.awt\&.Font\fR class returns type \f3String\fR, the \f3getName\fR method uses \f3String\fR and so the \f3getName\fR method appears on the Use page for \f3String\fR\&.This documents only uses of the API, not the implementation\&. When a method uses \f3String\fR in its implementation, but does not take a string as an argument or return a string, that is not considered a use of \f3String\fR\&.To access the generated Use page, go to the class or package and click the \fIUse link\fR in the navigation bar\&.
++.TP
++-version
++.br
++Includes the @version text in the generated docs\&. This text is omitted by default\&. To find out what version of the \f3javadoc\fR command you are using, use the \f3-J-version\fR option\&.
++.TP
++-author
++.br
++Includes the \f3@author\fR text in the generated docs\&.
++.TP
++-splitindex
++.br
++Splits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical symbols\&.
++.TP
++-windowtitle \fItitle\fR
++.br
++Specifies the title to be placed in the HTML \f3<title>\fR tag\&. The text specified in the \f3title\fR tag appears in the window title and in any browser bookmarks (favorite places) that someone creates for this page\&. This title should not contain any HTML tags because the browser does not interpret them correctly\&. Use escape characters on any internal quotation marks within the \f3title\fR tag\&. If the \f3-windowtitle\fR option is omitted, then the \f3javadoc\fR command uses the value of the \f3-doctitle\fR option for the \f3-windowtitle\fR option\&. For example, \f3javadoc -windowtitle "Java SE Platform" com\&.mypackage\fR\&.
++.TP
++-doctitle \fItitle\fR
++.br
++Specifies the title to place near the top of the overview summary file\&. The text specified in the \f3title\fR tag is placed as a centered, level-one heading directly beneath the top navigation bar\&. The \f3title\fR tag can contain HTML tags and white space, but when it does, you must enclose the title in quotation marks\&. Internal quotation marks within the \f3title\fR tag must be escaped\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
++.TP
++-title \fItitle\fR
++.br
++No longer exists\&. It existed only in Beta releases of Javadoc 1\&.2\&. It was renamed to \f3-doctitle\fR\&. This option was renamed to make it clear that it defines the document title, rather than the window title\&.
++.TP
++-header \fIheader\fR
++.br
++Specifies the header text to be placed at the top of each output file\&. The header is placed to the right of the upper navigation bar\&. The \f3header\fR can contain HTML tags and white space, but when it does, the \f3header\fR must be enclosed in quotation marks\&. Use escape characters for internal quotation marks within a header\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
++.TP
++-footer \fIfooter\fR
++.br
++Specifies the footer text to be placed at the bottom of each output file\&. The \fIfooter\fR value is placed to the right of the lower navigation bar\&. The \f3footer\fR value can contain HTML tags and white space, but when it does, the \f3footer\fR value must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within a footer\&.
++.TP
++-top
++.br
++Specifies the text to be placed at the top of each output file\&.
++.TP
++-bottom \fItext\fR
++.br
++Specifies the text to be placed at the bottom of each output file\&. The text is placed at the bottom of the page, underneath the lower navigation bar\&. The text can contain HTML tags and white space, but when it does, the text must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within text\&.
++.TP
++-link \fIextdocURL\fR
++.br
++Creates links to existing Javadoc-generated documentation of externally referenced classes\&. The \fIextdocURL\fR argument is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. You can specify multiple \f3-link\fR options in a specified \f3javadoc\fR command run to link to multiple documents\&.
++
++The package-list file must be found in this directory (otherwise, use the \f3-linkoffline\fR option)\&. The \f3javadoc\fR command reads the package names from the package-list file and links to those packages at that URL\&. When the \f3javadoc\fR command runs, the \f3extdocURL\fR value is copied into the \f3<A HREF>\fR links that are created\&. Therefore, \f3extdocURL\fR must be the URL to the directory, and not to a file\&. You can use an absolute link for \fIextdocURL\fR to enable your documents to link to a document on any web site, or you can use a relative link to link only to a relative location\&. If you use a relative link, then the value you pass in should be the relative path from the destination directory (specified with the \f3-d\fR option) to the directory containing the packages being linked to\&.When you specify an absolute link, you usually use an HTTP link\&. However, if you want to link to a file system that has no web server, then you can use a file link\&. Use a file link only when everyone who wants to access the generated documentation shares the same file system\&.In all cases, and on all operating systems, use a slash as the separator, whether the URL is absolute or relative, and \f3h\fR\f3ttp:\fR or \f3f\fR\f3ile:\fR as specified in the URL Memo: Uniform Resource Locators at http://www\&.ietf\&.org/rfc/rfc1738\&.txt
++.sp
++.nf
++\f3\-link http://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\-link file://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\-link <directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Differences between the -linkoffline and -link options
++
++Use the \f3-link\fR option in the following cases:
++.TP 0.2i
++\(bu
++When you use a relative path to the external API document\&.
++.TP 0.2i
++\(bu
++When you use an absolute URL to the external API document if your shell lets you open a connection to that URL for reading\&.
++.PP
++Use the \f3-linkoffline\fR option when you use an absolute URL to the external API document, if your shell does not allow a program to open a connection to that URL for reading\&. This can occur when you are behind a firewall and the document you want to link to is on the other side\&.
++.PP
++\f3Example 1 Absolute Link to External Documents\fR
++.PP
++Use the following command if you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java platform packages, shown at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
++.sp
++.nf
++\f3javadoc \-link http://docs\&.oracle\&.com/javase/8/docs/api/ com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The command generates documentation for the package \f3com\&.mypackage\fR with links to the Java SE packages\&. The generated documentation contains links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other options, such as the \f3-sourcepath\fR and \f3-d\fR options, are not shown\&.
++.PP
++\f3Example 2 Relative Link to External Documents\fR
++.PP
++In this example, there are two packages with documents that are generated in different runs of the \f3javadoc\fR command, and those documents are separated by a relative path\&. The packages are \f3com\&.apipackage\fR, an API, and c\f3om\&.spipackage\fR, an Service Provide Interface (SPI)\&. You want the documentation to reside in docs/api/com/apipackage and docs/spi/com/spipackage\&. Assuming that the API package documentation is already generated, and that docs is the current directory, you document the SPI package with links to the API documentation by running: \f3javadoc -d \&./spi -link \&.\&./api com\&.spipackage\fR\&.
++.PP
++Notice the \f3-link\fR option is relative to the destination directory (docs/spi)\&.
++.PP
++Notes
++
++The \f3-link\fR option lets you link to classes referenced to by your code, but not documented in the current \f3javadoc\fR command run\&. For these links to go to valid pages, you must know where those HTML pages are located and specify that location with \f3extdocURL\fR\&. This allows third-party documentation to link to java\&.* documentation at http://docs\&.oracle\&.com\&.Omit the \f3-link\fR option when you want the \f3javadoc\fR command to create links only to APIs within the documentation it is generating in the current run\&. Without the \f3-link\fR option, the \f3javadoc\fR command does not create links to documentation for external references because it does not know whether or where that documentation exists\&.The \f3-link\fR option can create links in several places in the generated documentation\&. See Process Source Files\&. Another use is for cross-links between sets of packages: Execute the \f3javadoc\fR command on one set of packages, then run the \f3javadoc\fR command again on another set of packages, creating links both ways between both sets\&.
++.PP
++How to Reference a Class
++
++For a link to an externally referenced class to appear (and not just its text label), the class must be referenced in the following way\&. It is not sufficient for it to be referenced in the body of a method\&. It must be referenced in either an \f3import\fR statement or in a declaration\&. Here are examples of how the class \f3java\&.io\&.File\fR can be referenced:
++.PP
++\fI\fRIn any kind of import statement\&. By wildcard import, import explicitly by name, or automatically import for \f3java\&.lang\&.*\fR\&.
++.PP
++In Java SE 1\&.3\&.\fIn\fR and 1\&.2\&.\fIn\fR, only an explicit import by name works\&. A wildcard \f3import\fR statement does not work, nor does the automatic \f3import java\&.lang\&.*\fR\&.
++.PP
++\fI\fRIn a declaration: \f3void mymethod(File f) {}\fR
++.PP
++The reference can be in the return type or parameter type of a method, constructor, field, class, or interface, or in an implements, extends, or throws statement\&.
++.PP
++An important corollary is that when you use the \f3-link\fR option, there can be many links that unintentionally do not appear due to this constraint\&. The text would appear without being a link\&. You can detect these by the warnings they emit\&. The simplest way to properly reference a class and add the link would be to import that class\&.
++.PP
++Package List
++
++The \f3-link\fR option requires that a file named package-list, which is generated by the \f3javadoc\fR command, exists at the URL you specify with the \f3-link\fR option\&. The package-list file is a simple text file that lists the names of packages documented at that location\&. In the earlier example, the \f3javadoc\fR command searches for a file named package-list at the specified URL, reads in the package names, and links to those packages at that URL\&.
++.PP
++For example, the package list for the Java SE API is located at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
++.PP
++The package list starts as follows:
++.sp
++.nf
++\f3java\&.applet\fP
++.fi
++.nf
++\f3java\&.awt\fP
++.fi
++.nf
++\f3java\&.awt\&.color\fP
++.fi
++.nf
++\f3java\&.awt\&.datatransfer\fP
++.fi
++.nf
++\f3java\&.awt\&.dnd\fP
++.fi
++.nf
++\f3java\&.awt\&.event\fP
++.fi
++.nf
++\f3java\&.awt\&.font\fP
++.fi
++.nf
++\f3and so on \&.\&.\&.\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When \f3javadoc\fR is run without the \f3-link\fR option and encounters a name that belongs to an externally referenced class, it prints the name with no link\&. However, when the \f3-link\fR option is used, the \f3javadoc\fR command searches the package-list file at the specified \fIextdocURL\fR location for that package name\&. When it finds the package name, it prefixes the name with \fIextdocURL\fR\&.
++.PP
++For there to be no broken links, all of the documentation for the external references must exist at the specified URLs\&. The \f3javadoc\fR command does not check that these pages exist, but only that the package-list exists\&.
++.PP
++Multiple Links
++
++You can supply multiple \f3-link\fR options to link to any number of externally generated documents\&. Javadoc 1\&.2 has a known bug that prevents you from supplying more than one \f3-link\fR options\&. This was fixed in Javadoc 1\&.2\&.2\&. Specify a different link option for each external document to link to \f3javadoc -link extdocURL1 -link extdocURL2 \&.\&.\&. -link extdocURLn com\&.mypackage\fR where \fIextdocURL1\fR, \fIextdocURL2\fR, \&.\f3\&.\&. extdocURLn\fR point respectively to the roots of external documents, each of which contains a file named package-list\&.
++.PP
++Cross Links
++
++Note that bootstrapping might be required when cross-linking two or more documents that were previously generated\&. If package-list does not exist for either document when you run the \f3javadoc\fR command on the first document, then the package-list does not yet exist for the second document\&. Therefore, to create the external links, you must regenerate the first document after you generate the second document\&.
++.PP
++In this case, the purpose of first generating a document is to create its package-list (or you can create it by hand if you are certain of the package names)\&. Then, generate the second document with its external links\&. The \f3javadoc\fR command prints a warning when a needed external package-list file does not exist\&.
++.TP
++-linkoffline \fIextdocURL packagelistLoc\fR
++.br
++This option is a variation of the \f3-link\fR option\&. They both create links to Javadoc-generated documentation for externally referenced classes\&. Use the \f3-link\fRo\f3ffline\fR option when linking to a document on the web when the \f3javadoc\fR command cannot access the document through a web connection\&. Use the \f3-linkoffline\fR option when package-list file of the external document is not accessible or does not exist at the \f3extdocURL\fR location, but does exist at a different location that can be specified by \f3packageListLoc\fR (typically local)\&. If \f3extdocURL\fR is accessible only on the World Wide Web, then the \f3-linkoffline\fR option removes the constraint that the \f3javadoc\fR command must have a web connection to generate documentation\&. Another use is as a work-around to update documents: After you have run the \f3javadoc\fR command on a full set of packages, you can run the \f3javadoc\fR command again on a smaller set of changed packages, so that the updated files can be inserted back into the original set\&. Examples follow\&. The \f3-linkoffline\fR option takes two arguments\&. The first is for the string to be embedded in the \f3<a href>\fR links, and the second tells the \f3-linkoffline\fR option where to find package-list:
++.RS
++.TP 0.2i
++\(bu
++The \f3extdocURL\fR value is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. When relative, the value should be the relative path from the destination directory (specified with the \f3-d\fR option) to the root of the packages being linked to\&. For more information, see \fIextdocURL\fR in the \f3-link\fR option\&.
++.TP 0.2i
++\(bu
++The \f3packagelistLoc\fR value is the path or URL to the directory that contains the package-list file for the external documentation\&. This can be a URL (http: or file:) or file path, and can be absolute or relative\&. When relative, make it relative to the current directory from where the \f3javadoc\fR command was run\&. Do not include the package-list file name\&.
++
++You can specify multiple \f3-linkoffline\fR options in a specified \f3javadoc\fR command run\&. Before Javadoc 1\&.2\&.2, the \f3-linkfile\fR options could be specified once\&.
++.RE
++
++.PP
++Absolute Links to External Documents
++
++You might have a situation where you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java SE packages at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
++.PP
++However, your shell does not have web access\&. In this case, do the following:
++.TP 0.4i
++1\&.
++Open the package-list file in a browser at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
++.TP 0.4i
++2\&.
++Save the file to a local directory, and point to this local copy with the second argument, \f3packagelistLoc\fR\&. In this example, the package list file was saved to the current directory (\&.)\&.
++.PP
++The following command generates documentation for the package c\f3om\&.mypackage\fR with links to the Java SE packages\&. The generated documentation will contain links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other necessary options, such as \f3-sourcepath\fR, are not shown\&.
++.sp
++.nf
++\f3javadoc \-linkoffline http://docs\&.oracle\&.com/javase/8/docs/api/ \&. com\&.mypackage \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Relative Links to External Documents
++
++It is not very common to use \f3-linkoffline\fR with relative paths, for the simple reason that the \f3-link\fR option is usually enough\&. When you use the \f3-linkoffline\fR option, the package-list file is usually local, and when you use relative links, the file you are linking to is also local, so it is usually unnecessary to give a different path for the two arguments to the \f3-linkoffline\fR option When the two arguments are identical, you can use the \f3-link\fR option\&.
++.PP
++Create a package-list File Manually
++
++If a package-list file does not exist yet, but you know what package names your document will link to, then you can manually create your own copy of this file and specify its path with \f3packagelistLoc\fR\&. An example would be the previous case where the package list for \f3com\&.spipackage\fR did not exist when \f3com\&.apipackage\fR was first generated\&. This technique is useful when you need to generate documentation that links to new external documentation whose package names you know, but which is not yet published\&. This is also a way of creating package-list files for packages generated with Javadoc 1\&.0 or 1\&.1, where package-list files were not generated\&. Similarly, two companies can share their unpublished package-list files so they can release their cross-linked documentation simultaneously\&.
++.PP
++Link to Multiple Documents
++
++You can include the \f3-linkoffline\fR option once for each generated document you want to refer to:
++.sp
++.nf
++\f3javadoc \-linkoffline extdocURL1 packagelistLoc1 \-linkoffline extdocURL2\fP
++.fi
++.nf
++\f3packagelistLoc2 \&.\&.\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Update Documents
++
++You can also use the \f3-linkoffline\fR option when your project has dozens or hundreds of packages\&. If you have already run the \f3javadoc\fR command on the entire source tree, then you can quickly make small changes to documentation comments and rerun the \f3javadoc\fR command on a portion of the source tree\&. Be aware that the second run works properly only when your changes are to documentation comments and not to declarations\&. If you were to add, remove, or change any declarations from the source code, then broken links could show up in the index, package tree, inherited member lists, Use page, and other places\&.
++.PP
++First, create a new destination directory, such as update, for this new small run\&. In this example, the original destination directory is named html\&. In the simplest example, change directory to the parent of html\&. Set the first argument of the \f3-linkoffline\fR option to the current directory (\&.) and set the second argument to the relative path to html, where it can find package-list and pass in only the package names of the packages you want to update:
++.sp
++.nf
++\f3javadoc \-d update \-linkoffline \&. html com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When the \f3javadoc\fR command completes, copy these generated class pages in update/com/package (not the overview or index) to the original files in html/com/package\&.
++.TP
++-linksource
++.br
++Creates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation\&. Links are created for classes, interfaces, constructors, methods, and fields whose declarations are in a source file\&. Otherwise, links are not created, such as for default constructors and generated classes\&.
++
++This option exposes all private implementation details in the included source files, including private classes, private fields, and the bodies of private methods, regardless of the \f3-public\fR, \f3-package\fR, \f3-protected\fR, and \f3-private\fR options\&. Unless you also use the \f3-private\fR option, not all private classes or interfaces are accessible through links\&.
++
++Each link appears on the name of the identifier in its declaration\&. For example, the link to the source code of the \f3Button\fR class would be on the word \f3Button\fR:
++.sp
++.nf
++\f3public class Button extends Component implements Accessible\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The link to the source code of the \f3getLabel\fR method in the \f3Button\fR class is on the word \f3getLabel\fR:
++.sp
++.nf
++\f3public String getLabel()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-group groupheading \fIpackagepattern:packagepattern\fR
++.br
++Separates packages on the overview page into whatever groups you specify, one group per table\&. You specify each group with a different \f3-group\fR option\&. The groups appear on the page in the order specified on the command line\&. Packages are alphabetized within a group\&. For a specified \f3-group\fR option, the packages matching the list of \f3packagepattern\fR expressions appear in a table with the heading \fIgroupheading\fR\&.
++.RS
++.TP 0.2i
++\(bu
++The \f3groupheading\fR can be any text and can include white space\&. This text is placed in the table heading for the group\&.
++.TP 0.2i
++\(bu
++The \f3packagepattern\fR value can be any package name at the start of any package name followed by an asterisk (*)\&. The asterisk is the only wildcard allowed and means match any characters\&. Multiple patterns can be included in a group by separating them with colons (:)\&. If you use an asterisk in a pattern or pattern list, then the pattern list must be inside quotation marks, such as \f3"java\&.lang*:java\&.util"\fR\&.
++.RE
++
++
++When you do not supply a \f3-group\fR option, all packages are placed in one group with the heading \fIPackages\fR and appropriate subheadings\&. If the subheadings do not include all documented packages (all groups), then the remaining packages appear in a separate group with the subheading Other Packages\&.
++
++For example, the following \f3javadoc\fR command separates the three documented packages into \fICore\fR, \fIExtension\fR, and \fIOther Packages\fR\&. The trailing dot (\&.) does not appear in \f3java\&.lang*\fR\&. Including the dot, such as \f3java\&.lang\&.*\fR omits the\f3java\&.lang\fR package\&.
++.sp
++.nf
++\f3javadoc \-group "Core Packages" "java\&.lang*:java\&.util"\fP
++.fi
++.nf
++\f3 \-group "Extension Packages" "javax\&.*"\fP
++.fi
++.nf
++\f3 java\&.lang java\&.lang\&.reflect java\&.util javax\&.servlet java\&.new\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fICore Packages\fR
++
++\f3java\&.lang\fR
++
++\f3java\&.lang\&.reflect\fR
++
++\f3java\&.util\fR
++
++\fIExtension Packages\fR
++
++\f3javax\&.servlet\fR
++
++\fIOther Packages\fR
++
++\f3java\&.new\fR
++.TP
++-nodeprecated
++.br
++Prevents the generation of any deprecated API in the documentation\&. This does what the \f3-nodeprecatedlist\fR option does, and it does not generate any deprecated API throughout the rest of the documentation\&. This is useful when writing code when you do not want to be distracted by the deprecated code\&.
++.TP
++-nodeprecatedlist
++.br
++Prevents the generation of the file that contains the list of deprecated APIs (deprecated-list\&.html) and the link in the navigation bar to that page\&. The \f3javadoc\fR command continues to generate the deprecated API throughout the rest of the document\&. This is useful when your source code contains no deprecated APIs, and you want to make the navigation bar cleaner\&.
++.TP
++-nosince
++.br
++Omits from the generated documents the \f3Since\fR sections associated with the \f3@since\fR tags\&.
++.TP
++-notree
++.br
++Omits the class/interface hierarchy pages from the generated documents\&. These are the pages you reach using the Tree button in the navigation bar\&. The hierarchy is produced by default\&.
++.TP
++-noindex
++.br
++Omits the index from the generated documents\&. The index is produced by default\&.
++.TP
++-nohelp
++.br
++Omits the HELP link in the navigation bars at the top and bottom of each page of output\&.
++.TP
++-nonavbar
++.br
++Prevents the generation of the navigation bar, header, and footer, that are usually found at the top and bottom of the generated pages\&. The \f3-nonavbar\fR option has no affect on the \f3-bottom\fR option\&. The \f3-nonavbar\fR option is useful when you are interested only in the content and have no need for navigation, such as when you are converting the files to PostScript or PDF for printing only\&.
++.TP
++-helpfile \fIpath\efilename\fR
++.br
++Specifies the path of an alternate help file path\efilename that the HELP link in the top and bottom navigation bars link to\&. Without this option, the \f3javadoc\fR command creates a help file help-doc\&.html that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to help-doc\&.html\&. The \f3javadoc\fR command adjusts the links in the navigation bar accordingly, for example:
++.sp
++.nf
++\f3javadoc \-helpfile /home/user/myhelp\&.html java\&.awt\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-stylesheet \fIpath/filename\fR
++.br
++Specifies the path of an alternate HTML stylesheet file\&. Without this option, the \f3javadoc\fR command automatically creates a stylesheet file stylesheet\&.css that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to stylesheet\&.css, for example:
++.sp
++.nf
++\f3javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-serialwarn
++.br
++Generates compile-time warnings for missing \f3@serial\fR tags\&. By default, Javadoc 1\&.2\&.2 and later versions generate no serial warnings\&. This is a reversal from earlier releases\&. Use this option to display the serial warnings, which helps to properly document default serializable fields and \f3writeExternal\fR methods\&.
++.TP
++-charset \fIname\fR
++.br
++Specifies the HTML character set for this document\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
++
++For example, \f3javadoc -charset "iso-8859-1" mypackage\fR inserts the following line in the head of every generated page:
++.sp
++.nf
++\f3<META http\-equiv="Content\-Type" content="text/html; charset=ISO\-8859\-1">\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This \f3META\fR tag is described in the HTML standard (4197265 and 4137321), HTML Document Representation, at http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
++
++See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
++.TP
++-docencoding \fIname\fR
++.br
++Specifies the encoding of the generated HTML files\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
++
++If you omit the \f3-docencoding\fR option but use the \f3-encoding\fR option, then the encoding of the generated HTML files is determined by the \f3-encoding\fR option, for example: \f3javadoc -docencoding "iso-8859-1" mypackage\fR\&. See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
++.TP
++-keywords
++.br
++Adds HTML keyword <META> tags to the generated file for each class\&. These tags can help search engines that look for <META> tags find the pages\&. Most search engines that search the entire Internet do not look at <META> tags, because pages can misuse them\&. Search engines offered by companies that confine their searches to their own website can benefit by looking at <META> tags\&. The <META> tags include the fully qualified name of the class and the unqualified names of the fields and methods\&. Constructors are not included because they are identical to the class name\&. For example, the class \f3String\fR starts with these keywords:
++.sp
++.nf
++\f3<META NAME="keywords" CONTENT="java\&.lang\&.String class">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="CASE_INSENSITIVE_ORDER">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="length()">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="charAt()">\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-tag \fItagname\fR:Xaoptcmf:"\fItaghead\fR"
++.br
++Enables the \f3javadoc\fR command to interpret a simple, one-argument \f3@tagname\fR custom block tag in documentation comments\&. For the \f3javadoc\fR command to spell-check tag names, it is important to include a \f3-tag\fR option for every custom tag that is present in the source code, disabling (with \f3X\fR) those that are not being output in the current run\&.The colon (:) is always the separator\&. The \f3-tag\fR option outputs the tag heading \fItaghead\fR in bold, followed on the next line by the text from its single argument\&. Similar to any block tag, the argument text can contain inline tags, which are also interpreted\&. The output is similar to standard one-argument tags, such as the \f3@return\fR and \f3@author\fR tags\&. Omitting a value for \fItaghead\fR causes \f3tagname\fR to be the heading\&.
++
++\fIPlacement of tags\fR: The \f3Xaoptcmf\fR arguments determine where in the source code the tag is allowed to be placed, and whether the tag can be disabled (using \f3X\fR)\&. You can supply either \f3a\fR, to allow the tag in all places, or any combination of the other letters:
++
++\f3X\fR (disable tag)
++
++\f3a\fR (all)
++
++\f3o\fR (overview)
++
++\f3p\fR (packages)
++
++\f3t\fR (types, that is classes and interfaces)
++
++\f3c\fR (constructors)
++
++\f3m\fR (methods)
++
++\f3f\fR (fields)
++
++\fIExamples of single tags\fR: An example of a tag option for a tag that can be used anywhere in the source code is: \f3-tag todo:a:"To Do:"\fR\&.
++
++If you want the \f3@todo\fR tag to be used only with constructors, methods, and fields, then you use: \f3-tag todo:cmf:"To Do:"\fR\&.
++
++Notice the last colon (:) is not a parameter separator, but is part of the heading text\&. You would use either tag option for source code that contains the \f3@todo\fR tag, such as: \f3@todo The documentation for this method needs work\fR\&.
++
++\fIColons in tag names\fR: Use a backslash to escape a colon that you want to use in a tag name\&. Use the \f3-tag ejb\e\e:bean:a:"EJB Bean:"\fR option for the following documentation comment:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @ejb:bean\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fISpell-checking tag names\fR: Some developers put custom tags in the source code that they do not always want to output\&. In these cases, it is important to list all tags that are in the source code, enabling the ones you want to output and disabling the ones you do not want to output\&. The presence of \f3X\fR disables the tag, while its absence enables the tag\&. This gives the \f3javadoc\fR command enough information to know whether a tag it encounters is unknown, which is probably the results of a typographical error or a misspelling\&. The \f3javadoc\fR command prints a warning in these cases\&. You can add \f3X\fR to the placement values already present, so that when you want to enable the tag, you can simply delete the \f3X\fR\&. For example, if the \f3@todo\fR tag is a tag that you want to suppress on output, then you would use: \f3-tag todo:Xcmf:"To Do:"\fR\&. If you would rather keep it simple, then use this: \f3-tag todo:X\fR\&. The syntax \f3-tag todo:X\fR works even when the \f3@todo\fR tag is defined by a taglet\&.
++
++\fIOrder of tags\fR: The order of the \f3-ta\fR\f3g\fR and \f3-taglet\fR options determines the order the tags are output\&. You can mix the custom tags with the standard tags to intersperse them\&. The tag options for standard tags are placeholders only for determining the order\&. They take only the standard tag\&'s name\&. Subheadings for standard tags cannot be altered\&. This is illustrated in the following example\&.If the \f3-tag\fR option is missing, then the position of the \f3-tagle\fR\f3t\fR option determines its order\&. If they are both present, then whichever appears last on the command line determines its order\&. This happens because the tags and taglets are processed in the order that they appear on the command line\&. For example, if the \f3-taglet\fR and \f3-tag\fR options have the name \f3todo\fR value, then the one that appears last on the command line determines the order\&.
++
++\fIExample of a complete set of tags\fR: This example inserts To Do after Parameters and before Throws in the output\&. By using \f3X\fR, it also specifies that the \f3@example\fR tag might be encountered in the source code that should not be output during this run\&. If you use the \f3@argfile\fR tag, then you can put the tags on separate lines in an argument file similar to this (no line continuation characters needed):
++.sp
++.nf
++\f3\-tag param\fP
++.fi
++.nf
++\f3\-tag return\fP
++.fi
++.nf
++\f3\-tag todo:a:"To Do:"\fP
++.fi
++.nf
++\f3\-tag throws\fP
++.fi
++.nf
++\f3\-tag see\fP
++.fi
++.nf
++\f3\-tag example:X\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the \f3javadoc\fR command parses the documentation comments, any tag encountered that is neither a standard tag nor passed in with the \f3-tag\fR or \f3-taglet\fR options is considered unknown, and a warning is thrown\&.
++
++The standard tags are initially stored internally in a list in their default order\&. Whenever the \f3-tag\fR options are used, those tags get appended to this list\&. Standard tags are moved from their default position\&. Therefore, if a \f3-tag\fR option is omitted for a standard tag, then it remains in its default position\&.
++
++\fIAvoiding conflicts\fR: If you want to create your own namespace, then you can use a dot-separated naming convention similar to that used for packages: \f3com\&.mycompany\&.todo\fR\&. Oracle will continue to create standard tags whose names do not contain dots\&. Any tag you create will override the behavior of a tag by the same name defined by Oracle\&. If you create a \f3@todo\fR tag or taglet, then it always has the same behavior you define, even when Oracle later creates a standard tag of the same name\&.
++
++\fIAnnotations vs\&. Javadoc tags\fR: In general, if the markup you want to add is intended to affect or produce documentation, then it should be a Javadoc tag\&. Otherwise, it should be an annotation\&. See Custom Tags and Annotations in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#annotations
++
++You can also create more complex block tags or custom inline tags with the \f3-taglet\fR option\&.
++.TP
++-taglet \fIclass\fR
++.br
++Specifies the class file that starts the taglet used in generating the documentation for that tag\&. Use the fully qualified name for the \f3class\fR value\&. This taglet also defines the number of text arguments that the custom tag has\&. The taglet accepts those arguments, processes them, and generates the output\&. For extensive documentation with example taglets, see: Taglet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html
++
++Taglets are useful for block or inline tags\&. They can have any number of arguments and implement custom behavior, such as making text bold, formatting bullets, writing out the text to a file, or starting other processes\&. Taglets can only determine where a tag should appear and in what form\&. All other decisions are made by the doclet\&. A taglet cannot do things such as remove a class name from the list of included classes\&. However, it can execute side effects, such as printing the tag\&'s text to a file or triggering another process\&. Use the \f3-tagletpath\fR option to specify the path to the taglet\&. The following example inserts the To Do taglet after Parameters and ahead of Throws in the generated pages\&. Alternately, you can use the \f3-taglet\fR option in place of its \f3-tag\fR option, but that might be difficult to read\&.
++.sp
++.nf
++\f3\-taglet com\&.sun\&.tools\&.doclets\&.ToDoTaglet\fP
++.fi
++.nf
++\f3\-tagletpath /home/taglets \fP
++.fi
++.nf
++\f3\-tag return\fP
++.fi
++.nf
++\f3\-tag param\fP
++.fi
++.nf
++\f3\-tag todo\fP
++.fi
++.nf
++\f3\-tag throws\fP
++.fi
++.nf
++\f3\-tag see\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-tagletpath \fItagletpathlist\fR
++.br
++Specifies the search paths for finding taglet class files\&. The \f3tagletpathlist\fR can contain multiple paths by separating them with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&.
++.TP
++-docfilesubdirs
++.br
++Enables deep copying of doc-files directories\&. Subdirectories and all contents are recursively copied to the destination\&. For example, the directory doc-files/example/images and all of its contents would be copied\&. There is also an option to exclude subdirectories\&.
++.TP
++-excludedocfilessubdir \fIname1:name2\fR
++.br
++Excludes any doc-files subdirectories with the specified names\&. This prevents the copying of SCCS and other source-code-control subdirectories\&.
++.TP
++-noqualifier all | \fIpackagename1\fR:\fIpackagename2\&.\&.\&.\fR
++.br
++Omits qualifying package names from class names in output\&. The argument to the \f3-noqualifier\fR option is either \f3all\fR (all package qualifiers are omitted) or a colon-separate list of packages, with wild cards, to be removed as qualifiers\&. The package name is removed from places where class or interface names appear\&. See Process Source Files\&.
++
++The following example omits all package qualifiers: \f3-noqualifier all\fR\&.
++
++The following example omits \f3java\&.lang\fR and \f3java\&.io\fR package qualifiers: \f3-noqualifier java\&.lang:java\&.io\fR\&.
++
++The following example omits package qualifiers starting with \f3java\fR, and \f3com\&.sun\fR subpackages, but not \f3javax\fR: \f3-noqualifier java\&.*:com\&.sun\&.*\fR\&.
++
++Where a package qualifier would appear due to the previous behavior, the name can be suitably shortened\&. See How a Name Appears\&. This rule is in effect whether or not the \f3-noqualifier\fR option is used\&.
++.TP
++-notimestamp
++.br
++Suppresses the time stamp, which is hidden in an HTML comment in the generated HTML near the top of each page\&. The \f3-notimestamp\fR option is useful when you want to run the \f3javadoc\fR command on two source bases and get the differences between \f3diff\fR them, because it prevents time stamps from causing a \f3diff\fR (which would otherwise be a \f3diff\fR on every page)\&. The time stamp includes the \f3javadoc\fR command release number, and currently appears similar to this: \f3<!-- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 -->\fR\&.
++.TP
++-nocomment
++.br
++Suppresses the entire comment body, including the main description and all tags, and generate only declarations\&. This option lets you reuse source files that were originally intended for a different purpose so that you can produce skeleton HTML documentation at the early stages of a new project\&.
++.TP
++-sourcetab \fItablength\fR
++.br
++Specifies the number of spaces each tab uses in the source\&.
++.SH COMMAND-LINE\ ARGUMENT\ FILES
++To shorten or simplify the \f3javadoc\fR command, you can specify one or more files that contain arguments to the \f3javadoc\fR command (except \f3-J\fR options)\&. This enables you to create \f3javadoc\fR commands of any length on any operating system\&.
++.PP
++An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be space-separated or newline-separated\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
++.PP
++File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (\f3*\fR) are not allowed in these lists (such as for specifying *\&.java)\&. Using the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
++.PP
++When you run the \f3javadoc\fR command, pass in the path and name of each argument file with the @ leading character\&. When the \f3javadoc\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
++.PP
++\f3Example 1 Single Argument File\fR
++.PP
++You could use a single argument file named \f3argfile\fR to hold all \f3javadoc\fR command arguments: \f3javadoc @argfile\fR\&. The argument file \f3\fRcontains the contents of both files, as shown in the next example\&.
++.PP
++\f3Example 2 Two Argument Files\fR
++.PP
++You can create two argument files: One for the \f3javadoc\fR command options and the other for the package names or source file names\&. Notice the following lists have no line-continuation characters\&.
++.PP
++Create a file named options that contains:
++.sp
++.nf
++\f3\-d docs\-filelist \fP
++.fi
++.nf
++\f3\-use \fP
++.fi
++.nf
++\f3\-splitindex\fP
++.fi
++.nf
++\f3\-windowtitle \&'Java SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3\-doctitle \&'Java SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3\-header \&'<b>Java\(tm SE 7</b>\&'\fP
++.fi
++.nf
++\f3\-bottom \&'Copyright &copy; 1993\-2011 Oracle and/or its affiliates\&. All rights reserved\&.\&'\fP
++.fi
++.nf
++\f3\-group "Core Packages" "java\&.*"\fP
++.fi
++.nf
++\f3\-overview /java/pubs/ws/1\&.7\&.0/src/share/classes/overview\-core\&.html\fP
++.fi
++.nf
++\f3\-sourcepath /java/pubs/ws/1\&.7\&.0/src/share/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Create a file named packages that contains:
++.sp
++.nf
++\f3com\&.mypackage1\fP
++.fi
++.nf
++\f3com\&.mypackage2\fP
++.fi
++.nf
++\f3com\&.mypackage3\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3javadoc\fR command as follows:
++.sp
++.nf
++\f3javadoc @options @packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Argument Files with Paths\fR
++.PP
++The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
++.sp
++.nf
++\f3javadoc @path1/options @path2/packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Option Arguments\fR
++.PP
++The following example saves an argument to a \f3javadoc\fR command option in an argument file\&. The \f3-bottom\fR option is used because it can have a lengthy argument\&. You could create a file named bottom to contain the text argument:
++.sp
++.nf
++\f3<font size="\-1">\fP
++.fi
++.nf
++\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&. <br/>\fP
++.fi
++.nf
++\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3 Other names may be trademarks of their respective owners\&.</font>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3javadoc\fR command as follows:\f3javadoc -bottom @bottom @packages\fR\&.
++.PP
++You can also include the \f3-bottom\fR option at the start of the argument file and run the \f3javadoc\fR command as follows: \f3javadoc @bottom @packages\fR\&.
++.SH RUNNING\ THE\ JAVADOC\ COMMAND
++The release number of the \f3javadoc\fR command can be determined with the \f3javadoc -J-version\fR option\&. The release number of the standard doclet appears in the output stream\&. It can be turned off with the \f3-quiet\fR option\&.
++.PP
++Use the public programmatic interface to call the \f3javadoc\fR command from within programs written in the Java language\&. This interface is in \f3com\&.sun\&.tools\&.javadoc\&.Main\fR (and the \f3javadoc\fR command is reentrant)\&. For more information, see The Standard Doclet at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard-doclet\&.html#runningprogrammatically
++.PP
++The following instructions call the standard HTML doclet\&. To call a custom doclet, use the \f3-doclet\fR and \f3-docletpath\fR options\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.SS SIMPLE\ EXAMPLES
++You can run the \f3javadoc\fR command on entire packages or individual source files\&. Each package name has a corresponding directory name\&.
++.PP
++In the following examples, the source files are located at /home/src/java/awt/*\&.java\&. The destination directory is /home/html\&.
++.PP
++Document One or More Packages
++
++To document a package, the source files for that package must be located in a directory that has the same name as the package\&.
++.PP
++If a package name has several identifiers (separated by dots, such as \f3java\&.awt\&.color\fR), then each subsequent identifier must correspond to a deeper subdirectory (such as java/awt/color)\&.
++.PP
++You can split the source files for a single package among two such directory trees located at different places, as long as \f3-sourcepath\fR points to them both\&. For example, src1/java/awt/color and src2/java/awt/color\&.
++.PP
++You can run the \f3javadoc\fR command either by changing directories (with the \f3cd\fR command) or by using the \f3-sourcepath\fR option\&. The following examples illustrate both alternatives\&.
++.PP
++\f3Example 1 Recursive Run from One or More Packages\fR
++.PP
++This example uses \f3-sourcepath\fR so the \f3javadoc\fR command can be run from any directory and \f3-subpackages\fR (a new 1\&.4 option) for recursion\&. It traverses the subpackages of the java directory excluding packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice this excludes \f3java\&.lang\&.ref\fR, a subpackage of \f3java\&.lang\fR\&. To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as \f3java:javax:org\&.xml\&.sax\fR\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Change to Root and Run Explicit Packages\fR
++.PP
++Change to the parent directory of the fully qualified package\&. Then, run the \f3javadoc\fR command with the names of one or more packages that you want to document:
++.sp
++.nf
++\f3cd /home/src/\fP
++.fi
++.nf
++\f3javadoc \-d /home/html java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as j\f3ava:javax:org\&.xml\&.sax\fR\&.
++.PP
++\f3Example 3 Run from Any Directory on Explicit Packages in One Tree\fR
++.PP
++In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with the parent directory of the top-level package\&. Provide the names of one or more packages that you want to document:
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Run from Any Directory on Explicit Packages in Multiple Trees\fR
++.PP
++Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with a colon-separated list of the paths to each tree\&'s root\&. Provide the names of one or more packages that you want to document\&. All source files for a specified package do not need to be located under a single root directory, but they must be found somewhere along the source path\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src1:/home/src2 java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The result is that all cases generate HTML-formatted documentation for the \f3public\fR and \f3protected\fR classes and interfaces in packages j\f3ava\&.awt\fR and \f3java\&.awt\&.even\fRt and save the HTML files in the specified destination directory\&. Because two or more packages are being generated, the document has three HTML frames: one for the list of packages, another for the list of classes, and the third for the main class pages\&.
++.PP
++Document One or More Classes
++
++The second way to run the \f3javadoc\fR command is to pass one or more source files\&. You can run \f3javadoc\fR either of the following two ways: by changing directories (with the \f3cd\fR command) or by fully specifying the path to the source files\&. Relative paths are relative to the current directory\&. The \f3-sourcepath\fR option is ignored when passing source files\&. You can use command-line wild cards, such as an asterisk (*), to specify groups of classes\&.
++.PP
++\f3Example 1 Change to the Source Directory\fR
++.PP
++Change to the directory that holds the source files\&. Then run the \f3javadoc\fR command with the names of one or more source files you want to document\&.
++.PP
++This example generates HTML-formatted documentation for the classes \f3Button\fR, \f3Canvas,\fR and classes that begin with \f3Graphics\fR\&. Because source files rather than package names were passed in as arguments to the \f3javadoc\fR command, the document has two frames: one for the list of classes and the other for the main page\&.
++.sp
++.nf
++\f3cd /home/src/java/awt\fP
++.fi
++.nf
++\f3javadoc \-d /home/html Button\&.java Canvas\&.java Graphics*\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Change to the Root Directory of the Package\fR
++.PP
++This is useful for documenting individual source files from different subpackages off of the same root\&. Change to the package root directory, and supply the source files with paths from the root\&.
++.sp
++.nf
++\f3cd /home/src/\fP
++.fi
++.nf
++\f3javadoc \-d /home/html java/awt/Button\&.java java/applet/Applet\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Document Files from Any Directory\fR
++.PP
++In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command with the absolute path (or path relative to the current directory) to the source files you want to document\&.
++.sp
++.nf
++\f3javadoc \-d /home/html /home/src/java/awt/Button\&.java\fP
++.fi
++.nf
++\f3/home/src/java/awt/Graphics*\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Document Packages and Classes
++
++You can document entire packages and individual classes at the same time\&. Here is an example that mixes two of the previous examples\&. You can use the \f3-sourcepath\fR option for the path to the packages but not for the path to the individual classes\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt\fP
++.fi
++.nf
++\f3/home/src/java/applet/Applet\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS REAL-WORLD\ EXAMPLES
++The following command-line and \f3makefile\fR versions of the \f3javadoc\fR command run on the Java platform APIs\&. It uses 180 MB of memory to generate the documentation for the 1500 (approximately) public and protected classes in the Java SE 1\&.2\&. Both examples use absolute paths in the option arguments, so that the same \f3javadoc\fR command can be run from any directory\&.
++.PP
++Command-Line Example
++
++The following command might be too long for some shells\&. You can use a command-line argument file (or write a shell script) to overcome this limitation\&.
++.PP
++In the example, \f3packages\fR is the name of a file that contains the packages to process, such as \f3java\&.applet\fR\f3java\&.lang\fR\&. None of the options should contain any newline characters between the single quotation marks\&. For example, if you copy and paste this example, then delete the newline characters from the \f3-bottom\fR option\&.
++.sp
++.nf
++\f3javadoc \-sourcepath /java/jdk/src/share/classes \e\fP
++.fi
++.nf
++\f3\-overview /java/jdk/src/share/classes/overview\&.html \e\fP
++.fi
++.nf
++\f3\-d /java/jdk/build/api \e\fP
++.fi
++.nf
++\f3\-use \e\fP
++.fi
++.nf
++\f3\-splitIndex \e\fP
++.fi
++.nf
++\f3\-windowtitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
++.fi
++.nf
++\f3\-doctitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
++.fi
++.nf
++\f3\-header \&'<b>Java\(tm SE 7</b>\&' \e\fP
++.fi
++.nf
++\f3\-bottom \&'<font size="\-1">\fP
++.fi
++.nf
++\f3<a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
++.fi
++.nf
++\f3Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3Other names may be trademarks of their respective owners\&.</font>\&' \e\fP
++.fi
++.nf
++\f3\-group "Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*" \e\fP
++.fi
++.nf
++\f3\-group "Extension Packages" "javax\&.*" \e\fP
++.fi
++.nf
++\f3\-J\-Xmx180m \e \fP
++.fi
++.nf
++\f3@packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Programmatic Interface
++
++The Javadoc Access API enables the user to invoke the Javadoc tool directly from a Java application without executing a new process\&.
++.PP
++For example, the following statements are equivalent to the command \f3javadoc -d /home/html -sourcepath /home/src -subpackages java -exclude java\&.net:java\&.lang com\&.example\fR:
++.sp
++.nf
++\f3import javax\&.tools\&.DocumentationTool;\fP
++.fi
++.nf
++\f3import javax\&.tools\&.ToolProvider;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class JavaAccessSample{\fP
++.fi
++.nf
++\f3 public static void main(String[] args){\fP
++.fi
++.nf
++\f3 DocumentationTool javadoc = ToolProvider\&.getSystemDocumentationTool();\fP
++.fi
++.nf
++\f3 int rc = javadoc\&.run( null, null, null,\fP
++.fi
++.nf
++\f3 "\-d", "/home/html",\fP
++.fi
++.nf
++\f3 "\-sourcepath", "home/src",\fP
++.fi
++.nf
++\f3 "\-subpackages", "java",\fP
++.fi
++.nf
++\f3 "\-exclude", "java\&.net:java\&.lang",\fP
++.fi
++.nf
++\f3 "com\&.example");\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The first three arguments of the \f3run\fR method specify input, standard output, and standard error streams\&. \f3Null\fR is the default value for \f3System\&.in\fR, \f3System\&.out\fR, and \f3System\&.err\fR, respectively\&.
++.SS THE\ MAKEFILE\ EXAMPLE
++This is an example of a GNU \f3makefile\fR\&. Single quotation marks surround \f3makefile\fR arguments\&. For an example of a Windows \f3makefile\fR, see the \f3makefiles\fR section of the Javadoc FAQ at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html#makefiles
++.sp
++.nf
++\f3javadoc \-sourcepath $(SRCDIR) \e /* Sets path for source files */\fP
++.fi
++.nf
++\f3 \-overview $(SRCDIR)/overview\&.html \e /* Sets file for overview text */\fP
++.fi
++.nf
++\f3 \-d /java/jdk/build/api \e /* Sets destination directory */\fP
++.fi
++.nf
++\f3 \-use \e /* Adds "Use" files */\fP
++.fi
++.nf
++\f3 \-splitIndex \e /* Splits index A\-Z */\fP
++.fi
++.nf
++\f3 \-windowtitle $(WINDOWTITLE) \e /* Adds a window title */\fP
++.fi
++.nf
++\f3 \-doctitle $(DOCTITLE) \e /* Adds a doc title */\fP
++.fi
++.nf
++\f3 \-header $(HEADER) \e /* Adds running header text */\fP
++.fi
++.nf
++\f3 \-bottom $(BOTTOM) \e /* Adds text at bottom */\fP
++.fi
++.nf
++\f3 \-group $(GROUPCORE) \e /* 1st subhead on overview page */\fP
++.fi
++.nf
++\f3 \-group $(GROUPEXT) \e /* 2nd subhead on overview page */\fP
++.fi
++.nf
++\f3 \-J\-Xmx180m \e /* Sets memory to 180MB */\fP
++.fi
++.nf
++\f3 java\&.lang java\&.lang\&.reflect \e /* Sets packages to document */\fP
++.fi
++.nf
++\f3 java\&.util java\&.io java\&.net \e\fP
++.fi
++.nf
++\f3 java\&.applet\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3WINDOWTITLE = \&'Java\(tm SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3DOCTITLE = \&'Java\(tm Platform Standard Edition 7 API Specification\&'\fP
++.fi
++.nf
++\f3HEADER = \&'<b>Java\(tm SE 7</font>\&'\fP
++.fi
++.nf
++\f3BOTTOM = \&'<font size="\-1">\fP
++.fi
++.nf
++\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
++.fi
++.nf
++\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3 Other names may be trademarks of their respective owners\&.</font>\&'\fP
++.fi
++.nf
++\f3GROUPCORE = \&'"Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*"\&'\fP
++.fi
++.nf
++\f3GROUPEXT = \&'"Extension Packages" "javax\&.*"\&'\fP
++.fi
++.nf
++\f3SRCDIR = \&'/java/jdk/1\&.7\&.0/src/share/classes\&'\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS NOTES
++.TP 0.2i
++\(bu
++If you omit the \f3-windowtitle\fR option, then the \f3javadoc\fR command copies the document title to the window title\&. The \f3-windowtitle\fR option text is similar to the the \f3-doctitle\fR option, but without HTML tags to prevent those tags from appearing as raw text in the window title\&.
++.TP 0.2i
++\(bu
++If you omit the \f3-footer\fR option, then the \f3javadoc\fR command copies the header text to the footer\&.
++.TP 0.2i
++\(bu
++Other important options you might want to use, but were not needed in the previous example, are the \f3-classpath\fR and \f3-link\fR options\&.
++.SH GENERAL\ TROUBLESHOOTING
++.TP 0.2i
++\(bu
++The \f3javadoc\fR command reads only files that contain valid class names\&. If the \f3javadoc\fR command is not correctly reading the contents of a file, then verify that the class names are valid\&. See Process Source Files\&.
++.TP 0.2i
++\(bu
++See the Javadoc FAQ for information about common bugs and for troubleshooting tips at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html
++.SH ERRORS\ AND\ WARNINGS
++Error and warning messages contain the file name and line number to the declaration line rather than to the particular line in the documentation comment\&.
++.PP
++For example, this message \f3error: cannot read: Class1\&.java\fR means that the \f3javadoc\fR command is trying to load \f3Class1\&.jav\fR\f3a\fR in the current directory\&. The class name is shown with its path (absolute or relative)\&.
++.SH ENVIRONMENT
++.TP
++CLASSPATH
++\f3CLASSPATH\fR is the environment variable that provides the path that the \f3javadoc\fR command uses to find user class files\&. This environment variable is overridden by the \f3-classpath\fR option\&. Separate directories with a semicolon for Windows or a colon for Oracle Solaris\&.
++
++\fIWindows example\fR: \f3\&.;C:\eclasses;C:\ehome\ejava\eclasses\fR
++
++\fIOracle Solaris example\fR: \f3\&.:/home/classes:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javap(1)
++.SH RELATED\ DOCUMENTS
++.TP 0.2i
++\(bu
++Javadoc Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/index\&.html
++.TP 0.2i
++\(bu
++How Classes Are Found http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++.TP 0.2i
++\(bu
++How to Write Doc Comments for the Javadoc Tool http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html
++.TP 0.2i
++\(bu
++URL Memo, Uniform Resource Locators http://www\&.ietf\&.org/rfc/rfc1738\&.txt
++.TP 0.2i
++\(bu
++HTML standard, HTML Document Representation (4197265 and 4137321) http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/javah.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/javah.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: javah.1
+-.\"
+-.if n .pl 99999
+-.TH javah 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: javah.1
++.\"
++.if n .pl 99999
++.TH javah 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,111 +47,111 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javah \- Generates C header and source files from a Java class\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavah\fR [ \fIoptions\fR ] f\fIully\-qualified\-class\-name \&.\&.\&.\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIfully-qualified-class-name\fR
+-The fully qualified location of the classes to be converted to C header and source files\&.
+-.SH DESCRIPTION
+-The \f3javah\fR command generates C header and source files that are needed to implement native methods\&. The generated header and source files are used by C programs to reference an object\&'s instance variables from native source code\&. The \f3\&.h\fR file contains a \f3struct\fR definition with a layout that parallels the layout of the corresponding class\&. The fields in the \f3struct\fR correspond to instance variables in the class\&.
+-.PP
+-The name of the header file and the structure declared within it are derived from the name of the class\&. When the class passed to the \f3javah\fR command is inside a package, the package name is added to the beginning of both the header file name and the structure name\&. Underscores (_) are used as name delimiters\&.
+-.PP
+-By default the \f3javah\fR command creates a header file for each class listed on the command line and puts the files in the current directory\&. Use the \f3-stubs\fR option to create source files\&. Use the \f3-o\fR option to concatenate the results for all listed classes into a single file\&.
+-.PP
+-The Java Native Interface (JNI) does not require header information or stub files\&. The \f3javah\fR command can still be used to generate native method function prototypes needed for JNI-style native methods\&. The \f3javah\fR command produces JNI-style output by default and places the result in the \f3\&.h\fR file\&.
+-.SH OPTIONS
+-.TP
+--o \fIoutputfile\fR
+-.br
+-Concatenates the resulting header or source files for all the classes listed on the command line into an output file\&. Only one of \f3-o\fR or \f3-d\fR can be used\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Sets the directory where the \f3javah\fR command saves the header files or the stub files\&. Only one of \f3-d\fR or \f3-o\fR can be used\&.
+-.TP
+--stubs
+-.br
+-Causes the \f3javah\fR command to generate C declarations from the Java object file\&.
+-.TP
+--verbose
+-.br
+-Indicates verbose output and causes the \f3javah\fR command to print a message to \f3stdout\fR about the status of the generated files\&.
+-.TP
+--help
+-.br
+-Prints a help message for \f3javah\fR usage\&.
+-.TP
+--version
+-.br
+-Prints \f3javah\fR command release information\&.
+-.TP
+--jni
+-.br
+-Causes the \f3javah\fR command to create an output file containing JNI-style native method function prototypes\&. This is the default output; use of \f3-jni\fR is optional\&.
+-.TP
+--classpath \fIpath\fR
+-.br
+-Specifies the path the \f3javah\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons on Oracle Solaris and semicolons on Windows\&. The general format for path is:
+-
+-\fIOracle Solaris\fR:
+-
+-\&.:\fIyour-path\fR
+-
+-Example: \f3\&.:/home/avh/classes:/usr/local/java/classes\fR
+-
+-\fIWindows\fR:
+-
+-\&.;\fIyour-path\fR
+-
+-Example: \f3\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR
+-
+-As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
+-
+-For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JAR\fR, then the class path element \f3mydir/*\fR is expanded to a \f3A\fR\f3\&.jar:b\&.JAR\fR, except that the order of jar files is unspecified\&. All JAR files in the specified directory, including hidden ones, are included in the list\&. A class path entry that consists of * expands to a list of all the JAR files in the current directory\&. The \f3CLASSPATH\fR environment variable, where defined, is similarly expanded\&. Any class path wild card expansion occurs before the Java Virtual Machine (JVM) is started\&. A Java program will never see unexpanded wild cards except by querying the environment\&. For example, by calling \f3System\&.getenv("CLASSPATH")\fR\&.
+-.TP
+--bootclasspath \fIpath\fR
+-.br
+-Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre\elib\ert\&.jar\fR and several other JAR files\&.
+-.TP
+--old
+-.br
+-Specifies that old JDK 1\&.0-style header files should be generated\&.
+-.TP
+--force
+-.br
+-Specifies that output files should always be written\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
+-.TP 0.2i
+-\(bu
+-javadoc(1)
++
++.SH NAME
++javah \- Generates C header and source files from a Java class\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavah\fR [ \fIoptions\fR ] f\fIully\-qualified\-class\-name \&.\&.\&.\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIfully-qualified-class-name\fR
++The fully qualified location of the classes to be converted to C header and source files\&.
++.SH DESCRIPTION
++The \f3javah\fR command generates C header and source files that are needed to implement native methods\&. The generated header and source files are used by C programs to reference an object\&'s instance variables from native source code\&. The \f3\&.h\fR file contains a \f3struct\fR definition with a layout that parallels the layout of the corresponding class\&. The fields in the \f3struct\fR correspond to instance variables in the class\&.
++.PP
++The name of the header file and the structure declared within it are derived from the name of the class\&. When the class passed to the \f3javah\fR command is inside a package, the package name is added to the beginning of both the header file name and the structure name\&. Underscores (_) are used as name delimiters\&.
++.PP
++By default the \f3javah\fR command creates a header file for each class listed on the command line and puts the files in the current directory\&. Use the \f3-stubs\fR option to create source files\&. Use the \f3-o\fR option to concatenate the results for all listed classes into a single file\&.
++.PP
++The Java Native Interface (JNI) does not require header information or stub files\&. The \f3javah\fR command can still be used to generate native method function prototypes needed for JNI-style native methods\&. The \f3javah\fR command produces JNI-style output by default and places the result in the \f3\&.h\fR file\&.
++.SH OPTIONS
++.TP
++-o \fIoutputfile\fR
++.br
++Concatenates the resulting header or source files for all the classes listed on the command line into an output file\&. Only one of \f3-o\fR or \f3-d\fR can be used\&.
++.TP
++-d \fIdirectory\fR
++.br
++Sets the directory where the \f3javah\fR command saves the header files or the stub files\&. Only one of \f3-d\fR or \f3-o\fR can be used\&.
++.TP
++-stubs
++.br
++Causes the \f3javah\fR command to generate C declarations from the Java object file\&.
++.TP
++-verbose
++.br
++Indicates verbose output and causes the \f3javah\fR command to print a message to \f3stdout\fR about the status of the generated files\&.
++.TP
++-help
++.br
++Prints a help message for \f3javah\fR usage\&.
++.TP
++-version
++.br
++Prints \f3javah\fR command release information\&.
++.TP
++-jni
++.br
++Causes the \f3javah\fR command to create an output file containing JNI-style native method function prototypes\&. This is the default output; use of \f3-jni\fR is optional\&.
++.TP
++-classpath \fIpath\fR
++.br
++Specifies the path the \f3javah\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons on Oracle Solaris and semicolons on Windows\&. The general format for path is:
++
++\fIOracle Solaris\fR:
++
++\&.:\fIyour-path\fR
++
++Example: \f3\&.:/home/avh/classes:/usr/local/java/classes\fR
++
++\fIWindows\fR:
++
++\&.;\fIyour-path\fR
++
++Example: \f3\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR
++
++As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
++
++For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JAR\fR, then the class path element \f3mydir/*\fR is expanded to a \f3A\fR\f3\&.jar:b\&.JAR\fR, except that the order of jar files is unspecified\&. All JAR files in the specified directory, including hidden ones, are included in the list\&. A class path entry that consists of * expands to a list of all the JAR files in the current directory\&. The \f3CLASSPATH\fR environment variable, where defined, is similarly expanded\&. Any class path wild card expansion occurs before the Java Virtual Machine (JVM) is started\&. A Java program will never see unexpanded wild cards except by querying the environment\&. For example, by calling \f3System\&.getenv("CLASSPATH")\fR\&.
++.TP
++-bootclasspath \fIpath\fR
++.br
++Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre\elib\ert\&.jar\fR and several other JAR files\&.
++.TP
++-old
++.br
++Specifies that old JDK 1\&.0-style header files should be generated\&.
++.TP
++-force
++.br
++Specifies that output files should always be written\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javap(1)
++.TP 0.2i
++\(bu
++javadoc(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/javap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/javap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/bsd/doc/man/jcmd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jcmd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2012, 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
+--- ./jdk/src/bsd/doc/man/jconsole.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jconsole.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Troubleshooting, Profiling, Monitoring and Management Tools
+-.\" Title: jconsole.1
+-.\"
+-.if n .pl 99999
+-.TH jconsole 1 "21 November 2013" "JDK 8" "Java Troubleshooting, Profiling, Monitoring and Management Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Troubleshooting, Profiling, Monitoring and Management Tools
++.\" Title: jconsole.1
++.\"
++.if n .pl 99999
++.TH jconsole 1 "21 November 2013" "JDK 8" "Java Troubleshooting, Profiling, Monitoring and Management Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,65 +47,65 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jconsole \- Starts a graphical console that lets you monitor and manage Java applications\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjconsole\fR [ \fIoptions\fR ] [ connection \&.\&.\&. ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR
+-The \f3pid\fR value is the process ID of a local Java Virtual Machine (JVM)\&. The JVM must be running with the same user ID as the user ID running the \f3jconsole\fR command\&.The \f3host:port\fR values are the name of the host system on which the JVM is running, and the port number specified by the system property \f3com\&.sun\&.management\&.jmxremote\&.port\fR when the JVM was started\&.The \f3jmxUrl\fR value is the address of the JMX agent to be connected to as described in JMXServiceURL\&.
+-
+-For more information about the \f3connection\fR parameter, see Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
+-
+-See also the \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
+-.SH DESCRIPTION
+-The \f3jconsole\fR command starts a graphical console tool that lets you monitor and manage Java applications and virtual machines on a local or remote machine\&.
+-.PP
+-On Windows, the \f3jconsole\fR command does not associate with a console window\&. It does, however, display a dialog box with error information when the \f3jconsole\fR command fails\&.
+-.SH OPTIONS
+-.TP
+--interval\fI=n\fR
+-.br
+-Sets the update interval to \fIn\fR seconds (default is 4 seconds)\&.
+-.TP
+--notile
+-.br
+-Does not tile windows initially (for two or more connections)\&.
+-.TP
+--pluginpath \fIplugins\fR
+-.br
+-Specifies a list of directories or JAR files to be searched for \f3JConsole\fR plug-ins\&. The \fIplugins\fR path should contain a provider-configuration file named \f3META-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR that contains one line for each plug-in\&. The line specifies the fully qualified class name of the class implementing the \f3com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR class\&.
+-.TP
+--version
+-.br
+-Displays release information and exits\&.
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the JVM on which the \f3jconsole\fR command is run\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Using JConsole at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html
+-.TP 0.2i
+-\(bu
+-Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
+-.TP 0.2i
+-\(bu
+-The \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
++
++.SH NAME
++jconsole \- Starts a graphical console that lets you monitor and manage Java applications\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjconsole\fR [ \fIoptions\fR ] [ connection \&.\&.\&. ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR
++The \f3pid\fR value is the process ID of a local Java Virtual Machine (JVM)\&. The JVM must be running with the same user ID as the user ID running the \f3jconsole\fR command\&.The \f3host:port\fR values are the name of the host system on which the JVM is running, and the port number specified by the system property \f3com\&.sun\&.management\&.jmxremote\&.port\fR when the JVM was started\&.The \f3jmxUrl\fR value is the address of the JMX agent to be connected to as described in JMXServiceURL\&.
++
++For more information about the \f3connection\fR parameter, see Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
++
++See also the \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
++.SH DESCRIPTION
++The \f3jconsole\fR command starts a graphical console tool that lets you monitor and manage Java applications and virtual machines on a local or remote machine\&.
++.PP
++On Windows, the \f3jconsole\fR command does not associate with a console window\&. It does, however, display a dialog box with error information when the \f3jconsole\fR command fails\&.
++.SH OPTIONS
++.TP
++-interval\fI=n\fR
++.br
++Sets the update interval to \fIn\fR seconds (default is 4 seconds)\&.
++.TP
++-notile
++.br
++Does not tile windows initially (for two or more connections)\&.
++.TP
++-pluginpath \fIplugins\fR
++.br
++Specifies a list of directories or JAR files to be searched for \f3JConsole\fR plug-ins\&. The \fIplugins\fR path should contain a provider-configuration file named \f3META-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR that contains one line for each plug-in\&. The line specifies the fully qualified class name of the class implementing the \f3com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR class\&.
++.TP
++-version
++.br
++Displays release information and exits\&.
++.TP
++-help
++.br
++Displays a help message\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the JVM on which the \f3jconsole\fR command is run\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Using JConsole at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html
++.TP 0.2i
++\(bu
++Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
++.TP 0.2i
++\(bu
++The \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jdb.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jdb.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1995, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jdb.1
+-.\"
+-.if n .pl 99999
+-.TH jdb 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jdb.1
++.\"
++.if n .pl 99999
++.TH jdb 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,223 +47,223 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jdb \- Finds and fixes bugs in Java platform programs\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjdb\fR [\fIoptions\fR] [\fIclassname\fR] [\fIarguments\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIclass\fRname
+-Name of the main class to debug\&.
+-.TP
+-\fIarguments\fR
+-Arguments passed to the \f3main()\fR method of the class\&.
+-.SH DESCRIPTION
+-The Java Debugger (JDB) is a simple command-line debugger for Java classes\&. The \f3jdb\fR command and its options call the JDB\&. The \f3jdb\fR command demonstrates the Java Platform Debugger Architecture (JDBA) and provides inspection and debugging of a local or remote Java Virtual Machine (JVM)\&. See Java Platform Debugger Architecture (JDBA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
+-.SS START\ A\ JDB\ SESSION
+-There are many ways to start a JDB session\&. The most frequently used way is to have JDB launch a new JVM with the main class of the application to be debugged\&. Do this by substituting the \f3jdb\fR command for the \f3java\fR command in the command line\&. For example, if your application\&'s main class is \f3MyClass\fR, then use the following command to debug it under JDB:
+-.sp
+-.nf
+-\f3jdb MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When started this way, the \f3jdb\fR command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class\&'s first instruction\&.
+-.PP
+-Another way to use the \f3jdb\fR command is by attaching it to a JVM that is already running\&. Syntax for starting a JVM to which the \f3jdb\fR command attaches when the JVM is running is as follows\&. This loads in-process debugging libraries and specifies the kind of connection to be made\&.
+-.sp
+-.nf
+-\f3java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-You can then attach the \f3jdb\fR command to the JVM with the following command:
+-.sp
+-.nf
+-\f3jdb \-attach 8000\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3MyClass\fR argument is not specified in the \f3jdb\fR command line in this case because the \f3jdb\fR command is connecting to an existing JVM instead of launching a new JVM\&.
+-.PP
+-There are many other ways to connect the debugger to a JVM, and all of them are supported by the \f3jdb\fR command\&. The Java Platform Debugger Architecture has additional documentation on these connection options\&.
+-.SS BASIC\ JDB\ COMMANDS
+-The following is a list of the basic \f3jdb\fR commands\&. The JDB supports other commands that you can list with the \f3-help\fR option\&.
+-.TP
+-help or ?
+-The \f3help\fR or \f3?\fR commands display the list of recognized commands with a brief description\&.
+-.TP
+-run
+-After you start JDB and set breakpoints, you can use the \f3run\fR command to execute the debugged application\&. The \f3run\fR command is available only when the \f3jdb\fR command starts the debugged application as opposed to attaching to an existing JVM\&.
+-.TP
+-cont
+-Continues execution of the debugged application after a breakpoint, exception, or step\&.
+-.TP
+-print
+-Displays Java objects and primitive values\&. For variables or fields of primitive types, the actual value is printed\&. For objects, a short description is printed\&. See the dump command to find out how to get more information about an object\&.
+-
+-\fINote:\fR To display local variables, the containing class must have been compiled with the \f3javac -g\fR option\&.
+-
+-The \f3print\fR command supports many simple Java expressions including those with method invocations, for example:
+-.sp
+-.nf
+-\f3print MyClass\&.myStaticField\fP
+-.fi
+-.nf
+-\f3print myObj\&.myInstanceField\fP
+-.fi
+-.nf
+-\f3print i + j + k (i, j, k are primities and either fields or local variables)\fP
+-.fi
+-.nf
+-\f3print myObj\&.myMethod() (if myMethod returns a non\-null)\fP
+-.fi
+-.nf
+-\f3print new java\&.lang\&.String("Hello")\&.length()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-dump
+-For primitive values, the \f3dump\fR command is identical to the \f3print\fR command\&. For objects, the \f3dump\fR command prints the current value of each field defined in the object\&. Static and instance fields are included\&. The \f3dump\fR command supports the same set of expressions as the \f3print\fR command\&.
+-.TP
+-threads
+-List the threads that are currently running\&. For each thread, its name and current status are printed and an index that can be used in other commands\&. In this example, the thread index is 4, the thread is an instance of \f3java\&.lang\&.Thread\fR, the thread name is \f3main\fR, and it is currently running\&.
+-.sp
+-.nf
+-\f34\&. (java\&.lang\&.Thread)0x1 main running\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-thread
+-Select a thread to be the current thread\&. Many \f3jdb\fR commands are based on the setting of the current thread\&. The thread is specified with the thread index described in the threads command\&.
+-.TP
+-where
+-The \f3where\fR command with no arguments dumps the stack of the current thread\&. The \f3where\fR\f3all\fR command dumps the stack of all threads in the current thread group\&. The \f3where\fR\f3threadindex\fR command dumps the stack of the specified thread\&.
+-
+-If the current thread is suspended either through an event such as a breakpoint or through the \f3suspend\fR command, then local variables and fields can be displayed with the \f3print\fR and \f3dump\fR commands\&. The \f3up\fR and \f3down\fR commands select which stack frame is the current stack frame\&.
+-.SS BREAKPOINTS
+-Breakpoints can be set in JDB at line numbers or at the first instruction of a method, for example:
+-.TP 0.2i
+-\(bu
+-The command \f3stop at MyClass:22\fR sets a breakpoint at the first instruction for line 22 of the source file containing \f3MyClass\fR\&.
+-.TP 0.2i
+-\(bu
+-The command \f3stop in java\&.lang\&.String\&.length\fR sets a breakpoint at the beginning of the method \f3java\&.lang\&.String\&.length\fR\&.
+-.TP 0.2i
+-\(bu
+-The command \f3stop in MyClass\&.<clinit>\fR uses \f3<clinit>\fR to identify the static initialization code for \f3MyClass\fR\&.
+-.PP
+-When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint\&. For example, \f3MyClass\&.myMethod(int,java\&.lang\&.String)\fR or \f3MyClass\&.myMethod()\fR\&.
+-.PP
+-The \f3clear\fR command removes breakpoints using the following syntax: \f3clear MyClass:45\fR\&. Using the \f3clear\fR or \f3stop\fR command with no argument displays a list of all breakpoints currently set\&. The \f3cont\fR command continues execution\&.
+-.SS STEPPING
+-The \f3step\fR command advances execution to the next line whether it is in the current stack frame or a called method\&. The \f3next\fR command advances execution to the next line in the current stack frame\&.
+-.SS EXCEPTIONS
+-When an exception occurs for which there is not a \f3catch\fR statement anywhere in the throwing thread\&'s call stack, the JVM typically prints an exception trace and exits\&. When running under JDB, however, control returns to JDB at the offending throw\&. You can then use the \f3jdb\fR command to diagnose the cause of the exception\&.
+-.PP
+-Use the \f3catch\fR command to cause the debugged application to stop at other thrown exceptions, for example: \f3catch java\&.io\&.FileNotFoundException\fR or \f3catch\fR\f3mypackage\&.BigTroubleException\fR\&. Any exception that is an instance of the specified class or subclass stops the application at the point where it is thrown\&.
+-.PP
+-The \f3ignore\fR command negates the effect of an earlier \f3catch\fR command\&. The \f3ignore\fR command does not cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger\&.
+-.SH OPTIONS
+-When you use the \f3jdb\fR command instead of the \f3java\fR command on the command line, the \f3jdb\fR command accepts many of the same options as the \f3java\fR command, including \f3-D\fR, \f3-classpath\fR, and \f3-X\fR options\&. The following list contains additional options that are accepted by the \f3jdb\fR command\&.
+-.PP
+-Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM it is to debug\&. For additional documentation about these connection alternatives, see Java Platform Debugger Architecture (JPDA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.TP
+--sourcepath \fIdir1:dir2: \&. \&. \&.\fR
+-.br
+-Uses the specified path to search for source files in the specified path\&. If this option is not specified, then use the default path of dot (\&.)\&.
+-.TP
+--attach \fIaddress\fR
+-.br
+-Attaches the debugger to a running JVM with the default connection mechanism\&.
+-.TP
+--listen \fIaddress\fR
+-.br
+-Waits for a running JVM to connect to the specified address with a standard connector\&.
+-.TP
+--launch
+-.br
+-Starts the debugged application immediately upon startup of JDB\&. The \f3-launch\fR option removes the need for the \f3run\fR command\&. The debugged application is launched and then stopped just before the initial application class is loaded\&. At that point, you can set any necessary breakpoints and use the \f3cont\fR command to continue execution\&.
+-.TP
+--listconnectors
+-.br
+-List the connectors available in this JVM\&.
+-.TP
+--connect connector-name:\fIname1=value1\fR
+-.br
+-Connects to the target JVM with the named connector and listed argument values\&.
+-.TP
+--dbgtrace [\fIflags\fR]
+-.br
+-Prints information for debugging the \f3jdb\fR command\&.
+-.TP
+--tclient
+-.br
+-Runs the application in the Java HotSpot VM client\&.
+-.TP
+--tserver
+-.br
+-Runs the application in the Java HotSpot VM server\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH OPTIONS\ FORWARDED\ TO\ THE\ DEBUGGER\ PROCESS
+-.TP
+--v -verbose[:\fIclass\fR|gc|jni]
+-.br
+-Turns on verbose mode\&.
+-.TP
+--D\fIname\fR=\fIvalue\fR
+-.br
+-Sets a system property\&.
+-.TP
+--classpath \fIdir\fR
+-.br
+-Lists directories separated by colons in which to look for classes\&.
+-.TP
+--X\fIoption\fR
+-.br
+-Nonstandard target JVM option\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
++
++.SH NAME
++jdb \- Finds and fixes bugs in Java platform programs\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjdb\fR [\fIoptions\fR] [\fIclassname\fR] [\fIarguments\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIclass\fRname
++Name of the main class to debug\&.
++.TP
++\fIarguments\fR
++Arguments passed to the \f3main()\fR method of the class\&.
++.SH DESCRIPTION
++The Java Debugger (JDB) is a simple command-line debugger for Java classes\&. The \f3jdb\fR command and its options call the JDB\&. The \f3jdb\fR command demonstrates the Java Platform Debugger Architecture (JDBA) and provides inspection and debugging of a local or remote Java Virtual Machine (JVM)\&. See Java Platform Debugger Architecture (JDBA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
++.SS START\ A\ JDB\ SESSION
++There are many ways to start a JDB session\&. The most frequently used way is to have JDB launch a new JVM with the main class of the application to be debugged\&. Do this by substituting the \f3jdb\fR command for the \f3java\fR command in the command line\&. For example, if your application\&'s main class is \f3MyClass\fR, then use the following command to debug it under JDB:
++.sp
++.nf
++\f3jdb MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When started this way, the \f3jdb\fR command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class\&'s first instruction\&.
++.PP
++Another way to use the \f3jdb\fR command is by attaching it to a JVM that is already running\&. Syntax for starting a JVM to which the \f3jdb\fR command attaches when the JVM is running is as follows\&. This loads in-process debugging libraries and specifies the kind of connection to be made\&.
++.sp
++.nf
++\f3java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++You can then attach the \f3jdb\fR command to the JVM with the following command:
++.sp
++.nf
++\f3jdb \-attach 8000\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3MyClass\fR argument is not specified in the \f3jdb\fR command line in this case because the \f3jdb\fR command is connecting to an existing JVM instead of launching a new JVM\&.
++.PP
++There are many other ways to connect the debugger to a JVM, and all of them are supported by the \f3jdb\fR command\&. The Java Platform Debugger Architecture has additional documentation on these connection options\&.
++.SS BASIC\ JDB\ COMMANDS
++The following is a list of the basic \f3jdb\fR commands\&. The JDB supports other commands that you can list with the \f3-help\fR option\&.
++.TP
++help or ?
++The \f3help\fR or \f3?\fR commands display the list of recognized commands with a brief description\&.
++.TP
++run
++After you start JDB and set breakpoints, you can use the \f3run\fR command to execute the debugged application\&. The \f3run\fR command is available only when the \f3jdb\fR command starts the debugged application as opposed to attaching to an existing JVM\&.
++.TP
++cont
++Continues execution of the debugged application after a breakpoint, exception, or step\&.
++.TP
++print
++Displays Java objects and primitive values\&. For variables or fields of primitive types, the actual value is printed\&. For objects, a short description is printed\&. See the dump command to find out how to get more information about an object\&.
++
++\fINote:\fR To display local variables, the containing class must have been compiled with the \f3javac -g\fR option\&.
++
++The \f3print\fR command supports many simple Java expressions including those with method invocations, for example:
++.sp
++.nf
++\f3print MyClass\&.myStaticField\fP
++.fi
++.nf
++\f3print myObj\&.myInstanceField\fP
++.fi
++.nf
++\f3print i + j + k (i, j, k are primities and either fields or local variables)\fP
++.fi
++.nf
++\f3print myObj\&.myMethod() (if myMethod returns a non\-null)\fP
++.fi
++.nf
++\f3print new java\&.lang\&.String("Hello")\&.length()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++dump
++For primitive values, the \f3dump\fR command is identical to the \f3print\fR command\&. For objects, the \f3dump\fR command prints the current value of each field defined in the object\&. Static and instance fields are included\&. The \f3dump\fR command supports the same set of expressions as the \f3print\fR command\&.
++.TP
++threads
++List the threads that are currently running\&. For each thread, its name and current status are printed and an index that can be used in other commands\&. In this example, the thread index is 4, the thread is an instance of \f3java\&.lang\&.Thread\fR, the thread name is \f3main\fR, and it is currently running\&.
++.sp
++.nf
++\f34\&. (java\&.lang\&.Thread)0x1 main running\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++thread
++Select a thread to be the current thread\&. Many \f3jdb\fR commands are based on the setting of the current thread\&. The thread is specified with the thread index described in the threads command\&.
++.TP
++where
++The \f3where\fR command with no arguments dumps the stack of the current thread\&. The \f3where\fR\f3all\fR command dumps the stack of all threads in the current thread group\&. The \f3where\fR\f3threadindex\fR command dumps the stack of the specified thread\&.
++
++If the current thread is suspended either through an event such as a breakpoint or through the \f3suspend\fR command, then local variables and fields can be displayed with the \f3print\fR and \f3dump\fR commands\&. The \f3up\fR and \f3down\fR commands select which stack frame is the current stack frame\&.
++.SS BREAKPOINTS
++Breakpoints can be set in JDB at line numbers or at the first instruction of a method, for example:
++.TP 0.2i
++\(bu
++The command \f3stop at MyClass:22\fR sets a breakpoint at the first instruction for line 22 of the source file containing \f3MyClass\fR\&.
++.TP 0.2i
++\(bu
++The command \f3stop in java\&.lang\&.String\&.length\fR sets a breakpoint at the beginning of the method \f3java\&.lang\&.String\&.length\fR\&.
++.TP 0.2i
++\(bu
++The command \f3stop in MyClass\&.<clinit>\fR uses \f3<clinit>\fR to identify the static initialization code for \f3MyClass\fR\&.
++.PP
++When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint\&. For example, \f3MyClass\&.myMethod(int,java\&.lang\&.String)\fR or \f3MyClass\&.myMethod()\fR\&.
++.PP
++The \f3clear\fR command removes breakpoints using the following syntax: \f3clear MyClass:45\fR\&. Using the \f3clear\fR or \f3stop\fR command with no argument displays a list of all breakpoints currently set\&. The \f3cont\fR command continues execution\&.
++.SS STEPPING
++The \f3step\fR command advances execution to the next line whether it is in the current stack frame or a called method\&. The \f3next\fR command advances execution to the next line in the current stack frame\&.
++.SS EXCEPTIONS
++When an exception occurs for which there is not a \f3catch\fR statement anywhere in the throwing thread\&'s call stack, the JVM typically prints an exception trace and exits\&. When running under JDB, however, control returns to JDB at the offending throw\&. You can then use the \f3jdb\fR command to diagnose the cause of the exception\&.
++.PP
++Use the \f3catch\fR command to cause the debugged application to stop at other thrown exceptions, for example: \f3catch java\&.io\&.FileNotFoundException\fR or \f3catch\fR\f3mypackage\&.BigTroubleException\fR\&. Any exception that is an instance of the specified class or subclass stops the application at the point where it is thrown\&.
++.PP
++The \f3ignore\fR command negates the effect of an earlier \f3catch\fR command\&. The \f3ignore\fR command does not cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger\&.
++.SH OPTIONS
++When you use the \f3jdb\fR command instead of the \f3java\fR command on the command line, the \f3jdb\fR command accepts many of the same options as the \f3java\fR command, including \f3-D\fR, \f3-classpath\fR, and \f3-X\fR options\&. The following list contains additional options that are accepted by the \f3jdb\fR command\&.
++.PP
++Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM it is to debug\&. For additional documentation about these connection alternatives, see Java Platform Debugger Architecture (JPDA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
++.TP
++-help
++.br
++Displays a help message\&.
++.TP
++-sourcepath \fIdir1:dir2: \&. \&. \&.\fR
++.br
++Uses the specified path to search for source files in the specified path\&. If this option is not specified, then use the default path of dot (\&.)\&.
++.TP
++-attach \fIaddress\fR
++.br
++Attaches the debugger to a running JVM with the default connection mechanism\&.
++.TP
++-listen \fIaddress\fR
++.br
++Waits for a running JVM to connect to the specified address with a standard connector\&.
++.TP
++-launch
++.br
++Starts the debugged application immediately upon startup of JDB\&. The \f3-launch\fR option removes the need for the \f3run\fR command\&. The debugged application is launched and then stopped just before the initial application class is loaded\&. At that point, you can set any necessary breakpoints and use the \f3cont\fR command to continue execution\&.
++.TP
++-listconnectors
++.br
++List the connectors available in this JVM\&.
++.TP
++-connect connector-name:\fIname1=value1\fR
++.br
++Connects to the target JVM with the named connector and listed argument values\&.
++.TP
++-dbgtrace [\fIflags\fR]
++.br
++Prints information for debugging the \f3jdb\fR command\&.
++.TP
++-tclient
++.br
++Runs the application in the Java HotSpot VM client\&.
++.TP
++-tserver
++.br
++Runs the application in the Java HotSpot VM server\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH OPTIONS\ FORWARDED\ TO\ THE\ DEBUGGER\ PROCESS
++.TP
++-v -verbose[:\fIclass\fR|gc|jni]
++.br
++Turns on verbose mode\&.
++.TP
++-D\fIname\fR=\fIvalue\fR
++.br
++Sets a system property\&.
++.TP
++-classpath \fIdir\fR
++.br
++Lists directories separated by colons in which to look for classes\&.
++.TP
++-X\fIoption\fR
++.br
++Nonstandard target JVM option\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javap(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jdeps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jdeps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jdeps.1
+-.\"
+-.if n .pl 99999
+-.TH jdeps 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jdeps.1
++.\"
++.if n .pl 99999
++.TH jdeps 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,490 +47,490 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jdeps \- Java class dependency analyzer\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjdeps\fR [\fIoptions\fR] \fIclasses\fR \&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIclasses\fR
+-Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
+-.SH DESCRIPTION
+-The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
+-.SH OPTIONS
+-.TP
+--dotoutput <\fIdir\fR>
+-.br
+-Destination directory for DOT file output\&. If specified, \f3jdeps\fR will generate one dot file per each analyzed archive named <\fIarchive-file-name\fR>\&.dot listing the dependencies, and also a summary file named summary\&.dot listing the dependencies among the archives\&.
+-.TP
+--s, -summary
+-.br
+-Prints dependency summary only\&.
+-.TP
+--v, -verbose
+-.br
+-Prints all class-level dependencies\&.
+-.TP
+--verbose:package
+-.br
+-Prints package-level dependencies excluding dependencies within the same archive\&.
+-.TP
+--verbose:class
+-.br
+-Prints class-level dependencies excluding dependencies within the same archive\&.
+-.TP
+--cp <\fIpath\fR>, -classpath <\fIpath\fR>
+-.br
+-Specifies where to find class files\&.
+-
+-See also Setting the Class Path\&.
+-.TP
+--p <\fIpkg name\fR>, -package <\fIpkg name\fR>
+-.br
+-Finds dependencies in the specified package\&. You can specify this option multiple times for different packages\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
+-.TP
+--e <\fIregex\fR>, -regex <\fIregex\fR>
+-.br
+-Finds dependencies in packages matching the specified regular expression pattern\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
+-.TP
+--include <\fIregex\fR>
+-.br
+-Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
+-.TP
+--jdkinternals
+-.br
+-Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
+-
+-\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
+-.TP
+--P, -profile
+-.br
+-Shows profile or the file containing a package\&.
+-.TP
+--apionly
+-.br
+-Restricts analysis to APIs, for example, dependences from the signature of \f3public\fR and \f3protected\fR members of public classes including field type, method parameter types, returned type, and checked exception types\&.
+-.TP
+--R, -recursive
+-.br
+-Recursively traverses all dependencies\&.
+-.TP
+--version
+-.br
+-Prints version information\&.
+-.TP
+--h, -?, -help
+-.br
+-Prints help message for \f3jdeps\fR\&.
+-.SH EXAMPLES
+-Analyzing the dependencies of Notepad\&.jar\&.
+-.sp
+-.nf
+-\f3$ jdeps demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 <unnamed> (Notepad\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt \fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt\&.event \fP
+-.fi
+-.nf
+-\f3 \-> java\&.beans \fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.net \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.logging \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.border \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.event \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.text \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.tree \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.undo \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use -P or -profile option to show on which profile that Notepad depends\&.
+-.sp
+-.nf
+-\f3$ jdeps \-profile demo/jfc/Notepad/Notepad\&.jar \fP
+-.fi
+-.nf
+-\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE)\fP
+-.fi
+-.nf
+-\f3 <unnamed> (Notepad\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt\&.event Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.beans Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.net compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.util compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.logging compact1\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.border Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.event Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.text Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.tree Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.undo Full JRE\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Analyzing the immediate dependencies of a specific class in a given classpath, for example the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class in the tools\&.jar file\&.
+-.sp
+-.nf
+-\f3$ jdeps \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use the \f3-verbose:class\fR option to find class-level dependencies or use the \f3-v\fR or \f3-verbose\fR option to include dependencies from the same JAR file\&.
+-.sp
+-.nf
+-\f3$ jdeps \-verbose:class \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps\&.Main (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io\&.PrintWriter \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.Exception \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.Object \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.String \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.System \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use the \f3-R\fR or \f3-recursive\fR option to analyze the transitive dependencies of the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class\&.
+-.sp
+-.nf
+-\f3$ jdeps \-R \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.classfile (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.reflect \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.charset \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file\&.attribute \fP
+-.fi
+-.nf
+-\f3 \-> java\&.text \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.jar \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.zip \fP
+-.fi
+-.nf
+-\f3/usr/java/jre/lib/jce\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 javax\&.crypto (jce\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.reflect \fP
+-.fi
+-.nf
+-\f3 \-> java\&.net \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.cert \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.spec \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.concurrent \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.jar \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.zip \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.security\&.auth \fP
+-.fi
+-.nf
+-\f3 \-> sun\&.security\&.jca JDK internal API (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> sun\&.security\&.util JDK internal API (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 javax\&.crypto\&.spec (jce\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.spec \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3/usr/java/jre/lib/rt\&.jar \-> /usr/java/jre/lib/jce\&.jar\fP
+-.fi
+-.nf
+-\f3 java\&.security (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.crypto\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Generate dot files of the dependencies of Notepad demo\&.
+-.sp
+-.nf
+-\f3$ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3jdeps\fR will create one dot file for each given JAR file named <\fIfilename\fR>\&.dot in the dot directory specified in the \f3-dotoutput\fR option, and also a summary file named summary\&.dot that will list the dependencies among the JAR files
+-.sp
+-.nf
+-\f3$ cat dot/Notepad\&.jar\&.dot \fP
+-.fi
+-.nf
+-\f3digraph "Notepad\&.jar" {\fP
+-.fi
+-.nf
+-\f3 // Path: demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.awt";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.awt\&.event";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.beans";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.io";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.lang";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.net";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.util";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.util\&.logging";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.border";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.event";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.text";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.tree";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.undo";\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3$ cat dot/summary\&.dot\fP
+-.fi
+-.nf
+-\f3digraph "summary" {\fP
+-.fi
+-.nf
+-\f3 "Notepad\&.jar" \-> "rt\&.jar";\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javap(1)
++
++.SH NAME
++jdeps \- Java class dependency analyzer\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjdeps\fR [\fIoptions\fR] \fIclasses\fR \&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIclasses\fR
++Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
++.SH DESCRIPTION
++The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
++.SH OPTIONS
++.TP
++-dotoutput <\fIdir\fR>
++.br
++Destination directory for DOT file output\&. If specified, \f3jdeps\fR will generate one dot file per each analyzed archive named <\fIarchive-file-name\fR>\&.dot listing the dependencies, and also a summary file named summary\&.dot listing the dependencies among the archives\&.
++.TP
++-s, -summary
++.br
++Prints dependency summary only\&.
++.TP
++-v, -verbose
++.br
++Prints all class-level dependencies\&.
++.TP
++-verbose:package
++.br
++Prints package-level dependencies excluding dependencies within the same archive\&.
++.TP
++-verbose:class
++.br
++Prints class-level dependencies excluding dependencies within the same archive\&.
++.TP
++-cp <\fIpath\fR>, -classpath <\fIpath\fR>
++.br
++Specifies where to find class files\&.
++
++See also Setting the Class Path\&.
++.TP
++-p <\fIpkg name\fR>, -package <\fIpkg name\fR>
++.br
++Finds dependencies in the specified package\&. You can specify this option multiple times for different packages\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
++.TP
++-e <\fIregex\fR>, -regex <\fIregex\fR>
++.br
++Finds dependencies in packages matching the specified regular expression pattern\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
++.TP
++-include <\fIregex\fR>
++.br
++Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
++.TP
++-jdkinternals
++.br
++Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
++
++\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
++.TP
++-P, -profile
++.br
++Shows profile or the file containing a package\&.
++.TP
++-apionly
++.br
++Restricts analysis to APIs, for example, dependences from the signature of \f3public\fR and \f3protected\fR members of public classes including field type, method parameter types, returned type, and checked exception types\&.
++.TP
++-R, -recursive
++.br
++Recursively traverses all dependencies\&.
++.TP
++-version
++.br
++Prints version information\&.
++.TP
++-h, -?, -help
++.br
++Prints help message for \f3jdeps\fR\&.
++.SH EXAMPLES
++Analyzing the dependencies of Notepad\&.jar\&.
++.sp
++.nf
++\f3$ jdeps demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 <unnamed> (Notepad\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.awt \fP
++.fi
++.nf
++\f3 \-> java\&.awt\&.event \fP
++.fi
++.nf
++\f3 \-> java\&.beans \fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.net \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.logging \fP
++.fi
++.nf
++\f3 \-> javax\&.swing \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.border \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.event \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.text \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.tree \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.undo \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use -P or -profile option to show on which profile that Notepad depends\&.
++.sp
++.nf
++\f3$ jdeps \-profile demo/jfc/Notepad/Notepad\&.jar \fP
++.fi
++.nf
++\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE)\fP
++.fi
++.nf
++\f3 <unnamed> (Notepad\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.awt Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.awt\&.event Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.beans Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.io compact1\fP
++.fi
++.nf
++\f3 \-> java\&.lang compact1\fP
++.fi
++.nf
++\f3 \-> java\&.net compact1\fP
++.fi
++.nf
++\f3 \-> java\&.util compact1\fP
++.fi
++.nf
++\f3 \-> java\&.util\&.logging compact1\fP
++.fi
++.nf
++\f3 \-> javax\&.swing Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.border Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.event Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.text Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.tree Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.undo Full JRE\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Analyzing the immediate dependencies of a specific class in a given classpath, for example the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class in the tools\&.jar file\&.
++.sp
++.nf
++\f3$ jdeps \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use the \f3-verbose:class\fR option to find class-level dependencies or use the \f3-v\fR or \f3-verbose\fR option to include dependencies from the same JAR file\&.
++.sp
++.nf
++\f3$ jdeps \-verbose:class \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps\&.Main (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io\&.PrintWriter \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.Exception \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.Object \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.String \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.System \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use the \f3-R\fR or \f3-recursive\fR option to analyze the transitive dependencies of the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class\&.
++.sp
++.nf
++\f3$ jdeps \-R \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.classfile (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.reflect \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.charset \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file\&.attribute \fP
++.fi
++.nf
++\f3 \-> java\&.text \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.jar \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.zip \fP
++.fi
++.nf
++\f3/usr/java/jre/lib/jce\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 javax\&.crypto (jce\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.reflect \fP
++.fi
++.nf
++\f3 \-> java\&.net \fP
++.fi
++.nf
++\f3 \-> java\&.nio \fP
++.fi
++.nf
++\f3 \-> java\&.security \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.cert \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.spec \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.concurrent \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.jar \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.zip \fP
++.fi
++.nf
++\f3 \-> javax\&.security\&.auth \fP
++.fi
++.nf
++\f3 \-> sun\&.security\&.jca JDK internal API (rt\&.jar)\fP
++.fi
++.nf
++\f3 \-> sun\&.security\&.util JDK internal API (rt\&.jar)\fP
++.fi
++.nf
++\f3 javax\&.crypto\&.spec (jce\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.spec \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3/usr/java/jre/lib/rt\&.jar \-> /usr/java/jre/lib/jce\&.jar\fP
++.fi
++.nf
++\f3 java\&.security (rt\&.jar)\fP
++.fi
++.nf
++\f3 \-> javax\&.crypto\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Generate dot files of the dependencies of Notepad demo\&.
++.sp
++.nf
++\f3$ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3jdeps\fR will create one dot file for each given JAR file named <\fIfilename\fR>\&.dot in the dot directory specified in the \f3-dotoutput\fR option, and also a summary file named summary\&.dot that will list the dependencies among the JAR files
++.sp
++.nf
++\f3$ cat dot/Notepad\&.jar\&.dot \fP
++.fi
++.nf
++\f3digraph "Notepad\&.jar" {\fP
++.fi
++.nf
++\f3 // Path: demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.awt";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.awt\&.event";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.beans";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.io";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.lang";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.net";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.util";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.util\&.logging";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.border";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.event";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.text";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.tree";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.undo";\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3$ cat dot/summary\&.dot\fP
++.fi
++.nf
++\f3digraph "summary" {\fP
++.fi
++.nf
++\f3 "Notepad\&.jar" \-> "rt\&.jar";\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javap(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jhat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jhat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2006, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jhat.1
+-.\"
+-.if n .pl 99999
+-.TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jhat.1
++.\"
++.if n .pl 99999
++.TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,89 +47,89 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIheap-dump-file\fR
+-Java binary heap dump file to be browsed\&. For a dump file that contains multiple heap dumps, you can specify which dump in the file by appending \f3#<number>\fR to the file name, for example, \f3myfile\&.hprof#3\fR\&.
+-.SH DESCRIPTION
+-The \f3jhat\fR command parses a Java heap dump file and starts a web server\&. The \f3jhat\fR command lets you to browse heap dumps with your favorite web browser\&. The \f3jhat\fR command supports predesigned queries such as show all instances of a known class \f3MyClass\fR, and Object Query Language (OQL)\&. OQL is similar to SQL, except for querying heap dumps\&. Help on OQL is available from the OQL help page shown by the \f3jhat\fR command\&. With the default port, OQL help is available at http://localhost:7000/oqlhelp/
+-.PP
+-There are several ways to generate a Java heap dump:
+-.TP 0.2i
+-\(bu
+-Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
+-.TP 0.2i
+-\(bu
+-Use the \f3jconsole\fR option to obtain a heap dump through \f3HotSpotDiagnosticMXBean\fR at runtime\&. See jconsole(1) and the \f3HotSpotDiagnosticMXBean\fR interface description at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html
+-.TP 0.2i
+-\(bu
+-Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&.
+-.TP 0.2i
+-\(bu
+-Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
+-.SH OPTIONS
+-.TP
+--stack false|true
+-.br
+-Turns off tracking object allocation call stack\&. If allocation site information is not available in the heap dump, then you have to set this flag to \f3false\fR\&. The default is \f3true\fR\&.
+-.TP
+--refs false|true
+-.br
+-Turns off tracking of references to objects\&. Default is \f3true\fR\&. By default, back pointers, which are objects that point to a specified object such as referrers or incoming references, are calculated for all objects in the heap\&.
+-.TP
+--port \fIport-number\fR
+-.br
+-Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
+-.TP
+--exclude \fIexclude-file\fR
+-.br
+-Specifies a file that lists data members that should be excluded from the reachable objects query\&. For example, if the file lists \f3java\&.lang\&.String\&.value\fR, then, then whenever the list of objects that are reachable from a specific object \f3o\fR are calculated, reference paths that involve \f3java\&.lang\&.String\&.value\fR field are not considered\&.
+-.TP
+--baseline \fIexclude-file\fR
+-.br
+-Specifies a baseline heap dump\&. Objects in both heap dumps with the same object ID are marked as not being new\&. Other objects are marked as new\&. This is useful for comparing two different heap dumps\&.
+-.TP
+--debug \fIint\fR
+-.br
+-Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&.
+-.TP
+--version
+-.br
+-Reports the release number and exits
+-.TP
+--h
+-.br
+-Dsiplays a help message and exits\&.
+-.TP
+--help
+-.br
+-Displays a help message and exits\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the Java Virtual Machine on which the \f3jhat\fR command is running\&. For example, \f3-J-Xmx512m\fR to use a maximum heap size of 512 MB\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jmap(1)
+-.TP 0.2i
+-\(bu
+-jconsole(1)
+-.TP 0.2i
+-\(bu
+-HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
++
++.SH NAME
++jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIheap-dump-file\fR
++Java binary heap dump file to be browsed\&. For a dump file that contains multiple heap dumps, you can specify which dump in the file by appending \f3#<number>\fR to the file name, for example, \f3myfile\&.hprof#3\fR\&.
++.SH DESCRIPTION
++The \f3jhat\fR command parses a Java heap dump file and starts a web server\&. The \f3jhat\fR command lets you to browse heap dumps with your favorite web browser\&. The \f3jhat\fR command supports predesigned queries such as show all instances of a known class \f3MyClass\fR, and Object Query Language (OQL)\&. OQL is similar to SQL, except for querying heap dumps\&. Help on OQL is available from the OQL help page shown by the \f3jhat\fR command\&. With the default port, OQL help is available at http://localhost:7000/oqlhelp/
++.PP
++There are several ways to generate a Java heap dump:
++.TP 0.2i
++\(bu
++Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
++.TP 0.2i
++\(bu
++Use the \f3jconsole\fR option to obtain a heap dump through \f3HotSpotDiagnosticMXBean\fR at runtime\&. See jconsole(1) and the \f3HotSpotDiagnosticMXBean\fR interface description at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html
++.TP 0.2i
++\(bu
++Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&.
++.TP 0.2i
++\(bu
++Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
++.SH OPTIONS
++.TP
++-stack false|true
++.br
++Turns off tracking object allocation call stack\&. If allocation site information is not available in the heap dump, then you have to set this flag to \f3false\fR\&. The default is \f3true\fR\&.
++.TP
++-refs false|true
++.br
++Turns off tracking of references to objects\&. Default is \f3true\fR\&. By default, back pointers, which are objects that point to a specified object such as referrers or incoming references, are calculated for all objects in the heap\&.
++.TP
++-port \fIport-number\fR
++.br
++Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
++.TP
++-exclude \fIexclude-file\fR
++.br
++Specifies a file that lists data members that should be excluded from the reachable objects query\&. For example, if the file lists \f3java\&.lang\&.String\&.value\fR, then, then whenever the list of objects that are reachable from a specific object \f3o\fR are calculated, reference paths that involve \f3java\&.lang\&.String\&.value\fR field are not considered\&.
++.TP
++-baseline \fIexclude-file\fR
++.br
++Specifies a baseline heap dump\&. Objects in both heap dumps with the same object ID are marked as not being new\&. Other objects are marked as new\&. This is useful for comparing two different heap dumps\&.
++.TP
++-debug \fIint\fR
++.br
++Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&.
++.TP
++-version
++.br
++Reports the release number and exits
++.TP
++-h
++.br
++Dsiplays a help message and exits\&.
++.TP
++-help
++.br
++Displays a help message and exits\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the Java Virtual Machine on which the \f3jhat\fR command is running\&. For example, \f3-J-Xmx512m\fR to use a maximum heap size of 512 MB\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jmap(1)
++.TP 0.2i
++\(bu
++jconsole(1)
++.TP 0.2i
++\(bu
++HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jinfo.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jinfo.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jinfo.1
+-.\"
+-.if n .pl 99999
+-.TH jinfo 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jinfo.1
++.\"
++.if n .pl 99999
++.TH jinfo 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,85 +47,85 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jinfo \- Generates configuration information\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjinfo\fR [ \fIoption\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjinfo\fR [ \fIoption \fR] \fIexecutable core\fR
+-.fi
+-.nf
+-
+-\fBjinfo\fR [ \fIoption \fR] \fI[ servier\-id ] remote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoption\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the configuration information is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the configuration information is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jinfo\fR command prints Java configuration information for a specified Java process or core file or a remote debug server\&. The configuration information includes Java system properties and Java Virtual Machine (JVM) command-line flags\&. If the specified process is running on a 64-bit JVM, then you might need to specify the \f3-J-d64\fR option, for example: \f3jinfo\fR\f3-J-d64 -sysprops pid\fR\&.
+-.PP
+-This utility is unsupported and might not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of the jvm\&.dll that is used by the target process or the location from which the crash dump file was produced\&. For example, \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR \&.
+-.SH OPTIONS
+-.TP
+-no-option
+-Prints both command-line flags and system property name-value pairs\&.
+-.TP
+--flag \fIname\fR
+-.br
+-Prints the name and value of the specified command-line flag\&.
+-.TP
+--flag \fI[+|-]name\fR
+-.br
+-enables or disables the specified Boolean command-line flag\&.
+-.TP
+--flag \fIname=value\fR
+-.br
+-Sets the specified command-line flag to the specified value\&.
+-.TP
+--flags
+-.br
+-Prints command-line flags passed to the JVM\&.
+-.TP
+--sysprops
+-.br
+-Prints Java system properties as name-value pairs\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jinfo \- Generates configuration information\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjinfo\fR [ \fIoption\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjinfo\fR [ \fIoption \fR] \fIexecutable core\fR
++.fi
++.nf
++
++\fBjinfo\fR [ \fIoption \fR] \fI[ servier\-id ] remote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoption\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the configuration information is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the configuration information is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jinfo\fR command prints Java configuration information for a specified Java process or core file or a remote debug server\&. The configuration information includes Java system properties and Java Virtual Machine (JVM) command-line flags\&. If the specified process is running on a 64-bit JVM, then you might need to specify the \f3-J-d64\fR option, for example: \f3jinfo\fR\f3-J-d64 -sysprops pid\fR\&.
++.PP
++This utility is unsupported and might not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of the jvm\&.dll that is used by the target process or the location from which the crash dump file was produced\&. For example, \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR \&.
++.SH OPTIONS
++.TP
++no-option
++Prints both command-line flags and system property name-value pairs\&.
++.TP
++-flag \fIname\fR
++.br
++Prints the name and value of the specified command-line flag\&.
++.TP
++-flag \fI[+|-]name\fR
++.br
++enables or disables the specified Boolean command-line flag\&.
++.TP
++-flag \fIname=value\fR
++.br
++Sets the specified command-line flag to the specified value\&.
++.TP
++-flags
++.br
++Prints command-line flags passed to the JVM\&.
++.TP
++-sysprops
++.br
++Prints Java system properties as name-value pairs\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jjs.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jjs.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/bsd/doc/man/jmap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jmap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jmap.1
+-.\"
+-.if n .pl 99999
+-.TH jmap 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jmap.1
++.\"
++.if n .pl 99999
++.TH jmap 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,96 +47,96 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jmap \- Prints shared object memory maps or heap memory details for a process, core file, or remote debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
+-.fi
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] [ \fIpid\fR ] \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the memory map is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the memory map is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jmap\fR command prints shared object memory maps or heap memory details of a specified process, core file, or remote debug server\&. If the specified process is running on a 64-bit Java Virtual Machine (JVM), then you might need to specify the \f3-J-d64\fR option, for example: \f3jmap\fR\f3-J-d64 -heap pid\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and might not be available in future releases of the JDK\&. On Windows Systems where the \f3dbgeng\&.dll\fR file is not present, Debugging Tools For Windows must be installed to make these tools work\&. The \f3PATH\fR environment variable should contain the location of the \f3jvm\&.dll\fR file that is used by the target process or the location from which the crash dump file was produced, for example: \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
+-.SH OPTIONS
+-.TP
+-<no option>
+-When no option is used, the \f3jmap\fR command prints shared object mappings\&. For each shared object loaded in the target JVM, the start address, size of the mapping, and the full path of the shared object file are printed\&. This behavior is similar to the Oracle Solaris \f3pmap\fR utility\&.
+-.TP
+--dump:[live,] format=b, file=\fIfilename\fR
+-.br
+-Dumps the Java heap in \f3hprof\fR binary format to \f3filename\fR\&. The \f3live\fR suboption is optional, but when specified, only the active objects in the heap are dumped\&. To browse the heap dump, you can use the jhat(1) command to read the generated file\&.
+-.TP
+--finalizerinfo
+-.br
+-Prints information about objects that are awaiting finalization\&.
+-.TP
+--heap
+-.br
+-Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage\&. In addition, the number and size of interned Strings are printed\&.
+-.TP
+--histo[:live]
+-.br
+-Prints a histogram of the heap\&. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed\&. The JVM internal class names are printed with an asterisk (*) prefix\&. If the \f3live\fR suboption is specified, then only active objects are counted\&.
+-.TP
+--clstats
+-.br
+-Prints class loader wise statistics of Java heap\&. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed\&.
+-.TP
+--F
+-.br
+-Force\&. Use this option with the \f3jmap -dump\fR or \f3jmap -histo\fR option when the pid does not respond\&. The \f3live\fR suboption is not supported in this mode\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the Java Virtual Machine where the \f3jmap\fR command is running\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jhat(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jmap \- Prints shared object memory maps or heap memory details for a process, core file, or remote debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
++.fi
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] [ \fIpid\fR ] \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the memory map is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the memory map is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jmap\fR command prints shared object memory maps or heap memory details of a specified process, core file, or remote debug server\&. If the specified process is running on a 64-bit Java Virtual Machine (JVM), then you might need to specify the \f3-J-d64\fR option, for example: \f3jmap\fR\f3-J-d64 -heap pid\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and might not be available in future releases of the JDK\&. On Windows Systems where the \f3dbgeng\&.dll\fR file is not present, Debugging Tools For Windows must be installed to make these tools work\&. The \f3PATH\fR environment variable should contain the location of the \f3jvm\&.dll\fR file that is used by the target process or the location from which the crash dump file was produced, for example: \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
++.SH OPTIONS
++.TP
++<no option>
++When no option is used, the \f3jmap\fR command prints shared object mappings\&. For each shared object loaded in the target JVM, the start address, size of the mapping, and the full path of the shared object file are printed\&. This behavior is similar to the Oracle Solaris \f3pmap\fR utility\&.
++.TP
++-dump:[live,] format=b, file=\fIfilename\fR
++.br
++Dumps the Java heap in \f3hprof\fR binary format to \f3filename\fR\&. The \f3live\fR suboption is optional, but when specified, only the active objects in the heap are dumped\&. To browse the heap dump, you can use the jhat(1) command to read the generated file\&.
++.TP
++-finalizerinfo
++.br
++Prints information about objects that are awaiting finalization\&.
++.TP
++-heap
++.br
++Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage\&. In addition, the number and size of interned Strings are printed\&.
++.TP
++-histo[:live]
++.br
++Prints a histogram of the heap\&. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed\&. The JVM internal class names are printed with an asterisk (*) prefix\&. If the \f3live\fR suboption is specified, then only active objects are counted\&.
++.TP
++-clstats
++.br
++Prints class loader wise statistics of Java heap\&. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed\&.
++.TP
++-F
++.br
++Force\&. Use this option with the \f3jmap -dump\fR or \f3jmap -histo\fR option when the pid does not respond\&. The \f3live\fR suboption is not supported in this mode\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the Java Virtual Machine where the \f3jmap\fR command is running\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jhat(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Monitoring Tools
+-.\" Title: jps.1
+-.\"
+-.if n .pl 99999
+-.TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Monitoring Tools
++.\" Title: jps.1
++.\"
++.if n .pl 99999
++.TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,157 +47,157 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIhostid\fR
+-The identifier of the host for which the process report should be generated\&. The \f3hostid\fR can include optional components that indicate the communications protocol, port number, and other implementation specific data\&. See Host Identifier\&.
+-.SH DESCRIPTION
+-The \f3jps\fR command lists the instrumented Java HotSpot VMs on the target system\&. The command is limited to reporting information on JVMs for which it has the access permissions\&.
+-.PP
+-If the \f3jps\fR command is run without specifying a \f3hostid\fR, then it searches for instrumented JVMs on the local host\&. If started with a \f3hostid\fR, then it searches for JVMs on the indicated host, using the specified protocol and port\&. A \f3jstatd\fR process is assumed to be running on the target host\&.
+-.PP
+-The \f3jps\fR command reports the local JVM identifier, or \f3lvmid\fR, for each instrumented JVM found on the target system\&. The \f3lvmid\fR is typically, but not necessarily, the operating system\&'s process identifier for the JVM process\&. With no options, \f3jps\fR lists each Java application\&'s \f3lvmid\fR followed by the short form of the application\&'s class name or jar file name\&. The short form of the class name or JAR file name omits the class\&'s package information or the JAR files path information\&.
+-.PP
+-The \f3jps\fR command uses the Java launcher to find the class name and arguments passed to the main method\&. If the target JVM is started with a custom launcher, then the class or JAR file name and the arguments to the \f3main\fR method are not available\&. In this case, the \f3jps\fR command outputs the string \f3Unknown\fR for the class name or JAR file name and for the arguments to the \f3main\fR method\&.
+-.PP
+-The list of JVMs produced by the \f3jps\fR command can be limited by the permissions granted to the principal running the command\&. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms\&.
+-.SH OPTIONS
+-The \f3jps\fR command supports a number of options that modify the output of the command\&. These options are subject to change or removal in the future\&.
+-.TP
+--q
+-.br
+-Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main\fR method, producing only a list of local JVM identifiers\&.
+-.TP
+--m
+-.br
+-Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
+-.TP
+--l
+-.br
+-Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
+-.TP
+--v
+-.br
+-Displays the arguments passed to the JVM\&.
+-.TP
+--V
+-.br
+-Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local JVM identifiers\&.
+-.TP
+--J\f3option\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH HOST\ IDENTIFIER
+-The host identifier, or \f3hostid\fR is a string that indicates the target system\&. The syntax of the \f3hostid\fR string corresponds to the syntax of a URI:
+-.sp
+-.nf
+-\f3[protocol:][[//]hostname][:port][/servername]\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.TP
+-\fIprotocol\fR
+-The communications protocol\&. If the \f3protocol\fR is omitted and a \f3hostname\fR is not specified, then the default protocol is a platform-specific, optimized, local protocol\&. If the protocol is omitted and a host name is specified, then the default protocol is \f3rmi\fR\&.
+-.TP
+-hostname
+-A hostname or IP address that indicates the target host\&. If you omit the \f3hostname\fR parameter, then the target host is the local host\&.
+-.TP
+-port
+-The default port for communicating with the remote server\&. If the \f3hostname\fR parameter is omitted or the \f3protocol\fR parameter specifies an optimized, local protocol, then the \f3port\fR parameter is ignored\&. Otherwise, treatment of the \f3port\fR parameter is implementation specific\&. For the default \f3rmi\fR protocol, the \f3port\fR parameter indicates the port number for the rmiregistry on the remote host\&. If the \f3port\fR parameter is omitted, and the \f3protocol\fR parameter indicates \f3rmi\fR, then the default rmiregistry port (1099) is used\&.
+-.TP
+-servername
+-The treatment of this parameter depends on the implementation\&. For the optimized, local protocol, this field is ignored\&. For the \f3rmi\fR protocol, this parameter is a string that represents the name of the RMI remote object on the remote host\&. See the \f3jstatd\fR command \f3-n\fRoption for more information\&.
+-.SH OUTPUT\ FORMAT
+-The output of the \f3jps\fR command follows the following pattern:
+-.sp
+-.nf
+-\f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-All output tokens are separated by white space\&. An \f3arg\fR value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters\&.
+-.PP
+-\fINote:\fR It is recommended that you do not write scripts to parse \f3jps\fR output because the format might change in future releases\&. If you write scripts that parse \f3jps\fR output, then expect to modify them for future releases of this tool\&.
+-.SH EXAMPLES
+-This section provides examples of the \f3jps\fR command\&.
+-.PP
+-List the instrumented JVMs on the local host:
+-.sp
+-.nf
+-\f3jps\fP
+-.fi
+-.nf
+-\f318027 Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f318032 jps\fP
+-.fi
+-.nf
+-\f318005 jstat\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example lists the instrumented JVMs on a remote host\&. This example assumes that the \f3jstat\fR server and either the its internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099)\&. It also assumes that the local host has appropriate permissions to access the remote host\&. This example also includes the \f3-l\fR option to output the long form of the class names or JAR file names\&.
+-.sp
+-.nf
+-\f3jps \-l remote\&.domain\fP
+-.fi
+-.nf
+-\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f32857 sun\&.tools\&.jstatd\&.jstatd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example lists the instrumented JVMs on a remote host with a non-default port for the RMI registry\&. This example assumes that the \f3jstatd\fR server, with an internal RMI registry bound to port 2002, is running on the remote host\&. This example also uses the \f3-m\fR option to include the arguments passed to the \f3main\fR method of each of the listed Java applications\&.
+-.sp
+-.nf
+-\f3jps \-m remote\&.domain:2002\fP
+-.fi
+-.nf
+-\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jstat(1)
+-.TP 0.2i
+-\(bu
+-jstatd(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIhostid\fR
++The identifier of the host for which the process report should be generated\&. The \f3hostid\fR can include optional components that indicate the communications protocol, port number, and other implementation specific data\&. See Host Identifier\&.
++.SH DESCRIPTION
++The \f3jps\fR command lists the instrumented Java HotSpot VMs on the target system\&. The command is limited to reporting information on JVMs for which it has the access permissions\&.
++.PP
++If the \f3jps\fR command is run without specifying a \f3hostid\fR, then it searches for instrumented JVMs on the local host\&. If started with a \f3hostid\fR, then it searches for JVMs on the indicated host, using the specified protocol and port\&. A \f3jstatd\fR process is assumed to be running on the target host\&.
++.PP
++The \f3jps\fR command reports the local JVM identifier, or \f3lvmid\fR, for each instrumented JVM found on the target system\&. The \f3lvmid\fR is typically, but not necessarily, the operating system\&'s process identifier for the JVM process\&. With no options, \f3jps\fR lists each Java application\&'s \f3lvmid\fR followed by the short form of the application\&'s class name or jar file name\&. The short form of the class name or JAR file name omits the class\&'s package information or the JAR files path information\&.
++.PP
++The \f3jps\fR command uses the Java launcher to find the class name and arguments passed to the main method\&. If the target JVM is started with a custom launcher, then the class or JAR file name and the arguments to the \f3main\fR method are not available\&. In this case, the \f3jps\fR command outputs the string \f3Unknown\fR for the class name or JAR file name and for the arguments to the \f3main\fR method\&.
++.PP
++The list of JVMs produced by the \f3jps\fR command can be limited by the permissions granted to the principal running the command\&. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms\&.
++.SH OPTIONS
++The \f3jps\fR command supports a number of options that modify the output of the command\&. These options are subject to change or removal in the future\&.
++.TP
++-q
++.br
++Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main\fR method, producing only a list of local JVM identifiers\&.
++.TP
++-m
++.br
++Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
++.TP
++-l
++.br
++Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
++.TP
++-v
++.br
++Displays the arguments passed to the JVM\&.
++.TP
++-V
++.br
++Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local JVM identifiers\&.
++.TP
++-J\f3option\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH HOST\ IDENTIFIER
++The host identifier, or \f3hostid\fR is a string that indicates the target system\&. The syntax of the \f3hostid\fR string corresponds to the syntax of a URI:
++.sp
++.nf
++\f3[protocol:][[//]hostname][:port][/servername]\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.TP
++\fIprotocol\fR
++The communications protocol\&. If the \f3protocol\fR is omitted and a \f3hostname\fR is not specified, then the default protocol is a platform-specific, optimized, local protocol\&. If the protocol is omitted and a host name is specified, then the default protocol is \f3rmi\fR\&.
++.TP
++hostname
++A hostname or IP address that indicates the target host\&. If you omit the \f3hostname\fR parameter, then the target host is the local host\&.
++.TP
++port
++The default port for communicating with the remote server\&. If the \f3hostname\fR parameter is omitted or the \f3protocol\fR parameter specifies an optimized, local protocol, then the \f3port\fR parameter is ignored\&. Otherwise, treatment of the \f3port\fR parameter is implementation specific\&. For the default \f3rmi\fR protocol, the \f3port\fR parameter indicates the port number for the rmiregistry on the remote host\&. If the \f3port\fR parameter is omitted, and the \f3protocol\fR parameter indicates \f3rmi\fR, then the default rmiregistry port (1099) is used\&.
++.TP
++servername
++The treatment of this parameter depends on the implementation\&. For the optimized, local protocol, this field is ignored\&. For the \f3rmi\fR protocol, this parameter is a string that represents the name of the RMI remote object on the remote host\&. See the \f3jstatd\fR command \f3-n\fRoption for more information\&.
++.SH OUTPUT\ FORMAT
++The output of the \f3jps\fR command follows the following pattern:
++.sp
++.nf
++\f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++All output tokens are separated by white space\&. An \f3arg\fR value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters\&.
++.PP
++\fINote:\fR It is recommended that you do not write scripts to parse \f3jps\fR output because the format might change in future releases\&. If you write scripts that parse \f3jps\fR output, then expect to modify them for future releases of this tool\&.
++.SH EXAMPLES
++This section provides examples of the \f3jps\fR command\&.
++.PP
++List the instrumented JVMs on the local host:
++.sp
++.nf
++\f3jps\fP
++.fi
++.nf
++\f318027 Java2Demo\&.JAR\fP
++.fi
++.nf
++\f318032 jps\fP
++.fi
++.nf
++\f318005 jstat\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example lists the instrumented JVMs on a remote host\&. This example assumes that the \f3jstat\fR server and either the its internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099)\&. It also assumes that the local host has appropriate permissions to access the remote host\&. This example also includes the \f3-l\fR option to output the long form of the class names or JAR file names\&.
++.sp
++.nf
++\f3jps \-l remote\&.domain\fP
++.fi
++.nf
++\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
++.fi
++.nf
++\f32857 sun\&.tools\&.jstatd\&.jstatd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example lists the instrumented JVMs on a remote host with a non-default port for the RMI registry\&. This example assumes that the \f3jstatd\fR server, with an internal RMI registry bound to port 2002, is running on the remote host\&. This example also uses the \f3-m\fR option to include the arguments passed to the \f3main\fR method of each of the listed Java applications\&.
++.sp
++.nf
++\f3jps \-m remote\&.domain:2002\fP
++.fi
++.nf
++\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
++.fi
++.nf
++\f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jstat(1)
++.TP 0.2i
++\(bu
++jstatd(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jrunscript.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jrunscript.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2006, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Scripting Tools
+-.\" Title: jrunscript.1
+-.\"
+-.if n .pl 99999
+-.TH jrunscript 1 "21 November 2013" "JDK 8" "Scripting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Scripting Tools
++.\" Title: jrunscript.1
++.\"
++.if n .pl 99999
++.TH jrunscript 1 "21 November 2013" "JDK 8" "Scripting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,148 +47,148 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jrunscript \- Runs a command-line script shell that supports interactive and batch modes\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjrunscript\fR [\fIoptions\fR] [\fIarguments\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIarguments\fR
+-Arguments, when used, follow immediately after options or the command name\&. See Arguments\&.
+-.SH DESCRIPTION
+-The \f3jrunscript\fR command is a language-independent command-line script shell\&. The \f3jrunscript\fR command supports both an interactive (read-eval-print) mode and a batch (\f3-f\fR option) mode of script execution\&. By default, JavaScript is the language used, but the \f3-l\fR option can be used to specify a different language\&. By using Java to scripting language communication, the \f3jrunscript\fR command supports an exploratory programming style\&.
+-.SH OPTIONS
+-.TP
+--classpath \fIpath\fR
+-.br
+-Indicate where any class files are that the script needs to access\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-Same as \f3-classpath\fR\f3path\fR\&.
+-.TP
+--D\fIname\fR=\fIvalue\fR
+-.br
+-Sets a Java system property\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR directly to the Java Virtual Machine where the \f3jrunscript\fR command is running\&.
+-.TP
+--I \fIlanguage\fR
+-.br
+-Uses the specified scripting language\&. By default, JavaScript is used\&. To use other scripting languages, you must specify the corresponding script engine\&'s JAR file with the \f3-cp\fR or \f3-classpath\fR option\&.
+-.TP
+--e \fIscript\fR
+-.br
+-Evaluates the specified script\&. This option can be used to run one-line scripts that are specified completely on the command line\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Specifies the character encoding used to read script files\&.
+-.TP
+--f \fIscript-file\fR
+-.br
+-Evaluates the specified script file (batch mode)\&.
+-.TP
+--f -
+-.br
+-Reads and evaluates a script from standard input (interactive mode)\&.
+-.TP
+--help
+-.br
+-Displays a help message and exits\&.
+-.TP
+--?
+-.br
+-Displays a help message and exits\&.
+-.TP
+--q
+-.br
+-Lists all script engines available and exits\&.
+-.SH ARGUMENTS
+-If arguments are present and if no \f3-e\fR or \f3-f\fR option is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script\&. If arguments and \f3-e\fR or the \f3-f\fR option are used, then all arguments are passed to the script\&. If arguments, \f3-e\fR and \f3-f\fR are missing, then interactive mode is used\&. Script arguments are available to a script in an engine variable named \f3arguments\fR of type \f3String\fR array\&.
+-.SH EXAMPLES
+-.SS EXECUTE\ INLINE\ SCRIPTS
+-.sp
+-.nf
+-\f3jrunscript \-e "print(\&'hello world\&')"\fP
+-.fi
+-.nf
+-\f3jrunscript \-e "cat(\&'http://www\&.example\&.com\&')"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS USE\ SPECIFIED\ LANGUAGE\ AND\ EVALUATE\ THE\ SCRIPT\ FILE
+-.sp
+-.nf
+-\f3jrunscript \-l js \-f test\&.js\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS INTERACTIVE\ MODE
+-.sp
+-.nf
+-\f3jrunscript\fP
+-.fi
+-.nf
+-\f3js> print(\&'Hello World\en\&');\fP
+-.fi
+-.nf
+-\f3Hello World\fP
+-.fi
+-.nf
+-\f3js> 34 + 55\fP
+-.fi
+-.nf
+-\f389\&.0\fP
+-.fi
+-.nf
+-\f3js> t = new java\&.lang\&.Thread(function() { print(\&'Hello World\en\&'); })\fP
+-.fi
+-.nf
+-\f3Thread[Thread\-0,5,main]\fP
+-.fi
+-.nf
+-\f3js> t\&.start()\fP
+-.fi
+-.nf
+-\f3js> Hello World\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3js>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS RUN\ SCRIPT\ FILE\ WITH\ SCRIPT\ ARGUMENTS
+-The test\&.js file is the script file\&. The \f3arg1\fR, \f3arg2\fR and \f3arg3\fR arguments are passed to the script\&. The script can access these arguments with an arguments array\&.
+-.sp
+-.nf
+-\f3jrunscript test\&.js arg1 arg2 arg3\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-If JavaScript is used, then before it evaluates a user defined script, the \f3jrunscript\fR command initializes certain built-in functions and objects\&. These JavaScript built-ins are documented in JsDoc-Toolkit at http://code\&.google\&.com/p/jsdoc-toolkit/
++
++.SH NAME
++jrunscript \- Runs a command-line script shell that supports interactive and batch modes\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjrunscript\fR [\fIoptions\fR] [\fIarguments\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIarguments\fR
++Arguments, when used, follow immediately after options or the command name\&. See Arguments\&.
++.SH DESCRIPTION
++The \f3jrunscript\fR command is a language-independent command-line script shell\&. The \f3jrunscript\fR command supports both an interactive (read-eval-print) mode and a batch (\f3-f\fR option) mode of script execution\&. By default, JavaScript is the language used, but the \f3-l\fR option can be used to specify a different language\&. By using Java to scripting language communication, the \f3jrunscript\fR command supports an exploratory programming style\&.
++.SH OPTIONS
++.TP
++-classpath \fIpath\fR
++.br
++Indicate where any class files are that the script needs to access\&.
++.TP
++-cp \fIpath\fR
++.br
++Same as \f3-classpath\fR\f3path\fR\&.
++.TP
++-D\fIname\fR=\fIvalue\fR
++.br
++Sets a Java system property\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR directly to the Java Virtual Machine where the \f3jrunscript\fR command is running\&.
++.TP
++-I \fIlanguage\fR
++.br
++Uses the specified scripting language\&. By default, JavaScript is used\&. To use other scripting languages, you must specify the corresponding script engine\&'s JAR file with the \f3-cp\fR or \f3-classpath\fR option\&.
++.TP
++-e \fIscript\fR
++.br
++Evaluates the specified script\&. This option can be used to run one-line scripts that are specified completely on the command line\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Specifies the character encoding used to read script files\&.
++.TP
++-f \fIscript-file\fR
++.br
++Evaluates the specified script file (batch mode)\&.
++.TP
++-f -
++.br
++Reads and evaluates a script from standard input (interactive mode)\&.
++.TP
++-help
++.br
++Displays a help message and exits\&.
++.TP
++-?
++.br
++Displays a help message and exits\&.
++.TP
++-q
++.br
++Lists all script engines available and exits\&.
++.SH ARGUMENTS
++If arguments are present and if no \f3-e\fR or \f3-f\fR option is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script\&. If arguments and \f3-e\fR or the \f3-f\fR option are used, then all arguments are passed to the script\&. If arguments, \f3-e\fR and \f3-f\fR are missing, then interactive mode is used\&. Script arguments are available to a script in an engine variable named \f3arguments\fR of type \f3String\fR array\&.
++.SH EXAMPLES
++.SS EXECUTE\ INLINE\ SCRIPTS
++.sp
++.nf
++\f3jrunscript \-e "print(\&'hello world\&')"\fP
++.fi
++.nf
++\f3jrunscript \-e "cat(\&'http://www\&.example\&.com\&')"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS USE\ SPECIFIED\ LANGUAGE\ AND\ EVALUATE\ THE\ SCRIPT\ FILE
++.sp
++.nf
++\f3jrunscript \-l js \-f test\&.js\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS INTERACTIVE\ MODE
++.sp
++.nf
++\f3jrunscript\fP
++.fi
++.nf
++\f3js> print(\&'Hello World\en\&');\fP
++.fi
++.nf
++\f3Hello World\fP
++.fi
++.nf
++\f3js> 34 + 55\fP
++.fi
++.nf
++\f389\&.0\fP
++.fi
++.nf
++\f3js> t = new java\&.lang\&.Thread(function() { print(\&'Hello World\en\&'); })\fP
++.fi
++.nf
++\f3Thread[Thread\-0,5,main]\fP
++.fi
++.nf
++\f3js> t\&.start()\fP
++.fi
++.nf
++\f3js> Hello World\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3js>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS RUN\ SCRIPT\ FILE\ WITH\ SCRIPT\ ARGUMENTS
++The test\&.js file is the script file\&. The \f3arg1\fR, \f3arg2\fR and \f3arg3\fR arguments are passed to the script\&. The script can access these arguments with an arguments array\&.
++.sp
++.nf
++\f3jrunscript test\&.js arg1 arg2 arg3\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++If JavaScript is used, then before it evaluates a user defined script, the \f3jrunscript\fR command initializes certain built-in functions and objects\&. These JavaScript built-ins are documented in JsDoc-Toolkit at http://code\&.google\&.com/p/jsdoc-toolkit/
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jsadebugd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jsadebugd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jsadebugd.1
+-.\"
+-.if n .pl 99999
+-.TH jsadebugd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jsadebugd.1
++.\"
++.if n .pl 99999
++.TH jsadebugd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,61 +47,61 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jsadebugd \- Attaches to a Java process or core file and acts as a debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjsadebugd\fR \fIpid\fR [ \fIserver\-id\fR ]
+-.fi
+-.nf
+-
+-\fBjsadebugd\fR \fIexecutable\fR \fIcore\fR [ \fIserver\-id\fR ]
+-.fi
+-.sp
+-.TP
+-\fIpid\fR
+-The process ID of the process to which the debug server attaches\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&. At most one instance of the debug server can be attached to a single process\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file to which the debug server should attach\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID that is needed when multiple debug servers are started on the same machine\&. This ID must be used by remote clients to identify the particular debug server to which to attach\&. Within a single machine, this ID must be unique\&.
+-.SH DESCRIPTION
+-The \f3jsadebugd\fR command attaches to a Java process or core file and acts as a debug server\&. Remote clients such as \f3jstack\fR, \f3jmap\fR, and \f3jinfo\fR can attach to the server through Java Remote Method Invocation (RMI)\&. Before you start the \f3jsadebugd\fR command, start the RMI registry with the \f3rmiregistry\fR command as follows where \fI$JAVA_HOME\fR is the JDK installation directory:
+-.sp
+-.nf
+-\f3rmiregistry \-J\-Xbootclasspath/p:$JAVA_HOME/lib/sajdi\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If the RMI registry was not started, then the \f3jsadebugd\fR command starts an RMI registry in a standard (1099) port internally\&. The debug server can be stopped by sending a \f3SIGINT\fR to it\&. To send a SIGINT press \fICtrl+C\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and may or may not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of jvm\&.dll used by the target process or the location from which the crash dump file was produced\&. For example, \f3s\fR\f3et PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jinfo(1)
+-.TP 0.2i
+-\(bu
+-jmap(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jstack(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jsadebugd \- Attaches to a Java process or core file and acts as a debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjsadebugd\fR \fIpid\fR [ \fIserver\-id\fR ]
++.fi
++.nf
++
++\fBjsadebugd\fR \fIexecutable\fR \fIcore\fR [ \fIserver\-id\fR ]
++.fi
++.sp
++.TP
++\fIpid\fR
++The process ID of the process to which the debug server attaches\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&. At most one instance of the debug server can be attached to a single process\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file to which the debug server should attach\&.
++.TP
++\fIserver-id\fR
++An optional unique ID that is needed when multiple debug servers are started on the same machine\&. This ID must be used by remote clients to identify the particular debug server to which to attach\&. Within a single machine, this ID must be unique\&.
++.SH DESCRIPTION
++The \f3jsadebugd\fR command attaches to a Java process or core file and acts as a debug server\&. Remote clients such as \f3jstack\fR, \f3jmap\fR, and \f3jinfo\fR can attach to the server through Java Remote Method Invocation (RMI)\&. Before you start the \f3jsadebugd\fR command, start the RMI registry with the \f3rmiregistry\fR command as follows where \fI$JAVA_HOME\fR is the JDK installation directory:
++.sp
++.nf
++\f3rmiregistry \-J\-Xbootclasspath/p:$JAVA_HOME/lib/sajdi\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If the RMI registry was not started, then the \f3jsadebugd\fR command starts an RMI registry in a standard (1099) port internally\&. The debug server can be stopped by sending a \f3SIGINT\fR to it\&. To send a SIGINT press \fICtrl+C\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and may or may not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of jvm\&.dll used by the target process or the location from which the crash dump file was produced\&. For example, \f3s\fR\f3et PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jinfo(1)
++.TP 0.2i
++\(bu
++jmap(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jstack(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jstack.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jstack.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jstack.1
+-.\"
+-.if n .pl 99999
+-.TH jstack 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jstack.1
++.\"
++.if n .pl 99999
++.TH jstack 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jstack \- Prints Java thread stack traces for a Java process, core file, or remote debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
+-.fi
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] [ \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the stack trace is printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the stack trace is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jstack\fR command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server\&. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed\&. With the \f3-m\fR option, the \f3jstack\fR command prints both Java and native frames of all threads with the program counter (PC)\&. For each native frame, the closest native symbol to PC, when available, is printed\&. C++ mangled names are not demangled\&. To demangle C++ names, the output of this command can be piped to \f3c++filt\fR\&. When the specified process is running on a 64-bit Java Virtual Machine, you might need to specify the \f3-J-d64\fR option, for example: \f3jstack -J-d64 -m pid\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and might not be available in future release of the JDK\&. In Windows Systems where the dbgeng\&.dll file is not present, Debugging Tools For Windows must be installed so these tools work\&. The \f3PATH\fR environment variable needs to contain the location of the jvm\&.dll that is used by the target process, or the location from which the crash dump file was produced\&. For example:
+-.sp
+-.nf
+-\f3set PATH=<jdk>\ejre\ebin\eclient;%PATH%\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--F
+-.br
+-Force a stack dump when \f3jstack\fR [\f3-l\fR] \f3pid\fR does not respond\&.
+-.TP
+--l
+-.br
+-Long listing\&. Prints additional information about locks such as a list of owned \f3java\&.util\&.concurrent\fR ownable synchronizers\&. See the \f3AbstractOwnableSynchronizer\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.html
+-.TP
+--m
+-.br
+-Prints a mixed mode stack trace that has both Java and native C/C++ frames\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.SH KNOWN\ BUGS
+-In mixed mode stack trace, the \f3-m\fR option does not work with the remote debug server\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pstack(1)
+-.TP 0.2i
+-\(bu
+-C++filt(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jstack \- Prints Java thread stack traces for a Java process, core file, or remote debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
++.fi
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] [ \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the stack trace is printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the stack trace is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jstack\fR command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server\&. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed\&. With the \f3-m\fR option, the \f3jstack\fR command prints both Java and native frames of all threads with the program counter (PC)\&. For each native frame, the closest native symbol to PC, when available, is printed\&. C++ mangled names are not demangled\&. To demangle C++ names, the output of this command can be piped to \f3c++filt\fR\&. When the specified process is running on a 64-bit Java Virtual Machine, you might need to specify the \f3-J-d64\fR option, for example: \f3jstack -J-d64 -m pid\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and might not be available in future release of the JDK\&. In Windows Systems where the dbgeng\&.dll file is not present, Debugging Tools For Windows must be installed so these tools work\&. The \f3PATH\fR environment variable needs to contain the location of the jvm\&.dll that is used by the target process, or the location from which the crash dump file was produced\&. For example:
++.sp
++.nf
++\f3set PATH=<jdk>\ejre\ebin\eclient;%PATH%\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-F
++.br
++Force a stack dump when \f3jstack\fR [\f3-l\fR] \f3pid\fR does not respond\&.
++.TP
++-l
++.br
++Long listing\&. Prints additional information about locks such as a list of owned \f3java\&.util\&.concurrent\fR ownable synchronizers\&. See the \f3AbstractOwnableSynchronizer\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.html
++.TP
++-m
++.br
++Prints a mixed mode stack trace that has both Java and native C/C++ frames\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.SH KNOWN\ BUGS
++In mixed mode stack trace, the \f3-m\fR option does not work with the remote debug server\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pstack(1)
++.TP 0.2i
++\(bu
++C++filt(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/jstat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jstat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/bsd/doc/man/jstatd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/jstatd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Monitoring Tools
+-.\" Title: jstatd.1
+-.\"
+-.if n .pl 99999
+-.TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Monitoring Tools
++.\" Title: jstatd.1
++.\"
++.if n .pl 99999
++.TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,162 +47,162 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjstatd\fR [ \fIoptions\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&.
+-.PP
+-The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&.
+-.SH OPTIONS
+-.TP
+--nr
+-.br
+-Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&.
+-.TP
+--p \fIport\fR
+-.br
+-The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&.
+-.TP
+--n \fIrminame\fR
+-.br
+-Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SECURITY
+-The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&.
+-.PP
+-The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&.
+-.PP
+-The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.PP
+-The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&.
+-.sp
+-.nf
+-\f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { \fP
+-.fi
+-.nf
+-\f3 permission java\&.security\&.AllPermission;\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows:
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&.
+-.SH REMOTE\ INTERFACE
+-The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&.
+-.SH EXAMPLES
+-The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background
+-.SS INTERNAL\ RMI\ REGISTRY
+-This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS EXTERNAL\ RMI\ REGISTRY
+-This example starts a \f3jstatd\fR session with a external RMI registry\&.
+-.sp
+-.nf
+-\f3rmiregistry&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&.
+-.sp
+-.nf
+-\f3jrmiregistry 2020&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&.
+-.sp
+-.nf
+-\f3rmiregistry 2020&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
+-.fi
+-.nf
+-\f3 \-n AlternateJstatdServerName\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY
+-This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS ENABLE\ RMI\ LOGGING
+-This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3 \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jstat(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjstatd\fR [ \fIoptions\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&.
++.PP
++The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&.
++.SH OPTIONS
++.TP
++-nr
++.br
++Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&.
++.TP
++-p \fIport\fR
++.br
++The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&.
++.TP
++-n \fIrminame\fR
++.br
++Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SECURITY
++The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&.
++.PP
++The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&.
++.PP
++The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.PP
++The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&.
++.sp
++.nf
++\f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { \fP
++.fi
++.nf
++\f3 permission java\&.security\&.AllPermission;\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows:
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&.
++.SH REMOTE\ INTERFACE
++The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&.
++.SH EXAMPLES
++The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background
++.SS INTERNAL\ RMI\ REGISTRY
++This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS EXTERNAL\ RMI\ REGISTRY
++This example starts a \f3jstatd\fR session with a external RMI registry\&.
++.sp
++.nf
++\f3rmiregistry&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&.
++.sp
++.nf
++\f3jrmiregistry 2020&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&.
++.sp
++.nf
++\f3rmiregistry 2020&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
++.fi
++.nf
++\f3 \-n AlternateJstatdServerName\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY
++This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS ENABLE\ RMI\ LOGGING
++This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3 \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jstat(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/keytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/keytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Security Tools
+-.\" Title: keytool.1
+-.\"
+-.if n .pl 99999
+-.TH keytool 1 "03 March 2015" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Security Tools
++.\" Title: keytool.1
++.\"
++.if n .pl 99999
++.TH keytool 1 "03 March 2015" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,1572 +47,1572 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-keytool \- Manages a keystore (database) of cryptographic keys, X\&.509 certificate chains, and trusted certificates\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBkeytool\fR [\fIcommands\fR]
+-.fi
+-.sp
+-.TP
+-\fIcommands\fR
+-See Commands\&. These commands are categorized by task as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-Create or Add Data to the Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--gencert
+-.TP 0.2i
+-\(bu
+--genkeypair
+-.TP 0.2i
+-\(bu
+--genseckey
+-.TP 0.2i
+-\(bu
+--importcert
+-.TP 0.2i
+-\(bu
+--importpassword
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Import Contents From Another Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--importkeystore
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Generate Certificate Request
+-.RS
+-.TP 0.2i
+-\(bu
+--certreq
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Export Data
+-.RS
+-.TP 0.2i
+-\(bu
+--exportcert
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Display Data
+-.RS
+-.TP 0.2i
+-\(bu
+--list
+-.TP 0.2i
+-\(bu
+--printcert
+-.TP 0.2i
+-\(bu
+--printcertreq
+-.TP 0.2i
+-\(bu
+--printcrl
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Manage the Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--storepasswd
+-.TP 0.2i
+-\(bu
+--keypasswd
+-.TP 0.2i
+-\(bu
+--delete
+-.TP 0.2i
+-\(bu
+--changealias
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Get Help
+-.RS
+-.TP 0.2i
+-\(bu
+--help
+-.RE
+-
+-.RE
+-
+-.SH DESCRIPTION
+-The \f3keytool\fR command is a key and certificate management utility\&. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself or herself to other users and services) or data integrity and authentication services, using digital signatures\&. The \f3keytool\fR command also enables users to cache the public keys (in the form of certificates) of their communicating peers\&.
+-.PP
+-A certificate is a digitally signed statement from one entity (person, company, and so on\&.), that says that the public key (and some other information) of some other entity has a particular value\&. (See Certificate\&.) When data is digitally signed, the signature can be verified to check the data integrity and authenticity\&. Integrity means that the data has not been modified or tampered with, and authenticity means the data comes from whoever claims to have created and signed it\&.
+-.PP
+-The \f3keytool\fR command also enables users to administer secret keys and passphrases used in symmetric encryption and decryption (DES)\&.
+-.PP
+-The \f3keytool\fR command stores the keys and certificates in a keystore\&. See KeyStore aliases\&.
+-.SH COMMAND\ AND\ OPTION\ NOTES
+-See Commands for a listing and description of the various commands\&.
+-.TP 0.2i
+-\(bu
+-All command and option names are preceded by a minus sign (-)\&.
+-.TP 0.2i
+-\(bu
+-The options for each command can be provided in any order\&.
+-.TP 0.2i
+-\(bu
+-All items not italicized or in braces or brackets are required to appear as is\&.
+-.TP 0.2i
+-\(bu
+-Braces surrounding an option signify that a default value will be used when the option is not specified on the command line\&. See Option Defaults\&. Braces are also used around the \f3-v\fR, \f3-rfc\fR, and \f3-J\fR options, which only have meaning when they appear on the command line\&. They do not have any default values other than not existing\&.
+-.TP 0.2i
+-\(bu
+-Brackets surrounding an option signify that the user is prompted for the values when the option is not specified on the command line\&. For the \f3-keypass\fR option, if you do not specify the option on the command line, then the \f3keytool\fR command first attempts to use the keystore password to recover the private/secret key\&. If this attempt fails, then the \f3keytool\fR command prompts you for the private/secret key password\&.
+-.TP 0.2i
+-\(bu
+-Items in italics (option values) represent the actual values that must be supplied\&. For example, here is the format of the \f3-printcert\fR command:
+-.sp
+-.nf
+-\f3keytool \-printcert {\-file \fIcert_file\fR} {\-v}\fP
+-.fi
+-.sp
+-
+-
+-
+-
+-When you specify a \f3-printcert\fR command, replace \fIcert_file\fR with the actual file name, as follows: \f3keytool -printcert -file VScert\&.cer\fR
+-.TP 0.2i
+-\(bu
+-Option values must be put in quotation marks when they contain a blank (space)\&.
+-.TP 0.2i
+-\(bu
+-The \f3-help\fR option is the default\&. The \f3keytool\fR command is the same as \f3keytool -help\fR\&.
+-.SH OPTION\ DEFAULTS
+-The following examples show the defaults for various option values\&.
+-.sp
+-.nf
+-\f3\-alias "mykey"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keyalg\fP
+-.fi
+-.nf
+-\f3 "DSA" (when using \-genkeypair)\fP
+-.fi
+-.nf
+-\f3 "DES" (when using \-genseckey)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keysize\fP
+-.fi
+-.nf
+-\f3 2048 (when using \-genkeypair and \-keyalg is "RSA")\fP
+-.fi
+-.nf
+-\f3 1024 (when using \-genkeypair and \-keyalg is "DSA")\fP
+-.fi
+-.nf
+-\f3 256 (when using \-genkeypair and \-keyalg is "EC")\fP
+-.fi
+-.nf
+-\f3 56 (when using \-genseckey and \-keyalg is "DES")\fP
+-.fi
+-.nf
+-\f3 168 (when using \-genseckey and \-keyalg is "DESede")\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-validity 90\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keystore <the file named \&.keystore in the user\&'s home directory>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-storetype <the value of the "keystore\&.type" property in the\fP
+-.fi
+-.nf
+-\f3 security properties file, which is returned by the static\fP
+-.fi
+-.nf
+-\f3 getDefaultType method in java\&.security\&.KeyStore>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-file\fP
+-.fi
+-.nf
+-\f3 stdin (if reading)\fP
+-.fi
+-.nf
+-\f3 stdout (if writing)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-protected false\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In generating a public/private key pair, the signature algorithm (\f3-sigalg\fR option) is derived from the algorithm of the underlying private key:
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type DSA, then the \f3-sigalg\fR option defaults to SHA1withDSA\&.
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type RSA, then the \f3-sigalg\fR option defaults to SHA256withRSA\&.
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type EC, then the \f3-sigalg\fR option defaults to SHA256withECDSA\&.
+-.PP
+-For a full list of \f3-keyalg\fR and \f3-sigalg\fR arguments, see Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-.SH COMMON\ OPTIONS
+-The \f3-v\fR option can appear for all commands except \f3-help\fR\&. When the \f3-v\fR option appears, it signifies verbose mode, which means that more information is provided in the output\&.
+-.PP
+-There is also a \f3-Jjavaoption\fR argument that can appear for any command\&. When the \f3-Jjavaoption\fR appears, the specified \f3javaoption\fR string is passed directly to the Java interpreter\&. This option does not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
+-.PP
+-These options can appear for all commands operating on a keystore:
+-.TP
+--storetype \fIstoretype\fR
+-.br
+-This qualifier specifies the type of keystore to be instantiated\&.
+-.TP
+--keystore \fIkeystore\fR
+-.br
+-The keystore location\&.
+-
+-If the JKS \f3storetype\fR is used and a keystore file does not yet exist, then certain \f3keytool\fR commands can result in a new keystore file being created\&. For example, if \f3keytool -genkeypair\fR is called and the \f3-keystore\fR option is not specified, the default keystore file named \f3\&.keystore\fR in the user\&'s home directory is created when it does not already exist\&. Similarly, if the \f3-keystore ks_file\fR option is specified but ks_file does not exist, then it is created\&. For more information on the JKS \f3storetype\fR, see the \fIKeyStore Implementation\fR section in KeyStore aliases\&.
+-
+-Note that the input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified if the keystore is not file-based\&. For example, when it resides on a hardware token device\&.
+-.TP
+--storepass[:\fIenv\fR| :\fIfile\fR] argument
+-.br
+-The password that is used to protect the integrity of the keystore\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the \f3value\fR argument, which must be at least 6 characters long\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named argument\&.
+-.RE
+-
+-
+-\fINote:\fR All other options that require passwords, such as \f3-keypass\fR, \f3-srckeypass\fR, -\f3destkeypass\fR, \f3-srcstorepass\fR, and \f3-deststorepass\fR, accept the \fIenv\fR and \fIfile\fR modifiers\&. Remember to separate the password option and the modifier with a colon (:)\&.
+-
+-The password must be provided to all commands that access the keystore contents\&. For such commands, when the \f3-storepass\fR option is not provided at the command line, the user is prompted for it\&.
+-
+-When retrieving information from the keystore, the password is optional\&. If no password is specified, then the integrity of the retrieved information cannot be verified and a warning is displayed\&.
+-.TP
+--providerName \fIprovider_name\fR
+-.br
+-Used to identify a cryptographic service provider\&'s name when listed in the security properties file\&.
+-.TP
+--providerClass \fIprovider_class_name\fR
+-.br
+-Used to specify the name of a cryptographic service provider\&'s master class file when the service provider is not listed in the security properties file\&.
+-.TP
+--providerArg \fIprovider_arg\fR
+-.br
+-Used with the \f3-providerClass\fR option to represent an optional string input argument for the constructor of \f3provider_class_name\fR\&.
+-.TP
+--protected
+-.br
+-Either \f3true\fR or \f3false\fR\&. This value should be specified as \f3true\fR when a password must be specified by way of a protected authentication path such as a dedicated PIN reader\&.Because there are two keystores involved in the \f3-importkeystore\fR command, the following two options \f3-srcprotected\fR and -\f3destprotected\fR are provided for the source keystore and the destination keystore respectively\&.
+-.TP
+--ext \fI{name{:critical} {=value}}\fR
+-.br
+-Denotes an X\&.509 certificate extension\&. The option can be used in \f3-genkeypair\fR and \f3-gencert\fR to embed extensions into the certificate generated, or in \f3-certreq\fR to show what extensions are requested in the certificate request\&. The option can appear multiple times\&. The \f3name\fR argument can be a supported extension name (see Named Extensions) or an arbitrary OID number\&. The \f3value\fR argument, when provided, denotes the argument for the extension\&. When \fIvalue\fR is omitted, that means that the default value of the extension or the extension requires no argument\&. The \f3:critical\fR modifier, when provided, means the extension\&'s \f3isCritical\fR attribute is \f3true\fR; otherwise, it is \f3false\fR\&. You can use \f3:c\fR in place of \f3:critical\fR\&.
+-.SH NAMED\ EXTENSIONS
+-The \f3keytool\fR command supports these named extensions\&. The names are not case-sensitive)\&.
+-.TP
+-BC or BasicContraints
+-\fIValues\fR: The full form is: \f3ca:{true|false}[,pathlen:<len>]\fR or \f3<len>\fR, which is short for \f3ca:true,pathlen:<len>\fR\&. When <\f3len\fR> is omitted, you have \f3ca:true\fR\&.
+-.TP
+-KU or KeyUsage
+-\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3digitalSignature\fR, \f3nonRepudiation\fR (contentCommitment), \f3keyEncipherment\fR, \f3dataEncipherment\fR, \f3keyAgreement\fR, \f3keyCertSign\fR, \f3cRLSign\fR, \f3encipherOnly\fR, \f3decipherOnly\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters (\f3dig\fR for \f3digitalSignature\fR) or in camel-case style (\f3dS\fR for \f3digitalSignature\fR or \f3cRLS\fR for \f3cRLSign\fR), as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
+-.TP
+-EKU or ExtendedKeyUsage
+-\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3anyExtendedKeyUsage\fR, \f3serverAuth\fR, \f3clientAuth\fR, \f3codeSigning\fR, \f3emailProtection\fR, \f3timeStamping\fR, \f3OCSPSigning\fR, or any \fIOID string\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters or in camel-case style, as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
+-.TP
+-SAN or SubjectAlternativeName
+-\fIValues\fR: \f3type\fR:\f3value\fR(,t\f3ype:value\fR)*, where \f3type\fR can be \f3EMAIL\fR, \f3URI\fR, \f3DNS\fR, \f3IP\fR, or \f3OID\fR\&. The \f3value\fR argument is the string format value for the \f3type\fR\&.
+-.TP
+-IAN or IssuerAlternativeName
+-\fIValues\fR: Same as \f3SubjectAlternativeName\fR\&.
+-.TP
+-SIA or SubjectInfoAccess
+-\fIValues\fR: \f3method\fR:\f3location-type\fR:\f3location-value\fR (,\f3method:location-type\fR:\f3location-value\fR)*, where \f3method\fR can be \f3timeStamping\fR, \f3caRepository\fR or any OID\&. The \f3location-type\fR and \f3location-value\fR arguments can be any \f3type\fR:\f3value\fR supported by the \f3SubjectAlternativeName\fR extension\&.
+-.TP
+-AIA or AuthorityInfoAccess
+-\fIValues\fR: Same as \f3SubjectInfoAccess\fR\&. The \f3method\fR argument can be \f3ocsp\fR,\f3caIssuers\fR, or any OID\&.
+-.PP
+-When \f3name\fR is OID, the value is the hexadecimal dumped DER encoding of the \f3extnValue\fR for the extension excluding the OCTET STRING type and length bytes\&. Any extra character other than standard hexadecimal numbers (0-9, a-f, A-F) are ignored in the HEX string\&. Therefore, both 01:02:03:04 and 01020304 are accepted as identical values\&. When there is no value, the extension has an empty value field\&.
+-.PP
+-A special name \f3honored\fR, used in \f3-gencert\fR only, denotes how the extensions included in the certificate request should be honored\&. The value for this name is a comma separated list of \f3all\fR (all requested extensions are honored), \f3name{:[critical|non-critical]}\fR (the named extension is honored, but using a different \f3isCritical\fR attribute) and \f3-name\fR (used with \f3all\fR, denotes an exception)\&. Requested extensions are not honored by default\&.
+-.PP
+-If, besides the\f3-ext honored\fR option, another named or OID \f3-ext\fR option is provided, this extension is added to those already honored\&. However, if this name (or OID) also appears in the honored value, then its value and criticality overrides the one in the request\&.
+-.PP
+-The \f3subjectKeyIdentifier\fR extension is always created\&. For non-self-signed certificates, the \f3authorityKeyIdentifier\fR is created\&.
+-.PP
+-\fINote:\fR Users should be aware that some combinations of extensions (and other certificate fields) may not conform to the Internet standard\&. See Certificate Conformance Warning\&.
+-.SH COMMANDS
+-.TP
+--gencert
+-.sp
+-.nf
+-\f3{\-rfc} {\-infile \fIinfile\fR} {\-outfile \fIoutfile\fR} {\-alias \fIalias\fR} {\-sigalg \fIsigalg\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-dname \fIdname\fR} {\-startdate \fIstartdate\fR {\-ext \fIext\fR}* {\-validity \fIvalDays\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-keypass \fIkeypass\fR] {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-providername \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a certificate as a response to a certificate request file (which can be created by the \f3keytool\fR\f3-certreq\fR command)\&. The command reads the request from \fIinfile\fR (if omitted, from the standard input), signs it using alias\&'s private key, and outputs the X\&.509 certificate into \fIoutfile\fR (if omitted, to the standard output)\&. When\f3-rfc\fR is specified, the output format is Base64-encoded PEM; otherwise, a binary DER is created\&.
+-
+-The \f3sigalg\fR value specifies the algorithm that should be used to sign the certificate\&. The \f3startdate\fR argument is the start time and date that the certificate is valid\&. The \f3valDays\fR argument tells the number of days for which the certificate should be considered valid\&.
+-
+-When \f3dname\fR is provided, it is used as the subject of the generated certificate\&. Otherwise, the one from the certificate request is used\&.
+-
+-The \f3ext\fR value shows what X\&.509 extensions will be embedded in the certificate\&. Read Common Options for the grammar of \f3-ext\fR\&.
+-
+-The \f3-gencert\fR option enables you to create certificate chains\&. The following example creates a certificate, \f3e1\fR, that contains three certificates in its certificate chain\&.
+-
+-The following commands creates four key pairs named \f3ca\fR, \f3ca1\fR, \f3ca2\fR, and \f3e1\fR:
+-.sp
+-.nf
+-\f3keytool \-alias ca \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca1 \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca2 \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias e1 \-dname CN=E1 \-genkeypair\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following two commands create a chain of signed certificates; \f3ca\fR signs \f3ca1\fR and \f3ca1\fR signs \f3ca2\fR, all of which are self-issued:
+-.sp
+-.nf
+-\f3keytool \-alias ca1 \-certreq |\fP
+-.fi
+-.nf
+-\f3 keytool \-alias ca \-gencert \-ext san=dns:ca1 |\fP
+-.fi
+-.nf
+-\f3 keytool \-alias ca1 \-importcert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca2 \-certreq |\fP
+-.fi
+-.nf
+-\f3 $KT \-alias ca1 \-gencert \-ext san=dns:ca2 |\fP
+-.fi
+-.nf
+-\f3 $KT \-alias ca2 \-importcert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following command creates the certificate \f3e1\fR and stores it in the file \f3e1\&.cert\fR, which is signed by \f3ca2\fR\&. As a result, \f3e1\fR should contain \f3ca\fR, \f3ca1\fR, and \f3ca2\fR in its certificate chain:
+-.sp
+-.nf
+-\f3keytool \-alias e1 \-certreq | keytool \-alias ca2 \-gencert > e1\&.cert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--genkeypair
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} {\-sigalg \fIsigalg\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-dname \fIdname\fR] [\-keypass \fIkeypass\fR] {\-startdate \fIvalue\fR} {\-ext \fIext\fR}*\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-validity \fIvalDays\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a key pair (a public key and associated private key)\&. Wraps the public key into an X\&.509 v3 self-signed certificate, which is stored as a single-element certificate chain\&. This certificate chain and the private key are stored in a new keystore entry identified by alias\&.
+-
+-The \f3keyalg\fR value specifies the algorithm to be used to generate the key pair, and the \f3keysize\fR value specifies the size of each key to be generated\&. The \f3sigalg\fR value specifies the algorithm that should be used to sign the self-signed certificate\&. This algorithm must be compatible with the \f3keyalg\fR value\&.
+-
+-The \f3dname\fR value specifies the X\&.500 Distinguished Name to be associated with the value of \f3alias\fR, and is used as the issuer and subject fields in the self-signed certificate\&. If no distinguished name is provided at the command line, then the user is prompted for one\&.
+-
+-The value of \f3keypass\fR is a password used to protect the private key of the generated key pair\&. If no password is provided, then the user is prompted for it\&. If you press \fIthe Return key\fR at the prompt, then the key password is set to the same password as the keystore password\&. The \f3keypass\fR value must be at least 6 characters\&.
+-
+-The value of \f3startdate\fR specifies the issue time of the certificate, also known as the "Not Before" value of the X\&.509 certificate\&'s Validity field\&.
+-
+-The option value can be set in one of these two forms:
+-
+-\f3([+-]nnn[ymdHMS])+\fR
+-
+-\f3[yyyy/mm/dd] [HH:MM:SS]\fR
+-
+-With the first form, the issue time is shifted by the specified value from the current time\&. The value is a concatenation of a sequence of subvalues\&. Inside each subvalue, the plus sign (+) means shift forward, and the minus sign (-) means shift backward\&. The time to be shifted is \f3nnn\fR units of years, months, days, hours, minutes, or seconds (denoted by a single character of \f3y\fR, \f3m\fR, \f3d\fR, \f3H\fR, \f3M\fR, or \f3S\fR respectively)\&. The exact value of the issue time is calculated using the \f3java\&.util\&.GregorianCalendar\&.add(int field, int amount)\fR method on each subvalue, from left to right\&. For example, by specifying, the issue time will be:
+-.sp
+-.nf
+-\f3Calendar c = new GregorianCalendar();\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.YEAR, \-1);\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.MONTH, 1);\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.DATE, \-1);\fP
+-.fi
+-.nf
+-\f3return c\&.getTime()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-With the second form, the user sets the exact issue time in two parts, year/month/day and hour:minute:second (using the local time zone)\&. The user can provide only one part, which means the other part is the same as the current date (or time)\&. The user must provide the exact number of digits as shown in the format definition (padding with 0 when shorter)\&. When both the date and time are provided, there is one (and only one) space character between the two parts\&. The hour should always be provided in 24 hour format\&.
+-
+-When the option is not provided, the start date is the current time\&. The option can be provided at most once\&.
+-
+-The value of \f3valDays\fR specifies the number of days (starting at the date specified by \f3-startdate\fR, or the current date when \f3-startdate\fR is not specified) for which the certificate should be considered valid\&.
+-
+-This command was named \f3-genkey\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-genkeypair\fR, is preferred going forward\&.
+-.TP
+--genseckey
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} [\-keypass \fIkeypass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a secret key and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&.
+-
+-The value of \f3keyalg\fR specifies the algorithm to be used to generate the secret key, and the value of \f3keysize\fR specifies the size of the key to be generated\&. The \f3keypass\fR value is a password that protects the secret key\&. If no password is provided, then the user is prompted for it\&. If you press the Return key at the prompt, then the key password is set to the same password that is used for the \f3keystore\fR\&. The \f3keypass\fR value must be at least 6 characters\&.
+-.TP
+--importcert
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} [\-keypass \fIkeypass\fR] {\-noprompt} {\-trustcacerts}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads the certificate or certificate chain (where the latter is supplied in a PKCS#7 formatted reply or a sequence of X\&.509 certificates) from the file \f3cert_file\fR, and stores it in the \f3keystore\fR entry identified by \f3alias\fR\&. If no file is specified, then the certificate or certificate chain is read from \f3stdin\fR\&.
+-
+-The \f3keytool\fR command can import X\&.509 v1, v2, and v3 certificates, and PKCS#7 formatted certificate chains consisting of certificates of that type\&. The data to be imported must be provided either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. In the latter case, the encoding must be bounded at the beginning by a string that starts with \f3-\fR\f3----BEGIN\fR, and bounded at the end by a string that starts with \f3-----END\fR\&.
+-
+-You import a certificate for two reasons: To add it to the list of trusted certificates, and to import a certificate reply received from a certificate authority (CA) as the result of submitting a Certificate Signing Request to that CA (see the \f3-certreq\fR option in Commands)\&.
+-
+-Which type of import is intended is indicated by the value of the \f3-alias\fR option\&. If the alias does not point to a key entry, then the \f3keytool\fR command assumes you are adding a trusted certificate entry\&. In this case, the alias should not already exist in the keystore\&. If the alias does already exist, then the \f3keytool\fR command outputs an error because there is already a trusted certificate for that alias, and does not import the certificate\&. If the alias points to a key entry, then the \f3keytool\fR command assumes you are importing a certificate reply\&.
+-.TP
+--importpassword
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Imports a passphrase and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&. The passphrase may be supplied via the standard input stream; otherwise the user is prompted for it\&. \f3keypass\fR is a password used to protect the imported passphrase\&. If no password is provided, the user is prompted for it\&. If you press the Return key at the prompt, the key password is set to the same password as that used for the \f3keystore\fR\&. \f3keypass\fR must be at least 6 characters long\&.
+-.TP
+--importkeystore
+-.sp
+-.nf
+-\f3{\-srcstoretype \fIsrcstoretype\fR} {\-deststoretype \fIdeststoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-srcstorepass \fIsrcstorepass\fR] [\-deststorepass \fIdeststorepass\fR] {\-srcprotected}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-destprotected} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-srcalias \fIsrcalias\fR {\-destalias \fIdestalias\fR} [\-srckeypass \fIsrckeypass\fR]} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-destkeypass \fIdestkeypass\fR] {\-noprompt}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-srcProviderName \fIsrc_provider_name\fR} {\-destProviderName \fIdest_provider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Imports a single entry or all entries from a source keystore to a destination keystore\&.
+-
+-When the \f3-srcalias\fR option is provided, the command imports the single entry identified by the alias to the destination keystore\&. If a destination alias is not provided with \f3destalias\fR, then \f3srcalias\fR is used as the destination alias\&. If the source entry is protected by a password, then \f3srckeypass\fR is used to recover the entry\&. If \fIsrckeypass\fR is not provided, then the \f3keytool\fR command attempts to use \f3srcstorepass\fR to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. The destination entry is protected with \f3destkeypass\fR\&. If \f3destkeypass\fR is not provided, then the destination entry is protected with the source entry password\&. For example, most third-party tools require \f3storepass\fR and \f3keypass\fR in a PKCS #12 keystore to be the same\&. In order to create a PKCS #12 keystore for these tools, always specify a \f3-destkeypass\fR to be the same as \f3-deststorepass\fR\&.
+-
+-If the \f3-srcalias\fR option is not provided, then all entries in the source keystore are imported into the destination keystore\&. Each destination entry is stored under the alias from the source entry\&. If the source entry is protected by a password, then \f3srcstorepass\fR is used to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. If a source keystore entry type is not supported in the destination keystore, or if an error occurs while storing an entry into the destination keystore, then the user is prompted whether to skip the entry and continue or to quit\&. The destination entry is protected with the source entry password\&.
+-
+-If the destination alias already exists in the destination keystore, then the user is prompted to either overwrite the entry or to create a new entry under a different alias name\&.
+-
+-If the \f3-noprompt\fR option is provided, then the user is not prompted for a new destination alias\&. Existing entries are overwritten with the destination alias name\&. Entries that cannot be imported are skipped and a warning is displayed\&.
+-.TP
+--printcertreq
+-.sp
+-.nf
+-\f3{\-file \fIfile\fR}\fP
+-.fi
+-.sp
+-
+-
+-Prints the content of a PKCS #10 format certificate request, which can be generated by the \f3keytool\fR\f3-certreq\fR command\&. The command reads the request from file\&. If there is no file, then the request is read from the standard input\&.
+-.TP
+--certreq
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-dname \fIdname\fR} {\-sigalg \fIsigalg\fR} {\-file \fIcertreq_file\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a Certificate Signing Request (CSR) using the PKCS #10 format\&.
+-
+-A CSR is intended to be sent to a certificate authority (CA)\&. The CA authenticates the certificate requestor (usually off-line) and will return a certificate or certificate chain, used to replace the existing certificate chain (which initially consists of a self-signed certificate) in the keystore\&.
+-
+-The private key associated with alias is used to create the PKCS #10 certificate request\&. To access the private key, the correct password must be provided\&. If \f3keypass\fR is not provided at the command line and is different from the password used to protect the integrity of the keystore, then the user is prompted for it\&. If \f3dname\fR is provided, then it is used as the subject in the CSR\&. Otherwise, the X\&.500 Distinguished Name associated with alias is used\&.
+-
+-The \f3sigalg\fR value specifies the algorithm that should be used to sign the CSR\&.
+-
+-The CSR is stored in the file certreq_file\&. If no file is specified, then the CSR is output to \f3stdout\fR\&.
+-
+-Use the \f3importcert\fR command to import the response from the CA\&.
+-.TP
+--exportcert
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-rfc} {\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads from the keystore the certificate associated with \fIalias\fR and stores it in the cert_file file\&. When no file is specified, the certificate is output to \f3stdout\fR\&.
+-
+-The certificate is by default output in binary encoding\&. If the \f3-rfc\fR option is specified, then the output in the printable encoding format defined by the Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-If \f3alias\fR refers to a trusted certificate, then that certificate is output\&. Otherwise, \f3alias\fR refers to a key entry with an associated certificate chain\&. In that case, the first certificate in the chain is returned\&. This certificate authenticates the public key of the entity addressed by \f3alias\fR\&.
+-
+-This command was named \f3-export\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-exportcert\fR, is preferred going forward\&.
+-.TP
+--list
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v | \-rfc} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Prints to \f3stdout\fR the contents of the keystore entry identified by \f3alias\fR\&. If no \f3alias\fR is specified, then the contents of the entire keystore are printed\&.
+-
+-This command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format, with additional information such as the owner, issuer, serial number, and any extensions\&. If the \f3-rfc\fR option is specified, then the certificate contents are printed using the printable encoding format, as defined by the Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-You cannot specify both \f3-v\fR and \f3-rfc\fR\&.
+-.TP
+--printcert
+-.sp
+-.nf
+-\f3{\-file \fIcert_file\fR | \-sslserver \fIhost\fR[:\fIport\fR]} {\-jarfile \fIJAR_file\fR {\-rfc} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads the certificate from the file cert_file, the SSL server located at host:port, or the signed JAR file \f3JAR_file\fR (with the \f3-jarfile\fR option and prints its contents in a human-readable format\&. When no port is specified, the standard HTTPS port 443 is assumed\&. Note that \f3-sslserver\fR and -file options cannot be provided at the same time\&. Otherwise, an error is reported\&. If neither option is specified, then the certificate is read from \f3stdin\fR\&.
+-
+-When\f3-rfc\fR is specified, the \f3keytool\fR command prints the certificate in PEM mode as defined by the Internet RFC 1421 Certificate Encoding standard\&. See Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-If the certificate is read from a file or \f3stdin\fR, then it might be either binary encoded or in printable encoding format, as defined by the RFC 1421 Certificate Encoding standard\&.
+-
+-If the SSL server is behind a firewall, then the \f3-J-Dhttps\&.proxyHost=proxyhost\fR and \f3-J-Dhttps\&.proxyPort=proxyport\fR options can be specified on the command line for proxy tunneling\&. See Java Secure Socket Extension (JSSE) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.html
+-
+-\fINote:\fR This option can be used independently of a keystore\&.
+-.TP
+--printcrl
+-.sp
+-.nf
+-\f3\-file \fIcrl_\fR {\-v}\fP
+-.fi
+-.sp
+-
+-
+-Reads the Certificate Revocation List (CRL) from the file \f3crl_\fR\&. A CRL is a list of digital certificates that were revoked by the CA that issued them\&. The CA generates the \f3crl_\fR file\&.
+-
+-\fINote:\fR This option can be used independently of a keystore\&.
+-.TP
+--storepasswd
+-.sp
+-.nf
+-\f3[\-new \fInew_storepass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Changes the password used to protect the integrity of the keystore contents\&. The new password is \f3new_storepass\fR, which must be at least 6 characters\&.
+-.TP
+--keypasswd
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-keypass \fIold_keypass\fR] [\-new \fInew_keypass\fR] {\-storetype \fIstoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Changes the password under which the private/secret key identified by \f3alias\fR is protected, from \f3old_keypass\fR to \f3new_keypass\fR, which must be at least 6 characters\&.
+-
+-If the \f3-keypass\fR option is not provided at the command line, and the key password is different from the keystore password, then the user is prompted for it\&.
+-
+-If the \f3-new\fR option is not provided at the command line, then the user is prompted for it
+-.TP
+--delete
+-.sp
+-.nf
+-\f3[\-alias \fIalias\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Deletes from the keystore the entry identified by \f3alias\fR\&. The user is prompted for the alias, when no alias is provided at the command line\&.
+-.TP
+--changealias
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-destalias \fIdestalias\fR] [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Move an existing keystore entry from the specified \f3alias\fR to a new alias, \f3destalias\fR\&. If no destination alias is provided, then the command prompts for one\&. If the original entry is protected with an entry password, then the password can be supplied with the \f3-keypass\fR option\&. If no key password is provided, then the \f3storepass\fR (if provided) is attempted first\&. If the attempt fails, then the user is prompted for a password\&.
+-.TP
+--help
+-.br
+-Lists the basic commands and their options\&.
+-
+-For more information about a specific command, enter the following, where \f3command_name\fR is the name of the command: \f3keytool -command_name -help\fR\&.
+-.SH EXAMPLES
+-This example walks through the sequence of steps to create a keystore for managing public/private key pair and certificates from trusted entities\&.
+-.SS GENERATE\ THE\ KEY\ PAIR
+-First, create a keystore and generate the key pair\&. You can use a command such as the following typed as a single line:
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-dname "cn=Mark Jones, ou=Java, o=Oracle, c=US"\fP
+-.fi
+-.nf
+-\f3 \-alias business \-keypass <new password for private key>\fP
+-.fi
+-.nf
+-\f3 \-keystore /working/mykeystore\fP
+-.fi
+-.nf
+-\f3 \-storepass <new password for keystore> \-validity 180\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The command creates the keystore named \f3mykeystore\fR in the working directory (assuming it does not already exist), and assigns it the password specified by \f3<new password for keystore>\fR\&. It generates a public/private key pair for the entity whose distinguished name has a common name of Mark Jones, organizational unit of Java, organization of Oracle and two-letter country code of US\&. It uses the default DSA key generation algorithm to create the keys; both are 1024 bits\&.
+-.PP
+-The command uses the default SHA1withDSA signature algorithm to create a self-signed certificate that includes the public key and the distinguished name information\&. The certificate is valid for 180 days, and is associated with the private key in a keystore entry referred to by the alias \f3business\fR\&. The private key is assigned the password specified by \f3<new password for private key>\fR\&.
+-.PP
+-The command is significantly shorter when the option defaults are accepted\&. In this case, no options are required, and the defaults are used for unspecified options that have default values\&. You are prompted for any required values\&. You could have the following:
+-.sp
+-.nf
+-\f3keytool \-genkeypair\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this case, a keystore entry with the alias \f3mykey\fR is created, with a newly generated key pair and a certificate that is valid for 90 days\&. This entry is placed in the keystore named \f3\&.keystore\fR in your home directory\&. The keystore is created when it does not already exist\&. You are prompted for the distinguished name information, the keystore password, and the private key password\&.
+-.PP
+-The rest of the examples assume you executed the \f3-genkeypair\fR command without options specified, and that you responded to the prompts with values equal to those specified in the first \f3-genkeypair\fR command\&. For example, a distinguished name of \f3cn=Mark Jones\fR, \f3ou=Java\fR, \f3o=Oracle\fR, \f3c=US\fR)\&.
+-.SS REQUEST\ A\ SIGNED\ CERTIFICATE\ FROM\ A\ CA
+-Generating the key pair created a self-signed certificate\&. A certificate is more likely to be trusted by others when it is signed by a Certification Authority (CA)\&. To get a CA signature, first generate a Certificate Signing Request (CSR), as follows:
+-.sp
+-.nf
+-\f3keytool \-certreq \-file MarkJ\&.csr\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This creates a CSR for the entity identified by the default alias \f3mykey\fR and puts the request in the file named MarkJ\&.csr\&. Submit this file to a CA, such as VeriSign\&. The CA authenticates you, the requestor (usually off-line), and returns a certificate, signed by them, authenticating your public key\&. In some cases, the CA returns a chain of certificates, each one authenticating the public key of the signer of the previous certificate in the chain\&.
+-.SS IMPORT\ A\ CERTIFICATE\ FOR\ THE\ CA
+-You now need to replace the self-signed certificate with a certificate chain, where each certificate in the chain authenticates the public key of the signer of the previous certificate in the chain, up to a root CA\&.
+-.PP
+-Before you import the certificate reply from a CA, you need one or more trusted certificates in your keystore or in the \f3cacerts\fR keystore file\&. See \f3-importcert\fR in Commands\&.
+-.TP 0.2i
+-\(bu
+-If the certificate reply is a certificate chain, then you need the top certificate of the chain\&. The root CA certificate that authenticates the public key of the CA\&.
+-.TP 0.2i
+-\(bu
+-If the certificate reply is a single certificate, then you need a certificate for the issuing CA (the one that signed it)\&. If that certificate is not self-signed, then you need a certificate for its signer, and so on, up to a self-signed root CA certificate\&.
+-.PP
+-The \f3cacerts\fR keystore file ships with several VeriSign root CA certificates, so you probably will not need to import a VeriSign certificate as a trusted certificate in your keystore\&. But if you request a signed certificate from a different CA, and a certificate authenticating that CA\&'s public key was not added to \f3cacerts\fR, then you must import a certificate from the CA as a trusted certificate\&.
+-.PP
+-A certificate from a CA is usually either self-signed or signed by another CA, in which case you need a certificate that authenticates that CA\&'s public key\&. Suppose company ABC, Inc\&., is a CA, and you obtain a file named A\f3BCCA\&.cer\fR that is supposed to be a self-signed certificate from ABC, that authenticates that CA\&'s public key\&. Be careful to ensure the certificate is valid before you import it as a trusted certificate\&. View it first with the \f3keytool -printcert\fR command or the \f3keytool -importcert\fR command without the \f3-noprompt\fR option, and make sure that the displayed certificate fingerprints match the expected ones\&. You can call the person who sent the certificate, and compare the fingerprints that you see with the ones that they show or that a secure public key repository shows\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s (for example, an attacker\&'s) certificate\&. If such an attack takes place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker has signed\&.
+-.PP
+-If you trust that the certificate is valid, then you can add it to your keystore with the following command:
+-.sp
+-.nf
+-\f3keytool \-importcert \-alias abc \-file ABCCA\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This command creates a trusted certificate entry in the keystore, with the data from the file ABCCA\&.cer, and assigns the alias \f3abc\fR to the entry\&.
+-.SS IMPORT\ THE\ CERTIFICATE\ REPLY\ FROM\ THE\ CA
+-After you import a certificate that authenticates the public key of the CA you submitted your certificate signing request to (or there is already such a certificate in the cacerts file), you can import the certificate reply and replace your self-signed certificate with a certificate chain\&. This chain is the one returned by the CA in response to your request (when the CA reply is a chain), or one constructed (when the CA reply is a single certificate) using the certificate reply and trusted certificates that are already available in the keystore where you import the reply or in the \f3cacerts\fR keystore file\&.
+-.PP
+-For example, if you sent your certificate signing request to VeriSign, then you can import the reply with the following, which assumes the returned certificate is named VSMarkJ\&.cer:
+-.sp
+-.nf
+-\f3keytool \-importcert \-trustcacerts \-file VSMarkJ\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS EXPORT\ A\ CERTIFICATE\ THAT\ AUTHENTICATES\ THE\ PUBLIC\ KEY
+-If you used the \f3jarsigner\fR command to sign a Java Archive (JAR) file, then clients that want to use the file will want to authenticate your signature\&. One way the clients can authenticate you is by first importing your public key certificate into their keystore as a trusted entry\&.
+-.PP
+-You can export the certificate and supply it to your clients\&. As an example, you can copy your certificate to a file named MJ\&.cer with the following command that assumes the entry has an alias of \f3mykey\fR:
+-.sp
+-.nf
+-\f3keytool \-exportcert \-alias mykey \-file MJ\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-With the certificate and the signed JAR file, a client can use the \f3jarsigner\fR command to authenticate your signature\&.
+-.SS IMPORT\ KEYSTORE
+-The command \f3importkeystore\fR is used to import an entire keystore into another keystore, which means all entries from the source keystore, including keys and certificates, are all imported to the destination keystore within a single command\&. You can use this command to import entries from a different type of keystore\&. During the import, all new entries in the destination keystore will have the same alias names and protection passwords (for secret keys and private keys)\&. If the \f3keytool\fR command cannot recover the private keys or secret keys from the source keystore, then it prompts you for a password\&. If it detects alias duplication, then it asks you for a new alias, and you can specify a new alias or simply allow the \f3keytool\fR command to overwrite the existing one\&.
+-.PP
+-For example, to import entries from a typical JKS type keystore key\&.jks into a PKCS #11 type hardware-based keystore, use the command:
+-.sp
+-.nf
+-\f3keytool \-importkeystore\fP
+-.fi
+-.nf
+-\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
+-.fi
+-.nf
+-\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
+-.fi
+-.nf
+-\f3 \-srcstorepass <src keystore password>\fP
+-.fi
+-.nf
+-\f3 \-deststorepass <destination keystore pwd>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3importkeystore\fR command can also be used to import a single entry from a source keystore to a destination keystore\&. In this case, besides the options you see in the previous example, you need to specify the alias you want to import\&. With the \f3-srcalias\fR option specified, you can also specify the destination alias name in the command line, as well as protection password for a secret/private key and the destination protection password you want\&. The following command demonstrates this:
+-.sp
+-.nf
+-\f3keytool \-importkeystore\fP
+-.fi
+-.nf
+-\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
+-.fi
+-.nf
+-\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
+-.fi
+-.nf
+-\f3 \-srcstorepass <src keystore password>\fP
+-.fi
+-.nf
+-\f3 \-deststorepass <destination keystore pwd>\fP
+-.fi
+-.nf
+-\f3 \-srcalias myprivatekey \-destalias myoldprivatekey\fP
+-.fi
+-.nf
+-\f3 \-srckeypass <source entry password>\fP
+-.fi
+-.nf
+-\f3 \-destkeypass <destination entry password>\fP
+-.fi
+-.nf
+-\f3 \-noprompt\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS GENERATE\ CERTIFICATES\ FOR\ AN\ SSL\ SERVER
+-The following are \f3keytool\fR commands to generate key pairs and certificates for three entities: Root CA (\f3root\fR), Intermediate CA (\f3ca\fR), and SSL server (\f3server\fR)\&. Ensure that you store all the certificates in the same keystore\&. In these examples, RSA is the recommended the key algorithm\&.
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-keystore root\&.jks \-alias root \-ext bc:c\fP
+-.fi
+-.nf
+-\f3keytool \-genkeypair \-keystore ca\&.jks \-alias ca \-ext bc:c\fP
+-.fi
+-.nf
+-\f3keytool \-genkeypair \-keystore server\&.jks \-alias server\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-keystore root\&.jks \-alias root \-exportcert \-rfc > root\&.pem\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-storepass <storepass> \-keystore ca\&.jks \-certreq \-alias ca |\fP
+-.fi
+-.nf
+-\f3 keytool \-storepass <storepass> \-keystore root\&.jks\fP
+-.fi
+-.nf
+-\f3 \-gencert \-alias root \-ext BC=0 \-rfc > ca\&.pem\fP
+-.fi
+-.nf
+-\f3keytool \-keystore ca\&.jks \-importcert \-alias ca \-file ca\&.pem\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-storepass <storepass> \-keystore server\&.jks \-certreq \-alias server |\fP
+-.fi
+-.nf
+-\f3 keytool \-storepass <storepass> \-keystore ca\&.jks \-gencert \-alias ca\fP
+-.fi
+-.nf
+-\f3 \-ext ku:c=dig,kE \-rfc > server\&.pem\fP
+-.fi
+-.nf
+-\f3cat root\&.pem ca\&.pem server\&.pem |\fP
+-.fi
+-.nf
+-\f3 keytool \-keystore server\&.jks \-importcert \-alias server\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH TERMS
+-.TP
+-Keystore
+-A keystore is a storage facility for cryptographic keys and certificates\&.
+-.TP
+-Keystore entries
+-Keystores can have different types of entries\&. The two most applicable entry types for the \f3keytool\fR command include the following:
+-
+-\fIKey entries\fR: Each entry holds very sensitive cryptographic key information, which is stored in a protected format to prevent unauthorized access\&. Typically, a key stored in this type of entry is a secret key, or a private key accompanied by the certificate chain for the corresponding public key\&. See Certificate Chains\&. The \f3keytool\fR command can handle both types of entries, while the \f3jarsigner\fR tool only handles the latter type of entry, that is private keys and their associated certificate chains\&.
+-
+-\fITrusted certificate entries\fR: Each entry contains a single public key certificate that belongs to another party\&. The entry is called a trusted certificate because the keystore owner trusts that the public key in the certificate belongs to the identity identified by the subject (owner) of the certificate\&. The issuer of the certificate vouches for this, by signing the certificate\&.
+-.TP
+-KeyStore aliases
+-All keystore entries (key and trusted certificate entries) are accessed by way of unique aliases\&.
+-
+-An alias is specified when you add an entity to the keystore with the \f3-genseckey\fR command to generate a secret key, the \f3-genkeypair\fR command to generate a key pair (public and private key), or the \f3-importcert\fR command to add a certificate or certificate chain to the list of trusted certificates\&. Subsequent \f3keytool\fR commands must use this same alias to refer to the entity\&.
+-
+-For example, you can use the alias \f3duke\fR to generate a new public/private key pair and wrap the public key into a self-signed certificate with the following command\&. See Certificate Chains\&.
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-alias duke \-keypass dukekeypasswd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This example specifies an initial password of \f3dukekeypasswd\fR required by subsequent commands to access the private key associated with the alias \f3duke\fR\&. If you later want to change Duke\&'s private key password, use a command such as the following:
+-.sp
+-.nf
+-\f3keytool \-keypasswd \-alias duke \-keypass dukekeypasswd \-new newpass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This changes the password from \f3dukekeypasswd\fR to \f3newpass\fR\&. A password should not be specified on a command line or in a script unless it is for testing purposes, or you are on a secure system\&. If you do not specify a required password option on a command line, then you are prompted for it\&.
+-.TP
+-KeyStore implementation
+-The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies well-defined interfaces to access and modify the information in a keystore\&. It is possible for there to be multiple different concrete implementations, where each implementation is that for a particular type of keystore\&.
+-
+-Currently, two command-line tools (\f3keytool\fR and \f3jarsigner\fR) and a GUI-based tool named Policy Tool make use of keystore implementations\&. Because the \f3KeyStore\fR class is \f3public\fR, users can write additional security applications that use it\&.
+-
+-There is a built-in default implementation, provided by Oracle\&. It implements the keystore as a file with a proprietary keystore type (format) named JKS\&. It protects each private key with its individual password, and also protects the integrity of the entire keystore with a (possibly different) password\&.
+-
+-Keystore implementations are provider-based\&. More specifically, the application interfaces supplied by \f3KeyStore\fR are implemented in terms of a Service Provider Interface (SPI)\&. That is, there is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, which defines the Service Provider Interface methods that providers must implement\&. The term \fIprovider\fR refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
+-
+-Applications can choose different types of keystore implementations from different providers, using the \f3getInstance\fR factory method supplied in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private/secret keys in the keystore and the integrity of the keystore\&. Keystore implementations of different types are not compatible\&.
+-
+-The \f3keytool\fR command works on any file-based keystore implementation\&. It treats the keystore location that is passed to it at the command line as a file name and converts it to a \f3FileInputStream\fR, from which it loads the keystore information\&.)The \f3jarsigner\fR and \f3policytool\fR commands can read a keystore from any location that can be specified with a URL\&.
+-
+-For \f3keytool\fR and \f3jarsigner\fR, you can specify a keystore type at the command line, with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIKeystore\fR menu\&.
+-
+-If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment directory\&. The \f3jre\fR directory in the SDK or the top-level directory of the Java Runtime Environment (JRE)\&.
+-
+-Each tool gets the \f3keystore\&.type\fR value and then examines all the currently installed providers until it finds one that implements a keystores of that type\&. It then uses the keystore implementation from that provider\&.The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type\fR property:
+-.sp
+-.nf
+-\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The default keystore type is \f3jks\fR, which is the proprietary type of the keystore implementation provided by Oracle\&. This is specified by the following line in the security properties file:
+-.sp
+-.nf
+-\f3keystore\&.type=jks\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To have the tools utilize a keystore implementation other than the default, you can change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
+-.sp
+-.nf
+-\f3keystore\&.type=pkcs12\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR Case does not matter in keystore type designations\&. For example, JKS would be considered the same as jks\&.
+-.TP
+-Certificate
+-A certificate (or public-key certificate) is a digitally signed statement from one entity (the issuer), saying that the public key and some other information of another entity (the subject) has some specific value\&. The following terms are related to certificates:
+-
+-\fIPublic Keys\fR: These are numbers associated with a particular entity, and are intended to be known to everyone who needs to have trusted interactions with that entity\&. Public keys are used to verify signatures\&.
+-
+-\fIDigitally Signed\fR: If some data is digitally signed, then it is stored with the identity of an entity and a signature that proves that entity knows about the data\&. The data is rendered unforgeable by signing with the entity\&'s private key\&.
+-
+-\fIIdentity\fR: A known way of addressing an entity\&. In some systems, the identity is the public key, and in others it can be anything from an Oracle Solaris UID to an email address to an X\&.509 distinguished name\&.
+-
+-\fISignature\fR: A signature is computed over some data using the private key of an entity\&. The signer, which in the case of a certificate is also known as the issuer\&.
+-
+-\fIPrivate Keys\fR: These are numbers, each of which is supposed to be known only to the particular entity whose private key it is (that is, it is supposed to be kept secret)\&. Private and public keys exist in pairs in all public key cryptography systems (also referred to as public key crypto systems)\&. In a typical public key crypto system, such as DSA, a private key corresponds to exactly one public key\&. Private keys are used to compute signatures\&.
+-
+-\fIEntity\fR: An entity is a person, organization, program, computer, business, bank, or something else you are trusting to some degree\&.
+-
+-Public key cryptography requires access to users\&' public keys\&. In a large-scale networked environment, it is impossible to guarantee that prior relationships between communicating entities were established or that a trusted repository exists with all used public keys\&. Certificates were invented as a solution to this public key distribution problem\&. Now a Certification Authority (CA) can act as a trusted third party\&. CAs are entities such as businesses that are trusted to sign (issue) certificates for other entities\&. It is assumed that CAs only create valid and reliable certificates because they are bound by legal agreements\&. There are many public Certification Authorities, such as VeriSign, Thawte, Entrust, and so on\&.
+-
+-You can also run your own Certification Authority using products such as Microsoft Certificate Server or the Entrust CA product for your organization\&. With the \f3keytool\fR command, it is possible to display, import, and export certificates\&. It is also possible to generate self-signed certificates\&.
+-
+-The \f3keytool\fR command currently handles X\&.509 certificates\&.
+-.TP
+-X\&.509 Certificates
+-The X\&.509 standard defines what information can go into a certificate and describes how to write it down (the data format)\&. All the data in a certificate is encoded with two related standards called ASN\&.1/DER\&. Abstract Syntax Notation 1 describes data\&. The Definite Encoding Rules describe a single way to store and transfer that data\&.
+-
+-All X\&.509 certificates have the following data, in addition to the signature:
+-
+-\fIVersion\fR: This identifies which version of the X\&.509 standard applies to this certificate, which affects what information can be specified in it\&. Thus far, three versions are defined\&. The \f3keytool\fR command can import and export v1, v2, and v3 certificates\&. It generates v3 certificates\&.
+-
+-X\&.509 Version 1 has been available since 1988, is widely deployed, and is the most generic\&.
+-
+-X\&.509 Version 2 introduced the concept of subject and issuer unique identifiers to handle the possibility of reuse of subject or issuer names over time\&. Most certificate profile documents strongly recommend that names not be reused and that certificates should not make use of unique identifiers\&. Version 2 certificates are not widely used\&.
+-
+-X\&.509 Version 3 is the most recent (1996) and supports the notion of extensions where anyone can define an extension and include it in the certificate\&. Some common extensions are: KeyUsage (limits the use of the keys to particular purposes such as \f3signing-only\fR) and AlternativeNames (allows other identities to also be associated with this public key, for example\&. DNS names, email addresses, IP addresses)\&. Extensions can be marked critical to indicate that the extension should be checked and enforced or used\&. For example, if a certificate has the KeyUsage extension marked critical and set to \f3keyCertSign\fR, then when this certificate is presented during SSL communication, it should be rejected because the certificate extension indicates that the associated private key should only be used for signing certificates and not for SSL use\&.
+-
+-\fISerial number\fR: The entity that created the certificate is responsible for assigning it a serial number to distinguish it from other certificates it issues\&. This information is used in numerous ways\&. For example, when a certificate is revoked its serial number is placed in a Certificate Revocation List (CRL)\&.
+-
+-\fISignature algorithm identifier\fR: This identifies the algorithm used by the CA to sign the certificate\&.
+-
+-\fIIssuer name\fR: The X\&.500 Distinguished Name of the entity that signed the certificate\&. See X\&.500 Distinguished Names\&. This is typically a CA\&. Using this certificate implies trusting the entity that signed this certificate\&. In some cases, such as root or top-level CA certificates, the issuer signs its own certificate\&.
+-
+-\fIValidity period\fR: Each certificate is valid only for a limited amount of time\&. This period is described by a start date and time and an end date and time, and can be as short as a few seconds or almost as long as a century\&. The validity period chosen depends on a number of factors, such as the strength of the private key used to sign the certificate, or the amount one is willing to pay for a certificate\&. This is the expected period that entities can rely on the public value, when the associated private key has not been compromised\&.
+-
+-\fISubject name\fR: The name of the entity whose public key the certificate identifies\&. This name uses the X\&.500 standard, so it is intended to be unique across the Internet\&. This is the X\&.500 Distinguished Name (DN) of the entity\&. See X\&.500 Distinguished Names\&. For example,
+-.sp
+-.nf
+-\f3CN=Java Duke, OU=Java Software Division, O=Oracle Corporation, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-These refer to the subject\&'s common name (CN), organizational unit (OU), organization (O), and country (C)\&.
+-
+-\fISubject public key information\fR: This is the public key of the entity being named with an algorithm identifier that specifies which public key crypto system this key belongs to and any associated key parameters\&.
+-.TP
+-Certificate Chains
+-The \f3keytool\fR command can create and manage keystore key entries that each contain a private key and an associated certificate chain\&. The first certificate in the chain contains the public key that corresponds to the private key\&.
+-
+-When keys are first generated, the chain starts off containing a single element, a self-signed certificate\&. See \f3-genkeypair\fR in Commands\&. A self-signed certificate is one for which the issuer (signer) is the same as the subject\&. The subject is the entity whose public key is being authenticated by the certificate\&. Whenever the \f3-genkeypair\fR command is called to generate a new public/private key pair, it also wraps the public key into a self-signed certificate\&.
+-
+-Later, after a Certificate Signing Request (CSR) was generated with the \f3-certreq\fR command and sent to a Certification Authority (CA), the response from the CA is imported with \f3-importcert\fR, and the self-signed certificate is replaced by a chain of certificates\&. See the \f3-certreq\fR and \f3-importcert\fR options in Commands\&. At the bottom of the chain is the certificate (reply) issued by the CA authenticating the subject\&'s public key\&. The next certificate in the chain is one that authenticates the CA\&'s public key\&.
+-
+-In many cases, this is a self-signed certificate, which is a certificate from the CA authenticating its own public key, and the last certificate in the chain\&. In other cases, the CA might return a chain of certificates\&. In this case, the bottom certificate in the chain is the same (a certificate signed by the CA, authenticating the public key of the key entry), but the second certificate in the chain is a certificate signed by a different CA that authenticates the public key of the CA you sent the CSR to\&. The next certificate in the chain is a certificate that authenticates the second CA\&'s key, and so on, until a self-signed root certificate is reached\&. Each certificate in the chain (after the first) authenticates the public key of the signer of the previous certificate in the chain\&.
+-
+-Many CAs only return the issued certificate, with no supporting chain, especially when there is a flat hierarchy (no intermediates CAs)\&. In this case, the certificate chain must be established from trusted certificate information already stored in the keystore\&.
+-
+-A different reply format (defined by the PKCS #7 standard) includes the supporting certificate chain in addition to the issued certificate\&. Both reply formats can be handled by the \f3keytool\fR command\&.
+-
+-The top-level (root) CA certificate is self-signed\&. However, the trust into the root\&'s public key does not come from the root certificate itself, but from other sources such as a newspaper\&. This is because anybody could generate a self-signed certificate with the distinguished name of, for example, the VeriSign root CA\&. The root CA public key is widely known\&. The only reason it is stored in a certificate is because this is the format understood by most tools, so the certificate in this case is only used as a vehicle to transport the root CA\&'s public key\&. Before you add the root CA certificate to your keystore, you should view it with the \f3-printcert\fR option and compare the displayed fingerprint with the well-known fingerprint obtained from a newspaper, the root CA\&'s Web page, and so on\&.
+-.TP
+-The cacerts Certificates File
+-A certificates file named \f3cacerts\fR resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment\&'s directory, which would be the \f3jre\fR directory in the SDK or the top-level directory of the JRE\&.
+-
+-The \f3cacerts\fR file represents a system-wide keystore with CA certificates\&. System administrators can configure and manage that file with the \f3keytool\fR command by specifying \f3jks\fR as the keystore type\&. The \f3cacerts\fR keystore file ships with a default set of root CA certificates\&. You can list the default certificates with the following command:
+-.sp
+-.nf
+-\f3keytool \-list \-keystore java\&.home/lib/security/cacerts\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The initial password of the \f3cacerts\fR keystore file is \f3changeit\fR\&. System administrators should change that password and the default access permission of that file upon installing the SDK\&.
+-
+-\fINote:\fR It is important to verify your \f3cacerts\fR file\&. Because you trust the CAs in the \f3cacerts\fR file as entities for signing and issuing certificates to other entities, you must manage the \f3cacerts\fR file carefully\&. The \f3cacerts\fR file should contain only certificates of the CAs you trust\&. It is your responsibility to verify the trusted root CA certificates bundled in the \f3cacerts\fR file and make your own trust decisions\&.
+-
+-To remove an untrusted CA certificate from the \f3cacerts\fR file, use the \f3delete\fR option of the \f3keytool\fR command\&. You can find the \f3cacerts\fR file in the JRE installation directory\&. Contact your system administrator if you do not have permission to edit this file
+-.TP
+-Internet RFC 1421 Certificate Encoding Standard
+-Certificates are often stored using the printable encoding format defined by the Internet RFC 1421 standard, instead of their binary encoding\&. This certificate format, also known as Base64 encoding, makes it easy to export certificates to other applications by email or through some other mechanism\&.
+-
+-Certificates read by the \f3-importcert\fR and \f3-printcert\fR commands can be in either this format or binary encoded\&. The \f3-exportcert\fR command by default outputs a certificate in binary encoding, but will instead output a certificate in the printable encoding format, when the \f3-rfc\fR option is specified\&.
+-
+-The \f3-list\fR command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format\&. If the \f3-rfc\fR option is specified, then the certificate is output in the printable encoding format\&.
+-
+-In its printable encoding format, the encoded certificate is bounded at the beginning and end by the following text:
+-.sp
+-.nf
+-\f3\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3encoded certificate goes here\&. \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-\-\-\-\-END CERTIFICATE\-\-\-\-\-\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-X\&.500 Distinguished Names
+-X\&.500 Distinguished Names are used to identify entities, such as those that are named by the \f3subject\fR and \f3issuer\fR (signer) fields of X\&.509 certificates\&. The \f3keytool\fR command supports the following subparts:
+-
+-\fIcommonName\fR: The common name of a person such as Susan Jones\&.
+-
+-\fIorganizationUnit\fR: The small organization (such as department or division) name\&. For example, Purchasing\&.
+-
+-\fIlocalityName\fR: The locality (city) name, for example, Palo Alto\&.
+-
+-\fIstateName\fR: State or province name, for example, California\&.
+-
+-\fIcountry\fR: Two-letter country code, for example, CH\&.
+-
+-When you supply a distinguished name string as the value of a \f3-dname\fR option, such as for the \f3-genkeypair\fR command, the string must be in the following format:
+-.sp
+-.nf
+-\f3CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-All the italicized items represent actual values and the previous keywords are abbreviations for the following:
+-.sp
+-.nf
+-\f3CN=commonName\fP
+-.fi
+-.nf
+-\f3OU=organizationUnit\fP
+-.fi
+-.nf
+-\f3O=organizationName\fP
+-.fi
+-.nf
+-\f3L=localityName\fP
+-.fi
+-.nf
+-\f3S=stateName\fP
+-.fi
+-.nf
+-\f3C=country\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-A sample distinguished name string is:
+-.sp
+-.nf
+-\f3CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino, S=California, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-A sample command using such a string is:
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-dname "CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino,\fP
+-.fi
+-.nf
+-\f3S=California, C=US" \-alias mark\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Case does not matter for the keyword abbreviations\&. For example, CN, cn, and Cn are all treated the same\&.
+-
+-Order matters; each subcomponent must appear in the designated order\&. However, it is not necessary to have all the subcomponents\&. You can use a subset, for example:
+-.sp
+-.nf
+-\f3CN=Steve Meier, OU=Java, O=Oracle, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If a distinguished name string value contains a comma, then the comma must be escaped by a backslash (\e) character when you specify the string on a command line, as in:
+-.sp
+-.nf
+-\f3cn=Peter Schuster, ou=Java\e, Product Development, o=Oracle, c=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-It is never necessary to specify a distinguished name string on a command line\&. When the distinguished name is needed for a command, but not supplied on the command line, the user is prompted for each of the subcomponents\&. In this case, a comma does not need to be escaped by a backslash (\e)\&.
+-.SH WARNINGS
+-.SS IMPORTING\ TRUSTED\ CERTIFICATES\ WARNING
+-\fIImportant\fR: Be sure to check a certificate very carefully before importing it as a trusted certificate\&.
+-.PP
+-Windows Example:
+-
+-View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose sends or emails you a certificate that you put it in a file named \f3\etmp\ecert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
+-.sp
+-.nf
+-\f3 keytool \-printcert \-file \etmp\ecert\fP
+-.fi
+-.nf
+-\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Serial Number: 59092b34\fP
+-.fi
+-.nf
+-\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
+-.fi
+-.nf
+-\f3 Certificate Fingerprints:\fP
+-.fi
+-.nf
+-\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
+-.fi
+-.nf
+-\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
+-.fi
+-.nf
+-\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
+-.fi
+-.nf
+-\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
+-.fi
+-.sp
+-
+-.PP
+-Oracle Solaris Example:
+-
+-View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose someone sends or emails you a certificate that you put it in a file named \f3/tmp/cert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
+-.sp
+-.nf
+-\f3 keytool \-printcert \-file /tmp/cert\fP
+-.fi
+-.nf
+-\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Serial Number: 59092b34\fP
+-.fi
+-.nf
+-\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
+-.fi
+-.nf
+-\f3 Certificate Fingerprints:\fP
+-.fi
+-.nf
+-\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
+-.fi
+-.nf
+-\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
+-.fi
+-.nf
+-\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
+-.fi
+-.nf
+-\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Then call or otherwise contact the person who sent the certificate and compare the fingerprints that you see with the ones that they show\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s certificate such as an attacker\&'s certificate\&. If such an attack took place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker signed, for example, a JAR file with malicious class files inside\&.
+-.PP
+-\fINote:\fR It is not required that you execute a \f3-printcert\fR command before importing a certificate\&. This is because before you add a certificate to the list of trusted certificates in the keystore, the \f3-importcert\fR command prints out the certificate information and prompts you to verify it\&. You can then stop the import operation\&. However, you can do this only when you call the \f3-importcert\fR command without the \f3-noprompt\fR option\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
+-.SS PASSWORDS\ WARNING
+-Most commands that operate on a keystore require the store password\&. Some commands require a private/secret key password\&. Passwords can be specified on the command line in the \f3-storepass\fR and \f3-keypass\fR options\&. However, a password should not be specified on a command line or in a script unless it is for testing, or you are on a secure system\&. When you do not specify a required password option on a command line, you are prompted for it\&.
+-.SS CERTIFICATE\ CONFORMANCE\ WARNING
+-The Internet standard RFC 5280 has defined a profile on conforming X\&.509 certificates, which includes what values and value combinations are valid for certificate fields and extensions\&. See the standard at http://tools\&.ietf\&.org/rfc/rfc5280\&.txt
+-.PP
+-The \f3keytool\fR command does not enforce all of these rules so it can generate certificates that do not conform to the standard\&. Certificates that do not conform to the standard might be rejected by JRE or other applications\&. Users should ensure that they provide the correct options for \f3-dname\fR, \f3-ext\fR, and so on\&.
+-.SH NOTES
+-.SS IMPORT\ A\ NEW\ TRUSTED\ CERTIFICATE
+-Before you add the certificate to the keystore, the \f3keytool\fR command verifies it by attempting to construct a chain of trust from that certificate to a self-signed certificate (belonging to a root CA), using trusted certificates that are already available in the keystore\&.
+-.PP
+-If the \f3-trustcacerts\fR option was specified, then additional certificates are considered for the chain of trust, namely the certificates in a file named \f3cacerts\fR\&.
+-.PP
+-If the \f3keytool\fR command fails to establish a trust path from the certificate to be imported up to a self-signed certificate (either from the keystore or the \f3cacerts\fR file), then the certificate information is printed, and the user is prompted to verify it by comparing the displayed certificate fingerprints with the fingerprints obtained from some other (trusted) source of information, which might be the certificate owner\&. Be very careful to ensure the certificate is valid before importing it as a trusted certificate\&. See Importing Trusted Certificates Warning\&. The user then has the option of stopping the import operation\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
+-.SS IMPORT\ A\ CERTIFICATE\ REPLY
+-When you import a certificate reply, the certificate reply is validated with trusted certificates from the keystore, and optionally, the certificates configured in the \f3cacerts\fR keystore file when the \f3-trustcacert\fR\f3s\fR option is specified\&. See The cacerts Certificates File\&.
+-.PP
+-The methods of determining whether the certificate reply is trusted are as follows:
+-.TP 0.2i
+-\(bu
+-If the reply is a single X\&.509 certificate, then the \f3keytool\fR command attempts to establish a trust chain, starting at the certificate reply and ending at a self-signed certificate (belonging to a root CA)\&. The certificate reply and the hierarchy of certificates is used to authenticate the certificate reply from the new certificate chain of aliases\&. If a trust chain cannot be established, then the certificate reply is not imported\&. In this case, the \f3keytool\fR command does not print the certificate and prompt the user to verify it, because it is very difficult for a user to determine the authenticity of the certificate reply\&.
+-.TP 0.2i
+-\(bu
+-If the reply is a PKCS #7 formatted certificate chain or a sequence of X\&.509 certificates, then the chain is ordered with the user certificate first followed by zero or more CA certificates\&. If the chain ends with a self-signed root CA certificate and the\f3-trustcacerts\fR option was specified, the \f3keytool\fR command attempts to match it with any of the trusted certificates in the keystore or the \f3cacerts\fR keystore file\&. If the chain does not end with a self-signed root CA certificate and the \f3-trustcacerts\fR option was specified, the \f3keytool\fR command tries to find one from the trusted certificates in the keystore or the \f3cacerts\fR keystore file and add it to the end of the chain\&. If the certificate is not found and the \f3-noprompt\fR option is not specified, the information of the last certificate in the chain is printed, and the user is prompted to verify it\&.
+-.PP
+-If the public key in the certificate reply matches the user\&'s public key already stored with \f3alias\fR, then the old certificate chain is replaced with the new certificate chain in the reply\&. The old chain can only be replaced with a valid \f3keypass\fR, and so the password used to protect the private key of the entry is supplied\&. If no password is provided, and the private key password is different from the keystore password, the user is prompted for it\&.
+-.PP
+-This command was named \f3-import\fR in earlier releases\&. This old name is still supported in this release\&. The new name, \f3-importcert\fR, is preferred going forward\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
+-.TP 0.2i
+-\(bu
+-Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
++
++.SH NAME
++keytool \- Manages a keystore (database) of cryptographic keys, X\&.509 certificate chains, and trusted certificates\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBkeytool\fR [\fIcommands\fR]
++.fi
++.sp
++.TP
++\fIcommands\fR
++See Commands\&. These commands are categorized by task as follows:
++.RS
++.TP 0.2i
++\(bu
++Create or Add Data to the Keystore
++.RS
++.TP 0.2i
++\(bu
++-gencert
++.TP 0.2i
++\(bu
++-genkeypair
++.TP 0.2i
++\(bu
++-genseckey
++.TP 0.2i
++\(bu
++-importcert
++.TP 0.2i
++\(bu
++-importpassword
++.RE
++
++.TP 0.2i
++\(bu
++Import Contents From Another Keystore
++.RS
++.TP 0.2i
++\(bu
++-importkeystore
++.RE
++
++.TP 0.2i
++\(bu
++Generate Certificate Request
++.RS
++.TP 0.2i
++\(bu
++-certreq
++.RE
++
++.TP 0.2i
++\(bu
++Export Data
++.RS
++.TP 0.2i
++\(bu
++-exportcert
++.RE
++
++.TP 0.2i
++\(bu
++Display Data
++.RS
++.TP 0.2i
++\(bu
++-list
++.TP 0.2i
++\(bu
++-printcert
++.TP 0.2i
++\(bu
++-printcertreq
++.TP 0.2i
++\(bu
++-printcrl
++.RE
++
++.TP 0.2i
++\(bu
++Manage the Keystore
++.RS
++.TP 0.2i
++\(bu
++-storepasswd
++.TP 0.2i
++\(bu
++-keypasswd
++.TP 0.2i
++\(bu
++-delete
++.TP 0.2i
++\(bu
++-changealias
++.RE
++
++.TP 0.2i
++\(bu
++Get Help
++.RS
++.TP 0.2i
++\(bu
++-help
++.RE
++
++.RE
++
++.SH DESCRIPTION
++The \f3keytool\fR command is a key and certificate management utility\&. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself or herself to other users and services) or data integrity and authentication services, using digital signatures\&. The \f3keytool\fR command also enables users to cache the public keys (in the form of certificates) of their communicating peers\&.
++.PP
++A certificate is a digitally signed statement from one entity (person, company, and so on\&.), that says that the public key (and some other information) of some other entity has a particular value\&. (See Certificate\&.) When data is digitally signed, the signature can be verified to check the data integrity and authenticity\&. Integrity means that the data has not been modified or tampered with, and authenticity means the data comes from whoever claims to have created and signed it\&.
++.PP
++The \f3keytool\fR command also enables users to administer secret keys and passphrases used in symmetric encryption and decryption (DES)\&.
++.PP
++The \f3keytool\fR command stores the keys and certificates in a keystore\&. See KeyStore aliases\&.
++.SH COMMAND\ AND\ OPTION\ NOTES
++See Commands for a listing and description of the various commands\&.
++.TP 0.2i
++\(bu
++All command and option names are preceded by a minus sign (-)\&.
++.TP 0.2i
++\(bu
++The options for each command can be provided in any order\&.
++.TP 0.2i
++\(bu
++All items not italicized or in braces or brackets are required to appear as is\&.
++.TP 0.2i
++\(bu
++Braces surrounding an option signify that a default value will be used when the option is not specified on the command line\&. See Option Defaults\&. Braces are also used around the \f3-v\fR, \f3-rfc\fR, and \f3-J\fR options, which only have meaning when they appear on the command line\&. They do not have any default values other than not existing\&.
++.TP 0.2i
++\(bu
++Brackets surrounding an option signify that the user is prompted for the values when the option is not specified on the command line\&. For the \f3-keypass\fR option, if you do not specify the option on the command line, then the \f3keytool\fR command first attempts to use the keystore password to recover the private/secret key\&. If this attempt fails, then the \f3keytool\fR command prompts you for the private/secret key password\&.
++.TP 0.2i
++\(bu
++Items in italics (option values) represent the actual values that must be supplied\&. For example, here is the format of the \f3-printcert\fR command:
++.sp
++.nf
++\f3keytool \-printcert {\-file \fIcert_file\fR} {\-v}\fP
++.fi
++.sp
++
++
++
++
++When you specify a \f3-printcert\fR command, replace \fIcert_file\fR with the actual file name, as follows: \f3keytool -printcert -file VScert\&.cer\fR
++.TP 0.2i
++\(bu
++Option values must be put in quotation marks when they contain a blank (space)\&.
++.TP 0.2i
++\(bu
++The \f3-help\fR option is the default\&. The \f3keytool\fR command is the same as \f3keytool -help\fR\&.
++.SH OPTION\ DEFAULTS
++The following examples show the defaults for various option values\&.
++.sp
++.nf
++\f3\-alias "mykey"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keyalg\fP
++.fi
++.nf
++\f3 "DSA" (when using \-genkeypair)\fP
++.fi
++.nf
++\f3 "DES" (when using \-genseckey)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keysize\fP
++.fi
++.nf
++\f3 2048 (when using \-genkeypair and \-keyalg is "RSA")\fP
++.fi
++.nf
++\f3 1024 (when using \-genkeypair and \-keyalg is "DSA")\fP
++.fi
++.nf
++\f3 256 (when using \-genkeypair and \-keyalg is "EC")\fP
++.fi
++.nf
++\f3 56 (when using \-genseckey and \-keyalg is "DES")\fP
++.fi
++.nf
++\f3 168 (when using \-genseckey and \-keyalg is "DESede")\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-validity 90\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keystore <the file named \&.keystore in the user\&'s home directory>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-storetype <the value of the "keystore\&.type" property in the\fP
++.fi
++.nf
++\f3 security properties file, which is returned by the static\fP
++.fi
++.nf
++\f3 getDefaultType method in java\&.security\&.KeyStore>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-file\fP
++.fi
++.nf
++\f3 stdin (if reading)\fP
++.fi
++.nf
++\f3 stdout (if writing)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-protected false\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In generating a public/private key pair, the signature algorithm (\f3-sigalg\fR option) is derived from the algorithm of the underlying private key:
++.TP 0.2i
++\(bu
++If the underlying private key is of type DSA, then the \f3-sigalg\fR option defaults to SHA1withDSA\&.
++.TP 0.2i
++\(bu
++If the underlying private key is of type RSA, then the \f3-sigalg\fR option defaults to SHA256withRSA\&.
++.TP 0.2i
++\(bu
++If the underlying private key is of type EC, then the \f3-sigalg\fR option defaults to SHA256withECDSA\&.
++.PP
++For a full list of \f3-keyalg\fR and \f3-sigalg\fR arguments, see Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++.SH COMMON\ OPTIONS
++The \f3-v\fR option can appear for all commands except \f3-help\fR\&. When the \f3-v\fR option appears, it signifies verbose mode, which means that more information is provided in the output\&.
++.PP
++There is also a \f3-Jjavaoption\fR argument that can appear for any command\&. When the \f3-Jjavaoption\fR appears, the specified \f3javaoption\fR string is passed directly to the Java interpreter\&. This option does not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
++.PP
++These options can appear for all commands operating on a keystore:
++.TP
++-storetype \fIstoretype\fR
++.br
++This qualifier specifies the type of keystore to be instantiated\&.
++.TP
++-keystore \fIkeystore\fR
++.br
++The keystore location\&.
++
++If the JKS \f3storetype\fR is used and a keystore file does not yet exist, then certain \f3keytool\fR commands can result in a new keystore file being created\&. For example, if \f3keytool -genkeypair\fR is called and the \f3-keystore\fR option is not specified, the default keystore file named \f3\&.keystore\fR in the user\&'s home directory is created when it does not already exist\&. Similarly, if the \f3-keystore ks_file\fR option is specified but ks_file does not exist, then it is created\&. For more information on the JKS \f3storetype\fR, see the \fIKeyStore Implementation\fR section in KeyStore aliases\&.
++
++Note that the input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified if the keystore is not file-based\&. For example, when it resides on a hardware token device\&.
++.TP
++-storepass[:\fIenv\fR| :\fIfile\fR] argument
++.br
++The password that is used to protect the integrity of the keystore\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the \f3value\fR argument, which must be at least 6 characters long\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named argument\&.
++.RE
++
++
++\fINote:\fR All other options that require passwords, such as \f3-keypass\fR, \f3-srckeypass\fR, -\f3destkeypass\fR, \f3-srcstorepass\fR, and \f3-deststorepass\fR, accept the \fIenv\fR and \fIfile\fR modifiers\&. Remember to separate the password option and the modifier with a colon (:)\&.
++
++The password must be provided to all commands that access the keystore contents\&. For such commands, when the \f3-storepass\fR option is not provided at the command line, the user is prompted for it\&.
++
++When retrieving information from the keystore, the password is optional\&. If no password is specified, then the integrity of the retrieved information cannot be verified and a warning is displayed\&.
++.TP
++-providerName \fIprovider_name\fR
++.br
++Used to identify a cryptographic service provider\&'s name when listed in the security properties file\&.
++.TP
++-providerClass \fIprovider_class_name\fR
++.br
++Used to specify the name of a cryptographic service provider\&'s master class file when the service provider is not listed in the security properties file\&.
++.TP
++-providerArg \fIprovider_arg\fR
++.br
++Used with the \f3-providerClass\fR option to represent an optional string input argument for the constructor of \f3provider_class_name\fR\&.
++.TP
++-protected
++.br
++Either \f3true\fR or \f3false\fR\&. This value should be specified as \f3true\fR when a password must be specified by way of a protected authentication path such as a dedicated PIN reader\&.Because there are two keystores involved in the \f3-importkeystore\fR command, the following two options \f3-srcprotected\fR and -\f3destprotected\fR are provided for the source keystore and the destination keystore respectively\&.
++.TP
++-ext \fI{name{:critical} {=value}}\fR
++.br
++Denotes an X\&.509 certificate extension\&. The option can be used in \f3-genkeypair\fR and \f3-gencert\fR to embed extensions into the certificate generated, or in \f3-certreq\fR to show what extensions are requested in the certificate request\&. The option can appear multiple times\&. The \f3name\fR argument can be a supported extension name (see Named Extensions) or an arbitrary OID number\&. The \f3value\fR argument, when provided, denotes the argument for the extension\&. When \fIvalue\fR is omitted, that means that the default value of the extension or the extension requires no argument\&. The \f3:critical\fR modifier, when provided, means the extension\&'s \f3isCritical\fR attribute is \f3true\fR; otherwise, it is \f3false\fR\&. You can use \f3:c\fR in place of \f3:critical\fR\&.
++.SH NAMED\ EXTENSIONS
++The \f3keytool\fR command supports these named extensions\&. The names are not case-sensitive)\&.
++.TP
++BC or BasicContraints
++\fIValues\fR: The full form is: \f3ca:{true|false}[,pathlen:<len>]\fR or \f3<len>\fR, which is short for \f3ca:true,pathlen:<len>\fR\&. When <\f3len\fR> is omitted, you have \f3ca:true\fR\&.
++.TP
++KU or KeyUsage
++\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3digitalSignature\fR, \f3nonRepudiation\fR (contentCommitment), \f3keyEncipherment\fR, \f3dataEncipherment\fR, \f3keyAgreement\fR, \f3keyCertSign\fR, \f3cRLSign\fR, \f3encipherOnly\fR, \f3decipherOnly\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters (\f3dig\fR for \f3digitalSignature\fR) or in camel-case style (\f3dS\fR for \f3digitalSignature\fR or \f3cRLS\fR for \f3cRLSign\fR), as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
++.TP
++EKU or ExtendedKeyUsage
++\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3anyExtendedKeyUsage\fR, \f3serverAuth\fR, \f3clientAuth\fR, \f3codeSigning\fR, \f3emailProtection\fR, \f3timeStamping\fR, \f3OCSPSigning\fR, or any \fIOID string\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters or in camel-case style, as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
++.TP
++SAN or SubjectAlternativeName
++\fIValues\fR: \f3type\fR:\f3value\fR(,t\f3ype:value\fR)*, where \f3type\fR can be \f3EMAIL\fR, \f3URI\fR, \f3DNS\fR, \f3IP\fR, or \f3OID\fR\&. The \f3value\fR argument is the string format value for the \f3type\fR\&.
++.TP
++IAN or IssuerAlternativeName
++\fIValues\fR: Same as \f3SubjectAlternativeName\fR\&.
++.TP
++SIA or SubjectInfoAccess
++\fIValues\fR: \f3method\fR:\f3location-type\fR:\f3location-value\fR (,\f3method:location-type\fR:\f3location-value\fR)*, where \f3method\fR can be \f3timeStamping\fR, \f3caRepository\fR or any OID\&. The \f3location-type\fR and \f3location-value\fR arguments can be any \f3type\fR:\f3value\fR supported by the \f3SubjectAlternativeName\fR extension\&.
++.TP
++AIA or AuthorityInfoAccess
++\fIValues\fR: Same as \f3SubjectInfoAccess\fR\&. The \f3method\fR argument can be \f3ocsp\fR,\f3caIssuers\fR, or any OID\&.
++.PP
++When \f3name\fR is OID, the value is the hexadecimal dumped DER encoding of the \f3extnValue\fR for the extension excluding the OCTET STRING type and length bytes\&. Any extra character other than standard hexadecimal numbers (0-9, a-f, A-F) are ignored in the HEX string\&. Therefore, both 01:02:03:04 and 01020304 are accepted as identical values\&. When there is no value, the extension has an empty value field\&.
++.PP
++A special name \f3honored\fR, used in \f3-gencert\fR only, denotes how the extensions included in the certificate request should be honored\&. The value for this name is a comma separated list of \f3all\fR (all requested extensions are honored), \f3name{:[critical|non-critical]}\fR (the named extension is honored, but using a different \f3isCritical\fR attribute) and \f3-name\fR (used with \f3all\fR, denotes an exception)\&. Requested extensions are not honored by default\&.
++.PP
++If, besides the\f3-ext honored\fR option, another named or OID \f3-ext\fR option is provided, this extension is added to those already honored\&. However, if this name (or OID) also appears in the honored value, then its value and criticality overrides the one in the request\&.
++.PP
++The \f3subjectKeyIdentifier\fR extension is always created\&. For non-self-signed certificates, the \f3authorityKeyIdentifier\fR is created\&.
++.PP
++\fINote:\fR Users should be aware that some combinations of extensions (and other certificate fields) may not conform to the Internet standard\&. See Certificate Conformance Warning\&.
++.SH COMMANDS
++.TP
++-gencert
++.sp
++.nf
++\f3{\-rfc} {\-infile \fIinfile\fR} {\-outfile \fIoutfile\fR} {\-alias \fIalias\fR} {\-sigalg \fIsigalg\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-dname \fIdname\fR} {\-startdate \fIstartdate\fR {\-ext \fIext\fR}* {\-validity \fIvalDays\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-keypass \fIkeypass\fR] {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-providername \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a certificate as a response to a certificate request file (which can be created by the \f3keytool\fR\f3-certreq\fR command)\&. The command reads the request from \fIinfile\fR (if omitted, from the standard input), signs it using alias\&'s private key, and outputs the X\&.509 certificate into \fIoutfile\fR (if omitted, to the standard output)\&. When\f3-rfc\fR is specified, the output format is Base64-encoded PEM; otherwise, a binary DER is created\&.
++
++The \f3sigalg\fR value specifies the algorithm that should be used to sign the certificate\&. The \f3startdate\fR argument is the start time and date that the certificate is valid\&. The \f3valDays\fR argument tells the number of days for which the certificate should be considered valid\&.
++
++When \f3dname\fR is provided, it is used as the subject of the generated certificate\&. Otherwise, the one from the certificate request is used\&.
++
++The \f3ext\fR value shows what X\&.509 extensions will be embedded in the certificate\&. Read Common Options for the grammar of \f3-ext\fR\&.
++
++The \f3-gencert\fR option enables you to create certificate chains\&. The following example creates a certificate, \f3e1\fR, that contains three certificates in its certificate chain\&.
++
++The following commands creates four key pairs named \f3ca\fR, \f3ca1\fR, \f3ca2\fR, and \f3e1\fR:
++.sp
++.nf
++\f3keytool \-alias ca \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias ca1 \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias ca2 \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias e1 \-dname CN=E1 \-genkeypair\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following two commands create a chain of signed certificates; \f3ca\fR signs \f3ca1\fR and \f3ca1\fR signs \f3ca2\fR, all of which are self-issued:
++.sp
++.nf
++\f3keytool \-alias ca1 \-certreq |\fP
++.fi
++.nf
++\f3 keytool \-alias ca \-gencert \-ext san=dns:ca1 |\fP
++.fi
++.nf
++\f3 keytool \-alias ca1 \-importcert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-alias ca2 \-certreq |\fP
++.fi
++.nf
++\f3 $KT \-alias ca1 \-gencert \-ext san=dns:ca2 |\fP
++.fi
++.nf
++\f3 $KT \-alias ca2 \-importcert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following command creates the certificate \f3e1\fR and stores it in the file \f3e1\&.cert\fR, which is signed by \f3ca2\fR\&. As a result, \f3e1\fR should contain \f3ca\fR, \f3ca1\fR, and \f3ca2\fR in its certificate chain:
++.sp
++.nf
++\f3keytool \-alias e1 \-certreq | keytool \-alias ca2 \-gencert > e1\&.cert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-genkeypair
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} {\-sigalg \fIsigalg\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-dname \fIdname\fR] [\-keypass \fIkeypass\fR] {\-startdate \fIvalue\fR} {\-ext \fIext\fR}*\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-validity \fIvalDays\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a key pair (a public key and associated private key)\&. Wraps the public key into an X\&.509 v3 self-signed certificate, which is stored as a single-element certificate chain\&. This certificate chain and the private key are stored in a new keystore entry identified by alias\&.
++
++The \f3keyalg\fR value specifies the algorithm to be used to generate the key pair, and the \f3keysize\fR value specifies the size of each key to be generated\&. The \f3sigalg\fR value specifies the algorithm that should be used to sign the self-signed certificate\&. This algorithm must be compatible with the \f3keyalg\fR value\&.
++
++The \f3dname\fR value specifies the X\&.500 Distinguished Name to be associated with the value of \f3alias\fR, and is used as the issuer and subject fields in the self-signed certificate\&. If no distinguished name is provided at the command line, then the user is prompted for one\&.
++
++The value of \f3keypass\fR is a password used to protect the private key of the generated key pair\&. If no password is provided, then the user is prompted for it\&. If you press \fIthe Return key\fR at the prompt, then the key password is set to the same password as the keystore password\&. The \f3keypass\fR value must be at least 6 characters\&.
++
++The value of \f3startdate\fR specifies the issue time of the certificate, also known as the "Not Before" value of the X\&.509 certificate\&'s Validity field\&.
++
++The option value can be set in one of these two forms:
++
++\f3([+-]nnn[ymdHMS])+\fR
++
++\f3[yyyy/mm/dd] [HH:MM:SS]\fR
++
++With the first form, the issue time is shifted by the specified value from the current time\&. The value is a concatenation of a sequence of subvalues\&. Inside each subvalue, the plus sign (+) means shift forward, and the minus sign (-) means shift backward\&. The time to be shifted is \f3nnn\fR units of years, months, days, hours, minutes, or seconds (denoted by a single character of \f3y\fR, \f3m\fR, \f3d\fR, \f3H\fR, \f3M\fR, or \f3S\fR respectively)\&. The exact value of the issue time is calculated using the \f3java\&.util\&.GregorianCalendar\&.add(int field, int amount)\fR method on each subvalue, from left to right\&. For example, by specifying, the issue time will be:
++.sp
++.nf
++\f3Calendar c = new GregorianCalendar();\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.YEAR, \-1);\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.MONTH, 1);\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.DATE, \-1);\fP
++.fi
++.nf
++\f3return c\&.getTime()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++With the second form, the user sets the exact issue time in two parts, year/month/day and hour:minute:second (using the local time zone)\&. The user can provide only one part, which means the other part is the same as the current date (or time)\&. The user must provide the exact number of digits as shown in the format definition (padding with 0 when shorter)\&. When both the date and time are provided, there is one (and only one) space character between the two parts\&. The hour should always be provided in 24 hour format\&.
++
++When the option is not provided, the start date is the current time\&. The option can be provided at most once\&.
++
++The value of \f3valDays\fR specifies the number of days (starting at the date specified by \f3-startdate\fR, or the current date when \f3-startdate\fR is not specified) for which the certificate should be considered valid\&.
++
++This command was named \f3-genkey\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-genkeypair\fR, is preferred going forward\&.
++.TP
++-genseckey
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} [\-keypass \fIkeypass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a secret key and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&.
++
++The value of \f3keyalg\fR specifies the algorithm to be used to generate the secret key, and the value of \f3keysize\fR specifies the size of the key to be generated\&. The \f3keypass\fR value is a password that protects the secret key\&. If no password is provided, then the user is prompted for it\&. If you press the Return key at the prompt, then the key password is set to the same password that is used for the \f3keystore\fR\&. The \f3keypass\fR value must be at least 6 characters\&.
++.TP
++-importcert
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} [\-keypass \fIkeypass\fR] {\-noprompt} {\-trustcacerts}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads the certificate or certificate chain (where the latter is supplied in a PKCS#7 formatted reply or a sequence of X\&.509 certificates) from the file \f3cert_file\fR, and stores it in the \f3keystore\fR entry identified by \f3alias\fR\&. If no file is specified, then the certificate or certificate chain is read from \f3stdin\fR\&.
++
++The \f3keytool\fR command can import X\&.509 v1, v2, and v3 certificates, and PKCS#7 formatted certificate chains consisting of certificates of that type\&. The data to be imported must be provided either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. In the latter case, the encoding must be bounded at the beginning by a string that starts with \f3-\fR\f3----BEGIN\fR, and bounded at the end by a string that starts with \f3-----END\fR\&.
++
++You import a certificate for two reasons: To add it to the list of trusted certificates, and to import a certificate reply received from a certificate authority (CA) as the result of submitting a Certificate Signing Request to that CA (see the \f3-certreq\fR option in Commands)\&.
++
++Which type of import is intended is indicated by the value of the \f3-alias\fR option\&. If the alias does not point to a key entry, then the \f3keytool\fR command assumes you are adding a trusted certificate entry\&. In this case, the alias should not already exist in the keystore\&. If the alias does already exist, then the \f3keytool\fR command outputs an error because there is already a trusted certificate for that alias, and does not import the certificate\&. If the alias points to a key entry, then the \f3keytool\fR command assumes you are importing a certificate reply\&.
++.TP
++-importpassword
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Imports a passphrase and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&. The passphrase may be supplied via the standard input stream; otherwise the user is prompted for it\&. \f3keypass\fR is a password used to protect the imported passphrase\&. If no password is provided, the user is prompted for it\&. If you press the Return key at the prompt, the key password is set to the same password as that used for the \f3keystore\fR\&. \f3keypass\fR must be at least 6 characters long\&.
++.TP
++-importkeystore
++.sp
++.nf
++\f3{\-srcstoretype \fIsrcstoretype\fR} {\-deststoretype \fIdeststoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-srcstorepass \fIsrcstorepass\fR] [\-deststorepass \fIdeststorepass\fR] {\-srcprotected}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-destprotected} \fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-srcalias \fIsrcalias\fR {\-destalias \fIdestalias\fR} [\-srckeypass \fIsrckeypass\fR]} \fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-destkeypass \fIdestkeypass\fR] {\-noprompt}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-srcProviderName \fIsrc_provider_name\fR} {\-destProviderName \fIdest_provider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Imports a single entry or all entries from a source keystore to a destination keystore\&.
++
++When the \f3-srcalias\fR option is provided, the command imports the single entry identified by the alias to the destination keystore\&. If a destination alias is not provided with \f3destalias\fR, then \f3srcalias\fR is used as the destination alias\&. If the source entry is protected by a password, then \f3srckeypass\fR is used to recover the entry\&. If \fIsrckeypass\fR is not provided, then the \f3keytool\fR command attempts to use \f3srcstorepass\fR to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. The destination entry is protected with \f3destkeypass\fR\&. If \f3destkeypass\fR is not provided, then the destination entry is protected with the source entry password\&. For example, most third-party tools require \f3storepass\fR and \f3keypass\fR in a PKCS #12 keystore to be the same\&. In order to create a PKCS #12 keystore for these tools, always specify a \f3-destkeypass\fR to be the same as \f3-deststorepass\fR\&.
++
++If the \f3-srcalias\fR option is not provided, then all entries in the source keystore are imported into the destination keystore\&. Each destination entry is stored under the alias from the source entry\&. If the source entry is protected by a password, then \f3srcstorepass\fR is used to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. If a source keystore entry type is not supported in the destination keystore, or if an error occurs while storing an entry into the destination keystore, then the user is prompted whether to skip the entry and continue or to quit\&. The destination entry is protected with the source entry password\&.
++
++If the destination alias already exists in the destination keystore, then the user is prompted to either overwrite the entry or to create a new entry under a different alias name\&.
++
++If the \f3-noprompt\fR option is provided, then the user is not prompted for a new destination alias\&. Existing entries are overwritten with the destination alias name\&. Entries that cannot be imported are skipped and a warning is displayed\&.
++.TP
++-printcertreq
++.sp
++.nf
++\f3{\-file \fIfile\fR}\fP
++.fi
++.sp
++
++
++Prints the content of a PKCS #10 format certificate request, which can be generated by the \f3keytool\fR\f3-certreq\fR command\&. The command reads the request from file\&. If there is no file, then the request is read from the standard input\&.
++.TP
++-certreq
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-dname \fIdname\fR} {\-sigalg \fIsigalg\fR} {\-file \fIcertreq_file\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a Certificate Signing Request (CSR) using the PKCS #10 format\&.
++
++A CSR is intended to be sent to a certificate authority (CA)\&. The CA authenticates the certificate requestor (usually off-line) and will return a certificate or certificate chain, used to replace the existing certificate chain (which initially consists of a self-signed certificate) in the keystore\&.
++
++The private key associated with alias is used to create the PKCS #10 certificate request\&. To access the private key, the correct password must be provided\&. If \f3keypass\fR is not provided at the command line and is different from the password used to protect the integrity of the keystore, then the user is prompted for it\&. If \f3dname\fR is provided, then it is used as the subject in the CSR\&. Otherwise, the X\&.500 Distinguished Name associated with alias is used\&.
++
++The \f3sigalg\fR value specifies the algorithm that should be used to sign the CSR\&.
++
++The CSR is stored in the file certreq_file\&. If no file is specified, then the CSR is output to \f3stdout\fR\&.
++
++Use the \f3importcert\fR command to import the response from the CA\&.
++.TP
++-exportcert
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-rfc} {\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads from the keystore the certificate associated with \fIalias\fR and stores it in the cert_file file\&. When no file is specified, the certificate is output to \f3stdout\fR\&.
++
++The certificate is by default output in binary encoding\&. If the \f3-rfc\fR option is specified, then the output in the printable encoding format defined by the Internet RFC 1421 Certificate Encoding Standard\&.
++
++If \f3alias\fR refers to a trusted certificate, then that certificate is output\&. Otherwise, \f3alias\fR refers to a key entry with an associated certificate chain\&. In that case, the first certificate in the chain is returned\&. This certificate authenticates the public key of the entity addressed by \f3alias\fR\&.
++
++This command was named \f3-export\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-exportcert\fR, is preferred going forward\&.
++.TP
++-list
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v | \-rfc} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Prints to \f3stdout\fR the contents of the keystore entry identified by \f3alias\fR\&. If no \f3alias\fR is specified, then the contents of the entire keystore are printed\&.
++
++This command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format, with additional information such as the owner, issuer, serial number, and any extensions\&. If the \f3-rfc\fR option is specified, then the certificate contents are printed using the printable encoding format, as defined by the Internet RFC 1421 Certificate Encoding Standard\&.
++
++You cannot specify both \f3-v\fR and \f3-rfc\fR\&.
++.TP
++-printcert
++.sp
++.nf
++\f3{\-file \fIcert_file\fR | \-sslserver \fIhost\fR[:\fIport\fR]} {\-jarfile \fIJAR_file\fR {\-rfc} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads the certificate from the file cert_file, the SSL server located at host:port, or the signed JAR file \f3JAR_file\fR (with the \f3-jarfile\fR option and prints its contents in a human-readable format\&. When no port is specified, the standard HTTPS port 443 is assumed\&. Note that \f3-sslserver\fR and -file options cannot be provided at the same time\&. Otherwise, an error is reported\&. If neither option is specified, then the certificate is read from \f3stdin\fR\&.
++
++When\f3-rfc\fR is specified, the \f3keytool\fR command prints the certificate in PEM mode as defined by the Internet RFC 1421 Certificate Encoding standard\&. See Internet RFC 1421 Certificate Encoding Standard\&.
++
++If the certificate is read from a file or \f3stdin\fR, then it might be either binary encoded or in printable encoding format, as defined by the RFC 1421 Certificate Encoding standard\&.
++
++If the SSL server is behind a firewall, then the \f3-J-Dhttps\&.proxyHost=proxyhost\fR and \f3-J-Dhttps\&.proxyPort=proxyport\fR options can be specified on the command line for proxy tunneling\&. See Java Secure Socket Extension (JSSE) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.html
++
++\fINote:\fR This option can be used independently of a keystore\&.
++.TP
++-printcrl
++.sp
++.nf
++\f3\-file \fIcrl_\fR {\-v}\fP
++.fi
++.sp
++
++
++Reads the Certificate Revocation List (CRL) from the file \f3crl_\fR\&. A CRL is a list of digital certificates that were revoked by the CA that issued them\&. The CA generates the \f3crl_\fR file\&.
++
++\fINote:\fR This option can be used independently of a keystore\&.
++.TP
++-storepasswd
++.sp
++.nf
++\f3[\-new \fInew_storepass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Changes the password used to protect the integrity of the keystore contents\&. The new password is \f3new_storepass\fR, which must be at least 6 characters\&.
++.TP
++-keypasswd
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-keypass \fIold_keypass\fR] [\-new \fInew_keypass\fR] {\-storetype \fIstoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Changes the password under which the private/secret key identified by \f3alias\fR is protected, from \f3old_keypass\fR to \f3new_keypass\fR, which must be at least 6 characters\&.
++
++If the \f3-keypass\fR option is not provided at the command line, and the key password is different from the keystore password, then the user is prompted for it\&.
++
++If the \f3-new\fR option is not provided at the command line, then the user is prompted for it
++.TP
++-delete
++.sp
++.nf
++\f3[\-alias \fIalias\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR} \fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Deletes from the keystore the entry identified by \f3alias\fR\&. The user is prompted for the alias, when no alias is provided at the command line\&.
++.TP
++-changealias
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-destalias \fIdestalias\fR] [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Move an existing keystore entry from the specified \f3alias\fR to a new alias, \f3destalias\fR\&. If no destination alias is provided, then the command prompts for one\&. If the original entry is protected with an entry password, then the password can be supplied with the \f3-keypass\fR option\&. If no key password is provided, then the \f3storepass\fR (if provided) is attempted first\&. If the attempt fails, then the user is prompted for a password\&.
++.TP
++-help
++.br
++Lists the basic commands and their options\&.
++
++For more information about a specific command, enter the following, where \f3command_name\fR is the name of the command: \f3keytool -command_name -help\fR\&.
++.SH EXAMPLES
++This example walks through the sequence of steps to create a keystore for managing public/private key pair and certificates from trusted entities\&.
++.SS GENERATE\ THE\ KEY\ PAIR
++First, create a keystore and generate the key pair\&. You can use a command such as the following typed as a single line:
++.sp
++.nf
++\f3keytool \-genkeypair \-dname "cn=Mark Jones, ou=Java, o=Oracle, c=US"\fP
++.fi
++.nf
++\f3 \-alias business \-keypass <new password for private key>\fP
++.fi
++.nf
++\f3 \-keystore /working/mykeystore\fP
++.fi
++.nf
++\f3 \-storepass <new password for keystore> \-validity 180\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The command creates the keystore named \f3mykeystore\fR in the working directory (assuming it does not already exist), and assigns it the password specified by \f3<new password for keystore>\fR\&. It generates a public/private key pair for the entity whose distinguished name has a common name of Mark Jones, organizational unit of Java, organization of Oracle and two-letter country code of US\&. It uses the default DSA key generation algorithm to create the keys; both are 1024 bits\&.
++.PP
++The command uses the default SHA1withDSA signature algorithm to create a self-signed certificate that includes the public key and the distinguished name information\&. The certificate is valid for 180 days, and is associated with the private key in a keystore entry referred to by the alias \f3business\fR\&. The private key is assigned the password specified by \f3<new password for private key>\fR\&.
++.PP
++The command is significantly shorter when the option defaults are accepted\&. In this case, no options are required, and the defaults are used for unspecified options that have default values\&. You are prompted for any required values\&. You could have the following:
++.sp
++.nf
++\f3keytool \-genkeypair\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this case, a keystore entry with the alias \f3mykey\fR is created, with a newly generated key pair and a certificate that is valid for 90 days\&. This entry is placed in the keystore named \f3\&.keystore\fR in your home directory\&. The keystore is created when it does not already exist\&. You are prompted for the distinguished name information, the keystore password, and the private key password\&.
++.PP
++The rest of the examples assume you executed the \f3-genkeypair\fR command without options specified, and that you responded to the prompts with values equal to those specified in the first \f3-genkeypair\fR command\&. For example, a distinguished name of \f3cn=Mark Jones\fR, \f3ou=Java\fR, \f3o=Oracle\fR, \f3c=US\fR)\&.
++.SS REQUEST\ A\ SIGNED\ CERTIFICATE\ FROM\ A\ CA
++Generating the key pair created a self-signed certificate\&. A certificate is more likely to be trusted by others when it is signed by a Certification Authority (CA)\&. To get a CA signature, first generate a Certificate Signing Request (CSR), as follows:
++.sp
++.nf
++\f3keytool \-certreq \-file MarkJ\&.csr\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This creates a CSR for the entity identified by the default alias \f3mykey\fR and puts the request in the file named MarkJ\&.csr\&. Submit this file to a CA, such as VeriSign\&. The CA authenticates you, the requestor (usually off-line), and returns a certificate, signed by them, authenticating your public key\&. In some cases, the CA returns a chain of certificates, each one authenticating the public key of the signer of the previous certificate in the chain\&.
++.SS IMPORT\ A\ CERTIFICATE\ FOR\ THE\ CA
++You now need to replace the self-signed certificate with a certificate chain, where each certificate in the chain authenticates the public key of the signer of the previous certificate in the chain, up to a root CA\&.
++.PP
++Before you import the certificate reply from a CA, you need one or more trusted certificates in your keystore or in the \f3cacerts\fR keystore file\&. See \f3-importcert\fR in Commands\&.
++.TP 0.2i
++\(bu
++If the certificate reply is a certificate chain, then you need the top certificate of the chain\&. The root CA certificate that authenticates the public key of the CA\&.
++.TP 0.2i
++\(bu
++If the certificate reply is a single certificate, then you need a certificate for the issuing CA (the one that signed it)\&. If that certificate is not self-signed, then you need a certificate for its signer, and so on, up to a self-signed root CA certificate\&.
++.PP
++The \f3cacerts\fR keystore file ships with several VeriSign root CA certificates, so you probably will not need to import a VeriSign certificate as a trusted certificate in your keystore\&. But if you request a signed certificate from a different CA, and a certificate authenticating that CA\&'s public key was not added to \f3cacerts\fR, then you must import a certificate from the CA as a trusted certificate\&.
++.PP
++A certificate from a CA is usually either self-signed or signed by another CA, in which case you need a certificate that authenticates that CA\&'s public key\&. Suppose company ABC, Inc\&., is a CA, and you obtain a file named A\f3BCCA\&.cer\fR that is supposed to be a self-signed certificate from ABC, that authenticates that CA\&'s public key\&. Be careful to ensure the certificate is valid before you import it as a trusted certificate\&. View it first with the \f3keytool -printcert\fR command or the \f3keytool -importcert\fR command without the \f3-noprompt\fR option, and make sure that the displayed certificate fingerprints match the expected ones\&. You can call the person who sent the certificate, and compare the fingerprints that you see with the ones that they show or that a secure public key repository shows\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s (for example, an attacker\&'s) certificate\&. If such an attack takes place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker has signed\&.
++.PP
++If you trust that the certificate is valid, then you can add it to your keystore with the following command:
++.sp
++.nf
++\f3keytool \-importcert \-alias abc \-file ABCCA\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This command creates a trusted certificate entry in the keystore, with the data from the file ABCCA\&.cer, and assigns the alias \f3abc\fR to the entry\&.
++.SS IMPORT\ THE\ CERTIFICATE\ REPLY\ FROM\ THE\ CA
++After you import a certificate that authenticates the public key of the CA you submitted your certificate signing request to (or there is already such a certificate in the cacerts file), you can import the certificate reply and replace your self-signed certificate with a certificate chain\&. This chain is the one returned by the CA in response to your request (when the CA reply is a chain), or one constructed (when the CA reply is a single certificate) using the certificate reply and trusted certificates that are already available in the keystore where you import the reply or in the \f3cacerts\fR keystore file\&.
++.PP
++For example, if you sent your certificate signing request to VeriSign, then you can import the reply with the following, which assumes the returned certificate is named VSMarkJ\&.cer:
++.sp
++.nf
++\f3keytool \-importcert \-trustcacerts \-file VSMarkJ\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS EXPORT\ A\ CERTIFICATE\ THAT\ AUTHENTICATES\ THE\ PUBLIC\ KEY
++If you used the \f3jarsigner\fR command to sign a Java Archive (JAR) file, then clients that want to use the file will want to authenticate your signature\&. One way the clients can authenticate you is by first importing your public key certificate into their keystore as a trusted entry\&.
++.PP
++You can export the certificate and supply it to your clients\&. As an example, you can copy your certificate to a file named MJ\&.cer with the following command that assumes the entry has an alias of \f3mykey\fR:
++.sp
++.nf
++\f3keytool \-exportcert \-alias mykey \-file MJ\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++With the certificate and the signed JAR file, a client can use the \f3jarsigner\fR command to authenticate your signature\&.
++.SS IMPORT\ KEYSTORE
++The command \f3importkeystore\fR is used to import an entire keystore into another keystore, which means all entries from the source keystore, including keys and certificates, are all imported to the destination keystore within a single command\&. You can use this command to import entries from a different type of keystore\&. During the import, all new entries in the destination keystore will have the same alias names and protection passwords (for secret keys and private keys)\&. If the \f3keytool\fR command cannot recover the private keys or secret keys from the source keystore, then it prompts you for a password\&. If it detects alias duplication, then it asks you for a new alias, and you can specify a new alias or simply allow the \f3keytool\fR command to overwrite the existing one\&.
++.PP
++For example, to import entries from a typical JKS type keystore key\&.jks into a PKCS #11 type hardware-based keystore, use the command:
++.sp
++.nf
++\f3keytool \-importkeystore\fP
++.fi
++.nf
++\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
++.fi
++.nf
++\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
++.fi
++.nf
++\f3 \-srcstorepass <src keystore password>\fP
++.fi
++.nf
++\f3 \-deststorepass <destination keystore pwd>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3importkeystore\fR command can also be used to import a single entry from a source keystore to a destination keystore\&. In this case, besides the options you see in the previous example, you need to specify the alias you want to import\&. With the \f3-srcalias\fR option specified, you can also specify the destination alias name in the command line, as well as protection password for a secret/private key and the destination protection password you want\&. The following command demonstrates this:
++.sp
++.nf
++\f3keytool \-importkeystore\fP
++.fi
++.nf
++\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
++.fi
++.nf
++\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
++.fi
++.nf
++\f3 \-srcstorepass <src keystore password>\fP
++.fi
++.nf
++\f3 \-deststorepass <destination keystore pwd>\fP
++.fi
++.nf
++\f3 \-srcalias myprivatekey \-destalias myoldprivatekey\fP
++.fi
++.nf
++\f3 \-srckeypass <source entry password>\fP
++.fi
++.nf
++\f3 \-destkeypass <destination entry password>\fP
++.fi
++.nf
++\f3 \-noprompt\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS GENERATE\ CERTIFICATES\ FOR\ AN\ SSL\ SERVER
++The following are \f3keytool\fR commands to generate key pairs and certificates for three entities: Root CA (\f3root\fR), Intermediate CA (\f3ca\fR), and SSL server (\f3server\fR)\&. Ensure that you store all the certificates in the same keystore\&. In these examples, RSA is the recommended the key algorithm\&.
++.sp
++.nf
++\f3keytool \-genkeypair \-keystore root\&.jks \-alias root \-ext bc:c\fP
++.fi
++.nf
++\f3keytool \-genkeypair \-keystore ca\&.jks \-alias ca \-ext bc:c\fP
++.fi
++.nf
++\f3keytool \-genkeypair \-keystore server\&.jks \-alias server\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-keystore root\&.jks \-alias root \-exportcert \-rfc > root\&.pem\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-storepass <storepass> \-keystore ca\&.jks \-certreq \-alias ca |\fP
++.fi
++.nf
++\f3 keytool \-storepass <storepass> \-keystore root\&.jks\fP
++.fi
++.nf
++\f3 \-gencert \-alias root \-ext BC=0 \-rfc > ca\&.pem\fP
++.fi
++.nf
++\f3keytool \-keystore ca\&.jks \-importcert \-alias ca \-file ca\&.pem\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-storepass <storepass> \-keystore server\&.jks \-certreq \-alias server |\fP
++.fi
++.nf
++\f3 keytool \-storepass <storepass> \-keystore ca\&.jks \-gencert \-alias ca\fP
++.fi
++.nf
++\f3 \-ext ku:c=dig,kE \-rfc > server\&.pem\fP
++.fi
++.nf
++\f3cat root\&.pem ca\&.pem server\&.pem |\fP
++.fi
++.nf
++\f3 keytool \-keystore server\&.jks \-importcert \-alias server\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH TERMS
++.TP
++Keystore
++A keystore is a storage facility for cryptographic keys and certificates\&.
++.TP
++Keystore entries
++Keystores can have different types of entries\&. The two most applicable entry types for the \f3keytool\fR command include the following:
++
++\fIKey entries\fR: Each entry holds very sensitive cryptographic key information, which is stored in a protected format to prevent unauthorized access\&. Typically, a key stored in this type of entry is a secret key, or a private key accompanied by the certificate chain for the corresponding public key\&. See Certificate Chains\&. The \f3keytool\fR command can handle both types of entries, while the \f3jarsigner\fR tool only handles the latter type of entry, that is private keys and their associated certificate chains\&.
++
++\fITrusted certificate entries\fR: Each entry contains a single public key certificate that belongs to another party\&. The entry is called a trusted certificate because the keystore owner trusts that the public key in the certificate belongs to the identity identified by the subject (owner) of the certificate\&. The issuer of the certificate vouches for this, by signing the certificate\&.
++.TP
++KeyStore aliases
++All keystore entries (key and trusted certificate entries) are accessed by way of unique aliases\&.
++
++An alias is specified when you add an entity to the keystore with the \f3-genseckey\fR command to generate a secret key, the \f3-genkeypair\fR command to generate a key pair (public and private key), or the \f3-importcert\fR command to add a certificate or certificate chain to the list of trusted certificates\&. Subsequent \f3keytool\fR commands must use this same alias to refer to the entity\&.
++
++For example, you can use the alias \f3duke\fR to generate a new public/private key pair and wrap the public key into a self-signed certificate with the following command\&. See Certificate Chains\&.
++.sp
++.nf
++\f3keytool \-genkeypair \-alias duke \-keypass dukekeypasswd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This example specifies an initial password of \f3dukekeypasswd\fR required by subsequent commands to access the private key associated with the alias \f3duke\fR\&. If you later want to change Duke\&'s private key password, use a command such as the following:
++.sp
++.nf
++\f3keytool \-keypasswd \-alias duke \-keypass dukekeypasswd \-new newpass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This changes the password from \f3dukekeypasswd\fR to \f3newpass\fR\&. A password should not be specified on a command line or in a script unless it is for testing purposes, or you are on a secure system\&. If you do not specify a required password option on a command line, then you are prompted for it\&.
++.TP
++KeyStore implementation
++The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies well-defined interfaces to access and modify the information in a keystore\&. It is possible for there to be multiple different concrete implementations, where each implementation is that for a particular type of keystore\&.
++
++Currently, two command-line tools (\f3keytool\fR and \f3jarsigner\fR) and a GUI-based tool named Policy Tool make use of keystore implementations\&. Because the \f3KeyStore\fR class is \f3public\fR, users can write additional security applications that use it\&.
++
++There is a built-in default implementation, provided by Oracle\&. It implements the keystore as a file with a proprietary keystore type (format) named JKS\&. It protects each private key with its individual password, and also protects the integrity of the entire keystore with a (possibly different) password\&.
++
++Keystore implementations are provider-based\&. More specifically, the application interfaces supplied by \f3KeyStore\fR are implemented in terms of a Service Provider Interface (SPI)\&. That is, there is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, which defines the Service Provider Interface methods that providers must implement\&. The term \fIprovider\fR refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
++
++Applications can choose different types of keystore implementations from different providers, using the \f3getInstance\fR factory method supplied in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private/secret keys in the keystore and the integrity of the keystore\&. Keystore implementations of different types are not compatible\&.
++
++The \f3keytool\fR command works on any file-based keystore implementation\&. It treats the keystore location that is passed to it at the command line as a file name and converts it to a \f3FileInputStream\fR, from which it loads the keystore information\&.)The \f3jarsigner\fR and \f3policytool\fR commands can read a keystore from any location that can be specified with a URL\&.
++
++For \f3keytool\fR and \f3jarsigner\fR, you can specify a keystore type at the command line, with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIKeystore\fR menu\&.
++
++If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment directory\&. The \f3jre\fR directory in the SDK or the top-level directory of the Java Runtime Environment (JRE)\&.
++
++Each tool gets the \f3keystore\&.type\fR value and then examines all the currently installed providers until it finds one that implements a keystores of that type\&. It then uses the keystore implementation from that provider\&.The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type\fR property:
++.sp
++.nf
++\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The default keystore type is \f3jks\fR, which is the proprietary type of the keystore implementation provided by Oracle\&. This is specified by the following line in the security properties file:
++.sp
++.nf
++\f3keystore\&.type=jks\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To have the tools utilize a keystore implementation other than the default, you can change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
++.sp
++.nf
++\f3keystore\&.type=pkcs12\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR Case does not matter in keystore type designations\&. For example, JKS would be considered the same as jks\&.
++.TP
++Certificate
++A certificate (or public-key certificate) is a digitally signed statement from one entity (the issuer), saying that the public key and some other information of another entity (the subject) has some specific value\&. The following terms are related to certificates:
++
++\fIPublic Keys\fR: These are numbers associated with a particular entity, and are intended to be known to everyone who needs to have trusted interactions with that entity\&. Public keys are used to verify signatures\&.
++
++\fIDigitally Signed\fR: If some data is digitally signed, then it is stored with the identity of an entity and a signature that proves that entity knows about the data\&. The data is rendered unforgeable by signing with the entity\&'s private key\&.
++
++\fIIdentity\fR: A known way of addressing an entity\&. In some systems, the identity is the public key, and in others it can be anything from an Oracle Solaris UID to an email address to an X\&.509 distinguished name\&.
++
++\fISignature\fR: A signature is computed over some data using the private key of an entity\&. The signer, which in the case of a certificate is also known as the issuer\&.
++
++\fIPrivate Keys\fR: These are numbers, each of which is supposed to be known only to the particular entity whose private key it is (that is, it is supposed to be kept secret)\&. Private and public keys exist in pairs in all public key cryptography systems (also referred to as public key crypto systems)\&. In a typical public key crypto system, such as DSA, a private key corresponds to exactly one public key\&. Private keys are used to compute signatures\&.
++
++\fIEntity\fR: An entity is a person, organization, program, computer, business, bank, or something else you are trusting to some degree\&.
++
++Public key cryptography requires access to users\&' public keys\&. In a large-scale networked environment, it is impossible to guarantee that prior relationships between communicating entities were established or that a trusted repository exists with all used public keys\&. Certificates were invented as a solution to this public key distribution problem\&. Now a Certification Authority (CA) can act as a trusted third party\&. CAs are entities such as businesses that are trusted to sign (issue) certificates for other entities\&. It is assumed that CAs only create valid and reliable certificates because they are bound by legal agreements\&. There are many public Certification Authorities, such as VeriSign, Thawte, Entrust, and so on\&.
++
++You can also run your own Certification Authority using products such as Microsoft Certificate Server or the Entrust CA product for your organization\&. With the \f3keytool\fR command, it is possible to display, import, and export certificates\&. It is also possible to generate self-signed certificates\&.
++
++The \f3keytool\fR command currently handles X\&.509 certificates\&.
++.TP
++X\&.509 Certificates
++The X\&.509 standard defines what information can go into a certificate and describes how to write it down (the data format)\&. All the data in a certificate is encoded with two related standards called ASN\&.1/DER\&. Abstract Syntax Notation 1 describes data\&. The Definite Encoding Rules describe a single way to store and transfer that data\&.
++
++All X\&.509 certificates have the following data, in addition to the signature:
++
++\fIVersion\fR: This identifies which version of the X\&.509 standard applies to this certificate, which affects what information can be specified in it\&. Thus far, three versions are defined\&. The \f3keytool\fR command can import and export v1, v2, and v3 certificates\&. It generates v3 certificates\&.
++
++X\&.509 Version 1 has been available since 1988, is widely deployed, and is the most generic\&.
++
++X\&.509 Version 2 introduced the concept of subject and issuer unique identifiers to handle the possibility of reuse of subject or issuer names over time\&. Most certificate profile documents strongly recommend that names not be reused and that certificates should not make use of unique identifiers\&. Version 2 certificates are not widely used\&.
++
++X\&.509 Version 3 is the most recent (1996) and supports the notion of extensions where anyone can define an extension and include it in the certificate\&. Some common extensions are: KeyUsage (limits the use of the keys to particular purposes such as \f3signing-only\fR) and AlternativeNames (allows other identities to also be associated with this public key, for example\&. DNS names, email addresses, IP addresses)\&. Extensions can be marked critical to indicate that the extension should be checked and enforced or used\&. For example, if a certificate has the KeyUsage extension marked critical and set to \f3keyCertSign\fR, then when this certificate is presented during SSL communication, it should be rejected because the certificate extension indicates that the associated private key should only be used for signing certificates and not for SSL use\&.
++
++\fISerial number\fR: The entity that created the certificate is responsible for assigning it a serial number to distinguish it from other certificates it issues\&. This information is used in numerous ways\&. For example, when a certificate is revoked its serial number is placed in a Certificate Revocation List (CRL)\&.
++
++\fISignature algorithm identifier\fR: This identifies the algorithm used by the CA to sign the certificate\&.
++
++\fIIssuer name\fR: The X\&.500 Distinguished Name of the entity that signed the certificate\&. See X\&.500 Distinguished Names\&. This is typically a CA\&. Using this certificate implies trusting the entity that signed this certificate\&. In some cases, such as root or top-level CA certificates, the issuer signs its own certificate\&.
++
++\fIValidity period\fR: Each certificate is valid only for a limited amount of time\&. This period is described by a start date and time and an end date and time, and can be as short as a few seconds or almost as long as a century\&. The validity period chosen depends on a number of factors, such as the strength of the private key used to sign the certificate, or the amount one is willing to pay for a certificate\&. This is the expected period that entities can rely on the public value, when the associated private key has not been compromised\&.
++
++\fISubject name\fR: The name of the entity whose public key the certificate identifies\&. This name uses the X\&.500 standard, so it is intended to be unique across the Internet\&. This is the X\&.500 Distinguished Name (DN) of the entity\&. See X\&.500 Distinguished Names\&. For example,
++.sp
++.nf
++\f3CN=Java Duke, OU=Java Software Division, O=Oracle Corporation, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++These refer to the subject\&'s common name (CN), organizational unit (OU), organization (O), and country (C)\&.
++
++\fISubject public key information\fR: This is the public key of the entity being named with an algorithm identifier that specifies which public key crypto system this key belongs to and any associated key parameters\&.
++.TP
++Certificate Chains
++The \f3keytool\fR command can create and manage keystore key entries that each contain a private key and an associated certificate chain\&. The first certificate in the chain contains the public key that corresponds to the private key\&.
++
++When keys are first generated, the chain starts off containing a single element, a self-signed certificate\&. See \f3-genkeypair\fR in Commands\&. A self-signed certificate is one for which the issuer (signer) is the same as the subject\&. The subject is the entity whose public key is being authenticated by the certificate\&. Whenever the \f3-genkeypair\fR command is called to generate a new public/private key pair, it also wraps the public key into a self-signed certificate\&.
++
++Later, after a Certificate Signing Request (CSR) was generated with the \f3-certreq\fR command and sent to a Certification Authority (CA), the response from the CA is imported with \f3-importcert\fR, and the self-signed certificate is replaced by a chain of certificates\&. See the \f3-certreq\fR and \f3-importcert\fR options in Commands\&. At the bottom of the chain is the certificate (reply) issued by the CA authenticating the subject\&'s public key\&. The next certificate in the chain is one that authenticates the CA\&'s public key\&.
++
++In many cases, this is a self-signed certificate, which is a certificate from the CA authenticating its own public key, and the last certificate in the chain\&. In other cases, the CA might return a chain of certificates\&. In this case, the bottom certificate in the chain is the same (a certificate signed by the CA, authenticating the public key of the key entry), but the second certificate in the chain is a certificate signed by a different CA that authenticates the public key of the CA you sent the CSR to\&. The next certificate in the chain is a certificate that authenticates the second CA\&'s key, and so on, until a self-signed root certificate is reached\&. Each certificate in the chain (after the first) authenticates the public key of the signer of the previous certificate in the chain\&.
++
++Many CAs only return the issued certificate, with no supporting chain, especially when there is a flat hierarchy (no intermediates CAs)\&. In this case, the certificate chain must be established from trusted certificate information already stored in the keystore\&.
++
++A different reply format (defined by the PKCS #7 standard) includes the supporting certificate chain in addition to the issued certificate\&. Both reply formats can be handled by the \f3keytool\fR command\&.
++
++The top-level (root) CA certificate is self-signed\&. However, the trust into the root\&'s public key does not come from the root certificate itself, but from other sources such as a newspaper\&. This is because anybody could generate a self-signed certificate with the distinguished name of, for example, the VeriSign root CA\&. The root CA public key is widely known\&. The only reason it is stored in a certificate is because this is the format understood by most tools, so the certificate in this case is only used as a vehicle to transport the root CA\&'s public key\&. Before you add the root CA certificate to your keystore, you should view it with the \f3-printcert\fR option and compare the displayed fingerprint with the well-known fingerprint obtained from a newspaper, the root CA\&'s Web page, and so on\&.
++.TP
++The cacerts Certificates File
++A certificates file named \f3cacerts\fR resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment\&'s directory, which would be the \f3jre\fR directory in the SDK or the top-level directory of the JRE\&.
++
++The \f3cacerts\fR file represents a system-wide keystore with CA certificates\&. System administrators can configure and manage that file with the \f3keytool\fR command by specifying \f3jks\fR as the keystore type\&. The \f3cacerts\fR keystore file ships with a default set of root CA certificates\&. You can list the default certificates with the following command:
++.sp
++.nf
++\f3keytool \-list \-keystore java\&.home/lib/security/cacerts\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The initial password of the \f3cacerts\fR keystore file is \f3changeit\fR\&. System administrators should change that password and the default access permission of that file upon installing the SDK\&.
++
++\fINote:\fR It is important to verify your \f3cacerts\fR file\&. Because you trust the CAs in the \f3cacerts\fR file as entities for signing and issuing certificates to other entities, you must manage the \f3cacerts\fR file carefully\&. The \f3cacerts\fR file should contain only certificates of the CAs you trust\&. It is your responsibility to verify the trusted root CA certificates bundled in the \f3cacerts\fR file and make your own trust decisions\&.
++
++To remove an untrusted CA certificate from the \f3cacerts\fR file, use the \f3delete\fR option of the \f3keytool\fR command\&. You can find the \f3cacerts\fR file in the JRE installation directory\&. Contact your system administrator if you do not have permission to edit this file
++.TP
++Internet RFC 1421 Certificate Encoding Standard
++Certificates are often stored using the printable encoding format defined by the Internet RFC 1421 standard, instead of their binary encoding\&. This certificate format, also known as Base64 encoding, makes it easy to export certificates to other applications by email or through some other mechanism\&.
++
++Certificates read by the \f3-importcert\fR and \f3-printcert\fR commands can be in either this format or binary encoded\&. The \f3-exportcert\fR command by default outputs a certificate in binary encoding, but will instead output a certificate in the printable encoding format, when the \f3-rfc\fR option is specified\&.
++
++The \f3-list\fR command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format\&. If the \f3-rfc\fR option is specified, then the certificate is output in the printable encoding format\&.
++
++In its printable encoding format, the encoded certificate is bounded at the beginning and end by the following text:
++.sp
++.nf
++\f3\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3encoded certificate goes here\&. \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-\-\-\-\-END CERTIFICATE\-\-\-\-\-\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++X\&.500 Distinguished Names
++X\&.500 Distinguished Names are used to identify entities, such as those that are named by the \f3subject\fR and \f3issuer\fR (signer) fields of X\&.509 certificates\&. The \f3keytool\fR command supports the following subparts:
++
++\fIcommonName\fR: The common name of a person such as Susan Jones\&.
++
++\fIorganizationUnit\fR: The small organization (such as department or division) name\&. For example, Purchasing\&.
++
++\fIlocalityName\fR: The locality (city) name, for example, Palo Alto\&.
++
++\fIstateName\fR: State or province name, for example, California\&.
++
++\fIcountry\fR: Two-letter country code, for example, CH\&.
++
++When you supply a distinguished name string as the value of a \f3-dname\fR option, such as for the \f3-genkeypair\fR command, the string must be in the following format:
++.sp
++.nf
++\f3CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++All the italicized items represent actual values and the previous keywords are abbreviations for the following:
++.sp
++.nf
++\f3CN=commonName\fP
++.fi
++.nf
++\f3OU=organizationUnit\fP
++.fi
++.nf
++\f3O=organizationName\fP
++.fi
++.nf
++\f3L=localityName\fP
++.fi
++.nf
++\f3S=stateName\fP
++.fi
++.nf
++\f3C=country\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++A sample distinguished name string is:
++.sp
++.nf
++\f3CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino, S=California, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++A sample command using such a string is:
++.sp
++.nf
++\f3keytool \-genkeypair \-dname "CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino,\fP
++.fi
++.nf
++\f3S=California, C=US" \-alias mark\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Case does not matter for the keyword abbreviations\&. For example, CN, cn, and Cn are all treated the same\&.
++
++Order matters; each subcomponent must appear in the designated order\&. However, it is not necessary to have all the subcomponents\&. You can use a subset, for example:
++.sp
++.nf
++\f3CN=Steve Meier, OU=Java, O=Oracle, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If a distinguished name string value contains a comma, then the comma must be escaped by a backslash (\e) character when you specify the string on a command line, as in:
++.sp
++.nf
++\f3cn=Peter Schuster, ou=Java\e, Product Development, o=Oracle, c=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++It is never necessary to specify a distinguished name string on a command line\&. When the distinguished name is needed for a command, but not supplied on the command line, the user is prompted for each of the subcomponents\&. In this case, a comma does not need to be escaped by a backslash (\e)\&.
++.SH WARNINGS
++.SS IMPORTING\ TRUSTED\ CERTIFICATES\ WARNING
++\fIImportant\fR: Be sure to check a certificate very carefully before importing it as a trusted certificate\&.
++.PP
++Windows Example:
++
++View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose sends or emails you a certificate that you put it in a file named \f3\etmp\ecert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
++.sp
++.nf
++\f3 keytool \-printcert \-file \etmp\ecert\fP
++.fi
++.nf
++\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Serial Number: 59092b34\fP
++.fi
++.nf
++\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
++.fi
++.nf
++\f3 Certificate Fingerprints:\fP
++.fi
++.nf
++\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
++.fi
++.nf
++\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
++.fi
++.nf
++\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
++.fi
++.nf
++\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
++.fi
++.sp
++
++.PP
++Oracle Solaris Example:
++
++View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose someone sends or emails you a certificate that you put it in a file named \f3/tmp/cert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
++.sp
++.nf
++\f3 keytool \-printcert \-file /tmp/cert\fP
++.fi
++.nf
++\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Serial Number: 59092b34\fP
++.fi
++.nf
++\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
++.fi
++.nf
++\f3 Certificate Fingerprints:\fP
++.fi
++.nf
++\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
++.fi
++.nf
++\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
++.fi
++.nf
++\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
++.fi
++.nf
++\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Then call or otherwise contact the person who sent the certificate and compare the fingerprints that you see with the ones that they show\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s certificate such as an attacker\&'s certificate\&. If such an attack took place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker signed, for example, a JAR file with malicious class files inside\&.
++.PP
++\fINote:\fR It is not required that you execute a \f3-printcert\fR command before importing a certificate\&. This is because before you add a certificate to the list of trusted certificates in the keystore, the \f3-importcert\fR command prints out the certificate information and prompts you to verify it\&. You can then stop the import operation\&. However, you can do this only when you call the \f3-importcert\fR command without the \f3-noprompt\fR option\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
++.SS PASSWORDS\ WARNING
++Most commands that operate on a keystore require the store password\&. Some commands require a private/secret key password\&. Passwords can be specified on the command line in the \f3-storepass\fR and \f3-keypass\fR options\&. However, a password should not be specified on a command line or in a script unless it is for testing, or you are on a secure system\&. When you do not specify a required password option on a command line, you are prompted for it\&.
++.SS CERTIFICATE\ CONFORMANCE\ WARNING
++The Internet standard RFC 5280 has defined a profile on conforming X\&.509 certificates, which includes what values and value combinations are valid for certificate fields and extensions\&. See the standard at http://tools\&.ietf\&.org/rfc/rfc5280\&.txt
++.PP
++The \f3keytool\fR command does not enforce all of these rules so it can generate certificates that do not conform to the standard\&. Certificates that do not conform to the standard might be rejected by JRE or other applications\&. Users should ensure that they provide the correct options for \f3-dname\fR, \f3-ext\fR, and so on\&.
++.SH NOTES
++.SS IMPORT\ A\ NEW\ TRUSTED\ CERTIFICATE
++Before you add the certificate to the keystore, the \f3keytool\fR command verifies it by attempting to construct a chain of trust from that certificate to a self-signed certificate (belonging to a root CA), using trusted certificates that are already available in the keystore\&.
++.PP
++If the \f3-trustcacerts\fR option was specified, then additional certificates are considered for the chain of trust, namely the certificates in a file named \f3cacerts\fR\&.
++.PP
++If the \f3keytool\fR command fails to establish a trust path from the certificate to be imported up to a self-signed certificate (either from the keystore or the \f3cacerts\fR file), then the certificate information is printed, and the user is prompted to verify it by comparing the displayed certificate fingerprints with the fingerprints obtained from some other (trusted) source of information, which might be the certificate owner\&. Be very careful to ensure the certificate is valid before importing it as a trusted certificate\&. See Importing Trusted Certificates Warning\&. The user then has the option of stopping the import operation\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
++.SS IMPORT\ A\ CERTIFICATE\ REPLY
++When you import a certificate reply, the certificate reply is validated with trusted certificates from the keystore, and optionally, the certificates configured in the \f3cacerts\fR keystore file when the \f3-trustcacert\fR\f3s\fR option is specified\&. See The cacerts Certificates File\&.
++.PP
++The methods of determining whether the certificate reply is trusted are as follows:
++.TP 0.2i
++\(bu
++If the reply is a single X\&.509 certificate, then the \f3keytool\fR command attempts to establish a trust chain, starting at the certificate reply and ending at a self-signed certificate (belonging to a root CA)\&. The certificate reply and the hierarchy of certificates is used to authenticate the certificate reply from the new certificate chain of aliases\&. If a trust chain cannot be established, then the certificate reply is not imported\&. In this case, the \f3keytool\fR command does not print the certificate and prompt the user to verify it, because it is very difficult for a user to determine the authenticity of the certificate reply\&.
++.TP 0.2i
++\(bu
++If the reply is a PKCS #7 formatted certificate chain or a sequence of X\&.509 certificates, then the chain is ordered with the user certificate first followed by zero or more CA certificates\&. If the chain ends with a self-signed root CA certificate and the\f3-trustcacerts\fR option was specified, the \f3keytool\fR command attempts to match it with any of the trusted certificates in the keystore or the \f3cacerts\fR keystore file\&. If the chain does not end with a self-signed root CA certificate and the \f3-trustcacerts\fR option was specified, the \f3keytool\fR command tries to find one from the trusted certificates in the keystore or the \f3cacerts\fR keystore file and add it to the end of the chain\&. If the certificate is not found and the \f3-noprompt\fR option is not specified, the information of the last certificate in the chain is printed, and the user is prompted to verify it\&.
++.PP
++If the public key in the certificate reply matches the user\&'s public key already stored with \f3alias\fR, then the old certificate chain is replaced with the new certificate chain in the reply\&. The old chain can only be replaced with a valid \f3keypass\fR, and so the password used to protect the private key of the entry is supplied\&. If no password is provided, and the private key password is different from the keystore password, the user is prompted for it\&.
++.PP
++This command was named \f3-import\fR in earlier releases\&. This old name is still supported in this release\&. The new name, \f3-importcert\fR, is preferred going forward\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
++.TP 0.2i
++\(bu
++Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/native2ascii.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/native2ascii.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Internationalization Tools
+-.\" Title: native2ascii.1
+-.\"
+-.if n .pl 99999
+-.TH native2ascii 1 "21 November 2013" "JDK 8" "Internationalization Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Internationalization Tools
++.\" Title: native2ascii.1
++.\"
++.if n .pl 99999
++.TH native2ascii 1 "21 November 2013" "JDK 8" "Internationalization Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,39 +47,39 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-native2ascii \- Creates localizable applications by converting a file with characters in any supported character encoding to one with ASCII and/or Unicode escapes or vice versa\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBnative2ascii\fR [ \fIinputfile\fR ] [ \fIoutputfile\fR ]
+-.fi
+-.sp
+-.TP
+-\fIinputfile\fR
+-The encoded file to be converted to ASCII\&.
+-.TP
+-\fIoutputfile\fR
+-The converted ASCII file\&.
+-.SH DESCRIPTION
+-The \f3native2ascii\fR command converts encoded files supported by the Java Runtime Environment (JRE) to files encoded in ASCII, using Unicode escapes (\f3\eu\fR\fIxxxx\fR) notation for all characters that are not part of the ASCII character set\&. This process is required for properties files that contain characters not in ISO-8859-1 character sets\&. The tool can also perform the reverse conversion\&.
+-.PP
+-If the \f3outputfile\fR value is omitted, then standard output is used for output\&. If, in addition, the \f3inputfile\fR value is omitted, then standard input is used for input\&.
+-.SH OPTIONS
+-.TP
+--reverse
+-.br
+-Perform the reverse operation: Converts a file encoded in ISO-8859-1 with Unicode escapes to a file in any character encoding supported by the JRE\&.
+-.TP
+--encoding \fIencoding_name\fR
+-.br
+-Specifies the name of the character encoding to be used by the conversion procedure\&. If this option is not present, then the default character encoding (as determined by the \f3java\&.nio\&.charset\&.Charset\&.defaultCharset\fR method) is used\&. The \f3encoding_name\fR string must be the name of a character encoding that is supported by the JRE\&. See Supported Encodings at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.html
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++
++.SH NAME
++native2ascii \- Creates localizable applications by converting a file with characters in any supported character encoding to one with ASCII and/or Unicode escapes or vice versa\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBnative2ascii\fR [ \fIinputfile\fR ] [ \fIoutputfile\fR ]
++.fi
++.sp
++.TP
++\fIinputfile\fR
++The encoded file to be converted to ASCII\&.
++.TP
++\fIoutputfile\fR
++The converted ASCII file\&.
++.SH DESCRIPTION
++The \f3native2ascii\fR command converts encoded files supported by the Java Runtime Environment (JRE) to files encoded in ASCII, using Unicode escapes (\f3\eu\fR\fIxxxx\fR) notation for all characters that are not part of the ASCII character set\&. This process is required for properties files that contain characters not in ISO-8859-1 character sets\&. The tool can also perform the reverse conversion\&.
++.PP
++If the \f3outputfile\fR value is omitted, then standard output is used for output\&. If, in addition, the \f3inputfile\fR value is omitted, then standard input is used for input\&.
++.SH OPTIONS
++.TP
++-reverse
++.br
++Perform the reverse operation: Converts a file encoded in ISO-8859-1 with Unicode escapes to a file in any character encoding supported by the JRE\&.
++.TP
++-encoding \fIencoding_name\fR
++.br
++Specifies the name of the character encoding to be used by the conversion procedure\&. If this option is not present, then the default character encoding (as determined by the \f3java\&.nio\&.charset\&.Charset\&.defaultCharset\fR method) is used\&. The \f3encoding_name\fR string must be the name of a character encoding that is supported by the JRE\&. See Supported Encodings at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.html
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/orbd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/orbd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: orbd.1
+-.\"
+-.if n .pl 99999
+-.TH orbd 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: orbd.1
++.\"
++.if n .pl 99999
++.TH orbd 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,166 +47,166 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-orbd \- Enables clients to locate and call persistent objects on servers in the CORBA environment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBorbd\fR [ \fIoptions\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3orbd\fR command enables clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The Server Manager included with the orbd tool is used to enable clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The persistent servers, while publishing the persistent object references in the naming service, include the port number of the ORBD in the object reference instead of the port number of the server\&. The inclusion of an ORBD port number in the object reference for persistent object references has the following advantages:
+-.TP 0.2i
+-\(bu
+-The object reference in the naming service remains independent of the server life cycle\&. For example, the object reference could be published by the server in the Naming Service when it is first installed, and then, independent of how many times the server is started or shut down, the ORBD returns the correct object reference to the calling client\&.
+-.TP 0.2i
+-\(bu
+-The client needs to look up the object reference in the naming service only once, and can keep reusing this reference independent of the changes introduced due to server life cycle\&.
+-.PP
+-To access the ORBD Server Manager, the server must be started using \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. For more information on the Server Manager, see Server Manager\&.
+-.PP
+-When \f3orbd\fR starts, it also starts a naming service\&. For more information about the naming service\&. See Start and Stop the Naming Service\&.
+-.SH OPTIONS
+-.TP
+--ORBInitialPort \fInameserverport\fR
+-.br
+-Required\&. Specifies the port on which the name server should be started\&. After it is started, \f3orbd\fR listens for incoming requests on this port\&. On Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, Oracle recommends that you use a port number above or equal to 1024\&.
+-.SS NONREQUIRED\ OPTIONS
+-.TP
+--port \fIport\fR
+-.br
+-Specifies the activation port where ORBD should be started, and where ORBD will be accepting requests for persistent objects\&. The default value for this port is 1049\&. This port number is added to the port field of the persistent Interoperable Object References (IOR)\&.
+-.TP
+--defaultdb \fIdirectory\fR
+-.br
+-Specifies the base where the ORBD persistent storage directory, \f3orb\&.db\fR, is created\&. If this option is not specified, then the default value is \f3\&./orb\&.db\fR\&.
+-.TP
+--serverPollingTime \fImilliseconds\fR
+-.br
+-Specifies how often ORBD checks for the health of persistent servers registered through \f3servertool\fR\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
+-.TP
+--serverStartupDelay milliseconds
+-.br
+-Specifies how long ORBD waits before sending a location forward exception after a persistent server that is registered through \f3servertool\fR is restarted\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SS START\ AND\ STOP\ THE\ NAMING\ SERVICE
+-A naming service is a CORBA service that allows CORBA objects to be named by means of binding a name to an object reference\&. The name binding can be stored in the naming service, and a client can supply the name to obtain the desired object reference\&.
+-.PP
+-Before running a client or a server, you will start ORBD\&. ORBD includes a persistent naming service and a transient naming service, both of which are an implementation of the COS Naming Service\&.
+-.PP
+-The Persistent Naming Service provides persistence for naming contexts\&. This means that this information is persistent across service shutdowns and startups, and is recoverable in the event of a service failure\&. If ORBD is restarted, then the Persistent Naming Service restores the naming context graph, so that the binding of all clients\&' and servers\&' names remains intact (persistent)\&.
+-.PP
+-For backward compatibility, \f3tnameserv\fR, a Transient Naming Service that shipped with earlier releases of the JDK, is also included in this release of Java SE\&. A transient naming service retains naming contexts as long as it is running\&. If there is a service interruption, then the naming context graph is lost\&.
+-.PP
+-The \f3-ORBInitialPort\fR argument is a required command-line argument for \f3orbd\fR, and is used to set the port number on which the naming service runs\&. The following instructions assume you can use port 1050 for the Java IDL Object Request Broker Daemon\&. When using Oracle Solaris software, you must become a root user to start a process on a port lower than 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&. You can substitute a different port when necessary\&.
+-.PP
+-To start \f3orbd\fR from a UNIX command shell, enter:
+-.sp
+-.nf
+-\f3orbd \-ORBInitialPort 1050&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-From an MS-DOS system prompt (Windows), enter:
+-.sp
+-.nf
+-\f3start orbd \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Now that ORBD is running, you can run your server and client applications\&. When running the client and server applications, they must be made aware of the port number (and machine name, when applicable) where the Naming Service is running\&. One way to do this is to add the following code to your application:
+-.sp
+-.nf
+-\f3Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialHost", "MyHost");\fP
+-.fi
+-.nf
+-\f3ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this example, the naming service is running on port 1050 on host \f3MyHost\fR\&. Another way is to specify the port number and/or machine name when running the server or client application from the command line\&. For example, you would start your \f3HelloApplication\fR with the following command line:
+-.sp
+-.nf
+-\f3java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To stop the naming service, use the relevant operating system command, such as \f3pkill\fR\f3orbd\fR on Oracle Solaris, or \fICtrl+C\fR in the DOS window in which \f3orbd\fR is running\&. Note that names registered with the naming service can disappear when the service is terminated because of a transient naming service\&. The Java IDL naming service will run until it is explicitly stopped\&.
+-.PP
+-For more information about the naming service included with ORBD, see Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+-.SH SERVER\ MANAGER
+-To access the ORBD Server Manager and run a persistent server, the server must be started with \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. When a server is started using \f3servertool\fR, it must be started on the same host and port on which \f3orbd\fR is executing\&. If the server is run on a different port, then the information stored in the database for local contexts will be invalid and the service will not work properly\&.
+-.PP
+-See Java IDL: The "Hello World" Example at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html
+-.PP
+-In this example, you run the \f3idlj\fR compiler and \f3javac\fR compiler as shown in the tutorial\&. To run the ORBD Server Manager, follow these steps for running the application:
+-.PP
+-Start \f3orbd\fR\&.
+-.PP
+-UNIX command shell, enter: \f3orbd -ORBInitialPort 1050\fR\&.
+-.PP
+-MS-DOS system prompt (Windows), enter: \f3s\fR\f3tart orbd -ORBInitialPort 105\fR\f30\fR\&.
+-.PP
+-Port 1050 is the port on which you want the name server to run\&. The \f3-ORBInitialPort\fR option is a required command-line argument\&. When using Oracle Solaris software, you must become a root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&.
+-.PP
+-Start the \f3servertool\fR: \f3servertool -ORBInitialPort 1050\fR\&.
+-.PP
+-Make sure the name server (\f3orbd\fR) port is the same as in the previous step, for example, \f3-ORBInitialPort 1050\&.\fR The \f3servertool\fR must be started on the same port as the name server\&.
+-.PP
+-In the \f3servertool\fR command line interface, start the \f3Hello\fR server from the \f3servertool\fR prompt:
+-.sp
+-.nf
+-\f3servertool > register \-server HelloServer \-classpath \&. \-applicationName\fP
+-.fi
+-.nf
+-\f3 HelloServerApName\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3servertool\fR registers the server, assigns it the name \f3HelloServerApName\fR, and displays its server ID with a listing of all registered servers\&.Run the client application from another terminal window or prompt:
+-.sp
+-.nf
+-\f3java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-For this example, you can omit \f3-ORBInitialHost localhost\fR because the name server is running on the same host as the \f3Hello\fR client\&. If the name server is running on a different host, then use the -\f3ORBInitialHost nameserverhost\fR option to specify the host on which the IDL name server is running\&.Specify the name server (\f3orbd\fR) port as done in the previous step, for example, \f3-ORBInitialPort 1050\fR\&. When you finish experimenting with the ORBD Server Manager, be sure to shut down or terminate the name server (\f3orbd\fR) and \f3servertool\fR\&. To shut down \f3orbd\fR from am MS-DOS prompt, select the window that is running the server and enter \fICtrl+C\fR to shut it down\&.
+-.PP
+-To shut down \f3orbd\fR from an Oracle Solaris shell, find the process, and terminate with the \f3kill\fR command\&. The server continues to wait for invocations until it is explicitly stopped\&. To shut down the \f3servertool\fR, type \fIquit\fR and press the \fIEnter\fR key\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-servertool(1)
+-.TP 0.2i
+-\(bu
+-Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++
++.SH NAME
++orbd \- Enables clients to locate and call persistent objects on servers in the CORBA environment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBorbd\fR [ \fIoptions\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3orbd\fR command enables clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The Server Manager included with the orbd tool is used to enable clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The persistent servers, while publishing the persistent object references in the naming service, include the port number of the ORBD in the object reference instead of the port number of the server\&. The inclusion of an ORBD port number in the object reference for persistent object references has the following advantages:
++.TP 0.2i
++\(bu
++The object reference in the naming service remains independent of the server life cycle\&. For example, the object reference could be published by the server in the Naming Service when it is first installed, and then, independent of how many times the server is started or shut down, the ORBD returns the correct object reference to the calling client\&.
++.TP 0.2i
++\(bu
++The client needs to look up the object reference in the naming service only once, and can keep reusing this reference independent of the changes introduced due to server life cycle\&.
++.PP
++To access the ORBD Server Manager, the server must be started using \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. For more information on the Server Manager, see Server Manager\&.
++.PP
++When \f3orbd\fR starts, it also starts a naming service\&. For more information about the naming service\&. See Start and Stop the Naming Service\&.
++.SH OPTIONS
++.TP
++-ORBInitialPort \fInameserverport\fR
++.br
++Required\&. Specifies the port on which the name server should be started\&. After it is started, \f3orbd\fR listens for incoming requests on this port\&. On Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, Oracle recommends that you use a port number above or equal to 1024\&.
++.SS NONREQUIRED\ OPTIONS
++.TP
++-port \fIport\fR
++.br
++Specifies the activation port where ORBD should be started, and where ORBD will be accepting requests for persistent objects\&. The default value for this port is 1049\&. This port number is added to the port field of the persistent Interoperable Object References (IOR)\&.
++.TP
++-defaultdb \fIdirectory\fR
++.br
++Specifies the base where the ORBD persistent storage directory, \f3orb\&.db\fR, is created\&. If this option is not specified, then the default value is \f3\&./orb\&.db\fR\&.
++.TP
++-serverPollingTime \fImilliseconds\fR
++.br
++Specifies how often ORBD checks for the health of persistent servers registered through \f3servertool\fR\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
++.TP
++-serverStartupDelay milliseconds
++.br
++Specifies how long ORBD waits before sending a location forward exception after a persistent server that is registered through \f3servertool\fR is restarted\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SS START\ AND\ STOP\ THE\ NAMING\ SERVICE
++A naming service is a CORBA service that allows CORBA objects to be named by means of binding a name to an object reference\&. The name binding can be stored in the naming service, and a client can supply the name to obtain the desired object reference\&.
++.PP
++Before running a client or a server, you will start ORBD\&. ORBD includes a persistent naming service and a transient naming service, both of which are an implementation of the COS Naming Service\&.
++.PP
++The Persistent Naming Service provides persistence for naming contexts\&. This means that this information is persistent across service shutdowns and startups, and is recoverable in the event of a service failure\&. If ORBD is restarted, then the Persistent Naming Service restores the naming context graph, so that the binding of all clients\&' and servers\&' names remains intact (persistent)\&.
++.PP
++For backward compatibility, \f3tnameserv\fR, a Transient Naming Service that shipped with earlier releases of the JDK, is also included in this release of Java SE\&. A transient naming service retains naming contexts as long as it is running\&. If there is a service interruption, then the naming context graph is lost\&.
++.PP
++The \f3-ORBInitialPort\fR argument is a required command-line argument for \f3orbd\fR, and is used to set the port number on which the naming service runs\&. The following instructions assume you can use port 1050 for the Java IDL Object Request Broker Daemon\&. When using Oracle Solaris software, you must become a root user to start a process on a port lower than 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&. You can substitute a different port when necessary\&.
++.PP
++To start \f3orbd\fR from a UNIX command shell, enter:
++.sp
++.nf
++\f3orbd \-ORBInitialPort 1050&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++From an MS-DOS system prompt (Windows), enter:
++.sp
++.nf
++\f3start orbd \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Now that ORBD is running, you can run your server and client applications\&. When running the client and server applications, they must be made aware of the port number (and machine name, when applicable) where the Naming Service is running\&. One way to do this is to add the following code to your application:
++.sp
++.nf
++\f3Properties props = new Properties();\fP
++.fi
++.nf
++\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialHost", "MyHost");\fP
++.fi
++.nf
++\f3ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this example, the naming service is running on port 1050 on host \f3MyHost\fR\&. Another way is to specify the port number and/or machine name when running the server or client application from the command line\&. For example, you would start your \f3HelloApplication\fR with the following command line:
++.sp
++.nf
++\f3java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To stop the naming service, use the relevant operating system command, such as \f3pkill\fR\f3orbd\fR on Oracle Solaris, or \fICtrl+C\fR in the DOS window in which \f3orbd\fR is running\&. Note that names registered with the naming service can disappear when the service is terminated because of a transient naming service\&. The Java IDL naming service will run until it is explicitly stopped\&.
++.PP
++For more information about the naming service included with ORBD, see Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++.SH SERVER\ MANAGER
++To access the ORBD Server Manager and run a persistent server, the server must be started with \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. When a server is started using \f3servertool\fR, it must be started on the same host and port on which \f3orbd\fR is executing\&. If the server is run on a different port, then the information stored in the database for local contexts will be invalid and the service will not work properly\&.
++.PP
++See Java IDL: The "Hello World" Example at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html
++.PP
++In this example, you run the \f3idlj\fR compiler and \f3javac\fR compiler as shown in the tutorial\&. To run the ORBD Server Manager, follow these steps for running the application:
++.PP
++Start \f3orbd\fR\&.
++.PP
++UNIX command shell, enter: \f3orbd -ORBInitialPort 1050\fR\&.
++.PP
++MS-DOS system prompt (Windows), enter: \f3s\fR\f3tart orbd -ORBInitialPort 105\fR\f30\fR\&.
++.PP
++Port 1050 is the port on which you want the name server to run\&. The \f3-ORBInitialPort\fR option is a required command-line argument\&. When using Oracle Solaris software, you must become a root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&.
++.PP
++Start the \f3servertool\fR: \f3servertool -ORBInitialPort 1050\fR\&.
++.PP
++Make sure the name server (\f3orbd\fR) port is the same as in the previous step, for example, \f3-ORBInitialPort 1050\&.\fR The \f3servertool\fR must be started on the same port as the name server\&.
++.PP
++In the \f3servertool\fR command line interface, start the \f3Hello\fR server from the \f3servertool\fR prompt:
++.sp
++.nf
++\f3servertool > register \-server HelloServer \-classpath \&. \-applicationName\fP
++.fi
++.nf
++\f3 HelloServerApName\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3servertool\fR registers the server, assigns it the name \f3HelloServerApName\fR, and displays its server ID with a listing of all registered servers\&.Run the client application from another terminal window or prompt:
++.sp
++.nf
++\f3java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++For this example, you can omit \f3-ORBInitialHost localhost\fR because the name server is running on the same host as the \f3Hello\fR client\&. If the name server is running on a different host, then use the -\f3ORBInitialHost nameserverhost\fR option to specify the host on which the IDL name server is running\&.Specify the name server (\f3orbd\fR) port as done in the previous step, for example, \f3-ORBInitialPort 1050\fR\&. When you finish experimenting with the ORBD Server Manager, be sure to shut down or terminate the name server (\f3orbd\fR) and \f3servertool\fR\&. To shut down \f3orbd\fR from am MS-DOS prompt, select the window that is running the server and enter \fICtrl+C\fR to shut it down\&.
++.PP
++To shut down \f3orbd\fR from an Oracle Solaris shell, find the process, and terminate with the \f3kill\fR command\&. The server continues to wait for invocations until it is explicitly stopped\&. To shut down the \f3servertool\fR, type \fIquit\fR and press the \fIEnter\fR key\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++servertool(1)
++.TP 0.2i
++\(bu
++Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/pack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/pack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Deployment Tools
+-.\" Title: pack200.1
+-.\"
+-.if n .pl 99999
+-.TH pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Deployment Tools
++.\" Title: pack200.1
++.\"
++.if n .pl 99999
++.TH pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,243 +47,243 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-pack200 \- Packages a JAR file into a compressed pack200 file for web deployment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBpack200\fR [\fIoptions\fR] \fIoutput\-file\fR \fIJAR\-file\fR
+-.fi
+-.sp
+-Options can be in any order\&. The last option on the command line or in a properties file supersedes all previously specified options\&.
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIoutput-file\fR
+-Name of the output file\&.
+-.TP
+-\fIJAR-file\fR
+-Name of the input file\&.
+-.SH DESCRIPTION
+-The \f3pack200\fR command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor\&. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time\&.
+-.PP
+-The \f3pack200\fR command has several options to fine-tune and set the compression engine\&. The typical usage is shown in the following example, where \f3myarchive\&.pack\&.gz\fR is produced with the default \f3pack200\fR command settings:
+-.sp
+-.nf
+-\f3pack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--r, --repack
+-.br
+-Produces a JAR file by packing and unpacking a JAR file\&. The resulting file can be used as an input to the \f3jarsigner\fR(1) tool\&. The following example packs and unpacks the myarchive\&.jar file:
+-.sp
+-.nf
+-\f3pack200 \-\-repack myarchive\-packer\&.jar myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3pack200 \-\-repack myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following example preserves the order of files in the input file\&.
+-.TP
+--g, --no-gzip
+-.br
+-Produces a \f3pack200\fR file\&. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser\&.
+-.sp
+-.nf
+-\f3pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--G, --strip-debug
+-.br
+-Strips debugging attributes from the output\&. These include \f3SourceFile\fR, \f3LineNumberTable\fR, \f3LocalVariableTable\fR and \f3LocalVariableTypeTable\fR\&. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers\&.
+-.TP
+---keep-file-order
+-.br
+-Preserve the order of files in the input file\&. This is the default behavior\&.
+-.TP
+--O, --no-keep-file-order
+-.br
+-The packer reorders and transmits all elements\&. The packer can also remove JAR directory names to reduce the download size\&. However, certain JAR file optimizations, such as indexing, might not work correctly\&.
+-.TP
+--S\fIvalue\fR , --segment-limit=\fIvalue\fR
+-.br
+-The value is the estimated target size \fIN\fR (in bytes) of each archive segment\&. If a single input file requires more than \fIN\fR bytes, then its own archive segment is provided\&. As a special case, a value of \f3-1\fR produces a single large segment with all input files, while a value of 0 produces one segment for each class\&. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory\&.
+-
+-The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties\&.
+-
+-The default is -1, which means that the packer creates a single segment output file\&. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs\&.
+-
+-A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit)\&.
+-.TP
+--E\fIvalue\fR , --effort=\fIvalue\fR
+-.br
+-If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive\&. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression\&. The special value 0 instructs the \f3pack200\fR command to copy through the original JAR file directly with no compression\&. The JSR 200 standard requires any unpacker to understand this special case as a pass-through of the entire archive\&.
+-
+-The default is 5, to invest a modest amount of time to produce reasonable compression\&.
+-.TP
+--H\fIvalue\fR , --deflate-hint=\fIvalue\fR
+-.br
+-Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger\&. The possible values are: \f3true\fR, \f3false\fR, or \f3keep\fR\&.
+-
+-If the \f3value\fR is \f3true\fR or false, then the \f3packer200\fR command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements\&.
+-
+-The \f3keep\fR value preserves deflation hints observed in the input JAR\&. This is the default\&.
+-.TP
+--m\fIvalue\fR , --modification-time=\fIvalue\fR
+-.br
+-The possible values are \f3latest\fR and \f3keep\fR\&.
+-
+-If the value is latest, then the packer attempts to determine the latest modification time, among all the available entries in the original archive, or the latest modification time of all the available entries in that segment\&. This single value is transmitted as part of the segment and applied to all the entries in each segment\&. This can marginally decrease the transmitted size of the archive at the expense of setting all installed files to a single date\&.
+-
+-If the value is \f3keep\fR, then modification times observed in the input JAR are preserved\&. This is the default\&.
+-.TP
+--P\fIfile\fR , --pass-file=\fIfile\fR
+-.br
+-Indicates that a file should be passed through bytewise with no compression\&. By repeating the option, multiple files can be specified\&. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/)\&. The resulting file names must match exactly as strings with their occurrences in the JAR file\&. If \f3file\fR is a directory name, then all files under that directory are passed\&.
+-.TP
+--U\fIaction\fR , --unknown-attribute=\fIaction\fR
+-.br
+-Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action\fR\&. The possible values for actions are \f3error\fR, \f3strip\fR, or \f3pass\fR\&.
+-
+-If the value is \f3error\fR, then the entire \f3pack200\fR command operation fails with a suitable explanation\&.
+-
+-If the value is \f3strip\fR, then the attribute is dropped\&. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures\&.
+-
+-If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
+-.TP
+-.nf
+--C\fIattribute-name\fR=\fIlayout\fR , --class-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--F\fIattribute-name\fR=\fIlayout\fR , --field-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--M\fIattribute-name\fR=\fIlayout\fR , --method-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--D\fIattribute-name\fR=\fIlayout\fR , --code-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute\fR, \f3field-attribute\fR, \f3method-attribute\fR, and \f3code-attribute\fR\&. The \fIattribute-name\fR is the name of the attribute for which the layout or action is being defined\&. The possible values for \fIaction\fR are \f3some-layout-string\fR, \f3error\fR, \f3strip\fR, \f3pass\fR\&.
+-
+-\f3some-layout-string\fR: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH\fR\&.
+-
+-If the value is \f3error\fR, then the \f3pack200\fR operation fails with an explanation\&.
+-
+-If the value is \f3strip\fR, then the attribute is removed from the output\&. Removing JVM-required attributes can cause class loader failures\&. For example, \f3--class-attribute=CompilationID=pass\fR causes the class file that contains this attribute to be passed through without further action by the packer\&.
+-
+-If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
+-.TP
+--f \fIpack\&.properties\fR , --config-file=\fIpack\&.properties\fR
+-.br
+-A configuration file, containing Java properties to initialize the packer, can be specified on the command line\&.
+-.sp
+-.nf
+-\f3pack200 \-f pack\&.properties myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3more pack\&.properties\fP
+-.fi
+-.nf
+-\f3# Generic properties for the packer\&.\fP
+-.fi
+-.nf
+-\f3modification\&.time=latest\fP
+-.fi
+-.nf
+-\f3deflate\&.hint=false\fP
+-.fi
+-.nf
+-\f3keep\&.file\&.order=false\fP
+-.fi
+-.nf
+-\f3# This option will cause the files bearing new attributes to\fP
+-.fi
+-.nf
+-\f3# be reported as an error rather than passed uncompressed\&.\fP
+-.fi
+-.nf
+-\f3unknown\&.attribute=error\fP
+-.fi
+-.nf
+-\f3# Change the segment limit to be unlimited\&.\fP
+-.fi
+-.nf
+-\f3segment\&.limit=\-1\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--v, --verbose
+-.br
+-Outputs minimal messages\&. Multiple specification of this option will create more verbose messages\&.
+-.TP
+--q, --quiet
+-.br
+-Specifies quiet operation with no messages\&.
+-.TP
+--l\fIfilename\fR , --log-file=\fIfilename\fR
+-.br
+-Specifies a log file to output messages\&.
+-.TP
+--?, -h, --help
+-.br
+-Prints help information about this command\&.
+-.TP
+--V, --version
+-.br
+-Prints version information about this command\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes the specified option to the Java Virtual Machine\&. For more information, see the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
+-.SH EXIT\ STATUS
+-The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs\&.
+-.SH NOTES
+-This command should not be confused with \f3pack\fR(1)\&. The \f3pack\fR and \f3pack200\fR commands are separate products\&.
+-.PP
+-The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-unpack200(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
++
++.SH NAME
++pack200 \- Packages a JAR file into a compressed pack200 file for web deployment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBpack200\fR [\fIoptions\fR] \fIoutput\-file\fR \fIJAR\-file\fR
++.fi
++.sp
++Options can be in any order\&. The last option on the command line or in a properties file supersedes all previously specified options\&.
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIoutput-file\fR
++Name of the output file\&.
++.TP
++\fIJAR-file\fR
++Name of the input file\&.
++.SH DESCRIPTION
++The \f3pack200\fR command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor\&. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time\&.
++.PP
++The \f3pack200\fR command has several options to fine-tune and set the compression engine\&. The typical usage is shown in the following example, where \f3myarchive\&.pack\&.gz\fR is produced with the default \f3pack200\fR command settings:
++.sp
++.nf
++\f3pack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-r, --repack
++.br
++Produces a JAR file by packing and unpacking a JAR file\&. The resulting file can be used as an input to the \f3jarsigner\fR(1) tool\&. The following example packs and unpacks the myarchive\&.jar file:
++.sp
++.nf
++\f3pack200 \-\-repack myarchive\-packer\&.jar myarchive\&.jar\fP
++.fi
++.nf
++\f3pack200 \-\-repack myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following example preserves the order of files in the input file\&.
++.TP
++-g, --no-gzip
++.br
++Produces a \f3pack200\fR file\&. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser\&.
++.sp
++.nf
++\f3pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-G, --strip-debug
++.br
++Strips debugging attributes from the output\&. These include \f3SourceFile\fR, \f3LineNumberTable\fR, \f3LocalVariableTable\fR and \f3LocalVariableTypeTable\fR\&. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers\&.
++.TP
++--keep-file-order
++.br
++Preserve the order of files in the input file\&. This is the default behavior\&.
++.TP
++-O, --no-keep-file-order
++.br
++The packer reorders and transmits all elements\&. The packer can also remove JAR directory names to reduce the download size\&. However, certain JAR file optimizations, such as indexing, might not work correctly\&.
++.TP
++-S\fIvalue\fR , --segment-limit=\fIvalue\fR
++.br
++The value is the estimated target size \fIN\fR (in bytes) of each archive segment\&. If a single input file requires more than \fIN\fR bytes, then its own archive segment is provided\&. As a special case, a value of \f3-1\fR produces a single large segment with all input files, while a value of 0 produces one segment for each class\&. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory\&.
++
++The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties\&.
++
++The default is -1, which means that the packer creates a single segment output file\&. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs\&.
++
++A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit)\&.
++.TP
++-E\fIvalue\fR , --effort=\fIvalue\fR
++.br
++If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive\&. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression\&. The special value 0 instructs the \f3pack200\fR command to copy through the original JAR file directly with no compression\&. The JSR 200 standard requires any unpacker to understand this special case as a pass-through of the entire archive\&.
++
++The default is 5, to invest a modest amount of time to produce reasonable compression\&.
++.TP
++-H\fIvalue\fR , --deflate-hint=\fIvalue\fR
++.br
++Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger\&. The possible values are: \f3true\fR, \f3false\fR, or \f3keep\fR\&.
++
++If the \f3value\fR is \f3true\fR or false, then the \f3packer200\fR command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements\&.
++
++The \f3keep\fR value preserves deflation hints observed in the input JAR\&. This is the default\&.
++.TP
++-m\fIvalue\fR , --modification-time=\fIvalue\fR
++.br
++The possible values are \f3latest\fR and \f3keep\fR\&.
++
++If the value is latest, then the packer attempts to determine the latest modification time, among all the available entries in the original archive, or the latest modification time of all the available entries in that segment\&. This single value is transmitted as part of the segment and applied to all the entries in each segment\&. This can marginally decrease the transmitted size of the archive at the expense of setting all installed files to a single date\&.
++
++If the value is \f3keep\fR, then modification times observed in the input JAR are preserved\&. This is the default\&.
++.TP
++-P\fIfile\fR , --pass-file=\fIfile\fR
++.br
++Indicates that a file should be passed through bytewise with no compression\&. By repeating the option, multiple files can be specified\&. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/)\&. The resulting file names must match exactly as strings with their occurrences in the JAR file\&. If \f3file\fR is a directory name, then all files under that directory are passed\&.
++.TP
++-U\fIaction\fR , --unknown-attribute=\fIaction\fR
++.br
++Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action\fR\&. The possible values for actions are \f3error\fR, \f3strip\fR, or \f3pass\fR\&.
++
++If the value is \f3error\fR, then the entire \f3pack200\fR command operation fails with a suitable explanation\&.
++
++If the value is \f3strip\fR, then the attribute is dropped\&. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures\&.
++
++If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
++.TP
++.nf
++-C\fIattribute-name\fR=\fIlayout\fR , --class-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-F\fIattribute-name\fR=\fIlayout\fR , --field-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-M\fIattribute-name\fR=\fIlayout\fR , --method-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-D\fIattribute-name\fR=\fIlayout\fR , --code-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute\fR, \f3field-attribute\fR, \f3method-attribute\fR, and \f3code-attribute\fR\&. The \fIattribute-name\fR is the name of the attribute for which the layout or action is being defined\&. The possible values for \fIaction\fR are \f3some-layout-string\fR, \f3error\fR, \f3strip\fR, \f3pass\fR\&.
++
++\f3some-layout-string\fR: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH\fR\&.
++
++If the value is \f3error\fR, then the \f3pack200\fR operation fails with an explanation\&.
++
++If the value is \f3strip\fR, then the attribute is removed from the output\&. Removing JVM-required attributes can cause class loader failures\&. For example, \f3--class-attribute=CompilationID=pass\fR causes the class file that contains this attribute to be passed through without further action by the packer\&.
++
++If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
++.TP
++-f \fIpack\&.properties\fR , --config-file=\fIpack\&.properties\fR
++.br
++A configuration file, containing Java properties to initialize the packer, can be specified on the command line\&.
++.sp
++.nf
++\f3pack200 \-f pack\&.properties myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3more pack\&.properties\fP
++.fi
++.nf
++\f3# Generic properties for the packer\&.\fP
++.fi
++.nf
++\f3modification\&.time=latest\fP
++.fi
++.nf
++\f3deflate\&.hint=false\fP
++.fi
++.nf
++\f3keep\&.file\&.order=false\fP
++.fi
++.nf
++\f3# This option will cause the files bearing new attributes to\fP
++.fi
++.nf
++\f3# be reported as an error rather than passed uncompressed\&.\fP
++.fi
++.nf
++\f3unknown\&.attribute=error\fP
++.fi
++.nf
++\f3# Change the segment limit to be unlimited\&.\fP
++.fi
++.nf
++\f3segment\&.limit=\-1\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-v, --verbose
++.br
++Outputs minimal messages\&. Multiple specification of this option will create more verbose messages\&.
++.TP
++-q, --quiet
++.br
++Specifies quiet operation with no messages\&.
++.TP
++-l\fIfilename\fR , --log-file=\fIfilename\fR
++.br
++Specifies a log file to output messages\&.
++.TP
++-?, -h, --help
++.br
++Prints help information about this command\&.
++.TP
++-V, --version
++.br
++Prints version information about this command\&.
++.TP
++-J\fIoption\fR
++.br
++Passes the specified option to the Java Virtual Machine\&. For more information, see the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
++.SH EXIT\ STATUS
++The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs\&.
++.SH NOTES
++This command should not be confused with \f3pack\fR(1)\&. The \f3pack\fR and \f3pack200\fR commands are separate products\&.
++.PP
++The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++unpack200(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/policytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/policytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Security Tools
+-.\" Title: policytool.1
+-.\"
+-.if n .pl 99999
+-.TH policytool 1 "03 March 2015" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Security Tools
++.\" Title: policytool.1
++.\"
++.if n .pl 99999
++.TH policytool 1 "03 March 2015" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,67 +47,67 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-policytool \- Reads and writes a plain text policy file based on user input through the utility GUI\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBpolicytool\fR [ \fB\-file\fR ] [ \fIfilename\fR ]
+-.fi
+-.sp
+-.TP
+--file
+-.br
+-Directs the \f3policytool\fR command to load a policy file\&.
+-.TP
+-\fIfilename\fR
+-The name of the file to be loaded\&.
+-.PP
+-\fIExamples\fR:
+-.PP
+-Run the policy tool administrator utility:
+-.sp
+-.nf
+-\f3policytool\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3policytool\fR command and load the specified file:
+-.sp
+-.nf
+-\f3policytool \-file \fImypolicyfile\fR\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH DESCRIPTION
+-The \f3policytool\fR command calls an administrator\&'s GUI that enables system administrators to manage the contents of local policy files\&. A policy file is a plain-text file with a \f3\&.policy\fR extension, that maps remote requestors by domain, to permission objects\&. For details, see Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.SH OPTIONS
+-.TP
+--file
+-.br
+-Directs the \f3policytool\fR command to load a policy file\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.TP 0.2i
+-\(bu
+-Policy File Creation and Management at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html
+-.TP 0.2i
+-\(bu
+-Permissions in Java SE Development Kit (JDK) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html
+-.TP 0.2i
+-\(bu
+-Java Security Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html
+-.TP 0.2i
+-\(bu
+-Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html
++
++.SH NAME
++policytool \- Reads and writes a plain text policy file based on user input through the utility GUI\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBpolicytool\fR [ \fB\-file\fR ] [ \fIfilename\fR ]
++.fi
++.sp
++.TP
++-file
++.br
++Directs the \f3policytool\fR command to load a policy file\&.
++.TP
++\fIfilename\fR
++The name of the file to be loaded\&.
++.PP
++\fIExamples\fR:
++.PP
++Run the policy tool administrator utility:
++.sp
++.nf
++\f3policytool\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3policytool\fR command and load the specified file:
++.sp
++.nf
++\f3policytool \-file \fImypolicyfile\fR\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH DESCRIPTION
++The \f3policytool\fR command calls an administrator\&'s GUI that enables system administrators to manage the contents of local policy files\&. A policy file is a plain-text file with a \f3\&.policy\fR extension, that maps remote requestors by domain, to permission objects\&. For details, see Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.SH OPTIONS
++.TP
++-file
++.br
++Directs the \f3policytool\fR command to load a policy file\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.TP 0.2i
++\(bu
++Policy File Creation and Management at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html
++.TP 0.2i
++\(bu
++Permissions in Java SE Development Kit (JDK) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html
++.TP 0.2i
++\(bu
++Java Security Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html
++.TP 0.2i
++\(bu
++Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/rmic.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/rmic.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmic.1
+-.\"
+-.if n .pl 99999
+-.TH rmic 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmic.1
++.\"
++.if n .pl 99999
++.TH rmic 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,176 +47,176 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmic \- Generates stub, skeleton, and tie classes for remote objects that use the Java Remote Method Protocol (JRMP) or Internet Inter-Orb protocol (IIOP)\&. Also generates Object Management Group (OMG) Interface Definition Language (IDL)
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmic\fR [ \fIoptions\fR ] \fIpackage\-qualified\-class\-names\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line \f3options\fR\&. See Options\&.
+-.TP
+-\fIpackage-qualified-class-names\fR
+-Class names that include their packages, for example, \f3java\&.awt\&.Color\fR\&.
+-.SH DESCRIPTION
+-\fIDeprecation Note:\fR Support for static generation of Java Remote Method Protocol (JRMP) stubs and skeletons has been deprecated\&. Oracle recommends that you use dynamically generated JRMP stubs instead, eliminating the need to use this tool for JRMP-based applications\&. See the \f3java\&.rmi\&.server\&.UnicastRemoteObject\fR specification at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html for further information\&.
+-.PP
+-The \f3rmic\fR compiler generates stub and skeleton class files using the Java Remote Method Protocol (JRMP) and stub and tie class files (IIOP protocol) for remote objects\&. These class files are generated from compiled Java programming language classes that are remote object implementation classes\&. A remote implementation class is a class that implements the interface \f3java\&.rmi\&.Remote\fR\&. The class names in the \f3rmic\fR command must be for classes that were compiled successfully with the \f3javac\fR command and must be fully package qualified\&. For example, running the \f3rmic\fR command on the class file name \f3HelloImpl\fR as shown here creates the \f3HelloImpl_Stub\&.class\fRfile in the hello subdirectory (named for the class\&'s package):
+-.sp
+-.nf
+-\f3rmic hello\&.HelloImpl\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-A skeleton for a remote object is a JRMP protocol server-side entity that has a method that dispatches calls to the remote object implementation\&.
+-.PP
+-A tie for a remote object is a server-side entity similar to a skeleton, but communicates with the client with the IIOP protocol\&.
+-.PP
+-A stub is a client-side proxy for a remote object that is responsible for communicating method invocations on remote objects to the server where the actual remote object implementation resides\&. A client\&'s reference to a remote object, therefore, is actually a reference to a local stub\&.
+-.PP
+-By default, the \f3rmic\fR command generates stub classes that use the 1\&.2 JRMP stub protocol version only, as though the \f3-v1\&.2\fR option was specified\&. The \f3-vcompat\fR option was the default in releases before 5\&.0\&. Use the \f3-iiop\fR option to generate stub and tie classes for the IIOP protocol\&. See Options\&.
+-.PP
+-A stub implements only the remote interfaces, and not any local interfaces that the remote object also implements\&. Because a JRMP stub implements the same set of remote interfaces as the remote object, a client can use the Java programming language built-in operators for casting and type checking\&. For IIOP, the \f3PortableRemoteObject\&.narrow\fR method must be used\&.
+-.SH OPTIONS
+-.TP
+--bootclasspath \fIpath\fR
+-.br
+-Overrides the location of bootstrap class files\&.
+-.TP
+--classpath path
+-.br
+-Specifies the path the \f3rmic\fR command uses to look up classes\&. This option overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons\&. The general format for path is: \f3\&.:<your_path>\fR, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies the root destination directory for the generated class hierarchy\&. You can use this option to specify a destination directory for the stub, skeleton, and tie files\&. For example, the following command places the stub and skeleton classes derived from MyClass into the directory /java/classes/exampleclass\&.
+-.sp
+-.nf
+-\f3rmic \-d /java/classes exampleclass\&.MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the \f3-d\fR option is not specified, then the default behavior is as if \f3-d \&.\fR was specified\&. The package hierarchy of the target class is created in the current directory, and stub/tie/skeleton files are placed within it\&. In some earlier releases of the \f3rmic\fR command, if the \f3-d\fR option was not specified, then the package hierarchy was not created, and all of the output files were placed directly in the current directory\&.
+-.TP
+--extdirs \fIpath\fR
+-.br
+-Overrides the location of installed extensions\&.
+-.TP
+--g
+-.br
+-Enables the generation of all debugging information, including local variables\&. By default, only line number information is generated\&.
+-.TP
+--idl
+-.br
+-Causes the \f3rmic\fR command to generate OMG IDL for the classes specified and any classes referenced\&. IDL provides a purely declarative, programming language-independent way to specify an API for an object\&. The IDL is used as a specification for methods and data that can be written in and called from any language that provides CORBA bindings\&. This includes Java and C++ among others\&. See Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
+-
+-When the \f3-idl\fR option is used, other options also include:
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
+-.TP 0.2i
+-\(bu
+-The \f3-factory\fR option uses the \f3factory\fR keyword in generated IDL\&.
+-.TP 0.2i
+-\(bu
+-The \f3-idlModule\fR from J\f3avaPackage[\&.class]\fR\f3toIDLModule\fR specifies \f3IDLEntity\fR package mapping, for example: \f3-idlModule\fR\f3my\&.module my::real::idlmod\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3-idlFile\fR\f3fromJavaPackage[\&.class] toIDLFile\fR specifies \f3IDLEntity\fR file mapping, for example: \f3-idlFile test\&.pkg\&.X TEST16\&.idl\fR\&.
+-.RE
+-
+-.TP
+--iiop
+-.br
+-Causes the \f3rmic\fR command to generate IIOP stub and tie classes, rather than JRMP stub and skeleton classes\&. A stub class is a local proxy for a remote object and is used by clients to send calls to a server\&. Each remote interface requires a stub class, which implements that remote interface\&. A client reference to a remote object is a reference to a stub\&. Tie classes are used on the server side to process incoming calls, and dispatch the calls to the proper implementation class\&. Each implementation class requires a tie class\&.
+-
+-If you call the \f3rmic\fR command with the \f3-iiop\fR, then it generates stubs and ties that conform to this naming convention:
+-.sp
+-.nf
+-\f3_<implementationName>_stub\&.class\fP
+-.fi
+-.nf
+-\f3_<interfaceName>_tie\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.RS
+-.TP 0.2i
+-\(bu
+-When you use the \f3-iiop\fR option, other options also include:
+-.TP 0.2i
+-\(bu
+-The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
+-.TP 0.2i
+-\(bu
+-The \f3-nolocalstubs\fR option means do not create stubs optimized for same-process clients and servers\&.
+-.TP 0.2i
+-\(bu
+-The \f3-noValueMethods\fR option must be used with the \f3-idl\fR option\&. The \f3-noValueMethods\fR option prevents the addition of \f3valuetype\fR methods and initializers to emitted IDL\&. These methods and initializers are optional for valuetypes, and are generated unless the \f3-noValueMethods\fR option is specified with the \f3-idl\fR option\&.
+-.TP 0.2i
+-\(bu
+-The \f3-poa\fR option changes the inheritance from \f3org\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR to \f3org\&.omg\&.PortableServer\&.Servant\fR\&. The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. In the Java programming language, the \f3Servant\fR type is mapped to the \f3Java org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&. Based on the OMG IDL to Java Language Mapping Specification, CORBA V 2\&.3\&.1 ptc/00-01-08\&.pdf\&..RE
+-
+-.TP
+--J
+-.br
+-Used with any Java command, the \f3-J\fR option passes the argument that follows the \f3-J\fR (no spaces between the \f3-J\fRand the argument) to the Java interpreter
+-.TP
+--keep or -keepgenerated
+-.br
+-Retains the generated \f3\&.java\fR source files for the stub, skeleton, and tie classes and writes them to the same directory as the\f3\&.class\fR files\&.
+-.TP
+--nowarn
+-.br
+-Turns off warnings\&. When the \f3-nowarn\fR options is used\&. The compiler does not print out any warnings\&.
+-.TP
+--nowrite
+-.br
+-Does not write compiled classes to the file system\&.
+-.TP
+--vcompat (deprecated)
+-.br
+-Generates stub and skeleton classes that are compatible with both the 1\&.1 and 1\&.2 JRMP stub protocol versions\&. This option was the default in releases before 5\&.0\&. The generated stub classes use the 1\&.1 stub protocol version when loaded in a JDK 1\&.1 virtual machine and use the 1\&.2 stub protocol version when loaded into a 1\&.2 (or later) virtual machine\&. The generated skeleton classes support both 1\&.1 and 1\&.2 stub protocol versions\&. The generated classes are relatively large to support both modes of operation\&. Note: This option has been deprecated\&. See Description\&.
+-.TP
+--verbose
+-.br
+-Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded\&.
+-.TP
+--v1\&.1 (deprecated)
+-.br
+-Generates stub and skeleton classes for the 1\&.1 JRMP stub protocol version only\&. The \f3-v1\&.1\fR option is only useful for generating stub classes that are serialization-compatible with preexisting, statically deployed stub classes that were generated by the \f3rmic\fR command from JDK 1\&.1 and that cannot be upgraded (and dynamic class loading is not being used)\&. Note: This option has been deprecated\&. See Description\&.
+-.TP
+--v1\&.2 (deprecated)
+-.br
+-(Default) Generates stub classes for the 1\&.2 JRMP stub protocol version only\&. No skeleton classes are generated because skeleton classes are not used with the 1\&.2 stub protocol version\&. The generated stub classes do not work when they are loaded into a JDK 1\&.1 virtual machine\&. Note: This option has been deprecated\&. See Description\&.
+-.SH ENVIRONMENT\ VARIABLES
+-.TP
+-CLASSPATH
+-Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-Setting the Class Path
++
++.SH NAME
++rmic \- Generates stub, skeleton, and tie classes for remote objects that use the Java Remote Method Protocol (JRMP) or Internet Inter-Orb protocol (IIOP)\&. Also generates Object Management Group (OMG) Interface Definition Language (IDL)
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmic\fR [ \fIoptions\fR ] \fIpackage\-qualified\-class\-names\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line \f3options\fR\&. See Options\&.
++.TP
++\fIpackage-qualified-class-names\fR
++Class names that include their packages, for example, \f3java\&.awt\&.Color\fR\&.
++.SH DESCRIPTION
++\fIDeprecation Note:\fR Support for static generation of Java Remote Method Protocol (JRMP) stubs and skeletons has been deprecated\&. Oracle recommends that you use dynamically generated JRMP stubs instead, eliminating the need to use this tool for JRMP-based applications\&. See the \f3java\&.rmi\&.server\&.UnicastRemoteObject\fR specification at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html for further information\&.
++.PP
++The \f3rmic\fR compiler generates stub and skeleton class files using the Java Remote Method Protocol (JRMP) and stub and tie class files (IIOP protocol) for remote objects\&. These class files are generated from compiled Java programming language classes that are remote object implementation classes\&. A remote implementation class is a class that implements the interface \f3java\&.rmi\&.Remote\fR\&. The class names in the \f3rmic\fR command must be for classes that were compiled successfully with the \f3javac\fR command and must be fully package qualified\&. For example, running the \f3rmic\fR command on the class file name \f3HelloImpl\fR as shown here creates the \f3HelloImpl_Stub\&.class\fRfile in the hello subdirectory (named for the class\&'s package):
++.sp
++.nf
++\f3rmic hello\&.HelloImpl\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++A skeleton for a remote object is a JRMP protocol server-side entity that has a method that dispatches calls to the remote object implementation\&.
++.PP
++A tie for a remote object is a server-side entity similar to a skeleton, but communicates with the client with the IIOP protocol\&.
++.PP
++A stub is a client-side proxy for a remote object that is responsible for communicating method invocations on remote objects to the server where the actual remote object implementation resides\&. A client\&'s reference to a remote object, therefore, is actually a reference to a local stub\&.
++.PP
++By default, the \f3rmic\fR command generates stub classes that use the 1\&.2 JRMP stub protocol version only, as though the \f3-v1\&.2\fR option was specified\&. The \f3-vcompat\fR option was the default in releases before 5\&.0\&. Use the \f3-iiop\fR option to generate stub and tie classes for the IIOP protocol\&. See Options\&.
++.PP
++A stub implements only the remote interfaces, and not any local interfaces that the remote object also implements\&. Because a JRMP stub implements the same set of remote interfaces as the remote object, a client can use the Java programming language built-in operators for casting and type checking\&. For IIOP, the \f3PortableRemoteObject\&.narrow\fR method must be used\&.
++.SH OPTIONS
++.TP
++-bootclasspath \fIpath\fR
++.br
++Overrides the location of bootstrap class files\&.
++.TP
++-classpath path
++.br
++Specifies the path the \f3rmic\fR command uses to look up classes\&. This option overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons\&. The general format for path is: \f3\&.:<your_path>\fR, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.TP
++-d \fIdirectory\fR
++.br
++Specifies the root destination directory for the generated class hierarchy\&. You can use this option to specify a destination directory for the stub, skeleton, and tie files\&. For example, the following command places the stub and skeleton classes derived from MyClass into the directory /java/classes/exampleclass\&.
++.sp
++.nf
++\f3rmic \-d /java/classes exampleclass\&.MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the \f3-d\fR option is not specified, then the default behavior is as if \f3-d \&.\fR was specified\&. The package hierarchy of the target class is created in the current directory, and stub/tie/skeleton files are placed within it\&. In some earlier releases of the \f3rmic\fR command, if the \f3-d\fR option was not specified, then the package hierarchy was not created, and all of the output files were placed directly in the current directory\&.
++.TP
++-extdirs \fIpath\fR
++.br
++Overrides the location of installed extensions\&.
++.TP
++-g
++.br
++Enables the generation of all debugging information, including local variables\&. By default, only line number information is generated\&.
++.TP
++-idl
++.br
++Causes the \f3rmic\fR command to generate OMG IDL for the classes specified and any classes referenced\&. IDL provides a purely declarative, programming language-independent way to specify an API for an object\&. The IDL is used as a specification for methods and data that can be written in and called from any language that provides CORBA bindings\&. This includes Java and C++ among others\&. See Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
++
++When the \f3-idl\fR option is used, other options also include:
++.RS
++.TP 0.2i
++\(bu
++The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
++.TP 0.2i
++\(bu
++The \f3-factory\fR option uses the \f3factory\fR keyword in generated IDL\&.
++.TP 0.2i
++\(bu
++The \f3-idlModule\fR from J\f3avaPackage[\&.class]\fR\f3toIDLModule\fR specifies \f3IDLEntity\fR package mapping, for example: \f3-idlModule\fR\f3my\&.module my::real::idlmod\fR\&.
++.TP 0.2i
++\(bu
++\f3-idlFile\fR\f3fromJavaPackage[\&.class] toIDLFile\fR specifies \f3IDLEntity\fR file mapping, for example: \f3-idlFile test\&.pkg\&.X TEST16\&.idl\fR\&.
++.RE
++
++.TP
++-iiop
++.br
++Causes the \f3rmic\fR command to generate IIOP stub and tie classes, rather than JRMP stub and skeleton classes\&. A stub class is a local proxy for a remote object and is used by clients to send calls to a server\&. Each remote interface requires a stub class, which implements that remote interface\&. A client reference to a remote object is a reference to a stub\&. Tie classes are used on the server side to process incoming calls, and dispatch the calls to the proper implementation class\&. Each implementation class requires a tie class\&.
++
++If you call the \f3rmic\fR command with the \f3-iiop\fR, then it generates stubs and ties that conform to this naming convention:
++.sp
++.nf
++\f3_<implementationName>_stub\&.class\fP
++.fi
++.nf
++\f3_<interfaceName>_tie\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.RS
++.TP 0.2i
++\(bu
++When you use the \f3-iiop\fR option, other options also include:
++.TP 0.2i
++\(bu
++The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
++.TP 0.2i
++\(bu
++The \f3-nolocalstubs\fR option means do not create stubs optimized for same-process clients and servers\&.
++.TP 0.2i
++\(bu
++The \f3-noValueMethods\fR option must be used with the \f3-idl\fR option\&. The \f3-noValueMethods\fR option prevents the addition of \f3valuetype\fR methods and initializers to emitted IDL\&. These methods and initializers are optional for valuetypes, and are generated unless the \f3-noValueMethods\fR option is specified with the \f3-idl\fR option\&.
++.TP 0.2i
++\(bu
++The \f3-poa\fR option changes the inheritance from \f3org\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR to \f3org\&.omg\&.PortableServer\&.Servant\fR\&. The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. In the Java programming language, the \f3Servant\fR type is mapped to the \f3Java org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&. Based on the OMG IDL to Java Language Mapping Specification, CORBA V 2\&.3\&.1 ptc/00-01-08\&.pdf\&..RE
++
++.TP
++-J
++.br
++Used with any Java command, the \f3-J\fR option passes the argument that follows the \f3-J\fR (no spaces between the \f3-J\fRand the argument) to the Java interpreter
++.TP
++-keep or -keepgenerated
++.br
++Retains the generated \f3\&.java\fR source files for the stub, skeleton, and tie classes and writes them to the same directory as the\f3\&.class\fR files\&.
++.TP
++-nowarn
++.br
++Turns off warnings\&. When the \f3-nowarn\fR options is used\&. The compiler does not print out any warnings\&.
++.TP
++-nowrite
++.br
++Does not write compiled classes to the file system\&.
++.TP
++-vcompat (deprecated)
++.br
++Generates stub and skeleton classes that are compatible with both the 1\&.1 and 1\&.2 JRMP stub protocol versions\&. This option was the default in releases before 5\&.0\&. The generated stub classes use the 1\&.1 stub protocol version when loaded in a JDK 1\&.1 virtual machine and use the 1\&.2 stub protocol version when loaded into a 1\&.2 (or later) virtual machine\&. The generated skeleton classes support both 1\&.1 and 1\&.2 stub protocol versions\&. The generated classes are relatively large to support both modes of operation\&. Note: This option has been deprecated\&. See Description\&.
++.TP
++-verbose
++.br
++Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded\&.
++.TP
++-v1\&.1 (deprecated)
++.br
++Generates stub and skeleton classes for the 1\&.1 JRMP stub protocol version only\&. The \f3-v1\&.1\fR option is only useful for generating stub classes that are serialization-compatible with preexisting, statically deployed stub classes that were generated by the \f3rmic\fR command from JDK 1\&.1 and that cannot be upgraded (and dynamic class loading is not being used)\&. Note: This option has been deprecated\&. See Description\&.
++.TP
++-v1\&.2 (deprecated)
++.br
++(Default) Generates stub classes for the 1\&.2 JRMP stub protocol version only\&. No skeleton classes are generated because skeleton classes are not used with the 1\&.2 stub protocol version\&. The generated stub classes do not work when they are loaded into a JDK 1\&.1 virtual machine\&. Note: This option has been deprecated\&. See Description\&.
++.SH ENVIRONMENT\ VARIABLES
++.TP
++CLASSPATH
++Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++Setting the Class Path
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/rmid.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/rmid.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmid.1
+-.\"
+-.if n .pl 99999
+-.TH rmid 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmid.1
++.\"
++.if n .pl 99999
++.TH rmid 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,267 +47,267 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmid \- Starts the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmid\fR [\fIoptions\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3rmid\fR command starts the activation system daemon\&. The activation system daemon must be started before activatable objects can be either registered with the activation system or activated in a JVM\&. For details on how to write programs that use activatable objects, the \fIUsing Activation\fR tutorial at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html
+-.PP
+-Start the daemon by executing the \f3rmid\fR command and specifying a security policy file, as follows:
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When you run Oracle\(cqs implementation of the \f3rmid\fR command, by default you must specify a security policy file so that the \f3rmid\fR command can verify whether or not the information in each \f3ActivationGroupDesc\fR is allowed to be used to start a JVM for an activation group\&. Specifically, the command and options specified by the \f3CommandEnvironment\fR and any properties passed to an \f3ActivationGroupDesc\fR constructor must now be explicitly allowed in the security policy file for the \f3rmid\fR command\&. The value of the \f3sun\&.rmi\&.activation\&.execPolicy\fR property dictates the policy that the \f3rmid\fR command uses to determine whether or not the information in an \f3ActivationGroupDesc\fR can be used to start a JVM for an activation group\&. For more information see the description of the -J-Dsun\&.rmi\&.activation\&.execPolicy=policy option\&.
+-.PP
+-Executing the \f3rmid\fR command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem\fR to the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR in this internal registry\&.
+-.PP
+-To specify an alternate port for the registry, you must specify the \f3-port\fR option when you execute the \f3rmid\fR command\&. For example, the following command starts the activation system daemon and a registry on the registry\&'s default port, 1099\&.
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH START\ RMID\ ON\ DEMAND
+-An alternative to starting \f3rmid\fR from the command line is to configure \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) to start \f3rmid\fR on demand\&.
+-.PP
+-When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd\fR/\f3xinetd\fR) by calling the \f3System\&.inheritedChannel\fR method\&. If the inherited channel is null or not an instance of \f3java\&.nio\&.channels\&.ServerSocketChannel\fR, then RMID assumes that it was not started by \f3inetd\fR/\f3xinetd\fR, and it starts as previously described\&.
+-.PP
+-If the inherited channel is a \f3ServerSocketChannel\fR instance, then RMID uses the \f3java\&.net\&.ServerSocket\fR obtained from the \f3ServerSocketChannel\fR as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java\&.rmi\&.activation\&.ActivationSystem\fR is bound and the \f3java\&.rmi\&.activation\&.Activator\fR remote object\&. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
+-.TP 0.2i
+-\(bu
+-Output printed to \f3System\&.err\fR is redirected to a file\&. This file is located in the directory specified by the \f3java\&.io\&.tmpdir\fR system property (typically \f3/var/tmp\fR or \f3/tmp\fR) with the prefix \f3rmid-err\fR and the suffix \f3tmp\fR\&.
+-.TP 0.2i
+-\(bu
+-The \f3-port\fR option is not allowed\&. If this option is specified, then RMID exits with an error message\&.
+-.TP 0.2i
+-\(bu
+-The \f3-log\fR option is required\&. If this option is not specified, then RMID exits with an error message
+-.PP
+-See the man pages for \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) for details on how to configure services to be started on demand\&.
+-.SH OPTIONS
+-.TP
+--C\fIoption\fR
+-.br
+-Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid\fR command when that process is created\&. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
+-.sp
+-.nf
+-\f3rmid \-C\-Dsome\&.property=value\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This ability to pass command-line arguments to child processes can be useful for debugging\&. For example, the following command enables server-call logging in all child JVMs\&.
+-.sp
+-.nf
+-\f3rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--J\fIoption\fR
+-.br
+-Specifies an option that is passed to the Java interpreter running RMID\&. For example, to specify that the \f3rmid\fR command use a policy file named \f3rmid\&.policy\fR, the \f3-J\fR option can be used to define the \f3java\&.security\&.policy\fR property on the \f3rmid\fR command line, for example:
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--J-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR
+-.br
+-Specifies the policy that RMID employs to check commands and command-line options used to start the JVM in which an activation group runs\&. Please note that this option exists only in Oracle\&'s implementation of the Java RMI activation daemon\&. If this property is not specified on the command line, then the result is the same as though \f3-J-Dsun\&.rmi\&.activation\&.execPolicy=default\fR were specified\&. The possible values of \f3policy\fR can be \f3default\fR, \f3policyClassName\fR, or \f3none\fR\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-default
+-
+-The \f3default\fR or unspecified value \f3execPolicy\fR allows the \f3rmid\fR command to execute commands with specific command-line options only when the \f3rmid\fR command was granted permission to execute those commands and options in the security policy file that the \f3rmid\fR command uses\&. Only the default activation group implementation can be used with the default execution policy\&.
+-
+-The \f3rmid\fR command starts a JVM for an activation group with the information in the group\&'s registered activation group descriptor, an \f3ActivationGroupDesc\fR\&. The group descriptor specifies an optional \f3ActivationGroupDesc\&.CommandEnvironment\fR that includes the command to execute to start the activation group and any command-line options to be added to the command line\&. By default, the \f3rmid\fR command uses the \f3java\fR command found in \f3java\&.home\fR\&. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>\fR\&.The \f3com\&.sun\&.rmi\&.rmid\&.ExecPermission\fR permission grants the \f3rmid\fR command permission to execute a command that is specified in the group descriptor\&'s \f3CommandEnvironment\fR to start an activation group\&. The \f3com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR permission enables the \f3rmid\fR command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment\fR when starting the activation group\&.When granting the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources\&.
+-
+-\fIExecPermission\fR
+-
+-The \f3ExecPermission\fR class represents permission for the \f3rmid\fR command to execute a specific command to start an activation group\&.
+-
+-\fISyntax\fR: The name of an \f3ExecPermission\fR is the path name of a command to grant the \f3rmid\fR command permission to execute\&. A path name that ends in a slash (/) and an asterisk (*) indicates that all of the files contained in that directory where slash is the file-separator character, \f3File\&.separatorChar\fR\&. A path name that ends in a slash (/) and a minus sign (-) indicates all files and subdirectories contained in that directory (recursively)\&. A path name that consists of the special token \f3<<ALL FILES>>\fR matches any file\&.
+-
+-A path name that consists of an asterisk (*) indicates all the files in the current directory\&. A path name that consists of a minus sign (-) indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory\&.
+-
+-\fIExecOptionPermission\fR
+-
+-The \f3ExecOptionPermission\fR class represents permission for the \f3rmid\fR command to use a specific command-line option when starting an activation group\&. The name of an \f3ExecOptionPermission\fR is the value of a command-line option\&.
+-
+-\fISyntax\fR: Options support a limited wild card scheme\&. An asterisk signifies a wild card match, and it can appear as the option name itself (matches any option), or an asterisk (*) can appear at the end of the option name only when the asterisk (*) follows a dot (\&.) or an equals sign (=)\&.
+-
+-For example: \f3*\fR or \f3-Dmydir\&.*\fR or \f3-Da\&.b\&.c=*\fR is valid, but \f3*mydir\fR or \f3-Da*b\fR or \f3ab*\fR is not\&.
+-
+-\fIPolicy file for rmid\fR
+-
+-When you grant the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources (universally)\&. It is safe to grant these permissions universally because only the \f3rmid\fR command checks these permissions\&.
+-
+-An example policy file that grants various execute permissions to the \f3rmid\fR command is:
+-.sp
+-.nf
+-\f3grant {\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
+-.fi
+-.nf
+-\f3 "/files/apps/java/jdk1\&.7\&.0/solaris/bin/java";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
+-.fi
+-.nf
+-\f3 "/files/apps/rmidcmds/*";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Djava\&.security\&.policy=/files/policies/group\&.policy";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Djava\&.security\&.debug=*";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Dsun\&.rmi\&.*";\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The first permission granted allows the \f3rmid\fR tcommand o execute the 1\&.7\&.0 release of the \f3java\fR command, specified by its explicit path name\&. By default, the version of the \f3java\fR command found in \f3java\&.home\fR is used (the same one that the \f3rmid\fR command uses), and does not need to be specified in the policy file\&. The second permission allows the \f3rmid\fR command to execute any command in the directory \f3/files/apps/rmidcmds\fR\&.
+-
+-The third permission granted, an \f3ExecOptionPermission\fR, allows the \f3rmid\fR command to start an activation group that defines the security policy file to be \f3/files/policies/group\&.policy\fR\&. The next permission allows the \f3java\&.security\&.debug property\fR to be used by an activation group\&. The last permission allows any property in the \f3sun\&.rmi property\fR name hierarchy to be used by activation groups\&.
+-
+-To start the \f3rmid\fR command with a policy file, the \f3java\&.security\&.policy\fR property needs to be specified on the \f3rmid\fR command line, for example:
+-
+-\f3rmid -J-Djava\&.security\&.policy=rmid\&.policy\fR\&.
+-.TP 0.2i
+-\(bu
+-<policyClassName>
+-
+-If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid\fR command, the name of a class whose \f3checkExecCommand\fR method is executed to check commands to be executed by the \f3rmid\fR command\&.
+-
+-The \f3policyClassName\fR specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand\fR method:
+-.sp
+-.nf
+-\f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)\fP
+-.fi
+-.nf
+-\f3 throws SecurityException;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Before starting an activation group, the \f3rmid\fR command calls the policy\&'s \f3checkExecCommand\fR method and passes to it the activation group descriptor and an array that contains the complete command to start the activation group\&. If the \f3checkExecCommand\fR throws a \f3SecurityException\fR, then the \f3rmid\fR command does not start the activation group and an \f3ActivationException\fR is thrown to the caller attempting to activate the object\&.
+-.TP 0.2i
+-\(bu
+-none
+-
+-If the \f3sun\&.rmi\&.activation\&.execPolicy\fR property value is \f3none\fR, then the \f3rmid\fR command does not perform any validation of commands to start activation groups\&.
+-.RE
+-
+-.TP
+--log \fIdir\fR
+-.br
+-Specifies the name of the directory the activation system daemon uses to write its database and associated information\&. The log directory defaults to creating a log, in the directory in which the \f3rmid\fR command was executed\&.
+-.TP
+--port \fIport\fR
+-.br
+-Specifies the port the registry uses\&. The activation system daemon binds the \f3ActivationSystem\fR, with the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR, in this registry\&. The \f3ActivationSystem\fR on the local machine can be obtained using the following \f3Naming\&.lookup\fR method call:
+-.sp
+-.nf
+-\f3import java\&.rmi\&.*; \fP
+-.fi
+-.nf
+-\f3 import java\&.rmi\&.activation\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 ActivationSystem system; system = (ActivationSystem)\fP
+-.fi
+-.nf
+-\f3 Naming\&.lookup("//:port/java\&.rmi\&.activation\&.ActivationSystem");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--stop
+-.br
+-Stops the current invocation of the \f3rmid\fR command for a port specified by the \f3-port\fR option\&. If no port is specified, then this option stops the \f3rmid\fR invocation running on port 1098\&.
+-.SH ENVIRONMENT\ VARIABLES
+-.TP
+-CLASSPATH
+-Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-Setting the Class Path
++
++.SH NAME
++rmid \- Starts the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmid\fR [\fIoptions\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3rmid\fR command starts the activation system daemon\&. The activation system daemon must be started before activatable objects can be either registered with the activation system or activated in a JVM\&. For details on how to write programs that use activatable objects, the \fIUsing Activation\fR tutorial at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html
++.PP
++Start the daemon by executing the \f3rmid\fR command and specifying a security policy file, as follows:
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When you run Oracle\(cqs implementation of the \f3rmid\fR command, by default you must specify a security policy file so that the \f3rmid\fR command can verify whether or not the information in each \f3ActivationGroupDesc\fR is allowed to be used to start a JVM for an activation group\&. Specifically, the command and options specified by the \f3CommandEnvironment\fR and any properties passed to an \f3ActivationGroupDesc\fR constructor must now be explicitly allowed in the security policy file for the \f3rmid\fR command\&. The value of the \f3sun\&.rmi\&.activation\&.execPolicy\fR property dictates the policy that the \f3rmid\fR command uses to determine whether or not the information in an \f3ActivationGroupDesc\fR can be used to start a JVM for an activation group\&. For more information see the description of the -J-Dsun\&.rmi\&.activation\&.execPolicy=policy option\&.
++.PP
++Executing the \f3rmid\fR command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem\fR to the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR in this internal registry\&.
++.PP
++To specify an alternate port for the registry, you must specify the \f3-port\fR option when you execute the \f3rmid\fR command\&. For example, the following command starts the activation system daemon and a registry on the registry\&'s default port, 1099\&.
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH START\ RMID\ ON\ DEMAND
++An alternative to starting \f3rmid\fR from the command line is to configure \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) to start \f3rmid\fR on demand\&.
++.PP
++When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd\fR/\f3xinetd\fR) by calling the \f3System\&.inheritedChannel\fR method\&. If the inherited channel is null or not an instance of \f3java\&.nio\&.channels\&.ServerSocketChannel\fR, then RMID assumes that it was not started by \f3inetd\fR/\f3xinetd\fR, and it starts as previously described\&.
++.PP
++If the inherited channel is a \f3ServerSocketChannel\fR instance, then RMID uses the \f3java\&.net\&.ServerSocket\fR obtained from the \f3ServerSocketChannel\fR as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java\&.rmi\&.activation\&.ActivationSystem\fR is bound and the \f3java\&.rmi\&.activation\&.Activator\fR remote object\&. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
++.TP 0.2i
++\(bu
++Output printed to \f3System\&.err\fR is redirected to a file\&. This file is located in the directory specified by the \f3java\&.io\&.tmpdir\fR system property (typically \f3/var/tmp\fR or \f3/tmp\fR) with the prefix \f3rmid-err\fR and the suffix \f3tmp\fR\&.
++.TP 0.2i
++\(bu
++The \f3-port\fR option is not allowed\&. If this option is specified, then RMID exits with an error message\&.
++.TP 0.2i
++\(bu
++The \f3-log\fR option is required\&. If this option is not specified, then RMID exits with an error message
++.PP
++See the man pages for \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) for details on how to configure services to be started on demand\&.
++.SH OPTIONS
++.TP
++-C\fIoption\fR
++.br
++Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid\fR command when that process is created\&. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
++.sp
++.nf
++\f3rmid \-C\-Dsome\&.property=value\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This ability to pass command-line arguments to child processes can be useful for debugging\&. For example, the following command enables server-call logging in all child JVMs\&.
++.sp
++.nf
++\f3rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-J\fIoption\fR
++.br
++Specifies an option that is passed to the Java interpreter running RMID\&. For example, to specify that the \f3rmid\fR command use a policy file named \f3rmid\&.policy\fR, the \f3-J\fR option can be used to define the \f3java\&.security\&.policy\fR property on the \f3rmid\fR command line, for example:
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-J-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR
++.br
++Specifies the policy that RMID employs to check commands and command-line options used to start the JVM in which an activation group runs\&. Please note that this option exists only in Oracle\&'s implementation of the Java RMI activation daemon\&. If this property is not specified on the command line, then the result is the same as though \f3-J-Dsun\&.rmi\&.activation\&.execPolicy=default\fR were specified\&. The possible values of \f3policy\fR can be \f3default\fR, \f3policyClassName\fR, or \f3none\fR\&.
++.RS
++.TP 0.2i
++\(bu
++default
++
++The \f3default\fR or unspecified value \f3execPolicy\fR allows the \f3rmid\fR command to execute commands with specific command-line options only when the \f3rmid\fR command was granted permission to execute those commands and options in the security policy file that the \f3rmid\fR command uses\&. Only the default activation group implementation can be used with the default execution policy\&.
++
++The \f3rmid\fR command starts a JVM for an activation group with the information in the group\&'s registered activation group descriptor, an \f3ActivationGroupDesc\fR\&. The group descriptor specifies an optional \f3ActivationGroupDesc\&.CommandEnvironment\fR that includes the command to execute to start the activation group and any command-line options to be added to the command line\&. By default, the \f3rmid\fR command uses the \f3java\fR command found in \f3java\&.home\fR\&. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>\fR\&.The \f3com\&.sun\&.rmi\&.rmid\&.ExecPermission\fR permission grants the \f3rmid\fR command permission to execute a command that is specified in the group descriptor\&'s \f3CommandEnvironment\fR to start an activation group\&. The \f3com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR permission enables the \f3rmid\fR command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment\fR when starting the activation group\&.When granting the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources\&.
++
++\fIExecPermission\fR
++
++The \f3ExecPermission\fR class represents permission for the \f3rmid\fR command to execute a specific command to start an activation group\&.
++
++\fISyntax\fR: The name of an \f3ExecPermission\fR is the path name of a command to grant the \f3rmid\fR command permission to execute\&. A path name that ends in a slash (/) and an asterisk (*) indicates that all of the files contained in that directory where slash is the file-separator character, \f3File\&.separatorChar\fR\&. A path name that ends in a slash (/) and a minus sign (-) indicates all files and subdirectories contained in that directory (recursively)\&. A path name that consists of the special token \f3<<ALL FILES>>\fR matches any file\&.
++
++A path name that consists of an asterisk (*) indicates all the files in the current directory\&. A path name that consists of a minus sign (-) indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory\&.
++
++\fIExecOptionPermission\fR
++
++The \f3ExecOptionPermission\fR class represents permission for the \f3rmid\fR command to use a specific command-line option when starting an activation group\&. The name of an \f3ExecOptionPermission\fR is the value of a command-line option\&.
++
++\fISyntax\fR: Options support a limited wild card scheme\&. An asterisk signifies a wild card match, and it can appear as the option name itself (matches any option), or an asterisk (*) can appear at the end of the option name only when the asterisk (*) follows a dot (\&.) or an equals sign (=)\&.
++
++For example: \f3*\fR or \f3-Dmydir\&.*\fR or \f3-Da\&.b\&.c=*\fR is valid, but \f3*mydir\fR or \f3-Da*b\fR or \f3ab*\fR is not\&.
++
++\fIPolicy file for rmid\fR
++
++When you grant the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources (universally)\&. It is safe to grant these permissions universally because only the \f3rmid\fR command checks these permissions\&.
++
++An example policy file that grants various execute permissions to the \f3rmid\fR command is:
++.sp
++.nf
++\f3grant {\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
++.fi
++.nf
++\f3 "/files/apps/java/jdk1\&.7\&.0/solaris/bin/java";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
++.fi
++.nf
++\f3 "/files/apps/rmidcmds/*";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Djava\&.security\&.policy=/files/policies/group\&.policy";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Djava\&.security\&.debug=*";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Dsun\&.rmi\&.*";\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The first permission granted allows the \f3rmid\fR tcommand o execute the 1\&.7\&.0 release of the \f3java\fR command, specified by its explicit path name\&. By default, the version of the \f3java\fR command found in \f3java\&.home\fR is used (the same one that the \f3rmid\fR command uses), and does not need to be specified in the policy file\&. The second permission allows the \f3rmid\fR command to execute any command in the directory \f3/files/apps/rmidcmds\fR\&.
++
++The third permission granted, an \f3ExecOptionPermission\fR, allows the \f3rmid\fR command to start an activation group that defines the security policy file to be \f3/files/policies/group\&.policy\fR\&. The next permission allows the \f3java\&.security\&.debug property\fR to be used by an activation group\&. The last permission allows any property in the \f3sun\&.rmi property\fR name hierarchy to be used by activation groups\&.
++
++To start the \f3rmid\fR command with a policy file, the \f3java\&.security\&.policy\fR property needs to be specified on the \f3rmid\fR command line, for example:
++
++\f3rmid -J-Djava\&.security\&.policy=rmid\&.policy\fR\&.
++.TP 0.2i
++\(bu
++<policyClassName>
++
++If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid\fR command, the name of a class whose \f3checkExecCommand\fR method is executed to check commands to be executed by the \f3rmid\fR command\&.
++
++The \f3policyClassName\fR specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand\fR method:
++.sp
++.nf
++\f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)\fP
++.fi
++.nf
++\f3 throws SecurityException;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Before starting an activation group, the \f3rmid\fR command calls the policy\&'s \f3checkExecCommand\fR method and passes to it the activation group descriptor and an array that contains the complete command to start the activation group\&. If the \f3checkExecCommand\fR throws a \f3SecurityException\fR, then the \f3rmid\fR command does not start the activation group and an \f3ActivationException\fR is thrown to the caller attempting to activate the object\&.
++.TP 0.2i
++\(bu
++none
++
++If the \f3sun\&.rmi\&.activation\&.execPolicy\fR property value is \f3none\fR, then the \f3rmid\fR command does not perform any validation of commands to start activation groups\&.
++.RE
++
++.TP
++-log \fIdir\fR
++.br
++Specifies the name of the directory the activation system daemon uses to write its database and associated information\&. The log directory defaults to creating a log, in the directory in which the \f3rmid\fR command was executed\&.
++.TP
++-port \fIport\fR
++.br
++Specifies the port the registry uses\&. The activation system daemon binds the \f3ActivationSystem\fR, with the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR, in this registry\&. The \f3ActivationSystem\fR on the local machine can be obtained using the following \f3Naming\&.lookup\fR method call:
++.sp
++.nf
++\f3import java\&.rmi\&.*; \fP
++.fi
++.nf
++\f3 import java\&.rmi\&.activation\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 ActivationSystem system; system = (ActivationSystem)\fP
++.fi
++.nf
++\f3 Naming\&.lookup("//:port/java\&.rmi\&.activation\&.ActivationSystem");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-stop
++.br
++Stops the current invocation of the \f3rmid\fR command for a port specified by the \f3-port\fR option\&. If no port is specified, then this option stops the \f3rmid\fR invocation running on port 1098\&.
++.SH ENVIRONMENT\ VARIABLES
++.TP
++CLASSPATH
++Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++Setting the Class Path
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/rmiregistry.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/rmiregistry.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmiregistry.1
+-.\"
+-.if n .pl 99999
+-.TH rmiregistry 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmiregistry.1
++.\"
++.if n .pl 99999
++.TH rmiregistry 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,51 +47,51 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmiregistry \- Starts a remote object registry on the specified port on the current host\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmiregistry\fR [ \fIport\fR ]
+-.fi
+-.sp
+-.TP
+-\fIport\fR
+-The number of a \f3port\fR on the current host at which to start the remote object registry\&.
+-.SH DESCRIPTION
+-The \f3rmiregistry\fR command creates and starts a remote object registry on the specified port on the current host\&. If the port is omitted, then the registry is started on port 1099\&. The \f3rmiregistry\fR command produces no output and is typically run in the background, for example:
+-.sp
+-.nf
+-\f3rmiregistry &\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-A remote object registry is a bootstrap naming service that is used by RMI servers on the same host to bind remote objects to names\&. Clients on local and remote hosts can then look up remote objects and make remote method invocations\&.
+-.PP
+-The registry is typically used to locate the first remote object on which an application needs to call methods\&. That object then provides application-specific support for finding other objects\&.
+-.PP
+-The methods of the \f3java\&.rmi\&.registry\&.LocateRegistry\fR class are used to get a registry operating on the local host or local host and port\&.
+-.PP
+-The URL-based methods of the \f3java\&.rmi\&.Naming\fR class operate on a registry and can be used to look up a remote object on any host and on the local host\&. Bind a simple name (string) to a remote object, rebind a new name to a remote object (overriding the old binding), unbind a remote object, and list the URL bound in the registry\&.
+-.SH OPTIONS
+-.TP
+--J
+-.br
+-Used with any Java option to pass the option following the \f3-J\fR (no spaces between the \f3-J\fR and the option) to the Java interpreter\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-\f3java\&.rmi\&.registry\&.LocateRegistry\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html
+-.TP 0.2i
+-\(bu
+-\f3java\&.rmi\&.Naming class description\fR at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html
++
++.SH NAME
++rmiregistry \- Starts a remote object registry on the specified port on the current host\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmiregistry\fR [ \fIport\fR ]
++.fi
++.sp
++.TP
++\fIport\fR
++The number of a \f3port\fR on the current host at which to start the remote object registry\&.
++.SH DESCRIPTION
++The \f3rmiregistry\fR command creates and starts a remote object registry on the specified port on the current host\&. If the port is omitted, then the registry is started on port 1099\&. The \f3rmiregistry\fR command produces no output and is typically run in the background, for example:
++.sp
++.nf
++\f3rmiregistry &\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++A remote object registry is a bootstrap naming service that is used by RMI servers on the same host to bind remote objects to names\&. Clients on local and remote hosts can then look up remote objects and make remote method invocations\&.
++.PP
++The registry is typically used to locate the first remote object on which an application needs to call methods\&. That object then provides application-specific support for finding other objects\&.
++.PP
++The methods of the \f3java\&.rmi\&.registry\&.LocateRegistry\fR class are used to get a registry operating on the local host or local host and port\&.
++.PP
++The URL-based methods of the \f3java\&.rmi\&.Naming\fR class operate on a registry and can be used to look up a remote object on any host and on the local host\&. Bind a simple name (string) to a remote object, rebind a new name to a remote object (overriding the old binding), unbind a remote object, and list the URL bound in the registry\&.
++.SH OPTIONS
++.TP
++-J
++.br
++Used with any Java option to pass the option following the \f3-J\fR (no spaces between the \f3-J\fR and the option) to the Java interpreter\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++\f3java\&.rmi\&.registry\&.LocateRegistry\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html
++.TP 0.2i
++\(bu
++\f3java\&.rmi\&.Naming class description\fR at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/schemagen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/schemagen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: schemagen.1
+-.\"
+-.if n .pl 99999
+-.TH schemagen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: schemagen.1
++.\"
++.if n .pl 99999
++.TH schemagen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,74 +47,74 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-schemagen \- Generates a schema for every name space that is referenced in your Java classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBschemagen\fR [ \fIoptions\fR ] \fIjava\-files\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIjava-files\fR
+-The Java class files to be processed\&.
+-.SH DESCRIPTION
+-The schema generator creates a schema file for each name space referenced in your Java classes\&. Currently, you cannot control the name of the generated schema files\&. To control the schema file names, see Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
+-.PP
+-Start the schema generator with the appropriate \f3schemagen\fR shell script in the bin directory for your platform\&. The current schema generator can process either Java source files or class files\&.
+-.sp
+-.nf
+-\f3schemagen\&.sh Foo\&.java Bar\&.java \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3Note: Writing schema1\&.xsd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If your java files reference other classes, then those classes must be accessible on your system \f3CLASSPATH\fR environment variable, or they need to be specified in the \f3schemagen\fR command line with the class path options\&. See Options\&. If the referenced files are not accessible or specified, then you get errors when you generate the schema\&.
+-.SH OPTIONS
+-.TP
+--d \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places processor-generated and \f3javac\fR-generated class files\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places user-specified files\&.
+-.TP
+--classpath \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places user-specified files\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Specifies the encoding to use for \f3apt\fR or \f3javac\fR command invocations\&.
+-.TP
+--episode \fIfile\fR
+-.br
+-Generates an episode file for separate compilation\&.
+-.TP
+--version
+-.br
+-Displays release information\&.
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
+-.TP 0.2i
+-\(bu
+-Java Architecture for XML Binding (JAXB) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/xml/jaxb/index\&.html
++
++.SH NAME
++schemagen \- Generates a schema for every name space that is referenced in your Java classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBschemagen\fR [ \fIoptions\fR ] \fIjava\-files\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIjava-files\fR
++The Java class files to be processed\&.
++.SH DESCRIPTION
++The schema generator creates a schema file for each name space referenced in your Java classes\&. Currently, you cannot control the name of the generated schema files\&. To control the schema file names, see Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
++.PP
++Start the schema generator with the appropriate \f3schemagen\fR shell script in the bin directory for your platform\&. The current schema generator can process either Java source files or class files\&.
++.sp
++.nf
++\f3schemagen\&.sh Foo\&.java Bar\&.java \&.\&.\&.\fP
++.fi
++.nf
++\f3Note: Writing schema1\&.xsd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If your java files reference other classes, then those classes must be accessible on your system \f3CLASSPATH\fR environment variable, or they need to be specified in the \f3schemagen\fR command line with the class path options\&. See Options\&. If the referenced files are not accessible or specified, then you get errors when you generate the schema\&.
++.SH OPTIONS
++.TP
++-d \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places processor-generated and \f3javac\fR-generated class files\&.
++.TP
++-cp \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places user-specified files\&.
++.TP
++-classpath \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places user-specified files\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Specifies the encoding to use for \f3apt\fR or \f3javac\fR command invocations\&.
++.TP
++-episode \fIfile\fR
++.br
++Generates an episode file for separate compilation\&.
++.TP
++-version
++.br
++Displays release information\&.
++.TP
++-help
++.br
++Displays a help message\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
++.TP 0.2i
++\(bu
++Java Architecture for XML Binding (JAXB) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/xml/jaxb/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/serialver.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/serialver.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: serialver.1
+-.\"
+-.if n .pl 99999
+-.TH serialver 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: serialver.1
++.\"
++.if n .pl 99999
++.TH serialver 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,63 +47,63 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-serialver \- Returns the serial version UID for specified classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBserialver\fR [ \fIoptions\fR ] [ \fIclassnames\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIclassnames\fR
+-The classes for which the \f3serialVersionUID\fR is to be returned\&.
+-.SH DESCRIPTION
+-The \f3serialver\fR command returns the \f3serialVersionUID\fR for one or more classes in a form suitable for copying into an evolving class\&. When called with no arguments, the \f3serialver\fR command prints a usage line\&.
+-.SH OPTIONS
+-.TP
+--classpath \fIpath-files\fR
+-.br
+-Sets the search path for application classes and resources\&. Separate classes and resources with a colon (:)\&.
+-.TP
+--show
+-.br
+-Displays a simple user interface\&. Enter the full class name and press either the \fIEnter\fR key or the \fIShow\fR button to display the \f3serialVersionUID\fR\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH NOTES
+-The \f3serialver\fR command loads and initializes the specified classes in its virtual machine, and by default, it does not set a security manager\&. If the \f3serialver\fR command is to be run with untrusted classes, then a security manager can be set with the following option:
+-.sp
+-.nf
+-\f3\-J\-Djava\&.security\&.manager\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When necessary, a security policy can be specified with the following option:
+-.sp
+-.nf
+-\f3\-J\-Djava\&.security\&.policy=<policy file>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-policytool(1)
+-.TP 0.2i
+-\(bu
+-The \f3java\&.io\&.ObjectStream\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.html
++
++.SH NAME
++serialver \- Returns the serial version UID for specified classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBserialver\fR [ \fIoptions\fR ] [ \fIclassnames\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIclassnames\fR
++The classes for which the \f3serialVersionUID\fR is to be returned\&.
++.SH DESCRIPTION
++The \f3serialver\fR command returns the \f3serialVersionUID\fR for one or more classes in a form suitable for copying into an evolving class\&. When called with no arguments, the \f3serialver\fR command prints a usage line\&.
++.SH OPTIONS
++.TP
++-classpath \fIpath-files\fR
++.br
++Sets the search path for application classes and resources\&. Separate classes and resources with a colon (:)\&.
++.TP
++-show
++.br
++Displays a simple user interface\&. Enter the full class name and press either the \fIEnter\fR key or the \fIShow\fR button to display the \f3serialVersionUID\fR\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH NOTES
++The \f3serialver\fR command loads and initializes the specified classes in its virtual machine, and by default, it does not set a security manager\&. If the \f3serialver\fR command is to be run with untrusted classes, then a security manager can be set with the following option:
++.sp
++.nf
++\f3\-J\-Djava\&.security\&.manager\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When necessary, a security policy can be specified with the following option:
++.sp
++.nf
++\f3\-J\-Djava\&.security\&.policy=<policy file>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++policytool(1)
++.TP 0.2i
++\(bu
++The \f3java\&.io\&.ObjectStream\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/servertool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/servertool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: servertool.1
+-.\"
+-.if n .pl 99999
+-.TH servertool 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: servertool.1
++.\"
++.if n .pl 99999
++.TH servertool 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-servertool \- Provides an easy-to-use interface for developers to register, unregister, start up, and shut down a persistent server\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBservertool\fR \-ORBInitialPort \fInameserverport\fR [ \fIoptions\fR ] [ \fIcommands \fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-commands
+-The command-line commands\&. See Commands\&.
+-.SH DESCRIPTION
+-The \f3servertool\fR command provides the command-line interface for developers to register, unregister, start up, and shut down a persistent server\&. Command-line commands let you obtain various statistical information about the server\&. See Commands\&.
+-.SH OPTIONS
+-.TP
+--ORBInitialHost \fInameserverhost\fR
+-.br
+-This options is required\&. It specifies the host machine on which the name server runs and listens for incoming requests\&. The \f3nameserverhost\fR value must specify the port on which the \f3orb\fR is running and listening for requests\&. The value defaults to \f3localhost\fR when this option is not specified\&. If \f3orbd\fR and \f3servertool\fR are running on different machines, then you must specify the name or IP address of the host on which \f3orbd\fR is running\&.
+-
+-\fINote:\fR On Oracle Solaris, you must become a root user to start a process on a port below 1024\&. Oracle recommends that you use a port number above or equal to 1024 for the \f3nameserverport\fR value\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH COMMANDS
+-You can start the \f3servertool\fR command with or without a command-line command\&.
+-.TP 0.2i
+-\(bu
+-If you did not specify a command when you started \f3servertool\fR, then the command-line tool displays the \f3servertool\fR prompt where you can enter commands: \f3servertool >\fR\&.
+-.TP 0.2i
+-\(bu
+-If you specify a command when you start \f3servertool\fR, then the Java IDL Server Tool starts, executes the command, and exits\&.
+-.TP
+-.ll 180
+-register -server \fIserver-class-name\fR -classpath \fIclasspath-to-server\fR [ -applicationName \fIapplication-name\fR -args \fIargs-to-server\fR -vmargs \fIflags-for-JVM\fR ]
+-Registers a new persistent server with the Object Request Broker Daemon (ORBD)\&. If the server is not already registered, then it is registered and activated\&. This command causes an installation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The installation method must be \f3public static void install(org\&.omg\&.CORBA\&.ORB)\fR\&. The install method is optional and lets developers provide their own server installation behavior, such as creating a database schema\&.
+-.TP
+-.ll 180
+-unregister -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
+-Unregisters a server from the ORBD with either its server ID or its application name\&. This command causes an uninstallation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The \f3uninstall\fR method must be \f3public static void uninstall(org\&.omg\&.CORBA\&.ORB)\fR\&. The \f3uninstall\fR method is optional and lets developers provide their own server uninstallation behavior, such as undoing the behavior of the \f3install\fR method\&.
+-.TP
+-getserverid -applicationName \fIapplication-name\fR
+-Returns the server ID that corresponds to the \f3application-name\fR value\&.
+-.TP
+-list
+-Lists information about all persistent servers registered with the ORBD\&.
+-.TP
+-listappnames
+-Lists the application names for all servers currently registered with the ORBD\&.
+-.TP
+-listactive
+-Lists information about all persistent servers that were started by the ORBD and are currently running\&.
+-.TP
+-.ll 180
+-locate -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -endpointType \fIendpointType\fR ]
+-Locates the endpoints (ports) of a specific type for all ORBs created by a registered server\&. If a server is not already running, then it is activated\&. If an \f3endpointType\fR value is not specified, then the plain/non-protected endpoint associated with each ORB in a server is returned\&.
+-.TP
+-.ll 180
+-locateperorb -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -orbid \fIORB-name\fR ]
+-Locates all the endpoints (ports) registered by a specific Object Request Broker (ORB) of registered server\&. If a server is not already running, then it is activated\&. If an \f3orbid\fR is not specified, then the default value of \f3""\fR is assigned to the \f3orbid\fR\&. If any ORBs are created with an \f3orbid\fR of empty string, then all ports registered by it are returned\&.
+-.TP
+-orblist -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
+-Lists the \f3ORBId\fR of the ORBs defined on a server\&. An \f3ORBId\fR is the string name for the ORB created by the server\&. If the server is not already running, then it is activated\&.
+-.TP
+-shutdown -serverid \fIserver-id\fR | -applicationName application-name
+-Shut down an active server that is registered with ORBD\&. During execution of this command, the \f3shutdown\fR method defined in the class specified by either the \f3-serverid\fR or \f3-applicationName\fR parameter is also called to shut down the server process\&.
+-.TP
+-startup -serverid \fIserver-id\fR | -applicationName application-name
+-Starts up or activate a server that is registered with ORBD\&. If the server is not running, then this command starts the server\&. If the server is already running, then an error message is displayed\&.
+-.TP
+-help
+-Lists all the commands available to the server through the \f3servertool\fR command\&.
+-.TP
+-quit
+-Exits the \f3servertool\fR command\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-orbd(1)
++
++.SH NAME
++servertool \- Provides an easy-to-use interface for developers to register, unregister, start up, and shut down a persistent server\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBservertool\fR \-ORBInitialPort \fInameserverport\fR [ \fIoptions\fR ] [ \fIcommands \fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++commands
++The command-line commands\&. See Commands\&.
++.SH DESCRIPTION
++The \f3servertool\fR command provides the command-line interface for developers to register, unregister, start up, and shut down a persistent server\&. Command-line commands let you obtain various statistical information about the server\&. See Commands\&.
++.SH OPTIONS
++.TP
++-ORBInitialHost \fInameserverhost\fR
++.br
++This options is required\&. It specifies the host machine on which the name server runs and listens for incoming requests\&. The \f3nameserverhost\fR value must specify the port on which the \f3orb\fR is running and listening for requests\&. The value defaults to \f3localhost\fR when this option is not specified\&. If \f3orbd\fR and \f3servertool\fR are running on different machines, then you must specify the name or IP address of the host on which \f3orbd\fR is running\&.
++
++\fINote:\fR On Oracle Solaris, you must become a root user to start a process on a port below 1024\&. Oracle recommends that you use a port number above or equal to 1024 for the \f3nameserverport\fR value\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH COMMANDS
++You can start the \f3servertool\fR command with or without a command-line command\&.
++.TP 0.2i
++\(bu
++If you did not specify a command when you started \f3servertool\fR, then the command-line tool displays the \f3servertool\fR prompt where you can enter commands: \f3servertool >\fR\&.
++.TP 0.2i
++\(bu
++If you specify a command when you start \f3servertool\fR, then the Java IDL Server Tool starts, executes the command, and exits\&.
++.TP
++.ll 180
++register -server \fIserver-class-name\fR -classpath \fIclasspath-to-server\fR [ -applicationName \fIapplication-name\fR -args \fIargs-to-server\fR -vmargs \fIflags-for-JVM\fR ]
++Registers a new persistent server with the Object Request Broker Daemon (ORBD)\&. If the server is not already registered, then it is registered and activated\&. This command causes an installation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The installation method must be \f3public static void install(org\&.omg\&.CORBA\&.ORB)\fR\&. The install method is optional and lets developers provide their own server installation behavior, such as creating a database schema\&.
++.TP
++.ll 180
++unregister -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
++Unregisters a server from the ORBD with either its server ID or its application name\&. This command causes an uninstallation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The \f3uninstall\fR method must be \f3public static void uninstall(org\&.omg\&.CORBA\&.ORB)\fR\&. The \f3uninstall\fR method is optional and lets developers provide their own server uninstallation behavior, such as undoing the behavior of the \f3install\fR method\&.
++.TP
++getserverid -applicationName \fIapplication-name\fR
++Returns the server ID that corresponds to the \f3application-name\fR value\&.
++.TP
++list
++Lists information about all persistent servers registered with the ORBD\&.
++.TP
++listappnames
++Lists the application names for all servers currently registered with the ORBD\&.
++.TP
++listactive
++Lists information about all persistent servers that were started by the ORBD and are currently running\&.
++.TP
++.ll 180
++locate -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -endpointType \fIendpointType\fR ]
++Locates the endpoints (ports) of a specific type for all ORBs created by a registered server\&. If a server is not already running, then it is activated\&. If an \f3endpointType\fR value is not specified, then the plain/non-protected endpoint associated with each ORB in a server is returned\&.
++.TP
++.ll 180
++locateperorb -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -orbid \fIORB-name\fR ]
++Locates all the endpoints (ports) registered by a specific Object Request Broker (ORB) of registered server\&. If a server is not already running, then it is activated\&. If an \f3orbid\fR is not specified, then the default value of \f3""\fR is assigned to the \f3orbid\fR\&. If any ORBs are created with an \f3orbid\fR of empty string, then all ports registered by it are returned\&.
++.TP
++orblist -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
++Lists the \f3ORBId\fR of the ORBs defined on a server\&. An \f3ORBId\fR is the string name for the ORB created by the server\&. If the server is not already running, then it is activated\&.
++.TP
++shutdown -serverid \fIserver-id\fR | -applicationName application-name
++Shut down an active server that is registered with ORBD\&. During execution of this command, the \f3shutdown\fR method defined in the class specified by either the \f3-serverid\fR or \f3-applicationName\fR parameter is also called to shut down the server process\&.
++.TP
++startup -serverid \fIserver-id\fR | -applicationName application-name
++Starts up or activate a server that is registered with ORBD\&. If the server is not running, then this command starts the server\&. If the server is already running, then an error message is displayed\&.
++.TP
++help
++Lists all the commands available to the server through the \f3servertool\fR command\&.
++.TP
++quit
++Exits the \f3servertool\fR command\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++orbd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/tnameserv.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/tnameserv.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1999, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: tnameserv.1
+-.\"
+-.if n .pl 99999
+-.TH tnameserv 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: tnameserv.1
++.\"
++.if n .pl 99999
++.TH tnameserv 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,441 +47,441 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-tnameserv \- Interface Definition Language (IDL)\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBtnameserve\fR \fB\-ORBInitialPort\fR [ \fInameserverport\fR ]
+-.fi
+-.sp
+-.TP
+--ORBInitialPort \fInameserverport\fR
+-.br
+-The initial port where the naming service listens for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references\fR methods\&.
+-.SH DESCRIPTION
+-Java IDL includes the Object Request Broker Daemon (ORBD)\&. ORBD is a daemon process that contains a Bootstrap Service, a Transient Naming Service, a Persistent Naming Service, and a Server Manager\&. The Java IDL tutorials all use ORBD, but you can substitute the \f3tnameserv\fR command for the \f3orbd\fR command in any of the examples that use a Transient Naming Service\&.
+-.PP
+-See orbd(1) or Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+-.PP
+-The CORBA Common Object Services (COS) Naming Service provides a tree-structure directory for object references similar to a file system that provides a directory structure for files\&. The Transient Naming Service provided with Java IDL, \f3tnameserv\fR, is a simple implementation of the COS Naming Service specification\&.
+-.PP
+-Object references are stored in the name space by name and each object reference-name pair is called a name binding\&. Name bindings can be organized under naming contexts\&. Naming contexts are name bindings and serve the same organizational function as a file system subdirectory\&. All bindings are stored under the initial naming context\&. The initial naming context is the only persistent binding in the name space\&. The rest of the name space is lost when the Java IDL naming service process stops and restarts\&.
+-.PP
+-For an applet or application to use COS naming, its ORB must know the port of a host running a naming service or have access to an initial naming context string for that naming service\&. The naming service can either be the Java IDL naming service or another COS-compliant naming service\&.
+-.SS START\ THE\ NAMING\ SERVICE
+-You must start the Java IDL naming service before an application or applet that uses its naming service\&. Installation of the Java IDL product creates a script (Oracle Solaris: \f3tnameserv\fR) or executable file (Windows: \f3tnameserv\&.exe\fR) that starts the Java IDL naming service\&. Start the naming service so it runs in the background\&.
+-.PP
+-If you do not specify otherwise, then the Java IDL naming service listens on port 900 for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references methods\fR, as follows:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort nameserverport&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the name server port, then port 900 is used by default\&. When running Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number greater than or equal to 1024\&. To specify a different port, for example, 1050, and to run the naming service in the background, from a UNIX command shell, enter:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort 1050&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-From an MS-DOS system prompt (Windows), enter:
+-.sp
+-.nf
+-\f3start tnameserv \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Clients of the name server must be made aware of the new port number\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR property to the new port number when you create the ORB object\&.
+-.SS RUN\ THE\ SERVER\ AND\ CLIENT\ ON\ DIFFERENT\ HOSTS
+-In most of the Java IDL and RMI-IIOP tutorials, the naming service, server, and client are all running on the development machine\&. In real-world deployment, the client and server probably run on different host machines from the Naming Service\&.
+-.PP
+-For the client and server to find the Naming Service, they must be made aware of the port number and host on which the naming service is running\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR and \f3org\&.omg\&.CORBA\&.ORBInitialHost\fR properties in the client and server files to the machine name and port number on which the Naming Service is running\&. An example of this is shown in Getting Started Using RMI-IIOP at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi-iiop/rmiiiopexample\&.html
+-.PP
+-You could also use the command-line options \f3-ORBInitialPort nameserverport#\fR and \f3-ORBInitialHost nameserverhostname\fR to tell the client and server where to find the naming service\&. For one example of doing this using the command-line option, see Java IDL: The Hello World Example on Two Machines at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.html
+-.PP
+-For example, suppose the Transient Naming Service, \f3tnameserv\fR is running on port 1050 on host \f3nameserverhost\fR\&. The client is running on host \f3clienthost,\fR and the server is running on host \f3serverhost\fR\&.
+-.PP
+-Start \f3tnameserv\fR on the host \f3nameserverhost\fR:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Start the server on the \f3serverhost\fR:
+-.sp
+-.nf
+-\f3java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Start the client on the \f3clienthost\fR:
+-.sp
+-.nf
+-\f3java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS STOP\ THE\ NAMING\ SERVICE
+-To stop the Java IDL naming service, use the relevant operating system command, such as \f3kill\fR for a Unix process or \f3Ctrl+C\fR for a Windows process\&. The naming service continues to wait for invocations until it is explicitly shut down\&. Note that names registered with the Java IDL naming service disappear when the service is terminated\&.
+-.SH OPTIONS
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH EXAMPLES
+-.SS ADD\ OBJECTS\ TO\ THE\ NAME\ SPACE
+-The following example shows how to add names to the name space\&. It is a self-contained Transient Naming Service client that creates the following simple tree\&.
+-.sp
+-.nf
+-\f3Initial Naming Context\fP
+-.fi
+-.nf
+-\f3 plans\fP
+-.fi
+-.nf
+-\f3 Personal\fP
+-.fi
+-.nf
+-\f3 calendar\fP
+-.fi
+-.nf
+-\f3 schedule\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this example, \f3plans\fR is an object reference and \f3Personal\fR is a naming context that contains two object references: \f3calendar\fR and \f3schedule\fR\&.
+-.sp
+-.nf
+-\f3import java\&.util\&.Properties;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CORBA\&.*;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CosNaming\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class NameClient {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public static void main(String args[]) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
+-.sp
+-.nf
+-\f3 Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3 ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code obtains the initial naming context and assigns it to \f3ctx\fR\&. The second line copies \f3ctx\fR into a dummy object reference \f3objref\fR that is attached to various names and added into the name space\&.
+-.sp
+-.nf
+-\f3 NamingContext ctx =\fP
+-.fi
+-.nf
+-\f3 NamingContextHelper\&.narrow(\fP
+-.fi
+-.nf
+-\f3 orb\&.resolve_initial_references("NameService"));\fP
+-.fi
+-.nf
+-\f3 NamingContext objref = ctx;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code creates a name \f3plans\fR of type \f3text\fR and binds it to the dummy object reference\&. \f3plans\fR is then added under the initial naming context using the \f3rebind\fR method\&. The \f3rebind\fR method enables you to run this program over and over again without getting the exceptions from using the \f3bind\fR method\&.
+-.sp
+-.nf
+-\f3 NameComponent nc1 = new NameComponent("plans", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name1 = {nc1};\fP
+-.fi
+-.nf
+-\f3 ctx\&.rebind(name1, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("plans rebind successful!");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code creates a naming context called \f3Personal\fR of type \f3directory\fR\&. The resulting object reference, \f3ctx2\fR, is bound to the \f3name\fR and added under the initial naming context\&.
+-.sp
+-.nf
+-\f3 NameComponent nc2 = new NameComponent("Personal", "directory");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name2 = {nc2};\fP
+-.fi
+-.nf
+-\f3 NamingContext ctx2 = ctx\&.bind_new_context(name2);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("new naming context added\&.\&.");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The remainder of the code binds the dummy object reference using the names \f3schedule\fR and \f3calendar\fR under the \f3Personal\fR naming context (\f3ctx2\fR)\&.
+-.sp
+-.nf
+-\f3 NameComponent nc3 = new NameComponent("schedule", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name3 = {nc3};\fP
+-.fi
+-.nf
+-\f3 ctx2\&.rebind(name3, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("schedule rebind successful!");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 NameComponent nc4 = new NameComponent("calender", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name4 = {nc4};\fP
+-.fi
+-.nf
+-\f3 ctx2\&.rebind(name4, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("calender rebind successful!");\fP
+-.fi
+-.nf
+-\f3 } catch (Exception e) {\fP
+-.fi
+-.nf
+-\f3 e\&.printStackTrace(System\&.err);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS BROWSING\ THE\ NAME\ SPACE
+-The following sample program shoes how to browse the name space\&.
+-.sp
+-.nf
+-\f3import java\&.util\&.Properties;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CORBA\&.*;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CosNaming\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class NameClientList {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public static void main(String args[]) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
+-.sp
+-.nf
+-\f3 Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3 ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following code obtains the initial naming context\&.
+-.sp
+-.nf
+-\f3 NamingContext nc =\fP
+-.fi
+-.nf
+-\f3 NamingContextHelper\&.narrow(\fP
+-.fi
+-.nf
+-\f3 orb\&.resolve_initial_references("NameService"));\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3list\fR method lists the bindings in the naming context\&. In this case, up to 1000 bindings from the initial naming context will be returned in the \f3BindingListHolder\fR; any remaining bindings are returned in the \f3BindingIteratorHolder\fR\&.
+-.sp
+-.nf
+-\f3 BindingListHolder bl = new BindingListHolder();\fP
+-.fi
+-.nf
+-\f3 BindingIteratorHolder blIt= new BindingIteratorHolder();\fP
+-.fi
+-.nf
+-\f3 nc\&.list(1000, bl, blIt);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code gets the array of bindings out of the returned \f3BindingListHolder\fR\&. If there are no bindings, then the program ends\&.
+-.sp
+-.nf
+-\f3 Binding bindings[] = bl\&.value;\fP
+-.fi
+-.nf
+-\f3 if (bindings\&.length == 0) return;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The remainder of the code loops through the bindings and prints outs the names\&.
+-.sp
+-.nf
+-\f3 for (int i=0; i < bindings\&.length; i++) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 // get the object reference for each binding\fP
+-.fi
+-.nf
+-\f3 org\&.omg\&.CORBA\&.Object obj = nc\&.resolve(bindings[i]\&.binding_name);\fP
+-.fi
+-.nf
+-\f3 String objStr = orb\&.object_to_string(obj);\fP
+-.fi
+-.nf
+-\f3 int lastIx = bindings[i]\&.binding_name\&.length\-1;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 // check to see if this is a naming context\fP
+-.fi
+-.nf
+-\f3 if (bindings[i]\&.binding_type == BindingType\&.ncontext) {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Context: " +\fP
+-.fi
+-.nf
+-\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
+-.fi
+-.nf
+-\f3 } else {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Object: " +\fP
+-.fi
+-.nf
+-\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 } catch (Exception e) {\fP
+-.fi
+-.nf
+-\f3 e\&.printStackTrace(System\&.err)\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-orbd(1)
++
++.SH NAME
++tnameserv \- Interface Definition Language (IDL)\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBtnameserve\fR \fB\-ORBInitialPort\fR [ \fInameserverport\fR ]
++.fi
++.sp
++.TP
++-ORBInitialPort \fInameserverport\fR
++.br
++The initial port where the naming service listens for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references\fR methods\&.
++.SH DESCRIPTION
++Java IDL includes the Object Request Broker Daemon (ORBD)\&. ORBD is a daemon process that contains a Bootstrap Service, a Transient Naming Service, a Persistent Naming Service, and a Server Manager\&. The Java IDL tutorials all use ORBD, but you can substitute the \f3tnameserv\fR command for the \f3orbd\fR command in any of the examples that use a Transient Naming Service\&.
++.PP
++See orbd(1) or Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++.PP
++The CORBA Common Object Services (COS) Naming Service provides a tree-structure directory for object references similar to a file system that provides a directory structure for files\&. The Transient Naming Service provided with Java IDL, \f3tnameserv\fR, is a simple implementation of the COS Naming Service specification\&.
++.PP
++Object references are stored in the name space by name and each object reference-name pair is called a name binding\&. Name bindings can be organized under naming contexts\&. Naming contexts are name bindings and serve the same organizational function as a file system subdirectory\&. All bindings are stored under the initial naming context\&. The initial naming context is the only persistent binding in the name space\&. The rest of the name space is lost when the Java IDL naming service process stops and restarts\&.
++.PP
++For an applet or application to use COS naming, its ORB must know the port of a host running a naming service or have access to an initial naming context string for that naming service\&. The naming service can either be the Java IDL naming service or another COS-compliant naming service\&.
++.SS START\ THE\ NAMING\ SERVICE
++You must start the Java IDL naming service before an application or applet that uses its naming service\&. Installation of the Java IDL product creates a script (Oracle Solaris: \f3tnameserv\fR) or executable file (Windows: \f3tnameserv\&.exe\fR) that starts the Java IDL naming service\&. Start the naming service so it runs in the background\&.
++.PP
++If you do not specify otherwise, then the Java IDL naming service listens on port 900 for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references methods\fR, as follows:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort nameserverport&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the name server port, then port 900 is used by default\&. When running Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number greater than or equal to 1024\&. To specify a different port, for example, 1050, and to run the naming service in the background, from a UNIX command shell, enter:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort 1050&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++From an MS-DOS system prompt (Windows), enter:
++.sp
++.nf
++\f3start tnameserv \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Clients of the name server must be made aware of the new port number\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR property to the new port number when you create the ORB object\&.
++.SS RUN\ THE\ SERVER\ AND\ CLIENT\ ON\ DIFFERENT\ HOSTS
++In most of the Java IDL and RMI-IIOP tutorials, the naming service, server, and client are all running on the development machine\&. In real-world deployment, the client and server probably run on different host machines from the Naming Service\&.
++.PP
++For the client and server to find the Naming Service, they must be made aware of the port number and host on which the naming service is running\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR and \f3org\&.omg\&.CORBA\&.ORBInitialHost\fR properties in the client and server files to the machine name and port number on which the Naming Service is running\&. An example of this is shown in Getting Started Using RMI-IIOP at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi-iiop/rmiiiopexample\&.html
++.PP
++You could also use the command-line options \f3-ORBInitialPort nameserverport#\fR and \f3-ORBInitialHost nameserverhostname\fR to tell the client and server where to find the naming service\&. For one example of doing this using the command-line option, see Java IDL: The Hello World Example on Two Machines at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.html
++.PP
++For example, suppose the Transient Naming Service, \f3tnameserv\fR is running on port 1050 on host \f3nameserverhost\fR\&. The client is running on host \f3clienthost,\fR and the server is running on host \f3serverhost\fR\&.
++.PP
++Start \f3tnameserv\fR on the host \f3nameserverhost\fR:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Start the server on the \f3serverhost\fR:
++.sp
++.nf
++\f3java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Start the client on the \f3clienthost\fR:
++.sp
++.nf
++\f3java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS STOP\ THE\ NAMING\ SERVICE
++To stop the Java IDL naming service, use the relevant operating system command, such as \f3kill\fR for a Unix process or \f3Ctrl+C\fR for a Windows process\&. The naming service continues to wait for invocations until it is explicitly shut down\&. Note that names registered with the Java IDL naming service disappear when the service is terminated\&.
++.SH OPTIONS
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH EXAMPLES
++.SS ADD\ OBJECTS\ TO\ THE\ NAME\ SPACE
++The following example shows how to add names to the name space\&. It is a self-contained Transient Naming Service client that creates the following simple tree\&.
++.sp
++.nf
++\f3Initial Naming Context\fP
++.fi
++.nf
++\f3 plans\fP
++.fi
++.nf
++\f3 Personal\fP
++.fi
++.nf
++\f3 calendar\fP
++.fi
++.nf
++\f3 schedule\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this example, \f3plans\fR is an object reference and \f3Personal\fR is a naming context that contains two object references: \f3calendar\fR and \f3schedule\fR\&.
++.sp
++.nf
++\f3import java\&.util\&.Properties;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CORBA\&.*;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CosNaming\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class NameClient {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public static void main(String args[]) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
++.sp
++.nf
++\f3 Properties props = new Properties();\fP
++.fi
++.nf
++\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3 ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code obtains the initial naming context and assigns it to \f3ctx\fR\&. The second line copies \f3ctx\fR into a dummy object reference \f3objref\fR that is attached to various names and added into the name space\&.
++.sp
++.nf
++\f3 NamingContext ctx =\fP
++.fi
++.nf
++\f3 NamingContextHelper\&.narrow(\fP
++.fi
++.nf
++\f3 orb\&.resolve_initial_references("NameService"));\fP
++.fi
++.nf
++\f3 NamingContext objref = ctx;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code creates a name \f3plans\fR of type \f3text\fR and binds it to the dummy object reference\&. \f3plans\fR is then added under the initial naming context using the \f3rebind\fR method\&. The \f3rebind\fR method enables you to run this program over and over again without getting the exceptions from using the \f3bind\fR method\&.
++.sp
++.nf
++\f3 NameComponent nc1 = new NameComponent("plans", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name1 = {nc1};\fP
++.fi
++.nf
++\f3 ctx\&.rebind(name1, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("plans rebind successful!");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code creates a naming context called \f3Personal\fR of type \f3directory\fR\&. The resulting object reference, \f3ctx2\fR, is bound to the \f3name\fR and added under the initial naming context\&.
++.sp
++.nf
++\f3 NameComponent nc2 = new NameComponent("Personal", "directory");\fP
++.fi
++.nf
++\f3 NameComponent[] name2 = {nc2};\fP
++.fi
++.nf
++\f3 NamingContext ctx2 = ctx\&.bind_new_context(name2);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("new naming context added\&.\&.");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The remainder of the code binds the dummy object reference using the names \f3schedule\fR and \f3calendar\fR under the \f3Personal\fR naming context (\f3ctx2\fR)\&.
++.sp
++.nf
++\f3 NameComponent nc3 = new NameComponent("schedule", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name3 = {nc3};\fP
++.fi
++.nf
++\f3 ctx2\&.rebind(name3, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("schedule rebind successful!");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 NameComponent nc4 = new NameComponent("calender", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name4 = {nc4};\fP
++.fi
++.nf
++\f3 ctx2\&.rebind(name4, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("calender rebind successful!");\fP
++.fi
++.nf
++\f3 } catch (Exception e) {\fP
++.fi
++.nf
++\f3 e\&.printStackTrace(System\&.err);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS BROWSING\ THE\ NAME\ SPACE
++The following sample program shoes how to browse the name space\&.
++.sp
++.nf
++\f3import java\&.util\&.Properties;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CORBA\&.*;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CosNaming\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class NameClientList {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public static void main(String args[]) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
++.sp
++.nf
++\f3 Properties props = new Properties();\fP
++.fi
++.nf
++\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3 ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following code obtains the initial naming context\&.
++.sp
++.nf
++\f3 NamingContext nc =\fP
++.fi
++.nf
++\f3 NamingContextHelper\&.narrow(\fP
++.fi
++.nf
++\f3 orb\&.resolve_initial_references("NameService"));\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3list\fR method lists the bindings in the naming context\&. In this case, up to 1000 bindings from the initial naming context will be returned in the \f3BindingListHolder\fR; any remaining bindings are returned in the \f3BindingIteratorHolder\fR\&.
++.sp
++.nf
++\f3 BindingListHolder bl = new BindingListHolder();\fP
++.fi
++.nf
++\f3 BindingIteratorHolder blIt= new BindingIteratorHolder();\fP
++.fi
++.nf
++\f3 nc\&.list(1000, bl, blIt);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code gets the array of bindings out of the returned \f3BindingListHolder\fR\&. If there are no bindings, then the program ends\&.
++.sp
++.nf
++\f3 Binding bindings[] = bl\&.value;\fP
++.fi
++.nf
++\f3 if (bindings\&.length == 0) return;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The remainder of the code loops through the bindings and prints outs the names\&.
++.sp
++.nf
++\f3 for (int i=0; i < bindings\&.length; i++) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 // get the object reference for each binding\fP
++.fi
++.nf
++\f3 org\&.omg\&.CORBA\&.Object obj = nc\&.resolve(bindings[i]\&.binding_name);\fP
++.fi
++.nf
++\f3 String objStr = orb\&.object_to_string(obj);\fP
++.fi
++.nf
++\f3 int lastIx = bindings[i]\&.binding_name\&.length\-1;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 // check to see if this is a naming context\fP
++.fi
++.nf
++\f3 if (bindings[i]\&.binding_type == BindingType\&.ncontext) {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Context: " +\fP
++.fi
++.nf
++\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
++.fi
++.nf
++\f3 } else {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Object: " +\fP
++.fi
++.nf
++\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 } catch (Exception e) {\fP
++.fi
++.nf
++\f3 e\&.printStackTrace(System\&.err)\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++orbd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/unpack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/unpack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Deployment Tools
+-.\" Title: unpack200.1
+-.\"
+-.if n .pl 99999
+-.TH unpack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Deployment Tools
++.\" Title: unpack200.1
++.\"
++.if n .pl 99999
++.TH unpack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-unpack200 \- Transforms a packed file produced by pack200(1) into a JAR file for web deployment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBunpack200\fR [ \fIoptions\fR ] input\-file \fIJAR\-file\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIinput-file\fR
+-Name of the input file, which can be a pack200 gzip file or a pack200 file\&. The input can also be JAR file produced by \f3pack200\fR(1) with an effort of \f30\fR, in which case the contents of the input file are copied to the output JAR file with the Pack200 marker\&.
+-.TP
+-\fIJAR-file\fR
+-Name of the output JAR file\&.
+-.SH DESCRIPTION
+-The \f3unpack200\fR command is a native implementation that transforms a packed file produced by \f3pack200\fR\f3(1)\fR into a JAR file\&. A typical usage follows\&. In the following example, the \f3myarchive\&.jar\fR file is produced from \f3myarchive\&.pack\&.gz\fR with the default \f3unpack200\fR command settings\&.
+-.sp
+-.nf
+-\f3unpack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--Hvalue --deflate-hint=\fIvalue\fR
+-.br
+-Sets the deflation to be \f3true\fR, \f3false\fR, or \f3keep\fR on all entries within a JAR file\&. The default mode is \f3keep\fR\&. If the value is \f3true\fR or \f3false\fR, then the \f3--deflate=hint\fR option overrides the default behavior and sets the deflation mode on all entries within the output JAR file\&.
+-.TP
+--r --remove-pack-file
+-.br
+-Removes the input pack file\&.
+-.TP
+--v --verbose
+-.br
+-Displays minimal messages\&. Multiple specifications of this option displays more verbose messages\&.
+-.TP
+--q --quiet
+-.br
+-Specifies quiet operation with no messages\&.
+-.TP
+--lfilename --log-file=\fIfilename\fR
+-.br
+-Specifies a log file where output messages are logged\&.
+-.TP
+--? -h --help
+-.br
+-Prints help information about the \f3unpack200\fR command\&.
+-.TP
+--V --version
+-.br
+-Prints version information about the \f3unpack200\fR command\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes option to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH NOTES
+-This command should not be confused with the \f3unpack\fR command\&. They are distinctly separate products\&.
+-.PP
+-The Java SE API Specification provided with the JDK is the superseding authority in case of discrepancies\&.
+-.SH EXIT\ STATUS
+-The following exit values are returned: 0 for successful completion, and a value that is greater than 0 when an error occurred\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pack200(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
+-.TP 0.2i
+-\(bu
+-Pack200 and Compression at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment-guide/pack200\&.html
+-.TP 0.2i
+-\(bu
+-The Java SE Technical Documentation page at http://docs\&.oracle\&.com/javase/
++
++.SH NAME
++unpack200 \- Transforms a packed file produced by pack200(1) into a JAR file for web deployment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBunpack200\fR [ \fIoptions\fR ] input\-file \fIJAR\-file\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIinput-file\fR
++Name of the input file, which can be a pack200 gzip file or a pack200 file\&. The input can also be JAR file produced by \f3pack200\fR(1) with an effort of \f30\fR, in which case the contents of the input file are copied to the output JAR file with the Pack200 marker\&.
++.TP
++\fIJAR-file\fR
++Name of the output JAR file\&.
++.SH DESCRIPTION
++The \f3unpack200\fR command is a native implementation that transforms a packed file produced by \f3pack200\fR\f3(1)\fR into a JAR file\&. A typical usage follows\&. In the following example, the \f3myarchive\&.jar\fR file is produced from \f3myarchive\&.pack\&.gz\fR with the default \f3unpack200\fR command settings\&.
++.sp
++.nf
++\f3unpack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-Hvalue --deflate-hint=\fIvalue\fR
++.br
++Sets the deflation to be \f3true\fR, \f3false\fR, or \f3keep\fR on all entries within a JAR file\&. The default mode is \f3keep\fR\&. If the value is \f3true\fR or \f3false\fR, then the \f3--deflate=hint\fR option overrides the default behavior and sets the deflation mode on all entries within the output JAR file\&.
++.TP
++-r --remove-pack-file
++.br
++Removes the input pack file\&.
++.TP
++-v --verbose
++.br
++Displays minimal messages\&. Multiple specifications of this option displays more verbose messages\&.
++.TP
++-q --quiet
++.br
++Specifies quiet operation with no messages\&.
++.TP
++-lfilename --log-file=\fIfilename\fR
++.br
++Specifies a log file where output messages are logged\&.
++.TP
++-? -h --help
++.br
++Prints help information about the \f3unpack200\fR command\&.
++.TP
++-V --version
++.br
++Prints version information about the \f3unpack200\fR command\&.
++.TP
++-J\fIoption\fR
++.br
++Passes option to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH NOTES
++This command should not be confused with the \f3unpack\fR command\&. They are distinctly separate products\&.
++.PP
++The Java SE API Specification provided with the JDK is the superseding authority in case of discrepancies\&.
++.SH EXIT\ STATUS
++The following exit values are returned: 0 for successful completion, and a value that is greater than 0 when an error occurred\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pack200(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
++.TP 0.2i
++\(bu
++Pack200 and Compression at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment-guide/pack200\&.html
++.TP 0.2i
++\(bu
++The Java SE Technical Documentation page at http://docs\&.oracle\&.com/javase/
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/wsgen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/wsgen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: wsgen.1
+-.\"
+-.if n .pl 99999
+-.TH wsgen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: wsgen.1
++.\"
++.if n .pl 99999
++.TH wsgen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,128 +47,128 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-wsgen \- Reads a web service endpoint implementation (SEI) class and generates all of the required artifacts for web service deployment, and invocation\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBwsgen\fR [ \fIoptions\fR ] \fISEI\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fISEI\fR
+-The web service endpoint implementation class (SEI) to be read\&.
+-.SH DESCRIPTION
+-The \f3wsgen\fR command generates JAX-WS portable artifacts used in JAX-WS web services\&. The tool reads a web service endpoint class and generates all the required artifacts for web service deployment and invocation\&. JAXWS 2\&.1\&.1 RI also provides a \f3wsgen\fR Ant task, see the \fITools\fR tab of the JAX-WS (wsgen) page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
+-.PP
+-To start the \f3wsgen\fR command, do the following:
+-.sp
+-.nf
+-\f3export JAXWS_HOME=/pathto/jaxws\-ri\fP
+-.fi
+-.nf
+-\f3$JAXWS_HOME/bin/wsgen\&.sh \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--classpath \fIpath\fR
+-.br
+-The location of the input class files\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-The location of the input class files\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-The location for where to place generated output files\&.
+-.TP
+--extension
+-.br
+-Allow vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
+-.TP
+--help
+-.br
+-Displays a help message about the \f3wsgen\fR command\&.
+-.TP
+--keep
+-.br
+-Keeps the generated files\&.
+-.TP
+--r \fIdirectory\fR
+-.br
+-Uses this option with the \f3-wsdl\fR option to specify where to place generated resource files such as WSDLs\&.
+-.TP
+--s \fIdirectory\fR
+-.br
+-The location for where to place generated source files\&.
+-.TP
+--verbose
+-.br
+-Displays compiler messages\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--wsdl [ :protocol ] \fI\fR
+-.br
+-An optional command that generates a WSDL file to review before endpoint deployment\&. The WSDL files contains a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns\&.
+-
+-By default the \f3wsgen\fR command does not generate a WSDL file\&. The \f3protocol\fR value is optional and is used to specify what protocol should be used for the WSDL binding (\f3wsdl:binding\fR)\&. Valid protocols are \f3soap1\&.1\fR and \f3Xsoap1\&.2\fR\&. The default is \f3soap1\&.1\fR\&. The \f3Xsoap1\&.2\fR protocol is not standard and can only be used with the \f3-extension\fR option\&.
+-.TP
+--servicename \fIname\fR
+-.br
+-Used only with the \f3-wsdl\fR option to specify a particular WSDL service (\f3wsdl:service\fR) name to be generated in the WSDL, for example: \f3-servicename "{http://mynamespace/}MyService"\fR\&.
+-.TP
+--portname \fIname\fR
+-.br
+-Used only with the \f3-wsdl\fR option to specify a particular WSDL port (\f3wsdl:port\fR) name to be generated in the WSDL, for example: \f3-portname "{http://mynamespace/}MyPort"\fR\&.
+-.SH EXAMPLES
+-The following example generates the wrapper classes for \f3StockService\fR with \f3@WebService\fR annotations inside stock directory\&.
+-.sp
+-.nf
+-\f3wsgen \-d stock \-cp myclasspath stock\&.StockService\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example generates a SOAP 1\&.1 WSDL and schema for the \f3stock\&.StockService\fR class with \f3@WebService\fR annotations\&.
+-.sp
+-.nf
+-\f3wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example generates a SOAP 1\&.2 WSDL\&.
+-.sp
+-.nf
+-\f3wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fINote:\fR You do not have to generate WSDL at development time because the JAXWS run time environment generates a WSDL for you when you deploy your service\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-wsimport(1)
+-.TP 0.2i
+-\(bu
+-\fIThe Tools\fR tab of the JAX-WS (wsgen) page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
++
++.SH NAME
++wsgen \- Reads a web service endpoint implementation (SEI) class and generates all of the required artifacts for web service deployment, and invocation\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBwsgen\fR [ \fIoptions\fR ] \fISEI\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fISEI\fR
++The web service endpoint implementation class (SEI) to be read\&.
++.SH DESCRIPTION
++The \f3wsgen\fR command generates JAX-WS portable artifacts used in JAX-WS web services\&. The tool reads a web service endpoint class and generates all the required artifacts for web service deployment and invocation\&. JAXWS 2\&.1\&.1 RI also provides a \f3wsgen\fR Ant task, see the \fITools\fR tab of the JAX-WS (wsgen) page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
++.PP
++To start the \f3wsgen\fR command, do the following:
++.sp
++.nf
++\f3export JAXWS_HOME=/pathto/jaxws\-ri\fP
++.fi
++.nf
++\f3$JAXWS_HOME/bin/wsgen\&.sh \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-classpath \fIpath\fR
++.br
++The location of the input class files\&.
++.TP
++-cp \fIpath\fR
++.br
++The location of the input class files\&.
++.TP
++-d \fIdirectory\fR
++.br
++The location for where to place generated output files\&.
++.TP
++-extension
++.br
++Allow vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
++.TP
++-help
++.br
++Displays a help message about the \f3wsgen\fR command\&.
++.TP
++-keep
++.br
++Keeps the generated files\&.
++.TP
++-r \fIdirectory\fR
++.br
++Uses this option with the \f3-wsdl\fR option to specify where to place generated resource files such as WSDLs\&.
++.TP
++-s \fIdirectory\fR
++.br
++The location for where to place generated source files\&.
++.TP
++-verbose
++.br
++Displays compiler messages\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-wsdl [ :protocol ] \fI\fR
++.br
++An optional command that generates a WSDL file to review before endpoint deployment\&. The WSDL files contains a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns\&.
++
++By default the \f3wsgen\fR command does not generate a WSDL file\&. The \f3protocol\fR value is optional and is used to specify what protocol should be used for the WSDL binding (\f3wsdl:binding\fR)\&. Valid protocols are \f3soap1\&.1\fR and \f3Xsoap1\&.2\fR\&. The default is \f3soap1\&.1\fR\&. The \f3Xsoap1\&.2\fR protocol is not standard and can only be used with the \f3-extension\fR option\&.
++.TP
++-servicename \fIname\fR
++.br
++Used only with the \f3-wsdl\fR option to specify a particular WSDL service (\f3wsdl:service\fR) name to be generated in the WSDL, for example: \f3-servicename "{http://mynamespace/}MyService"\fR\&.
++.TP
++-portname \fIname\fR
++.br
++Used only with the \f3-wsdl\fR option to specify a particular WSDL port (\f3wsdl:port\fR) name to be generated in the WSDL, for example: \f3-portname "{http://mynamespace/}MyPort"\fR\&.
++.SH EXAMPLES
++The following example generates the wrapper classes for \f3StockService\fR with \f3@WebService\fR annotations inside stock directory\&.
++.sp
++.nf
++\f3wsgen \-d stock \-cp myclasspath stock\&.StockService\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example generates a SOAP 1\&.1 WSDL and schema for the \f3stock\&.StockService\fR class with \f3@WebService\fR annotations\&.
++.sp
++.nf
++\f3wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example generates a SOAP 1\&.2 WSDL\&.
++.sp
++.nf
++\f3wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fINote:\fR You do not have to generate WSDL at development time because the JAXWS run time environment generates a WSDL for you when you deploy your service\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++wsimport(1)
++.TP 0.2i
++\(bu
++\fIThe Tools\fR tab of the JAX-WS (wsgen) page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/wsimport.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/wsimport.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: wsimport.1
+-.\"
+-.if n .pl 99999
+-.TH wsimport 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: wsimport.1
++.\"
++.if n .pl 99999
++.TH wsimport 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,169 +47,169 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-wsimport \- Generates JAX-WS portable artifacts that can be packaged in a web application archive (WAR) file and provides an Ant task\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBwsimport\fR [ \fIoptions\fR ] \fIwsdl\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIwsdl\fR
+-The file that contains the machine-readable description of how the web service can be called, what parameters it expects, and what data structures it returns\&.
+-.SH DESCRIPTION
+-The \f3wsimport\fR command generates the following JAX-WS portable artifacts\&. These artifacts can be packaged in a WAR file with the WSDL and schema documents and the endpoint implementation to be deployed\&. The \f3wsimport\fR command also provides a \f3wsimport\fR Ant task, see the Tools tab of the Wsimport Ant Task page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP 0.2i
+-\(bu
+-Service Endpoint Interface (SEI)
+-.TP 0.2i
+-\(bu
+-Service
+-.TP 0.2i
+-\(bu
+-Exception class is mapped from \f3wsdl:fault\fR (if any)
+-.TP 0.2i
+-\(bu
+-Async Response Bean is derived from response \f3wsdl:message\fR (if any)
+-.TP 0.2i
+-\(bu
+-JAXB generated value types (mapped java classes from schema types)
+-.PP
+-To start the \f3wsgen\fR command, do the following:
+-.PP
+-\fIOracle Solaris/Linux\fR:
+-.sp
+-.nf
+-\f3/bin/wsimport\&.sh \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fIWindows\fR:
+-.sp
+-.nf
+-\f3\ebin\ewsimport\&.bat \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies where to place generated output files\&.
+-.TP
+--b \fIpath\fR
+-.br
+-Specifies external JAX-WS or JAXB binding files\&. Multiple JAX-WS and JAXB binding files can be specified with the \f3-b\fR option\&. You can use these files to customize package names, bean names, and so on\&. For more information about JAX-WS and JAXB binding files, see the \fIUsers Guide\fR tab of WSDL Customization at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP
+--B \fIjaxbOption\fR
+-.br
+-Passes the \f3jaxbOption\fR option to the JAXB schema compiler\&.
+-.TP
+--catalog
+-.br
+-Specifies a catalog file to resolve external entity references\&. The \f3-catalog\fR option supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See the \fIUsers Guide\fR tab of the Catalog Support page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
+-.TP
+--extension
+-.br
+-Allows vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
+-.TP
+--help
+-.br
+-Displays a help message for the \f3wsimport\fR command\&.
+-.TP
+--httpproxy: \fIhost\fR:\fIport\fR
+-.br
+-Specifies an HTTP proxy server\&. The default is 8080\&.
+-.TP
+--keep
+-.br
+-Keeps generated files\&.
+-.TP
+--p \fIname\fR
+-.br
+-Specifies a target package \fIname\fR to override the WSDL and schema binding customizations, and the default algorithm defined in the specification\&.
+-.TP
+--s \fIdirectory\fR
+-.br
+-Specifies where to place generated source files\&.
+-.TP
+--verbose
+-.br
+-Displays compiler messages\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--wsdllocation \fIlocation\fR
+-.br
+-Specifies the \f3@WebServiceClient\&.wsdlLocation\fR value\&.
+-.TP
+--target
+-.br
+-Generates code according to the specified JAX-WS specification version\&. Version 2\&.0 generates compliant code for the JAX-WS 2\&.0 specification\&.
+-.TP
+--quiet
+-.br
+-Suppresses the \f3wsimport\fR command output\&.
+-.PP
+-Multiple \f3JAX-WS\fR and \f3JAXB\fR binding files can be specified using the \f3-b\fR option, and they can be used to customize various things such as package names and bean names\&. More information about \f3JAX-WS\fR and \f3JAXB\fR binding files can be found in the customization documentation at https://jax-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.html
+-.SH NONSTANDARD\ OPTIONS
+-.TP
+--XadditionalHeaders
+-.br
+-Maps headers not bound to a request or response message to Java method parameters\&.
+-.TP
+--Xauthfile \fIfile\fR
+-.br
+-The WSDL URI that specifies the file that contains authorization information\&. This URI is in the following format:
+-
+-http://\fIuser-name\fR:\f3password\fR@\fIhost-name\fR/\fIweb-service-name\fR>?wsdl\&.
+-.TP
+--Xdebug
+-.br
+-Prints debugging information\&.
+-.TP
+--Xno-addressing-databinding
+-.br
+-Enables binding of W3C EndpointReferenceType to Java\&.
+-.TP
+--Xnocompile
+-.br
+-Does not compile the generated Java files\&.
+-.SH EXAMPLE
+-The following example generates the Java artifacts and compiles the artifacts by importing \f3http://stockquote\&.example\&.com/quote?wsdl\fR
+-.sp
+-.nf
+-\f3wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-wsgen(1)
+-.TP 0.2i
+-\(bu
+-The Tools tab of Wsimport Ant Task page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP 0.2i
+-\(bu
+-The \fIUsers Guide\fR tab of Catalog Support page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
+-.TP 0.2i
+-\(bu
+-The \fIUsers Guide\fR tab of WSDL Customization page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++
++.SH NAME
++wsimport \- Generates JAX-WS portable artifacts that can be packaged in a web application archive (WAR) file and provides an Ant task\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBwsimport\fR [ \fIoptions\fR ] \fIwsdl\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIwsdl\fR
++The file that contains the machine-readable description of how the web service can be called, what parameters it expects, and what data structures it returns\&.
++.SH DESCRIPTION
++The \f3wsimport\fR command generates the following JAX-WS portable artifacts\&. These artifacts can be packaged in a WAR file with the WSDL and schema documents and the endpoint implementation to be deployed\&. The \f3wsimport\fR command also provides a \f3wsimport\fR Ant task, see the Tools tab of the Wsimport Ant Task page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP 0.2i
++\(bu
++Service Endpoint Interface (SEI)
++.TP 0.2i
++\(bu
++Service
++.TP 0.2i
++\(bu
++Exception class is mapped from \f3wsdl:fault\fR (if any)
++.TP 0.2i
++\(bu
++Async Response Bean is derived from response \f3wsdl:message\fR (if any)
++.TP 0.2i
++\(bu
++JAXB generated value types (mapped java classes from schema types)
++.PP
++To start the \f3wsgen\fR command, do the following:
++.PP
++\fIOracle Solaris/Linux\fR:
++.sp
++.nf
++\f3/bin/wsimport\&.sh \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fIWindows\fR:
++.sp
++.nf
++\f3\ebin\ewsimport\&.bat \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-d \fIdirectory\fR
++.br
++Specifies where to place generated output files\&.
++.TP
++-b \fIpath\fR
++.br
++Specifies external JAX-WS or JAXB binding files\&. Multiple JAX-WS and JAXB binding files can be specified with the \f3-b\fR option\&. You can use these files to customize package names, bean names, and so on\&. For more information about JAX-WS and JAXB binding files, see the \fIUsers Guide\fR tab of WSDL Customization at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP
++-B \fIjaxbOption\fR
++.br
++Passes the \f3jaxbOption\fR option to the JAXB schema compiler\&.
++.TP
++-catalog
++.br
++Specifies a catalog file to resolve external entity references\&. The \f3-catalog\fR option supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See the \fIUsers Guide\fR tab of the Catalog Support page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
++.TP
++-extension
++.br
++Allows vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
++.TP
++-help
++.br
++Displays a help message for the \f3wsimport\fR command\&.
++.TP
++-httpproxy: \fIhost\fR:\fIport\fR
++.br
++Specifies an HTTP proxy server\&. The default is 8080\&.
++.TP
++-keep
++.br
++Keeps generated files\&.
++.TP
++-p \fIname\fR
++.br
++Specifies a target package \fIname\fR to override the WSDL and schema binding customizations, and the default algorithm defined in the specification\&.
++.TP
++-s \fIdirectory\fR
++.br
++Specifies where to place generated source files\&.
++.TP
++-verbose
++.br
++Displays compiler messages\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-wsdllocation \fIlocation\fR
++.br
++Specifies the \f3@WebServiceClient\&.wsdlLocation\fR value\&.
++.TP
++-target
++.br
++Generates code according to the specified JAX-WS specification version\&. Version 2\&.0 generates compliant code for the JAX-WS 2\&.0 specification\&.
++.TP
++-quiet
++.br
++Suppresses the \f3wsimport\fR command output\&.
++.PP
++Multiple \f3JAX-WS\fR and \f3JAXB\fR binding files can be specified using the \f3-b\fR option, and they can be used to customize various things such as package names and bean names\&. More information about \f3JAX-WS\fR and \f3JAXB\fR binding files can be found in the customization documentation at https://jax-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.html
++.SH NONSTANDARD\ OPTIONS
++.TP
++-XadditionalHeaders
++.br
++Maps headers not bound to a request or response message to Java method parameters\&.
++.TP
++-Xauthfile \fIfile\fR
++.br
++The WSDL URI that specifies the file that contains authorization information\&. This URI is in the following format:
++
++http://\fIuser-name\fR:\f3password\fR@\fIhost-name\fR/\fIweb-service-name\fR>?wsdl\&.
++.TP
++-Xdebug
++.br
++Prints debugging information\&.
++.TP
++-Xno-addressing-databinding
++.br
++Enables binding of W3C EndpointReferenceType to Java\&.
++.TP
++-Xnocompile
++.br
++Does not compile the generated Java files\&.
++.SH EXAMPLE
++The following example generates the Java artifacts and compiles the artifacts by importing \f3http://stockquote\&.example\&.com/quote?wsdl\fR
++.sp
++.nf
++\f3wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++wsgen(1)
++.TP 0.2i
++\(bu
++The Tools tab of Wsimport Ant Task page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP 0.2i
++\(bu
++The \fIUsers Guide\fR tab of Catalog Support page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
++.TP 0.2i
++\(bu
++The \fIUsers Guide\fR tab of WSDL Customization page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/bsd/doc/man/xjc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/bsd/doc/man/xjc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: xjc.1
+-.\"
+-.if n .pl 99999
+-.TH xjc 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: xjc.1
++.\"
++.if n .pl 99999
++.TH xjc 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,185 +47,185 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-xjc \- Compiles an XML schema file into fully annotated Java classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBxjc\fR [ \fIoptions\fR ] \fBschema\fR \fIfile/URL/dir/jar\fR \&.\&.\&. [\fB\-b\fR \fIbindinfo\fR ] \&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-schema \fIfile/URL/dir/jar \&.\&.\&.\fR
+-The location of the XML schema file\&. If \f3dir\fR is specified, then all schema files in it are compiled\&. If \f3jar\fR is specified, then the \f3/META-INF/sun-jaxb\&.episode\fR binding file is compiled\&.
+-.TP
+--b \fIbindinfo\fR
+-.br
+-The location of the bindings files\&.
+-.SH DESCRIPTION
+-Start the binding compiler with the appropriate \f3xjc\fR shell script in the bin directory for your platform\&. There is also an Ant task to run the binding complier\&. See Using the XJC with Ant at http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html
+-.SH OPTIONS
+-.TP 0.2i
+-\(bu
+-See also Nonstandard Options
+-.TP 0.2i
+-\(bu
+-See also Deprecated and Removed Options
+-.TP
+--nv
+-.br
+-By default, the XJC binding compiler performs strict validation of the source schema before processing it\&. Use this option to disable strict schema validation\&. This does not mean that the binding compiler will not perform any validation, but means that it will perform a less-strict validation\&.
+-.TP
+--extension
+-.br
+-By default, the XJC binding compiler strictly enforces the rules outlined in the Compatibility chapter of the JAXB Specification\&. Appendix E\&.2 defines a set of W3C XML Schema features that are not completely supported by JAXB v1\&.0\&. In some cases, you may be allowed to use them in the \f3-extension\fR mode enabled by this switch\&. In the default (strict) mode, you are also limited to using only the binding customization defined in the specification\&. By using the \f3-extension\fR switch, you will be allowed to use the JAXB Vendor Extensions\&.
+-.TP
+--b \fIfile\fR
+-.br
+-Specifies one or more external binding files to process\&. Each binding file must have its own \f3-b\fR switch\&. The syntax of the external binding files is flexible\&. You can have a single binding file that contains customization for multiple schemas or you can break the customization into multiple bindings files: \f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings123\&.xjb\fR\f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings1\&.xjb -b bindings2\&.xjb -b bindings3\&.xjb\fR\&. In addition, the ordering of the schema files and binding files on the command line does not matter\&.
+-.TP
+--d \fIdir\fR
+-.br
+-By default, the XJC binding compiler generates the Java content classes in the current directory\&. Use this option to specify an alternate output directory\&. The output directory must already exist\&. The XJC binding compiler does not create it for you\&.
+-.TP
+--p \fIpkg\fR
+-.br
+-When you specify a target package with this command-line option, it overrides any binding customization for the package name and the default package name algorithm defined in the specification\&.
+-.TP
+--httpproxy \fIproxy\fR
+-.br
+-Specifies the HTTP or HTTPS proxy in the format \fI[user[:password]@]proxyHost[:proxyPort]\fR\&. The old \f3-host\fR and \f3-port\fR options are still supported by the RI for backward compatibility, but they were deprecated\&. The password specified with this option is an argument that is visible to other users who use the top command\&. For greater security, use the \f3-httpproxyfile\fR option\&.
+-.TP
+--httpproxyfile file
+-.br
+-Specifies the HTTP or HTTPS proxy with a file\&. The same format as the \f3-httpproxy\fR option, but the password specified in the file is not visible to other users\&.
+-.TP
+--classpath arg
+-.br
+-Specifies where to find client application class files used by the \fIjxb:javaType\fR and xjc:\fIsuperClass\fR customization\&.
+-.TP
+--catalog file
+-.br
+-Specifies catalog files to resolve external entity references\&. Supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See XML Entity and URI Resolvers at http://xerces\&.apache\&.org/xml-commons/components/resolver/resolver-article\&.html
+-.TP
+--readOnly
+-.br
+-By default, the XJC binding compiler does not write-protect the Java source files it generates\&. Use this option to force the XJC binding compiler to mark the generated Java sources as read-only\&.
+-.TP
+--npa
+-.br
+-Suppresses the generation of package level annotations into \f3**/package-info\&.java\fR\&. Using this switch causes the generated code to internalize those annotations into the other generated classes\&.
+-.TP
+--no-header
+-.br
+-Suppresses the generation of a file header comment that includes some note and time stamp\&. Using this makes the generated code more compatible with the \f3diff\fR command\&.
+-.TP
+--target 2\&.0
+-.br
+-Avoids generating code that relies on any JAXB 2\&.1 features\&. This will allow the generated code to run with JAXB 2\&.0 runtime environment (such as Java SE 6)\&.
+-.TP
+--xmlschema
+-.br
+-Treats input schemas as W3C XML Schema (default)\&. If you do not specify this switch, then your input schemas are treated as though they are W3C XML Schemas\&.
+-.TP
+--relaxing
+-.br
+-Treats input schemas as RELAX NG (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--relaxing-compact
+-.br
+-Treat input schemas as RELAX NG compact syntax (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--dtd
+-.br
+-Treats input schemas as XML DTD (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--wsdl
+-.br
+-Treats input as WSDL and compiles schemas inside it (experimental and unsupported)\&.
+-.TP
+--quiet
+-.br
+-Suppress compiler output, such as progress information and warnings\&.
+-.TP
+--verbose
+-.br
+-Be extra verbose, such as printing informational messages or displaying stack traces upon some errors\&.
+-.TP
+--help
+-.br
+-Displays a brief summary of the compiler switches\&.
+-.TP
+--version
+-.br
+-Displays the compiler version information\&.
+-.TP
+-\fIschema file/URL/dir\fR
+-Specifies one or more schema files to compile\&. If you specify a directory, then the \f3xjc\fR command scans it for all schema files and compiles them\&.
+-.SS NONSTANDARD\ OPTIONS
+-.TP
+--XLocator
+-.br
+-Causes the generated code to expose SAX Locator information about the source XML in the Java bean instances after unmarshalling\&.
+-.TP
+--Xsync-methods
+-.br
+-Causes all of the generated method signatures to include the \f3synchronized\fR keyword\&.
+-.TP
+--mark-generated
+-.br
+-Marks the generated code with the annotation \f3@javax\&.annotation\&.Generated\fR\&.
+-.TP
+--episode file
+-.br
+-Generates the specified episode file for separate compilation\&.
+-.SS DEPRECATED\ AND\ REMOVED\ OPTIONS
+-.TP
+--host & -port
+-.br
+-These options are replaced with the \f3-httpproxy\fR option\&. For backward compatibility, these options are supported, but will not be documented and might be removed from future releases\&.
+-.TP
+--use-runtime
+-.br
+-Because the JAXB 2\&.0 specification has defined a portable runtime environment, it is no longer necessary for the JAXB RI to generate \f3**/impl/runtime\fRpackages\&. Therefore, this switch is obsolete and was removed\&.
+-.TP
+--source
+-.br
+-The \f3-source\fR compatibility switch was introduced in the first JAXB 2\&.0 Early Access release\&. This switch is removed from future releases of JAXB 2\&.0\&. If you need to generate 1\&.0\&.x code, then use an installation of the 1\&.0\&.x code base\&.
+-.SH COMPILER\ RESTRICTIONS
+-In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches\&. Keep the following list of restrictions in mind when running the \f3xjc\fR command\&. Most of these issues only apply when you compile multiple schemas with multiple invocations of the \f3xjc\fR command\&.
+-.PP
+-To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
+-.TP 0.4i
+-1\&.
+-The \f3-p\fR option has the highest precedence\&.
+-.TP 0.4i
+-2\&.
+-\fIjaxb:package\fR customization\&.
+-.TP 0.4i
+-3\&.
+-If \f3targetNamespace\fR is declared, then apply the \f3t\fR\f3argetNamespace\fR to the Java package name algorithm defined in the specification\&.
+-.TP 0.4i
+-4\&.
+-If no \f3targetNamespace\fR is declared, then use a hard coded package named \f3generated\fR\&.
+-.PP
+-You cannot have more than one \fIjaxb:schemaBindings\fR per name space, so it is impossible to have two schemas in the same target name space compiled into different Java packages\&.
+-.PP
+-All schemas being compiled into the same Java package must be submitted to the XJC binding compiler at the same time\&. They cannot be compiled independently and work as expected\&.
+-.PP
+-Element substitution groups that are spread across multiple schema files must be compiled at the same time\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Binding Compiler (xjc) at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html
+-.TP 0.2i
+-\(bu
+-Java Architecture for XML Binding (JAXB) at http://www\&.oracle\&.com/technetwork/articles/javase/index-140168\&.html
++
++.SH NAME
++xjc \- Compiles an XML schema file into fully annotated Java classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBxjc\fR [ \fIoptions\fR ] \fBschema\fR \fIfile/URL/dir/jar\fR \&.\&.\&. [\fB\-b\fR \fIbindinfo\fR ] \&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++schema \fIfile/URL/dir/jar \&.\&.\&.\fR
++The location of the XML schema file\&. If \f3dir\fR is specified, then all schema files in it are compiled\&. If \f3jar\fR is specified, then the \f3/META-INF/sun-jaxb\&.episode\fR binding file is compiled\&.
++.TP
++-b \fIbindinfo\fR
++.br
++The location of the bindings files\&.
++.SH DESCRIPTION
++Start the binding compiler with the appropriate \f3xjc\fR shell script in the bin directory for your platform\&. There is also an Ant task to run the binding complier\&. See Using the XJC with Ant at http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html
++.SH OPTIONS
++.TP 0.2i
++\(bu
++See also Nonstandard Options
++.TP 0.2i
++\(bu
++See also Deprecated and Removed Options
++.TP
++-nv
++.br
++By default, the XJC binding compiler performs strict validation of the source schema before processing it\&. Use this option to disable strict schema validation\&. This does not mean that the binding compiler will not perform any validation, but means that it will perform a less-strict validation\&.
++.TP
++-extension
++.br
++By default, the XJC binding compiler strictly enforces the rules outlined in the Compatibility chapter of the JAXB Specification\&. Appendix E\&.2 defines a set of W3C XML Schema features that are not completely supported by JAXB v1\&.0\&. In some cases, you may be allowed to use them in the \f3-extension\fR mode enabled by this switch\&. In the default (strict) mode, you are also limited to using only the binding customization defined in the specification\&. By using the \f3-extension\fR switch, you will be allowed to use the JAXB Vendor Extensions\&.
++.TP
++-b \fIfile\fR
++.br
++Specifies one or more external binding files to process\&. Each binding file must have its own \f3-b\fR switch\&. The syntax of the external binding files is flexible\&. You can have a single binding file that contains customization for multiple schemas or you can break the customization into multiple bindings files: \f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings123\&.xjb\fR\f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings1\&.xjb -b bindings2\&.xjb -b bindings3\&.xjb\fR\&. In addition, the ordering of the schema files and binding files on the command line does not matter\&.
++.TP
++-d \fIdir\fR
++.br
++By default, the XJC binding compiler generates the Java content classes in the current directory\&. Use this option to specify an alternate output directory\&. The output directory must already exist\&. The XJC binding compiler does not create it for you\&.
++.TP
++-p \fIpkg\fR
++.br
++When you specify a target package with this command-line option, it overrides any binding customization for the package name and the default package name algorithm defined in the specification\&.
++.TP
++-httpproxy \fIproxy\fR
++.br
++Specifies the HTTP or HTTPS proxy in the format \fI[user[:password]@]proxyHost[:proxyPort]\fR\&. The old \f3-host\fR and \f3-port\fR options are still supported by the RI for backward compatibility, but they were deprecated\&. The password specified with this option is an argument that is visible to other users who use the top command\&. For greater security, use the \f3-httpproxyfile\fR option\&.
++.TP
++-httpproxyfile file
++.br
++Specifies the HTTP or HTTPS proxy with a file\&. The same format as the \f3-httpproxy\fR option, but the password specified in the file is not visible to other users\&.
++.TP
++-classpath arg
++.br
++Specifies where to find client application class files used by the \fIjxb:javaType\fR and xjc:\fIsuperClass\fR customization\&.
++.TP
++-catalog file
++.br
++Specifies catalog files to resolve external entity references\&. Supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See XML Entity and URI Resolvers at http://xerces\&.apache\&.org/xml-commons/components/resolver/resolver-article\&.html
++.TP
++-readOnly
++.br
++By default, the XJC binding compiler does not write-protect the Java source files it generates\&. Use this option to force the XJC binding compiler to mark the generated Java sources as read-only\&.
++.TP
++-npa
++.br
++Suppresses the generation of package level annotations into \f3**/package-info\&.java\fR\&. Using this switch causes the generated code to internalize those annotations into the other generated classes\&.
++.TP
++-no-header
++.br
++Suppresses the generation of a file header comment that includes some note and time stamp\&. Using this makes the generated code more compatible with the \f3diff\fR command\&.
++.TP
++-target 2\&.0
++.br
++Avoids generating code that relies on any JAXB 2\&.1 features\&. This will allow the generated code to run with JAXB 2\&.0 runtime environment (such as Java SE 6)\&.
++.TP
++-xmlschema
++.br
++Treats input schemas as W3C XML Schema (default)\&. If you do not specify this switch, then your input schemas are treated as though they are W3C XML Schemas\&.
++.TP
++-relaxing
++.br
++Treats input schemas as RELAX NG (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-relaxing-compact
++.br
++Treat input schemas as RELAX NG compact syntax (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-dtd
++.br
++Treats input schemas as XML DTD (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-wsdl
++.br
++Treats input as WSDL and compiles schemas inside it (experimental and unsupported)\&.
++.TP
++-quiet
++.br
++Suppress compiler output, such as progress information and warnings\&.
++.TP
++-verbose
++.br
++Be extra verbose, such as printing informational messages or displaying stack traces upon some errors\&.
++.TP
++-help
++.br
++Displays a brief summary of the compiler switches\&.
++.TP
++-version
++.br
++Displays the compiler version information\&.
++.TP
++\fIschema file/URL/dir\fR
++Specifies one or more schema files to compile\&. If you specify a directory, then the \f3xjc\fR command scans it for all schema files and compiles them\&.
++.SS NONSTANDARD\ OPTIONS
++.TP
++-XLocator
++.br
++Causes the generated code to expose SAX Locator information about the source XML in the Java bean instances after unmarshalling\&.
++.TP
++-Xsync-methods
++.br
++Causes all of the generated method signatures to include the \f3synchronized\fR keyword\&.
++.TP
++-mark-generated
++.br
++Marks the generated code with the annotation \f3@javax\&.annotation\&.Generated\fR\&.
++.TP
++-episode file
++.br
++Generates the specified episode file for separate compilation\&.
++.SS DEPRECATED\ AND\ REMOVED\ OPTIONS
++.TP
++-host & -port
++.br
++These options are replaced with the \f3-httpproxy\fR option\&. For backward compatibility, these options are supported, but will not be documented and might be removed from future releases\&.
++.TP
++-use-runtime
++.br
++Because the JAXB 2\&.0 specification has defined a portable runtime environment, it is no longer necessary for the JAXB RI to generate \f3**/impl/runtime\fRpackages\&. Therefore, this switch is obsolete and was removed\&.
++.TP
++-source
++.br
++The \f3-source\fR compatibility switch was introduced in the first JAXB 2\&.0 Early Access release\&. This switch is removed from future releases of JAXB 2\&.0\&. If you need to generate 1\&.0\&.x code, then use an installation of the 1\&.0\&.x code base\&.
++.SH COMPILER\ RESTRICTIONS
++In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches\&. Keep the following list of restrictions in mind when running the \f3xjc\fR command\&. Most of these issues only apply when you compile multiple schemas with multiple invocations of the \f3xjc\fR command\&.
++.PP
++To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
++.TP 0.4i
++1\&.
++The \f3-p\fR option has the highest precedence\&.
++.TP 0.4i
++2\&.
++\fIjaxb:package\fR customization\&.
++.TP 0.4i
++3\&.
++If \f3targetNamespace\fR is declared, then apply the \f3t\fR\f3argetNamespace\fR to the Java package name algorithm defined in the specification\&.
++.TP 0.4i
++4\&.
++If no \f3targetNamespace\fR is declared, then use a hard coded package named \f3generated\fR\&.
++.PP
++You cannot have more than one \fIjaxb:schemaBindings\fR per name space, so it is impossible to have two schemas in the same target name space compiled into different Java packages\&.
++.PP
++All schemas being compiled into the same Java package must be submitted to the XJC binding compiler at the same time\&. They cannot be compiled independently and work as expected\&.
++.PP
++Element substitution groups that are spread across multiple schema files must be compiled at the same time\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Binding Compiler (xjc) at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html
++.TP 0.2i
++\(bu
++Java Architecture for XML Binding (JAXB) at http://www\&.oracle\&.com/technetwork/articles/javase/index-140168\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/appletviewer.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/appletviewer.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1995, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: appletviewer.1
+-.\"
+-.if n .pl 99999
+-.TH appletviewer 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: appletviewer.1
++.\"
++.if n .pl 99999
++.TH appletviewer 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,42 +47,42 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-appletviewer \- Runs applets outside of a web browser\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBappletviewer\fR [\fIoptions\fR] \fIurl\fR\&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options separated by spaces\&. See Options\&.
+-.TP
+-\fIurl\fR
+-The location of the documents or resources to be displayed\&. You can specify multiple URLs separated by spaces\&.
+-.SH DESCRIPTION
+-The \f3appletviewer\fR command connects to the documents or resources designated by \fIurls\fR and displays each applet referenced by the documents in its own window\&. If the documents referred to by urls do not reference any applets with the \f3OBJECT\fR, \f3EMBED\fR, or \f3APPLET\fR tag, then the \f3appletviewer\fR command does nothing\&. For details about the HTML tags that the \f3appletviewer\fR command supports, see AppletViewer Tags at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.html
+-.PP
+-The \f3appletviewer\fR command requires encoded URLs according to the escaping mechanism defined in RFC2396\&. Only encoded URLs are supported\&. However, file names must be unencoded, as specified in RFC2396\&.
+-.PP
+-\fINote:\fR The \f3appletviewer\fR command is intended for development purposes only\&. For more information, see About Sample/Test Applications and Code at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.html
+-.SH OPTIONS
+-.TP
+--debug
+-.br
+-Starts the Applet Viewer in the Java debugger with the \f3jdb\fR command to debug the applets in the document\&.
+-.TP
+--encoding \fIencoding-name\fR
+-.br
+-Specifies the input HTML file encoding name\&.
+-.TP
+--J\fIjavaoption\fR
+-.br
+-Passes the string \f3javaoption\fR as a single argument to the Java interpreter, which runs the Applet Viewer\&. The argument should not contain spaces\&. Multiple argument words must all begin with the prefix \f3-J\fR\&. This is useful for adjusting the compiler\&'s execution environment or memory usage\&.
+-.PP
++
++.SH NAME
++appletviewer \- Runs applets outside of a web browser\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBappletviewer\fR [\fIoptions\fR] \fIurl\fR\&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options separated by spaces\&. See Options\&.
++.TP
++\fIurl\fR
++The location of the documents or resources to be displayed\&. You can specify multiple URLs separated by spaces\&.
++.SH DESCRIPTION
++The \f3appletviewer\fR command connects to the documents or resources designated by \fIurls\fR and displays each applet referenced by the documents in its own window\&. If the documents referred to by urls do not reference any applets with the \f3OBJECT\fR, \f3EMBED\fR, or \f3APPLET\fR tag, then the \f3appletviewer\fR command does nothing\&. For details about the HTML tags that the \f3appletviewer\fR command supports, see AppletViewer Tags at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.html
++.PP
++The \f3appletviewer\fR command requires encoded URLs according to the escaping mechanism defined in RFC2396\&. Only encoded URLs are supported\&. However, file names must be unencoded, as specified in RFC2396\&.
++.PP
++\fINote:\fR The \f3appletviewer\fR command is intended for development purposes only\&. For more information, see About Sample/Test Applications and Code at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.html
++.SH OPTIONS
++.TP
++-debug
++.br
++Starts the Applet Viewer in the Java debugger with the \f3jdb\fR command to debug the applets in the document\&.
++.TP
++-encoding \fIencoding-name\fR
++.br
++Specifies the input HTML file encoding name\&.
++.TP
++-J\fIjavaoption\fR
++.br
++Passes the string \f3javaoption\fR as a single argument to the Java interpreter, which runs the Applet Viewer\&. The argument should not contain spaces\&. Multiple argument words must all begin with the prefix \f3-J\fR\&. This is useful for adjusting the compiler\&'s execution environment or memory usage\&.
++.PP
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/extcheck.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/extcheck.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: extcheck.1
+-.\"
+-.if n .pl 99999
+-.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: extcheck.1
++.\"
++.if n .pl 99999
++.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,43 +47,43 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fItargetfile\&.jar\fR
+-The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
+-.SH DESCRIPTION
+-The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
+-.PP
+-The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
+-.PP
+-If no conflict is detected, then the return code is 0\&.
+-.PP
+-If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
+-.SH OPTIONS
+-.TP
+--verbose
+-.br
+-Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
++
++.SH NAME
++extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fItargetfile\&.jar\fR
++The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
++.SH DESCRIPTION
++The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
++.PP
++The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
++.PP
++If no conflict is detected, then the return code is 0\&.
++.PP
++If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
++.SH OPTIONS
++.TP
++-verbose
++.br
++Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/idlj.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/idlj.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: idlj.1
+-.\"
+-.if n .pl 99999
+-.TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: idlj.1
++.\"
++.if n .pl 99999
++.TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,520 +47,520 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBidlj\fR [ \fIoptions\fR ] \fIidlfile\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&. Options can appear in any order, but must precede the \f3idlfile\fR\&.
+-.TP
+-\fIidlfile\fR
+-The name of a file that contains Interface Definition Language (IDL) definitions\&.
+-.SH DESCRIPTION
+-The IDL-to-Java Compiler generates the Java bindings for a specified IDL file\&. For binding details, see Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
+-.PP
+-Some earlier releases of the IDL-to-Java compiler were named \f3idltojava\fR\&.
+-.SS EMIT\ CLIENT\ AND\ SERVER\ BINDINGS
+-The following \f3idlj\fR command generates an IDL file named \f3My\&.idl\fR with client-side bindings\&.
+-.sp
+-.nf
+-\f3idlj My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The previous syntax is equivalent to the following:
+-.sp
+-.nf
+-\f3idlj \-fclient My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The next example generates the server-side bindings, and includes the client-side bindings plus the skeleton, all of which are POA (Inheritance Model)\&.
+-.sp
+-.nf
+-\f3idlg \-fserver My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you want to generate both client and server-side bindings, then use one of the following (equivalent) commands:
+-.sp
+-.nf
+-\f3idlj \-fclient \-fserver My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There are two possible server-side models: the Portal Servant Inheritance Model and the Tie Model\&. See Tie Delegation Model\&.
+-.PP
+-\f3Portable Servant Inheritance Model\fR\&. The default server-side model is the Portable Servant Inheritance Model\&. Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3MyPOA\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3MyPOA\fR class\&. \f3MyPOA\&.java\fR is a stream-based skeleton that extends the \f3org\&.omg\&.PortableServer\&.Servant\fR class at http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.html The \f3My\fR interface implements the \f3callHandler\fR interface and the operations interface associated with the IDL interface the skeleton implements\&.The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. See Portable Object Adapter (POA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.html In the Java programming language, the \f3Servant\fR type is mapped to the Java \f3org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&.Another option for the Inheritance Model is to use the \f3-oldImplBase\fR flag to generate server-side bindings that are compatible with releases of the Java programming language before Java SE 1\&.4\&. The -\f3oldImplBase\fR flag is nonstandard, and these APIs are deprecated\&. You would use this flag only for compatibility with existing servers written in Java SE 1\&.3\&. In that case, you would need to modify an existing make file to add the \f3-oldImplBase\fR flag to the \f3idlj\fR compiler\&. Otherwise POA-based server-side mappings are generated\&. To generate server-side bindings that are backward compatible, do the following:
+-.sp
+-.nf
+-\f3idlj \-fclient \-fserver \-oldImplBase My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fall \-oldImplBase My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3_MyImplBase\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3_MyImplBase\fR class\&.
+-.PP
+-\f3Tie Delegation Model\fR\&. The other server-side model is called the Tie Model\&. This is a delegation model\&. Because it is not possible to generate ties and skeletons at the same time, they must be generated separately\&. The following commands generate the bindings for the Tie Model:
+-.sp
+-.nf
+-\f3idlj \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fallTIE My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-For the \f3My\fR interface, the second command generates \f3MyPOATie\&.java\fR\&. The constructor to the \f3MyPOATie\fR class takes a delegate\&. In this example, using the default POA model, the constructor also needs a POA\&. You must provide the implementation for the delegate, but it does not have to inherit from any other class, only the interface \f3MyOperations\fR\&. To use it with the ORB, you must wrap your implementation within the \f3MyPOATie\fR class, for example:
+-.sp
+-.nf
+-\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// Get reference to rootpoa & activate the POAManager\fP
+-.fi
+-.nf
+-\f3POA rootpoa = (POA)orb\&.resolve_initial_references("RootPOA");\fP
+-.fi
+-.nf
+-\f3rootpoa\&.the_POAManager()\&.activate();\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create servant and register it with the ORB\fP
+-.fi
+-.nf
+-\f3MyServant myDelegate = new MyServant();\fP
+-.fi
+-.nf
+-\f3myDelegate\&.setORB(orb); \fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create a tie, with servant being the delegate\&.\fP
+-.fi
+-.nf
+-\f3MyPOATie tie = new MyPOATie(myDelegate, rootpoa);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// obtain the objectRef for the tie\fP
+-.fi
+-.nf
+-\f3My ref = tie\&._this(orb);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-You might want to use the Tie model instead of the typical Inheritance model when your implementation must inherit from some other implementation\&. Java allows any number of interface inheritance, but there is only one slot for class inheritance\&. If you use the inheritance model, then that slot is used up\&. With the Tie Model, that slot is freed up for your own use\&. The drawback is that it introduces a level of indirection: one extra method call occurs when a method is called\&.
+-.PP
+-For server-side generation, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions earlier than Java SE 1\&.4\&.
+-.sp
+-.nf
+-\f3idlj \-oldImplBase \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-oldImplBase \-fallTIE My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-For the \f3My\fR interface, the this generates \f3My_Tie\&.java\fR\&. The constructor to the \f3My_Tie\fR class takes an \f3impl\fR object\&. You must provide the implementation for \f3impl\fR, but it does not have to inherit from any other class, only the interface \f3HelloOperations\fR\&. But to use it with the ORB, you must wrap your implementation within \f3My_Tie\fR, for example:
+-.sp
+-.nf
+-\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create servant and register it with the ORB\fP
+-.fi
+-.nf
+-\f3MyServant myDelegate = new MyServant();\fP
+-.fi
+-.nf
+-\f3myDelegate\&.setORB(orb); \fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create a tie, with servant being the delegate\&.\fP
+-.fi
+-.nf
+-\f3MyPOATie tie = new MyPOATie(myDelegate);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// obtain the objectRef for the tie\fP
+-.fi
+-.nf
+-\f3My ref = tie\&._this(orb);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ EMITTED\ FILES
+-If you want to direct the emitted files to a directory other than the current directory, then call the compiler this way: \f3i\fR\f3dlj -td /altdir My\&.idl\fR\&.
+-.PP
+-For the \f3My\fR interface, the bindings are emitted to \f3/altdir/My\&.java\fR, etc\&., instead of \f3\&./My\&.java\fR\&.
+-.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ INCLUDE\ FILES
+-If the \f3My\&.idl\fR file includes another \f3idl\fR file, \f3MyOther\&.idl\fR, then the compiler assumes that the \f3MyOther\&.idl\fR file resides in the local directory\&. If it resides in \f3/includes\fR, for example, then you call the compiler with the following command:
+-.sp
+-.nf
+-\f3idlj \-i /includes My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If \f3My\&.idl\fR also included \f3Another\&.idl\fR that resided in \f3/moreIncludes\fR, for example, then you call the compiler with the following command:
+-.sp
+-.nf
+-\f3idlj \-i /includes \-i /moreIncludes My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Because this form of \f3include\fR can become long, another way to indicate to the compiler where to search for included files is provided\&. This technique is similar to the idea of an environment variable\&. Create a file named idl\&.config in a directory that is listed in your \f3CLASSPATH\fR variable\&. Inside of \f3idl\&.config\fR, provide a line with the following form:
+-.sp
+-.nf
+-\f3includes=/includes;/moreIncludes\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The compiler will find this file and read in the includes list\&. Note that in this example the separator character between the two directories is a semicolon (;)\&. This separator character is platform dependent\&. On the Windows platform, use a semicolon, on the Unix platform, use a colon, and so on\&.
+-.SS EMIT\ BINDINGS\ FOR\ INCLUDE\ FILES
+-By default, only those interfaces, structures, and so on, that are defined in the \f3idl\fR file on the command line have Java bindings generated for them\&. The types defined in included files are not generated\&. For example, assume the following two \f3idl\fR files:
+-.sp
+-.nf
+-\f3My\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3#include <MyOther\&.idl>\fP
+-.fi
+-.nf
+-\f3interface My\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3MyOther\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3interface MyOther\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There is a caveat to the default rule\&. Any \f3#include\fR statements that appear at the global scope are treated as described\&. These \f3#include\fR statements can be thought of as import statements\&. The \f3#include\fR statements that appear within an enclosed scope are treated as true \f3#include\fR statements, which means that the code within the included file is treated as though it appeared in the original file and, therefore, Java bindings are emitted for it\&. Here is an example:
+-.sp
+-.nf
+-\f3My\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3#include <MyOther\&.idl>\fP
+-.fi
+-.nf
+-\f3interface My\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 #include <Embedded\&.idl>\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3MyOther\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3interface MyOther\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3Embedded\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3enum E {one, two, three};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Run\f3idlj My\&.idl\fRto generate the following list of Java files\&. Notice that \f3MyOther\&.java\fR is not generated because it is defined in an import-like \f3#include\fR\&. But \f3E\&.java\fR was generated because it was defined in a true \f3#include\fR\&. Notice that because the \f3Embedded\&.idl\fR file is included within the scope of the interface \f3My\fR, it appears within the scope of \f3My\fR (in \f3MyPackage\fR)\&. If the \f3-emitAll\fR flag had been used, then all types in all included files would have been emitted\&.
+-.sp
+-.nf
+-\f3\&./MyHolder\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyHelper\&.java\fP
+-.fi
+-.nf
+-\f3\&./_MyStub\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/EHolder\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/EHelper\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/E\&.java\fP
+-.fi
+-.nf
+-\f3\&./My\&.java\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS INSERT\ PACKAGE\ PREFIXES
+-Suppose that you work for a company named ABC that has constructed the following IDL file:
+-.sp
+-.nf
+-\f3Widgets\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3module Widgets\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 interface W1 {\&.\&.\&.};\fP
+-.fi
+-.nf
+-\f3 interface W2 {\&.\&.\&.};\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you run this file through the IDL-to-Java compiler, then the Java bindings for W1 and W2 are placed within the \f3Widgets\fR package\&. There is an industry convention that states that a company\&'s packages should reside within a package named \f3com\&.<company name>\fR\&. To follow this convention, the package name should be \f3com\&.abc\&.Widgets\fR\&. To place this package prefix onto the Widgets module, execute the following:
+-.sp
+-.nf
+-\f3idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you have an IDL file that includes Widgets\&.idl, then the \f3-pkgPrefix\fR flag must appear in that command also\&. If it does not, then your IDL file will be looking for a \f3Widgets\fR package rather than a \f3com\&.abc\&.Widgets\fR package\&.
+-.PP
+-If you have a number of these packages that require prefixes, then it might be easier to place them into the idl\&.config file described previously\&. Each package prefix line should be of the form: \f3PkgPrefix\&.<type>=<prefix>\fR\&. The line for the previous example would be \f3PkgPrefix\&.Widgets=com\&.abc\fR\&. This option does not affect the Repository ID\&.
+-.SS DEFINE\ SYMBOLS\ BEFORE\ COMPILATION
+-You might need to define a symbol for compilation that is not defined within the IDL file, perhaps to include debugging code in the bindings\&. The command \f3idlj -d MYDEF My\&.idl\fRis equivalent to putting the line \f3#define MYDEF\fR inside My\&.idl\&.
+-.SS PRESERVE\ PREEXISTING\ BINDINGS
+-If the Java binding files already exist, then the \f3-keep\fR flag keeps the compiler from overwriting them\&. The default is to generate all files without considering that they already exist\&. If you have customized those files (which you should not do unless you are very comfortable with their contents), then the \f3-keep\fR option is very useful\&. The command \f3idlj -keep My\&.idl\fR emits all client-side bindings that do not already exist\&.
+-.SS VIEW\ COMPILATION\ PROGRESS
+-The IDL-to-Java compiler generates status messages as it progresses through its phases of execution\&. Use the \f3-v\fR option to activate the verbose mode: \f3idlj -v My\&.idl\fR\&.
+-.PP
+-By default the compiler does not operate in verbose mode
+-.SS DISPLAY\ VERSION\ INFORMATION
+-To display the build version of the IDL-to-Java compiler, specify the \f3-version\fR option on the command-line: \f3idlj -version\fR\&.
+-.PP
+-Version information also appears within the bindings generated by the compiler\&. Any additional options appearing on the command-line are ignored\&.
+-.SH OPTIONS
+-.TP
+--d \fIsymbol\fR
+-.br
+-This is equivalent to the following line in an IDL file:
+-.sp
+-.nf
+-\f3#define \fIsymbol\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--demitAll
+-.br
+-Emit all types, including those found in \f3#include\fR files\&.
+-.TP
+--fside
+-.br
+-Defines what bindings to emit\&. The \f3side\fR parameter can be \f3client\fR, \f3server\fR, \f3serverTIE\fR, \f3all\fR, or \f3allTIE\fR\&. The \f3-fserverTIE\fR and \f3-fallTIE\fR options cause delegate model skeletons to be emitted\&. Defaults to \f3-fclient\fR when the flag is not specified\&.
+-.TP
+--i \fIinclude-path\fR
+-.br
+-By default, the current directory is scanned for included files\&. This option adds another directory\&.
+-.TP
+--i \fIkeep\fR
+-.br
+-If a file to be generated already exists, then do not overwrite it\&. By default it is overwritten\&.
+-.TP
+--noWarn
+-.br
+-Suppress warning messages\&.
+-.TP
+--oldImplBase
+-.br
+-Generates skeletons compatible with pre-1\&.4 JDK ORBs\&. By default, the POA Inheritance Model server-side bindings are generated\&. This option provides backward-compatibility with earlier releases of the Java programming language by generating server-side bindings that are \f3ImplBase\fR Inheritance Model classes\&.
+-.TP
+--pkgPrefix \fItype\fR\fIprefix\fR
+-.br
+-Wherever \f3type\fR is encountered at file scope, prefix the generated Java package name with \f3prefix\fR for all files generated for that type\&. The type is the simple name of either a top-level module, or an IDL type defined outside of any module\&.
+-.TP
+--pkgTranslate \fItype\fR\fIpackage\fR
+-.br
+-Whenever the module name type is encountered in an identifier, replace it in the identifier with package for all files in the generated Java package\&. Note that \f3pkgPrefix\fR changes are made first\&. The type value is the simple name of either a top-level module, or an IDL type defined outside of any module and must match the full package name exactly\&.
+-
+-If more than one translation matches an identifier, then the longest match is chosen as shown in the following example:
+-
+-\fICommand\fR:
+-.sp
+-.nf
+-\f3pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-\fIResulting Translation\fR:
+-.sp
+-.nf
+-\f3type => pkg\fP
+-.fi
+-.nf
+-\f3type\&.ext => pkg\&.ext\fP
+-.fi
+-.nf
+-\f3type\&.baz => pkg2\&.fizz\fP
+-.fi
+-.nf
+-\f3type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-The following package names \f3org\fR, \f3org\fR\&.o\f3mg\fR, or any subpackages of \f3org\&.omg\fR cannot be translated\&. Any attempt to translate these packages results in uncompilable code, and the use of these packages as the first argument after \f3-pkgTranslate\fR is treated as an error\&.
+-.TP
+--skeletonName \fIxxx%yyy\fR
+-.br
+-Use \f3xxx%yyy\fR as the pattern for naming the skeleton\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserver\fR or \f3-fall\fR), and \f3_%ImplBase\fR for the \f3oldImplBase\fR class (-\f3oldImplBase\fR) and (\f3-fserver\fR or \f3-fall\fR))\&.
+-.TP
+--td \fIdir\fR
+-.br
+-Use \fIdir\fR for the output directory instead of the current directory\&.
+-.TP
+--tieName \fIxxx%yyy\fR
+-.br
+-Use \f3xxx%yyy\fR according to the pattern\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserverTie or -fallTie\fR), and \f3_%Tie\fR for the \f3oldImplBase\fR tie class (-\f3oldImplBase\fR) and (\f3-fserverTie\fR or \f3-fallTie\fR))
+-.TP
+--nowarn, -verbose
+-.br
+-Displays release information and terminates\&.
+-.TP
+--version
+-.br
+-Displays release information and terminates\&.
+-.SH RESTRICTIONS
+-Escaped identifiers in the global scope cannot have the same spelling as IDL primitive types, \f3Object\fR, or \f3ValueBase\fR\&. This is because the symbol table is preloaded with these identifiers\&. Allowing them to be redefined would overwrite their original definitions\&. Possible permanent restriction\&.
+-.PP
+-The \f3fixed\fR IDL type is not supported\&.
+-.SH KNOWN\ PROBLEMS
+-No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&.
++
++.SH NAME
++idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBidlj\fR [ \fIoptions\fR ] \fIidlfile\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&. Options can appear in any order, but must precede the \f3idlfile\fR\&.
++.TP
++\fIidlfile\fR
++The name of a file that contains Interface Definition Language (IDL) definitions\&.
++.SH DESCRIPTION
++The IDL-to-Java Compiler generates the Java bindings for a specified IDL file\&. For binding details, see Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
++.PP
++Some earlier releases of the IDL-to-Java compiler were named \f3idltojava\fR\&.
++.SS EMIT\ CLIENT\ AND\ SERVER\ BINDINGS
++The following \f3idlj\fR command generates an IDL file named \f3My\&.idl\fR with client-side bindings\&.
++.sp
++.nf
++\f3idlj My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The previous syntax is equivalent to the following:
++.sp
++.nf
++\f3idlj \-fclient My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The next example generates the server-side bindings, and includes the client-side bindings plus the skeleton, all of which are POA (Inheritance Model)\&.
++.sp
++.nf
++\f3idlg \-fserver My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you want to generate both client and server-side bindings, then use one of the following (equivalent) commands:
++.sp
++.nf
++\f3idlj \-fclient \-fserver My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fall My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There are two possible server-side models: the Portal Servant Inheritance Model and the Tie Model\&. See Tie Delegation Model\&.
++.PP
++\f3Portable Servant Inheritance Model\fR\&. The default server-side model is the Portable Servant Inheritance Model\&. Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3MyPOA\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3MyPOA\fR class\&. \f3MyPOA\&.java\fR is a stream-based skeleton that extends the \f3org\&.omg\&.PortableServer\&.Servant\fR class at http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.html The \f3My\fR interface implements the \f3callHandler\fR interface and the operations interface associated with the IDL interface the skeleton implements\&.The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. See Portable Object Adapter (POA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.html In the Java programming language, the \f3Servant\fR type is mapped to the Java \f3org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&.Another option for the Inheritance Model is to use the \f3-oldImplBase\fR flag to generate server-side bindings that are compatible with releases of the Java programming language before Java SE 1\&.4\&. The -\f3oldImplBase\fR flag is nonstandard, and these APIs are deprecated\&. You would use this flag only for compatibility with existing servers written in Java SE 1\&.3\&. In that case, you would need to modify an existing make file to add the \f3-oldImplBase\fR flag to the \f3idlj\fR compiler\&. Otherwise POA-based server-side mappings are generated\&. To generate server-side bindings that are backward compatible, do the following:
++.sp
++.nf
++\f3idlj \-fclient \-fserver \-oldImplBase My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fall \-oldImplBase My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3_MyImplBase\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3_MyImplBase\fR class\&.
++.PP
++\f3Tie Delegation Model\fR\&. The other server-side model is called the Tie Model\&. This is a delegation model\&. Because it is not possible to generate ties and skeletons at the same time, they must be generated separately\&. The following commands generate the bindings for the Tie Model:
++.sp
++.nf
++\f3idlj \-fall My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fallTIE My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++For the \f3My\fR interface, the second command generates \f3MyPOATie\&.java\fR\&. The constructor to the \f3MyPOATie\fR class takes a delegate\&. In this example, using the default POA model, the constructor also needs a POA\&. You must provide the implementation for the delegate, but it does not have to inherit from any other class, only the interface \f3MyOperations\fR\&. To use it with the ORB, you must wrap your implementation within the \f3MyPOATie\fR class, for example:
++.sp
++.nf
++\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// Get reference to rootpoa & activate the POAManager\fP
++.fi
++.nf
++\f3POA rootpoa = (POA)orb\&.resolve_initial_references("RootPOA");\fP
++.fi
++.nf
++\f3rootpoa\&.the_POAManager()\&.activate();\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create servant and register it with the ORB\fP
++.fi
++.nf
++\f3MyServant myDelegate = new MyServant();\fP
++.fi
++.nf
++\f3myDelegate\&.setORB(orb); \fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create a tie, with servant being the delegate\&.\fP
++.fi
++.nf
++\f3MyPOATie tie = new MyPOATie(myDelegate, rootpoa);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// obtain the objectRef for the tie\fP
++.fi
++.nf
++\f3My ref = tie\&._this(orb);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++You might want to use the Tie model instead of the typical Inheritance model when your implementation must inherit from some other implementation\&. Java allows any number of interface inheritance, but there is only one slot for class inheritance\&. If you use the inheritance model, then that slot is used up\&. With the Tie Model, that slot is freed up for your own use\&. The drawback is that it introduces a level of indirection: one extra method call occurs when a method is called\&.
++.PP
++For server-side generation, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions earlier than Java SE 1\&.4\&.
++.sp
++.nf
++\f3idlj \-oldImplBase \-fall My\&.idl\fP
++.fi
++.nf
++\f3idlj \-oldImplBase \-fallTIE My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++For the \f3My\fR interface, the this generates \f3My_Tie\&.java\fR\&. The constructor to the \f3My_Tie\fR class takes an \f3impl\fR object\&. You must provide the implementation for \f3impl\fR, but it does not have to inherit from any other class, only the interface \f3HelloOperations\fR\&. But to use it with the ORB, you must wrap your implementation within \f3My_Tie\fR, for example:
++.sp
++.nf
++\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create servant and register it with the ORB\fP
++.fi
++.nf
++\f3MyServant myDelegate = new MyServant();\fP
++.fi
++.nf
++\f3myDelegate\&.setORB(orb); \fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create a tie, with servant being the delegate\&.\fP
++.fi
++.nf
++\f3MyPOATie tie = new MyPOATie(myDelegate);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// obtain the objectRef for the tie\fP
++.fi
++.nf
++\f3My ref = tie\&._this(orb);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ EMITTED\ FILES
++If you want to direct the emitted files to a directory other than the current directory, then call the compiler this way: \f3i\fR\f3dlj -td /altdir My\&.idl\fR\&.
++.PP
++For the \f3My\fR interface, the bindings are emitted to \f3/altdir/My\&.java\fR, etc\&., instead of \f3\&./My\&.java\fR\&.
++.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ INCLUDE\ FILES
++If the \f3My\&.idl\fR file includes another \f3idl\fR file, \f3MyOther\&.idl\fR, then the compiler assumes that the \f3MyOther\&.idl\fR file resides in the local directory\&. If it resides in \f3/includes\fR, for example, then you call the compiler with the following command:
++.sp
++.nf
++\f3idlj \-i /includes My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If \f3My\&.idl\fR also included \f3Another\&.idl\fR that resided in \f3/moreIncludes\fR, for example, then you call the compiler with the following command:
++.sp
++.nf
++\f3idlj \-i /includes \-i /moreIncludes My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Because this form of \f3include\fR can become long, another way to indicate to the compiler where to search for included files is provided\&. This technique is similar to the idea of an environment variable\&. Create a file named idl\&.config in a directory that is listed in your \f3CLASSPATH\fR variable\&. Inside of \f3idl\&.config\fR, provide a line with the following form:
++.sp
++.nf
++\f3includes=/includes;/moreIncludes\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The compiler will find this file and read in the includes list\&. Note that in this example the separator character between the two directories is a semicolon (;)\&. This separator character is platform dependent\&. On the Windows platform, use a semicolon, on the Unix platform, use a colon, and so on\&.
++.SS EMIT\ BINDINGS\ FOR\ INCLUDE\ FILES
++By default, only those interfaces, structures, and so on, that are defined in the \f3idl\fR file on the command line have Java bindings generated for them\&. The types defined in included files are not generated\&. For example, assume the following two \f3idl\fR files:
++.sp
++.nf
++\f3My\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3#include <MyOther\&.idl>\fP
++.fi
++.nf
++\f3interface My\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3MyOther\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3interface MyOther\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There is a caveat to the default rule\&. Any \f3#include\fR statements that appear at the global scope are treated as described\&. These \f3#include\fR statements can be thought of as import statements\&. The \f3#include\fR statements that appear within an enclosed scope are treated as true \f3#include\fR statements, which means that the code within the included file is treated as though it appeared in the original file and, therefore, Java bindings are emitted for it\&. Here is an example:
++.sp
++.nf
++\f3My\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3#include <MyOther\&.idl>\fP
++.fi
++.nf
++\f3interface My\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 #include <Embedded\&.idl>\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3MyOther\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3interface MyOther\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3Embedded\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3enum E {one, two, three};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Run\f3idlj My\&.idl\fRto generate the following list of Java files\&. Notice that \f3MyOther\&.java\fR is not generated because it is defined in an import-like \f3#include\fR\&. But \f3E\&.java\fR was generated because it was defined in a true \f3#include\fR\&. Notice that because the \f3Embedded\&.idl\fR file is included within the scope of the interface \f3My\fR, it appears within the scope of \f3My\fR (in \f3MyPackage\fR)\&. If the \f3-emitAll\fR flag had been used, then all types in all included files would have been emitted\&.
++.sp
++.nf
++\f3\&./MyHolder\&.java\fP
++.fi
++.nf
++\f3\&./MyHelper\&.java\fP
++.fi
++.nf
++\f3\&./_MyStub\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage\fP
++.fi
++.nf
++\f3\&./MyPackage/EHolder\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage/EHelper\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage/E\&.java\fP
++.fi
++.nf
++\f3\&./My\&.java\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS INSERT\ PACKAGE\ PREFIXES
++Suppose that you work for a company named ABC that has constructed the following IDL file:
++.sp
++.nf
++\f3Widgets\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3module Widgets\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 interface W1 {\&.\&.\&.};\fP
++.fi
++.nf
++\f3 interface W2 {\&.\&.\&.};\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you run this file through the IDL-to-Java compiler, then the Java bindings for W1 and W2 are placed within the \f3Widgets\fR package\&. There is an industry convention that states that a company\&'s packages should reside within a package named \f3com\&.<company name>\fR\&. To follow this convention, the package name should be \f3com\&.abc\&.Widgets\fR\&. To place this package prefix onto the Widgets module, execute the following:
++.sp
++.nf
++\f3idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you have an IDL file that includes Widgets\&.idl, then the \f3-pkgPrefix\fR flag must appear in that command also\&. If it does not, then your IDL file will be looking for a \f3Widgets\fR package rather than a \f3com\&.abc\&.Widgets\fR package\&.
++.PP
++If you have a number of these packages that require prefixes, then it might be easier to place them into the idl\&.config file described previously\&. Each package prefix line should be of the form: \f3PkgPrefix\&.<type>=<prefix>\fR\&. The line for the previous example would be \f3PkgPrefix\&.Widgets=com\&.abc\fR\&. This option does not affect the Repository ID\&.
++.SS DEFINE\ SYMBOLS\ BEFORE\ COMPILATION
++You might need to define a symbol for compilation that is not defined within the IDL file, perhaps to include debugging code in the bindings\&. The command \f3idlj -d MYDEF My\&.idl\fRis equivalent to putting the line \f3#define MYDEF\fR inside My\&.idl\&.
++.SS PRESERVE\ PREEXISTING\ BINDINGS
++If the Java binding files already exist, then the \f3-keep\fR flag keeps the compiler from overwriting them\&. The default is to generate all files without considering that they already exist\&. If you have customized those files (which you should not do unless you are very comfortable with their contents), then the \f3-keep\fR option is very useful\&. The command \f3idlj -keep My\&.idl\fR emits all client-side bindings that do not already exist\&.
++.SS VIEW\ COMPILATION\ PROGRESS
++The IDL-to-Java compiler generates status messages as it progresses through its phases of execution\&. Use the \f3-v\fR option to activate the verbose mode: \f3idlj -v My\&.idl\fR\&.
++.PP
++By default the compiler does not operate in verbose mode
++.SS DISPLAY\ VERSION\ INFORMATION
++To display the build version of the IDL-to-Java compiler, specify the \f3-version\fR option on the command-line: \f3idlj -version\fR\&.
++.PP
++Version information also appears within the bindings generated by the compiler\&. Any additional options appearing on the command-line are ignored\&.
++.SH OPTIONS
++.TP
++-d \fIsymbol\fR
++.br
++This is equivalent to the following line in an IDL file:
++.sp
++.nf
++\f3#define \fIsymbol\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-demitAll
++.br
++Emit all types, including those found in \f3#include\fR files\&.
++.TP
++-fside
++.br
++Defines what bindings to emit\&. The \f3side\fR parameter can be \f3client\fR, \f3server\fR, \f3serverTIE\fR, \f3all\fR, or \f3allTIE\fR\&. The \f3-fserverTIE\fR and \f3-fallTIE\fR options cause delegate model skeletons to be emitted\&. Defaults to \f3-fclient\fR when the flag is not specified\&.
++.TP
++-i \fIinclude-path\fR
++.br
++By default, the current directory is scanned for included files\&. This option adds another directory\&.
++.TP
++-i \fIkeep\fR
++.br
++If a file to be generated already exists, then do not overwrite it\&. By default it is overwritten\&.
++.TP
++-noWarn
++.br
++Suppress warning messages\&.
++.TP
++-oldImplBase
++.br
++Generates skeletons compatible with pre-1\&.4 JDK ORBs\&. By default, the POA Inheritance Model server-side bindings are generated\&. This option provides backward-compatibility with earlier releases of the Java programming language by generating server-side bindings that are \f3ImplBase\fR Inheritance Model classes\&.
++.TP
++-pkgPrefix \fItype\fR\fIprefix\fR
++.br
++Wherever \f3type\fR is encountered at file scope, prefix the generated Java package name with \f3prefix\fR for all files generated for that type\&. The type is the simple name of either a top-level module, or an IDL type defined outside of any module\&.
++.TP
++-pkgTranslate \fItype\fR\fIpackage\fR
++.br
++Whenever the module name type is encountered in an identifier, replace it in the identifier with package for all files in the generated Java package\&. Note that \f3pkgPrefix\fR changes are made first\&. The type value is the simple name of either a top-level module, or an IDL type defined outside of any module and must match the full package name exactly\&.
++
++If more than one translation matches an identifier, then the longest match is chosen as shown in the following example:
++
++\fICommand\fR:
++.sp
++.nf
++\f3pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++\fIResulting Translation\fR:
++.sp
++.nf
++\f3type => pkg\fP
++.fi
++.nf
++\f3type\&.ext => pkg\&.ext\fP
++.fi
++.nf
++\f3type\&.baz => pkg2\&.fizz\fP
++.fi
++.nf
++\f3type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++The following package names \f3org\fR, \f3org\fR\&.o\f3mg\fR, or any subpackages of \f3org\&.omg\fR cannot be translated\&. Any attempt to translate these packages results in uncompilable code, and the use of these packages as the first argument after \f3-pkgTranslate\fR is treated as an error\&.
++.TP
++-skeletonName \fIxxx%yyy\fR
++.br
++Use \f3xxx%yyy\fR as the pattern for naming the skeleton\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserver\fR or \f3-fall\fR), and \f3_%ImplBase\fR for the \f3oldImplBase\fR class (-\f3oldImplBase\fR) and (\f3-fserver\fR or \f3-fall\fR))\&.
++.TP
++-td \fIdir\fR
++.br
++Use \fIdir\fR for the output directory instead of the current directory\&.
++.TP
++-tieName \fIxxx%yyy\fR
++.br
++Use \f3xxx%yyy\fR according to the pattern\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserverTie or -fallTie\fR), and \f3_%Tie\fR for the \f3oldImplBase\fR tie class (-\f3oldImplBase\fR) and (\f3-fserverTie\fR or \f3-fallTie\fR))
++.TP
++-nowarn, -verbose
++.br
++Displays release information and terminates\&.
++.TP
++-version
++.br
++Displays release information and terminates\&.
++.SH RESTRICTIONS
++Escaped identifiers in the global scope cannot have the same spelling as IDL primitive types, \f3Object\fR, or \f3ValueBase\fR\&. This is because the symbol table is preloaded with these identifiers\&. Allowing them to be redefined would overwrite their original definitions\&. Possible permanent restriction\&.
++.PP
++The \f3fixed\fR IDL type is not supported\&.
++.SH KNOWN\ PROBLEMS
++No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&.
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/ja/appletviewer.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/appletviewer.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1995, 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
+--- ./jdk/src/linux/doc/man/ja/extcheck.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/extcheck.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1998, 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
+--- ./jdk/src/linux/doc/man/ja/idlj.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/idlj.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2001, 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
+--- ./jdk/src/linux/doc/man/ja/jar.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jar.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/linux/doc/man/ja/jarsigner.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jarsigner.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1998, 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
+--- ./jdk/src/linux/doc/man/ja/java.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/java.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/ja/javac.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/javac.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/ja/javadoc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/javadoc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/ja/javah.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/javah.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/ja/javap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/javap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/ja/javaws.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/javaws.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2003, 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
+--- ./jdk/src/linux/doc/man/ja/jcmd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jcmd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" 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
+--- ./jdk/src/linux/doc/man/ja/jconsole.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jconsole.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/jdb.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jdb.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1995, 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
+--- ./jdk/src/linux/doc/man/ja/jdeps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jdeps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2013, 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
+--- ./jdk/src/linux/doc/man/ja/jhat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jhat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2006, 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
+--- ./jdk/src/linux/doc/man/ja/jinfo.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jinfo.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/jjs.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jjs.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/ja/jmap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jmap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/jps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/jrunscript.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jrunscript.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2006, 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
+--- ./jdk/src/linux/doc/man/ja/jsadebugd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jsadebugd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/jstack.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jstack.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/jstat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jstat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/jstatd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jstatd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/jvisualvm.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/jvisualvm.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,4 @@
+ '\" t
+-.\" Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ .\"
+ .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ .\"
+--- ./jdk/src/linux/doc/man/ja/keytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/keytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1998, 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
+--- ./jdk/src/linux/doc/man/ja/native2ascii.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/native2ascii.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/linux/doc/man/ja/orbd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/orbd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2001, 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
+--- ./jdk/src/linux/doc/man/ja/pack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/pack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/policytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/policytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2001, 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
+--- ./jdk/src/linux/doc/man/ja/rmic.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/rmic.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/linux/doc/man/ja/rmid.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/rmid.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1998, 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
+--- ./jdk/src/linux/doc/man/ja/rmiregistry.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/rmiregistry.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/linux/doc/man/ja/schemagen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/schemagen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2005, 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
+--- ./jdk/src/linux/doc/man/ja/serialver.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/serialver.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/linux/doc/man/ja/servertool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/servertool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2001, 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
+--- ./jdk/src/linux/doc/man/ja/tnameserv.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/tnameserv.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1999, 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
+--- ./jdk/src/linux/doc/man/ja/unpack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/unpack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/ja/wsgen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/wsgen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2005, 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
+--- ./jdk/src/linux/doc/man/ja/wsimport.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/wsimport.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2005, 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
+--- ./jdk/src/linux/doc/man/ja/xjc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/ja/xjc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2005, 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
+--- ./jdk/src/linux/doc/man/jar.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jar.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jar.1
+-.\"
+-.if n .pl 99999
+-.TH jar 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jar.1
++.\"
++.if n .pl 99999
++.TH jar 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,437 +47,437 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jar \- Manipulates Java Archive (JAR) files\&.
+-.SH SYNOPSIS
+-Create JAR file
+-.sp
+-.nf
+-
+-\fBjar c\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Update JAR file
+-.sp
+-.nf
+-
+-\fBjar u\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Extract JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBx\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-List Contents of JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBt\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Add Index to JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBi\fR \fIjarfile\fR [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-.SH DESCRIPTION
+-The \f3jar\fR command is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format\&. However, the \f3jar\fR command was designed mainly to package Java applets or applications into a single archive\&. When the components of an applet or application (files, images and sounds) are combined into a single archive, they can be downloaded by a Java agent (such as a browser) in a single HTTP transaction, rather than requiring a new connection for each piece\&. This dramatically improves download times\&. The \f3jar\fR command also compresses files, which further improves download time\&. The \f3jar\fR command also allows individual entries in a file to be signed by the applet author so that their origin can be authenticated\&. A JAR file can be used as a class path entry, whether or not it is compressed\&.
+-.PP
+-The syntax for the \f3jar\fR command resembles the syntax for the \f3tar\fR command\&. It has several operation modes, defined by one of the mandatory \fIoperation arguments\fR\&. Other arguments are either \fIoptions\fR that modify the behavior of the operation, or \fIoperands\fR required to perform the operation\&.
+-.SH OPERATION\ ARGUMENTS
+-When using the \f3jar\fR command, you have to select an operation to be performed by specifying one of the following operation arguments\&. You can mix them up with other one-letter options on the command line, but usually the operation argument is the first argument specified\&.
+-.TP
+-c
+-Create a new JAR archive\&.
+-.TP
+-i
+-Generate index information for a JAR archive\&.
+-.TP
+-t
+-List the contents of a JAR archive\&.
+-.TP
+-u
+-Update a JAR archive\&.
+-.TP
+-x
+-Extract files from a JAR archive\&.
+-.SH OPTIONS
+-Use the following options to customize how the JAR file is created, updated, extracted, or viewed:
+-.TP
+-e
+-Sets the class specified by the \fIentrypoint\fR operand to be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The use of this option creates or overrides the \f3Main-Class\fR attribute value in the manifest file\&. The \f3e\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-
+-For example, the following command creates the \f3Main\&.jar\fR archive with the \f3Main\&.class\fR file where the \f3Main-Clas\fRs attribute value in the manifest is set to \f3Main\fR:
+-.sp
+-.nf
+-\f3jar cfe Main\&.jar Main Main\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The Java Runtime Environment (JRE) can directly call this application by running the following command:
+-.sp
+-.nf
+-\f3java \-jar Main\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the entry point class name is in a package, then it could use either the dot (\&.) or slash (/) as the delimiter\&. For example, if \f3Main\&.class\fR is in a package called \f3mydir\fR, then the entry point can be specified in one of the following ways:
+-.sp
+-.nf
+-\f3jar \-cfe Main\&.jar mydir/Main mydir/Main\&.class\fP
+-.fi
+-.nf
+-\f3jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Note
+-
+-Specifying both \f3m\fR and \f3e\fR options together when a particular manifest also contains the \f3Main-Class\fR attribute results in an ambiguous \f3Main-Class\fR specification\&. The ambiguity leads to an error and the \f3jar\fR command creation or update operation is terminated\&.
+-.TP
+-f
+-Sets the file specified by the \fI\fR\fIjarfile\fR operand to be the name of the JAR file that is created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR) from, or viewed (\f3t\fR)\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
+-.TP
+-m
+-Includes names and values of attributes from the file specified by the \f3manifest\fR operand in the manifest file of the \f3jar\fR command (located in the archive at \f3META-INF/MANIFEST\&.MF\fR)\&. The \f3jar\fR command adds the attribute\(cqs name and value to the JAR file unless an entry already exists with the same name, in which case the \f3jar\fR command updates the value of the attribute\&. The \f3m\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-
+-You can add special-purpose name-value attribute pairs to the manifest that are not contained in the default manifest file\&. For example, you can add attributes that specify vendor information, release information, package sealing, or to make JAR-bundled applications executable\&. For examples of using the \f3m\fR option, see Packaging Programs at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
+-.TP
+-M
+-Does not create a manifest file entry (for \f3c\fR and \f3u\fR), or delete a manifest file entry when one exists (for \f3u\fR)\&. The \f3M\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-.TP
+-n
+-When creating (\f3c\fR) a JAR file, this option normalizes the archive so that the content is not affected by the packing and unpacking operations of the pack200(1) command\&. Without this normalization, the signature of a signed JAR can become invalid\&.
+-.TP
+-v
+-Generates verbose output to standard output\&. See Examples\&.
+-.TP
+-0
+-(Zero) Creates (\f3c\fR) or updates (\f3u\fR) the JAR file without using ZIP compression\&.
+-.TP
+--C \fIdir\fR
+-.br
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, this option temporarily changes the directory while processing files specified by the \fIfile\fR operands\&. Its operation is intended to be similar to the \f3-C\fR option of the UNIX \f3tar\fR utility\&.For example, the following command changes to the \f3classes\fR directory and adds the \f3Bar\&.class\fR file from that directory to \f3my\&.jar\fR:
+-.sp
+-.nf
+-\f3jar uf my\&.jar \-C classes Bar\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following command changes to the \f3classes\fR directory and adds to \f3my\&.jar\fR all files within the classes directory (without creating a \f3classes\fR directory in the JAR file), then changes back to the original directory before changing to the \f3bin\fR directory to add \f3Xyz\&.class\fR to \f3my\&.jar\fR\&.
+-.sp
+-.nf
+-\f3jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If \f3classes\fR contained files \f3bar1\fR and \f3bar2\fR, then the JAR file will contain the following after running the previous command:
+-.sp
+-.nf
+-\f3% \fIjar tf my\&.jar\fR\fP
+-.fi
+-.nf
+-\f3META\-INF/\fP
+-.fi
+-.nf
+-\f3META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3bar1\fP
+-.fi
+-.nf
+-\f3bar2\fP
+-.fi
+-.nf
+-\f3Xyz\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-\fI\fR-J\fIoption\fR
+-Sets the specified JVM option to be used when the JRE runs the JAR file\&. JVM options are described on the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
+-.SH OPERANDS
+-The following operands are recognized by the \f3jar\fR command\&.
+-.TP
+-\fIfile\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIfile\fR operand defines the path and name of the file or directory that should be added to the archive\&. When extracting (\f3x\fR) or listing the contents (\f3t\fR) of a JAR file, the \fIfile\fR operand defines the path and name of the file to be extrated or listed\&. At least one valid file or directory must be specified\&. Separate multiple \fIfile\fR operands with spaces\&. If the \fIentrypoint\fR, \fIjarfile\fR, or \fImanifest\fR operands are used, the \fIfile\fR operands must be specified after them\&.
+-.TP
+-\fIentrypoint\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIentrypoint\fR operand defines the name of the class that should be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The \fIentrypoint\fR operand must be specified if the \f3e\fR option is present\&.
+-.TP
+-\fIjarfile\fR
+-Defines the name of the file to be created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR), or viewed (\f3t\fR)\&. The \fIjarfile\fR operand must be specified if the \f3f\fR option is present\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
+-
+-When indexing (\f3i\fR) a JAR file, specify the \fIjarfile\fR operand without the \f3f\fR option\&.
+-.TP
+-\fImanifest\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fImanifest\fR operand defines the preexisting manifest files with names and values of attributes to be included in \f3MANIFEST\&.MF\fR in the JAR file\&. The \fImanifest\fR operand must be specified if the \f3f\fR option is present\&.
+-.TP
+-\fI@arg-file\fR
+-To shorten or simplify the \f3jar\fR command, you can specify arguments in a separate text file and pass it to the \f3jar\fR command with the at sign (@) as a prefix\&. When the \f3jar\fR command encounters an argument beginning with the at sign, it expands the contents of that file into the argument list\&.
+-
+-An argument file can include options and arguments of the \f3jar\fR command (except the \f3-J\fR options, because they are passed to the launcher, which does not support argument files)\&. The arguments within a file can be separated by spaces or newline characters\&. File names within an argument file are relative to the current directory from which you run the \f3jar\fR command, not relative to the location of the argument file\&. Wild cards, such as the asterisk (*), that might otherwise be expanded by the operating system shell, are not expanded\&.
+-
+-The following example, shows how to create a \f3classes\&.list\fR file with names of files from the current directory output by the \f3find\fR command:
+-.sp
+-.nf
+-\f3find \&. \-name \&'*\&.class\&' \-print > classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-You can then execute the \f3jar\fR command and pass the \f3classes\&.list\fR file to it using the \fI@arg-file\fR syntax:
+-.sp
+-.nf
+-\f3jar cf my\&.jar @classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-An argument file can be specified with a path, but any file names inside the argument file that have relative paths are relative to the current working directory of the \f3jar\fR command, not to the path passed in, for example:
+-.sp
+-.nf
+-\f3jar @dir/classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.SH NOTES
+-The \f3e\fR, \f3f\fR, and \f3m\fR options must appear in the same order on the command line as the \fIentrypoint\fR, \fIjarfile\fR, and \fImanifest\fR operands, for example:
+-.sp
+-.nf
+-\f3jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH EXAMPLES
+-\f3Example 1 Adding All Files From the Current Directory With Verbose Output\fR
+-.sp
+-.nf
+-\f3% ls\fP
+-.fi
+-.nf
+-\f31\&.au Animator\&.class monkey\&.jpg\fP
+-.fi
+-.nf
+-\f32\&.au Wave\&.class spacemusic\&.au\fP
+-.fi
+-.nf
+-\f33\&.au at_work\&.gif\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3% jar cvf bundle\&.jar *\fP
+-.fi
+-.nf
+-\f3added manifest\fP
+-.fi
+-.nf
+-\f3adding: 1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: 2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: 3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
+-.fi
+-.nf
+-\f3adding: Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Adding Files From Subdirectories\fR
+-.sp
+-.nf
+-\f3% ls \-F\fP
+-.fi
+-.nf
+-\f3audio/ classes/ images/\fP
+-.fi
+-.nf
+-\f3% jar cvf bundle\&.jar audio classes images\fP
+-.fi
+-.nf
+-\f3added manifest\fP
+-.fi
+-.nf
+-\f3adding: audio/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: audio/1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: audio/2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: audio/3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
+-.fi
+-.nf
+-\f3adding: audio/spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: classes/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: classes/Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: classes/Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: images/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: images/monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: images/at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3% ls \-F\fP
+-.fi
+-.nf
+-\f3audio/ bundle\&.jar classes/ images/\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Listing the Contents of JAR\fR
+-.sp
+-.nf
+-\f3% jar tf bundle\&.jar\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3META\-INF/\fP
+-.fi
+-.nf
+-\f3META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3audio/1\&.au\fP
+-.fi
+-.nf
+-\f3audio/2\&.au\fP
+-.fi
+-.nf
+-\f3audio/3\&.au\fP
+-.fi
+-.nf
+-\f3audio/spacemusic\&.au\fP
+-.fi
+-.nf
+-\f3classes/Animator\&.class\fP
+-.fi
+-.nf
+-\f3classes/Wave\&.class\fP
+-.fi
+-.nf
+-\f3images/monkey\&.jpg\fP
+-.fi
+-.nf
+-\f3images/at_work\&.gif\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Adding an Index\fR
+-.PP
+-Use the \f3i\fR option when you split the interdependent classes for a stock trade application into three JAR files: \f3main\&.jar\fR, \f3buy\&.jar\fR, and \f3sell\&.jar\fR\&. If you specify the \f3Class-Path\fR attribute in the \f3main\&.jar\fR manifest, then you can use the \f3i\fR option to speed up the class loading time for your application:
+-.sp
+-.nf
+-\f3Class\-Path: buy\&.jar sell\&.jar\fP
+-.fi
+-.nf
+-\f3jar i main\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-An \f3INDEX\&.LIST\fR file is inserted to the \f3META-INF\fR directory\&. This enables the application class loader to download the specified JAR files when it is searching for classes or resources\&.
+-.PP
+-The application class loader uses the information stored in this file for efficient class loading\&. To copy directories, first compress files in \f3dir1\fR to \f3stdout\fR, then pipeline and extract from \f3stdin\fR to \f3dir2\fR (omitting the \f3-f\fR option from both \f3jar\fR commands):
+-.sp
+-.nf
+-\f3(cd dir1; jar c \&.) | (cd dir2; jar x)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pack200(1)\&.
+-.TP 0.2i
+-\(bu
+-The JAR section of The Java Tutorials at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
++
++.SH NAME
++jar \- Manipulates Java Archive (JAR) files\&.
++.SH SYNOPSIS
++Create JAR file
++.sp
++.nf
++
++\fBjar c\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Update JAR file
++.sp
++.nf
++
++\fBjar u\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Extract JAR file
++.sp
++.nf
++
++\fBjar\fR \fBx\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++List Contents of JAR file
++.sp
++.nf
++
++\fBjar\fR \fBt\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Add Index to JAR file
++.sp
++.nf
++
++\fBjar\fR \fBi\fR \fIjarfile\fR [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++.SH DESCRIPTION
++The \f3jar\fR command is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format\&. However, the \f3jar\fR command was designed mainly to package Java applets or applications into a single archive\&. When the components of an applet or application (files, images and sounds) are combined into a single archive, they can be downloaded by a Java agent (such as a browser) in a single HTTP transaction, rather than requiring a new connection for each piece\&. This dramatically improves download times\&. The \f3jar\fR command also compresses files, which further improves download time\&. The \f3jar\fR command also allows individual entries in a file to be signed by the applet author so that their origin can be authenticated\&. A JAR file can be used as a class path entry, whether or not it is compressed\&.
++.PP
++The syntax for the \f3jar\fR command resembles the syntax for the \f3tar\fR command\&. It has several operation modes, defined by one of the mandatory \fIoperation arguments\fR\&. Other arguments are either \fIoptions\fR that modify the behavior of the operation, or \fIoperands\fR required to perform the operation\&.
++.SH OPERATION\ ARGUMENTS
++When using the \f3jar\fR command, you have to select an operation to be performed by specifying one of the following operation arguments\&. You can mix them up with other one-letter options on the command line, but usually the operation argument is the first argument specified\&.
++.TP
++c
++Create a new JAR archive\&.
++.TP
++i
++Generate index information for a JAR archive\&.
++.TP
++t
++List the contents of a JAR archive\&.
++.TP
++u
++Update a JAR archive\&.
++.TP
++x
++Extract files from a JAR archive\&.
++.SH OPTIONS
++Use the following options to customize how the JAR file is created, updated, extracted, or viewed:
++.TP
++e
++Sets the class specified by the \fIentrypoint\fR operand to be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The use of this option creates or overrides the \f3Main-Class\fR attribute value in the manifest file\&. The \f3e\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++
++For example, the following command creates the \f3Main\&.jar\fR archive with the \f3Main\&.class\fR file where the \f3Main-Clas\fRs attribute value in the manifest is set to \f3Main\fR:
++.sp
++.nf
++\f3jar cfe Main\&.jar Main Main\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The Java Runtime Environment (JRE) can directly call this application by running the following command:
++.sp
++.nf
++\f3java \-jar Main\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the entry point class name is in a package, then it could use either the dot (\&.) or slash (/) as the delimiter\&. For example, if \f3Main\&.class\fR is in a package called \f3mydir\fR, then the entry point can be specified in one of the following ways:
++.sp
++.nf
++\f3jar \-cfe Main\&.jar mydir/Main mydir/Main\&.class\fP
++.fi
++.nf
++\f3jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Note
++
++Specifying both \f3m\fR and \f3e\fR options together when a particular manifest also contains the \f3Main-Class\fR attribute results in an ambiguous \f3Main-Class\fR specification\&. The ambiguity leads to an error and the \f3jar\fR command creation or update operation is terminated\&.
++.TP
++f
++Sets the file specified by the \fI\fR\fIjarfile\fR operand to be the name of the JAR file that is created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR) from, or viewed (\f3t\fR)\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
++.TP
++m
++Includes names and values of attributes from the file specified by the \f3manifest\fR operand in the manifest file of the \f3jar\fR command (located in the archive at \f3META-INF/MANIFEST\&.MF\fR)\&. The \f3jar\fR command adds the attribute\(cqs name and value to the JAR file unless an entry already exists with the same name, in which case the \f3jar\fR command updates the value of the attribute\&. The \f3m\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++
++You can add special-purpose name-value attribute pairs to the manifest that are not contained in the default manifest file\&. For example, you can add attributes that specify vendor information, release information, package sealing, or to make JAR-bundled applications executable\&. For examples of using the \f3m\fR option, see Packaging Programs at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
++.TP
++M
++Does not create a manifest file entry (for \f3c\fR and \f3u\fR), or delete a manifest file entry when one exists (for \f3u\fR)\&. The \f3M\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++.TP
++n
++When creating (\f3c\fR) a JAR file, this option normalizes the archive so that the content is not affected by the packing and unpacking operations of the pack200(1) command\&. Without this normalization, the signature of a signed JAR can become invalid\&.
++.TP
++v
++Generates verbose output to standard output\&. See Examples\&.
++.TP
++0
++(Zero) Creates (\f3c\fR) or updates (\f3u\fR) the JAR file without using ZIP compression\&.
++.TP
++-C \fIdir\fR
++.br
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, this option temporarily changes the directory while processing files specified by the \fIfile\fR operands\&. Its operation is intended to be similar to the \f3-C\fR option of the UNIX \f3tar\fR utility\&.For example, the following command changes to the \f3classes\fR directory and adds the \f3Bar\&.class\fR file from that directory to \f3my\&.jar\fR:
++.sp
++.nf
++\f3jar uf my\&.jar \-C classes Bar\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following command changes to the \f3classes\fR directory and adds to \f3my\&.jar\fR all files within the classes directory (without creating a \f3classes\fR directory in the JAR file), then changes back to the original directory before changing to the \f3bin\fR directory to add \f3Xyz\&.class\fR to \f3my\&.jar\fR\&.
++.sp
++.nf
++\f3jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If \f3classes\fR contained files \f3bar1\fR and \f3bar2\fR, then the JAR file will contain the following after running the previous command:
++.sp
++.nf
++\f3% \fIjar tf my\&.jar\fR\fP
++.fi
++.nf
++\f3META\-INF/\fP
++.fi
++.nf
++\f3META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3bar1\fP
++.fi
++.nf
++\f3bar2\fP
++.fi
++.nf
++\f3Xyz\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++\fI\fR-J\fIoption\fR
++Sets the specified JVM option to be used when the JRE runs the JAR file\&. JVM options are described on the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
++.SH OPERANDS
++The following operands are recognized by the \f3jar\fR command\&.
++.TP
++\fIfile\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIfile\fR operand defines the path and name of the file or directory that should be added to the archive\&. When extracting (\f3x\fR) or listing the contents (\f3t\fR) of a JAR file, the \fIfile\fR operand defines the path and name of the file to be extrated or listed\&. At least one valid file or directory must be specified\&. Separate multiple \fIfile\fR operands with spaces\&. If the \fIentrypoint\fR, \fIjarfile\fR, or \fImanifest\fR operands are used, the \fIfile\fR operands must be specified after them\&.
++.TP
++\fIentrypoint\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIentrypoint\fR operand defines the name of the class that should be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The \fIentrypoint\fR operand must be specified if the \f3e\fR option is present\&.
++.TP
++\fIjarfile\fR
++Defines the name of the file to be created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR), or viewed (\f3t\fR)\&. The \fIjarfile\fR operand must be specified if the \f3f\fR option is present\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
++
++When indexing (\f3i\fR) a JAR file, specify the \fIjarfile\fR operand without the \f3f\fR option\&.
++.TP
++\fImanifest\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fImanifest\fR operand defines the preexisting manifest files with names and values of attributes to be included in \f3MANIFEST\&.MF\fR in the JAR file\&. The \fImanifest\fR operand must be specified if the \f3f\fR option is present\&.
++.TP
++\fI@arg-file\fR
++To shorten or simplify the \f3jar\fR command, you can specify arguments in a separate text file and pass it to the \f3jar\fR command with the at sign (@) as a prefix\&. When the \f3jar\fR command encounters an argument beginning with the at sign, it expands the contents of that file into the argument list\&.
++
++An argument file can include options and arguments of the \f3jar\fR command (except the \f3-J\fR options, because they are passed to the launcher, which does not support argument files)\&. The arguments within a file can be separated by spaces or newline characters\&. File names within an argument file are relative to the current directory from which you run the \f3jar\fR command, not relative to the location of the argument file\&. Wild cards, such as the asterisk (*), that might otherwise be expanded by the operating system shell, are not expanded\&.
++
++The following example, shows how to create a \f3classes\&.list\fR file with names of files from the current directory output by the \f3find\fR command:
++.sp
++.nf
++\f3find \&. \-name \&'*\&.class\&' \-print > classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++You can then execute the \f3jar\fR command and pass the \f3classes\&.list\fR file to it using the \fI@arg-file\fR syntax:
++.sp
++.nf
++\f3jar cf my\&.jar @classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++An argument file can be specified with a path, but any file names inside the argument file that have relative paths are relative to the current working directory of the \f3jar\fR command, not to the path passed in, for example:
++.sp
++.nf
++\f3jar @dir/classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.SH NOTES
++The \f3e\fR, \f3f\fR, and \f3m\fR options must appear in the same order on the command line as the \fIentrypoint\fR, \fIjarfile\fR, and \fImanifest\fR operands, for example:
++.sp
++.nf
++\f3jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH EXAMPLES
++\f3Example 1 Adding All Files From the Current Directory With Verbose Output\fR
++.sp
++.nf
++\f3% ls\fP
++.fi
++.nf
++\f31\&.au Animator\&.class monkey\&.jpg\fP
++.fi
++.nf
++\f32\&.au Wave\&.class spacemusic\&.au\fP
++.fi
++.nf
++\f33\&.au at_work\&.gif\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3% jar cvf bundle\&.jar *\fP
++.fi
++.nf
++\f3added manifest\fP
++.fi
++.nf
++\f3adding: 1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: 2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: 3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
++.fi
++.nf
++\f3adding: Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Adding Files From Subdirectories\fR
++.sp
++.nf
++\f3% ls \-F\fP
++.fi
++.nf
++\f3audio/ classes/ images/\fP
++.fi
++.nf
++\f3% jar cvf bundle\&.jar audio classes images\fP
++.fi
++.nf
++\f3added manifest\fP
++.fi
++.nf
++\f3adding: audio/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: audio/1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: audio/2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: audio/3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
++.fi
++.nf
++\f3adding: audio/spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: classes/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: classes/Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: classes/Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: images/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: images/monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: images/at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3% ls \-F\fP
++.fi
++.nf
++\f3audio/ bundle\&.jar classes/ images/\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Listing the Contents of JAR\fR
++.sp
++.nf
++\f3% jar tf bundle\&.jar\fP
++.fi
++.sp
++.sp
++.nf
++\f3META\-INF/\fP
++.fi
++.nf
++\f3META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3audio/1\&.au\fP
++.fi
++.nf
++\f3audio/2\&.au\fP
++.fi
++.nf
++\f3audio/3\&.au\fP
++.fi
++.nf
++\f3audio/spacemusic\&.au\fP
++.fi
++.nf
++\f3classes/Animator\&.class\fP
++.fi
++.nf
++\f3classes/Wave\&.class\fP
++.fi
++.nf
++\f3images/monkey\&.jpg\fP
++.fi
++.nf
++\f3images/at_work\&.gif\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Adding an Index\fR
++.PP
++Use the \f3i\fR option when you split the interdependent classes for a stock trade application into three JAR files: \f3main\&.jar\fR, \f3buy\&.jar\fR, and \f3sell\&.jar\fR\&. If you specify the \f3Class-Path\fR attribute in the \f3main\&.jar\fR manifest, then you can use the \f3i\fR option to speed up the class loading time for your application:
++.sp
++.nf
++\f3Class\-Path: buy\&.jar sell\&.jar\fP
++.fi
++.nf
++\f3jar i main\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++An \f3INDEX\&.LIST\fR file is inserted to the \f3META-INF\fR directory\&. This enables the application class loader to download the specified JAR files when it is searching for classes or resources\&.
++.PP
++The application class loader uses the information stored in this file for efficient class loading\&. To copy directories, first compress files in \f3dir1\fR to \f3stdout\fR, then pipeline and extract from \f3stdin\fR to \f3dir2\fR (omitting the \f3-f\fR option from both \f3jar\fR commands):
++.sp
++.nf
++\f3(cd dir1; jar c \&.) | (cd dir2; jar x)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pack200(1)\&.
++.TP 0.2i
++\(bu
++The JAR section of The Java Tutorials at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jarsigner.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jarsigner.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Security Tools
+-.\" Title: jarsigner.1
+-.\"
+-.if n .pl 99999
+-.TH jarsigner 1 "21 November 2013" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Security Tools
++.\" Title: jarsigner.1
++.\"
++.if n .pl 99999
++.TH jarsigner 1 "21 November 2013" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,761 +47,761 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jarsigner \- Signs and verifies Java Archive (JAR) files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjarsigner\fR [ \fIoptions\fR ] \fIjar\-file\fR \fIalias\fR
+-.fi
+-.nf
+-
+-\fBjarsigner\fR \fB\-verify\fR [ \fIoptions\fR ] \fIjar\-file\fR [\fIalias \&.\&.\&.\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+--verify
+-.br
+-The \f3-verify\fR option can take zero or more keystore alias names after the JAR file name\&. When the \f3-verify\fR option is specified, the \f3jarsigner\fR command checks that the certificate used to verify each signed entry in the JAR file matches one of the keystore aliases\&. The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
+-
+-If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar verified, with signer errors" is displayed\&.
+-.TP
+-\fIjar-file\fR
+-The JAR file to be signed\&.
+-
+-If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar signed, with signer errors" is displayed\&.
+-.TP
+-\fIalias\fR
+-The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
+-.SH DESCRIPTION
+-The \f3jarsigner\fR tool has two purposes:
+-.TP 0.2i
+-\(bu
+-To sign Java Archive (JAR) files\&.
+-.TP 0.2i
+-\(bu
+-To verify the signatures and integrity of signed JAR files\&.
+-.PP
+-The JAR feature enables the packaging of class files, images, sounds, and other digital data in a single file for faster and easier distribution\&. A tool named \f3jar\fR enables developers to produce JAR files\&. (Technically, any zip file can also be considered a JAR file, although when created by the \f3jar\fR command or processed by the \f3jarsigner\fR command, JAR files also contain a \f3META-INF/MANIFEST\&.MF\fR file\&.)
+-.PP
+-A digital signature is a string of bits that is computed from some data (the data being signed) and the private key of an entity (a person, company, and so on)\&. Similar to a handwritten signature, a digital signature has many useful characteristics:
+-.TP 0.2i
+-\(bu
+-Its authenticity can be verified by a computation that uses the public key corresponding to the private key used to generate the signature\&.
+-.TP 0.2i
+-\(bu
+-It cannot be forged, assuming the private key is kept secret\&.
+-.TP 0.2i
+-\(bu
+-It is a function of the data signed and thus cannot be claimed to be the signature for other data as well\&.
+-.TP 0.2i
+-\(bu
+-The signed data cannot be changed\&. If the data is changed, then the signature cannot be verified as authentic\&.
+-.PP
+-To generate an entity\&'s signature for a file, the entity must first have a public/private key pair associated with it and one or more certificates that authenticate its public key\&. A certificate is a digitally signed statement from one entity that says that the public key of another entity has a particular value\&.
+-.PP
+-The \f3jarsigner\fR command uses key and certificate information from a keystore to generate digital signatures for JAR files\&. A keystore is a database of private keys and their associated X\&.509 certificate chains that authenticate the corresponding public keys\&. The \f3keytool\fR command is used to create and administer keystores\&.
+-.PP
+-The \f3jarsigner\fR command uses an entity\&'s private key to generate a signature\&. The signed JAR file contains, among other things, a copy of the certificate from the keystore for the public key corresponding to the private key used to sign the file\&. The \f3jarsigner\fR command can verify the digital signature of the signed JAR file using the certificate inside it (in its signature block file)\&.
+-.PP
+-The \f3jarsigner\fR command can generate signatures that include a time stamp that lets a systems or deployer (including Java Plug-in) to check whether the JAR file was signed while the signing certificate was still valid\&. In addition, APIs allow applications to obtain the timestamp information\&.
+-.PP
+-At this time, the \f3jarsigner\fR command can only sign JAR files created by the \f3jar\fR command or zip files\&. JAR files are the same as zip files, except they also have a \f3META-INF/MANIFEST\&.MF\fR file\&. A \f3META-INF/MANIFEST\&.MF\fR file is created when the \f3jarsigner\fR command signs a zip file\&.
+-.PP
+-The default \f3jarsigner\fR command behavior is to sign a JAR or zip file\&. Use the \f3-verify\fR option to verify a signed JAR file\&.
+-.PP
+-The \f3jarsigner\fR command also attempts to validate the signer\&'s certificate after signing or verifying\&. If there is a validation error or any other problem, the command generates warning messages\&. If you specify the \f3-strict\fR option, then the command treats severe warnings as errors\&. See Errors and Warnings\&.
+-.SS KEYSTORE\ ALIASES
+-All keystore entities are accessed with unique aliases\&.
+-.PP
+-When you use the \f3jarsigner\fR command to sign a JAR file, you must specify the alias for the keystore entry that contains the private key needed to generate the signature\&. For example, the following command signs the JAR file named \f3MyJARFile\&.jar\fR with the private key associated with the alias \f3duke\fR in the keystore named \f3mystore\fR in the \f3working\fR directory\&. Because no output file is specified, it overwrites \f3MyJARFile\&.jar\fR with the signed JAR file\&.
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore \-storepass <keystore password>\fP
+-.fi
+-.nf
+-\f3 \-keypass <private key password> MyJARFile\&.jar duke\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Keystores are protected with a password, so the store password must be specified\&. You are prompted for it when you do not specify it on the command line\&. Similarly, private keys are protected in a keystore with a password, so the private key\&'s password must be specified, and you are prompted for the password when you do not specify it on the command line and it is not the same as the store password\&.
+-.SS KEYSTORE\ LOCATION
+-The \f3jarsigner\fR command has a \f3-keystore\fR option for specifying the URL of the keystore to be used\&. The keystore is by default stored in a file named \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
+-.PP
+-On Oracle Solaris systems, \f3user\&.home\fR defaults to the user\&'s home directory\&.
+-.PP
+-The input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified when the \f3KeyStore\fR class is not file based, for example, when it resides on a hardware token device\&.
+-.SS KEYSTORE\ IMPLEMENTATION
+-The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies a number of well-defined interfaces to access and modify the information in a keystore\&. You can have multiple different concrete implementations, where each implementation is for a particular type of keystore\&.
+-.PP
+-Currently, there are two command-line tools that use keystore implementations (\f3keytool\fR and \f3jarsigner\fR), and a GUI-based tool named Policy Tool\&. Because the \f3KeyStore\fR class is publicly available, JDK users can write additional security applications that use it\&.
+-.PP
+-There is a built-in default implementation provided by Oracle that implements the keystore as a file, that uses a proprietary keystore type (format) named JKS\&. The built-in implementation protects each private key with its individual password and protects the integrity of the entire keystore with a (possibly different) password\&.
+-.PP
+-Keystore implementations are provider-based, which means the application interfaces supplied by the \f3KeyStore\fR class are implemented in terms of a Service Provider Interface (SPI)\&. There is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, that defines the Service Provider Interface methods that providers must implement\&. The term provider refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
+-.PP
+-Applications can choose different types of keystore implementations from different providers, with the \f3getInstance\fR factory method in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself\&. Keystore implementations of different types are not compatible\&.
+-.PP
+-The \f3jarsigner\fR and \f3policytool\fR commands can read file-based keystores from any location that can be specified using a URL\&. In addition, these commands can read non-file-based keystores such as those provided by MSCAPI on Windows and PKCS11 on all platforms\&.
+-.PP
+-For the \f3jarsigner\fR and \f3keytool\fR commands, you can specify a keystore type at the command line with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIEdit\fR command in the \fIKeyStore\fR menu\&.
+-.PP
+-If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and it resides in the JDK security properties directory, \f3java\&.home/lib/security\fR, where \f3java\&.home\fR is the runtime environment\&'s directory\&. The \f3jre\fR directory in the JDK or the top-level directory of the Java Runtime Environment (JRE)\&.
+-.PP
+-Each tool gets the \f3keystore\&.type\fR value and then examines all the installed providers until it finds one that implements keystores of that type\&. It then uses the keystore implementation from that provider\&.
+-.PP
+-The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type property\fR:
+-.sp
+-.nf
+-\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The default keystore type is \f3jks\fR (the proprietary type of the keystore implementation provided by Oracle)\&. This is specified by the following line in the security properties file:
+-.sp
+-.nf
+-\f3keystore\&.type=jks\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Case does not matter in keystore type designations\&. For example, \f3JKS\fR is the same as \f3jks\fR\&.
+-.PP
+-To have the tools use a keystore implementation other than the default, change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
+-.sp
+-.nf
+-\f3keystore\&.type=pkcs12\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-\fINote:\fR If you use the PKCS 11 provider package, then see "KeyTool" and "JarSigner" in Java PKCS #11 Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.html
+-.SS SUPPORTED\ ALGORITHMS
+-By default, the \f3jarsigner\fR command signs a JAR file using one of the following algorithms:
+-.TP 0.2i
+-\(bu
+-Digital Signature Algorithm (DSA) with the SHA1 digest algorithm
+-.TP 0.2i
+-\(bu
+-RSA algorithm with the SHA256 digest algorithm
+-.TP 0.2i
+-\(bu
+-Elliptic Curve (EC) cryptography algorithm with the SHA256 with Elliptic Curve Digital Signature Algorithm (ECDSA)\&.
+-.PP
+-If the signer\&'s public and private keys are DSA keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA1withDSA\fR algorithm\&. If the signer\&'s keys are RSA keys, then \f3jarsigner\fR attempts to sign the JAR file with the \f3SHA256withRSA\fR algorithm\&. If the signer\&'s keys are EC keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA256withECDSA\fR algorithm\&.
+-.PP
+-These default signature algorithms can be overridden using the \f3-sigalg\fR option\&.
+-.SS THE\ SIGNED\ JAR\ FILE
+-When the \f3jarsigner\fR command is used to sign a JAR file, the output signed JAR file is exactly the same as the input JAR file, except that it has two additional files placed in the META-INF directory:
+-.TP 0.2i
+-\(bu
+-A signature file with an \f3\&.SF\fR extension
+-.TP 0.2i
+-\(bu
+-A signature block file with a \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR extension
+-.PP
+-The base file names for these two files come from the value of the \f3-sigFile\fR option\&. For example, when the option is \f3-sigFile MKSIGN\fR, the files are named \f3MKSIGN\&.SF\fR and \f3MKSIGN\&.DSA\fR
+-.PP
+-If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to uppercase\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not allowed in a signature file name, then each such character is converted to an underscore (_) character in forming the file name\&. Valid characters include letters, digits, underscores, and hyphens\&.
+-.PP
+-Signature File
+-
+-A signature file (\f3\&.SF\fR file) looks similar to the manifest file that is always included in a JAR file when the \f3jarsigner\fR command is used to sign the file\&. For each source file included in the JAR file, the \f3\&.SF\fR file has three lines, such as in the manifest file, that list the following:
+-.TP 0.2i
+-\(bu
+-File name
+-.TP 0.2i
+-\(bu
+-Name of the digest algorithm (SHA)
+-.TP 0.2i
+-\(bu
+-SHA digest value
+-.PP
+-In the manifest file, the SHA digest value for each source file is the digest (hash) of the binary data in the source file\&. In the \f3\&.SF\fR file, the digest value for a specified source file is the hash of the three lines in the manifest file for the source file\&.
+-.PP
+-The signature file, by default, includes a header with a hash of the whole manifest file\&. The header also contains a hash of the manifest header\&. The presence of the header enables verification optimization\&. See JAR File Verification\&.
+-.PP
+-Signature Block File
+-
+-The \f3\&.SF\fR file is signed and the signature is placed in the signature block file\&. This file also contains, encoded inside it, the certificate or certificate chain from the keystore that authenticates the public key corresponding to the private key used for signing\&. The file has the extension \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR, depending on the digest algorithm used\&.
+-.SS SIGNATURE\ TIME\ STAMP
+-The \f3jarsigner\fR command can generate and store a signature time stamp when signing a JAR file\&. In addition, \f3jarsigner\fR supports alternative signing mechanisms\&. This behavior is optional and is controlled by the user at the time of signing through these options\&. See Options\&.
+-.sp
+-.nf
+-\f3\-tsa \fIurl\fR\fP
+-.fi
+-.nf
+-\f3\-tsacert \fIalias\fR\fP
+-.fi
+-.nf
+-\f3\-altsigner \fIclass\fR\fP
+-.fi
+-.nf
+-\f3\-altsignerpath \fIclasspathlist\fR\fP
+-.fi
+-.nf
+-\f3\-tsapolicyid \fIpolicyid\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS JAR\ FILE\ VERIFICATION
+-A successful JAR file verification occurs when the signatures are valid, and none of the files that were in the JAR file when the signatures were generated have changed since then\&. JAR file verification involves the following steps:
+-.TP 0.4i
+-1\&.
+-Verify the signature of the \f3\&.SF\fR file\&.
+-
+-The verification ensures that the signature stored in each signature block (\f3\&.DSA\fR) file was generated using the private key corresponding to the public key whose certificate (or certificate chain) also appears in the \f3\&.DSA\fR file\&. It also ensures that the signature is a valid signature of the corresponding signature (\f3\&.SF\fR) file, and thus the \f3\&.SF\fR file was not tampered with\&.
+-.TP 0.4i
+-2\&.
+-Verify the digest listed in each entry in the \f3\&.SF\fR file with each corresponding section in the manifest\&.
+-
+-The \f3\&.SF\fR file by default includes a header that contains a hash of the entire manifest file\&. When the header is present, the verification can check to see whether or not the hash in the header matches the hash of the manifest file\&. If there is a match, then verification proceeds to the next step\&.
+-
+-If there is no match, then a less optimized verification is required to ensure that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See Signature File\&.
+-
+-One reason the hash of the manifest file that is stored in the \f3\&.SF\fR file header might not equal the hash of the current manifest file is that one or more files were added to the JAR file (with the \f3jar\fR tool) after the signature and \f3\&.SF\fR file were generated\&. When the \f3jar\fR tool is used to add files, the manifest file is changed by adding sections to it for the new files, but the \f3\&.SF\fR file is not changed\&. A verification is still considered successful when none of the files that were in the JAR file when the signature was generated have been changed since then\&. This happens when the hashes in the non-header sections of the \f3\&.SF\fR file equal the hashes of the corresponding sections in the manifest file\&.
+-.TP 0.4i
+-3\&.
+-Read each file in the JAR file that has an entry in the \f3\&.SF\fR file\&. While reading, compute the file\&'s digest and compare the result with the digest for this file in the manifest section\&. The digests should be the same or verification fails\&.
+-
+-If any serious verification failures occur during the verification process, then the process is stopped and a security exception is thrown\&. The \f3jarsigner\fR command catches and displays the exception\&.
+-.PP
+-\fINote:\fR You should read any addition warnings (or errors if you specified the \f3-strict\fR option), as well as the content of the certificate (by specifying the \f3-verbose\fR and \f3-certs\fR options) to determine if the signature can be trusted\&.
+-.SS MULTIPLE\ SIGNATURES\ FOR\ A\ JAR\ FILE
+-A JAR file can be signed by multiple people by running the \f3jarsigner\fR command on the file multiple times and specifying the alias for a different person each time, as follows:
+-.sp
+-.nf
+-\f3jarsigner myBundle\&.jar susan\fP
+-.fi
+-.nf
+-\f3jarsigner myBundle\&.jar kevin\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-When a JAR file is signed multiple times, there are multiple \f3\&.SF\fR and \f3\&.DSA\fR files in the resulting JAR file, one pair for each signature\&. In the previous example, the output JAR file includes files with the following names:
+-.sp
+-.nf
+-\f3SUSAN\&.SF\fP
+-.fi
+-.nf
+-\f3SUSAN\&.DSA\fP
+-.fi
+-.nf
+-\f3KEVIN\&.SF\fP
+-.fi
+-.nf
+-\f3KEVIN\&.DSA\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-The following sections describe the various \f3jarsigner\fR options\&. Be aware of the following standards:
+-.TP 0.2i
+-\(bu
+-All option names are preceded by a minus sign (-)\&.
+-.TP 0.2i
+-\(bu
+-The options can be provided in any order\&.
+-.TP 0.2i
+-\(bu
+-Items that are in italics or underlined (option values) represent the actual values that must be supplied\&.
+-.TP 0.2i
+-\(bu
+-The \f3-storepass\fR, \f3-keypass\fR, \f3-sigfile\fR, \f3-sigalg\fR, \f3-digestalg\fR, \f3-signedjar\fR, and TSA-related options are only relevant when signing a JAR file; they are not relevant when verifying a signed JAR file\&. The \f3-keystore\fR option is relevant for signing and verifying a JAR file\&. In addition, aliases are specified when signing and verifying a JAR file\&.
+-.TP
+--keystore \fIurl\fR
+-.br
+-Specifies the URL that tells the keystore location\&. This defaults to the file \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
+-
+-A keystore is required when signing\&. You must explicitly specify a keystore when the default keystore does not exist or if you want to use one other than the default\&.
+-
+-A keystore is not required when verifying, but if one is specified or the default exists and the \f3-verbose\fR option was also specified, then additional information is output regarding whether or not any of the certificates used to verify the JAR file are contained in that keystore\&.
+-
+-The \f3-keystore\fR argument can be a file name and path specification rather than a URL, in which case it is treated the same as a file: URL, for example, the following are equivalent:
+-.sp
+-.nf
+-\f3\-keystore \fIfilePathAndName\fR\fP
+-.fi
+-.nf
+-\f3\-keystore file:\fIfilePathAndName\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-If the Sun PKCS #11 provider was configured in the \f3java\&.security\fR security properties file (located in the JRE\&'s \f3$JAVA_HOME/lib/security directory\fR), then the \f3keytool\fR and \f3jarsigner\fR tools can operate on the PKCS #11 token by specifying these options:
+-.sp
+-.nf
+-\f3\-keystore NONE\fP
+-.fi
+-.nf
+-\f3\-storetype PKCS11\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-For example, the following command lists the contents of the configured PKCS#11 token:
+-.sp
+-.nf
+-\f3keytool \-keystore NONE \-storetype PKCS11 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--storetype \fIstoretype\fR
+-.br
+-Specifies the type of keystore to be instantiated\&. The default keystore type is the one that is specified as the value of the \f3keystore\&.type\fR property in the security properties file, which is returned by the static \f3getDefaultType\fR method in \f3java\&.security\&.KeyStore\fR\&.
+-
+-The PIN for a PCKS #11 token can also be specified with the \f3-storepass\fR option\&. If none is specified, then the \f3keytool\fR and \f3jarsigner\fR commands prompt for the token PIN\&. If the token has a protected authentication path (such as a dedicated PIN-pad or a biometric reader), then the \f3-protected\fR option must be specified and no password options can be specified\&.
+-.TP
+--storepass[:env | :file] \fIargument\fR
+-.br
+-Specifies the password that is required to access the keystore\&. This is only needed when signing (not verifying) a JAR file\&. In that case, if a \f3-storepass\fR option is not provided at the command line, then the user is prompted for the password\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \fIargument\fR\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
+-.RE
+-
+-
+-\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
+-.TP
+--keypass [:env | :file] \fIargument\fR
+-.br
+-Specifies the password used to protect the private key of the keystore entry addressed by the alias specified on the command line\&. The password is required when using \f3jarsigner\fR to sign a JAR file\&. If no password is provided on the command line, and the required password is different from the store password, then the user is prompted for it\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \f3argument\fR\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
+-.RE
+-
+-
+-\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
+-.TP
+--sigfile \fIfile\fR
+-.br
+-Specifies the base file name to be used for the generated \f3\&.SF\fR and \f3\&.DSA\fR files\&. For example, if file is \f3DUKESIGN\fR, then the generated \f3\&.SF\fR and \f3\&.DSA\fR files are named \f3DUKESIGN\&.SF\fR and \f3DUKESIGN\&.DSA\fR, and placed in the \f3META-INF\fR directory of the signed JAR file\&.
+-
+-The characters in the file must come from the set \f3a-zA-Z0-9_-\fR\&. Only letters, numbers, underscore, and hyphen characters are allowed\&. All lowercase characters are converted to uppercase for the \f3\&.SF\fR and \f3\&.DSA\fR file names\&.
+-
+-If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to upper case\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not valid in a signature file name, then each such character is converted to an underscore (_) character to form the file name\&.
+-.TP
+--sigalg \fIalgorithm\fR
+-.br
+-Specifies the name of the signature algorithm to use to sign the JAR file\&.
+-
+-For a list of standard signature algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-
+-This algorithm must be compatible with the private key used to sign the JAR file\&. If this option is not specified, then \f3SHA1withDSA\fR, \f3SHA256withRSA\fR, or \f3SHA256withECDSA\fR are used depending on the type of private key\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
+-.TP
+--digestalg \fIalgorithm\fR
+-.br
+-Specifies the name of the message digest algorithm to use when digesting the entries of a JAR file\&.
+-
+-For a list of standard message digest algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-
+-If this option is not specified, then \f3SHA256\fR is used\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
+-.TP
+--certs
+-.br
+-If the \f3-certs\fR option appears on the command line with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. This information includes the name of the type of certificate (stored in the \f3\&.DSA\fR file) that certifies the signer\&'s public key, and if the certificate is an X\&.509 certificate (an instance of the \f3java\&.security\&.cert\&.X509Certificate\fR), then the distinguished name of the signer\&.
+-
+-The keystore is also examined\&. If no keystore value is specified on the command line, then the default keystore file (if any) is checked\&. If the public key certificate for a signer matches an entry in the keystore, then the alias name for the keystore entry for that signer is displayed in parentheses\&.
+-.TP
+--certchain \fIfile\fR
+-.br
+-Specifies the certificate chain to be used when the certificate chain associated with the private key of the keystore entry that is addressed by the alias specified on the command line is not complete\&. This can happen when the keystore is located on a hardware token where there is not enough capacity to hold a complete certificate chain\&. The file can be a sequence of concatenated X\&.509 certificates, or a single PKCS#7 formatted data block, either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. See Internet RFC 1421 Certificate Encoding Standard and http://tools\&.ietf\&.org/html/rfc1421\&.
+-.TP
+--verbose
+-.br
+-When the \f3-verbose\fR option appears on the command line, it indicates verbose mode, which causes \f3jarsigner\fR to output extra information about the progress of the JAR signing or verification\&.
+-.TP
+--internalsf
+-.br
+-In the past, the \f3\&.DSA\fR (signature block) file generated when a JAR file was signed included a complete encoded copy of the \f3\&.SF\fR file (signature file) also generated\&. This behavior has been changed\&. To reduce the overall size of the output JAR file, the \f3\&.DSA\fR file by default does not contain a copy of the \f3\&.SF\fR file anymore\&. If \f3-internalsf\fR appears on the command line, then the old behavior is utilized\&. This option is useful for testing\&. In practice, do not use the \f3-internalsf\fR option because it incurs higher overhead\&.
+-.TP
+--sectionsonly
+-.br
+-If the \f3-sectionsonly\fR option appears on the command line, then the \f3\&.SF\fR file (signature file) generated when a JAR file is signed does not include a header that contains a hash of the whole manifest file\&. It contains only the information and hashes related to each individual source file included in the JAR file\&. See Signature File\&.
+-
+-By default, this header is added, as an optimization\&. When the header is present, whenever the JAR file is verified, the verification can first check to see whether the hash in the header matches the hash of the whole manifest file\&. When there is a match, verification proceeds to the next step\&. When there is no match, it is necessary to do a less optimized verification that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See JAR File Verification\&.
+-
+-The \f3-sectionsonly\fR option is primarily used for testing\&. It should not be used other than for testing because using it incurs higher overhead\&.
+-.TP
+--protected
+-.br
+-Values can be either \f3true\fR or \f3false\fR\&. Specify \f3true\fR when a password must be specified through a protected authentication path such as a dedicated PIN reader\&.
+-.TP
+--providerClass \fIprovider-class-name\fR
+-.br
+-Used to specify the name of cryptographic service provider\&'s master class file when the service provider is not listed in the \f3java\&.security\fR security properties file\&.
+-
+-Used with the \f3-providerArg ConfigFilePath\fR option, the \f3keytool\fR and \f3jarsigner\fR tools install the provider dynamically and use \fIConfigFilePath\fR for the path to the token configuration file\&. The following example shows a command to list a \f3PKCS #11\fR keystore when the Oracle PKCS #11 provider was not configured in the security properties file\&.
+-.sp
+-.nf
+-\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerClass sun\&.security\&.pkcs11\&.SunPKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerArg /mydir1/mydir2/token\&.config \e\fP
+-.fi
+-.nf
+-\f3 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--providerName \fIproviderName\fR
+-.br
+-If more than one provider was configured in the \f3java\&.security\fR security properties file, then you can use the \f3-providerName\fR option to target a specific provider instance\&. The argument to this option is the name of the provider\&.
+-
+-For the Oracle PKCS #11 provider, \fIproviderName\fR is of the form \f3SunPKCS11-\fR\fITokenName\fR, where \fITokenName\fR is the name suffix that the provider instance has been configured with, as detailed in the configuration attributes table\&. For example, the following command lists the contents of the \f3PKCS #11\fR keystore provider instance with name suffix \f3SmartCard\fR:
+-.sp
+-.nf
+-\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerName SunPKCS11\-SmartCard \e\fP
+-.fi
+-.nf
+-\f3 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--J\fIjavaoption\fR
+-.br
+-Passes through the specified \fIjavaoption\fR string directly to the Java interpreter\&. The \f3jarsigner\fR command is a wrapper around the interpreter\&. This option should not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
+-.TP
+--tsa \fIurl\fR
+-.br
+-If \f3-tsa http://example\&.tsa\&.url\fR appears on the command line when signing a JAR file then a time stamp is generated for the signature\&. The URL, \f3http://example\&.tsa\&.url\fR, identifies the location of the Time Stamping Authority (TSA) and overrides any URL found with the \f3-tsacert\fR option\&. The \f3-tsa\fR option does not require the TSA public key certificate to be present in the keystore\&.
+-
+-To generate the time stamp, \f3jarsigner\fR communicates with the TSA with the Time-Stamp Protocol (TSP) defined in RFC 3161\&. When successful, the time stamp token returned by the TSA is stored with the signature in the signature block file\&.
+-.TP
+--tsacert \fIalias\fR
+-.br
+-When \f3-tsacert alias\fR appears on the command line when signing a JAR file, a time stamp is generated for the signature\&. The alias identifies the TSA public key certificate in the keystore that is in effect\&. The entry\&'s certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA\&.
+-
+-The TSA public key certificate must be present in the keystore when using the \f3-tsacert\fR option\&.
+-.TP
+--tsapolicyid \fIpolicyid\fR
+-.br
+-Specifies the object identifier (OID) that identifies the policy ID to be sent to the TSA server\&. If this option is not specified, no policy ID is sent and the TSA server will choose a default policy ID\&.
+-
+-Object identifiers are defined by X\&.696, which is an ITU Telecommunication Standardization Sector (ITU-T) standard\&. These identifiers are typically period-separated sets of non-negative digits like \f31\&.2\&.3\&.4\fR, for example\&.
+-.TP
+--altsigner \fIclass\fR
+-.br
+-This option specifies an alternative signing mechanism\&. The fully qualified class name identifies a class file that extends the \f3com\&.sun\&.jarsigner\&.ContentSigner\fR abstract class\&. The path to this class file is defined by the \f3-altsignerpath\fR option\&. If the \f3-altsigner\fR option is used, then the \f3jarsigner\fR command uses the signing mechanism provided by the specified class\&. Otherwise, the \f3jarsigner\fR command uses its default signing mechanism\&.
+-
+-For example, to use the signing mechanism provided by a class named \f3com\&.sun\&.sun\&.jarsigner\&.AuthSigner\fR, use the jarsigner option \f3-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fR\&.
+-.TP
+--altsignerpath \fIclasspathlist\fR
+-.br
+-Specifies the path to the class file and any JAR file it depends on\&. The class file name is specified with the \f3-altsigner\fR option\&. If the class file is in a JAR file, then this option specifies the path to that JAR file\&.
+-
+-An absolute path or a path relative to the current directory can be specified\&. If \fIclasspathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semicolon (;) on Windows\&. This option is not necessary when the class is already in the search path\&.
+-
+-The following example shows how to specify the path to a JAR file that contains the class file\&. The JAR file name is included\&.
+-.sp
+-.nf
+-\f3\-altsignerpath /home/user/lib/authsigner\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-The following example shows how to specify the path to the JAR file that contains the class file\&. The JAR file name is omitted\&.
+-.sp
+-.nf
+-\f3\-altsignerpath /home/user/classes/com/sun/tools/jarsigner/\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--strict
+-.br
+-During the signing or verifying process, the command may issue warning messages\&. If you specify this option, the exit code of the tool reflects the severe warning messages that this command found\&. See Errors and Warnings\&.
+-.TP
+--verbose \fIsuboptions\fR
+-.br
+-For the verifying process, the \f3-verbose\fR option takes suboptions to determine how much information is shown\&. If the \f3-certs\fR option is also specified, then the default mode (or suboption \f3all\fR) displays each entry as it is being processed, and after that, the certificate information for each signer of the JAR file\&. If the \f3-certs\fR and the \f3-verbose:grouped\fR suboptions are specified, then entries with the same signer info are grouped and displayed together with their certificate information\&. If \f3-certs\fR and the \f3-verbose:summary\fR suboptions are specified, then entries with the same signer information are grouped and displayed together with their certificate information\&. Details about each entry are summarized and displayed as \fIone entry (and more)\fR\&. See Examples\&.
+-.SH ERRORS\ AND\ WARNINGS
+-During the signing or verifying process, the \f3jarsigner\fR command may issue various errors or warnings\&.
+-.PP
+-If there is a failure, the \f3jarsigner\fR command exits with code 1\&. If there is no failure, but there are one or more severe warnings, the \f3jarsigner\fR command exits with code 0 when the \f3-strict\fR option is \fInot\fR specified, or exits with the OR-value of the warning codes when the \f3-strict\fR is specified\&. If there is only informational warnings or no warning at all, the command always exits with code 0\&.
+-.PP
+-For example, if a certificate used to sign an entry is expired and has a KeyUsage extension that does not allow it to sign a file, the \f3jarsigner\fR command exits with code 12 (=4+8) when the \f3-strict\fR option is specified\&.
+-.PP
+-\fINote:\fR Exit codes are reused because only the values from 0 to 255 are legal on Unix-based operating systems\&.
+-.PP
+-The following sections describes the names, codes, and descriptions of the errors and warnings that the \f3jarsigner\fR command can issue\&.
+-.SS FAILURE
+-Reasons why the \f3jarsigner\fR command fails include (but are not limited to) a command line parsing error, the inability to find a keypair to sign the JAR file, or the verification of a signed JAR fails\&.
+-.TP
+-failure
+-Code 1\&. The signing or verifying fails\&.
+-.SS SEVERE\ WARNINGS
+-\fINote:\fR Severe warnings are reported as errors if you specify the \f3-strict\fR option\&.
+-.PP
+-Reasons why the \f3jarsigner\fR command issues a severe warning include the certificate used to sign the JAR file has an error or the signed JAR file has other problems\&.
+-.TP
+-hasExpiredCert
+-Code 4\&. This jar contains entries whose signer certificate has expired\&.
+-.TP
+-notYetValidCert
+-Code 4\&. This jar contains entries whose signer certificate is not yet valid\&.
+-.TP
+-chainNotValidated
+-Code 4\&. This jar contains entries whose certificate chain cannot be correctly validated\&.
+-.TP
+-badKeyUsage
+-Code 8\&. This jar contains entries whose signer certificate\&'s KeyUsage extension doesn\&'t allow code signing\&.
+-.TP
+-badExtendedKeyUsage
+-Code 8\&. This jar contains entries whose signer certificate\&'s ExtendedKeyUsage extension doesn\&'t allow code signing\&.
+-.TP
+-badNetscapeCertType
+-Code 8\&. This jar contains entries whose signer certificate\&'s NetscapeCertType extension doesn\&'t allow code signing\&.
+-.TP
+-hasUnsignedEntry
+-Code 16\&. This jar contains unsigned entries which have not been integrity-checked\&.
+-.TP
+-notSignedByAlias
+-Code 32\&. This jar contains signed entries which are not signed by the specified alias(es)\&.
+-.TP
+-aliasNotInStore
+-Code 32\&. This jar contains signed entries that are not signed by alias in this keystore\&.
+-.SS INFORMATIONAL\ WARNINGS
+-Informational warnings include those that are not errors but regarded as bad practice\&. They do not have a code\&.
+-.TP
+-hasExpiringCert
+-This jar contains entries whose signer certificate will expire within six months\&.
+-.TP
+-noTimestamp
+-This jar contains signatures that does not include a timestamp\&. Without a timestamp, users may not be able to validate this JAR file after the signer certificate\&'s expiration date (\f3YYYY-MM-DD\fR) or after any future revocation date\&.
+-.SH EXAMPLES
+-.SS SIGN\ A\ JAR\ FILE
+-Use the following command to sign bundle\&.jar with the private key of a user whose keystore alias is \f3jane\fR in a keystore named \f3mystore\fR in the \f3working\fR directory and name the signed JAR file \f3sbundle\&.jar\fR:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore\fP
+-.fi
+-.nf
+-\f3 \-storepass <keystore password>\fP
+-.fi
+-.nf
+-\f3 \-keypass <private key password>\fP
+-.fi
+-.nf
+-\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There is no \f3-sigfile\fR specified in the previous command so the generated \f3\&.SF\fR and \f3\&.DSA\fR files to be placed in the signed JAR file have default names based on the alias name\&. They are named \f3JANE\&.SF\fR and \f3JANE\&.DSA\fR\&.
+-.PP
+-If you want to be prompted for the store password and the private key password, then you could shorten the previous command to the following:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore\fP
+-.fi
+-.nf
+-\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If the keystore is the default keystore (\&.keystore in your home directory), then you do not need to specify a keystore, as follows:
+-.sp
+-.nf
+-\f3jarsigner \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you want the signed JAR file to overwrite the input JAR file (bundle\&.jar), then you do not need to specify a \f3-signedjar\fR option, as follows:
+-.sp
+-.nf
+-\f3jarsigner bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS VERIFY\ A\ SIGNED\ JAR\ FILE
+-To verify a signed JAR file to ensure that the signature is valid and the JAR file was not been tampered with, use a command such as the following:
+-.sp
+-.nf
+-\f3jarsigner \-verify sbundle\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-When the verification is successful, \f3jar verified\fR is displayed\&. Otherwise, an error message is displayed\&. You can get more information when you use the \f3-verbose\fR option\&. A sample use of \f3jarsigner\fR with the\f3-verbose\fR option follows:
+-.sp
+-.nf
+-\f3jarsigner \-verify \-verbose sbundle\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
+-.fi
+-.nf
+-\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
+-.fi
+-.nf
+-\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 AclEx\&.class\fP
+-.fi
+-.nf
+-\f3 smk 849 Fri Sep 26 16:12:46 PDT 1997 test\&.class\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 s = signature was verified\fP
+-.fi
+-.nf
+-\f3 m = entry is listed in manifest\fP
+-.fi
+-.nf
+-\f3 k = at least one certificate was found in keystore\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 jar verified\&.\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS VERIFICATION\ WITH\ CERTIFICATE\ INFORMATION
+-If you specify the \f3-certs\fR option with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. The information includes the certificate type, the signer distinguished name information (when it is an X\&.509 certificate), and in parentheses, the keystore alias for the signer when the public key certificate in the JAR file matches the one in a keystore entry, for example:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore \-verify \-verbose \-certs myTest\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
+-.fi
+-.nf
+-\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
+-.fi
+-.nf
+-\f3 208 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.SF\fP
+-.fi
+-.nf
+-\f3 1087 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.DSA\fP
+-.fi
+-.nf
+-\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 Tst\&.class\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 X\&.509, CN=Test Group, OU=Java Software, O=Oracle, L=CUP, S=CA, C=US (javatest)\fP
+-.fi
+-.nf
+-\f3 X\&.509, CN=Jane Smith, OU=Java Software, O=Oracle, L=cup, S=ca, C=us (jane)\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 s = signature was verified\fP
+-.fi
+-.nf
+-\f3 m = entry is listed in manifest\fP
+-.fi
+-.nf
+-\f3 k = at least one certificate was found in keystore\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 jar verified\&.\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If the certificate for a signer is not an X\&.509 certificate, then there is no distinguished name information\&. In that case, just the certificate type and the alias are shown\&. For example, if the certificate is a PGP certificate, and the alias is \f3bob\fR, then you would get: \f3PGP, (bob)\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-keytool(1)
+-.TP 0.2i
+-\(bu
+-Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
++
++.SH NAME
++jarsigner \- Signs and verifies Java Archive (JAR) files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjarsigner\fR [ \fIoptions\fR ] \fIjar\-file\fR \fIalias\fR
++.fi
++.nf
++
++\fBjarsigner\fR \fB\-verify\fR [ \fIoptions\fR ] \fIjar\-file\fR [\fIalias \&.\&.\&.\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++-verify
++.br
++The \f3-verify\fR option can take zero or more keystore alias names after the JAR file name\&. When the \f3-verify\fR option is specified, the \f3jarsigner\fR command checks that the certificate used to verify each signed entry in the JAR file matches one of the keystore aliases\&. The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
++
++If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar verified, with signer errors" is displayed\&.
++.TP
++\fIjar-file\fR
++The JAR file to be signed\&.
++
++If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar signed, with signer errors" is displayed\&.
++.TP
++\fIalias\fR
++The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
++.SH DESCRIPTION
++The \f3jarsigner\fR tool has two purposes:
++.TP 0.2i
++\(bu
++To sign Java Archive (JAR) files\&.
++.TP 0.2i
++\(bu
++To verify the signatures and integrity of signed JAR files\&.
++.PP
++The JAR feature enables the packaging of class files, images, sounds, and other digital data in a single file for faster and easier distribution\&. A tool named \f3jar\fR enables developers to produce JAR files\&. (Technically, any zip file can also be considered a JAR file, although when created by the \f3jar\fR command or processed by the \f3jarsigner\fR command, JAR files also contain a \f3META-INF/MANIFEST\&.MF\fR file\&.)
++.PP
++A digital signature is a string of bits that is computed from some data (the data being signed) and the private key of an entity (a person, company, and so on)\&. Similar to a handwritten signature, a digital signature has many useful characteristics:
++.TP 0.2i
++\(bu
++Its authenticity can be verified by a computation that uses the public key corresponding to the private key used to generate the signature\&.
++.TP 0.2i
++\(bu
++It cannot be forged, assuming the private key is kept secret\&.
++.TP 0.2i
++\(bu
++It is a function of the data signed and thus cannot be claimed to be the signature for other data as well\&.
++.TP 0.2i
++\(bu
++The signed data cannot be changed\&. If the data is changed, then the signature cannot be verified as authentic\&.
++.PP
++To generate an entity\&'s signature for a file, the entity must first have a public/private key pair associated with it and one or more certificates that authenticate its public key\&. A certificate is a digitally signed statement from one entity that says that the public key of another entity has a particular value\&.
++.PP
++The \f3jarsigner\fR command uses key and certificate information from a keystore to generate digital signatures for JAR files\&. A keystore is a database of private keys and their associated X\&.509 certificate chains that authenticate the corresponding public keys\&. The \f3keytool\fR command is used to create and administer keystores\&.
++.PP
++The \f3jarsigner\fR command uses an entity\&'s private key to generate a signature\&. The signed JAR file contains, among other things, a copy of the certificate from the keystore for the public key corresponding to the private key used to sign the file\&. The \f3jarsigner\fR command can verify the digital signature of the signed JAR file using the certificate inside it (in its signature block file)\&.
++.PP
++The \f3jarsigner\fR command can generate signatures that include a time stamp that lets a systems or deployer (including Java Plug-in) to check whether the JAR file was signed while the signing certificate was still valid\&. In addition, APIs allow applications to obtain the timestamp information\&.
++.PP
++At this time, the \f3jarsigner\fR command can only sign JAR files created by the \f3jar\fR command or zip files\&. JAR files are the same as zip files, except they also have a \f3META-INF/MANIFEST\&.MF\fR file\&. A \f3META-INF/MANIFEST\&.MF\fR file is created when the \f3jarsigner\fR command signs a zip file\&.
++.PP
++The default \f3jarsigner\fR command behavior is to sign a JAR or zip file\&. Use the \f3-verify\fR option to verify a signed JAR file\&.
++.PP
++The \f3jarsigner\fR command also attempts to validate the signer\&'s certificate after signing or verifying\&. If there is a validation error or any other problem, the command generates warning messages\&. If you specify the \f3-strict\fR option, then the command treats severe warnings as errors\&. See Errors and Warnings\&.
++.SS KEYSTORE\ ALIASES
++All keystore entities are accessed with unique aliases\&.
++.PP
++When you use the \f3jarsigner\fR command to sign a JAR file, you must specify the alias for the keystore entry that contains the private key needed to generate the signature\&. For example, the following command signs the JAR file named \f3MyJARFile\&.jar\fR with the private key associated with the alias \f3duke\fR in the keystore named \f3mystore\fR in the \f3working\fR directory\&. Because no output file is specified, it overwrites \f3MyJARFile\&.jar\fR with the signed JAR file\&.
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore \-storepass <keystore password>\fP
++.fi
++.nf
++\f3 \-keypass <private key password> MyJARFile\&.jar duke\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Keystores are protected with a password, so the store password must be specified\&. You are prompted for it when you do not specify it on the command line\&. Similarly, private keys are protected in a keystore with a password, so the private key\&'s password must be specified, and you are prompted for the password when you do not specify it on the command line and it is not the same as the store password\&.
++.SS KEYSTORE\ LOCATION
++The \f3jarsigner\fR command has a \f3-keystore\fR option for specifying the URL of the keystore to be used\&. The keystore is by default stored in a file named \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
++.PP
++On Oracle Solaris systems, \f3user\&.home\fR defaults to the user\&'s home directory\&.
++.PP
++The input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified when the \f3KeyStore\fR class is not file based, for example, when it resides on a hardware token device\&.
++.SS KEYSTORE\ IMPLEMENTATION
++The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies a number of well-defined interfaces to access and modify the information in a keystore\&. You can have multiple different concrete implementations, where each implementation is for a particular type of keystore\&.
++.PP
++Currently, there are two command-line tools that use keystore implementations (\f3keytool\fR and \f3jarsigner\fR), and a GUI-based tool named Policy Tool\&. Because the \f3KeyStore\fR class is publicly available, JDK users can write additional security applications that use it\&.
++.PP
++There is a built-in default implementation provided by Oracle that implements the keystore as a file, that uses a proprietary keystore type (format) named JKS\&. The built-in implementation protects each private key with its individual password and protects the integrity of the entire keystore with a (possibly different) password\&.
++.PP
++Keystore implementations are provider-based, which means the application interfaces supplied by the \f3KeyStore\fR class are implemented in terms of a Service Provider Interface (SPI)\&. There is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, that defines the Service Provider Interface methods that providers must implement\&. The term provider refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
++.PP
++Applications can choose different types of keystore implementations from different providers, with the \f3getInstance\fR factory method in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself\&. Keystore implementations of different types are not compatible\&.
++.PP
++The \f3jarsigner\fR and \f3policytool\fR commands can read file-based keystores from any location that can be specified using a URL\&. In addition, these commands can read non-file-based keystores such as those provided by MSCAPI on Windows and PKCS11 on all platforms\&.
++.PP
++For the \f3jarsigner\fR and \f3keytool\fR commands, you can specify a keystore type at the command line with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIEdit\fR command in the \fIKeyStore\fR menu\&.
++.PP
++If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and it resides in the JDK security properties directory, \f3java\&.home/lib/security\fR, where \f3java\&.home\fR is the runtime environment\&'s directory\&. The \f3jre\fR directory in the JDK or the top-level directory of the Java Runtime Environment (JRE)\&.
++.PP
++Each tool gets the \f3keystore\&.type\fR value and then examines all the installed providers until it finds one that implements keystores of that type\&. It then uses the keystore implementation from that provider\&.
++.PP
++The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type property\fR:
++.sp
++.nf
++\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The default keystore type is \f3jks\fR (the proprietary type of the keystore implementation provided by Oracle)\&. This is specified by the following line in the security properties file:
++.sp
++.nf
++\f3keystore\&.type=jks\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Case does not matter in keystore type designations\&. For example, \f3JKS\fR is the same as \f3jks\fR\&.
++.PP
++To have the tools use a keystore implementation other than the default, change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
++.sp
++.nf
++\f3keystore\&.type=pkcs12\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++\fINote:\fR If you use the PKCS 11 provider package, then see "KeyTool" and "JarSigner" in Java PKCS #11 Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.html
++.SS SUPPORTED\ ALGORITHMS
++By default, the \f3jarsigner\fR command signs a JAR file using one of the following algorithms:
++.TP 0.2i
++\(bu
++Digital Signature Algorithm (DSA) with the SHA1 digest algorithm
++.TP 0.2i
++\(bu
++RSA algorithm with the SHA256 digest algorithm
++.TP 0.2i
++\(bu
++Elliptic Curve (EC) cryptography algorithm with the SHA256 with Elliptic Curve Digital Signature Algorithm (ECDSA)\&.
++.PP
++If the signer\&'s public and private keys are DSA keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA1withDSA\fR algorithm\&. If the signer\&'s keys are RSA keys, then \f3jarsigner\fR attempts to sign the JAR file with the \f3SHA256withRSA\fR algorithm\&. If the signer\&'s keys are EC keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA256withECDSA\fR algorithm\&.
++.PP
++These default signature algorithms can be overridden using the \f3-sigalg\fR option\&.
++.SS THE\ SIGNED\ JAR\ FILE
++When the \f3jarsigner\fR command is used to sign a JAR file, the output signed JAR file is exactly the same as the input JAR file, except that it has two additional files placed in the META-INF directory:
++.TP 0.2i
++\(bu
++A signature file with an \f3\&.SF\fR extension
++.TP 0.2i
++\(bu
++A signature block file with a \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR extension
++.PP
++The base file names for these two files come from the value of the \f3-sigFile\fR option\&. For example, when the option is \f3-sigFile MKSIGN\fR, the files are named \f3MKSIGN\&.SF\fR and \f3MKSIGN\&.DSA\fR
++.PP
++If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to uppercase\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not allowed in a signature file name, then each such character is converted to an underscore (_) character in forming the file name\&. Valid characters include letters, digits, underscores, and hyphens\&.
++.PP
++Signature File
++
++A signature file (\f3\&.SF\fR file) looks similar to the manifest file that is always included in a JAR file when the \f3jarsigner\fR command is used to sign the file\&. For each source file included in the JAR file, the \f3\&.SF\fR file has three lines, such as in the manifest file, that list the following:
++.TP 0.2i
++\(bu
++File name
++.TP 0.2i
++\(bu
++Name of the digest algorithm (SHA)
++.TP 0.2i
++\(bu
++SHA digest value
++.PP
++In the manifest file, the SHA digest value for each source file is the digest (hash) of the binary data in the source file\&. In the \f3\&.SF\fR file, the digest value for a specified source file is the hash of the three lines in the manifest file for the source file\&.
++.PP
++The signature file, by default, includes a header with a hash of the whole manifest file\&. The header also contains a hash of the manifest header\&. The presence of the header enables verification optimization\&. See JAR File Verification\&.
++.PP
++Signature Block File
++
++The \f3\&.SF\fR file is signed and the signature is placed in the signature block file\&. This file also contains, encoded inside it, the certificate or certificate chain from the keystore that authenticates the public key corresponding to the private key used for signing\&. The file has the extension \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR, depending on the digest algorithm used\&.
++.SS SIGNATURE\ TIME\ STAMP
++The \f3jarsigner\fR command can generate and store a signature time stamp when signing a JAR file\&. In addition, \f3jarsigner\fR supports alternative signing mechanisms\&. This behavior is optional and is controlled by the user at the time of signing through these options\&. See Options\&.
++.sp
++.nf
++\f3\-tsa \fIurl\fR\fP
++.fi
++.nf
++\f3\-tsacert \fIalias\fR\fP
++.fi
++.nf
++\f3\-altsigner \fIclass\fR\fP
++.fi
++.nf
++\f3\-altsignerpath \fIclasspathlist\fR\fP
++.fi
++.nf
++\f3\-tsapolicyid \fIpolicyid\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS JAR\ FILE\ VERIFICATION
++A successful JAR file verification occurs when the signatures are valid, and none of the files that were in the JAR file when the signatures were generated have changed since then\&. JAR file verification involves the following steps:
++.TP 0.4i
++1\&.
++Verify the signature of the \f3\&.SF\fR file\&.
++
++The verification ensures that the signature stored in each signature block (\f3\&.DSA\fR) file was generated using the private key corresponding to the public key whose certificate (or certificate chain) also appears in the \f3\&.DSA\fR file\&. It also ensures that the signature is a valid signature of the corresponding signature (\f3\&.SF\fR) file, and thus the \f3\&.SF\fR file was not tampered with\&.
++.TP 0.4i
++2\&.
++Verify the digest listed in each entry in the \f3\&.SF\fR file with each corresponding section in the manifest\&.
++
++The \f3\&.SF\fR file by default includes a header that contains a hash of the entire manifest file\&. When the header is present, the verification can check to see whether or not the hash in the header matches the hash of the manifest file\&. If there is a match, then verification proceeds to the next step\&.
++
++If there is no match, then a less optimized verification is required to ensure that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See Signature File\&.
++
++One reason the hash of the manifest file that is stored in the \f3\&.SF\fR file header might not equal the hash of the current manifest file is that one or more files were added to the JAR file (with the \f3jar\fR tool) after the signature and \f3\&.SF\fR file were generated\&. When the \f3jar\fR tool is used to add files, the manifest file is changed by adding sections to it for the new files, but the \f3\&.SF\fR file is not changed\&. A verification is still considered successful when none of the files that were in the JAR file when the signature was generated have been changed since then\&. This happens when the hashes in the non-header sections of the \f3\&.SF\fR file equal the hashes of the corresponding sections in the manifest file\&.
++.TP 0.4i
++3\&.
++Read each file in the JAR file that has an entry in the \f3\&.SF\fR file\&. While reading, compute the file\&'s digest and compare the result with the digest for this file in the manifest section\&. The digests should be the same or verification fails\&.
++
++If any serious verification failures occur during the verification process, then the process is stopped and a security exception is thrown\&. The \f3jarsigner\fR command catches and displays the exception\&.
++.PP
++\fINote:\fR You should read any addition warnings (or errors if you specified the \f3-strict\fR option), as well as the content of the certificate (by specifying the \f3-verbose\fR and \f3-certs\fR options) to determine if the signature can be trusted\&.
++.SS MULTIPLE\ SIGNATURES\ FOR\ A\ JAR\ FILE
++A JAR file can be signed by multiple people by running the \f3jarsigner\fR command on the file multiple times and specifying the alias for a different person each time, as follows:
++.sp
++.nf
++\f3jarsigner myBundle\&.jar susan\fP
++.fi
++.nf
++\f3jarsigner myBundle\&.jar kevin\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++When a JAR file is signed multiple times, there are multiple \f3\&.SF\fR and \f3\&.DSA\fR files in the resulting JAR file, one pair for each signature\&. In the previous example, the output JAR file includes files with the following names:
++.sp
++.nf
++\f3SUSAN\&.SF\fP
++.fi
++.nf
++\f3SUSAN\&.DSA\fP
++.fi
++.nf
++\f3KEVIN\&.SF\fP
++.fi
++.nf
++\f3KEVIN\&.DSA\fP
++.fi
++.sp
++.SH OPTIONS
++The following sections describe the various \f3jarsigner\fR options\&. Be aware of the following standards:
++.TP 0.2i
++\(bu
++All option names are preceded by a minus sign (-)\&.
++.TP 0.2i
++\(bu
++The options can be provided in any order\&.
++.TP 0.2i
++\(bu
++Items that are in italics or underlined (option values) represent the actual values that must be supplied\&.
++.TP 0.2i
++\(bu
++The \f3-storepass\fR, \f3-keypass\fR, \f3-sigfile\fR, \f3-sigalg\fR, \f3-digestalg\fR, \f3-signedjar\fR, and TSA-related options are only relevant when signing a JAR file; they are not relevant when verifying a signed JAR file\&. The \f3-keystore\fR option is relevant for signing and verifying a JAR file\&. In addition, aliases are specified when signing and verifying a JAR file\&.
++.TP
++-keystore \fIurl\fR
++.br
++Specifies the URL that tells the keystore location\&. This defaults to the file \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
++
++A keystore is required when signing\&. You must explicitly specify a keystore when the default keystore does not exist or if you want to use one other than the default\&.
++
++A keystore is not required when verifying, but if one is specified or the default exists and the \f3-verbose\fR option was also specified, then additional information is output regarding whether or not any of the certificates used to verify the JAR file are contained in that keystore\&.
++
++The \f3-keystore\fR argument can be a file name and path specification rather than a URL, in which case it is treated the same as a file: URL, for example, the following are equivalent:
++.sp
++.nf
++\f3\-keystore \fIfilePathAndName\fR\fP
++.fi
++.nf
++\f3\-keystore file:\fIfilePathAndName\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++If the Sun PKCS #11 provider was configured in the \f3java\&.security\fR security properties file (located in the JRE\&'s \f3$JAVA_HOME/lib/security directory\fR), then the \f3keytool\fR and \f3jarsigner\fR tools can operate on the PKCS #11 token by specifying these options:
++.sp
++.nf
++\f3\-keystore NONE\fP
++.fi
++.nf
++\f3\-storetype PKCS11\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++For example, the following command lists the contents of the configured PKCS#11 token:
++.sp
++.nf
++\f3keytool \-keystore NONE \-storetype PKCS11 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-storetype \fIstoretype\fR
++.br
++Specifies the type of keystore to be instantiated\&. The default keystore type is the one that is specified as the value of the \f3keystore\&.type\fR property in the security properties file, which is returned by the static \f3getDefaultType\fR method in \f3java\&.security\&.KeyStore\fR\&.
++
++The PIN for a PCKS #11 token can also be specified with the \f3-storepass\fR option\&. If none is specified, then the \f3keytool\fR and \f3jarsigner\fR commands prompt for the token PIN\&. If the token has a protected authentication path (such as a dedicated PIN-pad or a biometric reader), then the \f3-protected\fR option must be specified and no password options can be specified\&.
++.TP
++-storepass[:env | :file] \fIargument\fR
++.br
++Specifies the password that is required to access the keystore\&. This is only needed when signing (not verifying) a JAR file\&. In that case, if a \f3-storepass\fR option is not provided at the command line, then the user is prompted for the password\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \fIargument\fR\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
++.RE
++
++
++\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
++.TP
++-keypass [:env | :file] \fIargument\fR
++.br
++Specifies the password used to protect the private key of the keystore entry addressed by the alias specified on the command line\&. The password is required when using \f3jarsigner\fR to sign a JAR file\&. If no password is provided on the command line, and the required password is different from the store password, then the user is prompted for it\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \f3argument\fR\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
++.RE
++
++
++\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
++.TP
++-sigfile \fIfile\fR
++.br
++Specifies the base file name to be used for the generated \f3\&.SF\fR and \f3\&.DSA\fR files\&. For example, if file is \f3DUKESIGN\fR, then the generated \f3\&.SF\fR and \f3\&.DSA\fR files are named \f3DUKESIGN\&.SF\fR and \f3DUKESIGN\&.DSA\fR, and placed in the \f3META-INF\fR directory of the signed JAR file\&.
++
++The characters in the file must come from the set \f3a-zA-Z0-9_-\fR\&. Only letters, numbers, underscore, and hyphen characters are allowed\&. All lowercase characters are converted to uppercase for the \f3\&.SF\fR and \f3\&.DSA\fR file names\&.
++
++If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to upper case\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not valid in a signature file name, then each such character is converted to an underscore (_) character to form the file name\&.
++.TP
++-sigalg \fIalgorithm\fR
++.br
++Specifies the name of the signature algorithm to use to sign the JAR file\&.
++
++For a list of standard signature algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++
++This algorithm must be compatible with the private key used to sign the JAR file\&. If this option is not specified, then \f3SHA1withDSA\fR, \f3SHA256withRSA\fR, or \f3SHA256withECDSA\fR are used depending on the type of private key\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
++.TP
++-digestalg \fIalgorithm\fR
++.br
++Specifies the name of the message digest algorithm to use when digesting the entries of a JAR file\&.
++
++For a list of standard message digest algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++
++If this option is not specified, then \f3SHA256\fR is used\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
++.TP
++-certs
++.br
++If the \f3-certs\fR option appears on the command line with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. This information includes the name of the type of certificate (stored in the \f3\&.DSA\fR file) that certifies the signer\&'s public key, and if the certificate is an X\&.509 certificate (an instance of the \f3java\&.security\&.cert\&.X509Certificate\fR), then the distinguished name of the signer\&.
++
++The keystore is also examined\&. If no keystore value is specified on the command line, then the default keystore file (if any) is checked\&. If the public key certificate for a signer matches an entry in the keystore, then the alias name for the keystore entry for that signer is displayed in parentheses\&.
++.TP
++-certchain \fIfile\fR
++.br
++Specifies the certificate chain to be used when the certificate chain associated with the private key of the keystore entry that is addressed by the alias specified on the command line is not complete\&. This can happen when the keystore is located on a hardware token where there is not enough capacity to hold a complete certificate chain\&. The file can be a sequence of concatenated X\&.509 certificates, or a single PKCS#7 formatted data block, either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. See Internet RFC 1421 Certificate Encoding Standard and http://tools\&.ietf\&.org/html/rfc1421\&.
++.TP
++-verbose
++.br
++When the \f3-verbose\fR option appears on the command line, it indicates verbose mode, which causes \f3jarsigner\fR to output extra information about the progress of the JAR signing or verification\&.
++.TP
++-internalsf
++.br
++In the past, the \f3\&.DSA\fR (signature block) file generated when a JAR file was signed included a complete encoded copy of the \f3\&.SF\fR file (signature file) also generated\&. This behavior has been changed\&. To reduce the overall size of the output JAR file, the \f3\&.DSA\fR file by default does not contain a copy of the \f3\&.SF\fR file anymore\&. If \f3-internalsf\fR appears on the command line, then the old behavior is utilized\&. This option is useful for testing\&. In practice, do not use the \f3-internalsf\fR option because it incurs higher overhead\&.
++.TP
++-sectionsonly
++.br
++If the \f3-sectionsonly\fR option appears on the command line, then the \f3\&.SF\fR file (signature file) generated when a JAR file is signed does not include a header that contains a hash of the whole manifest file\&. It contains only the information and hashes related to each individual source file included in the JAR file\&. See Signature File\&.
++
++By default, this header is added, as an optimization\&. When the header is present, whenever the JAR file is verified, the verification can first check to see whether the hash in the header matches the hash of the whole manifest file\&. When there is a match, verification proceeds to the next step\&. When there is no match, it is necessary to do a less optimized verification that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See JAR File Verification\&.
++
++The \f3-sectionsonly\fR option is primarily used for testing\&. It should not be used other than for testing because using it incurs higher overhead\&.
++.TP
++-protected
++.br
++Values can be either \f3true\fR or \f3false\fR\&. Specify \f3true\fR when a password must be specified through a protected authentication path such as a dedicated PIN reader\&.
++.TP
++-providerClass \fIprovider-class-name\fR
++.br
++Used to specify the name of cryptographic service provider\&'s master class file when the service provider is not listed in the \f3java\&.security\fR security properties file\&.
++
++Used with the \f3-providerArg ConfigFilePath\fR option, the \f3keytool\fR and \f3jarsigner\fR tools install the provider dynamically and use \fIConfigFilePath\fR for the path to the token configuration file\&. The following example shows a command to list a \f3PKCS #11\fR keystore when the Oracle PKCS #11 provider was not configured in the security properties file\&.
++.sp
++.nf
++\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerClass sun\&.security\&.pkcs11\&.SunPKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerArg /mydir1/mydir2/token\&.config \e\fP
++.fi
++.nf
++\f3 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-providerName \fIproviderName\fR
++.br
++If more than one provider was configured in the \f3java\&.security\fR security properties file, then you can use the \f3-providerName\fR option to target a specific provider instance\&. The argument to this option is the name of the provider\&.
++
++For the Oracle PKCS #11 provider, \fIproviderName\fR is of the form \f3SunPKCS11-\fR\fITokenName\fR, where \fITokenName\fR is the name suffix that the provider instance has been configured with, as detailed in the configuration attributes table\&. For example, the following command lists the contents of the \f3PKCS #11\fR keystore provider instance with name suffix \f3SmartCard\fR:
++.sp
++.nf
++\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerName SunPKCS11\-SmartCard \e\fP
++.fi
++.nf
++\f3 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-J\fIjavaoption\fR
++.br
++Passes through the specified \fIjavaoption\fR string directly to the Java interpreter\&. The \f3jarsigner\fR command is a wrapper around the interpreter\&. This option should not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
++.TP
++-tsa \fIurl\fR
++.br
++If \f3-tsa http://example\&.tsa\&.url\fR appears on the command line when signing a JAR file then a time stamp is generated for the signature\&. The URL, \f3http://example\&.tsa\&.url\fR, identifies the location of the Time Stamping Authority (TSA) and overrides any URL found with the \f3-tsacert\fR option\&. The \f3-tsa\fR option does not require the TSA public key certificate to be present in the keystore\&.
++
++To generate the time stamp, \f3jarsigner\fR communicates with the TSA with the Time-Stamp Protocol (TSP) defined in RFC 3161\&. When successful, the time stamp token returned by the TSA is stored with the signature in the signature block file\&.
++.TP
++-tsacert \fIalias\fR
++.br
++When \f3-tsacert alias\fR appears on the command line when signing a JAR file, a time stamp is generated for the signature\&. The alias identifies the TSA public key certificate in the keystore that is in effect\&. The entry\&'s certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA\&.
++
++The TSA public key certificate must be present in the keystore when using the \f3-tsacert\fR option\&.
++.TP
++-tsapolicyid \fIpolicyid\fR
++.br
++Specifies the object identifier (OID) that identifies the policy ID to be sent to the TSA server\&. If this option is not specified, no policy ID is sent and the TSA server will choose a default policy ID\&.
++
++Object identifiers are defined by X\&.696, which is an ITU Telecommunication Standardization Sector (ITU-T) standard\&. These identifiers are typically period-separated sets of non-negative digits like \f31\&.2\&.3\&.4\fR, for example\&.
++.TP
++-altsigner \fIclass\fR
++.br
++This option specifies an alternative signing mechanism\&. The fully qualified class name identifies a class file that extends the \f3com\&.sun\&.jarsigner\&.ContentSigner\fR abstract class\&. The path to this class file is defined by the \f3-altsignerpath\fR option\&. If the \f3-altsigner\fR option is used, then the \f3jarsigner\fR command uses the signing mechanism provided by the specified class\&. Otherwise, the \f3jarsigner\fR command uses its default signing mechanism\&.
++
++For example, to use the signing mechanism provided by a class named \f3com\&.sun\&.sun\&.jarsigner\&.AuthSigner\fR, use the jarsigner option \f3-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fR\&.
++.TP
++-altsignerpath \fIclasspathlist\fR
++.br
++Specifies the path to the class file and any JAR file it depends on\&. The class file name is specified with the \f3-altsigner\fR option\&. If the class file is in a JAR file, then this option specifies the path to that JAR file\&.
++
++An absolute path or a path relative to the current directory can be specified\&. If \fIclasspathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semicolon (;) on Windows\&. This option is not necessary when the class is already in the search path\&.
++
++The following example shows how to specify the path to a JAR file that contains the class file\&. The JAR file name is included\&.
++.sp
++.nf
++\f3\-altsignerpath /home/user/lib/authsigner\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++The following example shows how to specify the path to the JAR file that contains the class file\&. The JAR file name is omitted\&.
++.sp
++.nf
++\f3\-altsignerpath /home/user/classes/com/sun/tools/jarsigner/\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-strict
++.br
++During the signing or verifying process, the command may issue warning messages\&. If you specify this option, the exit code of the tool reflects the severe warning messages that this command found\&. See Errors and Warnings\&.
++.TP
++-verbose \fIsuboptions\fR
++.br
++For the verifying process, the \f3-verbose\fR option takes suboptions to determine how much information is shown\&. If the \f3-certs\fR option is also specified, then the default mode (or suboption \f3all\fR) displays each entry as it is being processed, and after that, the certificate information for each signer of the JAR file\&. If the \f3-certs\fR and the \f3-verbose:grouped\fR suboptions are specified, then entries with the same signer info are grouped and displayed together with their certificate information\&. If \f3-certs\fR and the \f3-verbose:summary\fR suboptions are specified, then entries with the same signer information are grouped and displayed together with their certificate information\&. Details about each entry are summarized and displayed as \fIone entry (and more)\fR\&. See Examples\&.
++.SH ERRORS\ AND\ WARNINGS
++During the signing or verifying process, the \f3jarsigner\fR command may issue various errors or warnings\&.
++.PP
++If there is a failure, the \f3jarsigner\fR command exits with code 1\&. If there is no failure, but there are one or more severe warnings, the \f3jarsigner\fR command exits with code 0 when the \f3-strict\fR option is \fInot\fR specified, or exits with the OR-value of the warning codes when the \f3-strict\fR is specified\&. If there is only informational warnings or no warning at all, the command always exits with code 0\&.
++.PP
++For example, if a certificate used to sign an entry is expired and has a KeyUsage extension that does not allow it to sign a file, the \f3jarsigner\fR command exits with code 12 (=4+8) when the \f3-strict\fR option is specified\&.
++.PP
++\fINote:\fR Exit codes are reused because only the values from 0 to 255 are legal on Unix-based operating systems\&.
++.PP
++The following sections describes the names, codes, and descriptions of the errors and warnings that the \f3jarsigner\fR command can issue\&.
++.SS FAILURE
++Reasons why the \f3jarsigner\fR command fails include (but are not limited to) a command line parsing error, the inability to find a keypair to sign the JAR file, or the verification of a signed JAR fails\&.
++.TP
++failure
++Code 1\&. The signing or verifying fails\&.
++.SS SEVERE\ WARNINGS
++\fINote:\fR Severe warnings are reported as errors if you specify the \f3-strict\fR option\&.
++.PP
++Reasons why the \f3jarsigner\fR command issues a severe warning include the certificate used to sign the JAR file has an error or the signed JAR file has other problems\&.
++.TP
++hasExpiredCert
++Code 4\&. This jar contains entries whose signer certificate has expired\&.
++.TP
++notYetValidCert
++Code 4\&. This jar contains entries whose signer certificate is not yet valid\&.
++.TP
++chainNotValidated
++Code 4\&. This jar contains entries whose certificate chain cannot be correctly validated\&.
++.TP
++badKeyUsage
++Code 8\&. This jar contains entries whose signer certificate\&'s KeyUsage extension doesn\&'t allow code signing\&.
++.TP
++badExtendedKeyUsage
++Code 8\&. This jar contains entries whose signer certificate\&'s ExtendedKeyUsage extension doesn\&'t allow code signing\&.
++.TP
++badNetscapeCertType
++Code 8\&. This jar contains entries whose signer certificate\&'s NetscapeCertType extension doesn\&'t allow code signing\&.
++.TP
++hasUnsignedEntry
++Code 16\&. This jar contains unsigned entries which have not been integrity-checked\&.
++.TP
++notSignedByAlias
++Code 32\&. This jar contains signed entries which are not signed by the specified alias(es)\&.
++.TP
++aliasNotInStore
++Code 32\&. This jar contains signed entries that are not signed by alias in this keystore\&.
++.SS INFORMATIONAL\ WARNINGS
++Informational warnings include those that are not errors but regarded as bad practice\&. They do not have a code\&.
++.TP
++hasExpiringCert
++This jar contains entries whose signer certificate will expire within six months\&.
++.TP
++noTimestamp
++This jar contains signatures that does not include a timestamp\&. Without a timestamp, users may not be able to validate this JAR file after the signer certificate\&'s expiration date (\f3YYYY-MM-DD\fR) or after any future revocation date\&.
++.SH EXAMPLES
++.SS SIGN\ A\ JAR\ FILE
++Use the following command to sign bundle\&.jar with the private key of a user whose keystore alias is \f3jane\fR in a keystore named \f3mystore\fR in the \f3working\fR directory and name the signed JAR file \f3sbundle\&.jar\fR:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore\fP
++.fi
++.nf
++\f3 \-storepass <keystore password>\fP
++.fi
++.nf
++\f3 \-keypass <private key password>\fP
++.fi
++.nf
++\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There is no \f3-sigfile\fR specified in the previous command so the generated \f3\&.SF\fR and \f3\&.DSA\fR files to be placed in the signed JAR file have default names based on the alias name\&. They are named \f3JANE\&.SF\fR and \f3JANE\&.DSA\fR\&.
++.PP
++If you want to be prompted for the store password and the private key password, then you could shorten the previous command to the following:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore\fP
++.fi
++.nf
++\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If the keystore is the default keystore (\&.keystore in your home directory), then you do not need to specify a keystore, as follows:
++.sp
++.nf
++\f3jarsigner \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you want the signed JAR file to overwrite the input JAR file (bundle\&.jar), then you do not need to specify a \f3-signedjar\fR option, as follows:
++.sp
++.nf
++\f3jarsigner bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS VERIFY\ A\ SIGNED\ JAR\ FILE
++To verify a signed JAR file to ensure that the signature is valid and the JAR file was not been tampered with, use a command such as the following:
++.sp
++.nf
++\f3jarsigner \-verify sbundle\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++When the verification is successful, \f3jar verified\fR is displayed\&. Otherwise, an error message is displayed\&. You can get more information when you use the \f3-verbose\fR option\&. A sample use of \f3jarsigner\fR with the\f3-verbose\fR option follows:
++.sp
++.nf
++\f3jarsigner \-verify \-verbose sbundle\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
++.fi
++.nf
++\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
++.fi
++.nf
++\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 AclEx\&.class\fP
++.fi
++.nf
++\f3 smk 849 Fri Sep 26 16:12:46 PDT 1997 test\&.class\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 s = signature was verified\fP
++.fi
++.nf
++\f3 m = entry is listed in manifest\fP
++.fi
++.nf
++\f3 k = at least one certificate was found in keystore\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 jar verified\&.\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS VERIFICATION\ WITH\ CERTIFICATE\ INFORMATION
++If you specify the \f3-certs\fR option with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. The information includes the certificate type, the signer distinguished name information (when it is an X\&.509 certificate), and in parentheses, the keystore alias for the signer when the public key certificate in the JAR file matches the one in a keystore entry, for example:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore \-verify \-verbose \-certs myTest\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
++.fi
++.nf
++\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
++.fi
++.nf
++\f3 208 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.SF\fP
++.fi
++.nf
++\f3 1087 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.DSA\fP
++.fi
++.nf
++\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 Tst\&.class\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 X\&.509, CN=Test Group, OU=Java Software, O=Oracle, L=CUP, S=CA, C=US (javatest)\fP
++.fi
++.nf
++\f3 X\&.509, CN=Jane Smith, OU=Java Software, O=Oracle, L=cup, S=ca, C=us (jane)\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 s = signature was verified\fP
++.fi
++.nf
++\f3 m = entry is listed in manifest\fP
++.fi
++.nf
++\f3 k = at least one certificate was found in keystore\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 jar verified\&.\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If the certificate for a signer is not an X\&.509 certificate, then there is no distinguished name information\&. In that case, just the certificate type and the alias are shown\&. For example, if the certificate is a PGP certificate, and the alias is \f3bob\fR, then you would get: \f3PGP, (bob)\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++keytool(1)
++.TP 0.2i
++\(bu
++Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/java.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/java.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,7 +1,5 @@
+ '\" t
+-.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
+-.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++.\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/javac.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/javac.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Basic Tools
+-.\" Title: javac.1
+-.\"
+-.if n .pl 99999
+-.TH javac 1 "03 March 2015" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Basic Tools
++.\" Title: javac.1
++.\"
++.if n .pl 99999
++.TH javac 1 "03 March 2015" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,1322 +47,1322 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javac \- Reads Java class and interface definitions and compiles them into bytecode and class files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavac\fR [ \fIoptions\fR ] [ \fIsourcefiles\fR ] [ \fIclasses\fR] [ \fI@argfiles\fR ]
+-.fi
+-.sp
+-Arguments can be in any order:
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIsourcefiles\fR
+-One or more source files to be compiled (such as \f3MyClass\&.java\fR)\&.
+-.TP
+-\fIclasses\fR
+-One or more classes to be processed for annotations (such as \f3MyPackage\&.MyClass\fR)\&.
+-.TP
+-\fI@argfiles\fR
+-One or more files that list options and source files\&. The \f3-J\fR options are not allowed in these files\&. See Command-Line Argument Files\&.
+-.SH DESCRIPTION
+-The \f3javac\fR command reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files\&. The \f3javac\fR command can also process annotations in Java source files and classes\&.
+-.PP
+-There are two ways to pass source code file names to \f3javac\fR\&.
+-.TP 0.2i
+-\(bu
+-For a small number of source files, list the file names on the command line\&.
+-.TP 0.2i
+-\(bu
+-For a large number of source files, list the file names in a file that is separated by blanks or line breaks\&. Use the list file name preceded by an at sign (@) with the \f3javac\fR command\&.
+-.PP
+-Source code file names must have \&.java suffixes, class file names must have \&.class suffixes, and both source and class files must have root names that identify the class\&. For example, a class called \f3MyClass\fR would be written in a source file called \f3MyClass\&.java\fR and compiled into a bytecode class file called \f3MyClass\&.class\fR\&.
+-.PP
+-Inner class definitions produce additional class files\&. These class files have names that combine the inner and outer class names, such as \f3MyClass$MyInnerClass\&.class\fR\&.
+-.PP
+-Arrange source files in a directory tree that reflects their package tree\&. For example, if all of your source files are in \f3/workspace\fR, then put the source code for \f3com\&.mysoft\&.mypack\&.MyClass\fR in \f3/workspace/com/mysoft/mypack/MyClass\&.java\fR\&.
+-.PP
+-By default, the compiler puts each class file in the same directory as its source file\&. You can specify a separate destination directory with the \f3-d\fR option\&.
+-.SH OPTIONS
+-The compiler has a set of standard options that are supported on the current development environment\&. An additional set of nonstandard options are specific to the current virtual machine and compiler implementations and are subject to change in the future\&. Nonstandard options begin with the \f3-X\fR option\&.
+-.TP 0.2i
+-\(bu
+-See also Cross-Compilation Options
+-.TP 0.2i
+-\(bu
+-See also Nonstandard Options
+-.SS STANDARD\ OPTIONS
+-.TP
+--A\fIkey\fR[\fI=value\fR]
+-.br
+-Specifies options to pass to annotation processors\&. These options are not interpreted by \f3javac\fR directly, but are made available for use by individual processors\&. The \f3key\fR value should be one or more identifiers separated by a dot (\&.)\&.
+-.TP
+--cp \fIpath\fR or -classpath \fIpath\fR
+-.br
+-Specifies where to find user class files, and (optionally) annotation processors and source files\&. This class path overrides the user class path in the \f3CLASSPATH\fR environment variable\&. If neither \f3CLASSPATH\fR, \f3-cp\fR nor \f3-classpath\fR is specified, then the user \fIclass path\fR is the current directory\&. See Setting the Class Path\&.
+-
+-If the \f3-sourcepath\fR option is not specified, then the user class path is also searched for source files\&.
+-
+-If the \f3-processorpath\fR option is not specified, then the class path is also searched for annotation processors\&.
+-.TP
+--Djava\&.ext\&.dirs=\fIdirectories\fR
+-.br
+-Overrides the location of installed extensions\&.
+-.TP
+--Djava\&.endorsed\&.dirs=\fIdirectories\fR
+-.br
+-Overrides the location of the endorsed standards path\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Sets the destination directory for class files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then \f3javac\fR puts the class file in a subdirectory that reflects the package name and creates directories as needed\&.
+-
+-If you specify \f3-d\fR\f3/home/myclasses\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the class file is \f3/home/myclasses/com/mypackage/MyClass\&.class\fR\&.
+-
+-If the \fI-d\fR option is not specified, then \f3javac\fR puts each class file in the same directory as the source file from which it was generated\&.
+-
+-\fINote:\fR The directory specified by the \fI-d\fR option is not automatically added to your user class path\&.
+-.TP
+--deprecation
+-.br
+-Shows a description of each use or override of a deprecated member or class\&. Without the \f3-deprecation\fR option, \f3javac\fR shows a summary of the source files that use or override deprecated members or classes\&. The \f3-deprecation\fR option is shorthand for \f3-Xlint:deprecation\fR\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Sets the source file encoding name, such as EUC-JP and UTF-8\&. If the \f3-encoding\fR option is not specified, then the platform default converter is used\&.
+-.TP
+--endorseddirs \fIdirectories\fR
+-.br
+-Overrides the location of the endorsed standards path\&.
+-.TP
+--extdirs \fIdirectories\fR
+-.br
+-Overrides the location of the \f3ext\fR directory\&. The directories variable is a colon-separated list of directories\&. Each JAR file in the specified directories is searched for class files\&. All JAR files found become part of the class path\&.
+-
+-If you are cross-compiling (compiling classes against bootstrap and extension classes of a different Java platform implementation), then this option specifies the directories that contain the extension classes\&. See Cross-Compilation Options for more information\&.
+-.TP
+--g
+-.br
+-Generates all debugging information, including local variables\&. By default, only line number and source file information is generated\&.
+-.TP
+--g:none
+-.br
+-Does not generate any debugging information\&.
+-.TP
+--g:[\fIkeyword list\fR]
+-.br
+-Generates only some kinds of debugging information, specified by a comma separated list of keywords\&. Valid keywords are:
+-.RS
+-.TP
+-source
+-Source file debugging information\&.
+-.TP
+-lines
+-Line number debugging information\&.
+-.TP
+-vars
+-Local variable debugging information\&.
+-.RE
+-
+-.TP
+--help
+-.br
+-Prints a synopsis of standard options\&.
+-.TP
+--implicit:[\fIclass, none\fR]
+-.br
+-Controls the generation of class files for implicitly loaded source files\&. To automatically generate class files, use \f3-implicit:class\fR\&. To suppress class file generation, use \f3-implicit:none\fR\&. If this option is not specified, then the default is to automatically generate class files\&. In this case, the compiler issues a warning if any such class files are generated when also doing annotation processing\&. The warning is not issued when the \f3-implicit\fR option is set explicitly\&. See Searching for Types\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-
+-\fINote:\fR The \fICLASSPATH\fR, \f3-classpath\fR, \f3-bootclasspath\fR, and \f3-extdirs\fR options do not specify the classes used to run \f3javac\fR\&. Trying to customize the compiler implementation with these options and variables is risky and often does not accomplish what you want\&. If you must customize the complier implementation, then use the \f3-J\fR option to pass options through to the underlying \f3\fRJava launcher\&.
+-.TP
+--nowarn
+-.br
+-Disables warning messages\&. This option operates the same as the \f3-Xlint:none\fR option\&.
+-.TP
+--parameters
+-.br
+-Stores formal parameter names of constructors and methods in the generated class file so that the method \f3java\&.lang\&.reflect\&.Executable\&.getParameters\fR from the Reflection API can retrieve them\&.
+-.TP
+--proc: [\fInone\fR, \fIonly\fR]
+-.br
+-Controls whether annotation processing and compilation are done\&. \f3-proc:none\fR means that compilation takes place without annotation processing\&. \f3-proc:only\fR means that only annotation processing is done, without any subsequent compilation\&.
+-.TP
+--processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.]
+-.br
+-Names of the annotation processors to run\&. This bypasses the default discovery process\&.
+-.TP
+--processorpath \fIpath\fR
+-.br
+-Specifies where to find annotation processors\&. If this option is not used, then the class path is searched for processors\&.
+-.TP
+--s \fIdir\fR
+-.br
+-Specifies the directory where to place the generated source files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then the compiler puts the source file in a subdirectory that reflects the package name and creates directories as needed\&.
+-
+-If you specify \f3-s /home/mysrc\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the source file is put in \f3/home/mysrc/com/mypackage/MyClass\&.java\fR\&.
+-.TP
+--source \fIrelease\fR
+-.br
+-Specifies the version of source code accepted\&. The following values for \f3release\fR are allowed:
+-.RS
+-.TP
+-1\&.3
+-The compiler does not support assertions, generics, or other language features introduced after Java SE 1\&.3\&.
+-.TP
+-1\&.4
+-The compiler accepts code containing assertions, which were introduced in Java SE 1\&.4\&.
+-.TP
+-1\&.5
+-The compiler accepts code containing generics and other language features introduced in Java SE 5\&.
+-.TP
+-5
+-Synonym for 1\&.5\&.
+-.TP
+-1\&.6
+-No language changes were introduced in Java SE 6\&. However, encoding errors in source files are now reported as errors instead of warnings as in earlier releases of Java Platform, Standard Edition\&.
+-.TP
+-6
+-Synonym for 1\&.6\&.
+-.TP
+-1\&.7
+-The compiler accepts code with features introduced in Java SE 7\&.
+-.TP
+-7
+-Synonym for 1\&.7\&.
+-.TP
+-1\&.8
+-This is the default value\&. The compiler accepts code with features introduced in Java SE 8\&.
+-.TP
+-8
+-Synonym for 1\&.8\&.
+-.RE
+-
+-.TP
+--sourcepath \fIsourcepath\fR
+-.br
+-Specifies the source code path to search for class or interface definitions\&. As with the user class path, source path entries are separated by colons (:) on Oracle Solaris and semicolons on Windows and can be directories, JAR archives, or ZIP archives\&. If packages are used, then the local path name within the directory or archive must reflect the package name\&.
+-
+-\fINote:\fR Classes found through the class path might be recompiled when their source files are also found\&. See Searching for Types\&.
+-.TP
+--verbose
+-.br
+-Uses verbose output, which includes information about each class loaded and each source file compiled\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--werror
+-.br
+-Terminates compilation when warnings occur\&.
+-.TP
+--X
+-.br
+-Displays information about nonstandard options and exits\&.
+-.SS CROSS-COMPILATION\ OPTIONS
+-By default, classes are compiled against the bootstrap and extension classes of the platform that \f3javac\fR shipped with\&. But \f3javac\fR also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation\&. It is important to use the \f3-bootclasspath\fR and \f3-extdirs\fR options when cross-compiling\&.
+-.TP
+--target \fIversion\fR
+-.br
+-Generates class files that target a specified release of the virtual machine\&. Class files will run on the specified target and on later releases, but not on earlier releases of the JVM\&. Valid targets are 1\&.1, 1\&.2, 1\&.3, 1\&.4, 1\&.5 (also 5), 1\&.6 (also 6), 1\&.7 (also 7), and 1\&.8 (also 8)\&.
+-
+-The default for the \f3-target\fR option depends on the value of the \f3-source\fR option:
+-.RS
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is not specified, then the value of the \f3-target\fR option is 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.2, then the value of the \f3-target\fR option is 1\&.4
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.3, then the value of the \f3-target\fR option is 1\&.4
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.5, then the value of the \f3-target\fR option is 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.6, then the value of the \f3-target\fR is option 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.7, then the value of the \f3-target\fR is option 1\&.8
+-.TP 0.2i
+-\(bu
+-For all other values of the \f3-source\fR option, the value of the \f3-target\fR option is the value of the \f3-source\fR option\&.
+-.RE
+-
+-.TP
+--bootclasspath \fIbootclasspath\fR
+-.br
+-Cross-compiles against the specified set of boot classes\&. As with the user class path, boot class path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives\&.
+-.SS COMPACT\ PROFILE\ OPTION
+-Beginning with JDK 8, the \f3javac\fR compiler supports compact profiles\&. With compact profiles, applications that do not require the entire Java platform can be deployed and run with a smaller footprint\&. The compact profiles feature could be used to shorten the download time for applications from app stores\&. This feature makes for more compact deployment of Java applications that bundle the JRE\&. This feature is also useful in small devices\&.
+-.PP
+-The supported profile values are \f3compact1\fR, \f3compact2\fR, and \f3compact3\fR\&. These are additive layers\&. Each higher-numbered compact profile contains all of the APIs in profiles with smaller number names\&.
+-.TP
+--profile
+-.br
+-When using compact profiles, this option specifies the profile name when compiling\&. For example:
+-.sp
+-.nf
+-\f3javac \-profile compact1 Hello\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-javac does not compile source code that uses any Java SE APIs that is not in the specified profile\&. Here is an example of the error message that results from attempting to compile such source code:
+-.sp
+-.nf
+-\f3cd jdk1\&.8\&.0/bin\fP
+-.fi
+-.nf
+-\f3\&./javac \-profile compact1 Paint\&.java\fP
+-.fi
+-.nf
+-\f3Paint\&.java:5: error: Applet is not available in profile \&'compact1\&'\fP
+-.fi
+-.nf
+-\f3import java\&.applet\&.Applet;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-In this example, you can correct the error by modifying the source to not use the \f3Applet\fR class\&. You could also correct the error by compiling without the -profile option\&. Then the compilation would be run against the full set of Java SE APIs\&. (None of the compact profiles include the \f3Applet\fR class\&.)
+-
+-An alternative way to compile with compact profiles is to use the \f3-bootclasspath\fR option to specify a path to an \f3rt\&.jar\fR file that specifies a profile\&'s image\&. Using the \f3-profile\fR option instead does not require a profile image to be present on the system at compile time\&. This is useful when cross-compiling\&.
+-.SS NONSTANDARD\ OPTIONS
+-.TP
+--Xbootclasspath/p:\fIpath\fR
+-.br
+-Adds a suffix to the bootstrap class path\&.
+-.TP
+--Xbootclasspath/a:\fIpath\fR
+-.br
+-Adds a prefix to the bootstrap class path\&.
+-.TP
+--Xbootclasspath/:\fIpath\fR
+-.br
+-Overrides the location of the bootstrap class files\&.
+-.TP
+--Xdoclint:[-]\fIgroup\fR [\fI/access\fR]
+-.br
+-Enables or disables specific groups of checks, where \fIgroup\fR is one of the following values: \f3accessibility\fR, \f3syntax\fR, \f3reference\fR, \f3html\fR or \f3missing\fR\&. For more information about these groups of checks see the \f3-Xdoclint\fR option of the \f3javadoc\fR command\&. The \f3-Xdoclint\fR option is disabled by default in the \f3javac\fR command\&.
+-
+-The variable \fIaccess\fR specifies the minimum visibility level of classes and members that the \f3-Xdoclint\fR option checks\&. It can have one of the following values (in order of most to least visible) : \f3public\fR, \f3protected\fR, \f3package\fR and \f3private\fR\&. For example, the following option checks classes and members (with all groups of checks) that have the access level protected and higher (which includes protected, package and public):
+-.sp
+-.nf
+-\f3\-Xdoclint:all/protected\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following option enables all groups of checks for all access levels, except it will not check for HTML errors for classes and members that have access level package and higher (which includes package and public):
+-.sp
+-.nf
+-\f3\-Xdoclint:all,\-html/package\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--Xdoclint:none
+-.br
+-Disables all groups of checks\&.
+-.TP
+--Xdoclint:all[\fI/access\fR]
+-.br
+-Enables all groups of checks\&.
+-.TP
+--Xlint
+-.br
+-\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
+-.TP
+--Xlint:all
+-.br
+-\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
+-.TP
+--Xlint:none
+-.br
+-Disables all warnings\&.
+-.TP
+--Xlint:\fIname\fR
+-.br
+-Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option for a list of warnings you can disable with this option\&.
+-.TP
+--Xlint:\fI-name\fR
+-.br
+-Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option with the \f3-Xlint\fR option to get a list of warnings that you can disable with this option\&.
+-.TP
+--Xmaxerrs \fInumber\fR
+-.br
+-Sets the maximum number of errors to print\&.
+-.TP
+--Xmaxwarns \fInumber\fR
+-.br
+-Sets the maximum number of warnings to print\&.
+-.TP
+--Xstdout \fIfilename\fR
+-.br
+-Sends compiler messages to the named file\&. By default, compiler messages go to \f3System\&.err\fR\&.
+-.TP
+--Xprefer:[\fInewer,source\fR]
+-.br
+-Specifies which file to read when both a source file and class file are found for a type\&. (See Searching for Types)\&. If the \f3-Xprefer:newer\fR option is used, then it reads the newer of the source or class file for a type (default)\&. If the \f3-Xprefer:source\fR option is used, then it reads the source file\&. Use -\f3Xprefer:source\fR when you want to be sure that any annotation processors can access annotations declared with a retention policy of \f3SOURCE\fR\&.
+-.TP
+--Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR]
+-.br
+-Control whether javac generates \f3package-info\&.class\fR files from package-info\&.java files\&. Possible mode arguments for this option include the following\&.
+-.RS
+-.TP
+-always
+-Always generate a \f3package-info\&.class\fR file for every \f3package-info\&.java\fR file\&. This option may be useful if you use a build system such as Ant, which checks that each \f3\&.java\fR file has a corresponding \f3\&.class\fR file\&.
+-.TP
+-legacy
+-Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations\&. Don\&'t generate a \f3package-info\&.class\fR file if package-info\&.java only contains comments\&.
+-
+-\fINote:\fR A \f3package-info\&.class\fR file might be generated but be empty if all the annotations in the package-info\&.java file have \f3RetentionPolicy\&.SOURCE\fR\&.
+-.TP
+-nonempty
+-Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations with \f3RetentionPolicy\&.CLASS\fR or \f3RetentionPolicy\&.RUNTIME\fR\&.
+-.RE
+-
+-.TP
+--Xprint
+-.br
+-Prints a textual representation of specified types for debugging purposes\&. Perform neither annotation processing nor compilation\&. The format of the output could change\&.
+-.TP
+--XprintProcessorInfo
+-.br
+-Prints information about which annotations a processor is asked to process\&.
+-.TP
+--XprintRounds
+-.br
+-Prints information about initial and subsequent annotation processing rounds\&.
+-.SH ENABLE\ OR\ DISABLE\ WARNINGS\ WITH\ THE\ -XLINT\ OPTION
+-Enable warning \fIname\fR with the \f3-Xlint:name\fR option, where \f3name\fR is one of the following warning names\&. Note that you can disable a warning with the \f3-Xlint:-name:\fR option\&.
+-.TP
+-cast
+-Warns about unnecessary and redundant casts, for example:
+-.sp
+-.nf
+-\f3String s = (String) "Hello!"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-classfile
+-Warns about issues related to class file contents\&.
+-.TP
+-deprecation
+-Warns about the use of deprecated items, for example:
+-.sp
+-.nf
+-\f3java\&.util\&.Date myDate = new java\&.util\&.Date();\fP
+-.fi
+-.nf
+-\f3int currentDay = myDate\&.getDay();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The method \f3java\&.util\&.Date\&.getDay\fR has been deprecated since JDK 1\&.1
+-.TP
+-dep-ann
+-Warns about items that are documented with an \f3@deprecated\fR Javadoc comment, but do not have a \f3@Deprecated\fR annotation, for example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @deprecated As of Java SE 7, replaced by {@link #newMethod()}\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public static void deprecatedMethood() { }\fP
+-.fi
+-.nf
+-\f3public static void newMethod() { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-divzero
+-Warns about division by the constant integer 0, for example:
+-.sp
+-.nf
+-\f3int divideByZero = 42 / 0;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-empty
+-Warns about empty statements after \f3if\fRstatements, for example:
+-.sp
+-.nf
+-\f3class E {\fP
+-.fi
+-.nf
+-\f3 void m() {\fP
+-.fi
+-.nf
+-\f3 if (true) ;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-fallthrough
+-Checks the switch blocks for fall-through cases and provides a warning message for any that are found\&. Fall-through cases are cases in a switch block, other than the last case in the block, whose code does not include a break statement, allowing code execution to fall through from that case to the next case\&. For example, the code following the case 1 label in this switch block does not end with a break statement:
+-.sp
+-.nf
+-\f3switch (x) {\fP
+-.fi
+-.nf
+-\f3case 1:\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("1");\fP
+-.fi
+-.nf
+-\f3 // No break statement here\&.\fP
+-.fi
+-.nf
+-\f3case 2:\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("2");\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the \f3-Xlint:fallthrough\fR option was used when compiling this code, then the compiler emits a warning about possible fall-through into case, with the line number of the case in question\&.
+-.TP
+-finally
+-Warns about \f3finally\fR clauses that cannot complete normally, for example:
+-.sp
+-.nf
+-\f3public static int m() {\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3 throw new NullPointerException();\fP
+-.fi
+-.nf
+-\f3 } catch (NullPointerException(); {\fP
+-.fi
+-.nf
+-\f3 System\&.err\&.println("Caught NullPointerException\&.");\fP
+-.fi
+-.nf
+-\f3 return 1;\fP
+-.fi
+-.nf
+-\f3 } finally {\fP
+-.fi
+-.nf
+-\f3 return 0;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates a warning for the \f3finally\fR block in this example\&. When the \f3int\fR method is called, it returns a value of 0\&. A \f3finally\fR block executes when the \f3try\fR block exits\&. In this example, when control is transferred to the \f3catch\fR block, the \f3int\fR method exits\&. However, the \f3finally\fR block must execute, so it is executed, even though control was transferred outside the method\&.
+-.TP
+-options
+-Warns about issues that related to the use of command-line options\&. See Cross-Compilation Options\&.
+-.TP
+-overrides
+-Warns about issues regarding method overrides\&. For example, consider the following two classes:
+-.sp
+-.nf
+-\f3public class ClassWithVarargsMethod {\fP
+-.fi
+-.nf
+-\f3 void varargsMethod(String\&.\&.\&. s) { }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class ClassWithOverridingMethod extends ClassWithVarargsMethod {\fP
+-.fi
+-.nf
+-\f3 @Override\fP
+-.fi
+-.nf
+-\f3 void varargsMethod(String[] s) { }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates a warning similar to the following:\&.
+-.sp
+-.nf
+-\f3warning: [override] varargsMethod(String[]) in ClassWithOverridingMethod \fP
+-.fi
+-.nf
+-\f3overrides varargsMethod(String\&.\&.\&.) in ClassWithVarargsMethod; overriding\fP
+-.fi
+-.nf
+-\f3method is missing \&'\&.\&.\&.\&'\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler encounters a \f3varargs\fR method, it translates the \f3varargs\fR formal parameter into an array\&. In the method \f3ClassWithVarargsMethod\&.varargsMethod\fR, the compiler translates the \f3varargs\fR formal parameter \f3String\&.\&.\&. s\fR to the formal parameter \f3String[] s\fR, an array, which matches the formal parameter of the method \f3ClassWithOverridingMethod\&.varargsMethod\fR\&. Consequently, this example compiles\&.
+-.TP
+-path
+-Warns about invalid path elements and nonexistent path directories on the command line (with regard to the class path, the source path, and other paths)\&. Such warnings cannot be suppressed with the \f3@SuppressWarnings\fR annotation, for example:
+-.sp
+-.nf
+-\f3javac \-Xlint:path \-classpath /nonexistentpath Example\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-processing
+-Warn about issues regarding annotation processing\&. The compiler generates this warning when you have a class that has an annotation, and you use an annotation processor that cannot handle that type of exception\&. For example, the following is a simple annotation processor:
+-
+-\fISource file AnnocProc\&.java\fR:
+-.sp
+-.nf
+-\f3import java\&.util\&.*;\fP
+-.fi
+-.nf
+-\f3import javax\&.annotation\&.processing\&.*;\fP
+-.fi
+-.nf
+-\f3import javax\&.lang\&.model\&.*;\fP
+-.fi
+-.nf
+-\f3import\&.javaz\&.lang\&.model\&.element\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@SupportedAnnotationTypes("NotAnno")\fP
+-.fi
+-.nf
+-\f3public class AnnoProc extends AbstractProcessor {\fP
+-.fi
+-.nf
+-\f3 public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv){\fP
+-.fi
+-.nf
+-\f3 return true;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public SourceVersion getSupportedSourceVersion() {\fP
+-.fi
+-.nf
+-\f3 return SourceVersion\&.latest();\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fISource file AnnosWithoutProcessors\&.java\fR:
+-.sp
+-.nf
+-\f3@interface Anno { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@Anno\fP
+-.fi
+-.nf
+-\f3class AnnosWithoutProcessors { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following commands compile the annotation processor \f3AnnoProc\fR, then run this annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR:
+-.sp
+-.nf
+-\f3javac AnnoProc\&.java\fP
+-.fi
+-.nf
+-\f3javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutProcessors\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler runs the annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR, it generates the following warning:
+-.sp
+-.nf
+-\f3warning: [processing] No processor claimed any of these annotations: Anno\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To resolve this issue, you can rename the annotation defined and used in the class \f3AnnosWithoutProcessors\fR from \f3Anno\fR to \f3NotAnno\fR\&.
+-.TP
+-rawtypes
+-Warns about unchecked operations on raw types\&. The following statement generates a \f3rawtypes\fR warning:
+-.sp
+-.nf
+-\f3void countElements(List l) { \&.\&.\&. }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following example does not generate a \f3rawtypes\fR warning
+-.sp
+-.nf
+-\f3void countElements(List<?> l) { \&.\&.\&. }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\f3List\fR is a raw type\&. However, \f3List<?>\fR is an unbounded wildcard parameterized type\&. Because \f3List\fR is a parameterized interface, always specify its type argument\&. In this example, the \f3List\fR formal argument is specified with an unbounded wildcard (\f3?\fR) as its formal type parameter, which means that the \f3countElements\fR method can accept any instantiation of the \f3List\fR interface\&.
+-.TP
+-Serial
+-Warns about missing \f3serialVersionUID\fR definitions on serializable classes, for example:
+-.sp
+-.nf
+-\f3public class PersistentTime implements Serializable\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 private Date time;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public PersistentTime() {\fP
+-.fi
+-.nf
+-\f3 time = Calendar\&.getInstance()\&.getTime();\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public Date getTime() {\fP
+-.fi
+-.nf
+-\f3 return time;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates the following warning:
+-.sp
+-.nf
+-\f3warning: [serial] serializable class PersistentTime has no definition of\fP
+-.fi
+-.nf
+-\f3serialVersionUID\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If a serializable class does not explicitly declare a field named \f3serialVersionUID\fR, then the serialization runtime environment calculates a default \f3serialVersionUID\fR value for that class based on various aspects of the class, as described in the Java Object Serialization Specification\&. However, it is strongly recommended that all serializable classes explicitly declare \f3serialVersionUID\fR values because the default process of computing \f3serialVersionUID\fR vales is highly sensitive to class details that can vary depending on compiler implementations, and as a result, might cause an unexpected \f3InvalidClassExceptions\fR during deserialization\&. To guarantee a consistent \f3serialVersionUID\fR value across different Java compiler implementations, a serializable class must declare an explicit \f3serialVersionUID\fR value\&.
+-.TP
+-static
+-Warns about issues relating to the use of statics, for example:
+-.sp
+-.nf
+-\f3class XLintStatic {\fP
+-.fi
+-.nf
+-\f3 static void m1() { }\fP
+-.fi
+-.nf
+-\f3 void m2() { this\&.m1(); }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates the following warning:
+-.sp
+-.nf
+-\f3warning: [static] static method should be qualified by type name, \fP
+-.fi
+-.nf
+-\f3XLintStatic, instead of by an expression\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To resolve this issue, you can call the \f3static\fR method \f3m1\fR as follows:
+-.sp
+-.nf
+-\f3XLintStatic\&.m1();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Alternately, you can remove the \f3static\fR keyword from the declaration of the method \f3m1\fR\&.
+-.TP
+-try
+-Warns about issues relating to use of \f3try\fR blocks, including try-with-resources statements\&. For example, a warning is generated for the following statement because the resource \f3ac\fR declared in the \f3try\fR block is not used:
+-.sp
+-.nf
+-\f3try ( AutoCloseable ac = getResource() ) { // do nothing}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-unchecked
+-Gives more detail for unchecked conversion warnings that are mandated by the Java Language Specification, for example:
+-.sp
+-.nf
+-\f3List l = new ArrayList<Number>();\fP
+-.fi
+-.nf
+-\f3List<String> ls = l; // unchecked warning\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-During type erasure, the types \f3ArrayList<Number>\fR and \f3List<String>\fR become \f3ArrayList\fR and \f3List\fR, respectively\&.
+-
+-The \f3ls\fR command has the parameterized type \f3List<String>\fR\&. When the \f3List\fR referenced by \f3l\fR is assigned to \f3ls\fR, the compiler generates an unchecked warning\&. At compile time, the compiler and JVM cannot determine whether \f3l\fR refers to a \f3List<String>\fR type\&. In this case, \f3l\fR does not refer to a \f3List<String>\fR type\&. As a result, heap pollution occurs\&.
+-
+-A heap pollution situation occurs when the \f3List\fR object \f3l\fR, whose static type is \f3List<Number>\fR, is assigned to another \f3List\fR object, \f3ls\fR, that has a different static type, \f3List<String>\fR\&. However, the compiler still allows this assignment\&. It must allow this assignment to preserve backward compatibility with releases of Java SE that do not support generics\&. Because of type erasure, \f3List<Number>\fR and \f3List<String>\fR both become \f3List\fR\&. Consequently, the compiler allows the assignment of the object \f3l\fR\f3,\fR which has a raw type of \f3List\fR, to the object \f3ls\fR\&.
+-.TP
+-varargs
+-Warns about unsafe usages of variable arguments (\f3varargs\fR) methods, in particular, those that contain non-reifiable arguments, for example:
+-.sp
+-.nf
+-\f3public class ArrayBuilder {\fP
+-.fi
+-.nf
+-\f3 public static <T> void addToList (List<T> listArg, T\&.\&.\&. elements) {\fP
+-.fi
+-.nf
+-\f3 for (T x : elements) {\fP
+-.fi
+-.nf
+-\f3 listArg\&.add(x);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR A non-reifiable type is a type whose type information is not fully available at runtime\&.
+-
+-The compiler generates the following warning for the definition of the method \f3ArrayBuilder\&.addToList\fR
+-.sp
+-.nf
+-\f3warning: [varargs] Possible heap pollution from parameterized vararg type T\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler encounters a varargs method, it translates the \f3varargs\fR formal parameter into an array\&. However, the Java programming language does not permit the creation of arrays of parameterized types\&. In the method \f3ArrayBuilder\&.addToList\fR, the compiler translates the \f3varargs\fR formal parameter \f3T\&.\&.\&.\fR elements to the formal parameter \f3T[]\fR elements, an array\&. However, because of type erasure, the compiler converts the \f3varargs\fR formal parameter to \f3Object[]\fR elements\&. Consequently, there is a possibility of heap pollution\&.
+-.SH COMMAND-LINE\ ARGUMENT\ FILES
+-To shorten or simplify the \f3javac\fR command, you can specify one or more files that contain arguments to the \f3javac\fR command (except \f3-J\fR options)\&. This enables you to create \f3javac\fR commands of any length on any operating system\&.
+-.PP
+-An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be separated by spaces or new line characters\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
+-.PP
+-File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (*) are not allowed in these lists (such as for specifying \f3*\&.java\fR)\&. Use of the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
+-.PP
+-When executing the \f3javac\fR command, pass in the path and name of each argument file with the at sign (@) leading character\&. When the \f3javac\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
+-.PP
+-\f3Example 1 Single Argument File\fR
+-.PP
+-You could use a single argument file named \f3argfile\fR to hold all \f3javac\fR arguments:
+-.sp
+-.nf
+-\f3javac @argfile\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This argument file could contain the contents of both files shown in Example 2
+-.PP
+-\f3Example 2 Two Argument Files\fR
+-.PP
+-You can create two argument files: one for the \f3javac\fR options and the other for the source file names\&. Note that the following lists have no line-continuation characters\&.
+-.PP
+-Create a file named options that contains the following:
+-.sp
+-.nf
+-\f3\-d classes\fP
+-.fi
+-.nf
+-\f3\-g\fP
+-.fi
+-.nf
+-\f3\-sourcepath /java/pubs/ws/1\&.3/src/share/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Create a file named classes that contains the following:
+-.sp
+-.nf
+-\f3MyClass1\&.java\fP
+-.fi
+-.nf
+-\f3MyClass2\&.java\fP
+-.fi
+-.nf
+-\f3MyClass3\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Then, run the \f3javac\fR command as follows:
+-.sp
+-.nf
+-\f3javac @options @classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Argument Files with Paths\fR
+-.PP
+-The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
+-.sp
+-.nf
+-\f3javac @path1/options @path2/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH ANNOTATION\ PROCESSING
+-The \f3javac\fR command provides direct support for annotation processing, superseding the need for the separate annotation processing command, \f3apt\fR\&.
+-.PP
+-The API for annotation processors is defined in the \f3javax\&.annotation\&.processing\fR and j\f3avax\&.lang\&.model\fR packages and subpackages\&.
+-.SS HOW\ ANNOTATION\ PROCESSING\ WORKS
+-Unless annotation processing is disabled with the \f3-proc:none\fR option, the compiler searches for any annotation processors that are available\&. The search path can be specified with the \f3-processorpath\fR option\&. If no path is specified, then the user class path is used\&. Processors are located by means of service provider-configuration files named \f3META-INF/services/javax\&.annotation\&.processing\fR\&.Processor on the search path\&. Such files should contain the names of any annotation processors to be used, listed one per line\&. Alternatively, processors can be specified explicitly, using the \f3-processor\fR option\&.
+-.PP
+-After scanning the source files and classes on the command line to determine what annotations are present, the compiler queries the processors to determine what annotations they process\&. When a match is found, the processor is called\&. A processor can claim the annotations it processes, in which case no further attempt is made to find any processors for those annotations\&. After all of the annotations are claimed, the compiler does not search for additional processors\&.
+-.PP
+-If any processors generate new source files, then another round of annotation processing occurs: Any newly generated source files are scanned, and the annotations processed as before\&. Any processors called on previous rounds are also called on all subsequent rounds\&. This continues until no new source files are generated\&.
+-.PP
+-After a round occurs where no new source files are generated, the annotation processors are called one last time, to give them a chance to complete any remaining work\&. Finally, unless the \f3-proc:only\fR option is used, the compiler compiles the original and all generated source files\&.
+-.SS IMPLICITLY\ LOADED\ SOURCE\ FILES
+-To compile a set of source files, the compiler might need to implicitly load additional source files\&. See Searching for Types\&. Such files are currently not subject to annotation processing\&. By default, the compiler gives a warning when annotation processing occurred and any implicitly loaded source files are compiled\&. The \f3-implicit\fR option provides a way to suppress the warning\&.
+-.SH SEARCHING\ FOR\ TYPES
+-To compile a source file, the compiler often needs information about a type, but the type definition is not in the source files specified on the command line\&. The compiler needs type information for every class or interface used, extended, or implemented in the source file\&. This includes classes and interfaces not explicitly mentioned in the source file, but that provide information through inheritance\&.
+-.PP
+-For example, when you create a subclass \f3java\&.applet\&.Applet\fR, you are also using the ancestor classes of \f3Applet\fR: \f3java\&.awt\&.Panel\fR, \f3java\&.awt\&.Container\fR, \f3java\&.awt\&.Component\fR, and \f3java\&.lang\&.Object\fR\&.
+-.PP
+-When the compiler needs type information, it searches for a source file or class file that defines the type\&. The compiler searches for class files first in the bootstrap and extension classes, then in the user class path (which by default is the current directory)\&. The user class path is defined by setting the \f3CLASSPATH\fR environment variable or by using the \f3-classpath\fR option\&.
+-.PP
+-If you set the \f3-sourcepath\fR option, then the compiler searches the indicated path for source files\&. Otherwise, the compiler searches the user class path for both class files and source files\&.
+-.PP
+-You can specify different bootstrap or extension classes with the \f3-bootclasspath\fR and the \f3-extdirs\fR options\&. See Cross-Compilation Options\&.
+-.PP
+-A successful type search may produce a class file, a source file, or both\&. If both are found, then you can use the \f3-Xprefer\fR option to instruct the compiler which to use\&. If \f3newer\fR is specified, then the compiler uses the newer of the two files\&. If \f3source\fR is specified, the compiler uses the source file\&. The default is \f3newer\fR\&.
+-.PP
+-If a type search finds a source file for a required type, either by itself, or as a result of the setting for the \f3-Xprefer\fR option, then the compiler reads the source file to get the information it needs\&. By default the compiler also compiles the source file\&. You can use the \f3-implicit\fR option to specify the behavior\&. If \f3none\fR is specified, then no class files are generated for the source file\&. If \f3class\fR is specified, then class files are generated for the source file\&.
+-.PP
+-The compiler might not discover the need for some type information until after annotation processing completes\&. When the type information is found in a source file and no \f3-implicit\fR option is specified, the compiler gives a warning that the file is being compiled without being subject to annotation processing\&. To disable the warning, either specify the file on the command line (so that it will be subject to annotation processing) or use the \f3-implicit\fR option to specify whether or not class files should be generated for such source files\&.
+-.SH PROGRAMMATIC\ INTERFACE
+-The \f3javac\fR command supports the new Java Compiler API defined by the classes and interfaces in the \f3javax\&.tools\fR package\&.
+-.SS EXAMPLE
+-To compile as though providing command-line arguments, use the following syntax:
+-.sp
+-.nf
+-\f3JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The example writes diagnostics to the standard output stream and returns the exit code that \f3javac\fR would give when called from the command line\&.
+-.PP
+-You can use other methods in the \f3javax\&.tools\&.JavaCompiler\fR interface to handle diagnostics, control where files are read from and written to, and more\&.
+-.SS OLD\ INTERFACE
+-\fINote:\fR This API is retained for backward compatibility only\&. All new code should use the newer Java Compiler API\&.
+-.PP
+-The \f3com\&.sun\&.tools\&.javac\&.Main\fR class provides two static methods to call the compiler from a program:
+-.sp
+-.nf
+-\f3public static int compile(String[] args);\fP
+-.fi
+-.nf
+-\f3public static int compile(String[] args, PrintWriter out);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3args\fR parameter represents any of the command-line arguments that would typically be passed to the compiler\&.
+-.PP
+-The \f3out\fR parameter indicates where the compiler diagnostic output is directed\&.
+-.PP
+-The \f3return\fR value is equivalent to the \f3exit\fR value from \f3javac\fR\&.
+-.PP
+-\fINote:\fR All other classes and methods found in a package with names that start with \f3com\&.sun\&.tools\&.javac\fR (subpackages of \f3com\&.sun\&.tools\&.javac\fR) are strictly internal and subject to change at any time\&.
+-.SH EXAMPLES
+-\f3Example 1 Compile a Simple Program\fR
+-.PP
+-This example shows how to compile the \f3Hello\&.java\fR source file in the greetings directory\&. The class defined in \f3Hello\&.java\fR is called \f3greetings\&.Hello\fR\&. The greetings directory is the package directory both for the source file and the class file and is underneath the current directory\&. This makes it possible to use the default user class path\&. It also makes it unnecessary to specify a separate destination directory with the \f3-d\fR option\&.
+-.PP
+-The source code in \f3Hello\&.java\fR:
+-.sp
+-.nf
+-\f3package greetings;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class Hello {\fP
+-.fi
+-.nf
+-\f3 public static void main(String[] args) {\fP
+-.fi
+-.nf
+-\f3 for (int i=0; i < args\&.length; i++) {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Hello " + args[i]);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Compile greetings\&.Hello:
+-.sp
+-.nf
+-\f3javac greetings/Hello\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run \f3greetings\&.Hello\fR:
+-.sp
+-.nf
+-\f3java greetings\&.Hello World Universe Everyone\fP
+-.fi
+-.nf
+-\f3Hello World\fP
+-.fi
+-.nf
+-\f3Hello Universe\fP
+-.fi
+-.nf
+-\f3Hello Everyone\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Compile Multiple Source Files\fR
+-.PP
+-This example compiles the \f3Aloha\&.java\fR, \f3GutenTag\&.java\fR, \f3Hello\&.java\fR, and \f3Hi\&.java\fR source files in the \f3greetings\fR package\&.
+-.sp
+-.nf
+-\f3% javac greetings/*\&.java\fP
+-.fi
+-.nf
+-\f3% ls greetings\fP
+-.fi
+-.nf
+-\f3Aloha\&.class GutenTag\&.class Hello\&.class Hi\&.class\fP
+-.fi
+-.nf
+-\f3Aloha\&.java GutenTag\&.java Hello\&.java Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Specify a User Class Path\fR
+-.PP
+-After changing one of the source files in the previous example, recompile it:
+-.sp
+-.nf
+-\f3pwd\fP
+-.fi
+-.nf
+-\f3/examples\fP
+-.fi
+-.nf
+-\f3javac greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Because \f3greetings\&.Hi\fR refers to other classes in the \f3greetings\fR package, the compiler needs to find these other classes\&. The previous example works because the default user class path is the directory that contains the package directory\&. If you want to recompile this file without concern for which directory you are in, then add the examples directory to the user class path by setting \f3CLASSPATH\fR\&. This example uses the \f3-classpath\fR option\&.
+-.sp
+-.nf
+-\f3javac \-classpath /examples /examples/greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you change \f3greetings\&.Hi\fR to use a banner utility, then that utility also needs to be accessible through the user class path\&.
+-.sp
+-.nf
+-\f3javac \-classpath /examples:/lib/Banners\&.jar \e\fP
+-.fi
+-.nf
+-\f3 /examples/greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To execute a class in the \f3greetings\fR package, the program needs access to the \f3greetings\fR package, and to the classes that the \f3greetings\fR classes use\&.
+-.sp
+-.nf
+-\f3java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Separate Source Files and Class Files\fR
+-.PP
+-The following example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e \fP
+-.fi
+-.nf
+-\f3\-extdirs "" OldCode\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language be used to compile \f3OldCode\&.java\fR\&. The option \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&. Note that in most cases, the value of the \f3-target\fR option is the value of the \f3-source\fR option; in this example, you can omit the \f3-target\fR option\&.
+-.PP
+-You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 OldCode\&.java\fP
+-.fi
+-.nf
+-\f3warning: [options] bootstrap class path not set in conjunction with \fP
+-.fi
+-.nf
+-\f3\-source 1\&.7\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules (in this example, it uses version 1\&.7 of the Java programming language) combined with the new bootstrap classes, which can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&.
+-.PP
+-\f3Example 5 Cross Compile\fR
+-.PP
+-This example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e\fP
+-.fi
+-.nf
+-\f3 \-extdirs "" OldCode\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The\f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language to be used to compile OldCode\&.java\&. The \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&.
+-.PP
+-You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 OldCode\&.java\fP
+-.fi
+-.nf
+-\f3warning: [options] bootstrap class path not set in conjunction with \-source 1\&.7\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules combined with the new bootstrap classes\&. This combination can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&. In this example, the compiler uses release 1\&.7 of the Java programming language\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javadoc(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
++
++.SH NAME
++javac \- Reads Java class and interface definitions and compiles them into bytecode and class files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavac\fR [ \fIoptions\fR ] [ \fIsourcefiles\fR ] [ \fIclasses\fR] [ \fI@argfiles\fR ]
++.fi
++.sp
++Arguments can be in any order:
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIsourcefiles\fR
++One or more source files to be compiled (such as \f3MyClass\&.java\fR)\&.
++.TP
++\fIclasses\fR
++One or more classes to be processed for annotations (such as \f3MyPackage\&.MyClass\fR)\&.
++.TP
++\fI@argfiles\fR
++One or more files that list options and source files\&. The \f3-J\fR options are not allowed in these files\&. See Command-Line Argument Files\&.
++.SH DESCRIPTION
++The \f3javac\fR command reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files\&. The \f3javac\fR command can also process annotations in Java source files and classes\&.
++.PP
++There are two ways to pass source code file names to \f3javac\fR\&.
++.TP 0.2i
++\(bu
++For a small number of source files, list the file names on the command line\&.
++.TP 0.2i
++\(bu
++For a large number of source files, list the file names in a file that is separated by blanks or line breaks\&. Use the list file name preceded by an at sign (@) with the \f3javac\fR command\&.
++.PP
++Source code file names must have \&.java suffixes, class file names must have \&.class suffixes, and both source and class files must have root names that identify the class\&. For example, a class called \f3MyClass\fR would be written in a source file called \f3MyClass\&.java\fR and compiled into a bytecode class file called \f3MyClass\&.class\fR\&.
++.PP
++Inner class definitions produce additional class files\&. These class files have names that combine the inner and outer class names, such as \f3MyClass$MyInnerClass\&.class\fR\&.
++.PP
++Arrange source files in a directory tree that reflects their package tree\&. For example, if all of your source files are in \f3/workspace\fR, then put the source code for \f3com\&.mysoft\&.mypack\&.MyClass\fR in \f3/workspace/com/mysoft/mypack/MyClass\&.java\fR\&.
++.PP
++By default, the compiler puts each class file in the same directory as its source file\&. You can specify a separate destination directory with the \f3-d\fR option\&.
++.SH OPTIONS
++The compiler has a set of standard options that are supported on the current development environment\&. An additional set of nonstandard options are specific to the current virtual machine and compiler implementations and are subject to change in the future\&. Nonstandard options begin with the \f3-X\fR option\&.
++.TP 0.2i
++\(bu
++See also Cross-Compilation Options
++.TP 0.2i
++\(bu
++See also Nonstandard Options
++.SS STANDARD\ OPTIONS
++.TP
++-A\fIkey\fR[\fI=value\fR]
++.br
++Specifies options to pass to annotation processors\&. These options are not interpreted by \f3javac\fR directly, but are made available for use by individual processors\&. The \f3key\fR value should be one or more identifiers separated by a dot (\&.)\&.
++.TP
++-cp \fIpath\fR or -classpath \fIpath\fR
++.br
++Specifies where to find user class files, and (optionally) annotation processors and source files\&. This class path overrides the user class path in the \f3CLASSPATH\fR environment variable\&. If neither \f3CLASSPATH\fR, \f3-cp\fR nor \f3-classpath\fR is specified, then the user \fIclass path\fR is the current directory\&. See Setting the Class Path\&.
++
++If the \f3-sourcepath\fR option is not specified, then the user class path is also searched for source files\&.
++
++If the \f3-processorpath\fR option is not specified, then the class path is also searched for annotation processors\&.
++.TP
++-Djava\&.ext\&.dirs=\fIdirectories\fR
++.br
++Overrides the location of installed extensions\&.
++.TP
++-Djava\&.endorsed\&.dirs=\fIdirectories\fR
++.br
++Overrides the location of the endorsed standards path\&.
++.TP
++-d \fIdirectory\fR
++.br
++Sets the destination directory for class files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then \f3javac\fR puts the class file in a subdirectory that reflects the package name and creates directories as needed\&.
++
++If you specify \f3-d\fR\f3/home/myclasses\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the class file is \f3/home/myclasses/com/mypackage/MyClass\&.class\fR\&.
++
++If the \fI-d\fR option is not specified, then \f3javac\fR puts each class file in the same directory as the source file from which it was generated\&.
++
++\fINote:\fR The directory specified by the \fI-d\fR option is not automatically added to your user class path\&.
++.TP
++-deprecation
++.br
++Shows a description of each use or override of a deprecated member or class\&. Without the \f3-deprecation\fR option, \f3javac\fR shows a summary of the source files that use or override deprecated members or classes\&. The \f3-deprecation\fR option is shorthand for \f3-Xlint:deprecation\fR\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Sets the source file encoding name, such as EUC-JP and UTF-8\&. If the \f3-encoding\fR option is not specified, then the platform default converter is used\&.
++.TP
++-endorseddirs \fIdirectories\fR
++.br
++Overrides the location of the endorsed standards path\&.
++.TP
++-extdirs \fIdirectories\fR
++.br
++Overrides the location of the \f3ext\fR directory\&. The directories variable is a colon-separated list of directories\&. Each JAR file in the specified directories is searched for class files\&. All JAR files found become part of the class path\&.
++
++If you are cross-compiling (compiling classes against bootstrap and extension classes of a different Java platform implementation), then this option specifies the directories that contain the extension classes\&. See Cross-Compilation Options for more information\&.
++.TP
++-g
++.br
++Generates all debugging information, including local variables\&. By default, only line number and source file information is generated\&.
++.TP
++-g:none
++.br
++Does not generate any debugging information\&.
++.TP
++-g:[\fIkeyword list\fR]
++.br
++Generates only some kinds of debugging information, specified by a comma separated list of keywords\&. Valid keywords are:
++.RS
++.TP
++source
++Source file debugging information\&.
++.TP
++lines
++Line number debugging information\&.
++.TP
++vars
++Local variable debugging information\&.
++.RE
++
++.TP
++-help
++.br
++Prints a synopsis of standard options\&.
++.TP
++-implicit:[\fIclass, none\fR]
++.br
++Controls the generation of class files for implicitly loaded source files\&. To automatically generate class files, use \f3-implicit:class\fR\&. To suppress class file generation, use \f3-implicit:none\fR\&. If this option is not specified, then the default is to automatically generate class files\&. In this case, the compiler issues a warning if any such class files are generated when also doing annotation processing\&. The warning is not issued when the \f3-implicit\fR option is set explicitly\&. See Searching for Types\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++
++\fINote:\fR The \fICLASSPATH\fR, \f3-classpath\fR, \f3-bootclasspath\fR, and \f3-extdirs\fR options do not specify the classes used to run \f3javac\fR\&. Trying to customize the compiler implementation with these options and variables is risky and often does not accomplish what you want\&. If you must customize the complier implementation, then use the \f3-J\fR option to pass options through to the underlying \f3\fRJava launcher\&.
++.TP
++-nowarn
++.br
++Disables warning messages\&. This option operates the same as the \f3-Xlint:none\fR option\&.
++.TP
++-parameters
++.br
++Stores formal parameter names of constructors and methods in the generated class file so that the method \f3java\&.lang\&.reflect\&.Executable\&.getParameters\fR from the Reflection API can retrieve them\&.
++.TP
++-proc: [\fInone\fR, \fIonly\fR]
++.br
++Controls whether annotation processing and compilation are done\&. \f3-proc:none\fR means that compilation takes place without annotation processing\&. \f3-proc:only\fR means that only annotation processing is done, without any subsequent compilation\&.
++.TP
++-processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.]
++.br
++Names of the annotation processors to run\&. This bypasses the default discovery process\&.
++.TP
++-processorpath \fIpath\fR
++.br
++Specifies where to find annotation processors\&. If this option is not used, then the class path is searched for processors\&.
++.TP
++-s \fIdir\fR
++.br
++Specifies the directory where to place the generated source files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then the compiler puts the source file in a subdirectory that reflects the package name and creates directories as needed\&.
++
++If you specify \f3-s /home/mysrc\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the source file is put in \f3/home/mysrc/com/mypackage/MyClass\&.java\fR\&.
++.TP
++-source \fIrelease\fR
++.br
++Specifies the version of source code accepted\&. The following values for \f3release\fR are allowed:
++.RS
++.TP
++1\&.3
++The compiler does not support assertions, generics, or other language features introduced after Java SE 1\&.3\&.
++.TP
++1\&.4
++The compiler accepts code containing assertions, which were introduced in Java SE 1\&.4\&.
++.TP
++1\&.5
++The compiler accepts code containing generics and other language features introduced in Java SE 5\&.
++.TP
++5
++Synonym for 1\&.5\&.
++.TP
++1\&.6
++No language changes were introduced in Java SE 6\&. However, encoding errors in source files are now reported as errors instead of warnings as in earlier releases of Java Platform, Standard Edition\&.
++.TP
++6
++Synonym for 1\&.6\&.
++.TP
++1\&.7
++The compiler accepts code with features introduced in Java SE 7\&.
++.TP
++7
++Synonym for 1\&.7\&.
++.TP
++1\&.8
++This is the default value\&. The compiler accepts code with features introduced in Java SE 8\&.
++.TP
++8
++Synonym for 1\&.8\&.
++.RE
++
++.TP
++-sourcepath \fIsourcepath\fR
++.br
++Specifies the source code path to search for class or interface definitions\&. As with the user class path, source path entries are separated by colons (:) on Oracle Solaris and semicolons on Windows and can be directories, JAR archives, or ZIP archives\&. If packages are used, then the local path name within the directory or archive must reflect the package name\&.
++
++\fINote:\fR Classes found through the class path might be recompiled when their source files are also found\&. See Searching for Types\&.
++.TP
++-verbose
++.br
++Uses verbose output, which includes information about each class loaded and each source file compiled\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-werror
++.br
++Terminates compilation when warnings occur\&.
++.TP
++-X
++.br
++Displays information about nonstandard options and exits\&.
++.SS CROSS-COMPILATION\ OPTIONS
++By default, classes are compiled against the bootstrap and extension classes of the platform that \f3javac\fR shipped with\&. But \f3javac\fR also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation\&. It is important to use the \f3-bootclasspath\fR and \f3-extdirs\fR options when cross-compiling\&.
++.TP
++-target \fIversion\fR
++.br
++Generates class files that target a specified release of the virtual machine\&. Class files will run on the specified target and on later releases, but not on earlier releases of the JVM\&. Valid targets are 1\&.1, 1\&.2, 1\&.3, 1\&.4, 1\&.5 (also 5), 1\&.6 (also 6), 1\&.7 (also 7), and 1\&.8 (also 8)\&.
++
++The default for the \f3-target\fR option depends on the value of the \f3-source\fR option:
++.RS
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is not specified, then the value of the \f3-target\fR option is 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.2, then the value of the \f3-target\fR option is 1\&.4
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.3, then the value of the \f3-target\fR option is 1\&.4
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.5, then the value of the \f3-target\fR option is 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.6, then the value of the \f3-target\fR is option 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.7, then the value of the \f3-target\fR is option 1\&.8
++.TP 0.2i
++\(bu
++For all other values of the \f3-source\fR option, the value of the \f3-target\fR option is the value of the \f3-source\fR option\&.
++.RE
++
++.TP
++-bootclasspath \fIbootclasspath\fR
++.br
++Cross-compiles against the specified set of boot classes\&. As with the user class path, boot class path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives\&.
++.SS COMPACT\ PROFILE\ OPTION
++Beginning with JDK 8, the \f3javac\fR compiler supports compact profiles\&. With compact profiles, applications that do not require the entire Java platform can be deployed and run with a smaller footprint\&. The compact profiles feature could be used to shorten the download time for applications from app stores\&. This feature makes for more compact deployment of Java applications that bundle the JRE\&. This feature is also useful in small devices\&.
++.PP
++The supported profile values are \f3compact1\fR, \f3compact2\fR, and \f3compact3\fR\&. These are additive layers\&. Each higher-numbered compact profile contains all of the APIs in profiles with smaller number names\&.
++.TP
++-profile
++.br
++When using compact profiles, this option specifies the profile name when compiling\&. For example:
++.sp
++.nf
++\f3javac \-profile compact1 Hello\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++javac does not compile source code that uses any Java SE APIs that is not in the specified profile\&. Here is an example of the error message that results from attempting to compile such source code:
++.sp
++.nf
++\f3cd jdk1\&.8\&.0/bin\fP
++.fi
++.nf
++\f3\&./javac \-profile compact1 Paint\&.java\fP
++.fi
++.nf
++\f3Paint\&.java:5: error: Applet is not available in profile \&'compact1\&'\fP
++.fi
++.nf
++\f3import java\&.applet\&.Applet;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++In this example, you can correct the error by modifying the source to not use the \f3Applet\fR class\&. You could also correct the error by compiling without the -profile option\&. Then the compilation would be run against the full set of Java SE APIs\&. (None of the compact profiles include the \f3Applet\fR class\&.)
++
++An alternative way to compile with compact profiles is to use the \f3-bootclasspath\fR option to specify a path to an \f3rt\&.jar\fR file that specifies a profile\&'s image\&. Using the \f3-profile\fR option instead does not require a profile image to be present on the system at compile time\&. This is useful when cross-compiling\&.
++.SS NONSTANDARD\ OPTIONS
++.TP
++-Xbootclasspath/p:\fIpath\fR
++.br
++Adds a suffix to the bootstrap class path\&.
++.TP
++-Xbootclasspath/a:\fIpath\fR
++.br
++Adds a prefix to the bootstrap class path\&.
++.TP
++-Xbootclasspath/:\fIpath\fR
++.br
++Overrides the location of the bootstrap class files\&.
++.TP
++-Xdoclint:[-]\fIgroup\fR [\fI/access\fR]
++.br
++Enables or disables specific groups of checks, where \fIgroup\fR is one of the following values: \f3accessibility\fR, \f3syntax\fR, \f3reference\fR, \f3html\fR or \f3missing\fR\&. For more information about these groups of checks see the \f3-Xdoclint\fR option of the \f3javadoc\fR command\&. The \f3-Xdoclint\fR option is disabled by default in the \f3javac\fR command\&.
++
++The variable \fIaccess\fR specifies the minimum visibility level of classes and members that the \f3-Xdoclint\fR option checks\&. It can have one of the following values (in order of most to least visible) : \f3public\fR, \f3protected\fR, \f3package\fR and \f3private\fR\&. For example, the following option checks classes and members (with all groups of checks) that have the access level protected and higher (which includes protected, package and public):
++.sp
++.nf
++\f3\-Xdoclint:all/protected\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following option enables all groups of checks for all access levels, except it will not check for HTML errors for classes and members that have access level package and higher (which includes package and public):
++.sp
++.nf
++\f3\-Xdoclint:all,\-html/package\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-Xdoclint:none
++.br
++Disables all groups of checks\&.
++.TP
++-Xdoclint:all[\fI/access\fR]
++.br
++Enables all groups of checks\&.
++.TP
++-Xlint
++.br
++\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
++.TP
++-Xlint:all
++.br
++\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
++.TP
++-Xlint:none
++.br
++Disables all warnings\&.
++.TP
++-Xlint:\fIname\fR
++.br
++Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option for a list of warnings you can disable with this option\&.
++.TP
++-Xlint:\fI-name\fR
++.br
++Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option with the \f3-Xlint\fR option to get a list of warnings that you can disable with this option\&.
++.TP
++-Xmaxerrs \fInumber\fR
++.br
++Sets the maximum number of errors to print\&.
++.TP
++-Xmaxwarns \fInumber\fR
++.br
++Sets the maximum number of warnings to print\&.
++.TP
++-Xstdout \fIfilename\fR
++.br
++Sends compiler messages to the named file\&. By default, compiler messages go to \f3System\&.err\fR\&.
++.TP
++-Xprefer:[\fInewer,source\fR]
++.br
++Specifies which file to read when both a source file and class file are found for a type\&. (See Searching for Types)\&. If the \f3-Xprefer:newer\fR option is used, then it reads the newer of the source or class file for a type (default)\&. If the \f3-Xprefer:source\fR option is used, then it reads the source file\&. Use -\f3Xprefer:source\fR when you want to be sure that any annotation processors can access annotations declared with a retention policy of \f3SOURCE\fR\&.
++.TP
++-Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR]
++.br
++Control whether javac generates \f3package-info\&.class\fR files from package-info\&.java files\&. Possible mode arguments for this option include the following\&.
++.RS
++.TP
++always
++Always generate a \f3package-info\&.class\fR file for every \f3package-info\&.java\fR file\&. This option may be useful if you use a build system such as Ant, which checks that each \f3\&.java\fR file has a corresponding \f3\&.class\fR file\&.
++.TP
++legacy
++Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations\&. Don\&'t generate a \f3package-info\&.class\fR file if package-info\&.java only contains comments\&.
++
++\fINote:\fR A \f3package-info\&.class\fR file might be generated but be empty if all the annotations in the package-info\&.java file have \f3RetentionPolicy\&.SOURCE\fR\&.
++.TP
++nonempty
++Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations with \f3RetentionPolicy\&.CLASS\fR or \f3RetentionPolicy\&.RUNTIME\fR\&.
++.RE
++
++.TP
++-Xprint
++.br
++Prints a textual representation of specified types for debugging purposes\&. Perform neither annotation processing nor compilation\&. The format of the output could change\&.
++.TP
++-XprintProcessorInfo
++.br
++Prints information about which annotations a processor is asked to process\&.
++.TP
++-XprintRounds
++.br
++Prints information about initial and subsequent annotation processing rounds\&.
++.SH ENABLE\ OR\ DISABLE\ WARNINGS\ WITH\ THE\ -XLINT\ OPTION
++Enable warning \fIname\fR with the \f3-Xlint:name\fR option, where \f3name\fR is one of the following warning names\&. Note that you can disable a warning with the \f3-Xlint:-name:\fR option\&.
++.TP
++cast
++Warns about unnecessary and redundant casts, for example:
++.sp
++.nf
++\f3String s = (String) "Hello!"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++classfile
++Warns about issues related to class file contents\&.
++.TP
++deprecation
++Warns about the use of deprecated items, for example:
++.sp
++.nf
++\f3java\&.util\&.Date myDate = new java\&.util\&.Date();\fP
++.fi
++.nf
++\f3int currentDay = myDate\&.getDay();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The method \f3java\&.util\&.Date\&.getDay\fR has been deprecated since JDK 1\&.1
++.TP
++dep-ann
++Warns about items that are documented with an \f3@deprecated\fR Javadoc comment, but do not have a \f3@Deprecated\fR annotation, for example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @deprecated As of Java SE 7, replaced by {@link #newMethod()}\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public static void deprecatedMethood() { }\fP
++.fi
++.nf
++\f3public static void newMethod() { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++divzero
++Warns about division by the constant integer 0, for example:
++.sp
++.nf
++\f3int divideByZero = 42 / 0;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++empty
++Warns about empty statements after \f3if\fRstatements, for example:
++.sp
++.nf
++\f3class E {\fP
++.fi
++.nf
++\f3 void m() {\fP
++.fi
++.nf
++\f3 if (true) ;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++fallthrough
++Checks the switch blocks for fall-through cases and provides a warning message for any that are found\&. Fall-through cases are cases in a switch block, other than the last case in the block, whose code does not include a break statement, allowing code execution to fall through from that case to the next case\&. For example, the code following the case 1 label in this switch block does not end with a break statement:
++.sp
++.nf
++\f3switch (x) {\fP
++.fi
++.nf
++\f3case 1:\fP
++.fi
++.nf
++\f3 System\&.out\&.println("1");\fP
++.fi
++.nf
++\f3 // No break statement here\&.\fP
++.fi
++.nf
++\f3case 2:\fP
++.fi
++.nf
++\f3 System\&.out\&.println("2");\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the \f3-Xlint:fallthrough\fR option was used when compiling this code, then the compiler emits a warning about possible fall-through into case, with the line number of the case in question\&.
++.TP
++finally
++Warns about \f3finally\fR clauses that cannot complete normally, for example:
++.sp
++.nf
++\f3public static int m() {\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3 throw new NullPointerException();\fP
++.fi
++.nf
++\f3 } catch (NullPointerException(); {\fP
++.fi
++.nf
++\f3 System\&.err\&.println("Caught NullPointerException\&.");\fP
++.fi
++.nf
++\f3 return 1;\fP
++.fi
++.nf
++\f3 } finally {\fP
++.fi
++.nf
++\f3 return 0;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates a warning for the \f3finally\fR block in this example\&. When the \f3int\fR method is called, it returns a value of 0\&. A \f3finally\fR block executes when the \f3try\fR block exits\&. In this example, when control is transferred to the \f3catch\fR block, the \f3int\fR method exits\&. However, the \f3finally\fR block must execute, so it is executed, even though control was transferred outside the method\&.
++.TP
++options
++Warns about issues that related to the use of command-line options\&. See Cross-Compilation Options\&.
++.TP
++overrides
++Warns about issues regarding method overrides\&. For example, consider the following two classes:
++.sp
++.nf
++\f3public class ClassWithVarargsMethod {\fP
++.fi
++.nf
++\f3 void varargsMethod(String\&.\&.\&. s) { }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class ClassWithOverridingMethod extends ClassWithVarargsMethod {\fP
++.fi
++.nf
++\f3 @Override\fP
++.fi
++.nf
++\f3 void varargsMethod(String[] s) { }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates a warning similar to the following:\&.
++.sp
++.nf
++\f3warning: [override] varargsMethod(String[]) in ClassWithOverridingMethod \fP
++.fi
++.nf
++\f3overrides varargsMethod(String\&.\&.\&.) in ClassWithVarargsMethod; overriding\fP
++.fi
++.nf
++\f3method is missing \&'\&.\&.\&.\&'\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler encounters a \f3varargs\fR method, it translates the \f3varargs\fR formal parameter into an array\&. In the method \f3ClassWithVarargsMethod\&.varargsMethod\fR, the compiler translates the \f3varargs\fR formal parameter \f3String\&.\&.\&. s\fR to the formal parameter \f3String[] s\fR, an array, which matches the formal parameter of the method \f3ClassWithOverridingMethod\&.varargsMethod\fR\&. Consequently, this example compiles\&.
++.TP
++path
++Warns about invalid path elements and nonexistent path directories on the command line (with regard to the class path, the source path, and other paths)\&. Such warnings cannot be suppressed with the \f3@SuppressWarnings\fR annotation, for example:
++.sp
++.nf
++\f3javac \-Xlint:path \-classpath /nonexistentpath Example\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++processing
++Warn about issues regarding annotation processing\&. The compiler generates this warning when you have a class that has an annotation, and you use an annotation processor that cannot handle that type of exception\&. For example, the following is a simple annotation processor:
++
++\fISource file AnnocProc\&.java\fR:
++.sp
++.nf
++\f3import java\&.util\&.*;\fP
++.fi
++.nf
++\f3import javax\&.annotation\&.processing\&.*;\fP
++.fi
++.nf
++\f3import javax\&.lang\&.model\&.*;\fP
++.fi
++.nf
++\f3import\&.javaz\&.lang\&.model\&.element\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@SupportedAnnotationTypes("NotAnno")\fP
++.fi
++.nf
++\f3public class AnnoProc extends AbstractProcessor {\fP
++.fi
++.nf
++\f3 public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv){\fP
++.fi
++.nf
++\f3 return true;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public SourceVersion getSupportedSourceVersion() {\fP
++.fi
++.nf
++\f3 return SourceVersion\&.latest();\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fISource file AnnosWithoutProcessors\&.java\fR:
++.sp
++.nf
++\f3@interface Anno { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@Anno\fP
++.fi
++.nf
++\f3class AnnosWithoutProcessors { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following commands compile the annotation processor \f3AnnoProc\fR, then run this annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR:
++.sp
++.nf
++\f3javac AnnoProc\&.java\fP
++.fi
++.nf
++\f3javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutProcessors\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler runs the annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR, it generates the following warning:
++.sp
++.nf
++\f3warning: [processing] No processor claimed any of these annotations: Anno\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To resolve this issue, you can rename the annotation defined and used in the class \f3AnnosWithoutProcessors\fR from \f3Anno\fR to \f3NotAnno\fR\&.
++.TP
++rawtypes
++Warns about unchecked operations on raw types\&. The following statement generates a \f3rawtypes\fR warning:
++.sp
++.nf
++\f3void countElements(List l) { \&.\&.\&. }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following example does not generate a \f3rawtypes\fR warning
++.sp
++.nf
++\f3void countElements(List<?> l) { \&.\&.\&. }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\f3List\fR is a raw type\&. However, \f3List<?>\fR is an unbounded wildcard parameterized type\&. Because \f3List\fR is a parameterized interface, always specify its type argument\&. In this example, the \f3List\fR formal argument is specified with an unbounded wildcard (\f3?\fR) as its formal type parameter, which means that the \f3countElements\fR method can accept any instantiation of the \f3List\fR interface\&.
++.TP
++Serial
++Warns about missing \f3serialVersionUID\fR definitions on serializable classes, for example:
++.sp
++.nf
++\f3public class PersistentTime implements Serializable\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 private Date time;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public PersistentTime() {\fP
++.fi
++.nf
++\f3 time = Calendar\&.getInstance()\&.getTime();\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public Date getTime() {\fP
++.fi
++.nf
++\f3 return time;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates the following warning:
++.sp
++.nf
++\f3warning: [serial] serializable class PersistentTime has no definition of\fP
++.fi
++.nf
++\f3serialVersionUID\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If a serializable class does not explicitly declare a field named \f3serialVersionUID\fR, then the serialization runtime environment calculates a default \f3serialVersionUID\fR value for that class based on various aspects of the class, as described in the Java Object Serialization Specification\&. However, it is strongly recommended that all serializable classes explicitly declare \f3serialVersionUID\fR values because the default process of computing \f3serialVersionUID\fR vales is highly sensitive to class details that can vary depending on compiler implementations, and as a result, might cause an unexpected \f3InvalidClassExceptions\fR during deserialization\&. To guarantee a consistent \f3serialVersionUID\fR value across different Java compiler implementations, a serializable class must declare an explicit \f3serialVersionUID\fR value\&.
++.TP
++static
++Warns about issues relating to the use of statics, for example:
++.sp
++.nf
++\f3class XLintStatic {\fP
++.fi
++.nf
++\f3 static void m1() { }\fP
++.fi
++.nf
++\f3 void m2() { this\&.m1(); }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates the following warning:
++.sp
++.nf
++\f3warning: [static] static method should be qualified by type name, \fP
++.fi
++.nf
++\f3XLintStatic, instead of by an expression\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To resolve this issue, you can call the \f3static\fR method \f3m1\fR as follows:
++.sp
++.nf
++\f3XLintStatic\&.m1();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Alternately, you can remove the \f3static\fR keyword from the declaration of the method \f3m1\fR\&.
++.TP
++try
++Warns about issues relating to use of \f3try\fR blocks, including try-with-resources statements\&. For example, a warning is generated for the following statement because the resource \f3ac\fR declared in the \f3try\fR block is not used:
++.sp
++.nf
++\f3try ( AutoCloseable ac = getResource() ) { // do nothing}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++unchecked
++Gives more detail for unchecked conversion warnings that are mandated by the Java Language Specification, for example:
++.sp
++.nf
++\f3List l = new ArrayList<Number>();\fP
++.fi
++.nf
++\f3List<String> ls = l; // unchecked warning\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++During type erasure, the types \f3ArrayList<Number>\fR and \f3List<String>\fR become \f3ArrayList\fR and \f3List\fR, respectively\&.
++
++The \f3ls\fR command has the parameterized type \f3List<String>\fR\&. When the \f3List\fR referenced by \f3l\fR is assigned to \f3ls\fR, the compiler generates an unchecked warning\&. At compile time, the compiler and JVM cannot determine whether \f3l\fR refers to a \f3List<String>\fR type\&. In this case, \f3l\fR does not refer to a \f3List<String>\fR type\&. As a result, heap pollution occurs\&.
++
++A heap pollution situation occurs when the \f3List\fR object \f3l\fR, whose static type is \f3List<Number>\fR, is assigned to another \f3List\fR object, \f3ls\fR, that has a different static type, \f3List<String>\fR\&. However, the compiler still allows this assignment\&. It must allow this assignment to preserve backward compatibility with releases of Java SE that do not support generics\&. Because of type erasure, \f3List<Number>\fR and \f3List<String>\fR both become \f3List\fR\&. Consequently, the compiler allows the assignment of the object \f3l\fR\f3,\fR which has a raw type of \f3List\fR, to the object \f3ls\fR\&.
++.TP
++varargs
++Warns about unsafe usages of variable arguments (\f3varargs\fR) methods, in particular, those that contain non-reifiable arguments, for example:
++.sp
++.nf
++\f3public class ArrayBuilder {\fP
++.fi
++.nf
++\f3 public static <T> void addToList (List<T> listArg, T\&.\&.\&. elements) {\fP
++.fi
++.nf
++\f3 for (T x : elements) {\fP
++.fi
++.nf
++\f3 listArg\&.add(x);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR A non-reifiable type is a type whose type information is not fully available at runtime\&.
++
++The compiler generates the following warning for the definition of the method \f3ArrayBuilder\&.addToList\fR
++.sp
++.nf
++\f3warning: [varargs] Possible heap pollution from parameterized vararg type T\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler encounters a varargs method, it translates the \f3varargs\fR formal parameter into an array\&. However, the Java programming language does not permit the creation of arrays of parameterized types\&. In the method \f3ArrayBuilder\&.addToList\fR, the compiler translates the \f3varargs\fR formal parameter \f3T\&.\&.\&.\fR elements to the formal parameter \f3T[]\fR elements, an array\&. However, because of type erasure, the compiler converts the \f3varargs\fR formal parameter to \f3Object[]\fR elements\&. Consequently, there is a possibility of heap pollution\&.
++.SH COMMAND-LINE\ ARGUMENT\ FILES
++To shorten or simplify the \f3javac\fR command, you can specify one or more files that contain arguments to the \f3javac\fR command (except \f3-J\fR options)\&. This enables you to create \f3javac\fR commands of any length on any operating system\&.
++.PP
++An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be separated by spaces or new line characters\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
++.PP
++File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (*) are not allowed in these lists (such as for specifying \f3*\&.java\fR)\&. Use of the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
++.PP
++When executing the \f3javac\fR command, pass in the path and name of each argument file with the at sign (@) leading character\&. When the \f3javac\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
++.PP
++\f3Example 1 Single Argument File\fR
++.PP
++You could use a single argument file named \f3argfile\fR to hold all \f3javac\fR arguments:
++.sp
++.nf
++\f3javac @argfile\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This argument file could contain the contents of both files shown in Example 2
++.PP
++\f3Example 2 Two Argument Files\fR
++.PP
++You can create two argument files: one for the \f3javac\fR options and the other for the source file names\&. Note that the following lists have no line-continuation characters\&.
++.PP
++Create a file named options that contains the following:
++.sp
++.nf
++\f3\-d classes\fP
++.fi
++.nf
++\f3\-g\fP
++.fi
++.nf
++\f3\-sourcepath /java/pubs/ws/1\&.3/src/share/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Create a file named classes that contains the following:
++.sp
++.nf
++\f3MyClass1\&.java\fP
++.fi
++.nf
++\f3MyClass2\&.java\fP
++.fi
++.nf
++\f3MyClass3\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Then, run the \f3javac\fR command as follows:
++.sp
++.nf
++\f3javac @options @classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Argument Files with Paths\fR
++.PP
++The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
++.sp
++.nf
++\f3javac @path1/options @path2/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH ANNOTATION\ PROCESSING
++The \f3javac\fR command provides direct support for annotation processing, superseding the need for the separate annotation processing command, \f3apt\fR\&.
++.PP
++The API for annotation processors is defined in the \f3javax\&.annotation\&.processing\fR and j\f3avax\&.lang\&.model\fR packages and subpackages\&.
++.SS HOW\ ANNOTATION\ PROCESSING\ WORKS
++Unless annotation processing is disabled with the \f3-proc:none\fR option, the compiler searches for any annotation processors that are available\&. The search path can be specified with the \f3-processorpath\fR option\&. If no path is specified, then the user class path is used\&. Processors are located by means of service provider-configuration files named \f3META-INF/services/javax\&.annotation\&.processing\fR\&.Processor on the search path\&. Such files should contain the names of any annotation processors to be used, listed one per line\&. Alternatively, processors can be specified explicitly, using the \f3-processor\fR option\&.
++.PP
++After scanning the source files and classes on the command line to determine what annotations are present, the compiler queries the processors to determine what annotations they process\&. When a match is found, the processor is called\&. A processor can claim the annotations it processes, in which case no further attempt is made to find any processors for those annotations\&. After all of the annotations are claimed, the compiler does not search for additional processors\&.
++.PP
++If any processors generate new source files, then another round of annotation processing occurs: Any newly generated source files are scanned, and the annotations processed as before\&. Any processors called on previous rounds are also called on all subsequent rounds\&. This continues until no new source files are generated\&.
++.PP
++After a round occurs where no new source files are generated, the annotation processors are called one last time, to give them a chance to complete any remaining work\&. Finally, unless the \f3-proc:only\fR option is used, the compiler compiles the original and all generated source files\&.
++.SS IMPLICITLY\ LOADED\ SOURCE\ FILES
++To compile a set of source files, the compiler might need to implicitly load additional source files\&. See Searching for Types\&. Such files are currently not subject to annotation processing\&. By default, the compiler gives a warning when annotation processing occurred and any implicitly loaded source files are compiled\&. The \f3-implicit\fR option provides a way to suppress the warning\&.
++.SH SEARCHING\ FOR\ TYPES
++To compile a source file, the compiler often needs information about a type, but the type definition is not in the source files specified on the command line\&. The compiler needs type information for every class or interface used, extended, or implemented in the source file\&. This includes classes and interfaces not explicitly mentioned in the source file, but that provide information through inheritance\&.
++.PP
++For example, when you create a subclass \f3java\&.applet\&.Applet\fR, you are also using the ancestor classes of \f3Applet\fR: \f3java\&.awt\&.Panel\fR, \f3java\&.awt\&.Container\fR, \f3java\&.awt\&.Component\fR, and \f3java\&.lang\&.Object\fR\&.
++.PP
++When the compiler needs type information, it searches for a source file or class file that defines the type\&. The compiler searches for class files first in the bootstrap and extension classes, then in the user class path (which by default is the current directory)\&. The user class path is defined by setting the \f3CLASSPATH\fR environment variable or by using the \f3-classpath\fR option\&.
++.PP
++If you set the \f3-sourcepath\fR option, then the compiler searches the indicated path for source files\&. Otherwise, the compiler searches the user class path for both class files and source files\&.
++.PP
++You can specify different bootstrap or extension classes with the \f3-bootclasspath\fR and the \f3-extdirs\fR options\&. See Cross-Compilation Options\&.
++.PP
++A successful type search may produce a class file, a source file, or both\&. If both are found, then you can use the \f3-Xprefer\fR option to instruct the compiler which to use\&. If \f3newer\fR is specified, then the compiler uses the newer of the two files\&. If \f3source\fR is specified, the compiler uses the source file\&. The default is \f3newer\fR\&.
++.PP
++If a type search finds a source file for a required type, either by itself, or as a result of the setting for the \f3-Xprefer\fR option, then the compiler reads the source file to get the information it needs\&. By default the compiler also compiles the source file\&. You can use the \f3-implicit\fR option to specify the behavior\&. If \f3none\fR is specified, then no class files are generated for the source file\&. If \f3class\fR is specified, then class files are generated for the source file\&.
++.PP
++The compiler might not discover the need for some type information until after annotation processing completes\&. When the type information is found in a source file and no \f3-implicit\fR option is specified, the compiler gives a warning that the file is being compiled without being subject to annotation processing\&. To disable the warning, either specify the file on the command line (so that it will be subject to annotation processing) or use the \f3-implicit\fR option to specify whether or not class files should be generated for such source files\&.
++.SH PROGRAMMATIC\ INTERFACE
++The \f3javac\fR command supports the new Java Compiler API defined by the classes and interfaces in the \f3javax\&.tools\fR package\&.
++.SS EXAMPLE
++To compile as though providing command-line arguments, use the following syntax:
++.sp
++.nf
++\f3JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The example writes diagnostics to the standard output stream and returns the exit code that \f3javac\fR would give when called from the command line\&.
++.PP
++You can use other methods in the \f3javax\&.tools\&.JavaCompiler\fR interface to handle diagnostics, control where files are read from and written to, and more\&.
++.SS OLD\ INTERFACE
++\fINote:\fR This API is retained for backward compatibility only\&. All new code should use the newer Java Compiler API\&.
++.PP
++The \f3com\&.sun\&.tools\&.javac\&.Main\fR class provides two static methods to call the compiler from a program:
++.sp
++.nf
++\f3public static int compile(String[] args);\fP
++.fi
++.nf
++\f3public static int compile(String[] args, PrintWriter out);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3args\fR parameter represents any of the command-line arguments that would typically be passed to the compiler\&.
++.PP
++The \f3out\fR parameter indicates where the compiler diagnostic output is directed\&.
++.PP
++The \f3return\fR value is equivalent to the \f3exit\fR value from \f3javac\fR\&.
++.PP
++\fINote:\fR All other classes and methods found in a package with names that start with \f3com\&.sun\&.tools\&.javac\fR (subpackages of \f3com\&.sun\&.tools\&.javac\fR) are strictly internal and subject to change at any time\&.
++.SH EXAMPLES
++\f3Example 1 Compile a Simple Program\fR
++.PP
++This example shows how to compile the \f3Hello\&.java\fR source file in the greetings directory\&. The class defined in \f3Hello\&.java\fR is called \f3greetings\&.Hello\fR\&. The greetings directory is the package directory both for the source file and the class file and is underneath the current directory\&. This makes it possible to use the default user class path\&. It also makes it unnecessary to specify a separate destination directory with the \f3-d\fR option\&.
++.PP
++The source code in \f3Hello\&.java\fR:
++.sp
++.nf
++\f3package greetings;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class Hello {\fP
++.fi
++.nf
++\f3 public static void main(String[] args) {\fP
++.fi
++.nf
++\f3 for (int i=0; i < args\&.length; i++) {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Hello " + args[i]);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Compile greetings\&.Hello:
++.sp
++.nf
++\f3javac greetings/Hello\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run \f3greetings\&.Hello\fR:
++.sp
++.nf
++\f3java greetings\&.Hello World Universe Everyone\fP
++.fi
++.nf
++\f3Hello World\fP
++.fi
++.nf
++\f3Hello Universe\fP
++.fi
++.nf
++\f3Hello Everyone\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Compile Multiple Source Files\fR
++.PP
++This example compiles the \f3Aloha\&.java\fR, \f3GutenTag\&.java\fR, \f3Hello\&.java\fR, and \f3Hi\&.java\fR source files in the \f3greetings\fR package\&.
++.sp
++.nf
++\f3% javac greetings/*\&.java\fP
++.fi
++.nf
++\f3% ls greetings\fP
++.fi
++.nf
++\f3Aloha\&.class GutenTag\&.class Hello\&.class Hi\&.class\fP
++.fi
++.nf
++\f3Aloha\&.java GutenTag\&.java Hello\&.java Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Specify a User Class Path\fR
++.PP
++After changing one of the source files in the previous example, recompile it:
++.sp
++.nf
++\f3pwd\fP
++.fi
++.nf
++\f3/examples\fP
++.fi
++.nf
++\f3javac greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Because \f3greetings\&.Hi\fR refers to other classes in the \f3greetings\fR package, the compiler needs to find these other classes\&. The previous example works because the default user class path is the directory that contains the package directory\&. If you want to recompile this file without concern for which directory you are in, then add the examples directory to the user class path by setting \f3CLASSPATH\fR\&. This example uses the \f3-classpath\fR option\&.
++.sp
++.nf
++\f3javac \-classpath /examples /examples/greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you change \f3greetings\&.Hi\fR to use a banner utility, then that utility also needs to be accessible through the user class path\&.
++.sp
++.nf
++\f3javac \-classpath /examples:/lib/Banners\&.jar \e\fP
++.fi
++.nf
++\f3 /examples/greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To execute a class in the \f3greetings\fR package, the program needs access to the \f3greetings\fR package, and to the classes that the \f3greetings\fR classes use\&.
++.sp
++.nf
++\f3java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Separate Source Files and Class Files\fR
++.PP
++The following example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
++.sp
++.nf
++\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e \fP
++.fi
++.nf
++\f3\-extdirs "" OldCode\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language be used to compile \f3OldCode\&.java\fR\&. The option \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&. Note that in most cases, the value of the \f3-target\fR option is the value of the \f3-source\fR option; in this example, you can omit the \f3-target\fR option\&.
++.PP
++You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
++.sp
++.nf
++\f3javac \-source 1\&.7 OldCode\&.java\fP
++.fi
++.nf
++\f3warning: [options] bootstrap class path not set in conjunction with \fP
++.fi
++.nf
++\f3\-source 1\&.7\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules (in this example, it uses version 1\&.7 of the Java programming language) combined with the new bootstrap classes, which can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&.
++.PP
++\f3Example 5 Cross Compile\fR
++.PP
++This example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
++.sp
++.nf
++\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e\fP
++.fi
++.nf
++\f3 \-extdirs "" OldCode\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The\f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language to be used to compile OldCode\&.java\&. The \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&.
++.PP
++You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
++.sp
++.nf
++\f3javac \-source 1\&.7 OldCode\&.java\fP
++.fi
++.nf
++\f3warning: [options] bootstrap class path not set in conjunction with \-source 1\&.7\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules combined with the new bootstrap classes\&. This combination can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&. In this example, the compiler uses release 1\&.7 of the Java programming language\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javadoc(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jdb(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/javadoc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/javadoc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Basic Tools
+-.\" Title: javadoc.1
+-.\"
+-.if n .pl 99999
+-.TH javadoc 1 "03 March 2015" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Basic Tools
++.\" Title: javadoc.1
++.\"
++.if n .pl 99999
++.TH javadoc 1 "03 March 2015" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,2957 +47,2957 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javadoc \- Generates HTML pages of API documentation from Java source files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavadoc\fR {\fIpackages\fR|\fIsource\-files\fR} [\fIoptions\fR] [\fI@argfiles\fR]
+-.fi
+-.sp
+-.TP
+-\fIpackages\fR
+-Names of packages that you want to document, separated by spaces, for example \f3java\&.lang java\&.lang\&.reflect java\&.awt\fR\&. If you want to also document the subpackages, use the \f3-subpackages\fR option to specify the packages\&.
+-
+-By default, \f3javadoc\fR looks for the specified packages in the current directory and subdirectories\&. Use the \f3-sourcepath\fR option to specify the list of directories where to look for packages\&.
+-.TP
+-\fIsource-files\fR
+-Names of Java source files that you want to document, separated by spaces, for example \f3Class\&.java Object\&.java Button\&.java\fR\&. By default, \f3javadoc\fR looks for the specified classes in the current directory\&. However, you can specify the full path to the class file and use wildcard characters, for example \f3/home/src/java/awt/Graphics*\&.java\fR\&. You can also specify the path relative to the current directory\&.
+-.TP
+-\fIoptions\fR
+-Command-line options, separated by spaces\&. See Options\&.
+-.TP
+-\fI@argfiles\fR
+-Names of files that contain a list of \f3javadoc\fR command options, package names and source file names in any order\&.
+-.SH DESCRIPTION
+-The \f3javadoc\fR command parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages that describe (by default) the public and protected classes, nested classes (but not anonymous inner classes), interfaces, constructors, methods, and fields\&. You can use the \f3javadoc\fR command to generate the API documentation or the implementation documentation for a set of source files\&.
+-.PP
+-You can run the \f3javadoc\fR command on entire packages, individual source files, or both\&. When documenting entire packages, you can either use the \f3-subpackages\fR option to recursively traverse a directory and its subdirectories, or to pass in an explicit list of package names\&. When you document individual source files, pass in a list of Java source file names\&. See Simple Examples\&.
+-.SS PROCESS\ SOURCE\ FILES
+-The \f3javadoc\fR command processes files that end in source and other files described in Source Files\&. If you run the \f3javadoc\fR command by passing in individual source file names, then you can determine exactly which source files are processed\&. However, that is not how most developers want to work, because it is simpler to pass in package names\&. The \f3javadoc\fR command can be run three ways without explicitly specifying the source file names\&. You can pass in package names, use the \f3-subpackages\fR option, or use wild cards with source file names\&. In these cases, the \f3javadoc\fR command processes a source file only when the file fulfills all of the following requirements:
+-.TP 0.2i
+-\(bu
+-The file name prefix (with \f3\&.java\fR removed) is a valid class name\&.
+-.TP 0.2i
+-\(bu
+-The path name relative to the root of the source tree is a valid package name after the separators are converted to dots\&.
+-.TP 0.2i
+-\(bu
+-The package statement contains the valid package name\&.
+-.PP
+-Processing Links
+-
+-During a run, the \f3javadoc\fR command adds cross-reference links to package, class, and member names that are being documented as part of that run\&. Links appear in the following places\&. See Javadoc Tags for a description of the @ tags\&.
+-.TP 0.2i
+-\(bu
+-Declarations (return types, argument types, and field types)\&.
+-.TP 0.2i
+-\(bu
+-\fISee Also\fR sections that are generated from \f3@see\fR tags\&.
+-.TP 0.2i
+-\(bu
+-Inline text generated from \f3{@link}\fR tags\&.
+-.TP 0.2i
+-\(bu
+-Exception names generated from \f3@throws\fR tags\&.
+-.TP 0.2i
+-\(bu
+-\fISpecified by\fR links to interface members and \fIOverrides\fR links to class members\&. See Method Comment Inheritance\&.
+-.TP 0.2i
+-\(bu
+-Summary tables listing packages, classes and members\&.
+-.TP 0.2i
+-\(bu
+-Package and class inheritance trees\&.
+-.TP 0.2i
+-\(bu
+-The index\&.
+-.PP
+-You can add links to existing text for classes not included on the command line (but generated separately) by way of the \f3-link\fR and \f3-linkoffline\fR options\&.
+-.PP
+-Processing Details
+-
+-The \f3javadoc\fR command produces one complete document every time it runs\&. It does not do incremental builds that modify or directly incorporate the results from earlier runs\&. However, the \f3javadoc\fR command can link to results from other runs\&.
+-.PP
+-The \f3javadoc\fR command implementation requires and relies on the Java compiler\&. The \f3javadoc\fR command calls part of the \f3javac\fR command to compile the declarations and ignore the member implementations\&. The \f3javadoc\fR command builds a rich internal representation of the classes that includes the class hierarchy and use relationships to generate the HTML\&. The \f3javadoc\fR command also picks up user-supplied documentation from documentation comments in the source code\&. See Documentation Comments\&.
+-.PP
+-The \f3javadoc\fR command runs on source files that are pure stub files with no method bodies\&. This means you can write documentation comments and run the \f3javadoc\fR command in the early stages of design before API implementation\&.
+-.PP
+-Relying on the compiler ensures that the HTML output corresponds exactly with the actual implementation, which may rely on implicit, rather than explicit, source code\&. For example, the \f3javadoc\fR command documents default constructors that are present in the compiled class files but not in the source code\&.
+-.PP
+-In many cases, the \f3javadoc\fR command lets you generate documentation for source files with incomplete or erroneous code\&. You can generate documentation before all debugging and troubleshooting is done\&. The \f3javadoc\fR command does primitive checking of documentation comments\&.
+-.PP
+-When the \f3javadoc\fR command builds its internal structure for the documentation, it loads all referenced classes\&. Because of this, the \f3javadoc\fR command must be able to find all referenced classes, whether bootstrap classes, extensions, or user classes\&. See How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-.PP
+-Typically, classes you create must either be loaded as an extension or in the \f3javadoc\fR command class path\&.
+-.SS JAVADOC\ DOCLETS
+-You can customize the content and format of the \f3javadoc\fR command output with doclets\&. The \f3javadoc\fR command has a default built-in doclet, called the standard doclet, that generates HTML-formatted API documentation\&. You can modify or make a subclass of the standard doclet, or write your own doclet to generate HTML, XML, MIF, RTF or whatever output format you want\&.
+-.PP
+-When a custom doclet is not specified with the \f3-doclet\fR option, the \f3javadoc\fR command uses the default standard doclet\&. The \f3javadoc\fR command has several options that are available regardless of which doclet is being used\&. The standard doclet adds a supplementary set of command-line options\&. See Options\&.
+-.SH SOURCE\ FILES
+-The \f3javadoc\fR command generates output that originates from the following types of source files: Java language source files for classes (\f3\&.java\fR), package comment files, overview comment files, and miscellaneous unprocessed files\&. This section also describes test files and template files that can also be in the source tree, but that you want to be sure not to document\&.
+-.SS CLASS\ SOURCE\ FILES
+-Each class or interface and its members can have their own documentation comments contained in a source file\&. See Documentation Comments\&.
+-.SS PACKAGE\ COMMENT\ FILES
+-Each package can have its own documentation comment, contained in its own source file, that the \f3javadoc\fR command merges into the generated package summary page\&. You typically include in this comment any documentation that applies to the entire package\&.
+-.PP
+-To create a package comment file, you can place your comments in one of the following files:
+-.TP 0.2i
+-\(bu
+-The \f3package-info\&.java\fR file can contain the package declaration, package annotations, package comments, and Javadoc tags\&. This file is preferred\&.
+-.TP 0.2i
+-\(bu
+-The \f3package\&.html\fR file contains only package comments and Javadoc tags\&. No package annotations\&.
+-.PP
+-A package can have a single \f3package\&.html\fR file or a single \f3package-info\&.java\fR file, but not both\&. Place either file in the package directory in the source tree with your source files\&.
+-.PP
+-The package-info\&.java File
+-
+-The \f3package-info\&.java\fR file can contain a package comment of the following structure\&. The comment is placed before the package declaration\&.
+-.PP
+-\fINote:\fR The comment separators \f3/**\fR and \f3*/\fR must be present, but the leading asterisks on the intermediate lines can be left off\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Provides the classes necessary to create an \fP
+-.fi
+-.nf
+-\f3 * applet and the classes an applet uses \fP
+-.fi
+-.nf
+-\f3 * to communicate with its applet context\&.\fP
+-.fi
+-.nf
+-\f3 * <p>\fP
+-.fi
+-.nf
+-\f3 * The applet framework involves two entities:\fP
+-.fi
+-.nf
+-\f3 * the applet and the applet context\&.\fP
+-.fi
+-.nf
+-\f3 * An applet is an embeddable window (see the\fP
+-.fi
+-.nf
+-\f3 * {@link java\&.awt\&.Panel} class) with a few extra\fP
+-.fi
+-.nf
+-\f3 * methods that the applet context can use to \fP
+-.fi
+-.nf
+-\f3 * initialize, start, and stop the applet\&.\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @since 1\&.0\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3package java\&.lang\&.applet;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-The package\&.html File
+-
+-The \f3package\&.html\fR file can contain a package comment of the following structure\&. The comment is placed in the \f3<body>\fR element\&.
+-.PP
+-File: \f3java/applet/package\&.html\fR
+-.sp
+-.nf
+-\f3<HTML>\fP
+-.fi
+-.nf
+-\f3<BODY>\fP
+-.fi
+-.nf
+-\f3Provides the classes necessary to create an applet and the \fP
+-.fi
+-.nf
+-\f3classes an applet uses to communicate with its applet context\&.\fP
+-.fi
+-.nf
+-\f3<p>\fP
+-.fi
+-.nf
+-\f3The applet framework involves two entities: the applet\fP
+-.fi
+-.nf
+-\f3and the applet context\&. An applet is an embeddable\fP
+-.fi
+-.nf
+-\f3window (see the {@link java\&.awt\&.Panel} class) with a\fP
+-.fi
+-.nf
+-\f3few extra methods that the applet context can use to\fP
+-.fi
+-.nf
+-\f3initialize, start, and stop the applet\&. \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@since 1\&.0 \fP
+-.fi
+-.nf
+-\f3@see java\&.awt\fP
+-.fi
+-.nf
+-\f3</BODY>\fP
+-.fi
+-.nf
+-\f3</HTML>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3package\&.html\fR file is a typical HTML file and does not include a package declaration\&. The content of the package comment file is written in HTML with one exception\&. The documentation comment should not include the comment separators \f3/**\fR and \f3*/\fR or leading asterisks\&. When writing the comment, make the first sentence a summary about the package, and do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. You can include package tags\&. All block tags must appear after the main description\&. If you add an \f3@see\fR tag in a package comment file, then it must have a fully qualified name\&.
+-.PP
+-Processing the Comment File
+-
+-When the \f3javadoc\fR command runs, it searches for the package comment file\&. If the package comment file is found, then the \f3javadoc\fR command does the following:
+-.TP 0.2i
+-\(bu
+-Copies the comment for processing\&. For package\&.html, the \f3javadoc\fR command copies all content between the \f3<body>\fR and \f3</body>\fR HTML tags\&. You can include a \f3<head>\fR section to put a \f3<title>\fR tag, source file copyright statement, or other information, but none of these appear in the generated documentation\&.
+-.TP 0.2i
+-\(bu
+-Processes the package tags\&. See Package Tags\&.
+-.TP 0.2i
+-\(bu
+-Inserts the processed text at the bottom of the generated package summary page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-.TP 0.2i
+-\(bu
+-Copies the first sentence of the package comment to the top of the package summary page\&. The \f3javadoc\fR command also adds the package name and this first sentence to the list of packages on the overview page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-
+-The end of the sentence is determined by the same rules used for the end of the first sentence of class and member main descriptions\&.
+-.SS OVERVIEW\ COMMENT\ FILES
+-Each application or set of packages that you are documenting can have its own overview documentation comment that is kept in its own source file, that the \f3javadoc\fR command merges into the generated overview page\&. You typically include in this comment any documentation that applies to the entire application or set of packages\&.
+-.PP
+-You can name the file anything you want such as overview\&.html and place it anywhere\&. A typical location is at the top of the source tree\&.
+-.PP
+-For example, if the source files for the \f3java\&.applet\fR package are contained in the /home/user/src/java/applet directory, then you could create an overview comment file at /home/user/src/overview\&.html\&.
+-.PP
+-You can have multiple overview comment files for the same set of source files in case you want to run the \f3javadoc\fR command multiple times on different sets of packages\&. For example, you could run the \f3javadoc\fR command once with \f3-private\fR for internal documentation and again without that option for public documentation\&. In this case, you could describe the documentation as public or internal in the first sentence of each overview comment file\&.
+-.PP
+-The content of the overview comment file is one big documentation comment that is written in HTML\&. Make the first sentence a summary about the application or set of packages\&. Do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. All tags except inline tags, such as an {\f3@link}\fR tag, must appear after the main description\&. If you add an \f3@see\fR tag, then it must have a fully qualified name\&.
+-.PP
+-When you run the \f3javadoc\fR command, specify the overview comment file name with the \f3-overview\fR option\&. The file is then processed similarly to that of a package comment file\&. The \f3javadoc\fR command does the following:
+-.TP 0.2i
+-\(bu
+-Copies all content between the \f3<body>\fR and \f3</body>\fR tags for processing\&.
+-.TP 0.2i
+-\(bu
+-Processes the overview tags that are present\&. See Overview Tags\&.
+-.TP 0.2i
+-\(bu
+-Inserts the processed text at the bottom of the generated overview page\&. See Java Platform Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-.TP 0.2i
+-\(bu
+-Copies the first sentence of the overview comment to the top of the overview summary page\&.
+-.SS UNPROCESSED\ FILES
+-Your source files can include any files that you want the \f3javadoc\fR command to copy to the destination directory\&. These files usually include graphic files, example Java source and class files, and self-standing HTML files with a lot of content that would overwhelm the documentation comment of a typical Java source file\&.
+-.PP
+-To include unprocessed files, put them in a directory called doc-files\&. The doc-files directory can be a subdirectory of any package directory that contains source files\&. You can have one doc-files subdirectory for each package\&.
+-.PP
+-For example, if you want to include the image of a button in the \f3java\&.awt\&.Button\fR class documentation, then place the image file in the /home/user/src/java/awt/doc-files/ directory\&. Do not place the doc-files directory at /home/user/src/java/doc-files, because java is not a package\&. It does not contain any source files\&.
+-.PP
+-All links to the unprocessed files must be included in the code because the \f3javadoc\fR command does not look at the files\&. The \f3javadoc\fR command copies the directory and all of its contents to the destination\&. The following example shows how the link in the Button\&.java documentation comment might look:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This button looks like this: \fP
+-.fi
+-.nf
+-\f3 * <img src="doc\-files/Button\&.gif">\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS TEST\ AND\ TEMPLATE\ FILES
+-You can store test and template files in the source tree in the same directory with or in a subdirectory of the directory where the source files reside\&. To prevent test and template files from being processed, run the \f3javadoc\fR command and explicitly pass in individual source file names\&.
+-.PP
+-Test files are valid, compilable source files\&. Template files are not valid, compatible source files, but they often have the \f3\&.java\fR suffix\&.
+-.PP
+-Test Files
+-
+-If you want your test files to belong to either an unnamed package or to a package other than the package that the source files are in, then put the test files in a subdirectory underneath the source files and give the directory an invalid name\&. If you put the test files in the same directory with the source and call the \f3javadoc\fR command with a command-line argument that indicates its package name, then the test files cause warnings or errors\&. If the files are in a subdirectory with an invalid name, then the test file directory is skipped and no errors or warnings are issued\&. For example, to add test files for source files in com\&.package1, put them in a subdirectory in an invalid package name\&. The following directory name is invalid because it contains a hyphen:
+-.sp
+-.nf
+-\f3com/package1/test\-files/\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If your test files contain documentation comments, then you can set up a separate run of the \f3javadoc\fR command to produce test file documentation by passing in their test source file names with wild cards, such as \f3com/package1/test-files/*\&.java\fR\&.
+-.PP
+-Template Files
+-
+-If you want a template file to be in the source directory, but not generate errors when you execute the \f3javadoc\fR command, then give it an invalid file name such as \f3Buffer-Template\&.java\fR to prevent it from being processed\&. The \f3javadoc\fR command only processes source files with names, when stripped of the \f3\&.java\fR suffix, that are valid class names\&.
+-.SH GENERATED\ FILES
+-By default, the \f3javadoc\fR command uses a standard doclet that generates HTML-formatted documentation\&. The standard doclet generates basic content, cross-reference, and support pages described here\&. Each HTML page corresponds to a separate file\&. The \f3javadoc\fR command generates two types of files\&. The first type is named after classes and interfaces\&. The second type contain hyphens (such as package-summary\&.html) to prevent conflicts with the first type of file\&.
+-.SS BASIC\ CONTENT\ PAGES
+-.TP 0.2i
+-\(bu
+-One class or interface page (classname\&.html) for each class or interface being documented\&.
+-.TP 0.2i
+-\(bu
+-One package page (package-summary\&.html) for each package being documented\&. The \f3javadoc\fR command includes any HTML text provided in a file with the name package\&.html or package-info\&.java in the package directory of the source tree\&.
+-.TP 0.2i
+-\(bu
+-One overview page (overview-summary\&.html) for the entire set of packages\&. The overview page is the front page of the generated document\&. The \f3javadoc\fR command includes any HTML text provided in a file specified by the \f3-overview\fR option\&. The Overview page is created only when you pass two or more package names into the \f3javadoc\fR command\&. See HTML Frames and Options\&.
+-.SS CROSS-REFERENCE\ PAGES
+-.TP 0.2i
+-\(bu
+-One class hierarchy page for the entire set of packages (overview-tree\&.html)\&. To view the hierarchy page, click \fIOverview\fR in the navigation bar and click \fITree\fR\&.
+-.TP 0.2i
+-\(bu
+-One class hierarchy page for each package (package-tree\&.html) To view the hierarchy page, go to a particular package, class, or interface page, and click \fITree\fR to display the hierarchy for that package\&.
+-.TP 0.2i
+-\(bu
+-One use page for each package (package-use\&.html) and a separate use page for each class and interface (class-use/classname\&.html)\&. The use page describes what packages, classes, methods, constructors and fields use any part of the specified class, interface, or package\&. For example, given a class or interface A, its use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A\&. To view the use page, go to the package, class, or interface and click the \fIUse\fR link in the navigation bar\&.
+-.TP 0.2i
+-\(bu
+-A deprecated API page (deprecated-list\&.html) that lists all deprecated APIs and their suggested replacements\&. Avoid deprecated APIs because they can be removed in future implementations\&.
+-.TP 0.2i
+-\(bu
+-A constant field values page (constant-values\&.html) for the values of static fields\&.
+-.TP 0.2i
+-\(bu
+-A serialized form page (serialized-form\&.html) that provides information about serializable and externalizable classes with field and method descriptions\&. The information on this page is of interest to reimplementors, and not to developers who want to use the API\&. To access the serialized form page, go to any serialized class and click \fISerialized Form\fR in the See Also section of the class comment\&. The standard doclet generates a serialized form page that lists any class (public or non-public) that implements Serializable with its \f3readObject\fR and \f3writeObject\fR methods, the fields that are serialized, and the documentation comments from the \f3@serial\fR, \f3@serialField\fR, and \f3@serialData\fR tags\&. Public serializable classes can be excluded by marking them (or their package) with \f3@serial\fR exclude, and package-private serializable classes can be included by marking them (or their package) with an \f3@serial\fR include\&. As of Release 1\&.4, you can generate the complete serialized form for public and private classes by running the \f3javadoc\fR command without specifying the \f3-private\fR option\&. See Options\&.
+-.TP 0.2i
+-\(bu
+-An index page (\f3index-*\&.html\fR) of all class, interface, constructor, field and method names, in alphabetical order\&. The index page is internationalized for Unicode and can be generated as a single file or as a separate file for each starting character (such as A\(enZ for English)\&.
+-.SS SUPPORT\ PAGES
+-.TP 0.2i
+-\(bu
+-A help page (help-doc\&.html) that describes the navigation bar and the previous pages\&. Use \f3-helpfile\fR to override the default help file with your own custom help file\&.
+-.TP 0.2i
+-\(bu
+-One index\&.html file that creates the HTML frames for display\&. Load this file to display the front page with frames\&. The index\&.html file contains no text content\&.
+-.TP 0.2i
+-\(bu
+-Several frame files (\f3*-frame\&.html\fR) that contains lists of packages, classes, and interfaces\&. The frame files display the HTML frames\&.
+-.TP 0.2i
+-\(bu
+-A package list file (package-list) that is used by the \f3-link\fR and \f3-linkoffline\fR options\&. The package list file is a text file that is not reachable through links\&.
+-.TP 0.2i
+-\(bu
+-A style sheet file (stylesheet\&.css) that controls a limited amount of color, font family, font size, font style, and positioning information on the generated pages\&.
+-.TP 0.2i
+-\(bu
+-A doc-files directory that holds image, example, source code, or other files that you want copied to the destination directory\&. These files are not processed by the \f3javadoc\fR command\&. This directory is not processed unless it exists in the source tree\&.
+-.PP
+-See Options\&.
+-.SS HTML\ FRAMES
+-The \f3javadoc\fR command generates the minimum number of frames (two or three) necessary based on the values passed to the command\&. It omits the list of packages when you pass a single package name or source files that belong to a single package as an argument to the \f3javadoc\fR command\&. Instead, the \f3javadoc\fR command creates one frame in the left-hand column that displays the list of classes\&. When you pass two or more package names, the \f3javadoc\fR command creates a third frame that lists all packages and an overview page (overview-summary\&.html)\&. To bypass frames, click the \fINo Frames\fR link or enter the page set from the overview-summary\&.html page\&.
+-.SS GENERATED\ FILE\ STRUCTURE
+-The generated class and interface files are organized in the same directory hierarchy that Java source files and class files are organized\&. This structure is one directory per subpackage\&.
+-.PP
+-For example, the document generated for the \f3java\&.applet\&.Applet\fR class would be located at java/applet/Applet\&.html\&.
+-.PP
+-The file structure for the \f3java\&.applet\fR package follows, assuming that the destination directory is named \f3apidocs\fR\&. All files that contain the word \fIframe\fR appear in the upper-left or lower-left frames, as noted\&. All other HTML files appear in the right-hand frame\&.
+-.PP
+-Directories are bold\&. The asterisks (*) indicate the files and directories that are omitted when the arguments to the \f3javadoc\fR command are source file names rather than package names\&. When arguments are source file names, an empty package list is created\&. The doc-files directory is not created in the destination unless it exists in the source tree\&. See Generated Files\&.
+-.TP 0.2i
+-\(bu
+-\fIapidocs\fR: Top-level directory
+-.RS
+-.TP 0.2i
+-\(bu
+-index\&.html: Initial Page that sets up HTML frames
+-.TP 0.2i
+-\(bu
+-*overview-summary\&.html: Package list with summaries
+-.TP 0.2i
+-\(bu
+-overview-tree\&.html: Class hierarchy for all packages
+-.TP 0.2i
+-\(bu
+-deprecated-list\&.html: Deprecated APIs for all packages
+-.TP 0.2i
+-\(bu
+-constant-values\&.html: Static field values for all packages
+-.TP 0.2i
+-\(bu
+-serialized-form\&.html: Serialized forms for all packages
+-.TP 0.2i
+-\(bu
+-*overview-frame\&.html: All packages for display in upper-left frame
+-.TP 0.2i
+-\(bu
+-allclasses-frame\&.html: All classes for display in lower-left frame
+-.TP 0.2i
+-\(bu
+-help-doc\&.html: Help about Javadoc page organization
+-.TP 0.2i
+-\(bu
+-index-all\&.html: Default index created without \f3-splitindex\fR option
+-.TP 0.2i
+-\(bu
+-\fIindex-files\fR: Directory created with \f3-splitindex\fR option
+-.RS
+-.TP 0.2i
+-\(bu
+-index-<number>\&.html: Index files created with \f3-splitindex\fR option
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-package-list: Package names for resolving external references
+-.TP 0.2i
+-\(bu
+-stylesheet\&.css: Defines fonts, colors, positions, and so on
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-\fIjava\fR: Package directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIapplet\fR: Subpackage directory
+-.RS
+-.TP 0.2i
+-\(bu
+-Applet\&.html: \f3Applet\fR class page
+-.TP 0.2i
+-\(bu
+-AppletContext\&.html: \f3AppletContext\fR interface
+-.TP 0.2i
+-\(bu
+-AppletStub\&.html: \f3AppletStub\fR interface
+-.TP 0.2i
+-\(bu
+-AudioClip\&.html: \f3AudioClip\fR interface
+-.TP 0.2i
+-\(bu
+-package-summary\&.html: Classes with summaries
+-.TP 0.2i
+-\(bu
+-package-frame\&.html: Package classes for display in lower-left frame
+-.TP 0.2i
+-\(bu
+-package-tree\&.html: Class hierarchy for this package
+-.TP 0.2i
+-\(bu
+-package-use\&.html: Where this package is used
+-.TP 0.2i
+-\(bu
+-\fIdoc-files\fR: Image and example files directory
+-.TP 0.2i
+-\(bu
+-\fIclass-use\fR: Image and examples file location
+-
+-- Applet\&.html: Uses of the Applet class
+-
+-- AppletContext\&.html: Uses of the \f3AppletContext\fR interface
+-
+-- AppletStub\&.html: Uses of the \f3AppletStub\fR interface
+-
+-- AudioClip\&.html: Uses of the \f3AudioClip\fR interface
+-.RE
+-
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-\fIsrc-html\fR: Source code directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIjava\fR: Package directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIapplet\fR: Subpackage directory
+-
+-- Applet\&.html: Applet source code
+-
+-- AppletContext\&.html: \f3AppletContext\fR source code
+-
+-- AppletStub\&.html: \f3AppletStub\fR source code
+-
+-- AudioClip\&.html: \f3AudioClip\fR source code
+-.RE
+-
+-.RE
+-
+-.SS GENERATED\ API\ DECLARATIONS
+-The \f3javadoc\fR command generates a declaration at the start of each class, interface, field, constructor, and method description for that API item\&. For example, the declaration for the \f3Boolean\fR class is:
+-.sp
+-.nf
+-\f3public final class Boolean\fP
+-.fi
+-.nf
+-\f3extends Object\fP
+-.fi
+-.nf
+-\f3implements Serializable\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The declaration for the \f3Boolean\&.valueOf\fR method is:
+-.sp
+-.nf
+-\f3public static Boolean valueOf(String s)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3javadoc\fR command can include the modifiers \f3public\fR, \f3protected\fR, \f3private\fR, \f3abstract\fR, \f3final\fR, \f3static\fR, \f3transient\fR, and \f3volatile\fR, but not \f3synchronized\fR or \f3native\fR\&. The \f3synchronized\fR and \f3native\fR modifiers are considered implementation detail and not part of the API specification\&.
+-.PP
+-Rather than relying on the keyword \f3synchronized\fR, APIs should document their concurrency semantics in the main description of the comment\&. For example, a description might be: A single enumeration cannot be used by multiple threads concurrently\&. The document should not describe how to achieve these semantics\&. As another example, while the \f3Hashtable\fR option should be thread-safe, there is no reason to specify that it is achieved by synchronizing all of its exported methods\&. It is better to reserve the right to synchronize internally at the bucket level for higher concurrency\&.
+-.SH DOCUMENTATION\ COMMENTS
+-This section describes source code comments and comment inheritance\&.
+-.SS SOURCE\ CODE\ COMMENTS
+-You can include documentation comments in the source code, ahead of declarations for any class, interface, method, constructor, or field\&. You can also create documentation comments for each package and another one for the overview, though their syntax is slightly different\&. A documentation comment consists of the characters between \f3/**\fR and \f3*/\fR that end it\&. Leading asterisks are allowed on each line and are described further in the following section\&. The text in a comment can continue onto multiple lines\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is the typical format of a simple documentation comment\fP
+-.fi
+-.nf
+-\f3 * that spans two lines\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To save space you can put a comment on one line:
+-.sp
+-.nf
+-\f3/** This comment takes up only one line\&. */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Placement of Comments
+-
+-Documentation comments are recognized only when placed immediately before class, interface, constructor, method, or field declarations\&. Documentation comments placed in the body of a method are ignored\&. The \f3javadoc\fR command recognizes only one documentation comment per declaration statement\&. See Where Tags Can Be Used\&.
+-.PP
+-A common mistake is to put an \f3import\fR statement between the class comment and the class declaration\&. Do not put an \f3import\fR statement at this location because the \f3javadoc\fR command ignores the class comment\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is the class comment for the class Whatever\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3import com\&.example; // MISTAKE \- Important not to put import statement here\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class Whatever{ }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Parts of Comments
+-
+-A documentation comment has a main description followed by a tag section\&. The main description begins after the starting delimiter \f3/**\fR and continues until the tag section\&. The tag section starts with the first block tag, which is defined by the first \f3@\fR character that begins a line (ignoring leading asterisks, white space, and leading separator \f3/**\fR)\&. It is possible to have a comment with only a tag section and no main description\&. The main description cannot continue after the tag section begins\&. The argument to a tag can span multiple lines\&. There can be any number of tags, and some types of tags can be repeated while others cannot\&. For example, this \f3@see\fR tag starts the tag section:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This sentence holds the main description for this documentation comment\&.\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Object\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Block and inline Tags
+-
+-A tag is a special keyword within a documentation comment that the \f3javadoc\fR command processes\&. There are two kinds of tags: block tags, which appear as an \f3@tag\fR tag (also known as standalone tags), and inline tags, which appear within braces, as an \f3{@tag}\fR tag\&. To be interpreted, a block tag must appear at the beginning of a line, ignoring leading asterisks, white space, and the separator (\f3/**\fR)\&. This means you can use the \f3@\fR character elsewhere in the text and it will not be interpreted as the start of a tag\&. If you want to start a line with the \f3@\fR character and not have it be interpreted, then use the HTML entity \f3&#064;\fR\&. Each block tag has associated text, which includes any text following the tag up to, but not including, either the next tag, or the end of the documentation comment\&. This associated text can span multiple lines\&. An inline tag is allowed and interpreted anywhere that text is allowed\&. The following example contains the \f3@deprecated\fR block tag and the \f3{@link}\fR inline tag\&. See Javadoc Tags\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @deprecated As of JDK 1\&.1, replaced by {@link #setBounds(int,int,int,int)}\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Write Comments in HTML
+-
+-The text must be written in HTML with HTML entities and HTML tags\&. You can use whichever version of HTML your browser supports\&. The standard doclet generates HTML 3\&.2-compliant code elsewhere (outside of the documentation comments) with the inclusion of cascading style sheets and frames\&. HTML 4\&.0 is preferred for generated files because of the frame sets\&.
+-.PP
+-For example, entities for the less than symbol (<) and the greater than symbol (>) should be written as \f3&lt;\fR and \f3&gt;\fR\&. Similarly, the ampersand (&) should be written as \f3&amp;\fR\&. The bold HTML tag \f3<b>\fR is shown in the following example\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is a <b>doc</b> comment\&.\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Object\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Leading Asterisks
+-
+-When the \f3javadoc\fR command parses a documentation comment, leading asterisks (*) on each line are discarded, and blanks and tabs that precede the initial asterisks (*) are also discarded\&. If you omit the leading asterisk on a line, then the leading white space is no longer removed so that you can paste code examples directly into a documentation comment inside a \f3<PRE>\fR tag with its indentation preserved\&. Spaces are interpreted by browsers more uniformly than tabs\&. Indentation is relative to the left margin (rather than the separator \f3/**\fR or \f3<PRE>\fR tag)\&.
+-.PP
+-First Sentence
+-
+-The first sentence of each documentation comment should be a summary sentence that contains a concise but complete description of the declared entity\&. This sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first block tag\&. The \f3javadoc\fR command copies this first sentence to the member summary at the top of the HTML page\&.
+-.PP
+-Multiple-Field Declarations
+-
+-The Java platform lets you declare multiple fields in a single statement, but this statement can have only one documentation comment that is copied for all fields\&. If you want individual documentation comments for each field, then declare each field in a separate statement\&. For example, the following documentation comment does not make sense written as a single declaration and would be better handled as two declarations:
+-.sp
+-.nf
+-\f3/** \fP
+-.fi
+-.nf
+-\f3 * The horizontal and vertical distances of point (x,y)\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public int x, y; // Avoid this \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3javadoc\fR command generates the following documentation from the previous code:
+-.sp
+-.nf
+-\f3public int x\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The horizontal and vertical distances of point (x, y)\&.
+-.sp
+-.nf
+-\f3public int y\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The horizontal and vertical distances of point (x, y)\&.
+-.PP
+-Use of Header Tags
+-
+-When writing documentation comments for members, it is best not to use HTML heading tags such as \f3<H1>\fR and \f3<H2>\fR, because the \f3javadoc\fR command creates an entire structured document, and these structural tags might interfere with the formatting of the generated document\&. However, you can use these headings in class and package comments to provide your own structure\&.
+-.SS METHOD\ COMMENT\ INHERITANCE
+-The \f3javadoc\fR command allows method comment inheritance in classes and interfaces to fill in missing text or to explicitly inherit method comments\&. Constructors, fields, and nested classes do not inherit documentation comments\&.
+-.PP
+-\fINote:\fR The source file for an inherited method must be on the path specified by the \f3-sourcepath\fR option for the documentation comment to be available to copy\&. Neither the class nor its package needs to be passed in on the command line\&. This contrasts with Release 1\&.3\&.\fIn\fR and earlier releases, where the class had to be a documented class\&.
+-.PP
+-Fill in Missing Text
+-
+-When a main description, or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag is missing from a method comment, the \f3javadoc\fR command copies the corresponding main description or tag comment from the method it overrides or implements (if any)\&. See Method Comment Inheritance\&.
+-.PP
+-When an \f3@param\fR tag for a particular parameter is missing, the comment for that parameter is copied from the method further up the inheritance hierarchy\&. When an \f3@throws\fR tag for a particular exception is missing, the \f3@throws\fR tag is copied only when that exception is declared\&.
+-.PP
+-This behavior contrasts with Release 1\&.3 and earlier, where the presence of any main description or tag would prevent all comments from being inherited\&.
+-.PP
+-See Javadoc Tags and Options\&.
+-.PP
+-Explicit Inheritance
+-
+-Insert the \f3{@inheritDoc}\fR inline tag in a method main description or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag comment\&. The corresponding inherited main description or tag comment is copied into that spot\&.
+-.SS CLASS\ AND\ INTERFACE\ INHERITANCE
+-Comment inheritance occurs in all possible cases of inheritance from classes and interfaces:
+-.TP 0.2i
+-\(bu
+-When a method in a class overrides a method in a superclass
+-.TP 0.2i
+-\(bu
+-When a method in an interface overrides a method in a superinterface
+-.TP 0.2i
+-\(bu
+-When a method in a class implements a method in an interface
+-.PP
+-In the first two cases, the \f3javadoc\fR command generates the subheading \fIOverrides\fR in the documentation for the overriding method\&. A link to the method being overridden is included, whether or not the comment is inherited\&.
+-.PP
+-In the third case, when a method in a specified class implements a method in an interface, the \f3javadoc\fR command generates the subheading \fISpecified by\fR in the documentation for the overriding method\&. A link to the method being implemented is included, whether or not the comment is inherited\&.
+-.SS METHOD\ COMMENTS\ ALGORITHM
+-If a method does not have a documentation comment, or has an \f3{@inheritDoc}\fR tag, then the \f3javadoc\fR command uses the following algorithm to search for an applicable comment\&. The algorithm is designed to find the most specific applicable documentation comment, and to give preference to interfaces over superclasses:
+-.TP 0.4i
+-1\&.
+-Look in each directly implemented (or extended) interface in the order they appear following the word \f3implements\fR (or \f3extends\fR) in the method declaration\&. Use the first documentation comment found for this method\&.
+-.TP 0.4i
+-2\&.
+-If Step 1 failed to find a documentation comment, then recursively apply this entire algorithm to each directly implemented (or extended) interface in the same order they were examined in Step 1\&.
+-.TP 0.4i
+-3\&.
+-When Step 2 fails to find a documentation comment and this is a class other than the \f3Object\fR class, but not an interface:
+-.RS
+-.TP 0.4i
+-1\&.
+-If the superclass has a documentation comment for this method, then use it\&.
+-.TP 0.4i
+-2\&.
+-If Step 3a failed to find a documentation comment, then recursively apply this entire algorithm to the superclass\&.
+-.RE
+-
+-.SH JAVADOC\ TAGS
+-The \f3javadoc\fR command parses special tags when they are embedded within a Java documentation comment\&. The \f3javadoc\fR tags let you autogenerate a complete, well-formatted API from your source code\&. The tags start with an at sign (\f3@\fR) and are case-sensitive\&. They must be typed with the uppercase and lowercase letters as shown\&. A tag must start at the beginning of a line (after any leading spaces and an optional asterisk), or it is treated as text\&. By convention, tags with the same name are grouped together\&. For example, put all \f3@see\fR tags together\&. For more information, see Where Tags Can Be Used\&.
+-.PP
+-Tags have the following types:
+-.TP 0.2i
+-\(bu
+-Bock tags: Place block tags only in the tag section that follows the description\&. Block tags have the form: \fI@tag\fR\&.
+-.TP 0.2i
+-\(bu
+-Inline tags: Place inline tags anywhere in the main description or in the comments for block tags\&. Inline tags are enclosed within braces: \fI{@tag}\fR\&.
+-.PP
+-For custom tags, see -tag tagname:Xaoptcmf:"taghead"\&. See also Where Tags Can Be Used\&.
+-.SS TAG\ DESCRIPTIONS
+-.TP
+-@author \fIname-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds an Author entry with the specified name text to the generated documents when the \f3-author\fR option is used\&. A documentation comment can contain multiple \f3@author\fR tags\&. You can specify one name per \f3@author\fR tag or multiple names per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and space between names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line if you want a localized name separator other than a comma\&. See @author in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@author
+-.TP
+-{@code \fItext\fR}
+-Introduced in JDK 1\&.5
+-
+-Equivalent to \f3<code>{@literal}</code>\fR\&.
+-
+-Displays text in code font without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use regular angle brackets (< and >) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (\f3<-\fR)\&. For example, the documentation comment text \f3{@code A<B>C}\fR displayed in the generated HTML page unchanged as \f3A<B>C\fR\&. This means that the \f3<B>\fR is not interpreted as bold and is in code font\&. If you want the same functionality without the code font, then use the \f3{@literal}\fR tag\&.
+-.TP
+-@deprecated \fIdeprecated-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a comment indicating that this API should no longer be used (even though it may continue to work)\&. The \f3javadoc\fR command moves \f3deprecated-text\fRahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field\&.
+-
+-The first sentence of deprecated text should tell the user when the API was deprecated and what to use as a replacement\&. The \f3javadoc\fR command copies the first sentence to the summary section and index\&. Subsequent sentences can also explain why it was deprecated\&. You should include an \f3{@link}\fR tag (for Javadoc 1\&.2 or later) that points to the replacement API\&.
+-
+-Use the \fI@deprecated annotation\fR tag to deprecate a program element\&. See How and When to Deprecate APIs at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html
+-
+-See also @deprecated in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@deprecated
+-.TP
+-{@docRoot}
+-Introduced in JDK 1\&.3
+-
+-Represents the relative path to the generated document\&'s (destination) root directory from any generated page\&. This tag is useful when you want to include a file, such as a copyright page or company logo, that you want to reference from all generated pages\&. Linking to the copyright page from the bottom of each page is common\&.
+-
+-This \f3{@docRoot}\fR tag can be used both on the command line and in a documentation comment\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, and includes the text portion of any tag (such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags)\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-On the command line, where the header, footer, or bottom are defined: \f3javadoc -bottom \&'<a href="{@docRoot}/copyright\&.html">Copyright</a>\&'\fR\&.
+-
+-When you use the \f3{@docRoot}\fR tag this way in a make file, some \f3makefile\fR programs require a special way to escape for the brace \f3{}\fR characters\&. For example, the Inprise MAKE version 5\&.2 running on Windows requires double braces: \f3{{@docRoot}}\fR\&. It also requires double (rather than single) quotation marks to enclose arguments to options such as the \f3-bottom\fR option (with the quotation marks around the \f3href\fR argument omitted)\&.
+-.TP 0.2i
+-\(bu
+-In a documentation comment:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * See the <a href="{@docRoot}/copyright\&.html">Copyright</a>\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This tag is needed because the generated documents are in hierarchical directories, as deep as the number of subpackages\&. The expression: \f3<a href="{@docRoot}/copyright\&.html">\fR resolves to \f3<a href="\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/Object\&.java\fR and \f3<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/ref/Reference\&.java\fR\&.
+-.RE
+-
+-.TP
+-@exception \fIclass-name description\fR
+-Introduced in JDK 1\&.0
+-
+-Identical to the \f3@throws\fR tag\&. See @throws class-name description\&.
+-.TP
+-{@inheritDoc}
+-Introduced in JDK 1\&.4
+-
+-Inherits (copies) documentation from the nearest inheritable class or implementable interface into the current documentation comment at this tag\&'s location\&. This enables you to write more general comments higher up the inheritance tree and to write around the copied text\&.
+-
+-This tag is valid only in these places in a documentation comment:
+-.RS
+-.TP 0.2i
+-\(bu
+-In the main description block of a method\&. In this case, the main description is copied from a class or interface up the hierarchy\&.
+-.TP 0.2i
+-\(bu
+-In the text arguments of the \f3@return\fR, \f3@param,\fR and \f3@throws\fR tags of a method\&. In this case, the tag text is copied from the corresponding tag up the hierarchy\&.
+-.RE
+-
+-
+-See Method Comment Inheritance for a description of how comments are found in the inheritance hierarchy\&. Note that if this tag is missing, then the comment is or is not automatically inherited according to rules described in that section\&.
+-.TP
+-{@link \fIpackage\&.class#member label\fR}
+-Introduced in JDK 1\&.2
+-
+-Inserts an inline link with a visible text label that points to the documentation for the specified package, class, or member name of a referenced class\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, including the text portion of any tag, such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags\&. See @link in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#{@link
+-
+-This tag is similar to the \f3@see\fR tag\&. Both tags require the same references and accept the same syntax for \f3package\&.class#member\fR and \f3label\fR\&. The main difference is that the \f3{@link}\fR tag generates an inline link rather than placing the link in the See Also section\&. The \f3{@link}\fR tag begins and ends with braces to separate it from the rest of the inline text\&. If you need to use the right brace (\f3}\fR) inside the label, then use the HTML entity notation \f3&#125;\fR\&.
+-
+-There is no limit to the number of \f3{@link}\fR tags allowed in a sentence\&. You can use this tag in the main description part of any documentation comment or in the text portion of any tag, such as the \f3@deprecated\fR, \f3@return\fR or \f3@param\fR tags\&.
+-
+-For example, here is a comment that refers to the \f3getComponentAt(int, int)\fR method:
+-.sp
+-.nf
+-\f3Use the {@link #getComponentAt(int, int) getComponentAt} method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-From this code, the standard doclet generates the following HTML (assuming it refers to another class in the same package):
+-.sp
+-.nf
+-\f3Use the <a href="Component\&.html#getComponentAt(int, int)">getComponentAt</a> method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The previous line appears on the web page as:
+-.sp
+-.nf
+-\f3Use the getComponentAt method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-{@linkplain \fIpackage\&.class#member label\fR}
+-Introduced in JDK 1\&.4
+-
+-Behaves the same as the \f3{@link}\fR tag, except the link label is displayed in plain text rather than code font\&. Useful when the label is plain text\&. For example, \f3Refer to {@linkplain add() the overridden method}\fR\&. displays as: Refer to the overridden method\&.
+-.TP
+-{@literal \fItext\fR}
+-Introduced in JDK 1\&.5
+-
+-Displays text without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use angle brackets (\f3< and >\fR) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (<-)\&. For example, the documentation comment text \f3{@literal A<B>C}\fR displays unchanged in the generated HTML page in your browser, as \f3A<B>C\fR\&. The \f3<B>\fR is not interpreted as bold (and it is not in code font)\&. If you want the same functionality with the text in code font, then use the \f3{@code}\fR tag\&.
+-.TP
+-@param \fIparameter-name description\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a parameter with the specified \f3parameter-name\fR followed by the specified description to the Parameters section\&. When writing the documentation comment, you can continue the description onto multiple lines\&. This tag is valid only in a documentation comment for a method, constructor, or class\&. See @param in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@param
+-
+-The \f3parameter-name\fR can be the name of a parameter in a method or constructor, or the name of a type parameter of a class, method, or constructor\&. Use angle brackets around this parameter name to specify the use of a type parameter\&.
+-
+-Example of a type parameter of a class:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @param <E> Type of element stored in a list\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public interface List<E> extends Collection<E> {\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Example of a type parameter of a method:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @param string the string to be converted\fP
+-.fi
+-.nf
+-\f3 * @param type the type to convert the string to\fP
+-.fi
+-.nf
+-\f3 * @param <T> the type of the element\fP
+-.fi
+-.nf
+-\f3 * @param <V> the value of the element\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3<T, V extends T> V convert(String string, Class<T> type) {\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-@return \fIdescription\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a Returns section with the description text\&. This text should describe the return type and permissible range of values\&. This tag is valid only in a documentation comment for a method\&. See @return in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@return
+-.TP
+-@see \fIreference\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a \fISee Also\fR heading with a link or text entry that points to a reference\&. A documentation comment can contain any number of \f3@see\fR tags, which are all grouped under the same heading\&. The \f3@see\fR tag has three variations\&. The form is the most common\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. For inserting an inline link within a sentence to a package, class, or member, see \f3{@link}\fR\&.
+-
+-\fIForm 1\fR\&. The @see \f3string\fR tag form adds a text entry for \fIstring\fR\&. No link is generated\&. The string is a book or other reference to information not available by URL\&. The \f3javadoc\fR command distinguishes this from the previous cases by searching for a double quotation mark (") as the first character\&. For example, \f3@see "The Java Programming Language"\fR that generates the following text:
+-
+-\fISee Also\fR:
+-
+-"The Java Programming Language"
+-
+-\fIForm 2\fR\&. The \f3@see <a href="URL#value">label</a>\fR form adds a link as defined by \f3URL#value\fR\&. The \f3URL#value\fR parameter is a relative or absolute URL\&. The \f3javadoc\fR command distinguishes this from other cases by searching for a less-than symbol (\f3<\fR) as the first character\&. For example, \f3@see <a href="spec\&.html#section">Java Spec</a>\fR generates the following link:
+-
+-\fISee Also\fR:
+-
+-Java Spec
+-
+-\fIForm 3\fR\&. The \f3@see package\&.class#member label\fR form adds a link with a visible text label that points to the documentation for the specified name in the Java Language that is referenced\&. The label is optional\&. If the label is omitted, then the name appears instead as visible text, suitably shortened\&. Use the \f3-noqualifier\fR option to globally remove the package name from this visible text\&. Use the label when you want the visible text to be different from the autogenerated visible text\&. See How a Name Appears\&.
+-
+-In Java SE 1\&.2 only, the name but not the label automatically appears in \f3<code>\fR HTML tags\&. Starting with Java SE 1\&.2\&.2, the \f3<code>\fR tag is always included around the visible text, whether or not a label is used\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3package\&.class#member\fR is any valid program element name that is referenced, such as a package, class, interface, constructor, method or field name, except that the character ahead of the member name should be a number sign (\f3#\fR)\&. The class represents any top-level or nested class or interface\&. The member represents any constructor, method, or field (not a nested class or interface)\&. If this name is in the documented classes, then the \f3javadoc\fR command create a link to it\&. To create links to external referenced classes, use the \f3-link\fR option\&. Use either of the other two \f3@see\fR tag forms to refer to the documentation of a name that does not belong to a referenced class\&. See Specify a Name\&.
+-
+-\fINote:\fR External referenced classes are classes that are not passed into the \f3javadoc\fR command on the command line\&. Links in the generated documentation to external referenced classes are called external references or external links\&. For example, if you run the \f3javadoc\fR command on only the \f3java\&.awt package\fR, then any class in \f3java\&.lang\fR, such as \f3Object\fR, is an external referenced class\&. Use the \f3-link\fR and \f3-linkoffline\fR options to link to external referenced classes\&. The source comments of external referenced classes are not available to the \f3javadoc\fR command run\&.
+-.TP 0.2i
+-\(bu
+-\f3label\fR is optional text that is visible as the link label\&. The label can contain white space\&. If \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears, suitably shortened relative to the current class and package\&. See How a Name Appears\&.
+-.TP 0.2i
+-\(bu
+-A space is the delimiter between \f3package\&.class#member\fR and \f3label\fR\&. A space inside parentheses does not indicate the start of a label, so spaces can be used between parameters in a method\&.
+-.RE
+-
+-
+-\fI\fRIn the following example, an \f3@see\fR tag (in the \f3Character\fR class) refers to the equals method in the \f3String\fR class\&. The tag includes both arguments: the name \f3String#equals(Object)\fR and the label \f3equals\fR\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @see String#equals(Object) equals\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The standard doclet produces HTML that is similar to:
+-.sp
+-.nf
+-\f3<dl>\fP
+-.fi
+-.nf
+-\f3<dt><b>See Also:</b>\fP
+-.fi
+-.nf
+-\f3<dd><a href="\&.\&./\&.\&./java/lang/String#equals(java\&.lang\&.Object)"><code>equals<code></a>\fP
+-.fi
+-.nf
+-\f3</dl>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The previous code looks similar to the following in a browser, where the label is the visible link text:
+-
+-\fISee Also\fR:
+-
+-equals
+-.PP
+-Specify a Name
+-
+-\fI\fRThis \f3package\&.class#member\fR name can be either fully qualified, such as \f3java\&.lang\&.String#toUpperCase()\fR or not, such as \f3String#toUpperCase()\fR or \f3#toUpperCase()\fR\&. If the name is less than fully qualified, then the \f3javadoc\fR command uses the standard Java compiler search order to find it\&. See Search Order for the @see Tag\&. The name can contain white space within parentheses, such as between method arguments\&.The advantage to providing shorter, partially qualified names is that they are shorter to type and there is less clutter in the source code\&. The following listing shows the different forms of the name, where \f3Class\fR can be a class or interface; Type can be a class, interface, array, or primitive; and method can be a method or constructor\&.
+-.sp
+-.nf
+-\f3\fITypical forms for\fR\fI @see package\&.class#member\fR\fP
+-.fi
+-.nf
+-\f3\fIReferencing a member of the current class\fR\fP
+-.fi
+-.nf
+-\f3@see #field\fP
+-.fi
+-.nf
+-\f3@see #method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #constructor(Type argname, Type argname,\&.\&.\&.) \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\fIReferencing another class in the current or imported packages\fR\fP
+-.fi
+-.nf
+-\f3@see Class#field\fP
+-.fi
+-.nf
+-\f3@see Class#method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class\&.NestedClass\fP
+-.fi
+-.nf
+-\f3@see Class \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\fIReferencing an element in another package (fully qualified)\fR\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#field\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class\&.NestedClass\fP
+-.fi
+-.nf
+-\f3@see package\&.Class\fP
+-.fi
+-.nf
+-\f3@see package\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3\fRNotes about the previous listing:
+-.TP 0.2i
+-\(bu
+-The first set of forms with no class or package causes the \f3javadoc\fR command to search only through the current class hierarchy\&. It finds a member of the current class or interface, one of its superclasses or superinterfaces, or one of its enclosing classes or interfaces (search Items 1\(en3)\&. It does not search the rest of the current package or other packages (search Items 4\(en5)\&. See Search Order for the @see Tag\&.
+-.TP 0.2i
+-\(bu
+-If any method or constructor is entered as a name with no parentheses, such as \f3getValue\fR, and if there is no field with the same name, then the \f3javadoc\fR command still creates a link to the method\&. If this method is overloaded, then the \f3javadoc\fR command links to the first method its search encounters, which is unspecified\&.
+-.TP 0.2i
+-\(bu
+-Nested classes must be specified as \f3outer\&.inner\fR, not simply \f3inner\fR, for all forms\&.
+-.TP 0.2i
+-\(bu
+-As stated, the number sign (\f3#\fR), rather than a dot (\f3\&.\fR) separates a member from its class\&. This enables the \f3javadoc\fR command to resolve ambiguities, because the dot also separates classes, nested classes, packages, and subpackages\&. However, the \f3javadoc\fR command properly parses a dot when there is no ambiguity, but prints a warning to alert you\&.
+-.PP
+-Search Order for the @see Tag
+-
+-\fI\fRThe \f3javadoc\fR command processes an \f3@see\fR tag that appears in a source file, package file, or overview file\&. In the latter two files, you must fully qualify the name you supply with the \f3@see\fR tag\&. In a source file, you can specify a name that is fully qualified or partially qualified\&.
+-.PP
+-The following is the search order for the \f3@see\fR tag\&.
+-.TP 0.4i
+-1\&.
+-The current class or interface\&.
+-.TP 0.4i
+-2\&.
+-Any enclosing classes and interfaces searching the closest first\&.
+-.TP 0.4i
+-3\&.
+-Any superclasses and superinterfaces, searching the closest first\&.
+-.TP 0.4i
+-4\&.
+-The current package\&.
+-.TP 0.4i
+-5\&.
+-Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statement\&.
+-.PP
+-The \f3javadoc\fR command continues to search recursively through Items 1-3 for each class it encounters until it finds a match\&. That is, after it searches through the current class and its enclosing class E, it searches through the superclasses of E before the enclosing classes of E\&. In Items 4 and 5, the \f3javadoc\fR command does not search classes or interfaces within a package in any specified order (that order depends on the particular compiler)\&. In Item 5, the \f3javadoc\fR command searches in \fIjava\&.lang\fR because that is imported by all programs\&.
+-.PP
+-When the \f3javadoc\fR command encounters an \f3@see\fR tag in a source file that is not fully qualified, it searches for the specified name in the same order as the Java compiler would, except the \f3javadoc\fR command does not detect certain name space ambiguities because it assumes the source code is free of these errors\&. This search order is formally defined in the Java Language Specification\&. The \f3javadoc\fR command searches for that name through all related and imported classes and packages\&. In particular, it searches in this order:
+-.TP 0.4i
+-1\&.
+-The current class or interface\&.
+-.TP 0.4i
+-2\&.
+-Any enclosing classes and interfaces, searching the closest first\&.
+-.TP 0.4i
+-3\&.
+-Any superclasses and superinterfaces, searching the closest first\&.
+-.TP 0.4i
+-4\&.
+-The current package\&.
+-.TP 0.4i
+-5\&.
+-Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statements\&.
+-.PP
+-The \f3javadoc\fR command does not necessarily look in subclasses, nor will it look in other packages even when their documentation is being generated in the same run\&. For example, if the \f3@see\fR tag is in the \f3java\&.awt\&.event\&.KeyEvent\fR class and refers to a name in the \f3java\&.awt package\fR, then the \f3javadoc\fR command does not look in that package unless that class imports it\&.
+-.PP
+-How a Name Appears
+-
+-\fI\fRIf \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears\&. In general, it is suitably shortened relative to the current class and package\&. Shortened means the \f3javadoc\fR command displays only the minimum name necessary\&. For example, if the \f3String\&.toUpperCase()\fR method contains references to a member of the same class and to a member of a different class, then the class name is displayed only in the latter case, as shown in the following listing\&. Use the \f3-noqualifier\fR option to globally remove the package names\&.
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of the same class, same package
+-.br
+-\fIExample in\fR: \f3@see String#toLowerCase()\fR
+-.br
+-\fIAppears as\fR: \f3toLowerCase()\fR - omits the package and class names
+-.br
+-
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, same package
+-.br
+-\fIExample in\fR: \f3@see Character#toLowerCase(char)\fR
+-.br
+-\fIAppears as\fR: \f3Character\&.toLowerCase(char)\fR - omits the package name, includes the class name
+-.br
+-
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, different package
+-.br
+-\fIExample in\fR: \f3@see java\&.io\&.File#exists()\fR
+-.br
+-\fIAppears as\fR: \f3java\&.io\&.File\&.exists()\fR - includes the package and class names
+-.br
+-
+-.PP
+-Examples of the @see Tag
+-
+-The comment to the right shows how the name appears when the \f3@see\fR tag is in a class in another package, such as \f3java\&.applet\&.Applet\fR\&. See @see in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@see
+-.sp
+-.nf
+-\f3 See also:\fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.String // String \fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.String The String class // The String class \fP
+-.fi
+-.nf
+-\f3@see String // String \fP
+-.fi
+-.nf
+-\f3@see String#equals(Object) // String\&.equals(Object) \fP
+-.fi
+-.nf
+-\f3@see String#equals // String\&.equals(java\&.lang\&.Object) \fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.Object#wait(long) // java\&.lang\&.Object\&.wait(long) \fP
+-.fi
+-.nf
+-\f3@see Character#MAX_RADIX // Character\&.MAX_RADIX \fP
+-.fi
+-.nf
+-\f3@see <a href="spec\&.html">Java Spec</a> // Java Spec \fP
+-.fi
+-.nf
+-\f3@see "The Java Programming Language" // "The Java Programming Language" \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fINote:\fR You can extend the \f3@se\fR\f3e\fR tag to link to classes not being documented with the \f3-link\fR option\&.
+-.TP
+-@serial \fIfield-description\fR | include | exclude
+-Introduced in JDK 1\&.2
+-
+-Used in the documentation comment for a default serializable field\&. See Documenting Serializable Fields and Data for a Class at http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial-arch\&.html#5251
+-
+-See also Oracle\(cqs Criteria for Including Classes in the Serialized Form Specification at http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized-criteria-137781\&.html
+-
+-An optional \f3field-description\fR should explain the meaning of the field and list the acceptable values\&. When needed, the description can span multiple lines\&. The standard doclet adds this information to the serialized form page\&. See Cross-Reference Pages\&.
+-
+-If a serializable field was added to a class after the class was made serializable, then a statement should be added to its main description to identify at which version it was added\&.
+-
+-The \f3include\fR and \f3exclude\fR arguments identify whether a class or package should be included or excluded from the serialized form page\&. They work as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-A public or protected class that implements \f3Serializable\fR is included unless that class (or its package) is marked with the \f3@serial exclude\fR tag\&.
+-.TP 0.2i
+-\(bu
+-A private or package-private class that implements \f3Serializable\fR is excluded unless that class (or its package) is marked with the \f3@serial include\fR tag\&.
+-.RE
+-
+-
+-For example, the \f3javax\&.swing\fR package is marked with the \f3@serial\fR\f3exclude\fR tag in package\&.html or package-info\&.java\&. The public class \f3java\&.security\&.BasicPermission\fR is marked with the \f3@serial exclude\fR tag\&. The package-private class \f3java\&.util\&.PropertyPermissionCollection\fR is marked with the \f3@serial include\fR tag\&.
+-
+-The \f3@serial\fR tag at the class level overrides the \f3@serial\fR tag at the package level\&.
+-.TP
+-@serialData \fIdata-description\fR
+-Introduced in JDK 1\&.2
+-
+-Uses the data description value to document the types and order of data in the serialized form\&. This data includes the optional data written by the \f3writeObject\fR method and all data (including base classes) written by the \f3Externalizable\&.writeExternal\fR method\&.
+-
+-The \f3@serialData\fR tag can be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
+-.TP
+-@serialField \fIfield-name\fR\fIfield-type\fR\fIfield-description\fR
+-Introduced in JDK 1\&.2
+-
+-Documents an \f3ObjectStreamField\fR component of the \f3serialPersistentFields\fR member of a \f3Serializable\fR class\&. Use one \f3@serialField\fR tag for each \f3ObjectStreamField\fR component\&.
+-.TP
+-@since \fIsince-text\fR
+-Introduced in JDK 1\&.1
+-
+-Adds a \fISince\fR heading with the specified \f3since-text\fR value to the generated documentation\&. The text has no special internal structure\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. This tag means that this change or feature has existed since the software release specified by the \f3since-text\fR value, for example: \f3@since 1\&.5\fR\&.
+-
+-For Java platform source code, the \f3@since\fR tag indicates the version of the Java platform API specification, which is not necessarily when the source code was added to the reference implementation\&. Multiple \f3@since\fR tags are allowed and are treated like multiple \f3@author\fR tags\&. You could use multiple tags when the program element is used by more than one API\&.
+-.TP
+-@throws \fIclass-name\fR\fIdescription\fR
+-Introduced in JDK 1\&.2
+-
+-Behaves the same as the \f3@exception\fR tag\&. See @throws in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@exception
+-
+-The \f3@throws\fR tag adds a \fIThrows\fR subheading to the generated documentation, with the \f3class-name\fR and \f3description\fR text\&. The \fIclass-name\fR is the name of the exception that might be thrown by the method\&. This tag is valid only in the documentation comment for a method or constructor\&. If this class is not fully specified, then the \f3javadoc\fR command uses the search order to look up this class\&. Multiple \f3@throws\fR tags can be used in a specified documentation comment for the same or different exceptions\&. See Search Order for the @see Tag\&.
+-
+-To ensure that all checked exceptions are documented, when an \f3@throws\fR tag does not exist for an exception in the throws clause, the \f3javadoc\fR command adds that exception to the HTML output (with no description) as though it were documented with the \f3@throws\fR tag\&.
+-
+-The \f3@throws\fR documentation is copied from an overridden method to a subclass only when the exception is explicitly declared in the overridden method\&. The same is true for copying from an interface method to an implementing method\&. You can use the \f3{@inheritDoc}\fR tag to force the \f3@throws\fR tag to inherit documentation\&.
+-.TP
+-{@value \fIpackage\&.class#field\fR}
+-Introduced in JDK 1\&.4
+-
+-Displays constant values\&. When the \f3{@value}\fR tag is used without an argument in the documentation comment of a static field, it displays the value of that constant:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * The value of this constant is {@value}\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public static final String SCRIPT_START = "<script>"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When used with the argument \f3package\&.class#field\fR in any documentation comment, he \f3{@value}\fR tag displays the value of the specified constant:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Evaluates the script starting with {@value #SCRIPT_START}\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public String evalScript(String script) {}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The argument \f3package\&.class#field\fR takes a form similar to that of the \f3@see\fR tag argument, except that the member must be a static field\&.
+-
+-The values of these constants are also displayed in Constant Field Values at http://docs\&.oracle\&.com/javase/8/docs/api/constant-values\&.html
+-.TP
+-@version \fIversion-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a \fIVersion\fR subheading with the specified \f3version-text\fR value to the generated documents when the \f3-version\fR option is used\&. This tag is intended to hold the current release number of the software that this code is part of, as opposed to the\f3@since\fR tag, which holds the release number where this code was introduced\&. The \f3version-text\fR value has no special internal structure\&. See @version in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@version
+-
+-A documentation comment can contain multiple \f3@version\fR tags\&. When it makes sense, you can specify one release number per \f3@version\fR tag or multiple release numbers per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and a space between the names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line when you want a localized name separator other than a comma\&.
+-.SH WHERE\ TAGS\ CAN\ BE\ USED
+-The following sections describe where tags can be used\&. Note that the following tags can be used in all documentation comments: \f3@see\fR, \f3@since\fR, \f3@deprecated\fR, \f3{@link}\fR, \f3{@linkplain}\fR, and \f3{@docroot}\fR\&.
+-.SS OVERVIEW\ TAGS
+-Overview tags are tags that can appear in the documentation comment for the overview page (which resides in the source file typically named overview\&.html)\&. Similar to any other documentation comments, these tags must appear after the main description
+-.PP
+-\fINote:\fR The \f3{@link}\fR tag has a bug in overview documents in Java SE 1\&.2\&. The text appears correctly but has no link\&. The \f3{@docRoot}\fR tag does not currently work in overview documents\&.
+-.PP
+-The overview tags are the following:
+-.PP
+-@see reference || @since since-text || @serialField field-name field-type field-description || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.SS PACKAGE\ TAGS
+-Package tags are tags that can appear in the documentation comment for a package, that resides in the source file named package\&.html or package-info\&.java\&. The \f3@serial\fR tag can only be used here with the \f3include\fR or \f3exclude\fR argument\&.
+-.PP
+-The package tags are the following:
+-.PP
+-@see reference || @since since-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@linkplain package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.SS CLASS\ AND\ INTERFACE\ TAGS
+-The following are tags that can appear in the documentation comment for a class or interface\&. The \f3@serial\fR tag can only be used within the documentation for a class or interface with an \f3include\fR or \f3exclude\fR argument\&.
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.PP
+-Class comment example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * A class representing a window on the screen\&.\fP
+-.fi
+-.nf
+-\f3 * For example:\fP
+-.fi
+-.nf
+-\f3 * <pre>\fP
+-.fi
+-.nf
+-\f3 * Window win = new Window(parent);\fP
+-.fi
+-.nf
+-\f3 * win\&.show();\fP
+-.fi
+-.nf
+-\f3 * </pre>\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @author Sami Shaio\fP
+-.fi
+-.nf
+-\f3 * @version 1\&.13, 06/08/06\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\&.BaseWindow\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\&.Button\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3class Window extends BaseWindow {\fP
+-.fi
+-.nf
+-\f3 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS FIELD\ TAGS
+-These tags can appear in fields:
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @serialField field-name field-type field-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || {@value package\&.class#field}
+-.PP
+-Field comment example:
+-.sp
+-.nf
+-\f3 /**\fP
+-.fi
+-.nf
+-\f3 * The X\-coordinate of the component\&.\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @see #getLocation()\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3 int x = 1263732;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS CONSTRUCTOR\ AND\ METHOD\ TAGS
+-The following tags can appear in the documentation comment for a constructor or a method, except for the \f3@return\fR tag, which cannot appear in a constructor, and the \f3{@inheritDoc}\fR tag, which has restrictions\&.
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @param parameter-name description || @return description || @throws class-name description || @exception class-name description || @serialData data-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@inheritDoc} || {@docRoot}
+-.PP
+-\fINote:\fR The \f3@serialData\fR tag can only be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
+-.PP
+-Method comment example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Returns the character at the specified index\&. An index \fP
+-.fi
+-.nf
+-\f3 * ranges from <code>0</code> to <code>length() \- 1</code>\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @param index the index of the desired character\&.\fP
+-.fi
+-.nf
+-\f3 * @return the desired character\&.\fP
+-.fi
+-.nf
+-\f3 * @exception StringIndexOutOfRangeException \fP
+-.fi
+-.nf
+-\f3 * if the index is not in the range <code>0</code> \fP
+-.fi
+-.nf
+-\f3 * to <code>length()\-1</code>\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Character#charValue()\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3 public char charAt(int index) {\fP
+-.fi
+-.nf
+-\f3 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-The \f3javadoc\fR command uses doclets to determine its output\&. The \f3javadoc\fR command uses the default standard doclet unless a custom doclet is specified with the \f3-doclet\fR option\&. The \f3javadoc\fR command provides a set of command-line options that can be used with any doclet\&. These options are described in Javadoc Options\&. The standard doclet provides an additional set of command-line options that are described in Standard Doclet Options\&. All option names are not case-sensitive, but their arguments are case-sensitive\&.
+-.TP 0.2i
+-\(bu
+-See also Javadoc Options
+-.TP 0.2i
+-\(bu
+-See also Standard Doclet Options
+-.PP
+-The options are:
+-.PP
+--1\&.1 || -author || -bootclasspath classpathlist || -bottom text || -breakiterator || -charset name || -classpath classpathlist || -d directory || -docencoding name || -docfilesubdirs || -doclet class || -docletpath classpathlist || -doctitle title || -encoding || -exclude packagename1:packagename2:\&.\&.\&. || -excludedocfilessubdir name1:name2 || -extdirs dirist || -footer footer || -group groupheading packagepattern:packagepattern || -header header || -help || -helpfile path\efilename || -Jflag || -javafx ||-keywords || -link extdocURL || -linkoffline extdocURL packagelistLoc || -linksource || -locale language_country_variant || -nocomment || -nodeprecated || -nodeprecatedlist || -nohelp || -noindex || -nonavbar || -noqualifier all | packagename1:packagename2\&.\&.\&. || -nosince || -notimestamp || -notree || -overview path/filename || -package || -private || -protected || -public || -quiet || -serialwarn || -source release || -sourcepath sourcepathlist || -sourcetab tablength || -splitindex || -stylesheet path/filename || -subpackages package1:package2:\&.\&.\&. || -tag tagname:Xaoptcmf:"taghead" || -taglet class || -tagletpath tagletpathlist || -title title || -top || -use || -verbose || -version || -windowtitle title
+-.PP
+-The following options are the core Javadoc options that are available to all doclets\&. The standard doclet provides the rest of the doclets: \f3-bootclasspath\fR, \f3-breakiterator\fR, \f3-classpath\fR, \f3-doclet\fR, \f3-docletpath\fR, \f3-encoding\fR, -\f3exclude\fR, \f3-extdirs\fR, \f3-help\fR, \f3-locale\fR, \f3-\fR\f3overview\fR, \f3-package\fR, \f3-private\fR, \f3-protected\fR, \f3-public\fR, \f3-quiet\fR, \f3-source\fR, \f3-sourcepath\fR, \f3-subpackages\fR, and \f3-verbose\fR\&.
+-.SS JAVADOC\ OPTIONS
+-.TP
+--overview \fIpath/filename\fR
+-.br
+-Specifies that the \f3javadoc\fR command should retrieve the text for the overview documentation from the source file specified by the \fIpath/filename\fRand place it on the Overview page (overview-summary\&.html)\&. The \fIpath/filename\fRis relative to the current directory\&.
+-
+-While you can use any name you want for the \f3filename\fR value and place it anywhere you want for the path, it is typical to name it overview\&.html and place it in the source tree at the directory that contains the topmost package directories\&. In this location, no path is needed when documenting packages, because the \f3-sourcepath\fR option points to this file\&.
+-
+-For example, if the source tree for the \f3java\&.lang\fR package is /src/classes/java/lang/, then you could place the overview file at /src/classes/overview\&.html
+-
+-See Real-World Examples\&.
+-
+-For information about the file specified by \fIpath/filename,\fRsee Overview Comment Files\&.
+-
+-The overview page is created only when you pass two or more package names to the \f3javadoc\fR command\&. For a further explanation, see HTML Frames\&. The title on the overview page is set by \f3-doctitle\fR\&.
+-.TP
+--Xdoclint:(all|none|[-]\fI<group>\fR)
+-.br
+-Reports warnings for bad references, lack of accessibility and missing Javadoc comments, and reports errors for invalid Javadoc syntax and missing HTML tags\&.
+-
+-This option enables the \f3javadoc\fR command to check for all documentation comments included in the generated output\&. As always, you can select which items to include in the generated output with the standard options \f3-public\fR, \f3-protected\fR, \f3-package\fR and \f3-private\fR\&.
+-
+-When the \f3-Xdoclint\fR is enabled, it reports issues with messages similar to the \f3javac\fR command\&. The \f3javadoc\fR command prints a message, a copy of the source line, and a caret pointing at the exact position where the error was detected\&. Messages may be either warnings or errors, depending on their severity and the likelihood to cause an error if the generated documentation were run through a validator\&. For example, bad references or missing Javadoc comments do not cause the \f3javadoc\fR command to generate invalid HTML, so these issues are reported as warnings\&. Syntax errors or missing HTML end tags cause the \f3javadoc\fR command to generate invalid output, so these issues are reported as errors\&.
+-
+-By default, the \f3-Xdoclint\fR option is enabled\&. Disable it with the option \f3-Xdoclint:none\fR\&.
+-
+-Change what the \f3-Xdoclint\fR option reports with the following options:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint none\fR : disable the \f3-Xdoclint\fR option
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint\fR\fIgroup\fR : enable \fIgroup\fR checks
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint all\fR : enable all groups of checks
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint all,\fR\fI-group\fR : enable all except \fIgroup\fR checks
+-.RE
+-
+-
+-The variable \fIgroup\fR has one of the following values:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3accessibility\fR : Checks for the issues to be detected by an accessibility checker (for example, no caption or summary attributes specified in a \f3<table>\fR tag)\&.
+-.TP 0.2i
+-\(bu
+-\f3html\fR : Detects high-level HTML issues, like putting block elements inside inline elements, or not closing elements that require an end tag\&. The rules are derived from theHTML 4\&.01 Specification\&. This type of check enables the \f3javadoc\fR command to detect HTML issues that many browsers might accept\&.
+-.TP 0.2i
+-\(bu
+-\f3missing\fR : Checks for missing Javadoc comments or tags (for example, a missing comment or class, or a missing \f3@return\fR tag or similar tag on a method)\&.
+-.TP 0.2i
+-\(bu
+-\f3reference\fR : Checks for issues relating to the references to Java API elements from Javadoc tags (for example, item not found in \f3@see\fR , or a bad name after \f3@param)\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3syntax\fR : Checks for low level issues like unescaped angle brackets (\f3<\fR and \f3>\fR) and ampersands (\f3&\fR) and invalid Javadoc tags\&.
+-.RE
+-
+-
+-You can specify the \f3-Xdoclint\fR option multiple times to enable the option to check errors and warnings in multiple categories\&. Alternatively, you can specify multiple error and warning categories by using the preceding options\&. For example, use either of the following commands to check for the HTML, syntax, and accessibility issues in the file \fIfilename\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-Xdoclint:html \-Xdoclint:syntax \-Xdoclint:accessibility \fIfilename\fR\fP
+-.fi
+-.nf
+-\f3javadoc \-Xdoclint:html,syntax,accessibility \fIfilename\fR\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR The \f3javadoc\fR command does not guarantee the completeness of these checks\&. In particular, it is not a full HTML compliance checker\&. The goal of the -\f3Xdoclint\fR option is to enable the \f3javadoc\fR command to report majority of common errors\&.
+-
+-The \f3javadoc\fR command does not attempt to fix invalid input, it just reports it\&.
+-.TP
+--public
+-.br
+-Shows only public classes and members\&.
+-.TP
+--protected
+-.br
+-Shows only protected and public classes and members\&. This is the default\&.
+-.TP
+--package
+-.br
+-Shows only package, protected, and public classes and members\&.
+-.TP
+--private
+-.br
+-Shows all classes and members\&.
+-.TP
+--help
+-.br
+-Displays the online help, which lists all of the \f3javadoc\fR and \f3doclet\fR command-line options\&.
+-.TP
+--doclet \fIclass\fR
+-.br
+-Specifies the class file that starts the doclet used in generating the documentation\&. Use the fully qualified name\&. This doclet defines the content and formats the output\&. If the \f3-doclet\fR option is not used, then the \f3javadoc\fR command uses the standard doclet for generating the default HTML format\&. This class must contain the \f3start(Root)\fR method\&. The path to this starting class is defined by the \f3-docletpath\fR option\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.TP
+--docletpath \fIclasspathlist\fR
+-.br
+-Specifies the path to the doclet starting class file (specified with the \f3-doclet\fR option) and any JAR files it depends on\&. If the starting class file is in a JAR file, then this option specifies the path to that JAR file\&. You can specify an absolute path or a path relative to the current directory\&. If \f3classpathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semi-colon (;) on Windows\&. This option is not necessary when the doclet starting class is already in the search path\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.TP
+--1\&.1
+-.br
+-Removed from Javadoc 1\&.4 with no replacement\&. This option created documentation with the appearance and functionality of documentation generated by Javadoc 1\&.1 (it never supported nested classes)\&. If you need this option, then use Javadoc 1\&.2 or 1\&.3 instead\&.
+-.TP
+--source \fIrelease\fR
+-.br
+-Specifies the release of source code accepted\&. The following values for the \f3release\fR parameter are allowed\&. Use the value of \f3release\fR that corresponds to the value used when you compile code with the \f3javac\fR command\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.5\fR\&. The \f3javadoc\fR command accepts code containing generics and other language features introduced in JDK 1\&.5\&. The compiler defaults to the 1\&.5 behavior when the \f3-source\fR option is not used\&.
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.4\fR\&. The \f3javadoc\fR command accepts code containing assertions, which were introduced in JDK 1\&.4\&.
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.3\fR\&. The \f3javadoc\fR command does not support assertions, generics, or other language features introduced after JDK 1\&.3\&.
+-.RE
+-
+-.TP
+--sourcepath \fIsourcepathlist\fR
+-.br
+-Specifies the search paths for finding source files when passing package names or the \f3-subpackages\fR option into the \f3javadoc\fR command\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Note that this option is not only used to locate the source files being documented, but also to find source files that are not being documented, but whose comments are inherited by the source files being documented\&.
+-
+-You can use the \f3-sourcepath\fR option only when passing package names into the \f3javadoc\fR command\&. This will not locate source files passed into the \f3javadoc\fR command\&. To locate source files, \f3\fRchange to that directory or include the path ahead of each file, as shown at Document One or More Classes\&. If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses the class path to find the source files (see \f3-classpath\fR)\&. The default \f3-sourcepath\fR is the value of class path\&. If \f3-classpath\fR is omitted and you pass package names into the \f3javadoc\fR command, then the \f3javadoc\fR command searches in the current directory and subdirectories for the source files\&.
+-
+-Set \f3sourcepathlist\fR to the root directory of the source tree for the package you are documenting\&.
+-
+-For example, suppose you want to document a package called \f3com\&.mypackage\fR, whose source files are located at:/home/user/src/com/mypackage/*\&.java\&. Specify the sourcepath to /home/user/src, the directory that contains com\emypackage, and then supply the package name, as follows:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/src/ com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Notice that if you concatenate the value of sourcepath and the package name together and change the dot to a slash (/), then you have the full path to the package:
+-
+-/home/user/src/com/mypackage
+-
+-To point to two source paths:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user1/src:/home/user2/src com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--classpath \fIclasspathlist\fR
+-.br
+-Specifies the paths where the \f3javadoc\fR command searches for referenced classes These are the documented classes plus any classes referenced by those classes\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Follow the instructions in the class path documentation for specifying the \f3classpathlist\fR value\&.
+-
+-If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses \f3-classpath\fR to find the source files and class files (for backward compatibility)\&. If you want to search for source and class files in separate paths, then use both \f3-sourcepath\fR and \f3-classpath\fR\&.
+-
+-For example, if you want to document \f3com\&.mypackage\fR, whose source files reside in the directory /home/user/src/com/mypackage, and if this package relies on a library in /home/user/lib, then you would use the following command:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/lib \-classpath /home/user/src com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Similar to other tools, if you do not specify \f3-classpath\fR, then the \f3javadoc\fR command uses the \f3CLASSPATH\fR environment variable when it is set\&. If both are not set, then the \f3javadoc\fR command searches for classes from the current directory\&.
+-
+-For an in-depth description of how the \f3javadoc\fR command uses \f3-classpath\fR to find user classes as it relates to extension classes and bootstrap classes, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-
+-A class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
+-
+-For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JA\fRR, then the class path element \f3foo/*\fR is expanded to a \f3A\&.jar:b\&.JAR\fR, except that the order of JAR files is unspecified\&. All JAR files in the specified directory including hidden files are included in the list\&. A class path entry that consists of * expands to a list of all the jar files in the current directory\&. The \f3CLASSPATH\fR environment variable is similarly expanded\&. Any class path wildcard expansion occurs before the Java Virtual Machine (JVM) starts\&. No Java program ever sees unexpanded wild cards except by querying the environment, for example, by calling System\&.getenv(\f3"CLASSPATH"\fR)\&.
+-.TP
+--subpackages \fIpackage1:package2:\&.\&.\&.\fR
+-.br
+-Generates documentation from source files in the specified packages and recursively in their subpackages\&. This option is useful when adding new subpackages to the source code because they are automatically included\&. Each package argument is any top-level subpackage (such as \f3java\fR) or fully qualified package (such as \f3javax\&.swing\fR) that does not need to contain source files\&. Arguments are separated by colons on all operating systems\&. Wild cards are not allowed\&. Use \f3-sourcepath\fR to specify where to find the packages\&. This option does not process source files that are in the source tree but do not belong to the packages\&. See Process Source Files\&.
+-
+-For example, the following command generates documentation for packages named \f3java\fR and \f3javax\&.swing\fR and all of their subpackages\&.
+-.sp
+-.nf
+-\f3javadoc \-d docs \-sourcepath /home/user/src \-subpackages java:javax\&.swing \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--exclude \fIpackagename1:packagename2:\&.\&.\&.\fR
+-.br
+-Unconditionally excludes the specified packages and their subpackages from the list formed by \f3-subpackages\fR\&. It excludes those packages even when they would otherwise be included by some earlier or later \f3-subpackages\fR option\&.
+-
+-The following example would include \f3java\&.io\fR, \f3java\&.util\fR, and \f3java\&.math\fR (among others), but would exclude packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice that this example excludes \f3java\&.lang\&.ref\fR, which is a subpackage of \f3java\&.lang\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/src \-subpackages java \-exclude \fP
+-.fi
+-.nf
+-\f3 java\&.net:java\&.lang\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--bootclasspath \fIclasspathlist\fR
+-.br
+-Specifies the paths where the boot classes reside\&. These are typically the Java platform classes\&. The \f3bootclasspath\fR is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. For more information, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-
+-Separate directories in the \f3classpathlist\fR parameters with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
+-.TP
+--extdirs \fIdirist\fR
+-.br
+-Specifies the directories where extension classes reside\&. These are any classes that use the Java Extension mechanism\&. The \f3extdirs\fR option is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. See the \f3-classpath\fR option for more information\&. Separate directories in \f3dirlist\fR with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
+-.TP
+--verbose
+-.br
+-Provides more detailed messages while the \f3javadoc\fR command runs\&. Without the \f3verbose\fR option, messages appear for loading the source files, generating the documentation (one message per source file), and sorting\&. The verbose option causes the printing of additional messages that specify the number of milliseconds to parse each Java source file\&.
+-.TP
+--quiet
+-.br
+-Shuts off messages so that only the warnings and errors appear to make them easier to view\&. It also suppresses the \f3version\fR string\&.
+-.TP
+--breakiterator
+-.br
+-Uses the internationalized sentence boundary of \f3java\&.text\&.BreakIterator\fR to determine the end of the first sentence in the main description of a package, class, or member for English\&. All other locales already use the \f3BreakIterator\fR class, rather than an English language, locale-specific algorithm\&. The first sentence is copied to the package, class, or member summary and to the alphabetic index\&. From JDK 1\&.2 and later, the \f3BreakIterator\fR class is used to determine the end of a sentence for all languages except for English\&. Therefore, the \f3-breakiterator\fR option has no effect except for English from 1\&.2 and later\&. English has its own default algorithm:
+-.RS
+-.TP 0.2i
+-\(bu
+-English default sentence-break algorithm\&. Stops at a period followed by a space or an HTML block tag, such as \f3<P>\fR\&.
+-.TP 0.2i
+-\(bu
+-Breakiterator sentence-break algorithm\&. Stops at a period, question mark, or exclamation point followed by a space when the next word starts with a capital letter\&. This is meant to handle most abbreviations (such as "The serial no\&. is valid", but will not handle "Mr\&. Smith")\&. The \f3-breakiterator\fR option does not stop at HTML tags or sentences that begin with numbers or symbols\&. The algorithm stops at the last period in \&.\&./filename, even when embedded in an HTML tag\&.
+-.RE
+-
+-
+-In Java SE 1\&.5 the \f3-breakiterator\fR option warning messages are removed, and the default sentence-break algorithm is unchanged\&. If you have not modified your source code to eliminate the \f3-breakiterator\fR option warnings in Java SE 1\&.4\&.x, then you do not have to do anything\&. The warnings go away starting with Java SE 1\&.5\&.0\&.
+-.TP
+--locale \fIlanguage_country_variant\fR
+-.br
+-Specifies the locale that the \f3javadoc\fR command uses when it generates documentation\&. The argument is the name of the locale, as described in \f3j\fR\f3ava\&.util\&.Locale\fR documentation, such as \f3en_US\fR (English, United States) or \f3en_US_WIN\fR (Windows variant)\&.
+-
+-\fINote:\fR The \f3-locale\fR option must be placed ahead (to the left) of any options provided by the standard doclet or any other doclet\&. Otherwise, the navigation bars appear in English\&. This is the only command-line option that depends on order\&. See Standard Doclet Options\&.
+-
+-Specifying a locale causes the \f3javadoc\fR command to choose the resource files of that locale for messages such as strings in the navigation bar, headings for lists and tables, help file contents, comments in the stylesheet\&.css file, and so on\&. It also specifies the sorting order for lists sorted alphabetically, and the sentence separator to determine the end of the first sentence\&. The \f3-locale\fR option does not determine the locale of the documentation comment text specified in the source files of the documented classes\&.
+-.TP
+--encoding
+-.br
+-Specifies the encoding name of the source files, such as \f3EUCJIS/SJIS\fR\&. If this option is not specified, then the platform default converter is used\&. See also the\f3-docencoding name\fR and \f3-charset name\fR options\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR directly to the Java Runtime Environment (JRE) that runs the \f3javadoc\fR command\&. For example, if you must ensure that the system sets aside 32 MB of memory in which to process the generated documentation, then you would call the \f3-Xmx\fR option as follows: \f3javadoc -J-Xmx32m -J-Xms32m com\&.mypackage\fR\&. Be aware that \f3-Xms\fR is optional because it only sets the size of initial memory, which is useful when you know the minimum amount of memory required\&.
+-
+-There is no space between the \f3J\fR and the \f3flag\fR\&.
+-
+-Use the \f3-version\fR option to find out what version of the \f3javadoc\fR command you are using\&. The version number of the standard doclet appears in its output stream\&. See Running the Javadoc Command\&.
+-.sp
+-.nf
+-\f3javadoc \-J\-version\fP
+-.fi
+-.nf
+-\f3java version "1\&.7\&.0_09"\fP
+-.fi
+-.nf
+-\f3Java(TM) SE Runtime Environment (build 1\&.7\&.0_09\-b05)\fP
+-.fi
+-.nf
+-\f3Java HotSpot(TM) 64\-Bit Server VM (build 23\&.5\-b02, mixed mode)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--javafx
+-.br
+-Generates HTML documentation using the JavaFX extensions to the standard doclet\&. The generated documentation includes a Property Summary section in addition to the other summary sections generated by the standard Java doclet\&. The listed properties are linked to the sections for the getter and setter methods of each property\&.
+-
+-If there are no documentation comments written explicitly for getter and setter methods, the documentation comments from the property method are automatically copied to the generated documentation for these methods\&. This option also adds a new \f3@defaultValue\fR tag that allows documenting the default value for a property\&.
+-
+-Example:
+-.sp
+-.nf
+-\f3javadoc \-javafx MyClass\&.java \-d testdir\fP
+-.fi
+-.sp
+-
+-.SS STANDARD\ DOCLET\ OPTIONS
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies the destination directory where the \f3javadoc\fR command saves the generated HTML files\&. If you omit the \f3-d\fR option, then the files are saved to the current directory\&. The \f3directory\fR value can be absolute or relative to the current working directory\&. As of Java SE 1\&.4, the destination directory is automatically created when the \f3javadoc\fR command runs\&.
+-
+-For example, the following command generates the documentation for the package \f3com\&.mypackage\fR and saves the results in the /user/doc/ directory: \f3javadoc -d\fR\f3/user/doc/\fR\f3com\&.mypackage\fR\&.
+-.TP
+--use
+-.br
+-Includes one Use page for each documented class and package\&. The page describes what packages, classes, methods, constructors and fields use any API of the specified class or package\&. Given class C, things that use class C would include subclasses of C, fields declared as C, methods that return C, and methods and constructors with parameters of type C\&. For example, you can look at the Use page for the \f3String\fR type\&. Because the \f3getName\fR method in the \f3java\&.awt\&.Font\fR class returns type \f3String\fR, the \f3getName\fR method uses \f3String\fR and so the \f3getName\fR method appears on the Use page for \f3String\fR\&.This documents only uses of the API, not the implementation\&. When a method uses \f3String\fR in its implementation, but does not take a string as an argument or return a string, that is not considered a use of \f3String\fR\&.To access the generated Use page, go to the class or package and click the \fIUse link\fR in the navigation bar\&.
+-.TP
+--version
+-.br
+-Includes the @version text in the generated docs\&. This text is omitted by default\&. To find out what version of the \f3javadoc\fR command you are using, use the \f3-J-version\fR option\&.
+-.TP
+--author
+-.br
+-Includes the \f3@author\fR text in the generated docs\&.
+-.TP
+--splitindex
+-.br
+-Splits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical symbols\&.
+-.TP
+--windowtitle \fItitle\fR
+-.br
+-Specifies the title to be placed in the HTML \f3<title>\fR tag\&. The text specified in the \f3title\fR tag appears in the window title and in any browser bookmarks (favorite places) that someone creates for this page\&. This title should not contain any HTML tags because the browser does not interpret them correctly\&. Use escape characters on any internal quotation marks within the \f3title\fR tag\&. If the \f3-windowtitle\fR option is omitted, then the \f3javadoc\fR command uses the value of the \f3-doctitle\fR option for the \f3-windowtitle\fR option\&. For example, \f3javadoc -windowtitle "Java SE Platform" com\&.mypackage\fR\&.
+-.TP
+--doctitle \fItitle\fR
+-.br
+-Specifies the title to place near the top of the overview summary file\&. The text specified in the \f3title\fR tag is placed as a centered, level-one heading directly beneath the top navigation bar\&. The \f3title\fR tag can contain HTML tags and white space, but when it does, you must enclose the title in quotation marks\&. Internal quotation marks within the \f3title\fR tag must be escaped\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
+-.TP
+--title \fItitle\fR
+-.br
+-No longer exists\&. It existed only in Beta releases of Javadoc 1\&.2\&. It was renamed to \f3-doctitle\fR\&. This option was renamed to make it clear that it defines the document title, rather than the window title\&.
+-.TP
+--header \fIheader\fR
+-.br
+-Specifies the header text to be placed at the top of each output file\&. The header is placed to the right of the upper navigation bar\&. The \f3header\fR can contain HTML tags and white space, but when it does, the \f3header\fR must be enclosed in quotation marks\&. Use escape characters for internal quotation marks within a header\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
+-.TP
+--footer \fIfooter\fR
+-.br
+-Specifies the footer text to be placed at the bottom of each output file\&. The \fIfooter\fR value is placed to the right of the lower navigation bar\&. The \f3footer\fR value can contain HTML tags and white space, but when it does, the \f3footer\fR value must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within a footer\&.
+-.TP
+--top
+-.br
+-Specifies the text to be placed at the top of each output file\&.
+-.TP
+--bottom \fItext\fR
+-.br
+-Specifies the text to be placed at the bottom of each output file\&. The text is placed at the bottom of the page, underneath the lower navigation bar\&. The text can contain HTML tags and white space, but when it does, the text must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within text\&.
+-.TP
+--link \fIextdocURL\fR
+-.br
+-Creates links to existing Javadoc-generated documentation of externally referenced classes\&. The \fIextdocURL\fR argument is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. You can specify multiple \f3-link\fR options in a specified \f3javadoc\fR command run to link to multiple documents\&.
+-
+-The package-list file must be found in this directory (otherwise, use the \f3-linkoffline\fR option)\&. The \f3javadoc\fR command reads the package names from the package-list file and links to those packages at that URL\&. When the \f3javadoc\fR command runs, the \f3extdocURL\fR value is copied into the \f3<A HREF>\fR links that are created\&. Therefore, \f3extdocURL\fR must be the URL to the directory, and not to a file\&. You can use an absolute link for \fIextdocURL\fR to enable your documents to link to a document on any web site, or you can use a relative link to link only to a relative location\&. If you use a relative link, then the value you pass in should be the relative path from the destination directory (specified with the \f3-d\fR option) to the directory containing the packages being linked to\&.When you specify an absolute link, you usually use an HTTP link\&. However, if you want to link to a file system that has no web server, then you can use a file link\&. Use a file link only when everyone who wants to access the generated documentation shares the same file system\&.In all cases, and on all operating systems, use a slash as the separator, whether the URL is absolute or relative, and \f3h\fR\f3ttp:\fR or \f3f\fR\f3ile:\fR as specified in the URL Memo: Uniform Resource Locators at http://www\&.ietf\&.org/rfc/rfc1738\&.txt
+-.sp
+-.nf
+-\f3\-link http://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\-link file://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\-link <directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Differences between the -linkoffline and -link options
+-
+-Use the \f3-link\fR option in the following cases:
+-.TP 0.2i
+-\(bu
+-When you use a relative path to the external API document\&.
+-.TP 0.2i
+-\(bu
+-When you use an absolute URL to the external API document if your shell lets you open a connection to that URL for reading\&.
+-.PP
+-Use the \f3-linkoffline\fR option when you use an absolute URL to the external API document, if your shell does not allow a program to open a connection to that URL for reading\&. This can occur when you are behind a firewall and the document you want to link to is on the other side\&.
+-.PP
+-\f3Example 1 Absolute Link to External Documents\fR
+-.PP
+-Use the following command if you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java platform packages, shown at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
+-.sp
+-.nf
+-\f3javadoc \-link http://docs\&.oracle\&.com/javase/8/docs/api/ com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The command generates documentation for the package \f3com\&.mypackage\fR with links to the Java SE packages\&. The generated documentation contains links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other options, such as the \f3-sourcepath\fR and \f3-d\fR options, are not shown\&.
+-.PP
+-\f3Example 2 Relative Link to External Documents\fR
+-.PP
+-In this example, there are two packages with documents that are generated in different runs of the \f3javadoc\fR command, and those documents are separated by a relative path\&. The packages are \f3com\&.apipackage\fR, an API, and c\f3om\&.spipackage\fR, an Service Provide Interface (SPI)\&. You want the documentation to reside in docs/api/com/apipackage and docs/spi/com/spipackage\&. Assuming that the API package documentation is already generated, and that docs is the current directory, you document the SPI package with links to the API documentation by running: \f3javadoc -d \&./spi -link \&.\&./api com\&.spipackage\fR\&.
+-.PP
+-Notice the \f3-link\fR option is relative to the destination directory (docs/spi)\&.
+-.PP
+-Notes
+-
+-The \f3-link\fR option lets you link to classes referenced to by your code, but not documented in the current \f3javadoc\fR command run\&. For these links to go to valid pages, you must know where those HTML pages are located and specify that location with \f3extdocURL\fR\&. This allows third-party documentation to link to java\&.* documentation at http://docs\&.oracle\&.com\&.Omit the \f3-link\fR option when you want the \f3javadoc\fR command to create links only to APIs within the documentation it is generating in the current run\&. Without the \f3-link\fR option, the \f3javadoc\fR command does not create links to documentation for external references because it does not know whether or where that documentation exists\&.The \f3-link\fR option can create links in several places in the generated documentation\&. See Process Source Files\&. Another use is for cross-links between sets of packages: Execute the \f3javadoc\fR command on one set of packages, then run the \f3javadoc\fR command again on another set of packages, creating links both ways between both sets\&.
+-.PP
+-How to Reference a Class
+-
+-For a link to an externally referenced class to appear (and not just its text label), the class must be referenced in the following way\&. It is not sufficient for it to be referenced in the body of a method\&. It must be referenced in either an \f3import\fR statement or in a declaration\&. Here are examples of how the class \f3java\&.io\&.File\fR can be referenced:
+-.PP
+-\fI\fRIn any kind of import statement\&. By wildcard import, import explicitly by name, or automatically import for \f3java\&.lang\&.*\fR\&.
+-.PP
+-In Java SE 1\&.3\&.\fIn\fR and 1\&.2\&.\fIn\fR, only an explicit import by name works\&. A wildcard \f3import\fR statement does not work, nor does the automatic \f3import java\&.lang\&.*\fR\&.
+-.PP
+-\fI\fRIn a declaration: \f3void mymethod(File f) {}\fR
+-.PP
+-The reference can be in the return type or parameter type of a method, constructor, field, class, or interface, or in an implements, extends, or throws statement\&.
+-.PP
+-An important corollary is that when you use the \f3-link\fR option, there can be many links that unintentionally do not appear due to this constraint\&. The text would appear without being a link\&. You can detect these by the warnings they emit\&. The simplest way to properly reference a class and add the link would be to import that class\&.
+-.PP
+-Package List
+-
+-The \f3-link\fR option requires that a file named package-list, which is generated by the \f3javadoc\fR command, exists at the URL you specify with the \f3-link\fR option\&. The package-list file is a simple text file that lists the names of packages documented at that location\&. In the earlier example, the \f3javadoc\fR command searches for a file named package-list at the specified URL, reads in the package names, and links to those packages at that URL\&.
+-.PP
+-For example, the package list for the Java SE API is located at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
+-.PP
+-The package list starts as follows:
+-.sp
+-.nf
+-\f3java\&.applet\fP
+-.fi
+-.nf
+-\f3java\&.awt\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.color\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.datatransfer\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.dnd\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.font\fP
+-.fi
+-.nf
+-\f3and so on \&.\&.\&.\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When \f3javadoc\fR is run without the \f3-link\fR option and encounters a name that belongs to an externally referenced class, it prints the name with no link\&. However, when the \f3-link\fR option is used, the \f3javadoc\fR command searches the package-list file at the specified \fIextdocURL\fR location for that package name\&. When it finds the package name, it prefixes the name with \fIextdocURL\fR\&.
+-.PP
+-For there to be no broken links, all of the documentation for the external references must exist at the specified URLs\&. The \f3javadoc\fR command does not check that these pages exist, but only that the package-list exists\&.
+-.PP
+-Multiple Links
+-
+-You can supply multiple \f3-link\fR options to link to any number of externally generated documents\&. Javadoc 1\&.2 has a known bug that prevents you from supplying more than one \f3-link\fR options\&. This was fixed in Javadoc 1\&.2\&.2\&. Specify a different link option for each external document to link to \f3javadoc -link extdocURL1 -link extdocURL2 \&.\&.\&. -link extdocURLn com\&.mypackage\fR where \fIextdocURL1\fR, \fIextdocURL2\fR, \&.\f3\&.\&. extdocURLn\fR point respectively to the roots of external documents, each of which contains a file named package-list\&.
+-.PP
+-Cross Links
+-
+-Note that bootstrapping might be required when cross-linking two or more documents that were previously generated\&. If package-list does not exist for either document when you run the \f3javadoc\fR command on the first document, then the package-list does not yet exist for the second document\&. Therefore, to create the external links, you must regenerate the first document after you generate the second document\&.
+-.PP
+-In this case, the purpose of first generating a document is to create its package-list (or you can create it by hand if you are certain of the package names)\&. Then, generate the second document with its external links\&. The \f3javadoc\fR command prints a warning when a needed external package-list file does not exist\&.
+-.TP
+--linkoffline \fIextdocURL packagelistLoc\fR
+-.br
+-This option is a variation of the \f3-link\fR option\&. They both create links to Javadoc-generated documentation for externally referenced classes\&. Use the \f3-link\fRo\f3ffline\fR option when linking to a document on the web when the \f3javadoc\fR command cannot access the document through a web connection\&. Use the \f3-linkoffline\fR option when package-list file of the external document is not accessible or does not exist at the \f3extdocURL\fR location, but does exist at a different location that can be specified by \f3packageListLoc\fR (typically local)\&. If \f3extdocURL\fR is accessible only on the World Wide Web, then the \f3-linkoffline\fR option removes the constraint that the \f3javadoc\fR command must have a web connection to generate documentation\&. Another use is as a work-around to update documents: After you have run the \f3javadoc\fR command on a full set of packages, you can run the \f3javadoc\fR command again on a smaller set of changed packages, so that the updated files can be inserted back into the original set\&. Examples follow\&. The \f3-linkoffline\fR option takes two arguments\&. The first is for the string to be embedded in the \f3<a href>\fR links, and the second tells the \f3-linkoffline\fR option where to find package-list:
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3extdocURL\fR value is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. When relative, the value should be the relative path from the destination directory (specified with the \f3-d\fR option) to the root of the packages being linked to\&. For more information, see \fIextdocURL\fR in the \f3-link\fR option\&.
+-.TP 0.2i
+-\(bu
+-The \f3packagelistLoc\fR value is the path or URL to the directory that contains the package-list file for the external documentation\&. This can be a URL (http: or file:) or file path, and can be absolute or relative\&. When relative, make it relative to the current directory from where the \f3javadoc\fR command was run\&. Do not include the package-list file name\&.
+-
+-You can specify multiple \f3-linkoffline\fR options in a specified \f3javadoc\fR command run\&. Before Javadoc 1\&.2\&.2, the \f3-linkfile\fR options could be specified once\&.
+-.RE
+-
+-.PP
+-Absolute Links to External Documents
+-
+-You might have a situation where you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java SE packages at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
+-.PP
+-However, your shell does not have web access\&. In this case, do the following:
+-.TP 0.4i
+-1\&.
+-Open the package-list file in a browser at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
+-.TP 0.4i
+-2\&.
+-Save the file to a local directory, and point to this local copy with the second argument, \f3packagelistLoc\fR\&. In this example, the package list file was saved to the current directory (\&.)\&.
+-.PP
+-The following command generates documentation for the package c\f3om\&.mypackage\fR with links to the Java SE packages\&. The generated documentation will contain links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other necessary options, such as \f3-sourcepath\fR, are not shown\&.
+-.sp
+-.nf
+-\f3javadoc \-linkoffline http://docs\&.oracle\&.com/javase/8/docs/api/ \&. com\&.mypackage \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Relative Links to External Documents
+-
+-It is not very common to use \f3-linkoffline\fR with relative paths, for the simple reason that the \f3-link\fR option is usually enough\&. When you use the \f3-linkoffline\fR option, the package-list file is usually local, and when you use relative links, the file you are linking to is also local, so it is usually unnecessary to give a different path for the two arguments to the \f3-linkoffline\fR option When the two arguments are identical, you can use the \f3-link\fR option\&.
+-.PP
+-Create a package-list File Manually
+-
+-If a package-list file does not exist yet, but you know what package names your document will link to, then you can manually create your own copy of this file and specify its path with \f3packagelistLoc\fR\&. An example would be the previous case where the package list for \f3com\&.spipackage\fR did not exist when \f3com\&.apipackage\fR was first generated\&. This technique is useful when you need to generate documentation that links to new external documentation whose package names you know, but which is not yet published\&. This is also a way of creating package-list files for packages generated with Javadoc 1\&.0 or 1\&.1, where package-list files were not generated\&. Similarly, two companies can share their unpublished package-list files so they can release their cross-linked documentation simultaneously\&.
+-.PP
+-Link to Multiple Documents
+-
+-You can include the \f3-linkoffline\fR option once for each generated document you want to refer to:
+-.sp
+-.nf
+-\f3javadoc \-linkoffline extdocURL1 packagelistLoc1 \-linkoffline extdocURL2\fP
+-.fi
+-.nf
+-\f3packagelistLoc2 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Update Documents
+-
+-You can also use the \f3-linkoffline\fR option when your project has dozens or hundreds of packages\&. If you have already run the \f3javadoc\fR command on the entire source tree, then you can quickly make small changes to documentation comments and rerun the \f3javadoc\fR command on a portion of the source tree\&. Be aware that the second run works properly only when your changes are to documentation comments and not to declarations\&. If you were to add, remove, or change any declarations from the source code, then broken links could show up in the index, package tree, inherited member lists, Use page, and other places\&.
+-.PP
+-First, create a new destination directory, such as update, for this new small run\&. In this example, the original destination directory is named html\&. In the simplest example, change directory to the parent of html\&. Set the first argument of the \f3-linkoffline\fR option to the current directory (\&.) and set the second argument to the relative path to html, where it can find package-list and pass in only the package names of the packages you want to update:
+-.sp
+-.nf
+-\f3javadoc \-d update \-linkoffline \&. html com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When the \f3javadoc\fR command completes, copy these generated class pages in update/com/package (not the overview or index) to the original files in html/com/package\&.
+-.TP
+--linksource
+-.br
+-Creates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation\&. Links are created for classes, interfaces, constructors, methods, and fields whose declarations are in a source file\&. Otherwise, links are not created, such as for default constructors and generated classes\&.
+-
+-This option exposes all private implementation details in the included source files, including private classes, private fields, and the bodies of private methods, regardless of the \f3-public\fR, \f3-package\fR, \f3-protected\fR, and \f3-private\fR options\&. Unless you also use the \f3-private\fR option, not all private classes or interfaces are accessible through links\&.
+-
+-Each link appears on the name of the identifier in its declaration\&. For example, the link to the source code of the \f3Button\fR class would be on the word \f3Button\fR:
+-.sp
+-.nf
+-\f3public class Button extends Component implements Accessible\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The link to the source code of the \f3getLabel\fR method in the \f3Button\fR class is on the word \f3getLabel\fR:
+-.sp
+-.nf
+-\f3public String getLabel()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--group groupheading \fIpackagepattern:packagepattern\fR
+-.br
+-Separates packages on the overview page into whatever groups you specify, one group per table\&. You specify each group with a different \f3-group\fR option\&. The groups appear on the page in the order specified on the command line\&. Packages are alphabetized within a group\&. For a specified \f3-group\fR option, the packages matching the list of \f3packagepattern\fR expressions appear in a table with the heading \fIgroupheading\fR\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3groupheading\fR can be any text and can include white space\&. This text is placed in the table heading for the group\&.
+-.TP 0.2i
+-\(bu
+-The \f3packagepattern\fR value can be any package name at the start of any package name followed by an asterisk (*)\&. The asterisk is the only wildcard allowed and means match any characters\&. Multiple patterns can be included in a group by separating them with colons (:)\&. If you use an asterisk in a pattern or pattern list, then the pattern list must be inside quotation marks, such as \f3"java\&.lang*:java\&.util"\fR\&.
+-.RE
+-
+-
+-When you do not supply a \f3-group\fR option, all packages are placed in one group with the heading \fIPackages\fR and appropriate subheadings\&. If the subheadings do not include all documented packages (all groups), then the remaining packages appear in a separate group with the subheading Other Packages\&.
+-
+-For example, the following \f3javadoc\fR command separates the three documented packages into \fICore\fR, \fIExtension\fR, and \fIOther Packages\fR\&. The trailing dot (\&.) does not appear in \f3java\&.lang*\fR\&. Including the dot, such as \f3java\&.lang\&.*\fR omits the\f3java\&.lang\fR package\&.
+-.sp
+-.nf
+-\f3javadoc \-group "Core Packages" "java\&.lang*:java\&.util"\fP
+-.fi
+-.nf
+-\f3 \-group "Extension Packages" "javax\&.*"\fP
+-.fi
+-.nf
+-\f3 java\&.lang java\&.lang\&.reflect java\&.util javax\&.servlet java\&.new\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fICore Packages\fR
+-
+-\f3java\&.lang\fR
+-
+-\f3java\&.lang\&.reflect\fR
+-
+-\f3java\&.util\fR
+-
+-\fIExtension Packages\fR
+-
+-\f3javax\&.servlet\fR
+-
+-\fIOther Packages\fR
+-
+-\f3java\&.new\fR
+-.TP
+--nodeprecated
+-.br
+-Prevents the generation of any deprecated API in the documentation\&. This does what the \f3-nodeprecatedlist\fR option does, and it does not generate any deprecated API throughout the rest of the documentation\&. This is useful when writing code when you do not want to be distracted by the deprecated code\&.
+-.TP
+--nodeprecatedlist
+-.br
+-Prevents the generation of the file that contains the list of deprecated APIs (deprecated-list\&.html) and the link in the navigation bar to that page\&. The \f3javadoc\fR command continues to generate the deprecated API throughout the rest of the document\&. This is useful when your source code contains no deprecated APIs, and you want to make the navigation bar cleaner\&.
+-.TP
+--nosince
+-.br
+-Omits from the generated documents the \f3Since\fR sections associated with the \f3@since\fR tags\&.
+-.TP
+--notree
+-.br
+-Omits the class/interface hierarchy pages from the generated documents\&. These are the pages you reach using the Tree button in the navigation bar\&. The hierarchy is produced by default\&.
+-.TP
+--noindex
+-.br
+-Omits the index from the generated documents\&. The index is produced by default\&.
+-.TP
+--nohelp
+-.br
+-Omits the HELP link in the navigation bars at the top and bottom of each page of output\&.
+-.TP
+--nonavbar
+-.br
+-Prevents the generation of the navigation bar, header, and footer, that are usually found at the top and bottom of the generated pages\&. The \f3-nonavbar\fR option has no affect on the \f3-bottom\fR option\&. The \f3-nonavbar\fR option is useful when you are interested only in the content and have no need for navigation, such as when you are converting the files to PostScript or PDF for printing only\&.
+-.TP
+--helpfile \fIpath\efilename\fR
+-.br
+-Specifies the path of an alternate help file path\efilename that the HELP link in the top and bottom navigation bars link to\&. Without this option, the \f3javadoc\fR command creates a help file help-doc\&.html that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to help-doc\&.html\&. The \f3javadoc\fR command adjusts the links in the navigation bar accordingly, for example:
+-.sp
+-.nf
+-\f3javadoc \-helpfile /home/user/myhelp\&.html java\&.awt\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--stylesheet \fIpath/filename\fR
+-.br
+-Specifies the path of an alternate HTML stylesheet file\&. Without this option, the \f3javadoc\fR command automatically creates a stylesheet file stylesheet\&.css that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to stylesheet\&.css, for example:
+-.sp
+-.nf
+-\f3javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--serialwarn
+-.br
+-Generates compile-time warnings for missing \f3@serial\fR tags\&. By default, Javadoc 1\&.2\&.2 and later versions generate no serial warnings\&. This is a reversal from earlier releases\&. Use this option to display the serial warnings, which helps to properly document default serializable fields and \f3writeExternal\fR methods\&.
+-.TP
+--charset \fIname\fR
+-.br
+-Specifies the HTML character set for this document\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
+-
+-For example, \f3javadoc -charset "iso-8859-1" mypackage\fR inserts the following line in the head of every generated page:
+-.sp
+-.nf
+-\f3<META http\-equiv="Content\-Type" content="text/html; charset=ISO\-8859\-1">\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This \f3META\fR tag is described in the HTML standard (4197265 and 4137321), HTML Document Representation, at http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
+-
+-See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
+-.TP
+--docencoding \fIname\fR
+-.br
+-Specifies the encoding of the generated HTML files\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
+-
+-If you omit the \f3-docencoding\fR option but use the \f3-encoding\fR option, then the encoding of the generated HTML files is determined by the \f3-encoding\fR option, for example: \f3javadoc -docencoding "iso-8859-1" mypackage\fR\&. See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
+-.TP
+--keywords
+-.br
+-Adds HTML keyword <META> tags to the generated file for each class\&. These tags can help search engines that look for <META> tags find the pages\&. Most search engines that search the entire Internet do not look at <META> tags, because pages can misuse them\&. Search engines offered by companies that confine their searches to their own website can benefit by looking at <META> tags\&. The <META> tags include the fully qualified name of the class and the unqualified names of the fields and methods\&. Constructors are not included because they are identical to the class name\&. For example, the class \f3String\fR starts with these keywords:
+-.sp
+-.nf
+-\f3<META NAME="keywords" CONTENT="java\&.lang\&.String class">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="CASE_INSENSITIVE_ORDER">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="length()">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="charAt()">\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--tag \fItagname\fR:Xaoptcmf:"\fItaghead\fR"
+-.br
+-Enables the \f3javadoc\fR command to interpret a simple, one-argument \f3@tagname\fR custom block tag in documentation comments\&. For the \f3javadoc\fR command to spell-check tag names, it is important to include a \f3-tag\fR option for every custom tag that is present in the source code, disabling (with \f3X\fR) those that are not being output in the current run\&.The colon (:) is always the separator\&. The \f3-tag\fR option outputs the tag heading \fItaghead\fR in bold, followed on the next line by the text from its single argument\&. Similar to any block tag, the argument text can contain inline tags, which are also interpreted\&. The output is similar to standard one-argument tags, such as the \f3@return\fR and \f3@author\fR tags\&. Omitting a value for \fItaghead\fR causes \f3tagname\fR to be the heading\&.
+-
+-\fIPlacement of tags\fR: The \f3Xaoptcmf\fR arguments determine where in the source code the tag is allowed to be placed, and whether the tag can be disabled (using \f3X\fR)\&. You can supply either \f3a\fR, to allow the tag in all places, or any combination of the other letters:
+-
+-\f3X\fR (disable tag)
+-
+-\f3a\fR (all)
+-
+-\f3o\fR (overview)
+-
+-\f3p\fR (packages)
+-
+-\f3t\fR (types, that is classes and interfaces)
+-
+-\f3c\fR (constructors)
+-
+-\f3m\fR (methods)
+-
+-\f3f\fR (fields)
+-
+-\fIExamples of single tags\fR: An example of a tag option for a tag that can be used anywhere in the source code is: \f3-tag todo:a:"To Do:"\fR\&.
+-
+-If you want the \f3@todo\fR tag to be used only with constructors, methods, and fields, then you use: \f3-tag todo:cmf:"To Do:"\fR\&.
+-
+-Notice the last colon (:) is not a parameter separator, but is part of the heading text\&. You would use either tag option for source code that contains the \f3@todo\fR tag, such as: \f3@todo The documentation for this method needs work\fR\&.
+-
+-\fIColons in tag names\fR: Use a backslash to escape a colon that you want to use in a tag name\&. Use the \f3-tag ejb\e\e:bean:a:"EJB Bean:"\fR option for the following documentation comment:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @ejb:bean\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fISpell-checking tag names\fR: Some developers put custom tags in the source code that they do not always want to output\&. In these cases, it is important to list all tags that are in the source code, enabling the ones you want to output and disabling the ones you do not want to output\&. The presence of \f3X\fR disables the tag, while its absence enables the tag\&. This gives the \f3javadoc\fR command enough information to know whether a tag it encounters is unknown, which is probably the results of a typographical error or a misspelling\&. The \f3javadoc\fR command prints a warning in these cases\&. You can add \f3X\fR to the placement values already present, so that when you want to enable the tag, you can simply delete the \f3X\fR\&. For example, if the \f3@todo\fR tag is a tag that you want to suppress on output, then you would use: \f3-tag todo:Xcmf:"To Do:"\fR\&. If you would rather keep it simple, then use this: \f3-tag todo:X\fR\&. The syntax \f3-tag todo:X\fR works even when the \f3@todo\fR tag is defined by a taglet\&.
+-
+-\fIOrder of tags\fR: The order of the \f3-ta\fR\f3g\fR and \f3-taglet\fR options determines the order the tags are output\&. You can mix the custom tags with the standard tags to intersperse them\&. The tag options for standard tags are placeholders only for determining the order\&. They take only the standard tag\&'s name\&. Subheadings for standard tags cannot be altered\&. This is illustrated in the following example\&.If the \f3-tag\fR option is missing, then the position of the \f3-tagle\fR\f3t\fR option determines its order\&. If they are both present, then whichever appears last on the command line determines its order\&. This happens because the tags and taglets are processed in the order that they appear on the command line\&. For example, if the \f3-taglet\fR and \f3-tag\fR options have the name \f3todo\fR value, then the one that appears last on the command line determines the order\&.
+-
+-\fIExample of a complete set of tags\fR: This example inserts To Do after Parameters and before Throws in the output\&. By using \f3X\fR, it also specifies that the \f3@example\fR tag might be encountered in the source code that should not be output during this run\&. If you use the \f3@argfile\fR tag, then you can put the tags on separate lines in an argument file similar to this (no line continuation characters needed):
+-.sp
+-.nf
+-\f3\-tag param\fP
+-.fi
+-.nf
+-\f3\-tag return\fP
+-.fi
+-.nf
+-\f3\-tag todo:a:"To Do:"\fP
+-.fi
+-.nf
+-\f3\-tag throws\fP
+-.fi
+-.nf
+-\f3\-tag see\fP
+-.fi
+-.nf
+-\f3\-tag example:X\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the \f3javadoc\fR command parses the documentation comments, any tag encountered that is neither a standard tag nor passed in with the \f3-tag\fR or \f3-taglet\fR options is considered unknown, and a warning is thrown\&.
+-
+-The standard tags are initially stored internally in a list in their default order\&. Whenever the \f3-tag\fR options are used, those tags get appended to this list\&. Standard tags are moved from their default position\&. Therefore, if a \f3-tag\fR option is omitted for a standard tag, then it remains in its default position\&.
+-
+-\fIAvoiding conflicts\fR: If you want to create your own namespace, then you can use a dot-separated naming convention similar to that used for packages: \f3com\&.mycompany\&.todo\fR\&. Oracle will continue to create standard tags whose names do not contain dots\&. Any tag you create will override the behavior of a tag by the same name defined by Oracle\&. If you create a \f3@todo\fR tag or taglet, then it always has the same behavior you define, even when Oracle later creates a standard tag of the same name\&.
+-
+-\fIAnnotations vs\&. Javadoc tags\fR: In general, if the markup you want to add is intended to affect or produce documentation, then it should be a Javadoc tag\&. Otherwise, it should be an annotation\&. See Custom Tags and Annotations in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#annotations
+-
+-You can also create more complex block tags or custom inline tags with the \f3-taglet\fR option\&.
+-.TP
+--taglet \fIclass\fR
+-.br
+-Specifies the class file that starts the taglet used in generating the documentation for that tag\&. Use the fully qualified name for the \f3class\fR value\&. This taglet also defines the number of text arguments that the custom tag has\&. The taglet accepts those arguments, processes them, and generates the output\&. For extensive documentation with example taglets, see: Taglet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html
+-
+-Taglets are useful for block or inline tags\&. They can have any number of arguments and implement custom behavior, such as making text bold, formatting bullets, writing out the text to a file, or starting other processes\&. Taglets can only determine where a tag should appear and in what form\&. All other decisions are made by the doclet\&. A taglet cannot do things such as remove a class name from the list of included classes\&. However, it can execute side effects, such as printing the tag\&'s text to a file or triggering another process\&. Use the \f3-tagletpath\fR option to specify the path to the taglet\&. The following example inserts the To Do taglet after Parameters and ahead of Throws in the generated pages\&. Alternately, you can use the \f3-taglet\fR option in place of its \f3-tag\fR option, but that might be difficult to read\&.
+-.sp
+-.nf
+-\f3\-taglet com\&.sun\&.tools\&.doclets\&.ToDoTaglet\fP
+-.fi
+-.nf
+-\f3\-tagletpath /home/taglets \fP
+-.fi
+-.nf
+-\f3\-tag return\fP
+-.fi
+-.nf
+-\f3\-tag param\fP
+-.fi
+-.nf
+-\f3\-tag todo\fP
+-.fi
+-.nf
+-\f3\-tag throws\fP
+-.fi
+-.nf
+-\f3\-tag see\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--tagletpath \fItagletpathlist\fR
+-.br
+-Specifies the search paths for finding taglet class files\&. The \f3tagletpathlist\fR can contain multiple paths by separating them with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&.
+-.TP
+--docfilesubdirs
+-.br
+-Enables deep copying of doc-files directories\&. Subdirectories and all contents are recursively copied to the destination\&. For example, the directory doc-files/example/images and all of its contents would be copied\&. There is also an option to exclude subdirectories\&.
+-.TP
+--excludedocfilessubdir \fIname1:name2\fR
+-.br
+-Excludes any doc-files subdirectories with the specified names\&. This prevents the copying of SCCS and other source-code-control subdirectories\&.
+-.TP
+--noqualifier all | \fIpackagename1\fR:\fIpackagename2\&.\&.\&.\fR
+-.br
+-Omits qualifying package names from class names in output\&. The argument to the \f3-noqualifier\fR option is either \f3all\fR (all package qualifiers are omitted) or a colon-separate list of packages, with wild cards, to be removed as qualifiers\&. The package name is removed from places where class or interface names appear\&. See Process Source Files\&.
+-
+-The following example omits all package qualifiers: \f3-noqualifier all\fR\&.
+-
+-The following example omits \f3java\&.lang\fR and \f3java\&.io\fR package qualifiers: \f3-noqualifier java\&.lang:java\&.io\fR\&.
+-
+-The following example omits package qualifiers starting with \f3java\fR, and \f3com\&.sun\fR subpackages, but not \f3javax\fR: \f3-noqualifier java\&.*:com\&.sun\&.*\fR\&.
+-
+-Where a package qualifier would appear due to the previous behavior, the name can be suitably shortened\&. See How a Name Appears\&. This rule is in effect whether or not the \f3-noqualifier\fR option is used\&.
+-.TP
+--notimestamp
+-.br
+-Suppresses the time stamp, which is hidden in an HTML comment in the generated HTML near the top of each page\&. The \f3-notimestamp\fR option is useful when you want to run the \f3javadoc\fR command on two source bases and get the differences between \f3diff\fR them, because it prevents time stamps from causing a \f3diff\fR (which would otherwise be a \f3diff\fR on every page)\&. The time stamp includes the \f3javadoc\fR command release number, and currently appears similar to this: \f3<!-- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 -->\fR\&.
+-.TP
+--nocomment
+-.br
+-Suppresses the entire comment body, including the main description and all tags, and generate only declarations\&. This option lets you reuse source files that were originally intended for a different purpose so that you can produce skeleton HTML documentation at the early stages of a new project\&.
+-.TP
+--sourcetab \fItablength\fR
+-.br
+-Specifies the number of spaces each tab uses in the source\&.
+-.SH COMMAND-LINE\ ARGUMENT\ FILES
+-To shorten or simplify the \f3javadoc\fR command, you can specify one or more files that contain arguments to the \f3javadoc\fR command (except \f3-J\fR options)\&. This enables you to create \f3javadoc\fR commands of any length on any operating system\&.
+-.PP
+-An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be space-separated or newline-separated\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
+-.PP
+-File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (\f3*\fR) are not allowed in these lists (such as for specifying *\&.java)\&. Using the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
+-.PP
+-When you run the \f3javadoc\fR command, pass in the path and name of each argument file with the @ leading character\&. When the \f3javadoc\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
+-.PP
+-\f3Example 1 Single Argument File\fR
+-.PP
+-You could use a single argument file named \f3argfile\fR to hold all \f3javadoc\fR command arguments: \f3javadoc @argfile\fR\&. The argument file \f3\fRcontains the contents of both files, as shown in the next example\&.
+-.PP
+-\f3Example 2 Two Argument Files\fR
+-.PP
+-You can create two argument files: One for the \f3javadoc\fR command options and the other for the package names or source file names\&. Notice the following lists have no line-continuation characters\&.
+-.PP
+-Create a file named options that contains:
+-.sp
+-.nf
+-\f3\-d docs\-filelist \fP
+-.fi
+-.nf
+-\f3\-use \fP
+-.fi
+-.nf
+-\f3\-splitindex\fP
+-.fi
+-.nf
+-\f3\-windowtitle \&'Java SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3\-doctitle \&'Java SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3\-header \&'<b>Java\(tm SE 7</b>\&'\fP
+-.fi
+-.nf
+-\f3\-bottom \&'Copyright &copy; 1993\-2011 Oracle and/or its affiliates\&. All rights reserved\&.\&'\fP
+-.fi
+-.nf
+-\f3\-group "Core Packages" "java\&.*"\fP
+-.fi
+-.nf
+-\f3\-overview /java/pubs/ws/1\&.7\&.0/src/share/classes/overview\-core\&.html\fP
+-.fi
+-.nf
+-\f3\-sourcepath /java/pubs/ws/1\&.7\&.0/src/share/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Create a file named packages that contains:
+-.sp
+-.nf
+-\f3com\&.mypackage1\fP
+-.fi
+-.nf
+-\f3com\&.mypackage2\fP
+-.fi
+-.nf
+-\f3com\&.mypackage3\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3javadoc\fR command as follows:
+-.sp
+-.nf
+-\f3javadoc @options @packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Argument Files with Paths\fR
+-.PP
+-The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
+-.sp
+-.nf
+-\f3javadoc @path1/options @path2/packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Option Arguments\fR
+-.PP
+-The following example saves an argument to a \f3javadoc\fR command option in an argument file\&. The \f3-bottom\fR option is used because it can have a lengthy argument\&. You could create a file named bottom to contain the text argument:
+-.sp
+-.nf
+-\f3<font size="\-1">\fP
+-.fi
+-.nf
+-\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&. <br/>\fP
+-.fi
+-.nf
+-\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3 Other names may be trademarks of their respective owners\&.</font>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3javadoc\fR command as follows:\f3javadoc -bottom @bottom @packages\fR\&.
+-.PP
+-You can also include the \f3-bottom\fR option at the start of the argument file and run the \f3javadoc\fR command as follows: \f3javadoc @bottom @packages\fR\&.
+-.SH RUNNING\ THE\ JAVADOC\ COMMAND
+-The release number of the \f3javadoc\fR command can be determined with the \f3javadoc -J-version\fR option\&. The release number of the standard doclet appears in the output stream\&. It can be turned off with the \f3-quiet\fR option\&.
+-.PP
+-Use the public programmatic interface to call the \f3javadoc\fR command from within programs written in the Java language\&. This interface is in \f3com\&.sun\&.tools\&.javadoc\&.Main\fR (and the \f3javadoc\fR command is reentrant)\&. For more information, see The Standard Doclet at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard-doclet\&.html#runningprogrammatically
+-.PP
+-The following instructions call the standard HTML doclet\&. To call a custom doclet, use the \f3-doclet\fR and \f3-docletpath\fR options\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.SS SIMPLE\ EXAMPLES
+-You can run the \f3javadoc\fR command on entire packages or individual source files\&. Each package name has a corresponding directory name\&.
+-.PP
+-In the following examples, the source files are located at /home/src/java/awt/*\&.java\&. The destination directory is /home/html\&.
+-.PP
+-Document One or More Packages
+-
+-To document a package, the source files for that package must be located in a directory that has the same name as the package\&.
+-.PP
+-If a package name has several identifiers (separated by dots, such as \f3java\&.awt\&.color\fR), then each subsequent identifier must correspond to a deeper subdirectory (such as java/awt/color)\&.
+-.PP
+-You can split the source files for a single package among two such directory trees located at different places, as long as \f3-sourcepath\fR points to them both\&. For example, src1/java/awt/color and src2/java/awt/color\&.
+-.PP
+-You can run the \f3javadoc\fR command either by changing directories (with the \f3cd\fR command) or by using the \f3-sourcepath\fR option\&. The following examples illustrate both alternatives\&.
+-.PP
+-\f3Example 1 Recursive Run from One or More Packages\fR
+-.PP
+-This example uses \f3-sourcepath\fR so the \f3javadoc\fR command can be run from any directory and \f3-subpackages\fR (a new 1\&.4 option) for recursion\&. It traverses the subpackages of the java directory excluding packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice this excludes \f3java\&.lang\&.ref\fR, a subpackage of \f3java\&.lang\fR\&. To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as \f3java:javax:org\&.xml\&.sax\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Change to Root and Run Explicit Packages\fR
+-.PP
+-Change to the parent directory of the fully qualified package\&. Then, run the \f3javadoc\fR command with the names of one or more packages that you want to document:
+-.sp
+-.nf
+-\f3cd /home/src/\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as j\f3ava:javax:org\&.xml\&.sax\fR\&.
+-.PP
+-\f3Example 3 Run from Any Directory on Explicit Packages in One Tree\fR
+-.PP
+-In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with the parent directory of the top-level package\&. Provide the names of one or more packages that you want to document:
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Run from Any Directory on Explicit Packages in Multiple Trees\fR
+-.PP
+-Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with a colon-separated list of the paths to each tree\&'s root\&. Provide the names of one or more packages that you want to document\&. All source files for a specified package do not need to be located under a single root directory, but they must be found somewhere along the source path\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src1:/home/src2 java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The result is that all cases generate HTML-formatted documentation for the \f3public\fR and \f3protected\fR classes and interfaces in packages j\f3ava\&.awt\fR and \f3java\&.awt\&.even\fRt and save the HTML files in the specified destination directory\&. Because two or more packages are being generated, the document has three HTML frames: one for the list of packages, another for the list of classes, and the third for the main class pages\&.
+-.PP
+-Document One or More Classes
+-
+-The second way to run the \f3javadoc\fR command is to pass one or more source files\&. You can run \f3javadoc\fR either of the following two ways: by changing directories (with the \f3cd\fR command) or by fully specifying the path to the source files\&. Relative paths are relative to the current directory\&. The \f3-sourcepath\fR option is ignored when passing source files\&. You can use command-line wild cards, such as an asterisk (*), to specify groups of classes\&.
+-.PP
+-\f3Example 1 Change to the Source Directory\fR
+-.PP
+-Change to the directory that holds the source files\&. Then run the \f3javadoc\fR command with the names of one or more source files you want to document\&.
+-.PP
+-This example generates HTML-formatted documentation for the classes \f3Button\fR, \f3Canvas,\fR and classes that begin with \f3Graphics\fR\&. Because source files rather than package names were passed in as arguments to the \f3javadoc\fR command, the document has two frames: one for the list of classes and the other for the main page\&.
+-.sp
+-.nf
+-\f3cd /home/src/java/awt\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html Button\&.java Canvas\&.java Graphics*\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Change to the Root Directory of the Package\fR
+-.PP
+-This is useful for documenting individual source files from different subpackages off of the same root\&. Change to the package root directory, and supply the source files with paths from the root\&.
+-.sp
+-.nf
+-\f3cd /home/src/\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html java/awt/Button\&.java java/applet/Applet\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Document Files from Any Directory\fR
+-.PP
+-In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command with the absolute path (or path relative to the current directory) to the source files you want to document\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html /home/src/java/awt/Button\&.java\fP
+-.fi
+-.nf
+-\f3/home/src/java/awt/Graphics*\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Document Packages and Classes
+-
+-You can document entire packages and individual classes at the same time\&. Here is an example that mixes two of the previous examples\&. You can use the \f3-sourcepath\fR option for the path to the packages but not for the path to the individual classes\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt\fP
+-.fi
+-.nf
+-\f3/home/src/java/applet/Applet\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS REAL-WORLD\ EXAMPLES
+-The following command-line and \f3makefile\fR versions of the \f3javadoc\fR command run on the Java platform APIs\&. It uses 180 MB of memory to generate the documentation for the 1500 (approximately) public and protected classes in the Java SE 1\&.2\&. Both examples use absolute paths in the option arguments, so that the same \f3javadoc\fR command can be run from any directory\&.
+-.PP
+-Command-Line Example
+-
+-The following command might be too long for some shells\&. You can use a command-line argument file (or write a shell script) to overcome this limitation\&.
+-.PP
+-In the example, \f3packages\fR is the name of a file that contains the packages to process, such as \f3java\&.applet\fR\f3java\&.lang\fR\&. None of the options should contain any newline characters between the single quotation marks\&. For example, if you copy and paste this example, then delete the newline characters from the \f3-bottom\fR option\&.
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /java/jdk/src/share/classes \e\fP
+-.fi
+-.nf
+-\f3\-overview /java/jdk/src/share/classes/overview\&.html \e\fP
+-.fi
+-.nf
+-\f3\-d /java/jdk/build/api \e\fP
+-.fi
+-.nf
+-\f3\-use \e\fP
+-.fi
+-.nf
+-\f3\-splitIndex \e\fP
+-.fi
+-.nf
+-\f3\-windowtitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
+-.fi
+-.nf
+-\f3\-doctitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
+-.fi
+-.nf
+-\f3\-header \&'<b>Java\(tm SE 7</b>\&' \e\fP
+-.fi
+-.nf
+-\f3\-bottom \&'<font size="\-1">\fP
+-.fi
+-.nf
+-\f3<a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
+-.fi
+-.nf
+-\f3Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3Other names may be trademarks of their respective owners\&.</font>\&' \e\fP
+-.fi
+-.nf
+-\f3\-group "Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*" \e\fP
+-.fi
+-.nf
+-\f3\-group "Extension Packages" "javax\&.*" \e\fP
+-.fi
+-.nf
+-\f3\-J\-Xmx180m \e \fP
+-.fi
+-.nf
+-\f3@packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Programmatic Interface
+-
+-The Javadoc Access API enables the user to invoke the Javadoc tool directly from a Java application without executing a new process\&.
+-.PP
+-For example, the following statements are equivalent to the command \f3javadoc -d /home/html -sourcepath /home/src -subpackages java -exclude java\&.net:java\&.lang com\&.example\fR:
+-.sp
+-.nf
+-\f3import javax\&.tools\&.DocumentationTool;\fP
+-.fi
+-.nf
+-\f3import javax\&.tools\&.ToolProvider;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class JavaAccessSample{\fP
+-.fi
+-.nf
+-\f3 public static void main(String[] args){\fP
+-.fi
+-.nf
+-\f3 DocumentationTool javadoc = ToolProvider\&.getSystemDocumentationTool();\fP
+-.fi
+-.nf
+-\f3 int rc = javadoc\&.run( null, null, null,\fP
+-.fi
+-.nf
+-\f3 "\-d", "/home/html",\fP
+-.fi
+-.nf
+-\f3 "\-sourcepath", "home/src",\fP
+-.fi
+-.nf
+-\f3 "\-subpackages", "java",\fP
+-.fi
+-.nf
+-\f3 "\-exclude", "java\&.net:java\&.lang",\fP
+-.fi
+-.nf
+-\f3 "com\&.example");\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The first three arguments of the \f3run\fR method specify input, standard output, and standard error streams\&. \f3Null\fR is the default value for \f3System\&.in\fR, \f3System\&.out\fR, and \f3System\&.err\fR, respectively\&.
+-.SS THE\ MAKEFILE\ EXAMPLE
+-This is an example of a GNU \f3makefile\fR\&. Single quotation marks surround \f3makefile\fR arguments\&. For an example of a Windows \f3makefile\fR, see the \f3makefiles\fR section of the Javadoc FAQ at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html#makefiles
+-.sp
+-.nf
+-\f3javadoc \-sourcepath $(SRCDIR) \e /* Sets path for source files */\fP
+-.fi
+-.nf
+-\f3 \-overview $(SRCDIR)/overview\&.html \e /* Sets file for overview text */\fP
+-.fi
+-.nf
+-\f3 \-d /java/jdk/build/api \e /* Sets destination directory */\fP
+-.fi
+-.nf
+-\f3 \-use \e /* Adds "Use" files */\fP
+-.fi
+-.nf
+-\f3 \-splitIndex \e /* Splits index A\-Z */\fP
+-.fi
+-.nf
+-\f3 \-windowtitle $(WINDOWTITLE) \e /* Adds a window title */\fP
+-.fi
+-.nf
+-\f3 \-doctitle $(DOCTITLE) \e /* Adds a doc title */\fP
+-.fi
+-.nf
+-\f3 \-header $(HEADER) \e /* Adds running header text */\fP
+-.fi
+-.nf
+-\f3 \-bottom $(BOTTOM) \e /* Adds text at bottom */\fP
+-.fi
+-.nf
+-\f3 \-group $(GROUPCORE) \e /* 1st subhead on overview page */\fP
+-.fi
+-.nf
+-\f3 \-group $(GROUPEXT) \e /* 2nd subhead on overview page */\fP
+-.fi
+-.nf
+-\f3 \-J\-Xmx180m \e /* Sets memory to 180MB */\fP
+-.fi
+-.nf
+-\f3 java\&.lang java\&.lang\&.reflect \e /* Sets packages to document */\fP
+-.fi
+-.nf
+-\f3 java\&.util java\&.io java\&.net \e\fP
+-.fi
+-.nf
+-\f3 java\&.applet\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3WINDOWTITLE = \&'Java\(tm SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3DOCTITLE = \&'Java\(tm Platform Standard Edition 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3HEADER = \&'<b>Java\(tm SE 7</font>\&'\fP
+-.fi
+-.nf
+-\f3BOTTOM = \&'<font size="\-1">\fP
+-.fi
+-.nf
+-\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
+-.fi
+-.nf
+-\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3 Other names may be trademarks of their respective owners\&.</font>\&'\fP
+-.fi
+-.nf
+-\f3GROUPCORE = \&'"Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*"\&'\fP
+-.fi
+-.nf
+-\f3GROUPEXT = \&'"Extension Packages" "javax\&.*"\&'\fP
+-.fi
+-.nf
+-\f3SRCDIR = \&'/java/jdk/1\&.7\&.0/src/share/classes\&'\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS NOTES
+-.TP 0.2i
+-\(bu
+-If you omit the \f3-windowtitle\fR option, then the \f3javadoc\fR command copies the document title to the window title\&. The \f3-windowtitle\fR option text is similar to the the \f3-doctitle\fR option, but without HTML tags to prevent those tags from appearing as raw text in the window title\&.
+-.TP 0.2i
+-\(bu
+-If you omit the \f3-footer\fR option, then the \f3javadoc\fR command copies the header text to the footer\&.
+-.TP 0.2i
+-\(bu
+-Other important options you might want to use, but were not needed in the previous example, are the \f3-classpath\fR and \f3-link\fR options\&.
+-.SH GENERAL\ TROUBLESHOOTING
+-.TP 0.2i
+-\(bu
+-The \f3javadoc\fR command reads only files that contain valid class names\&. If the \f3javadoc\fR command is not correctly reading the contents of a file, then verify that the class names are valid\&. See Process Source Files\&.
+-.TP 0.2i
+-\(bu
+-See the Javadoc FAQ for information about common bugs and for troubleshooting tips at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html
+-.SH ERRORS\ AND\ WARNINGS
+-Error and warning messages contain the file name and line number to the declaration line rather than to the particular line in the documentation comment\&.
+-.PP
+-For example, this message \f3error: cannot read: Class1\&.java\fR means that the \f3javadoc\fR command is trying to load \f3Class1\&.jav\fR\f3a\fR in the current directory\&. The class name is shown with its path (absolute or relative)\&.
+-.SH ENVIRONMENT
+-.TP
+-CLASSPATH
+-\f3CLASSPATH\fR is the environment variable that provides the path that the \f3javadoc\fR command uses to find user class files\&. This environment variable is overridden by the \f3-classpath\fR option\&. Separate directories with a semicolon for Windows or a colon for Oracle Solaris\&.
+-
+-\fIWindows example\fR: \f3\&.;C:\eclasses;C:\ehome\ejava\eclasses\fR
+-
+-\fIOracle Solaris example\fR: \f3\&.:/home/classes:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
+-.SH RELATED\ DOCUMENTS
+-.TP 0.2i
+-\(bu
+-Javadoc Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/index\&.html
+-.TP 0.2i
+-\(bu
+-How Classes Are Found http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-.TP 0.2i
+-\(bu
+-How to Write Doc Comments for the Javadoc Tool http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html
+-.TP 0.2i
+-\(bu
+-URL Memo, Uniform Resource Locators http://www\&.ietf\&.org/rfc/rfc1738\&.txt
+-.TP 0.2i
+-\(bu
+-HTML standard, HTML Document Representation (4197265 and 4137321) http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
++
++.SH NAME
++javadoc \- Generates HTML pages of API documentation from Java source files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavadoc\fR {\fIpackages\fR|\fIsource\-files\fR} [\fIoptions\fR] [\fI@argfiles\fR]
++.fi
++.sp
++.TP
++\fIpackages\fR
++Names of packages that you want to document, separated by spaces, for example \f3java\&.lang java\&.lang\&.reflect java\&.awt\fR\&. If you want to also document the subpackages, use the \f3-subpackages\fR option to specify the packages\&.
++
++By default, \f3javadoc\fR looks for the specified packages in the current directory and subdirectories\&. Use the \f3-sourcepath\fR option to specify the list of directories where to look for packages\&.
++.TP
++\fIsource-files\fR
++Names of Java source files that you want to document, separated by spaces, for example \f3Class\&.java Object\&.java Button\&.java\fR\&. By default, \f3javadoc\fR looks for the specified classes in the current directory\&. However, you can specify the full path to the class file and use wildcard characters, for example \f3/home/src/java/awt/Graphics*\&.java\fR\&. You can also specify the path relative to the current directory\&.
++.TP
++\fIoptions\fR
++Command-line options, separated by spaces\&. See Options\&.
++.TP
++\fI@argfiles\fR
++Names of files that contain a list of \f3javadoc\fR command options, package names and source file names in any order\&.
++.SH DESCRIPTION
++The \f3javadoc\fR command parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages that describe (by default) the public and protected classes, nested classes (but not anonymous inner classes), interfaces, constructors, methods, and fields\&. You can use the \f3javadoc\fR command to generate the API documentation or the implementation documentation for a set of source files\&.
++.PP
++You can run the \f3javadoc\fR command on entire packages, individual source files, or both\&. When documenting entire packages, you can either use the \f3-subpackages\fR option to recursively traverse a directory and its subdirectories, or to pass in an explicit list of package names\&. When you document individual source files, pass in a list of Java source file names\&. See Simple Examples\&.
++.SS PROCESS\ SOURCE\ FILES
++The \f3javadoc\fR command processes files that end in source and other files described in Source Files\&. If you run the \f3javadoc\fR command by passing in individual source file names, then you can determine exactly which source files are processed\&. However, that is not how most developers want to work, because it is simpler to pass in package names\&. The \f3javadoc\fR command can be run three ways without explicitly specifying the source file names\&. You can pass in package names, use the \f3-subpackages\fR option, or use wild cards with source file names\&. In these cases, the \f3javadoc\fR command processes a source file only when the file fulfills all of the following requirements:
++.TP 0.2i
++\(bu
++The file name prefix (with \f3\&.java\fR removed) is a valid class name\&.
++.TP 0.2i
++\(bu
++The path name relative to the root of the source tree is a valid package name after the separators are converted to dots\&.
++.TP 0.2i
++\(bu
++The package statement contains the valid package name\&.
++.PP
++Processing Links
++
++During a run, the \f3javadoc\fR command adds cross-reference links to package, class, and member names that are being documented as part of that run\&. Links appear in the following places\&. See Javadoc Tags for a description of the @ tags\&.
++.TP 0.2i
++\(bu
++Declarations (return types, argument types, and field types)\&.
++.TP 0.2i
++\(bu
++\fISee Also\fR sections that are generated from \f3@see\fR tags\&.
++.TP 0.2i
++\(bu
++Inline text generated from \f3{@link}\fR tags\&.
++.TP 0.2i
++\(bu
++Exception names generated from \f3@throws\fR tags\&.
++.TP 0.2i
++\(bu
++\fISpecified by\fR links to interface members and \fIOverrides\fR links to class members\&. See Method Comment Inheritance\&.
++.TP 0.2i
++\(bu
++Summary tables listing packages, classes and members\&.
++.TP 0.2i
++\(bu
++Package and class inheritance trees\&.
++.TP 0.2i
++\(bu
++The index\&.
++.PP
++You can add links to existing text for classes not included on the command line (but generated separately) by way of the \f3-link\fR and \f3-linkoffline\fR options\&.
++.PP
++Processing Details
++
++The \f3javadoc\fR command produces one complete document every time it runs\&. It does not do incremental builds that modify or directly incorporate the results from earlier runs\&. However, the \f3javadoc\fR command can link to results from other runs\&.
++.PP
++The \f3javadoc\fR command implementation requires and relies on the Java compiler\&. The \f3javadoc\fR command calls part of the \f3javac\fR command to compile the declarations and ignore the member implementations\&. The \f3javadoc\fR command builds a rich internal representation of the classes that includes the class hierarchy and use relationships to generate the HTML\&. The \f3javadoc\fR command also picks up user-supplied documentation from documentation comments in the source code\&. See Documentation Comments\&.
++.PP
++The \f3javadoc\fR command runs on source files that are pure stub files with no method bodies\&. This means you can write documentation comments and run the \f3javadoc\fR command in the early stages of design before API implementation\&.
++.PP
++Relying on the compiler ensures that the HTML output corresponds exactly with the actual implementation, which may rely on implicit, rather than explicit, source code\&. For example, the \f3javadoc\fR command documents default constructors that are present in the compiled class files but not in the source code\&.
++.PP
++In many cases, the \f3javadoc\fR command lets you generate documentation for source files with incomplete or erroneous code\&. You can generate documentation before all debugging and troubleshooting is done\&. The \f3javadoc\fR command does primitive checking of documentation comments\&.
++.PP
++When the \f3javadoc\fR command builds its internal structure for the documentation, it loads all referenced classes\&. Because of this, the \f3javadoc\fR command must be able to find all referenced classes, whether bootstrap classes, extensions, or user classes\&. See How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++.PP
++Typically, classes you create must either be loaded as an extension or in the \f3javadoc\fR command class path\&.
++.SS JAVADOC\ DOCLETS
++You can customize the content and format of the \f3javadoc\fR command output with doclets\&. The \f3javadoc\fR command has a default built-in doclet, called the standard doclet, that generates HTML-formatted API documentation\&. You can modify or make a subclass of the standard doclet, or write your own doclet to generate HTML, XML, MIF, RTF or whatever output format you want\&.
++.PP
++When a custom doclet is not specified with the \f3-doclet\fR option, the \f3javadoc\fR command uses the default standard doclet\&. The \f3javadoc\fR command has several options that are available regardless of which doclet is being used\&. The standard doclet adds a supplementary set of command-line options\&. See Options\&.
++.SH SOURCE\ FILES
++The \f3javadoc\fR command generates output that originates from the following types of source files: Java language source files for classes (\f3\&.java\fR), package comment files, overview comment files, and miscellaneous unprocessed files\&. This section also describes test files and template files that can also be in the source tree, but that you want to be sure not to document\&.
++.SS CLASS\ SOURCE\ FILES
++Each class or interface and its members can have their own documentation comments contained in a source file\&. See Documentation Comments\&.
++.SS PACKAGE\ COMMENT\ FILES
++Each package can have its own documentation comment, contained in its own source file, that the \f3javadoc\fR command merges into the generated package summary page\&. You typically include in this comment any documentation that applies to the entire package\&.
++.PP
++To create a package comment file, you can place your comments in one of the following files:
++.TP 0.2i
++\(bu
++The \f3package-info\&.java\fR file can contain the package declaration, package annotations, package comments, and Javadoc tags\&. This file is preferred\&.
++.TP 0.2i
++\(bu
++The \f3package\&.html\fR file contains only package comments and Javadoc tags\&. No package annotations\&.
++.PP
++A package can have a single \f3package\&.html\fR file or a single \f3package-info\&.java\fR file, but not both\&. Place either file in the package directory in the source tree with your source files\&.
++.PP
++The package-info\&.java File
++
++The \f3package-info\&.java\fR file can contain a package comment of the following structure\&. The comment is placed before the package declaration\&.
++.PP
++\fINote:\fR The comment separators \f3/**\fR and \f3*/\fR must be present, but the leading asterisks on the intermediate lines can be left off\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Provides the classes necessary to create an \fP
++.fi
++.nf
++\f3 * applet and the classes an applet uses \fP
++.fi
++.nf
++\f3 * to communicate with its applet context\&.\fP
++.fi
++.nf
++\f3 * <p>\fP
++.fi
++.nf
++\f3 * The applet framework involves two entities:\fP
++.fi
++.nf
++\f3 * the applet and the applet context\&.\fP
++.fi
++.nf
++\f3 * An applet is an embeddable window (see the\fP
++.fi
++.nf
++\f3 * {@link java\&.awt\&.Panel} class) with a few extra\fP
++.fi
++.nf
++\f3 * methods that the applet context can use to \fP
++.fi
++.nf
++\f3 * initialize, start, and stop the applet\&.\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @since 1\&.0\fP
++.fi
++.nf
++\f3 * @see java\&.awt\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3package java\&.lang\&.applet;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++The package\&.html File
++
++The \f3package\&.html\fR file can contain a package comment of the following structure\&. The comment is placed in the \f3<body>\fR element\&.
++.PP
++File: \f3java/applet/package\&.html\fR
++.sp
++.nf
++\f3<HTML>\fP
++.fi
++.nf
++\f3<BODY>\fP
++.fi
++.nf
++\f3Provides the classes necessary to create an applet and the \fP
++.fi
++.nf
++\f3classes an applet uses to communicate with its applet context\&.\fP
++.fi
++.nf
++\f3<p>\fP
++.fi
++.nf
++\f3The applet framework involves two entities: the applet\fP
++.fi
++.nf
++\f3and the applet context\&. An applet is an embeddable\fP
++.fi
++.nf
++\f3window (see the {@link java\&.awt\&.Panel} class) with a\fP
++.fi
++.nf
++\f3few extra methods that the applet context can use to\fP
++.fi
++.nf
++\f3initialize, start, and stop the applet\&. \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@since 1\&.0 \fP
++.fi
++.nf
++\f3@see java\&.awt\fP
++.fi
++.nf
++\f3</BODY>\fP
++.fi
++.nf
++\f3</HTML>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3package\&.html\fR file is a typical HTML file and does not include a package declaration\&. The content of the package comment file is written in HTML with one exception\&. The documentation comment should not include the comment separators \f3/**\fR and \f3*/\fR or leading asterisks\&. When writing the comment, make the first sentence a summary about the package, and do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. You can include package tags\&. All block tags must appear after the main description\&. If you add an \f3@see\fR tag in a package comment file, then it must have a fully qualified name\&.
++.PP
++Processing the Comment File
++
++When the \f3javadoc\fR command runs, it searches for the package comment file\&. If the package comment file is found, then the \f3javadoc\fR command does the following:
++.TP 0.2i
++\(bu
++Copies the comment for processing\&. For package\&.html, the \f3javadoc\fR command copies all content between the \f3<body>\fR and \f3</body>\fR HTML tags\&. You can include a \f3<head>\fR section to put a \f3<title>\fR tag, source file copyright statement, or other information, but none of these appear in the generated documentation\&.
++.TP 0.2i
++\(bu
++Processes the package tags\&. See Package Tags\&.
++.TP 0.2i
++\(bu
++Inserts the processed text at the bottom of the generated package summary page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++.TP 0.2i
++\(bu
++Copies the first sentence of the package comment to the top of the package summary page\&. The \f3javadoc\fR command also adds the package name and this first sentence to the list of packages on the overview page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++
++The end of the sentence is determined by the same rules used for the end of the first sentence of class and member main descriptions\&.
++.SS OVERVIEW\ COMMENT\ FILES
++Each application or set of packages that you are documenting can have its own overview documentation comment that is kept in its own source file, that the \f3javadoc\fR command merges into the generated overview page\&. You typically include in this comment any documentation that applies to the entire application or set of packages\&.
++.PP
++You can name the file anything you want such as overview\&.html and place it anywhere\&. A typical location is at the top of the source tree\&.
++.PP
++For example, if the source files for the \f3java\&.applet\fR package are contained in the /home/user/src/java/applet directory, then you could create an overview comment file at /home/user/src/overview\&.html\&.
++.PP
++You can have multiple overview comment files for the same set of source files in case you want to run the \f3javadoc\fR command multiple times on different sets of packages\&. For example, you could run the \f3javadoc\fR command once with \f3-private\fR for internal documentation and again without that option for public documentation\&. In this case, you could describe the documentation as public or internal in the first sentence of each overview comment file\&.
++.PP
++The content of the overview comment file is one big documentation comment that is written in HTML\&. Make the first sentence a summary about the application or set of packages\&. Do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. All tags except inline tags, such as an {\f3@link}\fR tag, must appear after the main description\&. If you add an \f3@see\fR tag, then it must have a fully qualified name\&.
++.PP
++When you run the \f3javadoc\fR command, specify the overview comment file name with the \f3-overview\fR option\&. The file is then processed similarly to that of a package comment file\&. The \f3javadoc\fR command does the following:
++.TP 0.2i
++\(bu
++Copies all content between the \f3<body>\fR and \f3</body>\fR tags for processing\&.
++.TP 0.2i
++\(bu
++Processes the overview tags that are present\&. See Overview Tags\&.
++.TP 0.2i
++\(bu
++Inserts the processed text at the bottom of the generated overview page\&. See Java Platform Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++.TP 0.2i
++\(bu
++Copies the first sentence of the overview comment to the top of the overview summary page\&.
++.SS UNPROCESSED\ FILES
++Your source files can include any files that you want the \f3javadoc\fR command to copy to the destination directory\&. These files usually include graphic files, example Java source and class files, and self-standing HTML files with a lot of content that would overwhelm the documentation comment of a typical Java source file\&.
++.PP
++To include unprocessed files, put them in a directory called doc-files\&. The doc-files directory can be a subdirectory of any package directory that contains source files\&. You can have one doc-files subdirectory for each package\&.
++.PP
++For example, if you want to include the image of a button in the \f3java\&.awt\&.Button\fR class documentation, then place the image file in the /home/user/src/java/awt/doc-files/ directory\&. Do not place the doc-files directory at /home/user/src/java/doc-files, because java is not a package\&. It does not contain any source files\&.
++.PP
++All links to the unprocessed files must be included in the code because the \f3javadoc\fR command does not look at the files\&. The \f3javadoc\fR command copies the directory and all of its contents to the destination\&. The following example shows how the link in the Button\&.java documentation comment might look:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This button looks like this: \fP
++.fi
++.nf
++\f3 * <img src="doc\-files/Button\&.gif">\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS TEST\ AND\ TEMPLATE\ FILES
++You can store test and template files in the source tree in the same directory with or in a subdirectory of the directory where the source files reside\&. To prevent test and template files from being processed, run the \f3javadoc\fR command and explicitly pass in individual source file names\&.
++.PP
++Test files are valid, compilable source files\&. Template files are not valid, compatible source files, but they often have the \f3\&.java\fR suffix\&.
++.PP
++Test Files
++
++If you want your test files to belong to either an unnamed package or to a package other than the package that the source files are in, then put the test files in a subdirectory underneath the source files and give the directory an invalid name\&. If you put the test files in the same directory with the source and call the \f3javadoc\fR command with a command-line argument that indicates its package name, then the test files cause warnings or errors\&. If the files are in a subdirectory with an invalid name, then the test file directory is skipped and no errors or warnings are issued\&. For example, to add test files for source files in com\&.package1, put them in a subdirectory in an invalid package name\&. The following directory name is invalid because it contains a hyphen:
++.sp
++.nf
++\f3com/package1/test\-files/\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If your test files contain documentation comments, then you can set up a separate run of the \f3javadoc\fR command to produce test file documentation by passing in their test source file names with wild cards, such as \f3com/package1/test-files/*\&.java\fR\&.
++.PP
++Template Files
++
++If you want a template file to be in the source directory, but not generate errors when you execute the \f3javadoc\fR command, then give it an invalid file name such as \f3Buffer-Template\&.java\fR to prevent it from being processed\&. The \f3javadoc\fR command only processes source files with names, when stripped of the \f3\&.java\fR suffix, that are valid class names\&.
++.SH GENERATED\ FILES
++By default, the \f3javadoc\fR command uses a standard doclet that generates HTML-formatted documentation\&. The standard doclet generates basic content, cross-reference, and support pages described here\&. Each HTML page corresponds to a separate file\&. The \f3javadoc\fR command generates two types of files\&. The first type is named after classes and interfaces\&. The second type contain hyphens (such as package-summary\&.html) to prevent conflicts with the first type of file\&.
++.SS BASIC\ CONTENT\ PAGES
++.TP 0.2i
++\(bu
++One class or interface page (classname\&.html) for each class or interface being documented\&.
++.TP 0.2i
++\(bu
++One package page (package-summary\&.html) for each package being documented\&. The \f3javadoc\fR command includes any HTML text provided in a file with the name package\&.html or package-info\&.java in the package directory of the source tree\&.
++.TP 0.2i
++\(bu
++One overview page (overview-summary\&.html) for the entire set of packages\&. The overview page is the front page of the generated document\&. The \f3javadoc\fR command includes any HTML text provided in a file specified by the \f3-overview\fR option\&. The Overview page is created only when you pass two or more package names into the \f3javadoc\fR command\&. See HTML Frames and Options\&.
++.SS CROSS-REFERENCE\ PAGES
++.TP 0.2i
++\(bu
++One class hierarchy page for the entire set of packages (overview-tree\&.html)\&. To view the hierarchy page, click \fIOverview\fR in the navigation bar and click \fITree\fR\&.
++.TP 0.2i
++\(bu
++One class hierarchy page for each package (package-tree\&.html) To view the hierarchy page, go to a particular package, class, or interface page, and click \fITree\fR to display the hierarchy for that package\&.
++.TP 0.2i
++\(bu
++One use page for each package (package-use\&.html) and a separate use page for each class and interface (class-use/classname\&.html)\&. The use page describes what packages, classes, methods, constructors and fields use any part of the specified class, interface, or package\&. For example, given a class or interface A, its use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A\&. To view the use page, go to the package, class, or interface and click the \fIUse\fR link in the navigation bar\&.
++.TP 0.2i
++\(bu
++A deprecated API page (deprecated-list\&.html) that lists all deprecated APIs and their suggested replacements\&. Avoid deprecated APIs because they can be removed in future implementations\&.
++.TP 0.2i
++\(bu
++A constant field values page (constant-values\&.html) for the values of static fields\&.
++.TP 0.2i
++\(bu
++A serialized form page (serialized-form\&.html) that provides information about serializable and externalizable classes with field and method descriptions\&. The information on this page is of interest to reimplementors, and not to developers who want to use the API\&. To access the serialized form page, go to any serialized class and click \fISerialized Form\fR in the See Also section of the class comment\&. The standard doclet generates a serialized form page that lists any class (public or non-public) that implements Serializable with its \f3readObject\fR and \f3writeObject\fR methods, the fields that are serialized, and the documentation comments from the \f3@serial\fR, \f3@serialField\fR, and \f3@serialData\fR tags\&. Public serializable classes can be excluded by marking them (or their package) with \f3@serial\fR exclude, and package-private serializable classes can be included by marking them (or their package) with an \f3@serial\fR include\&. As of Release 1\&.4, you can generate the complete serialized form for public and private classes by running the \f3javadoc\fR command without specifying the \f3-private\fR option\&. See Options\&.
++.TP 0.2i
++\(bu
++An index page (\f3index-*\&.html\fR) of all class, interface, constructor, field and method names, in alphabetical order\&. The index page is internationalized for Unicode and can be generated as a single file or as a separate file for each starting character (such as A\(enZ for English)\&.
++.SS SUPPORT\ PAGES
++.TP 0.2i
++\(bu
++A help page (help-doc\&.html) that describes the navigation bar and the previous pages\&. Use \f3-helpfile\fR to override the default help file with your own custom help file\&.
++.TP 0.2i
++\(bu
++One index\&.html file that creates the HTML frames for display\&. Load this file to display the front page with frames\&. The index\&.html file contains no text content\&.
++.TP 0.2i
++\(bu
++Several frame files (\f3*-frame\&.html\fR) that contains lists of packages, classes, and interfaces\&. The frame files display the HTML frames\&.
++.TP 0.2i
++\(bu
++A package list file (package-list) that is used by the \f3-link\fR and \f3-linkoffline\fR options\&. The package list file is a text file that is not reachable through links\&.
++.TP 0.2i
++\(bu
++A style sheet file (stylesheet\&.css) that controls a limited amount of color, font family, font size, font style, and positioning information on the generated pages\&.
++.TP 0.2i
++\(bu
++A doc-files directory that holds image, example, source code, or other files that you want copied to the destination directory\&. These files are not processed by the \f3javadoc\fR command\&. This directory is not processed unless it exists in the source tree\&.
++.PP
++See Options\&.
++.SS HTML\ FRAMES
++The \f3javadoc\fR command generates the minimum number of frames (two or three) necessary based on the values passed to the command\&. It omits the list of packages when you pass a single package name or source files that belong to a single package as an argument to the \f3javadoc\fR command\&. Instead, the \f3javadoc\fR command creates one frame in the left-hand column that displays the list of classes\&. When you pass two or more package names, the \f3javadoc\fR command creates a third frame that lists all packages and an overview page (overview-summary\&.html)\&. To bypass frames, click the \fINo Frames\fR link or enter the page set from the overview-summary\&.html page\&.
++.SS GENERATED\ FILE\ STRUCTURE
++The generated class and interface files are organized in the same directory hierarchy that Java source files and class files are organized\&. This structure is one directory per subpackage\&.
++.PP
++For example, the document generated for the \f3java\&.applet\&.Applet\fR class would be located at java/applet/Applet\&.html\&.
++.PP
++The file structure for the \f3java\&.applet\fR package follows, assuming that the destination directory is named \f3apidocs\fR\&. All files that contain the word \fIframe\fR appear in the upper-left or lower-left frames, as noted\&. All other HTML files appear in the right-hand frame\&.
++.PP
++Directories are bold\&. The asterisks (*) indicate the files and directories that are omitted when the arguments to the \f3javadoc\fR command are source file names rather than package names\&. When arguments are source file names, an empty package list is created\&. The doc-files directory is not created in the destination unless it exists in the source tree\&. See Generated Files\&.
++.TP 0.2i
++\(bu
++\fIapidocs\fR: Top-level directory
++.RS
++.TP 0.2i
++\(bu
++index\&.html: Initial Page that sets up HTML frames
++.TP 0.2i
++\(bu
++*overview-summary\&.html: Package list with summaries
++.TP 0.2i
++\(bu
++overview-tree\&.html: Class hierarchy for all packages
++.TP 0.2i
++\(bu
++deprecated-list\&.html: Deprecated APIs for all packages
++.TP 0.2i
++\(bu
++constant-values\&.html: Static field values for all packages
++.TP 0.2i
++\(bu
++serialized-form\&.html: Serialized forms for all packages
++.TP 0.2i
++\(bu
++*overview-frame\&.html: All packages for display in upper-left frame
++.TP 0.2i
++\(bu
++allclasses-frame\&.html: All classes for display in lower-left frame
++.TP 0.2i
++\(bu
++help-doc\&.html: Help about Javadoc page organization
++.TP 0.2i
++\(bu
++index-all\&.html: Default index created without \f3-splitindex\fR option
++.TP 0.2i
++\(bu
++\fIindex-files\fR: Directory created with \f3-splitindex\fR option
++.RS
++.TP 0.2i
++\(bu
++index-<number>\&.html: Index files created with \f3-splitindex\fR option
++.RE
++
++.TP 0.2i
++\(bu
++package-list: Package names for resolving external references
++.TP 0.2i
++\(bu
++stylesheet\&.css: Defines fonts, colors, positions, and so on
++.RE
++
++.TP 0.2i
++\(bu
++\fIjava\fR: Package directory
++.RS
++.TP 0.2i
++\(bu
++\fIapplet\fR: Subpackage directory
++.RS
++.TP 0.2i
++\(bu
++Applet\&.html: \f3Applet\fR class page
++.TP 0.2i
++\(bu
++AppletContext\&.html: \f3AppletContext\fR interface
++.TP 0.2i
++\(bu
++AppletStub\&.html: \f3AppletStub\fR interface
++.TP 0.2i
++\(bu
++AudioClip\&.html: \f3AudioClip\fR interface
++.TP 0.2i
++\(bu
++package-summary\&.html: Classes with summaries
++.TP 0.2i
++\(bu
++package-frame\&.html: Package classes for display in lower-left frame
++.TP 0.2i
++\(bu
++package-tree\&.html: Class hierarchy for this package
++.TP 0.2i
++\(bu
++package-use\&.html: Where this package is used
++.TP 0.2i
++\(bu
++\fIdoc-files\fR: Image and example files directory
++.TP 0.2i
++\(bu
++\fIclass-use\fR: Image and examples file location
++
++- Applet\&.html: Uses of the Applet class
++
++- AppletContext\&.html: Uses of the \f3AppletContext\fR interface
++
++- AppletStub\&.html: Uses of the \f3AppletStub\fR interface
++
++- AudioClip\&.html: Uses of the \f3AudioClip\fR interface
++.RE
++
++.RE
++
++.TP 0.2i
++\(bu
++\fIsrc-html\fR: Source code directory
++.RS
++.TP 0.2i
++\(bu
++\fIjava\fR: Package directory
++.RS
++.TP 0.2i
++\(bu
++\fIapplet\fR: Subpackage directory
++
++- Applet\&.html: Applet source code
++
++- AppletContext\&.html: \f3AppletContext\fR source code
++
++- AppletStub\&.html: \f3AppletStub\fR source code
++
++- AudioClip\&.html: \f3AudioClip\fR source code
++.RE
++
++.RE
++
++.SS GENERATED\ API\ DECLARATIONS
++The \f3javadoc\fR command generates a declaration at the start of each class, interface, field, constructor, and method description for that API item\&. For example, the declaration for the \f3Boolean\fR class is:
++.sp
++.nf
++\f3public final class Boolean\fP
++.fi
++.nf
++\f3extends Object\fP
++.fi
++.nf
++\f3implements Serializable\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The declaration for the \f3Boolean\&.valueOf\fR method is:
++.sp
++.nf
++\f3public static Boolean valueOf(String s)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3javadoc\fR command can include the modifiers \f3public\fR, \f3protected\fR, \f3private\fR, \f3abstract\fR, \f3final\fR, \f3static\fR, \f3transient\fR, and \f3volatile\fR, but not \f3synchronized\fR or \f3native\fR\&. The \f3synchronized\fR and \f3native\fR modifiers are considered implementation detail and not part of the API specification\&.
++.PP
++Rather than relying on the keyword \f3synchronized\fR, APIs should document their concurrency semantics in the main description of the comment\&. For example, a description might be: A single enumeration cannot be used by multiple threads concurrently\&. The document should not describe how to achieve these semantics\&. As another example, while the \f3Hashtable\fR option should be thread-safe, there is no reason to specify that it is achieved by synchronizing all of its exported methods\&. It is better to reserve the right to synchronize internally at the bucket level for higher concurrency\&.
++.SH DOCUMENTATION\ COMMENTS
++This section describes source code comments and comment inheritance\&.
++.SS SOURCE\ CODE\ COMMENTS
++You can include documentation comments in the source code, ahead of declarations for any class, interface, method, constructor, or field\&. You can also create documentation comments for each package and another one for the overview, though their syntax is slightly different\&. A documentation comment consists of the characters between \f3/**\fR and \f3*/\fR that end it\&. Leading asterisks are allowed on each line and are described further in the following section\&. The text in a comment can continue onto multiple lines\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is the typical format of a simple documentation comment\fP
++.fi
++.nf
++\f3 * that spans two lines\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To save space you can put a comment on one line:
++.sp
++.nf
++\f3/** This comment takes up only one line\&. */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Placement of Comments
++
++Documentation comments are recognized only when placed immediately before class, interface, constructor, method, or field declarations\&. Documentation comments placed in the body of a method are ignored\&. The \f3javadoc\fR command recognizes only one documentation comment per declaration statement\&. See Where Tags Can Be Used\&.
++.PP
++A common mistake is to put an \f3import\fR statement between the class comment and the class declaration\&. Do not put an \f3import\fR statement at this location because the \f3javadoc\fR command ignores the class comment\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is the class comment for the class Whatever\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3import com\&.example; // MISTAKE \- Important not to put import statement here\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class Whatever{ }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Parts of Comments
++
++A documentation comment has a main description followed by a tag section\&. The main description begins after the starting delimiter \f3/**\fR and continues until the tag section\&. The tag section starts with the first block tag, which is defined by the first \f3@\fR character that begins a line (ignoring leading asterisks, white space, and leading separator \f3/**\fR)\&. It is possible to have a comment with only a tag section and no main description\&. The main description cannot continue after the tag section begins\&. The argument to a tag can span multiple lines\&. There can be any number of tags, and some types of tags can be repeated while others cannot\&. For example, this \f3@see\fR tag starts the tag section:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This sentence holds the main description for this documentation comment\&.\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Object\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Block and inline Tags
++
++A tag is a special keyword within a documentation comment that the \f3javadoc\fR command processes\&. There are two kinds of tags: block tags, which appear as an \f3@tag\fR tag (also known as standalone tags), and inline tags, which appear within braces, as an \f3{@tag}\fR tag\&. To be interpreted, a block tag must appear at the beginning of a line, ignoring leading asterisks, white space, and the separator (\f3/**\fR)\&. This means you can use the \f3@\fR character elsewhere in the text and it will not be interpreted as the start of a tag\&. If you want to start a line with the \f3@\fR character and not have it be interpreted, then use the HTML entity \f3&#064;\fR\&. Each block tag has associated text, which includes any text following the tag up to, but not including, either the next tag, or the end of the documentation comment\&. This associated text can span multiple lines\&. An inline tag is allowed and interpreted anywhere that text is allowed\&. The following example contains the \f3@deprecated\fR block tag and the \f3{@link}\fR inline tag\&. See Javadoc Tags\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @deprecated As of JDK 1\&.1, replaced by {@link #setBounds(int,int,int,int)}\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Write Comments in HTML
++
++The text must be written in HTML with HTML entities and HTML tags\&. You can use whichever version of HTML your browser supports\&. The standard doclet generates HTML 3\&.2-compliant code elsewhere (outside of the documentation comments) with the inclusion of cascading style sheets and frames\&. HTML 4\&.0 is preferred for generated files because of the frame sets\&.
++.PP
++For example, entities for the less than symbol (<) and the greater than symbol (>) should be written as \f3&lt;\fR and \f3&gt;\fR\&. Similarly, the ampersand (&) should be written as \f3&amp;\fR\&. The bold HTML tag \f3<b>\fR is shown in the following example\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is a <b>doc</b> comment\&.\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Object\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Leading Asterisks
++
++When the \f3javadoc\fR command parses a documentation comment, leading asterisks (*) on each line are discarded, and blanks and tabs that precede the initial asterisks (*) are also discarded\&. If you omit the leading asterisk on a line, then the leading white space is no longer removed so that you can paste code examples directly into a documentation comment inside a \f3<PRE>\fR tag with its indentation preserved\&. Spaces are interpreted by browsers more uniformly than tabs\&. Indentation is relative to the left margin (rather than the separator \f3/**\fR or \f3<PRE>\fR tag)\&.
++.PP
++First Sentence
++
++The first sentence of each documentation comment should be a summary sentence that contains a concise but complete description of the declared entity\&. This sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first block tag\&. The \f3javadoc\fR command copies this first sentence to the member summary at the top of the HTML page\&.
++.PP
++Multiple-Field Declarations
++
++The Java platform lets you declare multiple fields in a single statement, but this statement can have only one documentation comment that is copied for all fields\&. If you want individual documentation comments for each field, then declare each field in a separate statement\&. For example, the following documentation comment does not make sense written as a single declaration and would be better handled as two declarations:
++.sp
++.nf
++\f3/** \fP
++.fi
++.nf
++\f3 * The horizontal and vertical distances of point (x,y)\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public int x, y; // Avoid this \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3javadoc\fR command generates the following documentation from the previous code:
++.sp
++.nf
++\f3public int x\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The horizontal and vertical distances of point (x, y)\&.
++.sp
++.nf
++\f3public int y\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The horizontal and vertical distances of point (x, y)\&.
++.PP
++Use of Header Tags
++
++When writing documentation comments for members, it is best not to use HTML heading tags such as \f3<H1>\fR and \f3<H2>\fR, because the \f3javadoc\fR command creates an entire structured document, and these structural tags might interfere with the formatting of the generated document\&. However, you can use these headings in class and package comments to provide your own structure\&.
++.SS METHOD\ COMMENT\ INHERITANCE
++The \f3javadoc\fR command allows method comment inheritance in classes and interfaces to fill in missing text or to explicitly inherit method comments\&. Constructors, fields, and nested classes do not inherit documentation comments\&.
++.PP
++\fINote:\fR The source file for an inherited method must be on the path specified by the \f3-sourcepath\fR option for the documentation comment to be available to copy\&. Neither the class nor its package needs to be passed in on the command line\&. This contrasts with Release 1\&.3\&.\fIn\fR and earlier releases, where the class had to be a documented class\&.
++.PP
++Fill in Missing Text
++
++When a main description, or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag is missing from a method comment, the \f3javadoc\fR command copies the corresponding main description or tag comment from the method it overrides or implements (if any)\&. See Method Comment Inheritance\&.
++.PP
++When an \f3@param\fR tag for a particular parameter is missing, the comment for that parameter is copied from the method further up the inheritance hierarchy\&. When an \f3@throws\fR tag for a particular exception is missing, the \f3@throws\fR tag is copied only when that exception is declared\&.
++.PP
++This behavior contrasts with Release 1\&.3 and earlier, where the presence of any main description or tag would prevent all comments from being inherited\&.
++.PP
++See Javadoc Tags and Options\&.
++.PP
++Explicit Inheritance
++
++Insert the \f3{@inheritDoc}\fR inline tag in a method main description or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag comment\&. The corresponding inherited main description or tag comment is copied into that spot\&.
++.SS CLASS\ AND\ INTERFACE\ INHERITANCE
++Comment inheritance occurs in all possible cases of inheritance from classes and interfaces:
++.TP 0.2i
++\(bu
++When a method in a class overrides a method in a superclass
++.TP 0.2i
++\(bu
++When a method in an interface overrides a method in a superinterface
++.TP 0.2i
++\(bu
++When a method in a class implements a method in an interface
++.PP
++In the first two cases, the \f3javadoc\fR command generates the subheading \fIOverrides\fR in the documentation for the overriding method\&. A link to the method being overridden is included, whether or not the comment is inherited\&.
++.PP
++In the third case, when a method in a specified class implements a method in an interface, the \f3javadoc\fR command generates the subheading \fISpecified by\fR in the documentation for the overriding method\&. A link to the method being implemented is included, whether or not the comment is inherited\&.
++.SS METHOD\ COMMENTS\ ALGORITHM
++If a method does not have a documentation comment, or has an \f3{@inheritDoc}\fR tag, then the \f3javadoc\fR command uses the following algorithm to search for an applicable comment\&. The algorithm is designed to find the most specific applicable documentation comment, and to give preference to interfaces over superclasses:
++.TP 0.4i
++1\&.
++Look in each directly implemented (or extended) interface in the order they appear following the word \f3implements\fR (or \f3extends\fR) in the method declaration\&. Use the first documentation comment found for this method\&.
++.TP 0.4i
++2\&.
++If Step 1 failed to find a documentation comment, then recursively apply this entire algorithm to each directly implemented (or extended) interface in the same order they were examined in Step 1\&.
++.TP 0.4i
++3\&.
++When Step 2 fails to find a documentation comment and this is a class other than the \f3Object\fR class, but not an interface:
++.RS
++.TP 0.4i
++1\&.
++If the superclass has a documentation comment for this method, then use it\&.
++.TP 0.4i
++2\&.
++If Step 3a failed to find a documentation comment, then recursively apply this entire algorithm to the superclass\&.
++.RE
++
++.SH JAVADOC\ TAGS
++The \f3javadoc\fR command parses special tags when they are embedded within a Java documentation comment\&. The \f3javadoc\fR tags let you autogenerate a complete, well-formatted API from your source code\&. The tags start with an at sign (\f3@\fR) and are case-sensitive\&. They must be typed with the uppercase and lowercase letters as shown\&. A tag must start at the beginning of a line (after any leading spaces and an optional asterisk), or it is treated as text\&. By convention, tags with the same name are grouped together\&. For example, put all \f3@see\fR tags together\&. For more information, see Where Tags Can Be Used\&.
++.PP
++Tags have the following types:
++.TP 0.2i
++\(bu
++Bock tags: Place block tags only in the tag section that follows the description\&. Block tags have the form: \fI@tag\fR\&.
++.TP 0.2i
++\(bu
++Inline tags: Place inline tags anywhere in the main description or in the comments for block tags\&. Inline tags are enclosed within braces: \fI{@tag}\fR\&.
++.PP
++For custom tags, see -tag tagname:Xaoptcmf:"taghead"\&. See also Where Tags Can Be Used\&.
++.SS TAG\ DESCRIPTIONS
++.TP
++@author \fIname-text\fR
++Introduced in JDK 1\&.0
++
++Adds an Author entry with the specified name text to the generated documents when the \f3-author\fR option is used\&. A documentation comment can contain multiple \f3@author\fR tags\&. You can specify one name per \f3@author\fR tag or multiple names per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and space between names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line if you want a localized name separator other than a comma\&. See @author in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@author
++.TP
++{@code \fItext\fR}
++Introduced in JDK 1\&.5
++
++Equivalent to \f3<code>{@literal}</code>\fR\&.
++
++Displays text in code font without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use regular angle brackets (< and >) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (\f3<-\fR)\&. For example, the documentation comment text \f3{@code A<B>C}\fR displayed in the generated HTML page unchanged as \f3A<B>C\fR\&. This means that the \f3<B>\fR is not interpreted as bold and is in code font\&. If you want the same functionality without the code font, then use the \f3{@literal}\fR tag\&.
++.TP
++@deprecated \fIdeprecated-text\fR
++Introduced in JDK 1\&.0
++
++Adds a comment indicating that this API should no longer be used (even though it may continue to work)\&. The \f3javadoc\fR command moves \f3deprecated-text\fRahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field\&.
++
++The first sentence of deprecated text should tell the user when the API was deprecated and what to use as a replacement\&. The \f3javadoc\fR command copies the first sentence to the summary section and index\&. Subsequent sentences can also explain why it was deprecated\&. You should include an \f3{@link}\fR tag (for Javadoc 1\&.2 or later) that points to the replacement API\&.
++
++Use the \fI@deprecated annotation\fR tag to deprecate a program element\&. See How and When to Deprecate APIs at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html
++
++See also @deprecated in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@deprecated
++.TP
++{@docRoot}
++Introduced in JDK 1\&.3
++
++Represents the relative path to the generated document\&'s (destination) root directory from any generated page\&. This tag is useful when you want to include a file, such as a copyright page or company logo, that you want to reference from all generated pages\&. Linking to the copyright page from the bottom of each page is common\&.
++
++This \f3{@docRoot}\fR tag can be used both on the command line and in a documentation comment\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, and includes the text portion of any tag (such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags)\&.
++.RS
++.TP 0.2i
++\(bu
++On the command line, where the header, footer, or bottom are defined: \f3javadoc -bottom \&'<a href="{@docRoot}/copyright\&.html">Copyright</a>\&'\fR\&.
++
++When you use the \f3{@docRoot}\fR tag this way in a make file, some \f3makefile\fR programs require a special way to escape for the brace \f3{}\fR characters\&. For example, the Inprise MAKE version 5\&.2 running on Windows requires double braces: \f3{{@docRoot}}\fR\&. It also requires double (rather than single) quotation marks to enclose arguments to options such as the \f3-bottom\fR option (with the quotation marks around the \f3href\fR argument omitted)\&.
++.TP 0.2i
++\(bu
++In a documentation comment:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * See the <a href="{@docRoot}/copyright\&.html">Copyright</a>\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This tag is needed because the generated documents are in hierarchical directories, as deep as the number of subpackages\&. The expression: \f3<a href="{@docRoot}/copyright\&.html">\fR resolves to \f3<a href="\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/Object\&.java\fR and \f3<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/ref/Reference\&.java\fR\&.
++.RE
++
++.TP
++@exception \fIclass-name description\fR
++Introduced in JDK 1\&.0
++
++Identical to the \f3@throws\fR tag\&. See @throws class-name description\&.
++.TP
++{@inheritDoc}
++Introduced in JDK 1\&.4
++
++Inherits (copies) documentation from the nearest inheritable class or implementable interface into the current documentation comment at this tag\&'s location\&. This enables you to write more general comments higher up the inheritance tree and to write around the copied text\&.
++
++This tag is valid only in these places in a documentation comment:
++.RS
++.TP 0.2i
++\(bu
++In the main description block of a method\&. In this case, the main description is copied from a class or interface up the hierarchy\&.
++.TP 0.2i
++\(bu
++In the text arguments of the \f3@return\fR, \f3@param,\fR and \f3@throws\fR tags of a method\&. In this case, the tag text is copied from the corresponding tag up the hierarchy\&.
++.RE
++
++
++See Method Comment Inheritance for a description of how comments are found in the inheritance hierarchy\&. Note that if this tag is missing, then the comment is or is not automatically inherited according to rules described in that section\&.
++.TP
++{@link \fIpackage\&.class#member label\fR}
++Introduced in JDK 1\&.2
++
++Inserts an inline link with a visible text label that points to the documentation for the specified package, class, or member name of a referenced class\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, including the text portion of any tag, such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags\&. See @link in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#{@link
++
++This tag is similar to the \f3@see\fR tag\&. Both tags require the same references and accept the same syntax for \f3package\&.class#member\fR and \f3label\fR\&. The main difference is that the \f3{@link}\fR tag generates an inline link rather than placing the link in the See Also section\&. The \f3{@link}\fR tag begins and ends with braces to separate it from the rest of the inline text\&. If you need to use the right brace (\f3}\fR) inside the label, then use the HTML entity notation \f3&#125;\fR\&.
++
++There is no limit to the number of \f3{@link}\fR tags allowed in a sentence\&. You can use this tag in the main description part of any documentation comment or in the text portion of any tag, such as the \f3@deprecated\fR, \f3@return\fR or \f3@param\fR tags\&.
++
++For example, here is a comment that refers to the \f3getComponentAt(int, int)\fR method:
++.sp
++.nf
++\f3Use the {@link #getComponentAt(int, int) getComponentAt} method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++From this code, the standard doclet generates the following HTML (assuming it refers to another class in the same package):
++.sp
++.nf
++\f3Use the <a href="Component\&.html#getComponentAt(int, int)">getComponentAt</a> method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The previous line appears on the web page as:
++.sp
++.nf
++\f3Use the getComponentAt method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++{@linkplain \fIpackage\&.class#member label\fR}
++Introduced in JDK 1\&.4
++
++Behaves the same as the \f3{@link}\fR tag, except the link label is displayed in plain text rather than code font\&. Useful when the label is plain text\&. For example, \f3Refer to {@linkplain add() the overridden method}\fR\&. displays as: Refer to the overridden method\&.
++.TP
++{@literal \fItext\fR}
++Introduced in JDK 1\&.5
++
++Displays text without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use angle brackets (\f3< and >\fR) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (<-)\&. For example, the documentation comment text \f3{@literal A<B>C}\fR displays unchanged in the generated HTML page in your browser, as \f3A<B>C\fR\&. The \f3<B>\fR is not interpreted as bold (and it is not in code font)\&. If you want the same functionality with the text in code font, then use the \f3{@code}\fR tag\&.
++.TP
++@param \fIparameter-name description\fR
++Introduced in JDK 1\&.0
++
++Adds a parameter with the specified \f3parameter-name\fR followed by the specified description to the Parameters section\&. When writing the documentation comment, you can continue the description onto multiple lines\&. This tag is valid only in a documentation comment for a method, constructor, or class\&. See @param in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@param
++
++The \f3parameter-name\fR can be the name of a parameter in a method or constructor, or the name of a type parameter of a class, method, or constructor\&. Use angle brackets around this parameter name to specify the use of a type parameter\&.
++
++Example of a type parameter of a class:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @param <E> Type of element stored in a list\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public interface List<E> extends Collection<E> {\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Example of a type parameter of a method:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @param string the string to be converted\fP
++.fi
++.nf
++\f3 * @param type the type to convert the string to\fP
++.fi
++.nf
++\f3 * @param <T> the type of the element\fP
++.fi
++.nf
++\f3 * @param <V> the value of the element\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3<T, V extends T> V convert(String string, Class<T> type) {\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++@return \fIdescription\fR
++Introduced in JDK 1\&.0
++
++Adds a Returns section with the description text\&. This text should describe the return type and permissible range of values\&. This tag is valid only in a documentation comment for a method\&. See @return in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@return
++.TP
++@see \fIreference\fR
++Introduced in JDK 1\&.0
++
++Adds a \fISee Also\fR heading with a link or text entry that points to a reference\&. A documentation comment can contain any number of \f3@see\fR tags, which are all grouped under the same heading\&. The \f3@see\fR tag has three variations\&. The form is the most common\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. For inserting an inline link within a sentence to a package, class, or member, see \f3{@link}\fR\&.
++
++\fIForm 1\fR\&. The @see \f3string\fR tag form adds a text entry for \fIstring\fR\&. No link is generated\&. The string is a book or other reference to information not available by URL\&. The \f3javadoc\fR command distinguishes this from the previous cases by searching for a double quotation mark (") as the first character\&. For example, \f3@see "The Java Programming Language"\fR that generates the following text:
++
++\fISee Also\fR:
++
++"The Java Programming Language"
++
++\fIForm 2\fR\&. The \f3@see <a href="URL#value">label</a>\fR form adds a link as defined by \f3URL#value\fR\&. The \f3URL#value\fR parameter is a relative or absolute URL\&. The \f3javadoc\fR command distinguishes this from other cases by searching for a less-than symbol (\f3<\fR) as the first character\&. For example, \f3@see <a href="spec\&.html#section">Java Spec</a>\fR generates the following link:
++
++\fISee Also\fR:
++
++Java Spec
++
++\fIForm 3\fR\&. The \f3@see package\&.class#member label\fR form adds a link with a visible text label that points to the documentation for the specified name in the Java Language that is referenced\&. The label is optional\&. If the label is omitted, then the name appears instead as visible text, suitably shortened\&. Use the \f3-noqualifier\fR option to globally remove the package name from this visible text\&. Use the label when you want the visible text to be different from the autogenerated visible text\&. See How a Name Appears\&.
++
++In Java SE 1\&.2 only, the name but not the label automatically appears in \f3<code>\fR HTML tags\&. Starting with Java SE 1\&.2\&.2, the \f3<code>\fR tag is always included around the visible text, whether or not a label is used\&.
++.RS
++.TP 0.2i
++\(bu
++\f3package\&.class#member\fR is any valid program element name that is referenced, such as a package, class, interface, constructor, method or field name, except that the character ahead of the member name should be a number sign (\f3#\fR)\&. The class represents any top-level or nested class or interface\&. The member represents any constructor, method, or field (not a nested class or interface)\&. If this name is in the documented classes, then the \f3javadoc\fR command create a link to it\&. To create links to external referenced classes, use the \f3-link\fR option\&. Use either of the other two \f3@see\fR tag forms to refer to the documentation of a name that does not belong to a referenced class\&. See Specify a Name\&.
++
++\fINote:\fR External referenced classes are classes that are not passed into the \f3javadoc\fR command on the command line\&. Links in the generated documentation to external referenced classes are called external references or external links\&. For example, if you run the \f3javadoc\fR command on only the \f3java\&.awt package\fR, then any class in \f3java\&.lang\fR, such as \f3Object\fR, is an external referenced class\&. Use the \f3-link\fR and \f3-linkoffline\fR options to link to external referenced classes\&. The source comments of external referenced classes are not available to the \f3javadoc\fR command run\&.
++.TP 0.2i
++\(bu
++\f3label\fR is optional text that is visible as the link label\&. The label can contain white space\&. If \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears, suitably shortened relative to the current class and package\&. See How a Name Appears\&.
++.TP 0.2i
++\(bu
++A space is the delimiter between \f3package\&.class#member\fR and \f3label\fR\&. A space inside parentheses does not indicate the start of a label, so spaces can be used between parameters in a method\&.
++.RE
++
++
++\fI\fRIn the following example, an \f3@see\fR tag (in the \f3Character\fR class) refers to the equals method in the \f3String\fR class\&. The tag includes both arguments: the name \f3String#equals(Object)\fR and the label \f3equals\fR\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @see String#equals(Object) equals\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The standard doclet produces HTML that is similar to:
++.sp
++.nf
++\f3<dl>\fP
++.fi
++.nf
++\f3<dt><b>See Also:</b>\fP
++.fi
++.nf
++\f3<dd><a href="\&.\&./\&.\&./java/lang/String#equals(java\&.lang\&.Object)"><code>equals<code></a>\fP
++.fi
++.nf
++\f3</dl>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The previous code looks similar to the following in a browser, where the label is the visible link text:
++
++\fISee Also\fR:
++
++equals
++.PP
++Specify a Name
++
++\fI\fRThis \f3package\&.class#member\fR name can be either fully qualified, such as \f3java\&.lang\&.String#toUpperCase()\fR or not, such as \f3String#toUpperCase()\fR or \f3#toUpperCase()\fR\&. If the name is less than fully qualified, then the \f3javadoc\fR command uses the standard Java compiler search order to find it\&. See Search Order for the @see Tag\&. The name can contain white space within parentheses, such as between method arguments\&.The advantage to providing shorter, partially qualified names is that they are shorter to type and there is less clutter in the source code\&. The following listing shows the different forms of the name, where \f3Class\fR can be a class or interface; Type can be a class, interface, array, or primitive; and method can be a method or constructor\&.
++.sp
++.nf
++\f3\fITypical forms for\fR\fI @see package\&.class#member\fR\fP
++.fi
++.nf
++\f3\fIReferencing a member of the current class\fR\fP
++.fi
++.nf
++\f3@see #field\fP
++.fi
++.nf
++\f3@see #method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #constructor(Type argname, Type argname,\&.\&.\&.) \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\fIReferencing another class in the current or imported packages\fR\fP
++.fi
++.nf
++\f3@see Class#field\fP
++.fi
++.nf
++\f3@see Class#method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class\&.NestedClass\fP
++.fi
++.nf
++\f3@see Class \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\fIReferencing an element in another package (fully qualified)\fR\fP
++.fi
++.nf
++\f3@see package\&.Class#field\fP
++.fi
++.nf
++\f3@see package\&.Class#method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class\&.NestedClass\fP
++.fi
++.nf
++\f3@see package\&.Class\fP
++.fi
++.nf
++\f3@see package\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3\fRNotes about the previous listing:
++.TP 0.2i
++\(bu
++The first set of forms with no class or package causes the \f3javadoc\fR command to search only through the current class hierarchy\&. It finds a member of the current class or interface, one of its superclasses or superinterfaces, or one of its enclosing classes or interfaces (search Items 1\(en3)\&. It does not search the rest of the current package or other packages (search Items 4\(en5)\&. See Search Order for the @see Tag\&.
++.TP 0.2i
++\(bu
++If any method or constructor is entered as a name with no parentheses, such as \f3getValue\fR, and if there is no field with the same name, then the \f3javadoc\fR command still creates a link to the method\&. If this method is overloaded, then the \f3javadoc\fR command links to the first method its search encounters, which is unspecified\&.
++.TP 0.2i
++\(bu
++Nested classes must be specified as \f3outer\&.inner\fR, not simply \f3inner\fR, for all forms\&.
++.TP 0.2i
++\(bu
++As stated, the number sign (\f3#\fR), rather than a dot (\f3\&.\fR) separates a member from its class\&. This enables the \f3javadoc\fR command to resolve ambiguities, because the dot also separates classes, nested classes, packages, and subpackages\&. However, the \f3javadoc\fR command properly parses a dot when there is no ambiguity, but prints a warning to alert you\&.
++.PP
++Search Order for the @see Tag
++
++\fI\fRThe \f3javadoc\fR command processes an \f3@see\fR tag that appears in a source file, package file, or overview file\&. In the latter two files, you must fully qualify the name you supply with the \f3@see\fR tag\&. In a source file, you can specify a name that is fully qualified or partially qualified\&.
++.PP
++The following is the search order for the \f3@see\fR tag\&.
++.TP 0.4i
++1\&.
++The current class or interface\&.
++.TP 0.4i
++2\&.
++Any enclosing classes and interfaces searching the closest first\&.
++.TP 0.4i
++3\&.
++Any superclasses and superinterfaces, searching the closest first\&.
++.TP 0.4i
++4\&.
++The current package\&.
++.TP 0.4i
++5\&.
++Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statement\&.
++.PP
++The \f3javadoc\fR command continues to search recursively through Items 1-3 for each class it encounters until it finds a match\&. That is, after it searches through the current class and its enclosing class E, it searches through the superclasses of E before the enclosing classes of E\&. In Items 4 and 5, the \f3javadoc\fR command does not search classes or interfaces within a package in any specified order (that order depends on the particular compiler)\&. In Item 5, the \f3javadoc\fR command searches in \fIjava\&.lang\fR because that is imported by all programs\&.
++.PP
++When the \f3javadoc\fR command encounters an \f3@see\fR tag in a source file that is not fully qualified, it searches for the specified name in the same order as the Java compiler would, except the \f3javadoc\fR command does not detect certain name space ambiguities because it assumes the source code is free of these errors\&. This search order is formally defined in the Java Language Specification\&. The \f3javadoc\fR command searches for that name through all related and imported classes and packages\&. In particular, it searches in this order:
++.TP 0.4i
++1\&.
++The current class or interface\&.
++.TP 0.4i
++2\&.
++Any enclosing classes and interfaces, searching the closest first\&.
++.TP 0.4i
++3\&.
++Any superclasses and superinterfaces, searching the closest first\&.
++.TP 0.4i
++4\&.
++The current package\&.
++.TP 0.4i
++5\&.
++Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statements\&.
++.PP
++The \f3javadoc\fR command does not necessarily look in subclasses, nor will it look in other packages even when their documentation is being generated in the same run\&. For example, if the \f3@see\fR tag is in the \f3java\&.awt\&.event\&.KeyEvent\fR class and refers to a name in the \f3java\&.awt package\fR, then the \f3javadoc\fR command does not look in that package unless that class imports it\&.
++.PP
++How a Name Appears
++
++\fI\fRIf \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears\&. In general, it is suitably shortened relative to the current class and package\&. Shortened means the \f3javadoc\fR command displays only the minimum name necessary\&. For example, if the \f3String\&.toUpperCase()\fR method contains references to a member of the same class and to a member of a different class, then the class name is displayed only in the latter case, as shown in the following listing\&. Use the \f3-noqualifier\fR option to globally remove the package names\&.
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of the same class, same package
++.br
++\fIExample in\fR: \f3@see String#toLowerCase()\fR
++.br
++\fIAppears as\fR: \f3toLowerCase()\fR - omits the package and class names
++.br
++
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, same package
++.br
++\fIExample in\fR: \f3@see Character#toLowerCase(char)\fR
++.br
++\fIAppears as\fR: \f3Character\&.toLowerCase(char)\fR - omits the package name, includes the class name
++.br
++
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, different package
++.br
++\fIExample in\fR: \f3@see java\&.io\&.File#exists()\fR
++.br
++\fIAppears as\fR: \f3java\&.io\&.File\&.exists()\fR - includes the package and class names
++.br
++
++.PP
++Examples of the @see Tag
++
++The comment to the right shows how the name appears when the \f3@see\fR tag is in a class in another package, such as \f3java\&.applet\&.Applet\fR\&. See @see in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@see
++.sp
++.nf
++\f3 See also:\fP
++.fi
++.nf
++\f3@see java\&.lang\&.String // String \fP
++.fi
++.nf
++\f3@see java\&.lang\&.String The String class // The String class \fP
++.fi
++.nf
++\f3@see String // String \fP
++.fi
++.nf
++\f3@see String#equals(Object) // String\&.equals(Object) \fP
++.fi
++.nf
++\f3@see String#equals // String\&.equals(java\&.lang\&.Object) \fP
++.fi
++.nf
++\f3@see java\&.lang\&.Object#wait(long) // java\&.lang\&.Object\&.wait(long) \fP
++.fi
++.nf
++\f3@see Character#MAX_RADIX // Character\&.MAX_RADIX \fP
++.fi
++.nf
++\f3@see <a href="spec\&.html">Java Spec</a> // Java Spec \fP
++.fi
++.nf
++\f3@see "The Java Programming Language" // "The Java Programming Language" \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fINote:\fR You can extend the \f3@se\fR\f3e\fR tag to link to classes not being documented with the \f3-link\fR option\&.
++.TP
++@serial \fIfield-description\fR | include | exclude
++Introduced in JDK 1\&.2
++
++Used in the documentation comment for a default serializable field\&. See Documenting Serializable Fields and Data for a Class at http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial-arch\&.html#5251
++
++See also Oracle\(cqs Criteria for Including Classes in the Serialized Form Specification at http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized-criteria-137781\&.html
++
++An optional \f3field-description\fR should explain the meaning of the field and list the acceptable values\&. When needed, the description can span multiple lines\&. The standard doclet adds this information to the serialized form page\&. See Cross-Reference Pages\&.
++
++If a serializable field was added to a class after the class was made serializable, then a statement should be added to its main description to identify at which version it was added\&.
++
++The \f3include\fR and \f3exclude\fR arguments identify whether a class or package should be included or excluded from the serialized form page\&. They work as follows:
++.RS
++.TP 0.2i
++\(bu
++A public or protected class that implements \f3Serializable\fR is included unless that class (or its package) is marked with the \f3@serial exclude\fR tag\&.
++.TP 0.2i
++\(bu
++A private or package-private class that implements \f3Serializable\fR is excluded unless that class (or its package) is marked with the \f3@serial include\fR tag\&.
++.RE
++
++
++For example, the \f3javax\&.swing\fR package is marked with the \f3@serial\fR\f3exclude\fR tag in package\&.html or package-info\&.java\&. The public class \f3java\&.security\&.BasicPermission\fR is marked with the \f3@serial exclude\fR tag\&. The package-private class \f3java\&.util\&.PropertyPermissionCollection\fR is marked with the \f3@serial include\fR tag\&.
++
++The \f3@serial\fR tag at the class level overrides the \f3@serial\fR tag at the package level\&.
++.TP
++@serialData \fIdata-description\fR
++Introduced in JDK 1\&.2
++
++Uses the data description value to document the types and order of data in the serialized form\&. This data includes the optional data written by the \f3writeObject\fR method and all data (including base classes) written by the \f3Externalizable\&.writeExternal\fR method\&.
++
++The \f3@serialData\fR tag can be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
++.TP
++@serialField \fIfield-name\fR\fIfield-type\fR\fIfield-description\fR
++Introduced in JDK 1\&.2
++
++Documents an \f3ObjectStreamField\fR component of the \f3serialPersistentFields\fR member of a \f3Serializable\fR class\&. Use one \f3@serialField\fR tag for each \f3ObjectStreamField\fR component\&.
++.TP
++@since \fIsince-text\fR
++Introduced in JDK 1\&.1
++
++Adds a \fISince\fR heading with the specified \f3since-text\fR value to the generated documentation\&. The text has no special internal structure\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. This tag means that this change or feature has existed since the software release specified by the \f3since-text\fR value, for example: \f3@since 1\&.5\fR\&.
++
++For Java platform source code, the \f3@since\fR tag indicates the version of the Java platform API specification, which is not necessarily when the source code was added to the reference implementation\&. Multiple \f3@since\fR tags are allowed and are treated like multiple \f3@author\fR tags\&. You could use multiple tags when the program element is used by more than one API\&.
++.TP
++@throws \fIclass-name\fR\fIdescription\fR
++Introduced in JDK 1\&.2
++
++Behaves the same as the \f3@exception\fR tag\&. See @throws in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@exception
++
++The \f3@throws\fR tag adds a \fIThrows\fR subheading to the generated documentation, with the \f3class-name\fR and \f3description\fR text\&. The \fIclass-name\fR is the name of the exception that might be thrown by the method\&. This tag is valid only in the documentation comment for a method or constructor\&. If this class is not fully specified, then the \f3javadoc\fR command uses the search order to look up this class\&. Multiple \f3@throws\fR tags can be used in a specified documentation comment for the same or different exceptions\&. See Search Order for the @see Tag\&.
++
++To ensure that all checked exceptions are documented, when an \f3@throws\fR tag does not exist for an exception in the throws clause, the \f3javadoc\fR command adds that exception to the HTML output (with no description) as though it were documented with the \f3@throws\fR tag\&.
++
++The \f3@throws\fR documentation is copied from an overridden method to a subclass only when the exception is explicitly declared in the overridden method\&. The same is true for copying from an interface method to an implementing method\&. You can use the \f3{@inheritDoc}\fR tag to force the \f3@throws\fR tag to inherit documentation\&.
++.TP
++{@value \fIpackage\&.class#field\fR}
++Introduced in JDK 1\&.4
++
++Displays constant values\&. When the \f3{@value}\fR tag is used without an argument in the documentation comment of a static field, it displays the value of that constant:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * The value of this constant is {@value}\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public static final String SCRIPT_START = "<script>"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When used with the argument \f3package\&.class#field\fR in any documentation comment, he \f3{@value}\fR tag displays the value of the specified constant:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Evaluates the script starting with {@value #SCRIPT_START}\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public String evalScript(String script) {}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The argument \f3package\&.class#field\fR takes a form similar to that of the \f3@see\fR tag argument, except that the member must be a static field\&.
++
++The values of these constants are also displayed in Constant Field Values at http://docs\&.oracle\&.com/javase/8/docs/api/constant-values\&.html
++.TP
++@version \fIversion-text\fR
++Introduced in JDK 1\&.0
++
++Adds a \fIVersion\fR subheading with the specified \f3version-text\fR value to the generated documents when the \f3-version\fR option is used\&. This tag is intended to hold the current release number of the software that this code is part of, as opposed to the\f3@since\fR tag, which holds the release number where this code was introduced\&. The \f3version-text\fR value has no special internal structure\&. See @version in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@version
++
++A documentation comment can contain multiple \f3@version\fR tags\&. When it makes sense, you can specify one release number per \f3@version\fR tag or multiple release numbers per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and a space between the names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line when you want a localized name separator other than a comma\&.
++.SH WHERE\ TAGS\ CAN\ BE\ USED
++The following sections describe where tags can be used\&. Note that the following tags can be used in all documentation comments: \f3@see\fR, \f3@since\fR, \f3@deprecated\fR, \f3{@link}\fR, \f3{@linkplain}\fR, and \f3{@docroot}\fR\&.
++.SS OVERVIEW\ TAGS
++Overview tags are tags that can appear in the documentation comment for the overview page (which resides in the source file typically named overview\&.html)\&. Similar to any other documentation comments, these tags must appear after the main description
++.PP
++\fINote:\fR The \f3{@link}\fR tag has a bug in overview documents in Java SE 1\&.2\&. The text appears correctly but has no link\&. The \f3{@docRoot}\fR tag does not currently work in overview documents\&.
++.PP
++The overview tags are the following:
++.PP
++@see reference || @since since-text || @serialField field-name field-type field-description || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.SS PACKAGE\ TAGS
++Package tags are tags that can appear in the documentation comment for a package, that resides in the source file named package\&.html or package-info\&.java\&. The \f3@serial\fR tag can only be used here with the \f3include\fR or \f3exclude\fR argument\&.
++.PP
++The package tags are the following:
++.PP
++@see reference || @since since-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@linkplain package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.SS CLASS\ AND\ INTERFACE\ TAGS
++The following are tags that can appear in the documentation comment for a class or interface\&. The \f3@serial\fR tag can only be used within the documentation for a class or interface with an \f3include\fR or \f3exclude\fR argument\&.
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.PP
++Class comment example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * A class representing a window on the screen\&.\fP
++.fi
++.nf
++\f3 * For example:\fP
++.fi
++.nf
++\f3 * <pre>\fP
++.fi
++.nf
++\f3 * Window win = new Window(parent);\fP
++.fi
++.nf
++\f3 * win\&.show();\fP
++.fi
++.nf
++\f3 * </pre>\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @author Sami Shaio\fP
++.fi
++.nf
++\f3 * @version 1\&.13, 06/08/06\fP
++.fi
++.nf
++\f3 * @see java\&.awt\&.BaseWindow\fP
++.fi
++.nf
++\f3 * @see java\&.awt\&.Button\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3class Window extends BaseWindow {\fP
++.fi
++.nf
++\f3 \&.\&.\&.\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS FIELD\ TAGS
++These tags can appear in fields:
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @serialField field-name field-type field-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || {@value package\&.class#field}
++.PP
++Field comment example:
++.sp
++.nf
++\f3 /**\fP
++.fi
++.nf
++\f3 * The X\-coordinate of the component\&.\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @see #getLocation()\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3 int x = 1263732;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS CONSTRUCTOR\ AND\ METHOD\ TAGS
++The following tags can appear in the documentation comment for a constructor or a method, except for the \f3@return\fR tag, which cannot appear in a constructor, and the \f3{@inheritDoc}\fR tag, which has restrictions\&.
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @param parameter-name description || @return description || @throws class-name description || @exception class-name description || @serialData data-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@inheritDoc} || {@docRoot}
++.PP
++\fINote:\fR The \f3@serialData\fR tag can only be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
++.PP
++Method comment example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Returns the character at the specified index\&. An index \fP
++.fi
++.nf
++\f3 * ranges from <code>0</code> to <code>length() \- 1</code>\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @param index the index of the desired character\&.\fP
++.fi
++.nf
++\f3 * @return the desired character\&.\fP
++.fi
++.nf
++\f3 * @exception StringIndexOutOfRangeException \fP
++.fi
++.nf
++\f3 * if the index is not in the range <code>0</code> \fP
++.fi
++.nf
++\f3 * to <code>length()\-1</code>\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Character#charValue()\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3 public char charAt(int index) {\fP
++.fi
++.nf
++\f3 \&.\&.\&.\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++The \f3javadoc\fR command uses doclets to determine its output\&. The \f3javadoc\fR command uses the default standard doclet unless a custom doclet is specified with the \f3-doclet\fR option\&. The \f3javadoc\fR command provides a set of command-line options that can be used with any doclet\&. These options are described in Javadoc Options\&. The standard doclet provides an additional set of command-line options that are described in Standard Doclet Options\&. All option names are not case-sensitive, but their arguments are case-sensitive\&.
++.TP 0.2i
++\(bu
++See also Javadoc Options
++.TP 0.2i
++\(bu
++See also Standard Doclet Options
++.PP
++The options are:
++.PP
++-1\&.1 || -author || -bootclasspath classpathlist || -bottom text || -breakiterator || -charset name || -classpath classpathlist || -d directory || -docencoding name || -docfilesubdirs || -doclet class || -docletpath classpathlist || -doctitle title || -encoding || -exclude packagename1:packagename2:\&.\&.\&. || -excludedocfilessubdir name1:name2 || -extdirs dirist || -footer footer || -group groupheading packagepattern:packagepattern || -header header || -help || -helpfile path\efilename || -Jflag || -javafx ||-keywords || -link extdocURL || -linkoffline extdocURL packagelistLoc || -linksource || -locale language_country_variant || -nocomment || -nodeprecated || -nodeprecatedlist || -nohelp || -noindex || -nonavbar || -noqualifier all | packagename1:packagename2\&.\&.\&. || -nosince || -notimestamp || -notree || -overview path/filename || -package || -private || -protected || -public || -quiet || -serialwarn || -source release || -sourcepath sourcepathlist || -sourcetab tablength || -splitindex || -stylesheet path/filename || -subpackages package1:package2:\&.\&.\&. || -tag tagname:Xaoptcmf:"taghead" || -taglet class || -tagletpath tagletpathlist || -title title || -top || -use || -verbose || -version || -windowtitle title
++.PP
++The following options are the core Javadoc options that are available to all doclets\&. The standard doclet provides the rest of the doclets: \f3-bootclasspath\fR, \f3-breakiterator\fR, \f3-classpath\fR, \f3-doclet\fR, \f3-docletpath\fR, \f3-encoding\fR, -\f3exclude\fR, \f3-extdirs\fR, \f3-help\fR, \f3-locale\fR, \f3-\fR\f3overview\fR, \f3-package\fR, \f3-private\fR, \f3-protected\fR, \f3-public\fR, \f3-quiet\fR, \f3-source\fR, \f3-sourcepath\fR, \f3-subpackages\fR, and \f3-verbose\fR\&.
++.SS JAVADOC\ OPTIONS
++.TP
++-overview \fIpath/filename\fR
++.br
++Specifies that the \f3javadoc\fR command should retrieve the text for the overview documentation from the source file specified by the \fIpath/filename\fRand place it on the Overview page (overview-summary\&.html)\&. The \fIpath/filename\fRis relative to the current directory\&.
++
++While you can use any name you want for the \f3filename\fR value and place it anywhere you want for the path, it is typical to name it overview\&.html and place it in the source tree at the directory that contains the topmost package directories\&. In this location, no path is needed when documenting packages, because the \f3-sourcepath\fR option points to this file\&.
++
++For example, if the source tree for the \f3java\&.lang\fR package is /src/classes/java/lang/, then you could place the overview file at /src/classes/overview\&.html
++
++See Real-World Examples\&.
++
++For information about the file specified by \fIpath/filename,\fRsee Overview Comment Files\&.
++
++The overview page is created only when you pass two or more package names to the \f3javadoc\fR command\&. For a further explanation, see HTML Frames\&. The title on the overview page is set by \f3-doctitle\fR\&.
++.TP
++-Xdoclint:(all|none|[-]\fI<group>\fR)
++.br
++Reports warnings for bad references, lack of accessibility and missing Javadoc comments, and reports errors for invalid Javadoc syntax and missing HTML tags\&.
++
++This option enables the \f3javadoc\fR command to check for all documentation comments included in the generated output\&. As always, you can select which items to include in the generated output with the standard options \f3-public\fR, \f3-protected\fR, \f3-package\fR and \f3-private\fR\&.
++
++When the \f3-Xdoclint\fR is enabled, it reports issues with messages similar to the \f3javac\fR command\&. The \f3javadoc\fR command prints a message, a copy of the source line, and a caret pointing at the exact position where the error was detected\&. Messages may be either warnings or errors, depending on their severity and the likelihood to cause an error if the generated documentation were run through a validator\&. For example, bad references or missing Javadoc comments do not cause the \f3javadoc\fR command to generate invalid HTML, so these issues are reported as warnings\&. Syntax errors or missing HTML end tags cause the \f3javadoc\fR command to generate invalid output, so these issues are reported as errors\&.
++
++By default, the \f3-Xdoclint\fR option is enabled\&. Disable it with the option \f3-Xdoclint:none\fR\&.
++
++Change what the \f3-Xdoclint\fR option reports with the following options:
++.RS
++.TP 0.2i
++\(bu
++\f3-Xdoclint none\fR : disable the \f3-Xdoclint\fR option
++.TP 0.2i
++\(bu
++\f3-Xdoclint\fR\fIgroup\fR : enable \fIgroup\fR checks
++.TP 0.2i
++\(bu
++\f3-Xdoclint all\fR : enable all groups of checks
++.TP 0.2i
++\(bu
++\f3-Xdoclint all,\fR\fI-group\fR : enable all except \fIgroup\fR checks
++.RE
++
++
++The variable \fIgroup\fR has one of the following values:
++.RS
++.TP 0.2i
++\(bu
++\f3accessibility\fR : Checks for the issues to be detected by an accessibility checker (for example, no caption or summary attributes specified in a \f3<table>\fR tag)\&.
++.TP 0.2i
++\(bu
++\f3html\fR : Detects high-level HTML issues, like putting block elements inside inline elements, or not closing elements that require an end tag\&. The rules are derived from theHTML 4\&.01 Specification\&. This type of check enables the \f3javadoc\fR command to detect HTML issues that many browsers might accept\&.
++.TP 0.2i
++\(bu
++\f3missing\fR : Checks for missing Javadoc comments or tags (for example, a missing comment or class, or a missing \f3@return\fR tag or similar tag on a method)\&.
++.TP 0.2i
++\(bu
++\f3reference\fR : Checks for issues relating to the references to Java API elements from Javadoc tags (for example, item not found in \f3@see\fR , or a bad name after \f3@param)\fR\&.
++.TP 0.2i
++\(bu
++\f3syntax\fR : Checks for low level issues like unescaped angle brackets (\f3<\fR and \f3>\fR) and ampersands (\f3&\fR) and invalid Javadoc tags\&.
++.RE
++
++
++You can specify the \f3-Xdoclint\fR option multiple times to enable the option to check errors and warnings in multiple categories\&. Alternatively, you can specify multiple error and warning categories by using the preceding options\&. For example, use either of the following commands to check for the HTML, syntax, and accessibility issues in the file \fIfilename\fR\&.
++.sp
++.nf
++\f3javadoc \-Xdoclint:html \-Xdoclint:syntax \-Xdoclint:accessibility \fIfilename\fR\fP
++.fi
++.nf
++\f3javadoc \-Xdoclint:html,syntax,accessibility \fIfilename\fR\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR The \f3javadoc\fR command does not guarantee the completeness of these checks\&. In particular, it is not a full HTML compliance checker\&. The goal of the -\f3Xdoclint\fR option is to enable the \f3javadoc\fR command to report majority of common errors\&.
++
++The \f3javadoc\fR command does not attempt to fix invalid input, it just reports it\&.
++.TP
++-public
++.br
++Shows only public classes and members\&.
++.TP
++-protected
++.br
++Shows only protected and public classes and members\&. This is the default\&.
++.TP
++-package
++.br
++Shows only package, protected, and public classes and members\&.
++.TP
++-private
++.br
++Shows all classes and members\&.
++.TP
++-help
++.br
++Displays the online help, which lists all of the \f3javadoc\fR and \f3doclet\fR command-line options\&.
++.TP
++-doclet \fIclass\fR
++.br
++Specifies the class file that starts the doclet used in generating the documentation\&. Use the fully qualified name\&. This doclet defines the content and formats the output\&. If the \f3-doclet\fR option is not used, then the \f3javadoc\fR command uses the standard doclet for generating the default HTML format\&. This class must contain the \f3start(Root)\fR method\&. The path to this starting class is defined by the \f3-docletpath\fR option\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.TP
++-docletpath \fIclasspathlist\fR
++.br
++Specifies the path to the doclet starting class file (specified with the \f3-doclet\fR option) and any JAR files it depends on\&. If the starting class file is in a JAR file, then this option specifies the path to that JAR file\&. You can specify an absolute path or a path relative to the current directory\&. If \f3classpathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semi-colon (;) on Windows\&. This option is not necessary when the doclet starting class is already in the search path\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.TP
++-1\&.1
++.br
++Removed from Javadoc 1\&.4 with no replacement\&. This option created documentation with the appearance and functionality of documentation generated by Javadoc 1\&.1 (it never supported nested classes)\&. If you need this option, then use Javadoc 1\&.2 or 1\&.3 instead\&.
++.TP
++-source \fIrelease\fR
++.br
++Specifies the release of source code accepted\&. The following values for the \f3release\fR parameter are allowed\&. Use the value of \f3release\fR that corresponds to the value used when you compile code with the \f3javac\fR command\&.
++.RS
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.5\fR\&. The \f3javadoc\fR command accepts code containing generics and other language features introduced in JDK 1\&.5\&. The compiler defaults to the 1\&.5 behavior when the \f3-source\fR option is not used\&.
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.4\fR\&. The \f3javadoc\fR command accepts code containing assertions, which were introduced in JDK 1\&.4\&.
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.3\fR\&. The \f3javadoc\fR command does not support assertions, generics, or other language features introduced after JDK 1\&.3\&.
++.RE
++
++.TP
++-sourcepath \fIsourcepathlist\fR
++.br
++Specifies the search paths for finding source files when passing package names or the \f3-subpackages\fR option into the \f3javadoc\fR command\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Note that this option is not only used to locate the source files being documented, but also to find source files that are not being documented, but whose comments are inherited by the source files being documented\&.
++
++You can use the \f3-sourcepath\fR option only when passing package names into the \f3javadoc\fR command\&. This will not locate source files passed into the \f3javadoc\fR command\&. To locate source files, \f3\fRchange to that directory or include the path ahead of each file, as shown at Document One or More Classes\&. If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses the class path to find the source files (see \f3-classpath\fR)\&. The default \f3-sourcepath\fR is the value of class path\&. If \f3-classpath\fR is omitted and you pass package names into the \f3javadoc\fR command, then the \f3javadoc\fR command searches in the current directory and subdirectories for the source files\&.
++
++Set \f3sourcepathlist\fR to the root directory of the source tree for the package you are documenting\&.
++
++For example, suppose you want to document a package called \f3com\&.mypackage\fR, whose source files are located at:/home/user/src/com/mypackage/*\&.java\&. Specify the sourcepath to /home/user/src, the directory that contains com\emypackage, and then supply the package name, as follows:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/src/ com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Notice that if you concatenate the value of sourcepath and the package name together and change the dot to a slash (/), then you have the full path to the package:
++
++/home/user/src/com/mypackage
++
++To point to two source paths:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user1/src:/home/user2/src com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-classpath \fIclasspathlist\fR
++.br
++Specifies the paths where the \f3javadoc\fR command searches for referenced classes These are the documented classes plus any classes referenced by those classes\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Follow the instructions in the class path documentation for specifying the \f3classpathlist\fR value\&.
++
++If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses \f3-classpath\fR to find the source files and class files (for backward compatibility)\&. If you want to search for source and class files in separate paths, then use both \f3-sourcepath\fR and \f3-classpath\fR\&.
++
++For example, if you want to document \f3com\&.mypackage\fR, whose source files reside in the directory /home/user/src/com/mypackage, and if this package relies on a library in /home/user/lib, then you would use the following command:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/lib \-classpath /home/user/src com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Similar to other tools, if you do not specify \f3-classpath\fR, then the \f3javadoc\fR command uses the \f3CLASSPATH\fR environment variable when it is set\&. If both are not set, then the \f3javadoc\fR command searches for classes from the current directory\&.
++
++For an in-depth description of how the \f3javadoc\fR command uses \f3-classpath\fR to find user classes as it relates to extension classes and bootstrap classes, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++
++A class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
++
++For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JA\fRR, then the class path element \f3foo/*\fR is expanded to a \f3A\&.jar:b\&.JAR\fR, except that the order of JAR files is unspecified\&. All JAR files in the specified directory including hidden files are included in the list\&. A class path entry that consists of * expands to a list of all the jar files in the current directory\&. The \f3CLASSPATH\fR environment variable is similarly expanded\&. Any class path wildcard expansion occurs before the Java Virtual Machine (JVM) starts\&. No Java program ever sees unexpanded wild cards except by querying the environment, for example, by calling System\&.getenv(\f3"CLASSPATH"\fR)\&.
++.TP
++-subpackages \fIpackage1:package2:\&.\&.\&.\fR
++.br
++Generates documentation from source files in the specified packages and recursively in their subpackages\&. This option is useful when adding new subpackages to the source code because they are automatically included\&. Each package argument is any top-level subpackage (such as \f3java\fR) or fully qualified package (such as \f3javax\&.swing\fR) that does not need to contain source files\&. Arguments are separated by colons on all operating systems\&. Wild cards are not allowed\&. Use \f3-sourcepath\fR to specify where to find the packages\&. This option does not process source files that are in the source tree but do not belong to the packages\&. See Process Source Files\&.
++
++For example, the following command generates documentation for packages named \f3java\fR and \f3javax\&.swing\fR and all of their subpackages\&.
++.sp
++.nf
++\f3javadoc \-d docs \-sourcepath /home/user/src \-subpackages java:javax\&.swing \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-exclude \fIpackagename1:packagename2:\&.\&.\&.\fR
++.br
++Unconditionally excludes the specified packages and their subpackages from the list formed by \f3-subpackages\fR\&. It excludes those packages even when they would otherwise be included by some earlier or later \f3-subpackages\fR option\&.
++
++The following example would include \f3java\&.io\fR, \f3java\&.util\fR, and \f3java\&.math\fR (among others), but would exclude packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice that this example excludes \f3java\&.lang\&.ref\fR, which is a subpackage of \f3java\&.lang\fR\&.
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/src \-subpackages java \-exclude \fP
++.fi
++.nf
++\f3 java\&.net:java\&.lang\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-bootclasspath \fIclasspathlist\fR
++.br
++Specifies the paths where the boot classes reside\&. These are typically the Java platform classes\&. The \f3bootclasspath\fR is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. For more information, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++
++Separate directories in the \f3classpathlist\fR parameters with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
++.TP
++-extdirs \fIdirist\fR
++.br
++Specifies the directories where extension classes reside\&. These are any classes that use the Java Extension mechanism\&. The \f3extdirs\fR option is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. See the \f3-classpath\fR option for more information\&. Separate directories in \f3dirlist\fR with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
++.TP
++-verbose
++.br
++Provides more detailed messages while the \f3javadoc\fR command runs\&. Without the \f3verbose\fR option, messages appear for loading the source files, generating the documentation (one message per source file), and sorting\&. The verbose option causes the printing of additional messages that specify the number of milliseconds to parse each Java source file\&.
++.TP
++-quiet
++.br
++Shuts off messages so that only the warnings and errors appear to make them easier to view\&. It also suppresses the \f3version\fR string\&.
++.TP
++-breakiterator
++.br
++Uses the internationalized sentence boundary of \f3java\&.text\&.BreakIterator\fR to determine the end of the first sentence in the main description of a package, class, or member for English\&. All other locales already use the \f3BreakIterator\fR class, rather than an English language, locale-specific algorithm\&. The first sentence is copied to the package, class, or member summary and to the alphabetic index\&. From JDK 1\&.2 and later, the \f3BreakIterator\fR class is used to determine the end of a sentence for all languages except for English\&. Therefore, the \f3-breakiterator\fR option has no effect except for English from 1\&.2 and later\&. English has its own default algorithm:
++.RS
++.TP 0.2i
++\(bu
++English default sentence-break algorithm\&. Stops at a period followed by a space or an HTML block tag, such as \f3<P>\fR\&.
++.TP 0.2i
++\(bu
++Breakiterator sentence-break algorithm\&. Stops at a period, question mark, or exclamation point followed by a space when the next word starts with a capital letter\&. This is meant to handle most abbreviations (such as "The serial no\&. is valid", but will not handle "Mr\&. Smith")\&. The \f3-breakiterator\fR option does not stop at HTML tags or sentences that begin with numbers or symbols\&. The algorithm stops at the last period in \&.\&./filename, even when embedded in an HTML tag\&.
++.RE
++
++
++In Java SE 1\&.5 the \f3-breakiterator\fR option warning messages are removed, and the default sentence-break algorithm is unchanged\&. If you have not modified your source code to eliminate the \f3-breakiterator\fR option warnings in Java SE 1\&.4\&.x, then you do not have to do anything\&. The warnings go away starting with Java SE 1\&.5\&.0\&.
++.TP
++-locale \fIlanguage_country_variant\fR
++.br
++Specifies the locale that the \f3javadoc\fR command uses when it generates documentation\&. The argument is the name of the locale, as described in \f3j\fR\f3ava\&.util\&.Locale\fR documentation, such as \f3en_US\fR (English, United States) or \f3en_US_WIN\fR (Windows variant)\&.
++
++\fINote:\fR The \f3-locale\fR option must be placed ahead (to the left) of any options provided by the standard doclet or any other doclet\&. Otherwise, the navigation bars appear in English\&. This is the only command-line option that depends on order\&. See Standard Doclet Options\&.
++
++Specifying a locale causes the \f3javadoc\fR command to choose the resource files of that locale for messages such as strings in the navigation bar, headings for lists and tables, help file contents, comments in the stylesheet\&.css file, and so on\&. It also specifies the sorting order for lists sorted alphabetically, and the sentence separator to determine the end of the first sentence\&. The \f3-locale\fR option does not determine the locale of the documentation comment text specified in the source files of the documented classes\&.
++.TP
++-encoding
++.br
++Specifies the encoding name of the source files, such as \f3EUCJIS/SJIS\fR\&. If this option is not specified, then the platform default converter is used\&. See also the\f3-docencoding name\fR and \f3-charset name\fR options\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR directly to the Java Runtime Environment (JRE) that runs the \f3javadoc\fR command\&. For example, if you must ensure that the system sets aside 32 MB of memory in which to process the generated documentation, then you would call the \f3-Xmx\fR option as follows: \f3javadoc -J-Xmx32m -J-Xms32m com\&.mypackage\fR\&. Be aware that \f3-Xms\fR is optional because it only sets the size of initial memory, which is useful when you know the minimum amount of memory required\&.
++
++There is no space between the \f3J\fR and the \f3flag\fR\&.
++
++Use the \f3-version\fR option to find out what version of the \f3javadoc\fR command you are using\&. The version number of the standard doclet appears in its output stream\&. See Running the Javadoc Command\&.
++.sp
++.nf
++\f3javadoc \-J\-version\fP
++.fi
++.nf
++\f3java version "1\&.7\&.0_09"\fP
++.fi
++.nf
++\f3Java(TM) SE Runtime Environment (build 1\&.7\&.0_09\-b05)\fP
++.fi
++.nf
++\f3Java HotSpot(TM) 64\-Bit Server VM (build 23\&.5\-b02, mixed mode)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-javafx
++.br
++Generates HTML documentation using the JavaFX extensions to the standard doclet\&. The generated documentation includes a Property Summary section in addition to the other summary sections generated by the standard Java doclet\&. The listed properties are linked to the sections for the getter and setter methods of each property\&.
++
++If there are no documentation comments written explicitly for getter and setter methods, the documentation comments from the property method are automatically copied to the generated documentation for these methods\&. This option also adds a new \f3@defaultValue\fR tag that allows documenting the default value for a property\&.
++
++Example:
++.sp
++.nf
++\f3javadoc \-javafx MyClass\&.java \-d testdir\fP
++.fi
++.sp
++
++.SS STANDARD\ DOCLET\ OPTIONS
++.TP
++-d \fIdirectory\fR
++.br
++Specifies the destination directory where the \f3javadoc\fR command saves the generated HTML files\&. If you omit the \f3-d\fR option, then the files are saved to the current directory\&. The \f3directory\fR value can be absolute or relative to the current working directory\&. As of Java SE 1\&.4, the destination directory is automatically created when the \f3javadoc\fR command runs\&.
++
++For example, the following command generates the documentation for the package \f3com\&.mypackage\fR and saves the results in the /user/doc/ directory: \f3javadoc -d\fR\f3/user/doc/\fR\f3com\&.mypackage\fR\&.
++.TP
++-use
++.br
++Includes one Use page for each documented class and package\&. The page describes what packages, classes, methods, constructors and fields use any API of the specified class or package\&. Given class C, things that use class C would include subclasses of C, fields declared as C, methods that return C, and methods and constructors with parameters of type C\&. For example, you can look at the Use page for the \f3String\fR type\&. Because the \f3getName\fR method in the \f3java\&.awt\&.Font\fR class returns type \f3String\fR, the \f3getName\fR method uses \f3String\fR and so the \f3getName\fR method appears on the Use page for \f3String\fR\&.This documents only uses of the API, not the implementation\&. When a method uses \f3String\fR in its implementation, but does not take a string as an argument or return a string, that is not considered a use of \f3String\fR\&.To access the generated Use page, go to the class or package and click the \fIUse link\fR in the navigation bar\&.
++.TP
++-version
++.br
++Includes the @version text in the generated docs\&. This text is omitted by default\&. To find out what version of the \f3javadoc\fR command you are using, use the \f3-J-version\fR option\&.
++.TP
++-author
++.br
++Includes the \f3@author\fR text in the generated docs\&.
++.TP
++-splitindex
++.br
++Splits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical symbols\&.
++.TP
++-windowtitle \fItitle\fR
++.br
++Specifies the title to be placed in the HTML \f3<title>\fR tag\&. The text specified in the \f3title\fR tag appears in the window title and in any browser bookmarks (favorite places) that someone creates for this page\&. This title should not contain any HTML tags because the browser does not interpret them correctly\&. Use escape characters on any internal quotation marks within the \f3title\fR tag\&. If the \f3-windowtitle\fR option is omitted, then the \f3javadoc\fR command uses the value of the \f3-doctitle\fR option for the \f3-windowtitle\fR option\&. For example, \f3javadoc -windowtitle "Java SE Platform" com\&.mypackage\fR\&.
++.TP
++-doctitle \fItitle\fR
++.br
++Specifies the title to place near the top of the overview summary file\&. The text specified in the \f3title\fR tag is placed as a centered, level-one heading directly beneath the top navigation bar\&. The \f3title\fR tag can contain HTML tags and white space, but when it does, you must enclose the title in quotation marks\&. Internal quotation marks within the \f3title\fR tag must be escaped\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
++.TP
++-title \fItitle\fR
++.br
++No longer exists\&. It existed only in Beta releases of Javadoc 1\&.2\&. It was renamed to \f3-doctitle\fR\&. This option was renamed to make it clear that it defines the document title, rather than the window title\&.
++.TP
++-header \fIheader\fR
++.br
++Specifies the header text to be placed at the top of each output file\&. The header is placed to the right of the upper navigation bar\&. The \f3header\fR can contain HTML tags and white space, but when it does, the \f3header\fR must be enclosed in quotation marks\&. Use escape characters for internal quotation marks within a header\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
++.TP
++-footer \fIfooter\fR
++.br
++Specifies the footer text to be placed at the bottom of each output file\&. The \fIfooter\fR value is placed to the right of the lower navigation bar\&. The \f3footer\fR value can contain HTML tags and white space, but when it does, the \f3footer\fR value must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within a footer\&.
++.TP
++-top
++.br
++Specifies the text to be placed at the top of each output file\&.
++.TP
++-bottom \fItext\fR
++.br
++Specifies the text to be placed at the bottom of each output file\&. The text is placed at the bottom of the page, underneath the lower navigation bar\&. The text can contain HTML tags and white space, but when it does, the text must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within text\&.
++.TP
++-link \fIextdocURL\fR
++.br
++Creates links to existing Javadoc-generated documentation of externally referenced classes\&. The \fIextdocURL\fR argument is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. You can specify multiple \f3-link\fR options in a specified \f3javadoc\fR command run to link to multiple documents\&.
++
++The package-list file must be found in this directory (otherwise, use the \f3-linkoffline\fR option)\&. The \f3javadoc\fR command reads the package names from the package-list file and links to those packages at that URL\&. When the \f3javadoc\fR command runs, the \f3extdocURL\fR value is copied into the \f3<A HREF>\fR links that are created\&. Therefore, \f3extdocURL\fR must be the URL to the directory, and not to a file\&. You can use an absolute link for \fIextdocURL\fR to enable your documents to link to a document on any web site, or you can use a relative link to link only to a relative location\&. If you use a relative link, then the value you pass in should be the relative path from the destination directory (specified with the \f3-d\fR option) to the directory containing the packages being linked to\&.When you specify an absolute link, you usually use an HTTP link\&. However, if you want to link to a file system that has no web server, then you can use a file link\&. Use a file link only when everyone who wants to access the generated documentation shares the same file system\&.In all cases, and on all operating systems, use a slash as the separator, whether the URL is absolute or relative, and \f3h\fR\f3ttp:\fR or \f3f\fR\f3ile:\fR as specified in the URL Memo: Uniform Resource Locators at http://www\&.ietf\&.org/rfc/rfc1738\&.txt
++.sp
++.nf
++\f3\-link http://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\-link file://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\-link <directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Differences between the -linkoffline and -link options
++
++Use the \f3-link\fR option in the following cases:
++.TP 0.2i
++\(bu
++When you use a relative path to the external API document\&.
++.TP 0.2i
++\(bu
++When you use an absolute URL to the external API document if your shell lets you open a connection to that URL for reading\&.
++.PP
++Use the \f3-linkoffline\fR option when you use an absolute URL to the external API document, if your shell does not allow a program to open a connection to that URL for reading\&. This can occur when you are behind a firewall and the document you want to link to is on the other side\&.
++.PP
++\f3Example 1 Absolute Link to External Documents\fR
++.PP
++Use the following command if you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java platform packages, shown at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
++.sp
++.nf
++\f3javadoc \-link http://docs\&.oracle\&.com/javase/8/docs/api/ com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The command generates documentation for the package \f3com\&.mypackage\fR with links to the Java SE packages\&. The generated documentation contains links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other options, such as the \f3-sourcepath\fR and \f3-d\fR options, are not shown\&.
++.PP
++\f3Example 2 Relative Link to External Documents\fR
++.PP
++In this example, there are two packages with documents that are generated in different runs of the \f3javadoc\fR command, and those documents are separated by a relative path\&. The packages are \f3com\&.apipackage\fR, an API, and c\f3om\&.spipackage\fR, an Service Provide Interface (SPI)\&. You want the documentation to reside in docs/api/com/apipackage and docs/spi/com/spipackage\&. Assuming that the API package documentation is already generated, and that docs is the current directory, you document the SPI package with links to the API documentation by running: \f3javadoc -d \&./spi -link \&.\&./api com\&.spipackage\fR\&.
++.PP
++Notice the \f3-link\fR option is relative to the destination directory (docs/spi)\&.
++.PP
++Notes
++
++The \f3-link\fR option lets you link to classes referenced to by your code, but not documented in the current \f3javadoc\fR command run\&. For these links to go to valid pages, you must know where those HTML pages are located and specify that location with \f3extdocURL\fR\&. This allows third-party documentation to link to java\&.* documentation at http://docs\&.oracle\&.com\&.Omit the \f3-link\fR option when you want the \f3javadoc\fR command to create links only to APIs within the documentation it is generating in the current run\&. Without the \f3-link\fR option, the \f3javadoc\fR command does not create links to documentation for external references because it does not know whether or where that documentation exists\&.The \f3-link\fR option can create links in several places in the generated documentation\&. See Process Source Files\&. Another use is for cross-links between sets of packages: Execute the \f3javadoc\fR command on one set of packages, then run the \f3javadoc\fR command again on another set of packages, creating links both ways between both sets\&.
++.PP
++How to Reference a Class
++
++For a link to an externally referenced class to appear (and not just its text label), the class must be referenced in the following way\&. It is not sufficient for it to be referenced in the body of a method\&. It must be referenced in either an \f3import\fR statement or in a declaration\&. Here are examples of how the class \f3java\&.io\&.File\fR can be referenced:
++.PP
++\fI\fRIn any kind of import statement\&. By wildcard import, import explicitly by name, or automatically import for \f3java\&.lang\&.*\fR\&.
++.PP
++In Java SE 1\&.3\&.\fIn\fR and 1\&.2\&.\fIn\fR, only an explicit import by name works\&. A wildcard \f3import\fR statement does not work, nor does the automatic \f3import java\&.lang\&.*\fR\&.
++.PP
++\fI\fRIn a declaration: \f3void mymethod(File f) {}\fR
++.PP
++The reference can be in the return type or parameter type of a method, constructor, field, class, or interface, or in an implements, extends, or throws statement\&.
++.PP
++An important corollary is that when you use the \f3-link\fR option, there can be many links that unintentionally do not appear due to this constraint\&. The text would appear without being a link\&. You can detect these by the warnings they emit\&. The simplest way to properly reference a class and add the link would be to import that class\&.
++.PP
++Package List
++
++The \f3-link\fR option requires that a file named package-list, which is generated by the \f3javadoc\fR command, exists at the URL you specify with the \f3-link\fR option\&. The package-list file is a simple text file that lists the names of packages documented at that location\&. In the earlier example, the \f3javadoc\fR command searches for a file named package-list at the specified URL, reads in the package names, and links to those packages at that URL\&.
++.PP
++For example, the package list for the Java SE API is located at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
++.PP
++The package list starts as follows:
++.sp
++.nf
++\f3java\&.applet\fP
++.fi
++.nf
++\f3java\&.awt\fP
++.fi
++.nf
++\f3java\&.awt\&.color\fP
++.fi
++.nf
++\f3java\&.awt\&.datatransfer\fP
++.fi
++.nf
++\f3java\&.awt\&.dnd\fP
++.fi
++.nf
++\f3java\&.awt\&.event\fP
++.fi
++.nf
++\f3java\&.awt\&.font\fP
++.fi
++.nf
++\f3and so on \&.\&.\&.\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When \f3javadoc\fR is run without the \f3-link\fR option and encounters a name that belongs to an externally referenced class, it prints the name with no link\&. However, when the \f3-link\fR option is used, the \f3javadoc\fR command searches the package-list file at the specified \fIextdocURL\fR location for that package name\&. When it finds the package name, it prefixes the name with \fIextdocURL\fR\&.
++.PP
++For there to be no broken links, all of the documentation for the external references must exist at the specified URLs\&. The \f3javadoc\fR command does not check that these pages exist, but only that the package-list exists\&.
++.PP
++Multiple Links
++
++You can supply multiple \f3-link\fR options to link to any number of externally generated documents\&. Javadoc 1\&.2 has a known bug that prevents you from supplying more than one \f3-link\fR options\&. This was fixed in Javadoc 1\&.2\&.2\&. Specify a different link option for each external document to link to \f3javadoc -link extdocURL1 -link extdocURL2 \&.\&.\&. -link extdocURLn com\&.mypackage\fR where \fIextdocURL1\fR, \fIextdocURL2\fR, \&.\f3\&.\&. extdocURLn\fR point respectively to the roots of external documents, each of which contains a file named package-list\&.
++.PP
++Cross Links
++
++Note that bootstrapping might be required when cross-linking two or more documents that were previously generated\&. If package-list does not exist for either document when you run the \f3javadoc\fR command on the first document, then the package-list does not yet exist for the second document\&. Therefore, to create the external links, you must regenerate the first document after you generate the second document\&.
++.PP
++In this case, the purpose of first generating a document is to create its package-list (or you can create it by hand if you are certain of the package names)\&. Then, generate the second document with its external links\&. The \f3javadoc\fR command prints a warning when a needed external package-list file does not exist\&.
++.TP
++-linkoffline \fIextdocURL packagelistLoc\fR
++.br
++This option is a variation of the \f3-link\fR option\&. They both create links to Javadoc-generated documentation for externally referenced classes\&. Use the \f3-link\fRo\f3ffline\fR option when linking to a document on the web when the \f3javadoc\fR command cannot access the document through a web connection\&. Use the \f3-linkoffline\fR option when package-list file of the external document is not accessible or does not exist at the \f3extdocURL\fR location, but does exist at a different location that can be specified by \f3packageListLoc\fR (typically local)\&. If \f3extdocURL\fR is accessible only on the World Wide Web, then the \f3-linkoffline\fR option removes the constraint that the \f3javadoc\fR command must have a web connection to generate documentation\&. Another use is as a work-around to update documents: After you have run the \f3javadoc\fR command on a full set of packages, you can run the \f3javadoc\fR command again on a smaller set of changed packages, so that the updated files can be inserted back into the original set\&. Examples follow\&. The \f3-linkoffline\fR option takes two arguments\&. The first is for the string to be embedded in the \f3<a href>\fR links, and the second tells the \f3-linkoffline\fR option where to find package-list:
++.RS
++.TP 0.2i
++\(bu
++The \f3extdocURL\fR value is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. When relative, the value should be the relative path from the destination directory (specified with the \f3-d\fR option) to the root of the packages being linked to\&. For more information, see \fIextdocURL\fR in the \f3-link\fR option\&.
++.TP 0.2i
++\(bu
++The \f3packagelistLoc\fR value is the path or URL to the directory that contains the package-list file for the external documentation\&. This can be a URL (http: or file:) or file path, and can be absolute or relative\&. When relative, make it relative to the current directory from where the \f3javadoc\fR command was run\&. Do not include the package-list file name\&.
++
++You can specify multiple \f3-linkoffline\fR options in a specified \f3javadoc\fR command run\&. Before Javadoc 1\&.2\&.2, the \f3-linkfile\fR options could be specified once\&.
++.RE
++
++.PP
++Absolute Links to External Documents
++
++You might have a situation where you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java SE packages at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
++.PP
++However, your shell does not have web access\&. In this case, do the following:
++.TP 0.4i
++1\&.
++Open the package-list file in a browser at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
++.TP 0.4i
++2\&.
++Save the file to a local directory, and point to this local copy with the second argument, \f3packagelistLoc\fR\&. In this example, the package list file was saved to the current directory (\&.)\&.
++.PP
++The following command generates documentation for the package c\f3om\&.mypackage\fR with links to the Java SE packages\&. The generated documentation will contain links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other necessary options, such as \f3-sourcepath\fR, are not shown\&.
++.sp
++.nf
++\f3javadoc \-linkoffline http://docs\&.oracle\&.com/javase/8/docs/api/ \&. com\&.mypackage \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Relative Links to External Documents
++
++It is not very common to use \f3-linkoffline\fR with relative paths, for the simple reason that the \f3-link\fR option is usually enough\&. When you use the \f3-linkoffline\fR option, the package-list file is usually local, and when you use relative links, the file you are linking to is also local, so it is usually unnecessary to give a different path for the two arguments to the \f3-linkoffline\fR option When the two arguments are identical, you can use the \f3-link\fR option\&.
++.PP
++Create a package-list File Manually
++
++If a package-list file does not exist yet, but you know what package names your document will link to, then you can manually create your own copy of this file and specify its path with \f3packagelistLoc\fR\&. An example would be the previous case where the package list for \f3com\&.spipackage\fR did not exist when \f3com\&.apipackage\fR was first generated\&. This technique is useful when you need to generate documentation that links to new external documentation whose package names you know, but which is not yet published\&. This is also a way of creating package-list files for packages generated with Javadoc 1\&.0 or 1\&.1, where package-list files were not generated\&. Similarly, two companies can share their unpublished package-list files so they can release their cross-linked documentation simultaneously\&.
++.PP
++Link to Multiple Documents
++
++You can include the \f3-linkoffline\fR option once for each generated document you want to refer to:
++.sp
++.nf
++\f3javadoc \-linkoffline extdocURL1 packagelistLoc1 \-linkoffline extdocURL2\fP
++.fi
++.nf
++\f3packagelistLoc2 \&.\&.\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Update Documents
++
++You can also use the \f3-linkoffline\fR option when your project has dozens or hundreds of packages\&. If you have already run the \f3javadoc\fR command on the entire source tree, then you can quickly make small changes to documentation comments and rerun the \f3javadoc\fR command on a portion of the source tree\&. Be aware that the second run works properly only when your changes are to documentation comments and not to declarations\&. If you were to add, remove, or change any declarations from the source code, then broken links could show up in the index, package tree, inherited member lists, Use page, and other places\&.
++.PP
++First, create a new destination directory, such as update, for this new small run\&. In this example, the original destination directory is named html\&. In the simplest example, change directory to the parent of html\&. Set the first argument of the \f3-linkoffline\fR option to the current directory (\&.) and set the second argument to the relative path to html, where it can find package-list and pass in only the package names of the packages you want to update:
++.sp
++.nf
++\f3javadoc \-d update \-linkoffline \&. html com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When the \f3javadoc\fR command completes, copy these generated class pages in update/com/package (not the overview or index) to the original files in html/com/package\&.
++.TP
++-linksource
++.br
++Creates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation\&. Links are created for classes, interfaces, constructors, methods, and fields whose declarations are in a source file\&. Otherwise, links are not created, such as for default constructors and generated classes\&.
++
++This option exposes all private implementation details in the included source files, including private classes, private fields, and the bodies of private methods, regardless of the \f3-public\fR, \f3-package\fR, \f3-protected\fR, and \f3-private\fR options\&. Unless you also use the \f3-private\fR option, not all private classes or interfaces are accessible through links\&.
++
++Each link appears on the name of the identifier in its declaration\&. For example, the link to the source code of the \f3Button\fR class would be on the word \f3Button\fR:
++.sp
++.nf
++\f3public class Button extends Component implements Accessible\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The link to the source code of the \f3getLabel\fR method in the \f3Button\fR class is on the word \f3getLabel\fR:
++.sp
++.nf
++\f3public String getLabel()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-group groupheading \fIpackagepattern:packagepattern\fR
++.br
++Separates packages on the overview page into whatever groups you specify, one group per table\&. You specify each group with a different \f3-group\fR option\&. The groups appear on the page in the order specified on the command line\&. Packages are alphabetized within a group\&. For a specified \f3-group\fR option, the packages matching the list of \f3packagepattern\fR expressions appear in a table with the heading \fIgroupheading\fR\&.
++.RS
++.TP 0.2i
++\(bu
++The \f3groupheading\fR can be any text and can include white space\&. This text is placed in the table heading for the group\&.
++.TP 0.2i
++\(bu
++The \f3packagepattern\fR value can be any package name at the start of any package name followed by an asterisk (*)\&. The asterisk is the only wildcard allowed and means match any characters\&. Multiple patterns can be included in a group by separating them with colons (:)\&. If you use an asterisk in a pattern or pattern list, then the pattern list must be inside quotation marks, such as \f3"java\&.lang*:java\&.util"\fR\&.
++.RE
++
++
++When you do not supply a \f3-group\fR option, all packages are placed in one group with the heading \fIPackages\fR and appropriate subheadings\&. If the subheadings do not include all documented packages (all groups), then the remaining packages appear in a separate group with the subheading Other Packages\&.
++
++For example, the following \f3javadoc\fR command separates the three documented packages into \fICore\fR, \fIExtension\fR, and \fIOther Packages\fR\&. The trailing dot (\&.) does not appear in \f3java\&.lang*\fR\&. Including the dot, such as \f3java\&.lang\&.*\fR omits the\f3java\&.lang\fR package\&.
++.sp
++.nf
++\f3javadoc \-group "Core Packages" "java\&.lang*:java\&.util"\fP
++.fi
++.nf
++\f3 \-group "Extension Packages" "javax\&.*"\fP
++.fi
++.nf
++\f3 java\&.lang java\&.lang\&.reflect java\&.util javax\&.servlet java\&.new\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fICore Packages\fR
++
++\f3java\&.lang\fR
++
++\f3java\&.lang\&.reflect\fR
++
++\f3java\&.util\fR
++
++\fIExtension Packages\fR
++
++\f3javax\&.servlet\fR
++
++\fIOther Packages\fR
++
++\f3java\&.new\fR
++.TP
++-nodeprecated
++.br
++Prevents the generation of any deprecated API in the documentation\&. This does what the \f3-nodeprecatedlist\fR option does, and it does not generate any deprecated API throughout the rest of the documentation\&. This is useful when writing code when you do not want to be distracted by the deprecated code\&.
++.TP
++-nodeprecatedlist
++.br
++Prevents the generation of the file that contains the list of deprecated APIs (deprecated-list\&.html) and the link in the navigation bar to that page\&. The \f3javadoc\fR command continues to generate the deprecated API throughout the rest of the document\&. This is useful when your source code contains no deprecated APIs, and you want to make the navigation bar cleaner\&.
++.TP
++-nosince
++.br
++Omits from the generated documents the \f3Since\fR sections associated with the \f3@since\fR tags\&.
++.TP
++-notree
++.br
++Omits the class/interface hierarchy pages from the generated documents\&. These are the pages you reach using the Tree button in the navigation bar\&. The hierarchy is produced by default\&.
++.TP
++-noindex
++.br
++Omits the index from the generated documents\&. The index is produced by default\&.
++.TP
++-nohelp
++.br
++Omits the HELP link in the navigation bars at the top and bottom of each page of output\&.
++.TP
++-nonavbar
++.br
++Prevents the generation of the navigation bar, header, and footer, that are usually found at the top and bottom of the generated pages\&. The \f3-nonavbar\fR option has no affect on the \f3-bottom\fR option\&. The \f3-nonavbar\fR option is useful when you are interested only in the content and have no need for navigation, such as when you are converting the files to PostScript or PDF for printing only\&.
++.TP
++-helpfile \fIpath\efilename\fR
++.br
++Specifies the path of an alternate help file path\efilename that the HELP link in the top and bottom navigation bars link to\&. Without this option, the \f3javadoc\fR command creates a help file help-doc\&.html that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to help-doc\&.html\&. The \f3javadoc\fR command adjusts the links in the navigation bar accordingly, for example:
++.sp
++.nf
++\f3javadoc \-helpfile /home/user/myhelp\&.html java\&.awt\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-stylesheet \fIpath/filename\fR
++.br
++Specifies the path of an alternate HTML stylesheet file\&. Without this option, the \f3javadoc\fR command automatically creates a stylesheet file stylesheet\&.css that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to stylesheet\&.css, for example:
++.sp
++.nf
++\f3javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-serialwarn
++.br
++Generates compile-time warnings for missing \f3@serial\fR tags\&. By default, Javadoc 1\&.2\&.2 and later versions generate no serial warnings\&. This is a reversal from earlier releases\&. Use this option to display the serial warnings, which helps to properly document default serializable fields and \f3writeExternal\fR methods\&.
++.TP
++-charset \fIname\fR
++.br
++Specifies the HTML character set for this document\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
++
++For example, \f3javadoc -charset "iso-8859-1" mypackage\fR inserts the following line in the head of every generated page:
++.sp
++.nf
++\f3<META http\-equiv="Content\-Type" content="text/html; charset=ISO\-8859\-1">\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This \f3META\fR tag is described in the HTML standard (4197265 and 4137321), HTML Document Representation, at http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
++
++See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
++.TP
++-docencoding \fIname\fR
++.br
++Specifies the encoding of the generated HTML files\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
++
++If you omit the \f3-docencoding\fR option but use the \f3-encoding\fR option, then the encoding of the generated HTML files is determined by the \f3-encoding\fR option, for example: \f3javadoc -docencoding "iso-8859-1" mypackage\fR\&. See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
++.TP
++-keywords
++.br
++Adds HTML keyword <META> tags to the generated file for each class\&. These tags can help search engines that look for <META> tags find the pages\&. Most search engines that search the entire Internet do not look at <META> tags, because pages can misuse them\&. Search engines offered by companies that confine their searches to their own website can benefit by looking at <META> tags\&. The <META> tags include the fully qualified name of the class and the unqualified names of the fields and methods\&. Constructors are not included because they are identical to the class name\&. For example, the class \f3String\fR starts with these keywords:
++.sp
++.nf
++\f3<META NAME="keywords" CONTENT="java\&.lang\&.String class">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="CASE_INSENSITIVE_ORDER">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="length()">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="charAt()">\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-tag \fItagname\fR:Xaoptcmf:"\fItaghead\fR"
++.br
++Enables the \f3javadoc\fR command to interpret a simple, one-argument \f3@tagname\fR custom block tag in documentation comments\&. For the \f3javadoc\fR command to spell-check tag names, it is important to include a \f3-tag\fR option for every custom tag that is present in the source code, disabling (with \f3X\fR) those that are not being output in the current run\&.The colon (:) is always the separator\&. The \f3-tag\fR option outputs the tag heading \fItaghead\fR in bold, followed on the next line by the text from its single argument\&. Similar to any block tag, the argument text can contain inline tags, which are also interpreted\&. The output is similar to standard one-argument tags, such as the \f3@return\fR and \f3@author\fR tags\&. Omitting a value for \fItaghead\fR causes \f3tagname\fR to be the heading\&.
++
++\fIPlacement of tags\fR: The \f3Xaoptcmf\fR arguments determine where in the source code the tag is allowed to be placed, and whether the tag can be disabled (using \f3X\fR)\&. You can supply either \f3a\fR, to allow the tag in all places, or any combination of the other letters:
++
++\f3X\fR (disable tag)
++
++\f3a\fR (all)
++
++\f3o\fR (overview)
++
++\f3p\fR (packages)
++
++\f3t\fR (types, that is classes and interfaces)
++
++\f3c\fR (constructors)
++
++\f3m\fR (methods)
++
++\f3f\fR (fields)
++
++\fIExamples of single tags\fR: An example of a tag option for a tag that can be used anywhere in the source code is: \f3-tag todo:a:"To Do:"\fR\&.
++
++If you want the \f3@todo\fR tag to be used only with constructors, methods, and fields, then you use: \f3-tag todo:cmf:"To Do:"\fR\&.
++
++Notice the last colon (:) is not a parameter separator, but is part of the heading text\&. You would use either tag option for source code that contains the \f3@todo\fR tag, such as: \f3@todo The documentation for this method needs work\fR\&.
++
++\fIColons in tag names\fR: Use a backslash to escape a colon that you want to use in a tag name\&. Use the \f3-tag ejb\e\e:bean:a:"EJB Bean:"\fR option for the following documentation comment:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @ejb:bean\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fISpell-checking tag names\fR: Some developers put custom tags in the source code that they do not always want to output\&. In these cases, it is important to list all tags that are in the source code, enabling the ones you want to output and disabling the ones you do not want to output\&. The presence of \f3X\fR disables the tag, while its absence enables the tag\&. This gives the \f3javadoc\fR command enough information to know whether a tag it encounters is unknown, which is probably the results of a typographical error or a misspelling\&. The \f3javadoc\fR command prints a warning in these cases\&. You can add \f3X\fR to the placement values already present, so that when you want to enable the tag, you can simply delete the \f3X\fR\&. For example, if the \f3@todo\fR tag is a tag that you want to suppress on output, then you would use: \f3-tag todo:Xcmf:"To Do:"\fR\&. If you would rather keep it simple, then use this: \f3-tag todo:X\fR\&. The syntax \f3-tag todo:X\fR works even when the \f3@todo\fR tag is defined by a taglet\&.
++
++\fIOrder of tags\fR: The order of the \f3-ta\fR\f3g\fR and \f3-taglet\fR options determines the order the tags are output\&. You can mix the custom tags with the standard tags to intersperse them\&. The tag options for standard tags are placeholders only for determining the order\&. They take only the standard tag\&'s name\&. Subheadings for standard tags cannot be altered\&. This is illustrated in the following example\&.If the \f3-tag\fR option is missing, then the position of the \f3-tagle\fR\f3t\fR option determines its order\&. If they are both present, then whichever appears last on the command line determines its order\&. This happens because the tags and taglets are processed in the order that they appear on the command line\&. For example, if the \f3-taglet\fR and \f3-tag\fR options have the name \f3todo\fR value, then the one that appears last on the command line determines the order\&.
++
++\fIExample of a complete set of tags\fR: This example inserts To Do after Parameters and before Throws in the output\&. By using \f3X\fR, it also specifies that the \f3@example\fR tag might be encountered in the source code that should not be output during this run\&. If you use the \f3@argfile\fR tag, then you can put the tags on separate lines in an argument file similar to this (no line continuation characters needed):
++.sp
++.nf
++\f3\-tag param\fP
++.fi
++.nf
++\f3\-tag return\fP
++.fi
++.nf
++\f3\-tag todo:a:"To Do:"\fP
++.fi
++.nf
++\f3\-tag throws\fP
++.fi
++.nf
++\f3\-tag see\fP
++.fi
++.nf
++\f3\-tag example:X\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the \f3javadoc\fR command parses the documentation comments, any tag encountered that is neither a standard tag nor passed in with the \f3-tag\fR or \f3-taglet\fR options is considered unknown, and a warning is thrown\&.
++
++The standard tags are initially stored internally in a list in their default order\&. Whenever the \f3-tag\fR options are used, those tags get appended to this list\&. Standard tags are moved from their default position\&. Therefore, if a \f3-tag\fR option is omitted for a standard tag, then it remains in its default position\&.
++
++\fIAvoiding conflicts\fR: If you want to create your own namespace, then you can use a dot-separated naming convention similar to that used for packages: \f3com\&.mycompany\&.todo\fR\&. Oracle will continue to create standard tags whose names do not contain dots\&. Any tag you create will override the behavior of a tag by the same name defined by Oracle\&. If you create a \f3@todo\fR tag or taglet, then it always has the same behavior you define, even when Oracle later creates a standard tag of the same name\&.
++
++\fIAnnotations vs\&. Javadoc tags\fR: In general, if the markup you want to add is intended to affect or produce documentation, then it should be a Javadoc tag\&. Otherwise, it should be an annotation\&. See Custom Tags and Annotations in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#annotations
++
++You can also create more complex block tags or custom inline tags with the \f3-taglet\fR option\&.
++.TP
++-taglet \fIclass\fR
++.br
++Specifies the class file that starts the taglet used in generating the documentation for that tag\&. Use the fully qualified name for the \f3class\fR value\&. This taglet also defines the number of text arguments that the custom tag has\&. The taglet accepts those arguments, processes them, and generates the output\&. For extensive documentation with example taglets, see: Taglet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html
++
++Taglets are useful for block or inline tags\&. They can have any number of arguments and implement custom behavior, such as making text bold, formatting bullets, writing out the text to a file, or starting other processes\&. Taglets can only determine where a tag should appear and in what form\&. All other decisions are made by the doclet\&. A taglet cannot do things such as remove a class name from the list of included classes\&. However, it can execute side effects, such as printing the tag\&'s text to a file or triggering another process\&. Use the \f3-tagletpath\fR option to specify the path to the taglet\&. The following example inserts the To Do taglet after Parameters and ahead of Throws in the generated pages\&. Alternately, you can use the \f3-taglet\fR option in place of its \f3-tag\fR option, but that might be difficult to read\&.
++.sp
++.nf
++\f3\-taglet com\&.sun\&.tools\&.doclets\&.ToDoTaglet\fP
++.fi
++.nf
++\f3\-tagletpath /home/taglets \fP
++.fi
++.nf
++\f3\-tag return\fP
++.fi
++.nf
++\f3\-tag param\fP
++.fi
++.nf
++\f3\-tag todo\fP
++.fi
++.nf
++\f3\-tag throws\fP
++.fi
++.nf
++\f3\-tag see\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-tagletpath \fItagletpathlist\fR
++.br
++Specifies the search paths for finding taglet class files\&. The \f3tagletpathlist\fR can contain multiple paths by separating them with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&.
++.TP
++-docfilesubdirs
++.br
++Enables deep copying of doc-files directories\&. Subdirectories and all contents are recursively copied to the destination\&. For example, the directory doc-files/example/images and all of its contents would be copied\&. There is also an option to exclude subdirectories\&.
++.TP
++-excludedocfilessubdir \fIname1:name2\fR
++.br
++Excludes any doc-files subdirectories with the specified names\&. This prevents the copying of SCCS and other source-code-control subdirectories\&.
++.TP
++-noqualifier all | \fIpackagename1\fR:\fIpackagename2\&.\&.\&.\fR
++.br
++Omits qualifying package names from class names in output\&. The argument to the \f3-noqualifier\fR option is either \f3all\fR (all package qualifiers are omitted) or a colon-separate list of packages, with wild cards, to be removed as qualifiers\&. The package name is removed from places where class or interface names appear\&. See Process Source Files\&.
++
++The following example omits all package qualifiers: \f3-noqualifier all\fR\&.
++
++The following example omits \f3java\&.lang\fR and \f3java\&.io\fR package qualifiers: \f3-noqualifier java\&.lang:java\&.io\fR\&.
++
++The following example omits package qualifiers starting with \f3java\fR, and \f3com\&.sun\fR subpackages, but not \f3javax\fR: \f3-noqualifier java\&.*:com\&.sun\&.*\fR\&.
++
++Where a package qualifier would appear due to the previous behavior, the name can be suitably shortened\&. See How a Name Appears\&. This rule is in effect whether or not the \f3-noqualifier\fR option is used\&.
++.TP
++-notimestamp
++.br
++Suppresses the time stamp, which is hidden in an HTML comment in the generated HTML near the top of each page\&. The \f3-notimestamp\fR option is useful when you want to run the \f3javadoc\fR command on two source bases and get the differences between \f3diff\fR them, because it prevents time stamps from causing a \f3diff\fR (which would otherwise be a \f3diff\fR on every page)\&. The time stamp includes the \f3javadoc\fR command release number, and currently appears similar to this: \f3<!-- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 -->\fR\&.
++.TP
++-nocomment
++.br
++Suppresses the entire comment body, including the main description and all tags, and generate only declarations\&. This option lets you reuse source files that were originally intended for a different purpose so that you can produce skeleton HTML documentation at the early stages of a new project\&.
++.TP
++-sourcetab \fItablength\fR
++.br
++Specifies the number of spaces each tab uses in the source\&.
++.SH COMMAND-LINE\ ARGUMENT\ FILES
++To shorten or simplify the \f3javadoc\fR command, you can specify one or more files that contain arguments to the \f3javadoc\fR command (except \f3-J\fR options)\&. This enables you to create \f3javadoc\fR commands of any length on any operating system\&.
++.PP
++An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be space-separated or newline-separated\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
++.PP
++File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (\f3*\fR) are not allowed in these lists (such as for specifying *\&.java)\&. Using the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
++.PP
++When you run the \f3javadoc\fR command, pass in the path and name of each argument file with the @ leading character\&. When the \f3javadoc\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
++.PP
++\f3Example 1 Single Argument File\fR
++.PP
++You could use a single argument file named \f3argfile\fR to hold all \f3javadoc\fR command arguments: \f3javadoc @argfile\fR\&. The argument file \f3\fRcontains the contents of both files, as shown in the next example\&.
++.PP
++\f3Example 2 Two Argument Files\fR
++.PP
++You can create two argument files: One for the \f3javadoc\fR command options and the other for the package names or source file names\&. Notice the following lists have no line-continuation characters\&.
++.PP
++Create a file named options that contains:
++.sp
++.nf
++\f3\-d docs\-filelist \fP
++.fi
++.nf
++\f3\-use \fP
++.fi
++.nf
++\f3\-splitindex\fP
++.fi
++.nf
++\f3\-windowtitle \&'Java SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3\-doctitle \&'Java SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3\-header \&'<b>Java\(tm SE 7</b>\&'\fP
++.fi
++.nf
++\f3\-bottom \&'Copyright &copy; 1993\-2011 Oracle and/or its affiliates\&. All rights reserved\&.\&'\fP
++.fi
++.nf
++\f3\-group "Core Packages" "java\&.*"\fP
++.fi
++.nf
++\f3\-overview /java/pubs/ws/1\&.7\&.0/src/share/classes/overview\-core\&.html\fP
++.fi
++.nf
++\f3\-sourcepath /java/pubs/ws/1\&.7\&.0/src/share/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Create a file named packages that contains:
++.sp
++.nf
++\f3com\&.mypackage1\fP
++.fi
++.nf
++\f3com\&.mypackage2\fP
++.fi
++.nf
++\f3com\&.mypackage3\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3javadoc\fR command as follows:
++.sp
++.nf
++\f3javadoc @options @packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Argument Files with Paths\fR
++.PP
++The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
++.sp
++.nf
++\f3javadoc @path1/options @path2/packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Option Arguments\fR
++.PP
++The following example saves an argument to a \f3javadoc\fR command option in an argument file\&. The \f3-bottom\fR option is used because it can have a lengthy argument\&. You could create a file named bottom to contain the text argument:
++.sp
++.nf
++\f3<font size="\-1">\fP
++.fi
++.nf
++\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&. <br/>\fP
++.fi
++.nf
++\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3 Other names may be trademarks of their respective owners\&.</font>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3javadoc\fR command as follows:\f3javadoc -bottom @bottom @packages\fR\&.
++.PP
++You can also include the \f3-bottom\fR option at the start of the argument file and run the \f3javadoc\fR command as follows: \f3javadoc @bottom @packages\fR\&.
++.SH RUNNING\ THE\ JAVADOC\ COMMAND
++The release number of the \f3javadoc\fR command can be determined with the \f3javadoc -J-version\fR option\&. The release number of the standard doclet appears in the output stream\&. It can be turned off with the \f3-quiet\fR option\&.
++.PP
++Use the public programmatic interface to call the \f3javadoc\fR command from within programs written in the Java language\&. This interface is in \f3com\&.sun\&.tools\&.javadoc\&.Main\fR (and the \f3javadoc\fR command is reentrant)\&. For more information, see The Standard Doclet at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard-doclet\&.html#runningprogrammatically
++.PP
++The following instructions call the standard HTML doclet\&. To call a custom doclet, use the \f3-doclet\fR and \f3-docletpath\fR options\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.SS SIMPLE\ EXAMPLES
++You can run the \f3javadoc\fR command on entire packages or individual source files\&. Each package name has a corresponding directory name\&.
++.PP
++In the following examples, the source files are located at /home/src/java/awt/*\&.java\&. The destination directory is /home/html\&.
++.PP
++Document One or More Packages
++
++To document a package, the source files for that package must be located in a directory that has the same name as the package\&.
++.PP
++If a package name has several identifiers (separated by dots, such as \f3java\&.awt\&.color\fR), then each subsequent identifier must correspond to a deeper subdirectory (such as java/awt/color)\&.
++.PP
++You can split the source files for a single package among two such directory trees located at different places, as long as \f3-sourcepath\fR points to them both\&. For example, src1/java/awt/color and src2/java/awt/color\&.
++.PP
++You can run the \f3javadoc\fR command either by changing directories (with the \f3cd\fR command) or by using the \f3-sourcepath\fR option\&. The following examples illustrate both alternatives\&.
++.PP
++\f3Example 1 Recursive Run from One or More Packages\fR
++.PP
++This example uses \f3-sourcepath\fR so the \f3javadoc\fR command can be run from any directory and \f3-subpackages\fR (a new 1\&.4 option) for recursion\&. It traverses the subpackages of the java directory excluding packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice this excludes \f3java\&.lang\&.ref\fR, a subpackage of \f3java\&.lang\fR\&. To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as \f3java:javax:org\&.xml\&.sax\fR\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Change to Root and Run Explicit Packages\fR
++.PP
++Change to the parent directory of the fully qualified package\&. Then, run the \f3javadoc\fR command with the names of one or more packages that you want to document:
++.sp
++.nf
++\f3cd /home/src/\fP
++.fi
++.nf
++\f3javadoc \-d /home/html java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as j\f3ava:javax:org\&.xml\&.sax\fR\&.
++.PP
++\f3Example 3 Run from Any Directory on Explicit Packages in One Tree\fR
++.PP
++In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with the parent directory of the top-level package\&. Provide the names of one or more packages that you want to document:
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Run from Any Directory on Explicit Packages in Multiple Trees\fR
++.PP
++Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with a colon-separated list of the paths to each tree\&'s root\&. Provide the names of one or more packages that you want to document\&. All source files for a specified package do not need to be located under a single root directory, but they must be found somewhere along the source path\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src1:/home/src2 java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The result is that all cases generate HTML-formatted documentation for the \f3public\fR and \f3protected\fR classes and interfaces in packages j\f3ava\&.awt\fR and \f3java\&.awt\&.even\fRt and save the HTML files in the specified destination directory\&. Because two or more packages are being generated, the document has three HTML frames: one for the list of packages, another for the list of classes, and the third for the main class pages\&.
++.PP
++Document One or More Classes
++
++The second way to run the \f3javadoc\fR command is to pass one or more source files\&. You can run \f3javadoc\fR either of the following two ways: by changing directories (with the \f3cd\fR command) or by fully specifying the path to the source files\&. Relative paths are relative to the current directory\&. The \f3-sourcepath\fR option is ignored when passing source files\&. You can use command-line wild cards, such as an asterisk (*), to specify groups of classes\&.
++.PP
++\f3Example 1 Change to the Source Directory\fR
++.PP
++Change to the directory that holds the source files\&. Then run the \f3javadoc\fR command with the names of one or more source files you want to document\&.
++.PP
++This example generates HTML-formatted documentation for the classes \f3Button\fR, \f3Canvas,\fR and classes that begin with \f3Graphics\fR\&. Because source files rather than package names were passed in as arguments to the \f3javadoc\fR command, the document has two frames: one for the list of classes and the other for the main page\&.
++.sp
++.nf
++\f3cd /home/src/java/awt\fP
++.fi
++.nf
++\f3javadoc \-d /home/html Button\&.java Canvas\&.java Graphics*\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Change to the Root Directory of the Package\fR
++.PP
++This is useful for documenting individual source files from different subpackages off of the same root\&. Change to the package root directory, and supply the source files with paths from the root\&.
++.sp
++.nf
++\f3cd /home/src/\fP
++.fi
++.nf
++\f3javadoc \-d /home/html java/awt/Button\&.java java/applet/Applet\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Document Files from Any Directory\fR
++.PP
++In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command with the absolute path (or path relative to the current directory) to the source files you want to document\&.
++.sp
++.nf
++\f3javadoc \-d /home/html /home/src/java/awt/Button\&.java\fP
++.fi
++.nf
++\f3/home/src/java/awt/Graphics*\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Document Packages and Classes
++
++You can document entire packages and individual classes at the same time\&. Here is an example that mixes two of the previous examples\&. You can use the \f3-sourcepath\fR option for the path to the packages but not for the path to the individual classes\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt\fP
++.fi
++.nf
++\f3/home/src/java/applet/Applet\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS REAL-WORLD\ EXAMPLES
++The following command-line and \f3makefile\fR versions of the \f3javadoc\fR command run on the Java platform APIs\&. It uses 180 MB of memory to generate the documentation for the 1500 (approximately) public and protected classes in the Java SE 1\&.2\&. Both examples use absolute paths in the option arguments, so that the same \f3javadoc\fR command can be run from any directory\&.
++.PP
++Command-Line Example
++
++The following command might be too long for some shells\&. You can use a command-line argument file (or write a shell script) to overcome this limitation\&.
++.PP
++In the example, \f3packages\fR is the name of a file that contains the packages to process, such as \f3java\&.applet\fR\f3java\&.lang\fR\&. None of the options should contain any newline characters between the single quotation marks\&. For example, if you copy and paste this example, then delete the newline characters from the \f3-bottom\fR option\&.
++.sp
++.nf
++\f3javadoc \-sourcepath /java/jdk/src/share/classes \e\fP
++.fi
++.nf
++\f3\-overview /java/jdk/src/share/classes/overview\&.html \e\fP
++.fi
++.nf
++\f3\-d /java/jdk/build/api \e\fP
++.fi
++.nf
++\f3\-use \e\fP
++.fi
++.nf
++\f3\-splitIndex \e\fP
++.fi
++.nf
++\f3\-windowtitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
++.fi
++.nf
++\f3\-doctitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
++.fi
++.nf
++\f3\-header \&'<b>Java\(tm SE 7</b>\&' \e\fP
++.fi
++.nf
++\f3\-bottom \&'<font size="\-1">\fP
++.fi
++.nf
++\f3<a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
++.fi
++.nf
++\f3Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3Other names may be trademarks of their respective owners\&.</font>\&' \e\fP
++.fi
++.nf
++\f3\-group "Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*" \e\fP
++.fi
++.nf
++\f3\-group "Extension Packages" "javax\&.*" \e\fP
++.fi
++.nf
++\f3\-J\-Xmx180m \e \fP
++.fi
++.nf
++\f3@packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Programmatic Interface
++
++The Javadoc Access API enables the user to invoke the Javadoc tool directly from a Java application without executing a new process\&.
++.PP
++For example, the following statements are equivalent to the command \f3javadoc -d /home/html -sourcepath /home/src -subpackages java -exclude java\&.net:java\&.lang com\&.example\fR:
++.sp
++.nf
++\f3import javax\&.tools\&.DocumentationTool;\fP
++.fi
++.nf
++\f3import javax\&.tools\&.ToolProvider;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class JavaAccessSample{\fP
++.fi
++.nf
++\f3 public static void main(String[] args){\fP
++.fi
++.nf
++\f3 DocumentationTool javadoc = ToolProvider\&.getSystemDocumentationTool();\fP
++.fi
++.nf
++\f3 int rc = javadoc\&.run( null, null, null,\fP
++.fi
++.nf
++\f3 "\-d", "/home/html",\fP
++.fi
++.nf
++\f3 "\-sourcepath", "home/src",\fP
++.fi
++.nf
++\f3 "\-subpackages", "java",\fP
++.fi
++.nf
++\f3 "\-exclude", "java\&.net:java\&.lang",\fP
++.fi
++.nf
++\f3 "com\&.example");\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The first three arguments of the \f3run\fR method specify input, standard output, and standard error streams\&. \f3Null\fR is the default value for \f3System\&.in\fR, \f3System\&.out\fR, and \f3System\&.err\fR, respectively\&.
++.SS THE\ MAKEFILE\ EXAMPLE
++This is an example of a GNU \f3makefile\fR\&. Single quotation marks surround \f3makefile\fR arguments\&. For an example of a Windows \f3makefile\fR, see the \f3makefiles\fR section of the Javadoc FAQ at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html#makefiles
++.sp
++.nf
++\f3javadoc \-sourcepath $(SRCDIR) \e /* Sets path for source files */\fP
++.fi
++.nf
++\f3 \-overview $(SRCDIR)/overview\&.html \e /* Sets file for overview text */\fP
++.fi
++.nf
++\f3 \-d /java/jdk/build/api \e /* Sets destination directory */\fP
++.fi
++.nf
++\f3 \-use \e /* Adds "Use" files */\fP
++.fi
++.nf
++\f3 \-splitIndex \e /* Splits index A\-Z */\fP
++.fi
++.nf
++\f3 \-windowtitle $(WINDOWTITLE) \e /* Adds a window title */\fP
++.fi
++.nf
++\f3 \-doctitle $(DOCTITLE) \e /* Adds a doc title */\fP
++.fi
++.nf
++\f3 \-header $(HEADER) \e /* Adds running header text */\fP
++.fi
++.nf
++\f3 \-bottom $(BOTTOM) \e /* Adds text at bottom */\fP
++.fi
++.nf
++\f3 \-group $(GROUPCORE) \e /* 1st subhead on overview page */\fP
++.fi
++.nf
++\f3 \-group $(GROUPEXT) \e /* 2nd subhead on overview page */\fP
++.fi
++.nf
++\f3 \-J\-Xmx180m \e /* Sets memory to 180MB */\fP
++.fi
++.nf
++\f3 java\&.lang java\&.lang\&.reflect \e /* Sets packages to document */\fP
++.fi
++.nf
++\f3 java\&.util java\&.io java\&.net \e\fP
++.fi
++.nf
++\f3 java\&.applet\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3WINDOWTITLE = \&'Java\(tm SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3DOCTITLE = \&'Java\(tm Platform Standard Edition 7 API Specification\&'\fP
++.fi
++.nf
++\f3HEADER = \&'<b>Java\(tm SE 7</font>\&'\fP
++.fi
++.nf
++\f3BOTTOM = \&'<font size="\-1">\fP
++.fi
++.nf
++\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
++.fi
++.nf
++\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3 Other names may be trademarks of their respective owners\&.</font>\&'\fP
++.fi
++.nf
++\f3GROUPCORE = \&'"Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*"\&'\fP
++.fi
++.nf
++\f3GROUPEXT = \&'"Extension Packages" "javax\&.*"\&'\fP
++.fi
++.nf
++\f3SRCDIR = \&'/java/jdk/1\&.7\&.0/src/share/classes\&'\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS NOTES
++.TP 0.2i
++\(bu
++If you omit the \f3-windowtitle\fR option, then the \f3javadoc\fR command copies the document title to the window title\&. The \f3-windowtitle\fR option text is similar to the the \f3-doctitle\fR option, but without HTML tags to prevent those tags from appearing as raw text in the window title\&.
++.TP 0.2i
++\(bu
++If you omit the \f3-footer\fR option, then the \f3javadoc\fR command copies the header text to the footer\&.
++.TP 0.2i
++\(bu
++Other important options you might want to use, but were not needed in the previous example, are the \f3-classpath\fR and \f3-link\fR options\&.
++.SH GENERAL\ TROUBLESHOOTING
++.TP 0.2i
++\(bu
++The \f3javadoc\fR command reads only files that contain valid class names\&. If the \f3javadoc\fR command is not correctly reading the contents of a file, then verify that the class names are valid\&. See Process Source Files\&.
++.TP 0.2i
++\(bu
++See the Javadoc FAQ for information about common bugs and for troubleshooting tips at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html
++.SH ERRORS\ AND\ WARNINGS
++Error and warning messages contain the file name and line number to the declaration line rather than to the particular line in the documentation comment\&.
++.PP
++For example, this message \f3error: cannot read: Class1\&.java\fR means that the \f3javadoc\fR command is trying to load \f3Class1\&.jav\fR\f3a\fR in the current directory\&. The class name is shown with its path (absolute or relative)\&.
++.SH ENVIRONMENT
++.TP
++CLASSPATH
++\f3CLASSPATH\fR is the environment variable that provides the path that the \f3javadoc\fR command uses to find user class files\&. This environment variable is overridden by the \f3-classpath\fR option\&. Separate directories with a semicolon for Windows or a colon for Oracle Solaris\&.
++
++\fIWindows example\fR: \f3\&.;C:\eclasses;C:\ehome\ejava\eclasses\fR
++
++\fIOracle Solaris example\fR: \f3\&.:/home/classes:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javap(1)
++.SH RELATED\ DOCUMENTS
++.TP 0.2i
++\(bu
++Javadoc Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/index\&.html
++.TP 0.2i
++\(bu
++How Classes Are Found http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++.TP 0.2i
++\(bu
++How to Write Doc Comments for the Javadoc Tool http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html
++.TP 0.2i
++\(bu
++URL Memo, Uniform Resource Locators http://www\&.ietf\&.org/rfc/rfc1738\&.txt
++.TP 0.2i
++\(bu
++HTML standard, HTML Document Representation (4197265 and 4137321) http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/javah.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/javah.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: javah.1
+-.\"
+-.if n .pl 99999
+-.TH javah 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: javah.1
++.\"
++.if n .pl 99999
++.TH javah 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,111 +47,111 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javah \- Generates C header and source files from a Java class\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavah\fR [ \fIoptions\fR ] f\fIully\-qualified\-class\-name \&.\&.\&.\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIfully-qualified-class-name\fR
+-The fully qualified location of the classes to be converted to C header and source files\&.
+-.SH DESCRIPTION
+-The \f3javah\fR command generates C header and source files that are needed to implement native methods\&. The generated header and source files are used by C programs to reference an object\&'s instance variables from native source code\&. The \f3\&.h\fR file contains a \f3struct\fR definition with a layout that parallels the layout of the corresponding class\&. The fields in the \f3struct\fR correspond to instance variables in the class\&.
+-.PP
+-The name of the header file and the structure declared within it are derived from the name of the class\&. When the class passed to the \f3javah\fR command is inside a package, the package name is added to the beginning of both the header file name and the structure name\&. Underscores (_) are used as name delimiters\&.
+-.PP
+-By default the \f3javah\fR command creates a header file for each class listed on the command line and puts the files in the current directory\&. Use the \f3-stubs\fR option to create source files\&. Use the \f3-o\fR option to concatenate the results for all listed classes into a single file\&.
+-.PP
+-The Java Native Interface (JNI) does not require header information or stub files\&. The \f3javah\fR command can still be used to generate native method function prototypes needed for JNI-style native methods\&. The \f3javah\fR command produces JNI-style output by default and places the result in the \f3\&.h\fR file\&.
+-.SH OPTIONS
+-.TP
+--o \fIoutputfile\fR
+-.br
+-Concatenates the resulting header or source files for all the classes listed on the command line into an output file\&. Only one of \f3-o\fR or \f3-d\fR can be used\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Sets the directory where the \f3javah\fR command saves the header files or the stub files\&. Only one of \f3-d\fR or \f3-o\fR can be used\&.
+-.TP
+--stubs
+-.br
+-Causes the \f3javah\fR command to generate C declarations from the Java object file\&.
+-.TP
+--verbose
+-.br
+-Indicates verbose output and causes the \f3javah\fR command to print a message to \f3stdout\fR about the status of the generated files\&.
+-.TP
+--help
+-.br
+-Prints a help message for \f3javah\fR usage\&.
+-.TP
+--version
+-.br
+-Prints \f3javah\fR command release information\&.
+-.TP
+--jni
+-.br
+-Causes the \f3javah\fR command to create an output file containing JNI-style native method function prototypes\&. This is the default output; use of \f3-jni\fR is optional\&.
+-.TP
+--classpath \fIpath\fR
+-.br
+-Specifies the path the \f3javah\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons on Oracle Solaris and semicolons on Windows\&. The general format for path is:
+-
+-\fIOracle Solaris\fR:
+-
+-\&.:\fIyour-path\fR
+-
+-Example: \f3\&.:/home/avh/classes:/usr/local/java/classes\fR
+-
+-\fIWindows\fR:
+-
+-\&.;\fIyour-path\fR
+-
+-Example: \f3\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR
+-
+-As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
+-
+-For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JAR\fR, then the class path element \f3mydir/*\fR is expanded to a \f3A\fR\f3\&.jar:b\&.JAR\fR, except that the order of jar files is unspecified\&. All JAR files in the specified directory, including hidden ones, are included in the list\&. A class path entry that consists of * expands to a list of all the JAR files in the current directory\&. The \f3CLASSPATH\fR environment variable, where defined, is similarly expanded\&. Any class path wild card expansion occurs before the Java Virtual Machine (JVM) is started\&. A Java program will never see unexpanded wild cards except by querying the environment\&. For example, by calling \f3System\&.getenv("CLASSPATH")\fR\&.
+-.TP
+--bootclasspath \fIpath\fR
+-.br
+-Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre\elib\ert\&.jar\fR and several other JAR files\&.
+-.TP
+--old
+-.br
+-Specifies that old JDK 1\&.0-style header files should be generated\&.
+-.TP
+--force
+-.br
+-Specifies that output files should always be written\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
+-.TP 0.2i
+-\(bu
+-javadoc(1)
++
++.SH NAME
++javah \- Generates C header and source files from a Java class\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavah\fR [ \fIoptions\fR ] f\fIully\-qualified\-class\-name \&.\&.\&.\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIfully-qualified-class-name\fR
++The fully qualified location of the classes to be converted to C header and source files\&.
++.SH DESCRIPTION
++The \f3javah\fR command generates C header and source files that are needed to implement native methods\&. The generated header and source files are used by C programs to reference an object\&'s instance variables from native source code\&. The \f3\&.h\fR file contains a \f3struct\fR definition with a layout that parallels the layout of the corresponding class\&. The fields in the \f3struct\fR correspond to instance variables in the class\&.
++.PP
++The name of the header file and the structure declared within it are derived from the name of the class\&. When the class passed to the \f3javah\fR command is inside a package, the package name is added to the beginning of both the header file name and the structure name\&. Underscores (_) are used as name delimiters\&.
++.PP
++By default the \f3javah\fR command creates a header file for each class listed on the command line and puts the files in the current directory\&. Use the \f3-stubs\fR option to create source files\&. Use the \f3-o\fR option to concatenate the results for all listed classes into a single file\&.
++.PP
++The Java Native Interface (JNI) does not require header information or stub files\&. The \f3javah\fR command can still be used to generate native method function prototypes needed for JNI-style native methods\&. The \f3javah\fR command produces JNI-style output by default and places the result in the \f3\&.h\fR file\&.
++.SH OPTIONS
++.TP
++-o \fIoutputfile\fR
++.br
++Concatenates the resulting header or source files for all the classes listed on the command line into an output file\&. Only one of \f3-o\fR or \f3-d\fR can be used\&.
++.TP
++-d \fIdirectory\fR
++.br
++Sets the directory where the \f3javah\fR command saves the header files or the stub files\&. Only one of \f3-d\fR or \f3-o\fR can be used\&.
++.TP
++-stubs
++.br
++Causes the \f3javah\fR command to generate C declarations from the Java object file\&.
++.TP
++-verbose
++.br
++Indicates verbose output and causes the \f3javah\fR command to print a message to \f3stdout\fR about the status of the generated files\&.
++.TP
++-help
++.br
++Prints a help message for \f3javah\fR usage\&.
++.TP
++-version
++.br
++Prints \f3javah\fR command release information\&.
++.TP
++-jni
++.br
++Causes the \f3javah\fR command to create an output file containing JNI-style native method function prototypes\&. This is the default output; use of \f3-jni\fR is optional\&.
++.TP
++-classpath \fIpath\fR
++.br
++Specifies the path the \f3javah\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons on Oracle Solaris and semicolons on Windows\&. The general format for path is:
++
++\fIOracle Solaris\fR:
++
++\&.:\fIyour-path\fR
++
++Example: \f3\&.:/home/avh/classes:/usr/local/java/classes\fR
++
++\fIWindows\fR:
++
++\&.;\fIyour-path\fR
++
++Example: \f3\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR
++
++As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
++
++For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JAR\fR, then the class path element \f3mydir/*\fR is expanded to a \f3A\fR\f3\&.jar:b\&.JAR\fR, except that the order of jar files is unspecified\&. All JAR files in the specified directory, including hidden ones, are included in the list\&. A class path entry that consists of * expands to a list of all the JAR files in the current directory\&. The \f3CLASSPATH\fR environment variable, where defined, is similarly expanded\&. Any class path wild card expansion occurs before the Java Virtual Machine (JVM) is started\&. A Java program will never see unexpanded wild cards except by querying the environment\&. For example, by calling \f3System\&.getenv("CLASSPATH")\fR\&.
++.TP
++-bootclasspath \fIpath\fR
++.br
++Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre\elib\ert\&.jar\fR and several other JAR files\&.
++.TP
++-old
++.br
++Specifies that old JDK 1\&.0-style header files should be generated\&.
++.TP
++-force
++.br
++Specifies that output files should always be written\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javap(1)
++.TP 0.2i
++\(bu
++javadoc(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/javap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/javap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/jcmd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jcmd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2012, 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
+--- ./jdk/src/linux/doc/man/jconsole.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jconsole.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Troubleshooting, Profiling, Monitoring and Management Tools
+-.\" Title: jconsole.1
+-.\"
+-.if n .pl 99999
+-.TH jconsole 1 "21 November 2013" "JDK 8" "Java Troubleshooting, Profiling, Monitoring and Management Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Troubleshooting, Profiling, Monitoring and Management Tools
++.\" Title: jconsole.1
++.\"
++.if n .pl 99999
++.TH jconsole 1 "21 November 2013" "JDK 8" "Java Troubleshooting, Profiling, Monitoring and Management Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,65 +47,65 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jconsole \- Starts a graphical console that lets you monitor and manage Java applications\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjconsole\fR [ \fIoptions\fR ] [ connection \&.\&.\&. ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR
+-The \f3pid\fR value is the process ID of a local Java Virtual Machine (JVM)\&. The JVM must be running with the same user ID as the user ID running the \f3jconsole\fR command\&.The \f3host:port\fR values are the name of the host system on which the JVM is running, and the port number specified by the system property \f3com\&.sun\&.management\&.jmxremote\&.port\fR when the JVM was started\&.The \f3jmxUrl\fR value is the address of the JMX agent to be connected to as described in JMXServiceURL\&.
+-
+-For more information about the \f3connection\fR parameter, see Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
+-
+-See also the \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
+-.SH DESCRIPTION
+-The \f3jconsole\fR command starts a graphical console tool that lets you monitor and manage Java applications and virtual machines on a local or remote machine\&.
+-.PP
+-On Windows, the \f3jconsole\fR command does not associate with a console window\&. It does, however, display a dialog box with error information when the \f3jconsole\fR command fails\&.
+-.SH OPTIONS
+-.TP
+--interval\fI=n\fR
+-.br
+-Sets the update interval to \fIn\fR seconds (default is 4 seconds)\&.
+-.TP
+--notile
+-.br
+-Does not tile windows initially (for two or more connections)\&.
+-.TP
+--pluginpath \fIplugins\fR
+-.br
+-Specifies a list of directories or JAR files to be searched for \f3JConsole\fR plug-ins\&. The \fIplugins\fR path should contain a provider-configuration file named \f3META-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR that contains one line for each plug-in\&. The line specifies the fully qualified class name of the class implementing the \f3com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR class\&.
+-.TP
+--version
+-.br
+-Displays release information and exits\&.
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the JVM on which the \f3jconsole\fR command is run\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Using JConsole at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html
+-.TP 0.2i
+-\(bu
+-Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
+-.TP 0.2i
+-\(bu
+-The \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
++
++.SH NAME
++jconsole \- Starts a graphical console that lets you monitor and manage Java applications\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjconsole\fR [ \fIoptions\fR ] [ connection \&.\&.\&. ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR
++The \f3pid\fR value is the process ID of a local Java Virtual Machine (JVM)\&. The JVM must be running with the same user ID as the user ID running the \f3jconsole\fR command\&.The \f3host:port\fR values are the name of the host system on which the JVM is running, and the port number specified by the system property \f3com\&.sun\&.management\&.jmxremote\&.port\fR when the JVM was started\&.The \f3jmxUrl\fR value is the address of the JMX agent to be connected to as described in JMXServiceURL\&.
++
++For more information about the \f3connection\fR parameter, see Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
++
++See also the \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
++.SH DESCRIPTION
++The \f3jconsole\fR command starts a graphical console tool that lets you monitor and manage Java applications and virtual machines on a local or remote machine\&.
++.PP
++On Windows, the \f3jconsole\fR command does not associate with a console window\&. It does, however, display a dialog box with error information when the \f3jconsole\fR command fails\&.
++.SH OPTIONS
++.TP
++-interval\fI=n\fR
++.br
++Sets the update interval to \fIn\fR seconds (default is 4 seconds)\&.
++.TP
++-notile
++.br
++Does not tile windows initially (for two or more connections)\&.
++.TP
++-pluginpath \fIplugins\fR
++.br
++Specifies a list of directories or JAR files to be searched for \f3JConsole\fR plug-ins\&. The \fIplugins\fR path should contain a provider-configuration file named \f3META-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR that contains one line for each plug-in\&. The line specifies the fully qualified class name of the class implementing the \f3com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR class\&.
++.TP
++-version
++.br
++Displays release information and exits\&.
++.TP
++-help
++.br
++Displays a help message\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the JVM on which the \f3jconsole\fR command is run\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Using JConsole at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html
++.TP 0.2i
++\(bu
++Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
++.TP 0.2i
++\(bu
++The \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jdb.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jdb.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1995, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jdb.1
+-.\"
+-.if n .pl 99999
+-.TH jdb 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jdb.1
++.\"
++.if n .pl 99999
++.TH jdb 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,223 +47,223 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jdb \- Finds and fixes bugs in Java platform programs\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjdb\fR [\fIoptions\fR] [\fIclassname\fR] [\fIarguments\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIclass\fRname
+-Name of the main class to debug\&.
+-.TP
+-\fIarguments\fR
+-Arguments passed to the \f3main()\fR method of the class\&.
+-.SH DESCRIPTION
+-The Java Debugger (JDB) is a simple command-line debugger for Java classes\&. The \f3jdb\fR command and its options call the JDB\&. The \f3jdb\fR command demonstrates the Java Platform Debugger Architecture (JDBA) and provides inspection and debugging of a local or remote Java Virtual Machine (JVM)\&. See Java Platform Debugger Architecture (JDBA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
+-.SS START\ A\ JDB\ SESSION
+-There are many ways to start a JDB session\&. The most frequently used way is to have JDB launch a new JVM with the main class of the application to be debugged\&. Do this by substituting the \f3jdb\fR command for the \f3java\fR command in the command line\&. For example, if your application\&'s main class is \f3MyClass\fR, then use the following command to debug it under JDB:
+-.sp
+-.nf
+-\f3jdb MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When started this way, the \f3jdb\fR command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class\&'s first instruction\&.
+-.PP
+-Another way to use the \f3jdb\fR command is by attaching it to a JVM that is already running\&. Syntax for starting a JVM to which the \f3jdb\fR command attaches when the JVM is running is as follows\&. This loads in-process debugging libraries and specifies the kind of connection to be made\&.
+-.sp
+-.nf
+-\f3java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-You can then attach the \f3jdb\fR command to the JVM with the following command:
+-.sp
+-.nf
+-\f3jdb \-attach 8000\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3MyClass\fR argument is not specified in the \f3jdb\fR command line in this case because the \f3jdb\fR command is connecting to an existing JVM instead of launching a new JVM\&.
+-.PP
+-There are many other ways to connect the debugger to a JVM, and all of them are supported by the \f3jdb\fR command\&. The Java Platform Debugger Architecture has additional documentation on these connection options\&.
+-.SS BASIC\ JDB\ COMMANDS
+-The following is a list of the basic \f3jdb\fR commands\&. The JDB supports other commands that you can list with the \f3-help\fR option\&.
+-.TP
+-help or ?
+-The \f3help\fR or \f3?\fR commands display the list of recognized commands with a brief description\&.
+-.TP
+-run
+-After you start JDB and set breakpoints, you can use the \f3run\fR command to execute the debugged application\&. The \f3run\fR command is available only when the \f3jdb\fR command starts the debugged application as opposed to attaching to an existing JVM\&.
+-.TP
+-cont
+-Continues execution of the debugged application after a breakpoint, exception, or step\&.
+-.TP
+-print
+-Displays Java objects and primitive values\&. For variables or fields of primitive types, the actual value is printed\&. For objects, a short description is printed\&. See the dump command to find out how to get more information about an object\&.
+-
+-\fINote:\fR To display local variables, the containing class must have been compiled with the \f3javac -g\fR option\&.
+-
+-The \f3print\fR command supports many simple Java expressions including those with method invocations, for example:
+-.sp
+-.nf
+-\f3print MyClass\&.myStaticField\fP
+-.fi
+-.nf
+-\f3print myObj\&.myInstanceField\fP
+-.fi
+-.nf
+-\f3print i + j + k (i, j, k are primities and either fields or local variables)\fP
+-.fi
+-.nf
+-\f3print myObj\&.myMethod() (if myMethod returns a non\-null)\fP
+-.fi
+-.nf
+-\f3print new java\&.lang\&.String("Hello")\&.length()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-dump
+-For primitive values, the \f3dump\fR command is identical to the \f3print\fR command\&. For objects, the \f3dump\fR command prints the current value of each field defined in the object\&. Static and instance fields are included\&. The \f3dump\fR command supports the same set of expressions as the \f3print\fR command\&.
+-.TP
+-threads
+-List the threads that are currently running\&. For each thread, its name and current status are printed and an index that can be used in other commands\&. In this example, the thread index is 4, the thread is an instance of \f3java\&.lang\&.Thread\fR, the thread name is \f3main\fR, and it is currently running\&.
+-.sp
+-.nf
+-\f34\&. (java\&.lang\&.Thread)0x1 main running\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-thread
+-Select a thread to be the current thread\&. Many \f3jdb\fR commands are based on the setting of the current thread\&. The thread is specified with the thread index described in the threads command\&.
+-.TP
+-where
+-The \f3where\fR command with no arguments dumps the stack of the current thread\&. The \f3where\fR\f3all\fR command dumps the stack of all threads in the current thread group\&. The \f3where\fR\f3threadindex\fR command dumps the stack of the specified thread\&.
+-
+-If the current thread is suspended either through an event such as a breakpoint or through the \f3suspend\fR command, then local variables and fields can be displayed with the \f3print\fR and \f3dump\fR commands\&. The \f3up\fR and \f3down\fR commands select which stack frame is the current stack frame\&.
+-.SS BREAKPOINTS
+-Breakpoints can be set in JDB at line numbers or at the first instruction of a method, for example:
+-.TP 0.2i
+-\(bu
+-The command \f3stop at MyClass:22\fR sets a breakpoint at the first instruction for line 22 of the source file containing \f3MyClass\fR\&.
+-.TP 0.2i
+-\(bu
+-The command \f3stop in java\&.lang\&.String\&.length\fR sets a breakpoint at the beginning of the method \f3java\&.lang\&.String\&.length\fR\&.
+-.TP 0.2i
+-\(bu
+-The command \f3stop in MyClass\&.<clinit>\fR uses \f3<clinit>\fR to identify the static initialization code for \f3MyClass\fR\&.
+-.PP
+-When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint\&. For example, \f3MyClass\&.myMethod(int,java\&.lang\&.String)\fR or \f3MyClass\&.myMethod()\fR\&.
+-.PP
+-The \f3clear\fR command removes breakpoints using the following syntax: \f3clear MyClass:45\fR\&. Using the \f3clear\fR or \f3stop\fR command with no argument displays a list of all breakpoints currently set\&. The \f3cont\fR command continues execution\&.
+-.SS STEPPING
+-The \f3step\fR command advances execution to the next line whether it is in the current stack frame or a called method\&. The \f3next\fR command advances execution to the next line in the current stack frame\&.
+-.SS EXCEPTIONS
+-When an exception occurs for which there is not a \f3catch\fR statement anywhere in the throwing thread\&'s call stack, the JVM typically prints an exception trace and exits\&. When running under JDB, however, control returns to JDB at the offending throw\&. You can then use the \f3jdb\fR command to diagnose the cause of the exception\&.
+-.PP
+-Use the \f3catch\fR command to cause the debugged application to stop at other thrown exceptions, for example: \f3catch java\&.io\&.FileNotFoundException\fR or \f3catch\fR\f3mypackage\&.BigTroubleException\fR\&. Any exception that is an instance of the specified class or subclass stops the application at the point where it is thrown\&.
+-.PP
+-The \f3ignore\fR command negates the effect of an earlier \f3catch\fR command\&. The \f3ignore\fR command does not cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger\&.
+-.SH OPTIONS
+-When you use the \f3jdb\fR command instead of the \f3java\fR command on the command line, the \f3jdb\fR command accepts many of the same options as the \f3java\fR command, including \f3-D\fR, \f3-classpath\fR, and \f3-X\fR options\&. The following list contains additional options that are accepted by the \f3jdb\fR command\&.
+-.PP
+-Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM it is to debug\&. For additional documentation about these connection alternatives, see Java Platform Debugger Architecture (JPDA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.TP
+--sourcepath \fIdir1:dir2: \&. \&. \&.\fR
+-.br
+-Uses the specified path to search for source files in the specified path\&. If this option is not specified, then use the default path of dot (\&.)\&.
+-.TP
+--attach \fIaddress\fR
+-.br
+-Attaches the debugger to a running JVM with the default connection mechanism\&.
+-.TP
+--listen \fIaddress\fR
+-.br
+-Waits for a running JVM to connect to the specified address with a standard connector\&.
+-.TP
+--launch
+-.br
+-Starts the debugged application immediately upon startup of JDB\&. The \f3-launch\fR option removes the need for the \f3run\fR command\&. The debugged application is launched and then stopped just before the initial application class is loaded\&. At that point, you can set any necessary breakpoints and use the \f3cont\fR command to continue execution\&.
+-.TP
+--listconnectors
+-.br
+-List the connectors available in this JVM\&.
+-.TP
+--connect connector-name:\fIname1=value1\fR
+-.br
+-Connects to the target JVM with the named connector and listed argument values\&.
+-.TP
+--dbgtrace [\fIflags\fR]
+-.br
+-Prints information for debugging the \f3jdb\fR command\&.
+-.TP
+--tclient
+-.br
+-Runs the application in the Java HotSpot VM client\&.
+-.TP
+--tserver
+-.br
+-Runs the application in the Java HotSpot VM server\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH OPTIONS\ FORWARDED\ TO\ THE\ DEBUGGER\ PROCESS
+-.TP
+--v -verbose[:\fIclass\fR|gc|jni]
+-.br
+-Turns on verbose mode\&.
+-.TP
+--D\fIname\fR=\fIvalue\fR
+-.br
+-Sets a system property\&.
+-.TP
+--classpath \fIdir\fR
+-.br
+-Lists directories separated by colons in which to look for classes\&.
+-.TP
+--X\fIoption\fR
+-.br
+-Nonstandard target JVM option\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
++
++.SH NAME
++jdb \- Finds and fixes bugs in Java platform programs\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjdb\fR [\fIoptions\fR] [\fIclassname\fR] [\fIarguments\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIclass\fRname
++Name of the main class to debug\&.
++.TP
++\fIarguments\fR
++Arguments passed to the \f3main()\fR method of the class\&.
++.SH DESCRIPTION
++The Java Debugger (JDB) is a simple command-line debugger for Java classes\&. The \f3jdb\fR command and its options call the JDB\&. The \f3jdb\fR command demonstrates the Java Platform Debugger Architecture (JDBA) and provides inspection and debugging of a local or remote Java Virtual Machine (JVM)\&. See Java Platform Debugger Architecture (JDBA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
++.SS START\ A\ JDB\ SESSION
++There are many ways to start a JDB session\&. The most frequently used way is to have JDB launch a new JVM with the main class of the application to be debugged\&. Do this by substituting the \f3jdb\fR command for the \f3java\fR command in the command line\&. For example, if your application\&'s main class is \f3MyClass\fR, then use the following command to debug it under JDB:
++.sp
++.nf
++\f3jdb MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When started this way, the \f3jdb\fR command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class\&'s first instruction\&.
++.PP
++Another way to use the \f3jdb\fR command is by attaching it to a JVM that is already running\&. Syntax for starting a JVM to which the \f3jdb\fR command attaches when the JVM is running is as follows\&. This loads in-process debugging libraries and specifies the kind of connection to be made\&.
++.sp
++.nf
++\f3java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++You can then attach the \f3jdb\fR command to the JVM with the following command:
++.sp
++.nf
++\f3jdb \-attach 8000\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3MyClass\fR argument is not specified in the \f3jdb\fR command line in this case because the \f3jdb\fR command is connecting to an existing JVM instead of launching a new JVM\&.
++.PP
++There are many other ways to connect the debugger to a JVM, and all of them are supported by the \f3jdb\fR command\&. The Java Platform Debugger Architecture has additional documentation on these connection options\&.
++.SS BASIC\ JDB\ COMMANDS
++The following is a list of the basic \f3jdb\fR commands\&. The JDB supports other commands that you can list with the \f3-help\fR option\&.
++.TP
++help or ?
++The \f3help\fR or \f3?\fR commands display the list of recognized commands with a brief description\&.
++.TP
++run
++After you start JDB and set breakpoints, you can use the \f3run\fR command to execute the debugged application\&. The \f3run\fR command is available only when the \f3jdb\fR command starts the debugged application as opposed to attaching to an existing JVM\&.
++.TP
++cont
++Continues execution of the debugged application after a breakpoint, exception, or step\&.
++.TP
++print
++Displays Java objects and primitive values\&. For variables or fields of primitive types, the actual value is printed\&. For objects, a short description is printed\&. See the dump command to find out how to get more information about an object\&.
++
++\fINote:\fR To display local variables, the containing class must have been compiled with the \f3javac -g\fR option\&.
++
++The \f3print\fR command supports many simple Java expressions including those with method invocations, for example:
++.sp
++.nf
++\f3print MyClass\&.myStaticField\fP
++.fi
++.nf
++\f3print myObj\&.myInstanceField\fP
++.fi
++.nf
++\f3print i + j + k (i, j, k are primities and either fields or local variables)\fP
++.fi
++.nf
++\f3print myObj\&.myMethod() (if myMethod returns a non\-null)\fP
++.fi
++.nf
++\f3print new java\&.lang\&.String("Hello")\&.length()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++dump
++For primitive values, the \f3dump\fR command is identical to the \f3print\fR command\&. For objects, the \f3dump\fR command prints the current value of each field defined in the object\&. Static and instance fields are included\&. The \f3dump\fR command supports the same set of expressions as the \f3print\fR command\&.
++.TP
++threads
++List the threads that are currently running\&. For each thread, its name and current status are printed and an index that can be used in other commands\&. In this example, the thread index is 4, the thread is an instance of \f3java\&.lang\&.Thread\fR, the thread name is \f3main\fR, and it is currently running\&.
++.sp
++.nf
++\f34\&. (java\&.lang\&.Thread)0x1 main running\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++thread
++Select a thread to be the current thread\&. Many \f3jdb\fR commands are based on the setting of the current thread\&. The thread is specified with the thread index described in the threads command\&.
++.TP
++where
++The \f3where\fR command with no arguments dumps the stack of the current thread\&. The \f3where\fR\f3all\fR command dumps the stack of all threads in the current thread group\&. The \f3where\fR\f3threadindex\fR command dumps the stack of the specified thread\&.
++
++If the current thread is suspended either through an event such as a breakpoint or through the \f3suspend\fR command, then local variables and fields can be displayed with the \f3print\fR and \f3dump\fR commands\&. The \f3up\fR and \f3down\fR commands select which stack frame is the current stack frame\&.
++.SS BREAKPOINTS
++Breakpoints can be set in JDB at line numbers or at the first instruction of a method, for example:
++.TP 0.2i
++\(bu
++The command \f3stop at MyClass:22\fR sets a breakpoint at the first instruction for line 22 of the source file containing \f3MyClass\fR\&.
++.TP 0.2i
++\(bu
++The command \f3stop in java\&.lang\&.String\&.length\fR sets a breakpoint at the beginning of the method \f3java\&.lang\&.String\&.length\fR\&.
++.TP 0.2i
++\(bu
++The command \f3stop in MyClass\&.<clinit>\fR uses \f3<clinit>\fR to identify the static initialization code for \f3MyClass\fR\&.
++.PP
++When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint\&. For example, \f3MyClass\&.myMethod(int,java\&.lang\&.String)\fR or \f3MyClass\&.myMethod()\fR\&.
++.PP
++The \f3clear\fR command removes breakpoints using the following syntax: \f3clear MyClass:45\fR\&. Using the \f3clear\fR or \f3stop\fR command with no argument displays a list of all breakpoints currently set\&. The \f3cont\fR command continues execution\&.
++.SS STEPPING
++The \f3step\fR command advances execution to the next line whether it is in the current stack frame or a called method\&. The \f3next\fR command advances execution to the next line in the current stack frame\&.
++.SS EXCEPTIONS
++When an exception occurs for which there is not a \f3catch\fR statement anywhere in the throwing thread\&'s call stack, the JVM typically prints an exception trace and exits\&. When running under JDB, however, control returns to JDB at the offending throw\&. You can then use the \f3jdb\fR command to diagnose the cause of the exception\&.
++.PP
++Use the \f3catch\fR command to cause the debugged application to stop at other thrown exceptions, for example: \f3catch java\&.io\&.FileNotFoundException\fR or \f3catch\fR\f3mypackage\&.BigTroubleException\fR\&. Any exception that is an instance of the specified class or subclass stops the application at the point where it is thrown\&.
++.PP
++The \f3ignore\fR command negates the effect of an earlier \f3catch\fR command\&. The \f3ignore\fR command does not cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger\&.
++.SH OPTIONS
++When you use the \f3jdb\fR command instead of the \f3java\fR command on the command line, the \f3jdb\fR command accepts many of the same options as the \f3java\fR command, including \f3-D\fR, \f3-classpath\fR, and \f3-X\fR options\&. The following list contains additional options that are accepted by the \f3jdb\fR command\&.
++.PP
++Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM it is to debug\&. For additional documentation about these connection alternatives, see Java Platform Debugger Architecture (JPDA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
++.TP
++-help
++.br
++Displays a help message\&.
++.TP
++-sourcepath \fIdir1:dir2: \&. \&. \&.\fR
++.br
++Uses the specified path to search for source files in the specified path\&. If this option is not specified, then use the default path of dot (\&.)\&.
++.TP
++-attach \fIaddress\fR
++.br
++Attaches the debugger to a running JVM with the default connection mechanism\&.
++.TP
++-listen \fIaddress\fR
++.br
++Waits for a running JVM to connect to the specified address with a standard connector\&.
++.TP
++-launch
++.br
++Starts the debugged application immediately upon startup of JDB\&. The \f3-launch\fR option removes the need for the \f3run\fR command\&. The debugged application is launched and then stopped just before the initial application class is loaded\&. At that point, you can set any necessary breakpoints and use the \f3cont\fR command to continue execution\&.
++.TP
++-listconnectors
++.br
++List the connectors available in this JVM\&.
++.TP
++-connect connector-name:\fIname1=value1\fR
++.br
++Connects to the target JVM with the named connector and listed argument values\&.
++.TP
++-dbgtrace [\fIflags\fR]
++.br
++Prints information for debugging the \f3jdb\fR command\&.
++.TP
++-tclient
++.br
++Runs the application in the Java HotSpot VM client\&.
++.TP
++-tserver
++.br
++Runs the application in the Java HotSpot VM server\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH OPTIONS\ FORWARDED\ TO\ THE\ DEBUGGER\ PROCESS
++.TP
++-v -verbose[:\fIclass\fR|gc|jni]
++.br
++Turns on verbose mode\&.
++.TP
++-D\fIname\fR=\fIvalue\fR
++.br
++Sets a system property\&.
++.TP
++-classpath \fIdir\fR
++.br
++Lists directories separated by colons in which to look for classes\&.
++.TP
++-X\fIoption\fR
++.br
++Nonstandard target JVM option\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javap(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jdeps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jdeps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jdeps.1
+-.\"
+-.if n .pl 99999
+-.TH jdeps 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jdeps.1
++.\"
++.if n .pl 99999
++.TH jdeps 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,490 +47,490 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jdeps \- Java class dependency analyzer\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjdeps\fR [\fIoptions\fR] \fIclasses\fR \&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIclasses\fR
+-Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
+-.SH DESCRIPTION
+-The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
+-.SH OPTIONS
+-.TP
+--dotoutput <\fIdir\fR>
+-.br
+-Destination directory for DOT file output\&. If specified, \f3jdeps\fR will generate one dot file per each analyzed archive named <\fIarchive-file-name\fR>\&.dot listing the dependencies, and also a summary file named summary\&.dot listing the dependencies among the archives\&.
+-.TP
+--s, -summary
+-.br
+-Prints dependency summary only\&.
+-.TP
+--v, -verbose
+-.br
+-Prints all class-level dependencies\&.
+-.TP
+--verbose:package
+-.br
+-Prints package-level dependencies excluding dependencies within the same archive\&.
+-.TP
+--verbose:class
+-.br
+-Prints class-level dependencies excluding dependencies within the same archive\&.
+-.TP
+--cp <\fIpath\fR>, -classpath <\fIpath\fR>
+-.br
+-Specifies where to find class files\&.
+-
+-See also Setting the Class Path\&.
+-.TP
+--p <\fIpkg name\fR>, -package <\fIpkg name\fR>
+-.br
+-Finds dependencies in the specified package\&. You can specify this option multiple times for different packages\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
+-.TP
+--e <\fIregex\fR>, -regex <\fIregex\fR>
+-.br
+-Finds dependencies in packages matching the specified regular expression pattern\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
+-.TP
+--include <\fIregex\fR>
+-.br
+-Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
+-.TP
+--jdkinternals
+-.br
+-Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
+-
+-\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
+-.TP
+--P, -profile
+-.br
+-Shows profile or the file containing a package\&.
+-.TP
+--apionly
+-.br
+-Restricts analysis to APIs, for example, dependences from the signature of \f3public\fR and \f3protected\fR members of public classes including field type, method parameter types, returned type, and checked exception types\&.
+-.TP
+--R, -recursive
+-.br
+-Recursively traverses all dependencies\&.
+-.TP
+--version
+-.br
+-Prints version information\&.
+-.TP
+--h, -?, -help
+-.br
+-Prints help message for \f3jdeps\fR\&.
+-.SH EXAMPLES
+-Analyzing the dependencies of Notepad\&.jar\&.
+-.sp
+-.nf
+-\f3$ jdeps demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 <unnamed> (Notepad\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt \fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt\&.event \fP
+-.fi
+-.nf
+-\f3 \-> java\&.beans \fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.net \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.logging \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.border \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.event \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.text \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.tree \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.undo \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use -P or -profile option to show on which profile that Notepad depends\&.
+-.sp
+-.nf
+-\f3$ jdeps \-profile demo/jfc/Notepad/Notepad\&.jar \fP
+-.fi
+-.nf
+-\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE)\fP
+-.fi
+-.nf
+-\f3 <unnamed> (Notepad\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt\&.event Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.beans Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.net compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.util compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.logging compact1\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.border Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.event Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.text Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.tree Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.undo Full JRE\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Analyzing the immediate dependencies of a specific class in a given classpath, for example the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class in the tools\&.jar file\&.
+-.sp
+-.nf
+-\f3$ jdeps \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use the \f3-verbose:class\fR option to find class-level dependencies or use the \f3-v\fR or \f3-verbose\fR option to include dependencies from the same JAR file\&.
+-.sp
+-.nf
+-\f3$ jdeps \-verbose:class \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps\&.Main (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io\&.PrintWriter \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.Exception \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.Object \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.String \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.System \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use the \f3-R\fR or \f3-recursive\fR option to analyze the transitive dependencies of the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class\&.
+-.sp
+-.nf
+-\f3$ jdeps \-R \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.classfile (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.reflect \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.charset \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file\&.attribute \fP
+-.fi
+-.nf
+-\f3 \-> java\&.text \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.jar \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.zip \fP
+-.fi
+-.nf
+-\f3/usr/java/jre/lib/jce\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 javax\&.crypto (jce\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.reflect \fP
+-.fi
+-.nf
+-\f3 \-> java\&.net \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.cert \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.spec \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.concurrent \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.jar \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.zip \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.security\&.auth \fP
+-.fi
+-.nf
+-\f3 \-> sun\&.security\&.jca JDK internal API (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> sun\&.security\&.util JDK internal API (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 javax\&.crypto\&.spec (jce\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.spec \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3/usr/java/jre/lib/rt\&.jar \-> /usr/java/jre/lib/jce\&.jar\fP
+-.fi
+-.nf
+-\f3 java\&.security (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.crypto\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Generate dot files of the dependencies of Notepad demo\&.
+-.sp
+-.nf
+-\f3$ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3jdeps\fR will create one dot file for each given JAR file named <\fIfilename\fR>\&.dot in the dot directory specified in the \f3-dotoutput\fR option, and also a summary file named summary\&.dot that will list the dependencies among the JAR files
+-.sp
+-.nf
+-\f3$ cat dot/Notepad\&.jar\&.dot \fP
+-.fi
+-.nf
+-\f3digraph "Notepad\&.jar" {\fP
+-.fi
+-.nf
+-\f3 // Path: demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.awt";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.awt\&.event";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.beans";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.io";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.lang";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.net";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.util";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.util\&.logging";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.border";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.event";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.text";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.tree";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.undo";\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3$ cat dot/summary\&.dot\fP
+-.fi
+-.nf
+-\f3digraph "summary" {\fP
+-.fi
+-.nf
+-\f3 "Notepad\&.jar" \-> "rt\&.jar";\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javap(1)
++
++.SH NAME
++jdeps \- Java class dependency analyzer\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjdeps\fR [\fIoptions\fR] \fIclasses\fR \&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIclasses\fR
++Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
++.SH DESCRIPTION
++The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
++.SH OPTIONS
++.TP
++-dotoutput <\fIdir\fR>
++.br
++Destination directory for DOT file output\&. If specified, \f3jdeps\fR will generate one dot file per each analyzed archive named <\fIarchive-file-name\fR>\&.dot listing the dependencies, and also a summary file named summary\&.dot listing the dependencies among the archives\&.
++.TP
++-s, -summary
++.br
++Prints dependency summary only\&.
++.TP
++-v, -verbose
++.br
++Prints all class-level dependencies\&.
++.TP
++-verbose:package
++.br
++Prints package-level dependencies excluding dependencies within the same archive\&.
++.TP
++-verbose:class
++.br
++Prints class-level dependencies excluding dependencies within the same archive\&.
++.TP
++-cp <\fIpath\fR>, -classpath <\fIpath\fR>
++.br
++Specifies where to find class files\&.
++
++See also Setting the Class Path\&.
++.TP
++-p <\fIpkg name\fR>, -package <\fIpkg name\fR>
++.br
++Finds dependencies in the specified package\&. You can specify this option multiple times for different packages\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
++.TP
++-e <\fIregex\fR>, -regex <\fIregex\fR>
++.br
++Finds dependencies in packages matching the specified regular expression pattern\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
++.TP
++-include <\fIregex\fR>
++.br
++Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
++.TP
++-jdkinternals
++.br
++Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
++
++\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
++.TP
++-P, -profile
++.br
++Shows profile or the file containing a package\&.
++.TP
++-apionly
++.br
++Restricts analysis to APIs, for example, dependences from the signature of \f3public\fR and \f3protected\fR members of public classes including field type, method parameter types, returned type, and checked exception types\&.
++.TP
++-R, -recursive
++.br
++Recursively traverses all dependencies\&.
++.TP
++-version
++.br
++Prints version information\&.
++.TP
++-h, -?, -help
++.br
++Prints help message for \f3jdeps\fR\&.
++.SH EXAMPLES
++Analyzing the dependencies of Notepad\&.jar\&.
++.sp
++.nf
++\f3$ jdeps demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 <unnamed> (Notepad\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.awt \fP
++.fi
++.nf
++\f3 \-> java\&.awt\&.event \fP
++.fi
++.nf
++\f3 \-> java\&.beans \fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.net \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.logging \fP
++.fi
++.nf
++\f3 \-> javax\&.swing \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.border \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.event \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.text \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.tree \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.undo \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use -P or -profile option to show on which profile that Notepad depends\&.
++.sp
++.nf
++\f3$ jdeps \-profile demo/jfc/Notepad/Notepad\&.jar \fP
++.fi
++.nf
++\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE)\fP
++.fi
++.nf
++\f3 <unnamed> (Notepad\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.awt Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.awt\&.event Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.beans Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.io compact1\fP
++.fi
++.nf
++\f3 \-> java\&.lang compact1\fP
++.fi
++.nf
++\f3 \-> java\&.net compact1\fP
++.fi
++.nf
++\f3 \-> java\&.util compact1\fP
++.fi
++.nf
++\f3 \-> java\&.util\&.logging compact1\fP
++.fi
++.nf
++\f3 \-> javax\&.swing Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.border Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.event Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.text Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.tree Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.undo Full JRE\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Analyzing the immediate dependencies of a specific class in a given classpath, for example the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class in the tools\&.jar file\&.
++.sp
++.nf
++\f3$ jdeps \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use the \f3-verbose:class\fR option to find class-level dependencies or use the \f3-v\fR or \f3-verbose\fR option to include dependencies from the same JAR file\&.
++.sp
++.nf
++\f3$ jdeps \-verbose:class \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps\&.Main (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io\&.PrintWriter \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.Exception \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.Object \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.String \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.System \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use the \f3-R\fR or \f3-recursive\fR option to analyze the transitive dependencies of the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class\&.
++.sp
++.nf
++\f3$ jdeps \-R \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.classfile (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.reflect \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.charset \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file\&.attribute \fP
++.fi
++.nf
++\f3 \-> java\&.text \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.jar \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.zip \fP
++.fi
++.nf
++\f3/usr/java/jre/lib/jce\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 javax\&.crypto (jce\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.reflect \fP
++.fi
++.nf
++\f3 \-> java\&.net \fP
++.fi
++.nf
++\f3 \-> java\&.nio \fP
++.fi
++.nf
++\f3 \-> java\&.security \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.cert \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.spec \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.concurrent \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.jar \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.zip \fP
++.fi
++.nf
++\f3 \-> javax\&.security\&.auth \fP
++.fi
++.nf
++\f3 \-> sun\&.security\&.jca JDK internal API (rt\&.jar)\fP
++.fi
++.nf
++\f3 \-> sun\&.security\&.util JDK internal API (rt\&.jar)\fP
++.fi
++.nf
++\f3 javax\&.crypto\&.spec (jce\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.spec \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3/usr/java/jre/lib/rt\&.jar \-> /usr/java/jre/lib/jce\&.jar\fP
++.fi
++.nf
++\f3 java\&.security (rt\&.jar)\fP
++.fi
++.nf
++\f3 \-> javax\&.crypto\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Generate dot files of the dependencies of Notepad demo\&.
++.sp
++.nf
++\f3$ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3jdeps\fR will create one dot file for each given JAR file named <\fIfilename\fR>\&.dot in the dot directory specified in the \f3-dotoutput\fR option, and also a summary file named summary\&.dot that will list the dependencies among the JAR files
++.sp
++.nf
++\f3$ cat dot/Notepad\&.jar\&.dot \fP
++.fi
++.nf
++\f3digraph "Notepad\&.jar" {\fP
++.fi
++.nf
++\f3 // Path: demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.awt";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.awt\&.event";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.beans";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.io";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.lang";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.net";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.util";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.util\&.logging";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.border";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.event";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.text";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.tree";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.undo";\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3$ cat dot/summary\&.dot\fP
++.fi
++.nf
++\f3digraph "summary" {\fP
++.fi
++.nf
++\f3 "Notepad\&.jar" \-> "rt\&.jar";\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javap(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jhat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jhat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2006, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jhat.1
+-.\"
+-.if n .pl 99999
+-.TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jhat.1
++.\"
++.if n .pl 99999
++.TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,89 +47,89 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIheap-dump-file\fR
+-Java binary heap dump file to be browsed\&. For a dump file that contains multiple heap dumps, you can specify which dump in the file by appending \f3#<number>\fR to the file name, for example, \f3myfile\&.hprof#3\fR\&.
+-.SH DESCRIPTION
+-The \f3jhat\fR command parses a Java heap dump file and starts a web server\&. The \f3jhat\fR command lets you to browse heap dumps with your favorite web browser\&. The \f3jhat\fR command supports predesigned queries such as show all instances of a known class \f3MyClass\fR, and Object Query Language (OQL)\&. OQL is similar to SQL, except for querying heap dumps\&. Help on OQL is available from the OQL help page shown by the \f3jhat\fR command\&. With the default port, OQL help is available at http://localhost:7000/oqlhelp/
+-.PP
+-There are several ways to generate a Java heap dump:
+-.TP 0.2i
+-\(bu
+-Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
+-.TP 0.2i
+-\(bu
+-Use the \f3jconsole\fR option to obtain a heap dump through \f3HotSpotDiagnosticMXBean\fR at runtime\&. See jconsole(1) and the \f3HotSpotDiagnosticMXBean\fR interface description at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html
+-.TP 0.2i
+-\(bu
+-Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&.
+-.TP 0.2i
+-\(bu
+-Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
+-.SH OPTIONS
+-.TP
+--stack false|true
+-.br
+-Turns off tracking object allocation call stack\&. If allocation site information is not available in the heap dump, then you have to set this flag to \f3false\fR\&. The default is \f3true\fR\&.
+-.TP
+--refs false|true
+-.br
+-Turns off tracking of references to objects\&. Default is \f3true\fR\&. By default, back pointers, which are objects that point to a specified object such as referrers or incoming references, are calculated for all objects in the heap\&.
+-.TP
+--port \fIport-number\fR
+-.br
+-Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
+-.TP
+--exclude \fIexclude-file\fR
+-.br
+-Specifies a file that lists data members that should be excluded from the reachable objects query\&. For example, if the file lists \f3java\&.lang\&.String\&.value\fR, then, then whenever the list of objects that are reachable from a specific object \f3o\fR are calculated, reference paths that involve \f3java\&.lang\&.String\&.value\fR field are not considered\&.
+-.TP
+--baseline \fIexclude-file\fR
+-.br
+-Specifies a baseline heap dump\&. Objects in both heap dumps with the same object ID are marked as not being new\&. Other objects are marked as new\&. This is useful for comparing two different heap dumps\&.
+-.TP
+--debug \fIint\fR
+-.br
+-Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&.
+-.TP
+--version
+-.br
+-Reports the release number and exits
+-.TP
+--h
+-.br
+-Dsiplays a help message and exits\&.
+-.TP
+--help
+-.br
+-Displays a help message and exits\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the Java Virtual Machine on which the \f3jhat\fR command is running\&. For example, \f3-J-Xmx512m\fR to use a maximum heap size of 512 MB\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jmap(1)
+-.TP 0.2i
+-\(bu
+-jconsole(1)
+-.TP 0.2i
+-\(bu
+-HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
++
++.SH NAME
++jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIheap-dump-file\fR
++Java binary heap dump file to be browsed\&. For a dump file that contains multiple heap dumps, you can specify which dump in the file by appending \f3#<number>\fR to the file name, for example, \f3myfile\&.hprof#3\fR\&.
++.SH DESCRIPTION
++The \f3jhat\fR command parses a Java heap dump file and starts a web server\&. The \f3jhat\fR command lets you to browse heap dumps with your favorite web browser\&. The \f3jhat\fR command supports predesigned queries such as show all instances of a known class \f3MyClass\fR, and Object Query Language (OQL)\&. OQL is similar to SQL, except for querying heap dumps\&. Help on OQL is available from the OQL help page shown by the \f3jhat\fR command\&. With the default port, OQL help is available at http://localhost:7000/oqlhelp/
++.PP
++There are several ways to generate a Java heap dump:
++.TP 0.2i
++\(bu
++Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
++.TP 0.2i
++\(bu
++Use the \f3jconsole\fR option to obtain a heap dump through \f3HotSpotDiagnosticMXBean\fR at runtime\&. See jconsole(1) and the \f3HotSpotDiagnosticMXBean\fR interface description at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html
++.TP 0.2i
++\(bu
++Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&.
++.TP 0.2i
++\(bu
++Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
++.SH OPTIONS
++.TP
++-stack false|true
++.br
++Turns off tracking object allocation call stack\&. If allocation site information is not available in the heap dump, then you have to set this flag to \f3false\fR\&. The default is \f3true\fR\&.
++.TP
++-refs false|true
++.br
++Turns off tracking of references to objects\&. Default is \f3true\fR\&. By default, back pointers, which are objects that point to a specified object such as referrers or incoming references, are calculated for all objects in the heap\&.
++.TP
++-port \fIport-number\fR
++.br
++Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
++.TP
++-exclude \fIexclude-file\fR
++.br
++Specifies a file that lists data members that should be excluded from the reachable objects query\&. For example, if the file lists \f3java\&.lang\&.String\&.value\fR, then, then whenever the list of objects that are reachable from a specific object \f3o\fR are calculated, reference paths that involve \f3java\&.lang\&.String\&.value\fR field are not considered\&.
++.TP
++-baseline \fIexclude-file\fR
++.br
++Specifies a baseline heap dump\&. Objects in both heap dumps with the same object ID are marked as not being new\&. Other objects are marked as new\&. This is useful for comparing two different heap dumps\&.
++.TP
++-debug \fIint\fR
++.br
++Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&.
++.TP
++-version
++.br
++Reports the release number and exits
++.TP
++-h
++.br
++Dsiplays a help message and exits\&.
++.TP
++-help
++.br
++Displays a help message and exits\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the Java Virtual Machine on which the \f3jhat\fR command is running\&. For example, \f3-J-Xmx512m\fR to use a maximum heap size of 512 MB\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jmap(1)
++.TP 0.2i
++\(bu
++jconsole(1)
++.TP 0.2i
++\(bu
++HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jinfo.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jinfo.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jinfo.1
+-.\"
+-.if n .pl 99999
+-.TH jinfo 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jinfo.1
++.\"
++.if n .pl 99999
++.TH jinfo 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,85 +47,85 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jinfo \- Generates configuration information\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjinfo\fR [ \fIoption\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjinfo\fR [ \fIoption \fR] \fIexecutable core\fR
+-.fi
+-.nf
+-
+-\fBjinfo\fR [ \fIoption \fR] \fI[ servier\-id ] remote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoption\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the configuration information is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the configuration information is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jinfo\fR command prints Java configuration information for a specified Java process or core file or a remote debug server\&. The configuration information includes Java system properties and Java Virtual Machine (JVM) command-line flags\&. If the specified process is running on a 64-bit JVM, then you might need to specify the \f3-J-d64\fR option, for example: \f3jinfo\fR\f3-J-d64 -sysprops pid\fR\&.
+-.PP
+-This utility is unsupported and might not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of the jvm\&.dll that is used by the target process or the location from which the crash dump file was produced\&. For example, \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR \&.
+-.SH OPTIONS
+-.TP
+-no-option
+-Prints both command-line flags and system property name-value pairs\&.
+-.TP
+--flag \fIname\fR
+-.br
+-Prints the name and value of the specified command-line flag\&.
+-.TP
+--flag \fI[+|-]name\fR
+-.br
+-enables or disables the specified Boolean command-line flag\&.
+-.TP
+--flag \fIname=value\fR
+-.br
+-Sets the specified command-line flag to the specified value\&.
+-.TP
+--flags
+-.br
+-Prints command-line flags passed to the JVM\&.
+-.TP
+--sysprops
+-.br
+-Prints Java system properties as name-value pairs\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jinfo \- Generates configuration information\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjinfo\fR [ \fIoption\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjinfo\fR [ \fIoption \fR] \fIexecutable core\fR
++.fi
++.nf
++
++\fBjinfo\fR [ \fIoption \fR] \fI[ servier\-id ] remote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoption\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the configuration information is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the configuration information is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jinfo\fR command prints Java configuration information for a specified Java process or core file or a remote debug server\&. The configuration information includes Java system properties and Java Virtual Machine (JVM) command-line flags\&. If the specified process is running on a 64-bit JVM, then you might need to specify the \f3-J-d64\fR option, for example: \f3jinfo\fR\f3-J-d64 -sysprops pid\fR\&.
++.PP
++This utility is unsupported and might not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of the jvm\&.dll that is used by the target process or the location from which the crash dump file was produced\&. For example, \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR \&.
++.SH OPTIONS
++.TP
++no-option
++Prints both command-line flags and system property name-value pairs\&.
++.TP
++-flag \fIname\fR
++.br
++Prints the name and value of the specified command-line flag\&.
++.TP
++-flag \fI[+|-]name\fR
++.br
++enables or disables the specified Boolean command-line flag\&.
++.TP
++-flag \fIname=value\fR
++.br
++Sets the specified command-line flag to the specified value\&.
++.TP
++-flags
++.br
++Prints command-line flags passed to the JVM\&.
++.TP
++-sysprops
++.br
++Prints Java system properties as name-value pairs\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jjs.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jjs.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/linux/doc/man/jmap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jmap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jmap.1
+-.\"
+-.if n .pl 99999
+-.TH jmap 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jmap.1
++.\"
++.if n .pl 99999
++.TH jmap 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,96 +47,96 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jmap \- Prints shared object memory maps or heap memory details for a process, core file, or remote debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
+-.fi
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] [ \fIpid\fR ] \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the memory map is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the memory map is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jmap\fR command prints shared object memory maps or heap memory details of a specified process, core file, or remote debug server\&. If the specified process is running on a 64-bit Java Virtual Machine (JVM), then you might need to specify the \f3-J-d64\fR option, for example: \f3jmap\fR\f3-J-d64 -heap pid\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and might not be available in future releases of the JDK\&. On Windows Systems where the \f3dbgeng\&.dll\fR file is not present, Debugging Tools For Windows must be installed to make these tools work\&. The \f3PATH\fR environment variable should contain the location of the \f3jvm\&.dll\fR file that is used by the target process or the location from which the crash dump file was produced, for example: \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
+-.SH OPTIONS
+-.TP
+-<no option>
+-When no option is used, the \f3jmap\fR command prints shared object mappings\&. For each shared object loaded in the target JVM, the start address, size of the mapping, and the full path of the shared object file are printed\&. This behavior is similar to the Oracle Solaris \f3pmap\fR utility\&.
+-.TP
+--dump:[live,] format=b, file=\fIfilename\fR
+-.br
+-Dumps the Java heap in \f3hprof\fR binary format to \f3filename\fR\&. The \f3live\fR suboption is optional, but when specified, only the active objects in the heap are dumped\&. To browse the heap dump, you can use the jhat(1) command to read the generated file\&.
+-.TP
+--finalizerinfo
+-.br
+-Prints information about objects that are awaiting finalization\&.
+-.TP
+--heap
+-.br
+-Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage\&. In addition, the number and size of interned Strings are printed\&.
+-.TP
+--histo[:live]
+-.br
+-Prints a histogram of the heap\&. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed\&. The JVM internal class names are printed with an asterisk (*) prefix\&. If the \f3live\fR suboption is specified, then only active objects are counted\&.
+-.TP
+--clstats
+-.br
+-Prints class loader wise statistics of Java heap\&. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed\&.
+-.TP
+--F
+-.br
+-Force\&. Use this option with the \f3jmap -dump\fR or \f3jmap -histo\fR option when the pid does not respond\&. The \f3live\fR suboption is not supported in this mode\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the Java Virtual Machine where the \f3jmap\fR command is running\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jhat(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jmap \- Prints shared object memory maps or heap memory details for a process, core file, or remote debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
++.fi
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] [ \fIpid\fR ] \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the memory map is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the memory map is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jmap\fR command prints shared object memory maps or heap memory details of a specified process, core file, or remote debug server\&. If the specified process is running on a 64-bit Java Virtual Machine (JVM), then you might need to specify the \f3-J-d64\fR option, for example: \f3jmap\fR\f3-J-d64 -heap pid\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and might not be available in future releases of the JDK\&. On Windows Systems where the \f3dbgeng\&.dll\fR file is not present, Debugging Tools For Windows must be installed to make these tools work\&. The \f3PATH\fR environment variable should contain the location of the \f3jvm\&.dll\fR file that is used by the target process or the location from which the crash dump file was produced, for example: \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
++.SH OPTIONS
++.TP
++<no option>
++When no option is used, the \f3jmap\fR command prints shared object mappings\&. For each shared object loaded in the target JVM, the start address, size of the mapping, and the full path of the shared object file are printed\&. This behavior is similar to the Oracle Solaris \f3pmap\fR utility\&.
++.TP
++-dump:[live,] format=b, file=\fIfilename\fR
++.br
++Dumps the Java heap in \f3hprof\fR binary format to \f3filename\fR\&. The \f3live\fR suboption is optional, but when specified, only the active objects in the heap are dumped\&. To browse the heap dump, you can use the jhat(1) command to read the generated file\&.
++.TP
++-finalizerinfo
++.br
++Prints information about objects that are awaiting finalization\&.
++.TP
++-heap
++.br
++Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage\&. In addition, the number and size of interned Strings are printed\&.
++.TP
++-histo[:live]
++.br
++Prints a histogram of the heap\&. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed\&. The JVM internal class names are printed with an asterisk (*) prefix\&. If the \f3live\fR suboption is specified, then only active objects are counted\&.
++.TP
++-clstats
++.br
++Prints class loader wise statistics of Java heap\&. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed\&.
++.TP
++-F
++.br
++Force\&. Use this option with the \f3jmap -dump\fR or \f3jmap -histo\fR option when the pid does not respond\&. The \f3live\fR suboption is not supported in this mode\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the Java Virtual Machine where the \f3jmap\fR command is running\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jhat(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Monitoring Tools
+-.\" Title: jps.1
+-.\"
+-.if n .pl 99999
+-.TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Monitoring Tools
++.\" Title: jps.1
++.\"
++.if n .pl 99999
++.TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,157 +47,157 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIhostid\fR
+-The identifier of the host for which the process report should be generated\&. The \f3hostid\fR can include optional components that indicate the communications protocol, port number, and other implementation specific data\&. See Host Identifier\&.
+-.SH DESCRIPTION
+-The \f3jps\fR command lists the instrumented Java HotSpot VMs on the target system\&. The command is limited to reporting information on JVMs for which it has the access permissions\&.
+-.PP
+-If the \f3jps\fR command is run without specifying a \f3hostid\fR, then it searches for instrumented JVMs on the local host\&. If started with a \f3hostid\fR, then it searches for JVMs on the indicated host, using the specified protocol and port\&. A \f3jstatd\fR process is assumed to be running on the target host\&.
+-.PP
+-The \f3jps\fR command reports the local JVM identifier, or \f3lvmid\fR, for each instrumented JVM found on the target system\&. The \f3lvmid\fR is typically, but not necessarily, the operating system\&'s process identifier for the JVM process\&. With no options, \f3jps\fR lists each Java application\&'s \f3lvmid\fR followed by the short form of the application\&'s class name or jar file name\&. The short form of the class name or JAR file name omits the class\&'s package information or the JAR files path information\&.
+-.PP
+-The \f3jps\fR command uses the Java launcher to find the class name and arguments passed to the main method\&. If the target JVM is started with a custom launcher, then the class or JAR file name and the arguments to the \f3main\fR method are not available\&. In this case, the \f3jps\fR command outputs the string \f3Unknown\fR for the class name or JAR file name and for the arguments to the \f3main\fR method\&.
+-.PP
+-The list of JVMs produced by the \f3jps\fR command can be limited by the permissions granted to the principal running the command\&. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms\&.
+-.SH OPTIONS
+-The \f3jps\fR command supports a number of options that modify the output of the command\&. These options are subject to change or removal in the future\&.
+-.TP
+--q
+-.br
+-Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main\fR method, producing only a list of local JVM identifiers\&.
+-.TP
+--m
+-.br
+-Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
+-.TP
+--l
+-.br
+-Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
+-.TP
+--v
+-.br
+-Displays the arguments passed to the JVM\&.
+-.TP
+--V
+-.br
+-Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local JVM identifiers\&.
+-.TP
+--J\f3option\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH HOST\ IDENTIFIER
+-The host identifier, or \f3hostid\fR is a string that indicates the target system\&. The syntax of the \f3hostid\fR string corresponds to the syntax of a URI:
+-.sp
+-.nf
+-\f3[protocol:][[//]hostname][:port][/servername]\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.TP
+-\fIprotocol\fR
+-The communications protocol\&. If the \f3protocol\fR is omitted and a \f3hostname\fR is not specified, then the default protocol is a platform-specific, optimized, local protocol\&. If the protocol is omitted and a host name is specified, then the default protocol is \f3rmi\fR\&.
+-.TP
+-hostname
+-A hostname or IP address that indicates the target host\&. If you omit the \f3hostname\fR parameter, then the target host is the local host\&.
+-.TP
+-port
+-The default port for communicating with the remote server\&. If the \f3hostname\fR parameter is omitted or the \f3protocol\fR parameter specifies an optimized, local protocol, then the \f3port\fR parameter is ignored\&. Otherwise, treatment of the \f3port\fR parameter is implementation specific\&. For the default \f3rmi\fR protocol, the \f3port\fR parameter indicates the port number for the rmiregistry on the remote host\&. If the \f3port\fR parameter is omitted, and the \f3protocol\fR parameter indicates \f3rmi\fR, then the default rmiregistry port (1099) is used\&.
+-.TP
+-servername
+-The treatment of this parameter depends on the implementation\&. For the optimized, local protocol, this field is ignored\&. For the \f3rmi\fR protocol, this parameter is a string that represents the name of the RMI remote object on the remote host\&. See the \f3jstatd\fR command \f3-n\fRoption for more information\&.
+-.SH OUTPUT\ FORMAT
+-The output of the \f3jps\fR command follows the following pattern:
+-.sp
+-.nf
+-\f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-All output tokens are separated by white space\&. An \f3arg\fR value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters\&.
+-.PP
+-\fINote:\fR It is recommended that you do not write scripts to parse \f3jps\fR output because the format might change in future releases\&. If you write scripts that parse \f3jps\fR output, then expect to modify them for future releases of this tool\&.
+-.SH EXAMPLES
+-This section provides examples of the \f3jps\fR command\&.
+-.PP
+-List the instrumented JVMs on the local host:
+-.sp
+-.nf
+-\f3jps\fP
+-.fi
+-.nf
+-\f318027 Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f318032 jps\fP
+-.fi
+-.nf
+-\f318005 jstat\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example lists the instrumented JVMs on a remote host\&. This example assumes that the \f3jstat\fR server and either the its internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099)\&. It also assumes that the local host has appropriate permissions to access the remote host\&. This example also includes the \f3-l\fR option to output the long form of the class names or JAR file names\&.
+-.sp
+-.nf
+-\f3jps \-l remote\&.domain\fP
+-.fi
+-.nf
+-\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f32857 sun\&.tools\&.jstatd\&.jstatd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example lists the instrumented JVMs on a remote host with a non-default port for the RMI registry\&. This example assumes that the \f3jstatd\fR server, with an internal RMI registry bound to port 2002, is running on the remote host\&. This example also uses the \f3-m\fR option to include the arguments passed to the \f3main\fR method of each of the listed Java applications\&.
+-.sp
+-.nf
+-\f3jps \-m remote\&.domain:2002\fP
+-.fi
+-.nf
+-\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jstat(1)
+-.TP 0.2i
+-\(bu
+-jstatd(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIhostid\fR
++The identifier of the host for which the process report should be generated\&. The \f3hostid\fR can include optional components that indicate the communications protocol, port number, and other implementation specific data\&. See Host Identifier\&.
++.SH DESCRIPTION
++The \f3jps\fR command lists the instrumented Java HotSpot VMs on the target system\&. The command is limited to reporting information on JVMs for which it has the access permissions\&.
++.PP
++If the \f3jps\fR command is run without specifying a \f3hostid\fR, then it searches for instrumented JVMs on the local host\&. If started with a \f3hostid\fR, then it searches for JVMs on the indicated host, using the specified protocol and port\&. A \f3jstatd\fR process is assumed to be running on the target host\&.
++.PP
++The \f3jps\fR command reports the local JVM identifier, or \f3lvmid\fR, for each instrumented JVM found on the target system\&. The \f3lvmid\fR is typically, but not necessarily, the operating system\&'s process identifier for the JVM process\&. With no options, \f3jps\fR lists each Java application\&'s \f3lvmid\fR followed by the short form of the application\&'s class name or jar file name\&. The short form of the class name or JAR file name omits the class\&'s package information or the JAR files path information\&.
++.PP
++The \f3jps\fR command uses the Java launcher to find the class name and arguments passed to the main method\&. If the target JVM is started with a custom launcher, then the class or JAR file name and the arguments to the \f3main\fR method are not available\&. In this case, the \f3jps\fR command outputs the string \f3Unknown\fR for the class name or JAR file name and for the arguments to the \f3main\fR method\&.
++.PP
++The list of JVMs produced by the \f3jps\fR command can be limited by the permissions granted to the principal running the command\&. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms\&.
++.SH OPTIONS
++The \f3jps\fR command supports a number of options that modify the output of the command\&. These options are subject to change or removal in the future\&.
++.TP
++-q
++.br
++Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main\fR method, producing only a list of local JVM identifiers\&.
++.TP
++-m
++.br
++Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
++.TP
++-l
++.br
++Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
++.TP
++-v
++.br
++Displays the arguments passed to the JVM\&.
++.TP
++-V
++.br
++Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local JVM identifiers\&.
++.TP
++-J\f3option\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH HOST\ IDENTIFIER
++The host identifier, or \f3hostid\fR is a string that indicates the target system\&. The syntax of the \f3hostid\fR string corresponds to the syntax of a URI:
++.sp
++.nf
++\f3[protocol:][[//]hostname][:port][/servername]\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.TP
++\fIprotocol\fR
++The communications protocol\&. If the \f3protocol\fR is omitted and a \f3hostname\fR is not specified, then the default protocol is a platform-specific, optimized, local protocol\&. If the protocol is omitted and a host name is specified, then the default protocol is \f3rmi\fR\&.
++.TP
++hostname
++A hostname or IP address that indicates the target host\&. If you omit the \f3hostname\fR parameter, then the target host is the local host\&.
++.TP
++port
++The default port for communicating with the remote server\&. If the \f3hostname\fR parameter is omitted or the \f3protocol\fR parameter specifies an optimized, local protocol, then the \f3port\fR parameter is ignored\&. Otherwise, treatment of the \f3port\fR parameter is implementation specific\&. For the default \f3rmi\fR protocol, the \f3port\fR parameter indicates the port number for the rmiregistry on the remote host\&. If the \f3port\fR parameter is omitted, and the \f3protocol\fR parameter indicates \f3rmi\fR, then the default rmiregistry port (1099) is used\&.
++.TP
++servername
++The treatment of this parameter depends on the implementation\&. For the optimized, local protocol, this field is ignored\&. For the \f3rmi\fR protocol, this parameter is a string that represents the name of the RMI remote object on the remote host\&. See the \f3jstatd\fR command \f3-n\fRoption for more information\&.
++.SH OUTPUT\ FORMAT
++The output of the \f3jps\fR command follows the following pattern:
++.sp
++.nf
++\f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++All output tokens are separated by white space\&. An \f3arg\fR value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters\&.
++.PP
++\fINote:\fR It is recommended that you do not write scripts to parse \f3jps\fR output because the format might change in future releases\&. If you write scripts that parse \f3jps\fR output, then expect to modify them for future releases of this tool\&.
++.SH EXAMPLES
++This section provides examples of the \f3jps\fR command\&.
++.PP
++List the instrumented JVMs on the local host:
++.sp
++.nf
++\f3jps\fP
++.fi
++.nf
++\f318027 Java2Demo\&.JAR\fP
++.fi
++.nf
++\f318032 jps\fP
++.fi
++.nf
++\f318005 jstat\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example lists the instrumented JVMs on a remote host\&. This example assumes that the \f3jstat\fR server and either the its internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099)\&. It also assumes that the local host has appropriate permissions to access the remote host\&. This example also includes the \f3-l\fR option to output the long form of the class names or JAR file names\&.
++.sp
++.nf
++\f3jps \-l remote\&.domain\fP
++.fi
++.nf
++\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
++.fi
++.nf
++\f32857 sun\&.tools\&.jstatd\&.jstatd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example lists the instrumented JVMs on a remote host with a non-default port for the RMI registry\&. This example assumes that the \f3jstatd\fR server, with an internal RMI registry bound to port 2002, is running on the remote host\&. This example also uses the \f3-m\fR option to include the arguments passed to the \f3main\fR method of each of the listed Java applications\&.
++.sp
++.nf
++\f3jps \-m remote\&.domain:2002\fP
++.fi
++.nf
++\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
++.fi
++.nf
++\f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jstat(1)
++.TP 0.2i
++\(bu
++jstatd(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jrunscript.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jrunscript.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2006, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Scripting Tools
+-.\" Title: jrunscript.1
+-.\"
+-.if n .pl 99999
+-.TH jrunscript 1 "21 November 2013" "JDK 8" "Scripting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Scripting Tools
++.\" Title: jrunscript.1
++.\"
++.if n .pl 99999
++.TH jrunscript 1 "21 November 2013" "JDK 8" "Scripting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,148 +47,148 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jrunscript \- Runs a command-line script shell that supports interactive and batch modes\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjrunscript\fR [\fIoptions\fR] [\fIarguments\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIarguments\fR
+-Arguments, when used, follow immediately after options or the command name\&. See Arguments\&.
+-.SH DESCRIPTION
+-The \f3jrunscript\fR command is a language-independent command-line script shell\&. The \f3jrunscript\fR command supports both an interactive (read-eval-print) mode and a batch (\f3-f\fR option) mode of script execution\&. By default, JavaScript is the language used, but the \f3-l\fR option can be used to specify a different language\&. By using Java to scripting language communication, the \f3jrunscript\fR command supports an exploratory programming style\&.
+-.SH OPTIONS
+-.TP
+--classpath \fIpath\fR
+-.br
+-Indicate where any class files are that the script needs to access\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-Same as \f3-classpath\fR\f3path\fR\&.
+-.TP
+--D\fIname\fR=\fIvalue\fR
+-.br
+-Sets a Java system property\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR directly to the Java Virtual Machine where the \f3jrunscript\fR command is running\&.
+-.TP
+--I \fIlanguage\fR
+-.br
+-Uses the specified scripting language\&. By default, JavaScript is used\&. To use other scripting languages, you must specify the corresponding script engine\&'s JAR file with the \f3-cp\fR or \f3-classpath\fR option\&.
+-.TP
+--e \fIscript\fR
+-.br
+-Evaluates the specified script\&. This option can be used to run one-line scripts that are specified completely on the command line\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Specifies the character encoding used to read script files\&.
+-.TP
+--f \fIscript-file\fR
+-.br
+-Evaluates the specified script file (batch mode)\&.
+-.TP
+--f -
+-.br
+-Reads and evaluates a script from standard input (interactive mode)\&.
+-.TP
+--help
+-.br
+-Displays a help message and exits\&.
+-.TP
+--?
+-.br
+-Displays a help message and exits\&.
+-.TP
+--q
+-.br
+-Lists all script engines available and exits\&.
+-.SH ARGUMENTS
+-If arguments are present and if no \f3-e\fR or \f3-f\fR option is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script\&. If arguments and \f3-e\fR or the \f3-f\fR option are used, then all arguments are passed to the script\&. If arguments, \f3-e\fR and \f3-f\fR are missing, then interactive mode is used\&. Script arguments are available to a script in an engine variable named \f3arguments\fR of type \f3String\fR array\&.
+-.SH EXAMPLES
+-.SS EXECUTE\ INLINE\ SCRIPTS
+-.sp
+-.nf
+-\f3jrunscript \-e "print(\&'hello world\&')"\fP
+-.fi
+-.nf
+-\f3jrunscript \-e "cat(\&'http://www\&.example\&.com\&')"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS USE\ SPECIFIED\ LANGUAGE\ AND\ EVALUATE\ THE\ SCRIPT\ FILE
+-.sp
+-.nf
+-\f3jrunscript \-l js \-f test\&.js\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS INTERACTIVE\ MODE
+-.sp
+-.nf
+-\f3jrunscript\fP
+-.fi
+-.nf
+-\f3js> print(\&'Hello World\en\&');\fP
+-.fi
+-.nf
+-\f3Hello World\fP
+-.fi
+-.nf
+-\f3js> 34 + 55\fP
+-.fi
+-.nf
+-\f389\&.0\fP
+-.fi
+-.nf
+-\f3js> t = new java\&.lang\&.Thread(function() { print(\&'Hello World\en\&'); })\fP
+-.fi
+-.nf
+-\f3Thread[Thread\-0,5,main]\fP
+-.fi
+-.nf
+-\f3js> t\&.start()\fP
+-.fi
+-.nf
+-\f3js> Hello World\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3js>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS RUN\ SCRIPT\ FILE\ WITH\ SCRIPT\ ARGUMENTS
+-The test\&.js file is the script file\&. The \f3arg1\fR, \f3arg2\fR and \f3arg3\fR arguments are passed to the script\&. The script can access these arguments with an arguments array\&.
+-.sp
+-.nf
+-\f3jrunscript test\&.js arg1 arg2 arg3\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-If JavaScript is used, then before it evaluates a user defined script, the \f3jrunscript\fR command initializes certain built-in functions and objects\&. These JavaScript built-ins are documented in JsDoc-Toolkit at http://code\&.google\&.com/p/jsdoc-toolkit/
++
++.SH NAME
++jrunscript \- Runs a command-line script shell that supports interactive and batch modes\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjrunscript\fR [\fIoptions\fR] [\fIarguments\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIarguments\fR
++Arguments, when used, follow immediately after options or the command name\&. See Arguments\&.
++.SH DESCRIPTION
++The \f3jrunscript\fR command is a language-independent command-line script shell\&. The \f3jrunscript\fR command supports both an interactive (read-eval-print) mode and a batch (\f3-f\fR option) mode of script execution\&. By default, JavaScript is the language used, but the \f3-l\fR option can be used to specify a different language\&. By using Java to scripting language communication, the \f3jrunscript\fR command supports an exploratory programming style\&.
++.SH OPTIONS
++.TP
++-classpath \fIpath\fR
++.br
++Indicate where any class files are that the script needs to access\&.
++.TP
++-cp \fIpath\fR
++.br
++Same as \f3-classpath\fR\f3path\fR\&.
++.TP
++-D\fIname\fR=\fIvalue\fR
++.br
++Sets a Java system property\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR directly to the Java Virtual Machine where the \f3jrunscript\fR command is running\&.
++.TP
++-I \fIlanguage\fR
++.br
++Uses the specified scripting language\&. By default, JavaScript is used\&. To use other scripting languages, you must specify the corresponding script engine\&'s JAR file with the \f3-cp\fR or \f3-classpath\fR option\&.
++.TP
++-e \fIscript\fR
++.br
++Evaluates the specified script\&. This option can be used to run one-line scripts that are specified completely on the command line\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Specifies the character encoding used to read script files\&.
++.TP
++-f \fIscript-file\fR
++.br
++Evaluates the specified script file (batch mode)\&.
++.TP
++-f -
++.br
++Reads and evaluates a script from standard input (interactive mode)\&.
++.TP
++-help
++.br
++Displays a help message and exits\&.
++.TP
++-?
++.br
++Displays a help message and exits\&.
++.TP
++-q
++.br
++Lists all script engines available and exits\&.
++.SH ARGUMENTS
++If arguments are present and if no \f3-e\fR or \f3-f\fR option is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script\&. If arguments and \f3-e\fR or the \f3-f\fR option are used, then all arguments are passed to the script\&. If arguments, \f3-e\fR and \f3-f\fR are missing, then interactive mode is used\&. Script arguments are available to a script in an engine variable named \f3arguments\fR of type \f3String\fR array\&.
++.SH EXAMPLES
++.SS EXECUTE\ INLINE\ SCRIPTS
++.sp
++.nf
++\f3jrunscript \-e "print(\&'hello world\&')"\fP
++.fi
++.nf
++\f3jrunscript \-e "cat(\&'http://www\&.example\&.com\&')"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS USE\ SPECIFIED\ LANGUAGE\ AND\ EVALUATE\ THE\ SCRIPT\ FILE
++.sp
++.nf
++\f3jrunscript \-l js \-f test\&.js\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS INTERACTIVE\ MODE
++.sp
++.nf
++\f3jrunscript\fP
++.fi
++.nf
++\f3js> print(\&'Hello World\en\&');\fP
++.fi
++.nf
++\f3Hello World\fP
++.fi
++.nf
++\f3js> 34 + 55\fP
++.fi
++.nf
++\f389\&.0\fP
++.fi
++.nf
++\f3js> t = new java\&.lang\&.Thread(function() { print(\&'Hello World\en\&'); })\fP
++.fi
++.nf
++\f3Thread[Thread\-0,5,main]\fP
++.fi
++.nf
++\f3js> t\&.start()\fP
++.fi
++.nf
++\f3js> Hello World\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3js>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS RUN\ SCRIPT\ FILE\ WITH\ SCRIPT\ ARGUMENTS
++The test\&.js file is the script file\&. The \f3arg1\fR, \f3arg2\fR and \f3arg3\fR arguments are passed to the script\&. The script can access these arguments with an arguments array\&.
++.sp
++.nf
++\f3jrunscript test\&.js arg1 arg2 arg3\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++If JavaScript is used, then before it evaluates a user defined script, the \f3jrunscript\fR command initializes certain built-in functions and objects\&. These JavaScript built-ins are documented in JsDoc-Toolkit at http://code\&.google\&.com/p/jsdoc-toolkit/
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jsadebugd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jsadebugd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jsadebugd.1
+-.\"
+-.if n .pl 99999
+-.TH jsadebugd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jsadebugd.1
++.\"
++.if n .pl 99999
++.TH jsadebugd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,61 +47,61 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jsadebugd \- Attaches to a Java process or core file and acts as a debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjsadebugd\fR \fIpid\fR [ \fIserver\-id\fR ]
+-.fi
+-.nf
+-
+-\fBjsadebugd\fR \fIexecutable\fR \fIcore\fR [ \fIserver\-id\fR ]
+-.fi
+-.sp
+-.TP
+-\fIpid\fR
+-The process ID of the process to which the debug server attaches\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&. At most one instance of the debug server can be attached to a single process\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file to which the debug server should attach\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID that is needed when multiple debug servers are started on the same machine\&. This ID must be used by remote clients to identify the particular debug server to which to attach\&. Within a single machine, this ID must be unique\&.
+-.SH DESCRIPTION
+-The \f3jsadebugd\fR command attaches to a Java process or core file and acts as a debug server\&. Remote clients such as \f3jstack\fR, \f3jmap\fR, and \f3jinfo\fR can attach to the server through Java Remote Method Invocation (RMI)\&. Before you start the \f3jsadebugd\fR command, start the RMI registry with the \f3rmiregistry\fR command as follows where \fI$JAVA_HOME\fR is the JDK installation directory:
+-.sp
+-.nf
+-\f3rmiregistry \-J\-Xbootclasspath/p:$JAVA_HOME/lib/sajdi\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If the RMI registry was not started, then the \f3jsadebugd\fR command starts an RMI registry in a standard (1099) port internally\&. The debug server can be stopped by sending a \f3SIGINT\fR to it\&. To send a SIGINT press \fICtrl+C\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and may or may not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of jvm\&.dll used by the target process or the location from which the crash dump file was produced\&. For example, \f3s\fR\f3et PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jinfo(1)
+-.TP 0.2i
+-\(bu
+-jmap(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jstack(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jsadebugd \- Attaches to a Java process or core file and acts as a debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjsadebugd\fR \fIpid\fR [ \fIserver\-id\fR ]
++.fi
++.nf
++
++\fBjsadebugd\fR \fIexecutable\fR \fIcore\fR [ \fIserver\-id\fR ]
++.fi
++.sp
++.TP
++\fIpid\fR
++The process ID of the process to which the debug server attaches\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&. At most one instance of the debug server can be attached to a single process\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file to which the debug server should attach\&.
++.TP
++\fIserver-id\fR
++An optional unique ID that is needed when multiple debug servers are started on the same machine\&. This ID must be used by remote clients to identify the particular debug server to which to attach\&. Within a single machine, this ID must be unique\&.
++.SH DESCRIPTION
++The \f3jsadebugd\fR command attaches to a Java process or core file and acts as a debug server\&. Remote clients such as \f3jstack\fR, \f3jmap\fR, and \f3jinfo\fR can attach to the server through Java Remote Method Invocation (RMI)\&. Before you start the \f3jsadebugd\fR command, start the RMI registry with the \f3rmiregistry\fR command as follows where \fI$JAVA_HOME\fR is the JDK installation directory:
++.sp
++.nf
++\f3rmiregistry \-J\-Xbootclasspath/p:$JAVA_HOME/lib/sajdi\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If the RMI registry was not started, then the \f3jsadebugd\fR command starts an RMI registry in a standard (1099) port internally\&. The debug server can be stopped by sending a \f3SIGINT\fR to it\&. To send a SIGINT press \fICtrl+C\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and may or may not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of jvm\&.dll used by the target process or the location from which the crash dump file was produced\&. For example, \f3s\fR\f3et PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jinfo(1)
++.TP 0.2i
++\(bu
++jmap(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jstack(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jstack.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jstack.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jstack.1
+-.\"
+-.if n .pl 99999
+-.TH jstack 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jstack.1
++.\"
++.if n .pl 99999
++.TH jstack 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jstack \- Prints Java thread stack traces for a Java process, core file, or remote debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
+-.fi
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] [ \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the stack trace is printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the stack trace is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jstack\fR command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server\&. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed\&. With the \f3-m\fR option, the \f3jstack\fR command prints both Java and native frames of all threads with the program counter (PC)\&. For each native frame, the closest native symbol to PC, when available, is printed\&. C++ mangled names are not demangled\&. To demangle C++ names, the output of this command can be piped to \f3c++filt\fR\&. When the specified process is running on a 64-bit Java Virtual Machine, you might need to specify the \f3-J-d64\fR option, for example: \f3jstack -J-d64 -m pid\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and might not be available in future release of the JDK\&. In Windows Systems where the dbgeng\&.dll file is not present, Debugging Tools For Windows must be installed so these tools work\&. The \f3PATH\fR environment variable needs to contain the location of the jvm\&.dll that is used by the target process, or the location from which the crash dump file was produced\&. For example:
+-.sp
+-.nf
+-\f3set PATH=<jdk>\ejre\ebin\eclient;%PATH%\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--F
+-.br
+-Force a stack dump when \f3jstack\fR [\f3-l\fR] \f3pid\fR does not respond\&.
+-.TP
+--l
+-.br
+-Long listing\&. Prints additional information about locks such as a list of owned \f3java\&.util\&.concurrent\fR ownable synchronizers\&. See the \f3AbstractOwnableSynchronizer\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.html
+-.TP
+--m
+-.br
+-Prints a mixed mode stack trace that has both Java and native C/C++ frames\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.SH KNOWN\ BUGS
+-In mixed mode stack trace, the \f3-m\fR option does not work with the remote debug server\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pstack(1)
+-.TP 0.2i
+-\(bu
+-C++filt(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jstack \- Prints Java thread stack traces for a Java process, core file, or remote debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
++.fi
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] [ \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the stack trace is printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the stack trace is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jstack\fR command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server\&. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed\&. With the \f3-m\fR option, the \f3jstack\fR command prints both Java and native frames of all threads with the program counter (PC)\&. For each native frame, the closest native symbol to PC, when available, is printed\&. C++ mangled names are not demangled\&. To demangle C++ names, the output of this command can be piped to \f3c++filt\fR\&. When the specified process is running on a 64-bit Java Virtual Machine, you might need to specify the \f3-J-d64\fR option, for example: \f3jstack -J-d64 -m pid\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and might not be available in future release of the JDK\&. In Windows Systems where the dbgeng\&.dll file is not present, Debugging Tools For Windows must be installed so these tools work\&. The \f3PATH\fR environment variable needs to contain the location of the jvm\&.dll that is used by the target process, or the location from which the crash dump file was produced\&. For example:
++.sp
++.nf
++\f3set PATH=<jdk>\ejre\ebin\eclient;%PATH%\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-F
++.br
++Force a stack dump when \f3jstack\fR [\f3-l\fR] \f3pid\fR does not respond\&.
++.TP
++-l
++.br
++Long listing\&. Prints additional information about locks such as a list of owned \f3java\&.util\&.concurrent\fR ownable synchronizers\&. See the \f3AbstractOwnableSynchronizer\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.html
++.TP
++-m
++.br
++Prints a mixed mode stack trace that has both Java and native C/C++ frames\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.SH KNOWN\ BUGS
++In mixed mode stack trace, the \f3-m\fR option does not work with the remote debug server\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pstack(1)
++.TP 0.2i
++\(bu
++C++filt(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/jstat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jstat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/linux/doc/man/jstatd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/jstatd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Monitoring Tools
+-.\" Title: jstatd.1
+-.\"
+-.if n .pl 99999
+-.TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Monitoring Tools
++.\" Title: jstatd.1
++.\"
++.if n .pl 99999
++.TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,162 +47,162 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjstatd\fR [ \fIoptions\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&.
+-.PP
+-The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&.
+-.SH OPTIONS
+-.TP
+--nr
+-.br
+-Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&.
+-.TP
+--p \fIport\fR
+-.br
+-The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&.
+-.TP
+--n \fIrminame\fR
+-.br
+-Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SECURITY
+-The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&.
+-.PP
+-The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&.
+-.PP
+-The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.PP
+-The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&.
+-.sp
+-.nf
+-\f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { \fP
+-.fi
+-.nf
+-\f3 permission java\&.security\&.AllPermission;\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows:
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&.
+-.SH REMOTE\ INTERFACE
+-The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&.
+-.SH EXAMPLES
+-The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background
+-.SS INTERNAL\ RMI\ REGISTRY
+-This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS EXTERNAL\ RMI\ REGISTRY
+-This example starts a \f3jstatd\fR session with a external RMI registry\&.
+-.sp
+-.nf
+-\f3rmiregistry&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&.
+-.sp
+-.nf
+-\f3jrmiregistry 2020&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&.
+-.sp
+-.nf
+-\f3rmiregistry 2020&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
+-.fi
+-.nf
+-\f3 \-n AlternateJstatdServerName\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY
+-This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS ENABLE\ RMI\ LOGGING
+-This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3 \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jstat(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjstatd\fR [ \fIoptions\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&.
++.PP
++The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&.
++.SH OPTIONS
++.TP
++-nr
++.br
++Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&.
++.TP
++-p \fIport\fR
++.br
++The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&.
++.TP
++-n \fIrminame\fR
++.br
++Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SECURITY
++The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&.
++.PP
++The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&.
++.PP
++The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.PP
++The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&.
++.sp
++.nf
++\f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { \fP
++.fi
++.nf
++\f3 permission java\&.security\&.AllPermission;\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows:
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&.
++.SH REMOTE\ INTERFACE
++The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&.
++.SH EXAMPLES
++The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background
++.SS INTERNAL\ RMI\ REGISTRY
++This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS EXTERNAL\ RMI\ REGISTRY
++This example starts a \f3jstatd\fR session with a external RMI registry\&.
++.sp
++.nf
++\f3rmiregistry&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&.
++.sp
++.nf
++\f3jrmiregistry 2020&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&.
++.sp
++.nf
++\f3rmiregistry 2020&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
++.fi
++.nf
++\f3 \-n AlternateJstatdServerName\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY
++This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS ENABLE\ RMI\ LOGGING
++This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3 \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jstat(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/keytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/keytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Security Tools
+-.\" Title: keytool.1
+-.\"
+-.if n .pl 99999
+-.TH keytool 1 "03 March 2015" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Security Tools
++.\" Title: keytool.1
++.\"
++.if n .pl 99999
++.TH keytool 1 "03 March 2015" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,1572 +47,1572 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-keytool \- Manages a keystore (database) of cryptographic keys, X\&.509 certificate chains, and trusted certificates\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBkeytool\fR [\fIcommands\fR]
+-.fi
+-.sp
+-.TP
+-\fIcommands\fR
+-See Commands\&. These commands are categorized by task as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-Create or Add Data to the Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--gencert
+-.TP 0.2i
+-\(bu
+--genkeypair
+-.TP 0.2i
+-\(bu
+--genseckey
+-.TP 0.2i
+-\(bu
+--importcert
+-.TP 0.2i
+-\(bu
+--importpassword
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Import Contents From Another Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--importkeystore
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Generate Certificate Request
+-.RS
+-.TP 0.2i
+-\(bu
+--certreq
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Export Data
+-.RS
+-.TP 0.2i
+-\(bu
+--exportcert
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Display Data
+-.RS
+-.TP 0.2i
+-\(bu
+--list
+-.TP 0.2i
+-\(bu
+--printcert
+-.TP 0.2i
+-\(bu
+--printcertreq
+-.TP 0.2i
+-\(bu
+--printcrl
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Manage the Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--storepasswd
+-.TP 0.2i
+-\(bu
+--keypasswd
+-.TP 0.2i
+-\(bu
+--delete
+-.TP 0.2i
+-\(bu
+--changealias
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Get Help
+-.RS
+-.TP 0.2i
+-\(bu
+--help
+-.RE
+-
+-.RE
+-
+-.SH DESCRIPTION
+-The \f3keytool\fR command is a key and certificate management utility\&. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself or herself to other users and services) or data integrity and authentication services, using digital signatures\&. The \f3keytool\fR command also enables users to cache the public keys (in the form of certificates) of their communicating peers\&.
+-.PP
+-A certificate is a digitally signed statement from one entity (person, company, and so on\&.), that says that the public key (and some other information) of some other entity has a particular value\&. (See Certificate\&.) When data is digitally signed, the signature can be verified to check the data integrity and authenticity\&. Integrity means that the data has not been modified or tampered with, and authenticity means the data comes from whoever claims to have created and signed it\&.
+-.PP
+-The \f3keytool\fR command also enables users to administer secret keys and passphrases used in symmetric encryption and decryption (DES)\&.
+-.PP
+-The \f3keytool\fR command stores the keys and certificates in a keystore\&. See KeyStore aliases\&.
+-.SH COMMAND\ AND\ OPTION\ NOTES
+-See Commands for a listing and description of the various commands\&.
+-.TP 0.2i
+-\(bu
+-All command and option names are preceded by a minus sign (-)\&.
+-.TP 0.2i
+-\(bu
+-The options for each command can be provided in any order\&.
+-.TP 0.2i
+-\(bu
+-All items not italicized or in braces or brackets are required to appear as is\&.
+-.TP 0.2i
+-\(bu
+-Braces surrounding an option signify that a default value will be used when the option is not specified on the command line\&. See Option Defaults\&. Braces are also used around the \f3-v\fR, \f3-rfc\fR, and \f3-J\fR options, which only have meaning when they appear on the command line\&. They do not have any default values other than not existing\&.
+-.TP 0.2i
+-\(bu
+-Brackets surrounding an option signify that the user is prompted for the values when the option is not specified on the command line\&. For the \f3-keypass\fR option, if you do not specify the option on the command line, then the \f3keytool\fR command first attempts to use the keystore password to recover the private/secret key\&. If this attempt fails, then the \f3keytool\fR command prompts you for the private/secret key password\&.
+-.TP 0.2i
+-\(bu
+-Items in italics (option values) represent the actual values that must be supplied\&. For example, here is the format of the \f3-printcert\fR command:
+-.sp
+-.nf
+-\f3keytool \-printcert {\-file \fIcert_file\fR} {\-v}\fP
+-.fi
+-.sp
+-
+-
+-
+-
+-When you specify a \f3-printcert\fR command, replace \fIcert_file\fR with the actual file name, as follows: \f3keytool -printcert -file VScert\&.cer\fR
+-.TP 0.2i
+-\(bu
+-Option values must be put in quotation marks when they contain a blank (space)\&.
+-.TP 0.2i
+-\(bu
+-The \f3-help\fR option is the default\&. The \f3keytool\fR command is the same as \f3keytool -help\fR\&.
+-.SH OPTION\ DEFAULTS
+-The following examples show the defaults for various option values\&.
+-.sp
+-.nf
+-\f3\-alias "mykey"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keyalg\fP
+-.fi
+-.nf
+-\f3 "DSA" (when using \-genkeypair)\fP
+-.fi
+-.nf
+-\f3 "DES" (when using \-genseckey)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keysize\fP
+-.fi
+-.nf
+-\f3 2048 (when using \-genkeypair and \-keyalg is "RSA")\fP
+-.fi
+-.nf
+-\f3 1024 (when using \-genkeypair and \-keyalg is "DSA")\fP
+-.fi
+-.nf
+-\f3 256 (when using \-genkeypair and \-keyalg is "EC")\fP
+-.fi
+-.nf
+-\f3 56 (when using \-genseckey and \-keyalg is "DES")\fP
+-.fi
+-.nf
+-\f3 168 (when using \-genseckey and \-keyalg is "DESede")\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-validity 90\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keystore <the file named \&.keystore in the user\&'s home directory>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-storetype <the value of the "keystore\&.type" property in the\fP
+-.fi
+-.nf
+-\f3 security properties file, which is returned by the static\fP
+-.fi
+-.nf
+-\f3 getDefaultType method in java\&.security\&.KeyStore>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-file\fP
+-.fi
+-.nf
+-\f3 stdin (if reading)\fP
+-.fi
+-.nf
+-\f3 stdout (if writing)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-protected false\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In generating a public/private key pair, the signature algorithm (\f3-sigalg\fR option) is derived from the algorithm of the underlying private key:
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type DSA, then the \f3-sigalg\fR option defaults to SHA1withDSA\&.
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type RSA, then the \f3-sigalg\fR option defaults to SHA256withRSA\&.
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type EC, then the \f3-sigalg\fR option defaults to SHA256withECDSA\&.
+-.PP
+-For a full list of \f3-keyalg\fR and \f3-sigalg\fR arguments, see Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-.SH COMMON\ OPTIONS
+-The \f3-v\fR option can appear for all commands except \f3-help\fR\&. When the \f3-v\fR option appears, it signifies verbose mode, which means that more information is provided in the output\&.
+-.PP
+-There is also a \f3-Jjavaoption\fR argument that can appear for any command\&. When the \f3-Jjavaoption\fR appears, the specified \f3javaoption\fR string is passed directly to the Java interpreter\&. This option does not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
+-.PP
+-These options can appear for all commands operating on a keystore:
+-.TP
+--storetype \fIstoretype\fR
+-.br
+-This qualifier specifies the type of keystore to be instantiated\&.
+-.TP
+--keystore \fIkeystore\fR
+-.br
+-The keystore location\&.
+-
+-If the JKS \f3storetype\fR is used and a keystore file does not yet exist, then certain \f3keytool\fR commands can result in a new keystore file being created\&. For example, if \f3keytool -genkeypair\fR is called and the \f3-keystore\fR option is not specified, the default keystore file named \f3\&.keystore\fR in the user\&'s home directory is created when it does not already exist\&. Similarly, if the \f3-keystore ks_file\fR option is specified but ks_file does not exist, then it is created\&. For more information on the JKS \f3storetype\fR, see the \fIKeyStore Implementation\fR section in KeyStore aliases\&.
+-
+-Note that the input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified if the keystore is not file-based\&. For example, when it resides on a hardware token device\&.
+-.TP
+--storepass[:\fIenv\fR| :\fIfile\fR] argument
+-.br
+-The password that is used to protect the integrity of the keystore\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the \f3value\fR argument, which must be at least 6 characters long\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named argument\&.
+-.RE
+-
+-
+-\fINote:\fR All other options that require passwords, such as \f3-keypass\fR, \f3-srckeypass\fR, -\f3destkeypass\fR, \f3-srcstorepass\fR, and \f3-deststorepass\fR, accept the \fIenv\fR and \fIfile\fR modifiers\&. Remember to separate the password option and the modifier with a colon (:)\&.
+-
+-The password must be provided to all commands that access the keystore contents\&. For such commands, when the \f3-storepass\fR option is not provided at the command line, the user is prompted for it\&.
+-
+-When retrieving information from the keystore, the password is optional\&. If no password is specified, then the integrity of the retrieved information cannot be verified and a warning is displayed\&.
+-.TP
+--providerName \fIprovider_name\fR
+-.br
+-Used to identify a cryptographic service provider\&'s name when listed in the security properties file\&.
+-.TP
+--providerClass \fIprovider_class_name\fR
+-.br
+-Used to specify the name of a cryptographic service provider\&'s master class file when the service provider is not listed in the security properties file\&.
+-.TP
+--providerArg \fIprovider_arg\fR
+-.br
+-Used with the \f3-providerClass\fR option to represent an optional string input argument for the constructor of \f3provider_class_name\fR\&.
+-.TP
+--protected
+-.br
+-Either \f3true\fR or \f3false\fR\&. This value should be specified as \f3true\fR when a password must be specified by way of a protected authentication path such as a dedicated PIN reader\&.Because there are two keystores involved in the \f3-importkeystore\fR command, the following two options \f3-srcprotected\fR and -\f3destprotected\fR are provided for the source keystore and the destination keystore respectively\&.
+-.TP
+--ext \fI{name{:critical} {=value}}\fR
+-.br
+-Denotes an X\&.509 certificate extension\&. The option can be used in \f3-genkeypair\fR and \f3-gencert\fR to embed extensions into the certificate generated, or in \f3-certreq\fR to show what extensions are requested in the certificate request\&. The option can appear multiple times\&. The \f3name\fR argument can be a supported extension name (see Named Extensions) or an arbitrary OID number\&. The \f3value\fR argument, when provided, denotes the argument for the extension\&. When \fIvalue\fR is omitted, that means that the default value of the extension or the extension requires no argument\&. The \f3:critical\fR modifier, when provided, means the extension\&'s \f3isCritical\fR attribute is \f3true\fR; otherwise, it is \f3false\fR\&. You can use \f3:c\fR in place of \f3:critical\fR\&.
+-.SH NAMED\ EXTENSIONS
+-The \f3keytool\fR command supports these named extensions\&. The names are not case-sensitive)\&.
+-.TP
+-BC or BasicContraints
+-\fIValues\fR: The full form is: \f3ca:{true|false}[,pathlen:<len>]\fR or \f3<len>\fR, which is short for \f3ca:true,pathlen:<len>\fR\&. When <\f3len\fR> is omitted, you have \f3ca:true\fR\&.
+-.TP
+-KU or KeyUsage
+-\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3digitalSignature\fR, \f3nonRepudiation\fR (contentCommitment), \f3keyEncipherment\fR, \f3dataEncipherment\fR, \f3keyAgreement\fR, \f3keyCertSign\fR, \f3cRLSign\fR, \f3encipherOnly\fR, \f3decipherOnly\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters (\f3dig\fR for \f3digitalSignature\fR) or in camel-case style (\f3dS\fR for \f3digitalSignature\fR or \f3cRLS\fR for \f3cRLSign\fR), as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
+-.TP
+-EKU or ExtendedKeyUsage
+-\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3anyExtendedKeyUsage\fR, \f3serverAuth\fR, \f3clientAuth\fR, \f3codeSigning\fR, \f3emailProtection\fR, \f3timeStamping\fR, \f3OCSPSigning\fR, or any \fIOID string\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters or in camel-case style, as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
+-.TP
+-SAN or SubjectAlternativeName
+-\fIValues\fR: \f3type\fR:\f3value\fR(,t\f3ype:value\fR)*, where \f3type\fR can be \f3EMAIL\fR, \f3URI\fR, \f3DNS\fR, \f3IP\fR, or \f3OID\fR\&. The \f3value\fR argument is the string format value for the \f3type\fR\&.
+-.TP
+-IAN or IssuerAlternativeName
+-\fIValues\fR: Same as \f3SubjectAlternativeName\fR\&.
+-.TP
+-SIA or SubjectInfoAccess
+-\fIValues\fR: \f3method\fR:\f3location-type\fR:\f3location-value\fR (,\f3method:location-type\fR:\f3location-value\fR)*, where \f3method\fR can be \f3timeStamping\fR, \f3caRepository\fR or any OID\&. The \f3location-type\fR and \f3location-value\fR arguments can be any \f3type\fR:\f3value\fR supported by the \f3SubjectAlternativeName\fR extension\&.
+-.TP
+-AIA or AuthorityInfoAccess
+-\fIValues\fR: Same as \f3SubjectInfoAccess\fR\&. The \f3method\fR argument can be \f3ocsp\fR,\f3caIssuers\fR, or any OID\&.
+-.PP
+-When \f3name\fR is OID, the value is the hexadecimal dumped DER encoding of the \f3extnValue\fR for the extension excluding the OCTET STRING type and length bytes\&. Any extra character other than standard hexadecimal numbers (0-9, a-f, A-F) are ignored in the HEX string\&. Therefore, both 01:02:03:04 and 01020304 are accepted as identical values\&. When there is no value, the extension has an empty value field\&.
+-.PP
+-A special name \f3honored\fR, used in \f3-gencert\fR only, denotes how the extensions included in the certificate request should be honored\&. The value for this name is a comma separated list of \f3all\fR (all requested extensions are honored), \f3name{:[critical|non-critical]}\fR (the named extension is honored, but using a different \f3isCritical\fR attribute) and \f3-name\fR (used with \f3all\fR, denotes an exception)\&. Requested extensions are not honored by default\&.
+-.PP
+-If, besides the\f3-ext honored\fR option, another named or OID \f3-ext\fR option is provided, this extension is added to those already honored\&. However, if this name (or OID) also appears in the honored value, then its value and criticality overrides the one in the request\&.
+-.PP
+-The \f3subjectKeyIdentifier\fR extension is always created\&. For non-self-signed certificates, the \f3authorityKeyIdentifier\fR is created\&.
+-.PP
+-\fINote:\fR Users should be aware that some combinations of extensions (and other certificate fields) may not conform to the Internet standard\&. See Certificate Conformance Warning\&.
+-.SH COMMANDS
+-.TP
+--gencert
+-.sp
+-.nf
+-\f3{\-rfc} {\-infile \fIinfile\fR} {\-outfile \fIoutfile\fR} {\-alias \fIalias\fR} {\-sigalg \fIsigalg\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-dname \fIdname\fR} {\-startdate \fIstartdate\fR {\-ext \fIext\fR}* {\-validity \fIvalDays\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-keypass \fIkeypass\fR] {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-providername \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a certificate as a response to a certificate request file (which can be created by the \f3keytool\fR\f3-certreq\fR command)\&. The command reads the request from \fIinfile\fR (if omitted, from the standard input), signs it using alias\&'s private key, and outputs the X\&.509 certificate into \fIoutfile\fR (if omitted, to the standard output)\&. When\f3-rfc\fR is specified, the output format is Base64-encoded PEM; otherwise, a binary DER is created\&.
+-
+-The \f3sigalg\fR value specifies the algorithm that should be used to sign the certificate\&. The \f3startdate\fR argument is the start time and date that the certificate is valid\&. The \f3valDays\fR argument tells the number of days for which the certificate should be considered valid\&.
+-
+-When \f3dname\fR is provided, it is used as the subject of the generated certificate\&. Otherwise, the one from the certificate request is used\&.
+-
+-The \f3ext\fR value shows what X\&.509 extensions will be embedded in the certificate\&. Read Common Options for the grammar of \f3-ext\fR\&.
+-
+-The \f3-gencert\fR option enables you to create certificate chains\&. The following example creates a certificate, \f3e1\fR, that contains three certificates in its certificate chain\&.
+-
+-The following commands creates four key pairs named \f3ca\fR, \f3ca1\fR, \f3ca2\fR, and \f3e1\fR:
+-.sp
+-.nf
+-\f3keytool \-alias ca \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca1 \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca2 \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias e1 \-dname CN=E1 \-genkeypair\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following two commands create a chain of signed certificates; \f3ca\fR signs \f3ca1\fR and \f3ca1\fR signs \f3ca2\fR, all of which are self-issued:
+-.sp
+-.nf
+-\f3keytool \-alias ca1 \-certreq |\fP
+-.fi
+-.nf
+-\f3 keytool \-alias ca \-gencert \-ext san=dns:ca1 |\fP
+-.fi
+-.nf
+-\f3 keytool \-alias ca1 \-importcert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca2 \-certreq |\fP
+-.fi
+-.nf
+-\f3 $KT \-alias ca1 \-gencert \-ext san=dns:ca2 |\fP
+-.fi
+-.nf
+-\f3 $KT \-alias ca2 \-importcert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following command creates the certificate \f3e1\fR and stores it in the file \f3e1\&.cert\fR, which is signed by \f3ca2\fR\&. As a result, \f3e1\fR should contain \f3ca\fR, \f3ca1\fR, and \f3ca2\fR in its certificate chain:
+-.sp
+-.nf
+-\f3keytool \-alias e1 \-certreq | keytool \-alias ca2 \-gencert > e1\&.cert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--genkeypair
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} {\-sigalg \fIsigalg\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-dname \fIdname\fR] [\-keypass \fIkeypass\fR] {\-startdate \fIvalue\fR} {\-ext \fIext\fR}*\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-validity \fIvalDays\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a key pair (a public key and associated private key)\&. Wraps the public key into an X\&.509 v3 self-signed certificate, which is stored as a single-element certificate chain\&. This certificate chain and the private key are stored in a new keystore entry identified by alias\&.
+-
+-The \f3keyalg\fR value specifies the algorithm to be used to generate the key pair, and the \f3keysize\fR value specifies the size of each key to be generated\&. The \f3sigalg\fR value specifies the algorithm that should be used to sign the self-signed certificate\&. This algorithm must be compatible with the \f3keyalg\fR value\&.
+-
+-The \f3dname\fR value specifies the X\&.500 Distinguished Name to be associated with the value of \f3alias\fR, and is used as the issuer and subject fields in the self-signed certificate\&. If no distinguished name is provided at the command line, then the user is prompted for one\&.
+-
+-The value of \f3keypass\fR is a password used to protect the private key of the generated key pair\&. If no password is provided, then the user is prompted for it\&. If you press \fIthe Return key\fR at the prompt, then the key password is set to the same password as the keystore password\&. The \f3keypass\fR value must be at least 6 characters\&.
+-
+-The value of \f3startdate\fR specifies the issue time of the certificate, also known as the "Not Before" value of the X\&.509 certificate\&'s Validity field\&.
+-
+-The option value can be set in one of these two forms:
+-
+-\f3([+-]nnn[ymdHMS])+\fR
+-
+-\f3[yyyy/mm/dd] [HH:MM:SS]\fR
+-
+-With the first form, the issue time is shifted by the specified value from the current time\&. The value is a concatenation of a sequence of subvalues\&. Inside each subvalue, the plus sign (+) means shift forward, and the minus sign (-) means shift backward\&. The time to be shifted is \f3nnn\fR units of years, months, days, hours, minutes, or seconds (denoted by a single character of \f3y\fR, \f3m\fR, \f3d\fR, \f3H\fR, \f3M\fR, or \f3S\fR respectively)\&. The exact value of the issue time is calculated using the \f3java\&.util\&.GregorianCalendar\&.add(int field, int amount)\fR method on each subvalue, from left to right\&. For example, by specifying, the issue time will be:
+-.sp
+-.nf
+-\f3Calendar c = new GregorianCalendar();\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.YEAR, \-1);\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.MONTH, 1);\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.DATE, \-1);\fP
+-.fi
+-.nf
+-\f3return c\&.getTime()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-With the second form, the user sets the exact issue time in two parts, year/month/day and hour:minute:second (using the local time zone)\&. The user can provide only one part, which means the other part is the same as the current date (or time)\&. The user must provide the exact number of digits as shown in the format definition (padding with 0 when shorter)\&. When both the date and time are provided, there is one (and only one) space character between the two parts\&. The hour should always be provided in 24 hour format\&.
+-
+-When the option is not provided, the start date is the current time\&. The option can be provided at most once\&.
+-
+-The value of \f3valDays\fR specifies the number of days (starting at the date specified by \f3-startdate\fR, or the current date when \f3-startdate\fR is not specified) for which the certificate should be considered valid\&.
+-
+-This command was named \f3-genkey\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-genkeypair\fR, is preferred going forward\&.
+-.TP
+--genseckey
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} [\-keypass \fIkeypass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a secret key and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&.
+-
+-The value of \f3keyalg\fR specifies the algorithm to be used to generate the secret key, and the value of \f3keysize\fR specifies the size of the key to be generated\&. The \f3keypass\fR value is a password that protects the secret key\&. If no password is provided, then the user is prompted for it\&. If you press the Return key at the prompt, then the key password is set to the same password that is used for the \f3keystore\fR\&. The \f3keypass\fR value must be at least 6 characters\&.
+-.TP
+--importcert
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} [\-keypass \fIkeypass\fR] {\-noprompt} {\-trustcacerts}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads the certificate or certificate chain (where the latter is supplied in a PKCS#7 formatted reply or a sequence of X\&.509 certificates) from the file \f3cert_file\fR, and stores it in the \f3keystore\fR entry identified by \f3alias\fR\&. If no file is specified, then the certificate or certificate chain is read from \f3stdin\fR\&.
+-
+-The \f3keytool\fR command can import X\&.509 v1, v2, and v3 certificates, and PKCS#7 formatted certificate chains consisting of certificates of that type\&. The data to be imported must be provided either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. In the latter case, the encoding must be bounded at the beginning by a string that starts with \f3-\fR\f3----BEGIN\fR, and bounded at the end by a string that starts with \f3-----END\fR\&.
+-
+-You import a certificate for two reasons: To add it to the list of trusted certificates, and to import a certificate reply received from a certificate authority (CA) as the result of submitting a Certificate Signing Request to that CA (see the \f3-certreq\fR option in Commands)\&.
+-
+-Which type of import is intended is indicated by the value of the \f3-alias\fR option\&. If the alias does not point to a key entry, then the \f3keytool\fR command assumes you are adding a trusted certificate entry\&. In this case, the alias should not already exist in the keystore\&. If the alias does already exist, then the \f3keytool\fR command outputs an error because there is already a trusted certificate for that alias, and does not import the certificate\&. If the alias points to a key entry, then the \f3keytool\fR command assumes you are importing a certificate reply\&.
+-.TP
+--importpassword
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Imports a passphrase and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&. The passphrase may be supplied via the standard input stream; otherwise the user is prompted for it\&. \f3keypass\fR is a password used to protect the imported passphrase\&. If no password is provided, the user is prompted for it\&. If you press the Return key at the prompt, the key password is set to the same password as that used for the \f3keystore\fR\&. \f3keypass\fR must be at least 6 characters long\&.
+-.TP
+--importkeystore
+-.sp
+-.nf
+-\f3{\-srcstoretype \fIsrcstoretype\fR} {\-deststoretype \fIdeststoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-srcstorepass \fIsrcstorepass\fR] [\-deststorepass \fIdeststorepass\fR] {\-srcprotected}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-destprotected} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-srcalias \fIsrcalias\fR {\-destalias \fIdestalias\fR} [\-srckeypass \fIsrckeypass\fR]} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-destkeypass \fIdestkeypass\fR] {\-noprompt}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-srcProviderName \fIsrc_provider_name\fR} {\-destProviderName \fIdest_provider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Imports a single entry or all entries from a source keystore to a destination keystore\&.
+-
+-When the \f3-srcalias\fR option is provided, the command imports the single entry identified by the alias to the destination keystore\&. If a destination alias is not provided with \f3destalias\fR, then \f3srcalias\fR is used as the destination alias\&. If the source entry is protected by a password, then \f3srckeypass\fR is used to recover the entry\&. If \fIsrckeypass\fR is not provided, then the \f3keytool\fR command attempts to use \f3srcstorepass\fR to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. The destination entry is protected with \f3destkeypass\fR\&. If \f3destkeypass\fR is not provided, then the destination entry is protected with the source entry password\&. For example, most third-party tools require \f3storepass\fR and \f3keypass\fR in a PKCS #12 keystore to be the same\&. In order to create a PKCS #12 keystore for these tools, always specify a \f3-destkeypass\fR to be the same as \f3-deststorepass\fR\&.
+-
+-If the \f3-srcalias\fR option is not provided, then all entries in the source keystore are imported into the destination keystore\&. Each destination entry is stored under the alias from the source entry\&. If the source entry is protected by a password, then \f3srcstorepass\fR is used to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. If a source keystore entry type is not supported in the destination keystore, or if an error occurs while storing an entry into the destination keystore, then the user is prompted whether to skip the entry and continue or to quit\&. The destination entry is protected with the source entry password\&.
+-
+-If the destination alias already exists in the destination keystore, then the user is prompted to either overwrite the entry or to create a new entry under a different alias name\&.
+-
+-If the \f3-noprompt\fR option is provided, then the user is not prompted for a new destination alias\&. Existing entries are overwritten with the destination alias name\&. Entries that cannot be imported are skipped and a warning is displayed\&.
+-.TP
+--printcertreq
+-.sp
+-.nf
+-\f3{\-file \fIfile\fR}\fP
+-.fi
+-.sp
+-
+-
+-Prints the content of a PKCS #10 format certificate request, which can be generated by the \f3keytool\fR\f3-certreq\fR command\&. The command reads the request from file\&. If there is no file, then the request is read from the standard input\&.
+-.TP
+--certreq
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-dname \fIdname\fR} {\-sigalg \fIsigalg\fR} {\-file \fIcertreq_file\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a Certificate Signing Request (CSR) using the PKCS #10 format\&.
+-
+-A CSR is intended to be sent to a certificate authority (CA)\&. The CA authenticates the certificate requestor (usually off-line) and will return a certificate or certificate chain, used to replace the existing certificate chain (which initially consists of a self-signed certificate) in the keystore\&.
+-
+-The private key associated with alias is used to create the PKCS #10 certificate request\&. To access the private key, the correct password must be provided\&. If \f3keypass\fR is not provided at the command line and is different from the password used to protect the integrity of the keystore, then the user is prompted for it\&. If \f3dname\fR is provided, then it is used as the subject in the CSR\&. Otherwise, the X\&.500 Distinguished Name associated with alias is used\&.
+-
+-The \f3sigalg\fR value specifies the algorithm that should be used to sign the CSR\&.
+-
+-The CSR is stored in the file certreq_file\&. If no file is specified, then the CSR is output to \f3stdout\fR\&.
+-
+-Use the \f3importcert\fR command to import the response from the CA\&.
+-.TP
+--exportcert
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-rfc} {\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads from the keystore the certificate associated with \fIalias\fR and stores it in the cert_file file\&. When no file is specified, the certificate is output to \f3stdout\fR\&.
+-
+-The certificate is by default output in binary encoding\&. If the \f3-rfc\fR option is specified, then the output in the printable encoding format defined by the Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-If \f3alias\fR refers to a trusted certificate, then that certificate is output\&. Otherwise, \f3alias\fR refers to a key entry with an associated certificate chain\&. In that case, the first certificate in the chain is returned\&. This certificate authenticates the public key of the entity addressed by \f3alias\fR\&.
+-
+-This command was named \f3-export\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-exportcert\fR, is preferred going forward\&.
+-.TP
+--list
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v | \-rfc} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Prints to \f3stdout\fR the contents of the keystore entry identified by \f3alias\fR\&. If no \f3alias\fR is specified, then the contents of the entire keystore are printed\&.
+-
+-This command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format, with additional information such as the owner, issuer, serial number, and any extensions\&. If the \f3-rfc\fR option is specified, then the certificate contents are printed using the printable encoding format, as defined by the Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-You cannot specify both \f3-v\fR and \f3-rfc\fR\&.
+-.TP
+--printcert
+-.sp
+-.nf
+-\f3{\-file \fIcert_file\fR | \-sslserver \fIhost\fR[:\fIport\fR]} {\-jarfile \fIJAR_file\fR {\-rfc} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads the certificate from the file cert_file, the SSL server located at host:port, or the signed JAR file \f3JAR_file\fR (with the \f3-jarfile\fR option and prints its contents in a human-readable format\&. When no port is specified, the standard HTTPS port 443 is assumed\&. Note that \f3-sslserver\fR and -file options cannot be provided at the same time\&. Otherwise, an error is reported\&. If neither option is specified, then the certificate is read from \f3stdin\fR\&.
+-
+-When\f3-rfc\fR is specified, the \f3keytool\fR command prints the certificate in PEM mode as defined by the Internet RFC 1421 Certificate Encoding standard\&. See Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-If the certificate is read from a file or \f3stdin\fR, then it might be either binary encoded or in printable encoding format, as defined by the RFC 1421 Certificate Encoding standard\&.
+-
+-If the SSL server is behind a firewall, then the \f3-J-Dhttps\&.proxyHost=proxyhost\fR and \f3-J-Dhttps\&.proxyPort=proxyport\fR options can be specified on the command line for proxy tunneling\&. See Java Secure Socket Extension (JSSE) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.html
+-
+-\fINote:\fR This option can be used independently of a keystore\&.
+-.TP
+--printcrl
+-.sp
+-.nf
+-\f3\-file \fIcrl_\fR {\-v}\fP
+-.fi
+-.sp
+-
+-
+-Reads the Certificate Revocation List (CRL) from the file \f3crl_\fR\&. A CRL is a list of digital certificates that were revoked by the CA that issued them\&. The CA generates the \f3crl_\fR file\&.
+-
+-\fINote:\fR This option can be used independently of a keystore\&.
+-.TP
+--storepasswd
+-.sp
+-.nf
+-\f3[\-new \fInew_storepass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Changes the password used to protect the integrity of the keystore contents\&. The new password is \f3new_storepass\fR, which must be at least 6 characters\&.
+-.TP
+--keypasswd
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-keypass \fIold_keypass\fR] [\-new \fInew_keypass\fR] {\-storetype \fIstoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Changes the password under which the private/secret key identified by \f3alias\fR is protected, from \f3old_keypass\fR to \f3new_keypass\fR, which must be at least 6 characters\&.
+-
+-If the \f3-keypass\fR option is not provided at the command line, and the key password is different from the keystore password, then the user is prompted for it\&.
+-
+-If the \f3-new\fR option is not provided at the command line, then the user is prompted for it
+-.TP
+--delete
+-.sp
+-.nf
+-\f3[\-alias \fIalias\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Deletes from the keystore the entry identified by \f3alias\fR\&. The user is prompted for the alias, when no alias is provided at the command line\&.
+-.TP
+--changealias
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-destalias \fIdestalias\fR] [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Move an existing keystore entry from the specified \f3alias\fR to a new alias, \f3destalias\fR\&. If no destination alias is provided, then the command prompts for one\&. If the original entry is protected with an entry password, then the password can be supplied with the \f3-keypass\fR option\&. If no key password is provided, then the \f3storepass\fR (if provided) is attempted first\&. If the attempt fails, then the user is prompted for a password\&.
+-.TP
+--help
+-.br
+-Lists the basic commands and their options\&.
+-
+-For more information about a specific command, enter the following, where \f3command_name\fR is the name of the command: \f3keytool -command_name -help\fR\&.
+-.SH EXAMPLES
+-This example walks through the sequence of steps to create a keystore for managing public/private key pair and certificates from trusted entities\&.
+-.SS GENERATE\ THE\ KEY\ PAIR
+-First, create a keystore and generate the key pair\&. You can use a command such as the following typed as a single line:
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-dname "cn=Mark Jones, ou=Java, o=Oracle, c=US"\fP
+-.fi
+-.nf
+-\f3 \-alias business \-keypass <new password for private key>\fP
+-.fi
+-.nf
+-\f3 \-keystore /working/mykeystore\fP
+-.fi
+-.nf
+-\f3 \-storepass <new password for keystore> \-validity 180\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The command creates the keystore named \f3mykeystore\fR in the working directory (assuming it does not already exist), and assigns it the password specified by \f3<new password for keystore>\fR\&. It generates a public/private key pair for the entity whose distinguished name has a common name of Mark Jones, organizational unit of Java, organization of Oracle and two-letter country code of US\&. It uses the default DSA key generation algorithm to create the keys; both are 1024 bits\&.
+-.PP
+-The command uses the default SHA1withDSA signature algorithm to create a self-signed certificate that includes the public key and the distinguished name information\&. The certificate is valid for 180 days, and is associated with the private key in a keystore entry referred to by the alias \f3business\fR\&. The private key is assigned the password specified by \f3<new password for private key>\fR\&.
+-.PP
+-The command is significantly shorter when the option defaults are accepted\&. In this case, no options are required, and the defaults are used for unspecified options that have default values\&. You are prompted for any required values\&. You could have the following:
+-.sp
+-.nf
+-\f3keytool \-genkeypair\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this case, a keystore entry with the alias \f3mykey\fR is created, with a newly generated key pair and a certificate that is valid for 90 days\&. This entry is placed in the keystore named \f3\&.keystore\fR in your home directory\&. The keystore is created when it does not already exist\&. You are prompted for the distinguished name information, the keystore password, and the private key password\&.
+-.PP
+-The rest of the examples assume you executed the \f3-genkeypair\fR command without options specified, and that you responded to the prompts with values equal to those specified in the first \f3-genkeypair\fR command\&. For example, a distinguished name of \f3cn=Mark Jones\fR, \f3ou=Java\fR, \f3o=Oracle\fR, \f3c=US\fR)\&.
+-.SS REQUEST\ A\ SIGNED\ CERTIFICATE\ FROM\ A\ CA
+-Generating the key pair created a self-signed certificate\&. A certificate is more likely to be trusted by others when it is signed by a Certification Authority (CA)\&. To get a CA signature, first generate a Certificate Signing Request (CSR), as follows:
+-.sp
+-.nf
+-\f3keytool \-certreq \-file MarkJ\&.csr\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This creates a CSR for the entity identified by the default alias \f3mykey\fR and puts the request in the file named MarkJ\&.csr\&. Submit this file to a CA, such as VeriSign\&. The CA authenticates you, the requestor (usually off-line), and returns a certificate, signed by them, authenticating your public key\&. In some cases, the CA returns a chain of certificates, each one authenticating the public key of the signer of the previous certificate in the chain\&.
+-.SS IMPORT\ A\ CERTIFICATE\ FOR\ THE\ CA
+-You now need to replace the self-signed certificate with a certificate chain, where each certificate in the chain authenticates the public key of the signer of the previous certificate in the chain, up to a root CA\&.
+-.PP
+-Before you import the certificate reply from a CA, you need one or more trusted certificates in your keystore or in the \f3cacerts\fR keystore file\&. See \f3-importcert\fR in Commands\&.
+-.TP 0.2i
+-\(bu
+-If the certificate reply is a certificate chain, then you need the top certificate of the chain\&. The root CA certificate that authenticates the public key of the CA\&.
+-.TP 0.2i
+-\(bu
+-If the certificate reply is a single certificate, then you need a certificate for the issuing CA (the one that signed it)\&. If that certificate is not self-signed, then you need a certificate for its signer, and so on, up to a self-signed root CA certificate\&.
+-.PP
+-The \f3cacerts\fR keystore file ships with several VeriSign root CA certificates, so you probably will not need to import a VeriSign certificate as a trusted certificate in your keystore\&. But if you request a signed certificate from a different CA, and a certificate authenticating that CA\&'s public key was not added to \f3cacerts\fR, then you must import a certificate from the CA as a trusted certificate\&.
+-.PP
+-A certificate from a CA is usually either self-signed or signed by another CA, in which case you need a certificate that authenticates that CA\&'s public key\&. Suppose company ABC, Inc\&., is a CA, and you obtain a file named A\f3BCCA\&.cer\fR that is supposed to be a self-signed certificate from ABC, that authenticates that CA\&'s public key\&. Be careful to ensure the certificate is valid before you import it as a trusted certificate\&. View it first with the \f3keytool -printcert\fR command or the \f3keytool -importcert\fR command without the \f3-noprompt\fR option, and make sure that the displayed certificate fingerprints match the expected ones\&. You can call the person who sent the certificate, and compare the fingerprints that you see with the ones that they show or that a secure public key repository shows\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s (for example, an attacker\&'s) certificate\&. If such an attack takes place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker has signed\&.
+-.PP
+-If you trust that the certificate is valid, then you can add it to your keystore with the following command:
+-.sp
+-.nf
+-\f3keytool \-importcert \-alias abc \-file ABCCA\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This command creates a trusted certificate entry in the keystore, with the data from the file ABCCA\&.cer, and assigns the alias \f3abc\fR to the entry\&.
+-.SS IMPORT\ THE\ CERTIFICATE\ REPLY\ FROM\ THE\ CA
+-After you import a certificate that authenticates the public key of the CA you submitted your certificate signing request to (or there is already such a certificate in the cacerts file), you can import the certificate reply and replace your self-signed certificate with a certificate chain\&. This chain is the one returned by the CA in response to your request (when the CA reply is a chain), or one constructed (when the CA reply is a single certificate) using the certificate reply and trusted certificates that are already available in the keystore where you import the reply or in the \f3cacerts\fR keystore file\&.
+-.PP
+-For example, if you sent your certificate signing request to VeriSign, then you can import the reply with the following, which assumes the returned certificate is named VSMarkJ\&.cer:
+-.sp
+-.nf
+-\f3keytool \-importcert \-trustcacerts \-file VSMarkJ\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS EXPORT\ A\ CERTIFICATE\ THAT\ AUTHENTICATES\ THE\ PUBLIC\ KEY
+-If you used the \f3jarsigner\fR command to sign a Java Archive (JAR) file, then clients that want to use the file will want to authenticate your signature\&. One way the clients can authenticate you is by first importing your public key certificate into their keystore as a trusted entry\&.
+-.PP
+-You can export the certificate and supply it to your clients\&. As an example, you can copy your certificate to a file named MJ\&.cer with the following command that assumes the entry has an alias of \f3mykey\fR:
+-.sp
+-.nf
+-\f3keytool \-exportcert \-alias mykey \-file MJ\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-With the certificate and the signed JAR file, a client can use the \f3jarsigner\fR command to authenticate your signature\&.
+-.SS IMPORT\ KEYSTORE
+-The command \f3importkeystore\fR is used to import an entire keystore into another keystore, which means all entries from the source keystore, including keys and certificates, are all imported to the destination keystore within a single command\&. You can use this command to import entries from a different type of keystore\&. During the import, all new entries in the destination keystore will have the same alias names and protection passwords (for secret keys and private keys)\&. If the \f3keytool\fR command cannot recover the private keys or secret keys from the source keystore, then it prompts you for a password\&. If it detects alias duplication, then it asks you for a new alias, and you can specify a new alias or simply allow the \f3keytool\fR command to overwrite the existing one\&.
+-.PP
+-For example, to import entries from a typical JKS type keystore key\&.jks into a PKCS #11 type hardware-based keystore, use the command:
+-.sp
+-.nf
+-\f3keytool \-importkeystore\fP
+-.fi
+-.nf
+-\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
+-.fi
+-.nf
+-\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
+-.fi
+-.nf
+-\f3 \-srcstorepass <src keystore password>\fP
+-.fi
+-.nf
+-\f3 \-deststorepass <destination keystore pwd>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3importkeystore\fR command can also be used to import a single entry from a source keystore to a destination keystore\&. In this case, besides the options you see in the previous example, you need to specify the alias you want to import\&. With the \f3-srcalias\fR option specified, you can also specify the destination alias name in the command line, as well as protection password for a secret/private key and the destination protection password you want\&. The following command demonstrates this:
+-.sp
+-.nf
+-\f3keytool \-importkeystore\fP
+-.fi
+-.nf
+-\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
+-.fi
+-.nf
+-\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
+-.fi
+-.nf
+-\f3 \-srcstorepass <src keystore password>\fP
+-.fi
+-.nf
+-\f3 \-deststorepass <destination keystore pwd>\fP
+-.fi
+-.nf
+-\f3 \-srcalias myprivatekey \-destalias myoldprivatekey\fP
+-.fi
+-.nf
+-\f3 \-srckeypass <source entry password>\fP
+-.fi
+-.nf
+-\f3 \-destkeypass <destination entry password>\fP
+-.fi
+-.nf
+-\f3 \-noprompt\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS GENERATE\ CERTIFICATES\ FOR\ AN\ SSL\ SERVER
+-The following are \f3keytool\fR commands to generate key pairs and certificates for three entities: Root CA (\f3root\fR), Intermediate CA (\f3ca\fR), and SSL server (\f3server\fR)\&. Ensure that you store all the certificates in the same keystore\&. In these examples, RSA is the recommended the key algorithm\&.
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-keystore root\&.jks \-alias root \-ext bc:c\fP
+-.fi
+-.nf
+-\f3keytool \-genkeypair \-keystore ca\&.jks \-alias ca \-ext bc:c\fP
+-.fi
+-.nf
+-\f3keytool \-genkeypair \-keystore server\&.jks \-alias server\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-keystore root\&.jks \-alias root \-exportcert \-rfc > root\&.pem\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-storepass <storepass> \-keystore ca\&.jks \-certreq \-alias ca |\fP
+-.fi
+-.nf
+-\f3 keytool \-storepass <storepass> \-keystore root\&.jks\fP
+-.fi
+-.nf
+-\f3 \-gencert \-alias root \-ext BC=0 \-rfc > ca\&.pem\fP
+-.fi
+-.nf
+-\f3keytool \-keystore ca\&.jks \-importcert \-alias ca \-file ca\&.pem\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-storepass <storepass> \-keystore server\&.jks \-certreq \-alias server |\fP
+-.fi
+-.nf
+-\f3 keytool \-storepass <storepass> \-keystore ca\&.jks \-gencert \-alias ca\fP
+-.fi
+-.nf
+-\f3 \-ext ku:c=dig,kE \-rfc > server\&.pem\fP
+-.fi
+-.nf
+-\f3cat root\&.pem ca\&.pem server\&.pem |\fP
+-.fi
+-.nf
+-\f3 keytool \-keystore server\&.jks \-importcert \-alias server\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH TERMS
+-.TP
+-Keystore
+-A keystore is a storage facility for cryptographic keys and certificates\&.
+-.TP
+-Keystore entries
+-Keystores can have different types of entries\&. The two most applicable entry types for the \f3keytool\fR command include the following:
+-
+-\fIKey entries\fR: Each entry holds very sensitive cryptographic key information, which is stored in a protected format to prevent unauthorized access\&. Typically, a key stored in this type of entry is a secret key, or a private key accompanied by the certificate chain for the corresponding public key\&. See Certificate Chains\&. The \f3keytool\fR command can handle both types of entries, while the \f3jarsigner\fR tool only handles the latter type of entry, that is private keys and their associated certificate chains\&.
+-
+-\fITrusted certificate entries\fR: Each entry contains a single public key certificate that belongs to another party\&. The entry is called a trusted certificate because the keystore owner trusts that the public key in the certificate belongs to the identity identified by the subject (owner) of the certificate\&. The issuer of the certificate vouches for this, by signing the certificate\&.
+-.TP
+-KeyStore aliases
+-All keystore entries (key and trusted certificate entries) are accessed by way of unique aliases\&.
+-
+-An alias is specified when you add an entity to the keystore with the \f3-genseckey\fR command to generate a secret key, the \f3-genkeypair\fR command to generate a key pair (public and private key), or the \f3-importcert\fR command to add a certificate or certificate chain to the list of trusted certificates\&. Subsequent \f3keytool\fR commands must use this same alias to refer to the entity\&.
+-
+-For example, you can use the alias \f3duke\fR to generate a new public/private key pair and wrap the public key into a self-signed certificate with the following command\&. See Certificate Chains\&.
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-alias duke \-keypass dukekeypasswd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This example specifies an initial password of \f3dukekeypasswd\fR required by subsequent commands to access the private key associated with the alias \f3duke\fR\&. If you later want to change Duke\&'s private key password, use a command such as the following:
+-.sp
+-.nf
+-\f3keytool \-keypasswd \-alias duke \-keypass dukekeypasswd \-new newpass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This changes the password from \f3dukekeypasswd\fR to \f3newpass\fR\&. A password should not be specified on a command line or in a script unless it is for testing purposes, or you are on a secure system\&. If you do not specify a required password option on a command line, then you are prompted for it\&.
+-.TP
+-KeyStore implementation
+-The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies well-defined interfaces to access and modify the information in a keystore\&. It is possible for there to be multiple different concrete implementations, where each implementation is that for a particular type of keystore\&.
+-
+-Currently, two command-line tools (\f3keytool\fR and \f3jarsigner\fR) and a GUI-based tool named Policy Tool make use of keystore implementations\&. Because the \f3KeyStore\fR class is \f3public\fR, users can write additional security applications that use it\&.
+-
+-There is a built-in default implementation, provided by Oracle\&. It implements the keystore as a file with a proprietary keystore type (format) named JKS\&. It protects each private key with its individual password, and also protects the integrity of the entire keystore with a (possibly different) password\&.
+-
+-Keystore implementations are provider-based\&. More specifically, the application interfaces supplied by \f3KeyStore\fR are implemented in terms of a Service Provider Interface (SPI)\&. That is, there is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, which defines the Service Provider Interface methods that providers must implement\&. The term \fIprovider\fR refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
+-
+-Applications can choose different types of keystore implementations from different providers, using the \f3getInstance\fR factory method supplied in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private/secret keys in the keystore and the integrity of the keystore\&. Keystore implementations of different types are not compatible\&.
+-
+-The \f3keytool\fR command works on any file-based keystore implementation\&. It treats the keystore location that is passed to it at the command line as a file name and converts it to a \f3FileInputStream\fR, from which it loads the keystore information\&.)The \f3jarsigner\fR and \f3policytool\fR commands can read a keystore from any location that can be specified with a URL\&.
+-
+-For \f3keytool\fR and \f3jarsigner\fR, you can specify a keystore type at the command line, with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIKeystore\fR menu\&.
+-
+-If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment directory\&. The \f3jre\fR directory in the SDK or the top-level directory of the Java Runtime Environment (JRE)\&.
+-
+-Each tool gets the \f3keystore\&.type\fR value and then examines all the currently installed providers until it finds one that implements a keystores of that type\&. It then uses the keystore implementation from that provider\&.The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type\fR property:
+-.sp
+-.nf
+-\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The default keystore type is \f3jks\fR, which is the proprietary type of the keystore implementation provided by Oracle\&. This is specified by the following line in the security properties file:
+-.sp
+-.nf
+-\f3keystore\&.type=jks\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To have the tools utilize a keystore implementation other than the default, you can change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
+-.sp
+-.nf
+-\f3keystore\&.type=pkcs12\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR Case does not matter in keystore type designations\&. For example, JKS would be considered the same as jks\&.
+-.TP
+-Certificate
+-A certificate (or public-key certificate) is a digitally signed statement from one entity (the issuer), saying that the public key and some other information of another entity (the subject) has some specific value\&. The following terms are related to certificates:
+-
+-\fIPublic Keys\fR: These are numbers associated with a particular entity, and are intended to be known to everyone who needs to have trusted interactions with that entity\&. Public keys are used to verify signatures\&.
+-
+-\fIDigitally Signed\fR: If some data is digitally signed, then it is stored with the identity of an entity and a signature that proves that entity knows about the data\&. The data is rendered unforgeable by signing with the entity\&'s private key\&.
+-
+-\fIIdentity\fR: A known way of addressing an entity\&. In some systems, the identity is the public key, and in others it can be anything from an Oracle Solaris UID to an email address to an X\&.509 distinguished name\&.
+-
+-\fISignature\fR: A signature is computed over some data using the private key of an entity\&. The signer, which in the case of a certificate is also known as the issuer\&.
+-
+-\fIPrivate Keys\fR: These are numbers, each of which is supposed to be known only to the particular entity whose private key it is (that is, it is supposed to be kept secret)\&. Private and public keys exist in pairs in all public key cryptography systems (also referred to as public key crypto systems)\&. In a typical public key crypto system, such as DSA, a private key corresponds to exactly one public key\&. Private keys are used to compute signatures\&.
+-
+-\fIEntity\fR: An entity is a person, organization, program, computer, business, bank, or something else you are trusting to some degree\&.
+-
+-Public key cryptography requires access to users\&' public keys\&. In a large-scale networked environment, it is impossible to guarantee that prior relationships between communicating entities were established or that a trusted repository exists with all used public keys\&. Certificates were invented as a solution to this public key distribution problem\&. Now a Certification Authority (CA) can act as a trusted third party\&. CAs are entities such as businesses that are trusted to sign (issue) certificates for other entities\&. It is assumed that CAs only create valid and reliable certificates because they are bound by legal agreements\&. There are many public Certification Authorities, such as VeriSign, Thawte, Entrust, and so on\&.
+-
+-You can also run your own Certification Authority using products such as Microsoft Certificate Server or the Entrust CA product for your organization\&. With the \f3keytool\fR command, it is possible to display, import, and export certificates\&. It is also possible to generate self-signed certificates\&.
+-
+-The \f3keytool\fR command currently handles X\&.509 certificates\&.
+-.TP
+-X\&.509 Certificates
+-The X\&.509 standard defines what information can go into a certificate and describes how to write it down (the data format)\&. All the data in a certificate is encoded with two related standards called ASN\&.1/DER\&. Abstract Syntax Notation 1 describes data\&. The Definite Encoding Rules describe a single way to store and transfer that data\&.
+-
+-All X\&.509 certificates have the following data, in addition to the signature:
+-
+-\fIVersion\fR: This identifies which version of the X\&.509 standard applies to this certificate, which affects what information can be specified in it\&. Thus far, three versions are defined\&. The \f3keytool\fR command can import and export v1, v2, and v3 certificates\&. It generates v3 certificates\&.
+-
+-X\&.509 Version 1 has been available since 1988, is widely deployed, and is the most generic\&.
+-
+-X\&.509 Version 2 introduced the concept of subject and issuer unique identifiers to handle the possibility of reuse of subject or issuer names over time\&. Most certificate profile documents strongly recommend that names not be reused and that certificates should not make use of unique identifiers\&. Version 2 certificates are not widely used\&.
+-
+-X\&.509 Version 3 is the most recent (1996) and supports the notion of extensions where anyone can define an extension and include it in the certificate\&. Some common extensions are: KeyUsage (limits the use of the keys to particular purposes such as \f3signing-only\fR) and AlternativeNames (allows other identities to also be associated with this public key, for example\&. DNS names, email addresses, IP addresses)\&. Extensions can be marked critical to indicate that the extension should be checked and enforced or used\&. For example, if a certificate has the KeyUsage extension marked critical and set to \f3keyCertSign\fR, then when this certificate is presented during SSL communication, it should be rejected because the certificate extension indicates that the associated private key should only be used for signing certificates and not for SSL use\&.
+-
+-\fISerial number\fR: The entity that created the certificate is responsible for assigning it a serial number to distinguish it from other certificates it issues\&. This information is used in numerous ways\&. For example, when a certificate is revoked its serial number is placed in a Certificate Revocation List (CRL)\&.
+-
+-\fISignature algorithm identifier\fR: This identifies the algorithm used by the CA to sign the certificate\&.
+-
+-\fIIssuer name\fR: The X\&.500 Distinguished Name of the entity that signed the certificate\&. See X\&.500 Distinguished Names\&. This is typically a CA\&. Using this certificate implies trusting the entity that signed this certificate\&. In some cases, such as root or top-level CA certificates, the issuer signs its own certificate\&.
+-
+-\fIValidity period\fR: Each certificate is valid only for a limited amount of time\&. This period is described by a start date and time and an end date and time, and can be as short as a few seconds or almost as long as a century\&. The validity period chosen depends on a number of factors, such as the strength of the private key used to sign the certificate, or the amount one is willing to pay for a certificate\&. This is the expected period that entities can rely on the public value, when the associated private key has not been compromised\&.
+-
+-\fISubject name\fR: The name of the entity whose public key the certificate identifies\&. This name uses the X\&.500 standard, so it is intended to be unique across the Internet\&. This is the X\&.500 Distinguished Name (DN) of the entity\&. See X\&.500 Distinguished Names\&. For example,
+-.sp
+-.nf
+-\f3CN=Java Duke, OU=Java Software Division, O=Oracle Corporation, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-These refer to the subject\&'s common name (CN), organizational unit (OU), organization (O), and country (C)\&.
+-
+-\fISubject public key information\fR: This is the public key of the entity being named with an algorithm identifier that specifies which public key crypto system this key belongs to and any associated key parameters\&.
+-.TP
+-Certificate Chains
+-The \f3keytool\fR command can create and manage keystore key entries that each contain a private key and an associated certificate chain\&. The first certificate in the chain contains the public key that corresponds to the private key\&.
+-
+-When keys are first generated, the chain starts off containing a single element, a self-signed certificate\&. See \f3-genkeypair\fR in Commands\&. A self-signed certificate is one for which the issuer (signer) is the same as the subject\&. The subject is the entity whose public key is being authenticated by the certificate\&. Whenever the \f3-genkeypair\fR command is called to generate a new public/private key pair, it also wraps the public key into a self-signed certificate\&.
+-
+-Later, after a Certificate Signing Request (CSR) was generated with the \f3-certreq\fR command and sent to a Certification Authority (CA), the response from the CA is imported with \f3-importcert\fR, and the self-signed certificate is replaced by a chain of certificates\&. See the \f3-certreq\fR and \f3-importcert\fR options in Commands\&. At the bottom of the chain is the certificate (reply) issued by the CA authenticating the subject\&'s public key\&. The next certificate in the chain is one that authenticates the CA\&'s public key\&.
+-
+-In many cases, this is a self-signed certificate, which is a certificate from the CA authenticating its own public key, and the last certificate in the chain\&. In other cases, the CA might return a chain of certificates\&. In this case, the bottom certificate in the chain is the same (a certificate signed by the CA, authenticating the public key of the key entry), but the second certificate in the chain is a certificate signed by a different CA that authenticates the public key of the CA you sent the CSR to\&. The next certificate in the chain is a certificate that authenticates the second CA\&'s key, and so on, until a self-signed root certificate is reached\&. Each certificate in the chain (after the first) authenticates the public key of the signer of the previous certificate in the chain\&.
+-
+-Many CAs only return the issued certificate, with no supporting chain, especially when there is a flat hierarchy (no intermediates CAs)\&. In this case, the certificate chain must be established from trusted certificate information already stored in the keystore\&.
+-
+-A different reply format (defined by the PKCS #7 standard) includes the supporting certificate chain in addition to the issued certificate\&. Both reply formats can be handled by the \f3keytool\fR command\&.
+-
+-The top-level (root) CA certificate is self-signed\&. However, the trust into the root\&'s public key does not come from the root certificate itself, but from other sources such as a newspaper\&. This is because anybody could generate a self-signed certificate with the distinguished name of, for example, the VeriSign root CA\&. The root CA public key is widely known\&. The only reason it is stored in a certificate is because this is the format understood by most tools, so the certificate in this case is only used as a vehicle to transport the root CA\&'s public key\&. Before you add the root CA certificate to your keystore, you should view it with the \f3-printcert\fR option and compare the displayed fingerprint with the well-known fingerprint obtained from a newspaper, the root CA\&'s Web page, and so on\&.
+-.TP
+-The cacerts Certificates File
+-A certificates file named \f3cacerts\fR resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment\&'s directory, which would be the \f3jre\fR directory in the SDK or the top-level directory of the JRE\&.
+-
+-The \f3cacerts\fR file represents a system-wide keystore with CA certificates\&. System administrators can configure and manage that file with the \f3keytool\fR command by specifying \f3jks\fR as the keystore type\&. The \f3cacerts\fR keystore file ships with a default set of root CA certificates\&. You can list the default certificates with the following command:
+-.sp
+-.nf
+-\f3keytool \-list \-keystore java\&.home/lib/security/cacerts\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The initial password of the \f3cacerts\fR keystore file is \f3changeit\fR\&. System administrators should change that password and the default access permission of that file upon installing the SDK\&.
+-
+-\fINote:\fR It is important to verify your \f3cacerts\fR file\&. Because you trust the CAs in the \f3cacerts\fR file as entities for signing and issuing certificates to other entities, you must manage the \f3cacerts\fR file carefully\&. The \f3cacerts\fR file should contain only certificates of the CAs you trust\&. It is your responsibility to verify the trusted root CA certificates bundled in the \f3cacerts\fR file and make your own trust decisions\&.
+-
+-To remove an untrusted CA certificate from the \f3cacerts\fR file, use the \f3delete\fR option of the \f3keytool\fR command\&. You can find the \f3cacerts\fR file in the JRE installation directory\&. Contact your system administrator if you do not have permission to edit this file
+-.TP
+-Internet RFC 1421 Certificate Encoding Standard
+-Certificates are often stored using the printable encoding format defined by the Internet RFC 1421 standard, instead of their binary encoding\&. This certificate format, also known as Base64 encoding, makes it easy to export certificates to other applications by email or through some other mechanism\&.
+-
+-Certificates read by the \f3-importcert\fR and \f3-printcert\fR commands can be in either this format or binary encoded\&. The \f3-exportcert\fR command by default outputs a certificate in binary encoding, but will instead output a certificate in the printable encoding format, when the \f3-rfc\fR option is specified\&.
+-
+-The \f3-list\fR command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format\&. If the \f3-rfc\fR option is specified, then the certificate is output in the printable encoding format\&.
+-
+-In its printable encoding format, the encoded certificate is bounded at the beginning and end by the following text:
+-.sp
+-.nf
+-\f3\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3encoded certificate goes here\&. \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-\-\-\-\-END CERTIFICATE\-\-\-\-\-\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-X\&.500 Distinguished Names
+-X\&.500 Distinguished Names are used to identify entities, such as those that are named by the \f3subject\fR and \f3issuer\fR (signer) fields of X\&.509 certificates\&. The \f3keytool\fR command supports the following subparts:
+-
+-\fIcommonName\fR: The common name of a person such as Susan Jones\&.
+-
+-\fIorganizationUnit\fR: The small organization (such as department or division) name\&. For example, Purchasing\&.
+-
+-\fIlocalityName\fR: The locality (city) name, for example, Palo Alto\&.
+-
+-\fIstateName\fR: State or province name, for example, California\&.
+-
+-\fIcountry\fR: Two-letter country code, for example, CH\&.
+-
+-When you supply a distinguished name string as the value of a \f3-dname\fR option, such as for the \f3-genkeypair\fR command, the string must be in the following format:
+-.sp
+-.nf
+-\f3CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-All the italicized items represent actual values and the previous keywords are abbreviations for the following:
+-.sp
+-.nf
+-\f3CN=commonName\fP
+-.fi
+-.nf
+-\f3OU=organizationUnit\fP
+-.fi
+-.nf
+-\f3O=organizationName\fP
+-.fi
+-.nf
+-\f3L=localityName\fP
+-.fi
+-.nf
+-\f3S=stateName\fP
+-.fi
+-.nf
+-\f3C=country\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-A sample distinguished name string is:
+-.sp
+-.nf
+-\f3CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino, S=California, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-A sample command using such a string is:
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-dname "CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino,\fP
+-.fi
+-.nf
+-\f3S=California, C=US" \-alias mark\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Case does not matter for the keyword abbreviations\&. For example, CN, cn, and Cn are all treated the same\&.
+-
+-Order matters; each subcomponent must appear in the designated order\&. However, it is not necessary to have all the subcomponents\&. You can use a subset, for example:
+-.sp
+-.nf
+-\f3CN=Steve Meier, OU=Java, O=Oracle, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If a distinguished name string value contains a comma, then the comma must be escaped by a backslash (\e) character when you specify the string on a command line, as in:
+-.sp
+-.nf
+-\f3cn=Peter Schuster, ou=Java\e, Product Development, o=Oracle, c=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-It is never necessary to specify a distinguished name string on a command line\&. When the distinguished name is needed for a command, but not supplied on the command line, the user is prompted for each of the subcomponents\&. In this case, a comma does not need to be escaped by a backslash (\e)\&.
+-.SH WARNINGS
+-.SS IMPORTING\ TRUSTED\ CERTIFICATES\ WARNING
+-\fIImportant\fR: Be sure to check a certificate very carefully before importing it as a trusted certificate\&.
+-.PP
+-Windows Example:
+-
+-View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose sends or emails you a certificate that you put it in a file named \f3\etmp\ecert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
+-.sp
+-.nf
+-\f3 keytool \-printcert \-file \etmp\ecert\fP
+-.fi
+-.nf
+-\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Serial Number: 59092b34\fP
+-.fi
+-.nf
+-\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
+-.fi
+-.nf
+-\f3 Certificate Fingerprints:\fP
+-.fi
+-.nf
+-\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
+-.fi
+-.nf
+-\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
+-.fi
+-.nf
+-\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
+-.fi
+-.nf
+-\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
+-.fi
+-.sp
+-
+-.PP
+-Oracle Solaris Example:
+-
+-View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose someone sends or emails you a certificate that you put it in a file named \f3/tmp/cert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
+-.sp
+-.nf
+-\f3 keytool \-printcert \-file /tmp/cert\fP
+-.fi
+-.nf
+-\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Serial Number: 59092b34\fP
+-.fi
+-.nf
+-\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
+-.fi
+-.nf
+-\f3 Certificate Fingerprints:\fP
+-.fi
+-.nf
+-\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
+-.fi
+-.nf
+-\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
+-.fi
+-.nf
+-\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
+-.fi
+-.nf
+-\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Then call or otherwise contact the person who sent the certificate and compare the fingerprints that you see with the ones that they show\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s certificate such as an attacker\&'s certificate\&. If such an attack took place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker signed, for example, a JAR file with malicious class files inside\&.
+-.PP
+-\fINote:\fR It is not required that you execute a \f3-printcert\fR command before importing a certificate\&. This is because before you add a certificate to the list of trusted certificates in the keystore, the \f3-importcert\fR command prints out the certificate information and prompts you to verify it\&. You can then stop the import operation\&. However, you can do this only when you call the \f3-importcert\fR command without the \f3-noprompt\fR option\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
+-.SS PASSWORDS\ WARNING
+-Most commands that operate on a keystore require the store password\&. Some commands require a private/secret key password\&. Passwords can be specified on the command line in the \f3-storepass\fR and \f3-keypass\fR options\&. However, a password should not be specified on a command line or in a script unless it is for testing, or you are on a secure system\&. When you do not specify a required password option on a command line, you are prompted for it\&.
+-.SS CERTIFICATE\ CONFORMANCE\ WARNING
+-The Internet standard RFC 5280 has defined a profile on conforming X\&.509 certificates, which includes what values and value combinations are valid for certificate fields and extensions\&. See the standard at http://tools\&.ietf\&.org/rfc/rfc5280\&.txt
+-.PP
+-The \f3keytool\fR command does not enforce all of these rules so it can generate certificates that do not conform to the standard\&. Certificates that do not conform to the standard might be rejected by JRE or other applications\&. Users should ensure that they provide the correct options for \f3-dname\fR, \f3-ext\fR, and so on\&.
+-.SH NOTES
+-.SS IMPORT\ A\ NEW\ TRUSTED\ CERTIFICATE
+-Before you add the certificate to the keystore, the \f3keytool\fR command verifies it by attempting to construct a chain of trust from that certificate to a self-signed certificate (belonging to a root CA), using trusted certificates that are already available in the keystore\&.
+-.PP
+-If the \f3-trustcacerts\fR option was specified, then additional certificates are considered for the chain of trust, namely the certificates in a file named \f3cacerts\fR\&.
+-.PP
+-If the \f3keytool\fR command fails to establish a trust path from the certificate to be imported up to a self-signed certificate (either from the keystore or the \f3cacerts\fR file), then the certificate information is printed, and the user is prompted to verify it by comparing the displayed certificate fingerprints with the fingerprints obtained from some other (trusted) source of information, which might be the certificate owner\&. Be very careful to ensure the certificate is valid before importing it as a trusted certificate\&. See Importing Trusted Certificates Warning\&. The user then has the option of stopping the import operation\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
+-.SS IMPORT\ A\ CERTIFICATE\ REPLY
+-When you import a certificate reply, the certificate reply is validated with trusted certificates from the keystore, and optionally, the certificates configured in the \f3cacerts\fR keystore file when the \f3-trustcacert\fR\f3s\fR option is specified\&. See The cacerts Certificates File\&.
+-.PP
+-The methods of determining whether the certificate reply is trusted are as follows:
+-.TP 0.2i
+-\(bu
+-If the reply is a single X\&.509 certificate, then the \f3keytool\fR command attempts to establish a trust chain, starting at the certificate reply and ending at a self-signed certificate (belonging to a root CA)\&. The certificate reply and the hierarchy of certificates is used to authenticate the certificate reply from the new certificate chain of aliases\&. If a trust chain cannot be established, then the certificate reply is not imported\&. In this case, the \f3keytool\fR command does not print the certificate and prompt the user to verify it, because it is very difficult for a user to determine the authenticity of the certificate reply\&.
+-.TP 0.2i
+-\(bu
+-If the reply is a PKCS #7 formatted certificate chain or a sequence of X\&.509 certificates, then the chain is ordered with the user certificate first followed by zero or more CA certificates\&. If the chain ends with a self-signed root CA certificate and the\f3-trustcacerts\fR option was specified, the \f3keytool\fR command attempts to match it with any of the trusted certificates in the keystore or the \f3cacerts\fR keystore file\&. If the chain does not end with a self-signed root CA certificate and the \f3-trustcacerts\fR option was specified, the \f3keytool\fR command tries to find one from the trusted certificates in the keystore or the \f3cacerts\fR keystore file and add it to the end of the chain\&. If the certificate is not found and the \f3-noprompt\fR option is not specified, the information of the last certificate in the chain is printed, and the user is prompted to verify it\&.
+-.PP
+-If the public key in the certificate reply matches the user\&'s public key already stored with \f3alias\fR, then the old certificate chain is replaced with the new certificate chain in the reply\&. The old chain can only be replaced with a valid \f3keypass\fR, and so the password used to protect the private key of the entry is supplied\&. If no password is provided, and the private key password is different from the keystore password, the user is prompted for it\&.
+-.PP
+-This command was named \f3-import\fR in earlier releases\&. This old name is still supported in this release\&. The new name, \f3-importcert\fR, is preferred going forward\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
+-.TP 0.2i
+-\(bu
+-Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
++
++.SH NAME
++keytool \- Manages a keystore (database) of cryptographic keys, X\&.509 certificate chains, and trusted certificates\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBkeytool\fR [\fIcommands\fR]
++.fi
++.sp
++.TP
++\fIcommands\fR
++See Commands\&. These commands are categorized by task as follows:
++.RS
++.TP 0.2i
++\(bu
++Create or Add Data to the Keystore
++.RS
++.TP 0.2i
++\(bu
++-gencert
++.TP 0.2i
++\(bu
++-genkeypair
++.TP 0.2i
++\(bu
++-genseckey
++.TP 0.2i
++\(bu
++-importcert
++.TP 0.2i
++\(bu
++-importpassword
++.RE
++
++.TP 0.2i
++\(bu
++Import Contents From Another Keystore
++.RS
++.TP 0.2i
++\(bu
++-importkeystore
++.RE
++
++.TP 0.2i
++\(bu
++Generate Certificate Request
++.RS
++.TP 0.2i
++\(bu
++-certreq
++.RE
++
++.TP 0.2i
++\(bu
++Export Data
++.RS
++.TP 0.2i
++\(bu
++-exportcert
++.RE
++
++.TP 0.2i
++\(bu
++Display Data
++.RS
++.TP 0.2i
++\(bu
++-list
++.TP 0.2i
++\(bu
++-printcert
++.TP 0.2i
++\(bu
++-printcertreq
++.TP 0.2i
++\(bu
++-printcrl
++.RE
++
++.TP 0.2i
++\(bu
++Manage the Keystore
++.RS
++.TP 0.2i
++\(bu
++-storepasswd
++.TP 0.2i
++\(bu
++-keypasswd
++.TP 0.2i
++\(bu
++-delete
++.TP 0.2i
++\(bu
++-changealias
++.RE
++
++.TP 0.2i
++\(bu
++Get Help
++.RS
++.TP 0.2i
++\(bu
++-help
++.RE
++
++.RE
++
++.SH DESCRIPTION
++The \f3keytool\fR command is a key and certificate management utility\&. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself or herself to other users and services) or data integrity and authentication services, using digital signatures\&. The \f3keytool\fR command also enables users to cache the public keys (in the form of certificates) of their communicating peers\&.
++.PP
++A certificate is a digitally signed statement from one entity (person, company, and so on\&.), that says that the public key (and some other information) of some other entity has a particular value\&. (See Certificate\&.) When data is digitally signed, the signature can be verified to check the data integrity and authenticity\&. Integrity means that the data has not been modified or tampered with, and authenticity means the data comes from whoever claims to have created and signed it\&.
++.PP
++The \f3keytool\fR command also enables users to administer secret keys and passphrases used in symmetric encryption and decryption (DES)\&.
++.PP
++The \f3keytool\fR command stores the keys and certificates in a keystore\&. See KeyStore aliases\&.
++.SH COMMAND\ AND\ OPTION\ NOTES
++See Commands for a listing and description of the various commands\&.
++.TP 0.2i
++\(bu
++All command and option names are preceded by a minus sign (-)\&.
++.TP 0.2i
++\(bu
++The options for each command can be provided in any order\&.
++.TP 0.2i
++\(bu
++All items not italicized or in braces or brackets are required to appear as is\&.
++.TP 0.2i
++\(bu
++Braces surrounding an option signify that a default value will be used when the option is not specified on the command line\&. See Option Defaults\&. Braces are also used around the \f3-v\fR, \f3-rfc\fR, and \f3-J\fR options, which only have meaning when they appear on the command line\&. They do not have any default values other than not existing\&.
++.TP 0.2i
++\(bu
++Brackets surrounding an option signify that the user is prompted for the values when the option is not specified on the command line\&. For the \f3-keypass\fR option, if you do not specify the option on the command line, then the \f3keytool\fR command first attempts to use the keystore password to recover the private/secret key\&. If this attempt fails, then the \f3keytool\fR command prompts you for the private/secret key password\&.
++.TP 0.2i
++\(bu
++Items in italics (option values) represent the actual values that must be supplied\&. For example, here is the format of the \f3-printcert\fR command:
++.sp
++.nf
++\f3keytool \-printcert {\-file \fIcert_file\fR} {\-v}\fP
++.fi
++.sp
++
++
++
++
++When you specify a \f3-printcert\fR command, replace \fIcert_file\fR with the actual file name, as follows: \f3keytool -printcert -file VScert\&.cer\fR
++.TP 0.2i
++\(bu
++Option values must be put in quotation marks when they contain a blank (space)\&.
++.TP 0.2i
++\(bu
++The \f3-help\fR option is the default\&. The \f3keytool\fR command is the same as \f3keytool -help\fR\&.
++.SH OPTION\ DEFAULTS
++The following examples show the defaults for various option values\&.
++.sp
++.nf
++\f3\-alias "mykey"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keyalg\fP
++.fi
++.nf
++\f3 "DSA" (when using \-genkeypair)\fP
++.fi
++.nf
++\f3 "DES" (when using \-genseckey)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keysize\fP
++.fi
++.nf
++\f3 2048 (when using \-genkeypair and \-keyalg is "RSA")\fP
++.fi
++.nf
++\f3 1024 (when using \-genkeypair and \-keyalg is "DSA")\fP
++.fi
++.nf
++\f3 256 (when using \-genkeypair and \-keyalg is "EC")\fP
++.fi
++.nf
++\f3 56 (when using \-genseckey and \-keyalg is "DES")\fP
++.fi
++.nf
++\f3 168 (when using \-genseckey and \-keyalg is "DESede")\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-validity 90\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keystore <the file named \&.keystore in the user\&'s home directory>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-storetype <the value of the "keystore\&.type" property in the\fP
++.fi
++.nf
++\f3 security properties file, which is returned by the static\fP
++.fi
++.nf
++\f3 getDefaultType method in java\&.security\&.KeyStore>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-file\fP
++.fi
++.nf
++\f3 stdin (if reading)\fP
++.fi
++.nf
++\f3 stdout (if writing)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-protected false\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In generating a public/private key pair, the signature algorithm (\f3-sigalg\fR option) is derived from the algorithm of the underlying private key:
++.TP 0.2i
++\(bu
++If the underlying private key is of type DSA, then the \f3-sigalg\fR option defaults to SHA1withDSA\&.
++.TP 0.2i
++\(bu
++If the underlying private key is of type RSA, then the \f3-sigalg\fR option defaults to SHA256withRSA\&.
++.TP 0.2i
++\(bu
++If the underlying private key is of type EC, then the \f3-sigalg\fR option defaults to SHA256withECDSA\&.
++.PP
++For a full list of \f3-keyalg\fR and \f3-sigalg\fR arguments, see Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++.SH COMMON\ OPTIONS
++The \f3-v\fR option can appear for all commands except \f3-help\fR\&. When the \f3-v\fR option appears, it signifies verbose mode, which means that more information is provided in the output\&.
++.PP
++There is also a \f3-Jjavaoption\fR argument that can appear for any command\&. When the \f3-Jjavaoption\fR appears, the specified \f3javaoption\fR string is passed directly to the Java interpreter\&. This option does not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
++.PP
++These options can appear for all commands operating on a keystore:
++.TP
++-storetype \fIstoretype\fR
++.br
++This qualifier specifies the type of keystore to be instantiated\&.
++.TP
++-keystore \fIkeystore\fR
++.br
++The keystore location\&.
++
++If the JKS \f3storetype\fR is used and a keystore file does not yet exist, then certain \f3keytool\fR commands can result in a new keystore file being created\&. For example, if \f3keytool -genkeypair\fR is called and the \f3-keystore\fR option is not specified, the default keystore file named \f3\&.keystore\fR in the user\&'s home directory is created when it does not already exist\&. Similarly, if the \f3-keystore ks_file\fR option is specified but ks_file does not exist, then it is created\&. For more information on the JKS \f3storetype\fR, see the \fIKeyStore Implementation\fR section in KeyStore aliases\&.
++
++Note that the input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified if the keystore is not file-based\&. For example, when it resides on a hardware token device\&.
++.TP
++-storepass[:\fIenv\fR| :\fIfile\fR] argument
++.br
++The password that is used to protect the integrity of the keystore\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the \f3value\fR argument, which must be at least 6 characters long\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named argument\&.
++.RE
++
++
++\fINote:\fR All other options that require passwords, such as \f3-keypass\fR, \f3-srckeypass\fR, -\f3destkeypass\fR, \f3-srcstorepass\fR, and \f3-deststorepass\fR, accept the \fIenv\fR and \fIfile\fR modifiers\&. Remember to separate the password option and the modifier with a colon (:)\&.
++
++The password must be provided to all commands that access the keystore contents\&. For such commands, when the \f3-storepass\fR option is not provided at the command line, the user is prompted for it\&.
++
++When retrieving information from the keystore, the password is optional\&. If no password is specified, then the integrity of the retrieved information cannot be verified and a warning is displayed\&.
++.TP
++-providerName \fIprovider_name\fR
++.br
++Used to identify a cryptographic service provider\&'s name when listed in the security properties file\&.
++.TP
++-providerClass \fIprovider_class_name\fR
++.br
++Used to specify the name of a cryptographic service provider\&'s master class file when the service provider is not listed in the security properties file\&.
++.TP
++-providerArg \fIprovider_arg\fR
++.br
++Used with the \f3-providerClass\fR option to represent an optional string input argument for the constructor of \f3provider_class_name\fR\&.
++.TP
++-protected
++.br
++Either \f3true\fR or \f3false\fR\&. This value should be specified as \f3true\fR when a password must be specified by way of a protected authentication path such as a dedicated PIN reader\&.Because there are two keystores involved in the \f3-importkeystore\fR command, the following two options \f3-srcprotected\fR and -\f3destprotected\fR are provided for the source keystore and the destination keystore respectively\&.
++.TP
++-ext \fI{name{:critical} {=value}}\fR
++.br
++Denotes an X\&.509 certificate extension\&. The option can be used in \f3-genkeypair\fR and \f3-gencert\fR to embed extensions into the certificate generated, or in \f3-certreq\fR to show what extensions are requested in the certificate request\&. The option can appear multiple times\&. The \f3name\fR argument can be a supported extension name (see Named Extensions) or an arbitrary OID number\&. The \f3value\fR argument, when provided, denotes the argument for the extension\&. When \fIvalue\fR is omitted, that means that the default value of the extension or the extension requires no argument\&. The \f3:critical\fR modifier, when provided, means the extension\&'s \f3isCritical\fR attribute is \f3true\fR; otherwise, it is \f3false\fR\&. You can use \f3:c\fR in place of \f3:critical\fR\&.
++.SH NAMED\ EXTENSIONS
++The \f3keytool\fR command supports these named extensions\&. The names are not case-sensitive)\&.
++.TP
++BC or BasicContraints
++\fIValues\fR: The full form is: \f3ca:{true|false}[,pathlen:<len>]\fR or \f3<len>\fR, which is short for \f3ca:true,pathlen:<len>\fR\&. When <\f3len\fR> is omitted, you have \f3ca:true\fR\&.
++.TP
++KU or KeyUsage
++\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3digitalSignature\fR, \f3nonRepudiation\fR (contentCommitment), \f3keyEncipherment\fR, \f3dataEncipherment\fR, \f3keyAgreement\fR, \f3keyCertSign\fR, \f3cRLSign\fR, \f3encipherOnly\fR, \f3decipherOnly\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters (\f3dig\fR for \f3digitalSignature\fR) or in camel-case style (\f3dS\fR for \f3digitalSignature\fR or \f3cRLS\fR for \f3cRLSign\fR), as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
++.TP
++EKU or ExtendedKeyUsage
++\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3anyExtendedKeyUsage\fR, \f3serverAuth\fR, \f3clientAuth\fR, \f3codeSigning\fR, \f3emailProtection\fR, \f3timeStamping\fR, \f3OCSPSigning\fR, or any \fIOID string\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters or in camel-case style, as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
++.TP
++SAN or SubjectAlternativeName
++\fIValues\fR: \f3type\fR:\f3value\fR(,t\f3ype:value\fR)*, where \f3type\fR can be \f3EMAIL\fR, \f3URI\fR, \f3DNS\fR, \f3IP\fR, or \f3OID\fR\&. The \f3value\fR argument is the string format value for the \f3type\fR\&.
++.TP
++IAN or IssuerAlternativeName
++\fIValues\fR: Same as \f3SubjectAlternativeName\fR\&.
++.TP
++SIA or SubjectInfoAccess
++\fIValues\fR: \f3method\fR:\f3location-type\fR:\f3location-value\fR (,\f3method:location-type\fR:\f3location-value\fR)*, where \f3method\fR can be \f3timeStamping\fR, \f3caRepository\fR or any OID\&. The \f3location-type\fR and \f3location-value\fR arguments can be any \f3type\fR:\f3value\fR supported by the \f3SubjectAlternativeName\fR extension\&.
++.TP
++AIA or AuthorityInfoAccess
++\fIValues\fR: Same as \f3SubjectInfoAccess\fR\&. The \f3method\fR argument can be \f3ocsp\fR,\f3caIssuers\fR, or any OID\&.
++.PP
++When \f3name\fR is OID, the value is the hexadecimal dumped DER encoding of the \f3extnValue\fR for the extension excluding the OCTET STRING type and length bytes\&. Any extra character other than standard hexadecimal numbers (0-9, a-f, A-F) are ignored in the HEX string\&. Therefore, both 01:02:03:04 and 01020304 are accepted as identical values\&. When there is no value, the extension has an empty value field\&.
++.PP
++A special name \f3honored\fR, used in \f3-gencert\fR only, denotes how the extensions included in the certificate request should be honored\&. The value for this name is a comma separated list of \f3all\fR (all requested extensions are honored), \f3name{:[critical|non-critical]}\fR (the named extension is honored, but using a different \f3isCritical\fR attribute) and \f3-name\fR (used with \f3all\fR, denotes an exception)\&. Requested extensions are not honored by default\&.
++.PP
++If, besides the\f3-ext honored\fR option, another named or OID \f3-ext\fR option is provided, this extension is added to those already honored\&. However, if this name (or OID) also appears in the honored value, then its value and criticality overrides the one in the request\&.
++.PP
++The \f3subjectKeyIdentifier\fR extension is always created\&. For non-self-signed certificates, the \f3authorityKeyIdentifier\fR is created\&.
++.PP
++\fINote:\fR Users should be aware that some combinations of extensions (and other certificate fields) may not conform to the Internet standard\&. See Certificate Conformance Warning\&.
++.SH COMMANDS
++.TP
++-gencert
++.sp
++.nf
++\f3{\-rfc} {\-infile \fIinfile\fR} {\-outfile \fIoutfile\fR} {\-alias \fIalias\fR} {\-sigalg \fIsigalg\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-dname \fIdname\fR} {\-startdate \fIstartdate\fR {\-ext \fIext\fR}* {\-validity \fIvalDays\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-keypass \fIkeypass\fR] {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-providername \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a certificate as a response to a certificate request file (which can be created by the \f3keytool\fR\f3-certreq\fR command)\&. The command reads the request from \fIinfile\fR (if omitted, from the standard input), signs it using alias\&'s private key, and outputs the X\&.509 certificate into \fIoutfile\fR (if omitted, to the standard output)\&. When\f3-rfc\fR is specified, the output format is Base64-encoded PEM; otherwise, a binary DER is created\&.
++
++The \f3sigalg\fR value specifies the algorithm that should be used to sign the certificate\&. The \f3startdate\fR argument is the start time and date that the certificate is valid\&. The \f3valDays\fR argument tells the number of days for which the certificate should be considered valid\&.
++
++When \f3dname\fR is provided, it is used as the subject of the generated certificate\&. Otherwise, the one from the certificate request is used\&.
++
++The \f3ext\fR value shows what X\&.509 extensions will be embedded in the certificate\&. Read Common Options for the grammar of \f3-ext\fR\&.
++
++The \f3-gencert\fR option enables you to create certificate chains\&. The following example creates a certificate, \f3e1\fR, that contains three certificates in its certificate chain\&.
++
++The following commands creates four key pairs named \f3ca\fR, \f3ca1\fR, \f3ca2\fR, and \f3e1\fR:
++.sp
++.nf
++\f3keytool \-alias ca \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias ca1 \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias ca2 \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias e1 \-dname CN=E1 \-genkeypair\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following two commands create a chain of signed certificates; \f3ca\fR signs \f3ca1\fR and \f3ca1\fR signs \f3ca2\fR, all of which are self-issued:
++.sp
++.nf
++\f3keytool \-alias ca1 \-certreq |\fP
++.fi
++.nf
++\f3 keytool \-alias ca \-gencert \-ext san=dns:ca1 |\fP
++.fi
++.nf
++\f3 keytool \-alias ca1 \-importcert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-alias ca2 \-certreq |\fP
++.fi
++.nf
++\f3 $KT \-alias ca1 \-gencert \-ext san=dns:ca2 |\fP
++.fi
++.nf
++\f3 $KT \-alias ca2 \-importcert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following command creates the certificate \f3e1\fR and stores it in the file \f3e1\&.cert\fR, which is signed by \f3ca2\fR\&. As a result, \f3e1\fR should contain \f3ca\fR, \f3ca1\fR, and \f3ca2\fR in its certificate chain:
++.sp
++.nf
++\f3keytool \-alias e1 \-certreq | keytool \-alias ca2 \-gencert > e1\&.cert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-genkeypair
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} {\-sigalg \fIsigalg\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-dname \fIdname\fR] [\-keypass \fIkeypass\fR] {\-startdate \fIvalue\fR} {\-ext \fIext\fR}*\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-validity \fIvalDays\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a key pair (a public key and associated private key)\&. Wraps the public key into an X\&.509 v3 self-signed certificate, which is stored as a single-element certificate chain\&. This certificate chain and the private key are stored in a new keystore entry identified by alias\&.
++
++The \f3keyalg\fR value specifies the algorithm to be used to generate the key pair, and the \f3keysize\fR value specifies the size of each key to be generated\&. The \f3sigalg\fR value specifies the algorithm that should be used to sign the self-signed certificate\&. This algorithm must be compatible with the \f3keyalg\fR value\&.
++
++The \f3dname\fR value specifies the X\&.500 Distinguished Name to be associated with the value of \f3alias\fR, and is used as the issuer and subject fields in the self-signed certificate\&. If no distinguished name is provided at the command line, then the user is prompted for one\&.
++
++The value of \f3keypass\fR is a password used to protect the private key of the generated key pair\&. If no password is provided, then the user is prompted for it\&. If you press \fIthe Return key\fR at the prompt, then the key password is set to the same password as the keystore password\&. The \f3keypass\fR value must be at least 6 characters\&.
++
++The value of \f3startdate\fR specifies the issue time of the certificate, also known as the "Not Before" value of the X\&.509 certificate\&'s Validity field\&.
++
++The option value can be set in one of these two forms:
++
++\f3([+-]nnn[ymdHMS])+\fR
++
++\f3[yyyy/mm/dd] [HH:MM:SS]\fR
++
++With the first form, the issue time is shifted by the specified value from the current time\&. The value is a concatenation of a sequence of subvalues\&. Inside each subvalue, the plus sign (+) means shift forward, and the minus sign (-) means shift backward\&. The time to be shifted is \f3nnn\fR units of years, months, days, hours, minutes, or seconds (denoted by a single character of \f3y\fR, \f3m\fR, \f3d\fR, \f3H\fR, \f3M\fR, or \f3S\fR respectively)\&. The exact value of the issue time is calculated using the \f3java\&.util\&.GregorianCalendar\&.add(int field, int amount)\fR method on each subvalue, from left to right\&. For example, by specifying, the issue time will be:
++.sp
++.nf
++\f3Calendar c = new GregorianCalendar();\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.YEAR, \-1);\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.MONTH, 1);\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.DATE, \-1);\fP
++.fi
++.nf
++\f3return c\&.getTime()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++With the second form, the user sets the exact issue time in two parts, year/month/day and hour:minute:second (using the local time zone)\&. The user can provide only one part, which means the other part is the same as the current date (or time)\&. The user must provide the exact number of digits as shown in the format definition (padding with 0 when shorter)\&. When both the date and time are provided, there is one (and only one) space character between the two parts\&. The hour should always be provided in 24 hour format\&.
++
++When the option is not provided, the start date is the current time\&. The option can be provided at most once\&.
++
++The value of \f3valDays\fR specifies the number of days (starting at the date specified by \f3-startdate\fR, or the current date when \f3-startdate\fR is not specified) for which the certificate should be considered valid\&.
++
++This command was named \f3-genkey\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-genkeypair\fR, is preferred going forward\&.
++.TP
++-genseckey
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} [\-keypass \fIkeypass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a secret key and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&.
++
++The value of \f3keyalg\fR specifies the algorithm to be used to generate the secret key, and the value of \f3keysize\fR specifies the size of the key to be generated\&. The \f3keypass\fR value is a password that protects the secret key\&. If no password is provided, then the user is prompted for it\&. If you press the Return key at the prompt, then the key password is set to the same password that is used for the \f3keystore\fR\&. The \f3keypass\fR value must be at least 6 characters\&.
++.TP
++-importcert
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} [\-keypass \fIkeypass\fR] {\-noprompt} {\-trustcacerts}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads the certificate or certificate chain (where the latter is supplied in a PKCS#7 formatted reply or a sequence of X\&.509 certificates) from the file \f3cert_file\fR, and stores it in the \f3keystore\fR entry identified by \f3alias\fR\&. If no file is specified, then the certificate or certificate chain is read from \f3stdin\fR\&.
++
++The \f3keytool\fR command can import X\&.509 v1, v2, and v3 certificates, and PKCS#7 formatted certificate chains consisting of certificates of that type\&. The data to be imported must be provided either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. In the latter case, the encoding must be bounded at the beginning by a string that starts with \f3-\fR\f3----BEGIN\fR, and bounded at the end by a string that starts with \f3-----END\fR\&.
++
++You import a certificate for two reasons: To add it to the list of trusted certificates, and to import a certificate reply received from a certificate authority (CA) as the result of submitting a Certificate Signing Request to that CA (see the \f3-certreq\fR option in Commands)\&.
++
++Which type of import is intended is indicated by the value of the \f3-alias\fR option\&. If the alias does not point to a key entry, then the \f3keytool\fR command assumes you are adding a trusted certificate entry\&. In this case, the alias should not already exist in the keystore\&. If the alias does already exist, then the \f3keytool\fR command outputs an error because there is already a trusted certificate for that alias, and does not import the certificate\&. If the alias points to a key entry, then the \f3keytool\fR command assumes you are importing a certificate reply\&.
++.TP
++-importpassword
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Imports a passphrase and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&. The passphrase may be supplied via the standard input stream; otherwise the user is prompted for it\&. \f3keypass\fR is a password used to protect the imported passphrase\&. If no password is provided, the user is prompted for it\&. If you press the Return key at the prompt, the key password is set to the same password as that used for the \f3keystore\fR\&. \f3keypass\fR must be at least 6 characters long\&.
++.TP
++-importkeystore
++.sp
++.nf
++\f3{\-srcstoretype \fIsrcstoretype\fR} {\-deststoretype \fIdeststoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-srcstorepass \fIsrcstorepass\fR] [\-deststorepass \fIdeststorepass\fR] {\-srcprotected}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-destprotected} \fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-srcalias \fIsrcalias\fR {\-destalias \fIdestalias\fR} [\-srckeypass \fIsrckeypass\fR]} \fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-destkeypass \fIdestkeypass\fR] {\-noprompt}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-srcProviderName \fIsrc_provider_name\fR} {\-destProviderName \fIdest_provider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Imports a single entry or all entries from a source keystore to a destination keystore\&.
++
++When the \f3-srcalias\fR option is provided, the command imports the single entry identified by the alias to the destination keystore\&. If a destination alias is not provided with \f3destalias\fR, then \f3srcalias\fR is used as the destination alias\&. If the source entry is protected by a password, then \f3srckeypass\fR is used to recover the entry\&. If \fIsrckeypass\fR is not provided, then the \f3keytool\fR command attempts to use \f3srcstorepass\fR to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. The destination entry is protected with \f3destkeypass\fR\&. If \f3destkeypass\fR is not provided, then the destination entry is protected with the source entry password\&. For example, most third-party tools require \f3storepass\fR and \f3keypass\fR in a PKCS #12 keystore to be the same\&. In order to create a PKCS #12 keystore for these tools, always specify a \f3-destkeypass\fR to be the same as \f3-deststorepass\fR\&.
++
++If the \f3-srcalias\fR option is not provided, then all entries in the source keystore are imported into the destination keystore\&. Each destination entry is stored under the alias from the source entry\&. If the source entry is protected by a password, then \f3srcstorepass\fR is used to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. If a source keystore entry type is not supported in the destination keystore, or if an error occurs while storing an entry into the destination keystore, then the user is prompted whether to skip the entry and continue or to quit\&. The destination entry is protected with the source entry password\&.
++
++If the destination alias already exists in the destination keystore, then the user is prompted to either overwrite the entry or to create a new entry under a different alias name\&.
++
++If the \f3-noprompt\fR option is provided, then the user is not prompted for a new destination alias\&. Existing entries are overwritten with the destination alias name\&. Entries that cannot be imported are skipped and a warning is displayed\&.
++.TP
++-printcertreq
++.sp
++.nf
++\f3{\-file \fIfile\fR}\fP
++.fi
++.sp
++
++
++Prints the content of a PKCS #10 format certificate request, which can be generated by the \f3keytool\fR\f3-certreq\fR command\&. The command reads the request from file\&. If there is no file, then the request is read from the standard input\&.
++.TP
++-certreq
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-dname \fIdname\fR} {\-sigalg \fIsigalg\fR} {\-file \fIcertreq_file\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a Certificate Signing Request (CSR) using the PKCS #10 format\&.
++
++A CSR is intended to be sent to a certificate authority (CA)\&. The CA authenticates the certificate requestor (usually off-line) and will return a certificate or certificate chain, used to replace the existing certificate chain (which initially consists of a self-signed certificate) in the keystore\&.
++
++The private key associated with alias is used to create the PKCS #10 certificate request\&. To access the private key, the correct password must be provided\&. If \f3keypass\fR is not provided at the command line and is different from the password used to protect the integrity of the keystore, then the user is prompted for it\&. If \f3dname\fR is provided, then it is used as the subject in the CSR\&. Otherwise, the X\&.500 Distinguished Name associated with alias is used\&.
++
++The \f3sigalg\fR value specifies the algorithm that should be used to sign the CSR\&.
++
++The CSR is stored in the file certreq_file\&. If no file is specified, then the CSR is output to \f3stdout\fR\&.
++
++Use the \f3importcert\fR command to import the response from the CA\&.
++.TP
++-exportcert
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-rfc} {\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads from the keystore the certificate associated with \fIalias\fR and stores it in the cert_file file\&. When no file is specified, the certificate is output to \f3stdout\fR\&.
++
++The certificate is by default output in binary encoding\&. If the \f3-rfc\fR option is specified, then the output in the printable encoding format defined by the Internet RFC 1421 Certificate Encoding Standard\&.
++
++If \f3alias\fR refers to a trusted certificate, then that certificate is output\&. Otherwise, \f3alias\fR refers to a key entry with an associated certificate chain\&. In that case, the first certificate in the chain is returned\&. This certificate authenticates the public key of the entity addressed by \f3alias\fR\&.
++
++This command was named \f3-export\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-exportcert\fR, is preferred going forward\&.
++.TP
++-list
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v | \-rfc} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Prints to \f3stdout\fR the contents of the keystore entry identified by \f3alias\fR\&. If no \f3alias\fR is specified, then the contents of the entire keystore are printed\&.
++
++This command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format, with additional information such as the owner, issuer, serial number, and any extensions\&. If the \f3-rfc\fR option is specified, then the certificate contents are printed using the printable encoding format, as defined by the Internet RFC 1421 Certificate Encoding Standard\&.
++
++You cannot specify both \f3-v\fR and \f3-rfc\fR\&.
++.TP
++-printcert
++.sp
++.nf
++\f3{\-file \fIcert_file\fR | \-sslserver \fIhost\fR[:\fIport\fR]} {\-jarfile \fIJAR_file\fR {\-rfc} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads the certificate from the file cert_file, the SSL server located at host:port, or the signed JAR file \f3JAR_file\fR (with the \f3-jarfile\fR option and prints its contents in a human-readable format\&. When no port is specified, the standard HTTPS port 443 is assumed\&. Note that \f3-sslserver\fR and -file options cannot be provided at the same time\&. Otherwise, an error is reported\&. If neither option is specified, then the certificate is read from \f3stdin\fR\&.
++
++When\f3-rfc\fR is specified, the \f3keytool\fR command prints the certificate in PEM mode as defined by the Internet RFC 1421 Certificate Encoding standard\&. See Internet RFC 1421 Certificate Encoding Standard\&.
++
++If the certificate is read from a file or \f3stdin\fR, then it might be either binary encoded or in printable encoding format, as defined by the RFC 1421 Certificate Encoding standard\&.
++
++If the SSL server is behind a firewall, then the \f3-J-Dhttps\&.proxyHost=proxyhost\fR and \f3-J-Dhttps\&.proxyPort=proxyport\fR options can be specified on the command line for proxy tunneling\&. See Java Secure Socket Extension (JSSE) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.html
++
++\fINote:\fR This option can be used independently of a keystore\&.
++.TP
++-printcrl
++.sp
++.nf
++\f3\-file \fIcrl_\fR {\-v}\fP
++.fi
++.sp
++
++
++Reads the Certificate Revocation List (CRL) from the file \f3crl_\fR\&. A CRL is a list of digital certificates that were revoked by the CA that issued them\&. The CA generates the \f3crl_\fR file\&.
++
++\fINote:\fR This option can be used independently of a keystore\&.
++.TP
++-storepasswd
++.sp
++.nf
++\f3[\-new \fInew_storepass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Changes the password used to protect the integrity of the keystore contents\&. The new password is \f3new_storepass\fR, which must be at least 6 characters\&.
++.TP
++-keypasswd
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-keypass \fIold_keypass\fR] [\-new \fInew_keypass\fR] {\-storetype \fIstoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Changes the password under which the private/secret key identified by \f3alias\fR is protected, from \f3old_keypass\fR to \f3new_keypass\fR, which must be at least 6 characters\&.
++
++If the \f3-keypass\fR option is not provided at the command line, and the key password is different from the keystore password, then the user is prompted for it\&.
++
++If the \f3-new\fR option is not provided at the command line, then the user is prompted for it
++.TP
++-delete
++.sp
++.nf
++\f3[\-alias \fIalias\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR} \fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Deletes from the keystore the entry identified by \f3alias\fR\&. The user is prompted for the alias, when no alias is provided at the command line\&.
++.TP
++-changealias
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-destalias \fIdestalias\fR] [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Move an existing keystore entry from the specified \f3alias\fR to a new alias, \f3destalias\fR\&. If no destination alias is provided, then the command prompts for one\&. If the original entry is protected with an entry password, then the password can be supplied with the \f3-keypass\fR option\&. If no key password is provided, then the \f3storepass\fR (if provided) is attempted first\&. If the attempt fails, then the user is prompted for a password\&.
++.TP
++-help
++.br
++Lists the basic commands and their options\&.
++
++For more information about a specific command, enter the following, where \f3command_name\fR is the name of the command: \f3keytool -command_name -help\fR\&.
++.SH EXAMPLES
++This example walks through the sequence of steps to create a keystore for managing public/private key pair and certificates from trusted entities\&.
++.SS GENERATE\ THE\ KEY\ PAIR
++First, create a keystore and generate the key pair\&. You can use a command such as the following typed as a single line:
++.sp
++.nf
++\f3keytool \-genkeypair \-dname "cn=Mark Jones, ou=Java, o=Oracle, c=US"\fP
++.fi
++.nf
++\f3 \-alias business \-keypass <new password for private key>\fP
++.fi
++.nf
++\f3 \-keystore /working/mykeystore\fP
++.fi
++.nf
++\f3 \-storepass <new password for keystore> \-validity 180\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The command creates the keystore named \f3mykeystore\fR in the working directory (assuming it does not already exist), and assigns it the password specified by \f3<new password for keystore>\fR\&. It generates a public/private key pair for the entity whose distinguished name has a common name of Mark Jones, organizational unit of Java, organization of Oracle and two-letter country code of US\&. It uses the default DSA key generation algorithm to create the keys; both are 1024 bits\&.
++.PP
++The command uses the default SHA1withDSA signature algorithm to create a self-signed certificate that includes the public key and the distinguished name information\&. The certificate is valid for 180 days, and is associated with the private key in a keystore entry referred to by the alias \f3business\fR\&. The private key is assigned the password specified by \f3<new password for private key>\fR\&.
++.PP
++The command is significantly shorter when the option defaults are accepted\&. In this case, no options are required, and the defaults are used for unspecified options that have default values\&. You are prompted for any required values\&. You could have the following:
++.sp
++.nf
++\f3keytool \-genkeypair\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this case, a keystore entry with the alias \f3mykey\fR is created, with a newly generated key pair and a certificate that is valid for 90 days\&. This entry is placed in the keystore named \f3\&.keystore\fR in your home directory\&. The keystore is created when it does not already exist\&. You are prompted for the distinguished name information, the keystore password, and the private key password\&.
++.PP
++The rest of the examples assume you executed the \f3-genkeypair\fR command without options specified, and that you responded to the prompts with values equal to those specified in the first \f3-genkeypair\fR command\&. For example, a distinguished name of \f3cn=Mark Jones\fR, \f3ou=Java\fR, \f3o=Oracle\fR, \f3c=US\fR)\&.
++.SS REQUEST\ A\ SIGNED\ CERTIFICATE\ FROM\ A\ CA
++Generating the key pair created a self-signed certificate\&. A certificate is more likely to be trusted by others when it is signed by a Certification Authority (CA)\&. To get a CA signature, first generate a Certificate Signing Request (CSR), as follows:
++.sp
++.nf
++\f3keytool \-certreq \-file MarkJ\&.csr\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This creates a CSR for the entity identified by the default alias \f3mykey\fR and puts the request in the file named MarkJ\&.csr\&. Submit this file to a CA, such as VeriSign\&. The CA authenticates you, the requestor (usually off-line), and returns a certificate, signed by them, authenticating your public key\&. In some cases, the CA returns a chain of certificates, each one authenticating the public key of the signer of the previous certificate in the chain\&.
++.SS IMPORT\ A\ CERTIFICATE\ FOR\ THE\ CA
++You now need to replace the self-signed certificate with a certificate chain, where each certificate in the chain authenticates the public key of the signer of the previous certificate in the chain, up to a root CA\&.
++.PP
++Before you import the certificate reply from a CA, you need one or more trusted certificates in your keystore or in the \f3cacerts\fR keystore file\&. See \f3-importcert\fR in Commands\&.
++.TP 0.2i
++\(bu
++If the certificate reply is a certificate chain, then you need the top certificate of the chain\&. The root CA certificate that authenticates the public key of the CA\&.
++.TP 0.2i
++\(bu
++If the certificate reply is a single certificate, then you need a certificate for the issuing CA (the one that signed it)\&. If that certificate is not self-signed, then you need a certificate for its signer, and so on, up to a self-signed root CA certificate\&.
++.PP
++The \f3cacerts\fR keystore file ships with several VeriSign root CA certificates, so you probably will not need to import a VeriSign certificate as a trusted certificate in your keystore\&. But if you request a signed certificate from a different CA, and a certificate authenticating that CA\&'s public key was not added to \f3cacerts\fR, then you must import a certificate from the CA as a trusted certificate\&.
++.PP
++A certificate from a CA is usually either self-signed or signed by another CA, in which case you need a certificate that authenticates that CA\&'s public key\&. Suppose company ABC, Inc\&., is a CA, and you obtain a file named A\f3BCCA\&.cer\fR that is supposed to be a self-signed certificate from ABC, that authenticates that CA\&'s public key\&. Be careful to ensure the certificate is valid before you import it as a trusted certificate\&. View it first with the \f3keytool -printcert\fR command or the \f3keytool -importcert\fR command without the \f3-noprompt\fR option, and make sure that the displayed certificate fingerprints match the expected ones\&. You can call the person who sent the certificate, and compare the fingerprints that you see with the ones that they show or that a secure public key repository shows\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s (for example, an attacker\&'s) certificate\&. If such an attack takes place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker has signed\&.
++.PP
++If you trust that the certificate is valid, then you can add it to your keystore with the following command:
++.sp
++.nf
++\f3keytool \-importcert \-alias abc \-file ABCCA\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This command creates a trusted certificate entry in the keystore, with the data from the file ABCCA\&.cer, and assigns the alias \f3abc\fR to the entry\&.
++.SS IMPORT\ THE\ CERTIFICATE\ REPLY\ FROM\ THE\ CA
++After you import a certificate that authenticates the public key of the CA you submitted your certificate signing request to (or there is already such a certificate in the cacerts file), you can import the certificate reply and replace your self-signed certificate with a certificate chain\&. This chain is the one returned by the CA in response to your request (when the CA reply is a chain), or one constructed (when the CA reply is a single certificate) using the certificate reply and trusted certificates that are already available in the keystore where you import the reply or in the \f3cacerts\fR keystore file\&.
++.PP
++For example, if you sent your certificate signing request to VeriSign, then you can import the reply with the following, which assumes the returned certificate is named VSMarkJ\&.cer:
++.sp
++.nf
++\f3keytool \-importcert \-trustcacerts \-file VSMarkJ\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS EXPORT\ A\ CERTIFICATE\ THAT\ AUTHENTICATES\ THE\ PUBLIC\ KEY
++If you used the \f3jarsigner\fR command to sign a Java Archive (JAR) file, then clients that want to use the file will want to authenticate your signature\&. One way the clients can authenticate you is by first importing your public key certificate into their keystore as a trusted entry\&.
++.PP
++You can export the certificate and supply it to your clients\&. As an example, you can copy your certificate to a file named MJ\&.cer with the following command that assumes the entry has an alias of \f3mykey\fR:
++.sp
++.nf
++\f3keytool \-exportcert \-alias mykey \-file MJ\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++With the certificate and the signed JAR file, a client can use the \f3jarsigner\fR command to authenticate your signature\&.
++.SS IMPORT\ KEYSTORE
++The command \f3importkeystore\fR is used to import an entire keystore into another keystore, which means all entries from the source keystore, including keys and certificates, are all imported to the destination keystore within a single command\&. You can use this command to import entries from a different type of keystore\&. During the import, all new entries in the destination keystore will have the same alias names and protection passwords (for secret keys and private keys)\&. If the \f3keytool\fR command cannot recover the private keys or secret keys from the source keystore, then it prompts you for a password\&. If it detects alias duplication, then it asks you for a new alias, and you can specify a new alias or simply allow the \f3keytool\fR command to overwrite the existing one\&.
++.PP
++For example, to import entries from a typical JKS type keystore key\&.jks into a PKCS #11 type hardware-based keystore, use the command:
++.sp
++.nf
++\f3keytool \-importkeystore\fP
++.fi
++.nf
++\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
++.fi
++.nf
++\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
++.fi
++.nf
++\f3 \-srcstorepass <src keystore password>\fP
++.fi
++.nf
++\f3 \-deststorepass <destination keystore pwd>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3importkeystore\fR command can also be used to import a single entry from a source keystore to a destination keystore\&. In this case, besides the options you see in the previous example, you need to specify the alias you want to import\&. With the \f3-srcalias\fR option specified, you can also specify the destination alias name in the command line, as well as protection password for a secret/private key and the destination protection password you want\&. The following command demonstrates this:
++.sp
++.nf
++\f3keytool \-importkeystore\fP
++.fi
++.nf
++\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
++.fi
++.nf
++\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
++.fi
++.nf
++\f3 \-srcstorepass <src keystore password>\fP
++.fi
++.nf
++\f3 \-deststorepass <destination keystore pwd>\fP
++.fi
++.nf
++\f3 \-srcalias myprivatekey \-destalias myoldprivatekey\fP
++.fi
++.nf
++\f3 \-srckeypass <source entry password>\fP
++.fi
++.nf
++\f3 \-destkeypass <destination entry password>\fP
++.fi
++.nf
++\f3 \-noprompt\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS GENERATE\ CERTIFICATES\ FOR\ AN\ SSL\ SERVER
++The following are \f3keytool\fR commands to generate key pairs and certificates for three entities: Root CA (\f3root\fR), Intermediate CA (\f3ca\fR), and SSL server (\f3server\fR)\&. Ensure that you store all the certificates in the same keystore\&. In these examples, RSA is the recommended the key algorithm\&.
++.sp
++.nf
++\f3keytool \-genkeypair \-keystore root\&.jks \-alias root \-ext bc:c\fP
++.fi
++.nf
++\f3keytool \-genkeypair \-keystore ca\&.jks \-alias ca \-ext bc:c\fP
++.fi
++.nf
++\f3keytool \-genkeypair \-keystore server\&.jks \-alias server\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-keystore root\&.jks \-alias root \-exportcert \-rfc > root\&.pem\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-storepass <storepass> \-keystore ca\&.jks \-certreq \-alias ca |\fP
++.fi
++.nf
++\f3 keytool \-storepass <storepass> \-keystore root\&.jks\fP
++.fi
++.nf
++\f3 \-gencert \-alias root \-ext BC=0 \-rfc > ca\&.pem\fP
++.fi
++.nf
++\f3keytool \-keystore ca\&.jks \-importcert \-alias ca \-file ca\&.pem\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-storepass <storepass> \-keystore server\&.jks \-certreq \-alias server |\fP
++.fi
++.nf
++\f3 keytool \-storepass <storepass> \-keystore ca\&.jks \-gencert \-alias ca\fP
++.fi
++.nf
++\f3 \-ext ku:c=dig,kE \-rfc > server\&.pem\fP
++.fi
++.nf
++\f3cat root\&.pem ca\&.pem server\&.pem |\fP
++.fi
++.nf
++\f3 keytool \-keystore server\&.jks \-importcert \-alias server\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH TERMS
++.TP
++Keystore
++A keystore is a storage facility for cryptographic keys and certificates\&.
++.TP
++Keystore entries
++Keystores can have different types of entries\&. The two most applicable entry types for the \f3keytool\fR command include the following:
++
++\fIKey entries\fR: Each entry holds very sensitive cryptographic key information, which is stored in a protected format to prevent unauthorized access\&. Typically, a key stored in this type of entry is a secret key, or a private key accompanied by the certificate chain for the corresponding public key\&. See Certificate Chains\&. The \f3keytool\fR command can handle both types of entries, while the \f3jarsigner\fR tool only handles the latter type of entry, that is private keys and their associated certificate chains\&.
++
++\fITrusted certificate entries\fR: Each entry contains a single public key certificate that belongs to another party\&. The entry is called a trusted certificate because the keystore owner trusts that the public key in the certificate belongs to the identity identified by the subject (owner) of the certificate\&. The issuer of the certificate vouches for this, by signing the certificate\&.
++.TP
++KeyStore aliases
++All keystore entries (key and trusted certificate entries) are accessed by way of unique aliases\&.
++
++An alias is specified when you add an entity to the keystore with the \f3-genseckey\fR command to generate a secret key, the \f3-genkeypair\fR command to generate a key pair (public and private key), or the \f3-importcert\fR command to add a certificate or certificate chain to the list of trusted certificates\&. Subsequent \f3keytool\fR commands must use this same alias to refer to the entity\&.
++
++For example, you can use the alias \f3duke\fR to generate a new public/private key pair and wrap the public key into a self-signed certificate with the following command\&. See Certificate Chains\&.
++.sp
++.nf
++\f3keytool \-genkeypair \-alias duke \-keypass dukekeypasswd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This example specifies an initial password of \f3dukekeypasswd\fR required by subsequent commands to access the private key associated with the alias \f3duke\fR\&. If you later want to change Duke\&'s private key password, use a command such as the following:
++.sp
++.nf
++\f3keytool \-keypasswd \-alias duke \-keypass dukekeypasswd \-new newpass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This changes the password from \f3dukekeypasswd\fR to \f3newpass\fR\&. A password should not be specified on a command line or in a script unless it is for testing purposes, or you are on a secure system\&. If you do not specify a required password option on a command line, then you are prompted for it\&.
++.TP
++KeyStore implementation
++The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies well-defined interfaces to access and modify the information in a keystore\&. It is possible for there to be multiple different concrete implementations, where each implementation is that for a particular type of keystore\&.
++
++Currently, two command-line tools (\f3keytool\fR and \f3jarsigner\fR) and a GUI-based tool named Policy Tool make use of keystore implementations\&. Because the \f3KeyStore\fR class is \f3public\fR, users can write additional security applications that use it\&.
++
++There is a built-in default implementation, provided by Oracle\&. It implements the keystore as a file with a proprietary keystore type (format) named JKS\&. It protects each private key with its individual password, and also protects the integrity of the entire keystore with a (possibly different) password\&.
++
++Keystore implementations are provider-based\&. More specifically, the application interfaces supplied by \f3KeyStore\fR are implemented in terms of a Service Provider Interface (SPI)\&. That is, there is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, which defines the Service Provider Interface methods that providers must implement\&. The term \fIprovider\fR refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
++
++Applications can choose different types of keystore implementations from different providers, using the \f3getInstance\fR factory method supplied in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private/secret keys in the keystore and the integrity of the keystore\&. Keystore implementations of different types are not compatible\&.
++
++The \f3keytool\fR command works on any file-based keystore implementation\&. It treats the keystore location that is passed to it at the command line as a file name and converts it to a \f3FileInputStream\fR, from which it loads the keystore information\&.)The \f3jarsigner\fR and \f3policytool\fR commands can read a keystore from any location that can be specified with a URL\&.
++
++For \f3keytool\fR and \f3jarsigner\fR, you can specify a keystore type at the command line, with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIKeystore\fR menu\&.
++
++If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment directory\&. The \f3jre\fR directory in the SDK or the top-level directory of the Java Runtime Environment (JRE)\&.
++
++Each tool gets the \f3keystore\&.type\fR value and then examines all the currently installed providers until it finds one that implements a keystores of that type\&. It then uses the keystore implementation from that provider\&.The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type\fR property:
++.sp
++.nf
++\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The default keystore type is \f3jks\fR, which is the proprietary type of the keystore implementation provided by Oracle\&. This is specified by the following line in the security properties file:
++.sp
++.nf
++\f3keystore\&.type=jks\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To have the tools utilize a keystore implementation other than the default, you can change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
++.sp
++.nf
++\f3keystore\&.type=pkcs12\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR Case does not matter in keystore type designations\&. For example, JKS would be considered the same as jks\&.
++.TP
++Certificate
++A certificate (or public-key certificate) is a digitally signed statement from one entity (the issuer), saying that the public key and some other information of another entity (the subject) has some specific value\&. The following terms are related to certificates:
++
++\fIPublic Keys\fR: These are numbers associated with a particular entity, and are intended to be known to everyone who needs to have trusted interactions with that entity\&. Public keys are used to verify signatures\&.
++
++\fIDigitally Signed\fR: If some data is digitally signed, then it is stored with the identity of an entity and a signature that proves that entity knows about the data\&. The data is rendered unforgeable by signing with the entity\&'s private key\&.
++
++\fIIdentity\fR: A known way of addressing an entity\&. In some systems, the identity is the public key, and in others it can be anything from an Oracle Solaris UID to an email address to an X\&.509 distinguished name\&.
++
++\fISignature\fR: A signature is computed over some data using the private key of an entity\&. The signer, which in the case of a certificate is also known as the issuer\&.
++
++\fIPrivate Keys\fR: These are numbers, each of which is supposed to be known only to the particular entity whose private key it is (that is, it is supposed to be kept secret)\&. Private and public keys exist in pairs in all public key cryptography systems (also referred to as public key crypto systems)\&. In a typical public key crypto system, such as DSA, a private key corresponds to exactly one public key\&. Private keys are used to compute signatures\&.
++
++\fIEntity\fR: An entity is a person, organization, program, computer, business, bank, or something else you are trusting to some degree\&.
++
++Public key cryptography requires access to users\&' public keys\&. In a large-scale networked environment, it is impossible to guarantee that prior relationships between communicating entities were established or that a trusted repository exists with all used public keys\&. Certificates were invented as a solution to this public key distribution problem\&. Now a Certification Authority (CA) can act as a trusted third party\&. CAs are entities such as businesses that are trusted to sign (issue) certificates for other entities\&. It is assumed that CAs only create valid and reliable certificates because they are bound by legal agreements\&. There are many public Certification Authorities, such as VeriSign, Thawte, Entrust, and so on\&.
++
++You can also run your own Certification Authority using products such as Microsoft Certificate Server or the Entrust CA product for your organization\&. With the \f3keytool\fR command, it is possible to display, import, and export certificates\&. It is also possible to generate self-signed certificates\&.
++
++The \f3keytool\fR command currently handles X\&.509 certificates\&.
++.TP
++X\&.509 Certificates
++The X\&.509 standard defines what information can go into a certificate and describes how to write it down (the data format)\&. All the data in a certificate is encoded with two related standards called ASN\&.1/DER\&. Abstract Syntax Notation 1 describes data\&. The Definite Encoding Rules describe a single way to store and transfer that data\&.
++
++All X\&.509 certificates have the following data, in addition to the signature:
++
++\fIVersion\fR: This identifies which version of the X\&.509 standard applies to this certificate, which affects what information can be specified in it\&. Thus far, three versions are defined\&. The \f3keytool\fR command can import and export v1, v2, and v3 certificates\&. It generates v3 certificates\&.
++
++X\&.509 Version 1 has been available since 1988, is widely deployed, and is the most generic\&.
++
++X\&.509 Version 2 introduced the concept of subject and issuer unique identifiers to handle the possibility of reuse of subject or issuer names over time\&. Most certificate profile documents strongly recommend that names not be reused and that certificates should not make use of unique identifiers\&. Version 2 certificates are not widely used\&.
++
++X\&.509 Version 3 is the most recent (1996) and supports the notion of extensions where anyone can define an extension and include it in the certificate\&. Some common extensions are: KeyUsage (limits the use of the keys to particular purposes such as \f3signing-only\fR) and AlternativeNames (allows other identities to also be associated with this public key, for example\&. DNS names, email addresses, IP addresses)\&. Extensions can be marked critical to indicate that the extension should be checked and enforced or used\&. For example, if a certificate has the KeyUsage extension marked critical and set to \f3keyCertSign\fR, then when this certificate is presented during SSL communication, it should be rejected because the certificate extension indicates that the associated private key should only be used for signing certificates and not for SSL use\&.
++
++\fISerial number\fR: The entity that created the certificate is responsible for assigning it a serial number to distinguish it from other certificates it issues\&. This information is used in numerous ways\&. For example, when a certificate is revoked its serial number is placed in a Certificate Revocation List (CRL)\&.
++
++\fISignature algorithm identifier\fR: This identifies the algorithm used by the CA to sign the certificate\&.
++
++\fIIssuer name\fR: The X\&.500 Distinguished Name of the entity that signed the certificate\&. See X\&.500 Distinguished Names\&. This is typically a CA\&. Using this certificate implies trusting the entity that signed this certificate\&. In some cases, such as root or top-level CA certificates, the issuer signs its own certificate\&.
++
++\fIValidity period\fR: Each certificate is valid only for a limited amount of time\&. This period is described by a start date and time and an end date and time, and can be as short as a few seconds or almost as long as a century\&. The validity period chosen depends on a number of factors, such as the strength of the private key used to sign the certificate, or the amount one is willing to pay for a certificate\&. This is the expected period that entities can rely on the public value, when the associated private key has not been compromised\&.
++
++\fISubject name\fR: The name of the entity whose public key the certificate identifies\&. This name uses the X\&.500 standard, so it is intended to be unique across the Internet\&. This is the X\&.500 Distinguished Name (DN) of the entity\&. See X\&.500 Distinguished Names\&. For example,
++.sp
++.nf
++\f3CN=Java Duke, OU=Java Software Division, O=Oracle Corporation, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++These refer to the subject\&'s common name (CN), organizational unit (OU), organization (O), and country (C)\&.
++
++\fISubject public key information\fR: This is the public key of the entity being named with an algorithm identifier that specifies which public key crypto system this key belongs to and any associated key parameters\&.
++.TP
++Certificate Chains
++The \f3keytool\fR command can create and manage keystore key entries that each contain a private key and an associated certificate chain\&. The first certificate in the chain contains the public key that corresponds to the private key\&.
++
++When keys are first generated, the chain starts off containing a single element, a self-signed certificate\&. See \f3-genkeypair\fR in Commands\&. A self-signed certificate is one for which the issuer (signer) is the same as the subject\&. The subject is the entity whose public key is being authenticated by the certificate\&. Whenever the \f3-genkeypair\fR command is called to generate a new public/private key pair, it also wraps the public key into a self-signed certificate\&.
++
++Later, after a Certificate Signing Request (CSR) was generated with the \f3-certreq\fR command and sent to a Certification Authority (CA), the response from the CA is imported with \f3-importcert\fR, and the self-signed certificate is replaced by a chain of certificates\&. See the \f3-certreq\fR and \f3-importcert\fR options in Commands\&. At the bottom of the chain is the certificate (reply) issued by the CA authenticating the subject\&'s public key\&. The next certificate in the chain is one that authenticates the CA\&'s public key\&.
++
++In many cases, this is a self-signed certificate, which is a certificate from the CA authenticating its own public key, and the last certificate in the chain\&. In other cases, the CA might return a chain of certificates\&. In this case, the bottom certificate in the chain is the same (a certificate signed by the CA, authenticating the public key of the key entry), but the second certificate in the chain is a certificate signed by a different CA that authenticates the public key of the CA you sent the CSR to\&. The next certificate in the chain is a certificate that authenticates the second CA\&'s key, and so on, until a self-signed root certificate is reached\&. Each certificate in the chain (after the first) authenticates the public key of the signer of the previous certificate in the chain\&.
++
++Many CAs only return the issued certificate, with no supporting chain, especially when there is a flat hierarchy (no intermediates CAs)\&. In this case, the certificate chain must be established from trusted certificate information already stored in the keystore\&.
++
++A different reply format (defined by the PKCS #7 standard) includes the supporting certificate chain in addition to the issued certificate\&. Both reply formats can be handled by the \f3keytool\fR command\&.
++
++The top-level (root) CA certificate is self-signed\&. However, the trust into the root\&'s public key does not come from the root certificate itself, but from other sources such as a newspaper\&. This is because anybody could generate a self-signed certificate with the distinguished name of, for example, the VeriSign root CA\&. The root CA public key is widely known\&. The only reason it is stored in a certificate is because this is the format understood by most tools, so the certificate in this case is only used as a vehicle to transport the root CA\&'s public key\&. Before you add the root CA certificate to your keystore, you should view it with the \f3-printcert\fR option and compare the displayed fingerprint with the well-known fingerprint obtained from a newspaper, the root CA\&'s Web page, and so on\&.
++.TP
++The cacerts Certificates File
++A certificates file named \f3cacerts\fR resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment\&'s directory, which would be the \f3jre\fR directory in the SDK or the top-level directory of the JRE\&.
++
++The \f3cacerts\fR file represents a system-wide keystore with CA certificates\&. System administrators can configure and manage that file with the \f3keytool\fR command by specifying \f3jks\fR as the keystore type\&. The \f3cacerts\fR keystore file ships with a default set of root CA certificates\&. You can list the default certificates with the following command:
++.sp
++.nf
++\f3keytool \-list \-keystore java\&.home/lib/security/cacerts\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The initial password of the \f3cacerts\fR keystore file is \f3changeit\fR\&. System administrators should change that password and the default access permission of that file upon installing the SDK\&.
++
++\fINote:\fR It is important to verify your \f3cacerts\fR file\&. Because you trust the CAs in the \f3cacerts\fR file as entities for signing and issuing certificates to other entities, you must manage the \f3cacerts\fR file carefully\&. The \f3cacerts\fR file should contain only certificates of the CAs you trust\&. It is your responsibility to verify the trusted root CA certificates bundled in the \f3cacerts\fR file and make your own trust decisions\&.
++
++To remove an untrusted CA certificate from the \f3cacerts\fR file, use the \f3delete\fR option of the \f3keytool\fR command\&. You can find the \f3cacerts\fR file in the JRE installation directory\&. Contact your system administrator if you do not have permission to edit this file
++.TP
++Internet RFC 1421 Certificate Encoding Standard
++Certificates are often stored using the printable encoding format defined by the Internet RFC 1421 standard, instead of their binary encoding\&. This certificate format, also known as Base64 encoding, makes it easy to export certificates to other applications by email or through some other mechanism\&.
++
++Certificates read by the \f3-importcert\fR and \f3-printcert\fR commands can be in either this format or binary encoded\&. The \f3-exportcert\fR command by default outputs a certificate in binary encoding, but will instead output a certificate in the printable encoding format, when the \f3-rfc\fR option is specified\&.
++
++The \f3-list\fR command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format\&. If the \f3-rfc\fR option is specified, then the certificate is output in the printable encoding format\&.
++
++In its printable encoding format, the encoded certificate is bounded at the beginning and end by the following text:
++.sp
++.nf
++\f3\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3encoded certificate goes here\&. \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-\-\-\-\-END CERTIFICATE\-\-\-\-\-\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++X\&.500 Distinguished Names
++X\&.500 Distinguished Names are used to identify entities, such as those that are named by the \f3subject\fR and \f3issuer\fR (signer) fields of X\&.509 certificates\&. The \f3keytool\fR command supports the following subparts:
++
++\fIcommonName\fR: The common name of a person such as Susan Jones\&.
++
++\fIorganizationUnit\fR: The small organization (such as department or division) name\&. For example, Purchasing\&.
++
++\fIlocalityName\fR: The locality (city) name, for example, Palo Alto\&.
++
++\fIstateName\fR: State or province name, for example, California\&.
++
++\fIcountry\fR: Two-letter country code, for example, CH\&.
++
++When you supply a distinguished name string as the value of a \f3-dname\fR option, such as for the \f3-genkeypair\fR command, the string must be in the following format:
++.sp
++.nf
++\f3CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++All the italicized items represent actual values and the previous keywords are abbreviations for the following:
++.sp
++.nf
++\f3CN=commonName\fP
++.fi
++.nf
++\f3OU=organizationUnit\fP
++.fi
++.nf
++\f3O=organizationName\fP
++.fi
++.nf
++\f3L=localityName\fP
++.fi
++.nf
++\f3S=stateName\fP
++.fi
++.nf
++\f3C=country\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++A sample distinguished name string is:
++.sp
++.nf
++\f3CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino, S=California, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++A sample command using such a string is:
++.sp
++.nf
++\f3keytool \-genkeypair \-dname "CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino,\fP
++.fi
++.nf
++\f3S=California, C=US" \-alias mark\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Case does not matter for the keyword abbreviations\&. For example, CN, cn, and Cn are all treated the same\&.
++
++Order matters; each subcomponent must appear in the designated order\&. However, it is not necessary to have all the subcomponents\&. You can use a subset, for example:
++.sp
++.nf
++\f3CN=Steve Meier, OU=Java, O=Oracle, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If a distinguished name string value contains a comma, then the comma must be escaped by a backslash (\e) character when you specify the string on a command line, as in:
++.sp
++.nf
++\f3cn=Peter Schuster, ou=Java\e, Product Development, o=Oracle, c=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++It is never necessary to specify a distinguished name string on a command line\&. When the distinguished name is needed for a command, but not supplied on the command line, the user is prompted for each of the subcomponents\&. In this case, a comma does not need to be escaped by a backslash (\e)\&.
++.SH WARNINGS
++.SS IMPORTING\ TRUSTED\ CERTIFICATES\ WARNING
++\fIImportant\fR: Be sure to check a certificate very carefully before importing it as a trusted certificate\&.
++.PP
++Windows Example:
++
++View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose sends or emails you a certificate that you put it in a file named \f3\etmp\ecert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
++.sp
++.nf
++\f3 keytool \-printcert \-file \etmp\ecert\fP
++.fi
++.nf
++\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Serial Number: 59092b34\fP
++.fi
++.nf
++\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
++.fi
++.nf
++\f3 Certificate Fingerprints:\fP
++.fi
++.nf
++\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
++.fi
++.nf
++\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
++.fi
++.nf
++\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
++.fi
++.nf
++\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
++.fi
++.sp
++
++.PP
++Oracle Solaris Example:
++
++View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose someone sends or emails you a certificate that you put it in a file named \f3/tmp/cert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
++.sp
++.nf
++\f3 keytool \-printcert \-file /tmp/cert\fP
++.fi
++.nf
++\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Serial Number: 59092b34\fP
++.fi
++.nf
++\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
++.fi
++.nf
++\f3 Certificate Fingerprints:\fP
++.fi
++.nf
++\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
++.fi
++.nf
++\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
++.fi
++.nf
++\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
++.fi
++.nf
++\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Then call or otherwise contact the person who sent the certificate and compare the fingerprints that you see with the ones that they show\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s certificate such as an attacker\&'s certificate\&. If such an attack took place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker signed, for example, a JAR file with malicious class files inside\&.
++.PP
++\fINote:\fR It is not required that you execute a \f3-printcert\fR command before importing a certificate\&. This is because before you add a certificate to the list of trusted certificates in the keystore, the \f3-importcert\fR command prints out the certificate information and prompts you to verify it\&. You can then stop the import operation\&. However, you can do this only when you call the \f3-importcert\fR command without the \f3-noprompt\fR option\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
++.SS PASSWORDS\ WARNING
++Most commands that operate on a keystore require the store password\&. Some commands require a private/secret key password\&. Passwords can be specified on the command line in the \f3-storepass\fR and \f3-keypass\fR options\&. However, a password should not be specified on a command line or in a script unless it is for testing, or you are on a secure system\&. When you do not specify a required password option on a command line, you are prompted for it\&.
++.SS CERTIFICATE\ CONFORMANCE\ WARNING
++The Internet standard RFC 5280 has defined a profile on conforming X\&.509 certificates, which includes what values and value combinations are valid for certificate fields and extensions\&. See the standard at http://tools\&.ietf\&.org/rfc/rfc5280\&.txt
++.PP
++The \f3keytool\fR command does not enforce all of these rules so it can generate certificates that do not conform to the standard\&. Certificates that do not conform to the standard might be rejected by JRE or other applications\&. Users should ensure that they provide the correct options for \f3-dname\fR, \f3-ext\fR, and so on\&.
++.SH NOTES
++.SS IMPORT\ A\ NEW\ TRUSTED\ CERTIFICATE
++Before you add the certificate to the keystore, the \f3keytool\fR command verifies it by attempting to construct a chain of trust from that certificate to a self-signed certificate (belonging to a root CA), using trusted certificates that are already available in the keystore\&.
++.PP
++If the \f3-trustcacerts\fR option was specified, then additional certificates are considered for the chain of trust, namely the certificates in a file named \f3cacerts\fR\&.
++.PP
++If the \f3keytool\fR command fails to establish a trust path from the certificate to be imported up to a self-signed certificate (either from the keystore or the \f3cacerts\fR file), then the certificate information is printed, and the user is prompted to verify it by comparing the displayed certificate fingerprints with the fingerprints obtained from some other (trusted) source of information, which might be the certificate owner\&. Be very careful to ensure the certificate is valid before importing it as a trusted certificate\&. See Importing Trusted Certificates Warning\&. The user then has the option of stopping the import operation\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
++.SS IMPORT\ A\ CERTIFICATE\ REPLY
++When you import a certificate reply, the certificate reply is validated with trusted certificates from the keystore, and optionally, the certificates configured in the \f3cacerts\fR keystore file when the \f3-trustcacert\fR\f3s\fR option is specified\&. See The cacerts Certificates File\&.
++.PP
++The methods of determining whether the certificate reply is trusted are as follows:
++.TP 0.2i
++\(bu
++If the reply is a single X\&.509 certificate, then the \f3keytool\fR command attempts to establish a trust chain, starting at the certificate reply and ending at a self-signed certificate (belonging to a root CA)\&. The certificate reply and the hierarchy of certificates is used to authenticate the certificate reply from the new certificate chain of aliases\&. If a trust chain cannot be established, then the certificate reply is not imported\&. In this case, the \f3keytool\fR command does not print the certificate and prompt the user to verify it, because it is very difficult for a user to determine the authenticity of the certificate reply\&.
++.TP 0.2i
++\(bu
++If the reply is a PKCS #7 formatted certificate chain or a sequence of X\&.509 certificates, then the chain is ordered with the user certificate first followed by zero or more CA certificates\&. If the chain ends with a self-signed root CA certificate and the\f3-trustcacerts\fR option was specified, the \f3keytool\fR command attempts to match it with any of the trusted certificates in the keystore or the \f3cacerts\fR keystore file\&. If the chain does not end with a self-signed root CA certificate and the \f3-trustcacerts\fR option was specified, the \f3keytool\fR command tries to find one from the trusted certificates in the keystore or the \f3cacerts\fR keystore file and add it to the end of the chain\&. If the certificate is not found and the \f3-noprompt\fR option is not specified, the information of the last certificate in the chain is printed, and the user is prompted to verify it\&.
++.PP
++If the public key in the certificate reply matches the user\&'s public key already stored with \f3alias\fR, then the old certificate chain is replaced with the new certificate chain in the reply\&. The old chain can only be replaced with a valid \f3keypass\fR, and so the password used to protect the private key of the entry is supplied\&. If no password is provided, and the private key password is different from the keystore password, the user is prompted for it\&.
++.PP
++This command was named \f3-import\fR in earlier releases\&. This old name is still supported in this release\&. The new name, \f3-importcert\fR, is preferred going forward\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
++.TP 0.2i
++\(bu
++Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/native2ascii.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/native2ascii.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Internationalization Tools
+-.\" Title: native2ascii.1
+-.\"
+-.if n .pl 99999
+-.TH native2ascii 1 "21 November 2013" "JDK 8" "Internationalization Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Internationalization Tools
++.\" Title: native2ascii.1
++.\"
++.if n .pl 99999
++.TH native2ascii 1 "21 November 2013" "JDK 8" "Internationalization Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,39 +47,39 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-native2ascii \- Creates localizable applications by converting a file with characters in any supported character encoding to one with ASCII and/or Unicode escapes or vice versa\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBnative2ascii\fR [ \fIinputfile\fR ] [ \fIoutputfile\fR ]
+-.fi
+-.sp
+-.TP
+-\fIinputfile\fR
+-The encoded file to be converted to ASCII\&.
+-.TP
+-\fIoutputfile\fR
+-The converted ASCII file\&.
+-.SH DESCRIPTION
+-The \f3native2ascii\fR command converts encoded files supported by the Java Runtime Environment (JRE) to files encoded in ASCII, using Unicode escapes (\f3\eu\fR\fIxxxx\fR) notation for all characters that are not part of the ASCII character set\&. This process is required for properties files that contain characters not in ISO-8859-1 character sets\&. The tool can also perform the reverse conversion\&.
+-.PP
+-If the \f3outputfile\fR value is omitted, then standard output is used for output\&. If, in addition, the \f3inputfile\fR value is omitted, then standard input is used for input\&.
+-.SH OPTIONS
+-.TP
+--reverse
+-.br
+-Perform the reverse operation: Converts a file encoded in ISO-8859-1 with Unicode escapes to a file in any character encoding supported by the JRE\&.
+-.TP
+--encoding \fIencoding_name\fR
+-.br
+-Specifies the name of the character encoding to be used by the conversion procedure\&. If this option is not present, then the default character encoding (as determined by the \f3java\&.nio\&.charset\&.Charset\&.defaultCharset\fR method) is used\&. The \f3encoding_name\fR string must be the name of a character encoding that is supported by the JRE\&. See Supported Encodings at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.html
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++
++.SH NAME
++native2ascii \- Creates localizable applications by converting a file with characters in any supported character encoding to one with ASCII and/or Unicode escapes or vice versa\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBnative2ascii\fR [ \fIinputfile\fR ] [ \fIoutputfile\fR ]
++.fi
++.sp
++.TP
++\fIinputfile\fR
++The encoded file to be converted to ASCII\&.
++.TP
++\fIoutputfile\fR
++The converted ASCII file\&.
++.SH DESCRIPTION
++The \f3native2ascii\fR command converts encoded files supported by the Java Runtime Environment (JRE) to files encoded in ASCII, using Unicode escapes (\f3\eu\fR\fIxxxx\fR) notation for all characters that are not part of the ASCII character set\&. This process is required for properties files that contain characters not in ISO-8859-1 character sets\&. The tool can also perform the reverse conversion\&.
++.PP
++If the \f3outputfile\fR value is omitted, then standard output is used for output\&. If, in addition, the \f3inputfile\fR value is omitted, then standard input is used for input\&.
++.SH OPTIONS
++.TP
++-reverse
++.br
++Perform the reverse operation: Converts a file encoded in ISO-8859-1 with Unicode escapes to a file in any character encoding supported by the JRE\&.
++.TP
++-encoding \fIencoding_name\fR
++.br
++Specifies the name of the character encoding to be used by the conversion procedure\&. If this option is not present, then the default character encoding (as determined by the \f3java\&.nio\&.charset\&.Charset\&.defaultCharset\fR method) is used\&. The \f3encoding_name\fR string must be the name of a character encoding that is supported by the JRE\&. See Supported Encodings at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.html
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/orbd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/orbd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: orbd.1
+-.\"
+-.if n .pl 99999
+-.TH orbd 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: orbd.1
++.\"
++.if n .pl 99999
++.TH orbd 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,166 +47,166 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-orbd \- Enables clients to locate and call persistent objects on servers in the CORBA environment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBorbd\fR [ \fIoptions\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3orbd\fR command enables clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The Server Manager included with the orbd tool is used to enable clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The persistent servers, while publishing the persistent object references in the naming service, include the port number of the ORBD in the object reference instead of the port number of the server\&. The inclusion of an ORBD port number in the object reference for persistent object references has the following advantages:
+-.TP 0.2i
+-\(bu
+-The object reference in the naming service remains independent of the server life cycle\&. For example, the object reference could be published by the server in the Naming Service when it is first installed, and then, independent of how many times the server is started or shut down, the ORBD returns the correct object reference to the calling client\&.
+-.TP 0.2i
+-\(bu
+-The client needs to look up the object reference in the naming service only once, and can keep reusing this reference independent of the changes introduced due to server life cycle\&.
+-.PP
+-To access the ORBD Server Manager, the server must be started using \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. For more information on the Server Manager, see Server Manager\&.
+-.PP
+-When \f3orbd\fR starts, it also starts a naming service\&. For more information about the naming service\&. See Start and Stop the Naming Service\&.
+-.SH OPTIONS
+-.TP
+--ORBInitialPort \fInameserverport\fR
+-.br
+-Required\&. Specifies the port on which the name server should be started\&. After it is started, \f3orbd\fR listens for incoming requests on this port\&. On Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, Oracle recommends that you use a port number above or equal to 1024\&.
+-.SS NONREQUIRED\ OPTIONS
+-.TP
+--port \fIport\fR
+-.br
+-Specifies the activation port where ORBD should be started, and where ORBD will be accepting requests for persistent objects\&. The default value for this port is 1049\&. This port number is added to the port field of the persistent Interoperable Object References (IOR)\&.
+-.TP
+--defaultdb \fIdirectory\fR
+-.br
+-Specifies the base where the ORBD persistent storage directory, \f3orb\&.db\fR, is created\&. If this option is not specified, then the default value is \f3\&./orb\&.db\fR\&.
+-.TP
+--serverPollingTime \fImilliseconds\fR
+-.br
+-Specifies how often ORBD checks for the health of persistent servers registered through \f3servertool\fR\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
+-.TP
+--serverStartupDelay milliseconds
+-.br
+-Specifies how long ORBD waits before sending a location forward exception after a persistent server that is registered through \f3servertool\fR is restarted\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SS START\ AND\ STOP\ THE\ NAMING\ SERVICE
+-A naming service is a CORBA service that allows CORBA objects to be named by means of binding a name to an object reference\&. The name binding can be stored in the naming service, and a client can supply the name to obtain the desired object reference\&.
+-.PP
+-Before running a client or a server, you will start ORBD\&. ORBD includes a persistent naming service and a transient naming service, both of which are an implementation of the COS Naming Service\&.
+-.PP
+-The Persistent Naming Service provides persistence for naming contexts\&. This means that this information is persistent across service shutdowns and startups, and is recoverable in the event of a service failure\&. If ORBD is restarted, then the Persistent Naming Service restores the naming context graph, so that the binding of all clients\&' and servers\&' names remains intact (persistent)\&.
+-.PP
+-For backward compatibility, \f3tnameserv\fR, a Transient Naming Service that shipped with earlier releases of the JDK, is also included in this release of Java SE\&. A transient naming service retains naming contexts as long as it is running\&. If there is a service interruption, then the naming context graph is lost\&.
+-.PP
+-The \f3-ORBInitialPort\fR argument is a required command-line argument for \f3orbd\fR, and is used to set the port number on which the naming service runs\&. The following instructions assume you can use port 1050 for the Java IDL Object Request Broker Daemon\&. When using Oracle Solaris software, you must become a root user to start a process on a port lower than 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&. You can substitute a different port when necessary\&.
+-.PP
+-To start \f3orbd\fR from a UNIX command shell, enter:
+-.sp
+-.nf
+-\f3orbd \-ORBInitialPort 1050&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-From an MS-DOS system prompt (Windows), enter:
+-.sp
+-.nf
+-\f3start orbd \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Now that ORBD is running, you can run your server and client applications\&. When running the client and server applications, they must be made aware of the port number (and machine name, when applicable) where the Naming Service is running\&. One way to do this is to add the following code to your application:
+-.sp
+-.nf
+-\f3Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialHost", "MyHost");\fP
+-.fi
+-.nf
+-\f3ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this example, the naming service is running on port 1050 on host \f3MyHost\fR\&. Another way is to specify the port number and/or machine name when running the server or client application from the command line\&. For example, you would start your \f3HelloApplication\fR with the following command line:
+-.sp
+-.nf
+-\f3java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To stop the naming service, use the relevant operating system command, such as \f3pkill\fR\f3orbd\fR on Oracle Solaris, or \fICtrl+C\fR in the DOS window in which \f3orbd\fR is running\&. Note that names registered with the naming service can disappear when the service is terminated because of a transient naming service\&. The Java IDL naming service will run until it is explicitly stopped\&.
+-.PP
+-For more information about the naming service included with ORBD, see Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+-.SH SERVER\ MANAGER
+-To access the ORBD Server Manager and run a persistent server, the server must be started with \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. When a server is started using \f3servertool\fR, it must be started on the same host and port on which \f3orbd\fR is executing\&. If the server is run on a different port, then the information stored in the database for local contexts will be invalid and the service will not work properly\&.
+-.PP
+-See Java IDL: The "Hello World" Example at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html
+-.PP
+-In this example, you run the \f3idlj\fR compiler and \f3javac\fR compiler as shown in the tutorial\&. To run the ORBD Server Manager, follow these steps for running the application:
+-.PP
+-Start \f3orbd\fR\&.
+-.PP
+-UNIX command shell, enter: \f3orbd -ORBInitialPort 1050\fR\&.
+-.PP
+-MS-DOS system prompt (Windows), enter: \f3s\fR\f3tart orbd -ORBInitialPort 105\fR\f30\fR\&.
+-.PP
+-Port 1050 is the port on which you want the name server to run\&. The \f3-ORBInitialPort\fR option is a required command-line argument\&. When using Oracle Solaris software, you must become a root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&.
+-.PP
+-Start the \f3servertool\fR: \f3servertool -ORBInitialPort 1050\fR\&.
+-.PP
+-Make sure the name server (\f3orbd\fR) port is the same as in the previous step, for example, \f3-ORBInitialPort 1050\&.\fR The \f3servertool\fR must be started on the same port as the name server\&.
+-.PP
+-In the \f3servertool\fR command line interface, start the \f3Hello\fR server from the \f3servertool\fR prompt:
+-.sp
+-.nf
+-\f3servertool > register \-server HelloServer \-classpath \&. \-applicationName\fP
+-.fi
+-.nf
+-\f3 HelloServerApName\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3servertool\fR registers the server, assigns it the name \f3HelloServerApName\fR, and displays its server ID with a listing of all registered servers\&.Run the client application from another terminal window or prompt:
+-.sp
+-.nf
+-\f3java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-For this example, you can omit \f3-ORBInitialHost localhost\fR because the name server is running on the same host as the \f3Hello\fR client\&. If the name server is running on a different host, then use the -\f3ORBInitialHost nameserverhost\fR option to specify the host on which the IDL name server is running\&.Specify the name server (\f3orbd\fR) port as done in the previous step, for example, \f3-ORBInitialPort 1050\fR\&. When you finish experimenting with the ORBD Server Manager, be sure to shut down or terminate the name server (\f3orbd\fR) and \f3servertool\fR\&. To shut down \f3orbd\fR from am MS-DOS prompt, select the window that is running the server and enter \fICtrl+C\fR to shut it down\&.
+-.PP
+-To shut down \f3orbd\fR from an Oracle Solaris shell, find the process, and terminate with the \f3kill\fR command\&. The server continues to wait for invocations until it is explicitly stopped\&. To shut down the \f3servertool\fR, type \fIquit\fR and press the \fIEnter\fR key\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-servertool(1)
+-.TP 0.2i
+-\(bu
+-Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++
++.SH NAME
++orbd \- Enables clients to locate and call persistent objects on servers in the CORBA environment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBorbd\fR [ \fIoptions\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3orbd\fR command enables clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The Server Manager included with the orbd tool is used to enable clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The persistent servers, while publishing the persistent object references in the naming service, include the port number of the ORBD in the object reference instead of the port number of the server\&. The inclusion of an ORBD port number in the object reference for persistent object references has the following advantages:
++.TP 0.2i
++\(bu
++The object reference in the naming service remains independent of the server life cycle\&. For example, the object reference could be published by the server in the Naming Service when it is first installed, and then, independent of how many times the server is started or shut down, the ORBD returns the correct object reference to the calling client\&.
++.TP 0.2i
++\(bu
++The client needs to look up the object reference in the naming service only once, and can keep reusing this reference independent of the changes introduced due to server life cycle\&.
++.PP
++To access the ORBD Server Manager, the server must be started using \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. For more information on the Server Manager, see Server Manager\&.
++.PP
++When \f3orbd\fR starts, it also starts a naming service\&. For more information about the naming service\&. See Start and Stop the Naming Service\&.
++.SH OPTIONS
++.TP
++-ORBInitialPort \fInameserverport\fR
++.br
++Required\&. Specifies the port on which the name server should be started\&. After it is started, \f3orbd\fR listens for incoming requests on this port\&. On Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, Oracle recommends that you use a port number above or equal to 1024\&.
++.SS NONREQUIRED\ OPTIONS
++.TP
++-port \fIport\fR
++.br
++Specifies the activation port where ORBD should be started, and where ORBD will be accepting requests for persistent objects\&. The default value for this port is 1049\&. This port number is added to the port field of the persistent Interoperable Object References (IOR)\&.
++.TP
++-defaultdb \fIdirectory\fR
++.br
++Specifies the base where the ORBD persistent storage directory, \f3orb\&.db\fR, is created\&. If this option is not specified, then the default value is \f3\&./orb\&.db\fR\&.
++.TP
++-serverPollingTime \fImilliseconds\fR
++.br
++Specifies how often ORBD checks for the health of persistent servers registered through \f3servertool\fR\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
++.TP
++-serverStartupDelay milliseconds
++.br
++Specifies how long ORBD waits before sending a location forward exception after a persistent server that is registered through \f3servertool\fR is restarted\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SS START\ AND\ STOP\ THE\ NAMING\ SERVICE
++A naming service is a CORBA service that allows CORBA objects to be named by means of binding a name to an object reference\&. The name binding can be stored in the naming service, and a client can supply the name to obtain the desired object reference\&.
++.PP
++Before running a client or a server, you will start ORBD\&. ORBD includes a persistent naming service and a transient naming service, both of which are an implementation of the COS Naming Service\&.
++.PP
++The Persistent Naming Service provides persistence for naming contexts\&. This means that this information is persistent across service shutdowns and startups, and is recoverable in the event of a service failure\&. If ORBD is restarted, then the Persistent Naming Service restores the naming context graph, so that the binding of all clients\&' and servers\&' names remains intact (persistent)\&.
++.PP
++For backward compatibility, \f3tnameserv\fR, a Transient Naming Service that shipped with earlier releases of the JDK, is also included in this release of Java SE\&. A transient naming service retains naming contexts as long as it is running\&. If there is a service interruption, then the naming context graph is lost\&.
++.PP
++The \f3-ORBInitialPort\fR argument is a required command-line argument for \f3orbd\fR, and is used to set the port number on which the naming service runs\&. The following instructions assume you can use port 1050 for the Java IDL Object Request Broker Daemon\&. When using Oracle Solaris software, you must become a root user to start a process on a port lower than 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&. You can substitute a different port when necessary\&.
++.PP
++To start \f3orbd\fR from a UNIX command shell, enter:
++.sp
++.nf
++\f3orbd \-ORBInitialPort 1050&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++From an MS-DOS system prompt (Windows), enter:
++.sp
++.nf
++\f3start orbd \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Now that ORBD is running, you can run your server and client applications\&. When running the client and server applications, they must be made aware of the port number (and machine name, when applicable) where the Naming Service is running\&. One way to do this is to add the following code to your application:
++.sp
++.nf
++\f3Properties props = new Properties();\fP
++.fi
++.nf
++\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialHost", "MyHost");\fP
++.fi
++.nf
++\f3ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this example, the naming service is running on port 1050 on host \f3MyHost\fR\&. Another way is to specify the port number and/or machine name when running the server or client application from the command line\&. For example, you would start your \f3HelloApplication\fR with the following command line:
++.sp
++.nf
++\f3java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To stop the naming service, use the relevant operating system command, such as \f3pkill\fR\f3orbd\fR on Oracle Solaris, or \fICtrl+C\fR in the DOS window in which \f3orbd\fR is running\&. Note that names registered with the naming service can disappear when the service is terminated because of a transient naming service\&. The Java IDL naming service will run until it is explicitly stopped\&.
++.PP
++For more information about the naming service included with ORBD, see Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++.SH SERVER\ MANAGER
++To access the ORBD Server Manager and run a persistent server, the server must be started with \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. When a server is started using \f3servertool\fR, it must be started on the same host and port on which \f3orbd\fR is executing\&. If the server is run on a different port, then the information stored in the database for local contexts will be invalid and the service will not work properly\&.
++.PP
++See Java IDL: The "Hello World" Example at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html
++.PP
++In this example, you run the \f3idlj\fR compiler and \f3javac\fR compiler as shown in the tutorial\&. To run the ORBD Server Manager, follow these steps for running the application:
++.PP
++Start \f3orbd\fR\&.
++.PP
++UNIX command shell, enter: \f3orbd -ORBInitialPort 1050\fR\&.
++.PP
++MS-DOS system prompt (Windows), enter: \f3s\fR\f3tart orbd -ORBInitialPort 105\fR\f30\fR\&.
++.PP
++Port 1050 is the port on which you want the name server to run\&. The \f3-ORBInitialPort\fR option is a required command-line argument\&. When using Oracle Solaris software, you must become a root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&.
++.PP
++Start the \f3servertool\fR: \f3servertool -ORBInitialPort 1050\fR\&.
++.PP
++Make sure the name server (\f3orbd\fR) port is the same as in the previous step, for example, \f3-ORBInitialPort 1050\&.\fR The \f3servertool\fR must be started on the same port as the name server\&.
++.PP
++In the \f3servertool\fR command line interface, start the \f3Hello\fR server from the \f3servertool\fR prompt:
++.sp
++.nf
++\f3servertool > register \-server HelloServer \-classpath \&. \-applicationName\fP
++.fi
++.nf
++\f3 HelloServerApName\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3servertool\fR registers the server, assigns it the name \f3HelloServerApName\fR, and displays its server ID with a listing of all registered servers\&.Run the client application from another terminal window or prompt:
++.sp
++.nf
++\f3java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++For this example, you can omit \f3-ORBInitialHost localhost\fR because the name server is running on the same host as the \f3Hello\fR client\&. If the name server is running on a different host, then use the -\f3ORBInitialHost nameserverhost\fR option to specify the host on which the IDL name server is running\&.Specify the name server (\f3orbd\fR) port as done in the previous step, for example, \f3-ORBInitialPort 1050\fR\&. When you finish experimenting with the ORBD Server Manager, be sure to shut down or terminate the name server (\f3orbd\fR) and \f3servertool\fR\&. To shut down \f3orbd\fR from am MS-DOS prompt, select the window that is running the server and enter \fICtrl+C\fR to shut it down\&.
++.PP
++To shut down \f3orbd\fR from an Oracle Solaris shell, find the process, and terminate with the \f3kill\fR command\&. The server continues to wait for invocations until it is explicitly stopped\&. To shut down the \f3servertool\fR, type \fIquit\fR and press the \fIEnter\fR key\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++servertool(1)
++.TP 0.2i
++\(bu
++Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/pack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/pack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Deployment Tools
+-.\" Title: pack200.1
+-.\"
+-.if n .pl 99999
+-.TH pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Deployment Tools
++.\" Title: pack200.1
++.\"
++.if n .pl 99999
++.TH pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,243 +47,243 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-pack200 \- Packages a JAR file into a compressed pack200 file for web deployment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBpack200\fR [\fIoptions\fR] \fIoutput\-file\fR \fIJAR\-file\fR
+-.fi
+-.sp
+-Options can be in any order\&. The last option on the command line or in a properties file supersedes all previously specified options\&.
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIoutput-file\fR
+-Name of the output file\&.
+-.TP
+-\fIJAR-file\fR
+-Name of the input file\&.
+-.SH DESCRIPTION
+-The \f3pack200\fR command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor\&. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time\&.
+-.PP
+-The \f3pack200\fR command has several options to fine-tune and set the compression engine\&. The typical usage is shown in the following example, where \f3myarchive\&.pack\&.gz\fR is produced with the default \f3pack200\fR command settings:
+-.sp
+-.nf
+-\f3pack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--r, --repack
+-.br
+-Produces a JAR file by packing and unpacking a JAR file\&. The resulting file can be used as an input to the \f3jarsigner\fR(1) tool\&. The following example packs and unpacks the myarchive\&.jar file:
+-.sp
+-.nf
+-\f3pack200 \-\-repack myarchive\-packer\&.jar myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3pack200 \-\-repack myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following example preserves the order of files in the input file\&.
+-.TP
+--g, --no-gzip
+-.br
+-Produces a \f3pack200\fR file\&. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser\&.
+-.sp
+-.nf
+-\f3pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--G, --strip-debug
+-.br
+-Strips debugging attributes from the output\&. These include \f3SourceFile\fR, \f3LineNumberTable\fR, \f3LocalVariableTable\fR and \f3LocalVariableTypeTable\fR\&. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers\&.
+-.TP
+---keep-file-order
+-.br
+-Preserve the order of files in the input file\&. This is the default behavior\&.
+-.TP
+--O, --no-keep-file-order
+-.br
+-The packer reorders and transmits all elements\&. The packer can also remove JAR directory names to reduce the download size\&. However, certain JAR file optimizations, such as indexing, might not work correctly\&.
+-.TP
+--S\fIvalue\fR , --segment-limit=\fIvalue\fR
+-.br
+-The value is the estimated target size \fIN\fR (in bytes) of each archive segment\&. If a single input file requires more than \fIN\fR bytes, then its own archive segment is provided\&. As a special case, a value of \f3-1\fR produces a single large segment with all input files, while a value of 0 produces one segment for each class\&. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory\&.
+-
+-The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties\&.
+-
+-The default is -1, which means that the packer creates a single segment output file\&. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs\&.
+-
+-A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit)\&.
+-.TP
+--E\fIvalue\fR , --effort=\fIvalue\fR
+-.br
+-If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive\&. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression\&. The special value 0 instructs the \f3pack200\fR command to copy through the original JAR file directly with no compression\&. The JSR 200 standard requires any unpacker to understand this special case as a pass-through of the entire archive\&.
+-
+-The default is 5, to invest a modest amount of time to produce reasonable compression\&.
+-.TP
+--H\fIvalue\fR , --deflate-hint=\fIvalue\fR
+-.br
+-Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger\&. The possible values are: \f3true\fR, \f3false\fR, or \f3keep\fR\&.
+-
+-If the \f3value\fR is \f3true\fR or false, then the \f3packer200\fR command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements\&.
+-
+-The \f3keep\fR value preserves deflation hints observed in the input JAR\&. This is the default\&.
+-.TP
+--m\fIvalue\fR , --modification-time=\fIvalue\fR
+-.br
+-The possible values are \f3latest\fR and \f3keep\fR\&.
+-
+-If the value is latest, then the packer attempts to determine the latest modification time, among all the available entries in the original archive, or the latest modification time of all the available entries in that segment\&. This single value is transmitted as part of the segment and applied to all the entries in each segment\&. This can marginally decrease the transmitted size of the archive at the expense of setting all installed files to a single date\&.
+-
+-If the value is \f3keep\fR, then modification times observed in the input JAR are preserved\&. This is the default\&.
+-.TP
+--P\fIfile\fR , --pass-file=\fIfile\fR
+-.br
+-Indicates that a file should be passed through bytewise with no compression\&. By repeating the option, multiple files can be specified\&. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/)\&. The resulting file names must match exactly as strings with their occurrences in the JAR file\&. If \f3file\fR is a directory name, then all files under that directory are passed\&.
+-.TP
+--U\fIaction\fR , --unknown-attribute=\fIaction\fR
+-.br
+-Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action\fR\&. The possible values for actions are \f3error\fR, \f3strip\fR, or \f3pass\fR\&.
+-
+-If the value is \f3error\fR, then the entire \f3pack200\fR command operation fails with a suitable explanation\&.
+-
+-If the value is \f3strip\fR, then the attribute is dropped\&. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures\&.
+-
+-If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
+-.TP
+-.nf
+--C\fIattribute-name\fR=\fIlayout\fR , --class-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--F\fIattribute-name\fR=\fIlayout\fR , --field-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--M\fIattribute-name\fR=\fIlayout\fR , --method-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--D\fIattribute-name\fR=\fIlayout\fR , --code-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute\fR, \f3field-attribute\fR, \f3method-attribute\fR, and \f3code-attribute\fR\&. The \fIattribute-name\fR is the name of the attribute for which the layout or action is being defined\&. The possible values for \fIaction\fR are \f3some-layout-string\fR, \f3error\fR, \f3strip\fR, \f3pass\fR\&.
+-
+-\f3some-layout-string\fR: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH\fR\&.
+-
+-If the value is \f3error\fR, then the \f3pack200\fR operation fails with an explanation\&.
+-
+-If the value is \f3strip\fR, then the attribute is removed from the output\&. Removing JVM-required attributes can cause class loader failures\&. For example, \f3--class-attribute=CompilationID=pass\fR causes the class file that contains this attribute to be passed through without further action by the packer\&.
+-
+-If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
+-.TP
+--f \fIpack\&.properties\fR , --config-file=\fIpack\&.properties\fR
+-.br
+-A configuration file, containing Java properties to initialize the packer, can be specified on the command line\&.
+-.sp
+-.nf
+-\f3pack200 \-f pack\&.properties myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3more pack\&.properties\fP
+-.fi
+-.nf
+-\f3# Generic properties for the packer\&.\fP
+-.fi
+-.nf
+-\f3modification\&.time=latest\fP
+-.fi
+-.nf
+-\f3deflate\&.hint=false\fP
+-.fi
+-.nf
+-\f3keep\&.file\&.order=false\fP
+-.fi
+-.nf
+-\f3# This option will cause the files bearing new attributes to\fP
+-.fi
+-.nf
+-\f3# be reported as an error rather than passed uncompressed\&.\fP
+-.fi
+-.nf
+-\f3unknown\&.attribute=error\fP
+-.fi
+-.nf
+-\f3# Change the segment limit to be unlimited\&.\fP
+-.fi
+-.nf
+-\f3segment\&.limit=\-1\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--v, --verbose
+-.br
+-Outputs minimal messages\&. Multiple specification of this option will create more verbose messages\&.
+-.TP
+--q, --quiet
+-.br
+-Specifies quiet operation with no messages\&.
+-.TP
+--l\fIfilename\fR , --log-file=\fIfilename\fR
+-.br
+-Specifies a log file to output messages\&.
+-.TP
+--?, -h, --help
+-.br
+-Prints help information about this command\&.
+-.TP
+--V, --version
+-.br
+-Prints version information about this command\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes the specified option to the Java Virtual Machine\&. For more information, see the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
+-.SH EXIT\ STATUS
+-The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs\&.
+-.SH NOTES
+-This command should not be confused with \f3pack\fR(1)\&. The \f3pack\fR and \f3pack200\fR commands are separate products\&.
+-.PP
+-The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-unpack200(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
++
++.SH NAME
++pack200 \- Packages a JAR file into a compressed pack200 file for web deployment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBpack200\fR [\fIoptions\fR] \fIoutput\-file\fR \fIJAR\-file\fR
++.fi
++.sp
++Options can be in any order\&. The last option on the command line or in a properties file supersedes all previously specified options\&.
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIoutput-file\fR
++Name of the output file\&.
++.TP
++\fIJAR-file\fR
++Name of the input file\&.
++.SH DESCRIPTION
++The \f3pack200\fR command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor\&. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time\&.
++.PP
++The \f3pack200\fR command has several options to fine-tune and set the compression engine\&. The typical usage is shown in the following example, where \f3myarchive\&.pack\&.gz\fR is produced with the default \f3pack200\fR command settings:
++.sp
++.nf
++\f3pack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-r, --repack
++.br
++Produces a JAR file by packing and unpacking a JAR file\&. The resulting file can be used as an input to the \f3jarsigner\fR(1) tool\&. The following example packs and unpacks the myarchive\&.jar file:
++.sp
++.nf
++\f3pack200 \-\-repack myarchive\-packer\&.jar myarchive\&.jar\fP
++.fi
++.nf
++\f3pack200 \-\-repack myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following example preserves the order of files in the input file\&.
++.TP
++-g, --no-gzip
++.br
++Produces a \f3pack200\fR file\&. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser\&.
++.sp
++.nf
++\f3pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-G, --strip-debug
++.br
++Strips debugging attributes from the output\&. These include \f3SourceFile\fR, \f3LineNumberTable\fR, \f3LocalVariableTable\fR and \f3LocalVariableTypeTable\fR\&. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers\&.
++.TP
++--keep-file-order
++.br
++Preserve the order of files in the input file\&. This is the default behavior\&.
++.TP
++-O, --no-keep-file-order
++.br
++The packer reorders and transmits all elements\&. The packer can also remove JAR directory names to reduce the download size\&. However, certain JAR file optimizations, such as indexing, might not work correctly\&.
++.TP
++-S\fIvalue\fR , --segment-limit=\fIvalue\fR
++.br
++The value is the estimated target size \fIN\fR (in bytes) of each archive segment\&. If a single input file requires more than \fIN\fR bytes, then its own archive segment is provided\&. As a special case, a value of \f3-1\fR produces a single large segment with all input files, while a value of 0 produces one segment for each class\&. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory\&.
++
++The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties\&.
++
++The default is -1, which means that the packer creates a single segment output file\&. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs\&.
++
++A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit)\&.
++.TP
++-E\fIvalue\fR , --effort=\fIvalue\fR
++.br
++If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive\&. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression\&. The special value 0 instructs the \f3pack200\fR command to copy through the original JAR file directly with no compression\&. The JSR 200 standard requires any unpacker to understand this special case as a pass-through of the entire archive\&.
++
++The default is 5, to invest a modest amount of time to produce reasonable compression\&.
++.TP
++-H\fIvalue\fR , --deflate-hint=\fIvalue\fR
++.br
++Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger\&. The possible values are: \f3true\fR, \f3false\fR, or \f3keep\fR\&.
++
++If the \f3value\fR is \f3true\fR or false, then the \f3packer200\fR command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements\&.
++
++The \f3keep\fR value preserves deflation hints observed in the input JAR\&. This is the default\&.
++.TP
++-m\fIvalue\fR , --modification-time=\fIvalue\fR
++.br
++The possible values are \f3latest\fR and \f3keep\fR\&.
++
++If the value is latest, then the packer attempts to determine the latest modification time, among all the available entries in the original archive, or the latest modification time of all the available entries in that segment\&. This single value is transmitted as part of the segment and applied to all the entries in each segment\&. This can marginally decrease the transmitted size of the archive at the expense of setting all installed files to a single date\&.
++
++If the value is \f3keep\fR, then modification times observed in the input JAR are preserved\&. This is the default\&.
++.TP
++-P\fIfile\fR , --pass-file=\fIfile\fR
++.br
++Indicates that a file should be passed through bytewise with no compression\&. By repeating the option, multiple files can be specified\&. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/)\&. The resulting file names must match exactly as strings with their occurrences in the JAR file\&. If \f3file\fR is a directory name, then all files under that directory are passed\&.
++.TP
++-U\fIaction\fR , --unknown-attribute=\fIaction\fR
++.br
++Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action\fR\&. The possible values for actions are \f3error\fR, \f3strip\fR, or \f3pass\fR\&.
++
++If the value is \f3error\fR, then the entire \f3pack200\fR command operation fails with a suitable explanation\&.
++
++If the value is \f3strip\fR, then the attribute is dropped\&. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures\&.
++
++If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
++.TP
++.nf
++-C\fIattribute-name\fR=\fIlayout\fR , --class-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-F\fIattribute-name\fR=\fIlayout\fR , --field-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-M\fIattribute-name\fR=\fIlayout\fR , --method-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-D\fIattribute-name\fR=\fIlayout\fR , --code-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute\fR, \f3field-attribute\fR, \f3method-attribute\fR, and \f3code-attribute\fR\&. The \fIattribute-name\fR is the name of the attribute for which the layout or action is being defined\&. The possible values for \fIaction\fR are \f3some-layout-string\fR, \f3error\fR, \f3strip\fR, \f3pass\fR\&.
++
++\f3some-layout-string\fR: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH\fR\&.
++
++If the value is \f3error\fR, then the \f3pack200\fR operation fails with an explanation\&.
++
++If the value is \f3strip\fR, then the attribute is removed from the output\&. Removing JVM-required attributes can cause class loader failures\&. For example, \f3--class-attribute=CompilationID=pass\fR causes the class file that contains this attribute to be passed through without further action by the packer\&.
++
++If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
++.TP
++-f \fIpack\&.properties\fR , --config-file=\fIpack\&.properties\fR
++.br
++A configuration file, containing Java properties to initialize the packer, can be specified on the command line\&.
++.sp
++.nf
++\f3pack200 \-f pack\&.properties myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3more pack\&.properties\fP
++.fi
++.nf
++\f3# Generic properties for the packer\&.\fP
++.fi
++.nf
++\f3modification\&.time=latest\fP
++.fi
++.nf
++\f3deflate\&.hint=false\fP
++.fi
++.nf
++\f3keep\&.file\&.order=false\fP
++.fi
++.nf
++\f3# This option will cause the files bearing new attributes to\fP
++.fi
++.nf
++\f3# be reported as an error rather than passed uncompressed\&.\fP
++.fi
++.nf
++\f3unknown\&.attribute=error\fP
++.fi
++.nf
++\f3# Change the segment limit to be unlimited\&.\fP
++.fi
++.nf
++\f3segment\&.limit=\-1\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-v, --verbose
++.br
++Outputs minimal messages\&. Multiple specification of this option will create more verbose messages\&.
++.TP
++-q, --quiet
++.br
++Specifies quiet operation with no messages\&.
++.TP
++-l\fIfilename\fR , --log-file=\fIfilename\fR
++.br
++Specifies a log file to output messages\&.
++.TP
++-?, -h, --help
++.br
++Prints help information about this command\&.
++.TP
++-V, --version
++.br
++Prints version information about this command\&.
++.TP
++-J\fIoption\fR
++.br
++Passes the specified option to the Java Virtual Machine\&. For more information, see the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
++.SH EXIT\ STATUS
++The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs\&.
++.SH NOTES
++This command should not be confused with \f3pack\fR(1)\&. The \f3pack\fR and \f3pack200\fR commands are separate products\&.
++.PP
++The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++unpack200(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/policytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/policytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Security Tools
+-.\" Title: policytool.1
+-.\"
+-.if n .pl 99999
+-.TH policytool 1 "03 March 2015" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Security Tools
++.\" Title: policytool.1
++.\"
++.if n .pl 99999
++.TH policytool 1 "03 March 2015" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,67 +47,67 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-policytool \- Reads and writes a plain text policy file based on user input through the utility GUI\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBpolicytool\fR [ \fB\-file\fR ] [ \fIfilename\fR ]
+-.fi
+-.sp
+-.TP
+--file
+-.br
+-Directs the \f3policytool\fR command to load a policy file\&.
+-.TP
+-\fIfilename\fR
+-The name of the file to be loaded\&.
+-.PP
+-\fIExamples\fR:
+-.PP
+-Run the policy tool administrator utility:
+-.sp
+-.nf
+-\f3policytool\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3policytool\fR command and load the specified file:
+-.sp
+-.nf
+-\f3policytool \-file \fImypolicyfile\fR\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH DESCRIPTION
+-The \f3policytool\fR command calls an administrator\&'s GUI that enables system administrators to manage the contents of local policy files\&. A policy file is a plain-text file with a \f3\&.policy\fR extension, that maps remote requestors by domain, to permission objects\&. For details, see Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.SH OPTIONS
+-.TP
+--file
+-.br
+-Directs the \f3policytool\fR command to load a policy file\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.TP 0.2i
+-\(bu
+-Policy File Creation and Management at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html
+-.TP 0.2i
+-\(bu
+-Permissions in Java SE Development Kit (JDK) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html
+-.TP 0.2i
+-\(bu
+-Java Security Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html
+-.TP 0.2i
+-\(bu
+-Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html
++
++.SH NAME
++policytool \- Reads and writes a plain text policy file based on user input through the utility GUI\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBpolicytool\fR [ \fB\-file\fR ] [ \fIfilename\fR ]
++.fi
++.sp
++.TP
++-file
++.br
++Directs the \f3policytool\fR command to load a policy file\&.
++.TP
++\fIfilename\fR
++The name of the file to be loaded\&.
++.PP
++\fIExamples\fR:
++.PP
++Run the policy tool administrator utility:
++.sp
++.nf
++\f3policytool\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3policytool\fR command and load the specified file:
++.sp
++.nf
++\f3policytool \-file \fImypolicyfile\fR\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH DESCRIPTION
++The \f3policytool\fR command calls an administrator\&'s GUI that enables system administrators to manage the contents of local policy files\&. A policy file is a plain-text file with a \f3\&.policy\fR extension, that maps remote requestors by domain, to permission objects\&. For details, see Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.SH OPTIONS
++.TP
++-file
++.br
++Directs the \f3policytool\fR command to load a policy file\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.TP 0.2i
++\(bu
++Policy File Creation and Management at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html
++.TP 0.2i
++\(bu
++Permissions in Java SE Development Kit (JDK) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html
++.TP 0.2i
++\(bu
++Java Security Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html
++.TP 0.2i
++\(bu
++Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/rmic.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/rmic.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmic.1
+-.\"
+-.if n .pl 99999
+-.TH rmic 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmic.1
++.\"
++.if n .pl 99999
++.TH rmic 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,176 +47,176 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmic \- Generates stub, skeleton, and tie classes for remote objects that use the Java Remote Method Protocol (JRMP) or Internet Inter-Orb protocol (IIOP)\&. Also generates Object Management Group (OMG) Interface Definition Language (IDL)
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmic\fR [ \fIoptions\fR ] \fIpackage\-qualified\-class\-names\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line \f3options\fR\&. See Options\&.
+-.TP
+-\fIpackage-qualified-class-names\fR
+-Class names that include their packages, for example, \f3java\&.awt\&.Color\fR\&.
+-.SH DESCRIPTION
+-\fIDeprecation Note:\fR Support for static generation of Java Remote Method Protocol (JRMP) stubs and skeletons has been deprecated\&. Oracle recommends that you use dynamically generated JRMP stubs instead, eliminating the need to use this tool for JRMP-based applications\&. See the \f3java\&.rmi\&.server\&.UnicastRemoteObject\fR specification at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html for further information\&.
+-.PP
+-The \f3rmic\fR compiler generates stub and skeleton class files using the Java Remote Method Protocol (JRMP) and stub and tie class files (IIOP protocol) for remote objects\&. These class files are generated from compiled Java programming language classes that are remote object implementation classes\&. A remote implementation class is a class that implements the interface \f3java\&.rmi\&.Remote\fR\&. The class names in the \f3rmic\fR command must be for classes that were compiled successfully with the \f3javac\fR command and must be fully package qualified\&. For example, running the \f3rmic\fR command on the class file name \f3HelloImpl\fR as shown here creates the \f3HelloImpl_Stub\&.class\fRfile in the hello subdirectory (named for the class\&'s package):
+-.sp
+-.nf
+-\f3rmic hello\&.HelloImpl\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-A skeleton for a remote object is a JRMP protocol server-side entity that has a method that dispatches calls to the remote object implementation\&.
+-.PP
+-A tie for a remote object is a server-side entity similar to a skeleton, but communicates with the client with the IIOP protocol\&.
+-.PP
+-A stub is a client-side proxy for a remote object that is responsible for communicating method invocations on remote objects to the server where the actual remote object implementation resides\&. A client\&'s reference to a remote object, therefore, is actually a reference to a local stub\&.
+-.PP
+-By default, the \f3rmic\fR command generates stub classes that use the 1\&.2 JRMP stub protocol version only, as though the \f3-v1\&.2\fR option was specified\&. The \f3-vcompat\fR option was the default in releases before 5\&.0\&. Use the \f3-iiop\fR option to generate stub and tie classes for the IIOP protocol\&. See Options\&.
+-.PP
+-A stub implements only the remote interfaces, and not any local interfaces that the remote object also implements\&. Because a JRMP stub implements the same set of remote interfaces as the remote object, a client can use the Java programming language built-in operators for casting and type checking\&. For IIOP, the \f3PortableRemoteObject\&.narrow\fR method must be used\&.
+-.SH OPTIONS
+-.TP
+--bootclasspath \fIpath\fR
+-.br
+-Overrides the location of bootstrap class files\&.
+-.TP
+--classpath path
+-.br
+-Specifies the path the \f3rmic\fR command uses to look up classes\&. This option overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons\&. The general format for path is: \f3\&.:<your_path>\fR, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies the root destination directory for the generated class hierarchy\&. You can use this option to specify a destination directory for the stub, skeleton, and tie files\&. For example, the following command places the stub and skeleton classes derived from MyClass into the directory /java/classes/exampleclass\&.
+-.sp
+-.nf
+-\f3rmic \-d /java/classes exampleclass\&.MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the \f3-d\fR option is not specified, then the default behavior is as if \f3-d \&.\fR was specified\&. The package hierarchy of the target class is created in the current directory, and stub/tie/skeleton files are placed within it\&. In some earlier releases of the \f3rmic\fR command, if the \f3-d\fR option was not specified, then the package hierarchy was not created, and all of the output files were placed directly in the current directory\&.
+-.TP
+--extdirs \fIpath\fR
+-.br
+-Overrides the location of installed extensions\&.
+-.TP
+--g
+-.br
+-Enables the generation of all debugging information, including local variables\&. By default, only line number information is generated\&.
+-.TP
+--idl
+-.br
+-Causes the \f3rmic\fR command to generate OMG IDL for the classes specified and any classes referenced\&. IDL provides a purely declarative, programming language-independent way to specify an API for an object\&. The IDL is used as a specification for methods and data that can be written in and called from any language that provides CORBA bindings\&. This includes Java and C++ among others\&. See Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
+-
+-When the \f3-idl\fR option is used, other options also include:
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
+-.TP 0.2i
+-\(bu
+-The \f3-factory\fR option uses the \f3factory\fR keyword in generated IDL\&.
+-.TP 0.2i
+-\(bu
+-The \f3-idlModule\fR from J\f3avaPackage[\&.class]\fR\f3toIDLModule\fR specifies \f3IDLEntity\fR package mapping, for example: \f3-idlModule\fR\f3my\&.module my::real::idlmod\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3-idlFile\fR\f3fromJavaPackage[\&.class] toIDLFile\fR specifies \f3IDLEntity\fR file mapping, for example: \f3-idlFile test\&.pkg\&.X TEST16\&.idl\fR\&.
+-.RE
+-
+-.TP
+--iiop
+-.br
+-Causes the \f3rmic\fR command to generate IIOP stub and tie classes, rather than JRMP stub and skeleton classes\&. A stub class is a local proxy for a remote object and is used by clients to send calls to a server\&. Each remote interface requires a stub class, which implements that remote interface\&. A client reference to a remote object is a reference to a stub\&. Tie classes are used on the server side to process incoming calls, and dispatch the calls to the proper implementation class\&. Each implementation class requires a tie class\&.
+-
+-If you call the \f3rmic\fR command with the \f3-iiop\fR, then it generates stubs and ties that conform to this naming convention:
+-.sp
+-.nf
+-\f3_<implementationName>_stub\&.class\fP
+-.fi
+-.nf
+-\f3_<interfaceName>_tie\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.RS
+-.TP 0.2i
+-\(bu
+-When you use the \f3-iiop\fR option, other options also include:
+-.TP 0.2i
+-\(bu
+-The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
+-.TP 0.2i
+-\(bu
+-The \f3-nolocalstubs\fR option means do not create stubs optimized for same-process clients and servers\&.
+-.TP 0.2i
+-\(bu
+-The \f3-noValueMethods\fR option must be used with the \f3-idl\fR option\&. The \f3-noValueMethods\fR option prevents the addition of \f3valuetype\fR methods and initializers to emitted IDL\&. These methods and initializers are optional for valuetypes, and are generated unless the \f3-noValueMethods\fR option is specified with the \f3-idl\fR option\&.
+-.TP 0.2i
+-\(bu
+-The \f3-poa\fR option changes the inheritance from \f3org\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR to \f3org\&.omg\&.PortableServer\&.Servant\fR\&. The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. In the Java programming language, the \f3Servant\fR type is mapped to the \f3Java org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&. Based on the OMG IDL to Java Language Mapping Specification, CORBA V 2\&.3\&.1 ptc/00-01-08\&.pdf\&..RE
+-
+-.TP
+--J
+-.br
+-Used with any Java command, the \f3-J\fR option passes the argument that follows the \f3-J\fR (no spaces between the \f3-J\fRand the argument) to the Java interpreter
+-.TP
+--keep or -keepgenerated
+-.br
+-Retains the generated \f3\&.java\fR source files for the stub, skeleton, and tie classes and writes them to the same directory as the\f3\&.class\fR files\&.
+-.TP
+--nowarn
+-.br
+-Turns off warnings\&. When the \f3-nowarn\fR options is used\&. The compiler does not print out any warnings\&.
+-.TP
+--nowrite
+-.br
+-Does not write compiled classes to the file system\&.
+-.TP
+--vcompat (deprecated)
+-.br
+-Generates stub and skeleton classes that are compatible with both the 1\&.1 and 1\&.2 JRMP stub protocol versions\&. This option was the default in releases before 5\&.0\&. The generated stub classes use the 1\&.1 stub protocol version when loaded in a JDK 1\&.1 virtual machine and use the 1\&.2 stub protocol version when loaded into a 1\&.2 (or later) virtual machine\&. The generated skeleton classes support both 1\&.1 and 1\&.2 stub protocol versions\&. The generated classes are relatively large to support both modes of operation\&. Note: This option has been deprecated\&. See Description\&.
+-.TP
+--verbose
+-.br
+-Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded\&.
+-.TP
+--v1\&.1 (deprecated)
+-.br
+-Generates stub and skeleton classes for the 1\&.1 JRMP stub protocol version only\&. The \f3-v1\&.1\fR option is only useful for generating stub classes that are serialization-compatible with preexisting, statically deployed stub classes that were generated by the \f3rmic\fR command from JDK 1\&.1 and that cannot be upgraded (and dynamic class loading is not being used)\&. Note: This option has been deprecated\&. See Description\&.
+-.TP
+--v1\&.2 (deprecated)
+-.br
+-(Default) Generates stub classes for the 1\&.2 JRMP stub protocol version only\&. No skeleton classes are generated because skeleton classes are not used with the 1\&.2 stub protocol version\&. The generated stub classes do not work when they are loaded into a JDK 1\&.1 virtual machine\&. Note: This option has been deprecated\&. See Description\&.
+-.SH ENVIRONMENT\ VARIABLES
+-.TP
+-CLASSPATH
+-Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-Setting the Class Path
++
++.SH NAME
++rmic \- Generates stub, skeleton, and tie classes for remote objects that use the Java Remote Method Protocol (JRMP) or Internet Inter-Orb protocol (IIOP)\&. Also generates Object Management Group (OMG) Interface Definition Language (IDL)
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmic\fR [ \fIoptions\fR ] \fIpackage\-qualified\-class\-names\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line \f3options\fR\&. See Options\&.
++.TP
++\fIpackage-qualified-class-names\fR
++Class names that include their packages, for example, \f3java\&.awt\&.Color\fR\&.
++.SH DESCRIPTION
++\fIDeprecation Note:\fR Support for static generation of Java Remote Method Protocol (JRMP) stubs and skeletons has been deprecated\&. Oracle recommends that you use dynamically generated JRMP stubs instead, eliminating the need to use this tool for JRMP-based applications\&. See the \f3java\&.rmi\&.server\&.UnicastRemoteObject\fR specification at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html for further information\&.
++.PP
++The \f3rmic\fR compiler generates stub and skeleton class files using the Java Remote Method Protocol (JRMP) and stub and tie class files (IIOP protocol) for remote objects\&. These class files are generated from compiled Java programming language classes that are remote object implementation classes\&. A remote implementation class is a class that implements the interface \f3java\&.rmi\&.Remote\fR\&. The class names in the \f3rmic\fR command must be for classes that were compiled successfully with the \f3javac\fR command and must be fully package qualified\&. For example, running the \f3rmic\fR command on the class file name \f3HelloImpl\fR as shown here creates the \f3HelloImpl_Stub\&.class\fRfile in the hello subdirectory (named for the class\&'s package):
++.sp
++.nf
++\f3rmic hello\&.HelloImpl\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++A skeleton for a remote object is a JRMP protocol server-side entity that has a method that dispatches calls to the remote object implementation\&.
++.PP
++A tie for a remote object is a server-side entity similar to a skeleton, but communicates with the client with the IIOP protocol\&.
++.PP
++A stub is a client-side proxy for a remote object that is responsible for communicating method invocations on remote objects to the server where the actual remote object implementation resides\&. A client\&'s reference to a remote object, therefore, is actually a reference to a local stub\&.
++.PP
++By default, the \f3rmic\fR command generates stub classes that use the 1\&.2 JRMP stub protocol version only, as though the \f3-v1\&.2\fR option was specified\&. The \f3-vcompat\fR option was the default in releases before 5\&.0\&. Use the \f3-iiop\fR option to generate stub and tie classes for the IIOP protocol\&. See Options\&.
++.PP
++A stub implements only the remote interfaces, and not any local interfaces that the remote object also implements\&. Because a JRMP stub implements the same set of remote interfaces as the remote object, a client can use the Java programming language built-in operators for casting and type checking\&. For IIOP, the \f3PortableRemoteObject\&.narrow\fR method must be used\&.
++.SH OPTIONS
++.TP
++-bootclasspath \fIpath\fR
++.br
++Overrides the location of bootstrap class files\&.
++.TP
++-classpath path
++.br
++Specifies the path the \f3rmic\fR command uses to look up classes\&. This option overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons\&. The general format for path is: \f3\&.:<your_path>\fR, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.TP
++-d \fIdirectory\fR
++.br
++Specifies the root destination directory for the generated class hierarchy\&. You can use this option to specify a destination directory for the stub, skeleton, and tie files\&. For example, the following command places the stub and skeleton classes derived from MyClass into the directory /java/classes/exampleclass\&.
++.sp
++.nf
++\f3rmic \-d /java/classes exampleclass\&.MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the \f3-d\fR option is not specified, then the default behavior is as if \f3-d \&.\fR was specified\&. The package hierarchy of the target class is created in the current directory, and stub/tie/skeleton files are placed within it\&. In some earlier releases of the \f3rmic\fR command, if the \f3-d\fR option was not specified, then the package hierarchy was not created, and all of the output files were placed directly in the current directory\&.
++.TP
++-extdirs \fIpath\fR
++.br
++Overrides the location of installed extensions\&.
++.TP
++-g
++.br
++Enables the generation of all debugging information, including local variables\&. By default, only line number information is generated\&.
++.TP
++-idl
++.br
++Causes the \f3rmic\fR command to generate OMG IDL for the classes specified and any classes referenced\&. IDL provides a purely declarative, programming language-independent way to specify an API for an object\&. The IDL is used as a specification for methods and data that can be written in and called from any language that provides CORBA bindings\&. This includes Java and C++ among others\&. See Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
++
++When the \f3-idl\fR option is used, other options also include:
++.RS
++.TP 0.2i
++\(bu
++The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
++.TP 0.2i
++\(bu
++The \f3-factory\fR option uses the \f3factory\fR keyword in generated IDL\&.
++.TP 0.2i
++\(bu
++The \f3-idlModule\fR from J\f3avaPackage[\&.class]\fR\f3toIDLModule\fR specifies \f3IDLEntity\fR package mapping, for example: \f3-idlModule\fR\f3my\&.module my::real::idlmod\fR\&.
++.TP 0.2i
++\(bu
++\f3-idlFile\fR\f3fromJavaPackage[\&.class] toIDLFile\fR specifies \f3IDLEntity\fR file mapping, for example: \f3-idlFile test\&.pkg\&.X TEST16\&.idl\fR\&.
++.RE
++
++.TP
++-iiop
++.br
++Causes the \f3rmic\fR command to generate IIOP stub and tie classes, rather than JRMP stub and skeleton classes\&. A stub class is a local proxy for a remote object and is used by clients to send calls to a server\&. Each remote interface requires a stub class, which implements that remote interface\&. A client reference to a remote object is a reference to a stub\&. Tie classes are used on the server side to process incoming calls, and dispatch the calls to the proper implementation class\&. Each implementation class requires a tie class\&.
++
++If you call the \f3rmic\fR command with the \f3-iiop\fR, then it generates stubs and ties that conform to this naming convention:
++.sp
++.nf
++\f3_<implementationName>_stub\&.class\fP
++.fi
++.nf
++\f3_<interfaceName>_tie\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.RS
++.TP 0.2i
++\(bu
++When you use the \f3-iiop\fR option, other options also include:
++.TP 0.2i
++\(bu
++The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
++.TP 0.2i
++\(bu
++The \f3-nolocalstubs\fR option means do not create stubs optimized for same-process clients and servers\&.
++.TP 0.2i
++\(bu
++The \f3-noValueMethods\fR option must be used with the \f3-idl\fR option\&. The \f3-noValueMethods\fR option prevents the addition of \f3valuetype\fR methods and initializers to emitted IDL\&. These methods and initializers are optional for valuetypes, and are generated unless the \f3-noValueMethods\fR option is specified with the \f3-idl\fR option\&.
++.TP 0.2i
++\(bu
++The \f3-poa\fR option changes the inheritance from \f3org\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR to \f3org\&.omg\&.PortableServer\&.Servant\fR\&. The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. In the Java programming language, the \f3Servant\fR type is mapped to the \f3Java org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&. Based on the OMG IDL to Java Language Mapping Specification, CORBA V 2\&.3\&.1 ptc/00-01-08\&.pdf\&..RE
++
++.TP
++-J
++.br
++Used with any Java command, the \f3-J\fR option passes the argument that follows the \f3-J\fR (no spaces between the \f3-J\fRand the argument) to the Java interpreter
++.TP
++-keep or -keepgenerated
++.br
++Retains the generated \f3\&.java\fR source files for the stub, skeleton, and tie classes and writes them to the same directory as the\f3\&.class\fR files\&.
++.TP
++-nowarn
++.br
++Turns off warnings\&. When the \f3-nowarn\fR options is used\&. The compiler does not print out any warnings\&.
++.TP
++-nowrite
++.br
++Does not write compiled classes to the file system\&.
++.TP
++-vcompat (deprecated)
++.br
++Generates stub and skeleton classes that are compatible with both the 1\&.1 and 1\&.2 JRMP stub protocol versions\&. This option was the default in releases before 5\&.0\&. The generated stub classes use the 1\&.1 stub protocol version when loaded in a JDK 1\&.1 virtual machine and use the 1\&.2 stub protocol version when loaded into a 1\&.2 (or later) virtual machine\&. The generated skeleton classes support both 1\&.1 and 1\&.2 stub protocol versions\&. The generated classes are relatively large to support both modes of operation\&. Note: This option has been deprecated\&. See Description\&.
++.TP
++-verbose
++.br
++Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded\&.
++.TP
++-v1\&.1 (deprecated)
++.br
++Generates stub and skeleton classes for the 1\&.1 JRMP stub protocol version only\&. The \f3-v1\&.1\fR option is only useful for generating stub classes that are serialization-compatible with preexisting, statically deployed stub classes that were generated by the \f3rmic\fR command from JDK 1\&.1 and that cannot be upgraded (and dynamic class loading is not being used)\&. Note: This option has been deprecated\&. See Description\&.
++.TP
++-v1\&.2 (deprecated)
++.br
++(Default) Generates stub classes for the 1\&.2 JRMP stub protocol version only\&. No skeleton classes are generated because skeleton classes are not used with the 1\&.2 stub protocol version\&. The generated stub classes do not work when they are loaded into a JDK 1\&.1 virtual machine\&. Note: This option has been deprecated\&. See Description\&.
++.SH ENVIRONMENT\ VARIABLES
++.TP
++CLASSPATH
++Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++Setting the Class Path
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/rmid.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/rmid.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmid.1
+-.\"
+-.if n .pl 99999
+-.TH rmid 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmid.1
++.\"
++.if n .pl 99999
++.TH rmid 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,267 +47,267 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmid \- Starts the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmid\fR [\fIoptions\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3rmid\fR command starts the activation system daemon\&. The activation system daemon must be started before activatable objects can be either registered with the activation system or activated in a JVM\&. For details on how to write programs that use activatable objects, the \fIUsing Activation\fR tutorial at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html
+-.PP
+-Start the daemon by executing the \f3rmid\fR command and specifying a security policy file, as follows:
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When you run Oracle\(cqs implementation of the \f3rmid\fR command, by default you must specify a security policy file so that the \f3rmid\fR command can verify whether or not the information in each \f3ActivationGroupDesc\fR is allowed to be used to start a JVM for an activation group\&. Specifically, the command and options specified by the \f3CommandEnvironment\fR and any properties passed to an \f3ActivationGroupDesc\fR constructor must now be explicitly allowed in the security policy file for the \f3rmid\fR command\&. The value of the \f3sun\&.rmi\&.activation\&.execPolicy\fR property dictates the policy that the \f3rmid\fR command uses to determine whether or not the information in an \f3ActivationGroupDesc\fR can be used to start a JVM for an activation group\&. For more information see the description of the -J-Dsun\&.rmi\&.activation\&.execPolicy=policy option\&.
+-.PP
+-Executing the \f3rmid\fR command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem\fR to the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR in this internal registry\&.
+-.PP
+-To specify an alternate port for the registry, you must specify the \f3-port\fR option when you execute the \f3rmid\fR command\&. For example, the following command starts the activation system daemon and a registry on the registry\&'s default port, 1099\&.
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH START\ RMID\ ON\ DEMAND
+-An alternative to starting \f3rmid\fR from the command line is to configure \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) to start \f3rmid\fR on demand\&.
+-.PP
+-When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd\fR/\f3xinetd\fR) by calling the \f3System\&.inheritedChannel\fR method\&. If the inherited channel is null or not an instance of \f3java\&.nio\&.channels\&.ServerSocketChannel\fR, then RMID assumes that it was not started by \f3inetd\fR/\f3xinetd\fR, and it starts as previously described\&.
+-.PP
+-If the inherited channel is a \f3ServerSocketChannel\fR instance, then RMID uses the \f3java\&.net\&.ServerSocket\fR obtained from the \f3ServerSocketChannel\fR as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java\&.rmi\&.activation\&.ActivationSystem\fR is bound and the \f3java\&.rmi\&.activation\&.Activator\fR remote object\&. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
+-.TP 0.2i
+-\(bu
+-Output printed to \f3System\&.err\fR is redirected to a file\&. This file is located in the directory specified by the \f3java\&.io\&.tmpdir\fR system property (typically \f3/var/tmp\fR or \f3/tmp\fR) with the prefix \f3rmid-err\fR and the suffix \f3tmp\fR\&.
+-.TP 0.2i
+-\(bu
+-The \f3-port\fR option is not allowed\&. If this option is specified, then RMID exits with an error message\&.
+-.TP 0.2i
+-\(bu
+-The \f3-log\fR option is required\&. If this option is not specified, then RMID exits with an error message
+-.PP
+-See the man pages for \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) for details on how to configure services to be started on demand\&.
+-.SH OPTIONS
+-.TP
+--C\fIoption\fR
+-.br
+-Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid\fR command when that process is created\&. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
+-.sp
+-.nf
+-\f3rmid \-C\-Dsome\&.property=value\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This ability to pass command-line arguments to child processes can be useful for debugging\&. For example, the following command enables server-call logging in all child JVMs\&.
+-.sp
+-.nf
+-\f3rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--J\fIoption\fR
+-.br
+-Specifies an option that is passed to the Java interpreter running RMID\&. For example, to specify that the \f3rmid\fR command use a policy file named \f3rmid\&.policy\fR, the \f3-J\fR option can be used to define the \f3java\&.security\&.policy\fR property on the \f3rmid\fR command line, for example:
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--J-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR
+-.br
+-Specifies the policy that RMID employs to check commands and command-line options used to start the JVM in which an activation group runs\&. Please note that this option exists only in Oracle\&'s implementation of the Java RMI activation daemon\&. If this property is not specified on the command line, then the result is the same as though \f3-J-Dsun\&.rmi\&.activation\&.execPolicy=default\fR were specified\&. The possible values of \f3policy\fR can be \f3default\fR, \f3policyClassName\fR, or \f3none\fR\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-default
+-
+-The \f3default\fR or unspecified value \f3execPolicy\fR allows the \f3rmid\fR command to execute commands with specific command-line options only when the \f3rmid\fR command was granted permission to execute those commands and options in the security policy file that the \f3rmid\fR command uses\&. Only the default activation group implementation can be used with the default execution policy\&.
+-
+-The \f3rmid\fR command starts a JVM for an activation group with the information in the group\&'s registered activation group descriptor, an \f3ActivationGroupDesc\fR\&. The group descriptor specifies an optional \f3ActivationGroupDesc\&.CommandEnvironment\fR that includes the command to execute to start the activation group and any command-line options to be added to the command line\&. By default, the \f3rmid\fR command uses the \f3java\fR command found in \f3java\&.home\fR\&. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>\fR\&.The \f3com\&.sun\&.rmi\&.rmid\&.ExecPermission\fR permission grants the \f3rmid\fR command permission to execute a command that is specified in the group descriptor\&'s \f3CommandEnvironment\fR to start an activation group\&. The \f3com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR permission enables the \f3rmid\fR command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment\fR when starting the activation group\&.When granting the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources\&.
+-
+-\fIExecPermission\fR
+-
+-The \f3ExecPermission\fR class represents permission for the \f3rmid\fR command to execute a specific command to start an activation group\&.
+-
+-\fISyntax\fR: The name of an \f3ExecPermission\fR is the path name of a command to grant the \f3rmid\fR command permission to execute\&. A path name that ends in a slash (/) and an asterisk (*) indicates that all of the files contained in that directory where slash is the file-separator character, \f3File\&.separatorChar\fR\&. A path name that ends in a slash (/) and a minus sign (-) indicates all files and subdirectories contained in that directory (recursively)\&. A path name that consists of the special token \f3<<ALL FILES>>\fR matches any file\&.
+-
+-A path name that consists of an asterisk (*) indicates all the files in the current directory\&. A path name that consists of a minus sign (-) indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory\&.
+-
+-\fIExecOptionPermission\fR
+-
+-The \f3ExecOptionPermission\fR class represents permission for the \f3rmid\fR command to use a specific command-line option when starting an activation group\&. The name of an \f3ExecOptionPermission\fR is the value of a command-line option\&.
+-
+-\fISyntax\fR: Options support a limited wild card scheme\&. An asterisk signifies a wild card match, and it can appear as the option name itself (matches any option), or an asterisk (*) can appear at the end of the option name only when the asterisk (*) follows a dot (\&.) or an equals sign (=)\&.
+-
+-For example: \f3*\fR or \f3-Dmydir\&.*\fR or \f3-Da\&.b\&.c=*\fR is valid, but \f3*mydir\fR or \f3-Da*b\fR or \f3ab*\fR is not\&.
+-
+-\fIPolicy file for rmid\fR
+-
+-When you grant the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources (universally)\&. It is safe to grant these permissions universally because only the \f3rmid\fR command checks these permissions\&.
+-
+-An example policy file that grants various execute permissions to the \f3rmid\fR command is:
+-.sp
+-.nf
+-\f3grant {\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
+-.fi
+-.nf
+-\f3 "/files/apps/java/jdk1\&.7\&.0/solaris/bin/java";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
+-.fi
+-.nf
+-\f3 "/files/apps/rmidcmds/*";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Djava\&.security\&.policy=/files/policies/group\&.policy";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Djava\&.security\&.debug=*";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Dsun\&.rmi\&.*";\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The first permission granted allows the \f3rmid\fR tcommand o execute the 1\&.7\&.0 release of the \f3java\fR command, specified by its explicit path name\&. By default, the version of the \f3java\fR command found in \f3java\&.home\fR is used (the same one that the \f3rmid\fR command uses), and does not need to be specified in the policy file\&. The second permission allows the \f3rmid\fR command to execute any command in the directory \f3/files/apps/rmidcmds\fR\&.
+-
+-The third permission granted, an \f3ExecOptionPermission\fR, allows the \f3rmid\fR command to start an activation group that defines the security policy file to be \f3/files/policies/group\&.policy\fR\&. The next permission allows the \f3java\&.security\&.debug property\fR to be used by an activation group\&. The last permission allows any property in the \f3sun\&.rmi property\fR name hierarchy to be used by activation groups\&.
+-
+-To start the \f3rmid\fR command with a policy file, the \f3java\&.security\&.policy\fR property needs to be specified on the \f3rmid\fR command line, for example:
+-
+-\f3rmid -J-Djava\&.security\&.policy=rmid\&.policy\fR\&.
+-.TP 0.2i
+-\(bu
+-<policyClassName>
+-
+-If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid\fR command, the name of a class whose \f3checkExecCommand\fR method is executed to check commands to be executed by the \f3rmid\fR command\&.
+-
+-The \f3policyClassName\fR specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand\fR method:
+-.sp
+-.nf
+-\f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)\fP
+-.fi
+-.nf
+-\f3 throws SecurityException;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Before starting an activation group, the \f3rmid\fR command calls the policy\&'s \f3checkExecCommand\fR method and passes to it the activation group descriptor and an array that contains the complete command to start the activation group\&. If the \f3checkExecCommand\fR throws a \f3SecurityException\fR, then the \f3rmid\fR command does not start the activation group and an \f3ActivationException\fR is thrown to the caller attempting to activate the object\&.
+-.TP 0.2i
+-\(bu
+-none
+-
+-If the \f3sun\&.rmi\&.activation\&.execPolicy\fR property value is \f3none\fR, then the \f3rmid\fR command does not perform any validation of commands to start activation groups\&.
+-.RE
+-
+-.TP
+--log \fIdir\fR
+-.br
+-Specifies the name of the directory the activation system daemon uses to write its database and associated information\&. The log directory defaults to creating a log, in the directory in which the \f3rmid\fR command was executed\&.
+-.TP
+--port \fIport\fR
+-.br
+-Specifies the port the registry uses\&. The activation system daemon binds the \f3ActivationSystem\fR, with the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR, in this registry\&. The \f3ActivationSystem\fR on the local machine can be obtained using the following \f3Naming\&.lookup\fR method call:
+-.sp
+-.nf
+-\f3import java\&.rmi\&.*; \fP
+-.fi
+-.nf
+-\f3 import java\&.rmi\&.activation\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 ActivationSystem system; system = (ActivationSystem)\fP
+-.fi
+-.nf
+-\f3 Naming\&.lookup("//:port/java\&.rmi\&.activation\&.ActivationSystem");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--stop
+-.br
+-Stops the current invocation of the \f3rmid\fR command for a port specified by the \f3-port\fR option\&. If no port is specified, then this option stops the \f3rmid\fR invocation running on port 1098\&.
+-.SH ENVIRONMENT\ VARIABLES
+-.TP
+-CLASSPATH
+-Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-Setting the Class Path
++
++.SH NAME
++rmid \- Starts the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmid\fR [\fIoptions\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3rmid\fR command starts the activation system daemon\&. The activation system daemon must be started before activatable objects can be either registered with the activation system or activated in a JVM\&. For details on how to write programs that use activatable objects, the \fIUsing Activation\fR tutorial at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html
++.PP
++Start the daemon by executing the \f3rmid\fR command and specifying a security policy file, as follows:
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When you run Oracle\(cqs implementation of the \f3rmid\fR command, by default you must specify a security policy file so that the \f3rmid\fR command can verify whether or not the information in each \f3ActivationGroupDesc\fR is allowed to be used to start a JVM for an activation group\&. Specifically, the command and options specified by the \f3CommandEnvironment\fR and any properties passed to an \f3ActivationGroupDesc\fR constructor must now be explicitly allowed in the security policy file for the \f3rmid\fR command\&. The value of the \f3sun\&.rmi\&.activation\&.execPolicy\fR property dictates the policy that the \f3rmid\fR command uses to determine whether or not the information in an \f3ActivationGroupDesc\fR can be used to start a JVM for an activation group\&. For more information see the description of the -J-Dsun\&.rmi\&.activation\&.execPolicy=policy option\&.
++.PP
++Executing the \f3rmid\fR command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem\fR to the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR in this internal registry\&.
++.PP
++To specify an alternate port for the registry, you must specify the \f3-port\fR option when you execute the \f3rmid\fR command\&. For example, the following command starts the activation system daemon and a registry on the registry\&'s default port, 1099\&.
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH START\ RMID\ ON\ DEMAND
++An alternative to starting \f3rmid\fR from the command line is to configure \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) to start \f3rmid\fR on demand\&.
++.PP
++When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd\fR/\f3xinetd\fR) by calling the \f3System\&.inheritedChannel\fR method\&. If the inherited channel is null or not an instance of \f3java\&.nio\&.channels\&.ServerSocketChannel\fR, then RMID assumes that it was not started by \f3inetd\fR/\f3xinetd\fR, and it starts as previously described\&.
++.PP
++If the inherited channel is a \f3ServerSocketChannel\fR instance, then RMID uses the \f3java\&.net\&.ServerSocket\fR obtained from the \f3ServerSocketChannel\fR as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java\&.rmi\&.activation\&.ActivationSystem\fR is bound and the \f3java\&.rmi\&.activation\&.Activator\fR remote object\&. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
++.TP 0.2i
++\(bu
++Output printed to \f3System\&.err\fR is redirected to a file\&. This file is located in the directory specified by the \f3java\&.io\&.tmpdir\fR system property (typically \f3/var/tmp\fR or \f3/tmp\fR) with the prefix \f3rmid-err\fR and the suffix \f3tmp\fR\&.
++.TP 0.2i
++\(bu
++The \f3-port\fR option is not allowed\&. If this option is specified, then RMID exits with an error message\&.
++.TP 0.2i
++\(bu
++The \f3-log\fR option is required\&. If this option is not specified, then RMID exits with an error message
++.PP
++See the man pages for \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) for details on how to configure services to be started on demand\&.
++.SH OPTIONS
++.TP
++-C\fIoption\fR
++.br
++Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid\fR command when that process is created\&. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
++.sp
++.nf
++\f3rmid \-C\-Dsome\&.property=value\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This ability to pass command-line arguments to child processes can be useful for debugging\&. For example, the following command enables server-call logging in all child JVMs\&.
++.sp
++.nf
++\f3rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-J\fIoption\fR
++.br
++Specifies an option that is passed to the Java interpreter running RMID\&. For example, to specify that the \f3rmid\fR command use a policy file named \f3rmid\&.policy\fR, the \f3-J\fR option can be used to define the \f3java\&.security\&.policy\fR property on the \f3rmid\fR command line, for example:
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-J-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR
++.br
++Specifies the policy that RMID employs to check commands and command-line options used to start the JVM in which an activation group runs\&. Please note that this option exists only in Oracle\&'s implementation of the Java RMI activation daemon\&. If this property is not specified on the command line, then the result is the same as though \f3-J-Dsun\&.rmi\&.activation\&.execPolicy=default\fR were specified\&. The possible values of \f3policy\fR can be \f3default\fR, \f3policyClassName\fR, or \f3none\fR\&.
++.RS
++.TP 0.2i
++\(bu
++default
++
++The \f3default\fR or unspecified value \f3execPolicy\fR allows the \f3rmid\fR command to execute commands with specific command-line options only when the \f3rmid\fR command was granted permission to execute those commands and options in the security policy file that the \f3rmid\fR command uses\&. Only the default activation group implementation can be used with the default execution policy\&.
++
++The \f3rmid\fR command starts a JVM for an activation group with the information in the group\&'s registered activation group descriptor, an \f3ActivationGroupDesc\fR\&. The group descriptor specifies an optional \f3ActivationGroupDesc\&.CommandEnvironment\fR that includes the command to execute to start the activation group and any command-line options to be added to the command line\&. By default, the \f3rmid\fR command uses the \f3java\fR command found in \f3java\&.home\fR\&. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>\fR\&.The \f3com\&.sun\&.rmi\&.rmid\&.ExecPermission\fR permission grants the \f3rmid\fR command permission to execute a command that is specified in the group descriptor\&'s \f3CommandEnvironment\fR to start an activation group\&. The \f3com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR permission enables the \f3rmid\fR command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment\fR when starting the activation group\&.When granting the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources\&.
++
++\fIExecPermission\fR
++
++The \f3ExecPermission\fR class represents permission for the \f3rmid\fR command to execute a specific command to start an activation group\&.
++
++\fISyntax\fR: The name of an \f3ExecPermission\fR is the path name of a command to grant the \f3rmid\fR command permission to execute\&. A path name that ends in a slash (/) and an asterisk (*) indicates that all of the files contained in that directory where slash is the file-separator character, \f3File\&.separatorChar\fR\&. A path name that ends in a slash (/) and a minus sign (-) indicates all files and subdirectories contained in that directory (recursively)\&. A path name that consists of the special token \f3<<ALL FILES>>\fR matches any file\&.
++
++A path name that consists of an asterisk (*) indicates all the files in the current directory\&. A path name that consists of a minus sign (-) indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory\&.
++
++\fIExecOptionPermission\fR
++
++The \f3ExecOptionPermission\fR class represents permission for the \f3rmid\fR command to use a specific command-line option when starting an activation group\&. The name of an \f3ExecOptionPermission\fR is the value of a command-line option\&.
++
++\fISyntax\fR: Options support a limited wild card scheme\&. An asterisk signifies a wild card match, and it can appear as the option name itself (matches any option), or an asterisk (*) can appear at the end of the option name only when the asterisk (*) follows a dot (\&.) or an equals sign (=)\&.
++
++For example: \f3*\fR or \f3-Dmydir\&.*\fR or \f3-Da\&.b\&.c=*\fR is valid, but \f3*mydir\fR or \f3-Da*b\fR or \f3ab*\fR is not\&.
++
++\fIPolicy file for rmid\fR
++
++When you grant the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources (universally)\&. It is safe to grant these permissions universally because only the \f3rmid\fR command checks these permissions\&.
++
++An example policy file that grants various execute permissions to the \f3rmid\fR command is:
++.sp
++.nf
++\f3grant {\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
++.fi
++.nf
++\f3 "/files/apps/java/jdk1\&.7\&.0/solaris/bin/java";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
++.fi
++.nf
++\f3 "/files/apps/rmidcmds/*";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Djava\&.security\&.policy=/files/policies/group\&.policy";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Djava\&.security\&.debug=*";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Dsun\&.rmi\&.*";\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The first permission granted allows the \f3rmid\fR tcommand o execute the 1\&.7\&.0 release of the \f3java\fR command, specified by its explicit path name\&. By default, the version of the \f3java\fR command found in \f3java\&.home\fR is used (the same one that the \f3rmid\fR command uses), and does not need to be specified in the policy file\&. The second permission allows the \f3rmid\fR command to execute any command in the directory \f3/files/apps/rmidcmds\fR\&.
++
++The third permission granted, an \f3ExecOptionPermission\fR, allows the \f3rmid\fR command to start an activation group that defines the security policy file to be \f3/files/policies/group\&.policy\fR\&. The next permission allows the \f3java\&.security\&.debug property\fR to be used by an activation group\&. The last permission allows any property in the \f3sun\&.rmi property\fR name hierarchy to be used by activation groups\&.
++
++To start the \f3rmid\fR command with a policy file, the \f3java\&.security\&.policy\fR property needs to be specified on the \f3rmid\fR command line, for example:
++
++\f3rmid -J-Djava\&.security\&.policy=rmid\&.policy\fR\&.
++.TP 0.2i
++\(bu
++<policyClassName>
++
++If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid\fR command, the name of a class whose \f3checkExecCommand\fR method is executed to check commands to be executed by the \f3rmid\fR command\&.
++
++The \f3policyClassName\fR specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand\fR method:
++.sp
++.nf
++\f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)\fP
++.fi
++.nf
++\f3 throws SecurityException;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Before starting an activation group, the \f3rmid\fR command calls the policy\&'s \f3checkExecCommand\fR method and passes to it the activation group descriptor and an array that contains the complete command to start the activation group\&. If the \f3checkExecCommand\fR throws a \f3SecurityException\fR, then the \f3rmid\fR command does not start the activation group and an \f3ActivationException\fR is thrown to the caller attempting to activate the object\&.
++.TP 0.2i
++\(bu
++none
++
++If the \f3sun\&.rmi\&.activation\&.execPolicy\fR property value is \f3none\fR, then the \f3rmid\fR command does not perform any validation of commands to start activation groups\&.
++.RE
++
++.TP
++-log \fIdir\fR
++.br
++Specifies the name of the directory the activation system daemon uses to write its database and associated information\&. The log directory defaults to creating a log, in the directory in which the \f3rmid\fR command was executed\&.
++.TP
++-port \fIport\fR
++.br
++Specifies the port the registry uses\&. The activation system daemon binds the \f3ActivationSystem\fR, with the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR, in this registry\&. The \f3ActivationSystem\fR on the local machine can be obtained using the following \f3Naming\&.lookup\fR method call:
++.sp
++.nf
++\f3import java\&.rmi\&.*; \fP
++.fi
++.nf
++\f3 import java\&.rmi\&.activation\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 ActivationSystem system; system = (ActivationSystem)\fP
++.fi
++.nf
++\f3 Naming\&.lookup("//:port/java\&.rmi\&.activation\&.ActivationSystem");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-stop
++.br
++Stops the current invocation of the \f3rmid\fR command for a port specified by the \f3-port\fR option\&. If no port is specified, then this option stops the \f3rmid\fR invocation running on port 1098\&.
++.SH ENVIRONMENT\ VARIABLES
++.TP
++CLASSPATH
++Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++Setting the Class Path
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/rmiregistry.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/rmiregistry.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmiregistry.1
+-.\"
+-.if n .pl 99999
+-.TH rmiregistry 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmiregistry.1
++.\"
++.if n .pl 99999
++.TH rmiregistry 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,51 +47,51 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmiregistry \- Starts a remote object registry on the specified port on the current host\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmiregistry\fR [ \fIport\fR ]
+-.fi
+-.sp
+-.TP
+-\fIport\fR
+-The number of a \f3port\fR on the current host at which to start the remote object registry\&.
+-.SH DESCRIPTION
+-The \f3rmiregistry\fR command creates and starts a remote object registry on the specified port on the current host\&. If the port is omitted, then the registry is started on port 1099\&. The \f3rmiregistry\fR command produces no output and is typically run in the background, for example:
+-.sp
+-.nf
+-\f3rmiregistry &\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-A remote object registry is a bootstrap naming service that is used by RMI servers on the same host to bind remote objects to names\&. Clients on local and remote hosts can then look up remote objects and make remote method invocations\&.
+-.PP
+-The registry is typically used to locate the first remote object on which an application needs to call methods\&. That object then provides application-specific support for finding other objects\&.
+-.PP
+-The methods of the \f3java\&.rmi\&.registry\&.LocateRegistry\fR class are used to get a registry operating on the local host or local host and port\&.
+-.PP
+-The URL-based methods of the \f3java\&.rmi\&.Naming\fR class operate on a registry and can be used to look up a remote object on any host and on the local host\&. Bind a simple name (string) to a remote object, rebind a new name to a remote object (overriding the old binding), unbind a remote object, and list the URL bound in the registry\&.
+-.SH OPTIONS
+-.TP
+--J
+-.br
+-Used with any Java option to pass the option following the \f3-J\fR (no spaces between the \f3-J\fR and the option) to the Java interpreter\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-\f3java\&.rmi\&.registry\&.LocateRegistry\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html
+-.TP 0.2i
+-\(bu
+-\f3java\&.rmi\&.Naming class description\fR at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html
++
++.SH NAME
++rmiregistry \- Starts a remote object registry on the specified port on the current host\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmiregistry\fR [ \fIport\fR ]
++.fi
++.sp
++.TP
++\fIport\fR
++The number of a \f3port\fR on the current host at which to start the remote object registry\&.
++.SH DESCRIPTION
++The \f3rmiregistry\fR command creates and starts a remote object registry on the specified port on the current host\&. If the port is omitted, then the registry is started on port 1099\&. The \f3rmiregistry\fR command produces no output and is typically run in the background, for example:
++.sp
++.nf
++\f3rmiregistry &\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++A remote object registry is a bootstrap naming service that is used by RMI servers on the same host to bind remote objects to names\&. Clients on local and remote hosts can then look up remote objects and make remote method invocations\&.
++.PP
++The registry is typically used to locate the first remote object on which an application needs to call methods\&. That object then provides application-specific support for finding other objects\&.
++.PP
++The methods of the \f3java\&.rmi\&.registry\&.LocateRegistry\fR class are used to get a registry operating on the local host or local host and port\&.
++.PP
++The URL-based methods of the \f3java\&.rmi\&.Naming\fR class operate on a registry and can be used to look up a remote object on any host and on the local host\&. Bind a simple name (string) to a remote object, rebind a new name to a remote object (overriding the old binding), unbind a remote object, and list the URL bound in the registry\&.
++.SH OPTIONS
++.TP
++-J
++.br
++Used with any Java option to pass the option following the \f3-J\fR (no spaces between the \f3-J\fR and the option) to the Java interpreter\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++\f3java\&.rmi\&.registry\&.LocateRegistry\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html
++.TP 0.2i
++\(bu
++\f3java\&.rmi\&.Naming class description\fR at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/schemagen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/schemagen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: schemagen.1
+-.\"
+-.if n .pl 99999
+-.TH schemagen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: schemagen.1
++.\"
++.if n .pl 99999
++.TH schemagen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,74 +47,74 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-schemagen \- Generates a schema for every name space that is referenced in your Java classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBschemagen\fR [ \fIoptions\fR ] \fIjava\-files\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIjava-files\fR
+-The Java class files to be processed\&.
+-.SH DESCRIPTION
+-The schema generator creates a schema file for each name space referenced in your Java classes\&. Currently, you cannot control the name of the generated schema files\&. To control the schema file names, see Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
+-.PP
+-Start the schema generator with the appropriate \f3schemagen\fR shell script in the bin directory for your platform\&. The current schema generator can process either Java source files or class files\&.
+-.sp
+-.nf
+-\f3schemagen\&.sh Foo\&.java Bar\&.java \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3Note: Writing schema1\&.xsd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If your java files reference other classes, then those classes must be accessible on your system \f3CLASSPATH\fR environment variable, or they need to be specified in the \f3schemagen\fR command line with the class path options\&. See Options\&. If the referenced files are not accessible or specified, then you get errors when you generate the schema\&.
+-.SH OPTIONS
+-.TP
+--d \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places processor-generated and \f3javac\fR-generated class files\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places user-specified files\&.
+-.TP
+--classpath \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places user-specified files\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Specifies the encoding to use for \f3apt\fR or \f3javac\fR command invocations\&.
+-.TP
+--episode \fIfile\fR
+-.br
+-Generates an episode file for separate compilation\&.
+-.TP
+--version
+-.br
+-Displays release information\&.
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
+-.TP 0.2i
+-\(bu
+-Java Architecture for XML Binding (JAXB) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/xml/jaxb/index\&.html
++
++.SH NAME
++schemagen \- Generates a schema for every name space that is referenced in your Java classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBschemagen\fR [ \fIoptions\fR ] \fIjava\-files\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIjava-files\fR
++The Java class files to be processed\&.
++.SH DESCRIPTION
++The schema generator creates a schema file for each name space referenced in your Java classes\&. Currently, you cannot control the name of the generated schema files\&. To control the schema file names, see Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
++.PP
++Start the schema generator with the appropriate \f3schemagen\fR shell script in the bin directory for your platform\&. The current schema generator can process either Java source files or class files\&.
++.sp
++.nf
++\f3schemagen\&.sh Foo\&.java Bar\&.java \&.\&.\&.\fP
++.fi
++.nf
++\f3Note: Writing schema1\&.xsd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If your java files reference other classes, then those classes must be accessible on your system \f3CLASSPATH\fR environment variable, or they need to be specified in the \f3schemagen\fR command line with the class path options\&. See Options\&. If the referenced files are not accessible or specified, then you get errors when you generate the schema\&.
++.SH OPTIONS
++.TP
++-d \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places processor-generated and \f3javac\fR-generated class files\&.
++.TP
++-cp \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places user-specified files\&.
++.TP
++-classpath \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places user-specified files\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Specifies the encoding to use for \f3apt\fR or \f3javac\fR command invocations\&.
++.TP
++-episode \fIfile\fR
++.br
++Generates an episode file for separate compilation\&.
++.TP
++-version
++.br
++Displays release information\&.
++.TP
++-help
++.br
++Displays a help message\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
++.TP 0.2i
++\(bu
++Java Architecture for XML Binding (JAXB) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/xml/jaxb/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/serialver.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/serialver.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: serialver.1
+-.\"
+-.if n .pl 99999
+-.TH serialver 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: serialver.1
++.\"
++.if n .pl 99999
++.TH serialver 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,63 +47,63 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-serialver \- Returns the serial version UID for specified classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBserialver\fR [ \fIoptions\fR ] [ \fIclassnames\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIclassnames\fR
+-The classes for which the \f3serialVersionUID\fR is to be returned\&.
+-.SH DESCRIPTION
+-The \f3serialver\fR command returns the \f3serialVersionUID\fR for one or more classes in a form suitable for copying into an evolving class\&. When called with no arguments, the \f3serialver\fR command prints a usage line\&.
+-.SH OPTIONS
+-.TP
+--classpath \fIpath-files\fR
+-.br
+-Sets the search path for application classes and resources\&. Separate classes and resources with a colon (:)\&.
+-.TP
+--show
+-.br
+-Displays a simple user interface\&. Enter the full class name and press either the \fIEnter\fR key or the \fIShow\fR button to display the \f3serialVersionUID\fR\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH NOTES
+-The \f3serialver\fR command loads and initializes the specified classes in its virtual machine, and by default, it does not set a security manager\&. If the \f3serialver\fR command is to be run with untrusted classes, then a security manager can be set with the following option:
+-.sp
+-.nf
+-\f3\-J\-Djava\&.security\&.manager\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When necessary, a security policy can be specified with the following option:
+-.sp
+-.nf
+-\f3\-J\-Djava\&.security\&.policy=<policy file>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-policytool(1)
+-.TP 0.2i
+-\(bu
+-The \f3java\&.io\&.ObjectStream\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.html
++
++.SH NAME
++serialver \- Returns the serial version UID for specified classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBserialver\fR [ \fIoptions\fR ] [ \fIclassnames\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIclassnames\fR
++The classes for which the \f3serialVersionUID\fR is to be returned\&.
++.SH DESCRIPTION
++The \f3serialver\fR command returns the \f3serialVersionUID\fR for one or more classes in a form suitable for copying into an evolving class\&. When called with no arguments, the \f3serialver\fR command prints a usage line\&.
++.SH OPTIONS
++.TP
++-classpath \fIpath-files\fR
++.br
++Sets the search path for application classes and resources\&. Separate classes and resources with a colon (:)\&.
++.TP
++-show
++.br
++Displays a simple user interface\&. Enter the full class name and press either the \fIEnter\fR key or the \fIShow\fR button to display the \f3serialVersionUID\fR\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH NOTES
++The \f3serialver\fR command loads and initializes the specified classes in its virtual machine, and by default, it does not set a security manager\&. If the \f3serialver\fR command is to be run with untrusted classes, then a security manager can be set with the following option:
++.sp
++.nf
++\f3\-J\-Djava\&.security\&.manager\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When necessary, a security policy can be specified with the following option:
++.sp
++.nf
++\f3\-J\-Djava\&.security\&.policy=<policy file>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++policytool(1)
++.TP 0.2i
++\(bu
++The \f3java\&.io\&.ObjectStream\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/servertool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/servertool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: servertool.1
+-.\"
+-.if n .pl 99999
+-.TH servertool 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: servertool.1
++.\"
++.if n .pl 99999
++.TH servertool 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-servertool \- Provides an easy-to-use interface for developers to register, unregister, start up, and shut down a persistent server\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBservertool\fR \-ORBInitialPort \fInameserverport\fR [ \fIoptions\fR ] [ \fIcommands \fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-commands
+-The command-line commands\&. See Commands\&.
+-.SH DESCRIPTION
+-The \f3servertool\fR command provides the command-line interface for developers to register, unregister, start up, and shut down a persistent server\&. Command-line commands let you obtain various statistical information about the server\&. See Commands\&.
+-.SH OPTIONS
+-.TP
+--ORBInitialHost \fInameserverhost\fR
+-.br
+-This options is required\&. It specifies the host machine on which the name server runs and listens for incoming requests\&. The \f3nameserverhost\fR value must specify the port on which the \f3orb\fR is running and listening for requests\&. The value defaults to \f3localhost\fR when this option is not specified\&. If \f3orbd\fR and \f3servertool\fR are running on different machines, then you must specify the name or IP address of the host on which \f3orbd\fR is running\&.
+-
+-\fINote:\fR On Oracle Solaris, you must become a root user to start a process on a port below 1024\&. Oracle recommends that you use a port number above or equal to 1024 for the \f3nameserverport\fR value\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH COMMANDS
+-You can start the \f3servertool\fR command with or without a command-line command\&.
+-.TP 0.2i
+-\(bu
+-If you did not specify a command when you started \f3servertool\fR, then the command-line tool displays the \f3servertool\fR prompt where you can enter commands: \f3servertool >\fR\&.
+-.TP 0.2i
+-\(bu
+-If you specify a command when you start \f3servertool\fR, then the Java IDL Server Tool starts, executes the command, and exits\&.
+-.TP
+-.ll 180
+-register -server \fIserver-class-name\fR -classpath \fIclasspath-to-server\fR [ -applicationName \fIapplication-name\fR -args \fIargs-to-server\fR -vmargs \fIflags-for-JVM\fR ]
+-Registers a new persistent server with the Object Request Broker Daemon (ORBD)\&. If the server is not already registered, then it is registered and activated\&. This command causes an installation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The installation method must be \f3public static void install(org\&.omg\&.CORBA\&.ORB)\fR\&. The install method is optional and lets developers provide their own server installation behavior, such as creating a database schema\&.
+-.TP
+-.ll 180
+-unregister -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
+-Unregisters a server from the ORBD with either its server ID or its application name\&. This command causes an uninstallation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The \f3uninstall\fR method must be \f3public static void uninstall(org\&.omg\&.CORBA\&.ORB)\fR\&. The \f3uninstall\fR method is optional and lets developers provide their own server uninstallation behavior, such as undoing the behavior of the \f3install\fR method\&.
+-.TP
+-getserverid -applicationName \fIapplication-name\fR
+-Returns the server ID that corresponds to the \f3application-name\fR value\&.
+-.TP
+-list
+-Lists information about all persistent servers registered with the ORBD\&.
+-.TP
+-listappnames
+-Lists the application names for all servers currently registered with the ORBD\&.
+-.TP
+-listactive
+-Lists information about all persistent servers that were started by the ORBD and are currently running\&.
+-.TP
+-.ll 180
+-locate -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -endpointType \fIendpointType\fR ]
+-Locates the endpoints (ports) of a specific type for all ORBs created by a registered server\&. If a server is not already running, then it is activated\&. If an \f3endpointType\fR value is not specified, then the plain/non-protected endpoint associated with each ORB in a server is returned\&.
+-.TP
+-.ll 180
+-locateperorb -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -orbid \fIORB-name\fR ]
+-Locates all the endpoints (ports) registered by a specific Object Request Broker (ORB) of registered server\&. If a server is not already running, then it is activated\&. If an \f3orbid\fR is not specified, then the default value of \f3""\fR is assigned to the \f3orbid\fR\&. If any ORBs are created with an \f3orbid\fR of empty string, then all ports registered by it are returned\&.
+-.TP
+-orblist -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
+-Lists the \f3ORBId\fR of the ORBs defined on a server\&. An \f3ORBId\fR is the string name for the ORB created by the server\&. If the server is not already running, then it is activated\&.
+-.TP
+-shutdown -serverid \fIserver-id\fR | -applicationName application-name
+-Shut down an active server that is registered with ORBD\&. During execution of this command, the \f3shutdown\fR method defined in the class specified by either the \f3-serverid\fR or \f3-applicationName\fR parameter is also called to shut down the server process\&.
+-.TP
+-startup -serverid \fIserver-id\fR | -applicationName application-name
+-Starts up or activate a server that is registered with ORBD\&. If the server is not running, then this command starts the server\&. If the server is already running, then an error message is displayed\&.
+-.TP
+-help
+-Lists all the commands available to the server through the \f3servertool\fR command\&.
+-.TP
+-quit
+-Exits the \f3servertool\fR command\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-orbd(1)
++
++.SH NAME
++servertool \- Provides an easy-to-use interface for developers to register, unregister, start up, and shut down a persistent server\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBservertool\fR \-ORBInitialPort \fInameserverport\fR [ \fIoptions\fR ] [ \fIcommands \fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++commands
++The command-line commands\&. See Commands\&.
++.SH DESCRIPTION
++The \f3servertool\fR command provides the command-line interface for developers to register, unregister, start up, and shut down a persistent server\&. Command-line commands let you obtain various statistical information about the server\&. See Commands\&.
++.SH OPTIONS
++.TP
++-ORBInitialHost \fInameserverhost\fR
++.br
++This options is required\&. It specifies the host machine on which the name server runs and listens for incoming requests\&. The \f3nameserverhost\fR value must specify the port on which the \f3orb\fR is running and listening for requests\&. The value defaults to \f3localhost\fR when this option is not specified\&. If \f3orbd\fR and \f3servertool\fR are running on different machines, then you must specify the name or IP address of the host on which \f3orbd\fR is running\&.
++
++\fINote:\fR On Oracle Solaris, you must become a root user to start a process on a port below 1024\&. Oracle recommends that you use a port number above or equal to 1024 for the \f3nameserverport\fR value\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH COMMANDS
++You can start the \f3servertool\fR command with or without a command-line command\&.
++.TP 0.2i
++\(bu
++If you did not specify a command when you started \f3servertool\fR, then the command-line tool displays the \f3servertool\fR prompt where you can enter commands: \f3servertool >\fR\&.
++.TP 0.2i
++\(bu
++If you specify a command when you start \f3servertool\fR, then the Java IDL Server Tool starts, executes the command, and exits\&.
++.TP
++.ll 180
++register -server \fIserver-class-name\fR -classpath \fIclasspath-to-server\fR [ -applicationName \fIapplication-name\fR -args \fIargs-to-server\fR -vmargs \fIflags-for-JVM\fR ]
++Registers a new persistent server with the Object Request Broker Daemon (ORBD)\&. If the server is not already registered, then it is registered and activated\&. This command causes an installation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The installation method must be \f3public static void install(org\&.omg\&.CORBA\&.ORB)\fR\&. The install method is optional and lets developers provide their own server installation behavior, such as creating a database schema\&.
++.TP
++.ll 180
++unregister -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
++Unregisters a server from the ORBD with either its server ID or its application name\&. This command causes an uninstallation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The \f3uninstall\fR method must be \f3public static void uninstall(org\&.omg\&.CORBA\&.ORB)\fR\&. The \f3uninstall\fR method is optional and lets developers provide their own server uninstallation behavior, such as undoing the behavior of the \f3install\fR method\&.
++.TP
++getserverid -applicationName \fIapplication-name\fR
++Returns the server ID that corresponds to the \f3application-name\fR value\&.
++.TP
++list
++Lists information about all persistent servers registered with the ORBD\&.
++.TP
++listappnames
++Lists the application names for all servers currently registered with the ORBD\&.
++.TP
++listactive
++Lists information about all persistent servers that were started by the ORBD and are currently running\&.
++.TP
++.ll 180
++locate -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -endpointType \fIendpointType\fR ]
++Locates the endpoints (ports) of a specific type for all ORBs created by a registered server\&. If a server is not already running, then it is activated\&. If an \f3endpointType\fR value is not specified, then the plain/non-protected endpoint associated with each ORB in a server is returned\&.
++.TP
++.ll 180
++locateperorb -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -orbid \fIORB-name\fR ]
++Locates all the endpoints (ports) registered by a specific Object Request Broker (ORB) of registered server\&. If a server is not already running, then it is activated\&. If an \f3orbid\fR is not specified, then the default value of \f3""\fR is assigned to the \f3orbid\fR\&. If any ORBs are created with an \f3orbid\fR of empty string, then all ports registered by it are returned\&.
++.TP
++orblist -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
++Lists the \f3ORBId\fR of the ORBs defined on a server\&. An \f3ORBId\fR is the string name for the ORB created by the server\&. If the server is not already running, then it is activated\&.
++.TP
++shutdown -serverid \fIserver-id\fR | -applicationName application-name
++Shut down an active server that is registered with ORBD\&. During execution of this command, the \f3shutdown\fR method defined in the class specified by either the \f3-serverid\fR or \f3-applicationName\fR parameter is also called to shut down the server process\&.
++.TP
++startup -serverid \fIserver-id\fR | -applicationName application-name
++Starts up or activate a server that is registered with ORBD\&. If the server is not running, then this command starts the server\&. If the server is already running, then an error message is displayed\&.
++.TP
++help
++Lists all the commands available to the server through the \f3servertool\fR command\&.
++.TP
++quit
++Exits the \f3servertool\fR command\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++orbd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/tnameserv.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/tnameserv.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1999, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: tnameserv.1
+-.\"
+-.if n .pl 99999
+-.TH tnameserv 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: tnameserv.1
++.\"
++.if n .pl 99999
++.TH tnameserv 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,441 +47,441 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-tnameserv \- Interface Definition Language (IDL)\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBtnameserve\fR \fB\-ORBInitialPort\fR [ \fInameserverport\fR ]
+-.fi
+-.sp
+-.TP
+--ORBInitialPort \fInameserverport\fR
+-.br
+-The initial port where the naming service listens for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references\fR methods\&.
+-.SH DESCRIPTION
+-Java IDL includes the Object Request Broker Daemon (ORBD)\&. ORBD is a daemon process that contains a Bootstrap Service, a Transient Naming Service, a Persistent Naming Service, and a Server Manager\&. The Java IDL tutorials all use ORBD, but you can substitute the \f3tnameserv\fR command for the \f3orbd\fR command in any of the examples that use a Transient Naming Service\&.
+-.PP
+-See orbd(1) or Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+-.PP
+-The CORBA Common Object Services (COS) Naming Service provides a tree-structure directory for object references similar to a file system that provides a directory structure for files\&. The Transient Naming Service provided with Java IDL, \f3tnameserv\fR, is a simple implementation of the COS Naming Service specification\&.
+-.PP
+-Object references are stored in the name space by name and each object reference-name pair is called a name binding\&. Name bindings can be organized under naming contexts\&. Naming contexts are name bindings and serve the same organizational function as a file system subdirectory\&. All bindings are stored under the initial naming context\&. The initial naming context is the only persistent binding in the name space\&. The rest of the name space is lost when the Java IDL naming service process stops and restarts\&.
+-.PP
+-For an applet or application to use COS naming, its ORB must know the port of a host running a naming service or have access to an initial naming context string for that naming service\&. The naming service can either be the Java IDL naming service or another COS-compliant naming service\&.
+-.SS START\ THE\ NAMING\ SERVICE
+-You must start the Java IDL naming service before an application or applet that uses its naming service\&. Installation of the Java IDL product creates a script (Oracle Solaris: \f3tnameserv\fR) or executable file (Windows: \f3tnameserv\&.exe\fR) that starts the Java IDL naming service\&. Start the naming service so it runs in the background\&.
+-.PP
+-If you do not specify otherwise, then the Java IDL naming service listens on port 900 for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references methods\fR, as follows:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort nameserverport&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the name server port, then port 900 is used by default\&. When running Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number greater than or equal to 1024\&. To specify a different port, for example, 1050, and to run the naming service in the background, from a UNIX command shell, enter:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort 1050&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-From an MS-DOS system prompt (Windows), enter:
+-.sp
+-.nf
+-\f3start tnameserv \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Clients of the name server must be made aware of the new port number\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR property to the new port number when you create the ORB object\&.
+-.SS RUN\ THE\ SERVER\ AND\ CLIENT\ ON\ DIFFERENT\ HOSTS
+-In most of the Java IDL and RMI-IIOP tutorials, the naming service, server, and client are all running on the development machine\&. In real-world deployment, the client and server probably run on different host machines from the Naming Service\&.
+-.PP
+-For the client and server to find the Naming Service, they must be made aware of the port number and host on which the naming service is running\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR and \f3org\&.omg\&.CORBA\&.ORBInitialHost\fR properties in the client and server files to the machine name and port number on which the Naming Service is running\&. An example of this is shown in Getting Started Using RMI-IIOP at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi-iiop/rmiiiopexample\&.html
+-.PP
+-You could also use the command-line options \f3-ORBInitialPort nameserverport#\fR and \f3-ORBInitialHost nameserverhostname\fR to tell the client and server where to find the naming service\&. For one example of doing this using the command-line option, see Java IDL: The Hello World Example on Two Machines at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.html
+-.PP
+-For example, suppose the Transient Naming Service, \f3tnameserv\fR is running on port 1050 on host \f3nameserverhost\fR\&. The client is running on host \f3clienthost,\fR and the server is running on host \f3serverhost\fR\&.
+-.PP
+-Start \f3tnameserv\fR on the host \f3nameserverhost\fR:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Start the server on the \f3serverhost\fR:
+-.sp
+-.nf
+-\f3java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Start the client on the \f3clienthost\fR:
+-.sp
+-.nf
+-\f3java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS STOP\ THE\ NAMING\ SERVICE
+-To stop the Java IDL naming service, use the relevant operating system command, such as \f3kill\fR for a Unix process or \f3Ctrl+C\fR for a Windows process\&. The naming service continues to wait for invocations until it is explicitly shut down\&. Note that names registered with the Java IDL naming service disappear when the service is terminated\&.
+-.SH OPTIONS
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH EXAMPLES
+-.SS ADD\ OBJECTS\ TO\ THE\ NAME\ SPACE
+-The following example shows how to add names to the name space\&. It is a self-contained Transient Naming Service client that creates the following simple tree\&.
+-.sp
+-.nf
+-\f3Initial Naming Context\fP
+-.fi
+-.nf
+-\f3 plans\fP
+-.fi
+-.nf
+-\f3 Personal\fP
+-.fi
+-.nf
+-\f3 calendar\fP
+-.fi
+-.nf
+-\f3 schedule\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this example, \f3plans\fR is an object reference and \f3Personal\fR is a naming context that contains two object references: \f3calendar\fR and \f3schedule\fR\&.
+-.sp
+-.nf
+-\f3import java\&.util\&.Properties;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CORBA\&.*;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CosNaming\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class NameClient {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public static void main(String args[]) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
+-.sp
+-.nf
+-\f3 Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3 ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code obtains the initial naming context and assigns it to \f3ctx\fR\&. The second line copies \f3ctx\fR into a dummy object reference \f3objref\fR that is attached to various names and added into the name space\&.
+-.sp
+-.nf
+-\f3 NamingContext ctx =\fP
+-.fi
+-.nf
+-\f3 NamingContextHelper\&.narrow(\fP
+-.fi
+-.nf
+-\f3 orb\&.resolve_initial_references("NameService"));\fP
+-.fi
+-.nf
+-\f3 NamingContext objref = ctx;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code creates a name \f3plans\fR of type \f3text\fR and binds it to the dummy object reference\&. \f3plans\fR is then added under the initial naming context using the \f3rebind\fR method\&. The \f3rebind\fR method enables you to run this program over and over again without getting the exceptions from using the \f3bind\fR method\&.
+-.sp
+-.nf
+-\f3 NameComponent nc1 = new NameComponent("plans", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name1 = {nc1};\fP
+-.fi
+-.nf
+-\f3 ctx\&.rebind(name1, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("plans rebind successful!");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code creates a naming context called \f3Personal\fR of type \f3directory\fR\&. The resulting object reference, \f3ctx2\fR, is bound to the \f3name\fR and added under the initial naming context\&.
+-.sp
+-.nf
+-\f3 NameComponent nc2 = new NameComponent("Personal", "directory");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name2 = {nc2};\fP
+-.fi
+-.nf
+-\f3 NamingContext ctx2 = ctx\&.bind_new_context(name2);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("new naming context added\&.\&.");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The remainder of the code binds the dummy object reference using the names \f3schedule\fR and \f3calendar\fR under the \f3Personal\fR naming context (\f3ctx2\fR)\&.
+-.sp
+-.nf
+-\f3 NameComponent nc3 = new NameComponent("schedule", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name3 = {nc3};\fP
+-.fi
+-.nf
+-\f3 ctx2\&.rebind(name3, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("schedule rebind successful!");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 NameComponent nc4 = new NameComponent("calender", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name4 = {nc4};\fP
+-.fi
+-.nf
+-\f3 ctx2\&.rebind(name4, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("calender rebind successful!");\fP
+-.fi
+-.nf
+-\f3 } catch (Exception e) {\fP
+-.fi
+-.nf
+-\f3 e\&.printStackTrace(System\&.err);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS BROWSING\ THE\ NAME\ SPACE
+-The following sample program shoes how to browse the name space\&.
+-.sp
+-.nf
+-\f3import java\&.util\&.Properties;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CORBA\&.*;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CosNaming\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class NameClientList {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public static void main(String args[]) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
+-.sp
+-.nf
+-\f3 Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3 ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following code obtains the initial naming context\&.
+-.sp
+-.nf
+-\f3 NamingContext nc =\fP
+-.fi
+-.nf
+-\f3 NamingContextHelper\&.narrow(\fP
+-.fi
+-.nf
+-\f3 orb\&.resolve_initial_references("NameService"));\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3list\fR method lists the bindings in the naming context\&. In this case, up to 1000 bindings from the initial naming context will be returned in the \f3BindingListHolder\fR; any remaining bindings are returned in the \f3BindingIteratorHolder\fR\&.
+-.sp
+-.nf
+-\f3 BindingListHolder bl = new BindingListHolder();\fP
+-.fi
+-.nf
+-\f3 BindingIteratorHolder blIt= new BindingIteratorHolder();\fP
+-.fi
+-.nf
+-\f3 nc\&.list(1000, bl, blIt);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code gets the array of bindings out of the returned \f3BindingListHolder\fR\&. If there are no bindings, then the program ends\&.
+-.sp
+-.nf
+-\f3 Binding bindings[] = bl\&.value;\fP
+-.fi
+-.nf
+-\f3 if (bindings\&.length == 0) return;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The remainder of the code loops through the bindings and prints outs the names\&.
+-.sp
+-.nf
+-\f3 for (int i=0; i < bindings\&.length; i++) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 // get the object reference for each binding\fP
+-.fi
+-.nf
+-\f3 org\&.omg\&.CORBA\&.Object obj = nc\&.resolve(bindings[i]\&.binding_name);\fP
+-.fi
+-.nf
+-\f3 String objStr = orb\&.object_to_string(obj);\fP
+-.fi
+-.nf
+-\f3 int lastIx = bindings[i]\&.binding_name\&.length\-1;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 // check to see if this is a naming context\fP
+-.fi
+-.nf
+-\f3 if (bindings[i]\&.binding_type == BindingType\&.ncontext) {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Context: " +\fP
+-.fi
+-.nf
+-\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
+-.fi
+-.nf
+-\f3 } else {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Object: " +\fP
+-.fi
+-.nf
+-\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 } catch (Exception e) {\fP
+-.fi
+-.nf
+-\f3 e\&.printStackTrace(System\&.err)\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-orbd(1)
++
++.SH NAME
++tnameserv \- Interface Definition Language (IDL)\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBtnameserve\fR \fB\-ORBInitialPort\fR [ \fInameserverport\fR ]
++.fi
++.sp
++.TP
++-ORBInitialPort \fInameserverport\fR
++.br
++The initial port where the naming service listens for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references\fR methods\&.
++.SH DESCRIPTION
++Java IDL includes the Object Request Broker Daemon (ORBD)\&. ORBD is a daemon process that contains a Bootstrap Service, a Transient Naming Service, a Persistent Naming Service, and a Server Manager\&. The Java IDL tutorials all use ORBD, but you can substitute the \f3tnameserv\fR command for the \f3orbd\fR command in any of the examples that use a Transient Naming Service\&.
++.PP
++See orbd(1) or Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++.PP
++The CORBA Common Object Services (COS) Naming Service provides a tree-structure directory for object references similar to a file system that provides a directory structure for files\&. The Transient Naming Service provided with Java IDL, \f3tnameserv\fR, is a simple implementation of the COS Naming Service specification\&.
++.PP
++Object references are stored in the name space by name and each object reference-name pair is called a name binding\&. Name bindings can be organized under naming contexts\&. Naming contexts are name bindings and serve the same organizational function as a file system subdirectory\&. All bindings are stored under the initial naming context\&. The initial naming context is the only persistent binding in the name space\&. The rest of the name space is lost when the Java IDL naming service process stops and restarts\&.
++.PP
++For an applet or application to use COS naming, its ORB must know the port of a host running a naming service or have access to an initial naming context string for that naming service\&. The naming service can either be the Java IDL naming service or another COS-compliant naming service\&.
++.SS START\ THE\ NAMING\ SERVICE
++You must start the Java IDL naming service before an application or applet that uses its naming service\&. Installation of the Java IDL product creates a script (Oracle Solaris: \f3tnameserv\fR) or executable file (Windows: \f3tnameserv\&.exe\fR) that starts the Java IDL naming service\&. Start the naming service so it runs in the background\&.
++.PP
++If you do not specify otherwise, then the Java IDL naming service listens on port 900 for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references methods\fR, as follows:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort nameserverport&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the name server port, then port 900 is used by default\&. When running Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number greater than or equal to 1024\&. To specify a different port, for example, 1050, and to run the naming service in the background, from a UNIX command shell, enter:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort 1050&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++From an MS-DOS system prompt (Windows), enter:
++.sp
++.nf
++\f3start tnameserv \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Clients of the name server must be made aware of the new port number\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR property to the new port number when you create the ORB object\&.
++.SS RUN\ THE\ SERVER\ AND\ CLIENT\ ON\ DIFFERENT\ HOSTS
++In most of the Java IDL and RMI-IIOP tutorials, the naming service, server, and client are all running on the development machine\&. In real-world deployment, the client and server probably run on different host machines from the Naming Service\&.
++.PP
++For the client and server to find the Naming Service, they must be made aware of the port number and host on which the naming service is running\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR and \f3org\&.omg\&.CORBA\&.ORBInitialHost\fR properties in the client and server files to the machine name and port number on which the Naming Service is running\&. An example of this is shown in Getting Started Using RMI-IIOP at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi-iiop/rmiiiopexample\&.html
++.PP
++You could also use the command-line options \f3-ORBInitialPort nameserverport#\fR and \f3-ORBInitialHost nameserverhostname\fR to tell the client and server where to find the naming service\&. For one example of doing this using the command-line option, see Java IDL: The Hello World Example on Two Machines at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.html
++.PP
++For example, suppose the Transient Naming Service, \f3tnameserv\fR is running on port 1050 on host \f3nameserverhost\fR\&. The client is running on host \f3clienthost,\fR and the server is running on host \f3serverhost\fR\&.
++.PP
++Start \f3tnameserv\fR on the host \f3nameserverhost\fR:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Start the server on the \f3serverhost\fR:
++.sp
++.nf
++\f3java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Start the client on the \f3clienthost\fR:
++.sp
++.nf
++\f3java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS STOP\ THE\ NAMING\ SERVICE
++To stop the Java IDL naming service, use the relevant operating system command, such as \f3kill\fR for a Unix process or \f3Ctrl+C\fR for a Windows process\&. The naming service continues to wait for invocations until it is explicitly shut down\&. Note that names registered with the Java IDL naming service disappear when the service is terminated\&.
++.SH OPTIONS
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH EXAMPLES
++.SS ADD\ OBJECTS\ TO\ THE\ NAME\ SPACE
++The following example shows how to add names to the name space\&. It is a self-contained Transient Naming Service client that creates the following simple tree\&.
++.sp
++.nf
++\f3Initial Naming Context\fP
++.fi
++.nf
++\f3 plans\fP
++.fi
++.nf
++\f3 Personal\fP
++.fi
++.nf
++\f3 calendar\fP
++.fi
++.nf
++\f3 schedule\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this example, \f3plans\fR is an object reference and \f3Personal\fR is a naming context that contains two object references: \f3calendar\fR and \f3schedule\fR\&.
++.sp
++.nf
++\f3import java\&.util\&.Properties;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CORBA\&.*;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CosNaming\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class NameClient {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public static void main(String args[]) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
++.sp
++.nf
++\f3 Properties props = new Properties();\fP
++.fi
++.nf
++\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3 ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code obtains the initial naming context and assigns it to \f3ctx\fR\&. The second line copies \f3ctx\fR into a dummy object reference \f3objref\fR that is attached to various names and added into the name space\&.
++.sp
++.nf
++\f3 NamingContext ctx =\fP
++.fi
++.nf
++\f3 NamingContextHelper\&.narrow(\fP
++.fi
++.nf
++\f3 orb\&.resolve_initial_references("NameService"));\fP
++.fi
++.nf
++\f3 NamingContext objref = ctx;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code creates a name \f3plans\fR of type \f3text\fR and binds it to the dummy object reference\&. \f3plans\fR is then added under the initial naming context using the \f3rebind\fR method\&. The \f3rebind\fR method enables you to run this program over and over again without getting the exceptions from using the \f3bind\fR method\&.
++.sp
++.nf
++\f3 NameComponent nc1 = new NameComponent("plans", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name1 = {nc1};\fP
++.fi
++.nf
++\f3 ctx\&.rebind(name1, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("plans rebind successful!");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code creates a naming context called \f3Personal\fR of type \f3directory\fR\&. The resulting object reference, \f3ctx2\fR, is bound to the \f3name\fR and added under the initial naming context\&.
++.sp
++.nf
++\f3 NameComponent nc2 = new NameComponent("Personal", "directory");\fP
++.fi
++.nf
++\f3 NameComponent[] name2 = {nc2};\fP
++.fi
++.nf
++\f3 NamingContext ctx2 = ctx\&.bind_new_context(name2);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("new naming context added\&.\&.");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The remainder of the code binds the dummy object reference using the names \f3schedule\fR and \f3calendar\fR under the \f3Personal\fR naming context (\f3ctx2\fR)\&.
++.sp
++.nf
++\f3 NameComponent nc3 = new NameComponent("schedule", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name3 = {nc3};\fP
++.fi
++.nf
++\f3 ctx2\&.rebind(name3, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("schedule rebind successful!");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 NameComponent nc4 = new NameComponent("calender", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name4 = {nc4};\fP
++.fi
++.nf
++\f3 ctx2\&.rebind(name4, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("calender rebind successful!");\fP
++.fi
++.nf
++\f3 } catch (Exception e) {\fP
++.fi
++.nf
++\f3 e\&.printStackTrace(System\&.err);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS BROWSING\ THE\ NAME\ SPACE
++The following sample program shoes how to browse the name space\&.
++.sp
++.nf
++\f3import java\&.util\&.Properties;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CORBA\&.*;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CosNaming\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class NameClientList {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public static void main(String args[]) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
++.sp
++.nf
++\f3 Properties props = new Properties();\fP
++.fi
++.nf
++\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3 ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following code obtains the initial naming context\&.
++.sp
++.nf
++\f3 NamingContext nc =\fP
++.fi
++.nf
++\f3 NamingContextHelper\&.narrow(\fP
++.fi
++.nf
++\f3 orb\&.resolve_initial_references("NameService"));\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3list\fR method lists the bindings in the naming context\&. In this case, up to 1000 bindings from the initial naming context will be returned in the \f3BindingListHolder\fR; any remaining bindings are returned in the \f3BindingIteratorHolder\fR\&.
++.sp
++.nf
++\f3 BindingListHolder bl = new BindingListHolder();\fP
++.fi
++.nf
++\f3 BindingIteratorHolder blIt= new BindingIteratorHolder();\fP
++.fi
++.nf
++\f3 nc\&.list(1000, bl, blIt);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code gets the array of bindings out of the returned \f3BindingListHolder\fR\&. If there are no bindings, then the program ends\&.
++.sp
++.nf
++\f3 Binding bindings[] = bl\&.value;\fP
++.fi
++.nf
++\f3 if (bindings\&.length == 0) return;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The remainder of the code loops through the bindings and prints outs the names\&.
++.sp
++.nf
++\f3 for (int i=0; i < bindings\&.length; i++) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 // get the object reference for each binding\fP
++.fi
++.nf
++\f3 org\&.omg\&.CORBA\&.Object obj = nc\&.resolve(bindings[i]\&.binding_name);\fP
++.fi
++.nf
++\f3 String objStr = orb\&.object_to_string(obj);\fP
++.fi
++.nf
++\f3 int lastIx = bindings[i]\&.binding_name\&.length\-1;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 // check to see if this is a naming context\fP
++.fi
++.nf
++\f3 if (bindings[i]\&.binding_type == BindingType\&.ncontext) {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Context: " +\fP
++.fi
++.nf
++\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
++.fi
++.nf
++\f3 } else {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Object: " +\fP
++.fi
++.nf
++\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 } catch (Exception e) {\fP
++.fi
++.nf
++\f3 e\&.printStackTrace(System\&.err)\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++orbd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/unpack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/unpack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Deployment Tools
+-.\" Title: unpack200.1
+-.\"
+-.if n .pl 99999
+-.TH unpack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Deployment Tools
++.\" Title: unpack200.1
++.\"
++.if n .pl 99999
++.TH unpack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-unpack200 \- Transforms a packed file produced by pack200(1) into a JAR file for web deployment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBunpack200\fR [ \fIoptions\fR ] input\-file \fIJAR\-file\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIinput-file\fR
+-Name of the input file, which can be a pack200 gzip file or a pack200 file\&. The input can also be JAR file produced by \f3pack200\fR(1) with an effort of \f30\fR, in which case the contents of the input file are copied to the output JAR file with the Pack200 marker\&.
+-.TP
+-\fIJAR-file\fR
+-Name of the output JAR file\&.
+-.SH DESCRIPTION
+-The \f3unpack200\fR command is a native implementation that transforms a packed file produced by \f3pack200\fR\f3(1)\fR into a JAR file\&. A typical usage follows\&. In the following example, the \f3myarchive\&.jar\fR file is produced from \f3myarchive\&.pack\&.gz\fR with the default \f3unpack200\fR command settings\&.
+-.sp
+-.nf
+-\f3unpack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--Hvalue --deflate-hint=\fIvalue\fR
+-.br
+-Sets the deflation to be \f3true\fR, \f3false\fR, or \f3keep\fR on all entries within a JAR file\&. The default mode is \f3keep\fR\&. If the value is \f3true\fR or \f3false\fR, then the \f3--deflate=hint\fR option overrides the default behavior and sets the deflation mode on all entries within the output JAR file\&.
+-.TP
+--r --remove-pack-file
+-.br
+-Removes the input pack file\&.
+-.TP
+--v --verbose
+-.br
+-Displays minimal messages\&. Multiple specifications of this option displays more verbose messages\&.
+-.TP
+--q --quiet
+-.br
+-Specifies quiet operation with no messages\&.
+-.TP
+--lfilename --log-file=\fIfilename\fR
+-.br
+-Specifies a log file where output messages are logged\&.
+-.TP
+--? -h --help
+-.br
+-Prints help information about the \f3unpack200\fR command\&.
+-.TP
+--V --version
+-.br
+-Prints version information about the \f3unpack200\fR command\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes option to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH NOTES
+-This command should not be confused with the \f3unpack\fR command\&. They are distinctly separate products\&.
+-.PP
+-The Java SE API Specification provided with the JDK is the superseding authority in case of discrepancies\&.
+-.SH EXIT\ STATUS
+-The following exit values are returned: 0 for successful completion, and a value that is greater than 0 when an error occurred\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pack200(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
+-.TP 0.2i
+-\(bu
+-Pack200 and Compression at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment-guide/pack200\&.html
+-.TP 0.2i
+-\(bu
+-The Java SE Technical Documentation page at http://docs\&.oracle\&.com/javase/
++
++.SH NAME
++unpack200 \- Transforms a packed file produced by pack200(1) into a JAR file for web deployment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBunpack200\fR [ \fIoptions\fR ] input\-file \fIJAR\-file\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIinput-file\fR
++Name of the input file, which can be a pack200 gzip file or a pack200 file\&. The input can also be JAR file produced by \f3pack200\fR(1) with an effort of \f30\fR, in which case the contents of the input file are copied to the output JAR file with the Pack200 marker\&.
++.TP
++\fIJAR-file\fR
++Name of the output JAR file\&.
++.SH DESCRIPTION
++The \f3unpack200\fR command is a native implementation that transforms a packed file produced by \f3pack200\fR\f3(1)\fR into a JAR file\&. A typical usage follows\&. In the following example, the \f3myarchive\&.jar\fR file is produced from \f3myarchive\&.pack\&.gz\fR with the default \f3unpack200\fR command settings\&.
++.sp
++.nf
++\f3unpack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-Hvalue --deflate-hint=\fIvalue\fR
++.br
++Sets the deflation to be \f3true\fR, \f3false\fR, or \f3keep\fR on all entries within a JAR file\&. The default mode is \f3keep\fR\&. If the value is \f3true\fR or \f3false\fR, then the \f3--deflate=hint\fR option overrides the default behavior and sets the deflation mode on all entries within the output JAR file\&.
++.TP
++-r --remove-pack-file
++.br
++Removes the input pack file\&.
++.TP
++-v --verbose
++.br
++Displays minimal messages\&. Multiple specifications of this option displays more verbose messages\&.
++.TP
++-q --quiet
++.br
++Specifies quiet operation with no messages\&.
++.TP
++-lfilename --log-file=\fIfilename\fR
++.br
++Specifies a log file where output messages are logged\&.
++.TP
++-? -h --help
++.br
++Prints help information about the \f3unpack200\fR command\&.
++.TP
++-V --version
++.br
++Prints version information about the \f3unpack200\fR command\&.
++.TP
++-J\fIoption\fR
++.br
++Passes option to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH NOTES
++This command should not be confused with the \f3unpack\fR command\&. They are distinctly separate products\&.
++.PP
++The Java SE API Specification provided with the JDK is the superseding authority in case of discrepancies\&.
++.SH EXIT\ STATUS
++The following exit values are returned: 0 for successful completion, and a value that is greater than 0 when an error occurred\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pack200(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
++.TP 0.2i
++\(bu
++Pack200 and Compression at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment-guide/pack200\&.html
++.TP 0.2i
++\(bu
++The Java SE Technical Documentation page at http://docs\&.oracle\&.com/javase/
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/wsgen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/wsgen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: wsgen.1
+-.\"
+-.if n .pl 99999
+-.TH wsgen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: wsgen.1
++.\"
++.if n .pl 99999
++.TH wsgen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,128 +47,128 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-wsgen \- Reads a web service endpoint implementation (SEI) class and generates all of the required artifacts for web service deployment, and invocation\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBwsgen\fR [ \fIoptions\fR ] \fISEI\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fISEI\fR
+-The web service endpoint implementation class (SEI) to be read\&.
+-.SH DESCRIPTION
+-The \f3wsgen\fR command generates JAX-WS portable artifacts used in JAX-WS web services\&. The tool reads a web service endpoint class and generates all the required artifacts for web service deployment and invocation\&. JAXWS 2\&.1\&.1 RI also provides a \f3wsgen\fR Ant task, see the \fITools\fR tab of the JAX-WS (wsgen) page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
+-.PP
+-To start the \f3wsgen\fR command, do the following:
+-.sp
+-.nf
+-\f3export JAXWS_HOME=/pathto/jaxws\-ri\fP
+-.fi
+-.nf
+-\f3$JAXWS_HOME/bin/wsgen\&.sh \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--classpath \fIpath\fR
+-.br
+-The location of the input class files\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-The location of the input class files\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-The location for where to place generated output files\&.
+-.TP
+--extension
+-.br
+-Allow vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
+-.TP
+--help
+-.br
+-Displays a help message about the \f3wsgen\fR command\&.
+-.TP
+--keep
+-.br
+-Keeps the generated files\&.
+-.TP
+--r \fIdirectory\fR
+-.br
+-Uses this option with the \f3-wsdl\fR option to specify where to place generated resource files such as WSDLs\&.
+-.TP
+--s \fIdirectory\fR
+-.br
+-The location for where to place generated source files\&.
+-.TP
+--verbose
+-.br
+-Displays compiler messages\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--wsdl [ :protocol ] \fI\fR
+-.br
+-An optional command that generates a WSDL file to review before endpoint deployment\&. The WSDL files contains a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns\&.
+-
+-By default the \f3wsgen\fR command does not generate a WSDL file\&. The \f3protocol\fR value is optional and is used to specify what protocol should be used for the WSDL binding (\f3wsdl:binding\fR)\&. Valid protocols are \f3soap1\&.1\fR and \f3Xsoap1\&.2\fR\&. The default is \f3soap1\&.1\fR\&. The \f3Xsoap1\&.2\fR protocol is not standard and can only be used with the \f3-extension\fR option\&.
+-.TP
+--servicename \fIname\fR
+-.br
+-Used only with the \f3-wsdl\fR option to specify a particular WSDL service (\f3wsdl:service\fR) name to be generated in the WSDL, for example: \f3-servicename "{http://mynamespace/}MyService"\fR\&.
+-.TP
+--portname \fIname\fR
+-.br
+-Used only with the \f3-wsdl\fR option to specify a particular WSDL port (\f3wsdl:port\fR) name to be generated in the WSDL, for example: \f3-portname "{http://mynamespace/}MyPort"\fR\&.
+-.SH EXAMPLES
+-The following example generates the wrapper classes for \f3StockService\fR with \f3@WebService\fR annotations inside stock directory\&.
+-.sp
+-.nf
+-\f3wsgen \-d stock \-cp myclasspath stock\&.StockService\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example generates a SOAP 1\&.1 WSDL and schema for the \f3stock\&.StockService\fR class with \f3@WebService\fR annotations\&.
+-.sp
+-.nf
+-\f3wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example generates a SOAP 1\&.2 WSDL\&.
+-.sp
+-.nf
+-\f3wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fINote:\fR You do not have to generate WSDL at development time because the JAXWS run time environment generates a WSDL for you when you deploy your service\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-wsimport(1)
+-.TP 0.2i
+-\(bu
+-\fIThe Tools\fR tab of the JAX-WS (wsgen) page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
++
++.SH NAME
++wsgen \- Reads a web service endpoint implementation (SEI) class and generates all of the required artifacts for web service deployment, and invocation\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBwsgen\fR [ \fIoptions\fR ] \fISEI\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fISEI\fR
++The web service endpoint implementation class (SEI) to be read\&.
++.SH DESCRIPTION
++The \f3wsgen\fR command generates JAX-WS portable artifacts used in JAX-WS web services\&. The tool reads a web service endpoint class and generates all the required artifacts for web service deployment and invocation\&. JAXWS 2\&.1\&.1 RI also provides a \f3wsgen\fR Ant task, see the \fITools\fR tab of the JAX-WS (wsgen) page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
++.PP
++To start the \f3wsgen\fR command, do the following:
++.sp
++.nf
++\f3export JAXWS_HOME=/pathto/jaxws\-ri\fP
++.fi
++.nf
++\f3$JAXWS_HOME/bin/wsgen\&.sh \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-classpath \fIpath\fR
++.br
++The location of the input class files\&.
++.TP
++-cp \fIpath\fR
++.br
++The location of the input class files\&.
++.TP
++-d \fIdirectory\fR
++.br
++The location for where to place generated output files\&.
++.TP
++-extension
++.br
++Allow vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
++.TP
++-help
++.br
++Displays a help message about the \f3wsgen\fR command\&.
++.TP
++-keep
++.br
++Keeps the generated files\&.
++.TP
++-r \fIdirectory\fR
++.br
++Uses this option with the \f3-wsdl\fR option to specify where to place generated resource files such as WSDLs\&.
++.TP
++-s \fIdirectory\fR
++.br
++The location for where to place generated source files\&.
++.TP
++-verbose
++.br
++Displays compiler messages\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-wsdl [ :protocol ] \fI\fR
++.br
++An optional command that generates a WSDL file to review before endpoint deployment\&. The WSDL files contains a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns\&.
++
++By default the \f3wsgen\fR command does not generate a WSDL file\&. The \f3protocol\fR value is optional and is used to specify what protocol should be used for the WSDL binding (\f3wsdl:binding\fR)\&. Valid protocols are \f3soap1\&.1\fR and \f3Xsoap1\&.2\fR\&. The default is \f3soap1\&.1\fR\&. The \f3Xsoap1\&.2\fR protocol is not standard and can only be used with the \f3-extension\fR option\&.
++.TP
++-servicename \fIname\fR
++.br
++Used only with the \f3-wsdl\fR option to specify a particular WSDL service (\f3wsdl:service\fR) name to be generated in the WSDL, for example: \f3-servicename "{http://mynamespace/}MyService"\fR\&.
++.TP
++-portname \fIname\fR
++.br
++Used only with the \f3-wsdl\fR option to specify a particular WSDL port (\f3wsdl:port\fR) name to be generated in the WSDL, for example: \f3-portname "{http://mynamespace/}MyPort"\fR\&.
++.SH EXAMPLES
++The following example generates the wrapper classes for \f3StockService\fR with \f3@WebService\fR annotations inside stock directory\&.
++.sp
++.nf
++\f3wsgen \-d stock \-cp myclasspath stock\&.StockService\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example generates a SOAP 1\&.1 WSDL and schema for the \f3stock\&.StockService\fR class with \f3@WebService\fR annotations\&.
++.sp
++.nf
++\f3wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example generates a SOAP 1\&.2 WSDL\&.
++.sp
++.nf
++\f3wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fINote:\fR You do not have to generate WSDL at development time because the JAXWS run time environment generates a WSDL for you when you deploy your service\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++wsimport(1)
++.TP 0.2i
++\(bu
++\fIThe Tools\fR tab of the JAX-WS (wsgen) page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/wsimport.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/wsimport.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: wsimport.1
+-.\"
+-.if n .pl 99999
+-.TH wsimport 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: wsimport.1
++.\"
++.if n .pl 99999
++.TH wsimport 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,169 +47,169 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-wsimport \- Generates JAX-WS portable artifacts that can be packaged in a web application archive (WAR) file and provides an Ant task\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBwsimport\fR [ \fIoptions\fR ] \fIwsdl\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIwsdl\fR
+-The file that contains the machine-readable description of how the web service can be called, what parameters it expects, and what data structures it returns\&.
+-.SH DESCRIPTION
+-The \f3wsimport\fR command generates the following JAX-WS portable artifacts\&. These artifacts can be packaged in a WAR file with the WSDL and schema documents and the endpoint implementation to be deployed\&. The \f3wsimport\fR command also provides a \f3wsimport\fR Ant task, see the Tools tab of the Wsimport Ant Task page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP 0.2i
+-\(bu
+-Service Endpoint Interface (SEI)
+-.TP 0.2i
+-\(bu
+-Service
+-.TP 0.2i
+-\(bu
+-Exception class is mapped from \f3wsdl:fault\fR (if any)
+-.TP 0.2i
+-\(bu
+-Async Response Bean is derived from response \f3wsdl:message\fR (if any)
+-.TP 0.2i
+-\(bu
+-JAXB generated value types (mapped java classes from schema types)
+-.PP
+-To start the \f3wsgen\fR command, do the following:
+-.PP
+-\fIOracle Solaris/Linux\fR:
+-.sp
+-.nf
+-\f3/bin/wsimport\&.sh \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fIWindows\fR:
+-.sp
+-.nf
+-\f3\ebin\ewsimport\&.bat \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies where to place generated output files\&.
+-.TP
+--b \fIpath\fR
+-.br
+-Specifies external JAX-WS or JAXB binding files\&. Multiple JAX-WS and JAXB binding files can be specified with the \f3-b\fR option\&. You can use these files to customize package names, bean names, and so on\&. For more information about JAX-WS and JAXB binding files, see the \fIUsers Guide\fR tab of WSDL Customization at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP
+--B \fIjaxbOption\fR
+-.br
+-Passes the \f3jaxbOption\fR option to the JAXB schema compiler\&.
+-.TP
+--catalog
+-.br
+-Specifies a catalog file to resolve external entity references\&. The \f3-catalog\fR option supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See the \fIUsers Guide\fR tab of the Catalog Support page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
+-.TP
+--extension
+-.br
+-Allows vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
+-.TP
+--help
+-.br
+-Displays a help message for the \f3wsimport\fR command\&.
+-.TP
+--httpproxy: \fIhost\fR:\fIport\fR
+-.br
+-Specifies an HTTP proxy server\&. The default is 8080\&.
+-.TP
+--keep
+-.br
+-Keeps generated files\&.
+-.TP
+--p \fIname\fR
+-.br
+-Specifies a target package \fIname\fR to override the WSDL and schema binding customizations, and the default algorithm defined in the specification\&.
+-.TP
+--s \fIdirectory\fR
+-.br
+-Specifies where to place generated source files\&.
+-.TP
+--verbose
+-.br
+-Displays compiler messages\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--wsdllocation \fIlocation\fR
+-.br
+-Specifies the \f3@WebServiceClient\&.wsdlLocation\fR value\&.
+-.TP
+--target
+-.br
+-Generates code according to the specified JAX-WS specification version\&. Version 2\&.0 generates compliant code for the JAX-WS 2\&.0 specification\&.
+-.TP
+--quiet
+-.br
+-Suppresses the \f3wsimport\fR command output\&.
+-.PP
+-Multiple \f3JAX-WS\fR and \f3JAXB\fR binding files can be specified using the \f3-b\fR option, and they can be used to customize various things such as package names and bean names\&. More information about \f3JAX-WS\fR and \f3JAXB\fR binding files can be found in the customization documentation at https://jax-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.html
+-.SH NONSTANDARD\ OPTIONS
+-.TP
+--XadditionalHeaders
+-.br
+-Maps headers not bound to a request or response message to Java method parameters\&.
+-.TP
+--Xauthfile \fIfile\fR
+-.br
+-The WSDL URI that specifies the file that contains authorization information\&. This URI is in the following format:
+-
+-http://\fIuser-name\fR:\f3password\fR@\fIhost-name\fR/\fIweb-service-name\fR>?wsdl\&.
+-.TP
+--Xdebug
+-.br
+-Prints debugging information\&.
+-.TP
+--Xno-addressing-databinding
+-.br
+-Enables binding of W3C EndpointReferenceType to Java\&.
+-.TP
+--Xnocompile
+-.br
+-Does not compile the generated Java files\&.
+-.SH EXAMPLE
+-The following example generates the Java artifacts and compiles the artifacts by importing \f3http://stockquote\&.example\&.com/quote?wsdl\fR
+-.sp
+-.nf
+-\f3wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-wsgen(1)
+-.TP 0.2i
+-\(bu
+-The Tools tab of Wsimport Ant Task page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP 0.2i
+-\(bu
+-The \fIUsers Guide\fR tab of Catalog Support page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
+-.TP 0.2i
+-\(bu
+-The \fIUsers Guide\fR tab of WSDL Customization page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++
++.SH NAME
++wsimport \- Generates JAX-WS portable artifacts that can be packaged in a web application archive (WAR) file and provides an Ant task\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBwsimport\fR [ \fIoptions\fR ] \fIwsdl\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIwsdl\fR
++The file that contains the machine-readable description of how the web service can be called, what parameters it expects, and what data structures it returns\&.
++.SH DESCRIPTION
++The \f3wsimport\fR command generates the following JAX-WS portable artifacts\&. These artifacts can be packaged in a WAR file with the WSDL and schema documents and the endpoint implementation to be deployed\&. The \f3wsimport\fR command also provides a \f3wsimport\fR Ant task, see the Tools tab of the Wsimport Ant Task page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP 0.2i
++\(bu
++Service Endpoint Interface (SEI)
++.TP 0.2i
++\(bu
++Service
++.TP 0.2i
++\(bu
++Exception class is mapped from \f3wsdl:fault\fR (if any)
++.TP 0.2i
++\(bu
++Async Response Bean is derived from response \f3wsdl:message\fR (if any)
++.TP 0.2i
++\(bu
++JAXB generated value types (mapped java classes from schema types)
++.PP
++To start the \f3wsgen\fR command, do the following:
++.PP
++\fIOracle Solaris/Linux\fR:
++.sp
++.nf
++\f3/bin/wsimport\&.sh \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fIWindows\fR:
++.sp
++.nf
++\f3\ebin\ewsimport\&.bat \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-d \fIdirectory\fR
++.br
++Specifies where to place generated output files\&.
++.TP
++-b \fIpath\fR
++.br
++Specifies external JAX-WS or JAXB binding files\&. Multiple JAX-WS and JAXB binding files can be specified with the \f3-b\fR option\&. You can use these files to customize package names, bean names, and so on\&. For more information about JAX-WS and JAXB binding files, see the \fIUsers Guide\fR tab of WSDL Customization at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP
++-B \fIjaxbOption\fR
++.br
++Passes the \f3jaxbOption\fR option to the JAXB schema compiler\&.
++.TP
++-catalog
++.br
++Specifies a catalog file to resolve external entity references\&. The \f3-catalog\fR option supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See the \fIUsers Guide\fR tab of the Catalog Support page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
++.TP
++-extension
++.br
++Allows vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
++.TP
++-help
++.br
++Displays a help message for the \f3wsimport\fR command\&.
++.TP
++-httpproxy: \fIhost\fR:\fIport\fR
++.br
++Specifies an HTTP proxy server\&. The default is 8080\&.
++.TP
++-keep
++.br
++Keeps generated files\&.
++.TP
++-p \fIname\fR
++.br
++Specifies a target package \fIname\fR to override the WSDL and schema binding customizations, and the default algorithm defined in the specification\&.
++.TP
++-s \fIdirectory\fR
++.br
++Specifies where to place generated source files\&.
++.TP
++-verbose
++.br
++Displays compiler messages\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-wsdllocation \fIlocation\fR
++.br
++Specifies the \f3@WebServiceClient\&.wsdlLocation\fR value\&.
++.TP
++-target
++.br
++Generates code according to the specified JAX-WS specification version\&. Version 2\&.0 generates compliant code for the JAX-WS 2\&.0 specification\&.
++.TP
++-quiet
++.br
++Suppresses the \f3wsimport\fR command output\&.
++.PP
++Multiple \f3JAX-WS\fR and \f3JAXB\fR binding files can be specified using the \f3-b\fR option, and they can be used to customize various things such as package names and bean names\&. More information about \f3JAX-WS\fR and \f3JAXB\fR binding files can be found in the customization documentation at https://jax-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.html
++.SH NONSTANDARD\ OPTIONS
++.TP
++-XadditionalHeaders
++.br
++Maps headers not bound to a request or response message to Java method parameters\&.
++.TP
++-Xauthfile \fIfile\fR
++.br
++The WSDL URI that specifies the file that contains authorization information\&. This URI is in the following format:
++
++http://\fIuser-name\fR:\f3password\fR@\fIhost-name\fR/\fIweb-service-name\fR>?wsdl\&.
++.TP
++-Xdebug
++.br
++Prints debugging information\&.
++.TP
++-Xno-addressing-databinding
++.br
++Enables binding of W3C EndpointReferenceType to Java\&.
++.TP
++-Xnocompile
++.br
++Does not compile the generated Java files\&.
++.SH EXAMPLE
++The following example generates the Java artifacts and compiles the artifacts by importing \f3http://stockquote\&.example\&.com/quote?wsdl\fR
++.sp
++.nf
++\f3wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++wsgen(1)
++.TP 0.2i
++\(bu
++The Tools tab of Wsimport Ant Task page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP 0.2i
++\(bu
++The \fIUsers Guide\fR tab of Catalog Support page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
++.TP 0.2i
++\(bu
++The \fIUsers Guide\fR tab of WSDL Customization page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/linux/doc/man/xjc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/linux/doc/man/xjc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: xjc.1
+-.\"
+-.if n .pl 99999
+-.TH xjc 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: xjc.1
++.\"
++.if n .pl 99999
++.TH xjc 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,185 +47,185 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-xjc \- Compiles an XML schema file into fully annotated Java classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBxjc\fR [ \fIoptions\fR ] \fBschema\fR \fIfile/URL/dir/jar\fR \&.\&.\&. [\fB\-b\fR \fIbindinfo\fR ] \&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-schema \fIfile/URL/dir/jar \&.\&.\&.\fR
+-The location of the XML schema file\&. If \f3dir\fR is specified, then all schema files in it are compiled\&. If \f3jar\fR is specified, then the \f3/META-INF/sun-jaxb\&.episode\fR binding file is compiled\&.
+-.TP
+--b \fIbindinfo\fR
+-.br
+-The location of the bindings files\&.
+-.SH DESCRIPTION
+-Start the binding compiler with the appropriate \f3xjc\fR shell script in the bin directory for your platform\&. There is also an Ant task to run the binding complier\&. See Using the XJC with Ant at http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html
+-.SH OPTIONS
+-.TP 0.2i
+-\(bu
+-See also Nonstandard Options
+-.TP 0.2i
+-\(bu
+-See also Deprecated and Removed Options
+-.TP
+--nv
+-.br
+-By default, the XJC binding compiler performs strict validation of the source schema before processing it\&. Use this option to disable strict schema validation\&. This does not mean that the binding compiler will not perform any validation, but means that it will perform a less-strict validation\&.
+-.TP
+--extension
+-.br
+-By default, the XJC binding compiler strictly enforces the rules outlined in the Compatibility chapter of the JAXB Specification\&. Appendix E\&.2 defines a set of W3C XML Schema features that are not completely supported by JAXB v1\&.0\&. In some cases, you may be allowed to use them in the \f3-extension\fR mode enabled by this switch\&. In the default (strict) mode, you are also limited to using only the binding customization defined in the specification\&. By using the \f3-extension\fR switch, you will be allowed to use the JAXB Vendor Extensions\&.
+-.TP
+--b \fIfile\fR
+-.br
+-Specifies one or more external binding files to process\&. Each binding file must have its own \f3-b\fR switch\&. The syntax of the external binding files is flexible\&. You can have a single binding file that contains customization for multiple schemas or you can break the customization into multiple bindings files: \f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings123\&.xjb\fR\f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings1\&.xjb -b bindings2\&.xjb -b bindings3\&.xjb\fR\&. In addition, the ordering of the schema files and binding files on the command line does not matter\&.
+-.TP
+--d \fIdir\fR
+-.br
+-By default, the XJC binding compiler generates the Java content classes in the current directory\&. Use this option to specify an alternate output directory\&. The output directory must already exist\&. The XJC binding compiler does not create it for you\&.
+-.TP
+--p \fIpkg\fR
+-.br
+-When you specify a target package with this command-line option, it overrides any binding customization for the package name and the default package name algorithm defined in the specification\&.
+-.TP
+--httpproxy \fIproxy\fR
+-.br
+-Specifies the HTTP or HTTPS proxy in the format \fI[user[:password]@]proxyHost[:proxyPort]\fR\&. The old \f3-host\fR and \f3-port\fR options are still supported by the RI for backward compatibility, but they were deprecated\&. The password specified with this option is an argument that is visible to other users who use the top command\&. For greater security, use the \f3-httpproxyfile\fR option\&.
+-.TP
+--httpproxyfile file
+-.br
+-Specifies the HTTP or HTTPS proxy with a file\&. The same format as the \f3-httpproxy\fR option, but the password specified in the file is not visible to other users\&.
+-.TP
+--classpath arg
+-.br
+-Specifies where to find client application class files used by the \fIjxb:javaType\fR and xjc:\fIsuperClass\fR customization\&.
+-.TP
+--catalog file
+-.br
+-Specifies catalog files to resolve external entity references\&. Supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See XML Entity and URI Resolvers at http://xerces\&.apache\&.org/xml-commons/components/resolver/resolver-article\&.html
+-.TP
+--readOnly
+-.br
+-By default, the XJC binding compiler does not write-protect the Java source files it generates\&. Use this option to force the XJC binding compiler to mark the generated Java sources as read-only\&.
+-.TP
+--npa
+-.br
+-Suppresses the generation of package level annotations into \f3**/package-info\&.java\fR\&. Using this switch causes the generated code to internalize those annotations into the other generated classes\&.
+-.TP
+--no-header
+-.br
+-Suppresses the generation of a file header comment that includes some note and time stamp\&. Using this makes the generated code more compatible with the \f3diff\fR command\&.
+-.TP
+--target 2\&.0
+-.br
+-Avoids generating code that relies on any JAXB 2\&.1 features\&. This will allow the generated code to run with JAXB 2\&.0 runtime environment (such as Java SE 6)\&.
+-.TP
+--xmlschema
+-.br
+-Treats input schemas as W3C XML Schema (default)\&. If you do not specify this switch, then your input schemas are treated as though they are W3C XML Schemas\&.
+-.TP
+--relaxing
+-.br
+-Treats input schemas as RELAX NG (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--relaxing-compact
+-.br
+-Treat input schemas as RELAX NG compact syntax (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--dtd
+-.br
+-Treats input schemas as XML DTD (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--wsdl
+-.br
+-Treats input as WSDL and compiles schemas inside it (experimental and unsupported)\&.
+-.TP
+--quiet
+-.br
+-Suppress compiler output, such as progress information and warnings\&.
+-.TP
+--verbose
+-.br
+-Be extra verbose, such as printing informational messages or displaying stack traces upon some errors\&.
+-.TP
+--help
+-.br
+-Displays a brief summary of the compiler switches\&.
+-.TP
+--version
+-.br
+-Displays the compiler version information\&.
+-.TP
+-\fIschema file/URL/dir\fR
+-Specifies one or more schema files to compile\&. If you specify a directory, then the \f3xjc\fR command scans it for all schema files and compiles them\&.
+-.SS NONSTANDARD\ OPTIONS
+-.TP
+--XLocator
+-.br
+-Causes the generated code to expose SAX Locator information about the source XML in the Java bean instances after unmarshalling\&.
+-.TP
+--Xsync-methods
+-.br
+-Causes all of the generated method signatures to include the \f3synchronized\fR keyword\&.
+-.TP
+--mark-generated
+-.br
+-Marks the generated code with the annotation \f3@javax\&.annotation\&.Generated\fR\&.
+-.TP
+--episode file
+-.br
+-Generates the specified episode file for separate compilation\&.
+-.SS DEPRECATED\ AND\ REMOVED\ OPTIONS
+-.TP
+--host & -port
+-.br
+-These options are replaced with the \f3-httpproxy\fR option\&. For backward compatibility, these options are supported, but will not be documented and might be removed from future releases\&.
+-.TP
+--use-runtime
+-.br
+-Because the JAXB 2\&.0 specification has defined a portable runtime environment, it is no longer necessary for the JAXB RI to generate \f3**/impl/runtime\fRpackages\&. Therefore, this switch is obsolete and was removed\&.
+-.TP
+--source
+-.br
+-The \f3-source\fR compatibility switch was introduced in the first JAXB 2\&.0 Early Access release\&. This switch is removed from future releases of JAXB 2\&.0\&. If you need to generate 1\&.0\&.x code, then use an installation of the 1\&.0\&.x code base\&.
+-.SH COMPILER\ RESTRICTIONS
+-In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches\&. Keep the following list of restrictions in mind when running the \f3xjc\fR command\&. Most of these issues only apply when you compile multiple schemas with multiple invocations of the \f3xjc\fR command\&.
+-.PP
+-To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
+-.TP 0.4i
+-1\&.
+-The \f3-p\fR option has the highest precedence\&.
+-.TP 0.4i
+-2\&.
+-\fIjaxb:package\fR customization\&.
+-.TP 0.4i
+-3\&.
+-If \f3targetNamespace\fR is declared, then apply the \f3t\fR\f3argetNamespace\fR to the Java package name algorithm defined in the specification\&.
+-.TP 0.4i
+-4\&.
+-If no \f3targetNamespace\fR is declared, then use a hard coded package named \f3generated\fR\&.
+-.PP
+-You cannot have more than one \fIjaxb:schemaBindings\fR per name space, so it is impossible to have two schemas in the same target name space compiled into different Java packages\&.
+-.PP
+-All schemas being compiled into the same Java package must be submitted to the XJC binding compiler at the same time\&. They cannot be compiled independently and work as expected\&.
+-.PP
+-Element substitution groups that are spread across multiple schema files must be compiled at the same time\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Binding Compiler (xjc) at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html
+-.TP 0.2i
+-\(bu
+-Java Architecture for XML Binding (JAXB) at http://www\&.oracle\&.com/technetwork/articles/javase/index-140168\&.html
++
++.SH NAME
++xjc \- Compiles an XML schema file into fully annotated Java classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBxjc\fR [ \fIoptions\fR ] \fBschema\fR \fIfile/URL/dir/jar\fR \&.\&.\&. [\fB\-b\fR \fIbindinfo\fR ] \&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++schema \fIfile/URL/dir/jar \&.\&.\&.\fR
++The location of the XML schema file\&. If \f3dir\fR is specified, then all schema files in it are compiled\&. If \f3jar\fR is specified, then the \f3/META-INF/sun-jaxb\&.episode\fR binding file is compiled\&.
++.TP
++-b \fIbindinfo\fR
++.br
++The location of the bindings files\&.
++.SH DESCRIPTION
++Start the binding compiler with the appropriate \f3xjc\fR shell script in the bin directory for your platform\&. There is also an Ant task to run the binding complier\&. See Using the XJC with Ant at http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html
++.SH OPTIONS
++.TP 0.2i
++\(bu
++See also Nonstandard Options
++.TP 0.2i
++\(bu
++See also Deprecated and Removed Options
++.TP
++-nv
++.br
++By default, the XJC binding compiler performs strict validation of the source schema before processing it\&. Use this option to disable strict schema validation\&. This does not mean that the binding compiler will not perform any validation, but means that it will perform a less-strict validation\&.
++.TP
++-extension
++.br
++By default, the XJC binding compiler strictly enforces the rules outlined in the Compatibility chapter of the JAXB Specification\&. Appendix E\&.2 defines a set of W3C XML Schema features that are not completely supported by JAXB v1\&.0\&. In some cases, you may be allowed to use them in the \f3-extension\fR mode enabled by this switch\&. In the default (strict) mode, you are also limited to using only the binding customization defined in the specification\&. By using the \f3-extension\fR switch, you will be allowed to use the JAXB Vendor Extensions\&.
++.TP
++-b \fIfile\fR
++.br
++Specifies one or more external binding files to process\&. Each binding file must have its own \f3-b\fR switch\&. The syntax of the external binding files is flexible\&. You can have a single binding file that contains customization for multiple schemas or you can break the customization into multiple bindings files: \f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings123\&.xjb\fR\f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings1\&.xjb -b bindings2\&.xjb -b bindings3\&.xjb\fR\&. In addition, the ordering of the schema files and binding files on the command line does not matter\&.
++.TP
++-d \fIdir\fR
++.br
++By default, the XJC binding compiler generates the Java content classes in the current directory\&. Use this option to specify an alternate output directory\&. The output directory must already exist\&. The XJC binding compiler does not create it for you\&.
++.TP
++-p \fIpkg\fR
++.br
++When you specify a target package with this command-line option, it overrides any binding customization for the package name and the default package name algorithm defined in the specification\&.
++.TP
++-httpproxy \fIproxy\fR
++.br
++Specifies the HTTP or HTTPS proxy in the format \fI[user[:password]@]proxyHost[:proxyPort]\fR\&. The old \f3-host\fR and \f3-port\fR options are still supported by the RI for backward compatibility, but they were deprecated\&. The password specified with this option is an argument that is visible to other users who use the top command\&. For greater security, use the \f3-httpproxyfile\fR option\&.
++.TP
++-httpproxyfile file
++.br
++Specifies the HTTP or HTTPS proxy with a file\&. The same format as the \f3-httpproxy\fR option, but the password specified in the file is not visible to other users\&.
++.TP
++-classpath arg
++.br
++Specifies where to find client application class files used by the \fIjxb:javaType\fR and xjc:\fIsuperClass\fR customization\&.
++.TP
++-catalog file
++.br
++Specifies catalog files to resolve external entity references\&. Supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See XML Entity and URI Resolvers at http://xerces\&.apache\&.org/xml-commons/components/resolver/resolver-article\&.html
++.TP
++-readOnly
++.br
++By default, the XJC binding compiler does not write-protect the Java source files it generates\&. Use this option to force the XJC binding compiler to mark the generated Java sources as read-only\&.
++.TP
++-npa
++.br
++Suppresses the generation of package level annotations into \f3**/package-info\&.java\fR\&. Using this switch causes the generated code to internalize those annotations into the other generated classes\&.
++.TP
++-no-header
++.br
++Suppresses the generation of a file header comment that includes some note and time stamp\&. Using this makes the generated code more compatible with the \f3diff\fR command\&.
++.TP
++-target 2\&.0
++.br
++Avoids generating code that relies on any JAXB 2\&.1 features\&. This will allow the generated code to run with JAXB 2\&.0 runtime environment (such as Java SE 6)\&.
++.TP
++-xmlschema
++.br
++Treats input schemas as W3C XML Schema (default)\&. If you do not specify this switch, then your input schemas are treated as though they are W3C XML Schemas\&.
++.TP
++-relaxing
++.br
++Treats input schemas as RELAX NG (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-relaxing-compact
++.br
++Treat input schemas as RELAX NG compact syntax (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-dtd
++.br
++Treats input schemas as XML DTD (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-wsdl
++.br
++Treats input as WSDL and compiles schemas inside it (experimental and unsupported)\&.
++.TP
++-quiet
++.br
++Suppress compiler output, such as progress information and warnings\&.
++.TP
++-verbose
++.br
++Be extra verbose, such as printing informational messages or displaying stack traces upon some errors\&.
++.TP
++-help
++.br
++Displays a brief summary of the compiler switches\&.
++.TP
++-version
++.br
++Displays the compiler version information\&.
++.TP
++\fIschema file/URL/dir\fR
++Specifies one or more schema files to compile\&. If you specify a directory, then the \f3xjc\fR command scans it for all schema files and compiles them\&.
++.SS NONSTANDARD\ OPTIONS
++.TP
++-XLocator
++.br
++Causes the generated code to expose SAX Locator information about the source XML in the Java bean instances after unmarshalling\&.
++.TP
++-Xsync-methods
++.br
++Causes all of the generated method signatures to include the \f3synchronized\fR keyword\&.
++.TP
++-mark-generated
++.br
++Marks the generated code with the annotation \f3@javax\&.annotation\&.Generated\fR\&.
++.TP
++-episode file
++.br
++Generates the specified episode file for separate compilation\&.
++.SS DEPRECATED\ AND\ REMOVED\ OPTIONS
++.TP
++-host & -port
++.br
++These options are replaced with the \f3-httpproxy\fR option\&. For backward compatibility, these options are supported, but will not be documented and might be removed from future releases\&.
++.TP
++-use-runtime
++.br
++Because the JAXB 2\&.0 specification has defined a portable runtime environment, it is no longer necessary for the JAXB RI to generate \f3**/impl/runtime\fRpackages\&. Therefore, this switch is obsolete and was removed\&.
++.TP
++-source
++.br
++The \f3-source\fR compatibility switch was introduced in the first JAXB 2\&.0 Early Access release\&. This switch is removed from future releases of JAXB 2\&.0\&. If you need to generate 1\&.0\&.x code, then use an installation of the 1\&.0\&.x code base\&.
++.SH COMPILER\ RESTRICTIONS
++In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches\&. Keep the following list of restrictions in mind when running the \f3xjc\fR command\&. Most of these issues only apply when you compile multiple schemas with multiple invocations of the \f3xjc\fR command\&.
++.PP
++To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
++.TP 0.4i
++1\&.
++The \f3-p\fR option has the highest precedence\&.
++.TP 0.4i
++2\&.
++\fIjaxb:package\fR customization\&.
++.TP 0.4i
++3\&.
++If \f3targetNamespace\fR is declared, then apply the \f3t\fR\f3argetNamespace\fR to the Java package name algorithm defined in the specification\&.
++.TP 0.4i
++4\&.
++If no \f3targetNamespace\fR is declared, then use a hard coded package named \f3generated\fR\&.
++.PP
++You cannot have more than one \fIjaxb:schemaBindings\fR per name space, so it is impossible to have two schemas in the same target name space compiled into different Java packages\&.
++.PP
++All schemas being compiled into the same Java package must be submitted to the XJC binding compiler at the same time\&. They cannot be compiled independently and work as expected\&.
++.PP
++Element substitution groups that are spread across multiple schema files must be compiled at the same time\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Binding Compiler (xjc) at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html
++.TP 0.2i
++\(bu
++Java Architecture for XML Binding (JAXB) at http://www\&.oracle\&.com/technetwork/articles/javase/index-140168\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/macosx/bin/java_md_macosx.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/bin/java_md_macosx.c Wed Jul 01 21:53:30 2015 -0700
+@@ -616,11 +616,7 @@
+ if (access(libjava, F_OK) == 0) {
+ return JNI_TRUE;
+ }
+- /* ensure storage for path + /jre + NULL */
+- if ((JLI_StrLen(path) + 4 + 1) > pathsize) {
+- JLI_TraceLauncher("Insufficient space to store JRE path\n");
+- return JNI_FALSE;
+- }
++
+ /* Does the app ship a private JRE in <apphome>/jre directory? */
+ JLI_Snprintf(libjava, sizeof(libjava), "%s/jre/lib/" JAVA_DLL, path);
+ if (access(libjava, F_OK) == 0) {
+--- ./jdk/src/macosx/classes/apple/security/KeychainStore.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/apple/security/KeychainStore.java Wed Jul 01 21:53:30 2015 -0700
+@@ -140,7 +140,8 @@
+ * password to recover it.
+ *
+ * @param alias the alias name
+- * @param password the password for recovering the key
++ * @param password the password for recovering the key. This password is
++ * used internally as the key is exported in a PKCS12 format.
+ *
+ * @return the requested key, or null if the given alias does not exist
+ * or does not identify a <i>key entry</i>.
+@@ -155,6 +156,20 @@
+ {
+ permissionCheck();
+
++ // An empty password is rejected by MacOS API, no private key data
++ // is exported. If no password is passed (as is the case when
++ // this implementation is used as browser keystore in various
++ // deployment scenarios like Webstart, JFX and applets), create
++ // a dummy password so MacOS API is happy.
++ if (password == null || password.length == 0) {
++ // Must not be a char array with only a 0, as this is an empty
++ // string.
++ if (random == null) {
++ random = new SecureRandom();
++ }
++ password = Long.toString(random.nextLong()).toCharArray();
++ }
++
+ Object entry = entries.get(alias.toLowerCase());
+
+ if (entry == null || !(entry instanceof KeyEntry)) {
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaBorder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaBorder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011, 2012, 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
+@@ -68,8 +68,9 @@
+ painter.state.set(size);
+ }
+
++ @Override
+ public Insets getBorderInsets(final Component c) {
+- return sizeVariant.margins;
++ return (Insets) sizeVariant.margins.clone();
+ }
+
+ protected AquaBorder deriveBorderForSize(final Size size) {
+@@ -130,8 +131,10 @@
+ return (focusable != null && focusable instanceof JComponent && ((JComponent)focusable).hasFocus());
+ }
+
++ @Override
+ public boolean isBorderOpaque() { return false; }
+
++ @Override
+ public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int w, final int h) {
+ painter.paint(g, c, x, y, w, h);
+ }
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -152,20 +152,6 @@
+ }
+
+ @Override
+- public void focusGained(final FocusEvent e) {
+- if (arrowButton != null) {
+- arrowButton.repaint();
+- }
+- }
+-
+- @Override
+- public void focusLost(final FocusEvent e) {
+- if (arrowButton != null) {
+- arrowButton.repaint();
+- }
+- }
+-
+- @Override
+ public void changedUpdate(final DocumentEvent e) {
+ editorTextChanged();
+ }
+@@ -250,6 +236,16 @@
+ */
+ protected FocusListener createFocusListener() {
+ return new BasicComboBoxUI.FocusHandler() {
++ @Override
++ public void focusGained(FocusEvent e) {
++ super.focusGained(e);
++
++ if (arrowButton != null) {
++ arrowButton.repaint();
++ }
++ }
++
++ @Override
+ public void focusLost(final FocusEvent e) {
+ hasFocus = false;
+ if (!e.isTemporary()) {
+@@ -262,6 +258,10 @@
+ if (ac != null) {
+ ac.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.FOCUSED, null);
+ }
++
++ if (arrowButton != null) {
++ arrowButton.repaint();
++ }
+ }
+ };
+ }
+@@ -273,7 +273,7 @@
+
+ actionMap.put("aquaSelectNext", highlightNextAction);
+ actionMap.put("aquaSelectPrevious", highlightPreviousAction);
+- actionMap.put("aquaEnterPressed", triggerSelectionAction);
++ actionMap.put("enterPressed", triggerSelectionAction);
+ actionMap.put("aquaSpacePressed", toggleSelectionAction);
+
+ actionMap.put("aquaSelectHome", highlightFirstAction);
+@@ -429,6 +429,7 @@
+ if (editor != null) {
+ final Rectangle editorRect = rectangleForCurrentValue();
+ editorRect.width += 4;
++ editorRect.height += 1;
+ editor.setBounds(editorRect);
+ }
+ }
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011, 2013, 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
+@@ -1089,8 +1089,15 @@
+ super(f);
+ }
+
+- public Component getTableCellRendererComponent(final JTable list, final Object value, final boolean isSelected, final boolean cellHasFocus, final int index, final int col) {
+- super.getTableCellRendererComponent(list, value, isSelected, false, index, col); // No focus border, thanks
++ public Component getTableCellRendererComponent(final JTable list,
++ final Object value,
++ final boolean isSelected,
++ final boolean cellHasFocus,
++ final int index,
++ final int col) {
++ super.getTableCellRendererComponent(list, value, isSelected, false,
++ index,
++ col); // No focus border, thanks
+ final File file = (File)value;
+ final JFileChooser fc = getFileChooser();
+ setText(fc.getName(file));
+@@ -1105,8 +1112,14 @@
+ super(f);
+ }
+
+- public Component getTableCellRendererComponent(final JTable list, final Object value, final boolean isSelected, final boolean cellHasFocus, final int index, final int col) {
+- super.getTableCellRendererComponent(list, value, isSelected, false, index, col);
++ public Component getTableCellRendererComponent(final JTable list,
++ final Object value,
++ final boolean isSelected,
++ final boolean cellHasFocus,
++ final int index,
++ final int col) {
++ super.getTableCellRendererComponent(list, value, isSelected, false,
++ index, col);
+ final File file = (File)fFileList.getValueAt(index, 0);
+ setEnabled(isSelectableInList(file));
+ final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT);
+@@ -1122,14 +1135,17 @@
+ }
+ }
+
++ @Override
+ public Dimension getPreferredSize(final JComponent c) {
+- return PREF_SIZE;
++ return new Dimension(PREF_WIDTH, PREF_HEIGHT);
+ }
+
++ @Override
+ public Dimension getMinimumSize(final JComponent c) {
+- return MIN_SIZE;
++ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
+ }
+
++ @Override
+ public Dimension getMaximumSize(final JComponent c) {
+ return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+@@ -1793,12 +1809,8 @@
+
+ private static final int PREF_WIDTH = 550;
+ private static final int PREF_HEIGHT = 400;
+- private static final Dimension PREF_SIZE = new Dimension(PREF_WIDTH, PREF_HEIGHT);
+-
+ private static final int MIN_WIDTH = 400;
+ private static final int MIN_HEIGHT = 250;
+- private static final Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
+-
+ private static final int LIST_MIN_WIDTH = 400;
+ private static final int LIST_MIN_HEIGHT = 100;
+ private static final Dimension LIST_MIN_SIZE = new Dimension(LIST_MIN_WIDTH, LIST_MIN_HEIGHT);
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaIcon.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaIcon.java Wed Jul 01 21:53:30 2015 -0700
+@@ -195,7 +195,7 @@
+ AquaPainter.create(JRSUIState.getInstance());
+ initIconPainter(painter);
+
+- g.setClip(new Rectangle(x, y, width, height));
++ g.clipRect(x, y, width, height);
+ painter.paint(g, c, x, y, width, height);
+ g.dispose();
+ }
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java Wed Jul 01 21:53:30 2015 -0700
+@@ -214,7 +214,7 @@
+ "PAGE_DOWN", "aquaSelectPageDown",
+ "HOME", "aquaSelectHome",
+ "END", "aquaSelectEnd",
+- "ENTER", "aquaEnterPressed",
++ "ENTER", "enterPressed",
+ "UP", "aquaSelectPrevious",
+ "KP_UP", "aquaSelectPrevious",
+ "DOWN", "aquaSelectNext",
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaMenuBarBorder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaMenuBarBorder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011, 2012, 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
+@@ -25,46 +25,33 @@
+
+ package com.apple.laf;
+
+-import java.awt.*;
++import java.awt.Color;
++import java.awt.Component;
++import java.awt.Graphics;
++import java.awt.Insets;
+
+ import javax.swing.border.Border;
+
++import sun.swing.SwingUtilities2;
++
++/**
++ * The class represents the border of a {@code JMenuBar}.
++ */
+ public class AquaMenuBarBorder implements Border {
+- public AquaMenuBarBorder() {
+- super();
++
++ @Override
++ public void paintBorder(final Component c, final Graphics g, final int x,
++ final int y, final int width, final int height) {
++ g.setColor(Color.gray);
++ SwingUtilities2.drawHLine(g, x, x + width - 1, y + height - 1);
+ }
+
+- /**
+- * Paints the border for the specified component with the specified
+- * position and size.
+- * @param c the component for which this border is being painted
+- * @param g the paint graphics
+- * @param x the x position of the painted border
+- * @param y the y position of the painted border
+- * @param width the width of the painted border
+- * @param height the height of the painted border
+- */
+- public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
+- // for now we don't paint a border. We let the button paint it since there
+- // needs to be a strict ordering for aqua components.
+- //paintButton(c, g, x, y, width, height);
+- g.setColor(Color.gray);
+- g.drawLine(x, y + height - 1, x + width, y + height - 1);
+- }
+-
+- /**
+- * Returns the insets of the border.
+- * @param c the component for which this border insets value applies
+- */
++ @Override
+ public Insets getBorderInsets(final Component c) {
+ return new Insets(0, 0, 1, 0);
+ }
+
+- /**
+- * Returns whether or not the border is opaque. If the border
+- * is opaque, it is responsible for filling in it's own
+- * background when painting.
+- */
++ @Override
+ public boolean isBorderOpaque() {
+ return false;
+ }
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaMenuUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaMenuUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -148,11 +148,15 @@
+
+ // In Aqua, we always have a menu delay, regardless of where the menu is.
+ if (!(selectedPath.length > 0 && selectedPath[selectedPath.length - 1] == menu.getPopupMenu())) {
+- if (menu.getDelay() == 0) {
+- appendPath(getPath(), menu.getPopupMenu());
+- } else {
+- manager.setSelectedPath(getPath());
+- setupPostTimer(menu);
++ // the condition below prevents from activating menu in other frame
++ if (!menu.isTopLevelMenu() || (selectedPath.length > 0 &&
++ selectedPath[0] == menu.getParent())) {
++ if (menu.getDelay() == 0) {
++ appendPath(getPath(), menu.getPopupMenu());
++ } else {
++ manager.setSelectedPath(getPath());
++ setupPostTimer(menu);
++ }
+ }
+ }
+ }
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -29,6 +29,7 @@
+
+ import javax.swing.*;
+ import javax.swing.plaf.ComponentUI;
++import javax.swing.plaf.basic.BasicScrollPaneUI;
+
+ public class AquaScrollPaneUI extends javax.swing.plaf.basic.BasicScrollPaneUI {
+ public static ComponentUI createUI(final JComponent x) {
+@@ -39,28 +40,9 @@
+ return new XYMouseWheelHandler();
+ }
+
+- // This is a grody hack to trick BasicScrollPaneUI into scrolling horizontally
+- // when we notice that the shift key is down. This should be removed when AWT/Swing
+- // becomes aware of of multi-axis scroll wheels.
+- protected class XYMouseWheelHandler extends javax.swing.plaf.basic.BasicScrollPaneUI.MouseWheelHandler {
++ protected class XYMouseWheelHandler extends BasicScrollPaneUI.MouseWheelHandler {
+ public void mouseWheelMoved(final MouseWheelEvent e) {
+- JScrollBar vScrollBar = null;
+- boolean wasVisible = false;
+-
+- if (e.isShiftDown()) {
+- vScrollBar = scrollpane.getVerticalScrollBar();
+- if (vScrollBar != null) {
+- wasVisible = vScrollBar.isVisible();
+- vScrollBar.setVisible(false);
+- }
+- }
+-
+ super.mouseWheelMoved(e);
+-
+- if (wasVisible) {
+- vScrollBar.setVisible(true);
+- }
+-
+ // Consume the event even when the scrollBar is invisible
+ // see #7124320
+ e.consume();
+--- ./jdk/src/macosx/classes/com/apple/laf/AquaTextFieldBorder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/AquaTextFieldBorder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -124,7 +124,7 @@
+
+ public Insets getBorderInsets(final Component c) {
+ if (!(c instanceof JTextComponent) || c.isOpaque()) return new InsetsUIResource(3, 7, 3, 7);
+- return new InsetsUIResource(6, 7, 6, 7);
++ return new InsetsUIResource(5, 5, 5, 5);
+ }
+
+ protected static State getStateFor(final JTextComponent jc) {
+--- ./jdk/src/macosx/classes/com/apple/laf/resources/aqua_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/com/apple/laf/resources/aqua_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2011, 2013, 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
+@@ -124,7 +124,7 @@
+
+ # The following string will be formatted by a MessageFormat
+ # and {0} will be replaced by page number being printed
+-PrintingDialog.contentProgress.textAndMnemonic=Utskriven sida {0}...
++PrintingDialog.contentProgress.textAndMnemonic=Skriver ut sida {0}...
+
+ PrintingDialog.contentAborting.textAndMnemonic=Utskriften avbryts...
+
+@@ -172,7 +172,7 @@
+ ProgressMonitor.progress.textAndMnemonic=P\u00E5g\u00E5r...
+
+ ############ Split Pane Strings ############
+-SplitPane.leftButton.textAndMnemonic=v\u00E4nster knapp
++SplitPane.leftButton.textAndMnemonic=v\u00E4nsterknapp
+ SplitPane.rightButton.textAndMnemonic=h\u00F6ger knapp
+ # Used for Isindex
+ IsindexView.prompt=Detta \u00E4r ett s\u00F6kbart index. Ange s\u00F6kord:
+--- ./jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java Wed Jul 01 21:53:30 2015 -0700
+@@ -43,7 +43,6 @@
+ * therefore methods, which is using this id should be ready to it.
+ */
+ private volatile int displayID;
+- private volatile Insets screenInsets;
+ private volatile double xResolution;
+ private volatile double yResolution;
+ private volatile int scale;
+@@ -120,7 +119,13 @@
+ }
+
+ public Insets getScreenInsets() {
+- return screenInsets;
++ // the insets are queried synchronously and are not cached
++ // since there are no Quartz or Cocoa means to receive notifications
++ // on insets changes (e.g. when the Dock is resized):
++ // the existing CGDisplayReconfigurationCallBack is not notified
++ // as well as the NSApplicationDidChangeScreenParametersNotification
++ // is fired on the Dock location changes only
++ return nativeGetScreenInsets(displayID);
+ }
+
+ public int getScaleFactor() {
+@@ -135,7 +140,6 @@
+ public void displayChanged() {
+ xResolution = nativeGetXResolution(displayID);
+ yResolution = nativeGetYResolution(displayID);
+- screenInsets = nativeGetScreenInsets(displayID);
+ scale = (int) nativeGetScaleFactor(displayID);
+ //TODO configs/fullscreenWindow/modes?
+ }
+--- ./jdk/src/macosx/classes/sun/font/CFont.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/font/CFont.java Wed Jul 01 21:53:30 2015 -0700
+@@ -77,14 +77,72 @@
+ }
+
+ private static native long createNativeFont(final String nativeFontName,
+- final int style,
+- final boolean isFakeItalic);
++ final int style);
+ private static native void disposeNativeFont(final long nativeFontPtr);
+
+ private boolean isFakeItalic;
+ private String nativeFontName;
+ private long nativeFontPtr;
+
++ private native float getWidthNative(final long nativeFontPtr);
++ private native float getWeightNative(final long nativeFontPtr);
++
++ private int fontWidth = -1;
++ private int fontWeight = -1;
++
++ @Override
++ public int getWidth() {
++ if (fontWidth == -1) {
++ // Apple use a range of -1 -> +1, where 0.0 is normal
++ // OpenType uses a % range from 50% -> 200% where 100% is normal
++ // and maps these onto the integer values 1->9.
++ // Since that is what Font2D.getWidth() expects, remap to that.
++ float fw = getWidthNative(getNativeFontPtr());
++ if (fw == 0.0) { // short cut the common case
++ fontWidth = Font2D.FWIDTH_NORMAL;
++ return fontWidth;
++ }
++ fw += 1.0; fw *= 100.0;
++ if (fw <= 50.0) {
++ fontWidth = 1;
++ } else if (fw <= 62.5) {
++ fontWidth = 2;
++ } else if (fw <= 75.0) {
++ fontWidth = 3;
++ } else if (fw <= 87.5) {
++ fontWidth = 4;
++ } else if (fw <= 100.0) {
++ fontWidth = 5;
++ } else if (fw <= 112.5) {
++ fontWidth = 6;
++ } else if (fw <= 125.0) {
++ fontWidth = 7;
++ } else if (fw <= 150.0) {
++ fontWidth = 8;
++ } else {
++ fontWidth = 9;
++ }
++ }
++ return fontWidth;
++ }
++
++ @Override
++ public int getWeight() {
++ if (fontWeight == -1) {
++ // Apple use a range of -1 -> +1, where 0 is medium/regular
++ // Map this on to the OpenType range of 100->900 where
++ // 500 is medium/regular.
++ // We'll actually map to 0->1000 but that's close enough.
++ float fw = getWeightNative(getNativeFontPtr());
++ if (fw == 0) {
++ return Font2D.FWEIGHT_NORMAL;
++ }
++ fw += 1.0; fw *= 500;
++ fontWeight = (int)fw;
++ }
++ return fontWeight;
++ }
++
+ // this constructor is called from CFontWrapper.m
+ public CFont(String name) {
+ this(name, name);
+@@ -94,10 +152,11 @@
+ handle = new Font2DHandle(this);
+ fullName = name;
+ familyName = inFamilyName;
+- nativeFontName = inFamilyName;
++ nativeFontName = fullName;
+ setStyle();
+ }
+
++ /* Called from CFontManager too */
+ public CFont(CFont other, String logicalFamilyName) {
+ handle = new Font2DHandle(this);
+ fullName = logicalFamilyName;
+@@ -109,6 +168,7 @@
+
+ public CFont createItalicVariant() {
+ CFont font = new CFont(this, familyName);
++ font.nativeFontName = fullName;
+ font.fullName =
+ fullName + (style == Font.BOLD ? "" : "-") + "Italic-Derived";
+ font.style |= Font.ITALIC;
+@@ -118,7 +178,7 @@
+
+ protected synchronized long getNativeFontPtr() {
+ if (nativeFontPtr == 0L) {
+- nativeFontPtr = createNativeFont(nativeFontName, style, isFakeItalic);
++ nativeFontPtr = createNativeFont(nativeFontName, style);
+ }
+ return nativeFontPtr;
+ }
+--- ./jdk/src/macosx/classes/sun/font/CFontManager.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/font/CFontManager.java Wed Jul 01 21:53:30 2015 -0700
+@@ -252,13 +252,42 @@
+ final CFont font = new CFont(fontName, fontFamilyName);
+
+ registerGenericFont(font);
++ }
+
+- if ((font.getStyle() & Font.ITALIC) == 0) {
+- registerGenericFont(font.createItalicVariant(), true);
++ void registerItalicDerived() {
++ FontFamily[] famArr = FontFamily.getAllFontFamilies();
++ for (int i=0; i<famArr.length; i++) {
++ FontFamily family = famArr[i];
++
++ Font2D f2dPlain = family.getFont(Font.PLAIN);
++ if (f2dPlain != null && !(f2dPlain instanceof CFont)) continue;
++ Font2D f2dBold = family.getFont(Font.BOLD);
++ if (f2dBold != null && !(f2dBold instanceof CFont)) continue;
++ Font2D f2dItalic = family.getFont(Font.ITALIC);
++ if (f2dItalic != null && !(f2dItalic instanceof CFont)) continue;
++ Font2D f2dBoldItalic = family.getFont(Font.BOLD|Font.ITALIC);
++ if (f2dBoldItalic != null && !(f2dBoldItalic instanceof CFont)) continue;
++
++ CFont plain = (CFont)f2dPlain;
++ CFont bold = (CFont)f2dBold;
++ CFont italic = (CFont)f2dItalic;
++ CFont boldItalic = (CFont)f2dBoldItalic;
++
++ if (bold == null) bold = plain;
++ if (plain == null && bold == null) continue;
++ if (italic != null && boldItalic != null) continue;
++ if (plain != null && italic == null) {
++ registerGenericFont(plain.createItalicVariant(), true);
++ }
++ if (bold != null && boldItalic == null) {
++ registerGenericFont(bold.createItalicVariant(), true);
++ }
+ }
+ }
+
+ Object waitForFontsToBeLoaded = new Object();
++ private boolean loadedAllFonts = false;
++
+ public void loadFonts()
+ {
+ synchronized(waitForFontsToBeLoaded)
+@@ -267,7 +296,11 @@
+ java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction<Object>() {
+ public Object run() {
+- loadNativeFonts();
++ if (!loadedAllFonts) {
++ loadNativeFonts();
++ registerItalicDerived();
++ loadedAllFonts = true;
++ }
+ return null;
+ }
+ }
+--- ./jdk/src/macosx/classes/sun/lwawt/LWCheckboxPeer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/lwawt/LWCheckboxPeer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011, 2013, 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
+@@ -132,7 +132,9 @@
+ @Override
+ public void setState(final boolean state) {
+ synchronized (getDelegateLock()) {
++ getDelegate().getCurrentButton().removeItemListener(this);
+ getDelegate().setSelected(state);
++ getDelegate().getCurrentButton().addItemListener(this);
+ }
+ repaintPeer();
+ }
+--- ./jdk/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011, 2013, 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
+@@ -23,7 +23,6 @@
+ * questions.
+ */
+
+-
+ package sun.lwawt;
+
+ import java.awt.Component;
+@@ -40,7 +39,6 @@
+ import javax.swing.JTextArea;
+ import javax.swing.ScrollPaneConstants;
+ import javax.swing.text.Document;
+-import javax.swing.text.JTextComponent;
+
+ /**
+ * Lightweight implementation of {@link TextAreaPeer}. Delegates most of the
+@@ -75,12 +73,13 @@
+ super.initializeImpl();
+ final int visibility = getTarget().getScrollbarVisibility();
+ synchronized (getDelegateLock()) {
++ getTextComponent().setWrapStyleWord(true);
+ setScrollBarVisibility(visibility);
+ }
+ }
+
+ @Override
+- JTextComponent getTextComponent() {
++ JTextArea getTextComponent() {
+ return getDelegate().getView();
+ }
+
+@@ -165,7 +164,7 @@
+ // JTextArea.replaceRange() is called.
+ final Document document = getTextComponent().getDocument();
+ document.removeDocumentListener(this);
+- getDelegate().getView().replaceRange(text, start, end);
++ getTextComponent().replaceRange(text, start, end);
+ revalidate();
+ postEvent(new TextEvent(getTarget(), TextEvent.TEXT_VALUE_CHANGED));
+ document.addDocumentListener(this);
+--- ./jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1295,6 +1295,12 @@
+ }
+
+ KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
++
++ if (!becomesFocused && kfmPeer.getCurrentFocusedWindow() != getTarget()) {
++ // late window focus lost event - ingoring
++ return;
++ }
++
+ kfmPeer.setCurrentFocusedWindow(becomesFocused ? getTarget() : null);
+
+ int eventID = becomesFocused ? WindowEvent.WINDOW_GAINED_FOCUS : WindowEvent.WINDOW_LOST_FOCUS;
+--- ./jdk/src/macosx/classes/sun/lwawt/macosx/CAccessibility.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/lwawt/macosx/CAccessibility.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011, 2012, 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
+@@ -630,7 +630,7 @@
+
+ if (!allowIgnored) {
+ final AccessibleRole role = context.getAccessibleRole();
+- if (role != null && ignoredRoles.contains(roleKey(role))) {
++ if (role != null && ignoredRoles != null && ignoredRoles.contains(roleKey(role))) {
+ // Get the child's unignored children.
+ _addChildren(child, whichChildren, false, childrenAndRoles);
+ } else {
+--- ./jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java Wed Jul 01 21:53:30 2015 -0700
+@@ -161,7 +161,7 @@
+ }
+ // ignore focus "lost" native request as it may mistakenly
+ // deactivate active window (see 8001161)
+- if (globalFocusedWindow == this && parentWindowActive) {
++ if (globalFocusedWindow == this) {
+ responder.handleWindowFocusEvent(parentWindowActive, null);
+ }
+ }
+--- ./jdk/src/macosx/classes/sun/lwawt/macosx/CImage.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/lwawt/macosx/CImage.java Wed Jul 01 21:53:30 2015 -0700
+@@ -136,33 +136,35 @@
+ return ((DataBufferInt)bimg.getRaster().getDataBuffer()).getData();
+ }
+
++ // This is used to create a CImage from a Image
++ public CImage createFromImage(final Image image) {
++ return createFromImage(image, true);
++ }
++
+ public CImage createFromImageImmediately(final Image image) {
+- int[] buffer = imageToArray(image, false);
+-
+- if (buffer == null) {
+- return null;
+- }
+-
+- return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null),
+- image.getHeight(null)));
++ return createFromImage(image, false);
+ }
+
+ // This is used to create a CImage from a Image
+- public CImage createFromImage(final Image image) {
++ private CImage createFromImage(final Image image, final boolean prepareImage) {
+ if (image instanceof MultiResolutionImage) {
+ List<Image> resolutionVariants
+ = ((MultiResolutionImage) image).getResolutionVariants();
+- return createFromImages(resolutionVariants);
++ return createFromImages(resolutionVariants, prepareImage);
+ }
+
+- int[] buffer = imageToArray(image, true);
++ int[] buffer = imageToArray(image, prepareImage);
+ if (buffer == null) {
+ return null;
+ }
+ return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null), image.getHeight(null)));
+ }
+
+- public CImage createFromImages(List<Image> images) {
++ public CImage createFromImages(final List<Image> images) {
++ return createFromImages(images, true);
++ }
++
++ private CImage createFromImages(final List<Image> images, final boolean prepareImage) {
+ if (images == null || images.isEmpty()) {
+ return null;
+ }
+@@ -175,8 +177,8 @@
+
+ num = 0;
+
+- for (Image img : images) {
+- buffers[num] = imageToArray(img, true);
++ for (final Image img : images) {
++ buffers[num] = imageToArray(img, prepareImage);
+ if (buffers[num] == null) {
+ // Unable to process the image
+ continue;
+@@ -191,9 +193,9 @@
+ }
+
+ return new CImage(nativeCreateNSImageFromArrays(
+- Arrays.copyOf(buffers, num),
+- Arrays.copyOf(w, num),
+- Arrays.copyOf(h, num)));
++ Arrays.copyOf(buffers, num),
++ Arrays.copyOf(w, num),
++ Arrays.copyOf(h, num)));
+ }
+
+ static int getSelectorAsInt(final String fromString) {
+--- ./jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java Wed Jul 01 21:53:30 2015 -0700
+@@ -36,6 +36,10 @@
+ import javax.print.*;
+ import javax.print.attribute.PrintRequestAttributeSet;
+ import javax.print.attribute.HashPrintRequestAttributeSet;
++import javax.print.attribute.standard.Media;
++import javax.print.attribute.standard.MediaPrintableArea;
++import javax.print.attribute.standard.MediaSize;
++import javax.print.attribute.standard.MediaSizeName;
+ import javax.print.attribute.standard.PageRanges;
+
+ import sun.java2d.*;
+@@ -741,4 +745,34 @@
+ protected void startPage(PageFormat arg0, Printable arg1, int arg2, boolean arg3) throws PrinterException {
+ // TODO Auto-generated method stub
+ }
++
++ @Override
++ protected MediaSize getMediaSize(Media media, PrintService service,
++ PageFormat page) {
++ if (media == null || !(media instanceof MediaSizeName)) {
++ return getDefaultMediaSize(page);
+ }
++ MediaSize size = MediaSize.getMediaSizeForName((MediaSizeName) media);
++ return size != null ? size : getDefaultMediaSize(page);
++ }
++
++ private MediaSize getDefaultMediaSize(PageFormat page){
++ final int inch = 72;
++ Paper paper = page.getPaper();
++ float width = (float) (paper.getWidth() / inch);
++ float height = (float) (paper.getHeight() / inch);
++ return new MediaSize(width, height, MediaSize.INCH);
++ }
++
++ @Override
++ protected MediaPrintableArea getDefaultPrintableArea(PageFormat page, double w, double h) {
++ final float dpi = 72.0f;
++ Paper paper = page.getPaper();
++ return new MediaPrintableArea(
++ (float) (paper.getImageableX() / dpi),
++ (float) (paper.getImageableY() / dpi),
++ (float) (paper.getImageableWidth() / dpi),
++ (float) (paper.getImageableHeight() / dpi),
++ MediaPrintableArea.INCH);
++ }
++}
+\ No newline at end of file
+--- ./jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Wed Jul 01 21:53:30 2015 -0700
+@@ -366,8 +366,7 @@
+ protected void initializeDesktopProperties() {
+ super.initializeDesktopProperties();
+ Map <Object, Object> fontHints = new HashMap<>();
+- fontHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+- fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
++ fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
+ desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints);
+ desktopProperties.put("awt.mouse.numButtons", BUTTONS);
+
+--- ./jdk/src/macosx/javavm/export/jawt_md.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/javavm/export/jawt_md.h Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2013 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1999, 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
+--- ./jdk/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_PCM.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_PCM.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -28,7 +28,6 @@
+ //#define USE_VERBOSE_TRACE
+
+ #include <AudioUnit/AudioUnit.h>
+-#include <CoreServices/CoreServices.h>
+ #include <AudioToolbox/AudioConverter.h>
+ #include <pthread.h>
+ #include <math.h>
+@@ -617,7 +616,7 @@
+
+ ~OSX_DirectAudioDevice() {
+ if (audioUnit) {
+- CloseComponent(audioUnit);
++ AudioComponentInstanceDispose(audioUnit);
+ }
+ if (resampler) {
+ delete resampler;
+@@ -629,17 +628,16 @@
+ {
+ OSStatus err;
+ AudioUnit unit;
+- UInt32 size;
+
+- ComponentDescription desc;
++ AudioComponentDescription desc;
+ desc.componentType = kAudioUnitType_Output;
+ desc.componentSubType = (deviceID == 0 && isSource) ? kAudioUnitSubType_DefaultOutput : kAudioUnitSubType_HALOutput;
+ desc.componentManufacturer = kAudioUnitManufacturer_Apple;
+ desc.componentFlags = 0;
+ desc.componentFlagsMask = 0;
+
+- Component comp = FindNextComponent(NULL, &desc);
+- err = OpenAComponent(comp, &unit);
++ AudioComponent comp = AudioComponentFindNext(NULL, &desc);
++ err = AudioComponentInstanceNew(comp, &unit);
+
+ if (err) {
+ OS_ERROR0(err, "CreateOutputUnit:OpenAComponent");
+@@ -664,7 +662,7 @@
+ // get real AudioDeviceID for default input device (macosx current input device)
+ deviceID = GetDefaultDevice(isSource);
+ if (!deviceID) {
+- CloseComponent(unit);
++ AudioComponentInstanceDispose(unit);
+ return NULL;
+ }
+ }
+@@ -675,7 +673,7 @@
+ 0, &deviceID, sizeof(deviceID));
+ if (err) {
+ OS_ERROR0(err, "SetProperty (CurrentDevice)");
+- CloseComponent(unit);
++ AudioComponentInstanceDispose(unit);
+ return NULL;
+ }
+ }
+--- ./jdk/src/macosx/native/sun/awt/AWTView.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/awt/AWTView.m Wed Jul 01 21:53:30 2015 -0700
+@@ -310,7 +310,10 @@
+ }
+
+ - (BOOL) performKeyEquivalent: (NSEvent *) event {
+- [self deliverJavaKeyEventHelper: event];
++ // if IM is active key events should be ignored
++ if (![self hasMarkedText] && !fInPressAndHold) {
++ [self deliverJavaKeyEventHelper: event];
++ }
+
+ // Workaround for 8020209: special case for "Cmd =" and "Cmd ."
+ // because Cocoa calls performKeyEquivalent twice for these keystrokes
+--- ./jdk/src/macosx/native/sun/awt/CFRetainedResource.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/awt/CFRetainedResource.m Wed Jul 01 21:53:30 2015 -0700
+@@ -23,6 +23,7 @@
+ * questions.
+ */
+
++#import <Cocoa/Cocoa.h>
+ #import <JavaNativeFoundation/JavaNativeFoundation.h>
+
+ #import "sun_lwawt_macosx_CFRetainedResource.h"
+@@ -37,7 +38,10 @@
+ (JNIEnv *env, jclass clazz, jlong ptr, jboolean releaseOnAppKitThread)
+ {
+ if (releaseOnAppKitThread) {
+- [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
++ // Releasing resources on the main AppKit message loop only
++ // Releasing resources on the nested loops may cause dangling
++ // pointers after the nested loop is exited
++ [NSApp postRunnableEvent:^(){
+ CFRelease(jlong_to_ptr(ptr));
+ }];
+ } else {
+--- ./jdk/src/macosx/native/sun/awt/LWCToolkit.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/awt/LWCToolkit.h Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011, 2013, 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
+@@ -28,8 +28,6 @@
+
+ #import <Cocoa/Cocoa.h>
+ #import <JavaNativeFoundation/JavaNativeFoundation.h>
+-#import <CoreServices/CoreServices.h>
+-#import <AudioToolbox/AudioToolbox.h>
+
+ #define DEBUG 1
+
+--- ./jdk/src/macosx/native/sun/awt/LWCToolkit.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/awt/LWCToolkit.m Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2011, 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
+@@ -124,61 +124,6 @@
+ JNF_COCOA_EXIT(env);
+ }
+
+-static JNF_CLASS_CACHE(jc_Component, "java/awt/Component");
+-static JNF_MEMBER_CACHE(jf_Component_appContext, jc_Component, "appContext", "Lsun/awt/AppContext;");
+-static JNF_CLASS_CACHE(jc_MenuComponent, "java/awt/MenuComponent");
+-static JNF_MEMBER_CACHE(jf_MenuComponent_appContext, jc_MenuComponent, "appContext", "Lsun/awt/AppContext;");
+-
+-/*
+- * Class: sun_awt_SunToolkit
+- * Method: getAppContext
+- * Signature: (Ljava/awt/Object;)Lsun/awt/AppContext;
+- */
+-JNIEXPORT jobject JNICALL
+-Java_sun_awt_SunToolkit_getAppContext
+-(JNIEnv *env, jclass cls, jobject obj)
+-{
+- jobject appContext = NULL;
+-
+-JNF_COCOA_ENTER(env);
+-
+- if (JNFIsInstanceOf(env, obj, &jc_Component)) {
+- appContext = JNFGetObjectField(env, obj, jf_Component_appContext);
+- } else if (JNFIsInstanceOf(env, obj, &jc_MenuComponent)) {
+- appContext = JNFGetObjectField(env, obj, jf_MenuComponent_appContext);
+- }
+-
+-JNF_COCOA_EXIT(env);
+-
+- return appContext;
+-}
+-
+-/*
+- * Class: sun_awt_SunToolkit
+- * Method: setAppContext
+- * Signature: (Ljava/lang/Object;Lsun/awt/AppContext;)Z
+- */
+-JNIEXPORT jboolean JNICALL
+-Java_sun_awt_SunToolkit_setAppContext
+-(JNIEnv *env, jclass cls, jobject obj, jobject appContext)
+-{
+- jboolean isComponent;
+-
+-JNF_COCOA_ENTER(env);
+-
+- if (JNFIsInstanceOf(env, obj, &jc_Component)) {
+- JNFSetObjectField(env, obj, jf_Component_appContext, appContext);
+- isComponent = JNI_TRUE;
+- } else if (JNFIsInstanceOf(env, obj, &jc_MenuComponent)) {
+- JNFSetObjectField(env, obj, jf_MenuComponent_appContext, appContext);
+- isComponent = JNI_FALSE;
+- }
+-
+-JNF_COCOA_EXIT(env);
+-
+- return isComponent;
+-}
+-
+ /*
+ * Class: sun_lwawt_macosx_LWCToolkit
+ * Method: beep
+@@ -339,8 +284,10 @@
+ beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.010]];
+ if (processEvents) {
+ //We do not spin a runloop here as date is nil, so does not matter which mode to use
++ // Processing all events excluding NSApplicationDefined which need to be processed
++ // on the main loop only (those events are intended for disposing resources)
+ NSEvent *event;
+- if ((event = [NSApp nextEventMatchingMask:NSAnyEventMask
++ if ((event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSApplicationDefined)
+ untilDate:nil
+ inMode:NSDefaultRunLoopMode
+ dequeue:YES]) != nil) {
+--- ./jdk/src/macosx/native/sun/awt/awt.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/awt/awt.m Wed Jul 01 21:53:30 2015 -0700
+@@ -30,6 +30,7 @@
+ #import <JavaNativeFoundation/JavaNativeFoundation.h>
+ #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
+
++#import "jni_util.h"
+ #import "NSApplicationAWT.h"
+ #import "PropertiesUtilities.h"
+ #import "ThreadUtilities.h"
+@@ -436,8 +437,11 @@
+ }
+ JNIEnv* env = [ThreadUtilities getJNIEnvUncached];
+ jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/misc/ThreadGroupUtils");
++ CHECK_NULL_RETURN(jc_ThreadGroupUtils, JNI_VERSION_1_4);
+ jmethodID sjm_getRootThreadGroup = (*env)->GetStaticMethodID(env, jc_ThreadGroupUtils, "getRootThreadGroup", "()Ljava/lang/ThreadGroup;");
++ CHECK_NULL_RETURN(sjm_getRootThreadGroup, JNI_VERSION_1_4);
+ jobject rootThreadGroup = (*env)->CallStaticObjectMethod(env, jc_ThreadGroupUtils, sjm_getRootThreadGroup);
++ CHECK_NULL_RETURN(rootThreadGroup, JNI_VERSION_1_4);
+ [ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, rootThreadGroup)];
+ // The current thread was attached in getJNIEnvUnchached.
+ // Detach it back. It will be reattached later if needed with a proper TG
+--- ./jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m Wed Jul 01 21:53:30 2015 -0700
+@@ -126,12 +126,30 @@
+ return buf;
+ }
+
++BOOL isSWTRunning() {
++ char envVar[80];
++ // If this property is present we are running SWT
++ snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
++ return getenv(envVar) != NULL;
++}
++
+ char* SplashGetScaledImageName(const char* jar, const char* file,
+ float *scaleFactor) {
++ *scaleFactor = 1;
++
++ if(isSWTRunning()){
++ return nil;
++ }
++
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
+- *scaleFactor = 1;
+ char* scaledFile = nil;
+- float screenScaleFactor = 1;
++ __block float screenScaleFactor = 1;
++
++ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
++ // initialize NSApplication and AWT stuff
++ [NSApplicationAWT sharedApplication];
++ screenScaleFactor = [SplashNSScreen() backingScaleFactor];
++ }];
+
+ if (screenScaleFactor > 1) {
+ NSString *fileName = [NSString stringWithUTF8String: file];
+@@ -176,9 +194,12 @@
+ splash->screenFormat.byteOrder = 1 ? BYTE_ORDER_LSBFIRST : BYTE_ORDER_MSBFIRST;
+ splash->screenFormat.depthBytes = 4;
+
+- [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
+- [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
+- }];
++ // If we are running SWT we should not start a runLoop
++ if (!isSWTRunning()) {
++ [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
++ [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
++ }];
++ }
+ }
+
+ void
+--- ./jdk/src/macosx/native/sun/font/AWTFont.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/font/AWTFont.m Wed Jul 01 21:53:30 2015 -0700
+@@ -35,15 +35,11 @@
+ #import "AWTStrike.h"
+ #import "CoreTextSupport.h"
+
+-
+-#define DEBUG
+-
+ @implementation AWTFont
+
+-- (id) initWithFont:(NSFont *)font isFakeItalic:(BOOL)isFakeItalic {
++- (id) initWithFont:(NSFont *)font {
+ self = [super init];
+ if (self) {
+- fIsFakeItalic = isFakeItalic;
+ fFont = [font retain];
+ fNativeCGFont = CTFontCopyGraphicsFont((CTFontRef)font, NULL);
+ }
+@@ -72,7 +68,6 @@
+
+ + (AWTFont *) awtFontForName:(NSString *)name
+ style:(int)style
+- isFakeItalic:(BOOL)isFakeItalic
+ {
+ // create font with family & size
+ NSFont *nsFont = [NSFont fontWithName:name size:1.0];
+@@ -95,7 +90,7 @@
+ nsFont = [[NSFontManager sharedFontManager] convertFont:nsFont toHaveTrait:NSBoldFontMask];
+ }
+
+- return [[[AWTFont alloc] initWithFont:nsFont isFakeItalic:isFakeItalic] autorelease];
++ return [[[AWTFont alloc] initWithFont:nsFont] autorelease];
+ }
+
+ + (NSFont *) nsFontForJavaFont:(jobject)javaFont env:(JNIEnv *)env {
+@@ -354,7 +349,7 @@
+ JNIEXPORT jlong JNICALL
+ Java_sun_font_CFont_createNativeFont
+ (JNIEnv *env, jclass clazz,
+- jstring nativeFontName, jint style, jboolean isFakeItalic)
++ jstring nativeFontName, jint style)
+ {
+ AWTFont *awtFont = nil;
+
+@@ -362,8 +357,7 @@
+
+ awtFont =
+ [AWTFont awtFontForName:JNFJavaToNSString(env, nativeFontName)
+- style:style
+- isFakeItalic:isFakeItalic]; // autoreleased
++ style:style]; // autoreleased
+
+ if (awtFont) {
+ CFRetain(awtFont); // GC
+@@ -376,6 +370,52 @@
+
+ /*
+ * Class: sun_font_CFont
++ * Method: getWidthNative
++ * Signature: (J)F
++ */
++JNIEXPORT jfloat JNICALL
++Java_sun_font_CFont_getWidthNative
++ (JNIEnv *env, jobject cfont, jlong awtFontPtr)
++{
++ float widthVal;
++JNF_COCOA_ENTER(env);
++
++ AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
++ NSFont* nsFont = awtFont->fFont;
++ NSFontDescriptor *fontDescriptor = nsFont.fontDescriptor;
++ NSDictionary *fontTraits = [fontDescriptor objectForKey : NSFontTraitsAttribute];
++ NSNumber *width = [fontTraits objectForKey : NSFontWidthTrait];
++ widthVal = (float)[width floatValue];
++
++JNF_COCOA_EXIT(env);
++ return (jfloat)widthVal;
++}
++
++/*
++ * Class: sun_font_CFont
++ * Method: getWeightNative
++ * Signature: (J)F
++ */
++JNIEXPORT jfloat JNICALL
++Java_sun_font_CFont_getWeightNative
++ (JNIEnv *env, jobject cfont, jlong awtFontPtr)
++{
++ float weightVal;
++JNF_COCOA_ENTER(env);
++
++ AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
++ NSFont* nsFont = awtFont->fFont;
++ NSFontDescriptor *fontDescriptor = nsFont.fontDescriptor;
++ NSDictionary *fontTraits = [fontDescriptor objectForKey : NSFontTraitsAttribute];
++ NSNumber *weight = [fontTraits objectForKey : NSFontWeightTrait];
++ weightVal = (float)[weight floatValue];
++
++JNF_COCOA_EXIT(env);
++ return (jfloat)weightVal;
++}
++
++/*
++ * Class: sun_font_CFont
+ * Method: disposeNativeFont
+ * Signature: (J)V
+ */
+--- ./jdk/src/macosx/native/sun/font/AWTStrike.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/font/AWTStrike.m Wed Jul 01 21:53:30 2015 -0700
+@@ -311,21 +311,26 @@
+
+ jlong *glyphInfos =
+ (*env)->GetPrimitiveArrayCritical(env, glyphInfoLongArray, NULL);
+- if (glyphInfos != NULL) {
++
+ jint *rawGlyphCodes =
+- (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL);
+-
++ (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL);
++ @try {
++ if (rawGlyphCodes != NULL && glyphInfos != NULL) {
++ CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike,
++ rawGlyphCodes, len);
++ }
++ }
++ @finally {
+ if (rawGlyphCodes != NULL) {
+- CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike,
+- rawGlyphCodes, len);
+-
+- (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes,
+- rawGlyphCodes, JNI_ABORT);
++ (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes,
++ rawGlyphCodes, JNI_ABORT);
+ }
+- // Do not use JNI_COMMIT, as that will not free the buffer copy
+- // when +ProtectJavaHeap is on.
+- (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray,
+- glyphInfos, 0);
++ if (glyphInfos != NULL) {
++ // Do not use JNI_COMMIT, as that will not free the buffer copy
++ // when +ProtectJavaHeap is on.
++ (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray,
++ glyphInfos, 0);
++ }
+ }
+
+ JNF_COCOA_EXIT(env);
+--- ./jdk/src/macosx/native/sun/font/CGGlyphImages.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/font/CGGlyphImages.m Wed Jul 01 21:53:30 2015 -0700
+@@ -195,19 +195,41 @@
+
+
+ #pragma mark --- Font Rendering Mode Descriptors ---
++static Int32 reverseGamma = 0;
++
++static UInt8 reverseGammaLut[256] = { 0 };
++
++static inline UInt8* getReverseGammaLut() {
++ if (reverseGamma == 0) {
++ // initialize gamma lut
++ double gamma;
++ int i;
++ const char* pGammaEnv = getenv("J2D_LCD_REVERSE_GAMMA");
++ if (pGammaEnv != NULL) {
++ reverseGamma = atol(pGammaEnv);
++ }
++
++ if (reverseGamma < 100 || reverseGamma > 250) {
++ reverseGamma = 180;
++ }
++
++ gamma = 100.0 / reverseGamma;
++ for (i = 0; i < 256; i++) {
++ double x = ((double)i) / 255.0;
++ reverseGammaLut[i] = (UInt8)(255 * pow(x, gamma));
++ }
++ }
++ return reverseGammaLut;
++}
+
+ static inline void
+ CGGI_CopyARGBPixelToRGBPixel(const UInt32 p, UInt8 *dst)
+ {
+-#if __LITTLE_ENDIAN__
+- *(dst + 2) = 0xFF - (p >> 24 & 0xFF);
+- *(dst + 1) = 0xFF - (p >> 16 & 0xFF);
+- *(dst) = 0xFF - (p >> 8 & 0xFF);
+-#else
+- *(dst) = 0xFF - (p >> 16 & 0xFF);
+- *(dst + 1) = 0xFF - (p >> 8 & 0xFF);
+- *(dst + 2) = 0xFF - (p & 0xFF);
+-#endif
++ UInt8* lut = getReverseGammaLut();
++
++ *(dst + 0) = lut[0xFF - (p >> 16 & 0xFF)]; // red
++ *(dst + 1) = lut[0xFF - (p >> 8 & 0xFF)]; // green
++ *(dst + 2) = lut[0xFF - (p & 0xFF)]; // blue
+ }
+
+ static void
+@@ -222,17 +244,14 @@
+ size_t height = info->height;
+
+ size_t y;
++
++ // fill empty glyph image with black-on-white glyph
+ for (y = 0; y < height; y++) {
+ size_t destRow = y * destRowWidth * 3;
+ size_t srcRow = y * srcRowWidth;
+
+ size_t x;
+ for (x = 0; x < destRowWidth; x++) {
+- // size_t x3 = x * 3;
+- // UInt32 p = src[srcRow + x];
+- // dest[destRow + x3] = 0xFF - (p >> 16 & 0xFF);
+- // dest[destRow + x3 + 1] = 0xFF - (p >> 8 & 0xFF);
+- // dest[destRow + x3 + 2] = 0xFF - (p & 0xFF);
+ CGGI_CopyARGBPixelToRGBPixel(src[srcRow + x],
+ dest + destRow + x * 3);
+ }
+@@ -260,13 +279,9 @@
+ //}
+
+ static inline UInt8
+-CGGI_ConvertPixelToGreyBit(UInt32 p)
++CGGI_ConvertBWPixelToByteGray(UInt32 p)
+ {
+-#ifdef __LITTLE_ENDIAN__
+- return 0xFF - ((p >> 24 & 0xFF) + (p >> 16 & 0xFF) + (p >> 8 & 0xFF)) / 3;
+-#else
+- return 0xFF - ((p >> 16 & 0xFF) + (p >> 8 & 0xFF) + (p & 0xFF)) / 3;
+-#endif
++ return 0xFF - (((p >> 24 & 0xFF) + (p >> 16 & 0xFF) + (p >> 8 & 0xFF)) / 3);
+ }
+
+ static void
+@@ -281,14 +296,15 @@
+ size_t height = info->height;
+
+ size_t y;
++
++ // fill empty glyph image with black-on-white glyph
+ for (y = 0; y < height; y++) {
+ size_t destRow = y * destRowWidth;
+ size_t srcRow = y * srcRowWidth;
+-
+ size_t x;
+ for (x = 0; x < destRowWidth; x++) {
+ UInt32 p = src[srcRow + x];
+- dest[destRow + x] = CGGI_ConvertPixelToGreyBit(p);
++ dest[destRow + x] = CGGI_ConvertBWPixelToByteGray(p);
+ }
+ }
+ }
+@@ -316,13 +332,11 @@
+ {
+ CGGI_RenderingMode mode;
+ mode.cgFontMode = strike->fStyle;
++ NSException *e = nil;
+
+ switch (strike->fAAStyle) {
+- case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_DEFAULT:
+ case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_OFF:
+ case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_ON:
+- case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_GASP:
+- default:
+ mode.glyphDescriptor = &grey;
+ break;
+ case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
+@@ -331,6 +345,17 @@
+ case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_LCD_VBGR:
+ mode.glyphDescriptor = &rgb;
+ break;
++ case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_GASP:
++ case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_DEFAULT:
++ default:
++ /* we expect that text antialiasing hint has been already
++ * evaluated. Report an error if we get 'unevaluated' hint here.
++ */
++ e = [NSException
++ exceptionWithName:@"IllegalArgumentException"
++ reason:@"Invalid hint value"
++ userInfo:nil];
++ @throw e;
+ }
+
+ return mode;
+@@ -345,7 +370,8 @@
+ */
+ static inline void
+ CGGI_InitCanvas(CGGI_GlyphCanvas *canvas,
+- const vImagePixelCount width, const vImagePixelCount height)
++ const vImagePixelCount width, const vImagePixelCount height,
++ const CGGI_RenderingMode* mode)
+ {
+ // our canvas is *always* 4-byte ARGB
+ size_t bytesPerRow = width * sizeof(UInt32);
+@@ -356,19 +382,26 @@
+ canvas->image->height = height;
+ canvas->image->rowBytes = bytesPerRow;
+
+- canvas->image->data = (void *)calloc(byteCount, sizeof(UInt32));
++ canvas->image->data = (void *)calloc(byteCount, sizeof(UInt8));
+ if (canvas->image->data == NULL) {
+ [[NSException exceptionWithName:NSMallocException
+ reason:@"Failed to allocate memory for the buffer which backs the CGContext for glyph strikes." userInfo:nil] raise];
+ }
+
+- CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
++ uint32_t bmpInfo = kCGImageAlphaPremultipliedFirst;
++ if (mode->glyphDescriptor == &rgb) {
++ bmpInfo |= kCGBitmapByteOrder32Host;
++ }
++
++ CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
+ canvas->context = CGBitmapContextCreate(canvas->image->data,
+ width, height, 8, bytesPerRow,
+ colorSpace,
+- kCGImageAlphaPremultipliedFirst);
++ bmpInfo);
+
++ // set foreground color
+ CGContextSetRGBFillColor(canvas->context, 0.0f, 0.0f, 0.0f, 1.0f);
++
+ CGContextSetFontSize(canvas->context, 1);
+ CGContextSaveGState(canvas->context);
+
+@@ -404,7 +437,9 @@
+ * Quick and easy inline to check if this canvas is big enough.
+ */
+ static inline void
+-CGGI_SizeCanvas(CGGI_GlyphCanvas *canvas, const vImagePixelCount width, const vImagePixelCount height, const JRSFontRenderingStyle style)
++CGGI_SizeCanvas(CGGI_GlyphCanvas *canvas, const vImagePixelCount width,
++ const vImagePixelCount height,
++ const CGGI_RenderingMode* mode)
+ {
+ if (canvas->image != NULL &&
+ width < canvas->image->width &&
+@@ -418,8 +453,9 @@
+ CGGI_FreeCanvas(canvas);
+ CGGI_InitCanvas(canvas,
+ width * CGGI_GLYPH_CANVAS_SLACK,
+- height * CGGI_GLYPH_CANVAS_SLACK);
+- JRSFontSetRenderingStyleOnContext(canvas->context, style);
++ height * CGGI_GLYPH_CANVAS_SLACK,
++ mode);
++ JRSFontSetRenderingStyleOnContext(canvas->context, mode->cgFontMode);
+ }
+
+ /*
+@@ -443,6 +479,7 @@
+ Pixel_8888 opaqueWhite = { 0xFF, 0xFF, 0xFF, 0xFF };
+ #endif
+
++ // clear canvas background and set foreground color
+ vImageBufferFill_ARGB8888(&canvasRectToClear, opaqueWhite, kvImageNoFlags);
+ }
+
+@@ -577,7 +614,7 @@
+ GlyphInfo *info = CGGI_CreateNewGlyphInfoFrom(advance, bbox, strike, mode);
+
+ // fix the context size, just in case the substituted character is unexpectedly large
+- CGGI_SizeCanvas(canvas, info->width, info->height, mode->cgFontMode);
++ CGGI_SizeCanvas(canvas, info->width, info->height, mode);
+
+ // align the transform for the real CoreText strike
+ CGContextSetTextMatrix(canvas->context, strike->fAltTx);
+@@ -653,8 +690,11 @@
+ #endif
+ }
+
+-static NSString *threadLocalCanvasKey =
+- @"Java CoreGraphics Text Renderer Cached Canvas";
++static NSString *threadLocalAACanvasKey =
++ @"Java CoreGraphics Text Renderer Cached Canvas for AA";
++
++static NSString *threadLocalLCDCanvasKey =
++ @"Java CoreGraphics Text Renderer Cached Canvas for LCD";
+
+ /*
+ * This is the maximum length and height times the above slack squared
+@@ -678,25 +718,28 @@
+ CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_SLACK*CGGI_GLYPH_CANVAS_SLACK)
+ {
+ CGGI_GlyphCanvas *tmpCanvas = [[CGGI_GlyphCanvas alloc] init];
+- CGGI_InitCanvas(tmpCanvas, maxWidth, maxHeight);
++ CGGI_InitCanvas(tmpCanvas, maxWidth, maxHeight, mode);
+ CGGI_FillImagesForGlyphsWithSizedCanvas(tmpCanvas, strike,
+- mode, glyphInfos, uniChars,
+- glyphs, len);
++ mode, glyphInfos, uniChars,
++ glyphs, len);
+ CGGI_FreeCanvas(tmpCanvas);
+
+ [tmpCanvas release];
+ return;
+ }
+-
+ NSMutableDictionary *threadDict =
+ [[NSThread currentThread] threadDictionary];
+- CGGI_GlyphCanvas *canvas = [threadDict objectForKey:threadLocalCanvasKey];
++
++ NSString* theKey = (mode->glyphDescriptor == &rgb) ?
++ threadLocalLCDCanvasKey : threadLocalAACanvasKey;
++
++ CGGI_GlyphCanvas *canvas = [threadDict objectForKey:theKey];
+ if (canvas == nil) {
+ canvas = [[CGGI_GlyphCanvas alloc] init];
+- [threadDict setObject:canvas forKey:threadLocalCanvasKey];
++ [threadDict setObject:canvas forKey:theKey];
+ }
+
+- CGGI_SizeCanvas(canvas, maxWidth, maxHeight, mode->cgFontMode);
++ CGGI_SizeCanvas(canvas, maxWidth, maxHeight, mode);
+ CGGI_FillImagesForGlyphsWithSizedCanvas(canvas, strike, mode,
+ glyphInfos, uniChars, glyphs, len);
+ }
+--- ./jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.h Wed Jul 01 21:53:30 2015 -0700
+@@ -37,6 +37,7 @@
+ - (void) registerWithProcessManager;
+ - (void) setDockIconWithEnv:(JNIEnv *)env;
+ - (void) postDummyEvent;
++- (void) postRunnableEvent:(void (^)())block;
+ - (void) waitForDummyEvent;
+
+ + (void) runAWTLoopWithApp:(NSApplication*)app;
+--- ./jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m Wed Jul 01 21:53:30 2015 -0700
+@@ -338,9 +338,13 @@
+
+ - (void)sendEvent:(NSEvent *)event
+ {
+- if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp)) {
++ if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp) && [event subtype] == 0) {
+ [seenDummyEventLock lockWhenCondition:NO];
+ [seenDummyEventLock unlockWithCondition:YES];
++ } else if ([event type] == NSApplicationDefined && [event subtype] == 777) {
++ void (^block)() = (void (^)()) [event data1];
++ block();
++ [block release];
+ } else if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) {
+ // Cocoa won't send us key up event when releasing a key while Cmd is down,
+ // so we have to do it ourselves.
+@@ -350,6 +354,33 @@
+ }
+ }
+
++/*
++ * Posts the block to the AppKit event queue which will be executed
++ * on the main AppKit loop.
++ * While running nested loops this event will be ignored.
++ */
++- (void)postRunnableEvent:(void (^)())block
++{
++ void (^copy)() = [block copy];
++ NSInteger encode = (NSInteger) copy;
++ [copy retain];
++ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
++ NSEvent* event = [NSEvent otherEventWithType: NSApplicationDefined
++ location: NSMakePoint(0,0)
++ modifierFlags: 0
++ timestamp: 0
++ windowNumber: 0
++ context: nil
++ subtype: 777
++ data1: encode
++ data2: 0];
++
++ [NSApp postEvent: event atStart: NO];
++ [pool drain];
++}
++
++
++
+ - (void)postDummyEvent {
+ seenDummyEventLock = [[NSConditionLock alloc] initWithCondition:NO];
+ dummyEventTimestamp = [NSProcessInfo processInfo].systemUptime;
+--- ./jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -88,7 +88,7 @@
+ modal=modal
+ multiline=flera rader
+ multiselectable=flerval
+-opaque=t\u00E4ckande
++opaque=ogenomskinlig
+ pressed=nedtryckt
+ resizable=storleks\u00E4ndringsbar
+ selectable=valbar
+--- ./jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2008, 2013 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2008, 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
+--- ./jdk/src/share/classes/com/sun/crypto/provider/AESCrypt.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/AESCrypt.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -37,7 +37,7 @@
+ package com.sun.crypto.provider;
+
+ import java.security.InvalidKeyException;
+-import java.security.MessageDigest;
++import java.util.Arrays;
+
+ /**
+ * Rijndael --pronounced Reindaal-- is a symmetric cipher with a 128-bit
+@@ -88,7 +88,7 @@
+ key.length + " bytes");
+ }
+
+- if (!MessageDigest.isEqual(key, lastKey)) {
++ if (!Arrays.equals(key, lastKey)) {
+ // re-generate session key 'sessionK' when cipher key changes
+ makeSessionKey(key);
+ lastKey = key.clone(); // save cipher key
+--- ./jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -568,7 +568,7 @@
+ // check key+iv for encryption in GCM mode
+ requireReinit =
+ Arrays.equals(ivBytes, lastEncIv) &&
+- MessageDigest.isEqual(keyBytes, lastEncKey);
++ Arrays.equals(keyBytes, lastEncKey);
+ if (requireReinit) {
+ throw new InvalidAlgorithmParameterException
+ ("Cannot reuse iv for GCM encryption");
+--- ./jdk/src/share/classes/com/sun/crypto/provider/DESKey.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/DESKey.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -25,7 +25,6 @@
+
+ package com.sun.crypto.provider;
+
+-import java.security.MessageDigest;
+ import java.security.KeyRep;
+ import java.security.InvalidKeyException;
+ import javax.crypto.SecretKey;
+@@ -114,7 +113,7 @@
+ return false;
+
+ byte[] thatKey = ((SecretKey)obj).getEncoded();
+- boolean ret = MessageDigest.isEqual(this.key, thatKey);
++ boolean ret = java.util.Arrays.equals(this.key, thatKey);
+ java.util.Arrays.fill(thatKey, (byte)0x00);
+ return ret;
+ }
+--- ./jdk/src/share/classes/com/sun/crypto/provider/DESedeKey.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/DESedeKey.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -25,7 +25,6 @@
+
+ package com.sun.crypto.provider;
+
+-import java.security.MessageDigest;
+ import java.security.KeyRep;
+ import java.security.InvalidKeyException;
+ import javax.crypto.SecretKey;
+@@ -115,7 +114,7 @@
+ return false;
+
+ byte[] thatKey = ((SecretKey)obj).getEncoded();
+- boolean ret = MessageDigest.isEqual(this.key, thatKey);
++ boolean ret = java.util.Arrays.equals(this.key, thatKey);
+ java.util.Arrays.fill(thatKey, (byte)0x00);
+ return ret;
+ }
+--- ./jdk/src/share/classes/com/sun/crypto/provider/GHASH.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/GHASH.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,6 @@
+ /*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2015 Red Hat, Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -28,9 +29,7 @@
+
+ package com.sun.crypto.provider;
+
+-import java.util.Arrays;
+-import java.security.*;
+-import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
++import java.security.ProviderException;
+
+ /**
+ * This class represents the GHASH function defined in NIST 800-38D
+@@ -44,62 +43,90 @@
+ */
+ final class GHASH {
+
+- private static final byte P128 = (byte) 0xe1; //reduction polynomial
+-
+- private static boolean getBit(byte[] b, int pos) {
+- int p = pos / 8;
+- pos %= 8;
+- int i = (b[p] >>> (7 - pos)) & 1;
+- return i != 0;
++ private static long getLong(byte[] buffer, int offset) {
++ long result = 0;
++ int end = offset + 8;
++ for (int i = offset; i < end; ++i) {
++ result = (result << 8) + (buffer[i] & 0xFF);
++ }
++ return result;
+ }
+
+- private static void shift(byte[] b) {
+- byte temp, temp2;
+- temp2 = 0;
+- for (int i = 0; i < b.length; i++) {
+- temp = (byte) ((b[i] & 0x01) << 7);
+- b[i] = (byte) ((b[i] & 0xff) >>> 1);
+- b[i] = (byte) (b[i] | temp2);
+- temp2 = temp;
++ private static void putLong(byte[] buffer, int offset, long value) {
++ int end = offset + 8;
++ for (int i = end - 1; i >= offset; --i) {
++ buffer[i] = (byte) value;
++ value >>= 8;
+ }
+ }
+
+- // Given block X and Y, returns the muliplication of X * Y
+- private static byte[] blockMult(byte[] x, byte[] y) {
+- if (x.length != AES_BLOCK_SIZE || y.length != AES_BLOCK_SIZE) {
+- throw new RuntimeException("illegal input sizes");
++ private static final int AES_BLOCK_SIZE = 16;
++
++ // Multiplies state0, state1 by V0, V1.
++ private void blockMult(long V0, long V1) {
++ long Z0 = 0;
++ long Z1 = 0;
++ long X;
++
++ // Separate loops for processing state0 and state1.
++ X = state0;
++ for (int i = 0; i < 64; i++) {
++ // Zi+1 = Zi if bit i of x is 0
++ long mask = X >> 63;
++ Z0 ^= V0 & mask;
++ Z1 ^= V1 & mask;
++
++ // Save mask for conditional reduction below.
++ mask = (V1 << 63) >> 63;
++
++ // V = rightshift(V)
++ long carry = V0 & 1;
++ V0 = V0 >>> 1;
++ V1 = (V1 >>> 1) | (carry << 63);
++
++ // Conditional reduction modulo P128.
++ V0 ^= 0xe100000000000000L & mask;
++ X <<= 1;
+ }
+- byte[] z = new byte[AES_BLOCK_SIZE];
+- byte[] v = y.clone();
+- // calculate Z1-Z127 and V1-V127
+- for (int i = 0; i < 127; i++) {
++
++ X = state1;
++ for (int i = 64; i < 127; i++) {
+ // Zi+1 = Zi if bit i of x is 0
+- if (getBit(x, i)) {
+- for (int n = 0; n < z.length; n++) {
+- z[n] ^= v[n];
+- }
+- }
+- boolean lastBitOfV = getBit(v, 127);
+- shift(v);
+- if (lastBitOfV) v[0] ^= P128;
++ long mask = X >> 63;
++ Z0 ^= V0 & mask;
++ Z1 ^= V1 & mask;
++
++ // Save mask for conditional reduction below.
++ mask = (V1 << 63) >> 63;
++
++ // V = rightshift(V)
++ long carry = V0 & 1;
++ V0 = V0 >>> 1;
++ V1 = (V1 >>> 1) | (carry << 63);
++
++ // Conditional reduction.
++ V0 ^= 0xe100000000000000L & mask;
++ X <<= 1;
+ }
++
+ // calculate Z128
+- if (getBit(x, 127)) {
+- for (int n = 0; n < z.length; n++) {
+- z[n] ^= v[n];
+- }
+- }
+- return z;
++ long mask = X >> 63;
++ Z0 ^= V0 & mask;
++ Z1 ^= V1 & mask;
++
++ // Save result.
++ state0 = Z0;
++ state1 = Z1;
+ }
+
+ // hash subkey H; should not change after the object has been constructed
+- private final byte[] subkeyH;
++ private final long subkeyH0, subkeyH1;
+
+ // buffer for storing hash
+- private byte[] state;
++ private long state0, state1;
+
+ // variables for save/restore calls
+- private byte[] stateSave = null;
++ private long stateSave0, stateSave1;
+
+ /**
+ * Initializes the cipher in the specified mode with the given key
+@@ -114,8 +141,8 @@
+ if ((subkeyH == null) || subkeyH.length != AES_BLOCK_SIZE) {
+ throw new ProviderException("Internal error");
+ }
+- this.subkeyH = subkeyH;
+- this.state = new byte[AES_BLOCK_SIZE];
++ this.subkeyH0 = getLong(subkeyH, 0);
++ this.subkeyH1 = getLong(subkeyH, 8);
+ }
+
+ /**
+@@ -124,31 +151,33 @@
+ * this object for different data w/ the same H.
+ */
+ void reset() {
+- Arrays.fill(state, (byte) 0);
++ state0 = 0;
++ state1 = 0;
+ }
+
+ /**
+ * Save the current snapshot of this GHASH object.
+ */
+ void save() {
+- stateSave = state.clone();
++ stateSave0 = state0;
++ stateSave1 = state1;
+ }
+
+ /**
+ * Restores this object using the saved snapshot.
+ */
+ void restore() {
+- state = stateSave;
++ state0 = stateSave0;
++ state1 = stateSave1;
+ }
+
+ private void processBlock(byte[] data, int ofs) {
+ if (data.length - ofs < AES_BLOCK_SIZE) {
+ throw new RuntimeException("need complete block");
+ }
+- for (int n = 0; n < state.length; n++) {
+- state[n] ^= data[ofs + n];
+- }
+- state = blockMult(state, subkeyH);
++ state0 ^= getLong(data, ofs);
++ state1 ^= getLong(data, ofs + 8);
++ blockMult(subkeyH0, subkeyH1);
+ }
+
+ void update(byte[] in) {
+@@ -169,10 +198,10 @@
+ }
+
+ byte[] digest() {
+- try {
+- return state.clone();
+- } finally {
+- reset();
+- }
++ byte[] result = new byte[AES_BLOCK_SIZE];
++ putLong(result, 0, state0);
++ putLong(result, 8, state1);
++ reset();
++ return result;
+ }
+ }
+--- ./jdk/src/share/classes/com/sun/crypto/provider/JceKeyStore.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/JceKeyStore.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -107,7 +107,7 @@
+ {
+ Key key = null;
+
+- Object entry = entries.get(alias.toLowerCase());
++ Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
+
+ if (!((entry instanceof PrivateKeyEntry) ||
+ (entry instanceof SecretKeyEntry))) {
+@@ -150,7 +150,7 @@
+ {
+ Certificate[] chain = null;
+
+- Object entry = entries.get(alias.toLowerCase());
++ Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
+
+ if ((entry instanceof PrivateKeyEntry)
+ && (((PrivateKeyEntry)entry).chain != null)) {
+@@ -178,7 +178,7 @@
+ public Certificate engineGetCertificate(String alias) {
+ Certificate cert = null;
+
+- Object entry = entries.get(alias.toLowerCase());
++ Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
+
+ if (entry != null) {
+ if (entry instanceof TrustedCertEntry) {
+@@ -203,7 +203,7 @@
+ public Date engineGetCreationDate(String alias) {
+ Date date = null;
+
+- Object entry = entries.get(alias.toLowerCase());
++ Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
+
+ if (entry != null) {
+ // We have to create a new instance of java.util.Date because
+@@ -266,7 +266,7 @@
+ }
+
+ // store the entry
+- entries.put(alias.toLowerCase(), entry);
++ entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
+
+ } else {
+ SecretKeyEntry entry = new SecretKeyEntry();
+@@ -274,7 +274,7 @@
+
+ // seal and store the key
+ entry.sealedKey = keyProtector.seal(key);
+- entries.put(alias.toLowerCase(), entry);
++ entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
+ }
+
+ } catch (Exception e) {
+@@ -322,7 +322,7 @@
+ entry.chain = null;
+ }
+
+- entries.put(alias.toLowerCase(), entry);
++ entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
+ }
+ }
+
+@@ -345,7 +345,7 @@
+ {
+ synchronized(entries) {
+
+- Object entry = entries.get(alias.toLowerCase());
++ Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
+ if (entry != null) {
+ if (entry instanceof PrivateKeyEntry) {
+ throw new KeyStoreException("Cannot overwrite own "
+@@ -358,7 +358,7 @@
+ TrustedCertEntry trustedCertEntry = new TrustedCertEntry();
+ trustedCertEntry.cert = cert;
+ trustedCertEntry.date = new Date();
+- entries.put(alias.toLowerCase(), trustedCertEntry);
++ entries.put(alias.toLowerCase(Locale.ENGLISH), trustedCertEntry);
+ }
+ }
+
+@@ -373,7 +373,7 @@
+ throws KeyStoreException
+ {
+ synchronized(entries) {
+- entries.remove(alias.toLowerCase());
++ entries.remove(alias.toLowerCase(Locale.ENGLISH));
+ }
+ }
+
+@@ -394,7 +394,7 @@
+ * @return true if the alias exists, false otherwise
+ */
+ public boolean engineContainsAlias(String alias) {
+- return entries.containsKey(alias.toLowerCase());
++ return entries.containsKey(alias.toLowerCase(Locale.ENGLISH));
+ }
+
+ /**
+@@ -416,7 +416,7 @@
+ public boolean engineIsKeyEntry(String alias) {
+ boolean isKey = false;
+
+- Object entry = entries.get(alias.toLowerCase());
++ Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
+ if ((entry instanceof PrivateKeyEntry)
+ || (entry instanceof SecretKeyEntry)) {
+ isKey = true;
+@@ -434,7 +434,7 @@
+ */
+ public boolean engineIsCertificateEntry(String alias) {
+ boolean isCert = false;
+- Object entry = entries.get(alias.toLowerCase());
++ Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
+ if (entry instanceof TrustedCertEntry) {
+ isCert = true;
+ }
+--- ./jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -25,9 +25,9 @@
+
+ package com.sun.crypto.provider;
+
+-import java.security.MessageDigest;
+ import java.security.KeyRep;
+ import java.security.spec.InvalidKeySpecException;
++import java.util.Locale;
+ import javax.crypto.SecretKey;
+ import javax.crypto.spec.PBEKeySpec;
+
+@@ -92,7 +92,7 @@
+ for (int i = 1; i < this.key.length; i++) {
+ retval += this.key[i] * i;
+ }
+- return(retval ^= getAlgorithm().toLowerCase().hashCode());
++ return(retval ^= getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode());
+ }
+
+ public boolean equals(Object obj) {
+@@ -108,7 +108,7 @@
+ return false;
+
+ byte[] thatEncoded = that.getEncoded();
+- boolean ret = MessageDigest.isEqual(this.key, thatEncoded);
++ boolean ret = java.util.Arrays.equals(this.key, thatEncoded);
+ java.util.Arrays.fill(thatEncoded, (byte)0x00);
+ return ret;
+ }
+--- ./jdk/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -32,6 +32,7 @@
+ import javax.crypto.SecretKeyFactorySpi;
+ import javax.crypto.spec.PBEKeySpec;
+ import java.util.HashSet;
++import java.util.Locale;
+
+ /**
+ * This class implements a key factory for PBE keys according to PKCS#5,
+@@ -56,24 +57,24 @@
+
+ static {
+ validTypes = new HashSet<String>(17);
+- validTypes.add("PBEWithMD5AndDES".toUpperCase());
+- validTypes.add("PBEWithSHA1AndDESede".toUpperCase());
+- validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase());
+- validTypes.add("PBEWithSHA1AndRC2_128".toUpperCase());
+- validTypes.add("PBEWithSHA1AndRC4_40".toUpperCase());
+- validTypes.add("PBEWithSHA1AndRC4_128".toUpperCase());
++ validTypes.add("PBEWithMD5AndDES".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithSHA1AndDESede".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithSHA1AndRC2_128".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithSHA1AndRC4_40".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithSHA1AndRC4_128".toUpperCase(Locale.ENGLISH));
+ // Proprietary algorithm.
+- validTypes.add("PBEWithMD5AndTripleDES".toUpperCase());
+- validTypes.add("PBEWithHmacSHA1AndAES_128".toUpperCase());
+- validTypes.add("PBEWithHmacSHA224AndAES_128".toUpperCase());
+- validTypes.add("PBEWithHmacSHA256AndAES_128".toUpperCase());
+- validTypes.add("PBEWithHmacSHA384AndAES_128".toUpperCase());
+- validTypes.add("PBEWithHmacSHA512AndAES_128".toUpperCase());
+- validTypes.add("PBEWithHmacSHA1AndAES_256".toUpperCase());
+- validTypes.add("PBEWithHmacSHA224AndAES_256".toUpperCase());
+- validTypes.add("PBEWithHmacSHA256AndAES_256".toUpperCase());
+- validTypes.add("PBEWithHmacSHA384AndAES_256".toUpperCase());
+- validTypes.add("PBEWithHmacSHA512AndAES_256".toUpperCase());
++ validTypes.add("PBEWithMD5AndTripleDES".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA1AndAES_128".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA224AndAES_128".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA256AndAES_128".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA384AndAES_128".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA512AndAES_128".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA1AndAES_256".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA224AndAES_256".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA256AndAES_256".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA384AndAES_256".toUpperCase(Locale.ENGLISH));
++ validTypes.add("PBEWithHmacSHA512AndAES_256".toUpperCase(Locale.ENGLISH));
+ }
+
+ public static final class PBEWithMD5AndDES
+@@ -237,7 +238,7 @@
+ protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpecCl)
+ throws InvalidKeySpecException {
+ if ((key instanceof SecretKey)
+- && (validTypes.contains(key.getAlgorithm().toUpperCase()))
++ && (validTypes.contains(key.getAlgorithm().toUpperCase(Locale.ENGLISH)))
+ && (key.getFormat().equalsIgnoreCase("RAW"))) {
+
+ // Check if requested key spec is amongst the valid ones
+@@ -279,7 +280,7 @@
+ {
+ try {
+ if ((key != null) &&
+- (validTypes.contains(key.getAlgorithm().toUpperCase())) &&
++ (validTypes.contains(key.getAlgorithm().toUpperCase(Locale.ENGLISH))) &&
+ (key.getFormat().equalsIgnoreCase("RAW"))) {
+
+ // Check if key originates from this factory
+--- ./jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2005, 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
+@@ -30,7 +30,7 @@
+ import java.nio.CharBuffer;
+ import java.nio.charset.Charset;
+ import java.util.Arrays;
+-import java.security.MessageDigest;
++import java.util.Locale;
+ import java.security.KeyRep;
+ import java.security.GeneralSecurityException;
+ import java.security.NoSuchAlgorithmException;
+@@ -144,7 +144,7 @@
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(password) * 41 +
+- prf.getAlgorithm().toLowerCase().hashCode();
++ prf.getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode();
+ }
+ @Override
+ public boolean equals(Object obj) {
+@@ -153,7 +153,7 @@
+ SecretKey sk = (SecretKey)obj;
+ return prf.getAlgorithm().equalsIgnoreCase(
+ sk.getAlgorithm()) &&
+- MessageDigest.isEqual(password, sk.getEncoded());
++ Arrays.equals(password, sk.getEncoded());
+ }
+ };
+ prf.init(macKey);
+@@ -222,7 +222,7 @@
+ for (int i = 1; i < this.key.length; i++) {
+ retval += this.key[i] * i;
+ }
+- return(retval ^= getAlgorithm().toLowerCase().hashCode());
++ return(retval ^= getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode());
+ }
+
+ public boolean equals(Object obj) {
+@@ -239,7 +239,7 @@
+ if (!(that.getFormat().equalsIgnoreCase("RAW")))
+ return false;
+ byte[] thatEncoded = that.getEncoded();
+- boolean ret = MessageDigest.isEqual(key, that.getEncoded());
++ boolean ret = Arrays.equals(key, that.getEncoded());
+ java.util.Arrays.fill(thatEncoded, (byte)0x00);
+ return ret;
+ }
+--- ./jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -43,8 +43,6 @@
+
+ import java.awt.image.Raster;
+ import java.awt.image.WritableRaster;
+-import java.awt.image.SampleModel;
+-import java.awt.image.DataBuffer;
+ import java.awt.image.DataBufferByte;
+ import java.awt.image.ColorModel;
+ import java.awt.image.IndexColorModel;
+@@ -1048,7 +1046,13 @@
+
+ // Call the writer, who will call back for every scanline
+
+- processImageStarted(currentImage);
++ clearAbortRequest();
++ cbLock.lock();
++ try {
++ processImageStarted(currentImage);
++ } finally {
++ cbLock.unlock();
++ }
+
+ boolean aborted = false;
+
+@@ -1100,6 +1104,11 @@
+ currentImage++; // After a successful write
+ }
+
++ @Override
++ public boolean canWriteSequence() {
++ return true;
++ }
++
+ public void prepareWriteSequence(IIOMetadata streamMetadata)
+ throws IOException {
+ setThreadLock();
+@@ -1225,6 +1234,23 @@
+ }
+ }
+
++ @Override
++ protected synchronized void clearAbortRequest() {
++ setThreadLock();
++ try {
++ cbLock.check();
++ if (abortRequested()) {
++ super.clearAbortRequest();
++ // reset C structures
++ resetWriter(structPointer);
++ // reset the native destination
++ setDest(structPointer);
++ }
++ } finally {
++ clearThreadLock();
++ }
++ }
++
+ private void resetInternalState() {
+ // reset C structures
+ resetWriter(structPointer);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1495 @@
++/*
++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package com.sun.java.accessibility.util;
++
++import java.util.*;
++import java.awt.*;
++import java.awt.event.*;
++import javax.accessibility.*;
++import javax.swing.*;
++import javax.swing.event.*;
++import sun.security.util.SecurityConstants.AWT;
++
++/**
++ * <P>The {@code AWTEventMonitor} implements a suite of listeners that are
++ * conditionally installed on every AWT component instance in the Java
++ * Virtual Machine. The events captured by these listeners are made
++ * available through a unified set of listeners supported by {@code AWTEventMonitor}.
++ * With this, all the individual events on each of the AWT component
++ * instances are funneled into one set of listeners broken down by category
++ * (see {@link EventID} for the categories).
++ * <p>This class depends upon {@link EventQueueMonitor}, which provides the base
++ * level support for capturing the top-level containers as they are created.
++ */
++
++@jdk.Exported
++public class AWTEventMonitor {
++
++ static private boolean runningOnJDK1_4 = false;
++
++ /**
++ * The current component with keyboard focus.
++ *
++ * @see #getComponentWithFocus
++ *
++ * @deprecated This field is unused; to get the component with focus use the
++ * getComponentWithFocus method.
++ */
++ @Deprecated
++ static protected Component componentWithFocus = null;
++
++ static private Component componentWithFocus_private = null;
++
++ // Low-level listeners
++ /**
++ * The current list of registered ComponentListener classes.
++ *
++ * @see #addComponentListener
++ * @see #removeComponentListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected ComponentListener componentListener = null;
++
++ static private ComponentListener componentListener_private = null;
++
++ /**
++ * The current list of registered ContainerListener classes.
++ *
++ * @see #addContainerListener
++ * @see #removeContainerListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected ContainerListener containerListener = null;
++
++ static private ContainerListener containerListener_private = null;
++
++ /**
++ * The current list of registered FocusListener classes.
++ *
++ * @see #addFocusListener
++ * @see #removeFocusListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected FocusListener focusListener = null;
++
++ static private FocusListener focusListener_private = null;
++
++ /**
++ * The current list of registered KeyListener classes.
++ *
++ * @see #addKeyListener
++ * @see #removeKeyListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected KeyListener keyListener = null;
++
++ static private KeyListener keyListener_private = null;
++
++ /**
++ * The current list of registered MouseListener classes.
++ *
++ * @see #addMouseListener
++ * @see #removeMouseListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected MouseListener mouseListener = null;
++
++ static private MouseListener mouseListener_private = null;
++
++ /**
++ * The current list of registered MouseMotionListener classes.
++ *
++ * @see #addMouseMotionListener
++ * @see #removeMouseMotionListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected MouseMotionListener mouseMotionListener = null;
++
++ static private MouseMotionListener mouseMotionListener_private = null;
++
++ /**
++ * The current list of registered WindowListener classes.
++ *
++ * @see #addWindowListener
++ * @see #removeWindowListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected WindowListener windowListener = null;
++
++ static private WindowListener windowListener_private = null;
++
++
++ // Semantic listeners
++ /**
++ * The current list of registered ActionListener classes.
++ *
++ * @see #addActionListener
++ * @see #removeActionListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected ActionListener actionListener = null;
++
++ static private ActionListener actionListener_private = null;
++
++ /**
++ * The current list of registered AdjustmentListener classes.
++ *
++ * @see #addAdjustmentListener
++ * @see #removeAdjustmentListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected AdjustmentListener adjustmentListener = null;
++
++ static private AdjustmentListener adjustmentListener_private = null;
++
++ /**
++ * The current list of registered ItemListener classes.
++ *
++ * @see #addItemListener
++ * @see #removeItemListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected ItemListener itemListener = null;
++
++ static private ItemListener itemListener_private = null;
++
++ /**
++ * The current list of registered TextListener classes.
++ *
++ * @see #addTextListener
++ * @see #removeTextListener
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected TextListener textListener = null;
++
++ static private TextListener textListener_private = null;
++
++
++ /**
++ * The actual listener that is installed on the component instances.
++ * This listener calls the other registered listeners when an event
++ * occurs. By doing things this way, the actual number of listeners
++ * installed on a component instance is drastically reduced.
++ *
++ * @deprecated This field is unused.
++ */
++ @Deprecated
++ static protected AWTEventsListener awtListener = new AWTEventsListener();
++
++ static private final AWTEventsListener awtListener_private = new AWTEventsListener();
++
++ /**
++ * Returns the component that currently has keyboard focus. The return
++ * value can be null.
++ *
++ * @return the component that has keyboard focus
++ */
++ static public Component getComponentWithFocus() {
++ return componentWithFocus_private;
++ }
++
++ /*
++ * Check permissions
++ */
++ static private void checkInstallPermission() {
++ SecurityManager security = System.getSecurityManager();
++ if (security != null) {
++ security.checkPermission(AWT.ALL_AWT_EVENTS_PERMISSION);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#COMPONENT COMPONENT}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeComponentListener
++ */
++ static public void addComponentListener(ComponentListener l) {
++ if (componentListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.COMPONENT);
++ }
++ componentListener_private = AWTEventMulticaster.add(componentListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#COMPONENT COMPONENT} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addComponentListener
++ */
++ static public void removeComponentListener(ComponentListener l) {
++ componentListener_private = AWTEventMulticaster.remove(componentListener_private, l);
++ if (componentListener_private == null) {
++ awtListener_private.removeListeners(EventID.COMPONENT);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#CONTAINER CONTAINER}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeContainerListener
++ */
++ static public void addContainerListener(ContainerListener l) {
++ containerListener_private = AWTEventMulticaster.add(containerListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#CONTAINER CONTAINER} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addContainerListener
++ */
++ static public void removeContainerListener(ContainerListener l) {
++ containerListener_private = AWTEventMulticaster.remove(containerListener_private, l);
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#FOCUS FOCUS} events
++ * on each component instance in the Java Virtual Machine when they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeFocusListener
++ */
++ static public void addFocusListener(FocusListener l) {
++ focusListener_private = AWTEventMulticaster.add(focusListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives {@link EventID#FOCUS FOCUS}
++ * events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addFocusListener
++ */
++ static public void removeFocusListener(FocusListener l) {
++ focusListener_private = AWTEventMulticaster.remove(focusListener_private, l);
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#KEY KEY} events on each
++ * component instance in the Java Virtual Machine when they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeKeyListener
++ */
++ static public void addKeyListener(KeyListener l) {
++ if (keyListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.KEY);
++ }
++ keyListener_private = AWTEventMulticaster.add(keyListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives {@link EventID#KEY KEY}
++ * events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addKeyListener
++ */
++ static public void removeKeyListener(KeyListener l) {
++ keyListener_private = AWTEventMulticaster.remove(keyListener_private, l);
++ if (keyListener_private == null) {
++ awtListener_private.removeListeners(EventID.KEY);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#MOUSE MOUSE} events
++ * on each component instance in the Java Virtual Machine when they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeMouseListener
++ */
++ static public void addMouseListener(MouseListener l) {
++ if (mouseListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.MOUSE);
++ }
++ mouseListener_private = AWTEventMulticaster.add(mouseListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#MOUSE MOUSE} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addMouseListener
++ */
++ static public void removeMouseListener(MouseListener l) {
++ mouseListener_private = AWTEventMulticaster.remove(mouseListener_private, l);
++ if (mouseListener_private == null) {
++ awtListener_private.removeListeners(EventID.MOUSE);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all mouse {@link EventID#MOTION MOTION}
++ * events on each component instance in the Java Virtual Machine when they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeMouseMotionListener
++ */
++ static public void addMouseMotionListener(MouseMotionListener l) {
++ if (mouseMotionListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.MOTION);
++ }
++ mouseMotionListener_private = AWTEventMulticaster.add(mouseMotionListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#MOTION MOTION} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addMouseMotionListener
++ */
++ static public void removeMouseMotionListener(MouseMotionListener l) {
++ mouseMotionListener_private = AWTEventMulticaster.remove(mouseMotionListener_private, l);
++ if (mouseMotionListener_private == null) {
++ awtListener_private.removeListeners(EventID.MOTION);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#WINDOW WINDOW}
++ * events on each component instance in the Java Virtual Machine when they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeWindowListener
++ */
++ static public void addWindowListener(WindowListener l) {
++ if (windowListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.WINDOW);
++ }
++ windowListener_private = AWTEventMulticaster.add(windowListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#WINDOW WINDOW} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addWindowListener
++ */
++ static public void removeWindowListener(WindowListener l) {
++ windowListener_private = AWTEventMulticaster.remove(windowListener_private, l);
++ if (windowListener_private == null) {
++ awtListener_private.removeListeners(EventID.WINDOW);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#ACTION ACTION}
++ * events on each component instance in the Java Virtual Machine when they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeActionListener
++ */
++ static public void addActionListener(ActionListener l) {
++ if (actionListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.ACTION);
++ }
++ actionListener_private = AWTEventMulticaster.add(actionListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#ACTION ACTION} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addActionListener
++ */
++ static public void removeActionListener(ActionListener l) {
++ actionListener_private = AWTEventMulticaster.remove(actionListener_private, l);
++ if (actionListener_private == null) {
++ awtListener_private.removeListeners(EventID.ACTION);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all
++ * {@link EventID#ADJUSTMENT ADJUSTMENT} events on each component instance
++ * in the Java Virtual Machine when they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeAdjustmentListener
++ */
++ static public void addAdjustmentListener(AdjustmentListener l) {
++ if (adjustmentListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.ADJUSTMENT);
++ }
++ adjustmentListener_private = AWTEventMulticaster.add(adjustmentListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#ADJUSTMENT ADJUSTMENT} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addAdjustmentListener
++ */
++ static public void removeAdjustmentListener(AdjustmentListener l) {
++ adjustmentListener_private = AWTEventMulticaster.remove(adjustmentListener_private, l);
++ if (adjustmentListener_private == null) {
++ awtListener_private.removeListeners(EventID.ADJUSTMENT);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#ITEM ITEM} events
++ * on each component instance in the Java Virtual Machine when they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeItemListener
++ */
++ static public void addItemListener(ItemListener l) {
++ if (itemListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.ITEM);
++ }
++ itemListener_private = AWTEventMulticaster.add(itemListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives {@link EventID#ITEM ITEM}
++ * events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addItemListener
++ */
++ static public void removeItemListener(ItemListener l) {
++ itemListener_private = AWTEventMulticaster.remove(itemListener_private, l);
++ if (itemListener_private == null) {
++ awtListener_private.removeListeners(EventID.ITEM);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#TEXT TEXT} events
++ * on each component instance in the Java Virtual Machine when they occur.
++ * <P>Note: this listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeTextListener
++ */
++ static public void addTextListener(TextListener l) {
++ if (textListener_private == null) {
++ checkInstallPermission();
++ awtListener_private.installListeners(EventID.TEXT);
++ }
++ textListener_private = AWTEventMulticaster.add(textListener_private, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives {@link EventID#TEXT TEXT}
++ * events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addTextListener
++ */
++ static public void removeTextListener(TextListener l) {
++ textListener_private = AWTEventMulticaster.remove(textListener_private, l);
++ if (textListener_private == null) {
++ awtListener_private.removeListeners(EventID.TEXT);
++ }
++ }
++
++
++ /**
++ * AWTEventsListener is the class that does all the work for AWTEventMonitor.
++ * It is not intended for use by any other class except AWTEventMonitor.
++ *
++ */
++
++ static class AWTEventsListener implements TopLevelWindowListener,
++ ActionListener, AdjustmentListener, ComponentListener,
++ ContainerListener, FocusListener, ItemListener, KeyListener,
++ MouseListener, MouseMotionListener, TextListener, WindowListener,
++ ChangeListener {
++
++ /**
++ * internal variables for Action introspection
++ */
++ private java.lang.Class actionListeners[];
++ private java.lang.reflect.Method removeActionMethod;
++ private java.lang.reflect.Method addActionMethod;
++ private java.lang.Object actionArgs[];
++
++ /**
++ * internal variables for Item introspection
++ */
++ private java.lang.Class itemListeners[];
++ private java.lang.reflect.Method removeItemMethod;
++ private java.lang.reflect.Method addItemMethod;
++ private java.lang.Object itemArgs[];
++
++ /**
++ * internal variables for Text introspection
++ */
++ private java.lang.Class textListeners[];
++ private java.lang.reflect.Method removeTextMethod;
++ private java.lang.reflect.Method addTextMethod;
++ private java.lang.Object textArgs[];
++
++ /**
++ * internal variables for Window introspection
++ */
++ private java.lang.Class windowListeners[];
++ private java.lang.reflect.Method removeWindowMethod;
++ private java.lang.reflect.Method addWindowMethod;
++ private java.lang.Object windowArgs[];
++
++ /**
++ * Create a new instance of this class and install it on each component
++ * instance in the virtual machine that supports any of the currently
++ * registered listeners in AWTEventMonitor. Also registers itself
++ * as a TopLevelWindowListener with EventQueueMonitor so it can
++ * automatically add new listeners to new components.
++ *
++ * @see EventQueueMonitor
++ * @see AWTEventMonitor
++ */
++ public AWTEventsListener() {
++ String version = System.getProperty("java.version");
++ if (version != null) {
++ runningOnJDK1_4 = (version.compareTo("1.4") >= 0);
++ }
++ initializeIntrospection();
++ installListeners();
++ if (runningOnJDK1_4) {
++ MenuSelectionManager.defaultManager().addChangeListener(this);
++ }
++ EventQueueMonitor.addTopLevelWindowListener(this);
++ }
++
++ /**
++ * Set up all of the variables needed for introspection
++ */
++ private boolean initializeIntrospection() {
++ try {
++ actionListeners = new java.lang.Class[1];
++ actionArgs = new java.lang.Object[1];
++ actionListeners[0] = Class.forName("java.awt.event.ActionListener");
++ actionArgs[0] = this;
++
++ itemListeners = new java.lang.Class[1];
++ itemArgs = new java.lang.Object[1];
++ itemListeners[0] = Class.forName("java.awt.event.ItemListener");
++ itemArgs[0] = this;
++
++ textListeners = new java.lang.Class[1];
++ textArgs = new java.lang.Object[1];
++ textListeners[0] = Class.forName("java.awt.event.TextListener");
++ textArgs[0] = this;
++
++ windowListeners = new java.lang.Class[1];
++ windowArgs = new java.lang.Object[1];
++ windowListeners[0] = Class.forName("java.awt.event.WindowListener");
++ windowArgs[0] = this;
++
++ return true;
++ } catch (ClassNotFoundException e) {
++ System.out.println("EXCEPTION - Class 'java.awt.event.*' not in CLASSPATH");
++ return false;
++ }
++ }
++
++ /**
++ * Installs all currently registered listeners on all components based
++ * upon the current topLevelWindows cached by EventQueueMonitor.
++ * @see EventQueueMonitor
++ * @see AWTEventMonitor
++ */
++ protected void installListeners() {
++ Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
++ if (topLevelWindows != null) {
++ for (int i = 0; i < topLevelWindows.length; i++) {
++ installListeners(topLevelWindows[i]);
++ }
++ }
++ }
++
++ /**
++ * Installs listeners for the given event ID on all components based
++ * upon the current topLevelWindows cached by EventQueueMonitor.
++ * @see EventID
++ * @param eventID the event ID
++ */
++ protected void installListeners(int eventID) {
++ Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
++ if (topLevelWindows != null) {
++ for (int i = 0; i < topLevelWindows.length; i++) {
++ installListeners(topLevelWindows[i], eventID);
++ }
++ }
++ }
++
++ /**
++ * Installs all currently registered listeners to just the component.
++ * @param c the component to add listeners to
++ */
++ protected void installListeners(Component c) {
++
++ // Container and focus listeners are always installed for our own use.
++ //
++ installListeners(c,EventID.CONTAINER);
++ installListeners(c,EventID.FOCUS);
++
++ // conditionally install low-level listeners
++ //
++ if (AWTEventMonitor.componentListener_private != null) {
++ installListeners(c,EventID.COMPONENT);
++ }
++ if (AWTEventMonitor.keyListener_private != null) {
++ installListeners(c,EventID.KEY);
++ }
++ if (AWTEventMonitor.mouseListener_private != null) {
++ installListeners(c,EventID.MOUSE);
++ }
++ if (AWTEventMonitor.mouseMotionListener_private != null) {
++ installListeners(c,EventID.MOTION);
++ }
++ if (AWTEventMonitor.windowListener_private != null) {
++ installListeners(c,EventID.WINDOW);
++ }
++
++ // conditionally install Semantic listeners
++ //
++ if (AWTEventMonitor.actionListener_private != null) {
++ installListeners(c,EventID.ACTION);
++ }
++ if (AWTEventMonitor.adjustmentListener_private != null) {
++ installListeners(c,EventID.ADJUSTMENT);
++ }
++ if (AWTEventMonitor.itemListener_private != null) {
++ installListeners(c,EventID.ITEM);
++ }
++ if (AWTEventMonitor.textListener_private != null) {
++ installListeners(c,EventID.TEXT);
++ }
++ }
++
++ public void stateChanged(ChangeEvent e) {
++ processFocusGained();
++ }
++
++ private void processFocusGained() {
++ Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
++ if (focusOwner == null) {
++ return;
++ }
++ MenuSelectionManager.defaultManager().removeChangeListener(this);
++ MenuSelectionManager.defaultManager().addChangeListener(this);
++
++ // Only menus and popup selections are handled by the JRootPane.
++ if (focusOwner instanceof JRootPane) {
++ MenuElement [] path =
++ MenuSelectionManager.defaultManager().getSelectedPath();
++ if (path.length > 1) {
++ Component penult = path[path.length-2].getComponent();
++ Component last = path[path.length-1].getComponent();
++
++ if (last instanceof JPopupMenu ||
++ last instanceof JMenu) {
++ // This is a popup with nothing in the popup
++ // selected. The menu itself is selected.
++ componentWithFocus_private = last;
++ } else if (penult instanceof JPopupMenu) {
++ // This is a popup with an item selected
++ componentWithFocus_private = penult;
++ }
++ }
++ } else {
++ // The focus owner has the selection.
++ componentWithFocus_private = focusOwner;
++ }
++ }
++
++ /**
++ * Installs the given listener on the component and any of its children.
++ * As a precaution, it always attempts to remove itself as a listener
++ * first so it's always guaranteed to have installed itself just once.
++ * @param c the component to add listeners to
++ * @param eventID the eventID to add listeners for
++ * @see EventID
++ */
++ protected void installListeners(Component c, int eventID) {
++
++ // install the appropriate listener hook into this component
++ //
++ switch (eventID) {
++
++ case EventID.ACTION:
++ try {
++ removeActionMethod = c.getClass().getMethod(
++ "removeActionListener", actionListeners);
++ addActionMethod = c.getClass().getMethod(
++ "addActionListener", actionListeners);
++ try {
++ removeActionMethod.invoke(c, actionArgs);
++ addActionMethod.invoke(c, actionArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.ADJUSTMENT:
++ if (c instanceof Adjustable) {
++ ((Adjustable) c).removeAdjustmentListener(this);
++ ((Adjustable) c).addAdjustmentListener(this);
++ }
++ break;
++
++ case EventID.COMPONENT:
++ c.removeComponentListener(this);
++ c.addComponentListener(this);
++ break;
++
++ case EventID.CONTAINER:
++ if (c instanceof Container) {
++ ((Container) c).removeContainerListener(this);
++ ((Container) c).addContainerListener(this);
++ }
++ break;
++
++ case EventID.FOCUS:
++ c.removeFocusListener(this);
++ c.addFocusListener(this);
++
++ if (runningOnJDK1_4) {
++ processFocusGained();
++
++ } else { // not runningOnJDK1_4
++ if ((c != componentWithFocus_private) && c.hasFocus()) {
++ componentWithFocus_private = c;
++ }
++ }
++ break;
++
++ case EventID.ITEM:
++ try {
++ removeItemMethod = c.getClass().getMethod(
++ "removeItemListener", itemListeners);
++ addItemMethod = c.getClass().getMethod(
++ "addItemListener", itemListeners);
++ try {
++ removeItemMethod.invoke(c, itemArgs);
++ addItemMethod.invoke(c, itemArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ // [PK] CheckboxMenuItem isn't a component but it does
++ // implement Interface ItemSelectable!!
++ // if (c instanceof CheckboxMenuItem) {
++ // ((CheckboxMenuItem) c).removeItemListener(this);
++ // ((CheckboxMenuItem) c).addItemListener(this);
++ break;
++
++ case EventID.KEY:
++ c.removeKeyListener(this);
++ c.addKeyListener(this);
++ break;
++
++ case EventID.MOUSE:
++ c.removeMouseListener(this);
++ c.addMouseListener(this);
++ break;
++
++ case EventID.MOTION:
++ c.removeMouseMotionListener(this);
++ c.addMouseMotionListener(this);
++ break;
++
++ case EventID.TEXT:
++ try {
++ removeTextMethod = c.getClass().getMethod(
++ "removeTextListener", textListeners);
++ addTextMethod = c.getClass().getMethod(
++ "addTextListener", textListeners);
++ try {
++ removeTextMethod.invoke(c, textArgs);
++ addTextMethod.invoke(c, textArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.WINDOW:
++ try {
++ removeWindowMethod = c.getClass().getMethod(
++ "removeWindowListener", windowListeners);
++ addWindowMethod = c.getClass().getMethod(
++ "addWindowListener", windowListeners);
++ try {
++ removeWindowMethod.invoke(c, windowArgs);
++ addWindowMethod.invoke(c, windowArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ // Don't bother recursing the children if this isn't going to
++ // accomplish anything.
++ //
++ default:
++ return;
++ }
++
++ // if this component is a container, recurse through children
++ //
++ if (c instanceof Container) {
++ int count = ((Container) c).getComponentCount();
++ for (int i = 0; i < count; i++) {
++ installListeners(((Container) c).getComponent(i), eventID);
++ }
++ }
++ }
++
++ /**
++ * Removes all listeners for the given event ID on all components based
++ * upon the topLevelWindows cached by EventQueueMonitor.
++ * @param eventID the event ID
++ * @see EventID
++ */
++ protected void removeListeners(int eventID) {
++ Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
++ if (topLevelWindows != null) {
++ for (int i = 0; i < topLevelWindows.length; i++) {
++ removeListeners(topLevelWindows[i], eventID);
++ }
++ }
++ }
++
++ /**
++ * Removes all listeners for the given component and all its children.
++ * @param c the component
++ */
++ protected void removeListeners(Component c) {
++
++ // conditionally remove low-level listeners
++ //
++ if (AWTEventMonitor.componentListener_private != null) {
++ removeListeners(c,EventID.COMPONENT);
++ }
++ if (AWTEventMonitor.keyListener_private != null) {
++ removeListeners(c,EventID.KEY);
++ }
++ if (AWTEventMonitor.mouseListener_private != null) {
++ removeListeners(c,EventID.MOUSE);
++ }
++ if (AWTEventMonitor.mouseMotionListener_private != null) {
++ removeListeners(c,EventID.MOTION);
++ }
++ if (AWTEventMonitor.windowListener_private != null) {
++ removeListeners(c,EventID.WINDOW);
++ }
++
++ // Remove semantic listeners
++ //
++ if (AWTEventMonitor.actionListener_private != null) {
++ removeListeners(c,EventID.ACTION);
++ }
++ if (AWTEventMonitor.adjustmentListener_private != null) {
++ removeListeners(c,EventID.ADJUSTMENT);
++ }
++ if (AWTEventMonitor.itemListener_private != null) {
++ removeListeners(c,EventID.ITEM);
++ }
++ if (AWTEventMonitor.textListener_private != null) {
++ removeListeners(c,EventID.TEXT);
++ }
++ }
++
++ /**
++ * Removes all listeners for the event ID from the component and all
++ * of its children.
++ * @param c the component to remove listeners from
++ * @see EventID
++ */
++ protected void removeListeners(Component c, int eventID) {
++
++ // remove the appropriate listener hook into this component
++ //
++ switch (eventID) {
++
++ case EventID.ACTION:
++ try {
++ removeActionMethod = c.getClass().getMethod(
++ "removeActionListener",
++ actionListeners);
++ try {
++ removeActionMethod.invoke(c, actionArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.ADJUSTMENT:
++ if (c instanceof Adjustable) {
++ ((Adjustable) c).removeAdjustmentListener(this);
++ }
++ break;
++
++ case EventID.COMPONENT:
++ c.removeComponentListener(this);
++ break;
++
++ // Never remove these because we're always interested in them
++ // for our own use.
++ //case EventID.CONTAINER:
++ // if (c instanceof Container) {
++ // ((Container) c).removeContainerListener(this);
++ // }
++ // break;
++ //
++ //case EventID.FOCUS:
++ // c.removeFocusListener(this);
++ // break;
++
++ case EventID.ITEM:
++ try {
++ removeItemMethod = c.getClass().getMethod(
++ "removeItemListener", itemListeners);
++ try {
++ removeItemMethod.invoke(c, itemArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ // [PK] CheckboxMenuItem isn't a component but it does
++ // implement Interface ItemSelectable!!
++ // if (c instanceof CheckboxMenuItem) {
++ // ((CheckboxMenuItem) c).removeItemListener(this);
++ break;
++
++ case EventID.KEY:
++ c.removeKeyListener(this);
++ break;
++
++ case EventID.MOUSE:
++ c.removeMouseListener(this);
++ break;
++
++ case EventID.MOTION:
++ c.removeMouseMotionListener(this);
++ break;
++
++ case EventID.TEXT:
++ try {
++ removeTextMethod = c.getClass().getMethod(
++ "removeTextListener", textListeners);
++ try {
++ removeTextMethod.invoke(c, textArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.WINDOW:
++ try {
++ removeWindowMethod = c.getClass().getMethod(
++ "removeWindowListener", windowListeners);
++ try {
++ removeWindowMethod.invoke(c, windowArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ default:
++ return;
++ }
++
++ if (c instanceof Container) {
++ int count = ((Container) c).getComponentCount();
++ for (int i = 0; i < count; i++) {
++ removeListeners(((Container) c).getComponent(i), eventID);
++ }
++ }
++ }
++
++ /********************************************************************/
++ /* */
++ /* Listener Interface Methods */
++ /* */
++ /********************************************************************/
++
++ /* TopLevelWindow Methods ***************************************/
++
++ /**
++ * Called when top level window is created.
++ * @see EventQueueMonitor
++ * @see EventQueueMonitor#addTopLevelWindowListener
++ */
++ public void topLevelWindowCreated(Window w) {
++ installListeners(w);
++ }
++
++ /**
++ * Called when top level window is destroyed.
++ * @see EventQueueMonitor
++ * @see EventQueueMonitor#addTopLevelWindowListener
++ */
++ public void topLevelWindowDestroyed(Window w) {
++ }
++
++ /* ActionListener Methods ***************************************/
++
++ /**
++ * Called when an action is performed.
++ * @see AWTEventMonitor#addActionListener
++ */
++ public void actionPerformed(ActionEvent e) {
++ if (AWTEventMonitor.actionListener_private != null) {
++ AWTEventMonitor.actionListener_private.actionPerformed(e);
++ }
++ }
++
++ /* AdjustmentListener Methods ***********************************/
++
++ /**
++ * Called when an adjustment is made.
++ * @see AWTEventMonitor#addAdjustmentListener
++ */
++ public void adjustmentValueChanged(AdjustmentEvent e) {
++ if (AWTEventMonitor.adjustmentListener_private != null) {
++ AWTEventMonitor.adjustmentListener_private.adjustmentValueChanged(e);
++ }
++ }
++
++ /* ComponentListener Methods ************************************/
++
++ /**
++ * Called when a component is hidden.
++ * @see AWTEventMonitor#addComponentListener
++ */
++ public void componentHidden(ComponentEvent e) {
++ if (AWTEventMonitor.componentListener_private != null) {
++ AWTEventMonitor.componentListener_private.componentHidden(e);
++ }
++ }
++
++ /**
++ * Called when a component is moved.
++ * @see AWTEventMonitor#addComponentListener
++ */
++ public void componentMoved(ComponentEvent e) {
++ if (AWTEventMonitor.componentListener_private != null) {
++ AWTEventMonitor.componentListener_private.componentMoved(e);
++ }
++ }
++
++ /**
++ * Called when a component is resized.
++ * @see AWTEventMonitor#addComponentListener
++ */
++ public void componentResized(ComponentEvent e) {
++ if (AWTEventMonitor.componentListener_private != null) {
++ AWTEventMonitor.componentListener_private.componentResized(e);
++ }
++ }
++
++ /**
++ * Called when a component is shown.
++ * @see AWTEventMonitor#addComponentListener
++ */
++ public void componentShown(ComponentEvent e) {
++ if (AWTEventMonitor.componentListener_private != null) {
++ AWTEventMonitor.componentListener_private.componentShown(e);
++ }
++ }
++
++ /* ContainerListener Methods ************************************/
++
++ /**
++ * Called when a component is added to a container.
++ * @see AWTEventMonitor#addContainerListener
++ */
++ public void componentAdded(ContainerEvent e) {
++ installListeners(e.getChild());
++ if (AWTEventMonitor.containerListener_private != null) {
++ AWTEventMonitor.containerListener_private.componentAdded(e);
++ }
++ }
++
++ /**
++ * Called when a component is removed from a container.
++ * @see AWTEventMonitor#addContainerListener
++ */
++ public void componentRemoved(ContainerEvent e) {
++ removeListeners(e.getChild());
++ if (AWTEventMonitor.containerListener_private != null) {
++ AWTEventMonitor.containerListener_private.componentRemoved(e);
++ }
++ }
++
++ /* FocusListener Methods ****************************************/
++
++ /**
++ * Called when a component gains keyboard focus.
++ * @see AWTEventMonitor#addFocusListener
++ */
++ public void focusGained(FocusEvent e) {
++ AWTEventMonitor.componentWithFocus_private = (Component) e.getSource();
++ if (AWTEventMonitor.focusListener_private != null) {
++ AWTEventMonitor.focusListener_private.focusGained(e);
++ }
++ }
++
++ /**
++ * Called when a component loses keyboard focus.
++ * @see AWTEventMonitor#addFocusListener
++ */
++ public void focusLost(FocusEvent e) {
++ AWTEventMonitor.componentWithFocus_private = null;
++ if (AWTEventMonitor.focusListener_private != null) {
++ AWTEventMonitor.focusListener_private.focusLost(e);
++ }
++ }
++
++ /* ItemListener Methods *****************************************/
++
++ /**
++ * Called when an item's state changes.
++ * @see AWTEventMonitor#addItemListener
++ */
++ public void itemStateChanged(ItemEvent e) {
++ if (AWTEventMonitor.itemListener_private != null) {
++ AWTEventMonitor.itemListener_private.itemStateChanged(e);
++ }
++ }
++
++ /* KeyListener Methods ******************************************/
++
++ /**
++ * Called when a key is pressed.
++ * @see AWTEventMonitor#addKeyListener
++ */
++ public void keyPressed(KeyEvent e) {
++ if (AWTEventMonitor.keyListener_private != null) {
++ AWTEventMonitor.keyListener_private.keyPressed(e);
++ }
++ }
++
++ /**
++ * Called when a key is typed.
++ * @see AWTEventMonitor#addKeyListener
++ */
++ public void keyReleased(KeyEvent e) {
++ if (AWTEventMonitor.keyListener_private != null) {
++ AWTEventMonitor.keyListener_private.keyReleased(e);
++ }
++ }
++
++ /**
++ * Called when a key is released.
++ * @see AWTEventMonitor#addKeyListener
++ */
++ public void keyTyped(KeyEvent e) {
++ if (AWTEventMonitor.keyListener_private != null) {
++ AWTEventMonitor.keyListener_private.keyTyped(e);
++ }
++ }
++
++ /* MouseListener Methods ****************************************/
++
++ /**
++ * Called when the mouse is clicked.
++ * @see AWTEventMonitor#addMouseListener
++ */
++ public void mouseClicked(MouseEvent e) {
++ if (AWTEventMonitor.mouseListener_private != null) {
++ AWTEventMonitor.mouseListener_private.mouseClicked(e);
++ }
++ }
++
++ /**
++ * Called when the mouse enters a component.
++ * @see AWTEventMonitor#addMouseListener
++ */
++ public void mouseEntered(MouseEvent e) {
++ if (AWTEventMonitor.mouseListener_private != null) {
++ AWTEventMonitor.mouseListener_private.mouseEntered(e);
++ }
++ }
++
++ /**
++ * Called when the mouse leaves a component.
++ * @see AWTEventMonitor#addMouseListener
++ */
++ public void mouseExited(MouseEvent e) {
++ if (AWTEventMonitor.mouseListener_private != null) {
++ AWTEventMonitor.mouseListener_private.mouseExited(e);
++ }
++ }
++
++ /**
++ * Called when the mouse is pressed.
++ * @see AWTEventMonitor#addMouseListener
++ */
++ public void mousePressed(MouseEvent e) {
++ if (AWTEventMonitor.mouseListener_private != null) {
++ AWTEventMonitor.mouseListener_private.mousePressed(e);
++ }
++ }
++
++ /**
++ * Called when the mouse is released.
++ * @see AWTEventMonitor#addMouseListener
++ */
++ public void mouseReleased(MouseEvent e) {
++ if (AWTEventMonitor.mouseListener_private != null) {
++ AWTEventMonitor.mouseListener_private.mouseReleased(e);
++ }
++ }
++
++ /* MouseMotionListener Methods **********************************/
++
++ /**
++ * Called when the mouse is dragged.
++ * @see AWTEventMonitor#addMouseMotionListener
++ */
++ public void mouseDragged(MouseEvent e) {
++ if (AWTEventMonitor.mouseMotionListener_private != null) {
++ AWTEventMonitor.mouseMotionListener_private.mouseDragged(e);
++ }
++ }
++
++ /**
++ * Called when the mouse is moved.
++ * @see AWTEventMonitor#addMouseMotionListener
++ */
++ public void mouseMoved(MouseEvent e) {
++ if (AWTEventMonitor.mouseMotionListener_private != null) {
++ AWTEventMonitor.mouseMotionListener_private.mouseMoved(e);
++ }
++ }
++
++ /* TextListener Methods *****************************************/
++
++ /**
++ * Called when a component's text value changed.
++ * @see AWTEventMonitor#addTextListener
++ */
++ public void textValueChanged(TextEvent e) {
++ if (AWTEventMonitor.textListener_private != null) {
++ AWTEventMonitor.textListener_private.textValueChanged(e);
++ }
++ }
++
++ /* WindowListener Methods ***************************************/
++
++ /**
++ * Called when a window is opened.
++ * @see AWTEventMonitor#addWindowListener
++ */
++ public void windowOpened(WindowEvent e) {
++ if (AWTEventMonitor.windowListener_private != null) {
++ AWTEventMonitor.windowListener_private.windowOpened(e);
++ }
++ }
++
++ /**
++ * Called when a window is in the process of closing.
++ * @see AWTEventMonitor#addWindowListener
++ */
++ public void windowClosing(WindowEvent e) {
++ if (AWTEventMonitor.windowListener_private != null) {
++ AWTEventMonitor.windowListener_private.windowClosing(e);
++ }
++ }
++
++ /**
++ * Called when a window is closed.
++ * @see AWTEventMonitor#addWindowListener
++ */
++ public void windowClosed(WindowEvent e) {
++ if (AWTEventMonitor.windowListener_private != null) {
++ AWTEventMonitor.windowListener_private.windowClosed(e);
++ }
++ }
++
++ /**
++ * Called when a window is iconified.
++ * @see AWTEventMonitor#addWindowListener
++ */
++ public void windowIconified(WindowEvent e) {
++ if (AWTEventMonitor.windowListener_private != null) {
++ AWTEventMonitor.windowListener_private.windowIconified(e);
++ }
++ }
++
++ /**
++ * Called when a window is deiconified.
++ * @see AWTEventMonitor#addWindowListener
++ */
++ public void windowDeiconified(WindowEvent e) {
++ if (AWTEventMonitor.windowListener_private != null) {
++ AWTEventMonitor.windowListener_private.windowDeiconified(e);
++ }
++ }
++
++ /**
++ * Called when a window is activated.
++ * @see AWTEventMonitor#addWindowListener
++ */
++ public void windowActivated(WindowEvent e) {
++ if (AWTEventMonitor.windowListener_private != null) {
++ AWTEventMonitor.windowListener_private.windowActivated(e);
++ }
++ }
++
++ /**
++ * Called when a window is deactivated.
++ * @see AWTEventMonitor#addWindowListener
++ */
++ public void windowDeactivated(WindowEvent e) {
++ if (AWTEventMonitor.windowListener_private != null) {
++ AWTEventMonitor.windowListener_private.windowDeactivated(e);
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,376 @@
++/*
++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package com.sun.java.accessibility.util;
++
++import java.util.*;
++import java.beans.*;
++import java.awt.*;
++import java.awt.event.*;
++import javax.accessibility.*;
++
++/**
++ * <P>{@code AccessibilityEventMonitor} implements a PropertyChange listener
++ * on every UI object that implements interface {@code Accessible} in the Java
++ * Virtual Machine. The events captured by these listeners are made available
++ * through listeners supported by {@code AccessibilityEventMonitor}.
++ * With this, all the individual events on each of the UI object
++ * instances are funneled into one set of PropertyChange listeners.
++ * <p>This class depends upon {@link EventQueueMonitor}, which provides the base
++ * level support for capturing the top-level containers as they are created.
++ *
++ */
++
++@jdk.Exported
++public class AccessibilityEventMonitor {
++
++ // listeners
++ /**
++ * The current list of registered {@link java.beans.PropertyChangeListener
++ * PropertyChangeListener} classes.
++ *
++ * @see #addPropertyChangeListener
++ * @see #removePropertyChangeListener
++ */
++ static protected final AccessibilityListenerList listenerList =
++ new AccessibilityListenerList();
++
++
++ /**
++ * The actual listener that is installed on the component instances.
++ * This listener calls the other registered listeners when an event
++ * occurs. By doing things this way, the actual number of listeners
++ * installed on a component instance is drastically reduced.
++ */
++ static protected final AccessibilityEventListener accessibilityListener =
++ new AccessibilityEventListener();
++
++ /**
++ * Adds the specified listener to receive all PropertyChange events on
++ * each UI object instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to UI object instances that support this listener type.
++ *
++ * @param l the listener to add
++ *
++ * @see #removePropertyChangeListener
++ */
++ static public void addPropertyChangeListener(PropertyChangeListener l) {
++ if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
++ accessibilityListener.installListeners();
++ }
++ listenerList.add(PropertyChangeListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives PropertyChange
++ * events when they occur.
++ * @see #addPropertyChangeListener
++ * @param l the listener to remove
++ */
++ static public void removePropertyChangeListener(PropertyChangeListener l) {
++ listenerList.remove(PropertyChangeListener.class, l);
++ if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
++ accessibilityListener.removeListeners();
++ }
++ }
++
++
++ /**
++ * AccessibilityEventListener is the class that does all the work for
++ * AccessibilityEventMonitor. It is not intended for use by any other
++ * class except AccessibilityEventMonitor.
++ *
++ */
++
++ static class AccessibilityEventListener implements TopLevelWindowListener,
++ PropertyChangeListener {
++
++ /**
++ * Create a new instance of this class and install it on each component
++ * instance in the virtual machine that supports any of the currently
++ * registered listeners in AccessibilityEventMonitor. Also registers
++ * itself as a TopLevelWindowListener with EventQueueMonitor so it can
++ * automatically add new listeners to new components.
++ * @see EventQueueMonitor
++ * @see AccessibilityEventMonitor
++ */
++ public AccessibilityEventListener() {
++ EventQueueMonitor.addTopLevelWindowListener(this);
++ }
++
++ /**
++ * Installs PropertyChange listeners on all Accessible objects based
++ * upon the current topLevelWindows cached by EventQueueMonitor.
++ * @see EventQueueMonitor
++ * @see AWTEventMonitor
++ */
++ protected void installListeners() {
++ Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
++ if (topLevelWindows != null) {
++ for (int i = 0; i < topLevelWindows.length; i++) {
++ if (topLevelWindows[i] instanceof Accessible) {
++ installListeners((Accessible) topLevelWindows[i]);
++ }
++ }
++ }
++ }
++
++ /**
++ * Installs PropertyChange listeners to the Accessible object, and it's
++ * children (so long as the object isn't of TRANSIENT state).
++ * @param a the Accessible object to add listeners to
++ */
++ protected void installListeners(Accessible a) {
++ installListeners(a.getAccessibleContext());
++ }
++
++ /**
++ * Installs PropertyChange listeners to the AccessibleContext object,
++ * and it's * children (so long as the object isn't of TRANSIENT state).
++ * @param a the Accessible object to add listeners to
++ */
++ private void installListeners(AccessibleContext ac) {
++
++ if (ac != null) {
++ AccessibleStateSet states = ac.getAccessibleStateSet();
++ if (!states.contains(AccessibleState.TRANSIENT)) {
++ ac.addPropertyChangeListener(this);
++ /*
++ * Don't add listeners to transient children. Components
++ * with transient children should return an AccessibleStateSet
++ * containing AccessibleState.MANAGES_DESCENDANTS. Components
++ * may not explicitly return the MANAGES_DESCENDANTS state.
++ * In this case, don't add listeners to the children of
++ * lists, tables and trees.
++ */
++ AccessibleStateSet set = ac.getAccessibleStateSet();
++ if (set.contains(_AccessibleState.MANAGES_DESCENDANTS)) {
++ return;
++ }
++ AccessibleRole role = ac.getAccessibleRole();
++ if (role == AccessibleRole.LIST ||
++ role == AccessibleRole.TREE) {
++ return;
++ }
++ if (role == AccessibleRole.TABLE) {
++ // handle Oracle tables containing tables
++ Accessible child = ac.getAccessibleChild(0);
++ if (child != null) {
++ AccessibleContext ac2 = child.getAccessibleContext();
++ if (ac2 != null) {
++ role = ac2.getAccessibleRole();
++ if (role != null && role != AccessibleRole.TABLE) {
++ return;
++ }
++ }
++ }
++ }
++ int count = ac.getAccessibleChildrenCount();
++ for (int i = 0; i < count; i++) {
++ Accessible child = ac.getAccessibleChild(i);
++ if (child != null) {
++ installListeners(child);
++ }
++ }
++ }
++ }
++ }
++
++ /**
++ * Removes PropertyChange listeners on all Accessible objects based
++ * upon the topLevelWindows cached by EventQueueMonitor.
++ * @param eventID the event ID
++ * @see EventID
++ */
++ protected void removeListeners() {
++ Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
++ if (topLevelWindows != null) {
++ for (int i = 0; i < topLevelWindows.length; i++) {
++ if (topLevelWindows[i] instanceof Accessible) {
++ removeListeners((Accessible) topLevelWindows[i]);
++ }
++ }
++ }
++ }
++
++ /**
++ * Removes PropertyChange listeners for the given Accessible object,
++ * it's children (so long as the object isn't of TRANSIENT state).
++ * @param a the Accessible object to remove listeners from
++ */
++ protected void removeListeners(Accessible a) {
++ removeListeners(a.getAccessibleContext());
++ }
++
++ /**
++ * Removes PropertyChange listeners for the given AccessibleContext
++ * object, it's children (so long as the object isn't of TRANSIENT
++ * state).
++ * @param a the Accessible object to remove listeners from
++ */
++ private void removeListeners(AccessibleContext ac) {
++
++
++ if (ac != null) {
++ // Listeners are not added to transient components.
++ AccessibleStateSet states = ac.getAccessibleStateSet();
++ if (!states.contains(AccessibleState.TRANSIENT)) {
++ ac.removePropertyChangeListener(this);
++ /*
++ * Listeners are not added to transient children. Components
++ * with transient children should return an AccessibleStateSet
++ * containing AccessibleState.MANAGES_DESCENDANTS. Components
++ * may not explicitly return the MANAGES_DESCENDANTS state.
++ * In this case, don't remove listeners from the children of
++ * lists, tables and trees.
++ */
++ if (states.contains(_AccessibleState.MANAGES_DESCENDANTS)) {
++ return;
++ }
++ AccessibleRole role = ac.getAccessibleRole();
++ if (role == AccessibleRole.LIST ||
++ role == AccessibleRole.TABLE ||
++ role == AccessibleRole.TREE) {
++ return;
++ }
++ int count = ac.getAccessibleChildrenCount();
++ for (int i = 0; i < count; i++) {
++ Accessible child = ac.getAccessibleChild(i);
++ if (child != null) {
++ removeListeners(child);
++ }
++ }
++ }
++ }
++ }
++
++ /********************************************************************/
++ /* */
++ /* Listener Interface Methods */
++ /* */
++ /********************************************************************/
++
++ /* TopLevelWindow Methods ***************************************/
++
++ /**
++ * Called when top level window is created.
++ * @see EventQueueMonitor
++ * @see EventQueueMonitor#addTopLevelWindowListener
++ */
++ public void topLevelWindowCreated(Window w) {
++ if (w instanceof Accessible) {
++ installListeners((Accessible) w);
++ }
++ }
++
++ /**
++ * Called when top level window is destroyed.
++ * @see EventQueueMonitor
++ * @see EventQueueMonitor#addTopLevelWindowListener
++ */
++ public void topLevelWindowDestroyed(Window w) {
++ if (w instanceof Accessible) {
++ removeListeners((Accessible) w);
++ }
++ }
++
++
++ /* PropertyChangeListener Methods **************************************/
++
++ public void propertyChange(PropertyChangeEvent e) {
++ // propogate the event
++ Object[] listeners =
++ AccessibilityEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==PropertyChangeListener.class) {
++ ((PropertyChangeListener)listeners[i+1]).propertyChange(e);
++ }
++ }
++
++ // handle childbirth/death
++ String name = e.getPropertyName();
++ if (name.compareTo(AccessibleContext.ACCESSIBLE_CHILD_PROPERTY) == 0) {
++ Object oldValue = e.getOldValue();
++ Object newValue = e.getNewValue();
++
++ if ((oldValue == null) ^ (newValue == null)) { // one null, not both
++ if (oldValue != null) {
++ // this Accessible is a child that's going away
++ if (oldValue instanceof Accessible) {
++ Accessible a = (Accessible) oldValue;
++ removeListeners(a.getAccessibleContext());
++ } else if (oldValue instanceof AccessibleContext) {
++ removeListeners((AccessibleContext) oldValue);
++ }
++ } else if (newValue != null) {
++ // this Accessible is a child was just born
++ if (newValue instanceof Accessible) {
++ Accessible a = (Accessible) newValue;
++ installListeners(a.getAccessibleContext());
++ } else if (newValue instanceof AccessibleContext) {
++ installListeners((AccessibleContext) newValue);
++ }
++ }
++ } else {
++ System.out.println("ERROR in usage of PropertyChangeEvents for: " + e.toString());
++ }
++ }
++ }
++ }
++}
++
++/*
++ * workaround for no public AccessibleState constructor
++ */
++class _AccessibleState extends AccessibleState {
++ /**
++ * Indicates this object is responsible for managing its
++ * subcomponents. This is typically used for trees and tables
++ * that have a large number of subcomponents and where the
++ * objects are created only when needed and otherwise remain virtual.
++ * The application should not manage the subcomponents directly.
++ */
++ public static final _AccessibleState MANAGES_DESCENDANTS
++ = new _AccessibleState ("managesDescendants");
++
++ /**
++ * Creates a new AccessibleState using the given locale independent key.
++ * This should not be a public method. Instead, it is used to create
++ * the constants in this file to make it a strongly typed enumeration.
++ * Subclasses of this class should enforce similar policy.
++ * <p>
++ * The key String should be a locale independent key for the state.
++ * It is not intended to be used as the actual String to display
++ * to the user. To get the localized string, use toDisplayString.
++ *
++ * @param key the locale independent name of the state.
++ * @see AccessibleBundle#toDisplayString
++ */
++ protected _AccessibleState(String key) {
++ super(key);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,182 @@
++/*
++ * 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. 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 com.sun.java.accessibility.util;
++
++import java.util.*;
++import java.beans.*;
++import java.awt.*;
++import java.awt.event.*;
++import javax.accessibility.*;
++
++/**
++ * <P>The {@code AccessibilityListenerList} is a copy of the Swing
++ * {@link javax.swing.event.EventListenerList EventListerList} class.
++ *
++ */
++
++@jdk.Exported
++public class AccessibilityListenerList {
++ /* A null array to be shared by all empty listener lists */
++ private final static Object[] NULL_ARRAY = new Object[0];
++
++ /**
++ * The list of listener type, listener pairs
++ */
++ protected transient Object[] listenerList = NULL_ARRAY;
++
++ /**
++ * Passes back the event listener list as an array of listener type, listener pairs.
++ * Note that for performance reasons, this implementation passes back the actual
++ * data structure in which the listener data is stored internally. This method
++ * is guaranteed to pass back a non-null array, so that no null-checking
++ * is required in fire methods. A zero-length array of Object is returned if
++ * there are currently no listeners.
++ * <p>
++ * Absolutely no modification of the data contained in this array should be
++ * made. If any such manipulation is necessary, it should be done on a copy
++ * of the array returned rather than the array itself.
++ *
++ * @return an array of listener type, listener pairs.
++ */
++ public Object[] getListenerList() {
++ return listenerList;
++ }
++
++ /**
++ * Returns the total number of listeners for this listener list.
++ *
++ * @return the total number of listeners for this listener list.
++ */
++ public int getListenerCount() {
++ return listenerList.length/2;
++ }
++
++ /**
++ * Return the total number of listeners of the supplied type
++ * for this listener list.
++ *
++ * @param t the type of the listener to be counted
++ * @return the number of listeners found
++ */
++ public int getListenerCount(Class t) {
++ int count = 0;
++ Object[] lList = listenerList;
++ for (int i = 0; i < lList.length; i+=2) {
++ if (t == (Class)lList[i])
++ count++;
++ }
++ return count;
++ }
++
++ /**
++ * Add the listener as a listener of the specified type.
++ *
++ * @param t the type of the listener to be added
++ * @param l the listener to be added
++ */
++ public synchronized void add(Class t, EventListener l) {
++ if (!t.isInstance(l)) {
++ throw new IllegalArgumentException("Listener " + l +
++ " is not of type " + t);
++ }
++ if (l ==null) {
++ throw new IllegalArgumentException("Listener " + l +
++ " is null");
++ }
++ if (listenerList == NULL_ARRAY) {
++ // if this is the first listener added,
++ // initialize the lists
++ listenerList = new Object[] { t, l };
++ } else {
++ // Otherwise copy the array and add the new listener
++ int i = listenerList.length;
++ Object[] tmp = new Object[i+2];
++ System.arraycopy(listenerList, 0, tmp, 0, i);
++
++ tmp[i] = t;
++ tmp[i+1] = l;
++
++ listenerList = tmp;
++ }
++ }
++
++ /**
++ * Remove the listener as a listener of the specified type.
++ *
++ * @param t the type of the listener to be removed
++ * @param l the listener to be removed
++ */
++ public synchronized void remove(Class t, EventListener l) {
++ if (!t.isInstance(l)) {
++ throw new IllegalArgumentException("Listener " + l +
++ " is not of type " + t);
++ }
++ if (l ==null) {
++ throw new IllegalArgumentException("Listener " + l +
++ " is null");
++ }
++
++ // Is l on the list?
++ int index = -1;
++ for (int i = listenerList.length-2; i>=0; i-=2) {
++ if ((listenerList[i]==t) && (listenerList[i+1] == l)) {
++ index = i;
++ break;
++ }
++ }
++
++ // If so, remove it
++ if (index != -1) {
++ Object[] tmp = new Object[listenerList.length-2];
++ // Copy the list up to index
++ System.arraycopy(listenerList, 0, tmp, 0, index);
++ // Copy from two past the index, up to
++ // the end of tmp (which is two elements
++ // shorter than the old list)
++ if (index < tmp.length)
++ System.arraycopy(listenerList, index+2, tmp, index,
++ tmp.length - index);
++ // set the listener array to the new array or null
++ listenerList = (tmp.length == 0) ? NULL_ARRAY : tmp;
++ }
++ }
++
++ /**
++ * Return a string representation of the {@code AccessibilityListenerList}.
++ *
++ * @return a string representation of the {@code AccessibilityListenerList}.
++ */
++ public String toString() {
++ Object[] lList = listenerList;
++ String s = "EventListenerList: ";
++ s += lList.length/2 + " listeners: ";
++ for (int i = 0 ; i <= lList.length-2 ; i+=2) {
++ s += " type " + ((Class)lList[i]).getName();
++ s += " listener " + lList[i+1];
++ }
++ return s;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/EventID.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,206 @@
++/*
++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package com.sun.java.accessibility.util;
++
++/**
++ * EventID contains integer constants that map to event support in
++ * AWT and Swing. They are used by primarily by AWTEventMonitor,
++ * AWTEventsListener, SwingEventMonitor, and SwingEventListener, but
++ * can be freely used by any other class.
++ *
++ * @see AWTEventMonitor
++ * @see SwingEventMonitor
++ *
++ */
++@jdk.Exported
++public class EventID {
++
++ /**
++ * Maps to AWT Action support (i.e., ActionListener and ActionEvent)
++ */
++ static public final int ACTION = 0;
++
++ /**
++ * Maps to AWT Adjustment support (i.e., AdjustmentListener
++ * and AdjustmentEvent)
++ */
++ static public final int ADJUSTMENT = 1;
++
++ /**
++ * Maps to AWT Component support (i.e., ComponentListener
++ * and ComponentEvent)
++ */
++ static public final int COMPONENT = 2;
++
++ /**
++ * Maps to AWT Container support (i.e., ContainerListener
++ * and ContainerEvent)
++ */
++ static public final int CONTAINER = 3;
++
++ /**
++ * Maps to AWT Focus support (i.e., FocusListener and FocusEvent)
++ */
++ static public final int FOCUS = 4;
++
++ /**
++ * Maps to AWT Item support (i.e., ItemListener and ItemEvent)
++ */
++ static public final int ITEM = 5;
++
++ /**
++ * Maps to AWT Key support (i.e., KeyListener and KeyEvent)
++ */
++ static public final int KEY = 6;
++
++ /**
++ * Maps to AWT Mouse support (i.e., MouseListener and MouseEvent)
++ */
++ static public final int MOUSE = 7;
++
++ /**
++ * Maps to AWT MouseMotion support (i.e., MouseMotionListener
++ * and MouseMotionEvent)
++ */
++ static public final int MOTION = 8;
++
++ /**
++ * Maps to AWT Text support (i.e., TextListener and TextEvent)
++ */
++ static public final int TEXT = 10;
++
++ /**
++ * Maps to AWT Window support (i.e., WindowListener and WindowEvent)
++ */
++ static public final int WINDOW = 11;
++
++ /**
++ * Maps to Swing Ancestor support (i.e., AncestorListener and
++ * AncestorEvent)
++ */
++ static public final int ANCESTOR = 12;
++
++ /**
++ * Maps to Swing Text Caret support (i.e., CaretListener and
++ * CaretEvent)
++ */
++ static public final int CARET = 13;
++
++ /**
++ * Maps to Swing CellEditor support (i.e., CellEditorListener and
++ * CellEditorEvent)
++ */
++ static public final int CELLEDITOR = 14;
++
++ /**
++ * Maps to Swing Change support (i.e., ChangeListener and
++ * ChangeEvent)
++ */
++ static public final int CHANGE = 15;
++
++ /**
++ * Maps to Swing TableColumnModel support (i.e.,
++ * TableColumnModelListener and TableColumnModelEvent)
++ */
++ static public final int COLUMNMODEL = 16;
++
++ /**
++ * Maps to Swing Document support (i.e., DocumentListener and
++ * DocumentEvent)
++ */
++ static public final int DOCUMENT = 17;
++
++ /**
++ * Maps to Swing ListData support (i.e., ListDataListener and
++ * ListDataEvent)
++ */
++ static public final int LISTDATA = 18;
++
++ /**
++ * Maps to Swing ListSelection support (i.e., ListSelectionListener and
++ * ListSelectionEvent)
++ */
++ static public final int LISTSELECTION = 19;
++
++ /**
++ * Maps to Swing Menu support (i.e., MenuListener and
++ * MenuEvent)
++ */
++ static public final int MENU = 20;
++
++ /**
++ * Maps to Swing PopupMenu support (i.e., PopupMenuListener and
++ * PopupMenuEvent)
++ */
++ static public final int POPUPMENU = 21;
++
++ /**
++ * Maps to Swing TableModel support (i.e., TableModelListener and
++ * TableModelEvent)
++ */
++ static public final int TABLEMODEL = 22;
++
++ /**
++ * Maps to Swing TreeExpansion support (i.e., TreeExpansionListener and
++ * TreeExpansionEvent)
++ */
++ static public final int TREEEXPANSION = 23;
++
++ /**
++ * Maps to Swing TreeModel support (i.e., TreeModelListener and
++ * TreeModelEvent)
++ */
++ static public final int TREEMODEL = 24;
++
++ /**
++ * Maps to Swing TreeSelection support (i.e., TreeSelectionListener and
++ * TreeSelectionEvent)
++ */
++ static public final int TREESELECTION = 25;
++
++ /**
++ * Maps to Swing UndoableEdit support (i.e., UndoableEditListener and
++ * UndoableEditEvent)
++ */
++ static public final int UNDOABLEEDIT = 26;
++
++ /**
++ * Maps to Beans PropertyChange support (i.e., PropertyChangeListener
++ * and PropertyChangeEvent)
++ */
++ static public final int PROPERTYCHANGE = 27;
++
++ /**
++ * Maps to Beans VetoableChange support (i.e., VetoableChangeListener
++ * and VetoableChangeEvent)
++ */
++ static public final int VETOABLECHANGE = 28;
++
++ /**
++ * Maps to Swing InternalFrame support (i.e., InternalFrameListener)
++ */
++ static public final int INTERNALFRAME = 29;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,619 @@
++/*
++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package com.sun.java.accessibility.util;
++
++import java.util.*;
++import java.awt.*;
++import java.awt.event.*;
++import javax.accessibility.*;
++import java.security.AccessController;
++import java.security.PrivilegedAction;
++
++/**
++ * The {@code EventQueueMonitor} class provides key core functionality for Assistive
++ * Technologies (and other system-level technologies that need some of the same
++ * things that Assistive Technology needs).
++ *
++ * @see AWTEventMonitor
++ * @see SwingEventMonitor
++ */
++@jdk.Exported
++public class EventQueueMonitor
++ implements AWTEventListener {
++
++ // NOTE: All of the following properties are static. The reason
++ // for this is that there may be multiple EventQueue instances
++ // in use in the same VM. By making these properties static,
++ // we can guarantee we get the information from all of the
++ // EventQueue instances.
++
++ // The stuff that is cached.
++ //
++ static Vector topLevelWindows = new Vector();
++ static Window topLevelWindowWithFocus = null;
++ static Point currentMousePosition = null;
++ static Component currentMouseComponent = null;
++
++ // Low-level listener interfaces
++ //
++ static GUIInitializedListener guiInitializedListener = null;
++ static TopLevelWindowListener topLevelWindowListener = null;
++ static MouseMotionListener mouseMotionListener = null;
++
++ /**
++ * Class variable stating whether the assistive technologies have
++ * been loaded yet or not. The assistive technologies won't be
++ * loaded until the first event is posted to the EventQueue. This
++ * gives the toolkit a chance to do all the necessary initialization
++ * it needs to do.
++ */
++
++ /**
++ * Class variable stating whether the GUI subsystem has been initialized
++ * or not.
++ *
++ * @see #isGUIInitialized
++ */
++ static boolean guiInitialized = false;
++
++ /**
++ * Queue that holds events for later processing.
++ */
++ static EventQueueMonitorItem componentEventQueue = null;
++
++ /**
++ * Class that tells us what the component event dispatch thread is.
++ */
++ static private ComponentEvtDispatchThread cedt = null;
++
++ /**
++ * Handle the synchronization between the thing that populates the
++ * component event dispatch thread ({@link #queueComponentEvent})
++ * and the thing that processes the events ({@link ComponentEvtDispatchThread}).
++ */
++ static Object componentEventQueueLock = new Object();
++
++ /**
++ * Create a new {@code EventQueueMonitor} instance. Normally, this will
++ * be called only by the AWT Toolkit during initialization time.
++ * Assistive technologies should not create instances of
++ * EventQueueMonitor by themselves. Instead, they should either
++ * refer to it directly via the static methods in this class, e.g.,
++ * {@link #getCurrentMousePosition} or obtain the instance by asking the
++ * Toolkit, e.g., {@link java.awt.Toolkit#getSystemEventQueue}.
++ */
++ public EventQueueMonitor() {
++ if (cedt == null) {
++ cedt = new ComponentEvtDispatchThread("EventQueueMonitor-ComponentEvtDispatch");
++
++ cedt.setDaemon(true);
++ cedt.start();
++ }
++ }
++
++ /**
++ * Queue up a {@link java.awt.event.ComponentEvent ComponentEvent} for later
++ * processing by the {@link ComponentEvtDispatch} thread.
++ *
++ * @param e a {@code ComponentEvent}
++ */
++ static void queueComponentEvent(ComponentEvent e) {
++ synchronized(componentEventQueueLock) {
++ EventQueueMonitorItem eqi = new EventQueueMonitorItem(e);
++ if (componentEventQueue == null) {
++ componentEventQueue = eqi;
++ } else {
++ EventQueueMonitorItem q = componentEventQueue;
++ while (true) {
++ if (q.next != null) {
++ q = q.next;
++ } else {
++ break;
++ }
++ }
++ q.next = eqi;
++ }
++ componentEventQueueLock.notifyAll();
++ }
++ }
++
++ /**
++ * Tell the {@code EventQueueMonitor} to start listening for events.
++ */
++ public static void maybeInitialize() {
++ if (cedt == null) {
++ java.security.AccessController.doPrivileged(
++ new java.security.PrivilegedAction() {
++ public Object run() {
++ try {
++ long eventMask = AWTEvent.WINDOW_EVENT_MASK |
++ AWTEvent.FOCUS_EVENT_MASK |
++ AWTEvent.MOUSE_MOTION_EVENT_MASK;
++
++ Toolkit.getDefaultToolkit().addAWTEventListener(new EventQueueMonitor(), eventMask);
++ } catch (Exception e) {
++ }
++ return null;
++ }
++ }
++ );
++ }
++ }
++
++ /**
++ * Handle events as a result of registering a listener
++ * on the {@link java.awt.EventQueue EventQueue} in {@link #maybeInitialize}.
++ */
++ public void eventDispatched(AWTEvent theEvent) {
++ processEvent(theEvent);
++ }
++
++ /**
++ * Assisitive technologies that have
++ * registered a {@link GUIInitializedListener} will be notified.
++ *
++ * @see #addGUIInitializedListener
++ */
++ static void maybeNotifyAssistiveTechnologies() {
++
++ if (!guiInitialized) {
++ guiInitialized = true;
++ if (guiInitializedListener != null) {
++ guiInitializedListener.guiInitialized();
++ }
++ }
++
++ }
++
++ /********************************************************************/
++ /* */
++ /* Package Private Methods */
++ /* */
++ /********************************************************************/
++
++ /**
++ * Add a Container to the list of top-level containers
++ * in the cache. This follows the object's hierarchy up the
++ * tree until it finds the top most parent. If the parent is
++ * not already in the list of Containers, it adds it to the list.
++ *
++ * @param c the Container
++ */
++ static void addTopLevelWindow(Component c) {
++ Container parent;
++
++ if (c == null) {
++ return;
++ }
++
++ if (!(c instanceof Window)) {
++ addTopLevelWindow(c.getParent());
++ return;
++ }
++
++ if ((c instanceof Dialog) || (c instanceof Window)) {
++ parent = (Container) c;
++ } else {
++ parent = c.getParent();
++ if (parent != null) {
++ addTopLevelWindow(parent);
++ return;
++ }
++ }
++
++ if (parent == null) {
++ parent = (Container) c;
++ }
++
++ // Because this method is static, do not make it synchronized because
++ // it can lock the whole class. Instead, just lock what needs to be
++ // locked.
++ //
++ synchronized (topLevelWindows) {
++ if ((parent != null) && !topLevelWindows.contains(parent)) {
++ topLevelWindows.addElement(parent);
++ if (topLevelWindowListener != null) {
++ topLevelWindowListener.topLevelWindowCreated((Window) parent);
++ }
++ }
++ }
++ }
++
++ /**
++ * Removes a container from the list of top level containers in the cache.
++ *
++ * @param c the top level container to remove
++ */
++ static void removeTopLevelWindow(Window w) {
++
++ // Because this method is static, do not make it synchronized because
++ // it can lock the whole class. Instead, just lock what needs to be
++ // locked.
++ //
++ synchronized (topLevelWindows) {
++ if (topLevelWindows.contains(w)) {
++ topLevelWindows.removeElement(w);
++ if (topLevelWindowListener != null) {
++ topLevelWindowListener.topLevelWindowDestroyed(w);
++ }
++ }
++ }
++ }
++
++ /**
++ * Update current mouse position.
++ *
++ * @param mouseEvent the MouseEvent that holds the new mouse position.
++ */
++ static void updateCurrentMousePosition(MouseEvent mouseEvent) {
++ Point oldMousePos = currentMousePosition;
++ // Be careful here. The component in the event might be
++ // hidden by the time we process the event.
++ try {
++ Point eventPoint = mouseEvent.getPoint();
++ currentMouseComponent = (Component) (mouseEvent.getSource());
++ currentMousePosition = currentMouseComponent.getLocationOnScreen();
++ currentMousePosition.translate(eventPoint.x,eventPoint.y);
++ } catch (Exception e) {
++ currentMousePosition = oldMousePos;
++ }
++ }
++
++ /**
++ * Process the event. This maintains the event cache in addition
++ * to calling all the registered listeners. NOTE: The events that
++ * come through here are from peered Components.
++ *
++ * @param theEvent the AWTEvent
++ */
++ static void processEvent(AWTEvent theEvent) {
++ switch (theEvent.getID()) {
++ case MouseEvent.MOUSE_MOVED:
++ case MouseEvent.MOUSE_DRAGGED:
++ case FocusEvent.FOCUS_GAINED:
++ case WindowEvent.WINDOW_DEACTIVATED:
++ queueComponentEvent((ComponentEvent) theEvent);
++ break;
++
++ case WindowEvent.WINDOW_ACTIVATED:
++ // Dialogs fire WINDOW_ACTIVATED and FOCUS_GAINED events
++ // before WINDOW_OPENED so we need to add topLevelListeners
++ // for the dialog when it is first activated to get a
++ // focus gained event for the focus component in the dialog.
++ if (theEvent instanceof ComponentEvent) {
++ ComponentEvent ce = (ComponentEvent)theEvent;
++ if (ce.getComponent() instanceof Window) {
++ EventQueueMonitor.addTopLevelWindow(ce.getComponent());
++ EventQueueMonitor.maybeNotifyAssistiveTechnologies();
++ } else {
++ EventQueueMonitor.maybeNotifyAssistiveTechnologies();
++ EventQueueMonitor.addTopLevelWindow(ce.getComponent());
++ }
++ }
++ queueComponentEvent((ComponentEvent) theEvent);
++ break;
++
++ // handle WINDOW_OPENED and WINDOW_CLOSED events synchronously
++ case WindowEvent.WINDOW_OPENED:
++ if (theEvent instanceof ComponentEvent) {
++ ComponentEvent ce = (ComponentEvent)theEvent;
++ if (ce.getComponent() instanceof Window) {
++ EventQueueMonitor.addTopLevelWindow(ce.getComponent());
++ EventQueueMonitor.maybeNotifyAssistiveTechnologies();
++ } else {
++ EventQueueMonitor.maybeNotifyAssistiveTechnologies();
++ EventQueueMonitor.addTopLevelWindow(ce.getComponent());
++ }
++ }
++ break;
++ case WindowEvent.WINDOW_CLOSED:
++ if (theEvent instanceof ComponentEvent) {
++ ComponentEvent ce = (ComponentEvent)theEvent;
++ EventQueueMonitor.removeTopLevelWindow((Window) (ce.getComponent()));
++ }
++ break;
++
++ default:
++ break;
++ }
++ }
++
++ /**
++ * Internal test
++ */
++ static synchronized Component getShowingComponentAt(Container c, int x, int y) {
++ if (!c.contains(x, y)) {
++ return null;
++ }
++ int ncomponents = c.getComponentCount();
++ for (int i = 0 ; i < ncomponents ; i++) {
++ Component comp = c.getComponent(i);
++ if (comp != null && comp.isShowing()) {
++ Point location = comp.getLocation();
++ if (comp.contains(x - location.x, y - location.y)) {
++ return comp;
++ }
++ }
++ }
++ return c;
++ }
++
++ /**
++ * Return the Component at the given Point on the screen in the
++ * given Container.
++ *
++ * @param c the Container to search
++ * @param p the Point in screen coordinates
++ * @return the Component at the given Point on the screen in the
++ * given Container -- can be null if no Component is at that Point
++ */
++ static synchronized Component getComponentAt(Container c, Point p) {
++ if (!c.isShowing()) {
++ return null;
++ }
++
++ Component comp;
++ Point containerLoc = c.getLocationOnScreen();
++ Point containerPoint = new Point(p.x - containerLoc.x,
++ p.y - containerLoc.y);
++
++ comp = getShowingComponentAt(c, containerPoint.x, containerPoint.y);
++
++ if ((comp != c) && (comp instanceof Container)) {
++ return getComponentAt((Container)comp,p);
++ } else {
++ return comp;
++ }
++ }
++
++ /**
++ * Obtain the {@link javax.accessibility.Accessible Accessible} object at the given point on the Screen.
++ * The return value may be null if an {@code Accessible} object cannot be
++ * found at the particular point.
++ *
++ * @param p the point to be accessed
++ * @return the {@code Accessible} at the specified point
++ */
++ static public Accessible getAccessibleAt(Point p) {
++ Window w = getTopLevelWindowWithFocus();
++ Window[] wins = getTopLevelWindows();
++ Component c = null;
++
++ // See if the point we're being asked about is the
++ // currentMousePosition. If so, start with the component
++ // that we know the currentMousePostion is over
++ //
++ if (currentMousePosition == null) {
++ return null;
++ }
++ if (currentMousePosition.equals(p)) {
++ if (currentMouseComponent instanceof Container) {
++ c = getComponentAt((Container) currentMouseComponent, p);
++ }
++ }
++
++ // Try the window with focus next
++ //
++ if (c == null && w != null) {
++ c = getComponentAt(w,p);
++ }
++
++ // Try the other windows next. [[[WDW: Stacking order???]]]
++ if (c == null) {
++ for (int i = 0; i < wins.length; i++) {
++ c = getComponentAt(wins[i],p);
++ if (c != null) {
++ break;
++ }
++ }
++ }
++
++ if (c instanceof Accessible) {
++ AccessibleContext ac = ((Accessible) c).getAccessibleContext();
++ if (ac != null) {
++ AccessibleComponent acmp = ac.getAccessibleComponent();
++ if ((acmp != null) && (ac.getAccessibleChildrenCount() != 0)) {
++ Point location = acmp.getLocationOnScreen();
++ location.move(p.x - location.x, p.y - location.y);
++ return acmp.getAccessibleAt(location);
++ }
++ }
++ return (Accessible) c;
++ } else {
++ return Translator.getAccessible(c);
++ }
++ }
++
++ /********************************************************************/
++ /* */
++ /* Public Methods */
++ /* */
++ /********************************************************************/
++
++ /**
++ * Says whether the GUI subsystem has been initialized or not.
++ * If this returns true, the assistive technology can freely
++ * create GUI component instances. If the return value is false,
++ * the assistive technology should register a {@link GUIInitializedListener}
++ * and wait to create GUI component instances until the listener is
++ * called.
++ *
++ * @return true if the GUI subsystem has been initialized
++ * @see #addGUIInitializedListener
++ */
++ static public boolean isGUIInitialized() {
++ maybeInitialize();
++ return guiInitialized;
++ }
++
++ /**
++ * Adds the specified listener to be notified when the GUI subsystem
++ * is initialized. Assistive technologies should get the results of
++ * {@link #isGUIInitialized} before calling this method.
++ *
++ * @param l the listener to add
++ * @see #isGUIInitialized
++ * @see #removeTopLevelWindowListener
++ */
++ static public void addGUIInitializedListener(GUIInitializedListener l) {
++ maybeInitialize();
++ guiInitializedListener =
++ GUIInitializedMulticaster.add(guiInitializedListener,l);
++ }
++
++ /**
++ * Removes the specified listener to be notified when the GUI subsystem
++ * is initialized.
++ *
++ * @param l the listener to remove
++ * @see #addGUIInitializedListener
++ */
++ static public void removeGUIInitializedListener(GUIInitializedListener l) {
++ guiInitializedListener =
++ GUIInitializedMulticaster.remove(guiInitializedListener,l);
++ }
++
++ /**
++ * Adds the specified listener to be notified when a top level window
++ * is created or destroyed.
++ *
++ * @param l the listener to add
++ * @see #removeTopLevelWindowListener
++ */
++ static public void addTopLevelWindowListener(TopLevelWindowListener l) {
++ topLevelWindowListener =
++ TopLevelWindowMulticaster.add(topLevelWindowListener,l);
++ }
++
++ /**
++ * Removes the specified listener to be notified when a top level window
++ * is created or destroyed.
++ *
++ * @param l the listener to remove
++ * @see #addTopLevelWindowListener
++ */
++ static public void removeTopLevelWindowListener(TopLevelWindowListener l) {
++ topLevelWindowListener =
++ TopLevelWindowMulticaster.remove(topLevelWindowListener,l);
++ }
++
++ /**
++ * Return the last recorded position of the mouse in screen coordinates.
++ *
++ * @return the last recorded position of the mouse in screen coordinates
++ */
++ static public Point getCurrentMousePosition() {
++ return currentMousePosition;
++ }
++
++ /**
++ * Return the list of top level Windows in use in the Java Virtual Machine.
++ *
++ * @return an array of top level {@code Window}s in use in the Java Virtual Machine
++ */
++ static public Window[] getTopLevelWindows() {
++
++ // Because this method is static, do not make it synchronized because
++ // it can lock the whole class. Instead, just lock what needs to be
++ // locked.
++ //
++ synchronized (topLevelWindows) {
++ int count = topLevelWindows.size();
++ if (count > 0) {
++ Window[] w = new Window[count];
++ for (int i = 0; i < count; i++) {
++ w[i] = (Window)topLevelWindows.elementAt(i);
++ }
++ return w;
++ } else {
++ return new Window[0];
++ }
++ }
++ }
++
++ /**
++ * Return the top level {@code Window} that currently has keyboard focus.
++ *
++ * @return the top level {@code Window} that currently has keyboard focus
++ */
++ static public Window getTopLevelWindowWithFocus() {
++ return topLevelWindowWithFocus;
++ }
++}
++
++/**
++ * Handle all Component events in a separate thread. The reason for this is
++ * that WindowEvents tend to be used to do lots of processing on the Window
++ * hierarchy. As a result, it can frequently result in deadlock situations.
++ */
++class ComponentEvtDispatchThread extends Thread {
++ public ComponentEvtDispatchThread(String name) {
++ super(name);
++ }
++ public void run() {
++ ComponentEvent ce = null;
++ while (true) {
++ synchronized(EventQueueMonitor.componentEventQueueLock) {
++ while (EventQueueMonitor.componentEventQueue == null) {
++ try {
++ EventQueueMonitor.componentEventQueueLock.wait();
++ } catch (InterruptedException e) {
++ }
++ }
++ ce = (ComponentEvent)EventQueueMonitor.componentEventQueue.event;
++ EventQueueMonitor.componentEventQueue =
++ EventQueueMonitor.componentEventQueue.next;
++ }
++ switch (ce.getID()) {
++ case MouseEvent.MOUSE_MOVED:
++ case MouseEvent.MOUSE_DRAGGED:
++ EventQueueMonitor.updateCurrentMousePosition((MouseEvent) ce);
++ break;
++ case WindowEvent.WINDOW_ACTIVATED:
++ EventQueueMonitor.maybeNotifyAssistiveTechnologies();
++ EventQueueMonitor.topLevelWindowWithFocus = ((WindowEvent) ce).getWindow();
++ break;
++
++ default:
++ break;
++ }
++ }
++ }
++}
++
++/**
++ * EventQueueMonitorItem is the basic type that handles the
++ * queue for queueComponentEvent and the ComponentEvtDispatchThread.
++ */
++class EventQueueMonitorItem {
++ AWTEvent event;
++ EventQueueMonitorItem next;
++
++ EventQueueMonitorItem(AWTEvent evt) {
++ event = evt;
++ next = null;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/GUIInitializedListener.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,61 @@
++/*
++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package com.sun.java.accessibility.util;
++
++import java.awt.*;
++import java.util.*;
++import javax.accessibility.*;
++
++/**
++ * The {@code GUIInitializedListener} interface is used by the {@link EventQueueMonitor}
++ * class to notify an interested party when the GUI subsystem has been
++ * initialized. This is necessary because assistive technologies can
++ * be loaded before the GUI subsystem is initialized. As a result,
++ * assistive technologies should check the
++ * {@link EventQueueMonitor#isGUIInitialized isGUIInitialized} method
++ * of {@code EventQueueMonitor} before creating any GUI components. If the
++ * return value is true, assistive technologies can create GUI components
++ * following the same thread restrictions as any other application. If
++ * the return value is false, the assistive technology should register
++ * a {@code GUIInitializedListener} with the {@code EventQueueMonitor} to be notified
++ * when the GUI subsystem is initialized.
++ *
++ * @see EventQueueMonitor
++ * @see EventQueueMonitor#isGUIInitialized
++ * @see EventQueueMonitor#addGUIInitializedListener
++ * @see EventQueueMonitor#removeGUIInitializedListener
++ *
++ */
++@jdk.Exported
++public interface GUIInitializedListener extends EventListener {
++
++ /**
++ * Invoked when the GUI subsystem is initialized and it's OK for
++ * the assisitive technology to create instances of GUI objects.
++ */
++ public void guiInitialized();
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/GUIInitializedMulticaster.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,81 @@
++/*
++ * 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. 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 com.sun.java.accessibility.util;
++
++import java.awt.*;
++import java.util.EventListener;
++import javax.accessibility.*;
++
++
++/**
++ * The GUIInitializedMulticaster class is used to maintain a list of
++ * GUIInitializedListener classes. It is intended to be used primarily
++ * for internal support in the EventQueueMonitor class, and is not intended
++ * to be used by classes outside the Java Accessibility Utility package.
++ *
++ * @see EventQueueMonitor
++ * @see EventQueueMonitor#addGUIInitializedListener
++ * @see EventQueueMonitor#removeGUIInitializedListener
++ *
++ */
++@jdk.Exported(false)
++public class GUIInitializedMulticaster
++ extends AWTEventMulticaster implements GUIInitializedListener
++{
++ protected GUIInitializedMulticaster(EventListener a, EventListener b) {
++ super(a, b);
++ }
++
++ public void guiInitialized() {
++ ((GUIInitializedListener)a).guiInitialized();
++ ((GUIInitializedListener)b).guiInitialized();
++ }
++
++ public static GUIInitializedListener add(GUIInitializedListener a, GUIInitializedListener b) {
++ return (GUIInitializedListener)addInternal(a, b);
++ }
++
++ public static GUIInitializedListener remove(GUIInitializedListener l, GUIInitializedListener oldl) {
++ return (GUIInitializedListener)removeInternal(l, oldl);
++ }
++
++ protected static EventListener addInternal(EventListener a, EventListener b) {
++ if (a == null) return b;
++ if (b == null) return a;
++ return new GUIInitializedMulticaster(a, b);
++ }
++
++ protected static EventListener removeInternal(EventListener l, EventListener oldl) {
++ if (l == oldl || l == null) {
++ return null;
++ } else if (l instanceof GUIInitializedMulticaster) {
++ return ((GUIInitializedMulticaster)l).remove(oldl);
++ } else {
++ return l; // it's not here
++ }
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,2542 @@
++/*
++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package com.sun.java.accessibility.util;
++
++import java.util.*;
++import java.beans.*;
++import java.awt.*;
++import java.awt.event.*;
++import javax.swing.*;
++import javax.swing.event.*;
++import javax.swing.table.*;
++import javax.swing.tree.*;
++import javax.swing.text.*;
++import javax.swing.undo.*;
++import javax.accessibility.*;
++
++
++/**
++ * <P>{@code SwingEventMonitor} extends {@link AWTEventMonitor} by adding a suite of
++ * listeners conditionally installed on every Swing component instance
++ * in the Java Virtual Machine. The events captured by these listeners
++ * are made available through a unified set of listeners supported by
++ * {@code SwingEventMonitor}. With this, all the individual events on each of the
++ * AWT and Swing component instances are funneled into one set of listeners
++ * broken down by category (see {@link EventID} for the categories).
++ * <p>This class depends upon {@link EventQueueMonitor}, which provides the base
++ * level support for capturing the top-level containers as they are created.
++ * <p>Because this class extends {@code AWTEventMonitor}, it is not
++ * necessary to use this class and {@code AWTEventMonitor} at the same time.
++ * If you want to monitor both AWT and Swing components, you should
++ * use just this class.
++ *
++ * @see AWTEventMonitor
++ *
++ */
++@jdk.Exported
++public class SwingEventMonitor extends AWTEventMonitor {
++
++ /**
++ * The master list of all listeners registered by other classes.
++ * This can only be publicly modified by calling the add or
++ * remove listener methods in this class.
++ */
++ static protected final EventListenerList listenerList = new EventListenerList();
++
++ /**
++ * The actual listener that is installed on the component instances.
++ * This listener calls the other registered listeners when an event
++ * occurs. By doing things this way, the actual number of listeners
++ * installed on a component instance is drastically reduced.
++ */
++ static protected final SwingEventListener swingListener = new SwingEventListener();
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#ANCESTOR ANCESTOR}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeAncestorListener
++ */
++ static public void addAncestorListener(AncestorListener l) {
++ if (listenerList.getListenerCount(AncestorListener.class) == 0) {
++ swingListener.installListeners(EventID.ANCESTOR);
++ }
++ listenerList.add(AncestorListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#ANCESTOR ANCESTOR} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addAncestorListener
++ */
++ static public void removeAncestorListener(AncestorListener l) {
++ listenerList.remove(AncestorListener.class, l);
++ if (listenerList.getListenerCount(AncestorListener.class) == 0) {
++ swingListener.removeListeners(EventID.ANCESTOR);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#CARET CARET} events
++ * on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeCaretListener
++ */
++ static public void addCaretListener(CaretListener l) {
++ if (listenerList.getListenerCount(CaretListener.class) == 0) {
++ swingListener.installListeners(EventID.CARET);
++ }
++ listenerList.add(CaretListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#CARET CARET} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addCaretListener
++ */
++ static public void removeCaretListener(CaretListener l) {
++ listenerList.remove(CaretListener.class, l);
++ if (listenerList.getListenerCount(CaretListener.class) == 0) {
++ swingListener.removeListeners(EventID.CARET);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all
++ * {@link EventID#CELLEDITOR CELLEDITOR} events on each
++ * component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeCellEditorListener
++ */
++ static public void addCellEditorListener(CellEditorListener l) {
++ if (listenerList.getListenerCount(CellEditorListener.class) == 0) {
++ swingListener.installListeners(EventID.CELLEDITOR);
++ }
++ listenerList.add(CellEditorListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#CELLEDITOR CELLEDITOR} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addCellEditorListener
++ */
++ static public void removeCellEditorListener(CellEditorListener l) {
++ listenerList.remove(CellEditorListener.class, l);
++ if (listenerList.getListenerCount(CellEditorListener.class) == 0) {
++ swingListener.removeListeners(EventID.CELLEDITOR);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#CHANGE CHANGE}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeChangeListener
++ */
++ static public void addChangeListener(ChangeListener l) {
++ if (listenerList.getListenerCount(ChangeListener.class) == 0) {
++ swingListener.installListeners(EventID.CHANGE);
++ }
++ listenerList.add(ChangeListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#CHANGE CHANGE} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addChangeListener
++ */
++ static public void removeChangeListener(ChangeListener l) {
++ listenerList.remove(ChangeListener.class, l);
++ if (listenerList.getListenerCount(ChangeListener.class) == 0) {
++ swingListener.removeListeners(EventID.CHANGE);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#COLUMNMODEL COLUMNMODEL}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeColumnModelListener
++ */
++ static public void addColumnModelListener(TableColumnModelListener l) {
++ if (listenerList.getListenerCount(TableColumnModelListener.class) == 0) {
++ swingListener.installListeners(EventID.COLUMNMODEL);
++ }
++ listenerList.add(TableColumnModelListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#COLUMNMODEL COLUMNMODEL} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addColumnModelListener
++ */
++ static public void removeColumnModelListener(TableColumnModelListener l) {
++ listenerList.remove(TableColumnModelListener.class, l);
++ if (listenerList.getListenerCount(TableColumnModelListener.class) == 0) {
++ swingListener.removeListeners(EventID.COLUMNMODEL);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#DOCUMENT DOCUMENT}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeDocumentListener
++ */
++ static public void addDocumentListener(DocumentListener l) {
++ if (listenerList.getListenerCount(DocumentListener.class) == 0) {
++ swingListener.installListeners(EventID.DOCUMENT);
++ }
++ listenerList.add(DocumentListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#DOCUMENT DOCUMENT} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addDocumentListener
++ */
++ static public void removeDocumentListener(DocumentListener l) {
++ listenerList.remove(DocumentListener.class, l);
++ if (listenerList.getListenerCount(DocumentListener.class) == 0) {
++ swingListener.removeListeners(EventID.DOCUMENT);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#LISTDATA LISTDATA}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeListDataListener
++ */
++ static public void addListDataListener(ListDataListener l) {
++ if (listenerList.getListenerCount(ListDataListener.class) == 0) {
++ swingListener.installListeners(EventID.LISTDATA);
++ }
++ listenerList.add(ListDataListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#LISTDATA LISTDATA} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addListDataListener
++ */
++ static public void removeListDataListener(ListDataListener l) {
++ listenerList.remove(ListDataListener.class, l);
++ if (listenerList.getListenerCount(ListDataListener.class) == 0) {
++ swingListener.removeListeners(EventID.LISTDATA);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#LISTSELECTION LISTSELECTION}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeListSelectionListener
++ */
++ static public void addListSelectionListener(ListSelectionListener l) {
++ if (listenerList.getListenerCount(ListSelectionListener.class) == 0) {
++ swingListener.installListeners(EventID.LISTSELECTION);
++ }
++ listenerList.add(ListSelectionListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#LISTSELECTION LISTSELECTION} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addListSelectionListener
++ */
++ static public void removeListSelectionListener(ListSelectionListener l) {
++ listenerList.remove(ListSelectionListener.class, l);
++ if (listenerList.getListenerCount(ListSelectionListener.class) == 0) {
++ swingListener.removeListeners(EventID.LISTSELECTION);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#MENU MENU} events
++ * on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeMenuListener
++ */
++ static public void addMenuListener(MenuListener l) {
++ if (listenerList.getListenerCount(MenuListener.class) == 0) {
++ swingListener.installListeners(EventID.MENU);
++ }
++ listenerList.add(MenuListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#MENU MENU} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addMenuListener
++ */
++ static public void removeMenuListener(MenuListener l) {
++ listenerList.remove(MenuListener.class, l);
++ if (listenerList.getListenerCount(MenuListener.class) == 0) {
++ swingListener.removeListeners(EventID.MENU);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#POPUPMENU POPUPMENU}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removePopupMenuListener
++ */
++ static public void addPopupMenuListener(PopupMenuListener l) {
++ if (listenerList.getListenerCount(PopupMenuListener.class) == 0) {
++ swingListener.installListeners(EventID.POPUPMENU);
++ }
++ listenerList.add(PopupMenuListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#POPUPMENU POPUPMENU} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addPopupMenuListener
++ */
++ static public void removePopupMenuListener(PopupMenuListener l) {
++ listenerList.remove(PopupMenuListener.class, l);
++ if (listenerList.getListenerCount(PopupMenuListener.class) == 0) {
++ swingListener.removeListeners(EventID.POPUPMENU);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#TABLEMODEL TABLEMODEL}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeTableModelListener
++ */
++ static public void addTableModelListener(TableModelListener l) {
++ if (listenerList.getListenerCount(TableModelListener.class) == 0) {
++ swingListener.installListeners(EventID.TABLEMODEL);
++ }
++ listenerList.add(TableModelListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#TABLEMODEL TABLEMODEL} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addTableModelListener
++ */
++ static public void removeTableModelListener(TableModelListener l) {
++ listenerList.remove(TableModelListener.class, l);
++ if (listenerList.getListenerCount(TableModelListener.class) == 0) {
++ swingListener.removeListeners(EventID.TABLEMODEL);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#TREEEXPANSION TREEEXPANSION}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeTreeExpansionListener
++ */
++ static public void addTreeExpansionListener(TreeExpansionListener l) {
++ if (listenerList.getListenerCount(TreeExpansionListener.class) == 0) {
++ swingListener.installListeners(EventID.TREEEXPANSION);
++ }
++ listenerList.add(TreeExpansionListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#TREEEXPANSION TREEEXPANSION} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addTreeExpansionListener
++ */
++ static public void removeTreeExpansionListener(TreeExpansionListener l) {
++ listenerList.remove(TreeExpansionListener.class, l);
++ if (listenerList.getListenerCount(TreeExpansionListener.class) == 0) {
++ swingListener.removeListeners(EventID.TREEEXPANSION);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#TREEMODEL TREEMODEL}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeTreeModelListener
++ */
++ static public void addTreeModelListener(TreeModelListener l) {
++ if (listenerList.getListenerCount(TreeModelListener.class) == 0) {
++ swingListener.installListeners(EventID.TREEMODEL);
++ }
++ listenerList.add(TreeModelListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#TREEMODEL TREEMODEL} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addTreeModelListener
++ */
++ static public void removeTreeModelListener(TreeModelListener l) {
++ listenerList.remove(TreeModelListener.class, l);
++ if (listenerList.getListenerCount(TreeModelListener.class) == 0) {
++ swingListener.removeListeners(EventID.TREEMODEL);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#TREESELECTION TREESELECTION}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeTreeSelectionListener
++ */
++ static public void addTreeSelectionListener(TreeSelectionListener l) {
++ if (listenerList.getListenerCount(TreeSelectionListener.class) == 0) {
++ swingListener.installListeners(EventID.TREESELECTION);
++ }
++ listenerList.add(TreeSelectionListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#TREESELECTION TREESELECTION} events when they occur.
++ * @see #addTreeSelectionListener
++ * @param l the listener to remove
++ */
++ static public void removeTreeSelectionListener(TreeSelectionListener l) {
++ listenerList.remove(TreeSelectionListener.class, l);
++ if (listenerList.getListenerCount(TreeSelectionListener.class) == 0) {
++ swingListener.removeListeners(EventID.TREESELECTION);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#UNDOABLEEDIT UNDOABLEEDIT}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeUndoableEditListener
++ */
++ static public void addUndoableEditListener(UndoableEditListener l) {
++ if (listenerList.getListenerCount(UndoableEditListener.class) == 0) {
++ swingListener.installListeners(EventID.UNDOABLEEDIT);
++ }
++ listenerList.add(UndoableEditListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#UNDOABLEEDIT UNDOABLEEDIT} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addUndoableEditListener
++ */
++ static public void removeUndoableEditListener(UndoableEditListener l) {
++ listenerList.remove(UndoableEditListener.class, l);
++ if (listenerList.getListenerCount(UndoableEditListener.class) == 0) {
++ swingListener.removeListeners(EventID.UNDOABLEEDIT);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#INTERNALFRAME INTERNALFRAME}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeInternalFrameListener
++ */
++ static public void addInternalFrameListener(InternalFrameListener l) {
++ if (listenerList.getListenerCount(InternalFrameListener.class) == 0) {
++ swingListener.installListeners(EventID.INTERNALFRAME);
++ }
++ listenerList.add(InternalFrameListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#INTERNALFRAME INTERNALFRAME} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addInternalFrameListener
++ */
++ static public void removeInternalFrameListener(InternalFrameListener l) {
++ listenerList.remove(InternalFrameListener.class, l);
++ if (listenerList.getListenerCount(InternalFrameListener.class) == 0) {
++ swingListener.removeListeners(EventID.INTERNALFRAME);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#PROPERTYCHANGE PROPERTYCHANGE}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removePropertyChangeListener
++ */
++ static public void addPropertyChangeListener(PropertyChangeListener l) {
++ if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
++ swingListener.installListeners(EventID.PROPERTYCHANGE);
++ }
++ listenerList.add(PropertyChangeListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#PROPERTYCHANGE PROPERTYCHANGE} events when they occur.
++ * @see #addPropertyChangeListener
++ * @param l the listener to remove
++ */
++ static public void removePropertyChangeListener(PropertyChangeListener l) {
++ listenerList.remove(PropertyChangeListener.class, l);
++ if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
++ swingListener.removeListeners(EventID.PROPERTYCHANGE);
++ }
++ }
++
++ /**
++ * Adds the specified listener to receive all {@link EventID#VETOABLECHANGE VETOABLECHANGE}
++ * events on each component instance in the Java Virtual Machine as they occur.
++ * <P>Note: This listener is automatically added to all component
++ * instances created after this method is called. In addition, it
++ * is only added to component instances that support this listener type.
++ *
++ * @param l the listener to add
++ * @see #removeVetoableChangeListener
++ */
++ static public void addVetoableChangeListener(VetoableChangeListener l) {
++ if (listenerList.getListenerCount(VetoableChangeListener.class) == 0) {
++ swingListener.installListeners(EventID.VETOABLECHANGE);
++ }
++ listenerList.add(VetoableChangeListener.class, l);
++ }
++
++ /**
++ * Removes the specified listener so it no longer receives
++ * {@link EventID#VETOABLECHANGE VETOABLECHANGE} events when they occur.
++ *
++ * @param l the listener to remove
++ * @see #addVetoableChangeListener
++ */
++ static public void removeVetoableChangeListener(VetoableChangeListener l) {
++ listenerList.remove(VetoableChangeListener.class, l);
++ if (listenerList.getListenerCount(VetoableChangeListener.class) == 0) {
++ swingListener.removeListeners(EventID.VETOABLECHANGE);
++ }
++ }
++
++
++ /**
++ * SwingEventListener is the class that does all the work for
++ * SwingEventMonitor. It is not intended for use by any other class
++ * except SwingEventMonitor.
++ *
++ */
++ static class SwingEventListener extends AWTEventsListener
++ implements AncestorListener, CaretListener, CellEditorListener,
++ ChangeListener, DocumentListener, ListDataListener,
++ ListSelectionListener, MenuListener, PopupMenuListener,
++ TableColumnModelListener, TableModelListener, TreeExpansionListener,
++ TreeModelListener, TreeSelectionListener, UndoableEditListener,
++ InternalFrameListener,
++ PropertyChangeListener, VetoableChangeListener {
++
++ /**
++ * internal variables for Caret introspection
++ */
++ private java.lang.Class caretListeners[];
++ private java.lang.reflect.Method removeCaretMethod;
++ private java.lang.reflect.Method addCaretMethod;
++ private java.lang.Object caretArgs[];
++
++ /**
++ * internal variables for CellEditor introspection
++ */
++ private java.lang.Class cellEditorListeners[];
++ private java.lang.reflect.Method removeCellEditorMethod;
++ private java.lang.reflect.Method addCellEditorMethod;
++ private java.lang.Object cellEditorArgs[];
++ private java.lang.reflect.Method getCellEditorMethod;
++
++ /**
++ * internal variables for Change introspection
++ */
++ private java.lang.Class changeListeners[];
++ private java.lang.reflect.Method removeChangeMethod;
++ private java.lang.reflect.Method addChangeMethod;
++ private java.lang.Object changeArgs[];
++
++ /**
++ * internal variable for ColumnModel introspection
++ */
++ private java.lang.reflect.Method getColumnModelMethod;
++
++ /**
++ * internal variables for Document introspection
++ */
++ private java.lang.Class documentListeners[];
++ private java.lang.reflect.Method removeDocumentMethod;
++ private java.lang.reflect.Method addDocumentMethod;
++ private java.lang.Object documentArgs[];
++ private java.lang.reflect.Method getDocumentMethod;
++
++ /**
++ * internal variable for ListData, Table, and Tree introspection
++ */
++ private java.lang.reflect.Method getModelMethod;
++
++ /**
++ * internal variables for ListSelection introspection
++ */
++ private java.lang.Class listSelectionListeners[];
++ private java.lang.reflect.Method removeListSelectionMethod;
++ private java.lang.reflect.Method addListSelectionMethod;
++ private java.lang.Object listSelectionArgs[];
++ private java.lang.reflect.Method getSelectionModelMethod;
++
++ /**
++ * internal variables for Menu introspection
++ */
++ private java.lang.Class menuListeners[];
++ private java.lang.reflect.Method removeMenuMethod;
++ private java.lang.reflect.Method addMenuMethod;
++ private java.lang.Object menuArgs[];
++
++ /**
++ * internal variables for PopupMenu introspection
++ */
++ private java.lang.Class popupMenuListeners[];
++ private java.lang.reflect.Method removePopupMenuMethod;
++ private java.lang.reflect.Method addPopupMenuMethod;
++ private java.lang.Object popupMenuArgs[];
++ private java.lang.reflect.Method getPopupMenuMethod;
++
++ /**
++ * internal variables for TreeExpansion introspection
++ */
++ private java.lang.Class treeExpansionListeners[];
++ private java.lang.reflect.Method removeTreeExpansionMethod;
++ private java.lang.reflect.Method addTreeExpansionMethod;
++ private java.lang.Object treeExpansionArgs[];
++
++ /**
++ * internal variables for TreeSelection introspection
++ */
++ private java.lang.Class treeSelectionListeners[];
++ private java.lang.reflect.Method removeTreeSelectionMethod;
++ private java.lang.reflect.Method addTreeSelectionMethod;
++ private java.lang.Object treeSelectionArgs[];
++
++ /**
++ * internal variables for UndoableEdit introspection
++ */
++ private java.lang.Class undoableEditListeners[];
++ private java.lang.reflect.Method removeUndoableEditMethod;
++ private java.lang.reflect.Method addUndoableEditMethod;
++ private java.lang.Object undoableEditArgs[];
++
++ /**
++ * internal variables for InternalFrame introspection
++ */
++ private java.lang.Class internalFrameListeners[];
++ private java.lang.reflect.Method removeInternalFrameMethod;
++ private java.lang.reflect.Method addInternalFrameMethod;
++ private java.lang.Object internalFrameArgs[];
++
++ /**
++ * internal variables for PropertyChange introspection
++ */
++ private java.lang.Class propertyChangeListeners[];
++ private java.lang.reflect.Method removePropertyChangeMethod;
++ private java.lang.reflect.Method addPropertyChangeMethod;
++ private java.lang.Object propertyChangeArgs[];
++
++ /**
++ * internal variables for a variety of change introspections
++ */
++ private java.lang.Class nullClass[];
++ private java.lang.Object nullArgs[];
++
++ /**
++ * Create a new instance of this class and install it on each component
++ * instance in the virtual machine that supports any of the currently
++ * registered listeners in SwingEventMonitor. Also registers itself
++ * as a TopLevelWindowListener with EventQueueMonitor so it can
++ * automatically add new listeners to new components.
++ * @see EventQueueMonitor
++ * @see SwingEventMonitor
++ */
++ public SwingEventListener() {
++ initializeIntrospection();
++ installListeners();
++ EventQueueMonitor.addTopLevelWindowListener(this);
++ }
++
++ /**
++ * Set up all of the variables needed for introspection
++ */
++ private boolean initializeIntrospection() {
++ try {
++ caretListeners = new java.lang.Class[1];
++ caretArgs = new java.lang.Object[1];
++ caretListeners[0] = Class.forName("javax.swing.event.CaretListener");
++ caretArgs[0] = this;
++
++ cellEditorListeners = new java.lang.Class[1];
++ cellEditorArgs = new java.lang.Object[1];
++ cellEditorListeners[0] = Class.forName("javax.swing.event.CellEditorListener");
++ cellEditorArgs[0] = this;
++
++ changeListeners = new java.lang.Class[1];
++ changeArgs = new java.lang.Object[1];
++ changeListeners[0] = Class.forName("javax.swing.event.ChangeListener");
++ changeArgs[0] = this;
++
++ documentListeners = new java.lang.Class[1];
++ documentArgs = new java.lang.Object[1];
++ documentListeners[0] = Class.forName("javax.swing.event.DocumentListener");
++ documentArgs[0] = this;
++
++ listSelectionListeners = new java.lang.Class[1];
++ listSelectionArgs = new java.lang.Object[1];
++ listSelectionListeners[0] = Class.forName("javax.swing.event.ListSelectionListener");
++ listSelectionArgs[0] = this;
++
++ menuListeners = new java.lang.Class[1];
++ menuArgs = new java.lang.Object[1];
++ menuListeners[0] = Class.forName("javax.swing.event.MenuListener");
++ menuArgs[0] = this;
++
++ popupMenuListeners = new java.lang.Class[1];
++ popupMenuArgs = new java.lang.Object[1];
++ popupMenuListeners[0] = Class.forName("javax.swing.event.PopupMenuListener");
++ popupMenuArgs[0] = this;
++
++ treeExpansionListeners = new java.lang.Class[1];
++ treeExpansionArgs = new java.lang.Object[1];
++ treeExpansionListeners[0] = Class.forName("javax.swing.event.TreeExpansionListener");
++ treeExpansionArgs[0] = this;
++
++ treeSelectionListeners = new java.lang.Class[1];
++ treeSelectionArgs = new java.lang.Object[1];
++ treeSelectionListeners[0] = Class.forName("javax.swing.event.TreeSelectionListener");
++ treeSelectionArgs[0] = this;
++
++ undoableEditListeners = new java.lang.Class[1];
++ undoableEditArgs = new java.lang.Object[1];
++ undoableEditListeners[0] = Class.forName("javax.swing.event.UndoableEditListener");
++ undoableEditArgs[0] = this;
++
++ internalFrameListeners = new java.lang.Class[1];
++ internalFrameArgs = new java.lang.Object[1];
++ internalFrameListeners[0] = Class.forName("javax.swing.event.InternalFrameListener");
++ internalFrameArgs[0] = this;
++
++ nullClass = new java.lang.Class[0];
++ nullArgs = new java.lang.Object[0];
++
++ } catch (ClassNotFoundException e) {
++ System.out.println("EXCEPTION - Class 'javax.swing.event.*' not in CLASSPATH");
++ return false;
++ }
++
++ try {
++ propertyChangeListeners = new java.lang.Class[1];
++ propertyChangeArgs = new java.lang.Object[1];
++ propertyChangeListeners[0] = Class.forName("java.beans.PropertyChangeListener");
++ propertyChangeArgs[0] = this;
++
++ } catch (ClassNotFoundException e) {
++ System.out.println("EXCEPTION - Class 'java.beans.*' not in CLASSPATH");
++ return false;
++ }
++
++ return true;
++ }
++
++ /**
++ * Installs all appropriate Swing listeners to just the component.
++ * Also calls super (AWTEventsListener.installListeners()) to install
++ * the requested AWT listeners.
++ * @param c the component to add listeners to
++ */
++ protected void installListeners(Component c) {
++
++ // This SwingEventListener needs to be notified when a new
++ // Swing component has been added so it can add Swing listeners
++ // to these components. As a result, we always need a Container
++ // listener on every Container.
++ //
++ installListeners(c,EventID.CONTAINER);
++
++ // conditionally install Swing listeners
++ //
++ if (SwingEventMonitor.listenerList.getListenerCount(AncestorListener.class) > 0) {
++ installListeners(c,EventID.ANCESTOR);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(CaretListener.class) > 0) {
++ installListeners(c,EventID.CARET);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(CellEditorListener.class) > 0) {
++ installListeners(c,EventID.CELLEDITOR);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(ChangeListener.class) > 0) {
++ installListeners(c,EventID.CHANGE);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TableColumnModelListener.class) > 0) {
++ installListeners(c,EventID.COLUMNMODEL);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(DocumentListener.class) > 0) {
++ installListeners(c,EventID.DOCUMENT);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(ListDataListener.class) > 0) {
++ installListeners(c,EventID.LISTDATA);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(ListSelectionListener.class) > 0) {
++ installListeners(c,EventID.LISTSELECTION);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(MenuListener.class) > 0) {
++ installListeners(c,EventID.MENU);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(PopupMenuListener.class) > 0) {
++ installListeners(c,EventID.POPUPMENU);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TableModelListener.class) > 0) {
++ installListeners(c,EventID.TABLEMODEL);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TreeExpansionListener.class) > 0) {
++ installListeners(c,EventID.TREEEXPANSION);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TreeModelListener.class) > 0) {
++ installListeners(c,EventID.TREEMODEL);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TreeSelectionListener.class) > 0) {
++ installListeners(c,EventID.TREESELECTION);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(UndoableEditListener.class) > 0) {
++ installListeners(c,EventID.UNDOABLEEDIT);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(InternalFrameListener.class) > 0) {
++ installListeners(c,EventID.INTERNALFRAME);
++ }
++
++ // Conditionally install Beans listeners
++ //
++ if (SwingEventMonitor.listenerList.getListenerCount(PropertyChangeListener.class) > 0) {
++ installListeners(c,EventID.PROPERTYCHANGE);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(VetoableChangeListener.class) > 0) {
++ installListeners(c,EventID.VETOABLECHANGE);
++ }
++
++ // Now install the AWT listeners if needed.
++ //
++ super.installListeners(c);
++ }
++
++ /**
++ * Installs all appropriate Swing listeners to the component and all its
++ * children. As a precaution, it always attempts to remove itself as
++ * a listener first so we're always guaranteed it will installed itself
++ * just once.
++ * @param c the component to add listeners to
++ * @param eventID the eventID to add listeners for
++ */
++ protected void installListeners(Component c, int eventID) {
++
++ // install the appropriate listener hook into this component
++ //
++ switch (eventID) {
++
++ case EventID.CONTAINER:
++ if (c instanceof Container) {
++ ((Container) c).removeContainerListener(this);
++ ((Container) c).addContainerListener(this);
++ }
++ break;
++
++ case EventID.ANCESTOR:
++ if (c instanceof JComponent) {
++ ((JComponent) c).removeAncestorListener(this);
++ ((JComponent) c).addAncestorListener(this);
++ }
++ break;
++
++ case EventID.CARET:
++ try {
++ removeCaretMethod = c.getClass().getMethod(
++ "removeCaretListener", caretListeners);
++ addCaretMethod = c.getClass().getMethod(
++ "addCaretListener", caretListeners);
++ try {
++ removeCaretMethod.invoke(c, caretArgs);
++ addCaretMethod.invoke(c, caretArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.CELLEDITOR:
++ // Look for components which support the getCellEditor method
++ // (e.g. JTable, JTree)
++ //
++ try {
++ getCellEditorMethod = c.getClass().getMethod(
++ "getCellEditorMethod", nullClass);
++ try {
++ Object o = getCellEditorMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof CellEditor) {
++ ((CellEditor) o).removeCellEditorListener(this);
++ ((CellEditor) o).addCellEditorListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support CellEditor listeners
++ // (no current example)
++ //
++ try {
++ removeCellEditorMethod = c.getClass().getMethod(
++ "removeCellEditorListener", cellEditorListeners);
++ addCellEditorMethod = c.getClass().getMethod(
++ "addCellEditorListener", cellEditorListeners);
++ try {
++ removeCellEditorMethod.invoke(c, cellEditorArgs);
++ addCellEditorMethod.invoke(c, cellEditorArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.CHANGE:
++ // [[[FIXME: Need to add support for Style, StyleContext -pk]]]
++
++ // Look for components which support Change listeners
++ // (e.g. AbstractButton, Caret, JProgressBar, JSlider,
++ // JTabbedpane, JTextComponent, JViewport)
++ //
++ try {
++ removeChangeMethod = c.getClass().getMethod(
++ "removeChangeListener", changeListeners);
++ addChangeMethod = c.getClass().getMethod(
++ "addChangeListener", changeListeners);
++ try {
++ removeChangeMethod.invoke(c, changeArgs);
++ addChangeMethod.invoke(c, changeArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support the getModel method
++ // whose model supports Change listeners
++ // (e.g. BoundedRangeModel, ButtonModel, SingleSelectionModel)
++ //
++ try {
++ getModelMethod = c.getClass().getMethod(
++ "getModel", nullClass);
++ try {
++ Object o = getModelMethod.invoke(c, nullArgs);
++ if (o != null) {
++ removeChangeMethod = o.getClass().getMethod(
++ "removeChangeListener", changeListeners);
++ addChangeMethod = o.getClass().getMethod(
++ "addChangeListener", changeListeners);
++ removeChangeMethod.invoke(o, changeArgs);
++ addChangeMethod.invoke(o, changeArgs);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ break;
++
++ case EventID.COLUMNMODEL:
++ try {
++ getColumnModelMethod = c.getClass().getMethod(
++ "getTableColumnModel", nullClass);
++ try {
++ Object o = getColumnModelMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof TableColumnModel) {
++ ((TableColumnModel) o).removeColumnModelListener(this);
++ ((TableColumnModel) o).addColumnModelListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.DOCUMENT:
++ // Look for components which support the getDocument method
++ // (e.g. JTextComponent)
++ //
++ try {
++ getDocumentMethod = c.getClass().getMethod(
++ "getDocument", nullClass);
++ try {
++ Object o = getDocumentMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof Document) {
++ ((Document) o).removeDocumentListener(this);
++ ((Document) o).addDocumentListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support Document listeners
++ // (no current example)
++ //
++ try {
++ removeDocumentMethod = c.getClass().getMethod(
++ "removeDocumentListener", documentListeners);
++ addDocumentMethod = c.getClass().getMethod(
++ "addDocumentListener", documentListeners);
++ try {
++ removeDocumentMethod.invoke(c, documentArgs);
++ addDocumentMethod.invoke(c, documentArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ // Add the monitor as a PropertyChangeListener for document
++ // change events from text components.
++ //
++ if (c instanceof JTextComponent) {
++ try {
++ removePropertyChangeMethod = c.getClass().getMethod(
++ "removePropertyChangeListener",
++ propertyChangeListeners);
++ addPropertyChangeMethod = c.getClass().getMethod(
++ "addPropertyChangeListener",
++ propertyChangeListeners);
++ try {
++ removePropertyChangeMethod.invoke(c,
++ propertyChangeArgs);
++ addPropertyChangeMethod.invoke(c,
++ propertyChangeArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ }
++ break;
++
++ case EventID.LISTDATA:
++ case EventID.TABLEMODEL:
++ case EventID.TREEMODEL:
++ try {
++ getModelMethod = c.getClass().getMethod(
++ "getModel", nullClass);
++ try {
++ Object o = getModelMethod.invoke(c, nullArgs);
++ if (o != null) {
++ if (eventID == EventID.LISTDATA &&
++ o instanceof ListModel) {
++ ((ListModel) o).removeListDataListener(this);
++ ((ListModel) o).addListDataListener(this);
++ } else if (eventID == EventID.TABLEMODEL &&
++ o instanceof TableModel) {
++ ((TableModel) o).removeTableModelListener(this);
++ ((TableModel) o).addTableModelListener(this);
++ } else if (
++ o instanceof TreeModel) {
++ ((TreeModel) o).removeTreeModelListener(this);
++ ((TreeModel) o).addTreeModelListener(this);
++ }
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.LISTSELECTION:
++ // Look for components which support ListSelectionListeners
++ // (e.g. JList)
++ //
++ try {
++ removeListSelectionMethod = c.getClass().getMethod(
++ "removeListSelectionListener", listSelectionListeners);
++ addListSelectionMethod = c.getClass().getMethod(
++ "addListSelectionListener", listSelectionListeners);
++ try {
++ removeListSelectionMethod.invoke(c, listSelectionArgs);
++ addListSelectionMethod.invoke(c, listSelectionArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for selection models which support ListSelectionListeners
++ // (e.g. JTable's selection model)
++ //
++ try {
++ getSelectionModelMethod = c.getClass().getMethod(
++ "getSelectionModel", nullClass);
++ try {
++ Object o = getSelectionModelMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof ListSelectionModel) {
++ ((ListSelectionModel) o).removeListSelectionListener(this);
++ ((ListSelectionModel) o).addListSelectionListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.MENU:
++ try {
++ removeMenuMethod = c.getClass().getMethod(
++ "removeMenuListener", menuListeners);
++ addMenuMethod = c.getClass().getMethod(
++ "addMenuListener", menuListeners);
++ try {
++ removeMenuMethod.invoke(c, menuArgs);
++ addMenuMethod.invoke(c, menuArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.POPUPMENU:
++ // Look for components which support PopupMenuListeners
++ // (e.g. JPopupMenu)
++ //
++ try {
++ removePopupMenuMethod = c.getClass().getMethod(
++ "removePopupMenuListener", popupMenuListeners);
++ addPopupMenuMethod = c.getClass().getMethod(
++ "addPopupMenuListener", popupMenuListeners);
++ try {
++ removePopupMenuMethod.invoke(c, popupMenuArgs);
++ addPopupMenuMethod.invoke(c, popupMenuArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support getPopupMenu
++ // (e.g. JMenu)
++ //
++ try {
++ getPopupMenuMethod = c.getClass().getMethod(
++ "getPopupMenu", nullClass);
++ try {
++ Object o = getPopupMenuMethod.invoke(c, nullArgs);
++ if (o != null) {
++ removePopupMenuMethod = o.getClass().getMethod(
++ "removePopupMenuListener", popupMenuListeners);
++ addPopupMenuMethod = o.getClass().getMethod(
++ "addPopupMenuListener", popupMenuListeners);
++ removePopupMenuMethod.invoke(o, popupMenuArgs);
++ addPopupMenuMethod.invoke(o, popupMenuArgs);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.TREEEXPANSION:
++ try {
++ removeTreeExpansionMethod = c.getClass().getMethod(
++ "removeTreeExpansionListener", treeExpansionListeners);
++ addTreeExpansionMethod = c.getClass().getMethod(
++ "addTreeExpansionListener", treeExpansionListeners);
++ try {
++ removeTreeExpansionMethod.invoke(c, treeExpansionArgs);
++ addTreeExpansionMethod.invoke(c, treeExpansionArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.TREESELECTION:
++ try {
++ removeTreeSelectionMethod = c.getClass().getMethod(
++ "removeTreeSelectionListener", treeSelectionListeners);
++ addTreeSelectionMethod = c.getClass().getMethod(
++ "addTreeSelectionListener", treeSelectionListeners);
++ try {
++ removeTreeSelectionMethod.invoke(c, treeSelectionArgs);
++ addTreeSelectionMethod.invoke(c, treeSelectionArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.UNDOABLEEDIT:
++ // Look for components which support the getDocument method
++ // (e.g. JTextComponent)
++ //
++ try {
++ getDocumentMethod = c.getClass().getMethod(
++ "getDocument", nullClass);
++ try {
++ Object o = getDocumentMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof Document) {
++ ((Document) o).removeUndoableEditListener(this);
++ ((Document) o).addUndoableEditListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support UndoableEdit listeners
++ // (no current example)
++ //
++ try {
++ removeUndoableEditMethod = c.getClass().getMethod(
++ "removeUndoableEditListener", undoableEditListeners);
++ addUndoableEditMethod = c.getClass().getMethod(
++ "addUndoableEditListener", undoableEditListeners);
++ try {
++ removeUndoableEditMethod.invoke(c, undoableEditArgs);
++ addUndoableEditMethod.invoke(c, undoableEditArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.INTERNALFRAME:
++ // Look for components which support InternalFrame listeners
++ // (e.g. JInternalFrame)
++ //
++ try {
++ removeInternalFrameMethod = c.getClass().getMethod(
++ "removeInternalFrameListener", internalFrameListeners);
++ addInternalFrameMethod = c.getClass().getMethod(
++ "addInternalFrameListener", internalFrameListeners);
++ try {
++ removeInternalFrameMethod.invoke(c, internalFrameArgs);
++ addInternalFrameMethod.invoke(c, internalFrameArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.PROPERTYCHANGE:
++ // Look for components which support PropertyChange listeners
++ // (e.g. JComponent)
++ //
++ try {
++ removePropertyChangeMethod = c.getClass().getMethod(
++ "removePropertyChangeListener", propertyChangeListeners);
++ addPropertyChangeMethod = c.getClass().getMethod(
++ "addPropertyChangeListener", propertyChangeListeners);
++ try {
++ removePropertyChangeMethod.invoke(c, propertyChangeArgs);
++ addPropertyChangeMethod.invoke(c, propertyChangeArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support the getSelectionModel method
++ // (e.g. JTextComponent)
++ //
++ try {
++ getSelectionModelMethod = c.getClass().getMethod(
++ "getSelectionModel", nullClass);
++ try {
++ Object o = getSelectionModelMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof TreeSelectionModel) {
++ ((TreeSelectionModel) o).removePropertyChangeListener(this);
++ ((TreeSelectionModel) o).addPropertyChangeListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.VETOABLECHANGE:
++ if (c instanceof JComponent) {
++ ((JComponent) c).removeVetoableChangeListener(this);
++ ((JComponent) c).addVetoableChangeListener(this);
++ }
++ break;
++
++ // Don't bother recursing the children if this isn't going to
++ // accomplish anything.
++ //
++ default:
++ return;
++ }
++
++ if (c instanceof Container) {
++ int count = ((Container) c).getComponentCount();
++ for (int i = 0; i < count; i++) {
++ installListeners(((Container) c).getComponent(i), eventID);
++ }
++ }
++ }
++
++ /**
++ * Removes all listeners for the given component and all its children.
++ * @param c the component
++ */
++ protected void removeListeners(Component c) {
++
++ // conditionaly remove the Swing listeners
++ //
++ if (SwingEventMonitor.listenerList.getListenerCount(AncestorListener.class) > 0) {
++ removeListeners(c,EventID.ANCESTOR);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(CaretListener.class) > 0) {
++ removeListeners(c,EventID.CARET);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(CellEditorListener.class) > 0) {
++ removeListeners(c,EventID.CELLEDITOR);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(ChangeListener.class) > 0) {
++ removeListeners(c,EventID.CHANGE);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TableColumnModelListener.class) > 0) {
++ removeListeners(c,EventID.COLUMNMODEL);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(DocumentListener.class) > 0) {
++ removeListeners(c,EventID.DOCUMENT);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(ListDataListener.class) > 0) {
++ removeListeners(c,EventID.LISTDATA);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(ListSelectionListener.class) > 0) {
++ removeListeners(c,EventID.LISTSELECTION);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(MenuListener.class) > 0) {
++ removeListeners(c,EventID.MENU);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(PopupMenuListener.class) > 0) {
++ removeListeners(c,EventID.POPUPMENU);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TableModelListener.class) > 0) {
++ removeListeners(c,EventID.TABLEMODEL);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TreeExpansionListener.class) > 0) {
++ removeListeners(c,EventID.TREEEXPANSION);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TreeModelListener.class) > 0) {
++ removeListeners(c,EventID.TREEMODEL);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(TreeSelectionListener.class) > 0) {
++ removeListeners(c,EventID.TREESELECTION);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(UndoableEditListener.class) > 0) {
++ removeListeners(c,EventID.UNDOABLEEDIT);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(InternalFrameListener.class) > 0) {
++ removeListeners(c,EventID.INTERNALFRAME);
++ }
++
++ // conditionaly remove the beans listeners
++ //
++ if (SwingEventMonitor.listenerList.getListenerCount(PropertyChangeListener.class) > 0) {
++ removeListeners(c,EventID.PROPERTYCHANGE);
++ }
++ if (SwingEventMonitor.listenerList.getListenerCount(VetoableChangeListener.class) > 0) {
++ removeListeners(c,EventID.VETOABLECHANGE);
++ }
++
++ // Now remove the AWT listeners if needed.
++ //
++ super.removeListeners(c);
++ }
++
++ /**
++ * Removes all Swing listeners for the event ID from the component and
++ * all of its children.
++ * @param c the component to remove listeners from
++ */
++ protected void removeListeners(Component c, int eventID) {
++
++ // remove the appropriate listener hook into this component
++ //
++ switch (eventID) {
++
++ case EventID.CONTAINER:
++ //Never remove these because we're always interested in them
++ // for our own use.
++ break;
++
++ case EventID.ANCESTOR:
++ if (c instanceof JComponent) {
++ ((JComponent) c).removeAncestorListener(this);
++ }
++ break;
++
++ case EventID.CARET:
++ try {
++ removeCaretMethod = c.getClass().getMethod(
++ "removeCaretListener", caretListeners);
++ try {
++ removeCaretMethod.invoke(c, caretArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.CELLEDITOR:
++ // Look for components which support the getCellEditor method
++ // (e.g. JTable, JTree)
++ //
++ try {
++ getCellEditorMethod = c.getClass().getMethod(
++ "getCellEditorMethod", nullClass);
++ try {
++ Object o = getCellEditorMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof CellEditor) {
++ ((CellEditor) o).removeCellEditorListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support CellEditor listeners
++ // (no current example)
++ //
++ try {
++ removeCellEditorMethod = c.getClass().getMethod(
++ "removeCellEditorListener", cellEditorListeners);
++ try {
++ removeCellEditorMethod.invoke(c, cellEditorArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.CHANGE:
++ // [[[FIXME: Need to add support for Style, StyleContext -pk ]]]
++
++ // Look for components which support Change listeners
++ // (e.g. AbstractButton, Caret, JProgressBar, JSlider,
++ // JTabbedpane, JTextComponent, JViewport)
++ //
++ try {
++ removeChangeMethod = c.getClass().getMethod(
++ "removeChangeListener", changeListeners);
++ try {
++ removeChangeMethod.invoke(c, changeArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support the getModel method
++ // whose model supports Change listeners
++ // (e.g. BoundedRangeModel, ButtonModel, SingleSelectionModel)
++ //
++ try {
++ getModelMethod = c.getClass().getMethod(
++ "getModel", nullClass);
++ try {
++ Object o = getModelMethod.invoke(c, nullArgs);
++ if (o != null) {
++ removeChangeMethod = o.getClass().getMethod(
++ "removeChangeListener", changeListeners);
++ removeChangeMethod.invoke(o, changeArgs);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.COLUMNMODEL:
++ try {
++ getColumnModelMethod = c.getClass().getMethod(
++ "getTableColumnModel", nullClass);
++ try {
++ Object o = getColumnModelMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof TableColumnModel) {
++ ((TableColumnModel) o).removeColumnModelListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.DOCUMENT:
++ // Look for components which support the getDocument method
++ // (e.g. JTextComponent)
++ //
++ try {
++ getDocumentMethod = c.getClass().getMethod(
++ "getDocument", nullClass);
++ try {
++ Object o = getDocumentMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof Document) {
++ ((Document) o).removeDocumentListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support Document listeners
++ // (no current example)
++ //
++ try {
++ removeDocumentMethod = c.getClass().getMethod(
++ "removeDocumentListener", documentListeners);
++ try {
++ removeDocumentMethod.invoke(c, documentArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.LISTDATA:
++ case EventID.TABLEMODEL:
++ case EventID.TREEMODEL:
++ try {
++ getModelMethod = c.getClass().getMethod(
++ "getModel", nullClass);
++ try {
++ Object o = getModelMethod.invoke(c, nullArgs);
++ if (o != null) {
++ if (eventID == EventID.LISTDATA &&
++ o instanceof ListModel) {
++ ((ListModel) o).removeListDataListener(this);
++ } else if (eventID == EventID.TABLEMODEL &&
++ o instanceof TableModel) {
++ ((TableModel) o).removeTableModelListener(this);
++ } else if (
++ o instanceof TreeModel) {
++ ((TreeModel) o).removeTreeModelListener(this);
++ }
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.LISTSELECTION:
++ // Look for components which support ListSelectionListeners
++ // (e.g. JList)
++ //
++ try {
++ removeListSelectionMethod = c.getClass().getMethod(
++ "removeListSelectionListener", listSelectionListeners);
++ try {
++ removeListSelectionMethod.invoke(c, listSelectionArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for selection models which support
++ // ListSelectionListeners (e.g. JTable's selection model)
++ //
++ try {
++ getSelectionModelMethod = c.getClass().getMethod(
++ "getSelectionModel", nullClass);
++ try {
++ Object o = getSelectionModelMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof ListSelectionModel) {
++ ((ListSelectionModel) o).removeListSelectionListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.MENU:
++ try {
++ removeMenuMethod = c.getClass().getMethod(
++ "removeMenuListener", menuListeners);
++ try {
++ removeMenuMethod.invoke(c, menuArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.POPUPMENU:
++ // Look for components which support PopupMenuListeners
++ // (e.g. JPopupMenu)
++ //
++ try {
++ removePopupMenuMethod = c.getClass().getMethod(
++ "removePopupMenuListener", popupMenuListeners);
++ try {
++ removePopupMenuMethod.invoke(c, popupMenuArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support getPopupMenu
++ // (e.g. JMenu)
++ //
++ try {
++ getPopupMenuMethod = c.getClass().getMethod(
++ "getPopupMenu", nullClass);
++ try {
++ Object o = getPopupMenuMethod.invoke(c, nullArgs);
++ if (o != null) {
++ removePopupMenuMethod = o.getClass().getMethod(
++ "removePopupMenuListener", popupMenuListeners);
++ removePopupMenuMethod.invoke(o, popupMenuArgs);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.TREEEXPANSION:
++ try {
++ removeTreeExpansionMethod = c.getClass().getMethod(
++ "removeTreeExpansionListener", treeExpansionListeners);
++ try {
++ removeTreeExpansionMethod.invoke(c, treeExpansionArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.TREESELECTION:
++ try {
++ removeTreeSelectionMethod = c.getClass().getMethod(
++ "removeTreeSelectionListener", treeSelectionListeners);
++ try {
++ removeTreeSelectionMethod.invoke(c, treeSelectionArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.UNDOABLEEDIT:
++ // Look for components which support the getDocument method
++ // (e.g. JTextComponent)
++ //
++ try {
++ getDocumentMethod = c.getClass().getMethod(
++ "getDocument", nullClass);
++ try {
++ Object o = getDocumentMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof Document) {
++ ((Document) o).removeUndoableEditListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support UndoableEdit listeners
++ // (no current example)
++ //
++ try {
++ removeUndoableEditMethod = c.getClass().getMethod(
++ "removeUndoableEditListener", undoableEditListeners);
++ try {
++ removeUndoableEditMethod.invoke(c, undoableEditArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.INTERNALFRAME:
++ try {
++ removeInternalFrameMethod = c.getClass().getMethod(
++ "removeInternalFrameListener", internalFrameListeners);
++ try {
++ removeInternalFrameMethod.invoke(c, internalFrameArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.PROPERTYCHANGE:
++ // Look for components which support PropertyChange listeners
++ // (e.g. JComponent)
++ //
++ try {
++ removePropertyChangeMethod = c.getClass().getMethod(
++ "removePropertyChangeListener", propertyChangeListeners);
++ try {
++ removePropertyChangeMethod.invoke(c, propertyChangeArgs);
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++
++ // Look for components which support the getSelectionModel
++ // method (e.g. JTextComponent)
++ //
++ try {
++ getSelectionModelMethod = c.getClass().getMethod(
++ "getSelectionModel", nullClass);
++ try {
++ Object o = getSelectionModelMethod.invoke(c, nullArgs);
++ if (o != null && o instanceof TreeSelectionModel) {
++ ((TreeSelectionModel) o).removePropertyChangeListener(this);
++ }
++ } catch (java.lang.reflect.InvocationTargetException e) {
++ System.out.println("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ } catch (NoSuchMethodException e) {
++ // System.out.println("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ System.out.println("Exception: " + e.toString());
++ }
++ break;
++
++ case EventID.VETOABLECHANGE:
++ if (c instanceof JComponent) {
++ ((JComponent) c).removeVetoableChangeListener(this);
++ }
++ break;
++
++ default:
++ return;
++ }
++
++ if (c instanceof Container) {
++ int count = ((Container) c).getComponentCount();
++ for (int i = 0; i < count; i++) {
++ removeListeners(((Container) c).getComponent(i), eventID);
++ }
++ }
++ }
++
++ /********************************************************************/
++ /* */
++ /* Listener Interface Methods */
++ /* */
++ /********************************************************************/
++
++ /* ContainerListener Methods ************************************/
++
++ public void componentAdded(ContainerEvent e) {
++ installListeners(e.getChild());
++ }
++ public void componentRemoved(ContainerEvent e) {
++ removeListeners(e.getChild());
++ }
++
++ /* AncestorListener Methods ******************************************/
++
++ public void ancestorAdded(AncestorEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==AncestorListener.class) {
++ ((AncestorListener)listeners[i+1]).ancestorAdded(e);
++ }
++ }
++ }
++
++ public void ancestorRemoved(AncestorEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==AncestorListener.class) {
++ ((AncestorListener)listeners[i+1]).ancestorRemoved(e);
++ }
++ }
++ }
++
++ public void ancestorMoved(AncestorEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==AncestorListener.class) {
++ ((AncestorListener)listeners[i+1]).ancestorMoved(e);
++ }
++ }
++ }
++
++ /* CaretListener Methods ******************************************/
++
++ public void caretUpdate(CaretEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==CaretListener.class) {
++ ((CaretListener)listeners[i+1]).caretUpdate(e);
++ }
++ }
++ }
++
++ /* CellEditorListener Methods *****************************************/
++
++ public void editingStopped(ChangeEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==CellEditorListener.class) {
++ ((CellEditorListener)listeners[i+1]).editingStopped(e);
++ }
++ }
++ }
++
++ public void editingCanceled(ChangeEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==CellEditorListener.class) {
++ ((CellEditorListener)listeners[i+1]).editingCanceled(e);
++ }
++ }
++ }
++
++ /* ChangeListener Methods *****************************************/
++
++ public void stateChanged(ChangeEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==ChangeListener.class) {
++ ((ChangeListener)listeners[i+1]).stateChanged(e);
++ }
++ }
++ }
++
++ /* TableColumnModelListener Methods *******************************/
++
++ public void columnAdded(TableColumnModelEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TableColumnModelListener.class) {
++ ((TableColumnModelListener)listeners[i+1]).columnAdded(e);
++ }
++ }
++ }
++ public void columnMarginChanged(ChangeEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TableColumnModelListener.class) {
++ ((TableColumnModelListener)listeners[i+1]).columnMarginChanged(e);
++ }
++ }
++ }
++ public void columnMoved(TableColumnModelEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TableColumnModelListener.class) {
++ ((TableColumnModelListener)listeners[i+1]).columnMoved(e);
++ }
++ }
++ }
++ public void columnRemoved(TableColumnModelEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TableColumnModelListener.class) {
++ ((TableColumnModelListener)listeners[i+1]).columnRemoved(e);
++ }
++ }
++ }
++ public void columnSelectionChanged(ListSelectionEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TableColumnModelListener.class) {
++ ((TableColumnModelListener)listeners[i+1]).columnSelectionChanged(e);
++ }
++ }
++ }
++
++ /* DocumentListener Methods **************************************/
++
++ public void changedUpdate(DocumentEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==DocumentListener.class) {
++ ((DocumentListener)listeners[i+1]).changedUpdate(e);
++ }
++ }
++ }
++ public void insertUpdate(DocumentEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==DocumentListener.class) {
++ ((DocumentListener)listeners[i+1]).insertUpdate(e);
++ }
++ }
++ }
++ public void removeUpdate(DocumentEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==DocumentListener.class) {
++ ((DocumentListener)listeners[i+1]).removeUpdate(e);
++ }
++ }
++ }
++
++ /* ListDataListener Methods *****************************************/
++
++ public void contentsChanged(ListDataEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==ListDataListener.class) {
++ ((ListDataListener)listeners[i+1]).contentsChanged(e);
++ }
++ }
++ }
++ public void intervalAdded(ListDataEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==ListDataListener.class) {
++ ((ListDataListener)listeners[i+1]).intervalAdded(e);
++ }
++ }
++ }
++ public void intervalRemoved(ListDataEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==ListDataListener.class) {
++ ((ListDataListener)listeners[i+1]).intervalRemoved(e);
++ }
++ }
++ }
++
++ /* ListSelectionListener Methods ***********************************/
++
++ public void valueChanged(ListSelectionEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==ListSelectionListener.class) {
++ ((ListSelectionListener)listeners[i+1]).valueChanged(e);
++ }
++ }
++ }
++
++ /* MenuListener Methods *****************************************/
++
++ public void menuCanceled(MenuEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==MenuListener.class) {
++ ((MenuListener)listeners[i+1]).menuCanceled(e);
++ }
++ }
++ }
++ public void menuDeselected(MenuEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==MenuListener.class) {
++ ((MenuListener)listeners[i+1]).menuDeselected(e);
++ }
++ }
++ }
++ public void menuSelected(MenuEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==MenuListener.class) {
++ ((MenuListener)listeners[i+1]).menuSelected(e);
++ }
++ }
++ }
++
++ /* PopupMenuListener Methods **************************************/
++
++ public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==PopupMenuListener.class) {
++ ((PopupMenuListener)listeners[i+1]).popupMenuWillBecomeVisible(e);
++ }
++ }
++ }
++
++ public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==PopupMenuListener.class) {
++ ((PopupMenuListener)listeners[i+1]).popupMenuWillBecomeInvisible(e);
++ }
++ }
++ }
++
++ public void popupMenuCanceled(PopupMenuEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==PopupMenuListener.class) {
++ ((PopupMenuListener)listeners[i+1]).popupMenuCanceled(e);
++ }
++ }
++ }
++
++ /* TableModelListener Methods **************************************/
++
++ public void tableChanged(TableModelEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TableModelListener.class) {
++ ((TableModelListener)listeners[i+1]).tableChanged(e);
++ }
++ }
++ }
++
++ /* TreeExpansionListener Methods **********************************/
++
++ public void treeCollapsed(TreeExpansionEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TreeExpansionListener.class) {
++ ((TreeExpansionListener)listeners[i+1]).treeCollapsed(e);
++ }
++ }
++ }
++ public void treeExpanded(TreeExpansionEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TreeExpansionListener.class) {
++ ((TreeExpansionListener)listeners[i+1]).treeExpanded(e);
++ }
++ }
++ }
++
++ /* TreeModelListener Methods **********************************/
++
++ public void treeNodesChanged(TreeModelEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TreeModelListener.class) {
++ ((TreeModelListener)listeners[i+1]).treeNodesChanged(e);
++ }
++ }
++ }
++ public void treeNodesInserted(TreeModelEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TreeModelListener.class) {
++ ((TreeModelListener)listeners[i+1]).treeNodesInserted(e);
++ }
++ }
++ }
++ public void treeNodesRemoved(TreeModelEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TreeModelListener.class) {
++ ((TreeModelListener)listeners[i+1]).treeNodesRemoved(e);
++ }
++ }
++ }
++ public void treeStructureChanged(TreeModelEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TreeModelListener.class) {
++ ((TreeModelListener)listeners[i+1]).treeStructureChanged(e);
++ }
++ }
++ }
++
++ /* TreeSelectionListener Methods ***********************************/
++
++ public void valueChanged(TreeSelectionEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==TreeSelectionListener.class) {
++ ((TreeSelectionListener)listeners[i+1]).valueChanged(e);
++ }
++ }
++ }
++
++ /* UndoableEditListener Methods **************************************/
++
++ public void undoableEditHappened(UndoableEditEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==UndoableEditListener.class) {
++ ((UndoableEditListener)listeners[i+1]).undoableEditHappened(e);
++ }
++ }
++ }
++
++ /* InternalFrame Methods **********************************/
++
++ public void internalFrameOpened(InternalFrameEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==InternalFrameListener.class) {
++ ((InternalFrameListener)listeners[i+1]).internalFrameOpened(e);
++ }
++ }
++ }
++
++ public void internalFrameActivated(InternalFrameEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==InternalFrameListener.class) {
++ ((InternalFrameListener)listeners[i+1]).internalFrameActivated(e);
++ }
++ }
++ }
++
++ public void internalFrameDeactivated(InternalFrameEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==InternalFrameListener.class) {
++ ((InternalFrameListener)listeners[i+1]).internalFrameDeactivated(e);
++ }
++ }
++ }
++
++ public void internalFrameIconified(InternalFrameEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==InternalFrameListener.class) {
++ ((InternalFrameListener)listeners[i+1]).internalFrameIconified(e);
++ }
++ }
++ }
++
++ public void internalFrameDeiconified(InternalFrameEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==InternalFrameListener.class) {
++ ((InternalFrameListener)listeners[i+1]).internalFrameDeiconified(e);
++ }
++ }
++ }
++
++ public void internalFrameClosing(InternalFrameEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==InternalFrameListener.class) {
++ ((InternalFrameListener)listeners[i+1]).internalFrameClosing(e);
++ }
++ }
++ }
++
++ public void internalFrameClosed(InternalFrameEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==InternalFrameListener.class) {
++ ((InternalFrameListener)listeners[i+1]).internalFrameClosed(e);
++ }
++ }
++ }
++
++ /* PropertyChangeListener Methods **********************************/
++
++ public void propertyChange(PropertyChangeEvent e) {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==PropertyChangeListener.class) {
++ ((PropertyChangeListener)listeners[i+1]).propertyChange(e);
++ }
++ }
++ // Re-add the monitor as a DocumentChangeListener if
++ // the document changed in the text component.
++ if (e.getSource() instanceof JTextComponent) {
++ Document c = ((JTextComponent)e.getSource()).getDocument();
++ if (c == null) {
++ return;
++ }
++ try {
++ removeDocumentMethod = c.getClass().getMethod(
++ "removeDocumentListener", documentListeners);
++ addDocumentMethod = c.getClass().getMethod(
++ "addDocumentListener", documentListeners);
++ try {
++ removeDocumentMethod.invoke(c, documentArgs);
++ addDocumentMethod.invoke(c, documentArgs);
++ } catch (java.lang.reflect.InvocationTargetException e2) {
++ System.out.println("Exception: " + e2.toString());
++ } catch (IllegalAccessException e2) {
++ System.out.println("Exception: " + e2.toString());
++ }
++ } catch (NoSuchMethodException e2) {
++ // System.out.println("Exception: " + e2.toString());
++ } catch (SecurityException e2) {
++ System.out.println("Exception: " + e2.toString());
++ }
++ }
++
++ }
++
++ /* VetoableChangeListener Methods **********************************/
++
++ public void vetoableChange(PropertyChangeEvent e)
++ throws PropertyVetoException {
++ Object[] listeners = SwingEventMonitor.listenerList.getListenerList();
++ for (int i = listeners.length-2; i>=0; i-=2) {
++ if (listeners[i]==VetoableChangeListener.class) {
++ ((VetoableChangeListener)listeners[i+1]).vetoableChange(e);
++ }
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/TopLevelWindowListener.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package com.sun.java.accessibility.util;
++
++import java.awt.*;
++import java.util.*;
++import javax.accessibility.*;
++
++/**
++ * The {@code TopLevelWindowListener} interface is used by the {@link EventQueueMonitor}
++ * class to notify an interested party when a top level window is created
++ * or destroyed in the Java Virtual Machine. Classes wishing to express
++ * an interest in top level window events should implement this interface
++ * and register themselves with the {@code EventQueueMonitor} by calling the
++ * {@link EventQueueMonitor#addTopLevelWindowListener EventQueueMonitor.addTopLevelWindowListener}
++ * class method.
++ *
++ * @see EventQueueMonitor
++ * @see EventQueueMonitor#addTopLevelWindowListener
++ * @see EventQueueMonitor#removeTopLevelWindowListener
++ *
++ */
++@jdk.Exported
++public interface TopLevelWindowListener extends EventListener {
++
++ /**
++ * Invoked when a new top level window has been created.
++ *
++ * @param w the Window that was created
++ */
++ public void topLevelWindowCreated(Window w);
++
++ /**
++ * Invoked when a top level window has been destroyed.
++ *
++ * @param w the Window that was destroyed
++ */
++ public void topLevelWindowDestroyed(Window w);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/TopLevelWindowMulticaster.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,86 @@
++/*
++ * 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. 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 com.sun.java.accessibility.util;
++
++import java.awt.*;
++import java.util.EventListener;
++import javax.accessibility.*;
++
++
++/**
++ * The TopLevelWindowMulticaster class is used to maintain a list of
++ * TopLevelWindowListener classes. It is intended to be used primarily
++ * for internal support in the EventQueueMonitor class, and is not intended
++ * to be used by classes outside the Java Accessibility Utility package.
++ *
++ * @see EventQueueMonitor
++ * @see EventQueueMonitor#addTopLevelWindowListener
++ * @see EventQueueMonitor#removeTopLevelWindowListener
++ *
++ */
++@jdk.Exported(false)
++public class TopLevelWindowMulticaster
++ extends AWTEventMulticaster implements TopLevelWindowListener
++{
++ protected TopLevelWindowMulticaster(EventListener a, EventListener b) {
++ super(a, b);
++ }
++
++ public void topLevelWindowCreated(Window w) {
++ ((TopLevelWindowListener)a).topLevelWindowCreated(w);
++ ((TopLevelWindowListener)b).topLevelWindowCreated(w);
++ }
++
++ public void topLevelWindowDestroyed(Window w) {
++ ((TopLevelWindowListener)a).topLevelWindowDestroyed(w);
++ ((TopLevelWindowListener)b).topLevelWindowDestroyed(w);
++ }
++
++ public static TopLevelWindowListener add(TopLevelWindowListener a, TopLevelWindowListener b) {
++ return (TopLevelWindowListener)addInternal(a, b);
++ }
++
++ public static TopLevelWindowListener remove(TopLevelWindowListener l, TopLevelWindowListener oldl) {
++ return (TopLevelWindowListener)removeInternal(l, oldl);
++ }
++
++ protected static EventListener addInternal(EventListener a, EventListener b) {
++ if (a == null) return b;
++ if (b == null) return a;
++ return new TopLevelWindowMulticaster(a, b);
++ }
++
++ protected static EventListener removeInternal(EventListener l, EventListener oldl) {
++ if (l == oldl || l == null) {
++ return null;
++ } else if (l instanceof TopLevelWindowMulticaster) {
++ return ((TopLevelWindowMulticaster)l).remove(oldl);
++ } else {
++ return l; // it's not here
++ }
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/Translator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,730 @@
++/*
++ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++
++package com.sun.java.accessibility.util;
++
++import java.lang.*;
++import java.beans.*;
++import java.util.*;
++import java.awt.*;
++import java.awt.event.*;
++import java.awt.image.*;
++// Do not import Swing classes. This module is intended to work
++// with both Swing and AWT.
++// import javax.swing.*;
++import javax.accessibility.*;
++
++/**
++ * <p>The {@code Translator} class provides a translation to interface
++ * {@link javax.accessibility.Accessible Accessible}
++ * for objects that do not implement interface {@code Accessible}. Assistive
++ * technologies can use the {@link #getAccessible getAccessible} class method of
++ * {@code Translator} to obtain an object that implements interface {@code Accessible}.
++ * If the object passed in already implements interface {@code Accessible},
++ * {@code getAccessible} merely returns the object.
++ *
++ * <p>An example of how an assistive technology might use the {@code Translator}
++ * class is as follows:
++ *
++ * <PRE>
++ * Accessible accessible = Translator.getAccessible(someObj);
++ * // obtain information from the 'accessible' object.
++ * </PRE>
++ *
++ * <P>Note: This implementation is missing many things and is not a recommended way
++ * to implement accessibility features for a toolkit. Instead of relying upon this
++ * code, a toolkit's components should implement interface {@code Accessible} directly.
++ */
++@jdk.Exported
++public class Translator extends AccessibleContext
++ implements Accessible, AccessibleComponent {
++
++ /** The source object needing translating. */
++ protected Object source;
++
++ /**
++ * Find a translator for this class. If one doesn't exist for this
++ * class explicitly, try its superclass and so on.
++ *
++ * @param c a Class
++ * @return the {@code Translator} Class for the Class passed in
++ */
++ protected static Class getTranslatorClass(Class c) {
++ Class t = null;
++ if (c == null) {
++ return null;
++ }
++ try {
++ t = Class.forName("com.sun.java.accessibility.util."
++ + c.getName()
++ + "Translator");
++ return t;
++ } catch (Exception e) {
++ return getTranslatorClass(c.getSuperclass());
++ }
++ }
++
++ /**
++ * Obtain an object that implements interface {@code Accessible}. If the object
++ * passed in already implements interface {@code Accessible}, {@code getAccessible}
++ * merely returns the object.
++ *
++ * @param o an Object; if a null is passed in a null is returned
++ * @return an {@code Object}, possibly the {@code Object} passed in, that
++ * implements the {@code Accessible} interface for the {@code Object}
++ * which was passed in
++ */
++ public static Accessible getAccessible(Object o) {
++ Accessible a = null;
++
++ if (o == null) {
++ return null;
++ }
++ if (o instanceof Accessible) {
++ a = (Accessible)o;
++ } else {
++ Class translatorClass = getTranslatorClass(o.getClass());
++ if (translatorClass != null) {
++ try {
++ Translator t = (Translator)translatorClass.newInstance();
++ t.setSource(o);
++ a = t;
++ } catch (Exception e) {
++ }
++ }
++ }
++ if (a == null) {
++ a = new Translator(o);
++ }
++ return a;
++ }
++
++ /**
++ * Create a new {@code Translator}. You must call the {@link #setSource setSource}
++ * method to set the object to be translated after calling this constructor.
++ */
++ public Translator() {
++ }
++
++ /**
++ * Create a new {@code Translator} with the source object o.
++ *
++ * @param o the Component that does not implement interface
++ * {@link javax.accessibility.Accessible Accessible}
++ */
++ public Translator(Object o) {
++ source = o;
++ }
++
++ /**
++ * Get the source {@code Object} of the {@code Translator}.
++ *
++ * @return the source {@code Object} of the {@code Translator}
++ */
++ public Object getSource() {
++ return source;
++ }
++
++ /**
++ * Set the source object of the {@code Translator}.
++ *
++ * @param o the Component that does not implement interface Accessible
++ */
++ public void setSource(Object o) {
++ source = o;
++ }
++
++ /**
++ * Returns true if this object is the same as the one passed in.
++ *
++ * @param o the {@code Object} to check against
++ * @return true if this is the same object
++ */
++ public boolean equals(Object o) {
++ return source.equals(o);
++ }
++
++
++// Accessible methods
++
++ /**
++ * Returns this object.
++ */
++ public AccessibleContext getAccessibleContext() {
++ return this;
++ }
++
++// AccessibleContext methods
++
++ /**
++ * Get the accessible name of this object.
++ *
++ * @return the localized name of the object; can be null if this object
++ * does not have a name
++ */
++ public String getAccessibleName() {
++ if (source instanceof MenuItem) {
++ return ((MenuItem) source).getLabel();
++ } else if (source instanceof Component) {
++ return ((Component) source).getName();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Set the name of this object.
++ */
++ public void setAccessibleName(String s) {
++ if (source instanceof MenuItem) {
++ ((MenuItem) source).setLabel(s);
++ } else if (source instanceof Component) {
++ ((Component) source).setName(s);
++ }
++ }
++
++ /**
++ * Get the accessible description of this object.
++ *
++ * @return the description of the object; can be null if this object does
++ * not have a description
++ */
++ public String getAccessibleDescription() {
++ return null;
++ }
++
++ /**
++ * Set the accessible description of this object.
++ *
++ * @param s the new localized description of the object
++ */
++ public void setAccessibleDescription(String s) {
++ }
++
++ /**
++ * Get the role of this object.
++ *
++ * @return an instance of AccessibleRole describing the role of the object
++ */
++ public AccessibleRole getAccessibleRole() {
++ return AccessibleRole.UNKNOWN;
++ }
++
++
++ /**
++ * Get the state of this object, given an already populated state.
++ * This method is intended for use by subclasses so they don't have
++ * to check for everything.
++ *
++ * @return an instance of {@code AccessibleStateSet}
++ * containing the current state of the object
++ */
++ public AccessibleStateSet getAccessibleStateSet() {
++ AccessibleStateSet states = new AccessibleStateSet();
++ if (source instanceof Component) {
++ Component c = (Component) source;
++ for (Container p = c.getParent(); p != null; p = p.getParent()) {
++ if (p instanceof Window) {
++ if (((Window)p).getFocusOwner() == c) {
++ states.add(AccessibleState.FOCUSED);
++ }
++ }
++ }
++ }
++ if (isEnabled()) {
++ states.add(AccessibleState.ENABLED);
++ }
++ if (isFocusTraversable()) {
++ states.add(AccessibleState.FOCUSABLE);
++ }
++ if (source instanceof MenuItem) {
++ states.add(AccessibleState.FOCUSABLE);
++ }
++ return states;
++ }
++
++ /**
++ * Get the accessible parent of this object.
++ *
++ * @return the accessible parent of this object; can be null if this
++ * object does not have an accessible parent
++ */
++ public Accessible getAccessibleParent() {
++ if (accessibleParent != null) {
++ return accessibleParent;
++ } else if (source instanceof Component) {
++ return getAccessible(((Component) source).getParent());
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Get the index of this object in its accessible parent.
++ *
++ * @return -1 of this object does not have an accessible parent; otherwise,
++ * the index of the child in its accessible parent
++ */
++ public int getAccessibleIndexInParent() {
++ if (source instanceof Component) {
++ Container parent = ((Component) source).getParent();
++ if (parent != null) {
++ Component ca[] = parent.getComponents();
++ for (int i = 0; i < ca.length; i++) {
++ if (source.equals(ca[i])) {
++ return i;
++ }
++ }
++ }
++ }
++ return -1;
++ }
++
++ /**
++ * Returns the number of accessible children in the object.
++ *
++ * @return the number of accessible children in the object
++ */
++ public int getAccessibleChildrenCount() {
++ if (source instanceof Container) {
++ Component[] children = ((Container) source).getComponents();
++ int count = 0;
++ for (int i = 0; i < children.length; i++) {
++ Accessible a = getAccessible(children[i]);
++ if (a != null) {
++ count++;
++ }
++ }
++ return count;
++ } else {
++ return 0;
++ }
++ }
++
++ /**
++ * Return the nth accessible child of the object.
++ *
++ * @param i zero-based index of child
++ * @return the nth accessible child of the object
++ */
++ public Accessible getAccessibleChild(int i) {
++ if (source instanceof Container) {
++ Component[] children = ((Container) source).getComponents();
++ int count = 0;
++
++ for (int j = 0; j < children.length; j++) {
++ Accessible a = getAccessible(children[j]);
++ if (a != null) {
++ if (count == i) {
++ AccessibleContext ac = a.getAccessibleContext();
++ if (ac != null) {
++ ac.setAccessibleParent(this);
++ }
++ return a;
++ } else {
++ count++;
++ }
++ }
++ }
++ }
++ return null;
++ }
++
++ /**
++ * Gets the {@code Locale} of the component. If the component does not have a
++ * locale, the locale of its parent is returned.
++ *
++ * @return the {@code Locale} of the object
++ */
++ public Locale getLocale() throws IllegalComponentStateException {
++ if (source instanceof Component) {
++ return ((Component) source).getLocale();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Add a {@code PropertyChangeListener} to the listener list. The listener
++ * is registered for all properties.
++ */
++ public void addPropertyChangeListener(PropertyChangeListener l) {
++ }
++
++ /**
++ * Remove the {@code PropertyChangeListener} from the listener list.
++ */
++ public void removePropertyChangeListener(PropertyChangeListener l) {
++ }
++
++// AccessibleComponent methods
++
++ /**
++ * Get the background {@code Color} of this object.
++ *
++ * @return if supported, the background {@code Color} of the object;
++ * otherwise, null
++ *
++ */
++ public Color getBackground() {
++ if (source instanceof Component) { // MenuComponent doesn't do background
++ return ((Component) source).getBackground();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Set the background {@code Color} of this object.
++ *
++ * @param c the new {@code Color} for the background
++ */
++ public void setBackground(Color c) {
++ if (source instanceof Component) { // MenuComponent doesn't do background
++ ((Component) source).setBackground(c);
++ }
++ }
++
++ /**
++ * Get the foreground {@code Color} of this object.
++ *
++ * @return if supported, the foreground {@code Color} of the object; otherwise, null
++ */
++ public Color getForeground() {
++ if (source instanceof Component) { // MenuComponent doesn't do foreground
++ return ((Component) source).getForeground();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Set the foreground {@code Color} of this object.
++ *
++ * @param c the new {@code Color} for the foreground
++ */
++ public void setForeground(Color c) {
++ if (source instanceof Component) { // MenuComponent doesn't do foreground
++ ((Component) source).setForeground(c);
++ }
++ }
++
++ /**
++ * Get the {@code Cursor} of this object.
++ *
++ * @return if supported, the Cursor of the object; otherwise, null
++ */
++ public Cursor getCursor() {
++ if (source instanceof Component) { // MenuComponent doesn't do cursor
++ return ((Component) source).getCursor();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Set the {@code Cursor} of this object.
++ * @param c the new {@code Cursor} for the object
++ */
++ public void setCursor(Cursor c) {
++ if (source instanceof Component) { // MenuComponent doesn't do cursor
++ ((Component) source).setCursor(c);
++ }
++ }
++
++ /**
++ * Get the {@code Font} of this object.
++ *
++ * @return if supported, the {@code Font} for the object; otherwise, null
++ */
++ public Font getFont() {
++ if (source instanceof Component) {
++ return ((Component) source).getFont();
++ } else if (source instanceof MenuComponent) {
++ return ((MenuComponent) source).getFont();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Set the {@code Font} of this object.
++ *
++ * @param f the new {@code Font} for the object
++ */
++ public void setFont(Font f) {
++ if (source instanceof Component) {
++ ((Component) source).setFont(f);
++ } else if (source instanceof MenuComponent) {
++ ((MenuComponent) source).setFont(f);
++ }
++ }
++
++ /**
++ * Get the {@code FontMetrics} of this object.
++ *
++ * @param f the {@code Font}
++ * @return if supported, the {@code FontMetrics} the object; otherwise, null
++ * @see #getFont
++ */
++ public FontMetrics getFontMetrics(Font f) {
++ if (source instanceof Component) {
++ return ((Component) source).getFontMetrics(f);
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Determine if the object is enabled.
++ *
++ * @return true if object is enabled; otherwise, false
++ */
++ public boolean isEnabled() {
++ if (source instanceof Component) {
++ return ((Component) source).isEnabled();
++ } else if (source instanceof MenuItem) {
++ return ((MenuItem) source).isEnabled();
++ } else {
++ return true;
++ }
++ }
++
++ /**
++ * Set the enabled state of the object.
++ *
++ * @param b if true, enables this object; otherwise, disables it
++ */
++ public void setEnabled(boolean b) {
++ if (source instanceof Component) {
++ ((Component) source).setEnabled(b);
++ } else if (source instanceof MenuItem) {
++ ((MenuItem) source).setEnabled(b);
++ }
++ }
++
++ /**
++ * Determine if the object is visible.
++ *
++ * @return true if object is visible; otherwise, false
++ */
++ public boolean isVisible() {
++ if (source instanceof Component) {
++ return ((Component) source).isVisible();
++ } else {
++ return false;
++ }
++ }
++
++ /**
++ * Set the visible state of the object.
++ *
++ * @param b if true, shows this object; otherwise, hides it
++ */
++ public void setVisible(boolean b) {
++ if (source instanceof Component) {
++ ((Component) source).setVisible(b);
++ }
++ }
++
++ /**
++ * Determine if the object is showing. This is determined by checking
++ * the visibility of the object and ancestors of the object.
++ *
++ * @return true if object is showing; otherwise, false
++ */
++ public boolean isShowing() {
++ if (source instanceof Component) {
++ return ((Component) source).isShowing();
++ } else {
++ return false;
++ }
++ }
++
++ /**
++ * Checks whether the specified {@code Point} is within this
++ * object's bounds, where the {@code Point} is relative to the coordinate
++ * system of the object.
++ *
++ * @param p the {@code Point} relative to the coordinate system of the object
++ * @return true if object contains {@code Point}; otherwise false
++ */
++ public boolean contains(Point p) {
++ if (source instanceof Component) {
++ return ((Component) source).contains(p);
++ } else {
++ return false;
++ }
++ }
++
++ /**
++ * 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
++ */
++ public Point getLocationOnScreen() {
++ if (source instanceof Component) {
++ return ((Component) source).getLocationOnScreen();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Returns the location of the object relative to parent.
++ *
++ * @return location of object relative to parent; can be null if
++ * this object or its parent are not on the screen
++ */
++ public Point getLocation() {
++ if (source instanceof Component) {
++ return ((Component) source).getLocation();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Sets the location of the object relative to parent.
++ */
++ public void setLocation(Point p) {
++ if (source instanceof Component) {
++ ((Component) source).setLocation(p);
++ }
++ }
++
++ /**
++ * Returns the current bounds of this object.
++ *
++ * @return current bounds of object; can be null if this object
++ * is not on the screen
++ */
++ public Rectangle getBounds() {
++ if (source instanceof Component) {
++ return ((Component) source).getBounds();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Sets the current bounds of this object.
++ */
++ public void setBounds(Rectangle r) {
++ if (source instanceof Component) {
++ ((Component) source).setBounds(r);
++ }
++ }
++
++ /**
++ * Returns the current size of this object.
++ *
++ * @return current size of object; can be null if this object is
++ * not on the screen
++ */
++ public Dimension getSize() {
++ if (source instanceof Component) {
++ return ((Component) source).getSize();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Sets the current size of this object.
++ */
++ public void setSize(Dimension d) {
++ if (source instanceof Component) {
++ ((Component) source).setSize(d);
++ }
++ }
++
++ /**
++ * Returns the accessible child contained at the local coordinate
++ * Point, if one exists.
++ *
++ * @return the Accessible at the specified location, if it exists
++ */
++ public Accessible getAccessibleAt(Point p) {
++ if (source instanceof Component) {
++ Component c = ((Component) source).getComponentAt(p);
++ if (c != null) {
++ return (getAccessible(c));
++ }
++ }
++ return null;
++ }
++
++ /**
++ * Returns whether this object can accept focus or not.
++ *
++ * @return true if object can accept focus; otherwise false
++ */
++ public boolean isFocusTraversable() {
++ if (source instanceof Component) {
++ return ((Component) source).isFocusTraversable();
++ } else {
++ return false;
++ }
++ }
++
++ /**
++ * Requests focus for this object.
++ */
++ public void requestFocus() {
++ if (source instanceof Component) {
++ ((Component) source).requestFocus();
++ }
++ }
++
++ /**
++ * Adds the specified {@code FocusListener} to receive focus events from
++ * this component.
++ *
++ * @param l the focus listener
++ */
++ public synchronized void addFocusListener(FocusListener l) {
++ if (source instanceof Component) {
++ ((Component) source).addFocusListener(l);
++ }
++ }
++
++ /**
++ * Removes the specified focus listener so it no longer receives focus
++ * events from this component.
++ *
++ * @param l the focus listener; this method performs no function, nor does it
++ * throw an exception if the listener specified was not previously added
++ * to this component; if listener is null, no exception is thrown and no
++ * action is performed.
++ */
++ public synchronized void removeFocusListener(FocusListener l) {
++ if (source instanceof Component) {
++ ((Component) source).removeFocusListener(l);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/java/awt/ButtonTranslator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,78 @@
++/*
++ * Copyright (c) 2002, 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. 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 com.sun.java.accessibility.util.java.awt;
++
++import java.lang.*;
++import java.util.*;
++import java.awt.*;
++import java.awt.image.*;
++import javax.accessibility.*;
++import com.sun.java.accessibility.util.*;
++
++/**
++ * <p>The Translator class provides a translation to interface Accessible
++ * for objects that do not implement interface Accessible. Assistive
++ * technologies can use the 'getAccessible' class method of Translator to
++ * obtain an object that implements interface Accessible. If the object
++ * passed in already implements interface Accessible, getAccessible merely
++ * returns the object.
++ *
++ * <p>An example of how an assistive technology might use the Translator
++ * class is as follows:
++ *
++ * <PRE>
++ * Accessible accessible = Translator.getAccessible(someObj);
++ * // obtain information from the 'accessible' object.
++ * </PRE>
++ *
++ * <P>This class extends the Translator class to provide specific support
++ * for the Button class. Translator.getAccessible() will automatically
++ * load this class when an assistive technology asks for an accessible
++ * translator for Button.
++ *
++ */
++public class ButtonTranslator extends Translator {
++
++ /**
++ * Get the name of this object.
++ * @return the name of the object -- can be null if this object does
++ * not have a name
++ */
++ public String getAccessibleName() {
++ return ((Button) source).getLabel();
++ }
++
++ /**
++ * Set the name of this object.
++ */
++ public void setAccessibleName(String s) {
++ ((Button) source).setLabel(s);
++ }
++
++ public AccessibleRole getAccessibleRole() {
++ return AccessibleRole.PUSH_BUTTON;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/java/awt/CheckboxTranslator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,91 @@
++/*
++ * Copyright (c) 2002, 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. 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 com.sun.java.accessibility.util.java.awt;
++
++import java.lang.*;
++import java.util.*;
++import java.awt.*;
++import java.awt.image.*;
++import javax.accessibility.*;
++import com.sun.java.accessibility.util.*;
++
++/**
++ * <p>The Translator class provides a translation to interface Accessible
++ * for objects that do not implement interface Accessible. Assistive
++ * technologies can use the 'getAccessible' class method of Translator to
++ * obtain an object that implements interface Accessible. If the object
++ * passed in already implements interface Accessible, getAccessible merely
++ * returns the object.
++ *
++ * <p>An example of how an assistive technology might use the Translator
++ * class is as follows:
++ *
++ * <PRE>
++ * Accessible accessible = Translator.getAccessible(someObj);
++ * // obtain information from the 'accessible' object.
++ * </PRE>
++ *
++ * <P>This class extends the Translator class to provide specific support
++ * for the Checkbox class. Translator.getAccessible() will automatically
++ * load this class when an assistive technology asks for an accessible
++ * translator for Checkbox.
++ *
++ */
++public class CheckboxTranslator extends Translator {
++
++ /**
++ * Get the state of this object.
++ * @return an instance of AccessibleState containing the current state of the object
++ * @see AccessibleState
++ */
++ public AccessibleStateSet getAccessibleStateSet() {
++ AccessibleStateSet states = super.getAccessibleStateSet();
++ if (((Checkbox) source).getState()) {
++ states.add(AccessibleState.CHECKED);
++ }
++ return states;
++ }
++
++ /**
++ * Get the name of this object.
++ * @return the name of the object -- can be null if this object does
++ * not have a name
++ */
++ public String getAccessibleName() {
++ return ((Checkbox) source).getLabel();
++ }
++
++ /**
++ * Set the name of this object.
++ */
++ public void setAccessibleName(String s) {
++ ((Checkbox) source).setLabel(s);
++ }
++
++ public AccessibleRole getAccessibleRole() {
++ return AccessibleRole.CHECK_BOX;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/java/awt/LabelTranslator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,73 @@
++/*
++ * Copyright (c) 2002, 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. 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 com.sun.java.accessibility.util.java.awt;
++
++import java.lang.*;
++import java.util.*;
++import java.awt.*;
++import java.awt.image.*;
++import javax.accessibility.*;
++import com.sun.java.accessibility.util.*;
++
++/**
++ * <p>The Translator class provides a translation to interface Accessible
++ * for objects that do not implement interface Accessible. Assistive
++ * technologies can use the 'getAccessible' class method of Translator to
++ * obtain an object that implements interface Accessible. If the object
++ * passed in already implements interface Accessible, getAccessible merely
++ * returns the object.
++ *
++ * <p>An example of how an assistive technology might use the Translator
++ * class is as follows:
++ *
++ * <PRE>
++ * Accessible accessible = Translator.getAccessible(someObj);
++ * // obtain information from the 'accessible' object.
++ * </PRE>
++ *
++ * <P>This class extends the Translator class to provide specific support
++ * for the Label class. Translator.getAccessible() will automatically
++ * load this class when an assistive technology asks for an accessible
++ * translator for Label.
++ *
++ */
++public class LabelTranslator extends Translator {
++
++ public String getAccessibleName() {
++ return ((Label) source).getText();
++ }
++
++ /**
++ * Set the name of this object.
++ */
++ public void setAccessibleName(String s) {
++ ((Label) source).setText(s);
++ }
++
++ public AccessibleRole getAccessibleRole() {
++ return AccessibleRole.LABEL;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/java/awt/ListTranslator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,78 @@
++/*
++ * Copyright (c) 2002, 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. 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 com.sun.java.accessibility.util.java.awt;
++
++import java.lang.*;
++import java.util.*;
++import java.awt.*;
++import java.awt.image.*;
++import javax.accessibility.*;
++import com.sun.java.accessibility.util.*;
++
++/**
++ * <p>The Translator class provides a translation to interface Accessible
++ * for objects that do not implement interface Accessible. Assistive
++ * technologies can use the 'getAccessible' class method of Translator to
++ * obtain an object that implements interface Accessible. If the object
++ * passed in already implements interface Accessible, getAccessible merely
++ * returns the object.
++ *
++ * <p>An example of how an assistive technology might use the Translator
++ * class is as follows:
++ *
++ * <PRE>
++ * Accessible accessible = Translator.getAccessible(someObj);
++ * // obtain information from the 'accessible' object.
++ * </PRE>
++ *
++ * <P>This class extends the Translator class to provide specific support
++ * for the List class. Translator.getAccessible() will automatically
++ * load this class when an assistive technology asks for an accessible
++ * translator for List.
++ *
++ */
++public class ListTranslator extends Translator {
++
++ /**
++ * Get the state of this object.
++ * @return an instance of AccessibleState containing the current state of the object
++ * @see AccessibleState
++ */
++ public AccessibleStateSet getAccessibleStateSet() {
++ AccessibleStateSet states = super.getAccessibleStateSet();
++ if (((java.awt.List) source).isMultipleMode()) {
++ states.add(AccessibleState.MULTISELECTABLE);
++ }
++ if (((java.awt.List) source).getSelectedItems().length > 0) {
++ states.add(AccessibleState.SELECTED);
++ }
++ return states;
++ }
++
++ public AccessibleRole getAccessibleRole() {
++ return AccessibleRole.LIST;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/java/awt/TextComponentTranslator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (c) 2002, 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. 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 com.sun.java.accessibility.util.java.awt;
++
++import java.lang.*;
++import java.util.*;
++import java.awt.*;
++import java.awt.image.*;
++import javax.accessibility.*;
++import com.sun.java.accessibility.util.*;
++
++/**
++ * <p>The Translator class provides a translation to interface Accessible
++ * for objects that do not implement interface Accessible. Assistive
++ * technologies can use the 'getAccessible' class method of Translator to
++ * obtain an object that implements interface Accessible. If the object
++ * passed in already implements interface Accessible, getAccessible merely
++ * returns the object.
++ *
++ * <p>An example of how an assistive technology might use the Translator
++ * class is as follows:
++ *
++ * <PRE>
++ * Accessible accessible = Translator.getAccessible(someObj);
++ * // obtain information from the 'accessible' object.
++ * </PRE>
++ *
++ * <P>This class extends the Translator class to provide specific support
++ * for the TextComponent class. Translator.getAccessible() will automatically
++ * load this class when an assistive technology asks for an accessible
++ * translator for TextComponent.
++ *
++ */
++public class TextComponentTranslator extends Translator {
++
++ public AccessibleRole getAccessibleRole() {
++ return AccessibleRole.TEXT;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/com/sun/java/accessibility/util/package-info.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,69 @@
++/*
++ * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++/**
++ * Provides a collection of interfaces and classes that compose the Java Accessibility
++ * Utilities. The classes are used by Assistive Technologies, such as the screen
++ * readers which are used by those who are blind, and help provide access to GUI
++ * toolkits that implement the Java Accessibility API. An overview of the important
++ * classes follows.
++ *
++ * <p>The class {@code AccessibilityEventMonitor} implements a PropertyChange
++ * listener on every UI object that implements interface {@code Accessible} in the Java
++ * Virtual Machine.
++ *
++ * <p> The class {@code AWTEventMonitor} implements a suite of listeners that are
++ * conditionally installed on every AWT component instance in the Java Virtual Machine.
++ *
++ * <p>The class {@code EventQueueMonitor} provides key core functionality for
++ * Assistive Technologies (and other system-level technologies that need some of
++ * the same things that Assistive Technology needs).
++ *
++ * <p>The class {@code GUIInitializedMulticaster} is used to maintain a list of
++ * {@code GUIInitializedListener} classes which are used by the {@code EventQueueMonitor}
++ * class to notify an interested party when the GUI subsystem has been initialized.
++ * Note that this class is intended to be used primarily for internal support in
++ * the {@code EventQueueMonitor} class, and is not intended to be used by classes
++ * outside the Java Accessibility Utility package.
++ *
++ * <p>The class {@code SwingEventMonitor} extends {@code AWTEventMonitor} by adding
++ * a suite of listeners conditionally installed on every Swing component instance
++ * in the Java Virtual Machine.
++ *
++ * <p>The class {@code TopLevelWindowMulticaster} is used to maintain a list of
++ * {@code TopLevelWindowListener} classes which are used by the {@code EventQueueMonitor}
++ * class to notify an interested party when a top level window is created or destroyed
++ * in the Java Virtual Machine Note that this class is intended to be used primarily
++ * for internal support in the {@code EventQueueMonitor} class, and is not intended
++ * to be used by classes outside the Java Accessibility Utility package.
++ *
++ * <p>The class {@code Translator} provides a translation to interface {@code Accessible}
++ * for objects that do not implement interface {@code Accessible}.
++ *
++ * @since JDK1.7
++ */
++
++@jdk.Exported
++package com.sun.java.accessibility.util;
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -100,7 +100,8 @@
+ private static Dimension prefListSize = new Dimension(75, 150);
+
+ private static Dimension PREF_SIZE = new Dimension(435, 360);
+- private static Dimension MIN_SIZE = new Dimension(200, 300);
++ private static final int MIN_WIDTH = 200;
++ private static final int MIN_HEIGHT = 300;
+
+ private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
+
+@@ -1038,6 +1039,7 @@
+ }
+ }
+
++ @Override
+ public Dimension getPreferredSize(JComponent c) {
+ Dimension prefSize = new Dimension(PREF_SIZE);
+ JComponent accessory = getFileChooser().getAccessory();
+@@ -1053,10 +1055,12 @@
+ }
+ }
+
+- public Dimension getMinimumSize(JComponent x) {
+- return new Dimension(MIN_SIZE);
++ @Override
++ public Dimension getMinimumSize(JComponent x) {
++ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
+ }
+
++ @Override
+ public Dimension getMaximumSize(JComponent x) {
+ return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=Error creating directory "{0}": No such file or directory
+ FileChooser.deleteFileButton.textAndMnemonic=De&lete File
+ FileChooser.renameFileButton.textAndMnemonic=&Rename File
+-FileChooser.cancelButton.textAndMnemonic=&Cancel
+-FileChooser.saveButton.textAndMnemonic=&OK
+-FileChooser.openButton.textAndMnemonic=&OK
++FileChooser.cancelButton.textAndMnemonic=Cancel
++FileChooser.saveButton.textAndMnemonic=OK
++FileChooser.openButton.textAndMnemonic=OK
+ FileChooser.saveDialogTitle.textAndMnemonic=Save
+ FileChooser.openDialogTitle.textAndMnemonic=Open
+ FileChooser.pathLabel.textAndMnemonic=&Selection:
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=Fehler beim Erstellen von Verzeichnis "{0}": Datei oder Verzeichnis nicht vorhanden
+ FileChooser.deleteFileButton.textAndMnemonic=Datei &l\u00F6schen
+ FileChooser.renameFileButton.textAndMnemonic=Datei &umbenennen
+-FileChooser.cancelButton.textAndMnemonic=&Abbrechen
+-FileChooser.saveButton.textAndMnemonic=&OK
+-FileChooser.openButton.textAndMnemonic=&OK
++FileChooser.cancelButton.textAndMnemonic=Abbrechen
++FileChooser.saveButton.textAndMnemonic=OK
++FileChooser.openButton.textAndMnemonic=OK
+ FileChooser.saveDialogTitle.textAndMnemonic=Speichern
+ FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen
+ FileChooser.pathLabel.textAndMnemonic=Aus&wahl:
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_es.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_es.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=Error al crear el directorio "{0}": no existe dicho archivo o directorio
+ FileChooser.deleteFileButton.textAndMnemonic=Su&primir Archivo
+ FileChooser.renameFileButton.textAndMnemonic=Cambiar Nomb&re de Archivo
+-FileChooser.cancelButton.textAndMnemonic=&Cancelar
+-FileChooser.saveButton.textAndMnemonic=&Aceptar
+-FileChooser.openButton.textAndMnemonic=&Aceptar
++FileChooser.cancelButton.textAndMnemonic=Cancelar
++FileChooser.saveButton.textAndMnemonic=Aceptar
++FileChooser.openButton.textAndMnemonic=Aceptar
+ FileChooser.saveDialogTitle.textAndMnemonic=Guardar
+ FileChooser.openDialogTitle.textAndMnemonic=Abrir
+ FileChooser.pathLabel.textAndMnemonic=&Selecci\u00F3n:
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=Erreur lors de la cr\u00E9ation du r\u00E9pertoire "{0}" : ce fichier ou r\u00E9pertoire n''existe pas
+ FileChooser.deleteFileButton.textAndMnemonic=Supprimer &le fichier
+ FileChooser.renameFileButton.textAndMnemonic=&Renommer le fichier
+-FileChooser.cancelButton.textAndMnemonic=&Annuler
+-FileChooser.saveButton.textAndMnemonic=&OK
+-FileChooser.openButton.textAndMnemonic=&OK
++FileChooser.cancelButton.textAndMnemonic=Annuler
++FileChooser.saveButton.textAndMnemonic=OK
++FileChooser.openButton.textAndMnemonic=OK
+ FileChooser.saveDialogTitle.textAndMnemonic=Enregistrer
+ FileChooser.openDialogTitle.textAndMnemonic=Ouvrir
+ FileChooser.pathLabel.textAndMnemonic=&S\u00E9lection :
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_it.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_it.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=Errore durante la creazione della directory "{0}": file o directory inesistente
+ FileChooser.deleteFileButton.textAndMnemonic=E&limina file
+ FileChooser.renameFileButton.textAndMnemonic=&Rinomina file
+-FileChooser.cancelButton.textAndMnemonic=&Annulla
+-FileChooser.saveButton.textAndMnemonic=&OK
+-FileChooser.openButton.textAndMnemonic=&OK
++FileChooser.cancelButton.textAndMnemonic=Annulla
++FileChooser.saveButton.textAndMnemonic=OK
++FileChooser.openButton.textAndMnemonic=OK
+ FileChooser.saveDialogTitle.textAndMnemonic=Salva
+ FileChooser.openDialogTitle.textAndMnemonic=Apri
+ FileChooser.pathLabel.textAndMnemonic=&Selezione:
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ja.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ja.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{0}"\u306E\u4F5C\u6210\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: \u3053\u306E\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u5B58\u5728\u3057\u307E\u305B\u3093
+ FileChooser.deleteFileButton.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u524A\u9664(&L)
+ FileChooser.renameFileButton.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u5909\u66F4(&R)
+-FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88(&C)
+-FileChooser.saveButton.textAndMnemonic=OK(&O)
+-FileChooser.openButton.textAndMnemonic=OK(&O)
++FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
++FileChooser.saveButton.textAndMnemonic=OK
++FileChooser.openButton.textAndMnemonic=OK
+ FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58
+ FileChooser.openDialogTitle.textAndMnemonic=\u958B\u304F
+ FileChooser.pathLabel.textAndMnemonic=\u9078\u629E(&S):
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic="{0}" \uB514\uB809\uD1A0\uB9AC\uB97C \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: \uD574\uB2F9 \uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
+ FileChooser.deleteFileButton.textAndMnemonic=\uD30C\uC77C \uC0AD\uC81C(&L)
+ FileChooser.renameFileButton.textAndMnemonic=\uD30C\uC77C \uC774\uB984 \uBC14\uAFB8\uAE30(&R)
+-FileChooser.cancelButton.textAndMnemonic=\uCDE8\uC18C(&C)
+-FileChooser.saveButton.textAndMnemonic=\uD655\uC778(&O)
+-FileChooser.openButton.textAndMnemonic=\uD655\uC778(&O)
++FileChooser.cancelButton.textAndMnemonic=\uCDE8\uC18C
++FileChooser.saveButton.textAndMnemonic=\uD655\uC778
++FileChooser.openButton.textAndMnemonic=\uD655\uC778
+ FileChooser.saveDialogTitle.textAndMnemonic=\uC800\uC7A5
+ FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30
+ FileChooser.pathLabel.textAndMnemonic=\uC120\uD0DD \uC0AC\uD56D(&S):
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_pt_BR.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_pt_BR.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=Erro ao criar o diret\u00F3rio "{0}": N\u00E3o h\u00E1 arquivo ou diret\u00F3rio
+ FileChooser.deleteFileButton.textAndMnemonic=De&letar Arquivo
+ FileChooser.renameFileButton.textAndMnemonic=&Renomear Arquivo
+-FileChooser.cancelButton.textAndMnemonic=&Cancelar
+-FileChooser.saveButton.textAndMnemonic=&OK
+-FileChooser.openButton.textAndMnemonic=&OK
++FileChooser.cancelButton.textAndMnemonic=Cancelar
++FileChooser.saveButton.textAndMnemonic=OK
++FileChooser.openButton.textAndMnemonic=OK
+ FileChooser.saveDialogTitle.textAndMnemonic=Salvar
+ FileChooser.openDialogTitle.textAndMnemonic=Abrir
+ FileChooser.pathLabel.textAndMnemonic=&Sele\u00E7\u00E3o:
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=Ett fel intr\u00E4ffade vid f\u00F6rs\u00F6k att skapa katalogen "{0}": Filen eller katalogen finns inte
+ FileChooser.deleteFileButton.textAndMnemonic=Ta &bort fil
+ FileChooser.renameFileButton.textAndMnemonic=&\u00C4ndra namn p\u00E5 filen
+-FileChooser.cancelButton.textAndMnemonic=&Avbryt
+-FileChooser.saveButton.textAndMnemonic=&OK
+-FileChooser.openButton.textAndMnemonic=&OK
++FileChooser.cancelButton.textAndMnemonic=Avbryt
++FileChooser.saveButton.textAndMnemonic=OK
++FileChooser.openButton.textAndMnemonic=OK
+ FileChooser.saveDialogTitle.textAndMnemonic=Spara
+ FileChooser.openDialogTitle.textAndMnemonic=\u00D6ppna
+ FileChooser.pathLabel.textAndMnemonic=&Urval:
+@@ -44,11 +44,11 @@
+ FileChooser.foldersLabel.textAndMnemonic=Map&par
+ FileChooser.filesLabel.textAndMnemonic=&Filer
+
+-FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan Filv\u00E4ljare.
++FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan f\u00F6r filval.
+ FileChooser.saveButtonToolTip.textAndMnemonic=Spara vald fil.
+ FileChooser.openButtonToolTip.textAndMnemonic=\u00D6ppna vald fil.
+
+-FileChooser.renameFileDialog.textAndMnemonic=Namn\u00E4ndra fil "{0}" till
++FileChooser.renameFileDialog.textAndMnemonic=\u00C4ndra namn p\u00E5 fil "{0}" till
+ FileChooser.renameFileError.titleAndMnemonic=Fel
+ FileChooser.renameFileError.textAndMnemonic=Fel vid namn\u00E4ndring av fil "{0}" till "{1}"
+
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_CN.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_CN.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=\u521B\u5EFA\u76EE\u5F55 "{0}" \u65F6\u51FA\u9519: \u6CA1\u6709\u6B64\u7C7B\u6587\u4EF6\u6216\u76EE\u5F55
+ FileChooser.deleteFileButton.textAndMnemonic=\u5220\u9664\u6587\u4EF6(&L)
+ FileChooser.renameFileButton.textAndMnemonic=\u91CD\u547D\u540D\u6587\u4EF6(&R)
+-FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88(&C)
+-FileChooser.saveButton.textAndMnemonic=\u786E\u5B9A(&O)
+-FileChooser.openButton.textAndMnemonic=\u786E\u5B9A(&O)
++FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
++FileChooser.saveButton.textAndMnemonic=\u786E\u5B9A
++FileChooser.openButton.textAndMnemonic=\u786E\u5B9A
+ FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58
+ FileChooser.openDialogTitle.textAndMnemonic=\u6253\u5F00
+ FileChooser.pathLabel.textAndMnemonic=\u9009\u5B9A\u5185\u5BB9(&S):
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_TW.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_TW.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -34,9 +34,9 @@
+ FileChooser.newFolderNoDirectoryError.textAndMnemonic=\u5EFA\u7ACB\u76EE\u9304 "{0}" \u6642\u767C\u751F\u932F\u8AA4: \u6C92\u6709\u6B64\u6A94\u6848\u6216\u76EE\u9304
+ FileChooser.deleteFileButton.textAndMnemonic=\u522A\u9664\u6A94\u6848(&L)
+ FileChooser.renameFileButton.textAndMnemonic=\u91CD\u65B0\u547D\u540D\u6A94\u6848(&R)
+-FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88(&C)
+-FileChooser.saveButton.textAndMnemonic=\u78BA\u5B9A(&O)
+-FileChooser.openButton.textAndMnemonic=\u78BA\u5B9A(&O)
++FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
++FileChooser.saveButton.textAndMnemonic=\u78BA\u5B9A
++FileChooser.openButton.textAndMnemonic=\u78BA\u5B9A
+ FileChooser.saveDialogTitle.textAndMnemonic=\u5132\u5B58
+ FileChooser.openDialogTitle.textAndMnemonic=\u958B\u555F
+ FileChooser.pathLabel.textAndMnemonic=\u9078\u53D6(&S):
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -65,8 +65,8 @@
+
+ private static Dimension WITH_ACCELERATOR_PREF_SIZE = new Dimension(650, 450);
+ private static Dimension PREF_SIZE = new Dimension(350, 450);
+- private static Dimension MIN_SIZE = new Dimension(200, 300);
+-
++ private static final int MIN_WIDTH = 200;
++ private static final int MIN_HEIGHT = 300;
+ private static Dimension PREF_ACC_SIZE = new Dimension(10, 10);
+ private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
+
+@@ -615,6 +615,7 @@
+ return scrollpane;
+ }
+
++ @Override
+ public Dimension getPreferredSize(JComponent c) {
+ Dimension prefSize =
+ (getFileChooser().getAccessory() != null) ? WITH_ACCELERATOR_PREF_SIZE : PREF_SIZE;
+@@ -627,10 +628,12 @@
+ }
+ }
+
+- public Dimension getMinimumSize(JComponent x) {
+- return MIN_SIZE;
++ @Override
++ public Dimension getMinimumSize(JComponent x) {
++ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
+ }
+
++ @Override
+ public Dimension getMaximumSize(JComponent x) {
+ return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -33,8 +33,8 @@
+ FileChooser.enterFileNameLabel.textAndMnemonic=A&nge filnamn:
+ FileChooser.enterFolderNameLabel.textAndMnemonic=Ange ett mappnamn:
+
+-FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan Filv\u00E4ljare.
++FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan f\u00F6r filval.
+ FileChooser.saveButtonToolTip.textAndMnemonic=Spara vald fil.
+ FileChooser.openButtonToolTip.textAndMnemonic=\u00D6ppna vald fil.
+ FileChooser.updateButtonToolTip.textAndMnemonic=Uppdatera kataloglistan.
+-FileChooser.helpButtonToolTip.textAndMnemonic=Hj\u00E4lp - Filv\u00E4ljare.
++FileChooser.helpButtonToolTip.textAndMnemonic=Hj\u00E4lp f\u00F6r val av fil.
+--- ./jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -93,7 +93,6 @@
+
+ private static int MIN_WIDTH = 425;
+ private static int MIN_HEIGHT = 245;
+- private static Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
+
+ private static int LIST_PREF_WIDTH = 444;
+ private static int LIST_PREF_HEIGHT = 138;
+@@ -631,6 +630,7 @@
+ * @return a <code>Dimension</code> specifying the preferred
+ * width and height of the file chooser
+ */
++ @Override
+ public Dimension getPreferredSize(JComponent c) {
+ int prefWidth = PREF_SIZE.width;
+ Dimension d = c.getLayout().preferredLayoutSize(c);
+@@ -649,8 +649,9 @@
+ * @return a <code>Dimension</code> specifying the minimum
+ * width and height of the file chooser
+ */
++ @Override
+ public Dimension getMinimumSize(JComponent c) {
+- return MIN_SIZE;
++ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
+ }
+
+ /**
+@@ -660,6 +661,7 @@
+ * @return a <code>Dimension</code> specifying the maximum
+ * width and height of the file chooser
+ */
++ @Override
+ public Dimension getMaximumSize(JComponent c) {
+ return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+--- ./jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -79,18 +79,20 @@
+ * Takes a JarFile and converts into a pack-stream.
+ * <p>
+ * Closes its input but not its output. (Pack200 archives are appendable.)
+- * @param in a JarFile
++ *
++ * @param in a JarFile
+ * @param out an OutputStream
+ * @exception IOException if an error is encountered.
+ */
+ public synchronized void pack(JarFile in, OutputStream out) throws IOException {
+- assert(Utils.currentInstance.get() == null);
+- TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE))
+- ? null
+- : TimeZone.getDefault();
++ assert (Utils.currentInstance.get() == null);
++
++ boolean needUTC = !props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE);
+ try {
+ Utils.currentInstance.set(this);
+- if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
++ if (needUTC) {
++ Utils.changeDefaultTimeZoneToUtc();
++ }
+
+ if ("0".equals(props.getProperty(Pack200.Packer.EFFORT))) {
+ Utils.copyJarFile(in, out);
+@@ -99,7 +101,9 @@
+ }
+ } finally {
+ Utils.currentInstance.set(null);
+- if (tz != null) TimeZone.setDefault(tz);
++ if (needUTC) {
++ Utils.restoreDefaultTimeZone();
++ }
+ in.close();
+ }
+ }
+@@ -119,12 +123,13 @@
+ * @exception IOException if an error is encountered.
+ */
+ public synchronized void pack(JarInputStream in, OutputStream out) throws IOException {
+- assert(Utils.currentInstance.get() == null);
+- TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null :
+- TimeZone.getDefault();
++ assert (Utils.currentInstance.get() == null);
++ boolean needUTC = !props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE);
+ try {
+ Utils.currentInstance.set(this);
+- if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
++ if (needUTC) {
++ Utils.changeDefaultTimeZoneToUtc();
++ }
+ if ("0".equals(props.getProperty(Pack200.Packer.EFFORT))) {
+ Utils.copyJarFile(in, out);
+ } else {
+@@ -132,10 +137,13 @@
+ }
+ } finally {
+ Utils.currentInstance.set(null);
+- if (tz != null) TimeZone.setDefault(tz);
++ if (needUTC) {
++ Utils.restoreDefaultTimeZone();
++ }
+ in.close();
+ }
+ }
++
+ /**
+ * Register a listener for changes to options.
+ * @param listener An object to be invoked when a property is changed.
+--- ./jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -96,13 +96,15 @@
+ //Driver routines
+
+ // The unpack worker...
++
+ /**
+ * Takes a packed-stream InputStream, and writes to a JarOutputStream. Internally
+ * the entire buffer must be read, it may be more efficient to read the packed-stream
+ * to a file and pass the File object, in the alternate method described below.
+ * <p>
+ * Closes its input but not its output. (The output can accumulate more elements.)
+- * @param in an InputStream.
++ *
++ * @param in an InputStream.
+ * @param out a JarOutputStream.
+ * @exception IOException if an error is encountered.
+ */
+@@ -113,19 +115,19 @@
+ if (out == null) {
+ throw new NullPointerException("null output");
+ }
+- assert(Utils.currentInstance.get() == null);
+- TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE))
+- ? null
+- : TimeZone.getDefault();
+-
++ assert (Utils.currentInstance.get() == null);
++ boolean needUTC = !props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE);
+ try {
+ Utils.currentInstance.set(this);
+- if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
++ if (needUTC) {
++ Utils.changeDefaultTimeZoneToUtc();
++ }
+ final int verbose = props.getInteger(Utils.DEBUG_VERBOSE);
+ BufferedInputStream in0 = new BufferedInputStream(in);
+ if (Utils.isJarMagic(Utils.readMagic(in0))) {
+- if (verbose > 0)
++ if (verbose > 0) {
+ Utils.log.info("Copying unpacked JAR file...");
++ }
+ Utils.copyJarFile(new JarInputStream(in0), out);
+ } else if (props.getBoolean(Utils.DEBUG_DISABLE_NATIVE)) {
+ (new DoUnpack()).run(in0, out);
+@@ -144,7 +146,9 @@
+ } finally {
+ _nunp = null;
+ Utils.currentInstance.set(null);
+- if (tz != null) TimeZone.setDefault(tz);
++ if (needUTC) {
++ Utils.restoreDefaultTimeZone();
++ }
+ }
+ }
+
+@@ -152,7 +156,8 @@
+ * Takes an input File containing the pack file, and generates a JarOutputStream.
+ * <p>
+ * Does not close its output. (The output can accumulate more elements.)
+- * @param in a File.
++ *
++ * @param in a File.
+ * @param out a JarOutputStream.
+ * @exception IOException if an error is encountered.
+ */
+--- ./jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java Wed Jul 01 21:53:30 2015 -0700
+@@ -34,6 +34,7 @@
+ import java.io.OutputStream;
+ import java.util.Collections;
+ import java.util.Date;
++import java.util.TimeZone;
+ import java.util.jar.JarEntry;
+ import java.util.jar.JarFile;
+ import java.util.jar.JarInputStream;
+@@ -133,6 +134,9 @@
+ // to the engine code, especially the native code.
+ static final ThreadLocal<TLGlobals> currentInstance = new ThreadLocal<>();
+
++ private static TimeZone tz;
++ private static int workingPackerCount = 0;
++
+ // convenience method to access the TL globals
+ static TLGlobals getTLGlobals() {
+ return currentInstance.get();
+@@ -203,6 +207,24 @@
+ }
+ }
+
++ static synchronized void changeDefaultTimeZoneToUtc() {
++ if (workingPackerCount++ == 0) {
++ // only first thread saves default TZ
++ tz = TimeZone.getDefault();
++ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
++ }
++ }
++
++ static synchronized void restoreDefaultTimeZone() {
++ if (--workingPackerCount == 0) {
++ // reset timezone when all the packer/unpacker instances have terminated
++ if (tz != null) {
++ TimeZone.setDefault(tz);
++ }
++ tz = null;
++ }
++ }
++
+ static final Pack200Logger log
+ = new Pack200Logger("java.util.jar.Pack200");
+
+--- ./jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -538,6 +538,13 @@
+ currentFetchThread = null;
+ }
+
++ if (nr == null) {
++ if (logger.traceOn()) {
++ logger.trace("NotifFetcher-run",
++ "Recieved null object as notifs, stops fetching because the "
++ + "notification server is terminated.");
++ }
++ }
+ if (nr == null || shouldStop()) {
+ // tell that the thread is REALLY stopped
+ setState(STOPPED);
+@@ -657,7 +664,7 @@
+ return null;
+ }
+
+- if (shouldStop())
++ if (shouldStop() || nr == null)
+ return null;
+
+ startSequenceNumber = nr.getNextSequenceNumber();
+--- ./jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -184,124 +184,119 @@
+ Exception caughtException = null;
+ boolean[] doNotRetry = new boolean[servers.length];
+
+- try {
+- //
+- // The UDP retry strategy is to try the 1st server, and then
+- // each server in order. If no answer, double the timeout
+- // and try each server again.
+- //
+- for (int retry = 0; retry < retries; retry++) {
++ //
++ // The UDP retry strategy is to try the 1st server, and then
++ // each server in order. If no answer, double the timeout
++ // and try each server again.
++ //
++ for (int retry = 0; retry < retries; retry++) {
+
+- // Try each name server.
+- for (int i = 0; i < servers.length; i++) {
+- if (doNotRetry[i]) {
++ // Try each name server.
++ for (int i = 0; i < servers.length; i++) {
++ if (doNotRetry[i]) {
++ continue;
++ }
++
++ // send the request packet and wait for a response.
++ try {
++ if (debug) {
++ dprint("SEND ID (" + (retry + 1) + "): " + xid);
++ }
++
++ byte[] msg = null;
++ msg = doUdpQuery(pkt, servers[i], serverPorts[i],
++ retry, xid);
++ //
++ // If the matching response is not got within the
++ // given timeout, check if the response was enqueued
++ // by some other thread, if not proceed with the next
++ // server or retry.
++ //
++ if (msg == null) {
++ if (resps.size() > 0) {
++ msg = lookupResponse(xid);
++ }
++ if (msg == null) { // try next server or retry
++ continue;
++ }
++ }
++ Header hdr = new Header(msg, msg.length);
++
++ if (auth && !hdr.authoritative) {
++ caughtException = new NameNotFoundException(
++ "DNS response not authoritative");
++ doNotRetry[i] = true;
+ continue;
+ }
++ if (hdr.truncated) { // message is truncated -- try TCP
+
+- // send the request packet and wait for a response.
+- try {
+- if (debug) {
+- dprint("SEND ID (" + (retry + 1) + "): " + xid);
+- }
+-
+- byte[] msg = null;
+- msg = doUdpQuery(pkt, servers[i], serverPorts[i],
+- retry, xid);
+- //
+- // If the matching response is not got within the
+- // given timeout, check if the response was enqueued
+- // by some other thread, if not proceed with the next
+- // server or retry.
+- //
+- if (msg == null) {
+- if (resps.size() > 0) {
+- msg = lookupResponse(xid);
+- }
+- if (msg == null) { // try next server or retry
++ // Try each server, starting with the one that just
++ // provided the truncated message.
++ for (int j = 0; j < servers.length; j++) {
++ int ij = (i + j) % servers.length;
++ if (doNotRetry[ij]) {
+ continue;
+ }
+- }
+- Header hdr = new Header(msg, msg.length);
++ try {
++ Tcp tcp =
++ new Tcp(servers[ij], serverPorts[ij]);
++ byte[] msg2;
++ try {
++ msg2 = doTcpQuery(tcp, pkt);
++ } finally {
++ tcp.close();
++ }
++ Header hdr2 = new Header(msg2, msg2.length);
++ if (hdr2.query) {
++ throw new CommunicationException(
++ "DNS error: expecting response");
++ }
++ checkResponseCode(hdr2);
+
+- if (auth && !hdr.authoritative) {
+- caughtException = new NameNotFoundException(
+- "DNS response not authoritative");
+- doNotRetry[i] = true;
+- continue;
+- }
+- if (hdr.truncated) { // message is truncated -- try TCP
++ if (!auth || hdr2.authoritative) {
++ // Got a valid response
++ hdr = hdr2;
++ msg = msg2;
++ break;
++ } else {
++ doNotRetry[ij] = true;
++ }
++ } catch (Exception e) {
++ // Try next server, or use UDP response
++ }
++ } // servers
++ }
++ return new ResourceRecords(msg, msg.length, hdr, false);
+
+- // Try each server, starting with the one that just
+- // provided the truncated message.
+- for (int j = 0; j < servers.length; j++) {
+- int ij = (i + j) % servers.length;
+- if (doNotRetry[ij]) {
+- continue;
+- }
+- try {
+- Tcp tcp =
+- new Tcp(servers[ij], serverPorts[ij]);
+- byte[] msg2;
+- try {
+- msg2 = doTcpQuery(tcp, pkt);
+- } finally {
+- tcp.close();
+- }
+- Header hdr2 = new Header(msg2, msg2.length);
+- if (hdr2.query) {
+- throw new CommunicationException(
+- "DNS error: expecting response");
+- }
+- checkResponseCode(hdr2);
+-
+- if (!auth || hdr2.authoritative) {
+- // Got a valid response
+- hdr = hdr2;
+- msg = msg2;
+- break;
+- } else {
+- doNotRetry[ij] = true;
+- }
+- } catch (Exception e) {
+- // Try next server, or use UDP response
+- }
+- } // servers
+- }
+- return new ResourceRecords(msg, msg.length, hdr, false);
+-
+- } catch (IOException e) {
+- if (debug) {
+- dprint("Caught IOException:" + e);
+- }
+- if (caughtException == null) {
+- caughtException = e;
+- }
+- // Use reflection to allow pre-1.4 compilation.
+- // This won't be needed much longer.
+- if (e.getClass().getName().equals(
+- "java.net.PortUnreachableException")) {
+- doNotRetry[i] = true;
+- }
+- } catch (NameNotFoundException e) {
+- // This is authoritative, so return immediately
+- throw e;
+- } catch (CommunicationException e) {
+- if (caughtException == null) {
+- caughtException = e;
+- }
+- } catch (NamingException e) {
+- if (caughtException == null) {
+- caughtException = e;
+- }
++ } catch (IOException e) {
++ if (debug) {
++ dprint("Caught IOException:" + e);
++ }
++ if (caughtException == null) {
++ caughtException = e;
++ }
++ // Use reflection to allow pre-1.4 compilation.
++ // This won't be needed much longer.
++ if (e.getClass().getName().equals(
++ "java.net.PortUnreachableException")) {
+ doNotRetry[i] = true;
+ }
+- } // servers
+- } // retries
++ } catch (NameNotFoundException e) {
++ throw e;
++ } catch (CommunicationException e) {
++ if (caughtException == null) {
++ caughtException = e;
++ }
++ } catch (NamingException e) {
++ if (caughtException == null) {
++ caughtException = e;
++ }
++ doNotRetry[i] = true;
++ }
++ } // servers
++ } // retries
+
+- } finally {
+- reqs.remove(xid); // cleanup
+- }
+-
++ reqs.remove(xid);
+ if (caughtException instanceof NamingException) {
+ throw (NamingException) caughtException;
+ }
+--- ./jdk/src/share/classes/com/sun/jndi/ldap/Connection.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/jndi/ldap/Connection.java Wed Jul 01 21:53:30 2015 -0700
+@@ -439,9 +439,14 @@
+ BerDecoder readReply(LdapRequest ldr)
+ throws IOException, NamingException {
+ BerDecoder rber;
+- boolean waited = false;
+
+- while (((rber = ldr.getReplyBer()) == null) && !waited) {
++ // Track down elapsed time to workaround spurious wakeups
++ long elapsedMilli = 0;
++ long elapsedNano = 0;
++
++ while (((rber = ldr.getReplyBer()) == null) &&
++ (readTimeout <= 0 || elapsedMilli < readTimeout))
++ {
+ try {
+ // If socket closed, don't even try
+ synchronized (this) {
+@@ -455,11 +460,15 @@
+ rber = ldr.getReplyBer();
+ if (rber == null) {
+ if (readTimeout > 0) { // Socket read timeout is specified
++ long beginNano = System.nanoTime();
+
+- // will be woken up before readTimeout only if reply is
++ // will be woken up before readTimeout if reply is
+ // available
+- ldr.wait(readTimeout);
+- waited = true;
++ ldr.wait(readTimeout - elapsedMilli);
++ elapsedNano += (System.nanoTime() - beginNano);
++ elapsedMilli += elapsedNano / 1000_000;
++ elapsedNano %= 1000_000;
++
+ } else {
+ // no timeout is set so we wait infinitely until
+ // a response is received
+@@ -476,7 +485,7 @@
+ }
+ }
+
+- if ((rber == null) && waited) {
++ if ((rber == null) && (elapsedMilli >= readTimeout)) {
+ abandonRequest(ldr, null);
+ throw new NamingException("LDAP response read timed out, timeout used:"
+ + readTimeout + "ms." );
+--- ./jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java Wed Jul 01 21:53:30 2015 -0700
+@@ -26,9 +26,6 @@
+ package com.sun.jndi.ldap;
+
+ import javax.naming.*;
+-import javax.naming.directory.*;
+-import javax.naming.spi.*;
+-import java.net.URL;
+ import java.net.MalformedURLException;
+ import java.io.UnsupportedEncodingException;
+ import java.util.StringTokenizer;
+@@ -211,43 +208,52 @@
+
+ // query begins with a '?' or is null
+
+- if (query == null) {
++ if (query == null || query.length() < 2) {
+ return;
+ }
+
+- int qmark2 = query.indexOf('?', 1);
++ int currentIndex = 1;
++ int nextQmark;
++ int endIndex;
+
+- if (qmark2 < 0) {
+- attributes = query.substring(1);
++ // attributes:
++ nextQmark = query.indexOf('?', currentIndex);
++ endIndex = nextQmark == -1 ? query.length() : nextQmark;
++ if (endIndex - currentIndex > 0) {
++ attributes = query.substring(currentIndex, endIndex);
++ }
++ currentIndex = endIndex + 1;
++ if (currentIndex >= query.length()) {
+ return;
+- } else if (qmark2 != 1) {
+- attributes = query.substring(1, qmark2);
+ }
+
+- int qmark3 = query.indexOf('?', qmark2 + 1);
+-
+- if (qmark3 < 0) {
+- scope = query.substring(qmark2 + 1);
++ // scope:
++ nextQmark = query.indexOf('?', currentIndex);
++ endIndex = nextQmark == -1 ? query.length() : nextQmark;
++ if (endIndex - currentIndex > 0) {
++ scope = query.substring(currentIndex, endIndex);
++ }
++ currentIndex = endIndex + 1;
++ if (currentIndex >= query.length()) {
+ return;
+- } else if (qmark3 != qmark2 + 1) {
+- scope = query.substring(qmark2 + 1, qmark3);
+ }
+
+- int qmark4 = query.indexOf('?', qmark3 + 1);
++ // filter:
++ nextQmark = query.indexOf('?', currentIndex);
++ endIndex = nextQmark == -1 ? query.length() : nextQmark;
++ if (endIndex - currentIndex > 0) {
++ filter = query.substring(currentIndex, endIndex);
++ filter = UrlUtil.decode(filter, "UTF8");
++ }
++ currentIndex = endIndex + 1;
++ if (currentIndex >= query.length()) {
++ return;
++ }
+
+- if (qmark4 < 0) {
+- filter = query.substring(qmark3 + 1);
+- } else {
+- if (qmark4 != qmark3 + 1) {
+- filter = query.substring(qmark3 + 1, qmark4);
+- }
+- extensions = query.substring(qmark4 + 1);
+- if (extensions.length() > 0) {
+- extensions = UrlUtil.decode(extensions, "UTF8");
+- }
+- }
+- if (filter != null && filter.length() > 0) {
+- filter = UrlUtil.decode(filter, "UTF8");
++ // extensions:
++ if (query.length() - currentIndex > 0) {
++ extensions = query.substring(currentIndex);
++ extensions = UrlUtil.decode(extensions, "UTF8");
+ }
+ }
+
+--- ./jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
++# 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
+@@ -77,7 +77,7 @@
+ cachedrowsetimpl.fwdonly = ResultSet kan endast g\u00E5 fram\u00E5t
+ cachedrowsetimpl.type = Typ: {0}
+ cachedrowsetimpl.opnotysupp = Det finns \u00E4nnu inget st\u00F6d f\u00F6r denna \u00E5tg\u00E4rd
+-cachedrowsetimpl.featnotsupp = Det finns inget st\u00F6d f\u00F6r denna funktion
++cachedrowsetimpl.featnotsupp = Funktionen st\u00F6ds inte
+
+ # WebRowSetImpl exceptions
+ webrowsetimpl.nullhash = Kan inte instansiera WebRowSetImpl. Null-hashtabell skickades till konstruktor.
+@@ -100,7 +100,7 @@
+ joinrowsetimpl.emptyrowset = Tomma radupps\u00E4ttningar kan inte l\u00E4ggas till i denna JoinRowSet
+
+ #JdbcRowSetImpl exceptions
+-jdbcrowsetimpl.invalstate = Ogiltig status
++jdbcrowsetimpl.invalstate = Ogiltigt tillst\u00E5nd
+ jdbcrowsetimpl.connect = JdbcRowSet (anslut) JNDI kan inte anslutas
+ jdbcrowsetimpl.paramtype = Kan inte h\u00E4rleda parametertypen
+ jdbcrowsetimpl.matchcols = Matchningskolumnerna \u00E4r inte samma som de som st\u00E4llts in
+@@ -112,7 +112,7 @@
+ jdbcrowsetimpl.usecolid = Anv\u00E4nd kolumn-id som argument f\u00F6r unsetMatchColumn
+ jdbcrowsetimpl.resnotupd = ResultSet \u00E4r inte uppdateringsbart
+ jdbcrowsetimpl.opnotysupp = Det finns \u00E4nnu inget st\u00F6d f\u00F6r denna \u00E5tg\u00E4rd
+-jdbcrowsetimpl.featnotsupp = Det finns inget st\u00F6d f\u00F6r denna funktion
++jdbcrowsetimpl.featnotsupp = Funktionen st\u00F6ds inte
+
+ #CachedRowSetReader exceptions
+ crsreader.connect = (JNDI) kan inte anslutas
+@@ -149,15 +149,15 @@
+ wsrxmlwriter.notproper = Ingen riktig typ
+
+ #XmlReaderContentHandler exceptions
+-xmlrch.errmap = Fel uppstod vid inst\u00E4llning av mappning: {0}
+-xmlrch.errmetadata = Fel uppstod vid inst\u00E4llning av metadata: {0}
+-xmlrch.errinsertval = Fel uppstod vid infogning av v\u00E4rden: {0}
+-xmlrch.errconstr = Fel uppstod vid konstruktion av rad: {0}
+-xmlrch.errdel = Fel uppstod vid borttagning av rad: {0}
+-xmlrch.errinsert = Fel uppstod vid konstruktion av infogad rad: {0}
+-xmlrch.errinsdel = Fel uppstod vid konstruktion av insdel-rad: {0}
+-xmlrch.errupdate = Fel uppstod vid konstruktion av uppdateringsrad: {0}
+-xmlrch.errupdrow = Fel uppstod vid uppdatering av rad: {0}
++xmlrch.errmap = Ett fel intr\u00E4ffade vid inst\u00E4llning av mappning: {0}
++xmlrch.errmetadata = Ett fel intr\u00E4ffade vid inst\u00E4llning av metadata: {0}
++xmlrch.errinsertval = Ett fel intr\u00E4ffade vid infogning av v\u00E4rden: {0}
++xmlrch.errconstr = Ett fel intr\u00E4ffade vid konstruktion av rad: {0}
++xmlrch.errdel = Ett fel intr\u00E4ffade vid borttagning av rad: {0}
++xmlrch.errinsert = Ett fel intr\u00E4ffade vid konstruktion av infogad rad: {0}
++xmlrch.errinsdel = Ett fel intr\u00E4ffade vid konstruktion av insdel-rad: {0}
++xmlrch.errupdate = Ett fel intr\u00E4ffade vid konstruktion av uppdateringsrad: {0}
++xmlrch.errupdrow = Ett fel intr\u00E4ffade vid uppdatering av rad: {0}
+ xmlrch.chars = tecken:
+ xmlrch.badvalue = Felaktigt v\u00E4rde; egenskapen kan inte ha ett tomt v\u00E4rde
+ xmlrch.badvalue1 = Felaktigt v\u00E4rde; metadatan kan inte ha ett tomt v\u00E4rde
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,13 +43,13 @@
+ Specify a different file name.
+ FileChooser.acceptAllFileFilter.textAndMnemonic=All Files
+ FileChooser.cancelButton.textAndMnemonic=Cancel
+-FileChooser.saveButton.textAndMnemonic=&Save
+-FileChooser.openButton.textAndMnemonic=&Open
++FileChooser.saveButton.textAndMnemonic=Save
++FileChooser.openButton.textAndMnemonic=Open
+ FileChooser.saveDialogTitle.textAndMnemonic=Save
+ FileChooser.openDialogTitle.textAndMnemonic=Open
+ FileChooser.updateButton.textAndMnemonic=&Update
+ FileChooser.helpButton.textAndMnemonic=&Help
+-FileChooser.directoryOpenButton.textAndMnemonic=&Open
++FileChooser.directoryOpenButton.textAndMnemonic=Open
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic={0} kann nicht umbenannt werden: Es ist bereits eine Datei mit dem angegebenen Namen vorhanden. Geben Sie einen anderen Dateinamen an.
+ FileChooser.acceptAllFileFilter.textAndMnemonic=Alle Dateien
+ FileChooser.cancelButton.textAndMnemonic=Abbrechen
+-FileChooser.saveButton.textAndMnemonic=&Speichern
+-FileChooser.openButton.textAndMnemonic=\u00D6&ffnen
++FileChooser.saveButton.textAndMnemonic=Speichern
++FileChooser.openButton.textAndMnemonic=\u00D6ffnen
+ FileChooser.saveDialogTitle.textAndMnemonic=Speichern
+ FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen
+ FileChooser.updateButton.textAndMnemonic=A&ktualisieren
+ FileChooser.helpButton.textAndMnemonic=&Hilfe
+-FileChooser.directoryOpenButton.textAndMnemonic=\u00D6&ffnen
++FileChooser.directoryOpenButton.textAndMnemonic=\u00D6ffnen
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic=No se puede cambiar el nombre de {0}: ya existe un archivo con el nombre especificado. Especifique otro nombre de archivo.
+ FileChooser.acceptAllFileFilter.textAndMnemonic=Todos los Archivos
+ FileChooser.cancelButton.textAndMnemonic=Cancelar
+-FileChooser.saveButton.textAndMnemonic=&Guardar
+-FileChooser.openButton.textAndMnemonic=&Abrir
++FileChooser.saveButton.textAndMnemonic=Guardar
++FileChooser.openButton.textAndMnemonic=Abrir
+ FileChooser.saveDialogTitle.textAndMnemonic=Guardar
+ FileChooser.openDialogTitle.textAndMnemonic=Abrir
+ FileChooser.updateButton.textAndMnemonic=Act&ualizar
+ FileChooser.helpButton.textAndMnemonic=A&yuda
+-FileChooser.directoryOpenButton.textAndMnemonic=&Abrir
++FileChooser.directoryOpenButton.textAndMnemonic=Abrir
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic=Impossible de renommer {0} : il existe d\u00E9j\u00E0 un fichier portant le nom indiqu\u00E9. Indiquez-en un autre.
+ FileChooser.acceptAllFileFilter.textAndMnemonic=Tous les fichiers
+ FileChooser.cancelButton.textAndMnemonic=Annuler
+-FileChooser.saveButton.textAndMnemonic=Enregi&strer
+-FileChooser.openButton.textAndMnemonic=&Ouvrir
++FileChooser.saveButton.textAndMnemonic=Enregistrer
++FileChooser.openButton.textAndMnemonic=Ouvrir
+ FileChooser.saveDialogTitle.textAndMnemonic=Enregistrer
+ FileChooser.openDialogTitle.textAndMnemonic=Ouvrir
+ FileChooser.updateButton.textAndMnemonic=Mettre \u00E0 jo&ur
+ FileChooser.helpButton.textAndMnemonic=&Aide
+-FileChooser.directoryOpenButton.textAndMnemonic=&Ouvrir
++FileChooser.directoryOpenButton.textAndMnemonic=Ouvrir
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic=Impossibile rinominare {0}: esiste gi\u00E0 un file con il nome specificato. Specificare un altro nome.
+ FileChooser.acceptAllFileFilter.textAndMnemonic=Tutti i file
+ FileChooser.cancelButton.textAndMnemonic=Annulla
+-FileChooser.saveButton.textAndMnemonic=Sal&va
+-FileChooser.openButton.textAndMnemonic=&Apri
++FileChooser.saveButton.textAndMnemonic=Salva
++FileChooser.openButton.textAndMnemonic=Apri
+ FileChooser.saveDialogTitle.textAndMnemonic=Salva
+ FileChooser.openDialogTitle.textAndMnemonic=Apri
+ FileChooser.updateButton.textAndMnemonic=Ag&giorna
+ FileChooser.helpButton.textAndMnemonic=&?
+-FileChooser.directoryOpenButton.textAndMnemonic=&Apri
++FileChooser.directoryOpenButton.textAndMnemonic=Apri
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic={0}\u306E\u540D\u524D\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093: \u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u5225\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002
+ FileChooser.acceptAllFileFilter.textAndMnemonic=\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB
+ FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
+-FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58(&S)
+-FileChooser.openButton.textAndMnemonic=\u958B\u304F(&O)
++FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58
++FileChooser.openButton.textAndMnemonic=\u958B\u304F
+ FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58
+ FileChooser.openDialogTitle.textAndMnemonic=\u958B\u304F
+ FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0(&U)
+ FileChooser.helpButton.textAndMnemonic=\u30D8\u30EB\u30D7(&H)
+-FileChooser.directoryOpenButton.textAndMnemonic=\u958B\u304F(&O)
++FileChooser.directoryOpenButton.textAndMnemonic=\u958B\u304F
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic={0}\uC758 \uC774\uB984\uC744 \uBC14\uAFC0 \uC218 \uC5C6\uC74C: \uC9C0\uC815\uD55C \uC774\uB984\uC744 \uC0AC\uC6A9\uD558\uB294 \uD30C\uC77C\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4. \uB2E4\uB978 \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624.
+ FileChooser.acceptAllFileFilter.textAndMnemonic=\uBAA8\uB4E0 \uD30C\uC77C
+ FileChooser.cancelButton.textAndMnemonic=\uCDE8\uC18C
+-FileChooser.saveButton.textAndMnemonic=\uC800\uC7A5(&S)
+-FileChooser.openButton.textAndMnemonic=\uC5F4\uAE30(&O)
++FileChooser.saveButton.textAndMnemonic=\uC800\uC7A5
++FileChooser.openButton.textAndMnemonic=\uC5F4\uAE30
+ FileChooser.saveDialogTitle.textAndMnemonic=\uC800\uC7A5
+ FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30
+ FileChooser.updateButton.textAndMnemonic=\uC5C5\uB370\uC774\uD2B8(&U)
+ FileChooser.helpButton.textAndMnemonic=\uB3C4\uC6C0\uB9D0(&H)
+-FileChooser.directoryOpenButton.textAndMnemonic=\uC5F4\uAE30(&O)
++FileChooser.directoryOpenButton.textAndMnemonic=\uC5F4\uAE30
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic=N\u00E3o \u00E9 poss\u00EDvel renomear {0}: Um arquivo com o nome especificado j\u00E1 existe. Especifique outro nome de arquivo.
+ FileChooser.acceptAllFileFilter.textAndMnemonic=Todos os Arquivos
+ FileChooser.cancelButton.textAndMnemonic=Cancelar
+-FileChooser.saveButton.textAndMnemonic=&Salvar
+-FileChooser.openButton.textAndMnemonic=A&brir
++FileChooser.saveButton.textAndMnemonic=Salvar
++FileChooser.openButton.textAndMnemonic=Abrir
+ FileChooser.saveDialogTitle.textAndMnemonic=Salvar
+ FileChooser.openDialogTitle.textAndMnemonic=Abrir
+ FileChooser.updateButton.textAndMnemonic=At&ualizar
+ FileChooser.helpButton.textAndMnemonic=Aj&uda
+-FileChooser.directoryOpenButton.textAndMnemonic=A&brir
++FileChooser.directoryOpenButton.textAndMnemonic=Abrir
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic=Kan inte namn\u00E4ndra {0}: En fil med angivet namn finns redan. Ange ett annat filnamn.
+ FileChooser.acceptAllFileFilter.textAndMnemonic=Alla filer
+ FileChooser.cancelButton.textAndMnemonic=Avbryt
+-FileChooser.saveButton.textAndMnemonic=&Spara
+-FileChooser.openButton.textAndMnemonic=&\u00D6ppna
++FileChooser.saveButton.textAndMnemonic=Spara
++FileChooser.openButton.textAndMnemonic=\u00D6ppna
+ FileChooser.saveDialogTitle.textAndMnemonic=Spara
+ FileChooser.openDialogTitle.textAndMnemonic=\u00D6ppna
+ FileChooser.updateButton.textAndMnemonic=Upp&datera
+ FileChooser.helpButton.textAndMnemonic=&Hj\u00E4lp
+-FileChooser.directoryOpenButton.textAndMnemonic=&\u00D6ppna
++FileChooser.directoryOpenButton.textAndMnemonic=\u00D6ppna
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic=\u65E0\u6CD5\u91CD\u547D\u540D{0}: \u5DF2\u5B58\u5728\u5177\u6709\u6240\u6307\u5B9A\u540D\u79F0\u7684\u6587\u4EF6\u3002\u8BF7\u6307\u5B9A\u5176\u4ED6\u6587\u4EF6\u540D\u3002
+ FileChooser.acceptAllFileFilter.textAndMnemonic=\u6240\u6709\u6587\u4EF6
+ FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
+-FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58(&S)
+-FileChooser.openButton.textAndMnemonic=\u6253\u5F00(&O)
++FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58
++FileChooser.openButton.textAndMnemonic=\u6253\u5F00
+ FileChooser.saveDialogTitle.textAndMnemonic=\u4FDD\u5B58
+ FileChooser.openDialogTitle.textAndMnemonic=\u6253\u5F00
+ FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0(&U)
+ FileChooser.helpButton.textAndMnemonic=\u5E2E\u52A9(&H)
+-FileChooser.directoryOpenButton.textAndMnemonic=\u6253\u5F00(&O)
++FileChooser.directoryOpenButton.textAndMnemonic=\u6253\u5F00
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -42,13 +42,13 @@
+ FileChooser.renameErrorFileExists.textAndMnemonic=\u7121\u6CD5\u91CD\u65B0\u547D\u540D {0}: \u5DF2\u7D93\u5B58\u5728\u60A8\u6240\u6307\u5B9A\u540D\u7A31\u7684\u6A94\u6848\u3002\u8ACB\u6307\u5B9A\u4E0D\u540C\u7684\u540D\u7A31\u3002
+ FileChooser.acceptAllFileFilter.textAndMnemonic=\u6240\u6709\u6A94\u6848
+ FileChooser.cancelButton.textAndMnemonic=\u53D6\u6D88
+-FileChooser.saveButton.textAndMnemonic=\u5132\u5B58(&S)
+-FileChooser.openButton.textAndMnemonic=\u958B\u555F(&O)
++FileChooser.saveButton.textAndMnemonic=\u5132\u5B58
++FileChooser.openButton.textAndMnemonic=\u958B\u555F
+ FileChooser.saveDialogTitle.textAndMnemonic=\u5132\u5B58
+ FileChooser.openDialogTitle.textAndMnemonic=\u958B\u555F
+ FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0(&U)
+ FileChooser.helpButton.textAndMnemonic=\u8AAA\u660E(&H)
+-FileChooser.directoryOpenButton.textAndMnemonic=\u958B\u555F(&O)
++FileChooser.directoryOpenButton.textAndMnemonic=\u958B\u555F
+
+ # File Size Units
+ FileChooser.fileSizeKiloBytes={0} KB
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=Type
+ FileChooser.fileDateHeader.textAndMnemonic=Modified
+ FileChooser.fileAttrHeader.textAndMnemonic=Attributes
+-FileChooser.saveButton.textAndMnemonic=Save
+-FileChooser.openButton.textAndMnemonic=Open
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=&Restore
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=Typ
+ FileChooser.fileDateHeader.textAndMnemonic=Ge\u00E4ndert
+ FileChooser.fileAttrHeader.textAndMnemonic=Attribute
+-FileChooser.saveButton.textAndMnemonic=Speichern
+-FileChooser.openButton.textAndMnemonic=\u00D6ffnen
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=&Wiederherstellen
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+ FileChooser.fileDateHeader.textAndMnemonic=Modificado
+ FileChooser.fileAttrHeader.textAndMnemonic=Atributos
+-FileChooser.saveButton.textAndMnemonic=Guardar
+-FileChooser.openButton.textAndMnemonic=Abrir
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=&Restaurar
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=Type
+ FileChooser.fileDateHeader.textAndMnemonic=Modifi\u00E9
+ FileChooser.fileAttrHeader.textAndMnemonic=Attributs
+-FileChooser.saveButton.textAndMnemonic=Enregistrer
+-FileChooser.openButton.textAndMnemonic=Ouvrir
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=&Restaurer
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+ FileChooser.fileDateHeader.textAndMnemonic=Modificato
+ FileChooser.fileAttrHeader.textAndMnemonic=Attributi
+-FileChooser.saveButton.textAndMnemonic=Salva
+-FileChooser.openButton.textAndMnemonic=Apri
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=&Ripristina
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=\u30BF\u30A4\u30D7
+ FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6B63\u65E5
+ FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027
+-FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58
+-FileChooser.openButton.textAndMnemonic=\u958B\u304F
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=\u5FA9\u5143(&R)
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=\uC720\uD615
+ FileChooser.fileDateHeader.textAndMnemonic=\uC218\uC815 \uB0A0\uC9DC
+ FileChooser.fileAttrHeader.textAndMnemonic=\uC18D\uC131
+-FileChooser.saveButton.textAndMnemonic=\uC800\uC7A5
+-FileChooser.openButton.textAndMnemonic=\uC5F4\uAE30
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=\uBCF5\uC6D0(&R)
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+ FileChooser.fileDateHeader.textAndMnemonic=Modificado
+ FileChooser.fileAttrHeader.textAndMnemonic=Atributos
+-FileChooser.saveButton.textAndMnemonic=Salvar
+-FileChooser.openButton.textAndMnemonic=Abrir
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=&Restaurar
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=Typ
+ FileChooser.fileDateHeader.textAndMnemonic=\u00C4ndrad
+ FileChooser.fileAttrHeader.textAndMnemonic=Attribut
+-FileChooser.saveButton.textAndMnemonic=Spara
+-FileChooser.openButton.textAndMnemonic=\u00D6ppna
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=&\u00C5terst\u00E4ll
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=\u7C7B\u578B
+ FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F
+ FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027
+-FileChooser.saveButton.textAndMnemonic=\u4FDD\u5B58
+-FileChooser.openButton.textAndMnemonic=\u6253\u5F00
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=\u8FD8\u539F(&R)
+--- ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,6 @@
+ FileChooser.fileTypeHeader.textAndMnemonic=\u985E\u578B
+ FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F
+ FileChooser.fileAttrHeader.textAndMnemonic=\u5C6C\u6027
+-FileChooser.saveButton.textAndMnemonic=\u5132\u5B58
+-FileChooser.openButton.textAndMnemonic=\u958B\u555F
+
+ ############ Used by MetalTitlePane if rendering window decorations############
+ MetalTitlePane.restore.titleAndMnemonic=\u56DE\u5FA9(&R)
+--- ./jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -131,6 +131,15 @@
+ }
+
+ @Override
++ boolean isAssignableTo(ReferenceType type) {
++ if (type.name().equals("java.lang.Object")) {
++ // interfaces are always assignable to j.l.Object
++ return true;
++ }
++ return super.isAssignableTo(type);
++ }
++
++ @Override
+ List<InterfaceType> interfaces() {
+ return superinterfaces();
+ }
+@@ -140,4 +149,4 @@
+ // method must be directly in this interface
+ return this.equals(method.declaringType());
+ }
+-}
+\ No newline at end of file
++}
+--- ./jdk/src/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -311,7 +311,7 @@
+ /*
+ * For nonvirtual invokes, method must have a body
+ */
+- if ((options & INVOKE_NONVIRTUAL) != 0) {
++ if (isNonVirtual(options)) {
+ if (method.isAbstract()) {
+ throw new IllegalArgumentException("Abstract method");
+ }
+@@ -323,7 +323,7 @@
+ * method argument types.
+ */
+ ClassTypeImpl invokedClass;
+- if ((options & INVOKE_NONVIRTUAL) != 0) {
++ if (isNonVirtual(options)) {
+ // No overrides in non-virtual invokes
+ invokedClass = clazz;
+ } else {
+@@ -348,7 +348,7 @@
+ /*
+ * Only default methods allowed for nonvirtual invokes
+ */
+- if (!method.isDefault()) {
++ if (isNonVirtual(options) && !method.isDefault()) {
+ throw new IllegalArgumentException("Not a default method");
+ }
+ }
+@@ -624,4 +624,8 @@
+ byte typeValueKey() {
+ return JDWP.Tag.OBJECT;
+ }
++
++ private static boolean isNonVirtual(int options) {
++ return (options & INVOKE_NONVIRTUAL) != 0;
++ }
+ }
+--- ./jdk/src/share/classes/java/awt/Component.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/awt/Component.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1995, 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
+@@ -1302,6 +1302,25 @@
+ }
+
+ /**
++ * Determines the bounds of a visible part of the component relative to its
++ * parent.
++ *
++ * @return the visible part of bounds
++ */
++ private Rectangle getRecursivelyVisibleBounds() {
++ final Component container = getContainer();
++ final Rectangle bounds = getBounds();
++ if (container == null) {
++ // we are top level window or haven't a container, return our bounds
++ return bounds;
++ }
++ // translate the container's bounds to our coordinate space
++ final Rectangle parentsBounds = container.getRecursivelyVisibleBounds();
++ parentsBounds.setLocation(0, 0);
++ return parentsBounds.intersection(bounds);
++ }
++
++ /**
+ * Translates absolute coordinates into coordinates in the coordinate
+ * space of this component.
+ */
+@@ -1473,7 +1492,7 @@
+ ComponentPeer peer = this.peer;
+ if (peer != null) {
+ peer.setEnabled(true);
+- if (visible) {
++ if (visible && !getRecursivelyVisibleBounds().isEmpty()) {
+ updateCursorImmediately();
+ }
+ }
+@@ -1522,7 +1541,7 @@
+ ComponentPeer peer = this.peer;
+ if (peer != null) {
+ peer.setEnabled(false);
+- if (visible) {
++ if (visible && !getRecursivelyVisibleBounds().isEmpty()) {
+ updateCursorImmediately();
+ }
+ }
+@@ -1669,15 +1688,6 @@
+ /* do nothing */
+ }
+
+- /*
+- * Delete references from LightweithDispatcher of a heavyweight parent
+- */
+- void clearLightweightDispatcherOnRemove(Component removedComponent) {
+- if (parent != null) {
+- parent.clearLightweightDispatcherOnRemove(removedComponent);
+- }
+- }
+-
+ /**
+ * @deprecated As of JDK version 1.1,
+ * replaced by <code>setVisible(boolean)</code>.
+@@ -6180,7 +6190,7 @@
+ /**
+ * Indicates whether a class or its superclasses override coalesceEvents.
+ * Must be called with lock on coalesceMap and privileged.
+- * @see checkCoalsecing
++ * @see checkCoalescing
+ */
+ private static boolean isCoalesceEventsOverriden(Class<?> clazz) {
+ assert Thread.holdsLock(coalesceMap);
+@@ -6986,8 +6996,6 @@
+ }
+
+ synchronized (getTreeLock()) {
+- clearLightweightDispatcherOnRemove(this);
+-
+ if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
+ transferFocus(true);
+ }
+--- ./jdk/src/share/classes/java/awt/Container.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/awt/Container.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1995, 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
+@@ -41,8 +41,10 @@
+ import java.io.PrintStream;
+ import java.io.PrintWriter;
+
++import java.lang.ref.WeakReference;
+ import java.security.AccessController;
+
++import java.util.ArrayList;
+ import java.util.EventListener;
+ import java.util.HashSet;
+ import java.util.Set;
+@@ -99,7 +101,7 @@
+ * @see #add
+ * @see #getComponents
+ */
+- private java.util.List<Component> component = new java.util.ArrayList<Component>();
++ private java.util.List<Component> component = new ArrayList<>();
+
+ /**
+ * Layout manager for this container.
+@@ -2544,28 +2546,24 @@
+ if (!contains(x, y)) {
+ return null;
+ }
++ Component lightweight = null;
+ synchronized (getTreeLock()) {
+- // Two passes: see comment in sun.awt.SunGraphicsCallback
+- for (int i = 0; i < component.size(); i++) {
+- Component comp = component.get(i);
+- if (comp != null &&
+- !(comp.peer instanceof LightweightPeer)) {
+- if (comp.contains(x - comp.x, y - comp.y)) {
++ // Optimized version of two passes:
++ // see comment in sun.awt.SunGraphicsCallback
++ for (final Component comp : component) {
++ if (comp.contains(x - comp.x, y - comp.y)) {
++ if (!comp.isLightweight()) {
++ // return heavyweight component as soon as possible
+ return comp;
+ }
+- }
+- }
+- for (int i = 0; i < component.size(); i++) {
+- Component comp = component.get(i);
+- if (comp != null &&
+- comp.peer instanceof LightweightPeer) {
+- if (comp.contains(x - comp.x, y - comp.y)) {
+- return comp;
++ if (lightweight == null) {
++ // save and return later the first lightweight component
++ lightweight = comp;
+ }
+ }
+ }
+ }
+- return this;
++ return lightweight != null ? lightweight : this;
+ }
+
+ /**
+@@ -2669,52 +2667,54 @@
+ return null;
+ }
+
+- final Component findComponentAtImpl(int x, int y, boolean ignoreEnabled){
+- checkTreeLock();
++ final Component findComponentAtImpl(int x, int y, boolean ignoreEnabled) {
++ // checkTreeLock(); commented for a performance reason
+
+ if (!(contains(x, y) && visible && (ignoreEnabled || enabled))) {
+ return null;
+ }
+-
+- // Two passes: see comment in sun.awt.SunGraphicsCallback
+- for (int i = 0; i < component.size(); i++) {
+- Component comp = component.get(i);
+- if (comp != null &&
+- !(comp.peer instanceof LightweightPeer)) {
+- if (comp instanceof Container) {
+- comp = ((Container)comp).findComponentAtImpl(x - comp.x,
+- y - comp.y,
+- ignoreEnabled);
+- } else {
+- comp = comp.getComponentAt(x - comp.x, y - comp.y);
++ Component lightweight = null;
++ // Optimized version of two passes:
++ // see comment in sun.awt.SunGraphicsCallback
++ for (final Component comp : component) {
++ final int x1 = x - comp.x;
++ final int y1 = y - comp.y;
++ if (!comp.contains(x1, y1)) {
++ continue; // fast path
++ }
++ if (!comp.isLightweight()) {
++ final Component child = getChildAt(comp, x1, y1, ignoreEnabled);
++ if (child != null) {
++ // return heavyweight component as soon as possible
++ return child;
+ }
+- if (comp != null && comp.visible &&
+- (ignoreEnabled || comp.enabled))
+- {
+- return comp;
++ } else {
++ if (lightweight == null) {
++ // save and return later the first lightweight component
++ lightweight = getChildAt(comp, x1, y1, ignoreEnabled);
+ }
+ }
+ }
+- for (int i = 0; i < component.size(); i++) {
+- Component comp = component.get(i);
+- if (comp != null &&
+- comp.peer instanceof LightweightPeer) {
+- if (comp instanceof Container) {
+- comp = ((Container)comp).findComponentAtImpl(x - comp.x,
+- y - comp.y,
+- ignoreEnabled);
+- } else {
+- comp = comp.getComponentAt(x - comp.x, y - comp.y);
+- }
+- if (comp != null && comp.visible &&
+- (ignoreEnabled || comp.enabled))
+- {
+- return comp;
+- }
+- }
++ return lightweight != null ? lightweight : this;
++ }
++
++ /**
++ * Helper method for findComponentAtImpl. Finds a child component using
++ * findComponentAtImpl for Container and getComponentAt for Component.
++ */
++ private static Component getChildAt(Component comp, int x, int y,
++ boolean ignoreEnabled) {
++ if (comp instanceof Container) {
++ comp = ((Container) comp).findComponentAtImpl(x, y,
++ ignoreEnabled);
++ } else {
++ comp = comp.getComponentAt(x, y);
+ }
+-
+- return this;
++ if (comp != null && comp.visible &&
++ (ignoreEnabled || comp.enabled)) {
++ return comp;
++ }
++ return null;
+ }
+
+ /**
+@@ -3310,16 +3310,6 @@
+ }
+ }
+
+- @Override
+- void clearLightweightDispatcherOnRemove(Component removedComponent) {
+- if (dispatcher != null) {
+- dispatcher.removeReferences(removedComponent);
+- } else {
+- //It is a Lightweight Container, should clear parent`s Dispatcher
+- super.clearLightweightDispatcherOnRemove(removedComponent);
+- }
+- }
+-
+ final Container getTraversalRoot() {
+ if (isFocusCycleRoot()) {
+ return findTraversalRoot();
+@@ -4411,9 +4401,23 @@
+
+ private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.LightweightDispatcher");
+
++ private static final int BUTTONS_DOWN_MASK;
++
++ static {
++ int[] buttonsDownMask = AWTAccessor.getInputEventAccessor().
++ getButtonDownMasks();
++ int mask = 0;
++ for (int buttonDownMask : buttonsDownMask) {
++ mask |= buttonDownMask;
++ }
++ BUTTONS_DOWN_MASK = mask;
++ }
++
+ LightweightDispatcher(Container nativeContainer) {
+ this.nativeContainer = nativeContainer;
+- mouseEventTarget = null;
++ mouseEventTarget = new WeakReference<>(null);
++ targetLastEntered = new WeakReference<>(null);
++ targetLastEnteredDT = new WeakReference<>(null);
+ eventMask = 0;
+ }
+
+@@ -4424,9 +4428,9 @@
+ void dispose() {
+ //System.out.println("Disposing lw dispatcher");
+ stopListeningForOtherDrags();
+- mouseEventTarget = null;
+- targetLastEntered = null;
+- targetLastEnteredDT = null;
++ mouseEventTarget.clear();
++ targetLastEntered.clear();
++ targetLastEnteredDT.clear();
+ }
+
+ /**
+@@ -4477,25 +4481,12 @@
+ private boolean isMouseGrab(MouseEvent e) {
+ int modifiers = e.getModifiersEx();
+
+- if(e.getID() == MouseEvent.MOUSE_PRESSED
+- || e.getID() == MouseEvent.MOUSE_RELEASED)
+- {
+- switch (e.getButton()) {
+- case MouseEvent.BUTTON1:
+- modifiers ^= InputEvent.BUTTON1_DOWN_MASK;
+- break;
+- case MouseEvent.BUTTON2:
+- modifiers ^= InputEvent.BUTTON2_DOWN_MASK;
+- break;
+- case MouseEvent.BUTTON3:
+- modifiers ^= InputEvent.BUTTON3_DOWN_MASK;
+- break;
+- }
++ if (e.getID() == MouseEvent.MOUSE_PRESSED
++ || e.getID() == MouseEvent.MOUSE_RELEASED) {
++ modifiers ^= InputEvent.getMaskForButton(e.getButton());
+ }
+ /* modifiers now as just before event */
+- return ((modifiers & (InputEvent.BUTTON1_DOWN_MASK
+- | InputEvent.BUTTON2_DOWN_MASK
+- | InputEvent.BUTTON3_DOWN_MASK)) != 0);
++ return ((modifiers & BUTTONS_DOWN_MASK) != 0);
+ }
+
+ /**
+@@ -4513,65 +4504,62 @@
+
+ trackMouseEnterExit(mouseOver, e);
+
+- // 4508327 : MOUSE_CLICKED should only go to the recipient of
+- // the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
+- // MOUSE_CLICKED.
+- if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
+- mouseEventTarget = (mouseOver != nativeContainer) ? mouseOver: null;
+- isCleaned = false;
++ Component met = mouseEventTarget.get();
++ // 4508327 : MOUSE_CLICKED should only go to the recipient of
++ // the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
++ // MOUSE_CLICKED.
++ if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
++ met = (mouseOver != nativeContainer) ? mouseOver : null;
++ mouseEventTarget = new WeakReference<>(met);
+ }
+
+- if (mouseEventTarget != null) {
++ if (met != null) {
+ switch (id) {
+- case MouseEvent.MOUSE_ENTERED:
+- case MouseEvent.MOUSE_EXITED:
+- break;
+- case MouseEvent.MOUSE_PRESSED:
+- retargetMouseEvent(mouseEventTarget, id, e);
+- break;
+- case MouseEvent.MOUSE_RELEASED:
+- retargetMouseEvent(mouseEventTarget, id, e);
+- break;
+- case MouseEvent.MOUSE_CLICKED:
+- // 4508327: MOUSE_CLICKED should never be dispatched to a Component
+- // other than that which received the MOUSE_PRESSED event. If the
+- // mouse is now over a different Component, don't dispatch the event.
+- // The previous fix for a similar problem was associated with bug
+- // 4155217.
+- if (mouseOver == mouseEventTarget) {
+- retargetMouseEvent(mouseOver, id, e);
+- }
+- break;
+- case MouseEvent.MOUSE_MOVED:
+- retargetMouseEvent(mouseEventTarget, id, e);
+- break;
+- case MouseEvent.MOUSE_DRAGGED:
+- if (isMouseGrab(e)) {
+- retargetMouseEvent(mouseEventTarget, id, e);
+- }
+- break;
+- case MouseEvent.MOUSE_WHEEL:
+- // This may send it somewhere that doesn't have MouseWheelEvents
+- // enabled. In this case, Component.dispatchEventImpl() will
+- // retarget the event to a parent that DOES have the events enabled.
+- if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
+- eventLog.finest("retargeting mouse wheel to " +
++ case MouseEvent.MOUSE_ENTERED:
++ case MouseEvent.MOUSE_EXITED:
++ break;
++ case MouseEvent.MOUSE_PRESSED:
++ retargetMouseEvent(met, id, e);
++ break;
++ case MouseEvent.MOUSE_RELEASED:
++ retargetMouseEvent(met, id, e);
++ break;
++ case MouseEvent.MOUSE_CLICKED:
++ // 4508327: MOUSE_CLICKED should never be dispatched to a Component
++ // other than that which received the MOUSE_PRESSED event. If the
++ // mouse is now over a different Component, don't dispatch the event.
++ // The previous fix for a similar problem was associated with bug
++ // 4155217.
++ if (mouseOver == met) {
++ retargetMouseEvent(mouseOver, id, e);
++ }
++ break;
++ case MouseEvent.MOUSE_MOVED:
++ retargetMouseEvent(met, id, e);
++ break;
++ case MouseEvent.MOUSE_DRAGGED:
++ if (isMouseGrab(e)) {
++ retargetMouseEvent(met, id, e);
++ }
++ break;
++ case MouseEvent.MOUSE_WHEEL:
++ // This may send it somewhere that doesn't have MouseWheelEvents
++ // enabled. In this case, Component.dispatchEventImpl() will
++ // retarget the event to a parent that DOES have the events enabled.
++ if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
++ eventLog.finest("retargeting mouse wheel to " +
+ mouseOver.getName() + ", " +
+ mouseOver.getClass());
++ }
++ retargetMouseEvent(mouseOver, id, e);
++ break;
+ }
+- retargetMouseEvent(mouseOver, id, e);
+- break;
++ //Consuming of wheel events is implemented in "retargetMouseEvent".
++ if (id != MouseEvent.MOUSE_WHEEL) {
++ e.consume();
+ }
+- //Consuming of wheel events is implemented in "retargetMouseEvent".
+- if (id != MouseEvent.MOUSE_WHEEL) {
+- e.consume();
+ }
+- } else if (isCleaned && id != MouseEvent.MOUSE_WHEEL) {
+- //After mouseEventTarget was removed and cleaned should consume all events
+- //until new mouseEventTarget is found
+- e.consume();
+- }
+- return e.isConsumed();
++ return e.isConsumed();
+ }
+
+ private boolean processDropTargetEvent(SunDropTargetEvent e) {
+@@ -4628,15 +4616,16 @@
+ // drag has an associated drop target. MOUSE_ENTERED comes when the
+ // mouse is in the native container already. To propagate this event
+ // properly we should null out targetLastEntered.
+- targetLastEnteredDT = null;
++ targetLastEnteredDT.clear();
+ } else if (id == MouseEvent.MOUSE_ENTERED) {
+ isMouseDTInNativeContainer = true;
+ } else if (id == MouseEvent.MOUSE_EXITED) {
+ isMouseDTInNativeContainer = false;
+ }
+- targetLastEnteredDT = retargetMouseEnterExit(targetOver, e,
+- targetLastEnteredDT,
++ Component tle = retargetMouseEnterExit(targetOver, e,
++ targetLastEnteredDT.get(),
+ isMouseDTInNativeContainer);
++ targetLastEnteredDT = new WeakReference<>(tle);
+ }
+
+ /*
+@@ -4662,9 +4651,10 @@
+ isMouseInNativeContainer = false;
+ stopListeningForOtherDrags();
+ }
+- targetLastEntered = retargetMouseEnterExit(targetOver, e,
+- targetLastEntered,
++ Component tle = retargetMouseEnterExit(targetOver, e,
++ targetLastEntered.get(),
+ isMouseInNativeContainer);
++ targetLastEntered = new WeakReference<>(tle);
+ }
+
+ private Component retargetMouseEnterExit(Component targetOver, MouseEvent e,
+@@ -4926,22 +4916,17 @@
+ * is null, there are currently no events being forwarded to
+ * a subcomponent.
+ */
+- private transient Component mouseEventTarget;
++ private transient WeakReference<Component> mouseEventTarget;
+
+ /**
+ * The last component entered by the {@code MouseEvent}.
+ */
+- private transient Component targetLastEntered;
++ private transient WeakReference<Component> targetLastEntered;
+
+ /**
+ * The last component entered by the {@code SunDropTargetEvent}.
+ */
+- private transient Component targetLastEnteredDT;
+-
+- /**
+- * Indicates whether {@code mouseEventTarget} was removed and nulled
+- */
+- private transient boolean isCleaned;
++ private transient WeakReference<Component> targetLastEnteredDT;
+
+ /**
+ * Is the mouse over the native container.
+@@ -4982,17 +4967,4 @@
+ AWTEvent.MOUSE_EVENT_MASK |
+ AWTEvent.MOUSE_MOTION_EVENT_MASK |
+ AWTEvent.MOUSE_WHEEL_EVENT_MASK;
+-
+- void removeReferences(Component removedComponent) {
+- if (mouseEventTarget == removedComponent) {
+- isCleaned = true;
+- mouseEventTarget = null;
+- }
+- if (targetLastEntered == removedComponent) {
+- targetLastEntered = null;
+- }
+- if (targetLastEnteredDT == removedComponent) {
+- targetLastEnteredDT = null;
+- }
+- }
+ }
+--- ./jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java Wed Jul 01 21:53:30 2015 -0700
+@@ -504,7 +504,10 @@
+ } else if (comp instanceof Container && comp != aContainer) {
+ Container cont = (Container)comp;
+ if (cont.isFocusTraversalPolicyProvider()) {
+- return cont.getFocusTraversalPolicy().getLastComponent(cont);
++ Component retComp = cont.getFocusTraversalPolicy().getLastComponent(cont);
++ if (retComp != null) {
++ return retComp;
++ }
+ }
+ }
+ }
+--- ./jdk/src/share/classes/java/awt/GraphicsEnvironment.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/awt/GraphicsEnvironment.java Wed Jul 01 21:53:30 2015 -0700
+@@ -28,6 +28,7 @@
+
+ import java.awt.image.BufferedImage;
+ import java.security.AccessController;
++import java.security.PrivilegedAction;
+ import java.util.Locale;
+
+ import sun.font.FontManager;
+@@ -160,42 +161,38 @@
+ */
+ private static boolean getHeadlessProperty() {
+ if (headless == null) {
+- java.security.AccessController.doPrivileged(
+- new java.security.PrivilegedAction<Object>() {
+- public Object run() {
+- String nm = System.getProperty("java.awt.headless");
++ AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
++ String nm = System.getProperty("java.awt.headless");
+
+- if (nm == null) {
+- /* No need to ask for DISPLAY when run in a browser */
+- if (System.getProperty("javaplugin.version") != null) {
+- headless = defaultHeadless = Boolean.FALSE;
++ if (nm == null) {
++ /* No need to ask for DISPLAY when run in a browser */
++ if (System.getProperty("javaplugin.version") != null) {
++ headless = defaultHeadless = Boolean.FALSE;
++ } else {
++ String osName = System.getProperty("os.name");
++ if (osName.contains("OS X") && "sun.awt.HToolkit".equals(
++ System.getProperty("awt.toolkit")))
++ {
++ headless = defaultHeadless = Boolean.TRUE;
+ } else {
+- String osName = System.getProperty("os.name");
+- if (osName.contains("OS X") && "sun.awt.HToolkit".equals(
+- System.getProperty("awt.toolkit")))
+- {
+- headless = defaultHeadless = Boolean.TRUE;
+- } else {
+- headless = defaultHeadless =
+- Boolean.valueOf(("Linux".equals(osName) ||
+- "SunOS".equals(osName) ||
+- "FreeBSD".equals(osName) ||
+- "NetBSD".equals(osName) ||
+- "OpenBSD".equals(osName)) &&
+- (System.getenv("DISPLAY") == null));
+- }
++ final String display = System.getenv("DISPLAY");
++ headless = defaultHeadless =
++ ("Linux".equals(osName) ||
++ "SunOS".equals(osName) ||
++ "FreeBSD".equals(osName) ||
++ "NetBSD".equals(osName) ||
++ "OpenBSD".equals(osName) ||
++ "AIX".equals(osName)) &&
++ (display == null || display.trim().isEmpty());
+ }
+- } else if (nm.equals("true")) {
+- headless = Boolean.TRUE;
+- } else {
+- headless = Boolean.FALSE;
+ }
+- return null;
++ } else {
++ headless = Boolean.valueOf(nm);
+ }
+- }
+- );
++ return null;
++ });
+ }
+- return headless.booleanValue();
++ return headless;
+ }
+
+ /**
+--- ./jdk/src/share/classes/java/awt/MenuBar.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/awt/MenuBar.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1995, 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
+@@ -181,7 +181,7 @@
+ * removed from the menu bar, and replaced with the specified menu.
+ * @param m the menu to be set as the help menu
+ */
+- public void setHelpMenu(Menu m) {
++ public void setHelpMenu(final Menu m) {
+ synchronized (getTreeLock()) {
+ if (helpMenu == m) {
+ return;
+@@ -189,11 +189,11 @@
+ if (helpMenu != null) {
+ remove(helpMenu);
+ }
+- if (m.parent != this) {
+- add(m);
+- }
+ helpMenu = m;
+ if (m != null) {
++ if (m.parent != this) {
++ add(m);
++ }
+ m.isHelpMenu = true;
+ m.parent = this;
+ MenuBarPeer peer = (MenuBarPeer)this.peer;
+@@ -242,7 +242,7 @@
+ * @param index the position of the menu to be removed.
+ * @see java.awt.MenuBar#add(java.awt.Menu)
+ */
+- public void remove(int index) {
++ public void remove(final int index) {
+ synchronized (getTreeLock()) {
+ Menu m = getMenu(index);
+ menus.removeElementAt(index);
+@@ -252,6 +252,10 @@
+ m.parent = null;
+ peer.delMenu(index);
+ }
++ if (helpMenu == m) {
++ helpMenu = null;
++ m.isHelpMenu = false;
++ }
+ }
+ }
+
+--- ./jdk/src/share/classes/java/awt/ScrollPane.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/awt/ScrollPane.java Wed Jul 01 21:53:30 2015 -0700
+@@ -496,9 +496,8 @@
+ Point p = getScrollPosition();
+ Dimension cs = calculateChildSize();
+ Dimension vs = getViewportSize();
+- Insets i = getInsets();
+
+- c.reshape(i.left - p.x, i.top - p.y, cs.width, cs.height);
++ c.reshape(- p.x, - p.y, cs.width, cs.height);
+ ScrollPanePeer peer = (ScrollPanePeer)this.peer;
+ if (peer != null) {
+ peer.childResized(cs.width, cs.height);
+--- ./jdk/src/share/classes/java/awt/geom/Path2D.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/awt/geom/Path2D.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2006, 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
+@@ -101,6 +101,8 @@
+
+ static final int INIT_SIZE = 20;
+ static final int EXPAND_MAX = 500;
++ static final int EXPAND_MAX_COORDS = EXPAND_MAX * 2;
++ static final int EXPAND_MIN = 10; // ensure > 6 (cubics)
+
+ /**
+ * Constructs a new empty {@code Path2D} object.
+@@ -141,6 +143,42 @@
+ abstract int rectCrossings(double rxmin, double rymin,
+ double rxmax, double rymax);
+
++ static byte[] expandPointTypes(byte[] oldPointTypes, int needed) {
++ final int oldSize = oldPointTypes.length;
++ final int newSizeMin = oldSize + needed;
++ if (newSizeMin < oldSize) {
++ // hard overflow failure - we can't even accommodate
++ // new items without overflowing
++ throw new ArrayIndexOutOfBoundsException(
++ "pointTypes exceeds maximum capacity !");
++ }
++ // growth algorithm computation
++ int grow = oldSize;
++ if (grow > EXPAND_MAX) {
++ grow = Math.max(EXPAND_MAX, oldSize >> 3); // 1/8th min
++ } else if (grow < EXPAND_MIN) {
++ grow = EXPAND_MIN;
++ }
++ assert grow > 0;
++
++ int newSize = oldSize + grow;
++ if (newSize < newSizeMin) {
++ // overflow in growth algorithm computation
++ newSize = Integer.MAX_VALUE;
++ }
++ while (true) {
++ try {
++ // try allocating the larger array
++ return Arrays.copyOf(oldPointTypes, newSize);
++ } catch (OutOfMemoryError oome) {
++ if (newSize == newSizeMin) {
++ throw oome;
++ }
++ }
++ newSize = newSizeMin + (newSize - newSizeMin) / 2;
++ }
++ }
++
+ /**
+ * The {@code Float} class defines a geometric path with
+ * coordinates stored in single precision floating point.
+@@ -224,8 +262,8 @@
+ Path2D p2d = (Path2D) s;
+ setWindingRule(p2d.windingRule);
+ this.numTypes = p2d.numTypes;
+- this.pointTypes = Arrays.copyOf(p2d.pointTypes,
+- p2d.pointTypes.length);
++ // trim arrays:
++ this.pointTypes = Arrays.copyOf(p2d.pointTypes, p2d.numTypes);
+ this.numCoords = p2d.numCoords;
+ this.floatCoords = p2d.cloneCoordsFloat(at);
+ } else {
+@@ -237,19 +275,23 @@
+ }
+ }
+
++ @Override
+ float[] cloneCoordsFloat(AffineTransform at) {
++ // trim arrays:
+ float ret[];
+ if (at == null) {
+- ret = Arrays.copyOf(this.floatCoords, this.floatCoords.length);
++ ret = Arrays.copyOf(floatCoords, numCoords);
+ } else {
+- ret = new float[floatCoords.length];
++ ret = new float[numCoords];
+ at.transform(floatCoords, 0, ret, 0, numCoords / 2);
+ }
+ return ret;
+ }
+
++ @Override
+ double[] cloneCoordsDouble(AffineTransform at) {
+- double ret[] = new double[floatCoords.length];
++ // trim arrays:
++ double ret[] = new double[numCoords];
+ if (at == null) {
+ for (int i = 0; i < numCoords; i++) {
+ ret[i] = floatCoords[i];
+@@ -275,31 +317,53 @@
+ floatCoords[coordindex+1]);
+ }
+
++ @Override
+ void needRoom(boolean needMove, int newCoords) {
+- if (needMove && numTypes == 0) {
++ if ((numTypes == 0) && needMove) {
+ throw new IllegalPathStateException("missing initial moveto "+
+ "in path definition");
+ }
+- int size = pointTypes.length;
+- if (numTypes >= size) {
+- int grow = size;
+- if (grow > EXPAND_MAX) {
+- grow = EXPAND_MAX;
+- } else if (grow == 0) {
+- grow = 1;
++ if (numTypes >= pointTypes.length) {
++ pointTypes = expandPointTypes(pointTypes, 1);
++ }
++ if (numCoords > (floatCoords.length - newCoords)) {
++ floatCoords = expandCoords(floatCoords, newCoords);
++ }
++ }
++
++ static float[] expandCoords(float[] oldCoords, int needed) {
++ final int oldSize = oldCoords.length;
++ final int newSizeMin = oldSize + needed;
++ if (newSizeMin < oldSize) {
++ // hard overflow failure - we can't even accommodate
++ // new items without overflowing
++ throw new ArrayIndexOutOfBoundsException(
++ "coords exceeds maximum capacity !");
++ }
++ // growth algorithm computation
++ int grow = oldSize;
++ if (grow > EXPAND_MAX_COORDS) {
++ grow = Math.max(EXPAND_MAX_COORDS, oldSize >> 3); // 1/8th min
++ } else if (grow < EXPAND_MIN) {
++ grow = EXPAND_MIN;
++ }
++ assert grow > needed;
++
++ int newSize = oldSize + grow;
++ if (newSize < newSizeMin) {
++ // overflow in growth algorithm computation
++ newSize = Integer.MAX_VALUE;
++ }
++ while (true) {
++ try {
++ // try allocating the larger array
++ return Arrays.copyOf(oldCoords, newSize);
++ } catch (OutOfMemoryError oome) {
++ if (newSize == newSizeMin) {
++ throw oome;
++ }
+ }
+- pointTypes = Arrays.copyOf(pointTypes, size+grow);
+- }
+- size = floatCoords.length;
+- if (numCoords + newCoords > size) {
+- int grow = size;
+- if (grow > EXPAND_MAX * 2) {
+- grow = EXPAND_MAX * 2;
+- }
+- if (grow < newCoords) {
+- grow = newCoords;
+- }
+- floatCoords = Arrays.copyOf(floatCoords, size+grow);
++ newSize = newSizeMin + (newSize - newSizeMin) / 2;
+ }
+ }
+
+@@ -475,6 +539,9 @@
+ }
+
+ int pointCrossings(double px, double py) {
++ if (numTypes == 0) {
++ return 0;
++ }
+ double movx, movy, curx, cury, endx, endy;
+ float coords[] = floatCoords;
+ curx = movx = coords[0];
+@@ -552,6 +619,9 @@
+ int rectCrossings(double rxmin, double rymin,
+ double rxmax, double rymax)
+ {
++ if (numTypes == 0) {
++ return 0;
++ }
+ float coords[] = floatCoords;
+ double curx, cury, movx, movy, endx, endy;
+ curx = movx = coords[0];
+@@ -1061,8 +1131,8 @@
+ Path2D p2d = (Path2D) s;
+ setWindingRule(p2d.windingRule);
+ this.numTypes = p2d.numTypes;
+- this.pointTypes = Arrays.copyOf(p2d.pointTypes,
+- p2d.pointTypes.length);
++ // trim arrays:
++ this.pointTypes = Arrays.copyOf(p2d.pointTypes, p2d.numTypes);
+ this.numCoords = p2d.numCoords;
+ this.doubleCoords = p2d.cloneCoordsDouble(at);
+ } else {
+@@ -1074,8 +1144,10 @@
+ }
+ }
+
++ @Override
+ float[] cloneCoordsFloat(AffineTransform at) {
+- float ret[] = new float[doubleCoords.length];
++ // trim arrays:
++ float ret[] = new float[numCoords];
+ if (at == null) {
+ for (int i = 0; i < numCoords; i++) {
+ ret[i] = (float) doubleCoords[i];
+@@ -1086,13 +1158,14 @@
+ return ret;
+ }
+
++ @Override
+ double[] cloneCoordsDouble(AffineTransform at) {
++ // trim arrays:
+ double ret[];
+ if (at == null) {
+- ret = Arrays.copyOf(this.doubleCoords,
+- this.doubleCoords.length);
++ ret = Arrays.copyOf(doubleCoords, numCoords);
+ } else {
+- ret = new double[doubleCoords.length];
++ ret = new double[numCoords];
+ at.transform(doubleCoords, 0, ret, 0, numCoords / 2);
+ }
+ return ret;
+@@ -1113,31 +1186,53 @@
+ doubleCoords[coordindex+1]);
+ }
+
++ @Override
+ void needRoom(boolean needMove, int newCoords) {
+- if (needMove && numTypes == 0) {
++ if ((numTypes == 0) && needMove) {
+ throw new IllegalPathStateException("missing initial moveto "+
+ "in path definition");
+ }
+- int size = pointTypes.length;
+- if (numTypes >= size) {
+- int grow = size;
+- if (grow > EXPAND_MAX) {
+- grow = EXPAND_MAX;
+- } else if (grow == 0) {
+- grow = 1;
++ if (numTypes >= pointTypes.length) {
++ pointTypes = expandPointTypes(pointTypes, 1);
++ }
++ if (numCoords > (doubleCoords.length - newCoords)) {
++ doubleCoords = expandCoords(doubleCoords, newCoords);
++ }
++ }
++
++ static double[] expandCoords(double[] oldCoords, int needed) {
++ final int oldSize = oldCoords.length;
++ final int newSizeMin = oldSize + needed;
++ if (newSizeMin < oldSize) {
++ // hard overflow failure - we can't even accommodate
++ // new items without overflowing
++ throw new ArrayIndexOutOfBoundsException(
++ "coords exceeds maximum capacity !");
++ }
++ // growth algorithm computation
++ int grow = oldSize;
++ if (grow > EXPAND_MAX_COORDS) {
++ grow = Math.max(EXPAND_MAX_COORDS, oldSize >> 3); // 1/8th min
++ } else if (grow < EXPAND_MIN) {
++ grow = EXPAND_MIN;
++ }
++ assert grow > needed;
++
++ int newSize = oldSize + grow;
++ if (newSize < newSizeMin) {
++ // overflow in growth algorithm computation
++ newSize = Integer.MAX_VALUE;
++ }
++ while (true) {
++ try {
++ // try allocating the larger array
++ return Arrays.copyOf(oldCoords, newSize);
++ } catch (OutOfMemoryError oome) {
++ if (newSize == newSizeMin) {
++ throw oome;
++ }
+ }
+- pointTypes = Arrays.copyOf(pointTypes, size+grow);
+- }
+- size = doubleCoords.length;
+- if (numCoords + newCoords > size) {
+- int grow = size;
+- if (grow > EXPAND_MAX * 2) {
+- grow = EXPAND_MAX * 2;
+- }
+- if (grow < newCoords) {
+- grow = newCoords;
+- }
+- doubleCoords = Arrays.copyOf(doubleCoords, size+grow);
++ newSize = newSizeMin + (newSize - newSizeMin) / 2;
+ }
+ }
+
+@@ -1202,6 +1297,9 @@
+ }
+
+ int pointCrossings(double px, double py) {
++ if (numTypes == 0) {
++ return 0;
++ }
+ double movx, movy, curx, cury, endx, endy;
+ double coords[] = doubleCoords;
+ curx = movx = coords[0];
+@@ -1279,6 +1377,9 @@
+ int rectCrossings(double rxmin, double rymin,
+ double rxmax, double rymax)
+ {
++ if (numTypes == 0) {
++ return 0;
++ }
+ double coords[] = doubleCoords;
+ double curx, cury, movx, movy, endx, endy;
+ curx = movx = coords[0];
+--- ./jdk/src/share/classes/java/awt/image/BufferedImage.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/awt/image/BufferedImage.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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,26 +25,23 @@
+
+ package java.awt.image;
+
++import java.awt.Graphics2D;
++import java.awt.GraphicsEnvironment;
++import java.awt.Point;
++import java.awt.Rectangle;
+ import java.awt.Transparency;
+ import java.awt.color.ColorSpace;
+-import java.awt.Graphics2D;
+-import java.awt.GraphicsConfiguration;
+-import java.awt.GraphicsEnvironment;
+-import java.awt.ImageCapabilities;
+-import java.awt.geom.Rectangle2D;
+-import java.awt.geom.Point2D;
+-import java.awt.Point;
+-import java.awt.Rectangle;
+ import java.security.AccessController;
+ import java.security.PrivilegedAction;
+ import java.util.Hashtable;
++import java.util.Set;
+ import java.util.Vector;
+
++import sun.awt.image.ByteComponentRaster;
+ import sun.awt.image.BytePackedRaster;
+-import sun.awt.image.ShortComponentRaster;
+-import sun.awt.image.ByteComponentRaster;
+ import sun.awt.image.IntegerComponentRaster;
+ import sun.awt.image.OffScreenImageSource;
++import sun.awt.image.ShortComponentRaster;
+
+ /**
+ *
+@@ -68,18 +65,14 @@
+ * @see Raster
+ * @see WritableRaster
+ */
+-
+ public class BufferedImage extends java.awt.Image
+ implements WritableRenderedImage, Transparency
+ {
+- int imageType = TYPE_CUSTOM;
+- ColorModel colorModel;
+- WritableRaster raster;
+- OffScreenImageSource osis;
+- Hashtable properties;
+-
+- boolean isAlphaPremultiplied;// If true, alpha has been premultiplied in
+- // color channels
++ private int imageType = TYPE_CUSTOM;
++ private ColorModel colorModel;
++ private final WritableRaster raster;
++ private OffScreenImageSource osis;
++ private Hashtable<String, Object> properties;
+
+ /**
+ * Image Type Constants
+@@ -328,8 +321,8 @@
+ 0x000000ff, // Blue
+ 0x0 // Alpha
+ );
+- raster = colorModel.createCompatibleWritableRaster(width,
+- height);
++ raster = colorModel.createCompatibleWritableRaster(width,
++ height);
+ }
+ break;
+
+@@ -355,9 +348,8 @@
+ true, // Alpha Premultiplied
+ DataBuffer.TYPE_INT
+ );
+-
+- raster = colorModel.createCompatibleWritableRaster(width,
+- height);
++ raster = colorModel.createCompatibleWritableRaster(width,
++ height);
+ }
+ break;
+
+@@ -368,8 +360,8 @@
+ 0x0000ff00, // Green
+ 0x00ff0000 // Blue
+ );
+- raster = colorModel.createCompatibleWritableRaster(width,
+- height);
++ raster = colorModel.createCompatibleWritableRaster(width,
++ height);
+ }
+ break;
+
+@@ -642,7 +634,14 @@
+
+ colorModel = cm;
+ this.raster = raster;
+- this.properties = properties;
++ if (properties != null && !properties.isEmpty()) {
++ this.properties = new Hashtable<>();
++ for (final Object key : properties.keySet()) {
++ if (key instanceof String) {
++ this.properties.put((String) key, properties.get(key));
++ }
++ }
++ }
+ int numBands = raster.getNumBands();
+ boolean isAlphaPre = cm.isAlphaPremultiplied();
+ final boolean isStandard = isStandard(cm, raster);
+@@ -1272,7 +1271,11 @@
+ * or <code>null</code> if no property names are recognized.
+ */
+ public String[] getPropertyNames() {
+- return null;
++ if (properties == null || properties.isEmpty()) {
++ return null;
++ }
++ final Set<String> keys = properties.keySet();
++ return keys.toArray(new String[keys.size()]);
+ }
+
+ /**
+--- ./jdk/src/share/classes/java/beans/package.html Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/beans/package.html Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ <!--
+- Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 1998, 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
+@@ -147,8 +147,8 @@
+
+ For overview, architecture, and tutorial documentation, please see:
+ <ul>
+- <li><a href="http://java.sun.com/docs/books/tutorial/javabeans/">JavaBeans</a>, a trail in <em>The Java Tutorial</em>.
+- <li><a href="http://java.sun.com/products/jfc/tsc/articles/persistence2/">Long-Term Persistence</a>, an article in <em>The Swing Connection</em>.
++ <li><a href="http://docs.oracle.com/javase/tutorial/javabeans/">JavaBeans</a>, a trail in <em>The Java Tutorial</em>.
++ <li><a href="http://www.oracle.com/technetwork/java/persistence2-141443.html">Long-Term Persistence</a>, an article in <em>The Swing Connection</em>.
+ </ul>
+ <p>
+
+--- ./jdk/src/share/classes/java/io/ObjectInputStream.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/io/ObjectInputStream.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1829,8 +1829,6 @@
+ throws IOException
+ {
+ SerialCallbackContext oldContext = curContext;
+- if (oldContext != null)
+- oldContext.check();
+ curContext = null;
+ try {
+ boolean blocked = desc.hasBlockExternalData();
+@@ -1855,8 +1853,6 @@
+ skipCustomData();
+ }
+ } finally {
+- if (oldContext != null)
+- oldContext.check();
+ curContext = oldContext;
+ }
+ /*
+@@ -1887,12 +1883,12 @@
+ ObjectStreamClass slotDesc = slots[i].desc;
+
+ if (slots[i].hasData) {
+- if (obj == null || handles.lookupException(passHandle) != null) {
+- defaultReadFields(null, slotDesc); // skip field values
+- } else if (slotDesc.hasReadObjectMethod()) {
++ if (obj != null &&
++ slotDesc.hasReadObjectMethod() &&
++ handles.lookupException(passHandle) == null)
++ {
+ SerialCallbackContext oldContext = curContext;
+- if (oldContext != null)
+- oldContext.check();
++
+ try {
+ curContext = new SerialCallbackContext(obj, slotDesc);
+
+@@ -1909,8 +1905,6 @@
+ handles.markException(passHandle, ex);
+ } finally {
+ curContext.setUsed();
+- if (oldContext!= null)
+- oldContext.check();
+ curContext = oldContext;
+ }
+
+@@ -1923,7 +1917,6 @@
+ } else {
+ defaultReadFields(obj, slotDesc);
+ }
+-
+ if (slotDesc.hasWriteObjectData()) {
+ skipCustomData();
+ } else {
+--- ./jdk/src/share/classes/java/io/SerialCallbackContext.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/io/SerialCallbackContext.java Wed Jul 01 21:53:30 2015 -0700
+@@ -60,13 +60,6 @@
+ return desc;
+ }
+
+- public void check() throws NotActiveException {
+- if (thread != null && thread != Thread.currentThread()) {
+- throw new NotActiveException(
+- "expected thread: " + thread + ", but got: " + Thread.currentThread());
+- }
+- }
+-
+ private void checkAndSetUsed() throws NotActiveException {
+ if (thread != Thread.currentThread()) {
+ throw new NotActiveException(
+--- ./jdk/src/share/classes/java/lang/ClassLoader.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/ClassLoader.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -1724,7 +1724,6 @@
+
+ native long find(String name);
+ native void unload(String name, boolean isBuiltin);
+- static native String findBuiltinLib(String name);
+
+ public NativeLibrary(Class<?> fromClass, String name, boolean isBuiltin) {
+ this.name = name;
+@@ -1865,9 +1864,11 @@
+ throw new UnsatisfiedLinkError("no " + name + " in java.library.path");
+ }
+
++ private static native String findBuiltinLib(String name);
++
+ private static boolean loadLibrary0(Class<?> fromClass, final File file) {
+ // Check to see if we're attempting to access a static library
+- String name = NativeLibrary.findBuiltinLib(file.getName());
++ String name = findBuiltinLib(file.getName());
+ boolean isBuiltin = (name != null);
+ if (!isBuiltin) {
+ boolean exists = AccessController.doPrivileged(
+--- ./jdk/src/share/classes/java/lang/Object.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/Object.java Wed Jul 01 21:53:30 2015 -0700
+@@ -453,7 +453,7 @@
+ "nanosecond timeout value out of range");
+ }
+
+- if (nanos >= 500000 || (nanos != 0 && timeout == 0)) {
++ if (nanos > 0) {
+ timeout++;
+ }
+
+--- ./jdk/src/share/classes/java/lang/String.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/String.java Wed Jul 01 21:53:30 2015 -0700
+@@ -135,7 +135,7 @@
+ * unnecessary since Strings are immutable.
+ */
+ public String() {
+- this.value = new char[0];
++ this.value = "".value;
+ }
+
+ /**
+@@ -191,8 +191,14 @@
+ if (offset < 0) {
+ throw new StringIndexOutOfBoundsException(offset);
+ }
+- if (count < 0) {
+- throw new StringIndexOutOfBoundsException(count);
++ if (count <= 0) {
++ if (count < 0) {
++ throw new StringIndexOutOfBoundsException(count);
++ }
++ if (offset <= value.length) {
++ this.value = "".value;
++ return;
++ }
+ }
+ // Note: offset or count might be near -1>>>1.
+ if (offset > value.length - count) {
+@@ -233,8 +239,14 @@
+ if (offset < 0) {
+ throw new StringIndexOutOfBoundsException(offset);
+ }
+- if (count < 0) {
+- throw new StringIndexOutOfBoundsException(count);
++ if (count <= 0) {
++ if (count < 0) {
++ throw new StringIndexOutOfBoundsException(count);
++ }
++ if (offset <= codePoints.length) {
++ this.value = "".value;
++ return;
++ }
+ }
+ // Note: offset or count might be near -1>>>1.
+ if (offset > codePoints.length - count) {
+@@ -782,7 +794,7 @@
+ * subarray of {@code dst} starting at index {@code dstBegin}
+ * and ending at index:
+ * <blockquote><pre>
+- * dstbegin + (srcEnd-srcBegin) - 1
++ * dstBegin + (srcEnd-srcBegin) - 1
+ * </pre></blockquote>
+ *
+ * @param srcBegin index of the first character in the string
+@@ -827,7 +839,7 @@
+ * dst} starting at index {@code dstBegin} and ending at index:
+ *
+ * <blockquote><pre>
+- * dstbegin + (srcEnd-srcBegin) - 1
++ * dstBegin + (srcEnd-srcBegin) - 1
+ * </pre></blockquote>
+ *
+ * @deprecated This method does not properly convert characters into
+--- ./jdk/src/share/classes/java/lang/invoke/DirectMethodHandle.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/DirectMethodHandle.java Wed Jul 01 21:53:30 2015 -0700
+@@ -31,7 +31,6 @@
+ import sun.invoke.util.VerifyAccess;
+ import static java.lang.invoke.MethodHandleNatives.Constants.*;
+ import static java.lang.invoke.LambdaForm.*;
+-import static java.lang.invoke.LambdaForm.BasicType.*;
+ import static java.lang.invoke.MethodTypeForm.*;
+ import static java.lang.invoke.MethodHandleStatics.*;
+ import java.lang.ref.WeakReference;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/java/lang/invoke/InjectedProfile.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,37 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package java.lang.invoke;
++
++import java.lang.annotation.*;
++
++/**
++ * Internal marker for some methods in the JSR 292 implementation.
++ */
++/*non-public*/
++@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
++@Retention(RetentionPolicy.RUNTIME)
++@interface InjectedProfile {
++}
+--- ./jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java Wed Jul 01 21:53:30 2015 -0700
+@@ -285,6 +285,7 @@
+ // Forward the SAM method
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, samMethodName,
+ samMethodType.toMethodDescriptorString(), null, null);
++ mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
+ new ForwardingMethodGenerator(mv).generate(samMethodType);
+
+ // Forward the bridges
+@@ -292,6 +293,7 @@
+ for (MethodType mt : additionalBridges) {
+ mv = cw.visitMethod(ACC_PUBLIC|ACC_BRIDGE, samMethodName,
+ mt.toMethodDescriptorString(), null, null);
++ mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
+ new ForwardingMethodGenerator(mv).generate(mt);
+ }
+ }
+--- ./jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -56,9 +56,11 @@
+ private static final String OBJ = "java/lang/Object";
+ private static final String OBJARY = "[Ljava/lang/Object;";
+
++ private static final String MH_SIG = "L" + MH + ";";
+ private static final String LF_SIG = "L" + LF + ";";
+ private static final String LFN_SIG = "L" + LFN + ";";
+ private static final String LL_SIG = "(L" + OBJ + ";)L" + OBJ + ";";
++ private static final String LLV_SIG = "(L" + OBJ + ";L" + OBJ + ";)V";
+ private static final String CLL_SIG = "(L" + CLS + ";L" + OBJ + ";)L" + OBJ + ";";
+
+ /** Name of its super class*/
+@@ -616,6 +618,15 @@
+ return g.loadMethod(g.generateCustomizedCodeBytes());
+ }
+
++ /** Generates code to check that actual receiver and LambdaForm matches */
++ private boolean checkActualReceiver() {
++ // Expects MethodHandle on the stack and actual receiver MethodHandle in slot #0
++ mv.visitInsn(Opcodes.DUP);
++ mv.visitVarInsn(Opcodes.ALOAD, localsMap[0]);
++ mv.visitMethodInsn(Opcodes.INVOKESTATIC, MHI, "assertSame", LLV_SIG, false);
++ return true;
++ }
++
+ /**
+ * Generate an invoker method for the passed {@link LambdaForm}.
+ */
+@@ -635,6 +646,16 @@
+ mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
+ }
+
++ if (lambdaForm.customized != null) {
++ // Since LambdaForm is customized for a particular MethodHandle, it's safe to substitute
++ // receiver MethodHandle (at slot #0) with an embedded constant and use it instead.
++ // It enables more efficient code generation in some situations, since embedded constants
++ // are compile-time constants for JIT compiler.
++ mv.visitLdcInsn(constantPlaceholder(lambdaForm.customized));
++ mv.visitTypeInsn(Opcodes.CHECKCAST, MH);
++ assert(checkActualReceiver()); // expects MethodHandle on top of the stack
++ mv.visitVarInsn(Opcodes.ASTORE, localsMap[0]);
++ }
+
+ // iterate over the form's names, generating bytecode instructions for each
+ // start iterating at the first name following the arguments
+@@ -648,6 +669,11 @@
+ switch (intr) {
+ case SELECT_ALTERNATIVE:
+ assert isSelectAlternative(i);
++ if (PROFILE_GWT) {
++ assert(name.arguments[0] instanceof Name &&
++ nameRefersTo((Name)name.arguments[0], MethodHandleImpl.class, "profileBoolean"));
++ mv.visitAnnotation("Ljava/lang/invoke/InjectedProfile;", true);
++ }
+ onStack = emitSelectAlternative(name, lambdaForm.names[i+1]);
+ i++; // skip MH.invokeBasic of the selectAlternative result
+ continue;
+--- ./jdk/src/share/classes/java/lang/invoke/Invokers.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/Invokers.java Wed Jul 01 21:53:30 2015 -0700
+@@ -247,6 +247,7 @@
+ int nameCursor = OUTARG_LIMIT;
+ final int MTYPE_ARG = customized ? -1 : nameCursor++; // might be last in-argument
+ final int CHECK_TYPE = nameCursor++;
++ final int CHECK_CUSTOM = (CUSTOMIZE_THRESHOLD >= 0) ? nameCursor++ : -1;
+ final int LINKER_CALL = nameCursor++;
+ MethodType invokerFormType = mtype.invokerType();
+ if (isLinker) {
+@@ -279,6 +280,9 @@
+ // mh.invokeGeneric(a*):R => checkGenericType(mh, TYPEOF(a*:R)).invokeBasic(a*)
+ outArgs[0] = names[CHECK_TYPE];
+ }
++ if (CHECK_CUSTOM != -1) {
++ names[CHECK_CUSTOM] = new Name(NF_checkCustomized, outArgs[0]);
++ }
+ names[LINKER_CALL] = new Name(outCallType, outArgs);
+ lform = new LambdaForm(debugName, INARG_LIMIT, names);
+ if (isLinker)
+@@ -386,11 +390,32 @@
+ return ((CallSite)site).getTarget();
+ }
+
++ /*non-public*/ static
++ @ForceInline
++ void checkCustomized(Object o) {
++ MethodHandle mh = (MethodHandle)o;
++ if (mh.form.customized == null) {
++ maybeCustomize(mh);
++ }
++ }
++
++ /*non-public*/ static
++ @DontInline
++ void maybeCustomize(MethodHandle mh) {
++ byte count = mh.customizationCount;
++ if (count >= CUSTOMIZE_THRESHOLD) {
++ mh.customize();
++ } else {
++ mh.customizationCount = (byte)(count+1);
++ }
++ }
++
+ // Local constant functions:
+ private static final NamedFunction
+ NF_checkExactType,
+ NF_checkGenericType,
+- NF_getCallSiteTarget;
++ NF_getCallSiteTarget,
++ NF_checkCustomized;
+ static {
+ try {
+ NamedFunction nfs[] = {
+@@ -399,7 +424,9 @@
+ NF_checkGenericType = new NamedFunction(Invokers.class
+ .getDeclaredMethod("checkGenericType", Object.class, Object.class)),
+ NF_getCallSiteTarget = new NamedFunction(Invokers.class
+- .getDeclaredMethod("getCallSiteTarget", Object.class))
++ .getDeclaredMethod("getCallSiteTarget", Object.class)),
++ NF_checkCustomized = new NamedFunction(Invokers.class
++ .getDeclaredMethod("checkCustomized", Object.class))
+ };
+ for (NamedFunction nf : nfs) {
+ // Each nf must be statically invocable or we get tied up in our bootstraps.
+--- ./jdk/src/share/classes/java/lang/invoke/LambdaForm.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/LambdaForm.java Wed Jul 01 21:53:30 2015 -0700
+@@ -120,12 +120,14 @@
+ final int arity;
+ final int result;
+ final boolean forceInline;
++ final MethodHandle customized;
+ @Stable final Name[] names;
+ final String debugName;
+ MemberName vmentry; // low-level behavior, or null if not yet prepared
+ private boolean isCompiled;
+
+- volatile Object transformCache; // managed by LambdaFormEditor
++ // Either a LambdaForm cache (managed by LambdaFormEditor) or a link to uncustomized version (for customized LF)
++ volatile Object transformCache;
+
+ public static final int VOID_RESULT = -1, LAST_RESULT = -2;
+
+@@ -244,16 +246,17 @@
+
+ LambdaForm(String debugName,
+ int arity, Name[] names, int result) {
+- this(debugName, arity, names, result, true);
++ this(debugName, arity, names, result, /*forceInline=*/true, /*customized=*/null);
+ }
+ LambdaForm(String debugName,
+- int arity, Name[] names, int result, boolean forceInline) {
++ int arity, Name[] names, int result, boolean forceInline, MethodHandle customized) {
+ assert(namesOK(arity, names));
+ this.arity = arity;
+ this.result = fixResult(result, names);
+ this.names = names.clone();
+ this.debugName = fixDebugName(debugName);
+ this.forceInline = forceInline;
++ this.customized = customized;
+ int maxOutArity = normalize();
+ if (maxOutArity > MethodType.MAX_MH_INVOKER_ARITY) {
+ // Cannot use LF interpreter on very high arity expressions.
+@@ -263,21 +266,21 @@
+ }
+ LambdaForm(String debugName,
+ int arity, Name[] names) {
+- this(debugName, arity, names, LAST_RESULT, true);
++ this(debugName, arity, names, LAST_RESULT, /*forceInline=*/true, /*customized=*/null);
+ }
+ LambdaForm(String debugName,
+ int arity, Name[] names, boolean forceInline) {
+- this(debugName, arity, names, LAST_RESULT, forceInline);
++ this(debugName, arity, names, LAST_RESULT, forceInline, /*customized=*/null);
+ }
+ LambdaForm(String debugName,
+ Name[] formals, Name[] temps, Name result) {
+ this(debugName,
+- formals.length, buildNames(formals, temps, result), LAST_RESULT, true);
++ formals.length, buildNames(formals, temps, result), LAST_RESULT, /*forceInline=*/true, /*customized=*/null);
+ }
+ LambdaForm(String debugName,
+ Name[] formals, Name[] temps, Name result, boolean forceInline) {
+ this(debugName,
+- formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline);
++ formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline, /*customized=*/null);
+ }
+
+ private static Name[] buildNames(Name[] formals, Name[] temps, Name result) {
+@@ -291,10 +294,6 @@
+ }
+
+ private LambdaForm(String sig) {
+- this(sig, true);
+- }
+-
+- private LambdaForm(String sig, boolean forceInline) {
+ // Make a blank lambda form, which returns a constant zero or null.
+ // It is used as a template for managing the invocation of similar forms that are non-empty.
+ // Called only from getPreparedForm.
+@@ -303,7 +302,8 @@
+ this.result = (signatureReturn(sig) == V_TYPE ? -1 : arity);
+ this.names = buildEmptyNames(arity, sig);
+ this.debugName = "LF.zero";
+- this.forceInline = forceInline;
++ this.forceInline = true;
++ this.customized = null;
+ assert(nameRefsAreLegal());
+ assert(isEmpty());
+ assert(sig.equals(basicTypeSignature())) : sig + " != " + basicTypeSignature();
+@@ -375,6 +375,31 @@
+ return true;
+ }
+
++ /** Customize LambdaForm for a particular MethodHandle */
++ LambdaForm customize(MethodHandle mh) {
++ LambdaForm customForm = new LambdaForm(debugName, arity, names, result, forceInline, mh);
++ if (COMPILE_THRESHOLD > 0 && isCompiled) {
++ // If shared LambdaForm has been compiled, compile customized version as well.
++ customForm.compileToBytecode();
++ }
++ customForm.transformCache = this; // LambdaFormEditor should always use uncustomized form.
++ return customForm;
++ }
++
++ /** Get uncustomized flavor of the LambdaForm */
++ LambdaForm uncustomize() {
++ if (customized == null) {
++ return this;
++ }
++ assert(transformCache != null); // Customized LambdaForm should always has a link to uncustomized version.
++ LambdaForm uncustomizedForm = (LambdaForm)transformCache;
++ if (COMPILE_THRESHOLD > 0 && isCompiled) {
++ // If customized LambdaForm has been compiled, compile uncustomized version as well.
++ uncustomizedForm.compileToBytecode();
++ }
++ return uncustomizedForm;
++ }
++
+ /** Renumber and/or replace params so that they are interned and canonically numbered.
+ * @return maximum argument list length among the names (since we have to pass over them anyway)
+ */
+@@ -417,8 +442,8 @@
+ for (int i = arity; i < names.length; i++) {
+ names[i].internArguments();
+ }
+- assert(nameRefsAreLegal());
+ }
++ assert(nameRefsAreLegal());
+ return maxOutArity;
+ }
+
+@@ -606,7 +631,7 @@
+ * as a sort of pre-invocation linkage step.)
+ */
+ public void prepare() {
+- if (COMPILE_THRESHOLD == 0) {
++ if (COMPILE_THRESHOLD == 0 && !isCompiled) {
+ compileToBytecode();
+ }
+ if (this.vmentry != null) {
+@@ -620,11 +645,11 @@
+
+ /** Generate optimizable bytecode for this form. */
+ MemberName compileToBytecode() {
+- MethodType invokerType = methodType();
+- assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
+ if (vmentry != null && isCompiled) {
+ return vmentry; // already compiled somehow
+ }
++ MethodType invokerType = methodType();
++ assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
+ try {
+ vmentry = InvokerBytecodeGenerator.generateCustomizedCode(this, invokerType);
+ if (TRACE_INTERPRETER)
+--- ./jdk/src/share/classes/java/lang/invoke/LambdaFormEditor.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/LambdaFormEditor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -51,7 +51,10 @@
+ static LambdaFormEditor lambdaFormEditor(LambdaForm lambdaForm) {
+ // TO DO: Consider placing intern logic here, to cut down on duplication.
+ // lambdaForm = findPreexistingEquivalent(lambdaForm)
+- return new LambdaFormEditor(lambdaForm);
++
++ // Always use uncustomized version for editing.
++ // It helps caching and customized LambdaForms reuse transformCache field to keep a link to uncustomized version.
++ return new LambdaFormEditor(lambdaForm.uncustomize());
+ }
+
+ /** A description of a cached transform, possibly associated with the result of the transform.
+--- ./jdk/src/share/classes/java/lang/invoke/MethodHandle.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/MethodHandle.java Wed Jul 01 21:53:30 2015 -0700
+@@ -434,6 +434,8 @@
+ // form is not private so that invokers can easily fetch it
+ /*private*/ MethodHandle asTypeCache;
+ // asTypeCache is not private so that invokers can easily fetch it
++ /*non-public*/ byte customizationCount;
++ // customizationCount should be accessible from invokers
+
+ /**
+ * Reports the type of this method handle.
+@@ -454,9 +456,9 @@
+ type.getClass(); // explicit NPE
+ form.getClass(); // explicit NPE
+ this.type = type;
+- this.form = form;
++ this.form = form.uncustomize();
+
+- form.prepare(); // TO DO: Try to delay this step until just before invocation.
++ this.form.prepare(); // TO DO: Try to delay this step until just before invocation.
+ }
+
+ /**
+@@ -1425,12 +1427,24 @@
+ */
+ /*non-public*/
+ void updateForm(LambdaForm newForm) {
++ assert(newForm.customized == null || newForm.customized == this);
+ if (form == newForm) return;
+ newForm.prepare(); // as in MethodHandle.<init>
+ UNSAFE.putObject(this, FORM_OFFSET, newForm);
+ UNSAFE.fullFence();
+ }
+
++ /** Craft a LambdaForm customized for this particular MethodHandle */
++ /*non-public*/
++ void customize() {
++ if (form.customized == null) {
++ LambdaForm newForm = form.customize(this);
++ updateForm(newForm);
++ } else {
++ assert(form.customized == this);
++ }
++ }
++
+ private static final long FORM_OFFSET;
+ static {
+ try {
+--- ./jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -597,6 +597,7 @@
+ static final NamedFunction NF_checkSpreadArgument;
+ static final NamedFunction NF_guardWithCatch;
+ static final NamedFunction NF_throwException;
++ static final NamedFunction NF_profileBoolean;
+
+ static final MethodHandle MH_castReference;
+ static final MethodHandle MH_selectAlternative;
+@@ -614,10 +615,12 @@
+ NF_guardWithCatch = new NamedFunction(MHI.getDeclaredMethod("guardWithCatch", MethodHandle.class, Class.class,
+ MethodHandle.class, Object[].class));
+ NF_throwException = new NamedFunction(MHI.getDeclaredMethod("throwException", Throwable.class));
++ NF_profileBoolean = new NamedFunction(MHI.getDeclaredMethod("profileBoolean", boolean.class, int[].class));
+
+ NF_checkSpreadArgument.resolve();
+ NF_guardWithCatch.resolve();
+ NF_throwException.resolve();
++ NF_profileBoolean.resolve();
+
+ MH_castReference = IMPL_LOOKUP.findStatic(MHI, "castReference",
+ MethodType.methodType(Object.class, Class.class, Object.class));
+@@ -697,7 +700,26 @@
+ @LambdaForm.Hidden
+ static
+ MethodHandle selectAlternative(boolean testResult, MethodHandle target, MethodHandle fallback) {
+- return testResult ? target : fallback;
++ if (testResult) {
++ return target;
++ } else {
++ return fallback;
++ }
++ }
++
++ // Intrinsified by C2. Counters are used during parsing to calculate branch frequencies.
++ @LambdaForm.Hidden
++ static
++ boolean profileBoolean(boolean result, int[] counters) {
++ // Profile is int[2] where [0] and [1] correspond to false and true occurrences respectively.
++ int idx = result ? 1 : 0;
++ try {
++ counters[idx] = Math.addExact(counters[idx], 1);
++ } catch (ArithmeticException e) {
++ // Avoid continuous overflow by halving the problematic count.
++ counters[idx] = counters[idx] / 2;
++ }
++ return result;
+ }
+
+ static
+@@ -708,13 +730,18 @@
+ assert(test.type().equals(type.changeReturnType(boolean.class)) && fallback.type().equals(type));
+ MethodType basicType = type.basicType();
+ LambdaForm form = makeGuardWithTestForm(basicType);
+- BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
+ BoundMethodHandle mh;
+-
+ try {
+- mh = (BoundMethodHandle)
+- data.constructor().invokeBasic(type, form,
+- (Object) test, (Object) profile(target), (Object) profile(fallback));
++ if (PROFILE_GWT) {
++ int[] counts = new int[2];
++ mh = (BoundMethodHandle)
++ BoundMethodHandle.speciesData_LLLL().constructor().invokeBasic(type, form,
++ (Object) test, (Object) profile(target), (Object) profile(fallback), counts);
++ } else {
++ mh = (BoundMethodHandle)
++ BoundMethodHandle.speciesData_LLL().constructor().invokeBasic(type, form,
++ (Object) test, (Object) profile(target), (Object) profile(fallback));
++ }
+ } catch (Throwable ex) {
+ throw uncaughtException(ex);
+ }
+@@ -800,7 +827,7 @@
+ MethodHandle wrapper;
+ if (isCounting) {
+ LambdaForm lform;
+- lform = countingFormProducer.apply(target);
++ lform = countingFormProducer.apply(newTarget);
+ wrapper = new CountingWrapper(newTarget, lform, countingFormProducer, nonCountingFormProducer, DONT_INLINE_THRESHOLD);
+ } else {
+ wrapper = newTarget; // no need for a counting wrapper anymore
+@@ -856,7 +883,10 @@
+ final int GET_TEST = nameCursor++;
+ final int GET_TARGET = nameCursor++;
+ final int GET_FALLBACK = nameCursor++;
++ final int GET_COUNTERS = PROFILE_GWT ? nameCursor++ : -1;
+ final int CALL_TEST = nameCursor++;
++ final int PROFILE = (GET_COUNTERS != -1) ? nameCursor++ : -1;
++ final int TEST = nameCursor-1; // previous statement: either PROFILE or CALL_TEST
+ final int SELECT_ALT = nameCursor++;
+ final int CALL_TARGET = nameCursor++;
+ assert(CALL_TARGET == SELECT_ALT+1); // must be true to trigger IBG.emitSelectAlternative
+@@ -864,12 +894,16 @@
+ MethodType lambdaType = basicType.invokerType();
+ Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType);
+
+- BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
++ BoundMethodHandle.SpeciesData data =
++ (GET_COUNTERS != -1) ? BoundMethodHandle.speciesData_LLLL()
++ : BoundMethodHandle.speciesData_LLL();
+ names[THIS_MH] = names[THIS_MH].withConstraint(data);
+ names[GET_TEST] = new Name(data.getterFunction(0), names[THIS_MH]);
+ names[GET_TARGET] = new Name(data.getterFunction(1), names[THIS_MH]);
+ names[GET_FALLBACK] = new Name(data.getterFunction(2), names[THIS_MH]);
+-
++ if (GET_COUNTERS != -1) {
++ names[GET_COUNTERS] = new Name(data.getterFunction(3), names[THIS_MH]);
++ }
+ Object[] invokeArgs = Arrays.copyOfRange(names, 0, ARG_LIMIT, Object[].class);
+
+ // call test
+@@ -877,15 +911,18 @@
+ invokeArgs[0] = names[GET_TEST];
+ names[CALL_TEST] = new Name(testType, invokeArgs);
+
++ // profile branch
++ if (PROFILE != -1) {
++ names[PROFILE] = new Name(Lazy.NF_profileBoolean, names[CALL_TEST], names[GET_COUNTERS]);
++ }
+ // call selectAlternative
+- names[SELECT_ALT] = new Name(Lazy.MH_selectAlternative, names[CALL_TEST],
+- names[GET_TARGET], names[GET_FALLBACK]);
++ names[SELECT_ALT] = new Name(Lazy.MH_selectAlternative, names[TEST], names[GET_TARGET], names[GET_FALLBACK]);
+
+ // call target or fallback
+ invokeArgs[0] = names[SELECT_ALT];
+ names[CALL_TARGET] = new Name(basicType, invokeArgs);
+
+- lform = new LambdaForm("guard", lambdaType.parameterCount(), names);
++ lform = new LambdaForm("guard", lambdaType.parameterCount(), names, /*forceInline=*/true);
+
+ return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWT, lform);
+ }
+@@ -1615,4 +1652,13 @@
+ assert(elemType.isPrimitive());
+ return Lazy.MH_copyAsPrimitiveArray.bindTo(Wrapper.forPrimitiveType(elemType));
+ }
++
++ /*non-public*/ static void assertSame(Object mh1, Object mh2) {
++ if (mh1 != mh2) {
++ String msg = String.format("mh1 != mh2: mh1 = %s (form: %s); mh2 = %s (form: %s)",
++ mh1, ((MethodHandle)mh1).form,
++ mh2, ((MethodHandle)mh2).form);
++ throw newInternalError(msg);
++ }
++ }
+ }
+--- ./jdk/src/share/classes/java/lang/invoke/MethodHandleStatics.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/lang/invoke/MethodHandleStatics.java Wed Jul 01 21:53:30 2015 -0700
+@@ -48,9 +48,11 @@
+ static final int COMPILE_THRESHOLD;
+ static final int DONT_INLINE_THRESHOLD;
+ static final int PROFILE_LEVEL;
++ static final boolean PROFILE_GWT;
++ static final int CUSTOMIZE_THRESHOLD;
+
+ static {
+- final Object[] values = new Object[7];
++ final Object[] values = new Object[9];
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
+ values[0] = Boolean.getBoolean("java.lang.invoke.MethodHandle.DEBUG_NAMES");
+@@ -60,6 +62,8 @@
+ values[4] = Integer.getInteger("java.lang.invoke.MethodHandle.COMPILE_THRESHOLD", 0);
+ values[5] = Integer.getInteger("java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD", 30);
+ values[6] = Integer.getInteger("java.lang.invoke.MethodHandle.PROFILE_LEVEL", 0);
++ values[7] = Boolean.parseBoolean(System.getProperty("java.lang.invoke.MethodHandle.PROFILE_GWT", "true"));
++ values[8] = Integer.getInteger("java.lang.invoke.MethodHandle.CUSTOMIZE_THRESHOLD", 127);
+ return null;
+ }
+ });
+@@ -70,6 +74,12 @@
+ COMPILE_THRESHOLD = (Integer) values[4];
+ DONT_INLINE_THRESHOLD = (Integer) values[5];
+ PROFILE_LEVEL = (Integer) values[6];
++ PROFILE_GWT = (Boolean) values[7];
++ CUSTOMIZE_THRESHOLD = (Integer) values[8];
++
++ if (CUSTOMIZE_THRESHOLD < -1 || CUSTOMIZE_THRESHOLD > 127) {
++ throw newInternalError("CUSTOMIZE_THRESHOLD should be in [-1...127] range");
++ }
+ }
+
+ /** Tell if any of the debugging switches are turned on.
+--- ./jdk/src/share/classes/java/math/BigDecimal.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/math/BigDecimal.java Wed Jul 01 21:53:30 2015 -0700
+@@ -4801,41 +4801,61 @@
+ if (dividendHi >= divisor) {
+ return null;
+ }
++
+ final int shift = Long.numberOfLeadingZeros(divisor);
+ divisor <<= shift;
+
+ final long v1 = divisor >>> 32;
+ final long v0 = divisor & LONG_MASK;
+
+- long q1, q0;
+- long r_tmp;
+-
+ long tmp = dividendLo << shift;
+ long u1 = tmp >>> 32;
+ long u0 = tmp & LONG_MASK;
+
+ tmp = (dividendHi << shift) | (dividendLo >>> 64 - shift);
+ long u2 = tmp & LONG_MASK;
+- tmp = divWord(tmp,v1);
+- q1 = tmp & LONG_MASK;
+- r_tmp = tmp >>> 32;
++ long q1, r_tmp;
++ if (v1 == 1) {
++ q1 = tmp;
++ r_tmp = 0;
++ } else if (tmp >= 0) {
++ q1 = tmp / v1;
++ r_tmp = tmp - q1 * v1;
++ } else {
++ long[] rq = divRemNegativeLong(tmp, v1);
++ q1 = rq[1];
++ r_tmp = rq[0];
++ }
++
+ while(q1 >= DIV_NUM_BASE || unsignedLongCompare(q1*v0, make64(r_tmp, u1))) {
+ q1--;
+ r_tmp += v1;
+ if (r_tmp >= DIV_NUM_BASE)
+ break;
+ }
++
+ tmp = mulsub(u2,u1,v1,v0,q1);
+ u1 = tmp & LONG_MASK;
+- tmp = divWord(tmp,v1);
+- q0 = tmp & LONG_MASK;
+- r_tmp = tmp >>> 32;
++ long q0;
++ if (v1 == 1) {
++ q0 = tmp;
++ r_tmp = 0;
++ } else if (tmp >= 0) {
++ q0 = tmp / v1;
++ r_tmp = tmp - q0 * v1;
++ } else {
++ long[] rq = divRemNegativeLong(tmp, v1);
++ q0 = rq[1];
++ r_tmp = rq[0];
++ }
++
+ while(q0 >= DIV_NUM_BASE || unsignedLongCompare(q0*v0,make64(r_tmp,u0))) {
+ q0--;
+ r_tmp += v1;
+ if (r_tmp >= DIV_NUM_BASE)
+ break;
+ }
++
+ if((int)q1 < 0) {
+ // result (which is positive and unsigned here)
+ // can't fit into long due to sign bit is used for value
+@@ -4858,10 +4878,13 @@
+ }
+ }
+ }
++
+ long q = make64(q1,q0);
+ q*=sign;
++
+ if (roundingMode == ROUND_DOWN && scale == preferredScale)
+ return valueOf(q, scale);
++
+ long r = mulsub(u1, u0, v1, v0, q0) >>> shift;
+ if (r != 0) {
+ boolean increment = needIncrement(divisor >>> shift, roundingMode, sign, q, r);
+@@ -4904,28 +4927,35 @@
+ }
+ }
+
+- private static long divWord(long n, long dLong) {
+- long r;
+- long q;
+- if (dLong == 1) {
+- q = (int)n;
+- return (q & LONG_MASK);
+- }
++ /**
++ * Calculate the quotient and remainder of dividing a negative long by
++ * another long.
++ *
++ * @param n the numerator; must be negative
++ * @param d the denominator; must not be unity
++ * @return a two-element {@long} array with the remainder and quotient in
++ * the initial and final elements, respectively
++ */
++ private static long[] divRemNegativeLong(long n, long d) {
++ assert n < 0 : "Non-negative numerator " + n;
++ assert d != 1 : "Unity denominator";
++
+ // Approximate the quotient and remainder
+- q = (n >>> 1) / (dLong >>> 1);
+- r = n - q*dLong;
++ long q = (n >>> 1) / (d >>> 1);
++ long r = n - q * d;
+
+ // Correct the approximation
+ while (r < 0) {
+- r += dLong;
++ r += d;
+ q--;
+ }
+- while (r >= dLong) {
+- r -= dLong;
++ while (r >= d) {
++ r -= d;
+ q++;
+ }
+- // n - q*dlong == r && 0 <= r <dLong, hence we're done.
+- return (r << 32) | (q & LONG_MASK);
++
++ // n - q*d == r && 0 <= r < d, hence we're done.
++ return new long[] {r, q};
+ }
+
+ private static long make64(long hi, long lo) {
+--- ./jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -312,11 +312,16 @@
+ ret = socketGetOption(opt, null);
+ return new Integer(ret);
+ case IP_TOS:
+- ret = socketGetOption(opt, null);
+- if (ret == -1) { // ipv6 tos
+- return new Integer(trafficClass);
+- } else {
+- return new Integer(ret);
++ try {
++ ret = socketGetOption(opt, null);
++ if (ret == -1) { // ipv6 tos
++ return trafficClass;
++ } else {
++ return ret;
++ }
++ } catch (SocketException se) {
++ // TODO - should make better effort to read TOS or TCLASS
++ return trafficClass; // ipv6 tos
+ }
+ case SO_KEEPALIVE:
+ ret = socketGetOption(opt, null);
+--- ./jdk/src/share/classes/java/net/DatagramSocket.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/net/DatagramSocket.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1182,7 +1182,14 @@
+
+ if (isClosed())
+ throw new SocketException("Socket is closed");
+- getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc));
++ try {
++ getImpl().setOption(SocketOptions.IP_TOS, tc);
++ } catch (SocketException se) {
++ // not supported if socket already connected
++ // Solaris returns error in such cases
++ if(!isConnected())
++ throw se;
++ }
+ }
+
+ /**
+--- ./jdk/src/share/classes/java/net/InetAddress.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/net/InetAddress.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1995, 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
+@@ -203,33 +203,16 @@
+ static transient boolean preferIPv6Address = false;
+
+ static class InetAddressHolder {
+- /**
+- * Reserve the original application specified hostname.
+- *
+- * The original hostname is useful for domain-based endpoint
+- * identification (see RFC 2818 and RFC 6125). If an address
+- * was created with a raw IP address, a reverse name lookup
+- * may introduce endpoint identification security issue via
+- * DNS forging.
+- *
+- * Oracle JSSE provider is using this original hostname, via
+- * sun.misc.JavaNetAccess, for SSL/TLS endpoint identification.
+- *
+- * Note: May define a new public method in the future if necessary.
+- */
+- private String originalHostName;
+
+ InetAddressHolder() {}
+
+ InetAddressHolder(String hostName, int address, int family) {
+- this.originalHostName = hostName;
+ this.hostName = hostName;
+ this.address = address;
+ this.family = family;
+ }
+
+ void init(String hostName, int family) {
+- this.originalHostName = hostName;
+ this.hostName = hostName;
+ if (family != -1) {
+ this.family = family;
+@@ -242,10 +225,6 @@
+ return hostName;
+ }
+
+- String getOriginalHostName() {
+- return originalHostName;
+- }
+-
+ /**
+ * Holds a 32-bit IPv4 address.
+ */
+--- ./jdk/src/share/classes/java/net/Socket.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/net/Socket.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1378,7 +1378,14 @@
+
+ if (isClosed())
+ throw new SocketException("Socket is closed");
+- getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc));
++ try {
++ getImpl().setOption(SocketOptions.IP_TOS, tc);
++ } catch (SocketException se) {
++ // not supported if socket already connected
++ // Solaris returns error in such cases
++ if(!isConnected())
++ throw se;
++ }
+ }
+
+ /**
+--- ./jdk/src/share/classes/java/net/URLClassLoader.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/net/URLClassLoader.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -774,10 +774,6 @@
+ public URLClassPath getURLClassPath (URLClassLoader u) {
+ return u.ucp;
+ }
+-
+- public String getOriginalHostName(InetAddress ia) {
+- return ia.holder.getOriginalHostName();
+- }
+ }
+ );
+ ClassLoader.registerAsParallelCapable();
+--- ./jdk/src/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * 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,6 @@
+ import java.rmi.Remote;
+ import java.rmi.UnexpectedException;
+ import java.rmi.activation.Activatable;
+-import java.security.PrivilegedAction;
+ import java.util.Map;
+ import java.util.WeakHashMap;
+ import sun.rmi.server.Util;
+@@ -57,25 +56,6 @@
+ {
+ private static final long serialVersionUID = 2L;
+
+- // set to true if invocation handler allows finalize method (legacy behavior)
+- private static final boolean allowFinalizeInvocation;
+-
+- static {
+- String propName = "sun.rmi.server.invocationhandler.allowFinalizeInvocation";
+- String allowProp = java.security.AccessController.doPrivileged(
+- new PrivilegedAction<String>() {
+- @Override
+- public String run() {
+- return System.getProperty(propName);
+- }
+- });
+- if ("".equals(allowProp)) {
+- allowFinalizeInvocation = true;
+- } else {
+- allowFinalizeInvocation = Boolean.parseBoolean(allowProp);
+- }
+- }
+-
+ /**
+ * A weak hash map, mapping classes to weak hash maps that map
+ * method objects to method hashes.
+@@ -164,9 +144,6 @@
+ {
+ if (method.getDeclaringClass() == Object.class) {
+ return invokeObjectMethod(proxy, method, args);
+- } else if ("finalize".equals(method.getName()) && method.getParameterCount() == 0 &&
+- !allowFinalizeInvocation) {
+- return null; // ignore
+ } else {
+ return invokeRemoteMethod(proxy, method, args);
+ }
+--- ./jdk/src/share/classes/java/security/AccessControlContext.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/security/AccessControlContext.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -172,9 +172,24 @@
+ public AccessControlContext(AccessControlContext acc,
+ DomainCombiner combiner) {
+
+- SecurityManager sm = System.getSecurityManager();
+- if (sm != null) {
+- sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
++ this(acc, combiner, false);
++ }
++
++ /**
++ * package private to allow calls from ProtectionDomain without performing
++ * the security check for {@linkplain SecurityConstants.CREATE_ACC_PERMISSION}
++ * permission
++ */
++ AccessControlContext(AccessControlContext acc,
++ DomainCombiner combiner,
++ boolean preauthorized) {
++ if (!preauthorized) {
++ SecurityManager sm = System.getSecurityManager();
++ if (sm != null) {
++ sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
++ this.isAuthorized = true;
++ }
++ } else {
+ this.isAuthorized = true;
+ }
+
+--- ./jdk/src/share/classes/java/security/Identity.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/security/Identity.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -261,7 +261,7 @@
+ certificates.addElement(certificate);
+ }
+
+- private boolean keyEquals(PublicKey aKey, PublicKey anotherKey) {
++ private boolean keyEquals(Key aKey, Key anotherKey) {
+ String aKeyFormat = aKey.getFormat();
+ String anotherKeyFormat = anotherKey.getFormat();
+ if ((aKeyFormat == null) ^ (anotherKeyFormat == null))
+--- ./jdk/src/share/classes/java/security/MessageDigest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/security/MessageDigest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -440,10 +440,6 @@
+ * @return true if the digests are equal, false otherwise.
+ */
+ public static boolean isEqual(byte[] digesta, byte[] digestb) {
+- if (digesta == digestb) return true;
+- if (digesta == null || digestb == null) {
+- return false;
+- }
+ if (digesta.length != digestb.length) {
+ return false;
+ }
+--- ./jdk/src/share/classes/java/security/ProtectionDomain.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/security/ProtectionDomain.java Wed Jul 01 21:53:30 2015 -0700
+@@ -59,35 +59,44 @@
+ */
+
+ public class ProtectionDomain {
++ private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
++
++ private JavaSecurityAccessImpl() {
++ }
++
++ @Override
++ public <T> T doIntersectionPrivilege(
++ PrivilegedAction<T> action,
++ final AccessControlContext stack,
++ final AccessControlContext context) {
++ if (action == null) {
++ throw new NullPointerException();
++ }
++
++ return AccessController.doPrivileged(
++ action,
++ getCombinedACC(context, stack)
++ );
++ }
++
++ @Override
++ public <T> T doIntersectionPrivilege(
++ PrivilegedAction<T> action,
++ AccessControlContext context) {
++ return doIntersectionPrivilege(action,
++ AccessController.getContext(), context);
++ }
++
++ private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack) {
++ AccessControlContext acc = new AccessControlContext(context, stack.getCombiner(), true);
++
++ return new AccessControlContext(stack.getContext(), acc).optimize();
++ }
++ }
+
+ static {
+ // Set up JavaSecurityAccess in SharedSecrets
+- SharedSecrets.setJavaSecurityAccess(
+- new JavaSecurityAccess() {
+- public <T> T doIntersectionPrivilege(
+- PrivilegedAction<T> action,
+- final AccessControlContext stack,
+- final AccessControlContext context)
+- {
+- if (action == null) {
+- throw new NullPointerException();
+- }
+- return AccessController.doPrivileged(
+- action,
+- new AccessControlContext(
+- stack.getContext(), context).optimize()
+- );
+- }
+-
+- public <T> T doIntersectionPrivilege(
+- PrivilegedAction<T> action,
+- AccessControlContext context)
+- {
+- return doIntersectionPrivilege(action,
+- AccessController.getContext(), context);
+- }
+- }
+- );
++ SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
+ }
+
+ /* CodeSource */
+--- ./jdk/src/share/classes/java/security/Signature.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/security/Signature.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -1316,7 +1316,7 @@
+ byte[] out = cipher.doFinal(sigBytes);
+ byte[] dataBytes = data.toByteArray();
+ data.reset();
+- return MessageDigest.isEqual(out, dataBytes);
++ return Arrays.equals(out, dataBytes);
+ } catch (BadPaddingException e) {
+ // e.g. wrong public key used
+ // return false rather than throwing exception
+--- ./jdk/src/share/classes/java/security/cert/X509CRLSelector.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/security/cert/X509CRLSelector.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -679,14 +679,10 @@
+ nowPlusSkew = new Date(dateAndTime.getTime() + skew);
+ nowMinusSkew = new Date(dateAndTime.getTime() - skew);
+ }
+-
+- // Check that the test date is within the validity interval:
+- // [ thisUpdate - MAX_CLOCK_SKEW,
+- // nextUpdate + MAX_CLOCK_SKEW ]
+ if (nowMinusSkew.after(nextUpdate)
+ || nowPlusSkew.before(crlThisUpdate)) {
+ if (debug != null) {
+- debug.println("X509CRLSelector.match: update out-of-range");
++ debug.println("X509CRLSelector.match: update out of range");
+ }
+ return false;
+ }
+--- ./jdk/src/share/classes/java/security/cert/X509CertSelector.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/security/cert/X509CertSelector.java Wed Jul 01 21:53:30 2015 -0700
+@@ -2574,8 +2574,10 @@
+ } else {
+ if (maxPathLen < basicConstraints) {
+ if (debug != null) {
+- debug.println("X509CertSelector.match: maxPathLen too small ("
+- + maxPathLen + " < " + basicConstraints + ")");
++ debug.println("X509CertSelector.match: cert's maxPathLen " +
++ "is less than the min maxPathLen set by " +
++ "basicConstraints. " +
++ "(" + maxPathLen + " < " + basicConstraints + ")");
+ }
+ return false;
+ }
+--- ./jdk/src/share/classes/java/time/DayOfWeek.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/DayOfWeek.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -201,7 +201,7 @@
+ * Gets the day-of-week {@code int} value.
+ * <p>
+ * The values are numbered following the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).
+- * See {@link WeekFields#dayOfWeek} for localized week-numbering.
++ * See {@link java.time.temporal.WeekFields#dayOfWeek()} for localized week-numbering.
+ *
+ * @return the day-of-week, from 1 (Monday) to 7 (Sunday)
+ */
+@@ -288,7 +288,7 @@
+ /**
+ * Gets the value of the specified field from this day-of-week as an {@code int}.
+ * <p>
+- * This queries this day-of-week for the value for the specified field.
++ * This queries this day-of-week for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -321,7 +321,7 @@
+ /**
+ * Gets the value of the specified field from this day-of-week as a {@code long}.
+ * <p>
+- * This queries this day-of-week for the value for the specified field.
++ * This queries this day-of-week for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -419,7 +419,7 @@
+ * The adjustment is equivalent to using {@link Temporal#with(TemporalField, long)}
+ * passing {@link ChronoField#DAY_OF_WEEK} as the field.
+ * Note that this adjusts forwards or backwards within a Monday to Sunday week.
+- * See {@link WeekFields#dayOfWeek} for localized week start days.
++ * See {@link java.time.temporal.WeekFields#dayOfWeek()} for localized week start days.
+ * See {@code TemporalAdjuster} for other adjusters with more control,
+ * such as {@code next(MONDAY)}.
+ * <p>
+--- ./jdk/src/share/classes/java/time/Duration.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/Duration.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -546,7 +546,7 @@
+ * They are returned in the order seconds, nanos.
+ * <p>
+ * This set can be used in conjunction with {@link #get(TemporalUnit)}
+- * to access the entire state of the period.
++ * to access the entire state of the duration.
+ *
+ * @return a list containing the seconds and nanos units, not null
+ */
+@@ -686,8 +686,8 @@
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+- * @param amountToAdd the amount of the period, measured in terms of the unit, positive or negative
+- * @param unit the unit that the period is measured in, must have an exact duration, not null
++ * @param amountToAdd the amount to add, measured in terms of the unit, positive or negative
++ * @param unit the unit that the amount is measured in, must have an exact duration, not null
+ * @return a {@code Duration} based on this duration with the specified duration added, not null
+ * @throws UnsupportedTemporalTypeException if the unit is not supported
+ * @throws ArithmeticException if numeric overflow occurs
+@@ -848,8 +848,8 @@
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+- * @param amountToSubtract the amount of the period, measured in terms of the unit, positive or negative
+- * @param unit the unit that the period is measured in, must have an exact duration, not null
++ * @param amountToSubtract the amount to subtract, measured in terms of the unit, positive or negative
++ * @param unit the unit that the amount is measured in, must have an exact duration, not null
+ * @return a {@code Duration} based on this duration with the specified duration subtracted, not null
+ * @throws ArithmeticException if numeric overflow occurs
+ */
+--- ./jdk/src/share/classes/java/time/Instant.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/Instant.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -530,7 +530,7 @@
+ /**
+ * Gets the value of the specified field from this instant as an {@code int}.
+ * <p>
+- * This queries this instant for the value for the specified field.
++ * This queries this instant for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -571,7 +571,7 @@
+ /**
+ * Gets the value of the specified field from this instant as a {@code long}.
+ * <p>
+- * This queries this instant for the value for the specified field.
++ * This queries this instant for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+--- ./jdk/src/share/classes/java/time/LocalDate.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/LocalDate.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -280,7 +280,7 @@
+ * @param dayOfYear the day-of-year to represent, from 1 to 366
+ * @return the local date, not null
+ * @throws DateTimeException if the value of any field is out of range,
+- * or if the day-of-year is invalid for the month-year
++ * or if the day-of-year is invalid for the year
+ */
+ public static LocalDate ofYearDay(int year, int dayOfYear) {
+ YEAR.checkValidValue(year);
+@@ -308,7 +308,7 @@
+ *
+ * @param epochDay the Epoch Day to convert, based on the epoch 1970-01-01
+ * @return the local date, not null
+- * @throws DateTimeException if the epoch days exceeds the supported date range
++ * @throws DateTimeException if the epoch day exceeds the supported date range
+ */
+ public static LocalDate ofEpochDay(long epochDay) {
+ long zeroDay = epochDay + DAYS_0000_TO_1970;
+@@ -515,7 +515,7 @@
+ /**
+ * Checks if the specified unit is supported.
+ * <p>
+- * This checks if the specified unit can be added to, or subtracted from, this date-time.
++ * This checks if the specified unit can be added to, or subtracted from, this date.
+ * If false, then calling the {@link #plus(long, TemporalUnit)} and
+ * {@link #minus(long, TemporalUnit) minus} methods will throw an exception.
+ * <p>
+@@ -592,7 +592,7 @@
+ /**
+ * Gets the value of the specified field from this date as an {@code int}.
+ * <p>
+- * This queries this date for the value for the specified field.
++ * This queries this date for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -627,7 +627,7 @@
+ /**
+ * Gets the value of the specified field from this date as a {@code long}.
+ * <p>
+- * This queries this date for the value for the specified field.
++ * This queries this date for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -875,7 +875,9 @@
+ * <p>
+ * A simple adjuster might simply set the one of the fields, such as the year field.
+ * A more complex adjuster might set the date to the last day of the month.
+- * A selection of common adjustments is provided in {@link TemporalAdjuster}.
++ * <p>
++ * A selection of common adjustments is provided in
++ * {@link java.time.temporal.TemporalAdjusters TemporalAdjusters}.
+ * These include finding the "last day of the month" and "next Wednesday".
+ * Key date-time classes also implement the {@code TemporalAdjuster} interface,
+ * such as {@link Month} and {@link java.time.MonthDay MonthDay}.
+@@ -885,7 +887,7 @@
+ * For example this code returns a date on the last day of July:
+ * <pre>
+ * import static java.time.Month.*;
+- * import static java.time.temporal.Adjusters.*;
++ * import static java.time.temporal.TemporalAdjusters.*;
+ *
+ * result = localDate.with(JULY).with(lastDayOfMonth());
+ * </pre>
+@@ -1041,7 +1043,8 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this date with the year altered.
++ * Returns a copy of this {@code LocalDate} with the year altered.
++ * <p>
+ * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+@@ -1059,7 +1062,8 @@
+ }
+
+ /**
+- * Returns a copy of this date with the month-of-year altered.
++ * Returns a copy of this {@code LocalDate} with the month-of-year altered.
++ * <p>
+ * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+@@ -1077,7 +1081,8 @@
+ }
+
+ /**
+- * Returns a copy of this date with the day-of-month altered.
++ * Returns a copy of this {@code LocalDate} with the day-of-month altered.
++ * <p>
+ * If the resulting date is invalid, an exception is thrown.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+@@ -1095,7 +1100,8 @@
+ }
+
+ /**
+- * Returns a copy of this date with the day-of-year altered.
++ * Returns a copy of this {@code LocalDate} with the day-of-year altered.
++ * <p>
+ * If the resulting date is invalid, an exception is thrown.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+@@ -1245,7 +1251,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalDate} with the specified period in years added.
++ * Returns a copy of this {@code LocalDate} with the specified number of years added.
+ * <p>
+ * This method adds the specified amount to the years field in three steps:
+ * <ol>
+@@ -1273,7 +1279,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDate} with the specified period in months added.
++ * Returns a copy of this {@code LocalDate} with the specified number of months added.
+ * <p>
+ * This method adds the specified amount to the months field in three steps:
+ * <ol>
+@@ -1304,7 +1310,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDate} with the specified period in weeks added.
++ * Returns a copy of this {@code LocalDate} with the specified number of weeks added.
+ * <p>
+ * This method adds the specified amount in weeks to the days field incrementing
+ * the month and year fields as necessary to ensure the result remains valid.
+@@ -1402,11 +1408,11 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalDate} with the specified period in years subtracted.
++ * Returns a copy of this {@code LocalDate} with the specified number of years subtracted.
+ * <p>
+ * This method subtracts the specified amount from the years field in three steps:
+ * <ol>
+- * <li>Subtract the input years to the year field</li>
++ * <li>Subtract the input years from the year field</li>
+ * <li>Check if the resulting date would be invalid</li>
+ * <li>Adjust the day-of-month to the last valid day if necessary</li>
+ * </ol>
+@@ -1426,11 +1432,11 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDate} with the specified period in months subtracted.
++ * Returns a copy of this {@code LocalDate} with the specified number of months subtracted.
+ * <p>
+ * This method subtracts the specified amount from the months field in three steps:
+ * <ol>
+- * <li>Subtract the input months to the month-of-year field</li>
++ * <li>Subtract the input months from the month-of-year field</li>
+ * <li>Check if the resulting date would be invalid</li>
+ * <li>Adjust the day-of-month to the last valid day if necessary</li>
+ * </ol>
+@@ -1450,7 +1456,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDate} with the specified period in weeks subtracted.
++ * Returns a copy of this {@code LocalDate} with the specified number of weeks subtracted.
+ * <p>
+ * This method subtracts the specified amount in weeks from the days field decrementing
+ * the month and year fields as necessary to ensure the result remains valid.
+--- ./jdk/src/share/classes/java/time/LocalDateTime.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/LocalDateTime.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -428,7 +428,7 @@
+ /**
+ * Obtains an instance of {@code LocalDateTime} from a temporal object.
+ * <p>
+- * This obtains an offset time based on the specified temporal.
++ * This obtains a local date-time based on the specified temporal.
+ * A {@code TemporalAccessor} represents an arbitrary set of date and time information,
+ * which this factory converts to an instance of {@code LocalDateTime}.
+ * <p>
+@@ -656,7 +656,7 @@
+ /**
+ * Gets the value of the specified field from this date-time as an {@code int}.
+ * <p>
+- * This queries this date-time for the value for the specified field.
++ * This queries this date-time for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -693,7 +693,7 @@
+ /**
+ * Gets the value of the specified field from this date-time as a {@code long}.
+ * <p>
+- * This queries this date-time for the value for the specified field.
++ * This queries this date-time for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -878,7 +878,9 @@
+ * <p>
+ * A simple adjuster might simply set the one of the fields, such as the year field.
+ * A more complex adjuster might set the date to the last day of the month.
+- * A selection of common adjustments is provided in {@link TemporalAdjuster}.
++ * <p>
++ * A selection of common adjustments is provided in
++ * {@link java.time.temporal.TemporalAdjusters TemporalAdjusters}.
+ * These include finding the "last day of the month" and "next Wednesday".
+ * Key date-time classes also implement the {@code TemporalAdjuster} interface,
+ * such as {@link Month} and {@link java.time.MonthDay MonthDay}.
+@@ -888,7 +890,7 @@
+ * For example this code returns a date on the last day of July:
+ * <pre>
+ * import static java.time.Month.*;
+- * import static java.time.temporal.Adjusters.*;
++ * import static java.time.temporal.TemporalAdjusters.*;
+ *
+ * result = localDateTime.with(JULY).with(lastDayOfMonth());
+ * </pre>
+@@ -974,6 +976,7 @@
+ //-----------------------------------------------------------------------
+ /**
+ * Returns a copy of this {@code LocalDateTime} with the year altered.
++ * <p>
+ * The time does not affect the calculation and will be the same in the result.
+ * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
+ * <p>
+@@ -989,6 +992,7 @@
+
+ /**
+ * Returns a copy of this {@code LocalDateTime} with the month-of-year altered.
++ * <p>
+ * The time does not affect the calculation and will be the same in the result.
+ * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
+ * <p>
+@@ -1004,7 +1008,8 @@
+
+ /**
+ * Returns a copy of this {@code LocalDateTime} with the day-of-month altered.
+- * If the resulting {@code LocalDateTime} is invalid, an exception is thrown.
++ * <p>
++ * If the resulting date-time is invalid, an exception is thrown.
+ * The time does not affect the calculation and will be the same in the result.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+@@ -1020,7 +1025,8 @@
+
+ /**
+ * Returns a copy of this {@code LocalDateTime} with the day-of-year altered.
+- * If the resulting {@code LocalDateTime} is invalid, an exception is thrown.
++ * <p>
++ * If the resulting date-time is invalid, an exception is thrown.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1035,7 +1041,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the hour-of-day value altered.
++ * Returns a copy of this {@code LocalDateTime} with the hour-of-day altered.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1049,7 +1055,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the minute-of-hour value altered.
++ * Returns a copy of this {@code LocalDateTime} with the minute-of-hour altered.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1063,7 +1069,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the second-of-minute value altered.
++ * Returns a copy of this {@code LocalDateTime} with the second-of-minute altered.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1077,7 +1083,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the nano-of-second value altered.
++ * Returns a copy of this {@code LocalDateTime} with the nano-of-second altered.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1109,7 +1115,7 @@
+ * @param unit the unit to truncate to, not null
+ * @return a {@code LocalDateTime} based on this date-time with the time truncated, not null
+ * @throws DateTimeException if unable to truncate
+- * @throws UnsupportedTemporalTypeException if the field is not supported
++ * @throws UnsupportedTemporalTypeException if the unit is not supported
+ */
+ public LocalDateTime truncatedTo(TemporalUnit unit) {
+ return with(date, time.truncatedTo(unit));
+@@ -1192,7 +1198,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in years added.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of years added.
+ * <p>
+ * This method adds the specified amount to the years field in three steps:
+ * <ol>
+@@ -1217,7 +1223,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in months added.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of months added.
+ * <p>
+ * This method adds the specified amount to the months field in three steps:
+ * <ol>
+@@ -1242,7 +1248,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in weeks added.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of weeks added.
+ * <p>
+ * This method adds the specified amount in weeks to the days field incrementing
+ * the month and year fields as necessary to ensure the result remains valid.
+@@ -1262,7 +1268,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in days added.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of days added.
+ * <p>
+ * This method adds the specified amount to the days field incrementing the
+ * month and year fields as necessary to ensure the result remains valid.
+@@ -1283,7 +1289,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in hours added.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of hours added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1296,7 +1302,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in minutes added.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of minutes added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1309,7 +1315,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in seconds added.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of seconds added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1322,7 +1328,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in nanoseconds added.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of nanoseconds added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1391,7 +1397,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in years subtracted.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of years subtracted.
+ * <p>
+ * This method subtracts the specified amount from the years field in three steps:
+ * <ol>
+@@ -1415,7 +1421,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in months subtracted.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of months subtracted.
+ * <p>
+ * This method subtracts the specified amount from the months field in three steps:
+ * <ol>
+@@ -1439,7 +1445,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in weeks subtracted.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of weeks subtracted.
+ * <p>
+ * This method subtracts the specified amount in weeks from the days field decrementing
+ * the month and year fields as necessary to ensure the result remains valid.
+@@ -1458,9 +1464,9 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in days subtracted.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of days subtracted.
+ * <p>
+- * This method subtracts the specified amount from the days field incrementing the
++ * This method subtracts the specified amount from the days field decrementing the
+ * month and year fields as necessary to ensure the result remains valid.
+ * The result is only invalid if the maximum/minimum year is exceeded.
+ * <p>
+@@ -1478,7 +1484,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in hours subtracted.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of hours subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1491,7 +1497,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in minutes subtracted.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of minutes subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1504,7 +1510,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in seconds subtracted.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of seconds subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1517,7 +1523,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalDateTime} with the specified period in nanoseconds subtracted.
++ * Returns a copy of this {@code LocalDateTime} with the specified number of nanoseconds subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1575,7 +1581,7 @@
+ * what the result of this method will be.
+ * <p>
+ * The result of this method is obtained by invoking the
+- * {@link java.time.temporal.TemporalQuery#queryFrom(TemporalAccessor)} method on the
++ * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the
+ * specified query passing {@code this} as the argument.
+ *
+ * @param <R> the type of the result
+--- ./jdk/src/share/classes/java/time/LocalTime.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/LocalTime.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -93,7 +93,7 @@
+ import java.util.Objects;
+
+ /**
+- * A time without time-zone in the ISO-8601 calendar system,
++ * A time without a time-zone in the ISO-8601 calendar system,
+ * such as {@code 10:15:30}.
+ * <p>
+ * {@code LocalTime} is an immutable date-time object that represents a time,
+@@ -101,7 +101,7 @@
+ * Time is represented to nanosecond precision.
+ * For example, the value "13:45.30.123456789" can be stored in a {@code LocalTime}.
+ * <p>
+- * It does not store or represent a date or time-zone.
++ * This class does not store or represent a date or time-zone.
+ * Instead, it is a description of the local time as seen on a wall clock.
+ * It cannot represent an instant on the time-line without additional information
+ * such as an offset or time-zone.
+@@ -280,7 +280,7 @@
+ return ofNanoOfDay(secsOfDay * NANOS_PER_SECOND + now.getNano());
+ }
+
+- //------------------------get-----------------------------------------------
++ //-----------------------------------------------------------------------
+ /**
+ * Obtains an instance of {@code LocalTime} from an hour and minute.
+ * <p>
+@@ -395,7 +395,7 @@
+ * on extracting the {@link ChronoField#NANO_OF_DAY NANO_OF_DAY} field.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code LocalTime::from}.
++ * allowing it to be used as a query via method reference, {@code LocalTime::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the local time, not null
+@@ -418,7 +418,7 @@
+ * The string must represent a valid time and is parsed using
+ * {@link java.time.format.DateTimeFormatter#ISO_LOCAL_TIME}.
+ *
+- * @param text the text to parse such as "10:15:30", not null
++ * @param text the text to parse such as "10:15:30", not null
+ * @return the parsed local time, not null
+ * @throws DateTimeParseException if the text cannot be parsed
+ */
+@@ -524,7 +524,7 @@
+ /**
+ * Checks if the specified unit is supported.
+ * <p>
+- * This checks if the specified unit can be added to, or subtracted from, this date-time.
++ * This checks if the specified unit can be added to, or subtracted from, this time.
+ * If false, then calling the {@link #plus(long, TemporalUnit)} and
+ * {@link #minus(long, TemporalUnit) minus} methods will throw an exception.
+ * <p>
+@@ -589,7 +589,7 @@
+ /**
+ * Gets the value of the specified field from this time as an {@code int}.
+ * <p>
+- * This queries this time for the value for the specified field.
++ * This queries this time for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -624,7 +624,7 @@
+ /**
+ * Gets the value of the specified field from this time as a {@code long}.
+ * <p>
+- * This queries this time for the value for the specified field.
++ * This queries this time for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -858,7 +858,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalTime} with the hour-of-day value altered.
++ * Returns a copy of this {@code LocalTime} with the hour-of-day altered.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -875,7 +875,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the minute-of-hour value altered.
++ * Returns a copy of this {@code LocalTime} with the minute-of-hour altered.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -892,7 +892,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the second-of-minute value altered.
++ * Returns a copy of this {@code LocalTime} with the second-of-minute altered.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -909,7 +909,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the nano-of-second value altered.
++ * Returns a copy of this {@code LocalTime} with the nano-of-second altered.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -929,7 +929,7 @@
+ /**
+ * Returns a copy of this {@code LocalTime} with the time truncated.
+ * <p>
+- * Truncating the time returns a copy of the original time with fields
++ * Truncation returns a copy of the original time with fields
+ * smaller than the specified unit set to zero.
+ * For example, truncating with the {@link ChronoUnit#MINUTES minutes} unit
+ * will set the second-of-minute and nano-of-second field to zero.
+@@ -1059,7 +1059,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalTime} with the specified period in hours added.
++ * Returns a copy of this {@code LocalTime} with the specified number of hours added.
+ * <p>
+ * This adds the specified number of hours to this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1078,7 +1078,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the specified period in minutes added.
++ * Returns a copy of this {@code LocalTime} with the specified number of minutes added.
+ * <p>
+ * This adds the specified number of minutes to this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1103,7 +1103,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the specified period in seconds added.
++ * Returns a copy of this {@code LocalTime} with the specified number of seconds added.
+ * <p>
+ * This adds the specified number of seconds to this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1130,7 +1130,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the specified period in nanoseconds added.
++ * Returns a copy of this {@code LocalTime} with the specified number of nanoseconds added.
+ * <p>
+ * This adds the specified number of nanoseconds to this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1208,7 +1208,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code LocalTime} with the specified period in hours subtracted.
++ * Returns a copy of this {@code LocalTime} with the specified number of hours subtracted.
+ * <p>
+ * This subtracts the specified number of hours from this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1223,7 +1223,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the specified period in minutes subtracted.
++ * Returns a copy of this {@code LocalTime} with the specified number of minutes subtracted.
+ * <p>
+ * This subtracts the specified number of minutes from this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1238,7 +1238,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the specified period in seconds subtracted.
++ * Returns a copy of this {@code LocalTime} with the specified number of seconds subtracted.
+ * <p>
+ * This subtracts the specified number of seconds from this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1253,7 +1253,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code LocalTime} with the specified period in nanoseconds subtracted.
++ * Returns a copy of this {@code LocalTime} with the specified number of nanoseconds subtracted.
+ * <p>
+ * This subtracts the specified number of nanoseconds from this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1470,7 +1470,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Compares this {@code LocalTime} to another time.
++ * Compares this time to another time.
+ * <p>
+ * The comparison is based on the time-line position of the local times within a day.
+ * It is "consistent with equals", as defined by {@link Comparable}.
+@@ -1495,7 +1495,7 @@
+ }
+
+ /**
+- * Checks if this {@code LocalTime} is after the specified time.
++ * Checks if this time is after the specified time.
+ * <p>
+ * The comparison is based on the time-line position of the time within a day.
+ *
+@@ -1508,7 +1508,7 @@
+ }
+
+ /**
+- * Checks if this {@code LocalTime} is before the specified time.
++ * Checks if this time is before the specified time.
+ * <p>
+ * The comparison is based on the time-line position of the time within a day.
+ *
+--- ./jdk/src/share/classes/java/time/Month.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/Month.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -202,7 +202,7 @@
+ * chronology, or can be converted to a {@code LocalDate}.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code Month::from}.
++ * allowing it to be used as a query via method reference, {@code Month::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the month-of-year, not null
+@@ -315,7 +315,7 @@
+ /**
+ * Gets the value of the specified field from this month-of-year as an {@code int}.
+ * <p>
+- * This queries this month for the value for the specified field.
++ * This queries this month for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -348,7 +348,7 @@
+ /**
+ * Gets the value of the specified field from this month-of-year as a {@code long}.
+ * <p>
+- * This queries this month for the value for the specified field.
++ * This queries this month for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+--- ./jdk/src/share/classes/java/time/MonthDay.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/MonthDay.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -90,8 +90,8 @@
+ * A month-day in the ISO-8601 calendar system, such as {@code --12-03}.
+ * <p>
+ * {@code MonthDay} is an immutable date-time object that represents the combination
+- * of a year and month. Any field that can be derived from a month and day, such as
+- * quarter-of-year, can be obtained.
++ * of a month and day-of-month. Any field that can be derived from a month and day,
++ * such as quarter-of-year, can be obtained.
+ * <p>
+ * This class does not store or represent a year, time or time-zone.
+ * For example, the value "December 3rd" can be stored in a {@code MonthDay}.
+@@ -154,7 +154,7 @@
+ /**
+ * Obtains the current month-day from the system clock in the default time-zone.
+ * <p>
+- * This will query the {@link java.time.Clock#systemDefaultZone() system clock} in the default
++ * This will query the {@link Clock#systemDefaultZone() system clock} in the default
+ * time-zone to obtain the current month-day.
+ * <p>
+ * Using this method will prevent the ability to use an alternate clock for testing
+@@ -169,7 +169,7 @@
+ /**
+ * Obtains the current month-day from the system clock in the specified time-zone.
+ * <p>
+- * This will query the {@link Clock#system(java.time.ZoneId) system clock} to obtain the current month-day.
++ * This will query the {@link Clock#system(ZoneId) system clock} to obtain the current month-day.
+ * Specifying the time-zone avoids dependence on the default time-zone.
+ * <p>
+ * Using this method will prevent the ability to use an alternate clock for testing
+@@ -258,7 +258,7 @@
+ * chronology, or can be converted to a {@code LocalDate}.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code MonthDay::from}.
++ * allowing it to be used as a query via method reference, {@code MonthDay::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the month-day, not null
+@@ -389,7 +389,7 @@
+ /**
+ * Gets the value of the specified field from this month-day as an {@code int}.
+ * <p>
+- * This queries this month-day for the value for the specified field.
++ * This queries this month-day for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -420,7 +420,7 @@
+ /**
+ * Gets the value of the specified field from this month-day as a {@code long}.
+ * <p>
+- * This queries this month-day for the value for the specified field.
++ * This queries this month-day for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -501,7 +501,7 @@
+ * This method checks whether this month and day and the input year form
+ * a valid date. This can only return false for February 29th.
+ *
+- * @param year the year to validate, an out of range value returns false
++ * @param year the year to validate
+ * @return true if the year is valid for this month-day
+ * @see Year#isValidMonthDay(MonthDay)
+ */
+@@ -685,7 +685,7 @@
+ }
+
+ /**
+- * Is this month-day after the specified month-day.
++ * Checks if this month-day is after the specified month-day.
+ *
+ * @param other the other month-day to compare to, not null
+ * @return true if this is after the specified month-day
+@@ -695,7 +695,7 @@
+ }
+
+ /**
+- * Is this month-day before the specified month-day.
++ * Checks if this month-day is before the specified month-day.
+ *
+ * @param other the other month-day to compare to, not null
+ * @return true if this point is before the specified month-day
+--- ./jdk/src/share/classes/java/time/OffsetDateTime.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/OffsetDateTime.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -199,7 +199,7 @@
+ /**
+ * Obtains the current date-time from the system clock in the default time-zone.
+ * <p>
+- * This will query the {@link java.time.Clock#systemDefaultZone() system clock} in the default
++ * This will query the {@link Clock#systemDefaultZone() system clock} in the default
+ * time-zone to obtain the current date-time.
+ * The offset will be calculated from the time-zone in the clock.
+ * <p>
+@@ -215,7 +215,7 @@
+ /**
+ * Obtains the current date-time from the system clock in the specified time-zone.
+ * <p>
+- * This will query the {@link Clock#system(java.time.ZoneId) system clock} to obtain the current date-time.
++ * This will query the {@link Clock#system(ZoneId) system clock} to obtain the current date-time.
+ * Specifying the time-zone avoids dependence on the default time-zone.
+ * The offset will be calculated from the specified time-zone.
+ * <p>
+@@ -345,7 +345,7 @@
+ * those fields that are equivalent to the relevant objects.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code OffsetDateTime::from}.
++ * allowing it to be used as a query via method reference, {@code OffsetDateTime::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the offset date-time, not null
+@@ -567,7 +567,7 @@
+ /**
+ * Gets the value of the specified field from this date-time as an {@code int}.
+ * <p>
+- * This queries this date-time for the value for the specified field.
++ * This queries this date-time for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -609,7 +609,7 @@
+ /**
+ * Gets the value of the specified field from this date-time as a {@code long}.
+ * <p>
+- * This queries this date-time for the value for the specified field.
++ * This queries this date-time for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -704,7 +704,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Gets the {@code LocalDateTime} part of this offset date-time.
++ * Gets the {@code LocalDateTime} part of this date-time.
+ * <p>
+ * This returns a {@code LocalDateTime} with the same year, month, day and time
+ * as this date-time.
+@@ -796,10 +796,10 @@
+ /**
+ * Gets the day-of-week field, which is an enum {@code DayOfWeek}.
+ * <p>
+- * This method returns the enum {@link java.time.DayOfWeek} for the day-of-week.
++ * This method returns the enum {@link DayOfWeek} for the day-of-week.
+ * This avoids confusion as to what {@code int} values mean.
+ * If you need access to the primitive {@code int} value then the enum
+- * provides the {@link java.time.DayOfWeek#getValue() int value}.
++ * provides the {@link DayOfWeek#getValue() int value}.
+ * <p>
+ * Additional information can be obtained from the {@code DayOfWeek}.
+ * This includes textual names of the values.
+@@ -869,7 +869,8 @@
+ * <p>
+ * A simple adjuster might simply set the one of the fields, such as the year field.
+ * A more complex adjuster might set the date to the last day of the month.
+- * A selection of common adjustments is provided in {@link TemporalAdjuster}.
++ * A selection of common adjustments is provided in
++ * {@link java.time.temporal.TemporalAdjusters TemporalAdjusters}.
+ * These include finding the "last day of the month" and "next Wednesday".
+ * Key date-time classes also implement the {@code TemporalAdjuster} interface,
+ * such as {@link Month} and {@link java.time.MonthDay MonthDay}.
+@@ -879,7 +880,7 @@
+ * For example this code returns a date on the last day of July:
+ * <pre>
+ * import static java.time.Month.*;
+- * import static java.time.temporal.Adjusters.*;
++ * import static java.time.temporal.TemporalAdjusters.*;
+ *
+ * result = offsetDateTime.with(JULY).with(lastDayOfMonth());
+ * </pre>
+@@ -921,7 +922,7 @@
+ /**
+ * Returns a copy of this date-time with the specified field set to a new value.
+ * <p>
+- * TThis returns an {@code OffsetDateTime}, based on this one, with the value
++ * This returns an {@code OffsetDateTime}, based on this one, with the value
+ * for the specified field changed.
+ * This can be used to change any supported field, such as the year, month or day-of-month.
+ * If it is not possible to set the value, because the field is not supported or for
+@@ -980,7 +981,8 @@
+ //-----------------------------------------------------------------------
+ /**
+ * Returns a copy of this {@code OffsetDateTime} with the year altered.
+- * The offset does not affect the calculation and will be the same in the result.
++ * <p>
++ * The time and offset do not affect the calculation and will be the same in the result.
+ * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+@@ -995,7 +997,8 @@
+
+ /**
+ * Returns a copy of this {@code OffsetDateTime} with the month-of-year altered.
+- * The offset does not affect the calculation and will be the same in the result.
++ * <p>
++ * The time and offset do not affect the calculation and will be the same in the result.
+ * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+@@ -1010,8 +1013,9 @@
+
+ /**
+ * Returns a copy of this {@code OffsetDateTime} with the day-of-month altered.
++ * <p>
+ * If the resulting {@code OffsetDateTime} is invalid, an exception is thrown.
+- * The offset does not affect the calculation and will be the same in the result.
++ * The time and offset do not affect the calculation and will be the same in the result.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1026,6 +1030,8 @@
+
+ /**
+ * Returns a copy of this {@code OffsetDateTime} with the day-of-year altered.
++ * <p>
++ * The time and offset do not affect the calculation and will be the same in the result.
+ * If the resulting {@code OffsetDateTime} is invalid, an exception is thrown.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+@@ -1041,9 +1047,9 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the hour-of-day value altered.
++ * Returns a copy of this {@code OffsetDateTime} with the hour-of-day altered.
+ * <p>
+- * The offset does not affect the calculation and will be the same in the result.
++ * The date and offset do not affect the calculation and will be the same in the result.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1056,9 +1062,9 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the minute-of-hour value altered.
++ * Returns a copy of this {@code OffsetDateTime} with the minute-of-hour altered.
+ * <p>
+- * The offset does not affect the calculation and will be the same in the result.
++ * The date and offset do not affect the calculation and will be the same in the result.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1071,9 +1077,9 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the second-of-minute value altered.
++ * Returns a copy of this {@code OffsetDateTime} with the second-of-minute altered.
+ * <p>
+- * The offset does not affect the calculation and will be the same in the result.
++ * The date and offset do not affect the calculation and will be the same in the result.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1086,15 +1092,15 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the nano-of-second value altered.
++ * Returns a copy of this {@code OffsetDateTime} with the nano-of-second altered.
+ * <p>
+- * The offset does not affect the calculation and will be the same in the result.
++ * The date and offset do not affect the calculation and will be the same in the result.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+ * @param nanoOfSecond the nano-of-second to set in the result, from 0 to 999,999,999
+ * @return an {@code OffsetDateTime} based on this date-time with the requested nanosecond, not null
+- * @throws DateTimeException if the nanos value is invalid
++ * @throws DateTimeException if the nano value is invalid
+ */
+ public OffsetDateTime withNano(int nanoOfSecond) {
+ return with(dateTime.withNano(nanoOfSecond), offset);
+@@ -1188,7 +1194,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in years added.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of years added.
+ * <p>
+ * This method adds the specified amount to the years field in three steps:
+ * <ol>
+@@ -1212,7 +1218,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in months added.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of months added.
+ * <p>
+ * This method adds the specified amount to the months field in three steps:
+ * <ol>
+@@ -1236,13 +1242,13 @@
+ }
+
+ /**
+- * Returns a copy of this OffsetDateTime with the specified period in weeks added.
++ * Returns a copy of this OffsetDateTime with the specified number of weeks added.
+ * <p>
+ * This method adds the specified amount in weeks to the days field incrementing
+ * the month and year fields as necessary to ensure the result remains valid.
+ * The result is only invalid if the maximum/minimum year is exceeded.
+ * <p>
+- * For example, 2008-12-31 plus one week would result in the 2009-01-07.
++ * For example, 2008-12-31 plus one week would result in 2009-01-07.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1255,13 +1261,13 @@
+ }
+
+ /**
+- * Returns a copy of this OffsetDateTime with the specified period in days added.
++ * Returns a copy of this OffsetDateTime with the specified number of days added.
+ * <p>
+ * This method adds the specified amount to the days field incrementing the
+ * month and year fields as necessary to ensure the result remains valid.
+ * The result is only invalid if the maximum/minimum year is exceeded.
+ * <p>
+- * For example, 2008-12-31 plus one day would result in the 2009-01-01.
++ * For example, 2008-12-31 plus one day would result in 2009-01-01.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1274,7 +1280,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in hours added.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of hours added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1287,7 +1293,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in minutes added.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of minutes added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1300,7 +1306,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in seconds added.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of seconds added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1313,7 +1319,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in nanoseconds added.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of nanoseconds added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1377,11 +1383,11 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in years subtracted.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of years subtracted.
+ * <p>
+ * This method subtracts the specified amount from the years field in three steps:
+ * <ol>
+- * <li>Subtract the input years to the year field</li>
++ * <li>Subtract the input years from the year field</li>
+ * <li>Check if the resulting date would be invalid</li>
+ * <li>Adjust the day-of-month to the last valid day if necessary</li>
+ * </ol>
+@@ -1401,11 +1407,11 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in months subtracted.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of months subtracted.
+ * <p>
+ * This method subtracts the specified amount from the months field in three steps:
+ * <ol>
+- * <li>Subtract the input months to the month-of-year field</li>
++ * <li>Subtract the input months from the month-of-year field</li>
+ * <li>Check if the resulting date would be invalid</li>
+ * <li>Adjust the day-of-month to the last valid day if necessary</li>
+ * </ol>
+@@ -1425,13 +1431,13 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in weeks subtracted.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of weeks subtracted.
+ * <p>
+ * This method subtracts the specified amount in weeks from the days field decrementing
+ * the month and year fields as necessary to ensure the result remains valid.
+ * The result is only invalid if the maximum/minimum year is exceeded.
+ * <p>
+- * For example, 2008-12-31 minus one week would result in the 2009-01-07.
++ * For example, 2008-12-31 minus one week would result in 2009-01-07.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1444,13 +1450,13 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in days subtracted.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of days subtracted.
+ * <p>
+- * This method subtracts the specified amount from the days field incrementing the
++ * This method subtracts the specified amount from the days field decrementing the
+ * month and year fields as necessary to ensure the result remains valid.
+ * The result is only invalid if the maximum/minimum year is exceeded.
+ * <p>
+- * For example, 2008-12-31 minus one day would result in the 2009-01-01.
++ * For example, 2008-12-31 minus one day would result in 2009-01-01.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1463,7 +1469,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in hours subtracted.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of hours subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1476,7 +1482,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in minutes subtracted.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of minutes subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1489,7 +1495,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in seconds subtracted.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of seconds subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1502,7 +1508,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetDateTime} with the specified period in nanoseconds subtracted.
++ * Returns a copy of this {@code OffsetDateTime} with the specified number of nanoseconds subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1599,7 +1605,7 @@
+ * objects in terms of a single {@code TemporalUnit}.
+ * The start and end points are {@code this} and the specified date-time.
+ * The result will be negative if the end is before the start.
+- * For example, the period in days between two date-times can be calculated
++ * For example, the amount in days between two date-times can be calculated
+ * using {@code startDateTime.until(endDateTime, DAYS)}.
+ * <p>
+ * The {@code Temporal} passed to this method is converted to a
+@@ -1609,7 +1615,7 @@
+ * <p>
+ * The calculation returns a whole number, representing the number of
+ * complete units between the two date-times.
+- * For example, the period in months between 2012-06-15T00:00Z and 2012-08-14T23:59Z
++ * For example, the amount in months between 2012-06-15T00:00Z and 2012-08-14T23:59Z
+ * will only be one month as it is one minute short of two months.
+ * <p>
+ * There are two equivalent ways of using this method.
+@@ -1770,7 +1776,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Compares this {@code OffsetDateTime} to another date-time.
++ * Compares this date-time to another date-time.
+ * <p>
+ * The comparison is based on the instant then on the local date-time.
+ * It is "consistent with equals", as defined by {@link Comparable}.
+--- ./jdk/src/share/classes/java/time/OffsetTime.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/OffsetTime.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -153,14 +153,14 @@
+ /**
+ * Obtains the current time from the system clock in the default time-zone.
+ * <p>
+- * This will query the {@link java.time.Clock#systemDefaultZone() system clock} in the default
++ * This will query the {@link Clock#systemDefaultZone() system clock} in the default
+ * time-zone to obtain the current time.
+ * The offset will be calculated from the time-zone in the clock.
+ * <p>
+ * Using this method will prevent the ability to use an alternate clock for testing
+ * because the clock is hard-coded.
+ *
+- * @return the current time using the system clock, not null
++ * @return the current time using the system clock and default time-zone, not null
+ */
+ public static OffsetTime now() {
+ return now(Clock.systemDefaultZone());
+@@ -169,7 +169,7 @@
+ /**
+ * Obtains the current time from the system clock in the specified time-zone.
+ * <p>
+- * This will query the {@link Clock#system(java.time.ZoneId) system clock} to obtain the current time.
++ * This will query the {@link Clock#system(ZoneId) system clock} to obtain the current time.
+ * Specifying the time-zone avoids dependence on the default time-zone.
+ * The offset will be calculated from the specified time-zone.
+ * <p>
+@@ -277,7 +277,7 @@
+ * those fields that are equivalent to the relevant objects.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code OffsetTime::from}.
++ * allowing it to be used as a query via method reference, {@code OffsetTime::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the offset time, not null
+@@ -402,7 +402,7 @@
+ /**
+ * Checks if the specified unit is supported.
+ * <p>
+- * This checks if the specified unit can be added to, or subtracted from, this date-time.
++ * This checks if the specified unit can be added to, or subtracted from, this offset-time.
+ * If false, then calling the {@link #plus(long, TemporalUnit)} and
+ * {@link #minus(long, TemporalUnit) minus} methods will throw an exception.
+ * <p>
+@@ -473,7 +473,7 @@
+ /**
+ * Gets the value of the specified field from this time as an {@code int}.
+ * <p>
+- * This queries this time for the value for the specified field.
++ * This queries this time for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -505,7 +505,7 @@
+ /**
+ * Gets the value of the specified field from this time as a {@code long}.
+ * <p>
+- * This queries this time for the value for the specified field.
++ * This queries this time for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -575,7 +575,7 @@
+ * <p>
+ * This method returns an object with the specified {@code ZoneOffset} and a {@code LocalTime}
+ * adjusted by the difference between the two offsets.
+- * This will result in the old and new objects representing the same instant an an implied day.
++ * This will result in the old and new objects representing the same instant on an implied day.
+ * This is useful for finding the local time in a different offset.
+ * For example, if this time represents {@code 10:30+02:00} and the offset specified is
+ * {@code +03:00}, then this method will return {@code 11:30+03:00}.
+@@ -737,7 +737,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code OffsetTime} with the hour-of-day value altered.
++ * Returns a copy of this {@code OffsetTime} with the hour-of-day altered.
+ * <p>
+ * The offset does not affect the calculation and will be the same in the result.
+ * <p>
+@@ -752,7 +752,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the minute-of-hour value altered.
++ * Returns a copy of this {@code OffsetTime} with the minute-of-hour altered.
+ * <p>
+ * The offset does not affect the calculation and will be the same in the result.
+ * <p>
+@@ -767,7 +767,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the second-of-minute value altered.
++ * Returns a copy of this {@code OffsetTime} with the second-of-minute altered.
+ * <p>
+ * The offset does not affect the calculation and will be the same in the result.
+ * <p>
+@@ -782,7 +782,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the nano-of-second value altered.
++ * Returns a copy of this {@code OffsetTime} with the nano-of-second altered.
+ * <p>
+ * The offset does not affect the calculation and will be the same in the result.
+ * <p>
+@@ -884,7 +884,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code OffsetTime} with the specified period in hours added.
++ * Returns a copy of this {@code OffsetTime} with the specified number of hours added.
+ * <p>
+ * This adds the specified number of hours to this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -899,7 +899,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the specified period in minutes added.
++ * Returns a copy of this {@code OffsetTime} with the specified number of minutes added.
+ * <p>
+ * This adds the specified number of minutes to this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -914,7 +914,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the specified period in seconds added.
++ * Returns a copy of this {@code OffsetTime} with the specified number of seconds added.
+ * <p>
+ * This adds the specified number of seconds to this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -929,7 +929,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the specified period in nanoseconds added.
++ * Returns a copy of this {@code OffsetTime} with the specified number of nanoseconds added.
+ * <p>
+ * This adds the specified number of nanoseconds to this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -995,7 +995,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code OffsetTime} with the specified period in hours subtracted.
++ * Returns a copy of this {@code OffsetTime} with the specified number of hours subtracted.
+ * <p>
+ * This subtracts the specified number of hours from this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1010,7 +1010,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the specified period in minutes subtracted.
++ * Returns a copy of this {@code OffsetTime} with the specified number of minutes subtracted.
+ * <p>
+ * This subtracts the specified number of minutes from this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1025,7 +1025,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the specified period in seconds subtracted.
++ * Returns a copy of this {@code OffsetTime} with the specified number of seconds subtracted.
+ * <p>
+ * This subtracts the specified number of seconds from this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1040,7 +1040,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code OffsetTime} with the specified period in nanoseconds subtracted.
++ * Returns a copy of this {@code OffsetTime} with the specified number of nanoseconds subtracted.
+ * <p>
+ * This subtracts the specified number of nanoseconds from this time, returning a new time.
+ * The calculation wraps around midnight.
+@@ -1130,7 +1130,7 @@
+ * objects in terms of a single {@code TemporalUnit}.
+ * The start and end points are {@code this} and the specified time.
+ * The result will be negative if the end is before the start.
+- * For example, the period in hours between two times can be calculated
++ * For example, the amount in hours between two times can be calculated
+ * using {@code startTime.until(endTime, HOURS)}.
+ * <p>
+ * The {@code Temporal} passed to this method is converted to a
+@@ -1140,7 +1140,7 @@
+ * <p>
+ * The calculation returns a whole number, representing the number of
+ * complete units between the two times.
+- * For example, the period in hours between 11:30Z and 13:29Z will only
++ * For example, the amount in hours between 11:30Z and 13:29Z will only
+ * be one hour as it is one minute short of two hours.
+ * <p>
+ * There are two equivalent ways of using this method.
+@@ -1165,7 +1165,7 @@
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+- * @param endExclusive the end date, exclusive, which is converted to an {@code OffsetTime}, not null
++ * @param endExclusive the end time, exclusive, which is converted to an {@code OffsetTime}, not null
+ * @param unit the unit to measure the amount in, not null
+ * @return the amount of time between this time and the end time
+ * @throws DateTimeException if the amount cannot be calculated, or the end
+--- ./jdk/src/share/classes/java/time/Period.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/Period.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -616,7 +616,7 @@
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+- * @param amountToAdd the period to add, not null
++ * @param amountToAdd the amount to add, not null
+ * @return a {@code Period} based on this period with the requested period added, not null
+ * @throws DateTimeException if the specified amount has a non-ISO chronology or
+ * contains an invalid unit
+@@ -705,7 +705,7 @@
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+- * @param amountToSubtract the period to subtract, not null
++ * @param amountToSubtract the amount to subtract, not null
+ * @return a {@code Period} based on this period with the requested period subtracted, not null
+ * @throws DateTimeException if the specified amount has a non-ISO chronology or
+ * contains an invalid unit
+--- ./jdk/src/share/classes/java/time/Year.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/Year.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -164,7 +164,7 @@
+ /**
+ * Obtains the current year from the system clock in the default time-zone.
+ * <p>
+- * This will query the {@link java.time.Clock#systemDefaultZone() system clock} in the default
++ * This will query the {@link Clock#systemDefaultZone() system clock} in the default
+ * time-zone to obtain the current year.
+ * <p>
+ * Using this method will prevent the ability to use an alternate clock for testing
+@@ -179,7 +179,7 @@
+ /**
+ * Obtains the current year from the system clock in the specified time-zone.
+ * <p>
+- * This will query the {@link Clock#system(java.time.ZoneId) system clock} to obtain the current year.
++ * This will query the {@link Clock#system(ZoneId) system clock} to obtain the current year.
+ * Specifying the time-zone avoids dependence on the default time-zone.
+ * <p>
+ * Using this method will prevent the ability to use an alternate clock for testing
+@@ -240,7 +240,7 @@
+ * chronology, or can be converted to a {@code LocalDate}.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code Year::from}.
++ * allowing it to be used as a query via method reference, {@code Year::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the year, not null
+@@ -375,7 +375,7 @@
+ /**
+ * Checks if the specified unit is supported.
+ * <p>
+- * This checks if the specified unit can be added to, or subtracted from, this date-time.
++ * This checks if the specified unit can be added to, or subtracted from, this year.
+ * If false, then calling the {@link #plus(long, TemporalUnit)} and
+ * {@link #minus(long, TemporalUnit) minus} methods will throw an exception.
+ * <p>
+@@ -441,7 +441,7 @@
+ /**
+ * Gets the value of the specified field from this year as an {@code int}.
+ * <p>
+- * This queries this year for the value for the specified field.
++ * This queries this year for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -472,7 +472,7 @@
+ /**
+ * Gets the value of the specified field from this year as a {@code long}.
+ * <p>
+- * This queries this year for the value for the specified field.
++ * This queries this year for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -720,13 +720,13 @@
+ }
+
+ /**
+- * Returns a copy of this year with the specified number of years added.
++ * Returns a copy of this {@code Year} with the specified number of years added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+ * @param yearsToAdd the years to add, may be negative
+- * @return a {@code Year} based on this year with the period added, not null
+- * @throws DateTimeException if the result exceeds the supported year range
++ * @return a {@code Year} based on this year with the years added, not null
++ * @throws DateTimeException if the result exceeds the supported range
+ */
+ public Year plusYears(long yearsToAdd) {
+ if (yearsToAdd == 0) {
+@@ -786,13 +786,13 @@
+ }
+
+ /**
+- * Returns a copy of this year with the specified number of years subtracted.
++ * Returns a copy of this {@code Year} with the specified number of years subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+ * @param yearsToSubtract the years to subtract, may be negative
+- * @return a {@code Year} based on this year with the period subtracted, not null
+- * @throws DateTimeException if the result exceeds the supported year range
++ * @return a {@code Year} based on this year with the year subtracted, not null
++ * @throws DateTimeException if the result exceeds the supported range
+ */
+ public Year minusYears(long yearsToSubtract) {
+ return (yearsToSubtract == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-yearsToSubtract));
+@@ -871,12 +871,12 @@
+ * The result will be negative if the end is before the start.
+ * The {@code Temporal} passed to this method is converted to a
+ * {@code Year} using {@link #from(TemporalAccessor)}.
+- * For example, the period in decades between two year can be calculated
++ * For example, the amount in decades between two year can be calculated
+ * using {@code startYear.until(endYear, DECADES)}.
+ * <p>
+ * The calculation returns a whole number, representing the number of
+ * complete units between the two years.
+- * For example, the period in decades between 2012 and 2031
++ * For example, the amount in decades between 2012 and 2031
+ * will only be one decade as it is one year short of two decades.
+ * <p>
+ * There are two equivalent ways of using this method.
+@@ -948,7 +948,7 @@
+ * <p>
+ * The day-of-year value 366 is only valid in a leap year.
+ *
+- * @param dayOfYear the day-of-year to use, not null
++ * @param dayOfYear the day-of-year to use, from 1 to 365-366
+ * @return the local date formed from this year and the specified date of year, not null
+ * @throws DateTimeException if the day of year is zero or less, 366 or greater or equal
+ * to 366 and this is not a leap year
+@@ -1025,7 +1025,7 @@
+ }
+
+ /**
+- * Is this year after the specified year.
++ * Checks if this year is after the specified year.
+ *
+ * @param other the other year to compare to, not null
+ * @return true if this is after the specified year
+@@ -1035,7 +1035,7 @@
+ }
+
+ /**
+- * Is this year before the specified year.
++ * Checks if this year is before the specified year.
+ *
+ * @param other the other year to compare to, not null
+ * @return true if this point is before the specified year
+--- ./jdk/src/share/classes/java/time/YearMonth.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/YearMonth.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -157,9 +157,8 @@
+ /**
+ * Obtains the current year-month from the system clock in the default time-zone.
+ * <p>
+- * This will query the {@link java.time.Clock#systemDefaultZone() system clock} in the default
++ * This will query the {@link Clock#systemDefaultZone() system clock} in the default
+ * time-zone to obtain the current year-month.
+- * The zone and offset will be set based on the time-zone in the clock.
+ * <p>
+ * Using this method will prevent the ability to use an alternate clock for testing
+ * because the clock is hard-coded.
+@@ -173,7 +172,7 @@
+ /**
+ * Obtains the current year-month from the system clock in the specified time-zone.
+ * <p>
+- * This will query the {@link Clock#system(java.time.ZoneId) system clock} to obtain the current year-month.
++ * This will query the {@link Clock#system(ZoneId) system clock} to obtain the current year-month.
+ * Specifying the time-zone avoids dependence on the default time-zone.
+ * <p>
+ * Using this method will prevent the ability to use an alternate clock for testing
+@@ -243,7 +242,7 @@
+ * chronology, or can be converted to a {@code LocalDate}.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code YearMonth::from}.
++ * allowing it to be used as a query via method reference, {@code YearMonth::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the year-month, not null
+@@ -363,7 +362,7 @@
+ /**
+ * Checks if the specified unit is supported.
+ * <p>
+- * This checks if the specified unit can be added to, or subtracted from, this date-time.
++ * This checks if the specified unit can be added to, or subtracted from, this year-month.
+ * If false, then calling the {@link #plus(long, TemporalUnit)} and
+ * {@link #minus(long, TemporalUnit) minus} methods will throw an exception.
+ * <p>
+@@ -430,7 +429,7 @@
+ /**
+ * Gets the value of the specified field from this year-month as an {@code int}.
+ * <p>
+- * This queries this year-month for the value for the specified field.
++ * This queries this year-month for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -462,7 +461,7 @@
+ /**
+ * Gets the value of the specified field from this year-month as a {@code long}.
+ * <p>
+- * This queries this year-month for the value for the specified field.
++ * This queries this year-month for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -819,7 +818,7 @@
+ }
+
+ /**
+- * Returns a copy of this year-month with the specified period in years added.
++ * Returns a copy of this {@code YearMonth} with the specified number of years added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -836,7 +835,7 @@
+ }
+
+ /**
+- * Returns a copy of this year-month with the specified period in months added.
++ * Returns a copy of this {@code YearMonth} with the specified number of months added.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -906,7 +905,7 @@
+ }
+
+ /**
+- * Returns a copy of this year-month with the specified period in years subtracted.
++ * Returns a copy of this {@code YearMonth} with the specified number of years subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -919,7 +918,7 @@
+ }
+
+ /**
+- * Returns a copy of this year-month with the specified period in months subtracted.
++ * Returns a copy of this {@code YearMonth} with the specified number of months subtracted.
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+@@ -1004,12 +1003,12 @@
+ * The result will be negative if the end is before the start.
+ * The {@code Temporal} passed to this method is converted to a
+ * {@code YearMonth} using {@link #from(TemporalAccessor)}.
+- * For example, the period in years between two year-months can be calculated
++ * For example, the amount in years between two year-months can be calculated
+ * using {@code startYearMonth.until(endYearMonth, YEARS)}.
+ * <p>
+ * The calculation returns a whole number, representing the number of
+ * complete units between the two year-months.
+- * For example, the period in decades between 2012-06 and 2032-05
++ * For example, the amount in decades between 2012-06 and 2032-05
+ * will only be one decade as it is one month short of two decades.
+ * <p>
+ * There are two equivalent ways of using this method.
+@@ -1134,7 +1133,7 @@
+ }
+
+ /**
+- * Is this year-month after the specified year-month.
++ * Checks if this year-month is after the specified year-month.
+ *
+ * @param other the other year-month to compare to, not null
+ * @return true if this is after the specified year-month
+@@ -1144,7 +1143,7 @@
+ }
+
+ /**
+- * Is this year-month before the specified year-month.
++ * Checks if this year-month is before the specified year-month.
+ *
+ * @param other the other year-month to compare to, not null
+ * @return true if this point is before the specified year-month
+--- ./jdk/src/share/classes/java/time/ZoneId.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/ZoneId.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -453,7 +453,7 @@
+ * zones over offset-based zones using {@link TemporalQueries#zone()}.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code ZoneId::from}.
++ * allowing it to be used as a query via method reference, {@code ZoneId::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the zone ID, not null
+--- ./jdk/src/share/classes/java/time/ZoneOffset.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/ZoneOffset.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -89,7 +89,7 @@
+ /**
+ * A time-zone offset from Greenwich/UTC, such as {@code +02:00}.
+ * <p>
+- * A time-zone offset is the period of time that a time-zone differs from Greenwich/UTC.
++ * A time-zone offset is the amount of time that a time-zone differs from Greenwich/UTC.
+ * This is usually a fixed number of hours and minutes.
+ * <p>
+ * Different parts of the world have different time-zone offsets.
+@@ -334,7 +334,7 @@
+ * on extracting the {@link ChronoField#OFFSET_SECONDS OFFSET_SECONDS} field.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code ZoneOffset::from}.
++ * allowing it to be used as a query via method reference, {@code ZoneOffset::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the zone-offset, not null
+@@ -564,7 +564,7 @@
+ /**
+ * Gets the value of the specified field from this offset as an {@code int}.
+ * <p>
+- * This queries this offset for the value for the specified field.
++ * This queries this offset for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -599,7 +599,7 @@
+ /**
+ * Gets the value of the specified field from this offset as a {@code long}.
+ * <p>
+- * This queries this offset for the value for the specified field.
++ * This queries this offset for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+--- ./jdk/src/share/classes/java/time/ZonedDateTime.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/ZonedDateTime.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -419,7 +419,7 @@
+ * <p>
+ * Converting an instant to a zoned date-time is simple as there is only one valid
+ * offset for each instant. If the valid offset is different to the offset specified,
+- * the the date-time and offset of the zoned date-time will differ from those specified.
++ * then the date-time and offset of the zoned date-time will differ from those specified.
+ * <p>
+ * If the {@code ZoneId} to be used is a {@code ZoneOffset}, this method is equivalent
+ * to {@link #of(LocalDateTime, ZoneId)}.
+@@ -539,7 +539,7 @@
+ * those fields that are equivalent to the relevant objects.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code ZonedDateTime::from}.
++ * allowing it to be used as a query via method reference, {@code ZonedDateTime::from}.
+ *
+ * @param temporal the temporal object to convert, not null
+ * @return the zoned date-time, not null
+@@ -783,7 +783,7 @@
+ /**
+ * Gets the value of the specified field from this date-time as an {@code int}.
+ * <p>
+- * This queries this date-time for the value for the specified field.
++ * This queries this date-time for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -825,7 +825,7 @@
+ /**
+ * Gets the value of the specified field from this date-time as a {@code long}.
+ * <p>
+- * This queries this date-time for the value for the specified field.
++ * This queries this date-time for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+@@ -1183,7 +1183,8 @@
+ * <p>
+ * A simple adjuster might simply set the one of the fields, such as the year field.
+ * A more complex adjuster might set the date to the last day of the month.
+- * A selection of common adjustments is provided in {@link TemporalAdjuster}.
++ * A selection of common adjustments is provided in
++ * {@link java.time.temporal.TemporalAdjusters TemporalAdjusters}.
+ * These include finding the "last day of the month" and "next Wednesday".
+ * Key date-time classes also implement the {@code TemporalAdjuster} interface,
+ * such as {@link Month} and {@link java.time.MonthDay MonthDay}.
+@@ -1193,7 +1194,7 @@
+ * For example this code returns a date on the last day of July:
+ * <pre>
+ * import static java.time.Month.*;
+- * import static java.time.temporal.Adjusters.*;
++ * import static java.time.temporal.TemporalAdjusters.*;
+ *
+ * result = zonedDateTime.with(JULY).with(lastDayOfMonth());
+ * </pre>
+@@ -1314,7 +1315,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the year value altered.
++ * Returns a copy of this {@code ZonedDateTime} with the year altered.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#withYear(int) changing the year} of the local date-time.
+@@ -1336,7 +1337,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the month-of-year value altered.
++ * Returns a copy of this {@code ZonedDateTime} with the month-of-year altered.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#withMonth(int) changing the month} of the local date-time.
+@@ -1358,7 +1359,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the day-of-month value altered.
++ * Returns a copy of this {@code ZonedDateTime} with the day-of-month altered.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#withDayOfMonth(int) changing the day-of-month} of the local date-time.
+@@ -1405,7 +1406,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the hour-of-day value altered.
++ * Returns a copy of this {@code ZonedDateTime} with the hour-of-day altered.
+ * <p>
+ * This operates on the local time-line,
+ * {@linkplain LocalDateTime#withHour(int) changing the time} of the local date-time.
+@@ -1427,7 +1428,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the minute-of-hour value altered.
++ * Returns a copy of this {@code ZonedDateTime} with the minute-of-hour altered.
+ * <p>
+ * This operates on the local time-line,
+ * {@linkplain LocalDateTime#withMinute(int) changing the time} of the local date-time.
+@@ -1449,7 +1450,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the second-of-minute value altered.
++ * Returns a copy of this {@code ZonedDateTime} with the second-of-minute altered.
+ * <p>
+ * This operates on the local time-line,
+ * {@linkplain LocalDateTime#withSecond(int) changing the time} of the local date-time.
+@@ -1471,7 +1472,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the nano-of-second value altered.
++ * Returns a copy of this {@code ZonedDateTime} with the nano-of-second altered.
+ * <p>
+ * This operates on the local time-line,
+ * {@linkplain LocalDateTime#withNano(int) changing the time} of the local date-time.
+@@ -1507,7 +1508,7 @@
+ * {@link ChronoUnit#DAYS DAYS}. Other units throw an exception.
+ * <p>
+ * This operates on the local time-line,
+- * {@link LocalDateTime#truncatedTo(java.time.temporal.TemporalUnit) truncating}
++ * {@link LocalDateTime#truncatedTo(TemporalUnit) truncating}
+ * the underlying local date-time. This is then converted back to a
+ * {@code ZonedDateTime}, using the zone ID to obtain the offset.
+ * <p>
+@@ -1608,7 +1609,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in years added.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of years added.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#plusYears(long) adding years} to the local date-time.
+@@ -1630,7 +1631,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in months added.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of months added.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#plusMonths(long) adding months} to the local date-time.
+@@ -1652,7 +1653,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in weeks added.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of weeks added.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#plusWeeks(long) adding weeks} to the local date-time.
+@@ -1674,7 +1675,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in days added.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of days added.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#plusDays(long) adding days} to the local date-time.
+@@ -1697,7 +1698,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in hours added.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of hours added.
+ * <p>
+ * This operates on the instant time-line, such that adding one hour will
+ * always be a duration of one hour later.
+@@ -1725,7 +1726,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in minutes added.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of minutes added.
+ * <p>
+ * This operates on the instant time-line, such that adding one minute will
+ * always be a duration of one minute later.
+@@ -1743,7 +1744,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in seconds added.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of seconds added.
+ * <p>
+ * This operates on the instant time-line, such that adding one second will
+ * always be a duration of one second later.
+@@ -1761,7 +1762,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in nanoseconds added.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of nanoseconds added.
+ * <p>
+ * This operates on the instant time-line, such that adding one nano will
+ * always be a duration of one nano later.
+@@ -1849,7 +1850,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in years subtracted.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of years subtracted.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#minusYears(long) subtracting years} to the local date-time.
+@@ -1871,7 +1872,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in months subtracted.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of months subtracted.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#minusMonths(long) subtracting months} to the local date-time.
+@@ -1893,7 +1894,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in weeks subtracted.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of weeks subtracted.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#minusWeeks(long) subtracting weeks} to the local date-time.
+@@ -1915,7 +1916,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in days subtracted.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of days subtracted.
+ * <p>
+ * This operates on the local time-line,
+ * {@link LocalDateTime#minusDays(long) subtracting days} to the local date-time.
+@@ -1938,7 +1939,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in hours subtracted.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of hours subtracted.
+ * <p>
+ * This operates on the instant time-line, such that subtracting one hour will
+ * always be a duration of one hour earlier.
+@@ -1966,7 +1967,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in minutes subtracted.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of minutes subtracted.
+ * <p>
+ * This operates on the instant time-line, such that subtracting one minute will
+ * always be a duration of one minute earlier.
+@@ -1984,7 +1985,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in seconds subtracted.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of seconds subtracted.
+ * <p>
+ * This operates on the instant time-line, such that subtracting one second will
+ * always be a duration of one second earlier.
+@@ -2002,7 +2003,7 @@
+ }
+
+ /**
+- * Returns a copy of this {@code ZonedDateTime} with the specified period in nanoseconds subtracted.
++ * Returns a copy of this {@code ZonedDateTime} with the specified number of nanoseconds subtracted.
+ * <p>
+ * This operates on the instant time-line, such that subtracting one nano will
+ * always be a duration of one nano earlier.
+@@ -2029,7 +2030,7 @@
+ * what the result of this method will be.
+ * <p>
+ * The result of this method is obtained by invoking the
+- * {@link java.time.temporal.TemporalQuery#queryFrom(TemporalAccessor)} method on the
++ * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the
+ * specified query passing {@code this} as the argument.
+ *
+ * @param <R> the type of the result
+@@ -2054,7 +2055,7 @@
+ * objects in terms of a single {@code TemporalUnit}.
+ * The start and end points are {@code this} and the specified date-time.
+ * The result will be negative if the end is before the start.
+- * For example, the period in days between two date-times can be calculated
++ * For example, the amount in days between two date-times can be calculated
+ * using {@code startDateTime.until(endDateTime, DAYS)}.
+ * <p>
+ * The {@code Temporal} passed to this method is converted to a
+@@ -2064,7 +2065,7 @@
+ * <p>
+ * The calculation returns a whole number, representing the number of
+ * complete units between the two date-times.
+- * For example, the period in months between 2012-06-15T00:00Z and 2012-08-14T23:59Z
++ * For example, the amount in months between 2012-06-15T00:00Z and 2012-08-14T23:59Z
+ * will only be one month as it is one minute short of two months.
+ * <p>
+ * There are two equivalent ways of using this method.
+--- ./jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -249,8 +249,8 @@
+ * This allows dates in different calendar systems to be compared based
+ * on the position of the date on the local time-line.
+ * The underlying comparison is equivalent to comparing the epoch-day.
++ *
+ * @return a comparator that compares in time-line order ignoring the chronology
+- *
+ * @see #isAfter
+ * @see #isBefore
+ * @see #isEqual
+--- ./jdk/src/share/classes/java/time/chrono/ChronoLocalDateImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/ChronoLocalDateImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -227,7 +227,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this date with the specified period in years added.
++ * Returns a copy of this date with the specified number of years added.
+ * <p>
+ * This adds the specified period in years to the date.
+ * In some cases, adding years can cause the resulting date to become invalid.
+@@ -243,7 +243,7 @@
+ abstract D plusYears(long yearsToAdd);
+
+ /**
+- * Returns a copy of this date with the specified period in months added.
++ * Returns a copy of this date with the specified number of months added.
+ * <p>
+ * This adds the specified period in months to the date.
+ * In some cases, adding months can cause the resulting date to become invalid.
+@@ -259,7 +259,7 @@
+ abstract D plusMonths(long monthsToAdd);
+
+ /**
+- * Returns a copy of this date with the specified period in weeks added.
++ * Returns a copy of this date with the specified number of weeks added.
+ * <p>
+ * This adds the specified period in weeks to the date.
+ * In some cases, adding weeks can cause the resulting date to become invalid.
+@@ -292,7 +292,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Returns a copy of this date with the specified period in years subtracted.
++ * Returns a copy of this date with the specified number of years subtracted.
+ * <p>
+ * This subtracts the specified period in years to the date.
+ * In some cases, subtracting years can cause the resulting date to become invalid.
+@@ -313,7 +313,7 @@
+ }
+
+ /**
+- * Returns a copy of this date with the specified period in months subtracted.
++ * Returns a copy of this date with the specified number of months subtracted.
+ * <p>
+ * This subtracts the specified period in months to the date.
+ * In some cases, subtracting months can cause the resulting date to become invalid.
+@@ -334,7 +334,7 @@
+ }
+
+ /**
+- * Returns a copy of this date with the specified period in weeks subtracted.
++ * Returns a copy of this date with the specified number of weeks subtracted.
+ * <p>
+ * This subtracts the specified period in weeks to the date.
+ * In some cases, subtracting weeks can cause the resulting date to become invalid.
+--- ./jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -131,7 +131,6 @@
+ * The underlying comparison is equivalent to comparing the epoch-day and nano-of-day.
+ *
+ * @return a comparator that compares in time-line order ignoring the chronology
+- *
+ * @see #isAfter
+ * @see #isBefore
+ * @see #isEqual
+@@ -323,7 +322,7 @@
+ * what the result of this method will be.
+ * <p>
+ * The result of this method is obtained by invoking the
+- * {@link java.time.temporal.TemporalQuery#queryFrom(TemporalAccessor)} method on the
++ * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the
+ * specified query passing {@code this} as the argument.
+ *
+ * @param <R> the type of the result
+--- ./jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -132,7 +132,6 @@
+ * The underlying comparison is equivalent to comparing the epoch-second and nano-of-second.
+ *
+ * @return a comparator that compares in time-line order ignoring the chronology
+- *
+ * @see #isAfter
+ * @see #isBefore
+ * @see #isEqual
+@@ -292,7 +291,7 @@
+ * <p>
+ * This instance is immutable and unaffected by this method call.
+ *
+- * @return a {@code ZoneChronoDateTime} based on this date-time with the earlier offset, not null
++ * @return a {@code ChronoZonedDateTime} based on this date-time with the earlier offset, not null
+ * @throws DateTimeException if no rules can be found for the zone
+ * @throws DateTimeException if no rules are valid for this date-time
+ */
+@@ -319,7 +318,7 @@
+ ChronoZonedDateTime<D> withLaterOffsetAtOverlap();
+
+ /**
+- * Returns a copy of this ZonedDateTime with a different time-zone,
++ * Returns a copy of this date-time with a different time-zone,
+ * retaining the local date-time if possible.
+ * <p>
+ * This method changes the time-zone and retains the local date-time.
+@@ -470,7 +469,7 @@
+ * what the result of this method will be.
+ * <p>
+ * The result of this method is obtained by invoking the
+- * {@link java.time.temporal.TemporalQuery#queryFrom(TemporalAccessor)} method on the
++ * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the
+ * specified query passing {@code this} as the argument.
+ *
+ * @param <R> the type of the result
+--- ./jdk/src/share/classes/java/time/chrono/Chronology.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/Chronology.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -132,8 +132,9 @@
+ * The set of available chronologies can be extended by applications.
+ * Adding a new calendar system requires the writing of an implementation of
+ * {@code Chronology}, {@code ChronoLocalDate} and {@code Era}.
+- * The majority of the logic specific to the calendar system will be in
+- * {@code ChronoLocalDate}. The {@code Chronology} subclass acts as a factory.
++ * The majority of the logic specific to the calendar system will be in the
++ * {@code ChronoLocalDate} implementation.
++ * The {@code Chronology} implementation acts as a factory.
+ * <p>
+ * To permit the discovery of additional chronologies, the {@link java.util.ServiceLoader ServiceLoader}
+ * is used. A file must be added to the {@code META-INF/services} directory with the
+@@ -167,7 +168,7 @@
+ * If the specified temporal object does not have a chronology, {@link IsoChronology} is returned.
+ * <p>
+ * This method matches the signature of the functional interface {@link TemporalQuery}
+- * allowing it to be used in queries via method reference, {@code Chronology::from}.
++ * allowing it to be used as a query via method reference, {@code Chronology::from}.
+ *
+ * @param temporal the temporal to convert, not null
+ * @return the chronology, not null
+@@ -413,7 +414,7 @@
+ * The alternate clock may be introduced using {@link Clock dependency injection}.
+ *
+ * @implSpec
+- * The default implementation invokes {@link #date(TemporalAccessor)} )}.
++ * The default implementation invokes {@link #date(TemporalAccessor)}.
+ *
+ * @param clock the clock to use, not null
+ * @return the current local date, not null
+@@ -622,7 +623,7 @@
+ * The parameters control the style of the returned text and the locale.
+ *
+ * @implSpec
+- * The default implementation behaves as the the formatter was used to
++ * The default implementation behaves as though the formatter was used to
+ * format the chronology textual name.
+ *
+ * @param style the style of the text required, not null
+--- ./jdk/src/share/classes/java/time/chrono/Era.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/Era.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -182,7 +182,7 @@
+ /**
+ * Gets the value of the specified field from this era as an {@code int}.
+ * <p>
+- * This queries this era for the value for the specified field.
++ * This queries this era for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+@@ -215,7 +215,7 @@
+ /**
+ * Gets the value of the specified field from this era as a {@code long}.
+ * <p>
+- * This queries this era for the value for the specified field.
++ * This queries this era for the value of the specified field.
+ * If it is not possible to return the value, because the field is not supported
+ * or for some other reason, an exception is thrown.
+ * <p>
+--- ./jdk/src/share/classes/java/time/chrono/HijrahChronology.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/HijrahChronology.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -394,7 +394,7 @@
+ * Gets the ID of the chronology.
+ * <p>
+ * The ID uniquely identifies the {@code Chronology}. It can be used to
+- * lookup the {@code Chronology} using {@link #of(String)}.
++ * lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ *
+ * @return the chronology ID, non-null
+ * @see #getCalendarType()
+@@ -409,7 +409,7 @@
+ * <p>
+ * The calendar type is an identifier defined by the
+ * <em>Unicode Locale Data Markup Language (LDML)</em> specification.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ *
+ * @return the calendar system type; non-null if the calendar has
+ * a standard type, otherwise null
+--- ./jdk/src/share/classes/java/time/chrono/IsoChronology.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/IsoChronology.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -143,7 +143,7 @@
+ * Gets the ID of the chronology - 'ISO'.
+ * <p>
+ * The ID uniquely identifies the {@code Chronology}.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ *
+ * @return the chronology ID - 'ISO'
+ * @see #getCalendarType()
+@@ -158,7 +158,7 @@
+ * <p>
+ * The calendar type is an identifier defined by the
+ * <em>Unicode Locale Data Markup Language (LDML)</em> specification.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ * It can also be used as part of a locale, accessible via
+ * {@link Locale#getUnicodeLocaleType(String)} with the key 'ca'.
+ *
+--- ./jdk/src/share/classes/java/time/chrono/JapaneseChronology.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/JapaneseChronology.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -150,7 +150,7 @@
+ * Gets the ID of the chronology - 'Japanese'.
+ * <p>
+ * The ID uniquely identifies the {@code Chronology}.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ *
+ * @return the chronology ID - 'Japanese'
+ * @see #getCalendarType()
+@@ -165,7 +165,7 @@
+ * <p>
+ * The calendar type is an identifier defined by the
+ * <em>Unicode Locale Data Markup Language (LDML)</em> specification.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ * It can also be used as part of a locale, accessible via
+ * {@link Locale#getUnicodeLocaleType(String)} with the key 'ca'.
+ *
+--- ./jdk/src/share/classes/java/time/chrono/MinguoChronology.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/MinguoChronology.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -132,7 +132,7 @@
+ * Gets the ID of the chronology - 'Minguo'.
+ * <p>
+ * The ID uniquely identifies the {@code Chronology}.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ *
+ * @return the chronology ID - 'Minguo'
+ * @see #getCalendarType()
+@@ -147,7 +147,7 @@
+ * <p>
+ * The calendar type is an identifier defined by the
+ * <em>Unicode Locale Data Markup Language (LDML)</em> specification.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ * It can also be used as part of a locale, accessible via
+ * {@link Locale#getUnicodeLocaleType(String)} with the key 'ca'.
+ *
+--- ./jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -168,7 +168,7 @@
+ * Gets the ID of the chronology - 'ThaiBuddhist'.
+ * <p>
+ * The ID uniquely identifies the {@code Chronology}.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ *
+ * @return the chronology ID - 'ThaiBuddhist'
+ * @see #getCalendarType()
+@@ -183,7 +183,7 @@
+ * <p>
+ * The calendar type is an identifier defined by the
+ * <em>Unicode Locale Data Markup Language (LDML)</em> specification.
+- * It can be used to lookup the {@code Chronology} using {@link #of(String)}.
++ * It can be used to lookup the {@code Chronology} using {@link Chronology#of(String)}.
+ * It can also be used as part of a locale, accessible via
+ * {@link Locale#getUnicodeLocaleType(String)} with the key 'ca'.
+ *
+--- ./jdk/src/share/classes/java/time/format/DateTimeFormatter.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/format/DateTimeFormatter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -117,8 +117,9 @@
+ * {@code parse(CharSequence text, DateTimeFormatter formatter)}.
+ * <p>For example:
+ * <blockquote><pre>
+- * String text = date.toString(formatter);
+- * LocalDate date = LocalDate.parse(text, formatter);
++ * LocalDate date = LocalDate.now();
++ * String text = date.format(formatter);
++ * LocalDate parsedDate = LocalDate.parse(text, formatter);
+ * </pre></blockquote>
+ * <p>
+ * In addition to the format, formatters can be created with desired Locale,
+@@ -265,9 +266,10 @@
+ * <p>
+ * For example:
+ * <blockquote><pre>
++ * LocalDate date = LocalDate.now();
+ * DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd");
+- * String text = date.toString(formatter);
+- * LocalDate date = LocalDate.parse(text, formatter);
++ * String text = date.format(formatter);
++ * LocalDate parsedDate = LocalDate.parse(text, formatter);
+ * </pre></blockquote>
+ * <p>
+ * All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The
+@@ -1331,8 +1333,8 @@
+ * If the time '23:59:60' is received, then a simple conversion is applied,
+ * replacing the second-of-minute of 60 with 59. This query can be used
+ * on the parse result to determine if the leap-second adjustment was made.
+- * The query will return one second of excess if it did adjust to remove
+- * the leap-second, and zero if not. Note that applying a leap-second
++ * The query will return {@code true} if it did adjust to remove the
++ * leap-second, and {@code false} if not. Note that applying a leap-second
+ * smoothing mechanism, such as UTC-SLS, is the responsibility of the
+ * application, as follows:
+ * <pre>
+@@ -1976,7 +1978,7 @@
+ * Errors are returned using the error index field of the {@code ParsePosition}
+ * instead of {@code DateTimeParseException}.
+ * The returned error index will be set to an index indicative of the error.
+- * Callers must check for errors before using the context.
++ * Callers must check for errors before using the result.
+ * <p>
+ * If the formatter parses the same field more than once with different values,
+ * the result will be an error.
+--- ./jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -31,7 +31,7 @@
+ *
+ * Copyright (c) 2008-2012, Stephen Colebourne & Michael Nascimento Santos
+ *
+- * All rights reserved.
++ * All rights hg qreserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+@@ -137,7 +137,6 @@
+ * <li>ChronologyText - the name of the chronology</li>
+ * <li>Literal - a text literal</li>
+ * <li>Nested and Optional - formats can be nested or made optional</li>
+- * <li>Other - the printer and parser interfaces can be used to add user supplied formatting</li>
+ * </ul>
+ * In addition, any of the elements may be decorated by padding, either with spaces or any other character.
+ * <p>
+@@ -194,8 +193,8 @@
+ * The locale and chronology are used to lookup the locale specific format
+ * for the requested dateStyle and/or timeStyle.
+ *
+- * @param dateStyle the FormatStyle for the date
+- * @param timeStyle the FormatStyle for the time
++ * @param dateStyle the FormatStyle for the date, null for time-only pattern
++ * @param timeStyle the FormatStyle for the time, null for date-only pattern
+ * @param chrono the Chronology, non-null
+ * @param locale the locale, non-null
+ * @return the locale and Chronology specific formatting pattern
+@@ -747,9 +746,9 @@
+ * defines the connection between each value and the text:
+ * <pre>
+ * Map&lt;Long, String&gt; map = new HashMap&lt;&gt;();
+- * map.put(1, "JNY");
+- * map.put(2, "FBY");
+- * map.put(3, "MCH");
++ * map.put(1L, "JNY");
++ * map.put(2L, "FBY");
++ * map.put(3L, "MCH");
+ * ...
+ * builder.appendText(MONTH_OF_YEAR, map);
+ * </pre>
+@@ -841,7 +840,7 @@
+ * <p>
+ * The {@linkplain ResolverStyle resolver style} has no effect on instant parsing.
+ * The end-of-day time of '24:00' is handled as midnight at the start of the following day.
+- * The leap-second time of '23:59:59' is handled to some degree, see
++ * The leap-second time of '23:59:60' is handled to some degree, see
+ * {@link DateTimeFormatter#parsedLeapSecond()} for full details.
+ * <p>
+ * An alternative to this method is to format/parse the instant as a single
+@@ -864,7 +863,7 @@
+ * Appends the zone offset, such as '+01:00', to the formatter.
+ * <p>
+ * This appends an instruction to format/parse the offset ID to the builder.
+- * This is equivalent to calling {@code appendOffset("HH:MM:ss", "Z")}.
++ * This is equivalent to calling {@code appendOffset("+HH:MM:ss", "Z")}.
+ *
+ * @return this, for chaining, not null
+ */
+@@ -1049,7 +1048,7 @@
+ * "GMT+01:30" -- ZoneOffset.of("+01:30")
+ * </pre>
+ * <p>
+- * Note that this method is is identical to {@code appendZoneId()} except
++ * Note that this method is identical to {@code appendZoneId()} except
+ * in the mechanism used to obtain the zone.
+ * Note also that parsing accepts offsets, whereas formatting will never
+ * produce one.
+@@ -1107,7 +1106,7 @@
+ * "GMT+01:30" -- ZoneOffset.of("GMT+01:30")
+ * </pre>
+ * <p>
+- * Note that this method is is identical to {@code appendZoneId()} except
++ * Note that this method is identical to {@code appendZoneId()} except
+ * in the mechanism used to obtain the zone.
+ *
+ * @return this, for chaining, not null
+@@ -1132,7 +1131,7 @@
+ * for the locale set in the {@link DateTimeFormatter}.
+ * If the temporal object being printed represents an instant, then the text
+ * will be the summer or winter time text as appropriate.
+- * If the lookup for text does not find any suitable reuslt, then the
++ * If the lookup for text does not find any suitable result, then the
+ * {@link ZoneId#getId() ID} will be printed instead.
+ * If the zone cannot be obtained then an exception is thrown unless the
+ * section of the formatter is optional.
+@@ -1168,7 +1167,7 @@
+ * for the locale set in the {@link DateTimeFormatter}.
+ * If the temporal object being printed represents an instant, then the text
+ * will be the summer or winter time text as appropriate.
+- * If the lookup for text does not find any suitable reuslt, then the
++ * If the lookup for text does not find any suitable result, then the
+ * {@link ZoneId#getId() ID} will be printed instead.
+ * If the zone cannot be obtained then an exception is thrown unless the
+ * section of the formatter is optional.
+@@ -1182,7 +1181,7 @@
+ * zone. This method also allows a set of preferred {@link ZoneId} to be
+ * specified for parsing. The matched preferred zone id will be used if the
+ * textural zone name being parsed is not unique.
+- *
++ * <p>
+ * If the zone cannot be parsed then an exception is thrown unless the
+ * section of the formatter is optional.
+ *
+@@ -1227,7 +1226,6 @@
+ * <p>
+ * The calendar system name will be output during a format.
+ * If the chronology cannot be obtained then an exception will be thrown.
+- * The calendar system name is obtained from the Chronology.
+ *
+ * @param textStyle the text style to use, not null
+ * @return this, for chaining, not null
+@@ -1453,7 +1451,7 @@
+ * LLLLL 5 appendText(ChronoField.MONTH_OF_YEAR, TextStyle.NARROW_STANDALONE)
+ *
+ * w 1 append special localized WeekFields element for numeric week-of-year
+- * ww 1 append special localized WeekFields element for numeric week-of-year, zero-padded
++ * ww 2 append special localized WeekFields element for numeric week-of-year, zero-padded
+ * W 1 append special localized WeekFields element for numeric week-of-month
+ * d 1 appendValue(ChronoField.DAY_OF_MONTH)
+ * dd 2 appendValue(ChronoField.DAY_OF_MONTH, 2)
+@@ -1880,7 +1878,6 @@
+ * <p>
+ * During parsing, the padding and decorated element are parsed.
+ * If parsing is lenient, then the pad width is treated as a maximum.
+- * If parsing is case insensitive, then the pad character is matched ignoring case.
+ * The padding is parsed greedily. Thus, if the decorated element starts with
+ * the pad character, it will not be parsed.
+ *
+--- ./jdk/src/share/classes/java/time/format/DecimalStyle.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/format/DecimalStyle.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -62,7 +62,6 @@
+ package java.time.format;
+
+ import java.text.DecimalFormatSymbols;
+-import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.HashSet;
+ import java.util.Locale;
+@@ -138,7 +137,7 @@
+ * of(Locale.getDefault(Locale.Category.FORMAT))}.
+ *
+ * @see java.util.Locale.Category#FORMAT
+- * @return the info, not null
++ * @return the decimal style, not null
+ */
+ public static DecimalStyle ofDefaultLocale() {
+ return of(Locale.getDefault(Locale.Category.FORMAT));
+@@ -150,7 +149,7 @@
+ * This method provides access to locale sensitive decimal style symbols.
+ *
+ * @param locale the locale, not null
+- * @return the info, not null
++ * @return the decimal style, not null
+ */
+ public static DecimalStyle of(Locale locale) {
+ Objects.requireNonNull(locale, "locale");
+@@ -340,7 +339,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Checks if this DecimalStyle is equal another DecimalStyle.
++ * Checks if this DecimalStyle is equal to another DecimalStyle.
+ *
+ * @param obj the object to check, null returns false
+ * @return true if this is equal to the other date
+--- ./jdk/src/share/classes/java/time/package-info.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/package-info.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -65,7 +65,7 @@
+ * The main API for dates, times, instants, and durations.
+ * </p>
+ * <p>
+- * The classes defined here represent the principal date-time concepts,
++ * The classes defined here represent the principle date-time concepts,
+ * including instants, durations, dates, times, time-zones and periods.
+ * They are based on the ISO calendar system, which is the <i>de facto</i> world
+ * calendar following the proleptic Gregorian rules.
+@@ -120,9 +120,10 @@
+ *
+ * <h3>Duration and Period</h3>
+ * <p>
+- * Beyond dates and times, the API also allows the storage of period and durations of time.
++ * Beyond dates and times, the API also allows the storage of periods and durations of time.
+ * A {@link java.time.Duration} is a simple measure of time along the time-line in nanoseconds.
+- * A {@link java.time.Period} expresses an amount of time in units meaningful to humans, such as years or hours.
++ * A {@link java.time.Period} expresses an amount of time in units meaningful
++ * to humans, such as years or days.
+ * </p>
+ *
+ * <h3>Additional value types</h3>
+@@ -247,8 +248,8 @@
+ * </ul>
+ * <p>
+ * Multiple calendar systems is an awkward addition to the design challenges.
+- * The first principal is that most users want the standard ISO calendar system.
+- * As such, the main classes are ISO-only. The second principal is that most of those that want a
++ * The first principle is that most users want the standard ISO calendar system.
++ * As such, the main classes are ISO-only. The second principle is that most of those that want a
+ * non-ISO calendar system want it for user interaction, thus it is a UI localization issue.
+ * As such, date and time objects should be held as ISO objects in the data model and persistent
+ * storage, only being converted to and from a local calendar for display.
+--- ./jdk/src/share/classes/java/time/temporal/IsoFields.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/temporal/IsoFields.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -638,7 +638,7 @@
+
+ //-----------------------------------------------------------------------
+ /**
+- * Implementation of the period unit.
++ * Implementation of the unit.
+ */
+ private static enum Unit implements TemporalUnit {
+
+--- ./jdk/src/share/classes/java/time/temporal/Temporal.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/temporal/Temporal.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -157,7 +157,8 @@
+ * This adjusts this date-time according to the rules of the specified adjuster.
+ * A simple adjuster might simply set the one of the fields, such as the year field.
+ * A more complex adjuster might set the date to the last day of the month.
+- * A selection of common adjustments is provided in {@link TemporalAdjuster}.
++ * A selection of common adjustments is provided in
++ * {@link java.time.temporal.TemporalAdjusters TemporalAdjusters}.
+ * These include finding the "last day of the month" and "next Wednesday".
+ * The adjuster is responsible for handling special cases, such as the varying
+ * lengths of month and leap years.
+@@ -287,7 +288,7 @@
+ * This provides equivalent, safe behavior for immutable and mutable implementations.
+ *
+ * @param amountToAdd the amount of the specified unit to add, may be negative
+- * @param unit the unit of the period to add, not null
++ * @param unit the unit of the amount to add, not null
+ * @return an object of the same type with the specified period added, not null
+ * @throws DateTimeException if the unit cannot be added
+ * @throws UnsupportedTemporalTypeException if the unit is not supported
+@@ -359,7 +360,7 @@
+ * </pre>
+ *
+ * @param amountToSubtract the amount of the specified unit to subtract, may be negative
+- * @param unit the unit of the period to subtract, not null
++ * @param unit the unit of the amount to subtract, not null
+ * @return an object of the same type with the specified period subtracted, not null
+ * @throws DateTimeException if the unit cannot be subtracted
+ * @throws UnsupportedTemporalTypeException if the unit is not supported
+@@ -378,12 +379,12 @@
+ * The start and end points are {@code this} and the specified temporal.
+ * The end point is converted to be of the same type as the start point if different.
+ * The result will be negative if the end is before the start.
+- * For example, the period in hours between two temporal objects can be
++ * For example, the amount in hours between two temporal objects can be
+ * calculated using {@code startTime.until(endTime, HOURS)}.
+ * <p>
+ * The calculation returns a whole number, representing the number of
+ * complete units between the two temporals.
+- * For example, the period in hours between the times 11:30 and 13:29
++ * For example, the amount in hours between the times 11:30 and 13:29
+ * will only be one hour as it is one minute short of two hours.
+ * <p>
+ * There are two equivalent ways of using this method.
+--- ./jdk/src/share/classes/java/time/temporal/TemporalAccessor.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/temporal/TemporalAccessor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -180,7 +180,7 @@
+ /**
+ * Gets the value of the specified field as an {@code int}.
+ * <p>
+- * This queries the date-time for the value for the specified field.
++ * This queries the date-time for the value of the specified field.
+ * The returned value will always be within the valid range of values for the field.
+ * If the date-time cannot return the value, because the field is unsupported or for
+ * some other reason, an exception will be thrown.
+@@ -229,7 +229,7 @@
+ /**
+ * Gets the value of the specified field as a {@code long}.
+ * <p>
+- * This queries the date-time for the value for the specified field.
++ * This queries the date-time for the value of the specified field.
+ * The returned value may be outside the valid range of values for the field.
+ * If the date-time cannot return the value, because the field is unsupported or for
+ * some other reason, an exception will be thrown.
+--- ./jdk/src/share/classes/java/time/temporal/TemporalField.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/temporal/TemporalField.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -116,7 +116,7 @@
+ * For example, in the field 'MonthOfYear', the unit is 'Months'.
+ * See also {@link #getRangeUnit()}.
+ *
+- * @return the period unit defining the base unit of the field, not null
++ * @return the unit defining the base unit of the field, not null
+ */
+ TemporalUnit getBaseUnit();
+
+@@ -130,7 +130,7 @@
+ * The range is never null. For example, the 'Year' field is shorthand for
+ * 'YearOfForever'. It therefore has a unit of 'Years' and a range of 'Forever'.
+ *
+- * @return the period unit defining the range of the field, not null
++ * @return the unit defining the range of the field, not null
+ */
+ TemporalUnit getRangeUnit();
+
+@@ -179,7 +179,7 @@
+ * Checks if this field is supported by the temporal object.
+ * <p>
+ * This determines whether the temporal accessor supports this field.
+- * If this returns false, the the temporal cannot be queried for this field.
++ * If this returns false, then the temporal cannot be queried for this field.
+ * <p>
+ * There are two equivalent ways of using this method.
+ * The first is to invoke this method directly.
+--- ./jdk/src/share/classes/java/time/temporal/TemporalUnit.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/temporal/TemporalUnit.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -221,7 +221,7 @@
+ * @param temporal the temporal object to adjust, not null
+ * @param amount the amount of this unit to add, positive or negative
+ * @return the adjusted temporal object, not null
+- * @throws DateTimeException if the period cannot be added
++ * @throws DateTimeException if the amount cannot be added
+ * @throws UnsupportedTemporalTypeException if the unit is not supported by the temporal
+ */
+ <R extends Temporal> R addTo(R temporal, long amount);
+--- ./jdk/src/share/classes/java/time/zone/ZoneOffsetTransition.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/time/zone/ZoneOffsetTransition.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -83,7 +83,7 @@
+ * The discontinuity is normally a gap in spring and an overlap in autumn.
+ * {@code ZoneOffsetTransition} models the transition between the two offsets.
+ * <p>
+- * Gaps occur where there are local date-times that simply do not not exist.
++ * Gaps occur where there are local date-times that simply do not exist.
+ * An example would be when the offset changes from {@code +03:00} to {@code +04:00}.
+ * This might be described as 'the clocks will move forward one hour tonight at 1am'.
+ * <p>
+@@ -334,7 +334,7 @@
+ /**
+ * Does this transition represent a gap in the local time-line.
+ * <p>
+- * Gaps occur where there are local date-times that simply do not not exist.
++ * Gaps occur where there are local date-times that simply do not exist.
+ * An example would be when the offset changes from {@code +01:00} to {@code +02:00}.
+ * This might be described as 'the clocks will move forward one hour tonight at 1am'.
+ *
+--- ./jdk/src/share/classes/java/util/Calendar.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/Calendar.java Wed Jul 01 21:53:30 2015 -0700
+@@ -2083,17 +2083,33 @@
+ return null;
+ }
+
++ String calendarType = getCalendarType();
++ int fieldValue = get(field);
+ // the standalone and narrow styles are supported only through CalendarDataProviders.
+- if (isStandaloneStyle(style) || isNarrowStyle(style)) {
+- return CalendarDataUtility.retrieveFieldValueName(getCalendarType(),
+- field, get(field),
+- style, locale);
++ if (isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
++ String val = CalendarDataUtility.retrieveFieldValueName(calendarType,
++ field, fieldValue,
++ style, locale);
++ // Perform fallback here to follow the CLDR rules
++ if (val == null) {
++ if (isNarrowFormatStyle(style)) {
++ val = CalendarDataUtility.retrieveFieldValueName(calendarType,
++ field, fieldValue,
++ toStandaloneStyle(style),
++ locale);
++ } else if (isStandaloneStyle(style)) {
++ val = CalendarDataUtility.retrieveFieldValueName(calendarType,
++ field, fieldValue,
++ getBaseStyle(style),
++ locale);
++ }
++ }
++ return val;
+ }
+
+ DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
+ String[] strings = getFieldStrings(field, style, symbols);
+ if (strings != null) {
+- int fieldValue = get(field);
+ if (fieldValue < strings.length) {
+ return strings[fieldValue];
+ }
+@@ -2155,10 +2171,26 @@
+ ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
+ return null;
+ }
+- if (style == ALL_STYLES || isStandaloneStyle(style)) {
+- return CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
++
++ String calendarType = getCalendarType();
++ if (style == ALL_STYLES || isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
++ Map<String, Integer> map;
++ map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field, style, locale);
++
++ // Perform fallback here to follow the CLDR rules
++ if (map == null) {
++ if (isNarrowFormatStyle(style)) {
++ map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
++ toStandaloneStyle(style), locale);
++ } else if (style != ALL_STYLES) {
++ map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
++ getBaseStyle(style), locale);
++ }
++ }
++ return map;
+ }
+- // SHORT, LONG, or NARROW
++
++ // SHORT or LONG
+ return getDisplayNamesImpl(field, style, locale);
+ }
+
+@@ -2544,14 +2576,22 @@
+ return style & ~STANDALONE_MASK;
+ }
+
+- boolean isStandaloneStyle(int style) {
++ private int toStandaloneStyle(int style) {
++ return style | STANDALONE_MASK;
++ }
++
++ private boolean isStandaloneStyle(int style) {
+ return (style & STANDALONE_MASK) != 0;
+ }
+
+- boolean isNarrowStyle(int style) {
++ private boolean isNarrowStyle(int style) {
+ return style == NARROW_FORMAT || style == NARROW_STANDALONE;
+ }
+
++ private boolean isNarrowFormatStyle(int style) {
++ return style == NARROW_FORMAT;
++ }
++
+ /**
+ * Returns the pseudo-time-stamp for two fields, given their
+ * individual pseudo-time-stamps. If either of the fields
+--- ./jdk/src/share/classes/java/util/ComparableTimSort.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/ComparableTimSort.java Wed Jul 01 21:53:30 2015 -0700
+@@ -144,10 +144,14 @@
+ * large) stack lengths for smaller arrays. The "magic numbers" in the
+ * computation below must be changed if MIN_MERGE is decreased. See
+ * the MIN_MERGE declaration above for more information.
++ * The maximum value of 49 allows for an array up to length
++ * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
++ * increasing scenario. More explanations are given in section 4 of:
++ * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
+ */
+ int stackLen = (len < 120 ? 5 :
+ len < 1542 ? 10 :
+- len < 119151 ? 24 : 40);
++ len < 119151 ? 24 : 49);
+ runBase = new int[stackLen];
+ runLen = new int[stackLen];
+ }
+--- ./jdk/src/share/classes/java/util/Currency.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/Currency.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -139,11 +139,11 @@
+ // - maps country code to 32-bit int
+ // - 26*26 entries, corresponding to [A-Z]*[A-Z]
+ // - \u007F -> not valid country
+- // - bits 18-31: unused
+- // - bits 8-17: numeric code (0 to 1023)
+- // - bit 7: 1 - special case, bits 0-4 indicate which one
++ // - bits 20-31: unused
++ // - bits 10-19: numeric code (0 to 1023)
++ // - bit 9: 1 - special case, bits 0-4 indicate which one
+ // 0 - simple country, bits 0-4 indicate final char of currency code
+- // - bits 5-6: fraction digits for simple countries, 0 for special cases
++ // - bits 5-8: fraction digits for simple countries, 0 for special cases
+ // - bits 0-4: final char for currency code for simple country, or ID of special case
+ // - special case IDs:
+ // - 0: country has no currency
+@@ -181,32 +181,34 @@
+ // number of characters from A to Z
+ private static final int A_TO_Z = ('Z' - 'A') + 1;
+ // entry for invalid country codes
+- private static final int INVALID_COUNTRY_ENTRY = 0x007F;
++ private static final int INVALID_COUNTRY_ENTRY = 0x0000007F;
+ // entry for countries without currency
+- private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x0080;
++ private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x00000200;
+ // mask for simple case country entries
+- private static final int SIMPLE_CASE_COUNTRY_MASK = 0x0000;
++ private static final int SIMPLE_CASE_COUNTRY_MASK = 0x00000000;
+ // mask for simple case country entry final character
+- private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x001F;
++ private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x0000001F;
+ // mask for simple case country entry default currency digits
+- private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x0060;
++ private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x000001E0;
+ // shift count for simple case country entry default currency digits
+ private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_SHIFT = 5;
++ // maximum number for simple case country entry default currency digits
++ private static final int SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS = 9;
+ // mask for special case country entries
+- private static final int SPECIAL_CASE_COUNTRY_MASK = 0x0080;
++ private static final int SPECIAL_CASE_COUNTRY_MASK = 0x00000200;
+ // mask for special case country index
+- private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x001F;
++ private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x0000001F;
+ // delta from entry index component in main table to index into special case tables
+ private static final int SPECIAL_CASE_COUNTRY_INDEX_DELTA = 1;
+ // mask for distinguishing simple and special case countries
+ private static final int COUNTRY_TYPE_MASK = SIMPLE_CASE_COUNTRY_MASK | SPECIAL_CASE_COUNTRY_MASK;
+ // mask for the numeric code of the currency
+- private static final int NUMERIC_CODE_MASK = 0x0003FF00;
++ private static final int NUMERIC_CODE_MASK = 0x000FFC00;
+ // shift count for the numeric code of the currency
+- private static final int NUMERIC_CODE_SHIFT = 8;
++ private static final int NUMERIC_CODE_SHIFT = 10;
+
+ // Currency data format version
+- private static final int VALID_FORMAT_VERSION = 1;
++ private static final int VALID_FORMAT_VERSION = 2;
+
+ static {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+@@ -261,7 +263,7 @@
+ Set<String> keys = props.stringPropertyNames();
+ Pattern propertiesPattern =
+ Pattern.compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*" +
+- "([0-3])\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
++ "(\\d+)\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
+ "\\d{2}:\\d{2})?");
+ for (String key : keys) {
+ replaceCurrencyData(propertiesPattern,
+@@ -682,7 +684,7 @@
+ * @param ctry country code
+ * @param curdata currency data. This is a comma separated string that
+ * consists of "three-letter alphabet code", "three-digit numeric code",
+- * and "one-digit (0,1,2, or 3) default fraction digit".
++ * and "one-digit (0-9) default fraction digit".
+ * For example, "JPZ,392,0".
+ * An optional UTC date can be appended to the string (comma separated)
+ * to allow a currency change take effect after date specified.
+@@ -721,8 +723,14 @@
+
+ String code = m.group(1);
+ int numeric = Integer.parseInt(m.group(2));
++ int entry = numeric << NUMERIC_CODE_SHIFT;
+ int fraction = Integer.parseInt(m.group(3));
+- int entry = numeric << NUMERIC_CODE_SHIFT;
++ if (fraction > SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS) {
++ info("currency.properties entry for " + ctry +
++ " ignored since the fraction is more than " +
++ SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS + ":" + curdata, null);
++ return;
++ }
+
+ int index;
+ for (index = 0; index < scOldCurrencies.length; index++) {
+--- ./jdk/src/share/classes/java/util/CurrencyData.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/CurrencyData.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -23,7 +23,10 @@
+ # questions.
+ #
+
+-formatVersion=1
++# Version of the currency data format.
++# 1: initial
++# 2: Change in minor unit (allowing 4-9 digits)
++formatVersion=2
+
+ # Version of the currency code information in this class.
+ # It is a serial number that accompanies with each amendment.
+@@ -36,7 +39,7 @@
+ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036-\
+ AWG533-AYM945-AZM031-AZN944-BAM977-BBD052-BDT050-BEF056-BGL100-BGN975-BHD048-BIF108-\
+ BMD060-BND096-BOB068-BOV984-BRL986-BSD044-BTN064-BWP072-BYB112-BYR974-\
+- BZD084-CAD124-CDF976-CHF756-CLF990-CLP152-CNY156-COP170-CRC188-CSD891-CUP192-CUC931-\
++ BZD084-CAD124-CDF976-CHE947-CHF756-CHW948-CLF990-CLP152-CNY156-COP170-COU970-CRC188-CSD891-CUP192-CUC931-\
+ CVE132-CYP196-CZK203-DEM276-DJF262-DKK208-DOP214-DZD012-EEK233-EGP818-\
+ ERN232-ESP724-ETB230-EUR978-FIM246-FJD242-FKP238-FRF250-GBP826-GEL981-\
+ GHC288-GHS936-GIP292-GMD270-GNF324-GRD300-GTQ320-GWP624-GYD328-HKD344-HNL340-\
+@@ -49,7 +52,7 @@
+ PKR586-PLN985-PTE620-PYG600-QAR634-ROL946-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\
+ SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\
+ SRD968-SRG740-SSP728-STD678-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\
+- TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-\
++ TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
+ UYU858-UZS860-VEB862-VEF937-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\
+ XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\
+ XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZMW967-ZWD716-ZWL932-\
+@@ -579,16 +582,17 @@
+ ZW=ZWL
+
+
+-# List of currencies with 0, 1, OR 3 decimals for minor units, or where there
+-# are no minor units defined. All others use 2 decimals.
++# List of currencies with non-2digit decimals for minor units,
++# or where there are no minor units defined. All others use 2 decimals.
+
+ minor0=\
+- ADP-BEF-BIF-BYB-BYR-CLF-CLP-DJF-ESP-GNF-\
++ ADP-BEF-BIF-BYB-BYR-CLP-DJF-ESP-GNF-\
+ GRD-ISK-ITL-JPY-KMF-KRW-LUF-MGF-PYG-PTE-RWF-\
+- TPE-TRL-UGX-VND-VUV-XAF-XOF-XPF
+-minor1=
++ TPE-TRL-UGX-UYI-VND-VUV-XAF-XOF-XPF
+ minor3=\
+ BHD-IQD-JOD-KWD-LYD-OMR-TND
++minor4=\
++ CLF
+ minorUndefined=\
+ XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-\
+ XPT-XSU-XTS-XUA-XXX
+--- ./jdk/src/share/classes/java/util/TimSort.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/TimSort.java Wed Jul 01 21:53:30 2015 -0700
+@@ -174,10 +174,14 @@
+ * large) stack lengths for smaller arrays. The "magic numbers" in the
+ * computation below must be changed if MIN_MERGE is decreased. See
+ * the MIN_MERGE declaration above for more information.
++ * The maximum value of 49 allows for an array up to length
++ * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
++ * increasing scenario. More explanations are given in section 4 of:
++ * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
+ */
+ int stackLen = (len < 120 ? 5 :
+ len < 1542 ? 10 :
+- len < 119151 ? 24 : 40);
++ len < 119151 ? 24 : 49);
+ runBase = new int[stackLen];
+ runLen = new int[stackLen];
+ }
+--- ./jdk/src/share/classes/java/util/concurrent/CompletableFuture.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/concurrent/CompletableFuture.java Wed Jul 01 21:53:30 2015 -0700
+@@ -978,7 +978,15 @@
+ }
+ try {
+ @SuppressWarnings("unchecked") T t = (T) r;
+- return f.apply(t).toCompletableFuture();
++ CompletableFuture<V> g = f.apply(t).toCompletableFuture();
++ Object s = g.result;
++ if (s != null)
++ return new CompletableFuture<V>(encodeRelay(s));
++ CompletableFuture<V> d = new CompletableFuture<V>();
++ UniRelay<V> copy = new UniRelay<V>(d, g);
++ g.push(copy);
++ copy.tryFire(SYNC);
++ return d;
+ } catch (Throwable ex) {
+ return new CompletableFuture<V>(encodeThrowable(ex));
+ }
+--- ./jdk/src/share/classes/java/util/concurrent/ForkJoinPool.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/concurrent/ForkJoinPool.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1323,13 +1323,16 @@
+ /**
+ * Number of times to spin-wait before blocking. The spins (in
+ * awaitRunStateLock and awaitWork) currently use randomized
+- * spins. If/when MWAIT-like intrinsics becomes available, they
+- * may allow quieter spinning. The value of SPINS must be a power
+- * of two, at least 4. The current value causes spinning for a
+- * small fraction of typical context-switch times, well worthwhile
+- * given the typical likelihoods that blocking is not necessary.
++ * spins. Currently set to zero to reduce CPU usage.
++ *
++ * If greater than zero the value of SPINS must be a power
++ * of two, at least 4. A value of 2048 causes spinning for a
++ * small fraction of typical context-switch times.
++ *
++ * If/when MWAIT-like intrinsics becomes available, they
++ * may allow quieter spinning.
+ */
+- private static final int SPINS = 1 << 11;
++ private static final int SPINS = 0;
+
+ /**
+ * Increment for seed generators. See class ThreadLocal for
+@@ -2406,7 +2409,7 @@
+ int j = ((am & s) << ASHIFT) + ABASE;
+ U.putOrderedObject(a, j, task);
+ U.putOrderedInt(q, QTOP, s + 1);
+- U.putOrderedInt(q, QLOCK, 0);
++ U.putIntVolatile(q, QLOCK, 0);
+ if (n <= 1)
+ signalWork(ws, q);
+ return;
+--- ./jdk/src/share/classes/java/util/concurrent/LinkedTransferQueue.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/concurrent/LinkedTransferQueue.java Wed Jul 01 21:53:30 2015 -0700
+@@ -780,7 +780,9 @@
+ }
+
+ /**
+- * Version of firstOfMode used by Spliterator
++ * Version of firstOfMode used by Spliterator. Callers must
++ * recheck if the returned node's item field is null or
++ * self-linked before using.
+ */
+ final Node firstDataNode() {
+ for (Node p = head; p != null;) {
+@@ -953,11 +955,12 @@
+ Object[] a = new Object[n];
+ int i = 0;
+ do {
+- if ((a[i] = p.item) != null)
++ Object e = p.item;
++ if (e != p && (a[i] = e) != null)
+ ++i;
+ if (p == (p = p.next))
+ p = q.firstDataNode();
+- } while (p != null && i < n);
++ } while (p != null && i < n && p.isData);
+ if ((current = p) == null)
+ exhausted = true;
+ if (i > 0) {
+@@ -980,11 +983,11 @@
+ exhausted = true;
+ do {
+ Object e = p.item;
++ if (e != null && e != p)
++ action.accept((E)e);
+ if (p == (p = p.next))
+ p = q.firstDataNode();
+- if (e != null)
+- action.accept((E)e);
+- } while (p != null);
++ } while (p != null && p.isData);
+ }
+ }
+
+@@ -997,10 +1000,11 @@
+ ((p = current) != null || (p = q.firstDataNode()) != null)) {
+ Object e;
+ do {
+- e = p.item;
++ if ((e = p.item) == p)
++ e = null;
+ if (p == (p = p.next))
+ p = q.firstDataNode();
+- } while (e == null && p != null);
++ } while (e == null && p != null && p.isData);
+ if ((current = p) == null)
+ exhausted = true;
+ if (e != null) {
+--- ./jdk/src/share/classes/java/util/stream/AbstractPipeline.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/stream/AbstractPipeline.java Wed Jul 01 21:53:30 2015 -0700
+@@ -249,6 +249,11 @@
+ // If the last intermediate operation is stateful then
+ // evaluate directly to avoid an extra collection step
+ if (isParallel() && previousStage != null && opIsStateful()) {
++ // Set the depth of this, last, pipeline stage to zero to slice the
++ // pipeline such that this operation will not be included in the
++ // upstream slice and upstream operations will not be included
++ // in this slice
++ depth = 0;
+ return opEvaluateParallel(previousStage, previousStage.sourceSpliterator(0), generator);
+ }
+ else {
+@@ -379,60 +384,6 @@
+ }
+
+ /**
+- * Prepare the pipeline for a parallel execution. As the pipeline is built,
+- * the flags and depth indicators are set up for a sequential execution.
+- * If the execution is parallel, and there are any stateful operations, then
+- * some of these need to be adjusted, as well as adjusting for flags from
+- * the terminal operation (such as back-propagating UNORDERED).
+- * Need not be called for a sequential execution.
+- *
+- * @param terminalFlags Operation flags for the terminal operation
+- */
+- private void parallelPrepare(int terminalFlags) {
+- @SuppressWarnings("rawtypes")
+- AbstractPipeline backPropagationHead = sourceStage;
+- if (sourceStage.sourceAnyStateful) {
+- int depth = 1;
+- for ( @SuppressWarnings("rawtypes") AbstractPipeline u = sourceStage, p = sourceStage.nextStage;
+- p != null;
+- u = p, p = p.nextStage) {
+- int thisOpFlags = p.sourceOrOpFlags;
+- if (p.opIsStateful()) {
+- // If the stateful operation is a short-circuit operation
+- // then move the back propagation head forwards
+- // NOTE: there are no size-injecting ops
+- if (StreamOpFlag.SHORT_CIRCUIT.isKnown(thisOpFlags)) {
+- backPropagationHead = p;
+- // Clear the short circuit flag for next pipeline stage
+- // This stage encapsulates short-circuiting, the next
+- // stage may not have any short-circuit operations, and
+- // if so spliterator.forEachRemaining should be be used
+- // for traversal
+- thisOpFlags = thisOpFlags & ~StreamOpFlag.IS_SHORT_CIRCUIT;
+- }
+-
+- depth = 0;
+- // The following injects size, it is equivalent to:
+- // StreamOpFlag.combineOpFlags(StreamOpFlag.IS_SIZED, p.combinedFlags);
+- thisOpFlags = (thisOpFlags & ~StreamOpFlag.NOT_SIZED) | StreamOpFlag.IS_SIZED;
+- }
+- p.depth = depth++;
+- p.combinedFlags = StreamOpFlag.combineOpFlags(thisOpFlags, u.combinedFlags);
+- }
+- }
+-
+- // Apply the upstream terminal flags
+- if (terminalFlags != 0) {
+- int upstreamTerminalFlags = terminalFlags & StreamOpFlag.UPSTREAM_TERMINAL_OP_MASK;
+- for ( @SuppressWarnings("rawtypes") AbstractPipeline p = backPropagationHead; p.nextStage != null; p = p.nextStage) {
+- p.combinedFlags = StreamOpFlag.combineOpFlags(upstreamTerminalFlags, p.combinedFlags);
+- }
+-
+- combinedFlags = StreamOpFlag.combineOpFlags(terminalFlags, combinedFlags);
+- }
+- }
+-
+- /**
+ * Get the source spliterator for this pipeline stage. For a sequential or
+ * stateless parallel pipeline, this is the source spliterator. For a
+ * stateful parallel pipeline, this is a spliterator describing the results
+@@ -455,31 +406,49 @@
+ throw new IllegalStateException(MSG_CONSUMED);
+ }
+
+- if (isParallel()) {
+- // @@@ Merge parallelPrepare with the loop below and use the
+- // spliterator characteristics to determine if SIZED
+- // should be injected
+- parallelPrepare(terminalFlags);
+-
++ if (isParallel() && sourceStage.sourceAnyStateful) {
+ // Adapt the source spliterator, evaluating each stateful op
+- // in the pipeline up to and including this pipeline stage
+- for ( @SuppressWarnings("rawtypes") AbstractPipeline u = sourceStage, p = sourceStage.nextStage, e = this;
++ // in the pipeline up to and including this pipeline stage.
++ // The depth and flags of each pipeline stage are adjusted accordingly.
++ int depth = 1;
++ for (@SuppressWarnings("rawtypes") AbstractPipeline u = sourceStage, p = sourceStage.nextStage, e = this;
+ u != e;
+ u = p, p = p.nextStage) {
+
++ int thisOpFlags = p.sourceOrOpFlags;
+ if (p.opIsStateful()) {
++ depth = 0;
++
++ if (StreamOpFlag.SHORT_CIRCUIT.isKnown(thisOpFlags)) {
++ // Clear the short circuit flag for next pipeline stage
++ // This stage encapsulates short-circuiting, the next
++ // stage may not have any short-circuit operations, and
++ // if so spliterator.forEachRemaining should be used
++ // for traversal
++ thisOpFlags = thisOpFlags & ~StreamOpFlag.IS_SHORT_CIRCUIT;
++ }
++
+ spliterator = p.opEvaluateParallelLazy(u, spliterator);
++
++ // Inject or clear SIZED on the source pipeline stage
++ // based on the stage's spliterator
++ thisOpFlags = spliterator.hasCharacteristics(Spliterator.SIZED)
++ ? (thisOpFlags & ~StreamOpFlag.NOT_SIZED) | StreamOpFlag.IS_SIZED
++ : (thisOpFlags & ~StreamOpFlag.IS_SIZED) | StreamOpFlag.NOT_SIZED;
+ }
++ p.depth = depth++;
++ p.combinedFlags = StreamOpFlag.combineOpFlags(thisOpFlags, u.combinedFlags);
+ }
+ }
+- else if (terminalFlags != 0) {
++
++ if (terminalFlags != 0) {
++ // Apply flags from the terminal operation to last pipeline stage
+ combinedFlags = StreamOpFlag.combineOpFlags(terminalFlags, combinedFlags);
+ }
+
+ return spliterator;
+ }
+
+-
+ // PipelineHelper
+
+ @Override
+--- ./jdk/src/share/classes/java/util/zip/ZipEntry.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/zip/ZipEntry.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1995, 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
+@@ -41,7 +41,9 @@
+ class ZipEntry implements ZipConstants, Cloneable {
+
+ String name; // entry name
+- long time = -1; // last modification time
++ long xdostime = -1; // last modification time (in extended DOS time,
++ // where milliseconds lost in conversion might
++ // be encoded into the upper half)
+ FileTime mtime; // last modification time, from extra field data
+ FileTime atime; // last access time, from extra field data
+ FileTime ctime; // creation time, from extra field data
+@@ -64,6 +66,28 @@
+ public static final int DEFLATED = 8;
+
+ /**
++ * DOS time constant for representing timestamps before 1980.
++ */
++ static final long DOSTIME_BEFORE_1980 = (1 << 21) | (1 << 16);
++
++ /**
++ * Approximately 128 years, in milliseconds (ignoring leap years etc).
++ *
++ * This establish an approximate high-bound value for DOS times in
++ * milliseconds since epoch, used to enable an efficient but
++ * sufficient bounds check to avoid generating extended last modified
++ * time entries.
++ *
++ * Calculating the exact number is locale dependent, would require loading
++ * TimeZone data eagerly, and would make little practical sense. Since DOS
++ * times theoretically go to 2107 - with compatibility not guaranteed
++ * after 2099 - setting this to a time that is before but near 2099
++ * should be sufficient.
++ */
++ private static final long UPPER_DOSTIME_BOUND =
++ 128L * 365 * 24 * 60 * 60 * 1000;
++
++ /**
+ * Creates a new zip entry with the specified name.
+ *
+ * @param name
+@@ -93,7 +117,7 @@
+ public ZipEntry(ZipEntry e) {
+ Objects.requireNonNull(e, "entry");
+ name = e.name;
+- time = e.time;
++ xdostime = e.xdostime;
+ mtime = e.mtime;
+ atime = e.atime;
+ ctime = e.ctime;
+@@ -137,8 +161,14 @@
+ * @see #getLastModifiedTime()
+ */
+ public void setTime(long time) {
+- this.time = time;
+- this.mtime = null;
++ this.xdostime = javaToExtendedDosTime(time);
++ // Avoid setting the mtime field if time is in the valid
++ // range for a DOS time
++ if (xdostime != DOSTIME_BEFORE_1980 && time <= UPPER_DOSTIME_BOUND) {
++ this.mtime = null;
++ } else {
++ this.mtime = FileTime.from(time, TimeUnit.MILLISECONDS);
++ }
+ }
+
+ /**
+@@ -158,7 +188,10 @@
+ * @see #setLastModifiedTime(FileTime)
+ */
+ public long getTime() {
+- return time;
++ if (mtime != null) {
++ return mtime.toMillis();
++ }
++ return (xdostime != -1) ? extendedDosToJavaTime(xdostime) : -1;
+ }
+
+ /**
+@@ -180,9 +213,8 @@
+ * @since 1.8
+ */
+ public ZipEntry setLastModifiedTime(FileTime time) {
+- Objects.requireNonNull(name, "time");
+- this.mtime = time;
+- this.time = time.to(TimeUnit.MILLISECONDS);
++ this.mtime = Objects.requireNonNull(time, "lastModifiedTime");
++ this.xdostime = javaToExtendedDosTime(time.to(TimeUnit.MILLISECONDS));
+ return this;
+ }
+
+@@ -205,9 +237,9 @@
+ public FileTime getLastModifiedTime() {
+ if (mtime != null)
+ return mtime;
+- if (time == -1)
++ if (xdostime == -1)
+ return null;
+- return FileTime.from(time, TimeUnit.MILLISECONDS);
++ return FileTime.from(getTime(), TimeUnit.MILLISECONDS);
+ }
+
+ /**
+@@ -227,8 +259,7 @@
+ * @since 1.8
+ */
+ public ZipEntry setLastAccessTime(FileTime time) {
+- Objects.requireNonNull(name, "time");
+- this.atime = time;
++ this.atime = Objects.requireNonNull(time, "lastAccessTime");
+ return this;
+ }
+
+@@ -265,8 +296,7 @@
+ * @since 1.8
+ */
+ public ZipEntry setCreationTime(FileTime time) {
+- Objects.requireNonNull(name, "time");
+- this.ctime = time;
++ this.ctime = Objects.requireNonNull(time, "creationTime");
+ return this;
+ }
+
+@@ -451,6 +481,8 @@
+ }
+ break;
+ case EXTID_NTFS:
++ if (sz < 32) // reserved 4 bytes + tag 2 bytes + size 2 bytes
++ break; // m[a|c]time 24 bytes
+ int pos = off + 4; // reserved 4 bytes
+ if (get16(extra, pos) != 0x0001 || get16(extra, pos + 2) != 24)
+ break;
+--- ./jdk/src/share/classes/java/util/zip/ZipFile.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/zip/ZipFile.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1995, 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
+@@ -46,7 +46,6 @@
+ import java.util.stream.StreamSupport;
+
+ import static java.util.zip.ZipConstants64.*;
+-import static java.util.zip.ZipUtils.*;
+
+ /**
+ * This class is used to read entries from a zip file.
+@@ -567,7 +566,7 @@
+ e.name = zc.toString(bname, bname.length);
+ }
+ }
+- e.time = dosToJavaTime(getEntryTime(jzentry));
++ e.xdostime = getEntryTime(jzentry);
+ e.crc = getEntryCrc(jzentry);
+ e.size = getEntrySize(jzentry);
+ e.csize = getEntryCSize(jzentry);
+--- ./jdk/src/share/classes/java/util/zip/ZipInputStream.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/zip/ZipInputStream.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -303,7 +303,7 @@
+ throw new ZipException("encrypted ZIP entry not supported");
+ }
+ e.method = get16(tmpbuf, LOCHOW);
+- e.time = dosToJavaTime(get32(tmpbuf, LOCTIM));
++ e.xdostime = get32(tmpbuf, LOCTIM);
+ if ((flag & 8) == 8) {
+ /* "Data Descriptor" present */
+ if (e.method != DEFLATED) {
+--- ./jdk/src/share/classes/java/util/zip/ZipOutputStream.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/zip/ZipOutputStream.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -61,7 +61,6 @@
+ private static class XEntry {
+ final ZipEntry entry;
+ final long offset;
+- long dostime; // last modification time in msdos format
+ public XEntry(ZipEntry entry, long offset) {
+ this.entry = entry;
+ this.offset = offset;
+@@ -192,7 +191,7 @@
+ if (current != null) {
+ closeEntry(); // close previous entry
+ }
+- if (e.time == -1) {
++ if (e.xdostime == -1) {
+ // by default, do NOT use extended timestamps in extra
+ // data, for now.
+ e.setTime(System.currentTimeMillis());
+@@ -389,18 +388,12 @@
+ boolean hasZip64 = false;
+ int elen = getExtraLen(e.extra);
+
+- // keep a copy of dostime for writeCEN(), otherwise the tz
+- // sensitive local time entries in loc and cen might be
+- // different if the default tz get changed during writeLOC()
+- // and writeCEN()
+- xentry.dostime = javaToDosTime(e.time);
+-
+ writeInt(LOCSIG); // LOC header signature
+ if ((flag & 8) == 8) {
+ writeShort(version(e)); // version needed to extract
+ writeShort(flag); // general purpose bit flag
+ writeShort(e.method); // compression method
+- writeInt(xentry.dostime); // last modification time
++ writeInt(e.xdostime); // last modification time
+ // store size, uncompressed size, and crc-32 in data descriptor
+ // immediately following compressed entry data
+ writeInt(0);
+@@ -415,7 +408,7 @@
+ }
+ writeShort(flag); // general purpose bit flag
+ writeShort(e.method); // compression method
+- writeInt(xentry.dostime); // last modification time
++ writeInt(e.xdostime); // last modification time
+ writeInt(e.crc); // crc-32
+ if (hasZip64) {
+ writeInt(ZIP64_MAGICVAL);
+@@ -522,9 +515,7 @@
+ }
+ writeShort(flag); // general purpose bit flag
+ writeShort(e.method); // compression method
+- // use the copy in xentry, which has been converted
+- // from e.time in writeLOC()
+- writeInt(xentry.dostime); // last modification time
++ writeInt(e.xdostime); // last modification time
+ writeInt(e.crc); // crc-32
+ writeInt(csize); // compressed size
+ writeInt(size); // uncompressed size
+--- ./jdk/src/share/classes/java/util/zip/ZipUtils.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/java/util/zip/ZipUtils.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -29,9 +29,6 @@
+ import java.util.Date;
+ import java.util.concurrent.TimeUnit;
+
+-import static java.util.zip.ZipConstants.*;
+-import static java.util.zip.ZipConstants64.*;
+-
+ class ZipUtils {
+
+ // used to adjust values between Windows and java epoch
+@@ -69,7 +66,7 @@
+ /**
+ * Converts DOS time to Java time (number of milliseconds since epoch).
+ */
+- public static long dosToJavaTime(long dtime) {
++ private static long dosToJavaTime(long dtime) {
+ @SuppressWarnings("deprecation") // Use of date constructor.
+ Date d = new Date((int)(((dtime >> 25) & 0x7f) + 80),
+ (int)(((dtime >> 21) & 0x0f) - 1),
+@@ -81,14 +78,26 @@
+ }
+
+ /**
++ * Converts extended DOS time to Java time, where up to 1999 milliseconds
++ * might be encoded into the upper half of the returned long.
++ *
++ * @param xdostime the extended DOS time value
++ * @return milliseconds since epoch
++ */
++ public static long extendedDosToJavaTime(long xdostime) {
++ long time = dosToJavaTime(xdostime);
++ return time + (xdostime >> 32);
++ }
++
++ /**
+ * Converts Java time to DOS time.
+ */
+ @SuppressWarnings("deprecation") // Use of date methods
+- public static long javaToDosTime(long time) {
++ private static long javaToDosTime(long time) {
+ Date d = new Date(time);
+ int year = d.getYear() + 1900;
+ if (year < 1980) {
+- return (1 << 21) | (1 << 16);
++ return ZipEntry.DOSTIME_BEFORE_1980;
+ }
+ return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
+ d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
+@@ -96,6 +105,23 @@
+ }
+
+ /**
++ * Converts Java time to DOS time, encoding any milliseconds lost
++ * in the conversion into the upper half of the returned long.
++ *
++ * @param time milliseconds since epoch
++ * @return DOS time with 2s remainder encoded into upper half
++ */
++ public static long javaToExtendedDosTime(long time) {
++ if (time < 0) {
++ return ZipEntry.DOSTIME_BEFORE_1980;
++ }
++ long dostime = javaToDosTime(time);
++ return (dostime != ZipEntry.DOSTIME_BEFORE_1980)
++ ? dostime + ((time % 2000) << 32)
++ : ZipEntry.DOSTIME_BEFORE_1980;
++ }
++
++ /**
+ * Fetches unsigned 16-bit value from byte array at specified offset.
+ * The bytes are assumed to be in Intel (little-endian) byte order.
+ */
+--- ./jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -25,8 +25,8 @@
+
+ package javax.crypto.spec;
+
+-import java.security.MessageDigest;
+ import java.security.spec.KeySpec;
++import java.util.Locale;
+ import javax.crypto.SecretKey;
+
+ /**
+@@ -195,7 +195,8 @@
+ if (this.algorithm.equalsIgnoreCase("TripleDES"))
+ return (retval ^= "desede".hashCode());
+ else
+- return (retval ^= this.algorithm.toLowerCase().hashCode());
++ return (retval ^=
++ this.algorithm.toLowerCase(Locale.ENGLISH).hashCode());
+ }
+
+ /**
+@@ -227,6 +228,6 @@
+
+ byte[] thatKey = ((SecretKey)obj).getEncoded();
+
+- return MessageDigest.isEqual(this.key, thatKey);
++ return java.util.Arrays.equals(this.key, thatKey);
+ }
+ }
+--- ./jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -225,7 +225,7 @@
+ }
+
+ public short readShort() throws IOException {
+- if (read(byteBuf, 0, 2) < 0) {
++ if (read(byteBuf, 0, 2) != 2) {
+ throw new EOFException();
+ }
+
+@@ -247,7 +247,7 @@
+ }
+
+ public int readInt() throws IOException {
+- if (read(byteBuf, 0, 4) < 0) {
++ if (read(byteBuf, 0, 4) != 4) {
+ throw new EOFException();
+ }
+
+--- ./jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java Wed Jul 01 21:53:30 2015 -0700
+@@ -141,12 +141,6 @@
+ if (connection == null) {
+ throw new IllegalArgumentException("Null connection");
+ }
+- if (Proxy.isProxyClass(connection.getClass())) {
+- if (MBeanServerInvocationHandler.class.isAssignableFrom(
+- Proxy.getInvocationHandler(connection).getClass())) {
+- throw new IllegalArgumentException("Wrapping MBeanServerInvocationHandler");
+- }
+- }
+ if (objectName == null) {
+ throw new IllegalArgumentException("Null object name");
+ }
+@@ -424,10 +418,6 @@
+ new Class<?>[] {Object.class})
+ && isLocal(proxy, method))
+ return true;
+- if (methodName.equals("finalize")
+- && method.getParameterTypes().length == 0) {
+- return true;
+- }
+ return false;
+ }
+
+@@ -463,9 +453,6 @@
+ connection + "[" + objectName + "])";
+ } else if (methodName.equals("hashCode")) {
+ return objectName.hashCode()+connection.hashCode();
+- } else if (methodName.equals("finalize")) {
+- // ignore the finalizer invocation via proxy
+- return null;
+ }
+
+ throw new RuntimeException("Unexpected method name: " + methodName);
+--- ./jdk/src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -32,6 +32,7 @@
+ import java.security.AccessControlContext;
+ import java.security.AccessController;
+ import java.security.Permission;
++import java.security.PermissionCollection;
+ import java.security.Permissions;
+ import java.security.PrivilegedAction;
+ import java.security.PrivilegedActionException;
+@@ -58,7 +59,6 @@
+ import com.sun.jmx.remote.util.ClassLogger;
+ import com.sun.jmx.remote.util.EnvHelp;
+ import com.sun.jmx.remote.util.OrderClassLoaders;
+-import javax.management.loading.ClassLoaderRepository;
+
+ /**
+ * <p>Implementation of the {@link RMIConnection} interface. User
+@@ -131,24 +131,20 @@
+
+ final ClassLoader dcl = defaultClassLoader;
+
+- ClassLoaderRepository repository = AccessController.doPrivileged(
+- new PrivilegedAction<ClassLoaderRepository>() {
+- public ClassLoaderRepository run() {
+- return mbeanServer.getClassLoaderRepository();
+- }
+- },
+- withPermissions(new MBeanPermission("*", "getClassLoaderRepository"))
+- );
+- this.classLoaderWithRepository = AccessController.doPrivileged(
+- new PrivilegedAction<ClassLoaderWithRepository>() {
+- public ClassLoaderWithRepository run() {
+- return new ClassLoaderWithRepository(
+- repository,
+- dcl);
+- }
+- },
+- withPermissions(new RuntimePermission("createClassLoader"))
+- );
++ this.classLoaderWithRepository =
++ AccessController.doPrivileged(
++ new PrivilegedAction<ClassLoaderWithRepository>() {
++ public ClassLoaderWithRepository run() {
++ return new ClassLoaderWithRepository(
++ mbeanServer.getClassLoaderRepository(),
++ dcl);
++ }
++ },
++
++ withPermissions( new MBeanPermission("*", "getClassLoaderRepository"),
++ new RuntimePermission("createClassLoader"))
++ );
++
+
+ this.defaultContextClassLoader =
+ AccessController.doPrivileged(
+@@ -1258,10 +1254,11 @@
+ if (serverTerminated) {
+ // we must not call fetchNotifs() if the server is
+ // terminated (timeout elapsed).
+- //
+- return new NotificationResult(0L, 0L,
+- new TargetedNotification[0]);
+-
++ // returns null to force the client to stop fetching
++ if (logger.debugOn()) logger.debug("fetchNotifications",
++ "The notification server has been closed, "
++ + "returns null to force the client to stop fetching");
++ return null;
+ }
+ final long csn = clientSequenceNumber;
+ final int mn = maxNotifications;
+--- ./jdk/src/share/classes/javax/script/Compilable.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/script/Compilable.java Wed Jul 01 21:53:30 2015 -0700
+@@ -42,7 +42,7 @@
+ *
+ * @param script The source of the script, represented as a <code>String</code>.
+ *
+- * @return An subclass of <code>CompiledScript</code> to be executed later using one
++ * @return An instance of a subclass of <code>CompiledScript</code> to be executed later using one
+ * of the <code>eval</code> methods of <code>CompiledScript</code>.
+ *
+ * @throws ScriptException if compilation fails.
+@@ -61,7 +61,7 @@
+ *
+ * @param script The reader from which the script source is obtained.
+ *
+- * @return An implementation of <code>CompiledScript</code> to be executed
++ * @return An instance of a subclass of <code>CompiledScript</code> to be executed
+ * later using one of its <code>eval</code> methods of <code>CompiledScript</code>.
+ *
+ * @throws ScriptException if compilation fails.
+--- ./jdk/src/share/classes/javax/script/ScriptEngineFactory.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/script/ScriptEngineFactory.java Wed Jul 01 21:53:30 2015 -0700
+@@ -85,7 +85,7 @@
+ public List<String> getNames();
+
+ /**
+- * Returns the name of the scripting langauge supported by this
++ * Returns the name of the scripting language supported by this
+ * <code>ScriptEngine</code>.
+ * @return The name of the supported language.
+ */
+@@ -104,14 +104,15 @@
+ * <ul>
+ * <li>ScriptEngine.ENGINE</li>
+ * <li>ScriptEngine.ENGINE_VERSION</li>
+- * <li>ScriptEngine.NAME</li>
+ * <li>ScriptEngine.LANGUAGE</li>
+ * <li>ScriptEngine.LANGUAGE_VERSION</li>
++ * <li>ScriptEngine.NAME</li>
+ * </ul>
+ * <p>
+ * The values for these keys are the Strings returned by <code>getEngineName</code>,
+- * <code>getEngineVersion</code>, <code>getName</code>, <code>getLanguageName</code> and
+- * <code>getLanguageVersion</code> respectively.<br><br>
++ * <code>getEngineVersion</code>, <code>getLanguageName</code>,
++ * <code>getLanguageVersion</code> for the first four keys respectively. For NAME, one of the Strings
++ * returned by <code>getNames</code> is returned.<br><br>
+ * A reserved key, <code><b>THREADING</b></code>, whose value describes the behavior of the engine
+ * with respect to concurrent execution of scripts and maintenance of state is also defined.
+ * These values for the <code><b>THREADING</b></code> key are:<br><br>
+--- ./jdk/src/share/classes/javax/script/SimpleScriptContext.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/script/SimpleScriptContext.java Wed Jul 01 21:53:30 2015 -0700
+@@ -140,6 +140,7 @@
+ * @throws IllegalArgumentException if the name is empty.
+ */
+ public Object getAttribute(String name) {
++ checkName(name);
+ if (engineScope.containsKey(name)) {
+ return getAttribute(name, ENGINE_SCOPE);
+ } else if (globalScope != null && globalScope.containsKey(name)) {
+@@ -162,7 +163,7 @@
+ * @throws NullPointerException if the name is null.
+ */
+ public Object getAttribute(String name, int scope) {
+-
++ checkName(name);
+ switch (scope) {
+
+ case ENGINE_SCOPE:
+@@ -191,7 +192,7 @@
+ * @throws NullPointerException if the name is null.
+ */
+ public Object removeAttribute(String name, int scope) {
+-
++ checkName(name);
+ switch (scope) {
+
+ case ENGINE_SCOPE:
+@@ -223,7 +224,7 @@
+ * @throws NullPointerException if the name is null.
+ */
+ public void setAttribute(String name, Object value, int scope) {
+-
++ checkName(name);
+ switch (scope) {
+
+ case ENGINE_SCOPE:
+@@ -281,6 +282,7 @@
+ * @throws IllegalArgumentException if name is empty.
+ */
+ public int getAttributesScope(String name) {
++ checkName(name);
+ if (engineScope.containsKey(name)) {
+ return ENGINE_SCOPE;
+ } else if (globalScope != null && globalScope.containsKey(name)) {
+@@ -314,6 +316,13 @@
+ return scopes;
+ }
+
++ private void checkName(String name) {
++ Objects.requireNonNull(name);
++ if (name.isEmpty()) {
++ throw new IllegalArgumentException("name cannot be empty");
++ }
++ }
++
+ private static List<Integer> scopes;
+ static {
+ scopes = new ArrayList<Integer>(2);
+--- ./jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java Wed Jul 01 21:53:30 2015 -0700
+@@ -461,7 +461,7 @@
+ * <code>false</code> that it is not. The default is <code>true</code>.
+ * @serial
+ */
+- private boolean escapeProcessing;
++ private boolean escapeProcessing = true;
+
+ /**
+ * A constant indicating the isolation level of the connection
+--- ./jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 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
+@@ -48,6 +48,8 @@
+ * Therefore, any <code>RowSetMetaDataImpl</code> method that retrieves information
+ * is defined as having unspecified behavior when it is called
+ * before the <code>RowSet</code> object contains data.
++ *
++ * @since 1.5
+ */
+ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
+
+@@ -579,7 +581,7 @@
+ *
+ * @param columnIndex the first column is 1, the second is 2, and so on;
+ * must be between <code>1</code> and the number of columns, inclusive
+- * @return <code>true</code> if if a value in the designated column is a signed
++ * @return <code>true</code> if a value in the designated column is a signed
+ * number; <code>false</code> otherwise
+ * @throws SQLException if a database access error occurs
+ * or the given column number is out of bounds
+@@ -605,7 +607,7 @@
+ }
+
+ /**
+- * Retrieves the the suggested column title for the designated
++ * Retrieves the suggested column title for the designated
+ * column for use in printouts and displays.
+ *
+ * @param columnIndex the first column is 1, the second is 2, and so on;
+@@ -801,8 +803,10 @@
+ * @throws SQLException if a database access error occurs
+ * or the given column number is out of bounds
+ */
+- public boolean isDefinitelyWritable(int columnIndex)
+- throws SQLException { return true;}
++ public boolean isDefinitelyWritable(int columnIndex) throws SQLException {
++ checkColRange(columnIndex);
++ return true;
++ }
+
+ /**
+ * Retrieves the fully-qualified name of the class in the Java
+@@ -1071,7 +1075,7 @@
+ public int colType;
+
+ /**
+- * The field that holds the the type name used by this particular data source
++ * The field that holds the type name used by this particular data source
+ * for the value stored in this column.
+ *
+ * @serial
+@@ -1079,7 +1083,7 @@
+ public String colTypeName;
+
+ /**
+- * The field that holds the updatablity boolean per column of a RowSet
++ * The field that holds the updatability boolean per column of a RowSet
+ *
+ * @serial
+ */
+--- ./jdk/src/share/classes/javax/sql/rowset/RowSetWarning.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/sql/rowset/RowSetWarning.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 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
+@@ -50,15 +50,12 @@
+ * The inherited methods <code>getMessage</code>, <code>getSQLState</code>,
+ * and <code>getErrorCode</code> retrieve information contained in a
+ * <code>RowSetWarning</code> object.
++ *
++ * @since 1.5
+ */
+ public class RowSetWarning extends SQLException {
+
+ /**
+- * RowSetWarning object handle.
+- */
+- private RowSetWarning rwarning;
+-
+- /**
+ * Constructs a <code>RowSetWarning</code> object
+ * with the given value for the reason; SQLState defaults to null,
+ * and vendorCode defaults to 0.
+@@ -109,7 +106,7 @@
+ * @param reason a <code>String</code> giving a description of the
+ * warning;
+ * @param SQLState an XOPEN code identifying the warning; if a non standard
+- * XPOEN <i>SQLState</i> is supplied, no exception is thrown.
++ * XOPEN <i>SQLState</i> is supplied, no exception is thrown.
+ * @param vendorCode a database vendor-specific warning code
+ */
+ public RowSetWarning(java.lang.String reason, java.lang.String SQLState, int vendorCode) {
+@@ -126,7 +123,15 @@
+ * @see #setNextWarning
+ */
+ public RowSetWarning getNextWarning() {
+- return rwarning;
++ SQLException warning = getNextException();
++ if ( warning == null || warning instanceof RowSetWarning) {
++ return (RowSetWarning)warning;
++ } else {
++ // The chained value isn't a RowSetWarning.
++ // This is a programming error by whoever added it to
++ // the RowSetWarning chain. We throw a Java "Error".
++ throw new Error("RowSetWarning chain holds value that is not a RowSetWarning: ");
++ }
+ }
+
+ /**
+@@ -139,7 +144,7 @@
+ * @see #getNextWarning
+ */
+ public void setNextWarning(RowSetWarning warning) {
+- rwarning = warning;
++ setNextException(warning);
+ }
+
+ static final long serialVersionUID = 6678332766434564774L;
+--- ./jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2013, 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
+@@ -66,7 +66,7 @@
+ * value of this <code>SerialBlob</code> object.
+ * @serial
+ */
+- private byte buf[];
++ private byte[] buf;
+
+ /**
+ * The internal representation of the <code>Blob</code> object on which this
+@@ -102,12 +102,13 @@
+ * @throws SerialException if an error occurs during serialization
+ * @throws SQLException if a SQL errors occurs
+ */
+- public SerialBlob(byte[] b) throws SerialException, SQLException {
++ public SerialBlob(byte[] b)
++ throws SerialException, SQLException {
+
+ len = b.length;
+ buf = new byte[(int)len];
+ for(int i = 0; i < len; i++) {
+- buf[i] = b[i];
++ buf[i] = b[i];
+ }
+ origLen = len;
+ }
+@@ -132,19 +133,17 @@
+ * to this constructor is a <code>null</code>.
+ * @see java.sql.Blob
+ */
+- public SerialBlob (Blob blob) throws SerialException, SQLException {
++ public SerialBlob (Blob blob)
++ throws SerialException, SQLException {
+
+ if (blob == null) {
+- throw new SQLException("Cannot instantiate a SerialBlob " +
+- "object with a null Blob object");
++ throw new SQLException(
++ "Cannot instantiate a SerialBlob object with a null Blob object");
+ }
+
+ len = blob.length();
+ buf = blob.getBytes(1, (int)len );
+ this.blob = blob;
+-
+- //if ( len < 10240000)
+- // len = 10240000;
+ origLen = len;
+ }
+
+@@ -245,7 +244,8 @@
+ * value from the database
+ */
+ public long position(byte[] pattern, long start)
+- throws SerialException, SQLException {
++ throws SerialException, SQLException {
++
+ isValid();
+ if (start < 1 || start > len) {
+ return -1;
+@@ -290,7 +290,7 @@
+ * value from the database
+ */
+ public long position(Blob pattern, long start)
+- throws SerialException, SQLException {
++ throws SerialException, SQLException {
+ isValid();
+ return position(pattern.getBytes(1, (int)(pattern.length())), start);
+ }
+@@ -316,8 +316,8 @@
+ * @see #getBytes
+ */
+ public int setBytes(long pos, byte[] bytes)
+- throws SerialException, SQLException {
+- return (setBytes(pos, bytes, 0, bytes.length));
++ throws SerialException, SQLException {
++ return setBytes(pos, bytes, 0, bytes.length);
+ }
+
+ /**
+@@ -352,7 +352,7 @@
+ * @see #getBytes
+ */
+ public int setBytes(long pos, byte[] bytes, int offset, int length)
+- throws SerialException, SQLException {
++ throws SerialException, SQLException {
+
+ isValid();
+ if (offset < 0 || offset > bytes.length) {
+@@ -369,7 +369,7 @@
+
+ if ((length + offset) > bytes.length) {
+ throw new SerialException("Invalid OffSet. Cannot have combined offset " +
+- "and length that is greater that the Blob buffer");
++ "and length that is greater that the Blob buffer");
+ }
+
+ int i = 0;
+@@ -402,7 +402,8 @@
+ * @see #getBinaryStream
+ */
+ public java.io.OutputStream setBinaryStream(long pos)
+- throws SerialException, SQLException {
++ throws SerialException, SQLException {
++
+ isValid();
+ if (this.blob != null) {
+ return this.blob.setBinaryStream(pos);
+@@ -425,17 +426,16 @@
+ * if {@code free} had previously been called on this object
+ */
+ public void truncate(long length) throws SerialException {
+-
+ isValid();
+ if (length > len) {
+- throw new SerialException
+- ("Length more than what can be truncated");
++ throw new SerialException(
++ "Length more than what can be truncated");
+ } else if((int)length == 0) {
+- buf = new byte[0];
+- len = length;
++ buf = new byte[0];
++ len = length;
+ } else {
+- len = length;
+- buf = this.getBytes(1, (int)len);
++ len = length;
++ buf = this.getBytes(1, (int)len);
+ }
+ }
+
+@@ -466,8 +466,8 @@
+ throw new SerialException("Invalid position in BLOB object set");
+ }
+ if (length < 1 || length > len - pos + 1) {
+- throw new SerialException("length is < 1 or pos + length >"
+- + "total number of bytes");
++ throw new SerialException(
++ "length is < 1 or pos + length > total number of bytes");
+ }
+ return new ByteArrayInputStream(buf, (int) pos - 1, (int) length);
+ }
+@@ -536,14 +536,13 @@
+ public Object clone() {
+ try {
+ SerialBlob sb = (SerialBlob) super.clone();
+- sb.buf = (buf != null) ? Arrays.copyOf(buf, (int)len) : null;
++ sb.buf = (buf != null) ? Arrays.copyOf(buf, (int)len) : null;
+ sb.blob = null;
+ return sb;
+ } catch (CloneNotSupportedException ex) {
+ // this shouldn't happen, since we are Cloneable
+ throw new InternalError();
+ }
+-
+ }
+
+ /**
+@@ -554,15 +553,15 @@
+ throws IOException, ClassNotFoundException {
+
+ ObjectInputStream.GetField fields = s.readFields();
+- byte[] tmp = (byte[])fields.get("buf", null);
+- if (tmp == null)
+- throw new InvalidObjectException("buf is null and should not be!");
+- buf = tmp.clone();
+- len = fields.get("len", 0L);
+- if (buf.length != len)
+- throw new InvalidObjectException("buf is not the expected size");
+- origLen = fields.get("origLen", 0L);
+- blob = (Blob) fields.get("blob", null);
++ byte[] tmp = (byte[])fields.get("buf", null);
++ if (tmp == null)
++ throw new InvalidObjectException("buf is null and should not be!");
++ buf = tmp.clone();
++ len = fields.get("len", 0L);
++ if (buf.length != len)
++ throw new InvalidObjectException("buf is not the expected size");
++ origLen = fields.get("origLen", 0L);
++ blob = (Blob) fields.get("blob", null);
+ }
+
+ /**
+@@ -590,8 +589,8 @@
+ */
+ private void isValid() throws SerialException {
+ if (buf == null) {
+- throw new SerialException("Error: You cannot call a method on a "
+- + "SerialBlob instance once free() has been called.");
++ throw new SerialException("Error: You cannot call a method on a " +
++ "SerialBlob instance once free() has been called.");
+ }
+ }
+
+--- ./jdk/src/share/classes/javax/swing/AbstractButton.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/AbstractButton.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -2197,10 +2197,7 @@
+ */
+ public boolean imageUpdate(Image img, int infoflags,
+ int x, int y, int w, int h) {
+- Icon iconDisplayed = getIcon();
+- if (iconDisplayed == null) {
+- return false;
+- }
++ Icon iconDisplayed = null;
+
+ if (!model.isEnabled()) {
+ if (model.isSelected()) {
+@@ -2220,7 +2217,12 @@
+ iconDisplayed = getSelectedIcon();
+ }
+
+- if (!SwingUtilities.doesIconReferenceImage(iconDisplayed, img)) {
++ if (iconDisplayed == null) {
++ iconDisplayed = getIcon();
++ }
++
++ if (iconDisplayed == null
++ || !SwingUtilities.doesIconReferenceImage(iconDisplayed, img)) {
+ // We don't know about this image, disable the notification so
+ // we don't keep repainting.
+ return false;
+--- ./jdk/src/share/classes/javax/swing/JComponent.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/JComponent.java Wed Jul 01 21:53:30 2015 -0700
+@@ -3738,12 +3738,6 @@
+ * @param listener the PropertyChangeListener to be added
+ */
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+- if (accessibleContainerHandler == null) {
+- accessibleContainerHandler = new AccessibleContainerHandler();
+- }
+- if (propertyListenersCount++ == 0) {
+- JComponent.this.addContainerListener(accessibleContainerHandler);
+- }
+ super.addPropertyChangeListener(listener);
+ }
+
+@@ -3755,9 +3749,6 @@
+ * @param listener the PropertyChangeListener to be removed
+ */
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+- if (--propertyListenersCount == 0) {
+- JComponent.this.removeContainerListener(accessibleContainerHandler);
+- }
+ super.removePropertyChangeListener(listener);
+ }
+
+--- ./jdk/src/share/classes/javax/swing/JFormattedTextField.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/JFormattedTextField.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -30,7 +30,6 @@
+ import java.io.*;
+ import java.text.*;
+ import java.util.*;
+-import javax.swing.UIManager;
+ import javax.swing.event.*;
+ import javax.swing.plaf.UIResource;
+ import javax.swing.text.*;
+@@ -151,7 +150,7 @@
+ * will be created to handle formatting of numbers:
+ * <pre>
+ * JFormattedTextField tf = new JFormattedTextField();
+- * tf.setValue(new Number(100));
++ * tf.setValue(100);
+ * </pre>
+ * <p>
+ * <strong>Warning:</strong> As the <code>AbstractFormatter</code> will
+--- ./jdk/src/share/classes/javax/swing/JInternalFrame.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/JInternalFrame.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -38,7 +38,6 @@
+
+ import java.io.ObjectOutputStream;
+ import java.io.IOException;
+-import java.lang.StringBuilder;
+ import java.beans.PropertyChangeListener;
+ import sun.awt.AppContext;
+ import sun.swing.SwingUtilities2;
+@@ -1650,7 +1649,7 @@
+ * <dt><code>DO_NOTHING_ON_CLOSE</code>
+ * <dd> Do nothing.
+ * This requires the program to handle the operation
+- * in the <code>windowClosing</code> method
++ * in the <code>internalFrameClosing</code> method
+ * of a registered <code>InternalFrameListener</code> object.
+ * <dt><code>HIDE_ON_CLOSE</code>
+ * <dd> Automatically make the internal frame invisible.
+--- ./jdk/src/share/classes/javax/swing/JMenu.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/JMenu.java Wed Jul 01 21:53:30 2015 -0700
+@@ -475,7 +475,8 @@
+ }
+ // Then the y:
+ y = s.height + yOffset; // Prefer dropping down
+- if (position.y + y + pmSize.height >= screenBounds.height &&
++ if (position.y + y + pmSize.height >= screenBounds.height
++ + screenBounds.y &&
+ // popup doesn't fit - place it wherever there's more room
+ screenBounds.height - s.height < 2*(position.y
+ - screenBounds.y)) {
+--- ./jdk/src/share/classes/javax/swing/JSpinner.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/JSpinner.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -42,8 +42,6 @@
+ import javax.accessibility.*;
+ import sun.util.locale.provider.LocaleProviderAdapter;
+ import sun.util.locale.provider.LocaleResources;
+-import sun.util.locale.provider.LocaleServiceProviderPool;
+-
+
+ /**
+ * A single line input field that lets the user select a
+@@ -77,12 +75,12 @@
+ * try {
+ * spinner.commitEdit();
+ * }
+- * catch (ParseException pe) {{
++ * catch (ParseException pe) {
+ * // Edited value is invalid, spinner.getValue() will return
+ * // the last valid value, you could revert the spinner to show that:
+- * JComponent editor = spinner.getEditor()
++ * JComponent editor = spinner.getEditor();
+ * if (editor instanceof DefaultEditor) {
+- * ((DefaultEditor)editor).getTextField().setValue(spinner.getValue();
++ * ((DefaultEditor)editor).getTextField().setValue(spinner.getValue());
+ * }
+ * // reset the value to some known value:
+ * spinner.setValue(fallbackValue);
+--- ./jdk/src/share/classes/javax/swing/JTextArea.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/JTextArea.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -491,7 +491,6 @@
+ * @exception IllegalArgumentException if part of the range is an
+ * invalid position in the model
+ * @see #insert
+- * @see #replaceRange
+ */
+ public void replaceRange(String str, int start, int end) {
+ if (end < start) {
+--- ./jdk/src/share/classes/javax/swing/JTree.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/JTree.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -872,9 +872,10 @@
+ if(treeModelListener != null)
+ treeModel.addTreeModelListener(treeModelListener);
+ // Mark the root as expanded, if it isn't a leaf.
+- if(treeModel.getRoot() != null &&
+- !treeModel.isLeaf(treeModel.getRoot())) {
+- expandedState.put(new TreePath(treeModel.getRoot()),
++ Object treeRoot = treeModel.getRoot();
++ if(treeRoot != null &&
++ !treeModel.isLeaf(treeRoot)) {
++ expandedState.put(new TreePath(treeRoot),
+ Boolean.TRUE);
+ }
+ }
+@@ -3223,6 +3224,9 @@
+
+ int count = indexs.length;
+ Object parent = model.getRoot();
++ if (parent == null)
++ return null;
++
+ TreePath parentPath = new TreePath(parent);
+
+ for(int counter = 0; counter < count; counter++) {
+@@ -3798,8 +3802,9 @@
+ if (parent.getPathCount() == 1) {
+ // New root, remove everything!
+ clearToggledPaths();
+- if(treeModel.getRoot() != null &&
+- !treeModel.isLeaf(treeModel.getRoot())) {
++ Object treeRoot = treeModel.getRoot();
++ if(treeRoot != null &&
++ !treeModel.isLeaf(treeRoot)) {
+ // Mark the root as expanded, if it isn't a leaf.
+ expandedState.put(parent, Boolean.TRUE);
+ }
+@@ -4283,7 +4288,11 @@
+ if (model == null) {
+ return null;
+ }
+- TreePath path = new TreePath(model.getRoot());
++ Object treeRoot = model.getRoot();
++ if (treeRoot == null)
++ return null;
++
++ TreePath path = new TreePath(treeRoot);
+ if (JTree.this.isVisible(path)) {
+ TreeCellRenderer r = JTree.this.getCellRenderer();
+ TreeUI ui = JTree.this.getUI();
+@@ -4296,8 +4305,8 @@
+ boolean expanded = JTree.this.isExpanded(path);
+
+ return r.getTreeCellRendererComponent(JTree.this,
+- model.getRoot(), selected, expanded,
+- model.isLeaf(model.getRoot()), row, hasFocus);
++ treeRoot, selected, expanded,
++ model.isLeaf(treeRoot), row, hasFocus);
+ }
+ }
+ return null;
+@@ -4350,8 +4359,11 @@
+ return 1; // the root node
+ }
+
++ Object treeRoot = model.getRoot();
++ if (treeRoot == null)
++ return 0;
+ // return the root's first set of children count
+- return model.getChildCount(model.getRoot());
++ return model.getChildCount(treeRoot);
+ }
+
+ /**
+@@ -4365,9 +4377,17 @@
+ if (model == null) {
+ return null;
+ }
++
++ Object treeRoot = model.getRoot();
++ if (treeRoot == null) {
++ return null;
++ }
++
+ if (isRootVisible()) {
+ if (i == 0) { // return the root node Accessible
+- Object[] objPath = { model.getRoot() };
++ Object[] objPath = { treeRoot };
++ if (objPath[0] == null)
++ return null;
+ TreePath path = new TreePath(objPath);
+ return new AccessibleJTreeNode(JTree.this, path, JTree.this);
+ } else {
+@@ -4376,12 +4396,14 @@
+ }
+
+ // return Accessible for one of root's child nodes
+- int count = model.getChildCount(model.getRoot());
++ int count = model.getChildCount(treeRoot);
+ if (i < 0 || i >= count) {
+ return null;
+ }
+- Object obj = model.getChild(model.getRoot(), i);
+- Object[] objPath = { model.getRoot(), obj };
++ Object obj = model.getChild(treeRoot, i);
++ if (obj == null)
++ return null;
++ Object[] objPath = { treeRoot, obj };
+ TreePath path = new TreePath(objPath);
+ return new AccessibleJTreeNode(JTree.this, path, JTree.this);
+ }
+@@ -4420,6 +4442,9 @@
+ public int getAccessibleSelectionCount() {
+ Object[] rootPath = new Object[1];
+ rootPath[0] = treeModel.getRoot();
++ if (rootPath[0] == null)
++ return 0;
++
+ TreePath childPath = new TreePath(rootPath);
+ if (JTree.this.isPathSelected(childPath)) {
+ return 1;
+@@ -4442,6 +4467,8 @@
+ if (i == 0) {
+ Object[] rootPath = new Object[1];
+ rootPath[0] = treeModel.getRoot();
++ if (rootPath[0] == null)
++ return null;
+ TreePath childPath = new TreePath(rootPath);
+ if (JTree.this.isPathSelected(childPath)) {
+ return new AccessibleJTreeNode(JTree.this, childPath, JTree.this);
+@@ -4461,6 +4488,8 @@
+ if (i == 0) {
+ Object[] rootPath = new Object[1];
+ rootPath[0] = treeModel.getRoot();
++ if (rootPath[0] == null)
++ return false;
+ TreePath childPath = new TreePath(rootPath);
+ return JTree.this.isPathSelected(childPath);
+ } else {
+@@ -4482,6 +4511,8 @@
+ if (model != null) {
+ if (i == 0) {
+ Object[] objPath = {model.getRoot()};
++ if (objPath[0] == null)
++ return;
+ TreePath path = new TreePath(objPath);
+ JTree.this.addSelectionPath(path);
+ }
+@@ -4500,6 +4531,8 @@
+ if (model != null) {
+ if (i == 0) {
+ Object[] objPath = {model.getRoot()};
++ if (objPath[0] == null)
++ return;
+ TreePath path = new TreePath(objPath);
+ JTree.this.removeSelectionPath(path);
+ }
+@@ -4525,6 +4558,8 @@
+ TreeModel model = JTree.this.getModel();
+ if (model != null) {
+ Object[] objPath = {model.getRoot()};
++ if (objPath[0] == null)
++ return;
+ TreePath path = new TreePath(objPath);
+ JTree.this.addSelectionPath(path);
+ }
+--- ./jdk/src/share/classes/javax/swing/RepaintManager.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/RepaintManager.java Wed Jul 01 21:53:30 2015 -0700
+@@ -181,9 +181,16 @@
+ */
+ private final ProcessingRunnable processingRunnable;
+
+- private final static JavaSecurityAccess javaSecurityAccess =
+- SharedSecrets.getJavaSecurityAccess();
++ private static final JavaSecurityAccess javaSecurityAccess =
++ SharedSecrets.getJavaSecurityAccess();
+
++ /**
++ * Listener installed to detect display changes. When display changes,
++ * schedules a callback to notify all RepaintManagers of the display
++ * changes.
++ */
++ private static final DisplayChangedListener displayChangedHandler =
++ new DisplayChangedHandler();
+
+ static {
+ SwingAccessor.setRepaintManagerAccessor(new SwingAccessor.RepaintManagerAccessor() {
+@@ -225,8 +232,8 @@
+ GraphicsEnvironment ge = GraphicsEnvironment.
+ getLocalGraphicsEnvironment();
+ if (ge instanceof SunGraphicsEnvironment) {
+- ((SunGraphicsEnvironment)ge).addDisplayChangedListener(
+- new DisplayChangedHandler());
++ ((SunGraphicsEnvironment) ge).addDisplayChangedListener(
++ displayChangedHandler);
+ }
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ if ((tk instanceof SunToolkit)
+@@ -1649,6 +1656,12 @@
+ */
+ private static final class DisplayChangedHandler implements
+ DisplayChangedListener {
++ // Empty non private constructor was added because access to this
++ // class shouldn't be generated by the compiler using synthetic
++ // accessor method
++ DisplayChangedHandler() {
++ }
++
+ public void displayChanged() {
+ scheduleDisplayChanges();
+ }
+@@ -1656,11 +1669,10 @@
+ public void paletteChanged() {
+ }
+
+- private void scheduleDisplayChanges() {
++ private static void scheduleDisplayChanges() {
+ // To avoid threading problems, we notify each RepaintManager
+ // on the thread it was created on.
+- for (Object c : AppContext.getAppContexts()) {
+- AppContext context = (AppContext) c;
++ for (AppContext context : AppContext.getAppContexts()) {
+ synchronized(context) {
+ if (!context.isDisposed()) {
+ EventQueue eventQueue = (EventQueue)context.get(
+--- ./jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java Wed Jul 01 21:53:30 2015 -0700
+@@ -566,7 +566,10 @@
+ } else if (comp instanceof Container && comp != aContainer) {
+ Container cont = (Container)comp;
+ if (cont.isFocusTraversalPolicyProvider()) {
+- return cont.getFocusTraversalPolicy().getLastComponent(cont);
++ Component retComp = cont.getFocusTraversalPolicy().getLastComponent(cont);
++ if (retComp != null) {
++ return retComp;
++ }
+ }
+ }
+ }
+--- ./jdk/src/share/classes/javax/swing/UIDefaults.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/UIDefaults.java Wed Jul 01 21:53:30 2015 -0700
+@@ -44,9 +44,7 @@
+ import java.awt.Color;
+ import java.awt.Insets;
+ import java.awt.Dimension;
+-import java.lang.reflect.Method;
+ import java.beans.PropertyChangeListener;
+-import java.beans.PropertyChangeEvent;
+ import java.security.AccessController;
+ import java.security.AccessControlContext;
+ import java.security.PrivilegedAction;
+@@ -74,7 +72,7 @@
+ */
+ public class UIDefaults extends Hashtable<Object,Object>
+ {
+- private static final Object PENDING = "Pending";
++ private static final Object PENDING = new Object();
+
+ private SwingPropertyChangeSupport changeSupport;
+
+@@ -168,7 +166,7 @@
+ * Looks up up the given key in our Hashtable and resolves LazyValues
+ * or ActiveValues.
+ */
+- private Object getFromHashtable(Object key) {
++ private Object getFromHashtable(final Object key) {
+ /* Quickly handle the common case, without grabbing
+ * a lock.
+ */
+--- ./jdk/src/share/classes/javax/swing/package.html Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/package.html Wed Jul 01 21:53:30 2015 -0700
+@@ -3,7 +3,7 @@
+
+ <HEAD>
+ <!--
+-Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
++Copyright (c) 1998, 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
+@@ -68,6 +68,8 @@
+ the event dispatching thread. The following two examples work equally
+ well for transferring control and starting up a Swing application:
+ <pre>
++import javax.swing.SwingUtilities;
++
+ public class MyApp implements Runnable {
+ public void run() {
+ // Invoked on the event dispatching thread.
+@@ -75,16 +77,18 @@
+ }
+
+ public static void main(String[] args) {
+- SwingUtilities.invokeLater(new MyApp(args));
++ SwingUtilities.invokeLater(new MyApp());
+ }
+ }
+ </pre>
+ Or:
+ <pre>
++import javax.swing.SwingUtilities;
++
+ public class MyApp {
+ MyApp(String[] args) {
+- // Invoked on the event dispatching thread. Do any initialization
+- // here.
++ // Invoked on the event dispatching thread.
++ // Do any initialization here.
+ }
+
+ public void show() {
+--- ./jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -37,6 +37,8 @@
+ import java.awt.Color;
+ import java.awt.Graphics;
+
++import sun.swing.SwingUtilities2;
++
+ /**
+ * Factory object that can vend Borders appropriate for the basic L &amp; F.
+ * @author Georges Saab
+@@ -337,10 +339,10 @@
+ Color oldColor = g.getColor();
+ g.translate(x, y);
+ g.setColor(shadow);
+- g.drawLine(0, height-2, width, height-2);
++ SwingUtilities2.drawHLine(g, 0, width - 1, height - 2);
+ g.setColor(highlight);
+- g.drawLine(0, height-1, width, height-1);
+- g.translate(-x,-y);
++ SwingUtilities2.drawHLine(g, 0, width - 1, height - 1);
++ g.translate(-x, -y);
+ g.setColor(oldColor);
+ }
+
+--- ./jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -125,6 +125,8 @@
+ protected MouseMotionListener popupMouseMotionListener;
+ protected KeyListener popupKeyListener;
+
++ private MouseWheelListener mouseWheelListener;
++
+ // This is used for knowing when to cache the minimum preferred size.
+ // If the data in the list changes, the cached value get marked for recalc.
+ // Added to the current JComboBox model
+@@ -375,6 +377,10 @@
+ comboBox.getModel().addListDataListener( listDataListener );
+ }
+ }
++
++ if ((mouseWheelListener = createMouseWheelListener()) != null) {
++ comboBox.addMouseWheelListener(mouseWheelListener);
++ }
+ }
+
+ /**
+@@ -421,6 +427,9 @@
+ comboBox.getModel().removeListDataListener( listDataListener );
+ }
+ }
++ if (mouseWheelListener != null) {
++ comboBox.removeMouseWheelListener(mouseWheelListener);
++ }
+ }
+
+ /**
+@@ -534,6 +543,10 @@
+ return handler;
+ }
+
++ private MouseWheelListener createMouseWheelListener() {
++ return getHandler();
++ }
++
+ //
+ // end UI Initialization
+ //======================
+@@ -1669,7 +1682,8 @@
+ //
+ private class Handler implements ActionListener, FocusListener,
+ KeyListener, LayoutManager,
+- ListDataListener, PropertyChangeListener {
++ ListDataListener, PropertyChangeListener,
++ MouseWheelListener {
+ //
+ // PropertyChangeListener
+ //
+@@ -1939,21 +1953,25 @@
+ public void actionPerformed(ActionEvent evt) {
+ Object item = comboBox.getEditor().getItem();
+ if (item != null) {
+- if(!comboBox.isPopupVisible() && !item.equals(comboBox.getSelectedItem())) {
+- comboBox.setSelectedItem(comboBox.getEditor().getItem());
+- }
+- ActionMap am = comboBox.getActionMap();
+- if (am != null) {
+- Action action = am.get("enterPressed");
+- if (action != null) {
+- action.actionPerformed(new ActionEvent(comboBox, evt.getID(),
+- evt.getActionCommand(),
+- evt.getModifiers()));
++ if (!comboBox.isPopupVisible() && !item.equals(comboBox.getSelectedItem())) {
++ comboBox.setSelectedItem(comboBox.getEditor().getItem());
++ }
++ ActionMap am = comboBox.getActionMap();
++ if (am != null) {
++ Action action = am.get("enterPressed");
++ if (action != null) {
++ action.actionPerformed(new ActionEvent(comboBox, evt.getID(),
++ evt.getActionCommand(),
++ evt.getModifiers()));
++ }
+ }
+ }
+- }
++ }
++
++ public void mouseWheelMoved(MouseWheelEvent e) {
++ e.consume();
++ }
+ }
+- }
+
+ class DefaultKeySelectionManager implements JComboBox.KeySelectionManager, UIResource {
+ private String prefix = "";
+--- ./jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java Wed Jul 01 21:53:30 2015 -0700
+@@ -180,6 +180,8 @@
+ */
+ protected ItemListener itemListener;
+
++ private MouseWheelListener scrollerMouseWheelListener;
++
+ /**
+ * This protected field is implementation specific. Do not access directly
+ * or override.
+@@ -286,6 +288,7 @@
+ uninstallComboBoxModelListeners(comboBox.getModel());
+ uninstallKeyboardActions();
+ uninstallListListeners();
++ uninstallScrollerListeners();
+ // We do this, otherwise the listener the ui installs on
+ // the model (the combobox model in this case) will keep a
+ // reference to the list, causing the list (and us) to never get gced.
+@@ -572,6 +575,7 @@
+ scroller.setFocusable( false );
+ scroller.getVerticalScrollBar().setFocusable( false );
+ scroller.setBorder( null );
++ installScrollerListeners();
+ }
+
+ /**
+@@ -588,6 +592,20 @@
+ setFocusable( false );
+ }
+
++ private void installScrollerListeners() {
++ scrollerMouseWheelListener = getHandler();
++ if (scrollerMouseWheelListener != null) {
++ scroller.addMouseWheelListener(scrollerMouseWheelListener);
++ }
++ }
++
++ private void uninstallScrollerListeners() {
++ if (scrollerMouseWheelListener != null) {
++ scroller.removeMouseWheelListener(scrollerMouseWheelListener);
++ scrollerMouseWheelListener = null;
++ }
++ }
++
+ /**
+ * This method adds the necessary listeners to the JComboBox.
+ */
+@@ -796,8 +814,8 @@
+
+
+ private class Handler implements ItemListener, MouseListener,
+- MouseMotionListener, PropertyChangeListener,
+- Serializable {
++ MouseMotionListener, MouseWheelListener,
++ PropertyChangeListener, Serializable {
+ //
+ // MouseListener
+ // NOTE: this is added to both the JList and JComboBox
+@@ -981,6 +999,13 @@
+ setListSelection(comboBox.getSelectedIndex());
+ }
+ }
++
++ //
++ // MouseWheelListener
++ //
++ public void mouseWheelMoved(MouseWheelEvent e) {
++ e.consume();
++ }
+ }
+
+ //
+--- ./jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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,10 +36,9 @@
+ import java.awt.Graphics;
+ import java.awt.KeyboardFocusManager;
+ import java.awt.*;
+-import java.util.Vector;
++
+ import sun.swing.DefaultLookup;
+ import sun.swing.UIAction;
+-import sun.awt.AppContext;
+
+ /**
+ * Basic L&amp;F for a desktop.
+@@ -49,9 +48,6 @@
+ public class BasicDesktopPaneUI extends DesktopPaneUI {
+ // Old actions forward to an instance of this.
+ private static final Actions SHARED_ACTION = new Actions();
+- private static Dimension minSize = new Dimension(0,0);
+- private static Dimension maxSize = new Dimension(Integer.MAX_VALUE,
+- Integer.MAX_VALUE);
+ private Handler handler;
+ private PropertyChangeListener pcl;
+
+@@ -264,13 +260,19 @@
+
+ public void paint(Graphics g, JComponent c) {}
+
+- public Dimension getPreferredSize(JComponent c) {return null;}
++ @Override
++ public Dimension getPreferredSize(JComponent c) {
++ return null;
++ }
+
++ @Override
+ public Dimension getMinimumSize(JComponent c) {
+- return minSize;
+- }
+- public Dimension getMaximumSize(JComponent c){
+- return maxSize;
++ return new Dimension(0, 0);
++ }
++
++ @Override
++ public Dimension getMaximumSize(JComponent c) {
++ return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+
+ /**
+--- ./jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -884,7 +884,9 @@
+ processMouseEvent(me);
+ break;
+ case MouseEvent.MOUSE_WHEEL:
+- if (isInPopup(src)) {
++ if (isInPopup(src)
++ || ((src instanceof JComboBox) && ((JComboBox) src).isPopupVisible())) {
++
+ return;
+ }
+ cancelPopupMenu();
+--- ./jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -438,7 +438,7 @@
+ // to the button group or not
+ Component getFocusTransferBaseComponent(boolean next){
+ Component focusBaseComp = activeBtn;
+- Window container = SwingUtilities.getWindowAncestor(activeBtn);
++ Container container = focusBaseComp.getFocusCycleRootAncestor();
+ if (container != null) {
+ FocusTraversalPolicy policy = container.getFocusTraversalPolicy();
+ Component comp = next ? policy.getComponentAfter(container, activeBtn)
+--- ./jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -876,6 +876,12 @@
+ return;
+ }
+ orientation = SwingConstants.HORIZONTAL;
++ } else if(e.isShiftDown()){
++ JScrollBar hScroll = scrollpane.getHorizontalScrollBar();
++ if (hScroll != null && hScroll.isVisible()) {
++ toScroll = hScroll;
++ orientation = SwingConstants.HORIZONTAL;
++ }
+ }
+
+ e.consume();
+--- ./jdk/src/share/classes/javax/swing/plaf/metal/MetalBorders.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/metal/MetalBorders.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -40,6 +40,7 @@
+ import java.awt.Window;
+
+ import sun.swing.StringUIClientPropertyKey;
++import sun.swing.SwingUtilities2;
+
+
+ /**
+@@ -528,25 +529,22 @@
+ protected static Insets borderInsets = new Insets( 1, 0, 1, 0 );
+
+ public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
+- g.translate( x, y );
++ g.translate(x, y);
+
+ if (MetalLookAndFeel.usingOcean()) {
+- // Only paint a border if we're not next to a horizontal
+- // toolbar
+- if ((c instanceof JMenuBar) && !MetalToolBarUI.doesMenuBarBorderToolBar((JMenuBar)c)) {
++ // Only paint a border if we're not next to a horizontal toolbar
++ if (c instanceof JMenuBar
++ && !MetalToolBarUI.doesMenuBarBorderToolBar((JMenuBar)c)) {
+ g.setColor(MetalLookAndFeel.getControl());
+- g.drawLine(0, h - 2, w, h - 2);
++ SwingUtilities2.drawHLine(g, 0, w - 1, h - 2);
+ g.setColor(UIManager.getColor("MenuBar.borderColor"));
+- g.drawLine(0, h - 1, w, h - 1);
++ SwingUtilities2.drawHLine(g, 0, w - 1, h - 1);
+ }
++ } else {
++ g.setColor(MetalLookAndFeel.getControlShadow());
++ SwingUtilities2.drawHLine(g, 0, w - 1, h - 1);
+ }
+- else {
+- g.setColor( MetalLookAndFeel.getControlShadow() );
+- g.drawLine( 0, h-1, w, h-1 );
+- }
+-
+- g.translate( -x, -y );
+-
++ g.translate(-x, -y);
+ }
+
+ public Insets getBorderInsets(Component c, Insets newInsets) {
+--- ./jdk/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -92,8 +92,6 @@
+
+ private static int MIN_WIDTH = 500;
+ private static int MIN_HEIGHT = 326;
+- private static Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
+-
+ private static int LIST_PREF_WIDTH = 405;
+ private static int LIST_PREF_HEIGHT = 135;
+ private static Dimension LIST_PREF_SIZE = new Dimension(LIST_PREF_WIDTH, LIST_PREF_HEIGHT);
+@@ -565,6 +563,7 @@
+ * @return a <code>Dimension</code> specifying the preferred
+ * width and height of the file chooser
+ */
++ @Override
+ public Dimension getPreferredSize(JComponent c) {
+ int prefWidth = PREF_SIZE.width;
+ Dimension d = c.getLayout().preferredLayoutSize(c);
+@@ -583,8 +582,9 @@
+ * @return a <code>Dimension</code> specifying the minimum
+ * width and height of the file chooser
+ */
++ @Override
+ public Dimension getMinimumSize(JComponent c) {
+- return MIN_SIZE;
++ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
+ }
+
+ /**
+@@ -594,6 +594,7 @@
+ * @return a <code>Dimension</code> specifying the maximum
+ * width and height of the file chooser
+ */
++ @Override
+ public Dimension getMaximumSize(JComponent c) {
+ return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+@@ -604,7 +605,8 @@
+ } else {
+ JFileChooser fc = getFileChooser();
+ if ((fc.isDirectorySelectionEnabled() && !fc.isFileSelectionEnabled()) ||
+- (fc.isDirectorySelectionEnabled() && fc.isFileSelectionEnabled() && fc.getFileSystemView().isFileSystemRoot(file))) {
++ (fc.isDirectorySelectionEnabled() && fc.isFileSelectionEnabled()
++ && fc.getFileSystemView().isFileSystemRoot(file))) {
+ return file.getPath();
+ } else {
+ return file.getName();
+--- ./jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -625,6 +625,9 @@
+ // check if we can scale to the requested size
+ Dimension canvas = ctx.canvasSize;
+ Insets insets = ctx.stretchingInsets;
++ if (insets.left + insets.right > w || insets.top + insets.bottom > h) {
++ return;
++ }
+
+ if (w <= (canvas.width * ctx.maxHorizontalScaleFactor) && h <= (canvas.height * ctx.maxVerticalScaleFactor)) {
+ // get image at canvas size
+--- ./jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java Wed Jul 01 21:53:30 2015 -0700
+@@ -169,10 +169,9 @@
+ case '|':
+ case '&': {
+ Element e = (Element) token;
+- if (valSet == null) {
++ if (valSet == null || valSet.length <= Element.getMaxIndex()) {
+ valSet = new boolean[Element.getMaxIndex() + 1];
+ val = new boolean[valSet.length];
+- // All Element instances are created before this ever executes
+ }
+ if (valSet[e.index]) {
+ return val[e.index];
+--- ./jdk/src/share/classes/sun/applet/AppletPanel.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/applet/AppletPanel.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1995, 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
+@@ -682,7 +682,12 @@
+
+ if (toFocus != null) {
+ if (parent instanceof EmbeddedFrame) {
+- ((EmbeddedFrame)parent).synthesizeWindowActivation(true);
++ // JDK-8056915: Try to request focus to the embedder first and
++ // activate the embedded frame through it
++ if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) {
++ // Otherwise activate the embedded frame directly
++ ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
++ }
+ }
+ // EmbeddedFrame might have focus before the applet was added.
+ // Thus after its activation the most recent focus owner will be
+--- ./jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2014, 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
+@@ -92,10 +92,10 @@
+ {"appletviewer.main.debug.cantaccess", "Det finns ingen \u00E5tkomst till fels\u00F6kningsprogrammet!"},
+ {"appletviewer.main.nosecmgr", "Varning: SecurityManager har inte installerats!"},
+ {"appletviewer.main.warning", "Varning: Inga appletar har startats. Kontrollera att indata inneh\u00E5ller <applet>-tagg."},
+- {"appletviewer.main.warn.prop.overwrite", "Varning: Skriver tillf\u00E4lligt \u00F6ver systemegenskap enligt beg\u00E4ran fr\u00E5n anv\u00E4ndare: nyckel: {0} gammalt v\u00E4rde: {1} nytt v\u00E4rde: {2}"},
++ {"appletviewer.main.warn.prop.overwrite", "Varning: Skriver tillf\u00E4lligt \u00F6ver systemegenskap enligt beg\u00E4ran fr\u00E5n anv\u00E4ndare: nyckel: {0} tidigare v\u00E4rde: {1} nytt v\u00E4rde: {2}"},
+ {"appletviewer.main.warn.cantreadprops", "Varning: Kan inte l\u00E4sa egenskapsfil f\u00F6r AppletViewer: {0} Standardv\u00E4rden anv\u00E4nds."},
+- {"appletioexception.loadclass.throw.interrupted", "klassinl\u00E4sning avbr\u00F6ts: {0}"},
+- {"appletioexception.loadclass.throw.notloaded", "klass inte inl\u00E4st: {0}"},
++ {"appletioexception.loadclass.throw.interrupted", "klassladdning avbr\u00F6ts: {0}"},
++ {"appletioexception.loadclass.throw.notloaded", "klass inte laddad: {0}"},
+ {"appletclassloader.loadcode.verbose", "\u00D6ppnar str\u00F6m till: {0} f\u00F6r h\u00E4mtning av {1}"},
+ {"appletclassloader.filenotfound", "Hittade inte fil vid s\u00F6kning efter: {0}"},
+ {"appletclassloader.fileformat", "Undantag av filformat vid laddning av: {0}"},
+@@ -124,7 +124,7 @@
+ {"appletpanel.exception2", "undantag: {0}: {1}."},
+ {"appletpanel.error", "fel: {0}."},
+ {"appletpanel.error2", "fel {0}: {1}."},
+- {"appletpanel.notloaded", "Initiera: applet \u00E4r inte inl\u00E4st."},
++ {"appletpanel.notloaded", "Initiera: applet \u00E4r inte laddad."},
+ {"appletpanel.notinited", "Starta: applet \u00E4r inte initierad."},
+ {"appletpanel.notstarted", "Stoppa: applet har inte startats."},
+ {"appletpanel.notstopped", "Radera: applet har inte stoppats."},
+--- ./jdk/src/share/classes/sun/awt/EmbeddedFrame.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/awt/EmbeddedFrame.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -361,6 +361,15 @@
+ public void synthesizeWindowActivation(boolean doActivate) {}
+
+ /**
++ * Requests the focus to the embedder.
++ *
++ * @return {@code true} if focus request was successful, and {@code false} otherwise.
++ */
++ public boolean requestFocusToEmbedder() {
++ return false;
++ }
++
++ /**
+ * Moves this embedded frame to a new location. The top-left corner of
+ * the new location is specified by the <code>x</code> and <code>y</code>
+ * parameters relative to the native parent component.
+--- ./jdk/src/share/classes/sun/awt/SunToolkit.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/awt/SunToolkit.java Wed Jul 01 21:53:30 2015 -0700
+@@ -715,16 +715,19 @@
+ }
+
+
+- static final SoftCache imgCache = new SoftCache();
++ static final SoftCache fileImgCache = new SoftCache();
++
++ static final SoftCache urlImgCache = new SoftCache();
+
+ static Image getImageFromHash(Toolkit tk, URL url) {
+ checkPermissions(url);
+- synchronized (imgCache) {
+- Image img = (Image)imgCache.get(url);
++ synchronized (urlImgCache) {
++ String key = url.toString();
++ Image img = (Image)urlImgCache.get(key);
+ if (img == null) {
+ try {
+ img = tk.createImage(new URLImageSource(url));
+- imgCache.put(url, img);
++ urlImgCache.put(key, img);
+ } catch (Exception e) {
+ }
+ }
+@@ -735,12 +738,12 @@
+ static Image getImageFromHash(Toolkit tk,
+ String filename) {
+ checkPermissions(filename);
+- synchronized (imgCache) {
+- Image img = (Image)imgCache.get(filename);
++ synchronized (fileImgCache) {
++ Image img = (Image)fileImgCache.get(filename);
+ if (img == null) {
+ try {
+ img = tk.createImage(new FileImageSource(filename));
+- imgCache.put(filename, img);
++ fileImgCache.put(filename, img);
+ } catch (Exception e) {
+ }
+ }
+@@ -758,28 +761,29 @@
+
+ protected Image getImageWithResolutionVariant(String fileName,
+ String resolutionVariantName) {
+- synchronized (imgCache) {
++ synchronized (fileImgCache) {
+ Image image = getImageFromHash(this, fileName);
+ if (image instanceof MultiResolutionImage) {
+ return image;
+ }
+ Image resolutionVariant = getImageFromHash(this, resolutionVariantName);
+ image = createImageWithResolutionVariant(image, resolutionVariant);
+- imgCache.put(fileName, image);
++ fileImgCache.put(fileName, image);
+ return image;
+ }
+ }
+
+ protected Image getImageWithResolutionVariant(URL url,
+ URL resolutionVariantURL) {
+- synchronized (imgCache) {
++ synchronized (urlImgCache) {
+ Image image = getImageFromHash(this, url);
+ if (image instanceof MultiResolutionImage) {
+ return image;
+ }
+ Image resolutionVariant = getImageFromHash(this, resolutionVariantURL);
+ image = createImageWithResolutionVariant(image, resolutionVariant);
+- imgCache.put(url, image);
++ String key = url.toString();
++ urlImgCache.put(key, image);
+ return image;
+ }
+ }
+@@ -884,19 +888,27 @@
+ return null;
+ }
+
+- protected static boolean imageCached(Object key) {
+- return imgCache.containsKey(key);
++ protected static boolean imageCached(String fileName) {
++ return fileImgCache.containsKey(fileName);
++ }
++
++ protected static boolean imageCached(URL url) {
++ String key = url.toString();
++ return urlImgCache.containsKey(key);
+ }
+
+ protected static boolean imageExists(String filename) {
+- checkPermissions(filename);
+- return filename != null && new File(filename).exists();
++ if (filename != null) {
++ checkPermissions(filename);
++ return new File(filename).exists();
++ }
++ return false;
+ }
+
+ @SuppressWarnings("try")
+ protected static boolean imageExists(URL url) {
+- checkPermissions(url);
+ if (url != null) {
++ checkPermissions(url);
+ try (InputStream is = url.openStream()) {
+ return true;
+ }catch(IOException e){
+--- ./jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -2905,13 +2905,13 @@
+ return comp;
+ }
+
+- if (flavor1.isFlavorTextType()) {
+- return 1;
+- }
+-
+- if (flavor2.isFlavorTextType()) {
+- return -1;
+- }
++// if (flavor1.isFlavorTextType()) {
++// return 1;
++// }
++//
++// if (flavor2.isFlavorTextType()) {
++// return -1;
++// }
+
+ // Next, look for application/x-java-* types. Prefer unknown
+ // MIME types because if the user provides his own data flavor,
+--- ./jdk/src/share/classes/sun/awt/datatransfer/SunClipboard.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/awt/datatransfer/SunClipboard.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1999, 2006, 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
+@@ -39,7 +39,7 @@
+
+ import java.beans.PropertyChangeEvent;
+ import java.beans.PropertyChangeListener;
+-
++import java.util.Arrays;
+ import java.util.Iterator;
+ import java.util.Set;
+ import java.util.HashSet;
+@@ -75,12 +75,11 @@
+ private volatile int numberOfFlavorListeners = 0;
+
+ /**
+- * A set of <code>DataFlavor</code>s that is available on
+- * this clipboard. It is used for tracking changes
+- * of <code>DataFlavor</code>s available on this clipboard.
++ * A set of {@code DataFlavor}s that is available on this clipboard. It is
++ * used for tracking changes of {@code DataFlavor}s available on this
++ * clipboard. Can be {@code null}.
+ */
+- private volatile Set currentDataFlavors;
+-
++ private volatile long[] currentFormats;
+
+ public SunClipboard(String name) {
+ super(name);
+@@ -367,11 +366,11 @@
+ try {
+ openClipboard(null);
+ currentFormats = getClipboardFormats();
+- } catch (IllegalStateException exc) {
++ } catch (final IllegalStateException ignored) {
+ } finally {
+ closeClipboard();
+ }
+- currentDataFlavors = formatArrayAsDataFlavorSet(currentFormats);
++ this.currentFormats = currentFormats;
+
+ registerClipboardViewerChecked();
+ }
+@@ -391,7 +390,7 @@
+ if (contextFlavorListeners.remove(listener) &&
+ --numberOfFlavorListeners == 0) {
+ unregisterClipboardViewerChecked();
+- currentDataFlavors = null;
++ currentFormats = null;
+ }
+ }
+
+@@ -420,17 +419,15 @@
+ * @param formats data formats that have just been retrieved from
+ * this clipboard
+ */
+- public void checkChange(long[] formats) {
+- Set prevDataFlavors = currentDataFlavors;
+- currentDataFlavors = formatArrayAsDataFlavorSet(formats);
+-
+- if ((prevDataFlavors != null) && (currentDataFlavors != null) &&
+- prevDataFlavors.equals(currentDataFlavors)) {
++ protected final void checkChange(final long[] formats) {
++ if (Arrays.equals(formats, currentFormats)) {
+ // we've been able to successfully get available on the clipboard
+ // DataFlavors this and previous time and they are coincident;
+ // don't notify
+ return;
+ }
++ currentFormats = formats;
++
+
+ class SunFlavorChangeNotifier implements Runnable {
+ private final FlavorListener flavorListener;
+--- ./jdk/src/share/classes/sun/awt/resources/awt_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/awt/resources/awt_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -20,11 +20,11 @@
+ AWT.capsLock=Caps Lock
+ AWT.escape=Esc
+ AWT.space=Mellanslag
+-AWT.pgup=Page Up
+-AWT.pgdn=Page Down
++AWT.pgup=Sida upp
++AWT.pgdn=Sida ned
+ AWT.end=End
+ AWT.home=Hem
+-AWT.left=V\u00E4nsterpil
++AWT.left=V\u00E4nster
+ AWT.up=Upp
+ AWT.right=H\u00F6gerpil
+ AWT.down=Nedpil
+@@ -114,7 +114,7 @@
+ AWT.minus=Minus
+ AWT.rightParenthesis=H\u00F6gerparentes
+ AWT.underscore=Understreck
+-AWT.final=Slutgiltig
++AWT.final=Slutlig
+ AWT.convert=Konvertera
+ AWT.noconvert=Ingen konvertering
+ AWT.accept=Acceptera
+--- ./jdk/src/share/classes/sun/font/Font2D.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/font/Font2D.java Wed Jul 01 21:53:30 2015 -0700
+@@ -157,6 +157,21 @@
+ }
+ }
+
++ public static final int FWIDTH_NORMAL = 5; // OS/2 usWidthClass
++ public static final int FWEIGHT_NORMAL = 400; // OS/2 usWeightClass
++ public static final int FWEIGHT_BOLD = 700; // OS/2 usWeightClass
++
++ public int getWidth() {
++ return FWIDTH_NORMAL;
++ }
++
++ public int getWeight() {
++ if ((style & Font.BOLD) !=0) {
++ return FWEIGHT_BOLD;
++ } else {
++ return FWEIGHT_NORMAL;
++ }
++ }
+
+ int getRank() {
+ return fontRank;
+--- ./jdk/src/share/classes/sun/font/FontFamily.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/font/FontFamily.java Wed Jul 01 21:53:30 2015 -0700
+@@ -27,6 +27,7 @@
+
+ import java.io.File;
+ import java.awt.Font;
++import java.util.Collection;
+ import java.util.HashMap;
+ import java.util.concurrent.ConcurrentHashMap;
+ import java.util.Locale;
+@@ -134,7 +135,104 @@
+ return java.util.Objects.equals(newDir, existDir);
+ }
+
++ /*
++ * We want a family to be of the same width and prefer medium/normal width.
++ * Once we find a particular width we accept more of the same width
++ * until we find one closer to normal when we 'evict' all existing fonts.
++ * So once we see a 'normal' width font we evict all members that are not
++ * normal width and then accept only new ones that are normal width.
++ *
++ * Once a font passes the width test we subject it to the weight test.
++ * For Plain we target the weight the closest that is <= NORMAL (400)
++ * For Bold we target the weight that is closest to BOLD (700).
++ *
++ * In the future, rather than discarding these fonts, we should
++ * extend the family to include these so lookups on these properties
++ * can locate them, as presently they will only be located by full name
++ * based lookup.
++ */
++
++ private int familyWidth = 0;
++ private boolean preferredWidth(Font2D font) {
++
++ int newWidth = font.getWidth();
++
++ if (familyWidth == 0) {
++ familyWidth = newWidth;
++ return true;
++ }
++
++ if (newWidth == familyWidth) {
++ return true;
++ }
++
++ if (Math.abs(Font2D.FWIDTH_NORMAL - newWidth) <
++ Math.abs(Font2D.FWIDTH_NORMAL - familyWidth))
++ {
++ if (FontUtilities.debugFonts()) {
++ FontUtilities.getLogger().info(
++ "Found more preferred width. New width = " + newWidth +
++ " Old width = " + familyWidth + " in font " + font +
++ " nulling out fonts plain: " + plain + " bold: " + bold +
++ " italic: " + italic + " bolditalic: " + bolditalic);
++ }
++ familyWidth = newWidth;
++ plain = bold = italic = bolditalic = null;
++ return true;
++ } else if (FontUtilities.debugFonts()) {
++ FontUtilities.getLogger().info(
++ "Family rejecting font " + font +
++ " of less preferred width " + newWidth);
++ }
++ return false;
++ }
++
++ private boolean closerWeight(Font2D currFont, Font2D font, int style) {
++ if (familyWidth != font.getWidth()) {
++ return false;
++ }
++
++ if (currFont == null) {
++ return true;
++ }
++
++ if (FontUtilities.debugFonts()) {
++ FontUtilities.getLogger().info(
++ "New weight for style " + style + ". Curr.font=" + currFont +
++ " New font="+font+" Curr.weight="+ + currFont.getWeight()+
++ " New weight="+font.getWeight());
++ }
++
++ int newWeight = font.getWeight();
++ switch (style) {
++ case Font.PLAIN:
++ case Font.ITALIC:
++ return (newWeight <= Font2D.FWEIGHT_NORMAL &&
++ newWeight > currFont.getWeight());
++
++ case Font.BOLD:
++ case Font.BOLD|Font.ITALIC:
++ return (Math.abs(newWeight - Font2D.FWEIGHT_BOLD) <
++ Math.abs(currFont.getWeight() - Font2D.FWEIGHT_BOLD));
++
++ default:
++ return false;
++ }
++ }
++
+ public void setFont(Font2D font, int style) {
++
++ if (FontUtilities.isLogging()) {
++ String msg;
++ if (font instanceof CompositeFont) {
++ msg = "Request to add " + font.getFamilyName(null) +
++ " with style " + style + " to family " + familyName;
++ } else {
++ msg = "Request to add " + font +
++ " with style " + style + " to family " + this;
++ }
++ FontUtilities.getLogger().info(msg);
++ }
+ /* Allow a lower-rank font only if its a file font
+ * from the exact same source as any previous font.
+ */
+@@ -152,19 +250,27 @@
+ switch (style) {
+
+ case Font.PLAIN:
+- plain = font;
++ if (preferredWidth(font) && closerWeight(plain, font, style)) {
++ plain = font;
++ }
+ break;
+
+ case Font.BOLD:
+- bold = font;
++ if (preferredWidth(font) && closerWeight(bold, font, style)) {
++ bold = font;
++ }
+ break;
+
+ case Font.ITALIC:
+- italic = font;
++ if (preferredWidth(font) && closerWeight(italic, font, style)) {
++ italic = font;
++ }
+ break;
+
+ case Font.BOLD|Font.ITALIC:
+- bolditalic = font;
++ if (preferredWidth(font) && closerWeight(bolditalic, font, style)) {
++ bolditalic = font;
++ }
+ break;
+
+ default:
+@@ -316,6 +422,11 @@
+ return allLocaleNames.get(name.toLowerCase());
+ }
+
++ public static FontFamily[] getAllFontFamilies() {
++ Collection<FontFamily> families = familyNameMap.values();
++ return families.toArray(new FontFamily[0]);
++ }
++
+ public String toString() {
+ return
+ "Font family: " + familyName +
+--- ./jdk/src/share/classes/sun/font/StandardTextSource.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/font/StandardTextSource.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -33,42 +33,43 @@
+ import java.awt.font.FontRenderContext;
+ import java.awt.font.LineMetrics;
+
+-public class StandardTextSource extends TextSource {
+- char[] chars;
+- int start;
+- int len;
+- int cstart;
+- int clen;
+- int level; // assumed all uniform
+- int flags; // see GlyphVector.java
+- Font font;
+- FontRenderContext frc;
+- CoreMetrics cm;
++final class StandardTextSource extends TextSource {
+
+- /**
+- * Create a simple implementation of a TextSource.
+- *
+- * Chars is an array containing clen chars in the context, in
+- * logical order, contiguously starting at cstart. Start and len
+- * represent that portion of the context representing the true
+- * source; start, like cstart, is relative to the start of the
+- * character array.
+- *
+- * Level is the bidi level (0-63 for the entire context. Flags is
+- * the layout flags. Font is the font, frc is the render context,
+- * and lm is the line metrics for the entire source text, but not
+- * necessarily the context.
+- */
+- public StandardTextSource(char[] chars,
+- int start,
+- int len,
+- int cstart,
+- int clen,
+- int level,
+- int flags,
+- Font font,
+- FontRenderContext frc,
+- CoreMetrics cm) {
++ private final char[] chars;
++ private final int start;
++ private final int len;
++ private final int cstart;
++ private final int clen;
++ private final int level; // assumed all uniform
++ private final int flags; // see GlyphVector.java
++ private final Font font;
++ private final FontRenderContext frc;
++ private final CoreMetrics cm;
++
++ /**
++ * Create a simple implementation of a TextSource.
++ *
++ * Chars is an array containing clen chars in the context, in
++ * logical order, contiguously starting at cstart. Start and len
++ * represent that portion of the context representing the true
++ * source; start, like cstart, is relative to the start of the
++ * character array.
++ *
++ * Level is the bidi level (0-63 for the entire context. Flags is
++ * the layout flags. Font is the font, frc is the render context,
++ * and lm is the line metrics for the entire source text, but not
++ * necessarily the context.
++ */
++ StandardTextSource(char[] chars,
++ int start,
++ int len,
++ int cstart,
++ int clen,
++ int level,
++ int flags,
++ Font font,
++ FontRenderContext frc,
++ CoreMetrics cm) {
+ if (chars == null) {
+ throw new IllegalArgumentException("bad chars: null");
+ }
+@@ -97,7 +98,7 @@
+ throw new IllegalArgumentException("bad frc: null");
+ }
+
+- this.chars = chars.clone();
++ this.chars = chars;
+ this.start = start;
+ this.len = len;
+ this.cstart = cstart;
+@@ -115,40 +116,10 @@
+ }
+ }
+
+- /** Create a StandardTextSource whose context is coextensive with the source. */
+- public StandardTextSource(char[] chars,
+- int start,
+- int len,
+- int level,
+- int flags,
+- Font font,
+- FontRenderContext frc,
+- CoreMetrics cm) {
+- this(chars, start, len, start, len, level, flags, font, frc, cm);
+- }
+-
+- /** Create a StandardTextSource whose context and source are coextensive with the entire char array. */
+- public StandardTextSource(char[] chars,
+- int level,
+- int flags,
+- Font font,
+- FontRenderContext frc) {
+- this(chars, 0, chars.length, 0, chars.length, level, flags, font, frc, null);
+- }
+-
+- /** Create a StandardTextSource whose context and source are all the text in the String. */
+- public StandardTextSource(String str,
+- int level,
+- int flags,
+- Font font,
+- FontRenderContext frc) {
+- this(str.toCharArray(), 0, str.length(), 0, str.length(), level, flags, font, frc, null);
+- }
+-
+ // TextSource API
+
+ public char[] getChars() {
+- return chars.clone();
++ return chars;
+ }
+
+ public int getStart() {
+--- ./jdk/src/share/classes/sun/font/TextLabelFactory.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/font/TextLabelFactory.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -48,12 +48,12 @@
+ * @see TextLayout
+ */
+
+-public class TextLabelFactory {
+- private FontRenderContext frc;
+- private char[] text;
+- private Bidi bidi;
++public final class TextLabelFactory {
++ private final FontRenderContext frc;
++ private final char[] text;
++ private final Bidi bidi;
+ private Bidi lineBidi;
+- private int flags;
++ private final int flags;
+ private int lineStart;
+ private int lineLimit;
+
+--- ./jdk/src/share/classes/sun/font/TrueTypeFont.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/font/TrueTypeFont.java Wed Jul 01 21:53:30 2015 -0700
+@@ -959,6 +959,18 @@
+ setStyle(getTableBuffer(os_2Tag));
+ }
+
++ private int fontWidth = 0;
++ @Override
++ public int getWidth() {
++ return (fontWidth > 0) ? fontWidth : super.getWidth();
++ }
++
++ private int fontWeight = 0;
++ @Override
++ public int getWeight() {
++ return (fontWeight > 0) ? fontWeight : super.getWeight();
++ }
++
+ /* TrueTypeFont can use the fsSelection fields of OS/2 table
+ * to determine the style. In the unlikely case that doesn't exist,
+ * can use macStyle in the 'head' table but simpler to
+@@ -974,8 +986,15 @@
+ private static final int fsSelectionBoldBit = 0x00020;
+ private static final int fsSelectionRegularBit = 0x00040;
+ private void setStyle(ByteBuffer os_2Table) {
++ if (os_2Table == null) {
++ return;
++ }
++ if (os_2Table.capacity() >= 8) {
++ fontWeight = os_2Table.getChar(4) & 0xffff;
++ fontWidth = os_2Table.getChar(6) & 0xffff;
++ }
+ /* fsSelection is unsigned short at buffer offset 62 */
+- if (os_2Table == null || os_2Table.capacity() < 64) {
++ if (os_2Table.capacity() < 64) {
+ super.setStyle();
+ return;
+ }
+--- ./jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2014, 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
+@@ -59,6 +59,10 @@
+ TransformBlit transformBlitIntArgbPreToSurface =
+ new OGLSwToSurfaceTransform(SurfaceType.IntArgbPre,
+ OGLSurfaceData.PF_INT_ARGB_PRE);
++ OGLSurfaceToSwBlit blitSurfaceToIntArgbPre =
++ new OGLSurfaceToSwBlit(SurfaceType.IntArgbPre,
++ OGLSurfaceData.PF_INT_ARGB_PRE);
++
+ GraphicsPrimitive[] primitives = {
+ // surface->surface ops
+ new OGLSurfaceToSurfaceBlit(),
+@@ -73,8 +77,7 @@
+ // surface->sw ops
+ new OGLSurfaceToSwBlit(SurfaceType.IntArgb,
+ OGLSurfaceData.PF_INT_ARGB),
+- new OGLSurfaceToSwBlit(SurfaceType.IntArgbPre,
+- OGLSurfaceData.PF_INT_ARGB_PRE),
++ blitSurfaceToIntArgbPre,
+
+ // sw->surface ops
+ blitIntArgbPreToSurface,
+@@ -102,7 +105,14 @@
+ CompositeType.AnyAlpha,
+ blitIntArgbPreToSurface),
+
+- new OGLAnyCompositeBlit(),
++ new OGLAnyCompositeBlit(OGLSurfaceData.OpenGLSurface,
++ blitSurfaceToIntArgbPre,
++ blitSurfaceToIntArgbPre,
++ blitIntArgbPreToSurface),
++ new OGLAnyCompositeBlit(SurfaceType.Any,
++ null,
++ blitSurfaceToIntArgbPre,
++ blitIntArgbPreToSurface),
+
+ new OGLSwToSurfaceScale(SurfaceType.IntRgb,
+ OGLSurfaceData.PF_INT_RGB),
+@@ -869,11 +879,26 @@
+ }
+ }
+
++/**
++ * This general OGLAnyCompositeBlit implementation can convert any source/target
++ * surface to an intermediate surface using convertsrc/convertdst loops, applies
++ * necessary composite operation, and then uses convertresult loop to get the
++ * intermediate surface down to OpenGL.
++ */
+ final class OGLAnyCompositeBlit extends Blit {
++
+ private WeakReference<SurfaceData> dstTmp;
++ private WeakReference<SurfaceData> srcTmp;
++ private final Blit convertsrc;
++ private final Blit convertdst;
++ private final Blit convertresult;
+
+- OGLAnyCompositeBlit() {
+- super(SurfaceType.Any, CompositeType.Any, OGLSurfaceData.OpenGLSurface);
++ OGLAnyCompositeBlit(SurfaceType srctype, Blit convertsrc, Blit convertdst,
++ Blit convertresult) {
++ super(srctype, CompositeType.Any, OGLSurfaceData.OpenGLSurface);
++ this.convertsrc = convertsrc;
++ this.convertdst = convertdst;
++ this.convertresult = convertresult;
+ }
+
+ public synchronized void Blit(SurfaceData src, SurfaceData dst,
+@@ -881,9 +906,20 @@
+ int sx, int sy, int dx, int dy,
+ int w, int h)
+ {
+- Blit convertdst = Blit.getFromCache(dst.getSurfaceType(),
+- CompositeType.SrcNoEa,
+- SurfaceType.IntArgbPre);
++ if (convertsrc != null) {
++ SurfaceData cachedSrc = null;
++ if (srcTmp != null) {
++ // use cached intermediate surface, if available
++ cachedSrc = srcTmp.get();
++ }
++ // convert source to IntArgbPre
++ src = convertFrom(convertsrc, src, sx, sy, w, h, cachedSrc,
++ BufferedImage.TYPE_INT_ARGB_PRE);
++ if (src != cachedSrc) {
++ // cache the intermediate surface
++ srcTmp = new WeakReference<>(src);
++ }
++ }
+
+ SurfaceData cachedDst = null;
+
+@@ -906,12 +942,8 @@
+ // cache the intermediate surface
+ dstTmp = new WeakReference(dstBuffer);
+ }
+-
+ // now blit the buffer back to the destination
+- convertdst = Blit.getFromCache(dstBuffer.getSurfaceType(),
+- CompositeType.SrcNoEa,
+- dst.getSurfaceType());
+- convertdst.Blit(dstBuffer, dst, AlphaComposite.Src,
+- clip, 0, 0, dx, dy, w, h);
++ convertresult.Blit(dstBuffer, dst, AlphaComposite.Src, clip, 0, 0, dx,
++ dy, w, h);
+ }
+ }
+--- ./jdk/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java Wed Jul 01 21:53:30 2015 -0700
+@@ -26,6 +26,7 @@
+ package sun.java2d.opengl;
+
+ import java.awt.AlphaComposite;
++import java.awt.Composite;
+ import java.awt.GraphicsEnvironment;
+ import java.awt.Rectangle;
+ import java.awt.Transparency;
+@@ -400,8 +401,8 @@
+ /**
+ * For now, we can only render LCD text if:
+ * - the fragment shader extension is available, and
+- * - blending is disabled, and
+- * - the source color is opaque
++ * - the source color is opaque, and
++ * - blending is SrcOverNoEa or disabled
+ * - and the destination is opaque
+ *
+ * Eventually, we could enhance the native OGL text rendering code
+@@ -411,9 +412,19 @@
+ public boolean canRenderLCDText(SunGraphics2D sg2d) {
+ return
+ graphicsConfig.isCapPresent(CAPS_EXT_LCD_SHADER) &&
+- sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
++ sg2d.surfaceData.getTransparency() == Transparency.OPAQUE &&
+ sg2d.paintState <= SunGraphics2D.PAINT_OPAQUECOLOR &&
+- sg2d.surfaceData.getTransparency() == Transparency.OPAQUE;
++ (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY ||
++ (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA && canHandleComposite(sg2d.composite)));
++ }
++
++ private boolean canHandleComposite(Composite c) {
++ if (c instanceof AlphaComposite) {
++ AlphaComposite ac = (AlphaComposite)c;
++
++ return ac.getRule() == AlphaComposite.SRC_OVER && ac.getAlpha() >= 1f;
++ }
++ return false;
+ }
+
+ public void validatePipe(SunGraphics2D sg2d) {
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -47,9 +47,13 @@
+ \ enable verbose output\n\
+ \ -version print product version and exit\n\
+ \ -version:<value>\n\
++\ Warning: this feature is deprecated and will be removed\n\
++\ in a future release.\n\
+ \ require the specified version to run\n\
+ \ -showversion print product version and continue\n\
+ \ -jre-restrict-search | -no-jre-restrict-search\n\
++\ Warning: this feature is deprecated and will be removed\n\
++\ in a future release.\n\
+ \ include/exclude user private JREs in the version search\n\
+ \ -? -help print this help message\n\
+ \ -X print help on non-standard options\n\
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_de.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_de.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2014, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ weil die Ausf\u00FChrung auf einem Server-Class-Rechner erfolgt.\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n -classpath <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n und ZIP-Archiven zur Suche nach Klassendateien.\n -D<name>=<value>\n Legt eine Systemeigenschaft fest\n -verbose:[class|gc|jni]\n Aktiviert die Verbose-Ausgabe\n -version Druckt Produktversion und beendet das Programm\n -version:<value>\n Erfordert die angegebene Version zur Ausf\u00FChrung\n -showversion Druckt Produktversion und f\u00E4hrt fort\n -jre-restrict-search | -no-jre-restrict-search\n Bezieht private JREs des Benutzers in Versionssuche ein bzw. schlie\u00DFt sie aus\n -? -help Druckt diese Hilfemeldung\n -X Druckt Hilfe zu Nicht-Standardoptionen\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n Aktiviert Assertions mit angegebener Granularit\u00E4t\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n Deaktiviert Assertions mit angegebener Granularit\u00E4t\n -esa | -enablesystemassertions\n Aktiviert Systemassertionen\n -dsa | -disablesystemassertions\n Deaktiviert Systemassertionen\n -agentlib:<libname>[=<options>]\n L\u00E4dt native Agent Library <libname>, z.B. -agentlib:hprof\n siehe auch -agentlib:jdwp=help und -agentlib:hprof=help\n -agentpath:<pathname>[=<options>]\n L\u00E4dt native Agent Library nach vollem Pfadnamen\n -javaagent:<jarpath>[=<options>]\n L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n -splash:<imagepath>\n Zeigt Startbildschirm mit angegebenem Bild\nWeitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html
++java.launcher.opt.footer =\ -cp <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n -classpath <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n und ZIP-Archiven zur Suche nach Klassendateien.\n -D<name>=<value>\n Legt eine Systemeigenschaft fest\n -verbose:[class|gc|jni]\n Aktiviert die Verbose-Ausgabe\n -version Druckt Produktversion und beendet das Programm\n -version:<value>\n Warnung: Diese Funktion ist veraltet und wird in einer\n neueren Version entfernt.\n Erfordert die angegebene Version zur Ausf\u00FChrung\n -showversion Druckt Produktversion und f\u00E4hrt fort\n -jre-restrict-search | -no-jre-restrict-search\n Warnung: Diese Funktion ist veraltet und wird in einer\n neueren Version entfernt.\n Bezieht private JREs des Benutzers in Versionssuche ein bzw. schlie\u00DFt sie aus\n -? -help Druckt diese Hilfemeldung\n -X Druckt Hilfe zu Nicht-Standardoptionen\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n Aktiviert Assertions mit angegebener Granularit\u00E4t\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n Deaktiviert Assertions mit angegebener Granularit\u00E4t\n -esa | -enablesystemassertions\n Aktiviert Systemassertionen\n -dsa | -disablesystemassertions\n Deaktiviert Systemassertionen\n -agentlib:<libname>[=<options>]\n L\u00E4dt native Agent Library <libname>, z.B. -agentlib:hprof\n siehe auch -agentlib:jdwp=help und -agentlib:hprof=help\n -agentpath:<pathname>[=<options>]\n L\u00E4dt native Agent Library nach vollem Pfadnamen\n -javaagent:<jarpath>[=<options>]\n L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n -splash:<imagepath>\n Zeigt Startbildschirm mit angegebenem Bild\nWeitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xbootclasspath:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n Legt Suchpfad f\u00FCr Bootstrap-Klassen und Ressourcen fest\n -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n H\u00E4ngt an das Ende des Bootstrap Classpath an\n -Xbootclasspath/p:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n Stellt Bootstrap Classpath voran\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen an\n -Xnoclassgc Deaktiviert Klassen-Garbage Collection\n -Xincgc Aktiviert inkrementelle Garbage Collection\n -Xloggc:<file> Loggt GC-Status in einer Datei mit Zeitstempeln\n -Xbatch Deaktiviert Hintergrundkompilierung\n -Xms<size> Legt anf\u00E4ngliche Java Heap-Gr\u00F6\u00DFe fest\n -Xmx<size> Legt maximale Java Heap-Gr\u00F6\u00DFe fest\n -Xss<size> Legt Java-Threadstackgr\u00F6\u00DFe fest\n -Xprof Gibt CPU-Profiling-Daten aus\n -Xfuture Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n -Xrs Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n -Xshare:off Kein Versuch, gemeinsame Klassendaten zu verwenden\n -Xshare:auto Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n -Xshare:on Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_es.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_es.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2013, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ porque la ejecuci\u00F3n se est\u00E1 llevando a cabo en una m\u00E1quina de clase de servidor.\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <ruta de acceso de b\u00FAsqueda de clases de los directorios y los archivos zip/jar>\n -classpath <ruta de acceso de b\u00FAsqueda de clases de los directorios y los archivos zip/jar>\n Lista separada por {0} de directorios, archivos JAR\n y archivos ZIP para buscar archivos de clase.\n -D<nombre>=<valor>\n definir una propiedad del sistema\n -verbose:[class|gc|jni]\n activar la salida verbose\n -version imprimir la versi\u00F3n del producto y salir\n -version:<valor>\n es necesario que se ejecute la versi\u00F3n especificada\n -showversion imprimir la versi\u00F3n del producto y continuar\n -jre-restrict-search | -no-jre-restrict-search\n incluir/excluir JRE privados de usuario en la b\u00FAsqueda de versi\u00F3n\n -? -help imprimir este mensaje de ayuda\n -X imprimir la ayuda sobre las opciones que no sean est\u00E1ndar\n -ea[:<nombre_paquete>...|:<nombre_clase>]\n -enableassertions[:<nombre_paquete>...|:<nombre_clase>]\n activar afirmaciones con la granularidad especificada\n -da[:<nombre_paquete>...|:<nombre_clase>]\n -disableassertions[:<nombre_paquete>...|:<nombre_clase>]\n desactivar afirmaciones con la granularidad especificada\n -esa | -enablesystemassertions\n activar afirmaciones del sistema\n -dsa | -disablesystemassertions\n desactivar afirmaciones del sistema\n -agentlib:<nombre_bib>[=<opciones>]\n cargar la biblioteca de agente nativa <nombre_bib>, como -agentlib:hprof\n v\u00E9ase tambi\u00E9n -agentlib:jdwp=help y -agentlib:hprof=help\n -agentpath:<nombre_ruta_acceso>[=<opciones>]\n cargar biblioteca de agente nativa con el nombre de la ruta de acceso completa\n -javaagent:<ruta_acceso_jar>[=<opciones>]\n cargar agente de lenguaje de programaci\u00F3n Java, v\u00E9ase java.lang.instrument\n -splash:<ruta_acceso_imagen>\n mostrar una pantalla de presentaci\u00F3n con la imagen especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n.
++java.launcher.opt.footer =\ -cp <ruta de acceso de b\u00FAsqueda de clases de los directorios y los archivos zip/jar>\n -classpath <ruta de acceso de b\u00FAsqueda de clases de los directorios y los archivos zip/jar>\n Lista separada por {0} de directorios, archivos JAR\n y archivos ZIP para buscar archivos de clase.\n -D<nombre>=<valor>\n definir una propiedad del sistema\n -verbose:[class|gc|jni]\n activar la salida verbose\n -version imprimir la versi\u00F3n del producto y salir\n -version:<valor>\n Advertencia: Esta funci\u00F3n est\u00E1 anticuada y se eliminar\u00E1\n en una versi\u00F3n futura.\n es necesario que se ejecute la versi\u00F3n especificada\n -showversion imprimir la versi\u00F3n del producto y continuar\n -jre-restrict-search | -no-jre-restrict-search\n Advertencia: Esta funci\u00F3n est\u00E1 anticuada y se eliminar\u00E1\n en una versi\u00F3n futura.\n incluir/excluir JRE privados de usuario en la b\u00FAsqueda de versi\u00F3n\n -? -help imprimir este mensaje de ayuda\n -X imprimir la ayuda sobre las opciones que no sean est\u00E1ndar\n -ea[:<nombre_paquete>...|:<nombre_clase>]\n -enableassertions[:<nombre_paquete>...|:<nombre_clase>]\n activar afirmaciones con la granularidad especificada\n -da[:<nombre_paquete>...|:<nombre_clase>]\n -disableassertions[:<nombre_paquete>...|:<nombre_clase>]\n desactivar afirmaciones con la granularidad especificada\n -esa | -enablesystemassertions\n activar afirmaciones del sistema\n -dsa | -disablesystemassertions\n desactivar afirmaciones del sistema\n -agentlib:<nombre_bib>[=<opciones>]\n cargar la biblioteca de agente nativa <nombre_bib>, como -agentlib:hprof\n v\u00E9ase tambi\u00E9n -agentlib:jdwp=help y -agentlib:hprof=help\n -agentpath:<nombre_ruta_acceso>[=<opciones>]\n cargar biblioteca de agente nativa con el nombre de la ruta de acceso completa\n -javaagent:<ruta_acceso_jar>[=<opciones>]\n cargar agente de lenguaje de programaci\u00F3n Java, v\u00E9ase java.lang.instrument\n -splash:<ruta_acceso_imagen>\n mostrar una pantalla de presentaci\u00F3n con la imagen especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n.
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xint s\u00F3lo ejecuci\u00F3n de modo interpretado\n -Xbootclasspath:<directorios y archivos zip/jar separados por {0}>\n definir la ruta de acceso de b\u00FAsqueda para los recursos y clases de inicializaci\u00F3n de datos\n -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n agregar al final de la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xbootclasspath/p:<directorios y archivos zip/jar separados por {0}>\n anteponer a la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xincgc activar la recolecci\u00F3n de basura de clases\n -Xloggc:<archivo> registrar el estado de GC en un archivo con registros de hora\n -Xbatch desactivar compilaci\u00F3n en segundo plano\n -Xms<tama\u00F1o> definir tama\u00F1o de pila Java inicial\n -Xmx<tama\u00F1o> definir tama\u00F1o de pila Java m\u00E1ximo\n -Xss<tama\u00F1o> definir tama\u00F1o de la pila del thread de Java\n -Xprof datos de salida de creaci\u00F3n de perfil de CPU\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se emitir\u00E1 un fallo.\n -XshowSettings mostrar todos los valores y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:vm mostrar todos los valores de la VM y continuar\n -XshowSettings:properties\n mostrar todos los valores de las propiedades y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n\nLas opciones -X no son est\u00E1ndar, por lo que podr\u00EDan cambiarse sin previo aviso.\n
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2013, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ car vous ex\u00E9cutez une machine de classe de serveur.\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <class search path of directories and zip/jar files>\n -classpath <class search path of directories and zip/jar files>\n Liste de r\u00E9pertoires, d''archives JAR et\n d''archives ZIP s\u00E9par\u00E9s par des {0}, dans laquelle rechercher les fichiers de classe.\n -D<name>=<value>\n d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n -verbose:[class|gc|jni]\n activation de la sortie en mode verbose\n -version impression de la version du produit et fin de l''op\u00E9ration\n -version:<value>\n ex\u00E9cution de la version sp\u00E9cifi\u00E9e obligatoire\n -showversion impression de la version du produit et poursuite de l''op\u00E9ration\n -jre-restrict-search | -no-jre-restrict-search\n inclusion/exclusion des environnements JRE priv\u00E9s de l''utilisateur dans la recherche de version\n -? -help impression du message d''aide\n -X impression de l''aide sur les options non standard\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -esa | -enablesystemassertions\n activation des assertions syst\u00E8me\n -dsa | -disablesystemassertions\n d\u00E9sactivation des assertions syst\u00E8me\n -agentlib:<libname>[=<options>]\n chargement de la biblioth\u00E8que d''agent natif <libname>, par exemple -agentlib:hprof\n voir \u00E9galement, -agentlib:jdwp=help et -agentlib:hprof=help\n -agentpath:<pathname>[=<options>]\n chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n -javaagent:<jarpath>[=<options>]\n chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n -splash:<imagepath>\n affichage de l''\u00E9cran d''accueil avec l''image sp\u00E9cifi\u00E9e\nVoir http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails.
++java.launcher.opt.footer =\ -cp <class search path of directories and zip/jar files>\n -classpath <class search path of directories and zip/jar files>\n Liste de r\u00E9pertoires, d''archives JAR et\n d''archives ZIP s\u00E9par\u00E9s par des {0}, dans laquelle rechercher les fichiers de classe.\n -D<name>=<value>\n d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n -verbose:[class|gc|jni]\n activation de la sortie en mode verbose\n -version impression de la version du produit et fin de l''op\u00E9ration\n -version:<value>\n Avertissement : cette fonctionnalit\u00E9 est en phase d''abandon et sera enlev\u00E9e\n dans une version future.\n ex\u00E9cution de la version sp\u00E9cifi\u00E9e obligatoire\n -showversion impression de la version du produit et poursuite de l''op\u00E9ration\n -jre-restrict-search | -no-jre-restrict-search\n Avertissement : cette fonctionnalit\u00E9 est en phase d''abandon et sera enlev\u00E9e\n dans une version future.\n inclusion/exclusion des environnements JRE priv\u00E9s de l''utilisateur dans la recherche de version\n -? -help impression du message d''aide\n -X impression de l''aide sur les options non standard\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -esa | -enablesystemassertions\n activation des assertions syst\u00E8me\n -dsa | -disablesystemassertions\n d\u00E9sactivation des assertions syst\u00E8me\n -agentlib:<libname>[=<options>]\n chargement de la biblioth\u00E8que d''agent natif <libname>, par exemple -agentlib:hprof\n voir \u00E9galement, -agentlib:jdwp=help et -agentlib:hprof=help\n -agentpath:<pathname>[=<options>]\n chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n -javaagent:<jarpath>[=<options>]\n chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n -splash:<imagepath>\n affichage de l''\u00E9cran d''accueil avec l''image sp\u00E9cifi\u00E9e\nVoir http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails.
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xbootclasspath:<directories and zip/jar files separated by {0}>\n d\u00E9finition du chemin de recherche pour les ressources et classes bootstrap\n -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xbootclasspath/p:<directories and zip/jar files separated by {0}>\n ajout au d\u00E9but du chemin de classe bootstrap\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette (garbage collection) de la classe\n -Xincgc activation de l''op\u00E9ration de ramasse-miette (garbage collection) incr\u00E9mentielle\n -Xloggc:<file> journalisation du statut de l''op\u00E9ration de ramasse-miette (garbage collection) dans un fichier avec horodatages\n -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xms<size> d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx<size> d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xss<size> d\u00E9finition de la taille de pile de thread Java\n -Xprof sortie des donn\u00E9es de profilage de l''unit\u00E9 centrale\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n\nLes options -X ne sont pas des options standard et peuvent faire l''objet de modifications sans pr\u00E9avis.\n
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_it.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_it.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2013, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ perch\u00E9 si utilizza un computer di classe server.\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <classpath di ricerca di directory e file zip/jar>\n -classpath <classpath di ricerca di directory e file zip/jar>\n Una lista separata da {0} di directory, archivi JAR,\n e archivi ZIP utilizzata per la ricerca di file di classe.\n -D<nome>=<valore>\n imposta una propriet\u00E0 di sistema\n -verbose:[class|gc|jni]\n abilita l''output descrittivo\n -version stampa la versione del prodotto ed esce\n -version:<valore>\n richiede l''esecuzione della versione specificata\n -showversion stampa la versione del prodotto e continua\n -jre-restrict-search | -no-jre-restrict-search\n include/esclude gli ambienti JRE privati dell''utente nella ricerca della versione\n -? -help stampa questo messaggio della Guida\n -X stampa la Guida sulle opzioni non standard\n -ea[:<nomepackage>...|:<nomeclasse>]\n -enableassertions[:<nomepackage>...|:<nomeclasse>]\n abilita le asserzioni con la granularit\u00E0 specificata\n -da[:<nomepackage>...|:<nomeclasse>]\n -disableassertions[:<nomepackage>...|:<nomeclasse>]\n disabilita le asserzioni con la granularit\u00E0 specificata\n -esa | -enablesystemassertions\n abilita le asserzioni di sistema\n -dsa | -disablesystemassertions\n disabilita le asserzioni di sistema\n -agentlib:<nomelib>[=<opzioni>]\n carica la libreria agenti nativa <nomelib>, ad esempio -agentlib:hprof\n vedere anche, -agentlib:jdwp=help and -agentlib:hprof=help\n -agentpath:<nomepercorso>[=<opzioni>]\n carica la libreria agenti nativa con il percorso completo\n -javaagent:<percorsojar>[=<opzioni>]\n carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument\n -splash:<percorsoimmagine>\n mostra la schermata iniziale con l''immagine specificata\nPer ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html.
++java.launcher.opt.footer =\ -cp <classpath di ricerca di directory e file zip/jar>\n -classpath <classpath di ricerca di directory e file zip/jar>\n Una lista separata da {0} di directory, archivi JAR,\n e archivi ZIP utilizzata per la ricerca di file di classe.\n -D<nome>=<valore>\n imposta una propriet\u00E0 di sistema\n -verbose:[class|gc|jni]\n abilita l''output descrittivo\n -version stampa la versione del prodotto ed esce\n -version:<valore>\n Attenzione: questa funzione \u00E8 obsoleta e sar\u00E0 rimossa\n in una release futura.\n -showversion stampa la versione del prodotto e continua\n -jre-restrict-search | -no-jre-restrict-search\n Attenzione: questa funzione \u00E8 obsoleta e sar\u00E0 rimossa\n in una release futura.\n -? -help stampa questo messaggio della Guida\n -X stampa la Guida sulle opzioni non standard\n -ea[:<nomepackage>...|:<nomeclasse>]\n -enableassertions[:<nomepackage>...|:<nomeclasse>]\n abilita le asserzioni con la granularit\u00E0 specificata\n -da[:<nomepackage>...|:<nomeclasse>]\n -disableassertions[:<nomepackage>...|:<nomeclasse>]\n disabilita le asserzioni con la granularit\u00E0 specificata\n -esa | -enablesystemassertions\n abilita le asserzioni di sistema\n -dsa | -disablesystemassertions\n disabilita le asserzioni di sistema\n -agentlib:<nomelib>[=<opzioni>]\n carica la libreria agenti nativa <nomelib>, ad esempio -agentlib:hprof\n vedere anche, -agentlib:jdwp=help e -agentlib:hprof=help\n -agentpath:<nomepercorso>[=<opzioni>]\n carica la libreria agenti nativa con il percorso completo\n -javaagent:<percorsojar>[=<opzioni>]\n carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument\n -splash:<percorsoimmagine>\n mostra la schermata iniziale con l''immagine specificata\nPer ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html.
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed esecuzione in modalit\u00E0 mista (impostazione predefinita)\n -Xint esecuzione solo in modalit\u00E0 convertita\n -Xbootclasspath:<directory e file zip/jar separati da {0}>\n imposta il percorso di ricerca per le classi e le risorse di bootstrap\n -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n aggiunge alla fine del classpath di bootstrap\n -Xbootclasspath/p:<directory e file zip/jar separati da {0}>\n antepone al classpath di bootstrap\n -Xdiag mostra messaggi di diagnostica aggiuntivi\n -Xnoclassgc disabilita la garbage collection della classe\n -Xincgc abilita la garbage collection incrementale\n -Xloggc:<file> registra lo stato GC in un file di log con indicatori orari\n -Xbatch disabilita la compilazione in background\n -Xms<dimensione> imposta la dimensione heap Java iniziale\n -Xmx<dimensione> imposta la dimensione heap Java massima\n -Xss<dimensione> imposta la dimensione dello stack di thread Java\n -Xprof visualizza i dati di profilo della CPU\n -Xfuture abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n -Xrs riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n -Xcheck:jni esegue controlli aggiuntivi per le funzioni JNI\n -Xshare:off non tenta di utilizzare i dati della classe condivisi\n -Xshare:auto utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n -Xshare:on richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings mostra tutte le impostazioni e continua\n -XshowSettings:all\n mostra tutte le impostazioni e continua\n -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n -XshowSettings:properties\n mostra tutte le impostazioni delle propriet\u00E0 e continua\n -XshowSettings:locale\n mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n\nLe opzioni -X non sono opzioni standard e sono soggette a modifiche senza preavviso.\n
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2013, 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
+@@ -34,7 +34,8 @@
+ java.launcher.ergo.message2 =\ \u3053\u308C\u306F\u30B5\u30FC\u30D0\u30FC\u30AF\u30E9\u30B9\u306E\u30DE\u30B7\u30F3\u3067\u5B9F\u884C\u3057\u3066\u3044\u308B\u305F\u3081\u3067\u3059\u3002\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n -classpath <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3067\u3059\u3002\n -D<name>=<value>\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n -verbose:[class|gc|jni]\n \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n -version \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n -version:<value>\n \u6307\u5B9A\u3057\u305F\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5B9F\u884C\u306B\u5FC5\u9808\u306B\u3059\u308B\n -showversion \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n -jre-restrict-search | -no-jre-restrict-search\n \u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8JRE\u3092\u30D0\u30FC\u30B8\u30E7\u30F3\u691C\u7D22\u306B\u542B\u3081\u308B/\u9664\u5916\u3059\u308B\n -? -help \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -esa | -enablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -dsa | -disablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -agentlib:<libname>[=<options>]\n \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA<libname>\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:hprof\n -agentlib:jdwp=help\u3068-agentlib:hprof=help\u3082\u53C2\u7167\n -agentpath:<pathname>[=<options>]\n \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n -javaagent:<jarpath>[=<options>]\n Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n -splash:<imagepath>\n \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n\u8A73\u7D30\u306Fhttp://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
++java.launcher.opt.footer =\ -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n -classpath <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3067\u3059\u3002\n -D<name>=<value>\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n -verbose:[class|gc|jni]\n \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n -version \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n -version:<value>\n \u8B66\u544A: \u3053\u306E\u6A5F\u80FD\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u8A73\u7D30\u306E\u30EA\u30EA\u30FC\u30B9\u3067\n \u5EC3\u6B62\u3055\u308C\u307E\u3059\u3002\n \u6307\u5B9A\u3057\u305F\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5B9F\u884C\u306B\u5FC5\u9808\u306B\u3059\u308B\n -showversion \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n -jre-restrict-search | -no-jre-restrict-search\n \u8B66\u544A: \u3053\u306E\u6A5F\u80FD\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u8A73\u7D30\u306E\u30EA\u30EA\u30FC\u30B9\u3067\n \u5EC3\u6B62\u3055\u308C\u307E\u3059\u3002\n \u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8JRE\u3092\u30D0\u30FC\u30B8\u30E7\u30F3\u691C\u7D22\u306B\u542B\u3081\u308B/\u9664\u5916\u3059\u308B\n -? -help \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -esa | -enablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -dsa | -disablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -agentlib:<libname>[=<options>]\n \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA<libname>\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:hprof\n -agentlib:jdwp=help\u3068-agentlib:hprof=help\u3082\u53C2\u7167\n -agentpath:<pathname>[=<options>]\n \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n -javaagent:<jarpath>[=<options>]\n Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n -splash:<imagepath>\n \
++\u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n\u8A73\u7D30\u306Fhttp://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xbootclasspath:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u306E\u30AF\u30E9\u30B9\u3068\u30EA\u30BD\u30FC\u30B9\u306E\u691C\u7D22\u30D1\u30B9\u3092\u8A2D\u5B9A\u3059\u308B\n -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xbootclasspath/p:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u524D\u306B\u4ED8\u52A0\u3059\u308B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xincgc \u5897\u5206\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xloggc:<file> \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xms<size> Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx<size> Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xss<size> Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2013, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ \uC11C\uBC84\uAE09 \uC2DC\uC2A4\uD15C\uC5D0\uC11C \uC2E4\uD589 \uC911\uC774\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n -classpath <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n -D<name>=<value>\n \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n -verbose:[class|gc|jni]\n \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -version \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n -version:<value>\n \uC2E4\uD589\uD560 \uBC84\uC804\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.\n -showversion \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -jre-restrict-search | -no-jre-restrict-search\n \uBC84\uC804 \uAC80\uC0C9\uC5D0\uC11C \uC0AC\uC6A9\uC790 \uC804\uC6A9 JRE\uB97C \uD3EC\uD568/\uC81C\uC678\uD569\uB2C8\uB2E4.\n -? -help \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -X \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -esa | -enablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -dsa | -disablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -agentlib:<libname>[=<options>]\n <libname> \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:hprof).\n -agentlib:jdwp=help \uBC0F -agentlib:hprof=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -agentpath:<pathname>[=<options>]\n \uC804\uCCB4 \uACBD\uB85C\uBA85\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n -javaagent:<jarpath>[=<options>]\n Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -splash:<imagepath>\n \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.
++java.launcher.opt.footer =\ -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n -classpath <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n -D<name>=<value>\n \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n -verbose:[class|gc|jni]\n \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -version \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n -version:<value>\n \uACBD\uACE0: \uC774 \uAE30\uB2A5\uC740 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBA70\n \uC774\uD6C4 \uB9B4\uB9AC\uC2A4\uC5D0\uC11C \uC81C\uAC70\uB429\uB2C8\uB2E4.\n \uC2E4\uD589\uD560 \uBC84\uC804\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.\n -showversion \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -jre-restrict-search | -no-jre-restrict-search\n \uACBD\uACE0: \uC774 \uAE30\uB2A5\uC740 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBA70\n \uC774\uD6C4 \uB9B4\uB9AC\uC2A4\uC5D0\uC11C \uC81C\uAC70\uB429\uB2C8\uB2E4.\n \uBC84\uC804 \uAC80\uC0C9\uC5D0\uC11C \uC0AC\uC6A9\uC790 \uC804\uC6A9 JRE\uB97C \uD3EC\uD568/\uC81C\uC678\uD569\uB2C8\uB2E4.\n -? -help \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -X \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -esa | -enablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -dsa | -disablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -agentlib:<libname>[=<options>]\n <libname> \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:hprof).\n -agentlib:jdwp=help \uBC0F -agentlib:hprof=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -agentpath:<pathname>[=<options>]\n \uC804\uCCB4 \uACBD\uB85C\uBA85\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n -javaagent:<jarpath>[=<options>]\n Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -splash:<imagepath>\n \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xint \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xbootclasspath:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uBC0F \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uAC80\uC0C9 \uACBD\uB85C\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xbootclasspath/p:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uC55E\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xdiag \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xnoclassgc \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xincgc \uC99D\uBD84\uC801\uC778 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xloggc:<file> \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n -Xbatch \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xms<size> \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xmx<size> \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xss<size> Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xprof CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n -Xfuture \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xrs Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n -Xcheck:jni JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -Xshare:off \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -Xshare:auto \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xshare:on \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n -XshowSettings \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:all\n \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:properties\n \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:locale\n \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\n-X \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2014, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ porque a execu\u00E7\u00E3o est\u00E1 sendo feita em uma m\u00E1quina de classe de servidor.\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n -classpath <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n Uma lista separada por {0} de diret\u00F3rios, archives JAR\n e archives ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n -D<nome>=<valor>\n define uma propriedade do sistema\n -verbose:[class|gc|jni]\n ativa a sa\u00EDda detalhada\n -version imprime a vers\u00E3o do produto e sai do programa\n -version:<valor>\n requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n -showversion imprime a vers\u00E3o do produto e continua\n -jre-restrict-search | -no-jre-restrict-search\n inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n -? -help imprime esta mensagem de ajuda\n -X imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n -ea[:<nome do pacote>...|:<nome da classe>]\n -enableassertions[:<nome do pacote>...|:<nome da classe>]\n ativa asser\u00E7\u00F5es com granularidade especificada\n -da[:<nome do pacote>...|:<nome da classe>]\n -disableassertions[:<nome do pacote>...|:<nome da classe>]\n desativa asser\u00E7\u00F5es com granularidade especificada\n -esa | -enablesystemassertions\n ativa asser\u00E7\u00F5es do sistema\n -dsa | -disablesystemassertions\n desativa asser\u00E7\u00F5es do sistema\n -agentlib:<nome da biblioteca>[=<op\u00E7\u00F5es>]\n carrega a biblioteca de agentes nativa <nome da biblioteca>, por exemplo: -agentlib:hprof\n consulte tamb\u00E9m: -agentlib:jdwp=help e -agentlib:hprof=help\n -agentpath:<nome do caminho>[=<op\u00E7\u00F5es>]\n carrega a biblioteca de agentes nativa com base no nome do caminho completo\n -javaagent:<caminho do arquivo jar>[=<op\u00E7\u00F5es>]\n carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n -splash:<caminho da imagem>\n mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
++java.launcher.opt.footer =\ -cp <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n -classpath <caminho de pesquisa da classe dos diret\u00F3rios e arquivos zip/jar>\n Uma lista separada por {0} de diret\u00F3rios, arquivos compactados JAR\n e arquivos compactados ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n -D<nome>=<valor>\n define uma propriedade do sistema\n -verbose:[class|gc|jni]\n ativa a sa\u00EDda detalhada\n -version imprime a vers\u00E3o do produto e sai do programa\n -version:<valor>\n Advert\u00EAncia: esta funcionalidade est\u00E1 obsoleta e ser\u00E1 removida\n em uma release futura.\n requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n -showversion imprime a vers\u00E3o do produto e continua\n -jre-restrict-search | -no-jre-restrict-search\n Advert\u00EAncia: esta funcionalidade est\u00E1 obsoleta e ser\u00E1 removida\n em uma release futura.\n inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n -? -help imprime esta mensagem de ajuda\n -X imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n -ea[:<nome do pacote>...|:<nome da classe>]\n -enableassertions[:<nome do pacote>...|:<nome da classe>]\n ativa asser\u00E7\u00F5es com granularidade especificada\n -da[:<nome do pacote>...|:<nome da classe>]\n -disableassertions[:<nome do pacote>...|:<nome da classe>]\n desativa asser\u00E7\u00F5es com granularidade especificada\n -esa | -enablesystemassertions\n ativa asser\u00E7\u00F5es do sistema\n -dsa | -disablesystemassertions\n desativa asser\u00E7\u00F5es do sistema\n -agentlib:<nome da biblioteca>[=<op\u00E7\u00F5es>]\n carrega a biblioteca de agentes nativa <nome da biblioteca>, por exemplo: -agentlib:hprof\n consulte tamb\u00E9m: -agentlib:jdwp=help e -agentlib:hprof=help\n -agentpath:<nome do caminho>[=<op\u00E7\u00F5es>]\n carrega a biblioteca de agentes nativa com base no nome do caminho completo\n -javaagent:<caminho do arquivo jar>[=<op\u00E7\u00F5es>]\n carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n -splash:<caminho da imagem>\n mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed execu\u00E7\u00E3o no modo misto (padr\u00E3o)\n -Xint execu\u00E7\u00E3o somente no modo interpretado\n -Xbootclasspath:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n define o caminho de pesquisa para classes e recursos de inicializa\u00E7\u00E3o\n -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n anexa no final do caminho da classe de inicializa\u00E7\u00E3o\n -Xbootclasspath/p:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n anexa no in\u00EDcio do caminho da classe de inicializa\u00E7\u00E3o\n -Xdiag mostra mensagens de diagn\u00F3stico adicionais\n -Xnoclassgc desativa a coleta de lixo da classe\n -Xincgc ativa a coleta de lixo incremental\n -Xloggc:<arquivo> registra o status do GC status em um arquivo com marca\u00E7\u00F5es de data e hor\u00E1rio\n -Xbatch desativa a compila\u00E7\u00E3o em segundo plano\n -Xms<tamanho> define o tamanho inicial do heap Java\n -Xmx<tamanho> define o tamanho m\u00E1ximo do heap Java\n -Xss<tamanho> define o tamanho da pilha de threads java\n -Xprof produz dados de perfil da cpu\n -Xfuture ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo de exig\u00EAncia, prevendo o valor padr\u00E3o futuro\n -Xrs reduz o uso de sinais do SO pelo(a) Java/VM (consulte a documenta\u00E7\u00E3o)\n -Xcheck:jni executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es da JNI\n -Xshare:off n\u00E3o tenta usar dados da classe compartilhada\n -Xshare:auto se poss\u00EDvel, usa dados da classe compartilhada (padr\u00E3o)\n -Xshare:on requer o uso de dados da classe compartilhada, caso contr\u00E1rio haver\u00E1 falha.\n -XshowSettings mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:all\n mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 vm e continua\n -XshowSettings:properties\n mostra todas as defini\u00E7\u00F5es da propriedade e continua\n -XshowSettings:locale\n mostra todas as defini\u00E7\u00F5es relativas \u00E0s configura\u00E7\u00F5es regionais e continua\n\nAs -X options n\u00E3o s\u00E3o padronizadas e est\u00E3o sujeitas a altera\u00E7\u00F5es sem aviso.\n
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2013, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ eftersom du k\u00F6r en serverklassmaskin.\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <klass\u00F6kv\u00E4g f\u00F6r kataloger och zip-/jar-filer>\n -classpath <klass\u00F6kv\u00E4g f\u00F6r kataloger och zip-/jar-filer>\n En {0}-separerad lista med kataloger, JAR-arkiv,\n och ZIP-arkiv f\u00F6r s\u00F6kning efter klassfiler.\n -D<name>=<value>\n ange en systemegenskap\n -verbose:[class|gc|jni]\n aktivera utf\u00F6rliga utdata\n -version skriv ut produktversionen och avsluta\n -version:<value>\n beg\u00E4r den specifika versionen som ska k\u00F6ras\n -showversion skriv ut produktversionen och forts\u00E4tt\n -jre-restrict-search | -no-jre-restrict-search\n inkludera/exkludera anv\u00E4ndarprivata JRE:er i versions\u00F6kningen\n -? -help skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n -X skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n aktivera verifiering med angiven detaljgrad\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n avaktivera verifiering med angiven detaljgrad\n -esa | -enablesystemassertions\n aktivera systemverifieringar\n -dsa | -disablesystemassertions\n avaktivera systemverifieringar\n -agentlib:<libname>[=<options>]\n ladda ursprungligt agentbibliotek <libname>, e.g. -agentlib:hprof\n se \u00E4ven -agentlib:jdwp=help och -agentlib:hprof=help\n -agentpath:<pathname>[=<options>]\n ladda ursprungligt agentbibliotek med helt s\u00F6kv\u00E4gsnamn\n -javaagent:<jarpath>[=<options>]\n ladda Java-programspr\u00E5ksagent, se java.lang.instrument\n -splash:<imagepath>\n visa v\u00E4lkomstsk\u00E4rm med angiven bild\nMer information finns p\u00E5 http://www.oracle.com/technetwork/java/javase/documentation/index.html.
++java.launcher.opt.footer =\ -cp <class search path of directories and zip/jar files>\n -classpath <class search path of directories and zip/jar files>\n En lista \u00F6ver kataloger, JAR-arkiv och och ZIP-arkiv\n f\u00F6r s\u00F6kning efter klassfiler avgr\u00E4nsad med {0}.\n -D<name>=<value>\n ange en systemegenskap\n -verbose:[class|gc|jni]\n aktivera utf\u00F6rliga utdata\n -version skriv ut produktversion och avsluta\n -version:<value>\n Varning: den h\u00E4r funktionen \u00E4r inaktuell och kommer\n att tas bort i en framtida utg\u00E5va.\n kr\u00E4v den angivna versionen f\u00F6r att k\u00F6ra\n -showversion skriv ut produktversion och forts\u00E4tt\n -jre-restrict-search | -no-jre-restrict-search\n Varning: den h\u00E4r funktionen \u00E4r inaktuell och kommer\n att tas bort i en framtida utg\u00E5va.\n inkludera/exkludera anv\u00E4ndarprivata JRE:er i versionss\u00F6kningen\n -? -help skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n -X skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n aktivera verifieringar med den angivna detaljgraden\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n avaktivera verifieringar med den angivna detaljgraden\n -esa | -enablesystemassertions\n aktivera systemverifieringar\n -dsa | -disablesystemassertions\n avaktivera systemverifieringar\n -agentlib:<libname>[=<options>]\n ladda det ursprungliga agentbiblioteket <libname>, t.ex. -agentlib:hprof\n se \u00E4ven -agentlib:jdwp=help och -agentlib:hprof=help\n -agentpath:<pathname>[=<options>]\n ladda det ursprungliga agentbiblioteket med det fullst\u00E4ndiga s\u00F6kv\u00E4gsnamnet\n -javaagent:<jarpath>[=<options>]\n ladda agenten f\u00F6r programmeringsspr\u00E5ket Java, se java.lang.instrument\n -splash:<imagepath>\n visa v\u00E4lkomstsk\u00E4rmen med den angivna bilden\nMer information finns p\u00E5 http://www.oracle.com/technetwork/java/javase/documentation/index.html.
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed k\u00F6rning i blandat l\u00E4ge (standard)\n -Xint endast k\u00F6rning i tolkat l\u00E4ge\n -Xbootclasspath:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n ange s\u00F6kv\u00E4g f\u00F6r programladdningsklasser och -resurser\n -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n l\u00E4gg till i slutet av programladdningsklassens s\u00F6kv\u00E4g\n -Xbootclasspath/p:<kataloger och zip-/jar-filer avgr\u00E4nsas med {0}>\n l\u00E4gg till i b\u00F6rjan av programladdningsklassens s\u00F6kv\u00E4g\n -Xdiag visa ytterligare diagnostiska meddelanden\n -Xnoclassgc avaktivera klassens skr\u00E4pinsamling\n -Xincgc aktivera inkrementell skr\u00E4pinsamling\n -Xloggc:<fil> logga GC-status till en fil med tidsst\u00E4mplar\n -Xbatch avaktivera bakgrundskompilering\n -Xms<storlek> ange ursprunglig storlek f\u00F6r Java-heap\n -Xmx<storlek> ange maximal storlek f\u00F6r Java-heap\n -Xss<storlek> ange storlek f\u00F6r java-tr\u00E5dsstack\n -Xprof utdata f\u00F6r processorprofilering\n -Xfuture aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n -Xrs minska OS-signalanv\u00E4ndning av Java/VM (se dokumentation)\n -Xcheck:jni utf\u00F6r ytterligare kontroller f\u00F6r JNI-funktioner\n -Xshare:off anv\u00E4nd inte delade klassdata\n -Xshare:auto anv\u00E4nd delade klassdata om det g\u00E5r (standard)\n -Xshare:on kr\u00E4v att delade klassdata anv\u00E4nds, annars slutf\u00F6r inte.\n -XshowSettings visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:all\n visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:properties\n visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n -XshowSettings:locale\n visa alla spr\u00E5krelaterade inst\u00E4llningar och forts\u00E4tt\n\n-X-alternativen \u00E4r inte standard och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n
+@@ -42,7 +42,7 @@
+ # Translators please note do not translate the options themselves
+ java.launcher.X.macosx.usage=\nF\u00F6ljande alternativ \u00E4r specifika f\u00F6r Mac OS X:\n -XstartOnFirstThread\n k\u00F6r huvudmetoden() p\u00E5 den f\u00F6rsta (AppKit) tr\u00E5den\n -Xdock:name=<application name>"\n \u00E5sidosatt standardapplikationsnamn visas i docka\n -Xdock:icon=<path to icon file>\n \u00E5sidosatt standardikon visas i docka\n\n
+
+-java.launcher.cls.error1=Fel: Hittar inte eller kan inte ladda huvudklassen {0}
++java.launcher.cls.error1=Fel: Kan inte hitta eller kan inte ladda huvudklassen {0}
+ java.launcher.cls.error2=Fel: Huvudmetoden \u00E4r inte {0} i klassen {1}, definiera huvudmetoden som:\n public static void main(String[] args)
+ java.launcher.cls.error3=Fel: Huvudmetoden m\u00E5ste returnera ett v\u00E4rde av typen void i klassen {0}, \ndefiniera huvudmetoden som:\n public static void main(String[] args)
+ java.launcher.cls.error4=Fel: Huvudmetoden finns inte i klassen {0}, definiera huvudmetoden som:\n public static void main(String[] args)\neller s\u00E5 m\u00E5ste en JavaFX-applikationsklass ut\u00F6ka {1}
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2013, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ \u56E0\u4E3A\u60A8\u662F\u5728\u670D\u52A1\u5668\u7C7B\u8BA1\u7B97\u673A\u4E0A\u8FD0\u884C\u3002\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55, JAR \u6863\u6848\n \u548C ZIP \u6863\u6848\u5217\u8868, \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u3002\n -D<\u540D\u79F0>=<\u503C>\n \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n -verbose:[class|gc|jni]\n \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n -version \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n -version:<\u503C>\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u8FD0\u884C\n -showversion \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n -jre-restrict-search | -no-jre-restrict-search\n \u5728\u7248\u672C\u641C\u7D22\u4E2D\u5305\u62EC/\u6392\u9664\u7528\u6237\u4E13\u7528 JRE\n -? -help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n -esa | -enablesystemassertions\n \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n -dsa | -disablesystemassertions\n \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n -agentlib:<libname>[=<\u9009\u9879>]\n \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 <libname>, \u4F8B\u5982 -agentlib:hprof\n \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help \u548C -agentlib:hprof=help\n -agentpath:<pathname>[=<\u9009\u9879>]\n \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n -javaagent:<jarpath>[=<\u9009\u9879>]\n \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n -splash:<imagepath>\n \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002
++java.launcher.opt.footer =\ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55, JAR \u6863\u6848\n \u548C ZIP \u6863\u6848\u5217\u8868, \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u3002\n -D<\u540D\u79F0>=<\u503C>\n \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n -verbose:[class|gc|jni]\n \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n -version \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n -version:<\u503C>\n \u8B66\u544A: \u6B64\u529F\u80FD\u5DF2\u8FC7\u65F6, \u5C06\u5728\n \u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u3002\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u8FD0\u884C\n -showversion \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n -jre-restrict-search | -no-jre-restrict-search\n \u8B66\u544A: \u6B64\u529F\u80FD\u5DF2\u8FC7\u65F6, \u5C06\u5728\n \u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u3002\n \u5728\u7248\u672C\u641C\u7D22\u4E2D\u5305\u62EC/\u6392\u9664\u7528\u6237\u4E13\u7528 JRE\n -? -help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n -esa | -enablesystemassertions\n \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n -dsa | -disablesystemassertions\n \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n -agentlib:<libname>[=<\u9009\u9879>]\n \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 <libname>, \u4F8B\u5982 -agentlib:hprof\n \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help \u548C -agentlib:hprof=help\n -agentpath:<pathname>[=<\u9009\u9879>]\n \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n -javaagent:<jarpath>[=<\u9009\u9879>]\n \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n -splash:<imagepath>\n \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4)\n -Xint \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n -Xbootclasspath:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u8BBE\u7F6E\u641C\u7D22\u8DEF\u5F84\u4EE5\u5F15\u5BFC\u7C7B\u548C\u8D44\u6E90\n -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n -Xbootclasspath/p:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u7F6E\u4E8E\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u4E4B\u524D\n -Xdiag \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n -Xnoclassgc \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n -Xincgc \u542F\u7528\u589E\u91CF\u5783\u573E\u6536\u96C6\n -Xloggc:<file> \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n -Xbatch \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n -Xms<size> \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n -Xmx<size> \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n -Xss<size> \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n -Xprof \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n -Xfuture \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n -Xrs \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n -Xcheck:jni \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n -Xshare:off \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4)\n -Xshare:on \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n -XshowSettings \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:all\n \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:properties\n \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:locale\n \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\n-X \u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
+--- ./jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2007, 2013, 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
+@@ -34,7 +34,7 @@
+ java.launcher.ergo.message2 =\ \u56E0\u70BA\u60A8\u6B63\u5728\u4F3A\u670D\u5668\u985E\u5225\u6A5F\u5668\u4E0A\u57F7\u884C\u3002\n
+
+ # Translators please note do not translate the options themselves
+-java.launcher.opt.footer =\ -cp <class search path of directories and zip/jar files>\n -classpath <class search path of directories and zip/jar files>\n \u4F7F\u7528 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA\n ZIP \u5B58\u6A94\u6E05\u55AE\u4F86\u641C\u5C0B\u985E\u5225\u6A94\u6848\u3002\n -D<name>=<value>\n \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n -verbose:[class|gc|jni]\n \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n -version \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n -version:<value>\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u57F7\u884C\n -showversion \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n -jre-restrict-search | -no-jre-restrict-search\n \u5728\u7248\u672C\u641C\u5C0B\u4E2D\u5305\u62EC/\u6392\u9664\u4F7F\u7528\u8005\u5C08\u7528 JRE\n -? -help \u5217\u5370\u6B64\u8AAA\u660E\u8A0A\u606F\n -X \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u555F\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u505C\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -esa | -enablesystemassertions\n \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n -dsa | -disablesystemassertions\n \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n -agentlib:<libname>[=<options>]\n \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB <libname>\uFF0C\u4F8B\u5982 -agentlib:hprof\n \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help \u8207 -agentlib:hprof=help\n -agentpath:<pathname>[=<options>]\n \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n -javaagent:<jarpath>[=<options>]\n \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n -splash:<imagepath>\n \u986F\u793A\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n\u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002
++java.launcher.opt.footer =\ -cp <class search path of directories and zip/jar files>\n -classpath <class search path of directories and zip/jar files>\n \u4F7F\u7528 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA\n ZIP \u5B58\u6A94\u6E05\u55AE\u4F86\u641C\u5C0B\u985E\u5225\u6A94\u6848\u3002\n -D<name>=<value>\n \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n -verbose:[class|gc|jni]\n \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n -version \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n -version:<value>\n \u8B66\u544A: \u6B64\u529F\u80FD\u5DF2\u4E0D\u518D\u4F7F\u7528\uFF0C\u5C07\u6703\u5F9E\n \u672A\u4F86\u7248\u672C\u4E2D\u79FB\u9664\u3002\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u57F7\u884C\n -showversion \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n -jre-restrict-search | -no-jre-restrict-search\n \u8B66\u544A: \u6B64\u529F\u80FD\u5DF2\u4E0D\u518D\u4F7F\u7528\uFF0C\u5C07\u6703\u5F9E\n \u672A\u4F86\u7248\u672C\u4E2D\u79FB\u9664\u3002\n \u5728\u7248\u672C\u641C\u5C0B\u4E2D\u5305\u62EC/\u6392\u9664\u4F7F\u7528\u8005\u5C08\u7528 JRE\n -? -help \u5217\u5370\u6B64\u8AAA\u660E\u8A0A\u606F\n -X \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u555F\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u505C\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -esa | -enablesystemassertions\n \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n -dsa | -disablesystemassertions\n \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n -agentlib:<libname>[=<options>]\n \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB <libname>\uFF0C\u4F8B\u5982 -agentlib:hprof\n \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help \u8207 -agentlib:hprof=help\n -agentpath:<pathname>[=<options>]\n \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n -javaagent:<jarpath>[=<options>]\n \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n -splash:<imagepath>\n \u986F\u793A\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n\u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002
+
+ # Translators please note do not translate the options themselves
+ java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xbootclasspath:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u8A2D\u5B9A\u555F\u52D5\u5B89\u88DD\u985E\u5225\u548C\u8CC7\u6E90\u7684\u641C\u5C0B\u8DEF\u5F91\n -Xbootclasspath/a:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xbootclasspath/p:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u524D\u9762\n -Xdiag \u986F\u793A\u5176\u4ED6\u7684\u8A3A\u65B7\u8A0A\u606F\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xincgc \u555F\u7528\u6F38\u9032\u8CC7\u6E90\u56DE\u6536\n -Xloggc:<file> \u5229\u7528\u6642\u6233\u5C07 GC \u72C0\u614B\u8A18\u9304\u81F3\u6A94\u6848\u4E2D\n -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xms<size> \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx<size> \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xss<size> \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xprof \u8F38\u51FA CPU \u5206\u6790\u8CC7\u6599\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xcheck:jni \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:auto \u5118\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\n -X \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
+--- ./jdk/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java Wed Jul 01 21:53:30 2015 -0700
+@@ -767,7 +767,7 @@
+ JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
+ connServer.start();
+ } catch (IOException e) {
+- if (connServer == null) {
++ if (connServer == null || connServer.getAddress() == null) {
+ throw new AgentConfigurationError(CONNECTOR_SERVER_IO_ERROR,
+ e, url.toString());
+ } else {
+--- ./jdk/src/share/classes/sun/management/resources/agent_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/management/resources/agent_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,6 @@
+ #
+ #
+-# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2004, 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
+@@ -43,7 +43,7 @@
+ agent.err.premain.notfound = premain(String) finns inte i agentklassen
+ agent.err.agentclass.access.denied = \u00C5tkomst till premain(String) nekad
+ agent.err.invalid.agentclass = Ogiltigt egenskapsv\u00E4rde f\u00F6r com.sun.management.agent.class
+-agent.err.invalid.state = Ogiltig agentstatus
++agent.err.invalid.state = Ogiltigt agenttillst\u00E5nd
+ agent.err.invalid.jmxremote.port = Ogiltigt com.sun.management.jmxremote.port-nummer
+ agent.err.invalid.jmxremote.rmi.port = Ogiltigt com.sun.management.jmxremote.rmi.port-nummer
+
+--- ./jdk/src/share/classes/sun/misc/JavaNetAccess.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/misc/JavaNetAccess.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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,17 +26,10 @@
+ package sun.misc;
+
+ import java.net.URLClassLoader;
+-import java.net.InetAddress;
+
+ public interface JavaNetAccess {
+ /**
+ * return the URLClassPath belonging to the given loader
+ */
+ URLClassPath getURLClassPath (URLClassLoader u);
+-
+- /**
+- * Return the original application specified hostname of
+- * the given InetAddress object.
+- */
+- String getOriginalHostName(InetAddress ia);
+ }
+--- ./jdk/src/share/classes/sun/misc/Unsafe.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/misc/Unsafe.java Wed Jul 01 21:53:30 2015 -0700
+@@ -846,12 +846,14 @@
+ throws InstantiationException;
+
+ /** Lock the object. It must get unlocked via {@link #monitorExit}. */
++ @Deprecated
+ public native void monitorEnter(Object o);
+
+ /**
+ * Unlock the object. It must have been locked via {@link
+ * #monitorEnter}.
+ */
++ @Deprecated
+ public native void monitorExit(Object o);
+
+ /**
+@@ -859,6 +861,7 @@
+ * whether the lock succeeded. If it did, the object must be
+ * unlocked via {@link #monitorExit}.
+ */
++ @Deprecated
+ public native boolean tryMonitorEnter(Object o);
+
+ /** Throw the exception without telling the verifier. */
+--- ./jdk/src/share/classes/sun/net/httpserver/Code.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/net/httpserver/Code.java Wed Jul 01 21:53:30 2015 -0700
+@@ -103,7 +103,7 @@
+ case HTTP_UNAVAILABLE: return " Service Unavailable";
+ case HTTP_GATEWAY_TIMEOUT: return " Gateway Timeout";
+ case HTTP_VERSION: return " HTTP Version Not Supported";
+- default: return "";
++ default: return " ";
+ }
+ }
+ }
+--- ./jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Wed Jul 01 21:53:30 2015 -0700
+@@ -982,7 +982,7 @@
+ SocketPermission p = URLtoSocketPermission(this.url);
+ if (p != null) {
+ try {
+- AccessController.doPrivileged(
++ AccessController.doPrivilegedWithCombiner(
+ new PrivilegedExceptionAction<Void>() {
+ public Void run() throws IOException {
+ plainConnect0();
+@@ -1243,7 +1243,7 @@
+
+ if (p != null) {
+ try {
+- return AccessController.doPrivileged(
++ return AccessController.doPrivilegedWithCombiner(
+ new PrivilegedExceptionAction<OutputStream>() {
+ public OutputStream run() throws IOException {
+ return getOutputStream0();
+@@ -1426,7 +1426,7 @@
+
+ if (p != null) {
+ try {
+- return AccessController.doPrivileged(
++ return AccessController.doPrivilegedWithCombiner(
+ new PrivilegedExceptionAction<InputStream>() {
+ public InputStream run() throws IOException {
+ return getInputStream0();
+@@ -2568,7 +2568,7 @@
+
+ if (p != null) {
+ try {
+- return AccessController.doPrivileged(
++ return AccessController.doPrivilegedWithCombiner(
+ new PrivilegedExceptionAction<Boolean>() {
+ public Boolean run() throws IOException {
+ return followRedirect0(loc, stat, locUrl0);
+--- ./jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java Wed Jul 01 21:53:30 2015 -0700
+@@ -192,22 +192,6 @@
+ return userAgent;
+ }
+
+- // should remove once HttpClient.newHttpProxy is putback
+- private static Proxy newHttpProxy(String proxyHost, int proxyPort) {
+- InetSocketAddress saddr = null;
+- final String phost = proxyHost;
+- final int pport = proxyPort < 0 ? httpsPortNumber : proxyPort;
+- try {
+- saddr = java.security.AccessController.doPrivileged(new
+- java.security.PrivilegedExceptionAction<InetSocketAddress>() {
+- public InetSocketAddress run() {
+- return new InetSocketAddress(phost, pport);
+- }});
+- } catch (java.security.PrivilegedActionException pae) {
+- }
+- return new Proxy(Proxy.Type.HTTP, saddr);
+- }
+-
+ // CONSTRUCTOR, FACTORY
+
+
+@@ -251,7 +235,7 @@
+ throws IOException {
+ this(sf, url,
+ (proxyHost == null? null:
+- HttpsClient.newHttpProxy(proxyHost, proxyPort)),
++ HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
+ connectTimeout);
+ }
+
+@@ -261,6 +245,11 @@
+ HttpsClient(SSLSocketFactory sf, URL url, Proxy proxy,
+ int connectTimeout)
+ throws IOException {
++ PlatformLogger logger = HttpURLConnection.getHttpLogger();
++ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
++ logger.finest("Creating new HttpsClient with url:" + url + " and proxy:" + proxy +
++ " with connect timeout:" + connectTimeout);
++ }
+ this.proxy = proxy;
+ setSSLSocketFactory(sf);
+ this.proxyDisabled = true;
+@@ -317,7 +306,7 @@
+
+ return HttpsClient.New(sf, url, hv,
+ (proxyHost == null? null :
+- HttpsClient.newHttpProxy(proxyHost, proxyPort)),
++ HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
+ useCache, connectTimeout, httpuc);
+ }
+
+@@ -329,6 +318,11 @@
+ if (p == null) {
+ p = Proxy.NO_PROXY;
+ }
++ PlatformLogger logger = HttpURLConnection.getHttpLogger();
++ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
++ logger.finest("Looking for HttpClient for URL " + url +
++ " and proxy value of " + p);
++ }
+ HttpsClient ret = null;
+ if (useCache) {
+ /* see if one's already around */
+@@ -342,14 +336,13 @@
+
+ if (ret != null) {
+ if ((ret.proxy != null && ret.proxy.equals(p)) ||
+- (ret.proxy == null && p == null)) {
++ (ret.proxy == null && p == Proxy.NO_PROXY)) {
+ synchronized (ret) {
+ ret.cachedHttpClient = true;
+ assert ret.inCache;
+ ret.inCache = false;
+ if (httpuc != null && ret.needsTunneling())
+ httpuc.setTunnelState(TUNNELING);
+- PlatformLogger logger = HttpURLConnection.getHttpLogger();
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
+ logger.finest("KeepAlive stream retrieved from the cache, " + ret);
+ }
+@@ -360,6 +353,9 @@
+ // This should be fine as it is very rare that a connection
+ // to the same host will not use the same proxy.
+ synchronized(ret) {
++ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
++ logger.finest("Not returning this connection to cache: " + ret);
++ }
+ ret.inCache = false;
+ ret.closeServer();
+ }
+--- ./jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -38,6 +38,7 @@
+ import java.nio.channels.NonWritableChannelException;
+ import java.nio.channels.OverlappingFileLockException;
+ import java.nio.channels.ReadableByteChannel;
++import java.nio.channels.SelectableChannel;
+ import java.nio.channels.WritableByteChannel;
+ import java.security.AccessController;
+ import java.util.ArrayList;
+@@ -407,30 +408,13 @@
+ //
+ private static volatile boolean fileSupported = true;
+
+- private long transferToDirectly(long position, int icount,
+- WritableByteChannel target)
++ private long transferToDirectlyInternal(long position, int icount,
++ WritableByteChannel target,
++ FileDescriptor targetFD)
+ throws IOException
+ {
+- if (!transferSupported)
+- return IOStatus.UNSUPPORTED;
+-
+- FileDescriptor targetFD = null;
+- if (target instanceof FileChannelImpl) {
+- if (!fileSupported)
+- return IOStatus.UNSUPPORTED_CASE;
+- targetFD = ((FileChannelImpl)target).fd;
+- } else if (target instanceof SelChImpl) {
+- // Direct transfer to pipe causes EINVAL on some configurations
+- if ((target instanceof SinkChannelImpl) && !pipeSupported)
+- return IOStatus.UNSUPPORTED_CASE;
+- targetFD = ((SelChImpl)target).getFD();
+- }
+- if (targetFD == null)
+- return IOStatus.UNSUPPORTED;
+- int thisFDVal = IOUtil.fdVal(fd);
+- int targetFDVal = IOUtil.fdVal(targetFD);
+- if (thisFDVal == targetFDVal) // Not supported on some configurations
+- return IOStatus.UNSUPPORTED;
++ assert !nd.transferToDirectlyNeedsPositionLock() ||
++ Thread.holdsLock(positionLock);
+
+ long n = -1;
+ int ti = -1;
+@@ -440,7 +424,7 @@
+ if (!isOpen())
+ return -1;
+ do {
+- n = transferTo0(thisFDVal, position, icount, targetFDVal);
++ n = transferTo0(fd, position, icount, targetFD);
+ } while ((n == IOStatus.INTERRUPTED) && isOpen());
+ if (n == IOStatus.UNSUPPORTED_CASE) {
+ if (target instanceof SinkChannelImpl)
+@@ -461,6 +445,54 @@
+ }
+ }
+
++ private long transferToDirectly(long position, int icount,
++ WritableByteChannel target)
++ throws IOException
++ {
++ if (!transferSupported)
++ return IOStatus.UNSUPPORTED;
++
++ FileDescriptor targetFD = null;
++ if (target instanceof FileChannelImpl) {
++ if (!fileSupported)
++ return IOStatus.UNSUPPORTED_CASE;
++ targetFD = ((FileChannelImpl)target).fd;
++ } else if (target instanceof SelChImpl) {
++ // Direct transfer to pipe causes EINVAL on some configurations
++ if ((target instanceof SinkChannelImpl) && !pipeSupported)
++ return IOStatus.UNSUPPORTED_CASE;
++
++ // Platform-specific restrictions. Now there is only one:
++ // Direct transfer to non-blocking channel could be forbidden
++ SelectableChannel sc = (SelectableChannel)target;
++ if (!nd.canTransferToDirectly(sc))
++ return IOStatus.UNSUPPORTED_CASE;
++
++ targetFD = ((SelChImpl)target).getFD();
++ }
++
++ if (targetFD == null)
++ return IOStatus.UNSUPPORTED;
++ int thisFDVal = IOUtil.fdVal(fd);
++ int targetFDVal = IOUtil.fdVal(targetFD);
++ if (thisFDVal == targetFDVal) // Not supported on some configurations
++ return IOStatus.UNSUPPORTED;
++
++ if (nd.transferToDirectlyNeedsPositionLock()) {
++ synchronized (positionLock) {
++ long pos = position();
++ try {
++ return transferToDirectlyInternal(position, icount,
++ target, targetFD);
++ } finally {
++ position(pos);
++ }
++ }
++ } else {
++ return transferToDirectlyInternal(position, icount, target, targetFD);
++ }
++ }
++
+ // Maximum size to map when using a mapped buffer
+ private static final long MAPPED_TRANSFER_SIZE = 8L*1024L*1024L;
+
+@@ -1176,7 +1208,8 @@
+ private static native int unmap0(long address, long length);
+
+ // Transfers from src to dst, or returns -2 if kernel can't do that
+- private native long transferTo0(int src, long position, long count, int dst);
++ private native long transferTo0(FileDescriptor src, long position,
++ long count, FileDescriptor dst);
+
+ // Sets or reports this file's position
+ // If offset is -1, the current position is returned
+--- ./jdk/src/share/classes/sun/nio/ch/FileDispatcher.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/nio/ch/FileDispatcher.java Wed Jul 01 21:53:30 2015 -0700
+@@ -25,7 +25,9 @@
+
+ package sun.nio.ch;
+
+-import java.io.*;
++import java.io.FileDescriptor;
++import java.io.IOException;
++import java.nio.channels.SelectableChannel;
+
+ abstract class FileDispatcher extends NativeDispatcher {
+
+@@ -53,4 +55,8 @@
+ */
+ abstract FileDescriptor duplicateForMapping(FileDescriptor fd)
+ throws IOException;
++
++ abstract boolean canTransferToDirectly(SelectableChannel sc);
++
++ abstract boolean transferToDirectlyNeedsPositionLock();
+ }
+--- ./jdk/src/share/classes/sun/nio/ch/Net.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/nio/ch/Net.java Wed Jul 01 21:53:30 2015 -0700
+@@ -50,30 +50,8 @@
+ // set to true if exclusive binding is on for Windows
+ private static final boolean exclusiveBind;
+
+- static {
+- int availLevel = isExclusiveBindAvailable();
+- if (availLevel >= 0) {
+- String exclBindProp =
+- java.security.AccessController.doPrivileged(
+- new PrivilegedAction<String>() {
+- @Override
+- public String run() {
+- return System.getProperty(
+- "sun.net.useExclusiveBind");
+- }
+- });
+- if (exclBindProp != null) {
+- exclusiveBind = exclBindProp.length() == 0 ?
+- true : Boolean.parseBoolean(exclBindProp);
+- } else if (availLevel == 1) {
+- exclusiveBind = true;
+- } else {
+- exclusiveBind = false;
+- }
+- } else {
+- exclusiveBind = false;
+- }
+- }
++ // set to true if the fast tcp loopback should be enabled on Windows
++ private static final boolean fastLoopback;
+
+ // -- Miscellaneous utilities --
+
+@@ -391,6 +369,23 @@
+ }
+ }
+
++ public static boolean isFastTcpLoopbackRequested() {
++ String loopbackProp = java.security.AccessController.doPrivileged(
++ new PrivilegedAction<String>() {
++ @Override
++ public String run() {
++ return System.getProperty("jdk.net.useFastTcpLoopback");
++ }
++ });
++ boolean enable;
++ if ("".equals(loopbackProp)) {
++ enable = true;
++ } else {
++ enable = Boolean.parseBoolean(loopbackProp);
++ }
++ return enable;
++ }
++
+ // -- Socket operations --
+
+ private static native boolean isIPv6Available0();
+@@ -413,15 +408,16 @@
+ throws IOException {
+ boolean preferIPv6 = isIPv6Available() &&
+ (family != StandardProtocolFamily.INET);
+- return IOUtil.newFD(socket0(preferIPv6, stream, false));
++ return IOUtil.newFD(socket0(preferIPv6, stream, false, fastLoopback));
+ }
+
+ static FileDescriptor serverSocket(boolean stream) {
+- return IOUtil.newFD(socket0(isIPv6Available(), stream, true));
++ return IOUtil.newFD(socket0(isIPv6Available(), stream, true, fastLoopback));
+ }
+
+ // Due to oddities SO_REUSEADDR on windows reuse is ignored
+- private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse);
++ private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse,
++ boolean fastLoopback);
+
+ public static void bind(FileDescriptor fd, InetAddress addr, int port)
+ throws IOException
+@@ -634,4 +630,30 @@
+ POLLCONN = pollconnValue();
+ }
+
++ static {
++ int availLevel = isExclusiveBindAvailable();
++ if (availLevel >= 0) {
++ String exclBindProp =
++ java.security.AccessController.doPrivileged(
++ new PrivilegedAction<String>() {
++ @Override
++ public String run() {
++ return System.getProperty(
++ "sun.net.useExclusiveBind");
++ }
++ });
++ if (exclBindProp != null) {
++ exclusiveBind = exclBindProp.length() == 0 ?
++ true : Boolean.parseBoolean(exclBindProp);
++ } else if (availLevel == 1) {
++ exclusiveBind = true;
++ } else {
++ exclusiveBind = false;
++ }
++ } else {
++ exclusiveBind = false;
++ }
++
++ fastLoopback = isFastTcpLoopbackRequested();
++ }
+ }
+--- ./jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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,12 +321,9 @@
+ }
+
+ public void sendUrgentData(int data) throws IOException {
+- synchronized (sc.blockingLock()) {
+- if (!sc.isBlocking())
+- throw new IllegalBlockingModeException();
+- int n = sc.sendOutOfBandData((byte)data);
+- assert n == 1;
+- }
++ int n = sc.sendOutOfBandData((byte) data);
++ if (n == 0)
++ throw new IOException("Socket buffer full");
+ }
+
+ public void setOOBInline(boolean on) throws SocketException {
+--- ./jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1031,6 +1031,14 @@
+ "ebcdic-s-871+euro"
+ });
+
++ charset("x-IBM1166", "IBM1166",
++ new String[] {
++ "cp1166", // JDK historical
++ "ibm1166",
++ "ibm-1166",
++ "1166"
++ });
++
+ charset("IBM290", "IBM290",
+ new String[] {
+ "cp290",
+--- ./jdk/src/share/classes/sun/nio/cs/ext/HKSCS.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/nio/cs/ext/HKSCS.java Wed Jul 01 21:53:30 2015 -0700
+@@ -377,7 +377,6 @@
+ dst[dp++] = repl[1];
+ continue;
+ }
+- sp++;
+ }
+ if (bb > MAX_SINGLEBYTE) { // DoubleByte
+ dst[dp++] = (byte)(bb >> 8);
+--- ./jdk/src/share/classes/sun/print/RasterPrinterJob.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/print/RasterPrinterJob.java Wed Jul 01 21:53:30 2015 -0700
+@@ -560,18 +560,8 @@
+ }
+
+ Media media = (Media)attSet.get(Media.class);
+- if (media == null) {
+- media =
+- (Media)service.getDefaultAttributeValue(Media.class);
+- }
+- if (!(media instanceof MediaSizeName)) {
+- media = MediaSizeName.NA_LETTER;
+- }
+- MediaSize size =
+- MediaSize.getMediaSizeForName((MediaSizeName)media);
+- if (size == null) {
+- size = MediaSize.NA.LETTER;
+- }
++ MediaSize size = getMediaSize(media, service, page);
++
+ Paper paper = new Paper();
+ float dim[] = size.getSize(1); //units == 1 to avoid FP error
+ double w = Math.rint((dim[0]*72.0)/Size2DSyntax.INCH);
+@@ -580,9 +570,11 @@
+ MediaPrintableArea area =
+ (MediaPrintableArea)
+ attSet.get(MediaPrintableArea.class);
++ if (area == null) {
++ area = getDefaultPrintableArea(page, w, h);
++ }
++
+ double ix, iw, iy, ih;
+-
+- if (area != null) {
+ // Should pass in same unit as updatePageAttributes
+ // to avoid rounding off errors.
+ ix = Math.rint(
+@@ -593,8 +585,25 @@
+ area.getWidth(MediaPrintableArea.INCH) * DPI);
+ ih = Math.rint(
+ area.getHeight(MediaPrintableArea.INCH) * DPI);
++ paper.setImageableArea(ix, iy, iw, ih);
++ page.setPaper(paper);
++ return page;
+ }
+- else {
++ protected MediaSize getMediaSize(Media media, PrintService service,
++ PageFormat page) {
++ if (media == null) {
++ media = (Media)service.getDefaultAttributeValue(Media.class);
++ }
++ if (!(media instanceof MediaSizeName)) {
++ media = MediaSizeName.NA_LETTER;
++ }
++ MediaSize size = MediaSize.getMediaSizeForName((MediaSizeName) media);
++ return size != null ? size : MediaSize.NA.LETTER;
++ }
++
++ protected MediaPrintableArea getDefaultPrintableArea(PageFormat page,
++ double w, double h) {
++ double ix, iw, iy, ih;
+ if (w >= 72.0 * 6.0) {
+ ix = 72.0;
+ iw = w - 2 * 72.0;
+@@ -609,10 +618,9 @@
+ iy = h / 6.0;
+ ih = h * 0.75;
+ }
+- }
+- paper.setImageableArea(ix, iy, iw, ih);
+- page.setPaper(paper);
+- return page;
++
++ return new MediaPrintableArea((float) (ix / DPI), (float) (iy / DPI),
++ (float) (iw / DPI), (float) (ih / DPI), MediaPrintableArea.INCH);
+ }
+
+ protected void updatePageAttributes(PrintService service,
+@@ -811,7 +819,7 @@
+ }
+
+ protected PageFormat getPageFormatFromAttributes() {
+- if (attributes == null) {
++ if (attributes == null || attributes.isEmpty()) {
+ return null;
+ }
+ return attributeToPageFormat(getPrintService(), this.attributes);
+--- ./jdk/src/share/classes/sun/print/resources/serviceui_sv.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/print/resources/serviceui_sv.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -28,7 +28,7 @@
+ dialog.noprintermsg=Hittade ingen utskriftstj\u00E4nst.
+ dialog.writeerror=Kan inte skriva till filen:
+ #
+-label.info=Information:
++label.info=Info:
+ label.jobname=&Utskrift:
+ label.numcopies=Antal e&xemplar:
+ label.priority=P&rioritet:
+--- ./jdk/src/share/classes/sun/reflect/generics/repository/ClassRepository.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/reflect/generics/repository/ClassRepository.java Wed Jul 01 21:53:30 2015 -0700
+@@ -42,8 +42,11 @@
+
+ public static final ClassRepository NONE = ClassRepository.make("Ljava/lang/Object;", null);
+
+- private volatile Type superclass; // caches the generic superclass info
+- private volatile Type[] superInterfaces; // caches the generic superinterface info
++ /** The generic superclass info. Lazily initialized. */
++ private volatile Type superclass;
++
++ /** The generic superinterface info. Lazily initialized. */
++ private volatile Type[] superInterfaces;
+
+ // private, to enforce use of static factory
+ private ClassRepository(String rawSig, GenericsFactory f) {
+@@ -79,7 +82,7 @@
+ * with which the repository was created.
+ */
+
+- public Type getSuperclass(){
++ public Type getSuperclass() {
+ Type superclass = this.superclass;
+ if (superclass == null) { // lazily initialize superclass
+ Reifier r = getReifier(); // obtain visitor
+@@ -88,25 +91,24 @@
+ // extract result from visitor and cache it
+ superclass = r.getResult();
+ this.superclass = superclass;
+- }
++ }
+ return superclass; // return cached result
+ }
+
+- public Type[] getSuperInterfaces(){
++ public Type[] getSuperInterfaces() {
+ Type[] superInterfaces = this.superInterfaces;
+ if (superInterfaces == null) { // lazily initialize super interfaces
+ // first, extract super interface subtree(s) from AST
+ TypeTree[] ts = getTree().getSuperInterfaces();
+ // create array to store reified subtree(s)
+- Type[] sis = new Type[ts.length];
++ superInterfaces = new Type[ts.length];
+ // reify all subtrees
+ for (int i = 0; i < ts.length; i++) {
+ Reifier r = getReifier(); // obtain visitor
+ ts[i].accept(r);// reify subtree
+ // extract result from visitor and store it
+- sis[i] = r.getResult();
++ superInterfaces[i] = r.getResult();
+ }
+- superInterfaces = sis; // cache overall result
+ this.superInterfaces = superInterfaces;
+ }
+ return superInterfaces.clone(); // return cached result
+--- ./jdk/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java Wed Jul 01 21:53:30 2015 -0700
+@@ -42,7 +42,8 @@
+ public abstract class GenericDeclRepository<S extends Signature>
+ extends AbstractRepository<S> {
+
+- private volatile TypeVariable<?>[] typeParams; // caches the formal type parameters
++ /** The formal type parameters. Lazily initialized. */
++ private volatile TypeVariable<?>[] typeParams;
+
+ protected GenericDeclRepository(String rawSig, GenericsFactory f) {
+ super(rawSig, f);
+@@ -55,8 +56,7 @@
+ * If the corresponding field is non-null, it is returned.
+ * If not, it is created lazily. This is done by selecting the appropriate
+ * part of the tree and transforming it into a reflective object
+- * using a visitor.
+- * a visitor, which is created by feeding it the factory
++ * using a visitor, which is created by feeding it the factory
+ * with which the repository was created.
+ */
+
+@@ -64,22 +64,21 @@
+ * Return the formal type parameters of this generic declaration.
+ * @return the formal type parameters of this generic declaration
+ */
+- public TypeVariable<?>[] getTypeParameters(){
+- TypeVariable[] typeParams = this.typeParams;
++ public TypeVariable<?>[] getTypeParameters() {
++ TypeVariable<?>[] typeParams = this.typeParams;
+ if (typeParams == null) { // lazily initialize type parameters
+ // first, extract type parameter subtree(s) from AST
+ FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
+ // create array to store reified subtree(s)
+- TypeVariable<?>[] tps = new TypeVariable<?>[ftps.length];
++ typeParams = new TypeVariable<?>[ftps.length];
+ // reify all subtrees
+ for (int i = 0; i < ftps.length; i++) {
+ Reifier r = getReifier(); // obtain visitor
+ ftps[i].accept(r); // reify subtree
+ // extract result from visitor and store it
+- tps[i] = (TypeVariable<?>) r.getResult();
++ typeParams[i] = (TypeVariable<?>) r.getResult();
+ }
+- typeParams = tps; // cache overall result
+- this.typeParams = typeParams;
++ this.typeParams = typeParams; // cache overall result
+ }
+ return typeParams.clone(); // return cached result
+ }
+--- ./jdk/src/share/classes/sun/reflect/generics/scope/AbstractScope.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/reflect/generics/scope/AbstractScope.java Wed Jul 01 21:53:30 2015 -0700
+@@ -42,7 +42,9 @@
+ implements Scope {
+
+ private final D recvr; // the declaration whose scope this instance represents
+- private volatile Scope enclosingScope; // the enclosing scope of this scope
++
++ /** The enclosing scope of this scope. Lazily initialized. */
++ private volatile Scope enclosingScope;
+
+ /**
+ * Constructor. Takes a reflective object whose scope the newly
+--- ./jdk/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -69,7 +69,7 @@
+ /**
+ * Construct a key from its encoding. Called by the ECKeyFactory.
+ */
+- ECPrivateKeyImpl(byte[] encoded) throws InvalidKeyException {
++ public ECPrivateKeyImpl(byte[] encoded) throws InvalidKeyException {
+ decode(encoded);
+ }
+
+@@ -77,7 +77,7 @@
+ * Construct a key from its components. Used by the
+ * KeyFactory.
+ */
+- ECPrivateKeyImpl(BigInteger s, ECParameterSpec params)
++ public ECPrivateKeyImpl(BigInteger s, ECParameterSpec params)
+ throws InvalidKeyException {
+ this.s = s;
+ this.params = params;
+--- ./jdk/src/share/classes/sun/security/ec/ECPublicKeyImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ec/ECPublicKeyImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -52,7 +52,7 @@
+ * ECKeyFactory.
+ */
+ @SuppressWarnings("deprecation")
+- ECPublicKeyImpl(ECPoint w, ECParameterSpec params)
++ public ECPublicKeyImpl(ECPoint w, ECParameterSpec params)
+ throws InvalidKeyException {
+ this.w = w;
+ this.params = params;
+@@ -65,7 +65,7 @@
+ /**
+ * Construct a key from its encoding.
+ */
+- ECPublicKeyImpl(byte[] encoded) throws InvalidKeyException {
++ public ECPublicKeyImpl(byte[] encoded) throws InvalidKeyException {
+ decode(encoded);
+ }
+
+--- ./jdk/src/share/classes/sun/security/krb5/Config.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/krb5/Config.java Wed Jul 01 21:53:30 2015 -0700
+@@ -232,6 +232,31 @@
+ }
+
+ /**
++ * Gets the boolean value for the specified keys. Returns TRUE if the
++ * string value is "yes", or "true", FALSE if "no", or "false", or null
++ * if otherwise or not defined. The comparision is case-insensitive.
++ *
++ * @param keys the keys, see {@link #get(String...)}
++ * @return the boolean value, or null if there is no value defined or the
++ * value does not look like a boolean value.
++ * @throws IllegalArgumentException see {@link #get(String...)}
++ */
++ private Boolean getBooleanObject(String... keys) {
++ String s = get(keys);
++ if (s == null) {
++ return null;
++ }
++ switch (s.toLowerCase(Locale.US)) {
++ case "yes": case "true":
++ return Boolean.TRUE;
++ case "no": case "false":
++ return Boolean.FALSE;
++ default:
++ return null;
++ }
++ }
++
++ /**
+ * Gets all values for the specified keys.
+ * @throws IllegalArgumentException if any of the keys is illegal
+ * (See {@link #get})
+@@ -942,32 +967,30 @@
+ /**
+ * Check if need to use DNS to locate Kerberos services
+ */
+- private boolean useDNS(String name) {
+- String value = get("libdefaults", name);
+- if (value == null) {
+- value = get("libdefaults", "dns_fallback");
+- if ("false".equalsIgnoreCase(value)) {
+- return false;
+- } else {
+- return true;
+- }
+- } else {
+- return value.equalsIgnoreCase("true");
++ private boolean useDNS(String name, boolean defaultValue) {
++ Boolean value = getBooleanObject("libdefaults", name);
++ if (value != null) {
++ return value.booleanValue();
+ }
++ value = getBooleanObject("libdefaults", "dns_fallback");
++ if (value != null) {
++ return value.booleanValue();
++ }
++ return defaultValue;
+ }
+
+ /**
+ * Check if need to use DNS to locate the KDC
+ */
+ private boolean useDNS_KDC() {
+- return useDNS("dns_lookup_kdc");
++ return useDNS("dns_lookup_kdc", true);
+ }
+
+ /*
+ * Check if need to use DNS to locate the Realm
+ */
+ private boolean useDNS_Realm() {
+- return useDNS("dns_lookup_realm");
++ return useDNS("dns_lookup_realm", false);
+ }
+
+ /**
+--- ./jdk/src/share/classes/sun/security/krb5/KrbApReq.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/krb5/KrbApReq.java Wed Jul 01 21:53:30 2015 -0700
+@@ -60,22 +60,12 @@
+ private static boolean DEBUG = Krb5.DEBUG;
+ private static final char[] hexConst = "0123456789ABCDEF".toCharArray();
+
+- private static final MessageDigest md;
+-
+- static {
+- try {
+- md = MessageDigest.getInstance("MD5");
+- } catch (NoSuchAlgorithmException ex) {
+- throw new RuntimeException("Impossible");
+- }
+- }
+-
+ /**
+ * Constructs an AP-REQ message to send to the peer.
+ * @param tgsCred the <code>Credentials</code> to be used to construct the
+ * AP Request protocol message.
+ * @param mutualRequired Whether mutual authentication is required
+- * @param useSubkey Whether the subkey is to be used to protect this
++ * @param useSubKey Whether the subkey is to be used to protect this
+ * specific application session. If this is not set then the
+ * session key from the ticket will be used.
+ * @throws KrbException for any Kerberos protocol specific error
+@@ -99,10 +89,10 @@
+ * @param tgsCred the <code>Credentials</code> to be used to construct the
+ * AP Request protocol message.
+ * @param mutualRequired Whether mutual authentication is required
+- * @param useSubkey Whether the subkey is to be used to protect this
++ * @param useSubKey Whether the subkey is to be used to protect this
+ * specific application session. If this is not set then the
+ * session key from the ticket will be used.
+- * @param checksum checksum of the the application data that accompanies
++ * @param cksum checksum of the the application data that accompanies
+ * the KRB_AP_REQ.
+ * @throws KrbException for any Kerberos protocol specific error
+ * @throws IOException for any IO related errors
+@@ -142,8 +132,8 @@
+ * Constructs an AP-REQ message from the bytes received from the
+ * peer.
+ * @param message The message received from the peer
+- * @param keys <code>EncrtyptionKey</code>s to decrypt the message;
+- * key selected will depend on etype used to encrypte data
++ * @param cred <code>KrbAcceptCredential</code> containing keys to decrypt
++ * the message; key selected will depend on etype used to encrypt data
+ * @throws KrbException for any Kerberos protocol specific error
+ * @throws IOException for any IO related errors
+ * (e.g. socket operations)
+@@ -311,7 +301,14 @@
+ if (!authenticator.ctime.inClockSkew())
+ throw new KrbApErrException(Krb5.KRB_AP_ERR_SKEW);
+
+- byte[] hash = md.digest(apReqMessg.authenticator.cipher);
++ byte[] hash;
++ try {
++ hash = MessageDigest.getInstance("MD5")
++ .digest(apReqMessg.authenticator.cipher);
++ } catch (NoSuchAlgorithmException ex) {
++ throw new AssertionError("Impossible");
++ }
++
+ char[] h = new char[hash.length * 2];
+ for (int i=0; i<hash.length; i++) {
+ h[2*i] = hexConst[(hash[i]&0xff)>>4];
+--- ./jdk/src/share/classes/sun/security/pkcs11/Config.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/pkcs11/Config.java Wed Jul 01 21:53:30 2015 -0700
+@@ -584,16 +584,24 @@
+ }
+
+ private String parseLine() throws IOException {
+- String s = parseWord();
++ // allow quoted string as part of line
++ String s = null;
+ while (true) {
+ int token = nextToken();
+ if ((token == TT_EOL) || (token == TT_EOF)) {
+ break;
+ }
+- if (token != TT_WORD) {
++ if (token != TT_WORD && token != '\"') {
+ throw excToken("Unexpected value");
+ }
+- s = s + " " + st.sval;
++ if (s == null) {
++ s = st.sval;
++ } else {
++ s = s + " " + st.sval;
++ }
++ }
++ if (s == null) {
++ throw excToken("Unexpected empty line");
+ }
+ return s;
+ }
+@@ -653,7 +661,9 @@
+ //
+
+ private String parseLibrary(String keyword) throws IOException {
+- String lib = parseStringEntry(keyword);
++ checkDup(keyword);
++ parseEquals();
++ String lib = parseLine();
+ lib = expand(lib);
+ int i = lib.indexOf("/$ISA/");
+ if (i != -1) {
+--- ./jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java Wed Jul 01 21:53:30 2015 -0700
+@@ -116,7 +116,7 @@
+ byte[] encoded = key.getEncoded();
+
+ try {
+- key = ECUtil.decodeX509ECPublicKey(encoded);
++ key = P11ECUtil.decodeX509ECPublicKey(encoded);
+ } catch (InvalidKeySpecException ikse) {
+ throw new InvalidKeyException(ikse);
+ }
+@@ -145,7 +145,7 @@
+ byte[] encoded = key.getEncoded();
+
+ try {
+- key = ECUtil.decodePKCS8ECPrivateKey(encoded);
++ key = P11ECUtil.decodePKCS8ECPrivateKey(encoded);
+ } catch (InvalidKeySpecException ikse) {
+ throw new InvalidKeyException(ikse);
+ }
+@@ -167,7 +167,7 @@
+ if (keySpec instanceof X509EncodedKeySpec) {
+ try {
+ byte[] encoded = ((X509EncodedKeySpec)keySpec).getEncoded();
+- PublicKey key = ECUtil.decodeX509ECPublicKey(encoded);
++ PublicKey key = P11ECUtil.decodeX509ECPublicKey(encoded);
+ return implTranslatePublicKey(key);
+ } catch (InvalidKeyException e) {
+ throw new InvalidKeySpecException
+@@ -197,7 +197,7 @@
+ if (keySpec instanceof PKCS8EncodedKeySpec) {
+ try {
+ byte[] encoded = ((PKCS8EncodedKeySpec)keySpec).getEncoded();
+- PrivateKey key = ECUtil.decodePKCS8ECPrivateKey(encoded);
++ PrivateKey key = P11ECUtil.decodePKCS8ECPrivateKey(encoded);
+ return implTranslatePrivateKey(key);
+ } catch (GeneralSecurityException e) {
+ throw new InvalidKeySpecException
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/sun/security/pkcs11/P11ECUtil.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,114 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package sun.security.pkcs11;
++
++import java.io.IOException;
++import java.math.BigInteger;
++import java.security.*;
++import java.security.interfaces.*;
++import java.security.spec.*;
++
++import sun.security.ec.ECPublicKeyImpl;
++import sun.security.ec.ECPrivateKeyImpl;
++import sun.security.x509.X509Key;
++
++final class P11ECUtil {
++
++ static ECPublicKey decodeX509ECPublicKey(byte[] encoded)
++ throws InvalidKeySpecException {
++ X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encoded);
++
++ return (ECPublicKey)ECGeneratePublic(keySpec);
++ }
++
++ static byte[] x509EncodeECPublicKey(ECPoint w,
++ ECParameterSpec params) throws InvalidKeySpecException {
++ ECPublicKeySpec keySpec = new ECPublicKeySpec(w, params);
++ X509Key key = (X509Key)ECGeneratePublic(keySpec);
++
++ return key.getEncoded();
++ }
++
++ static ECPrivateKey decodePKCS8ECPrivateKey(byte[] encoded)
++ throws InvalidKeySpecException {
++ PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded);
++
++ return (ECPrivateKey)ECGeneratePrivate(keySpec);
++ }
++
++ static ECPrivateKey generateECPrivateKey(BigInteger s,
++ ECParameterSpec params) throws InvalidKeySpecException {
++ ECPrivateKeySpec keySpec = new ECPrivateKeySpec(s, params);
++
++ return (ECPrivateKey)ECGeneratePrivate(keySpec);
++ }
++
++ private static PublicKey ECGeneratePublic(KeySpec keySpec)
++ throws InvalidKeySpecException {
++ try {
++ if (keySpec instanceof X509EncodedKeySpec) {
++ X509EncodedKeySpec x509Spec = (X509EncodedKeySpec)keySpec;
++ return new ECPublicKeyImpl(x509Spec.getEncoded());
++ } else if (keySpec instanceof ECPublicKeySpec) {
++ ECPublicKeySpec ecSpec = (ECPublicKeySpec)keySpec;
++ return new ECPublicKeyImpl(
++ ecSpec.getW(),
++ ecSpec.getParams()
++ );
++ } else {
++ throw new InvalidKeySpecException("Only ECPublicKeySpec "
++ + "and X509EncodedKeySpec supported for EC public keys");
++ }
++ } catch (InvalidKeySpecException e) {
++ throw e;
++ } catch (GeneralSecurityException e) {
++ throw new InvalidKeySpecException(e);
++ }
++ }
++
++ private static PrivateKey ECGeneratePrivate(KeySpec keySpec)
++ throws InvalidKeySpecException {
++ try {
++ if (keySpec instanceof PKCS8EncodedKeySpec) {
++ PKCS8EncodedKeySpec pkcsSpec = (PKCS8EncodedKeySpec)keySpec;
++ return new ECPrivateKeyImpl(pkcsSpec.getEncoded());
++ } else if (keySpec instanceof ECPrivateKeySpec) {
++ ECPrivateKeySpec ecSpec = (ECPrivateKeySpec)keySpec;
++ return new ECPrivateKeyImpl(ecSpec.getS(), ecSpec.getParams());
++ } else {
++ throw new InvalidKeySpecException("Only ECPrivateKeySpec "
++ + "and PKCS8EncodedKeySpec supported for EC private keys");
++ }
++ } catch (InvalidKeySpecException e) {
++ throw e;
++ } catch (GeneralSecurityException e) {
++ throw new InvalidKeySpecException(e);
++ }
++ }
++
++ private P11ECUtil() {}
++
++}
+--- ./jdk/src/share/classes/sun/security/pkcs11/P11Key.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/pkcs11/P11Key.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -47,7 +47,6 @@
+
+ import sun.security.util.DerValue;
+ import sun.security.util.Length;
+-import sun.security.util.ECUtil;
+
+ /**
+ * Key implementation classes.
+@@ -165,7 +164,7 @@
+ } else {
+ otherEnc = other.getEncoded();
+ }
+- return MessageDigest.isEqual(thisEnc, otherEnc);
++ return Arrays.equals(thisEnc, otherEnc);
+ }
+
+ public int hashCode() {
+@@ -993,7 +992,7 @@
+ if (encoded == null) {
+ fetchValues();
+ try {
+- Key key = ECUtil.generateECPrivateKey(s, params);
++ Key key = P11ECUtil.generateECPrivateKey(s, params);
+ encoded = key.getEncoded();
+ } catch (InvalidKeySpecException e) {
+ throw new ProviderException(e);
+@@ -1067,7 +1066,7 @@
+ if (encoded == null) {
+ fetchValues();
+ try {
+- return ECUtil.x509EncodeECPublicKey(w, params);
++ return P11ECUtil.x509EncodeECPublicKey(w, params);
+ } catch (InvalidKeySpecException e) {
+ throw new ProviderException(e);
+ }
+--- ./jdk/src/share/classes/sun/security/pkcs11/SessionManager.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/pkcs11/SessionManager.java Wed Jul 01 21:53:30 2015 -0700
+@@ -90,6 +90,7 @@
+
+ // maximum number of active sessions during this invocation, for debugging
+ private int maxActiveSessions;
++ private Object maxActiveSessionsLock;
+
+ // flags to use in the C_OpenSession() call
+ private final long openSessionFlags;
+@@ -113,6 +114,9 @@
+ this.token = token;
+ this.objSessions = new Pool(this);
+ this.opSessions = new Pool(this);
++ if (debug != null) {
++ maxActiveSessionsLock = new Object();
++ }
+ }
+
+ // returns whether only a fairly low number of sessions are
+@@ -212,7 +216,7 @@
+ Session session = new Session(token, id);
+ activeSessions.incrementAndGet();
+ if (debug != null) {
+- synchronized(this) {
++ synchronized(maxActiveSessionsLock) {
+ if (activeSessions.get() > maxActiveSessions) {
+ maxActiveSessions = activeSessions.get();
+ if (maxActiveSessions % 10 == 0) {
+--- ./jdk/src/share/classes/sun/security/pkcs11/wrapper/Functions.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/pkcs11/wrapper/Functions.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+
+ /* Copyright (c) 2002 Graz University of Technology. All rights reserved.
+@@ -447,6 +447,22 @@
+ /**
+ * Check the given arrays for equalitiy. This method considers both arrays as
+ * equal, if both are <code>null</code> or both have the same length and
++ * contain exactly the same byte values.
++ *
++ * @param array1 The first array.
++ * @param array2 The second array.
++ * @return True, if both arrays are <code>null</code> or both have the same
++ * length and contain exactly the same byte values. False, otherwise.
++ * @preconditions
++ * @postconditions
++ */
++ public static boolean equals(byte[] array1, byte[] array2) {
++ return Arrays.equals(array1, array2);
++ }
++
++ /**
++ * Check the given arrays for equalitiy. This method considers both arrays as
++ * equal, if both are <code>null</code> or both have the same length and
+ * contain exactly the same char values.
+ *
+ * @param array1 The first array.
+@@ -456,7 +472,7 @@
+ * @preconditions
+ * @postconditions
+ */
+- private static boolean equals(char[] array1, char[] array2) {
++ public static boolean equals(char[] array1, char[] array2) {
+ return Arrays.equals(array1, array2);
+ }
+
+--- ./jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java Wed Jul 01 21:53:30 2015 -0700
+@@ -905,7 +905,7 @@
+ private static ObjectIdentifier mapPBEAlgorithmToOID(String algorithm)
+ throws NoSuchAlgorithmException {
+ // Check for PBES2 algorithms
+- if (algorithm.toLowerCase().startsWith("pbewithhmacsha")) {
++ if (algorithm.toLowerCase(Locale.ENGLISH).startsWith("pbewithhmacsha")) {
+ return pbes2_OID;
+ }
+ return AlgorithmId.get(algorithm).getOID();
+@@ -1058,6 +1058,39 @@
+ }
+
+ /**
++ * Determines if the keystore {@code Entry} for the specified
++ * {@code alias} is an instance or subclass of the specified
++ * {@code entryClass}.
++ *
++ * @param alias the alias name
++ * @param entryClass the entry class
++ *
++ * @return true if the keystore {@code Entry} for the specified
++ * {@code alias} is an instance or subclass of the
++ * specified {@code entryClass}, false otherwise
++ *
++ * @since 1.5
++ */
++ @Override
++ public boolean
++ engineEntryInstanceOf(String alias,
++ Class<? extends KeyStore.Entry> entryClass)
++ {
++ if (entryClass == KeyStore.TrustedCertificateEntry.class) {
++ return engineIsCertificateEntry(alias);
++ }
++
++ Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
++ if (entryClass == KeyStore.PrivateKeyEntry.class) {
++ return (entry != null && entry instanceof PrivateKeyEntry);
++ }
++ if (entryClass == KeyStore.SecretKeyEntry.class) {
++ return (entry != null && entry instanceof SecretKeyEntry);
++ }
++ return false;
++ }
++
++ /**
+ * Returns the (alias) name of the first keystore entry whose certificate
+ * matches the given certificate.
+ *
+@@ -1089,7 +1122,7 @@
+ } else {
+ continue;
+ }
+- if (certElem.equals(cert)) {
++ if (certElem != null && certElem.equals(cert)) {
+ return alias;
+ }
+ }
+@@ -1600,23 +1633,22 @@
+ Entry entry = entries.get(alias);
+
+ // certificate chain
+- int chainLen = 1;
+- Certificate[] certs = null;
++ Certificate[] certs;
+
+ if (entry instanceof PrivateKeyEntry) {
+ PrivateKeyEntry keyEntry = (PrivateKeyEntry) entry;
+- if (keyEntry.chain == null) {
+- chainLen = 0;
+- } else {
+- chainLen = keyEntry.chain.length;
+- }
+- certs = keyEntry.chain;
+-
++ if (keyEntry.chain != null) {
++ certs = keyEntry.chain;
++ } else {
++ certs = new Certificate[0];
++ }
+ } else if (entry instanceof CertEntry) {
+- certs = new Certificate[]{((CertEntry) entry).cert};
++ certs = new Certificate[]{((CertEntry) entry).cert};
++ } else {
++ certs = new Certificate[0];
+ }
+
+- for (int i = 0; i < chainLen; i++) {
++ for (int i = 0; i < certs.length; i++) {
+ // create SafeBag of Type CertBag
+ DerOutputStream safeBag = new DerOutputStream();
+ safeBag.putOID(CertBag_OID);
+@@ -1933,7 +1965,12 @@
+ safeContentsData = safeContents.getData();
+ } else if (contentType.equals((Object)ContentInfo.ENCRYPTED_DATA_OID)) {
+ if (password == null) {
+- continue;
++
++ if (debug != null) {
++ debug.println("Warning: skipping PKCS#7 encryptedData" +
++ " content-type - no password was supplied");
++ }
++ continue;
+ }
+
+ if (debug != null) {
+@@ -1975,8 +2012,9 @@
+ password = new char[1];
+ continue;
+ }
+- throw new IOException(
+- "failed to decrypt safe contents entry: " + e, e);
++ throw new IOException("keystore password was incorrect",
++ new UnrecoverableKeyException(
++ "failed to decrypt safe contents entry: " + e));
+ }
+ }
+ } else {
+@@ -2012,7 +2050,7 @@
+ "(MAC algorithm: " + m.getAlgorithm() + ")");
+ }
+
+- if (!MessageDigest.isEqual(macData.getDigest(), macResult)) {
++ if (!Arrays.equals(macData.getDigest(), macResult)) {
+ throw new SecurityException("Failed PKCS12" +
+ " integrity checking");
+ }
+--- ./jdk/src/share/classes/sun/security/provider/ConfigFile.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/ConfigFile.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -451,7 +451,7 @@
+
+ // controlFlag (required, optional, etc)
+ LoginModuleControlFlag controlFlag;
+- String sflag = match("controlFlag").toUpperCase();
++ String sflag = match("controlFlag").toUpperCase(Locale.ENGLISH);
+ switch (sflag) {
+ case "REQUIRED":
+ controlFlag = LoginModuleControlFlag.REQUIRED;
+--- ./jdk/src/share/classes/sun/security/provider/JavaKeyStore.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/JavaKeyStore.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -31,9 +31,10 @@
+ import java.security.cert.CertificateFactory;
+ import java.security.cert.CertificateException;
+ import java.util.*;
++
+ import sun.misc.IOUtils;
+-
+ import sun.security.pkcs.EncryptedPrivateKeyInfo;
++import sun.security.pkcs12.PKCS12KeyStore;
+
+ /**
+ * This class provides the keystore implementation referred to as "JKS".
+@@ -65,6 +66,13 @@
+ }
+ }
+
++ // special JKS that supports JKS and PKCS12 file formats
++ public static final class DualFormatJKS extends KeyStoreDelegator {
++ public DualFormatJKS() {
++ super("JKS", JKS.class, "PKCS12", PKCS12KeyStore.class);
++ }
++ }
++
+ private static final int MAGIC = 0xfeedfeed;
+ private static final int VERSION_1 = 0x01;
+ private static final int VERSION_2 = 0x02;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/classes/sun/security/provider/KeyStoreDelegator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,279 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package sun.security.provider;
++
++import java.io.*;
++import java.security.*;
++import java.security.cert.Certificate;
++import java.security.cert.CertificateFactory;
++import java.security.cert.CertificateException;
++import java.util.*;
++
++import sun.security.util.Debug;
++
++/**
++ * This class delegates to a primary or secondary keystore implementation.
++ *
++ * @since 1.8
++ */
++
++class KeyStoreDelegator extends KeyStoreSpi {
++
++ private static final String KEYSTORE_TYPE_COMPAT = "keystore.type.compat";
++ private static final Debug debug = Debug.getInstance("keystore");
++
++ private final String primaryType; // the primary keystore's type
++ private final String secondaryType; // the secondary keystore's type
++ private final Class<? extends KeyStoreSpi> primaryKeyStore;
++ // the primary keystore's class
++ private final Class<? extends KeyStoreSpi> secondaryKeyStore;
++ // the secondary keystore's class
++ private String type; // the delegate's type
++ private KeyStoreSpi keystore; // the delegate
++ private boolean compatModeEnabled = true;
++
++ public KeyStoreDelegator(
++ String primaryType,
++ Class<? extends KeyStoreSpi> primaryKeyStore,
++ String secondaryType,
++ Class<? extends KeyStoreSpi> secondaryKeyStore) {
++
++ // Check whether compatibility mode has been disabled
++ // (Use inner-class instead of lambda to avoid init/ClassLoader problem)
++ compatModeEnabled = "true".equalsIgnoreCase(
++ AccessController.doPrivileged(
++ new PrivilegedAction<String>() {
++ public String run() {
++ return Security.getProperty(KEYSTORE_TYPE_COMPAT);
++ }
++ }
++ ));
++
++ if (compatModeEnabled) {
++ this.primaryType = primaryType;
++ this.secondaryType = secondaryType;
++ this.primaryKeyStore = primaryKeyStore;
++ this.secondaryKeyStore = secondaryKeyStore;
++ } else {
++ this.primaryType = primaryType;
++ this.secondaryType = null;
++ this.primaryKeyStore = primaryKeyStore;
++ this.secondaryKeyStore = null;
++
++ if (debug != null) {
++ debug.println("WARNING: compatibility mode disabled for " +
++ primaryType + " and " + secondaryType + " keystore types");
++ }
++ }
++ }
++
++ @Override
++ public Key engineGetKey(String alias, char[] password)
++ throws NoSuchAlgorithmException, UnrecoverableKeyException {
++ return keystore.engineGetKey(alias, password);
++ }
++
++ @Override
++ public Certificate[] engineGetCertificateChain(String alias) {
++ return keystore.engineGetCertificateChain(alias);
++ }
++
++ @Override
++ public Certificate engineGetCertificate(String alias) {
++ return keystore.engineGetCertificate(alias);
++ }
++
++ @Override
++ public Date engineGetCreationDate(String alias) {
++ return keystore.engineGetCreationDate(alias);
++ }
++
++ @Override
++ public void engineSetKeyEntry(String alias, Key key, char[] password,
++ Certificate[] chain) throws KeyStoreException {
++ keystore.engineSetKeyEntry(alias, key, password, chain);
++ }
++
++ @Override
++ public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain)
++ throws KeyStoreException {
++ keystore.engineSetKeyEntry(alias, key, chain);
++ }
++
++ @Override
++ public void engineSetCertificateEntry(String alias, Certificate cert)
++ throws KeyStoreException {
++ keystore.engineSetCertificateEntry(alias, cert);
++ }
++
++ @Override
++ public void engineDeleteEntry(String alias) throws KeyStoreException {
++ keystore.engineDeleteEntry(alias);
++ }
++
++ @Override
++ public Enumeration<String> engineAliases() {
++ return keystore.engineAliases();
++ }
++
++ @Override
++ public boolean engineContainsAlias(String alias) {
++ return keystore.engineContainsAlias(alias);
++ }
++
++ @Override
++ public int engineSize() {
++ return keystore.engineSize();
++ }
++
++ @Override
++ public boolean engineIsKeyEntry(String alias) {
++ return keystore.engineIsKeyEntry(alias);
++ }
++
++ @Override
++ public boolean engineIsCertificateEntry(String alias) {
++ return keystore.engineIsCertificateEntry(alias);
++ }
++
++ @Override
++ public String engineGetCertificateAlias(Certificate cert) {
++ return keystore.engineGetCertificateAlias(cert);
++ }
++
++ @Override
++ public KeyStore.Entry engineGetEntry(String alias,
++ KeyStore.ProtectionParameter protParam)
++ throws KeyStoreException, NoSuchAlgorithmException,
++ UnrecoverableEntryException {
++ return keystore.engineGetEntry(alias, protParam);
++ }
++
++ @Override
++ public void engineSetEntry(String alias, KeyStore.Entry entry,
++ KeyStore.ProtectionParameter protParam)
++ throws KeyStoreException {
++ keystore.engineSetEntry(alias, entry, protParam);
++ }
++
++ @Override
++ public boolean engineEntryInstanceOf(String alias,
++ Class<? extends KeyStore.Entry> entryClass) {
++ return keystore.engineEntryInstanceOf(alias, entryClass);
++ }
++
++ @Override
++ public void engineStore(OutputStream stream, char[] password)
++ throws IOException, NoSuchAlgorithmException, CertificateException {
++
++ if (debug != null) {
++ debug.println("Storing keystore in " + type + " format");
++ }
++ keystore.engineStore(stream, password);
++ }
++
++ @Override
++ public void engineLoad(InputStream stream, char[] password)
++ throws IOException, NoSuchAlgorithmException, CertificateException {
++
++ // A new keystore is always created in the primary keystore format
++ if (stream == null || !compatModeEnabled) {
++ try {
++ keystore = primaryKeyStore.newInstance();
++
++ } catch (InstantiationException | IllegalAccessException e) {
++ // can safely ignore
++ }
++ type = primaryType;
++
++ if (debug != null && stream == null) {
++ debug.println("Creating a new keystore in " + type + " format");
++ }
++ keystore.engineLoad(stream, password);
++
++ } else {
++ // First try the primary keystore then try the secondary keystore
++ try (InputStream bufferedStream = new BufferedInputStream(stream)) {
++ bufferedStream.mark(Integer.MAX_VALUE);
++
++ try {
++ keystore = primaryKeyStore.newInstance();
++ type = primaryType;
++ keystore.engineLoad(bufferedStream, password);
++
++ } catch (Exception e) {
++
++ // incorrect password
++ if (e instanceof IOException &&
++ e.getCause() instanceof UnrecoverableKeyException) {
++ throw (IOException)e;
++ }
++
++ try {
++ keystore = secondaryKeyStore.newInstance();
++ type = secondaryType;
++ bufferedStream.reset();
++ keystore.engineLoad(bufferedStream, password);
++
++ if (debug != null) {
++ debug.println("WARNING: switching from " +
++ primaryType + " to " + secondaryType +
++ " keystore file format has altered the " +
++ "keystore security level");
++ }
++
++ } catch (InstantiationException |
++ IllegalAccessException e2) {
++ // can safely ignore
++
++ } catch (IOException |
++ NoSuchAlgorithmException |
++ CertificateException e3) {
++
++ // incorrect password
++ if (e3 instanceof IOException &&
++ e3.getCause() instanceof
++ UnrecoverableKeyException) {
++ throw (IOException)e3;
++ }
++ // rethrow the outer exception
++ if (e instanceof IOException) {
++ throw (IOException)e;
++ } else if (e instanceof CertificateException) {
++ throw (CertificateException)e;
++ } else if (e instanceof NoSuchAlgorithmException) {
++ throw (NoSuchAlgorithmException)e;
++ }
++ }
++ }
++ }
++
++ if (debug != null) {
++ debug.println("Loaded a keystore in " + type + " format");
++ }
++ }
++ }
++}
+--- ./jdk/src/share/classes/sun/security/provider/PolicyParser.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/PolicyParser.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -707,7 +707,7 @@
+ } catch (PropertyExpander.ExpandException peee) {
+ throw new IOException(peee.getLocalizedMessage());
+ }
+- properties.put(key.toLowerCase(), value);
++ properties.put(key.toLowerCase(Locale.ENGLISH), value);
+ }
+
+ return properties;
+--- ./jdk/src/share/classes/sun/security/provider/SunEntries.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/SunEntries.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -228,7 +228,8 @@
+ /*
+ * KeyStore
+ */
+- map.put("KeyStore.JKS", "sun.security.provider.JavaKeyStore$JKS");
++ map.put("KeyStore.JKS",
++ "sun.security.provider.JavaKeyStore$DualFormatJKS");
+ map.put("KeyStore.CaseExactJKS",
+ "sun.security.provider.JavaKeyStore$CaseExactJKS");
+ map.put("KeyStore.DKS", "sun.security.provider.DomainKeyStore$DKS");
+--- ./jdk/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -224,7 +224,8 @@
+ if (extVal == null) {
+ if (debug != null) {
+ debug.println("AdaptableX509CertSelector.match: "
+- + "no subject key ID extension");
++ + "no subject key ID extension. Subject: "
++ + xcert.getSubjectX500Principal());
+ }
+ return true;
+ }
+@@ -234,7 +235,9 @@
+ !Arrays.equals(ski, certSubjectKeyID)) {
+ if (debug != null) {
+ debug.println("AdaptableX509CertSelector.match: "
+- + "subject key IDs don't match");
++ + "subject key IDs don't match. "
++ + "Expected: " + Arrays.toString(ski) + " "
++ + "Cert's: " + Arrays.toString(certSubjectKeyID));
+ }
+ return false;
+ }
+--- ./jdk/src/share/classes/sun/security/provider/certpath/Builder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/Builder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -435,7 +435,12 @@
+ if (selector.match(targetCert) && !X509CertImpl.isSelfSigned
+ (targetCert, buildParams.sigProvider())) {
+ if (debug != null) {
+- debug.println("Builder.addMatchingCerts: adding target cert");
++ debug.println("Builder.addMatchingCerts: " +
++ "adding target cert" +
++ "\n SN: " + Debug.toHexString(
++ targetCert.getSerialNumber()) +
++ "\n Subject: " + targetCert.getSubjectX500Principal() +
++ "\n Issuer: " + targetCert.getIssuerX500Principal());
+ }
+ return resultCerts.add(targetCert);
+ }
+--- ./jdk/src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -145,8 +145,8 @@
+ if (prevNC != null && ((i == certPathLength) ||
+ !X509CertImpl.isSelfIssued(currCert))) {
+ if (debug != null) {
+- debug.println("prevNC = " + prevNC);
+- debug.println("currDN = " + currCert.getSubjectX500Principal());
++ debug.println("prevNC = " + prevNC +
++ ", currDN = " + currCert.getSubjectX500Principal());
+ }
+
+ try {
+@@ -184,8 +184,8 @@
+ currCertImpl.getNameConstraintsExtension();
+
+ if (debug != null) {
+- debug.println("prevNC = " + prevNC);
+- debug.println("newNC = " + String.valueOf(newConstraints));
++ debug.println("prevNC = " + prevNC +
++ ", newNC = " + String.valueOf(newConstraints));
+ }
+
+ // if there are no previous name constraints, we just return the
+@@ -225,8 +225,8 @@
+ String msg = "basic constraints";
+ if (debug != null) {
+ debug.println("---checking " + msg + "...");
+- debug.println("i = " + i);
+- debug.println("maxPathLength = " + maxPathLength);
++ debug.println("i = " + i +
++ ", maxPathLength = " + maxPathLength);
+ }
+
+ /* check if intermediate cert */
+--- ./jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java Wed Jul 01 21:53:30 2015 -0700
+@@ -320,6 +320,14 @@
+ Set<TrustAnchor> trustAnchors, List<CertStore> certStores,
+ Date validity) throws CRLException, IOException {
+
++ if (debug != null) {
++ debug.println("DistributionPointFetcher.verifyCRL: " +
++ "checking revocation status for" +
++ "\n SN: " + Debug.toHexString(certImpl.getSerialNumber()) +
++ "\n Subject: " + certImpl.getSubjectX500Principal() +
++ "\n Issuer: " + certImpl.getIssuerX500Principal());
++ }
++
+ boolean indirectCRL = false;
+ X509CRLImpl crlImpl = X509CRLImpl.toImpl(crl);
+ IssuingDistributionPointExtension idpExt =
+@@ -363,7 +371,9 @@
+ }
+ } else if (crlIssuer.equals(certIssuer) == false) {
+ if (debug != null) {
+- debug.println("crl issuer does not equal cert issuer");
++ debug.println("crl issuer does not equal cert issuer.\n" +
++ "crl issuer: " + crlIssuer + "\n" +
++ "cert issuer: " + certIssuer);
+ }
+ return false;
+ } else {
+--- ./jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -209,7 +209,8 @@
+ * getMatchingEECerts
+ */
+ if (debug != null) {
+- debug.println("ForwardBuilder.getMatchingCACerts(): ca is target");
++ debug.println("ForwardBuilder.getMatchingCACerts(): " +
++ "the target is a CA");
+ }
+
+ if (caTargetSelector == null) {
+@@ -291,8 +292,14 @@
+ for (X509Certificate trustedCert : trustedCerts) {
+ if (sel.match(trustedCert)) {
+ if (debug != null) {
+- debug.println("ForwardBuilder.getMatchingCACerts: "
+- + "found matching trust anchor");
++ debug.println("ForwardBuilder.getMatchingCACerts: " +
++ "found matching trust anchor." +
++ "\n SN: " +
++ Debug.toHexString(trustedCert.getSerialNumber()) +
++ "\n Subject: " +
++ trustedCert.getSubjectX500Principal() +
++ "\n Issuer: " +
++ trustedCert.getIssuerX500Principal());
+ }
+ if (caCerts.add(trustedCert) && !searchAllCertStores) {
+ return;
+--- ./jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 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
+@@ -151,8 +151,8 @@
+ private static final int DEFAULT_MAX_CLOCK_SKEW = 900000;
+
+ /**
+- * Integer value indicating the maximum allowable clock skew,
+- * in milliseconds, to be used for the OCSP check.
++ * Integer value indicating the maximum allowable clock skew, in seconds,
++ * to be used for the OCSP check.
+ */
+ private static final int MAX_CLOCK_SKEW = initializeClockSkew();
+
+@@ -586,14 +586,13 @@
+ "Unable to verify OCSP Response's signature");
+ }
+
++ // Check freshness of OCSPResponse
+ if (nonce != null) {
+ if (responseNonce != null && !Arrays.equals(nonce, responseNonce)) {
+ throw new CertPathValidatorException("Nonces don't match");
+ }
+ }
+
+- // Check freshness of OCSPResponse
+-
+ long now = (date == null) ? System.currentTimeMillis() : date.getTime();
+ Date nowPlusSkew = new Date(now + MAX_CLOCK_SKEW);
+ Date nowMinusSkew = new Date(now - MAX_CLOCK_SKEW);
+@@ -603,18 +602,13 @@
+ if (sr.nextUpdate != null) {
+ until = " until " + sr.nextUpdate;
+ }
+- debug.println("OCSP response validity interval is from " +
++ debug.println("Response's validity interval is from " +
+ sr.thisUpdate + until);
+- debug.println("Checking validity of OCSP response on: " +
+- new Date(now));
+ }
+
+- // Check that the test date is within the validity interval:
+- // [ thisUpdate - MAX_CLOCK_SKEW,
+- // MAX(thisUpdate, nextUpdate) + MAX_CLOCK_SKEW ]
+- if (nowPlusSkew.before(sr.thisUpdate) ||
+- nowMinusSkew.after(
+- sr.nextUpdate != null ? sr.nextUpdate : sr.thisUpdate))
++ // Check that the test date is within the validity interval
++ if ((sr.thisUpdate != null && nowPlusSkew.before(sr.thisUpdate)) ||
++ (sr.nextUpdate != null && nowMinusSkew.after(sr.nextUpdate)))
+ {
+ throw new CertPathValidatorException(
+ "Response is unreliable: its validity " +
+--- ./jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -159,19 +159,12 @@
+ ValidatorParams params)
+ throws CertPathValidatorException
+ {
+- // check if anchor is untrusted
+- UntrustedChecker untrustedChecker = new UntrustedChecker();
+- X509Certificate anchorCert = anchor.getTrustedCert();
+- if (anchorCert != null) {
+- untrustedChecker.check(anchorCert);
+- }
+-
+ int certPathLen = params.certificates().size();
+
+ // create PKIXCertPathCheckers
+ List<PKIXCertPathChecker> certPathCheckers = new ArrayList<>();
+ // add standard checkers that we will be using
+- certPathCheckers.add(untrustedChecker);
++ certPathCheckers.add(new UntrustedChecker());
+ certPathCheckers.add(new AlgorithmChecker(anchor));
+ certPathCheckers.add(new KeyChecker(certPathLen,
+ params.targetCertConstraints()));
+--- ./jdk/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -30,6 +30,7 @@
+ import java.util.Collections;
+ import java.util.List;
+ import java.util.Set;
++import java.util.StringJoiner;
+ import java.security.cert.CertPath;
+ import java.security.cert.CertPathValidatorException;
+ import java.security.cert.PKIXCertPathChecker;
+@@ -88,20 +89,25 @@
+ * current certificate of this loop to be the previous certificate
+ * of the next loop. The state is initialized during first loop.
+ */
+- if (debug != null)
+- debug.println("Checking cert" + (i+1) + " ...");
++ X509Certificate currCert = reversedCertList.get(i);
+
+- X509Certificate currCert = reversedCertList.get(i);
++ if (debug != null) {
++ debug.println("Checking cert" + (i+1) + " - Subject: " +
++ currCert.getSubjectX500Principal());
++ }
++
+ Set<String> unresCritExts = currCert.getCriticalExtensionOIDs();
+ if (unresCritExts == null) {
+ unresCritExts = Collections.<String>emptySet();
+ }
+
+ if (debug != null && !unresCritExts.isEmpty()) {
+- debug.println("Set of critical extensions:");
++ StringJoiner joiner = new StringJoiner(", ", "{", "}");
+ for (String oid : unresCritExts) {
+- debug.println(oid);
++ joiner.add(oid);
+ }
++ debug.println("Set of critical extensions: " +
++ joiner.toString());
+ }
+
+ for (int j = 0; j < certPathCheckers.size(); j++) {
+--- ./jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -343,11 +343,17 @@
+ PublicKey pubKey, boolean crlSignFlag)
+ throws CertPathValidatorException
+ {
++ if (debug != null) {
++ debug.println("RevocationChecker.check: checking cert" +
++ "\n SN: " + Debug.toHexString(xcert.getSerialNumber()) +
++ "\n Subject: " + xcert.getSubjectX500Principal() +
++ "\n Issuer: " + xcert.getIssuerX500Principal());
++ }
+ try {
+ if (onlyEE && xcert.getBasicConstraints() != -1) {
+ if (debug != null) {
+- debug.println("Skipping revocation check, not end " +
+- "entity cert");
++ debug.println("Skipping revocation check; cert is not " +
++ "an end entity cert");
+ }
+ return;
+ }
+--- ./jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -136,7 +136,8 @@
+ PKIXCertPathBuilderResult result = buildCertPath(false, adjList);
+ if (result == null) {
+ if (debug != null) {
+- debug.println("SunCertPathBuilder.engineBuild: 2nd pass");
++ debug.println("SunCertPathBuilder.engineBuild: 2nd pass; " +
++ "try building again searching all certstores");
+ }
+ // try again
+ adjList.clear();
+--- ./jdk/src/share/classes/sun/security/rsa/RSASignature.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/rsa/RSASignature.java Wed Jul 01 21:53:30 2015 -0700
+@@ -27,6 +27,7 @@
+
+ import java.io.IOException;
+ import java.nio.ByteBuffer;
++import java.util.Arrays;
+
+ import java.security.*;
+ import java.security.interfaces.*;
+@@ -193,7 +194,7 @@
+ byte[] decrypted = RSACore.rsa(sigBytes, publicKey);
+ byte[] unpadded = padding.unpad(decrypted);
+ byte[] decodedDigest = decodeSignature(digestOID, unpadded);
+- return MessageDigest.isEqual(digest, decodedDigest);
++ return Arrays.equals(digest, decodedDigest);
+ } catch (javax.crypto.BadPaddingException e) {
+ // occurs if the app has used the wrong RSA public key
+ // or if sigBytes is invalid
+--- ./jdk/src/share/classes/sun/security/ssl/CipherSuite.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/CipherSuite.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -968,7 +968,7 @@
+ * 1. Prefer Suite B compliant cipher suites, see RFC6460 (To be
+ * changed later, see below).
+ * 2. Prefer the stronger bulk cipher, in the order of AES_256(GCM),
+- * AES_128(GCM), AES_256, AES_128, 3DES-EDE.
++ * AES_128(GCM), AES_256, AES_128, 3DES-EDE, RC-4.
+ * 3. Prefer the stronger MAC algorithm, in the order of SHA384,
+ * SHA256, SHA, MD5.
+ * 4. Prefer the better performance of key exchange and digital
+@@ -1115,6 +1115,20 @@
+ add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
+ 0x0013, --p, K_DHE_DSS, B_3DES, N);
+
++ // RC-4
++ add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
++ 0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N);
++ add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
++ 0xC011, --p, K_ECDHE_RSA, B_RC4_128, N);
++ add("SSL_RSA_WITH_RC4_128_SHA",
++ 0x0005, --p, K_RSA, B_RC4_128, N);
++ add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
++ 0xC002, --p, K_ECDH_ECDSA, B_RC4_128, N);
++ add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
++ 0xC00C, --p, K_ECDH_RSA, B_RC4_128, N);
++ add("SSL_RSA_WITH_RC4_128_MD5",
++ 0x0004, --p, K_RSA, B_RC4_128, N);
++
+ // Renegotiation protection request Signalling Cipher Suite Value (SCSV)
+ add("TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
+ 0x00ff, --p, K_SCSV, B_NULL, T);
+@@ -1164,20 +1178,6 @@
+ add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
+ 0x001b, --p, K_DH_ANON, B_3DES, N);
+
+- // RC-4
+- add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+- 0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N);
+- add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
+- 0xC011, --p, K_ECDHE_RSA, B_RC4_128, N);
+- add("SSL_RSA_WITH_RC4_128_SHA",
+- 0x0005, --p, K_RSA, B_RC4_128, N);
+- add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
+- 0xC002, --p, K_ECDH_ECDSA, B_RC4_128, N);
+- add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
+- 0xC00C, --p, K_ECDH_RSA, B_RC4_128, N);
+- add("SSL_RSA_WITH_RC4_128_MD5",
+- 0x0004, --p, K_RSA, B_RC4_128, N);
+-
+ add("TLS_ECDH_anon_WITH_RC4_128_SHA",
+ 0xC016, --p, K_ECDH_ANON, B_RC4_128, N);
+ add("SSL_DH_anon_WITH_RC4_128_MD5",
+--- ./jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java Wed Jul 01 21:53:30 2015 -0700
+@@ -59,6 +59,10 @@
+ */
+ final class ClientHandshaker extends Handshaker {
+
++ // constants for subject alt names of type DNS and IP
++ private final static int ALTNAME_DNS = 2;
++ private final static int ALTNAME_IP = 7;
++
+ // the server's public key from its certificate.
+ private PublicKey serverKey;
+
+@@ -485,7 +489,7 @@
+ 0, clientVerifyData.length);
+ System.arraycopy(serverVerifyData, 0, verifyData,
+ clientVerifyData.length, serverVerifyData.length);
+- if (!MessageDigest.isEqual(verifyData,
++ if (!Arrays.equals(verifyData,
+ serverHelloRI.getRenegotiatedConnection())) {
+ fatalSE(Alerts.alert_handshake_failure,
+ "Incorrect verify data in ServerHello " +
+@@ -675,14 +679,6 @@
+ // NOTREACHED
+ }
+ ephemeralServerKey = mesg.getPublicKey();
+-
+- // check constraints of RSA PublicKey
+- if (!algorithmConstraints.permits(
+- EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), ephemeralServerKey)) {
+-
+- throw new SSLHandshakeException("RSA ServerKeyExchange " +
+- "does not comply to algorithm constraints");
+- }
+ }
+
+
+@@ -700,9 +696,6 @@
+ dh = new DHCrypt(mesg.getModulus(), mesg.getBase(),
+ sslContext.getSecureRandom());
+ serverDH = mesg.getServerPublicKey();
+-
+- // check algorithm constraints
+- dh.checkConstraints(algorithmConstraints, serverDH);
+ }
+
+ private void serverKeyExchange(ECDH_ServerKeyExchange mesg)
+@@ -713,14 +706,6 @@
+ ECPublicKey key = mesg.getPublicKey();
+ ecdh = new ECDHCrypt(key.getParams(), sslContext.getSecureRandom());
+ ephemeralServerKey = key;
+-
+- // check constraints of EC PublicKey
+- if (!algorithmConstraints.permits(
+- EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), ephemeralServerKey)) {
+-
+- throw new SSLHandshakeException("ECDH ServerKeyExchange " +
+- "does not comply to algorithm constraints");
+- }
+ }
+
+ /*
+@@ -837,6 +822,11 @@
+ } else {
+ warningSE(Alerts.alert_no_certificate);
+ }
++ if (debug != null && Debug.isOn("handshake")) {
++ System.out.println(
++ "Warning: no suitable certificate found - " +
++ "continuing without client authentication");
++ }
+ }
+
+ //
+@@ -1516,20 +1506,49 @@
+ return true;
+ }
+
+- // check the iPAddress field in subjectAltName extension
+- Object thisIPAddress = getSubjectAltName(thisCert, 7); // 7: iPAddress
+- Object prevIPAddress = getSubjectAltName(prevCert, 7);
+- if (thisIPAddress != null && prevIPAddress!= null) {
+- // only allow the exactly match
+- return Objects.equals(thisIPAddress, prevIPAddress);
++ // check subject alternative names
++ Collection<List<?>> thisSubjectAltNames = null;
++ try {
++ thisSubjectAltNames = thisCert.getSubjectAlternativeNames();
++ } catch (CertificateParsingException cpe) {
++ if (debug != null && Debug.isOn("handshake")) {
++ System.out.println(
++ "Attempt to obtain subjectAltNames extension failed!");
++ }
+ }
+
+- // check the dNSName field in subjectAltName extension
+- Object thisDNSName = getSubjectAltName(thisCert, 2); // 2: dNSName
+- Object prevDNSName = getSubjectAltName(prevCert, 2);
+- if (thisDNSName != null && prevDNSName!= null) {
+- // only allow the exactly match
+- return Objects.equals(thisDNSName, prevDNSName);
++ Collection<List<?>> prevSubjectAltNames = null;
++ try {
++ prevSubjectAltNames = prevCert.getSubjectAlternativeNames();
++ } catch (CertificateParsingException cpe) {
++ if (debug != null && Debug.isOn("handshake")) {
++ System.out.println(
++ "Attempt to obtain subjectAltNames extension failed!");
++ }
++ }
++
++ if ((thisSubjectAltNames != null) && (prevSubjectAltNames != null)) {
++ // check the iPAddress field in subjectAltName extension
++ Collection<String> thisSubAltIPAddrs =
++ getSubjectAltNames(thisSubjectAltNames, ALTNAME_IP);
++ Collection<String> prevSubAltIPAddrs =
++ getSubjectAltNames(prevSubjectAltNames, ALTNAME_IP);
++ if ((thisSubAltIPAddrs != null) && (prevSubAltIPAddrs != null) &&
++ (isEquivalent(thisSubAltIPAddrs, prevSubAltIPAddrs))) {
++
++ return true;
++ }
++
++ // check the dNSName field in subjectAltName extension
++ Collection<String> thisSubAltDnsNames =
++ getSubjectAltNames(thisSubjectAltNames, ALTNAME_DNS);
++ Collection<String> prevSubAltDnsNames =
++ getSubjectAltNames(prevSubjectAltNames, ALTNAME_DNS);
++ if ((thisSubAltDnsNames != null) && (prevSubAltDnsNames != null) &&
++ (isEquivalent(thisSubAltDnsNames, prevSubAltDnsNames))) {
++
++ return true;
++ }
+ }
+
+ // check the certificate subject and issuer
+@@ -1550,29 +1569,43 @@
+ /*
+ * Returns the subject alternative name of the specified type in the
+ * subjectAltNames extension of a certificate.
++ *
++ * Note that only those subjectAltName types that use String data
++ * should be passed into this function.
+ */
+- private static Object getSubjectAltName(X509Certificate cert, int type) {
+- Collection<List<?>> subjectAltNames;
++ private static Collection<String> getSubjectAltNames(
++ Collection<List<?>> subjectAltNames, int type) {
+
+- try {
+- subjectAltNames = cert.getSubjectAlternativeNames();
+- } catch (CertificateParsingException cpe) {
+- if (debug != null && Debug.isOn("handshake")) {
+- System.out.println(
+- "Attempt to obtain subjectAltNames extension failed!");
+- }
+- return null;
+- }
+-
+- if (subjectAltNames != null) {
+- for (List<?> subjectAltName : subjectAltNames) {
+- int subjectAltNameType = (Integer)subjectAltName.get(0);
+- if (subjectAltNameType == type) {
+- return subjectAltName.get(1);
++ HashSet<String> subAltDnsNames = null;
++ for (List<?> subjectAltName : subjectAltNames) {
++ int subjectAltNameType = (Integer)subjectAltName.get(0);
++ if (subjectAltNameType == type) {
++ String subAltDnsName = (String)subjectAltName.get(1);
++ if ((subAltDnsName != null) && !subAltDnsName.isEmpty()) {
++ if (subAltDnsNames == null) {
++ subAltDnsNames =
++ new HashSet<>(subjectAltNames.size());
++ }
++ subAltDnsNames.add(subAltDnsName);
+ }
+ }
+ }
+
+- return null;
++ return subAltDnsNames;
++ }
++
++ private static boolean isEquivalent(Collection<String> thisSubAltNames,
++ Collection<String> prevSubAltNames) {
++
++ for (String thisSubAltName : thisSubAltNames) {
++ for (String prevSubAltName : prevSubAltNames) {
++ // Only allow the exactly match. Check no wildcard character.
++ if (thisSubAltName.equalsIgnoreCase(prevSubAltName)) {
++ return true;
++ }
++ }
++ }
++
++ return false;
+ }
+ }
+--- ./jdk/src/share/classes/sun/security/ssl/DHCrypt.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/DHCrypt.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -34,7 +34,6 @@
+ import javax.crypto.KeyAgreement;
+ import javax.crypto.interfaces.DHPublicKey;
+ import javax.crypto.spec.*;
+-import java.util.EnumSet;
+
+ import sun.security.util.KeyUtil;
+
+@@ -217,28 +216,6 @@
+ }
+ }
+
+- // Check constraints of the specified DH public key.
+- void checkConstraints(AlgorithmConstraints constraints,
+- BigInteger peerPublicValue) throws SSLHandshakeException {
+-
+- try {
+- KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman");
+- DHPublicKeySpec spec =
+- new DHPublicKeySpec(peerPublicValue, modulus, base);
+- DHPublicKey publicKey = (DHPublicKey)kf.generatePublic(spec);
+-
+- // check constraints of DHPublicKey
+- if (!constraints.permits(
+- EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) {
+- throw new SSLHandshakeException(
+- "DHPublicKey does not comply to algorithm constraints");
+- }
+- } catch (GeneralSecurityException gse) {
+- throw (SSLHandshakeException) new SSLHandshakeException(
+- "Could not generate DHPublicKey").initCause(gse);
+- }
+- }
+-
+ // Generate and validate DHPublicKeySpec
+ private DHPublicKeySpec generateDHPublicKeySpec(KeyPairGenerator kpg)
+ throws GeneralSecurityException {
+--- ./jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2006, 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
+@@ -29,7 +29,6 @@
+ import java.security.interfaces.ECPublicKey;
+ import java.security.spec.*;
+
+-import java.util.EnumSet;
+ import javax.crypto.SecretKey;
+ import javax.crypto.KeyAgreement;
+ import javax.net.ssl.SSLHandshakeException;
+@@ -89,11 +88,8 @@
+ return publicKey;
+ }
+
+- // called by ClientHandshaker with either the server's static or
+- // ephemeral public key
+- SecretKey getAgreedSecret(
+- PublicKey peerPublicKey) throws SSLHandshakeException {
+-
++ // called by ClientHandshaker with either the server's static or ephemeral public key
++ SecretKey getAgreedSecret(PublicKey peerPublicKey) throws SSLHandshakeException {
+ try {
+ KeyAgreement ka = JsseJce.getKeyAgreement("ECDH");
+ ka.init(privateKey);
+@@ -106,13 +102,10 @@
+ }
+
+ // called by ServerHandshaker
+- SecretKey getAgreedSecret(
+- byte[] encodedPoint) throws SSLHandshakeException {
+-
++ SecretKey getAgreedSecret(byte[] encodedPoint) throws SSLHandshakeException {
+ try {
+ ECParameterSpec params = publicKey.getParams();
+- ECPoint point =
+- JsseJce.decodePoint(encodedPoint, params.getCurve());
++ ECPoint point = JsseJce.decodePoint(encodedPoint, params.getCurve());
+ KeyFactory kf = JsseJce.getKeyFactory("EC");
+ ECPublicKeySpec spec = new ECPublicKeySpec(point, params);
+ PublicKey peerPublicKey = kf.generatePublic(spec);
+@@ -123,30 +116,4 @@
+ }
+ }
+
+- // Check constraints of the specified EC public key.
+- void checkConstraints(AlgorithmConstraints constraints,
+- byte[] encodedPoint) throws SSLHandshakeException {
+-
+- try {
+-
+- ECParameterSpec params = publicKey.getParams();
+- ECPoint point =
+- JsseJce.decodePoint(encodedPoint, params.getCurve());
+- ECPublicKeySpec spec = new ECPublicKeySpec(point, params);
+-
+- KeyFactory kf = JsseJce.getKeyFactory("EC");
+- ECPublicKey publicKey = (ECPublicKey)kf.generatePublic(spec);
+-
+- // check constraints of ECPublicKey
+- if (!constraints.permits(
+- EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) {
+- throw new SSLHandshakeException(
+- "ECPublicKey does not comply to algorithm constraints");
+- }
+- } catch (GeneralSecurityException | java.io.IOException e) {
+- throw (SSLHandshakeException) new SSLHandshakeException(
+- "Could not generate ECPublicKey").initCause(e);
+- }
+- }
+-
+ }
+--- ./jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java Wed Jul 01 21:53:30 2015 -0700
+@@ -243,6 +243,7 @@
+ protocolVersion = ProtocolVersion.valueOf(s.getInt8(), s.getInt8());
+ clnt_random = new RandomCookie(s);
+ sessionId = new SessionId(s.getBytes8());
++ sessionId.checkLength(protocolVersion);
+ cipherSuites = new CipherSuiteList(s);
+ compression_methods = s.getBytes8();
+ if (messageLength() != messageLength) {
+@@ -355,6 +356,7 @@
+ input.getInt8());
+ svr_random = new RandomCookie(input);
+ sessionId = new SessionId(input.getBytes8());
++ sessionId.checkLength(protocolVersion);
+ cipherSuite = CipherSuite.valueOf(input.getInt8(), input.getInt8());
+ compression_method = (byte)input.getInt8();
+ if (messageLength() != messageLength) {
+@@ -490,11 +492,14 @@
+ void print(PrintStream s) throws IOException {
+ s.println("*** Certificate chain");
+
+- if (debug != null && Debug.isOn("verbose")) {
+- for (int i = 0; i < chain.length; i++)
++ if (chain.length == 0) {
++ s.println("<Empty>");
++ } else if (debug != null && Debug.isOn("verbose")) {
++ for (int i = 0; i < chain.length; i++) {
+ s.println("chain [" + i + "] = " + chain[i]);
+- s.println("***");
++ }
+ }
++ s.println("***");
+ }
+
+ X509Certificate[] getCertificateChain() {
+@@ -1907,7 +1912,7 @@
+ */
+ boolean verify(HandshakeHash handshakeHash, int sender, SecretKey master) {
+ byte[] myFinished = getFinished(handshakeHash, sender, master);
+- return MessageDigest.isEqual(myFinished, verifyData);
++ return Arrays.equals(myFinished, verifyData);
+ }
+
+ /*
+--- ./jdk/src/share/classes/sun/security/ssl/Handshaker.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/Handshaker.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -86,7 +86,7 @@
+ String identificationProtocol;
+
+ // The cryptographic algorithm constraints
+- AlgorithmConstraints algorithmConstraints = null;
++ private AlgorithmConstraints algorithmConstraints = null;
+
+ // Local supported signature and algorithms
+ Collection<SignatureAndHashAlgorithm> localSupportedSignAlgs;
+--- ./jdk/src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -34,9 +34,9 @@
+ import java.security.Key;
+
+ import java.util.Set;
++import java.util.HashSet;
+
+ import sun.security.util.DisabledAlgorithmConstraints;
+-import static sun.security.util.DisabledAlgorithmConstraints.*;
+ import sun.security.ssl.CipherSuite.*;
+
+ /**
+@@ -46,15 +46,10 @@
+ * for the syntax of the disabled algorithm string.
+ */
+ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
+-
+ private final static AlgorithmConstraints tlsDisabledAlgConstraints =
+- new DisabledAlgorithmConstraints(PROPERTY_TLS_DISABLED_ALGS,
+- new SSLAlgorithmDecomposer());
+-
++ new TLSDisabledAlgConstraints();
+ private final static AlgorithmConstraints x509DisabledAlgConstraints =
+- new DisabledAlgorithmConstraints(PROPERTY_CERTPATH_DISABLED_ALGS,
+- new SSLAlgorithmDecomposer(true));
+-
++ new X509DisabledAlgConstraints();
+ private AlgorithmConstraints userAlgConstraints = null;
+ private AlgorithmConstraints peerAlgConstraints = null;
+
+@@ -272,4 +267,217 @@
+ }
+ }
+
++ static private class BasicDisabledAlgConstraints
++ extends DisabledAlgorithmConstraints {
++ BasicDisabledAlgConstraints(String propertyName) {
++ super(propertyName);
++ }
++
++ protected Set<String> decomposes(KeyExchange keyExchange,
++ boolean forCertPathOnly) {
++ Set<String> components = new HashSet<>();
++ switch (keyExchange) {
++ case K_NULL:
++ if (!forCertPathOnly) {
++ components.add("NULL");
++ }
++ break;
++ case K_RSA:
++ components.add("RSA");
++ break;
++ case K_RSA_EXPORT:
++ components.add("RSA");
++ components.add("RSA_EXPORT");
++ break;
++ case K_DH_RSA:
++ components.add("RSA");
++ components.add("DH");
++ components.add("DiffieHellman");
++ components.add("DH_RSA");
++ break;
++ case K_DH_DSS:
++ components.add("DSA");
++ components.add("DSS");
++ components.add("DH");
++ components.add("DiffieHellman");
++ components.add("DH_DSS");
++ break;
++ case K_DHE_DSS:
++ components.add("DSA");
++ components.add("DSS");
++ components.add("DH");
++ components.add("DHE");
++ components.add("DiffieHellman");
++ components.add("DHE_DSS");
++ break;
++ case K_DHE_RSA:
++ components.add("RSA");
++ components.add("DH");
++ components.add("DHE");
++ components.add("DiffieHellman");
++ components.add("DHE_RSA");
++ break;
++ case K_DH_ANON:
++ if (!forCertPathOnly) {
++ components.add("ANON");
++ components.add("DH");
++ components.add("DiffieHellman");
++ components.add("DH_ANON");
++ }
++ break;
++ case K_ECDH_ECDSA:
++ components.add("ECDH");
++ components.add("ECDSA");
++ components.add("ECDH_ECDSA");
++ break;
++ case K_ECDH_RSA:
++ components.add("ECDH");
++ components.add("RSA");
++ components.add("ECDH_RSA");
++ break;
++ case K_ECDHE_ECDSA:
++ components.add("ECDHE");
++ components.add("ECDSA");
++ components.add("ECDHE_ECDSA");
++ break;
++ case K_ECDHE_RSA:
++ components.add("ECDHE");
++ components.add("RSA");
++ components.add("ECDHE_RSA");
++ break;
++ case K_ECDH_ANON:
++ if (!forCertPathOnly) {
++ components.add("ECDH");
++ components.add("ANON");
++ components.add("ECDH_ANON");
++ }
++ break;
++ case K_KRB5:
++ if (!forCertPathOnly) {
++ components.add("KRB5");
++ }
++ break;
++ case K_KRB5_EXPORT:
++ if (!forCertPathOnly) {
++ components.add("KRB5_EXPORT");
++ }
++ break;
++ default:
++ // ignore
++ }
++
++ return components;
++ }
++
++ protected Set<String> decomposes(BulkCipher bulkCipher) {
++ Set<String> components = new HashSet<>();
++
++ if (bulkCipher.transformation != null) {
++ components.addAll(super.decomposes(bulkCipher.transformation));
++ }
++
++ return components;
++ }
++
++ protected Set<String> decomposes(MacAlg macAlg) {
++ Set<String> components = new HashSet<>();
++
++ if (macAlg == CipherSuite.M_MD5) {
++ components.add("MD5");
++ components.add("HmacMD5");
++ } else if (macAlg == CipherSuite.M_SHA) {
++ components.add("SHA1");
++ components.add("SHA-1");
++ components.add("HmacSHA1");
++ } else if (macAlg == CipherSuite.M_SHA256) {
++ components.add("SHA256");
++ components.add("SHA-256");
++ components.add("HmacSHA256");
++ } else if (macAlg == CipherSuite.M_SHA384) {
++ components.add("SHA384");
++ components.add("SHA-384");
++ components.add("HmacSHA384");
++ }
++
++ return components;
++ }
++ }
++
++ static private class TLSDisabledAlgConstraints
++ extends BasicDisabledAlgConstraints {
++
++ TLSDisabledAlgConstraints() {
++ super(DisabledAlgorithmConstraints.PROPERTY_TLS_DISABLED_ALGS);
++ }
++
++ @Override
++ protected Set<String> decomposes(String algorithm) {
++ if (algorithm.startsWith("SSL_") || algorithm.startsWith("TLS_")) {
++ CipherSuite cipherSuite = null;
++ try {
++ cipherSuite = CipherSuite.valueOf(algorithm);
++ } catch (IllegalArgumentException iae) {
++ // ignore: unknown or unsupported ciphersuite
++ }
++
++ if (cipherSuite != null) {
++ Set<String> components = new HashSet<>();
++
++ if(cipherSuite.keyExchange != null) {
++ components.addAll(
++ decomposes(cipherSuite.keyExchange, false));
++ }
++
++ if (cipherSuite.cipher != null) {
++ components.addAll(decomposes(cipherSuite.cipher));
++ }
++
++ if (cipherSuite.macAlg != null) {
++ components.addAll(decomposes(cipherSuite.macAlg));
++ }
++
++ return components;
++ }
++ }
++
++ return super.decomposes(algorithm);
++ }
++ }
++
++ static private class X509DisabledAlgConstraints
++ extends BasicDisabledAlgConstraints {
++
++ X509DisabledAlgConstraints() {
++ super(DisabledAlgorithmConstraints.PROPERTY_CERTPATH_DISABLED_ALGS);
++ }
++
++ @Override
++ protected Set<String> decomposes(String algorithm) {
++ if (algorithm.startsWith("SSL_") || algorithm.startsWith("TLS_")) {
++ CipherSuite cipherSuite = null;
++ try {
++ cipherSuite = CipherSuite.valueOf(algorithm);
++ } catch (IllegalArgumentException iae) {
++ // ignore: unknown or unsupported ciphersuite
++ }
++
++ if (cipherSuite != null) {
++ Set<String> components = new HashSet<>();
++
++ if(cipherSuite.keyExchange != null) {
++ components.addAll(
++ decomposes(cipherSuite.keyExchange, true));
++ }
++
++ // Certification path algorithm constraints do not apply
++ // to cipherSuite.cipher and cipherSuite.macAlg.
++
++ return components;
++ }
++ }
++
++ return super.decomposes(algorithm);
++ }
++ }
+ }
++
+--- ./jdk/src/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,251 +0,0 @@
+-/*
+- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation. Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-package sun.security.ssl;
+-
+-import java.util.HashSet;
+-import java.util.Set;
+-import sun.security.util.AlgorithmDecomposer;
+-import static sun.security.ssl.CipherSuite.*;
+-import static sun.security.ssl.CipherSuite.KeyExchange.*;
+-
+-/**
+- * The class decomposes standard SSL/TLS cipher suites into sub-elements.
+- */
+-class SSLAlgorithmDecomposer extends AlgorithmDecomposer {
+-
+- // indicates that only certification path algorithms need to be used
+- private final boolean onlyX509;
+-
+- SSLAlgorithmDecomposer(boolean onlyX509) {
+- this.onlyX509 = onlyX509;
+- }
+-
+- SSLAlgorithmDecomposer() {
+- this(false);
+- }
+-
+- private Set<String> decomposes(CipherSuite.KeyExchange keyExchange) {
+- Set<String> components = new HashSet<>();
+- switch (keyExchange) {
+- case K_NULL:
+- if (!onlyX509) {
+- components.add("K_NULL");
+- }
+- break;
+- case K_RSA:
+- components.add("RSA");
+- break;
+- case K_RSA_EXPORT:
+- components.add("RSA");
+- components.add("RSA_EXPORT");
+- break;
+- case K_DH_RSA:
+- components.add("RSA");
+- components.add("DH");
+- components.add("DiffieHellman");
+- components.add("DH_RSA");
+- break;
+- case K_DH_DSS:
+- components.add("DSA");
+- components.add("DSS");
+- components.add("DH");
+- components.add("DiffieHellman");
+- components.add("DH_DSS");
+- break;
+- case K_DHE_DSS:
+- components.add("DSA");
+- components.add("DSS");
+- components.add("DH");
+- components.add("DHE");
+- components.add("DiffieHellman");
+- components.add("DHE_DSS");
+- break;
+- case K_DHE_RSA:
+- components.add("RSA");
+- components.add("DH");
+- components.add("DHE");
+- components.add("DiffieHellman");
+- components.add("DHE_RSA");
+- break;
+- case K_DH_ANON:
+- if (!onlyX509) {
+- components.add("ANON");
+- components.add("DH");
+- components.add("DiffieHellman");
+- components.add("DH_ANON");
+- }
+- break;
+- case K_ECDH_ECDSA:
+- components.add("ECDH");
+- components.add("ECDSA");
+- components.add("ECDH_ECDSA");
+- break;
+- case K_ECDH_RSA:
+- components.add("ECDH");
+- components.add("RSA");
+- components.add("ECDH_RSA");
+- break;
+- case K_ECDHE_ECDSA:
+- components.add("ECDHE");
+- components.add("ECDSA");
+- components.add("ECDHE_ECDSA");
+- break;
+- case K_ECDHE_RSA:
+- components.add("ECDHE");
+- components.add("RSA");
+- components.add("ECDHE_RSA");
+- break;
+- case K_ECDH_ANON:
+- if (!onlyX509) {
+- components.add("ECDH");
+- components.add("ANON");
+- components.add("ECDH_ANON");
+- }
+- break;
+- case K_KRB5:
+- if (!onlyX509) {
+- components.add("KRB5");
+- }
+- break;
+- case K_KRB5_EXPORT:
+- if (!onlyX509) {
+- components.add("KRB5_EXPORT");
+- }
+- break;
+- default:
+- // ignore
+- }
+-
+- return components;
+- }
+-
+- private Set<String> decomposes(CipherSuite.BulkCipher bulkCipher) {
+- Set<String> components = new HashSet<>();
+-
+- if (bulkCipher.transformation != null) {
+- components.addAll(super.decompose(bulkCipher.transformation));
+- }
+-
+- if (bulkCipher == B_NULL) {
+- components.add("C_NULL");
+- } else if (bulkCipher == B_RC2_40) {
+- components.add("RC2_CBC_40");
+- } else if (bulkCipher == B_RC4_40) {
+- components.add("RC4_40");
+- } else if (bulkCipher == B_RC4_128) {
+- components.add("RC4_128");
+- } else if (bulkCipher == B_DES_40) {
+- components.add("DES40_CBC");
+- components.add("DES_CBC_40");
+- } else if (bulkCipher == B_DES) {
+- components.add("DES_CBC");
+- } else if (bulkCipher == B_3DES) {
+- components.add("3DES_EDE_CBC");
+- } else if (bulkCipher == B_AES_128) {
+- components.add("AES_128_CBC");
+- } else if (bulkCipher == B_AES_256) {
+- components.add("AES_256_CBC");
+- } else if (bulkCipher == B_AES_128_GCM) {
+- components.add("AES_128_GCM");
+- } else if (bulkCipher == B_AES_256_GCM) {
+- components.add("AES_256_GCM");
+- }
+-
+- return components;
+- }
+-
+- private Set<String> decomposes(CipherSuite.MacAlg macAlg,
+- BulkCipher cipher) {
+- Set<String> components = new HashSet<>();
+-
+- if (macAlg == M_NULL
+- && cipher.cipherType != CipherType.AEAD_CIPHER) {
+- components.add("M_NULL");
+- } else if (macAlg == M_MD5) {
+- components.add("MD5");
+- components.add("HmacMD5");
+- } else if (macAlg == M_SHA) {
+- components.add("SHA1");
+- components.add("SHA-1");
+- components.add("HmacSHA1");
+- } else if (macAlg == M_SHA256) {
+- components.add("SHA256");
+- components.add("SHA-256");
+- components.add("HmacSHA256");
+- } else if (macAlg == M_SHA384) {
+- components.add("SHA384");
+- components.add("SHA-384");
+- components.add("HmacSHA384");
+- }
+-
+- return components;
+- }
+-
+- private Set<String> decompose(KeyExchange keyExchange, BulkCipher cipher,
+- MacAlg macAlg) {
+- Set<String> components = new HashSet<>();
+-
+- if (keyExchange != null) {
+- components.addAll(decomposes(keyExchange));
+- }
+-
+- if (onlyX509) {
+- // Certification path algorithm constraints do not apply
+- // to cipher and macAlg.
+- return components;
+- }
+-
+- if (cipher != null) {
+- components.addAll(decomposes(cipher));
+- }
+-
+- if (macAlg != null) {
+- components.addAll(decomposes(macAlg, cipher));
+- }
+-
+- return components;
+- }
+-
+- @Override
+- public Set<String> decompose(String algorithm) {
+- if (algorithm.startsWith("SSL_") || algorithm.startsWith("TLS_")) {
+- CipherSuite cipherSuite = null;
+- try {
+- cipherSuite = CipherSuite.valueOf(algorithm);
+- } catch (IllegalArgumentException iae) {
+- // ignore: unknown or unsupported ciphersuite
+- }
+-
+- if (cipherSuite != null) {
+- return decompose(cipherSuite.keyExchange, cipherSuite.cipher,
+- cipherSuite.macAlg);
+- }
+- }
+-
+- return super.decompose(algorithm);
+- }
+-
+-}
+--- ./jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -40,9 +40,6 @@
+ import javax.crypto.BadPaddingException;
+ import javax.net.ssl.*;
+
+-import sun.misc.JavaNetAccess;
+-import sun.misc.SharedSecrets;
+-
+ /**
+ * Implementation of an SSL socket. This is a normal connection type
+ * socket, implementing SSL over some lower level socket, such as TCP.
+@@ -392,15 +389,6 @@
+ */
+ private boolean preferLocalCipherSuites = false;
+
+- /*
+- * Is the local name service trustworthy?
+- *
+- * If the local name service is not trustworthy, reverse host name
+- * resolution should not be performed for endpoint identification.
+- */
+- static final boolean trustNameService =
+- Debug.getBooleanProperty("jdk.tls.trustNameService", false);
+-
+ //
+ // CONSTRUCTORS AND INITIALIZATION CODE
+ //
+@@ -2161,41 +2149,11 @@
+ synchronized String getHost() {
+ // Note that the host may be null or empty for localhost.
+ if (host == null || host.length() == 0) {
+- if (!trustNameService) {
+- // If the local name service is not trustworthy, reverse host
+- // name resolution should not be performed for endpoint
+- // identification. Use the application original specified
+- // hostname or IP address instead.
+- host = getOriginalHostname(getInetAddress());
+- } else {
+- host = getInetAddress().getHostName();
+- }
++ host = getInetAddress().getHostName();
+ }
+-
+ return host;
+ }
+
+- /*
+- * Get the original application specified hostname.
+- */
+- private static String getOriginalHostname(InetAddress inetAddress) {
+- /*
+- * Get the original hostname via sun.misc.SharedSecrets.
+- */
+- JavaNetAccess jna = SharedSecrets.getJavaNetAccess();
+- String originalHostname = jna.getOriginalHostName(inetAddress);
+-
+- /*
+- * If no application specified hostname, use the IP address.
+- */
+- if (originalHostname == null || originalHostname.length() == 0) {
+- originalHostname = inetAddress.getHostAddress();
+- }
+-
+- return originalHostname;
+- }
+-
+-
+ // ONLY used by HttpsClient to setup the URI specified hostname
+ //
+ // Please NOTE that this method MUST be called before calling to
+--- ./jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1996, 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
+@@ -32,7 +32,6 @@
+ import java.security.cert.*;
+ import java.security.interfaces.*;
+ import java.security.spec.ECParameterSpec;
+-import java.math.BigInteger;
+
+ import javax.crypto.SecretKey;
+ import javax.crypto.spec.SecretKeySpec;
+@@ -42,7 +41,6 @@
+ import javax.security.auth.Subject;
+
+ import sun.security.util.KeyUtil;
+-import sun.security.util.LegacyAlgorithmConstraints;
+ import sun.security.action.GetPropertyAction;
+ import sun.security.ssl.HandshakeMessage.*;
+ import sun.security.ssl.CipherSuite.*;
+@@ -108,12 +106,6 @@
+ // The customized ephemeral DH key size for non-exportable cipher suites.
+ private static final int customizedDHKeySize;
+
+- // legacy algorithm constraints
+- private static final AlgorithmConstraints legacyAlgorithmConstraints =
+- new LegacyAlgorithmConstraints(
+- LegacyAlgorithmConstraints.PROPERTY_TLS_LEGACY_ALGS,
+- new SSLAlgorithmDecomposer());
+-
+ static {
+ String property = AccessController.doPrivileged(
+ new GetPropertyAction("jdk.tls.ephemeralDHKeySize"));
+@@ -414,7 +406,7 @@
+ }
+
+ // verify the client_verify_data value
+- if (!MessageDigest.isEqual(clientVerifyData,
++ if (!Arrays.equals(clientVerifyData,
+ clientHelloRI.getRenegotiatedConnection())) {
+ fatalSE(Alerts.alert_handshake_failure,
+ "Incorrect verify data in ClientHello " +
+@@ -1003,7 +995,6 @@
+ proposed = getActiveCipherSuites();
+ }
+
+- List<CipherSuite> legacySuites = new ArrayList<>();
+ for (CipherSuite suite : prefered.collection()) {
+ if (isNegotiable(proposed, suite) == false) {
+ continue;
+@@ -1015,24 +1006,11 @@
+ continue;
+ }
+ }
+-
+- if (!legacyAlgorithmConstraints.permits(null, suite.name, null)) {
+- legacySuites.add(suite);
+- continue;
+- }
+-
+ if (trySetCipherSuite(suite) == false) {
+ continue;
+ }
+ return;
+ }
+-
+- for (CipherSuite suite : legacySuites) {
+- if (trySetCipherSuite(suite)) {
+- return;
+- }
+- }
+-
+ fatalSE(Alerts.alert_handshake_failure, "no cipher suites in common");
+ }
+
+@@ -1565,13 +1543,7 @@
+ if (debug != null && Debug.isOn("handshake")) {
+ mesg.print(System.out);
+ }
+-
+- BigInteger publicKeyValue = mesg.getClientPublicKey();
+-
+- // check algorithm constraints
+- dh.checkConstraints(algorithmConstraints, publicKeyValue);
+-
+- return dh.getAgreedSecret(publicKeyValue, false);
++ return dh.getAgreedSecret(mesg.getClientPublicKey(), false);
+ }
+
+ private SecretKey clientKeyExchange(ECDHClientKeyExchange mesg)
+@@ -1580,13 +1552,7 @@
+ if (debug != null && Debug.isOn("handshake")) {
+ mesg.print(System.out);
+ }
+-
+- byte[] publicPoint = mesg.getEncodedPoint();
+-
+- // check algorithm constraints
+- ecdh.checkConstraints(algorithmConstraints, publicPoint);
+-
+- return ecdh.getAgreedSecret(publicPoint);
++ return ecdh.getAgreedSecret(mesg.getEncodedPoint());
+ }
+
+ /*
+--- ./jdk/src/share/classes/sun/security/ssl/SessionId.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/ssl/SessionId.java Wed Jul 01 21:53:30 2015 -0700
+@@ -27,6 +27,7 @@
+ package sun.security.ssl;
+
+ import java.security.SecureRandom;
++import javax.net.ssl.SSLProtocolException;
+
+ /**
+ * Encapsulates an SSL session ID. SSL Session IDs are not reused by
+@@ -41,6 +42,7 @@
+ final
+ class SessionId
+ {
++ static int MAX_LENGTH = 32;
+ private byte sessionId []; // max 32 bytes
+
+ /** Constructs a new session ID ... perhaps for a rejoinable session */
+@@ -114,4 +116,19 @@
+ }
+ return true;
+ }
++
++ /**
++ * Checks the length of the session ID to make sure it sits within
++ * the range called out in the specification
++ */
++ void checkLength(ProtocolVersion pv) throws SSLProtocolException {
++ // As of today all versions of TLS have a 32-byte maximum length.
++ // In the future we can do more here to support protocol versions
++ // that may have longer max lengths.
++ if (sessionId.length > MAX_LENGTH) {
++ throw new SSLProtocolException("Invalid session ID length (" +
++ sessionId.length + " bytes)");
++ }
++ }
++
+ }
+--- ./jdk/src/share/classes/sun/security/tools/keytool/Main.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/tools/keytool/Main.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1494,7 +1494,7 @@
+ boolean useDefaultPBEAlgorithm = true;
+ SecretKey secKey = null;
+
+- if (keyAlgName.toUpperCase().startsWith("PBE")) {
++ if (keyAlgName.toUpperCase(Locale.ENGLISH).startsWith("PBE")) {
+ SecretKeyFactory factory = SecretKeyFactory.getInstance("PBE");
+
+ // User is prompted for PBE credential
+--- ./jdk/src/share/classes/sun/security/tools/policytool/Resources_sv.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/tools/policytool/Resources_sv.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -101,7 +101,7 @@
+ {"Principals", "Identitetshavare"},
+ {".Edit.Principal.", " Redigera identitetshavare:"},
+ {".Add.New.Principal.", " L\u00E4gg till ny identitetshavare:"},
+- {"Permissions", "Beh\u00F6righet"},
++ {"Permissions", "Beh\u00F6righeter"},
+ {".Edit.Permission.", " Redigera beh\u00F6righet:"},
+ {".Add.New.Permission.", " L\u00E4gg till ny beh\u00F6righet:"},
+ {"Signed.By.", "Signerad av:"},
+--- ./jdk/src/share/classes/sun/security/util/AbstractAlgorithmConstraints.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,119 +0,0 @@
+-/*
+- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation. Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-package sun.security.util;
+-
+-import java.security.AccessController;
+-import java.security.AlgorithmConstraints;
+-import java.security.PrivilegedAction;
+-import java.security.Security;
+-import java.util.Map;
+-import java.util.Set;
+-
+-/**
+- * The class contains common functionality for algorithm constraints classes.
+- */
+-public abstract class AbstractAlgorithmConstraints
+- implements AlgorithmConstraints {
+-
+- protected final AlgorithmDecomposer decomposer;
+-
+- protected AbstractAlgorithmConstraints(AlgorithmDecomposer decomposer) {
+- this.decomposer = decomposer;
+- }
+-
+- // Get algorithm constraints from the specified security property.
+- private static void loadAlgorithmsMap(Map<String, String[]> algorithmsMap,
+- String propertyName) {
+- String property = AccessController.doPrivileged(
+- (PrivilegedAction<String>) () -> Security.getProperty(
+- propertyName));
+-
+- String[] algorithmsInProperty = null;
+- if (property != null && !property.isEmpty()) {
+- // remove double quote marks from beginning/end of the property
+- if (property.charAt(0) == '"'
+- && property.charAt(property.length() - 1) == '"') {
+- property = property.substring(1, property.length() - 1);
+- }
+- algorithmsInProperty = property.split(",");
+- for (int i = 0; i < algorithmsInProperty.length;
+- i++) {
+- algorithmsInProperty[i] = algorithmsInProperty[i].trim();
+- }
+- }
+-
+- // map the disabled algorithms
+- if (algorithmsInProperty == null) {
+- algorithmsInProperty = new String[0];
+- }
+- algorithmsMap.put(propertyName, algorithmsInProperty);
+- }
+-
+- static String[] getAlgorithms(Map<String, String[]> algorithmsMap,
+- String propertyName) {
+- synchronized (algorithmsMap) {
+- if (!algorithmsMap.containsKey(propertyName)) {
+- loadAlgorithmsMap(algorithmsMap, propertyName);
+- }
+-
+- return algorithmsMap.get(propertyName);
+- }
+- }
+-
+- static boolean checkAlgorithm(String[] algorithms, String algorithm,
+- AlgorithmDecomposer decomposer) {
+- if (algorithm == null || algorithm.length() == 0) {
+- throw new IllegalArgumentException("No algorithm name specified");
+- }
+-
+- Set<String> elements = null;
+- for (String item : algorithms) {
+- if (item == null || item.isEmpty()) {
+- continue;
+- }
+-
+- // check the full name
+- if (item.equalsIgnoreCase(algorithm)) {
+- return false;
+- }
+-
+- // decompose the algorithm into sub-elements
+- if (elements == null) {
+- elements = decomposer.decompose(algorithm);
+- }
+-
+- // check the items of the algorithm
+- for (String element : elements) {
+- if (item.equalsIgnoreCase(element)) {
+- return false;
+- }
+- }
+- }
+-
+- return true;
+- }
+-
+-}
+--- ./jdk/src/share/classes/sun/security/util/AlgorithmDecomposer.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,130 +0,0 @@
+-/*
+- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation. Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-package sun.security.util;
+-
+-import java.util.HashSet;
+-import java.util.Set;
+-import java.util.regex.Pattern;
+-
+-/**
+- * The class decomposes standard algorithms into sub-elements.
+- */
+-public class AlgorithmDecomposer {
+-
+- private static final Pattern transPattern = Pattern.compile("/");
+- private static final Pattern pattern =
+- Pattern.compile("with|and", Pattern.CASE_INSENSITIVE);
+-
+- /**
+- * Decompose the standard algorithm name into sub-elements.
+- * <p>
+- * For example, we need to decompose "SHA1WithRSA" into "SHA1" and "RSA"
+- * so that we can check the "SHA1" and "RSA" algorithm constraints
+- * separately.
+- * <p>
+- * Please override the method if need to support more name pattern.
+- */
+- public Set<String> decompose(String algorithm) {
+- if (algorithm == null || algorithm.length() == 0) {
+- return new HashSet<>();
+- }
+-
+- // algorithm/mode/padding
+- String[] transTockens = transPattern.split(algorithm);
+-
+- Set<String> elements = new HashSet<>();
+- for (String transTocken : transTockens) {
+- if (transTocken == null || transTocken.length() == 0) {
+- continue;
+- }
+-
+- // PBEWith<digest>And<encryption>
+- // PBEWith<prf>And<encryption>
+- // OAEPWith<digest>And<mgf>Padding
+- // <digest>with<encryption>
+- // <digest>with<encryption>and<mgf>
+- String[] tokens = pattern.split(transTocken);
+-
+- for (String token : tokens) {
+- if (token == null || token.length() == 0) {
+- continue;
+- }
+-
+- elements.add(token);
+- }
+- }
+-
+- // In Java standard algorithm name specification, for different
+- // purpose, the SHA-1 and SHA-2 algorithm names are different. For
+- // example, for MessageDigest, the standard name is "SHA-256", while
+- // for Signature, the digest algorithm component is "SHA256" for
+- // signature algorithm "SHA256withRSA". So we need to check both
+- // "SHA-256" and "SHA256" to make the right constraint checking.
+-
+- // handle special name: SHA-1 and SHA1
+- if (elements.contains("SHA1") && !elements.contains("SHA-1")) {
+- elements.add("SHA-1");
+- }
+- if (elements.contains("SHA-1") && !elements.contains("SHA1")) {
+- elements.add("SHA1");
+- }
+-
+- // handle special name: SHA-224 and SHA224
+- if (elements.contains("SHA224") && !elements.contains("SHA-224")) {
+- elements.add("SHA-224");
+- }
+- if (elements.contains("SHA-224") && !elements.contains("SHA224")) {
+- elements.add("SHA224");
+- }
+-
+- // handle special name: SHA-256 and SHA256
+- if (elements.contains("SHA256") && !elements.contains("SHA-256")) {
+- elements.add("SHA-256");
+- }
+- if (elements.contains("SHA-256") && !elements.contains("SHA256")) {
+- elements.add("SHA256");
+- }
+-
+- // handle special name: SHA-384 and SHA384
+- if (elements.contains("SHA384") && !elements.contains("SHA-384")) {
+- elements.add("SHA-384");
+- }
+- if (elements.contains("SHA-384") && !elements.contains("SHA384")) {
+- elements.add("SHA384");
+- }
+-
+- // handle special name: SHA-512 and SHA512
+- if (elements.contains("SHA512") && !elements.contains("SHA-512")) {
+- elements.add("SHA-512");
+- }
+- if (elements.contains("SHA-512") && !elements.contains("SHA512")) {
+- elements.add("SHA512");
+- }
+-
+- return elements;
+- }
+-
+-}
+--- ./jdk/src/share/classes/sun/security/util/AuthResources_sv.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/util/AuthResources_sv.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -117,7 +117,7 @@
+ {"only.Principal.based.grant.entries.permitted",
+ "endast identitetshavarbaserade poster till\u00E5ts"},
+ {"expected.permission.entry", "f\u00F6rv\u00E4ntade beh\u00F6righetspost"},
+- {"number.", "antal "},
++ {"number.", "nummer"},
+ {"expected.expect.read.end.of.file.",
+ "f\u00F6rv\u00E4ntade {0}, l\u00E4ste filslut"},
+ {"expected.read.end.of.file", "f\u00F6rv\u00E4ntade ';', l\u00E4ste filslut"},
+--- ./jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -25,9 +25,15 @@
+
+ package sun.security.util;
+
++import java.security.AlgorithmConstraints;
+ import java.security.CryptoPrimitive;
+ import java.security.AlgorithmParameters;
++
+ import java.security.Key;
++import java.security.Security;
++import java.security.PrivilegedAction;
++import java.security.AccessController;
++
+ import java.util.Locale;
+ import java.util.Set;
+ import java.util.Collections;
+@@ -43,7 +49,7 @@
+ * See the "jdk.certpath.disabledAlgorithms" specification in java.security
+ * for the syntax of the disabled algorithm string.
+ */
+-public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
++public class DisabledAlgorithmConstraints implements AlgorithmConstraints {
+
+ // the known security property, jdk.certpath.disabledAlgorithms
+ public final static String PROPERTY_CERTPATH_DISABLED_ALGS =
+@@ -58,8 +64,8 @@
+ private final static Map<String, KeySizeConstraints> keySizeConstraintsMap =
+ new HashMap<>();
+
+- private final String[] disabledAlgorithms;
+- private final KeySizeConstraints keySizeConstraints;
++ private String[] disabledAlgorithms;
++ private KeySizeConstraints keySizeConstraints;
+
+ /**
+ * Initialize algorithm constraints with the specified security property.
+@@ -68,27 +74,56 @@
+ * algorithm constraints
+ */
+ public DisabledAlgorithmConstraints(String propertyName) {
+- this(propertyName, new AlgorithmDecomposer());
+- }
++ // Both disabledAlgorithmsMap and keySizeConstraintsMap are
++ // synchronized with the lock of disabledAlgorithmsMap.
++ synchronized (disabledAlgorithmsMap) {
++ if(!disabledAlgorithmsMap.containsKey(propertyName)) {
++ loadDisabledAlgorithmsMap(propertyName);
++ }
+
+- public DisabledAlgorithmConstraints(String propertyName,
+- AlgorithmDecomposer decomposer) {
+- super(decomposer);
+- disabledAlgorithms = getAlgorithms(disabledAlgorithmsMap, propertyName);
+- keySizeConstraints = getKeySizeConstraints(disabledAlgorithms,
+- propertyName);
++ disabledAlgorithms = disabledAlgorithmsMap.get(propertyName);
++ keySizeConstraints = keySizeConstraintsMap.get(propertyName);
++ }
+ }
+
+ @Override
+ final public boolean permits(Set<CryptoPrimitive> primitives,
+ String algorithm, AlgorithmParameters parameters) {
+
++ if (algorithm == null || algorithm.length() == 0) {
++ throw new IllegalArgumentException("No algorithm name specified");
++ }
++
+ if (primitives == null || primitives.isEmpty()) {
+ throw new IllegalArgumentException(
+ "No cryptographic primitive specified");
+ }
+
+- return checkAlgorithm(disabledAlgorithms, algorithm, decomposer);
++ Set<String> elements = null;
++ for (String disabled : disabledAlgorithms) {
++ if (disabled == null || disabled.isEmpty()) {
++ continue;
++ }
++
++ // check the full name
++ if (disabled.equalsIgnoreCase(algorithm)) {
++ return false;
++ }
++
++ // decompose the algorithm into sub-elements
++ if (elements == null) {
++ elements = decomposes(algorithm);
++ }
++
++ // check the items of the algorithm
++ for (String element : elements) {
++ if (disabled.equalsIgnoreCase(element)) {
++ return false;
++ }
++ }
++ }
++
++ return true;
+ }
+
+ @Override
+@@ -107,6 +142,98 @@
+ return checkConstraints(primitives, algorithm, key, parameters);
+ }
+
++ /**
++ * Decompose the standard algorithm name into sub-elements.
++ * <p>
++ * For example, we need to decompose "SHA1WithRSA" into "SHA1" and "RSA"
++ * so that we can check the "SHA1" and "RSA" algorithm constraints
++ * separately.
++ * <p>
++ * Please override the method if need to support more name pattern.
++ */
++ protected Set<String> decomposes(String algorithm) {
++ if (algorithm == null || algorithm.length() == 0) {
++ return new HashSet<String>();
++ }
++
++ // algorithm/mode/padding
++ Pattern transPattern = Pattern.compile("/");
++ String[] transTockens = transPattern.split(algorithm);
++
++ Set<String> elements = new HashSet<String>();
++ for (String transTocken : transTockens) {
++ if (transTocken == null || transTocken.length() == 0) {
++ continue;
++ }
++
++ // PBEWith<digest>And<encryption>
++ // PBEWith<prf>And<encryption>
++ // OAEPWith<digest>And<mgf>Padding
++ // <digest>with<encryption>
++ // <digest>with<encryption>and<mgf>
++ Pattern pattern =
++ Pattern.compile("with|and", Pattern.CASE_INSENSITIVE);
++ String[] tokens = pattern.split(transTocken);
++
++ for (String token : tokens) {
++ if (token == null || token.length() == 0) {
++ continue;
++ }
++
++ elements.add(token);
++ }
++ }
++
++ // In Java standard algorithm name specification, for different
++ // purpose, the SHA-1 and SHA-2 algorithm names are different. For
++ // example, for MessageDigest, the standard name is "SHA-256", while
++ // for Signature, the digest algorithm component is "SHA256" for
++ // signature algorithm "SHA256withRSA". So we need to check both
++ // "SHA-256" and "SHA256" to make the right constraint checking.
++
++ // handle special name: SHA-1 and SHA1
++ if (elements.contains("SHA1") && !elements.contains("SHA-1")) {
++ elements.add("SHA-1");
++ }
++ if (elements.contains("SHA-1") && !elements.contains("SHA1")) {
++ elements.add("SHA1");
++ }
++
++ // handle special name: SHA-224 and SHA224
++ if (elements.contains("SHA224") && !elements.contains("SHA-224")) {
++ elements.add("SHA-224");
++ }
++ if (elements.contains("SHA-224") && !elements.contains("SHA224")) {
++ elements.add("SHA224");
++ }
++
++ // handle special name: SHA-256 and SHA256
++ if (elements.contains("SHA256") && !elements.contains("SHA-256")) {
++ elements.add("SHA-256");
++ }
++ if (elements.contains("SHA-256") && !elements.contains("SHA256")) {
++ elements.add("SHA256");
++ }
++
++ // handle special name: SHA-384 and SHA384
++ if (elements.contains("SHA384") && !elements.contains("SHA-384")) {
++ elements.add("SHA-384");
++ }
++ if (elements.contains("SHA-384") && !elements.contains("SHA384")) {
++ elements.add("SHA384");
++ }
++
++ // handle special name: SHA-512 and SHA512
++ if (elements.contains("SHA512") && !elements.contains("SHA-512")) {
++ elements.add("SHA-512");
++ }
++ if (elements.contains("SHA-512") && !elements.contains("SHA512")) {
++ elements.add("SHA512");
++ }
++
++ return elements;
++ }
++
+ // Check algorithm constraints
+ private boolean checkConstraints(Set<CryptoPrimitive> primitives,
+ String algorithm, Key key, AlgorithmParameters parameters) {
+@@ -136,18 +263,43 @@
+ return true;
+ }
+
+- private static KeySizeConstraints getKeySizeConstraints(
+- String[] disabledAlgorithms, String propertyName) {
+- synchronized (keySizeConstraintsMap) {
+- if(!keySizeConstraintsMap.containsKey(propertyName)) {
+- // map the key constraints
+- KeySizeConstraints keySizeConstraints =
+- new KeySizeConstraints(disabledAlgorithms);
+- keySizeConstraintsMap.put(propertyName, keySizeConstraints);
++ // Get disabled algorithm constraints from the specified security property.
++ private static void loadDisabledAlgorithmsMap(
++ final String propertyName) {
++
++ String property = AccessController.doPrivileged(
++ new PrivilegedAction<String>() {
++ public String run() {
++ return Security.getProperty(propertyName);
++ }
++ });
++
++ String[] algorithmsInProperty = null;
++
++ if (property != null && !property.isEmpty()) {
++
++ // remove double quote marks from beginning/end of the property
++ if (property.charAt(0) == '"' &&
++ property.charAt(property.length() - 1) == '"') {
++ property = property.substring(1, property.length() - 1);
+ }
+
+- return keySizeConstraintsMap.get(propertyName);
++ algorithmsInProperty = property.split(",");
++ for (int i = 0; i < algorithmsInProperty.length; i++) {
++ algorithmsInProperty[i] = algorithmsInProperty[i].trim();
++ }
+ }
++
++ // map the disabled algorithms
++ if (algorithmsInProperty == null) {
++ algorithmsInProperty = new String[0];
++ }
++ disabledAlgorithmsMap.put(propertyName, algorithmsInProperty);
++
++ // map the key constraints
++ KeySizeConstraints keySizeConstraints =
++ new KeySizeConstraints(algorithmsInProperty);
++ keySizeConstraintsMap.put(propertyName, keySizeConstraints);
+ }
+
+ /**
+--- ./jdk/src/share/classes/sun/security/util/ECUtil.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/util/ECUtil.java Wed Jul 01 21:53:30 2015 -0700
+@@ -89,47 +89,6 @@
+ return Arrays.copyOfRange(b, i, b.length);
+ }
+
+- private static KeyFactory getKeyFactory() {
+- try {
+- return KeyFactory.getInstance("EC", "SunEC");
+- } catch (NoSuchAlgorithmException | NoSuchProviderException e) {
+- throw new RuntimeException(e);
+- }
+- }
+-
+- public static ECPublicKey decodeX509ECPublicKey(byte[] encoded)
+- throws InvalidKeySpecException {
+- KeyFactory keyFactory = getKeyFactory();
+- X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encoded);
+-
+- return (ECPublicKey)keyFactory.generatePublic(keySpec);
+- }
+-
+- public static byte[] x509EncodeECPublicKey(ECPoint w,
+- ECParameterSpec params) throws InvalidKeySpecException {
+- KeyFactory keyFactory = getKeyFactory();
+- ECPublicKeySpec keySpec = new ECPublicKeySpec(w, params);
+- X509Key key = (X509Key)keyFactory.generatePublic(keySpec);
+-
+- return key.getEncoded();
+- }
+-
+- public static ECPrivateKey decodePKCS8ECPrivateKey(byte[] encoded)
+- throws InvalidKeySpecException {
+- KeyFactory keyFactory = getKeyFactory();
+- PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded);
+-
+- return (ECPrivateKey)keyFactory.generatePrivate(keySpec);
+- }
+-
+- public static ECPrivateKey generateECPrivateKey(BigInteger s,
+- ECParameterSpec params) throws InvalidKeySpecException {
+- KeyFactory keyFactory = getKeyFactory();
+- ECPrivateKeySpec keySpec = new ECPrivateKeySpec(s, params);
+-
+- return (ECPrivateKey)keyFactory.generatePrivate(keySpec);
+- }
+-
+ private static AlgorithmParameters getECParameters(Provider p) {
+ try {
+ if (p != null) {
+--- ./jdk/src/share/classes/sun/security/util/LegacyAlgorithmConstraints.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,73 +0,0 @@
+-/*
+- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation. Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-package sun.security.util;
+-
+-import java.security.AlgorithmParameters;
+-import java.security.CryptoPrimitive;
+-import java.security.Key;
+-import java.util.HashMap;
+-import java.util.Map;
+-import java.util.Set;
+-import static sun.security.util.AbstractAlgorithmConstraints.getAlgorithms;
+-
+-/**
+- * Algorithm constraints for legacy algorithms.
+- */
+-public class LegacyAlgorithmConstraints extends AbstractAlgorithmConstraints {
+-
+- // the known security property, jdk.tls.legacyAlgorithms
+- public final static String PROPERTY_TLS_LEGACY_ALGS =
+- "jdk.tls.legacyAlgorithms";
+-
+- private final static Map<String, String[]> legacyAlgorithmsMap =
+- new HashMap<>();
+-
+- private final String[] legacyAlgorithms;
+-
+- public LegacyAlgorithmConstraints(String propertyName,
+- AlgorithmDecomposer decomposer) {
+- super(decomposer);
+- legacyAlgorithms = getAlgorithms(legacyAlgorithmsMap, propertyName);
+- }
+-
+- @Override
+- final public boolean permits(Set<CryptoPrimitive> primitives,
+- String algorithm, AlgorithmParameters parameters) {
+- return checkAlgorithm(legacyAlgorithms, algorithm, decomposer);
+- }
+-
+- @Override
+- final public boolean permits(Set<CryptoPrimitive> primitives, Key key) {
+- return true;
+- }
+-
+- @Override
+- final public boolean permits(Set<CryptoPrimitive> primitives,
+- String algorithm, Key key, AlgorithmParameters parameters) {
+- return checkAlgorithm(legacyAlgorithms, algorithm, decomposer);
+- }
+-
+-}
+--- ./jdk/src/share/classes/sun/security/util/Resources_sv.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/util/Resources_sv.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2000, 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
+@@ -135,7 +135,7 @@
+ {"expected.codeBase.or.SignedBy.or.Principal",
+ "f\u00F6rv\u00E4ntad codeBase eller SignedBy eller identitetshavare"},
+ {"expected.permission.entry", "f\u00F6rv\u00E4ntade beh\u00F6righetspost"},
+- {"number.", "antal "},
++ {"number.", "nummer"},
+ {"expected.expect.read.end.of.file.",
+ "f\u00F6rv\u00E4ntade [{0}], l\u00E4ste [filslut]"},
+ {"expected.read.end.of.file.",
+--- ./jdk/src/share/classes/sun/security/validator/SimpleValidator.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/security/validator/SimpleValidator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -141,18 +141,8 @@
+ // create distrusted certificates checker
+ UntrustedChecker untrustedChecker = new UntrustedChecker();
+
+- // check if anchor is untrusted
+- X509Certificate anchorCert = chain[chain.length - 1];
+- try {
+- untrustedChecker.check(anchorCert);
+- } catch (CertPathValidatorException cpve) {
+- throw new ValidatorException(
+- "Untrusted certificate: "+ anchorCert.getSubjectX500Principal(),
+- ValidatorException.T_UNTRUSTED_CERT, anchorCert, cpve);
+- }
+-
+ // create default algorithm constraints checker
+- TrustAnchor anchor = new TrustAnchor(anchorCert, null);
++ TrustAnchor anchor = new TrustAnchor(chain[chain.length - 1], null);
+ AlgorithmChecker defaultAlgChecker = new AlgorithmChecker(anchor);
+
+ // create application level algorithm constraints checker
+--- ./jdk/src/share/classes/sun/swing/SwingUtilities2.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/swing/SwingUtilities2.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -33,6 +33,7 @@
+ import java.awt.font.*;
+ import java.awt.geom.*;
+ import java.awt.print.PrinterGraphics;
++import java.text.BreakIterator;
+ import java.text.CharacterIterator;
+ import java.text.AttributedCharacterIterator;
+ import java.text.AttributedString;
+@@ -464,16 +465,15 @@
+ }
+ }
+ if (needsTextLayout) {
+- FontRenderContext frc = getFontRenderContext(c, fm);
+ AttributedString aString = new AttributedString(string);
+ if (c != null) {
+ aString.addAttribute(TextAttribute.NUMERIC_SHAPING,
+ c.getClientProperty(TextAttribute.NUMERIC_SHAPING));
+ }
+- LineBreakMeasurer measurer =
+- new LineBreakMeasurer(aString.getIterator(), frc);
+- int nChars = measurer.nextOffset(availTextWidth);
+- string = string.substring(0, nChars);
++ LineBreakMeasurer measurer = new LineBreakMeasurer(
++ aString.getIterator(), BreakIterator.getCharacterInstance(),
++ getFontRenderContext(c, fm));
++ string = string.substring(0, measurer.nextOffset(availTextWidth));
+
+ }
+ return string + clipString;
+--- ./jdk/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java Wed Jul 01 21:53:30 2015 -0700
+@@ -28,7 +28,6 @@
+ import java.awt.*;
+ import java.util.*;
+ import javax.swing.*;
+-import javax.swing.border.Border;
+ import javax.swing.plaf.*;
+
+ /**
+@@ -44,7 +43,8 @@
+ * @author Scott Violet
+ */
+ public class DefaultSynthStyle extends SynthStyle implements Cloneable {
+- private static final String PENDING = "Pending";
++
++ private static final Object PENDING = new Object();
+
+ /**
+ * Should the component be opaque?
+--- ./jdk/src/share/classes/sun/text/resources/de/FormatData_de.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/text/resources/de/FormatData_de.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -142,7 +142,7 @@
+ new String[] {
+ "Jan", // abb january
+ "Feb", // abb february
+- "Mrz", // abb march
++ "M\u00e4r", // abb march
+ "Apr", // abb april
+ "Mai", // abb may
+ "Jun", // abb june
+--- ./jdk/src/share/classes/sun/text/resources/en/FormatData_en_SG.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/text/resources/en/FormatData_en_SG.java Wed Jul 01 21:53:30 2015 -0700
+@@ -88,6 +88,14 @@
+ "NaN",
+ }
+ },
++ { "DatePatterns",
++ new String[] {
++ "EEEE, d MMMM, yyyy", // full date pattern
++ "d MMMM, yyyy", // long date pattern
++ "d MMM, yyyy", // medium date pattern
++ "d/M/yy", // short date pattern
++ }
++ },
+ };
+ }
+ }
+--- ./jdk/src/share/classes/sun/text/resources/fi/FormatData_fi.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/text/resources/fi/FormatData_fi.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -295,8 +295,8 @@
+ },
+ { "DatePatterns",
+ new String[] {
+- "d. MMMM'ta 'yyyy", // full date pattern
+- "d. MMMM'ta 'yyyy", // long date pattern
++ "d. MMMM yyyy", // full date pattern
++ "d. MMMM yyyy", // long date pattern
+ "d.M.yyyy", // medium date pattern
+ "d.M.yyyy", // short date pattern
+ }
+--- ./jdk/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -30,6 +30,7 @@
+ import java.security.PrivilegedAction;
+ import java.text.spi.BreakIteratorProvider;
+ import java.text.spi.CollatorProvider;
++import java.util.Collections;
+ import java.util.HashSet;
+ import java.util.Locale;
+ import java.util.ResourceBundle;
+@@ -103,6 +104,9 @@
+ protected Set<String> createLanguageTagSet(String category) {
+ ResourceBundle rb = ResourceBundle.getBundle("sun.util.cldr.CLDRLocaleDataMetaInfo", Locale.ROOT);
+ String supportedLocaleString = rb.getString(category);
++ if (supportedLocaleString == null) {
++ return Collections.emptySet();
++ }
+ Set<String> tagset = new HashSet<>();
+ StringTokenizer tokens = new StringTokenizer(supportedLocaleString);
+ while (tokens.hasMoreTokens()) {
+--- ./jdk/src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -34,6 +34,7 @@
+ import java.text.spi.DateFormatSymbolsProvider;
+ import java.text.spi.DecimalFormatSymbolsProvider;
+ import java.text.spi.NumberFormatProvider;
++import java.util.Collections;
+ import java.util.HashSet;
+ import java.util.Locale;
+ import java.util.Set;
+@@ -356,6 +357,9 @@
+
+ protected Set<String> createLanguageTagSet(String category) {
+ String supportedLocaleString = LocaleDataMetaInfo.getSupportedLocaleString(category);
++ if (supportedLocaleString == null) {
++ return Collections.emptySet();
++ }
+ Set<String> tagset = new HashSet<>();
+ StringTokenizer tokens = new StringTokenizer(supportedLocaleString);
+ while (tokens.hasMoreTokens()) {
+--- ./jdk/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -57,6 +57,12 @@
+ resourceNameToLocales.put("CollationData",
+ " #CollationData_ENLocales# | #CollationData_NonENLocales# ");
+
++ resourceNameToLocales.put("BreakIteratorInfo",
++ " #BreakIteratorInfo_ENLocales# | #BreakIteratorInfo_NonENLocales# ");
++
++ resourceNameToLocales.put("BreakIteratorRules",
++ " #BreakIteratorRules_ENLocales# | #BreakIteratorRules_NonENLocales# ");
++
+ resourceNameToLocales.put("TimeZoneNames",
+ " #TimeZoneNames_ENLocales# | #TimeZoneNames_NonENLocales# ");
+
+--- ./jdk/src/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -295,7 +295,7 @@
+ * A utility method for implementing the default LocaleServiceProvider.isSupportedLocale
+ * for the JRE, CLDR, and FALLBACK adapters.
+ */
+- static boolean isSupportedLocale(Locale locale, LocaleProviderAdapter.Type type, Set<String> langtags) {
++ public static boolean isSupportedLocale(Locale locale, LocaleProviderAdapter.Type type, Set<String> langtags) {
+ assert type == Type.JRE || type == Type.CLDR || type == Type.FALLBACK;
+ if (Locale.ROOT.equals(locale)) {
+ return true;
+--- ./jdk/src/share/classes/sun/util/locale/provider/LocaleResources.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/locale/provider/LocaleResources.java Wed Jul 01 21:53:30 2015 -0700
+@@ -47,6 +47,7 @@
+ import java.util.LinkedHashSet;
+ import java.util.Locale;
+ import java.util.Map;
++import java.util.Objects;
+ import java.util.ResourceBundle;
+ import java.util.Set;
+ import java.util.concurrent.ConcurrentHashMap;
+@@ -250,17 +251,17 @@
+ return (String) localeName;
+ }
+
+- String[] getTimeZoneNames(String key, int size) {
++ String[] getTimeZoneNames(String key) {
+ String[] names = null;
+- String cacheKey = TIME_ZONE_NAMES + size + '.' + key;
++ String cacheKey = TIME_ZONE_NAMES + '.' + key;
+
+ removeEmptyReferences();
+ ResourceReference data = cache.get(cacheKey);
+
+- if (data == null || ((names = (String[]) data.get()) == null)) {
++ if (Objects.isNull(data) || Objects.isNull((names = (String[]) data.get()))) {
+ TimeZoneNamesBundle tznb = localeData.getTimeZoneNames(locale);
+ if (tznb.containsKey(key)) {
+- names = tznb.getStringArray(key, size);
++ names = tznb.getStringArray(key);
+ cache.put(cacheKey,
+ new ResourceReference(cacheKey, (Object) names, referenceQueue));
+ }
+--- ./jdk/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -26,6 +26,7 @@
+ package sun.util.locale.provider;
+
+ import java.util.Locale;
++import java.util.Objects;
+ import java.util.Set;
+ import java.util.TimeZone;
+ import java.util.spi.TimeZoneNameProvider;
+@@ -95,8 +96,9 @@
+ */
+ @Override
+ public String getDisplayName(String id, boolean daylight, int style, Locale locale) {
+- String[] names = getDisplayNameArray(id, 5, locale);
+- if (names != null) {
++ String[] names = getDisplayNameArray(id, locale);
++ if (Objects.nonNull(names)) {
++ assert names.length >= 7;
+ int index = daylight ? 3 : 1;
+ if (style == TimeZone.SHORT) {
+ index++;
+@@ -108,18 +110,18 @@
+
+ @Override
+ public String getGenericDisplayName(String id, int style, Locale locale) {
+- String[] names = getDisplayNameArray(id, 7, locale);
+- if (names != null && names.length >= 7) {
++ String[] names = getDisplayNameArray(id, locale);
++ if (Objects.nonNull(names)) {
++ assert names.length >= 7;
+ return names[(style == TimeZone.LONG) ? 5 : 6];
+ }
+ return null;
+ }
+
+- private String[] getDisplayNameArray(String id, int n, Locale locale) {
+- if (id == null || locale == null) {
+- throw new NullPointerException();
+- }
+- return LocaleProviderAdapter.forType(type).getLocaleResources(locale).getTimeZoneNames(id, n);
++ private String[] getDisplayNameArray(String id, Locale locale) {
++ Objects.requireNonNull(id);
++ Objects.requireNonNull(locale);
++ return LocaleProviderAdapter.forType(type).getLocaleResources(locale).getTimeZoneNames(id);
+ }
+
+ /**
+--- ./jdk/src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java Wed Jul 01 21:53:30 2015 -0700
+@@ -30,6 +30,7 @@
+ import java.util.List;
+ import java.util.Locale;
+ import java.util.Map;
++import java.util.Objects;
+ import java.util.Set;
+ import java.util.concurrent.ConcurrentHashMap;
+ import java.util.spi.TimeZoneNameProvider;
+@@ -100,9 +101,9 @@
+ * Retrieve display names for a time zone ID.
+ */
+ public static String[] retrieveDisplayNames(String id, Locale locale) {
+- if (id == null || locale == null) {
+- throw new NullPointerException();
+- }
++ Objects.requireNonNull(id);
++ Objects.requireNonNull(locale);
++
+ return retrieveDisplayNamesImpl(id, locale);
+ }
+
+@@ -115,9 +116,12 @@
+ * @return the requested generic time zone display name, or null if not found.
+ */
+ public static String retrieveGenericDisplayName(String id, int style, Locale locale) {
+- LocaleServiceProviderPool pool =
+- LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
+- return pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale, "generic", style, id);
++ String[] names = retrieveDisplayNamesImpl(id, locale);
++ if (Objects.nonNull(names)) {
++ return names[6 - style];
++ } else {
++ return null;
++ }
+ }
+
+ /**
+@@ -130,140 +134,53 @@
+ * @return the requested time zone name, or null if not found.
+ */
+ public static String retrieveDisplayName(String id, boolean daylight, int style, Locale locale) {
+- LocaleServiceProviderPool pool =
+- LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
+- return pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale, daylight ? "dst" : "std", style, id);
++ String[] names = retrieveDisplayNamesImpl(id, locale);
++ if (Objects.nonNull(names)) {
++ return names[(daylight ? 4 : 2) - style];
++ } else {
++ return null;
++ }
+ }
+
+ private static String[] retrieveDisplayNamesImpl(String id, Locale locale) {
+ LocaleServiceProviderPool pool =
+ LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
++ String[] names;
++ Map<Locale, String[]> perLocale = null;
+
+ SoftReference<Map<Locale, String[]>> ref = cachedDisplayNames.get(id);
+- if (ref != null) {
+- Map<Locale, String[]> perLocale = ref.get();
+- if (perLocale != null) {
+- String[] names = perLocale.get(locale);
+- if (names != null) {
++ if (Objects.nonNull(ref)) {
++ perLocale = ref.get();
++ if (Objects.nonNull(perLocale)) {
++ names = perLocale.get(locale);
++ if (Objects.nonNull(names)) {
+ return names;
+ }
+- names = pool.getLocalizedObject(TimeZoneNameArrayGetter.INSTANCE, locale, id);
+- if (names != null) {
+- perLocale.put(locale, names);
+- }
+- return names;
+ }
+ }
+
+- String[] names = pool.getLocalizedObject(TimeZoneNameArrayGetter.INSTANCE, locale, id);
+- if (names != null) {
+- Map<Locale, String[]> perLocale = new ConcurrentHashMap<>();
+- perLocale.put(locale, names);
+- ref = new SoftReference<>(perLocale);
+- cachedDisplayNames.put(id, ref);
++ // build names array
++ names = new String[7];
++ names[0] = id;
++ for (int i = 1; i <= 6; i ++) {
++ names[i] = pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale,
++ i<5 ? (i<3 ? "std" : "dst") : "generic", i%2, id);
+ }
++
++ if (Objects.isNull(perLocale)) {
++ perLocale = new ConcurrentHashMap<>();
++ }
++ perLocale.put(locale, names);
++ ref = new SoftReference<>(perLocale);
++ cachedDisplayNames.put(id, ref);
+ return names;
+ }
+
++
+ /**
+ * Obtains a localized time zone strings from a TimeZoneNameProvider
+ * implementation.
+ */
+- private static class TimeZoneNameArrayGetter
+- implements LocaleServiceProviderPool.LocalizedObjectGetter<TimeZoneNameProvider,
+- String[]>{
+- private static final TimeZoneNameArrayGetter INSTANCE =
+- new TimeZoneNameArrayGetter();
+-
+- @Override
+- public String[] getObject(TimeZoneNameProvider timeZoneNameProvider,
+- Locale locale,
+- String requestID,
+- Object... params) {
+- assert params.length == 0;
+-
+- // First, try to get names with the request ID
+- String[] names = buildZoneStrings(timeZoneNameProvider, locale, requestID);
+-
+- if (names == null) {
+- Map<String, String> aliases = ZoneInfo.getAliasTable();
+-
+- if (aliases != null) {
+- // Check whether this id is an alias, if so,
+- // look for the standard id.
+- String canonicalID = aliases.get(requestID);
+- if (canonicalID != null) {
+- names = buildZoneStrings(timeZoneNameProvider, locale, canonicalID);
+- }
+- if (names == null) {
+- // There may be a case that a standard id has become an
+- // alias. so, check the aliases backward.
+- names = examineAliases(timeZoneNameProvider, locale,
+- canonicalID == null ? requestID : canonicalID, aliases);
+- }
+- }
+- }
+-
+- if (names != null) {
+- names[0] = requestID;
+- }
+-
+- return names;
+- }
+-
+- private static String[] examineAliases(TimeZoneNameProvider tznp, Locale locale,
+- String id,
+- Map<String, String> aliases) {
+- if (aliases.containsValue(id)) {
+- for (Map.Entry<String, String> entry : aliases.entrySet()) {
+- if (entry.getValue().equals(id)) {
+- String alias = entry.getKey();
+- String[] names = buildZoneStrings(tznp, locale, alias);
+- if (names != null) {
+- return names;
+- }
+- names = examineAliases(tznp, locale, alias, aliases);
+- if (names != null) {
+- return names;
+- }
+- }
+- }
+- }
+-
+- return null;
+- }
+-
+- private static String[] buildZoneStrings(TimeZoneNameProvider tznp,
+- Locale locale, String id) {
+- String[] names = new String[5];
+-
+- for (int i = 1; i <= 4; i ++) {
+- names[i] = tznp.getDisplayName(id, i>=3, i%2, locale);
+-
+- if (names[i] == null) {
+- switch (i) {
+- case 1:
+- // this id seems not localized by this provider
+- return null;
+- case 2:
+- case 4:
+- // If the display name for SHORT is not supplied,
+- // copy the LONG name.
+- names[i] = names[i-1];
+- break;
+- case 3:
+- // If the display name for DST is not supplied,
+- // copy the "standard" name.
+- names[3] = names[1];
+- break;
+- }
+- }
+- }
+-
+- return names;
+- }
+- }
+-
+ private static class TimeZoneNameGetter
+ implements LocaleServiceProviderPool.LocalizedObjectGetter<TimeZoneNameProvider,
+ String> {
+@@ -299,18 +216,16 @@
+ private static String examineAliases(TimeZoneNameProvider tznp, Locale locale,
+ String requestID, String tzid, int style,
+ Map<String, String> aliases) {
+- if (aliases.containsValue(tzid)) {
+- for (Map.Entry<String, String> entry : aliases.entrySet()) {
+- if (entry.getValue().equals(tzid)) {
+- String alias = entry.getKey();
+- String name = getName(tznp, locale, requestID, style, alias);
+- if (name != null) {
+- return name;
+- }
+- name = examineAliases(tznp, locale, requestID, alias, style, aliases);
+- if (name != null) {
+- return name;
+- }
++ for (Map.Entry<String, String> entry : aliases.entrySet()) {
++ if (entry.getValue().equals(tzid)) {
++ String alias = entry.getKey();
++ String name = getName(tznp, locale, requestID, style, alias);
++ if (name != null) {
++ return name;
++ }
++ name = examineAliases(tznp, locale, requestID, alias, style, aliases);
++ if (name != null) {
++ return name;
+ }
+ }
+ }
+--- ./jdk/src/share/classes/sun/util/resources/LocaleData.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/resources/LocaleData.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -48,8 +48,11 @@
+ import java.util.Locale;
+ import java.util.MissingResourceException;
+ import java.util.ResourceBundle;
++import java.util.Set;
++import sun.util.locale.provider.JRELocaleProviderAdapter;
+ import sun.util.locale.provider.LocaleDataMetaInfo;
+ import sun.util.locale.provider.LocaleProviderAdapter;
++import static sun.util.locale.provider.LocaleProviderAdapter.Type.CLDR;
+ import static sun.util.locale.provider.LocaleProviderAdapter.Type.JRE;
+
+ /**
+@@ -204,35 +207,23 @@
+ @Override
+ public List<Locale> getCandidateLocales(String baseName, Locale locale) {
+ List<Locale> candidates = super.getCandidateLocales(baseName, locale);
+- /* Get the locale string list from LocaleDataMetaInfo class. */
+- String localeString = LocaleDataMetaInfo.getSupportedLocaleString(baseName);
+-
+- if (localeString != null && localeString.length() != 0) {
+- for (Iterator<Locale> l = candidates.iterator(); l.hasNext();) {
+- Locale loc = l.next();
+- String lstr;
+- if (loc.getScript().length() > 0) {
+- lstr = loc.toLanguageTag().replace('-', '_');
+- } else {
+- lstr = loc.toString();
+- int idx = lstr.indexOf("_#");
+- if (idx >= 0) {
+- lstr = lstr.substring(0, idx);
+- }
+- }
+- /* Every locale string in the locale string list returned from
+- the above getSupportedLocaleString is enclosed
+- within two white spaces so that we could check some locale
+- such as "en".
+- */
+- if (lstr.length() != 0 && localeString.indexOf(" " + lstr + " ") == -1) {
+- l.remove();
++ // Weed out Locales which are known to have no resource bundles
++ int lastDot = baseName.lastIndexOf('.');
++ String category = (lastDot >= 0) ? baseName.substring(lastDot + 1) : baseName;
++ LocaleProviderAdapter.Type type = baseName.contains(DOTCLDR) ? CLDR : JRE;
++ LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type);
++ Set<String> langtags = ((JRELocaleProviderAdapter)adapter).getLanguageTagSet(category);
++ if (!langtags.isEmpty()) {
++ for (Iterator<Locale> itr = candidates.iterator(); itr.hasNext();) {
++ if (!LocaleProviderAdapter.isSupportedLocale(itr.next(), type, langtags)) {
++ itr.remove();
+ }
+ }
+ }
++
+ // Force fallback to Locale.ENGLISH for CLDR time zone names support
+ if (locale.getLanguage() != "en"
+- && baseName.contains(CLDR) && baseName.endsWith("TimeZoneNames")) {
++ && type == CLDR && category.equals("TimeZoneNames")) {
+ candidates.add(candidates.size() - 1, Locale.ENGLISH);
+ }
+ return candidates;
+@@ -254,7 +245,7 @@
+ return null;
+ }
+
+- private static final String CLDR = ".cldr";
++ private static final String DOTCLDR = ".cldr";
+
+ /**
+ * Changes baseName to its per-language package name and
+@@ -275,8 +266,8 @@
+ assert JRE.getUtilResourcesPackage().length()
+ == JRE.getTextResourcesPackage().length();
+ int index = JRE.getUtilResourcesPackage().length();
+- if (baseName.indexOf(CLDR, index) > 0) {
+- index += CLDR.length();
++ if (baseName.indexOf(DOTCLDR, index) > 0) {
++ index += DOTCLDR.length();
+ }
+ newBaseName = baseName.substring(0, index + 1) + lang
+ + baseName.substring(index);
+--- ./jdk/src/share/classes/sun/util/resources/TimeZoneNamesBundle.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/resources/TimeZoneNamesBundle.java Wed Jul 01 21:53:30 2015 -0700
+@@ -44,6 +44,7 @@
+ import java.util.LinkedHashMap;
+ import java.util.LinkedHashSet;
+ import java.util.MissingResourceException;
++import java.util.Objects;
+ import java.util.Set;
+
+ /**
+@@ -61,26 +62,6 @@
+ public abstract class TimeZoneNamesBundle extends OpenListResourceBundle {
+
+ /**
+- * Returns a String array containing time zone names. The String array has
+- * at most size elements.
+- *
+- * @param key the time zone ID for which names are obtained
+- * @param size the requested size of array for names
+- * @return a String array containing names
+- */
+- public String[] getStringArray(String key, int size) {
+- String[] names = handleGetObject(key, size);
+- if ((names == null || names.length != size) && parent != null) {
+- names = ((TimeZoneNamesBundle)parent).getStringArray(key, size);
+- }
+- if (names == null) {
+- throw new MissingResourceException("no time zone names", getClass().getName(), key);
+- }
+- return names;
+-
+- }
+-
+- /**
+ * Maps time zone IDs to locale-specific names.
+ * The value returned is an array of five strings:
+ * <ul>
+@@ -89,6 +70,8 @@
+ * <li>The short name of the time zone in standard time (localized).
+ * <li>The long name of the time zone in daylight savings time (localized).
+ * <li>The short name of the time zone in daylight savings time (localized).
++ * <li>The long name of the time zone in generic form (localized).
++ * <li>The short name of the time zone in generic form (localized).
+ * </ul>
+ * The localized names come from the subclasses's
+ * <code>getContents</code> implementations, while the time zone
+@@ -96,16 +79,12 @@
+ */
+ @Override
+ public Object handleGetObject(String key) {
+- return handleGetObject(key, 5);
+- }
+-
+- private String[] handleGetObject(String key, int n) {
+ String[] contents = (String[]) super.handleGetObject(key);
+- if (contents == null) {
++ if (Objects.isNull(contents)) {
+ return null;
+ }
+- int clen = Math.min(n - 1, contents.length);
+- String[] tmpobj = new String[clen+1];
++ int clen = contents.length;
++ String[] tmpobj = new String[7];
+ tmpobj[0] = key;
+ System.arraycopy(contents, 0, tmpobj, 1, clen);
+ return tmpobj;
+--- ./jdk/src/share/classes/sun/util/resources/en/TimeZoneNames_en_IE.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/classes/sun/util/resources/en/TimeZoneNames_en_IE.java Wed Jul 01 21:53:30 2015 -0700
+@@ -47,7 +47,8 @@
+ protected final Object[][] getContents() {
+ return new Object[][] {
+ {"Europe/London", new String[] {"Greenwich Mean Time", "GMT",
+- "Irish Summer Time", "IST" /*Dublin*/}},
++ "Irish Summer Time", "IST", /*Dublin*/
++ "Irish Time", "IT" /*Dublin*/}},
+ };
+ }
+ }
+--- ./jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Wed Jul 01 21:53:30 2015 -0700
+@@ -2252,6 +2252,8 @@
+ }
+ break;
+ case EXTID_NTFS:
++ if (sz < 32)
++ break;
+ pos += 4; // reserved 4 bytes
+ if (SH(extra, pos) != 0x0001)
+ break;
+--- ./jdk/src/share/lib/security/java.security-aix Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/lib/security/java.security-aix Wed Jul 01 21:53:30 2015 -0700
+@@ -171,6 +171,15 @@
+ keystore.type=jks
+
+ #
++# Controls compatibility mode for the JKS keystore type.
++#
++# When set to 'true', the JKS keystore type supports loading
++# keystore files in either JKS or PKCS12 format. When set to 'false'
++# it supports loading only JKS keystore files.
++#
++keystore.type.compat=true
++
++#
+ # List of comma-separated packages that start with or equal this string
+ # will cause a security exception to be thrown when
+ # passed to checkPackageAccess unless the
+@@ -500,61 +509,4 @@
+ #
+ # Example:
+ # jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
+-jdk.tls.disabledAlgorithms=SSLv3, DH keySize < 768
+-
+-# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
+-# processing in JSSE implementation.
+-#
+-# In some environments, a certain algorithm may be undesirable but it
+-# cannot be disabled because of its use in legacy applications. Legacy
+-# algorithms may still be supported, but applications should not use them
+-# as the security strength of legacy algorithms are usually not strong enough
+-# in practice.
+-#
+-# During SSL/TLS security parameters negotiation, legacy algorithms will
+-# not be negotiated unless there are no other candidates.
+-#
+-# The syntax of the disabled algorithm string is described as this Java
+-# BNF-style:
+-# LegacyAlgorithms:
+-# " LegacyAlgorithm { , LegacyAlgorithm } "
+-#
+-# LegacyAlgorithm:
+-# AlgorithmName (standard JSSE algorithm name)
+-#
+-# See the specification of security property "jdk.certpath.disabledAlgorithms"
+-# for the syntax and description of the "AlgorithmName" notation.
+-#
+-# Per SSL/TLS specifications, cipher suites have the form:
+-# SSL_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-# or
+-# TLS_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-#
+-# For example, the cipher suite TLS_RSA_WITH_AES_128_CBC_SHA uses RSA as the
+-# key exchange algorithm, AES_128_CBC (128 bits AES cipher algorithm in CBC
+-# mode) as the cipher (encryption) algorithm, and SHA-1 as the message digest
+-# algorithm for HMAC.
+-#
+-# The LegacyAlgorithm can be one of the following standard algorithm names:
+-# 1. JSSE cipher suite name, e.g., TLS_RSA_WITH_AES_128_CBC_SHA
+-# 2. JSSE key exchange algorithm name, e.g., RSA
+-# 3. JSSE cipher (encryption) algorithm name, e.g., AES_128_CBC
+-# 4. JSSE message digest algorithm name, e.g., SHA
+-#
+-# See SSL/TLS specifications and "Java Cryptography Architecture Standard
+-# Algorithm Name Documentation" for information about the algorithm names.
+-#
+-# Note: This property is currently used by Oracle's JSSE implementation.
+-# It is not guaranteed to be examined and used by other implementations.
+-# There is no guarantee the property will continue to exist or be of the
+-# same syntax in future releases.
+-#
+-# Example:
+-# jdk.tls.legacyAlgorithms=DH_anon, DES_CBC, SSL_RSA_WITH_RC4_128_MD5
+-#
+-jdk.tls.legacyAlgorithms= \
+- K_NULL, C_NULL, M_NULL, \
+- DHE_DSS_EXPORT, DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, \
+- DH_RSA_EXPORT, RSA_EXPORT, \
+- DH_anon, ECDH_anon, \
+- RC4_128, RC4_40, DES_CBC, DES40_CBC
++jdk.tls.disabledAlgorithms=SSLv3, RC4
+--- ./jdk/src/share/lib/security/java.security-linux Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/lib/security/java.security-linux Wed Jul 01 21:53:30 2015 -0700
+@@ -171,6 +171,15 @@
+ keystore.type=jks
+
+ #
++# Controls compatibility mode for the JKS keystore type.
++#
++# When set to 'true', the JKS keystore type supports loading
++# keystore files in either JKS or PKCS12 format. When set to 'false'
++# it supports loading only JKS keystore files.
++#
++keystore.type.compat=true
++
++#
+ # List of comma-separated packages that start with or equal this string
+ # will cause a security exception to be thrown when
+ # passed to checkPackageAccess unless the
+@@ -500,61 +509,4 @@
+ #
+ # Example:
+ # jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
+-jdk.tls.disabledAlgorithms=SSLv3, DH keySize < 768
+-
+-# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
+-# processing in JSSE implementation.
+-#
+-# In some environments, a certain algorithm may be undesirable but it
+-# cannot be disabled because of its use in legacy applications. Legacy
+-# algorithms may still be supported, but applications should not use them
+-# as the security strength of legacy algorithms are usually not strong enough
+-# in practice.
+-#
+-# During SSL/TLS security parameters negotiation, legacy algorithms will
+-# not be negotiated unless there are no other candidates.
+-#
+-# The syntax of the disabled algorithm string is described as this Java
+-# BNF-style:
+-# LegacyAlgorithms:
+-# " LegacyAlgorithm { , LegacyAlgorithm } "
+-#
+-# LegacyAlgorithm:
+-# AlgorithmName (standard JSSE algorithm name)
+-#
+-# See the specification of security property "jdk.certpath.disabledAlgorithms"
+-# for the syntax and description of the "AlgorithmName" notation.
+-#
+-# Per SSL/TLS specifications, cipher suites have the form:
+-# SSL_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-# or
+-# TLS_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-#
+-# For example, the cipher suite TLS_RSA_WITH_AES_128_CBC_SHA uses RSA as the
+-# key exchange algorithm, AES_128_CBC (128 bits AES cipher algorithm in CBC
+-# mode) as the cipher (encryption) algorithm, and SHA-1 as the message digest
+-# algorithm for HMAC.
+-#
+-# The LegacyAlgorithm can be one of the following standard algorithm names:
+-# 1. JSSE cipher suite name, e.g., TLS_RSA_WITH_AES_128_CBC_SHA
+-# 2. JSSE key exchange algorithm name, e.g., RSA
+-# 3. JSSE cipher (encryption) algorithm name, e.g., AES_128_CBC
+-# 4. JSSE message digest algorithm name, e.g., SHA
+-#
+-# See SSL/TLS specifications and "Java Cryptography Architecture Standard
+-# Algorithm Name Documentation" for information about the algorithm names.
+-#
+-# Note: This property is currently used by Oracle's JSSE implementation.
+-# It is not guaranteed to be examined and used by other implementations.
+-# There is no guarantee the property will continue to exist or be of the
+-# same syntax in future releases.
+-#
+-# Example:
+-# jdk.tls.legacyAlgorithms=DH_anon, DES_CBC, SSL_RSA_WITH_RC4_128_MD5
+-#
+-jdk.tls.legacyAlgorithms= \
+- K_NULL, C_NULL, M_NULL, \
+- DHE_DSS_EXPORT, DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, \
+- DH_RSA_EXPORT, RSA_EXPORT, \
+- DH_anon, ECDH_anon, \
+- RC4_128, RC4_40, DES_CBC, DES40_CBC
++jdk.tls.disabledAlgorithms=SSLv3, RC4
+--- ./jdk/src/share/lib/security/java.security-macosx Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/lib/security/java.security-macosx Wed Jul 01 21:53:30 2015 -0700
+@@ -172,6 +172,15 @@
+ keystore.type=jks
+
+ #
++# Controls compatibility mode for the JKS keystore type.
++#
++# When set to 'true', the JKS keystore type supports loading
++# keystore files in either JKS or PKCS12 format. When set to 'false'
++# it supports loading only JKS keystore files.
++#
++keystore.type.compat=true
++
++#
+ # List of comma-separated packages that start with or equal this string
+ # will cause a security exception to be thrown when
+ # passed to checkPackageAccess unless the
+@@ -503,61 +512,4 @@
+ #
+ # Example:
+ # jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
+-jdk.tls.disabledAlgorithms=SSLv3, DH keySize < 768
+-
+-# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
+-# processing in JSSE implementation.
+-#
+-# In some environments, a certain algorithm may be undesirable but it
+-# cannot be disabled because of its use in legacy applications. Legacy
+-# algorithms may still be supported, but applications should not use them
+-# as the security strength of legacy algorithms are usually not strong enough
+-# in practice.
+-#
+-# During SSL/TLS security parameters negotiation, legacy algorithms will
+-# not be negotiated unless there are no other candidates.
+-#
+-# The syntax of the disabled algorithm string is described as this Java
+-# BNF-style:
+-# LegacyAlgorithms:
+-# " LegacyAlgorithm { , LegacyAlgorithm } "
+-#
+-# LegacyAlgorithm:
+-# AlgorithmName (standard JSSE algorithm name)
+-#
+-# See the specification of security property "jdk.certpath.disabledAlgorithms"
+-# for the syntax and description of the "AlgorithmName" notation.
+-#
+-# Per SSL/TLS specifications, cipher suites have the form:
+-# SSL_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-# or
+-# TLS_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-#
+-# For example, the cipher suite TLS_RSA_WITH_AES_128_CBC_SHA uses RSA as the
+-# key exchange algorithm, AES_128_CBC (128 bits AES cipher algorithm in CBC
+-# mode) as the cipher (encryption) algorithm, and SHA-1 as the message digest
+-# algorithm for HMAC.
+-#
+-# The LegacyAlgorithm can be one of the following standard algorithm names:
+-# 1. JSSE cipher suite name, e.g., TLS_RSA_WITH_AES_128_CBC_SHA
+-# 2. JSSE key exchange algorithm name, e.g., RSA
+-# 3. JSSE cipher (encryption) algorithm name, e.g., AES_128_CBC
+-# 4. JSSE message digest algorithm name, e.g., SHA
+-#
+-# See SSL/TLS specifications and "Java Cryptography Architecture Standard
+-# Algorithm Name Documentation" for information about the algorithm names.
+-#
+-# Note: This property is currently used by Oracle's JSSE implementation.
+-# It is not guaranteed to be examined and used by other implementations.
+-# There is no guarantee the property will continue to exist or be of the
+-# same syntax in future releases.
+-#
+-# Example:
+-# jdk.tls.legacyAlgorithms=DH_anon, DES_CBC, SSL_RSA_WITH_RC4_128_MD5
+-#
+-jdk.tls.legacyAlgorithms= \
+- K_NULL, C_NULL, M_NULL, \
+- DHE_DSS_EXPORT, DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, \
+- DH_RSA_EXPORT, RSA_EXPORT, \
+- DH_anon, ECDH_anon, \
+- RC4_128, RC4_40, DES_CBC, DES40_CBC
++jdk.tls.disabledAlgorithms=SSLv3, RC4
+--- ./jdk/src/share/lib/security/java.security-solaris Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/lib/security/java.security-solaris Wed Jul 01 21:53:30 2015 -0700
+@@ -173,6 +173,15 @@
+ keystore.type=jks
+
+ #
++# Controls compatibility mode for the JKS keystore type.
++#
++# When set to 'true', the JKS keystore type supports loading
++# keystore files in either JKS or PKCS12 format. When set to 'false'
++# it supports loading only JKS keystore files.
++#
++keystore.type.compat=true
++
++#
+ # List of comma-separated packages that start with or equal this string
+ # will cause a security exception to be thrown when
+ # passed to checkPackageAccess unless the
+@@ -502,61 +511,4 @@
+ #
+ # Example:
+ # jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
+-jdk.tls.disabledAlgorithms=SSLv3, DH keySize < 768
+-
+-# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
+-# processing in JSSE implementation.
+-#
+-# In some environments, a certain algorithm may be undesirable but it
+-# cannot be disabled because of its use in legacy applications. Legacy
+-# algorithms may still be supported, but applications should not use them
+-# as the security strength of legacy algorithms are usually not strong enough
+-# in practice.
+-#
+-# During SSL/TLS security parameters negotiation, legacy algorithms will
+-# not be negotiated unless there are no other candidates.
+-#
+-# The syntax of the disabled algorithm string is described as this Java
+-# BNF-style:
+-# LegacyAlgorithms:
+-# " LegacyAlgorithm { , LegacyAlgorithm } "
+-#
+-# LegacyAlgorithm:
+-# AlgorithmName (standard JSSE algorithm name)
+-#
+-# See the specification of security property "jdk.certpath.disabledAlgorithms"
+-# for the syntax and description of the "AlgorithmName" notation.
+-#
+-# Per SSL/TLS specifications, cipher suites have the form:
+-# SSL_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-# or
+-# TLS_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-#
+-# For example, the cipher suite TLS_RSA_WITH_AES_128_CBC_SHA uses RSA as the
+-# key exchange algorithm, AES_128_CBC (128 bits AES cipher algorithm in CBC
+-# mode) as the cipher (encryption) algorithm, and SHA-1 as the message digest
+-# algorithm for HMAC.
+-#
+-# The LegacyAlgorithm can be one of the following standard algorithm names:
+-# 1. JSSE cipher suite name, e.g., TLS_RSA_WITH_AES_128_CBC_SHA
+-# 2. JSSE key exchange algorithm name, e.g., RSA
+-# 3. JSSE cipher (encryption) algorithm name, e.g., AES_128_CBC
+-# 4. JSSE message digest algorithm name, e.g., SHA
+-#
+-# See SSL/TLS specifications and "Java Cryptography Architecture Standard
+-# Algorithm Name Documentation" for information about the algorithm names.
+-#
+-# Note: This property is currently used by Oracle's JSSE implementation.
+-# It is not guaranteed to be examined and used by other implementations.
+-# There is no guarantee the property will continue to exist or be of the
+-# same syntax in future releases.
+-#
+-# Example:
+-# jdk.tls.legacyAlgorithms=DH_anon, DES_CBC, SSL_RSA_WITH_RC4_128_MD5
+-#
+-jdk.tls.legacyAlgorithms= \
+- K_NULL, C_NULL, M_NULL, \
+- DHE_DSS_EXPORT, DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, \
+- DH_RSA_EXPORT, RSA_EXPORT, \
+- DH_anon, ECDH_anon, \
+- RC4_128, RC4_40, DES_CBC, DES40_CBC
++jdk.tls.disabledAlgorithms=SSLv3, RC4
+--- ./jdk/src/share/lib/security/java.security-windows Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/lib/security/java.security-windows Wed Jul 01 21:53:30 2015 -0700
+@@ -172,6 +172,15 @@
+ keystore.type=jks
+
+ #
++# Controls compatibility mode for the JKS keystore type.
++#
++# When set to 'true', the JKS keystore type supports loading
++# keystore files in either JKS or PKCS12 format. When set to 'false'
++# it supports loading only JKS keystore files.
++#
++keystore.type.compat=true
++
++#
+ # List of comma-separated packages that start with or equal this string
+ # will cause a security exception to be thrown when
+ # passed to checkPackageAccess unless the
+@@ -503,61 +512,4 @@
+ #
+ # Example:
+ # jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
+-jdk.tls.disabledAlgorithms=SSLv3, DH keySize < 768
+-
+-# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
+-# processing in JSSE implementation.
+-#
+-# In some environments, a certain algorithm may be undesirable but it
+-# cannot be disabled because of its use in legacy applications. Legacy
+-# algorithms may still be supported, but applications should not use them
+-# as the security strength of legacy algorithms are usually not strong enough
+-# in practice.
+-#
+-# During SSL/TLS security parameters negotiation, legacy algorithms will
+-# not be negotiated unless there are no other candidates.
+-#
+-# The syntax of the disabled algorithm string is described as this Java
+-# BNF-style:
+-# LegacyAlgorithms:
+-# " LegacyAlgorithm { , LegacyAlgorithm } "
+-#
+-# LegacyAlgorithm:
+-# AlgorithmName (standard JSSE algorithm name)
+-#
+-# See the specification of security property "jdk.certpath.disabledAlgorithms"
+-# for the syntax and description of the "AlgorithmName" notation.
+-#
+-# Per SSL/TLS specifications, cipher suites have the form:
+-# SSL_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-# or
+-# TLS_KeyExchangeAlg_WITH_CipherAlg_MacAlg
+-#
+-# For example, the cipher suite TLS_RSA_WITH_AES_128_CBC_SHA uses RSA as the
+-# key exchange algorithm, AES_128_CBC (128 bits AES cipher algorithm in CBC
+-# mode) as the cipher (encryption) algorithm, and SHA-1 as the message digest
+-# algorithm for HMAC.
+-#
+-# The LegacyAlgorithm can be one of the following standard algorithm names:
+-# 1. JSSE cipher suite name, e.g., TLS_RSA_WITH_AES_128_CBC_SHA
+-# 2. JSSE key exchange algorithm name, e.g., RSA
+-# 3. JSSE cipher (encryption) algorithm name, e.g., AES_128_CBC
+-# 4. JSSE message digest algorithm name, e.g., SHA
+-#
+-# See SSL/TLS specifications and "Java Cryptography Architecture Standard
+-# Algorithm Name Documentation" for information about the algorithm names.
+-#
+-# Note: This property is currently used by Oracle's JSSE implementation.
+-# It is not guaranteed to be examined and used by other implementations.
+-# There is no guarantee the property will continue to exist or be of the
+-# same syntax in future releases.
+-#
+-# Example:
+-# jdk.tls.legacyAlgorithms=DH_anon, DES_CBC, SSL_RSA_WITH_RC4_128_MD5
+-#
+-jdk.tls.legacyAlgorithms= \
+- K_NULL, C_NULL, M_NULL, \
+- DHE_DSS_EXPORT, DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, \
+- DH_RSA_EXPORT, RSA_EXPORT, \
+- DH_anon, ECDH_anon, \
+- RC4_128, RC4_40, DES_CBC, DES40_CBC
++jdk.tls.disabledAlgorithms=SSLv3, RC4
+--- ./jdk/src/share/native/java/lang/ClassLoader.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/java/lang/ClassLoader.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2014, 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
+@@ -493,12 +493,12 @@
+ return res;
+ }
+ /*
+- * Class: java_lang_ClassLoader_NativeLibrary
++ * Class: java_lang_ClassLoader
+ * Method: findBuiltinLib
+ * Signature: (Ljava/lang/String;)Ljava/lang/String;
+ */
+ JNIEXPORT jstring JNICALL
+-Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib
++Java_java_lang_ClassLoader_findBuiltinLib
+ (JNIEnv *env, jclass cls, jstring name)
+ {
+ const char *cname;
+@@ -514,8 +514,6 @@
+ JNU_ThrowInternalError(env, "NULL filename for native library");
+ return NULL;
+ }
+- // Can't call initIDs because it will recurse into NativeLibrary via
+- // FindClass to check context so set prochandle here as well.
+ procHandle = getProcessHandle();
+ cname = JNU_GetStringPlatformChars(env, name, 0);
+ if (cname == NULL) {
+--- ./jdk/src/share/native/java/net/net_util.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/java/net/net_util.h Wed Jul 01 21:53:30 2015 -0700
+@@ -182,9 +182,13 @@
+ JNIEXPORT int JNICALL
+ NET_MapSocketOptionV6(jint cmd, int *level, int *optname);
+
++JNIEXPORT jint JNICALL
++NET_EnableFastTcpLoopback(int fd);
++
+ int getScopeID (struct sockaddr *);
+
+ int cmpScopeID (unsigned int, struct sockaddr *);
+
+ unsigned short in_cksum(unsigned short *addr, int len);
++
+ #endif /* NET_UTILS_H */
+--- ./jdk/src/share/native/java/util/zip/Deflater.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/java/util/zip/Deflater.c Wed Jul 01 21:53:30 2015 -0700
+@@ -68,10 +68,11 @@
+ JNU_ThrowOutOfMemoryError(env, 0);
+ return jlong_zero;
+ } else {
+- char *msg;
+- switch (deflateInit2(strm, level, Z_DEFLATED,
+- nowrap ? -MAX_WBITS : MAX_WBITS,
+- DEF_MEM_LEVEL, strategy)) {
++ const char *msg;
++ int ret = deflateInit2(strm, level, Z_DEFLATED,
++ nowrap ? -MAX_WBITS : MAX_WBITS,
++ DEF_MEM_LEVEL, strategy);
++ switch (ret) {
+ case Z_OK:
+ return ptr_to_jlong(strm);
+ case Z_MEM_ERROR:
+@@ -83,7 +84,11 @@
+ JNU_ThrowIllegalArgumentException(env, 0);
+ return jlong_zero;
+ default:
+- msg = strm->msg;
++ msg = ((strm->msg != NULL) ? strm->msg :
++ (ret == Z_VERSION_ERROR) ?
++ "zlib returned Z_VERSION_ERROR: "
++ "compile time and runtime zlib implementations differ" :
++ "unknown error initializing zlib library");
+ free(strm);
+ JNU_ThrowInternalError(env, msg);
+ return jlong_zero;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/native/sun/awt/giflib/COPYING Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,19 @@
++The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
++
++Permission is hereby granted, free of charge, to any person obtaining a copy
++of this software and associated documentation files (the "Software"), to deal
++in the Software without restriction, including without limitation the rights
++to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++copies of the Software, and to permit persons to whom the Software is
++furnished to do so, subject to the following conditions:
++
++The above copyright notice and this permission notice shall be included in
++all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++THE SOFTWARE.
+--- ./jdk/src/share/native/sun/awt/giflib/dgif_lib.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/awt/giflib/dgif_lib.c Wed Jul 01 21:53:30 2015 -0700
+@@ -23,219 +23,211 @@
+ */
+
+ /******************************************************************************
+- * "Gif-Lib" - Yet another gif library.
+- *
+- * Written by: Gershon Elber IBM PC Ver 1.1, Aug. 1990
+- ******************************************************************************
+- * The kernel of the GIF Decoding process can be found here.
+- ******************************************************************************
+- * History:
+- * 16 Jun 89 - Version 1.0 by Gershon Elber.
+- * 3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names).
+- *****************************************************************************/
+
+-/* !!!! */
++dgif_lib.c - GIF decoding
+
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#endif
++The functions here and in egif_lib.c are partitioned carefully so that
++if you only require one of read and write capability, only one of these
++two modules will be linked. Preserve this property!
++
++*****************************************************************************/
+
+ #include <stdlib.h>
+-#if defined (__MSDOS__) && !defined(__DJGPP__) && !defined(__GNUC__)
+-#include <io.h>
+-#include <alloc.h>
+-#include <sys\stat.h>
+-#else
+-#include <sys/types.h>
+-#include <sys/stat.h>
+-#endif /* __MSDOS__ */
++#include <limits.h>
++#include <stdint.h>
++#include <fcntl.h>
++#include <stdio.h>
++#include <string.h>
+
+ #ifdef _WIN32
+ #include <io.h>
+-#define _OPEN_BINARY
+ #else
+ #include <unistd.h>
+-#endif
++#endif /* _WIN32 */
+
+-#include <fcntl.h>
+-
+-#include <stdio.h>
+-#include <string.h>
+ #include "gif_lib.h"
+ #include "gif_lib_private.h"
+
+-#define COMMENT_EXT_FUNC_CODE 0xfe /* Extension function code for
+- comment. */
++/* compose unsigned little endian value */
++#define UNSIGNED_LITTLE_ENDIAN(lo, hi) ((lo) | ((hi) << 8))
+
+ /* avoid extra function call in case we use fread (TVT) */
+ #define READ(_gif,_buf,_len) \
+ (((GifFilePrivateType*)_gif->Private)->Read ? \
+- (size_t)((GifFilePrivateType*)_gif->Private)->Read(_gif,_buf,_len) : \
++ ((GifFilePrivateType*)_gif->Private)->Read(_gif,_buf,_len) : \
+ fread(_buf,1,_len,((GifFilePrivateType*)_gif->Private)->File))
+
+-static int DGifGetWord(GifFileType *GifFile, int *Word);
++static int DGifGetWord(GifFileType *GifFile, GifWord *Word);
+ static int DGifSetupDecompress(GifFileType *GifFile);
+ static int DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line,
+ int LineLen);
+-static int DGifGetPrefixChar(unsigned int *Prefix, int Code, int ClearCode);
++static int DGifGetPrefixChar(GifPrefixType *Prefix, int Code, int ClearCode);
+ static int DGifDecompressInput(GifFileType *GifFile, int *Code);
+ static int DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf,
+ GifByteType *NextByte);
+
+ /******************************************************************************
+- * Open a new gif file for read, given by its name.
+- * Returns GifFileType pointer dynamically allocated which serves as the gif
+- * info record. _GifError is cleared if succesfull.
+- *****************************************************************************/
++ Open a new GIF file for read, given by its name.
++ Returns dynamically allocated GifFileType pointer which serves as the GIF
++ info record.
++******************************************************************************/
+ GifFileType *
+-DGifOpenFileName(const char *FileName) {
++DGifOpenFileName(const char *FileName, int *Error)
++{
+ int FileHandle;
+ GifFileType *GifFile;
+
+- if ((FileHandle = open(FileName, O_RDONLY
+-#if defined(__MSDOS__) || defined(_OPEN_BINARY)
+- | O_BINARY
+-#endif /* __MSDOS__ || _OPEN_BINARY */
+- )) == -1) {
+- _GifError = D_GIF_ERR_OPEN_FAILED;
++ if ((FileHandle = open(FileName, O_RDONLY)) == -1) {
++ if (Error != NULL)
++ *Error = D_GIF_ERR_OPEN_FAILED;
+ return NULL;
+ }
+
+- GifFile = DGifOpenFileHandle(FileHandle);
+- if (GifFile == (GifFileType *)NULL)
+- close(FileHandle);
++ GifFile = DGifOpenFileHandle(FileHandle, Error);
+ return GifFile;
+ }
+
+ /******************************************************************************
+- * Update a new gif file, given its file handle.
+- * Returns GifFileType pointer dynamically allocated which serves as the gif
+- * info record. _GifError is cleared if succesfull.
+- *****************************************************************************/
++ Update a new GIF file, given its file handle.
++ Returns dynamically allocated GifFileType pointer which serves as the GIF
++ info record.
++******************************************************************************/
+ GifFileType *
+-DGifOpenFileHandle(int FileHandle) {
+-
+- unsigned char Buf[GIF_STAMP_LEN + 1];
++DGifOpenFileHandle(int FileHandle, int *Error)
++{
++ char Buf[GIF_STAMP_LEN + 1];
+ GifFileType *GifFile;
+ GifFilePrivateType *Private;
+ FILE *f;
+
+ GifFile = (GifFileType *)malloc(sizeof(GifFileType));
+ if (GifFile == NULL) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ if (Error != NULL)
++ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
++ (void)close(FileHandle);
+ return NULL;
+ }
+
+- memset(GifFile, '\0', sizeof(GifFileType));
++ /*@i1@*/memset(GifFile, '\0', sizeof(GifFileType));
++
++ /* Belt and suspenders, in case the null pointer isn't zero */
++ GifFile->SavedImages = NULL;
++ GifFile->SColorMap = NULL;
+
+ Private = (GifFilePrivateType *)malloc(sizeof(GifFilePrivateType));
+ if (Private == NULL) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ if (Error != NULL)
++ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
++ (void)close(FileHandle);
+ free((char *)GifFile);
+ return NULL;
+ }
+-#ifdef __MSDOS__
+- setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
+-#endif /* __MSDOS__ */
++#ifdef _WIN32
++ _setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
++#endif /* _WIN32 */
+
+ f = fdopen(FileHandle, "rb"); /* Make it into a stream: */
+
+-#ifdef __MSDOS__
+- setvbuf(f, NULL, _IOFBF, GIF_FILE_BUFFER_SIZE); /* And inc. stream
+- buffer. */
+-#endif /* __MSDOS__ */
+-
+- GifFile->Private = (VoidPtr)Private;
++ /*@-mustfreeonly@*/
++ GifFile->Private = (void *)Private;
+ Private->FileHandle = FileHandle;
+ Private->File = f;
+ Private->FileState = FILE_STATE_READ;
+- Private->Read = 0; /* don't use alternate input method (TVT) */
+- GifFile->UserData = 0; /* TVT */
++ Private->Read = NULL; /* don't use alternate input method (TVT) */
++ GifFile->UserData = NULL; /* TVT */
++ /*@=mustfreeonly@*/
+
+- /* Lets see if this is a GIF file: */
+- if (READ(GifFile, Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
+- _GifError = D_GIF_ERR_READ_FAILED;
+- fclose(f);
++ /* Let's see if this is a GIF file: */
++ /* coverity[check_return] */
++ if (READ(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
++ if (Error != NULL)
++ *Error = D_GIF_ERR_READ_FAILED;
++ (void)fclose(f);
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+- /* The GIF Version number is ignored at this time. Maybe we should do
+- * something more useful with it. */
++ /* Check for GIF prefix at start of file */
+ Buf[GIF_STAMP_LEN] = 0;
+- if (strncmp(GIF_STAMP, (const char*)Buf, GIF_VERSION_POS) != 0) {
+- _GifError = D_GIF_ERR_NOT_GIF_FILE;
+- fclose(f);
++ if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) {
++ if (Error != NULL)
++ *Error = D_GIF_ERR_NOT_GIF_FILE;
++ (void)fclose(f);
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+ if (DGifGetScreenDesc(GifFile) == GIF_ERROR) {
+- fclose(f);
++ (void)fclose(f);
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+- _GifError = 0;
++ GifFile->Error = 0;
++
++ /* What version of GIF? */
++ Private->gif89 = (Buf[GIF_VERSION_POS] == '9');
+
+ return GifFile;
+ }
+
+ /******************************************************************************
+- * GifFileType constructor with user supplied input function (TVT)
+- *****************************************************************************/
++ GifFileType constructor with user supplied input function (TVT)
++******************************************************************************/
+ GifFileType *
+-DGifOpen(void *userData,
+- InputFunc readFunc) {
+-
+- unsigned char Buf[GIF_STAMP_LEN + 1];
++DGifOpen(void *userData, InputFunc readFunc, int *Error)
++{
++ char Buf[GIF_STAMP_LEN + 1];
+ GifFileType *GifFile;
+ GifFilePrivateType *Private;
+
+- if (!readFunc) {
+- _GifError = D_GIF_ERR_READ_FAILED;
+- return NULL;
+- }
+-
+ GifFile = (GifFileType *)malloc(sizeof(GifFileType));
+ if (GifFile == NULL) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ if (Error != NULL)
++ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return NULL;
+ }
+
+ memset(GifFile, '\0', sizeof(GifFileType));
+
++ /* Belt and suspenders, in case the null pointer isn't zero */
++ GifFile->SavedImages = NULL;
++ GifFile->SColorMap = NULL;
++
+ Private = (GifFilePrivateType *)malloc(sizeof(GifFilePrivateType));
+ if (!Private) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ if (Error != NULL)
++ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ free((char *)GifFile);
+ return NULL;
+ }
+
+- GifFile->Private = (VoidPtr)Private;
++ GifFile->Private = (void *)Private;
+ Private->FileHandle = 0;
+- Private->File = 0;
++ Private->File = NULL;
+ Private->FileState = FILE_STATE_READ;
+
+ Private->Read = readFunc; /* TVT */
+ GifFile->UserData = userData; /* TVT */
+
+ /* Lets see if this is a GIF file: */
+- if (READ(GifFile, Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ /* coverity[check_return] */
++ if (READ(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
++ if (Error != NULL)
++ *Error = D_GIF_ERR_READ_FAILED;
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+- /* The GIF Version number is ignored at this time. Maybe we should do
+- * something more useful with it. */
+- Buf[GIF_STAMP_LEN] = 0;
+- if (strncmp(GIF_STAMP, (const char*)Buf, GIF_VERSION_POS) != 0) {
+- _GifError = D_GIF_ERR_NOT_GIF_FILE;
++ /* Check for GIF prefix at start of file */
++ Buf[GIF_STAMP_LEN] = '\0';
++ if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) {
++ if (Error != NULL)
++ *Error = D_GIF_ERR_NOT_GIF_FILE;
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+@@ -244,28 +236,34 @@
+ if (DGifGetScreenDesc(GifFile) == GIF_ERROR) {
+ free((char *)Private);
+ free((char *)GifFile);
++ if (Error != NULL)
++ *Error = D_GIF_ERR_NO_SCRN_DSCR;
+ return NULL;
+ }
+
+- _GifError = 0;
++ GifFile->Error = 0;
++
++ /* What version of GIF? */
++ Private->gif89 = (Buf[GIF_VERSION_POS] == '9');
+
+ return GifFile;
+ }
+
+ /******************************************************************************
+- * This routine should be called before any other DGif calls. Note that
+- * this routine is called automatically from DGif file open routines.
+- *****************************************************************************/
++ This routine should be called before any other DGif calls. Note that
++ this routine is called automatically from DGif file open routines.
++******************************************************************************/
+ int
+-DGifGetScreenDesc(GifFileType * GifFile) {
+-
+- int i, BitsPerPixel;
++DGifGetScreenDesc(GifFileType *GifFile)
++{
++ int BitsPerPixel;
++ bool SortFlag;
+ GifByteType Buf[3];
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+
+@@ -275,25 +273,33 @@
+ return GIF_ERROR;
+
+ if (READ(GifFile, Buf, 3) != 3) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
++ GifFreeMapObject(GifFile->SColorMap);
++ GifFile->SColorMap = NULL;
+ return GIF_ERROR;
+ }
+ GifFile->SColorResolution = (((Buf[0] & 0x70) + 1) >> 4) + 1;
++ SortFlag = (Buf[0] & 0x08) != 0;
+ BitsPerPixel = (Buf[0] & 0x07) + 1;
+ GifFile->SBackGroundColor = Buf[1];
++ GifFile->AspectByte = Buf[2];
+ if (Buf[0] & 0x80) { /* Do we have global color map? */
++ int i;
+
+- GifFile->SColorMap = MakeMapObject(1 << BitsPerPixel, NULL);
++ GifFile->SColorMap = GifMakeMapObject(1 << BitsPerPixel, NULL);
+ if (GifFile->SColorMap == NULL) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
+
+ /* Get the global color map: */
++ GifFile->SColorMap->SortFlag = SortFlag;
+ for (i = 0; i < GifFile->SColorMap->ColorCount; i++) {
++ /* coverity[check_return] */
+ if (READ(GifFile, Buf, 3) != 3) {
+- FreeMapObject(GifFile->SColorMap);
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFreeMapObject(GifFile->SColorMap);
++ GifFile->SColorMap = NULL;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ GifFile->SColorMap->Colors[i].Red = Buf[0];
+@@ -308,39 +314,39 @@
+ }
+
+ /******************************************************************************
+- * This routine should be called before any attempt to read an image.
+- *****************************************************************************/
++ This routine should be called before any attempt to read an image.
++******************************************************************************/
+ int
+-DGifGetRecordType(GifFileType * GifFile,
+- GifRecordType * Type) {
+-
++DGifGetRecordType(GifFileType *GifFile, GifRecordType* Type)
++{
+ GifByteType Buf;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+
++ /* coverity[check_return] */
+ if (READ(GifFile, &Buf, 1) != 1) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+
+ switch (Buf) {
+- case ',':
++ case DESCRIPTOR_INTRODUCER:
+ *Type = IMAGE_DESC_RECORD_TYPE;
+ break;
+- case '!':
++ case EXTENSION_INTRODUCER:
+ *Type = EXTENSION_RECORD_TYPE;
+ break;
+- case ';':
++ case TERMINATOR_INTRODUCER:
+ *Type = TERMINATE_RECORD_TYPE;
+ break;
+ default:
+ *Type = UNDEFINED_RECORD_TYPE;
+- _GifError = D_GIF_ERR_WRONG_RECORD;
++ GifFile->Error = D_GIF_ERR_WRONG_RECORD;
+ return GIF_ERROR;
+ }
+
+@@ -348,20 +354,20 @@
+ }
+
+ /******************************************************************************
+- * This routine should be called before any attempt to read an image.
+- * Note it is assumed the Image desc. header (',') has been read.
+- *****************************************************************************/
++ This routine should be called before any attempt to read an image.
++ Note it is assumed the Image desc. header has been read.
++******************************************************************************/
+ int
+-DGifGetImageDesc(GifFileType * GifFile) {
+-
+- int i, BitsPerPixel;
++DGifGetImageDesc(GifFileType *GifFile)
++{
++ unsigned int BitsPerPixel;
+ GifByteType Buf[3];
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+ SavedImage *sp;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+
+@@ -371,51 +377,57 @@
+ DGifGetWord(GifFile, &GifFile->Image.Height) == GIF_ERROR)
+ return GIF_ERROR;
+ if (READ(GifFile, Buf, 1) != 1) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
++ GifFreeMapObject(GifFile->Image.ColorMap);
++ GifFile->Image.ColorMap = NULL;
+ return GIF_ERROR;
+ }
+ BitsPerPixel = (Buf[0] & 0x07) + 1;
+- GifFile->Image.Interlace = (Buf[0] & 0x40);
+- if (Buf[0] & 0x80) { /* Does this image have local color map? */
++ GifFile->Image.Interlace = (Buf[0] & 0x40) ? true : false;
+
+- /*** FIXME: Why do we check both of these in order to do this?
+- * Why do we have both Image and SavedImages? */
+- if (GifFile->Image.ColorMap && GifFile->SavedImages == NULL)
+- FreeMapObject(GifFile->Image.ColorMap);
++ /* Setup the colormap */
++ if (GifFile->Image.ColorMap) {
++ GifFreeMapObject(GifFile->Image.ColorMap);
++ GifFile->Image.ColorMap = NULL;
++ }
++ /* Does this image have local color map? */
++ if (Buf[0] & 0x80) {
++ unsigned int i;
+
+- GifFile->Image.ColorMap = MakeMapObject(1 << BitsPerPixel, NULL);
++ GifFile->Image.ColorMap = GifMakeMapObject(1 << BitsPerPixel, NULL);
+ if (GifFile->Image.ColorMap == NULL) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
+
+ /* Get the image local color map: */
+ for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) {
++ /* coverity[check_return] */
+ if (READ(GifFile, Buf, 3) != 3) {
+- FreeMapObject(GifFile->Image.ColorMap);
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFreeMapObject(GifFile->Image.ColorMap);
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
++ GifFile->Image.ColorMap = NULL;
+ return GIF_ERROR;
+ }
+ GifFile->Image.ColorMap->Colors[i].Red = Buf[0];
+ GifFile->Image.ColorMap->Colors[i].Green = Buf[1];
+ GifFile->Image.ColorMap->Colors[i].Blue = Buf[2];
+ }
+- } else if (GifFile->Image.ColorMap) {
+- FreeMapObject(GifFile->Image.ColorMap);
+- GifFile->Image.ColorMap = NULL;
+ }
+
+ if (GifFile->SavedImages) {
+- if ((GifFile->SavedImages = (SavedImage *)realloc(GifFile->SavedImages,
+- sizeof(SavedImage) *
+- (GifFile->ImageCount + 1))) == NULL) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ SavedImage* new_saved_images =
++ (SavedImage *)realloc(GifFile->SavedImages,
++ sizeof(SavedImage) * (GifFile->ImageCount + 1));
++ if (new_saved_images == NULL) {
++ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
++ GifFile->SavedImages = new_saved_images;
+ } else {
+ if ((GifFile->SavedImages =
+ (SavedImage *) malloc(sizeof(SavedImage))) == NULL) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
+ }
+@@ -423,11 +435,11 @@
+ sp = &GifFile->SavedImages[GifFile->ImageCount];
+ memcpy(&sp->ImageDesc, &GifFile->Image, sizeof(GifImageDesc));
+ if (GifFile->Image.ColorMap != NULL) {
+- sp->ImageDesc.ColorMap = MakeMapObject(
++ sp->ImageDesc.ColorMap = GifMakeMapObject(
+ GifFile->Image.ColorMap->ColorCount,
+ GifFile->Image.ColorMap->Colors);
+ if (sp->ImageDesc.ColorMap == NULL) {
+- _GifError = D_GIF_ERR_NOT_ENOUGH_MEM;
++ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
+ }
+@@ -440,43 +452,40 @@
+ Private->PixelCount = (long)GifFile->Image.Width *
+ (long)GifFile->Image.Height;
+
+- return DGifSetupDecompress(GifFile); /* Reset decompress algorithm parameters. */
++ /* Reset decompress algorithm parameters. */
++ return DGifSetupDecompress(GifFile);
+ }
+
+ /******************************************************************************
+- * Get one full scanned line (Line) of length LineLen from GIF file.
+- *****************************************************************************/
++ Get one full scanned line (Line) of length LineLen from GIF file.
++******************************************************************************/
+ int
+-DGifGetLine(GifFileType * GifFile,
+- GifPixelType * Line,
+- int LineLen) {
+-
++DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen)
++{
+ GifByteType *Dummy;
+ GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+
+ if (!LineLen)
+ LineLen = GifFile->Image.Width;
+
+-#if defined(__MSDOS__) || defined(__GNUC__)
+ if ((Private->PixelCount -= LineLen) > 0xffff0000UL) {
+-#else
+- if ((Private->PixelCount -= LineLen) > 0xffff0000) {
+-#endif /* __MSDOS__ */
+- _GifError = D_GIF_ERR_DATA_TOO_BIG;
++ GifFile->Error = D_GIF_ERR_DATA_TOO_BIG;
+ return GIF_ERROR;
+ }
+
+ if (DGifDecompressLine(GifFile, Line, LineLen) == GIF_OK) {
+ if (Private->PixelCount == 0) {
+- /* We probably would not be called any more, so lets clean
+- * everything before we return: need to flush out all rest of
+- * image until empty block (size 0) detected. We use GetCodeNext. */
++ /* We probably won't be called any more, so let's clean up
++ * everything before we return: need to flush out all the
++ * rest of image until an empty block (size 0)
++ * detected. We use GetCodeNext.
++ */
+ do
+ if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR)
+ return GIF_ERROR;
+@@ -488,35 +497,32 @@
+ }
+
+ /******************************************************************************
+- * Put one pixel (Pixel) into GIF file.
+- *****************************************************************************/
++ Put one pixel (Pixel) into GIF file.
++******************************************************************************/
+ int
+-DGifGetPixel(GifFileType * GifFile,
+- GifPixelType Pixel) {
+-
++DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel)
++{
+ GifByteType *Dummy;
+ GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+-#if defined(__MSDOS__) || defined(__GNUC__)
+ if (--Private->PixelCount > 0xffff0000UL)
+-#else
+- if (--Private->PixelCount > 0xffff0000)
+-#endif /* __MSDOS__ */
+ {
+- _GifError = D_GIF_ERR_DATA_TOO_BIG;
++ GifFile->Error = D_GIF_ERR_DATA_TOO_BIG;
+ return GIF_ERROR;
+ }
+
+ if (DGifDecompressLine(GifFile, &Pixel, 1) == GIF_OK) {
+ if (Private->PixelCount == 0) {
+- /* We probably would not be called any more, so lets clean
+- * everything before we return: need to flush out all rest of
+- * image until empty block (size 0) detected. We use GetCodeNext. */
++ /* We probably won't be called any more, so let's clean up
++ * everything before we return: need to flush out all the
++ * rest of image until an empty block (size 0)
++ * detected. We use GetCodeNext.
++ */
+ do
+ if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR)
+ return GIF_ERROR;
+@@ -528,28 +534,27 @@
+ }
+
+ /******************************************************************************
+- * Get an extension block (see GIF manual) from gif file. This routine only
+- * returns the first data block, and DGifGetExtensionNext should be called
+- * after this one until NULL extension is returned.
+- * The Extension should NOT be freed by the user (not dynamically allocated).
+- * Note it is assumed the Extension desc. header ('!') has been read.
+- *****************************************************************************/
++ Get an extension block (see GIF manual) from GIF file. This routine only
++ returns the first data block, and DGifGetExtensionNext should be called
++ after this one until NULL extension is returned.
++ The Extension should NOT be freed by the user (not dynamically allocated).
++ Note it is assumed the Extension description header has been read.
++******************************************************************************/
+ int
+-DGifGetExtension(GifFileType * GifFile,
+- int *ExtCode,
+- GifByteType ** Extension) {
+-
++DGifGetExtension(GifFileType *GifFile, int *ExtCode, GifByteType **Extension)
++{
+ GifByteType Buf;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+
++ /* coverity[check_return] */
+ if (READ(GifFile, &Buf, 1) != 1) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ *ExtCode = Buf;
+@@ -558,26 +563,26 @@
+ }
+
+ /******************************************************************************
+- * Get a following extension block (see GIF manual) from gif file. This
+- * routine should be called until NULL Extension is returned.
+- * The Extension should NOT be freed by the user (not dynamically allocated).
+- *****************************************************************************/
++ Get a following extension block (see GIF manual) from GIF file. This
++ routine should be called until NULL Extension is returned.
++ The Extension should NOT be freed by the user (not dynamically allocated).
++******************************************************************************/
+ int
+-DGifGetExtensionNext(GifFileType * GifFile,
+- GifByteType ** Extension) {
+-
++DGifGetExtensionNext(GifFileType *GifFile, GifByteType ** Extension)
++{
+ GifByteType Buf;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (READ(GifFile, &Buf, 1) != 1) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ if (Buf > 0) {
+ *Extension = Private->Buf; /* Use private unused buffer. */
+ (*Extension)[0] = Buf; /* Pascal strings notation (pos. 0 is len.). */
++ /* coverity[tainted_data,check_return] */
+ if (READ(GifFile, &((*Extension)[1]), Buf) != Buf) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ } else
+@@ -587,91 +592,141 @@
+ }
+
+ /******************************************************************************
+- * This routine should be called last, to close the GIF file.
+- *****************************************************************************/
++ Extract a Graphics Control Block from raw extension data
++******************************************************************************/
++
++int DGifExtensionToGCB(const size_t GifExtensionLength,
++ const GifByteType *GifExtension,
++ GraphicsControlBlock *GCB)
++{
++ if (GifExtensionLength != 4) {
++ return GIF_ERROR;
++ }
++
++ GCB->DisposalMode = (GifExtension[0] >> 2) & 0x07;
++ GCB->UserInputFlag = (GifExtension[0] & 0x02) != 0;
++ GCB->DelayTime = UNSIGNED_LITTLE_ENDIAN(GifExtension[1], GifExtension[2]);
++ if (GifExtension[0] & 0x01)
++ GCB->TransparentColor = (int)GifExtension[3];
++ else
++ GCB->TransparentColor = NO_TRANSPARENT_COLOR;
++
++ return GIF_OK;
++}
++
++/******************************************************************************
++ Extract the Graphics Control Block for a saved image, if it exists.
++******************************************************************************/
++
++int DGifSavedExtensionToGCB(GifFileType *GifFile,
++ int ImageIndex, GraphicsControlBlock *GCB)
++{
++ int i;
++
++ if (ImageIndex < 0 || ImageIndex > GifFile->ImageCount - 1)
++ return GIF_ERROR;
++
++ GCB->DisposalMode = DISPOSAL_UNSPECIFIED;
++ GCB->UserInputFlag = false;
++ GCB->DelayTime = 0;
++ GCB->TransparentColor = NO_TRANSPARENT_COLOR;
++
++ for (i = 0; i < GifFile->SavedImages[ImageIndex].ExtensionBlockCount; i++) {
++ ExtensionBlock *ep = &GifFile->SavedImages[ImageIndex].ExtensionBlocks[i];
++ if (ep->Function == GRAPHICS_EXT_FUNC_CODE)
++ return DGifExtensionToGCB(ep->ByteCount, ep->Bytes, GCB);
++ }
++
++ return GIF_ERROR;
++}
++
++/******************************************************************************
++ This routine should be called last, to close the GIF file.
++******************************************************************************/
+ int
+-DGifCloseFile(GifFileType * GifFile) {
++DGifCloseFile(GifFileType *GifFile, int *ErrorCode)
++{
++ GifFilePrivateType *Private;
+
+- GifFilePrivateType *Private;
+- FILE *File;
++ if (GifFile == NULL || GifFile->Private == NULL)
++ return GIF_ERROR;
+
+- if (GifFile == NULL)
+- return GIF_ERROR;
++ if (GifFile->Image.ColorMap) {
++ GifFreeMapObject(GifFile->Image.ColorMap);
++ GifFile->Image.ColorMap = NULL;
++ }
++
++ if (GifFile->SColorMap) {
++ GifFreeMapObject(GifFile->SColorMap);
++ GifFile->SColorMap = NULL;
++ }
++
++ if (GifFile->SavedImages) {
++ GifFreeSavedImages(GifFile);
++ GifFile->SavedImages = NULL;
++ }
++
++ GifFreeExtensions(&GifFile->ExtensionBlockCount, &GifFile->ExtensionBlocks);
+
+ Private = (GifFilePrivateType *) GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ if (ErrorCode != NULL)
++ *ErrorCode = D_GIF_ERR_NOT_READABLE;
++ free((char *)GifFile->Private);
++ free(GifFile);
+ return GIF_ERROR;
+ }
+
+- File = Private->File;
+-
+- if (GifFile->Image.ColorMap) {
+- FreeMapObject(GifFile->Image.ColorMap);
+- GifFile->Image.ColorMap = NULL;
++ if (Private->File && (fclose(Private->File) != 0)) {
++ if (ErrorCode != NULL)
++ *ErrorCode = D_GIF_ERR_CLOSE_FAILED;
++ free((char *)GifFile->Private);
++ free(GifFile);
++ return GIF_ERROR;
+ }
+
+- if (GifFile->SColorMap) {
+- FreeMapObject(GifFile->SColorMap);
+- GifFile->SColorMap = NULL;
+- }
+-
+- if (Private) {
+- free((char *)Private);
+- Private = NULL;
+- }
+-
+- if (GifFile->SavedImages) {
+- FreeSavedImages(GifFile);
+- GifFile->SavedImages = NULL;
+- }
+-
++ free((char *)GifFile->Private);
+ free(GifFile);
+-
+- if (File && (fclose(File) != 0)) {
+- _GifError = D_GIF_ERR_CLOSE_FAILED;
+- return GIF_ERROR;
+- }
++ if (ErrorCode != NULL)
++ *ErrorCode = D_GIF_SUCCEEDED;
+ return GIF_OK;
+ }
+
+ /******************************************************************************
+- * Get 2 bytes (word) from the given file:
+- *****************************************************************************/
++ Get 2 bytes (word) from the given file:
++******************************************************************************/
+ static int
+-DGifGetWord(GifFileType * GifFile,
+- int *Word) {
+-
++DGifGetWord(GifFileType *GifFile, GifWord *Word)
++{
+ unsigned char c[2];
+
++ /* coverity[check_return] */
+ if (READ(GifFile, c, 2) != 2) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+
+- *Word = (((unsigned int)c[1]) << 8) + c[0];
++ *Word = (GifWord)UNSIGNED_LITTLE_ENDIAN(c[0], c[1]);
+ return GIF_OK;
+ }
+
+ /******************************************************************************
+- * Get the image code in compressed form. This routine can be called if the
+- * information needed to be piped out as is. Obviously this is much faster
+- * than decoding and encoding again. This routine should be followed by calls
+- * to DGifGetCodeNext, until NULL block is returned.
+- * The block should NOT be freed by the user (not dynamically allocated).
+- *****************************************************************************/
++ Get the image code in compressed form. This routine can be called if the
++ information needed to be piped out as is. Obviously this is much faster
++ than decoding and encoding again. This routine should be followed by calls
++ to DGifGetCodeNext, until NULL block is returned.
++ The block should NOT be freed by the user (not dynamically allocated).
++******************************************************************************/
+ int
+-DGifGetCode(GifFileType * GifFile,
+- int *CodeSize,
+- GifByteType ** CodeBlock) {
+-
++DGifGetCode(GifFileType *GifFile, int *CodeSize, GifByteType **CodeBlock)
++{
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+
+@@ -681,27 +736,30 @@
+ }
+
+ /******************************************************************************
+- * Continue to get the image code in compressed form. This routine should be
+- * called until NULL block is returned.
+- * The block should NOT be freed by the user (not dynamically allocated).
+- *****************************************************************************/
++ Continue to get the image code in compressed form. This routine should be
++ called until NULL block is returned.
++ The block should NOT be freed by the user (not dynamically allocated).
++******************************************************************************/
+ int
+-DGifGetCodeNext(GifFileType * GifFile,
+- GifByteType ** CodeBlock) {
+-
++DGifGetCodeNext(GifFileType *GifFile, GifByteType **CodeBlock)
++{
+ GifByteType Buf;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
++ /* coverity[tainted_data_argument] */
++ /* coverity[check_return] */
+ if (READ(GifFile, &Buf, 1) != 1) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+
++ /* coverity[lower_bounds] */
+ if (Buf > 0) {
+ *CodeBlock = Private->Buf; /* Use private unused buffer. */
+ (*CodeBlock)[0] = Buf; /* Pascal strings notation (pos. 0 is len.). */
++ /* coverity[tainted_data] */
+ if (READ(GifFile, &((*CodeBlock)[1]), Buf) != Buf) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ } else {
+@@ -714,20 +772,19 @@
+ }
+
+ /******************************************************************************
+- * Setup the LZ decompression for this image:
+- *****************************************************************************/
++ Setup the LZ decompression for this image:
++******************************************************************************/
+ static int
+-DGifSetupDecompress(GifFileType * GifFile) {
+-
++DGifSetupDecompress(GifFileType *GifFile)
++{
+ int i, BitsPerPixel;
+ GifByteType CodeSize;
+- unsigned int *Prefix;
++ GifPrefixType *Prefix;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+- READ(GifFile, &CodeSize, 1); /* Read Code size from file. */
+- if (CodeSize >= 12) {
+- /* Invalid initial code size: report failure */
+- return GIF_ERROR;
++ /* coverity[check_return] */
++ if (READ(GifFile, &CodeSize, 1) < 1) { /* Read Code size from file. */
++ return GIF_ERROR; /* Failed to read Code size. */
+ }
+ BitsPerPixel = CodeSize;
+
+@@ -751,20 +808,18 @@
+ }
+
+ /******************************************************************************
+- * The LZ decompression routine:
+- * This version decompress the given gif file into Line of length LineLen.
+- * This routine can be called few times (one per scan line, for example), in
+- * order the complete the whole image.
+- *****************************************************************************/
++ The LZ decompression routine:
++ This version decompress the given GIF file into Line of length LineLen.
++ This routine can be called few times (one per scan line, for example), in
++ order the complete the whole image.
++******************************************************************************/
+ static int
+-DGifDecompressLine(GifFileType * GifFile,
+- GifPixelType * Line,
+- int LineLen) {
+-
++DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, int LineLen)
++{
+ int i = 0;
+ int j, CrntCode, EOFCode, ClearCode, CrntPrefix, LastCode, StackPtr;
+ GifByteType *Stack, *Suffix;
+- unsigned int *Prefix;
++ GifPrefixType *Prefix;
+ GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+
+ StackPtr = Private->StackPtr;
+@@ -775,8 +830,12 @@
+ ClearCode = Private->ClearCode;
+ LastCode = Private->LastCode;
+
++ if (StackPtr > LZ_MAX_CODE) {
++ return GIF_ERROR;
++ }
++
+ if (StackPtr != 0) {
+- /* Let pop the stack off before continueing to read the gif file: */
++ /* Let pop the stack off before continueing to read the GIF file: */
+ while (StackPtr != 0 && i < LineLen)
+ Line[i++] = Stack[--StackPtr];
+ }
+@@ -789,11 +848,8 @@
+ /* Note however that usually we will not be here as we will stop
+ * decoding as soon as we got all the pixel, or EOF code will
+ * not be read at all, and DGifGetLine/Pixel clean everything. */
+- if (i != LineLen - 1 || Private->PixelCount != 0) {
+- _GifError = D_GIF_ERR_EOF_TOO_SOON;
+- return GIF_ERROR;
+- }
+- i++;
++ GifFile->Error = D_GIF_ERR_EOF_TOO_SOON;
++ return GIF_ERROR;
+ } else if (CrntCode == ClearCode) {
+ /* We need to start over again: */
+ for (j = 0; j <= LZ_MAX_CODE; j++)
+@@ -815,36 +871,37 @@
+ * pixels on our stack. If we done, pop the stack in reverse
+ * (thats what stack is good for!) order to output. */
+ if (Prefix[CrntCode] == NO_SUCH_CODE) {
++ CrntPrefix = LastCode;
++
+ /* Only allowed if CrntCode is exactly the running code:
+ * In that case CrntCode = XXXCode, CrntCode or the
+ * prefix code is last code and the suffix char is
+ * exactly the prefix of last code! */
+ if (CrntCode == Private->RunningCode - 2) {
+- CrntPrefix = LastCode;
+ Suffix[Private->RunningCode - 2] =
+ Stack[StackPtr++] = DGifGetPrefixChar(Prefix,
+ LastCode,
+ ClearCode);
+ } else {
+- _GifError = D_GIF_ERR_IMAGE_DEFECT;
+- return GIF_ERROR;
++ Suffix[Private->RunningCode - 2] =
++ Stack[StackPtr++] = DGifGetPrefixChar(Prefix,
++ CrntCode,
++ ClearCode);
+ }
+ } else
+ CrntPrefix = CrntCode;
+
+- /* Now (if image is O.K.) we should not get an NO_SUCH_CODE
+- * During the trace. As we might loop forever, in case of
+- * defective image, we count the number of loops we trace
+- * and stop if we got LZ_MAX_CODE. obviously we can not
+- * loop more than that. */
+- j = 0;
+- while (j++ <= LZ_MAX_CODE &&
++ /* Now (if image is O.K.) we should not get a NO_SUCH_CODE
++ * during the trace. As we might loop forever, in case of
++ * defective image, we use StackPtr as loop counter and stop
++ * before overflowing Stack[]. */
++ while (StackPtr < LZ_MAX_CODE &&
+ CrntPrefix > ClearCode && CrntPrefix <= LZ_MAX_CODE) {
+ Stack[StackPtr++] = Suffix[CrntPrefix];
+ CrntPrefix = Prefix[CrntPrefix];
+ }
+- if (j >= LZ_MAX_CODE || CrntPrefix > LZ_MAX_CODE) {
+- _GifError = D_GIF_ERR_IMAGE_DEFECT;
++ if (StackPtr >= LZ_MAX_CODE || CrntPrefix > LZ_MAX_CODE) {
++ GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
+ return GIF_ERROR;
+ }
+ /* Push the last character on stack: */
+@@ -854,7 +911,7 @@
+ while (StackPtr != 0 && i < LineLen)
+ Line[i++] = Stack[--StackPtr];
+ }
+- if (LastCode != NO_SUCH_CODE) {
++ if (LastCode != NO_SUCH_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
+ Prefix[Private->RunningCode - 2] = LastCode;
+
+ if (CrntCode == Private->RunningCode - 2) {
+@@ -880,37 +937,38 @@
+ }
+
+ /******************************************************************************
+- * Routine to trace the Prefixes linked list until we get a prefix which is
+- * not code, but a pixel value (less than ClearCode). Returns that pixel value.
+- * If image is defective, we might loop here forever, so we limit the loops to
+- * the maximum possible if image O.k. - LZ_MAX_CODE times.
+- *****************************************************************************/
++ Routine to trace the Prefixes linked list until we get a prefix which is
++ not code, but a pixel value (less than ClearCode). Returns that pixel value.
++ If image is defective, we might loop here forever, so we limit the loops to
++ the maximum possible if image O.k. - LZ_MAX_CODE times.
++******************************************************************************/
+ static int
+-DGifGetPrefixChar(unsigned int *Prefix,
+- int Code,
+- int ClearCode) {
+-
++DGifGetPrefixChar(GifPrefixType *Prefix, int Code, int ClearCode)
++{
+ int i = 0;
+
+- while (Code > ClearCode && i++ <= LZ_MAX_CODE)
++ while (Code > ClearCode && i++ <= LZ_MAX_CODE) {
++ if (Code > LZ_MAX_CODE) {
++ return NO_SUCH_CODE;
++ }
+ Code = Prefix[Code];
++ }
+ return Code;
+ }
+
+ /******************************************************************************
+- * Interface for accessing the LZ codes directly. Set Code to the real code
+- * (12bits), or to -1 if EOF code is returned.
+- *****************************************************************************/
++ Interface for accessing the LZ codes directly. Set Code to the real code
++ (12bits), or to -1 if EOF code is returned.
++******************************************************************************/
+ int
+-DGifGetLZCodes(GifFileType * GifFile,
+- int *Code) {
+-
++DGifGetLZCodes(GifFileType *GifFile, int *Code)
++{
+ GifByteType *CodeBlock;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+- _GifError = D_GIF_ERR_NOT_READABLE;
++ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+
+@@ -936,32 +994,38 @@
+ }
+
+ /******************************************************************************
+- * The LZ decompression input routine:
+- * This routine is responsable for the decompression of the bit stream from
+- * 8 bits (bytes) packets, into the real codes.
+- * Returns GIF_OK if read succesfully.
+- *****************************************************************************/
++ The LZ decompression input routine:
++ This routine is responsable for the decompression of the bit stream from
++ 8 bits (bytes) packets, into the real codes.
++ Returns GIF_OK if read successfully.
++******************************************************************************/
+ static int
+-DGifDecompressInput(GifFileType * GifFile,
+- int *Code) {
+-
+- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+-
+- GifByteType NextByte;
+- static unsigned int CodeMasks[] = {
++DGifDecompressInput(GifFileType *GifFile, int *Code)
++{
++ static const unsigned short CodeMasks[] = {
+ 0x0000, 0x0001, 0x0003, 0x0007,
+ 0x000f, 0x001f, 0x003f, 0x007f,
+ 0x00ff, 0x01ff, 0x03ff, 0x07ff,
+ 0x0fff
+ };
+
++ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
++
++ GifByteType NextByte;
++
++ /* The image can't contain more than LZ_BITS per code. */
++ if (Private->RunningBits > LZ_BITS) {
++ GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
++ return GIF_ERROR;
++ }
++
+ while (Private->CrntShiftState < Private->RunningBits) {
+ /* Needs to get more bytes from input stream for next code: */
+ if (DGifBufferedInput(GifFile, Private->Buf, &NextByte) == GIF_ERROR) {
+ return GIF_ERROR;
+ }
+ Private->CrntShiftDWord |=
+- ((unsigned long)NextByte) << Private->CrntShiftState;
++ ((unsigned long)NextByte) << Private->CrntShiftState;
+ Private->CrntShiftState += 8;
+ }
+ *Code = Private->CrntShiftDWord & CodeMasks[Private->RunningBits];
+@@ -970,37 +1034,45 @@
+ Private->CrntShiftState -= Private->RunningBits;
+
+ /* If code cannot fit into RunningBits bits, must raise its size. Note
+- * however that codes above 4095 are used for special signaling. */
+- if (++Private->RunningCode > Private->MaxCode1) {
+- if (Private->RunningBits < LZ_BITS) {
+- Private->MaxCode1 <<= 1;
+- Private->RunningBits++;
+- } else {
+- Private->RunningCode = Private->MaxCode1;
+- }
++ * however that codes above 4095 are used for special signaling.
++ * If we're using LZ_BITS bits already and we're at the max code, just
++ * keep using the table as it is, don't increment Private->RunningCode.
++ */
++ if (Private->RunningCode < LZ_MAX_CODE + 2 &&
++ ++Private->RunningCode > Private->MaxCode1 &&
++ Private->RunningBits < LZ_BITS) {
++ Private->MaxCode1 <<= 1;
++ Private->RunningBits++;
+ }
+ return GIF_OK;
+ }
+
+ /******************************************************************************
+- * This routines read one gif data block at a time and buffers it internally
+- * so that the decompression routine could access it.
+- * The routine returns the next byte from its internal buffer (or read next
+- * block in if buffer empty) and returns GIF_OK if succesful.
+- *****************************************************************************/
++ This routines read one GIF data block at a time and buffers it internally
++ so that the decompression routine could access it.
++ The routine returns the next byte from its internal buffer (or read next
++ block in if buffer empty) and returns GIF_OK if succesful.
++******************************************************************************/
+ static int
+-DGifBufferedInput(GifFileType * GifFile,
+- GifByteType * Buf,
+- GifByteType * NextByte) {
+-
++DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, GifByteType *NextByte)
++{
+ if (Buf[0] == 0) {
+ /* Needs to read the next buffer - this one is empty: */
++ /* coverity[check_return] */
+ if (READ(GifFile, Buf, 1) != 1) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
++ return GIF_ERROR;
++ }
++ /* There shouldn't be any empty data blocks here as the LZW spec
++ * says the LZW termination code should come first. Therefore we
++ * shouldn't be inside this routine at that point.
++ */
++ if (Buf[0] == 0) {
++ GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
+ return GIF_ERROR;
+ }
+ if (READ(GifFile, &Buf[1], Buf[0]) != Buf[0]) {
+- _GifError = D_GIF_ERR_READ_FAILED;
++ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ *NextByte = Buf[1];
+@@ -1015,21 +1087,21 @@
+ }
+
+ /******************************************************************************
+- * This routine reads an entire GIF into core, hanging all its state info off
+- * the GifFileType pointer. Call DGifOpenFileName() or DGifOpenFileHandle()
+- * first to initialize I/O. Its inverse is EGifSpew().
+- ******************************************************************************/
++ This routine reads an entire GIF into core, hanging all its state info off
++ the GifFileType pointer. Call DGifOpenFileName() or DGifOpenFileHandle()
++ first to initialize I/O. Its inverse is EGifSpew().
++*******************************************************************************/
+ int
+-DGifSlurp(GifFileType * GifFile) {
+-
+- int ImageSize;
++DGifSlurp(GifFileType *GifFile)
++{
++ size_t ImageSize;
+ GifRecordType RecordType;
+ SavedImage *sp;
+ GifByteType *ExtData;
+- SavedImage temp_save;
++ int ExtFunction;
+
+- temp_save.ExtensionBlocks = NULL;
+- temp_save.ExtensionBlockCount = 0;
++ GifFile->ExtensionBlocks = NULL;
++ GifFile->ExtensionBlockCount = 0;
+
+ do {
+ if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR)
+@@ -1041,44 +1113,77 @@
+ return (GIF_ERROR);
+
+ sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
++ /* Allocate memory for the image */
++ if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 &&
++ sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
++ return GIF_ERROR;
++ }
+ ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height;
+
++ if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) {
++ return GIF_ERROR;
++ }
+ sp->RasterBits = (unsigned char *)malloc(ImageSize *
+- sizeof(GifPixelType));
++ sizeof(GifPixelType));
++
+ if (sp->RasterBits == NULL) {
+ return GIF_ERROR;
+ }
+- if (DGifGetLine(GifFile, sp->RasterBits, ImageSize) ==
+- GIF_ERROR)
+- return (GIF_ERROR);
+- if (temp_save.ExtensionBlocks) {
+- sp->ExtensionBlocks = temp_save.ExtensionBlocks;
+- sp->ExtensionBlockCount = temp_save.ExtensionBlockCount;
+
+- temp_save.ExtensionBlocks = NULL;
+- temp_save.ExtensionBlockCount = 0;
++ if (sp->ImageDesc.Interlace) {
++ int i, j;
++ /*
++ * The way an interlaced image should be read -
++ * offsets and jumps...
++ */
++ int InterlacedOffset[] = { 0, 4, 2, 1 };
++ int InterlacedJumps[] = { 8, 8, 4, 2 };
++ /* Need to perform 4 passes on the image */
++ for (i = 0; i < 4; i++)
++ for (j = InterlacedOffset[i];
++ j < sp->ImageDesc.Height;
++ j += InterlacedJumps[i]) {
++ if (DGifGetLine(GifFile,
++ sp->RasterBits+j*sp->ImageDesc.Width,
++ sp->ImageDesc.Width) == GIF_ERROR)
++ return GIF_ERROR;
++ }
++ }
++ else {
++ if (DGifGetLine(GifFile,sp->RasterBits,ImageSize)==GIF_ERROR)
++ return (GIF_ERROR);
++ }
+
+- /* FIXME: The following is wrong. It is left in only for
+- * backwards compatibility. Someday it should go away. Use
+- * the sp->ExtensionBlocks->Function variable instead. */
+- sp->Function = sp->ExtensionBlocks[0].Function;
++ if (GifFile->ExtensionBlocks) {
++ sp->ExtensionBlocks = GifFile->ExtensionBlocks;
++ sp->ExtensionBlockCount = GifFile->ExtensionBlockCount;
++
++ GifFile->ExtensionBlocks = NULL;
++ GifFile->ExtensionBlockCount = 0;
+ }
+ break;
+
+ case EXTENSION_RECORD_TYPE:
+- if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) ==
+- GIF_ERROR)
++ if (DGifGetExtension(GifFile,&ExtFunction,&ExtData) == GIF_ERROR)
+ return (GIF_ERROR);
+- while (ExtData != NULL) {
+-
+- /* Create an extension block with our data */
+- if (AddExtensionBlock(&temp_save, ExtData[0], &ExtData[1])
++ /* Create an extension block with our data */
++ if (ExtData != NULL) {
++ if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
++ &GifFile->ExtensionBlocks,
++ ExtFunction, ExtData[0], &ExtData[1])
+ == GIF_ERROR)
+ return (GIF_ERROR);
+-
++ }
++ while (ExtData != NULL) {
+ if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR)
+ return (GIF_ERROR);
+- temp_save.Function = 0;
++ /* Continue the extension block */
++ if (ExtData != NULL)
++ if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
++ &GifFile->ExtensionBlocks,
++ CONTINUE_EXT_FUNC_CODE,
++ ExtData[0], &ExtData[1]) == GIF_ERROR)
++ return (GIF_ERROR);
+ }
+ break;
+
+@@ -1090,12 +1195,13 @@
+ }
+ } while (RecordType != TERMINATE_RECORD_TYPE);
+
+- /* Just in case the Gif has an extension block without an associated
+- * image... (Should we save this into a savefile structure with no image
+- * instead? Have to check if the present writing code can handle that as
+- * well.... */
+- if (temp_save.ExtensionBlocks)
+- FreeExtension(&temp_save);
++ /* Sanity check for corrupted file */
++ if (GifFile->ImageCount == 0) {
++ GifFile->Error = D_GIF_ERR_NO_IMAG_DSCR;
++ return(GIF_ERROR);
++ }
+
+ return (GIF_OK);
+ }
++
++/* end */
+--- ./jdk/src/share/native/sun/awt/giflib/gif_err.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/awt/giflib/gif_err.c Wed Jul 01 21:53:30 2015 -0700
+@@ -23,71 +23,81 @@
+ */
+
+ /*****************************************************************************
+- * "Gif-Lib" - Yet another gif library.
+- *
+- * Written by: Gershon Elber IBM PC Ver 0.1, Jun. 1989
+- *****************************************************************************
+- * Handle error reporting for the GIF library.
+- *****************************************************************************
+- * History:
+- * 17 Jun 89 - Version 1.0 by Gershon Elber.
+- ****************************************************************************/
+
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#endif
++gif_err.c - handle error reporting for the GIF library.
++
++****************************************************************************/
+
+ #include <stdio.h>
++
+ #include "gif_lib.h"
+-
+-int _GifError = 0;
++#include "gif_lib_private.h"
+
+ /*****************************************************************************
+- * Return the last GIF error (0 if none) and reset the error.
+- ****************************************************************************/
+-int
+-GifLastError(void) {
+- int i = _GifError;
++ Return a string description of the last GIF error
++*****************************************************************************/
++const char *
++GifErrorString(int ErrorCode)
++{
++ const char *Err;
+
+- _GifError = 0;
+-
+- return i;
+-}
+-
+-/*****************************************************************************
+- * Print the last GIF error to stderr.
+- ****************************************************************************/
+-void
+-PrintGifError(void) {
+- char *Err;
+-
+- switch (_GifError) {
++ switch (ErrorCode) {
++ case E_GIF_ERR_OPEN_FAILED:
++ Err = "Failed to open given file";
++ break;
++ case E_GIF_ERR_WRITE_FAILED:
++ Err = "Failed to write to given file";
++ break;
++ case E_GIF_ERR_HAS_SCRN_DSCR:
++ Err = "Screen descriptor has already been set";
++ break;
++ case E_GIF_ERR_HAS_IMAG_DSCR:
++ Err = "Image descriptor is still active";
++ break;
++ case E_GIF_ERR_NO_COLOR_MAP:
++ Err = "Neither global nor local color map";
++ break;
++ case E_GIF_ERR_DATA_TOO_BIG:
++ Err = "Number of pixels bigger than width * height";
++ break;
++ case E_GIF_ERR_NOT_ENOUGH_MEM:
++ Err = "Failed to allocate required memory";
++ break;
++ case E_GIF_ERR_DISK_IS_FULL:
++ Err = "Write failed (disk full?)";
++ break;
++ case E_GIF_ERR_CLOSE_FAILED:
++ Err = "Failed to close given file";
++ break;
++ case E_GIF_ERR_NOT_WRITEABLE:
++ Err = "Given file was not opened for write";
++ break;
+ case D_GIF_ERR_OPEN_FAILED:
+ Err = "Failed to open given file";
+ break;
+ case D_GIF_ERR_READ_FAILED:
+- Err = "Failed to Read from given file";
++ Err = "Failed to read from given file";
+ break;
+ case D_GIF_ERR_NOT_GIF_FILE:
+- Err = "Given file is NOT GIF file";
++ Err = "Data is not in GIF format";
+ break;
+ case D_GIF_ERR_NO_SCRN_DSCR:
+- Err = "No Screen Descriptor detected";
++ Err = "No screen descriptor detected";
+ break;
+ case D_GIF_ERR_NO_IMAG_DSCR:
+ Err = "No Image Descriptor detected";
+ break;
+ case D_GIF_ERR_NO_COLOR_MAP:
+- Err = "Neither Global Nor Local color map";
++ Err = "Neither global nor local color map";
+ break;
+ case D_GIF_ERR_WRONG_RECORD:
+ Err = "Wrong record type detected";
+ break;
+ case D_GIF_ERR_DATA_TOO_BIG:
+- Err = "#Pixels bigger than Width * Height";
++ Err = "Number of pixels bigger than width * height";
+ break;
+ case D_GIF_ERR_NOT_ENOUGH_MEM:
+- Err = "Fail to allocate required memory";
++ Err = "Failed to allocate required memory";
+ break;
+ case D_GIF_ERR_CLOSE_FAILED:
+ Err = "Failed to close given file";
+@@ -99,14 +109,13 @@
+ Err = "Image is defective, decoding aborted";
+ break;
+ case D_GIF_ERR_EOF_TOO_SOON:
+- Err = "Image EOF detected, before image complete";
++ Err = "Image EOF detected before image complete";
+ break;
+ default:
+ Err = NULL;
+ break;
+ }
+- if (Err != NULL)
+- fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
+- else
+- fprintf(stderr, "\nGIF-LIB undefined error %d.\n", _GifError);
++ return Err;
+ }
++
++/* end */
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/share/native/sun/awt/giflib/gif_hash.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,62 @@
++/*
++ * 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.
++ */
++
++/******************************************************************************
++
++gif_hash.h - magfic constants and declarations for GIF LZW
++
++******************************************************************************/
++
++#ifndef _GIF_HASH_H_
++#define _GIF_HASH_H_
++
++#include <stdint.h>
++
++#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */
++#define HT_KEY_MASK 0x1FFF /* 13bits keys */
++#define HT_KEY_NUM_BITS 13 /* 13bits keys */
++#define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */
++#define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */
++
++/* The 32 bits of the long are divided into two parts for the key & code: */
++/* 1. The code is 12 bits as our compression algorithm is limited to 12bits */
++/* 2. The key is 12 bits Prefix code + 8 bit new char or 20 bits. */
++/* The key is the upper 20 bits. The code is the lower 12. */
++#define HT_GET_KEY(l) (l >> 12)
++#define HT_GET_CODE(l) (l & 0x0FFF)
++#define HT_PUT_KEY(l) (l << 12)
++#define HT_PUT_CODE(l) (l & 0x0FFF)
++
++typedef struct GifHashTableType {
++ uint32_t HTable[HT_SIZE];
++} GifHashTableType;
++
++GifHashTableType *_InitHashTable(void);
++void _ClearHashTable(GifHashTableType *HashTable);
++void _InsertHashTable(GifHashTableType *HashTable, uint32_t Key, int Code);
++int _ExistsHashTable(GifHashTableType *HashTable, uint32_t Key);
++
++#endif /* _GIF_HASH_H_ */
++
++/* end */
+--- ./jdk/src/share/native/sun/awt/giflib/gif_lib.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/awt/giflib/gif_lib.h Wed Jul 01 21:53:30 2015 -0700
+@@ -23,21 +23,10 @@
+ */
+
+ /******************************************************************************
+- * In order to make life a little bit easier when using the GIF file format,
+- * this library was written, and which does all the dirty work...
+- *
+- * Written by Gershon Elber, Jun. 1989
+- * Hacks by Eric S. Raymond, Sep. 1992
+- ******************************************************************************
+- * History:
+- * 14 Jun 89 - Version 1.0 by Gershon Elber.
+- * 3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names)
+- * 15 Sep 90 - Version 2.0 by Eric S. Raymond (Changes to suoport GIF slurp)
+- * 26 Jun 96 - Version 3.0 by Eric S. Raymond (Full GIF89 support)
+- * 17 Dec 98 - Version 4.0 by Toshio Kuratomi (Fix extension writing code)
+- *****************************************************************************/
+
+-/* all encoding functionality stripped */
++gif_lib.h - service library for decoding and encoding GIF images
++
++*****************************************************************************/
+
+ #ifndef _GIF_LIB_H_
+ #define _GIF_LIB_H_ 1
+@@ -46,21 +35,21 @@
+ extern "C" {
+ #endif /* __cplusplus */
+
+-#define GIF_LIB_VERSION " Version 4.1, "
++#define GIFLIB_MAJOR 5
++#define GIFLIB_MINOR 1
++#define GIFLIB_RELEASE 1
+
+ #define GIF_ERROR 0
+ #define GIF_OK 1
+
+-#ifndef TRUE
+-#define TRUE 1
+-#endif /* TRUE */
+-#ifndef FALSE
+-#define FALSE 0
+-#endif /* FALSE */
++#include <stddef.h>
+
+-#ifndef NULL
+-#define NULL 0
+-#endif /* NULL */
++#ifdef bool
++#undef bool
++#endif
++typedef int bool;
++#define false 0
++#define true 1
+
+ #define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */
+ #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
+@@ -68,21 +57,11 @@
+ #define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */
+ #define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */
+
+-#define GIF_FILE_BUFFER_SIZE 16384 /* Files uses bigger buffers than usual. */
+-
+-typedef int GifBooleanType;
+ typedef unsigned char GifPixelType;
+ typedef unsigned char *GifRowType;
+ typedef unsigned char GifByteType;
+-
+-#define GIF_MESSAGE(Msg) fprintf(stderr, "\n%s: %s\n", PROGRAM_NAME, Msg)
+-#define GIF_EXIT(Msg) { GIF_MESSAGE(Msg); exit(-3); }
+-
+-#ifdef SYSV
+-#define VoidPtr char *
+-#else
+-#define VoidPtr void *
+-#endif /* SYSV */
++typedef unsigned int GifPrefixType;
++typedef int GifWord;
+
+ typedef struct GifColorType {
+ GifByteType Red, Green, Blue;
+@@ -91,27 +70,52 @@
+ typedef struct ColorMapObject {
+ int ColorCount;
+ int BitsPerPixel;
++ bool SortFlag;
+ GifColorType *Colors; /* on malloc(3) heap */
+ } ColorMapObject;
+
+ typedef struct GifImageDesc {
+- int Left, Top, Width, Height, /* Current image dimensions. */
+- Interlace; /* Sequential/Interlaced lines. */
+- ColorMapObject *ColorMap; /* The local color map */
++ GifWord Left, Top, Width, Height; /* Current image dimensions. */
++ bool Interlace; /* Sequential/Interlaced lines. */
++ ColorMapObject *ColorMap; /* The local color map */
+ } GifImageDesc;
+
++typedef struct ExtensionBlock {
++ int ByteCount;
++ GifByteType *Bytes; /* on malloc(3) heap */
++ int Function; /* The block function code */
++#define CONTINUE_EXT_FUNC_CODE 0x00 /* continuation subblock */
++#define COMMENT_EXT_FUNC_CODE 0xfe /* comment */
++#define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control (GIF89) */
++#define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */
++#define APPLICATION_EXT_FUNC_CODE 0xff /* application block */
++} ExtensionBlock;
++
++typedef struct SavedImage {
++ GifImageDesc ImageDesc;
++ GifByteType *RasterBits; /* on malloc(3) heap */
++ int ExtensionBlockCount; /* Count of extensions before image */
++ ExtensionBlock *ExtensionBlocks; /* Extensions before image */
++} SavedImage;
++
+ typedef struct GifFileType {
+- int SWidth, SHeight, /* Screen dimensions. */
+- SColorResolution, /* How many colors can we generate? */
+- SBackGroundColor; /* I hope you understand this one... */
+- ColorMapObject *SColorMap; /* NULL if not exists. */
+- int ImageCount; /* Number of current image */
+- GifImageDesc Image; /* Block describing current image */
+- struct SavedImage *SavedImages; /* Use this to accumulate file state */
+- VoidPtr UserData; /* hook to attach user data (TVT) */
+- VoidPtr Private; /* Don't mess with this! */
++ GifWord SWidth, SHeight; /* Size of virtual canvas */
++ GifWord SColorResolution; /* How many colors can we generate? */
++ GifWord SBackGroundColor; /* Background color for virtual canvas */
++ GifByteType AspectByte; /* Used to compute pixel aspect ratio */
++ ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */
++ int ImageCount; /* Number of current image (both APIs) */
++ GifImageDesc Image; /* Current image (low-level API) */
++ SavedImage *SavedImages; /* Image sequence (high-level API) */
++ int ExtensionBlockCount; /* Count extensions past last image */
++ ExtensionBlock *ExtensionBlocks; /* Extensions past last image */
++ int Error; /* Last error condition reported */
++ void *UserData; /* hook to attach user data (TVT) */
++ void *Private; /* Don't mess with this! */
+ } GifFileType;
+
++#define GIF_ASPECT_RATIO(n) ((n)+15.0/64.0)
++
+ typedef enum {
+ UNDEFINED_RECORD_TYPE,
+ SCREEN_DESC_RECORD_TYPE,
+@@ -120,58 +124,95 @@
+ TERMINATE_RECORD_TYPE /* Begin with ';' */
+ } GifRecordType;
+
+-/* DumpScreen2Gif routine constants identify type of window/screen to dump.
+- * Note all values below 1000 are reserved for the IBMPC different display
+- * devices (it has many!) and are compatible with the numbering TC2.0
+- * (Turbo C 2.0 compiler for IBM PC) gives to these devices.
+- */
+-typedef enum {
+- GIF_DUMP_SGI_WINDOW = 1000,
+- GIF_DUMP_X_WINDOW = 1001
+-} GifScreenDumpType;
+-
+ /* func type to read gif data from arbitrary sources (TVT) */
+ typedef int (*InputFunc) (GifFileType *, GifByteType *, int);
+
+-/* func type to write gif data ro arbitrary targets.
++/* func type to write gif data to arbitrary targets.
+ * Returns count of bytes written. (MRB)
+ */
+ typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int);
+
+ /******************************************************************************
+- * GIF89 extension function codes
++ GIF89 structures
+ ******************************************************************************/
+
+-#define COMMENT_EXT_FUNC_CODE 0xfe /* comment */
+-#define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control */
+-#define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */
+-#define APPLICATION_EXT_FUNC_CODE 0xff /* application block */
++typedef struct GraphicsControlBlock {
++ int DisposalMode;
++#define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */
++#define DISPOSE_DO_NOT 1 /* Leave image in place */
++#define DISPOSE_BACKGROUND 2 /* Set area too background color */
++#define DISPOSE_PREVIOUS 3 /* Restore to previous content */
++ bool UserInputFlag; /* User confirmation required before disposal */
++ int DelayTime; /* pre-display delay in 0.01sec units */
++ int TransparentColor; /* Palette index for transparency, -1 if none */
++#define NO_TRANSPARENT_COLOR -1
++} GraphicsControlBlock;
+
+ /******************************************************************************
+- * O.K., here are the routines one can access in order to decode GIF file:
+- * (GIF_LIB file DGIF_LIB.C).
+- *****************************************************************************/
++ GIF encoding routines
++******************************************************************************/
+
+-GifFileType *DGifOpenFileName(const char *GifFileName);
+-GifFileType *DGifOpenFileHandle(int GifFileHandle);
+-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc); /* new one
+- * (TVT) */
++/* Main entry points */
++GifFileType *EGifOpenFileName(const char *GifFileName,
++ const bool GifTestExistence, int *Error);
++GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error);
++GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error);
++int EGifSpew(GifFileType * GifFile);
++const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */
++int EGifCloseFile(GifFileType *GifFile, int *ErrorCode);
++
++#define E_GIF_SUCCEEDED 0
++#define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */
++#define E_GIF_ERR_WRITE_FAILED 2
++#define E_GIF_ERR_HAS_SCRN_DSCR 3
++#define E_GIF_ERR_HAS_IMAG_DSCR 4
++#define E_GIF_ERR_NO_COLOR_MAP 5
++#define E_GIF_ERR_DATA_TOO_BIG 6
++#define E_GIF_ERR_NOT_ENOUGH_MEM 7
++#define E_GIF_ERR_DISK_IS_FULL 8
++#define E_GIF_ERR_CLOSE_FAILED 9
++#define E_GIF_ERR_NOT_WRITEABLE 10
++
++/* These are legacy. You probably do not want to call them directly */
++int EGifPutScreenDesc(GifFileType *GifFile,
++ const int GifWidth, const int GifHeight,
++ const int GifColorRes,
++ const int GifBackGround,
++ const ColorMapObject *GifColorMap);
++int EGifPutImageDesc(GifFileType *GifFile,
++ const int GifLeft, const int GifTop,
++ const int GifWidth, const int GifHeight,
++ const bool GifInterlace,
++ const ColorMapObject *GifColorMap);
++void EGifSetGifVersion(GifFileType *GifFile, const bool gif89);
++int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine,
++ int GifLineLen);
++int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel);
++int EGifPutComment(GifFileType *GifFile, const char *GifComment);
++int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode);
++int EGifPutExtensionBlock(GifFileType *GifFile,
++ const int GifExtLen, const void *GifExtension);
++int EGifPutExtensionTrailer(GifFileType *GifFile);
++int EGifPutExtension(GifFileType *GifFile, const int GifExtCode,
++ const int GifExtLen,
++ const void *GifExtension);
++int EGifPutCode(GifFileType *GifFile, int GifCodeSize,
++ const GifByteType *GifCodeBlock);
++int EGifPutCodeNext(GifFileType *GifFile,
++ const GifByteType *GifCodeBlock);
++
++/******************************************************************************
++ GIF decoding routines
++******************************************************************************/
++
++/* Main entry points */
++GifFileType *DGifOpenFileName(const char *GifFileName, int *Error);
++GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error);
+ int DGifSlurp(GifFileType * GifFile);
+-int DGifGetScreenDesc(GifFileType * GifFile);
+-int DGifGetRecordType(GifFileType * GifFile, GifRecordType * GifType);
+-int DGifGetImageDesc(GifFileType * GifFile);
+-int DGifGetLine(GifFileType * GifFile, GifPixelType * GifLine, int GifLineLen);
+-int DGifGetPixel(GifFileType * GifFile, GifPixelType GifPixel);
+-int DGifGetComment(GifFileType * GifFile, char *GifComment);
+-int DGifGetExtension(GifFileType * GifFile, int *GifExtCode,
+- GifByteType ** GifExtension);
+-int DGifGetExtensionNext(GifFileType * GifFile, GifByteType ** GifExtension);
+-int DGifGetCode(GifFileType * GifFile, int *GifCodeSize,
+- GifByteType ** GifCodeBlock);
+-int DGifGetCodeNext(GifFileType * GifFile, GifByteType ** GifCodeBlock);
+-int DGifGetLZCodes(GifFileType * GifFile, int *GifCode);
+-int DGifCloseFile(GifFileType * GifFile);
++GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */
++ int DGifCloseFile(GifFileType * GifFile, int *ErrorCode);
+
++#define D_GIF_SUCCEEDED 0
+ #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */
+ #define D_GIF_ERR_READ_FAILED 102
+ #define D_GIF_ERR_NOT_GIF_FILE 103
+@@ -186,68 +227,113 @@
+ #define D_GIF_ERR_IMAGE_DEFECT 112
+ #define D_GIF_ERR_EOF_TOO_SOON 113
+
++/* These are legacy. You probably do not want to call them directly */
++int DGifGetScreenDesc(GifFileType *GifFile);
++int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
++int DGifGetImageDesc(GifFileType *GifFile);
++int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
++int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel);
++int DGifGetComment(GifFileType *GifFile, char *GifComment);
++int DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
++ GifByteType **GifExtension);
++int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension);
++int DGifGetCode(GifFileType *GifFile, int *GifCodeSize,
++ GifByteType **GifCodeBlock);
++int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
++int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
++
+
+ /******************************************************************************
+- * O.K., here are the routines from GIF_LIB file GIF_ERR.C.
++ Color table quantization (deprecated)
+ ******************************************************************************/
+-extern void PrintGifError(void);
+-extern int GifLastError(void);
++int GifQuantizeBuffer(unsigned int Width, unsigned int Height,
++ int *ColorMapSize, GifByteType * RedInput,
++ GifByteType * GreenInput, GifByteType * BlueInput,
++ GifByteType * OutputBuffer,
++ GifColorType * OutputColorMap);
+
+ /******************************************************************************
+- * O.K., here are the routines from GIF_LIB file DEV2GIF.C.
++ Error handling and reporting.
+ ******************************************************************************/
+-extern int DumpScreen2Gif(const char *FileName,
+- int ReqGraphDriver,
+- long ReqGraphMode1,
+- long ReqGraphMode2,
+- long ReqGraphMode3);
++extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
+
+ /*****************************************************************************
+- *
+- * Everything below this point is new after version 1.2, supporting `slurp
+- * mode' for doing I/O in two big belts with all the image-bashing in core.
+- *
+- *****************************************************************************/
++ Everything below this point is new after version 1.2, supporting `slurp
++ mode' for doing I/O in two big belts with all the image-bashing in core.
++******************************************************************************/
+
+ /******************************************************************************
+- * Color Map handling from ALLOCGIF.C
+- *****************************************************************************/
++ Color map handling from gif_alloc.c
++******************************************************************************/
+
+-extern ColorMapObject *MakeMapObject(int ColorCount,
+- const GifColorType * ColorMap);
+-extern void FreeMapObject(ColorMapObject * Object);
+-extern int BitSize(int n);
++extern ColorMapObject *GifMakeMapObject(int ColorCount,
++ const GifColorType *ColorMap);
++extern void GifFreeMapObject(ColorMapObject *Object);
++extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1,
++ const ColorMapObject *ColorIn2,
++ GifPixelType ColorTransIn2[]);
++extern int GifBitSize(int n);
+
+ /******************************************************************************
+- * Support for the in-core structures allocation (slurp mode).
+- *****************************************************************************/
++ Support for the in-core structures allocation (slurp mode).
++******************************************************************************/
+
+-/* This is the in-core version of an extension record */
+-typedef struct {
+- int ByteCount;
+- char *Bytes; /* on malloc(3) heap */
+- int Function; /* Holds the type of the Extension block. */
+-} ExtensionBlock;
++extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]);
++extern int GifAddExtensionBlock(int *ExtensionBlock_Count,
++ ExtensionBlock **ExtensionBlocks,
++ int Function,
++ unsigned int Len, unsigned char ExtData[]);
++extern void GifFreeExtensions(int *ExtensionBlock_Count,
++ ExtensionBlock **ExtensionBlocks);
++extern SavedImage *GifMakeSavedImage(GifFileType *GifFile,
++ const SavedImage *CopyFrom);
++extern void GifFreeSavedImages(GifFileType *GifFile);
+
+-/* This holds an image header, its unpacked raster bits, and extensions */
+-typedef struct SavedImage {
+- GifImageDesc ImageDesc;
+- unsigned char *RasterBits; /* on malloc(3) heap */
+- int Function; /* DEPRECATED: Use ExtensionBlocks[x].Function instead */
+- int ExtensionBlockCount;
+- ExtensionBlock *ExtensionBlocks; /* on malloc(3) heap */
+-} SavedImage;
++/******************************************************************************
++ 5.x functions for GIF89 graphics control blocks
++******************************************************************************/
+
+-extern void MakeExtension(SavedImage * New, int Function);
+-extern int AddExtensionBlock(SavedImage * New, int Len,
+- unsigned char ExtData[]);
+-extern void FreeExtension(SavedImage * Image);
+-extern SavedImage *MakeSavedImage(GifFileType * GifFile,
+- const SavedImage * CopyFrom);
+-extern void FreeSavedImages(GifFileType * GifFile);
++int DGifExtensionToGCB(const size_t GifExtensionLength,
++ const GifByteType *GifExtension,
++ GraphicsControlBlock *GCB);
++size_t EGifGCBToExtension(const GraphicsControlBlock *GCB,
++ GifByteType *GifExtension);
+
++int DGifSavedExtensionToGCB(GifFileType *GifFile,
++ int ImageIndex,
++ GraphicsControlBlock *GCB);
++int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB,
++ GifFileType *GifFile,
++ int ImageIndex);
++
++/******************************************************************************
++ The library's internal utility font
++******************************************************************************/
++
++#define GIF_FONT_WIDTH 8
++#define GIF_FONT_HEIGHT 8
++extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH];
++
++extern void GifDrawText8x8(SavedImage *Image,
++ const int x, const int y,
++ const char *legend, const int color);
++
++extern void GifDrawBox(SavedImage *Image,
++ const int x, const int y,
++ const int w, const int d, const int color);
++
++extern void GifDrawRectangle(SavedImage *Image,
++ const int x, const int y,
++ const int w, const int d, const int color);
++
++extern void GifDrawBoxedText8x8(SavedImage *Image,
++ const int x, const int y,
++ const char *legend,
++ const int border, const int bg, const int fg);
+
+ #ifdef __cplusplus
+ }
+ #endif /* __cplusplus */
+ #endif /* _GIF_LIB_H */
++
++/* end */
+--- ./jdk/src/share/native/sun/awt/giflib/gif_lib_private.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/awt/giflib/gif_lib_private.h Wed Jul 01 21:53:30 2015 -0700
+@@ -22,21 +22,21 @@
+ * questions.
+ */
+
++/****************************************************************************
++
++gif_lib_private.h - internal giflib routines and structures
++
++****************************************************************************/
++
+ #ifndef _GIF_LIB_PRIVATE_H
+ #define _GIF_LIB_PRIVATE_H
+
+ #include "gif_lib.h"
++#include "gif_hash.h"
+
+-#define PROGRAM_NAME "LIBUNGIF"
+-
+-#ifdef SYSV
+-#define VersionStr "Gif library module,\t\tEric S. Raymond\n\
+- (C) Copyright 1997 Eric S. Raymond\n"
+-#else
+-#define VersionStr PROGRAM_NAME " IBMPC " GIF_LIB_VERSION \
+- " Eric S. Raymond, " __DATE__ ", " \
+- __TIME__ "\n" "(C) Copyright 1997 Eric S. Raymond\n"
+-#endif /* SYSV */
++#define EXTENSION_INTRODUCER 0x21
++#define DESCRIPTOR_INTRODUCER 0x2c
++#define TERMINATOR_INTRODUCER 0x3b
+
+ #define LZ_MAX_CODE 4095 /* Biggest code possible in 12 bits. */
+ #define LZ_BITS 12
+@@ -54,7 +54,7 @@
+ #define IS_WRITEABLE(Private) (Private->FileState & FILE_STATE_WRITE)
+
+ typedef struct GifFilePrivateType {
+- int FileState, FileHandle, /* Where all this data goes to! */
++ GifWord FileState, FileHandle, /* Where all this data goes to! */
+ BitsPerPixel, /* Bits per pixel (Codes uses at least this + 1). */
+ ClearCode, /* The CLEAR LZ code. */
+ EOFCode, /* The EOF LZ code. */
+@@ -73,9 +73,11 @@
+ GifByteType Buf[256]; /* Compressed input is buffered here. */
+ GifByteType Stack[LZ_MAX_CODE]; /* Decoded pixels are stacked here. */
+ GifByteType Suffix[LZ_MAX_CODE + 1]; /* So we can trace the codes. */
+- unsigned int Prefix[LZ_MAX_CODE + 1];
++ GifPrefixType Prefix[LZ_MAX_CODE + 1];
++ GifHashTableType *HashTable;
++ bool gif89;
+ } GifFilePrivateType;
+
+-extern int _GifError;
++#endif /* _GIF_LIB_PRIVATE_H */
+
+-#endif /* _GIF_LIB_PRIVATE_H */
++/* end */
+--- ./jdk/src/share/native/sun/awt/giflib/gifalloc.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/awt/giflib/gifalloc.c Wed Jul 01 21:53:30 2015 -0700
+@@ -23,36 +23,27 @@
+ */
+
+ /*****************************************************************************
+- * "Gif-Lib" - Yet another gif library.
+- *
+- * Written by: Gershon Elber Ver 0.1, Jun. 1989
+- * Extensively hacked by: Eric S. Raymond Ver 1.?, Sep 1992
+- *****************************************************************************
+- * GIF construction tools
+- *****************************************************************************
+- * History:
+- * 15 Sep 92 - Version 1.0 by Eric Raymond.
+- ****************************************************************************/
+
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#endif
++ GIF construction tools
++
++****************************************************************************/
+
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++
+ #include "gif_lib.h"
+
+ #define MAX(x, y) (((x) > (y)) ? (x) : (y))
+
+ /******************************************************************************
+- * Miscellaneous utility functions
+- *****************************************************************************/
++ Miscellaneous utility functions
++******************************************************************************/
+
+ /* return smallest bitfield size n will fit in */
+ int
+-BitSize(int n) {
+-
++GifBitSize(int n)
++{
+ register int i;
+
+ for (i = 1; i <= 8; i++)
+@@ -62,22 +53,21 @@
+ }
+
+ /******************************************************************************
+- * Color map object functions
+- *****************************************************************************/
++ Color map object functions
++******************************************************************************/
+
+ /*
+ * Allocate a color map of given size; initialize with contents of
+ * ColorMap if that pointer is non-NULL.
+ */
+ ColorMapObject *
+-MakeMapObject(int ColorCount,
+- const GifColorType * ColorMap) {
+-
++GifMakeMapObject(int ColorCount, const GifColorType *ColorMap)
++{
+ ColorMapObject *Object;
+
+ /*** FIXME: Our ColorCount has to be a power of two. Is it necessary to
+ * make the user know that or should we automatically round up instead? */
+- if (ColorCount != (1 << BitSize(ColorCount))) {
++ if (ColorCount != (1 << GifBitSize(ColorCount))) {
+ return ((ColorMapObject *) NULL);
+ }
+
+@@ -93,9 +83,10 @@
+ }
+
+ Object->ColorCount = ColorCount;
+- Object->BitsPerPixel = BitSize(ColorCount);
++ Object->BitsPerPixel = GifBitSize(ColorCount);
++ Object->SortFlag = false;
+
+- if (ColorMap) {
++ if (ColorMap != NULL) {
+ memcpy((char *)Object->Colors,
+ (char *)ColorMap, ColorCount * sizeof(GifColorType));
+ }
+@@ -103,118 +94,222 @@
+ return (Object);
+ }
+
+-/*
+- * Free a color map object
+- */
++/*******************************************************************************
++Free a color map object
++*******************************************************************************/
+ void
+-FreeMapObject(ColorMapObject * Object) {
+-
++GifFreeMapObject(ColorMapObject *Object)
++{
+ if (Object != NULL) {
+- free(Object->Colors);
+- free(Object);
+- Object = NULL;
++ (void)free(Object->Colors);
++ (void)free(Object);
+ }
+ }
+
+ #ifdef DEBUG
+ void
+-DumpColorMap(ColorMapObject * Object,
+- FILE * fp) {
+-
+- if (Object) {
++DumpColorMap(ColorMapObject *Object,
++ FILE * fp)
++{
++ if (Object != NULL) {
+ int i, j, Len = Object->ColorCount;
+
+ for (i = 0; i < Len; i += 4) {
+ for (j = 0; j < 4 && j < Len; j++) {
+- fprintf(fp, "%3d: %02x %02x %02x ", i + j,
+- Object->Colors[i + j].Red,
+- Object->Colors[i + j].Green,
+- Object->Colors[i + j].Blue);
++ (void)fprintf(fp, "%3d: %02x %02x %02x ", i + j,
++ Object->Colors[i + j].Red,
++ Object->Colors[i + j].Green,
++ Object->Colors[i + j].Blue);
+ }
+- fprintf(fp, "\n");
++ (void)fprintf(fp, "\n");
+ }
+ }
+ }
+ #endif /* DEBUG */
+
+-/******************************************************************************
+- * Extension record functions
+- *****************************************************************************/
++/*******************************************************************************
++ Compute the union of two given color maps and return it. If result can't
++ fit into 256 colors, NULL is returned, the allocated union otherwise.
++ ColorIn1 is copied as is to ColorUnion, while colors from ColorIn2 are
++ copied iff they didn't exist before. ColorTransIn2 maps the old
++ ColorIn2 into the ColorUnion color map table./
++*******************************************************************************/
++ColorMapObject *
++GifUnionColorMap(const ColorMapObject *ColorIn1,
++ const ColorMapObject *ColorIn2,
++ GifPixelType ColorTransIn2[])
++{
++ int i, j, CrntSlot, RoundUpTo, NewGifBitSize;
++ ColorMapObject *ColorUnion;
+
+-void
+-MakeExtension(SavedImage * New,
+- int Function) {
++ /*
++ * We don't worry about duplicates within either color map; if
++ * the caller wants to resolve those, he can perform unions
++ * with an empty color map.
++ */
+
+- New->Function = Function;
+- /*** FIXME:
+- * Someday we might have to deal with multiple extensions.
+- * ??? Was this a note from Gershon or from me? Does the multiple
+- * extension blocks solve this or do we need multiple Functions? Or is
+- * this an obsolete function? (People should use AddExtensionBlock
+- * instead?)
+- * Looks like AddExtensionBlock needs to take the int Function argument
+- * then it can take the place of this function. Right now people have to
+- * use both. Fix AddExtensionBlock and add this to the deprecation list.
++ /* Allocate table which will hold the result for sure. */
++ ColorUnion = GifMakeMapObject(MAX(ColorIn1->ColorCount,
++ ColorIn2->ColorCount) * 2, NULL);
++
++ if (ColorUnion == NULL)
++ return (NULL);
++
++ /*
++ * Copy ColorIn1 to ColorUnion.
+ */
++ for (i = 0; i < ColorIn1->ColorCount; i++)
++ ColorUnion->Colors[i] = ColorIn1->Colors[i];
++ CrntSlot = ColorIn1->ColorCount;
++
++ /*
++ * Potentially obnoxious hack:
++ *
++ * Back CrntSlot down past all contiguous {0, 0, 0} slots at the end
++ * of table 1. This is very useful if your display is limited to
++ * 16 colors.
++ */
++ while (ColorIn1->Colors[CrntSlot - 1].Red == 0
++ && ColorIn1->Colors[CrntSlot - 1].Green == 0
++ && ColorIn1->Colors[CrntSlot - 1].Blue == 0)
++ CrntSlot--;
++
++ /* Copy ColorIn2 to ColorUnion (use old colors if they exist): */
++ for (i = 0; i < ColorIn2->ColorCount && CrntSlot <= 256; i++) {
++ /* Let's see if this color already exists: */
++ for (j = 0; j < ColorIn1->ColorCount; j++)
++ if (memcmp (&ColorIn1->Colors[j], &ColorIn2->Colors[i],
++ sizeof(GifColorType)) == 0)
++ break;
++
++ if (j < ColorIn1->ColorCount)
++ ColorTransIn2[i] = j; /* color exists in Color1 */
++ else {
++ /* Color is new - copy it to a new slot: */
++ ColorUnion->Colors[CrntSlot] = ColorIn2->Colors[i];
++ ColorTransIn2[i] = CrntSlot++;
++ }
++ }
++
++ if (CrntSlot > 256) {
++ GifFreeMapObject(ColorUnion);
++ return ((ColorMapObject *) NULL);
++ }
++
++ NewGifBitSize = GifBitSize(CrntSlot);
++ RoundUpTo = (1 << NewGifBitSize);
++
++ if (RoundUpTo != ColorUnion->ColorCount) {
++ register GifColorType *Map = ColorUnion->Colors;
++
++ /*
++ * Zero out slots up to next power of 2.
++ * We know these slots exist because of the way ColorUnion's
++ * start dimension was computed.
++ */
++ for (j = CrntSlot; j < RoundUpTo; j++)
++ Map[j].Red = Map[j].Green = Map[j].Blue = 0;
++
++ /* perhaps we can shrink the map? */
++ if (RoundUpTo < ColorUnion->ColorCount) {
++ GifColorType *new_map = (GifColorType *)realloc(Map,
++ sizeof(GifColorType) * RoundUpTo);
++ if( new_map == NULL ) {
++ GifFreeMapObject(ColorUnion);
++ return ((ColorMapObject *) NULL);
++ }
++ ColorUnion->Colors = new_map;
++ }
++ }
++
++ ColorUnion->ColorCount = RoundUpTo;
++ ColorUnion->BitsPerPixel = NewGifBitSize;
++
++ return (ColorUnion);
+ }
+
++/*******************************************************************************
++ Apply a given color translation to the raster bits of an image
++*******************************************************************************/
++void
++GifApplyTranslation(SavedImage *Image, GifPixelType Translation[])
++{
++ register int i;
++ register int RasterSize = Image->ImageDesc.Height * Image->ImageDesc.Width;
++
++ for (i = 0; i < RasterSize; i++)
++ Image->RasterBits[i] = Translation[Image->RasterBits[i]];
++}
++
++/******************************************************************************
++ Extension record functions
++******************************************************************************/
+ int
+-AddExtensionBlock(SavedImage * New,
+- int Len,
+- unsigned char ExtData[]) {
+-
++GifAddExtensionBlock(int *ExtensionBlockCount,
++ ExtensionBlock **ExtensionBlocks,
++ int Function,
++ unsigned int Len,
++ unsigned char ExtData[])
++{
+ ExtensionBlock *ep;
+
+- if (New->ExtensionBlocks == NULL)
+- New->ExtensionBlocks=(ExtensionBlock *)malloc(sizeof(ExtensionBlock));
+- else
+- New->ExtensionBlocks = (ExtensionBlock *)realloc(New->ExtensionBlocks,
++ if (*ExtensionBlocks == NULL)
++ *ExtensionBlocks=(ExtensionBlock *)malloc(sizeof(ExtensionBlock));
++ else {
++ ExtensionBlock* ep_new = (ExtensionBlock *)realloc(*ExtensionBlocks,
+ sizeof(ExtensionBlock) *
+- (New->ExtensionBlockCount + 1));
++ (*ExtensionBlockCount + 1));
++ if( ep_new == NULL )
++ return (GIF_ERROR);
++ *ExtensionBlocks = ep_new;
++ }
+
+- if (New->ExtensionBlocks == NULL)
++ if (*ExtensionBlocks == NULL)
+ return (GIF_ERROR);
+
+- ep = &New->ExtensionBlocks[New->ExtensionBlockCount++];
++ ep = &(*ExtensionBlocks)[(*ExtensionBlockCount)++];
+
++ ep->Function = Function;
+ ep->ByteCount=Len;
+- ep->Bytes = (char *)malloc(ep->ByteCount);
++ ep->Bytes = (GifByteType *)malloc(ep->ByteCount);
+ if (ep->Bytes == NULL)
+ return (GIF_ERROR);
+
+- if (ExtData) {
++ if (ExtData != NULL) {
+ memcpy(ep->Bytes, ExtData, Len);
+- ep->Function = New->Function;
+ }
+
+ return (GIF_OK);
+ }
+
+ void
+-FreeExtension(SavedImage * Image)
++GifFreeExtensions(int *ExtensionBlockCount,
++ ExtensionBlock **ExtensionBlocks)
+ {
+ ExtensionBlock *ep;
+
+- if ((Image == NULL) || (Image->ExtensionBlocks == NULL)) {
++ if (*ExtensionBlocks == NULL)
+ return;
+- }
+- for (ep = Image->ExtensionBlocks;
+- ep < (Image->ExtensionBlocks + Image->ExtensionBlockCount); ep++)
++
++ for (ep = *ExtensionBlocks;
++ ep < (*ExtensionBlocks + *ExtensionBlockCount);
++ ep++)
+ (void)free((char *)ep->Bytes);
+- free((char *)Image->ExtensionBlocks);
+- Image->ExtensionBlocks = NULL;
++ (void)free((char *)*ExtensionBlocks);
++ *ExtensionBlocks = NULL;
++ *ExtensionBlockCount = 0;
+ }
+
+ /******************************************************************************
+- * Image block allocation functions
++ Image block allocation functions
+ ******************************************************************************/
+
+ /* Private Function:
+ * Frees the last image in the GifFile->SavedImages array
+ */
+ void
+-FreeLastSavedImage(GifFileType *GifFile) {
+-
++FreeLastSavedImage(GifFileType *GifFile)
++{
+ SavedImage *sp;
+
+ if ((GifFile == NULL) || (GifFile->SavedImages == NULL))
+@@ -225,20 +320,21 @@
+ sp = &GifFile->SavedImages[GifFile->ImageCount];
+
+ /* Deallocate its Colormap */
+- if (sp->ImageDesc.ColorMap)
+- FreeMapObject(sp->ImageDesc.ColorMap);
++ if (sp->ImageDesc.ColorMap != NULL) {
++ GifFreeMapObject(sp->ImageDesc.ColorMap);
++ sp->ImageDesc.ColorMap = NULL;
++ }
+
+ /* Deallocate the image data */
+- if (sp->RasterBits)
++ if (sp->RasterBits != NULL)
+ free((char *)sp->RasterBits);
+
+ /* Deallocate any extensions */
+- if (sp->ExtensionBlocks)
+- FreeExtension(sp);
++ GifFreeExtensions(&sp->ExtensionBlockCount, &sp->ExtensionBlocks);
+
+ /*** FIXME: We could realloc the GifFile->SavedImages structure but is
+ * there a point to it? Saves some memory but we'd have to do it every
+- * time. If this is used in FreeSavedImages then it would be inefficient
++ * time. If this is used in GifFreeSavedImages then it would be inefficient
+ * (The whole array is going to be deallocated.) If we just use it when
+ * we want to free the last Image it's convenient to do it here.
+ */
+@@ -248,11 +344,8 @@
+ * Append an image block to the SavedImages array
+ */
+ SavedImage *
+-MakeSavedImage(GifFileType * GifFile,
+- const SavedImage * CopyFrom) {
+-
+- SavedImage *sp;
+-
++GifMakeSavedImage(GifFileType *GifFile, const SavedImage *CopyFrom)
++{
+ if (GifFile->SavedImages == NULL)
+ GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
+ else
+@@ -262,10 +355,10 @@
+ if (GifFile->SavedImages == NULL)
+ return ((SavedImage *)NULL);
+ else {
+- sp = &GifFile->SavedImages[GifFile->ImageCount++];
++ SavedImage *sp = &GifFile->SavedImages[GifFile->ImageCount++];
+ memset((char *)sp, '\0', sizeof(SavedImage));
+
+- if (CopyFrom) {
++ if (CopyFrom != NULL) {
+ memcpy((char *)sp, CopyFrom, sizeof(SavedImage));
+
+ /*
+@@ -275,8 +368,8 @@
+ */
+
+ /* first, the local color map */
+- if (sp->ImageDesc.ColorMap) {
+- sp->ImageDesc.ColorMap = MakeMapObject(
++ if (sp->ImageDesc.ColorMap != NULL) {
++ sp->ImageDesc.ColorMap = GifMakeMapObject(
+ CopyFrom->ImageDesc.ColorMap->ColorCount,
+ CopyFrom->ImageDesc.ColorMap->Colors);
+ if (sp->ImageDesc.ColorMap == NULL) {
+@@ -298,7 +391,7 @@
+ CopyFrom->ImageDesc.Width);
+
+ /* finally, the extension blocks */
+- if (sp->ExtensionBlocks) {
++ if (sp->ExtensionBlocks != NULL) {
+ sp->ExtensionBlocks = (ExtensionBlock *)malloc(
+ sizeof(ExtensionBlock) *
+ CopyFrom->ExtensionBlockCount);
+@@ -308,17 +401,6 @@
+ }
+ memcpy(sp->ExtensionBlocks, CopyFrom->ExtensionBlocks,
+ sizeof(ExtensionBlock) * CopyFrom->ExtensionBlockCount);
+-
+- /*
+- * For the moment, the actual blocks can take their
+- * chances with free(). We'll fix this later.
+- *** FIXME: [Better check this out... Toshio]
+- * 2004 May 27: Looks like this was an ESR note.
+- * It means the blocks are shallow copied from InFile to
+- * OutFile. However, I don't see that in this code....
+- * Did ESR fix it but never remove this note (And other notes
+- * in gifspnge?)
+- */
+ }
+ }
+
+@@ -327,8 +409,8 @@
+ }
+
+ void
+-FreeSavedImages(GifFileType * GifFile) {
+-
++GifFreeSavedImages(GifFileType *GifFile)
++{
+ SavedImage *sp;
+
+ if ((GifFile == NULL) || (GifFile->SavedImages == NULL)) {
+@@ -336,15 +418,18 @@
+ }
+ for (sp = GifFile->SavedImages;
+ sp < GifFile->SavedImages + GifFile->ImageCount; sp++) {
+- if (sp->ImageDesc.ColorMap)
+- FreeMapObject(sp->ImageDesc.ColorMap);
++ if (sp->ImageDesc.ColorMap != NULL) {
++ GifFreeMapObject(sp->ImageDesc.ColorMap);
++ sp->ImageDesc.ColorMap = NULL;
++ }
+
+- if (sp->RasterBits)
++ if (sp->RasterBits != NULL)
+ free((char *)sp->RasterBits);
+
+- if (sp->ExtensionBlocks)
+- FreeExtension(sp);
++ GifFreeExtensions(&sp->ExtensionBlockCount, &sp->ExtensionBlocks);
+ }
+ free((char *)GifFile->SavedImages);
+- GifFile->SavedImages=NULL;
++ GifFile->SavedImages = NULL;
+ }
++
++/* end */
+--- ./jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Wed Jul 01 21:53:30 2015 -0700
+@@ -2778,6 +2778,14 @@
+ pb = &data->pixelBuf;
+
+ if (setPixelBuffer(env, pb, buffer) == NOT_OK) {
++ if (scale != NULL) {
++ for (i = 0; i < numBands; i++) {
++ if (scale[i] != NULL) {
++ free(scale[i]);
++ }
++ }
++ free(scale);
++ }
+ return data->abortFlag; // We already threw an out of memory exception
+ }
+
+--- ./jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c Wed Jul 01 21:53:30 2015 -0700
+@@ -213,16 +213,16 @@
+ byte_t *pSrc = image->RasterBits;
+ ImageFormat srcFormat;
+ ImageRect srcRect, dstRect;
+- int pass, npass;
++ int pass = 4, npass = 5;
+
++#if GIFLIB_MAJOR < 5
++ /* Interlaced gif support is broken in giflib < 5
++ so we need to work around this */
+ if (desc->Interlace) {
+ pass = 0;
+ npass = 4;
+ }
+- else {
+- pass = 4;
+- npass = 5;
+- }
++#endif
+
+ srcFormat.colorMap = colorMapBuf;
+ srcFormat.depthBytes = 1;
+@@ -310,7 +310,13 @@
+ free(pBitmapBits);
+ free(pOldBitmapBits);
+
++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
++ if (DGifCloseFile(gif, NULL) == GIF_ERROR) {
++ return 0;
++ }
++#else
+ DGifCloseFile(gif);
++#endif
+
+ return 1;
+ }
+@@ -318,7 +324,11 @@
+ int
+ SplashDecodeGifStream(Splash * splash, SplashStream * stream)
+ {
++#if GIFLIB_MAJOR >= 5
++ GifFileType *gif = DGifOpen((void *) stream, SplashStreamGifInputFunc, NULL);
++#else
+ GifFileType *gif = DGifOpen((void *) stream, SplashStreamGifInputFunc);
++#endif
+
+ if (!gif)
+ return 0;
+--- ./jdk/src/share/native/sun/font/freetypeScaler.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/freetypeScaler.c Wed Jul 01 21:53:30 2015 -0700
+@@ -147,20 +147,6 @@
+
+ #define FILEDATACACHESIZE 1024
+
+-/* NB: is it ever called? */
+-static void CloseTTFontFileFunc(FT_Stream stream) {
+- FTScalerInfo *scalerInfo = (FTScalerInfo *) stream->pathname.pointer;
+- JNIEnv* env = scalerInfo->env;
+- jclass tmpClass = (*env)->FindClass(env, "sun/font/TrueTypeFont");
+- jfieldID platNameField =
+- (*env)->GetFieldID(env, tmpClass, "platName", "Ljava/lang/String;");
+- jstring platName = (*env)->GetObjectField(env,
+- scalerInfo->font2D,
+- platNameField);
+- const char *name = JNU_GetStringPlatformChars(env, platName, NULL);
+- JNU_ReleaseStringPlatformChars(env, platName, name);
+-}
+-
+ static unsigned long ReadTTFontFileFunc(FT_Stream stream,
+ unsigned long offset,
+ unsigned char* destBuffer,
+@@ -305,7 +291,7 @@
+ ftstream->size = filesize;
+ ftstream->pos = 0;
+ ftstream->read = (FT_Stream_IoFunc) ReadTTFontFileFunc;
+- ftstream->close = (FT_Stream_CloseFunc) CloseTTFontFileFunc;
++ ftstream->close = NULL;
+ ftstream->pathname.pointer = (void *) scalerInfo;
+
+ memset(&ft_open_args, 0, sizeof(FT_Open_Args));
+@@ -425,7 +411,6 @@
+ jobject metrics;
+ jfloat ax, ay, dx, dy, bx, by, lx, ly, mx, my;
+ jfloat f0 = 0.0;
+- FT_Pos bmodifier = 0;
+ FTScalerContext *context =
+ (FTScalerContext*) jlong_to_ptr(pScalerContext);
+ FTScalerInfo *scalerInfo =
+@@ -458,43 +443,38 @@
+ So, we have to do adust them explicitly and stay consistent with what
+ freetype does to outlines. */
+
+- /* For bolding glyphs are not just widened. Height is also changed
+- (see ftsynth.c).
+-
+- TODO: In vertical direction we could do better job and adjust metrics
+- proportionally to glyoh shape. */
+- if (context->doBold) {
+- bmodifier = FT_MulFix(
+- scalerInfo->face->units_per_EM,
+- scalerInfo->face->size->metrics.y_scale)/24;
+- }
+-
+
+ /**** Note: only some metrics are affected by styling ***/
+
++ /* See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657854 */
++#define FT_MulFixFloatShift6(a, b) (((float) (a)) * ((float) (b)) / 65536.0 / 64.0)
++
++ /*
++ * See FreeType source code: src/base/ftobjs.c ft_recompute_scaled_metrics()
++ * http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1659
++ */
+ /* ascent */
+ ax = 0;
+- ay = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
+- ((jlong) scalerInfo->face->ascender + bmodifier/2),
++ ay = -(jfloat) (FT_MulFixFloatShift6(
++ ((jlong) scalerInfo->face->ascender),
+ (jlong) scalerInfo->face->size->metrics.y_scale));
+ /* descent */
+ dx = 0;
+- dy = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
+- ((jlong) scalerInfo->face->descender + bmodifier/2),
++ dy = -(jfloat) (FT_MulFixFloatShift6(
++ ((jlong) scalerInfo->face->descender),
+ (jlong) scalerInfo->face->size->metrics.y_scale));
+ /* baseline */
+ bx = by = 0;
+
+ /* leading */
+ lx = 0;
+- ly = (jfloat) FT26Dot6ToFloat(FT_MulFix(
+- (jlong) scalerInfo->face->height + bmodifier,
++ ly = (jfloat) (FT_MulFixFloatShift6(
++ (jlong) scalerInfo->face->height,
+ (jlong) scalerInfo->face->size->metrics.y_scale))
+ + ay - dy;
+ /* max advance */
+ mx = (jfloat) FT26Dot6ToFloat(
+ scalerInfo->face->size->metrics.max_advance +
+- 2*bmodifier +
+ OBLIQUE_MODIFIER(scalerInfo->face->size->metrics.height));
+ my = 0;
+
+--- ./jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -53,7 +53,6 @@
+ Offset alternateSetTableOffset = SWAPW(alternateSetTableOffsetArray[coverageIndex]);
+ const LEReferenceTo<AlternateSetTable> alternateSetTable(base, success,
+ (const AlternateSetTable *) ((char *) this + alternateSetTableOffset));
+- if (!LE_SUCCESS(success)) return 0;
+ TTGlyphID alternate = SWAPW(alternateSetTable->alternateArray[0]);
+
+ if (filter == NULL || filter->accept(LE_SET_GLYPH(glyph, alternate), success)) {
+--- ./jdk/src/share/native/sun/font/layout/AnchorTables.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/AnchorTables.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -44,27 +44,21 @@
+ case 1:
+ {
+ LEReferenceTo<Format1AnchorTable> f1(base, success);
+- if (LE_SUCCESS(success)) {
+- f1->getAnchor(f1, fontInstance, anchor, success);
+- }
++ f1->getAnchor(f1, fontInstance, anchor, success);
+ break;
+ }
+
+ case 2:
+ {
+ LEReferenceTo<Format2AnchorTable> f2(base, success);
+- if (LE_SUCCESS(success)) {
+- f2->getAnchor(f2, glyphID, fontInstance, anchor, success);
+- }
++ f2->getAnchor(f2, glyphID, fontInstance, anchor, success);
+ break;
+ }
+
+ case 3:
+ {
+ LEReferenceTo<Format3AnchorTable> f3(base, success);
+- if (LE_SUCCESS(success)) {
+- f3->getAnchor(f3, fontInstance, anchor, success);
+- }
++ f3->getAnchor(f3, fontInstance, anchor, success);
+ break;
+ }
+
+@@ -72,9 +66,7 @@
+ {
+ // unknown format: just use x, y coordinate, like format 1...
+ LEReferenceTo<Format1AnchorTable> f1(base, success);
+- if (LE_SUCCESS(success)) {
+- f1->getAnchor(f1, fontInstance, anchor, success);
+- }
++ f1->getAnchor(f1, fontInstance, anchor, success);
+ break;
+ }
+ }
+@@ -120,18 +112,16 @@
+
+ if (dtxOffset != 0) {
+ LEReferenceTo<DeviceTable> dt(base, success, dtxOffset);
+- if (LE_SUCCESS(success)) {
+- le_int16 adjx = dt->getAdjustment(dt, (le_int16) fontInstance->getXPixelsPerEm(), success);
+- pixels.fX += adjx;
+- }
++ le_int16 adjx = dt->getAdjustment(dt, (le_int16) fontInstance->getXPixelsPerEm(), success);
++
++ pixels.fX += adjx;
+ }
+
+ if (dtyOffset != 0) {
+ LEReferenceTo<DeviceTable> dt(base, success, dtyOffset);
+- if (LE_SUCCESS(success)) {
+- le_int16 adjy = dt->getAdjustment(dt, (le_int16) fontInstance->getYPixelsPerEm(), success);
+- pixels.fY += adjy;
+- }
++ le_int16 adjy = dt->getAdjustment(dt, (le_int16) fontInstance->getYPixelsPerEm(), success);
++
++ pixels.fY += adjy;
+ }
+
+ fontInstance->pixelsToUnits(pixels, anchor);
+--- ./jdk/src/share/native/sun/font/layout/ContextualGlyphInsertionProc2.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/ContextualGlyphInsertionProc2.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -107,10 +107,6 @@
+
+ le_int16 markIndex = SWAPW(entry->markedInsertionListIndex);
+ if (markIndex > 0) {
+- if (markGlyph < 0 || markGlyph >= glyphStorage.getGlyphCount()) {
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
+ le_int16 count = (flags & cgiMarkedInsertCountMask) >> 5;
+ le_bool isKashidaLike = (flags & cgiMarkedIsKashidaLike);
+ le_bool isBefore = (flags & cgiMarkInsertBefore);
+@@ -119,10 +115,6 @@
+
+ le_int16 currIndex = SWAPW(entry->currentInsertionListIndex);
+ if (currIndex > 0) {
+- if (currGlyph < 0 || currGlyph >= glyphStorage.getGlyphCount()) {
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
+ le_int16 count = flags & cgiCurrentInsertCountMask;
+ le_bool isKashidaLike = (flags & cgiCurrentIsKashidaLike);
+ le_bool isBefore = (flags & cgiCurrentInsertBefore);
+--- ./jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -76,10 +76,6 @@
+ WordOffset currOffset = SWAPW(entry->currOffset);
+
+ if (markOffset != 0 && LE_SUCCESS(success)) {
+- if (markGlyph < 0 || markGlyph >= glyphStorage.getGlyphCount()) {
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
+ LEGlyphID mGlyph = glyphStorage[markGlyph];
+ TTGlyphID newGlyph = SWAPW(int16Table.getObject(markOffset + LE_GET_GLYPH(mGlyph), success)); // whew.
+
+@@ -87,10 +83,6 @@
+ }
+
+ if (currOffset != 0) {
+- if (currGlyph < 0 || currGlyph >= glyphStorage.getGlyphCount()) {
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
+ LEGlyphID thisGlyph = glyphStorage[currGlyph];
+ TTGlyphID newGlyph = SWAPW(int16Table.getObject(currOffset + LE_GET_GLYPH(thisGlyph), success)); // whew.
+
+--- ./jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc2.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc2.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -70,25 +70,17 @@
+ if(LE_FAILURE(success)) return 0;
+ le_uint16 newState = SWAPW(entry->newStateIndex);
+ le_uint16 flags = SWAPW(entry->flags);
+- le_uint16 markIndex = SWAPW(entry->markIndex);
+- le_uint16 currIndex = SWAPW(entry->currIndex);
++ le_int16 markIndex = SWAPW(entry->markIndex);
++ le_int16 currIndex = SWAPW(entry->currIndex);
+
+- if (markIndex != 0x0FFFF) {
+- if (markGlyph < 0 || markGlyph >= glyphStorage.getGlyphCount()) {
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
++ if (markIndex != -1) {
+ le_uint32 offset = SWAPL(perGlyphTable(markIndex, success));
+ LEGlyphID mGlyph = glyphStorage[markGlyph];
+ TTGlyphID newGlyph = lookup(offset, mGlyph, success);
+ glyphStorage[markGlyph] = LE_SET_GLYPH(mGlyph, newGlyph);
+ }
+
+- if (currIndex != 0x0FFFF) {
+- if (currGlyph < 0 || currGlyph >= glyphStorage.getGlyphCount()) {
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
++ if (currIndex != -1) {
+ le_uint32 offset = SWAPL(perGlyphTable(currIndex, success));
+ LEGlyphID thisGlyph = glyphStorage[currGlyph];
+ TTGlyphID newGlyph = lookup(offset, thisGlyph, success);
+--- ./jdk/src/share/native/sun/font/layout/Features.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/Features.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -41,7 +41,7 @@
+ LEReferenceTo<FeatureTable> FeatureListTable::getFeatureTable(const LETableReference &base, le_uint16 featureIndex, LETag *featureTag, LEErrorCode &success) const
+ {
+ LEReferenceToArrayOf<FeatureRecord>
+- featureRecordArrayRef(base, success, featureRecordArray, featureIndex+1);
++ featureRecordArrayRef(base, success, featureRecordArray, featureIndex);
+
+ if (featureIndex >= SWAPW(featureCount) || LE_FAILURE(success)) {
+ return LEReferenceTo<FeatureTable>();
+--- ./jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -73,7 +73,7 @@
+
+ fMorphTable->process(fMorphTable, glyphStorage, success);
+
+- return glyphStorage.getGlyphCount();
++ return count;
+ }
+
+ // apply positional tables
+--- ./jdk/src/share/native/sun/font/layout/GXLayoutEngine2.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/GXLayoutEngine2.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -69,7 +69,7 @@
+ }
+
+ fMorphTable->process(fMorphTable, glyphStorage, fTypoFlags, success);
+- return glyphStorage.getGlyphCount();
++ return count;
+ }
+
+ // apply positional tables
+--- ./jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -70,11 +70,6 @@
+ ByteOffset newState = SWAPW(entry->newStateOffset);
+ IndicRearrangementFlags flags = (IndicRearrangementFlags) SWAPW(entry->flags);
+
+- if (currGlyph < 0 || currGlyph >= glyphStorage.getGlyphCount()) {
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
+-
+ if (flags & irfMarkFirst) {
+ firstGlyph = currGlyph;
+ }
+--- ./jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -68,11 +68,6 @@
+ le_uint16 newState = SWAPW(entry->newStateIndex); // index to the new state
+ IndicRearrangementFlags flags = (IndicRearrangementFlags) SWAPW(entry->flags);
+
+- if (currGlyph < 0 || currGlyph >= glyphStorage.getGlyphCount()) {
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
+-
+ if (flags & irfMarkFirst) {
+ firstGlyph = currGlyph;
+ }
+--- ./jdk/src/share/native/sun/font/layout/LETableReference.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/LETableReference.h Wed Jul 01 21:53:30 2015 -0700
+@@ -188,7 +188,7 @@
+
+ void addOffset(size_t offset, LEErrorCode &success) {
+ if(hasBounds()) {
+- if(offset >= fLength) {
++ if(offset > fLength) {
+ LE_DEBUG_TR("addOffset off end");
+ success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+ return;
+@@ -203,7 +203,7 @@
+ if(atPtr==NULL) return 0;
+ if(LE_FAILURE(success)) return LE_UINTPTR_MAX;
+ if((atPtr < fStart) ||
+- (hasBounds() && (atPtr >= fStart+fLength))) {
++ (hasBounds() && (atPtr > fStart+fLength))) {
+ LE_DEBUG_TR3("ptrToOffset args out of range: %p", atPtr, 0);
+ success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+ return LE_UINTPTR_MAX;
+@@ -240,18 +240,6 @@
+ }
+
+ /**
+- * Throw an error if size*count overflows
+- */
+- size_t verifyLength(size_t offset, size_t size, le_uint32 count, LEErrorCode &success) {
+- if(count!=0 && size>LE_UINT32_MAX/count) {
+- LE_DEBUG_TR3("verifyLength failed size=%u, count=%u", size, count);
+- success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+- return 0;
+- }
+- return verifyLength(offset, size*count, success);
+- }
+-
+- /**
+ * Change parent link to another
+ */
+ LETableReference &reparent(const LETableReference &base) {
+@@ -436,7 +424,7 @@
+ if(fCount == LE_UNBOUNDED_ARRAY) { // not a known length
+ fCount = getLength()/LETableVarSizer<T>::getSize(); // fit to max size
+ }
+- LETableReference::verifyLength(0, LETableVarSizer<T>::getSize(), fCount, success);
++ LETableReference::verifyLength(0, LETableVarSizer<T>::getSize()*fCount, success);
+ }
+ if(LE_FAILURE(success)) {
+ fCount=0;
+@@ -451,7 +439,7 @@
+ if(fCount == LE_UNBOUNDED_ARRAY) { // not a known length
+ fCount = getLength()/LETableVarSizer<T>::getSize(); // fit to max size
+ }
+- LETableReference::verifyLength(0, LETableVarSizer<T>::getSize(), fCount, success);
++ LETableReference::verifyLength(0, LETableVarSizer<T>::getSize()*fCount, success);
+ }
+ if(LE_FAILURE(success)) clear();
+ }
+@@ -462,7 +450,7 @@
+ if(fCount == LE_UNBOUNDED_ARRAY) { // not a known length
+ fCount = getLength()/LETableVarSizer<T>::getSize(); // fit to max size
+ }
+- LETableReference::verifyLength(0, LETableVarSizer<T>::getSize(), fCount, success);
++ LETableReference::verifyLength(0, LETableVarSizer<T>::getSize()*fCount, success);
+ }
+ if(LE_FAILURE(success)) clear();
+ }
+--- ./jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -73,7 +73,7 @@
+ const LigatureSubstitutionStateEntry *entry = entryTable.getAlias(index, success);
+
+ ByteOffset newState = SWAPW(entry->newStateOffset);
+- le_uint16 flags = SWAPW(entry->flags);
++ le_int16 flags = SWAPW(entry->flags);
+
+ if (flags & lsfSetComponent) {
+ if (++m >= nComponents) {
+@@ -92,18 +92,15 @@
+ if (actionOffset != 0) {
+ LEReferenceTo<LigatureActionEntry> ap(stHeader, success, actionOffset);
+ LigatureActionEntry action;
+- le_int32 offset, i = 0, j = 0;
++ le_int32 offset, i = 0;
+ le_int32 stack[nComponents];
+ le_int16 mm = -1;
+
+ do {
+ le_uint32 componentGlyph = componentStack[m--];
+
+- if (j++ > 0) {
+- ap.addObject(success);
+- }
+-
+ action = SWAPL(*ap.getAlias());
++ ap.addObject(success); // ap++
+
+ if (m < 0) {
+ m = nComponents - 1;
+--- ./jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -98,7 +98,7 @@
+ ap.addObject(ligActionIndex, success);
+ LEReferenceToArrayOf<TTGlyphID> ligatureTable(stHeader, success, ligatureOffset, LE_UNBOUNDED_ARRAY);
+ LigatureActionEntry action;
+- le_int32 offset, i = 0, j = 0;
++ le_int32 offset, i = 0;
+ le_int32 stack[nComponents];
+ le_int16 mm = -1;
+
+@@ -111,10 +111,6 @@
+ do {
+ le_uint32 componentGlyph = componentStack[m--]; // pop off
+
+- if (j++ > 0) {
+- ap.addObject(success);
+- }
+-
+ action = SWAPL(*ap.getAlias());
+
+ if (m < 0) {
+@@ -148,6 +144,7 @@
+ LE_DEBUG_BAD_FONT("m<0")
+ }
+ #endif
++ ap.addObject(success);
+ } while (LE_SUCCESS(success) && !(action & lafLast) && (m>=0) ); // stop if last bit is set, or if run out of items
+
+ while (mm >= 0) {
+--- ./jdk/src/share/native/sun/font/layout/LookupProcessor.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/LookupProcessor.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -175,7 +175,7 @@
+ LEReferenceTo<LangSysTable> langSysTable;
+ le_uint16 featureCount = 0;
+ le_uint16 lookupListCount = 0;
+- le_uint16 requiredFeatureIndex;
++ le_uint16 requiredFeatureIndex = 0xFFFF;
+
+ if (LE_FAILURE(success)) {
+ return;
+--- ./jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -97,9 +97,13 @@
+
+ if( LE_FAILURE(success) ) { return 0; }
+ Offset anchorTableOffset = SWAPW(baseRecord->baseAnchorTableOffsetArray[markClass]);
++ if (anchorTableOffset <= 0) {
++ // this means the table is mal-formed...
++ glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition());
++ return 0;
++ }
++
+ LEReferenceTo<AnchorTable> anchorTable(baseArray, success, anchorTableOffset);
+- if( LE_FAILURE(success) ) { return 0; }
+-
+ LEPoint baseAnchor, markAdvance, pixels;
+
+
+--- ./jdk/src/share/native/sun/font/layout/MorphTables.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/MorphTables.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -52,15 +52,8 @@
+ le_uint32 chain;
+
+ for (chain = 0; LE_SUCCESS(success) && (chain < chainCount); chain += 1) {
+- if (chain > 0) {
+- le_uint32 chainLength = SWAPL(chainHeader->chainLength);
+- if (chainLength & 0x03) { // incorrect alignment for 32 bit tables
+- success = LE_MEMORY_ALLOCATION_ERROR; // as good a choice as any
+- return;
+- }
+- chainHeader.addOffset(chainLength, success);
+- }
+ FeatureFlags defaultFlags = SWAPL(chainHeader->defaultFlags);
++ le_uint32 chainLength = SWAPL(chainHeader->chainLength);
+ le_int16 nFeatureEntries = SWAPW(chainHeader->nFeatureEntries);
+ le_int16 nSubtables = SWAPW(chainHeader->nSubtables);
+ LEReferenceTo<MorphSubtableHeader> subtableHeader =
+@@ -68,14 +61,7 @@
+ le_int16 subtable;
+
+ for (subtable = 0; LE_SUCCESS(success) && (subtable < nSubtables); subtable += 1) {
+- if (subtable > 0) {
+- le_int16 length = SWAPW(subtableHeader->length);
+- if (length & 0x03) { // incorrect alignment for 32 bit tables
+- success = LE_MEMORY_ALLOCATION_ERROR; // as good a choice as any
+- return;
+- }
+- subtableHeader.addOffset(length, success);
+- }
++ le_int16 length = SWAPW(subtableHeader->length);
+ SubtableCoverage coverage = SWAPW(subtableHeader->coverage);
+ FeatureFlags subtableFeatures = SWAPL(subtableHeader->subtableFeatures);
+
+@@ -83,7 +69,10 @@
+ if ((coverage & scfVertical) == 0 && (subtableFeatures & defaultFlags) != 0 && LE_SUCCESS(success)) {
+ subtableHeader->process(subtableHeader, glyphStorage, success);
+ }
++
++ subtableHeader.addOffset(length, success);
+ }
++ chainHeader.addOffset(chainLength, success);
+ }
+ }
+
+--- ./jdk/src/share/native/sun/font/layout/MorphTables2.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/MorphTables2.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -59,10 +59,6 @@
+ for (chain = 0; LE_SUCCESS(success) && (chain < chainCount); chain++) {
+ if (chain>0) {
+ le_uint32 chainLength = SWAPL(chainHeader->chainLength);
+- if (chainLength & 0x03) { // incorrect alignment for 32 bit tables
+- success = LE_MEMORY_ALLOCATION_ERROR; // as good a choice as any
+- return;
+- }
+ chainHeader.addOffset(chainLength, success); // Don't increment the first time
+ }
+ FeatureFlags flag = SWAPL(chainHeader->defaultFlags);
+@@ -192,10 +188,6 @@
+ for (subtable = 0; LE_SUCCESS(success) && subtable < nSubtables; subtable++) {
+ if(subtable>0) {
+ le_uint32 length = SWAPL(subtableHeader->length);
+- if (length & 0x03) { // incorrect alignment for 32 bit tables
+- success = LE_MEMORY_ALLOCATION_ERROR; // as good a choice as any
+- return;
+- }
+ subtableHeader.addOffset(length, success); // Don't addOffset for the last entry.
+ }
+ le_uint32 coverage = SWAPL(subtableHeader->coverage);
+--- ./jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -179,13 +179,12 @@
+ LEReferenceTo<PairValueRecord> record(records);
+
+ for(le_int32 r = 0; r < recordCount; r += 1) {
+- if (r > 0) {
+- record.addOffset(recordSize, success);
+- }
+ if(LE_FAILURE(success)) return LEReferenceTo<PairValueRecord>();
+ if (SWAPW(record->secondGlyph) == glyphID) {
+ return record;
+ }
++
++ record.addOffset(recordSize, success);
+ }
+ #else
+ #error dead code - not updated.
+--- ./jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -94,9 +94,7 @@
+ return 0;
+ }
+
+- LEReferenceToArrayOf<TTGlyphID> substituteArrayRef(base, success, substituteArray, SWAPW(glyphCount));
+-
+- if (coverageIndex >= 0 && LE_SUCCESS(success) && coverageIndex < substituteArrayRef.getCount()) {
++ if (coverageIndex >= 0) {
+ TTGlyphID substitute = SWAPW(substituteArray[coverageIndex]);
+
+ if (filter == NULL || filter->accept(LE_SET_GLYPH(glyph, substitute), success)) {
+--- ./jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -85,7 +85,6 @@
+ if (currGlyph == glyphCount) {
+ // XXX: How do we handle EOT vs. EOL?
+ classCode = classCodeEOT;
+- break;
+ } else {
+ TTGlyphID glyphCode = (TTGlyphID) LE_GET_GLYPH(glyphStorage[currGlyph]);
+
+--- ./jdk/src/share/native/sun/font/layout/StateTableProcessor2.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/StateTableProcessor2.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -103,7 +103,6 @@
+ if (currGlyph == glyphCount || currGlyph == -1) {
+ // XXX: How do we handle EOT vs. EOL?
+ classCode = classCodeEOT;
+- break;
+ } else {
+ LEGlyphID gid = glyphStorage[currGlyph];
+ TTGlyphID glyphCode = (TTGlyphID) LE_GET_GLYPH(gid);
+@@ -135,7 +134,6 @@
+ if (currGlyph == glyphCount || currGlyph == -1) {
+ // XXX: How do we handle EOT vs. EOL?
+ classCode = classCodeEOT;
+- break;
+ } else {
+ LEGlyphID gid = glyphStorage[currGlyph];
+ TTGlyphID glyphCode = (TTGlyphID) LE_GET_GLYPH(gid);
+@@ -173,7 +171,6 @@
+ if (currGlyph == glyphCount || currGlyph == -1) {
+ // XXX: How do we handle EOT vs. EOL?
+ classCode = classCodeEOT;
+- break;
+ } else if(currGlyph > glyphCount) {
+ // note if > glyphCount, we've run off the end (bad font)
+ currGlyph = glyphCount;
+@@ -214,7 +211,6 @@
+ if (currGlyph == glyphCount || currGlyph == -1) {
+ // XXX: How do we handle EOT vs. EOL?
+ classCode = classCodeEOT;
+- break;
+ } else {
+ TTGlyphID glyphCode = (TTGlyphID) LE_GET_GLYPH(glyphStorage[currGlyph]);
+ if (glyphCode == 0xFFFF) {
+--- ./jdk/src/share/native/sun/font/layout/StateTables.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/font/layout/StateTables.h Wed Jul 01 21:53:30 2015 -0700
+@@ -126,7 +126,7 @@
+ struct StateEntry
+ {
+ ByteOffset newStateOffset;
+- le_uint16 flags;
++ le_int16 flags;
+ };
+
+ typedef le_uint16 EntryTableIndex2;
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmscgats.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmscgats.c Wed Jul 01 21:53:30 2015 -0700
+@@ -353,7 +353,7 @@
+ "XYZ_X", // X component of tristimulus data
+ "XYZ_Y", // Y component of tristimulus data
+ "XYZ_Z", // Z component of tristimulus data
+- "XYY_X" // x component of chromaticity data
++ "XYY_X", // x component of chromaticity data
+ "XYY_Y", // y component of chromaticity data
+ "XYY_CAPY", // Y component of tristimulus data
+ "LAB_L", // L* component of Lab data
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c Wed Jul 01 21:53:30 2015 -0700
+@@ -298,6 +298,8 @@
+ {
+ cmsMAT3 Scale, m1, m2, m3, m4;
+
++ // TODO: Follow Marc Mahy's recommendation to check if CHAD is same by using M1*M2 == M2*M1. If so, do nothing.
++
+ // Adaptation state
+ if (AdaptationState == 1.0) {
+
+@@ -559,7 +561,7 @@
+ cmsHPROFILE hProfile;
+ cmsMAT3 m;
+ cmsVEC3 off;
+- cmsColorSpaceSignature ColorSpaceIn, ColorSpaceOut, CurrentColorSpace;
++ cmsColorSpaceSignature ColorSpaceIn, ColorSpaceOut = cmsSigLabData, CurrentColorSpace;
+ cmsProfileClassSignature ClassSig;
+ cmsUInt32Number i, Intent;
+
+@@ -661,6 +663,22 @@
+ CurrentColorSpace = ColorSpaceOut;
+ }
+
++ // Check for non-negatives clip
++ if (dwFlags & cmsFLAGS_NONEGATIVES) {
++
++ if (ColorSpaceOut == cmsSigGrayData ||
++ ColorSpaceOut == cmsSigRgbData ||
++ ColorSpaceOut == cmsSigCmykData) {
++
++ cmsStage* clip = _cmsStageClipNegatives(Result->ContextID, cmsChannelsOf(ColorSpaceOut));
++ if (clip == NULL) goto Error;
++
++ if (!cmsPipelineInsertStage(Result, cmsAT_END, clip))
++ goto Error;
++ }
++
++ }
++
+ return Result;
+
+ Error:
+@@ -1074,7 +1092,7 @@
+ if (TheIntents[i] == INTENT_PERCEPTUAL || TheIntents[i] == INTENT_SATURATION) {
+
+ // Force BPC for V4 profiles in perceptual and saturation
+- if (cmsGetProfileVersion(hProfiles[i]) >= 4.0)
++ if (cmsGetEncodedICCversion(hProfiles[i]) >= 0x4000000)
+ BPC[i] = TRUE;
+ }
+ }
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmserr.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmserr.c Wed Jul 01 21:53:30 2015 -0700
+@@ -30,7 +30,7 @@
+ //---------------------------------------------------------------------------------
+ //
+ // Little Color Management System
+-// Copyright (c) 1998-2012 Marti Maria Saguer
++// Copyright (c) 1998-2015 Marti Maria Saguer
+ //
+ // Permission is hereby granted, free of charge, to any person obtaining
+ // a copy of this software and associated documentation files (the "Software"),
+@@ -54,6 +54,13 @@
+
+ #include "lcms2_internal.h"
+
++
++// This function is here to help applications to prevent mixing lcms versions on header and shared objects.
++int CMSEXPORT cmsGetEncodedCMMversion(void)
++{
++ return LCMS_VERSION;
++}
++
+ // I am so tired about incompatibilities on those functions that here are some replacements
+ // that hopefully would be fully portable.
+
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c Wed Jul 01 21:53:30 2015 -0700
+@@ -958,7 +958,7 @@
+
+ Rest = c1 * rx + c2 * ry + c3 * rz;
+
+- Tmp1[OutChan] = (cmsUInt16Number) c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest));
++ Tmp1[OutChan] = (cmsUInt16Number) ( c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest)));
+ }
+
+
+@@ -1022,7 +1022,7 @@
+
+ Rest = c1 * rx + c2 * ry + c3 * rz;
+
+- Tmp2[OutChan] = (cmsUInt16Number) c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest));
++ Tmp2[OutChan] = (cmsUInt16Number) (c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest)));
+ }
+
+
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c Wed Jul 01 21:53:30 2015 -0700
+@@ -482,6 +482,14 @@
+
+ // -------------------------------------------------------------------------------------------------------
+
++cmsIOHANDLER* CMSEXPORT cmsGetProfileIOhandler(cmsHPROFILE hProfile)
++{
++ _cmsICCPROFILE* Icc = (_cmsICCPROFILE*)hProfile;
++
++ if (Icc == NULL) return NULL;
++ return Icc->IOhandler;
++}
++
+ // Creates an empty structure holding all required parameters
+ cmsHPROFILE CMSEXPORT cmsCreateProfilePlaceholder(cmsContext ContextID)
+ {
+@@ -651,25 +659,26 @@
+ return _cmsSearchTag(Icc, sig, FALSE) >= 0;
+ }
+
+-/*
+- * Enforces that the profile version is per. spec.
+- * Operates on the big endian bytes from the profile.
+- * Called before converting to platform endianness.
+- * Byte 0 is BCD major version, so max 9.
+- * Byte 1 is 2 BCD digits, one per nibble.
+- * Reserved bytes 2 & 3 must be 0.
+- */
+-static cmsUInt32Number _validatedVersion(cmsUInt32Number DWord)
++
++
++// Enforces that the profile version is per. spec.
++// Operates on the big endian bytes from the profile.
++// Called before converting to platform endianness.
++// Byte 0 is BCD major version, so max 9.
++// Byte 1 is 2 BCD digits, one per nibble.
++// Reserved bytes 2 & 3 must be 0.
++static
++cmsUInt32Number _validatedVersion(cmsUInt32Number DWord)
+ {
+- cmsUInt8Number* pByte = (cmsUInt8Number*)&DWord;
++ cmsUInt8Number* pByte = (cmsUInt8Number*) &DWord;
+ cmsUInt8Number temp1;
+ cmsUInt8Number temp2;
+
+- if (*pByte > 0x09) *pByte = (cmsUInt8Number)9;
++ if (*pByte > 0x09) *pByte = (cmsUInt8Number) 0x09;
+ temp1 = *(pByte+1) & 0xf0;
+ temp2 = *(pByte+1) & 0x0f;
+ if (temp1 > 0x90) temp1 = 0x90;
+- if (temp2 > 9) temp2 = 0x09;
++ if (temp2 > 0x09) temp2 = 0x09;
+ *(pByte+1) = (cmsUInt8Number)(temp1 | temp2);
+ *(pByte+2) = (cmsUInt8Number)0;
+ *(pByte+3) = (cmsUInt8Number)0;
+@@ -1167,33 +1176,7 @@
+ return cmsOpenProfileFromMemTHR(NULL, MemPtr, dwSize);
+ }
+
+-static
+-cmsBool SanityCheck(_cmsICCPROFILE* profile)
+-{
+- cmsIOHANDLER* io;
+
+- if (!profile) {
+- return FALSE;
+- }
+-
+- io = profile->IOhandler;
+- if (!io) {
+- return FALSE;
+- }
+-
+- if (!io->Seek ||
+- !(io->Seek==NULLSeek || io->Seek==MemorySeek || io->Seek==FileSeek))
+- {
+- return FALSE;
+- }
+- if (!io->Read ||
+- !(io->Read==NULLRead || io->Read==MemoryRead || io->Read==FileRead))
+- {
+- return FALSE;
+- }
+-
+- return TRUE;
+-}
+
+ // Dump tag contents. If the profile is being modified, untouched tags are copied from FileOrig
+ static
+@@ -1225,7 +1208,7 @@
+
+ // Reach here if we are copying a tag from a disk-based ICC profile which has not been modified by user.
+ // In this case a blind copy of the block data is performed
+- if (SanityCheck(FileOrig) && Icc -> TagOffsets[i]) {
++ if (FileOrig != NULL && Icc -> TagOffsets[i]) {
+
+ cmsUInt32Number TagSize = FileOrig -> TagSizes[i];
+ cmsUInt32Number TagOffset = FileOrig -> TagOffsets[i];
+@@ -1874,7 +1857,7 @@
+
+ // Similar to the anterior. This function allows to write directly to the ICC profile any data, without
+ // checking anything. As a rule, mixing Raw with cooked doesn't work, so writting a tag as raw and then reading
+-// it as cooked without serializing does result into an error. If that is wha you want, you will need to dump
++// it as cooked without serializing does result into an error. If that is what you want, you will need to dump
+ // the profile to memry or disk and then reopen it.
+ cmsBool CMSEXPORT cmsWriteRawTag(cmsHPROFILE hProfile, cmsTagSignature sig, const void* data, cmsUInt32Number Size)
+ {
+@@ -1898,6 +1881,11 @@
+ Icc ->TagSizes[i] = Size;
+
+ _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
++
++ if (Icc->TagPtrs[i] == NULL) {
++ Icc->TagNames[i] = 0;
++ return FALSE;
++ }
+ return TRUE;
+ }
+
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c Wed Jul 01 21:53:30 2015 -0700
+@@ -339,8 +339,8 @@
+ cmsPipeline* _cmsReadInputLUT(cmsHPROFILE hProfile, int Intent)
+ {
+ cmsTagTypeSignature OriginalType;
+- cmsTagSignature tag16 = Device2PCS16[Intent];
+- cmsTagSignature tagFloat = Device2PCSFloat[Intent];
++ cmsTagSignature tag16;
++ cmsTagSignature tagFloat;
+ cmsContext ContextID = cmsGetProfileContextID(hProfile);
+
+ // On named color, take the appropiate tag
+@@ -369,6 +369,9 @@
+ // matter other LUT are present and have precedence. Intent = -1 means just this.
+ if (Intent != -1) {
+
++ tag16 = Device2PCS16[Intent];
++ tagFloat = Device2PCSFloat[Intent];
++
+ if (cmsIsTag(hProfile, tagFloat)) { // Float tag takes precedence
+
+ // Floating point LUT are always V4, but the encoding range is no
+@@ -611,13 +614,16 @@
+ cmsPipeline* _cmsReadOutputLUT(cmsHPROFILE hProfile, int Intent)
+ {
+ cmsTagTypeSignature OriginalType;
+- cmsTagSignature tag16 = PCS2Device16[Intent];
+- cmsTagSignature tagFloat = PCS2DeviceFloat[Intent];
+- cmsContext ContextID = cmsGetProfileContextID(hProfile);
++ cmsTagSignature tag16;
++ cmsTagSignature tagFloat;
++ cmsContext ContextID = cmsGetProfileContextID(hProfile);
+
+
+ if (Intent != -1) {
+
++ tag16 = PCS2Device16[Intent];
++ tagFloat = PCS2DeviceFloat[Intent];
++
+ if (cmsIsTag(hProfile, tagFloat)) { // Float tag takes precedence
+
+ // Floating point LUT are always V4
+@@ -935,7 +941,7 @@
+ {
+ if (!cmsWriteTag(hProfile, cmsSigProfileSequenceDescTag, seq)) return FALSE;
+
+- if (cmsGetProfileVersion(hProfile) >= 4.0) {
++ if (cmsGetEncodedICCversion(hProfile) >= 0x4000000) {
+
+ if (!cmsWriteTag(hProfile, cmsSigProfileSequenceIdTag, seq)) return FALSE;
+ }
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1154,7 +1154,23 @@
+ return mpe;
+ }
+
++// Clips values smaller than zero
++static
++void Clipper(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage *mpe)
++{
++ cmsUInt32Number i;
++ for (i = 0; i < mpe->InputChannels; i++) {
+
++ cmsFloat32Number n = In[i];
++ Out[i] = n < 0 ? 0 : n;
++ }
++}
++
++cmsStage* _cmsStageClipNegatives(cmsContext ContextID, int nChannels)
++{
++ return _cmsStageAllocPlaceholder(ContextID, cmsSigClipNegativesElemType,
++ nChannels, nChannels, Clipper, NULL, NULL, NULL);
++}
+
+ // ********************************************************************************
+ // Type cmsSigXYZ2LabElemType
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c Wed Jul 01 21:53:30 2015 -0700
+@@ -543,8 +543,9 @@
+ v ->nColors = 0;
+ v ->ContextID = ContextID;
+
+- while (v -> Allocated < n)
+- GrowNamedColorList(v);
++ while (v -> Allocated < n){
++ if (!GrowNamedColorList(v)) return NULL;
++ }
+
+ strncpy(v ->Prefix, Prefix, sizeof(v ->Prefix)-1);
+ strncpy(v ->Suffix, Suffix, sizeof(v ->Suffix)-1);
+@@ -573,8 +574,9 @@
+ if (NewNC == NULL) return NULL;
+
+ // For really large tables we need this
+- while (NewNC ->Allocated < v ->Allocated)
+- GrowNamedColorList(NewNC);
++ while (NewNC ->Allocated < v ->Allocated){
++ if (!GrowNamedColorList(NewNC)) return NULL;
++ }
+
+ memmove(NewNC ->Prefix, v ->Prefix, sizeof(v ->Prefix));
+ memmove(NewNC ->Suffix, v ->Suffix, sizeof(v ->Suffix));
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c Wed Jul 01 21:53:30 2015 -0700
+@@ -192,6 +192,90 @@
+ return AnyOpt;
+ }
+
++
++static
++cmsBool CloseEnoughFloat(cmsFloat64Number a, cmsFloat64Number b)
++{
++ return fabs(b - a) < 0.00001f;
++}
++
++static
++cmsBool isFloatMatrixIdentity(const cmsMAT3* a)
++{
++ cmsMAT3 Identity;
++ int i, j;
++
++ _cmsMAT3identity(&Identity);
++
++ for (i = 0; i < 3; i++)
++ for (j = 0; j < 3; j++)
++ if (!CloseEnoughFloat(a->v[i].n[j], Identity.v[i].n[j])) return FALSE;
++
++ return TRUE;
++}
++// if two adjacent matrices are found, multiply them.
++static
++cmsBool _MultiplyMatrix(cmsPipeline* Lut)
++{
++ cmsStage** pt1;
++ cmsStage** pt2;
++ cmsStage* chain;
++ cmsBool AnyOpt = FALSE;
++
++ pt1 = &Lut->Elements;
++ if (*pt1 == NULL) return AnyOpt;
++
++ while (*pt1 != NULL) {
++
++ pt2 = &((*pt1)->Next);
++ if (*pt2 == NULL) return AnyOpt;
++
++ if ((*pt1)->Implements == cmsSigMatrixElemType && (*pt2)->Implements == cmsSigMatrixElemType) {
++
++ // Get both matrices
++ _cmsStageMatrixData* m1 = (_cmsStageMatrixData*) cmsStageData(*pt1);
++ _cmsStageMatrixData* m2 = (_cmsStageMatrixData*) cmsStageData(*pt2);
++ cmsMAT3 res;
++
++ // Input offset and output offset should be zero to use this optimization
++ if (m1->Offset != NULL || m2 ->Offset != NULL ||
++ cmsStageInputChannels(*pt1) != 3 || cmsStageOutputChannels(*pt1) != 3 ||
++ cmsStageInputChannels(*pt2) != 3 || cmsStageOutputChannels(*pt2) != 3)
++ return FALSE;
++
++ // Multiply both matrices to get the result
++ _cmsMAT3per(&res, (cmsMAT3*)m2->Double, (cmsMAT3*)m1->Double);
++
++ // Get the next in chain afer the matrices
++ chain = (*pt2)->Next;
++
++ // Remove both matrices
++ _RemoveElement(pt2);
++ _RemoveElement(pt1);
++
++ // Now what if the result is a plain identity?
++ if (!isFloatMatrixIdentity(&res)) {
++
++ // We can not get rid of full matrix
++ cmsStage* Multmat = cmsStageAllocMatrix(Lut->ContextID, 3, 3, (const cmsFloat64Number*) &res, NULL);
++
++ // Recover the chain
++ if (Multmat != NULL) {
++ Multmat->Next = chain;
++ }
++ *pt1 = Multmat;
++ }
++
++ AnyOpt = TRUE;
++ }
++ else
++ pt1 = &((*pt1)->Next);
++ }
++
++ return AnyOpt;
++}
++
++
+ // Preoptimize just gets rif of no-ops coming paired. Conversion from v2 to v4 followed
+ // by a v4 to v2 and vice-versa. The elements are then discarded.
+ static
+@@ -224,6 +308,9 @@
+ // Remove float pcs Lab conversions
+ Opt |= _Remove2Op(Lut, cmsSigXYZ2FloatPCS, cmsSigFloatPCS2XYZ);
+
++ // Simplify matrix.
++ Opt |= _MultiplyMatrix(Lut);
++
+ if (Opt) AnyOpt = TRUE;
+
+ } while (Opt);
+@@ -280,12 +367,12 @@
+ void* Prelin16dup(cmsContext ContextID, const void* ptr)
+ {
+ Prelin16Data* p16 = (Prelin16Data*) ptr;
+- Prelin16Data* Duped = _cmsDupMem(ContextID, p16, sizeof(Prelin16Data));
++ Prelin16Data* Duped = (Prelin16Data*) _cmsDupMem(ContextID, p16, sizeof(Prelin16Data));
+
+ if (Duped == NULL) return NULL;
+
+- Duped ->EvalCurveOut16 = _cmsDupMem(ContextID, p16 ->EvalCurveOut16, p16 ->nOutputs * sizeof(_cmsInterpFn16));
+- Duped ->ParamsCurveOut16 = _cmsDupMem(ContextID, p16 ->ParamsCurveOut16, p16 ->nOutputs * sizeof(cmsInterpParams* ));
++ Duped->EvalCurveOut16 = (_cmsInterpFn16*) _cmsDupMem(ContextID, p16->EvalCurveOut16, p16->nOutputs * sizeof(_cmsInterpFn16));
++ Duped->ParamsCurveOut16 = (cmsInterpParams**)_cmsDupMem(ContextID, p16->ParamsCurveOut16, p16->nOutputs * sizeof(cmsInterpParams*));
+
+ return Duped;
+ }
+@@ -298,7 +385,7 @@
+ int nOutputs, cmsToneCurve** Out )
+ {
+ int i;
+- Prelin16Data* p16 = _cmsMallocZero(ContextID, sizeof(Prelin16Data));
++ Prelin16Data* p16 = (Prelin16Data*)_cmsMallocZero(ContextID, sizeof(Prelin16Data));
+ if (p16 == NULL) return NULL;
+
+ p16 ->nInputs = nInputs;
+@@ -787,7 +874,7 @@
+ cmsS15Fixed16Number v1, v2, v3;
+ Prelin8Data* p8;
+
+- p8 = _cmsMallocZero(ContextID, sizeof(Prelin8Data));
++ p8 = (Prelin8Data*)_cmsMallocZero(ContextID, sizeof(Prelin8Data));
+ if (p8 == NULL) return NULL;
+
+ // Since this only works for 8 bit input, values comes always as x * 257,
+@@ -861,7 +948,7 @@
+ Prelin8Data* p8 = (Prelin8Data*) D;
+ register const cmsInterpParams* p = p8 ->p;
+ int TotalOut = p -> nOutputs;
+- const cmsUInt16Number* LutTable = p -> Table;
++ const cmsUInt16Number* LutTable = (const cmsUInt16Number*) p->Table;
+
+ r = Input[0] >> 8;
+ g = Input[1] >> 8;
+@@ -1180,15 +1267,15 @@
+ static
+ void* CurvesDup(cmsContext ContextID, const void* ptr)
+ {
+- Curves16Data* Data = _cmsDupMem(ContextID, ptr, sizeof(Curves16Data));
++ Curves16Data* Data = (Curves16Data*)_cmsDupMem(ContextID, ptr, sizeof(Curves16Data));
+ int i;
+
+ if (Data == NULL) return NULL;
+
+- Data ->Curves = _cmsDupMem(ContextID, Data ->Curves, Data ->nCurves * sizeof(cmsUInt16Number*));
++ Data->Curves = (cmsUInt16Number**) _cmsDupMem(ContextID, Data->Curves, Data->nCurves * sizeof(cmsUInt16Number*));
+
+ for (i=0; i < Data -> nCurves; i++) {
+- Data ->Curves[i] = _cmsDupMem(ContextID, Data ->Curves[i], Data -> nElements * sizeof(cmsUInt16Number));
++ Data->Curves[i] = (cmsUInt16Number*) _cmsDupMem(ContextID, Data->Curves[i], Data->nElements * sizeof(cmsUInt16Number));
+ }
+
+ return (void*) Data;
+@@ -1201,18 +1288,18 @@
+ int i, j;
+ Curves16Data* c16;
+
+- c16 = _cmsMallocZero(ContextID, sizeof(Curves16Data));
++ c16 = (Curves16Data*)_cmsMallocZero(ContextID, sizeof(Curves16Data));
+ if (c16 == NULL) return NULL;
+
+ c16 ->nCurves = nCurves;
+ c16 ->nElements = nElements;
+
+- c16 ->Curves = _cmsCalloc(ContextID, nCurves, sizeof(cmsUInt16Number*));
++ c16->Curves = (cmsUInt16Number**) _cmsCalloc(ContextID, nCurves, sizeof(cmsUInt16Number*));
+ if (c16 ->Curves == NULL) return NULL;
+
+ for (i=0; i < nCurves; i++) {
+
+- c16->Curves[i] = _cmsCalloc(ContextID, nElements, sizeof(cmsUInt16Number));
++ c16->Curves[i] = (cmsUInt16Number*) _cmsCalloc(ContextID, nElements, sizeof(cmsUInt16Number));
+
+ if (c16->Curves[i] == NULL) {
+
+@@ -1560,49 +1647,83 @@
+ }
+
+ // 8 bits on input allows matrix-shaper boot up to 25 Mpixels per second on RGB. That's fast!
+-// TODO: Allow a third matrix for abs. colorimetric
+ static
+ cmsBool OptimizeMatrixShaper(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt32Number* InputFormat, cmsUInt32Number* OutputFormat, cmsUInt32Number* dwFlags)
+ {
+- cmsStage* Curve1, *Curve2;
+- cmsStage* Matrix1, *Matrix2;
+- _cmsStageMatrixData* Data1;
+- _cmsStageMatrixData* Data2;
+- cmsMAT3 res;
+- cmsBool IdentityMat;
+- cmsPipeline* Dest, *Src;
++ cmsStage* Curve1, *Curve2;
++ cmsStage* Matrix1, *Matrix2;
++ cmsMAT3 res;
++ cmsBool IdentityMat;
++ cmsPipeline* Dest, *Src;
++ cmsFloat64Number* Offset;
+
+- // Only works on RGB to RGB
+- if (T_CHANNELS(*InputFormat) != 3 || T_CHANNELS(*OutputFormat) != 3) return FALSE;
++ // Only works on RGB to RGB
++ if (T_CHANNELS(*InputFormat) != 3 || T_CHANNELS(*OutputFormat) != 3) return FALSE;
+
+- // Only works on 8 bit input
+- if (!_cmsFormatterIs8bit(*InputFormat)) return FALSE;
++ // Only works on 8 bit input
++ if (!_cmsFormatterIs8bit(*InputFormat)) return FALSE;
+
+- // Seems suitable, proceed
+- Src = *Lut;
++ // Seems suitable, proceed
++ Src = *Lut;
+
+- // Check for shaper-matrix-matrix-shaper structure, that is what this optimizer stands for
+- if (!cmsPipelineCheckAndRetreiveStages(Src, 4,
+- cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType,
+- &Curve1, &Matrix1, &Matrix2, &Curve2)) return FALSE;
++ // Check for:
++ //
++ // shaper-matrix-matrix-shaper
++ // shaper-matrix-shaper
++ //
++ // Both of those constructs are possible (first because abs. colorimetric).
++ // additionally, In the first case, the input matrix offset should be zero.
+
+- // Get both matrices
+- Data1 = (_cmsStageMatrixData*) cmsStageData(Matrix1);
+- Data2 = (_cmsStageMatrixData*) cmsStageData(Matrix2);
++ IdentityMat = FALSE;
++ if (cmsPipelineCheckAndRetreiveStages(Src, 4,
++ cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType,
++ &Curve1, &Matrix1, &Matrix2, &Curve2)) {
+
+- // Input offset should be zero
+- if (Data1 ->Offset != NULL) return FALSE;
++ // Get both matrices
++ _cmsStageMatrixData* Data1 = (_cmsStageMatrixData*)cmsStageData(Matrix1);
++ _cmsStageMatrixData* Data2 = (_cmsStageMatrixData*)cmsStageData(Matrix2);
+
+- // Multiply both matrices to get the result
+- _cmsMAT3per(&res, (cmsMAT3*) Data2 ->Double, (cmsMAT3*) Data1 ->Double);
++ // Input offset should be zero
++ if (Data1->Offset != NULL) return FALSE;
+
+- // Now the result is in res + Data2 -> Offset. Maybe is a plain identity?
+- IdentityMat = FALSE;
+- if (_cmsMAT3isIdentity(&res) && Data2 ->Offset == NULL) {
++ // Multiply both matrices to get the result
++ _cmsMAT3per(&res, (cmsMAT3*)Data2->Double, (cmsMAT3*)Data1->Double);
+
+- // We can get rid of full matrix
+- IdentityMat = TRUE;
+- }
++ // Only 2nd matrix has offset, or it is zero
++ Offset = Data2->Offset;
++
++ // Now the result is in res + Data2 -> Offset. Maybe is a plain identity?
++ if (_cmsMAT3isIdentity(&res) && Offset == NULL) {
++
++ // We can get rid of full matrix
++ IdentityMat = TRUE;
++ }
++
++ }
++ else {
++
++ if (cmsPipelineCheckAndRetreiveStages(Src, 3,
++ cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType,
++ &Curve1, &Matrix1, &Curve2)) {
++
++ _cmsStageMatrixData* Data = (_cmsStageMatrixData*)cmsStageData(Matrix1);
++
++ // Copy the matrix to our result
++ memcpy(&res, Data->Double, sizeof(res));
++
++ // Preserve the Odffset (may be NULL as a zero offset)
++ Offset = Data->Offset;
++
++ if (_cmsMAT3isIdentity(&res) && Offset == NULL) {
++
++ // We can get rid of full matrix
++ IdentityMat = TRUE;
++ }
++ }
++ else
++ return FALSE; // Not optimizeable this time
++
++ }
+
+ // Allocate an empty LUT
+ Dest = cmsPipelineAlloc(Src ->ContextID, Src ->InputChannels, Src ->OutputChannels);
+@@ -1612,9 +1733,12 @@
+ if (!cmsPipelineInsertStage(Dest, cmsAT_BEGIN, cmsStageDup(Curve1)))
+ goto Error;
+
+- if (!IdentityMat)
+- if (!cmsPipelineInsertStage(Dest, cmsAT_END, cmsStageAllocMatrix(Dest ->ContextID, 3, 3, (const cmsFloat64Number*) &res, Data2 ->Offset)))
+- goto Error;
++ if (!IdentityMat) {
++
++ if (!cmsPipelineInsertStage(Dest, cmsAT_END, cmsStageAllocMatrix(Dest->ContextID, 3, 3, (const cmsFloat64Number*)&res, Offset)))
++ goto Error;
++ }
++
+ if (!cmsPipelineInsertStage(Dest, cmsAT_END, cmsStageDup(Curve2)))
+ goto Error;
+
+@@ -1632,7 +1756,7 @@
+ *dwFlags |= cmsFLAGS_NOCACHE;
+
+ // Setup the optimizarion routines
+- SetMatShaper(Dest, mpeC1 ->TheCurves, &res, (cmsVEC3*) Data2 ->Offset, mpeC2->TheCurves, OutputFormat);
++ SetMatShaper(Dest, mpeC1 ->TheCurves, &res, (cmsVEC3*) Offset, mpeC2->TheCurves, OutputFormat);
+ }
+
+ cmsPipelineFree(Src);
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmspack.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmspack.c Wed Jul 01 21:53:30 2015 -0700
+@@ -2438,9 +2438,6 @@
+ ((cmsFloat64Number*) output)[i + start] = v;
+ }
+
+- if (!ExtraFirst) {
+- output += Extra * sizeof(cmsFloat64Number);
+- }
+
+ if (Extra == 0 && SwapFirst) {
+
+@@ -2451,7 +2448,7 @@
+ if (T_PLANAR(info -> OutputFormat))
+ return output + sizeof(cmsFloat64Number);
+ else
+- return output + nChan * sizeof(cmsFloat64Number);
++ return output + (nChan + Extra) * sizeof(cmsFloat64Number);
+
+ }
+
+@@ -2462,50 +2459,47 @@
+ register cmsUInt8Number* output,
+ register cmsUInt32Number Stride)
+ {
+- int nChan = T_CHANNELS(info -> OutputFormat);
+- int DoSwap = T_DOSWAP(info ->OutputFormat);
+- int Reverse = T_FLAVOR(info ->OutputFormat);
+- int Extra = T_EXTRA(info -> OutputFormat);
+- int SwapFirst = T_SWAPFIRST(info -> OutputFormat);
+- int Planar = T_PLANAR(info -> OutputFormat);
+- int ExtraFirst = DoSwap ^ SwapFirst;
+- cmsFloat64Number maximum = IsInkSpace(info ->OutputFormat) ? 655.35 : 65535.0;
+- cmsFloat64Number v = 0;
+- cmsFloat32Number* swap1 = (cmsFloat32Number*) output;
+- int i, start = 0;
+-
+- if (ExtraFirst)
+- start = Extra;
+-
+- for (i=0; i < nChan; i++) {
+-
+- int index = DoSwap ? (nChan - i - 1) : i;
+-
+- v = (cmsFloat64Number) wOut[index] / maximum;
+-
+- if (Reverse)
+- v = maximum - v;
+-
+- if (Planar)
+- ((cmsFloat32Number*) output)[(i + start ) * Stride]= (cmsFloat32Number) v;
+- else
+- ((cmsFloat32Number*) output)[i + start] = (cmsFloat32Number) v;
+- }
+-
+- if (!ExtraFirst) {
+- output += Extra * sizeof(cmsFloat32Number);
+- }
+-
+- if (Extra == 0 && SwapFirst) {
+-
+- memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsFloat32Number));
+- *swap1 = (cmsFloat32Number) v;
+- }
+-
+- if (T_PLANAR(info -> OutputFormat))
+- return output + sizeof(cmsFloat32Number);
+- else
+- return output + nChan * sizeof(cmsFloat32Number);
++ int nChan = T_CHANNELS(info->OutputFormat);
++ int DoSwap = T_DOSWAP(info->OutputFormat);
++ int Reverse = T_FLAVOR(info->OutputFormat);
++ int Extra = T_EXTRA(info->OutputFormat);
++ int SwapFirst = T_SWAPFIRST(info->OutputFormat);
++ int Planar = T_PLANAR(info->OutputFormat);
++ int ExtraFirst = DoSwap ^ SwapFirst;
++ cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 655.35 : 65535.0;
++ cmsFloat64Number v = 0;
++ cmsFloat32Number* swap1 = (cmsFloat32Number*)output;
++ int i, start = 0;
++
++ if (ExtraFirst)
++ start = Extra;
++
++ for (i = 0; i < nChan; i++) {
++
++ int index = DoSwap ? (nChan - i - 1) : i;
++
++ v = (cmsFloat64Number)wOut[index] / maximum;
++
++ if (Reverse)
++ v = maximum - v;
++
++ if (Planar)
++ ((cmsFloat32Number*)output)[(i + start) * Stride] = (cmsFloat32Number)v;
++ else
++ ((cmsFloat32Number*)output)[i + start] = (cmsFloat32Number)v;
++ }
++
++
++ if (Extra == 0 && SwapFirst) {
++
++ memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat32Number));
++ *swap1 = (cmsFloat32Number)v;
++ }
++
++ if (T_PLANAR(info->OutputFormat))
++ return output + sizeof(cmsFloat32Number);
++ else
++ return output + (nChan + Extra) * sizeof(cmsFloat32Number);
+ }
+
+
+@@ -2518,50 +2512,47 @@
+ cmsUInt8Number* output,
+ cmsUInt32Number Stride)
+ {
+- int nChan = T_CHANNELS(info -> OutputFormat);
+- int DoSwap = T_DOSWAP(info ->OutputFormat);
+- int Reverse = T_FLAVOR(info ->OutputFormat);
+- int Extra = T_EXTRA(info -> OutputFormat);
+- int SwapFirst = T_SWAPFIRST(info -> OutputFormat);
+- int Planar = T_PLANAR(info -> OutputFormat);
+- int ExtraFirst = DoSwap ^ SwapFirst;
+- cmsFloat64Number maximum = IsInkSpace(info ->OutputFormat) ? 100.0 : 1.0;
+- cmsFloat32Number* swap1 = (cmsFloat32Number*) output;
+- cmsFloat64Number v = 0;
+- int i, start = 0;
+-
+- if (ExtraFirst)
+- start = Extra;
+-
+- for (i=0; i < nChan; i++) {
+-
+- int index = DoSwap ? (nChan - i - 1) : i;
+-
+- v = wOut[index] * maximum;
+-
+- if (Reverse)
+- v = maximum - v;
+-
+- if (Planar)
+- ((cmsFloat32Number*) output)[(i + start)* Stride]= (cmsFloat32Number) v;
+- else
+- ((cmsFloat32Number*) output)[i + start] = (cmsFloat32Number) v;
+- }
+-
+- if (!ExtraFirst) {
+- output += Extra * sizeof(cmsFloat32Number);
+- }
+-
+- if (Extra == 0 && SwapFirst) {
+-
+- memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsFloat32Number));
+- *swap1 = (cmsFloat32Number) v;
+- }
+-
+- if (T_PLANAR(info -> OutputFormat))
+- return output + sizeof(cmsFloat32Number);
+- else
+- return output + nChan * sizeof(cmsFloat32Number);
++ int nChan = T_CHANNELS(info->OutputFormat);
++ int DoSwap = T_DOSWAP(info->OutputFormat);
++ int Reverse = T_FLAVOR(info->OutputFormat);
++ int Extra = T_EXTRA(info->OutputFormat);
++ int SwapFirst = T_SWAPFIRST(info->OutputFormat);
++ int Planar = T_PLANAR(info->OutputFormat);
++ int ExtraFirst = DoSwap ^ SwapFirst;
++ cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 100.0 : 1.0;
++ cmsFloat32Number* swap1 = (cmsFloat32Number*)output;
++ cmsFloat64Number v = 0;
++ int i, start = 0;
++
++ if (ExtraFirst)
++ start = Extra;
++
++ for (i = 0; i < nChan; i++) {
++
++ int index = DoSwap ? (nChan - i - 1) : i;
++
++ v = wOut[index] * maximum;
++
++ if (Reverse)
++ v = maximum - v;
++
++ if (Planar)
++ ((cmsFloat32Number*)output)[(i + start)* Stride] = (cmsFloat32Number)v;
++ else
++ ((cmsFloat32Number*)output)[i + start] = (cmsFloat32Number)v;
++ }
++
++
++ if (Extra == 0 && SwapFirst) {
++
++ memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat32Number));
++ *swap1 = (cmsFloat32Number)v;
++ }
++
++ if (T_PLANAR(info->OutputFormat))
++ return output + sizeof(cmsFloat32Number);
++ else
++ return output + (nChan + Extra) * sizeof(cmsFloat32Number);
+ }
+
+ static
+@@ -2570,51 +2561,47 @@
+ cmsUInt8Number* output,
+ cmsUInt32Number Stride)
+ {
+- int nChan = T_CHANNELS(info -> OutputFormat);
+- int DoSwap = T_DOSWAP(info ->OutputFormat);
+- int Reverse = T_FLAVOR(info ->OutputFormat);
+- int Extra = T_EXTRA(info -> OutputFormat);
+- int SwapFirst = T_SWAPFIRST(info -> OutputFormat);
+- int Planar = T_PLANAR(info -> OutputFormat);
+- int ExtraFirst = DoSwap ^ SwapFirst;
+- cmsFloat64Number maximum = IsInkSpace(info ->OutputFormat) ? 100.0 : 1.0;
+- cmsFloat64Number v = 0;
+- cmsFloat64Number* swap1 = (cmsFloat64Number*) output;
+- int i, start = 0;
+-
+- if (ExtraFirst)
+- start = Extra;
+-
+- for (i=0; i < nChan; i++) {
+-
+- int index = DoSwap ? (nChan - i - 1) : i;
+-
+- v = wOut[index] * maximum;
+-
+- if (Reverse)
+- v = maximum - v;
+-
+- if (Planar)
+- ((cmsFloat64Number*) output)[(i + start) * Stride] = v;
+- else
+- ((cmsFloat64Number*) output)[i + start] = v;
+- }
+-
+- if (!ExtraFirst) {
+- output += Extra * sizeof(cmsFloat64Number);
+- }
+-
+- if (Extra == 0 && SwapFirst) {
+-
+- memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsFloat64Number));
+- *swap1 = v;
+- }
+-
+-
+- if (T_PLANAR(info -> OutputFormat))
+- return output + sizeof(cmsFloat64Number);
+- else
+- return output + nChan * sizeof(cmsFloat64Number);
++ int nChan = T_CHANNELS(info->OutputFormat);
++ int DoSwap = T_DOSWAP(info->OutputFormat);
++ int Reverse = T_FLAVOR(info->OutputFormat);
++ int Extra = T_EXTRA(info->OutputFormat);
++ int SwapFirst = T_SWAPFIRST(info->OutputFormat);
++ int Planar = T_PLANAR(info->OutputFormat);
++ int ExtraFirst = DoSwap ^ SwapFirst;
++ cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 100.0 : 1.0;
++ cmsFloat64Number v = 0;
++ cmsFloat64Number* swap1 = (cmsFloat64Number*)output;
++ int i, start = 0;
++
++ if (ExtraFirst)
++ start = Extra;
++
++ for (i = 0; i < nChan; i++) {
++
++ int index = DoSwap ? (nChan - i - 1) : i;
++
++ v = wOut[index] * maximum;
++
++ if (Reverse)
++ v = maximum - v;
++
++ if (Planar)
++ ((cmsFloat64Number*)output)[(i + start) * Stride] = v;
++ else
++ ((cmsFloat64Number*)output)[i + start] = v;
++ }
++
++ if (Extra == 0 && SwapFirst) {
++
++ memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat64Number));
++ *swap1 = v;
++ }
++
++
++ if (T_PLANAR(info->OutputFormat))
++ return output + sizeof(cmsFloat64Number);
++ else
++ return output + (nChan + Extra) * sizeof(cmsFloat64Number);
+
+ }
+
+@@ -2850,50 +2837,47 @@
+ register cmsUInt8Number* output,
+ register cmsUInt32Number Stride)
+ {
+- int nChan = T_CHANNELS(info -> OutputFormat);
+- int DoSwap = T_DOSWAP(info ->OutputFormat);
+- int Reverse = T_FLAVOR(info ->OutputFormat);
+- int Extra = T_EXTRA(info -> OutputFormat);
+- int SwapFirst = T_SWAPFIRST(info -> OutputFormat);
+- int Planar = T_PLANAR(info -> OutputFormat);
+- int ExtraFirst = DoSwap ^ SwapFirst;
+- cmsFloat32Number maximum = IsInkSpace(info ->OutputFormat) ? 655.35F : 65535.0F;
+- cmsFloat32Number v = 0;
+- cmsUInt16Number* swap1 = (cmsUInt16Number*) output;
+- int i, start = 0;
+-
+- if (ExtraFirst)
+- start = Extra;
+-
+- for (i=0; i < nChan; i++) {
+-
+- int index = DoSwap ? (nChan - i - 1) : i;
+-
+- v = (cmsFloat32Number) wOut[index] / maximum;
+-
+- if (Reverse)
+- v = maximum - v;
+-
+- if (Planar)
+- ((cmsUInt16Number*) output)[(i + start ) * Stride]= _cmsFloat2Half(v);
+- else
+- ((cmsUInt16Number*) output)[i + start] = _cmsFloat2Half(v);
+- }
+-
+- if (!ExtraFirst) {
+- output += Extra * sizeof(cmsUInt16Number);
+- }
+-
+- if (Extra == 0 && SwapFirst) {
+-
+- memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsUInt16Number));
+- *swap1 = _cmsFloat2Half(v);
+- }
+-
+- if (T_PLANAR(info -> OutputFormat))
+- return output + sizeof(cmsUInt16Number);
+- else
+- return output + nChan * sizeof(cmsUInt16Number);
++ int nChan = T_CHANNELS(info->OutputFormat);
++ int DoSwap = T_DOSWAP(info->OutputFormat);
++ int Reverse = T_FLAVOR(info->OutputFormat);
++ int Extra = T_EXTRA(info->OutputFormat);
++ int SwapFirst = T_SWAPFIRST(info->OutputFormat);
++ int Planar = T_PLANAR(info->OutputFormat);
++ int ExtraFirst = DoSwap ^ SwapFirst;
++ cmsFloat32Number maximum = IsInkSpace(info->OutputFormat) ? 655.35F : 65535.0F;
++ cmsFloat32Number v = 0;
++ cmsUInt16Number* swap1 = (cmsUInt16Number*)output;
++ int i, start = 0;
++
++ if (ExtraFirst)
++ start = Extra;
++
++ for (i = 0; i < nChan; i++) {
++
++ int index = DoSwap ? (nChan - i - 1) : i;
++
++ v = (cmsFloat32Number)wOut[index] / maximum;
++
++ if (Reverse)
++ v = maximum - v;
++
++ if (Planar)
++ ((cmsUInt16Number*)output)[(i + start) * Stride] = _cmsFloat2Half(v);
++ else
++ ((cmsUInt16Number*)output)[i + start] = _cmsFloat2Half(v);
++ }
++
++
++ if (Extra == 0 && SwapFirst) {
++
++ memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsUInt16Number));
++ *swap1 = _cmsFloat2Half(v);
++ }
++
++ if (T_PLANAR(info->OutputFormat))
++ return output + sizeof(cmsUInt16Number);
++ else
++ return output + (nChan + Extra) * sizeof(cmsUInt16Number);
+ }
+
+
+@@ -2904,50 +2888,47 @@
+ cmsUInt8Number* output,
+ cmsUInt32Number Stride)
+ {
+- int nChan = T_CHANNELS(info -> OutputFormat);
+- int DoSwap = T_DOSWAP(info ->OutputFormat);
+- int Reverse = T_FLAVOR(info ->OutputFormat);
+- int Extra = T_EXTRA(info -> OutputFormat);
+- int SwapFirst = T_SWAPFIRST(info -> OutputFormat);
+- int Planar = T_PLANAR(info -> OutputFormat);
+- int ExtraFirst = DoSwap ^ SwapFirst;
+- cmsFloat32Number maximum = IsInkSpace(info ->OutputFormat) ? 100.0F : 1.0F;
+- cmsUInt16Number* swap1 = (cmsUInt16Number*) output;
+- cmsFloat32Number v = 0;
+- int i, start = 0;
+-
+- if (ExtraFirst)
+- start = Extra;
+-
+- for (i=0; i < nChan; i++) {
+-
+- int index = DoSwap ? (nChan - i - 1) : i;
+-
+- v = wOut[index] * maximum;
+-
+- if (Reverse)
+- v = maximum - v;
+-
+- if (Planar)
+- ((cmsUInt16Number*) output)[(i + start)* Stride]= _cmsFloat2Half( v );
+- else
+- ((cmsUInt16Number*) output)[i + start] = _cmsFloat2Half( v );
+- }
+-
+- if (!ExtraFirst) {
+- output += Extra * sizeof(cmsUInt16Number);
+- }
+-
+- if (Extra == 0 && SwapFirst) {
+-
+- memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsUInt16Number));
+- *swap1 = (cmsUInt16Number) _cmsFloat2Half( v );
+- }
+-
+- if (T_PLANAR(info -> OutputFormat))
+- return output + sizeof(cmsUInt16Number);
+- else
+- return output + nChan * sizeof(cmsUInt16Number);
++ int nChan = T_CHANNELS(info->OutputFormat);
++ int DoSwap = T_DOSWAP(info->OutputFormat);
++ int Reverse = T_FLAVOR(info->OutputFormat);
++ int Extra = T_EXTRA(info->OutputFormat);
++ int SwapFirst = T_SWAPFIRST(info->OutputFormat);
++ int Planar = T_PLANAR(info->OutputFormat);
++ int ExtraFirst = DoSwap ^ SwapFirst;
++ cmsFloat32Number maximum = IsInkSpace(info->OutputFormat) ? 100.0F : 1.0F;
++ cmsUInt16Number* swap1 = (cmsUInt16Number*)output;
++ cmsFloat32Number v = 0;
++ int i, start = 0;
++
++ if (ExtraFirst)
++ start = Extra;
++
++ for (i = 0; i < nChan; i++) {
++
++ int index = DoSwap ? (nChan - i - 1) : i;
++
++ v = wOut[index] * maximum;
++
++ if (Reverse)
++ v = maximum - v;
++
++ if (Planar)
++ ((cmsUInt16Number*)output)[(i + start)* Stride] = _cmsFloat2Half(v);
++ else
++ ((cmsUInt16Number*)output)[i + start] = _cmsFloat2Half(v);
++ }
++
++
++ if (Extra == 0 && SwapFirst) {
++
++ memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsUInt16Number));
++ *swap1 = (cmsUInt16Number)_cmsFloat2Half(v);
++ }
++
++ if (T_PLANAR(info->OutputFormat))
++ return output + sizeof(cmsUInt16Number);
++ else
++ return output + (nChan + Extra)* sizeof(cmsUInt16Number);
+ }
+
+ #endif
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmspcs.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmspcs.c Wed Jul 01 21:53:30 2015 -0700
+@@ -135,6 +135,15 @@
+ Dest -> Z = ((1 - Source -> x - Source -> y) / Source -> y) * Source -> Y;
+ }
+
++/*
++ The break point (24/116)^3 = (6/29)^3 is a very small amount of tristimulus
++ primary (0.008856). Generally, this only happens for
++ nearly ideal blacks and for some orange / amber colors in transmission mode.
++ For example, the Z value of the orange turn indicator lamp lens on an
++ automobile will often be below this value. But the Z does not
++ contribute to the perceived color directly.
++*/
++
+ static
+ cmsFloat64Number f(cmsFloat64Number t)
+ {
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsplugin.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsplugin.c Wed Jul 01 21:53:30 2015 -0700
+@@ -712,15 +712,21 @@
+
+
+ // Internal: get the memory area associanted with each context client
+-// Returns the block assigned to the specific zone.
++// Returns the block assigned to the specific zone. Never return NULL.
+ void* _cmsContextGetClientChunk(cmsContext ContextID, _cmsMemoryClient mc)
+ {
+ struct _cmsContext_struct* ctx;
+ void *ptr;
+
+- if (mc < 0 || mc >= MemoryClientMax) {
+- cmsSignalError(ContextID, cmsERROR_RANGE, "Bad context client");
+- return NULL;
++ if ((int) mc < 0 || mc >= MemoryClientMax) {
++
++ cmsSignalError(ContextID, cmsERROR_INTERNAL, "Bad context client -- possible corruption");
++
++ // This is catastrophic. Should never reach here
++ _cmsAssert(0);
++
++ // Reverts to global context
++ return globalContext.chunks[UserPtr];
+ }
+
+ ctx = _cmsGetContext(ContextID);
+@@ -909,7 +915,7 @@
+ }
+
+
+-
++/*
+ static
+ struct _cmsContext_struct* FindPrev(struct _cmsContext_struct* id)
+ {
+@@ -926,6 +932,7 @@
+
+ return NULL; // List is empty or only one element!
+ }
++*/
+
+ // Frees any resources associated with the given context,
+ // and destroys the context placeholder.
+@@ -961,8 +968,8 @@
+
+ // Search for previous
+ for (prev = _cmsContextPoolHead;
+- prev != NULL;
+- prev = prev ->Next)
++ prev != NULL;
++ prev = prev ->Next)
+ {
+ if (prev -> Next == ctx) {
+ prev -> Next = ctx ->Next;
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmssamp.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmssamp.c Wed Jul 01 21:53:30 2015 -0700
+@@ -30,7 +30,7 @@
+ //---------------------------------------------------------------------------------
+ //
+ // Little Color Management System
+-// Copyright (c) 1998-2010 Marti Maria Saguer
++// Copyright (c) 1998-2014 Marti Maria Saguer
+ //
+ // Permission is hereby granted, free of charge, to any person obtaining
+ // a copy of this software and associated documentation files (the "Software"),
+@@ -369,28 +369,7 @@
+
+ }
+
+-/*
+-static
+-cmsBool IsMonotonic(int n, const cmsFloat64Number Table[])
+-{
+- int i;
+- cmsFloat64Number last;
+
+- last = Table[n-1];
+-
+- for (i = n-2; i >= 0; --i) {
+-
+- if (Table[i] > last)
+-
+- return FALSE;
+- else
+- last = Table[i];
+-
+- }
+-
+- return TRUE;
+-}
+-*/
+
+ // Calculates the black point of a destination profile.
+ // This algorithm comes from the Adobe paper disclosing its black point compensation method.
+@@ -515,7 +494,6 @@
+
+
+ // Test for mid range straight (only on relative colorimetric)
+-
+ NearlyStraightMidrange = TRUE;
+ MinL = outRamp[0]; MaxL = outRamp[255];
+ if (Intent == INTENT_RELATIVE_COLORIMETRIC) {
+@@ -531,7 +509,6 @@
+ // DestinationBlackPoint shall be the same as initialLab.
+ // Otherwise, the DestinationBlackPoint shall be determined
+ // using curve fitting.
+-
+ if (NearlyStraightMidrange) {
+
+ cmsLab2XYZ(NULL, BlackPoint, &InitialLab);
+@@ -543,14 +520,12 @@
+
+ // curve fitting: The round-trip curve normally looks like a nearly constant section at the black point,
+ // with a corner and a nearly straight line to the white point.
+-
+ for (l=0; l < 256; l++) {
+
+ yRamp[l] = (outRamp[l] - MinL) / (MaxL - MinL);
+ }
+
+ // find the black point using the least squares error quadratic curve fitting
+-
+ if (Intent == INTENT_RELATIVE_COLORIMETRIC) {
+ lo = 0.1;
+ hi = 0.5;
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1718,10 +1718,7 @@
+ else
+ for (j=0; j < 256; j++) {
+
+- if (Tables != NULL)
+- val = (cmsUInt8Number) FROM_16_TO_8(Tables->TheCurves[i]->Table16[j]);
+- else
+- val = (cmsUInt8Number) j;
++ val = (cmsUInt8Number) FROM_16_TO_8(Tables->TheCurves[i]->Table16[j]);
+
+ if (!_cmsWriteUInt8Number(io, val)) return FALSE;
+ }
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsvirt.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsvirt.c Wed Jul 01 21:53:30 2015 -0700
+@@ -671,7 +671,7 @@
+ // Create the ICC virtual profile for sRGB space
+ cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID)
+ {
+- cmsCIExyY D65;
++ cmsCIExyY D65 = { 0.3127, 0.3290, 1.0 };
+ cmsCIExyYTRIPLE Rec709Primaries = {
+ {0.6400, 0.3300, 1.0},
+ {0.3000, 0.6000, 1.0},
+@@ -680,7 +680,7 @@
+ cmsToneCurve* Gamma22[3];
+ cmsHPROFILE hsRGB;
+
+- cmsWhitePointFromTemp(&D65, 6504);
++ // cmsWhitePointFromTemp(&D65, 6504);
+ Gamma22[0] = Gamma22[1] = Gamma22[2] = Build_sRGBGamma(ContextID);
+ if (Gamma22[0] == NULL) return NULL;
+
+@@ -708,6 +708,7 @@
+ cmsFloat64Number Contrast;
+ cmsFloat64Number Hue;
+ cmsFloat64Number Saturation;
++ cmsBool lAdjustWP;
+ cmsCIEXYZ WPsrc, WPdest;
+
+ } BCHSWADJUSTS, *LPBCHSWADJUSTS;
+@@ -737,9 +738,10 @@
+ cmsLCh2Lab(&LabOut, &LChOut);
+
+ // Move white point in Lab
+-
+- cmsLab2XYZ(&bchsw ->WPsrc, &XYZ, &LabOut);
+- cmsXYZ2Lab(&bchsw ->WPdest, &LabOut, &XYZ);
++ if (bchsw->lAdjustWP) {
++ cmsLab2XYZ(&bchsw->WPsrc, &XYZ, &LabOut);
++ cmsXYZ2Lab(&bchsw->WPdest, &LabOut, &XYZ);
++ }
+
+ // Back to encoded
+
+@@ -773,18 +775,23 @@
+ bchsw.Contrast = Contrast;
+ bchsw.Hue = Hue;
+ bchsw.Saturation = Saturation;
++ if (TempSrc == TempDest) {
+
+- cmsWhitePointFromTemp(&WhitePnt, TempSrc );
+- cmsxyY2XYZ(&bchsw.WPsrc, &WhitePnt);
++ bchsw.lAdjustWP = FALSE;
++ }
++ else {
++ bchsw.lAdjustWP = TRUE;
++ cmsWhitePointFromTemp(&WhitePnt, TempSrc);
++ cmsxyY2XYZ(&bchsw.WPsrc, &WhitePnt);
++ cmsWhitePointFromTemp(&WhitePnt, TempDest);
++ cmsxyY2XYZ(&bchsw.WPdest, &WhitePnt);
+
+- cmsWhitePointFromTemp(&WhitePnt, TempDest);
+- cmsxyY2XYZ(&bchsw.WPdest, &WhitePnt);
++ }
+
+ hICC = cmsCreateProfilePlaceholder(ContextID);
+ if (!hICC) // can't allocate
+ return NULL;
+
+-
+ cmsSetDeviceClass(hICC, cmsSigAbstractClass);
+ cmsSetColorSpace(hICC, cmsSigLabData);
+ cmsSetPCS(hICC, cmsSigLabData);
+@@ -1017,12 +1024,14 @@
+
+ } cmsAllowedLUT;
+
++#define cmsSig0 ((cmsTagSignature) 0)
++
+ static const cmsAllowedLUT AllowedLUTTypes[] = {
+
+- { FALSE, 0, cmsSigLut16Type, 4, { cmsSigMatrixElemType, cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType}},
+- { FALSE, 0, cmsSigLut16Type, 3, { cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType}},
+- { FALSE, 0, cmsSigLut16Type, 2, { cmsSigCurveSetElemType, cmsSigCLutElemType}},
+- { TRUE , 0, cmsSigLutAtoBType, 1, { cmsSigCurveSetElemType }},
++ { FALSE, cmsSig0, cmsSigLut16Type, 4, { cmsSigMatrixElemType, cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType } },
++ { FALSE, cmsSig0, cmsSigLut16Type, 3, { cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType } },
++ { FALSE, cmsSig0, cmsSigLut16Type, 2, { cmsSigCurveSetElemType, cmsSigCLutElemType } },
++ { TRUE, cmsSig0, cmsSigLutAtoBType, 1, { cmsSigCurveSetElemType } },
+ { TRUE , cmsSigAToB0Tag, cmsSigLutAtoBType, 3, { cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType } },
+ { TRUE , cmsSigAToB0Tag, cmsSigLutAtoBType, 3, { cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType } },
+ { TRUE , cmsSigAToB0Tag, cmsSigLutAtoBType, 5, { cmsSigCurveSetElemType, cmsSigCLutElemType, cmsSigCurveSetElemType, cmsSigMatrixElemType, cmsSigCurveSetElemType }},
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c Wed Jul 01 21:53:30 2015 -0700
+@@ -621,46 +621,48 @@
+ _cmsTransformPluginChunkType* ctx = ( _cmsTransformPluginChunkType*) _cmsContextGetClientChunk(ContextID, TransformPlugin);
+ _cmsTransformCollection* Plugin;
+
+- // Allocate needed memory
+- _cmsTRANSFORM* p = (_cmsTRANSFORM*) _cmsMallocZero(ContextID, sizeof(_cmsTRANSFORM));
+- if (!p) return NULL;
++ // Allocate needed memory
++ _cmsTRANSFORM* p = (_cmsTRANSFORM*)_cmsMallocZero(ContextID, sizeof(_cmsTRANSFORM));
++ if (!p) return NULL;
+
+- // Store the proposed pipeline
+- p ->Lut = lut;
++ // Store the proposed pipeline
++ p->Lut = lut;
+
+- // Let's see if any plug-in want to do the transform by itself
+- for (Plugin = ctx ->TransformCollection;
+- Plugin != NULL;
+- Plugin = Plugin ->Next) {
++ // Let's see if any plug-in want to do the transform by itself
++ if (p->Lut != NULL) {
+
+- if (Plugin ->Factory(&p->xform, &p->UserData, &p ->FreeUserData, &p ->Lut, InputFormat, OutputFormat, dwFlags)) {
++ for (Plugin = ctx->TransformCollection;
++ Plugin != NULL;
++ Plugin = Plugin->Next) {
+
+- // Last plugin in the declaration order takes control. We just keep
+- // the original parameters as a logging.
+- // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default
+- // an optimized transform is not reusable. The plug-in can, however, change
+- // the flags and make it suitable.
++ if (Plugin->Factory(&p->xform, &p->UserData, &p->FreeUserData, &p->Lut, InputFormat, OutputFormat, dwFlags)) {
+
+- p ->ContextID = ContextID;
+- p ->InputFormat = *InputFormat;
+- p ->OutputFormat = *OutputFormat;
+- p ->dwOriginalFlags = *dwFlags;
++ // Last plugin in the declaration order takes control. We just keep
++ // the original parameters as a logging.
++ // Note that cmsFLAGS_CAN_CHANGE_FORMATTER is not set, so by default
++ // an optimized transform is not reusable. The plug-in can, however, change
++ // the flags and make it suitable.
+
+- // Fill the formatters just in case the optimized routine is interested.
+- // No error is thrown if the formatter doesn't exist. It is up to the optimization
+- // factory to decide what to do in those cases.
+- p ->FromInput = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16;
+- p ->ToOutput = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16;
+- p ->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
+- p ->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
++ p->ContextID = ContextID;
++ p->InputFormat = *InputFormat;
++ p->OutputFormat = *OutputFormat;
++ p->dwOriginalFlags = *dwFlags;
+
+- return p;
+- }
+- }
++ // Fill the formatters just in case the optimized routine is interested.
++ // No error is thrown if the formatter doesn't exist. It is up to the optimization
++ // factory to decide what to do in those cases.
++ p->FromInput = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16;
++ p->ToOutput = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16;
++ p->FromInputFloat = _cmsGetFormatter(ContextID, *InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
++ p->ToOutputFloat = _cmsGetFormatter(ContextID, *OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_FLOAT).FmtFloat;
+
+- // Not suitable for the transform plug-in, let's check the pipeline plug-in
+- if (p ->Lut != NULL)
+- _cmsOptimizePipeline(ContextID, &p->Lut, Intent, InputFormat, OutputFormat, dwFlags);
++ return p;
++ }
++ }
++
++ // Not suitable for the transform plug-in, let's check the pipeline plug-in
++ _cmsOptimizePipeline(ContextID, &p->Lut, Intent, InputFormat, OutputFormat, dwFlags);
++ }
+
+ // Check whatever this is a true floating point transform
+ if (_cmsFormatterIsFloat(*InputFormat) && _cmsFormatterIsFloat(*OutputFormat)) {
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h Wed Jul 01 21:53:30 2015 -0700
+@@ -52,7 +52,7 @@
+ //
+ //---------------------------------------------------------------------------------
+ //
+-// Version 2.6
++// Version 2.7
+ //
+
+ #ifndef _lcms2_H
+@@ -104,7 +104,7 @@
+ #endif
+
+ // Version/release
+-#define LCMS_VERSION 2060
++#define LCMS_VERSION 2070
+
+ // I will give the chance of redefining basic types for compilers that are not fully C99 compliant
+ #ifndef CMS_BASIC_TYPES_ALREADY_DEFINED
+@@ -213,27 +213,19 @@
+ # define CMS_USE_BIG_ENDIAN 1
+ #endif
+
+-# ifdef TARGET_CPU_PPC
+-# if TARGET_CPU_PPC
+-# define CMS_USE_BIG_ENDIAN 1
+-# endif
+-# endif
+
+ #if defined(__powerpc__) || defined(__ppc__) || defined(TARGET_CPU_PPC)
++# if __powerpc__ || __ppc__ || TARGET_CPU_PPC
+ # define CMS_USE_BIG_ENDIAN 1
+-# if defined (__GNUC__) && defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN)
+-# if __BYTE_ORDER == __LITTLE_ENDIAN
+-// // Don't use big endian for PowerPC little endian mode
++# if defined (__GNUC__) && defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__)
++# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
++ // Don't use big endian for PowerPC little endian mode
+ # undef CMS_USE_BIG_ENDIAN
+ # endif
++# endif
+ # endif
+ #endif
+
+-// WORDS_BIGENDIAN takes precedence
+-#if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN)
+-# define CMS_USE_BIG_ENDIAN 1
+-#endif
+-
+ #ifdef macintosh
+ # ifdef __BIG_ENDIAN__
+ # define CMS_USE_BIG_ENDIAN 1
+@@ -243,6 +235,12 @@
+ # endif
+ #endif
+
++// WORDS_BIGENDIAN takes precedence
++#if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN)
++# define CMS_USE_BIG_ENDIAN 1
++#endif
++
++
+ // Calling convention -- this is hardly platform and compiler dependent
+ #ifdef CMS_IS_WINDOWS_
+ # if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
+@@ -553,7 +551,8 @@
+ cmsSigLab2FloatPCS = 0x64326C20, // 'd2l '
+ cmsSigFloatPCS2Lab = 0x6C326420, // 'l2d '
+ cmsSigXYZ2FloatPCS = 0x64327820, // 'd2x '
+- cmsSigFloatPCS2XYZ = 0x78326420 // 'x2d '
++ cmsSigFloatPCS2XYZ = 0x78326420, // 'x2d '
++ cmsSigClipNegativesElemType = 0x636c7020 // 'clp '
+
+ } cmsStageSignature;
+
+@@ -1031,6 +1030,10 @@
+
+ } cmsICCViewingConditions;
+
++// Get LittleCMS version (for shared objects) -----------------------------------------------------------------------------
++
++CMSAPI int CMSEXPORT cmsGetEncodedCMMversion(void);
++
+ // Support of non-standard functions --------------------------------------------------------------------------------------
+
+ CMSAPI int CMSEXPORT cmsstrcasecmp(const char* s1, const char* s2);
+@@ -1509,7 +1512,7 @@
+
+ CMSAPI cmsUInt32Number CMSEXPORT cmsChannelsOf(cmsColorSpaceSignature ColorSpace);
+
+-// Build a suitable formatter for the colorspace of this profile
++// Build a suitable formatter for the colorspace of this profile. nBytes=1 means 8 bits, nBytes=2 means 16 bits.
+ CMSAPI cmsUInt32Number CMSEXPORT cmsFormatterForColorspaceOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat);
+ CMSAPI cmsUInt32Number CMSEXPORT cmsFormatterForPCSOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat);
+
+@@ -1538,6 +1541,7 @@
+ CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromStream(cmsContext ContextID, FILE* Stream);
+ CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buffer, cmsUInt32Number size, const char* AccessMode);
+ CMSAPI cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromNULL(cmsContext ContextID);
++CMSAPI cmsIOHANDLER* CMSEXPORT cmsGetProfileIOhandler(cmsHPROFILE hProfile);
+ CMSAPI cmsBool CMSEXPORT cmsCloseIOhandler(cmsIOHANDLER* io);
+
+ // MD5 message digest --------------------------------------------------------------------------------------------------
+@@ -1672,6 +1676,10 @@
+ #define cmsFLAGS_CLUT_POST_LINEARIZATION 0x0001 // create postlinearization tables if possible
+ #define cmsFLAGS_CLUT_PRE_LINEARIZATION 0x0010 // create prelinearization tables if possible
+
++// Specific to unbounded mode
++#define cmsFLAGS_NONEGATIVES 0x8000 // Prevent negative numbers in floating point transforms
++
++
+ // Fine-tune control over number of gridpoints
+ #define cmsFLAGS_GRIDPOINTS(n) (((n) & 0xFF) << 16)
+
+--- ./jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h Wed Jul 01 21:53:30 2015 -0700
+@@ -223,11 +223,17 @@
+ // Microsoft felt that it was necessary to keep it set at -1 for an unlocked critical
+ // section, even when they changed the underlying algorithm to be more scalable.
+ // The final parts of the critical section object are unimportant, and can be set
+-// to zero for their defaults. This yields an initialization macro:
++// to zero for their defaults. This yields to an initialization macro:
+
+ typedef CRITICAL_SECTION _cmsMutex;
+
+-#define CMS_MUTEX_INITIALIZER {(void*) -1,-1,0,0,0,0}
++#define CMS_MUTEX_INITIALIZER {(PRTL_CRITICAL_SECTION_DEBUG) -1,-1,0,0,0,0}
++
++#ifdef _MSC_VER
++# if (_MSC_VER >= 1800)
++# pragma warning(disable : 26135)
++# endif
++#endif
+
+ cmsINLINE int _cmsLockPrimitive(_cmsMutex *m)
+ {
+@@ -313,38 +319,38 @@
+
+ cmsINLINE int _cmsLockPrimitive(_cmsMutex *m)
+ {
++ cmsUNUSED_PARAMETER(m);
+ return 0;
+- cmsUNUSED_PARAMETER(m);
+ }
+
+ cmsINLINE int _cmsUnlockPrimitive(_cmsMutex *m)
+ {
++ cmsUNUSED_PARAMETER(m);
+ return 0;
+- cmsUNUSED_PARAMETER(m);
+ }
+
+ cmsINLINE int _cmsInitMutexPrimitive(_cmsMutex *m)
+ {
++ cmsUNUSED_PARAMETER(m);
+ return 0;
+- cmsUNUSED_PARAMETER(m);
+ }
+
+ cmsINLINE int _cmsDestroyMutexPrimitive(_cmsMutex *m)
+ {
++ cmsUNUSED_PARAMETER(m);
+ return 0;
+- cmsUNUSED_PARAMETER(m);
+ }
+
+ cmsINLINE int _cmsEnterCriticalSectionPrimitive(_cmsMutex *m)
+ {
++ cmsUNUSED_PARAMETER(m);
+ return 0;
+- cmsUNUSED_PARAMETER(m);
+ }
+
+ cmsINLINE int _cmsLeaveCriticalSectionPrimitive(_cmsMutex *m)
+ {
++ cmsUNUSED_PARAMETER(m);
+ return 0;
+- cmsUNUSED_PARAMETER(m);
+ }
+ #endif
+
+@@ -852,6 +858,8 @@
+ cmsStage* _cmsStageNormalizeFromXyzFloat(cmsContext ContextID);
+ cmsStage* _cmsStageNormalizeToLabFloat(cmsContext ContextID);
+ cmsStage* _cmsStageNormalizeToXyzFloat(cmsContext ContextID);
++cmsStage* _cmsStageClipNegatives(cmsContext ContextID, int nChannels);
++
+
+ // For curve set only
+ cmsToneCurve** _cmsStageGetPtrToCurveSet(const cmsStage* mpe);
+--- ./jdk/src/share/native/sun/java2d/opengl/OGLContext.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/opengl/OGLContext.c Wed Jul 01 21:53:30 2015 -0700
+@@ -748,7 +748,7 @@
+ // finally, check to see if the hardware supports the required number
+ // of texture units
+ j2d_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &maxTexUnits);
+- if (maxTexUnits < 4) {
++ if (maxTexUnits < 2) {
+ J2dRlsTraceLn1(J2D_TRACE_INFO,
+ "OGLContext_IsLCDShaderSupportAvailable: not enough tex units (%d)",
+ maxTexUnits);
+--- ./jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c Wed Jul 01 21:53:30 2015 -0700
+@@ -95,22 +95,9 @@
+ static GLhandleARB lcdTextProgram = 0;
+
+ /**
+- * The size of one of the gamma LUT textures in any one dimension along
+- * the edge, in texels.
+- */
+-#define LUT_EDGE 16
+-
+-/**
+- * These are the texture object handles for the gamma and inverse gamma
+- * lookup tables.
+- */
+-static GLuint gammaLutTextureID = 0;
+-static GLuint invGammaLutTextureID = 0;
+-
+-/**
+ * This value tracks the previous LCD contrast setting, so if the contrast
+- * value hasn't changed since the last time the lookup tables were
+- * generated (not very common), then we can skip updating the tables.
++ * value hasn't changed since the last time the gamma uniforms were
++ * updated (not very common), then we can skip updating the unforms.
+ */
+ static jint lastLCDContrast = -1;
+
+@@ -275,12 +262,9 @@
+ * changes, we will modify the "src_adj" value in OGLTR_UpdateLCDTextColor()).
+ *
+ * The "main" function is executed for each "fragment" (or pixel) in the
+- * glyph image. We have determined that the pow() function can be quite
+- * slow and it only operates on scalar values, not vectors as we require.
+- * So instead we build two 3D textures containing gamma (and inverse gamma)
+- * lookup tables that allow us to approximate a component-wise pow() function
+- * with a single 3D texture lookup. This approach is at least 2x faster
+- * than the equivalent pow() calls.
++ * glyph image. The pow() routine operates on vectors, gives precise results,
++ * and provides acceptable level of performance, so we use it to perform
++ * the gamma adjustment.
+ *
+ * The variables involved in the equation can be expressed as follows:
+ *
+@@ -299,8 +283,8 @@
+ "uniform vec3 src_adj;"
+ "uniform sampler2D glyph_tex;"
+ "uniform sampler2D dst_tex;"
+- "uniform sampler3D invgamma_tex;"
+- "uniform sampler3D gamma_tex;"
++ "uniform vec3 gamma;"
++ "uniform vec3 invgamma;"
+ ""
+ "void main(void)"
+ "{"
+@@ -312,12 +296,12 @@
+ " }"
+ // load the RGB value from the corresponding destination pixel
+ " vec3 dst_clr = vec3(texture2D(dst_tex, gl_TexCoord[1].st));"
+- // gamma adjust the dest color using the invgamma LUT
+- " vec3 dst_adj = vec3(texture3D(invgamma_tex, dst_clr.stp));"
++ // gamma adjust the dest color
++ " vec3 dst_adj = pow(dst_clr.rgb, gamma);"
+ // linearly interpolate the three color values
+ " vec3 result = mix(dst_adj, src_adj, glyph_clr);"
+ // gamma re-adjust the resulting color (alpha is always set to 1.0)
+- " gl_FragColor = vec4(vec3(texture3D(gamma_tex, result.stp)), 1.0);"
++ " gl_FragColor = vec4(pow(result.rgb, invgamma), 1.0);"
+ "}";
+
+ /**
+@@ -348,10 +332,6 @@
+ j2d_glUniform1iARB(loc, 0); // texture unit 0
+ loc = j2d_glGetUniformLocationARB(lcdTextProgram, "dst_tex");
+ j2d_glUniform1iARB(loc, 1); // texture unit 1
+- loc = j2d_glGetUniformLocationARB(lcdTextProgram, "invgamma_tex");
+- j2d_glUniform1iARB(loc, 2); // texture unit 2
+- loc = j2d_glGetUniformLocationARB(lcdTextProgram, "gamma_tex");
+- j2d_glUniform1iARB(loc, 3); // texture unit 3
+
+ // "unuse" the program object; it will be re-bound later as needed
+ j2d_glUseProgramObjectARB(0);
+@@ -360,108 +340,26 @@
+ }
+
+ /**
+- * Initializes a 3D texture object for use as a three-dimensional gamma
+- * lookup table. Note that the wrap mode is initialized to GL_LINEAR so
+- * that the table will interpolate adjacent values when the index falls
+- * somewhere in between.
+- */
+-static GLuint
+-OGLTR_InitGammaLutTexture()
+-{
+- GLuint lutTextureID;
+-
+- j2d_glGenTextures(1, &lutTextureID);
+- j2d_glBindTexture(GL_TEXTURE_3D, lutTextureID);
+- j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+- j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+- j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+- j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+- j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+-
+- return lutTextureID;
+-}
+-
+-/**
+- * Updates the lookup table in the given texture object with the float
+- * values in the given system memory buffer. Note that we could use
+- * glTexSubImage3D() when updating the texture after its first
+- * initialization, but since we're updating the entire table (with
+- * power-of-two dimensions) and this is a relatively rare event, we'll
+- * just stick with glTexImage3D().
+- */
+-static void
+-OGLTR_UpdateGammaLutTexture(GLuint texID, GLfloat *lut, jint size)
+-{
+- j2d_glBindTexture(GL_TEXTURE_3D, texID);
+- j2d_glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB8,
+- size, size, size, 0, GL_RGB, GL_FLOAT, lut);
+-}
+-
+-/**
+- * (Re)Initializes the gamma lookup table textures.
++ * (Re)Initializes the gamma related uniforms.
+ *
+ * The given contrast value is an int in the range [100, 250] which we will
+- * then scale to fit in the range [1.0, 2.5]. We create two LUTs, one
+- * that essentially calculates pow(x, gamma) and the other calculates
+- * pow(x, 1/gamma). These values are replicated in all three dimensions, so
+- * given a single 3D texture coordinate (typically this will be a triplet
+- * in the form (r,g,b)), the 3D texture lookup will return an RGB triplet:
+- *
+- * (pow(r,g), pow(y,g), pow(z,g)
+- *
+- * where g is either gamma or 1/gamma, depending on the table.
++ * then scale to fit in the range [1.0, 2.5].
+ */
+ static jboolean
+ OGLTR_UpdateLCDTextContrast(jint contrast)
+ {
+- double gamma = ((double)contrast) / 100.0;
+- double ig = gamma;
+- double g = 1.0 / ig;
+- GLfloat lut[LUT_EDGE][LUT_EDGE][LUT_EDGE][3];
+- GLfloat invlut[LUT_EDGE][LUT_EDGE][LUT_EDGE][3];
+- int min = 0;
+- int max = LUT_EDGE - 1;
+- int x, y, z;
++ double g = ((double)contrast) / 100.0;
++ double ig = 1.0 / g;
++ GLint loc;
+
+ J2dTraceLn1(J2D_TRACE_INFO,
+ "OGLTR_UpdateLCDTextContrast: contrast=%d", contrast);
+
+- for (z = min; z <= max; z++) {
+- double zval = ((double)z) / max;
+- GLfloat gz = (GLfloat)pow(zval, g);
+- GLfloat igz = (GLfloat)pow(zval, ig);
++ loc = j2d_glGetUniformLocationARB(lcdTextProgram, "gamma");
++ j2d_glUniform3fARB(loc, g, g, g);
+
+- for (y = min; y <= max; y++) {
+- double yval = ((double)y) / max;
+- GLfloat gy = (GLfloat)pow(yval, g);
+- GLfloat igy = (GLfloat)pow(yval, ig);
+-
+- for (x = min; x <= max; x++) {
+- double xval = ((double)x) / max;
+- GLfloat gx = (GLfloat)pow(xval, g);
+- GLfloat igx = (GLfloat)pow(xval, ig);
+-
+- lut[z][y][x][0] = gx;
+- lut[z][y][x][1] = gy;
+- lut[z][y][x][2] = gz;
+-
+- invlut[z][y][x][0] = igx;
+- invlut[z][y][x][1] = igy;
+- invlut[z][y][x][2] = igz;
+- }
+- }
+- }
+-
+- if (gammaLutTextureID == 0) {
+- gammaLutTextureID = OGLTR_InitGammaLutTexture();
+- }
+- OGLTR_UpdateGammaLutTexture(gammaLutTextureID, (GLfloat *)lut, LUT_EDGE);
+-
+- if (invGammaLutTextureID == 0) {
+- invGammaLutTextureID = OGLTR_InitGammaLutTexture();
+- }
+- OGLTR_UpdateGammaLutTexture(invGammaLutTextureID,
+- (GLfloat *)invlut, LUT_EDGE);
++ loc = j2d_glGetUniformLocationARB(lcdTextProgram, "invgamma");
++ j2d_glUniform3fARB(loc, ig, ig, ig);
+
+ return JNI_TRUE;
+ }
+@@ -562,14 +460,6 @@
+ return JNI_FALSE;
+ }
+
+- // bind the gamma LUT textures
+- j2d_glActiveTextureARB(GL_TEXTURE2_ARB);
+- j2d_glBindTexture(GL_TEXTURE_3D, invGammaLutTextureID);
+- j2d_glEnable(GL_TEXTURE_3D);
+- j2d_glActiveTextureARB(GL_TEXTURE3_ARB);
+- j2d_glBindTexture(GL_TEXTURE_3D, gammaLutTextureID);
+- j2d_glEnable(GL_TEXTURE_3D);
+-
+ return JNI_TRUE;
+ }
+
+@@ -629,10 +519,6 @@
+ j2d_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ j2d_glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ j2d_glUseProgramObjectARB(0);
+- j2d_glActiveTextureARB(GL_TEXTURE3_ARB);
+- j2d_glDisable(GL_TEXTURE_3D);
+- j2d_glActiveTextureARB(GL_TEXTURE2_ARB);
+- j2d_glDisable(GL_TEXTURE_3D);
+ j2d_glActiveTextureARB(GL_TEXTURE1_ARB);
+ j2d_glDisable(GL_TEXTURE_2D);
+ j2d_glActiveTextureARB(GL_TEXTURE0_ARB);
+--- ./jdk/src/share/native/sun/security/ec/impl/ec.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/security/ec/impl/ec.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * This library is free software; you can redistribute it and/or
+@@ -34,7 +34,6 @@
+ * Dr Vipul Gupta <vipul.gupta@sun.com> and
+ * Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
+ *
+- * Last Modified Date from the Original Code: April 2015
+ *********************************************************************** */
+
+ #include "mplogic.h"
+@@ -586,10 +585,6 @@
+ return SECFailure;
+ }
+
+- if (EC_ValidatePublicKey(ecParams, publicValue, kmflag) != SECSuccess) {
+- return SECFailure;
+- }
+-
+ memset(derivedSecret, 0, sizeof *derivedSecret);
+ len = (ecParams->fieldID.size + 7) >> 3;
+ pointQ.len = 2*len + 1;
+--- ./jdk/src/share/native/sun/security/ec/impl/ecc_impl.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/security/ec/impl/ecc_impl.h Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * This library is free software; you can redistribute it and/or
+@@ -34,7 +34,6 @@
+ * Dr Vipul Gupta <vipul.gupta@sun.com> and
+ * Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
+ *
+- * Last Modified Date from the Original Code: November 2013
+ *********************************************************************** */
+
+ #ifndef _ECC_IMPL_H
+--- ./jdk/src/share/native/sun/security/ec/impl/ecdecode.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/security/ec/impl/ecdecode.c Wed Jul 01 21:53:30 2015 -0700
+@@ -34,7 +34,6 @@
+ * Dr Vipul Gupta <vipul.gupta@sun.com> and
+ * Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
+ *
+- * Last Modified Date from the Original Code: March 2012
+ *********************************************************************** */
+
+ #include <sys/types.h>
+--- ./jdk/src/share/native/sun/security/ec/impl/mpi.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/security/ec/impl/mpi.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * This library is free software; you can redistribute it and/or
+@@ -34,7 +34,6 @@
+ * Netscape Communications Corporation
+ * Douglas Stebila <douglas@stebila.ca> of Sun Laboratories.
+ *
+- * Last Modified Date from the Original Code: June 2014
+ *********************************************************************** */
+
+ /* Arbitrary precision integer arithmetic library */
+--- ./jdk/src/share/native/sun/security/ec/impl/oid.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/security/ec/impl/oid.c Wed Jul 01 21:53:30 2015 -0700
+@@ -33,7 +33,6 @@
+ * Contributor(s):
+ * Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
+ *
+- * Last Modified Date from the Original Code: March 2012
+ *********************************************************************** */
+
+ #include <sys/types.h>
+--- ./jdk/src/share/native/sun/security/ec/impl/secitem.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/security/ec/impl/secitem.c Wed Jul 01 21:53:30 2015 -0700
+@@ -32,7 +32,6 @@
+ *
+ * Contributor(s):
+ *
+- * Last Modified Date from the Original Code: March 2012
+ *********************************************************************** */
+
+ /*
+--- ./jdk/src/share/native/sun/tracing/dtrace/JVM.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/share/native/sun/tracing/dtrace/JVM.c Wed Jul 01 21:53:30 2015 -0700
+@@ -144,32 +144,34 @@
+ env, provider, &(jvm_provider->argsAttributes));
+ }
+
+-static void readProviderData(
++static int readProviderData(
+ JNIEnv* env, jobject provider, JVM_DTraceProvider* jvm_provider) {
+ jmethodID mid;
+ jobjectArray probes;
+ jsize i;
+- jclass clazz = (*env)->GetObjectClass(env, provider); CHECK
++ jclass clazz = (*env)->GetObjectClass(env, provider); CHECK_(0)
+ mid = (*env)->GetMethodID(
+- env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK
++ env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK_(0)
+ probes = (jobjectArray)(*env)->CallObjectMethod(
+- env, provider, mid); CHECK
++ env, provider, mid); CHECK_(0)
+
+ // Fill JVM structure, describing provider
+- jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK
++ jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK_(0)
+ jvm_provider->probes = (JVM_DTraceProbe*)calloc(
+ jvm_provider->probe_count, sizeof(*jvm_provider->probes));
+ mid = (*env)->GetMethodID(
+- env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK
++ env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK_(0)
+ jvm_provider->name = (jstring)(*env)->CallObjectMethod(
+- env, provider, mid); CHECK
++ env, provider, mid); CHECK_(0)
+
+- readInterfaceAttributes(env, provider, jvm_provider); CHECK
++ readInterfaceAttributes(env, provider, jvm_provider); CHECK_(0)
+
+ for (i = 0; i < jvm_provider->probe_count; ++i) {
+- jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK
+- readProbeData(env, probe, &jvm_provider->probes[i]); CHECK
++ jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK_(0)
++ readProbeData(env, probe, &jvm_provider->probes[i]); CHECK_(0)
+ }
++
++ return 1;
+ }
+
+ /*
+@@ -182,6 +184,7 @@
+ jlong handle = 0;
+ jsize num_providers;
+ jsize i;
++ jsize count = 0;
+ JVM_DTraceProvider* jvm_providers;
+
+ initialize();
+@@ -195,16 +198,23 @@
+ jvm_providers = (JVM_DTraceProvider*)calloc(
+ num_providers, sizeof(*jvm_providers));
+
+- for (i = 0; i < num_providers; ++i) {
+- JVM_DTraceProvider* p = &(jvm_providers[i]);
++ for (; count < num_providers; ++count) {
++ JVM_DTraceProvider* p = &(jvm_providers[count]);
+ jobject provider = (*env)->GetObjectArrayElement(
+- env, providers, i);
+- readProviderData(env, provider, p);
++ env, providers, count);
++ if ((*env)->ExceptionOccurred(env) ||
++ ! readProviderData(env, provider, p)) {
++ // got an error, bail out!
++ break;
++ }
+ }
+
+- handle = jvm_symbols->Activate(
+- env, JVM_TRACING_DTRACE_VERSION, moduleName,
+- num_providers, jvm_providers);
++ if (count == num_providers) {
++ // all providers successfully loaded - get the handle
++ handle = jvm_symbols->Activate(
++ env, JVM_TRACING_DTRACE_VERSION, moduleName,
++ num_providers, jvm_providers);
++ }
+
+ for (i = 0; i < num_providers; ++i) {
+ JVM_DTraceProvider* p = &(jvm_providers[i]);
+--- ./jdk/src/solaris/bin/arm/jvm.cfg Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,35 +0,0 @@
+-# Copyright (c) 2011, 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. 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.
+-#
+-# List of JVMs that can be used as an option to java, javac, etc.
+-# Order is important -- first in this list is the default JVM.
+-# NOTE that this both this file and its format are UNSUPPORTED and
+-# WILL GO AWAY in a future release.
+-#
+-# You may also select a JVM in an arbitrary location with the
+-# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
+-# and may not be available in a future release.
+-#
+--client IF_SERVER_CLASS -server
+--server KNOWN
+--minimal KNOWN
+--- ./jdk/src/solaris/bin/java_md_solinux.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/bin/java_md_solinux.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1998, 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
+@@ -613,14 +613,13 @@
+ /* runpath contains current effective LD_LIBRARY_PATH setting */
+
+ jvmpath = JLI_StringDup(jvmpath);
+- size_t new_runpath_size = ((runpath != NULL) ? JLI_StrLen(runpath) : 0) +
++ new_runpath = JLI_MemAlloc(((runpath != NULL) ? JLI_StrLen(runpath) : 0) +
+ 2 * JLI_StrLen(jrepath) + 2 * JLI_StrLen(arch) +
+ #ifdef AIX
+ /* On AIX we additionally need 'jli' in the path because ld doesn't support $ORIGIN. */
+ JLI_StrLen(jrepath) + JLI_StrLen(arch) + JLI_StrLen("/lib//jli:") +
+ #endif
+- JLI_StrLen(jvmpath) + 52;
+- new_runpath = JLI_MemAlloc(new_runpath_size);
++ JLI_StrLen(jvmpath) + 52);
+ newpath = new_runpath + JLI_StrLen(LD_LIBRARY_PATH "=");
+
+
+@@ -680,11 +679,6 @@
+ * loop of execv() because we test for the prefix, above.
+ */
+ if (runpath != 0) {
+- /* ensure storage for runpath + colon + NULL */
+- if ((JLI_StrLen(runpath) + 1 + 1) > new_runpath_size) {
+- JLI_ReportErrorMessageSys(JRE_ERROR11);
+- exit(1);
+- }
+ JLI_StrCat(new_runpath, ":");
+ JLI_StrCat(new_runpath, runpath);
+ }
+@@ -817,11 +811,7 @@
+ JLI_TraceLauncher("JRE path is %s\n", path);
+ return JNI_TRUE;
+ }
+- /* ensure storage for path + /jre + NULL */
+- if ((JLI_StrLen(path) + 4 + 1) > pathsize) {
+- JLI_TraceLauncher("Insufficient space to store JRE path\n");
+- return JNI_FALSE;
+- }
++
+ /* Does the app ship a private JRE in <apphome>/jre directory? */
+ JLI_Snprintf(libjava, sizeof(libjava), "%s/jre/lib/%s/" JAVA_DLL, path, arch);
+ if (access(libjava, F_OK) == 0) {
+--- ./jdk/src/solaris/bin/ppc/jvm.cfg Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,35 +0,0 @@
+-# Copyright (c) 2011, 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. 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.
+-#
+-# List of JVMs that can be used as an option to java, javac, etc.
+-# Order is important -- first in this list is the default JVM.
+-# NOTE that this both this file and its format are UNSUPPORTED and
+-# WILL GO AWAY in a future release.
+-#
+-# You may also select a JVM in an arbitrary location with the
+-# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
+-# and may not be available in a future release.
+-#
+--client KNOWN
+--server KNOWN
+--minimal KNOWN
+--- ./jdk/src/solaris/classes/java/lang/UNIXProcess.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/java/lang/UNIXProcess.java Wed Jul 01 21:53:30 2015 -0700
+@@ -405,14 +405,17 @@
+ if (hasExited) return true;
+ if (timeout <= 0) return false;
+
+- long timeoutAsNanos = unit.toNanos(timeout);
+- long startTime = System.nanoTime();
+- long rem = timeoutAsNanos;
++ long remainingNanos = unit.toNanos(timeout);
++ long deadline = System.nanoTime() + remainingNanos;
+
+- while (!hasExited && (rem > 0)) {
+- wait(Math.max(TimeUnit.NANOSECONDS.toMillis(rem), 1));
+- rem = timeoutAsNanos - (System.nanoTime() - startTime);
+- }
++ do {
++ // Round up to next millisecond
++ wait(TimeUnit.NANOSECONDS.toMillis(remainingNanos + 999_999L));
++ if (hasExited) {
++ return true;
++ }
++ remainingNanos = deadline - System.nanoTime();
++ } while (remainingNanos > 0);
+ return hasExited;
+ }
+
+--- ./jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/java/net/PlainDatagramSocketImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -69,6 +69,15 @@
+ return (T)flow;
+ }
+
++ protected void socketSetOption(int opt, Object val) throws SocketException {
++ try {
++ socketSetOption0(opt, val);
++ } catch (SocketException se) {
++ if (!connected)
++ throw se;
++ }
++ }
++
+ protected synchronized native void bind0(int lport, InetAddress laddr)
+ throws SocketException;
+
+@@ -101,7 +110,7 @@
+
+ protected native void datagramSocketClose();
+
+- protected native void socketSetOption(int opt, Object val)
++ protected native void socketSetOption0(int opt, Object val)
+ throws SocketException;
+
+ protected native Object socketGetOption(int opt) throws SocketException;
+--- ./jdk/src/solaris/classes/java/net/PlainSocketImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/java/net/PlainSocketImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -83,6 +83,15 @@
+ return (T)flow;
+ }
+
++ protected void socketSetOption(int opt, boolean b, Object val) throws SocketException {
++ try {
++ socketSetOption0(opt, b, val);
++ } catch (SocketException se) {
++ if (socket == null || !socket.isConnected())
++ throw se;
++ }
++ }
++
+ native void socketCreate(boolean isServer) throws IOException;
+
+ native void socketConnect(InetAddress address, int port, int timeout)
+@@ -103,7 +112,7 @@
+
+ static native void initProto();
+
+- native void socketSetOption(int cmd, boolean on, Object value)
++ native void socketSetOption0(int cmd, boolean on, Object value)
+ throws SocketException;
+
+ native int socketGetOption(int opt, Object iaContainerObj) throws SocketException;
+--- ./jdk/src/solaris/classes/sun/awt/UNIXToolkit.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/awt/UNIXToolkit.java Wed Jul 01 21:53:30 2015 -0700
+@@ -29,11 +29,9 @@
+ import java.awt.color.ColorSpace;
+ import java.awt.image.*;
+ import java.security.AccessController;
+-import java.security.PrivilegedAction;
+ import sun.security.action.GetIntegerAction;
+ import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection;
+ import sun.java2d.opengl.OGLRenderQueue;
+-import java.lang.reflect.InvocationTargetException;
+
+ public abstract class UNIXToolkit extends SunToolkit
+ {
+@@ -73,16 +71,16 @@
+ if (nativeGTKLoaded != null) {
+ // We've already attempted to load GTK, so just return the
+ // status of that attempt.
+- return nativeGTKLoaded.booleanValue();
++ return nativeGTKLoaded;
+
+ } else if (nativeGTKAvailable != null) {
+ // We've already checked the availability of the native GTK
+ // libraries, so just return the status of that attempt.
+- return nativeGTKAvailable.booleanValue();
++ return nativeGTKAvailable;
+
+ } else {
+ boolean success = check_gtk();
+- nativeGTKAvailable = Boolean.valueOf(success);
++ nativeGTKAvailable = success;
+ return success;
+ }
+ }
+@@ -99,11 +97,10 @@
+ public boolean loadGTK() {
+ synchronized (GTK_LOCK) {
+ if (nativeGTKLoaded == null) {
+- boolean success = load_gtk();
+- nativeGTKLoaded = Boolean.valueOf(success);
++ nativeGTKLoaded = load_gtk();
+ }
+ }
+- return nativeGTKLoaded.booleanValue();
++ return nativeGTKLoaded;
+ }
+
+ /**
+@@ -252,6 +249,7 @@
+
+ private native void nativeSync();
+
++ @Override
+ public void sync() {
+ // flush the X11 buffer
+ nativeSync();
+@@ -266,6 +264,8 @@
+ * This requires that the Gnome properties have already been gathered.
+ */
+ public static final String FONTCONFIGAAHINT = "fontconfig/Antialias";
++
++ @Override
+ protected RenderingHints getDesktopAAHints() {
+
+ Object aaValue = getDesktopProperty("gnome.Xft/Antialias");
+@@ -288,8 +288,8 @@
+ * us to default to "OFF". I don't think that's the best guess.
+ * So if its !=0 then lets assume AA.
+ */
+- boolean aa = Boolean.valueOf(((aaValue instanceof Number) &&
+- ((Number)aaValue).intValue() != 0));
++ boolean aa = ((aaValue instanceof Number)
++ && ((Number) aaValue).intValue() != 0);
+ Object aaHint;
+ if (aa) {
+ String subpixOrder =
+--- ./jdk/src/solaris/classes/sun/awt/X11/XClipboard.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/awt/X11/XClipboard.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 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
+@@ -156,19 +156,29 @@
+ isSelectionNotifyProcessed = true;
+
+ boolean mustSchedule = false;
+- synchronized (XClipboard.classLock) {
+- if (targetsAtom2Clipboard == null) {
+- targetsAtom2Clipboard = new HashMap<Long, XClipboard>(2);
++ XToolkit.awtLock();
++ try {
++ synchronized (XClipboard.classLock) {
++ try {
++ Thread.sleep(70);
++ } catch (InterruptedException e) {
++ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
++ }
++ if (targetsAtom2Clipboard == null) {
++ targetsAtom2Clipboard = new HashMap<Long, XClipboard>(2);
++ }
++ mustSchedule = targetsAtom2Clipboard.isEmpty();
++ targetsAtom2Clipboard.put(getTargetsPropertyAtom().getAtom(), this);
++ if (mustSchedule) {
++ XToolkit.addEventDispatcher(XWindow.getXAWTRootWindow().getWindow(),
++ new SelectionNotifyHandler());
++ }
+ }
+- mustSchedule = targetsAtom2Clipboard.isEmpty();
+- targetsAtom2Clipboard.put(getTargetsPropertyAtom().getAtom(), this);
+ if (mustSchedule) {
+- XToolkit.addEventDispatcher(XWindow.getXAWTRootWindow().getWindow(),
+- new SelectionNotifyHandler());
++ XToolkit.schedule(new CheckChangeTimerTask(), XClipboard.getPollInterval());
+ }
+- }
+- if (mustSchedule) {
+- XToolkit.schedule(new CheckChangeTimerTask(), XClipboard.getPollInterval());
++ } finally {
++ XToolkit.awtUnlock();
+ }
+ }
+
+@@ -281,6 +291,11 @@
+ }
+ }
+
+- checkChange(formats);
++ XToolkit.awtUnlock();
++ try {
++ checkChange(formats);
++ } finally {
++ XToolkit.awtLock();
++ }
+ }
+ }
+--- ./jdk/src/solaris/classes/sun/awt/X11/XRootWindow.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/awt/X11/XRootWindow.java Wed Jul 01 21:53:30 2015 -0700
+@@ -31,18 +31,22 @@
+ * common logical ancestor
+ */
+ class XRootWindow extends XBaseWindow {
+- private static XRootWindow xawtRootWindow = null;
+- static XRootWindow getInstance() {
+- XToolkit.awtLock();
+- try {
+- if (xawtRootWindow == null) {
++ private static class LazyHolder {
++ private static final XRootWindow xawtRootWindow;
++
++ static {
++ XToolkit.awtLock();
++ try {
+ xawtRootWindow = new XRootWindow();
+ xawtRootWindow.init(xawtRootWindow.getDelayedParams().delete(DELAYED));
++ } finally {
++ XToolkit.awtUnlock();
+ }
+- return xawtRootWindow;
+- } finally {
+- XToolkit.awtUnlock();
+ }
++
++ }
++ static XRootWindow getInstance() {
++ return LazyHolder.xawtRootWindow;
+ }
+
+ private XRootWindow() {
+--- ./jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Wed Jul 01 21:53:30 2015 -0700
+@@ -598,14 +598,19 @@
+ }
+ }
+ }
+- if( keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
+- keyEventLog.fine("before XFilterEvent:"+ev);
++ if (keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (
++ ev.get_type() == XConstants.KeyPress
++ || ev.get_type() == XConstants.KeyRelease)) {
++ keyEventLog.fine("before XFilterEvent:" + ev);
+ }
+ if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
+ continue;
+ }
+- if( keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
+- keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
++ if (keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (
++ ev.get_type() == XConstants.KeyPress
++ || ev.get_type() == XConstants.KeyRelease)) {
++ keyEventLog.fine(
++ "after XFilterEvent:" + ev); // IS THIS CORRECT?
+ }
+
+ dispatchEvent(ev);
+@@ -621,21 +626,28 @@
+ }
+ }
+
++ /**
++ * Listener installed to detect display changes.
++ */
++ private static final DisplayChangedListener displayChangedHandler =
++ new DisplayChangedListener() {
++ @Override
++ public void displayChanged() {
++ // 7045370: Reset the cached values
++ XToolkit.screenWidth = -1;
++ XToolkit.screenHeight = -1;
++ }
++
++ @Override
++ public void paletteChanged() {
++ }
++ };
++
+ static {
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ if (ge instanceof SunGraphicsEnvironment) {
+- ((SunGraphicsEnvironment)ge).addDisplayChangedListener(
+- new DisplayChangedListener() {
+- @Override
+- public void displayChanged() {
+- // 7045370: Reset the cached values
+- XToolkit.screenWidth = -1;
+- XToolkit.screenHeight = -1;
+- }
+-
+- @Override
+- public void paletteChanged() {}
+- });
++ ((SunGraphicsEnvironment) ge).addDisplayChangedListener(
++ displayChangedHandler);
+ }
+ }
+
+@@ -645,7 +657,9 @@
+ try {
+ XWindowAttributes pattr = new XWindowAttributes();
+ try {
+- XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(), pattr.pData);
++ XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
++ XToolkit.getDefaultRootWindow(),
++ pattr.pData);
+ screenWidth = (int) pattr.get_width();
+ screenHeight = (int) pattr.get_height();
+ } finally {
+@@ -814,10 +828,32 @@
+ // managers don't set this hint correctly, so we just get intersection with windowBounds
+ if (windowBounds != null && windowBounds.intersects(screenBounds))
+ {
+- insets.left = Math.max((int)Native.getLong(native_ptr, 0), insets.left);
+- insets.right = Math.max((int)Native.getLong(native_ptr, 1), insets.right);
+- insets.top = Math.max((int)Native.getLong(native_ptr, 2), insets.top);
+- insets.bottom = Math.max((int)Native.getLong(native_ptr, 3), insets.bottom);
++ int left = (int)Native.getLong(native_ptr, 0);
++ int right = (int)Native.getLong(native_ptr, 1);
++ int top = (int)Native.getLong(native_ptr, 2);
++ int bottom = (int)Native.getLong(native_ptr, 3);
++
++ /*
++ * struts could be relative to root window bounds, so
++ * make them relative to the screen bounds in this case
++ */
++ left = rootBounds.x + left > screenBounds.x ?
++ rootBounds.x + left - screenBounds.x : 0;
++ right = rootBounds.x + rootBounds.width - right <
++ screenBounds.x + screenBounds.width ?
++ screenBounds.x + screenBounds.width -
++ (rootBounds.x + rootBounds.width - right) : 0;
++ top = rootBounds.y + top > screenBounds.y ?
++ rootBounds.y + top - screenBounds.y : 0;
++ bottom = rootBounds.y + rootBounds.height - bottom <
++ screenBounds.y + screenBounds.height ?
++ screenBounds.y + screenBounds.height -
++ (rootBounds.y + rootBounds.height - bottom) : 0;
++
++ insets.left = Math.max(left, insets.left);
++ insets.right = Math.max(right, insets.right);
++ insets.top = Math.max(top, insets.top);
++ insets.bottom = Math.max(bottom, insets.bottom);
+ }
+ }
+ }
+@@ -2363,7 +2399,7 @@
+
+ private static XEventDispatcher oops_waiter;
+ private static boolean oops_updated;
+- private static boolean oops_move;
++ private static int oops_position = 0;
+
+ /**
+ * @inheritDoc
+@@ -2390,9 +2426,12 @@
+ oops_updated = false;
+ long event_number = getEventNumber();
+ // Generate OOPS ConfigureNotify event
+- XlibWrapper.XMoveWindow(getDisplay(), win.getWindow(), oops_move ? 0 : 1, 0);
++ XlibWrapper.XMoveWindow(getDisplay(), win.getWindow(), ++oops_position, 0);
+ // Change win position each time to avoid system optimization
+- oops_move = !oops_move;
++ if (oops_position > 50) {
++ oops_position = 0;
++ }
++
+ XSync();
+
+ eventLog.finer("Generated OOPS ConfigureNotify event");
+--- ./jdk/src/solaris/classes/sun/awt/X11/XWindow.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/awt/X11/XWindow.java Wed Jul 01 21:53:30 2015 -0700
+@@ -568,10 +568,6 @@
+ }
+
+ static int getModifiers(int state, int button, int keyCode) {
+- return getModifiers(state, button, keyCode, 0, false);
+- }
+-
+- static int getModifiers(int state, int button, int keyCode, int type, boolean wheel_mouse) {
+ int modifiers = 0;
+
+ if (((state & XConstants.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) {
+@@ -602,7 +598,7 @@
+ // ONLY one of these conditions should be TRUE to add that modifier.
+ if (((state & XlibUtil.getButtonMask(i + 1)) != 0) != (button == XConstants.buttons[i])){
+ //exclude wheel buttons from adding their numbers as modifiers
+- if (!wheel_mouse) {
++ if (!isWheel(XConstants.buttons[i])) {
+ modifiers |= InputEvent.getMaskForButton(i+1);
+ }
+ }
+@@ -610,6 +606,11 @@
+ return modifiers;
+ }
+
++ static boolean isWheel(int button) {
++ // 4 and 5 buttons are usually considered assigned to a first wheel
++ return button == XConstants.buttons[3] || button == XConstants.buttons[4];
++ }
++
+ static int getXModifiers(AWTKeyStroke stroke) {
+ int mods = stroke.getModifiers();
+ int res = 0;
+@@ -649,7 +650,6 @@
+ int modifiers;
+ boolean popupTrigger = false;
+ int button=0;
+- boolean wheel_mouse = false;
+ int lbutton = xbe.get_button();
+ /*
+ * Ignore the buttons above 20 due to the bit limit for
+@@ -702,11 +702,6 @@
+ }
+
+ button = XConstants.buttons[lbutton - 1];
+- // 4 and 5 buttons are usually considered assigned to a first wheel
+- if (lbutton == XConstants.buttons[3] ||
+- lbutton == XConstants.buttons[4]) {
+- wheel_mouse = true;
+- }
+
+ // mapping extra buttons to numbers starting from 4.
+ if ((button > XConstants.buttons[4]) && (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled())){
+@@ -716,9 +711,9 @@
+ if (button > XConstants.buttons[4]){
+ button -= 2;
+ }
+- modifiers = getModifiers(xbe.get_state(),button,0, type, wheel_mouse);
++ modifiers = getModifiers(xbe.get_state(),button,0);
+
+- if (!wheel_mouse) {
++ if (!isWheel(lbutton)) {
+ MouseEvent me = new MouseEvent((Component)getEventSource(),
+ type == XConstants.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED,
+ jWhen,modifiers, x, y,
+--- ./jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -679,28 +679,33 @@
+ GraphicsConfiguration newGC = null;
+ Rectangle screenBounds;
+
+- for (int i = 0; i < gds.length; i++) {
+- screenBounds = gds[i].getDefaultConfiguration().getBounds();
+- if (newBounds.intersects(screenBounds)) {
+- horizAmt = Math.min(newBounds.x + newBounds.width,
+- screenBounds.x + screenBounds.width) -
+- Math.max(newBounds.x, screenBounds.x);
+- vertAmt = Math.min(newBounds.y + newBounds.height,
+- screenBounds.y + screenBounds.height)-
+- Math.max(newBounds.y, screenBounds.y);
+- intAmt = horizAmt * vertAmt;
+- if (intAmt == area) {
+- // Completely on this screen - done!
+- newScreenNum = i;
+- newGC = gds[i].getDefaultConfiguration();
+- break;
+- }
+- if (intAmt > largestAmt) {
+- largestAmt = intAmt;
+- newScreenNum = i;
+- newGC = gds[i].getDefaultConfiguration();
++ XToolkit.awtUnlock();
++ try {
++ for (int i = 0; i < gds.length; i++) {
++ screenBounds = gds[i].getDefaultConfiguration().getBounds();
++ if (newBounds.intersects(screenBounds)) {
++ horizAmt = Math.min(newBounds.x + newBounds.width,
++ screenBounds.x + screenBounds.width) -
++ Math.max(newBounds.x, screenBounds.x);
++ vertAmt = Math.min(newBounds.y + newBounds.height,
++ screenBounds.y + screenBounds.height)-
++ Math.max(newBounds.y, screenBounds.y);
++ intAmt = horizAmt * vertAmt;
++ if (intAmt == area) {
++ // Completely on this screen - done!
++ newScreenNum = i;
++ newGC = gds[i].getDefaultConfiguration();
++ break;
++ }
++ if (intAmt > largestAmt) {
++ largestAmt = intAmt;
++ newScreenNum = i;
++ newGC = gds[i].getDefaultConfiguration();
++ }
+ }
+ }
++ } finally {
++ XToolkit.awtLock();
+ }
+ if (newScreenNum != curScreenNum) {
+ if (log.isLoggable(PlatformLogger.Level.FINEST)) {
+--- ./jdk/src/solaris/classes/sun/awt/X11ComponentPeer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/awt/X11ComponentPeer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -32,6 +32,7 @@
+ import java.awt.Graphics;
+
+ public interface X11ComponentPeer {
++ long getWindow();
+ long getContentWindow();
+ SurfaceData getSurfaceData();
+ GraphicsConfiguration getGraphicsConfiguration();
+--- ./jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java Wed Jul 01 21:53:30 2015 -0700
+@@ -286,7 +286,6 @@
+ * Returns true only if:
+ * - the Xrandr extension is present
+ * - the necessary Xrandr functions were loaded successfully
+- * - XINERAMA is not enabled
+ */
+ private static synchronized boolean isXrandrExtensionSupported() {
+ if (xrandrExtSupported == null) {
+@@ -298,11 +297,7 @@
+
+ @Override
+ public boolean isFullScreenSupported() {
+- // REMIND: for now we will only allow fullscreen exclusive mode
+- // on the primary screen; we could change this behavior slightly
+- // in the future by allowing only one screen to be in fullscreen
+- // exclusive mode at any given time...
+- boolean fsAvailable = (screen == 0) && isXrandrExtensionSupported();
++ boolean fsAvailable = isXrandrExtensionSupported();
+ if (fsAvailable) {
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+@@ -322,13 +317,15 @@
+
+ @Override
+ public boolean isDisplayChangeSupported() {
+- return (isFullScreenSupported() && (getFullScreenWindow() != null));
++ return (isFullScreenSupported()
++ && !((X11GraphicsEnvironment) GraphicsEnvironment
++ .getLocalGraphicsEnvironment()).runningXinerama());
+ }
+
+ private static void enterFullScreenExclusive(Window w) {
+ X11ComponentPeer peer = (X11ComponentPeer)w.getPeer();
+ if (peer != null) {
+- enterFullScreenExclusive(peer.getContentWindow());
++ enterFullScreenExclusive(peer.getWindow());
+ peer.setFullScreenExclusiveModeState(true);
+ }
+ }
+@@ -337,7 +334,7 @@
+ X11ComponentPeer peer = (X11ComponentPeer)w.getPeer();
+ if (peer != null) {
+ peer.setFullScreenExclusiveModeState(false);
+- exitFullScreenExclusive(peer.getContentWindow());
++ exitFullScreenExclusive(peer.getWindow());
+ }
+ }
+
+@@ -352,7 +349,9 @@
+ if (fsSupported && old != null) {
+ // enter windowed mode (and restore original display mode)
+ exitFullScreenExclusive(old);
+- setDisplayMode(origDisplayMode);
++ if (isDisplayChangeSupported()) {
++ setDisplayMode(origDisplayMode);
++ }
+ }
+
+ super.setFullScreenWindow(w);
+@@ -379,7 +378,11 @@
+ @Override
+ public synchronized DisplayMode getDisplayMode() {
+ if (isFullScreenSupported()) {
+- return getCurrentDisplayMode(screen);
++ DisplayMode mode = getCurrentDisplayMode(screen);
++ if (mode == null) {
++ mode = getDefaultDisplayMode();
++ }
++ return mode;
+ } else {
+ if (origDisplayMode == null) {
+ origDisplayMode = getDefaultDisplayMode();
+@@ -431,7 +434,9 @@
+ Window old = getFullScreenWindow();
+ if (old != null) {
+ exitFullScreenExclusive(old);
+- setDisplayMode(origDisplayMode);
++ if (isDisplayChangeSupported()) {
++ setDisplayMode(origDisplayMode);
++ }
+ }
+ };
+ Thread t = new Thread(rootTG, r,"Display-Change-Shutdown-Thread-"+screen);
+--- ./jdk/src/solaris/classes/sun/font/FcFontConfiguration.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/font/FcFontConfiguration.java Wed Jul 01 21:53:30 2015 -0700
+@@ -180,7 +180,7 @@
+ String[] componentFaceNames = cfi[idx].getComponentFaceNames();
+ FontDescriptor[] ret = new FontDescriptor[componentFaceNames.length];
+ for (int i = 0; i < componentFaceNames.length; i++) {
+- ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.UTF_8.newEncoder(), new int[0]);
++ ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.ISO_8859_1.newEncoder(), new int[0]);
+ }
+
+ return ret;
+--- ./jdk/src/solaris/classes/sun/java2d/xr/XRSolidSrcPict.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/java2d/xr/XRSolidSrcPict.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ /*
+- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
+-
++ * Copyright (c) 2013, 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
+--- ./jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -85,6 +85,15 @@
+ if (val.charAt(0) == '#' || val.charAt(0) == ';') {
+ break;
+ }
++ if ("nameserver".equals(keyword)) {
++ if (val.indexOf(':') >= 0 &&
++ val.indexOf('.') < 0 && // skip for IPv4 literals with port
++ val.indexOf('[') < 0 &&
++ val.indexOf(']') < 0 ) {
++ // IPv6 literal, in non-BSD-style.
++ val = "[" + val + "]";
++ }
++ }
+ ll.add(val);
+ if (--maxvalues == 0) {
+ break;
+--- ./jdk/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -25,10 +25,10 @@
+
+ package sun.nio.ch;
+
+-import java.io.*;
++import java.io.FileDescriptor;
++import java.io.IOException;
+
+-class FileDispatcherImpl extends FileDispatcher
+-{
++class FileDispatcherImpl extends FileDispatcher {
+
+ static {
+ IOUtil.load();
+@@ -108,6 +108,14 @@
+ return new FileDescriptor();
+ }
+
++ boolean canTransferToDirectly(java.nio.channels.SelectableChannel sc) {
++ return true;
++ }
++
++ boolean transferToDirectlyNeedsPositionLock() {
++ return false;
++ }
++
+ // -- Native methods --
+
+ static native int read0(FileDescriptor fd, long address, int len)
+--- ./jdk/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.
++ * 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
+--- ./jdk/src/solaris/doc/sun/man/man1/appletviewer.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/appletviewer.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1995, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: appletviewer.1
+-.\"
+-.if n .pl 99999
+-.TH appletviewer 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: appletviewer.1
++.\"
++.if n .pl 99999
++.TH appletviewer 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,42 +47,42 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-appletviewer \- Runs applets outside of a web browser\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBappletviewer\fR [\fIoptions\fR] \fIurl\fR\&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options separated by spaces\&. See Options\&.
+-.TP
+-\fIurl\fR
+-The location of the documents or resources to be displayed\&. You can specify multiple URLs separated by spaces\&.
+-.SH DESCRIPTION
+-The \f3appletviewer\fR command connects to the documents or resources designated by \fIurls\fR and displays each applet referenced by the documents in its own window\&. If the documents referred to by urls do not reference any applets with the \f3OBJECT\fR, \f3EMBED\fR, or \f3APPLET\fR tag, then the \f3appletviewer\fR command does nothing\&. For details about the HTML tags that the \f3appletviewer\fR command supports, see AppletViewer Tags at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.html
+-.PP
+-The \f3appletviewer\fR command requires encoded URLs according to the escaping mechanism defined in RFC2396\&. Only encoded URLs are supported\&. However, file names must be unencoded, as specified in RFC2396\&.
+-.PP
+-\fINote:\fR The \f3appletviewer\fR command is intended for development purposes only\&. For more information, see About Sample/Test Applications and Code at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.html
+-.SH OPTIONS
+-.TP
+--debug
+-.br
+-Starts the Applet Viewer in the Java debugger with the \f3jdb\fR command to debug the applets in the document\&.
+-.TP
+--encoding \fIencoding-name\fR
+-.br
+-Specifies the input HTML file encoding name\&.
+-.TP
+--J\fIjavaoption\fR
+-.br
+-Passes the string \f3javaoption\fR as a single argument to the Java interpreter, which runs the Applet Viewer\&. The argument should not contain spaces\&. Multiple argument words must all begin with the prefix \f3-J\fR\&. This is useful for adjusting the compiler\&'s execution environment or memory usage\&.
+-.PP
++
++.SH NAME
++appletviewer \- Runs applets outside of a web browser\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBappletviewer\fR [\fIoptions\fR] \fIurl\fR\&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options separated by spaces\&. See Options\&.
++.TP
++\fIurl\fR
++The location of the documents or resources to be displayed\&. You can specify multiple URLs separated by spaces\&.
++.SH DESCRIPTION
++The \f3appletviewer\fR command connects to the documents or resources designated by \fIurls\fR and displays each applet referenced by the documents in its own window\&. If the documents referred to by urls do not reference any applets with the \f3OBJECT\fR, \f3EMBED\fR, or \f3APPLET\fR tag, then the \f3appletviewer\fR command does nothing\&. For details about the HTML tags that the \f3appletviewer\fR command supports, see AppletViewer Tags at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.html
++.PP
++The \f3appletviewer\fR command requires encoded URLs according to the escaping mechanism defined in RFC2396\&. Only encoded URLs are supported\&. However, file names must be unencoded, as specified in RFC2396\&.
++.PP
++\fINote:\fR The \f3appletviewer\fR command is intended for development purposes only\&. For more information, see About Sample/Test Applications and Code at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.html
++.SH OPTIONS
++.TP
++-debug
++.br
++Starts the Applet Viewer in the Java debugger with the \f3jdb\fR command to debug the applets in the document\&.
++.TP
++-encoding \fIencoding-name\fR
++.br
++Specifies the input HTML file encoding name\&.
++.TP
++-J\fIjavaoption\fR
++.br
++Passes the string \f3javaoption\fR as a single argument to the Java interpreter, which runs the Applet Viewer\&. The argument should not contain spaces\&. Multiple argument words must all begin with the prefix \f3-J\fR\&. This is useful for adjusting the compiler\&'s execution environment or memory usage\&.
++.PP
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/extcheck.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/extcheck.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: extcheck.1
+-.\"
+-.if n .pl 99999
+-.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: extcheck.1
++.\"
++.if n .pl 99999
++.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,43 +47,43 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fItargetfile\&.jar\fR
+-The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
+-.SH DESCRIPTION
+-The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
+-.PP
+-The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
+-.PP
+-If no conflict is detected, then the return code is 0\&.
+-.PP
+-If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
+-.SH OPTIONS
+-.TP
+--verbose
+-.br
+-Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
++
++.SH NAME
++extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fItargetfile\&.jar\fR
++The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
++.SH DESCRIPTION
++The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
++.PP
++The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
++.PP
++If no conflict is detected, then the return code is 0\&.
++.PP
++If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
++.SH OPTIONS
++.TP
++-verbose
++.br
++Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/idlj.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/idlj.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: idlj.1
+-.\"
+-.if n .pl 99999
+-.TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: idlj.1
++.\"
++.if n .pl 99999
++.TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,520 +47,520 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBidlj\fR [ \fIoptions\fR ] \fIidlfile\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&. Options can appear in any order, but must precede the \f3idlfile\fR\&.
+-.TP
+-\fIidlfile\fR
+-The name of a file that contains Interface Definition Language (IDL) definitions\&.
+-.SH DESCRIPTION
+-The IDL-to-Java Compiler generates the Java bindings for a specified IDL file\&. For binding details, see Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
+-.PP
+-Some earlier releases of the IDL-to-Java compiler were named \f3idltojava\fR\&.
+-.SS EMIT\ CLIENT\ AND\ SERVER\ BINDINGS
+-The following \f3idlj\fR command generates an IDL file named \f3My\&.idl\fR with client-side bindings\&.
+-.sp
+-.nf
+-\f3idlj My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The previous syntax is equivalent to the following:
+-.sp
+-.nf
+-\f3idlj \-fclient My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The next example generates the server-side bindings, and includes the client-side bindings plus the skeleton, all of which are POA (Inheritance Model)\&.
+-.sp
+-.nf
+-\f3idlg \-fserver My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you want to generate both client and server-side bindings, then use one of the following (equivalent) commands:
+-.sp
+-.nf
+-\f3idlj \-fclient \-fserver My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There are two possible server-side models: the Portal Servant Inheritance Model and the Tie Model\&. See Tie Delegation Model\&.
+-.PP
+-\f3Portable Servant Inheritance Model\fR\&. The default server-side model is the Portable Servant Inheritance Model\&. Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3MyPOA\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3MyPOA\fR class\&. \f3MyPOA\&.java\fR is a stream-based skeleton that extends the \f3org\&.omg\&.PortableServer\&.Servant\fR class at http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.html The \f3My\fR interface implements the \f3callHandler\fR interface and the operations interface associated with the IDL interface the skeleton implements\&.The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. See Portable Object Adapter (POA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.html In the Java programming language, the \f3Servant\fR type is mapped to the Java \f3org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&.Another option for the Inheritance Model is to use the \f3-oldImplBase\fR flag to generate server-side bindings that are compatible with releases of the Java programming language before Java SE 1\&.4\&. The -\f3oldImplBase\fR flag is nonstandard, and these APIs are deprecated\&. You would use this flag only for compatibility with existing servers written in Java SE 1\&.3\&. In that case, you would need to modify an existing make file to add the \f3-oldImplBase\fR flag to the \f3idlj\fR compiler\&. Otherwise POA-based server-side mappings are generated\&. To generate server-side bindings that are backward compatible, do the following:
+-.sp
+-.nf
+-\f3idlj \-fclient \-fserver \-oldImplBase My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fall \-oldImplBase My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3_MyImplBase\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3_MyImplBase\fR class\&.
+-.PP
+-\f3Tie Delegation Model\fR\&. The other server-side model is called the Tie Model\&. This is a delegation model\&. Because it is not possible to generate ties and skeletons at the same time, they must be generated separately\&. The following commands generate the bindings for the Tie Model:
+-.sp
+-.nf
+-\f3idlj \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-fallTIE My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-For the \f3My\fR interface, the second command generates \f3MyPOATie\&.java\fR\&. The constructor to the \f3MyPOATie\fR class takes a delegate\&. In this example, using the default POA model, the constructor also needs a POA\&. You must provide the implementation for the delegate, but it does not have to inherit from any other class, only the interface \f3MyOperations\fR\&. To use it with the ORB, you must wrap your implementation within the \f3MyPOATie\fR class, for example:
+-.sp
+-.nf
+-\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// Get reference to rootpoa & activate the POAManager\fP
+-.fi
+-.nf
+-\f3POA rootpoa = (POA)orb\&.resolve_initial_references("RootPOA");\fP
+-.fi
+-.nf
+-\f3rootpoa\&.the_POAManager()\&.activate();\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create servant and register it with the ORB\fP
+-.fi
+-.nf
+-\f3MyServant myDelegate = new MyServant();\fP
+-.fi
+-.nf
+-\f3myDelegate\&.setORB(orb); \fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create a tie, with servant being the delegate\&.\fP
+-.fi
+-.nf
+-\f3MyPOATie tie = new MyPOATie(myDelegate, rootpoa);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// obtain the objectRef for the tie\fP
+-.fi
+-.nf
+-\f3My ref = tie\&._this(orb);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-You might want to use the Tie model instead of the typical Inheritance model when your implementation must inherit from some other implementation\&. Java allows any number of interface inheritance, but there is only one slot for class inheritance\&. If you use the inheritance model, then that slot is used up\&. With the Tie Model, that slot is freed up for your own use\&. The drawback is that it introduces a level of indirection: one extra method call occurs when a method is called\&.
+-.PP
+-For server-side generation, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions earlier than Java SE 1\&.4\&.
+-.sp
+-.nf
+-\f3idlj \-oldImplBase \-fall My\&.idl\fP
+-.fi
+-.nf
+-\f3idlj \-oldImplBase \-fallTIE My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-For the \f3My\fR interface, the this generates \f3My_Tie\&.java\fR\&. The constructor to the \f3My_Tie\fR class takes an \f3impl\fR object\&. You must provide the implementation for \f3impl\fR, but it does not have to inherit from any other class, only the interface \f3HelloOperations\fR\&. But to use it with the ORB, you must wrap your implementation within \f3My_Tie\fR, for example:
+-.sp
+-.nf
+-\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create servant and register it with the ORB\fP
+-.fi
+-.nf
+-\f3MyServant myDelegate = new MyServant();\fP
+-.fi
+-.nf
+-\f3myDelegate\&.setORB(orb); \fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// create a tie, with servant being the delegate\&.\fP
+-.fi
+-.nf
+-\f3MyPOATie tie = new MyPOATie(myDelegate);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3// obtain the objectRef for the tie\fP
+-.fi
+-.nf
+-\f3My ref = tie\&._this(orb);\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ EMITTED\ FILES
+-If you want to direct the emitted files to a directory other than the current directory, then call the compiler this way: \f3i\fR\f3dlj -td /altdir My\&.idl\fR\&.
+-.PP
+-For the \f3My\fR interface, the bindings are emitted to \f3/altdir/My\&.java\fR, etc\&., instead of \f3\&./My\&.java\fR\&.
+-.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ INCLUDE\ FILES
+-If the \f3My\&.idl\fR file includes another \f3idl\fR file, \f3MyOther\&.idl\fR, then the compiler assumes that the \f3MyOther\&.idl\fR file resides in the local directory\&. If it resides in \f3/includes\fR, for example, then you call the compiler with the following command:
+-.sp
+-.nf
+-\f3idlj \-i /includes My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If \f3My\&.idl\fR also included \f3Another\&.idl\fR that resided in \f3/moreIncludes\fR, for example, then you call the compiler with the following command:
+-.sp
+-.nf
+-\f3idlj \-i /includes \-i /moreIncludes My\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Because this form of \f3include\fR can become long, another way to indicate to the compiler where to search for included files is provided\&. This technique is similar to the idea of an environment variable\&. Create a file named idl\&.config in a directory that is listed in your \f3CLASSPATH\fR variable\&. Inside of \f3idl\&.config\fR, provide a line with the following form:
+-.sp
+-.nf
+-\f3includes=/includes;/moreIncludes\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The compiler will find this file and read in the includes list\&. Note that in this example the separator character between the two directories is a semicolon (;)\&. This separator character is platform dependent\&. On the Windows platform, use a semicolon, on the Unix platform, use a colon, and so on\&.
+-.SS EMIT\ BINDINGS\ FOR\ INCLUDE\ FILES
+-By default, only those interfaces, structures, and so on, that are defined in the \f3idl\fR file on the command line have Java bindings generated for them\&. The types defined in included files are not generated\&. For example, assume the following two \f3idl\fR files:
+-.sp
+-.nf
+-\f3My\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3#include <MyOther\&.idl>\fP
+-.fi
+-.nf
+-\f3interface My\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3MyOther\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3interface MyOther\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There is a caveat to the default rule\&. Any \f3#include\fR statements that appear at the global scope are treated as described\&. These \f3#include\fR statements can be thought of as import statements\&. The \f3#include\fR statements that appear within an enclosed scope are treated as true \f3#include\fR statements, which means that the code within the included file is treated as though it appeared in the original file and, therefore, Java bindings are emitted for it\&. Here is an example:
+-.sp
+-.nf
+-\f3My\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3#include <MyOther\&.idl>\fP
+-.fi
+-.nf
+-\f3interface My\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 #include <Embedded\&.idl>\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3MyOther\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3interface MyOther\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3Embedded\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3enum E {one, two, three};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Run\f3idlj My\&.idl\fRto generate the following list of Java files\&. Notice that \f3MyOther\&.java\fR is not generated because it is defined in an import-like \f3#include\fR\&. But \f3E\&.java\fR was generated because it was defined in a true \f3#include\fR\&. Notice that because the \f3Embedded\&.idl\fR file is included within the scope of the interface \f3My\fR, it appears within the scope of \f3My\fR (in \f3MyPackage\fR)\&. If the \f3-emitAll\fR flag had been used, then all types in all included files would have been emitted\&.
+-.sp
+-.nf
+-\f3\&./MyHolder\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyHelper\&.java\fP
+-.fi
+-.nf
+-\f3\&./_MyStub\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/EHolder\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/EHelper\&.java\fP
+-.fi
+-.nf
+-\f3\&./MyPackage/E\&.java\fP
+-.fi
+-.nf
+-\f3\&./My\&.java\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS INSERT\ PACKAGE\ PREFIXES
+-Suppose that you work for a company named ABC that has constructed the following IDL file:
+-.sp
+-.nf
+-\f3Widgets\&.idl file:\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3module Widgets\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 interface W1 {\&.\&.\&.};\fP
+-.fi
+-.nf
+-\f3 interface W2 {\&.\&.\&.};\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you run this file through the IDL-to-Java compiler, then the Java bindings for W1 and W2 are placed within the \f3Widgets\fR package\&. There is an industry convention that states that a company\&'s packages should reside within a package named \f3com\&.<company name>\fR\&. To follow this convention, the package name should be \f3com\&.abc\&.Widgets\fR\&. To place this package prefix onto the Widgets module, execute the following:
+-.sp
+-.nf
+-\f3idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you have an IDL file that includes Widgets\&.idl, then the \f3-pkgPrefix\fR flag must appear in that command also\&. If it does not, then your IDL file will be looking for a \f3Widgets\fR package rather than a \f3com\&.abc\&.Widgets\fR package\&.
+-.PP
+-If you have a number of these packages that require prefixes, then it might be easier to place them into the idl\&.config file described previously\&. Each package prefix line should be of the form: \f3PkgPrefix\&.<type>=<prefix>\fR\&. The line for the previous example would be \f3PkgPrefix\&.Widgets=com\&.abc\fR\&. This option does not affect the Repository ID\&.
+-.SS DEFINE\ SYMBOLS\ BEFORE\ COMPILATION
+-You might need to define a symbol for compilation that is not defined within the IDL file, perhaps to include debugging code in the bindings\&. The command \f3idlj -d MYDEF My\&.idl\fRis equivalent to putting the line \f3#define MYDEF\fR inside My\&.idl\&.
+-.SS PRESERVE\ PREEXISTING\ BINDINGS
+-If the Java binding files already exist, then the \f3-keep\fR flag keeps the compiler from overwriting them\&. The default is to generate all files without considering that they already exist\&. If you have customized those files (which you should not do unless you are very comfortable with their contents), then the \f3-keep\fR option is very useful\&. The command \f3idlj -keep My\&.idl\fR emits all client-side bindings that do not already exist\&.
+-.SS VIEW\ COMPILATION\ PROGRESS
+-The IDL-to-Java compiler generates status messages as it progresses through its phases of execution\&. Use the \f3-v\fR option to activate the verbose mode: \f3idlj -v My\&.idl\fR\&.
+-.PP
+-By default the compiler does not operate in verbose mode
+-.SS DISPLAY\ VERSION\ INFORMATION
+-To display the build version of the IDL-to-Java compiler, specify the \f3-version\fR option on the command-line: \f3idlj -version\fR\&.
+-.PP
+-Version information also appears within the bindings generated by the compiler\&. Any additional options appearing on the command-line are ignored\&.
+-.SH OPTIONS
+-.TP
+--d \fIsymbol\fR
+-.br
+-This is equivalent to the following line in an IDL file:
+-.sp
+-.nf
+-\f3#define \fIsymbol\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--demitAll
+-.br
+-Emit all types, including those found in \f3#include\fR files\&.
+-.TP
+--fside
+-.br
+-Defines what bindings to emit\&. The \f3side\fR parameter can be \f3client\fR, \f3server\fR, \f3serverTIE\fR, \f3all\fR, or \f3allTIE\fR\&. The \f3-fserverTIE\fR and \f3-fallTIE\fR options cause delegate model skeletons to be emitted\&. Defaults to \f3-fclient\fR when the flag is not specified\&.
+-.TP
+--i \fIinclude-path\fR
+-.br
+-By default, the current directory is scanned for included files\&. This option adds another directory\&.
+-.TP
+--i \fIkeep\fR
+-.br
+-If a file to be generated already exists, then do not overwrite it\&. By default it is overwritten\&.
+-.TP
+--noWarn
+-.br
+-Suppress warning messages\&.
+-.TP
+--oldImplBase
+-.br
+-Generates skeletons compatible with pre-1\&.4 JDK ORBs\&. By default, the POA Inheritance Model server-side bindings are generated\&. This option provides backward-compatibility with earlier releases of the Java programming language by generating server-side bindings that are \f3ImplBase\fR Inheritance Model classes\&.
+-.TP
+--pkgPrefix \fItype\fR\fIprefix\fR
+-.br
+-Wherever \f3type\fR is encountered at file scope, prefix the generated Java package name with \f3prefix\fR for all files generated for that type\&. The type is the simple name of either a top-level module, or an IDL type defined outside of any module\&.
+-.TP
+--pkgTranslate \fItype\fR\fIpackage\fR
+-.br
+-Whenever the module name type is encountered in an identifier, replace it in the identifier with package for all files in the generated Java package\&. Note that \f3pkgPrefix\fR changes are made first\&. The type value is the simple name of either a top-level module, or an IDL type defined outside of any module and must match the full package name exactly\&.
+-
+-If more than one translation matches an identifier, then the longest match is chosen as shown in the following example:
+-
+-\fICommand\fR:
+-.sp
+-.nf
+-\f3pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-\fIResulting Translation\fR:
+-.sp
+-.nf
+-\f3type => pkg\fP
+-.fi
+-.nf
+-\f3type\&.ext => pkg\&.ext\fP
+-.fi
+-.nf
+-\f3type\&.baz => pkg2\&.fizz\fP
+-.fi
+-.nf
+-\f3type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-The following package names \f3org\fR, \f3org\fR\&.o\f3mg\fR, or any subpackages of \f3org\&.omg\fR cannot be translated\&. Any attempt to translate these packages results in uncompilable code, and the use of these packages as the first argument after \f3-pkgTranslate\fR is treated as an error\&.
+-.TP
+--skeletonName \fIxxx%yyy\fR
+-.br
+-Use \f3xxx%yyy\fR as the pattern for naming the skeleton\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserver\fR or \f3-fall\fR), and \f3_%ImplBase\fR for the \f3oldImplBase\fR class (-\f3oldImplBase\fR) and (\f3-fserver\fR or \f3-fall\fR))\&.
+-.TP
+--td \fIdir\fR
+-.br
+-Use \fIdir\fR for the output directory instead of the current directory\&.
+-.TP
+--tieName \fIxxx%yyy\fR
+-.br
+-Use \f3xxx%yyy\fR according to the pattern\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserverTie or -fallTie\fR), and \f3_%Tie\fR for the \f3oldImplBase\fR tie class (-\f3oldImplBase\fR) and (\f3-fserverTie\fR or \f3-fallTie\fR))
+-.TP
+--nowarn, -verbose
+-.br
+-Displays release information and terminates\&.
+-.TP
+--version
+-.br
+-Displays release information and terminates\&.
+-.SH RESTRICTIONS
+-Escaped identifiers in the global scope cannot have the same spelling as IDL primitive types, \f3Object\fR, or \f3ValueBase\fR\&. This is because the symbol table is preloaded with these identifiers\&. Allowing them to be redefined would overwrite their original definitions\&. Possible permanent restriction\&.
+-.PP
+-The \f3fixed\fR IDL type is not supported\&.
+-.SH KNOWN\ PROBLEMS
+-No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&.
++
++.SH NAME
++idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBidlj\fR [ \fIoptions\fR ] \fIidlfile\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&. Options can appear in any order, but must precede the \f3idlfile\fR\&.
++.TP
++\fIidlfile\fR
++The name of a file that contains Interface Definition Language (IDL) definitions\&.
++.SH DESCRIPTION
++The IDL-to-Java Compiler generates the Java bindings for a specified IDL file\&. For binding details, see Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
++.PP
++Some earlier releases of the IDL-to-Java compiler were named \f3idltojava\fR\&.
++.SS EMIT\ CLIENT\ AND\ SERVER\ BINDINGS
++The following \f3idlj\fR command generates an IDL file named \f3My\&.idl\fR with client-side bindings\&.
++.sp
++.nf
++\f3idlj My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The previous syntax is equivalent to the following:
++.sp
++.nf
++\f3idlj \-fclient My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The next example generates the server-side bindings, and includes the client-side bindings plus the skeleton, all of which are POA (Inheritance Model)\&.
++.sp
++.nf
++\f3idlg \-fserver My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you want to generate both client and server-side bindings, then use one of the following (equivalent) commands:
++.sp
++.nf
++\f3idlj \-fclient \-fserver My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fall My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There are two possible server-side models: the Portal Servant Inheritance Model and the Tie Model\&. See Tie Delegation Model\&.
++.PP
++\f3Portable Servant Inheritance Model\fR\&. The default server-side model is the Portable Servant Inheritance Model\&. Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3MyPOA\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3MyPOA\fR class\&. \f3MyPOA\&.java\fR is a stream-based skeleton that extends the \f3org\&.omg\&.PortableServer\&.Servant\fR class at http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.html The \f3My\fR interface implements the \f3callHandler\fR interface and the operations interface associated with the IDL interface the skeleton implements\&.The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. See Portable Object Adapter (POA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.html In the Java programming language, the \f3Servant\fR type is mapped to the Java \f3org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&.Another option for the Inheritance Model is to use the \f3-oldImplBase\fR flag to generate server-side bindings that are compatible with releases of the Java programming language before Java SE 1\&.4\&. The -\f3oldImplBase\fR flag is nonstandard, and these APIs are deprecated\&. You would use this flag only for compatibility with existing servers written in Java SE 1\&.3\&. In that case, you would need to modify an existing make file to add the \f3-oldImplBase\fR flag to the \f3idlj\fR compiler\&. Otherwise POA-based server-side mappings are generated\&. To generate server-side bindings that are backward compatible, do the following:
++.sp
++.nf
++\f3idlj \-fclient \-fserver \-oldImplBase My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fall \-oldImplBase My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3_MyImplBase\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3_MyImplBase\fR class\&.
++.PP
++\f3Tie Delegation Model\fR\&. The other server-side model is called the Tie Model\&. This is a delegation model\&. Because it is not possible to generate ties and skeletons at the same time, they must be generated separately\&. The following commands generate the bindings for the Tie Model:
++.sp
++.nf
++\f3idlj \-fall My\&.idl\fP
++.fi
++.nf
++\f3idlj \-fallTIE My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++For the \f3My\fR interface, the second command generates \f3MyPOATie\&.java\fR\&. The constructor to the \f3MyPOATie\fR class takes a delegate\&. In this example, using the default POA model, the constructor also needs a POA\&. You must provide the implementation for the delegate, but it does not have to inherit from any other class, only the interface \f3MyOperations\fR\&. To use it with the ORB, you must wrap your implementation within the \f3MyPOATie\fR class, for example:
++.sp
++.nf
++\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// Get reference to rootpoa & activate the POAManager\fP
++.fi
++.nf
++\f3POA rootpoa = (POA)orb\&.resolve_initial_references("RootPOA");\fP
++.fi
++.nf
++\f3rootpoa\&.the_POAManager()\&.activate();\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create servant and register it with the ORB\fP
++.fi
++.nf
++\f3MyServant myDelegate = new MyServant();\fP
++.fi
++.nf
++\f3myDelegate\&.setORB(orb); \fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create a tie, with servant being the delegate\&.\fP
++.fi
++.nf
++\f3MyPOATie tie = new MyPOATie(myDelegate, rootpoa);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// obtain the objectRef for the tie\fP
++.fi
++.nf
++\f3My ref = tie\&._this(orb);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++You might want to use the Tie model instead of the typical Inheritance model when your implementation must inherit from some other implementation\&. Java allows any number of interface inheritance, but there is only one slot for class inheritance\&. If you use the inheritance model, then that slot is used up\&. With the Tie Model, that slot is freed up for your own use\&. The drawback is that it introduces a level of indirection: one extra method call occurs when a method is called\&.
++.PP
++For server-side generation, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions earlier than Java SE 1\&.4\&.
++.sp
++.nf
++\f3idlj \-oldImplBase \-fall My\&.idl\fP
++.fi
++.nf
++\f3idlj \-oldImplBase \-fallTIE My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++For the \f3My\fR interface, the this generates \f3My_Tie\&.java\fR\&. The constructor to the \f3My_Tie\fR class takes an \f3impl\fR object\&. You must provide the implementation for \f3impl\fR, but it does not have to inherit from any other class, only the interface \f3HelloOperations\fR\&. But to use it with the ORB, you must wrap your implementation within \f3My_Tie\fR, for example:
++.sp
++.nf
++\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create servant and register it with the ORB\fP
++.fi
++.nf
++\f3MyServant myDelegate = new MyServant();\fP
++.fi
++.nf
++\f3myDelegate\&.setORB(orb); \fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// create a tie, with servant being the delegate\&.\fP
++.fi
++.nf
++\f3MyPOATie tie = new MyPOATie(myDelegate);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3// obtain the objectRef for the tie\fP
++.fi
++.nf
++\f3My ref = tie\&._this(orb);\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ EMITTED\ FILES
++If you want to direct the emitted files to a directory other than the current directory, then call the compiler this way: \f3i\fR\f3dlj -td /altdir My\&.idl\fR\&.
++.PP
++For the \f3My\fR interface, the bindings are emitted to \f3/altdir/My\&.java\fR, etc\&., instead of \f3\&./My\&.java\fR\&.
++.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ INCLUDE\ FILES
++If the \f3My\&.idl\fR file includes another \f3idl\fR file, \f3MyOther\&.idl\fR, then the compiler assumes that the \f3MyOther\&.idl\fR file resides in the local directory\&. If it resides in \f3/includes\fR, for example, then you call the compiler with the following command:
++.sp
++.nf
++\f3idlj \-i /includes My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If \f3My\&.idl\fR also included \f3Another\&.idl\fR that resided in \f3/moreIncludes\fR, for example, then you call the compiler with the following command:
++.sp
++.nf
++\f3idlj \-i /includes \-i /moreIncludes My\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Because this form of \f3include\fR can become long, another way to indicate to the compiler where to search for included files is provided\&. This technique is similar to the idea of an environment variable\&. Create a file named idl\&.config in a directory that is listed in your \f3CLASSPATH\fR variable\&. Inside of \f3idl\&.config\fR, provide a line with the following form:
++.sp
++.nf
++\f3includes=/includes;/moreIncludes\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The compiler will find this file and read in the includes list\&. Note that in this example the separator character between the two directories is a semicolon (;)\&. This separator character is platform dependent\&. On the Windows platform, use a semicolon, on the Unix platform, use a colon, and so on\&.
++.SS EMIT\ BINDINGS\ FOR\ INCLUDE\ FILES
++By default, only those interfaces, structures, and so on, that are defined in the \f3idl\fR file on the command line have Java bindings generated for them\&. The types defined in included files are not generated\&. For example, assume the following two \f3idl\fR files:
++.sp
++.nf
++\f3My\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3#include <MyOther\&.idl>\fP
++.fi
++.nf
++\f3interface My\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3MyOther\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3interface MyOther\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There is a caveat to the default rule\&. Any \f3#include\fR statements that appear at the global scope are treated as described\&. These \f3#include\fR statements can be thought of as import statements\&. The \f3#include\fR statements that appear within an enclosed scope are treated as true \f3#include\fR statements, which means that the code within the included file is treated as though it appeared in the original file and, therefore, Java bindings are emitted for it\&. Here is an example:
++.sp
++.nf
++\f3My\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3#include <MyOther\&.idl>\fP
++.fi
++.nf
++\f3interface My\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 #include <Embedded\&.idl>\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3MyOther\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3interface MyOther\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3Embedded\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3enum E {one, two, three};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Run\f3idlj My\&.idl\fRto generate the following list of Java files\&. Notice that \f3MyOther\&.java\fR is not generated because it is defined in an import-like \f3#include\fR\&. But \f3E\&.java\fR was generated because it was defined in a true \f3#include\fR\&. Notice that because the \f3Embedded\&.idl\fR file is included within the scope of the interface \f3My\fR, it appears within the scope of \f3My\fR (in \f3MyPackage\fR)\&. If the \f3-emitAll\fR flag had been used, then all types in all included files would have been emitted\&.
++.sp
++.nf
++\f3\&./MyHolder\&.java\fP
++.fi
++.nf
++\f3\&./MyHelper\&.java\fP
++.fi
++.nf
++\f3\&./_MyStub\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage\fP
++.fi
++.nf
++\f3\&./MyPackage/EHolder\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage/EHelper\&.java\fP
++.fi
++.nf
++\f3\&./MyPackage/E\&.java\fP
++.fi
++.nf
++\f3\&./My\&.java\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS INSERT\ PACKAGE\ PREFIXES
++Suppose that you work for a company named ABC that has constructed the following IDL file:
++.sp
++.nf
++\f3Widgets\&.idl file:\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3module Widgets\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 interface W1 {\&.\&.\&.};\fP
++.fi
++.nf
++\f3 interface W2 {\&.\&.\&.};\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you run this file through the IDL-to-Java compiler, then the Java bindings for W1 and W2 are placed within the \f3Widgets\fR package\&. There is an industry convention that states that a company\&'s packages should reside within a package named \f3com\&.<company name>\fR\&. To follow this convention, the package name should be \f3com\&.abc\&.Widgets\fR\&. To place this package prefix onto the Widgets module, execute the following:
++.sp
++.nf
++\f3idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you have an IDL file that includes Widgets\&.idl, then the \f3-pkgPrefix\fR flag must appear in that command also\&. If it does not, then your IDL file will be looking for a \f3Widgets\fR package rather than a \f3com\&.abc\&.Widgets\fR package\&.
++.PP
++If you have a number of these packages that require prefixes, then it might be easier to place them into the idl\&.config file described previously\&. Each package prefix line should be of the form: \f3PkgPrefix\&.<type>=<prefix>\fR\&. The line for the previous example would be \f3PkgPrefix\&.Widgets=com\&.abc\fR\&. This option does not affect the Repository ID\&.
++.SS DEFINE\ SYMBOLS\ BEFORE\ COMPILATION
++You might need to define a symbol for compilation that is not defined within the IDL file, perhaps to include debugging code in the bindings\&. The command \f3idlj -d MYDEF My\&.idl\fRis equivalent to putting the line \f3#define MYDEF\fR inside My\&.idl\&.
++.SS PRESERVE\ PREEXISTING\ BINDINGS
++If the Java binding files already exist, then the \f3-keep\fR flag keeps the compiler from overwriting them\&. The default is to generate all files without considering that they already exist\&. If you have customized those files (which you should not do unless you are very comfortable with their contents), then the \f3-keep\fR option is very useful\&. The command \f3idlj -keep My\&.idl\fR emits all client-side bindings that do not already exist\&.
++.SS VIEW\ COMPILATION\ PROGRESS
++The IDL-to-Java compiler generates status messages as it progresses through its phases of execution\&. Use the \f3-v\fR option to activate the verbose mode: \f3idlj -v My\&.idl\fR\&.
++.PP
++By default the compiler does not operate in verbose mode
++.SS DISPLAY\ VERSION\ INFORMATION
++To display the build version of the IDL-to-Java compiler, specify the \f3-version\fR option on the command-line: \f3idlj -version\fR\&.
++.PP
++Version information also appears within the bindings generated by the compiler\&. Any additional options appearing on the command-line are ignored\&.
++.SH OPTIONS
++.TP
++-d \fIsymbol\fR
++.br
++This is equivalent to the following line in an IDL file:
++.sp
++.nf
++\f3#define \fIsymbol\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-demitAll
++.br
++Emit all types, including those found in \f3#include\fR files\&.
++.TP
++-fside
++.br
++Defines what bindings to emit\&. The \f3side\fR parameter can be \f3client\fR, \f3server\fR, \f3serverTIE\fR, \f3all\fR, or \f3allTIE\fR\&. The \f3-fserverTIE\fR and \f3-fallTIE\fR options cause delegate model skeletons to be emitted\&. Defaults to \f3-fclient\fR when the flag is not specified\&.
++.TP
++-i \fIinclude-path\fR
++.br
++By default, the current directory is scanned for included files\&. This option adds another directory\&.
++.TP
++-i \fIkeep\fR
++.br
++If a file to be generated already exists, then do not overwrite it\&. By default it is overwritten\&.
++.TP
++-noWarn
++.br
++Suppress warning messages\&.
++.TP
++-oldImplBase
++.br
++Generates skeletons compatible with pre-1\&.4 JDK ORBs\&. By default, the POA Inheritance Model server-side bindings are generated\&. This option provides backward-compatibility with earlier releases of the Java programming language by generating server-side bindings that are \f3ImplBase\fR Inheritance Model classes\&.
++.TP
++-pkgPrefix \fItype\fR\fIprefix\fR
++.br
++Wherever \f3type\fR is encountered at file scope, prefix the generated Java package name with \f3prefix\fR for all files generated for that type\&. The type is the simple name of either a top-level module, or an IDL type defined outside of any module\&.
++.TP
++-pkgTranslate \fItype\fR\fIpackage\fR
++.br
++Whenever the module name type is encountered in an identifier, replace it in the identifier with package for all files in the generated Java package\&. Note that \f3pkgPrefix\fR changes are made first\&. The type value is the simple name of either a top-level module, or an IDL type defined outside of any module and must match the full package name exactly\&.
++
++If more than one translation matches an identifier, then the longest match is chosen as shown in the following example:
++
++\fICommand\fR:
++.sp
++.nf
++\f3pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++\fIResulting Translation\fR:
++.sp
++.nf
++\f3type => pkg\fP
++.fi
++.nf
++\f3type\&.ext => pkg\&.ext\fP
++.fi
++.nf
++\f3type\&.baz => pkg2\&.fizz\fP
++.fi
++.nf
++\f3type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++The following package names \f3org\fR, \f3org\fR\&.o\f3mg\fR, or any subpackages of \f3org\&.omg\fR cannot be translated\&. Any attempt to translate these packages results in uncompilable code, and the use of these packages as the first argument after \f3-pkgTranslate\fR is treated as an error\&.
++.TP
++-skeletonName \fIxxx%yyy\fR
++.br
++Use \f3xxx%yyy\fR as the pattern for naming the skeleton\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserver\fR or \f3-fall\fR), and \f3_%ImplBase\fR for the \f3oldImplBase\fR class (-\f3oldImplBase\fR) and (\f3-fserver\fR or \f3-fall\fR))\&.
++.TP
++-td \fIdir\fR
++.br
++Use \fIdir\fR for the output directory instead of the current directory\&.
++.TP
++-tieName \fIxxx%yyy\fR
++.br
++Use \f3xxx%yyy\fR according to the pattern\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserverTie or -fallTie\fR), and \f3_%Tie\fR for the \f3oldImplBase\fR tie class (-\f3oldImplBase\fR) and (\f3-fserverTie\fR or \f3-fallTie\fR))
++.TP
++-nowarn, -verbose
++.br
++Displays release information and terminates\&.
++.TP
++-version
++.br
++Displays release information and terminates\&.
++.SH RESTRICTIONS
++Escaped identifiers in the global scope cannot have the same spelling as IDL primitive types, \f3Object\fR, or \f3ValueBase\fR\&. This is because the symbol table is preloaded with these identifiers\&. Allowing them to be redefined would overwrite their original definitions\&. Possible permanent restriction\&.
++.PP
++The \f3fixed\fR IDL type is not supported\&.
++.SH KNOWN\ PROBLEMS
++No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&.
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/appletviewer.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/appletviewer.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1995, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/extcheck.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/extcheck.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1998, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/idlj.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/idlj.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2001, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jar.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jar.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jarsigner.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jarsigner.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1998, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/java.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/java.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/javac.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/javac.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/javadoc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/javadoc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/javah.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/javah.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/javap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/javap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jcmd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jcmd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jconsole.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jconsole.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jdb.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jdb.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1995, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jdeps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jdeps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2013, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jhat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jhat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2006, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jinfo.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jinfo.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jjs.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jjs.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jmap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jmap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jrunscript.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jrunscript.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2006, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jsadebugd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jsadebugd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jstack.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jstack.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jstat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jstat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jstatd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jstatd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/jvisualvm.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/jvisualvm.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,4 @@
+ '\" t
+-.\" Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ .\"
+ .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ .\"
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/keytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/keytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1998, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/native2ascii.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/native2ascii.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/orbd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/orbd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2001, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/pack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/pack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/policytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/policytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2001, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/rmic.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/rmic.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/rmid.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/rmid.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1998, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/rmiregistry.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/rmiregistry.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/schemagen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/schemagen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2005, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/serialver.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/serialver.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1997, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/servertool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/servertool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2001, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/tnameserv.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/tnameserv.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1999, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/unpack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/unpack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/wsgen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/wsgen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2005, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/wsimport.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/wsimport.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2005, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/ja/xjc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/ja/xjc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2005, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/jar.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jar.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jar.1
+-.\"
+-.if n .pl 99999
+-.TH jar 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jar.1
++.\"
++.if n .pl 99999
++.TH jar 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,437 +47,437 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jar \- Manipulates Java Archive (JAR) files\&.
+-.SH SYNOPSIS
+-Create JAR file
+-.sp
+-.nf
+-
+-\fBjar c\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Update JAR file
+-.sp
+-.nf
+-
+-\fBjar u\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Extract JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBx\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-List Contents of JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBt\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-
+-Add Index to JAR file
+-.sp
+-.nf
+-
+-\fBjar\fR \fBi\fR \fIjarfile\fR [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
+-.fi
+-.sp
+-.SH DESCRIPTION
+-The \f3jar\fR command is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format\&. However, the \f3jar\fR command was designed mainly to package Java applets or applications into a single archive\&. When the components of an applet or application (files, images and sounds) are combined into a single archive, they can be downloaded by a Java agent (such as a browser) in a single HTTP transaction, rather than requiring a new connection for each piece\&. This dramatically improves download times\&. The \f3jar\fR command also compresses files, which further improves download time\&. The \f3jar\fR command also allows individual entries in a file to be signed by the applet author so that their origin can be authenticated\&. A JAR file can be used as a class path entry, whether or not it is compressed\&.
+-.PP
+-The syntax for the \f3jar\fR command resembles the syntax for the \f3tar\fR command\&. It has several operation modes, defined by one of the mandatory \fIoperation arguments\fR\&. Other arguments are either \fIoptions\fR that modify the behavior of the operation, or \fIoperands\fR required to perform the operation\&.
+-.SH OPERATION\ ARGUMENTS
+-When using the \f3jar\fR command, you have to select an operation to be performed by specifying one of the following operation arguments\&. You can mix them up with other one-letter options on the command line, but usually the operation argument is the first argument specified\&.
+-.TP
+-c
+-Create a new JAR archive\&.
+-.TP
+-i
+-Generate index information for a JAR archive\&.
+-.TP
+-t
+-List the contents of a JAR archive\&.
+-.TP
+-u
+-Update a JAR archive\&.
+-.TP
+-x
+-Extract files from a JAR archive\&.
+-.SH OPTIONS
+-Use the following options to customize how the JAR file is created, updated, extracted, or viewed:
+-.TP
+-e
+-Sets the class specified by the \fIentrypoint\fR operand to be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The use of this option creates or overrides the \f3Main-Class\fR attribute value in the manifest file\&. The \f3e\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-
+-For example, the following command creates the \f3Main\&.jar\fR archive with the \f3Main\&.class\fR file where the \f3Main-Clas\fRs attribute value in the manifest is set to \f3Main\fR:
+-.sp
+-.nf
+-\f3jar cfe Main\&.jar Main Main\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The Java Runtime Environment (JRE) can directly call this application by running the following command:
+-.sp
+-.nf
+-\f3java \-jar Main\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the entry point class name is in a package, then it could use either the dot (\&.) or slash (/) as the delimiter\&. For example, if \f3Main\&.class\fR is in a package called \f3mydir\fR, then the entry point can be specified in one of the following ways:
+-.sp
+-.nf
+-\f3jar \-cfe Main\&.jar mydir/Main mydir/Main\&.class\fP
+-.fi
+-.nf
+-\f3jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Note
+-
+-Specifying both \f3m\fR and \f3e\fR options together when a particular manifest also contains the \f3Main-Class\fR attribute results in an ambiguous \f3Main-Class\fR specification\&. The ambiguity leads to an error and the \f3jar\fR command creation or update operation is terminated\&.
+-.TP
+-f
+-Sets the file specified by the \fI\fR\fIjarfile\fR operand to be the name of the JAR file that is created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR) from, or viewed (\f3t\fR)\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
+-.TP
+-m
+-Includes names and values of attributes from the file specified by the \f3manifest\fR operand in the manifest file of the \f3jar\fR command (located in the archive at \f3META-INF/MANIFEST\&.MF\fR)\&. The \f3jar\fR command adds the attribute\(cqs name and value to the JAR file unless an entry already exists with the same name, in which case the \f3jar\fR command updates the value of the attribute\&. The \f3m\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-
+-You can add special-purpose name-value attribute pairs to the manifest that are not contained in the default manifest file\&. For example, you can add attributes that specify vendor information, release information, package sealing, or to make JAR-bundled applications executable\&. For examples of using the \f3m\fR option, see Packaging Programs at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
+-.TP
+-M
+-Does not create a manifest file entry (for \f3c\fR and \f3u\fR), or delete a manifest file entry when one exists (for \f3u\fR)\&. The \f3M\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
+-.TP
+-n
+-When creating (\f3c\fR) a JAR file, this option normalizes the archive so that the content is not affected by the packing and unpacking operations of the pack200(1) command\&. Without this normalization, the signature of a signed JAR can become invalid\&.
+-.TP
+-v
+-Generates verbose output to standard output\&. See Examples\&.
+-.TP
+-0
+-(Zero) Creates (\f3c\fR) or updates (\f3u\fR) the JAR file without using ZIP compression\&.
+-.TP
+--C \fIdir\fR
+-.br
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, this option temporarily changes the directory while processing files specified by the \fIfile\fR operands\&. Its operation is intended to be similar to the \f3-C\fR option of the UNIX \f3tar\fR utility\&.For example, the following command changes to the \f3classes\fR directory and adds the \f3Bar\&.class\fR file from that directory to \f3my\&.jar\fR:
+-.sp
+-.nf
+-\f3jar uf my\&.jar \-C classes Bar\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following command changes to the \f3classes\fR directory and adds to \f3my\&.jar\fR all files within the classes directory (without creating a \f3classes\fR directory in the JAR file), then changes back to the original directory before changing to the \f3bin\fR directory to add \f3Xyz\&.class\fR to \f3my\&.jar\fR\&.
+-.sp
+-.nf
+-\f3jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If \f3classes\fR contained files \f3bar1\fR and \f3bar2\fR, then the JAR file will contain the following after running the previous command:
+-.sp
+-.nf
+-\f3% \fIjar tf my\&.jar\fR\fP
+-.fi
+-.nf
+-\f3META\-INF/\fP
+-.fi
+-.nf
+-\f3META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3bar1\fP
+-.fi
+-.nf
+-\f3bar2\fP
+-.fi
+-.nf
+-\f3Xyz\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-\fI\fR-J\fIoption\fR
+-Sets the specified JVM option to be used when the JRE runs the JAR file\&. JVM options are described on the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
+-.SH OPERANDS
+-The following operands are recognized by the \f3jar\fR command\&.
+-.TP
+-\fIfile\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIfile\fR operand defines the path and name of the file or directory that should be added to the archive\&. When extracting (\f3x\fR) or listing the contents (\f3t\fR) of a JAR file, the \fIfile\fR operand defines the path and name of the file to be extrated or listed\&. At least one valid file or directory must be specified\&. Separate multiple \fIfile\fR operands with spaces\&. If the \fIentrypoint\fR, \fIjarfile\fR, or \fImanifest\fR operands are used, the \fIfile\fR operands must be specified after them\&.
+-.TP
+-\fIentrypoint\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIentrypoint\fR operand defines the name of the class that should be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The \fIentrypoint\fR operand must be specified if the \f3e\fR option is present\&.
+-.TP
+-\fIjarfile\fR
+-Defines the name of the file to be created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR), or viewed (\f3t\fR)\&. The \fIjarfile\fR operand must be specified if the \f3f\fR option is present\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
+-
+-When indexing (\f3i\fR) a JAR file, specify the \fIjarfile\fR operand without the \f3f\fR option\&.
+-.TP
+-\fImanifest\fR
+-When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fImanifest\fR operand defines the preexisting manifest files with names and values of attributes to be included in \f3MANIFEST\&.MF\fR in the JAR file\&. The \fImanifest\fR operand must be specified if the \f3f\fR option is present\&.
+-.TP
+-\fI@arg-file\fR
+-To shorten or simplify the \f3jar\fR command, you can specify arguments in a separate text file and pass it to the \f3jar\fR command with the at sign (@) as a prefix\&. When the \f3jar\fR command encounters an argument beginning with the at sign, it expands the contents of that file into the argument list\&.
+-
+-An argument file can include options and arguments of the \f3jar\fR command (except the \f3-J\fR options, because they are passed to the launcher, which does not support argument files)\&. The arguments within a file can be separated by spaces or newline characters\&. File names within an argument file are relative to the current directory from which you run the \f3jar\fR command, not relative to the location of the argument file\&. Wild cards, such as the asterisk (*), that might otherwise be expanded by the operating system shell, are not expanded\&.
+-
+-The following example, shows how to create a \f3classes\&.list\fR file with names of files from the current directory output by the \f3find\fR command:
+-.sp
+-.nf
+-\f3find \&. \-name \&'*\&.class\&' \-print > classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-You can then execute the \f3jar\fR command and pass the \f3classes\&.list\fR file to it using the \fI@arg-file\fR syntax:
+-.sp
+-.nf
+-\f3jar cf my\&.jar @classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-An argument file can be specified with a path, but any file names inside the argument file that have relative paths are relative to the current working directory of the \f3jar\fR command, not to the path passed in, for example:
+-.sp
+-.nf
+-\f3jar @dir/classes\&.list\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.SH NOTES
+-The \f3e\fR, \f3f\fR, and \f3m\fR options must appear in the same order on the command line as the \fIentrypoint\fR, \fIjarfile\fR, and \fImanifest\fR operands, for example:
+-.sp
+-.nf
+-\f3jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH EXAMPLES
+-\f3Example 1 Adding All Files From the Current Directory With Verbose Output\fR
+-.sp
+-.nf
+-\f3% ls\fP
+-.fi
+-.nf
+-\f31\&.au Animator\&.class monkey\&.jpg\fP
+-.fi
+-.nf
+-\f32\&.au Wave\&.class spacemusic\&.au\fP
+-.fi
+-.nf
+-\f33\&.au at_work\&.gif\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3% jar cvf bundle\&.jar *\fP
+-.fi
+-.nf
+-\f3added manifest\fP
+-.fi
+-.nf
+-\f3adding: 1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: 2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: 3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
+-.fi
+-.nf
+-\f3adding: Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Adding Files From Subdirectories\fR
+-.sp
+-.nf
+-\f3% ls \-F\fP
+-.fi
+-.nf
+-\f3audio/ classes/ images/\fP
+-.fi
+-.nf
+-\f3% jar cvf bundle\&.jar audio classes images\fP
+-.fi
+-.nf
+-\f3added manifest\fP
+-.fi
+-.nf
+-\f3adding: audio/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: audio/1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: audio/2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: audio/3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
+-.fi
+-.nf
+-\f3adding: audio/spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: classes/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: classes/Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: classes/Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
+-.fi
+-.nf
+-\f3adding: images/(in = 0) (out= 0)(stored 0%)\fP
+-.fi
+-.nf
+-\f3adding: images/monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3adding: images/at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3% ls \-F\fP
+-.fi
+-.nf
+-\f3audio/ bundle\&.jar classes/ images/\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Listing the Contents of JAR\fR
+-.sp
+-.nf
+-\f3% jar tf bundle\&.jar\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3META\-INF/\fP
+-.fi
+-.nf
+-\f3META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3audio/1\&.au\fP
+-.fi
+-.nf
+-\f3audio/2\&.au\fP
+-.fi
+-.nf
+-\f3audio/3\&.au\fP
+-.fi
+-.nf
+-\f3audio/spacemusic\&.au\fP
+-.fi
+-.nf
+-\f3classes/Animator\&.class\fP
+-.fi
+-.nf
+-\f3classes/Wave\&.class\fP
+-.fi
+-.nf
+-\f3images/monkey\&.jpg\fP
+-.fi
+-.nf
+-\f3images/at_work\&.gif\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Adding an Index\fR
+-.PP
+-Use the \f3i\fR option when you split the interdependent classes for a stock trade application into three JAR files: \f3main\&.jar\fR, \f3buy\&.jar\fR, and \f3sell\&.jar\fR\&. If you specify the \f3Class-Path\fR attribute in the \f3main\&.jar\fR manifest, then you can use the \f3i\fR option to speed up the class loading time for your application:
+-.sp
+-.nf
+-\f3Class\-Path: buy\&.jar sell\&.jar\fP
+-.fi
+-.nf
+-\f3jar i main\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-An \f3INDEX\&.LIST\fR file is inserted to the \f3META-INF\fR directory\&. This enables the application class loader to download the specified JAR files when it is searching for classes or resources\&.
+-.PP
+-The application class loader uses the information stored in this file for efficient class loading\&. To copy directories, first compress files in \f3dir1\fR to \f3stdout\fR, then pipeline and extract from \f3stdin\fR to \f3dir2\fR (omitting the \f3-f\fR option from both \f3jar\fR commands):
+-.sp
+-.nf
+-\f3(cd dir1; jar c \&.) | (cd dir2; jar x)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pack200(1)\&.
+-.TP 0.2i
+-\(bu
+-The JAR section of The Java Tutorials at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
++
++.SH NAME
++jar \- Manipulates Java Archive (JAR) files\&.
++.SH SYNOPSIS
++Create JAR file
++.sp
++.nf
++
++\fBjar c\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Update JAR file
++.sp
++.nf
++
++\fBjar u\fR[\fBefmMnv0\fR] [\fIentrypoint\fR] [\fIjarfile\fR] [\fImanifest\fR] [\fB\-C\fR \fIdir\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Extract JAR file
++.sp
++.nf
++
++\fBjar\fR \fBx\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++List Contents of JAR file
++.sp
++.nf
++
++\fBjar\fR \fBt\fR[\fBvf\fR] [\fIjarfile\fR] \fIfile\fR \&.\&.\&. [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++
++Add Index to JAR file
++.sp
++.nf
++
++\fBjar\fR \fBi\fR \fIjarfile\fR [\-J\fIoption\fR \&.\&.\&.] [@\fIarg\-file\fR \&.\&.\&.]
++.fi
++.sp
++.SH DESCRIPTION
++The \f3jar\fR command is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format\&. However, the \f3jar\fR command was designed mainly to package Java applets or applications into a single archive\&. When the components of an applet or application (files, images and sounds) are combined into a single archive, they can be downloaded by a Java agent (such as a browser) in a single HTTP transaction, rather than requiring a new connection for each piece\&. This dramatically improves download times\&. The \f3jar\fR command also compresses files, which further improves download time\&. The \f3jar\fR command also allows individual entries in a file to be signed by the applet author so that their origin can be authenticated\&. A JAR file can be used as a class path entry, whether or not it is compressed\&.
++.PP
++The syntax for the \f3jar\fR command resembles the syntax for the \f3tar\fR command\&. It has several operation modes, defined by one of the mandatory \fIoperation arguments\fR\&. Other arguments are either \fIoptions\fR that modify the behavior of the operation, or \fIoperands\fR required to perform the operation\&.
++.SH OPERATION\ ARGUMENTS
++When using the \f3jar\fR command, you have to select an operation to be performed by specifying one of the following operation arguments\&. You can mix them up with other one-letter options on the command line, but usually the operation argument is the first argument specified\&.
++.TP
++c
++Create a new JAR archive\&.
++.TP
++i
++Generate index information for a JAR archive\&.
++.TP
++t
++List the contents of a JAR archive\&.
++.TP
++u
++Update a JAR archive\&.
++.TP
++x
++Extract files from a JAR archive\&.
++.SH OPTIONS
++Use the following options to customize how the JAR file is created, updated, extracted, or viewed:
++.TP
++e
++Sets the class specified by the \fIentrypoint\fR operand to be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The use of this option creates or overrides the \f3Main-Class\fR attribute value in the manifest file\&. The \f3e\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++
++For example, the following command creates the \f3Main\&.jar\fR archive with the \f3Main\&.class\fR file where the \f3Main-Clas\fRs attribute value in the manifest is set to \f3Main\fR:
++.sp
++.nf
++\f3jar cfe Main\&.jar Main Main\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The Java Runtime Environment (JRE) can directly call this application by running the following command:
++.sp
++.nf
++\f3java \-jar Main\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the entry point class name is in a package, then it could use either the dot (\&.) or slash (/) as the delimiter\&. For example, if \f3Main\&.class\fR is in a package called \f3mydir\fR, then the entry point can be specified in one of the following ways:
++.sp
++.nf
++\f3jar \-cfe Main\&.jar mydir/Main mydir/Main\&.class\fP
++.fi
++.nf
++\f3jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Note
++
++Specifying both \f3m\fR and \f3e\fR options together when a particular manifest also contains the \f3Main-Class\fR attribute results in an ambiguous \f3Main-Class\fR specification\&. The ambiguity leads to an error and the \f3jar\fR command creation or update operation is terminated\&.
++.TP
++f
++Sets the file specified by the \fI\fR\fIjarfile\fR operand to be the name of the JAR file that is created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR) from, or viewed (\f3t\fR)\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
++.TP
++m
++Includes names and values of attributes from the file specified by the \f3manifest\fR operand in the manifest file of the \f3jar\fR command (located in the archive at \f3META-INF/MANIFEST\&.MF\fR)\&. The \f3jar\fR command adds the attribute\(cqs name and value to the JAR file unless an entry already exists with the same name, in which case the \f3jar\fR command updates the value of the attribute\&. The \f3m\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++
++You can add special-purpose name-value attribute pairs to the manifest that are not contained in the default manifest file\&. For example, you can add attributes that specify vendor information, release information, package sealing, or to make JAR-bundled applications executable\&. For examples of using the \f3m\fR option, see Packaging Programs at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
++.TP
++M
++Does not create a manifest file entry (for \f3c\fR and \f3u\fR), or delete a manifest file entry when one exists (for \f3u\fR)\&. The \f3M\fR option can be used when creating (\f3c\fR) or updating (\f3u\fR) the JAR file\&.
++.TP
++n
++When creating (\f3c\fR) a JAR file, this option normalizes the archive so that the content is not affected by the packing and unpacking operations of the pack200(1) command\&. Without this normalization, the signature of a signed JAR can become invalid\&.
++.TP
++v
++Generates verbose output to standard output\&. See Examples\&.
++.TP
++0
++(Zero) Creates (\f3c\fR) or updates (\f3u\fR) the JAR file without using ZIP compression\&.
++.TP
++-C \fIdir\fR
++.br
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, this option temporarily changes the directory while processing files specified by the \fIfile\fR operands\&. Its operation is intended to be similar to the \f3-C\fR option of the UNIX \f3tar\fR utility\&.For example, the following command changes to the \f3classes\fR directory and adds the \f3Bar\&.class\fR file from that directory to \f3my\&.jar\fR:
++.sp
++.nf
++\f3jar uf my\&.jar \-C classes Bar\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following command changes to the \f3classes\fR directory and adds to \f3my\&.jar\fR all files within the classes directory (without creating a \f3classes\fR directory in the JAR file), then changes back to the original directory before changing to the \f3bin\fR directory to add \f3Xyz\&.class\fR to \f3my\&.jar\fR\&.
++.sp
++.nf
++\f3jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If \f3classes\fR contained files \f3bar1\fR and \f3bar2\fR, then the JAR file will contain the following after running the previous command:
++.sp
++.nf
++\f3% \fIjar tf my\&.jar\fR\fP
++.fi
++.nf
++\f3META\-INF/\fP
++.fi
++.nf
++\f3META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3bar1\fP
++.fi
++.nf
++\f3bar2\fP
++.fi
++.nf
++\f3Xyz\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++\fI\fR-J\fIoption\fR
++Sets the specified JVM option to be used when the JRE runs the JAR file\&. JVM options are described on the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
++.SH OPERANDS
++The following operands are recognized by the \f3jar\fR command\&.
++.TP
++\fIfile\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIfile\fR operand defines the path and name of the file or directory that should be added to the archive\&. When extracting (\f3x\fR) or listing the contents (\f3t\fR) of a JAR file, the \fIfile\fR operand defines the path and name of the file to be extrated or listed\&. At least one valid file or directory must be specified\&. Separate multiple \fIfile\fR operands with spaces\&. If the \fIentrypoint\fR, \fIjarfile\fR, or \fImanifest\fR operands are used, the \fIfile\fR operands must be specified after them\&.
++.TP
++\fIentrypoint\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fIentrypoint\fR operand defines the name of the class that should be the entry point\f3\fR for a standalone Java application bundled into an executable JAR file\&. The \fIentrypoint\fR operand must be specified if the \f3e\fR option is present\&.
++.TP
++\fIjarfile\fR
++Defines the name of the file to be created (\f3c\fR), updated (\f3u\fR), extracted (\f3x\fR), or viewed (\f3t\fR)\&. The \fIjarfile\fR operand must be specified if the \f3f\fR option is present\&. Omitting the \f3f\fR option and the \fIjarfile\fR operand instructs the \f3jar\fR command to accept the JAR file name from \f3stdin\fR (for \f3x\fR and \f3t\fR) or send the JAR \f3\fRfile to \f3stdout\fR (for \f3c\fR and \f3u\fR)\&.
++
++When indexing (\f3i\fR) a JAR file, specify the \fIjarfile\fR operand without the \f3f\fR option\&.
++.TP
++\fImanifest\fR
++When creating (\f3c\fR) or updating (\f3u\fR) a JAR file, the \fImanifest\fR operand defines the preexisting manifest files with names and values of attributes to be included in \f3MANIFEST\&.MF\fR in the JAR file\&. The \fImanifest\fR operand must be specified if the \f3f\fR option is present\&.
++.TP
++\fI@arg-file\fR
++To shorten or simplify the \f3jar\fR command, you can specify arguments in a separate text file and pass it to the \f3jar\fR command with the at sign (@) as a prefix\&. When the \f3jar\fR command encounters an argument beginning with the at sign, it expands the contents of that file into the argument list\&.
++
++An argument file can include options and arguments of the \f3jar\fR command (except the \f3-J\fR options, because they are passed to the launcher, which does not support argument files)\&. The arguments within a file can be separated by spaces or newline characters\&. File names within an argument file are relative to the current directory from which you run the \f3jar\fR command, not relative to the location of the argument file\&. Wild cards, such as the asterisk (*), that might otherwise be expanded by the operating system shell, are not expanded\&.
++
++The following example, shows how to create a \f3classes\&.list\fR file with names of files from the current directory output by the \f3find\fR command:
++.sp
++.nf
++\f3find \&. \-name \&'*\&.class\&' \-print > classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++You can then execute the \f3jar\fR command and pass the \f3classes\&.list\fR file to it using the \fI@arg-file\fR syntax:
++.sp
++.nf
++\f3jar cf my\&.jar @classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++An argument file can be specified with a path, but any file names inside the argument file that have relative paths are relative to the current working directory of the \f3jar\fR command, not to the path passed in, for example:
++.sp
++.nf
++\f3jar @dir/classes\&.list\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.SH NOTES
++The \f3e\fR, \f3f\fR, and \f3m\fR options must appear in the same order on the command line as the \fIentrypoint\fR, \fIjarfile\fR, and \fImanifest\fR operands, for example:
++.sp
++.nf
++\f3jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH EXAMPLES
++\f3Example 1 Adding All Files From the Current Directory With Verbose Output\fR
++.sp
++.nf
++\f3% ls\fP
++.fi
++.nf
++\f31\&.au Animator\&.class monkey\&.jpg\fP
++.fi
++.nf
++\f32\&.au Wave\&.class spacemusic\&.au\fP
++.fi
++.nf
++\f33\&.au at_work\&.gif\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3% jar cvf bundle\&.jar *\fP
++.fi
++.nf
++\f3added manifest\fP
++.fi
++.nf
++\f3adding: 1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: 2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: 3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
++.fi
++.nf
++\f3adding: Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Adding Files From Subdirectories\fR
++.sp
++.nf
++\f3% ls \-F\fP
++.fi
++.nf
++\f3audio/ classes/ images/\fP
++.fi
++.nf
++\f3% jar cvf bundle\&.jar audio classes images\fP
++.fi
++.nf
++\f3added manifest\fP
++.fi
++.nf
++\f3adding: audio/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: audio/1\&.au(in = 2324) (out= 67)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: audio/2\&.au(in = 6970) (out= 90)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: audio/3\&.au(in = 11616) (out= 108)(deflated 99%)\fP
++.fi
++.nf
++\f3adding: audio/spacemusic\&.au(in = 3079) (out= 73)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: classes/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: classes/Animator\&.class(in = 2266) (out= 66)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: classes/Wave\&.class(in = 3778) (out= 81)(deflated 97%)\fP
++.fi
++.nf
++\f3adding: images/(in = 0) (out= 0)(stored 0%)\fP
++.fi
++.nf
++\f3adding: images/monkey\&.jpg(in = 7667) (out= 91)(deflated 98%)\fP
++.fi
++.nf
++\f3adding: images/at_work\&.gif(in = 6621) (out= 89)(deflated 98%)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3% ls \-F\fP
++.fi
++.nf
++\f3audio/ bundle\&.jar classes/ images/\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Listing the Contents of JAR\fR
++.sp
++.nf
++\f3% jar tf bundle\&.jar\fP
++.fi
++.sp
++.sp
++.nf
++\f3META\-INF/\fP
++.fi
++.nf
++\f3META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3audio/1\&.au\fP
++.fi
++.nf
++\f3audio/2\&.au\fP
++.fi
++.nf
++\f3audio/3\&.au\fP
++.fi
++.nf
++\f3audio/spacemusic\&.au\fP
++.fi
++.nf
++\f3classes/Animator\&.class\fP
++.fi
++.nf
++\f3classes/Wave\&.class\fP
++.fi
++.nf
++\f3images/monkey\&.jpg\fP
++.fi
++.nf
++\f3images/at_work\&.gif\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Adding an Index\fR
++.PP
++Use the \f3i\fR option when you split the interdependent classes for a stock trade application into three JAR files: \f3main\&.jar\fR, \f3buy\&.jar\fR, and \f3sell\&.jar\fR\&. If you specify the \f3Class-Path\fR attribute in the \f3main\&.jar\fR manifest, then you can use the \f3i\fR option to speed up the class loading time for your application:
++.sp
++.nf
++\f3Class\-Path: buy\&.jar sell\&.jar\fP
++.fi
++.nf
++\f3jar i main\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++An \f3INDEX\&.LIST\fR file is inserted to the \f3META-INF\fR directory\&. This enables the application class loader to download the specified JAR files when it is searching for classes or resources\&.
++.PP
++The application class loader uses the information stored in this file for efficient class loading\&. To copy directories, first compress files in \f3dir1\fR to \f3stdout\fR, then pipeline and extract from \f3stdin\fR to \f3dir2\fR (omitting the \f3-f\fR option from both \f3jar\fR commands):
++.sp
++.nf
++\f3(cd dir1; jar c \&.) | (cd dir2; jar x)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pack200(1)\&.
++.TP 0.2i
++\(bu
++The JAR section of The Java Tutorials at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jarsigner.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jarsigner.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Security Tools
+-.\" Title: jarsigner.1
+-.\"
+-.if n .pl 99999
+-.TH jarsigner 1 "21 November 2013" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Security Tools
++.\" Title: jarsigner.1
++.\"
++.if n .pl 99999
++.TH jarsigner 1 "21 November 2013" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,761 +47,761 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jarsigner \- Signs and verifies Java Archive (JAR) files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjarsigner\fR [ \fIoptions\fR ] \fIjar\-file\fR \fIalias\fR
+-.fi
+-.nf
+-
+-\fBjarsigner\fR \fB\-verify\fR [ \fIoptions\fR ] \fIjar\-file\fR [\fIalias \&.\&.\&.\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+--verify
+-.br
+-The \f3-verify\fR option can take zero or more keystore alias names after the JAR file name\&. When the \f3-verify\fR option is specified, the \f3jarsigner\fR command checks that the certificate used to verify each signed entry in the JAR file matches one of the keystore aliases\&. The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
+-
+-If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar verified, with signer errors" is displayed\&.
+-.TP
+-\fIjar-file\fR
+-The JAR file to be signed\&.
+-
+-If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar signed, with signer errors" is displayed\&.
+-.TP
+-\fIalias\fR
+-The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
+-.SH DESCRIPTION
+-The \f3jarsigner\fR tool has two purposes:
+-.TP 0.2i
+-\(bu
+-To sign Java Archive (JAR) files\&.
+-.TP 0.2i
+-\(bu
+-To verify the signatures and integrity of signed JAR files\&.
+-.PP
+-The JAR feature enables the packaging of class files, images, sounds, and other digital data in a single file for faster and easier distribution\&. A tool named \f3jar\fR enables developers to produce JAR files\&. (Technically, any zip file can also be considered a JAR file, although when created by the \f3jar\fR command or processed by the \f3jarsigner\fR command, JAR files also contain a \f3META-INF/MANIFEST\&.MF\fR file\&.)
+-.PP
+-A digital signature is a string of bits that is computed from some data (the data being signed) and the private key of an entity (a person, company, and so on)\&. Similar to a handwritten signature, a digital signature has many useful characteristics:
+-.TP 0.2i
+-\(bu
+-Its authenticity can be verified by a computation that uses the public key corresponding to the private key used to generate the signature\&.
+-.TP 0.2i
+-\(bu
+-It cannot be forged, assuming the private key is kept secret\&.
+-.TP 0.2i
+-\(bu
+-It is a function of the data signed and thus cannot be claimed to be the signature for other data as well\&.
+-.TP 0.2i
+-\(bu
+-The signed data cannot be changed\&. If the data is changed, then the signature cannot be verified as authentic\&.
+-.PP
+-To generate an entity\&'s signature for a file, the entity must first have a public/private key pair associated with it and one or more certificates that authenticate its public key\&. A certificate is a digitally signed statement from one entity that says that the public key of another entity has a particular value\&.
+-.PP
+-The \f3jarsigner\fR command uses key and certificate information from a keystore to generate digital signatures for JAR files\&. A keystore is a database of private keys and their associated X\&.509 certificate chains that authenticate the corresponding public keys\&. The \f3keytool\fR command is used to create and administer keystores\&.
+-.PP
+-The \f3jarsigner\fR command uses an entity\&'s private key to generate a signature\&. The signed JAR file contains, among other things, a copy of the certificate from the keystore for the public key corresponding to the private key used to sign the file\&. The \f3jarsigner\fR command can verify the digital signature of the signed JAR file using the certificate inside it (in its signature block file)\&.
+-.PP
+-The \f3jarsigner\fR command can generate signatures that include a time stamp that lets a systems or deployer (including Java Plug-in) to check whether the JAR file was signed while the signing certificate was still valid\&. In addition, APIs allow applications to obtain the timestamp information\&.
+-.PP
+-At this time, the \f3jarsigner\fR command can only sign JAR files created by the \f3jar\fR command or zip files\&. JAR files are the same as zip files, except they also have a \f3META-INF/MANIFEST\&.MF\fR file\&. A \f3META-INF/MANIFEST\&.MF\fR file is created when the \f3jarsigner\fR command signs a zip file\&.
+-.PP
+-The default \f3jarsigner\fR command behavior is to sign a JAR or zip file\&. Use the \f3-verify\fR option to verify a signed JAR file\&.
+-.PP
+-The \f3jarsigner\fR command also attempts to validate the signer\&'s certificate after signing or verifying\&. If there is a validation error or any other problem, the command generates warning messages\&. If you specify the \f3-strict\fR option, then the command treats severe warnings as errors\&. See Errors and Warnings\&.
+-.SS KEYSTORE\ ALIASES
+-All keystore entities are accessed with unique aliases\&.
+-.PP
+-When you use the \f3jarsigner\fR command to sign a JAR file, you must specify the alias for the keystore entry that contains the private key needed to generate the signature\&. For example, the following command signs the JAR file named \f3MyJARFile\&.jar\fR with the private key associated with the alias \f3duke\fR in the keystore named \f3mystore\fR in the \f3working\fR directory\&. Because no output file is specified, it overwrites \f3MyJARFile\&.jar\fR with the signed JAR file\&.
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore \-storepass <keystore password>\fP
+-.fi
+-.nf
+-\f3 \-keypass <private key password> MyJARFile\&.jar duke\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Keystores are protected with a password, so the store password must be specified\&. You are prompted for it when you do not specify it on the command line\&. Similarly, private keys are protected in a keystore with a password, so the private key\&'s password must be specified, and you are prompted for the password when you do not specify it on the command line and it is not the same as the store password\&.
+-.SS KEYSTORE\ LOCATION
+-The \f3jarsigner\fR command has a \f3-keystore\fR option for specifying the URL of the keystore to be used\&. The keystore is by default stored in a file named \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
+-.PP
+-On Oracle Solaris systems, \f3user\&.home\fR defaults to the user\&'s home directory\&.
+-.PP
+-The input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified when the \f3KeyStore\fR class is not file based, for example, when it resides on a hardware token device\&.
+-.SS KEYSTORE\ IMPLEMENTATION
+-The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies a number of well-defined interfaces to access and modify the information in a keystore\&. You can have multiple different concrete implementations, where each implementation is for a particular type of keystore\&.
+-.PP
+-Currently, there are two command-line tools that use keystore implementations (\f3keytool\fR and \f3jarsigner\fR), and a GUI-based tool named Policy Tool\&. Because the \f3KeyStore\fR class is publicly available, JDK users can write additional security applications that use it\&.
+-.PP
+-There is a built-in default implementation provided by Oracle that implements the keystore as a file, that uses a proprietary keystore type (format) named JKS\&. The built-in implementation protects each private key with its individual password and protects the integrity of the entire keystore with a (possibly different) password\&.
+-.PP
+-Keystore implementations are provider-based, which means the application interfaces supplied by the \f3KeyStore\fR class are implemented in terms of a Service Provider Interface (SPI)\&. There is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, that defines the Service Provider Interface methods that providers must implement\&. The term provider refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
+-.PP
+-Applications can choose different types of keystore implementations from different providers, with the \f3getInstance\fR factory method in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself\&. Keystore implementations of different types are not compatible\&.
+-.PP
+-The \f3jarsigner\fR and \f3policytool\fR commands can read file-based keystores from any location that can be specified using a URL\&. In addition, these commands can read non-file-based keystores such as those provided by MSCAPI on Windows and PKCS11 on all platforms\&.
+-.PP
+-For the \f3jarsigner\fR and \f3keytool\fR commands, you can specify a keystore type at the command line with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIEdit\fR command in the \fIKeyStore\fR menu\&.
+-.PP
+-If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and it resides in the JDK security properties directory, \f3java\&.home/lib/security\fR, where \f3java\&.home\fR is the runtime environment\&'s directory\&. The \f3jre\fR directory in the JDK or the top-level directory of the Java Runtime Environment (JRE)\&.
+-.PP
+-Each tool gets the \f3keystore\&.type\fR value and then examines all the installed providers until it finds one that implements keystores of that type\&. It then uses the keystore implementation from that provider\&.
+-.PP
+-The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type property\fR:
+-.sp
+-.nf
+-\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-The default keystore type is \f3jks\fR (the proprietary type of the keystore implementation provided by Oracle)\&. This is specified by the following line in the security properties file:
+-.sp
+-.nf
+-\f3keystore\&.type=jks\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-Case does not matter in keystore type designations\&. For example, \f3JKS\fR is the same as \f3jks\fR\&.
+-.PP
+-To have the tools use a keystore implementation other than the default, change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
+-.sp
+-.nf
+-\f3keystore\&.type=pkcs12\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-\fINote:\fR If you use the PKCS 11 provider package, then see "KeyTool" and "JarSigner" in Java PKCS #11 Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.html
+-.SS SUPPORTED\ ALGORITHMS
+-By default, the \f3jarsigner\fR command signs a JAR file using one of the following algorithms:
+-.TP 0.2i
+-\(bu
+-Digital Signature Algorithm (DSA) with the SHA1 digest algorithm
+-.TP 0.2i
+-\(bu
+-RSA algorithm with the SHA256 digest algorithm
+-.TP 0.2i
+-\(bu
+-Elliptic Curve (EC) cryptography algorithm with the SHA256 with Elliptic Curve Digital Signature Algorithm (ECDSA)\&.
+-.PP
+-If the signer\&'s public and private keys are DSA keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA1withDSA\fR algorithm\&. If the signer\&'s keys are RSA keys, then \f3jarsigner\fR attempts to sign the JAR file with the \f3SHA256withRSA\fR algorithm\&. If the signer\&'s keys are EC keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA256withECDSA\fR algorithm\&.
+-.PP
+-These default signature algorithms can be overridden using the \f3-sigalg\fR option\&.
+-.SS THE\ SIGNED\ JAR\ FILE
+-When the \f3jarsigner\fR command is used to sign a JAR file, the output signed JAR file is exactly the same as the input JAR file, except that it has two additional files placed in the META-INF directory:
+-.TP 0.2i
+-\(bu
+-A signature file with an \f3\&.SF\fR extension
+-.TP 0.2i
+-\(bu
+-A signature block file with a \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR extension
+-.PP
+-The base file names for these two files come from the value of the \f3-sigFile\fR option\&. For example, when the option is \f3-sigFile MKSIGN\fR, the files are named \f3MKSIGN\&.SF\fR and \f3MKSIGN\&.DSA\fR
+-.PP
+-If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to uppercase\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not allowed in a signature file name, then each such character is converted to an underscore (_) character in forming the file name\&. Valid characters include letters, digits, underscores, and hyphens\&.
+-.PP
+-Signature File
+-
+-A signature file (\f3\&.SF\fR file) looks similar to the manifest file that is always included in a JAR file when the \f3jarsigner\fR command is used to sign the file\&. For each source file included in the JAR file, the \f3\&.SF\fR file has three lines, such as in the manifest file, that list the following:
+-.TP 0.2i
+-\(bu
+-File name
+-.TP 0.2i
+-\(bu
+-Name of the digest algorithm (SHA)
+-.TP 0.2i
+-\(bu
+-SHA digest value
+-.PP
+-In the manifest file, the SHA digest value for each source file is the digest (hash) of the binary data in the source file\&. In the \f3\&.SF\fR file, the digest value for a specified source file is the hash of the three lines in the manifest file for the source file\&.
+-.PP
+-The signature file, by default, includes a header with a hash of the whole manifest file\&. The header also contains a hash of the manifest header\&. The presence of the header enables verification optimization\&. See JAR File Verification\&.
+-.PP
+-Signature Block File
+-
+-The \f3\&.SF\fR file is signed and the signature is placed in the signature block file\&. This file also contains, encoded inside it, the certificate or certificate chain from the keystore that authenticates the public key corresponding to the private key used for signing\&. The file has the extension \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR, depending on the digest algorithm used\&.
+-.SS SIGNATURE\ TIME\ STAMP
+-The \f3jarsigner\fR command can generate and store a signature time stamp when signing a JAR file\&. In addition, \f3jarsigner\fR supports alternative signing mechanisms\&. This behavior is optional and is controlled by the user at the time of signing through these options\&. See Options\&.
+-.sp
+-.nf
+-\f3\-tsa \fIurl\fR\fP
+-.fi
+-.nf
+-\f3\-tsacert \fIalias\fR\fP
+-.fi
+-.nf
+-\f3\-altsigner \fIclass\fR\fP
+-.fi
+-.nf
+-\f3\-altsignerpath \fIclasspathlist\fR\fP
+-.fi
+-.nf
+-\f3\-tsapolicyid \fIpolicyid\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS JAR\ FILE\ VERIFICATION
+-A successful JAR file verification occurs when the signatures are valid, and none of the files that were in the JAR file when the signatures were generated have changed since then\&. JAR file verification involves the following steps:
+-.TP 0.4i
+-1\&.
+-Verify the signature of the \f3\&.SF\fR file\&.
+-
+-The verification ensures that the signature stored in each signature block (\f3\&.DSA\fR) file was generated using the private key corresponding to the public key whose certificate (or certificate chain) also appears in the \f3\&.DSA\fR file\&. It also ensures that the signature is a valid signature of the corresponding signature (\f3\&.SF\fR) file, and thus the \f3\&.SF\fR file was not tampered with\&.
+-.TP 0.4i
+-2\&.
+-Verify the digest listed in each entry in the \f3\&.SF\fR file with each corresponding section in the manifest\&.
+-
+-The \f3\&.SF\fR file by default includes a header that contains a hash of the entire manifest file\&. When the header is present, the verification can check to see whether or not the hash in the header matches the hash of the manifest file\&. If there is a match, then verification proceeds to the next step\&.
+-
+-If there is no match, then a less optimized verification is required to ensure that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See Signature File\&.
+-
+-One reason the hash of the manifest file that is stored in the \f3\&.SF\fR file header might not equal the hash of the current manifest file is that one or more files were added to the JAR file (with the \f3jar\fR tool) after the signature and \f3\&.SF\fR file were generated\&. When the \f3jar\fR tool is used to add files, the manifest file is changed by adding sections to it for the new files, but the \f3\&.SF\fR file is not changed\&. A verification is still considered successful when none of the files that were in the JAR file when the signature was generated have been changed since then\&. This happens when the hashes in the non-header sections of the \f3\&.SF\fR file equal the hashes of the corresponding sections in the manifest file\&.
+-.TP 0.4i
+-3\&.
+-Read each file in the JAR file that has an entry in the \f3\&.SF\fR file\&. While reading, compute the file\&'s digest and compare the result with the digest for this file in the manifest section\&. The digests should be the same or verification fails\&.
+-
+-If any serious verification failures occur during the verification process, then the process is stopped and a security exception is thrown\&. The \f3jarsigner\fR command catches and displays the exception\&.
+-.PP
+-\fINote:\fR You should read any addition warnings (or errors if you specified the \f3-strict\fR option), as well as the content of the certificate (by specifying the \f3-verbose\fR and \f3-certs\fR options) to determine if the signature can be trusted\&.
+-.SS MULTIPLE\ SIGNATURES\ FOR\ A\ JAR\ FILE
+-A JAR file can be signed by multiple people by running the \f3jarsigner\fR command on the file multiple times and specifying the alias for a different person each time, as follows:
+-.sp
+-.nf
+-\f3jarsigner myBundle\&.jar susan\fP
+-.fi
+-.nf
+-\f3jarsigner myBundle\&.jar kevin\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-When a JAR file is signed multiple times, there are multiple \f3\&.SF\fR and \f3\&.DSA\fR files in the resulting JAR file, one pair for each signature\&. In the previous example, the output JAR file includes files with the following names:
+-.sp
+-.nf
+-\f3SUSAN\&.SF\fP
+-.fi
+-.nf
+-\f3SUSAN\&.DSA\fP
+-.fi
+-.nf
+-\f3KEVIN\&.SF\fP
+-.fi
+-.nf
+-\f3KEVIN\&.DSA\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-The following sections describe the various \f3jarsigner\fR options\&. Be aware of the following standards:
+-.TP 0.2i
+-\(bu
+-All option names are preceded by a minus sign (-)\&.
+-.TP 0.2i
+-\(bu
+-The options can be provided in any order\&.
+-.TP 0.2i
+-\(bu
+-Items that are in italics or underlined (option values) represent the actual values that must be supplied\&.
+-.TP 0.2i
+-\(bu
+-The \f3-storepass\fR, \f3-keypass\fR, \f3-sigfile\fR, \f3-sigalg\fR, \f3-digestalg\fR, \f3-signedjar\fR, and TSA-related options are only relevant when signing a JAR file; they are not relevant when verifying a signed JAR file\&. The \f3-keystore\fR option is relevant for signing and verifying a JAR file\&. In addition, aliases are specified when signing and verifying a JAR file\&.
+-.TP
+--keystore \fIurl\fR
+-.br
+-Specifies the URL that tells the keystore location\&. This defaults to the file \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
+-
+-A keystore is required when signing\&. You must explicitly specify a keystore when the default keystore does not exist or if you want to use one other than the default\&.
+-
+-A keystore is not required when verifying, but if one is specified or the default exists and the \f3-verbose\fR option was also specified, then additional information is output regarding whether or not any of the certificates used to verify the JAR file are contained in that keystore\&.
+-
+-The \f3-keystore\fR argument can be a file name and path specification rather than a URL, in which case it is treated the same as a file: URL, for example, the following are equivalent:
+-.sp
+-.nf
+-\f3\-keystore \fIfilePathAndName\fR\fP
+-.fi
+-.nf
+-\f3\-keystore file:\fIfilePathAndName\fR\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-If the Sun PKCS #11 provider was configured in the \f3java\&.security\fR security properties file (located in the JRE\&'s \f3$JAVA_HOME/lib/security directory\fR), then the \f3keytool\fR and \f3jarsigner\fR tools can operate on the PKCS #11 token by specifying these options:
+-.sp
+-.nf
+-\f3\-keystore NONE\fP
+-.fi
+-.nf
+-\f3\-storetype PKCS11\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-For example, the following command lists the contents of the configured PKCS#11 token:
+-.sp
+-.nf
+-\f3keytool \-keystore NONE \-storetype PKCS11 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--storetype \fIstoretype\fR
+-.br
+-Specifies the type of keystore to be instantiated\&. The default keystore type is the one that is specified as the value of the \f3keystore\&.type\fR property in the security properties file, which is returned by the static \f3getDefaultType\fR method in \f3java\&.security\&.KeyStore\fR\&.
+-
+-The PIN for a PCKS #11 token can also be specified with the \f3-storepass\fR option\&. If none is specified, then the \f3keytool\fR and \f3jarsigner\fR commands prompt for the token PIN\&. If the token has a protected authentication path (such as a dedicated PIN-pad or a biometric reader), then the \f3-protected\fR option must be specified and no password options can be specified\&.
+-.TP
+--storepass[:env | :file] \fIargument\fR
+-.br
+-Specifies the password that is required to access the keystore\&. This is only needed when signing (not verifying) a JAR file\&. In that case, if a \f3-storepass\fR option is not provided at the command line, then the user is prompted for the password\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \fIargument\fR\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
+-.RE
+-
+-
+-\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
+-.TP
+--keypass [:env | :file] \fIargument\fR
+-.br
+-Specifies the password used to protect the private key of the keystore entry addressed by the alias specified on the command line\&. The password is required when using \f3jarsigner\fR to sign a JAR file\&. If no password is provided on the command line, and the required password is different from the store password, then the user is prompted for it\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \f3argument\fR\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
+-.RE
+-
+-
+-\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
+-.TP
+--sigfile \fIfile\fR
+-.br
+-Specifies the base file name to be used for the generated \f3\&.SF\fR and \f3\&.DSA\fR files\&. For example, if file is \f3DUKESIGN\fR, then the generated \f3\&.SF\fR and \f3\&.DSA\fR files are named \f3DUKESIGN\&.SF\fR and \f3DUKESIGN\&.DSA\fR, and placed in the \f3META-INF\fR directory of the signed JAR file\&.
+-
+-The characters in the file must come from the set \f3a-zA-Z0-9_-\fR\&. Only letters, numbers, underscore, and hyphen characters are allowed\&. All lowercase characters are converted to uppercase for the \f3\&.SF\fR and \f3\&.DSA\fR file names\&.
+-
+-If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to upper case\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not valid in a signature file name, then each such character is converted to an underscore (_) character to form the file name\&.
+-.TP
+--sigalg \fIalgorithm\fR
+-.br
+-Specifies the name of the signature algorithm to use to sign the JAR file\&.
+-
+-For a list of standard signature algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-
+-This algorithm must be compatible with the private key used to sign the JAR file\&. If this option is not specified, then \f3SHA1withDSA\fR, \f3SHA256withRSA\fR, or \f3SHA256withECDSA\fR are used depending on the type of private key\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
+-.TP
+--digestalg \fIalgorithm\fR
+-.br
+-Specifies the name of the message digest algorithm to use when digesting the entries of a JAR file\&.
+-
+-For a list of standard message digest algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-
+-If this option is not specified, then \f3SHA256\fR is used\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
+-.TP
+--certs
+-.br
+-If the \f3-certs\fR option appears on the command line with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. This information includes the name of the type of certificate (stored in the \f3\&.DSA\fR file) that certifies the signer\&'s public key, and if the certificate is an X\&.509 certificate (an instance of the \f3java\&.security\&.cert\&.X509Certificate\fR), then the distinguished name of the signer\&.
+-
+-The keystore is also examined\&. If no keystore value is specified on the command line, then the default keystore file (if any) is checked\&. If the public key certificate for a signer matches an entry in the keystore, then the alias name for the keystore entry for that signer is displayed in parentheses\&.
+-.TP
+--certchain \fIfile\fR
+-.br
+-Specifies the certificate chain to be used when the certificate chain associated with the private key of the keystore entry that is addressed by the alias specified on the command line is not complete\&. This can happen when the keystore is located on a hardware token where there is not enough capacity to hold a complete certificate chain\&. The file can be a sequence of concatenated X\&.509 certificates, or a single PKCS#7 formatted data block, either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. See Internet RFC 1421 Certificate Encoding Standard and http://tools\&.ietf\&.org/html/rfc1421\&.
+-.TP
+--verbose
+-.br
+-When the \f3-verbose\fR option appears on the command line, it indicates verbose mode, which causes \f3jarsigner\fR to output extra information about the progress of the JAR signing or verification\&.
+-.TP
+--internalsf
+-.br
+-In the past, the \f3\&.DSA\fR (signature block) file generated when a JAR file was signed included a complete encoded copy of the \f3\&.SF\fR file (signature file) also generated\&. This behavior has been changed\&. To reduce the overall size of the output JAR file, the \f3\&.DSA\fR file by default does not contain a copy of the \f3\&.SF\fR file anymore\&. If \f3-internalsf\fR appears on the command line, then the old behavior is utilized\&. This option is useful for testing\&. In practice, do not use the \f3-internalsf\fR option because it incurs higher overhead\&.
+-.TP
+--sectionsonly
+-.br
+-If the \f3-sectionsonly\fR option appears on the command line, then the \f3\&.SF\fR file (signature file) generated when a JAR file is signed does not include a header that contains a hash of the whole manifest file\&. It contains only the information and hashes related to each individual source file included in the JAR file\&. See Signature File\&.
+-
+-By default, this header is added, as an optimization\&. When the header is present, whenever the JAR file is verified, the verification can first check to see whether the hash in the header matches the hash of the whole manifest file\&. When there is a match, verification proceeds to the next step\&. When there is no match, it is necessary to do a less optimized verification that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See JAR File Verification\&.
+-
+-The \f3-sectionsonly\fR option is primarily used for testing\&. It should not be used other than for testing because using it incurs higher overhead\&.
+-.TP
+--protected
+-.br
+-Values can be either \f3true\fR or \f3false\fR\&. Specify \f3true\fR when a password must be specified through a protected authentication path such as a dedicated PIN reader\&.
+-.TP
+--providerClass \fIprovider-class-name\fR
+-.br
+-Used to specify the name of cryptographic service provider\&'s master class file when the service provider is not listed in the \f3java\&.security\fR security properties file\&.
+-
+-Used with the \f3-providerArg ConfigFilePath\fR option, the \f3keytool\fR and \f3jarsigner\fR tools install the provider dynamically and use \fIConfigFilePath\fR for the path to the token configuration file\&. The following example shows a command to list a \f3PKCS #11\fR keystore when the Oracle PKCS #11 provider was not configured in the security properties file\&.
+-.sp
+-.nf
+-\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerClass sun\&.security\&.pkcs11\&.SunPKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerArg /mydir1/mydir2/token\&.config \e\fP
+-.fi
+-.nf
+-\f3 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--providerName \fIproviderName\fR
+-.br
+-If more than one provider was configured in the \f3java\&.security\fR security properties file, then you can use the \f3-providerName\fR option to target a specific provider instance\&. The argument to this option is the name of the provider\&.
+-
+-For the Oracle PKCS #11 provider, \fIproviderName\fR is of the form \f3SunPKCS11-\fR\fITokenName\fR, where \fITokenName\fR is the name suffix that the provider instance has been configured with, as detailed in the configuration attributes table\&. For example, the following command lists the contents of the \f3PKCS #11\fR keystore provider instance with name suffix \f3SmartCard\fR:
+-.sp
+-.nf
+-\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
+-.fi
+-.nf
+-\f3 \-providerName SunPKCS11\-SmartCard \e\fP
+-.fi
+-.nf
+-\f3 \-list\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--J\fIjavaoption\fR
+-.br
+-Passes through the specified \fIjavaoption\fR string directly to the Java interpreter\&. The \f3jarsigner\fR command is a wrapper around the interpreter\&. This option should not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
+-.TP
+--tsa \fIurl\fR
+-.br
+-If \f3-tsa http://example\&.tsa\&.url\fR appears on the command line when signing a JAR file then a time stamp is generated for the signature\&. The URL, \f3http://example\&.tsa\&.url\fR, identifies the location of the Time Stamping Authority (TSA) and overrides any URL found with the \f3-tsacert\fR option\&. The \f3-tsa\fR option does not require the TSA public key certificate to be present in the keystore\&.
+-
+-To generate the time stamp, \f3jarsigner\fR communicates with the TSA with the Time-Stamp Protocol (TSP) defined in RFC 3161\&. When successful, the time stamp token returned by the TSA is stored with the signature in the signature block file\&.
+-.TP
+--tsacert \fIalias\fR
+-.br
+-When \f3-tsacert alias\fR appears on the command line when signing a JAR file, a time stamp is generated for the signature\&. The alias identifies the TSA public key certificate in the keystore that is in effect\&. The entry\&'s certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA\&.
+-
+-The TSA public key certificate must be present in the keystore when using the \f3-tsacert\fR option\&.
+-.TP
+--tsapolicyid \fIpolicyid\fR
+-.br
+-Specifies the object identifier (OID) that identifies the policy ID to be sent to the TSA server\&. If this option is not specified, no policy ID is sent and the TSA server will choose a default policy ID\&.
+-
+-Object identifiers are defined by X\&.696, which is an ITU Telecommunication Standardization Sector (ITU-T) standard\&. These identifiers are typically period-separated sets of non-negative digits like \f31\&.2\&.3\&.4\fR, for example\&.
+-.TP
+--altsigner \fIclass\fR
+-.br
+-This option specifies an alternative signing mechanism\&. The fully qualified class name identifies a class file that extends the \f3com\&.sun\&.jarsigner\&.ContentSigner\fR abstract class\&. The path to this class file is defined by the \f3-altsignerpath\fR option\&. If the \f3-altsigner\fR option is used, then the \f3jarsigner\fR command uses the signing mechanism provided by the specified class\&. Otherwise, the \f3jarsigner\fR command uses its default signing mechanism\&.
+-
+-For example, to use the signing mechanism provided by a class named \f3com\&.sun\&.sun\&.jarsigner\&.AuthSigner\fR, use the jarsigner option \f3-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fR\&.
+-.TP
+--altsignerpath \fIclasspathlist\fR
+-.br
+-Specifies the path to the class file and any JAR file it depends on\&. The class file name is specified with the \f3-altsigner\fR option\&. If the class file is in a JAR file, then this option specifies the path to that JAR file\&.
+-
+-An absolute path or a path relative to the current directory can be specified\&. If \fIclasspathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semicolon (;) on Windows\&. This option is not necessary when the class is already in the search path\&.
+-
+-The following example shows how to specify the path to a JAR file that contains the class file\&. The JAR file name is included\&.
+-.sp
+-.nf
+-\f3\-altsignerpath /home/user/lib/authsigner\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-
+-The following example shows how to specify the path to the JAR file that contains the class file\&. The JAR file name is omitted\&.
+-.sp
+-.nf
+-\f3\-altsignerpath /home/user/classes/com/sun/tools/jarsigner/\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-
+-.TP
+--strict
+-.br
+-During the signing or verifying process, the command may issue warning messages\&. If you specify this option, the exit code of the tool reflects the severe warning messages that this command found\&. See Errors and Warnings\&.
+-.TP
+--verbose \fIsuboptions\fR
+-.br
+-For the verifying process, the \f3-verbose\fR option takes suboptions to determine how much information is shown\&. If the \f3-certs\fR option is also specified, then the default mode (or suboption \f3all\fR) displays each entry as it is being processed, and after that, the certificate information for each signer of the JAR file\&. If the \f3-certs\fR and the \f3-verbose:grouped\fR suboptions are specified, then entries with the same signer info are grouped and displayed together with their certificate information\&. If \f3-certs\fR and the \f3-verbose:summary\fR suboptions are specified, then entries with the same signer information are grouped and displayed together with their certificate information\&. Details about each entry are summarized and displayed as \fIone entry (and more)\fR\&. See Examples\&.
+-.SH ERRORS\ AND\ WARNINGS
+-During the signing or verifying process, the \f3jarsigner\fR command may issue various errors or warnings\&.
+-.PP
+-If there is a failure, the \f3jarsigner\fR command exits with code 1\&. If there is no failure, but there are one or more severe warnings, the \f3jarsigner\fR command exits with code 0 when the \f3-strict\fR option is \fInot\fR specified, or exits with the OR-value of the warning codes when the \f3-strict\fR is specified\&. If there is only informational warnings or no warning at all, the command always exits with code 0\&.
+-.PP
+-For example, if a certificate used to sign an entry is expired and has a KeyUsage extension that does not allow it to sign a file, the \f3jarsigner\fR command exits with code 12 (=4+8) when the \f3-strict\fR option is specified\&.
+-.PP
+-\fINote:\fR Exit codes are reused because only the values from 0 to 255 are legal on Unix-based operating systems\&.
+-.PP
+-The following sections describes the names, codes, and descriptions of the errors and warnings that the \f3jarsigner\fR command can issue\&.
+-.SS FAILURE
+-Reasons why the \f3jarsigner\fR command fails include (but are not limited to) a command line parsing error, the inability to find a keypair to sign the JAR file, or the verification of a signed JAR fails\&.
+-.TP
+-failure
+-Code 1\&. The signing or verifying fails\&.
+-.SS SEVERE\ WARNINGS
+-\fINote:\fR Severe warnings are reported as errors if you specify the \f3-strict\fR option\&.
+-.PP
+-Reasons why the \f3jarsigner\fR command issues a severe warning include the certificate used to sign the JAR file has an error or the signed JAR file has other problems\&.
+-.TP
+-hasExpiredCert
+-Code 4\&. This jar contains entries whose signer certificate has expired\&.
+-.TP
+-notYetValidCert
+-Code 4\&. This jar contains entries whose signer certificate is not yet valid\&.
+-.TP
+-chainNotValidated
+-Code 4\&. This jar contains entries whose certificate chain cannot be correctly validated\&.
+-.TP
+-badKeyUsage
+-Code 8\&. This jar contains entries whose signer certificate\&'s KeyUsage extension doesn\&'t allow code signing\&.
+-.TP
+-badExtendedKeyUsage
+-Code 8\&. This jar contains entries whose signer certificate\&'s ExtendedKeyUsage extension doesn\&'t allow code signing\&.
+-.TP
+-badNetscapeCertType
+-Code 8\&. This jar contains entries whose signer certificate\&'s NetscapeCertType extension doesn\&'t allow code signing\&.
+-.TP
+-hasUnsignedEntry
+-Code 16\&. This jar contains unsigned entries which have not been integrity-checked\&.
+-.TP
+-notSignedByAlias
+-Code 32\&. This jar contains signed entries which are not signed by the specified alias(es)\&.
+-.TP
+-aliasNotInStore
+-Code 32\&. This jar contains signed entries that are not signed by alias in this keystore\&.
+-.SS INFORMATIONAL\ WARNINGS
+-Informational warnings include those that are not errors but regarded as bad practice\&. They do not have a code\&.
+-.TP
+-hasExpiringCert
+-This jar contains entries whose signer certificate will expire within six months\&.
+-.TP
+-noTimestamp
+-This jar contains signatures that does not include a timestamp\&. Without a timestamp, users may not be able to validate this JAR file after the signer certificate\&'s expiration date (\f3YYYY-MM-DD\fR) or after any future revocation date\&.
+-.SH EXAMPLES
+-.SS SIGN\ A\ JAR\ FILE
+-Use the following command to sign bundle\&.jar with the private key of a user whose keystore alias is \f3jane\fR in a keystore named \f3mystore\fR in the \f3working\fR directory and name the signed JAR file \f3sbundle\&.jar\fR:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore\fP
+-.fi
+-.nf
+-\f3 \-storepass <keystore password>\fP
+-.fi
+-.nf
+-\f3 \-keypass <private key password>\fP
+-.fi
+-.nf
+-\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-There is no \f3-sigfile\fR specified in the previous command so the generated \f3\&.SF\fR and \f3\&.DSA\fR files to be placed in the signed JAR file have default names based on the alias name\&. They are named \f3JANE\&.SF\fR and \f3JANE\&.DSA\fR\&.
+-.PP
+-If you want to be prompted for the store password and the private key password, then you could shorten the previous command to the following:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore\fP
+-.fi
+-.nf
+-\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If the keystore is the default keystore (\&.keystore in your home directory), then you do not need to specify a keystore, as follows:
+-.sp
+-.nf
+-\f3jarsigner \-signedjar sbundle\&.jar bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If you want the signed JAR file to overwrite the input JAR file (bundle\&.jar), then you do not need to specify a \f3-signedjar\fR option, as follows:
+-.sp
+-.nf
+-\f3jarsigner bundle\&.jar jane\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS VERIFY\ A\ SIGNED\ JAR\ FILE
+-To verify a signed JAR file to ensure that the signature is valid and the JAR file was not been tampered with, use a command such as the following:
+-.sp
+-.nf
+-\f3jarsigner \-verify sbundle\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-When the verification is successful, \f3jar verified\fR is displayed\&. Otherwise, an error message is displayed\&. You can get more information when you use the \f3-verbose\fR option\&. A sample use of \f3jarsigner\fR with the\f3-verbose\fR option follows:
+-.sp
+-.nf
+-\f3jarsigner \-verify \-verbose sbundle\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
+-.fi
+-.nf
+-\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
+-.fi
+-.nf
+-\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 AclEx\&.class\fP
+-.fi
+-.nf
+-\f3 smk 849 Fri Sep 26 16:12:46 PDT 1997 test\&.class\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 s = signature was verified\fP
+-.fi
+-.nf
+-\f3 m = entry is listed in manifest\fP
+-.fi
+-.nf
+-\f3 k = at least one certificate was found in keystore\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 jar verified\&.\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-.SS VERIFICATION\ WITH\ CERTIFICATE\ INFORMATION
+-If you specify the \f3-certs\fR option with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. The information includes the certificate type, the signer distinguished name information (when it is an X\&.509 certificate), and in parentheses, the keystore alias for the signer when the public key certificate in the JAR file matches the one in a keystore entry, for example:
+-.sp
+-.nf
+-\f3jarsigner \-keystore /working/mystore \-verify \-verbose \-certs myTest\&.jar\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
+-.fi
+-.nf
+-\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
+-.fi
+-.nf
+-\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
+-.fi
+-.nf
+-\f3 208 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.SF\fP
+-.fi
+-.nf
+-\f3 1087 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.DSA\fP
+-.fi
+-.nf
+-\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 Tst\&.class\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 X\&.509, CN=Test Group, OU=Java Software, O=Oracle, L=CUP, S=CA, C=US (javatest)\fP
+-.fi
+-.nf
+-\f3 X\&.509, CN=Jane Smith, OU=Java Software, O=Oracle, L=cup, S=ca, C=us (jane)\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 s = signature was verified\fP
+-.fi
+-.nf
+-\f3 m = entry is listed in manifest\fP
+-.fi
+-.nf
+-\f3 k = at least one certificate was found in keystore\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.nf
+-\f3 jar verified\&.\fP
+-.fi
+-.nf
+-\f3\fR
+-.fi
+-.sp
+-If the certificate for a signer is not an X\&.509 certificate, then there is no distinguished name information\&. In that case, just the certificate type and the alias are shown\&. For example, if the certificate is a PGP certificate, and the alias is \f3bob\fR, then you would get: \f3PGP, (bob)\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-keytool(1)
+-.TP 0.2i
+-\(bu
+-Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
++
++.SH NAME
++jarsigner \- Signs and verifies Java Archive (JAR) files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjarsigner\fR [ \fIoptions\fR ] \fIjar\-file\fR \fIalias\fR
++.fi
++.nf
++
++\fBjarsigner\fR \fB\-verify\fR [ \fIoptions\fR ] \fIjar\-file\fR [\fIalias \&.\&.\&.\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++-verify
++.br
++The \f3-verify\fR option can take zero or more keystore alias names after the JAR file name\&. When the \f3-verify\fR option is specified, the \f3jarsigner\fR command checks that the certificate used to verify each signed entry in the JAR file matches one of the keystore aliases\&. The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
++
++If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar verified, with signer errors" is displayed\&.
++.TP
++\fIjar-file\fR
++The JAR file to be signed\&.
++
++If you also specified the \f3-strict\fR option, and the \f3jarsigner\fR command detected severe warnings, the message, "jar signed, with signer errors" is displayed\&.
++.TP
++\fIalias\fR
++The aliases are defined in the keystore specified by \f3-keystore\fR or the default keystore\&.
++.SH DESCRIPTION
++The \f3jarsigner\fR tool has two purposes:
++.TP 0.2i
++\(bu
++To sign Java Archive (JAR) files\&.
++.TP 0.2i
++\(bu
++To verify the signatures and integrity of signed JAR files\&.
++.PP
++The JAR feature enables the packaging of class files, images, sounds, and other digital data in a single file for faster and easier distribution\&. A tool named \f3jar\fR enables developers to produce JAR files\&. (Technically, any zip file can also be considered a JAR file, although when created by the \f3jar\fR command or processed by the \f3jarsigner\fR command, JAR files also contain a \f3META-INF/MANIFEST\&.MF\fR file\&.)
++.PP
++A digital signature is a string of bits that is computed from some data (the data being signed) and the private key of an entity (a person, company, and so on)\&. Similar to a handwritten signature, a digital signature has many useful characteristics:
++.TP 0.2i
++\(bu
++Its authenticity can be verified by a computation that uses the public key corresponding to the private key used to generate the signature\&.
++.TP 0.2i
++\(bu
++It cannot be forged, assuming the private key is kept secret\&.
++.TP 0.2i
++\(bu
++It is a function of the data signed and thus cannot be claimed to be the signature for other data as well\&.
++.TP 0.2i
++\(bu
++The signed data cannot be changed\&. If the data is changed, then the signature cannot be verified as authentic\&.
++.PP
++To generate an entity\&'s signature for a file, the entity must first have a public/private key pair associated with it and one or more certificates that authenticate its public key\&. A certificate is a digitally signed statement from one entity that says that the public key of another entity has a particular value\&.
++.PP
++The \f3jarsigner\fR command uses key and certificate information from a keystore to generate digital signatures for JAR files\&. A keystore is a database of private keys and their associated X\&.509 certificate chains that authenticate the corresponding public keys\&. The \f3keytool\fR command is used to create and administer keystores\&.
++.PP
++The \f3jarsigner\fR command uses an entity\&'s private key to generate a signature\&. The signed JAR file contains, among other things, a copy of the certificate from the keystore for the public key corresponding to the private key used to sign the file\&. The \f3jarsigner\fR command can verify the digital signature of the signed JAR file using the certificate inside it (in its signature block file)\&.
++.PP
++The \f3jarsigner\fR command can generate signatures that include a time stamp that lets a systems or deployer (including Java Plug-in) to check whether the JAR file was signed while the signing certificate was still valid\&. In addition, APIs allow applications to obtain the timestamp information\&.
++.PP
++At this time, the \f3jarsigner\fR command can only sign JAR files created by the \f3jar\fR command or zip files\&. JAR files are the same as zip files, except they also have a \f3META-INF/MANIFEST\&.MF\fR file\&. A \f3META-INF/MANIFEST\&.MF\fR file is created when the \f3jarsigner\fR command signs a zip file\&.
++.PP
++The default \f3jarsigner\fR command behavior is to sign a JAR or zip file\&. Use the \f3-verify\fR option to verify a signed JAR file\&.
++.PP
++The \f3jarsigner\fR command also attempts to validate the signer\&'s certificate after signing or verifying\&. If there is a validation error or any other problem, the command generates warning messages\&. If you specify the \f3-strict\fR option, then the command treats severe warnings as errors\&. See Errors and Warnings\&.
++.SS KEYSTORE\ ALIASES
++All keystore entities are accessed with unique aliases\&.
++.PP
++When you use the \f3jarsigner\fR command to sign a JAR file, you must specify the alias for the keystore entry that contains the private key needed to generate the signature\&. For example, the following command signs the JAR file named \f3MyJARFile\&.jar\fR with the private key associated with the alias \f3duke\fR in the keystore named \f3mystore\fR in the \f3working\fR directory\&. Because no output file is specified, it overwrites \f3MyJARFile\&.jar\fR with the signed JAR file\&.
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore \-storepass <keystore password>\fP
++.fi
++.nf
++\f3 \-keypass <private key password> MyJARFile\&.jar duke\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Keystores are protected with a password, so the store password must be specified\&. You are prompted for it when you do not specify it on the command line\&. Similarly, private keys are protected in a keystore with a password, so the private key\&'s password must be specified, and you are prompted for the password when you do not specify it on the command line and it is not the same as the store password\&.
++.SS KEYSTORE\ LOCATION
++The \f3jarsigner\fR command has a \f3-keystore\fR option for specifying the URL of the keystore to be used\&. The keystore is by default stored in a file named \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
++.PP
++On Oracle Solaris systems, \f3user\&.home\fR defaults to the user\&'s home directory\&.
++.PP
++The input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified when the \f3KeyStore\fR class is not file based, for example, when it resides on a hardware token device\&.
++.SS KEYSTORE\ IMPLEMENTATION
++The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies a number of well-defined interfaces to access and modify the information in a keystore\&. You can have multiple different concrete implementations, where each implementation is for a particular type of keystore\&.
++.PP
++Currently, there are two command-line tools that use keystore implementations (\f3keytool\fR and \f3jarsigner\fR), and a GUI-based tool named Policy Tool\&. Because the \f3KeyStore\fR class is publicly available, JDK users can write additional security applications that use it\&.
++.PP
++There is a built-in default implementation provided by Oracle that implements the keystore as a file, that uses a proprietary keystore type (format) named JKS\&. The built-in implementation protects each private key with its individual password and protects the integrity of the entire keystore with a (possibly different) password\&.
++.PP
++Keystore implementations are provider-based, which means the application interfaces supplied by the \f3KeyStore\fR class are implemented in terms of a Service Provider Interface (SPI)\&. There is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, that defines the Service Provider Interface methods that providers must implement\&. The term provider refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
++.PP
++Applications can choose different types of keystore implementations from different providers, with the \f3getInstance\fR factory method in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself\&. Keystore implementations of different types are not compatible\&.
++.PP
++The \f3jarsigner\fR and \f3policytool\fR commands can read file-based keystores from any location that can be specified using a URL\&. In addition, these commands can read non-file-based keystores such as those provided by MSCAPI on Windows and PKCS11 on all platforms\&.
++.PP
++For the \f3jarsigner\fR and \f3keytool\fR commands, you can specify a keystore type at the command line with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIEdit\fR command in the \fIKeyStore\fR menu\&.
++.PP
++If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and it resides in the JDK security properties directory, \f3java\&.home/lib/security\fR, where \f3java\&.home\fR is the runtime environment\&'s directory\&. The \f3jre\fR directory in the JDK or the top-level directory of the Java Runtime Environment (JRE)\&.
++.PP
++Each tool gets the \f3keystore\&.type\fR value and then examines all the installed providers until it finds one that implements keystores of that type\&. It then uses the keystore implementation from that provider\&.
++.PP
++The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type property\fR:
++.sp
++.nf
++\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++The default keystore type is \f3jks\fR (the proprietary type of the keystore implementation provided by Oracle)\&. This is specified by the following line in the security properties file:
++.sp
++.nf
++\f3keystore\&.type=jks\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++Case does not matter in keystore type designations\&. For example, \f3JKS\fR is the same as \f3jks\fR\&.
++.PP
++To have the tools use a keystore implementation other than the default, change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
++.sp
++.nf
++\f3keystore\&.type=pkcs12\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++\fINote:\fR If you use the PKCS 11 provider package, then see "KeyTool" and "JarSigner" in Java PKCS #11 Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.html
++.SS SUPPORTED\ ALGORITHMS
++By default, the \f3jarsigner\fR command signs a JAR file using one of the following algorithms:
++.TP 0.2i
++\(bu
++Digital Signature Algorithm (DSA) with the SHA1 digest algorithm
++.TP 0.2i
++\(bu
++RSA algorithm with the SHA256 digest algorithm
++.TP 0.2i
++\(bu
++Elliptic Curve (EC) cryptography algorithm with the SHA256 with Elliptic Curve Digital Signature Algorithm (ECDSA)\&.
++.PP
++If the signer\&'s public and private keys are DSA keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA1withDSA\fR algorithm\&. If the signer\&'s keys are RSA keys, then \f3jarsigner\fR attempts to sign the JAR file with the \f3SHA256withRSA\fR algorithm\&. If the signer\&'s keys are EC keys, then \f3jarsigner\fR signs the JAR file with the \f3SHA256withECDSA\fR algorithm\&.
++.PP
++These default signature algorithms can be overridden using the \f3-sigalg\fR option\&.
++.SS THE\ SIGNED\ JAR\ FILE
++When the \f3jarsigner\fR command is used to sign a JAR file, the output signed JAR file is exactly the same as the input JAR file, except that it has two additional files placed in the META-INF directory:
++.TP 0.2i
++\(bu
++A signature file with an \f3\&.SF\fR extension
++.TP 0.2i
++\(bu
++A signature block file with a \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR extension
++.PP
++The base file names for these two files come from the value of the \f3-sigFile\fR option\&. For example, when the option is \f3-sigFile MKSIGN\fR, the files are named \f3MKSIGN\&.SF\fR and \f3MKSIGN\&.DSA\fR
++.PP
++If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to uppercase\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not allowed in a signature file name, then each such character is converted to an underscore (_) character in forming the file name\&. Valid characters include letters, digits, underscores, and hyphens\&.
++.PP
++Signature File
++
++A signature file (\f3\&.SF\fR file) looks similar to the manifest file that is always included in a JAR file when the \f3jarsigner\fR command is used to sign the file\&. For each source file included in the JAR file, the \f3\&.SF\fR file has three lines, such as in the manifest file, that list the following:
++.TP 0.2i
++\(bu
++File name
++.TP 0.2i
++\(bu
++Name of the digest algorithm (SHA)
++.TP 0.2i
++\(bu
++SHA digest value
++.PP
++In the manifest file, the SHA digest value for each source file is the digest (hash) of the binary data in the source file\&. In the \f3\&.SF\fR file, the digest value for a specified source file is the hash of the three lines in the manifest file for the source file\&.
++.PP
++The signature file, by default, includes a header with a hash of the whole manifest file\&. The header also contains a hash of the manifest header\&. The presence of the header enables verification optimization\&. See JAR File Verification\&.
++.PP
++Signature Block File
++
++The \f3\&.SF\fR file is signed and the signature is placed in the signature block file\&. This file also contains, encoded inside it, the certificate or certificate chain from the keystore that authenticates the public key corresponding to the private key used for signing\&. The file has the extension \f3\&.DSA\fR, \f3\&.RSA\fR, or \f3\&.EC\fR, depending on the digest algorithm used\&.
++.SS SIGNATURE\ TIME\ STAMP
++The \f3jarsigner\fR command can generate and store a signature time stamp when signing a JAR file\&. In addition, \f3jarsigner\fR supports alternative signing mechanisms\&. This behavior is optional and is controlled by the user at the time of signing through these options\&. See Options\&.
++.sp
++.nf
++\f3\-tsa \fIurl\fR\fP
++.fi
++.nf
++\f3\-tsacert \fIalias\fR\fP
++.fi
++.nf
++\f3\-altsigner \fIclass\fR\fP
++.fi
++.nf
++\f3\-altsignerpath \fIclasspathlist\fR\fP
++.fi
++.nf
++\f3\-tsapolicyid \fIpolicyid\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS JAR\ FILE\ VERIFICATION
++A successful JAR file verification occurs when the signatures are valid, and none of the files that were in the JAR file when the signatures were generated have changed since then\&. JAR file verification involves the following steps:
++.TP 0.4i
++1\&.
++Verify the signature of the \f3\&.SF\fR file\&.
++
++The verification ensures that the signature stored in each signature block (\f3\&.DSA\fR) file was generated using the private key corresponding to the public key whose certificate (or certificate chain) also appears in the \f3\&.DSA\fR file\&. It also ensures that the signature is a valid signature of the corresponding signature (\f3\&.SF\fR) file, and thus the \f3\&.SF\fR file was not tampered with\&.
++.TP 0.4i
++2\&.
++Verify the digest listed in each entry in the \f3\&.SF\fR file with each corresponding section in the manifest\&.
++
++The \f3\&.SF\fR file by default includes a header that contains a hash of the entire manifest file\&. When the header is present, the verification can check to see whether or not the hash in the header matches the hash of the manifest file\&. If there is a match, then verification proceeds to the next step\&.
++
++If there is no match, then a less optimized verification is required to ensure that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See Signature File\&.
++
++One reason the hash of the manifest file that is stored in the \f3\&.SF\fR file header might not equal the hash of the current manifest file is that one or more files were added to the JAR file (with the \f3jar\fR tool) after the signature and \f3\&.SF\fR file were generated\&. When the \f3jar\fR tool is used to add files, the manifest file is changed by adding sections to it for the new files, but the \f3\&.SF\fR file is not changed\&. A verification is still considered successful when none of the files that were in the JAR file when the signature was generated have been changed since then\&. This happens when the hashes in the non-header sections of the \f3\&.SF\fR file equal the hashes of the corresponding sections in the manifest file\&.
++.TP 0.4i
++3\&.
++Read each file in the JAR file that has an entry in the \f3\&.SF\fR file\&. While reading, compute the file\&'s digest and compare the result with the digest for this file in the manifest section\&. The digests should be the same or verification fails\&.
++
++If any serious verification failures occur during the verification process, then the process is stopped and a security exception is thrown\&. The \f3jarsigner\fR command catches and displays the exception\&.
++.PP
++\fINote:\fR You should read any addition warnings (or errors if you specified the \f3-strict\fR option), as well as the content of the certificate (by specifying the \f3-verbose\fR and \f3-certs\fR options) to determine if the signature can be trusted\&.
++.SS MULTIPLE\ SIGNATURES\ FOR\ A\ JAR\ FILE
++A JAR file can be signed by multiple people by running the \f3jarsigner\fR command on the file multiple times and specifying the alias for a different person each time, as follows:
++.sp
++.nf
++\f3jarsigner myBundle\&.jar susan\fP
++.fi
++.nf
++\f3jarsigner myBundle\&.jar kevin\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++When a JAR file is signed multiple times, there are multiple \f3\&.SF\fR and \f3\&.DSA\fR files in the resulting JAR file, one pair for each signature\&. In the previous example, the output JAR file includes files with the following names:
++.sp
++.nf
++\f3SUSAN\&.SF\fP
++.fi
++.nf
++\f3SUSAN\&.DSA\fP
++.fi
++.nf
++\f3KEVIN\&.SF\fP
++.fi
++.nf
++\f3KEVIN\&.DSA\fP
++.fi
++.sp
++.SH OPTIONS
++The following sections describe the various \f3jarsigner\fR options\&. Be aware of the following standards:
++.TP 0.2i
++\(bu
++All option names are preceded by a minus sign (-)\&.
++.TP 0.2i
++\(bu
++The options can be provided in any order\&.
++.TP 0.2i
++\(bu
++Items that are in italics or underlined (option values) represent the actual values that must be supplied\&.
++.TP 0.2i
++\(bu
++The \f3-storepass\fR, \f3-keypass\fR, \f3-sigfile\fR, \f3-sigalg\fR, \f3-digestalg\fR, \f3-signedjar\fR, and TSA-related options are only relevant when signing a JAR file; they are not relevant when verifying a signed JAR file\&. The \f3-keystore\fR option is relevant for signing and verifying a JAR file\&. In addition, aliases are specified when signing and verifying a JAR file\&.
++.TP
++-keystore \fIurl\fR
++.br
++Specifies the URL that tells the keystore location\&. This defaults to the file \f3\&.keystore\fR in the user\&'s home directory, as determined by the \f3user\&.home\fR system property\&.
++
++A keystore is required when signing\&. You must explicitly specify a keystore when the default keystore does not exist or if you want to use one other than the default\&.
++
++A keystore is not required when verifying, but if one is specified or the default exists and the \f3-verbose\fR option was also specified, then additional information is output regarding whether or not any of the certificates used to verify the JAR file are contained in that keystore\&.
++
++The \f3-keystore\fR argument can be a file name and path specification rather than a URL, in which case it is treated the same as a file: URL, for example, the following are equivalent:
++.sp
++.nf
++\f3\-keystore \fIfilePathAndName\fR\fP
++.fi
++.nf
++\f3\-keystore file:\fIfilePathAndName\fR\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++If the Sun PKCS #11 provider was configured in the \f3java\&.security\fR security properties file (located in the JRE\&'s \f3$JAVA_HOME/lib/security directory\fR), then the \f3keytool\fR and \f3jarsigner\fR tools can operate on the PKCS #11 token by specifying these options:
++.sp
++.nf
++\f3\-keystore NONE\fP
++.fi
++.nf
++\f3\-storetype PKCS11\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++For example, the following command lists the contents of the configured PKCS#11 token:
++.sp
++.nf
++\f3keytool \-keystore NONE \-storetype PKCS11 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-storetype \fIstoretype\fR
++.br
++Specifies the type of keystore to be instantiated\&. The default keystore type is the one that is specified as the value of the \f3keystore\&.type\fR property in the security properties file, which is returned by the static \f3getDefaultType\fR method in \f3java\&.security\&.KeyStore\fR\&.
++
++The PIN for a PCKS #11 token can also be specified with the \f3-storepass\fR option\&. If none is specified, then the \f3keytool\fR and \f3jarsigner\fR commands prompt for the token PIN\&. If the token has a protected authentication path (such as a dedicated PIN-pad or a biometric reader), then the \f3-protected\fR option must be specified and no password options can be specified\&.
++.TP
++-storepass[:env | :file] \fIargument\fR
++.br
++Specifies the password that is required to access the keystore\&. This is only needed when signing (not verifying) a JAR file\&. In that case, if a \f3-storepass\fR option is not provided at the command line, then the user is prompted for the password\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \fIargument\fR\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
++.RE
++
++
++\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
++.TP
++-keypass [:env | :file] \fIargument\fR
++.br
++Specifies the password used to protect the private key of the keystore entry addressed by the alias specified on the command line\&. The password is required when using \f3jarsigner\fR to sign a JAR file\&. If no password is provided on the command line, and the required password is different from the store password, then the user is prompted for it\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the value \f3argument\fR\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named \f3argument\fR\&.
++.RE
++
++
++\fINote:\fR The password should not be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system\&.
++.TP
++-sigfile \fIfile\fR
++.br
++Specifies the base file name to be used for the generated \f3\&.SF\fR and \f3\&.DSA\fR files\&. For example, if file is \f3DUKESIGN\fR, then the generated \f3\&.SF\fR and \f3\&.DSA\fR files are named \f3DUKESIGN\&.SF\fR and \f3DUKESIGN\&.DSA\fR, and placed in the \f3META-INF\fR directory of the signed JAR file\&.
++
++The characters in the file must come from the set \f3a-zA-Z0-9_-\fR\&. Only letters, numbers, underscore, and hyphen characters are allowed\&. All lowercase characters are converted to uppercase for the \f3\&.SF\fR and \f3\&.DSA\fR file names\&.
++
++If no \f3-sigfile\fR option appears on the command line, then the base file name for the \f3\&.SF\fR and \f3\&.DSA\fR files is the first 8 characters of the alias name specified on the command line, all converted to upper case\&. If the alias name has fewer than 8 characters, then the full alias name is used\&. If the alias name contains any characters that are not valid in a signature file name, then each such character is converted to an underscore (_) character to form the file name\&.
++.TP
++-sigalg \fIalgorithm\fR
++.br
++Specifies the name of the signature algorithm to use to sign the JAR file\&.
++
++For a list of standard signature algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++
++This algorithm must be compatible with the private key used to sign the JAR file\&. If this option is not specified, then \f3SHA1withDSA\fR, \f3SHA256withRSA\fR, or \f3SHA256withECDSA\fR are used depending on the type of private key\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
++.TP
++-digestalg \fIalgorithm\fR
++.br
++Specifies the name of the message digest algorithm to use when digesting the entries of a JAR file\&.
++
++For a list of standard message digest algorithm names, see "Appendix A: Standard Names" in the Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++
++If this option is not specified, then \f3SHA256\fR is used\&. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f3-providerClass\fR option; otherwise, the command will not succeed\&.
++.TP
++-certs
++.br
++If the \f3-certs\fR option appears on the command line with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. This information includes the name of the type of certificate (stored in the \f3\&.DSA\fR file) that certifies the signer\&'s public key, and if the certificate is an X\&.509 certificate (an instance of the \f3java\&.security\&.cert\&.X509Certificate\fR), then the distinguished name of the signer\&.
++
++The keystore is also examined\&. If no keystore value is specified on the command line, then the default keystore file (if any) is checked\&. If the public key certificate for a signer matches an entry in the keystore, then the alias name for the keystore entry for that signer is displayed in parentheses\&.
++.TP
++-certchain \fIfile\fR
++.br
++Specifies the certificate chain to be used when the certificate chain associated with the private key of the keystore entry that is addressed by the alias specified on the command line is not complete\&. This can happen when the keystore is located on a hardware token where there is not enough capacity to hold a complete certificate chain\&. The file can be a sequence of concatenated X\&.509 certificates, or a single PKCS#7 formatted data block, either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. See Internet RFC 1421 Certificate Encoding Standard and http://tools\&.ietf\&.org/html/rfc1421\&.
++.TP
++-verbose
++.br
++When the \f3-verbose\fR option appears on the command line, it indicates verbose mode, which causes \f3jarsigner\fR to output extra information about the progress of the JAR signing or verification\&.
++.TP
++-internalsf
++.br
++In the past, the \f3\&.DSA\fR (signature block) file generated when a JAR file was signed included a complete encoded copy of the \f3\&.SF\fR file (signature file) also generated\&. This behavior has been changed\&. To reduce the overall size of the output JAR file, the \f3\&.DSA\fR file by default does not contain a copy of the \f3\&.SF\fR file anymore\&. If \f3-internalsf\fR appears on the command line, then the old behavior is utilized\&. This option is useful for testing\&. In practice, do not use the \f3-internalsf\fR option because it incurs higher overhead\&.
++.TP
++-sectionsonly
++.br
++If the \f3-sectionsonly\fR option appears on the command line, then the \f3\&.SF\fR file (signature file) generated when a JAR file is signed does not include a header that contains a hash of the whole manifest file\&. It contains only the information and hashes related to each individual source file included in the JAR file\&. See Signature File\&.
++
++By default, this header is added, as an optimization\&. When the header is present, whenever the JAR file is verified, the verification can first check to see whether the hash in the header matches the hash of the whole manifest file\&. When there is a match, verification proceeds to the next step\&. When there is no match, it is necessary to do a less optimized verification that the hash in each source file information section in the \f3\&.SF\fR file equals the hash of its corresponding section in the manifest file\&. See JAR File Verification\&.
++
++The \f3-sectionsonly\fR option is primarily used for testing\&. It should not be used other than for testing because using it incurs higher overhead\&.
++.TP
++-protected
++.br
++Values can be either \f3true\fR or \f3false\fR\&. Specify \f3true\fR when a password must be specified through a protected authentication path such as a dedicated PIN reader\&.
++.TP
++-providerClass \fIprovider-class-name\fR
++.br
++Used to specify the name of cryptographic service provider\&'s master class file when the service provider is not listed in the \f3java\&.security\fR security properties file\&.
++
++Used with the \f3-providerArg ConfigFilePath\fR option, the \f3keytool\fR and \f3jarsigner\fR tools install the provider dynamically and use \fIConfigFilePath\fR for the path to the token configuration file\&. The following example shows a command to list a \f3PKCS #11\fR keystore when the Oracle PKCS #11 provider was not configured in the security properties file\&.
++.sp
++.nf
++\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerClass sun\&.security\&.pkcs11\&.SunPKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerArg /mydir1/mydir2/token\&.config \e\fP
++.fi
++.nf
++\f3 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-providerName \fIproviderName\fR
++.br
++If more than one provider was configured in the \f3java\&.security\fR security properties file, then you can use the \f3-providerName\fR option to target a specific provider instance\&. The argument to this option is the name of the provider\&.
++
++For the Oracle PKCS #11 provider, \fIproviderName\fR is of the form \f3SunPKCS11-\fR\fITokenName\fR, where \fITokenName\fR is the name suffix that the provider instance has been configured with, as detailed in the configuration attributes table\&. For example, the following command lists the contents of the \f3PKCS #11\fR keystore provider instance with name suffix \f3SmartCard\fR:
++.sp
++.nf
++\f3jarsigner \-keystore NONE \-storetype PKCS11 \e\fP
++.fi
++.nf
++\f3 \-providerName SunPKCS11\-SmartCard \e\fP
++.fi
++.nf
++\f3 \-list\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-J\fIjavaoption\fR
++.br
++Passes through the specified \fIjavaoption\fR string directly to the Java interpreter\&. The \f3jarsigner\fR command is a wrapper around the interpreter\&. This option should not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
++.TP
++-tsa \fIurl\fR
++.br
++If \f3-tsa http://example\&.tsa\&.url\fR appears on the command line when signing a JAR file then a time stamp is generated for the signature\&. The URL, \f3http://example\&.tsa\&.url\fR, identifies the location of the Time Stamping Authority (TSA) and overrides any URL found with the \f3-tsacert\fR option\&. The \f3-tsa\fR option does not require the TSA public key certificate to be present in the keystore\&.
++
++To generate the time stamp, \f3jarsigner\fR communicates with the TSA with the Time-Stamp Protocol (TSP) defined in RFC 3161\&. When successful, the time stamp token returned by the TSA is stored with the signature in the signature block file\&.
++.TP
++-tsacert \fIalias\fR
++.br
++When \f3-tsacert alias\fR appears on the command line when signing a JAR file, a time stamp is generated for the signature\&. The alias identifies the TSA public key certificate in the keystore that is in effect\&. The entry\&'s certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA\&.
++
++The TSA public key certificate must be present in the keystore when using the \f3-tsacert\fR option\&.
++.TP
++-tsapolicyid \fIpolicyid\fR
++.br
++Specifies the object identifier (OID) that identifies the policy ID to be sent to the TSA server\&. If this option is not specified, no policy ID is sent and the TSA server will choose a default policy ID\&.
++
++Object identifiers are defined by X\&.696, which is an ITU Telecommunication Standardization Sector (ITU-T) standard\&. These identifiers are typically period-separated sets of non-negative digits like \f31\&.2\&.3\&.4\fR, for example\&.
++.TP
++-altsigner \fIclass\fR
++.br
++This option specifies an alternative signing mechanism\&. The fully qualified class name identifies a class file that extends the \f3com\&.sun\&.jarsigner\&.ContentSigner\fR abstract class\&. The path to this class file is defined by the \f3-altsignerpath\fR option\&. If the \f3-altsigner\fR option is used, then the \f3jarsigner\fR command uses the signing mechanism provided by the specified class\&. Otherwise, the \f3jarsigner\fR command uses its default signing mechanism\&.
++
++For example, to use the signing mechanism provided by a class named \f3com\&.sun\&.sun\&.jarsigner\&.AuthSigner\fR, use the jarsigner option \f3-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fR\&.
++.TP
++-altsignerpath \fIclasspathlist\fR
++.br
++Specifies the path to the class file and any JAR file it depends on\&. The class file name is specified with the \f3-altsigner\fR option\&. If the class file is in a JAR file, then this option specifies the path to that JAR file\&.
++
++An absolute path or a path relative to the current directory can be specified\&. If \fIclasspathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semicolon (;) on Windows\&. This option is not necessary when the class is already in the search path\&.
++
++The following example shows how to specify the path to a JAR file that contains the class file\&. The JAR file name is included\&.
++.sp
++.nf
++\f3\-altsignerpath /home/user/lib/authsigner\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++
++The following example shows how to specify the path to the JAR file that contains the class file\&. The JAR file name is omitted\&.
++.sp
++.nf
++\f3\-altsignerpath /home/user/classes/com/sun/tools/jarsigner/\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++
++.TP
++-strict
++.br
++During the signing or verifying process, the command may issue warning messages\&. If you specify this option, the exit code of the tool reflects the severe warning messages that this command found\&. See Errors and Warnings\&.
++.TP
++-verbose \fIsuboptions\fR
++.br
++For the verifying process, the \f3-verbose\fR option takes suboptions to determine how much information is shown\&. If the \f3-certs\fR option is also specified, then the default mode (or suboption \f3all\fR) displays each entry as it is being processed, and after that, the certificate information for each signer of the JAR file\&. If the \f3-certs\fR and the \f3-verbose:grouped\fR suboptions are specified, then entries with the same signer info are grouped and displayed together with their certificate information\&. If \f3-certs\fR and the \f3-verbose:summary\fR suboptions are specified, then entries with the same signer information are grouped and displayed together with their certificate information\&. Details about each entry are summarized and displayed as \fIone entry (and more)\fR\&. See Examples\&.
++.SH ERRORS\ AND\ WARNINGS
++During the signing or verifying process, the \f3jarsigner\fR command may issue various errors or warnings\&.
++.PP
++If there is a failure, the \f3jarsigner\fR command exits with code 1\&. If there is no failure, but there are one or more severe warnings, the \f3jarsigner\fR command exits with code 0 when the \f3-strict\fR option is \fInot\fR specified, or exits with the OR-value of the warning codes when the \f3-strict\fR is specified\&. If there is only informational warnings or no warning at all, the command always exits with code 0\&.
++.PP
++For example, if a certificate used to sign an entry is expired and has a KeyUsage extension that does not allow it to sign a file, the \f3jarsigner\fR command exits with code 12 (=4+8) when the \f3-strict\fR option is specified\&.
++.PP
++\fINote:\fR Exit codes are reused because only the values from 0 to 255 are legal on Unix-based operating systems\&.
++.PP
++The following sections describes the names, codes, and descriptions of the errors and warnings that the \f3jarsigner\fR command can issue\&.
++.SS FAILURE
++Reasons why the \f3jarsigner\fR command fails include (but are not limited to) a command line parsing error, the inability to find a keypair to sign the JAR file, or the verification of a signed JAR fails\&.
++.TP
++failure
++Code 1\&. The signing or verifying fails\&.
++.SS SEVERE\ WARNINGS
++\fINote:\fR Severe warnings are reported as errors if you specify the \f3-strict\fR option\&.
++.PP
++Reasons why the \f3jarsigner\fR command issues a severe warning include the certificate used to sign the JAR file has an error or the signed JAR file has other problems\&.
++.TP
++hasExpiredCert
++Code 4\&. This jar contains entries whose signer certificate has expired\&.
++.TP
++notYetValidCert
++Code 4\&. This jar contains entries whose signer certificate is not yet valid\&.
++.TP
++chainNotValidated
++Code 4\&. This jar contains entries whose certificate chain cannot be correctly validated\&.
++.TP
++badKeyUsage
++Code 8\&. This jar contains entries whose signer certificate\&'s KeyUsage extension doesn\&'t allow code signing\&.
++.TP
++badExtendedKeyUsage
++Code 8\&. This jar contains entries whose signer certificate\&'s ExtendedKeyUsage extension doesn\&'t allow code signing\&.
++.TP
++badNetscapeCertType
++Code 8\&. This jar contains entries whose signer certificate\&'s NetscapeCertType extension doesn\&'t allow code signing\&.
++.TP
++hasUnsignedEntry
++Code 16\&. This jar contains unsigned entries which have not been integrity-checked\&.
++.TP
++notSignedByAlias
++Code 32\&. This jar contains signed entries which are not signed by the specified alias(es)\&.
++.TP
++aliasNotInStore
++Code 32\&. This jar contains signed entries that are not signed by alias in this keystore\&.
++.SS INFORMATIONAL\ WARNINGS
++Informational warnings include those that are not errors but regarded as bad practice\&. They do not have a code\&.
++.TP
++hasExpiringCert
++This jar contains entries whose signer certificate will expire within six months\&.
++.TP
++noTimestamp
++This jar contains signatures that does not include a timestamp\&. Without a timestamp, users may not be able to validate this JAR file after the signer certificate\&'s expiration date (\f3YYYY-MM-DD\fR) or after any future revocation date\&.
++.SH EXAMPLES
++.SS SIGN\ A\ JAR\ FILE
++Use the following command to sign bundle\&.jar with the private key of a user whose keystore alias is \f3jane\fR in a keystore named \f3mystore\fR in the \f3working\fR directory and name the signed JAR file \f3sbundle\&.jar\fR:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore\fP
++.fi
++.nf
++\f3 \-storepass <keystore password>\fP
++.fi
++.nf
++\f3 \-keypass <private key password>\fP
++.fi
++.nf
++\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++There is no \f3-sigfile\fR specified in the previous command so the generated \f3\&.SF\fR and \f3\&.DSA\fR files to be placed in the signed JAR file have default names based on the alias name\&. They are named \f3JANE\&.SF\fR and \f3JANE\&.DSA\fR\&.
++.PP
++If you want to be prompted for the store password and the private key password, then you could shorten the previous command to the following:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore\fP
++.fi
++.nf
++\f3 \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If the keystore is the default keystore (\&.keystore in your home directory), then you do not need to specify a keystore, as follows:
++.sp
++.nf
++\f3jarsigner \-signedjar sbundle\&.jar bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If you want the signed JAR file to overwrite the input JAR file (bundle\&.jar), then you do not need to specify a \f3-signedjar\fR option, as follows:
++.sp
++.nf
++\f3jarsigner bundle\&.jar jane\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS VERIFY\ A\ SIGNED\ JAR\ FILE
++To verify a signed JAR file to ensure that the signature is valid and the JAR file was not been tampered with, use a command such as the following:
++.sp
++.nf
++\f3jarsigner \-verify sbundle\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++When the verification is successful, \f3jar verified\fR is displayed\&. Otherwise, an error message is displayed\&. You can get more information when you use the \f3-verbose\fR option\&. A sample use of \f3jarsigner\fR with the\f3-verbose\fR option follows:
++.sp
++.nf
++\f3jarsigner \-verify \-verbose sbundle\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
++.fi
++.nf
++\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
++.fi
++.nf
++\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 AclEx\&.class\fP
++.fi
++.nf
++\f3 smk 849 Fri Sep 26 16:12:46 PDT 1997 test\&.class\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 s = signature was verified\fP
++.fi
++.nf
++\f3 m = entry is listed in manifest\fP
++.fi
++.nf
++\f3 k = at least one certificate was found in keystore\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 jar verified\&.\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++.SS VERIFICATION\ WITH\ CERTIFICATE\ INFORMATION
++If you specify the \f3-certs\fR option with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. The information includes the certificate type, the signer distinguished name information (when it is an X\&.509 certificate), and in parentheses, the keystore alias for the signer when the public key certificate in the JAR file matches the one in a keystore entry, for example:
++.sp
++.nf
++\f3jarsigner \-keystore /working/mystore \-verify \-verbose \-certs myTest\&.jar\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
++.fi
++.nf
++\f3 199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
++.fi
++.nf
++\f3 1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
++.fi
++.nf
++\f3 208 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.SF\fP
++.fi
++.nf
++\f3 1087 Fri Sep 26 16:23:30 PDT 1997 META\-INF/JAVATEST\&.DSA\fP
++.fi
++.nf
++\f3 smk 2752 Fri Sep 26 16:12:30 PDT 1997 Tst\&.class\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 X\&.509, CN=Test Group, OU=Java Software, O=Oracle, L=CUP, S=CA, C=US (javatest)\fP
++.fi
++.nf
++\f3 X\&.509, CN=Jane Smith, OU=Java Software, O=Oracle, L=cup, S=ca, C=us (jane)\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 s = signature was verified\fP
++.fi
++.nf
++\f3 m = entry is listed in manifest\fP
++.fi
++.nf
++\f3 k = at least one certificate was found in keystore\fP
++.fi
++.nf
++\f3\fR
++.fi
++.nf
++\f3 jar verified\&.\fP
++.fi
++.nf
++\f3\fR
++.fi
++.sp
++If the certificate for a signer is not an X\&.509 certificate, then there is no distinguished name information\&. In that case, just the certificate type and the alias are shown\&. For example, if the certificate is a PGP certificate, and the alias is \f3bob\fR, then you would get: \f3PGP, (bob)\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++keytool(1)
++.TP 0.2i
++\(bu
++Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/java.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/java.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/javac.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/javac.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Basic Tools
+-.\" Title: javac.1
+-.\"
+-.if n .pl 99999
+-.TH javac 1 "03 March 2015" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Basic Tools
++.\" Title: javac.1
++.\"
++.if n .pl 99999
++.TH javac 1 "03 March 2015" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,1322 +47,1322 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javac \- Reads Java class and interface definitions and compiles them into bytecode and class files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavac\fR [ \fIoptions\fR ] [ \fIsourcefiles\fR ] [ \fIclasses\fR] [ \fI@argfiles\fR ]
+-.fi
+-.sp
+-Arguments can be in any order:
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIsourcefiles\fR
+-One or more source files to be compiled (such as \f3MyClass\&.java\fR)\&.
+-.TP
+-\fIclasses\fR
+-One or more classes to be processed for annotations (such as \f3MyPackage\&.MyClass\fR)\&.
+-.TP
+-\fI@argfiles\fR
+-One or more files that list options and source files\&. The \f3-J\fR options are not allowed in these files\&. See Command-Line Argument Files\&.
+-.SH DESCRIPTION
+-The \f3javac\fR command reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files\&. The \f3javac\fR command can also process annotations in Java source files and classes\&.
+-.PP
+-There are two ways to pass source code file names to \f3javac\fR\&.
+-.TP 0.2i
+-\(bu
+-For a small number of source files, list the file names on the command line\&.
+-.TP 0.2i
+-\(bu
+-For a large number of source files, list the file names in a file that is separated by blanks or line breaks\&. Use the list file name preceded by an at sign (@) with the \f3javac\fR command\&.
+-.PP
+-Source code file names must have \&.java suffixes, class file names must have \&.class suffixes, and both source and class files must have root names that identify the class\&. For example, a class called \f3MyClass\fR would be written in a source file called \f3MyClass\&.java\fR and compiled into a bytecode class file called \f3MyClass\&.class\fR\&.
+-.PP
+-Inner class definitions produce additional class files\&. These class files have names that combine the inner and outer class names, such as \f3MyClass$MyInnerClass\&.class\fR\&.
+-.PP
+-Arrange source files in a directory tree that reflects their package tree\&. For example, if all of your source files are in \f3/workspace\fR, then put the source code for \f3com\&.mysoft\&.mypack\&.MyClass\fR in \f3/workspace/com/mysoft/mypack/MyClass\&.java\fR\&.
+-.PP
+-By default, the compiler puts each class file in the same directory as its source file\&. You can specify a separate destination directory with the \f3-d\fR option\&.
+-.SH OPTIONS
+-The compiler has a set of standard options that are supported on the current development environment\&. An additional set of nonstandard options are specific to the current virtual machine and compiler implementations and are subject to change in the future\&. Nonstandard options begin with the \f3-X\fR option\&.
+-.TP 0.2i
+-\(bu
+-See also Cross-Compilation Options
+-.TP 0.2i
+-\(bu
+-See also Nonstandard Options
+-.SS STANDARD\ OPTIONS
+-.TP
+--A\fIkey\fR[\fI=value\fR]
+-.br
+-Specifies options to pass to annotation processors\&. These options are not interpreted by \f3javac\fR directly, but are made available for use by individual processors\&. The \f3key\fR value should be one or more identifiers separated by a dot (\&.)\&.
+-.TP
+--cp \fIpath\fR or -classpath \fIpath\fR
+-.br
+-Specifies where to find user class files, and (optionally) annotation processors and source files\&. This class path overrides the user class path in the \f3CLASSPATH\fR environment variable\&. If neither \f3CLASSPATH\fR, \f3-cp\fR nor \f3-classpath\fR is specified, then the user \fIclass path\fR is the current directory\&. See Setting the Class Path\&.
+-
+-If the \f3-sourcepath\fR option is not specified, then the user class path is also searched for source files\&.
+-
+-If the \f3-processorpath\fR option is not specified, then the class path is also searched for annotation processors\&.
+-.TP
+--Djava\&.ext\&.dirs=\fIdirectories\fR
+-.br
+-Overrides the location of installed extensions\&.
+-.TP
+--Djava\&.endorsed\&.dirs=\fIdirectories\fR
+-.br
+-Overrides the location of the endorsed standards path\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Sets the destination directory for class files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then \f3javac\fR puts the class file in a subdirectory that reflects the package name and creates directories as needed\&.
+-
+-If you specify \f3-d\fR\f3/home/myclasses\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the class file is \f3/home/myclasses/com/mypackage/MyClass\&.class\fR\&.
+-
+-If the \fI-d\fR option is not specified, then \f3javac\fR puts each class file in the same directory as the source file from which it was generated\&.
+-
+-\fINote:\fR The directory specified by the \fI-d\fR option is not automatically added to your user class path\&.
+-.TP
+--deprecation
+-.br
+-Shows a description of each use or override of a deprecated member or class\&. Without the \f3-deprecation\fR option, \f3javac\fR shows a summary of the source files that use or override deprecated members or classes\&. The \f3-deprecation\fR option is shorthand for \f3-Xlint:deprecation\fR\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Sets the source file encoding name, such as EUC-JP and UTF-8\&. If the \f3-encoding\fR option is not specified, then the platform default converter is used\&.
+-.TP
+--endorseddirs \fIdirectories\fR
+-.br
+-Overrides the location of the endorsed standards path\&.
+-.TP
+--extdirs \fIdirectories\fR
+-.br
+-Overrides the location of the \f3ext\fR directory\&. The directories variable is a colon-separated list of directories\&. Each JAR file in the specified directories is searched for class files\&. All JAR files found become part of the class path\&.
+-
+-If you are cross-compiling (compiling classes against bootstrap and extension classes of a different Java platform implementation), then this option specifies the directories that contain the extension classes\&. See Cross-Compilation Options for more information\&.
+-.TP
+--g
+-.br
+-Generates all debugging information, including local variables\&. By default, only line number and source file information is generated\&.
+-.TP
+--g:none
+-.br
+-Does not generate any debugging information\&.
+-.TP
+--g:[\fIkeyword list\fR]
+-.br
+-Generates only some kinds of debugging information, specified by a comma separated list of keywords\&. Valid keywords are:
+-.RS
+-.TP
+-source
+-Source file debugging information\&.
+-.TP
+-lines
+-Line number debugging information\&.
+-.TP
+-vars
+-Local variable debugging information\&.
+-.RE
+-
+-.TP
+--help
+-.br
+-Prints a synopsis of standard options\&.
+-.TP
+--implicit:[\fIclass, none\fR]
+-.br
+-Controls the generation of class files for implicitly loaded source files\&. To automatically generate class files, use \f3-implicit:class\fR\&. To suppress class file generation, use \f3-implicit:none\fR\&. If this option is not specified, then the default is to automatically generate class files\&. In this case, the compiler issues a warning if any such class files are generated when also doing annotation processing\&. The warning is not issued when the \f3-implicit\fR option is set explicitly\&. See Searching for Types\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-
+-\fINote:\fR The \fICLASSPATH\fR, \f3-classpath\fR, \f3-bootclasspath\fR, and \f3-extdirs\fR options do not specify the classes used to run \f3javac\fR\&. Trying to customize the compiler implementation with these options and variables is risky and often does not accomplish what you want\&. If you must customize the complier implementation, then use the \f3-J\fR option to pass options through to the underlying \f3\fRJava launcher\&.
+-.TP
+--nowarn
+-.br
+-Disables warning messages\&. This option operates the same as the \f3-Xlint:none\fR option\&.
+-.TP
+--parameters
+-.br
+-Stores formal parameter names of constructors and methods in the generated class file so that the method \f3java\&.lang\&.reflect\&.Executable\&.getParameters\fR from the Reflection API can retrieve them\&.
+-.TP
+--proc: [\fInone\fR, \fIonly\fR]
+-.br
+-Controls whether annotation processing and compilation are done\&. \f3-proc:none\fR means that compilation takes place without annotation processing\&. \f3-proc:only\fR means that only annotation processing is done, without any subsequent compilation\&.
+-.TP
+--processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.]
+-.br
+-Names of the annotation processors to run\&. This bypasses the default discovery process\&.
+-.TP
+--processorpath \fIpath\fR
+-.br
+-Specifies where to find annotation processors\&. If this option is not used, then the class path is searched for processors\&.
+-.TP
+--s \fIdir\fR
+-.br
+-Specifies the directory where to place the generated source files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then the compiler puts the source file in a subdirectory that reflects the package name and creates directories as needed\&.
+-
+-If you specify \f3-s /home/mysrc\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the source file is put in \f3/home/mysrc/com/mypackage/MyClass\&.java\fR\&.
+-.TP
+--source \fIrelease\fR
+-.br
+-Specifies the version of source code accepted\&. The following values for \f3release\fR are allowed:
+-.RS
+-.TP
+-1\&.3
+-The compiler does not support assertions, generics, or other language features introduced after Java SE 1\&.3\&.
+-.TP
+-1\&.4
+-The compiler accepts code containing assertions, which were introduced in Java SE 1\&.4\&.
+-.TP
+-1\&.5
+-The compiler accepts code containing generics and other language features introduced in Java SE 5\&.
+-.TP
+-5
+-Synonym for 1\&.5\&.
+-.TP
+-1\&.6
+-No language changes were introduced in Java SE 6\&. However, encoding errors in source files are now reported as errors instead of warnings as in earlier releases of Java Platform, Standard Edition\&.
+-.TP
+-6
+-Synonym for 1\&.6\&.
+-.TP
+-1\&.7
+-The compiler accepts code with features introduced in Java SE 7\&.
+-.TP
+-7
+-Synonym for 1\&.7\&.
+-.TP
+-1\&.8
+-This is the default value\&. The compiler accepts code with features introduced in Java SE 8\&.
+-.TP
+-8
+-Synonym for 1\&.8\&.
+-.RE
+-
+-.TP
+--sourcepath \fIsourcepath\fR
+-.br
+-Specifies the source code path to search for class or interface definitions\&. As with the user class path, source path entries are separated by colons (:) on Oracle Solaris and semicolons on Windows and can be directories, JAR archives, or ZIP archives\&. If packages are used, then the local path name within the directory or archive must reflect the package name\&.
+-
+-\fINote:\fR Classes found through the class path might be recompiled when their source files are also found\&. See Searching for Types\&.
+-.TP
+--verbose
+-.br
+-Uses verbose output, which includes information about each class loaded and each source file compiled\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--werror
+-.br
+-Terminates compilation when warnings occur\&.
+-.TP
+--X
+-.br
+-Displays information about nonstandard options and exits\&.
+-.SS CROSS-COMPILATION\ OPTIONS
+-By default, classes are compiled against the bootstrap and extension classes of the platform that \f3javac\fR shipped with\&. But \f3javac\fR also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation\&. It is important to use the \f3-bootclasspath\fR and \f3-extdirs\fR options when cross-compiling\&.
+-.TP
+--target \fIversion\fR
+-.br
+-Generates class files that target a specified release of the virtual machine\&. Class files will run on the specified target and on later releases, but not on earlier releases of the JVM\&. Valid targets are 1\&.1, 1\&.2, 1\&.3, 1\&.4, 1\&.5 (also 5), 1\&.6 (also 6), 1\&.7 (also 7), and 1\&.8 (also 8)\&.
+-
+-The default for the \f3-target\fR option depends on the value of the \f3-source\fR option:
+-.RS
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is not specified, then the value of the \f3-target\fR option is 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.2, then the value of the \f3-target\fR option is 1\&.4
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.3, then the value of the \f3-target\fR option is 1\&.4
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.5, then the value of the \f3-target\fR option is 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.6, then the value of the \f3-target\fR is option 1\&.8
+-.TP 0.2i
+-\(bu
+-If the \f3-source\fR option is 1\&.7, then the value of the \f3-target\fR is option 1\&.8
+-.TP 0.2i
+-\(bu
+-For all other values of the \f3-source\fR option, the value of the \f3-target\fR option is the value of the \f3-source\fR option\&.
+-.RE
+-
+-.TP
+--bootclasspath \fIbootclasspath\fR
+-.br
+-Cross-compiles against the specified set of boot classes\&. As with the user class path, boot class path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives\&.
+-.SS COMPACT\ PROFILE\ OPTION
+-Beginning with JDK 8, the \f3javac\fR compiler supports compact profiles\&. With compact profiles, applications that do not require the entire Java platform can be deployed and run with a smaller footprint\&. The compact profiles feature could be used to shorten the download time for applications from app stores\&. This feature makes for more compact deployment of Java applications that bundle the JRE\&. This feature is also useful in small devices\&.
+-.PP
+-The supported profile values are \f3compact1\fR, \f3compact2\fR, and \f3compact3\fR\&. These are additive layers\&. Each higher-numbered compact profile contains all of the APIs in profiles with smaller number names\&.
+-.TP
+--profile
+-.br
+-When using compact profiles, this option specifies the profile name when compiling\&. For example:
+-.sp
+-.nf
+-\f3javac \-profile compact1 Hello\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-javac does not compile source code that uses any Java SE APIs that is not in the specified profile\&. Here is an example of the error message that results from attempting to compile such source code:
+-.sp
+-.nf
+-\f3cd jdk1\&.8\&.0/bin\fP
+-.fi
+-.nf
+-\f3\&./javac \-profile compact1 Paint\&.java\fP
+-.fi
+-.nf
+-\f3Paint\&.java:5: error: Applet is not available in profile \&'compact1\&'\fP
+-.fi
+-.nf
+-\f3import java\&.applet\&.Applet;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-In this example, you can correct the error by modifying the source to not use the \f3Applet\fR class\&. You could also correct the error by compiling without the -profile option\&. Then the compilation would be run against the full set of Java SE APIs\&. (None of the compact profiles include the \f3Applet\fR class\&.)
+-
+-An alternative way to compile with compact profiles is to use the \f3-bootclasspath\fR option to specify a path to an \f3rt\&.jar\fR file that specifies a profile\&'s image\&. Using the \f3-profile\fR option instead does not require a profile image to be present on the system at compile time\&. This is useful when cross-compiling\&.
+-.SS NONSTANDARD\ OPTIONS
+-.TP
+--Xbootclasspath/p:\fIpath\fR
+-.br
+-Adds a suffix to the bootstrap class path\&.
+-.TP
+--Xbootclasspath/a:\fIpath\fR
+-.br
+-Adds a prefix to the bootstrap class path\&.
+-.TP
+--Xbootclasspath/:\fIpath\fR
+-.br
+-Overrides the location of the bootstrap class files\&.
+-.TP
+--Xdoclint:[-]\fIgroup\fR [\fI/access\fR]
+-.br
+-Enables or disables specific groups of checks, where \fIgroup\fR is one of the following values: \f3accessibility\fR, \f3syntax\fR, \f3reference\fR, \f3html\fR or \f3missing\fR\&. For more information about these groups of checks see the \f3-Xdoclint\fR option of the \f3javadoc\fR command\&. The \f3-Xdoclint\fR option is disabled by default in the \f3javac\fR command\&.
+-
+-The variable \fIaccess\fR specifies the minimum visibility level of classes and members that the \f3-Xdoclint\fR option checks\&. It can have one of the following values (in order of most to least visible) : \f3public\fR, \f3protected\fR, \f3package\fR and \f3private\fR\&. For example, the following option checks classes and members (with all groups of checks) that have the access level protected and higher (which includes protected, package and public):
+-.sp
+-.nf
+-\f3\-Xdoclint:all/protected\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following option enables all groups of checks for all access levels, except it will not check for HTML errors for classes and members that have access level package and higher (which includes package and public):
+-.sp
+-.nf
+-\f3\-Xdoclint:all,\-html/package\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--Xdoclint:none
+-.br
+-Disables all groups of checks\&.
+-.TP
+--Xdoclint:all[\fI/access\fR]
+-.br
+-Enables all groups of checks\&.
+-.TP
+--Xlint
+-.br
+-\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
+-.TP
+--Xlint:all
+-.br
+-\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
+-.TP
+--Xlint:none
+-.br
+-Disables all warnings\&.
+-.TP
+--Xlint:\fIname\fR
+-.br
+-Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option for a list of warnings you can disable with this option\&.
+-.TP
+--Xlint:\fI-name\fR
+-.br
+-Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option with the \f3-Xlint\fR option to get a list of warnings that you can disable with this option\&.
+-.TP
+--Xmaxerrs \fInumber\fR
+-.br
+-Sets the maximum number of errors to print\&.
+-.TP
+--Xmaxwarns \fInumber\fR
+-.br
+-Sets the maximum number of warnings to print\&.
+-.TP
+--Xstdout \fIfilename\fR
+-.br
+-Sends compiler messages to the named file\&. By default, compiler messages go to \f3System\&.err\fR\&.
+-.TP
+--Xprefer:[\fInewer,source\fR]
+-.br
+-Specifies which file to read when both a source file and class file are found for a type\&. (See Searching for Types)\&. If the \f3-Xprefer:newer\fR option is used, then it reads the newer of the source or class file for a type (default)\&. If the \f3-Xprefer:source\fR option is used, then it reads the source file\&. Use -\f3Xprefer:source\fR when you want to be sure that any annotation processors can access annotations declared with a retention policy of \f3SOURCE\fR\&.
+-.TP
+--Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR]
+-.br
+-Control whether javac generates \f3package-info\&.class\fR files from package-info\&.java files\&. Possible mode arguments for this option include the following\&.
+-.RS
+-.TP
+-always
+-Always generate a \f3package-info\&.class\fR file for every \f3package-info\&.java\fR file\&. This option may be useful if you use a build system such as Ant, which checks that each \f3\&.java\fR file has a corresponding \f3\&.class\fR file\&.
+-.TP
+-legacy
+-Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations\&. Don\&'t generate a \f3package-info\&.class\fR file if package-info\&.java only contains comments\&.
+-
+-\fINote:\fR A \f3package-info\&.class\fR file might be generated but be empty if all the annotations in the package-info\&.java file have \f3RetentionPolicy\&.SOURCE\fR\&.
+-.TP
+-nonempty
+-Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations with \f3RetentionPolicy\&.CLASS\fR or \f3RetentionPolicy\&.RUNTIME\fR\&.
+-.RE
+-
+-.TP
+--Xprint
+-.br
+-Prints a textual representation of specified types for debugging purposes\&. Perform neither annotation processing nor compilation\&. The format of the output could change\&.
+-.TP
+--XprintProcessorInfo
+-.br
+-Prints information about which annotations a processor is asked to process\&.
+-.TP
+--XprintRounds
+-.br
+-Prints information about initial and subsequent annotation processing rounds\&.
+-.SH ENABLE\ OR\ DISABLE\ WARNINGS\ WITH\ THE\ -XLINT\ OPTION
+-Enable warning \fIname\fR with the \f3-Xlint:name\fR option, where \f3name\fR is one of the following warning names\&. Note that you can disable a warning with the \f3-Xlint:-name:\fR option\&.
+-.TP
+-cast
+-Warns about unnecessary and redundant casts, for example:
+-.sp
+-.nf
+-\f3String s = (String) "Hello!"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-classfile
+-Warns about issues related to class file contents\&.
+-.TP
+-deprecation
+-Warns about the use of deprecated items, for example:
+-.sp
+-.nf
+-\f3java\&.util\&.Date myDate = new java\&.util\&.Date();\fP
+-.fi
+-.nf
+-\f3int currentDay = myDate\&.getDay();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The method \f3java\&.util\&.Date\&.getDay\fR has been deprecated since JDK 1\&.1
+-.TP
+-dep-ann
+-Warns about items that are documented with an \f3@deprecated\fR Javadoc comment, but do not have a \f3@Deprecated\fR annotation, for example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @deprecated As of Java SE 7, replaced by {@link #newMethod()}\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public static void deprecatedMethood() { }\fP
+-.fi
+-.nf
+-\f3public static void newMethod() { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-divzero
+-Warns about division by the constant integer 0, for example:
+-.sp
+-.nf
+-\f3int divideByZero = 42 / 0;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-empty
+-Warns about empty statements after \f3if\fRstatements, for example:
+-.sp
+-.nf
+-\f3class E {\fP
+-.fi
+-.nf
+-\f3 void m() {\fP
+-.fi
+-.nf
+-\f3 if (true) ;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-fallthrough
+-Checks the switch blocks for fall-through cases and provides a warning message for any that are found\&. Fall-through cases are cases in a switch block, other than the last case in the block, whose code does not include a break statement, allowing code execution to fall through from that case to the next case\&. For example, the code following the case 1 label in this switch block does not end with a break statement:
+-.sp
+-.nf
+-\f3switch (x) {\fP
+-.fi
+-.nf
+-\f3case 1:\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("1");\fP
+-.fi
+-.nf
+-\f3 // No break statement here\&.\fP
+-.fi
+-.nf
+-\f3case 2:\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("2");\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the \f3-Xlint:fallthrough\fR option was used when compiling this code, then the compiler emits a warning about possible fall-through into case, with the line number of the case in question\&.
+-.TP
+-finally
+-Warns about \f3finally\fR clauses that cannot complete normally, for example:
+-.sp
+-.nf
+-\f3public static int m() {\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3 throw new NullPointerException();\fP
+-.fi
+-.nf
+-\f3 } catch (NullPointerException(); {\fP
+-.fi
+-.nf
+-\f3 System\&.err\&.println("Caught NullPointerException\&.");\fP
+-.fi
+-.nf
+-\f3 return 1;\fP
+-.fi
+-.nf
+-\f3 } finally {\fP
+-.fi
+-.nf
+-\f3 return 0;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates a warning for the \f3finally\fR block in this example\&. When the \f3int\fR method is called, it returns a value of 0\&. A \f3finally\fR block executes when the \f3try\fR block exits\&. In this example, when control is transferred to the \f3catch\fR block, the \f3int\fR method exits\&. However, the \f3finally\fR block must execute, so it is executed, even though control was transferred outside the method\&.
+-.TP
+-options
+-Warns about issues that related to the use of command-line options\&. See Cross-Compilation Options\&.
+-.TP
+-overrides
+-Warns about issues regarding method overrides\&. For example, consider the following two classes:
+-.sp
+-.nf
+-\f3public class ClassWithVarargsMethod {\fP
+-.fi
+-.nf
+-\f3 void varargsMethod(String\&.\&.\&. s) { }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class ClassWithOverridingMethod extends ClassWithVarargsMethod {\fP
+-.fi
+-.nf
+-\f3 @Override\fP
+-.fi
+-.nf
+-\f3 void varargsMethod(String[] s) { }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates a warning similar to the following:\&.
+-.sp
+-.nf
+-\f3warning: [override] varargsMethod(String[]) in ClassWithOverridingMethod \fP
+-.fi
+-.nf
+-\f3overrides varargsMethod(String\&.\&.\&.) in ClassWithVarargsMethod; overriding\fP
+-.fi
+-.nf
+-\f3method is missing \&'\&.\&.\&.\&'\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler encounters a \f3varargs\fR method, it translates the \f3varargs\fR formal parameter into an array\&. In the method \f3ClassWithVarargsMethod\&.varargsMethod\fR, the compiler translates the \f3varargs\fR formal parameter \f3String\&.\&.\&. s\fR to the formal parameter \f3String[] s\fR, an array, which matches the formal parameter of the method \f3ClassWithOverridingMethod\&.varargsMethod\fR\&. Consequently, this example compiles\&.
+-.TP
+-path
+-Warns about invalid path elements and nonexistent path directories on the command line (with regard to the class path, the source path, and other paths)\&. Such warnings cannot be suppressed with the \f3@SuppressWarnings\fR annotation, for example:
+-.sp
+-.nf
+-\f3javac \-Xlint:path \-classpath /nonexistentpath Example\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-processing
+-Warn about issues regarding annotation processing\&. The compiler generates this warning when you have a class that has an annotation, and you use an annotation processor that cannot handle that type of exception\&. For example, the following is a simple annotation processor:
+-
+-\fISource file AnnocProc\&.java\fR:
+-.sp
+-.nf
+-\f3import java\&.util\&.*;\fP
+-.fi
+-.nf
+-\f3import javax\&.annotation\&.processing\&.*;\fP
+-.fi
+-.nf
+-\f3import javax\&.lang\&.model\&.*;\fP
+-.fi
+-.nf
+-\f3import\&.javaz\&.lang\&.model\&.element\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@SupportedAnnotationTypes("NotAnno")\fP
+-.fi
+-.nf
+-\f3public class AnnoProc extends AbstractProcessor {\fP
+-.fi
+-.nf
+-\f3 public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv){\fP
+-.fi
+-.nf
+-\f3 return true;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public SourceVersion getSupportedSourceVersion() {\fP
+-.fi
+-.nf
+-\f3 return SourceVersion\&.latest();\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fISource file AnnosWithoutProcessors\&.java\fR:
+-.sp
+-.nf
+-\f3@interface Anno { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@Anno\fP
+-.fi
+-.nf
+-\f3class AnnosWithoutProcessors { }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following commands compile the annotation processor \f3AnnoProc\fR, then run this annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR:
+-.sp
+-.nf
+-\f3javac AnnoProc\&.java\fP
+-.fi
+-.nf
+-\f3javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutProcessors\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler runs the annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR, it generates the following warning:
+-.sp
+-.nf
+-\f3warning: [processing] No processor claimed any of these annotations: Anno\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To resolve this issue, you can rename the annotation defined and used in the class \f3AnnosWithoutProcessors\fR from \f3Anno\fR to \f3NotAnno\fR\&.
+-.TP
+-rawtypes
+-Warns about unchecked operations on raw types\&. The following statement generates a \f3rawtypes\fR warning:
+-.sp
+-.nf
+-\f3void countElements(List l) { \&.\&.\&. }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following example does not generate a \f3rawtypes\fR warning
+-.sp
+-.nf
+-\f3void countElements(List<?> l) { \&.\&.\&. }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\f3List\fR is a raw type\&. However, \f3List<?>\fR is an unbounded wildcard parameterized type\&. Because \f3List\fR is a parameterized interface, always specify its type argument\&. In this example, the \f3List\fR formal argument is specified with an unbounded wildcard (\f3?\fR) as its formal type parameter, which means that the \f3countElements\fR method can accept any instantiation of the \f3List\fR interface\&.
+-.TP
+-Serial
+-Warns about missing \f3serialVersionUID\fR definitions on serializable classes, for example:
+-.sp
+-.nf
+-\f3public class PersistentTime implements Serializable\fP
+-.fi
+-.nf
+-\f3{\fP
+-.fi
+-.nf
+-\f3 private Date time;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public PersistentTime() {\fP
+-.fi
+-.nf
+-\f3 time = Calendar\&.getInstance()\&.getTime();\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public Date getTime() {\fP
+-.fi
+-.nf
+-\f3 return time;\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates the following warning:
+-.sp
+-.nf
+-\f3warning: [serial] serializable class PersistentTime has no definition of\fP
+-.fi
+-.nf
+-\f3serialVersionUID\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If a serializable class does not explicitly declare a field named \f3serialVersionUID\fR, then the serialization runtime environment calculates a default \f3serialVersionUID\fR value for that class based on various aspects of the class, as described in the Java Object Serialization Specification\&. However, it is strongly recommended that all serializable classes explicitly declare \f3serialVersionUID\fR values because the default process of computing \f3serialVersionUID\fR vales is highly sensitive to class details that can vary depending on compiler implementations, and as a result, might cause an unexpected \f3InvalidClassExceptions\fR during deserialization\&. To guarantee a consistent \f3serialVersionUID\fR value across different Java compiler implementations, a serializable class must declare an explicit \f3serialVersionUID\fR value\&.
+-.TP
+-static
+-Warns about issues relating to the use of statics, for example:
+-.sp
+-.nf
+-\f3class XLintStatic {\fP
+-.fi
+-.nf
+-\f3 static void m1() { }\fP
+-.fi
+-.nf
+-\f3 void m2() { this\&.m1(); }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The compiler generates the following warning:
+-.sp
+-.nf
+-\f3warning: [static] static method should be qualified by type name, \fP
+-.fi
+-.nf
+-\f3XLintStatic, instead of by an expression\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To resolve this issue, you can call the \f3static\fR method \f3m1\fR as follows:
+-.sp
+-.nf
+-\f3XLintStatic\&.m1();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Alternately, you can remove the \f3static\fR keyword from the declaration of the method \f3m1\fR\&.
+-.TP
+-try
+-Warns about issues relating to use of \f3try\fR blocks, including try-with-resources statements\&. For example, a warning is generated for the following statement because the resource \f3ac\fR declared in the \f3try\fR block is not used:
+-.sp
+-.nf
+-\f3try ( AutoCloseable ac = getResource() ) { // do nothing}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-unchecked
+-Gives more detail for unchecked conversion warnings that are mandated by the Java Language Specification, for example:
+-.sp
+-.nf
+-\f3List l = new ArrayList<Number>();\fP
+-.fi
+-.nf
+-\f3List<String> ls = l; // unchecked warning\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-During type erasure, the types \f3ArrayList<Number>\fR and \f3List<String>\fR become \f3ArrayList\fR and \f3List\fR, respectively\&.
+-
+-The \f3ls\fR command has the parameterized type \f3List<String>\fR\&. When the \f3List\fR referenced by \f3l\fR is assigned to \f3ls\fR, the compiler generates an unchecked warning\&. At compile time, the compiler and JVM cannot determine whether \f3l\fR refers to a \f3List<String>\fR type\&. In this case, \f3l\fR does not refer to a \f3List<String>\fR type\&. As a result, heap pollution occurs\&.
+-
+-A heap pollution situation occurs when the \f3List\fR object \f3l\fR, whose static type is \f3List<Number>\fR, is assigned to another \f3List\fR object, \f3ls\fR, that has a different static type, \f3List<String>\fR\&. However, the compiler still allows this assignment\&. It must allow this assignment to preserve backward compatibility with releases of Java SE that do not support generics\&. Because of type erasure, \f3List<Number>\fR and \f3List<String>\fR both become \f3List\fR\&. Consequently, the compiler allows the assignment of the object \f3l\fR\f3,\fR which has a raw type of \f3List\fR, to the object \f3ls\fR\&.
+-.TP
+-varargs
+-Warns about unsafe usages of variable arguments (\f3varargs\fR) methods, in particular, those that contain non-reifiable arguments, for example:
+-.sp
+-.nf
+-\f3public class ArrayBuilder {\fP
+-.fi
+-.nf
+-\f3 public static <T> void addToList (List<T> listArg, T\&.\&.\&. elements) {\fP
+-.fi
+-.nf
+-\f3 for (T x : elements) {\fP
+-.fi
+-.nf
+-\f3 listArg\&.add(x);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR A non-reifiable type is a type whose type information is not fully available at runtime\&.
+-
+-The compiler generates the following warning for the definition of the method \f3ArrayBuilder\&.addToList\fR
+-.sp
+-.nf
+-\f3warning: [varargs] Possible heap pollution from parameterized vararg type T\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the compiler encounters a varargs method, it translates the \f3varargs\fR formal parameter into an array\&. However, the Java programming language does not permit the creation of arrays of parameterized types\&. In the method \f3ArrayBuilder\&.addToList\fR, the compiler translates the \f3varargs\fR formal parameter \f3T\&.\&.\&.\fR elements to the formal parameter \f3T[]\fR elements, an array\&. However, because of type erasure, the compiler converts the \f3varargs\fR formal parameter to \f3Object[]\fR elements\&. Consequently, there is a possibility of heap pollution\&.
+-.SH COMMAND-LINE\ ARGUMENT\ FILES
+-To shorten or simplify the \f3javac\fR command, you can specify one or more files that contain arguments to the \f3javac\fR command (except \f3-J\fR options)\&. This enables you to create \f3javac\fR commands of any length on any operating system\&.
+-.PP
+-An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be separated by spaces or new line characters\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
+-.PP
+-File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (*) are not allowed in these lists (such as for specifying \f3*\&.java\fR)\&. Use of the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
+-.PP
+-When executing the \f3javac\fR command, pass in the path and name of each argument file with the at sign (@) leading character\&. When the \f3javac\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
+-.PP
+-\f3Example 1 Single Argument File\fR
+-.PP
+-You could use a single argument file named \f3argfile\fR to hold all \f3javac\fR arguments:
+-.sp
+-.nf
+-\f3javac @argfile\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This argument file could contain the contents of both files shown in Example 2
+-.PP
+-\f3Example 2 Two Argument Files\fR
+-.PP
+-You can create two argument files: one for the \f3javac\fR options and the other for the source file names\&. Note that the following lists have no line-continuation characters\&.
+-.PP
+-Create a file named options that contains the following:
+-.sp
+-.nf
+-\f3\-d classes\fP
+-.fi
+-.nf
+-\f3\-g\fP
+-.fi
+-.nf
+-\f3\-sourcepath /java/pubs/ws/1\&.3/src/share/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Create a file named classes that contains the following:
+-.sp
+-.nf
+-\f3MyClass1\&.java\fP
+-.fi
+-.nf
+-\f3MyClass2\&.java\fP
+-.fi
+-.nf
+-\f3MyClass3\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Then, run the \f3javac\fR command as follows:
+-.sp
+-.nf
+-\f3javac @options @classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Argument Files with Paths\fR
+-.PP
+-The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
+-.sp
+-.nf
+-\f3javac @path1/options @path2/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH ANNOTATION\ PROCESSING
+-The \f3javac\fR command provides direct support for annotation processing, superseding the need for the separate annotation processing command, \f3apt\fR\&.
+-.PP
+-The API for annotation processors is defined in the \f3javax\&.annotation\&.processing\fR and j\f3avax\&.lang\&.model\fR packages and subpackages\&.
+-.SS HOW\ ANNOTATION\ PROCESSING\ WORKS
+-Unless annotation processing is disabled with the \f3-proc:none\fR option, the compiler searches for any annotation processors that are available\&. The search path can be specified with the \f3-processorpath\fR option\&. If no path is specified, then the user class path is used\&. Processors are located by means of service provider-configuration files named \f3META-INF/services/javax\&.annotation\&.processing\fR\&.Processor on the search path\&. Such files should contain the names of any annotation processors to be used, listed one per line\&. Alternatively, processors can be specified explicitly, using the \f3-processor\fR option\&.
+-.PP
+-After scanning the source files and classes on the command line to determine what annotations are present, the compiler queries the processors to determine what annotations they process\&. When a match is found, the processor is called\&. A processor can claim the annotations it processes, in which case no further attempt is made to find any processors for those annotations\&. After all of the annotations are claimed, the compiler does not search for additional processors\&.
+-.PP
+-If any processors generate new source files, then another round of annotation processing occurs: Any newly generated source files are scanned, and the annotations processed as before\&. Any processors called on previous rounds are also called on all subsequent rounds\&. This continues until no new source files are generated\&.
+-.PP
+-After a round occurs where no new source files are generated, the annotation processors are called one last time, to give them a chance to complete any remaining work\&. Finally, unless the \f3-proc:only\fR option is used, the compiler compiles the original and all generated source files\&.
+-.SS IMPLICITLY\ LOADED\ SOURCE\ FILES
+-To compile a set of source files, the compiler might need to implicitly load additional source files\&. See Searching for Types\&. Such files are currently not subject to annotation processing\&. By default, the compiler gives a warning when annotation processing occurred and any implicitly loaded source files are compiled\&. The \f3-implicit\fR option provides a way to suppress the warning\&.
+-.SH SEARCHING\ FOR\ TYPES
+-To compile a source file, the compiler often needs information about a type, but the type definition is not in the source files specified on the command line\&. The compiler needs type information for every class or interface used, extended, or implemented in the source file\&. This includes classes and interfaces not explicitly mentioned in the source file, but that provide information through inheritance\&.
+-.PP
+-For example, when you create a subclass \f3java\&.applet\&.Applet\fR, you are also using the ancestor classes of \f3Applet\fR: \f3java\&.awt\&.Panel\fR, \f3java\&.awt\&.Container\fR, \f3java\&.awt\&.Component\fR, and \f3java\&.lang\&.Object\fR\&.
+-.PP
+-When the compiler needs type information, it searches for a source file or class file that defines the type\&. The compiler searches for class files first in the bootstrap and extension classes, then in the user class path (which by default is the current directory)\&. The user class path is defined by setting the \f3CLASSPATH\fR environment variable or by using the \f3-classpath\fR option\&.
+-.PP
+-If you set the \f3-sourcepath\fR option, then the compiler searches the indicated path for source files\&. Otherwise, the compiler searches the user class path for both class files and source files\&.
+-.PP
+-You can specify different bootstrap or extension classes with the \f3-bootclasspath\fR and the \f3-extdirs\fR options\&. See Cross-Compilation Options\&.
+-.PP
+-A successful type search may produce a class file, a source file, or both\&. If both are found, then you can use the \f3-Xprefer\fR option to instruct the compiler which to use\&. If \f3newer\fR is specified, then the compiler uses the newer of the two files\&. If \f3source\fR is specified, the compiler uses the source file\&. The default is \f3newer\fR\&.
+-.PP
+-If a type search finds a source file for a required type, either by itself, or as a result of the setting for the \f3-Xprefer\fR option, then the compiler reads the source file to get the information it needs\&. By default the compiler also compiles the source file\&. You can use the \f3-implicit\fR option to specify the behavior\&. If \f3none\fR is specified, then no class files are generated for the source file\&. If \f3class\fR is specified, then class files are generated for the source file\&.
+-.PP
+-The compiler might not discover the need for some type information until after annotation processing completes\&. When the type information is found in a source file and no \f3-implicit\fR option is specified, the compiler gives a warning that the file is being compiled without being subject to annotation processing\&. To disable the warning, either specify the file on the command line (so that it will be subject to annotation processing) or use the \f3-implicit\fR option to specify whether or not class files should be generated for such source files\&.
+-.SH PROGRAMMATIC\ INTERFACE
+-The \f3javac\fR command supports the new Java Compiler API defined by the classes and interfaces in the \f3javax\&.tools\fR package\&.
+-.SS EXAMPLE
+-To compile as though providing command-line arguments, use the following syntax:
+-.sp
+-.nf
+-\f3JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler();\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The example writes diagnostics to the standard output stream and returns the exit code that \f3javac\fR would give when called from the command line\&.
+-.PP
+-You can use other methods in the \f3javax\&.tools\&.JavaCompiler\fR interface to handle diagnostics, control where files are read from and written to, and more\&.
+-.SS OLD\ INTERFACE
+-\fINote:\fR This API is retained for backward compatibility only\&. All new code should use the newer Java Compiler API\&.
+-.PP
+-The \f3com\&.sun\&.tools\&.javac\&.Main\fR class provides two static methods to call the compiler from a program:
+-.sp
+-.nf
+-\f3public static int compile(String[] args);\fP
+-.fi
+-.nf
+-\f3public static int compile(String[] args, PrintWriter out);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3args\fR parameter represents any of the command-line arguments that would typically be passed to the compiler\&.
+-.PP
+-The \f3out\fR parameter indicates where the compiler diagnostic output is directed\&.
+-.PP
+-The \f3return\fR value is equivalent to the \f3exit\fR value from \f3javac\fR\&.
+-.PP
+-\fINote:\fR All other classes and methods found in a package with names that start with \f3com\&.sun\&.tools\&.javac\fR (subpackages of \f3com\&.sun\&.tools\&.javac\fR) are strictly internal and subject to change at any time\&.
+-.SH EXAMPLES
+-\f3Example 1 Compile a Simple Program\fR
+-.PP
+-This example shows how to compile the \f3Hello\&.java\fR source file in the greetings directory\&. The class defined in \f3Hello\&.java\fR is called \f3greetings\&.Hello\fR\&. The greetings directory is the package directory both for the source file and the class file and is underneath the current directory\&. This makes it possible to use the default user class path\&. It also makes it unnecessary to specify a separate destination directory with the \f3-d\fR option\&.
+-.PP
+-The source code in \f3Hello\&.java\fR:
+-.sp
+-.nf
+-\f3package greetings;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class Hello {\fP
+-.fi
+-.nf
+-\f3 public static void main(String[] args) {\fP
+-.fi
+-.nf
+-\f3 for (int i=0; i < args\&.length; i++) {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Hello " + args[i]);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Compile greetings\&.Hello:
+-.sp
+-.nf
+-\f3javac greetings/Hello\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run \f3greetings\&.Hello\fR:
+-.sp
+-.nf
+-\f3java greetings\&.Hello World Universe Everyone\fP
+-.fi
+-.nf
+-\f3Hello World\fP
+-.fi
+-.nf
+-\f3Hello Universe\fP
+-.fi
+-.nf
+-\f3Hello Everyone\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Compile Multiple Source Files\fR
+-.PP
+-This example compiles the \f3Aloha\&.java\fR, \f3GutenTag\&.java\fR, \f3Hello\&.java\fR, and \f3Hi\&.java\fR source files in the \f3greetings\fR package\&.
+-.sp
+-.nf
+-\f3% javac greetings/*\&.java\fP
+-.fi
+-.nf
+-\f3% ls greetings\fP
+-.fi
+-.nf
+-\f3Aloha\&.class GutenTag\&.class Hello\&.class Hi\&.class\fP
+-.fi
+-.nf
+-\f3Aloha\&.java GutenTag\&.java Hello\&.java Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Specify a User Class Path\fR
+-.PP
+-After changing one of the source files in the previous example, recompile it:
+-.sp
+-.nf
+-\f3pwd\fP
+-.fi
+-.nf
+-\f3/examples\fP
+-.fi
+-.nf
+-\f3javac greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Because \f3greetings\&.Hi\fR refers to other classes in the \f3greetings\fR package, the compiler needs to find these other classes\&. The previous example works because the default user class path is the directory that contains the package directory\&. If you want to recompile this file without concern for which directory you are in, then add the examples directory to the user class path by setting \f3CLASSPATH\fR\&. This example uses the \f3-classpath\fR option\&.
+-.sp
+-.nf
+-\f3javac \-classpath /examples /examples/greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you change \f3greetings\&.Hi\fR to use a banner utility, then that utility also needs to be accessible through the user class path\&.
+-.sp
+-.nf
+-\f3javac \-classpath /examples:/lib/Banners\&.jar \e\fP
+-.fi
+-.nf
+-\f3 /examples/greetings/Hi\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To execute a class in the \f3greetings\fR package, the program needs access to the \f3greetings\fR package, and to the classes that the \f3greetings\fR classes use\&.
+-.sp
+-.nf
+-\f3java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Separate Source Files and Class Files\fR
+-.PP
+-The following example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e \fP
+-.fi
+-.nf
+-\f3\-extdirs "" OldCode\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language be used to compile \f3OldCode\&.java\fR\&. The option \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&. Note that in most cases, the value of the \f3-target\fR option is the value of the \f3-source\fR option; in this example, you can omit the \f3-target\fR option\&.
+-.PP
+-You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 OldCode\&.java\fP
+-.fi
+-.nf
+-\f3warning: [options] bootstrap class path not set in conjunction with \fP
+-.fi
+-.nf
+-\f3\-source 1\&.7\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules (in this example, it uses version 1\&.7 of the Java programming language) combined with the new bootstrap classes, which can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&.
+-.PP
+-\f3Example 5 Cross Compile\fR
+-.PP
+-This example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e\fP
+-.fi
+-.nf
+-\f3 \-extdirs "" OldCode\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The\f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language to be used to compile OldCode\&.java\&. The \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&.
+-.PP
+-You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
+-.sp
+-.nf
+-\f3javac \-source 1\&.7 OldCode\&.java\fP
+-.fi
+-.nf
+-\f3warning: [options] bootstrap class path not set in conjunction with \-source 1\&.7\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules combined with the new bootstrap classes\&. This combination can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&. In this example, the compiler uses release 1\&.7 of the Java programming language\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javadoc(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
++
++.SH NAME
++javac \- Reads Java class and interface definitions and compiles them into bytecode and class files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavac\fR [ \fIoptions\fR ] [ \fIsourcefiles\fR ] [ \fIclasses\fR] [ \fI@argfiles\fR ]
++.fi
++.sp
++Arguments can be in any order:
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIsourcefiles\fR
++One or more source files to be compiled (such as \f3MyClass\&.java\fR)\&.
++.TP
++\fIclasses\fR
++One or more classes to be processed for annotations (such as \f3MyPackage\&.MyClass\fR)\&.
++.TP
++\fI@argfiles\fR
++One or more files that list options and source files\&. The \f3-J\fR options are not allowed in these files\&. See Command-Line Argument Files\&.
++.SH DESCRIPTION
++The \f3javac\fR command reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files\&. The \f3javac\fR command can also process annotations in Java source files and classes\&.
++.PP
++There are two ways to pass source code file names to \f3javac\fR\&.
++.TP 0.2i
++\(bu
++For a small number of source files, list the file names on the command line\&.
++.TP 0.2i
++\(bu
++For a large number of source files, list the file names in a file that is separated by blanks or line breaks\&. Use the list file name preceded by an at sign (@) with the \f3javac\fR command\&.
++.PP
++Source code file names must have \&.java suffixes, class file names must have \&.class suffixes, and both source and class files must have root names that identify the class\&. For example, a class called \f3MyClass\fR would be written in a source file called \f3MyClass\&.java\fR and compiled into a bytecode class file called \f3MyClass\&.class\fR\&.
++.PP
++Inner class definitions produce additional class files\&. These class files have names that combine the inner and outer class names, such as \f3MyClass$MyInnerClass\&.class\fR\&.
++.PP
++Arrange source files in a directory tree that reflects their package tree\&. For example, if all of your source files are in \f3/workspace\fR, then put the source code for \f3com\&.mysoft\&.mypack\&.MyClass\fR in \f3/workspace/com/mysoft/mypack/MyClass\&.java\fR\&.
++.PP
++By default, the compiler puts each class file in the same directory as its source file\&. You can specify a separate destination directory with the \f3-d\fR option\&.
++.SH OPTIONS
++The compiler has a set of standard options that are supported on the current development environment\&. An additional set of nonstandard options are specific to the current virtual machine and compiler implementations and are subject to change in the future\&. Nonstandard options begin with the \f3-X\fR option\&.
++.TP 0.2i
++\(bu
++See also Cross-Compilation Options
++.TP 0.2i
++\(bu
++See also Nonstandard Options
++.SS STANDARD\ OPTIONS
++.TP
++-A\fIkey\fR[\fI=value\fR]
++.br
++Specifies options to pass to annotation processors\&. These options are not interpreted by \f3javac\fR directly, but are made available for use by individual processors\&. The \f3key\fR value should be one or more identifiers separated by a dot (\&.)\&.
++.TP
++-cp \fIpath\fR or -classpath \fIpath\fR
++.br
++Specifies where to find user class files, and (optionally) annotation processors and source files\&. This class path overrides the user class path in the \f3CLASSPATH\fR environment variable\&. If neither \f3CLASSPATH\fR, \f3-cp\fR nor \f3-classpath\fR is specified, then the user \fIclass path\fR is the current directory\&. See Setting the Class Path\&.
++
++If the \f3-sourcepath\fR option is not specified, then the user class path is also searched for source files\&.
++
++If the \f3-processorpath\fR option is not specified, then the class path is also searched for annotation processors\&.
++.TP
++-Djava\&.ext\&.dirs=\fIdirectories\fR
++.br
++Overrides the location of installed extensions\&.
++.TP
++-Djava\&.endorsed\&.dirs=\fIdirectories\fR
++.br
++Overrides the location of the endorsed standards path\&.
++.TP
++-d \fIdirectory\fR
++.br
++Sets the destination directory for class files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then \f3javac\fR puts the class file in a subdirectory that reflects the package name and creates directories as needed\&.
++
++If you specify \f3-d\fR\f3/home/myclasses\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the class file is \f3/home/myclasses/com/mypackage/MyClass\&.class\fR\&.
++
++If the \fI-d\fR option is not specified, then \f3javac\fR puts each class file in the same directory as the source file from which it was generated\&.
++
++\fINote:\fR The directory specified by the \fI-d\fR option is not automatically added to your user class path\&.
++.TP
++-deprecation
++.br
++Shows a description of each use or override of a deprecated member or class\&. Without the \f3-deprecation\fR option, \f3javac\fR shows a summary of the source files that use or override deprecated members or classes\&. The \f3-deprecation\fR option is shorthand for \f3-Xlint:deprecation\fR\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Sets the source file encoding name, such as EUC-JP and UTF-8\&. If the \f3-encoding\fR option is not specified, then the platform default converter is used\&.
++.TP
++-endorseddirs \fIdirectories\fR
++.br
++Overrides the location of the endorsed standards path\&.
++.TP
++-extdirs \fIdirectories\fR
++.br
++Overrides the location of the \f3ext\fR directory\&. The directories variable is a colon-separated list of directories\&. Each JAR file in the specified directories is searched for class files\&. All JAR files found become part of the class path\&.
++
++If you are cross-compiling (compiling classes against bootstrap and extension classes of a different Java platform implementation), then this option specifies the directories that contain the extension classes\&. See Cross-Compilation Options for more information\&.
++.TP
++-g
++.br
++Generates all debugging information, including local variables\&. By default, only line number and source file information is generated\&.
++.TP
++-g:none
++.br
++Does not generate any debugging information\&.
++.TP
++-g:[\fIkeyword list\fR]
++.br
++Generates only some kinds of debugging information, specified by a comma separated list of keywords\&. Valid keywords are:
++.RS
++.TP
++source
++Source file debugging information\&.
++.TP
++lines
++Line number debugging information\&.
++.TP
++vars
++Local variable debugging information\&.
++.RE
++
++.TP
++-help
++.br
++Prints a synopsis of standard options\&.
++.TP
++-implicit:[\fIclass, none\fR]
++.br
++Controls the generation of class files for implicitly loaded source files\&. To automatically generate class files, use \f3-implicit:class\fR\&. To suppress class file generation, use \f3-implicit:none\fR\&. If this option is not specified, then the default is to automatically generate class files\&. In this case, the compiler issues a warning if any such class files are generated when also doing annotation processing\&. The warning is not issued when the \f3-implicit\fR option is set explicitly\&. See Searching for Types\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++
++\fINote:\fR The \fICLASSPATH\fR, \f3-classpath\fR, \f3-bootclasspath\fR, and \f3-extdirs\fR options do not specify the classes used to run \f3javac\fR\&. Trying to customize the compiler implementation with these options and variables is risky and often does not accomplish what you want\&. If you must customize the complier implementation, then use the \f3-J\fR option to pass options through to the underlying \f3\fRJava launcher\&.
++.TP
++-nowarn
++.br
++Disables warning messages\&. This option operates the same as the \f3-Xlint:none\fR option\&.
++.TP
++-parameters
++.br
++Stores formal parameter names of constructors and methods in the generated class file so that the method \f3java\&.lang\&.reflect\&.Executable\&.getParameters\fR from the Reflection API can retrieve them\&.
++.TP
++-proc: [\fInone\fR, \fIonly\fR]
++.br
++Controls whether annotation processing and compilation are done\&. \f3-proc:none\fR means that compilation takes place without annotation processing\&. \f3-proc:only\fR means that only annotation processing is done, without any subsequent compilation\&.
++.TP
++-processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.]
++.br
++Names of the annotation processors to run\&. This bypasses the default discovery process\&.
++.TP
++-processorpath \fIpath\fR
++.br
++Specifies where to find annotation processors\&. If this option is not used, then the class path is searched for processors\&.
++.TP
++-s \fIdir\fR
++.br
++Specifies the directory where to place the generated source files\&. The directory must already exist because \f3javac\fR does not create it\&. If a class is part of a package, then the compiler puts the source file in a subdirectory that reflects the package name and creates directories as needed\&.
++
++If you specify \f3-s /home/mysrc\fR and the class is called \f3com\&.mypackage\&.MyClass\fR, then the source file is put in \f3/home/mysrc/com/mypackage/MyClass\&.java\fR\&.
++.TP
++-source \fIrelease\fR
++.br
++Specifies the version of source code accepted\&. The following values for \f3release\fR are allowed:
++.RS
++.TP
++1\&.3
++The compiler does not support assertions, generics, or other language features introduced after Java SE 1\&.3\&.
++.TP
++1\&.4
++The compiler accepts code containing assertions, which were introduced in Java SE 1\&.4\&.
++.TP
++1\&.5
++The compiler accepts code containing generics and other language features introduced in Java SE 5\&.
++.TP
++5
++Synonym for 1\&.5\&.
++.TP
++1\&.6
++No language changes were introduced in Java SE 6\&. However, encoding errors in source files are now reported as errors instead of warnings as in earlier releases of Java Platform, Standard Edition\&.
++.TP
++6
++Synonym for 1\&.6\&.
++.TP
++1\&.7
++The compiler accepts code with features introduced in Java SE 7\&.
++.TP
++7
++Synonym for 1\&.7\&.
++.TP
++1\&.8
++This is the default value\&. The compiler accepts code with features introduced in Java SE 8\&.
++.TP
++8
++Synonym for 1\&.8\&.
++.RE
++
++.TP
++-sourcepath \fIsourcepath\fR
++.br
++Specifies the source code path to search for class or interface definitions\&. As with the user class path, source path entries are separated by colons (:) on Oracle Solaris and semicolons on Windows and can be directories, JAR archives, or ZIP archives\&. If packages are used, then the local path name within the directory or archive must reflect the package name\&.
++
++\fINote:\fR Classes found through the class path might be recompiled when their source files are also found\&. See Searching for Types\&.
++.TP
++-verbose
++.br
++Uses verbose output, which includes information about each class loaded and each source file compiled\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-werror
++.br
++Terminates compilation when warnings occur\&.
++.TP
++-X
++.br
++Displays information about nonstandard options and exits\&.
++.SS CROSS-COMPILATION\ OPTIONS
++By default, classes are compiled against the bootstrap and extension classes of the platform that \f3javac\fR shipped with\&. But \f3javac\fR also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation\&. It is important to use the \f3-bootclasspath\fR and \f3-extdirs\fR options when cross-compiling\&.
++.TP
++-target \fIversion\fR
++.br
++Generates class files that target a specified release of the virtual machine\&. Class files will run on the specified target and on later releases, but not on earlier releases of the JVM\&. Valid targets are 1\&.1, 1\&.2, 1\&.3, 1\&.4, 1\&.5 (also 5), 1\&.6 (also 6), 1\&.7 (also 7), and 1\&.8 (also 8)\&.
++
++The default for the \f3-target\fR option depends on the value of the \f3-source\fR option:
++.RS
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is not specified, then the value of the \f3-target\fR option is 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.2, then the value of the \f3-target\fR option is 1\&.4
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.3, then the value of the \f3-target\fR option is 1\&.4
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.5, then the value of the \f3-target\fR option is 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.6, then the value of the \f3-target\fR is option 1\&.8
++.TP 0.2i
++\(bu
++If the \f3-source\fR option is 1\&.7, then the value of the \f3-target\fR is option 1\&.8
++.TP 0.2i
++\(bu
++For all other values of the \f3-source\fR option, the value of the \f3-target\fR option is the value of the \f3-source\fR option\&.
++.RE
++
++.TP
++-bootclasspath \fIbootclasspath\fR
++.br
++Cross-compiles against the specified set of boot classes\&. As with the user class path, boot class path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives\&.
++.SS COMPACT\ PROFILE\ OPTION
++Beginning with JDK 8, the \f3javac\fR compiler supports compact profiles\&. With compact profiles, applications that do not require the entire Java platform can be deployed and run with a smaller footprint\&. The compact profiles feature could be used to shorten the download time for applications from app stores\&. This feature makes for more compact deployment of Java applications that bundle the JRE\&. This feature is also useful in small devices\&.
++.PP
++The supported profile values are \f3compact1\fR, \f3compact2\fR, and \f3compact3\fR\&. These are additive layers\&. Each higher-numbered compact profile contains all of the APIs in profiles with smaller number names\&.
++.TP
++-profile
++.br
++When using compact profiles, this option specifies the profile name when compiling\&. For example:
++.sp
++.nf
++\f3javac \-profile compact1 Hello\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++javac does not compile source code that uses any Java SE APIs that is not in the specified profile\&. Here is an example of the error message that results from attempting to compile such source code:
++.sp
++.nf
++\f3cd jdk1\&.8\&.0/bin\fP
++.fi
++.nf
++\f3\&./javac \-profile compact1 Paint\&.java\fP
++.fi
++.nf
++\f3Paint\&.java:5: error: Applet is not available in profile \&'compact1\&'\fP
++.fi
++.nf
++\f3import java\&.applet\&.Applet;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++In this example, you can correct the error by modifying the source to not use the \f3Applet\fR class\&. You could also correct the error by compiling without the -profile option\&. Then the compilation would be run against the full set of Java SE APIs\&. (None of the compact profiles include the \f3Applet\fR class\&.)
++
++An alternative way to compile with compact profiles is to use the \f3-bootclasspath\fR option to specify a path to an \f3rt\&.jar\fR file that specifies a profile\&'s image\&. Using the \f3-profile\fR option instead does not require a profile image to be present on the system at compile time\&. This is useful when cross-compiling\&.
++.SS NONSTANDARD\ OPTIONS
++.TP
++-Xbootclasspath/p:\fIpath\fR
++.br
++Adds a suffix to the bootstrap class path\&.
++.TP
++-Xbootclasspath/a:\fIpath\fR
++.br
++Adds a prefix to the bootstrap class path\&.
++.TP
++-Xbootclasspath/:\fIpath\fR
++.br
++Overrides the location of the bootstrap class files\&.
++.TP
++-Xdoclint:[-]\fIgroup\fR [\fI/access\fR]
++.br
++Enables or disables specific groups of checks, where \fIgroup\fR is one of the following values: \f3accessibility\fR, \f3syntax\fR, \f3reference\fR, \f3html\fR or \f3missing\fR\&. For more information about these groups of checks see the \f3-Xdoclint\fR option of the \f3javadoc\fR command\&. The \f3-Xdoclint\fR option is disabled by default in the \f3javac\fR command\&.
++
++The variable \fIaccess\fR specifies the minimum visibility level of classes and members that the \f3-Xdoclint\fR option checks\&. It can have one of the following values (in order of most to least visible) : \f3public\fR, \f3protected\fR, \f3package\fR and \f3private\fR\&. For example, the following option checks classes and members (with all groups of checks) that have the access level protected and higher (which includes protected, package and public):
++.sp
++.nf
++\f3\-Xdoclint:all/protected\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following option enables all groups of checks for all access levels, except it will not check for HTML errors for classes and members that have access level package and higher (which includes package and public):
++.sp
++.nf
++\f3\-Xdoclint:all,\-html/package\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-Xdoclint:none
++.br
++Disables all groups of checks\&.
++.TP
++-Xdoclint:all[\fI/access\fR]
++.br
++Enables all groups of checks\&.
++.TP
++-Xlint
++.br
++\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
++.TP
++-Xlint:all
++.br
++\fI\fREnables all recommended warnings\&. In this release, enabling all available warnings is recommended\&.
++.TP
++-Xlint:none
++.br
++Disables all warnings\&.
++.TP
++-Xlint:\fIname\fR
++.br
++Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option for a list of warnings you can disable with this option\&.
++.TP
++-Xlint:\fI-name\fR
++.br
++Disables warning name\&. See Enable or Disable Warnings with the -Xlint Option with the \f3-Xlint\fR option to get a list of warnings that you can disable with this option\&.
++.TP
++-Xmaxerrs \fInumber\fR
++.br
++Sets the maximum number of errors to print\&.
++.TP
++-Xmaxwarns \fInumber\fR
++.br
++Sets the maximum number of warnings to print\&.
++.TP
++-Xstdout \fIfilename\fR
++.br
++Sends compiler messages to the named file\&. By default, compiler messages go to \f3System\&.err\fR\&.
++.TP
++-Xprefer:[\fInewer,source\fR]
++.br
++Specifies which file to read when both a source file and class file are found for a type\&. (See Searching for Types)\&. If the \f3-Xprefer:newer\fR option is used, then it reads the newer of the source or class file for a type (default)\&. If the \f3-Xprefer:source\fR option is used, then it reads the source file\&. Use -\f3Xprefer:source\fR when you want to be sure that any annotation processors can access annotations declared with a retention policy of \f3SOURCE\fR\&.
++.TP
++-Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR]
++.br
++Control whether javac generates \f3package-info\&.class\fR files from package-info\&.java files\&. Possible mode arguments for this option include the following\&.
++.RS
++.TP
++always
++Always generate a \f3package-info\&.class\fR file for every \f3package-info\&.java\fR file\&. This option may be useful if you use a build system such as Ant, which checks that each \f3\&.java\fR file has a corresponding \f3\&.class\fR file\&.
++.TP
++legacy
++Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations\&. Don\&'t generate a \f3package-info\&.class\fR file if package-info\&.java only contains comments\&.
++
++\fINote:\fR A \f3package-info\&.class\fR file might be generated but be empty if all the annotations in the package-info\&.java file have \f3RetentionPolicy\&.SOURCE\fR\&.
++.TP
++nonempty
++Generate a \f3package-info\&.class\fR file only if package-info\&.java contains annotations with \f3RetentionPolicy\&.CLASS\fR or \f3RetentionPolicy\&.RUNTIME\fR\&.
++.RE
++
++.TP
++-Xprint
++.br
++Prints a textual representation of specified types for debugging purposes\&. Perform neither annotation processing nor compilation\&. The format of the output could change\&.
++.TP
++-XprintProcessorInfo
++.br
++Prints information about which annotations a processor is asked to process\&.
++.TP
++-XprintRounds
++.br
++Prints information about initial and subsequent annotation processing rounds\&.
++.SH ENABLE\ OR\ DISABLE\ WARNINGS\ WITH\ THE\ -XLINT\ OPTION
++Enable warning \fIname\fR with the \f3-Xlint:name\fR option, where \f3name\fR is one of the following warning names\&. Note that you can disable a warning with the \f3-Xlint:-name:\fR option\&.
++.TP
++cast
++Warns about unnecessary and redundant casts, for example:
++.sp
++.nf
++\f3String s = (String) "Hello!"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++classfile
++Warns about issues related to class file contents\&.
++.TP
++deprecation
++Warns about the use of deprecated items, for example:
++.sp
++.nf
++\f3java\&.util\&.Date myDate = new java\&.util\&.Date();\fP
++.fi
++.nf
++\f3int currentDay = myDate\&.getDay();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The method \f3java\&.util\&.Date\&.getDay\fR has been deprecated since JDK 1\&.1
++.TP
++dep-ann
++Warns about items that are documented with an \f3@deprecated\fR Javadoc comment, but do not have a \f3@Deprecated\fR annotation, for example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @deprecated As of Java SE 7, replaced by {@link #newMethod()}\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public static void deprecatedMethood() { }\fP
++.fi
++.nf
++\f3public static void newMethod() { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++divzero
++Warns about division by the constant integer 0, for example:
++.sp
++.nf
++\f3int divideByZero = 42 / 0;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++empty
++Warns about empty statements after \f3if\fRstatements, for example:
++.sp
++.nf
++\f3class E {\fP
++.fi
++.nf
++\f3 void m() {\fP
++.fi
++.nf
++\f3 if (true) ;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++fallthrough
++Checks the switch blocks for fall-through cases and provides a warning message for any that are found\&. Fall-through cases are cases in a switch block, other than the last case in the block, whose code does not include a break statement, allowing code execution to fall through from that case to the next case\&. For example, the code following the case 1 label in this switch block does not end with a break statement:
++.sp
++.nf
++\f3switch (x) {\fP
++.fi
++.nf
++\f3case 1:\fP
++.fi
++.nf
++\f3 System\&.out\&.println("1");\fP
++.fi
++.nf
++\f3 // No break statement here\&.\fP
++.fi
++.nf
++\f3case 2:\fP
++.fi
++.nf
++\f3 System\&.out\&.println("2");\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the \f3-Xlint:fallthrough\fR option was used when compiling this code, then the compiler emits a warning about possible fall-through into case, with the line number of the case in question\&.
++.TP
++finally
++Warns about \f3finally\fR clauses that cannot complete normally, for example:
++.sp
++.nf
++\f3public static int m() {\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3 throw new NullPointerException();\fP
++.fi
++.nf
++\f3 } catch (NullPointerException(); {\fP
++.fi
++.nf
++\f3 System\&.err\&.println("Caught NullPointerException\&.");\fP
++.fi
++.nf
++\f3 return 1;\fP
++.fi
++.nf
++\f3 } finally {\fP
++.fi
++.nf
++\f3 return 0;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates a warning for the \f3finally\fR block in this example\&. When the \f3int\fR method is called, it returns a value of 0\&. A \f3finally\fR block executes when the \f3try\fR block exits\&. In this example, when control is transferred to the \f3catch\fR block, the \f3int\fR method exits\&. However, the \f3finally\fR block must execute, so it is executed, even though control was transferred outside the method\&.
++.TP
++options
++Warns about issues that related to the use of command-line options\&. See Cross-Compilation Options\&.
++.TP
++overrides
++Warns about issues regarding method overrides\&. For example, consider the following two classes:
++.sp
++.nf
++\f3public class ClassWithVarargsMethod {\fP
++.fi
++.nf
++\f3 void varargsMethod(String\&.\&.\&. s) { }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class ClassWithOverridingMethod extends ClassWithVarargsMethod {\fP
++.fi
++.nf
++\f3 @Override\fP
++.fi
++.nf
++\f3 void varargsMethod(String[] s) { }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates a warning similar to the following:\&.
++.sp
++.nf
++\f3warning: [override] varargsMethod(String[]) in ClassWithOverridingMethod \fP
++.fi
++.nf
++\f3overrides varargsMethod(String\&.\&.\&.) in ClassWithVarargsMethod; overriding\fP
++.fi
++.nf
++\f3method is missing \&'\&.\&.\&.\&'\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler encounters a \f3varargs\fR method, it translates the \f3varargs\fR formal parameter into an array\&. In the method \f3ClassWithVarargsMethod\&.varargsMethod\fR, the compiler translates the \f3varargs\fR formal parameter \f3String\&.\&.\&. s\fR to the formal parameter \f3String[] s\fR, an array, which matches the formal parameter of the method \f3ClassWithOverridingMethod\&.varargsMethod\fR\&. Consequently, this example compiles\&.
++.TP
++path
++Warns about invalid path elements and nonexistent path directories on the command line (with regard to the class path, the source path, and other paths)\&. Such warnings cannot be suppressed with the \f3@SuppressWarnings\fR annotation, for example:
++.sp
++.nf
++\f3javac \-Xlint:path \-classpath /nonexistentpath Example\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++processing
++Warn about issues regarding annotation processing\&. The compiler generates this warning when you have a class that has an annotation, and you use an annotation processor that cannot handle that type of exception\&. For example, the following is a simple annotation processor:
++
++\fISource file AnnocProc\&.java\fR:
++.sp
++.nf
++\f3import java\&.util\&.*;\fP
++.fi
++.nf
++\f3import javax\&.annotation\&.processing\&.*;\fP
++.fi
++.nf
++\f3import javax\&.lang\&.model\&.*;\fP
++.fi
++.nf
++\f3import\&.javaz\&.lang\&.model\&.element\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@SupportedAnnotationTypes("NotAnno")\fP
++.fi
++.nf
++\f3public class AnnoProc extends AbstractProcessor {\fP
++.fi
++.nf
++\f3 public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv){\fP
++.fi
++.nf
++\f3 return true;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public SourceVersion getSupportedSourceVersion() {\fP
++.fi
++.nf
++\f3 return SourceVersion\&.latest();\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fISource file AnnosWithoutProcessors\&.java\fR:
++.sp
++.nf
++\f3@interface Anno { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@Anno\fP
++.fi
++.nf
++\f3class AnnosWithoutProcessors { }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following commands compile the annotation processor \f3AnnoProc\fR, then run this annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR:
++.sp
++.nf
++\f3javac AnnoProc\&.java\fP
++.fi
++.nf
++\f3javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutProcessors\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler runs the annotation processor against the source file \f3AnnosWithoutProcessors\&.java\fR, it generates the following warning:
++.sp
++.nf
++\f3warning: [processing] No processor claimed any of these annotations: Anno\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To resolve this issue, you can rename the annotation defined and used in the class \f3AnnosWithoutProcessors\fR from \f3Anno\fR to \f3NotAnno\fR\&.
++.TP
++rawtypes
++Warns about unchecked operations on raw types\&. The following statement generates a \f3rawtypes\fR warning:
++.sp
++.nf
++\f3void countElements(List l) { \&.\&.\&. }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following example does not generate a \f3rawtypes\fR warning
++.sp
++.nf
++\f3void countElements(List<?> l) { \&.\&.\&. }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\f3List\fR is a raw type\&. However, \f3List<?>\fR is an unbounded wildcard parameterized type\&. Because \f3List\fR is a parameterized interface, always specify its type argument\&. In this example, the \f3List\fR formal argument is specified with an unbounded wildcard (\f3?\fR) as its formal type parameter, which means that the \f3countElements\fR method can accept any instantiation of the \f3List\fR interface\&.
++.TP
++Serial
++Warns about missing \f3serialVersionUID\fR definitions on serializable classes, for example:
++.sp
++.nf
++\f3public class PersistentTime implements Serializable\fP
++.fi
++.nf
++\f3{\fP
++.fi
++.nf
++\f3 private Date time;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public PersistentTime() {\fP
++.fi
++.nf
++\f3 time = Calendar\&.getInstance()\&.getTime();\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public Date getTime() {\fP
++.fi
++.nf
++\f3 return time;\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates the following warning:
++.sp
++.nf
++\f3warning: [serial] serializable class PersistentTime has no definition of\fP
++.fi
++.nf
++\f3serialVersionUID\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If a serializable class does not explicitly declare a field named \f3serialVersionUID\fR, then the serialization runtime environment calculates a default \f3serialVersionUID\fR value for that class based on various aspects of the class, as described in the Java Object Serialization Specification\&. However, it is strongly recommended that all serializable classes explicitly declare \f3serialVersionUID\fR values because the default process of computing \f3serialVersionUID\fR vales is highly sensitive to class details that can vary depending on compiler implementations, and as a result, might cause an unexpected \f3InvalidClassExceptions\fR during deserialization\&. To guarantee a consistent \f3serialVersionUID\fR value across different Java compiler implementations, a serializable class must declare an explicit \f3serialVersionUID\fR value\&.
++.TP
++static
++Warns about issues relating to the use of statics, for example:
++.sp
++.nf
++\f3class XLintStatic {\fP
++.fi
++.nf
++\f3 static void m1() { }\fP
++.fi
++.nf
++\f3 void m2() { this\&.m1(); }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The compiler generates the following warning:
++.sp
++.nf
++\f3warning: [static] static method should be qualified by type name, \fP
++.fi
++.nf
++\f3XLintStatic, instead of by an expression\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To resolve this issue, you can call the \f3static\fR method \f3m1\fR as follows:
++.sp
++.nf
++\f3XLintStatic\&.m1();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Alternately, you can remove the \f3static\fR keyword from the declaration of the method \f3m1\fR\&.
++.TP
++try
++Warns about issues relating to use of \f3try\fR blocks, including try-with-resources statements\&. For example, a warning is generated for the following statement because the resource \f3ac\fR declared in the \f3try\fR block is not used:
++.sp
++.nf
++\f3try ( AutoCloseable ac = getResource() ) { // do nothing}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++unchecked
++Gives more detail for unchecked conversion warnings that are mandated by the Java Language Specification, for example:
++.sp
++.nf
++\f3List l = new ArrayList<Number>();\fP
++.fi
++.nf
++\f3List<String> ls = l; // unchecked warning\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++During type erasure, the types \f3ArrayList<Number>\fR and \f3List<String>\fR become \f3ArrayList\fR and \f3List\fR, respectively\&.
++
++The \f3ls\fR command has the parameterized type \f3List<String>\fR\&. When the \f3List\fR referenced by \f3l\fR is assigned to \f3ls\fR, the compiler generates an unchecked warning\&. At compile time, the compiler and JVM cannot determine whether \f3l\fR refers to a \f3List<String>\fR type\&. In this case, \f3l\fR does not refer to a \f3List<String>\fR type\&. As a result, heap pollution occurs\&.
++
++A heap pollution situation occurs when the \f3List\fR object \f3l\fR, whose static type is \f3List<Number>\fR, is assigned to another \f3List\fR object, \f3ls\fR, that has a different static type, \f3List<String>\fR\&. However, the compiler still allows this assignment\&. It must allow this assignment to preserve backward compatibility with releases of Java SE that do not support generics\&. Because of type erasure, \f3List<Number>\fR and \f3List<String>\fR both become \f3List\fR\&. Consequently, the compiler allows the assignment of the object \f3l\fR\f3,\fR which has a raw type of \f3List\fR, to the object \f3ls\fR\&.
++.TP
++varargs
++Warns about unsafe usages of variable arguments (\f3varargs\fR) methods, in particular, those that contain non-reifiable arguments, for example:
++.sp
++.nf
++\f3public class ArrayBuilder {\fP
++.fi
++.nf
++\f3 public static <T> void addToList (List<T> listArg, T\&.\&.\&. elements) {\fP
++.fi
++.nf
++\f3 for (T x : elements) {\fP
++.fi
++.nf
++\f3 listArg\&.add(x);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR A non-reifiable type is a type whose type information is not fully available at runtime\&.
++
++The compiler generates the following warning for the definition of the method \f3ArrayBuilder\&.addToList\fR
++.sp
++.nf
++\f3warning: [varargs] Possible heap pollution from parameterized vararg type T\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the compiler encounters a varargs method, it translates the \f3varargs\fR formal parameter into an array\&. However, the Java programming language does not permit the creation of arrays of parameterized types\&. In the method \f3ArrayBuilder\&.addToList\fR, the compiler translates the \f3varargs\fR formal parameter \f3T\&.\&.\&.\fR elements to the formal parameter \f3T[]\fR elements, an array\&. However, because of type erasure, the compiler converts the \f3varargs\fR formal parameter to \f3Object[]\fR elements\&. Consequently, there is a possibility of heap pollution\&.
++.SH COMMAND-LINE\ ARGUMENT\ FILES
++To shorten or simplify the \f3javac\fR command, you can specify one or more files that contain arguments to the \f3javac\fR command (except \f3-J\fR options)\&. This enables you to create \f3javac\fR commands of any length on any operating system\&.
++.PP
++An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be separated by spaces or new line characters\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
++.PP
++File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (*) are not allowed in these lists (such as for specifying \f3*\&.java\fR)\&. Use of the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
++.PP
++When executing the \f3javac\fR command, pass in the path and name of each argument file with the at sign (@) leading character\&. When the \f3javac\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
++.PP
++\f3Example 1 Single Argument File\fR
++.PP
++You could use a single argument file named \f3argfile\fR to hold all \f3javac\fR arguments:
++.sp
++.nf
++\f3javac @argfile\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This argument file could contain the contents of both files shown in Example 2
++.PP
++\f3Example 2 Two Argument Files\fR
++.PP
++You can create two argument files: one for the \f3javac\fR options and the other for the source file names\&. Note that the following lists have no line-continuation characters\&.
++.PP
++Create a file named options that contains the following:
++.sp
++.nf
++\f3\-d classes\fP
++.fi
++.nf
++\f3\-g\fP
++.fi
++.nf
++\f3\-sourcepath /java/pubs/ws/1\&.3/src/share/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Create a file named classes that contains the following:
++.sp
++.nf
++\f3MyClass1\&.java\fP
++.fi
++.nf
++\f3MyClass2\&.java\fP
++.fi
++.nf
++\f3MyClass3\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Then, run the \f3javac\fR command as follows:
++.sp
++.nf
++\f3javac @options @classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Argument Files with Paths\fR
++.PP
++The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
++.sp
++.nf
++\f3javac @path1/options @path2/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH ANNOTATION\ PROCESSING
++The \f3javac\fR command provides direct support for annotation processing, superseding the need for the separate annotation processing command, \f3apt\fR\&.
++.PP
++The API for annotation processors is defined in the \f3javax\&.annotation\&.processing\fR and j\f3avax\&.lang\&.model\fR packages and subpackages\&.
++.SS HOW\ ANNOTATION\ PROCESSING\ WORKS
++Unless annotation processing is disabled with the \f3-proc:none\fR option, the compiler searches for any annotation processors that are available\&. The search path can be specified with the \f3-processorpath\fR option\&. If no path is specified, then the user class path is used\&. Processors are located by means of service provider-configuration files named \f3META-INF/services/javax\&.annotation\&.processing\fR\&.Processor on the search path\&. Such files should contain the names of any annotation processors to be used, listed one per line\&. Alternatively, processors can be specified explicitly, using the \f3-processor\fR option\&.
++.PP
++After scanning the source files and classes on the command line to determine what annotations are present, the compiler queries the processors to determine what annotations they process\&. When a match is found, the processor is called\&. A processor can claim the annotations it processes, in which case no further attempt is made to find any processors for those annotations\&. After all of the annotations are claimed, the compiler does not search for additional processors\&.
++.PP
++If any processors generate new source files, then another round of annotation processing occurs: Any newly generated source files are scanned, and the annotations processed as before\&. Any processors called on previous rounds are also called on all subsequent rounds\&. This continues until no new source files are generated\&.
++.PP
++After a round occurs where no new source files are generated, the annotation processors are called one last time, to give them a chance to complete any remaining work\&. Finally, unless the \f3-proc:only\fR option is used, the compiler compiles the original and all generated source files\&.
++.SS IMPLICITLY\ LOADED\ SOURCE\ FILES
++To compile a set of source files, the compiler might need to implicitly load additional source files\&. See Searching for Types\&. Such files are currently not subject to annotation processing\&. By default, the compiler gives a warning when annotation processing occurred and any implicitly loaded source files are compiled\&. The \f3-implicit\fR option provides a way to suppress the warning\&.
++.SH SEARCHING\ FOR\ TYPES
++To compile a source file, the compiler often needs information about a type, but the type definition is not in the source files specified on the command line\&. The compiler needs type information for every class or interface used, extended, or implemented in the source file\&. This includes classes and interfaces not explicitly mentioned in the source file, but that provide information through inheritance\&.
++.PP
++For example, when you create a subclass \f3java\&.applet\&.Applet\fR, you are also using the ancestor classes of \f3Applet\fR: \f3java\&.awt\&.Panel\fR, \f3java\&.awt\&.Container\fR, \f3java\&.awt\&.Component\fR, and \f3java\&.lang\&.Object\fR\&.
++.PP
++When the compiler needs type information, it searches for a source file or class file that defines the type\&. The compiler searches for class files first in the bootstrap and extension classes, then in the user class path (which by default is the current directory)\&. The user class path is defined by setting the \f3CLASSPATH\fR environment variable or by using the \f3-classpath\fR option\&.
++.PP
++If you set the \f3-sourcepath\fR option, then the compiler searches the indicated path for source files\&. Otherwise, the compiler searches the user class path for both class files and source files\&.
++.PP
++You can specify different bootstrap or extension classes with the \f3-bootclasspath\fR and the \f3-extdirs\fR options\&. See Cross-Compilation Options\&.
++.PP
++A successful type search may produce a class file, a source file, or both\&. If both are found, then you can use the \f3-Xprefer\fR option to instruct the compiler which to use\&. If \f3newer\fR is specified, then the compiler uses the newer of the two files\&. If \f3source\fR is specified, the compiler uses the source file\&. The default is \f3newer\fR\&.
++.PP
++If a type search finds a source file for a required type, either by itself, or as a result of the setting for the \f3-Xprefer\fR option, then the compiler reads the source file to get the information it needs\&. By default the compiler also compiles the source file\&. You can use the \f3-implicit\fR option to specify the behavior\&. If \f3none\fR is specified, then no class files are generated for the source file\&. If \f3class\fR is specified, then class files are generated for the source file\&.
++.PP
++The compiler might not discover the need for some type information until after annotation processing completes\&. When the type information is found in a source file and no \f3-implicit\fR option is specified, the compiler gives a warning that the file is being compiled without being subject to annotation processing\&. To disable the warning, either specify the file on the command line (so that it will be subject to annotation processing) or use the \f3-implicit\fR option to specify whether or not class files should be generated for such source files\&.
++.SH PROGRAMMATIC\ INTERFACE
++The \f3javac\fR command supports the new Java Compiler API defined by the classes and interfaces in the \f3javax\&.tools\fR package\&.
++.SS EXAMPLE
++To compile as though providing command-line arguments, use the following syntax:
++.sp
++.nf
++\f3JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler();\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The example writes diagnostics to the standard output stream and returns the exit code that \f3javac\fR would give when called from the command line\&.
++.PP
++You can use other methods in the \f3javax\&.tools\&.JavaCompiler\fR interface to handle diagnostics, control where files are read from and written to, and more\&.
++.SS OLD\ INTERFACE
++\fINote:\fR This API is retained for backward compatibility only\&. All new code should use the newer Java Compiler API\&.
++.PP
++The \f3com\&.sun\&.tools\&.javac\&.Main\fR class provides two static methods to call the compiler from a program:
++.sp
++.nf
++\f3public static int compile(String[] args);\fP
++.fi
++.nf
++\f3public static int compile(String[] args, PrintWriter out);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3args\fR parameter represents any of the command-line arguments that would typically be passed to the compiler\&.
++.PP
++The \f3out\fR parameter indicates where the compiler diagnostic output is directed\&.
++.PP
++The \f3return\fR value is equivalent to the \f3exit\fR value from \f3javac\fR\&.
++.PP
++\fINote:\fR All other classes and methods found in a package with names that start with \f3com\&.sun\&.tools\&.javac\fR (subpackages of \f3com\&.sun\&.tools\&.javac\fR) are strictly internal and subject to change at any time\&.
++.SH EXAMPLES
++\f3Example 1 Compile a Simple Program\fR
++.PP
++This example shows how to compile the \f3Hello\&.java\fR source file in the greetings directory\&. The class defined in \f3Hello\&.java\fR is called \f3greetings\&.Hello\fR\&. The greetings directory is the package directory both for the source file and the class file and is underneath the current directory\&. This makes it possible to use the default user class path\&. It also makes it unnecessary to specify a separate destination directory with the \f3-d\fR option\&.
++.PP
++The source code in \f3Hello\&.java\fR:
++.sp
++.nf
++\f3package greetings;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class Hello {\fP
++.fi
++.nf
++\f3 public static void main(String[] args) {\fP
++.fi
++.nf
++\f3 for (int i=0; i < args\&.length; i++) {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Hello " + args[i]);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Compile greetings\&.Hello:
++.sp
++.nf
++\f3javac greetings/Hello\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run \f3greetings\&.Hello\fR:
++.sp
++.nf
++\f3java greetings\&.Hello World Universe Everyone\fP
++.fi
++.nf
++\f3Hello World\fP
++.fi
++.nf
++\f3Hello Universe\fP
++.fi
++.nf
++\f3Hello Everyone\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Compile Multiple Source Files\fR
++.PP
++This example compiles the \f3Aloha\&.java\fR, \f3GutenTag\&.java\fR, \f3Hello\&.java\fR, and \f3Hi\&.java\fR source files in the \f3greetings\fR package\&.
++.sp
++.nf
++\f3% javac greetings/*\&.java\fP
++.fi
++.nf
++\f3% ls greetings\fP
++.fi
++.nf
++\f3Aloha\&.class GutenTag\&.class Hello\&.class Hi\&.class\fP
++.fi
++.nf
++\f3Aloha\&.java GutenTag\&.java Hello\&.java Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Specify a User Class Path\fR
++.PP
++After changing one of the source files in the previous example, recompile it:
++.sp
++.nf
++\f3pwd\fP
++.fi
++.nf
++\f3/examples\fP
++.fi
++.nf
++\f3javac greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Because \f3greetings\&.Hi\fR refers to other classes in the \f3greetings\fR package, the compiler needs to find these other classes\&. The previous example works because the default user class path is the directory that contains the package directory\&. If you want to recompile this file without concern for which directory you are in, then add the examples directory to the user class path by setting \f3CLASSPATH\fR\&. This example uses the \f3-classpath\fR option\&.
++.sp
++.nf
++\f3javac \-classpath /examples /examples/greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you change \f3greetings\&.Hi\fR to use a banner utility, then that utility also needs to be accessible through the user class path\&.
++.sp
++.nf
++\f3javac \-classpath /examples:/lib/Banners\&.jar \e\fP
++.fi
++.nf
++\f3 /examples/greetings/Hi\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To execute a class in the \f3greetings\fR package, the program needs access to the \f3greetings\fR package, and to the classes that the \f3greetings\fR classes use\&.
++.sp
++.nf
++\f3java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Separate Source Files and Class Files\fR
++.PP
++The following example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
++.sp
++.nf
++\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e \fP
++.fi
++.nf
++\f3\-extdirs "" OldCode\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language be used to compile \f3OldCode\&.java\fR\&. The option \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&. Note that in most cases, the value of the \f3-target\fR option is the value of the \f3-source\fR option; in this example, you can omit the \f3-target\fR option\&.
++.PP
++You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
++.sp
++.nf
++\f3javac \-source 1\&.7 OldCode\&.java\fP
++.fi
++.nf
++\f3warning: [options] bootstrap class path not set in conjunction with \fP
++.fi
++.nf
++\f3\-source 1\&.7\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules (in this example, it uses version 1\&.7 of the Java programming language) combined with the new bootstrap classes, which can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&.
++.PP
++\f3Example 5 Cross Compile\fR
++.PP
++This example uses \f3javac\fR to compile code that runs on JVM 1\&.7\&.
++.sp
++.nf
++\f3javac \-source 1\&.7 \-target 1\&.7 \-bootclasspath jdk1\&.7\&.0/lib/rt\&.jar \e\fP
++.fi
++.nf
++\f3 \-extdirs "" OldCode\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The\f3-source 1\&.7\fR option specifies that release 1\&.7 (or 7) of the Java programming language to be used to compile OldCode\&.java\&. The \f3-target 1\&.7\fR option ensures that the generated class files are compatible with JVM 1\&.7\&.
++.PP
++You must specify the \f3-bootclasspath\fR option to specify the correct version of the bootstrap classes (the \f3rt\&.jar\fR library)\&. If not, then the compiler generates a warning:
++.sp
++.nf
++\f3javac \-source 1\&.7 OldCode\&.java\fP
++.fi
++.nf
++\f3warning: [options] bootstrap class path not set in conjunction with \-source 1\&.7\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the correct version of bootstrap classes, then the compiler uses the old language rules combined with the new bootstrap classes\&. This combination can result in class files that do not work on the older platform (in this case, Java SE 7) because reference to nonexistent methods can get included\&. In this example, the compiler uses release 1\&.7 of the Java programming language\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javadoc(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jdb(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/javadoc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/javadoc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Basic Tools
+-.\" Title: javadoc.1
+-.\"
+-.if n .pl 99999
+-.TH javadoc 1 "03 March 2015" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Basic Tools
++.\" Title: javadoc.1
++.\"
++.if n .pl 99999
++.TH javadoc 1 "03 March 2015" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,2957 +47,2957 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javadoc \- Generates HTML pages of API documentation from Java source files\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavadoc\fR {\fIpackages\fR|\fIsource\-files\fR} [\fIoptions\fR] [\fI@argfiles\fR]
+-.fi
+-.sp
+-.TP
+-\fIpackages\fR
+-Names of packages that you want to document, separated by spaces, for example \f3java\&.lang java\&.lang\&.reflect java\&.awt\fR\&. If you want to also document the subpackages, use the \f3-subpackages\fR option to specify the packages\&.
+-
+-By default, \f3javadoc\fR looks for the specified packages in the current directory and subdirectories\&. Use the \f3-sourcepath\fR option to specify the list of directories where to look for packages\&.
+-.TP
+-\fIsource-files\fR
+-Names of Java source files that you want to document, separated by spaces, for example \f3Class\&.java Object\&.java Button\&.java\fR\&. By default, \f3javadoc\fR looks for the specified classes in the current directory\&. However, you can specify the full path to the class file and use wildcard characters, for example \f3/home/src/java/awt/Graphics*\&.java\fR\&. You can also specify the path relative to the current directory\&.
+-.TP
+-\fIoptions\fR
+-Command-line options, separated by spaces\&. See Options\&.
+-.TP
+-\fI@argfiles\fR
+-Names of files that contain a list of \f3javadoc\fR command options, package names and source file names in any order\&.
+-.SH DESCRIPTION
+-The \f3javadoc\fR command parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages that describe (by default) the public and protected classes, nested classes (but not anonymous inner classes), interfaces, constructors, methods, and fields\&. You can use the \f3javadoc\fR command to generate the API documentation or the implementation documentation for a set of source files\&.
+-.PP
+-You can run the \f3javadoc\fR command on entire packages, individual source files, or both\&. When documenting entire packages, you can either use the \f3-subpackages\fR option to recursively traverse a directory and its subdirectories, or to pass in an explicit list of package names\&. When you document individual source files, pass in a list of Java source file names\&. See Simple Examples\&.
+-.SS PROCESS\ SOURCE\ FILES
+-The \f3javadoc\fR command processes files that end in source and other files described in Source Files\&. If you run the \f3javadoc\fR command by passing in individual source file names, then you can determine exactly which source files are processed\&. However, that is not how most developers want to work, because it is simpler to pass in package names\&. The \f3javadoc\fR command can be run three ways without explicitly specifying the source file names\&. You can pass in package names, use the \f3-subpackages\fR option, or use wild cards with source file names\&. In these cases, the \f3javadoc\fR command processes a source file only when the file fulfills all of the following requirements:
+-.TP 0.2i
+-\(bu
+-The file name prefix (with \f3\&.java\fR removed) is a valid class name\&.
+-.TP 0.2i
+-\(bu
+-The path name relative to the root of the source tree is a valid package name after the separators are converted to dots\&.
+-.TP 0.2i
+-\(bu
+-The package statement contains the valid package name\&.
+-.PP
+-Processing Links
+-
+-During a run, the \f3javadoc\fR command adds cross-reference links to package, class, and member names that are being documented as part of that run\&. Links appear in the following places\&. See Javadoc Tags for a description of the @ tags\&.
+-.TP 0.2i
+-\(bu
+-Declarations (return types, argument types, and field types)\&.
+-.TP 0.2i
+-\(bu
+-\fISee Also\fR sections that are generated from \f3@see\fR tags\&.
+-.TP 0.2i
+-\(bu
+-Inline text generated from \f3{@link}\fR tags\&.
+-.TP 0.2i
+-\(bu
+-Exception names generated from \f3@throws\fR tags\&.
+-.TP 0.2i
+-\(bu
+-\fISpecified by\fR links to interface members and \fIOverrides\fR links to class members\&. See Method Comment Inheritance\&.
+-.TP 0.2i
+-\(bu
+-Summary tables listing packages, classes and members\&.
+-.TP 0.2i
+-\(bu
+-Package and class inheritance trees\&.
+-.TP 0.2i
+-\(bu
+-The index\&.
+-.PP
+-You can add links to existing text for classes not included on the command line (but generated separately) by way of the \f3-link\fR and \f3-linkoffline\fR options\&.
+-.PP
+-Processing Details
+-
+-The \f3javadoc\fR command produces one complete document every time it runs\&. It does not do incremental builds that modify or directly incorporate the results from earlier runs\&. However, the \f3javadoc\fR command can link to results from other runs\&.
+-.PP
+-The \f3javadoc\fR command implementation requires and relies on the Java compiler\&. The \f3javadoc\fR command calls part of the \f3javac\fR command to compile the declarations and ignore the member implementations\&. The \f3javadoc\fR command builds a rich internal representation of the classes that includes the class hierarchy and use relationships to generate the HTML\&. The \f3javadoc\fR command also picks up user-supplied documentation from documentation comments in the source code\&. See Documentation Comments\&.
+-.PP
+-The \f3javadoc\fR command runs on source files that are pure stub files with no method bodies\&. This means you can write documentation comments and run the \f3javadoc\fR command in the early stages of design before API implementation\&.
+-.PP
+-Relying on the compiler ensures that the HTML output corresponds exactly with the actual implementation, which may rely on implicit, rather than explicit, source code\&. For example, the \f3javadoc\fR command documents default constructors that are present in the compiled class files but not in the source code\&.
+-.PP
+-In many cases, the \f3javadoc\fR command lets you generate documentation for source files with incomplete or erroneous code\&. You can generate documentation before all debugging and troubleshooting is done\&. The \f3javadoc\fR command does primitive checking of documentation comments\&.
+-.PP
+-When the \f3javadoc\fR command builds its internal structure for the documentation, it loads all referenced classes\&. Because of this, the \f3javadoc\fR command must be able to find all referenced classes, whether bootstrap classes, extensions, or user classes\&. See How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-.PP
+-Typically, classes you create must either be loaded as an extension or in the \f3javadoc\fR command class path\&.
+-.SS JAVADOC\ DOCLETS
+-You can customize the content and format of the \f3javadoc\fR command output with doclets\&. The \f3javadoc\fR command has a default built-in doclet, called the standard doclet, that generates HTML-formatted API documentation\&. You can modify or make a subclass of the standard doclet, or write your own doclet to generate HTML, XML, MIF, RTF or whatever output format you want\&.
+-.PP
+-When a custom doclet is not specified with the \f3-doclet\fR option, the \f3javadoc\fR command uses the default standard doclet\&. The \f3javadoc\fR command has several options that are available regardless of which doclet is being used\&. The standard doclet adds a supplementary set of command-line options\&. See Options\&.
+-.SH SOURCE\ FILES
+-The \f3javadoc\fR command generates output that originates from the following types of source files: Java language source files for classes (\f3\&.java\fR), package comment files, overview comment files, and miscellaneous unprocessed files\&. This section also describes test files and template files that can also be in the source tree, but that you want to be sure not to document\&.
+-.SS CLASS\ SOURCE\ FILES
+-Each class or interface and its members can have their own documentation comments contained in a source file\&. See Documentation Comments\&.
+-.SS PACKAGE\ COMMENT\ FILES
+-Each package can have its own documentation comment, contained in its own source file, that the \f3javadoc\fR command merges into the generated package summary page\&. You typically include in this comment any documentation that applies to the entire package\&.
+-.PP
+-To create a package comment file, you can place your comments in one of the following files:
+-.TP 0.2i
+-\(bu
+-The \f3package-info\&.java\fR file can contain the package declaration, package annotations, package comments, and Javadoc tags\&. This file is preferred\&.
+-.TP 0.2i
+-\(bu
+-The \f3package\&.html\fR file contains only package comments and Javadoc tags\&. No package annotations\&.
+-.PP
+-A package can have a single \f3package\&.html\fR file or a single \f3package-info\&.java\fR file, but not both\&. Place either file in the package directory in the source tree with your source files\&.
+-.PP
+-The package-info\&.java File
+-
+-The \f3package-info\&.java\fR file can contain a package comment of the following structure\&. The comment is placed before the package declaration\&.
+-.PP
+-\fINote:\fR The comment separators \f3/**\fR and \f3*/\fR must be present, but the leading asterisks on the intermediate lines can be left off\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Provides the classes necessary to create an \fP
+-.fi
+-.nf
+-\f3 * applet and the classes an applet uses \fP
+-.fi
+-.nf
+-\f3 * to communicate with its applet context\&.\fP
+-.fi
+-.nf
+-\f3 * <p>\fP
+-.fi
+-.nf
+-\f3 * The applet framework involves two entities:\fP
+-.fi
+-.nf
+-\f3 * the applet and the applet context\&.\fP
+-.fi
+-.nf
+-\f3 * An applet is an embeddable window (see the\fP
+-.fi
+-.nf
+-\f3 * {@link java\&.awt\&.Panel} class) with a few extra\fP
+-.fi
+-.nf
+-\f3 * methods that the applet context can use to \fP
+-.fi
+-.nf
+-\f3 * initialize, start, and stop the applet\&.\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @since 1\&.0\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3package java\&.lang\&.applet;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-The package\&.html File
+-
+-The \f3package\&.html\fR file can contain a package comment of the following structure\&. The comment is placed in the \f3<body>\fR element\&.
+-.PP
+-File: \f3java/applet/package\&.html\fR
+-.sp
+-.nf
+-\f3<HTML>\fP
+-.fi
+-.nf
+-\f3<BODY>\fP
+-.fi
+-.nf
+-\f3Provides the classes necessary to create an applet and the \fP
+-.fi
+-.nf
+-\f3classes an applet uses to communicate with its applet context\&.\fP
+-.fi
+-.nf
+-\f3<p>\fP
+-.fi
+-.nf
+-\f3The applet framework involves two entities: the applet\fP
+-.fi
+-.nf
+-\f3and the applet context\&. An applet is an embeddable\fP
+-.fi
+-.nf
+-\f3window (see the {@link java\&.awt\&.Panel} class) with a\fP
+-.fi
+-.nf
+-\f3few extra methods that the applet context can use to\fP
+-.fi
+-.nf
+-\f3initialize, start, and stop the applet\&. \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3@since 1\&.0 \fP
+-.fi
+-.nf
+-\f3@see java\&.awt\fP
+-.fi
+-.nf
+-\f3</BODY>\fP
+-.fi
+-.nf
+-\f3</HTML>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3package\&.html\fR file is a typical HTML file and does not include a package declaration\&. The content of the package comment file is written in HTML with one exception\&. The documentation comment should not include the comment separators \f3/**\fR and \f3*/\fR or leading asterisks\&. When writing the comment, make the first sentence a summary about the package, and do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. You can include package tags\&. All block tags must appear after the main description\&. If you add an \f3@see\fR tag in a package comment file, then it must have a fully qualified name\&.
+-.PP
+-Processing the Comment File
+-
+-When the \f3javadoc\fR command runs, it searches for the package comment file\&. If the package comment file is found, then the \f3javadoc\fR command does the following:
+-.TP 0.2i
+-\(bu
+-Copies the comment for processing\&. For package\&.html, the \f3javadoc\fR command copies all content between the \f3<body>\fR and \f3</body>\fR HTML tags\&. You can include a \f3<head>\fR section to put a \f3<title>\fR tag, source file copyright statement, or other information, but none of these appear in the generated documentation\&.
+-.TP 0.2i
+-\(bu
+-Processes the package tags\&. See Package Tags\&.
+-.TP 0.2i
+-\(bu
+-Inserts the processed text at the bottom of the generated package summary page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-.TP 0.2i
+-\(bu
+-Copies the first sentence of the package comment to the top of the package summary page\&. The \f3javadoc\fR command also adds the package name and this first sentence to the list of packages on the overview page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-
+-The end of the sentence is determined by the same rules used for the end of the first sentence of class and member main descriptions\&.
+-.SS OVERVIEW\ COMMENT\ FILES
+-Each application or set of packages that you are documenting can have its own overview documentation comment that is kept in its own source file, that the \f3javadoc\fR command merges into the generated overview page\&. You typically include in this comment any documentation that applies to the entire application or set of packages\&.
+-.PP
+-You can name the file anything you want such as overview\&.html and place it anywhere\&. A typical location is at the top of the source tree\&.
+-.PP
+-For example, if the source files for the \f3java\&.applet\fR package are contained in the /home/user/src/java/applet directory, then you could create an overview comment file at /home/user/src/overview\&.html\&.
+-.PP
+-You can have multiple overview comment files for the same set of source files in case you want to run the \f3javadoc\fR command multiple times on different sets of packages\&. For example, you could run the \f3javadoc\fR command once with \f3-private\fR for internal documentation and again without that option for public documentation\&. In this case, you could describe the documentation as public or internal in the first sentence of each overview comment file\&.
+-.PP
+-The content of the overview comment file is one big documentation comment that is written in HTML\&. Make the first sentence a summary about the application or set of packages\&. Do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. All tags except inline tags, such as an {\f3@link}\fR tag, must appear after the main description\&. If you add an \f3@see\fR tag, then it must have a fully qualified name\&.
+-.PP
+-When you run the \f3javadoc\fR command, specify the overview comment file name with the \f3-overview\fR option\&. The file is then processed similarly to that of a package comment file\&. The \f3javadoc\fR command does the following:
+-.TP 0.2i
+-\(bu
+-Copies all content between the \f3<body>\fR and \f3</body>\fR tags for processing\&.
+-.TP 0.2i
+-\(bu
+-Processes the overview tags that are present\&. See Overview Tags\&.
+-.TP 0.2i
+-\(bu
+-Inserts the processed text at the bottom of the generated overview page\&. See Java Platform Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
+-.TP 0.2i
+-\(bu
+-Copies the first sentence of the overview comment to the top of the overview summary page\&.
+-.SS UNPROCESSED\ FILES
+-Your source files can include any files that you want the \f3javadoc\fR command to copy to the destination directory\&. These files usually include graphic files, example Java source and class files, and self-standing HTML files with a lot of content that would overwhelm the documentation comment of a typical Java source file\&.
+-.PP
+-To include unprocessed files, put them in a directory called doc-files\&. The doc-files directory can be a subdirectory of any package directory that contains source files\&. You can have one doc-files subdirectory for each package\&.
+-.PP
+-For example, if you want to include the image of a button in the \f3java\&.awt\&.Button\fR class documentation, then place the image file in the /home/user/src/java/awt/doc-files/ directory\&. Do not place the doc-files directory at /home/user/src/java/doc-files, because java is not a package\&. It does not contain any source files\&.
+-.PP
+-All links to the unprocessed files must be included in the code because the \f3javadoc\fR command does not look at the files\&. The \f3javadoc\fR command copies the directory and all of its contents to the destination\&. The following example shows how the link in the Button\&.java documentation comment might look:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This button looks like this: \fP
+-.fi
+-.nf
+-\f3 * <img src="doc\-files/Button\&.gif">\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS TEST\ AND\ TEMPLATE\ FILES
+-You can store test and template files in the source tree in the same directory with or in a subdirectory of the directory where the source files reside\&. To prevent test and template files from being processed, run the \f3javadoc\fR command and explicitly pass in individual source file names\&.
+-.PP
+-Test files are valid, compilable source files\&. Template files are not valid, compatible source files, but they often have the \f3\&.java\fR suffix\&.
+-.PP
+-Test Files
+-
+-If you want your test files to belong to either an unnamed package or to a package other than the package that the source files are in, then put the test files in a subdirectory underneath the source files and give the directory an invalid name\&. If you put the test files in the same directory with the source and call the \f3javadoc\fR command with a command-line argument that indicates its package name, then the test files cause warnings or errors\&. If the files are in a subdirectory with an invalid name, then the test file directory is skipped and no errors or warnings are issued\&. For example, to add test files for source files in com\&.package1, put them in a subdirectory in an invalid package name\&. The following directory name is invalid because it contains a hyphen:
+-.sp
+-.nf
+-\f3com/package1/test\-files/\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If your test files contain documentation comments, then you can set up a separate run of the \f3javadoc\fR command to produce test file documentation by passing in their test source file names with wild cards, such as \f3com/package1/test-files/*\&.java\fR\&.
+-.PP
+-Template Files
+-
+-If you want a template file to be in the source directory, but not generate errors when you execute the \f3javadoc\fR command, then give it an invalid file name such as \f3Buffer-Template\&.java\fR to prevent it from being processed\&. The \f3javadoc\fR command only processes source files with names, when stripped of the \f3\&.java\fR suffix, that are valid class names\&.
+-.SH GENERATED\ FILES
+-By default, the \f3javadoc\fR command uses a standard doclet that generates HTML-formatted documentation\&. The standard doclet generates basic content, cross-reference, and support pages described here\&. Each HTML page corresponds to a separate file\&. The \f3javadoc\fR command generates two types of files\&. The first type is named after classes and interfaces\&. The second type contain hyphens (such as package-summary\&.html) to prevent conflicts with the first type of file\&.
+-.SS BASIC\ CONTENT\ PAGES
+-.TP 0.2i
+-\(bu
+-One class or interface page (classname\&.html) for each class or interface being documented\&.
+-.TP 0.2i
+-\(bu
+-One package page (package-summary\&.html) for each package being documented\&. The \f3javadoc\fR command includes any HTML text provided in a file with the name package\&.html or package-info\&.java in the package directory of the source tree\&.
+-.TP 0.2i
+-\(bu
+-One overview page (overview-summary\&.html) for the entire set of packages\&. The overview page is the front page of the generated document\&. The \f3javadoc\fR command includes any HTML text provided in a file specified by the \f3-overview\fR option\&. The Overview page is created only when you pass two or more package names into the \f3javadoc\fR command\&. See HTML Frames and Options\&.
+-.SS CROSS-REFERENCE\ PAGES
+-.TP 0.2i
+-\(bu
+-One class hierarchy page for the entire set of packages (overview-tree\&.html)\&. To view the hierarchy page, click \fIOverview\fR in the navigation bar and click \fITree\fR\&.
+-.TP 0.2i
+-\(bu
+-One class hierarchy page for each package (package-tree\&.html) To view the hierarchy page, go to a particular package, class, or interface page, and click \fITree\fR to display the hierarchy for that package\&.
+-.TP 0.2i
+-\(bu
+-One use page for each package (package-use\&.html) and a separate use page for each class and interface (class-use/classname\&.html)\&. The use page describes what packages, classes, methods, constructors and fields use any part of the specified class, interface, or package\&. For example, given a class or interface A, its use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A\&. To view the use page, go to the package, class, or interface and click the \fIUse\fR link in the navigation bar\&.
+-.TP 0.2i
+-\(bu
+-A deprecated API page (deprecated-list\&.html) that lists all deprecated APIs and their suggested replacements\&. Avoid deprecated APIs because they can be removed in future implementations\&.
+-.TP 0.2i
+-\(bu
+-A constant field values page (constant-values\&.html) for the values of static fields\&.
+-.TP 0.2i
+-\(bu
+-A serialized form page (serialized-form\&.html) that provides information about serializable and externalizable classes with field and method descriptions\&. The information on this page is of interest to reimplementors, and not to developers who want to use the API\&. To access the serialized form page, go to any serialized class and click \fISerialized Form\fR in the See Also section of the class comment\&. The standard doclet generates a serialized form page that lists any class (public or non-public) that implements Serializable with its \f3readObject\fR and \f3writeObject\fR methods, the fields that are serialized, and the documentation comments from the \f3@serial\fR, \f3@serialField\fR, and \f3@serialData\fR tags\&. Public serializable classes can be excluded by marking them (or their package) with \f3@serial\fR exclude, and package-private serializable classes can be included by marking them (or their package) with an \f3@serial\fR include\&. As of Release 1\&.4, you can generate the complete serialized form for public and private classes by running the \f3javadoc\fR command without specifying the \f3-private\fR option\&. See Options\&.
+-.TP 0.2i
+-\(bu
+-An index page (\f3index-*\&.html\fR) of all class, interface, constructor, field and method names, in alphabetical order\&. The index page is internationalized for Unicode and can be generated as a single file or as a separate file for each starting character (such as A\(enZ for English)\&.
+-.SS SUPPORT\ PAGES
+-.TP 0.2i
+-\(bu
+-A help page (help-doc\&.html) that describes the navigation bar and the previous pages\&. Use \f3-helpfile\fR to override the default help file with your own custom help file\&.
+-.TP 0.2i
+-\(bu
+-One index\&.html file that creates the HTML frames for display\&. Load this file to display the front page with frames\&. The index\&.html file contains no text content\&.
+-.TP 0.2i
+-\(bu
+-Several frame files (\f3*-frame\&.html\fR) that contains lists of packages, classes, and interfaces\&. The frame files display the HTML frames\&.
+-.TP 0.2i
+-\(bu
+-A package list file (package-list) that is used by the \f3-link\fR and \f3-linkoffline\fR options\&. The package list file is a text file that is not reachable through links\&.
+-.TP 0.2i
+-\(bu
+-A style sheet file (stylesheet\&.css) that controls a limited amount of color, font family, font size, font style, and positioning information on the generated pages\&.
+-.TP 0.2i
+-\(bu
+-A doc-files directory that holds image, example, source code, or other files that you want copied to the destination directory\&. These files are not processed by the \f3javadoc\fR command\&. This directory is not processed unless it exists in the source tree\&.
+-.PP
+-See Options\&.
+-.SS HTML\ FRAMES
+-The \f3javadoc\fR command generates the minimum number of frames (two or three) necessary based on the values passed to the command\&. It omits the list of packages when you pass a single package name or source files that belong to a single package as an argument to the \f3javadoc\fR command\&. Instead, the \f3javadoc\fR command creates one frame in the left-hand column that displays the list of classes\&. When you pass two or more package names, the \f3javadoc\fR command creates a third frame that lists all packages and an overview page (overview-summary\&.html)\&. To bypass frames, click the \fINo Frames\fR link or enter the page set from the overview-summary\&.html page\&.
+-.SS GENERATED\ FILE\ STRUCTURE
+-The generated class and interface files are organized in the same directory hierarchy that Java source files and class files are organized\&. This structure is one directory per subpackage\&.
+-.PP
+-For example, the document generated for the \f3java\&.applet\&.Applet\fR class would be located at java/applet/Applet\&.html\&.
+-.PP
+-The file structure for the \f3java\&.applet\fR package follows, assuming that the destination directory is named \f3apidocs\fR\&. All files that contain the word \fIframe\fR appear in the upper-left or lower-left frames, as noted\&. All other HTML files appear in the right-hand frame\&.
+-.PP
+-Directories are bold\&. The asterisks (*) indicate the files and directories that are omitted when the arguments to the \f3javadoc\fR command are source file names rather than package names\&. When arguments are source file names, an empty package list is created\&. The doc-files directory is not created in the destination unless it exists in the source tree\&. See Generated Files\&.
+-.TP 0.2i
+-\(bu
+-\fIapidocs\fR: Top-level directory
+-.RS
+-.TP 0.2i
+-\(bu
+-index\&.html: Initial Page that sets up HTML frames
+-.TP 0.2i
+-\(bu
+-*overview-summary\&.html: Package list with summaries
+-.TP 0.2i
+-\(bu
+-overview-tree\&.html: Class hierarchy for all packages
+-.TP 0.2i
+-\(bu
+-deprecated-list\&.html: Deprecated APIs for all packages
+-.TP 0.2i
+-\(bu
+-constant-values\&.html: Static field values for all packages
+-.TP 0.2i
+-\(bu
+-serialized-form\&.html: Serialized forms for all packages
+-.TP 0.2i
+-\(bu
+-*overview-frame\&.html: All packages for display in upper-left frame
+-.TP 0.2i
+-\(bu
+-allclasses-frame\&.html: All classes for display in lower-left frame
+-.TP 0.2i
+-\(bu
+-help-doc\&.html: Help about Javadoc page organization
+-.TP 0.2i
+-\(bu
+-index-all\&.html: Default index created without \f3-splitindex\fR option
+-.TP 0.2i
+-\(bu
+-\fIindex-files\fR: Directory created with \f3-splitindex\fR option
+-.RS
+-.TP 0.2i
+-\(bu
+-index-<number>\&.html: Index files created with \f3-splitindex\fR option
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-package-list: Package names for resolving external references
+-.TP 0.2i
+-\(bu
+-stylesheet\&.css: Defines fonts, colors, positions, and so on
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-\fIjava\fR: Package directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIapplet\fR: Subpackage directory
+-.RS
+-.TP 0.2i
+-\(bu
+-Applet\&.html: \f3Applet\fR class page
+-.TP 0.2i
+-\(bu
+-AppletContext\&.html: \f3AppletContext\fR interface
+-.TP 0.2i
+-\(bu
+-AppletStub\&.html: \f3AppletStub\fR interface
+-.TP 0.2i
+-\(bu
+-AudioClip\&.html: \f3AudioClip\fR interface
+-.TP 0.2i
+-\(bu
+-package-summary\&.html: Classes with summaries
+-.TP 0.2i
+-\(bu
+-package-frame\&.html: Package classes for display in lower-left frame
+-.TP 0.2i
+-\(bu
+-package-tree\&.html: Class hierarchy for this package
+-.TP 0.2i
+-\(bu
+-package-use\&.html: Where this package is used
+-.TP 0.2i
+-\(bu
+-\fIdoc-files\fR: Image and example files directory
+-.TP 0.2i
+-\(bu
+-\fIclass-use\fR: Image and examples file location
+-
+-- Applet\&.html: Uses of the Applet class
+-
+-- AppletContext\&.html: Uses of the \f3AppletContext\fR interface
+-
+-- AppletStub\&.html: Uses of the \f3AppletStub\fR interface
+-
+-- AudioClip\&.html: Uses of the \f3AudioClip\fR interface
+-.RE
+-
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-\fIsrc-html\fR: Source code directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIjava\fR: Package directory
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIapplet\fR: Subpackage directory
+-
+-- Applet\&.html: Applet source code
+-
+-- AppletContext\&.html: \f3AppletContext\fR source code
+-
+-- AppletStub\&.html: \f3AppletStub\fR source code
+-
+-- AudioClip\&.html: \f3AudioClip\fR source code
+-.RE
+-
+-.RE
+-
+-.SS GENERATED\ API\ DECLARATIONS
+-The \f3javadoc\fR command generates a declaration at the start of each class, interface, field, constructor, and method description for that API item\&. For example, the declaration for the \f3Boolean\fR class is:
+-.sp
+-.nf
+-\f3public final class Boolean\fP
+-.fi
+-.nf
+-\f3extends Object\fP
+-.fi
+-.nf
+-\f3implements Serializable\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The declaration for the \f3Boolean\&.valueOf\fR method is:
+-.sp
+-.nf
+-\f3public static Boolean valueOf(String s)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3javadoc\fR command can include the modifiers \f3public\fR, \f3protected\fR, \f3private\fR, \f3abstract\fR, \f3final\fR, \f3static\fR, \f3transient\fR, and \f3volatile\fR, but not \f3synchronized\fR or \f3native\fR\&. The \f3synchronized\fR and \f3native\fR modifiers are considered implementation detail and not part of the API specification\&.
+-.PP
+-Rather than relying on the keyword \f3synchronized\fR, APIs should document their concurrency semantics in the main description of the comment\&. For example, a description might be: A single enumeration cannot be used by multiple threads concurrently\&. The document should not describe how to achieve these semantics\&. As another example, while the \f3Hashtable\fR option should be thread-safe, there is no reason to specify that it is achieved by synchronizing all of its exported methods\&. It is better to reserve the right to synchronize internally at the bucket level for higher concurrency\&.
+-.SH DOCUMENTATION\ COMMENTS
+-This section describes source code comments and comment inheritance\&.
+-.SS SOURCE\ CODE\ COMMENTS
+-You can include documentation comments in the source code, ahead of declarations for any class, interface, method, constructor, or field\&. You can also create documentation comments for each package and another one for the overview, though their syntax is slightly different\&. A documentation comment consists of the characters between \f3/**\fR and \f3*/\fR that end it\&. Leading asterisks are allowed on each line and are described further in the following section\&. The text in a comment can continue onto multiple lines\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is the typical format of a simple documentation comment\fP
+-.fi
+-.nf
+-\f3 * that spans two lines\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To save space you can put a comment on one line:
+-.sp
+-.nf
+-\f3/** This comment takes up only one line\&. */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Placement of Comments
+-
+-Documentation comments are recognized only when placed immediately before class, interface, constructor, method, or field declarations\&. Documentation comments placed in the body of a method are ignored\&. The \f3javadoc\fR command recognizes only one documentation comment per declaration statement\&. See Where Tags Can Be Used\&.
+-.PP
+-A common mistake is to put an \f3import\fR statement between the class comment and the class declaration\&. Do not put an \f3import\fR statement at this location because the \f3javadoc\fR command ignores the class comment\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is the class comment for the class Whatever\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3import com\&.example; // MISTAKE \- Important not to put import statement here\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class Whatever{ }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Parts of Comments
+-
+-A documentation comment has a main description followed by a tag section\&. The main description begins after the starting delimiter \f3/**\fR and continues until the tag section\&. The tag section starts with the first block tag, which is defined by the first \f3@\fR character that begins a line (ignoring leading asterisks, white space, and leading separator \f3/**\fR)\&. It is possible to have a comment with only a tag section and no main description\&. The main description cannot continue after the tag section begins\&. The argument to a tag can span multiple lines\&. There can be any number of tags, and some types of tags can be repeated while others cannot\&. For example, this \f3@see\fR tag starts the tag section:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This sentence holds the main description for this documentation comment\&.\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Object\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Block and inline Tags
+-
+-A tag is a special keyword within a documentation comment that the \f3javadoc\fR command processes\&. There are two kinds of tags: block tags, which appear as an \f3@tag\fR tag (also known as standalone tags), and inline tags, which appear within braces, as an \f3{@tag}\fR tag\&. To be interpreted, a block tag must appear at the beginning of a line, ignoring leading asterisks, white space, and the separator (\f3/**\fR)\&. This means you can use the \f3@\fR character elsewhere in the text and it will not be interpreted as the start of a tag\&. If you want to start a line with the \f3@\fR character and not have it be interpreted, then use the HTML entity \f3&#064;\fR\&. Each block tag has associated text, which includes any text following the tag up to, but not including, either the next tag, or the end of the documentation comment\&. This associated text can span multiple lines\&. An inline tag is allowed and interpreted anywhere that text is allowed\&. The following example contains the \f3@deprecated\fR block tag and the \f3{@link}\fR inline tag\&. See Javadoc Tags\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @deprecated As of JDK 1\&.1, replaced by {@link #setBounds(int,int,int,int)}\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Write Comments in HTML
+-
+-The text must be written in HTML with HTML entities and HTML tags\&. You can use whichever version of HTML your browser supports\&. The standard doclet generates HTML 3\&.2-compliant code elsewhere (outside of the documentation comments) with the inclusion of cascading style sheets and frames\&. HTML 4\&.0 is preferred for generated files because of the frame sets\&.
+-.PP
+-For example, entities for the less than symbol (<) and the greater than symbol (>) should be written as \f3&lt;\fR and \f3&gt;\fR\&. Similarly, the ampersand (&) should be written as \f3&amp;\fR\&. The bold HTML tag \f3<b>\fR is shown in the following example\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * This is a <b>doc</b> comment\&.\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Object\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Leading Asterisks
+-
+-When the \f3javadoc\fR command parses a documentation comment, leading asterisks (*) on each line are discarded, and blanks and tabs that precede the initial asterisks (*) are also discarded\&. If you omit the leading asterisk on a line, then the leading white space is no longer removed so that you can paste code examples directly into a documentation comment inside a \f3<PRE>\fR tag with its indentation preserved\&. Spaces are interpreted by browsers more uniformly than tabs\&. Indentation is relative to the left margin (rather than the separator \f3/**\fR or \f3<PRE>\fR tag)\&.
+-.PP
+-First Sentence
+-
+-The first sentence of each documentation comment should be a summary sentence that contains a concise but complete description of the declared entity\&. This sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first block tag\&. The \f3javadoc\fR command copies this first sentence to the member summary at the top of the HTML page\&.
+-.PP
+-Multiple-Field Declarations
+-
+-The Java platform lets you declare multiple fields in a single statement, but this statement can have only one documentation comment that is copied for all fields\&. If you want individual documentation comments for each field, then declare each field in a separate statement\&. For example, the following documentation comment does not make sense written as a single declaration and would be better handled as two declarations:
+-.sp
+-.nf
+-\f3/** \fP
+-.fi
+-.nf
+-\f3 * The horizontal and vertical distances of point (x,y)\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public int x, y; // Avoid this \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3javadoc\fR command generates the following documentation from the previous code:
+-.sp
+-.nf
+-\f3public int x\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The horizontal and vertical distances of point (x, y)\&.
+-.sp
+-.nf
+-\f3public int y\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The horizontal and vertical distances of point (x, y)\&.
+-.PP
+-Use of Header Tags
+-
+-When writing documentation comments for members, it is best not to use HTML heading tags such as \f3<H1>\fR and \f3<H2>\fR, because the \f3javadoc\fR command creates an entire structured document, and these structural tags might interfere with the formatting of the generated document\&. However, you can use these headings in class and package comments to provide your own structure\&.
+-.SS METHOD\ COMMENT\ INHERITANCE
+-The \f3javadoc\fR command allows method comment inheritance in classes and interfaces to fill in missing text or to explicitly inherit method comments\&. Constructors, fields, and nested classes do not inherit documentation comments\&.
+-.PP
+-\fINote:\fR The source file for an inherited method must be on the path specified by the \f3-sourcepath\fR option for the documentation comment to be available to copy\&. Neither the class nor its package needs to be passed in on the command line\&. This contrasts with Release 1\&.3\&.\fIn\fR and earlier releases, where the class had to be a documented class\&.
+-.PP
+-Fill in Missing Text
+-
+-When a main description, or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag is missing from a method comment, the \f3javadoc\fR command copies the corresponding main description or tag comment from the method it overrides or implements (if any)\&. See Method Comment Inheritance\&.
+-.PP
+-When an \f3@param\fR tag for a particular parameter is missing, the comment for that parameter is copied from the method further up the inheritance hierarchy\&. When an \f3@throws\fR tag for a particular exception is missing, the \f3@throws\fR tag is copied only when that exception is declared\&.
+-.PP
+-This behavior contrasts with Release 1\&.3 and earlier, where the presence of any main description or tag would prevent all comments from being inherited\&.
+-.PP
+-See Javadoc Tags and Options\&.
+-.PP
+-Explicit Inheritance
+-
+-Insert the \f3{@inheritDoc}\fR inline tag in a method main description or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag comment\&. The corresponding inherited main description or tag comment is copied into that spot\&.
+-.SS CLASS\ AND\ INTERFACE\ INHERITANCE
+-Comment inheritance occurs in all possible cases of inheritance from classes and interfaces:
+-.TP 0.2i
+-\(bu
+-When a method in a class overrides a method in a superclass
+-.TP 0.2i
+-\(bu
+-When a method in an interface overrides a method in a superinterface
+-.TP 0.2i
+-\(bu
+-When a method in a class implements a method in an interface
+-.PP
+-In the first two cases, the \f3javadoc\fR command generates the subheading \fIOverrides\fR in the documentation for the overriding method\&. A link to the method being overridden is included, whether or not the comment is inherited\&.
+-.PP
+-In the third case, when a method in a specified class implements a method in an interface, the \f3javadoc\fR command generates the subheading \fISpecified by\fR in the documentation for the overriding method\&. A link to the method being implemented is included, whether or not the comment is inherited\&.
+-.SS METHOD\ COMMENTS\ ALGORITHM
+-If a method does not have a documentation comment, or has an \f3{@inheritDoc}\fR tag, then the \f3javadoc\fR command uses the following algorithm to search for an applicable comment\&. The algorithm is designed to find the most specific applicable documentation comment, and to give preference to interfaces over superclasses:
+-.TP 0.4i
+-1\&.
+-Look in each directly implemented (or extended) interface in the order they appear following the word \f3implements\fR (or \f3extends\fR) in the method declaration\&. Use the first documentation comment found for this method\&.
+-.TP 0.4i
+-2\&.
+-If Step 1 failed to find a documentation comment, then recursively apply this entire algorithm to each directly implemented (or extended) interface in the same order they were examined in Step 1\&.
+-.TP 0.4i
+-3\&.
+-When Step 2 fails to find a documentation comment and this is a class other than the \f3Object\fR class, but not an interface:
+-.RS
+-.TP 0.4i
+-1\&.
+-If the superclass has a documentation comment for this method, then use it\&.
+-.TP 0.4i
+-2\&.
+-If Step 3a failed to find a documentation comment, then recursively apply this entire algorithm to the superclass\&.
+-.RE
+-
+-.SH JAVADOC\ TAGS
+-The \f3javadoc\fR command parses special tags when they are embedded within a Java documentation comment\&. The \f3javadoc\fR tags let you autogenerate a complete, well-formatted API from your source code\&. The tags start with an at sign (\f3@\fR) and are case-sensitive\&. They must be typed with the uppercase and lowercase letters as shown\&. A tag must start at the beginning of a line (after any leading spaces and an optional asterisk), or it is treated as text\&. By convention, tags with the same name are grouped together\&. For example, put all \f3@see\fR tags together\&. For more information, see Where Tags Can Be Used\&.
+-.PP
+-Tags have the following types:
+-.TP 0.2i
+-\(bu
+-Bock tags: Place block tags only in the tag section that follows the description\&. Block tags have the form: \fI@tag\fR\&.
+-.TP 0.2i
+-\(bu
+-Inline tags: Place inline tags anywhere in the main description or in the comments for block tags\&. Inline tags are enclosed within braces: \fI{@tag}\fR\&.
+-.PP
+-For custom tags, see -tag tagname:Xaoptcmf:"taghead"\&. See also Where Tags Can Be Used\&.
+-.SS TAG\ DESCRIPTIONS
+-.TP
+-@author \fIname-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds an Author entry with the specified name text to the generated documents when the \f3-author\fR option is used\&. A documentation comment can contain multiple \f3@author\fR tags\&. You can specify one name per \f3@author\fR tag or multiple names per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and space between names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line if you want a localized name separator other than a comma\&. See @author in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@author
+-.TP
+-{@code \fItext\fR}
+-Introduced in JDK 1\&.5
+-
+-Equivalent to \f3<code>{@literal}</code>\fR\&.
+-
+-Displays text in code font without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use regular angle brackets (< and >) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (\f3<-\fR)\&. For example, the documentation comment text \f3{@code A<B>C}\fR displayed in the generated HTML page unchanged as \f3A<B>C\fR\&. This means that the \f3<B>\fR is not interpreted as bold and is in code font\&. If you want the same functionality without the code font, then use the \f3{@literal}\fR tag\&.
+-.TP
+-@deprecated \fIdeprecated-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a comment indicating that this API should no longer be used (even though it may continue to work)\&. The \f3javadoc\fR command moves \f3deprecated-text\fRahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field\&.
+-
+-The first sentence of deprecated text should tell the user when the API was deprecated and what to use as a replacement\&. The \f3javadoc\fR command copies the first sentence to the summary section and index\&. Subsequent sentences can also explain why it was deprecated\&. You should include an \f3{@link}\fR tag (for Javadoc 1\&.2 or later) that points to the replacement API\&.
+-
+-Use the \fI@deprecated annotation\fR tag to deprecate a program element\&. See How and When to Deprecate APIs at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html
+-
+-See also @deprecated in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@deprecated
+-.TP
+-{@docRoot}
+-Introduced in JDK 1\&.3
+-
+-Represents the relative path to the generated document\&'s (destination) root directory from any generated page\&. This tag is useful when you want to include a file, such as a copyright page or company logo, that you want to reference from all generated pages\&. Linking to the copyright page from the bottom of each page is common\&.
+-
+-This \f3{@docRoot}\fR tag can be used both on the command line and in a documentation comment\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, and includes the text portion of any tag (such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags)\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-On the command line, where the header, footer, or bottom are defined: \f3javadoc -bottom \&'<a href="{@docRoot}/copyright\&.html">Copyright</a>\&'\fR\&.
+-
+-When you use the \f3{@docRoot}\fR tag this way in a make file, some \f3makefile\fR programs require a special way to escape for the brace \f3{}\fR characters\&. For example, the Inprise MAKE version 5\&.2 running on Windows requires double braces: \f3{{@docRoot}}\fR\&. It also requires double (rather than single) quotation marks to enclose arguments to options such as the \f3-bottom\fR option (with the quotation marks around the \f3href\fR argument omitted)\&.
+-.TP 0.2i
+-\(bu
+-In a documentation comment:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * See the <a href="{@docRoot}/copyright\&.html">Copyright</a>\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This tag is needed because the generated documents are in hierarchical directories, as deep as the number of subpackages\&. The expression: \f3<a href="{@docRoot}/copyright\&.html">\fR resolves to \f3<a href="\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/Object\&.java\fR and \f3<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/ref/Reference\&.java\fR\&.
+-.RE
+-
+-.TP
+-@exception \fIclass-name description\fR
+-Introduced in JDK 1\&.0
+-
+-Identical to the \f3@throws\fR tag\&. See @throws class-name description\&.
+-.TP
+-{@inheritDoc}
+-Introduced in JDK 1\&.4
+-
+-Inherits (copies) documentation from the nearest inheritable class or implementable interface into the current documentation comment at this tag\&'s location\&. This enables you to write more general comments higher up the inheritance tree and to write around the copied text\&.
+-
+-This tag is valid only in these places in a documentation comment:
+-.RS
+-.TP 0.2i
+-\(bu
+-In the main description block of a method\&. In this case, the main description is copied from a class or interface up the hierarchy\&.
+-.TP 0.2i
+-\(bu
+-In the text arguments of the \f3@return\fR, \f3@param,\fR and \f3@throws\fR tags of a method\&. In this case, the tag text is copied from the corresponding tag up the hierarchy\&.
+-.RE
+-
+-
+-See Method Comment Inheritance for a description of how comments are found in the inheritance hierarchy\&. Note that if this tag is missing, then the comment is or is not automatically inherited according to rules described in that section\&.
+-.TP
+-{@link \fIpackage\&.class#member label\fR}
+-Introduced in JDK 1\&.2
+-
+-Inserts an inline link with a visible text label that points to the documentation for the specified package, class, or member name of a referenced class\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, including the text portion of any tag, such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags\&. See @link in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#{@link
+-
+-This tag is similar to the \f3@see\fR tag\&. Both tags require the same references and accept the same syntax for \f3package\&.class#member\fR and \f3label\fR\&. The main difference is that the \f3{@link}\fR tag generates an inline link rather than placing the link in the See Also section\&. The \f3{@link}\fR tag begins and ends with braces to separate it from the rest of the inline text\&. If you need to use the right brace (\f3}\fR) inside the label, then use the HTML entity notation \f3&#125;\fR\&.
+-
+-There is no limit to the number of \f3{@link}\fR tags allowed in a sentence\&. You can use this tag in the main description part of any documentation comment or in the text portion of any tag, such as the \f3@deprecated\fR, \f3@return\fR or \f3@param\fR tags\&.
+-
+-For example, here is a comment that refers to the \f3getComponentAt(int, int)\fR method:
+-.sp
+-.nf
+-\f3Use the {@link #getComponentAt(int, int) getComponentAt} method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-From this code, the standard doclet generates the following HTML (assuming it refers to another class in the same package):
+-.sp
+-.nf
+-\f3Use the <a href="Component\&.html#getComponentAt(int, int)">getComponentAt</a> method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The previous line appears on the web page as:
+-.sp
+-.nf
+-\f3Use the getComponentAt method\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-{@linkplain \fIpackage\&.class#member label\fR}
+-Introduced in JDK 1\&.4
+-
+-Behaves the same as the \f3{@link}\fR tag, except the link label is displayed in plain text rather than code font\&. Useful when the label is plain text\&. For example, \f3Refer to {@linkplain add() the overridden method}\fR\&. displays as: Refer to the overridden method\&.
+-.TP
+-{@literal \fItext\fR}
+-Introduced in JDK 1\&.5
+-
+-Displays text without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use angle brackets (\f3< and >\fR) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (<-)\&. For example, the documentation comment text \f3{@literal A<B>C}\fR displays unchanged in the generated HTML page in your browser, as \f3A<B>C\fR\&. The \f3<B>\fR is not interpreted as bold (and it is not in code font)\&. If you want the same functionality with the text in code font, then use the \f3{@code}\fR tag\&.
+-.TP
+-@param \fIparameter-name description\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a parameter with the specified \f3parameter-name\fR followed by the specified description to the Parameters section\&. When writing the documentation comment, you can continue the description onto multiple lines\&. This tag is valid only in a documentation comment for a method, constructor, or class\&. See @param in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@param
+-
+-The \f3parameter-name\fR can be the name of a parameter in a method or constructor, or the name of a type parameter of a class, method, or constructor\&. Use angle brackets around this parameter name to specify the use of a type parameter\&.
+-
+-Example of a type parameter of a class:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @param <E> Type of element stored in a list\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public interface List<E> extends Collection<E> {\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Example of a type parameter of a method:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @param string the string to be converted\fP
+-.fi
+-.nf
+-\f3 * @param type the type to convert the string to\fP
+-.fi
+-.nf
+-\f3 * @param <T> the type of the element\fP
+-.fi
+-.nf
+-\f3 * @param <V> the value of the element\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3<T, V extends T> V convert(String string, Class<T> type) {\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-@return \fIdescription\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a Returns section with the description text\&. This text should describe the return type and permissible range of values\&. This tag is valid only in a documentation comment for a method\&. See @return in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@return
+-.TP
+-@see \fIreference\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a \fISee Also\fR heading with a link or text entry that points to a reference\&. A documentation comment can contain any number of \f3@see\fR tags, which are all grouped under the same heading\&. The \f3@see\fR tag has three variations\&. The form is the most common\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. For inserting an inline link within a sentence to a package, class, or member, see \f3{@link}\fR\&.
+-
+-\fIForm 1\fR\&. The @see \f3string\fR tag form adds a text entry for \fIstring\fR\&. No link is generated\&. The string is a book or other reference to information not available by URL\&. The \f3javadoc\fR command distinguishes this from the previous cases by searching for a double quotation mark (") as the first character\&. For example, \f3@see "The Java Programming Language"\fR that generates the following text:
+-
+-\fISee Also\fR:
+-
+-"The Java Programming Language"
+-
+-\fIForm 2\fR\&. The \f3@see <a href="URL#value">label</a>\fR form adds a link as defined by \f3URL#value\fR\&. The \f3URL#value\fR parameter is a relative or absolute URL\&. The \f3javadoc\fR command distinguishes this from other cases by searching for a less-than symbol (\f3<\fR) as the first character\&. For example, \f3@see <a href="spec\&.html#section">Java Spec</a>\fR generates the following link:
+-
+-\fISee Also\fR:
+-
+-Java Spec
+-
+-\fIForm 3\fR\&. The \f3@see package\&.class#member label\fR form adds a link with a visible text label that points to the documentation for the specified name in the Java Language that is referenced\&. The label is optional\&. If the label is omitted, then the name appears instead as visible text, suitably shortened\&. Use the \f3-noqualifier\fR option to globally remove the package name from this visible text\&. Use the label when you want the visible text to be different from the autogenerated visible text\&. See How a Name Appears\&.
+-
+-In Java SE 1\&.2 only, the name but not the label automatically appears in \f3<code>\fR HTML tags\&. Starting with Java SE 1\&.2\&.2, the \f3<code>\fR tag is always included around the visible text, whether or not a label is used\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3package\&.class#member\fR is any valid program element name that is referenced, such as a package, class, interface, constructor, method or field name, except that the character ahead of the member name should be a number sign (\f3#\fR)\&. The class represents any top-level or nested class or interface\&. The member represents any constructor, method, or field (not a nested class or interface)\&. If this name is in the documented classes, then the \f3javadoc\fR command create a link to it\&. To create links to external referenced classes, use the \f3-link\fR option\&. Use either of the other two \f3@see\fR tag forms to refer to the documentation of a name that does not belong to a referenced class\&. See Specify a Name\&.
+-
+-\fINote:\fR External referenced classes are classes that are not passed into the \f3javadoc\fR command on the command line\&. Links in the generated documentation to external referenced classes are called external references or external links\&. For example, if you run the \f3javadoc\fR command on only the \f3java\&.awt package\fR, then any class in \f3java\&.lang\fR, such as \f3Object\fR, is an external referenced class\&. Use the \f3-link\fR and \f3-linkoffline\fR options to link to external referenced classes\&. The source comments of external referenced classes are not available to the \f3javadoc\fR command run\&.
+-.TP 0.2i
+-\(bu
+-\f3label\fR is optional text that is visible as the link label\&. The label can contain white space\&. If \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears, suitably shortened relative to the current class and package\&. See How a Name Appears\&.
+-.TP 0.2i
+-\(bu
+-A space is the delimiter between \f3package\&.class#member\fR and \f3label\fR\&. A space inside parentheses does not indicate the start of a label, so spaces can be used between parameters in a method\&.
+-.RE
+-
+-
+-\fI\fRIn the following example, an \f3@see\fR tag (in the \f3Character\fR class) refers to the equals method in the \f3String\fR class\&. The tag includes both arguments: the name \f3String#equals(Object)\fR and the label \f3equals\fR\&.
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @see String#equals(Object) equals\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The standard doclet produces HTML that is similar to:
+-.sp
+-.nf
+-\f3<dl>\fP
+-.fi
+-.nf
+-\f3<dt><b>See Also:</b>\fP
+-.fi
+-.nf
+-\f3<dd><a href="\&.\&./\&.\&./java/lang/String#equals(java\&.lang\&.Object)"><code>equals<code></a>\fP
+-.fi
+-.nf
+-\f3</dl>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The previous code looks similar to the following in a browser, where the label is the visible link text:
+-
+-\fISee Also\fR:
+-
+-equals
+-.PP
+-Specify a Name
+-
+-\fI\fRThis \f3package\&.class#member\fR name can be either fully qualified, such as \f3java\&.lang\&.String#toUpperCase()\fR or not, such as \f3String#toUpperCase()\fR or \f3#toUpperCase()\fR\&. If the name is less than fully qualified, then the \f3javadoc\fR command uses the standard Java compiler search order to find it\&. See Search Order for the @see Tag\&. The name can contain white space within parentheses, such as between method arguments\&.The advantage to providing shorter, partially qualified names is that they are shorter to type and there is less clutter in the source code\&. The following listing shows the different forms of the name, where \f3Class\fR can be a class or interface; Type can be a class, interface, array, or primitive; and method can be a method or constructor\&.
+-.sp
+-.nf
+-\f3\fITypical forms for\fR\fI @see package\&.class#member\fR\fP
+-.fi
+-.nf
+-\f3\fIReferencing a member of the current class\fR\fP
+-.fi
+-.nf
+-\f3@see #field\fP
+-.fi
+-.nf
+-\f3@see #method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see #constructor(Type argname, Type argname,\&.\&.\&.) \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\fIReferencing another class in the current or imported packages\fR\fP
+-.fi
+-.nf
+-\f3@see Class#field\fP
+-.fi
+-.nf
+-\f3@see Class#method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see Class\&.NestedClass\fP
+-.fi
+-.nf
+-\f3@see Class \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\fIReferencing an element in another package (fully qualified)\fR\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#field\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#method(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#method(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#constructor(Type, Type,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
+-.fi
+-.nf
+-\f3@see package\&.Class\&.NestedClass\fP
+-.fi
+-.nf
+-\f3@see package\&.Class\fP
+-.fi
+-.nf
+-\f3@see package\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3\fRNotes about the previous listing:
+-.TP 0.2i
+-\(bu
+-The first set of forms with no class or package causes the \f3javadoc\fR command to search only through the current class hierarchy\&. It finds a member of the current class or interface, one of its superclasses or superinterfaces, or one of its enclosing classes or interfaces (search Items 1\(en3)\&. It does not search the rest of the current package or other packages (search Items 4\(en5)\&. See Search Order for the @see Tag\&.
+-.TP 0.2i
+-\(bu
+-If any method or constructor is entered as a name with no parentheses, such as \f3getValue\fR, and if there is no field with the same name, then the \f3javadoc\fR command still creates a link to the method\&. If this method is overloaded, then the \f3javadoc\fR command links to the first method its search encounters, which is unspecified\&.
+-.TP 0.2i
+-\(bu
+-Nested classes must be specified as \f3outer\&.inner\fR, not simply \f3inner\fR, for all forms\&.
+-.TP 0.2i
+-\(bu
+-As stated, the number sign (\f3#\fR), rather than a dot (\f3\&.\fR) separates a member from its class\&. This enables the \f3javadoc\fR command to resolve ambiguities, because the dot also separates classes, nested classes, packages, and subpackages\&. However, the \f3javadoc\fR command properly parses a dot when there is no ambiguity, but prints a warning to alert you\&.
+-.PP
+-Search Order for the @see Tag
+-
+-\fI\fRThe \f3javadoc\fR command processes an \f3@see\fR tag that appears in a source file, package file, or overview file\&. In the latter two files, you must fully qualify the name you supply with the \f3@see\fR tag\&. In a source file, you can specify a name that is fully qualified or partially qualified\&.
+-.PP
+-The following is the search order for the \f3@see\fR tag\&.
+-.TP 0.4i
+-1\&.
+-The current class or interface\&.
+-.TP 0.4i
+-2\&.
+-Any enclosing classes and interfaces searching the closest first\&.
+-.TP 0.4i
+-3\&.
+-Any superclasses and superinterfaces, searching the closest first\&.
+-.TP 0.4i
+-4\&.
+-The current package\&.
+-.TP 0.4i
+-5\&.
+-Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statement\&.
+-.PP
+-The \f3javadoc\fR command continues to search recursively through Items 1-3 for each class it encounters until it finds a match\&. That is, after it searches through the current class and its enclosing class E, it searches through the superclasses of E before the enclosing classes of E\&. In Items 4 and 5, the \f3javadoc\fR command does not search classes or interfaces within a package in any specified order (that order depends on the particular compiler)\&. In Item 5, the \f3javadoc\fR command searches in \fIjava\&.lang\fR because that is imported by all programs\&.
+-.PP
+-When the \f3javadoc\fR command encounters an \f3@see\fR tag in a source file that is not fully qualified, it searches for the specified name in the same order as the Java compiler would, except the \f3javadoc\fR command does not detect certain name space ambiguities because it assumes the source code is free of these errors\&. This search order is formally defined in the Java Language Specification\&. The \f3javadoc\fR command searches for that name through all related and imported classes and packages\&. In particular, it searches in this order:
+-.TP 0.4i
+-1\&.
+-The current class or interface\&.
+-.TP 0.4i
+-2\&.
+-Any enclosing classes and interfaces, searching the closest first\&.
+-.TP 0.4i
+-3\&.
+-Any superclasses and superinterfaces, searching the closest first\&.
+-.TP 0.4i
+-4\&.
+-The current package\&.
+-.TP 0.4i
+-5\&.
+-Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statements\&.
+-.PP
+-The \f3javadoc\fR command does not necessarily look in subclasses, nor will it look in other packages even when their documentation is being generated in the same run\&. For example, if the \f3@see\fR tag is in the \f3java\&.awt\&.event\&.KeyEvent\fR class and refers to a name in the \f3java\&.awt package\fR, then the \f3javadoc\fR command does not look in that package unless that class imports it\&.
+-.PP
+-How a Name Appears
+-
+-\fI\fRIf \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears\&. In general, it is suitably shortened relative to the current class and package\&. Shortened means the \f3javadoc\fR command displays only the minimum name necessary\&. For example, if the \f3String\&.toUpperCase()\fR method contains references to a member of the same class and to a member of a different class, then the class name is displayed only in the latter case, as shown in the following listing\&. Use the \f3-noqualifier\fR option to globally remove the package names\&.
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of the same class, same package
+-.br
+-\fIExample in\fR: \f3@see String#toLowerCase()\fR
+-.br
+-\fIAppears as\fR: \f3toLowerCase()\fR - omits the package and class names
+-.br
+-
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, same package
+-.br
+-\fIExample in\fR: \f3@see Character#toLowerCase(char)\fR
+-.br
+-\fIAppears as\fR: \f3Character\&.toLowerCase(char)\fR - omits the package name, includes the class name
+-.br
+-
+-.PP
+-\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, different package
+-.br
+-\fIExample in\fR: \f3@see java\&.io\&.File#exists()\fR
+-.br
+-\fIAppears as\fR: \f3java\&.io\&.File\&.exists()\fR - includes the package and class names
+-.br
+-
+-.PP
+-Examples of the @see Tag
+-
+-The comment to the right shows how the name appears when the \f3@see\fR tag is in a class in another package, such as \f3java\&.applet\&.Applet\fR\&. See @see in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@see
+-.sp
+-.nf
+-\f3 See also:\fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.String // String \fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.String The String class // The String class \fP
+-.fi
+-.nf
+-\f3@see String // String \fP
+-.fi
+-.nf
+-\f3@see String#equals(Object) // String\&.equals(Object) \fP
+-.fi
+-.nf
+-\f3@see String#equals // String\&.equals(java\&.lang\&.Object) \fP
+-.fi
+-.nf
+-\f3@see java\&.lang\&.Object#wait(long) // java\&.lang\&.Object\&.wait(long) \fP
+-.fi
+-.nf
+-\f3@see Character#MAX_RADIX // Character\&.MAX_RADIX \fP
+-.fi
+-.nf
+-\f3@see <a href="spec\&.html">Java Spec</a> // Java Spec \fP
+-.fi
+-.nf
+-\f3@see "The Java Programming Language" // "The Java Programming Language" \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fINote:\fR You can extend the \f3@se\fR\f3e\fR tag to link to classes not being documented with the \f3-link\fR option\&.
+-.TP
+-@serial \fIfield-description\fR | include | exclude
+-Introduced in JDK 1\&.2
+-
+-Used in the documentation comment for a default serializable field\&. See Documenting Serializable Fields and Data for a Class at http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial-arch\&.html#5251
+-
+-See also Oracle\(cqs Criteria for Including Classes in the Serialized Form Specification at http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized-criteria-137781\&.html
+-
+-An optional \f3field-description\fR should explain the meaning of the field and list the acceptable values\&. When needed, the description can span multiple lines\&. The standard doclet adds this information to the serialized form page\&. See Cross-Reference Pages\&.
+-
+-If a serializable field was added to a class after the class was made serializable, then a statement should be added to its main description to identify at which version it was added\&.
+-
+-The \f3include\fR and \f3exclude\fR arguments identify whether a class or package should be included or excluded from the serialized form page\&. They work as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-A public or protected class that implements \f3Serializable\fR is included unless that class (or its package) is marked with the \f3@serial exclude\fR tag\&.
+-.TP 0.2i
+-\(bu
+-A private or package-private class that implements \f3Serializable\fR is excluded unless that class (or its package) is marked with the \f3@serial include\fR tag\&.
+-.RE
+-
+-
+-For example, the \f3javax\&.swing\fR package is marked with the \f3@serial\fR\f3exclude\fR tag in package\&.html or package-info\&.java\&. The public class \f3java\&.security\&.BasicPermission\fR is marked with the \f3@serial exclude\fR tag\&. The package-private class \f3java\&.util\&.PropertyPermissionCollection\fR is marked with the \f3@serial include\fR tag\&.
+-
+-The \f3@serial\fR tag at the class level overrides the \f3@serial\fR tag at the package level\&.
+-.TP
+-@serialData \fIdata-description\fR
+-Introduced in JDK 1\&.2
+-
+-Uses the data description value to document the types and order of data in the serialized form\&. This data includes the optional data written by the \f3writeObject\fR method and all data (including base classes) written by the \f3Externalizable\&.writeExternal\fR method\&.
+-
+-The \f3@serialData\fR tag can be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
+-.TP
+-@serialField \fIfield-name\fR\fIfield-type\fR\fIfield-description\fR
+-Introduced in JDK 1\&.2
+-
+-Documents an \f3ObjectStreamField\fR component of the \f3serialPersistentFields\fR member of a \f3Serializable\fR class\&. Use one \f3@serialField\fR tag for each \f3ObjectStreamField\fR component\&.
+-.TP
+-@since \fIsince-text\fR
+-Introduced in JDK 1\&.1
+-
+-Adds a \fISince\fR heading with the specified \f3since-text\fR value to the generated documentation\&. The text has no special internal structure\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. This tag means that this change or feature has existed since the software release specified by the \f3since-text\fR value, for example: \f3@since 1\&.5\fR\&.
+-
+-For Java platform source code, the \f3@since\fR tag indicates the version of the Java platform API specification, which is not necessarily when the source code was added to the reference implementation\&. Multiple \f3@since\fR tags are allowed and are treated like multiple \f3@author\fR tags\&. You could use multiple tags when the program element is used by more than one API\&.
+-.TP
+-@throws \fIclass-name\fR\fIdescription\fR
+-Introduced in JDK 1\&.2
+-
+-Behaves the same as the \f3@exception\fR tag\&. See @throws in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@exception
+-
+-The \f3@throws\fR tag adds a \fIThrows\fR subheading to the generated documentation, with the \f3class-name\fR and \f3description\fR text\&. The \fIclass-name\fR is the name of the exception that might be thrown by the method\&. This tag is valid only in the documentation comment for a method or constructor\&. If this class is not fully specified, then the \f3javadoc\fR command uses the search order to look up this class\&. Multiple \f3@throws\fR tags can be used in a specified documentation comment for the same or different exceptions\&. See Search Order for the @see Tag\&.
+-
+-To ensure that all checked exceptions are documented, when an \f3@throws\fR tag does not exist for an exception in the throws clause, the \f3javadoc\fR command adds that exception to the HTML output (with no description) as though it were documented with the \f3@throws\fR tag\&.
+-
+-The \f3@throws\fR documentation is copied from an overridden method to a subclass only when the exception is explicitly declared in the overridden method\&. The same is true for copying from an interface method to an implementing method\&. You can use the \f3{@inheritDoc}\fR tag to force the \f3@throws\fR tag to inherit documentation\&.
+-.TP
+-{@value \fIpackage\&.class#field\fR}
+-Introduced in JDK 1\&.4
+-
+-Displays constant values\&. When the \f3{@value}\fR tag is used without an argument in the documentation comment of a static field, it displays the value of that constant:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * The value of this constant is {@value}\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public static final String SCRIPT_START = "<script>"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When used with the argument \f3package\&.class#field\fR in any documentation comment, he \f3{@value}\fR tag displays the value of the specified constant:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Evaluates the script starting with {@value #SCRIPT_START}\&.\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3public String evalScript(String script) {}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The argument \f3package\&.class#field\fR takes a form similar to that of the \f3@see\fR tag argument, except that the member must be a static field\&.
+-
+-The values of these constants are also displayed in Constant Field Values at http://docs\&.oracle\&.com/javase/8/docs/api/constant-values\&.html
+-.TP
+-@version \fIversion-text\fR
+-Introduced in JDK 1\&.0
+-
+-Adds a \fIVersion\fR subheading with the specified \f3version-text\fR value to the generated documents when the \f3-version\fR option is used\&. This tag is intended to hold the current release number of the software that this code is part of, as opposed to the\f3@since\fR tag, which holds the release number where this code was introduced\&. The \f3version-text\fR value has no special internal structure\&. See @version in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@version
+-
+-A documentation comment can contain multiple \f3@version\fR tags\&. When it makes sense, you can specify one release number per \f3@version\fR tag or multiple release numbers per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and a space between the names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line when you want a localized name separator other than a comma\&.
+-.SH WHERE\ TAGS\ CAN\ BE\ USED
+-The following sections describe where tags can be used\&. Note that the following tags can be used in all documentation comments: \f3@see\fR, \f3@since\fR, \f3@deprecated\fR, \f3{@link}\fR, \f3{@linkplain}\fR, and \f3{@docroot}\fR\&.
+-.SS OVERVIEW\ TAGS
+-Overview tags are tags that can appear in the documentation comment for the overview page (which resides in the source file typically named overview\&.html)\&. Similar to any other documentation comments, these tags must appear after the main description
+-.PP
+-\fINote:\fR The \f3{@link}\fR tag has a bug in overview documents in Java SE 1\&.2\&. The text appears correctly but has no link\&. The \f3{@docRoot}\fR tag does not currently work in overview documents\&.
+-.PP
+-The overview tags are the following:
+-.PP
+-@see reference || @since since-text || @serialField field-name field-type field-description || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.SS PACKAGE\ TAGS
+-Package tags are tags that can appear in the documentation comment for a package, that resides in the source file named package\&.html or package-info\&.java\&. The \f3@serial\fR tag can only be used here with the \f3include\fR or \f3exclude\fR argument\&.
+-.PP
+-The package tags are the following:
+-.PP
+-@see reference || @since since-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@linkplain package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.SS CLASS\ AND\ INTERFACE\ TAGS
+-The following are tags that can appear in the documentation comment for a class or interface\&. The \f3@serial\fR tag can only be used within the documentation for a class or interface with an \f3include\fR or \f3exclude\fR argument\&.
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
+-.PP
+-Class comment example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * A class representing a window on the screen\&.\fP
+-.fi
+-.nf
+-\f3 * For example:\fP
+-.fi
+-.nf
+-\f3 * <pre>\fP
+-.fi
+-.nf
+-\f3 * Window win = new Window(parent);\fP
+-.fi
+-.nf
+-\f3 * win\&.show();\fP
+-.fi
+-.nf
+-\f3 * </pre>\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @author Sami Shaio\fP
+-.fi
+-.nf
+-\f3 * @version 1\&.13, 06/08/06\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\&.BaseWindow\fP
+-.fi
+-.nf
+-\f3 * @see java\&.awt\&.Button\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3class Window extends BaseWindow {\fP
+-.fi
+-.nf
+-\f3 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS FIELD\ TAGS
+-These tags can appear in fields:
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @serialField field-name field-type field-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || {@value package\&.class#field}
+-.PP
+-Field comment example:
+-.sp
+-.nf
+-\f3 /**\fP
+-.fi
+-.nf
+-\f3 * The X\-coordinate of the component\&.\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @see #getLocation()\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3 int x = 1263732;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS CONSTRUCTOR\ AND\ METHOD\ TAGS
+-The following tags can appear in the documentation comment for a constructor or a method, except for the \f3@return\fR tag, which cannot appear in a constructor, and the \f3{@inheritDoc}\fR tag, which has restrictions\&.
+-.PP
+-@see reference || @since since-text || @deprecated deprecated-text || @param parameter-name description || @return description || @throws class-name description || @exception class-name description || @serialData data-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@inheritDoc} || {@docRoot}
+-.PP
+-\fINote:\fR The \f3@serialData\fR tag can only be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
+-.PP
+-Method comment example:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * Returns the character at the specified index\&. An index \fP
+-.fi
+-.nf
+-\f3 * ranges from <code>0</code> to <code>length() \- 1</code>\fP
+-.fi
+-.nf
+-\f3 *\fP
+-.fi
+-.nf
+-\f3 * @param index the index of the desired character\&.\fP
+-.fi
+-.nf
+-\f3 * @return the desired character\&.\fP
+-.fi
+-.nf
+-\f3 * @exception StringIndexOutOfRangeException \fP
+-.fi
+-.nf
+-\f3 * if the index is not in the range <code>0</code> \fP
+-.fi
+-.nf
+-\f3 * to <code>length()\-1</code>\fP
+-.fi
+-.nf
+-\f3 * @see java\&.lang\&.Character#charValue()\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3 public char charAt(int index) {\fP
+-.fi
+-.nf
+-\f3 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-The \f3javadoc\fR command uses doclets to determine its output\&. The \f3javadoc\fR command uses the default standard doclet unless a custom doclet is specified with the \f3-doclet\fR option\&. The \f3javadoc\fR command provides a set of command-line options that can be used with any doclet\&. These options are described in Javadoc Options\&. The standard doclet provides an additional set of command-line options that are described in Standard Doclet Options\&. All option names are not case-sensitive, but their arguments are case-sensitive\&.
+-.TP 0.2i
+-\(bu
+-See also Javadoc Options
+-.TP 0.2i
+-\(bu
+-See also Standard Doclet Options
+-.PP
+-The options are:
+-.PP
+--1\&.1 || -author || -bootclasspath classpathlist || -bottom text || -breakiterator || -charset name || -classpath classpathlist || -d directory || -docencoding name || -docfilesubdirs || -doclet class || -docletpath classpathlist || -doctitle title || -encoding || -exclude packagename1:packagename2:\&.\&.\&. || -excludedocfilessubdir name1:name2 || -extdirs dirist || -footer footer || -group groupheading packagepattern:packagepattern || -header header || -help || -helpfile path\efilename || -Jflag || -javafx ||-keywords || -link extdocURL || -linkoffline extdocURL packagelistLoc || -linksource || -locale language_country_variant || -nocomment || -nodeprecated || -nodeprecatedlist || -nohelp || -noindex || -nonavbar || -noqualifier all | packagename1:packagename2\&.\&.\&. || -nosince || -notimestamp || -notree || -overview path/filename || -package || -private || -protected || -public || -quiet || -serialwarn || -source release || -sourcepath sourcepathlist || -sourcetab tablength || -splitindex || -stylesheet path/filename || -subpackages package1:package2:\&.\&.\&. || -tag tagname:Xaoptcmf:"taghead" || -taglet class || -tagletpath tagletpathlist || -title title || -top || -use || -verbose || -version || -windowtitle title
+-.PP
+-The following options are the core Javadoc options that are available to all doclets\&. The standard doclet provides the rest of the doclets: \f3-bootclasspath\fR, \f3-breakiterator\fR, \f3-classpath\fR, \f3-doclet\fR, \f3-docletpath\fR, \f3-encoding\fR, -\f3exclude\fR, \f3-extdirs\fR, \f3-help\fR, \f3-locale\fR, \f3-\fR\f3overview\fR, \f3-package\fR, \f3-private\fR, \f3-protected\fR, \f3-public\fR, \f3-quiet\fR, \f3-source\fR, \f3-sourcepath\fR, \f3-subpackages\fR, and \f3-verbose\fR\&.
+-.SS JAVADOC\ OPTIONS
+-.TP
+--overview \fIpath/filename\fR
+-.br
+-Specifies that the \f3javadoc\fR command should retrieve the text for the overview documentation from the source file specified by the \fIpath/filename\fRand place it on the Overview page (overview-summary\&.html)\&. The \fIpath/filename\fRis relative to the current directory\&.
+-
+-While you can use any name you want for the \f3filename\fR value and place it anywhere you want for the path, it is typical to name it overview\&.html and place it in the source tree at the directory that contains the topmost package directories\&. In this location, no path is needed when documenting packages, because the \f3-sourcepath\fR option points to this file\&.
+-
+-For example, if the source tree for the \f3java\&.lang\fR package is /src/classes/java/lang/, then you could place the overview file at /src/classes/overview\&.html
+-
+-See Real-World Examples\&.
+-
+-For information about the file specified by \fIpath/filename,\fRsee Overview Comment Files\&.
+-
+-The overview page is created only when you pass two or more package names to the \f3javadoc\fR command\&. For a further explanation, see HTML Frames\&. The title on the overview page is set by \f3-doctitle\fR\&.
+-.TP
+--Xdoclint:(all|none|[-]\fI<group>\fR)
+-.br
+-Reports warnings for bad references, lack of accessibility and missing Javadoc comments, and reports errors for invalid Javadoc syntax and missing HTML tags\&.
+-
+-This option enables the \f3javadoc\fR command to check for all documentation comments included in the generated output\&. As always, you can select which items to include in the generated output with the standard options \f3-public\fR, \f3-protected\fR, \f3-package\fR and \f3-private\fR\&.
+-
+-When the \f3-Xdoclint\fR is enabled, it reports issues with messages similar to the \f3javac\fR command\&. The \f3javadoc\fR command prints a message, a copy of the source line, and a caret pointing at the exact position where the error was detected\&. Messages may be either warnings or errors, depending on their severity and the likelihood to cause an error if the generated documentation were run through a validator\&. For example, bad references or missing Javadoc comments do not cause the \f3javadoc\fR command to generate invalid HTML, so these issues are reported as warnings\&. Syntax errors or missing HTML end tags cause the \f3javadoc\fR command to generate invalid output, so these issues are reported as errors\&.
+-
+-By default, the \f3-Xdoclint\fR option is enabled\&. Disable it with the option \f3-Xdoclint:none\fR\&.
+-
+-Change what the \f3-Xdoclint\fR option reports with the following options:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint none\fR : disable the \f3-Xdoclint\fR option
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint\fR\fIgroup\fR : enable \fIgroup\fR checks
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint all\fR : enable all groups of checks
+-.TP 0.2i
+-\(bu
+-\f3-Xdoclint all,\fR\fI-group\fR : enable all except \fIgroup\fR checks
+-.RE
+-
+-
+-The variable \fIgroup\fR has one of the following values:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3accessibility\fR : Checks for the issues to be detected by an accessibility checker (for example, no caption or summary attributes specified in a \f3<table>\fR tag)\&.
+-.TP 0.2i
+-\(bu
+-\f3html\fR : Detects high-level HTML issues, like putting block elements inside inline elements, or not closing elements that require an end tag\&. The rules are derived from theHTML 4\&.01 Specification\&. This type of check enables the \f3javadoc\fR command to detect HTML issues that many browsers might accept\&.
+-.TP 0.2i
+-\(bu
+-\f3missing\fR : Checks for missing Javadoc comments or tags (for example, a missing comment or class, or a missing \f3@return\fR tag or similar tag on a method)\&.
+-.TP 0.2i
+-\(bu
+-\f3reference\fR : Checks for issues relating to the references to Java API elements from Javadoc tags (for example, item not found in \f3@see\fR , or a bad name after \f3@param)\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3syntax\fR : Checks for low level issues like unescaped angle brackets (\f3<\fR and \f3>\fR) and ampersands (\f3&\fR) and invalid Javadoc tags\&.
+-.RE
+-
+-
+-You can specify the \f3-Xdoclint\fR option multiple times to enable the option to check errors and warnings in multiple categories\&. Alternatively, you can specify multiple error and warning categories by using the preceding options\&. For example, use either of the following commands to check for the HTML, syntax, and accessibility issues in the file \fIfilename\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-Xdoclint:html \-Xdoclint:syntax \-Xdoclint:accessibility \fIfilename\fR\fP
+-.fi
+-.nf
+-\f3javadoc \-Xdoclint:html,syntax,accessibility \fIfilename\fR\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR The \f3javadoc\fR command does not guarantee the completeness of these checks\&. In particular, it is not a full HTML compliance checker\&. The goal of the -\f3Xdoclint\fR option is to enable the \f3javadoc\fR command to report majority of common errors\&.
+-
+-The \f3javadoc\fR command does not attempt to fix invalid input, it just reports it\&.
+-.TP
+--public
+-.br
+-Shows only public classes and members\&.
+-.TP
+--protected
+-.br
+-Shows only protected and public classes and members\&. This is the default\&.
+-.TP
+--package
+-.br
+-Shows only package, protected, and public classes and members\&.
+-.TP
+--private
+-.br
+-Shows all classes and members\&.
+-.TP
+--help
+-.br
+-Displays the online help, which lists all of the \f3javadoc\fR and \f3doclet\fR command-line options\&.
+-.TP
+--doclet \fIclass\fR
+-.br
+-Specifies the class file that starts the doclet used in generating the documentation\&. Use the fully qualified name\&. This doclet defines the content and formats the output\&. If the \f3-doclet\fR option is not used, then the \f3javadoc\fR command uses the standard doclet for generating the default HTML format\&. This class must contain the \f3start(Root)\fR method\&. The path to this starting class is defined by the \f3-docletpath\fR option\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.TP
+--docletpath \fIclasspathlist\fR
+-.br
+-Specifies the path to the doclet starting class file (specified with the \f3-doclet\fR option) and any JAR files it depends on\&. If the starting class file is in a JAR file, then this option specifies the path to that JAR file\&. You can specify an absolute path or a path relative to the current directory\&. If \f3classpathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semi-colon (;) on Windows\&. This option is not necessary when the doclet starting class is already in the search path\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.TP
+--1\&.1
+-.br
+-Removed from Javadoc 1\&.4 with no replacement\&. This option created documentation with the appearance and functionality of documentation generated by Javadoc 1\&.1 (it never supported nested classes)\&. If you need this option, then use Javadoc 1\&.2 or 1\&.3 instead\&.
+-.TP
+--source \fIrelease\fR
+-.br
+-Specifies the release of source code accepted\&. The following values for the \f3release\fR parameter are allowed\&. Use the value of \f3release\fR that corresponds to the value used when you compile code with the \f3javac\fR command\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.5\fR\&. The \f3javadoc\fR command accepts code containing generics and other language features introduced in JDK 1\&.5\&. The compiler defaults to the 1\&.5 behavior when the \f3-source\fR option is not used\&.
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.4\fR\&. The \f3javadoc\fR command accepts code containing assertions, which were introduced in JDK 1\&.4\&.
+-.TP 0.2i
+-\(bu
+-\fIRelease Value: 1\&.3\fR\&. The \f3javadoc\fR command does not support assertions, generics, or other language features introduced after JDK 1\&.3\&.
+-.RE
+-
+-.TP
+--sourcepath \fIsourcepathlist\fR
+-.br
+-Specifies the search paths for finding source files when passing package names or the \f3-subpackages\fR option into the \f3javadoc\fR command\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Note that this option is not only used to locate the source files being documented, but also to find source files that are not being documented, but whose comments are inherited by the source files being documented\&.
+-
+-You can use the \f3-sourcepath\fR option only when passing package names into the \f3javadoc\fR command\&. This will not locate source files passed into the \f3javadoc\fR command\&. To locate source files, \f3\fRchange to that directory or include the path ahead of each file, as shown at Document One or More Classes\&. If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses the class path to find the source files (see \f3-classpath\fR)\&. The default \f3-sourcepath\fR is the value of class path\&. If \f3-classpath\fR is omitted and you pass package names into the \f3javadoc\fR command, then the \f3javadoc\fR command searches in the current directory and subdirectories for the source files\&.
+-
+-Set \f3sourcepathlist\fR to the root directory of the source tree for the package you are documenting\&.
+-
+-For example, suppose you want to document a package called \f3com\&.mypackage\fR, whose source files are located at:/home/user/src/com/mypackage/*\&.java\&. Specify the sourcepath to /home/user/src, the directory that contains com\emypackage, and then supply the package name, as follows:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/src/ com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Notice that if you concatenate the value of sourcepath and the package name together and change the dot to a slash (/), then you have the full path to the package:
+-
+-/home/user/src/com/mypackage
+-
+-To point to two source paths:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user1/src:/home/user2/src com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--classpath \fIclasspathlist\fR
+-.br
+-Specifies the paths where the \f3javadoc\fR command searches for referenced classes These are the documented classes plus any classes referenced by those classes\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Follow the instructions in the class path documentation for specifying the \f3classpathlist\fR value\&.
+-
+-If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses \f3-classpath\fR to find the source files and class files (for backward compatibility)\&. If you want to search for source and class files in separate paths, then use both \f3-sourcepath\fR and \f3-classpath\fR\&.
+-
+-For example, if you want to document \f3com\&.mypackage\fR, whose source files reside in the directory /home/user/src/com/mypackage, and if this package relies on a library in /home/user/lib, then you would use the following command:
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/lib \-classpath /home/user/src com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Similar to other tools, if you do not specify \f3-classpath\fR, then the \f3javadoc\fR command uses the \f3CLASSPATH\fR environment variable when it is set\&. If both are not set, then the \f3javadoc\fR command searches for classes from the current directory\&.
+-
+-For an in-depth description of how the \f3javadoc\fR command uses \f3-classpath\fR to find user classes as it relates to extension classes and bootstrap classes, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-
+-A class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
+-
+-For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JA\fRR, then the class path element \f3foo/*\fR is expanded to a \f3A\&.jar:b\&.JAR\fR, except that the order of JAR files is unspecified\&. All JAR files in the specified directory including hidden files are included in the list\&. A class path entry that consists of * expands to a list of all the jar files in the current directory\&. The \f3CLASSPATH\fR environment variable is similarly expanded\&. Any class path wildcard expansion occurs before the Java Virtual Machine (JVM) starts\&. No Java program ever sees unexpanded wild cards except by querying the environment, for example, by calling System\&.getenv(\f3"CLASSPATH"\fR)\&.
+-.TP
+--subpackages \fIpackage1:package2:\&.\&.\&.\fR
+-.br
+-Generates documentation from source files in the specified packages and recursively in their subpackages\&. This option is useful when adding new subpackages to the source code because they are automatically included\&. Each package argument is any top-level subpackage (such as \f3java\fR) or fully qualified package (such as \f3javax\&.swing\fR) that does not need to contain source files\&. Arguments are separated by colons on all operating systems\&. Wild cards are not allowed\&. Use \f3-sourcepath\fR to specify where to find the packages\&. This option does not process source files that are in the source tree but do not belong to the packages\&. See Process Source Files\&.
+-
+-For example, the following command generates documentation for packages named \f3java\fR and \f3javax\&.swing\fR and all of their subpackages\&.
+-.sp
+-.nf
+-\f3javadoc \-d docs \-sourcepath /home/user/src \-subpackages java:javax\&.swing \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--exclude \fIpackagename1:packagename2:\&.\&.\&.\fR
+-.br
+-Unconditionally excludes the specified packages and their subpackages from the list formed by \f3-subpackages\fR\&. It excludes those packages even when they would otherwise be included by some earlier or later \f3-subpackages\fR option\&.
+-
+-The following example would include \f3java\&.io\fR, \f3java\&.util\fR, and \f3java\&.math\fR (among others), but would exclude packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice that this example excludes \f3java\&.lang\&.ref\fR, which is a subpackage of \f3java\&.lang\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /home/user/src \-subpackages java \-exclude \fP
+-.fi
+-.nf
+-\f3 java\&.net:java\&.lang\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--bootclasspath \fIclasspathlist\fR
+-.br
+-Specifies the paths where the boot classes reside\&. These are typically the Java platform classes\&. The \f3bootclasspath\fR is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. For more information, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-
+-Separate directories in the \f3classpathlist\fR parameters with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
+-.TP
+--extdirs \fIdirist\fR
+-.br
+-Specifies the directories where extension classes reside\&. These are any classes that use the Java Extension mechanism\&. The \f3extdirs\fR option is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. See the \f3-classpath\fR option for more information\&. Separate directories in \f3dirlist\fR with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
+-.TP
+--verbose
+-.br
+-Provides more detailed messages while the \f3javadoc\fR command runs\&. Without the \f3verbose\fR option, messages appear for loading the source files, generating the documentation (one message per source file), and sorting\&. The verbose option causes the printing of additional messages that specify the number of milliseconds to parse each Java source file\&.
+-.TP
+--quiet
+-.br
+-Shuts off messages so that only the warnings and errors appear to make them easier to view\&. It also suppresses the \f3version\fR string\&.
+-.TP
+--breakiterator
+-.br
+-Uses the internationalized sentence boundary of \f3java\&.text\&.BreakIterator\fR to determine the end of the first sentence in the main description of a package, class, or member for English\&. All other locales already use the \f3BreakIterator\fR class, rather than an English language, locale-specific algorithm\&. The first sentence is copied to the package, class, or member summary and to the alphabetic index\&. From JDK 1\&.2 and later, the \f3BreakIterator\fR class is used to determine the end of a sentence for all languages except for English\&. Therefore, the \f3-breakiterator\fR option has no effect except for English from 1\&.2 and later\&. English has its own default algorithm:
+-.RS
+-.TP 0.2i
+-\(bu
+-English default sentence-break algorithm\&. Stops at a period followed by a space or an HTML block tag, such as \f3<P>\fR\&.
+-.TP 0.2i
+-\(bu
+-Breakiterator sentence-break algorithm\&. Stops at a period, question mark, or exclamation point followed by a space when the next word starts with a capital letter\&. This is meant to handle most abbreviations (such as "The serial no\&. is valid", but will not handle "Mr\&. Smith")\&. The \f3-breakiterator\fR option does not stop at HTML tags or sentences that begin with numbers or symbols\&. The algorithm stops at the last period in \&.\&./filename, even when embedded in an HTML tag\&.
+-.RE
+-
+-
+-In Java SE 1\&.5 the \f3-breakiterator\fR option warning messages are removed, and the default sentence-break algorithm is unchanged\&. If you have not modified your source code to eliminate the \f3-breakiterator\fR option warnings in Java SE 1\&.4\&.x, then you do not have to do anything\&. The warnings go away starting with Java SE 1\&.5\&.0\&.
+-.TP
+--locale \fIlanguage_country_variant\fR
+-.br
+-Specifies the locale that the \f3javadoc\fR command uses when it generates documentation\&. The argument is the name of the locale, as described in \f3j\fR\f3ava\&.util\&.Locale\fR documentation, such as \f3en_US\fR (English, United States) or \f3en_US_WIN\fR (Windows variant)\&.
+-
+-\fINote:\fR The \f3-locale\fR option must be placed ahead (to the left) of any options provided by the standard doclet or any other doclet\&. Otherwise, the navigation bars appear in English\&. This is the only command-line option that depends on order\&. See Standard Doclet Options\&.
+-
+-Specifying a locale causes the \f3javadoc\fR command to choose the resource files of that locale for messages such as strings in the navigation bar, headings for lists and tables, help file contents, comments in the stylesheet\&.css file, and so on\&. It also specifies the sorting order for lists sorted alphabetically, and the sentence separator to determine the end of the first sentence\&. The \f3-locale\fR option does not determine the locale of the documentation comment text specified in the source files of the documented classes\&.
+-.TP
+--encoding
+-.br
+-Specifies the encoding name of the source files, such as \f3EUCJIS/SJIS\fR\&. If this option is not specified, then the platform default converter is used\&. See also the\f3-docencoding name\fR and \f3-charset name\fR options\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR directly to the Java Runtime Environment (JRE) that runs the \f3javadoc\fR command\&. For example, if you must ensure that the system sets aside 32 MB of memory in which to process the generated documentation, then you would call the \f3-Xmx\fR option as follows: \f3javadoc -J-Xmx32m -J-Xms32m com\&.mypackage\fR\&. Be aware that \f3-Xms\fR is optional because it only sets the size of initial memory, which is useful when you know the minimum amount of memory required\&.
+-
+-There is no space between the \f3J\fR and the \f3flag\fR\&.
+-
+-Use the \f3-version\fR option to find out what version of the \f3javadoc\fR command you are using\&. The version number of the standard doclet appears in its output stream\&. See Running the Javadoc Command\&.
+-.sp
+-.nf
+-\f3javadoc \-J\-version\fP
+-.fi
+-.nf
+-\f3java version "1\&.7\&.0_09"\fP
+-.fi
+-.nf
+-\f3Java(TM) SE Runtime Environment (build 1\&.7\&.0_09\-b05)\fP
+-.fi
+-.nf
+-\f3Java HotSpot(TM) 64\-Bit Server VM (build 23\&.5\-b02, mixed mode)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--javafx
+-.br
+-Generates HTML documentation using the JavaFX extensions to the standard doclet\&. The generated documentation includes a Property Summary section in addition to the other summary sections generated by the standard Java doclet\&. The listed properties are linked to the sections for the getter and setter methods of each property\&.
+-
+-If there are no documentation comments written explicitly for getter and setter methods, the documentation comments from the property method are automatically copied to the generated documentation for these methods\&. This option also adds a new \f3@defaultValue\fR tag that allows documenting the default value for a property\&.
+-
+-Example:
+-.sp
+-.nf
+-\f3javadoc \-javafx MyClass\&.java \-d testdir\fP
+-.fi
+-.sp
+-
+-.SS STANDARD\ DOCLET\ OPTIONS
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies the destination directory where the \f3javadoc\fR command saves the generated HTML files\&. If you omit the \f3-d\fR option, then the files are saved to the current directory\&. The \f3directory\fR value can be absolute or relative to the current working directory\&. As of Java SE 1\&.4, the destination directory is automatically created when the \f3javadoc\fR command runs\&.
+-
+-For example, the following command generates the documentation for the package \f3com\&.mypackage\fR and saves the results in the /user/doc/ directory: \f3javadoc -d\fR\f3/user/doc/\fR\f3com\&.mypackage\fR\&.
+-.TP
+--use
+-.br
+-Includes one Use page for each documented class and package\&. The page describes what packages, classes, methods, constructors and fields use any API of the specified class or package\&. Given class C, things that use class C would include subclasses of C, fields declared as C, methods that return C, and methods and constructors with parameters of type C\&. For example, you can look at the Use page for the \f3String\fR type\&. Because the \f3getName\fR method in the \f3java\&.awt\&.Font\fR class returns type \f3String\fR, the \f3getName\fR method uses \f3String\fR and so the \f3getName\fR method appears on the Use page for \f3String\fR\&.This documents only uses of the API, not the implementation\&. When a method uses \f3String\fR in its implementation, but does not take a string as an argument or return a string, that is not considered a use of \f3String\fR\&.To access the generated Use page, go to the class or package and click the \fIUse link\fR in the navigation bar\&.
+-.TP
+--version
+-.br
+-Includes the @version text in the generated docs\&. This text is omitted by default\&. To find out what version of the \f3javadoc\fR command you are using, use the \f3-J-version\fR option\&.
+-.TP
+--author
+-.br
+-Includes the \f3@author\fR text in the generated docs\&.
+-.TP
+--splitindex
+-.br
+-Splits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical symbols\&.
+-.TP
+--windowtitle \fItitle\fR
+-.br
+-Specifies the title to be placed in the HTML \f3<title>\fR tag\&. The text specified in the \f3title\fR tag appears in the window title and in any browser bookmarks (favorite places) that someone creates for this page\&. This title should not contain any HTML tags because the browser does not interpret them correctly\&. Use escape characters on any internal quotation marks within the \f3title\fR tag\&. If the \f3-windowtitle\fR option is omitted, then the \f3javadoc\fR command uses the value of the \f3-doctitle\fR option for the \f3-windowtitle\fR option\&. For example, \f3javadoc -windowtitle "Java SE Platform" com\&.mypackage\fR\&.
+-.TP
+--doctitle \fItitle\fR
+-.br
+-Specifies the title to place near the top of the overview summary file\&. The text specified in the \f3title\fR tag is placed as a centered, level-one heading directly beneath the top navigation bar\&. The \f3title\fR tag can contain HTML tags and white space, but when it does, you must enclose the title in quotation marks\&. Internal quotation marks within the \f3title\fR tag must be escaped\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
+-.TP
+--title \fItitle\fR
+-.br
+-No longer exists\&. It existed only in Beta releases of Javadoc 1\&.2\&. It was renamed to \f3-doctitle\fR\&. This option was renamed to make it clear that it defines the document title, rather than the window title\&.
+-.TP
+--header \fIheader\fR
+-.br
+-Specifies the header text to be placed at the top of each output file\&. The header is placed to the right of the upper navigation bar\&. The \f3header\fR can contain HTML tags and white space, but when it does, the \f3header\fR must be enclosed in quotation marks\&. Use escape characters for internal quotation marks within a header\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
+-.TP
+--footer \fIfooter\fR
+-.br
+-Specifies the footer text to be placed at the bottom of each output file\&. The \fIfooter\fR value is placed to the right of the lower navigation bar\&. The \f3footer\fR value can contain HTML tags and white space, but when it does, the \f3footer\fR value must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within a footer\&.
+-.TP
+--top
+-.br
+-Specifies the text to be placed at the top of each output file\&.
+-.TP
+--bottom \fItext\fR
+-.br
+-Specifies the text to be placed at the bottom of each output file\&. The text is placed at the bottom of the page, underneath the lower navigation bar\&. The text can contain HTML tags and white space, but when it does, the text must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within text\&.
+-.TP
+--link \fIextdocURL\fR
+-.br
+-Creates links to existing Javadoc-generated documentation of externally referenced classes\&. The \fIextdocURL\fR argument is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. You can specify multiple \f3-link\fR options in a specified \f3javadoc\fR command run to link to multiple documents\&.
+-
+-The package-list file must be found in this directory (otherwise, use the \f3-linkoffline\fR option)\&. The \f3javadoc\fR command reads the package names from the package-list file and links to those packages at that URL\&. When the \f3javadoc\fR command runs, the \f3extdocURL\fR value is copied into the \f3<A HREF>\fR links that are created\&. Therefore, \f3extdocURL\fR must be the URL to the directory, and not to a file\&. You can use an absolute link for \fIextdocURL\fR to enable your documents to link to a document on any web site, or you can use a relative link to link only to a relative location\&. If you use a relative link, then the value you pass in should be the relative path from the destination directory (specified with the \f3-d\fR option) to the directory containing the packages being linked to\&.When you specify an absolute link, you usually use an HTTP link\&. However, if you want to link to a file system that has no web server, then you can use a file link\&. Use a file link only when everyone who wants to access the generated documentation shares the same file system\&.In all cases, and on all operating systems, use a slash as the separator, whether the URL is absolute or relative, and \f3h\fR\f3ttp:\fR or \f3f\fR\f3ile:\fR as specified in the URL Memo: Uniform Resource Locators at http://www\&.ietf\&.org/rfc/rfc1738\&.txt
+-.sp
+-.nf
+-\f3\-link http://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\-link file://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\-link <directory>/<directory>/\&.\&.\&./<name>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Differences between the -linkoffline and -link options
+-
+-Use the \f3-link\fR option in the following cases:
+-.TP 0.2i
+-\(bu
+-When you use a relative path to the external API document\&.
+-.TP 0.2i
+-\(bu
+-When you use an absolute URL to the external API document if your shell lets you open a connection to that URL for reading\&.
+-.PP
+-Use the \f3-linkoffline\fR option when you use an absolute URL to the external API document, if your shell does not allow a program to open a connection to that URL for reading\&. This can occur when you are behind a firewall and the document you want to link to is on the other side\&.
+-.PP
+-\f3Example 1 Absolute Link to External Documents\fR
+-.PP
+-Use the following command if you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java platform packages, shown at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
+-.sp
+-.nf
+-\f3javadoc \-link http://docs\&.oracle\&.com/javase/8/docs/api/ com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The command generates documentation for the package \f3com\&.mypackage\fR with links to the Java SE packages\&. The generated documentation contains links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other options, such as the \f3-sourcepath\fR and \f3-d\fR options, are not shown\&.
+-.PP
+-\f3Example 2 Relative Link to External Documents\fR
+-.PP
+-In this example, there are two packages with documents that are generated in different runs of the \f3javadoc\fR command, and those documents are separated by a relative path\&. The packages are \f3com\&.apipackage\fR, an API, and c\f3om\&.spipackage\fR, an Service Provide Interface (SPI)\&. You want the documentation to reside in docs/api/com/apipackage and docs/spi/com/spipackage\&. Assuming that the API package documentation is already generated, and that docs is the current directory, you document the SPI package with links to the API documentation by running: \f3javadoc -d \&./spi -link \&.\&./api com\&.spipackage\fR\&.
+-.PP
+-Notice the \f3-link\fR option is relative to the destination directory (docs/spi)\&.
+-.PP
+-Notes
+-
+-The \f3-link\fR option lets you link to classes referenced to by your code, but not documented in the current \f3javadoc\fR command run\&. For these links to go to valid pages, you must know where those HTML pages are located and specify that location with \f3extdocURL\fR\&. This allows third-party documentation to link to java\&.* documentation at http://docs\&.oracle\&.com\&.Omit the \f3-link\fR option when you want the \f3javadoc\fR command to create links only to APIs within the documentation it is generating in the current run\&. Without the \f3-link\fR option, the \f3javadoc\fR command does not create links to documentation for external references because it does not know whether or where that documentation exists\&.The \f3-link\fR option can create links in several places in the generated documentation\&. See Process Source Files\&. Another use is for cross-links between sets of packages: Execute the \f3javadoc\fR command on one set of packages, then run the \f3javadoc\fR command again on another set of packages, creating links both ways between both sets\&.
+-.PP
+-How to Reference a Class
+-
+-For a link to an externally referenced class to appear (and not just its text label), the class must be referenced in the following way\&. It is not sufficient for it to be referenced in the body of a method\&. It must be referenced in either an \f3import\fR statement or in a declaration\&. Here are examples of how the class \f3java\&.io\&.File\fR can be referenced:
+-.PP
+-\fI\fRIn any kind of import statement\&. By wildcard import, import explicitly by name, or automatically import for \f3java\&.lang\&.*\fR\&.
+-.PP
+-In Java SE 1\&.3\&.\fIn\fR and 1\&.2\&.\fIn\fR, only an explicit import by name works\&. A wildcard \f3import\fR statement does not work, nor does the automatic \f3import java\&.lang\&.*\fR\&.
+-.PP
+-\fI\fRIn a declaration: \f3void mymethod(File f) {}\fR
+-.PP
+-The reference can be in the return type or parameter type of a method, constructor, field, class, or interface, or in an implements, extends, or throws statement\&.
+-.PP
+-An important corollary is that when you use the \f3-link\fR option, there can be many links that unintentionally do not appear due to this constraint\&. The text would appear without being a link\&. You can detect these by the warnings they emit\&. The simplest way to properly reference a class and add the link would be to import that class\&.
+-.PP
+-Package List
+-
+-The \f3-link\fR option requires that a file named package-list, which is generated by the \f3javadoc\fR command, exists at the URL you specify with the \f3-link\fR option\&. The package-list file is a simple text file that lists the names of packages documented at that location\&. In the earlier example, the \f3javadoc\fR command searches for a file named package-list at the specified URL, reads in the package names, and links to those packages at that URL\&.
+-.PP
+-For example, the package list for the Java SE API is located at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
+-.PP
+-The package list starts as follows:
+-.sp
+-.nf
+-\f3java\&.applet\fP
+-.fi
+-.nf
+-\f3java\&.awt\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.color\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.datatransfer\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.dnd\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3java\&.awt\&.font\fP
+-.fi
+-.nf
+-\f3and so on \&.\&.\&.\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When \f3javadoc\fR is run without the \f3-link\fR option and encounters a name that belongs to an externally referenced class, it prints the name with no link\&. However, when the \f3-link\fR option is used, the \f3javadoc\fR command searches the package-list file at the specified \fIextdocURL\fR location for that package name\&. When it finds the package name, it prefixes the name with \fIextdocURL\fR\&.
+-.PP
+-For there to be no broken links, all of the documentation for the external references must exist at the specified URLs\&. The \f3javadoc\fR command does not check that these pages exist, but only that the package-list exists\&.
+-.PP
+-Multiple Links
+-
+-You can supply multiple \f3-link\fR options to link to any number of externally generated documents\&. Javadoc 1\&.2 has a known bug that prevents you from supplying more than one \f3-link\fR options\&. This was fixed in Javadoc 1\&.2\&.2\&. Specify a different link option for each external document to link to \f3javadoc -link extdocURL1 -link extdocURL2 \&.\&.\&. -link extdocURLn com\&.mypackage\fR where \fIextdocURL1\fR, \fIextdocURL2\fR, \&.\f3\&.\&. extdocURLn\fR point respectively to the roots of external documents, each of which contains a file named package-list\&.
+-.PP
+-Cross Links
+-
+-Note that bootstrapping might be required when cross-linking two or more documents that were previously generated\&. If package-list does not exist for either document when you run the \f3javadoc\fR command on the first document, then the package-list does not yet exist for the second document\&. Therefore, to create the external links, you must regenerate the first document after you generate the second document\&.
+-.PP
+-In this case, the purpose of first generating a document is to create its package-list (or you can create it by hand if you are certain of the package names)\&. Then, generate the second document with its external links\&. The \f3javadoc\fR command prints a warning when a needed external package-list file does not exist\&.
+-.TP
+--linkoffline \fIextdocURL packagelistLoc\fR
+-.br
+-This option is a variation of the \f3-link\fR option\&. They both create links to Javadoc-generated documentation for externally referenced classes\&. Use the \f3-link\fRo\f3ffline\fR option when linking to a document on the web when the \f3javadoc\fR command cannot access the document through a web connection\&. Use the \f3-linkoffline\fR option when package-list file of the external document is not accessible or does not exist at the \f3extdocURL\fR location, but does exist at a different location that can be specified by \f3packageListLoc\fR (typically local)\&. If \f3extdocURL\fR is accessible only on the World Wide Web, then the \f3-linkoffline\fR option removes the constraint that the \f3javadoc\fR command must have a web connection to generate documentation\&. Another use is as a work-around to update documents: After you have run the \f3javadoc\fR command on a full set of packages, you can run the \f3javadoc\fR command again on a smaller set of changed packages, so that the updated files can be inserted back into the original set\&. Examples follow\&. The \f3-linkoffline\fR option takes two arguments\&. The first is for the string to be embedded in the \f3<a href>\fR links, and the second tells the \f3-linkoffline\fR option where to find package-list:
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3extdocURL\fR value is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. When relative, the value should be the relative path from the destination directory (specified with the \f3-d\fR option) to the root of the packages being linked to\&. For more information, see \fIextdocURL\fR in the \f3-link\fR option\&.
+-.TP 0.2i
+-\(bu
+-The \f3packagelistLoc\fR value is the path or URL to the directory that contains the package-list file for the external documentation\&. This can be a URL (http: or file:) or file path, and can be absolute or relative\&. When relative, make it relative to the current directory from where the \f3javadoc\fR command was run\&. Do not include the package-list file name\&.
+-
+-You can specify multiple \f3-linkoffline\fR options in a specified \f3javadoc\fR command run\&. Before Javadoc 1\&.2\&.2, the \f3-linkfile\fR options could be specified once\&.
+-.RE
+-
+-.PP
+-Absolute Links to External Documents
+-
+-You might have a situation where you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java SE packages at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
+-.PP
+-However, your shell does not have web access\&. In this case, do the following:
+-.TP 0.4i
+-1\&.
+-Open the package-list file in a browser at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
+-.TP 0.4i
+-2\&.
+-Save the file to a local directory, and point to this local copy with the second argument, \f3packagelistLoc\fR\&. In this example, the package list file was saved to the current directory (\&.)\&.
+-.PP
+-The following command generates documentation for the package c\f3om\&.mypackage\fR with links to the Java SE packages\&. The generated documentation will contain links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other necessary options, such as \f3-sourcepath\fR, are not shown\&.
+-.sp
+-.nf
+-\f3javadoc \-linkoffline http://docs\&.oracle\&.com/javase/8/docs/api/ \&. com\&.mypackage \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Relative Links to External Documents
+-
+-It is not very common to use \f3-linkoffline\fR with relative paths, for the simple reason that the \f3-link\fR option is usually enough\&. When you use the \f3-linkoffline\fR option, the package-list file is usually local, and when you use relative links, the file you are linking to is also local, so it is usually unnecessary to give a different path for the two arguments to the \f3-linkoffline\fR option When the two arguments are identical, you can use the \f3-link\fR option\&.
+-.PP
+-Create a package-list File Manually
+-
+-If a package-list file does not exist yet, but you know what package names your document will link to, then you can manually create your own copy of this file and specify its path with \f3packagelistLoc\fR\&. An example would be the previous case where the package list for \f3com\&.spipackage\fR did not exist when \f3com\&.apipackage\fR was first generated\&. This technique is useful when you need to generate documentation that links to new external documentation whose package names you know, but which is not yet published\&. This is also a way of creating package-list files for packages generated with Javadoc 1\&.0 or 1\&.1, where package-list files were not generated\&. Similarly, two companies can share their unpublished package-list files so they can release their cross-linked documentation simultaneously\&.
+-.PP
+-Link to Multiple Documents
+-
+-You can include the \f3-linkoffline\fR option once for each generated document you want to refer to:
+-.sp
+-.nf
+-\f3javadoc \-linkoffline extdocURL1 packagelistLoc1 \-linkoffline extdocURL2\fP
+-.fi
+-.nf
+-\f3packagelistLoc2 \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Update Documents
+-
+-You can also use the \f3-linkoffline\fR option when your project has dozens or hundreds of packages\&. If you have already run the \f3javadoc\fR command on the entire source tree, then you can quickly make small changes to documentation comments and rerun the \f3javadoc\fR command on a portion of the source tree\&. Be aware that the second run works properly only when your changes are to documentation comments and not to declarations\&. If you were to add, remove, or change any declarations from the source code, then broken links could show up in the index, package tree, inherited member lists, Use page, and other places\&.
+-.PP
+-First, create a new destination directory, such as update, for this new small run\&. In this example, the original destination directory is named html\&. In the simplest example, change directory to the parent of html\&. Set the first argument of the \f3-linkoffline\fR option to the current directory (\&.) and set the second argument to the relative path to html, where it can find package-list and pass in only the package names of the packages you want to update:
+-.sp
+-.nf
+-\f3javadoc \-d update \-linkoffline \&. html com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When the \f3javadoc\fR command completes, copy these generated class pages in update/com/package (not the overview or index) to the original files in html/com/package\&.
+-.TP
+--linksource
+-.br
+-Creates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation\&. Links are created for classes, interfaces, constructors, methods, and fields whose declarations are in a source file\&. Otherwise, links are not created, such as for default constructors and generated classes\&.
+-
+-This option exposes all private implementation details in the included source files, including private classes, private fields, and the bodies of private methods, regardless of the \f3-public\fR, \f3-package\fR, \f3-protected\fR, and \f3-private\fR options\&. Unless you also use the \f3-private\fR option, not all private classes or interfaces are accessible through links\&.
+-
+-Each link appears on the name of the identifier in its declaration\&. For example, the link to the source code of the \f3Button\fR class would be on the word \f3Button\fR:
+-.sp
+-.nf
+-\f3public class Button extends Component implements Accessible\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The link to the source code of the \f3getLabel\fR method in the \f3Button\fR class is on the word \f3getLabel\fR:
+-.sp
+-.nf
+-\f3public String getLabel()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--group groupheading \fIpackagepattern:packagepattern\fR
+-.br
+-Separates packages on the overview page into whatever groups you specify, one group per table\&. You specify each group with a different \f3-group\fR option\&. The groups appear on the page in the order specified on the command line\&. Packages are alphabetized within a group\&. For a specified \f3-group\fR option, the packages matching the list of \f3packagepattern\fR expressions appear in a table with the heading \fIgroupheading\fR\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3groupheading\fR can be any text and can include white space\&. This text is placed in the table heading for the group\&.
+-.TP 0.2i
+-\(bu
+-The \f3packagepattern\fR value can be any package name at the start of any package name followed by an asterisk (*)\&. The asterisk is the only wildcard allowed and means match any characters\&. Multiple patterns can be included in a group by separating them with colons (:)\&. If you use an asterisk in a pattern or pattern list, then the pattern list must be inside quotation marks, such as \f3"java\&.lang*:java\&.util"\fR\&.
+-.RE
+-
+-
+-When you do not supply a \f3-group\fR option, all packages are placed in one group with the heading \fIPackages\fR and appropriate subheadings\&. If the subheadings do not include all documented packages (all groups), then the remaining packages appear in a separate group with the subheading Other Packages\&.
+-
+-For example, the following \f3javadoc\fR command separates the three documented packages into \fICore\fR, \fIExtension\fR, and \fIOther Packages\fR\&. The trailing dot (\&.) does not appear in \f3java\&.lang*\fR\&. Including the dot, such as \f3java\&.lang\&.*\fR omits the\f3java\&.lang\fR package\&.
+-.sp
+-.nf
+-\f3javadoc \-group "Core Packages" "java\&.lang*:java\&.util"\fP
+-.fi
+-.nf
+-\f3 \-group "Extension Packages" "javax\&.*"\fP
+-.fi
+-.nf
+-\f3 java\&.lang java\&.lang\&.reflect java\&.util javax\&.servlet java\&.new\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fICore Packages\fR
+-
+-\f3java\&.lang\fR
+-
+-\f3java\&.lang\&.reflect\fR
+-
+-\f3java\&.util\fR
+-
+-\fIExtension Packages\fR
+-
+-\f3javax\&.servlet\fR
+-
+-\fIOther Packages\fR
+-
+-\f3java\&.new\fR
+-.TP
+--nodeprecated
+-.br
+-Prevents the generation of any deprecated API in the documentation\&. This does what the \f3-nodeprecatedlist\fR option does, and it does not generate any deprecated API throughout the rest of the documentation\&. This is useful when writing code when you do not want to be distracted by the deprecated code\&.
+-.TP
+--nodeprecatedlist
+-.br
+-Prevents the generation of the file that contains the list of deprecated APIs (deprecated-list\&.html) and the link in the navigation bar to that page\&. The \f3javadoc\fR command continues to generate the deprecated API throughout the rest of the document\&. This is useful when your source code contains no deprecated APIs, and you want to make the navigation bar cleaner\&.
+-.TP
+--nosince
+-.br
+-Omits from the generated documents the \f3Since\fR sections associated with the \f3@since\fR tags\&.
+-.TP
+--notree
+-.br
+-Omits the class/interface hierarchy pages from the generated documents\&. These are the pages you reach using the Tree button in the navigation bar\&. The hierarchy is produced by default\&.
+-.TP
+--noindex
+-.br
+-Omits the index from the generated documents\&. The index is produced by default\&.
+-.TP
+--nohelp
+-.br
+-Omits the HELP link in the navigation bars at the top and bottom of each page of output\&.
+-.TP
+--nonavbar
+-.br
+-Prevents the generation of the navigation bar, header, and footer, that are usually found at the top and bottom of the generated pages\&. The \f3-nonavbar\fR option has no affect on the \f3-bottom\fR option\&. The \f3-nonavbar\fR option is useful when you are interested only in the content and have no need for navigation, such as when you are converting the files to PostScript or PDF for printing only\&.
+-.TP
+--helpfile \fIpath\efilename\fR
+-.br
+-Specifies the path of an alternate help file path\efilename that the HELP link in the top and bottom navigation bars link to\&. Without this option, the \f3javadoc\fR command creates a help file help-doc\&.html that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to help-doc\&.html\&. The \f3javadoc\fR command adjusts the links in the navigation bar accordingly, for example:
+-.sp
+-.nf
+-\f3javadoc \-helpfile /home/user/myhelp\&.html java\&.awt\&.\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--stylesheet \fIpath/filename\fR
+-.br
+-Specifies the path of an alternate HTML stylesheet file\&. Without this option, the \f3javadoc\fR command automatically creates a stylesheet file stylesheet\&.css that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to stylesheet\&.css, for example:
+-.sp
+-.nf
+-\f3javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--serialwarn
+-.br
+-Generates compile-time warnings for missing \f3@serial\fR tags\&. By default, Javadoc 1\&.2\&.2 and later versions generate no serial warnings\&. This is a reversal from earlier releases\&. Use this option to display the serial warnings, which helps to properly document default serializable fields and \f3writeExternal\fR methods\&.
+-.TP
+--charset \fIname\fR
+-.br
+-Specifies the HTML character set for this document\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
+-
+-For example, \f3javadoc -charset "iso-8859-1" mypackage\fR inserts the following line in the head of every generated page:
+-.sp
+-.nf
+-\f3<META http\-equiv="Content\-Type" content="text/html; charset=ISO\-8859\-1">\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This \f3META\fR tag is described in the HTML standard (4197265 and 4137321), HTML Document Representation, at http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
+-
+-See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
+-.TP
+--docencoding \fIname\fR
+-.br
+-Specifies the encoding of the generated HTML files\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
+-
+-If you omit the \f3-docencoding\fR option but use the \f3-encoding\fR option, then the encoding of the generated HTML files is determined by the \f3-encoding\fR option, for example: \f3javadoc -docencoding "iso-8859-1" mypackage\fR\&. See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
+-.TP
+--keywords
+-.br
+-Adds HTML keyword <META> tags to the generated file for each class\&. These tags can help search engines that look for <META> tags find the pages\&. Most search engines that search the entire Internet do not look at <META> tags, because pages can misuse them\&. Search engines offered by companies that confine their searches to their own website can benefit by looking at <META> tags\&. The <META> tags include the fully qualified name of the class and the unqualified names of the fields and methods\&. Constructors are not included because they are identical to the class name\&. For example, the class \f3String\fR starts with these keywords:
+-.sp
+-.nf
+-\f3<META NAME="keywords" CONTENT="java\&.lang\&.String class">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="CASE_INSENSITIVE_ORDER">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="length()">\fP
+-.fi
+-.nf
+-\f3<META NAME="keywords" CONTENT="charAt()">\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--tag \fItagname\fR:Xaoptcmf:"\fItaghead\fR"
+-.br
+-Enables the \f3javadoc\fR command to interpret a simple, one-argument \f3@tagname\fR custom block tag in documentation comments\&. For the \f3javadoc\fR command to spell-check tag names, it is important to include a \f3-tag\fR option for every custom tag that is present in the source code, disabling (with \f3X\fR) those that are not being output in the current run\&.The colon (:) is always the separator\&. The \f3-tag\fR option outputs the tag heading \fItaghead\fR in bold, followed on the next line by the text from its single argument\&. Similar to any block tag, the argument text can contain inline tags, which are also interpreted\&. The output is similar to standard one-argument tags, such as the \f3@return\fR and \f3@author\fR tags\&. Omitting a value for \fItaghead\fR causes \f3tagname\fR to be the heading\&.
+-
+-\fIPlacement of tags\fR: The \f3Xaoptcmf\fR arguments determine where in the source code the tag is allowed to be placed, and whether the tag can be disabled (using \f3X\fR)\&. You can supply either \f3a\fR, to allow the tag in all places, or any combination of the other letters:
+-
+-\f3X\fR (disable tag)
+-
+-\f3a\fR (all)
+-
+-\f3o\fR (overview)
+-
+-\f3p\fR (packages)
+-
+-\f3t\fR (types, that is classes and interfaces)
+-
+-\f3c\fR (constructors)
+-
+-\f3m\fR (methods)
+-
+-\f3f\fR (fields)
+-
+-\fIExamples of single tags\fR: An example of a tag option for a tag that can be used anywhere in the source code is: \f3-tag todo:a:"To Do:"\fR\&.
+-
+-If you want the \f3@todo\fR tag to be used only with constructors, methods, and fields, then you use: \f3-tag todo:cmf:"To Do:"\fR\&.
+-
+-Notice the last colon (:) is not a parameter separator, but is part of the heading text\&. You would use either tag option for source code that contains the \f3@todo\fR tag, such as: \f3@todo The documentation for this method needs work\fR\&.
+-
+-\fIColons in tag names\fR: Use a backslash to escape a colon that you want to use in a tag name\&. Use the \f3-tag ejb\e\e:bean:a:"EJB Bean:"\fR option for the following documentation comment:
+-.sp
+-.nf
+-\f3/**\fP
+-.fi
+-.nf
+-\f3 * @ejb:bean\fP
+-.fi
+-.nf
+-\f3 */\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fISpell-checking tag names\fR: Some developers put custom tags in the source code that they do not always want to output\&. In these cases, it is important to list all tags that are in the source code, enabling the ones you want to output and disabling the ones you do not want to output\&. The presence of \f3X\fR disables the tag, while its absence enables the tag\&. This gives the \f3javadoc\fR command enough information to know whether a tag it encounters is unknown, which is probably the results of a typographical error or a misspelling\&. The \f3javadoc\fR command prints a warning in these cases\&. You can add \f3X\fR to the placement values already present, so that when you want to enable the tag, you can simply delete the \f3X\fR\&. For example, if the \f3@todo\fR tag is a tag that you want to suppress on output, then you would use: \f3-tag todo:Xcmf:"To Do:"\fR\&. If you would rather keep it simple, then use this: \f3-tag todo:X\fR\&. The syntax \f3-tag todo:X\fR works even when the \f3@todo\fR tag is defined by a taglet\&.
+-
+-\fIOrder of tags\fR: The order of the \f3-ta\fR\f3g\fR and \f3-taglet\fR options determines the order the tags are output\&. You can mix the custom tags with the standard tags to intersperse them\&. The tag options for standard tags are placeholders only for determining the order\&. They take only the standard tag\&'s name\&. Subheadings for standard tags cannot be altered\&. This is illustrated in the following example\&.If the \f3-tag\fR option is missing, then the position of the \f3-tagle\fR\f3t\fR option determines its order\&. If they are both present, then whichever appears last on the command line determines its order\&. This happens because the tags and taglets are processed in the order that they appear on the command line\&. For example, if the \f3-taglet\fR and \f3-tag\fR options have the name \f3todo\fR value, then the one that appears last on the command line determines the order\&.
+-
+-\fIExample of a complete set of tags\fR: This example inserts To Do after Parameters and before Throws in the output\&. By using \f3X\fR, it also specifies that the \f3@example\fR tag might be encountered in the source code that should not be output during this run\&. If you use the \f3@argfile\fR tag, then you can put the tags on separate lines in an argument file similar to this (no line continuation characters needed):
+-.sp
+-.nf
+-\f3\-tag param\fP
+-.fi
+-.nf
+-\f3\-tag return\fP
+-.fi
+-.nf
+-\f3\-tag todo:a:"To Do:"\fP
+-.fi
+-.nf
+-\f3\-tag throws\fP
+-.fi
+-.nf
+-\f3\-tag see\fP
+-.fi
+-.nf
+-\f3\-tag example:X\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-When the \f3javadoc\fR command parses the documentation comments, any tag encountered that is neither a standard tag nor passed in with the \f3-tag\fR or \f3-taglet\fR options is considered unknown, and a warning is thrown\&.
+-
+-The standard tags are initially stored internally in a list in their default order\&. Whenever the \f3-tag\fR options are used, those tags get appended to this list\&. Standard tags are moved from their default position\&. Therefore, if a \f3-tag\fR option is omitted for a standard tag, then it remains in its default position\&.
+-
+-\fIAvoiding conflicts\fR: If you want to create your own namespace, then you can use a dot-separated naming convention similar to that used for packages: \f3com\&.mycompany\&.todo\fR\&. Oracle will continue to create standard tags whose names do not contain dots\&. Any tag you create will override the behavior of a tag by the same name defined by Oracle\&. If you create a \f3@todo\fR tag or taglet, then it always has the same behavior you define, even when Oracle later creates a standard tag of the same name\&.
+-
+-\fIAnnotations vs\&. Javadoc tags\fR: In general, if the markup you want to add is intended to affect or produce documentation, then it should be a Javadoc tag\&. Otherwise, it should be an annotation\&. See Custom Tags and Annotations in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#annotations
+-
+-You can also create more complex block tags or custom inline tags with the \f3-taglet\fR option\&.
+-.TP
+--taglet \fIclass\fR
+-.br
+-Specifies the class file that starts the taglet used in generating the documentation for that tag\&. Use the fully qualified name for the \f3class\fR value\&. This taglet also defines the number of text arguments that the custom tag has\&. The taglet accepts those arguments, processes them, and generates the output\&. For extensive documentation with example taglets, see: Taglet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html
+-
+-Taglets are useful for block or inline tags\&. They can have any number of arguments and implement custom behavior, such as making text bold, formatting bullets, writing out the text to a file, or starting other processes\&. Taglets can only determine where a tag should appear and in what form\&. All other decisions are made by the doclet\&. A taglet cannot do things such as remove a class name from the list of included classes\&. However, it can execute side effects, such as printing the tag\&'s text to a file or triggering another process\&. Use the \f3-tagletpath\fR option to specify the path to the taglet\&. The following example inserts the To Do taglet after Parameters and ahead of Throws in the generated pages\&. Alternately, you can use the \f3-taglet\fR option in place of its \f3-tag\fR option, but that might be difficult to read\&.
+-.sp
+-.nf
+-\f3\-taglet com\&.sun\&.tools\&.doclets\&.ToDoTaglet\fP
+-.fi
+-.nf
+-\f3\-tagletpath /home/taglets \fP
+-.fi
+-.nf
+-\f3\-tag return\fP
+-.fi
+-.nf
+-\f3\-tag param\fP
+-.fi
+-.nf
+-\f3\-tag todo\fP
+-.fi
+-.nf
+-\f3\-tag throws\fP
+-.fi
+-.nf
+-\f3\-tag see\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--tagletpath \fItagletpathlist\fR
+-.br
+-Specifies the search paths for finding taglet class files\&. The \f3tagletpathlist\fR can contain multiple paths by separating them with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&.
+-.TP
+--docfilesubdirs
+-.br
+-Enables deep copying of doc-files directories\&. Subdirectories and all contents are recursively copied to the destination\&. For example, the directory doc-files/example/images and all of its contents would be copied\&. There is also an option to exclude subdirectories\&.
+-.TP
+--excludedocfilessubdir \fIname1:name2\fR
+-.br
+-Excludes any doc-files subdirectories with the specified names\&. This prevents the copying of SCCS and other source-code-control subdirectories\&.
+-.TP
+--noqualifier all | \fIpackagename1\fR:\fIpackagename2\&.\&.\&.\fR
+-.br
+-Omits qualifying package names from class names in output\&. The argument to the \f3-noqualifier\fR option is either \f3all\fR (all package qualifiers are omitted) or a colon-separate list of packages, with wild cards, to be removed as qualifiers\&. The package name is removed from places where class or interface names appear\&. See Process Source Files\&.
+-
+-The following example omits all package qualifiers: \f3-noqualifier all\fR\&.
+-
+-The following example omits \f3java\&.lang\fR and \f3java\&.io\fR package qualifiers: \f3-noqualifier java\&.lang:java\&.io\fR\&.
+-
+-The following example omits package qualifiers starting with \f3java\fR, and \f3com\&.sun\fR subpackages, but not \f3javax\fR: \f3-noqualifier java\&.*:com\&.sun\&.*\fR\&.
+-
+-Where a package qualifier would appear due to the previous behavior, the name can be suitably shortened\&. See How a Name Appears\&. This rule is in effect whether or not the \f3-noqualifier\fR option is used\&.
+-.TP
+--notimestamp
+-.br
+-Suppresses the time stamp, which is hidden in an HTML comment in the generated HTML near the top of each page\&. The \f3-notimestamp\fR option is useful when you want to run the \f3javadoc\fR command on two source bases and get the differences between \f3diff\fR them, because it prevents time stamps from causing a \f3diff\fR (which would otherwise be a \f3diff\fR on every page)\&. The time stamp includes the \f3javadoc\fR command release number, and currently appears similar to this: \f3<!-- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 -->\fR\&.
+-.TP
+--nocomment
+-.br
+-Suppresses the entire comment body, including the main description and all tags, and generate only declarations\&. This option lets you reuse source files that were originally intended for a different purpose so that you can produce skeleton HTML documentation at the early stages of a new project\&.
+-.TP
+--sourcetab \fItablength\fR
+-.br
+-Specifies the number of spaces each tab uses in the source\&.
+-.SH COMMAND-LINE\ ARGUMENT\ FILES
+-To shorten or simplify the \f3javadoc\fR command, you can specify one or more files that contain arguments to the \f3javadoc\fR command (except \f3-J\fR options)\&. This enables you to create \f3javadoc\fR commands of any length on any operating system\&.
+-.PP
+-An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be space-separated or newline-separated\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
+-.PP
+-File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (\f3*\fR) are not allowed in these lists (such as for specifying *\&.java)\&. Using the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
+-.PP
+-When you run the \f3javadoc\fR command, pass in the path and name of each argument file with the @ leading character\&. When the \f3javadoc\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
+-.PP
+-\f3Example 1 Single Argument File\fR
+-.PP
+-You could use a single argument file named \f3argfile\fR to hold all \f3javadoc\fR command arguments: \f3javadoc @argfile\fR\&. The argument file \f3\fRcontains the contents of both files, as shown in the next example\&.
+-.PP
+-\f3Example 2 Two Argument Files\fR
+-.PP
+-You can create two argument files: One for the \f3javadoc\fR command options and the other for the package names or source file names\&. Notice the following lists have no line-continuation characters\&.
+-.PP
+-Create a file named options that contains:
+-.sp
+-.nf
+-\f3\-d docs\-filelist \fP
+-.fi
+-.nf
+-\f3\-use \fP
+-.fi
+-.nf
+-\f3\-splitindex\fP
+-.fi
+-.nf
+-\f3\-windowtitle \&'Java SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3\-doctitle \&'Java SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3\-header \&'<b>Java\(tm SE 7</b>\&'\fP
+-.fi
+-.nf
+-\f3\-bottom \&'Copyright &copy; 1993\-2011 Oracle and/or its affiliates\&. All rights reserved\&.\&'\fP
+-.fi
+-.nf
+-\f3\-group "Core Packages" "java\&.*"\fP
+-.fi
+-.nf
+-\f3\-overview /java/pubs/ws/1\&.7\&.0/src/share/classes/overview\-core\&.html\fP
+-.fi
+-.nf
+-\f3\-sourcepath /java/pubs/ws/1\&.7\&.0/src/share/classes\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Create a file named packages that contains:
+-.sp
+-.nf
+-\f3com\&.mypackage1\fP
+-.fi
+-.nf
+-\f3com\&.mypackage2\fP
+-.fi
+-.nf
+-\f3com\&.mypackage3\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3javadoc\fR command as follows:
+-.sp
+-.nf
+-\f3javadoc @options @packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Argument Files with Paths\fR
+-.PP
+-The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
+-.sp
+-.nf
+-\f3javadoc @path1/options @path2/packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Option Arguments\fR
+-.PP
+-The following example saves an argument to a \f3javadoc\fR command option in an argument file\&. The \f3-bottom\fR option is used because it can have a lengthy argument\&. You could create a file named bottom to contain the text argument:
+-.sp
+-.nf
+-\f3<font size="\-1">\fP
+-.fi
+-.nf
+-\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&. <br/>\fP
+-.fi
+-.nf
+-\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3 Other names may be trademarks of their respective owners\&.</font>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3javadoc\fR command as follows:\f3javadoc -bottom @bottom @packages\fR\&.
+-.PP
+-You can also include the \f3-bottom\fR option at the start of the argument file and run the \f3javadoc\fR command as follows: \f3javadoc @bottom @packages\fR\&.
+-.SH RUNNING\ THE\ JAVADOC\ COMMAND
+-The release number of the \f3javadoc\fR command can be determined with the \f3javadoc -J-version\fR option\&. The release number of the standard doclet appears in the output stream\&. It can be turned off with the \f3-quiet\fR option\&.
+-.PP
+-Use the public programmatic interface to call the \f3javadoc\fR command from within programs written in the Java language\&. This interface is in \f3com\&.sun\&.tools\&.javadoc\&.Main\fR (and the \f3javadoc\fR command is reentrant)\&. For more information, see The Standard Doclet at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard-doclet\&.html#runningprogrammatically
+-.PP
+-The following instructions call the standard HTML doclet\&. To call a custom doclet, use the \f3-doclet\fR and \f3-docletpath\fR options\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
+-.SS SIMPLE\ EXAMPLES
+-You can run the \f3javadoc\fR command on entire packages or individual source files\&. Each package name has a corresponding directory name\&.
+-.PP
+-In the following examples, the source files are located at /home/src/java/awt/*\&.java\&. The destination directory is /home/html\&.
+-.PP
+-Document One or More Packages
+-
+-To document a package, the source files for that package must be located in a directory that has the same name as the package\&.
+-.PP
+-If a package name has several identifiers (separated by dots, such as \f3java\&.awt\&.color\fR), then each subsequent identifier must correspond to a deeper subdirectory (such as java/awt/color)\&.
+-.PP
+-You can split the source files for a single package among two such directory trees located at different places, as long as \f3-sourcepath\fR points to them both\&. For example, src1/java/awt/color and src2/java/awt/color\&.
+-.PP
+-You can run the \f3javadoc\fR command either by changing directories (with the \f3cd\fR command) or by using the \f3-sourcepath\fR option\&. The following examples illustrate both alternatives\&.
+-.PP
+-\f3Example 1 Recursive Run from One or More Packages\fR
+-.PP
+-This example uses \f3-sourcepath\fR so the \f3javadoc\fR command can be run from any directory and \f3-subpackages\fR (a new 1\&.4 option) for recursion\&. It traverses the subpackages of the java directory excluding packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice this excludes \f3java\&.lang\&.ref\fR, a subpackage of \f3java\&.lang\fR\&. To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as \f3java:javax:org\&.xml\&.sax\fR\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Change to Root and Run Explicit Packages\fR
+-.PP
+-Change to the parent directory of the fully qualified package\&. Then, run the \f3javadoc\fR command with the names of one or more packages that you want to document:
+-.sp
+-.nf
+-\f3cd /home/src/\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as j\f3ava:javax:org\&.xml\&.sax\fR\&.
+-.PP
+-\f3Example 3 Run from Any Directory on Explicit Packages in One Tree\fR
+-.PP
+-In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with the parent directory of the top-level package\&. Provide the names of one or more packages that you want to document:
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 4 Run from Any Directory on Explicit Packages in Multiple Trees\fR
+-.PP
+-Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with a colon-separated list of the paths to each tree\&'s root\&. Provide the names of one or more packages that you want to document\&. All source files for a specified package do not need to be located under a single root directory, but they must be found somewhere along the source path\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src1:/home/src2 java\&.awt java\&.awt\&.event\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The result is that all cases generate HTML-formatted documentation for the \f3public\fR and \f3protected\fR classes and interfaces in packages j\f3ava\&.awt\fR and \f3java\&.awt\&.even\fRt and save the HTML files in the specified destination directory\&. Because two or more packages are being generated, the document has three HTML frames: one for the list of packages, another for the list of classes, and the third for the main class pages\&.
+-.PP
+-Document One or More Classes
+-
+-The second way to run the \f3javadoc\fR command is to pass one or more source files\&. You can run \f3javadoc\fR either of the following two ways: by changing directories (with the \f3cd\fR command) or by fully specifying the path to the source files\&. Relative paths are relative to the current directory\&. The \f3-sourcepath\fR option is ignored when passing source files\&. You can use command-line wild cards, such as an asterisk (*), to specify groups of classes\&.
+-.PP
+-\f3Example 1 Change to the Source Directory\fR
+-.PP
+-Change to the directory that holds the source files\&. Then run the \f3javadoc\fR command with the names of one or more source files you want to document\&.
+-.PP
+-This example generates HTML-formatted documentation for the classes \f3Button\fR, \f3Canvas,\fR and classes that begin with \f3Graphics\fR\&. Because source files rather than package names were passed in as arguments to the \f3javadoc\fR command, the document has two frames: one for the list of classes and the other for the main page\&.
+-.sp
+-.nf
+-\f3cd /home/src/java/awt\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html Button\&.java Canvas\&.java Graphics*\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 2 Change to the Root Directory of the Package\fR
+-.PP
+-This is useful for documenting individual source files from different subpackages off of the same root\&. Change to the package root directory, and supply the source files with paths from the root\&.
+-.sp
+-.nf
+-\f3cd /home/src/\fP
+-.fi
+-.nf
+-\f3javadoc \-d /home/html java/awt/Button\&.java java/applet/Applet\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3Example 3 Document Files from Any Directory\fR
+-.PP
+-In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command with the absolute path (or path relative to the current directory) to the source files you want to document\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html /home/src/java/awt/Button\&.java\fP
+-.fi
+-.nf
+-\f3/home/src/java/awt/Graphics*\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Document Packages and Classes
+-
+-You can document entire packages and individual classes at the same time\&. Here is an example that mixes two of the previous examples\&. You can use the \f3-sourcepath\fR option for the path to the packages but not for the path to the individual classes\&.
+-.sp
+-.nf
+-\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt\fP
+-.fi
+-.nf
+-\f3/home/src/java/applet/Applet\&.java\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS REAL-WORLD\ EXAMPLES
+-The following command-line and \f3makefile\fR versions of the \f3javadoc\fR command run on the Java platform APIs\&. It uses 180 MB of memory to generate the documentation for the 1500 (approximately) public and protected classes in the Java SE 1\&.2\&. Both examples use absolute paths in the option arguments, so that the same \f3javadoc\fR command can be run from any directory\&.
+-.PP
+-Command-Line Example
+-
+-The following command might be too long for some shells\&. You can use a command-line argument file (or write a shell script) to overcome this limitation\&.
+-.PP
+-In the example, \f3packages\fR is the name of a file that contains the packages to process, such as \f3java\&.applet\fR\f3java\&.lang\fR\&. None of the options should contain any newline characters between the single quotation marks\&. For example, if you copy and paste this example, then delete the newline characters from the \f3-bottom\fR option\&.
+-.sp
+-.nf
+-\f3javadoc \-sourcepath /java/jdk/src/share/classes \e\fP
+-.fi
+-.nf
+-\f3\-overview /java/jdk/src/share/classes/overview\&.html \e\fP
+-.fi
+-.nf
+-\f3\-d /java/jdk/build/api \e\fP
+-.fi
+-.nf
+-\f3\-use \e\fP
+-.fi
+-.nf
+-\f3\-splitIndex \e\fP
+-.fi
+-.nf
+-\f3\-windowtitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
+-.fi
+-.nf
+-\f3\-doctitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
+-.fi
+-.nf
+-\f3\-header \&'<b>Java\(tm SE 7</b>\&' \e\fP
+-.fi
+-.nf
+-\f3\-bottom \&'<font size="\-1">\fP
+-.fi
+-.nf
+-\f3<a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
+-.fi
+-.nf
+-\f3Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3Other names may be trademarks of their respective owners\&.</font>\&' \e\fP
+-.fi
+-.nf
+-\f3\-group "Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*" \e\fP
+-.fi
+-.nf
+-\f3\-group "Extension Packages" "javax\&.*" \e\fP
+-.fi
+-.nf
+-\f3\-J\-Xmx180m \e \fP
+-.fi
+-.nf
+-\f3@packages\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.PP
+-Programmatic Interface
+-
+-The Javadoc Access API enables the user to invoke the Javadoc tool directly from a Java application without executing a new process\&.
+-.PP
+-For example, the following statements are equivalent to the command \f3javadoc -d /home/html -sourcepath /home/src -subpackages java -exclude java\&.net:java\&.lang com\&.example\fR:
+-.sp
+-.nf
+-\f3import javax\&.tools\&.DocumentationTool;\fP
+-.fi
+-.nf
+-\f3import javax\&.tools\&.ToolProvider;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class JavaAccessSample{\fP
+-.fi
+-.nf
+-\f3 public static void main(String[] args){\fP
+-.fi
+-.nf
+-\f3 DocumentationTool javadoc = ToolProvider\&.getSystemDocumentationTool();\fP
+-.fi
+-.nf
+-\f3 int rc = javadoc\&.run( null, null, null,\fP
+-.fi
+-.nf
+-\f3 "\-d", "/home/html",\fP
+-.fi
+-.nf
+-\f3 "\-sourcepath", "home/src",\fP
+-.fi
+-.nf
+-\f3 "\-subpackages", "java",\fP
+-.fi
+-.nf
+-\f3 "\-exclude", "java\&.net:java\&.lang",\fP
+-.fi
+-.nf
+-\f3 "com\&.example");\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The first three arguments of the \f3run\fR method specify input, standard output, and standard error streams\&. \f3Null\fR is the default value for \f3System\&.in\fR, \f3System\&.out\fR, and \f3System\&.err\fR, respectively\&.
+-.SS THE\ MAKEFILE\ EXAMPLE
+-This is an example of a GNU \f3makefile\fR\&. Single quotation marks surround \f3makefile\fR arguments\&. For an example of a Windows \f3makefile\fR, see the \f3makefiles\fR section of the Javadoc FAQ at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html#makefiles
+-.sp
+-.nf
+-\f3javadoc \-sourcepath $(SRCDIR) \e /* Sets path for source files */\fP
+-.fi
+-.nf
+-\f3 \-overview $(SRCDIR)/overview\&.html \e /* Sets file for overview text */\fP
+-.fi
+-.nf
+-\f3 \-d /java/jdk/build/api \e /* Sets destination directory */\fP
+-.fi
+-.nf
+-\f3 \-use \e /* Adds "Use" files */\fP
+-.fi
+-.nf
+-\f3 \-splitIndex \e /* Splits index A\-Z */\fP
+-.fi
+-.nf
+-\f3 \-windowtitle $(WINDOWTITLE) \e /* Adds a window title */\fP
+-.fi
+-.nf
+-\f3 \-doctitle $(DOCTITLE) \e /* Adds a doc title */\fP
+-.fi
+-.nf
+-\f3 \-header $(HEADER) \e /* Adds running header text */\fP
+-.fi
+-.nf
+-\f3 \-bottom $(BOTTOM) \e /* Adds text at bottom */\fP
+-.fi
+-.nf
+-\f3 \-group $(GROUPCORE) \e /* 1st subhead on overview page */\fP
+-.fi
+-.nf
+-\f3 \-group $(GROUPEXT) \e /* 2nd subhead on overview page */\fP
+-.fi
+-.nf
+-\f3 \-J\-Xmx180m \e /* Sets memory to 180MB */\fP
+-.fi
+-.nf
+-\f3 java\&.lang java\&.lang\&.reflect \e /* Sets packages to document */\fP
+-.fi
+-.nf
+-\f3 java\&.util java\&.io java\&.net \e\fP
+-.fi
+-.nf
+-\f3 java\&.applet\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3WINDOWTITLE = \&'Java\(tm SE 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3DOCTITLE = \&'Java\(tm Platform Standard Edition 7 API Specification\&'\fP
+-.fi
+-.nf
+-\f3HEADER = \&'<b>Java\(tm SE 7</font>\&'\fP
+-.fi
+-.nf
+-\f3BOTTOM = \&'<font size="\-1">\fP
+-.fi
+-.nf
+-\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
+-.fi
+-.nf
+-\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
+-.fi
+-.nf
+-\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
+-.fi
+-.nf
+-\f3 Other names may be trademarks of their respective owners\&.</font>\&'\fP
+-.fi
+-.nf
+-\f3GROUPCORE = \&'"Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*"\&'\fP
+-.fi
+-.nf
+-\f3GROUPEXT = \&'"Extension Packages" "javax\&.*"\&'\fP
+-.fi
+-.nf
+-\f3SRCDIR = \&'/java/jdk/1\&.7\&.0/src/share/classes\&'\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS NOTES
+-.TP 0.2i
+-\(bu
+-If you omit the \f3-windowtitle\fR option, then the \f3javadoc\fR command copies the document title to the window title\&. The \f3-windowtitle\fR option text is similar to the the \f3-doctitle\fR option, but without HTML tags to prevent those tags from appearing as raw text in the window title\&.
+-.TP 0.2i
+-\(bu
+-If you omit the \f3-footer\fR option, then the \f3javadoc\fR command copies the header text to the footer\&.
+-.TP 0.2i
+-\(bu
+-Other important options you might want to use, but were not needed in the previous example, are the \f3-classpath\fR and \f3-link\fR options\&.
+-.SH GENERAL\ TROUBLESHOOTING
+-.TP 0.2i
+-\(bu
+-The \f3javadoc\fR command reads only files that contain valid class names\&. If the \f3javadoc\fR command is not correctly reading the contents of a file, then verify that the class names are valid\&. See Process Source Files\&.
+-.TP 0.2i
+-\(bu
+-See the Javadoc FAQ for information about common bugs and for troubleshooting tips at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html
+-.SH ERRORS\ AND\ WARNINGS
+-Error and warning messages contain the file name and line number to the declaration line rather than to the particular line in the documentation comment\&.
+-.PP
+-For example, this message \f3error: cannot read: Class1\&.java\fR means that the \f3javadoc\fR command is trying to load \f3Class1\&.jav\fR\f3a\fR in the current directory\&. The class name is shown with its path (absolute or relative)\&.
+-.SH ENVIRONMENT
+-.TP
+-CLASSPATH
+-\f3CLASSPATH\fR is the environment variable that provides the path that the \f3javadoc\fR command uses to find user class files\&. This environment variable is overridden by the \f3-classpath\fR option\&. Separate directories with a semicolon for Windows or a colon for Oracle Solaris\&.
+-
+-\fIWindows example\fR: \f3\&.;C:\eclasses;C:\ehome\ejava\eclasses\fR
+-
+-\fIOracle Solaris example\fR: \f3\&.:/home/classes:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
+-.SH RELATED\ DOCUMENTS
+-.TP 0.2i
+-\(bu
+-Javadoc Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/index\&.html
+-.TP 0.2i
+-\(bu
+-How Classes Are Found http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
+-.TP 0.2i
+-\(bu
+-How to Write Doc Comments for the Javadoc Tool http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html
+-.TP 0.2i
+-\(bu
+-URL Memo, Uniform Resource Locators http://www\&.ietf\&.org/rfc/rfc1738\&.txt
+-.TP 0.2i
+-\(bu
+-HTML standard, HTML Document Representation (4197265 and 4137321) http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
++
++.SH NAME
++javadoc \- Generates HTML pages of API documentation from Java source files\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavadoc\fR {\fIpackages\fR|\fIsource\-files\fR} [\fIoptions\fR] [\fI@argfiles\fR]
++.fi
++.sp
++.TP
++\fIpackages\fR
++Names of packages that you want to document, separated by spaces, for example \f3java\&.lang java\&.lang\&.reflect java\&.awt\fR\&. If you want to also document the subpackages, use the \f3-subpackages\fR option to specify the packages\&.
++
++By default, \f3javadoc\fR looks for the specified packages in the current directory and subdirectories\&. Use the \f3-sourcepath\fR option to specify the list of directories where to look for packages\&.
++.TP
++\fIsource-files\fR
++Names of Java source files that you want to document, separated by spaces, for example \f3Class\&.java Object\&.java Button\&.java\fR\&. By default, \f3javadoc\fR looks for the specified classes in the current directory\&. However, you can specify the full path to the class file and use wildcard characters, for example \f3/home/src/java/awt/Graphics*\&.java\fR\&. You can also specify the path relative to the current directory\&.
++.TP
++\fIoptions\fR
++Command-line options, separated by spaces\&. See Options\&.
++.TP
++\fI@argfiles\fR
++Names of files that contain a list of \f3javadoc\fR command options, package names and source file names in any order\&.
++.SH DESCRIPTION
++The \f3javadoc\fR command parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages that describe (by default) the public and protected classes, nested classes (but not anonymous inner classes), interfaces, constructors, methods, and fields\&. You can use the \f3javadoc\fR command to generate the API documentation or the implementation documentation for a set of source files\&.
++.PP
++You can run the \f3javadoc\fR command on entire packages, individual source files, or both\&. When documenting entire packages, you can either use the \f3-subpackages\fR option to recursively traverse a directory and its subdirectories, or to pass in an explicit list of package names\&. When you document individual source files, pass in a list of Java source file names\&. See Simple Examples\&.
++.SS PROCESS\ SOURCE\ FILES
++The \f3javadoc\fR command processes files that end in source and other files described in Source Files\&. If you run the \f3javadoc\fR command by passing in individual source file names, then you can determine exactly which source files are processed\&. However, that is not how most developers want to work, because it is simpler to pass in package names\&. The \f3javadoc\fR command can be run three ways without explicitly specifying the source file names\&. You can pass in package names, use the \f3-subpackages\fR option, or use wild cards with source file names\&. In these cases, the \f3javadoc\fR command processes a source file only when the file fulfills all of the following requirements:
++.TP 0.2i
++\(bu
++The file name prefix (with \f3\&.java\fR removed) is a valid class name\&.
++.TP 0.2i
++\(bu
++The path name relative to the root of the source tree is a valid package name after the separators are converted to dots\&.
++.TP 0.2i
++\(bu
++The package statement contains the valid package name\&.
++.PP
++Processing Links
++
++During a run, the \f3javadoc\fR command adds cross-reference links to package, class, and member names that are being documented as part of that run\&. Links appear in the following places\&. See Javadoc Tags for a description of the @ tags\&.
++.TP 0.2i
++\(bu
++Declarations (return types, argument types, and field types)\&.
++.TP 0.2i
++\(bu
++\fISee Also\fR sections that are generated from \f3@see\fR tags\&.
++.TP 0.2i
++\(bu
++Inline text generated from \f3{@link}\fR tags\&.
++.TP 0.2i
++\(bu
++Exception names generated from \f3@throws\fR tags\&.
++.TP 0.2i
++\(bu
++\fISpecified by\fR links to interface members and \fIOverrides\fR links to class members\&. See Method Comment Inheritance\&.
++.TP 0.2i
++\(bu
++Summary tables listing packages, classes and members\&.
++.TP 0.2i
++\(bu
++Package and class inheritance trees\&.
++.TP 0.2i
++\(bu
++The index\&.
++.PP
++You can add links to existing text for classes not included on the command line (but generated separately) by way of the \f3-link\fR and \f3-linkoffline\fR options\&.
++.PP
++Processing Details
++
++The \f3javadoc\fR command produces one complete document every time it runs\&. It does not do incremental builds that modify or directly incorporate the results from earlier runs\&. However, the \f3javadoc\fR command can link to results from other runs\&.
++.PP
++The \f3javadoc\fR command implementation requires and relies on the Java compiler\&. The \f3javadoc\fR command calls part of the \f3javac\fR command to compile the declarations and ignore the member implementations\&. The \f3javadoc\fR command builds a rich internal representation of the classes that includes the class hierarchy and use relationships to generate the HTML\&. The \f3javadoc\fR command also picks up user-supplied documentation from documentation comments in the source code\&. See Documentation Comments\&.
++.PP
++The \f3javadoc\fR command runs on source files that are pure stub files with no method bodies\&. This means you can write documentation comments and run the \f3javadoc\fR command in the early stages of design before API implementation\&.
++.PP
++Relying on the compiler ensures that the HTML output corresponds exactly with the actual implementation, which may rely on implicit, rather than explicit, source code\&. For example, the \f3javadoc\fR command documents default constructors that are present in the compiled class files but not in the source code\&.
++.PP
++In many cases, the \f3javadoc\fR command lets you generate documentation for source files with incomplete or erroneous code\&. You can generate documentation before all debugging and troubleshooting is done\&. The \f3javadoc\fR command does primitive checking of documentation comments\&.
++.PP
++When the \f3javadoc\fR command builds its internal structure for the documentation, it loads all referenced classes\&. Because of this, the \f3javadoc\fR command must be able to find all referenced classes, whether bootstrap classes, extensions, or user classes\&. See How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++.PP
++Typically, classes you create must either be loaded as an extension or in the \f3javadoc\fR command class path\&.
++.SS JAVADOC\ DOCLETS
++You can customize the content and format of the \f3javadoc\fR command output with doclets\&. The \f3javadoc\fR command has a default built-in doclet, called the standard doclet, that generates HTML-formatted API documentation\&. You can modify or make a subclass of the standard doclet, or write your own doclet to generate HTML, XML, MIF, RTF or whatever output format you want\&.
++.PP
++When a custom doclet is not specified with the \f3-doclet\fR option, the \f3javadoc\fR command uses the default standard doclet\&. The \f3javadoc\fR command has several options that are available regardless of which doclet is being used\&. The standard doclet adds a supplementary set of command-line options\&. See Options\&.
++.SH SOURCE\ FILES
++The \f3javadoc\fR command generates output that originates from the following types of source files: Java language source files for classes (\f3\&.java\fR), package comment files, overview comment files, and miscellaneous unprocessed files\&. This section also describes test files and template files that can also be in the source tree, but that you want to be sure not to document\&.
++.SS CLASS\ SOURCE\ FILES
++Each class or interface and its members can have their own documentation comments contained in a source file\&. See Documentation Comments\&.
++.SS PACKAGE\ COMMENT\ FILES
++Each package can have its own documentation comment, contained in its own source file, that the \f3javadoc\fR command merges into the generated package summary page\&. You typically include in this comment any documentation that applies to the entire package\&.
++.PP
++To create a package comment file, you can place your comments in one of the following files:
++.TP 0.2i
++\(bu
++The \f3package-info\&.java\fR file can contain the package declaration, package annotations, package comments, and Javadoc tags\&. This file is preferred\&.
++.TP 0.2i
++\(bu
++The \f3package\&.html\fR file contains only package comments and Javadoc tags\&. No package annotations\&.
++.PP
++A package can have a single \f3package\&.html\fR file or a single \f3package-info\&.java\fR file, but not both\&. Place either file in the package directory in the source tree with your source files\&.
++.PP
++The package-info\&.java File
++
++The \f3package-info\&.java\fR file can contain a package comment of the following structure\&. The comment is placed before the package declaration\&.
++.PP
++\fINote:\fR The comment separators \f3/**\fR and \f3*/\fR must be present, but the leading asterisks on the intermediate lines can be left off\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Provides the classes necessary to create an \fP
++.fi
++.nf
++\f3 * applet and the classes an applet uses \fP
++.fi
++.nf
++\f3 * to communicate with its applet context\&.\fP
++.fi
++.nf
++\f3 * <p>\fP
++.fi
++.nf
++\f3 * The applet framework involves two entities:\fP
++.fi
++.nf
++\f3 * the applet and the applet context\&.\fP
++.fi
++.nf
++\f3 * An applet is an embeddable window (see the\fP
++.fi
++.nf
++\f3 * {@link java\&.awt\&.Panel} class) with a few extra\fP
++.fi
++.nf
++\f3 * methods that the applet context can use to \fP
++.fi
++.nf
++\f3 * initialize, start, and stop the applet\&.\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @since 1\&.0\fP
++.fi
++.nf
++\f3 * @see java\&.awt\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3package java\&.lang\&.applet;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++The package\&.html File
++
++The \f3package\&.html\fR file can contain a package comment of the following structure\&. The comment is placed in the \f3<body>\fR element\&.
++.PP
++File: \f3java/applet/package\&.html\fR
++.sp
++.nf
++\f3<HTML>\fP
++.fi
++.nf
++\f3<BODY>\fP
++.fi
++.nf
++\f3Provides the classes necessary to create an applet and the \fP
++.fi
++.nf
++\f3classes an applet uses to communicate with its applet context\&.\fP
++.fi
++.nf
++\f3<p>\fP
++.fi
++.nf
++\f3The applet framework involves two entities: the applet\fP
++.fi
++.nf
++\f3and the applet context\&. An applet is an embeddable\fP
++.fi
++.nf
++\f3window (see the {@link java\&.awt\&.Panel} class) with a\fP
++.fi
++.nf
++\f3few extra methods that the applet context can use to\fP
++.fi
++.nf
++\f3initialize, start, and stop the applet\&. \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3@since 1\&.0 \fP
++.fi
++.nf
++\f3@see java\&.awt\fP
++.fi
++.nf
++\f3</BODY>\fP
++.fi
++.nf
++\f3</HTML>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3package\&.html\fR file is a typical HTML file and does not include a package declaration\&. The content of the package comment file is written in HTML with one exception\&. The documentation comment should not include the comment separators \f3/**\fR and \f3*/\fR or leading asterisks\&. When writing the comment, make the first sentence a summary about the package, and do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. You can include package tags\&. All block tags must appear after the main description\&. If you add an \f3@see\fR tag in a package comment file, then it must have a fully qualified name\&.
++.PP
++Processing the Comment File
++
++When the \f3javadoc\fR command runs, it searches for the package comment file\&. If the package comment file is found, then the \f3javadoc\fR command does the following:
++.TP 0.2i
++\(bu
++Copies the comment for processing\&. For package\&.html, the \f3javadoc\fR command copies all content between the \f3<body>\fR and \f3</body>\fR HTML tags\&. You can include a \f3<head>\fR section to put a \f3<title>\fR tag, source file copyright statement, or other information, but none of these appear in the generated documentation\&.
++.TP 0.2i
++\(bu
++Processes the package tags\&. See Package Tags\&.
++.TP 0.2i
++\(bu
++Inserts the processed text at the bottom of the generated package summary page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++.TP 0.2i
++\(bu
++Copies the first sentence of the package comment to the top of the package summary page\&. The \f3javadoc\fR command also adds the package name and this first sentence to the list of packages on the overview page\&. See Java Platform, Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++
++The end of the sentence is determined by the same rules used for the end of the first sentence of class and member main descriptions\&.
++.SS OVERVIEW\ COMMENT\ FILES
++Each application or set of packages that you are documenting can have its own overview documentation comment that is kept in its own source file, that the \f3javadoc\fR command merges into the generated overview page\&. You typically include in this comment any documentation that applies to the entire application or set of packages\&.
++.PP
++You can name the file anything you want such as overview\&.html and place it anywhere\&. A typical location is at the top of the source tree\&.
++.PP
++For example, if the source files for the \f3java\&.applet\fR package are contained in the /home/user/src/java/applet directory, then you could create an overview comment file at /home/user/src/overview\&.html\&.
++.PP
++You can have multiple overview comment files for the same set of source files in case you want to run the \f3javadoc\fR command multiple times on different sets of packages\&. For example, you could run the \f3javadoc\fR command once with \f3-private\fR for internal documentation and again without that option for public documentation\&. In this case, you could describe the documentation as public or internal in the first sentence of each overview comment file\&.
++.PP
++The content of the overview comment file is one big documentation comment that is written in HTML\&. Make the first sentence a summary about the application or set of packages\&. Do not put a title or any other text between the \f3<body>\fR tag and the first sentence\&. All tags except inline tags, such as an {\f3@link}\fR tag, must appear after the main description\&. If you add an \f3@see\fR tag, then it must have a fully qualified name\&.
++.PP
++When you run the \f3javadoc\fR command, specify the overview comment file name with the \f3-overview\fR option\&. The file is then processed similarly to that of a package comment file\&. The \f3javadoc\fR command does the following:
++.TP 0.2i
++\(bu
++Copies all content between the \f3<body>\fR and \f3</body>\fR tags for processing\&.
++.TP 0.2i
++\(bu
++Processes the overview tags that are present\&. See Overview Tags\&.
++.TP 0.2i
++\(bu
++Inserts the processed text at the bottom of the generated overview page\&. See Java Platform Standard Edition API Specification Overview at http://docs\&.oracle\&.com/javase/8/docs/api/overview-summary\&.html
++.TP 0.2i
++\(bu
++Copies the first sentence of the overview comment to the top of the overview summary page\&.
++.SS UNPROCESSED\ FILES
++Your source files can include any files that you want the \f3javadoc\fR command to copy to the destination directory\&. These files usually include graphic files, example Java source and class files, and self-standing HTML files with a lot of content that would overwhelm the documentation comment of a typical Java source file\&.
++.PP
++To include unprocessed files, put them in a directory called doc-files\&. The doc-files directory can be a subdirectory of any package directory that contains source files\&. You can have one doc-files subdirectory for each package\&.
++.PP
++For example, if you want to include the image of a button in the \f3java\&.awt\&.Button\fR class documentation, then place the image file in the /home/user/src/java/awt/doc-files/ directory\&. Do not place the doc-files directory at /home/user/src/java/doc-files, because java is not a package\&. It does not contain any source files\&.
++.PP
++All links to the unprocessed files must be included in the code because the \f3javadoc\fR command does not look at the files\&. The \f3javadoc\fR command copies the directory and all of its contents to the destination\&. The following example shows how the link in the Button\&.java documentation comment might look:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This button looks like this: \fP
++.fi
++.nf
++\f3 * <img src="doc\-files/Button\&.gif">\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS TEST\ AND\ TEMPLATE\ FILES
++You can store test and template files in the source tree in the same directory with or in a subdirectory of the directory where the source files reside\&. To prevent test and template files from being processed, run the \f3javadoc\fR command and explicitly pass in individual source file names\&.
++.PP
++Test files are valid, compilable source files\&. Template files are not valid, compatible source files, but they often have the \f3\&.java\fR suffix\&.
++.PP
++Test Files
++
++If you want your test files to belong to either an unnamed package or to a package other than the package that the source files are in, then put the test files in a subdirectory underneath the source files and give the directory an invalid name\&. If you put the test files in the same directory with the source and call the \f3javadoc\fR command with a command-line argument that indicates its package name, then the test files cause warnings or errors\&. If the files are in a subdirectory with an invalid name, then the test file directory is skipped and no errors or warnings are issued\&. For example, to add test files for source files in com\&.package1, put them in a subdirectory in an invalid package name\&. The following directory name is invalid because it contains a hyphen:
++.sp
++.nf
++\f3com/package1/test\-files/\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If your test files contain documentation comments, then you can set up a separate run of the \f3javadoc\fR command to produce test file documentation by passing in their test source file names with wild cards, such as \f3com/package1/test-files/*\&.java\fR\&.
++.PP
++Template Files
++
++If you want a template file to be in the source directory, but not generate errors when you execute the \f3javadoc\fR command, then give it an invalid file name such as \f3Buffer-Template\&.java\fR to prevent it from being processed\&. The \f3javadoc\fR command only processes source files with names, when stripped of the \f3\&.java\fR suffix, that are valid class names\&.
++.SH GENERATED\ FILES
++By default, the \f3javadoc\fR command uses a standard doclet that generates HTML-formatted documentation\&. The standard doclet generates basic content, cross-reference, and support pages described here\&. Each HTML page corresponds to a separate file\&. The \f3javadoc\fR command generates two types of files\&. The first type is named after classes and interfaces\&. The second type contain hyphens (such as package-summary\&.html) to prevent conflicts with the first type of file\&.
++.SS BASIC\ CONTENT\ PAGES
++.TP 0.2i
++\(bu
++One class or interface page (classname\&.html) for each class or interface being documented\&.
++.TP 0.2i
++\(bu
++One package page (package-summary\&.html) for each package being documented\&. The \f3javadoc\fR command includes any HTML text provided in a file with the name package\&.html or package-info\&.java in the package directory of the source tree\&.
++.TP 0.2i
++\(bu
++One overview page (overview-summary\&.html) for the entire set of packages\&. The overview page is the front page of the generated document\&. The \f3javadoc\fR command includes any HTML text provided in a file specified by the \f3-overview\fR option\&. The Overview page is created only when you pass two or more package names into the \f3javadoc\fR command\&. See HTML Frames and Options\&.
++.SS CROSS-REFERENCE\ PAGES
++.TP 0.2i
++\(bu
++One class hierarchy page for the entire set of packages (overview-tree\&.html)\&. To view the hierarchy page, click \fIOverview\fR in the navigation bar and click \fITree\fR\&.
++.TP 0.2i
++\(bu
++One class hierarchy page for each package (package-tree\&.html) To view the hierarchy page, go to a particular package, class, or interface page, and click \fITree\fR to display the hierarchy for that package\&.
++.TP 0.2i
++\(bu
++One use page for each package (package-use\&.html) and a separate use page for each class and interface (class-use/classname\&.html)\&. The use page describes what packages, classes, methods, constructors and fields use any part of the specified class, interface, or package\&. For example, given a class or interface A, its use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A\&. To view the use page, go to the package, class, or interface and click the \fIUse\fR link in the navigation bar\&.
++.TP 0.2i
++\(bu
++A deprecated API page (deprecated-list\&.html) that lists all deprecated APIs and their suggested replacements\&. Avoid deprecated APIs because they can be removed in future implementations\&.
++.TP 0.2i
++\(bu
++A constant field values page (constant-values\&.html) for the values of static fields\&.
++.TP 0.2i
++\(bu
++A serialized form page (serialized-form\&.html) that provides information about serializable and externalizable classes with field and method descriptions\&. The information on this page is of interest to reimplementors, and not to developers who want to use the API\&. To access the serialized form page, go to any serialized class and click \fISerialized Form\fR in the See Also section of the class comment\&. The standard doclet generates a serialized form page that lists any class (public or non-public) that implements Serializable with its \f3readObject\fR and \f3writeObject\fR methods, the fields that are serialized, and the documentation comments from the \f3@serial\fR, \f3@serialField\fR, and \f3@serialData\fR tags\&. Public serializable classes can be excluded by marking them (or their package) with \f3@serial\fR exclude, and package-private serializable classes can be included by marking them (or their package) with an \f3@serial\fR include\&. As of Release 1\&.4, you can generate the complete serialized form for public and private classes by running the \f3javadoc\fR command without specifying the \f3-private\fR option\&. See Options\&.
++.TP 0.2i
++\(bu
++An index page (\f3index-*\&.html\fR) of all class, interface, constructor, field and method names, in alphabetical order\&. The index page is internationalized for Unicode and can be generated as a single file or as a separate file for each starting character (such as A\(enZ for English)\&.
++.SS SUPPORT\ PAGES
++.TP 0.2i
++\(bu
++A help page (help-doc\&.html) that describes the navigation bar and the previous pages\&. Use \f3-helpfile\fR to override the default help file with your own custom help file\&.
++.TP 0.2i
++\(bu
++One index\&.html file that creates the HTML frames for display\&. Load this file to display the front page with frames\&. The index\&.html file contains no text content\&.
++.TP 0.2i
++\(bu
++Several frame files (\f3*-frame\&.html\fR) that contains lists of packages, classes, and interfaces\&. The frame files display the HTML frames\&.
++.TP 0.2i
++\(bu
++A package list file (package-list) that is used by the \f3-link\fR and \f3-linkoffline\fR options\&. The package list file is a text file that is not reachable through links\&.
++.TP 0.2i
++\(bu
++A style sheet file (stylesheet\&.css) that controls a limited amount of color, font family, font size, font style, and positioning information on the generated pages\&.
++.TP 0.2i
++\(bu
++A doc-files directory that holds image, example, source code, or other files that you want copied to the destination directory\&. These files are not processed by the \f3javadoc\fR command\&. This directory is not processed unless it exists in the source tree\&.
++.PP
++See Options\&.
++.SS HTML\ FRAMES
++The \f3javadoc\fR command generates the minimum number of frames (two or three) necessary based on the values passed to the command\&. It omits the list of packages when you pass a single package name or source files that belong to a single package as an argument to the \f3javadoc\fR command\&. Instead, the \f3javadoc\fR command creates one frame in the left-hand column that displays the list of classes\&. When you pass two or more package names, the \f3javadoc\fR command creates a third frame that lists all packages and an overview page (overview-summary\&.html)\&. To bypass frames, click the \fINo Frames\fR link or enter the page set from the overview-summary\&.html page\&.
++.SS GENERATED\ FILE\ STRUCTURE
++The generated class and interface files are organized in the same directory hierarchy that Java source files and class files are organized\&. This structure is one directory per subpackage\&.
++.PP
++For example, the document generated for the \f3java\&.applet\&.Applet\fR class would be located at java/applet/Applet\&.html\&.
++.PP
++The file structure for the \f3java\&.applet\fR package follows, assuming that the destination directory is named \f3apidocs\fR\&. All files that contain the word \fIframe\fR appear in the upper-left or lower-left frames, as noted\&. All other HTML files appear in the right-hand frame\&.
++.PP
++Directories are bold\&. The asterisks (*) indicate the files and directories that are omitted when the arguments to the \f3javadoc\fR command are source file names rather than package names\&. When arguments are source file names, an empty package list is created\&. The doc-files directory is not created in the destination unless it exists in the source tree\&. See Generated Files\&.
++.TP 0.2i
++\(bu
++\fIapidocs\fR: Top-level directory
++.RS
++.TP 0.2i
++\(bu
++index\&.html: Initial Page that sets up HTML frames
++.TP 0.2i
++\(bu
++*overview-summary\&.html: Package list with summaries
++.TP 0.2i
++\(bu
++overview-tree\&.html: Class hierarchy for all packages
++.TP 0.2i
++\(bu
++deprecated-list\&.html: Deprecated APIs for all packages
++.TP 0.2i
++\(bu
++constant-values\&.html: Static field values for all packages
++.TP 0.2i
++\(bu
++serialized-form\&.html: Serialized forms for all packages
++.TP 0.2i
++\(bu
++*overview-frame\&.html: All packages for display in upper-left frame
++.TP 0.2i
++\(bu
++allclasses-frame\&.html: All classes for display in lower-left frame
++.TP 0.2i
++\(bu
++help-doc\&.html: Help about Javadoc page organization
++.TP 0.2i
++\(bu
++index-all\&.html: Default index created without \f3-splitindex\fR option
++.TP 0.2i
++\(bu
++\fIindex-files\fR: Directory created with \f3-splitindex\fR option
++.RS
++.TP 0.2i
++\(bu
++index-<number>\&.html: Index files created with \f3-splitindex\fR option
++.RE
++
++.TP 0.2i
++\(bu
++package-list: Package names for resolving external references
++.TP 0.2i
++\(bu
++stylesheet\&.css: Defines fonts, colors, positions, and so on
++.RE
++
++.TP 0.2i
++\(bu
++\fIjava\fR: Package directory
++.RS
++.TP 0.2i
++\(bu
++\fIapplet\fR: Subpackage directory
++.RS
++.TP 0.2i
++\(bu
++Applet\&.html: \f3Applet\fR class page
++.TP 0.2i
++\(bu
++AppletContext\&.html: \f3AppletContext\fR interface
++.TP 0.2i
++\(bu
++AppletStub\&.html: \f3AppletStub\fR interface
++.TP 0.2i
++\(bu
++AudioClip\&.html: \f3AudioClip\fR interface
++.TP 0.2i
++\(bu
++package-summary\&.html: Classes with summaries
++.TP 0.2i
++\(bu
++package-frame\&.html: Package classes for display in lower-left frame
++.TP 0.2i
++\(bu
++package-tree\&.html: Class hierarchy for this package
++.TP 0.2i
++\(bu
++package-use\&.html: Where this package is used
++.TP 0.2i
++\(bu
++\fIdoc-files\fR: Image and example files directory
++.TP 0.2i
++\(bu
++\fIclass-use\fR: Image and examples file location
++
++- Applet\&.html: Uses of the Applet class
++
++- AppletContext\&.html: Uses of the \f3AppletContext\fR interface
++
++- AppletStub\&.html: Uses of the \f3AppletStub\fR interface
++
++- AudioClip\&.html: Uses of the \f3AudioClip\fR interface
++.RE
++
++.RE
++
++.TP 0.2i
++\(bu
++\fIsrc-html\fR: Source code directory
++.RS
++.TP 0.2i
++\(bu
++\fIjava\fR: Package directory
++.RS
++.TP 0.2i
++\(bu
++\fIapplet\fR: Subpackage directory
++
++- Applet\&.html: Applet source code
++
++- AppletContext\&.html: \f3AppletContext\fR source code
++
++- AppletStub\&.html: \f3AppletStub\fR source code
++
++- AudioClip\&.html: \f3AudioClip\fR source code
++.RE
++
++.RE
++
++.SS GENERATED\ API\ DECLARATIONS
++The \f3javadoc\fR command generates a declaration at the start of each class, interface, field, constructor, and method description for that API item\&. For example, the declaration for the \f3Boolean\fR class is:
++.sp
++.nf
++\f3public final class Boolean\fP
++.fi
++.nf
++\f3extends Object\fP
++.fi
++.nf
++\f3implements Serializable\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The declaration for the \f3Boolean\&.valueOf\fR method is:
++.sp
++.nf
++\f3public static Boolean valueOf(String s)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3javadoc\fR command can include the modifiers \f3public\fR, \f3protected\fR, \f3private\fR, \f3abstract\fR, \f3final\fR, \f3static\fR, \f3transient\fR, and \f3volatile\fR, but not \f3synchronized\fR or \f3native\fR\&. The \f3synchronized\fR and \f3native\fR modifiers are considered implementation detail and not part of the API specification\&.
++.PP
++Rather than relying on the keyword \f3synchronized\fR, APIs should document their concurrency semantics in the main description of the comment\&. For example, a description might be: A single enumeration cannot be used by multiple threads concurrently\&. The document should not describe how to achieve these semantics\&. As another example, while the \f3Hashtable\fR option should be thread-safe, there is no reason to specify that it is achieved by synchronizing all of its exported methods\&. It is better to reserve the right to synchronize internally at the bucket level for higher concurrency\&.
++.SH DOCUMENTATION\ COMMENTS
++This section describes source code comments and comment inheritance\&.
++.SS SOURCE\ CODE\ COMMENTS
++You can include documentation comments in the source code, ahead of declarations for any class, interface, method, constructor, or field\&. You can also create documentation comments for each package and another one for the overview, though their syntax is slightly different\&. A documentation comment consists of the characters between \f3/**\fR and \f3*/\fR that end it\&. Leading asterisks are allowed on each line and are described further in the following section\&. The text in a comment can continue onto multiple lines\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is the typical format of a simple documentation comment\fP
++.fi
++.nf
++\f3 * that spans two lines\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To save space you can put a comment on one line:
++.sp
++.nf
++\f3/** This comment takes up only one line\&. */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Placement of Comments
++
++Documentation comments are recognized only when placed immediately before class, interface, constructor, method, or field declarations\&. Documentation comments placed in the body of a method are ignored\&. The \f3javadoc\fR command recognizes only one documentation comment per declaration statement\&. See Where Tags Can Be Used\&.
++.PP
++A common mistake is to put an \f3import\fR statement between the class comment and the class declaration\&. Do not put an \f3import\fR statement at this location because the \f3javadoc\fR command ignores the class comment\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is the class comment for the class Whatever\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3import com\&.example; // MISTAKE \- Important not to put import statement here\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class Whatever{ }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Parts of Comments
++
++A documentation comment has a main description followed by a tag section\&. The main description begins after the starting delimiter \f3/**\fR and continues until the tag section\&. The tag section starts with the first block tag, which is defined by the first \f3@\fR character that begins a line (ignoring leading asterisks, white space, and leading separator \f3/**\fR)\&. It is possible to have a comment with only a tag section and no main description\&. The main description cannot continue after the tag section begins\&. The argument to a tag can span multiple lines\&. There can be any number of tags, and some types of tags can be repeated while others cannot\&. For example, this \f3@see\fR tag starts the tag section:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This sentence holds the main description for this documentation comment\&.\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Object\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Block and inline Tags
++
++A tag is a special keyword within a documentation comment that the \f3javadoc\fR command processes\&. There are two kinds of tags: block tags, which appear as an \f3@tag\fR tag (also known as standalone tags), and inline tags, which appear within braces, as an \f3{@tag}\fR tag\&. To be interpreted, a block tag must appear at the beginning of a line, ignoring leading asterisks, white space, and the separator (\f3/**\fR)\&. This means you can use the \f3@\fR character elsewhere in the text and it will not be interpreted as the start of a tag\&. If you want to start a line with the \f3@\fR character and not have it be interpreted, then use the HTML entity \f3&#064;\fR\&. Each block tag has associated text, which includes any text following the tag up to, but not including, either the next tag, or the end of the documentation comment\&. This associated text can span multiple lines\&. An inline tag is allowed and interpreted anywhere that text is allowed\&. The following example contains the \f3@deprecated\fR block tag and the \f3{@link}\fR inline tag\&. See Javadoc Tags\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @deprecated As of JDK 1\&.1, replaced by {@link #setBounds(int,int,int,int)}\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Write Comments in HTML
++
++The text must be written in HTML with HTML entities and HTML tags\&. You can use whichever version of HTML your browser supports\&. The standard doclet generates HTML 3\&.2-compliant code elsewhere (outside of the documentation comments) with the inclusion of cascading style sheets and frames\&. HTML 4\&.0 is preferred for generated files because of the frame sets\&.
++.PP
++For example, entities for the less than symbol (<) and the greater than symbol (>) should be written as \f3&lt;\fR and \f3&gt;\fR\&. Similarly, the ampersand (&) should be written as \f3&amp;\fR\&. The bold HTML tag \f3<b>\fR is shown in the following example\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * This is a <b>doc</b> comment\&.\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Object\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Leading Asterisks
++
++When the \f3javadoc\fR command parses a documentation comment, leading asterisks (*) on each line are discarded, and blanks and tabs that precede the initial asterisks (*) are also discarded\&. If you omit the leading asterisk on a line, then the leading white space is no longer removed so that you can paste code examples directly into a documentation comment inside a \f3<PRE>\fR tag with its indentation preserved\&. Spaces are interpreted by browsers more uniformly than tabs\&. Indentation is relative to the left margin (rather than the separator \f3/**\fR or \f3<PRE>\fR tag)\&.
++.PP
++First Sentence
++
++The first sentence of each documentation comment should be a summary sentence that contains a concise but complete description of the declared entity\&. This sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first block tag\&. The \f3javadoc\fR command copies this first sentence to the member summary at the top of the HTML page\&.
++.PP
++Multiple-Field Declarations
++
++The Java platform lets you declare multiple fields in a single statement, but this statement can have only one documentation comment that is copied for all fields\&. If you want individual documentation comments for each field, then declare each field in a separate statement\&. For example, the following documentation comment does not make sense written as a single declaration and would be better handled as two declarations:
++.sp
++.nf
++\f3/** \fP
++.fi
++.nf
++\f3 * The horizontal and vertical distances of point (x,y)\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public int x, y; // Avoid this \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3javadoc\fR command generates the following documentation from the previous code:
++.sp
++.nf
++\f3public int x\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The horizontal and vertical distances of point (x, y)\&.
++.sp
++.nf
++\f3public int y\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The horizontal and vertical distances of point (x, y)\&.
++.PP
++Use of Header Tags
++
++When writing documentation comments for members, it is best not to use HTML heading tags such as \f3<H1>\fR and \f3<H2>\fR, because the \f3javadoc\fR command creates an entire structured document, and these structural tags might interfere with the formatting of the generated document\&. However, you can use these headings in class and package comments to provide your own structure\&.
++.SS METHOD\ COMMENT\ INHERITANCE
++The \f3javadoc\fR command allows method comment inheritance in classes and interfaces to fill in missing text or to explicitly inherit method comments\&. Constructors, fields, and nested classes do not inherit documentation comments\&.
++.PP
++\fINote:\fR The source file for an inherited method must be on the path specified by the \f3-sourcepath\fR option for the documentation comment to be available to copy\&. Neither the class nor its package needs to be passed in on the command line\&. This contrasts with Release 1\&.3\&.\fIn\fR and earlier releases, where the class had to be a documented class\&.
++.PP
++Fill in Missing Text
++
++When a main description, or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag is missing from a method comment, the \f3javadoc\fR command copies the corresponding main description or tag comment from the method it overrides or implements (if any)\&. See Method Comment Inheritance\&.
++.PP
++When an \f3@param\fR tag for a particular parameter is missing, the comment for that parameter is copied from the method further up the inheritance hierarchy\&. When an \f3@throws\fR tag for a particular exception is missing, the \f3@throws\fR tag is copied only when that exception is declared\&.
++.PP
++This behavior contrasts with Release 1\&.3 and earlier, where the presence of any main description or tag would prevent all comments from being inherited\&.
++.PP
++See Javadoc Tags and Options\&.
++.PP
++Explicit Inheritance
++
++Insert the \f3{@inheritDoc}\fR inline tag in a method main description or \f3@return\fR, \f3@param\fR, or \f3@throws\fR tag comment\&. The corresponding inherited main description or tag comment is copied into that spot\&.
++.SS CLASS\ AND\ INTERFACE\ INHERITANCE
++Comment inheritance occurs in all possible cases of inheritance from classes and interfaces:
++.TP 0.2i
++\(bu
++When a method in a class overrides a method in a superclass
++.TP 0.2i
++\(bu
++When a method in an interface overrides a method in a superinterface
++.TP 0.2i
++\(bu
++When a method in a class implements a method in an interface
++.PP
++In the first two cases, the \f3javadoc\fR command generates the subheading \fIOverrides\fR in the documentation for the overriding method\&. A link to the method being overridden is included, whether or not the comment is inherited\&.
++.PP
++In the third case, when a method in a specified class implements a method in an interface, the \f3javadoc\fR command generates the subheading \fISpecified by\fR in the documentation for the overriding method\&. A link to the method being implemented is included, whether or not the comment is inherited\&.
++.SS METHOD\ COMMENTS\ ALGORITHM
++If a method does not have a documentation comment, or has an \f3{@inheritDoc}\fR tag, then the \f3javadoc\fR command uses the following algorithm to search for an applicable comment\&. The algorithm is designed to find the most specific applicable documentation comment, and to give preference to interfaces over superclasses:
++.TP 0.4i
++1\&.
++Look in each directly implemented (or extended) interface in the order they appear following the word \f3implements\fR (or \f3extends\fR) in the method declaration\&. Use the first documentation comment found for this method\&.
++.TP 0.4i
++2\&.
++If Step 1 failed to find a documentation comment, then recursively apply this entire algorithm to each directly implemented (or extended) interface in the same order they were examined in Step 1\&.
++.TP 0.4i
++3\&.
++When Step 2 fails to find a documentation comment and this is a class other than the \f3Object\fR class, but not an interface:
++.RS
++.TP 0.4i
++1\&.
++If the superclass has a documentation comment for this method, then use it\&.
++.TP 0.4i
++2\&.
++If Step 3a failed to find a documentation comment, then recursively apply this entire algorithm to the superclass\&.
++.RE
++
++.SH JAVADOC\ TAGS
++The \f3javadoc\fR command parses special tags when they are embedded within a Java documentation comment\&. The \f3javadoc\fR tags let you autogenerate a complete, well-formatted API from your source code\&. The tags start with an at sign (\f3@\fR) and are case-sensitive\&. They must be typed with the uppercase and lowercase letters as shown\&. A tag must start at the beginning of a line (after any leading spaces and an optional asterisk), or it is treated as text\&. By convention, tags with the same name are grouped together\&. For example, put all \f3@see\fR tags together\&. For more information, see Where Tags Can Be Used\&.
++.PP
++Tags have the following types:
++.TP 0.2i
++\(bu
++Bock tags: Place block tags only in the tag section that follows the description\&. Block tags have the form: \fI@tag\fR\&.
++.TP 0.2i
++\(bu
++Inline tags: Place inline tags anywhere in the main description or in the comments for block tags\&. Inline tags are enclosed within braces: \fI{@tag}\fR\&.
++.PP
++For custom tags, see -tag tagname:Xaoptcmf:"taghead"\&. See also Where Tags Can Be Used\&.
++.SS TAG\ DESCRIPTIONS
++.TP
++@author \fIname-text\fR
++Introduced in JDK 1\&.0
++
++Adds an Author entry with the specified name text to the generated documents when the \f3-author\fR option is used\&. A documentation comment can contain multiple \f3@author\fR tags\&. You can specify one name per \f3@author\fR tag or multiple names per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and space between names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line if you want a localized name separator other than a comma\&. See @author in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@author
++.TP
++{@code \fItext\fR}
++Introduced in JDK 1\&.5
++
++Equivalent to \f3<code>{@literal}</code>\fR\&.
++
++Displays text in code font without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use regular angle brackets (< and >) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (\f3<-\fR)\&. For example, the documentation comment text \f3{@code A<B>C}\fR displayed in the generated HTML page unchanged as \f3A<B>C\fR\&. This means that the \f3<B>\fR is not interpreted as bold and is in code font\&. If you want the same functionality without the code font, then use the \f3{@literal}\fR tag\&.
++.TP
++@deprecated \fIdeprecated-text\fR
++Introduced in JDK 1\&.0
++
++Adds a comment indicating that this API should no longer be used (even though it may continue to work)\&. The \f3javadoc\fR command moves \f3deprecated-text\fRahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field\&.
++
++The first sentence of deprecated text should tell the user when the API was deprecated and what to use as a replacement\&. The \f3javadoc\fR command copies the first sentence to the summary section and index\&. Subsequent sentences can also explain why it was deprecated\&. You should include an \f3{@link}\fR tag (for Javadoc 1\&.2 or later) that points to the replacement API\&.
++
++Use the \fI@deprecated annotation\fR tag to deprecate a program element\&. See How and When to Deprecate APIs at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html
++
++See also @deprecated in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@deprecated
++.TP
++{@docRoot}
++Introduced in JDK 1\&.3
++
++Represents the relative path to the generated document\&'s (destination) root directory from any generated page\&. This tag is useful when you want to include a file, such as a copyright page or company logo, that you want to reference from all generated pages\&. Linking to the copyright page from the bottom of each page is common\&.
++
++This \f3{@docRoot}\fR tag can be used both on the command line and in a documentation comment\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, and includes the text portion of any tag (such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags)\&.
++.RS
++.TP 0.2i
++\(bu
++On the command line, where the header, footer, or bottom are defined: \f3javadoc -bottom \&'<a href="{@docRoot}/copyright\&.html">Copyright</a>\&'\fR\&.
++
++When you use the \f3{@docRoot}\fR tag this way in a make file, some \f3makefile\fR programs require a special way to escape for the brace \f3{}\fR characters\&. For example, the Inprise MAKE version 5\&.2 running on Windows requires double braces: \f3{{@docRoot}}\fR\&. It also requires double (rather than single) quotation marks to enclose arguments to options such as the \f3-bottom\fR option (with the quotation marks around the \f3href\fR argument omitted)\&.
++.TP 0.2i
++\(bu
++In a documentation comment:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * See the <a href="{@docRoot}/copyright\&.html">Copyright</a>\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This tag is needed because the generated documents are in hierarchical directories, as deep as the number of subpackages\&. The expression: \f3<a href="{@docRoot}/copyright\&.html">\fR resolves to \f3<a href="\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/Object\&.java\fR and \f3<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fR for \f3java/lang/ref/Reference\&.java\fR\&.
++.RE
++
++.TP
++@exception \fIclass-name description\fR
++Introduced in JDK 1\&.0
++
++Identical to the \f3@throws\fR tag\&. See @throws class-name description\&.
++.TP
++{@inheritDoc}
++Introduced in JDK 1\&.4
++
++Inherits (copies) documentation from the nearest inheritable class or implementable interface into the current documentation comment at this tag\&'s location\&. This enables you to write more general comments higher up the inheritance tree and to write around the copied text\&.
++
++This tag is valid only in these places in a documentation comment:
++.RS
++.TP 0.2i
++\(bu
++In the main description block of a method\&. In this case, the main description is copied from a class or interface up the hierarchy\&.
++.TP 0.2i
++\(bu
++In the text arguments of the \f3@return\fR, \f3@param,\fR and \f3@throws\fR tags of a method\&. In this case, the tag text is copied from the corresponding tag up the hierarchy\&.
++.RE
++
++
++See Method Comment Inheritance for a description of how comments are found in the inheritance hierarchy\&. Note that if this tag is missing, then the comment is or is not automatically inherited according to rules described in that section\&.
++.TP
++{@link \fIpackage\&.class#member label\fR}
++Introduced in JDK 1\&.2
++
++Inserts an inline link with a visible text label that points to the documentation for the specified package, class, or member name of a referenced class\&. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field, including the text portion of any tag, such as the \f3@return\fR, \f3@param\fR and \f3@deprecated\fR tags\&. See @link in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#{@link
++
++This tag is similar to the \f3@see\fR tag\&. Both tags require the same references and accept the same syntax for \f3package\&.class#member\fR and \f3label\fR\&. The main difference is that the \f3{@link}\fR tag generates an inline link rather than placing the link in the See Also section\&. The \f3{@link}\fR tag begins and ends with braces to separate it from the rest of the inline text\&. If you need to use the right brace (\f3}\fR) inside the label, then use the HTML entity notation \f3&#125;\fR\&.
++
++There is no limit to the number of \f3{@link}\fR tags allowed in a sentence\&. You can use this tag in the main description part of any documentation comment or in the text portion of any tag, such as the \f3@deprecated\fR, \f3@return\fR or \f3@param\fR tags\&.
++
++For example, here is a comment that refers to the \f3getComponentAt(int, int)\fR method:
++.sp
++.nf
++\f3Use the {@link #getComponentAt(int, int) getComponentAt} method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++From this code, the standard doclet generates the following HTML (assuming it refers to another class in the same package):
++.sp
++.nf
++\f3Use the <a href="Component\&.html#getComponentAt(int, int)">getComponentAt</a> method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The previous line appears on the web page as:
++.sp
++.nf
++\f3Use the getComponentAt method\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++{@linkplain \fIpackage\&.class#member label\fR}
++Introduced in JDK 1\&.4
++
++Behaves the same as the \f3{@link}\fR tag, except the link label is displayed in plain text rather than code font\&. Useful when the label is plain text\&. For example, \f3Refer to {@linkplain add() the overridden method}\fR\&. displays as: Refer to the overridden method\&.
++.TP
++{@literal \fItext\fR}
++Introduced in JDK 1\&.5
++
++Displays text without interpreting the text as HTML markup or nested Javadoc tags\&. This enables you to use angle brackets (\f3< and >\fR) instead of the HTML entities (\f3&lt;\fR and \f3&gt;\fR) in documentation comments, such as in parameter types (\f3<Object>\fR), inequalities (\f33 < 4\fR), or arrows (<-)\&. For example, the documentation comment text \f3{@literal A<B>C}\fR displays unchanged in the generated HTML page in your browser, as \f3A<B>C\fR\&. The \f3<B>\fR is not interpreted as bold (and it is not in code font)\&. If you want the same functionality with the text in code font, then use the \f3{@code}\fR tag\&.
++.TP
++@param \fIparameter-name description\fR
++Introduced in JDK 1\&.0
++
++Adds a parameter with the specified \f3parameter-name\fR followed by the specified description to the Parameters section\&. When writing the documentation comment, you can continue the description onto multiple lines\&. This tag is valid only in a documentation comment for a method, constructor, or class\&. See @param in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@param
++
++The \f3parameter-name\fR can be the name of a parameter in a method or constructor, or the name of a type parameter of a class, method, or constructor\&. Use angle brackets around this parameter name to specify the use of a type parameter\&.
++
++Example of a type parameter of a class:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @param <E> Type of element stored in a list\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public interface List<E> extends Collection<E> {\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Example of a type parameter of a method:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @param string the string to be converted\fP
++.fi
++.nf
++\f3 * @param type the type to convert the string to\fP
++.fi
++.nf
++\f3 * @param <T> the type of the element\fP
++.fi
++.nf
++\f3 * @param <V> the value of the element\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3<T, V extends T> V convert(String string, Class<T> type) {\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++@return \fIdescription\fR
++Introduced in JDK 1\&.0
++
++Adds a Returns section with the description text\&. This text should describe the return type and permissible range of values\&. This tag is valid only in a documentation comment for a method\&. See @return in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@return
++.TP
++@see \fIreference\fR
++Introduced in JDK 1\&.0
++
++Adds a \fISee Also\fR heading with a link or text entry that points to a reference\&. A documentation comment can contain any number of \f3@see\fR tags, which are all grouped under the same heading\&. The \f3@see\fR tag has three variations\&. The form is the most common\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. For inserting an inline link within a sentence to a package, class, or member, see \f3{@link}\fR\&.
++
++\fIForm 1\fR\&. The @see \f3string\fR tag form adds a text entry for \fIstring\fR\&. No link is generated\&. The string is a book or other reference to information not available by URL\&. The \f3javadoc\fR command distinguishes this from the previous cases by searching for a double quotation mark (") as the first character\&. For example, \f3@see "The Java Programming Language"\fR that generates the following text:
++
++\fISee Also\fR:
++
++"The Java Programming Language"
++
++\fIForm 2\fR\&. The \f3@see <a href="URL#value">label</a>\fR form adds a link as defined by \f3URL#value\fR\&. The \f3URL#value\fR parameter is a relative or absolute URL\&. The \f3javadoc\fR command distinguishes this from other cases by searching for a less-than symbol (\f3<\fR) as the first character\&. For example, \f3@see <a href="spec\&.html#section">Java Spec</a>\fR generates the following link:
++
++\fISee Also\fR:
++
++Java Spec
++
++\fIForm 3\fR\&. The \f3@see package\&.class#member label\fR form adds a link with a visible text label that points to the documentation for the specified name in the Java Language that is referenced\&. The label is optional\&. If the label is omitted, then the name appears instead as visible text, suitably shortened\&. Use the \f3-noqualifier\fR option to globally remove the package name from this visible text\&. Use the label when you want the visible text to be different from the autogenerated visible text\&. See How a Name Appears\&.
++
++In Java SE 1\&.2 only, the name but not the label automatically appears in \f3<code>\fR HTML tags\&. Starting with Java SE 1\&.2\&.2, the \f3<code>\fR tag is always included around the visible text, whether or not a label is used\&.
++.RS
++.TP 0.2i
++\(bu
++\f3package\&.class#member\fR is any valid program element name that is referenced, such as a package, class, interface, constructor, method or field name, except that the character ahead of the member name should be a number sign (\f3#\fR)\&. The class represents any top-level or nested class or interface\&. The member represents any constructor, method, or field (not a nested class or interface)\&. If this name is in the documented classes, then the \f3javadoc\fR command create a link to it\&. To create links to external referenced classes, use the \f3-link\fR option\&. Use either of the other two \f3@see\fR tag forms to refer to the documentation of a name that does not belong to a referenced class\&. See Specify a Name\&.
++
++\fINote:\fR External referenced classes are classes that are not passed into the \f3javadoc\fR command on the command line\&. Links in the generated documentation to external referenced classes are called external references or external links\&. For example, if you run the \f3javadoc\fR command on only the \f3java\&.awt package\fR, then any class in \f3java\&.lang\fR, such as \f3Object\fR, is an external referenced class\&. Use the \f3-link\fR and \f3-linkoffline\fR options to link to external referenced classes\&. The source comments of external referenced classes are not available to the \f3javadoc\fR command run\&.
++.TP 0.2i
++\(bu
++\f3label\fR is optional text that is visible as the link label\&. The label can contain white space\&. If \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears, suitably shortened relative to the current class and package\&. See How a Name Appears\&.
++.TP 0.2i
++\(bu
++A space is the delimiter between \f3package\&.class#member\fR and \f3label\fR\&. A space inside parentheses does not indicate the start of a label, so spaces can be used between parameters in a method\&.
++.RE
++
++
++\fI\fRIn the following example, an \f3@see\fR tag (in the \f3Character\fR class) refers to the equals method in the \f3String\fR class\&. The tag includes both arguments: the name \f3String#equals(Object)\fR and the label \f3equals\fR\&.
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @see String#equals(Object) equals\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The standard doclet produces HTML that is similar to:
++.sp
++.nf
++\f3<dl>\fP
++.fi
++.nf
++\f3<dt><b>See Also:</b>\fP
++.fi
++.nf
++\f3<dd><a href="\&.\&./\&.\&./java/lang/String#equals(java\&.lang\&.Object)"><code>equals<code></a>\fP
++.fi
++.nf
++\f3</dl>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The previous code looks similar to the following in a browser, where the label is the visible link text:
++
++\fISee Also\fR:
++
++equals
++.PP
++Specify a Name
++
++\fI\fRThis \f3package\&.class#member\fR name can be either fully qualified, such as \f3java\&.lang\&.String#toUpperCase()\fR or not, such as \f3String#toUpperCase()\fR or \f3#toUpperCase()\fR\&. If the name is less than fully qualified, then the \f3javadoc\fR command uses the standard Java compiler search order to find it\&. See Search Order for the @see Tag\&. The name can contain white space within parentheses, such as between method arguments\&.The advantage to providing shorter, partially qualified names is that they are shorter to type and there is less clutter in the source code\&. The following listing shows the different forms of the name, where \f3Class\fR can be a class or interface; Type can be a class, interface, array, or primitive; and method can be a method or constructor\&.
++.sp
++.nf
++\f3\fITypical forms for\fR\fI @see package\&.class#member\fR\fP
++.fi
++.nf
++\f3\fIReferencing a member of the current class\fR\fP
++.fi
++.nf
++\f3@see #field\fP
++.fi
++.nf
++\f3@see #method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see #constructor(Type argname, Type argname,\&.\&.\&.) \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\fIReferencing another class in the current or imported packages\fR\fP
++.fi
++.nf
++\f3@see Class#field\fP
++.fi
++.nf
++\f3@see Class#method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see Class\&.NestedClass\fP
++.fi
++.nf
++\f3@see Class \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\fIReferencing an element in another package (fully qualified)\fR\fP
++.fi
++.nf
++\f3@see package\&.Class#field\fP
++.fi
++.nf
++\f3@see package\&.Class#method(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#method(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#constructor(Type, Type,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class#constructor(Type argname, Type argname,\&.\&.\&.)\fP
++.fi
++.nf
++\f3@see package\&.Class\&.NestedClass\fP
++.fi
++.nf
++\f3@see package\&.Class\fP
++.fi
++.nf
++\f3@see package\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3\fRNotes about the previous listing:
++.TP 0.2i
++\(bu
++The first set of forms with no class or package causes the \f3javadoc\fR command to search only through the current class hierarchy\&. It finds a member of the current class or interface, one of its superclasses or superinterfaces, or one of its enclosing classes or interfaces (search Items 1\(en3)\&. It does not search the rest of the current package or other packages (search Items 4\(en5)\&. See Search Order for the @see Tag\&.
++.TP 0.2i
++\(bu
++If any method or constructor is entered as a name with no parentheses, such as \f3getValue\fR, and if there is no field with the same name, then the \f3javadoc\fR command still creates a link to the method\&. If this method is overloaded, then the \f3javadoc\fR command links to the first method its search encounters, which is unspecified\&.
++.TP 0.2i
++\(bu
++Nested classes must be specified as \f3outer\&.inner\fR, not simply \f3inner\fR, for all forms\&.
++.TP 0.2i
++\(bu
++As stated, the number sign (\f3#\fR), rather than a dot (\f3\&.\fR) separates a member from its class\&. This enables the \f3javadoc\fR command to resolve ambiguities, because the dot also separates classes, nested classes, packages, and subpackages\&. However, the \f3javadoc\fR command properly parses a dot when there is no ambiguity, but prints a warning to alert you\&.
++.PP
++Search Order for the @see Tag
++
++\fI\fRThe \f3javadoc\fR command processes an \f3@see\fR tag that appears in a source file, package file, or overview file\&. In the latter two files, you must fully qualify the name you supply with the \f3@see\fR tag\&. In a source file, you can specify a name that is fully qualified or partially qualified\&.
++.PP
++The following is the search order for the \f3@see\fR tag\&.
++.TP 0.4i
++1\&.
++The current class or interface\&.
++.TP 0.4i
++2\&.
++Any enclosing classes and interfaces searching the closest first\&.
++.TP 0.4i
++3\&.
++Any superclasses and superinterfaces, searching the closest first\&.
++.TP 0.4i
++4\&.
++The current package\&.
++.TP 0.4i
++5\&.
++Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statement\&.
++.PP
++The \f3javadoc\fR command continues to search recursively through Items 1-3 for each class it encounters until it finds a match\&. That is, after it searches through the current class and its enclosing class E, it searches through the superclasses of E before the enclosing classes of E\&. In Items 4 and 5, the \f3javadoc\fR command does not search classes or interfaces within a package in any specified order (that order depends on the particular compiler)\&. In Item 5, the \f3javadoc\fR command searches in \fIjava\&.lang\fR because that is imported by all programs\&.
++.PP
++When the \f3javadoc\fR command encounters an \f3@see\fR tag in a source file that is not fully qualified, it searches for the specified name in the same order as the Java compiler would, except the \f3javadoc\fR command does not detect certain name space ambiguities because it assumes the source code is free of these errors\&. This search order is formally defined in the Java Language Specification\&. The \f3javadoc\fR command searches for that name through all related and imported classes and packages\&. In particular, it searches in this order:
++.TP 0.4i
++1\&.
++The current class or interface\&.
++.TP 0.4i
++2\&.
++Any enclosing classes and interfaces, searching the closest first\&.
++.TP 0.4i
++3\&.
++Any superclasses and superinterfaces, searching the closest first\&.
++.TP 0.4i
++4\&.
++The current package\&.
++.TP 0.4i
++5\&.
++Any imported packages, classes, and interfaces, searching in the order of the \f3import\fR statements\&.
++.PP
++The \f3javadoc\fR command does not necessarily look in subclasses, nor will it look in other packages even when their documentation is being generated in the same run\&. For example, if the \f3@see\fR tag is in the \f3java\&.awt\&.event\&.KeyEvent\fR class and refers to a name in the \f3java\&.awt package\fR, then the \f3javadoc\fR command does not look in that package unless that class imports it\&.
++.PP
++How a Name Appears
++
++\fI\fRIf \f3label\fR is omitted, then \f3package\&.class\&.member\fR appears\&. In general, it is suitably shortened relative to the current class and package\&. Shortened means the \f3javadoc\fR command displays only the minimum name necessary\&. For example, if the \f3String\&.toUpperCase()\fR method contains references to a member of the same class and to a member of a different class, then the class name is displayed only in the latter case, as shown in the following listing\&. Use the \f3-noqualifier\fR option to globally remove the package names\&.
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of the same class, same package
++.br
++\fIExample in\fR: \f3@see String#toLowerCase()\fR
++.br
++\fIAppears as\fR: \f3toLowerCase()\fR - omits the package and class names
++.br
++
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, same package
++.br
++\fIExample in\fR: \f3@see Character#toLowerCase(char)\fR
++.br
++\fIAppears as\fR: \f3Character\&.toLowerCase(char)\fR - omits the package name, includes the class name
++.br
++
++.PP
++\fIType of reference\fR: The \f3@see\fR tag refers to a member of a different class, different package
++.br
++\fIExample in\fR: \f3@see java\&.io\&.File#exists()\fR
++.br
++\fIAppears as\fR: \f3java\&.io\&.File\&.exists()\fR - includes the package and class names
++.br
++
++.PP
++Examples of the @see Tag
++
++The comment to the right shows how the name appears when the \f3@see\fR tag is in a class in another package, such as \f3java\&.applet\&.Applet\fR\&. See @see in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@see
++.sp
++.nf
++\f3 See also:\fP
++.fi
++.nf
++\f3@see java\&.lang\&.String // String \fP
++.fi
++.nf
++\f3@see java\&.lang\&.String The String class // The String class \fP
++.fi
++.nf
++\f3@see String // String \fP
++.fi
++.nf
++\f3@see String#equals(Object) // String\&.equals(Object) \fP
++.fi
++.nf
++\f3@see String#equals // String\&.equals(java\&.lang\&.Object) \fP
++.fi
++.nf
++\f3@see java\&.lang\&.Object#wait(long) // java\&.lang\&.Object\&.wait(long) \fP
++.fi
++.nf
++\f3@see Character#MAX_RADIX // Character\&.MAX_RADIX \fP
++.fi
++.nf
++\f3@see <a href="spec\&.html">Java Spec</a> // Java Spec \fP
++.fi
++.nf
++\f3@see "The Java Programming Language" // "The Java Programming Language" \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fINote:\fR You can extend the \f3@se\fR\f3e\fR tag to link to classes not being documented with the \f3-link\fR option\&.
++.TP
++@serial \fIfield-description\fR | include | exclude
++Introduced in JDK 1\&.2
++
++Used in the documentation comment for a default serializable field\&. See Documenting Serializable Fields and Data for a Class at http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial-arch\&.html#5251
++
++See also Oracle\(cqs Criteria for Including Classes in the Serialized Form Specification at http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized-criteria-137781\&.html
++
++An optional \f3field-description\fR should explain the meaning of the field and list the acceptable values\&. When needed, the description can span multiple lines\&. The standard doclet adds this information to the serialized form page\&. See Cross-Reference Pages\&.
++
++If a serializable field was added to a class after the class was made serializable, then a statement should be added to its main description to identify at which version it was added\&.
++
++The \f3include\fR and \f3exclude\fR arguments identify whether a class or package should be included or excluded from the serialized form page\&. They work as follows:
++.RS
++.TP 0.2i
++\(bu
++A public or protected class that implements \f3Serializable\fR is included unless that class (or its package) is marked with the \f3@serial exclude\fR tag\&.
++.TP 0.2i
++\(bu
++A private or package-private class that implements \f3Serializable\fR is excluded unless that class (or its package) is marked with the \f3@serial include\fR tag\&.
++.RE
++
++
++For example, the \f3javax\&.swing\fR package is marked with the \f3@serial\fR\f3exclude\fR tag in package\&.html or package-info\&.java\&. The public class \f3java\&.security\&.BasicPermission\fR is marked with the \f3@serial exclude\fR tag\&. The package-private class \f3java\&.util\&.PropertyPermissionCollection\fR is marked with the \f3@serial include\fR tag\&.
++
++The \f3@serial\fR tag at the class level overrides the \f3@serial\fR tag at the package level\&.
++.TP
++@serialData \fIdata-description\fR
++Introduced in JDK 1\&.2
++
++Uses the data description value to document the types and order of data in the serialized form\&. This data includes the optional data written by the \f3writeObject\fR method and all data (including base classes) written by the \f3Externalizable\&.writeExternal\fR method\&.
++
++The \f3@serialData\fR tag can be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
++.TP
++@serialField \fIfield-name\fR\fIfield-type\fR\fIfield-description\fR
++Introduced in JDK 1\&.2
++
++Documents an \f3ObjectStreamField\fR component of the \f3serialPersistentFields\fR member of a \f3Serializable\fR class\&. Use one \f3@serialField\fR tag for each \f3ObjectStreamField\fR component\&.
++.TP
++@since \fIsince-text\fR
++Introduced in JDK 1\&.1
++
++Adds a \fISince\fR heading with the specified \f3since-text\fR value to the generated documentation\&. The text has no special internal structure\&. This tag is valid in any documentation comment: overview, package, class, interface, constructor, method, or field\&. This tag means that this change or feature has existed since the software release specified by the \f3since-text\fR value, for example: \f3@since 1\&.5\fR\&.
++
++For Java platform source code, the \f3@since\fR tag indicates the version of the Java platform API specification, which is not necessarily when the source code was added to the reference implementation\&. Multiple \f3@since\fR tags are allowed and are treated like multiple \f3@author\fR tags\&. You could use multiple tags when the program element is used by more than one API\&.
++.TP
++@throws \fIclass-name\fR\fIdescription\fR
++Introduced in JDK 1\&.2
++
++Behaves the same as the \f3@exception\fR tag\&. See @throws in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@exception
++
++The \f3@throws\fR tag adds a \fIThrows\fR subheading to the generated documentation, with the \f3class-name\fR and \f3description\fR text\&. The \fIclass-name\fR is the name of the exception that might be thrown by the method\&. This tag is valid only in the documentation comment for a method or constructor\&. If this class is not fully specified, then the \f3javadoc\fR command uses the search order to look up this class\&. Multiple \f3@throws\fR tags can be used in a specified documentation comment for the same or different exceptions\&. See Search Order for the @see Tag\&.
++
++To ensure that all checked exceptions are documented, when an \f3@throws\fR tag does not exist for an exception in the throws clause, the \f3javadoc\fR command adds that exception to the HTML output (with no description) as though it were documented with the \f3@throws\fR tag\&.
++
++The \f3@throws\fR documentation is copied from an overridden method to a subclass only when the exception is explicitly declared in the overridden method\&. The same is true for copying from an interface method to an implementing method\&. You can use the \f3{@inheritDoc}\fR tag to force the \f3@throws\fR tag to inherit documentation\&.
++.TP
++{@value \fIpackage\&.class#field\fR}
++Introduced in JDK 1\&.4
++
++Displays constant values\&. When the \f3{@value}\fR tag is used without an argument in the documentation comment of a static field, it displays the value of that constant:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * The value of this constant is {@value}\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public static final String SCRIPT_START = "<script>"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When used with the argument \f3package\&.class#field\fR in any documentation comment, he \f3{@value}\fR tag displays the value of the specified constant:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Evaluates the script starting with {@value #SCRIPT_START}\&.\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3public String evalScript(String script) {}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The argument \f3package\&.class#field\fR takes a form similar to that of the \f3@see\fR tag argument, except that the member must be a static field\&.
++
++The values of these constants are also displayed in Constant Field Values at http://docs\&.oracle\&.com/javase/8/docs/api/constant-values\&.html
++.TP
++@version \fIversion-text\fR
++Introduced in JDK 1\&.0
++
++Adds a \fIVersion\fR subheading with the specified \f3version-text\fR value to the generated documents when the \f3-version\fR option is used\&. This tag is intended to hold the current release number of the software that this code is part of, as opposed to the\f3@since\fR tag, which holds the release number where this code was introduced\&. The \f3version-text\fR value has no special internal structure\&. See @version in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#@version
++
++A documentation comment can contain multiple \f3@version\fR tags\&. When it makes sense, you can specify one release number per \f3@version\fR tag or multiple release numbers per tag\&. In the former case, the \f3javadoc\fR command inserts a comma (,) and a space between the names\&. In the latter case, the entire text is copied to the generated document without being parsed\&. Therefore, you can use multiple names per line when you want a localized name separator other than a comma\&.
++.SH WHERE\ TAGS\ CAN\ BE\ USED
++The following sections describe where tags can be used\&. Note that the following tags can be used in all documentation comments: \f3@see\fR, \f3@since\fR, \f3@deprecated\fR, \f3{@link}\fR, \f3{@linkplain}\fR, and \f3{@docroot}\fR\&.
++.SS OVERVIEW\ TAGS
++Overview tags are tags that can appear in the documentation comment for the overview page (which resides in the source file typically named overview\&.html)\&. Similar to any other documentation comments, these tags must appear after the main description
++.PP
++\fINote:\fR The \f3{@link}\fR tag has a bug in overview documents in Java SE 1\&.2\&. The text appears correctly but has no link\&. The \f3{@docRoot}\fR tag does not currently work in overview documents\&.
++.PP
++The overview tags are the following:
++.PP
++@see reference || @since since-text || @serialField field-name field-type field-description || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.SS PACKAGE\ TAGS
++Package tags are tags that can appear in the documentation comment for a package, that resides in the source file named package\&.html or package-info\&.java\&. The \f3@serial\fR tag can only be used here with the \f3include\fR or \f3exclude\fR argument\&.
++.PP
++The package tags are the following:
++.PP
++@see reference || @since since-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@linkplain package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.SS CLASS\ AND\ INTERFACE\ TAGS
++The following are tags that can appear in the documentation comment for a class or interface\&. The \f3@serial\fR tag can only be used within the documentation for a class or interface with an \f3include\fR or \f3exclude\fR argument\&.
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @author name-text || @version version-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} ||
++.PP
++Class comment example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * A class representing a window on the screen\&.\fP
++.fi
++.nf
++\f3 * For example:\fP
++.fi
++.nf
++\f3 * <pre>\fP
++.fi
++.nf
++\f3 * Window win = new Window(parent);\fP
++.fi
++.nf
++\f3 * win\&.show();\fP
++.fi
++.nf
++\f3 * </pre>\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @author Sami Shaio\fP
++.fi
++.nf
++\f3 * @version 1\&.13, 06/08/06\fP
++.fi
++.nf
++\f3 * @see java\&.awt\&.BaseWindow\fP
++.fi
++.nf
++\f3 * @see java\&.awt\&.Button\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3class Window extends BaseWindow {\fP
++.fi
++.nf
++\f3 \&.\&.\&.\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS FIELD\ TAGS
++These tags can appear in fields:
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @serial field-description | include | exclude || @serialField field-name field-type field-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || {@value package\&.class#field}
++.PP
++Field comment example:
++.sp
++.nf
++\f3 /**\fP
++.fi
++.nf
++\f3 * The X\-coordinate of the component\&.\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @see #getLocation()\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3 int x = 1263732;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS CONSTRUCTOR\ AND\ METHOD\ TAGS
++The following tags can appear in the documentation comment for a constructor or a method, except for the \f3@return\fR tag, which cannot appear in a constructor, and the \f3{@inheritDoc}\fR tag, which has restrictions\&.
++.PP
++@see reference || @since since-text || @deprecated deprecated-text || @param parameter-name description || @return description || @throws class-name description || @exception class-name description || @serialData data-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@inheritDoc} || {@docRoot}
++.PP
++\fINote:\fR The \f3@serialData\fR tag can only be used in the documentation comment for the \f3writeObject\fR, \f3readObject\fR, \f3writeExternal\fR, \f3readExternal\fR, \f3writeReplace\fR, and \f3readResolve\fR methods\&.
++.PP
++Method comment example:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * Returns the character at the specified index\&. An index \fP
++.fi
++.nf
++\f3 * ranges from <code>0</code> to <code>length() \- 1</code>\fP
++.fi
++.nf
++\f3 *\fP
++.fi
++.nf
++\f3 * @param index the index of the desired character\&.\fP
++.fi
++.nf
++\f3 * @return the desired character\&.\fP
++.fi
++.nf
++\f3 * @exception StringIndexOutOfRangeException \fP
++.fi
++.nf
++\f3 * if the index is not in the range <code>0</code> \fP
++.fi
++.nf
++\f3 * to <code>length()\-1</code>\fP
++.fi
++.nf
++\f3 * @see java\&.lang\&.Character#charValue()\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3 public char charAt(int index) {\fP
++.fi
++.nf
++\f3 \&.\&.\&.\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++The \f3javadoc\fR command uses doclets to determine its output\&. The \f3javadoc\fR command uses the default standard doclet unless a custom doclet is specified with the \f3-doclet\fR option\&. The \f3javadoc\fR command provides a set of command-line options that can be used with any doclet\&. These options are described in Javadoc Options\&. The standard doclet provides an additional set of command-line options that are described in Standard Doclet Options\&. All option names are not case-sensitive, but their arguments are case-sensitive\&.
++.TP 0.2i
++\(bu
++See also Javadoc Options
++.TP 0.2i
++\(bu
++See also Standard Doclet Options
++.PP
++The options are:
++.PP
++-1\&.1 || -author || -bootclasspath classpathlist || -bottom text || -breakiterator || -charset name || -classpath classpathlist || -d directory || -docencoding name || -docfilesubdirs || -doclet class || -docletpath classpathlist || -doctitle title || -encoding || -exclude packagename1:packagename2:\&.\&.\&. || -excludedocfilessubdir name1:name2 || -extdirs dirist || -footer footer || -group groupheading packagepattern:packagepattern || -header header || -help || -helpfile path\efilename || -Jflag || -javafx ||-keywords || -link extdocURL || -linkoffline extdocURL packagelistLoc || -linksource || -locale language_country_variant || -nocomment || -nodeprecated || -nodeprecatedlist || -nohelp || -noindex || -nonavbar || -noqualifier all | packagename1:packagename2\&.\&.\&. || -nosince || -notimestamp || -notree || -overview path/filename || -package || -private || -protected || -public || -quiet || -serialwarn || -source release || -sourcepath sourcepathlist || -sourcetab tablength || -splitindex || -stylesheet path/filename || -subpackages package1:package2:\&.\&.\&. || -tag tagname:Xaoptcmf:"taghead" || -taglet class || -tagletpath tagletpathlist || -title title || -top || -use || -verbose || -version || -windowtitle title
++.PP
++The following options are the core Javadoc options that are available to all doclets\&. The standard doclet provides the rest of the doclets: \f3-bootclasspath\fR, \f3-breakiterator\fR, \f3-classpath\fR, \f3-doclet\fR, \f3-docletpath\fR, \f3-encoding\fR, -\f3exclude\fR, \f3-extdirs\fR, \f3-help\fR, \f3-locale\fR, \f3-\fR\f3overview\fR, \f3-package\fR, \f3-private\fR, \f3-protected\fR, \f3-public\fR, \f3-quiet\fR, \f3-source\fR, \f3-sourcepath\fR, \f3-subpackages\fR, and \f3-verbose\fR\&.
++.SS JAVADOC\ OPTIONS
++.TP
++-overview \fIpath/filename\fR
++.br
++Specifies that the \f3javadoc\fR command should retrieve the text for the overview documentation from the source file specified by the \fIpath/filename\fRand place it on the Overview page (overview-summary\&.html)\&. The \fIpath/filename\fRis relative to the current directory\&.
++
++While you can use any name you want for the \f3filename\fR value and place it anywhere you want for the path, it is typical to name it overview\&.html and place it in the source tree at the directory that contains the topmost package directories\&. In this location, no path is needed when documenting packages, because the \f3-sourcepath\fR option points to this file\&.
++
++For example, if the source tree for the \f3java\&.lang\fR package is /src/classes/java/lang/, then you could place the overview file at /src/classes/overview\&.html
++
++See Real-World Examples\&.
++
++For information about the file specified by \fIpath/filename,\fRsee Overview Comment Files\&.
++
++The overview page is created only when you pass two or more package names to the \f3javadoc\fR command\&. For a further explanation, see HTML Frames\&. The title on the overview page is set by \f3-doctitle\fR\&.
++.TP
++-Xdoclint:(all|none|[-]\fI<group>\fR)
++.br
++Reports warnings for bad references, lack of accessibility and missing Javadoc comments, and reports errors for invalid Javadoc syntax and missing HTML tags\&.
++
++This option enables the \f3javadoc\fR command to check for all documentation comments included in the generated output\&. As always, you can select which items to include in the generated output with the standard options \f3-public\fR, \f3-protected\fR, \f3-package\fR and \f3-private\fR\&.
++
++When the \f3-Xdoclint\fR is enabled, it reports issues with messages similar to the \f3javac\fR command\&. The \f3javadoc\fR command prints a message, a copy of the source line, and a caret pointing at the exact position where the error was detected\&. Messages may be either warnings or errors, depending on their severity and the likelihood to cause an error if the generated documentation were run through a validator\&. For example, bad references or missing Javadoc comments do not cause the \f3javadoc\fR command to generate invalid HTML, so these issues are reported as warnings\&. Syntax errors or missing HTML end tags cause the \f3javadoc\fR command to generate invalid output, so these issues are reported as errors\&.
++
++By default, the \f3-Xdoclint\fR option is enabled\&. Disable it with the option \f3-Xdoclint:none\fR\&.
++
++Change what the \f3-Xdoclint\fR option reports with the following options:
++.RS
++.TP 0.2i
++\(bu
++\f3-Xdoclint none\fR : disable the \f3-Xdoclint\fR option
++.TP 0.2i
++\(bu
++\f3-Xdoclint\fR\fIgroup\fR : enable \fIgroup\fR checks
++.TP 0.2i
++\(bu
++\f3-Xdoclint all\fR : enable all groups of checks
++.TP 0.2i
++\(bu
++\f3-Xdoclint all,\fR\fI-group\fR : enable all except \fIgroup\fR checks
++.RE
++
++
++The variable \fIgroup\fR has one of the following values:
++.RS
++.TP 0.2i
++\(bu
++\f3accessibility\fR : Checks for the issues to be detected by an accessibility checker (for example, no caption or summary attributes specified in a \f3<table>\fR tag)\&.
++.TP 0.2i
++\(bu
++\f3html\fR : Detects high-level HTML issues, like putting block elements inside inline elements, or not closing elements that require an end tag\&. The rules are derived from theHTML 4\&.01 Specification\&. This type of check enables the \f3javadoc\fR command to detect HTML issues that many browsers might accept\&.
++.TP 0.2i
++\(bu
++\f3missing\fR : Checks for missing Javadoc comments or tags (for example, a missing comment or class, or a missing \f3@return\fR tag or similar tag on a method)\&.
++.TP 0.2i
++\(bu
++\f3reference\fR : Checks for issues relating to the references to Java API elements from Javadoc tags (for example, item not found in \f3@see\fR , or a bad name after \f3@param)\fR\&.
++.TP 0.2i
++\(bu
++\f3syntax\fR : Checks for low level issues like unescaped angle brackets (\f3<\fR and \f3>\fR) and ampersands (\f3&\fR) and invalid Javadoc tags\&.
++.RE
++
++
++You can specify the \f3-Xdoclint\fR option multiple times to enable the option to check errors and warnings in multiple categories\&. Alternatively, you can specify multiple error and warning categories by using the preceding options\&. For example, use either of the following commands to check for the HTML, syntax, and accessibility issues in the file \fIfilename\fR\&.
++.sp
++.nf
++\f3javadoc \-Xdoclint:html \-Xdoclint:syntax \-Xdoclint:accessibility \fIfilename\fR\fP
++.fi
++.nf
++\f3javadoc \-Xdoclint:html,syntax,accessibility \fIfilename\fR\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR The \f3javadoc\fR command does not guarantee the completeness of these checks\&. In particular, it is not a full HTML compliance checker\&. The goal of the -\f3Xdoclint\fR option is to enable the \f3javadoc\fR command to report majority of common errors\&.
++
++The \f3javadoc\fR command does not attempt to fix invalid input, it just reports it\&.
++.TP
++-public
++.br
++Shows only public classes and members\&.
++.TP
++-protected
++.br
++Shows only protected and public classes and members\&. This is the default\&.
++.TP
++-package
++.br
++Shows only package, protected, and public classes and members\&.
++.TP
++-private
++.br
++Shows all classes and members\&.
++.TP
++-help
++.br
++Displays the online help, which lists all of the \f3javadoc\fR and \f3doclet\fR command-line options\&.
++.TP
++-doclet \fIclass\fR
++.br
++Specifies the class file that starts the doclet used in generating the documentation\&. Use the fully qualified name\&. This doclet defines the content and formats the output\&. If the \f3-doclet\fR option is not used, then the \f3javadoc\fR command uses the standard doclet for generating the default HTML format\&. This class must contain the \f3start(Root)\fR method\&. The path to this starting class is defined by the \f3-docletpath\fR option\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.TP
++-docletpath \fIclasspathlist\fR
++.br
++Specifies the path to the doclet starting class file (specified with the \f3-doclet\fR option) and any JAR files it depends on\&. If the starting class file is in a JAR file, then this option specifies the path to that JAR file\&. You can specify an absolute path or a path relative to the current directory\&. If \f3classpathlist\fR contains multiple paths or JAR files, then they should be separated with a colon (:) on Oracle Solaris and a semi-colon (;) on Windows\&. This option is not necessary when the doclet starting class is already in the search path\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.TP
++-1\&.1
++.br
++Removed from Javadoc 1\&.4 with no replacement\&. This option created documentation with the appearance and functionality of documentation generated by Javadoc 1\&.1 (it never supported nested classes)\&. If you need this option, then use Javadoc 1\&.2 or 1\&.3 instead\&.
++.TP
++-source \fIrelease\fR
++.br
++Specifies the release of source code accepted\&. The following values for the \f3release\fR parameter are allowed\&. Use the value of \f3release\fR that corresponds to the value used when you compile code with the \f3javac\fR command\&.
++.RS
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.5\fR\&. The \f3javadoc\fR command accepts code containing generics and other language features introduced in JDK 1\&.5\&. The compiler defaults to the 1\&.5 behavior when the \f3-source\fR option is not used\&.
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.4\fR\&. The \f3javadoc\fR command accepts code containing assertions, which were introduced in JDK 1\&.4\&.
++.TP 0.2i
++\(bu
++\fIRelease Value: 1\&.3\fR\&. The \f3javadoc\fR command does not support assertions, generics, or other language features introduced after JDK 1\&.3\&.
++.RE
++
++.TP
++-sourcepath \fIsourcepathlist\fR
++.br
++Specifies the search paths for finding source files when passing package names or the \f3-subpackages\fR option into the \f3javadoc\fR command\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Note that this option is not only used to locate the source files being documented, but also to find source files that are not being documented, but whose comments are inherited by the source files being documented\&.
++
++You can use the \f3-sourcepath\fR option only when passing package names into the \f3javadoc\fR command\&. This will not locate source files passed into the \f3javadoc\fR command\&. To locate source files, \f3\fRchange to that directory or include the path ahead of each file, as shown at Document One or More Classes\&. If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses the class path to find the source files (see \f3-classpath\fR)\&. The default \f3-sourcepath\fR is the value of class path\&. If \f3-classpath\fR is omitted and you pass package names into the \f3javadoc\fR command, then the \f3javadoc\fR command searches in the current directory and subdirectories for the source files\&.
++
++Set \f3sourcepathlist\fR to the root directory of the source tree for the package you are documenting\&.
++
++For example, suppose you want to document a package called \f3com\&.mypackage\fR, whose source files are located at:/home/user/src/com/mypackage/*\&.java\&. Specify the sourcepath to /home/user/src, the directory that contains com\emypackage, and then supply the package name, as follows:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/src/ com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Notice that if you concatenate the value of sourcepath and the package name together and change the dot to a slash (/), then you have the full path to the package:
++
++/home/user/src/com/mypackage
++
++To point to two source paths:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user1/src:/home/user2/src com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-classpath \fIclasspathlist\fR
++.br
++Specifies the paths where the \f3javadoc\fR command searches for referenced classes These are the documented classes plus any classes referenced by those classes\&. Separate multiple paths with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&. Follow the instructions in the class path documentation for specifying the \f3classpathlist\fR value\&.
++
++If you omit \f3-sourcepath\fR, then the \f3javadoc\fR command uses \f3-classpath\fR to find the source files and class files (for backward compatibility)\&. If you want to search for source and class files in separate paths, then use both \f3-sourcepath\fR and \f3-classpath\fR\&.
++
++For example, if you want to document \f3com\&.mypackage\fR, whose source files reside in the directory /home/user/src/com/mypackage, and if this package relies on a library in /home/user/lib, then you would use the following command:
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/lib \-classpath /home/user/src com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Similar to other tools, if you do not specify \f3-classpath\fR, then the \f3javadoc\fR command uses the \f3CLASSPATH\fR environment variable when it is set\&. If both are not set, then the \f3javadoc\fR command searches for classes from the current directory\&.
++
++For an in-depth description of how the \f3javadoc\fR command uses \f3-classpath\fR to find user classes as it relates to extension classes and bootstrap classes, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++
++A class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
++
++For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JA\fRR, then the class path element \f3foo/*\fR is expanded to a \f3A\&.jar:b\&.JAR\fR, except that the order of JAR files is unspecified\&. All JAR files in the specified directory including hidden files are included in the list\&. A class path entry that consists of * expands to a list of all the jar files in the current directory\&. The \f3CLASSPATH\fR environment variable is similarly expanded\&. Any class path wildcard expansion occurs before the Java Virtual Machine (JVM) starts\&. No Java program ever sees unexpanded wild cards except by querying the environment, for example, by calling System\&.getenv(\f3"CLASSPATH"\fR)\&.
++.TP
++-subpackages \fIpackage1:package2:\&.\&.\&.\fR
++.br
++Generates documentation from source files in the specified packages and recursively in their subpackages\&. This option is useful when adding new subpackages to the source code because they are automatically included\&. Each package argument is any top-level subpackage (such as \f3java\fR) or fully qualified package (such as \f3javax\&.swing\fR) that does not need to contain source files\&. Arguments are separated by colons on all operating systems\&. Wild cards are not allowed\&. Use \f3-sourcepath\fR to specify where to find the packages\&. This option does not process source files that are in the source tree but do not belong to the packages\&. See Process Source Files\&.
++
++For example, the following command generates documentation for packages named \f3java\fR and \f3javax\&.swing\fR and all of their subpackages\&.
++.sp
++.nf
++\f3javadoc \-d docs \-sourcepath /home/user/src \-subpackages java:javax\&.swing \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-exclude \fIpackagename1:packagename2:\&.\&.\&.\fR
++.br
++Unconditionally excludes the specified packages and their subpackages from the list formed by \f3-subpackages\fR\&. It excludes those packages even when they would otherwise be included by some earlier or later \f3-subpackages\fR option\&.
++
++The following example would include \f3java\&.io\fR, \f3java\&.util\fR, and \f3java\&.math\fR (among others), but would exclude packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice that this example excludes \f3java\&.lang\&.ref\fR, which is a subpackage of \f3java\&.lang\fR\&.
++.sp
++.nf
++\f3javadoc \-sourcepath /home/user/src \-subpackages java \-exclude \fP
++.fi
++.nf
++\f3 java\&.net:java\&.lang\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-bootclasspath \fIclasspathlist\fR
++.br
++Specifies the paths where the boot classes reside\&. These are typically the Java platform classes\&. The \f3bootclasspath\fR is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. For more information, see How Classes Are Found at http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++
++Separate directories in the \f3classpathlist\fR parameters with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
++.TP
++-extdirs \fIdirist\fR
++.br
++Specifies the directories where extension classes reside\&. These are any classes that use the Java Extension mechanism\&. The \f3extdirs\fR option is part of the search path the \f3javadoc\fR command uses to look up source and class files\&. See the \f3-classpath\fR option for more information\&. Separate directories in \f3dirlist\fR with semicolons (;) for Windows and colons (:) for Oracle Solaris\&.
++.TP
++-verbose
++.br
++Provides more detailed messages while the \f3javadoc\fR command runs\&. Without the \f3verbose\fR option, messages appear for loading the source files, generating the documentation (one message per source file), and sorting\&. The verbose option causes the printing of additional messages that specify the number of milliseconds to parse each Java source file\&.
++.TP
++-quiet
++.br
++Shuts off messages so that only the warnings and errors appear to make them easier to view\&. It also suppresses the \f3version\fR string\&.
++.TP
++-breakiterator
++.br
++Uses the internationalized sentence boundary of \f3java\&.text\&.BreakIterator\fR to determine the end of the first sentence in the main description of a package, class, or member for English\&. All other locales already use the \f3BreakIterator\fR class, rather than an English language, locale-specific algorithm\&. The first sentence is copied to the package, class, or member summary and to the alphabetic index\&. From JDK 1\&.2 and later, the \f3BreakIterator\fR class is used to determine the end of a sentence for all languages except for English\&. Therefore, the \f3-breakiterator\fR option has no effect except for English from 1\&.2 and later\&. English has its own default algorithm:
++.RS
++.TP 0.2i
++\(bu
++English default sentence-break algorithm\&. Stops at a period followed by a space or an HTML block tag, such as \f3<P>\fR\&.
++.TP 0.2i
++\(bu
++Breakiterator sentence-break algorithm\&. Stops at a period, question mark, or exclamation point followed by a space when the next word starts with a capital letter\&. This is meant to handle most abbreviations (such as "The serial no\&. is valid", but will not handle "Mr\&. Smith")\&. The \f3-breakiterator\fR option does not stop at HTML tags or sentences that begin with numbers or symbols\&. The algorithm stops at the last period in \&.\&./filename, even when embedded in an HTML tag\&.
++.RE
++
++
++In Java SE 1\&.5 the \f3-breakiterator\fR option warning messages are removed, and the default sentence-break algorithm is unchanged\&. If you have not modified your source code to eliminate the \f3-breakiterator\fR option warnings in Java SE 1\&.4\&.x, then you do not have to do anything\&. The warnings go away starting with Java SE 1\&.5\&.0\&.
++.TP
++-locale \fIlanguage_country_variant\fR
++.br
++Specifies the locale that the \f3javadoc\fR command uses when it generates documentation\&. The argument is the name of the locale, as described in \f3j\fR\f3ava\&.util\&.Locale\fR documentation, such as \f3en_US\fR (English, United States) or \f3en_US_WIN\fR (Windows variant)\&.
++
++\fINote:\fR The \f3-locale\fR option must be placed ahead (to the left) of any options provided by the standard doclet or any other doclet\&. Otherwise, the navigation bars appear in English\&. This is the only command-line option that depends on order\&. See Standard Doclet Options\&.
++
++Specifying a locale causes the \f3javadoc\fR command to choose the resource files of that locale for messages such as strings in the navigation bar, headings for lists and tables, help file contents, comments in the stylesheet\&.css file, and so on\&. It also specifies the sorting order for lists sorted alphabetically, and the sentence separator to determine the end of the first sentence\&. The \f3-locale\fR option does not determine the locale of the documentation comment text specified in the source files of the documented classes\&.
++.TP
++-encoding
++.br
++Specifies the encoding name of the source files, such as \f3EUCJIS/SJIS\fR\&. If this option is not specified, then the platform default converter is used\&. See also the\f3-docencoding name\fR and \f3-charset name\fR options\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR directly to the Java Runtime Environment (JRE) that runs the \f3javadoc\fR command\&. For example, if you must ensure that the system sets aside 32 MB of memory in which to process the generated documentation, then you would call the \f3-Xmx\fR option as follows: \f3javadoc -J-Xmx32m -J-Xms32m com\&.mypackage\fR\&. Be aware that \f3-Xms\fR is optional because it only sets the size of initial memory, which is useful when you know the minimum amount of memory required\&.
++
++There is no space between the \f3J\fR and the \f3flag\fR\&.
++
++Use the \f3-version\fR option to find out what version of the \f3javadoc\fR command you are using\&. The version number of the standard doclet appears in its output stream\&. See Running the Javadoc Command\&.
++.sp
++.nf
++\f3javadoc \-J\-version\fP
++.fi
++.nf
++\f3java version "1\&.7\&.0_09"\fP
++.fi
++.nf
++\f3Java(TM) SE Runtime Environment (build 1\&.7\&.0_09\-b05)\fP
++.fi
++.nf
++\f3Java HotSpot(TM) 64\-Bit Server VM (build 23\&.5\-b02, mixed mode)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-javafx
++.br
++Generates HTML documentation using the JavaFX extensions to the standard doclet\&. The generated documentation includes a Property Summary section in addition to the other summary sections generated by the standard Java doclet\&. The listed properties are linked to the sections for the getter and setter methods of each property\&.
++
++If there are no documentation comments written explicitly for getter and setter methods, the documentation comments from the property method are automatically copied to the generated documentation for these methods\&. This option also adds a new \f3@defaultValue\fR tag that allows documenting the default value for a property\&.
++
++Example:
++.sp
++.nf
++\f3javadoc \-javafx MyClass\&.java \-d testdir\fP
++.fi
++.sp
++
++.SS STANDARD\ DOCLET\ OPTIONS
++.TP
++-d \fIdirectory\fR
++.br
++Specifies the destination directory where the \f3javadoc\fR command saves the generated HTML files\&. If you omit the \f3-d\fR option, then the files are saved to the current directory\&. The \f3directory\fR value can be absolute or relative to the current working directory\&. As of Java SE 1\&.4, the destination directory is automatically created when the \f3javadoc\fR command runs\&.
++
++For example, the following command generates the documentation for the package \f3com\&.mypackage\fR and saves the results in the /user/doc/ directory: \f3javadoc -d\fR\f3/user/doc/\fR\f3com\&.mypackage\fR\&.
++.TP
++-use
++.br
++Includes one Use page for each documented class and package\&. The page describes what packages, classes, methods, constructors and fields use any API of the specified class or package\&. Given class C, things that use class C would include subclasses of C, fields declared as C, methods that return C, and methods and constructors with parameters of type C\&. For example, you can look at the Use page for the \f3String\fR type\&. Because the \f3getName\fR method in the \f3java\&.awt\&.Font\fR class returns type \f3String\fR, the \f3getName\fR method uses \f3String\fR and so the \f3getName\fR method appears on the Use page for \f3String\fR\&.This documents only uses of the API, not the implementation\&. When a method uses \f3String\fR in its implementation, but does not take a string as an argument or return a string, that is not considered a use of \f3String\fR\&.To access the generated Use page, go to the class or package and click the \fIUse link\fR in the navigation bar\&.
++.TP
++-version
++.br
++Includes the @version text in the generated docs\&. This text is omitted by default\&. To find out what version of the \f3javadoc\fR command you are using, use the \f3-J-version\fR option\&.
++.TP
++-author
++.br
++Includes the \f3@author\fR text in the generated docs\&.
++.TP
++-splitindex
++.br
++Splits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical symbols\&.
++.TP
++-windowtitle \fItitle\fR
++.br
++Specifies the title to be placed in the HTML \f3<title>\fR tag\&. The text specified in the \f3title\fR tag appears in the window title and in any browser bookmarks (favorite places) that someone creates for this page\&. This title should not contain any HTML tags because the browser does not interpret them correctly\&. Use escape characters on any internal quotation marks within the \f3title\fR tag\&. If the \f3-windowtitle\fR option is omitted, then the \f3javadoc\fR command uses the value of the \f3-doctitle\fR option for the \f3-windowtitle\fR option\&. For example, \f3javadoc -windowtitle "Java SE Platform" com\&.mypackage\fR\&.
++.TP
++-doctitle \fItitle\fR
++.br
++Specifies the title to place near the top of the overview summary file\&. The text specified in the \f3title\fR tag is placed as a centered, level-one heading directly beneath the top navigation bar\&. The \f3title\fR tag can contain HTML tags and white space, but when it does, you must enclose the title in quotation marks\&. Internal quotation marks within the \f3title\fR tag must be escaped\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
++.TP
++-title \fItitle\fR
++.br
++No longer exists\&. It existed only in Beta releases of Javadoc 1\&.2\&. It was renamed to \f3-doctitle\fR\&. This option was renamed to make it clear that it defines the document title, rather than the window title\&.
++.TP
++-header \fIheader\fR
++.br
++Specifies the header text to be placed at the top of each output file\&. The header is placed to the right of the upper navigation bar\&. The \f3header\fR can contain HTML tags and white space, but when it does, the \f3header\fR must be enclosed in quotation marks\&. Use escape characters for internal quotation marks within a header\&. For example, \f3javadoc -header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\&.\fR
++.TP
++-footer \fIfooter\fR
++.br
++Specifies the footer text to be placed at the bottom of each output file\&. The \fIfooter\fR value is placed to the right of the lower navigation bar\&. The \f3footer\fR value can contain HTML tags and white space, but when it does, the \f3footer\fR value must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within a footer\&.
++.TP
++-top
++.br
++Specifies the text to be placed at the top of each output file\&.
++.TP
++-bottom \fItext\fR
++.br
++Specifies the text to be placed at the bottom of each output file\&. The text is placed at the bottom of the page, underneath the lower navigation bar\&. The text can contain HTML tags and white space, but when it does, the text must be enclosed in quotation marks\&. Use escape characters for any internal quotation marks within text\&.
++.TP
++-link \fIextdocURL\fR
++.br
++Creates links to existing Javadoc-generated documentation of externally referenced classes\&. The \fIextdocURL\fR argument is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. You can specify multiple \f3-link\fR options in a specified \f3javadoc\fR command run to link to multiple documents\&.
++
++The package-list file must be found in this directory (otherwise, use the \f3-linkoffline\fR option)\&. The \f3javadoc\fR command reads the package names from the package-list file and links to those packages at that URL\&. When the \f3javadoc\fR command runs, the \f3extdocURL\fR value is copied into the \f3<A HREF>\fR links that are created\&. Therefore, \f3extdocURL\fR must be the URL to the directory, and not to a file\&. You can use an absolute link for \fIextdocURL\fR to enable your documents to link to a document on any web site, or you can use a relative link to link only to a relative location\&. If you use a relative link, then the value you pass in should be the relative path from the destination directory (specified with the \f3-d\fR option) to the directory containing the packages being linked to\&.When you specify an absolute link, you usually use an HTTP link\&. However, if you want to link to a file system that has no web server, then you can use a file link\&. Use a file link only when everyone who wants to access the generated documentation shares the same file system\&.In all cases, and on all operating systems, use a slash as the separator, whether the URL is absolute or relative, and \f3h\fR\f3ttp:\fR or \f3f\fR\f3ile:\fR as specified in the URL Memo: Uniform Resource Locators at http://www\&.ietf\&.org/rfc/rfc1738\&.txt
++.sp
++.nf
++\f3\-link http://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\-link file://<host>/<directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\-link <directory>/<directory>/\&.\&.\&./<name>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Differences between the -linkoffline and -link options
++
++Use the \f3-link\fR option in the following cases:
++.TP 0.2i
++\(bu
++When you use a relative path to the external API document\&.
++.TP 0.2i
++\(bu
++When you use an absolute URL to the external API document if your shell lets you open a connection to that URL for reading\&.
++.PP
++Use the \f3-linkoffline\fR option when you use an absolute URL to the external API document, if your shell does not allow a program to open a connection to that URL for reading\&. This can occur when you are behind a firewall and the document you want to link to is on the other side\&.
++.PP
++\f3Example 1 Absolute Link to External Documents\fR
++.PP
++Use the following command if you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java platform packages, shown at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
++.sp
++.nf
++\f3javadoc \-link http://docs\&.oracle\&.com/javase/8/docs/api/ com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The command generates documentation for the package \f3com\&.mypackage\fR with links to the Java SE packages\&. The generated documentation contains links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other options, such as the \f3-sourcepath\fR and \f3-d\fR options, are not shown\&.
++.PP
++\f3Example 2 Relative Link to External Documents\fR
++.PP
++In this example, there are two packages with documents that are generated in different runs of the \f3javadoc\fR command, and those documents are separated by a relative path\&. The packages are \f3com\&.apipackage\fR, an API, and c\f3om\&.spipackage\fR, an Service Provide Interface (SPI)\&. You want the documentation to reside in docs/api/com/apipackage and docs/spi/com/spipackage\&. Assuming that the API package documentation is already generated, and that docs is the current directory, you document the SPI package with links to the API documentation by running: \f3javadoc -d \&./spi -link \&.\&./api com\&.spipackage\fR\&.
++.PP
++Notice the \f3-link\fR option is relative to the destination directory (docs/spi)\&.
++.PP
++Notes
++
++The \f3-link\fR option lets you link to classes referenced to by your code, but not documented in the current \f3javadoc\fR command run\&. For these links to go to valid pages, you must know where those HTML pages are located and specify that location with \f3extdocURL\fR\&. This allows third-party documentation to link to java\&.* documentation at http://docs\&.oracle\&.com\&.Omit the \f3-link\fR option when you want the \f3javadoc\fR command to create links only to APIs within the documentation it is generating in the current run\&. Without the \f3-link\fR option, the \f3javadoc\fR command does not create links to documentation for external references because it does not know whether or where that documentation exists\&.The \f3-link\fR option can create links in several places in the generated documentation\&. See Process Source Files\&. Another use is for cross-links between sets of packages: Execute the \f3javadoc\fR command on one set of packages, then run the \f3javadoc\fR command again on another set of packages, creating links both ways between both sets\&.
++.PP
++How to Reference a Class
++
++For a link to an externally referenced class to appear (and not just its text label), the class must be referenced in the following way\&. It is not sufficient for it to be referenced in the body of a method\&. It must be referenced in either an \f3import\fR statement or in a declaration\&. Here are examples of how the class \f3java\&.io\&.File\fR can be referenced:
++.PP
++\fI\fRIn any kind of import statement\&. By wildcard import, import explicitly by name, or automatically import for \f3java\&.lang\&.*\fR\&.
++.PP
++In Java SE 1\&.3\&.\fIn\fR and 1\&.2\&.\fIn\fR, only an explicit import by name works\&. A wildcard \f3import\fR statement does not work, nor does the automatic \f3import java\&.lang\&.*\fR\&.
++.PP
++\fI\fRIn a declaration: \f3void mymethod(File f) {}\fR
++.PP
++The reference can be in the return type or parameter type of a method, constructor, field, class, or interface, or in an implements, extends, or throws statement\&.
++.PP
++An important corollary is that when you use the \f3-link\fR option, there can be many links that unintentionally do not appear due to this constraint\&. The text would appear without being a link\&. You can detect these by the warnings they emit\&. The simplest way to properly reference a class and add the link would be to import that class\&.
++.PP
++Package List
++
++The \f3-link\fR option requires that a file named package-list, which is generated by the \f3javadoc\fR command, exists at the URL you specify with the \f3-link\fR option\&. The package-list file is a simple text file that lists the names of packages documented at that location\&. In the earlier example, the \f3javadoc\fR command searches for a file named package-list at the specified URL, reads in the package names, and links to those packages at that URL\&.
++.PP
++For example, the package list for the Java SE API is located at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
++.PP
++The package list starts as follows:
++.sp
++.nf
++\f3java\&.applet\fP
++.fi
++.nf
++\f3java\&.awt\fP
++.fi
++.nf
++\f3java\&.awt\&.color\fP
++.fi
++.nf
++\f3java\&.awt\&.datatransfer\fP
++.fi
++.nf
++\f3java\&.awt\&.dnd\fP
++.fi
++.nf
++\f3java\&.awt\&.event\fP
++.fi
++.nf
++\f3java\&.awt\&.font\fP
++.fi
++.nf
++\f3and so on \&.\&.\&.\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When \f3javadoc\fR is run without the \f3-link\fR option and encounters a name that belongs to an externally referenced class, it prints the name with no link\&. However, when the \f3-link\fR option is used, the \f3javadoc\fR command searches the package-list file at the specified \fIextdocURL\fR location for that package name\&. When it finds the package name, it prefixes the name with \fIextdocURL\fR\&.
++.PP
++For there to be no broken links, all of the documentation for the external references must exist at the specified URLs\&. The \f3javadoc\fR command does not check that these pages exist, but only that the package-list exists\&.
++.PP
++Multiple Links
++
++You can supply multiple \f3-link\fR options to link to any number of externally generated documents\&. Javadoc 1\&.2 has a known bug that prevents you from supplying more than one \f3-link\fR options\&. This was fixed in Javadoc 1\&.2\&.2\&. Specify a different link option for each external document to link to \f3javadoc -link extdocURL1 -link extdocURL2 \&.\&.\&. -link extdocURLn com\&.mypackage\fR where \fIextdocURL1\fR, \fIextdocURL2\fR, \&.\f3\&.\&. extdocURLn\fR point respectively to the roots of external documents, each of which contains a file named package-list\&.
++.PP
++Cross Links
++
++Note that bootstrapping might be required when cross-linking two or more documents that were previously generated\&. If package-list does not exist for either document when you run the \f3javadoc\fR command on the first document, then the package-list does not yet exist for the second document\&. Therefore, to create the external links, you must regenerate the first document after you generate the second document\&.
++.PP
++In this case, the purpose of first generating a document is to create its package-list (or you can create it by hand if you are certain of the package names)\&. Then, generate the second document with its external links\&. The \f3javadoc\fR command prints a warning when a needed external package-list file does not exist\&.
++.TP
++-linkoffline \fIextdocURL packagelistLoc\fR
++.br
++This option is a variation of the \f3-link\fR option\&. They both create links to Javadoc-generated documentation for externally referenced classes\&. Use the \f3-link\fRo\f3ffline\fR option when linking to a document on the web when the \f3javadoc\fR command cannot access the document through a web connection\&. Use the \f3-linkoffline\fR option when package-list file of the external document is not accessible or does not exist at the \f3extdocURL\fR location, but does exist at a different location that can be specified by \f3packageListLoc\fR (typically local)\&. If \f3extdocURL\fR is accessible only on the World Wide Web, then the \f3-linkoffline\fR option removes the constraint that the \f3javadoc\fR command must have a web connection to generate documentation\&. Another use is as a work-around to update documents: After you have run the \f3javadoc\fR command on a full set of packages, you can run the \f3javadoc\fR command again on a smaller set of changed packages, so that the updated files can be inserted back into the original set\&. Examples follow\&. The \f3-linkoffline\fR option takes two arguments\&. The first is for the string to be embedded in the \f3<a href>\fR links, and the second tells the \f3-linkoffline\fR option where to find package-list:
++.RS
++.TP 0.2i
++\(bu
++The \f3extdocURL\fR value is the absolute or relative URL of the directory that contains the external Javadoc-generated documentation you want to link to\&. When relative, the value should be the relative path from the destination directory (specified with the \f3-d\fR option) to the root of the packages being linked to\&. For more information, see \fIextdocURL\fR in the \f3-link\fR option\&.
++.TP 0.2i
++\(bu
++The \f3packagelistLoc\fR value is the path or URL to the directory that contains the package-list file for the external documentation\&. This can be a URL (http: or file:) or file path, and can be absolute or relative\&. When relative, make it relative to the current directory from where the \f3javadoc\fR command was run\&. Do not include the package-list file name\&.
++
++You can specify multiple \f3-linkoffline\fR options in a specified \f3javadoc\fR command run\&. Before Javadoc 1\&.2\&.2, the \f3-linkfile\fR options could be specified once\&.
++.RE
++
++.PP
++Absolute Links to External Documents
++
++You might have a situation where you want to link to the \f3java\&.lang\fR, \f3java\&.io\fR and other Java SE packages at http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html
++.PP
++However, your shell does not have web access\&. In this case, do the following:
++.TP 0.4i
++1\&.
++Open the package-list file in a browser at http://docs\&.oracle\&.com/javase/8/docs/api/package-list
++.TP 0.4i
++2\&.
++Save the file to a local directory, and point to this local copy with the second argument, \f3packagelistLoc\fR\&. In this example, the package list file was saved to the current directory (\&.)\&.
++.PP
++The following command generates documentation for the package c\f3om\&.mypackage\fR with links to the Java SE packages\&. The generated documentation will contain links to the \f3Object\fR class, for example, in the class \f3trees\fR\&. Other necessary options, such as \f3-sourcepath\fR, are not shown\&.
++.sp
++.nf
++\f3javadoc \-linkoffline http://docs\&.oracle\&.com/javase/8/docs/api/ \&. com\&.mypackage \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Relative Links to External Documents
++
++It is not very common to use \f3-linkoffline\fR with relative paths, for the simple reason that the \f3-link\fR option is usually enough\&. When you use the \f3-linkoffline\fR option, the package-list file is usually local, and when you use relative links, the file you are linking to is also local, so it is usually unnecessary to give a different path for the two arguments to the \f3-linkoffline\fR option When the two arguments are identical, you can use the \f3-link\fR option\&.
++.PP
++Create a package-list File Manually
++
++If a package-list file does not exist yet, but you know what package names your document will link to, then you can manually create your own copy of this file and specify its path with \f3packagelistLoc\fR\&. An example would be the previous case where the package list for \f3com\&.spipackage\fR did not exist when \f3com\&.apipackage\fR was first generated\&. This technique is useful when you need to generate documentation that links to new external documentation whose package names you know, but which is not yet published\&. This is also a way of creating package-list files for packages generated with Javadoc 1\&.0 or 1\&.1, where package-list files were not generated\&. Similarly, two companies can share their unpublished package-list files so they can release their cross-linked documentation simultaneously\&.
++.PP
++Link to Multiple Documents
++
++You can include the \f3-linkoffline\fR option once for each generated document you want to refer to:
++.sp
++.nf
++\f3javadoc \-linkoffline extdocURL1 packagelistLoc1 \-linkoffline extdocURL2\fP
++.fi
++.nf
++\f3packagelistLoc2 \&.\&.\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Update Documents
++
++You can also use the \f3-linkoffline\fR option when your project has dozens or hundreds of packages\&. If you have already run the \f3javadoc\fR command on the entire source tree, then you can quickly make small changes to documentation comments and rerun the \f3javadoc\fR command on a portion of the source tree\&. Be aware that the second run works properly only when your changes are to documentation comments and not to declarations\&. If you were to add, remove, or change any declarations from the source code, then broken links could show up in the index, package tree, inherited member lists, Use page, and other places\&.
++.PP
++First, create a new destination directory, such as update, for this new small run\&. In this example, the original destination directory is named html\&. In the simplest example, change directory to the parent of html\&. Set the first argument of the \f3-linkoffline\fR option to the current directory (\&.) and set the second argument to the relative path to html, where it can find package-list and pass in only the package names of the packages you want to update:
++.sp
++.nf
++\f3javadoc \-d update \-linkoffline \&. html com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When the \f3javadoc\fR command completes, copy these generated class pages in update/com/package (not the overview or index) to the original files in html/com/package\&.
++.TP
++-linksource
++.br
++Creates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation\&. Links are created for classes, interfaces, constructors, methods, and fields whose declarations are in a source file\&. Otherwise, links are not created, such as for default constructors and generated classes\&.
++
++This option exposes all private implementation details in the included source files, including private classes, private fields, and the bodies of private methods, regardless of the \f3-public\fR, \f3-package\fR, \f3-protected\fR, and \f3-private\fR options\&. Unless you also use the \f3-private\fR option, not all private classes or interfaces are accessible through links\&.
++
++Each link appears on the name of the identifier in its declaration\&. For example, the link to the source code of the \f3Button\fR class would be on the word \f3Button\fR:
++.sp
++.nf
++\f3public class Button extends Component implements Accessible\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The link to the source code of the \f3getLabel\fR method in the \f3Button\fR class is on the word \f3getLabel\fR:
++.sp
++.nf
++\f3public String getLabel()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-group groupheading \fIpackagepattern:packagepattern\fR
++.br
++Separates packages on the overview page into whatever groups you specify, one group per table\&. You specify each group with a different \f3-group\fR option\&. The groups appear on the page in the order specified on the command line\&. Packages are alphabetized within a group\&. For a specified \f3-group\fR option, the packages matching the list of \f3packagepattern\fR expressions appear in a table with the heading \fIgroupheading\fR\&.
++.RS
++.TP 0.2i
++\(bu
++The \f3groupheading\fR can be any text and can include white space\&. This text is placed in the table heading for the group\&.
++.TP 0.2i
++\(bu
++The \f3packagepattern\fR value can be any package name at the start of any package name followed by an asterisk (*)\&. The asterisk is the only wildcard allowed and means match any characters\&. Multiple patterns can be included in a group by separating them with colons (:)\&. If you use an asterisk in a pattern or pattern list, then the pattern list must be inside quotation marks, such as \f3"java\&.lang*:java\&.util"\fR\&.
++.RE
++
++
++When you do not supply a \f3-group\fR option, all packages are placed in one group with the heading \fIPackages\fR and appropriate subheadings\&. If the subheadings do not include all documented packages (all groups), then the remaining packages appear in a separate group with the subheading Other Packages\&.
++
++For example, the following \f3javadoc\fR command separates the three documented packages into \fICore\fR, \fIExtension\fR, and \fIOther Packages\fR\&. The trailing dot (\&.) does not appear in \f3java\&.lang*\fR\&. Including the dot, such as \f3java\&.lang\&.*\fR omits the\f3java\&.lang\fR package\&.
++.sp
++.nf
++\f3javadoc \-group "Core Packages" "java\&.lang*:java\&.util"\fP
++.fi
++.nf
++\f3 \-group "Extension Packages" "javax\&.*"\fP
++.fi
++.nf
++\f3 java\&.lang java\&.lang\&.reflect java\&.util javax\&.servlet java\&.new\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fICore Packages\fR
++
++\f3java\&.lang\fR
++
++\f3java\&.lang\&.reflect\fR
++
++\f3java\&.util\fR
++
++\fIExtension Packages\fR
++
++\f3javax\&.servlet\fR
++
++\fIOther Packages\fR
++
++\f3java\&.new\fR
++.TP
++-nodeprecated
++.br
++Prevents the generation of any deprecated API in the documentation\&. This does what the \f3-nodeprecatedlist\fR option does, and it does not generate any deprecated API throughout the rest of the documentation\&. This is useful when writing code when you do not want to be distracted by the deprecated code\&.
++.TP
++-nodeprecatedlist
++.br
++Prevents the generation of the file that contains the list of deprecated APIs (deprecated-list\&.html) and the link in the navigation bar to that page\&. The \f3javadoc\fR command continues to generate the deprecated API throughout the rest of the document\&. This is useful when your source code contains no deprecated APIs, and you want to make the navigation bar cleaner\&.
++.TP
++-nosince
++.br
++Omits from the generated documents the \f3Since\fR sections associated with the \f3@since\fR tags\&.
++.TP
++-notree
++.br
++Omits the class/interface hierarchy pages from the generated documents\&. These are the pages you reach using the Tree button in the navigation bar\&. The hierarchy is produced by default\&.
++.TP
++-noindex
++.br
++Omits the index from the generated documents\&. The index is produced by default\&.
++.TP
++-nohelp
++.br
++Omits the HELP link in the navigation bars at the top and bottom of each page of output\&.
++.TP
++-nonavbar
++.br
++Prevents the generation of the navigation bar, header, and footer, that are usually found at the top and bottom of the generated pages\&. The \f3-nonavbar\fR option has no affect on the \f3-bottom\fR option\&. The \f3-nonavbar\fR option is useful when you are interested only in the content and have no need for navigation, such as when you are converting the files to PostScript or PDF for printing only\&.
++.TP
++-helpfile \fIpath\efilename\fR
++.br
++Specifies the path of an alternate help file path\efilename that the HELP link in the top and bottom navigation bars link to\&. Without this option, the \f3javadoc\fR command creates a help file help-doc\&.html that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to help-doc\&.html\&. The \f3javadoc\fR command adjusts the links in the navigation bar accordingly, for example:
++.sp
++.nf
++\f3javadoc \-helpfile /home/user/myhelp\&.html java\&.awt\&.\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-stylesheet \fIpath/filename\fR
++.br
++Specifies the path of an alternate HTML stylesheet file\&. Without this option, the \f3javadoc\fR command automatically creates a stylesheet file stylesheet\&.css that is hard-coded in the \f3javadoc\fR command\&. This option lets you override the default\&. The file name can be any name and is not restricted to stylesheet\&.css, for example:
++.sp
++.nf
++\f3javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-serialwarn
++.br
++Generates compile-time warnings for missing \f3@serial\fR tags\&. By default, Javadoc 1\&.2\&.2 and later versions generate no serial warnings\&. This is a reversal from earlier releases\&. Use this option to display the serial warnings, which helps to properly document default serializable fields and \f3writeExternal\fR methods\&.
++.TP
++-charset \fIname\fR
++.br
++Specifies the HTML character set for this document\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
++
++For example, \f3javadoc -charset "iso-8859-1" mypackage\fR inserts the following line in the head of every generated page:
++.sp
++.nf
++\f3<META http\-equiv="Content\-Type" content="text/html; charset=ISO\-8859\-1">\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This \f3META\fR tag is described in the HTML standard (4197265 and 4137321), HTML Document Representation, at http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
++
++See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
++.TP
++-docencoding \fIname\fR
++.br
++Specifies the encoding of the generated HTML files\&. The name should be a preferred MIME name as specified in the IANA Registry, Character Sets at http://www\&.iana\&.org/assignments/character-sets
++
++If you omit the \f3-docencoding\fR option but use the \f3-encoding\fR option, then the encoding of the generated HTML files is determined by the \f3-encoding\fR option, for example: \f3javadoc -docencoding "iso-8859-1" mypackage\fR\&. See also the \f3-encoding\fR and \f3-docencoding name\fR options\&.
++.TP
++-keywords
++.br
++Adds HTML keyword <META> tags to the generated file for each class\&. These tags can help search engines that look for <META> tags find the pages\&. Most search engines that search the entire Internet do not look at <META> tags, because pages can misuse them\&. Search engines offered by companies that confine their searches to their own website can benefit by looking at <META> tags\&. The <META> tags include the fully qualified name of the class and the unqualified names of the fields and methods\&. Constructors are not included because they are identical to the class name\&. For example, the class \f3String\fR starts with these keywords:
++.sp
++.nf
++\f3<META NAME="keywords" CONTENT="java\&.lang\&.String class">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="CASE_INSENSITIVE_ORDER">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="length()">\fP
++.fi
++.nf
++\f3<META NAME="keywords" CONTENT="charAt()">\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-tag \fItagname\fR:Xaoptcmf:"\fItaghead\fR"
++.br
++Enables the \f3javadoc\fR command to interpret a simple, one-argument \f3@tagname\fR custom block tag in documentation comments\&. For the \f3javadoc\fR command to spell-check tag names, it is important to include a \f3-tag\fR option for every custom tag that is present in the source code, disabling (with \f3X\fR) those that are not being output in the current run\&.The colon (:) is always the separator\&. The \f3-tag\fR option outputs the tag heading \fItaghead\fR in bold, followed on the next line by the text from its single argument\&. Similar to any block tag, the argument text can contain inline tags, which are also interpreted\&. The output is similar to standard one-argument tags, such as the \f3@return\fR and \f3@author\fR tags\&. Omitting a value for \fItaghead\fR causes \f3tagname\fR to be the heading\&.
++
++\fIPlacement of tags\fR: The \f3Xaoptcmf\fR arguments determine where in the source code the tag is allowed to be placed, and whether the tag can be disabled (using \f3X\fR)\&. You can supply either \f3a\fR, to allow the tag in all places, or any combination of the other letters:
++
++\f3X\fR (disable tag)
++
++\f3a\fR (all)
++
++\f3o\fR (overview)
++
++\f3p\fR (packages)
++
++\f3t\fR (types, that is classes and interfaces)
++
++\f3c\fR (constructors)
++
++\f3m\fR (methods)
++
++\f3f\fR (fields)
++
++\fIExamples of single tags\fR: An example of a tag option for a tag that can be used anywhere in the source code is: \f3-tag todo:a:"To Do:"\fR\&.
++
++If you want the \f3@todo\fR tag to be used only with constructors, methods, and fields, then you use: \f3-tag todo:cmf:"To Do:"\fR\&.
++
++Notice the last colon (:) is not a parameter separator, but is part of the heading text\&. You would use either tag option for source code that contains the \f3@todo\fR tag, such as: \f3@todo The documentation for this method needs work\fR\&.
++
++\fIColons in tag names\fR: Use a backslash to escape a colon that you want to use in a tag name\&. Use the \f3-tag ejb\e\e:bean:a:"EJB Bean:"\fR option for the following documentation comment:
++.sp
++.nf
++\f3/**\fP
++.fi
++.nf
++\f3 * @ejb:bean\fP
++.fi
++.nf
++\f3 */\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fISpell-checking tag names\fR: Some developers put custom tags in the source code that they do not always want to output\&. In these cases, it is important to list all tags that are in the source code, enabling the ones you want to output and disabling the ones you do not want to output\&. The presence of \f3X\fR disables the tag, while its absence enables the tag\&. This gives the \f3javadoc\fR command enough information to know whether a tag it encounters is unknown, which is probably the results of a typographical error or a misspelling\&. The \f3javadoc\fR command prints a warning in these cases\&. You can add \f3X\fR to the placement values already present, so that when you want to enable the tag, you can simply delete the \f3X\fR\&. For example, if the \f3@todo\fR tag is a tag that you want to suppress on output, then you would use: \f3-tag todo:Xcmf:"To Do:"\fR\&. If you would rather keep it simple, then use this: \f3-tag todo:X\fR\&. The syntax \f3-tag todo:X\fR works even when the \f3@todo\fR tag is defined by a taglet\&.
++
++\fIOrder of tags\fR: The order of the \f3-ta\fR\f3g\fR and \f3-taglet\fR options determines the order the tags are output\&. You can mix the custom tags with the standard tags to intersperse them\&. The tag options for standard tags are placeholders only for determining the order\&. They take only the standard tag\&'s name\&. Subheadings for standard tags cannot be altered\&. This is illustrated in the following example\&.If the \f3-tag\fR option is missing, then the position of the \f3-tagle\fR\f3t\fR option determines its order\&. If they are both present, then whichever appears last on the command line determines its order\&. This happens because the tags and taglets are processed in the order that they appear on the command line\&. For example, if the \f3-taglet\fR and \f3-tag\fR options have the name \f3todo\fR value, then the one that appears last on the command line determines the order\&.
++
++\fIExample of a complete set of tags\fR: This example inserts To Do after Parameters and before Throws in the output\&. By using \f3X\fR, it also specifies that the \f3@example\fR tag might be encountered in the source code that should not be output during this run\&. If you use the \f3@argfile\fR tag, then you can put the tags on separate lines in an argument file similar to this (no line continuation characters needed):
++.sp
++.nf
++\f3\-tag param\fP
++.fi
++.nf
++\f3\-tag return\fP
++.fi
++.nf
++\f3\-tag todo:a:"To Do:"\fP
++.fi
++.nf
++\f3\-tag throws\fP
++.fi
++.nf
++\f3\-tag see\fP
++.fi
++.nf
++\f3\-tag example:X\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++When the \f3javadoc\fR command parses the documentation comments, any tag encountered that is neither a standard tag nor passed in with the \f3-tag\fR or \f3-taglet\fR options is considered unknown, and a warning is thrown\&.
++
++The standard tags are initially stored internally in a list in their default order\&. Whenever the \f3-tag\fR options are used, those tags get appended to this list\&. Standard tags are moved from their default position\&. Therefore, if a \f3-tag\fR option is omitted for a standard tag, then it remains in its default position\&.
++
++\fIAvoiding conflicts\fR: If you want to create your own namespace, then you can use a dot-separated naming convention similar to that used for packages: \f3com\&.mycompany\&.todo\fR\&. Oracle will continue to create standard tags whose names do not contain dots\&. Any tag you create will override the behavior of a tag by the same name defined by Oracle\&. If you create a \f3@todo\fR tag or taglet, then it always has the same behavior you define, even when Oracle later creates a standard tag of the same name\&.
++
++\fIAnnotations vs\&. Javadoc tags\fR: In general, if the markup you want to add is intended to affect or produce documentation, then it should be a Javadoc tag\&. Otherwise, it should be an annotation\&. See Custom Tags and Annotations in How to Write Doc Comments for the Javadoc Tool at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html#annotations
++
++You can also create more complex block tags or custom inline tags with the \f3-taglet\fR option\&.
++.TP
++-taglet \fIclass\fR
++.br
++Specifies the class file that starts the taglet used in generating the documentation for that tag\&. Use the fully qualified name for the \f3class\fR value\&. This taglet also defines the number of text arguments that the custom tag has\&. The taglet accepts those arguments, processes them, and generates the output\&. For extensive documentation with example taglets, see: Taglet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html
++
++Taglets are useful for block or inline tags\&. They can have any number of arguments and implement custom behavior, such as making text bold, formatting bullets, writing out the text to a file, or starting other processes\&. Taglets can only determine where a tag should appear and in what form\&. All other decisions are made by the doclet\&. A taglet cannot do things such as remove a class name from the list of included classes\&. However, it can execute side effects, such as printing the tag\&'s text to a file or triggering another process\&. Use the \f3-tagletpath\fR option to specify the path to the taglet\&. The following example inserts the To Do taglet after Parameters and ahead of Throws in the generated pages\&. Alternately, you can use the \f3-taglet\fR option in place of its \f3-tag\fR option, but that might be difficult to read\&.
++.sp
++.nf
++\f3\-taglet com\&.sun\&.tools\&.doclets\&.ToDoTaglet\fP
++.fi
++.nf
++\f3\-tagletpath /home/taglets \fP
++.fi
++.nf
++\f3\-tag return\fP
++.fi
++.nf
++\f3\-tag param\fP
++.fi
++.nf
++\f3\-tag todo\fP
++.fi
++.nf
++\f3\-tag throws\fP
++.fi
++.nf
++\f3\-tag see\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-tagletpath \fItagletpathlist\fR
++.br
++Specifies the search paths for finding taglet class files\&. The \f3tagletpathlist\fR can contain multiple paths by separating them with a colon (:)\&. The \f3javadoc\fR command searches all subdirectories of the specified paths\&.
++.TP
++-docfilesubdirs
++.br
++Enables deep copying of doc-files directories\&. Subdirectories and all contents are recursively copied to the destination\&. For example, the directory doc-files/example/images and all of its contents would be copied\&. There is also an option to exclude subdirectories\&.
++.TP
++-excludedocfilessubdir \fIname1:name2\fR
++.br
++Excludes any doc-files subdirectories with the specified names\&. This prevents the copying of SCCS and other source-code-control subdirectories\&.
++.TP
++-noqualifier all | \fIpackagename1\fR:\fIpackagename2\&.\&.\&.\fR
++.br
++Omits qualifying package names from class names in output\&. The argument to the \f3-noqualifier\fR option is either \f3all\fR (all package qualifiers are omitted) or a colon-separate list of packages, with wild cards, to be removed as qualifiers\&. The package name is removed from places where class or interface names appear\&. See Process Source Files\&.
++
++The following example omits all package qualifiers: \f3-noqualifier all\fR\&.
++
++The following example omits \f3java\&.lang\fR and \f3java\&.io\fR package qualifiers: \f3-noqualifier java\&.lang:java\&.io\fR\&.
++
++The following example omits package qualifiers starting with \f3java\fR, and \f3com\&.sun\fR subpackages, but not \f3javax\fR: \f3-noqualifier java\&.*:com\&.sun\&.*\fR\&.
++
++Where a package qualifier would appear due to the previous behavior, the name can be suitably shortened\&. See How a Name Appears\&. This rule is in effect whether or not the \f3-noqualifier\fR option is used\&.
++.TP
++-notimestamp
++.br
++Suppresses the time stamp, which is hidden in an HTML comment in the generated HTML near the top of each page\&. The \f3-notimestamp\fR option is useful when you want to run the \f3javadoc\fR command on two source bases and get the differences between \f3diff\fR them, because it prevents time stamps from causing a \f3diff\fR (which would otherwise be a \f3diff\fR on every page)\&. The time stamp includes the \f3javadoc\fR command release number, and currently appears similar to this: \f3<!-- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 -->\fR\&.
++.TP
++-nocomment
++.br
++Suppresses the entire comment body, including the main description and all tags, and generate only declarations\&. This option lets you reuse source files that were originally intended for a different purpose so that you can produce skeleton HTML documentation at the early stages of a new project\&.
++.TP
++-sourcetab \fItablength\fR
++.br
++Specifies the number of spaces each tab uses in the source\&.
++.SH COMMAND-LINE\ ARGUMENT\ FILES
++To shorten or simplify the \f3javadoc\fR command, you can specify one or more files that contain arguments to the \f3javadoc\fR command (except \f3-J\fR options)\&. This enables you to create \f3javadoc\fR commands of any length on any operating system\&.
++.PP
++An argument file can include \f3javac\fR options and source file names in any combination\&. The arguments within a file can be space-separated or newline-separated\&. If a file name contains embedded spaces, then put the whole file name in double quotation marks\&.
++.PP
++File Names within an argument file are relative to the current directory, not the location of the argument file\&. Wild cards (\f3*\fR) are not allowed in these lists (such as for specifying *\&.java)\&. Using the at sign (@) to recursively interpret files is not supported\&. The \f3-J\fR options are not supported because they are passed to the launcher, which does not support argument files\&.
++.PP
++When you run the \f3javadoc\fR command, pass in the path and name of each argument file with the @ leading character\&. When the \f3javadoc\fR command encounters an argument beginning with the at sign (@), it expands the contents of that file into the argument list\&.
++.PP
++\f3Example 1 Single Argument File\fR
++.PP
++You could use a single argument file named \f3argfile\fR to hold all \f3javadoc\fR command arguments: \f3javadoc @argfile\fR\&. The argument file \f3\fRcontains the contents of both files, as shown in the next example\&.
++.PP
++\f3Example 2 Two Argument Files\fR
++.PP
++You can create two argument files: One for the \f3javadoc\fR command options and the other for the package names or source file names\&. Notice the following lists have no line-continuation characters\&.
++.PP
++Create a file named options that contains:
++.sp
++.nf
++\f3\-d docs\-filelist \fP
++.fi
++.nf
++\f3\-use \fP
++.fi
++.nf
++\f3\-splitindex\fP
++.fi
++.nf
++\f3\-windowtitle \&'Java SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3\-doctitle \&'Java SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3\-header \&'<b>Java\(tm SE 7</b>\&'\fP
++.fi
++.nf
++\f3\-bottom \&'Copyright &copy; 1993\-2011 Oracle and/or its affiliates\&. All rights reserved\&.\&'\fP
++.fi
++.nf
++\f3\-group "Core Packages" "java\&.*"\fP
++.fi
++.nf
++\f3\-overview /java/pubs/ws/1\&.7\&.0/src/share/classes/overview\-core\&.html\fP
++.fi
++.nf
++\f3\-sourcepath /java/pubs/ws/1\&.7\&.0/src/share/classes\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Create a file named packages that contains:
++.sp
++.nf
++\f3com\&.mypackage1\fP
++.fi
++.nf
++\f3com\&.mypackage2\fP
++.fi
++.nf
++\f3com\&.mypackage3\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3javadoc\fR command as follows:
++.sp
++.nf
++\f3javadoc @options @packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Argument Files with Paths\fR
++.PP
++The argument files can have paths, but any file names inside the files are relative to the current working directory (not \f3path1\fR or \f3path2\fR):
++.sp
++.nf
++\f3javadoc @path1/options @path2/packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Option Arguments\fR
++.PP
++The following example saves an argument to a \f3javadoc\fR command option in an argument file\&. The \f3-bottom\fR option is used because it can have a lengthy argument\&. You could create a file named bottom to contain the text argument:
++.sp
++.nf
++\f3<font size="\-1">\fP
++.fi
++.nf
++\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&. <br/>\fP
++.fi
++.nf
++\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3 Other names may be trademarks of their respective owners\&.</font>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3javadoc\fR command as follows:\f3javadoc -bottom @bottom @packages\fR\&.
++.PP
++You can also include the \f3-bottom\fR option at the start of the argument file and run the \f3javadoc\fR command as follows: \f3javadoc @bottom @packages\fR\&.
++.SH RUNNING\ THE\ JAVADOC\ COMMAND
++The release number of the \f3javadoc\fR command can be determined with the \f3javadoc -J-version\fR option\&. The release number of the standard doclet appears in the output stream\&. It can be turned off with the \f3-quiet\fR option\&.
++.PP
++Use the public programmatic interface to call the \f3javadoc\fR command from within programs written in the Java language\&. This interface is in \f3com\&.sun\&.tools\&.javadoc\&.Main\fR (and the \f3javadoc\fR command is reentrant)\&. For more information, see The Standard Doclet at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard-doclet\&.html#runningprogrammatically
++.PP
++The following instructions call the standard HTML doclet\&. To call a custom doclet, use the \f3-doclet\fR and \f3-docletpath\fR options\&. See Doclet Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html
++.SS SIMPLE\ EXAMPLES
++You can run the \f3javadoc\fR command on entire packages or individual source files\&. Each package name has a corresponding directory name\&.
++.PP
++In the following examples, the source files are located at /home/src/java/awt/*\&.java\&. The destination directory is /home/html\&.
++.PP
++Document One or More Packages
++
++To document a package, the source files for that package must be located in a directory that has the same name as the package\&.
++.PP
++If a package name has several identifiers (separated by dots, such as \f3java\&.awt\&.color\fR), then each subsequent identifier must correspond to a deeper subdirectory (such as java/awt/color)\&.
++.PP
++You can split the source files for a single package among two such directory trees located at different places, as long as \f3-sourcepath\fR points to them both\&. For example, src1/java/awt/color and src2/java/awt/color\&.
++.PP
++You can run the \f3javadoc\fR command either by changing directories (with the \f3cd\fR command) or by using the \f3-sourcepath\fR option\&. The following examples illustrate both alternatives\&.
++.PP
++\f3Example 1 Recursive Run from One or More Packages\fR
++.PP
++This example uses \f3-sourcepath\fR so the \f3javadoc\fR command can be run from any directory and \f3-subpackages\fR (a new 1\&.4 option) for recursion\&. It traverses the subpackages of the java directory excluding packages rooted at \f3java\&.net\fR and \f3java\&.lang\fR\&. Notice this excludes \f3java\&.lang\&.ref\fR, a subpackage of \f3java\&.lang\fR\&. To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as \f3java:javax:org\&.xml\&.sax\fR\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Change to Root and Run Explicit Packages\fR
++.PP
++Change to the parent directory of the fully qualified package\&. Then, run the \f3javadoc\fR command with the names of one or more packages that you want to document:
++.sp
++.nf
++\f3cd /home/src/\fP
++.fi
++.nf
++\f3javadoc \-d /home/html java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To also traverse down other package trees, append their names to the \f3-subpackages\fR argument, such as j\f3ava:javax:org\&.xml\&.sax\fR\&.
++.PP
++\f3Example 3 Run from Any Directory on Explicit Packages in One Tree\fR
++.PP
++In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with the parent directory of the top-level package\&. Provide the names of one or more packages that you want to document:
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 4 Run from Any Directory on Explicit Packages in Multiple Trees\fR
++.PP
++Run the \f3javadoc\fR command and use the \f3-sourcepath\fR option with a colon-separated list of the paths to each tree\&'s root\&. Provide the names of one or more packages that you want to document\&. All source files for a specified package do not need to be located under a single root directory, but they must be found somewhere along the source path\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src1:/home/src2 java\&.awt java\&.awt\&.event\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The result is that all cases generate HTML-formatted documentation for the \f3public\fR and \f3protected\fR classes and interfaces in packages j\f3ava\&.awt\fR and \f3java\&.awt\&.even\fRt and save the HTML files in the specified destination directory\&. Because two or more packages are being generated, the document has three HTML frames: one for the list of packages, another for the list of classes, and the third for the main class pages\&.
++.PP
++Document One or More Classes
++
++The second way to run the \f3javadoc\fR command is to pass one or more source files\&. You can run \f3javadoc\fR either of the following two ways: by changing directories (with the \f3cd\fR command) or by fully specifying the path to the source files\&. Relative paths are relative to the current directory\&. The \f3-sourcepath\fR option is ignored when passing source files\&. You can use command-line wild cards, such as an asterisk (*), to specify groups of classes\&.
++.PP
++\f3Example 1 Change to the Source Directory\fR
++.PP
++Change to the directory that holds the source files\&. Then run the \f3javadoc\fR command with the names of one or more source files you want to document\&.
++.PP
++This example generates HTML-formatted documentation for the classes \f3Button\fR, \f3Canvas,\fR and classes that begin with \f3Graphics\fR\&. Because source files rather than package names were passed in as arguments to the \f3javadoc\fR command, the document has two frames: one for the list of classes and the other for the main page\&.
++.sp
++.nf
++\f3cd /home/src/java/awt\fP
++.fi
++.nf
++\f3javadoc \-d /home/html Button\&.java Canvas\&.java Graphics*\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 2 Change to the Root Directory of the Package\fR
++.PP
++This is useful for documenting individual source files from different subpackages off of the same root\&. Change to the package root directory, and supply the source files with paths from the root\&.
++.sp
++.nf
++\f3cd /home/src/\fP
++.fi
++.nf
++\f3javadoc \-d /home/html java/awt/Button\&.java java/applet/Applet\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3Example 3 Document Files from Any Directory\fR
++.PP
++In this case, it does not matter what the current directory is\&. Run the \f3javadoc\fR command with the absolute path (or path relative to the current directory) to the source files you want to document\&.
++.sp
++.nf
++\f3javadoc \-d /home/html /home/src/java/awt/Button\&.java\fP
++.fi
++.nf
++\f3/home/src/java/awt/Graphics*\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Document Packages and Classes
++
++You can document entire packages and individual classes at the same time\&. Here is an example that mixes two of the previous examples\&. You can use the \f3-sourcepath\fR option for the path to the packages but not for the path to the individual classes\&.
++.sp
++.nf
++\f3javadoc \-d /home/html \-sourcepath /home/src java\&.awt\fP
++.fi
++.nf
++\f3/home/src/java/applet/Applet\&.java\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS REAL-WORLD\ EXAMPLES
++The following command-line and \f3makefile\fR versions of the \f3javadoc\fR command run on the Java platform APIs\&. It uses 180 MB of memory to generate the documentation for the 1500 (approximately) public and protected classes in the Java SE 1\&.2\&. Both examples use absolute paths in the option arguments, so that the same \f3javadoc\fR command can be run from any directory\&.
++.PP
++Command-Line Example
++
++The following command might be too long for some shells\&. You can use a command-line argument file (or write a shell script) to overcome this limitation\&.
++.PP
++In the example, \f3packages\fR is the name of a file that contains the packages to process, such as \f3java\&.applet\fR\f3java\&.lang\fR\&. None of the options should contain any newline characters between the single quotation marks\&. For example, if you copy and paste this example, then delete the newline characters from the \f3-bottom\fR option\&.
++.sp
++.nf
++\f3javadoc \-sourcepath /java/jdk/src/share/classes \e\fP
++.fi
++.nf
++\f3\-overview /java/jdk/src/share/classes/overview\&.html \e\fP
++.fi
++.nf
++\f3\-d /java/jdk/build/api \e\fP
++.fi
++.nf
++\f3\-use \e\fP
++.fi
++.nf
++\f3\-splitIndex \e\fP
++.fi
++.nf
++\f3\-windowtitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
++.fi
++.nf
++\f3\-doctitle \&'Java Platform, Standard Edition 7 API Specification\&' \e\fP
++.fi
++.nf
++\f3\-header \&'<b>Java\(tm SE 7</b>\&' \e\fP
++.fi
++.nf
++\f3\-bottom \&'<font size="\-1">\fP
++.fi
++.nf
++\f3<a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
++.fi
++.nf
++\f3Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3Other names may be trademarks of their respective owners\&.</font>\&' \e\fP
++.fi
++.nf
++\f3\-group "Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*" \e\fP
++.fi
++.nf
++\f3\-group "Extension Packages" "javax\&.*" \e\fP
++.fi
++.nf
++\f3\-J\-Xmx180m \e \fP
++.fi
++.nf
++\f3@packages\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.PP
++Programmatic Interface
++
++The Javadoc Access API enables the user to invoke the Javadoc tool directly from a Java application without executing a new process\&.
++.PP
++For example, the following statements are equivalent to the command \f3javadoc -d /home/html -sourcepath /home/src -subpackages java -exclude java\&.net:java\&.lang com\&.example\fR:
++.sp
++.nf
++\f3import javax\&.tools\&.DocumentationTool;\fP
++.fi
++.nf
++\f3import javax\&.tools\&.ToolProvider;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class JavaAccessSample{\fP
++.fi
++.nf
++\f3 public static void main(String[] args){\fP
++.fi
++.nf
++\f3 DocumentationTool javadoc = ToolProvider\&.getSystemDocumentationTool();\fP
++.fi
++.nf
++\f3 int rc = javadoc\&.run( null, null, null,\fP
++.fi
++.nf
++\f3 "\-d", "/home/html",\fP
++.fi
++.nf
++\f3 "\-sourcepath", "home/src",\fP
++.fi
++.nf
++\f3 "\-subpackages", "java",\fP
++.fi
++.nf
++\f3 "\-exclude", "java\&.net:java\&.lang",\fP
++.fi
++.nf
++\f3 "com\&.example");\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The first three arguments of the \f3run\fR method specify input, standard output, and standard error streams\&. \f3Null\fR is the default value for \f3System\&.in\fR, \f3System\&.out\fR, and \f3System\&.err\fR, respectively\&.
++.SS THE\ MAKEFILE\ EXAMPLE
++This is an example of a GNU \f3makefile\fR\&. Single quotation marks surround \f3makefile\fR arguments\&. For an example of a Windows \f3makefile\fR, see the \f3makefiles\fR section of the Javadoc FAQ at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html#makefiles
++.sp
++.nf
++\f3javadoc \-sourcepath $(SRCDIR) \e /* Sets path for source files */\fP
++.fi
++.nf
++\f3 \-overview $(SRCDIR)/overview\&.html \e /* Sets file for overview text */\fP
++.fi
++.nf
++\f3 \-d /java/jdk/build/api \e /* Sets destination directory */\fP
++.fi
++.nf
++\f3 \-use \e /* Adds "Use" files */\fP
++.fi
++.nf
++\f3 \-splitIndex \e /* Splits index A\-Z */\fP
++.fi
++.nf
++\f3 \-windowtitle $(WINDOWTITLE) \e /* Adds a window title */\fP
++.fi
++.nf
++\f3 \-doctitle $(DOCTITLE) \e /* Adds a doc title */\fP
++.fi
++.nf
++\f3 \-header $(HEADER) \e /* Adds running header text */\fP
++.fi
++.nf
++\f3 \-bottom $(BOTTOM) \e /* Adds text at bottom */\fP
++.fi
++.nf
++\f3 \-group $(GROUPCORE) \e /* 1st subhead on overview page */\fP
++.fi
++.nf
++\f3 \-group $(GROUPEXT) \e /* 2nd subhead on overview page */\fP
++.fi
++.nf
++\f3 \-J\-Xmx180m \e /* Sets memory to 180MB */\fP
++.fi
++.nf
++\f3 java\&.lang java\&.lang\&.reflect \e /* Sets packages to document */\fP
++.fi
++.nf
++\f3 java\&.util java\&.io java\&.net \e\fP
++.fi
++.nf
++\f3 java\&.applet\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3WINDOWTITLE = \&'Java\(tm SE 7 API Specification\&'\fP
++.fi
++.nf
++\f3DOCTITLE = \&'Java\(tm Platform Standard Edition 7 API Specification\&'\fP
++.fi
++.nf
++\f3HEADER = \&'<b>Java\(tm SE 7</font>\&'\fP
++.fi
++.nf
++\f3BOTTOM = \&'<font size="\-1">\fP
++.fi
++.nf
++\f3 <a href="http://bugreport\&.sun\&.com/bugreport/">Submit a bug or feature</a><br/>\fP
++.fi
++.nf
++\f3 Copyright &copy; 1993, 2011, Oracle and/or its affiliates\&. All rights reserved\&.<br/>\fP
++.fi
++.nf
++\f3 Oracle is a registered trademark of Oracle Corporation and/or its affiliates\&.\fP
++.fi
++.nf
++\f3 Other names may be trademarks of their respective owners\&.</font>\&'\fP
++.fi
++.nf
++\f3GROUPCORE = \&'"Core Packages" "java\&.*:com\&.sun\&.java\&.*:org\&.omg\&.*"\&'\fP
++.fi
++.nf
++\f3GROUPEXT = \&'"Extension Packages" "javax\&.*"\&'\fP
++.fi
++.nf
++\f3SRCDIR = \&'/java/jdk/1\&.7\&.0/src/share/classes\&'\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS NOTES
++.TP 0.2i
++\(bu
++If you omit the \f3-windowtitle\fR option, then the \f3javadoc\fR command copies the document title to the window title\&. The \f3-windowtitle\fR option text is similar to the the \f3-doctitle\fR option, but without HTML tags to prevent those tags from appearing as raw text in the window title\&.
++.TP 0.2i
++\(bu
++If you omit the \f3-footer\fR option, then the \f3javadoc\fR command copies the header text to the footer\&.
++.TP 0.2i
++\(bu
++Other important options you might want to use, but were not needed in the previous example, are the \f3-classpath\fR and \f3-link\fR options\&.
++.SH GENERAL\ TROUBLESHOOTING
++.TP 0.2i
++\(bu
++The \f3javadoc\fR command reads only files that contain valid class names\&. If the \f3javadoc\fR command is not correctly reading the contents of a file, then verify that the class names are valid\&. See Process Source Files\&.
++.TP 0.2i
++\(bu
++See the Javadoc FAQ for information about common bugs and for troubleshooting tips at http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137483\&.html
++.SH ERRORS\ AND\ WARNINGS
++Error and warning messages contain the file name and line number to the declaration line rather than to the particular line in the documentation comment\&.
++.PP
++For example, this message \f3error: cannot read: Class1\&.java\fR means that the \f3javadoc\fR command is trying to load \f3Class1\&.jav\fR\f3a\fR in the current directory\&. The class name is shown with its path (absolute or relative)\&.
++.SH ENVIRONMENT
++.TP
++CLASSPATH
++\f3CLASSPATH\fR is the environment variable that provides the path that the \f3javadoc\fR command uses to find user class files\&. This environment variable is overridden by the \f3-classpath\fR option\&. Separate directories with a semicolon for Windows or a colon for Oracle Solaris\&.
++
++\fIWindows example\fR: \f3\&.;C:\eclasses;C:\ehome\ejava\eclasses\fR
++
++\fIOracle Solaris example\fR: \f3\&.:/home/classes:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javap(1)
++.SH RELATED\ DOCUMENTS
++.TP 0.2i
++\(bu
++Javadoc Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/index\&.html
++.TP 0.2i
++\(bu
++How Classes Are Found http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html
++.TP 0.2i
++\(bu
++How to Write Doc Comments for the Javadoc Tool http://www\&.oracle\&.com/technetwork/java/javase/documentation/index-137868\&.html
++.TP 0.2i
++\(bu
++URL Memo, Uniform Resource Locators http://www\&.ietf\&.org/rfc/rfc1738\&.txt
++.TP 0.2i
++\(bu
++HTML standard, HTML Document Representation (4197265 and 4137321) http://www\&.w3\&.org/TR/REC-html40/charset\&.html#h-5\&.2\&.2
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/javah.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/javah.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1994, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: javah.1
+-.\"
+-.if n .pl 99999
+-.TH javah 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: javah.1
++.\"
++.if n .pl 99999
++.TH javah 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,111 +47,111 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-javah \- Generates C header and source files from a Java class\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjavah\fR [ \fIoptions\fR ] f\fIully\-qualified\-class\-name \&.\&.\&.\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIfully-qualified-class-name\fR
+-The fully qualified location of the classes to be converted to C header and source files\&.
+-.SH DESCRIPTION
+-The \f3javah\fR command generates C header and source files that are needed to implement native methods\&. The generated header and source files are used by C programs to reference an object\&'s instance variables from native source code\&. The \f3\&.h\fR file contains a \f3struct\fR definition with a layout that parallels the layout of the corresponding class\&. The fields in the \f3struct\fR correspond to instance variables in the class\&.
+-.PP
+-The name of the header file and the structure declared within it are derived from the name of the class\&. When the class passed to the \f3javah\fR command is inside a package, the package name is added to the beginning of both the header file name and the structure name\&. Underscores (_) are used as name delimiters\&.
+-.PP
+-By default the \f3javah\fR command creates a header file for each class listed on the command line and puts the files in the current directory\&. Use the \f3-stubs\fR option to create source files\&. Use the \f3-o\fR option to concatenate the results for all listed classes into a single file\&.
+-.PP
+-The Java Native Interface (JNI) does not require header information or stub files\&. The \f3javah\fR command can still be used to generate native method function prototypes needed for JNI-style native methods\&. The \f3javah\fR command produces JNI-style output by default and places the result in the \f3\&.h\fR file\&.
+-.SH OPTIONS
+-.TP
+--o \fIoutputfile\fR
+-.br
+-Concatenates the resulting header or source files for all the classes listed on the command line into an output file\&. Only one of \f3-o\fR or \f3-d\fR can be used\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Sets the directory where the \f3javah\fR command saves the header files or the stub files\&. Only one of \f3-d\fR or \f3-o\fR can be used\&.
+-.TP
+--stubs
+-.br
+-Causes the \f3javah\fR command to generate C declarations from the Java object file\&.
+-.TP
+--verbose
+-.br
+-Indicates verbose output and causes the \f3javah\fR command to print a message to \f3stdout\fR about the status of the generated files\&.
+-.TP
+--help
+-.br
+-Prints a help message for \f3javah\fR usage\&.
+-.TP
+--version
+-.br
+-Prints \f3javah\fR command release information\&.
+-.TP
+--jni
+-.br
+-Causes the \f3javah\fR command to create an output file containing JNI-style native method function prototypes\&. This is the default output; use of \f3-jni\fR is optional\&.
+-.TP
+--classpath \fIpath\fR
+-.br
+-Specifies the path the \f3javah\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons on Oracle Solaris and semicolons on Windows\&. The general format for path is:
+-
+-\fIOracle Solaris\fR:
+-
+-\&.:\fIyour-path\fR
+-
+-Example: \f3\&.:/home/avh/classes:/usr/local/java/classes\fR
+-
+-\fIWindows\fR:
+-
+-\&.;\fIyour-path\fR
+-
+-Example: \f3\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR
+-
+-As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
+-
+-For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JAR\fR, then the class path element \f3mydir/*\fR is expanded to a \f3A\fR\f3\&.jar:b\&.JAR\fR, except that the order of jar files is unspecified\&. All JAR files in the specified directory, including hidden ones, are included in the list\&. A class path entry that consists of * expands to a list of all the JAR files in the current directory\&. The \f3CLASSPATH\fR environment variable, where defined, is similarly expanded\&. Any class path wild card expansion occurs before the Java Virtual Machine (JVM) is started\&. A Java program will never see unexpanded wild cards except by querying the environment\&. For example, by calling \f3System\&.getenv("CLASSPATH")\fR\&.
+-.TP
+--bootclasspath \fIpath\fR
+-.br
+-Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre\elib\ert\&.jar\fR and several other JAR files\&.
+-.TP
+--old
+-.br
+-Specifies that old JDK 1\&.0-style header files should be generated\&.
+-.TP
+--force
+-.br
+-Specifies that output files should always be written\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jdb(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
+-.TP 0.2i
+-\(bu
+-javadoc(1)
++
++.SH NAME
++javah \- Generates C header and source files from a Java class\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjavah\fR [ \fIoptions\fR ] f\fIully\-qualified\-class\-name \&.\&.\&.\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIfully-qualified-class-name\fR
++The fully qualified location of the classes to be converted to C header and source files\&.
++.SH DESCRIPTION
++The \f3javah\fR command generates C header and source files that are needed to implement native methods\&. The generated header and source files are used by C programs to reference an object\&'s instance variables from native source code\&. The \f3\&.h\fR file contains a \f3struct\fR definition with a layout that parallels the layout of the corresponding class\&. The fields in the \f3struct\fR correspond to instance variables in the class\&.
++.PP
++The name of the header file and the structure declared within it are derived from the name of the class\&. When the class passed to the \f3javah\fR command is inside a package, the package name is added to the beginning of both the header file name and the structure name\&. Underscores (_) are used as name delimiters\&.
++.PP
++By default the \f3javah\fR command creates a header file for each class listed on the command line and puts the files in the current directory\&. Use the \f3-stubs\fR option to create source files\&. Use the \f3-o\fR option to concatenate the results for all listed classes into a single file\&.
++.PP
++The Java Native Interface (JNI) does not require header information or stub files\&. The \f3javah\fR command can still be used to generate native method function prototypes needed for JNI-style native methods\&. The \f3javah\fR command produces JNI-style output by default and places the result in the \f3\&.h\fR file\&.
++.SH OPTIONS
++.TP
++-o \fIoutputfile\fR
++.br
++Concatenates the resulting header or source files for all the classes listed on the command line into an output file\&. Only one of \f3-o\fR or \f3-d\fR can be used\&.
++.TP
++-d \fIdirectory\fR
++.br
++Sets the directory where the \f3javah\fR command saves the header files or the stub files\&. Only one of \f3-d\fR or \f3-o\fR can be used\&.
++.TP
++-stubs
++.br
++Causes the \f3javah\fR command to generate C declarations from the Java object file\&.
++.TP
++-verbose
++.br
++Indicates verbose output and causes the \f3javah\fR command to print a message to \f3stdout\fR about the status of the generated files\&.
++.TP
++-help
++.br
++Prints a help message for \f3javah\fR usage\&.
++.TP
++-version
++.br
++Prints \f3javah\fR command release information\&.
++.TP
++-jni
++.br
++Causes the \f3javah\fR command to create an output file containing JNI-style native method function prototypes\&. This is the default output; use of \f3-jni\fR is optional\&.
++.TP
++-classpath \fIpath\fR
++.br
++Specifies the path the \f3javah\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons on Oracle Solaris and semicolons on Windows\&. The general format for path is:
++
++\fIOracle Solaris\fR:
++
++\&.:\fIyour-path\fR
++
++Example: \f3\&.:/home/avh/classes:/usr/local/java/classes\fR
++
++\fIWindows\fR:
++
++\&.;\fIyour-path\fR
++
++Example: \f3\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR
++
++As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&.
++
++For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JAR\fR, then the class path element \f3mydir/*\fR is expanded to a \f3A\fR\f3\&.jar:b\&.JAR\fR, except that the order of jar files is unspecified\&. All JAR files in the specified directory, including hidden ones, are included in the list\&. A class path entry that consists of * expands to a list of all the JAR files in the current directory\&. The \f3CLASSPATH\fR environment variable, where defined, is similarly expanded\&. Any class path wild card expansion occurs before the Java Virtual Machine (JVM) is started\&. A Java program will never see unexpanded wild cards except by querying the environment\&. For example, by calling \f3System\&.getenv("CLASSPATH")\fR\&.
++.TP
++-bootclasspath \fIpath\fR
++.br
++Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre\elib\ert\&.jar\fR and several other JAR files\&.
++.TP
++-old
++.br
++Specifies that old JDK 1\&.0-style header files should be generated\&.
++.TP
++-force
++.br
++Specifies that output files should always be written\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jdb(1)
++.TP 0.2i
++\(bu
++javap(1)
++.TP 0.2i
++\(bu
++javadoc(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/javap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/javap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/jcmd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jcmd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2012, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/jconsole.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jconsole.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Troubleshooting, Profiling, Monitoring and Management Tools
+-.\" Title: jconsole.1
+-.\"
+-.if n .pl 99999
+-.TH jconsole 1 "21 November 2013" "JDK 8" "Java Troubleshooting, Profiling, Monitoring and Management Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Troubleshooting, Profiling, Monitoring and Management Tools
++.\" Title: jconsole.1
++.\"
++.if n .pl 99999
++.TH jconsole 1 "21 November 2013" "JDK 8" "Java Troubleshooting, Profiling, Monitoring and Management Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,65 +47,65 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jconsole \- Starts a graphical console that lets you monitor and manage Java applications\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjconsole\fR [ \fIoptions\fR ] [ connection \&.\&.\&. ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR
+-The \f3pid\fR value is the process ID of a local Java Virtual Machine (JVM)\&. The JVM must be running with the same user ID as the user ID running the \f3jconsole\fR command\&.The \f3host:port\fR values are the name of the host system on which the JVM is running, and the port number specified by the system property \f3com\&.sun\&.management\&.jmxremote\&.port\fR when the JVM was started\&.The \f3jmxUrl\fR value is the address of the JMX agent to be connected to as described in JMXServiceURL\&.
+-
+-For more information about the \f3connection\fR parameter, see Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
+-
+-See also the \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
+-.SH DESCRIPTION
+-The \f3jconsole\fR command starts a graphical console tool that lets you monitor and manage Java applications and virtual machines on a local or remote machine\&.
+-.PP
+-On Windows, the \f3jconsole\fR command does not associate with a console window\&. It does, however, display a dialog box with error information when the \f3jconsole\fR command fails\&.
+-.SH OPTIONS
+-.TP
+--interval\fI=n\fR
+-.br
+-Sets the update interval to \fIn\fR seconds (default is 4 seconds)\&.
+-.TP
+--notile
+-.br
+-Does not tile windows initially (for two or more connections)\&.
+-.TP
+--pluginpath \fIplugins\fR
+-.br
+-Specifies a list of directories or JAR files to be searched for \f3JConsole\fR plug-ins\&. The \fIplugins\fR path should contain a provider-configuration file named \f3META-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR that contains one line for each plug-in\&. The line specifies the fully qualified class name of the class implementing the \f3com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR class\&.
+-.TP
+--version
+-.br
+-Displays release information and exits\&.
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the JVM on which the \f3jconsole\fR command is run\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Using JConsole at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html
+-.TP 0.2i
+-\(bu
+-Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
+-.TP 0.2i
+-\(bu
+-The \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
++
++.SH NAME
++jconsole \- Starts a graphical console that lets you monitor and manage Java applications\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjconsole\fR [ \fIoptions\fR ] [ connection \&.\&.\&. ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR
++The \f3pid\fR value is the process ID of a local Java Virtual Machine (JVM)\&. The JVM must be running with the same user ID as the user ID running the \f3jconsole\fR command\&.The \f3host:port\fR values are the name of the host system on which the JVM is running, and the port number specified by the system property \f3com\&.sun\&.management\&.jmxremote\&.port\fR when the JVM was started\&.The \f3jmxUrl\fR value is the address of the JMX agent to be connected to as described in JMXServiceURL\&.
++
++For more information about the \f3connection\fR parameter, see Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
++
++See also the \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
++.SH DESCRIPTION
++The \f3jconsole\fR command starts a graphical console tool that lets you monitor and manage Java applications and virtual machines on a local or remote machine\&.
++.PP
++On Windows, the \f3jconsole\fR command does not associate with a console window\&. It does, however, display a dialog box with error information when the \f3jconsole\fR command fails\&.
++.SH OPTIONS
++.TP
++-interval\fI=n\fR
++.br
++Sets the update interval to \fIn\fR seconds (default is 4 seconds)\&.
++.TP
++-notile
++.br
++Does not tile windows initially (for two or more connections)\&.
++.TP
++-pluginpath \fIplugins\fR
++.br
++Specifies a list of directories or JAR files to be searched for \f3JConsole\fR plug-ins\&. The \fIplugins\fR path should contain a provider-configuration file named \f3META-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR that contains one line for each plug-in\&. The line specifies the fully qualified class name of the class implementing the \f3com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR class\&.
++.TP
++-version
++.br
++Displays release information and exits\&.
++.TP
++-help
++.br
++Displays a help message\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the JVM on which the \f3jconsole\fR command is run\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Using JConsole at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html
++.TP 0.2i
++\(bu
++Monitoring and Management Using JMX Technology at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html
++.TP 0.2i
++\(bu
++The \f3JMXServiceURL\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jdb.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jdb.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1995, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jdb.1
+-.\"
+-.if n .pl 99999
+-.TH jdb 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jdb.1
++.\"
++.if n .pl 99999
++.TH jdb 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,223 +47,223 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jdb \- Finds and fixes bugs in Java platform programs\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjdb\fR [\fIoptions\fR] [\fIclassname\fR] [\fIarguments\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIclass\fRname
+-Name of the main class to debug\&.
+-.TP
+-\fIarguments\fR
+-Arguments passed to the \f3main()\fR method of the class\&.
+-.SH DESCRIPTION
+-The Java Debugger (JDB) is a simple command-line debugger for Java classes\&. The \f3jdb\fR command and its options call the JDB\&. The \f3jdb\fR command demonstrates the Java Platform Debugger Architecture (JDBA) and provides inspection and debugging of a local or remote Java Virtual Machine (JVM)\&. See Java Platform Debugger Architecture (JDBA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
+-.SS START\ A\ JDB\ SESSION
+-There are many ways to start a JDB session\&. The most frequently used way is to have JDB launch a new JVM with the main class of the application to be debugged\&. Do this by substituting the \f3jdb\fR command for the \f3java\fR command in the command line\&. For example, if your application\&'s main class is \f3MyClass\fR, then use the following command to debug it under JDB:
+-.sp
+-.nf
+-\f3jdb MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When started this way, the \f3jdb\fR command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class\&'s first instruction\&.
+-.PP
+-Another way to use the \f3jdb\fR command is by attaching it to a JVM that is already running\&. Syntax for starting a JVM to which the \f3jdb\fR command attaches when the JVM is running is as follows\&. This loads in-process debugging libraries and specifies the kind of connection to be made\&.
+-.sp
+-.nf
+-\f3java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-You can then attach the \f3jdb\fR command to the JVM with the following command:
+-.sp
+-.nf
+-\f3jdb \-attach 8000\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3MyClass\fR argument is not specified in the \f3jdb\fR command line in this case because the \f3jdb\fR command is connecting to an existing JVM instead of launching a new JVM\&.
+-.PP
+-There are many other ways to connect the debugger to a JVM, and all of them are supported by the \f3jdb\fR command\&. The Java Platform Debugger Architecture has additional documentation on these connection options\&.
+-.SS BASIC\ JDB\ COMMANDS
+-The following is a list of the basic \f3jdb\fR commands\&. The JDB supports other commands that you can list with the \f3-help\fR option\&.
+-.TP
+-help or ?
+-The \f3help\fR or \f3?\fR commands display the list of recognized commands with a brief description\&.
+-.TP
+-run
+-After you start JDB and set breakpoints, you can use the \f3run\fR command to execute the debugged application\&. The \f3run\fR command is available only when the \f3jdb\fR command starts the debugged application as opposed to attaching to an existing JVM\&.
+-.TP
+-cont
+-Continues execution of the debugged application after a breakpoint, exception, or step\&.
+-.TP
+-print
+-Displays Java objects and primitive values\&. For variables or fields of primitive types, the actual value is printed\&. For objects, a short description is printed\&. See the dump command to find out how to get more information about an object\&.
+-
+-\fINote:\fR To display local variables, the containing class must have been compiled with the \f3javac -g\fR option\&.
+-
+-The \f3print\fR command supports many simple Java expressions including those with method invocations, for example:
+-.sp
+-.nf
+-\f3print MyClass\&.myStaticField\fP
+-.fi
+-.nf
+-\f3print myObj\&.myInstanceField\fP
+-.fi
+-.nf
+-\f3print i + j + k (i, j, k are primities and either fields or local variables)\fP
+-.fi
+-.nf
+-\f3print myObj\&.myMethod() (if myMethod returns a non\-null)\fP
+-.fi
+-.nf
+-\f3print new java\&.lang\&.String("Hello")\&.length()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-dump
+-For primitive values, the \f3dump\fR command is identical to the \f3print\fR command\&. For objects, the \f3dump\fR command prints the current value of each field defined in the object\&. Static and instance fields are included\&. The \f3dump\fR command supports the same set of expressions as the \f3print\fR command\&.
+-.TP
+-threads
+-List the threads that are currently running\&. For each thread, its name and current status are printed and an index that can be used in other commands\&. In this example, the thread index is 4, the thread is an instance of \f3java\&.lang\&.Thread\fR, the thread name is \f3main\fR, and it is currently running\&.
+-.sp
+-.nf
+-\f34\&. (java\&.lang\&.Thread)0x1 main running\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-thread
+-Select a thread to be the current thread\&. Many \f3jdb\fR commands are based on the setting of the current thread\&. The thread is specified with the thread index described in the threads command\&.
+-.TP
+-where
+-The \f3where\fR command with no arguments dumps the stack of the current thread\&. The \f3where\fR\f3all\fR command dumps the stack of all threads in the current thread group\&. The \f3where\fR\f3threadindex\fR command dumps the stack of the specified thread\&.
+-
+-If the current thread is suspended either through an event such as a breakpoint or through the \f3suspend\fR command, then local variables and fields can be displayed with the \f3print\fR and \f3dump\fR commands\&. The \f3up\fR and \f3down\fR commands select which stack frame is the current stack frame\&.
+-.SS BREAKPOINTS
+-Breakpoints can be set in JDB at line numbers or at the first instruction of a method, for example:
+-.TP 0.2i
+-\(bu
+-The command \f3stop at MyClass:22\fR sets a breakpoint at the first instruction for line 22 of the source file containing \f3MyClass\fR\&.
+-.TP 0.2i
+-\(bu
+-The command \f3stop in java\&.lang\&.String\&.length\fR sets a breakpoint at the beginning of the method \f3java\&.lang\&.String\&.length\fR\&.
+-.TP 0.2i
+-\(bu
+-The command \f3stop in MyClass\&.<clinit>\fR uses \f3<clinit>\fR to identify the static initialization code for \f3MyClass\fR\&.
+-.PP
+-When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint\&. For example, \f3MyClass\&.myMethod(int,java\&.lang\&.String)\fR or \f3MyClass\&.myMethod()\fR\&.
+-.PP
+-The \f3clear\fR command removes breakpoints using the following syntax: \f3clear MyClass:45\fR\&. Using the \f3clear\fR or \f3stop\fR command with no argument displays a list of all breakpoints currently set\&. The \f3cont\fR command continues execution\&.
+-.SS STEPPING
+-The \f3step\fR command advances execution to the next line whether it is in the current stack frame or a called method\&. The \f3next\fR command advances execution to the next line in the current stack frame\&.
+-.SS EXCEPTIONS
+-When an exception occurs for which there is not a \f3catch\fR statement anywhere in the throwing thread\&'s call stack, the JVM typically prints an exception trace and exits\&. When running under JDB, however, control returns to JDB at the offending throw\&. You can then use the \f3jdb\fR command to diagnose the cause of the exception\&.
+-.PP
+-Use the \f3catch\fR command to cause the debugged application to stop at other thrown exceptions, for example: \f3catch java\&.io\&.FileNotFoundException\fR or \f3catch\fR\f3mypackage\&.BigTroubleException\fR\&. Any exception that is an instance of the specified class or subclass stops the application at the point where it is thrown\&.
+-.PP
+-The \f3ignore\fR command negates the effect of an earlier \f3catch\fR command\&. The \f3ignore\fR command does not cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger\&.
+-.SH OPTIONS
+-When you use the \f3jdb\fR command instead of the \f3java\fR command on the command line, the \f3jdb\fR command accepts many of the same options as the \f3java\fR command, including \f3-D\fR, \f3-classpath\fR, and \f3-X\fR options\&. The following list contains additional options that are accepted by the \f3jdb\fR command\&.
+-.PP
+-Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM it is to debug\&. For additional documentation about these connection alternatives, see Java Platform Debugger Architecture (JPDA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.TP
+--sourcepath \fIdir1:dir2: \&. \&. \&.\fR
+-.br
+-Uses the specified path to search for source files in the specified path\&. If this option is not specified, then use the default path of dot (\&.)\&.
+-.TP
+--attach \fIaddress\fR
+-.br
+-Attaches the debugger to a running JVM with the default connection mechanism\&.
+-.TP
+--listen \fIaddress\fR
+-.br
+-Waits for a running JVM to connect to the specified address with a standard connector\&.
+-.TP
+--launch
+-.br
+-Starts the debugged application immediately upon startup of JDB\&. The \f3-launch\fR option removes the need for the \f3run\fR command\&. The debugged application is launched and then stopped just before the initial application class is loaded\&. At that point, you can set any necessary breakpoints and use the \f3cont\fR command to continue execution\&.
+-.TP
+--listconnectors
+-.br
+-List the connectors available in this JVM\&.
+-.TP
+--connect connector-name:\fIname1=value1\fR
+-.br
+-Connects to the target JVM with the named connector and listed argument values\&.
+-.TP
+--dbgtrace [\fIflags\fR]
+-.br
+-Prints information for debugging the \f3jdb\fR command\&.
+-.TP
+--tclient
+-.br
+-Runs the application in the Java HotSpot VM client\&.
+-.TP
+--tserver
+-.br
+-Runs the application in the Java HotSpot VM server\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH OPTIONS\ FORWARDED\ TO\ THE\ DEBUGGER\ PROCESS
+-.TP
+--v -verbose[:\fIclass\fR|gc|jni]
+-.br
+-Turns on verbose mode\&.
+-.TP
+--D\fIname\fR=\fIvalue\fR
+-.br
+-Sets a system property\&.
+-.TP
+--classpath \fIdir\fR
+-.br
+-Lists directories separated by colons in which to look for classes\&.
+-.TP
+--X\fIoption\fR
+-.br
+-Nonstandard target JVM option\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-javah(1)
+-.TP 0.2i
+-\(bu
+-javap(1)
++
++.SH NAME
++jdb \- Finds and fixes bugs in Java platform programs\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjdb\fR [\fIoptions\fR] [\fIclassname\fR] [\fIarguments\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIclass\fRname
++Name of the main class to debug\&.
++.TP
++\fIarguments\fR
++Arguments passed to the \f3main()\fR method of the class\&.
++.SH DESCRIPTION
++The Java Debugger (JDB) is a simple command-line debugger for Java classes\&. The \f3jdb\fR command and its options call the JDB\&. The \f3jdb\fR command demonstrates the Java Platform Debugger Architecture (JDBA) and provides inspection and debugging of a local or remote Java Virtual Machine (JVM)\&. See Java Platform Debugger Architecture (JDBA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
++.SS START\ A\ JDB\ SESSION
++There are many ways to start a JDB session\&. The most frequently used way is to have JDB launch a new JVM with the main class of the application to be debugged\&. Do this by substituting the \f3jdb\fR command for the \f3java\fR command in the command line\&. For example, if your application\&'s main class is \f3MyClass\fR, then use the following command to debug it under JDB:
++.sp
++.nf
++\f3jdb MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When started this way, the \f3jdb\fR command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class\&'s first instruction\&.
++.PP
++Another way to use the \f3jdb\fR command is by attaching it to a JVM that is already running\&. Syntax for starting a JVM to which the \f3jdb\fR command attaches when the JVM is running is as follows\&. This loads in-process debugging libraries and specifies the kind of connection to be made\&.
++.sp
++.nf
++\f3java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++You can then attach the \f3jdb\fR command to the JVM with the following command:
++.sp
++.nf
++\f3jdb \-attach 8000\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3MyClass\fR argument is not specified in the \f3jdb\fR command line in this case because the \f3jdb\fR command is connecting to an existing JVM instead of launching a new JVM\&.
++.PP
++There are many other ways to connect the debugger to a JVM, and all of them are supported by the \f3jdb\fR command\&. The Java Platform Debugger Architecture has additional documentation on these connection options\&.
++.SS BASIC\ JDB\ COMMANDS
++The following is a list of the basic \f3jdb\fR commands\&. The JDB supports other commands that you can list with the \f3-help\fR option\&.
++.TP
++help or ?
++The \f3help\fR or \f3?\fR commands display the list of recognized commands with a brief description\&.
++.TP
++run
++After you start JDB and set breakpoints, you can use the \f3run\fR command to execute the debugged application\&. The \f3run\fR command is available only when the \f3jdb\fR command starts the debugged application as opposed to attaching to an existing JVM\&.
++.TP
++cont
++Continues execution of the debugged application after a breakpoint, exception, or step\&.
++.TP
++print
++Displays Java objects and primitive values\&. For variables or fields of primitive types, the actual value is printed\&. For objects, a short description is printed\&. See the dump command to find out how to get more information about an object\&.
++
++\fINote:\fR To display local variables, the containing class must have been compiled with the \f3javac -g\fR option\&.
++
++The \f3print\fR command supports many simple Java expressions including those with method invocations, for example:
++.sp
++.nf
++\f3print MyClass\&.myStaticField\fP
++.fi
++.nf
++\f3print myObj\&.myInstanceField\fP
++.fi
++.nf
++\f3print i + j + k (i, j, k are primities and either fields or local variables)\fP
++.fi
++.nf
++\f3print myObj\&.myMethod() (if myMethod returns a non\-null)\fP
++.fi
++.nf
++\f3print new java\&.lang\&.String("Hello")\&.length()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++dump
++For primitive values, the \f3dump\fR command is identical to the \f3print\fR command\&. For objects, the \f3dump\fR command prints the current value of each field defined in the object\&. Static and instance fields are included\&. The \f3dump\fR command supports the same set of expressions as the \f3print\fR command\&.
++.TP
++threads
++List the threads that are currently running\&. For each thread, its name and current status are printed and an index that can be used in other commands\&. In this example, the thread index is 4, the thread is an instance of \f3java\&.lang\&.Thread\fR, the thread name is \f3main\fR, and it is currently running\&.
++.sp
++.nf
++\f34\&. (java\&.lang\&.Thread)0x1 main running\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++thread
++Select a thread to be the current thread\&. Many \f3jdb\fR commands are based on the setting of the current thread\&. The thread is specified with the thread index described in the threads command\&.
++.TP
++where
++The \f3where\fR command with no arguments dumps the stack of the current thread\&. The \f3where\fR\f3all\fR command dumps the stack of all threads in the current thread group\&. The \f3where\fR\f3threadindex\fR command dumps the stack of the specified thread\&.
++
++If the current thread is suspended either through an event such as a breakpoint or through the \f3suspend\fR command, then local variables and fields can be displayed with the \f3print\fR and \f3dump\fR commands\&. The \f3up\fR and \f3down\fR commands select which stack frame is the current stack frame\&.
++.SS BREAKPOINTS
++Breakpoints can be set in JDB at line numbers or at the first instruction of a method, for example:
++.TP 0.2i
++\(bu
++The command \f3stop at MyClass:22\fR sets a breakpoint at the first instruction for line 22 of the source file containing \f3MyClass\fR\&.
++.TP 0.2i
++\(bu
++The command \f3stop in java\&.lang\&.String\&.length\fR sets a breakpoint at the beginning of the method \f3java\&.lang\&.String\&.length\fR\&.
++.TP 0.2i
++\(bu
++The command \f3stop in MyClass\&.<clinit>\fR uses \f3<clinit>\fR to identify the static initialization code for \f3MyClass\fR\&.
++.PP
++When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint\&. For example, \f3MyClass\&.myMethod(int,java\&.lang\&.String)\fR or \f3MyClass\&.myMethod()\fR\&.
++.PP
++The \f3clear\fR command removes breakpoints using the following syntax: \f3clear MyClass:45\fR\&. Using the \f3clear\fR or \f3stop\fR command with no argument displays a list of all breakpoints currently set\&. The \f3cont\fR command continues execution\&.
++.SS STEPPING
++The \f3step\fR command advances execution to the next line whether it is in the current stack frame or a called method\&. The \f3next\fR command advances execution to the next line in the current stack frame\&.
++.SS EXCEPTIONS
++When an exception occurs for which there is not a \f3catch\fR statement anywhere in the throwing thread\&'s call stack, the JVM typically prints an exception trace and exits\&. When running under JDB, however, control returns to JDB at the offending throw\&. You can then use the \f3jdb\fR command to diagnose the cause of the exception\&.
++.PP
++Use the \f3catch\fR command to cause the debugged application to stop at other thrown exceptions, for example: \f3catch java\&.io\&.FileNotFoundException\fR or \f3catch\fR\f3mypackage\&.BigTroubleException\fR\&. Any exception that is an instance of the specified class or subclass stops the application at the point where it is thrown\&.
++.PP
++The \f3ignore\fR command negates the effect of an earlier \f3catch\fR command\&. The \f3ignore\fR command does not cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger\&.
++.SH OPTIONS
++When you use the \f3jdb\fR command instead of the \f3java\fR command on the command line, the \f3jdb\fR command accepts many of the same options as the \f3java\fR command, including \f3-D\fR, \f3-classpath\fR, and \f3-X\fR options\&. The following list contains additional options that are accepted by the \f3jdb\fR command\&.
++.PP
++Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM it is to debug\&. For additional documentation about these connection alternatives, see Java Platform Debugger Architecture (JPDA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
++.TP
++-help
++.br
++Displays a help message\&.
++.TP
++-sourcepath \fIdir1:dir2: \&. \&. \&.\fR
++.br
++Uses the specified path to search for source files in the specified path\&. If this option is not specified, then use the default path of dot (\&.)\&.
++.TP
++-attach \fIaddress\fR
++.br
++Attaches the debugger to a running JVM with the default connection mechanism\&.
++.TP
++-listen \fIaddress\fR
++.br
++Waits for a running JVM to connect to the specified address with a standard connector\&.
++.TP
++-launch
++.br
++Starts the debugged application immediately upon startup of JDB\&. The \f3-launch\fR option removes the need for the \f3run\fR command\&. The debugged application is launched and then stopped just before the initial application class is loaded\&. At that point, you can set any necessary breakpoints and use the \f3cont\fR command to continue execution\&.
++.TP
++-listconnectors
++.br
++List the connectors available in this JVM\&.
++.TP
++-connect connector-name:\fIname1=value1\fR
++.br
++Connects to the target JVM with the named connector and listed argument values\&.
++.TP
++-dbgtrace [\fIflags\fR]
++.br
++Prints information for debugging the \f3jdb\fR command\&.
++.TP
++-tclient
++.br
++Runs the application in the Java HotSpot VM client\&.
++.TP
++-tserver
++.br
++Runs the application in the Java HotSpot VM server\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH OPTIONS\ FORWARDED\ TO\ THE\ DEBUGGER\ PROCESS
++.TP
++-v -verbose[:\fIclass\fR|gc|jni]
++.br
++Turns on verbose mode\&.
++.TP
++-D\fIname\fR=\fIvalue\fR
++.br
++Sets a system property\&.
++.TP
++-classpath \fIdir\fR
++.br
++Lists directories separated by colons in which to look for classes\&.
++.TP
++-X\fIoption\fR
++.br
++Nonstandard target JVM option\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++javah(1)
++.TP 0.2i
++\(bu
++javap(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jdeps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jdeps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Basic Tools
+-.\" Title: jdeps.1
+-.\"
+-.if n .pl 99999
+-.TH jdeps 1 "21 November 2013" "JDK 8" "Basic Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Basic Tools
++.\" Title: jdeps.1
++.\"
++.if n .pl 99999
++.TH jdeps 1 "21 November 2013" "JDK 8" "Basic Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,490 +47,490 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jdeps \- Java class dependency analyzer\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjdeps\fR [\fIoptions\fR] \fIclasses\fR \&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIclasses\fR
+-Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
+-.SH DESCRIPTION
+-The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
+-.SH OPTIONS
+-.TP
+--dotoutput <\fIdir\fR>
+-.br
+-Destination directory for DOT file output\&. If specified, \f3jdeps\fR will generate one dot file per each analyzed archive named <\fIarchive-file-name\fR>\&.dot listing the dependencies, and also a summary file named summary\&.dot listing the dependencies among the archives\&.
+-.TP
+--s, -summary
+-.br
+-Prints dependency summary only\&.
+-.TP
+--v, -verbose
+-.br
+-Prints all class-level dependencies\&.
+-.TP
+--verbose:package
+-.br
+-Prints package-level dependencies excluding dependencies within the same archive\&.
+-.TP
+--verbose:class
+-.br
+-Prints class-level dependencies excluding dependencies within the same archive\&.
+-.TP
+--cp <\fIpath\fR>, -classpath <\fIpath\fR>
+-.br
+-Specifies where to find class files\&.
+-
+-See also Setting the Class Path\&.
+-.TP
+--p <\fIpkg name\fR>, -package <\fIpkg name\fR>
+-.br
+-Finds dependencies in the specified package\&. You can specify this option multiple times for different packages\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
+-.TP
+--e <\fIregex\fR>, -regex <\fIregex\fR>
+-.br
+-Finds dependencies in packages matching the specified regular expression pattern\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
+-.TP
+--include <\fIregex\fR>
+-.br
+-Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
+-.TP
+--jdkinternals
+-.br
+-Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
+-
+-\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
+-.TP
+--P, -profile
+-.br
+-Shows profile or the file containing a package\&.
+-.TP
+--apionly
+-.br
+-Restricts analysis to APIs, for example, dependences from the signature of \f3public\fR and \f3protected\fR members of public classes including field type, method parameter types, returned type, and checked exception types\&.
+-.TP
+--R, -recursive
+-.br
+-Recursively traverses all dependencies\&.
+-.TP
+--version
+-.br
+-Prints version information\&.
+-.TP
+--h, -?, -help
+-.br
+-Prints help message for \f3jdeps\fR\&.
+-.SH EXAMPLES
+-Analyzing the dependencies of Notepad\&.jar\&.
+-.sp
+-.nf
+-\f3$ jdeps demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 <unnamed> (Notepad\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt \fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt\&.event \fP
+-.fi
+-.nf
+-\f3 \-> java\&.beans \fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.net \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.logging \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.border \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.event \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.text \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.tree \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.undo \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use -P or -profile option to show on which profile that Notepad depends\&.
+-.sp
+-.nf
+-\f3$ jdeps \-profile demo/jfc/Notepad/Notepad\&.jar \fP
+-.fi
+-.nf
+-\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE)\fP
+-.fi
+-.nf
+-\f3 <unnamed> (Notepad\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.awt\&.event Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.beans Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.net compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.util compact1\fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.logging compact1\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.border Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.event Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.text Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.tree Full JRE\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.swing\&.undo Full JRE\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Analyzing the immediate dependencies of a specific class in a given classpath, for example the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class in the tools\&.jar file\&.
+-.sp
+-.nf
+-\f3$ jdeps \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use the \f3-verbose:class\fR option to find class-level dependencies or use the \f3-v\fR or \f3-verbose\fR option to include dependencies from the same JAR file\&.
+-.sp
+-.nf
+-\f3$ jdeps \-verbose:class \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps\&.Main (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io\&.PrintWriter \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.Exception \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.Object \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.String \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.System \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Use the \f3-R\fR or \f3-recursive\fR option to analyze the transitive dependencies of the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class\&.
+-.sp
+-.nf
+-\f3$ jdeps \-R \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
+-.fi
+-.nf
+-\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.classfile (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.reflect \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.charset \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio\&.file\&.attribute \fP
+-.fi
+-.nf
+-\f3 \-> java\&.text \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.jar \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.zip \fP
+-.fi
+-.nf
+-\f3/usr/java/jre/lib/jce\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
+-.fi
+-.nf
+-\f3 javax\&.crypto (jce\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.io \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang\&.reflect \fP
+-.fi
+-.nf
+-\f3 \-> java\&.net \fP
+-.fi
+-.nf
+-\f3 \-> java\&.nio \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.cert \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.spec \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.concurrent \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.jar \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.regex \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util\&.zip \fP
+-.fi
+-.nf
+-\f3 \-> javax\&.security\&.auth \fP
+-.fi
+-.nf
+-\f3 \-> sun\&.security\&.jca JDK internal API (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> sun\&.security\&.util JDK internal API (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 javax\&.crypto\&.spec (jce\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> java\&.lang \fP
+-.fi
+-.nf
+-\f3 \-> java\&.security\&.spec \fP
+-.fi
+-.nf
+-\f3 \-> java\&.util \fP
+-.fi
+-.nf
+-\f3/usr/java/jre/lib/rt\&.jar \-> /usr/java/jre/lib/jce\&.jar\fP
+-.fi
+-.nf
+-\f3 java\&.security (rt\&.jar)\fP
+-.fi
+-.nf
+-\f3 \-> javax\&.crypto\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Generate dot files of the dependencies of Notepad demo\&.
+-.sp
+-.nf
+-\f3$ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\f3jdeps\fR will create one dot file for each given JAR file named <\fIfilename\fR>\&.dot in the dot directory specified in the \f3-dotoutput\fR option, and also a summary file named summary\&.dot that will list the dependencies among the JAR files
+-.sp
+-.nf
+-\f3$ cat dot/Notepad\&.jar\&.dot \fP
+-.fi
+-.nf
+-\f3digraph "Notepad\&.jar" {\fP
+-.fi
+-.nf
+-\f3 // Path: demo/jfc/Notepad/Notepad\&.jar\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.awt";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.awt\&.event";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.beans";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.io";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.lang";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.net";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.util";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "java\&.util\&.logging";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.border";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.event";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.text";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.tree";\fP
+-.fi
+-.nf
+-\f3 "<unnamed>" \-> "javax\&.swing\&.undo";\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3$ cat dot/summary\&.dot\fP
+-.fi
+-.nf
+-\f3digraph "summary" {\fP
+-.fi
+-.nf
+-\f3 "Notepad\&.jar" \-> "rt\&.jar";\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javap(1)
++
++.SH NAME
++jdeps \- Java class dependency analyzer\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjdeps\fR [\fIoptions\fR] \fIclasses\fR \&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIclasses\fR
++Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
++.SH DESCRIPTION
++The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
++.SH OPTIONS
++.TP
++-dotoutput <\fIdir\fR>
++.br
++Destination directory for DOT file output\&. If specified, \f3jdeps\fR will generate one dot file per each analyzed archive named <\fIarchive-file-name\fR>\&.dot listing the dependencies, and also a summary file named summary\&.dot listing the dependencies among the archives\&.
++.TP
++-s, -summary
++.br
++Prints dependency summary only\&.
++.TP
++-v, -verbose
++.br
++Prints all class-level dependencies\&.
++.TP
++-verbose:package
++.br
++Prints package-level dependencies excluding dependencies within the same archive\&.
++.TP
++-verbose:class
++.br
++Prints class-level dependencies excluding dependencies within the same archive\&.
++.TP
++-cp <\fIpath\fR>, -classpath <\fIpath\fR>
++.br
++Specifies where to find class files\&.
++
++See also Setting the Class Path\&.
++.TP
++-p <\fIpkg name\fR>, -package <\fIpkg name\fR>
++.br
++Finds dependencies in the specified package\&. You can specify this option multiple times for different packages\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
++.TP
++-e <\fIregex\fR>, -regex <\fIregex\fR>
++.br
++Finds dependencies in packages matching the specified regular expression pattern\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
++.TP
++-include <\fIregex\fR>
++.br
++Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
++.TP
++-jdkinternals
++.br
++Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
++
++\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
++.TP
++-P, -profile
++.br
++Shows profile or the file containing a package\&.
++.TP
++-apionly
++.br
++Restricts analysis to APIs, for example, dependences from the signature of \f3public\fR and \f3protected\fR members of public classes including field type, method parameter types, returned type, and checked exception types\&.
++.TP
++-R, -recursive
++.br
++Recursively traverses all dependencies\&.
++.TP
++-version
++.br
++Prints version information\&.
++.TP
++-h, -?, -help
++.br
++Prints help message for \f3jdeps\fR\&.
++.SH EXAMPLES
++Analyzing the dependencies of Notepad\&.jar\&.
++.sp
++.nf
++\f3$ jdeps demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 <unnamed> (Notepad\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.awt \fP
++.fi
++.nf
++\f3 \-> java\&.awt\&.event \fP
++.fi
++.nf
++\f3 \-> java\&.beans \fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.net \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.logging \fP
++.fi
++.nf
++\f3 \-> javax\&.swing \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.border \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.event \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.text \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.tree \fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.undo \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use -P or -profile option to show on which profile that Notepad depends\&.
++.sp
++.nf
++\f3$ jdeps \-profile demo/jfc/Notepad/Notepad\&.jar \fP
++.fi
++.nf
++\f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE)\fP
++.fi
++.nf
++\f3 <unnamed> (Notepad\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.awt Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.awt\&.event Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.beans Full JRE\fP
++.fi
++.nf
++\f3 \-> java\&.io compact1\fP
++.fi
++.nf
++\f3 \-> java\&.lang compact1\fP
++.fi
++.nf
++\f3 \-> java\&.net compact1\fP
++.fi
++.nf
++\f3 \-> java\&.util compact1\fP
++.fi
++.nf
++\f3 \-> java\&.util\&.logging compact1\fP
++.fi
++.nf
++\f3 \-> javax\&.swing Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.border Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.event Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.text Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.tree Full JRE\fP
++.fi
++.nf
++\f3 \-> javax\&.swing\&.undo Full JRE\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Analyzing the immediate dependencies of a specific class in a given classpath, for example the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class in the tools\&.jar file\&.
++.sp
++.nf
++\f3$ jdeps \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use the \f3-verbose:class\fR option to find class-level dependencies or use the \f3-v\fR or \f3-verbose\fR option to include dependencies from the same JAR file\&.
++.sp
++.nf
++\f3$ jdeps \-verbose:class \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps\&.Main (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io\&.PrintWriter \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.Exception \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.Object \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.String \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.System \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Use the \f3-R\fR or \f3-recursive\fR option to analyze the transitive dependencies of the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class\&.
++.sp
++.nf
++\f3$ jdeps \-R \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
++.fi
++.nf
++\f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.classfile (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.reflect \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.charset \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file \fP
++.fi
++.nf
++\f3 \-> java\&.nio\&.file\&.attribute \fP
++.fi
++.nf
++\f3 \-> java\&.text \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.jar \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.zip \fP
++.fi
++.nf
++\f3/usr/java/jre/lib/jce\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
++.fi
++.nf
++\f3 javax\&.crypto (jce\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.io \fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.lang\&.reflect \fP
++.fi
++.nf
++\f3 \-> java\&.net \fP
++.fi
++.nf
++\f3 \-> java\&.nio \fP
++.fi
++.nf
++\f3 \-> java\&.security \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.cert \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.spec \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.concurrent \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.jar \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.regex \fP
++.fi
++.nf
++\f3 \-> java\&.util\&.zip \fP
++.fi
++.nf
++\f3 \-> javax\&.security\&.auth \fP
++.fi
++.nf
++\f3 \-> sun\&.security\&.jca JDK internal API (rt\&.jar)\fP
++.fi
++.nf
++\f3 \-> sun\&.security\&.util JDK internal API (rt\&.jar)\fP
++.fi
++.nf
++\f3 javax\&.crypto\&.spec (jce\&.jar)\fP
++.fi
++.nf
++\f3 \-> java\&.lang \fP
++.fi
++.nf
++\f3 \-> java\&.security\&.spec \fP
++.fi
++.nf
++\f3 \-> java\&.util \fP
++.fi
++.nf
++\f3/usr/java/jre/lib/rt\&.jar \-> /usr/java/jre/lib/jce\&.jar\fP
++.fi
++.nf
++\f3 java\&.security (rt\&.jar)\fP
++.fi
++.nf
++\f3 \-> javax\&.crypto\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Generate dot files of the dependencies of Notepad demo\&.
++.sp
++.nf
++\f3$ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\f3jdeps\fR will create one dot file for each given JAR file named <\fIfilename\fR>\&.dot in the dot directory specified in the \f3-dotoutput\fR option, and also a summary file named summary\&.dot that will list the dependencies among the JAR files
++.sp
++.nf
++\f3$ cat dot/Notepad\&.jar\&.dot \fP
++.fi
++.nf
++\f3digraph "Notepad\&.jar" {\fP
++.fi
++.nf
++\f3 // Path: demo/jfc/Notepad/Notepad\&.jar\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.awt";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.awt\&.event";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.beans";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.io";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.lang";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.net";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.util";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "java\&.util\&.logging";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.border";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.event";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.text";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.tree";\fP
++.fi
++.nf
++\f3 "<unnamed>" \-> "javax\&.swing\&.undo";\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3$ cat dot/summary\&.dot\fP
++.fi
++.nf
++\f3digraph "summary" {\fP
++.fi
++.nf
++\f3 "Notepad\&.jar" \-> "rt\&.jar";\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javap(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jhat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jhat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2006, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jhat.1
+-.\"
+-.if n .pl 99999
+-.TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jhat.1
++.\"
++.if n .pl 99999
++.TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,89 +47,89 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIheap-dump-file\fR
+-Java binary heap dump file to be browsed\&. For a dump file that contains multiple heap dumps, you can specify which dump in the file by appending \f3#<number>\fR to the file name, for example, \f3myfile\&.hprof#3\fR\&.
+-.SH DESCRIPTION
+-The \f3jhat\fR command parses a Java heap dump file and starts a web server\&. The \f3jhat\fR command lets you to browse heap dumps with your favorite web browser\&. The \f3jhat\fR command supports predesigned queries such as show all instances of a known class \f3MyClass\fR, and Object Query Language (OQL)\&. OQL is similar to SQL, except for querying heap dumps\&. Help on OQL is available from the OQL help page shown by the \f3jhat\fR command\&. With the default port, OQL help is available at http://localhost:7000/oqlhelp/
+-.PP
+-There are several ways to generate a Java heap dump:
+-.TP 0.2i
+-\(bu
+-Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
+-.TP 0.2i
+-\(bu
+-Use the \f3jconsole\fR option to obtain a heap dump through \f3HotSpotDiagnosticMXBean\fR at runtime\&. See jconsole(1) and the \f3HotSpotDiagnosticMXBean\fR interface description at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html
+-.TP 0.2i
+-\(bu
+-Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&.
+-.TP 0.2i
+-\(bu
+-Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
+-.SH OPTIONS
+-.TP
+--stack false|true
+-.br
+-Turns off tracking object allocation call stack\&. If allocation site information is not available in the heap dump, then you have to set this flag to \f3false\fR\&. The default is \f3true\fR\&.
+-.TP
+--refs false|true
+-.br
+-Turns off tracking of references to objects\&. Default is \f3true\fR\&. By default, back pointers, which are objects that point to a specified object such as referrers or incoming references, are calculated for all objects in the heap\&.
+-.TP
+--port \fIport-number\fR
+-.br
+-Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
+-.TP
+--exclude \fIexclude-file\fR
+-.br
+-Specifies a file that lists data members that should be excluded from the reachable objects query\&. For example, if the file lists \f3java\&.lang\&.String\&.value\fR, then, then whenever the list of objects that are reachable from a specific object \f3o\fR are calculated, reference paths that involve \f3java\&.lang\&.String\&.value\fR field are not considered\&.
+-.TP
+--baseline \fIexclude-file\fR
+-.br
+-Specifies a baseline heap dump\&. Objects in both heap dumps with the same object ID are marked as not being new\&. Other objects are marked as new\&. This is useful for comparing two different heap dumps\&.
+-.TP
+--debug \fIint\fR
+-.br
+-Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&.
+-.TP
+--version
+-.br
+-Reports the release number and exits
+-.TP
+--h
+-.br
+-Dsiplays a help message and exits\&.
+-.TP
+--help
+-.br
+-Displays a help message and exits\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the Java Virtual Machine on which the \f3jhat\fR command is running\&. For example, \f3-J-Xmx512m\fR to use a maximum heap size of 512 MB\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jmap(1)
+-.TP 0.2i
+-\(bu
+-jconsole(1)
+-.TP 0.2i
+-\(bu
+-HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
++
++.SH NAME
++jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIheap-dump-file\fR
++Java binary heap dump file to be browsed\&. For a dump file that contains multiple heap dumps, you can specify which dump in the file by appending \f3#<number>\fR to the file name, for example, \f3myfile\&.hprof#3\fR\&.
++.SH DESCRIPTION
++The \f3jhat\fR command parses a Java heap dump file and starts a web server\&. The \f3jhat\fR command lets you to browse heap dumps with your favorite web browser\&. The \f3jhat\fR command supports predesigned queries such as show all instances of a known class \f3MyClass\fR, and Object Query Language (OQL)\&. OQL is similar to SQL, except for querying heap dumps\&. Help on OQL is available from the OQL help page shown by the \f3jhat\fR command\&. With the default port, OQL help is available at http://localhost:7000/oqlhelp/
++.PP
++There are several ways to generate a Java heap dump:
++.TP 0.2i
++\(bu
++Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
++.TP 0.2i
++\(bu
++Use the \f3jconsole\fR option to obtain a heap dump through \f3HotSpotDiagnosticMXBean\fR at runtime\&. See jconsole(1) and the \f3HotSpotDiagnosticMXBean\fR interface description at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html
++.TP 0.2i
++\(bu
++Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&.
++.TP 0.2i
++\(bu
++Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
++.SH OPTIONS
++.TP
++-stack false|true
++.br
++Turns off tracking object allocation call stack\&. If allocation site information is not available in the heap dump, then you have to set this flag to \f3false\fR\&. The default is \f3true\fR\&.
++.TP
++-refs false|true
++.br
++Turns off tracking of references to objects\&. Default is \f3true\fR\&. By default, back pointers, which are objects that point to a specified object such as referrers or incoming references, are calculated for all objects in the heap\&.
++.TP
++-port \fIport-number\fR
++.br
++Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
++.TP
++-exclude \fIexclude-file\fR
++.br
++Specifies a file that lists data members that should be excluded from the reachable objects query\&. For example, if the file lists \f3java\&.lang\&.String\&.value\fR, then, then whenever the list of objects that are reachable from a specific object \f3o\fR are calculated, reference paths that involve \f3java\&.lang\&.String\&.value\fR field are not considered\&.
++.TP
++-baseline \fIexclude-file\fR
++.br
++Specifies a baseline heap dump\&. Objects in both heap dumps with the same object ID are marked as not being new\&. Other objects are marked as new\&. This is useful for comparing two different heap dumps\&.
++.TP
++-debug \fIint\fR
++.br
++Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&.
++.TP
++-version
++.br
++Reports the release number and exits
++.TP
++-h
++.br
++Dsiplays a help message and exits\&.
++.TP
++-help
++.br
++Displays a help message and exits\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the Java Virtual Machine on which the \f3jhat\fR command is running\&. For example, \f3-J-Xmx512m\fR to use a maximum heap size of 512 MB\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jmap(1)
++.TP 0.2i
++\(bu
++jconsole(1)
++.TP 0.2i
++\(bu
++HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jinfo.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jinfo.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jinfo.1
+-.\"
+-.if n .pl 99999
+-.TH jinfo 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jinfo.1
++.\"
++.if n .pl 99999
++.TH jinfo 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,85 +47,85 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jinfo \- Generates configuration information\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjinfo\fR [ \fIoption\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjinfo\fR [ \fIoption \fR] \fIexecutable core\fR
+-.fi
+-.nf
+-
+-\fBjinfo\fR [ \fIoption \fR] \fI[ servier\-id ] remote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoption\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the configuration information is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the configuration information is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jinfo\fR command prints Java configuration information for a specified Java process or core file or a remote debug server\&. The configuration information includes Java system properties and Java Virtual Machine (JVM) command-line flags\&. If the specified process is running on a 64-bit JVM, then you might need to specify the \f3-J-d64\fR option, for example: \f3jinfo\fR\f3-J-d64 -sysprops pid\fR\&.
+-.PP
+-This utility is unsupported and might not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of the jvm\&.dll that is used by the target process or the location from which the crash dump file was produced\&. For example, \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR \&.
+-.SH OPTIONS
+-.TP
+-no-option
+-Prints both command-line flags and system property name-value pairs\&.
+-.TP
+--flag \fIname\fR
+-.br
+-Prints the name and value of the specified command-line flag\&.
+-.TP
+--flag \fI[+|-]name\fR
+-.br
+-enables or disables the specified Boolean command-line flag\&.
+-.TP
+--flag \fIname=value\fR
+-.br
+-Sets the specified command-line flag to the specified value\&.
+-.TP
+--flags
+-.br
+-Prints command-line flags passed to the JVM\&.
+-.TP
+--sysprops
+-.br
+-Prints Java system properties as name-value pairs\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jinfo \- Generates configuration information\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjinfo\fR [ \fIoption\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjinfo\fR [ \fIoption \fR] \fIexecutable core\fR
++.fi
++.nf
++
++\fBjinfo\fR [ \fIoption \fR] \fI[ servier\-id ] remote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoption\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the configuration information is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the configuration information is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jinfo\fR command prints Java configuration information for a specified Java process or core file or a remote debug server\&. The configuration information includes Java system properties and Java Virtual Machine (JVM) command-line flags\&. If the specified process is running on a 64-bit JVM, then you might need to specify the \f3-J-d64\fR option, for example: \f3jinfo\fR\f3-J-d64 -sysprops pid\fR\&.
++.PP
++This utility is unsupported and might not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of the jvm\&.dll that is used by the target process or the location from which the crash dump file was produced\&. For example, \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR \&.
++.SH OPTIONS
++.TP
++no-option
++Prints both command-line flags and system property name-value pairs\&.
++.TP
++-flag \fIname\fR
++.br
++Prints the name and value of the specified command-line flag\&.
++.TP
++-flag \fI[+|-]name\fR
++.br
++enables or disables the specified Boolean command-line flag\&.
++.TP
++-flag \fIname=value\fR
++.br
++Sets the specified command-line flag to the specified value\&.
++.TP
++-flags
++.br
++Prints command-line flags passed to the JVM\&.
++.TP
++-sysprops
++.br
++Prints Java system properties as name-value pairs\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jjs.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jjs.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 1994, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/jmap.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jmap.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jmap.1
+-.\"
+-.if n .pl 99999
+-.TH jmap 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jmap.1
++.\"
++.if n .pl 99999
++.TH jmap 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,96 +47,96 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jmap \- Prints shared object memory maps or heap memory details for a process, core file, or remote debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
+-.fi
+-.nf
+-
+-\fBjmap\fR [ \fIoptions\fR ] [ \fIpid\fR ] \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the memory map is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the memory map is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jmap\fR command prints shared object memory maps or heap memory details of a specified process, core file, or remote debug server\&. If the specified process is running on a 64-bit Java Virtual Machine (JVM), then you might need to specify the \f3-J-d64\fR option, for example: \f3jmap\fR\f3-J-d64 -heap pid\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and might not be available in future releases of the JDK\&. On Windows Systems where the \f3dbgeng\&.dll\fR file is not present, Debugging Tools For Windows must be installed to make these tools work\&. The \f3PATH\fR environment variable should contain the location of the \f3jvm\&.dll\fR file that is used by the target process or the location from which the crash dump file was produced, for example: \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
+-.SH OPTIONS
+-.TP
+-<no option>
+-When no option is used, the \f3jmap\fR command prints shared object mappings\&. For each shared object loaded in the target JVM, the start address, size of the mapping, and the full path of the shared object file are printed\&. This behavior is similar to the Oracle Solaris \f3pmap\fR utility\&.
+-.TP
+--dump:[live,] format=b, file=\fIfilename\fR
+-.br
+-Dumps the Java heap in \f3hprof\fR binary format to \f3filename\fR\&. The \f3live\fR suboption is optional, but when specified, only the active objects in the heap are dumped\&. To browse the heap dump, you can use the jhat(1) command to read the generated file\&.
+-.TP
+--finalizerinfo
+-.br
+-Prints information about objects that are awaiting finalization\&.
+-.TP
+--heap
+-.br
+-Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage\&. In addition, the number and size of interned Strings are printed\&.
+-.TP
+--histo[:live]
+-.br
+-Prints a histogram of the heap\&. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed\&. The JVM internal class names are printed with an asterisk (*) prefix\&. If the \f3live\fR suboption is specified, then only active objects are counted\&.
+-.TP
+--clstats
+-.br
+-Prints class loader wise statistics of Java heap\&. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed\&.
+-.TP
+--F
+-.br
+-Force\&. Use this option with the \f3jmap -dump\fR or \f3jmap -histo\fR option when the pid does not respond\&. The \f3live\fR suboption is not supported in this mode\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR to the Java Virtual Machine where the \f3jmap\fR command is running\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jhat(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jmap \- Prints shared object memory maps or heap memory details for a process, core file, or remote debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
++.fi
++.nf
++
++\fBjmap\fR [ \fIoptions\fR ] [ \fIpid\fR ] \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the memory map is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the memory map is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jmap\fR command prints shared object memory maps or heap memory details of a specified process, core file, or remote debug server\&. If the specified process is running on a 64-bit Java Virtual Machine (JVM), then you might need to specify the \f3-J-d64\fR option, for example: \f3jmap\fR\f3-J-d64 -heap pid\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and might not be available in future releases of the JDK\&. On Windows Systems where the \f3dbgeng\&.dll\fR file is not present, Debugging Tools For Windows must be installed to make these tools work\&. The \f3PATH\fR environment variable should contain the location of the \f3jvm\&.dll\fR file that is used by the target process or the location from which the crash dump file was produced, for example: \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
++.SH OPTIONS
++.TP
++<no option>
++When no option is used, the \f3jmap\fR command prints shared object mappings\&. For each shared object loaded in the target JVM, the start address, size of the mapping, and the full path of the shared object file are printed\&. This behavior is similar to the Oracle Solaris \f3pmap\fR utility\&.
++.TP
++-dump:[live,] format=b, file=\fIfilename\fR
++.br
++Dumps the Java heap in \f3hprof\fR binary format to \f3filename\fR\&. The \f3live\fR suboption is optional, but when specified, only the active objects in the heap are dumped\&. To browse the heap dump, you can use the jhat(1) command to read the generated file\&.
++.TP
++-finalizerinfo
++.br
++Prints information about objects that are awaiting finalization\&.
++.TP
++-heap
++.br
++Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage\&. In addition, the number and size of interned Strings are printed\&.
++.TP
++-histo[:live]
++.br
++Prints a histogram of the heap\&. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed\&. The JVM internal class names are printed with an asterisk (*) prefix\&. If the \f3live\fR suboption is specified, then only active objects are counted\&.
++.TP
++-clstats
++.br
++Prints class loader wise statistics of Java heap\&. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed\&.
++.TP
++-F
++.br
++Force\&. Use this option with the \f3jmap -dump\fR or \f3jmap -histo\fR option when the pid does not respond\&. The \f3live\fR suboption is not supported in this mode\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR to the Java Virtual Machine where the \f3jmap\fR command is running\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jhat(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jps.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jps.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Monitoring Tools
+-.\" Title: jps.1
+-.\"
+-.if n .pl 99999
+-.TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Monitoring Tools
++.\" Title: jps.1
++.\"
++.if n .pl 99999
++.TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,157 +47,157 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.TP
+-\fIhostid\fR
+-The identifier of the host for which the process report should be generated\&. The \f3hostid\fR can include optional components that indicate the communications protocol, port number, and other implementation specific data\&. See Host Identifier\&.
+-.SH DESCRIPTION
+-The \f3jps\fR command lists the instrumented Java HotSpot VMs on the target system\&. The command is limited to reporting information on JVMs for which it has the access permissions\&.
+-.PP
+-If the \f3jps\fR command is run without specifying a \f3hostid\fR, then it searches for instrumented JVMs on the local host\&. If started with a \f3hostid\fR, then it searches for JVMs on the indicated host, using the specified protocol and port\&. A \f3jstatd\fR process is assumed to be running on the target host\&.
+-.PP
+-The \f3jps\fR command reports the local JVM identifier, or \f3lvmid\fR, for each instrumented JVM found on the target system\&. The \f3lvmid\fR is typically, but not necessarily, the operating system\&'s process identifier for the JVM process\&. With no options, \f3jps\fR lists each Java application\&'s \f3lvmid\fR followed by the short form of the application\&'s class name or jar file name\&. The short form of the class name or JAR file name omits the class\&'s package information or the JAR files path information\&.
+-.PP
+-The \f3jps\fR command uses the Java launcher to find the class name and arguments passed to the main method\&. If the target JVM is started with a custom launcher, then the class or JAR file name and the arguments to the \f3main\fR method are not available\&. In this case, the \f3jps\fR command outputs the string \f3Unknown\fR for the class name or JAR file name and for the arguments to the \f3main\fR method\&.
+-.PP
+-The list of JVMs produced by the \f3jps\fR command can be limited by the permissions granted to the principal running the command\&. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms\&.
+-.SH OPTIONS
+-The \f3jps\fR command supports a number of options that modify the output of the command\&. These options are subject to change or removal in the future\&.
+-.TP
+--q
+-.br
+-Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main\fR method, producing only a list of local JVM identifiers\&.
+-.TP
+--m
+-.br
+-Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
+-.TP
+--l
+-.br
+-Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
+-.TP
+--v
+-.br
+-Displays the arguments passed to the JVM\&.
+-.TP
+--V
+-.br
+-Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local JVM identifiers\&.
+-.TP
+--J\f3option\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH HOST\ IDENTIFIER
+-The host identifier, or \f3hostid\fR is a string that indicates the target system\&. The syntax of the \f3hostid\fR string corresponds to the syntax of a URI:
+-.sp
+-.nf
+-\f3[protocol:][[//]hostname][:port][/servername]\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.TP
+-\fIprotocol\fR
+-The communications protocol\&. If the \f3protocol\fR is omitted and a \f3hostname\fR is not specified, then the default protocol is a platform-specific, optimized, local protocol\&. If the protocol is omitted and a host name is specified, then the default protocol is \f3rmi\fR\&.
+-.TP
+-hostname
+-A hostname or IP address that indicates the target host\&. If you omit the \f3hostname\fR parameter, then the target host is the local host\&.
+-.TP
+-port
+-The default port for communicating with the remote server\&. If the \f3hostname\fR parameter is omitted or the \f3protocol\fR parameter specifies an optimized, local protocol, then the \f3port\fR parameter is ignored\&. Otherwise, treatment of the \f3port\fR parameter is implementation specific\&. For the default \f3rmi\fR protocol, the \f3port\fR parameter indicates the port number for the rmiregistry on the remote host\&. If the \f3port\fR parameter is omitted, and the \f3protocol\fR parameter indicates \f3rmi\fR, then the default rmiregistry port (1099) is used\&.
+-.TP
+-servername
+-The treatment of this parameter depends on the implementation\&. For the optimized, local protocol, this field is ignored\&. For the \f3rmi\fR protocol, this parameter is a string that represents the name of the RMI remote object on the remote host\&. See the \f3jstatd\fR command \f3-n\fRoption for more information\&.
+-.SH OUTPUT\ FORMAT
+-The output of the \f3jps\fR command follows the following pattern:
+-.sp
+-.nf
+-\f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-All output tokens are separated by white space\&. An \f3arg\fR value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters\&.
+-.PP
+-\fINote:\fR It is recommended that you do not write scripts to parse \f3jps\fR output because the format might change in future releases\&. If you write scripts that parse \f3jps\fR output, then expect to modify them for future releases of this tool\&.
+-.SH EXAMPLES
+-This section provides examples of the \f3jps\fR command\&.
+-.PP
+-List the instrumented JVMs on the local host:
+-.sp
+-.nf
+-\f3jps\fP
+-.fi
+-.nf
+-\f318027 Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f318032 jps\fP
+-.fi
+-.nf
+-\f318005 jstat\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example lists the instrumented JVMs on a remote host\&. This example assumes that the \f3jstat\fR server and either the its internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099)\&. It also assumes that the local host has appropriate permissions to access the remote host\&. This example also includes the \f3-l\fR option to output the long form of the class names or JAR file names\&.
+-.sp
+-.nf
+-\f3jps \-l remote\&.domain\fP
+-.fi
+-.nf
+-\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f32857 sun\&.tools\&.jstatd\&.jstatd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example lists the instrumented JVMs on a remote host with a non-default port for the RMI registry\&. This example assumes that the \f3jstatd\fR server, with an internal RMI registry bound to port 2002, is running on the remote host\&. This example also uses the \f3-m\fR option to include the arguments passed to the \f3main\fR method of each of the listed Java applications\&.
+-.sp
+-.nf
+-\f3jps \-m remote\&.domain:2002\fP
+-.fi
+-.nf
+-\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
+-.fi
+-.nf
+-\f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jstat(1)
+-.TP 0.2i
+-\(bu
+-jstatd(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.TP
++\fIhostid\fR
++The identifier of the host for which the process report should be generated\&. The \f3hostid\fR can include optional components that indicate the communications protocol, port number, and other implementation specific data\&. See Host Identifier\&.
++.SH DESCRIPTION
++The \f3jps\fR command lists the instrumented Java HotSpot VMs on the target system\&. The command is limited to reporting information on JVMs for which it has the access permissions\&.
++.PP
++If the \f3jps\fR command is run without specifying a \f3hostid\fR, then it searches for instrumented JVMs on the local host\&. If started with a \f3hostid\fR, then it searches for JVMs on the indicated host, using the specified protocol and port\&. A \f3jstatd\fR process is assumed to be running on the target host\&.
++.PP
++The \f3jps\fR command reports the local JVM identifier, or \f3lvmid\fR, for each instrumented JVM found on the target system\&. The \f3lvmid\fR is typically, but not necessarily, the operating system\&'s process identifier for the JVM process\&. With no options, \f3jps\fR lists each Java application\&'s \f3lvmid\fR followed by the short form of the application\&'s class name or jar file name\&. The short form of the class name or JAR file name omits the class\&'s package information or the JAR files path information\&.
++.PP
++The \f3jps\fR command uses the Java launcher to find the class name and arguments passed to the main method\&. If the target JVM is started with a custom launcher, then the class or JAR file name and the arguments to the \f3main\fR method are not available\&. In this case, the \f3jps\fR command outputs the string \f3Unknown\fR for the class name or JAR file name and for the arguments to the \f3main\fR method\&.
++.PP
++The list of JVMs produced by the \f3jps\fR command can be limited by the permissions granted to the principal running the command\&. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms\&.
++.SH OPTIONS
++The \f3jps\fR command supports a number of options that modify the output of the command\&. These options are subject to change or removal in the future\&.
++.TP
++-q
++.br
++Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main\fR method, producing only a list of local JVM identifiers\&.
++.TP
++-m
++.br
++Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
++.TP
++-l
++.br
++Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
++.TP
++-v
++.br
++Displays the arguments passed to the JVM\&.
++.TP
++-V
++.br
++Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local JVM identifiers\&.
++.TP
++-J\f3option\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH HOST\ IDENTIFIER
++The host identifier, or \f3hostid\fR is a string that indicates the target system\&. The syntax of the \f3hostid\fR string corresponds to the syntax of a URI:
++.sp
++.nf
++\f3[protocol:][[//]hostname][:port][/servername]\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.TP
++\fIprotocol\fR
++The communications protocol\&. If the \f3protocol\fR is omitted and a \f3hostname\fR is not specified, then the default protocol is a platform-specific, optimized, local protocol\&. If the protocol is omitted and a host name is specified, then the default protocol is \f3rmi\fR\&.
++.TP
++hostname
++A hostname or IP address that indicates the target host\&. If you omit the \f3hostname\fR parameter, then the target host is the local host\&.
++.TP
++port
++The default port for communicating with the remote server\&. If the \f3hostname\fR parameter is omitted or the \f3protocol\fR parameter specifies an optimized, local protocol, then the \f3port\fR parameter is ignored\&. Otherwise, treatment of the \f3port\fR parameter is implementation specific\&. For the default \f3rmi\fR protocol, the \f3port\fR parameter indicates the port number for the rmiregistry on the remote host\&. If the \f3port\fR parameter is omitted, and the \f3protocol\fR parameter indicates \f3rmi\fR, then the default rmiregistry port (1099) is used\&.
++.TP
++servername
++The treatment of this parameter depends on the implementation\&. For the optimized, local protocol, this field is ignored\&. For the \f3rmi\fR protocol, this parameter is a string that represents the name of the RMI remote object on the remote host\&. See the \f3jstatd\fR command \f3-n\fRoption for more information\&.
++.SH OUTPUT\ FORMAT
++The output of the \f3jps\fR command follows the following pattern:
++.sp
++.nf
++\f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++All output tokens are separated by white space\&. An \f3arg\fR value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters\&.
++.PP
++\fINote:\fR It is recommended that you do not write scripts to parse \f3jps\fR output because the format might change in future releases\&. If you write scripts that parse \f3jps\fR output, then expect to modify them for future releases of this tool\&.
++.SH EXAMPLES
++This section provides examples of the \f3jps\fR command\&.
++.PP
++List the instrumented JVMs on the local host:
++.sp
++.nf
++\f3jps\fP
++.fi
++.nf
++\f318027 Java2Demo\&.JAR\fP
++.fi
++.nf
++\f318032 jps\fP
++.fi
++.nf
++\f318005 jstat\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example lists the instrumented JVMs on a remote host\&. This example assumes that the \f3jstat\fR server and either the its internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099)\&. It also assumes that the local host has appropriate permissions to access the remote host\&. This example also includes the \f3-l\fR option to output the long form of the class names or JAR file names\&.
++.sp
++.nf
++\f3jps \-l remote\&.domain\fP
++.fi
++.nf
++\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
++.fi
++.nf
++\f32857 sun\&.tools\&.jstatd\&.jstatd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example lists the instrumented JVMs on a remote host with a non-default port for the RMI registry\&. This example assumes that the \f3jstatd\fR server, with an internal RMI registry bound to port 2002, is running on the remote host\&. This example also uses the \f3-m\fR option to include the arguments passed to the \f3main\fR method of each of the listed Java applications\&.
++.sp
++.nf
++\f3jps \-m remote\&.domain:2002\fP
++.fi
++.nf
++\f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
++.fi
++.nf
++\f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jstat(1)
++.TP 0.2i
++\(bu
++jstatd(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jrunscript.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jrunscript.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2006, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Scripting Tools
+-.\" Title: jrunscript.1
+-.\"
+-.if n .pl 99999
+-.TH jrunscript 1 "21 November 2013" "JDK 8" "Scripting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Scripting Tools
++.\" Title: jrunscript.1
++.\"
++.if n .pl 99999
++.TH jrunscript 1 "21 November 2013" "JDK 8" "Scripting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,148 +47,148 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jrunscript \- Runs a command-line script shell that supports interactive and batch modes\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjrunscript\fR [\fIoptions\fR] [\fIarguments\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIarguments\fR
+-Arguments, when used, follow immediately after options or the command name\&. See Arguments\&.
+-.SH DESCRIPTION
+-The \f3jrunscript\fR command is a language-independent command-line script shell\&. The \f3jrunscript\fR command supports both an interactive (read-eval-print) mode and a batch (\f3-f\fR option) mode of script execution\&. By default, JavaScript is the language used, but the \f3-l\fR option can be used to specify a different language\&. By using Java to scripting language communication, the \f3jrunscript\fR command supports an exploratory programming style\&.
+-.SH OPTIONS
+-.TP
+--classpath \fIpath\fR
+-.br
+-Indicate where any class files are that the script needs to access\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-Same as \f3-classpath\fR\f3path\fR\&.
+-.TP
+--D\fIname\fR=\fIvalue\fR
+-.br
+-Sets a Java system property\&.
+-.TP
+--J\fIflag\fR
+-.br
+-Passes \f3flag\fR directly to the Java Virtual Machine where the \f3jrunscript\fR command is running\&.
+-.TP
+--I \fIlanguage\fR
+-.br
+-Uses the specified scripting language\&. By default, JavaScript is used\&. To use other scripting languages, you must specify the corresponding script engine\&'s JAR file with the \f3-cp\fR or \f3-classpath\fR option\&.
+-.TP
+--e \fIscript\fR
+-.br
+-Evaluates the specified script\&. This option can be used to run one-line scripts that are specified completely on the command line\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Specifies the character encoding used to read script files\&.
+-.TP
+--f \fIscript-file\fR
+-.br
+-Evaluates the specified script file (batch mode)\&.
+-.TP
+--f -
+-.br
+-Reads and evaluates a script from standard input (interactive mode)\&.
+-.TP
+--help
+-.br
+-Displays a help message and exits\&.
+-.TP
+--?
+-.br
+-Displays a help message and exits\&.
+-.TP
+--q
+-.br
+-Lists all script engines available and exits\&.
+-.SH ARGUMENTS
+-If arguments are present and if no \f3-e\fR or \f3-f\fR option is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script\&. If arguments and \f3-e\fR or the \f3-f\fR option are used, then all arguments are passed to the script\&. If arguments, \f3-e\fR and \f3-f\fR are missing, then interactive mode is used\&. Script arguments are available to a script in an engine variable named \f3arguments\fR of type \f3String\fR array\&.
+-.SH EXAMPLES
+-.SS EXECUTE\ INLINE\ SCRIPTS
+-.sp
+-.nf
+-\f3jrunscript \-e "print(\&'hello world\&')"\fP
+-.fi
+-.nf
+-\f3jrunscript \-e "cat(\&'http://www\&.example\&.com\&')"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS USE\ SPECIFIED\ LANGUAGE\ AND\ EVALUATE\ THE\ SCRIPT\ FILE
+-.sp
+-.nf
+-\f3jrunscript \-l js \-f test\&.js\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS INTERACTIVE\ MODE
+-.sp
+-.nf
+-\f3jrunscript\fP
+-.fi
+-.nf
+-\f3js> print(\&'Hello World\en\&');\fP
+-.fi
+-.nf
+-\f3Hello World\fP
+-.fi
+-.nf
+-\f3js> 34 + 55\fP
+-.fi
+-.nf
+-\f389\&.0\fP
+-.fi
+-.nf
+-\f3js> t = new java\&.lang\&.Thread(function() { print(\&'Hello World\en\&'); })\fP
+-.fi
+-.nf
+-\f3Thread[Thread\-0,5,main]\fP
+-.fi
+-.nf
+-\f3js> t\&.start()\fP
+-.fi
+-.nf
+-\f3js> Hello World\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3js>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS RUN\ SCRIPT\ FILE\ WITH\ SCRIPT\ ARGUMENTS
+-The test\&.js file is the script file\&. The \f3arg1\fR, \f3arg2\fR and \f3arg3\fR arguments are passed to the script\&. The script can access these arguments with an arguments array\&.
+-.sp
+-.nf
+-\f3jrunscript test\&.js arg1 arg2 arg3\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-If JavaScript is used, then before it evaluates a user defined script, the \f3jrunscript\fR command initializes certain built-in functions and objects\&. These JavaScript built-ins are documented in JsDoc-Toolkit at http://code\&.google\&.com/p/jsdoc-toolkit/
++
++.SH NAME
++jrunscript \- Runs a command-line script shell that supports interactive and batch modes\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjrunscript\fR [\fIoptions\fR] [\fIarguments\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIarguments\fR
++Arguments, when used, follow immediately after options or the command name\&. See Arguments\&.
++.SH DESCRIPTION
++The \f3jrunscript\fR command is a language-independent command-line script shell\&. The \f3jrunscript\fR command supports both an interactive (read-eval-print) mode and a batch (\f3-f\fR option) mode of script execution\&. By default, JavaScript is the language used, but the \f3-l\fR option can be used to specify a different language\&. By using Java to scripting language communication, the \f3jrunscript\fR command supports an exploratory programming style\&.
++.SH OPTIONS
++.TP
++-classpath \fIpath\fR
++.br
++Indicate where any class files are that the script needs to access\&.
++.TP
++-cp \fIpath\fR
++.br
++Same as \f3-classpath\fR\f3path\fR\&.
++.TP
++-D\fIname\fR=\fIvalue\fR
++.br
++Sets a Java system property\&.
++.TP
++-J\fIflag\fR
++.br
++Passes \f3flag\fR directly to the Java Virtual Machine where the \f3jrunscript\fR command is running\&.
++.TP
++-I \fIlanguage\fR
++.br
++Uses the specified scripting language\&. By default, JavaScript is used\&. To use other scripting languages, you must specify the corresponding script engine\&'s JAR file with the \f3-cp\fR or \f3-classpath\fR option\&.
++.TP
++-e \fIscript\fR
++.br
++Evaluates the specified script\&. This option can be used to run one-line scripts that are specified completely on the command line\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Specifies the character encoding used to read script files\&.
++.TP
++-f \fIscript-file\fR
++.br
++Evaluates the specified script file (batch mode)\&.
++.TP
++-f -
++.br
++Reads and evaluates a script from standard input (interactive mode)\&.
++.TP
++-help
++.br
++Displays a help message and exits\&.
++.TP
++-?
++.br
++Displays a help message and exits\&.
++.TP
++-q
++.br
++Lists all script engines available and exits\&.
++.SH ARGUMENTS
++If arguments are present and if no \f3-e\fR or \f3-f\fR option is used, then the first argument is the script file and the rest of the arguments, if any, are passed to the script\&. If arguments and \f3-e\fR or the \f3-f\fR option are used, then all arguments are passed to the script\&. If arguments, \f3-e\fR and \f3-f\fR are missing, then interactive mode is used\&. Script arguments are available to a script in an engine variable named \f3arguments\fR of type \f3String\fR array\&.
++.SH EXAMPLES
++.SS EXECUTE\ INLINE\ SCRIPTS
++.sp
++.nf
++\f3jrunscript \-e "print(\&'hello world\&')"\fP
++.fi
++.nf
++\f3jrunscript \-e "cat(\&'http://www\&.example\&.com\&')"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS USE\ SPECIFIED\ LANGUAGE\ AND\ EVALUATE\ THE\ SCRIPT\ FILE
++.sp
++.nf
++\f3jrunscript \-l js \-f test\&.js\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS INTERACTIVE\ MODE
++.sp
++.nf
++\f3jrunscript\fP
++.fi
++.nf
++\f3js> print(\&'Hello World\en\&');\fP
++.fi
++.nf
++\f3Hello World\fP
++.fi
++.nf
++\f3js> 34 + 55\fP
++.fi
++.nf
++\f389\&.0\fP
++.fi
++.nf
++\f3js> t = new java\&.lang\&.Thread(function() { print(\&'Hello World\en\&'); })\fP
++.fi
++.nf
++\f3Thread[Thread\-0,5,main]\fP
++.fi
++.nf
++\f3js> t\&.start()\fP
++.fi
++.nf
++\f3js> Hello World\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3js>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS RUN\ SCRIPT\ FILE\ WITH\ SCRIPT\ ARGUMENTS
++The test\&.js file is the script file\&. The \f3arg1\fR, \f3arg2\fR and \f3arg3\fR arguments are passed to the script\&. The script can access these arguments with an arguments array\&.
++.sp
++.nf
++\f3jrunscript test\&.js arg1 arg2 arg3\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++If JavaScript is used, then before it evaluates a user defined script, the \f3jrunscript\fR command initializes certain built-in functions and objects\&. These JavaScript built-ins are documented in JsDoc-Toolkit at http://code\&.google\&.com/p/jsdoc-toolkit/
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jsadebugd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jsadebugd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jsadebugd.1
+-.\"
+-.if n .pl 99999
+-.TH jsadebugd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jsadebugd.1
++.\"
++.if n .pl 99999
++.TH jsadebugd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,61 +47,61 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jsadebugd \- Attaches to a Java process or core file and acts as a debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjsadebugd\fR \fIpid\fR [ \fIserver\-id\fR ]
+-.fi
+-.nf
+-
+-\fBjsadebugd\fR \fIexecutable\fR \fIcore\fR [ \fIserver\-id\fR ]
+-.fi
+-.sp
+-.TP
+-\fIpid\fR
+-The process ID of the process to which the debug server attaches\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&. At most one instance of the debug server can be attached to a single process\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file to which the debug server should attach\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID that is needed when multiple debug servers are started on the same machine\&. This ID must be used by remote clients to identify the particular debug server to which to attach\&. Within a single machine, this ID must be unique\&.
+-.SH DESCRIPTION
+-The \f3jsadebugd\fR command attaches to a Java process or core file and acts as a debug server\&. Remote clients such as \f3jstack\fR, \f3jmap\fR, and \f3jinfo\fR can attach to the server through Java Remote Method Invocation (RMI)\&. Before you start the \f3jsadebugd\fR command, start the RMI registry with the \f3rmiregistry\fR command as follows where \fI$JAVA_HOME\fR is the JDK installation directory:
+-.sp
+-.nf
+-\f3rmiregistry \-J\-Xbootclasspath/p:$JAVA_HOME/lib/sajdi\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If the RMI registry was not started, then the \f3jsadebugd\fR command starts an RMI registry in a standard (1099) port internally\&. The debug server can be stopped by sending a \f3SIGINT\fR to it\&. To send a SIGINT press \fICtrl+C\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and may or may not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of jvm\&.dll used by the target process or the location from which the crash dump file was produced\&. For example, \f3s\fR\f3et PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jinfo(1)
+-.TP 0.2i
+-\(bu
+-jmap(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jstack(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jsadebugd \- Attaches to a Java process or core file and acts as a debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjsadebugd\fR \fIpid\fR [ \fIserver\-id\fR ]
++.fi
++.nf
++
++\fBjsadebugd\fR \fIexecutable\fR \fIcore\fR [ \fIserver\-id\fR ]
++.fi
++.sp
++.TP
++\fIpid\fR
++The process ID of the process to which the debug server attaches\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&. At most one instance of the debug server can be attached to a single process\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file to which the debug server should attach\&.
++.TP
++\fIserver-id\fR
++An optional unique ID that is needed when multiple debug servers are started on the same machine\&. This ID must be used by remote clients to identify the particular debug server to which to attach\&. Within a single machine, this ID must be unique\&.
++.SH DESCRIPTION
++The \f3jsadebugd\fR command attaches to a Java process or core file and acts as a debug server\&. Remote clients such as \f3jstack\fR, \f3jmap\fR, and \f3jinfo\fR can attach to the server through Java Remote Method Invocation (RMI)\&. Before you start the \f3jsadebugd\fR command, start the RMI registry with the \f3rmiregistry\fR command as follows where \fI$JAVA_HOME\fR is the JDK installation directory:
++.sp
++.nf
++\f3rmiregistry \-J\-Xbootclasspath/p:$JAVA_HOME/lib/sajdi\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If the RMI registry was not started, then the \f3jsadebugd\fR command starts an RMI registry in a standard (1099) port internally\&. The debug server can be stopped by sending a \f3SIGINT\fR to it\&. To send a SIGINT press \fICtrl+C\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and may or may not be available in future releases of the JDK\&. In Windows Systems where \f3dbgeng\&.dll\fR is not present, Debugging Tools For Windows must be installed to have these tools working\&. The \f3PATH\fR environment variable should contain the location of jvm\&.dll used by the target process or the location from which the crash dump file was produced\&. For example, \f3s\fR\f3et PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jinfo(1)
++.TP 0.2i
++\(bu
++jmap(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jstack(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jstack.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jstack.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Troubleshooting Tools
+-.\" Title: jstack.1
+-.\"
+-.if n .pl 99999
+-.TH jstack 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Troubleshooting Tools
++.\" Title: jstack.1
++.\"
++.if n .pl 99999
++.TH jstack 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jstack \- Prints Java thread stack traces for a Java process, core file, or remote debug server\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] \fIpid\fR
+-.fi
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
+-.fi
+-.nf
+-
+-\fBjstack\fR [ \fIoptions\fR ] [ \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIpid\fR
+-The process ID for which the stack trace is printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
+-.TP
+-\fIexecutable\fR
+-The Java executable from which the core dump was produced\&.
+-.TP
+-\fIcore\fR
+-The core file for which the stack trace is to be printed\&.
+-.TP
+-\fIremote-hostname-or-IP\fR
+-The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
+-.TP
+-\fIserver-id\fR
+-An optional unique ID to use when multiple debug servers are running on the same remote host\&.
+-.SH DESCRIPTION
+-The \f3jstack\fR command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server\&. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed\&. With the \f3-m\fR option, the \f3jstack\fR command prints both Java and native frames of all threads with the program counter (PC)\&. For each native frame, the closest native symbol to PC, when available, is printed\&. C++ mangled names are not demangled\&. To demangle C++ names, the output of this command can be piped to \f3c++filt\fR\&. When the specified process is running on a 64-bit Java Virtual Machine, you might need to specify the \f3-J-d64\fR option, for example: \f3jstack -J-d64 -m pid\fR\&.
+-.PP
+-\fINote:\fR This utility is unsupported and might not be available in future release of the JDK\&. In Windows Systems where the dbgeng\&.dll file is not present, Debugging Tools For Windows must be installed so these tools work\&. The \f3PATH\fR environment variable needs to contain the location of the jvm\&.dll that is used by the target process, or the location from which the crash dump file was produced\&. For example:
+-.sp
+-.nf
+-\f3set PATH=<jdk>\ejre\ebin\eclient;%PATH%\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--F
+-.br
+-Force a stack dump when \f3jstack\fR [\f3-l\fR] \f3pid\fR does not respond\&.
+-.TP
+--l
+-.br
+-Long listing\&. Prints additional information about locks such as a list of owned \f3java\&.util\&.concurrent\fR ownable synchronizers\&. See the \f3AbstractOwnableSynchronizer\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.html
+-.TP
+--m
+-.br
+-Prints a mixed mode stack trace that has both Java and native C/C++ frames\&.
+-.TP
+--h
+-.br
+-Prints a help message\&.
+-.TP
+--help
+-.br
+-Prints a help message\&.
+-.SH KNOWN\ BUGS
+-In mixed mode stack trace, the \f3-m\fR option does not work with the remote debug server\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pstack(1)
+-.TP 0.2i
+-\(bu
+-C++filt(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jsadebugd(1)
++
++.SH NAME
++jstack \- Prints Java thread stack traces for a Java process, core file, or remote debug server\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] \fIpid\fR
++.fi
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
++.fi
++.nf
++
++\fBjstack\fR [ \fIoptions\fR ] [ \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIpid\fR
++The process ID for which the stack trace is printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
++.TP
++\fIexecutable\fR
++The Java executable from which the core dump was produced\&.
++.TP
++\fIcore\fR
++The core file for which the stack trace is to be printed\&.
++.TP
++\fIremote-hostname-or-IP\fR
++The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
++.TP
++\fIserver-id\fR
++An optional unique ID to use when multiple debug servers are running on the same remote host\&.
++.SH DESCRIPTION
++The \f3jstack\fR command prints Java stack traces of Java threads for a specified Java process, core file, or remote debug server\&. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed\&. With the \f3-m\fR option, the \f3jstack\fR command prints both Java and native frames of all threads with the program counter (PC)\&. For each native frame, the closest native symbol to PC, when available, is printed\&. C++ mangled names are not demangled\&. To demangle C++ names, the output of this command can be piped to \f3c++filt\fR\&. When the specified process is running on a 64-bit Java Virtual Machine, you might need to specify the \f3-J-d64\fR option, for example: \f3jstack -J-d64 -m pid\fR\&.
++.PP
++\fINote:\fR This utility is unsupported and might not be available in future release of the JDK\&. In Windows Systems where the dbgeng\&.dll file is not present, Debugging Tools For Windows must be installed so these tools work\&. The \f3PATH\fR environment variable needs to contain the location of the jvm\&.dll that is used by the target process, or the location from which the crash dump file was produced\&. For example:
++.sp
++.nf
++\f3set PATH=<jdk>\ejre\ebin\eclient;%PATH%\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-F
++.br
++Force a stack dump when \f3jstack\fR [\f3-l\fR] \f3pid\fR does not respond\&.
++.TP
++-l
++.br
++Long listing\&. Prints additional information about locks such as a list of owned \f3java\&.util\&.concurrent\fR ownable synchronizers\&. See the \f3AbstractOwnableSynchronizer\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.html
++.TP
++-m
++.br
++Prints a mixed mode stack trace that has both Java and native C/C++ frames\&.
++.TP
++-h
++.br
++Prints a help message\&.
++.TP
++-help
++.br
++Prints a help message\&.
++.SH KNOWN\ BUGS
++In mixed mode stack trace, the \f3-m\fR option does not work with the remote debug server\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pstack(1)
++.TP 0.2i
++\(bu
++C++filt(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jsadebugd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/jstat.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jstat.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+ '\" t
+ .\" Copyright (c) 2004, 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
+--- ./jdk/src/solaris/doc/sun/man/man1/jstatd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/jstatd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Monitoring Tools
+-.\" Title: jstatd.1
+-.\"
+-.if n .pl 99999
+-.TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Monitoring Tools
++.\" Title: jstatd.1
++.\"
++.if n .pl 99999
++.TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,162 +47,162 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBjstatd\fR [ \fIoptions\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&.
+-.PP
+-The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&.
+-.SH OPTIONS
+-.TP
+--nr
+-.br
+-Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&.
+-.TP
+--p \fIport\fR
+-.br
+-The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&.
+-.TP
+--n \fIrminame\fR
+-.br
+-Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH SECURITY
+-The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&.
+-.PP
+-The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&.
+-.PP
+-The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.PP
+-The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&.
+-.sp
+-.nf
+-\f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { \fP
+-.fi
+-.nf
+-\f3 permission java\&.security\&.AllPermission;\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows:
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&.
+-.SH REMOTE\ INTERFACE
+-The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&.
+-.SH EXAMPLES
+-The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background
+-.SS INTERNAL\ RMI\ REGISTRY
+-This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS EXTERNAL\ RMI\ REGISTRY
+-This example starts a \f3jstatd\fR session with a external RMI registry\&.
+-.sp
+-.nf
+-\f3rmiregistry&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&.
+-.sp
+-.nf
+-\f3jrmiregistry 2020&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&.
+-.sp
+-.nf
+-\f3rmiregistry 2020&\fP
+-.fi
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
+-.fi
+-.nf
+-\f3 \-n AlternateJstatdServerName\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY
+-This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS ENABLE\ RMI\ LOGGING
+-This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&.
+-.sp
+-.nf
+-\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
+-.fi
+-.nf
+-\f3 \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-jps(1)
+-.TP 0.2i
+-\(bu
+-jstat(1)
+-.TP 0.2i
+-\(bu
+-rmiregistry(1)
++
++.SH NAME
++jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBjstatd\fR [ \fIoptions\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&.
++.PP
++The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&.
++.SH OPTIONS
++.TP
++-nr
++.br
++Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&.
++.TP
++-p \fIport\fR
++.br
++The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&.
++.TP
++-n \fIrminame\fR
++.br
++Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH SECURITY
++The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&.
++.PP
++The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&.
++.PP
++The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.PP
++The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&.
++.sp
++.nf
++\f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { \fP
++.fi
++.nf
++\f3 permission java\&.security\&.AllPermission;\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows:
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&.
++.SH REMOTE\ INTERFACE
++The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&.
++.SH EXAMPLES
++The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background
++.SS INTERNAL\ RMI\ REGISTRY
++This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS EXTERNAL\ RMI\ REGISTRY
++This example starts a \f3jstatd\fR session with a external RMI registry\&.
++.sp
++.nf
++\f3rmiregistry&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&.
++.sp
++.nf
++\f3jrmiregistry 2020&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&.
++.sp
++.nf
++\f3rmiregistry 2020&\fP
++.fi
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
++.fi
++.nf
++\f3 \-n AlternateJstatdServerName\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY
++This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS ENABLE\ RMI\ LOGGING
++This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&.
++.sp
++.nf
++\f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
++.fi
++.nf
++\f3 \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++jps(1)
++.TP 0.2i
++\(bu
++jstat(1)
++.TP 0.2i
++\(bu
++rmiregistry(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/keytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/keytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Security Tools
+-.\" Title: keytool.1
+-.\"
+-.if n .pl 99999
+-.TH keytool 1 "03 March 2015" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Security Tools
++.\" Title: keytool.1
++.\"
++.if n .pl 99999
++.TH keytool 1 "03 March 2015" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,1572 +47,1572 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-keytool \- Manages a keystore (database) of cryptographic keys, X\&.509 certificate chains, and trusted certificates\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBkeytool\fR [\fIcommands\fR]
+-.fi
+-.sp
+-.TP
+-\fIcommands\fR
+-See Commands\&. These commands are categorized by task as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-Create or Add Data to the Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--gencert
+-.TP 0.2i
+-\(bu
+--genkeypair
+-.TP 0.2i
+-\(bu
+--genseckey
+-.TP 0.2i
+-\(bu
+--importcert
+-.TP 0.2i
+-\(bu
+--importpassword
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Import Contents From Another Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--importkeystore
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Generate Certificate Request
+-.RS
+-.TP 0.2i
+-\(bu
+--certreq
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Export Data
+-.RS
+-.TP 0.2i
+-\(bu
+--exportcert
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Display Data
+-.RS
+-.TP 0.2i
+-\(bu
+--list
+-.TP 0.2i
+-\(bu
+--printcert
+-.TP 0.2i
+-\(bu
+--printcertreq
+-.TP 0.2i
+-\(bu
+--printcrl
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Manage the Keystore
+-.RS
+-.TP 0.2i
+-\(bu
+--storepasswd
+-.TP 0.2i
+-\(bu
+--keypasswd
+-.TP 0.2i
+-\(bu
+--delete
+-.TP 0.2i
+-\(bu
+--changealias
+-.RE
+-
+-.TP 0.2i
+-\(bu
+-Get Help
+-.RS
+-.TP 0.2i
+-\(bu
+--help
+-.RE
+-
+-.RE
+-
+-.SH DESCRIPTION
+-The \f3keytool\fR command is a key and certificate management utility\&. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself or herself to other users and services) or data integrity and authentication services, using digital signatures\&. The \f3keytool\fR command also enables users to cache the public keys (in the form of certificates) of their communicating peers\&.
+-.PP
+-A certificate is a digitally signed statement from one entity (person, company, and so on\&.), that says that the public key (and some other information) of some other entity has a particular value\&. (See Certificate\&.) When data is digitally signed, the signature can be verified to check the data integrity and authenticity\&. Integrity means that the data has not been modified or tampered with, and authenticity means the data comes from whoever claims to have created and signed it\&.
+-.PP
+-The \f3keytool\fR command also enables users to administer secret keys and passphrases used in symmetric encryption and decryption (DES)\&.
+-.PP
+-The \f3keytool\fR command stores the keys and certificates in a keystore\&. See KeyStore aliases\&.
+-.SH COMMAND\ AND\ OPTION\ NOTES
+-See Commands for a listing and description of the various commands\&.
+-.TP 0.2i
+-\(bu
+-All command and option names are preceded by a minus sign (-)\&.
+-.TP 0.2i
+-\(bu
+-The options for each command can be provided in any order\&.
+-.TP 0.2i
+-\(bu
+-All items not italicized or in braces or brackets are required to appear as is\&.
+-.TP 0.2i
+-\(bu
+-Braces surrounding an option signify that a default value will be used when the option is not specified on the command line\&. See Option Defaults\&. Braces are also used around the \f3-v\fR, \f3-rfc\fR, and \f3-J\fR options, which only have meaning when they appear on the command line\&. They do not have any default values other than not existing\&.
+-.TP 0.2i
+-\(bu
+-Brackets surrounding an option signify that the user is prompted for the values when the option is not specified on the command line\&. For the \f3-keypass\fR option, if you do not specify the option on the command line, then the \f3keytool\fR command first attempts to use the keystore password to recover the private/secret key\&. If this attempt fails, then the \f3keytool\fR command prompts you for the private/secret key password\&.
+-.TP 0.2i
+-\(bu
+-Items in italics (option values) represent the actual values that must be supplied\&. For example, here is the format of the \f3-printcert\fR command:
+-.sp
+-.nf
+-\f3keytool \-printcert {\-file \fIcert_file\fR} {\-v}\fP
+-.fi
+-.sp
+-
+-
+-
+-
+-When you specify a \f3-printcert\fR command, replace \fIcert_file\fR with the actual file name, as follows: \f3keytool -printcert -file VScert\&.cer\fR
+-.TP 0.2i
+-\(bu
+-Option values must be put in quotation marks when they contain a blank (space)\&.
+-.TP 0.2i
+-\(bu
+-The \f3-help\fR option is the default\&. The \f3keytool\fR command is the same as \f3keytool -help\fR\&.
+-.SH OPTION\ DEFAULTS
+-The following examples show the defaults for various option values\&.
+-.sp
+-.nf
+-\f3\-alias "mykey"\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keyalg\fP
+-.fi
+-.nf
+-\f3 "DSA" (when using \-genkeypair)\fP
+-.fi
+-.nf
+-\f3 "DES" (when using \-genseckey)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keysize\fP
+-.fi
+-.nf
+-\f3 2048 (when using \-genkeypair and \-keyalg is "RSA")\fP
+-.fi
+-.nf
+-\f3 1024 (when using \-genkeypair and \-keyalg is "DSA")\fP
+-.fi
+-.nf
+-\f3 256 (when using \-genkeypair and \-keyalg is "EC")\fP
+-.fi
+-.nf
+-\f3 56 (when using \-genseckey and \-keyalg is "DES")\fP
+-.fi
+-.nf
+-\f3 168 (when using \-genseckey and \-keyalg is "DESede")\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-validity 90\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-keystore <the file named \&.keystore in the user\&'s home directory>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-storetype <the value of the "keystore\&.type" property in the\fP
+-.fi
+-.nf
+-\f3 security properties file, which is returned by the static\fP
+-.fi
+-.nf
+-\f3 getDefaultType method in java\&.security\&.KeyStore>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-file\fP
+-.fi
+-.nf
+-\f3 stdin (if reading)\fP
+-.fi
+-.nf
+-\f3 stdout (if writing)\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-protected false\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In generating a public/private key pair, the signature algorithm (\f3-sigalg\fR option) is derived from the algorithm of the underlying private key:
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type DSA, then the \f3-sigalg\fR option defaults to SHA1withDSA\&.
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type RSA, then the \f3-sigalg\fR option defaults to SHA256withRSA\&.
+-.TP 0.2i
+-\(bu
+-If the underlying private key is of type EC, then the \f3-sigalg\fR option defaults to SHA256withECDSA\&.
+-.PP
+-For a full list of \f3-keyalg\fR and \f3-sigalg\fR arguments, see Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
+-.SH COMMON\ OPTIONS
+-The \f3-v\fR option can appear for all commands except \f3-help\fR\&. When the \f3-v\fR option appears, it signifies verbose mode, which means that more information is provided in the output\&.
+-.PP
+-There is also a \f3-Jjavaoption\fR argument that can appear for any command\&. When the \f3-Jjavaoption\fR appears, the specified \f3javaoption\fR string is passed directly to the Java interpreter\&. This option does not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
+-.PP
+-These options can appear for all commands operating on a keystore:
+-.TP
+--storetype \fIstoretype\fR
+-.br
+-This qualifier specifies the type of keystore to be instantiated\&.
+-.TP
+--keystore \fIkeystore\fR
+-.br
+-The keystore location\&.
+-
+-If the JKS \f3storetype\fR is used and a keystore file does not yet exist, then certain \f3keytool\fR commands can result in a new keystore file being created\&. For example, if \f3keytool -genkeypair\fR is called and the \f3-keystore\fR option is not specified, the default keystore file named \f3\&.keystore\fR in the user\&'s home directory is created when it does not already exist\&. Similarly, if the \f3-keystore ks_file\fR option is specified but ks_file does not exist, then it is created\&. For more information on the JKS \f3storetype\fR, see the \fIKeyStore Implementation\fR section in KeyStore aliases\&.
+-
+-Note that the input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified if the keystore is not file-based\&. For example, when it resides on a hardware token device\&.
+-.TP
+--storepass[:\fIenv\fR| :\fIfile\fR] argument
+-.br
+-The password that is used to protect the integrity of the keystore\&.
+-
+-If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the \f3value\fR argument, which must be at least 6 characters long\&. Otherwise, the password is retrieved as follows:
+-.RS
+-.TP 0.2i
+-\(bu
+-\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3file\fR: Retrieve the password from the file named argument\&.
+-.RE
+-
+-
+-\fINote:\fR All other options that require passwords, such as \f3-keypass\fR, \f3-srckeypass\fR, -\f3destkeypass\fR, \f3-srcstorepass\fR, and \f3-deststorepass\fR, accept the \fIenv\fR and \fIfile\fR modifiers\&. Remember to separate the password option and the modifier with a colon (:)\&.
+-
+-The password must be provided to all commands that access the keystore contents\&. For such commands, when the \f3-storepass\fR option is not provided at the command line, the user is prompted for it\&.
+-
+-When retrieving information from the keystore, the password is optional\&. If no password is specified, then the integrity of the retrieved information cannot be verified and a warning is displayed\&.
+-.TP
+--providerName \fIprovider_name\fR
+-.br
+-Used to identify a cryptographic service provider\&'s name when listed in the security properties file\&.
+-.TP
+--providerClass \fIprovider_class_name\fR
+-.br
+-Used to specify the name of a cryptographic service provider\&'s master class file when the service provider is not listed in the security properties file\&.
+-.TP
+--providerArg \fIprovider_arg\fR
+-.br
+-Used with the \f3-providerClass\fR option to represent an optional string input argument for the constructor of \f3provider_class_name\fR\&.
+-.TP
+--protected
+-.br
+-Either \f3true\fR or \f3false\fR\&. This value should be specified as \f3true\fR when a password must be specified by way of a protected authentication path such as a dedicated PIN reader\&.Because there are two keystores involved in the \f3-importkeystore\fR command, the following two options \f3-srcprotected\fR and -\f3destprotected\fR are provided for the source keystore and the destination keystore respectively\&.
+-.TP
+--ext \fI{name{:critical} {=value}}\fR
+-.br
+-Denotes an X\&.509 certificate extension\&. The option can be used in \f3-genkeypair\fR and \f3-gencert\fR to embed extensions into the certificate generated, or in \f3-certreq\fR to show what extensions are requested in the certificate request\&. The option can appear multiple times\&. The \f3name\fR argument can be a supported extension name (see Named Extensions) or an arbitrary OID number\&. The \f3value\fR argument, when provided, denotes the argument for the extension\&. When \fIvalue\fR is omitted, that means that the default value of the extension or the extension requires no argument\&. The \f3:critical\fR modifier, when provided, means the extension\&'s \f3isCritical\fR attribute is \f3true\fR; otherwise, it is \f3false\fR\&. You can use \f3:c\fR in place of \f3:critical\fR\&.
+-.SH NAMED\ EXTENSIONS
+-The \f3keytool\fR command supports these named extensions\&. The names are not case-sensitive)\&.
+-.TP
+-BC or BasicContraints
+-\fIValues\fR: The full form is: \f3ca:{true|false}[,pathlen:<len>]\fR or \f3<len>\fR, which is short for \f3ca:true,pathlen:<len>\fR\&. When <\f3len\fR> is omitted, you have \f3ca:true\fR\&.
+-.TP
+-KU or KeyUsage
+-\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3digitalSignature\fR, \f3nonRepudiation\fR (contentCommitment), \f3keyEncipherment\fR, \f3dataEncipherment\fR, \f3keyAgreement\fR, \f3keyCertSign\fR, \f3cRLSign\fR, \f3encipherOnly\fR, \f3decipherOnly\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters (\f3dig\fR for \f3digitalSignature\fR) or in camel-case style (\f3dS\fR for \f3digitalSignature\fR or \f3cRLS\fR for \f3cRLSign\fR), as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
+-.TP
+-EKU or ExtendedKeyUsage
+-\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3anyExtendedKeyUsage\fR, \f3serverAuth\fR, \f3clientAuth\fR, \f3codeSigning\fR, \f3emailProtection\fR, \f3timeStamping\fR, \f3OCSPSigning\fR, or any \fIOID string\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters or in camel-case style, as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
+-.TP
+-SAN or SubjectAlternativeName
+-\fIValues\fR: \f3type\fR:\f3value\fR(,t\f3ype:value\fR)*, where \f3type\fR can be \f3EMAIL\fR, \f3URI\fR, \f3DNS\fR, \f3IP\fR, or \f3OID\fR\&. The \f3value\fR argument is the string format value for the \f3type\fR\&.
+-.TP
+-IAN or IssuerAlternativeName
+-\fIValues\fR: Same as \f3SubjectAlternativeName\fR\&.
+-.TP
+-SIA or SubjectInfoAccess
+-\fIValues\fR: \f3method\fR:\f3location-type\fR:\f3location-value\fR (,\f3method:location-type\fR:\f3location-value\fR)*, where \f3method\fR can be \f3timeStamping\fR, \f3caRepository\fR or any OID\&. The \f3location-type\fR and \f3location-value\fR arguments can be any \f3type\fR:\f3value\fR supported by the \f3SubjectAlternativeName\fR extension\&.
+-.TP
+-AIA or AuthorityInfoAccess
+-\fIValues\fR: Same as \f3SubjectInfoAccess\fR\&. The \f3method\fR argument can be \f3ocsp\fR,\f3caIssuers\fR, or any OID\&.
+-.PP
+-When \f3name\fR is OID, the value is the hexadecimal dumped DER encoding of the \f3extnValue\fR for the extension excluding the OCTET STRING type and length bytes\&. Any extra character other than standard hexadecimal numbers (0-9, a-f, A-F) are ignored in the HEX string\&. Therefore, both 01:02:03:04 and 01020304 are accepted as identical values\&. When there is no value, the extension has an empty value field\&.
+-.PP
+-A special name \f3honored\fR, used in \f3-gencert\fR only, denotes how the extensions included in the certificate request should be honored\&. The value for this name is a comma separated list of \f3all\fR (all requested extensions are honored), \f3name{:[critical|non-critical]}\fR (the named extension is honored, but using a different \f3isCritical\fR attribute) and \f3-name\fR (used with \f3all\fR, denotes an exception)\&. Requested extensions are not honored by default\&.
+-.PP
+-If, besides the\f3-ext honored\fR option, another named or OID \f3-ext\fR option is provided, this extension is added to those already honored\&. However, if this name (or OID) also appears in the honored value, then its value and criticality overrides the one in the request\&.
+-.PP
+-The \f3subjectKeyIdentifier\fR extension is always created\&. For non-self-signed certificates, the \f3authorityKeyIdentifier\fR is created\&.
+-.PP
+-\fINote:\fR Users should be aware that some combinations of extensions (and other certificate fields) may not conform to the Internet standard\&. See Certificate Conformance Warning\&.
+-.SH COMMANDS
+-.TP
+--gencert
+-.sp
+-.nf
+-\f3{\-rfc} {\-infile \fIinfile\fR} {\-outfile \fIoutfile\fR} {\-alias \fIalias\fR} {\-sigalg \fIsigalg\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-dname \fIdname\fR} {\-startdate \fIstartdate\fR {\-ext \fIext\fR}* {\-validity \fIvalDays\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-keypass \fIkeypass\fR] {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-providername \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a certificate as a response to a certificate request file (which can be created by the \f3keytool\fR\f3-certreq\fR command)\&. The command reads the request from \fIinfile\fR (if omitted, from the standard input), signs it using alias\&'s private key, and outputs the X\&.509 certificate into \fIoutfile\fR (if omitted, to the standard output)\&. When\f3-rfc\fR is specified, the output format is Base64-encoded PEM; otherwise, a binary DER is created\&.
+-
+-The \f3sigalg\fR value specifies the algorithm that should be used to sign the certificate\&. The \f3startdate\fR argument is the start time and date that the certificate is valid\&. The \f3valDays\fR argument tells the number of days for which the certificate should be considered valid\&.
+-
+-When \f3dname\fR is provided, it is used as the subject of the generated certificate\&. Otherwise, the one from the certificate request is used\&.
+-
+-The \f3ext\fR value shows what X\&.509 extensions will be embedded in the certificate\&. Read Common Options for the grammar of \f3-ext\fR\&.
+-
+-The \f3-gencert\fR option enables you to create certificate chains\&. The following example creates a certificate, \f3e1\fR, that contains three certificates in its certificate chain\&.
+-
+-The following commands creates four key pairs named \f3ca\fR, \f3ca1\fR, \f3ca2\fR, and \f3e1\fR:
+-.sp
+-.nf
+-\f3keytool \-alias ca \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca1 \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca2 \-dname CN=CA \-genkeypair\fP
+-.fi
+-.nf
+-\f3keytool \-alias e1 \-dname CN=E1 \-genkeypair\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following two commands create a chain of signed certificates; \f3ca\fR signs \f3ca1\fR and \f3ca1\fR signs \f3ca2\fR, all of which are self-issued:
+-.sp
+-.nf
+-\f3keytool \-alias ca1 \-certreq |\fP
+-.fi
+-.nf
+-\f3 keytool \-alias ca \-gencert \-ext san=dns:ca1 |\fP
+-.fi
+-.nf
+-\f3 keytool \-alias ca1 \-importcert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-alias ca2 \-certreq |\fP
+-.fi
+-.nf
+-\f3 $KT \-alias ca1 \-gencert \-ext san=dns:ca2 |\fP
+-.fi
+-.nf
+-\f3 $KT \-alias ca2 \-importcert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following command creates the certificate \f3e1\fR and stores it in the file \f3e1\&.cert\fR, which is signed by \f3ca2\fR\&. As a result, \f3e1\fR should contain \f3ca\fR, \f3ca1\fR, and \f3ca2\fR in its certificate chain:
+-.sp
+-.nf
+-\f3keytool \-alias e1 \-certreq | keytool \-alias ca2 \-gencert > e1\&.cert\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--genkeypair
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} {\-sigalg \fIsigalg\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-dname \fIdname\fR] [\-keypass \fIkeypass\fR] {\-startdate \fIvalue\fR} {\-ext \fIext\fR}*\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-validity \fIvalDays\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a key pair (a public key and associated private key)\&. Wraps the public key into an X\&.509 v3 self-signed certificate, which is stored as a single-element certificate chain\&. This certificate chain and the private key are stored in a new keystore entry identified by alias\&.
+-
+-The \f3keyalg\fR value specifies the algorithm to be used to generate the key pair, and the \f3keysize\fR value specifies the size of each key to be generated\&. The \f3sigalg\fR value specifies the algorithm that should be used to sign the self-signed certificate\&. This algorithm must be compatible with the \f3keyalg\fR value\&.
+-
+-The \f3dname\fR value specifies the X\&.500 Distinguished Name to be associated with the value of \f3alias\fR, and is used as the issuer and subject fields in the self-signed certificate\&. If no distinguished name is provided at the command line, then the user is prompted for one\&.
+-
+-The value of \f3keypass\fR is a password used to protect the private key of the generated key pair\&. If no password is provided, then the user is prompted for it\&. If you press \fIthe Return key\fR at the prompt, then the key password is set to the same password as the keystore password\&. The \f3keypass\fR value must be at least 6 characters\&.
+-
+-The value of \f3startdate\fR specifies the issue time of the certificate, also known as the "Not Before" value of the X\&.509 certificate\&'s Validity field\&.
+-
+-The option value can be set in one of these two forms:
+-
+-\f3([+-]nnn[ymdHMS])+\fR
+-
+-\f3[yyyy/mm/dd] [HH:MM:SS]\fR
+-
+-With the first form, the issue time is shifted by the specified value from the current time\&. The value is a concatenation of a sequence of subvalues\&. Inside each subvalue, the plus sign (+) means shift forward, and the minus sign (-) means shift backward\&. The time to be shifted is \f3nnn\fR units of years, months, days, hours, minutes, or seconds (denoted by a single character of \f3y\fR, \f3m\fR, \f3d\fR, \f3H\fR, \f3M\fR, or \f3S\fR respectively)\&. The exact value of the issue time is calculated using the \f3java\&.util\&.GregorianCalendar\&.add(int field, int amount)\fR method on each subvalue, from left to right\&. For example, by specifying, the issue time will be:
+-.sp
+-.nf
+-\f3Calendar c = new GregorianCalendar();\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.YEAR, \-1);\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.MONTH, 1);\fP
+-.fi
+-.nf
+-\f3c\&.add(Calendar\&.DATE, \-1);\fP
+-.fi
+-.nf
+-\f3return c\&.getTime()\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-With the second form, the user sets the exact issue time in two parts, year/month/day and hour:minute:second (using the local time zone)\&. The user can provide only one part, which means the other part is the same as the current date (or time)\&. The user must provide the exact number of digits as shown in the format definition (padding with 0 when shorter)\&. When both the date and time are provided, there is one (and only one) space character between the two parts\&. The hour should always be provided in 24 hour format\&.
+-
+-When the option is not provided, the start date is the current time\&. The option can be provided at most once\&.
+-
+-The value of \f3valDays\fR specifies the number of days (starting at the date specified by \f3-startdate\fR, or the current date when \f3-startdate\fR is not specified) for which the certificate should be considered valid\&.
+-
+-This command was named \f3-genkey\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-genkeypair\fR, is preferred going forward\&.
+-.TP
+--genseckey
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} [\-keypass \fIkeypass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a secret key and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&.
+-
+-The value of \f3keyalg\fR specifies the algorithm to be used to generate the secret key, and the value of \f3keysize\fR specifies the size of the key to be generated\&. The \f3keypass\fR value is a password that protects the secret key\&. If no password is provided, then the user is prompted for it\&. If you press the Return key at the prompt, then the key password is set to the same password that is used for the \f3keystore\fR\&. The \f3keypass\fR value must be at least 6 characters\&.
+-.TP
+--importcert
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} [\-keypass \fIkeypass\fR] {\-noprompt} {\-trustcacerts}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads the certificate or certificate chain (where the latter is supplied in a PKCS#7 formatted reply or a sequence of X\&.509 certificates) from the file \f3cert_file\fR, and stores it in the \f3keystore\fR entry identified by \f3alias\fR\&. If no file is specified, then the certificate or certificate chain is read from \f3stdin\fR\&.
+-
+-The \f3keytool\fR command can import X\&.509 v1, v2, and v3 certificates, and PKCS#7 formatted certificate chains consisting of certificates of that type\&. The data to be imported must be provided either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. In the latter case, the encoding must be bounded at the beginning by a string that starts with \f3-\fR\f3----BEGIN\fR, and bounded at the end by a string that starts with \f3-----END\fR\&.
+-
+-You import a certificate for two reasons: To add it to the list of trusted certificates, and to import a certificate reply received from a certificate authority (CA) as the result of submitting a Certificate Signing Request to that CA (see the \f3-certreq\fR option in Commands)\&.
+-
+-Which type of import is intended is indicated by the value of the \f3-alias\fR option\&. If the alias does not point to a key entry, then the \f3keytool\fR command assumes you are adding a trusted certificate entry\&. In this case, the alias should not already exist in the keystore\&. If the alias does already exist, then the \f3keytool\fR command outputs an error because there is already a trusted certificate for that alias, and does not import the certificate\&. If the alias points to a key entry, then the \f3keytool\fR command assumes you are importing a certificate reply\&.
+-.TP
+--importpassword
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Imports a passphrase and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&. The passphrase may be supplied via the standard input stream; otherwise the user is prompted for it\&. \f3keypass\fR is a password used to protect the imported passphrase\&. If no password is provided, the user is prompted for it\&. If you press the Return key at the prompt, the key password is set to the same password as that used for the \f3keystore\fR\&. \f3keypass\fR must be at least 6 characters long\&.
+-.TP
+--importkeystore
+-.sp
+-.nf
+-\f3{\-srcstoretype \fIsrcstoretype\fR} {\-deststoretype \fIdeststoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-srcstorepass \fIsrcstorepass\fR] [\-deststorepass \fIdeststorepass\fR] {\-srcprotected}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-destprotected} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-srcalias \fIsrcalias\fR {\-destalias \fIdestalias\fR} [\-srckeypass \fIsrckeypass\fR]} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-destkeypass \fIdestkeypass\fR] {\-noprompt}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-srcProviderName \fIsrc_provider_name\fR} {\-destProviderName \fIdest_provider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Imports a single entry or all entries from a source keystore to a destination keystore\&.
+-
+-When the \f3-srcalias\fR option is provided, the command imports the single entry identified by the alias to the destination keystore\&. If a destination alias is not provided with \f3destalias\fR, then \f3srcalias\fR is used as the destination alias\&. If the source entry is protected by a password, then \f3srckeypass\fR is used to recover the entry\&. If \fIsrckeypass\fR is not provided, then the \f3keytool\fR command attempts to use \f3srcstorepass\fR to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. The destination entry is protected with \f3destkeypass\fR\&. If \f3destkeypass\fR is not provided, then the destination entry is protected with the source entry password\&. For example, most third-party tools require \f3storepass\fR and \f3keypass\fR in a PKCS #12 keystore to be the same\&. In order to create a PKCS #12 keystore for these tools, always specify a \f3-destkeypass\fR to be the same as \f3-deststorepass\fR\&.
+-
+-If the \f3-srcalias\fR option is not provided, then all entries in the source keystore are imported into the destination keystore\&. Each destination entry is stored under the alias from the source entry\&. If the source entry is protected by a password, then \f3srcstorepass\fR is used to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. If a source keystore entry type is not supported in the destination keystore, or if an error occurs while storing an entry into the destination keystore, then the user is prompted whether to skip the entry and continue or to quit\&. The destination entry is protected with the source entry password\&.
+-
+-If the destination alias already exists in the destination keystore, then the user is prompted to either overwrite the entry or to create a new entry under a different alias name\&.
+-
+-If the \f3-noprompt\fR option is provided, then the user is not prompted for a new destination alias\&. Existing entries are overwritten with the destination alias name\&. Entries that cannot be imported are skipped and a warning is displayed\&.
+-.TP
+--printcertreq
+-.sp
+-.nf
+-\f3{\-file \fIfile\fR}\fP
+-.fi
+-.sp
+-
+-
+-Prints the content of a PKCS #10 format certificate request, which can be generated by the \f3keytool\fR\f3-certreq\fR command\&. The command reads the request from file\&. If there is no file, then the request is read from the standard input\&.
+-.TP
+--certreq
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-dname \fIdname\fR} {\-sigalg \fIsigalg\fR} {\-file \fIcertreq_file\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Generates a Certificate Signing Request (CSR) using the PKCS #10 format\&.
+-
+-A CSR is intended to be sent to a certificate authority (CA)\&. The CA authenticates the certificate requestor (usually off-line) and will return a certificate or certificate chain, used to replace the existing certificate chain (which initially consists of a self-signed certificate) in the keystore\&.
+-
+-The private key associated with alias is used to create the PKCS #10 certificate request\&. To access the private key, the correct password must be provided\&. If \f3keypass\fR is not provided at the command line and is different from the password used to protect the integrity of the keystore, then the user is prompted for it\&. If \f3dname\fR is provided, then it is used as the subject in the CSR\&. Otherwise, the X\&.500 Distinguished Name associated with alias is used\&.
+-
+-The \f3sigalg\fR value specifies the algorithm that should be used to sign the CSR\&.
+-
+-The CSR is stored in the file certreq_file\&. If no file is specified, then the CSR is output to \f3stdout\fR\&.
+-
+-Use the \f3importcert\fR command to import the response from the CA\&.
+-.TP
+--exportcert
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-rfc} {\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads from the keystore the certificate associated with \fIalias\fR and stores it in the cert_file file\&. When no file is specified, the certificate is output to \f3stdout\fR\&.
+-
+-The certificate is by default output in binary encoding\&. If the \f3-rfc\fR option is specified, then the output in the printable encoding format defined by the Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-If \f3alias\fR refers to a trusted certificate, then that certificate is output\&. Otherwise, \f3alias\fR refers to a key entry with an associated certificate chain\&. In that case, the first certificate in the chain is returned\&. This certificate authenticates the public key of the entity addressed by \f3alias\fR\&.
+-
+-This command was named \f3-export\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-exportcert\fR, is preferred going forward\&.
+-.TP
+--list
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v | \-rfc} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Prints to \f3stdout\fR the contents of the keystore entry identified by \f3alias\fR\&. If no \f3alias\fR is specified, then the contents of the entire keystore are printed\&.
+-
+-This command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format, with additional information such as the owner, issuer, serial number, and any extensions\&. If the \f3-rfc\fR option is specified, then the certificate contents are printed using the printable encoding format, as defined by the Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-You cannot specify both \f3-v\fR and \f3-rfc\fR\&.
+-.TP
+--printcert
+-.sp
+-.nf
+-\f3{\-file \fIcert_file\fR | \-sslserver \fIhost\fR[:\fIport\fR]} {\-jarfile \fIJAR_file\fR {\-rfc} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Reads the certificate from the file cert_file, the SSL server located at host:port, or the signed JAR file \f3JAR_file\fR (with the \f3-jarfile\fR option and prints its contents in a human-readable format\&. When no port is specified, the standard HTTPS port 443 is assumed\&. Note that \f3-sslserver\fR and -file options cannot be provided at the same time\&. Otherwise, an error is reported\&. If neither option is specified, then the certificate is read from \f3stdin\fR\&.
+-
+-When\f3-rfc\fR is specified, the \f3keytool\fR command prints the certificate in PEM mode as defined by the Internet RFC 1421 Certificate Encoding standard\&. See Internet RFC 1421 Certificate Encoding Standard\&.
+-
+-If the certificate is read from a file or \f3stdin\fR, then it might be either binary encoded or in printable encoding format, as defined by the RFC 1421 Certificate Encoding standard\&.
+-
+-If the SSL server is behind a firewall, then the \f3-J-Dhttps\&.proxyHost=proxyhost\fR and \f3-J-Dhttps\&.proxyPort=proxyport\fR options can be specified on the command line for proxy tunneling\&. See Java Secure Socket Extension (JSSE) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.html
+-
+-\fINote:\fR This option can be used independently of a keystore\&.
+-.TP
+--printcrl
+-.sp
+-.nf
+-\f3\-file \fIcrl_\fR {\-v}\fP
+-.fi
+-.sp
+-
+-
+-Reads the Certificate Revocation List (CRL) from the file \f3crl_\fR\&. A CRL is a list of digital certificates that were revoked by the CA that issued them\&. The CA generates the \f3crl_\fR file\&.
+-
+-\fINote:\fR This option can be used independently of a keystore\&.
+-.TP
+--storepasswd
+-.sp
+-.nf
+-\f3[\-new \fInew_storepass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Changes the password used to protect the integrity of the keystore contents\&. The new password is \f3new_storepass\fR, which must be at least 6 characters\&.
+-.TP
+--keypasswd
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-keypass \fIold_keypass\fR] [\-new \fInew_keypass\fR] {\-storetype \fIstoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Changes the password under which the private/secret key identified by \f3alias\fR is protected, from \f3old_keypass\fR to \f3new_keypass\fR, which must be at least 6 characters\&.
+-
+-If the \f3-keypass\fR option is not provided at the command line, and the key password is different from the keystore password, then the user is prompted for it\&.
+-
+-If the \f3-new\fR option is not provided at the command line, then the user is prompted for it
+-.TP
+--delete
+-.sp
+-.nf
+-\f3[\-alias \fIalias\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerName \fIprovider_name\fR} \fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-v} {\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Deletes from the keystore the entry identified by \f3alias\fR\&. The user is prompted for the alias, when no alias is provided at the command line\&.
+-.TP
+--changealias
+-.sp
+-.nf
+-\f3{\-alias \fIalias\fR} [\-destalias \fIdestalias\fR] [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
+-.fi
+-.sp
+-.sp
+-.nf
+-\f3{\-protected} {\-Jjavaoption}\fP
+-.fi
+-.sp
+-
+-
+-Move an existing keystore entry from the specified \f3alias\fR to a new alias, \f3destalias\fR\&. If no destination alias is provided, then the command prompts for one\&. If the original entry is protected with an entry password, then the password can be supplied with the \f3-keypass\fR option\&. If no key password is provided, then the \f3storepass\fR (if provided) is attempted first\&. If the attempt fails, then the user is prompted for a password\&.
+-.TP
+--help
+-.br
+-Lists the basic commands and their options\&.
+-
+-For more information about a specific command, enter the following, where \f3command_name\fR is the name of the command: \f3keytool -command_name -help\fR\&.
+-.SH EXAMPLES
+-This example walks through the sequence of steps to create a keystore for managing public/private key pair and certificates from trusted entities\&.
+-.SS GENERATE\ THE\ KEY\ PAIR
+-First, create a keystore and generate the key pair\&. You can use a command such as the following typed as a single line:
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-dname "cn=Mark Jones, ou=Java, o=Oracle, c=US"\fP
+-.fi
+-.nf
+-\f3 \-alias business \-keypass <new password for private key>\fP
+-.fi
+-.nf
+-\f3 \-keystore /working/mykeystore\fP
+-.fi
+-.nf
+-\f3 \-storepass <new password for keystore> \-validity 180\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The command creates the keystore named \f3mykeystore\fR in the working directory (assuming it does not already exist), and assigns it the password specified by \f3<new password for keystore>\fR\&. It generates a public/private key pair for the entity whose distinguished name has a common name of Mark Jones, organizational unit of Java, organization of Oracle and two-letter country code of US\&. It uses the default DSA key generation algorithm to create the keys; both are 1024 bits\&.
+-.PP
+-The command uses the default SHA1withDSA signature algorithm to create a self-signed certificate that includes the public key and the distinguished name information\&. The certificate is valid for 180 days, and is associated with the private key in a keystore entry referred to by the alias \f3business\fR\&. The private key is assigned the password specified by \f3<new password for private key>\fR\&.
+-.PP
+-The command is significantly shorter when the option defaults are accepted\&. In this case, no options are required, and the defaults are used for unspecified options that have default values\&. You are prompted for any required values\&. You could have the following:
+-.sp
+-.nf
+-\f3keytool \-genkeypair\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this case, a keystore entry with the alias \f3mykey\fR is created, with a newly generated key pair and a certificate that is valid for 90 days\&. This entry is placed in the keystore named \f3\&.keystore\fR in your home directory\&. The keystore is created when it does not already exist\&. You are prompted for the distinguished name information, the keystore password, and the private key password\&.
+-.PP
+-The rest of the examples assume you executed the \f3-genkeypair\fR command without options specified, and that you responded to the prompts with values equal to those specified in the first \f3-genkeypair\fR command\&. For example, a distinguished name of \f3cn=Mark Jones\fR, \f3ou=Java\fR, \f3o=Oracle\fR, \f3c=US\fR)\&.
+-.SS REQUEST\ A\ SIGNED\ CERTIFICATE\ FROM\ A\ CA
+-Generating the key pair created a self-signed certificate\&. A certificate is more likely to be trusted by others when it is signed by a Certification Authority (CA)\&. To get a CA signature, first generate a Certificate Signing Request (CSR), as follows:
+-.sp
+-.nf
+-\f3keytool \-certreq \-file MarkJ\&.csr\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This creates a CSR for the entity identified by the default alias \f3mykey\fR and puts the request in the file named MarkJ\&.csr\&. Submit this file to a CA, such as VeriSign\&. The CA authenticates you, the requestor (usually off-line), and returns a certificate, signed by them, authenticating your public key\&. In some cases, the CA returns a chain of certificates, each one authenticating the public key of the signer of the previous certificate in the chain\&.
+-.SS IMPORT\ A\ CERTIFICATE\ FOR\ THE\ CA
+-You now need to replace the self-signed certificate with a certificate chain, where each certificate in the chain authenticates the public key of the signer of the previous certificate in the chain, up to a root CA\&.
+-.PP
+-Before you import the certificate reply from a CA, you need one or more trusted certificates in your keystore or in the \f3cacerts\fR keystore file\&. See \f3-importcert\fR in Commands\&.
+-.TP 0.2i
+-\(bu
+-If the certificate reply is a certificate chain, then you need the top certificate of the chain\&. The root CA certificate that authenticates the public key of the CA\&.
+-.TP 0.2i
+-\(bu
+-If the certificate reply is a single certificate, then you need a certificate for the issuing CA (the one that signed it)\&. If that certificate is not self-signed, then you need a certificate for its signer, and so on, up to a self-signed root CA certificate\&.
+-.PP
+-The \f3cacerts\fR keystore file ships with several VeriSign root CA certificates, so you probably will not need to import a VeriSign certificate as a trusted certificate in your keystore\&. But if you request a signed certificate from a different CA, and a certificate authenticating that CA\&'s public key was not added to \f3cacerts\fR, then you must import a certificate from the CA as a trusted certificate\&.
+-.PP
+-A certificate from a CA is usually either self-signed or signed by another CA, in which case you need a certificate that authenticates that CA\&'s public key\&. Suppose company ABC, Inc\&., is a CA, and you obtain a file named A\f3BCCA\&.cer\fR that is supposed to be a self-signed certificate from ABC, that authenticates that CA\&'s public key\&. Be careful to ensure the certificate is valid before you import it as a trusted certificate\&. View it first with the \f3keytool -printcert\fR command or the \f3keytool -importcert\fR command without the \f3-noprompt\fR option, and make sure that the displayed certificate fingerprints match the expected ones\&. You can call the person who sent the certificate, and compare the fingerprints that you see with the ones that they show or that a secure public key repository shows\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s (for example, an attacker\&'s) certificate\&. If such an attack takes place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker has signed\&.
+-.PP
+-If you trust that the certificate is valid, then you can add it to your keystore with the following command:
+-.sp
+-.nf
+-\f3keytool \-importcert \-alias abc \-file ABCCA\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This command creates a trusted certificate entry in the keystore, with the data from the file ABCCA\&.cer, and assigns the alias \f3abc\fR to the entry\&.
+-.SS IMPORT\ THE\ CERTIFICATE\ REPLY\ FROM\ THE\ CA
+-After you import a certificate that authenticates the public key of the CA you submitted your certificate signing request to (or there is already such a certificate in the cacerts file), you can import the certificate reply and replace your self-signed certificate with a certificate chain\&. This chain is the one returned by the CA in response to your request (when the CA reply is a chain), or one constructed (when the CA reply is a single certificate) using the certificate reply and trusted certificates that are already available in the keystore where you import the reply or in the \f3cacerts\fR keystore file\&.
+-.PP
+-For example, if you sent your certificate signing request to VeriSign, then you can import the reply with the following, which assumes the returned certificate is named VSMarkJ\&.cer:
+-.sp
+-.nf
+-\f3keytool \-importcert \-trustcacerts \-file VSMarkJ\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS EXPORT\ A\ CERTIFICATE\ THAT\ AUTHENTICATES\ THE\ PUBLIC\ KEY
+-If you used the \f3jarsigner\fR command to sign a Java Archive (JAR) file, then clients that want to use the file will want to authenticate your signature\&. One way the clients can authenticate you is by first importing your public key certificate into their keystore as a trusted entry\&.
+-.PP
+-You can export the certificate and supply it to your clients\&. As an example, you can copy your certificate to a file named MJ\&.cer with the following command that assumes the entry has an alias of \f3mykey\fR:
+-.sp
+-.nf
+-\f3keytool \-exportcert \-alias mykey \-file MJ\&.cer\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-With the certificate and the signed JAR file, a client can use the \f3jarsigner\fR command to authenticate your signature\&.
+-.SS IMPORT\ KEYSTORE
+-The command \f3importkeystore\fR is used to import an entire keystore into another keystore, which means all entries from the source keystore, including keys and certificates, are all imported to the destination keystore within a single command\&. You can use this command to import entries from a different type of keystore\&. During the import, all new entries in the destination keystore will have the same alias names and protection passwords (for secret keys and private keys)\&. If the \f3keytool\fR command cannot recover the private keys or secret keys from the source keystore, then it prompts you for a password\&. If it detects alias duplication, then it asks you for a new alias, and you can specify a new alias or simply allow the \f3keytool\fR command to overwrite the existing one\&.
+-.PP
+-For example, to import entries from a typical JKS type keystore key\&.jks into a PKCS #11 type hardware-based keystore, use the command:
+-.sp
+-.nf
+-\f3keytool \-importkeystore\fP
+-.fi
+-.nf
+-\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
+-.fi
+-.nf
+-\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
+-.fi
+-.nf
+-\f3 \-srcstorepass <src keystore password>\fP
+-.fi
+-.nf
+-\f3 \-deststorepass <destination keystore pwd>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3importkeystore\fR command can also be used to import a single entry from a source keystore to a destination keystore\&. In this case, besides the options you see in the previous example, you need to specify the alias you want to import\&. With the \f3-srcalias\fR option specified, you can also specify the destination alias name in the command line, as well as protection password for a secret/private key and the destination protection password you want\&. The following command demonstrates this:
+-.sp
+-.nf
+-\f3keytool \-importkeystore\fP
+-.fi
+-.nf
+-\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
+-.fi
+-.nf
+-\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
+-.fi
+-.nf
+-\f3 \-srcstorepass <src keystore password>\fP
+-.fi
+-.nf
+-\f3 \-deststorepass <destination keystore pwd>\fP
+-.fi
+-.nf
+-\f3 \-srcalias myprivatekey \-destalias myoldprivatekey\fP
+-.fi
+-.nf
+-\f3 \-srckeypass <source entry password>\fP
+-.fi
+-.nf
+-\f3 \-destkeypass <destination entry password>\fP
+-.fi
+-.nf
+-\f3 \-noprompt\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS GENERATE\ CERTIFICATES\ FOR\ AN\ SSL\ SERVER
+-The following are \f3keytool\fR commands to generate key pairs and certificates for three entities: Root CA (\f3root\fR), Intermediate CA (\f3ca\fR), and SSL server (\f3server\fR)\&. Ensure that you store all the certificates in the same keystore\&. In these examples, RSA is the recommended the key algorithm\&.
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-keystore root\&.jks \-alias root \-ext bc:c\fP
+-.fi
+-.nf
+-\f3keytool \-genkeypair \-keystore ca\&.jks \-alias ca \-ext bc:c\fP
+-.fi
+-.nf
+-\f3keytool \-genkeypair \-keystore server\&.jks \-alias server\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-keystore root\&.jks \-alias root \-exportcert \-rfc > root\&.pem\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-storepass <storepass> \-keystore ca\&.jks \-certreq \-alias ca |\fP
+-.fi
+-.nf
+-\f3 keytool \-storepass <storepass> \-keystore root\&.jks\fP
+-.fi
+-.nf
+-\f3 \-gencert \-alias root \-ext BC=0 \-rfc > ca\&.pem\fP
+-.fi
+-.nf
+-\f3keytool \-keystore ca\&.jks \-importcert \-alias ca \-file ca\&.pem\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3keytool \-storepass <storepass> \-keystore server\&.jks \-certreq \-alias server |\fP
+-.fi
+-.nf
+-\f3 keytool \-storepass <storepass> \-keystore ca\&.jks \-gencert \-alias ca\fP
+-.fi
+-.nf
+-\f3 \-ext ku:c=dig,kE \-rfc > server\&.pem\fP
+-.fi
+-.nf
+-\f3cat root\&.pem ca\&.pem server\&.pem |\fP
+-.fi
+-.nf
+-\f3 keytool \-keystore server\&.jks \-importcert \-alias server\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH TERMS
+-.TP
+-Keystore
+-A keystore is a storage facility for cryptographic keys and certificates\&.
+-.TP
+-Keystore entries
+-Keystores can have different types of entries\&. The two most applicable entry types for the \f3keytool\fR command include the following:
+-
+-\fIKey entries\fR: Each entry holds very sensitive cryptographic key information, which is stored in a protected format to prevent unauthorized access\&. Typically, a key stored in this type of entry is a secret key, or a private key accompanied by the certificate chain for the corresponding public key\&. See Certificate Chains\&. The \f3keytool\fR command can handle both types of entries, while the \f3jarsigner\fR tool only handles the latter type of entry, that is private keys and their associated certificate chains\&.
+-
+-\fITrusted certificate entries\fR: Each entry contains a single public key certificate that belongs to another party\&. The entry is called a trusted certificate because the keystore owner trusts that the public key in the certificate belongs to the identity identified by the subject (owner) of the certificate\&. The issuer of the certificate vouches for this, by signing the certificate\&.
+-.TP
+-KeyStore aliases
+-All keystore entries (key and trusted certificate entries) are accessed by way of unique aliases\&.
+-
+-An alias is specified when you add an entity to the keystore with the \f3-genseckey\fR command to generate a secret key, the \f3-genkeypair\fR command to generate a key pair (public and private key), or the \f3-importcert\fR command to add a certificate or certificate chain to the list of trusted certificates\&. Subsequent \f3keytool\fR commands must use this same alias to refer to the entity\&.
+-
+-For example, you can use the alias \f3duke\fR to generate a new public/private key pair and wrap the public key into a self-signed certificate with the following command\&. See Certificate Chains\&.
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-alias duke \-keypass dukekeypasswd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This example specifies an initial password of \f3dukekeypasswd\fR required by subsequent commands to access the private key associated with the alias \f3duke\fR\&. If you later want to change Duke\&'s private key password, use a command such as the following:
+-.sp
+-.nf
+-\f3keytool \-keypasswd \-alias duke \-keypass dukekeypasswd \-new newpass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This changes the password from \f3dukekeypasswd\fR to \f3newpass\fR\&. A password should not be specified on a command line or in a script unless it is for testing purposes, or you are on a secure system\&. If you do not specify a required password option on a command line, then you are prompted for it\&.
+-.TP
+-KeyStore implementation
+-The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies well-defined interfaces to access and modify the information in a keystore\&. It is possible for there to be multiple different concrete implementations, where each implementation is that for a particular type of keystore\&.
+-
+-Currently, two command-line tools (\f3keytool\fR and \f3jarsigner\fR) and a GUI-based tool named Policy Tool make use of keystore implementations\&. Because the \f3KeyStore\fR class is \f3public\fR, users can write additional security applications that use it\&.
+-
+-There is a built-in default implementation, provided by Oracle\&. It implements the keystore as a file with a proprietary keystore type (format) named JKS\&. It protects each private key with its individual password, and also protects the integrity of the entire keystore with a (possibly different) password\&.
+-
+-Keystore implementations are provider-based\&. More specifically, the application interfaces supplied by \f3KeyStore\fR are implemented in terms of a Service Provider Interface (SPI)\&. That is, there is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, which defines the Service Provider Interface methods that providers must implement\&. The term \fIprovider\fR refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
+-
+-Applications can choose different types of keystore implementations from different providers, using the \f3getInstance\fR factory method supplied in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private/secret keys in the keystore and the integrity of the keystore\&. Keystore implementations of different types are not compatible\&.
+-
+-The \f3keytool\fR command works on any file-based keystore implementation\&. It treats the keystore location that is passed to it at the command line as a file name and converts it to a \f3FileInputStream\fR, from which it loads the keystore information\&.)The \f3jarsigner\fR and \f3policytool\fR commands can read a keystore from any location that can be specified with a URL\&.
+-
+-For \f3keytool\fR and \f3jarsigner\fR, you can specify a keystore type at the command line, with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIKeystore\fR menu\&.
+-
+-If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment directory\&. The \f3jre\fR directory in the SDK or the top-level directory of the Java Runtime Environment (JRE)\&.
+-
+-Each tool gets the \f3keystore\&.type\fR value and then examines all the currently installed providers until it finds one that implements a keystores of that type\&. It then uses the keystore implementation from that provider\&.The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type\fR property:
+-.sp
+-.nf
+-\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The default keystore type is \f3jks\fR, which is the proprietary type of the keystore implementation provided by Oracle\&. This is specified by the following line in the security properties file:
+-.sp
+-.nf
+-\f3keystore\&.type=jks\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-To have the tools utilize a keystore implementation other than the default, you can change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
+-.sp
+-.nf
+-\f3keystore\&.type=pkcs12\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-\fINote:\fR Case does not matter in keystore type designations\&. For example, JKS would be considered the same as jks\&.
+-.TP
+-Certificate
+-A certificate (or public-key certificate) is a digitally signed statement from one entity (the issuer), saying that the public key and some other information of another entity (the subject) has some specific value\&. The following terms are related to certificates:
+-
+-\fIPublic Keys\fR: These are numbers associated with a particular entity, and are intended to be known to everyone who needs to have trusted interactions with that entity\&. Public keys are used to verify signatures\&.
+-
+-\fIDigitally Signed\fR: If some data is digitally signed, then it is stored with the identity of an entity and a signature that proves that entity knows about the data\&. The data is rendered unforgeable by signing with the entity\&'s private key\&.
+-
+-\fIIdentity\fR: A known way of addressing an entity\&. In some systems, the identity is the public key, and in others it can be anything from an Oracle Solaris UID to an email address to an X\&.509 distinguished name\&.
+-
+-\fISignature\fR: A signature is computed over some data using the private key of an entity\&. The signer, which in the case of a certificate is also known as the issuer\&.
+-
+-\fIPrivate Keys\fR: These are numbers, each of which is supposed to be known only to the particular entity whose private key it is (that is, it is supposed to be kept secret)\&. Private and public keys exist in pairs in all public key cryptography systems (also referred to as public key crypto systems)\&. In a typical public key crypto system, such as DSA, a private key corresponds to exactly one public key\&. Private keys are used to compute signatures\&.
+-
+-\fIEntity\fR: An entity is a person, organization, program, computer, business, bank, or something else you are trusting to some degree\&.
+-
+-Public key cryptography requires access to users\&' public keys\&. In a large-scale networked environment, it is impossible to guarantee that prior relationships between communicating entities were established or that a trusted repository exists with all used public keys\&. Certificates were invented as a solution to this public key distribution problem\&. Now a Certification Authority (CA) can act as a trusted third party\&. CAs are entities such as businesses that are trusted to sign (issue) certificates for other entities\&. It is assumed that CAs only create valid and reliable certificates because they are bound by legal agreements\&. There are many public Certification Authorities, such as VeriSign, Thawte, Entrust, and so on\&.
+-
+-You can also run your own Certification Authority using products such as Microsoft Certificate Server or the Entrust CA product for your organization\&. With the \f3keytool\fR command, it is possible to display, import, and export certificates\&. It is also possible to generate self-signed certificates\&.
+-
+-The \f3keytool\fR command currently handles X\&.509 certificates\&.
+-.TP
+-X\&.509 Certificates
+-The X\&.509 standard defines what information can go into a certificate and describes how to write it down (the data format)\&. All the data in a certificate is encoded with two related standards called ASN\&.1/DER\&. Abstract Syntax Notation 1 describes data\&. The Definite Encoding Rules describe a single way to store and transfer that data\&.
+-
+-All X\&.509 certificates have the following data, in addition to the signature:
+-
+-\fIVersion\fR: This identifies which version of the X\&.509 standard applies to this certificate, which affects what information can be specified in it\&. Thus far, three versions are defined\&. The \f3keytool\fR command can import and export v1, v2, and v3 certificates\&. It generates v3 certificates\&.
+-
+-X\&.509 Version 1 has been available since 1988, is widely deployed, and is the most generic\&.
+-
+-X\&.509 Version 2 introduced the concept of subject and issuer unique identifiers to handle the possibility of reuse of subject or issuer names over time\&. Most certificate profile documents strongly recommend that names not be reused and that certificates should not make use of unique identifiers\&. Version 2 certificates are not widely used\&.
+-
+-X\&.509 Version 3 is the most recent (1996) and supports the notion of extensions where anyone can define an extension and include it in the certificate\&. Some common extensions are: KeyUsage (limits the use of the keys to particular purposes such as \f3signing-only\fR) and AlternativeNames (allows other identities to also be associated with this public key, for example\&. DNS names, email addresses, IP addresses)\&. Extensions can be marked critical to indicate that the extension should be checked and enforced or used\&. For example, if a certificate has the KeyUsage extension marked critical and set to \f3keyCertSign\fR, then when this certificate is presented during SSL communication, it should be rejected because the certificate extension indicates that the associated private key should only be used for signing certificates and not for SSL use\&.
+-
+-\fISerial number\fR: The entity that created the certificate is responsible for assigning it a serial number to distinguish it from other certificates it issues\&. This information is used in numerous ways\&. For example, when a certificate is revoked its serial number is placed in a Certificate Revocation List (CRL)\&.
+-
+-\fISignature algorithm identifier\fR: This identifies the algorithm used by the CA to sign the certificate\&.
+-
+-\fIIssuer name\fR: The X\&.500 Distinguished Name of the entity that signed the certificate\&. See X\&.500 Distinguished Names\&. This is typically a CA\&. Using this certificate implies trusting the entity that signed this certificate\&. In some cases, such as root or top-level CA certificates, the issuer signs its own certificate\&.
+-
+-\fIValidity period\fR: Each certificate is valid only for a limited amount of time\&. This period is described by a start date and time and an end date and time, and can be as short as a few seconds or almost as long as a century\&. The validity period chosen depends on a number of factors, such as the strength of the private key used to sign the certificate, or the amount one is willing to pay for a certificate\&. This is the expected period that entities can rely on the public value, when the associated private key has not been compromised\&.
+-
+-\fISubject name\fR: The name of the entity whose public key the certificate identifies\&. This name uses the X\&.500 standard, so it is intended to be unique across the Internet\&. This is the X\&.500 Distinguished Name (DN) of the entity\&. See X\&.500 Distinguished Names\&. For example,
+-.sp
+-.nf
+-\f3CN=Java Duke, OU=Java Software Division, O=Oracle Corporation, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-These refer to the subject\&'s common name (CN), organizational unit (OU), organization (O), and country (C)\&.
+-
+-\fISubject public key information\fR: This is the public key of the entity being named with an algorithm identifier that specifies which public key crypto system this key belongs to and any associated key parameters\&.
+-.TP
+-Certificate Chains
+-The \f3keytool\fR command can create and manage keystore key entries that each contain a private key and an associated certificate chain\&. The first certificate in the chain contains the public key that corresponds to the private key\&.
+-
+-When keys are first generated, the chain starts off containing a single element, a self-signed certificate\&. See \f3-genkeypair\fR in Commands\&. A self-signed certificate is one for which the issuer (signer) is the same as the subject\&. The subject is the entity whose public key is being authenticated by the certificate\&. Whenever the \f3-genkeypair\fR command is called to generate a new public/private key pair, it also wraps the public key into a self-signed certificate\&.
+-
+-Later, after a Certificate Signing Request (CSR) was generated with the \f3-certreq\fR command and sent to a Certification Authority (CA), the response from the CA is imported with \f3-importcert\fR, and the self-signed certificate is replaced by a chain of certificates\&. See the \f3-certreq\fR and \f3-importcert\fR options in Commands\&. At the bottom of the chain is the certificate (reply) issued by the CA authenticating the subject\&'s public key\&. The next certificate in the chain is one that authenticates the CA\&'s public key\&.
+-
+-In many cases, this is a self-signed certificate, which is a certificate from the CA authenticating its own public key, and the last certificate in the chain\&. In other cases, the CA might return a chain of certificates\&. In this case, the bottom certificate in the chain is the same (a certificate signed by the CA, authenticating the public key of the key entry), but the second certificate in the chain is a certificate signed by a different CA that authenticates the public key of the CA you sent the CSR to\&. The next certificate in the chain is a certificate that authenticates the second CA\&'s key, and so on, until a self-signed root certificate is reached\&. Each certificate in the chain (after the first) authenticates the public key of the signer of the previous certificate in the chain\&.
+-
+-Many CAs only return the issued certificate, with no supporting chain, especially when there is a flat hierarchy (no intermediates CAs)\&. In this case, the certificate chain must be established from trusted certificate information already stored in the keystore\&.
+-
+-A different reply format (defined by the PKCS #7 standard) includes the supporting certificate chain in addition to the issued certificate\&. Both reply formats can be handled by the \f3keytool\fR command\&.
+-
+-The top-level (root) CA certificate is self-signed\&. However, the trust into the root\&'s public key does not come from the root certificate itself, but from other sources such as a newspaper\&. This is because anybody could generate a self-signed certificate with the distinguished name of, for example, the VeriSign root CA\&. The root CA public key is widely known\&. The only reason it is stored in a certificate is because this is the format understood by most tools, so the certificate in this case is only used as a vehicle to transport the root CA\&'s public key\&. Before you add the root CA certificate to your keystore, you should view it with the \f3-printcert\fR option and compare the displayed fingerprint with the well-known fingerprint obtained from a newspaper, the root CA\&'s Web page, and so on\&.
+-.TP
+-The cacerts Certificates File
+-A certificates file named \f3cacerts\fR resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment\&'s directory, which would be the \f3jre\fR directory in the SDK or the top-level directory of the JRE\&.
+-
+-The \f3cacerts\fR file represents a system-wide keystore with CA certificates\&. System administrators can configure and manage that file with the \f3keytool\fR command by specifying \f3jks\fR as the keystore type\&. The \f3cacerts\fR keystore file ships with a default set of root CA certificates\&. You can list the default certificates with the following command:
+-.sp
+-.nf
+-\f3keytool \-list \-keystore java\&.home/lib/security/cacerts\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The initial password of the \f3cacerts\fR keystore file is \f3changeit\fR\&. System administrators should change that password and the default access permission of that file upon installing the SDK\&.
+-
+-\fINote:\fR It is important to verify your \f3cacerts\fR file\&. Because you trust the CAs in the \f3cacerts\fR file as entities for signing and issuing certificates to other entities, you must manage the \f3cacerts\fR file carefully\&. The \f3cacerts\fR file should contain only certificates of the CAs you trust\&. It is your responsibility to verify the trusted root CA certificates bundled in the \f3cacerts\fR file and make your own trust decisions\&.
+-
+-To remove an untrusted CA certificate from the \f3cacerts\fR file, use the \f3delete\fR option of the \f3keytool\fR command\&. You can find the \f3cacerts\fR file in the JRE installation directory\&. Contact your system administrator if you do not have permission to edit this file
+-.TP
+-Internet RFC 1421 Certificate Encoding Standard
+-Certificates are often stored using the printable encoding format defined by the Internet RFC 1421 standard, instead of their binary encoding\&. This certificate format, also known as Base64 encoding, makes it easy to export certificates to other applications by email or through some other mechanism\&.
+-
+-Certificates read by the \f3-importcert\fR and \f3-printcert\fR commands can be in either this format or binary encoded\&. The \f3-exportcert\fR command by default outputs a certificate in binary encoding, but will instead output a certificate in the printable encoding format, when the \f3-rfc\fR option is specified\&.
+-
+-The \f3-list\fR command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format\&. If the \f3-rfc\fR option is specified, then the certificate is output in the printable encoding format\&.
+-
+-In its printable encoding format, the encoded certificate is bounded at the beginning and end by the following text:
+-.sp
+-.nf
+-\f3\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3encoded certificate goes here\&. \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3\-\-\-\-\-END CERTIFICATE\-\-\-\-\-\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+-X\&.500 Distinguished Names
+-X\&.500 Distinguished Names are used to identify entities, such as those that are named by the \f3subject\fR and \f3issuer\fR (signer) fields of X\&.509 certificates\&. The \f3keytool\fR command supports the following subparts:
+-
+-\fIcommonName\fR: The common name of a person such as Susan Jones\&.
+-
+-\fIorganizationUnit\fR: The small organization (such as department or division) name\&. For example, Purchasing\&.
+-
+-\fIlocalityName\fR: The locality (city) name, for example, Palo Alto\&.
+-
+-\fIstateName\fR: State or province name, for example, California\&.
+-
+-\fIcountry\fR: Two-letter country code, for example, CH\&.
+-
+-When you supply a distinguished name string as the value of a \f3-dname\fR option, such as for the \f3-genkeypair\fR command, the string must be in the following format:
+-.sp
+-.nf
+-\f3CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-All the italicized items represent actual values and the previous keywords are abbreviations for the following:
+-.sp
+-.nf
+-\f3CN=commonName\fP
+-.fi
+-.nf
+-\f3OU=organizationUnit\fP
+-.fi
+-.nf
+-\f3O=organizationName\fP
+-.fi
+-.nf
+-\f3L=localityName\fP
+-.fi
+-.nf
+-\f3S=stateName\fP
+-.fi
+-.nf
+-\f3C=country\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-A sample distinguished name string is:
+-.sp
+-.nf
+-\f3CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino, S=California, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-A sample command using such a string is:
+-.sp
+-.nf
+-\f3keytool \-genkeypair \-dname "CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino,\fP
+-.fi
+-.nf
+-\f3S=California, C=US" \-alias mark\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Case does not matter for the keyword abbreviations\&. For example, CN, cn, and Cn are all treated the same\&.
+-
+-Order matters; each subcomponent must appear in the designated order\&. However, it is not necessary to have all the subcomponents\&. You can use a subset, for example:
+-.sp
+-.nf
+-\f3CN=Steve Meier, OU=Java, O=Oracle, C=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If a distinguished name string value contains a comma, then the comma must be escaped by a backslash (\e) character when you specify the string on a command line, as in:
+-.sp
+-.nf
+-\f3cn=Peter Schuster, ou=Java\e, Product Development, o=Oracle, c=US\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-It is never necessary to specify a distinguished name string on a command line\&. When the distinguished name is needed for a command, but not supplied on the command line, the user is prompted for each of the subcomponents\&. In this case, a comma does not need to be escaped by a backslash (\e)\&.
+-.SH WARNINGS
+-.SS IMPORTING\ TRUSTED\ CERTIFICATES\ WARNING
+-\fIImportant\fR: Be sure to check a certificate very carefully before importing it as a trusted certificate\&.
+-.PP
+-Windows Example:
+-
+-View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose sends or emails you a certificate that you put it in a file named \f3\etmp\ecert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
+-.sp
+-.nf
+-\f3 keytool \-printcert \-file \etmp\ecert\fP
+-.fi
+-.nf
+-\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Serial Number: 59092b34\fP
+-.fi
+-.nf
+-\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
+-.fi
+-.nf
+-\f3 Certificate Fingerprints:\fP
+-.fi
+-.nf
+-\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
+-.fi
+-.nf
+-\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
+-.fi
+-.nf
+-\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
+-.fi
+-.nf
+-\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
+-.fi
+-.sp
+-
+-.PP
+-Oracle Solaris Example:
+-
+-View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose someone sends or emails you a certificate that you put it in a file named \f3/tmp/cert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
+-.sp
+-.nf
+-\f3 keytool \-printcert \-file /tmp/cert\fP
+-.fi
+-.nf
+-\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
+-.fi
+-.nf
+-\f3 Serial Number: 59092b34\fP
+-.fi
+-.nf
+-\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
+-.fi
+-.nf
+-\f3 Certificate Fingerprints:\fP
+-.fi
+-.nf
+-\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
+-.fi
+-.nf
+-\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
+-.fi
+-.nf
+-\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
+-.fi
+-.nf
+-\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Then call or otherwise contact the person who sent the certificate and compare the fingerprints that you see with the ones that they show\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s certificate such as an attacker\&'s certificate\&. If such an attack took place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker signed, for example, a JAR file with malicious class files inside\&.
+-.PP
+-\fINote:\fR It is not required that you execute a \f3-printcert\fR command before importing a certificate\&. This is because before you add a certificate to the list of trusted certificates in the keystore, the \f3-importcert\fR command prints out the certificate information and prompts you to verify it\&. You can then stop the import operation\&. However, you can do this only when you call the \f3-importcert\fR command without the \f3-noprompt\fR option\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
+-.SS PASSWORDS\ WARNING
+-Most commands that operate on a keystore require the store password\&. Some commands require a private/secret key password\&. Passwords can be specified on the command line in the \f3-storepass\fR and \f3-keypass\fR options\&. However, a password should not be specified on a command line or in a script unless it is for testing, or you are on a secure system\&. When you do not specify a required password option on a command line, you are prompted for it\&.
+-.SS CERTIFICATE\ CONFORMANCE\ WARNING
+-The Internet standard RFC 5280 has defined a profile on conforming X\&.509 certificates, which includes what values and value combinations are valid for certificate fields and extensions\&. See the standard at http://tools\&.ietf\&.org/rfc/rfc5280\&.txt
+-.PP
+-The \f3keytool\fR command does not enforce all of these rules so it can generate certificates that do not conform to the standard\&. Certificates that do not conform to the standard might be rejected by JRE or other applications\&. Users should ensure that they provide the correct options for \f3-dname\fR, \f3-ext\fR, and so on\&.
+-.SH NOTES
+-.SS IMPORT\ A\ NEW\ TRUSTED\ CERTIFICATE
+-Before you add the certificate to the keystore, the \f3keytool\fR command verifies it by attempting to construct a chain of trust from that certificate to a self-signed certificate (belonging to a root CA), using trusted certificates that are already available in the keystore\&.
+-.PP
+-If the \f3-trustcacerts\fR option was specified, then additional certificates are considered for the chain of trust, namely the certificates in a file named \f3cacerts\fR\&.
+-.PP
+-If the \f3keytool\fR command fails to establish a trust path from the certificate to be imported up to a self-signed certificate (either from the keystore or the \f3cacerts\fR file), then the certificate information is printed, and the user is prompted to verify it by comparing the displayed certificate fingerprints with the fingerprints obtained from some other (trusted) source of information, which might be the certificate owner\&. Be very careful to ensure the certificate is valid before importing it as a trusted certificate\&. See Importing Trusted Certificates Warning\&. The user then has the option of stopping the import operation\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
+-.SS IMPORT\ A\ CERTIFICATE\ REPLY
+-When you import a certificate reply, the certificate reply is validated with trusted certificates from the keystore, and optionally, the certificates configured in the \f3cacerts\fR keystore file when the \f3-trustcacert\fR\f3s\fR option is specified\&. See The cacerts Certificates File\&.
+-.PP
+-The methods of determining whether the certificate reply is trusted are as follows:
+-.TP 0.2i
+-\(bu
+-If the reply is a single X\&.509 certificate, then the \f3keytool\fR command attempts to establish a trust chain, starting at the certificate reply and ending at a self-signed certificate (belonging to a root CA)\&. The certificate reply and the hierarchy of certificates is used to authenticate the certificate reply from the new certificate chain of aliases\&. If a trust chain cannot be established, then the certificate reply is not imported\&. In this case, the \f3keytool\fR command does not print the certificate and prompt the user to verify it, because it is very difficult for a user to determine the authenticity of the certificate reply\&.
+-.TP 0.2i
+-\(bu
+-If the reply is a PKCS #7 formatted certificate chain or a sequence of X\&.509 certificates, then the chain is ordered with the user certificate first followed by zero or more CA certificates\&. If the chain ends with a self-signed root CA certificate and the\f3-trustcacerts\fR option was specified, the \f3keytool\fR command attempts to match it with any of the trusted certificates in the keystore or the \f3cacerts\fR keystore file\&. If the chain does not end with a self-signed root CA certificate and the \f3-trustcacerts\fR option was specified, the \f3keytool\fR command tries to find one from the trusted certificates in the keystore or the \f3cacerts\fR keystore file and add it to the end of the chain\&. If the certificate is not found and the \f3-noprompt\fR option is not specified, the information of the last certificate in the chain is printed, and the user is prompted to verify it\&.
+-.PP
+-If the public key in the certificate reply matches the user\&'s public key already stored with \f3alias\fR, then the old certificate chain is replaced with the new certificate chain in the reply\&. The old chain can only be replaced with a valid \f3keypass\fR, and so the password used to protect the private key of the entry is supplied\&. If no password is provided, and the private key password is different from the keystore password, the user is prompted for it\&.
+-.PP
+-This command was named \f3-import\fR in earlier releases\&. This old name is still supported in this release\&. The new name, \f3-importcert\fR, is preferred going forward\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
+-.TP 0.2i
+-\(bu
+-Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
++
++.SH NAME
++keytool \- Manages a keystore (database) of cryptographic keys, X\&.509 certificate chains, and trusted certificates\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBkeytool\fR [\fIcommands\fR]
++.fi
++.sp
++.TP
++\fIcommands\fR
++See Commands\&. These commands are categorized by task as follows:
++.RS
++.TP 0.2i
++\(bu
++Create or Add Data to the Keystore
++.RS
++.TP 0.2i
++\(bu
++-gencert
++.TP 0.2i
++\(bu
++-genkeypair
++.TP 0.2i
++\(bu
++-genseckey
++.TP 0.2i
++\(bu
++-importcert
++.TP 0.2i
++\(bu
++-importpassword
++.RE
++
++.TP 0.2i
++\(bu
++Import Contents From Another Keystore
++.RS
++.TP 0.2i
++\(bu
++-importkeystore
++.RE
++
++.TP 0.2i
++\(bu
++Generate Certificate Request
++.RS
++.TP 0.2i
++\(bu
++-certreq
++.RE
++
++.TP 0.2i
++\(bu
++Export Data
++.RS
++.TP 0.2i
++\(bu
++-exportcert
++.RE
++
++.TP 0.2i
++\(bu
++Display Data
++.RS
++.TP 0.2i
++\(bu
++-list
++.TP 0.2i
++\(bu
++-printcert
++.TP 0.2i
++\(bu
++-printcertreq
++.TP 0.2i
++\(bu
++-printcrl
++.RE
++
++.TP 0.2i
++\(bu
++Manage the Keystore
++.RS
++.TP 0.2i
++\(bu
++-storepasswd
++.TP 0.2i
++\(bu
++-keypasswd
++.TP 0.2i
++\(bu
++-delete
++.TP 0.2i
++\(bu
++-changealias
++.RE
++
++.TP 0.2i
++\(bu
++Get Help
++.RS
++.TP 0.2i
++\(bu
++-help
++.RE
++
++.RE
++
++.SH DESCRIPTION
++The \f3keytool\fR command is a key and certificate management utility\&. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself or herself to other users and services) or data integrity and authentication services, using digital signatures\&. The \f3keytool\fR command also enables users to cache the public keys (in the form of certificates) of their communicating peers\&.
++.PP
++A certificate is a digitally signed statement from one entity (person, company, and so on\&.), that says that the public key (and some other information) of some other entity has a particular value\&. (See Certificate\&.) When data is digitally signed, the signature can be verified to check the data integrity and authenticity\&. Integrity means that the data has not been modified or tampered with, and authenticity means the data comes from whoever claims to have created and signed it\&.
++.PP
++The \f3keytool\fR command also enables users to administer secret keys and passphrases used in symmetric encryption and decryption (DES)\&.
++.PP
++The \f3keytool\fR command stores the keys and certificates in a keystore\&. See KeyStore aliases\&.
++.SH COMMAND\ AND\ OPTION\ NOTES
++See Commands for a listing and description of the various commands\&.
++.TP 0.2i
++\(bu
++All command and option names are preceded by a minus sign (-)\&.
++.TP 0.2i
++\(bu
++The options for each command can be provided in any order\&.
++.TP 0.2i
++\(bu
++All items not italicized or in braces or brackets are required to appear as is\&.
++.TP 0.2i
++\(bu
++Braces surrounding an option signify that a default value will be used when the option is not specified on the command line\&. See Option Defaults\&. Braces are also used around the \f3-v\fR, \f3-rfc\fR, and \f3-J\fR options, which only have meaning when they appear on the command line\&. They do not have any default values other than not existing\&.
++.TP 0.2i
++\(bu
++Brackets surrounding an option signify that the user is prompted for the values when the option is not specified on the command line\&. For the \f3-keypass\fR option, if you do not specify the option on the command line, then the \f3keytool\fR command first attempts to use the keystore password to recover the private/secret key\&. If this attempt fails, then the \f3keytool\fR command prompts you for the private/secret key password\&.
++.TP 0.2i
++\(bu
++Items in italics (option values) represent the actual values that must be supplied\&. For example, here is the format of the \f3-printcert\fR command:
++.sp
++.nf
++\f3keytool \-printcert {\-file \fIcert_file\fR} {\-v}\fP
++.fi
++.sp
++
++
++
++
++When you specify a \f3-printcert\fR command, replace \fIcert_file\fR with the actual file name, as follows: \f3keytool -printcert -file VScert\&.cer\fR
++.TP 0.2i
++\(bu
++Option values must be put in quotation marks when they contain a blank (space)\&.
++.TP 0.2i
++\(bu
++The \f3-help\fR option is the default\&. The \f3keytool\fR command is the same as \f3keytool -help\fR\&.
++.SH OPTION\ DEFAULTS
++The following examples show the defaults for various option values\&.
++.sp
++.nf
++\f3\-alias "mykey"\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keyalg\fP
++.fi
++.nf
++\f3 "DSA" (when using \-genkeypair)\fP
++.fi
++.nf
++\f3 "DES" (when using \-genseckey)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keysize\fP
++.fi
++.nf
++\f3 2048 (when using \-genkeypair and \-keyalg is "RSA")\fP
++.fi
++.nf
++\f3 1024 (when using \-genkeypair and \-keyalg is "DSA")\fP
++.fi
++.nf
++\f3 256 (when using \-genkeypair and \-keyalg is "EC")\fP
++.fi
++.nf
++\f3 56 (when using \-genseckey and \-keyalg is "DES")\fP
++.fi
++.nf
++\f3 168 (when using \-genseckey and \-keyalg is "DESede")\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-validity 90\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-keystore <the file named \&.keystore in the user\&'s home directory>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-storetype <the value of the "keystore\&.type" property in the\fP
++.fi
++.nf
++\f3 security properties file, which is returned by the static\fP
++.fi
++.nf
++\f3 getDefaultType method in java\&.security\&.KeyStore>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-file\fP
++.fi
++.nf
++\f3 stdin (if reading)\fP
++.fi
++.nf
++\f3 stdout (if writing)\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-protected false\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In generating a public/private key pair, the signature algorithm (\f3-sigalg\fR option) is derived from the algorithm of the underlying private key:
++.TP 0.2i
++\(bu
++If the underlying private key is of type DSA, then the \f3-sigalg\fR option defaults to SHA1withDSA\&.
++.TP 0.2i
++\(bu
++If the underlying private key is of type RSA, then the \f3-sigalg\fR option defaults to SHA256withRSA\&.
++.TP 0.2i
++\(bu
++If the underlying private key is of type EC, then the \f3-sigalg\fR option defaults to SHA256withECDSA\&.
++.PP
++For a full list of \f3-keyalg\fR and \f3-sigalg\fR arguments, see Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppA
++.SH COMMON\ OPTIONS
++The \f3-v\fR option can appear for all commands except \f3-help\fR\&. When the \f3-v\fR option appears, it signifies verbose mode, which means that more information is provided in the output\&.
++.PP
++There is also a \f3-Jjavaoption\fR argument that can appear for any command\&. When the \f3-Jjavaoption\fR appears, the specified \f3javaoption\fR string is passed directly to the Java interpreter\&. This option does not contain any spaces\&. It is useful for adjusting the execution environment or memory usage\&. For a list of possible interpreter options, type \f3java -h\fR or \f3java -X\fR at the command line\&.
++.PP
++These options can appear for all commands operating on a keystore:
++.TP
++-storetype \fIstoretype\fR
++.br
++This qualifier specifies the type of keystore to be instantiated\&.
++.TP
++-keystore \fIkeystore\fR
++.br
++The keystore location\&.
++
++If the JKS \f3storetype\fR is used and a keystore file does not yet exist, then certain \f3keytool\fR commands can result in a new keystore file being created\&. For example, if \f3keytool -genkeypair\fR is called and the \f3-keystore\fR option is not specified, the default keystore file named \f3\&.keystore\fR in the user\&'s home directory is created when it does not already exist\&. Similarly, if the \f3-keystore ks_file\fR option is specified but ks_file does not exist, then it is created\&. For more information on the JKS \f3storetype\fR, see the \fIKeyStore Implementation\fR section in KeyStore aliases\&.
++
++Note that the input stream from the \f3-keystore\fR option is passed to the \f3KeyStore\&.load\fR method\&. If \f3NONE\fR is specified as the URL, then a null stream is passed to the \f3KeyStore\&.load\fR method\&. \f3NONE\fR should be specified if the keystore is not file-based\&. For example, when it resides on a hardware token device\&.
++.TP
++-storepass[:\fIenv\fR| :\fIfile\fR] argument
++.br
++The password that is used to protect the integrity of the keystore\&.
++
++If the modifier \f3env\fR or \f3file\fR is not specified, then the password has the \f3value\fR argument, which must be at least 6 characters long\&. Otherwise, the password is retrieved as follows:
++.RS
++.TP 0.2i
++\(bu
++\f3env\fR: Retrieve the password from the environment variable named \f3argument\fR\&.
++.TP 0.2i
++\(bu
++\f3file\fR: Retrieve the password from the file named argument\&.
++.RE
++
++
++\fINote:\fR All other options that require passwords, such as \f3-keypass\fR, \f3-srckeypass\fR, -\f3destkeypass\fR, \f3-srcstorepass\fR, and \f3-deststorepass\fR, accept the \fIenv\fR and \fIfile\fR modifiers\&. Remember to separate the password option and the modifier with a colon (:)\&.
++
++The password must be provided to all commands that access the keystore contents\&. For such commands, when the \f3-storepass\fR option is not provided at the command line, the user is prompted for it\&.
++
++When retrieving information from the keystore, the password is optional\&. If no password is specified, then the integrity of the retrieved information cannot be verified and a warning is displayed\&.
++.TP
++-providerName \fIprovider_name\fR
++.br
++Used to identify a cryptographic service provider\&'s name when listed in the security properties file\&.
++.TP
++-providerClass \fIprovider_class_name\fR
++.br
++Used to specify the name of a cryptographic service provider\&'s master class file when the service provider is not listed in the security properties file\&.
++.TP
++-providerArg \fIprovider_arg\fR
++.br
++Used with the \f3-providerClass\fR option to represent an optional string input argument for the constructor of \f3provider_class_name\fR\&.
++.TP
++-protected
++.br
++Either \f3true\fR or \f3false\fR\&. This value should be specified as \f3true\fR when a password must be specified by way of a protected authentication path such as a dedicated PIN reader\&.Because there are two keystores involved in the \f3-importkeystore\fR command, the following two options \f3-srcprotected\fR and -\f3destprotected\fR are provided for the source keystore and the destination keystore respectively\&.
++.TP
++-ext \fI{name{:critical} {=value}}\fR
++.br
++Denotes an X\&.509 certificate extension\&. The option can be used in \f3-genkeypair\fR and \f3-gencert\fR to embed extensions into the certificate generated, or in \f3-certreq\fR to show what extensions are requested in the certificate request\&. The option can appear multiple times\&. The \f3name\fR argument can be a supported extension name (see Named Extensions) or an arbitrary OID number\&. The \f3value\fR argument, when provided, denotes the argument for the extension\&. When \fIvalue\fR is omitted, that means that the default value of the extension or the extension requires no argument\&. The \f3:critical\fR modifier, when provided, means the extension\&'s \f3isCritical\fR attribute is \f3true\fR; otherwise, it is \f3false\fR\&. You can use \f3:c\fR in place of \f3:critical\fR\&.
++.SH NAMED\ EXTENSIONS
++The \f3keytool\fR command supports these named extensions\&. The names are not case-sensitive)\&.
++.TP
++BC or BasicContraints
++\fIValues\fR: The full form is: \f3ca:{true|false}[,pathlen:<len>]\fR or \f3<len>\fR, which is short for \f3ca:true,pathlen:<len>\fR\&. When <\f3len\fR> is omitted, you have \f3ca:true\fR\&.
++.TP
++KU or KeyUsage
++\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3digitalSignature\fR, \f3nonRepudiation\fR (contentCommitment), \f3keyEncipherment\fR, \f3dataEncipherment\fR, \f3keyAgreement\fR, \f3keyCertSign\fR, \f3cRLSign\fR, \f3encipherOnly\fR, \f3decipherOnly\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters (\f3dig\fR for \f3digitalSignature\fR) or in camel-case style (\f3dS\fR for \f3digitalSignature\fR or \f3cRLS\fR for \f3cRLSign\fR), as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
++.TP
++EKU or ExtendedKeyUsage
++\fIValues\fR: \f3usage\fR(,\f3usage\fR)*, where \fIusage\fR can be one of \f3anyExtendedKeyUsage\fR, \f3serverAuth\fR, \f3clientAuth\fR, \f3codeSigning\fR, \f3emailProtection\fR, \f3timeStamping\fR, \f3OCSPSigning\fR, or any \fIOID string\fR\&. The \fIusage\fR argument can be abbreviated with the first few letters or in camel-case style, as long as no ambiguity is found\&. The \f3usage\fR values are case-sensitive\&.
++.TP
++SAN or SubjectAlternativeName
++\fIValues\fR: \f3type\fR:\f3value\fR(,t\f3ype:value\fR)*, where \f3type\fR can be \f3EMAIL\fR, \f3URI\fR, \f3DNS\fR, \f3IP\fR, or \f3OID\fR\&. The \f3value\fR argument is the string format value for the \f3type\fR\&.
++.TP
++IAN or IssuerAlternativeName
++\fIValues\fR: Same as \f3SubjectAlternativeName\fR\&.
++.TP
++SIA or SubjectInfoAccess
++\fIValues\fR: \f3method\fR:\f3location-type\fR:\f3location-value\fR (,\f3method:location-type\fR:\f3location-value\fR)*, where \f3method\fR can be \f3timeStamping\fR, \f3caRepository\fR or any OID\&. The \f3location-type\fR and \f3location-value\fR arguments can be any \f3type\fR:\f3value\fR supported by the \f3SubjectAlternativeName\fR extension\&.
++.TP
++AIA or AuthorityInfoAccess
++\fIValues\fR: Same as \f3SubjectInfoAccess\fR\&. The \f3method\fR argument can be \f3ocsp\fR,\f3caIssuers\fR, or any OID\&.
++.PP
++When \f3name\fR is OID, the value is the hexadecimal dumped DER encoding of the \f3extnValue\fR for the extension excluding the OCTET STRING type and length bytes\&. Any extra character other than standard hexadecimal numbers (0-9, a-f, A-F) are ignored in the HEX string\&. Therefore, both 01:02:03:04 and 01020304 are accepted as identical values\&. When there is no value, the extension has an empty value field\&.
++.PP
++A special name \f3honored\fR, used in \f3-gencert\fR only, denotes how the extensions included in the certificate request should be honored\&. The value for this name is a comma separated list of \f3all\fR (all requested extensions are honored), \f3name{:[critical|non-critical]}\fR (the named extension is honored, but using a different \f3isCritical\fR attribute) and \f3-name\fR (used with \f3all\fR, denotes an exception)\&. Requested extensions are not honored by default\&.
++.PP
++If, besides the\f3-ext honored\fR option, another named or OID \f3-ext\fR option is provided, this extension is added to those already honored\&. However, if this name (or OID) also appears in the honored value, then its value and criticality overrides the one in the request\&.
++.PP
++The \f3subjectKeyIdentifier\fR extension is always created\&. For non-self-signed certificates, the \f3authorityKeyIdentifier\fR is created\&.
++.PP
++\fINote:\fR Users should be aware that some combinations of extensions (and other certificate fields) may not conform to the Internet standard\&. See Certificate Conformance Warning\&.
++.SH COMMANDS
++.TP
++-gencert
++.sp
++.nf
++\f3{\-rfc} {\-infile \fIinfile\fR} {\-outfile \fIoutfile\fR} {\-alias \fIalias\fR} {\-sigalg \fIsigalg\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-dname \fIdname\fR} {\-startdate \fIstartdate\fR {\-ext \fIext\fR}* {\-validity \fIvalDays\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-keypass \fIkeypass\fR] {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-providername \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a certificate as a response to a certificate request file (which can be created by the \f3keytool\fR\f3-certreq\fR command)\&. The command reads the request from \fIinfile\fR (if omitted, from the standard input), signs it using alias\&'s private key, and outputs the X\&.509 certificate into \fIoutfile\fR (if omitted, to the standard output)\&. When\f3-rfc\fR is specified, the output format is Base64-encoded PEM; otherwise, a binary DER is created\&.
++
++The \f3sigalg\fR value specifies the algorithm that should be used to sign the certificate\&. The \f3startdate\fR argument is the start time and date that the certificate is valid\&. The \f3valDays\fR argument tells the number of days for which the certificate should be considered valid\&.
++
++When \f3dname\fR is provided, it is used as the subject of the generated certificate\&. Otherwise, the one from the certificate request is used\&.
++
++The \f3ext\fR value shows what X\&.509 extensions will be embedded in the certificate\&. Read Common Options for the grammar of \f3-ext\fR\&.
++
++The \f3-gencert\fR option enables you to create certificate chains\&. The following example creates a certificate, \f3e1\fR, that contains three certificates in its certificate chain\&.
++
++The following commands creates four key pairs named \f3ca\fR, \f3ca1\fR, \f3ca2\fR, and \f3e1\fR:
++.sp
++.nf
++\f3keytool \-alias ca \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias ca1 \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias ca2 \-dname CN=CA \-genkeypair\fP
++.fi
++.nf
++\f3keytool \-alias e1 \-dname CN=E1 \-genkeypair\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following two commands create a chain of signed certificates; \f3ca\fR signs \f3ca1\fR and \f3ca1\fR signs \f3ca2\fR, all of which are self-issued:
++.sp
++.nf
++\f3keytool \-alias ca1 \-certreq |\fP
++.fi
++.nf
++\f3 keytool \-alias ca \-gencert \-ext san=dns:ca1 |\fP
++.fi
++.nf
++\f3 keytool \-alias ca1 \-importcert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-alias ca2 \-certreq |\fP
++.fi
++.nf
++\f3 $KT \-alias ca1 \-gencert \-ext san=dns:ca2 |\fP
++.fi
++.nf
++\f3 $KT \-alias ca2 \-importcert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following command creates the certificate \f3e1\fR and stores it in the file \f3e1\&.cert\fR, which is signed by \f3ca2\fR\&. As a result, \f3e1\fR should contain \f3ca\fR, \f3ca1\fR, and \f3ca2\fR in its certificate chain:
++.sp
++.nf
++\f3keytool \-alias e1 \-certreq | keytool \-alias ca2 \-gencert > e1\&.cert\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-genkeypair
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} {\-sigalg \fIsigalg\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-dname \fIdname\fR] [\-keypass \fIkeypass\fR] {\-startdate \fIvalue\fR} {\-ext \fIext\fR}*\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-validity \fIvalDays\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a key pair (a public key and associated private key)\&. Wraps the public key into an X\&.509 v3 self-signed certificate, which is stored as a single-element certificate chain\&. This certificate chain and the private key are stored in a new keystore entry identified by alias\&.
++
++The \f3keyalg\fR value specifies the algorithm to be used to generate the key pair, and the \f3keysize\fR value specifies the size of each key to be generated\&. The \f3sigalg\fR value specifies the algorithm that should be used to sign the self-signed certificate\&. This algorithm must be compatible with the \f3keyalg\fR value\&.
++
++The \f3dname\fR value specifies the X\&.500 Distinguished Name to be associated with the value of \f3alias\fR, and is used as the issuer and subject fields in the self-signed certificate\&. If no distinguished name is provided at the command line, then the user is prompted for one\&.
++
++The value of \f3keypass\fR is a password used to protect the private key of the generated key pair\&. If no password is provided, then the user is prompted for it\&. If you press \fIthe Return key\fR at the prompt, then the key password is set to the same password as the keystore password\&. The \f3keypass\fR value must be at least 6 characters\&.
++
++The value of \f3startdate\fR specifies the issue time of the certificate, also known as the "Not Before" value of the X\&.509 certificate\&'s Validity field\&.
++
++The option value can be set in one of these two forms:
++
++\f3([+-]nnn[ymdHMS])+\fR
++
++\f3[yyyy/mm/dd] [HH:MM:SS]\fR
++
++With the first form, the issue time is shifted by the specified value from the current time\&. The value is a concatenation of a sequence of subvalues\&. Inside each subvalue, the plus sign (+) means shift forward, and the minus sign (-) means shift backward\&. The time to be shifted is \f3nnn\fR units of years, months, days, hours, minutes, or seconds (denoted by a single character of \f3y\fR, \f3m\fR, \f3d\fR, \f3H\fR, \f3M\fR, or \f3S\fR respectively)\&. The exact value of the issue time is calculated using the \f3java\&.util\&.GregorianCalendar\&.add(int field, int amount)\fR method on each subvalue, from left to right\&. For example, by specifying, the issue time will be:
++.sp
++.nf
++\f3Calendar c = new GregorianCalendar();\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.YEAR, \-1);\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.MONTH, 1);\fP
++.fi
++.nf
++\f3c\&.add(Calendar\&.DATE, \-1);\fP
++.fi
++.nf
++\f3return c\&.getTime()\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++With the second form, the user sets the exact issue time in two parts, year/month/day and hour:minute:second (using the local time zone)\&. The user can provide only one part, which means the other part is the same as the current date (or time)\&. The user must provide the exact number of digits as shown in the format definition (padding with 0 when shorter)\&. When both the date and time are provided, there is one (and only one) space character between the two parts\&. The hour should always be provided in 24 hour format\&.
++
++When the option is not provided, the start date is the current time\&. The option can be provided at most once\&.
++
++The value of \f3valDays\fR specifies the number of days (starting at the date specified by \f3-startdate\fR, or the current date when \f3-startdate\fR is not specified) for which the certificate should be considered valid\&.
++
++This command was named \f3-genkey\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-genkeypair\fR, is preferred going forward\&.
++.TP
++-genseckey
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-keyalg \fIkeyalg\fR} {\-keysize \fIkeysize\fR} [\-keypass \fIkeypass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a secret key and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&.
++
++The value of \f3keyalg\fR specifies the algorithm to be used to generate the secret key, and the value of \f3keysize\fR specifies the size of the key to be generated\&. The \f3keypass\fR value is a password that protects the secret key\&. If no password is provided, then the user is prompted for it\&. If you press the Return key at the prompt, then the key password is set to the same password that is used for the \f3keystore\fR\&. The \f3keypass\fR value must be at least 6 characters\&.
++.TP
++-importcert
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} [\-keypass \fIkeypass\fR] {\-noprompt} {\-trustcacerts}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads the certificate or certificate chain (where the latter is supplied in a PKCS#7 formatted reply or a sequence of X\&.509 certificates) from the file \f3cert_file\fR, and stores it in the \f3keystore\fR entry identified by \f3alias\fR\&. If no file is specified, then the certificate or certificate chain is read from \f3stdin\fR\&.
++
++The \f3keytool\fR command can import X\&.509 v1, v2, and v3 certificates, and PKCS#7 formatted certificate chains consisting of certificates of that type\&. The data to be imported must be provided either in binary encoding format or in printable encoding format (also known as Base64 encoding) as defined by the Internet RFC 1421 standard\&. In the latter case, the encoding must be bounded at the beginning by a string that starts with \f3-\fR\f3----BEGIN\fR, and bounded at the end by a string that starts with \f3-----END\fR\&.
++
++You import a certificate for two reasons: To add it to the list of trusted certificates, and to import a certificate reply received from a certificate authority (CA) as the result of submitting a Certificate Signing Request to that CA (see the \f3-certreq\fR option in Commands)\&.
++
++Which type of import is intended is indicated by the value of the \f3-alias\fR option\&. If the alias does not point to a key entry, then the \f3keytool\fR command assumes you are adding a trusted certificate entry\&. In this case, the alias should not already exist in the keystore\&. If the alias does already exist, then the \f3keytool\fR command outputs an error because there is already a trusted certificate for that alias, and does not import the certificate\&. If the alias points to a key entry, then the \f3keytool\fR command assumes you are importing a certificate reply\&.
++.TP
++-importpassword
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Imports a passphrase and stores it in a new \f3KeyStore\&.SecretKeyEntry\fR identified by \f3alias\fR\&. The passphrase may be supplied via the standard input stream; otherwise the user is prompted for it\&. \f3keypass\fR is a password used to protect the imported passphrase\&. If no password is provided, the user is prompted for it\&. If you press the Return key at the prompt, the key password is set to the same password as that used for the \f3keystore\fR\&. \f3keypass\fR must be at least 6 characters long\&.
++.TP
++-importkeystore
++.sp
++.nf
++\f3{\-srcstoretype \fIsrcstoretype\fR} {\-deststoretype \fIdeststoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-srcstorepass \fIsrcstorepass\fR] [\-deststorepass \fIdeststorepass\fR] {\-srcprotected}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-destprotected} \fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-srcalias \fIsrcalias\fR {\-destalias \fIdestalias\fR} [\-srckeypass \fIsrckeypass\fR]} \fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-destkeypass \fIdestkeypass\fR] {\-noprompt}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-srcProviderName \fIsrc_provider_name\fR} {\-destProviderName \fIdest_provider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Imports a single entry or all entries from a source keystore to a destination keystore\&.
++
++When the \f3-srcalias\fR option is provided, the command imports the single entry identified by the alias to the destination keystore\&. If a destination alias is not provided with \f3destalias\fR, then \f3srcalias\fR is used as the destination alias\&. If the source entry is protected by a password, then \f3srckeypass\fR is used to recover the entry\&. If \fIsrckeypass\fR is not provided, then the \f3keytool\fR command attempts to use \f3srcstorepass\fR to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. The destination entry is protected with \f3destkeypass\fR\&. If \f3destkeypass\fR is not provided, then the destination entry is protected with the source entry password\&. For example, most third-party tools require \f3storepass\fR and \f3keypass\fR in a PKCS #12 keystore to be the same\&. In order to create a PKCS #12 keystore for these tools, always specify a \f3-destkeypass\fR to be the same as \f3-deststorepass\fR\&.
++
++If the \f3-srcalias\fR option is not provided, then all entries in the source keystore are imported into the destination keystore\&. Each destination entry is stored under the alias from the source entry\&. If the source entry is protected by a password, then \f3srcstorepass\fR is used to recover the entry\&. If \f3srcstorepass\fR is either not provided or is incorrect, then the user is prompted for a password\&. If a source keystore entry type is not supported in the destination keystore, or if an error occurs while storing an entry into the destination keystore, then the user is prompted whether to skip the entry and continue or to quit\&. The destination entry is protected with the source entry password\&.
++
++If the destination alias already exists in the destination keystore, then the user is prompted to either overwrite the entry or to create a new entry under a different alias name\&.
++
++If the \f3-noprompt\fR option is provided, then the user is not prompted for a new destination alias\&. Existing entries are overwritten with the destination alias name\&. Entries that cannot be imported are skipped and a warning is displayed\&.
++.TP
++-printcertreq
++.sp
++.nf
++\f3{\-file \fIfile\fR}\fP
++.fi
++.sp
++
++
++Prints the content of a PKCS #10 format certificate request, which can be generated by the \f3keytool\fR\f3-certreq\fR command\&. The command reads the request from file\&. If there is no file, then the request is read from the standard input\&.
++.TP
++-certreq
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-dname \fIdname\fR} {\-sigalg \fIsigalg\fR} {\-file \fIcertreq_file\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Generates a Certificate Signing Request (CSR) using the PKCS #10 format\&.
++
++A CSR is intended to be sent to a certificate authority (CA)\&. The CA authenticates the certificate requestor (usually off-line) and will return a certificate or certificate chain, used to replace the existing certificate chain (which initially consists of a self-signed certificate) in the keystore\&.
++
++The private key associated with alias is used to create the PKCS #10 certificate request\&. To access the private key, the correct password must be provided\&. If \f3keypass\fR is not provided at the command line and is different from the password used to protect the integrity of the keystore, then the user is prompted for it\&. If \f3dname\fR is provided, then it is used as the subject in the CSR\&. Otherwise, the X\&.500 Distinguished Name associated with alias is used\&.
++
++The \f3sigalg\fR value specifies the algorithm that should be used to sign the CSR\&.
++
++The CSR is stored in the file certreq_file\&. If no file is specified, then the CSR is output to \f3stdout\fR\&.
++
++Use the \f3importcert\fR command to import the response from the CA\&.
++.TP
++-exportcert
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-file \fIcert_file\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-rfc} {\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads from the keystore the certificate associated with \fIalias\fR and stores it in the cert_file file\&. When no file is specified, the certificate is output to \f3stdout\fR\&.
++
++The certificate is by default output in binary encoding\&. If the \f3-rfc\fR option is specified, then the output in the printable encoding format defined by the Internet RFC 1421 Certificate Encoding Standard\&.
++
++If \f3alias\fR refers to a trusted certificate, then that certificate is output\&. Otherwise, \f3alias\fR refers to a key entry with an associated certificate chain\&. In that case, the first certificate in the chain is returned\&. This certificate authenticates the public key of the entity addressed by \f3alias\fR\&.
++
++This command was named \f3-export\fR in earlier releases\&. The old name is still supported in this release\&. The new name, \f3-exportcert\fR, is preferred going forward\&.
++.TP
++-list
++.sp
++.nf
++\f3{\-alias \fIalias\fR} {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v | \-rfc} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Prints to \f3stdout\fR the contents of the keystore entry identified by \f3alias\fR\&. If no \f3alias\fR is specified, then the contents of the entire keystore are printed\&.
++
++This command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format, with additional information such as the owner, issuer, serial number, and any extensions\&. If the \f3-rfc\fR option is specified, then the certificate contents are printed using the printable encoding format, as defined by the Internet RFC 1421 Certificate Encoding Standard\&.
++
++You cannot specify both \f3-v\fR and \f3-rfc\fR\&.
++.TP
++-printcert
++.sp
++.nf
++\f3{\-file \fIcert_file\fR | \-sslserver \fIhost\fR[:\fIport\fR]} {\-jarfile \fIJAR_file\fR {\-rfc} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Reads the certificate from the file cert_file, the SSL server located at host:port, or the signed JAR file \f3JAR_file\fR (with the \f3-jarfile\fR option and prints its contents in a human-readable format\&. When no port is specified, the standard HTTPS port 443 is assumed\&. Note that \f3-sslserver\fR and -file options cannot be provided at the same time\&. Otherwise, an error is reported\&. If neither option is specified, then the certificate is read from \f3stdin\fR\&.
++
++When\f3-rfc\fR is specified, the \f3keytool\fR command prints the certificate in PEM mode as defined by the Internet RFC 1421 Certificate Encoding standard\&. See Internet RFC 1421 Certificate Encoding Standard\&.
++
++If the certificate is read from a file or \f3stdin\fR, then it might be either binary encoded or in printable encoding format, as defined by the RFC 1421 Certificate Encoding standard\&.
++
++If the SSL server is behind a firewall, then the \f3-J-Dhttps\&.proxyHost=proxyhost\fR and \f3-J-Dhttps\&.proxyPort=proxyport\fR options can be specified on the command line for proxy tunneling\&. See Java Secure Socket Extension (JSSE) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.html
++
++\fINote:\fR This option can be used independently of a keystore\&.
++.TP
++-printcrl
++.sp
++.nf
++\f3\-file \fIcrl_\fR {\-v}\fP
++.fi
++.sp
++
++
++Reads the Certificate Revocation List (CRL) from the file \f3crl_\fR\&. A CRL is a list of digital certificates that were revoked by the CA that issued them\&. The CA generates the \f3crl_\fR file\&.
++
++\fINote:\fR This option can be used independently of a keystore\&.
++.TP
++-storepasswd
++.sp
++.nf
++\f3[\-new \fInew_storepass\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3[\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Changes the password used to protect the integrity of the keystore contents\&. The new password is \f3new_storepass\fR, which must be at least 6 characters\&.
++.TP
++-keypasswd
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-keypass \fIold_keypass\fR] [\-new \fInew_keypass\fR] {\-storetype \fIstoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Changes the password under which the private/secret key identified by \f3alias\fR is protected, from \f3old_keypass\fR to \f3new_keypass\fR, which must be at least 6 characters\&.
++
++If the \f3-keypass\fR option is not provided at the command line, and the key password is different from the keystore password, then the user is prompted for it\&.
++
++If the \f3-new\fR option is not provided at the command line, then the user is prompted for it
++.TP
++-delete
++.sp
++.nf
++\f3[\-alias \fIalias\fR] {\-storetype \fIstoretype\fR} {\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR]\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerName \fIprovider_name\fR} \fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-v} {\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Deletes from the keystore the entry identified by \f3alias\fR\&. The user is prompted for the alias, when no alias is provided at the command line\&.
++.TP
++-changealias
++.sp
++.nf
++\f3{\-alias \fIalias\fR} [\-destalias \fIdestalias\fR] [\-keypass \fIkeypass\fR] {\-storetype \fIstoretype\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-keystore \fIkeystore\fR} [\-storepass \fIstorepass\fR] {\-providerName \fIprovider_name\fR}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-providerClass \fIprovider_class_name\fR {\-providerArg \fIprovider_arg\fR}} {\-v}\fP
++.fi
++.sp
++.sp
++.nf
++\f3{\-protected} {\-Jjavaoption}\fP
++.fi
++.sp
++
++
++Move an existing keystore entry from the specified \f3alias\fR to a new alias, \f3destalias\fR\&. If no destination alias is provided, then the command prompts for one\&. If the original entry is protected with an entry password, then the password can be supplied with the \f3-keypass\fR option\&. If no key password is provided, then the \f3storepass\fR (if provided) is attempted first\&. If the attempt fails, then the user is prompted for a password\&.
++.TP
++-help
++.br
++Lists the basic commands and their options\&.
++
++For more information about a specific command, enter the following, where \f3command_name\fR is the name of the command: \f3keytool -command_name -help\fR\&.
++.SH EXAMPLES
++This example walks through the sequence of steps to create a keystore for managing public/private key pair and certificates from trusted entities\&.
++.SS GENERATE\ THE\ KEY\ PAIR
++First, create a keystore and generate the key pair\&. You can use a command such as the following typed as a single line:
++.sp
++.nf
++\f3keytool \-genkeypair \-dname "cn=Mark Jones, ou=Java, o=Oracle, c=US"\fP
++.fi
++.nf
++\f3 \-alias business \-keypass <new password for private key>\fP
++.fi
++.nf
++\f3 \-keystore /working/mykeystore\fP
++.fi
++.nf
++\f3 \-storepass <new password for keystore> \-validity 180\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The command creates the keystore named \f3mykeystore\fR in the working directory (assuming it does not already exist), and assigns it the password specified by \f3<new password for keystore>\fR\&. It generates a public/private key pair for the entity whose distinguished name has a common name of Mark Jones, organizational unit of Java, organization of Oracle and two-letter country code of US\&. It uses the default DSA key generation algorithm to create the keys; both are 1024 bits\&.
++.PP
++The command uses the default SHA1withDSA signature algorithm to create a self-signed certificate that includes the public key and the distinguished name information\&. The certificate is valid for 180 days, and is associated with the private key in a keystore entry referred to by the alias \f3business\fR\&. The private key is assigned the password specified by \f3<new password for private key>\fR\&.
++.PP
++The command is significantly shorter when the option defaults are accepted\&. In this case, no options are required, and the defaults are used for unspecified options that have default values\&. You are prompted for any required values\&. You could have the following:
++.sp
++.nf
++\f3keytool \-genkeypair\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this case, a keystore entry with the alias \f3mykey\fR is created, with a newly generated key pair and a certificate that is valid for 90 days\&. This entry is placed in the keystore named \f3\&.keystore\fR in your home directory\&. The keystore is created when it does not already exist\&. You are prompted for the distinguished name information, the keystore password, and the private key password\&.
++.PP
++The rest of the examples assume you executed the \f3-genkeypair\fR command without options specified, and that you responded to the prompts with values equal to those specified in the first \f3-genkeypair\fR command\&. For example, a distinguished name of \f3cn=Mark Jones\fR, \f3ou=Java\fR, \f3o=Oracle\fR, \f3c=US\fR)\&.
++.SS REQUEST\ A\ SIGNED\ CERTIFICATE\ FROM\ A\ CA
++Generating the key pair created a self-signed certificate\&. A certificate is more likely to be trusted by others when it is signed by a Certification Authority (CA)\&. To get a CA signature, first generate a Certificate Signing Request (CSR), as follows:
++.sp
++.nf
++\f3keytool \-certreq \-file MarkJ\&.csr\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This creates a CSR for the entity identified by the default alias \f3mykey\fR and puts the request in the file named MarkJ\&.csr\&. Submit this file to a CA, such as VeriSign\&. The CA authenticates you, the requestor (usually off-line), and returns a certificate, signed by them, authenticating your public key\&. In some cases, the CA returns a chain of certificates, each one authenticating the public key of the signer of the previous certificate in the chain\&.
++.SS IMPORT\ A\ CERTIFICATE\ FOR\ THE\ CA
++You now need to replace the self-signed certificate with a certificate chain, where each certificate in the chain authenticates the public key of the signer of the previous certificate in the chain, up to a root CA\&.
++.PP
++Before you import the certificate reply from a CA, you need one or more trusted certificates in your keystore or in the \f3cacerts\fR keystore file\&. See \f3-importcert\fR in Commands\&.
++.TP 0.2i
++\(bu
++If the certificate reply is a certificate chain, then you need the top certificate of the chain\&. The root CA certificate that authenticates the public key of the CA\&.
++.TP 0.2i
++\(bu
++If the certificate reply is a single certificate, then you need a certificate for the issuing CA (the one that signed it)\&. If that certificate is not self-signed, then you need a certificate for its signer, and so on, up to a self-signed root CA certificate\&.
++.PP
++The \f3cacerts\fR keystore file ships with several VeriSign root CA certificates, so you probably will not need to import a VeriSign certificate as a trusted certificate in your keystore\&. But if you request a signed certificate from a different CA, and a certificate authenticating that CA\&'s public key was not added to \f3cacerts\fR, then you must import a certificate from the CA as a trusted certificate\&.
++.PP
++A certificate from a CA is usually either self-signed or signed by another CA, in which case you need a certificate that authenticates that CA\&'s public key\&. Suppose company ABC, Inc\&., is a CA, and you obtain a file named A\f3BCCA\&.cer\fR that is supposed to be a self-signed certificate from ABC, that authenticates that CA\&'s public key\&. Be careful to ensure the certificate is valid before you import it as a trusted certificate\&. View it first with the \f3keytool -printcert\fR command or the \f3keytool -importcert\fR command without the \f3-noprompt\fR option, and make sure that the displayed certificate fingerprints match the expected ones\&. You can call the person who sent the certificate, and compare the fingerprints that you see with the ones that they show or that a secure public key repository shows\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s (for example, an attacker\&'s) certificate\&. If such an attack takes place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker has signed\&.
++.PP
++If you trust that the certificate is valid, then you can add it to your keystore with the following command:
++.sp
++.nf
++\f3keytool \-importcert \-alias abc \-file ABCCA\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This command creates a trusted certificate entry in the keystore, with the data from the file ABCCA\&.cer, and assigns the alias \f3abc\fR to the entry\&.
++.SS IMPORT\ THE\ CERTIFICATE\ REPLY\ FROM\ THE\ CA
++After you import a certificate that authenticates the public key of the CA you submitted your certificate signing request to (or there is already such a certificate in the cacerts file), you can import the certificate reply and replace your self-signed certificate with a certificate chain\&. This chain is the one returned by the CA in response to your request (when the CA reply is a chain), or one constructed (when the CA reply is a single certificate) using the certificate reply and trusted certificates that are already available in the keystore where you import the reply or in the \f3cacerts\fR keystore file\&.
++.PP
++For example, if you sent your certificate signing request to VeriSign, then you can import the reply with the following, which assumes the returned certificate is named VSMarkJ\&.cer:
++.sp
++.nf
++\f3keytool \-importcert \-trustcacerts \-file VSMarkJ\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS EXPORT\ A\ CERTIFICATE\ THAT\ AUTHENTICATES\ THE\ PUBLIC\ KEY
++If you used the \f3jarsigner\fR command to sign a Java Archive (JAR) file, then clients that want to use the file will want to authenticate your signature\&. One way the clients can authenticate you is by first importing your public key certificate into their keystore as a trusted entry\&.
++.PP
++You can export the certificate and supply it to your clients\&. As an example, you can copy your certificate to a file named MJ\&.cer with the following command that assumes the entry has an alias of \f3mykey\fR:
++.sp
++.nf
++\f3keytool \-exportcert \-alias mykey \-file MJ\&.cer\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++With the certificate and the signed JAR file, a client can use the \f3jarsigner\fR command to authenticate your signature\&.
++.SS IMPORT\ KEYSTORE
++The command \f3importkeystore\fR is used to import an entire keystore into another keystore, which means all entries from the source keystore, including keys and certificates, are all imported to the destination keystore within a single command\&. You can use this command to import entries from a different type of keystore\&. During the import, all new entries in the destination keystore will have the same alias names and protection passwords (for secret keys and private keys)\&. If the \f3keytool\fR command cannot recover the private keys or secret keys from the source keystore, then it prompts you for a password\&. If it detects alias duplication, then it asks you for a new alias, and you can specify a new alias or simply allow the \f3keytool\fR command to overwrite the existing one\&.
++.PP
++For example, to import entries from a typical JKS type keystore key\&.jks into a PKCS #11 type hardware-based keystore, use the command:
++.sp
++.nf
++\f3keytool \-importkeystore\fP
++.fi
++.nf
++\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
++.fi
++.nf
++\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
++.fi
++.nf
++\f3 \-srcstorepass <src keystore password>\fP
++.fi
++.nf
++\f3 \-deststorepass <destination keystore pwd>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3importkeystore\fR command can also be used to import a single entry from a source keystore to a destination keystore\&. In this case, besides the options you see in the previous example, you need to specify the alias you want to import\&. With the \f3-srcalias\fR option specified, you can also specify the destination alias name in the command line, as well as protection password for a secret/private key and the destination protection password you want\&. The following command demonstrates this:
++.sp
++.nf
++\f3keytool \-importkeystore\fP
++.fi
++.nf
++\f3 \-srckeystore key\&.jks \-destkeystore NONE\fP
++.fi
++.nf
++\f3 \-srcstoretype JKS \-deststoretype PKCS11\fP
++.fi
++.nf
++\f3 \-srcstorepass <src keystore password>\fP
++.fi
++.nf
++\f3 \-deststorepass <destination keystore pwd>\fP
++.fi
++.nf
++\f3 \-srcalias myprivatekey \-destalias myoldprivatekey\fP
++.fi
++.nf
++\f3 \-srckeypass <source entry password>\fP
++.fi
++.nf
++\f3 \-destkeypass <destination entry password>\fP
++.fi
++.nf
++\f3 \-noprompt\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS GENERATE\ CERTIFICATES\ FOR\ AN\ SSL\ SERVER
++The following are \f3keytool\fR commands to generate key pairs and certificates for three entities: Root CA (\f3root\fR), Intermediate CA (\f3ca\fR), and SSL server (\f3server\fR)\&. Ensure that you store all the certificates in the same keystore\&. In these examples, RSA is the recommended the key algorithm\&.
++.sp
++.nf
++\f3keytool \-genkeypair \-keystore root\&.jks \-alias root \-ext bc:c\fP
++.fi
++.nf
++\f3keytool \-genkeypair \-keystore ca\&.jks \-alias ca \-ext bc:c\fP
++.fi
++.nf
++\f3keytool \-genkeypair \-keystore server\&.jks \-alias server\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-keystore root\&.jks \-alias root \-exportcert \-rfc > root\&.pem\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-storepass <storepass> \-keystore ca\&.jks \-certreq \-alias ca |\fP
++.fi
++.nf
++\f3 keytool \-storepass <storepass> \-keystore root\&.jks\fP
++.fi
++.nf
++\f3 \-gencert \-alias root \-ext BC=0 \-rfc > ca\&.pem\fP
++.fi
++.nf
++\f3keytool \-keystore ca\&.jks \-importcert \-alias ca \-file ca\&.pem\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3keytool \-storepass <storepass> \-keystore server\&.jks \-certreq \-alias server |\fP
++.fi
++.nf
++\f3 keytool \-storepass <storepass> \-keystore ca\&.jks \-gencert \-alias ca\fP
++.fi
++.nf
++\f3 \-ext ku:c=dig,kE \-rfc > server\&.pem\fP
++.fi
++.nf
++\f3cat root\&.pem ca\&.pem server\&.pem |\fP
++.fi
++.nf
++\f3 keytool \-keystore server\&.jks \-importcert \-alias server\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH TERMS
++.TP
++Keystore
++A keystore is a storage facility for cryptographic keys and certificates\&.
++.TP
++Keystore entries
++Keystores can have different types of entries\&. The two most applicable entry types for the \f3keytool\fR command include the following:
++
++\fIKey entries\fR: Each entry holds very sensitive cryptographic key information, which is stored in a protected format to prevent unauthorized access\&. Typically, a key stored in this type of entry is a secret key, or a private key accompanied by the certificate chain for the corresponding public key\&. See Certificate Chains\&. The \f3keytool\fR command can handle both types of entries, while the \f3jarsigner\fR tool only handles the latter type of entry, that is private keys and their associated certificate chains\&.
++
++\fITrusted certificate entries\fR: Each entry contains a single public key certificate that belongs to another party\&. The entry is called a trusted certificate because the keystore owner trusts that the public key in the certificate belongs to the identity identified by the subject (owner) of the certificate\&. The issuer of the certificate vouches for this, by signing the certificate\&.
++.TP
++KeyStore aliases
++All keystore entries (key and trusted certificate entries) are accessed by way of unique aliases\&.
++
++An alias is specified when you add an entity to the keystore with the \f3-genseckey\fR command to generate a secret key, the \f3-genkeypair\fR command to generate a key pair (public and private key), or the \f3-importcert\fR command to add a certificate or certificate chain to the list of trusted certificates\&. Subsequent \f3keytool\fR commands must use this same alias to refer to the entity\&.
++
++For example, you can use the alias \f3duke\fR to generate a new public/private key pair and wrap the public key into a self-signed certificate with the following command\&. See Certificate Chains\&.
++.sp
++.nf
++\f3keytool \-genkeypair \-alias duke \-keypass dukekeypasswd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This example specifies an initial password of \f3dukekeypasswd\fR required by subsequent commands to access the private key associated with the alias \f3duke\fR\&. If you later want to change Duke\&'s private key password, use a command such as the following:
++.sp
++.nf
++\f3keytool \-keypasswd \-alias duke \-keypass dukekeypasswd \-new newpass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This changes the password from \f3dukekeypasswd\fR to \f3newpass\fR\&. A password should not be specified on a command line or in a script unless it is for testing purposes, or you are on a secure system\&. If you do not specify a required password option on a command line, then you are prompted for it\&.
++.TP
++KeyStore implementation
++The \f3KeyStore\fR class provided in the \f3java\&.security\fR package supplies well-defined interfaces to access and modify the information in a keystore\&. It is possible for there to be multiple different concrete implementations, where each implementation is that for a particular type of keystore\&.
++
++Currently, two command-line tools (\f3keytool\fR and \f3jarsigner\fR) and a GUI-based tool named Policy Tool make use of keystore implementations\&. Because the \f3KeyStore\fR class is \f3public\fR, users can write additional security applications that use it\&.
++
++There is a built-in default implementation, provided by Oracle\&. It implements the keystore as a file with a proprietary keystore type (format) named JKS\&. It protects each private key with its individual password, and also protects the integrity of the entire keystore with a (possibly different) password\&.
++
++Keystore implementations are provider-based\&. More specifically, the application interfaces supplied by \f3KeyStore\fR are implemented in terms of a Service Provider Interface (SPI)\&. That is, there is a corresponding abstract \f3KeystoreSpi\fR class, also in the \f3java\&.security package\fR, which defines the Service Provider Interface methods that providers must implement\&. The term \fIprovider\fR refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API\&. To provide a keystore implementation, clients must implement a provider and supply a \f3KeystoreSpi\fR subclass implementation, as described in How to Implement a Provider in the Java Cryptography Architecture at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.html
++
++Applications can choose different types of keystore implementations from different providers, using the \f3getInstance\fR factory method supplied in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private/secret keys in the keystore and the integrity of the keystore\&. Keystore implementations of different types are not compatible\&.
++
++The \f3keytool\fR command works on any file-based keystore implementation\&. It treats the keystore location that is passed to it at the command line as a file name and converts it to a \f3FileInputStream\fR, from which it loads the keystore information\&.)The \f3jarsigner\fR and \f3policytool\fR commands can read a keystore from any location that can be specified with a URL\&.
++
++For \f3keytool\fR and \f3jarsigner\fR, you can specify a keystore type at the command line, with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIKeystore\fR menu\&.
++
++If you do not explicitly specify a keystore type, then the tools choose a keystore implementation based on the value of the \f3keystore\&.type\fR property specified in the security properties file\&. The security properties file is called \f3java\&.security\fR, and resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment directory\&. The \f3jre\fR directory in the SDK or the top-level directory of the Java Runtime Environment (JRE)\&.
++
++Each tool gets the \f3keystore\&.type\fR value and then examines all the currently installed providers until it finds one that implements a keystores of that type\&. It then uses the keystore implementation from that provider\&.The \f3KeyStore\fR class defines a static method named \f3getDefaultType\fR that lets applications and applets retrieve the value of the \f3keystore\&.type\fR property\&. The following line of code creates an instance of the default keystore type as specified in the \f3keystore\&.type\fR property:
++.sp
++.nf
++\f3KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType());\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The default keystore type is \f3jks\fR, which is the proprietary type of the keystore implementation provided by Oracle\&. This is specified by the following line in the security properties file:
++.sp
++.nf
++\f3keystore\&.type=jks\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++To have the tools utilize a keystore implementation other than the default, you can change that line to specify a different keystore type\&. For example, if you have a provider package that supplies a keystore implementation for a keystore type called \f3pkcs12\fR, then change the line to the following:
++.sp
++.nf
++\f3keystore\&.type=pkcs12\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++\fINote:\fR Case does not matter in keystore type designations\&. For example, JKS would be considered the same as jks\&.
++.TP
++Certificate
++A certificate (or public-key certificate) is a digitally signed statement from one entity (the issuer), saying that the public key and some other information of another entity (the subject) has some specific value\&. The following terms are related to certificates:
++
++\fIPublic Keys\fR: These are numbers associated with a particular entity, and are intended to be known to everyone who needs to have trusted interactions with that entity\&. Public keys are used to verify signatures\&.
++
++\fIDigitally Signed\fR: If some data is digitally signed, then it is stored with the identity of an entity and a signature that proves that entity knows about the data\&. The data is rendered unforgeable by signing with the entity\&'s private key\&.
++
++\fIIdentity\fR: A known way of addressing an entity\&. In some systems, the identity is the public key, and in others it can be anything from an Oracle Solaris UID to an email address to an X\&.509 distinguished name\&.
++
++\fISignature\fR: A signature is computed over some data using the private key of an entity\&. The signer, which in the case of a certificate is also known as the issuer\&.
++
++\fIPrivate Keys\fR: These are numbers, each of which is supposed to be known only to the particular entity whose private key it is (that is, it is supposed to be kept secret)\&. Private and public keys exist in pairs in all public key cryptography systems (also referred to as public key crypto systems)\&. In a typical public key crypto system, such as DSA, a private key corresponds to exactly one public key\&. Private keys are used to compute signatures\&.
++
++\fIEntity\fR: An entity is a person, organization, program, computer, business, bank, or something else you are trusting to some degree\&.
++
++Public key cryptography requires access to users\&' public keys\&. In a large-scale networked environment, it is impossible to guarantee that prior relationships between communicating entities were established or that a trusted repository exists with all used public keys\&. Certificates were invented as a solution to this public key distribution problem\&. Now a Certification Authority (CA) can act as a trusted third party\&. CAs are entities such as businesses that are trusted to sign (issue) certificates for other entities\&. It is assumed that CAs only create valid and reliable certificates because they are bound by legal agreements\&. There are many public Certification Authorities, such as VeriSign, Thawte, Entrust, and so on\&.
++
++You can also run your own Certification Authority using products such as Microsoft Certificate Server or the Entrust CA product for your organization\&. With the \f3keytool\fR command, it is possible to display, import, and export certificates\&. It is also possible to generate self-signed certificates\&.
++
++The \f3keytool\fR command currently handles X\&.509 certificates\&.
++.TP
++X\&.509 Certificates
++The X\&.509 standard defines what information can go into a certificate and describes how to write it down (the data format)\&. All the data in a certificate is encoded with two related standards called ASN\&.1/DER\&. Abstract Syntax Notation 1 describes data\&. The Definite Encoding Rules describe a single way to store and transfer that data\&.
++
++All X\&.509 certificates have the following data, in addition to the signature:
++
++\fIVersion\fR: This identifies which version of the X\&.509 standard applies to this certificate, which affects what information can be specified in it\&. Thus far, three versions are defined\&. The \f3keytool\fR command can import and export v1, v2, and v3 certificates\&. It generates v3 certificates\&.
++
++X\&.509 Version 1 has been available since 1988, is widely deployed, and is the most generic\&.
++
++X\&.509 Version 2 introduced the concept of subject and issuer unique identifiers to handle the possibility of reuse of subject or issuer names over time\&. Most certificate profile documents strongly recommend that names not be reused and that certificates should not make use of unique identifiers\&. Version 2 certificates are not widely used\&.
++
++X\&.509 Version 3 is the most recent (1996) and supports the notion of extensions where anyone can define an extension and include it in the certificate\&. Some common extensions are: KeyUsage (limits the use of the keys to particular purposes such as \f3signing-only\fR) and AlternativeNames (allows other identities to also be associated with this public key, for example\&. DNS names, email addresses, IP addresses)\&. Extensions can be marked critical to indicate that the extension should be checked and enforced or used\&. For example, if a certificate has the KeyUsage extension marked critical and set to \f3keyCertSign\fR, then when this certificate is presented during SSL communication, it should be rejected because the certificate extension indicates that the associated private key should only be used for signing certificates and not for SSL use\&.
++
++\fISerial number\fR: The entity that created the certificate is responsible for assigning it a serial number to distinguish it from other certificates it issues\&. This information is used in numerous ways\&. For example, when a certificate is revoked its serial number is placed in a Certificate Revocation List (CRL)\&.
++
++\fISignature algorithm identifier\fR: This identifies the algorithm used by the CA to sign the certificate\&.
++
++\fIIssuer name\fR: The X\&.500 Distinguished Name of the entity that signed the certificate\&. See X\&.500 Distinguished Names\&. This is typically a CA\&. Using this certificate implies trusting the entity that signed this certificate\&. In some cases, such as root or top-level CA certificates, the issuer signs its own certificate\&.
++
++\fIValidity period\fR: Each certificate is valid only for a limited amount of time\&. This period is described by a start date and time and an end date and time, and can be as short as a few seconds or almost as long as a century\&. The validity period chosen depends on a number of factors, such as the strength of the private key used to sign the certificate, or the amount one is willing to pay for a certificate\&. This is the expected period that entities can rely on the public value, when the associated private key has not been compromised\&.
++
++\fISubject name\fR: The name of the entity whose public key the certificate identifies\&. This name uses the X\&.500 standard, so it is intended to be unique across the Internet\&. This is the X\&.500 Distinguished Name (DN) of the entity\&. See X\&.500 Distinguished Names\&. For example,
++.sp
++.nf
++\f3CN=Java Duke, OU=Java Software Division, O=Oracle Corporation, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++These refer to the subject\&'s common name (CN), organizational unit (OU), organization (O), and country (C)\&.
++
++\fISubject public key information\fR: This is the public key of the entity being named with an algorithm identifier that specifies which public key crypto system this key belongs to and any associated key parameters\&.
++.TP
++Certificate Chains
++The \f3keytool\fR command can create and manage keystore key entries that each contain a private key and an associated certificate chain\&. The first certificate in the chain contains the public key that corresponds to the private key\&.
++
++When keys are first generated, the chain starts off containing a single element, a self-signed certificate\&. See \f3-genkeypair\fR in Commands\&. A self-signed certificate is one for which the issuer (signer) is the same as the subject\&. The subject is the entity whose public key is being authenticated by the certificate\&. Whenever the \f3-genkeypair\fR command is called to generate a new public/private key pair, it also wraps the public key into a self-signed certificate\&.
++
++Later, after a Certificate Signing Request (CSR) was generated with the \f3-certreq\fR command and sent to a Certification Authority (CA), the response from the CA is imported with \f3-importcert\fR, and the self-signed certificate is replaced by a chain of certificates\&. See the \f3-certreq\fR and \f3-importcert\fR options in Commands\&. At the bottom of the chain is the certificate (reply) issued by the CA authenticating the subject\&'s public key\&. The next certificate in the chain is one that authenticates the CA\&'s public key\&.
++
++In many cases, this is a self-signed certificate, which is a certificate from the CA authenticating its own public key, and the last certificate in the chain\&. In other cases, the CA might return a chain of certificates\&. In this case, the bottom certificate in the chain is the same (a certificate signed by the CA, authenticating the public key of the key entry), but the second certificate in the chain is a certificate signed by a different CA that authenticates the public key of the CA you sent the CSR to\&. The next certificate in the chain is a certificate that authenticates the second CA\&'s key, and so on, until a self-signed root certificate is reached\&. Each certificate in the chain (after the first) authenticates the public key of the signer of the previous certificate in the chain\&.
++
++Many CAs only return the issued certificate, with no supporting chain, especially when there is a flat hierarchy (no intermediates CAs)\&. In this case, the certificate chain must be established from trusted certificate information already stored in the keystore\&.
++
++A different reply format (defined by the PKCS #7 standard) includes the supporting certificate chain in addition to the issued certificate\&. Both reply formats can be handled by the \f3keytool\fR command\&.
++
++The top-level (root) CA certificate is self-signed\&. However, the trust into the root\&'s public key does not come from the root certificate itself, but from other sources such as a newspaper\&. This is because anybody could generate a self-signed certificate with the distinguished name of, for example, the VeriSign root CA\&. The root CA public key is widely known\&. The only reason it is stored in a certificate is because this is the format understood by most tools, so the certificate in this case is only used as a vehicle to transport the root CA\&'s public key\&. Before you add the root CA certificate to your keystore, you should view it with the \f3-printcert\fR option and compare the displayed fingerprint with the well-known fingerprint obtained from a newspaper, the root CA\&'s Web page, and so on\&.
++.TP
++The cacerts Certificates File
++A certificates file named \f3cacerts\fR resides in the security properties directory, \f3java\&.home\elib\esecurity\fR on Windows and \f3java\&.home/lib/security\fR on Oracle Solaris, where \f3java\&.home\fR is the runtime environment\&'s directory, which would be the \f3jre\fR directory in the SDK or the top-level directory of the JRE\&.
++
++The \f3cacerts\fR file represents a system-wide keystore with CA certificates\&. System administrators can configure and manage that file with the \f3keytool\fR command by specifying \f3jks\fR as the keystore type\&. The \f3cacerts\fR keystore file ships with a default set of root CA certificates\&. You can list the default certificates with the following command:
++.sp
++.nf
++\f3keytool \-list \-keystore java\&.home/lib/security/cacerts\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The initial password of the \f3cacerts\fR keystore file is \f3changeit\fR\&. System administrators should change that password and the default access permission of that file upon installing the SDK\&.
++
++\fINote:\fR It is important to verify your \f3cacerts\fR file\&. Because you trust the CAs in the \f3cacerts\fR file as entities for signing and issuing certificates to other entities, you must manage the \f3cacerts\fR file carefully\&. The \f3cacerts\fR file should contain only certificates of the CAs you trust\&. It is your responsibility to verify the trusted root CA certificates bundled in the \f3cacerts\fR file and make your own trust decisions\&.
++
++To remove an untrusted CA certificate from the \f3cacerts\fR file, use the \f3delete\fR option of the \f3keytool\fR command\&. You can find the \f3cacerts\fR file in the JRE installation directory\&. Contact your system administrator if you do not have permission to edit this file
++.TP
++Internet RFC 1421 Certificate Encoding Standard
++Certificates are often stored using the printable encoding format defined by the Internet RFC 1421 standard, instead of their binary encoding\&. This certificate format, also known as Base64 encoding, makes it easy to export certificates to other applications by email or through some other mechanism\&.
++
++Certificates read by the \f3-importcert\fR and \f3-printcert\fR commands can be in either this format or binary encoded\&. The \f3-exportcert\fR command by default outputs a certificate in binary encoding, but will instead output a certificate in the printable encoding format, when the \f3-rfc\fR option is specified\&.
++
++The \f3-list\fR command by default prints the SHA1 fingerprint of a certificate\&. If the \f3-v\fR option is specified, then the certificate is printed in human-readable format\&. If the \f3-rfc\fR option is specified, then the certificate is output in the printable encoding format\&.
++
++In its printable encoding format, the encoded certificate is bounded at the beginning and end by the following text:
++.sp
++.nf
++\f3\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3encoded certificate goes here\&. \fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3\-\-\-\-\-END CERTIFICATE\-\-\-\-\-\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++X\&.500 Distinguished Names
++X\&.500 Distinguished Names are used to identify entities, such as those that are named by the \f3subject\fR and \f3issuer\fR (signer) fields of X\&.509 certificates\&. The \f3keytool\fR command supports the following subparts:
++
++\fIcommonName\fR: The common name of a person such as Susan Jones\&.
++
++\fIorganizationUnit\fR: The small organization (such as department or division) name\&. For example, Purchasing\&.
++
++\fIlocalityName\fR: The locality (city) name, for example, Palo Alto\&.
++
++\fIstateName\fR: State or province name, for example, California\&.
++
++\fIcountry\fR: Two-letter country code, for example, CH\&.
++
++When you supply a distinguished name string as the value of a \f3-dname\fR option, such as for the \f3-genkeypair\fR command, the string must be in the following format:
++.sp
++.nf
++\f3CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++All the italicized items represent actual values and the previous keywords are abbreviations for the following:
++.sp
++.nf
++\f3CN=commonName\fP
++.fi
++.nf
++\f3OU=organizationUnit\fP
++.fi
++.nf
++\f3O=organizationName\fP
++.fi
++.nf
++\f3L=localityName\fP
++.fi
++.nf
++\f3S=stateName\fP
++.fi
++.nf
++\f3C=country\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++A sample distinguished name string is:
++.sp
++.nf
++\f3CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino, S=California, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++A sample command using such a string is:
++.sp
++.nf
++\f3keytool \-genkeypair \-dname "CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino,\fP
++.fi
++.nf
++\f3S=California, C=US" \-alias mark\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Case does not matter for the keyword abbreviations\&. For example, CN, cn, and Cn are all treated the same\&.
++
++Order matters; each subcomponent must appear in the designated order\&. However, it is not necessary to have all the subcomponents\&. You can use a subset, for example:
++.sp
++.nf
++\f3CN=Steve Meier, OU=Java, O=Oracle, C=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If a distinguished name string value contains a comma, then the comma must be escaped by a backslash (\e) character when you specify the string on a command line, as in:
++.sp
++.nf
++\f3cn=Peter Schuster, ou=Java\e, Product Development, o=Oracle, c=US\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++It is never necessary to specify a distinguished name string on a command line\&. When the distinguished name is needed for a command, but not supplied on the command line, the user is prompted for each of the subcomponents\&. In this case, a comma does not need to be escaped by a backslash (\e)\&.
++.SH WARNINGS
++.SS IMPORTING\ TRUSTED\ CERTIFICATES\ WARNING
++\fIImportant\fR: Be sure to check a certificate very carefully before importing it as a trusted certificate\&.
++.PP
++Windows Example:
++
++View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose sends or emails you a certificate that you put it in a file named \f3\etmp\ecert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
++.sp
++.nf
++\f3 keytool \-printcert \-file \etmp\ecert\fP
++.fi
++.nf
++\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Serial Number: 59092b34\fP
++.fi
++.nf
++\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
++.fi
++.nf
++\f3 Certificate Fingerprints:\fP
++.fi
++.nf
++\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
++.fi
++.nf
++\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
++.fi
++.nf
++\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
++.fi
++.nf
++\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
++.fi
++.sp
++
++.PP
++Oracle Solaris Example:
++
++View the certificate first with the \f3-printcert\fR command or the \f3-importcert\fR command without the \f3-noprompt\fR option\&. Ensure that the displayed certificate fingerprints match the expected ones\&. For example, suppose someone sends or emails you a certificate that you put it in a file named \f3/tmp/cert\fR\&. Before you consider adding the certificate to your list of trusted certificates, you can execute a \f3-printcert\fR command to view its fingerprints, as follows:
++.sp
++.nf
++\f3 keytool \-printcert \-file /tmp/cert\fP
++.fi
++.nf
++\f3 Owner: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Issuer: CN=ll, OU=ll, O=ll, L=ll, S=ll, C=ll\fP
++.fi
++.nf
++\f3 Serial Number: 59092b34\fP
++.fi
++.nf
++\f3 Valid from: Thu Sep 25 18:01:13 PDT 1997 until: Wed Dec 24 17:01:13 PST 1997\fP
++.fi
++.nf
++\f3 Certificate Fingerprints:\fP
++.fi
++.nf
++\f3 MD5: 11:81:AD:92:C8:E5:0E:A2:01:2E:D4:7A:D7:5F:07:6F\fP
++.fi
++.nf
++\f3 SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE\fP
++.fi
++.nf
++\f3 SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:\fP
++.fi
++.nf
++\f3 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Then call or otherwise contact the person who sent the certificate and compare the fingerprints that you see with the ones that they show\&. Only when the fingerprints are equal is it guaranteed that the certificate was not replaced in transit with somebody else\&'s certificate such as an attacker\&'s certificate\&. If such an attack took place, and you did not check the certificate before you imported it, then you would be trusting anything the attacker signed, for example, a JAR file with malicious class files inside\&.
++.PP
++\fINote:\fR It is not required that you execute a \f3-printcert\fR command before importing a certificate\&. This is because before you add a certificate to the list of trusted certificates in the keystore, the \f3-importcert\fR command prints out the certificate information and prompts you to verify it\&. You can then stop the import operation\&. However, you can do this only when you call the \f3-importcert\fR command without the \f3-noprompt\fR option\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
++.SS PASSWORDS\ WARNING
++Most commands that operate on a keystore require the store password\&. Some commands require a private/secret key password\&. Passwords can be specified on the command line in the \f3-storepass\fR and \f3-keypass\fR options\&. However, a password should not be specified on a command line or in a script unless it is for testing, or you are on a secure system\&. When you do not specify a required password option on a command line, you are prompted for it\&.
++.SS CERTIFICATE\ CONFORMANCE\ WARNING
++The Internet standard RFC 5280 has defined a profile on conforming X\&.509 certificates, which includes what values and value combinations are valid for certificate fields and extensions\&. See the standard at http://tools\&.ietf\&.org/rfc/rfc5280\&.txt
++.PP
++The \f3keytool\fR command does not enforce all of these rules so it can generate certificates that do not conform to the standard\&. Certificates that do not conform to the standard might be rejected by JRE or other applications\&. Users should ensure that they provide the correct options for \f3-dname\fR, \f3-ext\fR, and so on\&.
++.SH NOTES
++.SS IMPORT\ A\ NEW\ TRUSTED\ CERTIFICATE
++Before you add the certificate to the keystore, the \f3keytool\fR command verifies it by attempting to construct a chain of trust from that certificate to a self-signed certificate (belonging to a root CA), using trusted certificates that are already available in the keystore\&.
++.PP
++If the \f3-trustcacerts\fR option was specified, then additional certificates are considered for the chain of trust, namely the certificates in a file named \f3cacerts\fR\&.
++.PP
++If the \f3keytool\fR command fails to establish a trust path from the certificate to be imported up to a self-signed certificate (either from the keystore or the \f3cacerts\fR file), then the certificate information is printed, and the user is prompted to verify it by comparing the displayed certificate fingerprints with the fingerprints obtained from some other (trusted) source of information, which might be the certificate owner\&. Be very careful to ensure the certificate is valid before importing it as a trusted certificate\&. See Importing Trusted Certificates Warning\&. The user then has the option of stopping the import operation\&. If the \f3-noprompt\fR option is specified, then there is no interaction with the user\&.
++.SS IMPORT\ A\ CERTIFICATE\ REPLY
++When you import a certificate reply, the certificate reply is validated with trusted certificates from the keystore, and optionally, the certificates configured in the \f3cacerts\fR keystore file when the \f3-trustcacert\fR\f3s\fR option is specified\&. See The cacerts Certificates File\&.
++.PP
++The methods of determining whether the certificate reply is trusted are as follows:
++.TP 0.2i
++\(bu
++If the reply is a single X\&.509 certificate, then the \f3keytool\fR command attempts to establish a trust chain, starting at the certificate reply and ending at a self-signed certificate (belonging to a root CA)\&. The certificate reply and the hierarchy of certificates is used to authenticate the certificate reply from the new certificate chain of aliases\&. If a trust chain cannot be established, then the certificate reply is not imported\&. In this case, the \f3keytool\fR command does not print the certificate and prompt the user to verify it, because it is very difficult for a user to determine the authenticity of the certificate reply\&.
++.TP 0.2i
++\(bu
++If the reply is a PKCS #7 formatted certificate chain or a sequence of X\&.509 certificates, then the chain is ordered with the user certificate first followed by zero or more CA certificates\&. If the chain ends with a self-signed root CA certificate and the\f3-trustcacerts\fR option was specified, the \f3keytool\fR command attempts to match it with any of the trusted certificates in the keystore or the \f3cacerts\fR keystore file\&. If the chain does not end with a self-signed root CA certificate and the \f3-trustcacerts\fR option was specified, the \f3keytool\fR command tries to find one from the trusted certificates in the keystore or the \f3cacerts\fR keystore file and add it to the end of the chain\&. If the certificate is not found and the \f3-noprompt\fR option is not specified, the information of the last certificate in the chain is printed, and the user is prompted to verify it\&.
++.PP
++If the public key in the certificate reply matches the user\&'s public key already stored with \f3alias\fR, then the old certificate chain is replaced with the new certificate chain in the reply\&. The old chain can only be replaced with a valid \f3keypass\fR, and so the password used to protect the private key of the entry is supplied\&. If no password is provided, and the private key password is different from the keystore password, the user is prompted for it\&.
++.PP
++This command was named \f3-import\fR in earlier releases\&. This old name is still supported in this release\&. The new name, \f3-importcert\fR, is preferred going forward\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
++.TP 0.2i
++\(bu
++Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/native2ascii.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/native2ascii.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Internationalization Tools
+-.\" Title: native2ascii.1
+-.\"
+-.if n .pl 99999
+-.TH native2ascii 1 "21 November 2013" "JDK 8" "Internationalization Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Internationalization Tools
++.\" Title: native2ascii.1
++.\"
++.if n .pl 99999
++.TH native2ascii 1 "21 November 2013" "JDK 8" "Internationalization Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,39 +47,39 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-native2ascii \- Creates localizable applications by converting a file with characters in any supported character encoding to one with ASCII and/or Unicode escapes or vice versa\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBnative2ascii\fR [ \fIinputfile\fR ] [ \fIoutputfile\fR ]
+-.fi
+-.sp
+-.TP
+-\fIinputfile\fR
+-The encoded file to be converted to ASCII\&.
+-.TP
+-\fIoutputfile\fR
+-The converted ASCII file\&.
+-.SH DESCRIPTION
+-The \f3native2ascii\fR command converts encoded files supported by the Java Runtime Environment (JRE) to files encoded in ASCII, using Unicode escapes (\f3\eu\fR\fIxxxx\fR) notation for all characters that are not part of the ASCII character set\&. This process is required for properties files that contain characters not in ISO-8859-1 character sets\&. The tool can also perform the reverse conversion\&.
+-.PP
+-If the \f3outputfile\fR value is omitted, then standard output is used for output\&. If, in addition, the \f3inputfile\fR value is omitted, then standard input is used for input\&.
+-.SH OPTIONS
+-.TP
+--reverse
+-.br
+-Perform the reverse operation: Converts a file encoded in ISO-8859-1 with Unicode escapes to a file in any character encoding supported by the JRE\&.
+-.TP
+--encoding \fIencoding_name\fR
+-.br
+-Specifies the name of the character encoding to be used by the conversion procedure\&. If this option is not present, then the default character encoding (as determined by the \f3java\&.nio\&.charset\&.Charset\&.defaultCharset\fR method) is used\&. The \f3encoding_name\fR string must be the name of a character encoding that is supported by the JRE\&. See Supported Encodings at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.html
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++
++.SH NAME
++native2ascii \- Creates localizable applications by converting a file with characters in any supported character encoding to one with ASCII and/or Unicode escapes or vice versa\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBnative2ascii\fR [ \fIinputfile\fR ] [ \fIoutputfile\fR ]
++.fi
++.sp
++.TP
++\fIinputfile\fR
++The encoded file to be converted to ASCII\&.
++.TP
++\fIoutputfile\fR
++The converted ASCII file\&.
++.SH DESCRIPTION
++The \f3native2ascii\fR command converts encoded files supported by the Java Runtime Environment (JRE) to files encoded in ASCII, using Unicode escapes (\f3\eu\fR\fIxxxx\fR) notation for all characters that are not part of the ASCII character set\&. This process is required for properties files that contain characters not in ISO-8859-1 character sets\&. The tool can also perform the reverse conversion\&.
++.PP
++If the \f3outputfile\fR value is omitted, then standard output is used for output\&. If, in addition, the \f3inputfile\fR value is omitted, then standard input is used for input\&.
++.SH OPTIONS
++.TP
++-reverse
++.br
++Perform the reverse operation: Converts a file encoded in ISO-8859-1 with Unicode escapes to a file in any character encoding supported by the JRE\&.
++.TP
++-encoding \fIencoding_name\fR
++.br
++Specifies the name of the character encoding to be used by the conversion procedure\&. If this option is not present, then the default character encoding (as determined by the \f3java\&.nio\&.charset\&.Charset\&.defaultCharset\fR method) is used\&. The \f3encoding_name\fR string must be the name of a character encoding that is supported by the JRE\&. See Supported Encodings at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.html
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/orbd.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/orbd.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: orbd.1
+-.\"
+-.if n .pl 99999
+-.TH orbd 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: orbd.1
++.\"
++.if n .pl 99999
++.TH orbd 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,166 +47,166 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-orbd \- Enables clients to locate and call persistent objects on servers in the CORBA environment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBorbd\fR [ \fIoptions\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-Command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3orbd\fR command enables clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The Server Manager included with the orbd tool is used to enable clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The persistent servers, while publishing the persistent object references in the naming service, include the port number of the ORBD in the object reference instead of the port number of the server\&. The inclusion of an ORBD port number in the object reference for persistent object references has the following advantages:
+-.TP 0.2i
+-\(bu
+-The object reference in the naming service remains independent of the server life cycle\&. For example, the object reference could be published by the server in the Naming Service when it is first installed, and then, independent of how many times the server is started or shut down, the ORBD returns the correct object reference to the calling client\&.
+-.TP 0.2i
+-\(bu
+-The client needs to look up the object reference in the naming service only once, and can keep reusing this reference independent of the changes introduced due to server life cycle\&.
+-.PP
+-To access the ORBD Server Manager, the server must be started using \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. For more information on the Server Manager, see Server Manager\&.
+-.PP
+-When \f3orbd\fR starts, it also starts a naming service\&. For more information about the naming service\&. See Start and Stop the Naming Service\&.
+-.SH OPTIONS
+-.TP
+--ORBInitialPort \fInameserverport\fR
+-.br
+-Required\&. Specifies the port on which the name server should be started\&. After it is started, \f3orbd\fR listens for incoming requests on this port\&. On Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, Oracle recommends that you use a port number above or equal to 1024\&.
+-.SS NONREQUIRED\ OPTIONS
+-.TP
+--port \fIport\fR
+-.br
+-Specifies the activation port where ORBD should be started, and where ORBD will be accepting requests for persistent objects\&. The default value for this port is 1049\&. This port number is added to the port field of the persistent Interoperable Object References (IOR)\&.
+-.TP
+--defaultdb \fIdirectory\fR
+-.br
+-Specifies the base where the ORBD persistent storage directory, \f3orb\&.db\fR, is created\&. If this option is not specified, then the default value is \f3\&./orb\&.db\fR\&.
+-.TP
+--serverPollingTime \fImilliseconds\fR
+-.br
+-Specifies how often ORBD checks for the health of persistent servers registered through \f3servertool\fR\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
+-.TP
+--serverStartupDelay milliseconds
+-.br
+-Specifies how long ORBD waits before sending a location forward exception after a persistent server that is registered through \f3servertool\fR is restarted\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SS START\ AND\ STOP\ THE\ NAMING\ SERVICE
+-A naming service is a CORBA service that allows CORBA objects to be named by means of binding a name to an object reference\&. The name binding can be stored in the naming service, and a client can supply the name to obtain the desired object reference\&.
+-.PP
+-Before running a client or a server, you will start ORBD\&. ORBD includes a persistent naming service and a transient naming service, both of which are an implementation of the COS Naming Service\&.
+-.PP
+-The Persistent Naming Service provides persistence for naming contexts\&. This means that this information is persistent across service shutdowns and startups, and is recoverable in the event of a service failure\&. If ORBD is restarted, then the Persistent Naming Service restores the naming context graph, so that the binding of all clients\&' and servers\&' names remains intact (persistent)\&.
+-.PP
+-For backward compatibility, \f3tnameserv\fR, a Transient Naming Service that shipped with earlier releases of the JDK, is also included in this release of Java SE\&. A transient naming service retains naming contexts as long as it is running\&. If there is a service interruption, then the naming context graph is lost\&.
+-.PP
+-The \f3-ORBInitialPort\fR argument is a required command-line argument for \f3orbd\fR, and is used to set the port number on which the naming service runs\&. The following instructions assume you can use port 1050 for the Java IDL Object Request Broker Daemon\&. When using Oracle Solaris software, you must become a root user to start a process on a port lower than 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&. You can substitute a different port when necessary\&.
+-.PP
+-To start \f3orbd\fR from a UNIX command shell, enter:
+-.sp
+-.nf
+-\f3orbd \-ORBInitialPort 1050&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-From an MS-DOS system prompt (Windows), enter:
+-.sp
+-.nf
+-\f3start orbd \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Now that ORBD is running, you can run your server and client applications\&. When running the client and server applications, they must be made aware of the port number (and machine name, when applicable) where the Naming Service is running\&. One way to do this is to add the following code to your application:
+-.sp
+-.nf
+-\f3Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialHost", "MyHost");\fP
+-.fi
+-.nf
+-\f3ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this example, the naming service is running on port 1050 on host \f3MyHost\fR\&. Another way is to specify the port number and/or machine name when running the server or client application from the command line\&. For example, you would start your \f3HelloApplication\fR with the following command line:
+-.sp
+-.nf
+-\f3java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-To stop the naming service, use the relevant operating system command, such as \f3pkill\fR\f3orbd\fR on Oracle Solaris, or \fICtrl+C\fR in the DOS window in which \f3orbd\fR is running\&. Note that names registered with the naming service can disappear when the service is terminated because of a transient naming service\&. The Java IDL naming service will run until it is explicitly stopped\&.
+-.PP
+-For more information about the naming service included with ORBD, see Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+-.SH SERVER\ MANAGER
+-To access the ORBD Server Manager and run a persistent server, the server must be started with \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. When a server is started using \f3servertool\fR, it must be started on the same host and port on which \f3orbd\fR is executing\&. If the server is run on a different port, then the information stored in the database for local contexts will be invalid and the service will not work properly\&.
+-.PP
+-See Java IDL: The "Hello World" Example at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html
+-.PP
+-In this example, you run the \f3idlj\fR compiler and \f3javac\fR compiler as shown in the tutorial\&. To run the ORBD Server Manager, follow these steps for running the application:
+-.PP
+-Start \f3orbd\fR\&.
+-.PP
+-UNIX command shell, enter: \f3orbd -ORBInitialPort 1050\fR\&.
+-.PP
+-MS-DOS system prompt (Windows), enter: \f3s\fR\f3tart orbd -ORBInitialPort 105\fR\f30\fR\&.
+-.PP
+-Port 1050 is the port on which you want the name server to run\&. The \f3-ORBInitialPort\fR option is a required command-line argument\&. When using Oracle Solaris software, you must become a root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&.
+-.PP
+-Start the \f3servertool\fR: \f3servertool -ORBInitialPort 1050\fR\&.
+-.PP
+-Make sure the name server (\f3orbd\fR) port is the same as in the previous step, for example, \f3-ORBInitialPort 1050\&.\fR The \f3servertool\fR must be started on the same port as the name server\&.
+-.PP
+-In the \f3servertool\fR command line interface, start the \f3Hello\fR server from the \f3servertool\fR prompt:
+-.sp
+-.nf
+-\f3servertool > register \-server HelloServer \-classpath \&. \-applicationName\fP
+-.fi
+-.nf
+-\f3 HelloServerApName\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3servertool\fR registers the server, assigns it the name \f3HelloServerApName\fR, and displays its server ID with a listing of all registered servers\&.Run the client application from another terminal window or prompt:
+-.sp
+-.nf
+-\f3java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-For this example, you can omit \f3-ORBInitialHost localhost\fR because the name server is running on the same host as the \f3Hello\fR client\&. If the name server is running on a different host, then use the -\f3ORBInitialHost nameserverhost\fR option to specify the host on which the IDL name server is running\&.Specify the name server (\f3orbd\fR) port as done in the previous step, for example, \f3-ORBInitialPort 1050\fR\&. When you finish experimenting with the ORBD Server Manager, be sure to shut down or terminate the name server (\f3orbd\fR) and \f3servertool\fR\&. To shut down \f3orbd\fR from am MS-DOS prompt, select the window that is running the server and enter \fICtrl+C\fR to shut it down\&.
+-.PP
+-To shut down \f3orbd\fR from an Oracle Solaris shell, find the process, and terminate with the \f3kill\fR command\&. The server continues to wait for invocations until it is explicitly stopped\&. To shut down the \f3servertool\fR, type \fIquit\fR and press the \fIEnter\fR key\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-servertool(1)
+-.TP 0.2i
+-\(bu
+-Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++
++.SH NAME
++orbd \- Enables clients to locate and call persistent objects on servers in the CORBA environment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBorbd\fR [ \fIoptions\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++Command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3orbd\fR command enables clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The Server Manager included with the orbd tool is used to enable clients to transparently locate and call persistent objects on servers in the CORBA environment\&. The persistent servers, while publishing the persistent object references in the naming service, include the port number of the ORBD in the object reference instead of the port number of the server\&. The inclusion of an ORBD port number in the object reference for persistent object references has the following advantages:
++.TP 0.2i
++\(bu
++The object reference in the naming service remains independent of the server life cycle\&. For example, the object reference could be published by the server in the Naming Service when it is first installed, and then, independent of how many times the server is started or shut down, the ORBD returns the correct object reference to the calling client\&.
++.TP 0.2i
++\(bu
++The client needs to look up the object reference in the naming service only once, and can keep reusing this reference independent of the changes introduced due to server life cycle\&.
++.PP
++To access the ORBD Server Manager, the server must be started using \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. For more information on the Server Manager, see Server Manager\&.
++.PP
++When \f3orbd\fR starts, it also starts a naming service\&. For more information about the naming service\&. See Start and Stop the Naming Service\&.
++.SH OPTIONS
++.TP
++-ORBInitialPort \fInameserverport\fR
++.br
++Required\&. Specifies the port on which the name server should be started\&. After it is started, \f3orbd\fR listens for incoming requests on this port\&. On Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, Oracle recommends that you use a port number above or equal to 1024\&.
++.SS NONREQUIRED\ OPTIONS
++.TP
++-port \fIport\fR
++.br
++Specifies the activation port where ORBD should be started, and where ORBD will be accepting requests for persistent objects\&. The default value for this port is 1049\&. This port number is added to the port field of the persistent Interoperable Object References (IOR)\&.
++.TP
++-defaultdb \fIdirectory\fR
++.br
++Specifies the base where the ORBD persistent storage directory, \f3orb\&.db\fR, is created\&. If this option is not specified, then the default value is \f3\&./orb\&.db\fR\&.
++.TP
++-serverPollingTime \fImilliseconds\fR
++.br
++Specifies how often ORBD checks for the health of persistent servers registered through \f3servertool\fR\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
++.TP
++-serverStartupDelay milliseconds
++.br
++Specifies how long ORBD waits before sending a location forward exception after a persistent server that is registered through \f3servertool\fR is restarted\&. The default value is 1000 ms\&. The value specified for \f3milliseconds\fR must be a valid positive integer\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SS START\ AND\ STOP\ THE\ NAMING\ SERVICE
++A naming service is a CORBA service that allows CORBA objects to be named by means of binding a name to an object reference\&. The name binding can be stored in the naming service, and a client can supply the name to obtain the desired object reference\&.
++.PP
++Before running a client or a server, you will start ORBD\&. ORBD includes a persistent naming service and a transient naming service, both of which are an implementation of the COS Naming Service\&.
++.PP
++The Persistent Naming Service provides persistence for naming contexts\&. This means that this information is persistent across service shutdowns and startups, and is recoverable in the event of a service failure\&. If ORBD is restarted, then the Persistent Naming Service restores the naming context graph, so that the binding of all clients\&' and servers\&' names remains intact (persistent)\&.
++.PP
++For backward compatibility, \f3tnameserv\fR, a Transient Naming Service that shipped with earlier releases of the JDK, is also included in this release of Java SE\&. A transient naming service retains naming contexts as long as it is running\&. If there is a service interruption, then the naming context graph is lost\&.
++.PP
++The \f3-ORBInitialPort\fR argument is a required command-line argument for \f3orbd\fR, and is used to set the port number on which the naming service runs\&. The following instructions assume you can use port 1050 for the Java IDL Object Request Broker Daemon\&. When using Oracle Solaris software, you must become a root user to start a process on a port lower than 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&. You can substitute a different port when necessary\&.
++.PP
++To start \f3orbd\fR from a UNIX command shell, enter:
++.sp
++.nf
++\f3orbd \-ORBInitialPort 1050&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++From an MS-DOS system prompt (Windows), enter:
++.sp
++.nf
++\f3start orbd \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Now that ORBD is running, you can run your server and client applications\&. When running the client and server applications, they must be made aware of the port number (and machine name, when applicable) where the Naming Service is running\&. One way to do this is to add the following code to your application:
++.sp
++.nf
++\f3Properties props = new Properties();\fP
++.fi
++.nf
++\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3props\&.put("org\&.omg\&.CORBA\&.ORBInitialHost", "MyHost");\fP
++.fi
++.nf
++\f3ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this example, the naming service is running on port 1050 on host \f3MyHost\fR\&. Another way is to specify the port number and/or machine name when running the server or client application from the command line\&. For example, you would start your \f3HelloApplication\fR with the following command line:
++.sp
++.nf
++\f3java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++To stop the naming service, use the relevant operating system command, such as \f3pkill\fR\f3orbd\fR on Oracle Solaris, or \fICtrl+C\fR in the DOS window in which \f3orbd\fR is running\&. Note that names registered with the naming service can disappear when the service is terminated because of a transient naming service\&. The Java IDL naming service will run until it is explicitly stopped\&.
++.PP
++For more information about the naming service included with ORBD, see Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++.SH SERVER\ MANAGER
++To access the ORBD Server Manager and run a persistent server, the server must be started with \f3servertool\fR, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server\&. When a server is started using \f3servertool\fR, it must be started on the same host and port on which \f3orbd\fR is executing\&. If the server is run on a different port, then the information stored in the database for local contexts will be invalid and the service will not work properly\&.
++.PP
++See Java IDL: The "Hello World" Example at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html
++.PP
++In this example, you run the \f3idlj\fR compiler and \f3javac\fR compiler as shown in the tutorial\&. To run the ORBD Server Manager, follow these steps for running the application:
++.PP
++Start \f3orbd\fR\&.
++.PP
++UNIX command shell, enter: \f3orbd -ORBInitialPort 1050\fR\&.
++.PP
++MS-DOS system prompt (Windows), enter: \f3s\fR\f3tart orbd -ORBInitialPort 105\fR\f30\fR\&.
++.PP
++Port 1050 is the port on which you want the name server to run\&. The \f3-ORBInitialPort\fR option is a required command-line argument\&. When using Oracle Solaris software, you must become a root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number above or equal to 1024\&.
++.PP
++Start the \f3servertool\fR: \f3servertool -ORBInitialPort 1050\fR\&.
++.PP
++Make sure the name server (\f3orbd\fR) port is the same as in the previous step, for example, \f3-ORBInitialPort 1050\&.\fR The \f3servertool\fR must be started on the same port as the name server\&.
++.PP
++In the \f3servertool\fR command line interface, start the \f3Hello\fR server from the \f3servertool\fR prompt:
++.sp
++.nf
++\f3servertool > register \-server HelloServer \-classpath \&. \-applicationName\fP
++.fi
++.nf
++\f3 HelloServerApName\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3servertool\fR registers the server, assigns it the name \f3HelloServerApName\fR, and displays its server ID with a listing of all registered servers\&.Run the client application from another terminal window or prompt:
++.sp
++.nf
++\f3java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++For this example, you can omit \f3-ORBInitialHost localhost\fR because the name server is running on the same host as the \f3Hello\fR client\&. If the name server is running on a different host, then use the -\f3ORBInitialHost nameserverhost\fR option to specify the host on which the IDL name server is running\&.Specify the name server (\f3orbd\fR) port as done in the previous step, for example, \f3-ORBInitialPort 1050\fR\&. When you finish experimenting with the ORBD Server Manager, be sure to shut down or terminate the name server (\f3orbd\fR) and \f3servertool\fR\&. To shut down \f3orbd\fR from am MS-DOS prompt, select the window that is running the server and enter \fICtrl+C\fR to shut it down\&.
++.PP
++To shut down \f3orbd\fR from an Oracle Solaris shell, find the process, and terminate with the \f3kill\fR command\&. The server continues to wait for invocations until it is explicitly stopped\&. To shut down the \f3servertool\fR, type \fIquit\fR and press the \fIEnter\fR key\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++servertool(1)
++.TP 0.2i
++\(bu
++Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/pack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/pack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Deployment Tools
+-.\" Title: pack200.1
+-.\"
+-.if n .pl 99999
+-.TH pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Deployment Tools
++.\" Title: pack200.1
++.\"
++.if n .pl 99999
++.TH pack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,243 +47,243 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-pack200 \- Packages a JAR file into a compressed pack200 file for web deployment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBpack200\fR [\fIoptions\fR] \fIoutput\-file\fR \fIJAR\-file\fR
+-.fi
+-.sp
+-Options can be in any order\&. The last option on the command line or in a properties file supersedes all previously specified options\&.
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIoutput-file\fR
+-Name of the output file\&.
+-.TP
+-\fIJAR-file\fR
+-Name of the input file\&.
+-.SH DESCRIPTION
+-The \f3pack200\fR command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor\&. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time\&.
+-.PP
+-The \f3pack200\fR command has several options to fine-tune and set the compression engine\&. The typical usage is shown in the following example, where \f3myarchive\&.pack\&.gz\fR is produced with the default \f3pack200\fR command settings:
+-.sp
+-.nf
+-\f3pack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--r, --repack
+-.br
+-Produces a JAR file by packing and unpacking a JAR file\&. The resulting file can be used as an input to the \f3jarsigner\fR(1) tool\&. The following example packs and unpacks the myarchive\&.jar file:
+-.sp
+-.nf
+-\f3pack200 \-\-repack myarchive\-packer\&.jar myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3pack200 \-\-repack myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The following example preserves the order of files in the input file\&.
+-.TP
+--g, --no-gzip
+-.br
+-Produces a \f3pack200\fR file\&. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser\&.
+-.sp
+-.nf
+-\f3pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--G, --strip-debug
+-.br
+-Strips debugging attributes from the output\&. These include \f3SourceFile\fR, \f3LineNumberTable\fR, \f3LocalVariableTable\fR and \f3LocalVariableTypeTable\fR\&. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers\&.
+-.TP
+---keep-file-order
+-.br
+-Preserve the order of files in the input file\&. This is the default behavior\&.
+-.TP
+--O, --no-keep-file-order
+-.br
+-The packer reorders and transmits all elements\&. The packer can also remove JAR directory names to reduce the download size\&. However, certain JAR file optimizations, such as indexing, might not work correctly\&.
+-.TP
+--S\fIvalue\fR , --segment-limit=\fIvalue\fR
+-.br
+-The value is the estimated target size \fIN\fR (in bytes) of each archive segment\&. If a single input file requires more than \fIN\fR bytes, then its own archive segment is provided\&. As a special case, a value of \f3-1\fR produces a single large segment with all input files, while a value of 0 produces one segment for each class\&. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory\&.
+-
+-The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties\&.
+-
+-The default is -1, which means that the packer creates a single segment output file\&. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs\&.
+-
+-A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit)\&.
+-.TP
+--E\fIvalue\fR , --effort=\fIvalue\fR
+-.br
+-If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive\&. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression\&. The special value 0 instructs the \f3pack200\fR command to copy through the original JAR file directly with no compression\&. The JSR 200 standard requires any unpacker to understand this special case as a pass-through of the entire archive\&.
+-
+-The default is 5, to invest a modest amount of time to produce reasonable compression\&.
+-.TP
+--H\fIvalue\fR , --deflate-hint=\fIvalue\fR
+-.br
+-Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger\&. The possible values are: \f3true\fR, \f3false\fR, or \f3keep\fR\&.
+-
+-If the \f3value\fR is \f3true\fR or false, then the \f3packer200\fR command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements\&.
+-
+-The \f3keep\fR value preserves deflation hints observed in the input JAR\&. This is the default\&.
+-.TP
+--m\fIvalue\fR , --modification-time=\fIvalue\fR
+-.br
+-The possible values are \f3latest\fR and \f3keep\fR\&.
+-
+-If the value is latest, then the packer attempts to determine the latest modification time, among all the available entries in the original archive, or the latest modification time of all the available entries in that segment\&. This single value is transmitted as part of the segment and applied to all the entries in each segment\&. This can marginally decrease the transmitted size of the archive at the expense of setting all installed files to a single date\&.
+-
+-If the value is \f3keep\fR, then modification times observed in the input JAR are preserved\&. This is the default\&.
+-.TP
+--P\fIfile\fR , --pass-file=\fIfile\fR
+-.br
+-Indicates that a file should be passed through bytewise with no compression\&. By repeating the option, multiple files can be specified\&. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/)\&. The resulting file names must match exactly as strings with their occurrences in the JAR file\&. If \f3file\fR is a directory name, then all files under that directory are passed\&.
+-.TP
+--U\fIaction\fR , --unknown-attribute=\fIaction\fR
+-.br
+-Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action\fR\&. The possible values for actions are \f3error\fR, \f3strip\fR, or \f3pass\fR\&.
+-
+-If the value is \f3error\fR, then the entire \f3pack200\fR command operation fails with a suitable explanation\&.
+-
+-If the value is \f3strip\fR, then the attribute is dropped\&. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures\&.
+-
+-If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
+-.TP
+-.nf
+--C\fIattribute-name\fR=\fIlayout\fR , --class-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--F\fIattribute-name\fR=\fIlayout\fR , --field-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--M\fIattribute-name\fR=\fIlayout\fR , --method-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-See next option\&.
+-.TP
+-.nf
+--D\fIattribute-name\fR=\fIlayout\fR , --code-attribute=\fIattribute-name\fR=\fIaction\fR
+-.br
+-.fi
+-With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute\fR, \f3field-attribute\fR, \f3method-attribute\fR, and \f3code-attribute\fR\&. The \fIattribute-name\fR is the name of the attribute for which the layout or action is being defined\&. The possible values for \fIaction\fR are \f3some-layout-string\fR, \f3error\fR, \f3strip\fR, \f3pass\fR\&.
+-
+-\f3some-layout-string\fR: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH\fR\&.
+-
+-If the value is \f3error\fR, then the \f3pack200\fR operation fails with an explanation\&.
+-
+-If the value is \f3strip\fR, then the attribute is removed from the output\&. Removing JVM-required attributes can cause class loader failures\&. For example, \f3--class-attribute=CompilationID=pass\fR causes the class file that contains this attribute to be passed through without further action by the packer\&.
+-
+-If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
+-.TP
+--f \fIpack\&.properties\fR , --config-file=\fIpack\&.properties\fR
+-.br
+-A configuration file, containing Java properties to initialize the packer, can be specified on the command line\&.
+-.sp
+-.nf
+-\f3pack200 \-f pack\&.properties myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3more pack\&.properties\fP
+-.fi
+-.nf
+-\f3# Generic properties for the packer\&.\fP
+-.fi
+-.nf
+-\f3modification\&.time=latest\fP
+-.fi
+-.nf
+-\f3deflate\&.hint=false\fP
+-.fi
+-.nf
+-\f3keep\&.file\&.order=false\fP
+-.fi
+-.nf
+-\f3# This option will cause the files bearing new attributes to\fP
+-.fi
+-.nf
+-\f3# be reported as an error rather than passed uncompressed\&.\fP
+-.fi
+-.nf
+-\f3unknown\&.attribute=error\fP
+-.fi
+-.nf
+-\f3# Change the segment limit to be unlimited\&.\fP
+-.fi
+-.nf
+-\f3segment\&.limit=\-1\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--v, --verbose
+-.br
+-Outputs minimal messages\&. Multiple specification of this option will create more verbose messages\&.
+-.TP
+--q, --quiet
+-.br
+-Specifies quiet operation with no messages\&.
+-.TP
+--l\fIfilename\fR , --log-file=\fIfilename\fR
+-.br
+-Specifies a log file to output messages\&.
+-.TP
+--?, -h, --help
+-.br
+-Prints help information about this command\&.
+-.TP
+--V, --version
+-.br
+-Prints version information about this command\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes the specified option to the Java Virtual Machine\&. For more information, see the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
+-.SH EXIT\ STATUS
+-The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs\&.
+-.SH NOTES
+-This command should not be confused with \f3pack\fR(1)\&. The \f3pack\fR and \f3pack200\fR commands are separate products\&.
+-.PP
+-The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-unpack200(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
++
++.SH NAME
++pack200 \- Packages a JAR file into a compressed pack200 file for web deployment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBpack200\fR [\fIoptions\fR] \fIoutput\-file\fR \fIJAR\-file\fR
++.fi
++.sp
++Options can be in any order\&. The last option on the command line or in a properties file supersedes all previously specified options\&.
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIoutput-file\fR
++Name of the output file\&.
++.TP
++\fIJAR-file\fR
++Name of the input file\&.
++.SH DESCRIPTION
++The \f3pack200\fR command is a Java application that transforms a JAR file into a compressed pack200 file with the Java gzip compressor\&. The pack200 files are highly compressed files that can be directly deployed to save bandwidth and reduce download time\&.
++.PP
++The \f3pack200\fR command has several options to fine-tune and set the compression engine\&. The typical usage is shown in the following example, where \f3myarchive\&.pack\&.gz\fR is produced with the default \f3pack200\fR command settings:
++.sp
++.nf
++\f3pack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-r, --repack
++.br
++Produces a JAR file by packing and unpacking a JAR file\&. The resulting file can be used as an input to the \f3jarsigner\fR(1) tool\&. The following example packs and unpacks the myarchive\&.jar file:
++.sp
++.nf
++\f3pack200 \-\-repack myarchive\-packer\&.jar myarchive\&.jar\fP
++.fi
++.nf
++\f3pack200 \-\-repack myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The following example preserves the order of files in the input file\&.
++.TP
++-g, --no-gzip
++.br
++Produces a \f3pack200\fR file\&. With this option, a suitable compressor must be used, and the target system must use a corresponding decompresser\&.
++.sp
++.nf
++\f3pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-G, --strip-debug
++.br
++Strips debugging attributes from the output\&. These include \f3SourceFile\fR, \f3LineNumberTable\fR, \f3LocalVariableTable\fR and \f3LocalVariableTypeTable\fR\&. Removing these attributes reduces the size of both downloads and installations, but reduces the usefulness of debuggers\&.
++.TP
++--keep-file-order
++.br
++Preserve the order of files in the input file\&. This is the default behavior\&.
++.TP
++-O, --no-keep-file-order
++.br
++The packer reorders and transmits all elements\&. The packer can also remove JAR directory names to reduce the download size\&. However, certain JAR file optimizations, such as indexing, might not work correctly\&.
++.TP
++-S\fIvalue\fR , --segment-limit=\fIvalue\fR
++.br
++The value is the estimated target size \fIN\fR (in bytes) of each archive segment\&. If a single input file requires more than \fIN\fR bytes, then its own archive segment is provided\&. As a special case, a value of \f3-1\fR produces a single large segment with all input files, while a value of 0 produces one segment for each class\&. Larger archive segments result in less fragmentation and better compression, but processing them requires more memory\&.
++
++The size of each segment is estimated by counting the size of each input file to be transmitted in the segment with the size of its name and other transmitted properties\&.
++
++The default is -1, which means that the packer creates a single segment output file\&. In cases where extremely large output files are generated, users are strongly encouraged to use segmenting or break up the input file into smaller JARs\&.
++
++A 10 MB JAR packed without this limit typically packs about 10 percent smaller, but the packer might require a larger Java heap (about 10 times the segment limit)\&.
++.TP
++-E\fIvalue\fR , --effort=\fIvalue\fR
++.br
++If the value is set to a single decimal digit, then the packer uses the indicated amount of effort in compressing the archive\&. Level 1 might produce somewhat larger size and faster compression speed, while level 9 takes much longer, but can produce better compression\&. The special value 0 instructs the \f3pack200\fR command to copy through the original JAR file directly with no compression\&. The JSR 200 standard requires any unpacker to understand this special case as a pass-through of the entire archive\&.
++
++The default is 5, to invest a modest amount of time to produce reasonable compression\&.
++.TP
++-H\fIvalue\fR , --deflate-hint=\fIvalue\fR
++.br
++Overrides the default, which preserves the input information, but can cause the transmitted archive to be larger\&. The possible values are: \f3true\fR, \f3false\fR, or \f3keep\fR\&.
++
++If the \f3value\fR is \f3true\fR or false, then the \f3packer200\fR command sets the deflation hint accordingly in the output archive and does not transmit the individual deflation hints of archive elements\&.
++
++The \f3keep\fR value preserves deflation hints observed in the input JAR\&. This is the default\&.
++.TP
++-m\fIvalue\fR , --modification-time=\fIvalue\fR
++.br
++The possible values are \f3latest\fR and \f3keep\fR\&.
++
++If the value is latest, then the packer attempts to determine the latest modification time, among all the available entries in the original archive, or the latest modification time of all the available entries in that segment\&. This single value is transmitted as part of the segment and applied to all the entries in each segment\&. This can marginally decrease the transmitted size of the archive at the expense of setting all installed files to a single date\&.
++
++If the value is \f3keep\fR, then modification times observed in the input JAR are preserved\&. This is the default\&.
++.TP
++-P\fIfile\fR , --pass-file=\fIfile\fR
++.br
++Indicates that a file should be passed through bytewise with no compression\&. By repeating the option, multiple files can be specified\&. There is no pathname transformation, except that the system file separator is replaced by the JAR file separator forward slash (/)\&. The resulting file names must match exactly as strings with their occurrences in the JAR file\&. If \f3file\fR is a directory name, then all files under that directory are passed\&.
++.TP
++-U\fIaction\fR , --unknown-attribute=\fIaction\fR
++.br
++Overrides the default behavior, which means that the class file that contains the unknown attribute is passed through with the specified \f3action\fR\&. The possible values for actions are \f3error\fR, \f3strip\fR, or \f3pass\fR\&.
++
++If the value is \f3error\fR, then the entire \f3pack200\fR command operation fails with a suitable explanation\&.
++
++If the value is \f3strip\fR, then the attribute is dropped\&. Removing the required Java Virtual Machine (JVM) attributes can cause class loader failures\&.
++
++If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
++.TP
++.nf
++-C\fIattribute-name\fR=\fIlayout\fR , --class-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-F\fIattribute-name\fR=\fIlayout\fR , --field-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-M\fIattribute-name\fR=\fIlayout\fR , --method-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++See next option\&.
++.TP
++.nf
++-D\fIattribute-name\fR=\fIlayout\fR , --code-attribute=\fIattribute-name\fR=\fIaction\fR
++.br
++.fi
++With the previous four options, the attribute layout can be specified for a class entity, such as \f3class-attribute\fR, \f3field-attribute\fR, \f3method-attribute\fR, and \f3code-attribute\fR\&. The \fIattribute-name\fR is the name of the attribute for which the layout or action is being defined\&. The possible values for \fIaction\fR are \f3some-layout-string\fR, \f3error\fR, \f3strip\fR, \f3pass\fR\&.
++
++\f3some-layout-string\fR: The layout language is defined in the JSR 200 specification, for example: \f3--class-attribute=SourceFile=RUH\fR\&.
++
++If the value is \f3error\fR, then the \f3pack200\fR operation fails with an explanation\&.
++
++If the value is \f3strip\fR, then the attribute is removed from the output\&. Removing JVM-required attributes can cause class loader failures\&. For example, \f3--class-attribute=CompilationID=pass\fR causes the class file that contains this attribute to be passed through without further action by the packer\&.
++
++If the value is \f3pass\fR, then the entire class is transmitted as though it is a resource\&.
++.TP
++-f \fIpack\&.properties\fR , --config-file=\fIpack\&.properties\fR
++.br
++A configuration file, containing Java properties to initialize the packer, can be specified on the command line\&.
++.sp
++.nf
++\f3pack200 \-f pack\&.properties myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3more pack\&.properties\fP
++.fi
++.nf
++\f3# Generic properties for the packer\&.\fP
++.fi
++.nf
++\f3modification\&.time=latest\fP
++.fi
++.nf
++\f3deflate\&.hint=false\fP
++.fi
++.nf
++\f3keep\&.file\&.order=false\fP
++.fi
++.nf
++\f3# This option will cause the files bearing new attributes to\fP
++.fi
++.nf
++\f3# be reported as an error rather than passed uncompressed\&.\fP
++.fi
++.nf
++\f3unknown\&.attribute=error\fP
++.fi
++.nf
++\f3# Change the segment limit to be unlimited\&.\fP
++.fi
++.nf
++\f3segment\&.limit=\-1\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-v, --verbose
++.br
++Outputs minimal messages\&. Multiple specification of this option will create more verbose messages\&.
++.TP
++-q, --quiet
++.br
++Specifies quiet operation with no messages\&.
++.TP
++-l\fIfilename\fR , --log-file=\fIfilename\fR
++.br
++Specifies a log file to output messages\&.
++.TP
++-?, -h, --help
++.br
++Prints help information about this command\&.
++.TP
++-V, --version
++.br
++Prints version information about this command\&.
++.TP
++-J\fIoption\fR
++.br
++Passes the specified option to the Java Virtual Machine\&. For more information, see the reference page for the java(1) command\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&.
++.SH EXIT\ STATUS
++The following exit values are returned: 0 for successful completion and a number greater than 0 when an error occurs\&.
++.SH NOTES
++This command should not be confused with \f3pack\fR(1)\&. The \f3pack\fR and \f3pack200\fR commands are separate products\&.
++.PP
++The Java SE API Specification provided with the JDK is the superseding authority, when there are discrepancies\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++unpack200(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/policytool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/policytool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 03 March 2015
+-.\" SectDesc: Security Tools
+-.\" Title: policytool.1
+-.\"
+-.if n .pl 99999
+-.TH policytool 1 "03 March 2015" "JDK 8" "Security Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 03 March 2015
++.\" SectDesc: Security Tools
++.\" Title: policytool.1
++.\"
++.if n .pl 99999
++.TH policytool 1 "03 March 2015" "JDK 8" "Security Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,67 +47,67 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-policytool \- Reads and writes a plain text policy file based on user input through the utility GUI\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBpolicytool\fR [ \fB\-file\fR ] [ \fIfilename\fR ]
+-.fi
+-.sp
+-.TP
+--file
+-.br
+-Directs the \f3policytool\fR command to load a policy file\&.
+-.TP
+-\fIfilename\fR
+-The name of the file to be loaded\&.
+-.PP
+-\fIExamples\fR:
+-.PP
+-Run the policy tool administrator utility:
+-.sp
+-.nf
+-\f3policytool\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Run the \f3policytool\fR command and load the specified file:
+-.sp
+-.nf
+-\f3policytool \-file \fImypolicyfile\fR\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH DESCRIPTION
+-The \f3policytool\fR command calls an administrator\&'s GUI that enables system administrators to manage the contents of local policy files\&. A policy file is a plain-text file with a \f3\&.policy\fR extension, that maps remote requestors by domain, to permission objects\&. For details, see Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.SH OPTIONS
+-.TP
+--file
+-.br
+-Directs the \f3policytool\fR command to load a policy file\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
+-.TP 0.2i
+-\(bu
+-Policy File Creation and Management at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html
+-.TP 0.2i
+-\(bu
+-Permissions in Java SE Development Kit (JDK) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html
+-.TP 0.2i
+-\(bu
+-Java Security Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html
+-.TP 0.2i
+-\(bu
+-Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html
++
++.SH NAME
++policytool \- Reads and writes a plain text policy file based on user input through the utility GUI\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBpolicytool\fR [ \fB\-file\fR ] [ \fIfilename\fR ]
++.fi
++.sp
++.TP
++-file
++.br
++Directs the \f3policytool\fR command to load a policy file\&.
++.TP
++\fIfilename\fR
++The name of the file to be loaded\&.
++.PP
++\fIExamples\fR:
++.PP
++Run the policy tool administrator utility:
++.sp
++.nf
++\f3policytool\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Run the \f3policytool\fR command and load the specified file:
++.sp
++.nf
++\f3policytool \-file \fImypolicyfile\fR\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH DESCRIPTION
++The \f3policytool\fR command calls an administrator\&'s GUI that enables system administrators to manage the contents of local policy files\&. A policy file is a plain-text file with a \f3\&.policy\fR extension, that maps remote requestors by domain, to permission objects\&. For details, see Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.SH OPTIONS
++.TP
++-file
++.br
++Directs the \f3policytool\fR command to load a policy file\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
++.TP 0.2i
++\(bu
++Policy File Creation and Management at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html
++.TP 0.2i
++\(bu
++Permissions in Java SE Development Kit (JDK) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html
++.TP 0.2i
++\(bu
++Java Security Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html
++.TP 0.2i
++\(bu
++Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/rmic.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/rmic.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmic.1
+-.\"
+-.if n .pl 99999
+-.TH rmic 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmic.1
++.\"
++.if n .pl 99999
++.TH rmic 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,176 +47,176 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmic \- Generates stub, skeleton, and tie classes for remote objects that use the Java Remote Method Protocol (JRMP) or Internet Inter-Orb protocol (IIOP)\&. Also generates Object Management Group (OMG) Interface Definition Language (IDL)
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmic\fR [ \fIoptions\fR ] \fIpackage\-qualified\-class\-names\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line \f3options\fR\&. See Options\&.
+-.TP
+-\fIpackage-qualified-class-names\fR
+-Class names that include their packages, for example, \f3java\&.awt\&.Color\fR\&.
+-.SH DESCRIPTION
+-\fIDeprecation Note:\fR Support for static generation of Java Remote Method Protocol (JRMP) stubs and skeletons has been deprecated\&. Oracle recommends that you use dynamically generated JRMP stubs instead, eliminating the need to use this tool for JRMP-based applications\&. See the \f3java\&.rmi\&.server\&.UnicastRemoteObject\fR specification at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html for further information\&.
+-.PP
+-The \f3rmic\fR compiler generates stub and skeleton class files using the Java Remote Method Protocol (JRMP) and stub and tie class files (IIOP protocol) for remote objects\&. These class files are generated from compiled Java programming language classes that are remote object implementation classes\&. A remote implementation class is a class that implements the interface \f3java\&.rmi\&.Remote\fR\&. The class names in the \f3rmic\fR command must be for classes that were compiled successfully with the \f3javac\fR command and must be fully package qualified\&. For example, running the \f3rmic\fR command on the class file name \f3HelloImpl\fR as shown here creates the \f3HelloImpl_Stub\&.class\fRfile in the hello subdirectory (named for the class\&'s package):
+-.sp
+-.nf
+-\f3rmic hello\&.HelloImpl\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-A skeleton for a remote object is a JRMP protocol server-side entity that has a method that dispatches calls to the remote object implementation\&.
+-.PP
+-A tie for a remote object is a server-side entity similar to a skeleton, but communicates with the client with the IIOP protocol\&.
+-.PP
+-A stub is a client-side proxy for a remote object that is responsible for communicating method invocations on remote objects to the server where the actual remote object implementation resides\&. A client\&'s reference to a remote object, therefore, is actually a reference to a local stub\&.
+-.PP
+-By default, the \f3rmic\fR command generates stub classes that use the 1\&.2 JRMP stub protocol version only, as though the \f3-v1\&.2\fR option was specified\&. The \f3-vcompat\fR option was the default in releases before 5\&.0\&. Use the \f3-iiop\fR option to generate stub and tie classes for the IIOP protocol\&. See Options\&.
+-.PP
+-A stub implements only the remote interfaces, and not any local interfaces that the remote object also implements\&. Because a JRMP stub implements the same set of remote interfaces as the remote object, a client can use the Java programming language built-in operators for casting and type checking\&. For IIOP, the \f3PortableRemoteObject\&.narrow\fR method must be used\&.
+-.SH OPTIONS
+-.TP
+--bootclasspath \fIpath\fR
+-.br
+-Overrides the location of bootstrap class files\&.
+-.TP
+--classpath path
+-.br
+-Specifies the path the \f3rmic\fR command uses to look up classes\&. This option overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons\&. The general format for path is: \f3\&.:<your_path>\fR, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies the root destination directory for the generated class hierarchy\&. You can use this option to specify a destination directory for the stub, skeleton, and tie files\&. For example, the following command places the stub and skeleton classes derived from MyClass into the directory /java/classes/exampleclass\&.
+-.sp
+-.nf
+-\f3rmic \-d /java/classes exampleclass\&.MyClass\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-If the \f3-d\fR option is not specified, then the default behavior is as if \f3-d \&.\fR was specified\&. The package hierarchy of the target class is created in the current directory, and stub/tie/skeleton files are placed within it\&. In some earlier releases of the \f3rmic\fR command, if the \f3-d\fR option was not specified, then the package hierarchy was not created, and all of the output files were placed directly in the current directory\&.
+-.TP
+--extdirs \fIpath\fR
+-.br
+-Overrides the location of installed extensions\&.
+-.TP
+--g
+-.br
+-Enables the generation of all debugging information, including local variables\&. By default, only line number information is generated\&.
+-.TP
+--idl
+-.br
+-Causes the \f3rmic\fR command to generate OMG IDL for the classes specified and any classes referenced\&. IDL provides a purely declarative, programming language-independent way to specify an API for an object\&. The IDL is used as a specification for methods and data that can be written in and called from any language that provides CORBA bindings\&. This includes Java and C++ among others\&. See Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
+-
+-When the \f3-idl\fR option is used, other options also include:
+-.RS
+-.TP 0.2i
+-\(bu
+-The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
+-.TP 0.2i
+-\(bu
+-The \f3-factory\fR option uses the \f3factory\fR keyword in generated IDL\&.
+-.TP 0.2i
+-\(bu
+-The \f3-idlModule\fR from J\f3avaPackage[\&.class]\fR\f3toIDLModule\fR specifies \f3IDLEntity\fR package mapping, for example: \f3-idlModule\fR\f3my\&.module my::real::idlmod\fR\&.
+-.TP 0.2i
+-\(bu
+-\f3-idlFile\fR\f3fromJavaPackage[\&.class] toIDLFile\fR specifies \f3IDLEntity\fR file mapping, for example: \f3-idlFile test\&.pkg\&.X TEST16\&.idl\fR\&.
+-.RE
+-
+-.TP
+--iiop
+-.br
+-Causes the \f3rmic\fR command to generate IIOP stub and tie classes, rather than JRMP stub and skeleton classes\&. A stub class is a local proxy for a remote object and is used by clients to send calls to a server\&. Each remote interface requires a stub class, which implements that remote interface\&. A client reference to a remote object is a reference to a stub\&. Tie classes are used on the server side to process incoming calls, and dispatch the calls to the proper implementation class\&. Each implementation class requires a tie class\&.
+-
+-If you call the \f3rmic\fR command with the \f3-iiop\fR, then it generates stubs and ties that conform to this naming convention:
+-.sp
+-.nf
+-\f3_<implementationName>_stub\&.class\fP
+-.fi
+-.nf
+-\f3_<interfaceName>_tie\&.class\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.RS
+-.TP 0.2i
+-\(bu
+-When you use the \f3-iiop\fR option, other options also include:
+-.TP 0.2i
+-\(bu
+-The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
+-.TP 0.2i
+-\(bu
+-The \f3-nolocalstubs\fR option means do not create stubs optimized for same-process clients and servers\&.
+-.TP 0.2i
+-\(bu
+-The \f3-noValueMethods\fR option must be used with the \f3-idl\fR option\&. The \f3-noValueMethods\fR option prevents the addition of \f3valuetype\fR methods and initializers to emitted IDL\&. These methods and initializers are optional for valuetypes, and are generated unless the \f3-noValueMethods\fR option is specified with the \f3-idl\fR option\&.
+-.TP 0.2i
+-\(bu
+-The \f3-poa\fR option changes the inheritance from \f3org\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR to \f3org\&.omg\&.PortableServer\&.Servant\fR\&. The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. In the Java programming language, the \f3Servant\fR type is mapped to the \f3Java org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&. Based on the OMG IDL to Java Language Mapping Specification, CORBA V 2\&.3\&.1 ptc/00-01-08\&.pdf\&..RE
+-
+-.TP
+--J
+-.br
+-Used with any Java command, the \f3-J\fR option passes the argument that follows the \f3-J\fR (no spaces between the \f3-J\fRand the argument) to the Java interpreter
+-.TP
+--keep or -keepgenerated
+-.br
+-Retains the generated \f3\&.java\fR source files for the stub, skeleton, and tie classes and writes them to the same directory as the\f3\&.class\fR files\&.
+-.TP
+--nowarn
+-.br
+-Turns off warnings\&. When the \f3-nowarn\fR options is used\&. The compiler does not print out any warnings\&.
+-.TP
+--nowrite
+-.br
+-Does not write compiled classes to the file system\&.
+-.TP
+--vcompat (deprecated)
+-.br
+-Generates stub and skeleton classes that are compatible with both the 1\&.1 and 1\&.2 JRMP stub protocol versions\&. This option was the default in releases before 5\&.0\&. The generated stub classes use the 1\&.1 stub protocol version when loaded in a JDK 1\&.1 virtual machine and use the 1\&.2 stub protocol version when loaded into a 1\&.2 (or later) virtual machine\&. The generated skeleton classes support both 1\&.1 and 1\&.2 stub protocol versions\&. The generated classes are relatively large to support both modes of operation\&. Note: This option has been deprecated\&. See Description\&.
+-.TP
+--verbose
+-.br
+-Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded\&.
+-.TP
+--v1\&.1 (deprecated)
+-.br
+-Generates stub and skeleton classes for the 1\&.1 JRMP stub protocol version only\&. The \f3-v1\&.1\fR option is only useful for generating stub classes that are serialization-compatible with preexisting, statically deployed stub classes that were generated by the \f3rmic\fR command from JDK 1\&.1 and that cannot be upgraded (and dynamic class loading is not being used)\&. Note: This option has been deprecated\&. See Description\&.
+-.TP
+--v1\&.2 (deprecated)
+-.br
+-(Default) Generates stub classes for the 1\&.2 JRMP stub protocol version only\&. No skeleton classes are generated because skeleton classes are not used with the 1\&.2 stub protocol version\&. The generated stub classes do not work when they are loaded into a JDK 1\&.1 virtual machine\&. Note: This option has been deprecated\&. See Description\&.
+-.SH ENVIRONMENT\ VARIABLES
+-.TP
+-CLASSPATH
+-Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-javac(1)
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-Setting the Class Path
++
++.SH NAME
++rmic \- Generates stub, skeleton, and tie classes for remote objects that use the Java Remote Method Protocol (JRMP) or Internet Inter-Orb protocol (IIOP)\&. Also generates Object Management Group (OMG) Interface Definition Language (IDL)
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmic\fR [ \fIoptions\fR ] \fIpackage\-qualified\-class\-names\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line \f3options\fR\&. See Options\&.
++.TP
++\fIpackage-qualified-class-names\fR
++Class names that include their packages, for example, \f3java\&.awt\&.Color\fR\&.
++.SH DESCRIPTION
++\fIDeprecation Note:\fR Support for static generation of Java Remote Method Protocol (JRMP) stubs and skeletons has been deprecated\&. Oracle recommends that you use dynamically generated JRMP stubs instead, eliminating the need to use this tool for JRMP-based applications\&. See the \f3java\&.rmi\&.server\&.UnicastRemoteObject\fR specification at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html for further information\&.
++.PP
++The \f3rmic\fR compiler generates stub and skeleton class files using the Java Remote Method Protocol (JRMP) and stub and tie class files (IIOP protocol) for remote objects\&. These class files are generated from compiled Java programming language classes that are remote object implementation classes\&. A remote implementation class is a class that implements the interface \f3java\&.rmi\&.Remote\fR\&. The class names in the \f3rmic\fR command must be for classes that were compiled successfully with the \f3javac\fR command and must be fully package qualified\&. For example, running the \f3rmic\fR command on the class file name \f3HelloImpl\fR as shown here creates the \f3HelloImpl_Stub\&.class\fRfile in the hello subdirectory (named for the class\&'s package):
++.sp
++.nf
++\f3rmic hello\&.HelloImpl\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++A skeleton for a remote object is a JRMP protocol server-side entity that has a method that dispatches calls to the remote object implementation\&.
++.PP
++A tie for a remote object is a server-side entity similar to a skeleton, but communicates with the client with the IIOP protocol\&.
++.PP
++A stub is a client-side proxy for a remote object that is responsible for communicating method invocations on remote objects to the server where the actual remote object implementation resides\&. A client\&'s reference to a remote object, therefore, is actually a reference to a local stub\&.
++.PP
++By default, the \f3rmic\fR command generates stub classes that use the 1\&.2 JRMP stub protocol version only, as though the \f3-v1\&.2\fR option was specified\&. The \f3-vcompat\fR option was the default in releases before 5\&.0\&. Use the \f3-iiop\fR option to generate stub and tie classes for the IIOP protocol\&. See Options\&.
++.PP
++A stub implements only the remote interfaces, and not any local interfaces that the remote object also implements\&. Because a JRMP stub implements the same set of remote interfaces as the remote object, a client can use the Java programming language built-in operators for casting and type checking\&. For IIOP, the \f3PortableRemoteObject\&.narrow\fR method must be used\&.
++.SH OPTIONS
++.TP
++-bootclasspath \fIpath\fR
++.br
++Overrides the location of bootstrap class files\&.
++.TP
++-classpath path
++.br
++Specifies the path the \f3rmic\fR command uses to look up classes\&. This option overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons\&. The general format for path is: \f3\&.:<your_path>\fR, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.TP
++-d \fIdirectory\fR
++.br
++Specifies the root destination directory for the generated class hierarchy\&. You can use this option to specify a destination directory for the stub, skeleton, and tie files\&. For example, the following command places the stub and skeleton classes derived from MyClass into the directory /java/classes/exampleclass\&.
++.sp
++.nf
++\f3rmic \-d /java/classes exampleclass\&.MyClass\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++If the \f3-d\fR option is not specified, then the default behavior is as if \f3-d \&.\fR was specified\&. The package hierarchy of the target class is created in the current directory, and stub/tie/skeleton files are placed within it\&. In some earlier releases of the \f3rmic\fR command, if the \f3-d\fR option was not specified, then the package hierarchy was not created, and all of the output files were placed directly in the current directory\&.
++.TP
++-extdirs \fIpath\fR
++.br
++Overrides the location of installed extensions\&.
++.TP
++-g
++.br
++Enables the generation of all debugging information, including local variables\&. By default, only line number information is generated\&.
++.TP
++-idl
++.br
++Causes the \f3rmic\fR command to generate OMG IDL for the classes specified and any classes referenced\&. IDL provides a purely declarative, programming language-independent way to specify an API for an object\&. The IDL is used as a specification for methods and data that can be written in and called from any language that provides CORBA bindings\&. This includes Java and C++ among others\&. See Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html
++
++When the \f3-idl\fR option is used, other options also include:
++.RS
++.TP 0.2i
++\(bu
++The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
++.TP 0.2i
++\(bu
++The \f3-factory\fR option uses the \f3factory\fR keyword in generated IDL\&.
++.TP 0.2i
++\(bu
++The \f3-idlModule\fR from J\f3avaPackage[\&.class]\fR\f3toIDLModule\fR specifies \f3IDLEntity\fR package mapping, for example: \f3-idlModule\fR\f3my\&.module my::real::idlmod\fR\&.
++.TP 0.2i
++\(bu
++\f3-idlFile\fR\f3fromJavaPackage[\&.class] toIDLFile\fR specifies \f3IDLEntity\fR file mapping, for example: \f3-idlFile test\&.pkg\&.X TEST16\&.idl\fR\&.
++.RE
++
++.TP
++-iiop
++.br
++Causes the \f3rmic\fR command to generate IIOP stub and tie classes, rather than JRMP stub and skeleton classes\&. A stub class is a local proxy for a remote object and is used by clients to send calls to a server\&. Each remote interface requires a stub class, which implements that remote interface\&. A client reference to a remote object is a reference to a stub\&. Tie classes are used on the server side to process incoming calls, and dispatch the calls to the proper implementation class\&. Each implementation class requires a tie class\&.
++
++If you call the \f3rmic\fR command with the \f3-iiop\fR, then it generates stubs and ties that conform to this naming convention:
++.sp
++.nf
++\f3_<implementationName>_stub\&.class\fP
++.fi
++.nf
++\f3_<interfaceName>_tie\&.class\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.RS
++.TP 0.2i
++\(bu
++When you use the \f3-iiop\fR option, other options also include:
++.TP 0.2i
++\(bu
++The \f3-always\fR or \f3-alwaysgenerate\fR options force regeneration even when existing stubs/ties/IDL are newer than the input class\&.
++.TP 0.2i
++\(bu
++The \f3-nolocalstubs\fR option means do not create stubs optimized for same-process clients and servers\&.
++.TP 0.2i
++\(bu
++The \f3-noValueMethods\fR option must be used with the \f3-idl\fR option\&. The \f3-noValueMethods\fR option prevents the addition of \f3valuetype\fR methods and initializers to emitted IDL\&. These methods and initializers are optional for valuetypes, and are generated unless the \f3-noValueMethods\fR option is specified with the \f3-idl\fR option\&.
++.TP 0.2i
++\(bu
++The \f3-poa\fR option changes the inheritance from \f3org\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR to \f3org\&.omg\&.PortableServer\&.Servant\fR\&. The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. In the Java programming language, the \f3Servant\fR type is mapped to the \f3Java org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&. Based on the OMG IDL to Java Language Mapping Specification, CORBA V 2\&.3\&.1 ptc/00-01-08\&.pdf\&..RE
++
++.TP
++-J
++.br
++Used with any Java command, the \f3-J\fR option passes the argument that follows the \f3-J\fR (no spaces between the \f3-J\fRand the argument) to the Java interpreter
++.TP
++-keep or -keepgenerated
++.br
++Retains the generated \f3\&.java\fR source files for the stub, skeleton, and tie classes and writes them to the same directory as the\f3\&.class\fR files\&.
++.TP
++-nowarn
++.br
++Turns off warnings\&. When the \f3-nowarn\fR options is used\&. The compiler does not print out any warnings\&.
++.TP
++-nowrite
++.br
++Does not write compiled classes to the file system\&.
++.TP
++-vcompat (deprecated)
++.br
++Generates stub and skeleton classes that are compatible with both the 1\&.1 and 1\&.2 JRMP stub protocol versions\&. This option was the default in releases before 5\&.0\&. The generated stub classes use the 1\&.1 stub protocol version when loaded in a JDK 1\&.1 virtual machine and use the 1\&.2 stub protocol version when loaded into a 1\&.2 (or later) virtual machine\&. The generated skeleton classes support both 1\&.1 and 1\&.2 stub protocol versions\&. The generated classes are relatively large to support both modes of operation\&. Note: This option has been deprecated\&. See Description\&.
++.TP
++-verbose
++.br
++Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded\&.
++.TP
++-v1\&.1 (deprecated)
++.br
++Generates stub and skeleton classes for the 1\&.1 JRMP stub protocol version only\&. The \f3-v1\&.1\fR option is only useful for generating stub classes that are serialization-compatible with preexisting, statically deployed stub classes that were generated by the \f3rmic\fR command from JDK 1\&.1 and that cannot be upgraded (and dynamic class loading is not being used)\&. Note: This option has been deprecated\&. See Description\&.
++.TP
++-v1\&.2 (deprecated)
++.br
++(Default) Generates stub classes for the 1\&.2 JRMP stub protocol version only\&. No skeleton classes are generated because skeleton classes are not used with the 1\&.2 stub protocol version\&. The generated stub classes do not work when they are loaded into a JDK 1\&.1 virtual machine\&. Note: This option has been deprecated\&. See Description\&.
++.SH ENVIRONMENT\ VARIABLES
++.TP
++CLASSPATH
++Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++javac(1)
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++Setting the Class Path
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/rmid.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/rmid.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1998, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmid.1
+-.\"
+-.if n .pl 99999
+-.TH rmid 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmid.1
++.\"
++.if n .pl 99999
++.TH rmid 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,267 +47,267 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmid \- Starts the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmid\fR [\fIoptions\fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.SH DESCRIPTION
+-The \f3rmid\fR command starts the activation system daemon\&. The activation system daemon must be started before activatable objects can be either registered with the activation system or activated in a JVM\&. For details on how to write programs that use activatable objects, the \fIUsing Activation\fR tutorial at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html
+-.PP
+-Start the daemon by executing the \f3rmid\fR command and specifying a security policy file, as follows:
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When you run Oracle\(cqs implementation of the \f3rmid\fR command, by default you must specify a security policy file so that the \f3rmid\fR command can verify whether or not the information in each \f3ActivationGroupDesc\fR is allowed to be used to start a JVM for an activation group\&. Specifically, the command and options specified by the \f3CommandEnvironment\fR and any properties passed to an \f3ActivationGroupDesc\fR constructor must now be explicitly allowed in the security policy file for the \f3rmid\fR command\&. The value of the \f3sun\&.rmi\&.activation\&.execPolicy\fR property dictates the policy that the \f3rmid\fR command uses to determine whether or not the information in an \f3ActivationGroupDesc\fR can be used to start a JVM for an activation group\&. For more information see the description of the -J-Dsun\&.rmi\&.activation\&.execPolicy=policy option\&.
+-.PP
+-Executing the \f3rmid\fR command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem\fR to the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR in this internal registry\&.
+-.PP
+-To specify an alternate port for the registry, you must specify the \f3-port\fR option when you execute the \f3rmid\fR command\&. For example, the following command starts the activation system daemon and a registry on the registry\&'s default port, 1099\&.
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH START\ RMID\ ON\ DEMAND
+-An alternative to starting \f3rmid\fR from the command line is to configure \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) to start \f3rmid\fR on demand\&.
+-.PP
+-When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd\fR/\f3xinetd\fR) by calling the \f3System\&.inheritedChannel\fR method\&. If the inherited channel is null or not an instance of \f3java\&.nio\&.channels\&.ServerSocketChannel\fR, then RMID assumes that it was not started by \f3inetd\fR/\f3xinetd\fR, and it starts as previously described\&.
+-.PP
+-If the inherited channel is a \f3ServerSocketChannel\fR instance, then RMID uses the \f3java\&.net\&.ServerSocket\fR obtained from the \f3ServerSocketChannel\fR as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java\&.rmi\&.activation\&.ActivationSystem\fR is bound and the \f3java\&.rmi\&.activation\&.Activator\fR remote object\&. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
+-.TP 0.2i
+-\(bu
+-Output printed to \f3System\&.err\fR is redirected to a file\&. This file is located in the directory specified by the \f3java\&.io\&.tmpdir\fR system property (typically \f3/var/tmp\fR or \f3/tmp\fR) with the prefix \f3rmid-err\fR and the suffix \f3tmp\fR\&.
+-.TP 0.2i
+-\(bu
+-The \f3-port\fR option is not allowed\&. If this option is specified, then RMID exits with an error message\&.
+-.TP 0.2i
+-\(bu
+-The \f3-log\fR option is required\&. If this option is not specified, then RMID exits with an error message
+-.PP
+-See the man pages for \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) for details on how to configure services to be started on demand\&.
+-.SH OPTIONS
+-.TP
+--C\fIoption\fR
+-.br
+-Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid\fR command when that process is created\&. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
+-.sp
+-.nf
+-\f3rmid \-C\-Dsome\&.property=value\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-This ability to pass command-line arguments to child processes can be useful for debugging\&. For example, the following command enables server-call logging in all child JVMs\&.
+-.sp
+-.nf
+-\f3rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--J\fIoption\fR
+-.br
+-Specifies an option that is passed to the Java interpreter running RMID\&. For example, to specify that the \f3rmid\fR command use a policy file named \f3rmid\&.policy\fR, the \f3-J\fR option can be used to define the \f3java\&.security\&.policy\fR property on the \f3rmid\fR command line, for example:
+-.sp
+-.nf
+-\f3rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--J-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR
+-.br
+-Specifies the policy that RMID employs to check commands and command-line options used to start the JVM in which an activation group runs\&. Please note that this option exists only in Oracle\&'s implementation of the Java RMI activation daemon\&. If this property is not specified on the command line, then the result is the same as though \f3-J-Dsun\&.rmi\&.activation\&.execPolicy=default\fR were specified\&. The possible values of \f3policy\fR can be \f3default\fR, \f3policyClassName\fR, or \f3none\fR\&.
+-.RS
+-.TP 0.2i
+-\(bu
+-default
+-
+-The \f3default\fR or unspecified value \f3execPolicy\fR allows the \f3rmid\fR command to execute commands with specific command-line options only when the \f3rmid\fR command was granted permission to execute those commands and options in the security policy file that the \f3rmid\fR command uses\&. Only the default activation group implementation can be used with the default execution policy\&.
+-
+-The \f3rmid\fR command starts a JVM for an activation group with the information in the group\&'s registered activation group descriptor, an \f3ActivationGroupDesc\fR\&. The group descriptor specifies an optional \f3ActivationGroupDesc\&.CommandEnvironment\fR that includes the command to execute to start the activation group and any command-line options to be added to the command line\&. By default, the \f3rmid\fR command uses the \f3java\fR command found in \f3java\&.home\fR\&. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>\fR\&.The \f3com\&.sun\&.rmi\&.rmid\&.ExecPermission\fR permission grants the \f3rmid\fR command permission to execute a command that is specified in the group descriptor\&'s \f3CommandEnvironment\fR to start an activation group\&. The \f3com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR permission enables the \f3rmid\fR command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment\fR when starting the activation group\&.When granting the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources\&.
+-
+-\fIExecPermission\fR
+-
+-The \f3ExecPermission\fR class represents permission for the \f3rmid\fR command to execute a specific command to start an activation group\&.
+-
+-\fISyntax\fR: The name of an \f3ExecPermission\fR is the path name of a command to grant the \f3rmid\fR command permission to execute\&. A path name that ends in a slash (/) and an asterisk (*) indicates that all of the files contained in that directory where slash is the file-separator character, \f3File\&.separatorChar\fR\&. A path name that ends in a slash (/) and a minus sign (-) indicates all files and subdirectories contained in that directory (recursively)\&. A path name that consists of the special token \f3<<ALL FILES>>\fR matches any file\&.
+-
+-A path name that consists of an asterisk (*) indicates all the files in the current directory\&. A path name that consists of a minus sign (-) indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory\&.
+-
+-\fIExecOptionPermission\fR
+-
+-The \f3ExecOptionPermission\fR class represents permission for the \f3rmid\fR command to use a specific command-line option when starting an activation group\&. The name of an \f3ExecOptionPermission\fR is the value of a command-line option\&.
+-
+-\fISyntax\fR: Options support a limited wild card scheme\&. An asterisk signifies a wild card match, and it can appear as the option name itself (matches any option), or an asterisk (*) can appear at the end of the option name only when the asterisk (*) follows a dot (\&.) or an equals sign (=)\&.
+-
+-For example: \f3*\fR or \f3-Dmydir\&.*\fR or \f3-Da\&.b\&.c=*\fR is valid, but \f3*mydir\fR or \f3-Da*b\fR or \f3ab*\fR is not\&.
+-
+-\fIPolicy file for rmid\fR
+-
+-When you grant the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources (universally)\&. It is safe to grant these permissions universally because only the \f3rmid\fR command checks these permissions\&.
+-
+-An example policy file that grants various execute permissions to the \f3rmid\fR command is:
+-.sp
+-.nf
+-\f3grant {\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
+-.fi
+-.nf
+-\f3 "/files/apps/java/jdk1\&.7\&.0/solaris/bin/java";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
+-.fi
+-.nf
+-\f3 "/files/apps/rmidcmds/*";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Djava\&.security\&.policy=/files/policies/group\&.policy";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Djava\&.security\&.debug=*";\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
+-.fi
+-.nf
+-\f3 "\-Dsun\&.rmi\&.*";\fP
+-.fi
+-.nf
+-\f3};\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-The first permission granted allows the \f3rmid\fR tcommand o execute the 1\&.7\&.0 release of the \f3java\fR command, specified by its explicit path name\&. By default, the version of the \f3java\fR command found in \f3java\&.home\fR is used (the same one that the \f3rmid\fR command uses), and does not need to be specified in the policy file\&. The second permission allows the \f3rmid\fR command to execute any command in the directory \f3/files/apps/rmidcmds\fR\&.
+-
+-The third permission granted, an \f3ExecOptionPermission\fR, allows the \f3rmid\fR command to start an activation group that defines the security policy file to be \f3/files/policies/group\&.policy\fR\&. The next permission allows the \f3java\&.security\&.debug property\fR to be used by an activation group\&. The last permission allows any property in the \f3sun\&.rmi property\fR name hierarchy to be used by activation groups\&.
+-
+-To start the \f3rmid\fR command with a policy file, the \f3java\&.security\&.policy\fR property needs to be specified on the \f3rmid\fR command line, for example:
+-
+-\f3rmid -J-Djava\&.security\&.policy=rmid\&.policy\fR\&.
+-.TP 0.2i
+-\(bu
+-<policyClassName>
+-
+-If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid\fR command, the name of a class whose \f3checkExecCommand\fR method is executed to check commands to be executed by the \f3rmid\fR command\&.
+-
+-The \f3policyClassName\fR specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand\fR method:
+-.sp
+-.nf
+-\f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)\fP
+-.fi
+-.nf
+-\f3 throws SecurityException;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-
+-Before starting an activation group, the \f3rmid\fR command calls the policy\&'s \f3checkExecCommand\fR method and passes to it the activation group descriptor and an array that contains the complete command to start the activation group\&. If the \f3checkExecCommand\fR throws a \f3SecurityException\fR, then the \f3rmid\fR command does not start the activation group and an \f3ActivationException\fR is thrown to the caller attempting to activate the object\&.
+-.TP 0.2i
+-\(bu
+-none
+-
+-If the \f3sun\&.rmi\&.activation\&.execPolicy\fR property value is \f3none\fR, then the \f3rmid\fR command does not perform any validation of commands to start activation groups\&.
+-.RE
+-
+-.TP
+--log \fIdir\fR
+-.br
+-Specifies the name of the directory the activation system daemon uses to write its database and associated information\&. The log directory defaults to creating a log, in the directory in which the \f3rmid\fR command was executed\&.
+-.TP
+--port \fIport\fR
+-.br
+-Specifies the port the registry uses\&. The activation system daemon binds the \f3ActivationSystem\fR, with the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR, in this registry\&. The \f3ActivationSystem\fR on the local machine can be obtained using the following \f3Naming\&.lookup\fR method call:
+-.sp
+-.nf
+-\f3import java\&.rmi\&.*; \fP
+-.fi
+-.nf
+-\f3 import java\&.rmi\&.activation\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 ActivationSystem system; system = (ActivationSystem)\fP
+-.fi
+-.nf
+-\f3 Naming\&.lookup("//:port/java\&.rmi\&.activation\&.ActivationSystem");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-
+-.TP
+--stop
+-.br
+-Stops the current invocation of the \f3rmid\fR command for a port specified by the \f3-port\fR option\&. If no port is specified, then this option stops the \f3rmid\fR invocation running on port 1098\&.
+-.SH ENVIRONMENT\ VARIABLES
+-.TP
+-CLASSPATH
+-Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-Setting the Class Path
++
++.SH NAME
++rmid \- Starts the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmid\fR [\fIoptions\fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.SH DESCRIPTION
++The \f3rmid\fR command starts the activation system daemon\&. The activation system daemon must be started before activatable objects can be either registered with the activation system or activated in a JVM\&. For details on how to write programs that use activatable objects, the \fIUsing Activation\fR tutorial at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html
++.PP
++Start the daemon by executing the \f3rmid\fR command and specifying a security policy file, as follows:
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When you run Oracle\(cqs implementation of the \f3rmid\fR command, by default you must specify a security policy file so that the \f3rmid\fR command can verify whether or not the information in each \f3ActivationGroupDesc\fR is allowed to be used to start a JVM for an activation group\&. Specifically, the command and options specified by the \f3CommandEnvironment\fR and any properties passed to an \f3ActivationGroupDesc\fR constructor must now be explicitly allowed in the security policy file for the \f3rmid\fR command\&. The value of the \f3sun\&.rmi\&.activation\&.execPolicy\fR property dictates the policy that the \f3rmid\fR command uses to determine whether or not the information in an \f3ActivationGroupDesc\fR can be used to start a JVM for an activation group\&. For more information see the description of the -J-Dsun\&.rmi\&.activation\&.execPolicy=policy option\&.
++.PP
++Executing the \f3rmid\fR command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem\fR to the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR in this internal registry\&.
++.PP
++To specify an alternate port for the registry, you must specify the \f3-port\fR option when you execute the \f3rmid\fR command\&. For example, the following command starts the activation system daemon and a registry on the registry\&'s default port, 1099\&.
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH START\ RMID\ ON\ DEMAND
++An alternative to starting \f3rmid\fR from the command line is to configure \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) to start \f3rmid\fR on demand\&.
++.PP
++When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd\fR/\f3xinetd\fR) by calling the \f3System\&.inheritedChannel\fR method\&. If the inherited channel is null or not an instance of \f3java\&.nio\&.channels\&.ServerSocketChannel\fR, then RMID assumes that it was not started by \f3inetd\fR/\f3xinetd\fR, and it starts as previously described\&.
++.PP
++If the inherited channel is a \f3ServerSocketChannel\fR instance, then RMID uses the \f3java\&.net\&.ServerSocket\fR obtained from the \f3ServerSocketChannel\fR as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java\&.rmi\&.activation\&.ActivationSystem\fR is bound and the \f3java\&.rmi\&.activation\&.Activator\fR remote object\&. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
++.TP 0.2i
++\(bu
++Output printed to \f3System\&.err\fR is redirected to a file\&. This file is located in the directory specified by the \f3java\&.io\&.tmpdir\fR system property (typically \f3/var/tmp\fR or \f3/tmp\fR) with the prefix \f3rmid-err\fR and the suffix \f3tmp\fR\&.
++.TP 0.2i
++\(bu
++The \f3-port\fR option is not allowed\&. If this option is specified, then RMID exits with an error message\&.
++.TP 0.2i
++\(bu
++The \f3-log\fR option is required\&. If this option is not specified, then RMID exits with an error message
++.PP
++See the man pages for \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) for details on how to configure services to be started on demand\&.
++.SH OPTIONS
++.TP
++-C\fIoption\fR
++.br
++Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid\fR command when that process is created\&. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
++.sp
++.nf
++\f3rmid \-C\-Dsome\&.property=value\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++This ability to pass command-line arguments to child processes can be useful for debugging\&. For example, the following command enables server-call logging in all child JVMs\&.
++.sp
++.nf
++\f3rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-J\fIoption\fR
++.br
++Specifies an option that is passed to the Java interpreter running RMID\&. For example, to specify that the \f3rmid\fR command use a policy file named \f3rmid\&.policy\fR, the \f3-J\fR option can be used to define the \f3java\&.security\&.policy\fR property on the \f3rmid\fR command line, for example:
++.sp
++.nf
++\f3rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-J-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR
++.br
++Specifies the policy that RMID employs to check commands and command-line options used to start the JVM in which an activation group runs\&. Please note that this option exists only in Oracle\&'s implementation of the Java RMI activation daemon\&. If this property is not specified on the command line, then the result is the same as though \f3-J-Dsun\&.rmi\&.activation\&.execPolicy=default\fR were specified\&. The possible values of \f3policy\fR can be \f3default\fR, \f3policyClassName\fR, or \f3none\fR\&.
++.RS
++.TP 0.2i
++\(bu
++default
++
++The \f3default\fR or unspecified value \f3execPolicy\fR allows the \f3rmid\fR command to execute commands with specific command-line options only when the \f3rmid\fR command was granted permission to execute those commands and options in the security policy file that the \f3rmid\fR command uses\&. Only the default activation group implementation can be used with the default execution policy\&.
++
++The \f3rmid\fR command starts a JVM for an activation group with the information in the group\&'s registered activation group descriptor, an \f3ActivationGroupDesc\fR\&. The group descriptor specifies an optional \f3ActivationGroupDesc\&.CommandEnvironment\fR that includes the command to execute to start the activation group and any command-line options to be added to the command line\&. By default, the \f3rmid\fR command uses the \f3java\fR command found in \f3java\&.home\fR\&. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>\fR\&.The \f3com\&.sun\&.rmi\&.rmid\&.ExecPermission\fR permission grants the \f3rmid\fR command permission to execute a command that is specified in the group descriptor\&'s \f3CommandEnvironment\fR to start an activation group\&. The \f3com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR permission enables the \f3rmid\fR command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment\fR when starting the activation group\&.When granting the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources\&.
++
++\fIExecPermission\fR
++
++The \f3ExecPermission\fR class represents permission for the \f3rmid\fR command to execute a specific command to start an activation group\&.
++
++\fISyntax\fR: The name of an \f3ExecPermission\fR is the path name of a command to grant the \f3rmid\fR command permission to execute\&. A path name that ends in a slash (/) and an asterisk (*) indicates that all of the files contained in that directory where slash is the file-separator character, \f3File\&.separatorChar\fR\&. A path name that ends in a slash (/) and a minus sign (-) indicates all files and subdirectories contained in that directory (recursively)\&. A path name that consists of the special token \f3<<ALL FILES>>\fR matches any file\&.
++
++A path name that consists of an asterisk (*) indicates all the files in the current directory\&. A path name that consists of a minus sign (-) indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory\&.
++
++\fIExecOptionPermission\fR
++
++The \f3ExecOptionPermission\fR class represents permission for the \f3rmid\fR command to use a specific command-line option when starting an activation group\&. The name of an \f3ExecOptionPermission\fR is the value of a command-line option\&.
++
++\fISyntax\fR: Options support a limited wild card scheme\&. An asterisk signifies a wild card match, and it can appear as the option name itself (matches any option), or an asterisk (*) can appear at the end of the option name only when the asterisk (*) follows a dot (\&.) or an equals sign (=)\&.
++
++For example: \f3*\fR or \f3-Dmydir\&.*\fR or \f3-Da\&.b\&.c=*\fR is valid, but \f3*mydir\fR or \f3-Da*b\fR or \f3ab*\fR is not\&.
++
++\fIPolicy file for rmid\fR
++
++When you grant the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources (universally)\&. It is safe to grant these permissions universally because only the \f3rmid\fR command checks these permissions\&.
++
++An example policy file that grants various execute permissions to the \f3rmid\fR command is:
++.sp
++.nf
++\f3grant {\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
++.fi
++.nf
++\f3 "/files/apps/java/jdk1\&.7\&.0/solaris/bin/java";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
++.fi
++.nf
++\f3 "/files/apps/rmidcmds/*";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Djava\&.security\&.policy=/files/policies/group\&.policy";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Djava\&.security\&.debug=*";\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
++.fi
++.nf
++\f3 "\-Dsun\&.rmi\&.*";\fP
++.fi
++.nf
++\f3};\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++The first permission granted allows the \f3rmid\fR tcommand o execute the 1\&.7\&.0 release of the \f3java\fR command, specified by its explicit path name\&. By default, the version of the \f3java\fR command found in \f3java\&.home\fR is used (the same one that the \f3rmid\fR command uses), and does not need to be specified in the policy file\&. The second permission allows the \f3rmid\fR command to execute any command in the directory \f3/files/apps/rmidcmds\fR\&.
++
++The third permission granted, an \f3ExecOptionPermission\fR, allows the \f3rmid\fR command to start an activation group that defines the security policy file to be \f3/files/policies/group\&.policy\fR\&. The next permission allows the \f3java\&.security\&.debug property\fR to be used by an activation group\&. The last permission allows any property in the \f3sun\&.rmi property\fR name hierarchy to be used by activation groups\&.
++
++To start the \f3rmid\fR command with a policy file, the \f3java\&.security\&.policy\fR property needs to be specified on the \f3rmid\fR command line, for example:
++
++\f3rmid -J-Djava\&.security\&.policy=rmid\&.policy\fR\&.
++.TP 0.2i
++\(bu
++<policyClassName>
++
++If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid\fR command, the name of a class whose \f3checkExecCommand\fR method is executed to check commands to be executed by the \f3rmid\fR command\&.
++
++The \f3policyClassName\fR specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand\fR method:
++.sp
++.nf
++\f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)\fP
++.fi
++.nf
++\f3 throws SecurityException;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++
++Before starting an activation group, the \f3rmid\fR command calls the policy\&'s \f3checkExecCommand\fR method and passes to it the activation group descriptor and an array that contains the complete command to start the activation group\&. If the \f3checkExecCommand\fR throws a \f3SecurityException\fR, then the \f3rmid\fR command does not start the activation group and an \f3ActivationException\fR is thrown to the caller attempting to activate the object\&.
++.TP 0.2i
++\(bu
++none
++
++If the \f3sun\&.rmi\&.activation\&.execPolicy\fR property value is \f3none\fR, then the \f3rmid\fR command does not perform any validation of commands to start activation groups\&.
++.RE
++
++.TP
++-log \fIdir\fR
++.br
++Specifies the name of the directory the activation system daemon uses to write its database and associated information\&. The log directory defaults to creating a log, in the directory in which the \f3rmid\fR command was executed\&.
++.TP
++-port \fIport\fR
++.br
++Specifies the port the registry uses\&. The activation system daemon binds the \f3ActivationSystem\fR, with the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR, in this registry\&. The \f3ActivationSystem\fR on the local machine can be obtained using the following \f3Naming\&.lookup\fR method call:
++.sp
++.nf
++\f3import java\&.rmi\&.*; \fP
++.fi
++.nf
++\f3 import java\&.rmi\&.activation\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 ActivationSystem system; system = (ActivationSystem)\fP
++.fi
++.nf
++\f3 Naming\&.lookup("//:port/java\&.rmi\&.activation\&.ActivationSystem");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++
++.TP
++-stop
++.br
++Stops the current invocation of the \f3rmid\fR command for a port specified by the \f3-port\fR option\&. If no port is specified, then this option stops the \f3rmid\fR invocation running on port 1098\&.
++.SH ENVIRONMENT\ VARIABLES
++.TP
++CLASSPATH
++Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++Setting the Class Path
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/rmiregistry.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/rmiregistry.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: rmiregistry.1
+-.\"
+-.if n .pl 99999
+-.TH rmiregistry 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: rmiregistry.1
++.\"
++.if n .pl 99999
++.TH rmiregistry 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,51 +47,51 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-rmiregistry \- Starts a remote object registry on the specified port on the current host\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBrmiregistry\fR [ \fIport\fR ]
+-.fi
+-.sp
+-.TP
+-\fIport\fR
+-The number of a \f3port\fR on the current host at which to start the remote object registry\&.
+-.SH DESCRIPTION
+-The \f3rmiregistry\fR command creates and starts a remote object registry on the specified port on the current host\&. If the port is omitted, then the registry is started on port 1099\&. The \f3rmiregistry\fR command produces no output and is typically run in the background, for example:
+-.sp
+-.nf
+-\f3rmiregistry &\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-A remote object registry is a bootstrap naming service that is used by RMI servers on the same host to bind remote objects to names\&. Clients on local and remote hosts can then look up remote objects and make remote method invocations\&.
+-.PP
+-The registry is typically used to locate the first remote object on which an application needs to call methods\&. That object then provides application-specific support for finding other objects\&.
+-.PP
+-The methods of the \f3java\&.rmi\&.registry\&.LocateRegistry\fR class are used to get a registry operating on the local host or local host and port\&.
+-.PP
+-The URL-based methods of the \f3java\&.rmi\&.Naming\fR class operate on a registry and can be used to look up a remote object on any host and on the local host\&. Bind a simple name (string) to a remote object, rebind a new name to a remote object (overriding the old binding), unbind a remote object, and list the URL bound in the registry\&.
+-.SH OPTIONS
+-.TP
+--J
+-.br
+-Used with any Java option to pass the option following the \f3-J\fR (no spaces between the \f3-J\fR and the option) to the Java interpreter\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-java(1)
+-.TP 0.2i
+-\(bu
+-\f3java\&.rmi\&.registry\&.LocateRegistry\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html
+-.TP 0.2i
+-\(bu
+-\f3java\&.rmi\&.Naming class description\fR at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html
++
++.SH NAME
++rmiregistry \- Starts a remote object registry on the specified port on the current host\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBrmiregistry\fR [ \fIport\fR ]
++.fi
++.sp
++.TP
++\fIport\fR
++The number of a \f3port\fR on the current host at which to start the remote object registry\&.
++.SH DESCRIPTION
++The \f3rmiregistry\fR command creates and starts a remote object registry on the specified port on the current host\&. If the port is omitted, then the registry is started on port 1099\&. The \f3rmiregistry\fR command produces no output and is typically run in the background, for example:
++.sp
++.nf
++\f3rmiregistry &\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++A remote object registry is a bootstrap naming service that is used by RMI servers on the same host to bind remote objects to names\&. Clients on local and remote hosts can then look up remote objects and make remote method invocations\&.
++.PP
++The registry is typically used to locate the first remote object on which an application needs to call methods\&. That object then provides application-specific support for finding other objects\&.
++.PP
++The methods of the \f3java\&.rmi\&.registry\&.LocateRegistry\fR class are used to get a registry operating on the local host or local host and port\&.
++.PP
++The URL-based methods of the \f3java\&.rmi\&.Naming\fR class operate on a registry and can be used to look up a remote object on any host and on the local host\&. Bind a simple name (string) to a remote object, rebind a new name to a remote object (overriding the old binding), unbind a remote object, and list the URL bound in the registry\&.
++.SH OPTIONS
++.TP
++-J
++.br
++Used with any Java option to pass the option following the \f3-J\fR (no spaces between the \f3-J\fR and the option) to the Java interpreter\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++java(1)
++.TP 0.2i
++\(bu
++\f3java\&.rmi\&.registry\&.LocateRegistry\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html
++.TP 0.2i
++\(bu
++\f3java\&.rmi\&.Naming class description\fR at http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/schemagen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/schemagen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: schemagen.1
+-.\"
+-.if n .pl 99999
+-.TH schemagen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: schemagen.1
++.\"
++.if n .pl 99999
++.TH schemagen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,74 +47,74 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-schemagen \- Generates a schema for every name space that is referenced in your Java classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBschemagen\fR [ \fIoptions\fR ] \fIjava\-files\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIjava-files\fR
+-The Java class files to be processed\&.
+-.SH DESCRIPTION
+-The schema generator creates a schema file for each name space referenced in your Java classes\&. Currently, you cannot control the name of the generated schema files\&. To control the schema file names, see Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
+-.PP
+-Start the schema generator with the appropriate \f3schemagen\fR shell script in the bin directory for your platform\&. The current schema generator can process either Java source files or class files\&.
+-.sp
+-.nf
+-\f3schemagen\&.sh Foo\&.java Bar\&.java \&.\&.\&.\fP
+-.fi
+-.nf
+-\f3Note: Writing schema1\&.xsd\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If your java files reference other classes, then those classes must be accessible on your system \f3CLASSPATH\fR environment variable, or they need to be specified in the \f3schemagen\fR command line with the class path options\&. See Options\&. If the referenced files are not accessible or specified, then you get errors when you generate the schema\&.
+-.SH OPTIONS
+-.TP
+--d \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places processor-generated and \f3javac\fR-generated class files\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places user-specified files\&.
+-.TP
+--classpath \fIpath\fR
+-.br
+-The location where the \f3schemagen\fR command places user-specified files\&.
+-.TP
+--encoding \fIencoding\fR
+-.br
+-Specifies the encoding to use for \f3apt\fR or \f3javac\fR command invocations\&.
+-.TP
+--episode \fIfile\fR
+-.br
+-Generates an episode file for separate compilation\&.
+-.TP
+--version
+-.br
+-Displays release information\&.
+-.TP
+--help
+-.br
+-Displays a help message\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
+-.TP 0.2i
+-\(bu
+-Java Architecture for XML Binding (JAXB) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/xml/jaxb/index\&.html
++
++.SH NAME
++schemagen \- Generates a schema for every name space that is referenced in your Java classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBschemagen\fR [ \fIoptions\fR ] \fIjava\-files\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIjava-files\fR
++The Java class files to be processed\&.
++.SH DESCRIPTION
++The schema generator creates a schema file for each name space referenced in your Java classes\&. Currently, you cannot control the name of the generated schema files\&. To control the schema file names, see Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
++.PP
++Start the schema generator with the appropriate \f3schemagen\fR shell script in the bin directory for your platform\&. The current schema generator can process either Java source files or class files\&.
++.sp
++.nf
++\f3schemagen\&.sh Foo\&.java Bar\&.java \&.\&.\&.\fP
++.fi
++.nf
++\f3Note: Writing schema1\&.xsd\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If your java files reference other classes, then those classes must be accessible on your system \f3CLASSPATH\fR environment variable, or they need to be specified in the \f3schemagen\fR command line with the class path options\&. See Options\&. If the referenced files are not accessible or specified, then you get errors when you generate the schema\&.
++.SH OPTIONS
++.TP
++-d \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places processor-generated and \f3javac\fR-generated class files\&.
++.TP
++-cp \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places user-specified files\&.
++.TP
++-classpath \fIpath\fR
++.br
++The location where the \f3schemagen\fR command places user-specified files\&.
++.TP
++-encoding \fIencoding\fR
++.br
++Specifies the encoding to use for \f3apt\fR or \f3javac\fR command invocations\&.
++.TP
++-episode \fIfile\fR
++.br
++Generates an episode file for separate compilation\&.
++.TP
++-version
++.br
++Displays release information\&.
++.TP
++-help
++.br
++Displays a help message\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Using SchemaGen with Ant at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.html
++.TP 0.2i
++\(bu
++Java Architecture for XML Binding (JAXB) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/xml/jaxb/index\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/serialver.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/serialver.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1997, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Remote Method Invocation (RMI) Tools
+-.\" Title: serialver.1
+-.\"
+-.if n .pl 99999
+-.TH serialver 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Remote Method Invocation (RMI) Tools
++.\" Title: serialver.1
++.\"
++.if n .pl 99999
++.TH serialver 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,63 +47,63 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-serialver \- Returns the serial version UID for specified classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBserialver\fR [ \fIoptions\fR ] [ \fIclassnames\fR ]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIclassnames\fR
+-The classes for which the \f3serialVersionUID\fR is to be returned\&.
+-.SH DESCRIPTION
+-The \f3serialver\fR command returns the \f3serialVersionUID\fR for one or more classes in a form suitable for copying into an evolving class\&. When called with no arguments, the \f3serialver\fR command prints a usage line\&.
+-.SH OPTIONS
+-.TP
+--classpath \fIpath-files\fR
+-.br
+-Sets the search path for application classes and resources\&. Separate classes and resources with a colon (:)\&.
+-.TP
+--show
+-.br
+-Displays a simple user interface\&. Enter the full class name and press either the \fIEnter\fR key or the \fIShow\fR button to display the \f3serialVersionUID\fR\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH NOTES
+-The \f3serialver\fR command loads and initializes the specified classes in its virtual machine, and by default, it does not set a security manager\&. If the \f3serialver\fR command is to be run with untrusted classes, then a security manager can be set with the following option:
+-.sp
+-.nf
+-\f3\-J\-Djava\&.security\&.manager\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-When necessary, a security policy can be specified with the following option:
+-.sp
+-.nf
+-\f3\-J\-Djava\&.security\&.policy=<policy file>\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-policytool(1)
+-.TP 0.2i
+-\(bu
+-The \f3java\&.io\&.ObjectStream\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.html
++
++.SH NAME
++serialver \- Returns the serial version UID for specified classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBserialver\fR [ \fIoptions\fR ] [ \fIclassnames\fR ]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIclassnames\fR
++The classes for which the \f3serialVersionUID\fR is to be returned\&.
++.SH DESCRIPTION
++The \f3serialver\fR command returns the \f3serialVersionUID\fR for one or more classes in a form suitable for copying into an evolving class\&. When called with no arguments, the \f3serialver\fR command prints a usage line\&.
++.SH OPTIONS
++.TP
++-classpath \fIpath-files\fR
++.br
++Sets the search path for application classes and resources\&. Separate classes and resources with a colon (:)\&.
++.TP
++-show
++.br
++Displays a simple user interface\&. Enter the full class name and press either the \fIEnter\fR key or the \fIShow\fR button to display the \f3serialVersionUID\fR\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH NOTES
++The \f3serialver\fR command loads and initializes the specified classes in its virtual machine, and by default, it does not set a security manager\&. If the \f3serialver\fR command is to be run with untrusted classes, then a security manager can be set with the following option:
++.sp
++.nf
++\f3\-J\-Djava\&.security\&.manager\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++When necessary, a security policy can be specified with the following option:
++.sp
++.nf
++\f3\-J\-Djava\&.security\&.policy=<policy file>\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++policytool(1)
++.TP 0.2i
++\(bu
++The \f3java\&.io\&.ObjectStream\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/servertool.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/servertool.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2001, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: servertool.1
+-.\"
+-.if n .pl 99999
+-.TH servertool 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: servertool.1
++.\"
++.if n .pl 99999
++.TH servertool 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-servertool \- Provides an easy-to-use interface for developers to register, unregister, start up, and shut down a persistent server\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBservertool\fR \-ORBInitialPort \fInameserverport\fR [ \fIoptions\fR ] [ \fIcommands \fR]
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-commands
+-The command-line commands\&. See Commands\&.
+-.SH DESCRIPTION
+-The \f3servertool\fR command provides the command-line interface for developers to register, unregister, start up, and shut down a persistent server\&. Command-line commands let you obtain various statistical information about the server\&. See Commands\&.
+-.SH OPTIONS
+-.TP
+--ORBInitialHost \fInameserverhost\fR
+-.br
+-This options is required\&. It specifies the host machine on which the name server runs and listens for incoming requests\&. The \f3nameserverhost\fR value must specify the port on which the \f3orb\fR is running and listening for requests\&. The value defaults to \f3localhost\fR when this option is not specified\&. If \f3orbd\fR and \f3servertool\fR are running on different machines, then you must specify the name or IP address of the host on which \f3orbd\fR is running\&.
+-
+-\fINote:\fR On Oracle Solaris, you must become a root user to start a process on a port below 1024\&. Oracle recommends that you use a port number above or equal to 1024 for the \f3nameserverport\fR value\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH COMMANDS
+-You can start the \f3servertool\fR command with or without a command-line command\&.
+-.TP 0.2i
+-\(bu
+-If you did not specify a command when you started \f3servertool\fR, then the command-line tool displays the \f3servertool\fR prompt where you can enter commands: \f3servertool >\fR\&.
+-.TP 0.2i
+-\(bu
+-If you specify a command when you start \f3servertool\fR, then the Java IDL Server Tool starts, executes the command, and exits\&.
+-.TP
+-.ll 180
+-register -server \fIserver-class-name\fR -classpath \fIclasspath-to-server\fR [ -applicationName \fIapplication-name\fR -args \fIargs-to-server\fR -vmargs \fIflags-for-JVM\fR ]
+-Registers a new persistent server with the Object Request Broker Daemon (ORBD)\&. If the server is not already registered, then it is registered and activated\&. This command causes an installation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The installation method must be \f3public static void install(org\&.omg\&.CORBA\&.ORB)\fR\&. The install method is optional and lets developers provide their own server installation behavior, such as creating a database schema\&.
+-.TP
+-.ll 180
+-unregister -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
+-Unregisters a server from the ORBD with either its server ID or its application name\&. This command causes an uninstallation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The \f3uninstall\fR method must be \f3public static void uninstall(org\&.omg\&.CORBA\&.ORB)\fR\&. The \f3uninstall\fR method is optional and lets developers provide their own server uninstallation behavior, such as undoing the behavior of the \f3install\fR method\&.
+-.TP
+-getserverid -applicationName \fIapplication-name\fR
+-Returns the server ID that corresponds to the \f3application-name\fR value\&.
+-.TP
+-list
+-Lists information about all persistent servers registered with the ORBD\&.
+-.TP
+-listappnames
+-Lists the application names for all servers currently registered with the ORBD\&.
+-.TP
+-listactive
+-Lists information about all persistent servers that were started by the ORBD and are currently running\&.
+-.TP
+-.ll 180
+-locate -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -endpointType \fIendpointType\fR ]
+-Locates the endpoints (ports) of a specific type for all ORBs created by a registered server\&. If a server is not already running, then it is activated\&. If an \f3endpointType\fR value is not specified, then the plain/non-protected endpoint associated with each ORB in a server is returned\&.
+-.TP
+-.ll 180
+-locateperorb -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -orbid \fIORB-name\fR ]
+-Locates all the endpoints (ports) registered by a specific Object Request Broker (ORB) of registered server\&. If a server is not already running, then it is activated\&. If an \f3orbid\fR is not specified, then the default value of \f3""\fR is assigned to the \f3orbid\fR\&. If any ORBs are created with an \f3orbid\fR of empty string, then all ports registered by it are returned\&.
+-.TP
+-orblist -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
+-Lists the \f3ORBId\fR of the ORBs defined on a server\&. An \f3ORBId\fR is the string name for the ORB created by the server\&. If the server is not already running, then it is activated\&.
+-.TP
+-shutdown -serverid \fIserver-id\fR | -applicationName application-name
+-Shut down an active server that is registered with ORBD\&. During execution of this command, the \f3shutdown\fR method defined in the class specified by either the \f3-serverid\fR or \f3-applicationName\fR parameter is also called to shut down the server process\&.
+-.TP
+-startup -serverid \fIserver-id\fR | -applicationName application-name
+-Starts up or activate a server that is registered with ORBD\&. If the server is not running, then this command starts the server\&. If the server is already running, then an error message is displayed\&.
+-.TP
+-help
+-Lists all the commands available to the server through the \f3servertool\fR command\&.
+-.TP
+-quit
+-Exits the \f3servertool\fR command\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-orbd(1)
++
++.SH NAME
++servertool \- Provides an easy-to-use interface for developers to register, unregister, start up, and shut down a persistent server\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBservertool\fR \-ORBInitialPort \fInameserverport\fR [ \fIoptions\fR ] [ \fIcommands \fR]
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++commands
++The command-line commands\&. See Commands\&.
++.SH DESCRIPTION
++The \f3servertool\fR command provides the command-line interface for developers to register, unregister, start up, and shut down a persistent server\&. Command-line commands let you obtain various statistical information about the server\&. See Commands\&.
++.SH OPTIONS
++.TP
++-ORBInitialHost \fInameserverhost\fR
++.br
++This options is required\&. It specifies the host machine on which the name server runs and listens for incoming requests\&. The \f3nameserverhost\fR value must specify the port on which the \f3orb\fR is running and listening for requests\&. The value defaults to \f3localhost\fR when this option is not specified\&. If \f3orbd\fR and \f3servertool\fR are running on different machines, then you must specify the name or IP address of the host on which \f3orbd\fR is running\&.
++
++\fINote:\fR On Oracle Solaris, you must become a root user to start a process on a port below 1024\&. Oracle recommends that you use a port number above or equal to 1024 for the \f3nameserverport\fR value\&.
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH COMMANDS
++You can start the \f3servertool\fR command with or without a command-line command\&.
++.TP 0.2i
++\(bu
++If you did not specify a command when you started \f3servertool\fR, then the command-line tool displays the \f3servertool\fR prompt where you can enter commands: \f3servertool >\fR\&.
++.TP 0.2i
++\(bu
++If you specify a command when you start \f3servertool\fR, then the Java IDL Server Tool starts, executes the command, and exits\&.
++.TP
++.ll 180
++register -server \fIserver-class-name\fR -classpath \fIclasspath-to-server\fR [ -applicationName \fIapplication-name\fR -args \fIargs-to-server\fR -vmargs \fIflags-for-JVM\fR ]
++Registers a new persistent server with the Object Request Broker Daemon (ORBD)\&. If the server is not already registered, then it is registered and activated\&. This command causes an installation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The installation method must be \f3public static void install(org\&.omg\&.CORBA\&.ORB)\fR\&. The install method is optional and lets developers provide their own server installation behavior, such as creating a database schema\&.
++.TP
++.ll 180
++unregister -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
++Unregisters a server from the ORBD with either its server ID or its application name\&. This command causes an uninstallation method to be called in the \f3main\fR class of the server identified by the \f3-server\fR option\&. The \f3uninstall\fR method must be \f3public static void uninstall(org\&.omg\&.CORBA\&.ORB)\fR\&. The \f3uninstall\fR method is optional and lets developers provide their own server uninstallation behavior, such as undoing the behavior of the \f3install\fR method\&.
++.TP
++getserverid -applicationName \fIapplication-name\fR
++Returns the server ID that corresponds to the \f3application-name\fR value\&.
++.TP
++list
++Lists information about all persistent servers registered with the ORBD\&.
++.TP
++listappnames
++Lists the application names for all servers currently registered with the ORBD\&.
++.TP
++listactive
++Lists information about all persistent servers that were started by the ORBD and are currently running\&.
++.TP
++.ll 180
++locate -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -endpointType \fIendpointType\fR ]
++Locates the endpoints (ports) of a specific type for all ORBs created by a registered server\&. If a server is not already running, then it is activated\&. If an \f3endpointType\fR value is not specified, then the plain/non-protected endpoint associated with each ORB in a server is returned\&.
++.TP
++.ll 180
++locateperorb -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR [ -orbid \fIORB-name\fR ]
++Locates all the endpoints (ports) registered by a specific Object Request Broker (ORB) of registered server\&. If a server is not already running, then it is activated\&. If an \f3orbid\fR is not specified, then the default value of \f3""\fR is assigned to the \f3orbid\fR\&. If any ORBs are created with an \f3orbid\fR of empty string, then all ports registered by it are returned\&.
++.TP
++orblist -serverid \fIserver-id\fR | -applicationName \fIapplication-name\fR
++Lists the \f3ORBId\fR of the ORBs defined on a server\&. An \f3ORBId\fR is the string name for the ORB created by the server\&. If the server is not already running, then it is activated\&.
++.TP
++shutdown -serverid \fIserver-id\fR | -applicationName application-name
++Shut down an active server that is registered with ORBD\&. During execution of this command, the \f3shutdown\fR method defined in the class specified by either the \f3-serverid\fR or \f3-applicationName\fR parameter is also called to shut down the server process\&.
++.TP
++startup -serverid \fIserver-id\fR | -applicationName application-name
++Starts up or activate a server that is registered with ORBD\&. If the server is not running, then this command starts the server\&. If the server is already running, then an error message is displayed\&.
++.TP
++help
++Lists all the commands available to the server through the \f3servertool\fR command\&.
++.TP
++quit
++Exits the \f3servertool\fR command\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++orbd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/tnameserv.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/tnameserv.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 1999, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java IDL and RMI-IIOP Tools
+-.\" Title: tnameserv.1
+-.\"
+-.if n .pl 99999
+-.TH tnameserv 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java IDL and RMI-IIOP Tools
++.\" Title: tnameserv.1
++.\"
++.if n .pl 99999
++.TH tnameserv 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,441 +47,441 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-tnameserv \- Interface Definition Language (IDL)\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBtnameserve\fR \fB\-ORBInitialPort\fR [ \fInameserverport\fR ]
+-.fi
+-.sp
+-.TP
+--ORBInitialPort \fInameserverport\fR
+-.br
+-The initial port where the naming service listens for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references\fR methods\&.
+-.SH DESCRIPTION
+-Java IDL includes the Object Request Broker Daemon (ORBD)\&. ORBD is a daemon process that contains a Bootstrap Service, a Transient Naming Service, a Persistent Naming Service, and a Server Manager\&. The Java IDL tutorials all use ORBD, but you can substitute the \f3tnameserv\fR command for the \f3orbd\fR command in any of the examples that use a Transient Naming Service\&.
+-.PP
+-See orbd(1) or Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
+-.PP
+-The CORBA Common Object Services (COS) Naming Service provides a tree-structure directory for object references similar to a file system that provides a directory structure for files\&. The Transient Naming Service provided with Java IDL, \f3tnameserv\fR, is a simple implementation of the COS Naming Service specification\&.
+-.PP
+-Object references are stored in the name space by name and each object reference-name pair is called a name binding\&. Name bindings can be organized under naming contexts\&. Naming contexts are name bindings and serve the same organizational function as a file system subdirectory\&. All bindings are stored under the initial naming context\&. The initial naming context is the only persistent binding in the name space\&. The rest of the name space is lost when the Java IDL naming service process stops and restarts\&.
+-.PP
+-For an applet or application to use COS naming, its ORB must know the port of a host running a naming service or have access to an initial naming context string for that naming service\&. The naming service can either be the Java IDL naming service or another COS-compliant naming service\&.
+-.SS START\ THE\ NAMING\ SERVICE
+-You must start the Java IDL naming service before an application or applet that uses its naming service\&. Installation of the Java IDL product creates a script (Oracle Solaris: \f3tnameserv\fR) or executable file (Windows: \f3tnameserv\&.exe\fR) that starts the Java IDL naming service\&. Start the naming service so it runs in the background\&.
+-.PP
+-If you do not specify otherwise, then the Java IDL naming service listens on port 900 for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references methods\fR, as follows:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort nameserverport&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-If you do not specify the name server port, then port 900 is used by default\&. When running Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number greater than or equal to 1024\&. To specify a different port, for example, 1050, and to run the naming service in the background, from a UNIX command shell, enter:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort 1050&\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-From an MS-DOS system prompt (Windows), enter:
+-.sp
+-.nf
+-\f3start tnameserv \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Clients of the name server must be made aware of the new port number\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR property to the new port number when you create the ORB object\&.
+-.SS RUN\ THE\ SERVER\ AND\ CLIENT\ ON\ DIFFERENT\ HOSTS
+-In most of the Java IDL and RMI-IIOP tutorials, the naming service, server, and client are all running on the development machine\&. In real-world deployment, the client and server probably run on different host machines from the Naming Service\&.
+-.PP
+-For the client and server to find the Naming Service, they must be made aware of the port number and host on which the naming service is running\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR and \f3org\&.omg\&.CORBA\&.ORBInitialHost\fR properties in the client and server files to the machine name and port number on which the Naming Service is running\&. An example of this is shown in Getting Started Using RMI-IIOP at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi-iiop/rmiiiopexample\&.html
+-.PP
+-You could also use the command-line options \f3-ORBInitialPort nameserverport#\fR and \f3-ORBInitialHost nameserverhostname\fR to tell the client and server where to find the naming service\&. For one example of doing this using the command-line option, see Java IDL: The Hello World Example on Two Machines at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.html
+-.PP
+-For example, suppose the Transient Naming Service, \f3tnameserv\fR is running on port 1050 on host \f3nameserverhost\fR\&. The client is running on host \f3clienthost,\fR and the server is running on host \f3serverhost\fR\&.
+-.PP
+-Start \f3tnameserv\fR on the host \f3nameserverhost\fR:
+-.sp
+-.nf
+-\f3tnameserv \-ORBInitialPort 1050\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Start the server on the \f3serverhost\fR:
+-.sp
+-.nf
+-\f3java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-Start the client on the \f3clienthost\fR:
+-.sp
+-.nf
+-\f3java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS STOP\ THE\ NAMING\ SERVICE
+-To stop the Java IDL naming service, use the relevant operating system command, such as \f3kill\fR for a Unix process or \f3Ctrl+C\fR for a Windows process\&. The naming service continues to wait for invocations until it is explicitly shut down\&. Note that names registered with the Java IDL naming service disappear when the service is terminated\&.
+-.SH OPTIONS
+-.TP
+--J\fIoption\fR
+-.br
+-Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH EXAMPLES
+-.SS ADD\ OBJECTS\ TO\ THE\ NAME\ SPACE
+-The following example shows how to add names to the name space\&. It is a self-contained Transient Naming Service client that creates the following simple tree\&.
+-.sp
+-.nf
+-\f3Initial Naming Context\fP
+-.fi
+-.nf
+-\f3 plans\fP
+-.fi
+-.nf
+-\f3 Personal\fP
+-.fi
+-.nf
+-\f3 calendar\fP
+-.fi
+-.nf
+-\f3 schedule\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In this example, \f3plans\fR is an object reference and \f3Personal\fR is a naming context that contains two object references: \f3calendar\fR and \f3schedule\fR\&.
+-.sp
+-.nf
+-\f3import java\&.util\&.Properties;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CORBA\&.*;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CosNaming\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class NameClient {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public static void main(String args[]) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
+-.sp
+-.nf
+-\f3 Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3 ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code obtains the initial naming context and assigns it to \f3ctx\fR\&. The second line copies \f3ctx\fR into a dummy object reference \f3objref\fR that is attached to various names and added into the name space\&.
+-.sp
+-.nf
+-\f3 NamingContext ctx =\fP
+-.fi
+-.nf
+-\f3 NamingContextHelper\&.narrow(\fP
+-.fi
+-.nf
+-\f3 orb\&.resolve_initial_references("NameService"));\fP
+-.fi
+-.nf
+-\f3 NamingContext objref = ctx;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code creates a name \f3plans\fR of type \f3text\fR and binds it to the dummy object reference\&. \f3plans\fR is then added under the initial naming context using the \f3rebind\fR method\&. The \f3rebind\fR method enables you to run this program over and over again without getting the exceptions from using the \f3bind\fR method\&.
+-.sp
+-.nf
+-\f3 NameComponent nc1 = new NameComponent("plans", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name1 = {nc1};\fP
+-.fi
+-.nf
+-\f3 ctx\&.rebind(name1, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("plans rebind successful!");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code creates a naming context called \f3Personal\fR of type \f3directory\fR\&. The resulting object reference, \f3ctx2\fR, is bound to the \f3name\fR and added under the initial naming context\&.
+-.sp
+-.nf
+-\f3 NameComponent nc2 = new NameComponent("Personal", "directory");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name2 = {nc2};\fP
+-.fi
+-.nf
+-\f3 NamingContext ctx2 = ctx\&.bind_new_context(name2);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("new naming context added\&.\&.");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The remainder of the code binds the dummy object reference using the names \f3schedule\fR and \f3calendar\fR under the \f3Personal\fR naming context (\f3ctx2\fR)\&.
+-.sp
+-.nf
+-\f3 NameComponent nc3 = new NameComponent("schedule", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name3 = {nc3};\fP
+-.fi
+-.nf
+-\f3 ctx2\&.rebind(name3, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("schedule rebind successful!");\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 NameComponent nc4 = new NameComponent("calender", "text");\fP
+-.fi
+-.nf
+-\f3 NameComponent[] name4 = {nc4};\fP
+-.fi
+-.nf
+-\f3 ctx2\&.rebind(name4, objref);\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("calender rebind successful!");\fP
+-.fi
+-.nf
+-\f3 } catch (Exception e) {\fP
+-.fi
+-.nf
+-\f3 e\&.printStackTrace(System\&.err);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SS BROWSING\ THE\ NAME\ SPACE
+-The following sample program shoes how to browse the name space\&.
+-.sp
+-.nf
+-\f3import java\&.util\&.Properties;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CORBA\&.*;\fP
+-.fi
+-.nf
+-\f3import org\&.omg\&.CosNaming\&.*;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3public class NameClientList {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 public static void main(String args[]) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 try {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
+-.sp
+-.nf
+-\f3 Properties props = new Properties();\fP
+-.fi
+-.nf
+-\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
+-.fi
+-.nf
+-\f3 ORB orb = ORB\&.init(args, props);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following code obtains the initial naming context\&.
+-.sp
+-.nf
+-\f3 NamingContext nc =\fP
+-.fi
+-.nf
+-\f3 NamingContextHelper\&.narrow(\fP
+-.fi
+-.nf
+-\f3 orb\&.resolve_initial_references("NameService"));\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The \f3list\fR method lists the bindings in the naming context\&. In this case, up to 1000 bindings from the initial naming context will be returned in the \f3BindingListHolder\fR; any remaining bindings are returned in the \f3BindingIteratorHolder\fR\&.
+-.sp
+-.nf
+-\f3 BindingListHolder bl = new BindingListHolder();\fP
+-.fi
+-.nf
+-\f3 BindingIteratorHolder blIt= new BindingIteratorHolder();\fP
+-.fi
+-.nf
+-\f3 nc\&.list(1000, bl, blIt);\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-This code gets the array of bindings out of the returned \f3BindingListHolder\fR\&. If there are no bindings, then the program ends\&.
+-.sp
+-.nf
+-\f3 Binding bindings[] = bl\&.value;\fP
+-.fi
+-.nf
+-\f3 if (bindings\&.length == 0) return;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The remainder of the code loops through the bindings and prints outs the names\&.
+-.sp
+-.nf
+-\f3 for (int i=0; i < bindings\&.length; i++) {\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 // get the object reference for each binding\fP
+-.fi
+-.nf
+-\f3 org\&.omg\&.CORBA\&.Object obj = nc\&.resolve(bindings[i]\&.binding_name);\fP
+-.fi
+-.nf
+-\f3 String objStr = orb\&.object_to_string(obj);\fP
+-.fi
+-.nf
+-\f3 int lastIx = bindings[i]\&.binding_name\&.length\-1;\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.nf
+-\f3 // check to see if this is a naming context\fP
+-.fi
+-.nf
+-\f3 if (bindings[i]\&.binding_type == BindingType\&.ncontext) {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Context: " +\fP
+-.fi
+-.nf
+-\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
+-.fi
+-.nf
+-\f3 } else {\fP
+-.fi
+-.nf
+-\f3 System\&.out\&.println("Object: " +\fP
+-.fi
+-.nf
+-\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 } catch (Exception e) {\fP
+-.fi
+-.nf
+-\f3 e\&.printStackTrace(System\&.err)\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3 }\fP
+-.fi
+-.nf
+-\f3}\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-orbd(1)
++
++.SH NAME
++tnameserv \- Interface Definition Language (IDL)\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBtnameserve\fR \fB\-ORBInitialPort\fR [ \fInameserverport\fR ]
++.fi
++.sp
++.TP
++-ORBInitialPort \fInameserverport\fR
++.br
++The initial port where the naming service listens for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references\fR methods\&.
++.SH DESCRIPTION
++Java IDL includes the Object Request Broker Daemon (ORBD)\&. ORBD is a daemon process that contains a Bootstrap Service, a Transient Naming Service, a Persistent Naming Service, and a Server Manager\&. The Java IDL tutorials all use ORBD, but you can substitute the \f3tnameserv\fR command for the \f3orbd\fR command in any of the examples that use a Transient Naming Service\&.
++.PP
++See orbd(1) or Naming Service at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html
++.PP
++The CORBA Common Object Services (COS) Naming Service provides a tree-structure directory for object references similar to a file system that provides a directory structure for files\&. The Transient Naming Service provided with Java IDL, \f3tnameserv\fR, is a simple implementation of the COS Naming Service specification\&.
++.PP
++Object references are stored in the name space by name and each object reference-name pair is called a name binding\&. Name bindings can be organized under naming contexts\&. Naming contexts are name bindings and serve the same organizational function as a file system subdirectory\&. All bindings are stored under the initial naming context\&. The initial naming context is the only persistent binding in the name space\&. The rest of the name space is lost when the Java IDL naming service process stops and restarts\&.
++.PP
++For an applet or application to use COS naming, its ORB must know the port of a host running a naming service or have access to an initial naming context string for that naming service\&. The naming service can either be the Java IDL naming service or another COS-compliant naming service\&.
++.SS START\ THE\ NAMING\ SERVICE
++You must start the Java IDL naming service before an application or applet that uses its naming service\&. Installation of the Java IDL product creates a script (Oracle Solaris: \f3tnameserv\fR) or executable file (Windows: \f3tnameserv\&.exe\fR) that starts the Java IDL naming service\&. Start the naming service so it runs in the background\&.
++.PP
++If you do not specify otherwise, then the Java IDL naming service listens on port 900 for the bootstrap protocol used to implement the ORB \f3resolve_initial_references\fR and \f3list_initial_references methods\fR, as follows:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort nameserverport&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++If you do not specify the name server port, then port 900 is used by default\&. When running Oracle Solaris software, you must become the root user to start a process on a port below 1024\&. For this reason, it is recommended that you use a port number greater than or equal to 1024\&. To specify a different port, for example, 1050, and to run the naming service in the background, from a UNIX command shell, enter:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort 1050&\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++From an MS-DOS system prompt (Windows), enter:
++.sp
++.nf
++\f3start tnameserv \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Clients of the name server must be made aware of the new port number\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR property to the new port number when you create the ORB object\&.
++.SS RUN\ THE\ SERVER\ AND\ CLIENT\ ON\ DIFFERENT\ HOSTS
++In most of the Java IDL and RMI-IIOP tutorials, the naming service, server, and client are all running on the development machine\&. In real-world deployment, the client and server probably run on different host machines from the Naming Service\&.
++.PP
++For the client and server to find the Naming Service, they must be made aware of the port number and host on which the naming service is running\&. Do this by setting the \f3org\&.omg\&.CORBA\&.ORBInitialPort\fR and \f3org\&.omg\&.CORBA\&.ORBInitialHost\fR properties in the client and server files to the machine name and port number on which the Naming Service is running\&. An example of this is shown in Getting Started Using RMI-IIOP at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi-iiop/rmiiiopexample\&.html
++.PP
++You could also use the command-line options \f3-ORBInitialPort nameserverport#\fR and \f3-ORBInitialHost nameserverhostname\fR to tell the client and server where to find the naming service\&. For one example of doing this using the command-line option, see Java IDL: The Hello World Example on Two Machines at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.html
++.PP
++For example, suppose the Transient Naming Service, \f3tnameserv\fR is running on port 1050 on host \f3nameserverhost\fR\&. The client is running on host \f3clienthost,\fR and the server is running on host \f3serverhost\fR\&.
++.PP
++Start \f3tnameserv\fR on the host \f3nameserverhost\fR:
++.sp
++.nf
++\f3tnameserv \-ORBInitialPort 1050\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Start the server on the \f3serverhost\fR:
++.sp
++.nf
++\f3java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++Start the client on the \f3clienthost\fR:
++.sp
++.nf
++\f3java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS STOP\ THE\ NAMING\ SERVICE
++To stop the Java IDL naming service, use the relevant operating system command, such as \f3kill\fR for a Unix process or \f3Ctrl+C\fR for a Windows process\&. The naming service continues to wait for invocations until it is explicitly shut down\&. Note that names registered with the Java IDL naming service disappear when the service is terminated\&.
++.SH OPTIONS
++.TP
++-J\fIoption\fR
++.br
++Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH EXAMPLES
++.SS ADD\ OBJECTS\ TO\ THE\ NAME\ SPACE
++The following example shows how to add names to the name space\&. It is a self-contained Transient Naming Service client that creates the following simple tree\&.
++.sp
++.nf
++\f3Initial Naming Context\fP
++.fi
++.nf
++\f3 plans\fP
++.fi
++.nf
++\f3 Personal\fP
++.fi
++.nf
++\f3 calendar\fP
++.fi
++.nf
++\f3 schedule\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In this example, \f3plans\fR is an object reference and \f3Personal\fR is a naming context that contains two object references: \f3calendar\fR and \f3schedule\fR\&.
++.sp
++.nf
++\f3import java\&.util\&.Properties;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CORBA\&.*;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CosNaming\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class NameClient {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public static void main(String args[]) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
++.sp
++.nf
++\f3 Properties props = new Properties();\fP
++.fi
++.nf
++\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3 ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code obtains the initial naming context and assigns it to \f3ctx\fR\&. The second line copies \f3ctx\fR into a dummy object reference \f3objref\fR that is attached to various names and added into the name space\&.
++.sp
++.nf
++\f3 NamingContext ctx =\fP
++.fi
++.nf
++\f3 NamingContextHelper\&.narrow(\fP
++.fi
++.nf
++\f3 orb\&.resolve_initial_references("NameService"));\fP
++.fi
++.nf
++\f3 NamingContext objref = ctx;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code creates a name \f3plans\fR of type \f3text\fR and binds it to the dummy object reference\&. \f3plans\fR is then added under the initial naming context using the \f3rebind\fR method\&. The \f3rebind\fR method enables you to run this program over and over again without getting the exceptions from using the \f3bind\fR method\&.
++.sp
++.nf
++\f3 NameComponent nc1 = new NameComponent("plans", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name1 = {nc1};\fP
++.fi
++.nf
++\f3 ctx\&.rebind(name1, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("plans rebind successful!");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code creates a naming context called \f3Personal\fR of type \f3directory\fR\&. The resulting object reference, \f3ctx2\fR, is bound to the \f3name\fR and added under the initial naming context\&.
++.sp
++.nf
++\f3 NameComponent nc2 = new NameComponent("Personal", "directory");\fP
++.fi
++.nf
++\f3 NameComponent[] name2 = {nc2};\fP
++.fi
++.nf
++\f3 NamingContext ctx2 = ctx\&.bind_new_context(name2);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("new naming context added\&.\&.");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The remainder of the code binds the dummy object reference using the names \f3schedule\fR and \f3calendar\fR under the \f3Personal\fR naming context (\f3ctx2\fR)\&.
++.sp
++.nf
++\f3 NameComponent nc3 = new NameComponent("schedule", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name3 = {nc3};\fP
++.fi
++.nf
++\f3 ctx2\&.rebind(name3, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("schedule rebind successful!");\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 NameComponent nc4 = new NameComponent("calender", "text");\fP
++.fi
++.nf
++\f3 NameComponent[] name4 = {nc4};\fP
++.fi
++.nf
++\f3 ctx2\&.rebind(name4, objref);\fP
++.fi
++.nf
++\f3 System\&.out\&.println("calender rebind successful!");\fP
++.fi
++.nf
++\f3 } catch (Exception e) {\fP
++.fi
++.nf
++\f3 e\&.printStackTrace(System\&.err);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SS BROWSING\ THE\ NAME\ SPACE
++The following sample program shoes how to browse the name space\&.
++.sp
++.nf
++\f3import java\&.util\&.Properties;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CORBA\&.*;\fP
++.fi
++.nf
++\f3import org\&.omg\&.CosNaming\&.*;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3public class NameClientList {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 public static void main(String args[]) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 try {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++In Start the Naming Service, the \f3nameserver\fR was started on port 1050\&. The following code ensures that the client program is aware of this port number\&.
++.sp
++.nf
++\f3 Properties props = new Properties();\fP
++.fi
++.nf
++\f3 props\&.put("org\&.omg\&.CORBA\&.ORBInitialPort", "1050");\fP
++.fi
++.nf
++\f3 ORB orb = ORB\&.init(args, props);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following code obtains the initial naming context\&.
++.sp
++.nf
++\f3 NamingContext nc =\fP
++.fi
++.nf
++\f3 NamingContextHelper\&.narrow(\fP
++.fi
++.nf
++\f3 orb\&.resolve_initial_references("NameService"));\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The \f3list\fR method lists the bindings in the naming context\&. In this case, up to 1000 bindings from the initial naming context will be returned in the \f3BindingListHolder\fR; any remaining bindings are returned in the \f3BindingIteratorHolder\fR\&.
++.sp
++.nf
++\f3 BindingListHolder bl = new BindingListHolder();\fP
++.fi
++.nf
++\f3 BindingIteratorHolder blIt= new BindingIteratorHolder();\fP
++.fi
++.nf
++\f3 nc\&.list(1000, bl, blIt);\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++This code gets the array of bindings out of the returned \f3BindingListHolder\fR\&. If there are no bindings, then the program ends\&.
++.sp
++.nf
++\f3 Binding bindings[] = bl\&.value;\fP
++.fi
++.nf
++\f3 if (bindings\&.length == 0) return;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The remainder of the code loops through the bindings and prints outs the names\&.
++.sp
++.nf
++\f3 for (int i=0; i < bindings\&.length; i++) {\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 // get the object reference for each binding\fP
++.fi
++.nf
++\f3 org\&.omg\&.CORBA\&.Object obj = nc\&.resolve(bindings[i]\&.binding_name);\fP
++.fi
++.nf
++\f3 String objStr = orb\&.object_to_string(obj);\fP
++.fi
++.nf
++\f3 int lastIx = bindings[i]\&.binding_name\&.length\-1;\fP
++.fi
++.nf
++\f3\fP
++.fi
++.nf
++\f3 // check to see if this is a naming context\fP
++.fi
++.nf
++\f3 if (bindings[i]\&.binding_type == BindingType\&.ncontext) {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Context: " +\fP
++.fi
++.nf
++\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
++.fi
++.nf
++\f3 } else {\fP
++.fi
++.nf
++\f3 System\&.out\&.println("Object: " +\fP
++.fi
++.nf
++\f3 bindings[i]\&.binding_name[lastIx]\&.id);\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 } catch (Exception e) {\fP
++.fi
++.nf
++\f3 e\&.printStackTrace(System\&.err)\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3 }\fP
++.fi
++.nf
++\f3}\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++orbd(1)
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/unpack200.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/unpack200.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2004, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Deployment Tools
+-.\" Title: unpack200.1
+-.\"
+-.if n .pl 99999
+-.TH unpack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Deployment Tools
++.\" Title: unpack200.1
++.\"
++.if n .pl 99999
++.TH unpack200 1 "21 November 2013" "JDK 8" "Java Deployment Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,90 +47,90 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-unpack200 \- Transforms a packed file produced by pack200(1) into a JAR file for web deployment\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBunpack200\fR [ \fIoptions\fR ] input\-file \fIJAR\-file\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIinput-file\fR
+-Name of the input file, which can be a pack200 gzip file or a pack200 file\&. The input can also be JAR file produced by \f3pack200\fR(1) with an effort of \f30\fR, in which case the contents of the input file are copied to the output JAR file with the Pack200 marker\&.
+-.TP
+-\fIJAR-file\fR
+-Name of the output JAR file\&.
+-.SH DESCRIPTION
+-The \f3unpack200\fR command is a native implementation that transforms a packed file produced by \f3pack200\fR\f3(1)\fR into a JAR file\&. A typical usage follows\&. In the following example, the \f3myarchive\&.jar\fR file is produced from \f3myarchive\&.pack\&.gz\fR with the default \f3unpack200\fR command settings\&.
+-.sp
+-.nf
+-\f3unpack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--Hvalue --deflate-hint=\fIvalue\fR
+-.br
+-Sets the deflation to be \f3true\fR, \f3false\fR, or \f3keep\fR on all entries within a JAR file\&. The default mode is \f3keep\fR\&. If the value is \f3true\fR or \f3false\fR, then the \f3--deflate=hint\fR option overrides the default behavior and sets the deflation mode on all entries within the output JAR file\&.
+-.TP
+--r --remove-pack-file
+-.br
+-Removes the input pack file\&.
+-.TP
+--v --verbose
+-.br
+-Displays minimal messages\&. Multiple specifications of this option displays more verbose messages\&.
+-.TP
+--q --quiet
+-.br
+-Specifies quiet operation with no messages\&.
+-.TP
+--lfilename --log-file=\fIfilename\fR
+-.br
+-Specifies a log file where output messages are logged\&.
+-.TP
+--? -h --help
+-.br
+-Prints help information about the \f3unpack200\fR command\&.
+-.TP
+--V --version
+-.br
+-Prints version information about the \f3unpack200\fR command\&.
+-.TP
+--J\fIoption\fR
+-.br
+-Passes option to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
+-.SH NOTES
+-This command should not be confused with the \f3unpack\fR command\&. They are distinctly separate products\&.
+-.PP
+-The Java SE API Specification provided with the JDK is the superseding authority in case of discrepancies\&.
+-.SH EXIT\ STATUS
+-The following exit values are returned: 0 for successful completion, and a value that is greater than 0 when an error occurred\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-pack200(1)
+-.TP 0.2i
+-\(bu
+-jar(1)
+-.TP 0.2i
+-\(bu
+-jarsigner(1)
+-.TP 0.2i
+-\(bu
+-Pack200 and Compression at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment-guide/pack200\&.html
+-.TP 0.2i
+-\(bu
+-The Java SE Technical Documentation page at http://docs\&.oracle\&.com/javase/
++
++.SH NAME
++unpack200 \- Transforms a packed file produced by pack200(1) into a JAR file for web deployment\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBunpack200\fR [ \fIoptions\fR ] input\-file \fIJAR\-file\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIinput-file\fR
++Name of the input file, which can be a pack200 gzip file or a pack200 file\&. The input can also be JAR file produced by \f3pack200\fR(1) with an effort of \f30\fR, in which case the contents of the input file are copied to the output JAR file with the Pack200 marker\&.
++.TP
++\fIJAR-file\fR
++Name of the output JAR file\&.
++.SH DESCRIPTION
++The \f3unpack200\fR command is a native implementation that transforms a packed file produced by \f3pack200\fR\f3(1)\fR into a JAR file\&. A typical usage follows\&. In the following example, the \f3myarchive\&.jar\fR file is produced from \f3myarchive\&.pack\&.gz\fR with the default \f3unpack200\fR command settings\&.
++.sp
++.nf
++\f3unpack200 myarchive\&.pack\&.gz myarchive\&.jar\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-Hvalue --deflate-hint=\fIvalue\fR
++.br
++Sets the deflation to be \f3true\fR, \f3false\fR, or \f3keep\fR on all entries within a JAR file\&. The default mode is \f3keep\fR\&. If the value is \f3true\fR or \f3false\fR, then the \f3--deflate=hint\fR option overrides the default behavior and sets the deflation mode on all entries within the output JAR file\&.
++.TP
++-r --remove-pack-file
++.br
++Removes the input pack file\&.
++.TP
++-v --verbose
++.br
++Displays minimal messages\&. Multiple specifications of this option displays more verbose messages\&.
++.TP
++-q --quiet
++.br
++Specifies quiet operation with no messages\&.
++.TP
++-lfilename --log-file=\fIfilename\fR
++.br
++Specifies a log file where output messages are logged\&.
++.TP
++-? -h --help
++.br
++Prints help information about the \f3unpack200\fR command\&.
++.TP
++-V --version
++.br
++Prints version information about the \f3unpack200\fR command\&.
++.TP
++-J\fIoption\fR
++.br
++Passes option to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
++.SH NOTES
++This command should not be confused with the \f3unpack\fR command\&. They are distinctly separate products\&.
++.PP
++The Java SE API Specification provided with the JDK is the superseding authority in case of discrepancies\&.
++.SH EXIT\ STATUS
++The following exit values are returned: 0 for successful completion, and a value that is greater than 0 when an error occurred\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++pack200(1)
++.TP 0.2i
++\(bu
++jar(1)
++.TP 0.2i
++\(bu
++jarsigner(1)
++.TP 0.2i
++\(bu
++Pack200 and Compression at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment-guide/pack200\&.html
++.TP 0.2i
++\(bu
++The Java SE Technical Documentation page at http://docs\&.oracle\&.com/javase/
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/wsgen.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/wsgen.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: wsgen.1
+-.\"
+-.if n .pl 99999
+-.TH wsgen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: wsgen.1
++.\"
++.if n .pl 99999
++.TH wsgen 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,128 +47,128 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-wsgen \- Reads a web service endpoint implementation (SEI) class and generates all of the required artifacts for web service deployment, and invocation\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBwsgen\fR [ \fIoptions\fR ] \fISEI\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fISEI\fR
+-The web service endpoint implementation class (SEI) to be read\&.
+-.SH DESCRIPTION
+-The \f3wsgen\fR command generates JAX-WS portable artifacts used in JAX-WS web services\&. The tool reads a web service endpoint class and generates all the required artifacts for web service deployment and invocation\&. JAXWS 2\&.1\&.1 RI also provides a \f3wsgen\fR Ant task, see the \fITools\fR tab of the JAX-WS (wsgen) page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
+-.PP
+-To start the \f3wsgen\fR command, do the following:
+-.sp
+-.nf
+-\f3export JAXWS_HOME=/pathto/jaxws\-ri\fP
+-.fi
+-.nf
+-\f3$JAXWS_HOME/bin/wsgen\&.sh \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--classpath \fIpath\fR
+-.br
+-The location of the input class files\&.
+-.TP
+--cp \fIpath\fR
+-.br
+-The location of the input class files\&.
+-.TP
+--d \fIdirectory\fR
+-.br
+-The location for where to place generated output files\&.
+-.TP
+--extension
+-.br
+-Allow vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
+-.TP
+--help
+-.br
+-Displays a help message about the \f3wsgen\fR command\&.
+-.TP
+--keep
+-.br
+-Keeps the generated files\&.
+-.TP
+--r \fIdirectory\fR
+-.br
+-Uses this option with the \f3-wsdl\fR option to specify where to place generated resource files such as WSDLs\&.
+-.TP
+--s \fIdirectory\fR
+-.br
+-The location for where to place generated source files\&.
+-.TP
+--verbose
+-.br
+-Displays compiler messages\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--wsdl [ :protocol ] \fI\fR
+-.br
+-An optional command that generates a WSDL file to review before endpoint deployment\&. The WSDL files contains a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns\&.
+-
+-By default the \f3wsgen\fR command does not generate a WSDL file\&. The \f3protocol\fR value is optional and is used to specify what protocol should be used for the WSDL binding (\f3wsdl:binding\fR)\&. Valid protocols are \f3soap1\&.1\fR and \f3Xsoap1\&.2\fR\&. The default is \f3soap1\&.1\fR\&. The \f3Xsoap1\&.2\fR protocol is not standard and can only be used with the \f3-extension\fR option\&.
+-.TP
+--servicename \fIname\fR
+-.br
+-Used only with the \f3-wsdl\fR option to specify a particular WSDL service (\f3wsdl:service\fR) name to be generated in the WSDL, for example: \f3-servicename "{http://mynamespace/}MyService"\fR\&.
+-.TP
+--portname \fIname\fR
+-.br
+-Used only with the \f3-wsdl\fR option to specify a particular WSDL port (\f3wsdl:port\fR) name to be generated in the WSDL, for example: \f3-portname "{http://mynamespace/}MyPort"\fR\&.
+-.SH EXAMPLES
+-The following example generates the wrapper classes for \f3StockService\fR with \f3@WebService\fR annotations inside stock directory\&.
+-.sp
+-.nf
+-\f3wsgen \-d stock \-cp myclasspath stock\&.StockService\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example generates a SOAP 1\&.1 WSDL and schema for the \f3stock\&.StockService\fR class with \f3@WebService\fR annotations\&.
+-.sp
+-.nf
+-\f3wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-The following example generates a SOAP 1\&.2 WSDL\&.
+-.sp
+-.nf
+-\f3wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService \fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fINote:\fR You do not have to generate WSDL at development time because the JAXWS run time environment generates a WSDL for you when you deploy your service\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-wsimport(1)
+-.TP 0.2i
+-\(bu
+-\fIThe Tools\fR tab of the JAX-WS (wsgen) page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
++
++.SH NAME
++wsgen \- Reads a web service endpoint implementation (SEI) class and generates all of the required artifacts for web service deployment, and invocation\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBwsgen\fR [ \fIoptions\fR ] \fISEI\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fISEI\fR
++The web service endpoint implementation class (SEI) to be read\&.
++.SH DESCRIPTION
++The \f3wsgen\fR command generates JAX-WS portable artifacts used in JAX-WS web services\&. The tool reads a web service endpoint class and generates all the required artifacts for web service deployment and invocation\&. JAXWS 2\&.1\&.1 RI also provides a \f3wsgen\fR Ant task, see the \fITools\fR tab of the JAX-WS (wsgen) page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
++.PP
++To start the \f3wsgen\fR command, do the following:
++.sp
++.nf
++\f3export JAXWS_HOME=/pathto/jaxws\-ri\fP
++.fi
++.nf
++\f3$JAXWS_HOME/bin/wsgen\&.sh \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-classpath \fIpath\fR
++.br
++The location of the input class files\&.
++.TP
++-cp \fIpath\fR
++.br
++The location of the input class files\&.
++.TP
++-d \fIdirectory\fR
++.br
++The location for where to place generated output files\&.
++.TP
++-extension
++.br
++Allow vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
++.TP
++-help
++.br
++Displays a help message about the \f3wsgen\fR command\&.
++.TP
++-keep
++.br
++Keeps the generated files\&.
++.TP
++-r \fIdirectory\fR
++.br
++Uses this option with the \f3-wsdl\fR option to specify where to place generated resource files such as WSDLs\&.
++.TP
++-s \fIdirectory\fR
++.br
++The location for where to place generated source files\&.
++.TP
++-verbose
++.br
++Displays compiler messages\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-wsdl [ :protocol ] \fI\fR
++.br
++An optional command that generates a WSDL file to review before endpoint deployment\&. The WSDL files contains a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns\&.
++
++By default the \f3wsgen\fR command does not generate a WSDL file\&. The \f3protocol\fR value is optional and is used to specify what protocol should be used for the WSDL binding (\f3wsdl:binding\fR)\&. Valid protocols are \f3soap1\&.1\fR and \f3Xsoap1\&.2\fR\&. The default is \f3soap1\&.1\fR\&. The \f3Xsoap1\&.2\fR protocol is not standard and can only be used with the \f3-extension\fR option\&.
++.TP
++-servicename \fIname\fR
++.br
++Used only with the \f3-wsdl\fR option to specify a particular WSDL service (\f3wsdl:service\fR) name to be generated in the WSDL, for example: \f3-servicename "{http://mynamespace/}MyService"\fR\&.
++.TP
++-portname \fIname\fR
++.br
++Used only with the \f3-wsdl\fR option to specify a particular WSDL port (\f3wsdl:port\fR) name to be generated in the WSDL, for example: \f3-portname "{http://mynamespace/}MyPort"\fR\&.
++.SH EXAMPLES
++The following example generates the wrapper classes for \f3StockService\fR with \f3@WebService\fR annotations inside stock directory\&.
++.sp
++.nf
++\f3wsgen \-d stock \-cp myclasspath stock\&.StockService\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example generates a SOAP 1\&.1 WSDL and schema for the \f3stock\&.StockService\fR class with \f3@WebService\fR annotations\&.
++.sp
++.nf
++\f3wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++The following example generates a SOAP 1\&.2 WSDL\&.
++.sp
++.nf
++\f3wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService \fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fINote:\fR You do not have to generate WSDL at development time because the JAXWS run time environment generates a WSDL for you when you deploy your service\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++wsimport(1)
++.TP 0.2i
++\(bu
++\fIThe Tools\fR tab of the JAX-WS (wsgen) page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/wsimport.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/wsimport.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: wsimport.1
+-.\"
+-.if n .pl 99999
+-.TH wsimport 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: wsimport.1
++.\"
++.if n .pl 99999
++.TH wsimport 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,169 +47,169 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-wsimport \- Generates JAX-WS portable artifacts that can be packaged in a web application archive (WAR) file and provides an Ant task\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBwsimport\fR [ \fIoptions\fR ] \fIwsdl\fR
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-\fIwsdl\fR
+-The file that contains the machine-readable description of how the web service can be called, what parameters it expects, and what data structures it returns\&.
+-.SH DESCRIPTION
+-The \f3wsimport\fR command generates the following JAX-WS portable artifacts\&. These artifacts can be packaged in a WAR file with the WSDL and schema documents and the endpoint implementation to be deployed\&. The \f3wsimport\fR command also provides a \f3wsimport\fR Ant task, see the Tools tab of the Wsimport Ant Task page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP 0.2i
+-\(bu
+-Service Endpoint Interface (SEI)
+-.TP 0.2i
+-\(bu
+-Service
+-.TP 0.2i
+-\(bu
+-Exception class is mapped from \f3wsdl:fault\fR (if any)
+-.TP 0.2i
+-\(bu
+-Async Response Bean is derived from response \f3wsdl:message\fR (if any)
+-.TP 0.2i
+-\(bu
+-JAXB generated value types (mapped java classes from schema types)
+-.PP
+-To start the \f3wsgen\fR command, do the following:
+-.PP
+-\fIOracle Solaris/Linux\fR:
+-.sp
+-.nf
+-\f3/bin/wsimport\&.sh \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-\fIWindows\fR:
+-.sp
+-.nf
+-\f3\ebin\ewsimport\&.bat \-help\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH OPTIONS
+-.TP
+--d \fIdirectory\fR
+-.br
+-Specifies where to place generated output files\&.
+-.TP
+--b \fIpath\fR
+-.br
+-Specifies external JAX-WS or JAXB binding files\&. Multiple JAX-WS and JAXB binding files can be specified with the \f3-b\fR option\&. You can use these files to customize package names, bean names, and so on\&. For more information about JAX-WS and JAXB binding files, see the \fIUsers Guide\fR tab of WSDL Customization at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP
+--B \fIjaxbOption\fR
+-.br
+-Passes the \f3jaxbOption\fR option to the JAXB schema compiler\&.
+-.TP
+--catalog
+-.br
+-Specifies a catalog file to resolve external entity references\&. The \f3-catalog\fR option supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See the \fIUsers Guide\fR tab of the Catalog Support page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
+-.TP
+--extension
+-.br
+-Allows vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
+-.TP
+--help
+-.br
+-Displays a help message for the \f3wsimport\fR command\&.
+-.TP
+--httpproxy: \fIhost\fR:\fIport\fR
+-.br
+-Specifies an HTTP proxy server\&. The default is 8080\&.
+-.TP
+--keep
+-.br
+-Keeps generated files\&.
+-.TP
+--p \fIname\fR
+-.br
+-Specifies a target package \fIname\fR to override the WSDL and schema binding customizations, and the default algorithm defined in the specification\&.
+-.TP
+--s \fIdirectory\fR
+-.br
+-Specifies where to place generated source files\&.
+-.TP
+--verbose
+-.br
+-Displays compiler messages\&.
+-.TP
+--version
+-.br
+-Prints release information\&.
+-.TP
+--wsdllocation \fIlocation\fR
+-.br
+-Specifies the \f3@WebServiceClient\&.wsdlLocation\fR value\&.
+-.TP
+--target
+-.br
+-Generates code according to the specified JAX-WS specification version\&. Version 2\&.0 generates compliant code for the JAX-WS 2\&.0 specification\&.
+-.TP
+--quiet
+-.br
+-Suppresses the \f3wsimport\fR command output\&.
+-.PP
+-Multiple \f3JAX-WS\fR and \f3JAXB\fR binding files can be specified using the \f3-b\fR option, and they can be used to customize various things such as package names and bean names\&. More information about \f3JAX-WS\fR and \f3JAXB\fR binding files can be found in the customization documentation at https://jax-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.html
+-.SH NONSTANDARD\ OPTIONS
+-.TP
+--XadditionalHeaders
+-.br
+-Maps headers not bound to a request or response message to Java method parameters\&.
+-.TP
+--Xauthfile \fIfile\fR
+-.br
+-The WSDL URI that specifies the file that contains authorization information\&. This URI is in the following format:
+-
+-http://\fIuser-name\fR:\f3password\fR@\fIhost-name\fR/\fIweb-service-name\fR>?wsdl\&.
+-.TP
+--Xdebug
+-.br
+-Prints debugging information\&.
+-.TP
+--Xno-addressing-databinding
+-.br
+-Enables binding of W3C EndpointReferenceType to Java\&.
+-.TP
+--Xnocompile
+-.br
+-Does not compile the generated Java files\&.
+-.SH EXAMPLE
+-The following example generates the Java artifacts and compiles the artifacts by importing \f3http://stockquote\&.example\&.com/quote?wsdl\fR
+-.sp
+-.nf
+-\f3wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl\fP
+-.fi
+-.nf
+-\f3\fP
+-.fi
+-.sp
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-wsgen(1)
+-.TP 0.2i
+-\(bu
+-The Tools tab of Wsimport Ant Task page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+-.TP 0.2i
+-\(bu
+-The \fIUsers Guide\fR tab of Catalog Support page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
+-.TP 0.2i
+-\(bu
+-The \fIUsers Guide\fR tab of WSDL Customization page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++
++.SH NAME
++wsimport \- Generates JAX-WS portable artifacts that can be packaged in a web application archive (WAR) file and provides an Ant task\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBwsimport\fR [ \fIoptions\fR ] \fIwsdl\fR
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++\fIwsdl\fR
++The file that contains the machine-readable description of how the web service can be called, what parameters it expects, and what data structures it returns\&.
++.SH DESCRIPTION
++The \f3wsimport\fR command generates the following JAX-WS portable artifacts\&. These artifacts can be packaged in a WAR file with the WSDL and schema documents and the endpoint implementation to be deployed\&. The \f3wsimport\fR command also provides a \f3wsimport\fR Ant task, see the Tools tab of the Wsimport Ant Task page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP 0.2i
++\(bu
++Service Endpoint Interface (SEI)
++.TP 0.2i
++\(bu
++Service
++.TP 0.2i
++\(bu
++Exception class is mapped from \f3wsdl:fault\fR (if any)
++.TP 0.2i
++\(bu
++Async Response Bean is derived from response \f3wsdl:message\fR (if any)
++.TP 0.2i
++\(bu
++JAXB generated value types (mapped java classes from schema types)
++.PP
++To start the \f3wsgen\fR command, do the following:
++.PP
++\fIOracle Solaris/Linux\fR:
++.sp
++.nf
++\f3/bin/wsimport\&.sh \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++\fIWindows\fR:
++.sp
++.nf
++\f3\ebin\ewsimport\&.bat \-help\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH OPTIONS
++.TP
++-d \fIdirectory\fR
++.br
++Specifies where to place generated output files\&.
++.TP
++-b \fIpath\fR
++.br
++Specifies external JAX-WS or JAXB binding files\&. Multiple JAX-WS and JAXB binding files can be specified with the \f3-b\fR option\&. You can use these files to customize package names, bean names, and so on\&. For more information about JAX-WS and JAXB binding files, see the \fIUsers Guide\fR tab of WSDL Customization at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP
++-B \fIjaxbOption\fR
++.br
++Passes the \f3jaxbOption\fR option to the JAXB schema compiler\&.
++.TP
++-catalog
++.br
++Specifies a catalog file to resolve external entity references\&. The \f3-catalog\fR option supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See the \fIUsers Guide\fR tab of the Catalog Support page at http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
++.TP
++-extension
++.br
++Allows vendor extensions\&. Use of extensions can result in applications that are not portable or that do not work with other implementations\&.
++.TP
++-help
++.br
++Displays a help message for the \f3wsimport\fR command\&.
++.TP
++-httpproxy: \fIhost\fR:\fIport\fR
++.br
++Specifies an HTTP proxy server\&. The default is 8080\&.
++.TP
++-keep
++.br
++Keeps generated files\&.
++.TP
++-p \fIname\fR
++.br
++Specifies a target package \fIname\fR to override the WSDL and schema binding customizations, and the default algorithm defined in the specification\&.
++.TP
++-s \fIdirectory\fR
++.br
++Specifies where to place generated source files\&.
++.TP
++-verbose
++.br
++Displays compiler messages\&.
++.TP
++-version
++.br
++Prints release information\&.
++.TP
++-wsdllocation \fIlocation\fR
++.br
++Specifies the \f3@WebServiceClient\&.wsdlLocation\fR value\&.
++.TP
++-target
++.br
++Generates code according to the specified JAX-WS specification version\&. Version 2\&.0 generates compliant code for the JAX-WS 2\&.0 specification\&.
++.TP
++-quiet
++.br
++Suppresses the \f3wsimport\fR command output\&.
++.PP
++Multiple \f3JAX-WS\fR and \f3JAXB\fR binding files can be specified using the \f3-b\fR option, and they can be used to customize various things such as package names and bean names\&. More information about \f3JAX-WS\fR and \f3JAXB\fR binding files can be found in the customization documentation at https://jax-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.html
++.SH NONSTANDARD\ OPTIONS
++.TP
++-XadditionalHeaders
++.br
++Maps headers not bound to a request or response message to Java method parameters\&.
++.TP
++-Xauthfile \fIfile\fR
++.br
++The WSDL URI that specifies the file that contains authorization information\&. This URI is in the following format:
++
++http://\fIuser-name\fR:\f3password\fR@\fIhost-name\fR/\fIweb-service-name\fR>?wsdl\&.
++.TP
++-Xdebug
++.br
++Prints debugging information\&.
++.TP
++-Xno-addressing-databinding
++.br
++Enables binding of W3C EndpointReferenceType to Java\&.
++.TP
++-Xnocompile
++.br
++Does not compile the generated Java files\&.
++.SH EXAMPLE
++The following example generates the Java artifacts and compiles the artifacts by importing \f3http://stockquote\&.example\&.com/quote?wsdl\fR
++.sp
++.nf
++\f3wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl\fP
++.fi
++.nf
++\f3\fP
++.fi
++.sp
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++wsgen(1)
++.TP 0.2i
++\(bu
++The Tools tab of Wsimport Ant Task page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
++.TP 0.2i
++\(bu
++The \fIUsers Guide\fR tab of Catalog Support page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog-support\&.html
++.TP 0.2i
++\(bu
++The \fIUsers Guide\fR tab of WSDL Customization page http://jax-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/doc/sun/man/man1/xjc.1 Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/doc/sun/man/man1/xjc.1 Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,5 @@
+-'\" t
+-.\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+-.\"
++'\" t
++.\" Copyright (c) 2005, 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
+@@ -21,14 +20,14 @@
+ .\" or visit www.oracle.com if you need additional information or have any
+ .\" questions.
+ .\"
+-.\" Arch: generic
+-.\" Software: JDK 8
+-.\" Date: 21 November 2013
+-.\" SectDesc: Java Web Services Tools
+-.\" Title: xjc.1
+-.\"
+-.if n .pl 99999
+-.TH xjc 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
++.\" Arch: generic
++.\" Software: JDK 8
++.\" Date: 21 November 2013
++.\" SectDesc: Java Web Services Tools
++.\" Title: xjc.1
++.\"
++.if n .pl 99999
++.TH xjc 1 "21 November 2013" "JDK 8" "Java Web Services Tools"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -48,185 +47,185 @@
+ .\" -----------------------------------------------------------------
+ .\" * MAIN CONTENT STARTS HERE *
+ .\" -----------------------------------------------------------------
+-
+-.SH NAME
+-xjc \- Compiles an XML schema file into fully annotated Java classes\&.
+-.SH SYNOPSIS
+-.sp
+-.nf
+-
+-\fBxjc\fR [ \fIoptions\fR ] \fBschema\fR \fIfile/URL/dir/jar\fR \&.\&.\&. [\fB\-b\fR \fIbindinfo\fR ] \&.\&.\&.
+-.fi
+-.sp
+-.TP
+-\fIoptions\fR
+-The command-line options\&. See Options\&.
+-.TP
+-schema \fIfile/URL/dir/jar \&.\&.\&.\fR
+-The location of the XML schema file\&. If \f3dir\fR is specified, then all schema files in it are compiled\&. If \f3jar\fR is specified, then the \f3/META-INF/sun-jaxb\&.episode\fR binding file is compiled\&.
+-.TP
+--b \fIbindinfo\fR
+-.br
+-The location of the bindings files\&.
+-.SH DESCRIPTION
+-Start the binding compiler with the appropriate \f3xjc\fR shell script in the bin directory for your platform\&. There is also an Ant task to run the binding complier\&. See Using the XJC with Ant at http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html
+-.SH OPTIONS
+-.TP 0.2i
+-\(bu
+-See also Nonstandard Options
+-.TP 0.2i
+-\(bu
+-See also Deprecated and Removed Options
+-.TP
+--nv
+-.br
+-By default, the XJC binding compiler performs strict validation of the source schema before processing it\&. Use this option to disable strict schema validation\&. This does not mean that the binding compiler will not perform any validation, but means that it will perform a less-strict validation\&.
+-.TP
+--extension
+-.br
+-By default, the XJC binding compiler strictly enforces the rules outlined in the Compatibility chapter of the JAXB Specification\&. Appendix E\&.2 defines a set of W3C XML Schema features that are not completely supported by JAXB v1\&.0\&. In some cases, you may be allowed to use them in the \f3-extension\fR mode enabled by this switch\&. In the default (strict) mode, you are also limited to using only the binding customization defined in the specification\&. By using the \f3-extension\fR switch, you will be allowed to use the JAXB Vendor Extensions\&.
+-.TP
+--b \fIfile\fR
+-.br
+-Specifies one or more external binding files to process\&. Each binding file must have its own \f3-b\fR switch\&. The syntax of the external binding files is flexible\&. You can have a single binding file that contains customization for multiple schemas or you can break the customization into multiple bindings files: \f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings123\&.xjb\fR\f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings1\&.xjb -b bindings2\&.xjb -b bindings3\&.xjb\fR\&. In addition, the ordering of the schema files and binding files on the command line does not matter\&.
+-.TP
+--d \fIdir\fR
+-.br
+-By default, the XJC binding compiler generates the Java content classes in the current directory\&. Use this option to specify an alternate output directory\&. The output directory must already exist\&. The XJC binding compiler does not create it for you\&.
+-.TP
+--p \fIpkg\fR
+-.br
+-When you specify a target package with this command-line option, it overrides any binding customization for the package name and the default package name algorithm defined in the specification\&.
+-.TP
+--httpproxy \fIproxy\fR
+-.br
+-Specifies the HTTP or HTTPS proxy in the format \fI[user[:password]@]proxyHost[:proxyPort]\fR\&. The old \f3-host\fR and \f3-port\fR options are still supported by the RI for backward compatibility, but they were deprecated\&. The password specified with this option is an argument that is visible to other users who use the top command\&. For greater security, use the \f3-httpproxyfile\fR option\&.
+-.TP
+--httpproxyfile file
+-.br
+-Specifies the HTTP or HTTPS proxy with a file\&. The same format as the \f3-httpproxy\fR option, but the password specified in the file is not visible to other users\&.
+-.TP
+--classpath arg
+-.br
+-Specifies where to find client application class files used by the \fIjxb:javaType\fR and xjc:\fIsuperClass\fR customization\&.
+-.TP
+--catalog file
+-.br
+-Specifies catalog files to resolve external entity references\&. Supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See XML Entity and URI Resolvers at http://xerces\&.apache\&.org/xml-commons/components/resolver/resolver-article\&.html
+-.TP
+--readOnly
+-.br
+-By default, the XJC binding compiler does not write-protect the Java source files it generates\&. Use this option to force the XJC binding compiler to mark the generated Java sources as read-only\&.
+-.TP
+--npa
+-.br
+-Suppresses the generation of package level annotations into \f3**/package-info\&.java\fR\&. Using this switch causes the generated code to internalize those annotations into the other generated classes\&.
+-.TP
+--no-header
+-.br
+-Suppresses the generation of a file header comment that includes some note and time stamp\&. Using this makes the generated code more compatible with the \f3diff\fR command\&.
+-.TP
+--target 2\&.0
+-.br
+-Avoids generating code that relies on any JAXB 2\&.1 features\&. This will allow the generated code to run with JAXB 2\&.0 runtime environment (such as Java SE 6)\&.
+-.TP
+--xmlschema
+-.br
+-Treats input schemas as W3C XML Schema (default)\&. If you do not specify this switch, then your input schemas are treated as though they are W3C XML Schemas\&.
+-.TP
+--relaxing
+-.br
+-Treats input schemas as RELAX NG (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--relaxing-compact
+-.br
+-Treat input schemas as RELAX NG compact syntax (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--dtd
+-.br
+-Treats input schemas as XML DTD (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
+-.TP
+--wsdl
+-.br
+-Treats input as WSDL and compiles schemas inside it (experimental and unsupported)\&.
+-.TP
+--quiet
+-.br
+-Suppress compiler output, such as progress information and warnings\&.
+-.TP
+--verbose
+-.br
+-Be extra verbose, such as printing informational messages or displaying stack traces upon some errors\&.
+-.TP
+--help
+-.br
+-Displays a brief summary of the compiler switches\&.
+-.TP
+--version
+-.br
+-Displays the compiler version information\&.
+-.TP
+-\fIschema file/URL/dir\fR
+-Specifies one or more schema files to compile\&. If you specify a directory, then the \f3xjc\fR command scans it for all schema files and compiles them\&.
+-.SS NONSTANDARD\ OPTIONS
+-.TP
+--XLocator
+-.br
+-Causes the generated code to expose SAX Locator information about the source XML in the Java bean instances after unmarshalling\&.
+-.TP
+--Xsync-methods
+-.br
+-Causes all of the generated method signatures to include the \f3synchronized\fR keyword\&.
+-.TP
+--mark-generated
+-.br
+-Marks the generated code with the annotation \f3@javax\&.annotation\&.Generated\fR\&.
+-.TP
+--episode file
+-.br
+-Generates the specified episode file for separate compilation\&.
+-.SS DEPRECATED\ AND\ REMOVED\ OPTIONS
+-.TP
+--host & -port
+-.br
+-These options are replaced with the \f3-httpproxy\fR option\&. For backward compatibility, these options are supported, but will not be documented and might be removed from future releases\&.
+-.TP
+--use-runtime
+-.br
+-Because the JAXB 2\&.0 specification has defined a portable runtime environment, it is no longer necessary for the JAXB RI to generate \f3**/impl/runtime\fRpackages\&. Therefore, this switch is obsolete and was removed\&.
+-.TP
+--source
+-.br
+-The \f3-source\fR compatibility switch was introduced in the first JAXB 2\&.0 Early Access release\&. This switch is removed from future releases of JAXB 2\&.0\&. If you need to generate 1\&.0\&.x code, then use an installation of the 1\&.0\&.x code base\&.
+-.SH COMPILER\ RESTRICTIONS
+-In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches\&. Keep the following list of restrictions in mind when running the \f3xjc\fR command\&. Most of these issues only apply when you compile multiple schemas with multiple invocations of the \f3xjc\fR command\&.
+-.PP
+-To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
+-.TP 0.4i
+-1\&.
+-The \f3-p\fR option has the highest precedence\&.
+-.TP 0.4i
+-2\&.
+-\fIjaxb:package\fR customization\&.
+-.TP 0.4i
+-3\&.
+-If \f3targetNamespace\fR is declared, then apply the \f3t\fR\f3argetNamespace\fR to the Java package name algorithm defined in the specification\&.
+-.TP 0.4i
+-4\&.
+-If no \f3targetNamespace\fR is declared, then use a hard coded package named \f3generated\fR\&.
+-.PP
+-You cannot have more than one \fIjaxb:schemaBindings\fR per name space, so it is impossible to have two schemas in the same target name space compiled into different Java packages\&.
+-.PP
+-All schemas being compiled into the same Java package must be submitted to the XJC binding compiler at the same time\&. They cannot be compiled independently and work as expected\&.
+-.PP
+-Element substitution groups that are spread across multiple schema files must be compiled at the same time\&.
+-.SH SEE\ ALSO
+-.TP 0.2i
+-\(bu
+-Binding Compiler (xjc) at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html
+-.TP 0.2i
+-\(bu
+-Java Architecture for XML Binding (JAXB) at http://www\&.oracle\&.com/technetwork/articles/javase/index-140168\&.html
++
++.SH NAME
++xjc \- Compiles an XML schema file into fully annotated Java classes\&.
++.SH SYNOPSIS
++.sp
++.nf
++
++\fBxjc\fR [ \fIoptions\fR ] \fBschema\fR \fIfile/URL/dir/jar\fR \&.\&.\&. [\fB\-b\fR \fIbindinfo\fR ] \&.\&.\&.
++.fi
++.sp
++.TP
++\fIoptions\fR
++The command-line options\&. See Options\&.
++.TP
++schema \fIfile/URL/dir/jar \&.\&.\&.\fR
++The location of the XML schema file\&. If \f3dir\fR is specified, then all schema files in it are compiled\&. If \f3jar\fR is specified, then the \f3/META-INF/sun-jaxb\&.episode\fR binding file is compiled\&.
++.TP
++-b \fIbindinfo\fR
++.br
++The location of the bindings files\&.
++.SH DESCRIPTION
++Start the binding compiler with the appropriate \f3xjc\fR shell script in the bin directory for your platform\&. There is also an Ant task to run the binding complier\&. See Using the XJC with Ant at http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html
++.SH OPTIONS
++.TP 0.2i
++\(bu
++See also Nonstandard Options
++.TP 0.2i
++\(bu
++See also Deprecated and Removed Options
++.TP
++-nv
++.br
++By default, the XJC binding compiler performs strict validation of the source schema before processing it\&. Use this option to disable strict schema validation\&. This does not mean that the binding compiler will not perform any validation, but means that it will perform a less-strict validation\&.
++.TP
++-extension
++.br
++By default, the XJC binding compiler strictly enforces the rules outlined in the Compatibility chapter of the JAXB Specification\&. Appendix E\&.2 defines a set of W3C XML Schema features that are not completely supported by JAXB v1\&.0\&. In some cases, you may be allowed to use them in the \f3-extension\fR mode enabled by this switch\&. In the default (strict) mode, you are also limited to using only the binding customization defined in the specification\&. By using the \f3-extension\fR switch, you will be allowed to use the JAXB Vendor Extensions\&.
++.TP
++-b \fIfile\fR
++.br
++Specifies one or more external binding files to process\&. Each binding file must have its own \f3-b\fR switch\&. The syntax of the external binding files is flexible\&. You can have a single binding file that contains customization for multiple schemas or you can break the customization into multiple bindings files: \f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings123\&.xjb\fR\f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings1\&.xjb -b bindings2\&.xjb -b bindings3\&.xjb\fR\&. In addition, the ordering of the schema files and binding files on the command line does not matter\&.
++.TP
++-d \fIdir\fR
++.br
++By default, the XJC binding compiler generates the Java content classes in the current directory\&. Use this option to specify an alternate output directory\&. The output directory must already exist\&. The XJC binding compiler does not create it for you\&.
++.TP
++-p \fIpkg\fR
++.br
++When you specify a target package with this command-line option, it overrides any binding customization for the package name and the default package name algorithm defined in the specification\&.
++.TP
++-httpproxy \fIproxy\fR
++.br
++Specifies the HTTP or HTTPS proxy in the format \fI[user[:password]@]proxyHost[:proxyPort]\fR\&. The old \f3-host\fR and \f3-port\fR options are still supported by the RI for backward compatibility, but they were deprecated\&. The password specified with this option is an argument that is visible to other users who use the top command\&. For greater security, use the \f3-httpproxyfile\fR option\&.
++.TP
++-httpproxyfile file
++.br
++Specifies the HTTP or HTTPS proxy with a file\&. The same format as the \f3-httpproxy\fR option, but the password specified in the file is not visible to other users\&.
++.TP
++-classpath arg
++.br
++Specifies where to find client application class files used by the \fIjxb:javaType\fR and xjc:\fIsuperClass\fR customization\&.
++.TP
++-catalog file
++.br
++Specifies catalog files to resolve external entity references\&. Supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See XML Entity and URI Resolvers at http://xerces\&.apache\&.org/xml-commons/components/resolver/resolver-article\&.html
++.TP
++-readOnly
++.br
++By default, the XJC binding compiler does not write-protect the Java source files it generates\&. Use this option to force the XJC binding compiler to mark the generated Java sources as read-only\&.
++.TP
++-npa
++.br
++Suppresses the generation of package level annotations into \f3**/package-info\&.java\fR\&. Using this switch causes the generated code to internalize those annotations into the other generated classes\&.
++.TP
++-no-header
++.br
++Suppresses the generation of a file header comment that includes some note and time stamp\&. Using this makes the generated code more compatible with the \f3diff\fR command\&.
++.TP
++-target 2\&.0
++.br
++Avoids generating code that relies on any JAXB 2\&.1 features\&. This will allow the generated code to run with JAXB 2\&.0 runtime environment (such as Java SE 6)\&.
++.TP
++-xmlschema
++.br
++Treats input schemas as W3C XML Schema (default)\&. If you do not specify this switch, then your input schemas are treated as though they are W3C XML Schemas\&.
++.TP
++-relaxing
++.br
++Treats input schemas as RELAX NG (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-relaxing-compact
++.br
++Treat input schemas as RELAX NG compact syntax (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-dtd
++.br
++Treats input schemas as XML DTD (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&.
++.TP
++-wsdl
++.br
++Treats input as WSDL and compiles schemas inside it (experimental and unsupported)\&.
++.TP
++-quiet
++.br
++Suppress compiler output, such as progress information and warnings\&.
++.TP
++-verbose
++.br
++Be extra verbose, such as printing informational messages or displaying stack traces upon some errors\&.
++.TP
++-help
++.br
++Displays a brief summary of the compiler switches\&.
++.TP
++-version
++.br
++Displays the compiler version information\&.
++.TP
++\fIschema file/URL/dir\fR
++Specifies one or more schema files to compile\&. If you specify a directory, then the \f3xjc\fR command scans it for all schema files and compiles them\&.
++.SS NONSTANDARD\ OPTIONS
++.TP
++-XLocator
++.br
++Causes the generated code to expose SAX Locator information about the source XML in the Java bean instances after unmarshalling\&.
++.TP
++-Xsync-methods
++.br
++Causes all of the generated method signatures to include the \f3synchronized\fR keyword\&.
++.TP
++-mark-generated
++.br
++Marks the generated code with the annotation \f3@javax\&.annotation\&.Generated\fR\&.
++.TP
++-episode file
++.br
++Generates the specified episode file for separate compilation\&.
++.SS DEPRECATED\ AND\ REMOVED\ OPTIONS
++.TP
++-host & -port
++.br
++These options are replaced with the \f3-httpproxy\fR option\&. For backward compatibility, these options are supported, but will not be documented and might be removed from future releases\&.
++.TP
++-use-runtime
++.br
++Because the JAXB 2\&.0 specification has defined a portable runtime environment, it is no longer necessary for the JAXB RI to generate \f3**/impl/runtime\fRpackages\&. Therefore, this switch is obsolete and was removed\&.
++.TP
++-source
++.br
++The \f3-source\fR compatibility switch was introduced in the first JAXB 2\&.0 Early Access release\&. This switch is removed from future releases of JAXB 2\&.0\&. If you need to generate 1\&.0\&.x code, then use an installation of the 1\&.0\&.x code base\&.
++.SH COMPILER\ RESTRICTIONS
++In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches\&. Keep the following list of restrictions in mind when running the \f3xjc\fR command\&. Most of these issues only apply when you compile multiple schemas with multiple invocations of the \f3xjc\fR command\&.
++.PP
++To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
++.TP 0.4i
++1\&.
++The \f3-p\fR option has the highest precedence\&.
++.TP 0.4i
++2\&.
++\fIjaxb:package\fR customization\&.
++.TP 0.4i
++3\&.
++If \f3targetNamespace\fR is declared, then apply the \f3t\fR\f3argetNamespace\fR to the Java package name algorithm defined in the specification\&.
++.TP 0.4i
++4\&.
++If no \f3targetNamespace\fR is declared, then use a hard coded package named \f3generated\fR\&.
++.PP
++You cannot have more than one \fIjaxb:schemaBindings\fR per name space, so it is impossible to have two schemas in the same target name space compiled into different Java packages\&.
++.PP
++All schemas being compiled into the same Java package must be submitted to the XJC binding compiler at the same time\&. They cannot be compiled independently and work as expected\&.
++.PP
++Element substitution groups that are spread across multiple schema files must be compiled at the same time\&.
++.SH SEE\ ALSO
++.TP 0.2i
++\(bu
++Binding Compiler (xjc) at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html
++.TP 0.2i
++\(bu
++Java Architecture for XML Binding (JAXB) at http://www\&.oracle\&.com/technetwork/articles/javase/index-140168\&.html
+ .RE
+ .br
+ 'pl 8.5i
+--- ./jdk/src/solaris/native/java/io/UnixFileSystem_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/java/io/UnixFileSystem_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -283,6 +283,10 @@
+ struct dirent64 *result;
+ int len, maxlen;
+ jobjectArray rv, old;
++ jclass str_class;
++
++ str_class = JNU_ClassString(env);
++ CHECK_NULL_RETURN(str_class, NULL);
+
+ WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
+ dir = opendir(path);
+@@ -299,7 +303,7 @@
+ /* Allocate an initial String array */
+ len = 0;
+ maxlen = 16;
+- rv = (*env)->NewObjectArray(env, maxlen, JNU_ClassString(env), NULL);
++ rv = (*env)->NewObjectArray(env, maxlen, str_class, NULL);
+ if (rv == NULL) goto error;
+
+ /* Scan the directory */
+@@ -309,8 +313,7 @@
+ continue;
+ if (len == maxlen) {
+ old = rv;
+- rv = (*env)->NewObjectArray(env, maxlen <<= 1,
+- JNU_ClassString(env), NULL);
++ rv = (*env)->NewObjectArray(env, maxlen <<= 1, str_class, NULL);
+ if (rv == NULL) goto error;
+ if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error;
+ (*env)->DeleteLocalRef(env, old);
+@@ -329,7 +332,7 @@
+
+ /* Copy the final results into an appropriately-sized array */
+ old = rv;
+- rv = (*env)->NewObjectArray(env, len, JNU_ClassString(env), NULL);
++ rv = (*env)->NewObjectArray(env, len, str_class, NULL);
+ if (rv == NULL) {
+ return NULL;
+ }
+--- ./jdk/src/solaris/native/java/net/Inet4AddressImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/java/net/Inet4AddressImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -144,7 +144,7 @@
+ jobjectArray ret = 0;
+ int retLen = 0;
+
+- int error=0;
++ int getaddrinfo_error=0;
+ struct addrinfo hints, *res, *resNew = NULL;
+
+ if (!initializeInetClasses(env))
+@@ -172,22 +172,23 @@
+ return NULL;
+ }
+
++ getaddrinfo_error = getaddrinfo(hostname, NULL, &hints, &res);
++
+ #ifdef MACOSX
+- /* If we're looking up the local machine, bypass DNS lookups and get
+- * address from getifaddrs.
+- */
+- ret = lookupIfLocalhost(env, hostname, JNI_FALSE);
+- if (ret != NULL || (*env)->ExceptionCheck(env)) {
+- JNU_ReleaseStringPlatformChars(env, host, hostname);
+- return ret;
++ if (getaddrinfo_error) {
++ // If getaddrinfo fails try getifaddrs.
++ ret = lookupIfLocalhost(env, hostname, JNI_FALSE);
++ if (ret != NULL || (*env)->ExceptionCheck(env)) {
++ JNU_ReleaseStringPlatformChars(env, host, hostname);
++ return ret;
++ }
+ }
+ #endif
+
+- error = getaddrinfo(hostname, NULL, &hints, &res);
+-
+- if (error) {
++ if (getaddrinfo_error) {
+ /* report error */
+- ThrowUnknownHostExceptionWithGaiError(env, hostname, error);
++ ThrowUnknownHostExceptionWithGaiError(
++ env, hostname, getaddrinfo_error);
+ JNU_ReleaseStringPlatformChars(env, host, hostname);
+ return NULL;
+ } else {
+--- ./jdk/src/solaris/native/java/net/Inet6AddressImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/java/net/Inet6AddressImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -196,6 +196,10 @@
+ }
+
+ name = (*env)->NewStringUTF(env, hostname);
++ if (name == NULL) {
++ freeifaddrs(ifa);
++ return NULL;
++ }
+
+ /* Iterate over the interfaces, and total up the number of IPv4 and IPv6
+ * addresses we have. Also keep a count of loopback addresses. We need to
+@@ -292,7 +296,7 @@
+ jobjectArray ret = 0;
+ int retLen = 0;
+
+- int error=0;
++ int getaddrinfo_error=0;
+ #ifdef AF_INET6
+ struct addrinfo hints, *res, *resNew = NULL;
+ #endif /* AF_INET6 */
+@@ -307,19 +311,6 @@
+ hostname = JNU_GetStringPlatformChars(env, host, JNI_FALSE);
+ CHECK_NULL_RETURN(hostname, NULL);
+
+-#ifdef MACOSX
+- /*
+- * If we're looking up the local machine, attempt to get the address
+- * from getifaddrs. This ensures we get an IPv6 address for the local
+- * machine.
+- */
+- ret = lookupIfLocalhost(env, hostname, JNI_TRUE);
+- if (ret != NULL || (*env)->ExceptionCheck(env)) {
+- JNU_ReleaseStringPlatformChars(env, host, hostname);
+- return ret;
+- }
+-#endif
+-
+ #ifdef AF_INET6
+ /* Try once, with our static buffer. */
+ memset(&hints, 0, sizeof(hints));
+@@ -339,11 +330,27 @@
+ }
+ #endif
+
+- error = getaddrinfo(hostname, NULL, &hints, &res);
++ getaddrinfo_error = getaddrinfo(hostname, NULL, &hints, &res);
+
+- if (error) {
++#ifdef MACOSX
++ if (getaddrinfo_error) {
++ /*
++ * If getaddrinfo fails looking up the local machine, attempt to get the
++ * address from getifaddrs. This ensures we get an IPv6 address for the
++ * local machine.
++ */
++ ret = lookupIfLocalhost(env, hostname, JNI_TRUE);
++ if (ret != NULL || (*env)->ExceptionCheck(env)) {
++ JNU_ReleaseStringPlatformChars(env, host, hostname);
++ return ret;
++ }
++ }
++#endif
++
++ if (getaddrinfo_error) {
+ /* report error */
+- ThrowUnknownHostExceptionWithGaiError(env, hostname, error);
++ ThrowUnknownHostExceptionWithGaiError(
++ env, hostname, getaddrinfo_error);
+ JNU_ReleaseStringPlatformChars(env, host, hostname);
+ return NULL;
+ } else {
+--- ./jdk/src/solaris/native/java/net/NetworkInterface.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/java/net/NetworkInterface.c Wed Jul 01 21:53:30 2015 -0700
+@@ -253,6 +253,7 @@
+ if (name_utf == NULL) {
+ if (!(*env)->ExceptionCheck(env))
+ JNU_ThrowOutOfMemoryError(env, NULL);
++ freeif(ifs);
+ return NULL;
+ }
+ /*
+@@ -527,9 +528,9 @@
+ JNU_ThrowOutOfMemoryError(env, NULL);
+ return NULL;
+ }
+- if ((sock =openSocketWithFallback(env, name_utf)) < 0) {
++ if ((sock = openSocketWithFallback(env, name_utf)) < 0) {
+ (*env)->ReleaseStringUTFChars(env, name, name_utf);
+- return JNI_FALSE;
++ return NULL;
+ }
+
+
+--- ./jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1321,11 +1321,11 @@
+
+ /*
+ * Class: java_net_PlainDatagramSocketImpl
+- * Method: socketSetOption
++ * Method: socketSetOption0
+ * Signature: (ILjava/lang/Object;)V
+ */
+ JNIEXPORT void JNICALL
+-Java_java_net_PlainDatagramSocketImpl_socketSetOption(JNIEnv *env,
++Java_java_net_PlainDatagramSocketImpl_socketSetOption0(JNIEnv *env,
+ jobject this,
+ jint opt,
+ jobject value) {
+--- ./jdk/src/solaris/native/java/net/PlainSocketImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/java/net/PlainSocketImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -885,11 +885,11 @@
+
+ /*
+ * Class: java_net_PlainSocketImpl
+- * Method: socketSetOption
++ * Method: socketSetOption0
+ * Signature: (IZLjava/lang/Object;)V
+ */
+ JNIEXPORT void JNICALL
+-Java_java_net_PlainSocketImpl_socketSetOption(JNIEnv *env, jobject this,
++Java_java_net_PlainSocketImpl_socketSetOption0(JNIEnv *env, jobject this,
+ jint cmd, jboolean on,
+ jobject value) {
+ int fd;
+--- ./jdk/src/solaris/native/java/net/net_util_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/java/net/net_util_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -97,6 +97,7 @@
+ CHECK_NULL(c);
+ ni_defaultIndexID = (*env)->GetStaticFieldID(
+ env, c, "defaultIndex", "I");
++ CHECK_NULL(ni_defaultIndexID);
+ ni_class = c;
+ }
+ int defaultIndex;
+@@ -119,6 +120,7 @@
+ CHECK_NULL_RETURN(c, 0);
+ ni_defaultIndexID = (*env)->GetStaticFieldID(env, c,
+ "defaultIndex", "I");
++ CHECK_NULL_RETURN(ni_defaultIndexID, 0);
+ ni_class = c;
+ }
+ int defaultIndex = 0;
+@@ -777,6 +779,11 @@
+ #endif
+ }
+
++JNIEXPORT jint JNICALL
++NET_EnableFastTcpLoopback(int fd) {
++ return 0;
++}
++
+ /* In the case of an IPv4 Inetaddress this method will return an
+ * IPv4 mapped address where IPv6 is available and v4MappedAddress is TRUE.
+ * Otherwise it will return a sockaddr_in structure for an IPv4 InetAddress.
+@@ -1005,12 +1012,10 @@
+
+ int i;
+
+- /*
+- * Different multicast options if IPv6 is enabled
+- */
+ #ifdef AF_INET6
+ if (ipv6_available()) {
+ switch (cmd) {
++ // Different multicast options if IPv6 is enabled
+ case java_net_SocketOptions_IP_MULTICAST_IF:
+ case java_net_SocketOptions_IP_MULTICAST_IF2:
+ *level = IPPROTO_IPV6;
+@@ -1021,6 +1026,13 @@
+ *level = IPPROTO_IPV6;
+ *optname = IPV6_MULTICAST_LOOP;
+ return 0;
++#if (defined(__solaris__) || defined(MACOSX))
++ // Map IP_TOS request to IPV6_TCLASS
++ case java_net_SocketOptions_IP_TOS:
++ *level = IPPROTO_IPV6;
++ *optname = IPV6_TCLASS;
++ return 0;
++#endif
+ }
+ }
+ #endif
+@@ -1196,9 +1208,6 @@
+ * Wrapper for getsockopt system routine - does any necessary
+ * pre/post processing to deal with OS specific oddities :-
+ *
+- * IP_TOS is a no-op with IPv6 sockets as it's setup when
+- * the connection is established.
+- *
+ * On Linux the SO_SNDBUF/SO_RCVBUF values must be post-processed
+ * to compensate for an incorrect value returned by the kernel.
+ */
+@@ -1208,21 +1217,6 @@
+ {
+ int rv;
+
+-#ifdef AF_INET6
+- if ((level == IPPROTO_IP) && (opt == IP_TOS)) {
+- if (ipv6_available()) {
+-
+- /*
+- * For IPv6 socket option implemented at Java-level
+- * so return -1.
+- */
+- int *tc = (int *)result;
+- *tc = -1;
+- return 0;
+- }
+- }
+-#endif
+-
+ #ifdef __solaris__
+ rv = getsockopt(fd, level, opt, result, len);
+ #else
+@@ -1273,8 +1267,7 @@
+ *
+ * For IP_TOS socket option need to mask off bits as this
+ * aren't automatically masked by the kernel and results in
+- * an error. In addition IP_TOS is a NOOP with IPv6 as it
+- * should be setup as connection time.
++ * an error.
+ */
+ int
+ NET_SetSockOpt(int fd, int level, int opt, const void *arg,
+@@ -1305,9 +1298,9 @@
+
+ /*
+ * IPPROTO/IP_TOS :-
+- * 1. IPv6 on Solaris/Mac OS: NOOP and will be set
+- * in flowinfo field when connecting TCP socket,
+- * or sending UDP packet.
++ * 1. IPv6 on Solaris/Mac OS:
++ * Set the TOS OR Traffic Class value to cater for
++ * IPv6 and IPv4 scenarios.
+ * 2. IPv6 on Linux: By default Linux ignores flowinfo
+ * field so enable IPV6_FLOWINFO_SEND so that flowinfo
+ * will be examined. We also set the IPv4 TOS option in this case.
+@@ -1317,12 +1310,6 @@
+ if (level == IPPROTO_IP && opt == IP_TOS) {
+ int *iptos;
+
+-#if defined(AF_INET6) && (defined(__solaris__) || defined(MACOSX))
+- if (ipv6_available()) {
+- return 0;
+- }
+-#endif
+-
+ #if defined(AF_INET6) && defined(__linux__)
+ if (ipv6_available()) {
+ int optval = 1;
+@@ -1330,6 +1317,16 @@
+ (void *)&optval, sizeof(optval)) < 0) {
+ return -1;
+ }
++ /*
++ * Let's also set the IPV6_TCLASS flag.
++ * Linux appears to allow both IP_TOS and IPV6_TCLASS to be set
++ * This helps in mixed environments where IPv4 and IPv6 sockets
++ * are connecting.
++ */
++ if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS,
++ arg, len) < 0) {
++ return -1;
++ }
+ }
+ #endif
+
+@@ -1422,7 +1419,7 @@
+ * On Linux the receive buffer is used for both socket
+ * structures and the the packet payload. The implication
+ * is that if SO_RCVBUF is too small then small packets
+- * must be discard.
++ * must be discarded.
+ */
+ #ifdef __linux__
+ if (level == SOL_SOCKET && opt == SO_RCVBUF) {
+@@ -1521,7 +1518,6 @@
+ int exclbind = -1;
+ #endif
+ int rv;
+- int arg, alen;
+
+ #ifdef __linux__
+ /*
+@@ -1538,7 +1534,7 @@
+ }
+ #endif
+
+-#if defined(__solaris__)
++#if defined(__solaris__) && defined(AF_INET6)
+ /*
+ * Solaris has separate IPv4 and IPv6 port spaces so we
+ * use an exclusive bind when SO_REUSEADDR is not used to
+@@ -1548,31 +1544,35 @@
+ * results in a late bind that fails because the
+ * corresponding IPv4 port is in use.
+ */
+- alen = sizeof(arg);
+- if (useExclBind || getsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
+- (char *)&arg, &alen) == 0) {
+- if (useExclBind || arg == 0) {
+- /*
+- * SO_REUSEADDR is disabled or sun.net.useExclusiveBind
+- * property is true so enable TCP_EXCLBIND or
+- * UDP_EXCLBIND
+- */
+- alen = sizeof(arg);
+- if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&arg,
+- &alen) == 0) {
+- if (arg == SOCK_STREAM) {
+- level = IPPROTO_TCP;
+- exclbind = TCP_EXCLBIND;
+- } else {
+- level = IPPROTO_UDP;
+- exclbind = UDP_EXCLBIND;
++ if (ipv6_available()) {
++ int arg, len;
++
++ len = sizeof(arg);
++ if (useExclBind || getsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
++ (char *)&arg, &len) == 0) {
++ if (useExclBind || arg == 0) {
++ /*
++ * SO_REUSEADDR is disabled or sun.net.useExclusiveBind
++ * property is true so enable TCP_EXCLBIND or
++ * UDP_EXCLBIND
++ */
++ len = sizeof(arg);
++ if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&arg,
++ &len) == 0) {
++ if (arg == SOCK_STREAM) {
++ level = IPPROTO_TCP;
++ exclbind = TCP_EXCLBIND;
++ } else {
++ level = IPPROTO_UDP;
++ exclbind = UDP_EXCLBIND;
++ }
+ }
++
++ arg = 1;
++ setsockopt(fd, level, exclbind, (char *)&arg,
++ sizeof(arg));
+ }
+-
+- arg = 1;
+- setsockopt(fd, level, exclbind, (char *)&arg,
+- sizeof(arg));
+- }
++ }
+ }
+
+ #endif
+@@ -1602,7 +1602,7 @@
+ * NET_WAIT_READ, NET_WAIT_WRITE & NET_WAIT_CONNECT.
+ *
+ * The function will return when either the socket is ready for one
+- * of the specified operation or the timeout expired.
++ * of the specified operations or the timeout expired.
+ *
+ * It returns the time left from the timeout (possibly 0), or -1 if it expired.
+ */
+--- ./jdk/src/solaris/native/sun/awt/awt_Event.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/awt/awt_Event.c Wed Jul 01 21:53:30 2015 -0700
+@@ -42,7 +42,7 @@
+ JNIEXPORT void JNICALL
+ Java_java_awt_Event_initIDs(JNIEnv *env, jclass cls)
+ {
+- eventIDs.data = (*env)->GetFieldID(env, cls, "data", "J");
+- eventIDs.consumed = (*env)->GetFieldID(env, cls, "consumed", "Z");
+- eventIDs.id = (*env)->GetFieldID(env, cls, "id", "I");
++ CHECK_NULL(eventIDs.data = (*env)->GetFieldID(env, cls, "data", "J"));
++ CHECK_NULL(eventIDs.consumed = (*env)->GetFieldID(env, cls, "consumed", "Z"));
++ CHECK_NULL(eventIDs.id = (*env)->GetFieldID(env, cls, "id", "I"));
+ }
+--- ./jdk/src/solaris/native/sun/awt/awt_Font.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/awt/awt_Font.c Wed Jul 01 21:53:30 2015 -0700
+@@ -579,6 +579,7 @@
+ Disposer_AddRecord(env, font, pDataDisposeMethod, ptr_to_jlong(fdata));
+ return fdata;
+ } else {
++ JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+ Display *display = NULL;
+ struct FontData *fdata = NULL;
+ char fontSpec[1024];
+--- ./jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c Wed Jul 01 21:53:30 2015 -0700
+@@ -23,6 +23,7 @@
+ * questions.
+ */
+
++#include "jni_util.h"
+ #include "awt_p.h"
+ #include "awt.h"
+ #include "color.h"
+@@ -763,6 +764,7 @@
+ XSetIOErrorHandler(xioerror_handler);
+ JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil", "init", "(J)V",
+ ptr_to_jlong(awt_display));
++ JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+
+ /* set awt_numScreens, and whether or not we're using Xinerama */
+ xineramaInit();
+@@ -789,6 +791,7 @@
+ x11Screens[i].root = RootWindow(awt_display, i);
+ }
+ x11Screens[i].defaultConfig = makeDefaultConfig(env, i);
++ JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+ }
+
+ return dpy;
+@@ -1495,7 +1498,7 @@
+ if (aData == NULL) {
+ return JNI_FALSE;
+ }
+- return (jboolean)aData->isTranslucencySupported;
++ return aData->isTranslucencySupported ? JNI_TRUE : JNI_FALSE;
+ #endif
+ }
+
+@@ -1575,9 +1578,9 @@
+ jobject this)
+ {
+ #ifdef HEADLESS
+- return false;
++ return JNI_FALSE;
+ #else
+- return usingXinerama;
++ return usingXinerama ? JNI_TRUE : JNI_FALSE;
+ #endif /* HEADLESS */
+ }
+
+@@ -1713,9 +1716,9 @@
+
+ /*
+ * REMIND: Fullscreen mode doesn't work quite right with multi-monitor
+- * setups and RANDR 1.2. So for now we also require a single screen.
++ * setups and RANDR 1.2.
+ */
+- if (awt_numScreens > 1 ) {
++ if ((rr_maj_ver == 1 && rr_min_ver <= 2) && awt_numScreens > 1) {
+ J2dRlsTraceLn(J2D_TRACE_INFO, "X11GD_InitXrandrFuncs: Can't use Xrandr. "
+ "Multiple screens in use");
+ dlclose(pLibRandR);
+@@ -1803,40 +1806,14 @@
+ Atom wmState = XInternAtom(awt_display, "_NET_WM_STATE", False);
+ Atom wmStateFs = XInternAtom(awt_display,
+ "_NET_WM_STATE_FULLSCREEN", False);
+- Window root, parent, *children = NULL;
+- unsigned int numchildren;
++ XWindowAttributes attr;
+ XEvent event;
+- Status status;
+
+- if (wmState == None || wmStateFs == None) {
++ if (wmState == None || wmStateFs == None
++ || !XGetWindowAttributes(awt_display, win, &attr)) {
+ return;
+ }
+
+- /*
+- * Note: the Window passed to this method is typically the "content
+- * window" of the top-level, but we need the actual shell window for
+- * the purposes of constructing the XEvent. Therefore, we walk up the
+- * window hierarchy here to find the true top-level.
+- */
+- do {
+- if (!XQueryTree(awt_display, win,
+- &root, &parent,
+- &children, &numchildren))
+- {
+- return;
+- }
+-
+- if (children != NULL) {
+- XFree(children);
+- }
+-
+- if (parent == root) {
+- break;
+- }
+-
+- win = parent;
+- } while (root != parent);
+-
+ memset(&event, 0, sizeof(event));
+ event.xclient.type = ClientMessage;
+ event.xclient.message_type = wmState;
+@@ -1846,7 +1823,7 @@
+ event.xclient.data.l[0] = enabled ? 1 : 0; // 1==add, 0==remove
+ event.xclient.data.l[1] = wmStateFs;
+
+- XSendEvent(awt_display, root, False,
++ XSendEvent(awt_display, attr.root, False,
+ SubstructureRedirectMask | SubstructureNotifyMask,
+ &event);
+ XSync(awt_display, False);
+--- ./jdk/src/solaris/native/sun/awt/awt_InputMethod.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/awt/awt_InputMethod.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -904,7 +904,6 @@
+ static Bool
+ createXIC(JNIEnv * env, X11InputMethodData *pX11IMData, Window w)
+ {
+- XIC active_ic, passive_ic;
+ XVaNestedList preedit = NULL;
+ XVaNestedList status = NULL;
+ XIMStyle on_the_spot_styles = XIMPreeditCallbacks,
+@@ -974,6 +973,12 @@
+ }
+
+ if (active_styles == on_the_spot_styles) {
++ pX11IMData->ic_passive = XCreateIC(X11im,
++ XNClientWindow, w,
++ XNFocusWindow, w,
++ XNInputStyle, passive_styles,
++ NULL);
++
+ callbacks = (XIMCallback *)malloc(sizeof(XIMCallback) * NCALLBACKS);
+ if (callbacks == (XIMCallback *)NULL)
+ return False;
+@@ -1024,12 +1029,6 @@
+ NULL);
+ XFree((void *)preedit);
+ #endif /* __linux__ || MACOSX */
+- pX11IMData->ic_passive = XCreateIC(X11im,
+- XNClientWindow, w,
+- XNFocusWindow, w,
+- XNInputStyle, passive_styles,
+- NULL);
+-
+ } else {
+ pX11IMData->ic_active = XCreateIC(X11im,
+ XNClientWindow, w,
+--- ./jdk/src/solaris/native/sun/awt/gtk2_interface.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/awt/gtk2_interface.c Wed Jul 01 21:53:30 2015 -0700
+@@ -33,6 +33,7 @@
+ #include "jvm_md.h"
+ #include "sizecalc.h"
+ #include <jni_util.h>
++#include "awt.h"
+
+ #define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0")
+ #define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0")
+@@ -433,7 +434,8 @@
+ result = TRUE;
+ }
+
+- dlclose(lib);
++ // 8048289: workaround for https://bugzilla.gnome.org/show_bug.cgi?id=733065
++ // dlclose(lib);
+
+ return result;
+ }
+@@ -889,6 +891,7 @@
+ * BadMatch errors which we would normally ignore. The IO error handler
+ * is preserved here, too, just for consistency.
+ */
++ AWT_LOCK();
+ handler = XSetErrorHandler(NULL);
+ io_handler = XSetIOErrorHandler(NULL);
+
+@@ -925,6 +928,7 @@
+
+ XSetErrorHandler(handler);
+ XSetIOErrorHandler(io_handler);
++ AWT_UNLOCK();
+
+ /* Initialize widget array. */
+ for (i = 0; i < _GTK_WIDGET_TYPE_SIZE; i++)
+--- ./jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c Wed Jul 01 21:53:30 2015 -0700
+@@ -72,6 +72,11 @@
+
+ static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler)
+ {
++ jthrowable pendingException;
++ if (pendingException = (*env)->ExceptionOccurred(env)) {
++ (*env)->ExceptionClear(env);
++ }
++
+ GtkWidget * dialog = (GtkWidget*)jlong_to_ptr(
+ (*env)->GetLongField(env, jpeer, widgetFieldID));
+
+@@ -95,6 +100,10 @@
+ fp_gdk_threads_leave();
+ }
+ }
++
++ if (pendingException) {
++ (*env)->Throw(env, pendingException);
++ }
+ }
+
+ /*
+--- ./jdk/src/solaris/native/sun/awt/utility/rect.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/awt/utility/rect.h Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2014 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2007, 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
+--- ./jdk/src/solaris/native/sun/font/X11FontScaler.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/font/X11FontScaler.c Wed Jul 01 21:53:30 2015 -0700
+@@ -234,7 +234,7 @@
+
+ NativeScalerContext *context = (NativeScalerContext*)pScalerContext;
+ AWTFont xFont = (AWTFont)context->xFont;
+- AWTChar xcs;
++ AWTChar xcs = NULL;
+ jfloat advance = 0.0f;
+
+ if (xFont == NULL || context->ptSize == NO_POINTSIZE) {
+--- ./jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -56,18 +56,28 @@
+ Java_sun_nio_ch_DatagramChannelImpl_initIDs(JNIEnv *env, jclass clazz)
+ {
+ clazz = (*env)->FindClass(env, "java/net/InetSocketAddress");
++ CHECK_NULL(clazz);
+ isa_class = (*env)->NewGlobalRef(env, clazz);
++ if (isa_class == NULL) {
++ JNU_ThrowOutOfMemoryError(env, NULL);
++ return;
++ }
+ isa_ctorID = (*env)->GetMethodID(env, clazz, "<init>",
+ "(Ljava/net/InetAddress;I)V");
++ CHECK_NULL(isa_ctorID);
+
+ clazz = (*env)->FindClass(env, "sun/nio/ch/DatagramChannelImpl");
++ CHECK_NULL(clazz);
+ dci_senderID = (*env)->GetFieldID(env, clazz, "sender",
+ "Ljava/net/SocketAddress;");
++ CHECK_NULL(dci_senderID);
+ dci_senderAddrID = (*env)->GetFieldID(env, clazz,
+ "cachedSenderInetAddress",
+ "Ljava/net/InetAddress;");
++ CHECK_NULL(dci_senderAddrID);
+ dci_senderPortID = (*env)->GetFieldID(env, clazz,
+ "cachedSenderPort", "I");
++ CHECK_NULL(dci_senderPortID);
+ }
+
+ JNIEXPORT void JNICALL
+@@ -121,7 +131,7 @@
+ * but that is acceptable.
+ */
+ if (rv < 0 && errno == EAFNOSUPPORT)
+- rv = errno = 0;
++ rv = errno = 0;
+ #endif
+ }
+ #endif
+@@ -192,17 +202,11 @@
+ if (senderAddr == NULL) {
+ jobject isa = NULL;
+ int port;
+- jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa,
+- &port);
+-
++ jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
+ if (ia != NULL) {
+ isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
+ }
+-
+- if (isa == NULL) {
+- JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+- return IOS_THROWN;
+- }
++ CHECK_NULL_RETURN(isa, IOS_THROWN);
+
+ (*env)->SetObjectField(env, this, dci_senderAddrID, ia);
+ (*env)->SetIntField(env, this, dci_senderPortID,
+--- ./jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -154,10 +154,13 @@
+
+ JNIEXPORT jlong JNICALL
+ Java_sun_nio_ch_FileChannelImpl_transferTo0(JNIEnv *env, jobject this,
+- jint srcFD,
++ jobject srcFDO,
+ jlong position, jlong count,
+- jint dstFD)
++ jobject dstFDO)
+ {
++ jint srcFD = fdval(env, srcFDO);
++ jint dstFD = fdval(env, dstFDO);
++
+ #if defined(__linux__)
+ off64_t offset = (off64_t)position;
+ jlong n = sendfile64(dstFD, srcFD, &offset, (size_t)count);
+--- ./jdk/src/solaris/native/sun/nio/ch/FileKey.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/ch/FileKey.c Wed Jul 01 21:53:30 2015 -0700
+@@ -43,8 +43,8 @@
+ JNIEXPORT void JNICALL
+ Java_sun_nio_ch_FileKey_initIDs(JNIEnv *env, jclass clazz)
+ {
+- key_st_dev = (*env)->GetFieldID(env, clazz, "st_dev", "J");
+- key_st_ino = (*env)->GetFieldID(env, clazz, "st_ino", "J");
++ CHECK_NULL(key_st_dev = (*env)->GetFieldID(env, clazz, "st_dev", "J"));
++ CHECK_NULL(key_st_ino = (*env)->GetFieldID(env, clazz, "st_ino", "J"));
+ }
+
+
+--- ./jdk/src/solaris/native/sun/nio/ch/IOUtil.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/ch/IOUtil.c Wed Jul 01 21:53:30 2015 -0700
+@@ -42,8 +42,8 @@
+ JNIEXPORT void JNICALL
+ Java_sun_nio_ch_IOUtil_initIDs(JNIEnv *env, jclass clazz)
+ {
+- clazz = (*env)->FindClass(env, "java/io/FileDescriptor");
+- fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I");
++ CHECK_NULL(clazz = (*env)->FindClass(env, "java/io/FileDescriptor"));
++ CHECK_NULL(fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I"));
+ }
+
+ JNIEXPORT jboolean JNICALL
+--- ./jdk/src/solaris/native/sun/nio/ch/Net.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/ch/Net.c Wed Jul 01 21:53:30 2015 -0700
+@@ -231,7 +231,7 @@
+
+ JNIEXPORT int JNICALL
+ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6,
+- jboolean stream, jboolean reuse)
++ jboolean stream, jboolean reuse, jboolean ignored)
+ {
+ int fd;
+ int type = (stream ? SOCK_STREAM : SOCK_DGRAM);
+--- ./jdk/src/solaris/native/sun/nio/ch/ServerSocketChannelImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/ch/ServerSocketChannelImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -57,12 +57,20 @@
+ jclass cls;
+
+ cls = (*env)->FindClass(env, "java/io/FileDescriptor");
++ CHECK_NULL(cls);
+ fd_fdID = (*env)->GetFieldID(env, cls, "fd", "I");
++ CHECK_NULL(fd_fdID);
+
+ cls = (*env)->FindClass(env, "java/net/InetSocketAddress");
++ CHECK_NULL(cls);
+ isa_class = (*env)->NewGlobalRef(env, cls);
++ if (isa_class == NULL) {
++ JNU_ThrowOutOfMemoryError(env, NULL);
++ return;
++ }
+ isa_ctorID = (*env)->GetMethodID(env, cls, "<init>",
+ "(Ljava/net/InetAddress;I)V");
++ CHECK_NULL(isa_ctorID);
+ }
+
+ JNIEXPORT jint JNICALL
+@@ -79,6 +87,10 @@
+ jint remote_port;
+
+ NET_AllocSockaddr(&sa, &alloc_len);
++ if (sa == NULL) {
++ JNU_ThrowOutOfMemoryError(env, NULL);
++ return IOS_THROWN;
++ }
+
+ /*
+ * accept connection but ignore ECONNABORTED indicating that
+@@ -110,8 +122,9 @@
+ (*env)->SetIntField(env, newfdo, fd_fdID, newfd);
+ remote_ia = NET_SockaddrToInetAddress(env, sa, (int *)&remote_port);
+ free((void *)sa);
+- isa = (*env)->NewObject(env, isa_class, isa_ctorID,
+- remote_ia, remote_port);
++ CHECK_NULL_RETURN(remote_ia, IOS_THROWN);
++ isa = (*env)->NewObject(env, isa_class, isa_ctorID, remote_ia, remote_port);
++ CHECK_NULL_RETURN(isa, IOS_THROWN);
+ (*env)->SetObjectArrayElement(env, isaa, 0, isa);
+ return 1;
+ }
+--- ./jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2009, 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
+@@ -213,6 +213,7 @@
+
+ /* retrieved address from sockaddr */
+ isaObj = SockAddrToInetSocketAddress(env, sap);
++ CHECK_NULL(isaObj);
+
+ /* data retrieved from sff_data */
+ if (dataLength > 0) {
+@@ -337,6 +338,7 @@
+ }
+
+ addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr);
++ CHECK_NULL(addressObj);
+
+ /* create PeerAddressChanged */
+ resultObj = (*env)->NewObject(env, spc_class, spc_ctrID, spc->spc_assoc_id,
+@@ -393,6 +395,7 @@
+ }
+
+ isa = SockAddrToInetSocketAddress(env, sap);
++ CHECK_NULL(isa);
+ getControlData(msg, cdata);
+
+ /* create MessageInfoImpl */
+@@ -461,11 +464,6 @@
+ union sctp_notification *snp;
+ jboolean allocated = JNI_FALSE;
+
+- if (rv > SCTP_NOTIFICATION_SIZE) {
+- JNU_ThrowInternalError(env, "should not reach here");
+- return -1;
+- }
+-
+ if (!(msg->msg_flags & MSG_EOR) && length < SCTP_NOTIFICATION_SIZE) {
+ char* newBuf;
+ int rvSAVE = rv;
+@@ -613,4 +611,3 @@
+ return Java_sun_nio_ch_SocketChannelImpl_checkConnect(env, this,
+ fdo, block, ready);
+ }
+-
+--- ./jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c Wed Jul 01 21:53:30 2015 -0700
+@@ -315,11 +315,12 @@
+ if (isaCls == 0) {
+ jclass c = (*env)->FindClass(env, "java/net/InetSocketAddress");
+ CHECK_NULL(c);
++ isaCtrID = (*env)->GetMethodID(env, c, "<init>",
++ "(Ljava/net/InetAddress;I)V");
++ CHECK_NULL(isaCtrID);
+ isaCls = (*env)->NewGlobalRef(env, c);
+ CHECK_NULL(isaCls);
+ (*env)->DeleteLocalRef(env, c);
+- isaCtrID = (*env)->GetMethodID(env, isaCls, "<init>",
+- "(Ljava/net/InetAddress;I)V");
+ }
+ }
+
+@@ -382,8 +383,9 @@
+ ia = NET_SockaddrToInetAddress(env, sap, &port);
+ if (ia != NULL)
+ isa = (*env)->NewObject(env, isaCls, isaCtrID, ia, port);
+- if (isa != NULL)
+- (*env)->SetObjectArrayElement(env, isaa, i, isa);
++ if (isa == NULL)
++ break;
++ (*env)->SetObjectArrayElement(env, isaa, i, isa);
+
+ if (sap->sa_family == AF_INET)
+ addr_buf = ((struct sockaddr_in*)addr_buf) + 1;
+@@ -433,8 +435,9 @@
+ ia = NET_SockaddrToInetAddress(env, sap, &port);
+ if (ia != NULL)
+ isa = (*env)->NewObject(env, isaCls, isaCtrID, ia, port);
+- if (isa != NULL)
+- (*env)->SetObjectArrayElement(env, isaa, i, isa);
++ if (isa == NULL)
++ break;
++ (*env)->SetObjectArrayElement(env, isaa, i, isa);
+
+ if (sap->sa_family == AF_INET)
+ addr_buf = ((struct sockaddr_in*)addr_buf) + 1;
+--- ./jdk/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c Wed Jul 01 21:53:30 2015 -0700
+@@ -72,13 +72,15 @@
+ jclass clazz;
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
++ CHECK_NULL(entry_name);
+ entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
++ CHECK_NULL(entry_dir);
+ entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
++ CHECK_NULL(entry_fstype);
+ entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
++ CHECK_NULL(entry_options);
+ }
+
+ JNIEXPORT jlong JNICALL
+@@ -201,4 +203,3 @@
+ free(iter);
+ }
+ }
+-
+--- ./jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c Wed Jul 01 21:53:30 2015 -0700
+@@ -68,13 +68,15 @@
+ my_flistxattr_func = (flistxattr_func*)dlsym(RTLD_DEFAULT, "flistxattr");
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+- if (clazz == NULL)
+- return;
+-
++ CHECK_NULL(clazz);
+ entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
++ CHECK_NULL(entry_name);
+ entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
++ CHECK_NULL(entry_dir);
+ entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
++ CHECK_NULL(entry_fstype);
+ entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
++ CHECK_NULL(entry_options);
+ }
+
+ JNIEXPORT jint JNICALL
+--- ./jdk/src/solaris/native/sun/nio/fs/SolarisNativeDispatcher.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/fs/SolarisNativeDispatcher.c Wed Jul 01 21:53:30 2015 -0700
+@@ -55,14 +55,17 @@
+ JNIEXPORT void JNICALL
+ Java_sun_nio_fs_SolarisNativeDispatcher_init(JNIEnv *env, jclass clazz) {
+ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+- if (clazz == NULL)
+- return;
+-
++ CHECK_NULL(clazz);
+ entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
++ CHECK_NULL(entry_name);
+ entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
++ CHECK_NULL(entry_dir);
+ entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
++ CHECK_NULL(entry_fstype);
+ entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
++ CHECK_NULL(entry_options);
+ entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
++ CHECK_NULL(entry_dev);
+ }
+
+ JNIEXPORT jint JNICALL
+--- ./jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c Wed Jul 01 21:53:30 2015 -0700
+@@ -179,46 +179,64 @@
+ jclass clazz;
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixFileAttributes");
+- if (clazz == NULL) {
+- return 0;
+- }
++ CHECK_NULL_RETURN(clazz, 0);
+ attrs_st_mode = (*env)->GetFieldID(env, clazz, "st_mode", "I");
++ CHECK_NULL_RETURN(attrs_st_mode, 0);
+ attrs_st_ino = (*env)->GetFieldID(env, clazz, "st_ino", "J");
++ CHECK_NULL_RETURN(attrs_st_ino, 0);
+ attrs_st_dev = (*env)->GetFieldID(env, clazz, "st_dev", "J");
++ CHECK_NULL_RETURN(attrs_st_dev, 0);
+ attrs_st_rdev = (*env)->GetFieldID(env, clazz, "st_rdev", "J");
++ CHECK_NULL_RETURN(attrs_st_rdev, 0);
+ attrs_st_nlink = (*env)->GetFieldID(env, clazz, "st_nlink", "I");
++ CHECK_NULL_RETURN(attrs_st_nlink, 0);
+ attrs_st_uid = (*env)->GetFieldID(env, clazz, "st_uid", "I");
++ CHECK_NULL_RETURN(attrs_st_uid, 0);
+ attrs_st_gid = (*env)->GetFieldID(env, clazz, "st_gid", "I");
++ CHECK_NULL_RETURN(attrs_st_gid, 0);
+ attrs_st_size = (*env)->GetFieldID(env, clazz, "st_size", "J");
++ CHECK_NULL_RETURN(attrs_st_size, 0);
+ attrs_st_atime_sec = (*env)->GetFieldID(env, clazz, "st_atime_sec", "J");
++ CHECK_NULL_RETURN(attrs_st_atime_sec, 0);
+ attrs_st_atime_nsec = (*env)->GetFieldID(env, clazz, "st_atime_nsec", "J");
++ CHECK_NULL_RETURN(attrs_st_atime_nsec, 0);
+ attrs_st_mtime_sec = (*env)->GetFieldID(env, clazz, "st_mtime_sec", "J");
++ CHECK_NULL_RETURN(attrs_st_mtime_sec, 0);
+ attrs_st_mtime_nsec = (*env)->GetFieldID(env, clazz, "st_mtime_nsec", "J");
++ CHECK_NULL_RETURN(attrs_st_mtime_nsec, 0);
+ attrs_st_ctime_sec = (*env)->GetFieldID(env, clazz, "st_ctime_sec", "J");
++ CHECK_NULL_RETURN(attrs_st_ctime_sec, 0);
+ attrs_st_ctime_nsec = (*env)->GetFieldID(env, clazz, "st_ctime_nsec", "J");
++ CHECK_NULL_RETURN(attrs_st_ctime_nsec, 0);
+
+ #ifdef _DARWIN_FEATURE_64_BIT_INODE
+ attrs_st_birthtime_sec = (*env)->GetFieldID(env, clazz, "st_birthtime_sec", "J");
++ CHECK_NULL_RETURN(attrs_st_birthtime_sec, 0);
+ #endif
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixFileStoreAttributes");
+- if (clazz == NULL) {
+- return 0;
+- }
++ CHECK_NULL_RETURN(clazz, 0);
+ attrs_f_frsize = (*env)->GetFieldID(env, clazz, "f_frsize", "J");
++ CHECK_NULL_RETURN(attrs_f_frsize, 0);
+ attrs_f_blocks = (*env)->GetFieldID(env, clazz, "f_blocks", "J");
++ CHECK_NULL_RETURN(attrs_f_blocks, 0);
+ attrs_f_bfree = (*env)->GetFieldID(env, clazz, "f_bfree", "J");
++ CHECK_NULL_RETURN(attrs_f_bfree, 0);
+ attrs_f_bavail = (*env)->GetFieldID(env, clazz, "f_bavail", "J");
++ CHECK_NULL_RETURN(attrs_f_bavail, 0);
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
+- if (clazz == NULL) {
+- return 0;
+- }
++ CHECK_NULL_RETURN(clazz, 0);
+ entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
++ CHECK_NULL_RETURN(entry_name, 0);
+ entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
++ CHECK_NULL_RETURN(entry_dir, 0);
+ entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
++ CHECK_NULL_RETURN(entry_fstype, 0);
+ entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
++ CHECK_NULL_RETURN(entry_options, 0);
+ entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
++ CHECK_NULL_RETURN(entry_dev, 0);
+
+ /* system calls that might not be available at run time */
+
+--- ./jdk/src/solaris/native/sun/xawt/XToolkit.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/solaris/native/sun/xawt/XToolkit.c Wed Jul 01 21:53:30 2015 -0700
+@@ -77,7 +77,7 @@
+ #ifndef HEADLESS
+
+ extern Display* awt_init_Display(JNIEnv *env, jobject this);
+-extern void freeNativeStringArray(char **array, long length);
++extern void freeNativeStringArray(char **array, jsize length);
+ extern char** stringArrayToNative(JNIEnv *env, jobjectArray array, jsize * ret_length);
+
+ struct XFontPeerIDs xFontPeerIDs;
+--- ./jdk/src/windows/bin/java_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/bin/java_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 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
+@@ -318,11 +318,7 @@
+ JLI_TraceLauncher("JRE path is %s\n", path);
+ return JNI_TRUE;
+ }
+- /* ensure storage for path + \jre + NULL */
+- if ((JLI_StrLen(path) + 4 + 1) > pathsize) {
+- JLI_TraceLauncher("Insufficient space to store JRE path\n");
+- return JNI_FALSE;
+- }
++
+ /* Does this app ship a private JRE in <apphome>\jre directory? */
+ JLI_Snprintf(javadll, sizeof (javadll), "%s\\jre\\bin\\" JAVA_DLL, path);
+ if (stat(javadll, &s) == 0) {
+@@ -1407,6 +1403,26 @@
+ return JNI_FALSE;
+ }
+
++int
++filterArgs(StdArg *stdargs, const int nargc, StdArg **pargv) {
++ StdArg* argv = NULL;
++ int nargs = 0;
++ int i;
++
++ /* Copy the non-vm args */
++ for (i = 0; i < nargc ; i++) {
++ const char *arg = stdargs[i].arg;
++ if (arg[0] == '-' && arg[1] == 'J')
++ continue;
++ argv = (StdArg*) JLI_MemRealloc(argv, (nargs+1) * sizeof(StdArg));
++ argv[nargs].arg = JLI_StringDup(arg);
++ argv[nargs].has_wildcard = stdargs[i].has_wildcard;
++ nargs++;
++ }
++ *pargv = argv;
++ return nargs;
++}
++
+ /*
+ * At this point we have the arguments to the application, and we need to
+ * check with original stdargs in order to compare which of these truly
+@@ -1421,8 +1437,9 @@
+ char *ostart, *astart, **nargv;
+ jboolean needs_expansion = JNI_FALSE;
+ jmethodID mid;
+- int stdargc;
++ int filteredargc, stdargc;
+ StdArg *stdargs;
++ StdArg *filteredargs;
+ jclass cls = GetLauncherHelperClass(env);
+ NULL_CHECK0(cls);
+
+@@ -1433,6 +1450,8 @@
+ stdargs = JLI_GetStdArgs();
+ stdargc = JLI_GetStdArgc();
+
++ filteredargc = filterArgs(stdargs, stdargc, &filteredargs);
++
+ // sanity check, this should never happen
+ if (argc > stdargc) {
+ JLI_TraceLauncher("Warning: app args is larger than the original, %d %d\n", argc, stdargc);
+@@ -1441,8 +1460,8 @@
+ }
+
+ // sanity check, match the args we have, to the holy grail
+- idx = stdargc - argc;
+- ostart = stdargs[idx].arg;
++ idx = filteredargc - argc;
++ ostart = filteredargs[idx].arg;
+ astart = strv[0];
+ // sanity check, ensure that the first argument of the arrays are the same
+ if (JLI_StrCmp(ostart, astart) != 0) {
+@@ -1455,8 +1474,8 @@
+ // make a copy of the args which will be expanded in java if required.
+ nargv = (char **)JLI_MemAlloc(argc * sizeof(char*));
+ for (i = 0, j = idx; i < argc; i++, j++) {
+- jboolean arg_expand = (JLI_StrCmp(stdargs[j].arg, strv[i]) == 0)
+- ? stdargs[j].has_wildcard
++ jboolean arg_expand = (JLI_StrCmp(filteredargs[j].arg, strv[i]) == 0)
++ ? filteredargs[j].has_wildcard
+ : JNI_FALSE;
+ if (needs_expansion == JNI_FALSE)
+ needs_expansion = arg_expand;
+@@ -1493,5 +1512,6 @@
+ JLI_MemFree(nargv[i]);
+ }
+ JLI_MemFree(nargv);
++ JLI_MemFree(filteredargs);
+ return outArray;
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/classes/com/sun/java/accessibility/32bit/AccessBridgeLoader.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,71 @@
++/*
++ * Copyright (c) 2002, 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. 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 com.sun.java.accessibility;
++
++@jdk.Exported(false)
++abstract class AccessBridgeLoader {
++
++ /**
++ * Load JavaAccessBridge.DLL (our native half)
++ */
++ static {
++ java.security.AccessController.doPrivileged(
++ new java.security.PrivilegedAction<Object>() {
++ public Object run() {
++ System.loadLibrary("JavaAccessBridge-32");
++ return null;
++ }
++ }, null, new java.lang.RuntimePermission("loadLibrary.JavaAccessBridge-32")
++ );
++ }
++
++ boolean useJAWT_DLL = false;
++
++ /**
++ * AccessBridgeLoader constructor
++ */
++ AccessBridgeLoader() {
++ // load JAWTAccessBridge.DLL on JDK 1.4.1 or later
++ // determine which version of the JDK is running
++ String version = System.getProperty("java.version");
++ if (version != null)
++ useJAWT_DLL = (version.compareTo("1.4.1") >= 0);
++
++ if (useJAWT_DLL) {
++ // Note that we have to explicitly load JAWT.DLL
++ java.security.AccessController.doPrivileged(
++ new java.security.PrivilegedAction<Object>() {
++ public Object run() {
++ System.loadLibrary("JAWT");
++ System.loadLibrary("JAWTAccessBridge-32");
++ return null;
++ }
++ }, null, new RuntimePermission("loadLibrary.JAWT"),
++ new RuntimePermission("loadLibrary.JAWTAccessBridge-32")
++ );
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/classes/com/sun/java/accessibility/64bit/AccessBridgeLoader.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,71 @@
++/*
++ * Copyright (c) 2002, 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. 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 com.sun.java.accessibility;
++
++@jdk.Exported(false)
++abstract class AccessBridgeLoader {
++
++ /**
++ * Load JavaAccessBridge.DLL (our native half)
++ */
++ static {
++ java.security.AccessController.doPrivileged(
++ new java.security.PrivilegedAction<Object>() {
++ public Object run() {
++ System.loadLibrary("JavaAccessBridge-64");
++ return null;
++ }
++ }, null, new RuntimePermission("loadLibrary.JavaAccessBridge-64")
++ );
++ }
++
++ boolean useJAWT_DLL = false;
++
++ /**
++ * AccessBridgLoader constructor
++ */
++ AccessBridgeLoader() {
++ // load JAWTAccessBridge.DLL on JDK 1.4.1 or later
++ String version = System.getProperty("java.version");
++ if (version != null)
++ useJAWT_DLL = (version.compareTo("1.4.1") >= 0);
++
++ if (useJAWT_DLL) {
++ // Note that we have to explicitly load JAWT.DLL
++ java.security.AccessController.doPrivileged(
++ new java.security.PrivilegedAction<Object>() {
++ public Object run() {
++ System.loadLibrary("JAWT");
++ System.loadLibrary("JAWTAccessBridge-64");
++ return null;
++ }
++ }, null, new RuntimePermission("loadLibrary.JAWT"),
++ new RuntimePermission("loadLibrary.JAWTAccessBridge-64")
++ );
++ }
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/classes/com/sun/java/accessibility/AccessBridge.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,7272 @@
++/*
++ * 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. 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 com.sun.java.accessibility;
++
++import java.awt.*;
++import java.awt.event.*;
++import java.util.*;
++import java.lang.*;
++import java.lang.reflect.*;
++
++import java.beans.*;
++import javax.swing.*;
++import javax.swing.event.*;
++import javax.swing.text.*;
++import javax.swing.tree.*;
++import javax.swing.table.*;
++import javax.swing.plaf.TreeUI;
++
++import javax.accessibility.*;
++import com.sun.java.accessibility.util.*;
++import sun.awt.AWTAccessor;
++import sun.awt.AppContext;
++import sun.awt.SunToolkit;
++
++import java.util.concurrent.Callable;
++import java.util.concurrent.ConcurrentHashMap;
++import java.util.concurrent.CountDownLatch;
++
++/*
++ * Note: This class has to be public. It's loaded from the VM like this:
++ * Class.forName(atName).newInstance();
++ */
++@jdk.Exported(false)
++final public class AccessBridge extends AccessBridgeLoader {
++
++ private final String AccessBridgeVersion =
++ "AccessBridge 2.0.4";
++
++ private static AccessBridge theAccessBridge;
++ private ObjectReferences references;
++ private EventHandler eventHandler;
++ private boolean runningOnJDK1_4 = false;
++ private boolean runningOnJDK1_5 = false;
++
++ // Maps AccessibleRoles strings to AccessibleRoles.
++ private ConcurrentHashMap<String,AccessibleRole> accessibleRoleMap = new ConcurrentHashMap<>();
++
++ /**
++ If the object's role is in the following array getVirtualAccessibleName
++ will use the extended search algorithm.
++ */
++ private ArrayList<AccessibleRole> extendedVirtualNameSearchRoles = new ArrayList<>();
++ /**
++ If the role of the object's parent is in the following array
++ getVirtualAccessibleName will NOT use the extended search
++ algorithm even if the object's role is in the
++ extendedVirtualNameSearchRoles array.
++ */
++ private ArrayList<AccessibleRole> noExtendedVirtualNameSearchParentRoles = new ArrayList<>();
++
++ /**
++ * AccessBridge constructor
++ *
++ * Note: This constructor has to be public. It's called from the VM like this:
++ * Class.forName(atName).newInstance();
++ */
++ public AccessBridge() {
++ super();
++ theAccessBridge = this;
++ references = new ObjectReferences();
++
++ // initialize shutdown hook
++ Runtime runTime = Runtime.getRuntime();
++ shutdownHook hook = new shutdownHook();
++ runTime.addShutdownHook(new Thread(hook));
++
++ // initialize AccessibleRole map
++ initAccessibleRoleMap();
++
++ // determine which version of the JDK is running
++ String version = getJavaVersionProperty();
++ debugString("JDK version = "+version);
++ runningOnJDK1_4 = (version.compareTo("1.4") >= 0);
++ runningOnJDK1_5 = (version.compareTo("1.5") >= 0);
++
++ // initialize the methods that map HWNDs and Java top-level
++ // windows
++ if (initHWNDcalls() == true) {
++
++ // is this a JVM we can use?
++ // install JDK 1.2 and later Swing ToolKit listener
++ EventQueueMonitor.isGUIInitialized();
++
++ // start the Java event handler
++ eventHandler = new EventHandler(this);
++
++ // register for menu selection events
++ if (runningOnJDK1_4) {
++ MenuSelectionManager.defaultManager().addChangeListener(eventHandler);
++ }
++
++ // register as a NativeWindowHandler
++ addNativeWindowHandler(new DefaultNativeWindowHandler());
++
++ // start in a new thread
++ Thread abthread = new Thread(new dllRunner());
++ abthread.setDaemon(true);
++ abthread.start();
++ debugString("AccessBridge started");
++ }
++ }
++
++ /*
++ * adaptor to run the AccessBridge DLL
++ */
++ private class dllRunner implements Runnable {
++ public void run() {
++ runDLL();
++ }
++ }
++
++ /*
++ * shutdown hook
++ */
++ private class shutdownHook implements Runnable {
++
++ public void run() {
++ debugString("***** shutdownHook: shutting down...");
++ javaShutdown();
++ }
++ }
++
++
++ /*
++ * Initialize the hashtable that maps Strings to AccessibleRoles.
++ */
++ private void initAccessibleRoleMap() {
++ /*
++ * Initialize the AccessibleRoles map. This code uses methods in
++ * java.lang.reflect.* to build the map.
++ */
++ try {
++ Class<?> clAccessibleRole = Class.forName ("javax.accessibility.AccessibleRole");
++ if (null != clAccessibleRole) {
++ AccessibleRole roleUnknown = AccessibleRole.UNKNOWN;
++ Field [] fields = clAccessibleRole.getFields ();
++ int i = 0;
++ for (i = 0; i < fields.length; i ++) {
++ Field f = fields [i];
++ if (javax.accessibility.AccessibleRole.class == f.getType ()) {
++ AccessibleRole nextRole = (AccessibleRole) (f.get (roleUnknown));
++ String nextRoleString = nextRole.toDisplayString (Locale.US);
++ accessibleRoleMap.put (nextRoleString, nextRole);
++ }
++ }
++ }
++ } catch (Exception e) {}
++
++ /*
++ Build the extendedVirtualNameSearchRoles array list. I chose this method
++ because some of the Accessible Roles that need to be added to it are not
++ available in all versions of the J2SE that we want to support.
++ */
++ extendedVirtualNameSearchRoles.add (AccessibleRole.COMBO_BOX);
++ try {
++ /*
++ Added in J2SE 1.4
++ */
++ extendedVirtualNameSearchRoles.add (AccessibleRole.DATE_EDITOR);
++ } catch (NoSuchFieldError e) {}
++ extendedVirtualNameSearchRoles.add (AccessibleRole.LIST);
++ extendedVirtualNameSearchRoles.add (AccessibleRole.PASSWORD_TEXT);
++ extendedVirtualNameSearchRoles.add (AccessibleRole.SLIDER);
++ try {
++ /*
++ Added in J2SE 1.3
++ */
++ extendedVirtualNameSearchRoles.add (AccessibleRole.SPIN_BOX);
++ } catch (NoSuchFieldError e) {}
++ extendedVirtualNameSearchRoles.add (AccessibleRole.TABLE);
++ extendedVirtualNameSearchRoles.add (AccessibleRole.TEXT);
++ extendedVirtualNameSearchRoles.add (AccessibleRole.UNKNOWN);
++
++ noExtendedVirtualNameSearchParentRoles.add (AccessibleRole.TABLE);
++ noExtendedVirtualNameSearchParentRoles.add (AccessibleRole.TOOL_BAR);
++ }
++
++ /**
++ * start the AccessBridge DLL running in its own thread
++ */
++ private native void runDLL();
++
++ /**
++ * debugging output (goes to OutputDebugStr())
++ */
++ private native void sendDebugString(String debugStr);
++
++ /**
++ * debugging output (goes to OutputDebugStr())
++ */
++ private void debugString(String debugStr) {
++ sendDebugString(debugStr);
++ }
++
++ /* ===== utility methods ===== */
++
++ /**
++ * decrement the reference to the object (called by native code)
++ */
++ private void decrementReference(Object o) {
++ references.decrement(o);
++ }
++
++ /**
++ * get the java.version property from the JVM
++ */
++ private String getJavaVersionProperty() {
++ String s = System.getProperty("java.version");
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ return null;
++ }
++
++ /**
++ * get the java.version property from the JVM
++ */
++ private String getAccessBridgeVersion() {
++ String s = new String(AccessBridgeVersion);
++ references.increment(s);
++ return s;
++ }
++
++ /* ===== HWND/Java window mapping methods ===== */
++
++ // Java toolkit methods for mapping HWNDs to Java components
++ private Method javaGetComponentFromNativeWindowHandleMethod;
++ private Method javaGetNativeWindowHandleFromComponentMethod;
++
++ // native jawt methods for mapping HWNDs to Java components
++ private native int isJAWTInstalled();
++
++ private native int jawtGetNativeWindowHandleFromComponent(Component comp);
++
++ private native Component jawtGetComponentFromNativeWindowHandle(int handle);
++
++ Toolkit toolkit;
++
++ /**
++ * map an HWND to an AWT Component
++ */
++ private boolean initHWNDcalls() {
++ Class<?> integerParemter[] = new Class<?>[1];
++ integerParemter[0] = Integer.TYPE;
++ Class<?> componentParemter[] = new Class<?>[1];
++ try {
++ componentParemter[0] = Class.forName("java.awt.Component");
++ } catch (ClassNotFoundException e) {
++ debugString("Exception: " + e.toString());
++ }
++ Object[] args = new Object[1];
++ Component c;
++ boolean returnVal = false;
++
++ toolkit = Toolkit.getDefaultToolkit();
++
++ if (useJAWT_DLL) {
++ returnVal = true;
++ } else {
++ // verify javaGetComponentFromNativeWindowHandle() method
++ // is present if JAWT.DLL is not installed
++ try {
++ javaGetComponentFromNativeWindowHandleMethod =
++ toolkit.getClass().getMethod(
++ "getComponentFromNativeWindowHandle", integerParemter);
++ if (javaGetComponentFromNativeWindowHandleMethod != null) {
++ try {
++ args[0] = new Integer(1);
++ c = (Component) javaGetComponentFromNativeWindowHandleMethod.invoke(toolkit, args);
++ returnVal = true;
++ } catch (InvocationTargetException e) {
++ debugString("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ debugString("Exception: " + e.toString());
++ }
++ }
++ } catch (NoSuchMethodException e) {
++ debugString("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ debugString("Exception: " + e.toString());
++ }
++
++ // verify getComponentFromNativeWindowHandle() method
++ // is present if JAWT.DLL is not installed
++ try {
++ javaGetNativeWindowHandleFromComponentMethod =
++ toolkit.getClass().getMethod(
++ "getNativeWindowHandleFromComponent", componentParemter);
++ if (javaGetNativeWindowHandleFromComponentMethod != null) {
++ try {
++ args[0] = new Button("OK"); // need some Component...
++ Integer i = (Integer) javaGetNativeWindowHandleFromComponentMethod.invoke(toolkit, args);
++ returnVal = true;
++ } catch (InvocationTargetException e) {
++ debugString("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ debugString("Exception: " + e.toString());
++ } catch (Exception e) {
++ debugString("Exception: " + e.toString());
++ }
++ }
++ } catch (NoSuchMethodException e) {
++ debugString("Exception: " + e.toString());
++ } catch (SecurityException e) {
++ debugString("Exception: " + e.toString());
++ }
++ }
++ return returnVal;
++ }
++
++ // native window handler interface
++ private interface NativeWindowHandler {
++ public Accessible getAccessibleFromNativeWindowHandle(int nativeHandle);
++ }
++
++ // hash table of native window handle to AccessibleContext mappings
++ static private ConcurrentHashMap<Integer,AccessibleContext> windowHandleToContextMap = new ConcurrentHashMap<>();
++
++ // hash table of AccessibleContext to native window handle mappings
++ static private ConcurrentHashMap<AccessibleContext,Integer> contextToWindowHandleMap = new ConcurrentHashMap<>();
++
++ /*
++ * adds a virtual window handler to our hash tables
++ */
++ static private void registerVirtualFrame(final Accessible a,
++ Integer nativeWindowHandle ) {
++ if (a != null) {
++ AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return a.getAccessibleContext();
++ }
++ }, a);
++ windowHandleToContextMap.put(nativeWindowHandle, ac);
++ contextToWindowHandleMap.put(ac, nativeWindowHandle);
++ }
++ }
++
++ /*
++ * removes a virtual window handler to our hash tables
++ */
++ static private void revokeVirtualFrame(final Accessible a,
++ Integer nativeWindowHandle ) {
++ AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return a.getAccessibleContext();
++ }
++ }, a);
++ windowHandleToContextMap.remove(nativeWindowHandle);
++ contextToWindowHandleMap.remove(ac);
++ }
++
++ // vector of native window handlers
++ private static Vector<NativeWindowHandler> nativeWindowHandlers = new Vector<>();
++
++ /*
++ * adds a native window handler to our list
++ */
++ private static void addNativeWindowHandler(NativeWindowHandler handler) {
++ if (handler == null) {
++ throw new IllegalArgumentException();
++ }
++ nativeWindowHandlers.addElement(handler);
++ }
++
++ /*
++ * removes a native window handler to our list
++ */
++ private static boolean removeNativeWindowHandler(NativeWindowHandler handler) {
++ if (handler == null) {
++ throw new IllegalArgumentException();
++ }
++ return nativeWindowHandlers.removeElement(handler);
++ }
++
++ /**
++ * verifies that a native window handle is a Java window
++ */
++ private boolean isJavaWindow(int nativeHandle) {
++ AccessibleContext ac = getContextFromNativeWindowHandle(nativeHandle);
++ if (ac != null) {
++ saveContextToWindowHandleMapping(ac, nativeHandle);
++ return true;
++ }
++ return false;
++ }
++
++ /*
++ * saves the mapping between an AccessibleContext and a window handle
++ */
++ private void saveContextToWindowHandleMapping(AccessibleContext ac,
++ int nativeHandle) {
++ debugString("saveContextToWindowHandleMapping...");
++ if (ac == null) {
++ return;
++ }
++ if (! contextToWindowHandleMap.containsKey(ac)) {
++ debugString("saveContextToWindowHandleMapping: ac = "+ac+"; handle = "+nativeHandle);
++ contextToWindowHandleMap.put(ac, nativeHandle);
++ }
++ }
++
++ /**
++ * maps a native window handle to an Accessible Context
++ */
++ private AccessibleContext getContextFromNativeWindowHandle(int nativeHandle) {
++ // First, look for the Accessible in our hash table of
++ // virtual window handles.
++ AccessibleContext ac = windowHandleToContextMap.get(nativeHandle);
++ if(ac!=null) {
++ saveContextToWindowHandleMapping(ac, nativeHandle);
++ return ac;
++ }
++
++ // Next, look for the native window handle in our vector
++ // of native window handles.
++ int numHandlers = nativeWindowHandlers.size();
++ for (int i = 0; i < numHandlers; i++) {
++ NativeWindowHandler nextHandler = nativeWindowHandlers.elementAt(i);
++ final Accessible a = nextHandler.getAccessibleFromNativeWindowHandle(nativeHandle);
++ if (a != null) {
++ ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return a.getAccessibleContext();
++ }
++ }, a);
++ saveContextToWindowHandleMapping(ac, nativeHandle);
++ return ac;
++ }
++ }
++ // Not found.
++ return null;
++ }
++
++ /**
++ * maps an AccessibleContext to a native window handle
++ * returns 0 on error
++ */
++ private int getNativeWindowHandleFromContext(AccessibleContext ac) {
++ debugString("getNativeWindowHandleFromContext: ac = "+ac);
++ try {
++ return contextToWindowHandleMap.get(ac);
++ } catch (Exception ex) {
++ return 0;
++ }
++ }
++
++ private class DefaultNativeWindowHandler implements NativeWindowHandler {
++ /*
++ * returns the Accessible associated with a native window
++ */
++ public Accessible getAccessibleFromNativeWindowHandle(int nativeHandle) {
++ final Component c = getComponentFromNativeWindowHandle(nativeHandle);
++ if (c instanceof Accessible) {
++ AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return c.getAccessibleContext();
++ }
++ }, c);
++ saveContextToWindowHandleMapping(ac, nativeHandle);
++ return (Accessible)c;
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * map an HWND to an AWT Component
++ */
++ private Component getComponentFromNativeWindowHandle(int nativeHandle) {
++ if (useJAWT_DLL) {
++ debugString("*** calling jawtGetComponentFromNativeWindowHandle");
++ return jawtGetComponentFromNativeWindowHandle(nativeHandle);
++ } else {
++ debugString("*** calling javaGetComponentFromNativeWindowHandle");
++ Object[] args = new Object[1];
++ if (javaGetComponentFromNativeWindowHandleMethod != null) {
++ try {
++ args[0] = nativeHandle;
++ Object o = javaGetComponentFromNativeWindowHandleMethod.invoke(toolkit, args);
++ if (o instanceof Accessible) {
++ final Accessible acc=(Accessible)o;
++ AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return acc.getAccessibleContext();
++ }
++ }, (Component)o);
++ saveContextToWindowHandleMapping(ac,nativeHandle);
++ }
++ return (Component)o;
++ } catch (InvocationTargetException | IllegalAccessException e) {
++ debugString("Exception: " + e.toString());
++ }
++ }
++ }
++ return null;
++ }
++ }
++
++ /**
++ * map an AWT Component to an HWND
++ */
++ private int getNativeWindowHandleFromComponent(final Component target) {
++ if (useJAWT_DLL) {
++ debugString("*** calling jawtGetNativeWindowHandleFromComponent");
++ return jawtGetNativeWindowHandleFromComponent(target);
++ } else {
++ Object[] args = new Object[1];
++ debugString("*** calling javaGetNativeWindowHandleFromComponent");
++ if (javaGetNativeWindowHandleFromComponentMethod != null) {
++ try {
++ args[0] = target;
++ Integer i = (Integer) javaGetNativeWindowHandleFromComponentMethod.invoke(toolkit, args);
++ // cache the mapping
++ AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return target.getAccessibleContext();
++ }
++ }, target);
++ contextToWindowHandleMap.put(ac, i);
++ return i.intValue();
++ } catch (InvocationTargetException e) {
++ debugString("Exception: " + e.toString());
++ } catch (IllegalAccessException e) {
++ debugString("Exception: " + e.toString());
++ }
++ }
++ }
++ return -1;
++ }
++
++ /* ===== AccessibleContext methods =====*/
++
++ /*
++ * returns the inner-most AccessibleContext in parent at Point(x, y)
++ */
++ private AccessibleContext getAccessibleContextAt(int x, int y,
++ AccessibleContext parent) {
++ if (parent == null) {
++ return null;
++ }
++ if (windowHandleToContextMap != null &&
++ windowHandleToContextMap.containsValue(getRootAccessibleContext(parent))) {
++ // Path for applications that register their top-level
++ // windows with the AccessBridge (e.g., StarOffice 6.1)
++ return getAccessibleContextAt_1(x, y, parent);
++ } else {
++ // Path for applications that do not register
++ // their top-level windows with the AccessBridge
++ // (e.g., Swing/AWT applications)
++ return getAccessibleContextAt_2(x, y, parent);
++ }
++ }
++
++ /*
++ * returns the root accessible context
++ */
++ private AccessibleContext getRootAccessibleContext(final AccessibleContext ac) {
++ if (ac == null) {
++ return null;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ Accessible parent = ac.getAccessibleParent();
++ if (parent == null) {
++ return ac;
++ }
++ Accessible tmp = parent.getAccessibleContext().getAccessibleParent();
++ while (tmp != null) {
++ parent = tmp;
++ tmp = parent.getAccessibleContext().getAccessibleParent();
++ }
++ return parent.getAccessibleContext();
++ }
++ }, ac);
++ }
++
++ /*
++ * StarOffice version that does not use the EventQueueMonitor
++ */
++ private AccessibleContext getAccessibleContextAt_1(final int x, final int y,
++ final AccessibleContext parent) {
++ debugString(" : getAccessibleContextAt_1 called");
++ debugString(" -> x = " + x + " y = " + y + " parent = " + parent);
++
++ if (parent == null) return null;
++ final AccessibleComponent acmp = InvocationUtils.invokeAndWait(new Callable<AccessibleComponent>() {
++ @Override
++ public AccessibleComponent call() throws Exception {
++ return parent.getAccessibleComponent();
++ }
++ }, parent);
++ if (acmp!=null) {
++ final Point loc = InvocationUtils.invokeAndWait(new Callable<Point>() {
++ @Override
++ public Point call() throws Exception {
++ return acmp.getLocation();
++ }
++ }, parent);
++ final Accessible a = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
++ @Override
++ public Accessible call() throws Exception {
++ return acmp.getAccessibleAt(new Point(x - loc.x, y - loc.y));
++ }
++ }, parent);
++ if (a != null) {
++ AccessibleContext foundAC = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return a.getAccessibleContext();
++ }
++ }, parent);
++ if (foundAC != null) {
++ if (foundAC != parent) {
++ // recurse down into the child
++ return getAccessibleContextAt_1(x - loc.x, y - loc.y,
++ foundAC);
++ } else
++ return foundAC;
++ }
++ }
++ }
++ return parent;
++ }
++
++ /*
++ * AWT/Swing version
++ */
++ private AccessibleContext getAccessibleContextAt_2(final int x, final int y,
++ AccessibleContext parent) {
++ debugString("getAccessibleContextAt_2 called");
++ debugString(" -> x = " + x + " y = " + y + " parent = " + parent);
++
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ Accessible a = EventQueueMonitor.getAccessibleAt(new Point(x, y));
++ if (a != null) {
++ AccessibleContext childAC = a.getAccessibleContext();
++ if (childAC != null) {
++ debugString(" returning childAC = " + childAC);
++ return childAC;
++ }
++ }
++ return null;
++ }
++ }, parent);
++ }
++
++ /**
++ * returns the Accessible that has focus
++ */
++ private AccessibleContext getAccessibleContextWithFocus() {
++ Component c = AWTEventMonitor.getComponentWithFocus();
++ if (c != null) {
++ final Accessible a = Translator.getAccessible(c);
++ if (a != null) {
++ AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return a.getAccessibleContext();
++ }
++ }, c);
++ if (ac != null) {
++ return ac;
++ }
++ }
++ }
++ return null;
++ }
++
++ /**
++ * returns the AccessibleName from an AccessibleContext
++ */
++ private String getAccessibleNameFromContext(final AccessibleContext ac) {
++ debugString("***** ac = "+ac.getClass());
++ if (ac != null) {
++ String s = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return ac.getAccessibleName();
++ }
++ }, ac);
++ if (s != null) {
++ references.increment(s);
++ debugString("Returning AccessibleName from Context: " + s);
++ return s;
++ } else {
++ return null;
++ }
++ } else {
++ debugString("getAccessibleNameFromContext; ac = null!");
++ return null;
++ }
++ }
++
++ /**
++ * Returns an AccessibleName for a component using an algorithm optimized
++ * for the JAWS screen reader. This method is only intended for JAWS. All
++ * other uses are entirely optional.
++ */
++ private String getVirtualAccessibleNameFromContext(final AccessibleContext ac) {
++ if (null != ac) {
++ /*
++ Step 1:
++ =======
++ Determine if we can obtain the Virtual Accessible Name from the
++ Accessible Name or Accessible Description of the object.
++ */
++ String nameString = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return ac.getAccessibleName();
++ }
++ }, ac);
++ if ( ( null != nameString ) && ( 0 != nameString.length () ) ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from AccessibleContext::getAccessibleName.");
++ references.increment (nameString);
++ return nameString;
++ }
++ String descriptionString = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return ac.getAccessibleDescription();
++ }
++ }, ac);
++ if ( ( null != descriptionString ) && ( 0 != descriptionString.length () ) ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from AccessibleContext::getAccessibleDescription.");
++ references.increment (descriptionString);
++ return descriptionString;
++ }
++
++ debugString ("The Virtual Accessible Name was not found using AccessibleContext::getAccessibleDescription. or getAccessibleName");
++ /*
++ Step 2:
++ =======
++ Decide whether the extended name search algorithm should be
++ used for this object.
++ */
++ boolean bExtendedSearch = false;
++ AccessibleRole role = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return ac.getAccessibleRole();
++ }
++ }, ac);
++ AccessibleContext parentContext = null;
++ AccessibleRole parentRole = AccessibleRole.UNKNOWN;
++
++ if ( extendedVirtualNameSearchRoles.contains (role) ) {
++ parentContext = getAccessibleParentFromContext (ac);
++ if ( null != parentContext ) {
++ final AccessibleContext parentContextInnerTemp = parentContext;
++ parentRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return parentContextInnerTemp.getAccessibleRole();
++ }
++ }, ac);
++ if ( AccessibleRole.UNKNOWN != parentRole ) {
++ bExtendedSearch = true;
++ if ( noExtendedVirtualNameSearchParentRoles.contains (parentRole) ) {
++ bExtendedSearch = false;
++ }
++ }
++ }
++ }
++
++ if (false == bExtendedSearch) {
++ debugString ("bk -- getVirtualAccessibleNameFromContext will not use the extended name search algorithm. role = " + role.toDisplayString (Locale.US) );
++ /*
++ Step 3:
++ =======
++ We have determined that we should not use the extended name
++ search algorithm for this object (we must obtain the name of
++ the object from the object itself and not from neighboring
++ objects). However the object name cannot be obtained from
++ the Accessible Name or Accessible Description of the object.
++
++ Handle several special cases here that might yield a value for
++ the Virtual Accessible Name. Return null if the object does
++ not match the criteria for any of these special cases.
++ */
++ if (AccessibleRole.LABEL == role) {
++ /*
++ Does the label support the Accessible Text Interface?
++ */
++ final AccessibleText at = InvocationUtils.invokeAndWait(new Callable<AccessibleText>() {
++ @Override
++ public AccessibleText call() throws Exception {
++ return ac.getAccessibleText();
++ }
++ }, ac);
++ if (null != at) {
++ int charCount = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return at.getCharCount();
++ }
++ }, ac);
++ String text = getAccessibleTextRangeFromContext (ac, 0, charCount);
++ if (null != text) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from the Accessible Text of the LABEL object.");
++ references.increment (text);
++ return text;
++ }
++ }
++ /*
++ Does the label support the Accessible Icon Interface?
++ */
++ debugString ("bk -- Attempting to obtain the Virtual Accessible Name from the Accessible Icon information.");
++ final AccessibleIcon [] ai = InvocationUtils.invokeAndWait(new Callable<AccessibleIcon[]>() {
++ @Override
++ public AccessibleIcon[] call() throws Exception {
++ return ac.getAccessibleIcon();
++ }
++ }, ac);
++ if ( (null != ai) && (ai.length > 0) ) {
++ String iconDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return ai[0].getAccessibleIconDescription();
++ }
++ }, ac);
++ if (iconDescription != null){
++ debugString ("bk -- The Virtual Accessible Name was obtained from the description of the first Accessible Icon found in the LABEL object.");
++ references.increment (iconDescription);
++ return iconDescription;
++ }
++ } else {
++ parentContext = getAccessibleParentFromContext (ac);
++ if ( null != parentContext ) {
++ final AccessibleContext parentContextInnerTemp = parentContext;
++ parentRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return parentContextInnerTemp.getAccessibleRole();
++ }
++ }, ac);
++ if ( AccessibleRole.TABLE == parentRole ) {
++ int indexInParent = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return ac.getAccessibleIndexInParent();
++ }
++ }, ac);
++ final AccessibleContext acTableCell = getAccessibleChildFromContext (parentContext, indexInParent);
++ debugString ("bk -- Making a second attempt to obtain the Virtual Accessible Name from the Accessible Icon information for the Table Cell.");
++ if (acTableCell != null) {
++ final AccessibleIcon [] aiRet =InvocationUtils.invokeAndWait(new Callable<AccessibleIcon[]>() {
++ @Override
++ public AccessibleIcon[] call() throws Exception {
++ return acTableCell.getAccessibleIcon();
++ }
++ }, ac);
++ if ( (null != aiRet) && (aiRet.length > 0) ) {
++ String iconDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return aiRet[0].getAccessibleIconDescription ();
++ }
++ }, ac);
++ if (iconDescription != null){
++ debugString ("bk -- The Virtual Accessible Name was obtained from the description of the first Accessible Icon found in the Table Cell object.");
++ references.increment (iconDescription);
++ return iconDescription;
++ }
++ }
++ }
++ }
++ }
++ }
++ } else if ( (AccessibleRole.TOGGLE_BUTTON == role) ||
++ (AccessibleRole.PUSH_BUTTON == role) ) {
++ /*
++ Does the button support the Accessible Icon Interface?
++ */
++ debugString ("bk -- Attempting to obtain the Virtual Accessible Name from the Accessible Icon information.");
++ final AccessibleIcon [] ai = InvocationUtils.invokeAndWait(new Callable<AccessibleIcon []>() {
++ public AccessibleIcon [] call() {
++ return ac.getAccessibleIcon ();
++ }
++ }, ac);
++ if ( (null != ai) && (ai.length > 0) ) {
++ String iconDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return ai[0].getAccessibleIconDescription ();
++ }
++ }, ac);
++ if (iconDescription != null){
++ debugString ("bk -- The Virtual Accessible Name was obtained from the description of the first Accessible Icon found in the TOGGLE_BUTTON or PUSH_BUTTON object.");
++ references.increment (iconDescription);
++ return iconDescription;
++ }
++ }
++ } else if ( AccessibleRole.CHECK_BOX == role ) {
++ /*
++ NOTE: The only case I know of in which a check box does not
++ have a name is when that check box is contained in a table.
++
++ In this case it would be appropriate to use the display string
++ of the check box object as the name (in US English the display
++ string is typically either "true" or "false").
++
++ I am using the AccessibleValue interface to obtain the display
++ string of the check box. If the Accessible Value is 1, I am
++ returning Boolean.TRUE.toString (), If the Accessible Value is
++ 0, I am returning Boolean.FALSE.toString (). If the Accessible
++ Value is some other number, I will return the display string of
++ the current numerical value of the check box.
++ */
++ final AccessibleValue av = InvocationUtils.invokeAndWait(new Callable<AccessibleValue>() {
++ @Override
++ public AccessibleValue call() throws Exception {
++ return ac.getAccessibleValue();
++ }
++ }, ac);
++ if ( null != av ) {
++ nameString = null;
++ Number value = InvocationUtils.invokeAndWait(new Callable<Number>() {
++ @Override
++ public Number call() throws Exception {
++ return av.getCurrentAccessibleValue();
++ }
++ }, ac);
++ if ( null != value ) {
++ if ( 1 == value.intValue () ) {
++ nameString = Boolean.TRUE.toString ();
++ } else if ( 0 == value.intValue () ) {
++ nameString = Boolean.FALSE.toString ();
++ } else {
++ nameString = value.toString ();
++ }
++ if ( null != nameString ) {
++ references.increment (nameString);
++ return nameString;
++ }
++ }
++ }
++ }
++ return null;
++ }
++
++ /*
++ +
++ Beginning of the extended name search
++ +
++ */
++ final AccessibleContext parentContextOuterTemp = parentContext;
++ String parentName = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return parentContextOuterTemp.getAccessibleName();
++ }
++ }, ac);
++ String parentDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return parentContextOuterTemp.getAccessibleDescription();
++ }
++ }, ac);
++
++ /*
++ Step 4:
++ =======
++ Special case for Slider Bar objects.
++ */
++ if ( (AccessibleRole.SLIDER == role) &&
++ (AccessibleRole.PANEL == parentRole) &&
++ (null != parentName) ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from the Accessible Name of the SLIDER object's parent object.");
++ references.increment (parentName);
++ return parentName;
++ }
++
++ boolean bIsEditCombo = false;
++
++ AccessibleContext testContext = ac;
++ /*
++ Step 5:
++ =======
++ Special case for Edit Combo Boxes
++ */
++ if ( (AccessibleRole.TEXT == role) &&
++ (AccessibleRole.COMBO_BOX == parentRole) ) {
++ bIsEditCombo = true;
++ if (null != parentName) {
++ debugString ("bk -- The Virtual Accessible Name for this Edit Combo box was obtained from the Accessible Name of the object's parent object.");
++ references.increment (parentName);
++ return parentName;
++ } else if (null != parentDescription) {
++ debugString ("bk -- The Virtual Accessible Name for this Edit Combo box was obtained from the Accessible Description of the object's parent object.");
++ references.increment (parentDescription);
++ return parentDescription;
++ }
++ testContext = parentContext;
++ parentRole = AccessibleRole.UNKNOWN;
++ parentContext = getAccessibleParentFromContext (testContext);
++ if ( null != parentContext ) {
++ final AccessibleContext parentContextInnerTemp = parentContext;
++ parentRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return parentContextInnerTemp.getAccessibleRole();
++ }
++ }, ac);
++ }
++ }
++
++ /*
++ Step 6:
++ =======
++ Attempt to get the Virtual Accessible Name of the object using the
++ Accessible Relation Set Info (the LABELED_BY Accessible Relation).
++ */
++ String version = getJavaVersionProperty ();
++ if ( (null != version) && (version.compareTo ("1.3") >= 0) ) {
++ final AccessibleContext parentContextTempInner = parentContext;
++ AccessibleRelationSet ars = InvocationUtils.invokeAndWait(new Callable<AccessibleRelationSet>() {
++ @Override
++ public AccessibleRelationSet call() throws Exception {
++ return parentContextTempInner.getAccessibleRelationSet();
++ }
++ }, ac);
++ if ( ars != null && (ars.size () > 0) && (ars.contains (AccessibleRelation.LABELED_BY)) ) {
++ AccessibleRelation labeledByRelation = ars.get (AccessibleRelation.LABELED_BY);
++ if (labeledByRelation != null) {
++ Object [] targets = labeledByRelation.getTarget ();
++ Object o = targets [0];
++ if (o instanceof Accessible) {
++ AccessibleContext labelContext = ((Accessible)o).getAccessibleContext ();
++ if (labelContext != null) {
++ String labelName = labelContext.getAccessibleName ();
++ String labelDescription = labelContext.getAccessibleDescription ();
++ if (null != labelName) {
++ debugString ("bk -- The Virtual Accessible Name was obtained using the LABELED_BY AccessibleRelation -- Name Case.");
++ references.increment (labelName);
++ return labelName;
++ } else if (null != labelDescription) {
++ debugString ("bk -- The Virtual Accessible Name was obtained using the LABELED_BY AccessibleRelation -- Description Case.");
++ references.increment (labelDescription);
++ return labelDescription;
++ }
++ }
++ }
++ }
++ }
++ } else {
++ debugString ("bk -- This version of Java does not support AccessibleContext::getAccessibleRelationSet.");
++ }
++
++ //Note: add AccessibleContext to use InvocationUtils.invokeAndWait
++ /*
++ Step 7:
++ =======
++ Search for a label object that is positioned either just to the left
++ or just above the object and get the Accessible Name of the Label
++ object.
++ */
++ int testIndexMax = 0;
++ int testX = 0;
++ int testY = 0;
++ int testWidth = 0;
++ int testHeight = 0;
++ int targetX = 0;
++ int targetY = 0;
++ final AccessibleContext tempContext = testContext;
++ int testIndex = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return tempContext.getAccessibleIndexInParent();
++ }
++ }, ac);
++ if ( null != parentContext ) {
++ final AccessibleContext parentContextInnerTemp = parentContext;
++ testIndexMax = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return parentContextInnerTemp.getAccessibleChildrenCount() - 1;
++ }
++ }, ac);
++ }
++ testX = getAccessibleXcoordFromContext (testContext);
++ testY = getAccessibleYcoordFromContext (testContext);
++ testWidth = getAccessibleWidthFromContext (testContext);
++ testHeight = getAccessibleHeightFromContext (testContext);
++ targetX = testX + 2;
++ targetY = testY + 2;
++
++ int childIndex = testIndex - 1;
++ /*Accessible child = null;
++ AccessibleContext childContext = null;
++ AccessibleRole childRole = AccessibleRole.UNKNOWN;*/
++ int childX = 0;
++ int childY = 0;
++ int childWidth = 0;
++ int childHeight = 0;
++ String childName = null;
++ String childDescription = null;
++ while (childIndex >= 0) {
++ final int childIndexTemp = childIndex;
++ final AccessibleContext parentContextInnerTemp = parentContext;
++ final Accessible child = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
++ @Override
++ public Accessible call() throws Exception {
++ return parentContextInnerTemp.getAccessibleChild(childIndexTemp);
++ }
++ }, ac);
++ if ( null != child ) {
++ final AccessibleContext childContext = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return child.getAccessibleContext();
++ }
++ }, ac);
++ if ( null != childContext ) {
++ AccessibleRole childRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return childContext.getAccessibleRole();
++ }
++ }, ac);
++ if ( AccessibleRole.LABEL == childRole ) {
++ childX = getAccessibleXcoordFromContext (childContext);
++ childY = getAccessibleYcoordFromContext (childContext);
++ childWidth = getAccessibleWidthFromContext (childContext);
++ childHeight = getAccessibleHeightFromContext (childContext);
++ if ( (childX < testX) &&
++ ((childY <= targetY) && (targetY <= (childY + childHeight))) ) {
++ childName = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleName ();
++ }
++ }, ac);
++ if ( null != childName ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a LABEL object positioned to the left of the object.");
++ references.increment (childName);
++ return childName;
++ }
++ childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleDescription ();
++ }
++ }, ac);
++ if ( null != childDescription ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a LABEL object positioned to the left of the object.");
++ references.increment (childDescription);
++ return childDescription;
++ }
++ } else if ( (childY < targetY) &&
++ ((childX <= targetX) && (targetX <= (childX + childWidth))) ) {
++ childName = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleName ();
++ }
++ }, ac);
++ if ( null != childName ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a LABEL object positioned above the object.");
++ references.increment (childName);
++ return childName;
++ }
++ childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleDescription ();
++ }
++ }, ac);
++ if ( null != childDescription ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a LABEL object positioned above the object.");
++ references.increment (childDescription);
++ return childDescription;
++ }
++ }
++ }
++ }
++ }
++ childIndex --;
++ }
++ childIndex = testIndex + 1;
++ while (childIndex <= testIndexMax) {
++ final int childIndexTemp = childIndex;
++ final AccessibleContext parentContextInnerTemp = parentContext;
++ final Accessible child = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
++ @Override
++ public Accessible call() throws Exception {
++ return parentContextInnerTemp.getAccessibleChild(childIndexTemp);
++ }
++ }, ac);
++ if ( null != child ) {
++ final AccessibleContext childContext = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return child.getAccessibleContext();
++ }
++ }, ac);
++ if ( null != childContext ) {
++ AccessibleRole childRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return childContext.getAccessibleRole();
++ }
++ }, ac);
++ if ( AccessibleRole.LABEL == childRole ) {
++ childX = getAccessibleXcoordFromContext (childContext);
++ childY = getAccessibleYcoordFromContext (childContext);
++ childWidth = getAccessibleWidthFromContext (childContext);
++ childHeight = getAccessibleHeightFromContext (childContext);
++ if ( (childX < testX) &&
++ ((childY <= targetY) && (targetY <= (childY + childHeight))) ) {
++ childName = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleName ();
++ }
++ }, ac);
++ if ( null != childName ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a LABEL object positioned to the left of the object.");
++ references.increment (childName);
++ return childName;
++ }
++ childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleDescription ();
++ }
++ }, ac);
++ if ( null != childDescription ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a LABEL object positioned to the left of the object.");
++ references.increment (childDescription);
++ return childDescription;
++ }
++ } else if ( (childY < targetY) &&
++ ((childX <= targetX) && (targetX <= (childX + childWidth))) ) {
++ childName = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleName ();
++ }
++ }, ac);
++ if ( null != childName ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a LABEL object positioned above the object.");
++ references.increment (childName);
++ return childName;
++ }
++ childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleDescription ();
++ }
++ }, ac);
++ if ( null != childDescription ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a LABEL object positioned above the object.");
++ references.increment (childDescription);
++ return childDescription;
++ }
++ }
++ }
++ }
++ }
++ childIndex ++;
++ }
++ /*
++ Step 8:
++ =======
++ Special case for combo boxes and text objects, based on a
++ similar special case I found in some of our internal JAWS code.
++
++ Search for a button object that is positioned either just to the left
++ or just above the object and get the Accessible Name of the button
++ object.
++ */
++ if ( (AccessibleRole.TEXT == role) ||
++ (AccessibleRole.COMBO_BOX == role) ||
++ (bIsEditCombo) ) {
++ childIndex = testIndex - 1;
++ while (childIndex >= 0) {
++ final int childIndexTemp = childIndex;
++ final AccessibleContext parentContextInnerTemp = parentContext;
++ final Accessible child = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
++ @Override
++ public Accessible call() throws Exception {
++ return parentContextInnerTemp.getAccessibleChild(childIndexTemp);
++ }
++ }, ac);
++ if ( null != child ) {
++ final AccessibleContext childContext = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return child.getAccessibleContext();
++ }
++ }, ac);
++ if ( null != childContext ) {
++ AccessibleRole childRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return childContext.getAccessibleRole();
++ }
++ }, ac);
++ if ( ( AccessibleRole.PUSH_BUTTON == childRole ) ||
++ ( AccessibleRole.TOGGLE_BUTTON == childRole )) {
++ childX = getAccessibleXcoordFromContext (childContext);
++ childY = getAccessibleYcoordFromContext (childContext);
++ childWidth = getAccessibleWidthFromContext (childContext);
++ childHeight = getAccessibleHeightFromContext (childContext);
++ if ( (childX < testX) &&
++ ((childY <= targetY) && (targetY <= (childY + childHeight))) ) {
++ childName = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleName ();
++ }
++ }, ac);
++ if ( null != childName ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a PUSH_BUTTON or TOGGLE_BUTTON object positioned to the left of the object.");
++ references.increment (childName);
++ return childName;
++ }
++ childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleDescription ();
++ }
++ }, ac);
++ if ( null != childDescription ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a PUSH_BUTTON or TOGGLE_BUTTON object positioned to the left of the object.");
++ references.increment (childDescription);
++ return childDescription;
++ }
++ }
++ }
++ }
++ }
++ childIndex --;
++ }
++ childIndex = testIndex + 1;
++ while (childIndex <= testIndexMax) {
++ final int childIndexTemp = childIndex;
++ final AccessibleContext parentContextInnerTemp = parentContext;
++ final Accessible child = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
++ @Override
++ public Accessible call() throws Exception {
++ return parentContextInnerTemp.getAccessibleChild(childIndexTemp);
++ }
++ }, ac);
++ if ( null != child ) {
++ final AccessibleContext childContext = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return child.getAccessibleContext();
++ }
++ }, ac);
++ if ( null != childContext ) {
++ AccessibleRole childRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return childContext.getAccessibleRole();
++ }
++ }, ac);
++ if ( ( AccessibleRole.PUSH_BUTTON == childRole ) ||
++ ( AccessibleRole.TOGGLE_BUTTON == childRole ) ) {
++ childX = getAccessibleXcoordFromContext (childContext);
++ childY = getAccessibleYcoordFromContext (childContext);
++ childWidth = getAccessibleWidthFromContext (childContext);
++ childHeight = getAccessibleHeightFromContext (childContext);
++ if ( (childX < testX) &&
++ ((childY <= targetY) && (targetY <= (childY + childHeight))) ) {
++ childName = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleName();
++ }
++ }, ac);
++ if ( null != childName ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a PUSH_BUTTON or TOGGLE_BUTTON object positioned to the left of the object.");
++ references.increment (childName);
++ return childName;
++ }
++ childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
++ public String call() {
++ return childContext.getAccessibleDescription ();
++ }
++ }, ac);
++ if ( null != childDescription ) {
++ debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a PUSH_BUTTON or TOGGLE_BUTTON object positioned to the left of the object.");
++ references.increment (childDescription);
++ return childDescription;
++ }
++ }
++ }
++ }
++ }
++ childIndex ++;
++ }
++ }
++ return null;
++ } else {
++ debugString ("AccessBridge::getVirtualAccessibleNameFromContext error - ac == null.");
++ return null;
++ }
++ }
++
++ /**
++ * returns the AccessibleDescription from an AccessibleContext
++ */
++ private String getAccessibleDescriptionFromContext(final AccessibleContext ac) {
++ if (ac != null) {
++ String s = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return ac.getAccessibleDescription();
++ }
++ }, ac);
++ if (s != null) {
++ references.increment(s);
++ debugString("Returning AccessibleDescription from Context: " + s);
++ return s;
++ }
++ } else {
++ debugString("getAccessibleDescriptionFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * returns the AccessibleRole from an AccessibleContext
++ */
++ private String getAccessibleRoleStringFromContext(final AccessibleContext ac) {
++ if (ac != null) {
++ AccessibleRole role = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
++ @Override
++ public AccessibleRole call() throws Exception {
++ return ac.getAccessibleRole();
++ }
++ }, ac);
++ if (role != null) {
++ String s = role.toDisplayString(Locale.US);
++ if (s != null) {
++ references.increment(s);
++ debugString("Returning AccessibleRole from Context: " + s);
++ return s;
++ }
++ }
++ } else {
++ debugString("getAccessibleRoleStringFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the AccessibleRole from an AccessibleContext in the en_US locale
++ */
++ private String getAccessibleRoleStringFromContext_en_US(final AccessibleContext ac) {
++ return getAccessibleRoleStringFromContext(ac);
++ }
++
++ /**
++ * return the AccessibleStates from an AccessibleContext
++ */
++ private String getAccessibleStatesStringFromContext(final AccessibleContext ac) {
++ if (ac != null) {
++ AccessibleStateSet stateSet = InvocationUtils.invokeAndWait(new Callable<AccessibleStateSet>() {
++ @Override
++ public AccessibleStateSet call() throws Exception {
++ return ac.getAccessibleStateSet();
++ }
++ }, ac);
++ if (stateSet != null) {
++ String s = stateSet.toString();
++ if (s != null &&
++ s.indexOf(AccessibleState.MANAGES_DESCENDANTS.toDisplayString(Locale.US)) == -1) {
++ // Indicate whether this component manages its own
++ // children
++ AccessibleRole role = ac.getAccessibleRole();
++ if (role == AccessibleRole.LIST ||
++ role == AccessibleRole.TABLE ||
++ role == AccessibleRole.TREE) {
++ s += ",";
++ s += AccessibleState.MANAGES_DESCENDANTS.toDisplayString(Locale.US);
++ }
++ references.increment(s);
++ debugString("Returning AccessibleStateSet from Context: " + s);
++ return s;
++ }
++ }
++ } else {
++ debugString("getAccessibleStatesStringFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * returns the AccessibleStates from an AccessibleContext in the en_US locale
++ */
++ private String getAccessibleStatesStringFromContext_en_US(final AccessibleContext ac) {
++ if (ac != null) {
++ AccessibleStateSet stateSet = InvocationUtils.invokeAndWait(new Callable<AccessibleStateSet>() {
++ @Override
++ public AccessibleStateSet call() throws Exception {
++ return ac.getAccessibleStateSet();
++ }
++ }, ac);
++ if (stateSet != null) {
++ String s = "";
++ AccessibleState[] states = stateSet.toArray();
++ if (states != null && states.length > 0) {
++ s = states[0].toDisplayString(Locale.US);
++ for (int i = 1; i < states.length; i++) {
++ s = s + "," + states[i].toDisplayString(Locale.US);
++ }
++ }
++ references.increment(s);
++ debugString("Returning AccessibleStateSet en_US from Context: " + s);
++ return s;
++ }
++ }
++ debugString("getAccessibleStatesStringFromContext; ac = null");
++ return null;
++ }
++
++ /**
++ * returns the AccessibleParent from an AccessibleContext
++ */
++ private AccessibleContext getAccessibleParentFromContext(final AccessibleContext ac) {
++ if (ac==null)
++ return null;
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ Accessible a = ac.getAccessibleParent();
++ if (a != null) {
++ AccessibleContext apc = a.getAccessibleContext();
++ if (apc != null) {
++ return apc;
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ /**
++ * returns the AccessibleIndexInParent from an AccessibleContext
++ */
++ private int getAccessibleIndexInParentFromContext(final AccessibleContext ac) {
++ if (ac==null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return ac.getAccessibleIndexInParent();
++ }
++ }, ac);
++ }
++
++ /**
++ * returns the AccessibleChild count from an AccessibleContext
++ */
++ private int getAccessibleChildrenCountFromContext(final AccessibleContext ac) {
++ if (ac==null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return ac.getAccessibleChildrenCount();
++ }
++ }, ac);
++ }
++
++ /**
++ * returns the AccessibleChild Context from an AccessibleContext
++ */
++ private AccessibleContext getAccessibleChildFromContext(final AccessibleContext ac, final int index) {
++
++ if (ac == null) {
++ return null;
++ }
++
++ final JTable table = InvocationUtils.invokeAndWait(new Callable<JTable>() {
++ @Override
++ public JTable call() throws Exception {
++ // work-around for AccessibleJTable.getCurrentAccessibleContext returning
++ // wrong renderer component when cell contains more than one component
++ Accessible parent = ac.getAccessibleParent();
++ if (parent != null) {
++ int indexInParent = ac.getAccessibleIndexInParent();
++ Accessible child =
++ parent.getAccessibleContext().getAccessibleChild(indexInParent);
++ if (child instanceof JTable) {
++ return (JTable) child;
++ }
++ }
++ return null;
++ }
++ }, ac);
++
++ if (table == null) {
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ Accessible a = ac.getAccessibleChild(index);
++ if (a != null) {
++ return a.getAccessibleContext();
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ final AccessibleTable at = getAccessibleTableFromContext(ac);
++
++ final int row = getAccessibleTableRow(at, index);
++ final int column = getAccessibleTableColumn(at, index);
++
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ TableCellRenderer renderer = table.getCellRenderer(row, column);
++ if (renderer == null) {
++ Class<?> columnClass = table.getColumnClass(column);
++ renderer = table.getDefaultRenderer(columnClass);
++ }
++ Component component =
++ renderer.getTableCellRendererComponent(table, table.getValueAt(row, column),
++ false, false, row, column);
++ if (component instanceof Accessible) {
++ return component.getAccessibleContext();
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ /**
++ * returns the AccessibleComponent bounds on screen from an AccessibleContext
++ */
++ private Rectangle getAccessibleBoundsOnScreenFromContext(final AccessibleContext ac) {
++ if(ac==null)
++ return null;
++ return InvocationUtils.invokeAndWait(new Callable<Rectangle>() {
++ @Override
++ public Rectangle call() throws Exception {
++ AccessibleComponent acmp = ac.getAccessibleComponent();
++ if (acmp != null) {
++ Rectangle r = acmp.getBounds();
++ if (r != null) {
++ try {
++ Point p = acmp.getLocationOnScreen();
++ if (p != null) {
++ r.x = p.x;
++ r.y = p.y;
++ return r;
++ }
++ } catch (Exception e) {
++ return null;
++ }
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ /**
++ * returns the AccessibleComponent x-coord from an AccessibleContext
++ */
++ private int getAccessibleXcoordFromContext(AccessibleContext ac) {
++ if (ac != null) {
++ Rectangle r = getAccessibleBoundsOnScreenFromContext(ac);
++ if (r != null) {
++ debugString(" - Returning Accessible x coord from Context: " + r.x);
++ return r.x;
++ }
++ } else {
++ debugString("getAccessibleXcoordFromContext ac = null");
++ }
++ return -1;
++ }
++
++ /**
++ * returns the AccessibleComponent y-coord from an AccessibleContext
++ */
++ private int getAccessibleYcoordFromContext(AccessibleContext ac) {
++ debugString("getAccessibleYcoordFromContext() called");
++ if (ac != null) {
++ Rectangle r = getAccessibleBoundsOnScreenFromContext(ac);
++ if (r != null) {
++ return r.y;
++ }
++ } else {
++ debugString("getAccessibleYcoordFromContext; ac = null");
++ }
++ return -1;
++ }
++
++ /**
++ * returns the AccessibleComponent height from an AccessibleContext
++ */
++ private int getAccessibleHeightFromContext(AccessibleContext ac) {
++ if (ac != null) {
++ Rectangle r = getAccessibleBoundsOnScreenFromContext(ac);
++ if (r != null) {
++ return r.height;
++ }
++ } else {
++ debugString("getAccessibleHeightFromContext; ac = null");
++ }
++ return -1;
++ }
++
++ /**
++ * returns the AccessibleComponent width from an AccessibleContext
++ */
++ private int getAccessibleWidthFromContext(AccessibleContext ac) {
++ if (ac != null) {
++ Rectangle r = getAccessibleBoundsOnScreenFromContext(ac);
++ if (r != null) {
++ return r.width;
++ }
++ } else {
++ debugString("getAccessibleWidthFromContext; ac = null");
++ }
++ return -1;
++ }
++
++
++ /**
++ * returns the AccessibleComponent from an AccessibleContext
++ */
++ private AccessibleComponent getAccessibleComponentFromContext(AccessibleContext ac) {
++ if (ac != null) {
++ AccessibleComponent acmp = ac.getAccessibleComponent();
++ if (acmp != null) {
++ debugString("Returning AccessibleComponent Context");
++ return acmp;
++ }
++ } else {
++ debugString("getAccessibleComponentFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * returns the AccessibleAction from an AccessibleContext
++ */
++ private AccessibleAction getAccessibleActionFromContext(final AccessibleContext ac) {
++ debugString("Returning AccessibleAction Context");
++ return ac == null ? null : InvocationUtils.invokeAndWait(new Callable<AccessibleAction>() {
++ @Override
++ public AccessibleAction call() throws Exception {
++ return ac.getAccessibleAction();
++ }
++ }, ac);
++ }
++
++ /**
++ * returns the AccessibleSelection from an AccessibleContext
++ */
++ private AccessibleSelection getAccessibleSelectionFromContext(final AccessibleContext ac) {
++ return ac == null ? null : InvocationUtils.invokeAndWait(new Callable<AccessibleSelection>() {
++ @Override
++ public AccessibleSelection call() throws Exception {
++ return ac.getAccessibleSelection();
++ }
++ }, ac);
++ }
++
++ /**
++ * return the AccessibleText from an AccessibleContext
++ */
++ private AccessibleText getAccessibleTextFromContext(final AccessibleContext ac) {
++ return ac == null ? null : InvocationUtils.invokeAndWait(new Callable<AccessibleText>() {
++ @Override
++ public AccessibleText call() throws Exception {
++ return ac.getAccessibleText();
++ }
++ }, ac);
++ }
++
++ /**
++ * return the AccessibleComponent from an AccessibleContext
++ */
++ private AccessibleValue getAccessibleValueFromContext(final AccessibleContext ac) {
++ return ac == null ? null : InvocationUtils.invokeAndWait(new Callable<AccessibleValue>() {
++ @Override
++ public AccessibleValue call() throws Exception {
++ return ac.getAccessibleValue();
++ }
++ }, ac);
++ }
++
++ /* ===== AccessibleText methods ===== */
++
++ /**
++ * returns the bounding rectangle for the text cursor
++ * XXX
++ */
++ private Rectangle getCaretLocation(final AccessibleContext ac) {
++ debugString("getCaretLocation");
++ if (ac==null)
++ return null;
++ return InvocationUtils.invokeAndWait(new Callable<Rectangle>() {
++ @Override
++ public Rectangle call() throws Exception {
++ // workaround for JAAPI not returning cursor bounding rectangle
++ Rectangle r = null;
++ Accessible parent = ac.getAccessibleParent();
++ if (parent instanceof Accessible) {
++ int indexInParent = ac.getAccessibleIndexInParent();
++ Accessible child =
++ parent.getAccessibleContext().getAccessibleChild(indexInParent);
++
++ if (child instanceof JTextComponent) {
++ JTextComponent text = (JTextComponent) child;
++ try {
++ r = text.modelToView(text.getCaretPosition());
++ if (r != null) {
++ Point p = text.getLocationOnScreen();
++ r.translate(p.x, p.y);
++ }
++ } catch (BadLocationException ble) {
++ }
++ }
++ }
++ return r;
++ }
++ }, ac);
++ }
++
++ /**
++ * returns the x-coordinate for the text cursor rectangle
++ */
++ private int getCaretLocationX(AccessibleContext ac) {
++ Rectangle r = getCaretLocation(ac);
++ if (r != null) {
++ return r.x;
++ } else {
++ return -1;
++ }
++ }
++
++ /**
++ * returns the y-coordinate for the text cursor rectangle
++ */
++ private int getCaretLocationY(AccessibleContext ac) {
++ Rectangle r = getCaretLocation(ac);
++ if (r != null) {
++ return r.y;
++ } else {
++ return -1;
++ }
++ }
++
++ /**
++ * returns the height for the text cursor rectangle
++ */
++ private int getCaretLocationHeight(AccessibleContext ac) {
++ Rectangle r = getCaretLocation(ac);
++ if (r != null) {
++ return r.height;
++ } else {
++ return -1;
++ }
++ }
++
++ /**
++ * returns the width for the text cursor rectangle
++ */
++ private int getCaretLocationWidth(AccessibleContext ac) {
++ Rectangle r = getCaretLocation(ac);
++ if (r != null) {
++ return r.width;
++ } else {
++ return -1;
++ }
++ }
++
++ /**
++ * returns the character count from an AccessibleContext
++ */
++ private int getAccessibleCharCountFromContext(final AccessibleContext ac) {
++ if (ac==null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ return at.getCharCount();
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /**
++ * returns the caret position from an AccessibleContext
++ */
++ private int getAccessibleCaretPositionFromContext(final AccessibleContext ac) {
++ if (ac==null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ return at.getCaretPosition();
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /**
++ * Return the index at a specific point from an AccessibleContext
++ * Point(x, y) is in screen coordinates.
++ */
++ private int getAccessibleIndexAtPointFromContext(final AccessibleContext ac,
++ final int x, final int y) {
++ debugString("getAccessibleIndexAtPointFromContext: x = "+x+"; y = "+y);
++ if (ac==null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ AccessibleComponent acomp = ac.getAccessibleComponent();
++ if (at != null && acomp != null) {
++ // Convert x and y from screen coordinates to
++ // local coordinates.
++ try {
++ Point p = acomp.getLocationOnScreen();
++ int x1, y1;
++ if (p != null) {
++ x1 = x - p.x;
++ if (x1 < 0) {
++ x1 = 0;
++ }
++ y1 = y - p.y;
++ if (y1 < 0) {
++ y1 = 0;
++ }
++
++ Point newPoint = new Point(x1, y1);
++ int indexAtPoint = at.getIndexAtPoint(new Point(x1, y1));
++ return indexAtPoint;
++ }
++ } catch (Exception e) {
++ }
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /**
++ * return the letter at a specific point from an AccessibleContext
++ */
++ private String getAccessibleLetterAtIndexFromContext(final AccessibleContext ac, final int index) {
++ if (ac != null) {
++ String s = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at == null) return null;
++ return at.getAtIndex(AccessibleText.CHARACTER, index);
++ }
++ }, ac);
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ } else {
++ debugString("getAccessibleLetterAtIndexFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the word at a specific point from an AccessibleContext
++ */
++ private String getAccessibleWordAtIndexFromContext(final AccessibleContext ac, final int index) {
++ if (ac != null) {
++ String s = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at == null) return null;
++ return at.getAtIndex(AccessibleText.WORD, index);
++ }
++ }, ac);
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ } else {
++ debugString("getAccessibleWordAtIndexFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the sentence at a specific point from an AccessibleContext
++ */
++ private String getAccessibleSentenceAtIndexFromContext(final AccessibleContext ac, final int index) {
++ if (ac != null) {
++ String s = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at == null) return null;
++ return at.getAtIndex(AccessibleText.SENTENCE, index);
++ }
++ }, ac);
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ } else {
++ debugString("getAccessibleSentenceAtIndexFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the text selection start from an AccessibleContext
++ */
++ private int getAccessibleTextSelectionStartFromContext(final AccessibleContext ac) {
++ if (ac == null) return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ return at.getSelectionStart();
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /**
++ * return the text selection end from an AccessibleContext
++ */
++ private int getAccessibleTextSelectionEndFromContext(final AccessibleContext ac) {
++ if (ac == null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ return at.getSelectionEnd();
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /**
++ * return the selected text from an AccessibleContext
++ */
++ private String getAccessibleTextSelectedTextFromContext(final AccessibleContext ac) {
++ if (ac != null) {
++ String s = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at == null) return null;
++ return at.getSelectedText();
++ }
++ }, ac);
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ } else {
++ debugString("getAccessibleTextSelectedTextFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the attribute string at a given index from an AccessibleContext
++ */
++ private String getAccessibleAttributesAtIndexFromContext(final AccessibleContext ac,
++ final int index) {
++ if (ac == null)
++ return null;
++ AttributeSet as = InvocationUtils.invokeAndWait(new Callable<AttributeSet>() {
++ @Override
++ public AttributeSet call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ return at.getCharacterAttribute(index);
++ }
++ return null;
++ }
++ }, ac);
++ String s = expandStyleConstants(as);
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ return null;
++ }
++
++ /**
++ * Get line info: left index of line
++ *
++ * algorithm: cast back, doubling each time,
++ * 'till find line boundaries
++ *
++ * return -1 if we can't get the info (e.g. index or at passed in
++ * is bogus; etc.)
++ */
++ private int getAccessibleTextLineLeftBoundsFromContext(final AccessibleContext ac,
++ final int index) {
++ if (ac == null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ int lineStart;
++ int offset;
++ Rectangle charRect;
++ Rectangle indexRect = at.getCharacterBounds(index);
++ int textLen = at.getCharCount();
++ if (indexRect == null) {
++ return -1;
++ }
++ // find the start of the line
++ //
++ offset = 1;
++ lineStart = index - offset < 0 ? 0 : index - offset;
++ charRect = at.getCharacterBounds(lineStart);
++ // slouch behind beginning of line
++ while (charRect != null
++ && charRect.y >= indexRect.y
++ && lineStart > 0) {
++ offset = offset << 1;
++ lineStart = index - offset < 0 ? 0 : index - offset;
++ charRect = at.getCharacterBounds(lineStart);
++ }
++ if (lineStart == 0) { // special case: we're on the first line!
++ // we found it!
++ } else {
++ offset = offset >> 1; // know boundary within last expansion
++ // ground forward to beginning of line
++ while (offset > 0) {
++ charRect = at.getCharacterBounds(lineStart + offset);
++ if (charRect.y < indexRect.y) { // still before line
++ lineStart += offset;
++ } else {
++ // leave lineStart alone, it's close!
++ }
++ offset = offset >> 1;
++ }
++ // subtract one 'cause we're already too far...
++ lineStart += 1;
++ }
++ return lineStart;
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /**
++ * Get line info: right index of line
++ *
++ * algorithm: cast back, doubling each time,
++ * 'till find line boundaries
++ *
++ * return -1 if we can't get the info (e.g. index or at passed in
++ * is bogus; etc.)
++ */
++ private int getAccessibleTextLineRightBoundsFromContext(final AccessibleContext ac, final int index) {
++ if(ac == null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ int lineEnd;
++ int offset;
++ Rectangle charRect;
++ Rectangle indexRect = at.getCharacterBounds(index);
++ int textLen = at.getCharCount();
++ if (indexRect == null) {
++ return -1;
++ }
++ // find the end of the line
++ //
++ offset = 1;
++ lineEnd = index + offset > textLen - 1
++ ? textLen - 1 : index + offset;
++ charRect = at.getCharacterBounds(lineEnd);
++ // push past end of line
++ while (charRect != null &&
++ charRect.y <= indexRect.y &&
++ lineEnd < textLen - 1) {
++ offset = offset << 1;
++ lineEnd = index + offset > textLen - 1
++ ? textLen - 1 : index + offset;
++ charRect = at.getCharacterBounds(lineEnd);
++ }
++ if (lineEnd == textLen - 1) { // special case: on the last line!
++ // we found it!
++ } else {
++ offset = offset >> 1; // know boundary within last expansion
++ // pull back to end of line
++ while (offset > 0) {
++ charRect = at.getCharacterBounds(lineEnd - offset);
++ if (charRect.y > indexRect.y) { // still beyond line
++ lineEnd -= offset;
++ } else {
++ // leave lineEnd alone, it's close!
++ }
++ offset = offset >> 1;
++ }
++ // subtract one 'cause we're already too far...
++ lineEnd -= 1;
++ }
++ return lineEnd;
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /**
++ * Get a range of text; null if indicies are bogus
++ */
++ private String getAccessibleTextRangeFromContext(final AccessibleContext ac,
++ final int start, final int end) {
++ String s = InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ if (ac != null) {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ // start - end is inclusive
++ if (start > end) {
++ return null;
++ }
++ if (end >= at.getCharCount()) {
++ return null;
++ }
++ StringBuffer buf = new StringBuffer(end - start + 1);
++ for (int i = start; i <= end; i++) {
++ buf.append(at.getAtIndex(AccessibleText.CHARACTER, i));
++ }
++ return buf.toString();
++ }
++ }
++ return null;
++ }
++ }, ac);
++ if (s != null) {
++ references.increment(s);
++ return s;
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * return the AttributeSet object at a given index from an AccessibleContext
++ */
++ private AttributeSet getAccessibleAttributeSetAtIndexFromContext(final AccessibleContext ac,
++ final int index) {
++ return InvocationUtils.invokeAndWait(new Callable<AttributeSet>() {
++ @Override
++ public AttributeSet call() throws Exception {
++ if (ac != null) {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ AttributeSet as = at.getCharacterAttribute(index);
++ if (as != null) {
++ AccessBridge.this.references.increment(as);
++ return as;
++ }
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++
++ /**
++ * return the bounding rectangle at index from an AccessibleContext
++ */
++ private Rectangle getAccessibleTextRectAtIndexFromContext(final AccessibleContext ac,
++ final int index) {
++ // want to do this in global coords, so need to combine w/ac global coords
++ Rectangle r = InvocationUtils.invokeAndWait(new Callable<Rectangle>() {
++ @Override
++ public Rectangle call() throws Exception {
++ // want to do this in global coords, so need to combine w/ac global coords
++ if (ac != null) {
++ AccessibleText at = ac.getAccessibleText();
++ if (at != null) {
++ Rectangle rect = at.getCharacterBounds(index);
++ if (rect != null) {
++ String s = at.getAtIndex(AccessibleText.CHARACTER, index);
++ if (s != null && s.equals("\n")) {
++ rect.width = 0;
++ }
++ return rect;
++ }
++ }
++ }
++ return null;
++ }
++ }, ac);
++ Rectangle acRect = getAccessibleBoundsOnScreenFromContext(ac);
++ if (r != null && acRect != null) {
++ r.translate(acRect.x, acRect.y);
++ return r;
++ }
++ return null;
++ }
++
++ /**
++ * return the AccessibleText character x-coord at index from an AccessibleContext
++ */
++ private int getAccessibleXcoordTextRectAtIndexFromContext(AccessibleContext ac, int index) {
++ if (ac != null) {
++ Rectangle r = getAccessibleTextRectAtIndexFromContext(ac, index);
++ if (r != null) {
++ return r.x;
++ }
++ } else {
++ debugString("getAccessibleXcoordTextRectAtIndexFromContext; ac = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the AccessibleText character y-coord at index from an AccessibleContext
++ */
++ private int getAccessibleYcoordTextRectAtIndexFromContext(AccessibleContext ac, int index) {
++ if (ac != null) {
++ Rectangle r = getAccessibleTextRectAtIndexFromContext(ac, index);
++ if (r != null) {
++ return r.y;
++ }
++ } else {
++ debugString("getAccessibleYcoordTextRectAtIndexFromContext; ac = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the AccessibleText character height at index from an AccessibleContext
++ */
++ private int getAccessibleHeightTextRectAtIndexFromContext(AccessibleContext ac, int index) {
++ if (ac != null) {
++ Rectangle r = getAccessibleTextRectAtIndexFromContext(ac, index);
++ if (r != null) {
++ return r.height;
++ }
++ } else {
++ debugString("getAccessibleHeightTextRectAtIndexFromContext; ac = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the AccessibleText character width at index from an AccessibleContext
++ */
++ private int getAccessibleWidthTextRectAtIndexFromContext(AccessibleContext ac, int index) {
++ if (ac != null) {
++ Rectangle r = getAccessibleTextRectAtIndexFromContext(ac, index);
++ if (r != null) {
++ return r.width;
++ }
++ } else {
++ debugString("getAccessibleWidthTextRectAtIndexFromContext; ac = null");
++ }
++ return -1;
++ }
++
++ /* ===== AttributeSet methods for AccessibleText ===== */
++
++ /**
++ * return the bold setting from an AttributeSet
++ */
++ private boolean getBoldFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.isBold(as);
++ } else {
++ debugString("getBoldFromAttributeSet; as = null");
++ }
++ return false;
++ }
++
++ /**
++ * return the italic setting from an AttributeSet
++ */
++ private boolean getItalicFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.isItalic(as);
++ } else {
++ debugString("getItalicFromAttributeSet; as = null");
++ }
++ return false;
++ }
++
++ /**
++ * return the underline setting from an AttributeSet
++ */
++ private boolean getUnderlineFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.isUnderline(as);
++ } else {
++ debugString("getUnderlineFromAttributeSet; as = null");
++ }
++ return false;
++ }
++
++ /**
++ * return the strikethrough setting from an AttributeSet
++ */
++ private boolean getStrikethroughFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.isStrikeThrough(as);
++ } else {
++ debugString("getStrikethroughFromAttributeSet; as = null");
++ }
++ return false;
++ }
++
++ /**
++ * return the superscript setting from an AttributeSet
++ */
++ private boolean getSuperscriptFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.isSuperscript(as);
++ } else {
++ debugString("getSuperscriptFromAttributeSet; as = null");
++ }
++ return false;
++ }
++
++ /**
++ * return the subscript setting from an AttributeSet
++ */
++ private boolean getSubscriptFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.isSubscript(as);
++ } else {
++ debugString("getSubscriptFromAttributeSet; as = null");
++ }
++ return false;
++ }
++
++ /**
++ * return the background color from an AttributeSet
++ */
++ private String getBackgroundColorFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ String s = StyleConstants.getBackground(as).toString();
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ } else {
++ debugString("getBackgroundColorFromAttributeSet; as = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the foreground color from an AttributeSet
++ */
++ private String getForegroundColorFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ String s = StyleConstants.getForeground(as).toString();
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ } else {
++ debugString("getForegroundColorFromAttributeSet; as = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the font family from an AttributeSet
++ */
++ private String getFontFamilyFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ String s = StyleConstants.getFontFamily(as).toString();
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ } else {
++ debugString("getFontFamilyFromAttributeSet; as = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the font size from an AttributeSet
++ */
++ private int getFontSizeFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getFontSize(as);
++ } else {
++ debugString("getFontSizeFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the alignment from an AttributeSet
++ */
++ private int getAlignmentFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getAlignment(as);
++ } else {
++ debugString("getAlignmentFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the BiDi level from an AttributeSet
++ */
++ private int getBidiLevelFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getBidiLevel(as);
++ } else {
++ debugString("getBidiLevelFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++
++ /**
++ * return the first line indent from an AttributeSet
++ */
++ private float getFirstLineIndentFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getFirstLineIndent(as);
++ } else {
++ debugString("getFirstLineIndentFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the left indent from an AttributeSet
++ */
++ private float getLeftIndentFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getLeftIndent(as);
++ } else {
++ debugString("getLeftIndentFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the right indent from an AttributeSet
++ */
++ private float getRightIndentFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getRightIndent(as);
++ } else {
++ debugString("getRightIndentFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the line spacing from an AttributeSet
++ */
++ private float getLineSpacingFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getLineSpacing(as);
++ } else {
++ debugString("getLineSpacingFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the space above from an AttributeSet
++ */
++ private float getSpaceAboveFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getSpaceAbove(as);
++ } else {
++ debugString("getSpaceAboveFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++ /**
++ * return the space below from an AttributeSet
++ */
++ private float getSpaceBelowFromAttributeSet(AttributeSet as) {
++ if (as != null) {
++ return StyleConstants.getSpaceBelow(as);
++ } else {
++ debugString("getSpaceBelowFromAttributeSet; as = null");
++ }
++ return -1;
++ }
++
++ /**
++ * Enumerate all StyleConstants in the AttributeSet
++ *
++ * We need to check explicitly, 'cause of the HTML package conversion
++ * mechanism (they may not be stored as StyleConstants, just translated
++ * to them when asked).
++ *
++ * (Use convenience methods where they are defined...)
++ *
++ * Not checking the following (which the IBM SNS guidelines says
++ * should be defined):
++ * - ComponentElementName
++ * - IconElementName
++ * - NameAttribute
++ * - ResolveAttribute
++ */
++ private String expandStyleConstants(AttributeSet as) {
++ Color c;
++ Object o;
++ String attrString = "";
++
++ // ---------- check for various Character Constants
++
++ attrString += "BidiLevel = " + StyleConstants.getBidiLevel(as);
++
++ final Component comp = StyleConstants.getComponent(as);
++ if (comp != null) {
++ if (comp instanceof Accessible) {
++ final AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return comp.getAccessibleContext();
++ }
++ }, comp);
++ if (ac != null) {
++ attrString += "; Accessible Component = " + InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return ac.getAccessibleName();
++ }
++ }, ac);
++ } else {
++ attrString += "; Innaccessible Component = " + comp;
++ }
++ } else {
++ attrString += "; Innaccessible Component = " + comp;
++ }
++ }
++
++ Icon i = StyleConstants.getIcon(as);
++ if (i != null) {
++ if (i instanceof ImageIcon) {
++ attrString += "; ImageIcon = " + ((ImageIcon) i).getDescription();
++ } else {
++ attrString += "; Icon = " + i;
++ }
++ }
++
++ attrString += "; FontFamily = " + StyleConstants.getFontFamily(as);
++
++ attrString += "; FontSize = " + StyleConstants.getFontSize(as);
++
++ if (StyleConstants.isBold(as)) {
++ attrString += "; bold";
++ }
++
++ if (StyleConstants.isItalic(as)) {
++ attrString += "; italic";
++ }
++
++ if (StyleConstants.isUnderline(as)) {
++ attrString += "; underline";
++ }
++
++ if (StyleConstants.isStrikeThrough(as)) {
++ attrString += "; strikethrough";
++ }
++
++ if (StyleConstants.isSuperscript(as)) {
++ attrString += "; superscript";
++ }
++
++ if (StyleConstants.isSubscript(as)) {
++ attrString += "; subscript";
++ }
++
++ c = StyleConstants.getForeground(as);
++ if (c != null) {
++ attrString += "; Foreground = " + c;
++ }
++
++ c = StyleConstants.getBackground(as);
++ if (c != null) {
++ attrString += "; Background = " + c;
++ }
++
++ attrString += "; FirstLineIndent = " + StyleConstants.getFirstLineIndent(as);
++
++ attrString += "; RightIndent = " + StyleConstants.getRightIndent(as);
++
++ attrString += "; LeftIndent = " + StyleConstants.getLeftIndent(as);
++
++ attrString += "; LineSpacing = " + StyleConstants.getLineSpacing(as);
++
++ attrString += "; SpaceAbove = " + StyleConstants.getSpaceAbove(as);
++
++ attrString += "; SpaceBelow = " + StyleConstants.getSpaceBelow(as);
++
++ attrString += "; Alignment = " + StyleConstants.getAlignment(as);
++
++ TabSet ts = StyleConstants.getTabSet(as);
++ if (ts != null) {
++ attrString += "; TabSet = " + ts;
++ }
++
++ return attrString;
++ }
++
++
++ /* ===== AccessibleValue methods ===== */
++
++ /**
++ * return the AccessibleValue current value from an AccessibleContext
++ * returned using a String 'cause the value is a java Number
++ *
++ */
++ private String getCurrentAccessibleValueFromContext(final AccessibleContext ac) {
++ if (ac != null) {
++ final Number value = InvocationUtils.invokeAndWait(new Callable<Number>() {
++ @Override
++ public Number call() throws Exception {
++ AccessibleValue av = ac.getAccessibleValue();
++ if (av == null) return null;
++ return av.getCurrentAccessibleValue();
++ }
++ }, ac);
++ if (value != null) {
++ String s = value.toString();
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ }
++ } else {
++ debugString("getCurrentAccessibleValueFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the AccessibleValue maximum value from an AccessibleContext
++ * returned using a String 'cause the value is a java Number
++ *
++ */
++ private String getMaximumAccessibleValueFromContext(final AccessibleContext ac) {
++ if (ac != null) {
++ final Number value = InvocationUtils.invokeAndWait(new Callable<Number>() {
++ @Override
++ public Number call() throws Exception {
++ AccessibleValue av = ac.getAccessibleValue();
++ if (av == null) return null;
++ return av.getMaximumAccessibleValue();
++ }
++ }, ac);
++ if (value != null) {
++ String s = value.toString();
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ }
++ } else {
++ debugString("getMaximumAccessibleValueFromContext; ac = null");
++ }
++ return null;
++ }
++
++ /**
++ * return the AccessibleValue minimum value from an AccessibleContext
++ * returned using a String 'cause the value is a java Number
++ *
++ */
++ private String getMinimumAccessibleValueFromContext(final AccessibleContext ac) {
++ if (ac != null) {
++ final Number value = InvocationUtils.invokeAndWait(new Callable<Number>() {
++ @Override
++ public Number call() throws Exception {
++ AccessibleValue av = ac.getAccessibleValue();
++ if (av == null) return null;
++ return av.getMinimumAccessibleValue();
++ }
++ }, ac);
++ if (value != null) {
++ String s = value.toString();
++ if (s != null) {
++ references.increment(s);
++ return s;
++ }
++ }
++ } else {
++ debugString("getMinimumAccessibleValueFromContext; ac = null");
++ }
++ return null;
++ }
++
++
++ /* ===== AccessibleSelection methods ===== */
++
++ /**
++ * add to the AccessibleSelection of an AccessibleContext child i
++ *
++ */
++ private void addAccessibleSelectionFromContext(final AccessibleContext ac, final int i) {
++ try {
++ InvocationUtils.invokeAndWait(new Callable<Object>() {
++ @Override
++ public Object call() throws Exception {
++ if (ac != null) {
++ AccessibleSelection as = ac.getAccessibleSelection();
++ if (as != null) {
++ as.addAccessibleSelection(i);
++ }
++ }
++ return null;
++ }
++ }, ac);
++ } catch(Exception e){}
++ }
++
++ /**
++ * clear all of the AccessibleSelection of an AccessibleContex
++ *
++ */
++ private void clearAccessibleSelectionFromContext(final AccessibleContext ac) {
++ try {
++ InvocationUtils.invokeAndWait(new Callable<Object>() {
++ @Override
++ public Object call() throws Exception {
++ AccessibleSelection as = ac.getAccessibleSelection();
++ if (as != null) {
++ as.clearAccessibleSelection();
++ }
++ return null;
++ }
++ }, ac);
++ } catch(Exception e){}
++
++ }
++
++ /**
++ * get the AccessibleContext of the i-th AccessibleSelection of an AccessibleContext
++ *
++ */
++ private AccessibleContext getAccessibleSelectionFromContext(final AccessibleContext ac, final int i) {
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ if (ac != null) {
++ AccessibleSelection as = ac.getAccessibleSelection();
++ if (as != null) {
++ Accessible a = as.getAccessibleSelection(i);
++ if (a == null)
++ return null;
++ else
++ return a.getAccessibleContext();
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ /**
++ * get number of things selected in the AccessibleSelection of an AccessibleContext
++ *
++ */
++ private int getAccessibleSelectionCountFromContext(final AccessibleContext ac) {
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ if (ac != null) {
++ AccessibleSelection as = ac.getAccessibleSelection();
++ if (as != null) {
++ return as.getAccessibleSelectionCount();
++ }
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /**
++ * return true if the i-th child of the AccessibleSelection of an AccessibleContext is selected
++ *
++ */
++ private boolean isAccessibleChildSelectedFromContext(final AccessibleContext ac, final int i) {
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ if (ac != null) {
++ AccessibleSelection as = ac.getAccessibleSelection();
++ if (as != null) {
++ return as.isAccessibleChildSelected(i);
++ }
++ }
++ return false;
++ }
++ }, ac);
++ }
++
++ /**
++ * remove the i-th child from the AccessibleSelection of an AccessibleContext
++ *
++ */
++ private void removeAccessibleSelectionFromContext(final AccessibleContext ac, final int i) {
++ InvocationUtils.invokeAndWait(new Callable<Object>() {
++ @Override
++ public Object call() throws Exception {
++ if (ac != null) {
++ AccessibleSelection as = ac.getAccessibleSelection();
++ if (as != null) {
++ as.removeAccessibleSelection(i);
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ /**
++ * select all (if possible) of the children of the AccessibleSelection of an AccessibleContext
++ *
++ */
++ private void selectAllAccessibleSelectionFromContext(final AccessibleContext ac) {
++ InvocationUtils.invokeAndWait(new Callable<Object>() {
++ @Override
++ public Object call() throws Exception {
++ if (ac != null) {
++ AccessibleSelection as = ac.getAccessibleSelection();
++ if (as != null) {
++ as.selectAllAccessibleSelection();
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ // ======== AccessibleTable ========
++
++ ConcurrentHashMap<AccessibleTable,AccessibleContext> hashtab = new ConcurrentHashMap<>();
++
++ /**
++ * returns the AccessibleTable for an AccessibleContext
++ */
++ private AccessibleTable getAccessibleTableFromContext(final AccessibleContext ac) {
++ String version = getJavaVersionProperty();
++ if ((version != null && version.compareTo("1.3") >= 0)) {
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleTable>() {
++ @Override
++ public AccessibleTable call() throws Exception {
++ if (ac != null) {
++ AccessibleTable at = ac.getAccessibleTable();
++ if (at != null) {
++ AccessBridge.this.hashtab.put(at, ac);
++ return at;
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++ return null;
++ }
++
++
++ /*
++ * returns the AccessibleContext that contains an AccessibleTable
++ */
++ private AccessibleContext getContextFromAccessibleTable(AccessibleTable at) {
++ return hashtab.get(at);
++ }
++
++ /*
++ * returns the row count for an AccessibleTable
++ */
++ private int getAccessibleTableRowCount(final AccessibleContext ac) {
++ debugString("##### getAccessibleTableRowCount");
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ if (ac != null) {
++ AccessibleTable at = ac.getAccessibleTable();
++ if (at != null) {
++ return at.getAccessibleRowCount();
++ }
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /*
++ * returns the column count for an AccessibleTable
++ */
++ private int getAccessibleTableColumnCount(final AccessibleContext ac) {
++ debugString("##### getAccessibleTableColumnCount");
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ if (ac != null) {
++ AccessibleTable at = ac.getAccessibleTable();
++ if (at != null) {
++ return at.getAccessibleColumnCount();
++ }
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /*
++ * returns the AccessibleContext for an AccessibleTable cell
++ */
++ private AccessibleContext getAccessibleTableCellAccessibleContext(final AccessibleTable at,
++ final int row, final int column) {
++ debugString("getAccessibleTableCellAccessibleContext: at = "+at.getClass());
++ if (at == null) return null;
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ if (!(at instanceof AccessibleContext)) {
++ Accessible a = at.getAccessibleAt(row, column);
++ if (a != null) {
++ return a.getAccessibleContext();
++ }
++ } else {
++ // work-around for AccessibleJTable.getCurrentAccessibleContext returning
++ // wrong renderer component when cell contains more than one component
++ AccessibleContext ac = (AccessibleContext) at;
++ Accessible parent = ac.getAccessibleParent();
++ if (parent != null) {
++ int indexInParent = ac.getAccessibleIndexInParent();
++ Accessible child =
++ parent.getAccessibleContext().getAccessibleChild(indexInParent);
++ if (child instanceof JTable) {
++ JTable table = (JTable) child;
++
++ TableCellRenderer renderer = table.getCellRenderer(row, column);
++ if (renderer == null) {
++ Class<?> columnClass = table.getColumnClass(column);
++ renderer = table.getDefaultRenderer(columnClass);
++ }
++ Component component =
++ renderer.getTableCellRendererComponent(table, table.getValueAt(row, column),
++ false, false, row, column);
++ if (component instanceof Accessible) {
++ return component.getAccessibleContext();
++ }
++ }
++ }
++ }
++ return null;
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++
++ /*
++ * returns the index of a cell at a given row and column in an AccessibleTable
++ */
++ private int getAccessibleTableCellIndex(final AccessibleTable at, int row, int column) {
++ debugString("##### getAccessibleTableCellIndex: at="+at);
++ if (at != null) {
++ int cellIndex = row *
++ InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return at.getAccessibleColumnCount();
++ }
++ }, getContextFromAccessibleTable(at)) +
++ column;
++ debugString(" ##### getAccessibleTableCellIndex="+cellIndex);
++ return cellIndex;
++ }
++ debugString(" ##### getAccessibleTableCellIndex FAILED");
++ return -1;
++ }
++
++ /*
++ * returns the row extent of a cell at a given row and column in an AccessibleTable
++ */
++ private int getAccessibleTableCellRowExtent(final AccessibleTable at, final int row, final int column) {
++ debugString("##### getAccessibleTableCellRowExtent");
++ if (at != null) {
++ int rowExtent = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return at.getAccessibleRowExtentAt(row, column);
++ }
++ },
++ getContextFromAccessibleTable(at));
++ debugString(" ##### getAccessibleTableCellRowExtent="+rowExtent);
++ return rowExtent;
++ }
++ debugString(" ##### getAccessibleTableCellRowExtent FAILED");
++ return -1;
++ }
++
++ /*
++ * returns the column extent of a cell at a given row and column in an AccessibleTable
++ */
++ private int getAccessibleTableCellColumnExtent(final AccessibleTable at, final int row, final int column) {
++ debugString("##### getAccessibleTableCellColumnExtent");
++ if (at != null) {
++ int columnExtent = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return at.getAccessibleColumnExtentAt(row, column);
++ }
++ },
++ getContextFromAccessibleTable(at));
++ debugString(" ##### getAccessibleTableCellColumnExtent="+columnExtent);
++ return columnExtent;
++ }
++ debugString(" ##### getAccessibleTableCellColumnExtent FAILED");
++ return -1;
++ }
++
++ /*
++ * returns whether a cell is selected at a given row and column in an AccessibleTable
++ */
++ private boolean isAccessibleTableCellSelected(final AccessibleTable at, final int row,
++ final int column) {
++ debugString("##### isAccessibleTableCellSelected: ["+row+"]["+column+"]");
++ if (at == null)
++ return false;
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ boolean isSelected = false;
++ Accessible a = at.getAccessibleAt(row, column);
++ if (a != null) {
++ AccessibleContext ac = a.getAccessibleContext();
++ if (ac == null)
++ return false;
++ AccessibleStateSet as = ac.getAccessibleStateSet();
++ if (as != null) {
++ isSelected = as.contains(AccessibleState.SELECTED);
++ }
++ }
++ return isSelected;
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++
++ /*
++ * returns an AccessibleTable that represents the row header in an
++ * AccessibleTable
++ */
++ private AccessibleTable getAccessibleTableRowHeader(final AccessibleContext ac) {
++ debugString(" ##### getAccessibleTableRowHeader called");
++ AccessibleTable at = InvocationUtils.invokeAndWait(new Callable<AccessibleTable>() {
++ @Override
++ public AccessibleTable call() throws Exception {
++ if (ac != null) {
++ AccessibleTable at = ac.getAccessibleTable();
++ if (at != null) {
++ return at.getAccessibleRowHeader();
++ }
++ }
++ return null;
++ }
++ }, ac);
++ if (at != null) {
++ hashtab.put(at, ac);
++ }
++ return at;
++ }
++
++ /*
++ * returns an AccessibleTable that represents the column header in an
++ * AccessibleTable
++ */
++ private AccessibleTable getAccessibleTableColumnHeader(final AccessibleContext ac) {
++ debugString("##### getAccessibleTableColumnHeader");
++ if (ac == null)
++ return null;
++ AccessibleTable at = InvocationUtils.invokeAndWait(new Callable<AccessibleTable>() {
++ @Override
++ public AccessibleTable call() throws Exception {
++ // workaround for getAccessibleColumnHeader NPE
++ // when the table header is null
++ Accessible parent = ac.getAccessibleParent();
++ if (parent != null) {
++ int indexInParent = ac.getAccessibleIndexInParent();
++ Accessible child =
++ parent.getAccessibleContext().getAccessibleChild(indexInParent);
++ if (child instanceof JTable) {
++ JTable table = (JTable) child;
++ if (table.getTableHeader() == null) {
++ return null;
++ }
++ }
++ }
++ AccessibleTable at = ac.getAccessibleTable();
++ if (at != null) {
++ return at.getAccessibleColumnHeader();
++ }
++ return null;
++ }
++ }, ac);
++ if (at != null) {
++ hashtab.put(at, ac);
++ }
++ return at;
++ }
++
++ /*
++ * returns the number of row headers in an AccessibleTable that represents
++ * the row header in an AccessibleTable
++ */
++ private int getAccessibleTableRowHeaderRowCount(AccessibleContext ac) {
++
++ debugString(" ##### getAccessibleTableRowHeaderRowCount called");
++ if (ac != null) {
++ final AccessibleTable atRowHeader = getAccessibleTableRowHeader(ac);
++ if (atRowHeader != null) {
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ if (atRowHeader != null) {
++ return atRowHeader.getAccessibleRowCount();
++ }
++ return -1;
++ }
++ }, ac);
++ }
++ }
++ return -1;
++ }
++
++ /*
++ * returns the number of column headers in an AccessibleTable that represents
++ * the row header in an AccessibleTable
++ */
++ private int getAccessibleTableRowHeaderColumnCount(AccessibleContext ac) {
++ debugString(" ##### getAccessibleTableRowHeaderColumnCount called");
++ if (ac != null) {
++ final AccessibleTable atRowHeader = getAccessibleTableRowHeader(ac);
++ if (atRowHeader != null) {
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ if (atRowHeader != null) {
++ return atRowHeader.getAccessibleColumnCount();
++ }
++ return -1;
++ }
++ }, ac);
++ }
++ }
++ debugString(" ##### getAccessibleTableRowHeaderColumnCount FAILED");
++ return -1;
++ }
++
++ /*
++ * returns the number of row headers in an AccessibleTable that represents
++ * the column header in an AccessibleTable
++ */
++ private int getAccessibleTableColumnHeaderRowCount(AccessibleContext ac) {
++
++ debugString("##### getAccessibleTableColumnHeaderRowCount");
++ if (ac != null) {
++ final AccessibleTable atColumnHeader = getAccessibleTableColumnHeader(ac);
++ if (atColumnHeader != null) {
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ if (atColumnHeader != null) {
++ return atColumnHeader.getAccessibleRowCount();
++ }
++ return -1;
++ }
++ }, ac);
++ }
++ }
++ debugString(" ##### getAccessibleTableColumnHeaderRowCount FAILED");
++ return -1;
++ }
++
++ /*
++ * returns the number of column headers in an AccessibleTable that represents
++ * the column header in an AccessibleTable
++ */
++ private int getAccessibleTableColumnHeaderColumnCount(AccessibleContext ac) {
++
++ debugString("##### getAccessibleTableColumnHeaderColumnCount");
++ if (ac != null) {
++ final AccessibleTable atColumnHeader = getAccessibleTableColumnHeader(ac);
++ if (atColumnHeader != null) {
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ if (atColumnHeader != null) {
++ return atColumnHeader.getAccessibleColumnCount();
++ }
++ return -1;
++ }
++ }, ac);
++ }
++ }
++ debugString(" ##### getAccessibleTableColumnHeaderColumnCount FAILED");
++ return -1;
++ }
++
++ /*
++ * returns the description of a row header in an AccessibleTable
++ */
++ private AccessibleContext getAccessibleTableRowDescription(final AccessibleTable table,
++ final int row) {
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ if (table != null) {
++ Accessible a = table.getAccessibleRowDescription(row);
++ if (a != null) {
++ return a.getAccessibleContext();
++ }
++ }
++ return null;
++ }
++ }, getContextFromAccessibleTable(table));
++ }
++
++ /*
++ * returns the description of a column header in an AccessibleTable
++ */
++ private AccessibleContext getAccessibleTableColumnDescription(final AccessibleTable at,
++ final int column) {
++ if (at == null)
++ return null;
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ Accessible a = at.getAccessibleColumnDescription(column);
++ if (a != null) {
++ return a.getAccessibleContext();
++ }
++ return null;
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++
++ /*
++ * returns the number of rows selected in an AccessibleTable
++ */
++ private int getAccessibleTableRowSelectionCount(final AccessibleTable at) {
++ if (at != null) {
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ int[] selections = at.getSelectedAccessibleRows();
++ if (selections != null)
++ return selections.length;
++ else
++ return -1;
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++ return -1;
++ }
++
++ /*
++ * returns the row number of the i-th selected row in an AccessibleTable
++ */
++ private int getAccessibleTableRowSelections(final AccessibleTable at, final int i) {
++ if (at != null) {
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ int[] selections = at.getSelectedAccessibleRows();
++ if (selections.length > i) {
++ return selections[i];
++ }
++ return -1;
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++ return -1;
++ }
++
++ /*
++ * returns whether a row is selected in an AccessibleTable
++ */
++ private boolean isAccessibleTableRowSelected(final AccessibleTable at,
++ final int row) {
++ if (at == null)
++ return false;
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ return at.isAccessibleRowSelected(row);
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++
++ /*
++ * returns whether a column is selected in an AccessibleTable
++ */
++ private boolean isAccessibleTableColumnSelected(final AccessibleTable at,
++ final int column) {
++ if (at == null)
++ return false;
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ return at.isAccessibleColumnSelected(column);
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++
++ /*
++ * returns the number of columns selected in an AccessibleTable
++ */
++ private int getAccessibleTableColumnSelectionCount(final AccessibleTable at) {
++ if (at == null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ int[] selections = at.getSelectedAccessibleColumns();
++ if (selections != null)
++ return selections.length;
++ else
++ return -1;
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++
++ /*
++ * returns the row number of the i-th selected row in an AccessibleTable
++ */
++ private int getAccessibleTableColumnSelections(final AccessibleTable at, final int i) {
++ if (at == null)
++ return -1;
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ int[] selections = at.getSelectedAccessibleColumns();
++ if (selections != null && selections.length > i) {
++ return selections[i];
++ }
++ return -1;
++ }
++ }, getContextFromAccessibleTable(at));
++ }
++
++ /* ===== AccessibleExtendedTable (since 1.4) ===== */
++
++ /*
++ * returns the row number for a cell at a given index in an AccessibleTable
++ */
++ private int getAccessibleTableRow(final AccessibleTable at, int index) {
++ if (at == null)
++ return -1;
++ int colCount=InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return at.getAccessibleColumnCount();
++ }
++ }, getContextFromAccessibleTable(at));
++ return index / colCount;
++ }
++
++ /*
++ * returns the column number for a cell at a given index in an AccessibleTable
++ */
++ private int getAccessibleTableColumn(final AccessibleTable at, int index) {
++ if (at == null)
++ return -1;
++ int colCount=InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return at.getAccessibleColumnCount();
++ }
++ }, getContextFromAccessibleTable(at));
++ return index % colCount;
++ }
++
++ /*
++ * returns the index for a cell at a given row and column in an
++ * AccessibleTable
++ */
++ private int getAccessibleTableIndex(final AccessibleTable at, int row, int column) {
++ if (at == null)
++ return -1;
++ int colCount = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return at.getAccessibleColumnCount();
++ }
++ }, getContextFromAccessibleTable(at));
++ return row * colCount + column;
++ }
++
++ // ===== AccessibleRelationSet =====
++
++ /*
++ * returns the number of relations in the AccessibleContext's
++ * AccessibleRelationSet
++ */
++ private int getAccessibleRelationCount(final AccessibleContext ac) {
++ String version = getJavaVersionProperty();
++ if ((version != null && version.compareTo("1.3") >= 0)) {
++ if (ac != null) {
++ AccessibleRelationSet ars = InvocationUtils.invokeAndWait(new Callable<AccessibleRelationSet>() {
++ @Override
++ public AccessibleRelationSet call() throws Exception {
++ return ac.getAccessibleRelationSet();
++ }
++ }, ac);
++ if (ars != null)
++ return ars.size();
++ }
++ }
++ return 0;
++ }
++
++ /*
++ * returns the ith relation key in the AccessibleContext's
++ * AccessibleRelationSet
++ */
++ private String getAccessibleRelationKey(final AccessibleContext ac, final int i) {
++ return InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ if (ac != null) {
++ AccessibleRelationSet ars = ac.getAccessibleRelationSet();
++ if (ars != null) {
++ AccessibleRelation[] relations = ars.toArray();
++ if (relations != null && i >= 0 && i < relations.length) {
++ return relations[i].getKey();
++ }
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ /*
++ * returns the number of targets in a relation in the AccessibleContext's
++ * AccessibleRelationSet
++ */
++ private int getAccessibleRelationTargetCount(final AccessibleContext ac, final int i) {
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ if (ac != null) {
++ AccessibleRelationSet ars = ac.getAccessibleRelationSet();
++ if (ars != null) {
++ AccessibleRelation[] relations = ars.toArray();
++ if (relations != null && i >= 0 && i < relations.length) {
++ Object[] targets = relations[i].getTarget();
++ return targets.length;
++ }
++ }
++ }
++ return -1;
++ }
++ }, ac);
++ }
++
++ /*
++ * returns the jth target in the ith relation in the AccessibleContext's
++ * AccessibleRelationSet
++ */
++ private AccessibleContext getAccessibleRelationTarget(final AccessibleContext ac,
++ final int i, final int j) {
++ debugString("***** getAccessibleRelationTarget");
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ if (ac != null) {
++ AccessibleRelationSet ars = ac.getAccessibleRelationSet();
++ if (ars != null) {
++ AccessibleRelation[] relations = ars.toArray();
++ if (relations != null && i >= 0 && i < relations.length) {
++ Object[] targets = relations[i].getTarget();
++ if (targets != null && j >= 0 & j < targets.length) {
++ Object o = targets[j];
++ if (o instanceof Accessible) {
++ return ((Accessible) o).getAccessibleContext();
++ }
++ }
++ }
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ // ========= AccessibleHypertext =========
++
++ private Map<AccessibleHypertext, AccessibleContext> hyperTextContextMap = new WeakHashMap<>();
++ private Map<AccessibleHyperlink, AccessibleContext> hyperLinkContextMap = new WeakHashMap<>();
++
++ /*
++ * Returns the AccessibleHypertext
++ */
++ private AccessibleHypertext getAccessibleHypertext(final AccessibleContext ac) {
++ debugString("getAccessibleHyperlink");
++ if (ac==null)
++ return null;
++ AccessibleHypertext hypertext = InvocationUtils.invokeAndWait(new Callable<AccessibleHypertext>() {
++ @Override
++ public AccessibleHypertext call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (!(at instanceof AccessibleHypertext)) {
++ return null;
++ }
++ return ((AccessibleHypertext) at);
++ }
++ }, ac);
++ hyperTextContextMap.put(hypertext, ac);
++ return hypertext;
++ }
++
++ /*
++ * Returns the number of AccessibleHyperlinks
++ */
++ private int getAccessibleHyperlinkCount(AccessibleContext ac) {
++ debugString("getAccessibleHyperlinkCount");
++ if (ac == null) {
++ return 0;
++ }
++ final AccessibleHypertext hypertext = getAccessibleHypertext(ac);
++ if (hypertext == null) {
++ return 0;
++ }
++ //return hypertext.getLinkCount();
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return hypertext.getLinkCount();
++ }
++ }, ac);
++ }
++
++ /*
++ * Returns the hyperlink at the specified index
++ */
++ private AccessibleHyperlink getAccessibleHyperlink(final AccessibleHypertext hypertext, final int i) {
++ debugString("getAccessibleHyperlink");
++ if (hypertext == null) {
++ return null;
++ }
++ AccessibleContext ac = hyperTextContextMap.get(hypertext);
++ if ( i < 0 || i >=
++ InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return hypertext.getLinkCount();
++ }
++ }, ac) ) {
++ return null;
++ }
++ AccessibleHyperlink acLink = InvocationUtils.invokeAndWait(new Callable<AccessibleHyperlink>() {
++ @Override
++ public AccessibleHyperlink call() throws Exception {
++ AccessibleHyperlink link = hypertext.getLink(i);
++ if (link == null || (!link.isValid())) {
++ return null;
++ }
++ return link;
++ }
++ }, ac);
++ hyperLinkContextMap.put(acLink, ac);
++ return acLink;
++ }
++
++ /*
++ * Returns the hyperlink object description
++ */
++ private String getAccessibleHyperlinkText(final AccessibleHyperlink link) {
++ debugString("getAccessibleHyperlinkText");
++ if (link == null) {
++ return null;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ Object o = link.getAccessibleActionDescription(0);
++ if (o != null) {
++ return o.toString();
++ }
++ return null;
++ }
++ }, hyperLinkContextMap.get(link));
++ }
++
++ /*
++ * Returns the hyperlink URL
++ */
++ private String getAccessibleHyperlinkURL(final AccessibleHyperlink link) {
++ debugString("getAccessibleHyperlinkURL");
++ if (link == null) {
++ return null;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ Object o = link.getAccessibleActionObject(0);
++ if (o != null) {
++ return o.toString();
++ } else {
++ return null;
++ }
++ }
++ }, hyperLinkContextMap.get(link));
++ }
++
++ /*
++ * Returns the start index of the hyperlink text
++ */
++ private int getAccessibleHyperlinkStartIndex(final AccessibleHyperlink link) {
++ debugString("getAccessibleHyperlinkStartIndex");
++ if (link == null) {
++ return -1;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return link.getStartIndex();
++ }
++ }, hyperLinkContextMap.get(link));
++ }
++
++ /*
++ * Returns the end index of the hyperlink text
++ */
++ private int getAccessibleHyperlinkEndIndex(final AccessibleHyperlink link) {
++ debugString("getAccessibleHyperlinkEndIndex");
++ if (link == null) {
++ return -1;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return link.getEndIndex();
++ }
++ }, hyperLinkContextMap.get(link));
++ }
++
++ /*
++ * Returns the index into an array of hyperlinks that
++ * is associated with this character index, or -1 if there
++ * is no hyperlink associated with this index.
++ */
++ private int getAccessibleHypertextLinkIndex(final AccessibleHypertext hypertext, final int charIndex) {
++ debugString("getAccessibleHypertextLinkIndex: charIndex = "+charIndex);
++ if (hypertext == null) {
++ return -1;
++ }
++ int linkIndex = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return hypertext.getLinkIndex(charIndex);
++ }
++ }, hyperTextContextMap.get(hypertext));
++ debugString("getAccessibleHypertextLinkIndex returning "+linkIndex);
++ return linkIndex;
++ }
++
++ /*
++ * Actives the hyperlink
++ */
++ private boolean activateAccessibleHyperlink(final AccessibleContext ac,
++ final AccessibleHyperlink link) {
++ //debugString("activateAccessibleHyperlink: link = "+link.getClass());
++ if (link == null) {
++ return false;
++ }
++ boolean retval = InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ return link.doAccessibleAction(0);
++ }
++ }, ac);
++ debugString("activateAccessibleHyperlink: returning = "+retval);
++ return retval;
++ }
++
++
++ // ============ AccessibleKeyBinding =============
++
++ /*
++ * returns the component mnemonic
++ */
++ private KeyStroke getMnemonic(final AccessibleContext ac) {
++ if (ac == null)
++ return null;
++ return InvocationUtils.invokeAndWait(new Callable<KeyStroke>() {
++ @Override
++ public KeyStroke call() throws Exception {
++ AccessibleComponent comp = ac.getAccessibleComponent();
++ if (!(comp instanceof AccessibleExtendedComponent)) {
++ return null;
++ }
++ AccessibleExtendedComponent aec = (AccessibleExtendedComponent) comp;
++ if (aec != null) {
++ AccessibleKeyBinding akb = aec.getAccessibleKeyBinding();
++ if (akb != null) {
++ Object o = akb.getAccessibleKeyBinding(0);
++ if (o instanceof KeyStroke) {
++ return (KeyStroke) o;
++ }
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ /*
++ * returns the JMenuItem accelerator
++ */
++ private KeyStroke getAccelerator(final AccessibleContext ac) {
++ // workaround for getAccessibleKeyBinding not returning the
++ // JMenuItem accelerator
++ if (ac == null)
++ return null;
++ return InvocationUtils.invokeAndWait(new Callable<KeyStroke>() {
++ @Override
++ public KeyStroke call() throws Exception {
++ Accessible parent = ac.getAccessibleParent();
++ if (parent instanceof Accessible) {
++ int indexInParent = ac.getAccessibleIndexInParent();
++ Accessible child =
++ parent.getAccessibleContext().getAccessibleChild(indexInParent);
++ if (child instanceof JMenuItem) {
++ JMenuItem menuItem = (JMenuItem) child;
++ if (menuItem == null)
++ return null;
++ KeyStroke keyStroke = menuItem.getAccelerator();
++ return keyStroke;
++ }
++ }
++ return null;
++ }
++ }, ac);
++ }
++
++ /*
++ * returns 1-24 to indicate which F key is being used for a shortcut or 0 otherwise
++ */
++ private int fKeyNumber(KeyStroke keyStroke) {
++ if (keyStroke == null)
++ return 0;
++ int fKey = 0;
++ String keyText = KeyEvent.getKeyText(keyStroke.getKeyCode());
++ if (keyText != null && (keyText.length() == 2 || keyText.length() == 3)) {
++ String prefix = keyText.substring(0, 1);
++ if (prefix.equals("F")) {
++ try {
++ int suffix = Integer.parseInt(keyText.substring(1));
++ if (suffix >= 1 && suffix <= 24) {
++ fKey = suffix;
++ }
++ } catch (Exception e) { // ignore NumberFormatException
++ }
++ }
++ }
++ return fKey;
++ }
++
++ /*
++ * returns one of several important control characters or 0 otherwise
++ */
++ private int controlCode(KeyStroke keyStroke) {
++ if (keyStroke == null)
++ return 0;
++ int code = keyStroke.getKeyCode();
++ switch (code) {
++ case KeyEvent.VK_BACK_SPACE:
++ case KeyEvent.VK_DELETE:
++ case KeyEvent.VK_DOWN:
++ case KeyEvent.VK_END:
++ case KeyEvent.VK_HOME:
++ case KeyEvent.VK_INSERT:
++ case KeyEvent.VK_KP_DOWN:
++ case KeyEvent.VK_KP_LEFT:
++ case KeyEvent.VK_KP_RIGHT:
++ case KeyEvent.VK_KP_UP:
++ case KeyEvent.VK_LEFT:
++ case KeyEvent.VK_PAGE_DOWN:
++ case KeyEvent.VK_PAGE_UP:
++ case KeyEvent.VK_RIGHT:
++ case KeyEvent.VK_UP:
++ break;
++ default:
++ code = 0;
++ break;
++ }
++ return code;
++ }
++
++ /*
++ * returns the KeyStoke character
++ */
++ private char getKeyChar(KeyStroke keyStroke) {
++ // If the shortcut is an FKey return 1-24
++ if (keyStroke == null)
++ return 0;
++ int fKey = fKeyNumber(keyStroke);
++ if (fKey != 0) {
++ // return 0x00000001 through 0x00000018
++ debugString(" Shortcut is: F" + fKey);
++ return (char)fKey;
++ }
++ // If the accelerator is a control character, return it
++ int keyCode = controlCode(keyStroke);
++ if (keyCode != 0) {
++ debugString(" Shortcut is control character: " + Integer.toHexString(keyCode));
++ return (char)keyCode;
++ }
++ String keyText = KeyEvent.getKeyText(keyStroke.getKeyCode());
++ debugString(" Shortcut is: " + keyText);
++ if (keyText != null || keyText.length() > 0) {
++ CharSequence seq = keyText.subSequence(0, 1);
++ if (seq != null || seq.length() > 0) {
++ return seq.charAt(0);
++ }
++ }
++ return 0;
++ }
++
++ /*
++ * returns the KeyStroke modifiers as an int
++ */
++ private int getModifiers(KeyStroke keyStroke) {
++ if (keyStroke == null)
++ return 0;
++ debugString("In AccessBridge.getModifiers");
++ // modifiers is a bit strip where bits 0-7 indicate a traditional modifier
++ // such as Ctrl/Alt/Shift, bit 8 indicates an F key shortcut, and bit 9 indicates
++ // a control code shortcut such as the delete key.
++
++ int modifiers = 0;
++ // Is the shortcut an FKey?
++ if (fKeyNumber(keyStroke) != 0) {
++ modifiers |= 1 << 8;
++ }
++ // Is the shortcut a control code?
++ if (controlCode(keyStroke) != 0) {
++ modifiers |= 1 << 9;
++ }
++ // The following is needed in order to handle translated modifiers.
++ // getKeyModifiersText doesn't work because for example in German Strg is
++ // returned for Ctrl.
++
++ // There can be more than one modifier, e.g. if the modifier is ctrl + shift + B
++ // the toString text is "shift ctrl pressed B". Need to parse through that.
++ StringTokenizer st = new StringTokenizer(keyStroke.toString());
++ while (st.hasMoreTokens()) {
++ String text = st.nextToken();
++ // Meta+Ctrl+Alt+Shift
++ // 0-3 are shift, ctrl, meta, alt
++ // 4-7 are for Solaris workstations (though not being used)
++ if (text.startsWith("met")) {
++ debugString(" found meta");
++ modifiers |= ActionEvent.META_MASK;
++ }
++ if (text.startsWith("ctr")) {
++ debugString(" found ctrl");
++ modifiers |= ActionEvent.CTRL_MASK;
++ }
++ if (text.startsWith("alt")) {
++ debugString(" found alt");
++ modifiers |= ActionEvent.ALT_MASK;
++ }
++ if (text.startsWith("shi")) {
++ debugString(" found shift");
++ modifiers |= ActionEvent.SHIFT_MASK;
++ }
++ }
++ debugString(" returning modifiers: 0x" + Integer.toHexString(modifiers));
++ return modifiers;
++ }
++
++ /*
++ * returns the number of key bindings associated with this context
++ */
++ private int getAccessibleKeyBindingsCount(AccessibleContext ac) {
++ if (ac == null || (! runningOnJDK1_4) )
++ return 0;
++ int count = 0;
++
++ if (getMnemonic(ac) != null) {
++ count++;
++ }
++ if (getAccelerator(ac) != null) {
++ count++;
++ }
++ return count;
++ }
++
++ /*
++ * returns the key binding character at the specified index
++ */
++ private char getAccessibleKeyBindingChar(AccessibleContext ac, int index) {
++ if (ac == null || (! runningOnJDK1_4) )
++ return 0;
++ if((index == 0) && getMnemonic(ac)==null) {// special case when there is no mnemonic
++ KeyStroke keyStroke = getAccelerator(ac);
++ if (keyStroke != null) {
++ return getKeyChar(keyStroke);
++ }
++ }
++ if (index == 0) { // mnemonic
++ KeyStroke keyStroke = getMnemonic(ac);
++ if (keyStroke != null) {
++ return getKeyChar(keyStroke);
++ }
++ } else if (index == 1) { // accelerator
++ KeyStroke keyStroke = getAccelerator(ac);
++ if (keyStroke != null) {
++ return getKeyChar(keyStroke);
++ }
++ }
++ return 0;
++ }
++
++ /*
++ * returns the key binding modifiers at the specified index
++ */
++ private int getAccessibleKeyBindingModifiers(AccessibleContext ac, int index) {
++ if (ac == null || (! runningOnJDK1_4) )
++ return 0;
++ if((index == 0) && getMnemonic(ac)==null) {// special case when there is no mnemonic
++ KeyStroke keyStroke = getAccelerator(ac);
++ if (keyStroke != null) {
++ return getModifiers(keyStroke);
++ }
++ }
++ if (index == 0) { // mnemonic
++ KeyStroke keyStroke = getMnemonic(ac);
++ if (keyStroke != null) {
++ return getModifiers(keyStroke);
++ }
++ } else if (index == 1) { // accelerator
++ KeyStroke keyStroke = getAccelerator(ac);
++ if (keyStroke != null) {
++ return getModifiers(keyStroke);
++ }
++ }
++ return 0;
++ }
++
++ // ========== AccessibleIcon ============
++
++ /*
++ * return the number of icons associated with this context
++ */
++ private int getAccessibleIconsCount(final AccessibleContext ac) {
++ debugString("getAccessibleIconsCount");
++ if (ac == null) {
++ return 0;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleIcon[] ai = ac.getAccessibleIcon();
++ if (ai == null) {
++ return 0;
++ }
++ return ai.length;
++ }
++ }, ac);
++ }
++
++ /*
++ * return icon description at the specified index
++ */
++ private String getAccessibleIconDescription(final AccessibleContext ac, final int index) {
++ debugString("getAccessibleIconDescription: index = "+index);
++ if (ac == null) {
++ return null;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ AccessibleIcon[] ai = ac.getAccessibleIcon();
++ if (ai == null || index < 0 || index >= ai.length) {
++ return null;
++ }
++ return ai[index].getAccessibleIconDescription();
++ }
++ }, ac);
++ }
++
++ /*
++ * return icon height at the specified index
++ */
++ private int getAccessibleIconHeight(final AccessibleContext ac, final int index) {
++ debugString("getAccessibleIconHeight: index = "+index);
++ if (ac == null) {
++ return 0;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleIcon[] ai = ac.getAccessibleIcon();
++ if (ai == null || index < 0 || index >= ai.length) {
++ return 0;
++ }
++ return ai[index].getAccessibleIconHeight();
++ }
++ }, ac);
++ }
++
++ /*
++ * return icon width at the specified index
++ */
++ private int getAccessibleIconWidth(final AccessibleContext ac, final int index) {
++ debugString("getAccessibleIconWidth: index = "+index);
++ if (ac == null) {
++ return 0;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleIcon[] ai = ac.getAccessibleIcon();
++ if (ai == null || index < 0 || index >= ai.length) {
++ return 0;
++ }
++ return ai[index].getAccessibleIconWidth();
++ }
++ }, ac);
++ }
++
++ // ========= AccessibleAction ===========
++
++ /*
++ * return the number of icons associated with this context
++ */
++ private int getAccessibleActionsCount(final AccessibleContext ac) {
++ debugString("getAccessibleActionsCount");
++ if (ac == null) {
++ return 0;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ AccessibleAction aa = ac.getAccessibleAction();
++ if (aa == null)
++ return 0;
++ return aa.getAccessibleActionCount();
++ }
++ }, ac);
++ }
++
++ /*
++ * return icon description at the specified index
++ */
++ private String getAccessibleActionName(final AccessibleContext ac, final int index) {
++ debugString("getAccessibleActionName: index = "+index);
++ if (ac == null) {
++ return null;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ AccessibleAction aa = ac.getAccessibleAction();
++ if (aa == null) {
++ return null;
++ }
++ return aa.getAccessibleActionDescription(index);
++ }
++ }, ac);
++ }
++ /*
++ * return icon description at the specified index
++ */
++ private boolean doAccessibleActions(final AccessibleContext ac, final String name) {
++ debugString("doAccessibleActions: action name = "+name);
++ if (ac == null || name == null) {
++ return false;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ AccessibleAction aa = ac.getAccessibleAction();
++ if (aa == null) {
++ return false;
++ }
++ int index = -1;
++ int numActions = aa.getAccessibleActionCount();
++ for (int i = 0; i < numActions; i++) {
++ String actionName = aa.getAccessibleActionDescription(i);
++ if (name.equals(actionName)) {
++ index = i;
++ break;
++ }
++ }
++ if (index == -1) {
++ return false;
++ }
++ boolean retval = aa.doAccessibleAction(index);
++ return retval;
++ }
++ }, ac);
++ }
++
++ /* ===== AT utility methods ===== */
++
++ /**
++ * Sets the contents of an AccessibleContext that
++ * implements AccessibleEditableText with the
++ * specified text string.
++ * Returns whether successful.
++ */
++ private boolean setTextContents(final AccessibleContext ac, final String text) {
++ debugString("setTextContents: ac = "+ac+"; text = "+text);
++
++ if (! (ac instanceof AccessibleEditableText)) {
++ debugString(" ac not instanceof AccessibleEditableText: "+ac);
++ return false;
++ }
++ if (text == null) {
++ debugString(" text is null");
++ return false;
++ }
++
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ // check whether the text field is editable
++ AccessibleStateSet ass = ac.getAccessibleStateSet();
++ if (!ass.contains(AccessibleState.ENABLED)) {
++ return false;
++ }
++ ((AccessibleEditableText) ac).setTextContents(text);
++ return true;
++ }
++ }, ac);
++ }
++
++ /**
++ * Returns the Accessible Context of an Internal Frame object that is
++ * the ancestor of a given object. If the object is an Internal Frame
++ * object or an Internal Frame ancestor object was found, returns the
++ * object's AccessibleContext.
++ * If there is no ancestor object that has an Accessible Role of
++ * Internal Frame, returns (AccessibleContext)0.
++ */
++ private AccessibleContext getInternalFrame (AccessibleContext ac) {
++ return getParentWithRole(ac, AccessibleRole.INTERNAL_FRAME.toString());
++ }
++
++ /**
++ * Returns the Accessible Context for the top level object in
++ * a Java Window. This is same Accessible Context that is obtained
++ * from GetAccessibleContextFromHWND for that window. Returns
++ * (AccessibleContext)0 on error.
++ */
++ private AccessibleContext getTopLevelObject (final AccessibleContext ac) {
++ debugString("getTopLevelObject; ac = "+ac);
++ if (ac == null) {
++ return null;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ if (ac.getAccessibleRole() == AccessibleRole.DIALOG) {
++ // return the dialog, not the parent window
++ return ac;
++ }
++
++ Accessible parent = ac.getAccessibleParent();
++ if (parent == null) {
++ return ac;
++ }
++ Accessible tmp = parent;
++ while (tmp != null && tmp.getAccessibleContext() != null) {
++ AccessibleContext ac2 = tmp.getAccessibleContext();
++ if (ac2 != null && ac2.getAccessibleRole() == AccessibleRole.DIALOG) {
++ // return the dialog, not the parent window
++ return ac2;
++ }
++ parent = tmp;
++ tmp = parent.getAccessibleContext().getAccessibleParent();
++ }
++ return parent.getAccessibleContext();
++ }
++ }, ac);
++ }
++
++ /**
++ * Returns the parent AccessibleContext that has the specified AccessibleRole.
++ * Returns null on error or if the AccessibleContext does not exist.
++ */
++ private AccessibleContext getParentWithRole (final AccessibleContext ac,
++ final String roleName) {
++ debugString("getParentWithRole; ac = "+ac);
++ debugString("role = "+roleName);
++ if (ac == null || roleName == null) {
++ return null;
++ }
++
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ AccessibleRole role = AccessBridge.this.accessibleRoleMap.get(roleName);
++ if (role == null) {
++ return ac;
++ }
++
++ Accessible parent = ac.getAccessibleParent();
++ if (parent == null && ac.getAccessibleRole() == role) {
++ return ac;
++ }
++
++ Accessible tmp = parent;
++ AccessibleContext tmp_ac = null;
++
++ while (tmp != null && (tmp_ac = tmp.getAccessibleContext()) != null) {
++ AccessibleRole ar = tmp_ac.getAccessibleRole();
++ if (ar == role) {
++ // found
++ return tmp_ac;
++ }
++ parent = tmp;
++ tmp = parent.getAccessibleContext().getAccessibleParent();
++ }
++ // not found
++ return null;
++ }
++ }, ac);
++ }
++
++ /**
++ * Returns the parent AccessibleContext that has the specified AccessibleRole.
++ * Otherwise, returns the top level object for the Java Window.
++ * Returns (AccessibleContext)0 on error.
++ */
++ private AccessibleContext getParentWithRoleElseRoot (AccessibleContext ac,
++ String roleName) {
++ AccessibleContext retval = getParentWithRole(ac, roleName);
++ if (retval == null) {
++ retval = getTopLevelObject(ac);
++ }
++ return retval;
++ }
++
++ /**
++ * Returns how deep in the object hierarchy a given object is.
++ * The top most object in the object hierarchy has an object depth of 0.
++ * Returns -1 on error.
++ */
++ private int getObjectDepth(final AccessibleContext ac) {
++ debugString("getObjectDepth: ac = "+ac);
++
++ if (ac == null) {
++ return -1;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ int count = 0;
++ Accessible parent = ac.getAccessibleParent();
++ if (parent == null) {
++ return count;
++ }
++ Accessible tmp = parent;
++ while (tmp != null && tmp.getAccessibleContext() != null) {
++ parent = tmp;
++ tmp = parent.getAccessibleContext().getAccessibleParent();
++ count++;
++ }
++ return count;
++ }
++ }, ac);
++ }
++
++ /**
++ * Returns the Accessible Context of the current ActiveDescendent of an object.
++ * Returns (AccessibleContext)0 on error.
++ */
++ private AccessibleContext getActiveDescendent (final AccessibleContext ac) {
++ debugString("getActiveDescendent: ac = "+ac);
++ if (ac == null) {
++ return null;
++ }
++ // workaround for JTree bug where the only possible active
++ // descendent is the JTree root
++ final Accessible parent = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
++ @Override
++ public Accessible call() throws Exception {
++ return ac.getAccessibleParent();
++ }
++ }, ac);
++
++ if (parent != null) {
++ Accessible child = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
++ @Override
++ public Accessible call() throws Exception {
++ int indexInParent = ac.getAccessibleIndexInParent();
++ return parent.getAccessibleContext().getAccessibleChild(indexInParent);
++ }
++ }, ac);
++
++ if (child instanceof JTree) {
++ // return the selected node
++ final JTree tree = (JTree)child;
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ return new AccessibleJTreeNode(tree,
++ tree.getSelectionPath(),
++ null);
++ }
++ }, child);
++ }
++ }
++
++ return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ AccessibleSelection as = ac.getAccessibleSelection();
++ if (as == null) {
++ return null;
++ }
++ // assume single selection
++ if (as.getAccessibleSelectionCount() != 1) {
++ return null;
++ }
++ Accessible a = as.getAccessibleSelection(0);
++ if (a == null) {
++ return null;
++ }
++ return a.getAccessibleContext();
++ }
++ }, ac);
++ }
++
++
++ /**
++ * Additional methods for Teton
++ */
++
++ /**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm.
++ * Returns whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++ private String getJAWSAccessibleName(final AccessibleContext ac) {
++ debugString("getJAWSAccessibleName");
++ if (ac == null) {
++ return null;
++ }
++ // placeholder
++ return InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return ac.getAccessibleName();
++ }
++ }, ac);
++ }
++
++ /**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++ private boolean requestFocus(final AccessibleContext ac) {
++ debugString("requestFocus");
++ if (ac == null) {
++ return false;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ AccessibleComponent acomp = ac.getAccessibleComponent();
++ if (acomp == null) {
++ return false;
++ }
++ acomp.requestFocus();
++ return ac.getAccessibleStateSet().contains(AccessibleState.FOCUSED);
++ }
++ }, ac);
++ }
++
++ /**
++ * Selects text between two indices. Selection includes the
++ * text at the start index and the text at the end index. Returns
++ * whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++ private boolean selectTextRange(final AccessibleContext ac, final int startIndex, final int endIndex) {
++ debugString("selectTextRange: start = "+startIndex+"; end = "+endIndex);
++ if (ac == null) {
++ return false;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (!(at instanceof AccessibleEditableText)) {
++ return false;
++ }
++ ((AccessibleEditableText) at).selectText(startIndex, endIndex);
++
++ boolean result = at.getSelectionStart() == startIndex &&
++ at.getSelectionEnd() == endIndex;
++ return result;
++ }
++ }, ac);
++ }
++
++ /**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++ private boolean setCaretPosition(final AccessibleContext ac, final int position) {
++ debugString("setCaretPosition: position = "+position);
++ if (ac == null) {
++ return false;
++ }
++ return InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ AccessibleText at = ac.getAccessibleText();
++ if (!(at instanceof AccessibleEditableText)) {
++ return false;
++ }
++ ((AccessibleEditableText) at).selectText(position, position);
++ return at.getCaretPosition() == position;
++ }
++ }, ac);
++ }
++
++ /**
++ * Gets the number of visible children of an AccessibleContext.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ private int _visibleChildrenCount;
++ private AccessibleContext _visibleChild;
++ private int _currentVisibleIndex;
++ private boolean _foundVisibleChild;
++
++ private int getVisibleChildrenCount(AccessibleContext ac) {
++ debugString("getVisibleChildrenCount");
++ if (ac == null) {
++ return -1;
++ }
++ _visibleChildrenCount = 0;
++ _getVisibleChildrenCount(ac);
++ debugString(" _visibleChildrenCount = "+_visibleChildrenCount);
++ return _visibleChildrenCount;
++ }
++
++ /*
++ * Recursively descends AccessibleContext and gets the number
++ * of visible children
++ */
++ private void _getVisibleChildrenCount(final AccessibleContext ac) {
++ if (ac == null)
++ return;
++ int numChildren = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return ac.getAccessibleChildrenCount();
++ }
++ }, ac);
++ for (int i = 0; i < numChildren; i++) {
++ final int idx = i;
++ final AccessibleContext ac2 = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ Accessible a = ac.getAccessibleChild(idx);
++ if (a != null)
++ return a.getAccessibleContext();
++ else
++ return null;
++ }
++ }, ac);
++ if ( ac2 == null ||
++ (!InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ return ac2.getAccessibleStateSet().contains(AccessibleState.SHOWING);
++ }
++ }, ac))
++ ) {
++ continue;
++ }
++ _visibleChildrenCount++;
++
++ if (InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return ac2.getAccessibleChildrenCount();
++ }
++ }, ac) > 0 ) {
++ _getVisibleChildrenCount(ac2);
++ }
++ }
++ }
++
++ /**
++ * Gets the visible child of an AccessibleContext at the
++ * specified index
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ private AccessibleContext getVisibleChild(AccessibleContext ac, int index) {
++ debugString("getVisibleChild: index = "+index);
++ if (ac == null) {
++ return null;
++ }
++ _visibleChild = null;
++ _currentVisibleIndex = 0;
++ _foundVisibleChild = false;
++ _getVisibleChild(ac, index);
++
++ if (_visibleChild != null) {
++ debugString( " getVisibleChild: found child = " +
++ InvocationUtils.invokeAndWait(new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return AccessBridge.this._visibleChild.getAccessibleName();
++ }
++ }, ac) );
++ }
++ return _visibleChild;
++ }
++
++ /*
++ * Recursively searchs AccessibleContext and finds the visible component
++ * at the specified index
++ */
++ private void _getVisibleChild(final AccessibleContext ac, final int index) {
++ if (_visibleChild != null) {
++ return;
++ }
++
++ int numChildren = InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return ac.getAccessibleChildrenCount();
++ }
++ }, ac);
++ for (int i = 0; i < numChildren; i++) {
++ final int idx=i;
++ final AccessibleContext ac2=InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
++ @Override
++ public AccessibleContext call() throws Exception {
++ Accessible a = ac.getAccessibleChild(idx);
++ if (a == null)
++ return null;
++ else
++ return a.getAccessibleContext();
++ }
++ }, ac);
++ if (ac2 == null ||
++ (!InvocationUtils.invokeAndWait(new Callable<Boolean>() {
++ @Override
++ public Boolean call() throws Exception {
++ return ac2.getAccessibleStateSet().contains(AccessibleState.SHOWING);
++ }
++ }, ac))) {
++ continue;
++ }
++ if (!_foundVisibleChild && _currentVisibleIndex == index) {
++ _visibleChild = ac2;
++ _foundVisibleChild = true;
++ return;
++ }
++ _currentVisibleIndex++;
++
++ if ( InvocationUtils.invokeAndWait(new Callable<Integer>() {
++ @Override
++ public Integer call() throws Exception {
++ return ac2.getAccessibleChildrenCount();
++ }
++ }, ac) > 0 ) {
++ _getVisibleChild(ac2, index);
++ }
++ }
++ }
++
++
++ /* ===== Java object memory management code ===== */
++
++ /**
++ * Class to track object references to ensure the
++ * Java VM doesn't garbage collect them
++ */
++ private class ObjectReferences {
++
++ private class Reference {
++ private int value;
++
++ Reference(int i) {
++ value = i;
++ }
++
++ public String toString() {
++ return ("refCount: " + value);
++ }
++ }
++
++ /**
++ * table object references, to keep 'em from being garbage collected
++ */
++ private ConcurrentHashMap<Object,Reference> refs;
++
++ /**
++ * Constructor
++ */
++ ObjectReferences() {
++ refs = new ConcurrentHashMap<>(4);
++ }
++
++ /**
++ * Debugging: dump the contents of ObjectReferences' refs Hashtable
++ */
++ String dump() {
++ return refs.toString();
++ }
++
++ /**
++ * Increment ref count; set to 1 if we have no references for it
++ */
++ void increment(Object o) {
++ if (o == null){
++ debugString("ObjectReferences::increment - Passed in object is null");
++ return;
++ }
++
++ if (refs.containsKey(o)) {
++ (refs.get(o)).value++;
++ } else {
++ refs.put(o, new Reference(1));
++ }
++ }
++
++ /**
++ * Decrement ref count; remove if count drops to 0
++ */
++ void decrement(Object o) {
++ Reference aRef = refs.get(o);
++ if (aRef != null) {
++ aRef.value--;
++ if (aRef.value == 0) {
++ refs.remove(o);
++ } else if (aRef.value < 0) {
++ debugString("ERROR: decrementing reference count below 0");
++ }
++ } else {
++ debugString("ERROR: object to decrement not in ObjectReferences table");
++ }
++ }
++
++ }
++
++ /* ===== event handling code ===== */
++
++ /**
++ * native method for handling property change events
++ */
++ private native void propertyCaretChange(PropertyChangeEvent e,
++ AccessibleContext src,
++ int oldValue, int newValue);
++ private native void propertyDescriptionChange(PropertyChangeEvent e,
++ AccessibleContext src,
++ String oldValue, String newValue);
++ private native void propertyNameChange(PropertyChangeEvent e,
++ AccessibleContext src,
++ String oldValue, String newValue);
++ private native void propertySelectionChange(PropertyChangeEvent e,
++ AccessibleContext src);
++ private native void propertyStateChange(PropertyChangeEvent e,
++ AccessibleContext src,
++ String oldValue, String newValue);
++ private native void propertyTextChange(PropertyChangeEvent e,
++ AccessibleContext src);
++ private native void propertyValueChange(PropertyChangeEvent e,
++ AccessibleContext src,
++ String oldValue, String newValue);
++ private native void propertyVisibleDataChange(PropertyChangeEvent e,
++ AccessibleContext src);
++ private native void propertyChildChange(PropertyChangeEvent e,
++ AccessibleContext src,
++ AccessibleContext oldValue,
++ AccessibleContext newValue);
++ private native void propertyActiveDescendentChange(PropertyChangeEvent e,
++ AccessibleContext src,
++ AccessibleContext oldValue,
++ AccessibleContext newValue);
++
++ private native void javaShutdown();
++
++ /**
++ * native methods for handling focus events
++ */
++ private native void focusGained(FocusEvent e, AccessibleContext src);
++ private native void focusLost(FocusEvent e, AccessibleContext src);
++
++ /**
++ * native method for handling caret events
++ */
++ private native void caretUpdate(CaretEvent e, AccessibleContext src);
++
++ /**
++ * native methods for handling mouse events
++ */
++ private native void mouseClicked(MouseEvent e, AccessibleContext src);
++ private native void mouseEntered(MouseEvent e, AccessibleContext src);
++ private native void mouseExited(MouseEvent e, AccessibleContext src);
++ private native void mousePressed(MouseEvent e, AccessibleContext src);
++ private native void mouseReleased(MouseEvent e, AccessibleContext src);
++
++ /**
++ * native methods for handling menu & popupMenu events
++ */
++ private native void menuCanceled(MenuEvent e, AccessibleContext src);
++ private native void menuDeselected(MenuEvent e, AccessibleContext src);
++ private native void menuSelected(MenuEvent e, AccessibleContext src);
++ private native void popupMenuCanceled(PopupMenuEvent e, AccessibleContext src);
++ private native void popupMenuWillBecomeInvisible(PopupMenuEvent e,
++ AccessibleContext src);
++ private native void popupMenuWillBecomeVisible(PopupMenuEvent e,
++ AccessibleContext src);
++
++ /* ===== event definitions ===== */
++
++ private static final long PROPERTY_CHANGE_EVENTS = 1;
++ private static final long FOCUS_GAINED_EVENTS = 2;
++ private static final long FOCUS_LOST_EVENTS = 4;
++ private static final long FOCUS_EVENTS = (FOCUS_GAINED_EVENTS | FOCUS_LOST_EVENTS);
++
++ private static final long CARET_UPATE_EVENTS = 8;
++ private static final long CARET_EVENTS = CARET_UPATE_EVENTS;
++
++ private static final long MOUSE_CLICKED_EVENTS = 16;
++ private static final long MOUSE_ENTERED_EVENTS = 32;
++ private static final long MOUSE_EXITED_EVENTS = 64;
++ private static final long MOUSE_PRESSED_EVENTS = 128;
++ private static final long MOUSE_RELEASED_EVENTS = 256;
++ private static final long MOUSE_EVENTS = (MOUSE_CLICKED_EVENTS | MOUSE_ENTERED_EVENTS |
++ MOUSE_EXITED_EVENTS | MOUSE_PRESSED_EVENTS |
++ MOUSE_RELEASED_EVENTS);
++
++ private static final long MENU_CANCELED_EVENTS = 512;
++ private static final long MENU_DESELECTED_EVENTS = 1024;
++ private static final long MENU_SELECTED_EVENTS = 2048;
++ private static final long MENU_EVENTS = (MENU_CANCELED_EVENTS | MENU_DESELECTED_EVENTS |
++ MENU_SELECTED_EVENTS);
++
++ private static final long POPUPMENU_CANCELED_EVENTS = 4096;
++ private static final long POPUPMENU_WILL_BECOME_INVISIBLE_EVENTS = 8192;
++ private static final long POPUPMENU_WILL_BECOME_VISIBLE_EVENTS = 16384;
++ private static final long POPUPMENU_EVENTS = (POPUPMENU_CANCELED_EVENTS |
++ POPUPMENU_WILL_BECOME_INVISIBLE_EVENTS |
++ POPUPMENU_WILL_BECOME_VISIBLE_EVENTS);
++
++ /* These use their own numbering scheme, to ensure sufficient expansion room */
++ private static final long PROPERTY_NAME_CHANGE_EVENTS = 1;
++ private static final long PROPERTY_DESCRIPTION_CHANGE_EVENTS = 2;
++ private static final long PROPERTY_STATE_CHANGE_EVENTS = 4;
++ private static final long PROPERTY_VALUE_CHANGE_EVENTS = 8;
++ private static final long PROPERTY_SELECTION_CHANGE_EVENTS = 16;
++ private static final long PROPERTY_TEXT_CHANGE_EVENTS = 32;
++ private static final long PROPERTY_CARET_CHANGE_EVENTS = 64;
++ private static final long PROPERTY_VISIBLEDATA_CHANGE_EVENTS = 128;
++ private static final long PROPERTY_CHILD_CHANGE_EVENTS = 256;
++ private static final long PROPERTY_ACTIVEDESCENDENT_CHANGE_EVENTS = 512;
++
++
++ private static final long PROPERTY_EVENTS = (PROPERTY_NAME_CHANGE_EVENTS |
++ PROPERTY_DESCRIPTION_CHANGE_EVENTS |
++ PROPERTY_STATE_CHANGE_EVENTS |
++ PROPERTY_VALUE_CHANGE_EVENTS |
++ PROPERTY_SELECTION_CHANGE_EVENTS |
++ PROPERTY_TEXT_CHANGE_EVENTS |
++ PROPERTY_CARET_CHANGE_EVENTS |
++ PROPERTY_VISIBLEDATA_CHANGE_EVENTS |
++ PROPERTY_CHILD_CHANGE_EVENTS |
++ PROPERTY_ACTIVEDESCENDENT_CHANGE_EVENTS);
++
++ /**
++ * The EventHandler class listens for Java events and
++ * forwards them to the AT
++ */
++ private class EventHandler implements PropertyChangeListener,
++ FocusListener, CaretListener,
++ MenuListener, PopupMenuListener,
++ MouseListener, WindowListener,
++ ChangeListener {
++
++ private AccessBridge accessBridge;
++ private long javaEventMask = 0;
++ private long accessibilityEventMask = 0;
++
++ EventHandler(AccessBridge bridge) {
++ accessBridge = bridge;
++
++ // Register to receive WINDOW_OPENED and WINDOW_CLOSED
++ // events. Add the event source as a native window
++ // handler is it implements NativeWindowHandler.
++ // SwingEventMonitor.addWindowListener(this);
++ }
++
++ // --------- Event Notification Registration methods
++
++ /**
++ * Invoked the first time a window is made visible.
++ */
++ public void windowOpened(WindowEvent e) {
++ // If the window is a NativeWindowHandler, add it.
++ Object o = null;
++ if (e != null)
++ o = e.getSource();
++ if (o instanceof NativeWindowHandler) {
++ addNativeWindowHandler((NativeWindowHandler)o);
++ }
++ }
++
++ /**
++ * Invoked when the user attempts to close the window
++ * from the window's system menu. If the program does not
++ * explicitly hide or dispose the window while processing
++ * this event, the window close operation will be canceled.
++ */
++ public void windowClosing(WindowEvent e) {}
++
++ /**
++ * Invoked when a window has been closed as the result
++ * of calling dispose on the window.
++ */
++ public void windowClosed(WindowEvent e) {
++ // If the window is a NativeWindowHandler, remove it.
++ Object o = null;
++ if (e != null)
++ o = e.getSource();
++ if (o instanceof NativeWindowHandler) {
++ removeNativeWindowHandler((NativeWindowHandler)o);
++ }
++ }
++
++ /**
++ * Invoked when a window is changed from a normal to a
++ * minimized state. For many platforms, a minimized window
++ * is displayed as the icon specified in the window's
++ * iconImage property.
++ * @see java.awt.Frame#setIconImage
++ */
++ public void windowIconified(WindowEvent e) {}
++
++ /**
++ * Invoked when a window is changed from a minimized
++ * to a normal state.
++ */
++ public void windowDeiconified(WindowEvent e) {}
++
++ /**
++ * Invoked when the Window is set to be the active Window. Only a Frame or
++ * a Dialog can be the active Window. The native windowing system may
++ * denote the active Window or its children with special decorations, such
++ * as a highlighted title bar. The active Window is always either the
++ * focused Window, or the first Frame or Dialog that is an owner of the
++ * focused Window.
++ */
++ public void windowActivated(WindowEvent e) {}
++
++ /**
++ * Invoked when a Window is no longer the active Window. Only a Frame or a
++ * Dialog can be the active Window. The native windowing system may denote
++ * the active Window or its children with special decorations, such as a
++ * highlighted title bar. The active Window is always either the focused
++ * Window, or the first Frame or Dialog that is an owner of the focused
++ * Window.
++ */
++ public void windowDeactivated(WindowEvent e) {}
++
++ /**
++ * Turn on event monitoring for the event type passed in
++ * If necessary, add the appropriate event listener (if
++ * no other event of that type is being listened for)
++ */
++ void addJavaEventNotification(long type) {
++ long newEventMask = javaEventMask | type;
++ /*
++ if ( ((javaEventMask & PROPERTY_EVENTS) == 0) &&
++ ((newEventMask & PROPERTY_EVENTS) != 0) ) {
++ AccessibilityEventMonitor.addPropertyChangeListener(this);
++ }
++ */
++ if ( ((javaEventMask & FOCUS_EVENTS) == 0) &&
++ ((newEventMask & FOCUS_EVENTS) != 0) ) {
++ SwingEventMonitor.addFocusListener(this);
++ }
++ if ( ((javaEventMask & CARET_EVENTS) == 0) &&
++ ((newEventMask & CARET_EVENTS) != 0) ) {
++ SwingEventMonitor.addCaretListener(this);
++ }
++ if ( ((javaEventMask & MOUSE_EVENTS) == 0) &&
++ ((newEventMask & MOUSE_EVENTS) != 0) ) {
++ SwingEventMonitor.addMouseListener(this);
++ }
++ if ( ((javaEventMask & MENU_EVENTS) == 0) &&
++ ((newEventMask & MENU_EVENTS) != 0) ) {
++ SwingEventMonitor.addMenuListener(this);
++ SwingEventMonitor.addPopupMenuListener(this);
++ }
++ if ( ((javaEventMask & POPUPMENU_EVENTS) == 0) &&
++ ((newEventMask & POPUPMENU_EVENTS) != 0) ) {
++ SwingEventMonitor.addPopupMenuListener(this);
++ }
++
++ javaEventMask = newEventMask;
++ }
++
++ /**
++ * Turn off event monitoring for the event type passed in
++ * If necessary, remove the appropriate event listener (if
++ * no other event of that type is being listened for)
++ */
++ void removeJavaEventNotification(long type) {
++ long newEventMask = javaEventMask & (~type);
++ /*
++ if ( ((javaEventMask & PROPERTY_EVENTS) != 0) &&
++ ((newEventMask & PROPERTY_EVENTS) == 0) ) {
++ AccessibilityEventMonitor.removePropertyChangeListener(this);
++ }
++ */
++ if (((javaEventMask & FOCUS_EVENTS) != 0) &&
++ ((newEventMask & FOCUS_EVENTS) == 0)) {
++ SwingEventMonitor.removeFocusListener(this);
++ }
++ if (((javaEventMask & CARET_EVENTS) != 0) &&
++ ((newEventMask & CARET_EVENTS) == 0)) {
++ SwingEventMonitor.removeCaretListener(this);
++ }
++ if (((javaEventMask & MOUSE_EVENTS) == 0) &&
++ ((newEventMask & MOUSE_EVENTS) != 0)) {
++ SwingEventMonitor.removeMouseListener(this);
++ }
++ if (((javaEventMask & MENU_EVENTS) == 0) &&
++ ((newEventMask & MENU_EVENTS) != 0)) {
++ SwingEventMonitor.removeMenuListener(this);
++ }
++ if (((javaEventMask & POPUPMENU_EVENTS) == 0) &&
++ ((newEventMask & POPUPMENU_EVENTS) != 0)) {
++ SwingEventMonitor.removePopupMenuListener(this);
++ }
++
++ javaEventMask = newEventMask;
++ }
++
++ /**
++ * Turn on event monitoring for the event type passed in
++ * If necessary, add the appropriate event listener (if
++ * no other event of that type is being listened for)
++ */
++ void addAccessibilityEventNotification(long type) {
++ long newEventMask = accessibilityEventMask | type;
++ if ( ((accessibilityEventMask & PROPERTY_EVENTS) == 0) &&
++ ((newEventMask & PROPERTY_EVENTS) != 0) ) {
++ AccessibilityEventMonitor.addPropertyChangeListener(this);
++ }
++ accessibilityEventMask = newEventMask;
++ }
++
++ /**
++ * Turn off event monitoring for the event type passed in
++ * If necessary, remove the appropriate event listener (if
++ * no other event of that type is being listened for)
++ */
++ void removeAccessibilityEventNotification(long type) {
++ long newEventMask = accessibilityEventMask & (~type);
++ if ( ((accessibilityEventMask & PROPERTY_EVENTS) != 0) &&
++ ((newEventMask & PROPERTY_EVENTS) == 0) ) {
++ AccessibilityEventMonitor.removePropertyChangeListener(this);
++ }
++ accessibilityEventMask = newEventMask;
++ }
++
++ /**
++ * ------- property change event glue
++ */
++ // This is invoked on the EDT , as
++ public void propertyChange(PropertyChangeEvent e) {
++
++ accessBridge.debugString("propertyChange(" + e.toString() + ") called");
++
++ if (e != null && (accessibilityEventMask & PROPERTY_EVENTS) != 0) {
++ Object o = e.getSource();
++ AccessibleContext ac;
++
++ if (o instanceof AccessibleContext) {
++ ac = (AccessibleContext) o;
++ } else {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a == null)
++ return;
++ else
++ ac = a.getAccessibleContext();
++ }
++ if (ac != null) {
++ InvocationUtils.registerAccessibleContext(ac, AppContext.getAppContext());
++
++ accessBridge.debugString("AccessibleContext: " + ac);
++ String propertyName = e.getPropertyName();
++
++ if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_CARET_PROPERTY) == 0) {
++ int oldValue = 0;
++ int newValue = 0;
++
++ if (e.getOldValue() instanceof Integer) {
++ oldValue = ((Integer) e.getOldValue()).intValue();
++ }
++ if (e.getNewValue() instanceof Integer) {
++ newValue = ((Integer) e.getNewValue()).intValue();
++ }
++ accessBridge.debugString(" - about to call propertyCaretChange()");
++ accessBridge.debugString(" old value: " + oldValue + "new value: " + newValue);
++ accessBridge.propertyCaretChange(e, ac, oldValue, newValue);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY) == 0) {
++ String oldValue = null;
++ String newValue = null;
++
++ if (e.getOldValue() != null) {
++ oldValue = e.getOldValue().toString();
++ }
++ if (e.getNewValue() != null) {
++ newValue = e.getNewValue().toString();
++ }
++ accessBridge.debugString(" - about to call propertyDescriptionChange()");
++ accessBridge.debugString(" old value: " + oldValue + "new value: " + newValue);
++ accessBridge.propertyDescriptionChange(e, ac, oldValue, newValue);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_NAME_PROPERTY) == 0) {
++ String oldValue = null;
++ String newValue = null;
++
++ if (e.getOldValue() != null) {
++ oldValue = e.getOldValue().toString();
++ }
++ if (e.getNewValue() != null) {
++ newValue = e.getNewValue().toString();
++ }
++ accessBridge.debugString(" - about to call propertyNameChange()");
++ accessBridge.debugString(" old value: " + oldValue + " new value: " + newValue);
++ accessBridge.propertyNameChange(e, ac, oldValue, newValue);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY) == 0) {
++ accessBridge.debugString(" - about to call propertySelectionChange() " + ac + " " + Thread.currentThread() + " " + e.getSource());
++
++ accessBridge.propertySelectionChange(e, ac);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_STATE_PROPERTY) == 0) {
++ String oldValue = null;
++ String newValue = null;
++
++ // Localization fix requested by Oliver for EA-1
++ if (e.getOldValue() != null) {
++ AccessibleState oldState = (AccessibleState) e.getOldValue();
++ oldValue = oldState.toDisplayString(Locale.US);
++ }
++ if (e.getNewValue() != null) {
++ AccessibleState newState = (AccessibleState) e.getNewValue();
++ newValue = newState.toDisplayString(Locale.US);
++ }
++
++ accessBridge.debugString(" - about to call propertyStateChange()");
++ accessBridge.propertyStateChange(e, ac, oldValue, newValue);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_TEXT_PROPERTY) == 0) {
++ accessBridge.debugString(" - about to call propertyTextChange()");
++ accessBridge.propertyTextChange(e, ac);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_VALUE_PROPERTY) == 0) { // strings 'cause of floating point, etc.
++ String oldValue = null;
++ String newValue = null;
++
++ if (e.getOldValue() != null) {
++ oldValue = e.getOldValue().toString();
++ }
++ if (e.getNewValue() != null) {
++ newValue = e.getNewValue().toString();
++ }
++ accessBridge.debugString(" - about to call propertyDescriptionChange()");
++ accessBridge.propertyValueChange(e, ac, oldValue, newValue);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY) == 0) {
++ accessBridge.propertyVisibleDataChange(e, ac);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_CHILD_PROPERTY) == 0) {
++ AccessibleContext oldAC = null;
++ AccessibleContext newAC = null;
++ Accessible a;
++
++ if (e.getOldValue() instanceof AccessibleContext) {
++ oldAC = (AccessibleContext) e.getOldValue();
++ InvocationUtils.registerAccessibleContext(oldAC, AppContext.getAppContext());
++ }
++ if (e.getNewValue() instanceof AccessibleContext) {
++ newAC = (AccessibleContext) e.getNewValue();
++ InvocationUtils.registerAccessibleContext(newAC, AppContext.getAppContext());
++ }
++ accessBridge.debugString(" - about to call propertyChildChange()");
++ accessBridge.debugString(" old AC: " + oldAC + "new AC: " + newAC);
++ accessBridge.propertyChildChange(e, ac, oldAC, newAC);
++
++ } else if (propertyName.compareTo(AccessibleContext.ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY) == 0) {
++ handleActiveDescendentEvent(e, ac);
++ }
++ }
++ }
++ }
++
++ /*
++ * Handle an ActiveDescendent PropertyChangeEvent. This
++ * method works around a JTree bug where ActiveDescendent
++ * PropertyChangeEvents have the wrong parent.
++ */
++ private AccessibleContext prevAC = null; // previous AccessibleContext
++
++ private void handleActiveDescendentEvent(PropertyChangeEvent e,
++ AccessibleContext ac) {
++ if (e == null || ac == null)
++ return;
++ AccessibleContext oldAC = null;
++ AccessibleContext newAC = null;
++ Accessible a;
++
++ // get the old active descendent
++ if (e.getOldValue() instanceof Accessible) {
++ oldAC = ((Accessible) e.getOldValue()).getAccessibleContext();
++ } else if (e.getOldValue() instanceof Component) {
++ a = Translator.getAccessible(e.getOldValue());
++ if (a != null) {
++ oldAC = a.getAccessibleContext();
++ }
++ }
++ if (oldAC != null) {
++ Accessible parent = oldAC.getAccessibleParent();
++ if (parent instanceof JTree) {
++ // use the previous AccessibleJTreeNode
++ oldAC = prevAC;
++ }
++ }
++
++ // get the new active descendent
++ if (e.getNewValue() instanceof Accessible) {
++ newAC = ((Accessible) e.getNewValue()).getAccessibleContext();
++ } else if (e.getNewValue() instanceof Component) {
++ a = Translator.getAccessible(e.getNewValue());
++ if (a != null) {
++ newAC = a.getAccessibleContext();
++ }
++ }
++ if (newAC != null) {
++ Accessible parent = newAC.getAccessibleParent();
++ if (parent instanceof JTree) {
++ // use a new AccessibleJTreeNode with the right parent
++ JTree tree = (JTree)parent;
++ newAC = new AccessibleJTreeNode(tree,
++ tree.getSelectionPath(),
++ null);
++ }
++ }
++ prevAC = newAC;
++
++ accessBridge.debugString(" - about to call propertyActiveDescendentChange()");
++ accessBridge.debugString(" AC: " + ac);
++ accessBridge.debugString(" old AC: " + oldAC + "new AC: " + newAC);
++
++ InvocationUtils.registerAccessibleContext(oldAC, AppContext.getAppContext());
++ InvocationUtils.registerAccessibleContext(newAC, AppContext.getAppContext());
++ accessBridge.propertyActiveDescendentChange(e, ac, oldAC, newAC);
++ }
++
++ /**
++ * ------- focus event glue
++ */
++ private boolean stateChangeListenerAdded = false;
++
++ public void focusGained(FocusEvent e) {
++ if (runningOnJDK1_4) {
++ processFocusGained();
++ } else {
++ if ((javaEventMask & FOCUS_GAINED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, SunToolkit.targetToAppContext(e.getSource()));
++ accessBridge.focusGained(e, context);
++ }
++ }
++ }
++ }
++
++ public void stateChanged(ChangeEvent e) {
++ processFocusGained();
++ }
++
++ private void processFocusGained() {
++ Component focusOwner = KeyboardFocusManager.
++ getCurrentKeyboardFocusManager().getFocusOwner();
++ if (focusOwner == null) {
++ return;
++ }
++
++ // Only menus and popup selections are handled by the JRootPane.
++ if (focusOwner instanceof JRootPane) {
++ MenuElement [] path =
++ MenuSelectionManager.defaultManager().getSelectedPath();
++ if (path.length > 1) {
++ Component penult = path[path.length-2].getComponent();
++ Component last = path[path.length-1].getComponent();
++
++ if (last instanceof JPopupMenu) {
++ // This is a popup with nothing in the popup
++ // selected. The menu itself is selected.
++ FocusEvent e = new FocusEvent(penult, FocusEvent.FOCUS_GAINED);
++ AccessibleContext context = penult.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, SunToolkit.targetToAppContext(penult));
++ accessBridge.focusGained(e, context);
++ } else if (penult instanceof JPopupMenu) {
++ // This is a popup with an item selected
++ FocusEvent e =
++ new FocusEvent(last, FocusEvent.FOCUS_GAINED);
++ accessBridge.debugString(" - about to call focusGained()");
++ AccessibleContext focusedAC = last.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(focusedAC, SunToolkit.targetToAppContext(last));
++ accessBridge.debugString(" AC: " + focusedAC);
++ accessBridge.focusGained(e, focusedAC);
++ }
++ }
++ } else {
++ // The focus owner has the selection.
++ if (focusOwner instanceof Accessible) {
++ FocusEvent e = new FocusEvent(focusOwner,
++ FocusEvent.FOCUS_GAINED);
++ accessBridge.debugString(" - about to call focusGained()");
++ AccessibleContext focusedAC = focusOwner.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(focusedAC, SunToolkit.targetToAppContext(focusOwner));
++ accessBridge.debugString(" AC: " + focusedAC);
++ accessBridge.focusGained(e, focusedAC);
++ }
++ }
++ }
++
++ public void focusLost(FocusEvent e) {
++ if (e != null && (javaEventMask & FOCUS_LOST_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ accessBridge.debugString(" - about to call focusLost()");
++ accessBridge.debugString(" AC: " + a.getAccessibleContext());
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.focusLost(e, context);
++ }
++ }
++ }
++
++ /**
++ * ------- caret event glue
++ */
++ public void caretUpdate(CaretEvent e) {
++ if (e != null && (javaEventMask & CARET_UPATE_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.caretUpdate(e, context);
++ }
++ }
++ }
++
++ /**
++ * ------- mouse event glue
++ */
++
++ public void mouseClicked(MouseEvent e) {
++ if (e != null && (javaEventMask & MOUSE_CLICKED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.mouseClicked(e, context);
++ }
++ }
++ }
++
++ public void mouseEntered(MouseEvent e) {
++ if (e != null && (javaEventMask & MOUSE_ENTERED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.mouseEntered(e, context);
++ }
++ }
++ }
++
++ public void mouseExited(MouseEvent e) {
++ if (e != null && (javaEventMask & MOUSE_EXITED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.mouseExited(e, context);
++ }
++ }
++ }
++
++ public void mousePressed(MouseEvent e) {
++ if (e != null && (javaEventMask & MOUSE_PRESSED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.mousePressed(e, context);
++ }
++ }
++ }
++
++ public void mouseReleased(MouseEvent e) {
++ if (e != null && (javaEventMask & MOUSE_RELEASED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.mouseReleased(e, context);
++ }
++ }
++ }
++
++ /**
++ * ------- menu event glue
++ */
++ public void menuCanceled(MenuEvent e) {
++ if (e != null && (javaEventMask & MENU_CANCELED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.menuCanceled(e, context);
++ }
++ }
++ }
++
++ public void menuDeselected(MenuEvent e) {
++ if (e != null && (javaEventMask & MENU_DESELECTED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.menuDeselected(e, context);
++ }
++ }
++ }
++
++ public void menuSelected(MenuEvent e) {
++ if (e != null && (javaEventMask & MENU_SELECTED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.menuSelected(e, context);
++ }
++ }
++ }
++
++ public void popupMenuCanceled(PopupMenuEvent e) {
++ if (e != null && (javaEventMask & POPUPMENU_CANCELED_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.popupMenuCanceled(e, context);
++ }
++ }
++ }
++
++ public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
++ if (e != null && (javaEventMask & POPUPMENU_WILL_BECOME_INVISIBLE_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.popupMenuWillBecomeInvisible(e, context);
++ }
++ }
++ }
++
++ public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
++ if (e != null && (javaEventMask & POPUPMENU_WILL_BECOME_VISIBLE_EVENTS) != 0) {
++ Accessible a = Translator.getAccessible(e.getSource());
++ if (a != null) {
++ AccessibleContext context = a.getAccessibleContext();
++ InvocationUtils.registerAccessibleContext(context, AppContext.getAppContext());
++ accessBridge.popupMenuWillBecomeVisible(e, context);
++ }
++ }
++ }
++
++ } // End of EventHandler Class
++
++ // --------- Event Notification Registration methods
++
++ /**
++ * Wrapper method around eventHandler.addJavaEventNotification()
++ */
++ private void addJavaEventNotification(final long type) {
++ EventQueue.invokeLater(new Runnable() {
++ public void run(){
++ eventHandler.addJavaEventNotification(type);
++ }
++ });
++ }
++
++ /**
++ * Wrapper method around eventHandler.removeJavaEventNotification()
++ */
++ private void removeJavaEventNotification(final long type) {
++ EventQueue.invokeLater(new Runnable() {
++ public void run(){
++ eventHandler.removeJavaEventNotification(type);
++ }
++ });
++ }
++
++
++ /**
++ * Wrapper method around eventHandler.addAccessibilityEventNotification()
++ */
++ private void addAccessibilityEventNotification(final long type) {
++ EventQueue.invokeLater(new Runnable() {
++ public void run(){
++ eventHandler.addAccessibilityEventNotification(type);
++ }
++ });
++ }
++
++ /**
++ * Wrapper method around eventHandler.removeAccessibilityEventNotification()
++ */
++ private void removeAccessibilityEventNotification(final long type) {
++ EventQueue.invokeLater(new Runnable() {
++ public void run(){
++ eventHandler.removeAccessibilityEventNotification(type);
++ }
++ });
++ }
++
++ /**
++ ******************************************************
++ * All AccessibleRoles
++ *
++ * We shouldn't have to do this since it requires us
++ * to synchronize the allAccessibleRoles array when
++ * the AccessibleRoles class interface changes. However,
++ * there is no Accessibility API method to get all
++ * AccessibleRoles
++ ******************************************************
++ */
++ private AccessibleRole [] allAccessibleRoles = {
++ /**
++ * Object is used to alert the user about something.
++ */
++ AccessibleRole.ALERT,
++
++ /**
++ * The header for a column of data.
++ */
++ AccessibleRole.COLUMN_HEADER,
++
++ /**
++ * Object that can be drawn into and is used to trap
++ * events.
++ * @see #FRAME
++ * @see #GLASS_PANE
++ * @see #LAYERED_PANE
++ */
++ AccessibleRole.CANVAS,
++
++ /**
++ * A list of choices the user can select from. Also optionally
++ * allows the user to enter a choice of their own.
++ */
++ AccessibleRole.COMBO_BOX,
++
++ /**
++ * An iconified internal frame in a DESKTOP_PANE.
++ * @see #DESKTOP_PANE
++ * @see #INTERNAL_FRAME
++ */
++ AccessibleRole.DESKTOP_ICON,
++
++ /**
++ * A frame-like object that is clipped by a desktop pane. The
++ * desktop pane, internal frame, and desktop icon objects are
++ * often used to create multiple document interfaces within an
++ * application.
++ * @see #DESKTOP_ICON
++ * @see #DESKTOP_PANE
++ * @see #FRAME
++ */
++ AccessibleRole.INTERNAL_FRAME,
++
++ /**
++ * A pane that supports internal frames and
++ * iconified versions of those internal frames.
++ * @see #DESKTOP_ICON
++ * @see #INTERNAL_FRAME
++ */
++ AccessibleRole.DESKTOP_PANE,
++
++ /**
++ * A specialized pane whose primary use is inside a DIALOG
++ * @see #DIALOG
++ */
++ AccessibleRole.OPTION_PANE,
++
++ /**
++ * A top level window with no title or border.
++ * @see #FRAME
++ * @see #DIALOG
++ */
++ AccessibleRole.WINDOW,
++
++ /**
++ * A top level window with a title bar, border, menu bar, etc. It is
++ * often used as the primary window for an application.
++ * @see #DIALOG
++ * @see #CANVAS
++ * @see #WINDOW
++ */
++ AccessibleRole.FRAME,
++
++ /**
++ * A top level window with title bar and a border. A dialog is similar
++ * to a frame, but it has fewer properties and is often used as a
++ * secondary window for an application.
++ * @see #FRAME
++ * @see #WINDOW
++ */
++ AccessibleRole.DIALOG,
++
++ /**
++ * A specialized dialog that lets the user choose a color.
++ */
++ AccessibleRole.COLOR_CHOOSER,
++
++
++ /**
++ * A pane that allows the user to navigate through
++ * and select the contents of a directory. May be used
++ * by a file chooser.
++ * @see #FILE_CHOOSER
++ */
++ AccessibleRole.DIRECTORY_PANE,
++
++ /**
++ * A specialized dialog that displays the files in the directory
++ * and lets the user select a file, browse a different directory,
++ * or specify a filename. May use the directory pane to show the
++ * contents of a directory.
++ * @see #DIRECTORY_PANE
++ */
++ AccessibleRole.FILE_CHOOSER,
++
++ /**
++ * An object that fills up space in a user interface. It is often
++ * used in interfaces to tweak the spacing between components,
++ * but serves no other purpose.
++ */
++ AccessibleRole.FILLER,
++
++ /**
++ * A hypertext anchor
++ */
++ // AccessibleRole.HYPERLINK,
++
++ /**
++ * A small fixed size picture, typically used to decorate components.
++ */
++ AccessibleRole.ICON,
++
++ /**
++ * An object used to present an icon or short string in an interface.
++ */
++ AccessibleRole.LABEL,
++
++ /**
++ * A specialized pane that has a glass pane and a layered pane as its
++ * children.
++ * @see #GLASS_PANE
++ * @see #LAYERED_PANE
++ */
++ AccessibleRole.ROOT_PANE,
++
++ /**
++ * A pane that is guaranteed to be painted on top
++ * of all panes beneath it.
++ * @see #ROOT_PANE
++ * @see #CANVAS
++ */
++ AccessibleRole.GLASS_PANE,
++
++ /**
++ * A specialized pane that allows its children to be drawn in layers,
++ * providing a form of stacking order. This is usually the pane that
++ * holds the menu bar as well as the pane that contains most of the
++ * visual components in a window.
++ * @see #GLASS_PANE
++ * @see #ROOT_PANE
++ */
++ AccessibleRole.LAYERED_PANE,
++
++ /**
++ * An object that presents a list of objects to the user and allows the
++ * user to select one or more of them. A list is usually contained
++ * within a scroll pane.
++ * @see #SCROLL_PANE
++ * @see #LIST_ITEM
++ */
++ AccessibleRole.LIST,
++
++ /**
++ * An object that presents an element in a list. A list is usually
++ * contained within a scroll pane.
++ * @see #SCROLL_PANE
++ * @see #LIST
++ */
++ AccessibleRole.LIST_ITEM,
++
++ /**
++ * An object usually drawn at the top of the primary dialog box of
++ * an application that contains a list of menus the user can choose
++ * from. For example, a menu bar might contain menus for "File,"
++ * "Edit," and "Help."
++ * @see #MENU
++ * @see #POPUP_MENU
++ * @see #LAYERED_PANE
++ */
++ AccessibleRole.MENU_BAR,
++
++ /**
++ * A temporary window that is usually used to offer the user a
++ * list of choices, and then hides when the user selects one of
++ * those choices.
++ * @see #MENU
++ * @see #MENU_ITEM
++ */
++ AccessibleRole.POPUP_MENU,
++
++ /**
++ * An object usually found inside a menu bar that contains a list
++ * of actions the user can choose from. A menu can have any object
++ * as its children, but most often they are menu items, other menus,
++ * or rudimentary objects such as radio buttons, check boxes, or
++ * separators. For example, an application may have an "Edit" menu
++ * that contains menu items for "Cut" and "Paste."
++ * @see #MENU_BAR
++ * @see #MENU_ITEM
++ * @see #SEPARATOR
++ * @see #RADIO_BUTTON
++ * @see #CHECK_BOX
++ * @see #POPUP_MENU
++ */
++ AccessibleRole.MENU,
++
++ /**
++ * An object usually contained in a menu that presents an action
++ * the user can choose. For example, the "Cut" menu item in an
++ * "Edit" menu would be an action the user can select to cut the
++ * selected area of text in a document.
++ * @see #MENU_BAR
++ * @see #SEPARATOR
++ * @see #POPUP_MENU
++ */
++ AccessibleRole.MENU_ITEM,
++
++ /**
++ * An object usually contained in a menu to provide a visual
++ * and logical separation of the contents in a menu. For example,
++ * the "File" menu of an application might contain menu items for
++ * "Open," "Close," and "Exit," and will place a separator between
++ * "Close" and "Exit" menu items.
++ * @see #MENU
++ * @see #MENU_ITEM
++ */
++ AccessibleRole.SEPARATOR,
++
++ /**
++ * An object that presents a series of panels (or page tabs), one at a
++ * time, through some mechanism provided by the object. The most common
++ * mechanism is a list of tabs at the top of the panel. The children of
++ * a page tab list are all page tabs.
++ * @see #PAGE_TAB
++ */
++ AccessibleRole.PAGE_TAB_LIST,
++
++ /**
++ * An object that is a child of a page tab list. Its sole child is
++ * the panel that is to be presented to the user when the user
++ * selects the page tab from the list of tabs in the page tab list.
++ * @see #PAGE_TAB_LIST
++ */
++ AccessibleRole.PAGE_TAB,
++
++ /**
++ * A generic container that is often used to group objects.
++ */
++ AccessibleRole.PANEL,
++
++ /**
++ * An object used to indicate how much of a task has been completed.
++ */
++ AccessibleRole.PROGRESS_BAR,
++
++ /**
++ * A text object used for passwords, or other places where the
++ * text contents is not shown visibly to the user
++ */
++ AccessibleRole.PASSWORD_TEXT,
++
++ /**
++ * An object the user can manipulate to tell the application to do
++ * something.
++ * @see #CHECK_BOX
++ * @see #TOGGLE_BUTTON
++ * @see #RADIO_BUTTON
++ */
++ AccessibleRole.PUSH_BUTTON,
++
++ /**
++ * A specialized push button that can be checked or unchecked, but
++ * does not provide a separate indicator for the current state.
++ * @see #PUSH_BUTTON
++ * @see #CHECK_BOX
++ * @see #RADIO_BUTTON
++ */
++ AccessibleRole.TOGGLE_BUTTON,
++
++ /**
++ * A choice that can be checked or unchecked and provides a
++ * separate indicator for the current state.
++ * @see #PUSH_BUTTON
++ * @see #TOGGLE_BUTTON
++ * @see #RADIO_BUTTON
++ */
++ AccessibleRole.CHECK_BOX,
++
++ /**
++ * A specialized check box that will cause other radio buttons in the
++ * same group to become unchecked when this one is checked.
++ * @see #PUSH_BUTTON
++ * @see #TOGGLE_BUTTON
++ * @see #CHECK_BOX
++ */
++ AccessibleRole.RADIO_BUTTON,
++
++ /**
++ * The header for a row of data.
++ */
++ AccessibleRole.ROW_HEADER,
++
++ /**
++ * An object that allows a user to incrementally view a large amount
++ * of information. Its children can include scroll bars and a viewport.
++ * @see #SCROLL_BAR
++ * @see #VIEWPORT
++ */
++ AccessibleRole.SCROLL_PANE,
++
++ /**
++ * An object usually used to allow a user to incrementally view a
++ * large amount of data. Usually used only by a scroll pane.
++ * @see #SCROLL_PANE
++ */
++ AccessibleRole.SCROLL_BAR,
++
++ /**
++ * An object usually used in a scroll pane. It represents the portion
++ * of the entire data that the user can see. As the user manipulates
++ * the scroll bars, the contents of the viewport can change.
++ * @see #SCROLL_PANE
++ */
++ AccessibleRole.VIEWPORT,
++
++ /**
++ * An object that allows the user to select from a bounded range. For
++ * example, a slider might be used to select a number between 0 and 100.
++ */
++ AccessibleRole.SLIDER,
++
++ /**
++ * A specialized panel that presents two other panels at the same time.
++ * Between the two panels is a divider the user can manipulate to make
++ * one panel larger and the other panel smaller.
++ */
++ AccessibleRole.SPLIT_PANE,
++
++ /**
++ * An object used to present information in terms of rows and columns.
++ * An example might include a spreadsheet application.
++ */
++ AccessibleRole.TABLE,
++
++ /**
++ * An object that presents text to the user. The text is usually
++ * editable by the user as opposed to a label.
++ * @see #LABEL
++ */
++ AccessibleRole.TEXT,
++
++ /**
++ * An object used to present hierarchical information to the user.
++ * The individual nodes in the tree can be collapsed and expanded
++ * to provide selective disclosure of the tree's contents.
++ */
++ AccessibleRole.TREE,
++
++ /**
++ * A bar or palette usually composed of push buttons or toggle buttons.
++ * It is often used to provide the most frequently used functions for an
++ * application.
++ */
++ AccessibleRole.TOOL_BAR,
++
++ /**
++ * An object that provides information about another object. The
++ * accessibleDescription property of the tool tip is often displayed
++ * to the user in a small "help bubble" when the user causes the
++ * mouse to hover over the object associated with the tool tip.
++ */
++ AccessibleRole.TOOL_TIP,
++
++ /**
++ * An AWT component, but nothing else is known about it.
++ * @see #SWING_COMPONENT
++ * @see #UNKNOWN
++ */
++ AccessibleRole.AWT_COMPONENT,
++
++ /**
++ * A Swing component, but nothing else is known about it.
++ * @see #AWT_COMPONENT
++ * @see #UNKNOWN
++ */
++ AccessibleRole.SWING_COMPONENT,
++
++ /**
++ * The object contains some Accessible information, but its role is
++ * not known.
++ * @see #AWT_COMPONENT
++ * @see #SWING_COMPONENT
++ */
++ AccessibleRole.UNKNOWN,
++
++ // These roles are only available in JDK 1.4
++
++ /**
++ * A STATUS_BAR is an simple component that can contain
++ * multiple labels of status information to the user.
++ AccessibleRole.STATUS_BAR,
++
++ /**
++ * A DATE_EDITOR is a component that allows users to edit
++ * java.util.Date and java.util.Time objects
++ AccessibleRole.DATE_EDITOR,
++
++ /**
++ * A SPIN_BOX is a simple spinner component and its main use
++ * is for simple numbers.
++ AccessibleRole.SPIN_BOX,
++
++ /**
++ * A FONT_CHOOSER is a component that lets the user pick various
++ * attributes for fonts.
++ AccessibleRole.FONT_CHOOSER,
++
++ /**
++ * A GROUP_BOX is a simple container that contains a border
++ * around it and contains components inside it.
++ AccessibleRole.GROUP_BOX
++
++ /**
++ * Since JDK 1.5
++ *
++ * A text header
++
++ AccessibleRole.HEADER,
++
++ /**
++ * A text footer
++
++ AccessibleRole.FOOTER,
++
++ /**
++ * A text paragraph
++
++ AccessibleRole.PARAGRAPH,
++
++ /**
++ * A ruler is an object used to measure distance
++
++ AccessibleRole.RULER,
++
++ /**
++ * A role indicating the object acts as a formula for
++ * calculating a value. An example is a formula in
++ * a spreadsheet cell.
++ AccessibleRole.EDITBAR
++ */
++ };
++
++ /**
++ * This class implements accessibility support for the
++ * <code>JTree</code> child. It provides an implementation of the
++ * Java Accessibility API appropriate to tree nodes.
++ *
++ * Copied from JTree.java to work around a JTree bug where
++ * ActiveDescendent PropertyChangeEvents contain the wrong
++ * parent.
++ */
++ /**
++ * This class in invoked on the EDT as its part of ActiveDescendant,
++ * hence the calls do not need to be specifically made on the EDT
++ */
++ private class AccessibleJTreeNode extends AccessibleContext
++ implements Accessible, AccessibleComponent, AccessibleSelection,
++ AccessibleAction {
++
++ private JTree tree = null;
++ private TreeModel treeModel = null;
++ private Object obj = null;
++ private TreePath path = null;
++ private Accessible accessibleParent = null;
++ private int index = 0;
++ private boolean isLeaf = false;
++
++ /**
++ * Constructs an AccessibleJTreeNode
++ */
++ AccessibleJTreeNode(JTree t, TreePath p, Accessible ap) {
++ tree = t;
++ path = p;
++ accessibleParent = ap;
++ if (t != null)
++ treeModel = t.getModel();
++ if (p != null) {
++ obj = p.getLastPathComponent();
++ if (treeModel != null && obj != null) {
++ isLeaf = treeModel.isLeaf(obj);
++ }
++ }
++ debugString("AccessibleJTreeNode: name = "+getAccessibleName()+"; TreePath = "+p+"; parent = "+ap);
++ }
++
++ private TreePath getChildTreePath(int i) {
++ // Tree nodes can't be so complex that they have
++ // two sets of children -> we're ignoring that case
++ if (i < 0 || i >= getAccessibleChildrenCount() || path == null || treeModel == null) {
++ return null;
++ } else {
++ Object childObj = treeModel.getChild(obj, i);
++ Object[] objPath = path.getPath();
++ Object[] objChildPath = new Object[objPath.length+1];
++ java.lang.System.arraycopy(objPath, 0, objChildPath, 0, objPath.length);
++ objChildPath[objChildPath.length-1] = childObj;
++ return new TreePath(objChildPath);
++ }
++ }
++
++ /**
++ * Get the AccessibleContext associated with this tree node.
++ * In the implementation of the Java Accessibility API for
++ * this class, return this object, which is its own
++ * AccessibleContext.
++ *
++ * @return this object
++ */
++ public AccessibleContext getAccessibleContext() {
++ return this;
++ }
++
++ private AccessibleContext getCurrentAccessibleContext() {
++ Component c = getCurrentComponent();
++ if (c instanceof Accessible) {
++ return (c.getAccessibleContext());
++ } else {
++ return null;
++ }
++ }
++
++ private Component getCurrentComponent() {
++ debugString("AccessibleJTreeNode: getCurrentComponent");
++ // is the object visible?
++ // if so, get row, selected, focus & leaf state,
++ // and then get the renderer component and return it
++ if (tree != null && tree.isVisible(path)) {
++ TreeCellRenderer r = tree.getCellRenderer();
++ if (r == null) {
++ debugString(" returning null 1");
++ return null;
++ }
++ TreeUI ui = tree.getUI();
++ if (ui != null) {
++ int row = ui.getRowForPath(tree, path);
++ boolean selected = tree.isPathSelected(path);
++ boolean expanded = tree.isExpanded(path);
++ boolean hasFocus = false; // how to tell?? -PK
++ Component retval = r.getTreeCellRendererComponent(tree, obj,
++ selected, expanded,
++ isLeaf, row, hasFocus);
++ debugString(" returning = "+retval.getClass());
++ return retval;
++ }
++ }
++ debugString(" returning null 2");
++ return null;
++ }
++
++ // AccessibleContext methods
++
++ /**
++ * Get the accessible name of this object.
++ *
++ * @return the localized name of the object; null if this
++ * object does not have a name
++ */
++ public String getAccessibleName() {
++ debugString("AccessibleJTreeNode: getAccessibleName");
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ String name = ac.getAccessibleName();
++ if ((name != null) && (!name.isEmpty())) {
++ String retval = ac.getAccessibleName();
++ debugString(" returning "+retval);
++ return retval;
++ } else {
++ return null;
++ }
++ }
++ if ((accessibleName != null) && (accessibleName.isEmpty())) {
++ return accessibleName;
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Set the localized accessible name of this object.
++ *
++ * @param s the new localized name of the object.
++ */
++ public void setAccessibleName(String s) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ ac.setAccessibleName(s);
++ } else {
++ super.setAccessibleName(s);
++ }
++ }
++
++ //
++ // *** should check tooltip text for desc. (needs MouseEvent)
++ //
++ /**
++ * Get the accessible description of this object.
++ *
++ * @return the localized description of the object; null if
++ * this object does not have a description
++ */
++ public String getAccessibleDescription() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ return ac.getAccessibleDescription();
++ } else {
++ return super.getAccessibleDescription();
++ }
++ }
++
++ /**
++ * Set the accessible description of this object.
++ *
++ * @param s the new localized description of the object
++ */
++ public void setAccessibleDescription(String s) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ ac.setAccessibleDescription(s);
++ } else {
++ super.setAccessibleDescription(s);
++ }
++ }
++
++ /**
++ * Get the role of this object.
++ *
++ * @return an instance of AccessibleRole describing the role of the object
++ * @see AccessibleRole
++ */
++ public AccessibleRole getAccessibleRole() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ return ac.getAccessibleRole();
++ } else {
++ return AccessibleRole.UNKNOWN;
++ }
++ }
++
++ /**
++ * Get the state set of this object.
++ *
++ * @return an instance of AccessibleStateSet containing the
++ * current state set of the object
++ * @see AccessibleState
++ */
++ public AccessibleStateSet getAccessibleStateSet() {
++ if (tree == null)
++ return null;
++ AccessibleContext ac = getCurrentAccessibleContext();
++ AccessibleStateSet states;
++ int row = tree.getUI().getRowForPath(tree,path);
++ int lsr = tree.getLeadSelectionRow();
++ if (ac != null) {
++ states = ac.getAccessibleStateSet();
++ } else {
++ states = new AccessibleStateSet();
++ }
++ // need to test here, 'cause the underlying component
++ // is a cellRenderer, which is never showing...
++ if (isShowing()) {
++ states.add(AccessibleState.SHOWING);
++ } else if (states.contains(AccessibleState.SHOWING)) {
++ states.remove(AccessibleState.SHOWING);
++ }
++ if (isVisible()) {
++ states.add(AccessibleState.VISIBLE);
++ } else if (states.contains(AccessibleState.VISIBLE)) {
++ states.remove(AccessibleState.VISIBLE);
++ }
++ if (tree.isPathSelected(path)){
++ states.add(AccessibleState.SELECTED);
++ }
++ if (lsr == row) {
++ states.add(AccessibleState.ACTIVE);
++ }
++ if (!isLeaf) {
++ states.add(AccessibleState.EXPANDABLE);
++ }
++ if (tree.isExpanded(path)) {
++ states.add(AccessibleState.EXPANDED);
++ } else {
++ states.add(AccessibleState.COLLAPSED);
++ }
++ if (tree.isEditable()) {
++ states.add(AccessibleState.EDITABLE);
++ }
++ return states;
++ }
++
++ /**
++ * Get the Accessible parent of this object.
++ *
++ * @return the Accessible parent of this object; null if this
++ * object does not have an Accessible parent
++ */
++ public Accessible getAccessibleParent() {
++ // someone wants to know, so we need to create our parent
++ // if we don't have one (hey, we're a talented kid!)
++ if (accessibleParent == null && path != null) {
++ Object[] objPath = path.getPath();
++ if (objPath.length > 1) {
++ Object objParent = objPath[objPath.length-2];
++ if (treeModel != null) {
++ index = treeModel.getIndexOfChild(objParent, obj);
++ }
++ Object[] objParentPath = new Object[objPath.length-1];
++ java.lang.System.arraycopy(objPath, 0, objParentPath,
++ 0, objPath.length-1);
++ TreePath parentPath = new TreePath(objParentPath);
++ accessibleParent = new AccessibleJTreeNode(tree,
++ parentPath,
++ null);
++ this.setAccessibleParent(accessibleParent);
++ } else if (treeModel != null) {
++ accessibleParent = tree; // we're the top!
++ index = 0; // we're an only child!
++ this.setAccessibleParent(accessibleParent);
++ }
++ }
++ return accessibleParent;
++ }
++
++ /**
++ * Get the index of this object in its accessible parent.
++ *
++ * @return the index of this object in its parent; -1 if this
++ * object does not have an accessible parent.
++ * @see #getAccessibleParent
++ */
++ public int getAccessibleIndexInParent() {
++ // index is invalid 'till we have an accessibleParent...
++ if (accessibleParent == null) {
++ getAccessibleParent();
++ }
++ if (path != null) {
++ Object[] objPath = path.getPath();
++ if (objPath.length > 1) {
++ Object objParent = objPath[objPath.length-2];
++ if (treeModel != null) {
++ index = treeModel.getIndexOfChild(objParent, obj);
++ }
++ }
++ }
++ return index;
++ }
++
++ /**
++ * Returns the number of accessible children in the object.
++ *
++ * @return the number of accessible children in the object.
++ */
++ public int getAccessibleChildrenCount() {
++ // Tree nodes can't be so complex that they have
++ // two sets of children -> we're ignoring that case
++ if (obj != null && treeModel != null) {
++ return treeModel.getChildCount(obj);
++ }
++ return 0;
++ }
++
++ /**
++ * Return the specified Accessible child of the object.
++ *
++ * @param i zero-based index of child
++ * @return the Accessible child of the object
++ */
++ public Accessible getAccessibleChild(int i) {
++ // Tree nodes can't be so complex that they have
++ // two sets of children -> we're ignoring that case
++ if (i < 0 || i >= getAccessibleChildrenCount() || path == null || treeModel == null) {
++ return null;
++ } else {
++ Object childObj = treeModel.getChild(obj, i);
++ Object[] objPath = path.getPath();
++ Object[] objChildPath = new Object[objPath.length+1];
++ java.lang.System.arraycopy(objPath, 0, objChildPath, 0, objPath.length);
++ objChildPath[objChildPath.length-1] = childObj;
++ TreePath childPath = new TreePath(objChildPath);
++ return new AccessibleJTreeNode(tree, childPath, this);
++ }
++ }
++
++ /**
++ * Gets the locale of the component. If the component does not have
++ * a locale, then the locale of its parent is returned.
++ *
++ * @return This component's locale. If this component does not have
++ * a locale, the locale of its parent is returned.
++ * @exception IllegalComponentStateException
++ * If the 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.
++ * @see #setLocale
++ */
++ public Locale getLocale() {
++ if (tree == null)
++ return null;
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ return ac.getLocale();
++ } else {
++ return tree.getLocale();
++ }
++ }
++
++ /**
++ * Add a PropertyChangeListener to the listener list.
++ * The listener is registered for all properties.
++ *
++ * @param l The PropertyChangeListener to be added
++ */
++ public void addPropertyChangeListener(PropertyChangeListener l) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ ac.addPropertyChangeListener(l);
++ } else {
++ super.addPropertyChangeListener(l);
++ }
++ }
++
++ /**
++ * Remove a PropertyChangeListener from the listener list.
++ * This removes a PropertyChangeListener that was registered
++ * for all properties.
++ *
++ * @param l The PropertyChangeListener to be removed
++ */
++ public void removePropertyChangeListener(PropertyChangeListener l) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ ac.removePropertyChangeListener(l);
++ } else {
++ super.removePropertyChangeListener(l);
++ }
++ }
++
++ /**
++ * Get the AccessibleAction associated with this object. In the
++ * implementation of the Java Accessibility API for this class,
++ * return this object, which is responsible for implementing the
++ * AccessibleAction interface on behalf of itself.
++ *
++ * @return this object
++ */
++ public AccessibleAction getAccessibleAction() {
++ return this;
++ }
++
++ /**
++ * Get the AccessibleComponent associated with this object. In the
++ * implementation of the Java Accessibility API for this class,
++ * return this object, which is responsible for implementing the
++ * AccessibleComponent interface on behalf of itself.
++ *
++ * @return this object
++ */
++ public AccessibleComponent getAccessibleComponent() {
++ return this; // to override getBounds()
++ }
++
++ /**
++ * Get the AccessibleSelection associated with this object if one
++ * exists. Otherwise return null.
++ *
++ * @return the AccessibleSelection, or null
++ */
++ public AccessibleSelection getAccessibleSelection() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null && isLeaf) {
++ return getCurrentAccessibleContext().getAccessibleSelection();
++ } else {
++ return this;
++ }
++ }
++
++ /**
++ * Get the AccessibleText associated with this object if one
++ * exists. Otherwise return null.
++ *
++ * @return the AccessibleText, or null
++ */
++ public AccessibleText getAccessibleText() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ return getCurrentAccessibleContext().getAccessibleText();
++ } else {
++ return null;
++ }
++ }
++
++ /**
++ * Get the AccessibleValue associated with this object if one
++ * exists. Otherwise return null.
++ *
++ * @return the AccessibleValue, or null
++ */
++ public AccessibleValue getAccessibleValue() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ return getCurrentAccessibleContext().getAccessibleValue();
++ } else {
++ return null;
++ }
++ }
++
++
++ // AccessibleComponent methods
++
++ /**
++ * Get the background color of this object.
++ *
++ * @return the background color, if supported, of the object;
++ * otherwise, null
++ */
++ public Color getBackground() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ac).getBackground();
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ return c.getBackground();
++ } else {
++ return null;
++ }
++ }
++ }
++
++ /**
++ * Set the background color of this object.
++ *
++ * @param c the new Color for the background
++ */
++ public void setBackground(Color c) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).setBackground(c);
++ } else {
++ Component cp = getCurrentComponent();
++ if ( cp != null) {
++ cp.setBackground(c);
++ }
++ }
++ }
++
++
++ /**
++ * Get the foreground color of this object.
++ *
++ * @return the foreground color, if supported, of the object;
++ * otherwise, null
++ */
++ public Color getForeground() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ac).getForeground();
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ return c.getForeground();
++ } else {
++ return null;
++ }
++ }
++ }
++
++ public void setForeground(Color c) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).setForeground(c);
++ } else {
++ Component cp = getCurrentComponent();
++ if (cp != null) {
++ cp.setForeground(c);
++ }
++ }
++ }
++
++ public Cursor getCursor() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ac).getCursor();
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ return c.getCursor();
++ } else {
++ Accessible ap = getAccessibleParent();
++ if (ap instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ap).getCursor();
++ } else {
++ return null;
++ }
++ }
++ }
++ }
++
++ public void setCursor(Cursor c) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).setCursor(c);
++ } else {
++ Component cp = getCurrentComponent();
++ if (cp != null) {
++ cp.setCursor(c);
++ }
++ }
++ }
++
++ public Font getFont() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ac).getFont();
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ return c.getFont();
++ } else {
++ return null;
++ }
++ }
++ }
++
++ public void setFont(Font f) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).setFont(f);
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ c.setFont(f);
++ }
++ }
++ }
++
++ public FontMetrics getFontMetrics(Font f) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ac).getFontMetrics(f);
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ return c.getFontMetrics(f);
++ } else {
++ return null;
++ }
++ }
++ }
++
++ public boolean isEnabled() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ac).isEnabled();
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ return c.isEnabled();
++ } else {
++ return false;
++ }
++ }
++ }
++
++ public void setEnabled(boolean b) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).setEnabled(b);
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ c.setEnabled(b);
++ }
++ }
++ }
++
++ public boolean isVisible() {
++ if (tree == null)
++ return false;
++ Rectangle pathBounds = tree.getPathBounds(path);
++ Rectangle parentBounds = tree.getVisibleRect();
++ if ( pathBounds != null && parentBounds != null &&
++ parentBounds.intersects(pathBounds) ) {
++ return true;
++ } else {
++ return false;
++ }
++ }
++
++ public void setVisible(boolean b) {
++ }
++
++ public boolean isShowing() {
++ return (tree.isShowing() && isVisible());
++ }
++
++ public boolean contains(Point p) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ Rectangle r = ((AccessibleComponent) ac).getBounds();
++ return r.contains(p);
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ Rectangle r = c.getBounds();
++ return r.contains(p);
++ } else {
++ return getBounds().contains(p);
++ }
++ }
++ }
++
++ public Point getLocationOnScreen() {
++ if (tree != null) {
++ Point treeLocation = tree.getLocationOnScreen();
++ Rectangle pathBounds = tree.getPathBounds(path);
++ if (treeLocation != null && pathBounds != null) {
++ Point nodeLocation = new Point(pathBounds.x,
++ pathBounds.y);
++ nodeLocation.translate(treeLocation.x, treeLocation.y);
++ return nodeLocation;
++ } else {
++ return null;
++ }
++ } else {
++ return null;
++ }
++ }
++
++ private Point getLocationInJTree() {
++ Rectangle r = tree.getPathBounds(path);
++ if (r != null) {
++ return r.getLocation();
++ } else {
++ return null;
++ }
++ }
++
++ public Point getLocation() {
++ Rectangle r = getBounds();
++ if (r != null) {
++ return r.getLocation();
++ } else {
++ return null;
++ }
++ }
++
++ public void setLocation(Point p) {
++ }
++
++ public Rectangle getBounds() {
++ if (tree == null)
++ return null;
++ Rectangle r = tree.getPathBounds(path);
++ Accessible parent = getAccessibleParent();
++ if (parent instanceof AccessibleJTreeNode) {
++ Point parentLoc = ((AccessibleJTreeNode) parent).getLocationInJTree();
++ if (parentLoc != null && r != null) {
++ r.translate(-parentLoc.x, -parentLoc.y);
++ } else {
++ return null; // not visible!
++ }
++ }
++ return r;
++ }
++
++ public void setBounds(Rectangle r) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).setBounds(r);
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ c.setBounds(r);
++ }
++ }
++ }
++
++ public Dimension getSize() {
++ return getBounds().getSize();
++ }
++
++ public void setSize (Dimension d) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).setSize(d);
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ c.setSize(d);
++ }
++ }
++ }
++
++ /**
++ * Returns the <code>Accessible</code> child, if one exists,
++ * contained at the local coordinate <code>Point</code>.
++ * Otherwise returns <code>null</code>.
++ *
++ * @param p point in local coordinates of this
++ * <code>Accessible</code>
++ * @return the <code>Accessible</code>, if it exists,
++ * at the specified location; else <code>null</code>
++ */
++ public Accessible getAccessibleAt(Point p) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ac).getAccessibleAt(p);
++ } else {
++ return null;
++ }
++ }
++
++ public boolean isFocusTraversable() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ return ((AccessibleComponent) ac).isFocusTraversable();
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ return c.isFocusable();
++ } else {
++ return false;
++ }
++ }
++ }
++
++ public void requestFocus() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).requestFocus();
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ c.requestFocus();
++ }
++ }
++ }
++
++ public void addFocusListener(FocusListener l) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).addFocusListener(l);
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ c.addFocusListener(l);
++ }
++ }
++ }
++
++ public void removeFocusListener(FocusListener l) {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac instanceof AccessibleComponent) {
++ ((AccessibleComponent) ac).removeFocusListener(l);
++ } else {
++ Component c = getCurrentComponent();
++ if (c != null) {
++ c.removeFocusListener(l);
++ }
++ }
++ }
++
++ // AccessibleSelection methods
++
++ /**
++ * Returns the number of items currently selected.
++ * If no items are selected, the return value will be 0.
++ *
++ * @return the number of items currently selected.
++ */
++ public int getAccessibleSelectionCount() {
++ int count = 0;
++ int childCount = getAccessibleChildrenCount();
++ for (int i = 0; i < childCount; i++) {
++ TreePath childPath = getChildTreePath(i);
++ if (tree.isPathSelected(childPath)) {
++ count++;
++ }
++ }
++ return count;
++ }
++
++ /**
++ * Returns an Accessible representing the specified selected item
++ * in the object. If there isn't a selection, or there are
++ * fewer items selected than the integer passed in, the return
++ * value will be null.
++ *
++ * @param i the zero-based index of selected items
++ * @return an Accessible containing the selected item
++ */
++ public Accessible getAccessibleSelection(int i) {
++ int childCount = getAccessibleChildrenCount();
++ if (i < 0 || i >= childCount) {
++ return null; // out of range
++ }
++ int count = 0;
++ for (int j = 0; j < childCount && i >= count; j++) {
++ TreePath childPath = getChildTreePath(j);
++ if (tree.isPathSelected(childPath)) {
++ if (count == i) {
++ return new AccessibleJTreeNode(tree, childPath, this);
++ } else {
++ count++;
++ }
++ }
++ }
++ return null;
++ }
++
++ /**
++ * Returns true if the current child of this object is selected.
++ *
++ * @param i the zero-based index of the child in this Accessible
++ * object.
++ * @see AccessibleContext#getAccessibleChild
++ */
++ public boolean isAccessibleChildSelected(int i) {
++ int childCount = getAccessibleChildrenCount();
++ if (i < 0 || i >= childCount) {
++ return false; // out of range
++ } else {
++ TreePath childPath = getChildTreePath(i);
++ return tree.isPathSelected(childPath);
++ }
++ }
++
++ /**
++ * Adds the specified selected item in the object to the object's
++ * selection. If the object supports multiple selections,
++ * the specified item is added to any existing selection, otherwise
++ * it replaces any existing selection in the object. If the
++ * specified item is already selected, this method has no effect.
++ *
++ * @param i the zero-based index of selectable items
++ */
++ public void addAccessibleSelection(int i) {
++ if (tree == null)
++ return;
++ TreeModel model = tree.getModel();
++ if (model != null) {
++ if (i >= 0 && i < getAccessibleChildrenCount()) {
++ TreePath path = getChildTreePath(i);
++ tree.addSelectionPath(path);
++ }
++ }
++ }
++
++ /**
++ * Removes the specified selected item in the object from the
++ * object's
++ * selection. If the specified item isn't currently selected, this
++ * method has no effect.
++ *
++ * @param i the zero-based index of selectable items
++ */
++ public void removeAccessibleSelection(int i) {
++ if (tree == null)
++ return;
++ TreeModel model = tree.getModel();
++ if (model != null) {
++ if (i >= 0 && i < getAccessibleChildrenCount()) {
++ TreePath path = getChildTreePath(i);
++ tree.removeSelectionPath(path);
++ }
++ }
++ }
++
++ /**
++ * Clears the selection in the object, so that nothing in the
++ * object is selected.
++ */
++ public void clearAccessibleSelection() {
++ int childCount = getAccessibleChildrenCount();
++ for (int i = 0; i < childCount; i++) {
++ removeAccessibleSelection(i);
++ }
++ }
++
++ /**
++ * Causes every selected item in the object to be selected
++ * if the object supports multiple selections.
++ */
++ public void selectAllAccessibleSelection() {
++ if (tree == null)
++ return;
++ TreeModel model = tree.getModel();
++ if (model != null) {
++ int childCount = getAccessibleChildrenCount();
++ TreePath path;
++ for (int i = 0; i < childCount; i++) {
++ path = getChildTreePath(i);
++ tree.addSelectionPath(path);
++ }
++ }
++ }
++
++ // AccessibleAction methods
++
++ /**
++ * Returns the number of accessible actions available in this
++ * tree node. If this node is not a leaf, there is at least
++ * one action (toggle expand), in addition to any available
++ * on the object behind the TreeCellRenderer.
++ *
++ * @return the number of Actions in this object
++ */
++ public int getAccessibleActionCount() {
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (ac != null) {
++ AccessibleAction aa = ac.getAccessibleAction();
++ if (aa != null) {
++ return (aa.getAccessibleActionCount() + (isLeaf ? 0 : 1));
++ }
++ }
++ return isLeaf ? 0 : 1;
++ }
++
++ /**
++ * Return a description of the specified action of the tree node.
++ * If this node is not a leaf, there is at least one action
++ * description (toggle expand), in addition to any available
++ * on the object behind the TreeCellRenderer.
++ *
++ * @param i zero-based index of the actions
++ * @return a description of the action
++ */
++ public String getAccessibleActionDescription(int i) {
++ if (i < 0 || i >= getAccessibleActionCount()) {
++ return null;
++ }
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (i == 0) {
++ // TIGER - 4766636
++ // return AccessibleAction.TOGGLE_EXPAND;
++ return "toggle expand";
++ } else if (ac != null) {
++ AccessibleAction aa = ac.getAccessibleAction();
++ if (aa != null) {
++ return aa.getAccessibleActionDescription(i - 1);
++ }
++ }
++ return null;
++ }
++
++ /**
++ * Perform the specified Action on the tree node. If this node
++ * is not a leaf, there is at least one action which can be
++ * done (toggle expand), in addition to any available on the
++ * object behind the TreeCellRenderer.
++ *
++ * @param i zero-based index of actions
++ * @return true if the the action was performed; else false.
++ */
++ public boolean doAccessibleAction(int i) {
++ if (i < 0 || i >= getAccessibleActionCount()) {
++ return false;
++ }
++ AccessibleContext ac = getCurrentAccessibleContext();
++ if (i == 0) {
++ if (tree.isExpanded(path)) {
++ tree.collapsePath(path);
++ } else {
++ tree.expandPath(path);
++ }
++ return true;
++ } else if (ac != null) {
++ AccessibleAction aa = ac.getAccessibleAction();
++ if (aa != null) {
++ return aa.doAccessibleAction(i - 1);
++ }
++ }
++ return false;
++ }
++
++ } // inner class AccessibleJTreeNode
++
++ /**
++ * A helper class to perform {@code Callable} objects on the event dispatch thread appropriate
++ * for the provided {@code AccessibleContext}.
++ */
++ private static class InvocationUtils {
++
++ /**
++ * Invokes a {@code Callable} in the {@code AppContext} of the given {@code Accessible}
++ * and waits for it to finish blocking the caller thread.
++ *
++ * @param callable the {@code Callable} to invoke
++ * @param accessible the {@code Accessible} which would be used to find the right context
++ * for the task execution
++ * @param <T> type parameter for the result value
++ *
++ * @return the result of the {@code Callable} execution
++ */
++ public static <T> T invokeAndWait(final Callable<T> callable,
++ final Accessible accessible) {
++ if (accessible instanceof Component) {
++ return invokeAndWait(callable, (Component)accessible);
++ }
++ if (accessible instanceof AccessibleContext) {
++ // This case also covers the Translator
++ return invokeAndWait(callable, (AccessibleContext)accessible);
++ }
++ throw new RuntimeException("Unmapped Accessible used to dispatch event: " + accessible);
++ }
++
++ /**
++ * Invokes a {@code Callable} in the {@code AppContext} of the given {@code Component}
++ * and waits for it to finish blocking the caller thread.
++ *
++ * @param callable the {@code Callable} to invoke
++ * @param component the {@code Component} which would be used to find the right context
++ * for the task execution
++ * @param <T> type parameter for the result value
++ *
++ * @return the result of the {@code Callable} execution
++ */
++ public static <T> T invokeAndWait(final Callable<T> callable,
++ final Component component) {
++ return invokeAndWait(callable, SunToolkit.targetToAppContext(component));
++ }
++
++ /**
++ * Invokes a {@code Callable} in the {@code AppContext} mapped to the given {@code AccessibleContext}
++ * and waits for it to finish blocking the caller thread.
++ *
++ * @param callable the {@code Callable} to invoke
++ * @param accessibleContext the {@code AccessibleContext} which would be used to determine the right
++ * context for the task execution.
++ * @param <T> type parameter for the result value
++ *
++ * @return the result of the {@code Callable} execution
++ */
++ public static <T> T invokeAndWait(final Callable<T> callable,
++ final AccessibleContext accessibleContext) {
++ AppContext targetContext = AWTAccessor.getAccessibleContextAccessor()
++ .getAppContext(accessibleContext);
++ if (targetContext != null) {
++ return invokeAndWait(callable, targetContext);
++ } else {
++ // Normally this should not happen, unmapped context provided and
++ // the target AppContext is unknown.
++
++ // Try to recover in case the context is a translator.
++ if (accessibleContext instanceof Translator) {
++ Object source = ((Translator)accessibleContext).getSource();
++ if (source instanceof Component) {
++ return invokeAndWait(callable, (Component)source);
++ }
++ }
++ }
++ throw new RuntimeException("Unmapped AccessibleContext used to dispatch event: " + accessibleContext);
++ }
++
++ private static <T> T invokeAndWait(final Callable<T> callable,
++ final AppContext targetAppContext) {
++ final CallableWrapper<T> wrapper = new CallableWrapper<T>(callable);
++ try {
++ invokeAndWait(wrapper, targetAppContext);
++ T result = wrapper.getResult();
++ updateAppContextMap(result, targetAppContext);
++ return result;
++ } catch (final Exception e) {
++ throw new RuntimeException(e);
++ }
++ }
++
++ private static void invokeAndWait(final Runnable runnable,
++ final AppContext appContext)
++ throws InterruptedException, InvocationTargetException {
++
++ EventQueue eq = SunToolkit.getSystemEventQueueImplPP(appContext);
++ Object lock = new Object();
++ Toolkit source = Toolkit.getDefaultToolkit();
++ InvocationEvent event =
++ new InvocationEvent(source, runnable, lock, true);
++ synchronized (lock) {
++ eq.postEvent(event);
++ lock.wait();
++ }
++
++ Throwable eventThrowable = event.getThrowable();
++ if (eventThrowable != null) {
++ throw new InvocationTargetException(eventThrowable);
++ }
++ }
++
++ /**
++ * Maps the {@code AccessibleContext} to the {@code AppContext} which should be used
++ * to dispatch events related to the {@code AccessibleContext}
++ * @param accessibleContext the {@code AccessibleContext} for the mapping
++ * @param targetContext the {@code AppContext} for the mapping
++ */
++ public static void registerAccessibleContext(final AccessibleContext accessibleContext,
++ final AppContext targetContext) {
++ if (accessibleContext != null) {
++ AWTAccessor.getAccessibleContextAccessor().setAppContext(accessibleContext, targetContext);
++ }
++ }
++
++ private static <T> void updateAppContextMap(final T accessibleContext,
++ final AppContext targetContext) {
++ if (accessibleContext instanceof AccessibleContext) {
++ registerAccessibleContext((AccessibleContext)accessibleContext, targetContext);
++ }
++ }
++
++ private static class CallableWrapper<T> implements Runnable {
++ private final Callable<T> callable;
++ private volatile T object;
++ private Exception e;
++
++ CallableWrapper(final Callable<T> callable) {
++ this.callable = callable;
++ }
++
++ public void run() {
++ try {
++ if (callable != null) {
++ object = callable.call();
++ }
++ } catch (final Exception e) {
++ this.e = e;
++ }
++ }
++
++ T getResult() throws Exception {
++ if (e != null)
++ throw e;
++ return object;
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/classes/com/sun/java/accessibility/legacy/AccessBridgeLoader.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,71 @@
++/*
++ * Copyright (c) 2002, 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. 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 com.sun.java.accessibility;
++
++@jdk.Exported(false)
++abstract class AccessBridgeLoader {
++
++ /**
++ * Load JavaAccessBridge.DLL (our native half)
++ */
++ static {
++ java.security.AccessController.doPrivileged(
++ new java.security.PrivilegedAction<Object>() {
++ public Object run() {
++ System.loadLibrary("JavaAccessBridge");
++ return null;
++ }
++ }, null, new RuntimePermission("loadLibrary.JavaAccessBridge")
++ );
++ }
++
++ boolean useJAWT_DLL = false;
++
++ /**
++ * AccessBridgeLoader constructor
++ */
++ AccessBridgeLoader() {
++ String version = System.getProperty("java.version");
++ if (version != null)
++ useJAWT_DLL = (version.compareTo("1.4.1") >= 0);
++
++ // load JAWTAccessBridge.DLL on JDK 1.4.1 or later
++ if (useJAWT_DLL) {
++ // Note that we have to explicitly load JAWT.DLL
++ java.security.AccessController.doPrivileged(
++ new java.security.PrivilegedAction<Object>() {
++ public Object run() {
++ System.loadLibrary("JAWT");
++ System.loadLibrary("JAWTAccessBridge");
++ return null;
++ }
++ }, null, new RuntimePermission("loadLibrary.JAWT"),
++ new RuntimePermission("loadLibrary.JAWTAccessBridge")
++ );
++ }
++ }
++}
+--- ./jdk/src/windows/classes/java/lang/ProcessImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/classes/java/lang/ProcessImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -461,11 +461,21 @@
+ if (getExitCodeProcess(handle) != STILL_ACTIVE) return true;
+ if (timeout <= 0) return false;
+
+- long msTimeout = unit.toMillis(timeout);
++ long remainingNanos = unit.toNanos(timeout);
++ long deadline = System.nanoTime() + remainingNanos ;
+
+- waitForTimeoutInterruptibly(handle, msTimeout);
+- if (Thread.interrupted())
+- throw new InterruptedException();
++ do {
++ // Round up to next millisecond
++ long msTimeout = TimeUnit.NANOSECONDS.toMillis(remainingNanos + 999_999L);
++ waitForTimeoutInterruptibly(handle, msTimeout);
++ if (Thread.interrupted())
++ throw new InterruptedException();
++ if (getExitCodeProcess(handle) != STILL_ACTIVE) {
++ return true;
++ }
++ remainingNanos = deadline - System.nanoTime();
++ } while (remainingNanos > 0);
++
+ return (getExitCodeProcess(handle) != STILL_ACTIVE);
+ }
+
+--- ./jdk/src/windows/classes/java/util/prefs/WindowsPreferences.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/classes/java/util/prefs/WindowsPreferences.java Wed Jul 01 21:53:30 2015 -0700
+@@ -53,8 +53,8 @@
+ /**
+ * Windows registry path to <tt>Preferences</tt>'s root nodes.
+ */
+- private static final byte[] WINDOWS_ROOT_PATH
+- = stringToByteArray("Software\\JavaSoft\\Prefs");
++ private static final byte[] WINDOWS_ROOT_PATH =
++ stringToByteArray("Software\\JavaSoft\\Prefs");
+
+ /**
+ * Windows handles to <tt>HKEY_CURRENT_USER</tt> and
+@@ -138,12 +138,12 @@
+ * Java wrapper for Windows registry API RegOpenKey()
+ */
+ private static native int[] WindowsRegOpenKey(int hKey, byte[] subKey,
+- int securityMask);
++ int securityMask);
+ /**
+ * Retries RegOpenKey() MAX_ATTEMPTS times before giving up.
+ */
+ private static int[] WindowsRegOpenKey1(int hKey, byte[] subKey,
+- int securityMask) {
++ int securityMask) {
+ int[] result = WindowsRegOpenKey(hKey, subKey, securityMask);
+ if (result[ERROR_CODE] == ERROR_SUCCESS) {
+ return result;
+@@ -158,16 +158,16 @@
+ } else if (result[ERROR_CODE] != ERROR_ACCESS_DENIED) {
+ long sleepTime = INIT_SLEEP_TIME;
+ for (int i = 0; i < MAX_ATTEMPTS; i++) {
+- try {
+- Thread.sleep(sleepTime);
+- } catch(InterruptedException e) {
+- return result;
+- }
+- sleepTime *= 2;
+- result = WindowsRegOpenKey(hKey, subKey, securityMask);
+- if (result[ERROR_CODE] == ERROR_SUCCESS) {
+- return result;
+- }
++ try {
++ Thread.sleep(sleepTime);
++ } catch(InterruptedException e) {
++ return result;
++ }
++ sleepTime *= 2;
++ result = WindowsRegOpenKey(hKey, subKey, securityMask);
++ if (result[ERROR_CODE] == ERROR_SUCCESS) {
++ return result;
++ }
+ }
+ }
+ return result;
+@@ -189,10 +189,10 @@
+ private static int[] WindowsRegCreateKeyEx1(int hKey, byte[] subKey) {
+ int[] result = WindowsRegCreateKeyEx(hKey, subKey);
+ if (result[ERROR_CODE] == ERROR_SUCCESS) {
+- return result;
+- } else {
+- long sleepTime = INIT_SLEEP_TIME;
+- for (int i = 0; i < MAX_ATTEMPTS; i++) {
++ return result;
++ } else {
++ long sleepTime = INIT_SLEEP_TIME;
++ for (int i = 0; i < MAX_ATTEMPTS; i++) {
+ try {
+ Thread.sleep(sleepTime);
+ } catch(InterruptedException e) {
+@@ -201,7 +201,7 @@
+ sleepTime *= 2;
+ result = WindowsRegCreateKeyEx(hKey, subKey);
+ if (result[ERROR_CODE] == ERROR_SUCCESS) {
+- return result;
++ return result;
+ }
+ }
+ }
+@@ -223,10 +223,10 @@
+ private static int WindowsRegFlushKey1(int hKey) {
+ int result = WindowsRegFlushKey(hKey);
+ if (result == ERROR_SUCCESS) {
+- return result;
+- } else {
+- long sleepTime = INIT_SLEEP_TIME;
+- for (int i = 0; i < MAX_ATTEMPTS; i++) {
++ return result;
++ } else {
++ long sleepTime = INIT_SLEEP_TIME;
++ for (int i = 0; i < MAX_ATTEMPTS; i++) {
+ try {
+ Thread.sleep(sleepTime);
+ } catch(InterruptedException e) {
+@@ -235,7 +235,7 @@
+ sleepTime *= 2;
+ result = WindowsRegFlushKey(hKey);
+ if (result == ERROR_SUCCESS) {
+- return result;
++ return result;
+ }
+ }
+ }
+@@ -246,23 +246,23 @@
+ * Java wrapper for Windows registry API RegQueryValueEx()
+ */
+ private static native byte[] WindowsRegQueryValueEx(int hKey,
+- byte[] valueName);
++ byte[] valueName);
+ /**
+ * Java wrapper for Windows registry API RegSetValueEx()
+ */
+ private static native int WindowsRegSetValueEx(int hKey, byte[] valueName,
+- byte[] value);
++ byte[] value);
+ /**
+ * Retries RegSetValueEx() MAX_ATTEMPTS times before giving up.
+ */
+ private static int WindowsRegSetValueEx1(int hKey, byte[] valueName,
+- byte[] value) {
++ byte[] value) {
+ int result = WindowsRegSetValueEx(hKey, valueName, value);
+ if (result == ERROR_SUCCESS) {
+- return result;
+- } else {
+- long sleepTime = INIT_SLEEP_TIME;
+- for (int i = 0; i < MAX_ATTEMPTS; i++) {
++ return result;
++ } else {
++ long sleepTime = INIT_SLEEP_TIME;
++ for (int i = 0; i < MAX_ATTEMPTS; i++) {
+ try {
+ Thread.sleep(sleepTime);
+ } catch(InterruptedException e) {
+@@ -271,7 +271,7 @@
+ sleepTime *= 2;
+ result = WindowsRegSetValueEx(hKey, valueName, value);
+ if (result == ERROR_SUCCESS) {
+- return result;
++ return result;
+ }
+ }
+ }
+@@ -294,10 +294,10 @@
+ private static int[] WindowsRegQueryInfoKey1(int hKey) {
+ int[] result = WindowsRegQueryInfoKey(hKey);
+ if (result[ERROR_CODE] == ERROR_SUCCESS) {
+- return result;
+- } else {
+- long sleepTime = INIT_SLEEP_TIME;
+- for (int i = 0; i < MAX_ATTEMPTS; i++) {
++ return result;
++ } else {
++ long sleepTime = INIT_SLEEP_TIME;
++ for (int i = 0; i < MAX_ATTEMPTS; i++) {
+ try {
+ Thread.sleep(sleepTime);
+ } catch(InterruptedException e) {
+@@ -306,7 +306,7 @@
+ sleepTime *= 2;
+ result = WindowsRegQueryInfoKey(hKey);
+ if (result[ERROR_CODE] == ERROR_SUCCESS) {
+- return result;
++ return result;
+ }
+ }
+ }
+@@ -317,19 +317,19 @@
+ * Java wrapper for Windows registry API RegEnumKeyEx()
+ */
+ private static native byte[] WindowsRegEnumKeyEx(int hKey, int subKeyIndex,
+- int maxKeyLength);
++ int maxKeyLength);
+
+ /**
+ * Retries RegEnumKeyEx() MAX_ATTEMPTS times before giving up.
+ */
+ private static byte[] WindowsRegEnumKeyEx1(int hKey, int subKeyIndex,
+- int maxKeyLength) {
++ int maxKeyLength) {
+ byte[] result = WindowsRegEnumKeyEx(hKey, subKeyIndex, maxKeyLength);
+ if (result != null) {
+- return result;
+- } else {
+- long sleepTime = INIT_SLEEP_TIME;
+- for (int i = 0; i < MAX_ATTEMPTS; i++) {
++ return result;
++ } else {
++ long sleepTime = INIT_SLEEP_TIME;
++ for (int i = 0; i < MAX_ATTEMPTS; i++) {
+ try {
+ Thread.sleep(sleepTime);
+ } catch(InterruptedException e) {
+@@ -338,7 +338,7 @@
+ sleepTime *= 2;
+ result = WindowsRegEnumKeyEx(hKey, subKeyIndex, maxKeyLength);
+ if (result != null) {
+- return result;
++ return result;
+ }
+ }
+ }
+@@ -349,19 +349,19 @@
+ * Java wrapper for Windows registry API RegEnumValue()
+ */
+ private static native byte[] WindowsRegEnumValue(int hKey, int valueIndex,
+- int maxValueNameLength);
++ int maxValueNameLength);
+ /**
+ * Retries RegEnumValueEx() MAX_ATTEMPTS times before giving up.
+ */
+ private static byte[] WindowsRegEnumValue1(int hKey, int valueIndex,
+- int maxValueNameLength) {
++ int maxValueNameLength) {
+ byte[] result = WindowsRegEnumValue(hKey, valueIndex,
+- maxValueNameLength);
++ maxValueNameLength);
+ if (result != null) {
+- return result;
+- } else {
+- long sleepTime = INIT_SLEEP_TIME;
+- for (int i = 0; i < MAX_ATTEMPTS; i++) {
++ return result;
++ } else {
++ long sleepTime = INIT_SLEEP_TIME;
++ for (int i = 0; i < MAX_ATTEMPTS; i++) {
+ try {
+ Thread.sleep(sleepTime);
+ } catch(InterruptedException e) {
+@@ -369,9 +369,9 @@
+ }
+ sleepTime *= 2;
+ result = WindowsRegEnumValue(hKey, valueIndex,
+- maxValueNameLength);
++ maxValueNameLength);
+ if (result != null) {
+- return result;
++ return result;
+ }
+ }
+ }
+@@ -395,11 +395,11 @@
+ int[] result =
+ WindowsRegCreateKeyEx1(parentNativeHandle, toWindowsName(name));
+ if (result[ERROR_CODE] != ERROR_SUCCESS) {
+- logger().warning("Could not create windows registry "
+- + "node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegCreateKeyEx(...) returned error code " +
+- result[ERROR_CODE] + ".");
++ logger().warning("Could not create windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" + Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegCreateKeyEx(...) returned error code " +
++ result[ERROR_CODE] + ".");
+ isBackingStoreAvailable = false;
+ return;
+ }
+@@ -417,15 +417,15 @@
+ * @param rootDirectory Path to root directory, as a byte-encoded string.
+ */
+ private WindowsPreferences(int rootNativeHandle, byte[] rootDirectory) {
+- super(null,"");
++ super(null, "");
+ int[] result =
+ WindowsRegCreateKeyEx1(rootNativeHandle, rootDirectory);
+ if (result[ERROR_CODE] != ERROR_SUCCESS) {
+ logger().warning("Could not open/create prefs root node " +
+- byteArrayToString(windowsAbsolutePath()) + " at root 0x" +
+- Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegCreateKeyEx(...) returned error code " +
+- result[ERROR_CODE] + ".");
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" + Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegCreateKeyEx(...) returned error code " +
++ result[ERROR_CODE] + ".");
+ isBackingStoreAvailable = false;
+ return;
+ }
+@@ -442,7 +442,7 @@
+ private byte[] windowsAbsolutePath() {
+ ByteArrayOutputStream bstream = new ByteArrayOutputStream();
+ bstream.write(WINDOWS_ROOT_PATH, 0, WINDOWS_ROOT_PATH.length-1);
+- StringTokenizer tokenizer = new StringTokenizer(absolutePath(),"/");
++ StringTokenizer tokenizer = new StringTokenizer(absolutePath(), "/");
+ while (tokenizer.hasMoreTokens()) {
+ bstream.write((byte)'\\');
+ String nextName = tokenizer.nextToken();
+@@ -496,27 +496,30 @@
+ /* Check if key's path is short enough be opened at once
+ otherwise use a path-splitting procedure */
+ if (windowsAbsolutePath.length <= MAX_WINDOWS_PATH_LENGTH + 1) {
+- int[] result = WindowsRegOpenKey1(rootNativeHandle(),
+- windowsAbsolutePath, mask1);
+- if (result[ERROR_CODE] == ERROR_ACCESS_DENIED && mask2 != mask1)
+- result = WindowsRegOpenKey1(rootNativeHandle(),
+- windowsAbsolutePath, mask2);
++ int[] result = WindowsRegOpenKey1(rootNativeHandle(),
++ windowsAbsolutePath, mask1);
++ if (result[ERROR_CODE] == ERROR_ACCESS_DENIED && mask2 != mask1)
++ result = WindowsRegOpenKey1(rootNativeHandle(),
++ windowsAbsolutePath, mask2);
+
+- if (result[ERROR_CODE] != ERROR_SUCCESS) {
+- logger().warning("Could not open windows "
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegOpenKey(...) returned error code " +
+- result[ERROR_CODE] + ".");
++ if (result[ERROR_CODE] != ERROR_SUCCESS) {
++ logger().warning("Could not open windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegOpenKey(...) returned error code " +
++ result[ERROR_CODE] + ".");
+ result[NATIVE_HANDLE] = NULL_NATIVE_HANDLE;
+ if (result[ERROR_CODE] == ERROR_ACCESS_DENIED) {
+- throw new SecurityException("Could not open windows "
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) +
+- ": Access denied");
++ throw new SecurityException(
++ "Could not open windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) +
++ ": Access denied");
+ }
+- }
+- return result[NATIVE_HANDLE];
++ }
++ return result[NATIVE_HANDLE];
+ } else {
+ return openKey(rootNativeHandle(), windowsAbsolutePath, mask1, mask2);
+ }
+@@ -539,21 +542,21 @@
+ int mask1, int mask2) {
+ /* If the path is short enough open at once. Otherwise split the path */
+ if (windowsRelativePath.length <= MAX_WINDOWS_PATH_LENGTH + 1 ) {
+- int[] result = WindowsRegOpenKey1(nativeHandle,
+- windowsRelativePath, mask1);
+- if (result[ERROR_CODE] == ERROR_ACCESS_DENIED && mask2 != mask1)
+- result = WindowsRegOpenKey1(nativeHandle,
+- windowsRelativePath, mask2);
++ int[] result = WindowsRegOpenKey1(nativeHandle,
++ windowsRelativePath, mask1);
++ if (result[ERROR_CODE] == ERROR_ACCESS_DENIED && mask2 != mask1)
++ result = WindowsRegOpenKey1(nativeHandle,
++ windowsRelativePath, mask2);
+
+- if (result[ERROR_CODE] != ERROR_SUCCESS) {
+- logger().warning("Could not open windows "
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(nativeHandle) +
+- ". Windows RegOpenKey(...) returned error code " +
+- result[ERROR_CODE] + ".");
++ if (result[ERROR_CODE] != ERROR_SUCCESS) {
++ logger().warning("Could not open windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" + Integer.toHexString(nativeHandle) +
++ ". Windows RegOpenKey(...) returned error code " +
++ result[ERROR_CODE] + ".");
+ result[NATIVE_HANDLE] = NULL_NATIVE_HANDLE;
+- }
+- return result[NATIVE_HANDLE];
++ }
++ return result[NATIVE_HANDLE];
+ } else {
+ int separatorPosition = -1;
+ // Be greedy - open the longest possible path
+@@ -595,10 +598,12 @@
+ private void closeKey(int nativeHandle) {
+ int result = WindowsRegCloseKey(nativeHandle);
+ if (result != ERROR_SUCCESS) {
+- logger().warning("Could not close windows "
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegCloseKey(...) returned error code " + result + ".");
++ logger().warning("Could not close windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegCloseKey(...) returned error code " +
++ result + ".");
+ }
+ }
+
+@@ -609,22 +614,25 @@
+ * @see #getSpi(String)
+ */
+ protected void putSpi(String javaName, String value) {
+- int nativeHandle = openKey(KEY_SET_VALUE);
+- if (nativeHandle == NULL_NATIVE_HANDLE) {
+- isBackingStoreAvailable = false;
+- return;
+- }
+- int result = WindowsRegSetValueEx1(nativeHandle,
+- toWindowsName(javaName), toWindowsValueString(value));
+- if (result != ERROR_SUCCESS) {
+- logger().warning("Could not assign value to key " +
+- byteArrayToString(toWindowsName(javaName))+ " at Windows registry node "
+- + byteArrayToString(windowsAbsolutePath()) + " at root 0x"
+- + Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegSetValueEx(...) returned error code " + result + ".");
+- isBackingStoreAvailable = false;
++ int nativeHandle = openKey(KEY_SET_VALUE);
++ if (nativeHandle == NULL_NATIVE_HANDLE) {
++ isBackingStoreAvailable = false;
++ return;
+ }
+- closeKey(nativeHandle);
++ int result = WindowsRegSetValueEx1(nativeHandle,
++ toWindowsName(javaName), toWindowsValueString(value));
++ if (result != ERROR_SUCCESS) {
++ logger().warning("Could not assign value to key " +
++ byteArrayToString(toWindowsName(javaName)) +
++ " at Windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegSetValueEx(...) returned error code " +
++ result + ".");
++ isBackingStoreAvailable = false;
++ }
++ closeKey(nativeHandle);
+ }
+
+ /**
+@@ -663,12 +671,12 @@
+ int result =
+ WindowsRegDeleteValue(nativeHandle, toWindowsName(key));
+ if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) {
+- logger().warning("Could not delete windows registry "
+- + "value " + byteArrayToString(windowsAbsolutePath())+ "\\" +
+- toWindowsName(key) + " at root 0x" +
+- Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegDeleteValue(...) returned error code " +
+- result + ".");
++ logger().warning("Could not delete windows registry value " +
++ byteArrayToString(windowsAbsolutePath()) + "\\" +
++ toWindowsName(key) + " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegDeleteValue(...) returned error code " +
++ result + ".");
+ isBackingStoreAvailable = false;
+ }
+ closeKey(nativeHandle);
+@@ -684,17 +692,20 @@
+ // Find out the number of values
+ int nativeHandle = openKey(KEY_QUERY_VALUE);
+ if (nativeHandle == NULL_NATIVE_HANDLE) {
+- throw new BackingStoreException("Could not open windows"
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) + ".");
++ throw new BackingStoreException(
++ "Could not open windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) + ".");
+ }
+ int[] result = WindowsRegQueryInfoKey1(nativeHandle);
+ if (result[ERROR_CODE] != ERROR_SUCCESS) {
+- String info = "Could not query windows"
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegQueryInfoKeyEx(...) returned error code " +
+- result[ERROR_CODE] + ".";
++ String info = "Could not query windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegQueryInfoKeyEx(...) returned error code " +
++ result[ERROR_CODE] + ".";
+ logger().warning(info);
+ throw new BackingStoreException(info);
+ }
+@@ -703,17 +714,17 @@
+ if (valuesNumber == 0) {
+ closeKey(nativeHandle);
+ return new String[0];
+- }
+- // Get the values
+- String[] valueNames = new String[valuesNumber];
+- for (int i = 0; i < valuesNumber; i++) {
++ }
++ // Get the values
++ String[] valueNames = new String[valuesNumber];
++ for (int i = 0; i < valuesNumber; i++) {
+ byte[] windowsName = WindowsRegEnumValue1(nativeHandle, i,
+- maxValueNameLength+1);
++ maxValueNameLength+1);
+ if (windowsName == null) {
+ String info =
+- "Could not enumerate value #" + i + " of windows node " +
+- byteArrayToString(windowsAbsolutePath()) + " at root 0x" +
+- Integer.toHexString(rootNativeHandle()) + ".";
++ "Could not enumerate value #" + i + " of windows node " +
++ byteArrayToString(windowsAbsolutePath()) + " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) + ".";
+ logger().warning(info);
+ throw new BackingStoreException(info);
+ }
+@@ -731,20 +742,22 @@
+ */
+ protected String[] childrenNamesSpi() throws BackingStoreException {
+ // Open key
+- int nativeHandle = openKey(KEY_ENUMERATE_SUB_KEYS| KEY_QUERY_VALUE);
++ int nativeHandle = openKey(KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE);
+ if (nativeHandle == NULL_NATIVE_HANDLE) {
+- throw new BackingStoreException("Could not open windows"
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) + ".");
++ throw new BackingStoreException(
++ "Could not open windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) + ".");
+ }
+ // Get number of children
+ int[] result = WindowsRegQueryInfoKey1(nativeHandle);
+ if (result[ERROR_CODE] != ERROR_SUCCESS) {
+- String info = "Could not query windows"
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegQueryInfoKeyEx(...) returned error code " +
+- result[ERROR_CODE] + ".";
++ String info = "Could not query windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" + Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegQueryInfoKeyEx(...) returned error code " +
++ result[ERROR_CODE] + ".";
+ logger().warning(info);
+ throw new BackingStoreException(info);
+ }
+@@ -759,12 +772,12 @@
+ // Get children
+ for (int i = 0; i < subKeysNumber; i++) {
+ byte[] windowsName = WindowsRegEnumKeyEx1(nativeHandle, i,
+- maxKeyLength+1);
++ maxKeyLength+1);
+ if (windowsName == null) {
+ String info =
+- "Could not enumerate key #" + i + " of windows node " +
+- byteArrayToString(windowsAbsolutePath()) + " at root 0x" +
+- Integer.toHexString(rootNativeHandle()) + ". ";
++ "Could not enumerate key #" + i + " of windows node " +
++ byteArrayToString(windowsAbsolutePath()) + " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) + ". ";
+ logger().warning(info);
+ throw new BackingStoreException(info);
+ }
+@@ -789,20 +802,24 @@
+ }
+ if (!isBackingStoreAvailable) {
+ throw new BackingStoreException(
+- "flush(): Backing store not available.");
++ "flush(): Backing store not available.");
+ }
+ int nativeHandle = openKey(KEY_READ);
+ if (nativeHandle == NULL_NATIVE_HANDLE) {
+- throw new BackingStoreException("Could not open windows"
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) + ".");
++ throw new BackingStoreException(
++ "Could not open windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) + ".");
+ }
+ int result = WindowsRegFlushKey1(nativeHandle);
+ if (result != ERROR_SUCCESS) {
+- String info = "Could not flush windows "
+- + "registry node " + byteArrayToString(windowsAbsolutePath())
+- + " at root 0x" + Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegFlushKey(...) returned error code " + result + ".";
++ String info = "Could not flush windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegFlushKey(...) returned error code " +
++ result + ".";
+ logger().warning(info);
+ throw new BackingStoreException(info);
+ }
+@@ -829,7 +846,7 @@
+ * Logs a warning message, if Windows Registry is unavailable.
+ */
+ protected AbstractPreferences childSpi(String name) {
+- return new WindowsPreferences(this, name);
++ return new WindowsPreferences(this, name);
+ }
+
+ /**
+@@ -840,20 +857,22 @@
+ */
+ public void removeNodeSpi() throws BackingStoreException {
+ int parentNativeHandle =
+- ((WindowsPreferences)parent()).openKey(DELETE);
++ ((WindowsPreferences)parent()).openKey(DELETE);
+ if (parentNativeHandle == NULL_NATIVE_HANDLE) {
+- throw new BackingStoreException("Could not open parent windows"
+- + "registry node of " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) + ".");
++ throw new BackingStoreException(
++ "Could not open parent windows registry node of " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" +
++ Integer.toHexString(rootNativeHandle()) + ".");
+ }
+ int result =
+ WindowsRegDeleteKey(parentNativeHandle, toWindowsName(name()));
+ if (result != ERROR_SUCCESS) {
+- String info = "Could not delete windows "
+- + "registry node " + byteArrayToString(windowsAbsolutePath()) +
+- " at root 0x" + Integer.toHexString(rootNativeHandle()) +
+- ". Windows RegDeleteKeyEx(...) returned error code " +
+- result + ".";
++ String info = "Could not delete windows registry node " +
++ byteArrayToString(windowsAbsolutePath()) +
++ " at root 0x" + Integer.toHexString(rootNativeHandle()) +
++ ". Windows RegDeleteKeyEx(...) returned error code " +
++ result + ".";
+ logger().warning(info);
+ throw new BackingStoreException(info);
+ }
+@@ -870,23 +889,25 @@
+ private static String toJavaName(byte[] windowsNameArray) {
+ String windowsName = byteArrayToString(windowsNameArray);
+ // check if Alt64
+- if ((windowsName.length()>1) &&
+- (windowsName.substring(0,2).equals("/!"))) {
++ if ((windowsName.length() > 1) &&
++ (windowsName.substring(0, 2).equals("/!"))) {
+ return toJavaAlt64Name(windowsName);
+ }
+- StringBuffer javaName = new StringBuffer();
++ StringBuilder javaName = new StringBuilder();
+ char ch;
+ // Decode from simple encoding
+- for (int i = 0; i < windowsName.length(); i++){
++ for (int i = 0; i < windowsName.length(); i++) {
+ if ((ch = windowsName.charAt(i)) == '/') {
+ char next = ' ';
+ if ((windowsName.length() > i + 1) &&
+- ((next = windowsName.charAt(i+1)) >= 'A') && (next <= 'Z')) {
+- ch = next;
+- i++;
+- } else if ((windowsName.length() > i + 1) && (next == '/')) {
+- ch = '\\';
+- i++;
++ ((next = windowsName.charAt(i+1)) >= 'A') &&
++ (next <= 'Z')) {
++ ch = next;
++ i++;
++ } else if ((windowsName.length() > i + 1) &&
++ (next == '/')) {
++ ch = '\\';
++ i++;
+ }
+ } else if (ch == '\\') {
+ ch = '/';
+@@ -905,8 +926,8 @@
+
+ private static String toJavaAlt64Name(String windowsName) {
+ byte[] byteBuffer =
+- Base64.altBase64ToByteArray(windowsName.substring(2));
+- StringBuffer result = new StringBuffer();
++ Base64.altBase64ToByteArray(windowsName.substring(2));
++ StringBuilder result = new StringBuilder();
+ for (int i = 0; i < byteBuffer.length; i++) {
+ int firstbyte = (byteBuffer[i++] & 0xff);
+ int secondbyte = (byteBuffer[i] & 0xff);
+@@ -936,10 +957,10 @@
+ * Base64 class.
+ */
+ private static byte[] toWindowsName(String javaName) {
+- StringBuffer windowsName = new StringBuffer();
++ StringBuilder windowsName = new StringBuilder();
+ for (int i = 0; i < javaName.length(); i++) {
+- char ch =javaName.charAt(i);
+- if ((ch < 0x0020)||(ch > 0x007f)) {
++ char ch = javaName.charAt(i);
++ if ((ch < 0x0020) || (ch > 0x007f)) {
+ // If a non-trivial character encountered, use altBase64
+ return toWindowsAlt64Name(javaName);
+ }
+@@ -948,7 +969,7 @@
+ } else if (ch == '/') {
+ windowsName.append('\\');
+ } else if ((ch >= 'A') && (ch <='Z')) {
+- windowsName.append("/" + ch);
++ windowsName.append('/').append(ch);
+ } else {
+ windowsName.append(ch);
+ }
+@@ -967,13 +988,13 @@
+ // Convert to byte pairs
+ int counter = 0;
+ for (int i = 0; i < javaName.length();i++) {
+- int ch = javaName.charAt(i);
+- javaNameArray[counter++] = (byte)(ch >>> 8);
+- javaNameArray[counter++] = (byte)ch;
++ int ch = javaName.charAt(i);
++ javaNameArray[counter++] = (byte)(ch >>> 8);
++ javaNameArray[counter++] = (byte)ch;
+ }
+
+- return stringToByteArray(
+- "/!" + Base64.byteArrayToAltBase64(javaNameArray));
++ return stringToByteArray("/!" +
++ Base64.byteArrayToAltBase64(javaNameArray));
+ }
+
+ /**
+@@ -985,30 +1006,31 @@
+ private static String toJavaValueString(byte[] windowsNameArray) {
+ // Use modified native2ascii algorithm
+ String windowsName = byteArrayToString(windowsNameArray);
+- StringBuffer javaName = new StringBuffer();
++ StringBuilder javaName = new StringBuilder();
+ char ch;
+ for (int i = 0; i < windowsName.length(); i++){
+ if ((ch = windowsName.charAt(i)) == '/') {
+ char next = ' ';
+
+ if (windowsName.length() > i + 1 &&
+- (next = windowsName.charAt(i + 1)) == 'u') {
+- if (windowsName.length() < i + 6){
++ (next = windowsName.charAt(i + 1)) == 'u') {
++ if (windowsName.length() < i + 6) {
+ break;
+ } else {
+- ch = (char)Integer.parseInt
+- (windowsName.substring(i + 2, i + 6), 16);
++ ch = (char)Integer.parseInt(
++ windowsName.substring(i + 2, i + 6), 16);
+ i += 5;
+ }
+ } else
+ if ((windowsName.length() > i + 1) &&
+- ((windowsName.charAt(i+1)) >= 'A') && (next <= 'Z')) {
+- ch = next;
+- i++;
+- } else if ((windowsName.length() > i + 1) &&
+- (next == '/')) {
+- ch = '\\';
+- i++;
++ ((windowsName.charAt(i+1)) >= 'A') &&
++ (next <= 'Z')) {
++ ch = next;
++ i++;
++ } else if ((windowsName.length() > i + 1) &&
++ (next == '/')) {
++ ch = '\\';
++ i++;
+ }
+ } else if (ch == '\\') {
+ ch = '/';
+@@ -1028,14 +1050,14 @@
+ * to convert java string to a byte array of ASCII characters.
+ */
+ private static byte[] toWindowsValueString(String javaName) {
+- StringBuffer windowsName = new StringBuffer();
++ StringBuilder windowsName = new StringBuilder();
+ for (int i = 0; i < javaName.length(); i++) {
+- char ch =javaName.charAt(i);
+- if ((ch < 0x0020)||(ch > 0x007f)){
++ char ch = javaName.charAt(i);
++ if ((ch < 0x0020) || (ch > 0x007f)){
+ // write \udddd
+ windowsName.append("/u");
+ String hex = Integer.toHexString(javaName.charAt(i));
+- StringBuffer hex4 = new StringBuffer(hex);
++ StringBuilder hex4 = new StringBuilder(hex);
+ hex4.reverse();
+ int len = 4 - hex4.length();
+ for (int j = 0; j < len; j++){
+@@ -1049,7 +1071,7 @@
+ } else if (ch == '/') {
+ windowsName.append('\\');
+ } else if ((ch >= 'A') && (ch <='Z')) {
+- windowsName.append("/" + ch);
++ windowsName.append('/').append(ch);
+ } else {
+ windowsName.append(ch);
+ }
+@@ -1061,8 +1083,9 @@
+ * Returns native handle for the top Windows node for this node.
+ */
+ private int rootNativeHandle() {
+- return (isUserNode()? USER_ROOT_NATIVE_HANDLE :
+- SYSTEM_ROOT_NATIVE_HANDLE);
++ return (isUserNode()
++ ? USER_ROOT_NATIVE_HANDLE
++ : SYSTEM_ROOT_NATIVE_HANDLE);
+ }
+
+ /**
+@@ -1081,7 +1104,7 @@
+ * Converts a null-terminated byte array to java string
+ */
+ private static String byteArrayToString(byte[] array) {
+- StringBuffer result = new StringBuffer();
++ StringBuilder result = new StringBuilder();
+ for (int i = 0; i < array.length - 1; i++) {
+ result.append((char)array[i]);
+ }
+--- ./jdk/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2014, 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
+@@ -51,6 +51,11 @@
+ private static int pScale = 0;
+ private static final int MAX_BAND_SIZE = (1024*30);
+
++ /**
++ * This flag is set to {@code true} if this embedded frame is hosted by Internet Explorer.
++ */
++ private boolean isEmbeddedInIE = false;
++
+ private static String printScale = AccessController.doPrivileged(
+ new GetPropertyAction("sun.java2d.print.pluginscalefactor"));
+
+@@ -243,6 +248,14 @@
+ }
+ }
+
++ @SuppressWarnings("deprecation")
++ public boolean requestFocusToEmbedder() {
++ if (isEmbeddedInIE) {
++ return ((WEmbeddedFramePeer) getPeer()).requestFocusToEmbedder();
++ }
++ return false;
++ }
++
+ public void registerAccelerator(AWTKeyStroke stroke) {}
+ public void unregisterAccelerator(AWTKeyStroke stroke) {}
+
+--- ./jdk/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2014, 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
+@@ -78,4 +78,11 @@
+ // false on other systems.
+ return !Win32GraphicsEnvironment.isDWMCompositionEnabled();
+ }
++
++ /**
++ * Sets the focus to plugin control window, the parent of embedded frame.
++ * Eventually, it will synthesizeWindowActivation to activate the embedded frame,
++ * if plugin control window gets the focus.
++ */
++ public native boolean requestFocusToEmbedder();
+ }
+--- ./jdk/src/windows/classes/sun/nio/ch/FileDispatcherImpl.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/classes/sun/nio/ch/FileDispatcherImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -25,15 +25,16 @@
+
+ package sun.nio.ch;
+
+-import java.io.*;
++import java.io.FileDescriptor;
++import java.io.IOException;
++import java.security.PrivilegedAction;
+ import sun.misc.SharedSecrets;
+ import sun.misc.JavaIOFileDescriptorAccess;
+
+-class FileDispatcherImpl extends FileDispatcher
+-{
+- static {
+- IOUtil.load();
+- }
++class FileDispatcherImpl extends FileDispatcher {
++
++ // set to true if fast file transmission (TransmitFile) is enabled
++ private static final boolean fastFileTransfer;
+
+ /**
+ * Indicates if the dispatcher should first advance the file position
+@@ -120,6 +121,36 @@
+ return result;
+ }
+
++ boolean canTransferToDirectly(java.nio.channels.SelectableChannel sc) {
++ return fastFileTransfer && sc.isBlocking();
++ }
++
++ boolean transferToDirectlyNeedsPositionLock() {
++ return true;
++ }
++
++ static boolean isFastFileTransferRequested() {
++ String fileTransferProp = java.security.AccessController.doPrivileged(
++ new PrivilegedAction<String>() {
++ @Override
++ public String run() {
++ return System.getProperty("jdk.nio.enableFastFileTransfer");
++ }
++ });
++ boolean enable;
++ if ("".equals(fileTransferProp)) {
++ enable = true;
++ } else {
++ enable = Boolean.parseBoolean(fileTransferProp);
++ }
++ return enable;
++ }
++
++ static {
++ IOUtil.load();
++ fastFileTransfer = isFastFileTransferRequested();
++ }
++
+ //-- Native methods
+
+ static native int read0(FileDescriptor fd, long address, int len)
+--- ./jdk/src/windows/classes/sun/security/mscapi/KeyStore.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/classes/sun/security/mscapi/KeyStore.java Wed Jul 01 21:53:30 2015 -0700
+@@ -41,12 +41,7 @@
+ import java.security.cert.CertificateException;
+ import java.security.cert.CertificateFactory;
+ import java.security.interfaces.RSAPrivateCrtKey;
+-import java.util.ArrayList;
+-import java.util.Collection;
+-import java.util.Date;
+-import java.util.Enumeration;
+-import java.util.Iterator;
+-import java.util.UUID;
++import java.util.*;
+
+ import sun.security.action.GetPropertyAction;
+
+@@ -142,7 +137,7 @@
+ key.getPrimeExponentQ().toByteArray(),
+ key.getCrtCoefficient().toByteArray());
+
+- privateKey = storePrivateKey(keyBlob,
++ privateKey = storePrivateKey(Objects.requireNonNull(keyBlob),
+ "{" + UUID.randomUUID().toString() + "}", keyBitLength);
+ }
+
+--- ./jdk/src/windows/native/java/io/FileDescriptor_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/io/FileDescriptor_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -48,8 +48,8 @@
+
+ JNIEXPORT void JNICALL
+ Java_java_io_FileDescriptor_initIDs(JNIEnv *env, jclass fdClass) {
+- IO_fd_fdID = (*env)->GetFieldID(env, fdClass, "fd", "I");
+- IO_handle_fdID = (*env)->GetFieldID(env, fdClass, "handle", "J");
++ CHECK_NULL(IO_fd_fdID = (*env)->GetFieldID(env, fdClass, "fd", "I"));
++ CHECK_NULL(IO_handle_fdID = (*env)->GetFieldID(env, fdClass, "handle", "J"));
+ }
+
+ JNIEXPORT jlong JNICALL
+--- ./jdk/src/windows/native/java/io/WinNTFileSystem_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/io/WinNTFileSystem_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -59,10 +59,12 @@
+ Java_java_io_WinNTFileSystem_initIDs(JNIEnv *env, jclass cls)
+ {
+ HMODULE handle;
+- jclass fileClass = (*env)->FindClass(env, "java/io/File");
+- if (!fileClass) return;
+- ids.path =
+- (*env)->GetFieldID(env, fileClass, "path", "Ljava/lang/String;");
++ jclass fileClass;
++
++ fileClass = (*env)->FindClass(env, "java/io/File");
++ CHECK_NULL(fileClass);
++ ids.path = (*env)->GetFieldID(env, fileClass, "path", "Ljava/lang/String;");
++ CHECK_NULL(ids.path);
+
+ // GetFinalPathNameByHandle requires Windows Vista or newer
+ if (GetModuleHandleExW((GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+@@ -247,8 +249,8 @@
+ WCHAR canonicalPath[MAX_PATH_LENGTH];
+
+ WITH_UNICODE_STRING(env, pathname, path) {
+- /*we estimate the max length of memory needed as
+- "currentDir. length + pathname.length"
++ /* we estimate the max length of memory needed as
++ "currentDir. length + pathname.length"
+ */
+ int len = (int)wcslen(path);
+ len += currentDirLength(path, len);
+@@ -262,12 +264,11 @@
+ } else {
+ JNU_ThrowOutOfMemoryError(env, "native memory allocation failed");
+ }
+- } else
+- if (wcanonicalize(path, canonicalPath, MAX_PATH_LENGTH) >= 0) {
++ } else if (wcanonicalize(path, canonicalPath, MAX_PATH_LENGTH) >= 0) {
+ rv = (*env)->NewString(env, canonicalPath, (jsize)wcslen(canonicalPath));
+ }
+ } END_UNICODE_STRING(env, path);
+- if (rv == NULL) {
++ if (rv == NULL && !(*env)->ExceptionCheck(env)) {
+ JNU_ThrowIOExceptionWithLastError(env, "Bad pathname");
+ }
+ return rv;
+@@ -296,15 +297,14 @@
+ } else {
+ JNU_ThrowOutOfMemoryError(env, "native memory allocation failed");
+ }
+- } else
+- if (wcanonicalizeWithPrefix(canonicalPrefix,
+- pathWithCanonicalPrefix,
+- canonicalPath, MAX_PATH_LENGTH) >= 0) {
++ } else if (wcanonicalizeWithPrefix(canonicalPrefix,
++ pathWithCanonicalPrefix,
++ canonicalPath, MAX_PATH_LENGTH) >= 0) {
+ rv = (*env)->NewString(env, canonicalPath, (jsize)wcslen(canonicalPath));
+ }
+ } END_UNICODE_STRING(env, pathWithCanonicalPrefix);
+ } END_UNICODE_STRING(env, canonicalPrefix);
+- if (rv == NULL) {
++ if (rv == NULL && !(*env)->ExceptionCheck(env)) {
+ JNU_ThrowIOExceptionWithLastError(env, "Bad pathname");
+ }
+ return rv;
+@@ -624,8 +624,13 @@
+ jobjectArray rv, old;
+ DWORD fattr;
+ jstring name;
++ jclass str_class;
++ WCHAR *pathbuf;
+
+- WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
++ str_class = JNU_ClassString(env);
++ CHECK_NULL_RETURN(str_class, NULL);
++
++ pathbuf = fileToNTPath(env, file, ids.path);
+ if (pathbuf == NULL)
+ return NULL;
+ search_path = (WCHAR*)malloc(2*wcslen(pathbuf) + 6);
+@@ -673,7 +678,7 @@
+ return NULL;
+ } else {
+ // No files found - return an empty array
+- rv = (*env)->NewObjectArray(env, 0, JNU_ClassString(env), NULL);
++ rv = (*env)->NewObjectArray(env, 0, str_class, NULL);
+ return rv;
+ }
+ }
+@@ -681,7 +686,7 @@
+ /* Allocate an initial String array */
+ len = 0;
+ maxlen = 16;
+- rv = (*env)->NewObjectArray(env, maxlen, JNU_ClassString(env), NULL);
++ rv = (*env)->NewObjectArray(env, maxlen, str_class, NULL);
+ if (rv == NULL) // Couldn't allocate an array
+ return NULL;
+ /* Scan the directory */
+@@ -695,10 +700,8 @@
+ return NULL; // error;
+ if (len == maxlen) {
+ old = rv;
+- rv = (*env)->NewObjectArray(env, maxlen <<= 1,
+- JNU_ClassString(env), NULL);
+- if ( rv == NULL
+- || JNU_CopyObjectArray(env, rv, old, len) < 0)
++ rv = (*env)->NewObjectArray(env, maxlen <<= 1, str_class, NULL);
++ if (rv == NULL || JNU_CopyObjectArray(env, rv, old, len) < 0)
+ return NULL; // error
+ (*env)->DeleteLocalRef(env, old);
+ }
+@@ -713,7 +716,7 @@
+
+ /* Copy the final results into an appropriately-sized array */
+ old = rv;
+- rv = (*env)->NewObjectArray(env, len, JNU_ClassString(env), NULL);
++ rv = (*env)->NewObjectArray(env, len, str_class, NULL);
+ if (rv == NULL)
+ return NULL; /* error */
+ if (JNU_CopyObjectArray(env, rv, old, len) < 0)
+--- ./jdk/src/windows/native/java/lang/ProcessImpl_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/lang/ProcessImpl_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -272,14 +272,10 @@
+ FALSE, FALSE, FALSE,
+ FALSE, FALSE, FALSE};
+
+- {
+- /* Extraction of current process standard IOE handles */
+- DWORD idsIOE[3] = {STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, STD_ERROR_HANDLE};
+- int i;
+- for (i = 0; i < 3; ++i)
+- /* Should not be closed by CloseHandle! */
+- stdIOE[i] = GetStdHandle(idsIOE[i]);
+- }
++ /* These three should not be closed by CloseHandle! */
++ stdIOE[0] = GetStdHandle(STD_INPUT_HANDLE);
++ stdIOE[1] = GetStdHandle(STD_OUTPUT_HANDLE);
++ stdIOE[2] = GetStdHandle(STD_ERROR_HANDLE);
+
+ prepareIOEHandleState(stdIOE, inherit);
+ {
+@@ -308,11 +304,16 @@
+
+ if (success) {
+ PROCESS_INFORMATION pi;
+- DWORD processFlag = CREATE_UNICODE_ENVIRONMENT;
++ DWORD processFlag = CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT;
+
+- /* Suppress popping-up of a console window for non-console applications */
+- if (GetConsoleWindow() == NULL)
+- processFlag |= CREATE_NO_WINDOW;
++ /* If the standard I/O is inherited, CREATE_NO_WINDOW must not be used. */
++ if (GetConsoleWindow() != NULL &&
++ (si.hStdInput == stdIOE[0] ||
++ si.hStdOutput == stdIOE[1] ||
++ si.hStdError == (redirectErrorStream ? stdIOE[1] : stdIOE[2])))
++ {
++ processFlag &= ~CREATE_NO_WINDOW;
++ }
+
+ si.dwFlags = STARTF_USESTDHANDLES;
+ if (!CreateProcessW(
+--- ./jdk/src/windows/native/java/lang/java_props_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/lang/java_props_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -348,8 +348,8 @@
+ GetJavaProperties(JNIEnv* env)
+ {
+ static java_props_t sprops = {0};
+-
+- OSVERSIONINFOEX ver;
++ int majorVersion;
++ int minorVersion;
+
+ if (sprops.line_separator) {
+ return &sprops;
+@@ -380,21 +380,67 @@
+ /* OS properties */
+ {
+ char buf[100];
+- SYSTEM_INFO si;
+- PGNSI pGNSI;
++ boolean is_workstation;
++ boolean is_64bit;
++ DWORD platformId;
++ {
++ OSVERSIONINFOEX ver;
++ ver.dwOSVersionInfoSize = sizeof(ver);
++ GetVersionEx((OSVERSIONINFO *) &ver);
++ majorVersion = ver.dwMajorVersion;
++ minorVersion = ver.dwMinorVersion;
++ is_workstation = (ver.wProductType == VER_NT_WORKSTATION);
++ platformId = ver.dwPlatformId;
++ sprops.patch_level = _strdup(ver.szCSDVersion);
++ }
+
+- ver.dwOSVersionInfoSize = sizeof(ver);
+- GetVersionEx((OSVERSIONINFO *) &ver);
++ {
++ SYSTEM_INFO si;
++ ZeroMemory(&si, sizeof(SYSTEM_INFO));
++ GetNativeSystemInfo(&si);
+
+- ZeroMemory(&si, sizeof(SYSTEM_INFO));
+- // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.
+- pGNSI = (PGNSI) GetProcAddress(
+- GetModuleHandle(TEXT("kernel32.dll")),
+- "GetNativeSystemInfo");
+- if(NULL != pGNSI)
+- pGNSI(&si);
+- else
+- GetSystemInfo(&si);
++ is_64bit = (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64);
++ }
++ do {
++ // Read the major and minor version number from kernel32.dll
++ VS_FIXEDFILEINFO *file_info;
++ WCHAR kernel32_path[MAX_PATH];
++ DWORD version_size;
++ LPTSTR version_info;
++ UINT len, ret;
++
++ // Get the full path to \Windows\System32\kernel32.dll and use that for
++ // determining what version of Windows we're running on.
++ len = MAX_PATH - (UINT)strlen("\\kernel32.dll") - 1;
++ ret = GetSystemDirectoryW(kernel32_path, len);
++ if (ret == 0 || ret > len) {
++ break;
++ }
++ wcsncat(kernel32_path, L"\\kernel32.dll", MAX_PATH - ret);
++
++ version_size = GetFileVersionInfoSizeW(kernel32_path, NULL);
++ if (version_size == 0) {
++ break;
++ }
++
++ version_info = (LPTSTR)malloc(version_size);
++ if (version_info == NULL) {
++ break;
++ }
++
++ if (!GetFileVersionInfoW(kernel32_path, 0, version_size, version_info)) {
++ free(version_info);
++ break;
++ }
++
++ if (!VerQueryValueW(version_info, L"\\", (LPVOID*)&file_info, &len)) {
++ free(version_info);
++ break;
++ }
++ majorVersion = HIWORD(file_info->dwProductVersionMS);
++ minorVersion = LOWORD(file_info->dwProductVersionMS);
++ free(version_info);
++ } while (0);
+
+ /*
+ * From msdn page on OSVERSIONINFOEX, current as of this
+@@ -420,17 +466,15 @@
+ * Windows Server 2008 R2 6 1 (!VER_NT_WORKSTATION)
+ * Windows 8 6 2 (VER_NT_WORKSTATION)
+ * Windows Server 2012 6 2 (!VER_NT_WORKSTATION)
++ * Windows 10 10 0 (VER_NT_WORKSTATION)
+ *
+ * This mapping will presumably be augmented as new Windows
+ * versions are released.
+ */
+- switch (ver.dwPlatformId) {
+- case VER_PLATFORM_WIN32s:
+- sprops.os_name = "Windows 3.1";
+- break;
++ switch (platformId) {
+ case VER_PLATFORM_WIN32_WINDOWS:
+- if (ver.dwMajorVersion == 4) {
+- switch (ver.dwMinorVersion) {
++ if (majorVersion == 4) {
++ switch (minorVersion) {
+ case 0: sprops.os_name = "Windows 95"; break;
+ case 10: sprops.os_name = "Windows 98"; break;
+ case 90: sprops.os_name = "Windows Me"; break;
+@@ -441,10 +485,10 @@
+ }
+ break;
+ case VER_PLATFORM_WIN32_NT:
+- if (ver.dwMajorVersion <= 4) {
++ if (majorVersion <= 4) {
+ sprops.os_name = "Windows NT";
+- } else if (ver.dwMajorVersion == 5) {
+- switch (ver.dwMinorVersion) {
++ } else if (majorVersion == 5) {
++ switch (minorVersion) {
+ case 0: sprops.os_name = "Windows 2000"; break;
+ case 1: sprops.os_name = "Windows XP"; break;
+ case 2:
+@@ -459,8 +503,7 @@
+ * If it is, the operating system is Windows XP 64 bit;
+ * otherwise, it is Windows Server 2003."
+ */
+- if(ver.wProductType == VER_NT_WORKSTATION &&
+- si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
++ if (is_workstation && is_64bit) {
+ sprops.os_name = "Windows XP"; /* 64 bit */
+ } else {
+ sprops.os_name = "Windows 2003";
+@@ -468,12 +511,12 @@
+ break;
+ default: sprops.os_name = "Windows NT (unknown)"; break;
+ }
+- } else if (ver.dwMajorVersion == 6) {
++ } else if (majorVersion == 6) {
+ /*
+ * See table in MSDN OSVERSIONINFOEX documentation.
+ */
+- if (ver.wProductType == VER_NT_WORKSTATION) {
+- switch (ver.dwMinorVersion) {
++ if (is_workstation) {
++ switch (minorVersion) {
+ case 0: sprops.os_name = "Windows Vista"; break;
+ case 1: sprops.os_name = "Windows 7"; break;
+ case 2: sprops.os_name = "Windows 8"; break;
+@@ -481,7 +524,7 @@
+ default: sprops.os_name = "Windows NT (unknown)";
+ }
+ } else {
+- switch (ver.dwMinorVersion) {
++ switch (minorVersion) {
+ case 0: sprops.os_name = "Windows Server 2008"; break;
+ case 1: sprops.os_name = "Windows Server 2008 R2"; break;
+ case 2: sprops.os_name = "Windows Server 2012"; break;
+@@ -489,6 +532,17 @@
+ default: sprops.os_name = "Windows NT (unknown)";
+ }
+ }
++ } else if (majorVersion == 10) {
++ if (is_workstation) {
++ switch (minorVersion) {
++ case 0: sprops.os_name = "Windows 10"; break;
++ default: sprops.os_name = "Windows NT (unknown)";
++ }
++ } else {
++ switch (minorVersion) {
++ default: sprops.os_name = "Windows NT (unknown)";
++ }
++ }
+ } else {
+ sprops.os_name = "Windows NT (unknown)";
+ }
+@@ -497,7 +551,7 @@
+ sprops.os_name = "Windows (unknown)";
+ break;
+ }
+- sprintf(buf, "%d.%d", ver.dwMajorVersion, ver.dwMinorVersion);
++ sprintf(buf, "%d.%d", majorVersion, minorVersion);
+ sprops.os_version = _strdup(buf);
+ #if _M_IA64
+ sprops.os_arch = "ia64";
+@@ -508,9 +562,6 @@
+ #else
+ sprops.os_arch = "unknown";
+ #endif
+-
+- sprops.patch_level = _strdup(ver.szCSDVersion);
+-
+ sprops.desktop = "windows";
+ }
+
+@@ -621,7 +672,7 @@
+ &display_encoding);
+
+ sprops.sun_jnu_encoding = getEncodingInternal(systemDefaultLCID);
+- if (LANGIDFROMLCID(userDefaultLCID) == 0x0c04 && ver.dwMajorVersion == 6) {
++ if (LANGIDFROMLCID(userDefaultLCID) == 0x0c04 && majorVersion == 6) {
+ // MS claims "Vista has built-in support for HKSCS-2004.
+ // All of the HKSCS-2004 characters have Unicode 4.1.
+ // PUA code point assignments". But what it really means
+--- ./jdk/src/windows/native/java/net/DualStackPlainDatagramSocketImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/net/DualStackPlainDatagramSocketImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -462,7 +462,7 @@
+ */
+ JNIEXPORT void JNICALL Java_java_net_DualStackPlainDatagramSocketImpl_socketSetIntOption
+ (JNIEnv *env, jclass clazz, jint fd , jint cmd, jint value) {
+- int level, opt;
++ int level = 0, opt = 0;
+
+ if (NET_MapSocketOption(cmd, &level, &opt) < 0) {
+ JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
+@@ -482,7 +482,7 @@
+ */
+ JNIEXPORT jint JNICALL Java_java_net_DualStackPlainDatagramSocketImpl_socketGetIntOption
+ (JNIEnv *env, jclass clazz, jint fd, jint cmd) {
+- int level, opt, result=0;
++ int level = 0, opt = 0, result=0;
+ int result_len = sizeof(result);
+
+ if (NET_MapSocketOption(cmd, &level, &opt) < 0) {
+--- ./jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -294,6 +294,8 @@
+ return -1;
+ }
+
++ SetHandleInformation((HANDLE)(UINT_PTR)newfd, HANDLE_FLAG_INHERIT, 0);
++
+ ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
+ isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
+ (*env)->SetObjectArrayElement(env, isaa, 0, isa);
+@@ -367,8 +369,8 @@
+ JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_setIntOption
+ (JNIEnv *env, jclass clazz, jint fd, jint cmd, jint value) {
+
+- int level, opt;
+- struct linger linger;
++ int level = 0, opt = 0;
++ struct linger linger = {0, 0};
+ char *parg;
+ int arglen;
+
+@@ -407,9 +409,9 @@
+ JNIEXPORT jint JNICALL Java_java_net_DualStackPlainSocketImpl_getIntOption
+ (JNIEnv *env, jclass clazz, jint fd, jint cmd) {
+
+- int level, opt;
++ int level = 0, opt = 0;
+ int result=0;
+- struct linger linger;
++ struct linger linger = {0, 0};
+ char *arg;
+ int arglen;
+
+--- ./jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -335,6 +335,8 @@
+ struct sockaddr_in rmtaddr;
+ int addrlen = sizeof(rmtaddr);
+
++ memset((char *)&rmtaddr, 0, sizeof(rmtaddr));
++
+ /*
+ * A no-op if this OS doesn't support it.
+ */
+@@ -431,9 +433,11 @@
+ int ipv6_supported = ipv6_available();
+
+ SOCKETADDRESS lcladdr;
+- int lcladdrlen;
++ int lcladdrlen = sizeof(lcladdr);
+ int address;
+
++ memset((char *)&lcladdr, 0, sizeof(lcladdr));
++
+ family = getInetAddress_family(env, addressObj);
+ if (family == IPv6 && !ipv6_supported) {
+ JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
+@@ -617,7 +621,7 @@
+ }
+ fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
+
+- memset(&addr, 0, len);
++ memset((char *)&addr, 0, len);
+ connect(fd, (struct sockaddr *)&addr, len);
+
+ /*
+@@ -625,7 +629,7 @@
+ * to disable ICMP port unreachable handling here.
+ */
+ if (xp_or_later) {
+- DWORD x1, x2; /* ignored result codes */
++ DWORD x1 = 0, x2 = 0; /* ignored result codes */
+ int t = FALSE;
+ WSAIoctl(fd,SIO_UDP_CONNRESET,&t,sizeof(t),&x1,sizeof(x1),&x2,0,0);
+ }
+@@ -655,8 +659,9 @@
+
+ SOCKETADDRESS rmtaddr;
+ SOCKETADDRESS *addrp = &rmtaddr;
+- int addrlen;
++ int addrlen = 0;
+
++ memset((char *)&rmtaddr, 0, sizeof(rmtaddr));
+
+ if (IS_NULL(packet)) {
+ JNU_ThrowNullPointerException(env, "null packet");
+@@ -1444,7 +1449,7 @@
+ } else if (n < 0) {
+ NET_ThrowCurrent(env, "Datagram receive failed");
+ } else {
+- int port;
++ int port = 0;
+ jobject packetAddress;
+
+ /*
+@@ -1822,11 +1827,11 @@
+ jint opt,jobject value) {
+
+ int fd=-1, fd1=-1;
+- int levelv4, levelv6, optnamev4, optnamev6, optlen;
++ int levelv4 = 0, levelv6 = 0, optnamev4 = 0, optnamev6 = 0, optlen = 0;
+ union {
+ int i;
+ char c;
+- } optval;
++ } optval = { 0 };
+ int ipv6_supported = ipv6_available();
+ fd = getFD(env, this);
+
+@@ -2193,7 +2198,7 @@
+ int level, optname, optlen;
+ union {
+ int i;
+- } optval;
++ } optval = {0};
+ int ipv6_supported = ipv6_available();
+
+ fd = getFD(env, this);
+@@ -2444,12 +2449,15 @@
+ struct ipv6_mreq mname6;
+
+ struct in_addr in;
+- DWORD ifindex;
++ DWORD ifindex = 0;
+
+ int len, family;
+ int ipv6_supported = ipv6_available();
+ int cmd ;
+
++ memset((char *)&in, 0, sizeof(in));
++ memset((char *)&name, 0, sizeof(name));
++
+ if (IS_NULL(fdObj) && IS_NULL(fd1Obj)) {
+ JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
+ "Socket closed");
+--- ./jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -208,6 +208,7 @@
+
+ /* The result of the connection */
+ int connect_res;
++ memset((char *)&him, 0, sizeof(him));
+
+ if (!IS_NULL(fdObj)) {
+ fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
+@@ -400,7 +401,7 @@
+ /* fdObj is the FileDescriptor field on this */
+ jobject fdObj, fd1Obj;
+ /* fd is an int field on fdObj */
+- int fd, fd1, len;
++ int fd, fd1, len = 0;
+ int ipv6_supported = ipv6_available();
+
+ /* family is an int field of iaObj */
+@@ -700,6 +701,7 @@
+ }
+ return;
+ }
++ SetHandleInformation((HANDLE)(UINT_PTR)fd, HANDLE_FLAG_INHERIT, 0);
+ (*env)->SetIntField(env, socketFdObj, IO_fd_fdID, fd);
+
+ if (him.him.sa_family == AF_INET) {
+@@ -843,12 +845,13 @@
+ jint cmd, jboolean on,
+ jobject value) {
+ int fd, fd1;
+- int level, optname, optlen;
++ int level = 0, optname = 0, optlen = 0;
+ union {
+ int i;
+ struct linger ling;
+ } optval;
+
++ memset((char *)&optval, 0, sizeof(optval));
+ /*
+ * Get SOCKET and check that it hasn't been closed
+ */
+@@ -1009,17 +1012,17 @@
+ jint opt, jobject iaContainerObj) {
+
+ int fd, fd1;
+- int level, optname, optlen;
++ int level = 0, optname = 0, optlen = 0;
+ union {
+ int i;
+ struct linger ling;
+ } optval;
+-
+ /*
+ * Get SOCKET and check it hasn't been closed
+ */
+ fd = getFD(env, this);
+ fd1 = getFD1(env, this);
++ memset((char *)&optval, 0, sizeof(optval));
+
+ if (fd < 0 && fd1 < 0) {
+ JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
+@@ -1043,6 +1046,7 @@
+ jfieldID iaFieldID;
+
+ len = sizeof(him);
++ memset((char *)&him, 0, len);
+
+ if (fd == -1) {
+ /* must be an IPV6 only socket. Case where both sockets are != -1
+--- ./jdk/src/windows/native/java/net/net_util_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/net/net_util_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -29,6 +29,9 @@
+ #include "net_util.h"
+ #include "jni.h"
+
++// Taken from mstcpip.h in Windows SDK 8.0 or newer.
++#define SIO_LOOPBACK_FAST_PATH _WSAIOW(IOC_VENDOR,16)
++
+ #ifndef IPTOS_TOS_MASK
+ #define IPTOS_TOS_MASK 0x1e
+ #endif
+@@ -386,8 +389,8 @@
+ NET_SetSockOpt(int s, int level, int optname, const void *optval,
+ int optlen)
+ {
+- int rv;
+- int parg;
++ int rv = 0;
++ int parg = 0;
+ int plen = sizeof(parg);
+
+ if (level == IPPROTO_IP && optname == IP_TOS) {
+@@ -478,7 +481,7 @@
+ * Sets SO_ECLUSIVEADDRUSE if SO_REUSEADDR is not already set.
+ */
+ void setExclusiveBind(int fd) {
+- int parg;
++ int parg = 0;
+ int plen = sizeof(parg);
+ int rv = 0;
+ rv = NET_GetSockOpt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&parg, &plen);
+@@ -499,7 +502,7 @@
+ JNIEXPORT int JNICALL
+ NET_Bind(int s, struct sockaddr *him, int len)
+ {
+- int rv;
++ int rv = 0;
+ rv = bind(s, him, len);
+
+ if (rv == SOCKET_ERROR) {
+@@ -529,8 +532,8 @@
+
+ JNIEXPORT int JNICALL
+ NET_SocketClose(int fd) {
+- struct linger l;
+- int ret;
++ struct linger l = {0, 0};
++ int ret = 0;
+ int len = sizeof (l);
+ if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) {
+ if (l.l_onoff == 0) {
+@@ -844,6 +847,25 @@
+ }
+ }
+
++/**
++ * Enables SIO_LOOPBACK_FAST_PATH
++ */
++JNIEXPORT jint JNICALL
++NET_EnableFastTcpLoopback(int fd) {
++ int enabled = 1;
++ DWORD result_byte_count = -1;
++ int result = WSAIoctl(fd,
++ SIO_LOOPBACK_FAST_PATH,
++ &enabled,
++ sizeof(enabled),
++ NULL,
++ 0,
++ &result_byte_count,
++ NULL,
++ NULL);
++ return result == SOCKET_ERROR ? WSAGetLastError() : 0;
++}
++
+ /* If address types is IPv6, then IPv6 must be available. Otherwise
+ * no address can be generated. In the case of an IPv4 Inetaddress this
+ * method will return an IPv4 mapped address where IPv6 is available and
+--- ./jdk/src/windows/native/java/util/TimeZone_md.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/java/util/TimeZone_md.c Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -28,6 +28,7 @@
+ #include <stdlib.h>
+ #include "jvm.h"
+ #include "TimeZone_md.h"
++#include "jdk_util.h"
+
+ #define VALUE_UNKNOWN 0
+ #define VALUE_KEY 1
+@@ -49,6 +50,20 @@
+ SYSTEMTIME dstDate;
+ } TziValue;
+
++#if _WIN32_WINNT < 0x0600 /* < _WIN32_WINNT_VISTA */
++typedef struct _TIME_DYNAMIC_ZONE_INFORMATION {
++ LONG Bias;
++ WCHAR StandardName[32];
++ SYSTEMTIME StandardDate;
++ LONG StandardBias;
++ WCHAR DaylightName[32];
++ SYSTEMTIME DaylightDate;
++ LONG DaylightBias;
++ WCHAR TimeZoneKeyName[128];
++ BOOLEAN DynamicDaylightTimeDisabled;
++} DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION;
++#endif
++
+ /*
+ * Registry key names
+ */
+@@ -143,6 +158,33 @@
+ }
+
+ /*
++ * Use NO_DYNAMIC_TIME_ZONE_INFO as the return value indicating that no
++ * dynamic time zone information is available.
++ */
++#define NO_DYNAMIC_TIME_ZONE_INFO (-128)
++
++static int getDynamicTimeZoneInfo(PDYNAMIC_TIME_ZONE_INFORMATION pdtzi) {
++ DWORD timeType = NO_DYNAMIC_TIME_ZONE_INFO;
++ HMODULE dllHandle;
++
++ /*
++ * Dynamically load the dll to call GetDynamicTimeZoneInformation.
++ */
++ dllHandle = JDK_LoadSystemLibrary("Kernel32.dll");
++ if (dllHandle != NULL) {
++ typedef DWORD (WINAPI *GetDynamicTimezoneInfoType)(PDYNAMIC_TIME_ZONE_INFORMATION);
++ GetDynamicTimezoneInfoType getDynamicTimeZoneInfoFunc =
++ (GetDynamicTimezoneInfoType) GetProcAddress(dllHandle,
++ "GetDynamicTimeZoneInformation");
++
++ if (getDynamicTimeZoneInfo != NULL) {
++ timeType = getDynamicTimeZoneInfoFunc(pdtzi);
++ }
++ }
++ return timeType;
++}
++
++/*
+ * Gets the current time zone entry in the "Time Zones" registry.
+ */
+ static int getWinTimeZone(char *winZoneName, char *winMapID)
+@@ -161,23 +203,96 @@
+ WCHAR *stdNamePtr = tzi.StandardName;
+ DWORD valueSize;
+ DWORD timeType;
+- int isVista;
++ int isVistaOrLater;
+
+ /*
+- * Get the current time zone setting of the platform.
++ * Determine if this is a Vista or later.
++ */
++ ver.dwOSVersionInfoSize = sizeof(ver);
++ GetVersionEx(&ver);
++ isVistaOrLater = (ver.dwMajorVersion >= 6);
++
++ if (isVistaOrLater) {
++ DYNAMIC_TIME_ZONE_INFORMATION dtzi;
++ DWORD bufSize;
++ DWORD val;
++
++ /*
++ * Get the dynamic time zone information, if available, so that time
++ * zone redirection can be supported. (see JDK-7044727)
++ */
++ timeType = getDynamicTimeZoneInfo(&dtzi);
++ if (timeType == TIME_ZONE_ID_INVALID) {
++ goto err;
++ }
++
++ if (timeType != NO_DYNAMIC_TIME_ZONE_INFO) {
++ /*
++ * Make sure TimeZoneKeyName is available from the API call. If
++ * DynamicDaylightTime is disabled, return a custom time zone name
++ * based on the GMT offset. Otherwise, return the TimeZoneKeyName
++ * value.
++ */
++ if (dtzi.TimeZoneKeyName[0] != 0) {
++ if (dtzi.DynamicDaylightTimeDisabled) {
++ customZoneName(dtzi.Bias, winZoneName);
++ return VALUE_GMTOFFSET;
++ }
++ wcstombs(winZoneName, dtzi.TimeZoneKeyName, MAX_ZONE_CHAR);
++ return VALUE_KEY;
++ }
++
++ /*
++ * If TimeZoneKeyName is not available, check whether StandardName
++ * is available to fall back to the older API GetTimeZoneInformation.
++ * If not, directly read the value from registry keys.
++ */
++ if (dtzi.StandardName[0] == 0) {
++ ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
++ KEY_READ, (PHKEY)&hKey);
++ if (ret != ERROR_SUCCESS) {
++ goto err;
++ }
++
++ /*
++ * Determine if auto-daylight time adjustment is turned off.
++ */
++ bufSize = sizeof(val);
++ ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled", NULL,
++ &valueType, (LPBYTE) &val, &bufSize);
++ if (ret != ERROR_SUCCESS) {
++ goto err;
++ }
++ /*
++ * Return a custom time zone name if auto-daylight time
++ * adjustment is disabled.
++ */
++ if (val == 1) {
++ customZoneName(dtzi.Bias, winZoneName);
++ (void) RegCloseKey(hKey);
++ return VALUE_GMTOFFSET;
++ }
++
++ bufSize = MAX_ZONE_CHAR;
++ ret = RegQueryValueExA(hKey, "TimeZoneKeyName",NULL,
++ &valueType, (LPBYTE)winZoneName, &bufSize);
++ if (ret != ERROR_SUCCESS) {
++ goto err;
++ }
++ (void) RegCloseKey(hKey);
++ return VALUE_KEY;
++ }
++ }
++ }
++
++ /*
++ * Fall back to GetTimeZoneInformation
+ */
+ timeType = GetTimeZoneInformation(&tzi);
+ if (timeType == TIME_ZONE_ID_INVALID) {
+ goto err;
+ }
+
+- /*
+- * Determine if this is an NT system.
+- */
+- ver.dwOSVersionInfoSize = sizeof(ver);
+- GetVersionEx(&ver);
+- isVista = ver.dwMajorVersion >= 6;
+-
+ ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
+ KEY_READ, (PHKEY)&hKey);
+ if (ret == ERROR_SUCCESS) {
+@@ -187,23 +302,23 @@
+ /*
+ * Determine if auto-daylight time adjustment is turned off.
+ */
+- valueType = 0;
+ bufSize = sizeof(val);
+- ret = RegQueryValueExA(hKey, "DisableAutoDaylightTimeSet",
+- NULL, &valueType, (LPBYTE) &val, &bufSize);
+- /*
+- * Vista uses the different key name.
+- */
++ ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled", NULL,
++ &valueType, (LPBYTE) &val, &bufSize);
+ if (ret != ERROR_SUCCESS) {
+- bufSize = sizeof(val);
+- ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled",
+- NULL, &valueType, (LPBYTE) &val, &bufSize);
++ /*
++ * Try the old key name.
++ */
++ bufSize = sizeof(val);
++ ret = RegQueryValueExA(hKey, "DisableAutoDaylightTimeSet", NULL,
++ &valueType, (LPBYTE) &val, &bufSize);
+ }
+
+ if (ret == ERROR_SUCCESS) {
+- int daylightSavingsUpdateDisabledOther = val == 1 && tzi.DaylightDate.wMonth != 0;
+- int daylightSavingsUpdateDisabledVista = val == 1;
+- int daylightSavingsUpdateDisabled = isVista ? daylightSavingsUpdateDisabledVista : daylightSavingsUpdateDisabledOther;
++ int daylightSavingsUpdateDisabledOther = (val == 1 && tzi.DaylightDate.wMonth != 0);
++ int daylightSavingsUpdateDisabledVista = (val == 1);
++ int daylightSavingsUpdateDisabled
++ = (isVistaOrLater ? daylightSavingsUpdateDisabledVista : daylightSavingsUpdateDisabledOther);
+
+ if (daylightSavingsUpdateDisabled) {
+ (void) RegCloseKey(hKey);
+@@ -213,28 +328,12 @@
+ }
+
+ /*
+- * Vista has the key for the current "Time Zones" entry.
+- */
+- if (isVista) {
+- valueType = 0;
+- bufSize = MAX_ZONE_CHAR;
+- ret = RegQueryValueExA(hKey, "TimeZoneKeyName", NULL,
+- &valueType, (LPBYTE) winZoneName, &bufSize);
+- if (ret != ERROR_SUCCESS) {
+- goto err;
+- }
+- (void) RegCloseKey(hKey);
+- return VALUE_KEY;
+- }
+-
+- /*
+ * Win32 problem: If the length of the standard time name is equal
+ * to (or probably longer than) 32 in the registry,
+ * GetTimeZoneInformation() on NT returns a null string as its
+ * standard time name. We need to work around this problem by
+ * getting the same information from the TimeZoneInformation
+- * registry. The function on Win98 seems to return its key name.
+- * We can't do anything in that case.
++ * registry.
+ */
+ if (tzi.StandardName[0] == 0) {
+ bufSize = sizeof(stdNameInReg);
+@@ -510,18 +609,49 @@
+ } else {
+ std_timezone = matchJavaTZ(java_home_dir, result,
+ winZoneName, winMapID);
++ if (std_timezone == NULL) {
++ std_timezone = getGMTOffsetID();
++ }
+ }
+ }
+-
+ return std_timezone;
+ }
+
+ /**
+- * Returns a GMT-offset-based time zone ID. On Win32, it always return
+- * NULL since the fall back is performed in getWinTimeZone().
++ * Returns a GMT-offset-based time zone ID.
+ */
+ char *
+ getGMTOffsetID()
+ {
+- return NULL;
++ LONG bias = 0;
++ LONG ret;
++ HANDLE hKey = NULL;
++ char zonename[32];
++
++ // Obtain the current GMT offset value of ActiveTimeBias.
++ ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
++ KEY_READ, (PHKEY)&hKey);
++ if (ret == ERROR_SUCCESS) {
++ DWORD val;
++ DWORD bufSize = sizeof(val);
++ ULONG valueType = 0;
++ ret = RegQueryValueExA(hKey, "ActiveTimeBias",
++ NULL, &valueType, (LPBYTE) &val, &bufSize);
++ if (ret == ERROR_SUCCESS) {
++ bias = (LONG) val;
++ }
++ (void) RegCloseKey(hKey);
++ }
++
++ // If we can't get the ActiveTimeBias value, use Bias of TimeZoneInformation.
++ // Note: Bias doesn't reflect current daylight saving.
++ if (ret != ERROR_SUCCESS) {
++ TIME_ZONE_INFORMATION tzi;
++ if (GetTimeZoneInformation(&tzi) != TIME_ZONE_ID_INVALID) {
++ bias = tzi.Bias;
++ }
++ }
++
++ customZoneName(bias, zonename);
++ return _strdup(zonename);
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeATInstance.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,271 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * A class to track key AT instance info from the JavaAccessBridge
++ */
++
++#include "AccessBridgeDebug.h"
++#include "AccessBridgeATInstance.h"
++#include "AccessBridgeMessages.h"
++
++#include <windows.h>
++#include <winbase.h>
++
++
++/**
++ * AccessBridgeATInstance constructor
++ */
++AccessBridgeATInstance::AccessBridgeATInstance(HWND ourABWindow, HWND winABWindow,
++ char *memoryFilename,
++ AccessBridgeATInstance *next) {
++ ourAccessBridgeWindow = ourABWindow;
++ winAccessBridgeWindow = winABWindow;
++ nextATInstance = next;
++ javaEventMask = 0;
++ accessibilityEventMask = 0;
++ strncpy(memoryMappedFileName, memoryFilename, cMemoryMappedNameSize);
++}
++
++/**
++ * AccessBridgeATInstance descructor
++ */
++AccessBridgeATInstance::~AccessBridgeATInstance() {
++ PrintDebugString("\r\nin AccessBridgeATInstance::~AccessBridgeATInstance");
++
++ // if IPC memory mapped file view is valid, unmap it
++ if (memoryMappedView != (char *) 0) {
++ PrintDebugString(" unmapping memoryMappedView; view = %p", memoryMappedView);
++ UnmapViewOfFile(memoryMappedView);
++ memoryMappedView = (char *) 0;
++ }
++ // if IPC memory mapped file handle map is open, close it
++ if (memoryMappedFileMapHandle != (HANDLE) 0) {
++ PrintDebugString(" closing memoryMappedFileMapHandle; handle = %p", memoryMappedFileMapHandle);
++ CloseHandle(memoryMappedFileMapHandle);
++ memoryMappedFileMapHandle = (HANDLE) 0;
++ }
++}
++
++/**
++ * Sets up the memory-mapped file to do IPC messaging
++ * 1 files is created: to handle requests for information
++ * initiated from Windows AT. The package is placed into
++ * the memory-mapped file (char *memoryMappedView),
++ * and then a special SendMessage() is sent. When the
++ * JavaDLL returns from SendMessage() processing, the
++ * data will be in memoryMappedView. The SendMessage()
++ * return value tells us if all is right with the world.
++ *
++ * The set-up proces involves creating the memory-mapped
++ * file, and writing a special string to it so that the
++ * WindowsDLL so it knows about it as well.
++ */
++LRESULT
++AccessBridgeATInstance::initiateIPC() {
++ DWORD errorCode;
++
++ PrintDebugString("\r\nin AccessBridgeATInstance::initiateIPC()");
++
++ // open Windows-initiated IPC filemap & map it to a ptr
++
++ memoryMappedFileMapHandle = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE,
++ FALSE, memoryMappedFileName);
++ if (memoryMappedFileMapHandle == NULL) {
++ errorCode = GetLastError();
++ PrintDebugString(" Failed to CreateFileMapping for %s, error: %X", memoryMappedFileName, errorCode);
++ return errorCode;
++ } else {
++ PrintDebugString(" CreateFileMapping worked - filename: %s", memoryMappedFileName);
++ }
++
++ memoryMappedView = (char *) MapViewOfFile(memoryMappedFileMapHandle,
++ FILE_MAP_READ | FILE_MAP_WRITE,
++ 0, 0, 0);
++ if (memoryMappedView == NULL) {
++ errorCode = GetLastError();
++ PrintDebugString(" Failed to MapViewOfFile for %s, error: %X", memoryMappedFileName, errorCode);
++ return errorCode;
++ } else {
++ PrintDebugString(" MapViewOfFile worked - view: %p", memoryMappedView);
++ }
++
++
++ // look for the JavaDLL's answer to see if it could read the file
++ if (strcmp(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_QUERY) != 0) {
++ PrintDebugString(" JavaVM failed to write to memory mapped file %s",
++ memoryMappedFileName);
++ return -1;
++ } else {
++ PrintDebugString(" JavaVM successfully wrote to file!");
++ }
++
++
++ // write some data to the memory mapped file for WindowsDLL to verify
++ strcpy(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_ANSWER);
++
++
++ return 0;
++}
++
++
++typedef struct EVENT_STRUCT
++{
++ char *buffer;
++ int bufsize;
++ ABHWND64 winAccessBridgeWindow;
++ ABHWND64 ourAccessBridgeWindow;
++}EVENT_STRUCT;
++
++
++#include <process.h>
++#define THREAD_PROC unsigned int __stdcall
++typedef unsigned int (__stdcall *THREAD_ROUTINE)(LPVOID lpThreadParameter);
++
++static HANDLE BeginThread(THREAD_ROUTINE thread_func,DWORD *id,DWORD param)
++{
++ HANDLE ret;
++ ret = (HANDLE) _beginthreadex(NULL,0,thread_func,(void *)param,0,(unsigned int *)id);
++ if(ret == INVALID_HANDLE_VALUE)
++ ret = NULL;
++ return(ret);
++}
++
++DWORD JavaBridgeThreadId = 0;
++
++static THREAD_PROC JavaBridgeThread(LPVOID param1)
++{
++ MSG msg;
++ DWORD rc = 0;
++ while (GetMessage(&msg, // message structure
++ NULL, // handle of window receiving the message
++ 0, // lowest message to examine
++ 0)) // highest message to examine
++ {
++ if(msg.message == WM_USER)
++ {
++ EVENT_STRUCT *event_struct = (EVENT_STRUCT *)msg.wParam;
++ COPYDATASTRUCT toCopy;
++ toCopy.dwData = 0; // 32-bits we could use for something...
++ toCopy.cbData = event_struct->bufsize;
++ toCopy.lpData = event_struct->buffer;
++
++ LRESULT ret = SendMessage((HWND)ABLongToHandle(event_struct->winAccessBridgeWindow), WM_COPYDATA,
++ (WPARAM)event_struct->ourAccessBridgeWindow, (LPARAM) &toCopy);
++ delete event_struct->buffer;
++ delete event_struct;
++ }
++ if(msg.message == (WM_USER+1))
++ PostQuitMessage(0);
++ }
++ JavaBridgeThreadId = 0;
++ return(0);
++}
++
++/*
++ * Handles one event
++ */
++static void do_event(char *buffer, int bufsize,HWND ourAccessBridgeWindow,HWND winAccessBridgeWindow)
++{
++ EVENT_STRUCT *event_struct = new EVENT_STRUCT;
++ event_struct->bufsize = bufsize;
++ event_struct->buffer = new char[bufsize];
++ memcpy(event_struct->buffer,buffer,bufsize);
++ event_struct->ourAccessBridgeWindow = ABHandleToLong(ourAccessBridgeWindow);
++ event_struct->winAccessBridgeWindow = ABHandleToLong(winAccessBridgeWindow);
++ if(!JavaBridgeThreadId)
++ {
++ HANDLE JavaBridgeThreadHandle = BeginThread(JavaBridgeThread,&JavaBridgeThreadId,(DWORD)event_struct);
++ CloseHandle(JavaBridgeThreadHandle);
++ }
++ PostThreadMessage(JavaBridgeThreadId,WM_USER,(WPARAM)event_struct,0);
++}
++
++
++/**
++ * sendJavaEventPackage - uses SendMessage(WM_COPYDATA) to do
++ * IPC messaging with the Java AccessBridge DLL
++ * to propogate events to those ATs that want 'em
++ *
++ */
++LRESULT
++AccessBridgeATInstance::sendJavaEventPackage(char *buffer, int bufsize, long eventID) {
++
++ PrintDebugString("AccessBridgeATInstance::sendJavaEventPackage() eventID = %X", eventID);
++ PrintDebugString("AccessBridgeATInstance::sendJavaEventPackage() (using PostMessage) eventID = %X", eventID);
++
++ if (eventID & javaEventMask) {
++ do_event(buffer,bufsize,ourAccessBridgeWindow,winAccessBridgeWindow);
++ return(0);
++ } else {
++ return -1;
++ }
++}
++
++
++/**
++ * uses SendMessage(WM_COPYDATA) to do
++ * IPC messaging with the Java AccessBridge DLL
++ * to propogate events to those ATs that want 'em
++ *
++ */
++LRESULT
++AccessBridgeATInstance::sendAccessibilityEventPackage(char *buffer, int bufsize, long eventID) {
++
++ PrintDebugString("AccessBridgeATInstance::sendAccessibilityEventPackage() eventID = %X", eventID);
++
++ if (eventID & accessibilityEventMask) {
++ do_event(buffer,bufsize,ourAccessBridgeWindow,winAccessBridgeWindow);
++ return(0);
++ } else {
++ return -1;
++ }
++}
++
++
++/**
++ * findABATInstanceFromATHWND - walk through linked list from
++ * where we are. Return the
++ * AccessBridgeATInstance
++ * of the ABATInstance that
++ * matches the passed in vmID;
++ * no match: return 0
++ */
++AccessBridgeATInstance *
++AccessBridgeATInstance::findABATInstanceFromATHWND(HWND window) {
++ // no need to recurse really
++ if (winAccessBridgeWindow == window) {
++ return this;
++ } else {
++ AccessBridgeATInstance *current = nextATInstance;
++ while (current != (AccessBridgeATInstance *) 0) {
++ if (current->winAccessBridgeWindow == window) {
++ return current;
++ }
++ current = current->nextATInstance;
++ }
++ }
++ return (AccessBridgeATInstance *) 0;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeATInstance.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,65 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * A class to track key AT instance info from the JavaAccessBridge
++ */
++
++#include <windows.h>
++#include "AccessBridgePackages.h"
++
++#ifndef __AccessBridgeATInstance_H__
++#define __AccessBridgeATInstance_H__
++
++
++/**
++ * The AccessBridgeATInstance class.
++ */
++class AccessBridgeATInstance {
++ friend class JavaAccessBridge;
++
++ AccessBridgeATInstance *nextATInstance;
++ HWND ourAccessBridgeWindow;
++ HWND winAccessBridgeWindow;
++ long javaEventMask;
++ long accessibilityEventMask;
++
++ // IPC variables
++ HANDLE memoryMappedFileMapHandle; // handle to file map
++ char *memoryMappedView; // ptr to shared memory
++ char memoryMappedFileName[cMemoryMappedNameSize];
++
++public:
++ AccessBridgeATInstance(HWND ourABWindow, HWND winABWindow,
++ char *memoryFilename,
++ AccessBridgeATInstance *next);
++ ~AccessBridgeATInstance();
++ LRESULT initiateIPC();
++ LRESULT sendJavaEventPackage(char *buffer, int bufsize, long eventID);
++ LRESULT sendAccessibilityEventPackage(char *buffer, int bufsize, long eventID);
++ AccessBridgeATInstance *findABATInstanceFromATHWND(HWND window);
++};
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeCallbacks.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,96 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * AccessBridgeCallbacks.h 1.17 05/03/21
++ */
++
++/*
++ * Header file defining callback typedefs for Windows routines
++ * which are called from Java (responding to events, etc.).
++ */
++
++#ifndef __AccessBridgeCallbacks_H__
++#define __AccessBridgeCallbacks_H__
++
++#include <jni.h>
++#include "AccessBridgePackages.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++typedef void (*AccessBridge_PropertyChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *property, wchar_t *oldValue, wchar_t *newValue);
++
++typedef void (*AccessBridge_JavaShutdownFP) (long vmID);
++typedef void (*AccessBridge_JavaShutdownFP) (long vmID);
++
++typedef void (*AccessBridge_FocusGainedFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_FocusLostFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++
++typedef void (*AccessBridge_CaretUpdateFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++
++typedef void (*AccessBridge_MouseClickedFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_MouseEnteredFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_MouseExitedFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_MousePressedFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_MouseReleasedFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++
++typedef void (*AccessBridge_MenuCanceledFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_MenuDeselectedFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_MenuSelectedFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_PopupMenuCanceledFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_PopupMenuWillBecomeInvisibleFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_PopupMenuWillBecomeVisibleFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++
++typedef void (*AccessBridge_PropertyNameChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldName, wchar_t *newName);
++typedef void (*AccessBridge_PropertyDescriptionChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldDescription, wchar_t *newDescription);
++typedef void (*AccessBridge_PropertyStateChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldState, wchar_t *newState);
++typedef void (*AccessBridge_PropertyValueChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldValue, wchar_t *newValue);
++typedef void (*AccessBridge_PropertySelectionChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_PropertyTextChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_PropertyCaretChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source,
++ int oldPosition, int newPosition);
++typedef void (*AccessBridge_PropertyVisibleDataChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source);
++typedef void (*AccessBridge_PropertyChildChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source,
++ JOBJECT64 oldChild, JOBJECT64 newChild);
++typedef void (*AccessBridge_PropertyActiveDescendentChangeFP) (long vmID, JOBJECT64 event,
++ JOBJECT64 source,
++ JOBJECT64 oldActiveDescendent,
++ JOBJECT64 newActiveDescendent);
++
++typedef void (*AccessBridge_PropertyTableModelChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 src,
++ wchar_t *oldValue, wchar_t *newValue);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeCalls.c Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1131 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * @(#)AccessBridgeCalls.c 1.25 05/08/22
++ */
++
++/*
++ * Wrapper functions around calls to the AccessBridge DLL
++ */
++
++
++#include <windows.h>
++#include <jni.h>
++
++
++//#define ACCESSBRIDGE_32
++//#define ACCESSBRIDGE_64
++
++#include "AccessBridgeCalls.h"
++#include "AccessBridgeDebug.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++ HINSTANCE theAccessBridgeInstance;
++ AccessBridgeFPs theAccessBridge;
++
++ BOOL theAccessBridgeInitializedFlag = FALSE;
++
++#define LOAD_FP(result, type, name) \
++ PrintDebugString("LOAD_FP loading: %s ...", name); \
++ if ((theAccessBridge.result = \
++ (type) GetProcAddress(theAccessBridgeInstance, name)) == (type) 0) { \
++ PrintDebugString("LOAD_FP failed: %s", name); \
++ return FALSE; \
++ }
++
++ BOOL initializeAccessBridge() {
++
++#ifdef ACCESSBRIDGE_ARCH_32 // For 32bit AT new bridge
++ theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-32");
++#else
++#ifdef ACCESSBRIDGE_ARCH_64 // For 64bit AT new bridge
++ theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-64");
++#else // legacy
++ theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE");
++#endif
++#endif
++ if (theAccessBridgeInstance != 0) {
++ LOAD_FP(Windows_run, Windows_runFP, "Windows_run");
++
++ LOAD_FP(SetJavaShutdown, SetJavaShutdownFP, "setJavaShutdownFP");
++ LOAD_FP(SetFocusGained, SetFocusGainedFP, "setFocusGainedFP");
++ LOAD_FP(SetFocusLost, SetFocusLostFP, "setFocusLostFP");
++
++ LOAD_FP(SetCaretUpdate, SetCaretUpdateFP, "setCaretUpdateFP");
++
++ LOAD_FP(SetMouseClicked, SetMouseClickedFP, "setMouseClickedFP");
++ LOAD_FP(SetMouseEntered, SetMouseEnteredFP, "setMouseEnteredFP");
++ LOAD_FP(SetMouseExited, SetMouseExitedFP, "setMouseExitedFP");
++ LOAD_FP(SetMousePressed, SetMousePressedFP, "setMousePressedFP");
++ LOAD_FP(SetMouseReleased, SetMouseReleasedFP, "setMouseReleasedFP");
++
++ LOAD_FP(SetMenuCanceled, SetMenuCanceledFP, "setMenuCanceledFP");
++ LOAD_FP(SetMenuDeselected, SetMenuDeselectedFP, "setMenuDeselectedFP");
++ LOAD_FP(SetMenuSelected, SetMenuSelectedFP, "setMenuSelectedFP");
++ LOAD_FP(SetPopupMenuCanceled, SetPopupMenuCanceledFP, "setPopupMenuCanceledFP");
++ LOAD_FP(SetPopupMenuWillBecomeInvisible, SetPopupMenuWillBecomeInvisibleFP, "setPopupMenuWillBecomeInvisibleFP");
++ LOAD_FP(SetPopupMenuWillBecomeVisible, SetPopupMenuWillBecomeVisibleFP, "setPopupMenuWillBecomeVisibleFP");
++
++ LOAD_FP(SetPropertyNameChange, SetPropertyNameChangeFP, "setPropertyNameChangeFP");
++ LOAD_FP(SetPropertyDescriptionChange, SetPropertyDescriptionChangeFP, "setPropertyDescriptionChangeFP");
++ LOAD_FP(SetPropertyStateChange, SetPropertyStateChangeFP, "setPropertyStateChangeFP");
++ LOAD_FP(SetPropertyValueChange, SetPropertyValueChangeFP, "setPropertyValueChangeFP");
++ LOAD_FP(SetPropertySelectionChange, SetPropertySelectionChangeFP, "setPropertySelectionChangeFP");
++ LOAD_FP(SetPropertyTextChange, SetPropertyTextChangeFP, "setPropertyTextChangeFP");
++ LOAD_FP(SetPropertyCaretChange, SetPropertyCaretChangeFP, "setPropertyCaretChangeFP");
++ LOAD_FP(SetPropertyVisibleDataChange, SetPropertyVisibleDataChangeFP, "setPropertyVisibleDataChangeFP");
++ LOAD_FP(SetPropertyChildChange, SetPropertyChildChangeFP, "setPropertyChildChangeFP");
++ LOAD_FP(SetPropertyActiveDescendentChange, SetPropertyActiveDescendentChangeFP, "setPropertyActiveDescendentChangeFP");
++
++ LOAD_FP(SetPropertyTableModelChange, SetPropertyTableModelChangeFP, "setPropertyTableModelChangeFP");
++
++ LOAD_FP(ReleaseJavaObject, ReleaseJavaObjectFP, "releaseJavaObject");
++ LOAD_FP(GetVersionInfo, GetVersionInfoFP, "getVersionInfo");
++
++ LOAD_FP(IsJavaWindow, IsJavaWindowFP, "isJavaWindow");
++ LOAD_FP(IsSameObject, IsSameObjectFP, "isSameObject");
++ LOAD_FP(GetAccessibleContextFromHWND, GetAccessibleContextFromHWNDFP, "getAccessibleContextFromHWND");
++ LOAD_FP(getHWNDFromAccessibleContext, getHWNDFromAccessibleContextFP, "getHWNDFromAccessibleContext");
++
++ LOAD_FP(GetAccessibleContextAt, GetAccessibleContextAtFP, "getAccessibleContextAt");
++ LOAD_FP(GetAccessibleContextWithFocus, GetAccessibleContextWithFocusFP, "getAccessibleContextWithFocus");
++ LOAD_FP(GetAccessibleContextInfo, GetAccessibleContextInfoFP, "getAccessibleContextInfo");
++ LOAD_FP(GetAccessibleChildFromContext, GetAccessibleChildFromContextFP, "getAccessibleChildFromContext");
++ LOAD_FP(GetAccessibleParentFromContext, GetAccessibleParentFromContextFP, "getAccessibleParentFromContext");
++
++ /* begin AccessibleTable */
++ LOAD_FP(getAccessibleTableInfo, getAccessibleTableInfoFP, "getAccessibleTableInfo");
++ LOAD_FP(getAccessibleTableCellInfo, getAccessibleTableCellInfoFP, "getAccessibleTableCellInfo");
++
++ LOAD_FP(getAccessibleTableRowHeader, getAccessibleTableRowHeaderFP, "getAccessibleTableRowHeader");
++ LOAD_FP(getAccessibleTableColumnHeader, getAccessibleTableColumnHeaderFP, "getAccessibleTableColumnHeader");
++
++ LOAD_FP(getAccessibleTableRowDescription, getAccessibleTableRowDescriptionFP, "getAccessibleTableRowDescription");
++ LOAD_FP(getAccessibleTableColumnDescription, getAccessibleTableColumnDescriptionFP, "getAccessibleTableColumnDescription");
++
++ LOAD_FP(getAccessibleTableRowSelectionCount, getAccessibleTableRowSelectionCountFP,
++ "getAccessibleTableRowSelectionCount");
++ LOAD_FP(isAccessibleTableRowSelected, isAccessibleTableRowSelectedFP,
++ "isAccessibleTableRowSelected");
++ LOAD_FP(getAccessibleTableRowSelections, getAccessibleTableRowSelectionsFP,
++ "getAccessibleTableRowSelections");
++
++ LOAD_FP(getAccessibleTableColumnSelectionCount, getAccessibleTableColumnSelectionCountFP,
++ "getAccessibleTableColumnSelectionCount");
++ LOAD_FP(isAccessibleTableColumnSelected, isAccessibleTableColumnSelectedFP,
++ "isAccessibleTableColumnSelected");
++ LOAD_FP(getAccessibleTableColumnSelections, getAccessibleTableColumnSelectionsFP,
++ "getAccessibleTableColumnSelections");
++
++ LOAD_FP(getAccessibleTableRow, getAccessibleTableRowFP,
++ "getAccessibleTableRow");
++ LOAD_FP(getAccessibleTableColumn, getAccessibleTableColumnFP,
++ "getAccessibleTableColumn");
++ LOAD_FP(getAccessibleTableIndex, getAccessibleTableIndexFP,
++ "getAccessibleTableIndex");
++
++ /* end AccessibleTable */
++
++ /* AccessibleRelationSet */
++ LOAD_FP(getAccessibleRelationSet, getAccessibleRelationSetFP, "getAccessibleRelationSet");
++
++ /* AccessibleHypertext */
++ LOAD_FP(getAccessibleHypertext, getAccessibleHypertextFP, "getAccessibleHypertext");
++ LOAD_FP(activateAccessibleHyperlink, activateAccessibleHyperlinkFP, "activateAccessibleHyperlink");
++ LOAD_FP(getAccessibleHyperlinkCount, getAccessibleHyperlinkCountFP, "getAccessibleHyperlinkCount");
++ LOAD_FP(getAccessibleHypertextExt, getAccessibleHypertextExtFP, "getAccessibleHypertextExt");
++ LOAD_FP(getAccessibleHypertextLinkIndex, getAccessibleHypertextLinkIndexFP, "getAccessibleHypertextLinkIndex");
++ LOAD_FP(getAccessibleHyperlink, getAccessibleHyperlinkFP, "getAccessibleHyperlink");
++
++ /* Accessible KeyBinding, Icon and Action */
++ LOAD_FP(getAccessibleKeyBindings, getAccessibleKeyBindingsFP, "getAccessibleKeyBindings");
++ LOAD_FP(getAccessibleIcons, getAccessibleIconsFP, "getAccessibleIcons");
++ LOAD_FP(getAccessibleActions, getAccessibleActionsFP, "getAccessibleActions");
++ LOAD_FP(doAccessibleActions, doAccessibleActionsFP, "doAccessibleActions");
++
++ /* AccessibleText */
++ LOAD_FP(GetAccessibleTextInfo, GetAccessibleTextInfoFP, "getAccessibleTextInfo");
++ LOAD_FP(GetAccessibleTextItems, GetAccessibleTextItemsFP, "getAccessibleTextItems");
++ LOAD_FP(GetAccessibleTextSelectionInfo, GetAccessibleTextSelectionInfoFP, "getAccessibleTextSelectionInfo");
++ LOAD_FP(GetAccessibleTextAttributes, GetAccessibleTextAttributesFP, "getAccessibleTextAttributes");
++ LOAD_FP(GetAccessibleTextRect, GetAccessibleTextRectFP, "getAccessibleTextRect");
++ LOAD_FP(GetAccessibleTextLineBounds, GetAccessibleTextLineBoundsFP, "getAccessibleTextLineBounds");
++ LOAD_FP(GetAccessibleTextRange, GetAccessibleTextRangeFP, "getAccessibleTextRange");
++
++ LOAD_FP(GetCurrentAccessibleValueFromContext, GetCurrentAccessibleValueFromContextFP, "getCurrentAccessibleValueFromContext");
++ LOAD_FP(GetMaximumAccessibleValueFromContext, GetMaximumAccessibleValueFromContextFP, "getMaximumAccessibleValueFromContext");
++ LOAD_FP(GetMinimumAccessibleValueFromContext, GetMinimumAccessibleValueFromContextFP, "getMinimumAccessibleValueFromContext");
++
++ LOAD_FP(AddAccessibleSelectionFromContext, AddAccessibleSelectionFromContextFP, "addAccessibleSelectionFromContext");
++ LOAD_FP(ClearAccessibleSelectionFromContext, ClearAccessibleSelectionFromContextFP, "clearAccessibleSelectionFromContext");
++ LOAD_FP(GetAccessibleSelectionFromContext, GetAccessibleSelectionFromContextFP, "getAccessibleSelectionFromContext");
++ LOAD_FP(GetAccessibleSelectionCountFromContext, GetAccessibleSelectionCountFromContextFP, "getAccessibleSelectionCountFromContext");
++ LOAD_FP(IsAccessibleChildSelectedFromContext, IsAccessibleChildSelectedFromContextFP, "isAccessibleChildSelectedFromContext");
++ LOAD_FP(RemoveAccessibleSelectionFromContext, RemoveAccessibleSelectionFromContextFP, "removeAccessibleSelectionFromContext");
++ LOAD_FP(SelectAllAccessibleSelectionFromContext, SelectAllAccessibleSelectionFromContextFP, "selectAllAccessibleSelectionFromContext");
++
++ LOAD_FP(setTextContents, setTextContentsFP, "setTextContents");
++ LOAD_FP(getParentWithRole, getParentWithRoleFP, "getParentWithRole");
++ LOAD_FP(getTopLevelObject, getTopLevelObjectFP, "getTopLevelObject");
++ LOAD_FP(getParentWithRoleElseRoot, getParentWithRoleElseRootFP, "getParentWithRoleElseRoot");
++ LOAD_FP(getObjectDepth, getObjectDepthFP, "getObjectDepth");
++ LOAD_FP(getActiveDescendent, getActiveDescendentFP, "getActiveDescendent");
++
++ // additional methods for Teton
++ LOAD_FP(getVirtualAccessibleName, getVirtualAccessibleNameFP, "getVirtualAccessibleName");
++ LOAD_FP(requestFocus, requestFocusFP, "requestFocus");
++ LOAD_FP(selectTextRange, selectTextRangeFP, "selectTextRange");
++ LOAD_FP(getTextAttributesInRange, getTextAttributesInRangeFP, "getTextAttributesInRange");
++ LOAD_FP(getVisibleChildrenCount, getVisibleChildrenCountFP, "getVisibleChildrenCount");
++ LOAD_FP(getVisibleChildren, getVisibleChildrenFP, "getVisibleChildren");
++ LOAD_FP(setCaretPosition, setCaretPositionFP, "setCaretPosition");
++ LOAD_FP(getCaretLocation, getCaretLocationFP, "getCaretLocation");
++
++ LOAD_FP(getEventsWaiting, getEventsWaitingFP, "getEventsWaiting");
++
++ theAccessBridge.Windows_run();
++
++ theAccessBridgeInitializedFlag = TRUE;
++ PrintDebugString("theAccessBridgeInitializedFlag = TRUE");
++ return TRUE;
++ } else {
++ return FALSE;
++ }
++ }
++
++
++ BOOL shutdownAccessBridge() {
++ BOOL result;
++ DWORD error;
++ theAccessBridgeInitializedFlag = FALSE;
++ if (theAccessBridgeInstance != (HANDLE) 0) {
++ result = FreeLibrary(theAccessBridgeInstance);
++ if (result != TRUE) {
++ error = GetLastError();
++ }
++ return TRUE;
++ }
++ return FALSE;
++ }
++
++
++ void SetJavaShutdown(AccessBridge_JavaShutdownFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetJavaShutdown(fp);
++ }
++ }
++
++ void SetFocusGained(AccessBridge_FocusGainedFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetFocusGained(fp);
++ }
++ }
++
++ void SetFocusLost(AccessBridge_FocusLostFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetFocusLost(fp);
++ }
++ }
++
++
++ void SetCaretUpdate(AccessBridge_CaretUpdateFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetCaretUpdate(fp);
++ }
++ }
++
++
++ void SetMouseClicked(AccessBridge_MouseClickedFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetMouseClicked(fp);
++ }
++ }
++
++ void SetMouseEntered(AccessBridge_MouseEnteredFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetMouseEntered(fp);
++ }
++ }
++
++ void SetMouseExited(AccessBridge_MouseExitedFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetMouseExited(fp);
++ }
++ }
++
++ void SetMousePressed(AccessBridge_MousePressedFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetMousePressed(fp);
++ }
++ }
++
++ void SetMouseReleased(AccessBridge_MouseReleasedFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetMouseReleased(fp);
++ }
++ }
++
++
++ void SetMenuCanceled(AccessBridge_MenuCanceledFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetMenuCanceled(fp);
++ }
++ }
++
++ void SetMenuDeselected(AccessBridge_MenuDeselectedFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetMenuDeselected(fp);
++ }
++ }
++
++ void SetMenuSelected(AccessBridge_MenuSelectedFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetMenuSelected(fp);
++ }
++ }
++
++ void SetPopupMenuCanceled(AccessBridge_PopupMenuCanceledFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPopupMenuCanceled(fp);
++ }
++ }
++
++ void SetPopupMenuWillBecomeInvisible(AccessBridge_PopupMenuWillBecomeInvisibleFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPopupMenuWillBecomeInvisible(fp);
++ }
++ }
++
++ void SetPopupMenuWillBecomeVisible(AccessBridge_PopupMenuWillBecomeVisibleFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPopupMenuWillBecomeVisible(fp);
++ }
++ }
++
++
++ void SetPropertyNameChange(AccessBridge_PropertyNameChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyNameChange(fp);
++ }
++ }
++
++ void SetPropertyDescriptionChange(AccessBridge_PropertyDescriptionChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyDescriptionChange(fp);
++ }
++ }
++
++ void SetPropertyStateChange(AccessBridge_PropertyStateChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyStateChange(fp);
++ }
++ }
++
++ void SetPropertyValueChange(AccessBridge_PropertyValueChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyValueChange(fp);
++ }
++ }
++
++ void SetPropertySelectionChange(AccessBridge_PropertySelectionChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertySelectionChange(fp);
++ }
++ }
++
++ void SetPropertyTextChange(AccessBridge_PropertyTextChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyTextChange(fp);
++ }
++ }
++
++ void SetPropertyCaretChange(AccessBridge_PropertyCaretChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyCaretChange(fp);
++ }
++ }
++
++ void SetPropertyVisibleDataChange(AccessBridge_PropertyVisibleDataChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyVisibleDataChange(fp);
++ }
++ }
++
++ void SetPropertyChildChange(AccessBridge_PropertyChildChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyChildChange(fp);
++ }
++ }
++
++ void SetPropertyActiveDescendentChange(AccessBridge_PropertyActiveDescendentChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyActiveDescendentChange(fp);
++ }
++ }
++
++ void SetPropertyTableModelChange(AccessBridge_PropertyTableModelChangeFP fp) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SetPropertyTableModelChange(fp);
++ }
++ }
++
++ /**
++ * General routines
++ */
++ void ReleaseJavaObject(long vmID, Java_Object object) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.ReleaseJavaObject(vmID, object);
++ }
++ }
++
++ BOOL GetVersionInfo(long vmID, AccessBridgeVersionInfo *info) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetVersionInfo(vmID, info);
++ }
++ return FALSE;
++ }
++
++
++ /**
++ * Window routines
++ */
++ BOOL IsJavaWindow(HWND window) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ BOOL ret ;
++ ret = theAccessBridge.IsJavaWindow(window);
++ return ret ;
++
++ }
++ return FALSE;
++ }
++
++
++ /**
++ * Returns the virtual machine ID and AccessibleContext for a top-level window
++ */
++ BOOL GetAccessibleContextFromHWND(HWND target, long *vmID, AccessibleContext *ac) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleContextFromHWND(target, vmID, ac);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Returns the HWND from the AccessibleContext of a top-level window. Returns 0
++ * on error or if the AccessibleContext does not refer to a top-level window.
++ */
++ HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accesibleContext) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getHWNDFromAccessibleContext(vmID, accesibleContext);
++ }
++ return (HWND)0;
++ }
++
++ /**
++ * returns whether two objects are the same
++ */
++ BOOL IsSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.IsSameObject(vmID, obj1, obj2);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Sets editable text contents. The AccessibleContext must implement AccessibleEditableText and
++ * be editable. The maximum text length is MAX_STRING_SIZE - 1.
++ * Returns whether successful
++ */
++ BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.setTextContents(vmID, accessibleContext, text);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Returns the Accessible Context with the specified role that is the
++ * ancestor of a given object. The role is one of the role strings
++ * defined in AccessBridgePackages.h
++ * If there is no ancestor object that has the specified role,
++ * returns (AccessibleContext)0.
++ */
++ AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext,
++ const wchar_t *role) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getParentWithRole(vmID, accessibleContext, role);
++ }
++ return (AccessibleContext)0;
++ }
++
++ /**
++ * Returns the Accessible Context with the specified role that is the
++ * ancestor of a given object. The role is one of the role strings
++ * defined in AccessBridgePackages.h. If an object with the specified
++ * role does not exist, returns the top level object for the Java Window.
++ * Returns (AccessibleContext)0 on error.
++ */
++ AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext,
++ const wchar_t *role) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getParentWithRoleElseRoot(vmID, accessibleContext, role);
++ }
++ return (AccessibleContext)0;
++ }
++
++ /**
++ * Returns the Accessible Context for the top level object in
++ * a Java Window. This is same Accessible Context that is obtained
++ * from GetAccessibleContextFromHWND for that window. Returns
++ * (AccessibleContext)0 on error.
++ */
++ AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getTopLevelObject(vmID, accessibleContext);
++ }
++ return (AccessibleContext)0;
++ }
++
++ /**
++ * Returns how deep in the object hierarchy a given object is.
++ * The top most object in the object hierarchy has an object depth of 0.
++ * Returns -1 on error.
++ */
++ int getObjectDepth (const long vmID, const AccessibleContext accessibleContext) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getObjectDepth(vmID, accessibleContext);
++ }
++ return -1;
++ }
++
++ /**
++ * Returns the Accessible Context of the current ActiveDescendent of an object.
++ * This method assumes the ActiveDescendent is the component that is currently
++ * selected in a container object.
++ * Returns (AccessibleContext)0 on error or if there is no selection.
++ */
++ AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getActiveDescendent(vmID, accessibleContext);
++ }
++ return (AccessibleContext)0;
++ }
++
++
++ /**
++ * Accessible Context routines
++ */
++ BOOL GetAccessibleContextAt(long vmID, AccessibleContext acParent,
++ jint x, jint y, AccessibleContext *ac) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleContextAt(vmID, acParent, x, y, ac);
++ }
++ return FALSE;
++ }
++
++ BOOL GetAccessibleContextWithFocus(HWND window, long *vmID, AccessibleContext *ac) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleContextWithFocus(window, vmID, ac);
++ }
++ return FALSE;
++ }
++
++ BOOL GetAccessibleContextInfo(long vmID, AccessibleContext ac, AccessibleContextInfo *info) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleContextInfo(vmID, ac, info);
++ }
++ return FALSE;
++ }
++
++ AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleChildFromContext(vmID, ac, index);
++ }
++ return (AccessibleContext) 0;
++ }
++
++ AccessibleContext GetAccessibleParentFromContext(long vmID, AccessibleContext ac) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleParentFromContext(vmID, ac);
++ }
++ return (AccessibleContext) 0;
++ }
++
++ /* begin AccessibleTable routines */
++
++ /*
++ * get information about an AccessibleTable
++ */
++ BOOL getAccessibleTableInfo(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableInfo(vmID, acParent, tableInfo);
++ }
++ return FALSE;
++ }
++
++ /*
++ * get information about an AccessibleTable cell
++ */
++ BOOL getAccessibleTableCellInfo(long vmID, AccessibleTable accessibleTable,
++ jint row, jint column, AccessibleTableCellInfo *tableCellInfo) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableCellInfo(vmID, accessibleTable, row, column, tableCellInfo);
++ }
++ return FALSE;
++ }
++
++ /*
++ * get information about an AccessibleTable row header
++ */
++ BOOL getAccessibleTableRowHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableRowHeader(vmID, acParent, tableInfo);
++ }
++ return FALSE;
++ }
++
++ /*
++ * get information about an AccessibleTable column header
++ */
++ BOOL getAccessibleTableColumnHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableColumnHeader(vmID, acParent, tableInfo);
++ }
++ return FALSE;
++ }
++
++ /*
++ * return a description of an AccessibleTable row header
++ */
++ AccessibleContext getAccessibleTableRowDescription(long vmID, AccessibleContext acParent, jint row) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableRowDescription(vmID, acParent, row);
++ }
++ return (AccessibleContext)0;
++ }
++
++ /*
++ * return a description of an AccessibleTable column header
++ */
++ AccessibleContext getAccessibleTableColumnDescription(long vmID, AccessibleContext acParent, jint column) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableColumnDescription(vmID, acParent, column);
++ }
++ return (AccessibleContext)0;
++ }
++
++ /*
++ * return the number of rows selected in an AccessibleTable
++ */
++ jint getAccessibleTableRowSelectionCount(long vmID, AccessibleTable table) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableRowSelectionCount(vmID, table);
++ }
++ return -1;
++ }
++
++ /*
++ * return whether a row is selected in an AccessibleTable
++ */
++ BOOL isAccessibleTableRowSelected(long vmID, AccessibleTable table, jint row) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.isAccessibleTableRowSelected(vmID, table, row);
++ }
++ return FALSE;
++ }
++
++ /*
++ * get an array of selected rows in an AccessibleTable
++ */
++ BOOL getAccessibleTableRowSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableRowSelections(vmID, table, count, selections);
++ }
++ return FALSE;
++ }
++
++ /*
++ * return the number of columns selected in an AccessibleTable
++ */
++ jint getAccessibleTableColumnSelectionCount(long vmID, AccessibleTable table) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableColumnSelectionCount(vmID, table);
++ }
++ return -1;
++ }
++
++ /*
++ * return whether a column is selected in an AccessibleTable
++ */
++ BOOL isAccessibleTableColumnSelected(long vmID, AccessibleTable table, jint column) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.isAccessibleTableColumnSelected(vmID, table, column);
++ }
++ return FALSE;
++ }
++
++ /*
++ * get an array of columns selected in an AccessibleTable
++ */
++ BOOL getAccessibleTableColumnSelections(long vmID, AccessibleTable table, jint count, jint *selections) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableColumnSelections(vmID, table, count, selections);
++ }
++ return FALSE;
++ }
++
++ /*
++ * return the row number for a cell at a given index
++ */
++ jint
++ getAccessibleTableRow(long vmID, AccessibleTable table, jint index) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableRow(vmID, table, index);
++ }
++ return -1;
++ }
++
++ /*
++ * return the column number for a cell at a given index
++ */
++ jint
++ getAccessibleTableColumn(long vmID, AccessibleTable table, jint index) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableColumn(vmID, table, index);
++ }
++ return -1;
++ }
++
++ /*
++ * return the index of a cell at a given row and column
++ */
++ jint
++ getAccessibleTableIndex(long vmID, AccessibleTable table, jint row, jint column) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleTableIndex(vmID, table, row, column);
++ }
++ return -1;
++ }
++
++ /* end AccessibleTable routines */
++
++
++ /**
++ * Accessible Text routines
++ */
++ BOOL GetAccessibleTextInfo(long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleTextInfo(vmID, at, textInfo, x, y);
++ }
++ return FALSE;
++ }
++
++ BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleTextItems(vmID, at, textItems, index);
++ }
++ return FALSE;
++ }
++
++ BOOL GetAccessibleTextSelectionInfo(long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleTextSelectionInfo(vmID, at, textSelection);
++ }
++ return FALSE;
++ }
++
++ BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleTextAttributes(vmID, at, index, attributes);
++ }
++ return FALSE;
++ }
++
++ BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleTextRect(vmID, at, rectInfo, index);
++ }
++ return FALSE;
++ }
++
++ BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleTextLineBounds(vmID, at, index, startIndex, endIndex);
++ }
++ return FALSE;
++ }
++
++ BOOL GetAccessibleTextRange(long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleTextRange(vmID, at, start, end, text, len);
++ }
++ return FALSE;
++ }
++
++ /**
++ * AccessibleRelationSet routines
++ */
++ BOOL getAccessibleRelationSet(long vmID, AccessibleContext accessibleContext,
++ AccessibleRelationSetInfo *relationSetInfo) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleRelationSet(vmID, accessibleContext, relationSetInfo);
++ }
++ return FALSE;
++ }
++
++ /**
++ * AccessibleHypertext routines
++ */
++
++ // Gets AccessibleHypertext for an AccessibleContext
++ BOOL getAccessibleHypertext(long vmID, AccessibleContext accessibleContext,
++ AccessibleHypertextInfo *hypertextInfo) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleHypertext(vmID, accessibleContext, hypertextInfo);
++ }
++ return FALSE;
++ }
++
++ // Activates an AccessibleHyperlink for an AccessibleContext
++ BOOL activateAccessibleHyperlink(long vmID, AccessibleContext accessibleContext,
++ AccessibleHyperlink accessibleHyperlink) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.activateAccessibleHyperlink(vmID, accessibleContext, accessibleHyperlink);
++ }
++ return FALSE;
++ }
++
++ /*
++ * Returns the number of hyperlinks in a component
++ * Maps to AccessibleHypertext.getLinkCount.
++ * Returns -1 on error.
++ */
++ jint getAccessibleHyperlinkCount(const long vmID,
++ const AccessibleContext accessibleContext) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleHyperlinkCount(vmID, accessibleContext);
++ }
++ return -1;
++ }
++
++ /*
++ * This method is used to iterate through the hyperlinks in a component. It
++ * returns hypertext information for a component starting at hyperlink index
++ * nStartIndex. No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will
++ * be returned for each call to this method.
++ * returns FALSE on error.
++ */
++ BOOL getAccessibleHypertextExt(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nStartIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertextInfo) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleHypertextExt(vmID,
++ accessibleContext,
++ nStartIndex,
++ hypertextInfo);
++ }
++ return FALSE;
++ }
++
++ /*
++ * Returns the index into an array of hyperlinks that is associated with
++ * a character index in document;
++ * Maps to AccessibleHypertext.getLinkIndex.
++ * Returns -1 on error.
++ */
++ jint getAccessibleHypertextLinkIndex(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleHypertextLinkIndex(vmID,
++ hypertext,
++ nIndex);
++ }
++ return -1;
++ }
++
++ /*
++ * Returns the nth hyperlink in a document.
++ * Maps to AccessibleHypertext.getLink.
++ * Returns -1 on error
++ */
++ BOOL getAccessibleHyperlink(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex,
++ /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo) {
++
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleHyperlink(vmID,
++ hypertext,
++ nIndex,
++ hyperlinkInfo);
++ }
++ return FALSE;
++ }
++
++
++ /* Accessible KeyBindings, Icons and Actions */
++ BOOL getAccessibleKeyBindings(long vmID, AccessibleContext accessibleContext,
++ AccessibleKeyBindings *keyBindings) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleKeyBindings(vmID, accessibleContext, keyBindings);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleIcons(long vmID, AccessibleContext accessibleContext,
++ AccessibleIcons *icons) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleIcons(vmID, accessibleContext, icons);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleActions(long vmID, AccessibleContext accessibleContext,
++ AccessibleActions *actions) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getAccessibleActions(vmID, accessibleContext, actions);
++ }
++ return FALSE;
++ }
++
++ BOOL doAccessibleActions(long vmID, AccessibleContext accessibleContext,
++ AccessibleActionsToDo *actionsToDo, jint *failure) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.doAccessibleActions(vmID, accessibleContext, actionsToDo, failure);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Accessible Value routines
++ */
++ BOOL GetCurrentAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetCurrentAccessibleValueFromContext(vmID, av, value, len);
++ }
++ return FALSE;
++ }
++
++ BOOL GetMaximumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetMaximumAccessibleValueFromContext(vmID, av, value, len);
++ }
++ return FALSE;
++ }
++
++ BOOL GetMinimumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetMinimumAccessibleValueFromContext(vmID, av, value, len);
++ }
++ return FALSE;
++ }
++
++
++ /**
++ * Accessible Selection routines
++ */
++ void addAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.AddAccessibleSelectionFromContext(vmID, as, i);
++ }
++ }
++
++ void clearAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.ClearAccessibleSelectionFromContext(vmID, as);
++ }
++ }
++
++ JOBJECT64 GetAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleSelectionFromContext(vmID, as, i);
++ }
++ return (JOBJECT64) 0;
++ }
++
++ int GetAccessibleSelectionCountFromContext(long vmID, AccessibleSelection as) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.GetAccessibleSelectionCountFromContext(vmID, as);
++ }
++ return -1;
++ }
++
++ BOOL IsAccessibleChildSelectedFromContext(long vmID, AccessibleSelection as, int i) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.IsAccessibleChildSelectedFromContext(vmID, as, i);
++ }
++ return FALSE;
++ }
++
++ void RemoveAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.RemoveAccessibleSelectionFromContext(vmID, as, i);
++ }
++ }
++
++ void SelectAllAccessibleSelectionFromContext(long vmID, AccessibleSelection as) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ theAccessBridge.SelectAllAccessibleSelectionFromContext(vmID, as);
++ }
++ }
++
++ /**
++ * Additional methods for Teton
++ */
++
++ /**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
++ * whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++ BOOL getVirtualAccessibleName(const long vmID, const AccessibleContext accessibleContext,
++ wchar_t *name, int len) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getVirtualAccessibleName(vmID, accessibleContext, name, len);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++ BOOL requestFocus(const long vmID, const AccessibleContext accessibleContext) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.requestFocus(vmID, accessibleContext);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++ BOOL selectTextRange(const long vmID, const AccessibleContext accessibleContext,
++ const int startIndex, const int endIndex) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.selectTextRange(vmID, accessibleContext, startIndex, endIndex);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Get text attributes between two indices. The attribute list includes the text at the
++ * start index and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++ BOOL getTextAttributesInRange(const long vmID, const AccessibleContext accessibleContext,
++ const int startIndex, const int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getTextAttributesInRange(vmID, accessibleContext, startIndex,
++ endIndex, attributes, len);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Returns the number of visible children of a component. Returns -1 on error.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ int getVisibleChildrenCount(const long vmID, const AccessibleContext accessibleContext) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getVisibleChildrenCount(vmID, accessibleContext);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Gets the visible children of an AccessibleContext. Returns whether successful;
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ BOOL getVisibleChildren(const long vmID, const AccessibleContext accessibleContext,
++ const int startIndex, VisibleChildrenInfo *visibleChildrenInfo) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getVisibleChildren(vmID, accessibleContext, startIndex,
++ visibleChildrenInfo);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++ BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext,
++ const int position) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.setCaretPosition(vmID, accessibleContext, position);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Gets the text caret location
++ */
++ BOOL getCaretLocation(long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index) {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getCaretLocation(vmID, ac, rectInfo, index);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Gets the number of events waiting to fire
++ */
++ int getEventsWaiting() {
++ if (theAccessBridgeInitializedFlag == TRUE) {
++ return theAccessBridge.getEventsWaiting();
++ }
++ return FALSE;
++ }
++
++#ifdef __cplusplus
++}
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeCalls.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,706 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * Wrapper functions around calls to the AccessBridge DLL
++ */
++
++#include <windows.h>
++#include <jni.h>
++#include "AccessBridgeCallbacks.h"
++#include "AccessBridgePackages.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define null NULL
++
++ typedef JOBJECT64 AccessibleContext;
++ typedef JOBJECT64 AccessibleText;
++ typedef JOBJECT64 AccessibleValue;
++ typedef JOBJECT64 AccessibleSelection;
++ typedef JOBJECT64 Java_Object;
++ typedef JOBJECT64 PropertyChangeEvent;
++ typedef JOBJECT64 FocusEvent;
++ typedef JOBJECT64 CaretEvent;
++ typedef JOBJECT64 MouseEvent;
++ typedef JOBJECT64 MenuEvent;
++ typedef JOBJECT64 AccessibleTable;
++ typedef JOBJECT64 AccessibleHyperlink;
++ typedef JOBJECT64 AccessibleHypertext;
++
++
++ typedef void (*Windows_runFP) ();
++
++ typedef void (*SetPropertyChangeFP) (AccessBridge_PropertyChangeFP fp);
++
++ typedef void (*SetJavaShutdownFP) (AccessBridge_JavaShutdownFP fp);
++ typedef void (*SetFocusGainedFP) (AccessBridge_FocusGainedFP fp);
++ typedef void (*SetFocusLostFP) (AccessBridge_FocusLostFP fp);
++
++ typedef void (*SetCaretUpdateFP) (AccessBridge_CaretUpdateFP fp);
++
++ typedef void (*SetMouseClickedFP) (AccessBridge_MouseClickedFP fp);
++ typedef void (*SetMouseEnteredFP) (AccessBridge_MouseEnteredFP fp);
++ typedef void (*SetMouseExitedFP) (AccessBridge_MouseExitedFP fp);
++ typedef void (*SetMousePressedFP) (AccessBridge_MousePressedFP fp);
++ typedef void (*SetMouseReleasedFP) (AccessBridge_MouseReleasedFP fp);
++
++ typedef void (*SetMenuCanceledFP) (AccessBridge_MenuCanceledFP fp);
++ typedef void (*SetMenuDeselectedFP) (AccessBridge_MenuDeselectedFP fp);
++ typedef void (*SetMenuSelectedFP) (AccessBridge_MenuSelectedFP fp);
++ typedef void (*SetPopupMenuCanceledFP) (AccessBridge_PopupMenuCanceledFP fp);
++ typedef void (*SetPopupMenuWillBecomeInvisibleFP) (AccessBridge_PopupMenuWillBecomeInvisibleFP fp);
++ typedef void (*SetPopupMenuWillBecomeVisibleFP) (AccessBridge_PopupMenuWillBecomeVisibleFP fp);
++
++ typedef void (*SetPropertyNameChangeFP) (AccessBridge_PropertyNameChangeFP fp);
++ typedef void (*SetPropertyDescriptionChangeFP) (AccessBridge_PropertyDescriptionChangeFP fp);
++ typedef void (*SetPropertyStateChangeFP) (AccessBridge_PropertyStateChangeFP fp);
++ typedef void (*SetPropertyValueChangeFP) (AccessBridge_PropertyValueChangeFP fp);
++ typedef void (*SetPropertySelectionChangeFP) (AccessBridge_PropertySelectionChangeFP fp);
++ typedef void (*SetPropertyTextChangeFP) (AccessBridge_PropertyTextChangeFP fp);
++ typedef void (*SetPropertyCaretChangeFP) (AccessBridge_PropertyCaretChangeFP fp);
++ typedef void (*SetPropertyVisibleDataChangeFP) (AccessBridge_PropertyVisibleDataChangeFP fp);
++ typedef void (*SetPropertyChildChangeFP) (AccessBridge_PropertyChildChangeFP fp);
++ typedef void (*SetPropertyActiveDescendentChangeFP) (AccessBridge_PropertyActiveDescendentChangeFP fp);
++
++ typedef void (*SetPropertyTableModelChangeFP) (AccessBridge_PropertyTableModelChangeFP fp);
++
++ typedef void (*ReleaseJavaObjectFP) (long vmID, Java_Object object);
++
++ typedef BOOL (*GetVersionInfoFP) (long vmID, AccessBridgeVersionInfo *info);
++
++ typedef BOOL (*IsJavaWindowFP) (HWND window);
++ typedef BOOL (*IsSameObjectFP) (long vmID, JOBJECT64 obj1, JOBJECT64 obj2);
++ typedef BOOL (*GetAccessibleContextFromHWNDFP) (HWND window, long *vmID, AccessibleContext *ac);
++ typedef HWND (*getHWNDFromAccessibleContextFP) (long vmID, AccessibleContext ac);
++
++ typedef BOOL (*GetAccessibleContextAtFP) (long vmID, AccessibleContext acParent,
++ jint x, jint y, AccessibleContext *ac);
++ typedef BOOL (*GetAccessibleContextWithFocusFP) (HWND window, long *vmID, AccessibleContext *ac);
++ typedef BOOL (*GetAccessibleContextInfoFP) (long vmID, AccessibleContext ac, AccessibleContextInfo *info);
++ typedef AccessibleContext (*GetAccessibleChildFromContextFP) (long vmID, AccessibleContext ac, jint i);
++ typedef AccessibleContext (*GetAccessibleParentFromContextFP) (long vmID, AccessibleContext ac);
++
++ /* begin AccessibleTable */
++ typedef BOOL (*getAccessibleTableInfoFP) (long vmID, AccessibleContext ac, AccessibleTableInfo *tableInfo);
++ typedef BOOL (*getAccessibleTableCellInfoFP) (long vmID, AccessibleTable accessibleTable,
++ jint row, jint column, AccessibleTableCellInfo *tableCellInfo);
++
++ typedef BOOL (*getAccessibleTableRowHeaderFP) (long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo);
++ typedef BOOL (*getAccessibleTableColumnHeaderFP) (long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo);
++
++ typedef AccessibleContext (*getAccessibleTableRowDescriptionFP) (long vmID, AccessibleContext acParent, jint row);
++ typedef AccessibleContext (*getAccessibleTableColumnDescriptionFP) (long vmID, AccessibleContext acParent, jint column);
++
++ typedef jint (*getAccessibleTableRowSelectionCountFP) (long vmID, AccessibleTable table);
++ typedef BOOL (*isAccessibleTableRowSelectedFP) (long vmID, AccessibleTable table, jint row);
++ typedef BOOL (*getAccessibleTableRowSelectionsFP) (long vmID, AccessibleTable table, jint count,
++ jint *selections);
++
++ typedef jint (*getAccessibleTableColumnSelectionCountFP) (long vmID, AccessibleTable table);
++ typedef BOOL (*isAccessibleTableColumnSelectedFP) (long vmID, AccessibleTable table, jint column);
++ typedef BOOL (*getAccessibleTableColumnSelectionsFP) (long vmID, AccessibleTable table, jint count,
++ jint *selections);
++
++ typedef jint (*getAccessibleTableRowFP) (long vmID, AccessibleTable table, jint index);
++ typedef jint (*getAccessibleTableColumnFP) (long vmID, AccessibleTable table, jint index);
++ typedef jint (*getAccessibleTableIndexFP) (long vmID, AccessibleTable table, jint row, jint column);
++ /* end AccessibleTable */
++
++ /* AccessibleRelationSet */
++ typedef BOOL (*getAccessibleRelationSetFP) (long vmID, AccessibleContext accessibleContext,
++ AccessibleRelationSetInfo *relationSetInfo);
++
++ /* AccessibleHypertext */
++ typedef BOOL (*getAccessibleHypertextFP)(long vmID, AccessibleContext accessibleContext,
++ AccessibleHypertextInfo *hypertextInfo);
++
++ typedef BOOL (*activateAccessibleHyperlinkFP)(long vmID, AccessibleContext accessibleContext,
++ AccessibleHyperlink accessibleHyperlink);
++
++ typedef jint (*getAccessibleHyperlinkCountFP)(const long vmID,
++ const AccessibleContext accessibleContext);
++
++ typedef BOOL (*getAccessibleHypertextExtFP) (const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nStartIndex,
++ AccessibleHypertextInfo *hypertextInfo);
++
++ typedef jint (*getAccessibleHypertextLinkIndexFP)(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex);
++
++ typedef BOOL (*getAccessibleHyperlinkFP)(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex,
++ AccessibleHyperlinkInfo *hyperlinkInfo);
++
++
++ /* Accessible KeyBindings, Icons and Actions */
++ typedef BOOL (*getAccessibleKeyBindingsFP)(long vmID, AccessibleContext accessibleContext,
++ AccessibleKeyBindings *keyBindings);
++
++ typedef BOOL (*getAccessibleIconsFP)(long vmID, AccessibleContext accessibleContext,
++ AccessibleIcons *icons);
++
++ typedef BOOL (*getAccessibleActionsFP)(long vmID, AccessibleContext accessibleContext,
++ AccessibleActions *actions);
++
++ typedef BOOL (*doAccessibleActionsFP)(long vmID, AccessibleContext accessibleContext,
++ AccessibleActionsToDo *actionsToDo, jint *failure);
++
++
++ /* AccessibleText */
++
++ typedef BOOL (*GetAccessibleTextInfoFP) (long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y);
++ typedef BOOL (*GetAccessibleTextItemsFP) (long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index);
++ typedef BOOL (*GetAccessibleTextSelectionInfoFP) (long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection);
++ typedef BOOL (*GetAccessibleTextAttributesFP) (long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes);
++ typedef BOOL (*GetAccessibleTextRectFP) (long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index);
++ typedef BOOL (*GetAccessibleTextLineBoundsFP) (long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex);
++ typedef BOOL (*GetAccessibleTextRangeFP) (long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len);
++
++ typedef BOOL (*GetCurrentAccessibleValueFromContextFP) (long vmID, AccessibleValue av, wchar_t *value, short len);
++ typedef BOOL (*GetMaximumAccessibleValueFromContextFP) (long vmID, AccessibleValue av, wchar_t *value, short len);
++ typedef BOOL (*GetMinimumAccessibleValueFromContextFP) (long vmID, AccessibleValue av, wchar_t *value, short len);
++
++ typedef void (*AddAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as, int i);
++ typedef void (*ClearAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as);
++ typedef JOBJECT64 (*GetAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as, int i);
++ typedef int (*GetAccessibleSelectionCountFromContextFP) (long vmID, AccessibleSelection as);
++ typedef BOOL (*IsAccessibleChildSelectedFromContextFP) (long vmID, AccessibleSelection as, int i);
++ typedef void (*RemoveAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as, int i);
++ typedef void (*SelectAllAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as);
++
++ /* Utility methods */
++
++ typedef BOOL (*setTextContentsFP) (const long vmID, const AccessibleContext ac, const wchar_t *text);
++ typedef AccessibleContext (*getParentWithRoleFP) (const long vmID, const AccessibleContext ac, const wchar_t *role);
++ typedef AccessibleContext (*getParentWithRoleElseRootFP) (const long vmID, const AccessibleContext ac, const wchar_t *role);
++ typedef AccessibleContext (*getTopLevelObjectFP) (const long vmID, const AccessibleContext ac);
++ typedef int (*getObjectDepthFP) (const long vmID, const AccessibleContext ac);
++ typedef AccessibleContext (*getActiveDescendentFP) (const long vmID, const AccessibleContext ac);
++
++
++ typedef BOOL (*getVirtualAccessibleNameFP) (const long vmID, const AccessibleContext accessibleContext,
++ wchar_t *name, int len);
++
++ typedef BOOL (*requestFocusFP) (const long vmID, const AccessibleContext accessibleContext);
++
++ typedef BOOL (*selectTextRangeFP) (const long vmID, const AccessibleContext accessibleContext,
++ const int startIndex, const int endIndex);
++
++ typedef BOOL (*getTextAttributesInRangeFP) (const long vmID, const AccessibleContext accessibleContext,
++ const int startIndex, const int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len);
++
++ typedef int (*getVisibleChildrenCountFP) (const long vmID, const AccessibleContext accessibleContext);
++
++ typedef BOOL (*getVisibleChildrenFP) (const long vmID, const AccessibleContext accessibleContext,
++ const int startIndex, VisibleChildrenInfo *children);
++
++ typedef BOOL (*setCaretPositionFP) (const long vmID, const AccessibleContext accessibleContext, const int position);
++
++ typedef BOOL (*getCaretLocationFP) (long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index);
++
++ typedef int (*getEventsWaitingFP) ();
++
++ typedef struct AccessBridgeFPsTag {
++ Windows_runFP Windows_run;
++
++ SetPropertyChangeFP SetPropertyChange;
++
++ SetJavaShutdownFP SetJavaShutdown;
++ SetFocusGainedFP SetFocusGained;
++ SetFocusLostFP SetFocusLost;
++
++ SetCaretUpdateFP SetCaretUpdate;
++
++ SetMouseClickedFP SetMouseClicked;
++ SetMouseEnteredFP SetMouseEntered;
++ SetMouseExitedFP SetMouseExited;
++ SetMousePressedFP SetMousePressed;
++ SetMouseReleasedFP SetMouseReleased;
++
++ SetMenuCanceledFP SetMenuCanceled;
++ SetMenuDeselectedFP SetMenuDeselected;
++ SetMenuSelectedFP SetMenuSelected;
++ SetPopupMenuCanceledFP SetPopupMenuCanceled;
++ SetPopupMenuWillBecomeInvisibleFP SetPopupMenuWillBecomeInvisible;
++ SetPopupMenuWillBecomeVisibleFP SetPopupMenuWillBecomeVisible;
++
++ SetPropertyNameChangeFP SetPropertyNameChange;
++ SetPropertyDescriptionChangeFP SetPropertyDescriptionChange;
++ SetPropertyStateChangeFP SetPropertyStateChange;
++ SetPropertyValueChangeFP SetPropertyValueChange;
++ SetPropertySelectionChangeFP SetPropertySelectionChange;
++ SetPropertyTextChangeFP SetPropertyTextChange;
++ SetPropertyCaretChangeFP SetPropertyCaretChange;
++ SetPropertyVisibleDataChangeFP SetPropertyVisibleDataChange;
++ SetPropertyChildChangeFP SetPropertyChildChange;
++ SetPropertyActiveDescendentChangeFP SetPropertyActiveDescendentChange;
++
++ SetPropertyTableModelChangeFP SetPropertyTableModelChange;
++
++ ReleaseJavaObjectFP ReleaseJavaObject;
++ GetVersionInfoFP GetVersionInfo;
++
++ IsJavaWindowFP IsJavaWindow;
++ IsSameObjectFP IsSameObject;
++ GetAccessibleContextFromHWNDFP GetAccessibleContextFromHWND;
++ getHWNDFromAccessibleContextFP getHWNDFromAccessibleContext;
++
++ GetAccessibleContextAtFP GetAccessibleContextAt;
++ GetAccessibleContextWithFocusFP GetAccessibleContextWithFocus;
++ GetAccessibleContextInfoFP GetAccessibleContextInfo;
++ GetAccessibleChildFromContextFP GetAccessibleChildFromContext;
++ GetAccessibleParentFromContextFP GetAccessibleParentFromContext;
++
++ getAccessibleTableInfoFP getAccessibleTableInfo;
++ getAccessibleTableCellInfoFP getAccessibleTableCellInfo;
++
++ getAccessibleTableRowHeaderFP getAccessibleTableRowHeader;
++ getAccessibleTableColumnHeaderFP getAccessibleTableColumnHeader;
++
++ getAccessibleTableRowDescriptionFP getAccessibleTableRowDescription;
++ getAccessibleTableColumnDescriptionFP getAccessibleTableColumnDescription;
++
++ getAccessibleTableRowSelectionCountFP getAccessibleTableRowSelectionCount;
++ isAccessibleTableRowSelectedFP isAccessibleTableRowSelected;
++ getAccessibleTableRowSelectionsFP getAccessibleTableRowSelections;
++
++ getAccessibleTableColumnSelectionCountFP getAccessibleTableColumnSelectionCount;
++ isAccessibleTableColumnSelectedFP isAccessibleTableColumnSelected;
++ getAccessibleTableColumnSelectionsFP getAccessibleTableColumnSelections;
++
++ getAccessibleTableRowFP getAccessibleTableRow;
++ getAccessibleTableColumnFP getAccessibleTableColumn;
++ getAccessibleTableIndexFP getAccessibleTableIndex;
++
++ getAccessibleRelationSetFP getAccessibleRelationSet;
++
++ getAccessibleHypertextFP getAccessibleHypertext;
++ activateAccessibleHyperlinkFP activateAccessibleHyperlink;
++ getAccessibleHyperlinkCountFP getAccessibleHyperlinkCount;
++ getAccessibleHypertextExtFP getAccessibleHypertextExt;
++ getAccessibleHypertextLinkIndexFP getAccessibleHypertextLinkIndex;
++ getAccessibleHyperlinkFP getAccessibleHyperlink;
++
++ getAccessibleKeyBindingsFP getAccessibleKeyBindings;
++ getAccessibleIconsFP getAccessibleIcons;
++ getAccessibleActionsFP getAccessibleActions;
++ doAccessibleActionsFP doAccessibleActions;
++
++ GetAccessibleTextInfoFP GetAccessibleTextInfo;
++ GetAccessibleTextItemsFP GetAccessibleTextItems;
++ GetAccessibleTextSelectionInfoFP GetAccessibleTextSelectionInfo;
++ GetAccessibleTextAttributesFP GetAccessibleTextAttributes;
++ GetAccessibleTextRectFP GetAccessibleTextRect;
++ GetAccessibleTextLineBoundsFP GetAccessibleTextLineBounds;
++ GetAccessibleTextRangeFP GetAccessibleTextRange;
++
++ GetCurrentAccessibleValueFromContextFP GetCurrentAccessibleValueFromContext;
++ GetMaximumAccessibleValueFromContextFP GetMaximumAccessibleValueFromContext;
++ GetMinimumAccessibleValueFromContextFP GetMinimumAccessibleValueFromContext;
++
++ AddAccessibleSelectionFromContextFP AddAccessibleSelectionFromContext;
++ ClearAccessibleSelectionFromContextFP ClearAccessibleSelectionFromContext;
++ GetAccessibleSelectionFromContextFP GetAccessibleSelectionFromContext;
++ GetAccessibleSelectionCountFromContextFP GetAccessibleSelectionCountFromContext;
++ IsAccessibleChildSelectedFromContextFP IsAccessibleChildSelectedFromContext;
++ RemoveAccessibleSelectionFromContextFP RemoveAccessibleSelectionFromContext;
++ SelectAllAccessibleSelectionFromContextFP SelectAllAccessibleSelectionFromContext;
++
++ setTextContentsFP setTextContents;
++ getParentWithRoleFP getParentWithRole;
++ getTopLevelObjectFP getTopLevelObject;
++ getParentWithRoleElseRootFP getParentWithRoleElseRoot;
++ getObjectDepthFP getObjectDepth;
++ getActiveDescendentFP getActiveDescendent;
++
++ getVirtualAccessibleNameFP getVirtualAccessibleName;
++ requestFocusFP requestFocus;
++ selectTextRangeFP selectTextRange;
++ getTextAttributesInRangeFP getTextAttributesInRange;
++ getVisibleChildrenCountFP getVisibleChildrenCount;
++ getVisibleChildrenFP getVisibleChildren;
++ setCaretPositionFP setCaretPosition;
++ getCaretLocationFP getCaretLocation;
++
++ getEventsWaitingFP getEventsWaiting;
++
++ } AccessBridgeFPs;
++
++
++ /**
++ * Initialize the world
++ */
++ BOOL initializeAccessBridge();
++ BOOL shutdownAccessBridge();
++
++ /**
++ * Window routines
++ */
++ BOOL IsJavaWindow(HWND window);
++
++ // Returns the virtual machine ID and AccessibleContext for a top-level window
++ BOOL GetAccessibleContextFromHWND(HWND target, long *vmID, AccessibleContext *ac);
++
++ // Returns the HWND from the AccessibleContext of a top-level window
++ HWND getHWNDFromAccessibleContext(long vmID, AccessibleContext ac);
++
++
++ /**
++ * Event handling routines
++ */
++ void SetJavaShutdown(AccessBridge_JavaShutdownFP fp);
++ void SetFocusGained(AccessBridge_FocusGainedFP fp);
++ void SetFocusLost(AccessBridge_FocusLostFP fp);
++
++ void SetCaretUpdate(AccessBridge_CaretUpdateFP fp);
++
++ void SetMouseClicked(AccessBridge_MouseClickedFP fp);
++ void SetMouseEntered(AccessBridge_MouseEnteredFP fp);
++ void SetMouseExited(AccessBridge_MouseExitedFP fp);
++ void SetMousePressed(AccessBridge_MousePressedFP fp);
++ void SetMouseReleased(AccessBridge_MouseReleasedFP fp);
++
++ void SetMenuCanceled(AccessBridge_MenuCanceledFP fp);
++ void SetMenuDeselected(AccessBridge_MenuDeselectedFP fp);
++ void SetMenuSelected(AccessBridge_MenuSelectedFP fp);
++ void SetPopupMenuCanceled(AccessBridge_PopupMenuCanceledFP fp);
++ void SetPopupMenuWillBecomeInvisible(AccessBridge_PopupMenuWillBecomeInvisibleFP fp);
++ void SetPopupMenuWillBecomeVisible(AccessBridge_PopupMenuWillBecomeVisibleFP fp);
++
++ void SetPropertyNameChange(AccessBridge_PropertyNameChangeFP fp);
++ void SetPropertyDescriptionChange(AccessBridge_PropertyDescriptionChangeFP fp);
++ void SetPropertyStateChange(AccessBridge_PropertyStateChangeFP fp);
++ void SetPropertyValueChange(AccessBridge_PropertyValueChangeFP fp);
++ void SetPropertySelectionChange(AccessBridge_PropertySelectionChangeFP fp);
++ void SetPropertyTextChange(AccessBridge_PropertyTextChangeFP fp);
++ void SetPropertyCaretChange(AccessBridge_PropertyCaretChangeFP fp);
++ void SetPropertyVisibleDataChange(AccessBridge_PropertyVisibleDataChangeFP fp);
++ void SetPropertyChildChange(AccessBridge_PropertyChildChangeFP fp);
++ void SetPropertyActiveDescendentChange(AccessBridge_PropertyActiveDescendentChangeFP fp);
++
++ void SetPropertyTableModelChange(AccessBridge_PropertyTableModelChangeFP fp);
++
++
++ /**
++ * General routines
++ */
++ void ReleaseJavaObject(long vmID, Java_Object object);
++ BOOL GetVersionInfo(long vmID, AccessBridgeVersionInfo *info);
++ HWND GetHWNDFromAccessibleContext(long vmID, JOBJECT64 accesibleContext);
++
++ /**
++ * Accessible Context routines
++ */
++ BOOL GetAccessibleContextAt(long vmID, AccessibleContext acParent,
++ jint x, jint y, AccessibleContext *ac);
++ BOOL GetAccessibleContextWithFocus(HWND window, long *vmID, AccessibleContext *ac);
++ BOOL GetAccessibleContextInfo(long vmID, AccessibleContext ac, AccessibleContextInfo *info);
++ AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index);
++ AccessibleContext GetAccessibleParentFromContext(long vmID, AccessibleContext ac);
++
++ /**
++ * Accessible Text routines
++ */
++ BOOL GetAccessibleTextInfo(long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y);
++ BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index);
++ BOOL GetAccessibleTextSelectionInfo(long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection);
++ BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes);
++ BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index);
++ BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex);
++ BOOL GetAccessibleTextRange(long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len);
++
++ /* begin AccessibleTable routines */
++ BOOL getAccessibleTableInfo(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo);
++
++ BOOL getAccessibleTableCellInfo(long vmID, AccessibleTable accessibleTable, jint row, jint column,
++ AccessibleTableCellInfo *tableCellInfo);
++
++ BOOL getAccessibleTableRowHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo);
++ BOOL getAccessibleTableColumnHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo);
++
++ AccessibleContext getAccessibleTableRowDescription(long vmID, AccessibleContext acParent, jint row);
++ AccessibleContext getAccessibleTableColumnDescription(long vmID, AccessibleContext acParent, jint column);
++
++ jint getAccessibleTableRowSelectionCount(long vmID, AccessibleTable table);
++ BOOL isAccessibleTableRowSelected(long vmID, AccessibleTable table, jint row);
++ BOOL getAccessibleTableRowSelections(long vmID, AccessibleTable table, jint count, jint *selections);
++
++ jint getAccessibleTableColumnSelectionCount(long vmID, AccessibleTable table);
++ BOOL isAccessibleTableColumnSelected(long vmID, AccessibleTable table, jint column);
++ BOOL getAccessibleTableColumnSelections(long vmID, AccessibleTable table, jint count, jint *selections);
++
++ jint getAccessibleTableRow(long vmID, AccessibleTable table, jint index);
++ jint getAccessibleTableColumn(long vmID, AccessibleTable table, jint index);
++ jint getAccessibleTableIndex(long vmID, AccessibleTable table, jint row, jint column);
++ /* end AccessibleTable */
++
++ /* ----- AccessibleRelationSet routines */
++ BOOL getAccessibleRelationSet(long vmID, AccessibleContext accessibleContext,
++ AccessibleRelationSetInfo *relationSetInfo);
++
++ /* ----- AccessibleHypertext routines */
++
++ /*
++ * Returns hypertext information associated with a component.
++ */
++ BOOL getAccessibleHypertext(long vmID, AccessibleContext accessibleContext,
++ AccessibleHypertextInfo *hypertextInfo);
++
++ /*
++ * Requests that a hyperlink be activated.
++ */
++ BOOL activateAccessibleHyperlink(long vmID, AccessibleContext accessibleContext,
++ AccessibleHyperlink accessibleHyperlink);
++
++ /*
++ * Returns the number of hyperlinks in a component
++ * Maps to AccessibleHypertext.getLinkCount.
++ * Returns -1 on error.
++ */
++ jint getAccessibleHyperlinkCount(const long vmID,
++ const AccessibleHypertext hypertext);
++
++ /*
++ * This method is used to iterate through the hyperlinks in a component. It
++ * returns hypertext information for a component starting at hyperlink index
++ * nStartIndex. No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will
++ * be returned for each call to this method.
++ * Returns FALSE on error.
++ */
++ BOOL getAccessibleHypertextExt(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nStartIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertextInfo);
++
++ /*
++ * Returns the index into an array of hyperlinks that is associated with
++ * a character index in document; maps to AccessibleHypertext.getLinkIndex
++ * Returns -1 on error.
++ */
++ jint getAccessibleHypertextLinkIndex(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex);
++
++ /*
++ * Returns the nth hyperlink in a document
++ * Maps to AccessibleHypertext.getLink.
++ * Returns FALSE on error
++ */
++ BOOL getAccessibleHyperlink(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex,
++ /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo);
++
++ /* Accessible KeyBindings, Icons and Actions */
++
++ /*
++ * Returns a list of key bindings associated with a component.
++ */
++ BOOL getAccessibleKeyBindings(long vmID, AccessibleContext accessibleContext,
++ AccessibleKeyBindings *keyBindings);
++
++ /*
++ * Returns a list of icons associate with a component.
++ */
++ BOOL getAccessibleIcons(long vmID, AccessibleContext accessibleContext,
++ AccessibleIcons *icons);
++
++ /*
++ * Returns a list of actions that a component can perform.
++ */
++ BOOL getAccessibleActions(long vmID, AccessibleContext accessibleContext,
++ AccessibleActions *actions);
++
++ /*
++ * Request that a list of AccessibleActions be performed by a component.
++ * Returns TRUE if all actions are performed. Returns FALSE
++ * when the first requested action fails in which case "failure"
++ * contains the index of the action that failed.
++ */
++ BOOL doAccessibleActions(long vmID, AccessibleContext accessibleContext,
++ AccessibleActionsToDo *actionsToDo, jint *failure);
++
++
++
++ /* Additional utility methods */
++
++ /*
++ * Returns whether two object references refer to the same object.
++ */
++ BOOL IsSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2);
++
++ /**
++ * Sets editable text contents. The AccessibleContext must implement AccessibleEditableText and
++ * be editable. The maximum text length that can be set is MAX_STRING_SIZE - 1.
++ * Returns whether successful
++ */
++ BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text);
++
++ /**
++ * Returns the Accessible Context with the specified role that is the
++ * ancestor of a given object. The role is one of the role strings
++ * defined in AccessBridgePackages.h
++ * If there is no ancestor object that has the specified role,
++ * returns (AccessibleContext)0.
++ */
++ AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext,
++ const wchar_t *role);
++
++ /**
++ * Returns the Accessible Context with the specified role that is the
++ * ancestor of a given object. The role is one of the role strings
++ * defined in AccessBridgePackages.h. If an object with the specified
++ * role does not exist, returns the top level object for the Java Window.
++ * Returns (AccessibleContext)0 on error.
++ */
++ AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext,
++ const wchar_t *role);
++
++ /**
++ * Returns the Accessible Context for the top level object in
++ * a Java Window. This is same Accessible Context that is obtained
++ * from GetAccessibleContextFromHWND for that window. Returns
++ * (AccessibleContext)0 on error.
++ */
++ AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext);
++
++ /**
++ * Returns how deep in the object hierarchy a given object is.
++ * The top most object in the object hierarchy has an object depth of 0.
++ * Returns -1 on error.
++ */
++ int getObjectDepth (const long vmID, const AccessibleContext accessibleContext);
++
++ /**
++ * Returns the Accessible Context of the current ActiveDescendent of an object.
++ * This method assumes the ActiveDescendent is the component that is currently
++ * selected in a container object.
++ * Returns (AccessibleContext)0 on error or if there is no selection.
++ */
++ AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext);
++
++ /**
++ /**
++ * Accessible Value routines
++ */
++ BOOL GetCurrentAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len);
++ BOOL GetMaximumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len);
++ BOOL GetMinimumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len);
++
++ /**
++ * Accessible Selection routines
++ */
++ void AddAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i);
++ void ClearAccessibleSelectionFromContext(long vmID, AccessibleSelection as);
++ JOBJECT64 GetAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i);
++ int GetAccessibleSelectionCountFromContext(long vmID, AccessibleSelection as);
++ BOOL IsAccessibleChildSelectedFromContext(long vmID, AccessibleSelection as, int i);
++ void RemoveAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i);
++ void SelectAllAccessibleSelectionFromContext(long vmID, AccessibleSelection as);
++
++ /**
++ * Additional methods for Teton
++ */
++
++ /**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
++ * whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++ BOOL getVirtualAccessibleName(const long vmID, const AccessibleContext accessibleContext,
++ wchar_t *name, int len);
++
++ /**
++ * Request focus for a component. Returns whether successful.
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++ BOOL requestFocus(const long vmID, const AccessibleContext accessibleContext);
++
++ /**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful.
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++ BOOL selectTextRange(const long vmID, const AccessibleContext accessibleContext, const int startIndex,
++ const int endIndex);
++
++ /**
++ * Get text attributes between two indices. The attribute list includes the text at the
++ * start index and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++ BOOL getTextAttributesInRange(const long vmID, const AccessibleContext accessibleContext,
++ const int startIndex, const int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len);
++
++ /**
++ * Returns the number of visible children of a component. Returns -1 on error.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ int getVisibleChildrenCount(const long vmID, const AccessibleContext accessibleContext);
++
++ /**
++ * Gets the visible children of an AccessibleContext. Returns whether successful.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ BOOL getVisibleChildren(const long vmID, const AccessibleContext accessibleContext,
++ const int startIndex,
++ VisibleChildrenInfo *visibleChildrenInfo);
++
++ /**
++ * Set the caret to a text position. Returns whether successful.
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++ BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext,
++ const int position);
++
++ /**
++ * Gets the text caret location
++ */
++ BOOL getCaretLocation(long vmID, AccessibleContext ac,
++ AccessibleTextRectInfo *rectInfo, jint index);
++
++ /**
++ * Gets the number of events waiting to fire
++ */
++ int getEventsWaiting();
++
++#ifdef __cplusplus
++}
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeDebug.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,156 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * A class to manage AccessBridge debugging
++ */
++
++#include "AccessBridgeDebug.h"
++#include <stdarg.h>
++#include <stdio.h>
++#include <windows.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/**
++ * print a GetLastError message
++ */
++char *printError(char *msg) {
++ LPVOID lpMsgBuf = NULL;
++ static char retbuf[256];
++
++ if (msg != NULL) {
++ strncpy((char *)retbuf, msg, sizeof(retbuf));
++ }
++ if (!FormatMessage(
++ FORMAT_MESSAGE_ALLOCATE_BUFFER |
++ FORMAT_MESSAGE_FROM_SYSTEM |
++ FORMAT_MESSAGE_IGNORE_INSERTS,
++ NULL,
++ GetLastError(),
++ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
++ (LPTSTR) &lpMsgBuf,
++ 0,
++ NULL ))
++ {
++ PrintDebugString(" %s: FormatMessage failed", msg);
++ } else {
++ PrintDebugString(" %s: %s", msg, (char *)lpMsgBuf);
++ }
++ if (lpMsgBuf != NULL) {
++ strncat((char *)retbuf, ": ", sizeof(retbuf) - strlen(retbuf) - 1);
++ strncat((char *)retbuf, (char *)lpMsgBuf, sizeof(retbuf) - strlen(retbuf) - 1);
++ }
++ return (char *)retbuf;
++}
++
++
++ /**
++ * Send debugging info to the appropriate place
++ */
++ void PrintDebugString(char *msg, ...) {
++#ifdef DEBUGGING_ON
++ char buf[1024];
++ va_list argprt;
++
++ va_start(argprt, msg); // set up argptr
++ vsprintf(buf, msg, argprt);
++#ifdef SEND_TO_OUTPUT_DEBUG_STRING
++ OutputDebugString(buf);
++#endif
++#ifdef SEND_TO_CONSOLE
++ printf(buf);
++ printf("\r\n");
++#endif
++#endif
++ }
++
++ /**
++ * Send Java debugging info to the appropriate place
++ */
++ void PrintJavaDebugString2(char *msg, ...) {
++#ifdef JAVA_DEBUGGING_ON
++ char buf[1024];
++ va_list argprt;
++
++ va_start(argprt, msg); // set up argptr
++ vsprintf(buf, msg, argprt);
++#ifdef SEND_TO_OUTPUT_DEBUG_STRING
++ OutputDebugString(buf);
++#endif
++#ifdef SEND_TO_CONSOLE
++ printf(buf);
++ printf("\r\n");
++#endif
++#endif
++ }
++ /**
++ * Wide version of the method to send debugging info to the appropriate place
++ */
++ void wPrintDebugString(wchar_t *msg, ...) {
++#ifdef DEBUGGING_ON
++ char buf[1024];
++ char charmsg[256];
++ va_list argprt;
++
++ va_start(argprt, msg); // set up argptr
++ sprintf(charmsg, "%ls", msg); // convert format string to multi-byte
++ vsprintf(buf, charmsg, argprt);
++#ifdef SEND_TO_OUTPUT_DEBUG_STRING
++ OutputDebugString(buf);
++#endif
++#ifdef SEND_TO_CONSOLE
++ printf(buf);
++ printf("\r\n");
++#endif
++#endif
++ }
++
++ /**
++ * Wide version of the method to send Java debugging info to the appropriate place
++ */
++ void wPrintJavaDebugString(wchar_t *msg, ...) {
++#ifdef JAVA_DEBUGGING_ON
++ char buf[1024];
++ char charmsg[256];
++ va_list argprt;
++
++ va_start(argprt, msg); // set up argptr
++ sprintf(charmsg, "%ls", msg); // convert format string to multi-byte
++ vsprintf(buf, charmsg, argprt);
++#ifdef SEND_TO_OUTPUT_DEBUG_STRING
++ OutputDebugString(buf);
++#endif
++#ifdef SEND_TO_CONSOLE
++ printf(buf);
++ printf("\r\n");
++#endif
++#endif
++ }
++#ifdef __cplusplus
++}
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeDebug.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,63 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * A class to manage AccessBridge debugging
++ */
++
++#ifndef __AccessBridgeDebug_H__
++#define __AccessBridgeDebug_H__
++
++#include <crtdbg.h>
++#include <windows.h>
++
++#ifdef DEBUG
++#define DEBUGGING_ON
++#define SEND_TO_OUTPUT_DEBUG_STRING
++//#define JAVA_DEBUGGING_ON
++#endif
++
++#ifdef DEBUGGING_ON
++#define DEBUG_CODE(x) x
++#else
++#define DEBUG_CODE(x) /* */
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++ char *printError(char *msg);
++ void PrintDebugString(char *msg, ...);
++ void PrintJavaDebugString(char *msg, ...);
++ void wPrintJavaDebugString(wchar_t *msg, ...);
++ void wPrintDebugString(wchar_t *msg, ...);
++
++#ifdef __cplusplus
++}
++#endif
++
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeEventHandler.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,382 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * A class to manage firing Accessibility events to Windows AT
++ */
++
++#include "AccessBridgeDebug.h"
++#include "AccessBridgeEventHandler.h"
++#include "AccessBridgePackages.h"
++#include "WinAccessBridge.h"
++
++DEBUG_CODE(extern HWND theDialogWindow);
++extern "C" {
++DEBUG_CODE(void AppendToCallInfo(char *s));
++}
++
++
++// -----------------------------
++
++/**
++ * Initialization. Set all callbacks to null
++ */
++AccessBridgeEventHandler::AccessBridgeEventHandler() {
++ javaEventMask = 0;
++ accessibilityEventMask = 0;
++
++ propertyChangeFP = (AccessBridge_PropertyChangeFP) NULL;
++ javaShutdownFP = (AccessBridge_JavaShutdownFP) NULL;
++ focusGainedFP = (AccessBridge_FocusGainedFP) NULL;
++ focusLostFP = (AccessBridge_FocusLostFP) NULL;
++ caretUpdateFP = (AccessBridge_CaretUpdateFP) NULL;
++ mouseClickedFP = (AccessBridge_MouseClickedFP) NULL;
++ mouseEnteredFP = (AccessBridge_MouseEnteredFP) NULL;
++ mouseExitedFP = (AccessBridge_MouseExitedFP) NULL;
++ mousePressedFP = (AccessBridge_MousePressedFP) NULL;
++ mouseReleasedFP = (AccessBridge_MouseReleasedFP) NULL;
++ menuCanceledFP = (AccessBridge_MenuCanceledFP) NULL;
++ menuDeselectedFP = (AccessBridge_MenuDeselectedFP) NULL;
++ menuSelectedFP = (AccessBridge_MenuSelectedFP) NULL;
++ popupMenuCanceledFP = (AccessBridge_PopupMenuCanceledFP) NULL;
++ popupMenuWillBecomeInvisibleFP = (AccessBridge_PopupMenuWillBecomeInvisibleFP) NULL;
++ popupMenuWillBecomeVisibleFP = (AccessBridge_PopupMenuWillBecomeVisibleFP) NULL;
++
++ propertyNameChangeFP = (AccessBridge_PropertyNameChangeFP) NULL;
++ propertyDescriptionChangeFP = (AccessBridge_PropertyDescriptionChangeFP) NULL;
++ propertyStateChangeFP = (AccessBridge_PropertyStateChangeFP) NULL;
++ propertyValueChangeFP = (AccessBridge_PropertyValueChangeFP) NULL;
++ propertySelectionChangeFP = (AccessBridge_PropertySelectionChangeFP) NULL;
++ propertyTextChangeFP = (AccessBridge_PropertyTextChangeFP) NULL;
++ propertyCaretChangeFP = (AccessBridge_PropertyCaretChangeFP) NULL;
++ propertyVisibleDataChangeFP = (AccessBridge_PropertyVisibleDataChangeFP) NULL;
++ propertyChildChangeFP = (AccessBridge_PropertyChildChangeFP) NULL;
++ propertyActiveDescendentChangeFP = (AccessBridge_PropertyActiveDescendentChangeFP) NULL;
++
++ propertyTableModelChangeFP = (AccessBridge_PropertyTableModelChangeFP) NULL;
++
++}
++
++/**
++ * Destruction.
++ */
++AccessBridgeEventHandler::~AccessBridgeEventHandler() {
++}
++
++
++// ------------ Event handling methods
++
++#define SET_JAVA_EVENT_FP(function, eventFP, callbackFP, eventConstant) \
++ void AccessBridgeEventHandler::function(eventFP fp, WinAccessBridge *wab) { \
++ callbackFP = fp; \
++ if (fp != (eventFP) 0) { \
++ javaEventMask |= eventConstant; \
++ wab->addJavaEventNotification(eventConstant); \
++ } else { \
++ javaEventMask &= (0xFFFFFFFF - eventConstant); \
++ wab->removeJavaEventNotification(eventConstant); \
++ } \
++ }
++
++SET_JAVA_EVENT_FP(setPropertyChangeFP, AccessBridge_PropertyChangeFP, propertyChangeFP, cPropertyChangeEvent)
++SET_JAVA_EVENT_FP(setJavaShutdownFP, AccessBridge_JavaShutdownFP, javaShutdownFP, cJavaShutdownEvent)
++SET_JAVA_EVENT_FP(setFocusGainedFP, AccessBridge_FocusGainedFP, focusGainedFP, cFocusGainedEvent)
++SET_JAVA_EVENT_FP(setFocusLostFP, AccessBridge_FocusLostFP, focusLostFP, cFocusLostEvent)
++SET_JAVA_EVENT_FP(setCaretUpdateFP, AccessBridge_CaretUpdateFP, caretUpdateFP, cCaretUpdateEvent)
++SET_JAVA_EVENT_FP(setMouseClickedFP, AccessBridge_MouseClickedFP, mouseClickedFP, cMouseClickedEvent)
++SET_JAVA_EVENT_FP(setMouseEnteredFP, AccessBridge_MouseEnteredFP, mouseEnteredFP, cMouseEnteredEvent)
++SET_JAVA_EVENT_FP(setMouseExitedFP, AccessBridge_MouseExitedFP, mouseExitedFP, cMouseExitedEvent)
++SET_JAVA_EVENT_FP(setMousePressedFP, AccessBridge_MousePressedFP, mousePressedFP, cMousePressedEvent)
++SET_JAVA_EVENT_FP(setMouseReleasedFP, AccessBridge_MouseReleasedFP, mouseReleasedFP, cMouseReleasedEvent)
++SET_JAVA_EVENT_FP(setMenuCanceledFP, AccessBridge_MenuCanceledFP, menuCanceledFP, cMenuCanceledEvent)
++SET_JAVA_EVENT_FP(setMenuDeselectedFP, AccessBridge_MenuDeselectedFP, menuDeselectedFP, cMenuDeselectedEvent)
++SET_JAVA_EVENT_FP(setMenuSelectedFP, AccessBridge_MenuSelectedFP, menuSelectedFP, cMenuSelectedEvent)
++SET_JAVA_EVENT_FP(setPopupMenuCanceledFP, AccessBridge_PopupMenuCanceledFP, popupMenuCanceledFP, cPopupMenuCanceledEvent)
++SET_JAVA_EVENT_FP(setPopupMenuWillBecomeInvisibleFP, AccessBridge_PopupMenuWillBecomeInvisibleFP, popupMenuWillBecomeInvisibleFP, cPopupMenuWillBecomeInvisibleEvent)
++SET_JAVA_EVENT_FP(setPopupMenuWillBecomeVisibleFP, AccessBridge_PopupMenuWillBecomeVisibleFP, popupMenuWillBecomeVisibleFP, cPopupMenuWillBecomeVisibleEvent)
++
++#define SET_ACCESSIBILITY_EVENT_FP(function, eventFP, callbackFP, eventConstant) \
++ void AccessBridgeEventHandler::function(eventFP fp, WinAccessBridge *wab) { \
++ callbackFP = fp; \
++ if (fp != (eventFP) 0) { \
++ accessibilityEventMask |= eventConstant; \
++ wab->addAccessibilityEventNotification(eventConstant); \
++ } else { \
++ accessibilityEventMask &= (0xFFFFFFFF - eventConstant); \
++ wab->removeAccessibilityEventNotification(eventConstant); \
++ } \
++ }
++
++
++SET_ACCESSIBILITY_EVENT_FP(setPropertyNameChangeFP, AccessBridge_PropertyNameChangeFP, propertyNameChangeFP, cPropertyNameChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertyDescriptionChangeFP, AccessBridge_PropertyDescriptionChangeFP, propertyDescriptionChangeFP, cPropertyDescriptionChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertyStateChangeFP, AccessBridge_PropertyStateChangeFP, propertyStateChangeFP, cPropertyStateChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertyValueChangeFP, AccessBridge_PropertyValueChangeFP, propertyValueChangeFP, cPropertyValueChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertySelectionChangeFP, AccessBridge_PropertySelectionChangeFP, propertySelectionChangeFP, cPropertySelectionChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertyTextChangeFP, AccessBridge_PropertyTextChangeFP, propertyTextChangeFP, cPropertyTextChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertyCaretChangeFP, AccessBridge_PropertyCaretChangeFP, propertyCaretChangeFP, cPropertyCaretChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertyVisibleDataChangeFP, AccessBridge_PropertyVisibleDataChangeFP, propertyVisibleDataChangeFP, cPropertyVisibleDataChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertyChildChangeFP, AccessBridge_PropertyChildChangeFP, propertyChildChangeFP, cPropertyChildChangeEvent)
++SET_ACCESSIBILITY_EVENT_FP(setPropertyActiveDescendentChangeFP, AccessBridge_PropertyActiveDescendentChangeFP, propertyActiveDescendentChangeFP, cPropertyActiveDescendentChangeEvent)
++
++SET_ACCESSIBILITY_EVENT_FP(setPropertyTableModelChangeFP, AccessBridge_PropertyTableModelChangeFP, propertyTableModelChangeFP, cPropertyTableModelChangeEvent)
++
++
++/**
++ * propertyChange - extends the Java method call to Windows:
++ * propertyChange(PropertyChangeEvent e, )
++ *
++ * Note: PropertyChangeEvent object passed in is a globalReference;
++ * It is critical that releaseJavaObject() be called
++ * on the PropertyChangeEvent once it is no longer needed,
++ * otherwise the JavaVM/JNI will suffer memory leaks
++ *
++ */
++void
++AccessBridgeEventHandler::firePropertyChange(long vmID,
++ JOBJECT64 event, JOBJECT64 source,
++ wchar_t *property, wchar_t *oldName,
++ wchar_t *newName) {
++ DEBUG_CODE(char debugBuf[255]);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ DEBUG_CODE(sprintf(debugBuf, "\r\nCalling firePropertyChange(%p, %p):\r\n", event, source));
++#else // JOBJECT64 is jlong (64 bit)
++ DEBUG_CODE(sprintf(debugBuf, "\r\nCalling firePropertyChange(%016I64X, %016I64X):\r\n", event, source));
++#endif
++ DEBUG_CODE(AppendToCallInfo(debugBuf));
++
++ if (propertyChangeFP != (AccessBridge_PropertyChangeFP) 0) {
++ propertyChangeFP(vmID, event, source, property, oldName, newName);
++ } else {
++ DEBUG_CODE(AppendToCallInfo(" Error! propertyChangeFP == 0\r\n"));
++ }
++}
++
++
++/**
++ * FIRE_EVENT - macro for all fireXXX methods (which
++ * all are basically identical to one another...)
++ *
++ * Note: the event and source objects passed in are globalReferences;
++ * It is critical that releaseJavaObject() be called
++ * on them once they are no longer needed, otherwise
++ * the JavaVM/JNI will suffer memory leaks
++ *
++ */
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++const char fireEventDebugString[] = "\r\nIn AccessBridgeEventHandler::%s(%p, %p); vmID = %X\r\n";
++#else // JOBJECT64 is jlong (64 bit)
++const char fireEventDebugString[] = "\r\nIn AccessBridgeEventHandler::%s(%016I64X, %016I64X); vmID = %X\r\n";
++#endif
++
++#define FIRE_EVENT(method, FPprototype, eventFP) \
++ void AccessBridgeEventHandler::method(long vmID, JOBJECT64 event, JOBJECT64 source) { \
++ DEBUG_CODE(char debugBuf[255]); \
++ DEBUG_CODE(sprintf(debugBuf, fireEventDebugString, #method, event, source, vmID)); \
++ DEBUG_CODE(AppendToCallInfo(debugBuf)); \
++ if (eventFP != (FPprototype) 0) { \
++ eventFP(vmID, event, source); \
++ } else { \
++ DEBUG_CODE(AppendToCallInfo(" Error! eventFP == 0\r\n")); \
++ } \
++ }
++
++ void AccessBridgeEventHandler::fireJavaShutdown(long vmID) {
++ DEBUG_CODE(char debugBuf[255]);
++ DEBUG_CODE(sprintf(debugBuf, "\r\nCalling fireJavaShutdown; vmID = %X\r\n", vmID));
++ DEBUG_CODE(AppendToCallInfo(debugBuf));
++ if (javaShutdownFP != (AccessBridge_JavaShutdownFP) 0) {
++ javaShutdownFP(vmID);
++ } else {
++ DEBUG_CODE(AppendToCallInfo(" Error! javaShutdownFP == 0\r\n"));
++ }
++ }
++
++FIRE_EVENT(fireFocusGained, AccessBridge_FocusGainedFP, focusGainedFP)
++FIRE_EVENT(fireFocusLost, AccessBridge_FocusLostFP, focusLostFP)
++FIRE_EVENT(fireCaretUpdate, AccessBridge_CaretUpdateFP, caretUpdateFP)
++FIRE_EVENT(fireMouseClicked, AccessBridge_MouseClickedFP, mouseClickedFP)
++FIRE_EVENT(fireMouseEntered, AccessBridge_MouseEnteredFP, mouseEnteredFP)
++FIRE_EVENT(fireMouseExited, AccessBridge_MouseExitedFP, mouseExitedFP)
++FIRE_EVENT(fireMousePressed, AccessBridge_MousePressedFP, mousePressedFP)
++FIRE_EVENT(fireMouseReleased, AccessBridge_MouseReleasedFP, mouseReleasedFP)
++FIRE_EVENT(fireMenuCanceled, AccessBridge_MenuCanceledFP, menuCanceledFP)
++FIRE_EVENT(fireMenuDeselected, AccessBridge_MenuDeselectedFP, menuDeselectedFP)
++FIRE_EVENT(fireMenuSelected, AccessBridge_MenuSelectedFP, menuSelectedFP)
++FIRE_EVENT(firePopupMenuCanceled, AccessBridge_PopupMenuCanceledFP, popupMenuCanceledFP)
++FIRE_EVENT(firePopupMenuWillBecomeInvisible, AccessBridge_PopupMenuWillBecomeInvisibleFP, popupMenuWillBecomeInvisibleFP)
++FIRE_EVENT(firePopupMenuWillBecomeVisible, AccessBridge_PopupMenuWillBecomeVisibleFP, popupMenuWillBecomeVisibleFP)
++
++
++/**
++ * FIRE_PROPERTY_CHANGE - macro for all fireXXX methods (which
++ * all are basically identical to one another...
++ *
++ * Note: the event and source objects passed in are globalReferences;
++ * It is critical that releaseJavaObject() be called
++ * on them once they are no longer needed, otherwise
++ * the JavaVM/JNI will suffer memory leaks
++ *
++ */
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++const char firePropertyChangeDebugString[] = "\r\nIn AccessBridgeEventHandler::%s, Firing a no-param property change (%p, %p):\r\n";
++#else // JOBJECT64 is jlong (64 bit)
++const char firePropertyChangeDebugString[] = "\r\nIn AccessBridgeEventHandler::%s, Firing a no-param property change (%016I64X, %016I64X):\r\n";
++#endif
++
++#define FIRE_PROPERTY_CHANGE(method, FPprototype, eventFP) \
++ void AccessBridgeEventHandler::method(long vmID, JOBJECT64 event, JOBJECT64 source) { \
++ DEBUG_CODE(char debugBuf[255]); \
++ DEBUG_CODE(sprintf(debugBuf, firePropertyChangeDebugString, #method, event, source)); \
++ DEBUG_CODE(AppendToCallInfo(debugBuf)); \
++ if (eventFP != (FPprototype) 0) { \
++ eventFP(vmID, event, source); \
++ } else { \
++ DEBUG_CODE(AppendToCallInfo(" Error! eventFP == 0\r\n")); \
++ } \
++ }
++
++/**
++ * FIRE_STRING_PROPERTY_CHANGE - macro for all firePropertyXXXChange methods
++ * that have strings as the old/new values
++
++ * Note: the event and source objects passed in are globalReferences;
++ * It is critical that releaseJavaObject() be called
++ * on them once they are no longer needed, otherwise
++ * the JavaVM/JNI will suffer memory leaks
++ *
++ */
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++const char fireStringPropertyChangeDebugString[] = "\r\nIn AccessBridgeEventHandler::%s, Firing a string property change (%p, %p, %ls, %ls):\r\n";
++#else // JOBJECT64 is jlong (64 bit)
++const char fireStringPropertyChangeDebugString[] = "\r\nIn AccessBridgeEventHandler::%s, Firing a string property change (%016I64X, %016I64X, %ls, %ls):\r\n";
++#endif
++
++#define FIRE_STRING_PROPERTY_CHANGE(method, FPprototype, eventFP, oldValue, newValue) \
++ void AccessBridgeEventHandler::method(long vmID, JOBJECT64 event, JOBJECT64 source, \
++ wchar_t *oldValue, wchar_t *newValue) { \
++ DEBUG_CODE(char debugBuf[255]); \
++ DEBUG_CODE(sprintf(debugBuf, fireStringPropertyChangeDebugString, #method, event, source, oldValue, newValue)); \
++ DEBUG_CODE(AppendToCallInfo(debugBuf)); \
++ if (eventFP != (FPprototype) 0) { \
++ eventFP(vmID, event, source, oldValue, newValue); \
++ } else { \
++ DEBUG_CODE(AppendToCallInfo(" Error! eventFP == 0\r\n")); \
++ } \
++ }
++
++/**
++ * FIRE_INT_PROPERTY_CHANGE - macro for all firePropertyXXXChange methods
++ * that have ints as the old/new values
++ *
++ * Note: the event and source objects passed in are globalReferences;
++ * It is critical that releaseJavaObject() be called
++ * on them once they are no longer needed, otherwise
++ * the JavaVM/JNI will suffer memory leaks
++ *
++ */
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++const char fireIntPropertyChangeDebugString[] = "\r\nIn AccessBridgeEventHandler::%s, Firing an int property change (%p, %p, %d, %d):\r\n";
++#else // JOBJECT64 is jlong (64 bit)
++const char fireIntPropertyChangeDebugString[] = "\r\nIn AccessBridgeEventHandler::%s, Firing an int property change (%016I64X, %016I64X, %d, %d):\r\n";
++#endif
++
++#define FIRE_INT_PROPERTY_CHANGE(method, FPprototype, eventFP) \
++ void AccessBridgeEventHandler::method(long vmID, JOBJECT64 event, JOBJECT64 source, \
++ int oldValue, int newValue) { \
++ DEBUG_CODE(char debugBuf[255]); \
++ DEBUG_CODE(sprintf(debugBuf, fireIntPropertyChangeDebugString, #method, event, source, oldValue, newValue)); \
++ DEBUG_CODE(AppendToCallInfo(debugBuf)); \
++ if (eventFP != (FPprototype) 0) { \
++ eventFP(vmID, event, source, oldValue, newValue); \
++ } else { \
++ DEBUG_CODE(AppendToCallInfo(" Error! eventFP == 0\r\n")); \
++ } \
++ }
++
++/**
++ * FIRE_AC_PROPERTY_CHANGE - macro for all firePropertyXXXChange methods
++ * that have jobjects (AccessibleContexts) as the old/new values
++ *
++ * Note: the event and source objects passed in are globalReferences;
++ * It is critical that releaseJavaObject() be called
++ * on them once they are no longer needed, otherwise
++ * the JavaVM/JNI will suffer memory leaks
++ *
++ */
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++const char fireACPropertyChangeDebugString[] = "\r\nIn AccessBridgeEventHandler::%s, Firing an AC property change (%p, %p, %p, %p):\r\n";
++#else // JOBJECT64 is jlong (64 bit)
++const char fireACPropertyChangeDebugString[] = "\r\nIn AccessBridgeEventHandler::%s, Firing an AC property change (%016I64X, %016I64X, %016I64X, %016I64X):\r\n";
++#endif
++
++#define FIRE_AC_PROPERTY_CHANGE(method, FPprototype, eventFP) \
++ void AccessBridgeEventHandler::method(long vmID, JOBJECT64 event, JOBJECT64 source, \
++ JOBJECT64 oldValue, JOBJECT64 newValue) { \
++ DEBUG_CODE(char debugBuf[255]); \
++ DEBUG_CODE(sprintf(debugBuf, fireACPropertyChangeDebugString, #method, event, source, oldValue, newValue)); \
++ DEBUG_CODE(AppendToCallInfo(debugBuf)); \
++ if (eventFP != (FPprototype) 0) { \
++ eventFP(vmID, event, source, oldValue, newValue); \
++ } else { \
++ DEBUG_CODE(AppendToCallInfo(" Error! eventFP == 0\r\n")); \
++ } \
++ }
++
++FIRE_STRING_PROPERTY_CHANGE(firePropertyNameChange,
++ AccessBridge_PropertyNameChangeFP,
++ propertyNameChangeFP, oldName, newName)
++FIRE_STRING_PROPERTY_CHANGE(firePropertyDescriptionChange,
++ AccessBridge_PropertyDescriptionChangeFP,
++ propertyDescriptionChangeFP,
++ oldDescription, newDescription)
++FIRE_STRING_PROPERTY_CHANGE(firePropertyStateChange,
++ AccessBridge_PropertyStateChangeFP,
++ propertyStateChangeFP, oldState, newState)
++FIRE_STRING_PROPERTY_CHANGE(firePropertyValueChange,
++ AccessBridge_PropertyValueChangeFP,
++ propertyValueChangeFP, oldValue, newValue)
++FIRE_PROPERTY_CHANGE(firePropertySelectionChange,
++ AccessBridge_PropertySelectionChangeFP,
++ propertySelectionChangeFP)
++FIRE_PROPERTY_CHANGE(firePropertyTextChange,
++ AccessBridge_PropertyTextChangeFP,
++ propertyTextChangeFP);
++FIRE_INT_PROPERTY_CHANGE(firePropertyCaretChange,
++ AccessBridge_PropertyCaretChangeFP,
++ propertyCaretChangeFP)
++FIRE_PROPERTY_CHANGE(firePropertyVisibleDataChange,
++ AccessBridge_PropertyVisibleDataChangeFP,
++ propertyVisibleDataChangeFP)
++FIRE_AC_PROPERTY_CHANGE(firePropertyChildChange,
++ AccessBridge_PropertyChildChangeFP,
++ propertyChildChangeFP)
++FIRE_AC_PROPERTY_CHANGE(firePropertyActiveDescendentChange,
++ AccessBridge_PropertyActiveDescendentChangeFP,
++ propertyActiveDescendentChangeFP)
++
++FIRE_STRING_PROPERTY_CHANGE(firePropertyTableModelChange,
++ AccessBridge_PropertyTableModelChangeFP,
++ propertyTableModelChangeFP, oldValue, newValue)
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeEventHandler.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,161 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * A class to manage firing Accessibility events to Windows AT
++ */
++
++#ifndef __AccessBridgeEventHandler_H__
++#define __AccessBridgeEventHandler_H__
++
++#include "AccessBridgeCallbacks.h"
++#include "AccessBridgePackages.h"
++
++class WinAccessBridge;
++
++class AccessBridgeEventHandler {
++ long javaEventMask;
++ long accessibilityEventMask;
++
++ AccessBridge_PropertyChangeFP propertyChangeFP;
++ AccessBridge_JavaShutdownFP javaShutdownFP;
++ AccessBridge_FocusGainedFP focusGainedFP;
++ AccessBridge_FocusLostFP focusLostFP;
++ AccessBridge_CaretUpdateFP caretUpdateFP;
++ AccessBridge_MouseClickedFP mouseClickedFP;
++ AccessBridge_MouseEnteredFP mouseEnteredFP;
++ AccessBridge_MouseExitedFP mouseExitedFP;
++ AccessBridge_MousePressedFP mousePressedFP;
++ AccessBridge_MouseReleasedFP mouseReleasedFP;
++ AccessBridge_MenuCanceledFP menuCanceledFP;
++ AccessBridge_MenuDeselectedFP menuDeselectedFP;
++ AccessBridge_MenuSelectedFP menuSelectedFP;
++ AccessBridge_PopupMenuCanceledFP popupMenuCanceledFP;
++ AccessBridge_PopupMenuWillBecomeInvisibleFP popupMenuWillBecomeInvisibleFP;
++ AccessBridge_PopupMenuWillBecomeVisibleFP popupMenuWillBecomeVisibleFP;
++
++ AccessBridge_PropertyNameChangeFP propertyNameChangeFP;
++ AccessBridge_PropertyDescriptionChangeFP propertyDescriptionChangeFP;
++ AccessBridge_PropertyStateChangeFP propertyStateChangeFP;
++ AccessBridge_PropertyValueChangeFP propertyValueChangeFP;
++ AccessBridge_PropertySelectionChangeFP propertySelectionChangeFP;
++ AccessBridge_PropertyTextChangeFP propertyTextChangeFP;
++ AccessBridge_PropertyCaretChangeFP propertyCaretChangeFP;
++ AccessBridge_PropertyVisibleDataChangeFP propertyVisibleDataChangeFP;
++ AccessBridge_PropertyChildChangeFP propertyChildChangeFP;
++ AccessBridge_PropertyActiveDescendentChangeFP propertyActiveDescendentChangeFP;
++
++ AccessBridge_PropertyTableModelChangeFP propertyTableModelChangeFP;
++
++
++
++public:
++ AccessBridgeEventHandler();
++ ~AccessBridgeEventHandler();
++ long getJavaEventMask() {return javaEventMask;};
++ long getAccessibilityEventMask() {return accessibilityEventMask;};
++
++ // ------- Registry methods
++ void setPropertyChangeFP(AccessBridge_PropertyChangeFP fp, WinAccessBridge *wab);
++ void setJavaShutdownFP(AccessBridge_JavaShutdownFP fp, WinAccessBridge *wab);
++ void setFocusGainedFP(AccessBridge_FocusGainedFP fp, WinAccessBridge *wab);
++ void setFocusLostFP(AccessBridge_FocusLostFP fp, WinAccessBridge *wab);
++ void setCaretUpdateFP(AccessBridge_CaretUpdateFP fp, WinAccessBridge *wab);
++ void setMouseClickedFP(AccessBridge_MouseClickedFP fp, WinAccessBridge *wab);
++ void setMouseEnteredFP(AccessBridge_MouseEnteredFP fp, WinAccessBridge *wab);
++ void setMouseExitedFP(AccessBridge_MouseExitedFP fp, WinAccessBridge *wab);
++ void setMousePressedFP(AccessBridge_MousePressedFP fp, WinAccessBridge *wab);
++ void setMouseReleasedFP(AccessBridge_MouseReleasedFP fp, WinAccessBridge *wab);
++ void setMenuCanceledFP(AccessBridge_MenuCanceledFP fp, WinAccessBridge *wab);
++ void setMenuDeselectedFP(AccessBridge_MenuDeselectedFP fp, WinAccessBridge *wab);
++ void setMenuSelectedFP(AccessBridge_MenuSelectedFP fp, WinAccessBridge *wab);
++ void setPopupMenuCanceledFP(AccessBridge_PopupMenuCanceledFP fp, WinAccessBridge *wab);
++ void setPopupMenuWillBecomeInvisibleFP(AccessBridge_PopupMenuWillBecomeInvisibleFP fp,
++ WinAccessBridge *wab);
++ void setPopupMenuWillBecomeVisibleFP(AccessBridge_PopupMenuWillBecomeVisibleFP fp,
++ WinAccessBridge *wab);
++
++ void setPropertyNameChangeFP(AccessBridge_PropertyNameChangeFP fp, WinAccessBridge *wab);
++ void setPropertyDescriptionChangeFP(AccessBridge_PropertyDescriptionChangeFP fp,
++ WinAccessBridge *wab);
++ void setPropertyStateChangeFP(AccessBridge_PropertyStateChangeFP fp, WinAccessBridge *wab);
++ void setPropertyValueChangeFP(AccessBridge_PropertyValueChangeFP fp, WinAccessBridge *wab);
++ void setPropertySelectionChangeFP(AccessBridge_PropertySelectionChangeFP fp,
++ WinAccessBridge *wab);
++ void setPropertyTextChangeFP(AccessBridge_PropertyTextChangeFP fp, WinAccessBridge *wab);
++ void setPropertyCaretChangeFP(AccessBridge_PropertyCaretChangeFP fp, WinAccessBridge *wab);
++ void setPropertyVisibleDataChangeFP(AccessBridge_PropertyVisibleDataChangeFP fp,
++ WinAccessBridge *wab);
++ void setPropertyChildChangeFP(AccessBridge_PropertyChildChangeFP fp, WinAccessBridge *wab);
++ void setPropertyActiveDescendentChangeFP(AccessBridge_PropertyActiveDescendentChangeFP fp,
++ WinAccessBridge *wab);
++
++ void setPropertyTableModelChangeFP(AccessBridge_PropertyTableModelChangeFP fp,
++ WinAccessBridge *wab);
++
++ // ------- Event notification methods
++ void firePropertyChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *property, wchar_t *oldName, wchar_t *newName);
++ void fireJavaShutdown(long vmID);
++ void fireFocusGained(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireFocusLost(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireCaretUpdate(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireMouseClicked(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireMouseEntered(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireMouseExited(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireMousePressed(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireMouseReleased(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireMenuCanceled(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireMenuDeselected(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void fireMenuSelected(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void firePopupMenuCanceled(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void firePopupMenuWillBecomeInvisible(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void firePopupMenuWillBecomeVisible(long vmID, JOBJECT64 event, JOBJECT64 source);
++
++ void firePropertyNameChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldName, wchar_t *newName);
++ void firePropertyDescriptionChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldDescription, wchar_t *newDescription);
++ void firePropertyStateChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldState, wchar_t *newState);
++ void firePropertyValueChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldValue, wchar_t *newValue);
++ void firePropertySelectionChange(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void firePropertyTextChange(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void firePropertyCaretChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ int oldPosition, int newPosition);
++ void firePropertyVisibleDataChange(long vmID, JOBJECT64 event, JOBJECT64 source);
++ void firePropertyChildChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ JOBJECT64 oldChild, JOBJECT64 newChild);
++ void firePropertyActiveDescendentChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ JOBJECT64 oldActiveDescendent, JOBJECT64 newActiveDescendent);
++
++ void firePropertyTableModelChange(long vmID, JOBJECT64 event, JOBJECT64 source,
++ wchar_t *oldValue, wchar_t *newValue);
++
++};
++
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeJavaEntryPoints.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,4793 @@
++/*
++ * 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. 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.
++ */
++
++/*
++ * A class to manage JNI calls into AccessBridge.java
++ */
++
++#include "AccessBridgeJavaEntryPoints.h"
++#include "AccessBridgeDebug.h"
++
++
++
++/**
++ * Initialize the AccessBridgeJavaEntryPoints class
++ *
++ */
++AccessBridgeJavaEntryPoints::AccessBridgeJavaEntryPoints(JNIEnv *jniEnvironment,
++ jobject bridgeObject) {
++ jniEnv = jniEnvironment;
++ accessBridgeObject = (jobject)bridgeObject;
++ PrintDebugString("AccessBridgeJavaEntryPoints(%X, %X) called", jniEnv, accessBridgeObject);
++}
++
++
++/**
++ * Destructor
++ *
++ */
++AccessBridgeJavaEntryPoints::~AccessBridgeJavaEntryPoints() {
++}
++
++// -----------------------------------
++
++#define FIND_CLASS(classRef, className) \
++ localClassRef = jniEnv->FindClass(className); \
++ if (localClassRef == (jclass) 0) { \
++ PrintDebugString(" Error! FindClass(%s) failed!", className); \
++ PrintDebugString(" -> jniEnv = %p", jniEnv); \
++ return FALSE; \
++ } \
++ classRef = (jclass) jniEnv->NewGlobalRef(localClassRef); \
++ jniEnv->DeleteLocalRef(localClassRef); \
++ if (classRef == (jclass) 0) { \
++ PrintDebugString(" Error! FindClass(%s) failed!", className); \
++ PrintDebugString(" -> (ran out of RAM)"); \
++ return FALSE; \
++ }
++
++
++#define FIND_METHOD(methodID, classRef, methodString, methodSignature); \
++ methodID = jniEnv->GetMethodID(classRef, methodString, methodSignature); \
++ if (methodID == (jmethodID) 0) { \
++ PrintDebugString(" Error! GetMethodID(%s) failed!", methodString); \
++ PrintDebugString(" -> jniEnv = %p; classRef = %p", jniEnv, classRef); \
++ return FALSE; \
++ }
++
++#define EXCEPTION_CHECK(situationDescription, returnVal) \
++ if (exception = jniEnv->ExceptionOccurred()) { \
++ PrintDebugString("\r\n *** Exception occured while doing: %s; returning %d", situationDescription, returnVal); \
++ jniEnv->ExceptionDescribe(); \
++ jniEnv->ExceptionClear(); \
++ return (returnVal); \
++ }
++
++#define EXCEPTION_CHECK_VOID(situationDescription) \
++ if (exception = jniEnv->ExceptionOccurred()) { \
++ PrintDebugString("\r\n *** Exception occured while doing: %s", situationDescription); \
++ jniEnv->ExceptionDescribe(); \
++ jniEnv->ExceptionClear(); \
++ return; \
++ }
++
++/**
++ * Make all of the getClass() & getMethod() calls
++ *
++ */
++BOOL
++AccessBridgeJavaEntryPoints::BuildJavaEntryPoints() {
++ jclass localClassRef;
++
++ PrintDebugString("Calling BuildJavaEntryPoints():");
++
++ FIND_CLASS(bridgeClass, "com/sun/java/accessibility/AccessBridge");
++
++ // ------- general methods
++
++ // GetMethodID(decrementReference)
++ FIND_METHOD(decrementReferenceMethod, bridgeClass,
++ "decrementReference",
++ "(Ljava/lang/Object;)V");
++
++ // GetMethodID(getJavaVersionPropertyMethod)
++ FIND_METHOD(getJavaVersionPropertyMethod, bridgeClass,
++ "getJavaVersionProperty",
++ "()Ljava/lang/String;");
++
++ // GetMethodID(getAccessBridgeVersionMethod)
++ FIND_METHOD(getAccessBridgeVersionMethod, bridgeClass,
++ "getAccessBridgeVersion",
++ "()Ljava/lang/String;");
++
++
++ // ------- Window methods
++
++ // GetMethodID(isJavaWindow)
++ FIND_METHOD(isJavaWindowMethod, bridgeClass,
++ "isJavaWindow",
++ "(I)Z");
++
++ // GetMethodID(getAccessibleContextFromHWND)
++ FIND_METHOD(getAccessibleContextFromHWNDMethod, bridgeClass,
++ "getContextFromNativeWindowHandle",
++ "(I)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getHWNDFromAccessibleContext)
++ FIND_METHOD(getHWNDFromAccessibleContextMethod, bridgeClass,
++ "getNativeWindowHandleFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleParentFromContext)
++ FIND_METHOD(getAccessibleParentFromContextMethod, bridgeClass,
++ "getAccessibleParentFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleContext;");
++
++ // ===== utility methods ===== */
++
++ // GetMethodID(setTextContents)
++ FIND_METHOD(setTextContentsMethod, bridgeClass,
++ "setTextContents",
++ "(Ljavax/accessibility/AccessibleContext;Ljava/lang/String;)Z");
++
++ // GetMethodID(getParentWithRole)
++ FIND_METHOD(getParentWithRoleMethod, bridgeClass,
++ "getParentWithRole",
++ "(Ljavax/accessibility/AccessibleContext;Ljava/lang/String;)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getTopLevelObject)
++ FIND_METHOD(getTopLevelObjectMethod, bridgeClass,
++ "getTopLevelObject",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getParentWithRoleElseRoot)
++ FIND_METHOD(getParentWithRoleElseRootMethod, bridgeClass,
++ "getParentWithRoleElseRoot",
++ "(Ljavax/accessibility/AccessibleContext;Ljava/lang/String;)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getObjectDepth)
++ FIND_METHOD(getObjectDepthMethod, bridgeClass,
++ "getObjectDepth",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getActiveDescendent)
++ FIND_METHOD(getActiveDescendentMethod, bridgeClass,
++ "getActiveDescendent",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleContext;");
++
++ // ------- AccessibleContext methods
++
++ // GetMethodID(getAccessibleContextAt)
++ FIND_METHOD(getAccessibleContextAtMethod, bridgeClass,
++ "getAccessibleContextAt",
++ "(IILjavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleContextWithFocus)
++ FIND_METHOD(getAccessibleContextWithFocusMethod, bridgeClass,
++ "getAccessibleContextWithFocus",
++ "()Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleNameFromContext)
++ FIND_METHOD(getAccessibleNameFromContextMethod, bridgeClass,
++ "getAccessibleNameFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleDescriptionFromContext)
++ FIND_METHOD(getAccessibleDescriptionFromContextMethod, bridgeClass,
++ "getAccessibleDescriptionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleRoleStringFromContext)
++ FIND_METHOD(getAccessibleRoleStringFromContextMethod, bridgeClass,
++ "getAccessibleRoleStringFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleRoleStringFromContext_en_US)
++ FIND_METHOD(getAccessibleRoleStringFromContext_en_USMethod, bridgeClass,
++ "getAccessibleRoleStringFromContext_en_US",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleStatesStringFromContext)
++ FIND_METHOD(getAccessibleStatesStringFromContextMethod, bridgeClass,
++ "getAccessibleStatesStringFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleStatesStringFromContext_en_US)
++ FIND_METHOD(getAccessibleStatesStringFromContext_en_USMethod, bridgeClass,
++ "getAccessibleStatesStringFromContext_en_US",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleParentFromContext)
++ FIND_METHOD(getAccessibleParentFromContextMethod, bridgeClass,
++ "getAccessibleParentFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleIndexInParentFromContext)
++ FIND_METHOD(getAccessibleIndexInParentFromContextMethod, bridgeClass,
++ "getAccessibleIndexInParentFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleChildrenCountFromContext)
++ FIND_METHOD(getAccessibleChildrenCountFromContextMethod, bridgeClass,
++ "getAccessibleChildrenCountFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleChildFromContext)
++ FIND_METHOD(getAccessibleChildFromContextMethod, bridgeClass,
++ "getAccessibleChildFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleBoundsOnScreenFromContext)
++ FIND_METHOD(getAccessibleBoundsOnScreenFromContextMethod, bridgeClass,
++ "getAccessibleBoundsOnScreenFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/awt/Rectangle;");
++
++ // GetMethodID(getAccessibleXcoordFromContext)
++ FIND_METHOD(getAccessibleXcoordFromContextMethod, bridgeClass,
++ "getAccessibleXcoordFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleYcoordFromContext)
++ FIND_METHOD(getAccessibleYcoordFromContextMethod, bridgeClass,
++ "getAccessibleYcoordFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleHeightFromContext)
++ FIND_METHOD(getAccessibleHeightFromContextMethod, bridgeClass,
++ "getAccessibleHeightFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleWidthFromContext)
++ FIND_METHOD(getAccessibleWidthFromContextMethod, bridgeClass,
++ "getAccessibleWidthFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleComponentFromContext)
++ FIND_METHOD(getAccessibleComponentFromContextMethod, bridgeClass,
++ "getAccessibleComponentFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleComponent;");
++
++ // GetMethodID(getAccessibleActionFromContext)
++ FIND_METHOD(getAccessibleActionFromContextMethod, bridgeClass,
++ "getAccessibleActionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleAction;");
++
++ // GetMethodID(getAccessibleSelectionFromContext)
++ FIND_METHOD(getAccessibleSelectionFromContextMethod, bridgeClass,
++ "getAccessibleSelectionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleSelection;");
++
++ // GetMethodID(getAccessibleTextFromContext)
++ FIND_METHOD(getAccessibleTextFromContextMethod, bridgeClass,
++ "getAccessibleTextFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleText;");
++
++ // GetMethodID(getAccessibleValueFromContext)
++ FIND_METHOD(getAccessibleValueFromContextMethod, bridgeClass,
++ "getAccessibleValueFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleValue;");
++
++
++ // ------- begin AccessibleTable methods
++
++ // GetMethodID(getAccessibleTableFromContext)
++ FIND_METHOD(getAccessibleTableFromContextMethod, bridgeClass,
++ "getAccessibleTableFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleTable;");
++
++ // GetMethodID(getContextFromAccessibleTable)
++ FIND_METHOD(getContextFromAccessibleTableMethod, bridgeClass,
++ "getContextFromAccessibleTable",
++ "(Ljavax/accessibility/AccessibleTable;)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleTableRowHeader)
++ FIND_METHOD(getAccessibleTableRowHeaderMethod, bridgeClass,
++ "getAccessibleTableRowHeader",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleTable;");
++
++
++ // GetMethodID(getAccessibleTableColumnHeader)
++ FIND_METHOD(getAccessibleTableColumnHeaderMethod, bridgeClass,
++ "getAccessibleTableColumnHeader",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleTable;");
++
++
++ // GetMethodID(getAccessibleTableRowCount)
++ FIND_METHOD(getAccessibleTableRowCountMethod, bridgeClass,
++ "getAccessibleTableRowCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleTableColumnCount)
++ FIND_METHOD(getAccessibleTableColumnCountMethod, bridgeClass,
++ "getAccessibleTableColumnCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleTableCellAccessibleContext)
++ FIND_METHOD(getAccessibleTableCellAccessibleContextMethod, bridgeClass,
++ "getAccessibleTableCellAccessibleContext",
++ "(Ljavax/accessibility/AccessibleTable;II)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleTableCellIndex)
++ FIND_METHOD(getAccessibleTableCellIndexMethod, bridgeClass,
++ "getAccessibleTableCellIndex",
++ "(Ljavax/accessibility/AccessibleTable;II)I");
++
++ // GetMethodID(getAccessibleTableCellRowExtent)
++ FIND_METHOD(getAccessibleTableCellRowExtentMethod, bridgeClass,
++ "getAccessibleTableCellRowExtent",
++ "(Ljavax/accessibility/AccessibleTable;II)I");
++
++ // GetMethodID(getAccessibleTableCellColumnExtent)
++ FIND_METHOD(getAccessibleTableCellColumnExtentMethod, bridgeClass,
++ "getAccessibleTableCellColumnExtent",
++ "(Ljavax/accessibility/AccessibleTable;II)I");
++
++ // GetMethodID(isAccessibleTableCellSelected)
++ FIND_METHOD(isAccessibleTableCellSelectedMethod, bridgeClass,
++ "isAccessibleTableCellSelected",
++ "(Ljavax/accessibility/AccessibleTable;II)Z");
++
++ // GetMethodID(getAccessibleTableRowHeaderRowCount)
++ FIND_METHOD(getAccessibleTableRowHeaderRowCountMethod, bridgeClass,
++ "getAccessibleTableRowHeaderRowCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleTableColumnHeaderRowCount)
++ FIND_METHOD(getAccessibleTableColumnHeaderRowCountMethod, bridgeClass,
++ "getAccessibleTableColumnHeaderRowCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleTableRowHeaderColumnCount)
++ FIND_METHOD(getAccessibleTableRowHeaderColumnCountMethod, bridgeClass,
++ "getAccessibleTableRowHeaderColumnCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleTableColumnHeaderColumnCount)
++ FIND_METHOD(getAccessibleTableColumnHeaderColumnCountMethod, bridgeClass,
++ "getAccessibleTableColumnHeaderColumnCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleTableRowDescription)
++ FIND_METHOD(getAccessibleTableRowDescriptionMethod, bridgeClass,
++ "getAccessibleTableRowDescription",
++ "(Ljavax/accessibility/AccessibleTable;I)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleTableColumnDescription)
++ FIND_METHOD(getAccessibleTableColumnDescriptionMethod, bridgeClass,
++ "getAccessibleTableColumnDescription",
++ "(Ljavax/accessibility/AccessibleTable;I)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleTableRowSelectionCount)
++ FIND_METHOD(getAccessibleTableRowSelectionCountMethod, bridgeClass,
++ "getAccessibleTableRowSelectionCount",
++ "(Ljavax/accessibility/AccessibleTable;)I");
++
++ // GetMethodID(isAccessibleTableRowSelected)
++ FIND_METHOD(isAccessibleTableRowSelectedMethod, bridgeClass,
++ "isAccessibleTableRowSelected",
++ "(Ljavax/accessibility/AccessibleTable;I)Z");
++
++ // GetMethodID(getAccessibleTableRowSelections)
++ FIND_METHOD(getAccessibleTableRowSelectionsMethod, bridgeClass,
++ "getAccessibleTableRowSelections",
++ "(Ljavax/accessibility/AccessibleTable;I)I");
++
++ // GetMethodID(getAccessibleTableColumnSelectionCount)
++ FIND_METHOD(getAccessibleTableColumnSelectionCountMethod, bridgeClass,
++ "getAccessibleTableColumnSelectionCount",
++ "(Ljavax/accessibility/AccessibleTable;)I");
++
++ // GetMethodID(isAccessibleTableColumnSelected)
++ FIND_METHOD(isAccessibleTableColumnSelectedMethod, bridgeClass,
++ "isAccessibleTableColumnSelected",
++ "(Ljavax/accessibility/AccessibleTable;I)Z");
++
++ // GetMethodID(getAccessibleTableColumnSelections)
++ FIND_METHOD(getAccessibleTableColumnSelectionsMethod, bridgeClass,
++ "getAccessibleTableColumnSelections",
++ "(Ljavax/accessibility/AccessibleTable;I)I");
++
++ // GetMethodID(getAccessibleTableRow)
++ FIND_METHOD(getAccessibleTableRowMethod, bridgeClass,
++ "getAccessibleTableRow",
++ "(Ljavax/accessibility/AccessibleTable;I)I");
++
++ // GetMethodID(getAccessibleTableColumn)
++ FIND_METHOD(getAccessibleTableColumnMethod, bridgeClass,
++ "getAccessibleTableColumn",
++ "(Ljavax/accessibility/AccessibleTable;I)I");
++
++ // GetMethodID(getAccessibleTableIndex)
++ FIND_METHOD(getAccessibleTableIndexMethod, bridgeClass,
++ "getAccessibleTableIndex",
++ "(Ljavax/accessibility/AccessibleTable;II)I");
++
++ /* ------- end AccessibleTable methods */
++
++ /* start AccessibleRelationSet methods ----- */
++
++ // GetMethodID(getAccessibleRelationCount)
++ FIND_METHOD(getAccessibleRelationCountMethod, bridgeClass,
++ "getAccessibleRelationCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleRelationKey)
++ FIND_METHOD(getAccessibleRelationKeyMethod, bridgeClass,
++ "getAccessibleRelationKey",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleRelationTargetCount)
++ FIND_METHOD(getAccessibleRelationTargetCountMethod, bridgeClass,
++ "getAccessibleRelationTargetCount",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleRelationTarget)
++ FIND_METHOD(getAccessibleRelationTargetMethod, bridgeClass,
++ "getAccessibleRelationTarget",
++ "(Ljavax/accessibility/AccessibleContext;II)Ljavax/accessibility/AccessibleContext;");
++
++
++ // ------- AccessibleHypertext methods
++
++ // GetMethodID(getAccessibleHypertext)
++ FIND_METHOD(getAccessibleHypertextMethod, bridgeClass,
++ "getAccessibleHypertext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljavax/accessibility/AccessibleHypertext;");
++
++ // GetMethodID(activateAccessibleHyperlink)
++ FIND_METHOD(activateAccessibleHyperlinkMethod, bridgeClass,
++ "activateAccessibleHyperlink",
++ "(Ljavax/accessibility/AccessibleContext;Ljavax/accessibility/AccessibleHyperlink;)Z");
++
++ // GetMethodID(getAccessibleHyperlinkCount)
++ FIND_METHOD(getAccessibleHyperlinkCountMethod, bridgeClass,
++ "getAccessibleHyperlinkCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleHyperlink)
++ FIND_METHOD(getAccessibleHyperlinkMethod, bridgeClass,
++ "getAccessibleHyperlink",
++ "(Ljavax/accessibility/AccessibleHypertext;I)Ljavax/accessibility/AccessibleHyperlink;");
++
++ // GetMethodID(getAccessibleHyperlinkText)
++ FIND_METHOD(getAccessibleHyperlinkTextMethod, bridgeClass,
++ "getAccessibleHyperlinkText",
++ "(Ljavax/accessibility/AccessibleHyperlink;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleHyperlinkURL)
++ FIND_METHOD(getAccessibleHyperlinkURLMethod, bridgeClass,
++ "getAccessibleHyperlinkURL",
++ "(Ljavax/accessibility/AccessibleHyperlink;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleHyperlinkStartIndex)
++ FIND_METHOD(getAccessibleHyperlinkStartIndexMethod, bridgeClass,
++ "getAccessibleHyperlinkStartIndex",
++ "(Ljavax/accessibility/AccessibleHyperlink;)I");
++
++ // GetMethodID(getAccessibleHyperlinkEndIndex)
++ FIND_METHOD(getAccessibleHyperlinkEndIndexMethod, bridgeClass,
++ "getAccessibleHyperlinkEndIndex",
++ "(Ljavax/accessibility/AccessibleHyperlink;)I");
++
++ // GetMethodID(getAccessibleHypertextLinkIndex)
++ FIND_METHOD(getAccessibleHypertextLinkIndexMethod, bridgeClass,
++ "getAccessibleHypertextLinkIndex",
++ "(Ljavax/accessibility/AccessibleHypertext;I)I");
++
++ // Accessible KeyBinding, Icon and Action ====================
++
++ // GetMethodID(getAccessibleKeyBindingsCount)
++ FIND_METHOD(getAccessibleKeyBindingsCountMethod, bridgeClass,
++ "getAccessibleKeyBindingsCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleKeyBindingChar)
++ FIND_METHOD(getAccessibleKeyBindingCharMethod, bridgeClass,
++ "getAccessibleKeyBindingChar",
++ "(Ljavax/accessibility/AccessibleContext;I)C");
++
++ // GetMethodID(getAccessibleKeyBindingModifiers)
++ FIND_METHOD(getAccessibleKeyBindingModifiersMethod, bridgeClass,
++ "getAccessibleKeyBindingModifiers",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleIconsCount)
++ FIND_METHOD(getAccessibleIconsCountMethod, bridgeClass,
++ "getAccessibleIconsCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleIconDescription)
++ FIND_METHOD(getAccessibleIconDescriptionMethod, bridgeClass,
++ "getAccessibleIconDescription",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleIconHeight)
++ FIND_METHOD(getAccessibleIconHeightMethod, bridgeClass,
++ "getAccessibleIconHeight",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleIconWidth)
++ FIND_METHOD(getAccessibleIconWidthMethod, bridgeClass,
++ "getAccessibleIconWidth",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleActionsCount)
++ FIND_METHOD(getAccessibleActionsCountMethod, bridgeClass,
++ "getAccessibleActionsCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleActionName)
++ FIND_METHOD(getAccessibleActionNameMethod, bridgeClass,
++ "getAccessibleActionName",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljava/lang/String;");
++
++ // GetMethodID(doAccessibleActions)
++ FIND_METHOD(doAccessibleActionsMethod, bridgeClass,
++ "doAccessibleActions",
++ "(Ljavax/accessibility/AccessibleContext;Ljava/lang/String;)Z");
++
++ // ------- AccessibleText methods
++
++ // GetMethodID(getAccessibleCharCountFromContext)
++ FIND_METHOD(getAccessibleCharCountFromContextMethod, bridgeClass,
++ "getAccessibleCharCountFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleCaretPositionFromContext)
++ FIND_METHOD(getAccessibleCaretPositionFromContextMethod, bridgeClass,
++ "getAccessibleCaretPositionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleIndexAtPointFromContext)
++ FIND_METHOD(getAccessibleIndexAtPointFromContextMethod, bridgeClass,
++ "getAccessibleIndexAtPointFromContext",
++ "(Ljavax/accessibility/AccessibleContext;II)I");
++
++ // GetMethodID(getAccessibleLetterAtIndexFromContext)
++ FIND_METHOD(getAccessibleLetterAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleLetterAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleWordAtIndexFromContext)
++ FIND_METHOD(getAccessibleWordAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleWordAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleSentenceAtIndexFromContext)
++ FIND_METHOD(getAccessibleSentenceAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleSentenceAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleTextSelectionStartFromContext)
++ FIND_METHOD(getAccessibleTextSelectionStartFromContextMethod, bridgeClass,
++ "getAccessibleTextSelectionStartFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleTextSelectionEndFromContext)
++ FIND_METHOD(getAccessibleTextSelectionEndFromContextMethod, bridgeClass,
++ "getAccessibleTextSelectionEndFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getAccessibleTextSelectedTextFromContext)
++ FIND_METHOD(getAccessibleTextSelectedTextFromContextMethod, bridgeClass,
++ "getAccessibleTextSelectedTextFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleAttributesAtIndexFromContext)
++ FIND_METHOD(getAccessibleAttributesAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleAttributesAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljava/lang/String;");
++
++ // GetMethodID(getAccessibleAttributeSetAtIndexFromContext)
++ FIND_METHOD(getAccessibleAttributeSetAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleAttributeSetAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljavax/swing/text/AttributeSet;");
++
++ // GetMethodID(getAccessibleTextRectAtIndexFromContext)
++ FIND_METHOD(getAccessibleTextRectAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleTextRectAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljava/awt/Rectangle;");
++
++ // GetMethodID(getAccessibleXcoordTextRectAtIndexFromContext)
++ FIND_METHOD(getAccessibleXcoordTextRectAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleXcoordTextRectAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleYcoordTextRectAtIndexFromContext)
++ FIND_METHOD(getAccessibleYcoordTextRectAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleYcoordTextRectAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleHeightTextRectAtIndexFromContext)
++ FIND_METHOD(getAccessibleHeightTextRectAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleHeightTextRectAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleWidthTextRectAtIndexFromContext)
++ FIND_METHOD(getAccessibleWidthTextRectAtIndexFromContextMethod, bridgeClass,
++ "getAccessibleWidthTextRectAtIndexFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getCaretLocationX)
++ FIND_METHOD(getCaretLocationXMethod, bridgeClass,
++ "getCaretLocationX",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getCaretLocationY)
++ FIND_METHOD(getCaretLocationYMethod, bridgeClass,
++ "getCaretLocationY",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getCaretLocationHeight)
++ FIND_METHOD(getCaretLocationHeightMethod, bridgeClass,
++ "getCaretLocationHeight",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getCaretLocationWidth)
++ FIND_METHOD(getCaretLocationWidthMethod, bridgeClass,
++ "getCaretLocationWidth",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++
++ // GetMethodID(getAccessibleTextLineLeftBoundsFromContextMethod)
++ FIND_METHOD(getAccessibleTextLineLeftBoundsFromContextMethod, bridgeClass,
++ "getAccessibleTextLineLeftBoundsFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleTextLineRightBoundsFromContextMethod)
++ FIND_METHOD(getAccessibleTextLineRightBoundsFromContextMethod, bridgeClass,
++ "getAccessibleTextLineRightBoundsFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)I");
++
++ // GetMethodID(getAccessibleTextRangeFromContextMethod)
++ FIND_METHOD(getAccessibleTextRangeFromContextMethod, bridgeClass,
++ "getAccessibleTextRangeFromContext",
++ "(Ljavax/accessibility/AccessibleContext;II)Ljava/lang/String;");
++
++
++ // ------- AccessibleValue methods
++
++ // GetMethodID(getCurrentAccessibleValueFromContext)
++ FIND_METHOD(getCurrentAccessibleValueFromContextMethod, bridgeClass,
++ "getCurrentAccessibleValueFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getMaximumAccessibleValueFromContext)
++ FIND_METHOD(getMaximumAccessibleValueFromContextMethod, bridgeClass,
++ "getMaximumAccessibleValueFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ // GetMethodID(getMinimumAccessibleValueFromContext)
++ FIND_METHOD(getMinimumAccessibleValueFromContextMethod, bridgeClass,
++ "getMinimumAccessibleValueFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++
++ // ------- AccessibleSelection methods
++
++ // GetMethodID(addAccessibleSelectionFromContext)
++ FIND_METHOD(addAccessibleSelectionFromContextMethod, bridgeClass,
++ "addAccessibleSelectionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)V");
++
++ // GetMethodID(clearAccessibleSelectionFromContext)
++ FIND_METHOD(clearAccessibleSelectionFromContextMethod, bridgeClass,
++ "clearAccessibleSelectionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)V");
++
++ // GetMethodID(getAccessibleSelectionFromContext)
++ FIND_METHOD(getAccessibleSelectionContextFromContextMethod, bridgeClass,
++ "getAccessibleSelectionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(getAccessibleSelectionCountFromContext)
++ FIND_METHOD(getAccessibleSelectionCountFromContextMethod, bridgeClass,
++ "getAccessibleSelectionCountFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(isAccessibleChildSelectedFromContext)
++ FIND_METHOD(isAccessibleChildSelectedFromContextMethod, bridgeClass,
++ "isAccessibleChildSelectedFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)Z");
++
++ // GetMethodID(removeAccessibleSelectionFromContext)
++ FIND_METHOD(removeAccessibleSelectionFromContextMethod, bridgeClass,
++ "removeAccessibleSelectionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;I)V");
++
++ // GetMethodID(selectAllAccessibleSelectionFromContext)
++ FIND_METHOD(selectAllAccessibleSelectionFromContextMethod, bridgeClass,
++ "selectAllAccessibleSelectionFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)V");
++
++
++ // ------- Event Notification methods
++
++ // GetMethodID(addJavaEventNotification)
++ FIND_METHOD(addJavaEventNotificationMethod, bridgeClass,
++ "addJavaEventNotification", "(J)V");
++
++ // GetMethodID(removeJavaEventNotification)
++ FIND_METHOD(removeJavaEventNotificationMethod, bridgeClass,
++ "removeJavaEventNotification", "(J)V");
++
++ // GetMethodID(addAccessibilityEventNotification)
++ FIND_METHOD(addAccessibilityEventNotificationMethod, bridgeClass,
++ "addAccessibilityEventNotification", "(J)V");
++
++ // GetMethodID(removeAccessibilityEventNotification)
++ FIND_METHOD(removeAccessibilityEventNotificationMethod, bridgeClass,
++ "removeAccessibilityEventNotification", "(J)V");
++
++
++ // ------- AttributeSet methods
++
++ // GetMethodID(getBoldFromAttributeSet)
++ FIND_METHOD(getBoldFromAttributeSetMethod, bridgeClass,
++ "getBoldFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Z");
++
++ // GetMethodID(getItalicFromAttributeSet)
++ FIND_METHOD(getItalicFromAttributeSetMethod, bridgeClass,
++ "getItalicFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Z");
++
++ // GetMethodID(getUnderlineFromAttributeSet)
++ FIND_METHOD(getUnderlineFromAttributeSetMethod, bridgeClass,
++ "getUnderlineFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Z");
++
++ // GetMethodID(getStrikethroughFromAttributeSet)
++ FIND_METHOD(getStrikethroughFromAttributeSetMethod, bridgeClass,
++ "getStrikethroughFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Z");
++
++ // GetMethodID(getSuperscriptFromAttributeSet)
++ FIND_METHOD(getSuperscriptFromAttributeSetMethod, bridgeClass,
++ "getSuperscriptFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Z");
++
++ // GetMethodID(getSubscriptFromAttributeSet)
++ FIND_METHOD(getSubscriptFromAttributeSetMethod, bridgeClass,
++ "getSubscriptFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Z");
++
++ // GetMethodID(getBackgroundColorFromAttributeSet)
++ FIND_METHOD(getBackgroundColorFromAttributeSetMethod, bridgeClass,
++ "getBackgroundColorFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Ljava/lang/String;");
++
++ // GetMethodID(getForegroundColorFromAttributeSet)
++ FIND_METHOD(getForegroundColorFromAttributeSetMethod, bridgeClass,
++ "getForegroundColorFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Ljava/lang/String;");
++
++ // GetMethodID(getFontFamilyFromAttributeSet)
++ FIND_METHOD(getFontFamilyFromAttributeSetMethod, bridgeClass,
++ "getFontFamilyFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)Ljava/lang/String;");
++
++ // GetMethodID(getFontSizeFromAttributeSet)
++ FIND_METHOD(getFontSizeFromAttributeSetMethod, bridgeClass,
++ "getFontSizeFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)I");
++
++ // GetMethodID(getAlignmentFromAttributeSet)
++ FIND_METHOD(getAlignmentFromAttributeSetMethod, bridgeClass,
++ "getAlignmentFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)I");
++
++ // GetMethodID(getBidiLevelFromAttributeSet)
++ FIND_METHOD(getBidiLevelFromAttributeSetMethod, bridgeClass,
++ "getBidiLevelFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)I");
++
++ // GetMethodID(getFirstLineIndentFromAttributeSet)
++ FIND_METHOD(getFirstLineIndentFromAttributeSetMethod, bridgeClass,
++ "getFirstLineIndentFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)F");
++
++ // GetMethodID(getLeftIndentFromAttributeSet)
++ FIND_METHOD(getLeftIndentFromAttributeSetMethod, bridgeClass,
++ "getLeftIndentFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)F");
++
++ // GetMethodID(getRightIndentFromAttributeSet)
++ FIND_METHOD(getRightIndentFromAttributeSetMethod, bridgeClass,
++ "getRightIndentFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)F");
++
++ // GetMethodID(getLineSpacingFromAttributeSet)
++ FIND_METHOD(getLineSpacingFromAttributeSetMethod, bridgeClass,
++ "getLineSpacingFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)F");
++
++ // GetMethodID(getSpaceAboveFromAttributeSet)
++ FIND_METHOD(getSpaceAboveFromAttributeSetMethod, bridgeClass,
++ "getSpaceAboveFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)F");
++
++ // GetMethodID(getSpaceBelowFromAttributeSet)
++ FIND_METHOD(getSpaceBelowFromAttributeSetMethod, bridgeClass,
++ "getSpaceBelowFromAttributeSet", "(Ljavax/swing/text/AttributeSet;)F");
++
++
++ /**
++ * Additional methods for Teton
++ */
++
++ // GetMethodID(requestFocus)
++ FIND_METHOD(requestFocusMethod, bridgeClass,
++ "requestFocus",
++ "(Ljavax/accessibility/AccessibleContext;)Z");
++
++ // GetMethodID(selectTextRange)
++ FIND_METHOD(selectTextRangeMethod, bridgeClass,
++ "selectTextRange",
++ "(Ljavax/accessibility/AccessibleContext;II)Z");
++
++ // GetMethodID(getVisibleChildrenCount)
++ FIND_METHOD(getVisibleChildrenCountMethod, bridgeClass,
++ "getVisibleChildrenCount",
++ "(Ljavax/accessibility/AccessibleContext;)I");
++
++ // GetMethodID(getVisibleChild)
++ FIND_METHOD(getVisibleChildMethod, bridgeClass,
++ "getVisibleChild",
++ "(Ljavax/accessibility/AccessibleContext;I)Ljavax/accessibility/AccessibleContext;");
++
++ // GetMethodID(setCaretPosition)
++ FIND_METHOD(setCaretPositionMethod, bridgeClass,
++ "setCaretPosition",
++ "(Ljavax/accessibility/AccessibleContext;I)Z");
++
++ // GetMethodID(getVirtualAccessibleNameFromContextMethod) Ben Key
++ FIND_METHOD(getVirtualAccessibleNameFromContextMethod, bridgeClass,
++ "getVirtualAccessibleNameFromContext",
++ "(Ljavax/accessibility/AccessibleContext;)Ljava/lang/String;");
++
++ return TRUE;
++}
++
++// Note for the following code which makes JNI upcalls...
++//
++// Problem, bug DB 16818166, JBS DB JDK-8015400
++// AccessibleContext is a JOBJECT64 which is a jobject (32 bit pointer)
++// for a Legacy (XP) build and a jlong (64 bits) for a -32 or -64 build.
++// For the -32 build the lower 32 bits needs to be extracted into a jobject.
++// Otherwise, if AccessibleContext is used directly what happens is that
++// the JNI code consumes the lower 32 of its 64 bits and that is not a
++// problem, but then when the JNI code consumes the next 32 bits for the
++// reference to the role String it gets the higher 0x00000000 bits from
++// the 64 bit JOBJECT64 AccessibleContext variable and thus a null reference
++// is passed as the String reference.
++//
++// Solution:
++// Cast the JOBJECT64 to a jobject. For a 64 bit compile this is basically
++// a noop, i.e. JOBJECT64 is a 64 bit jlong and a jobject is a 64 bit reference.
++// For a 32 bit compile the cast drops the high order 32 bits, i.e. JOBJECT64
++// is a 64 bit jlong and jobject is a 32 bit reference. For a Legacy build
++// JOBJECT64 is a jobject so this is also basically a noop. The casts are
++// done in the methods in JavaAccessBridge::processPackage.
++
++// -----------------------------------
++
++/**
++ * isJavaWindow - returns whether the HWND is a Java window or not
++ *
++ */
++BOOL
++AccessBridgeJavaEntryPoints::isJavaWindow(jint window) {
++ jthrowable exception;
++ BOOL returnVal;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::isJavaWindow(%X):", window);
++
++ if (isJavaWindowMethod != (jmethodID) 0) {
++ returnVal = (BOOL) jniEnv->CallBooleanMethod(accessBridgeObject, isJavaWindowMethod, window);
++ EXCEPTION_CHECK("Getting isJavaWindow - call to CallBooleanMethod()", FALSE);
++ return returnVal;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or isJavaWindowMethod == 0");
++ return FALSE;
++ }
++}
++
++// -----------------------------------
++
++/**
++ * isSameObject - returns whether two object reference refer to the same object
++ *
++ */
++BOOL
++AccessBridgeJavaEntryPoints::isSameObject(jobject obj1, jobject obj2) {
++ jthrowable exception;
++ BOOL returnVal;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::isSameObject(%p %p):", obj1, obj2);
++
++ returnVal = (BOOL) jniEnv->IsSameObject((jobject)obj1, (jobject)obj2);
++ EXCEPTION_CHECK("Calling IsSameObject", FALSE);
++
++ PrintDebugString("\r\n isSameObject returning %d", returnVal);
++ return returnVal;
++}
++
++// -----------------------------------
++
++/**
++ * getAccessibleContextFromHWND - returns the AccessibleContext, if any, for an HWND
++ *
++ */
++jobject
++AccessBridgeJavaEntryPoints::getAccessibleContextFromHWND(jint window) {
++ jobject returnedAccessibleContext;
++ jobject globalRef;
++ jthrowable exception;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::getAccessibleContextFromHWND(%X):", window);
++
++ if (getAccessibleContextFromHWNDMethod != (jmethodID) 0) {
++ returnedAccessibleContext =
++ (jobject)jniEnv->CallObjectMethod(accessBridgeObject, getAccessibleContextFromHWNDMethod,
++ window);
++ EXCEPTION_CHECK("Getting AccessibleContextFromHWND - call to CallObjectMethod()", (jobject) 0);
++ globalRef = (jobject)jniEnv->NewGlobalRef((jobject)returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleContextFromHWND - call to CallObjectMethod()", (jobject) 0);
++ return globalRef;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or getAccessibleContextFromHWNDMethod == 0");
++ return (jobject) 0;
++ }
++}
++
++// -----------------------------------
++
++/**
++ * getHWNDFromAccessibleContext - returns the HWND for an AccessibleContext, if any
++ * returns (HWND)0 on error.
++ */
++HWND
++AccessBridgeJavaEntryPoints::getHWNDFromAccessibleContext(jobject accessibleContext) {
++ jthrowable exception;
++ HWND rHWND;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::getHWNDFromAccessibleContext(%X):",
++ accessibleContext);
++
++ if (getHWNDFromAccessibleContextMethod != (jmethodID) 0) {
++ rHWND = (HWND)jniEnv->CallIntMethod(accessBridgeObject, getHWNDFromAccessibleContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting HWNDFromAccessibleContext - call to CallIntMethod()", (HWND)0);
++ PrintDebugString("\r\n rHWND = %X", rHWND);
++ return rHWND;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or getHWNDFromAccessibleContextMethod == 0");
++ return (HWND)0;
++ }
++}
++
++
++/* ====== Utility methods ===== */
++
++/**
++ * Sets a text field to the specified string. Returns whether successful;
++ */
++BOOL
++AccessBridgeJavaEntryPoints::setTextContents(const jobject accessibleContext, const wchar_t *text) {
++ jthrowable exception;
++ BOOL result = FALSE;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::setTextContents(%p, %ls):",
++ accessibleContext, text);
++
++ if (setTextContentsMethod != (jmethodID) 0) {
++
++ // create a Java String for the text
++ jstring textString = jniEnv->NewString(text, (jsize)wcslen(text));
++ if (textString == 0) {
++ PrintDebugString("\r NewString failed");
++ return FALSE;
++ }
++
++ result = (BOOL)jniEnv->CallBooleanMethod(accessBridgeObject,
++ setTextContentsMethod,
++ accessibleContext, textString);
++ EXCEPTION_CHECK("setTextContents - call to CallBooleanMethod()", FALSE);
++ PrintDebugString("\r\n result = %d", result);
++ return result;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or setTextContentsMethod == 0");
++ return result;
++ }
++}
++
++/**
++ * Returns the Accessible Context of a Page Tab object that is the
++ * ancestor of a given object. If the object is a Page Tab object
++ * or a Page Tab ancestor object was found, returns the object
++ * AccessibleContext.
++ * If there is no ancestor object that has an Accessible Role of Page Tab,
++ * returns (AccessibleContext)0.
++ */
++jobject
++AccessBridgeJavaEntryPoints::getParentWithRole(const jobject accessibleContext, const wchar_t *role) {
++ jthrowable exception;
++ jobject rAccessibleContext;
++
++ PrintDebugString("In AccessBridgeJavaEntryPoints::getParentWithRole(%p):",
++ accessibleContext);
++
++ if (getParentWithRoleMethod != (jmethodID) 0) {
++ // create a Java String for the role
++ jstring roleName = jniEnv->NewString(role, (jsize)wcslen(role));
++ if (roleName == 0) {
++ PrintDebugString(" NewString failed");
++ return FALSE;
++ }
++
++ rAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getParentWithRoleMethod,
++ accessibleContext, roleName);
++ EXCEPTION_CHECK("Getting ParentWithRole - call to CallObjectMethod()", (AccessibleContext)0);
++ PrintDebugString(" rAccessibleContext = %p", rAccessibleContext);
++ jobject globalRef = jniEnv->NewGlobalRef(rAccessibleContext);
++ EXCEPTION_CHECK("Getting ParentWithRole - call to NewGlobalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ rAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or getParentWithRoleMethod == 0");
++ return 0;
++ }
++}
++
++/**
++ * Returns the Accessible Context for the top level object in
++ * a Java Window. This is same Accessible Context that is obtained
++ * from GetAccessibleContextFromHWND for that window. Returns
++ * (AccessibleContext)0 on error.
++ */
++jobject
++AccessBridgeJavaEntryPoints::getTopLevelObject(const jobject accessibleContext) {
++ jthrowable exception;
++ jobject rAccessibleContext;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::getTopLevelObject(%p):",
++ accessibleContext);
++
++ if (getTopLevelObjectMethod != (jmethodID) 0) {
++ rAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getTopLevelObjectMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting TopLevelObject - call to CallObjectMethod()", FALSE);
++ PrintDebugString("\r\n rAccessibleContext = %p", rAccessibleContext);
++ jobject globalRef = jniEnv->NewGlobalRef(rAccessibleContext);
++ EXCEPTION_CHECK("Getting TopLevelObject - call to NewGlobalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ rAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or getTopLevelObjectMethod == 0");
++ return 0;
++ }
++}
++
++/**
++ * If there is an Ancestor object that has an Accessible Role of
++ * Internal Frame, returns the Accessible Context of the Internal
++ * Frame object. Otherwise, returns the top level object for that
++ * Java Window. Returns (AccessibleContext)0 on error.
++ */
++jobject
++AccessBridgeJavaEntryPoints::getParentWithRoleElseRoot(const jobject accessibleContext, const wchar_t *role) {
++ jthrowable exception;
++ jobject rAccessibleContext;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::getParentWithRoleElseRoot(%p):",
++ accessibleContext);
++
++ if (getParentWithRoleElseRootMethod != (jmethodID) 0) {
++
++ // create a Java String for the role
++ jstring roleName = jniEnv->NewString(role, (jsize)wcslen(role));
++ if (roleName == 0) {
++ PrintDebugString("\r NewString failed");
++ return FALSE;
++ }
++
++ rAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getParentWithRoleElseRootMethod,
++ accessibleContext, roleName);
++ EXCEPTION_CHECK("Getting ParentWithRoleElseRoot - call to CallObjectMethod()", (AccessibleContext)0);
++ PrintDebugString(" rAccessibleContext = %p", rAccessibleContext);
++ jobject globalRef = jniEnv->NewGlobalRef(rAccessibleContext);
++ EXCEPTION_CHECK("Getting ParentWithRoleElseRoot - call to NewGlobalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ rAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or getParentWithRoleElseRootMethod == 0");
++ return 0;
++ }
++}
++
++/**
++ * Returns how deep in the object hierarchy a given object is.
++ * The top most object in the object hierarchy has an object depth of 0.
++ * Returns -1 on error.
++ */
++jint
++AccessBridgeJavaEntryPoints::getObjectDepth(const jobject accessibleContext) {
++ jthrowable exception;
++ jint rResult;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::getObjectDepth(%p):",
++ accessibleContext);
++
++ if (getObjectDepthMethod != (jmethodID) 0) {
++ rResult = jniEnv->CallIntMethod(accessBridgeObject,
++ getObjectDepthMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting ObjectDepth - call to CallIntMethod()", -1);
++ PrintDebugString("\r\n rResult = %d", rResult);
++ return rResult;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or getObjectDepthMethod == 0");
++ return -1;
++ }
++}
++
++
++
++/**
++ * Returns the Accessible Context of the current ActiveDescendent of an object.
++ * Returns 0 on error.
++ */
++jobject
++AccessBridgeJavaEntryPoints::getActiveDescendent(const jobject accessibleContext) {
++ jthrowable exception;
++ jobject rAccessibleContext;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::getActiveDescendent(%p):",
++ accessibleContext);
++
++ if (getActiveDescendentMethod != (jmethodID) 0) {
++ rAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getActiveDescendentMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting ActiveDescendent - call to CallObjectMethod()", (AccessibleContext)0);
++ PrintDebugString("\r\n rAccessibleContext = %p", rAccessibleContext);
++ jobject globalRef = jniEnv->NewGlobalRef(rAccessibleContext);
++ EXCEPTION_CHECK("Getting ActiveDescendant - call to NewGlobalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ rAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or getActiveDescendentMethod == 0");
++ return (AccessibleContext)0;
++ }
++}
++
++/**
++ * Additional methods for Teton
++ */
++
++/**
++ * Returns an AccessibleName for a component using an algorithm optimized
++ * for the JAWS screen reader by Ben Key (Freedom Scientific). This method
++ * is only intended for JAWS. All other uses are entirely optional.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++BOOL
++AccessBridgeJavaEntryPoints::getVirtualAccessibleName (
++ IN const jobject object,
++ OUT wchar_t * name,
++ IN const int nameSize)
++{
++ /*
++ +
++ Parameter validation
++ +
++ */
++ if ((name == 0) || (nameSize == 0))
++ {
++ return FALSE;
++ }
++ ::memset (name, 0, nameSize * sizeof (wchar_t));
++ if (0 == object)
++ {
++ return FALSE;
++ }
++
++ jstring js = NULL;
++ const wchar_t * stringBytes = NULL;
++ jthrowable exception = NULL;
++ jsize length = 0;
++ PrintDebugString("\r\n getVirtualAccessibleName called.");
++ if (getVirtualAccessibleNameFromContextMethod != (jmethodID) 0)
++ {
++ js = (jstring) jniEnv->CallObjectMethod (
++ accessBridgeObject,
++ getVirtualAccessibleNameFromContextMethod,
++ object);
++ EXCEPTION_CHECK("Getting AccessibleName - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0)
++ {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars (js, 0);
++ EXCEPTION_CHECK("Getting AccessibleName - call to GetStringChars()", FALSE);
++ wcsncpy(name, stringBytes, nameSize - 1);
++ length = jniEnv->GetStringLength(js);
++ EXCEPTION_CHECK("Getting AccessibleName - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleName - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod (
++ accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleName - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Name = %ls", name);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleName - call to DeleteLocalRef()", FALSE);
++ }
++ else
++ {
++ PrintDebugString(" Accessible Name is null.");
++ }
++ }
++ else
++ {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or getVirtualAccessibleNameFromContextMethod == 0");
++ return FALSE;
++ }
++ if ( 0 != name [0] )
++ {
++ return TRUE;
++ }
++ return FALSE;
++}
++
++
++/**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++BOOL
++AccessBridgeJavaEntryPoints::requestFocus(const jobject accessibleContext) {
++
++ jthrowable exception;
++ BOOL result = FALSE;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::requestFocus(%p):",
++ accessibleContext);
++
++ if (requestFocusMethod != (jmethodID) 0) {
++ result = (BOOL)jniEnv->CallBooleanMethod(accessBridgeObject,
++ requestFocusMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("requestFocus - call to CallBooleanMethod()", FALSE);
++ PrintDebugString("\r\n result = %d", result);
++ return result;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or requestFocusMethod == 0");
++ return result;
++ }
++}
++
++/**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++BOOL
++AccessBridgeJavaEntryPoints::selectTextRange(const jobject accessibleContext, int startIndex, int endIndex) {
++
++ jthrowable exception;
++ BOOL result = FALSE;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::selectTextRange(%p start = %d end = %d):",
++ accessibleContext, startIndex, endIndex);
++
++ if (selectTextRangeMethod != (jmethodID) 0) {
++ result = (BOOL)jniEnv->CallBooleanMethod(accessBridgeObject,
++ selectTextRangeMethod,
++ accessibleContext,
++ startIndex, endIndex);
++ EXCEPTION_CHECK("selectTextRange - call to CallBooleanMethod()", FALSE);
++ PrintDebugString("\r\n result = %d", result);
++ return result;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or selectTextRangeMethod == 0");
++ return result;
++ }
++}
++
++/*
++ * Returns whether two text attributes are the same.
++ */
++static BOOL CompareAccessibleTextAttributesInfo(AccessibleTextAttributesInfo *one,
++ AccessibleTextAttributesInfo *two) {
++ return(one->bold == two->bold
++ && one->italic == two->italic
++ && one->underline == two->underline
++ && one->strikethrough == two->strikethrough
++ && one->superscript == two->superscript
++ && one->subscript == two->subscript
++ && one->fontSize == two->fontSize
++ && one->alignment == two->alignment
++ && one->bidiLevel == two->bidiLevel
++ && one->firstLineIndent == two->firstLineIndent
++ && one->leftIndent == two->leftIndent
++ && one->rightIndent == two->rightIndent
++ && one->lineSpacing == two->lineSpacing
++ && one->spaceAbove == two->spaceAbove
++ && one->spaceBelow == two->spaceBelow
++ && !wcscmp(one->backgroundColor,two->backgroundColor)
++ && !wcscmp(one->foregroundColor,two->foregroundColor)
++ && !wcscmp(one->fullAttributesString,two->fullAttributesString));
++}
++
++/**
++ * Get text attributes between two indices.
++ *
++ * Only one AccessibleTextAttributesInfo structure is passed - which
++ * contains the attributes for the first character, the function then goes
++ * through the following characters in the range specified and stops when the
++ * attributes are different from the first, it then returns in the passed
++ * parameter len the number of characters with the attributes returned. In most
++ * situations this will be all the characters, and if not the calling program
++ * can easily get the attributes for the next characters with different
++ * attributes
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++
++/* NEW FASTER CODE!!*/
++BOOL
++AccessBridgeJavaEntryPoints::getTextAttributesInRange(const jobject accessibleContext,
++ int startIndex, int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len) {
++
++ jstring js;
++ const wchar_t *stringBytes;
++ jthrowable exception;
++ jsize length;
++ BOOL result = FALSE;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::getTextAttributesInRange(%p start = %d end = %d):",
++ accessibleContext, startIndex, endIndex);
++
++ *len = 0;
++ result = getAccessibleTextAttributes((jobject)accessibleContext, startIndex, attributes);
++ if (result != TRUE) {
++ return FALSE;
++ }
++ (*len)++;
++
++ for (jint i = startIndex+1; i <= endIndex; i++) {
++
++ AccessibleTextAttributesInfo test_attributes = *attributes;
++ // Get the full test_attributes string at i
++ if (getAccessibleAttributesAtIndexFromContextMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting full test_attributes string from Context...");
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleAttributesAtIndexFromContextMethod,
++ accessibleContext, i);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to GetStringChars()", FALSE);
++ wcsncpy(test_attributes.fullAttributesString, stringBytes, (sizeof(test_attributes.fullAttributesString) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ test_attributes.fullAttributesString[length < (sizeof(test_attributes.fullAttributesString) / sizeof(wchar_t)) ?
++ length : (sizeof(test_attributes.fullAttributesString) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Text attributes = %ls", test_attributes.fullAttributesString);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Text attributes is null.");
++ test_attributes.fullAttributesString[0] = (wchar_t) 0;
++ return FALSE;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleAttributesAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++ if(wcscmp(attributes->fullAttributesString,test_attributes.fullAttributesString))
++ break;
++ if (result != TRUE) {
++ return FALSE;
++ }
++ (*len)++;
++ }
++ return TRUE;
++}
++
++/*
++ * Returns the number of visible children of a component
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++int
++AccessBridgeJavaEntryPoints::getVisibleChildrenCount(const jobject accessibleContext) {
++
++ jthrowable exception;
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getVisibleChildrenCount(%p)",
++ accessibleContext);
++
++ // get the visible children count
++ int numChildren = jniEnv->CallIntMethod(accessBridgeObject, getVisibleChildrenCountMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("##### Getting visible children count - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### visible children count = %d", numChildren);
++
++ return numChildren;
++}
++
++
++/*
++ * This method is used to iterate through the visible children of a component. It
++ * returns visible children information for a component starting at nStartIndex.
++ * No more than MAX_VISIBLE_CHILDREN VisibleChildrenInfo objects will
++ * be returned for each call to this method. Returns FALSE on error.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++BOOL AccessBridgeJavaEntryPoints::getVisibleChildren(const jobject accessibleContext,
++ const int nStartIndex,
++ /* OUT */ VisibleChildrenInfo *visibleChildrenInfo) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getVisibleChildren(%p, startIndex = %d)",
++ accessibleContext, nStartIndex);
++
++ // get the visible children count
++ int numChildren = jniEnv->CallIntMethod(accessBridgeObject, getVisibleChildrenCountMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("##### Getting visible children count - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### visible children count = %d", numChildren);
++
++ if (nStartIndex >= numChildren) {
++ return FALSE;
++ }
++
++ // get the visible children
++ int bufIndex = 0;
++ for (int i = nStartIndex; (i < numChildren) && (i < nStartIndex + MAX_VISIBLE_CHILDREN); i++) {
++ PrintDebugString(" getting visible child %d ...", i);
++
++ // get the visible child at index i
++ jobject ac = jniEnv->CallObjectMethod(accessBridgeObject, getVisibleChildMethod,
++ accessibleContext, i);
++ EXCEPTION_CHECK("##### getVisibleChildMethod - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(ac);
++ EXCEPTION_CHECK("##### getVisibleChildMethod - call to NewGlobalRef()", FALSE);
++ visibleChildrenInfo->children[bufIndex] = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### visible child = %p", globalRef);
++
++ bufIndex++;
++ }
++ visibleChildrenInfo->returnedChildrenCount = bufIndex;
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getVisibleChildren succeeded");
++ return TRUE;
++}
++
++/**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++BOOL
++AccessBridgeJavaEntryPoints::setCaretPosition(const jobject accessibleContext, int position) {
++
++ jthrowable exception;
++ BOOL result = FALSE;
++
++ PrintDebugString("\r\nIn AccessBridgeJavaEntryPoints::setCaretPostion(%p position = %d):",
++ accessibleContext, position);
++
++ if (setCaretPositionMethod != (jmethodID) 0) {
++ result = (BOOL)jniEnv->CallBooleanMethod(accessBridgeObject,
++ setCaretPositionMethod,
++ accessibleContext, position);
++ EXCEPTION_CHECK("setCaretPostion - call to CallBooleanMethod()", FALSE);
++ PrintDebugString("\r\n result = %d", result);
++ return result;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or setCaretPositionMethod == 0");
++ return result;
++ }
++}
++
++
++// -----------------------------------
++
++/**
++ * getVersionInfo - returns the version string of the java.version property
++ * and the AccessBridge.java version
++ *
++ */
++BOOL
++AccessBridgeJavaEntryPoints::getVersionInfo(AccessBridgeVersionInfo *info) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getVersionInfo():");
++
++ if (getJavaVersionPropertyMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getJavaVersionPropertyMethod);
++ EXCEPTION_CHECK("Getting JavaVersionProperty - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ length = jniEnv->GetStringLength(js);
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ if (stringBytes == NULL) {
++ if (!jniEnv->ExceptionCheck()) {
++ PrintDebugString("\r\n *** Exception when getting JavaVersionProperty - call to GetStringChars");
++ jniEnv->ExceptionDescribe();
++ jniEnv->ExceptionClear();
++ }
++ return FALSE;
++ }
++ wcsncpy(info->bridgeJavaDLLVersion,
++ stringBytes,
++ sizeof(info->bridgeJavaDLLVersion) / sizeof(wchar_t));
++ info->bridgeJavaDLLVersion[length < (sizeof(info->bridgeJavaDLLVersion) / sizeof(wchar_t)) ?
++ length : (sizeof(info->bridgeJavaDLLVersion) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ wcsncpy(info->VMversion,
++ stringBytes,
++ sizeof(info->VMversion) / sizeof(wchar_t));
++ info->VMversion[length < (sizeof(info->VMversion) / sizeof(wchar_t)) ?
++ length : (sizeof(info->VMversion) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ wcsncpy(info->bridgeJavaClassVersion,
++ stringBytes,
++ sizeof(info->bridgeJavaClassVersion) / sizeof(wchar_t));
++ info->bridgeJavaClassVersion[length < (sizeof(info->bridgeJavaClassVersion) / sizeof(wchar_t)) ?
++ length : (sizeof(info->bridgeJavaClassVersion) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ wcsncpy(info->bridgeWinDLLVersion,
++ stringBytes,
++ sizeof(info->bridgeWinDLLVersion) / sizeof(wchar_t));
++ info->bridgeWinDLLVersion[length < (sizeof(info->bridgeWinDLLVersion) / sizeof(wchar_t)) ?
++ length : (sizeof(info->bridgeWinDLLVersion) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting JavaVersionProperty - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting JavaVersionProperty - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Java version = %ls", info->VMversion);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting JavaVersionProperty - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Java version is null.");
++ info->VMversion[0] = (wchar_t) 0;
++ return FALSE;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getJavaVersionPropertyMethod == 0");
++ return FALSE;
++ }
++
++ return TRUE;
++}
++
++
++/*
++ * Verifies the Java VM still exists and obj is an
++ * instance of AccessibleText
++ */
++BOOL AccessBridgeJavaEntryPoints::verifyAccessibleText(jobject obj) {
++ JavaVM *vm;
++ BOOL retval;
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::verifyAccessibleText");
++
++ if (jniEnv->GetJavaVM(&vm) != 0) {
++ PrintDebugString(" Error! No Java VM");
++ return FALSE;
++ }
++
++ if (obj == (jobject)0) {
++ PrintDebugString(" Error! Null jobject");
++ return FALSE;
++ }
++
++ // Copied from getAccessibleContextInfo
++ if (getAccessibleTextFromContextMethod != (jmethodID) 0) {
++ jobject returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTextFromContextMethod,
++ (jobject)obj);
++ EXCEPTION_CHECK("Getting AccessibleText - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" AccessibleText = %p", returnedJobject);
++ retval = returnedJobject != (jobject) 0;
++ jniEnv->DeleteLocalRef(returnedJobject);
++ EXCEPTION_CHECK("Getting AccessibleText - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTextFromContextMethod == 0");
++ return FALSE;
++ }
++ if (retval == FALSE) {
++ PrintDebugString(" Error! jobject is not an AccessibleText");
++ }
++ return retval;
++}
++
++
++/********** AccessibleContext routines ***********************************/
++
++/**
++ * getAccessibleContextAt - performs the Java method call:
++ * Accessible AccessBridge.getAccessibleContextAt(x, y)
++ *
++ * Note: this call explicitly goes through the AccessBridge,
++ * so that it can keep a reference the returned jobject for the JavaVM.
++ * You must explicity call INTreleaseJavaObject() when you are through using
++ * the Accessible returned, to let the AccessBridge know it can release the
++ * object, so that the can then garbage collect it.
++ *
++ */
++jobject
++AccessBridgeJavaEntryPoints::getAccessibleContextAt(jint x, jint y, jobject accessibleContext) {
++ jobject returnedAccessibleContext;
++ jobject globalRef;
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleContextAt(%d, %d, %p):",
++ x, y, accessibleContext);
++
++ if (getAccessibleContextAtMethod != (jmethodID) 0) {
++ returnedAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleContextAtMethod,
++ x, y, accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleContextAt - call to CallObjectMethod()", FALSE);
++ globalRef = jniEnv->NewGlobalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleContextAt - call to NewGlobalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ returnedAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleContextAtMethod == 0");
++ return (jobject) 0;
++ }
++}
++
++/**
++ * getAccessibleWithFocus - performs the Java method calls:
++ * Accessible Translator.getAccessible(SwingEventMonitor.getComponentWithFocus();
++ *
++ * Note: this call explicitly goes through the AccessBridge,
++ * so that the AccessBridge can hide expected changes in how this functions
++ * between JDK 1.1.x w/AccessibilityUtility classes, and JDK 1.2, when some
++ * of this functionality may be built into the platform
++ *
++ */
++jobject
++AccessBridgeJavaEntryPoints::getAccessibleContextWithFocus() {
++ jobject returnedAccessibleContext;
++ jobject globalRef;
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleContextWithFocus()");
++
++ if (getAccessibleContextWithFocusMethod != (jmethodID) 0) {
++ returnedAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleContextWithFocusMethod);
++ EXCEPTION_CHECK("Getting AccessibleContextWithFocus - call to CallObjectMethod()", FALSE);
++ globalRef = jniEnv->NewGlobalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleContextWithFocus - call to NewGlobalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ returnedAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString(" Error! either jniEnv == 0 or getAccessibleContextWithFocusMethod == 0");
++ return (jobject) 0;
++ }
++}
++
++/**
++ * getAccessibleContextInfo - fills a struct with a bunch of information
++ * contained in the Java Accessibility API
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ *
++ * Note: this call explicitly goes through the AccessBridge,
++ * so that it can keep a reference the returned jobject for the JavaVM.
++ * You must explicity call releaseJavaObject() when you are through using
++ * the AccessibleContext returned, to let the AccessBridge know it can release the
++ * object, so that the JavaVM can then garbage collect it.
++ */
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleContextInfo(jobject accessibleContext, AccessibleContextInfo *info) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jobject returnedJobject;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\n##### Calling AccessBridgeJavaEntryPoints::getAccessibleContextInfo(%p):", accessibleContext);
++
++ ZeroMemory(info, sizeof(AccessibleContextInfo));
++
++ if (accessibleContext == (jobject) 0) {
++ PrintDebugString(" passed in AccessibleContext == null! (oops)");
++ return (FALSE);
++ }
++
++ // Get the Accessible Name
++ if (getAccessibleNameFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleNameFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleName - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleName - call to GetStringChars()", FALSE);
++ wcsncpy(info->name, stringBytes, (sizeof(info->name) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ info->name[length < (sizeof(info->name) / sizeof(wchar_t)) ?
++ length : (sizeof(info->name) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleName - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleName - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleName - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Name = %ls", info->name);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleName - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Name is null.");
++ info->name[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleNameFromContextMethod == 0");
++ return FALSE;
++ }
++
++
++ // Get the Accessible Description
++ if (getAccessibleDescriptionFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleDescriptionFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleDescription - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleName - call to GetStringChars()", FALSE);
++ wcsncpy(info->description, stringBytes, (sizeof(info->description) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ info->description[length < (sizeof(info->description) / sizeof(wchar_t)) ?
++ length : (sizeof(info->description) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleName - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleName - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleName - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Description = %ls", info->description);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleName - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Description is null.");
++ info->description[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleDescriptionFromContextMethod == 0");
++ return FALSE;
++ }
++
++
++ // Get the Accessible Role String
++ if (getAccessibleRoleStringFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleRoleStringFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleRole - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleRole - call to GetStringChars()", FALSE);
++ wcsncpy(info->role, stringBytes, (sizeof(info->role) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ info->role[length < (sizeof(info->role) / sizeof(wchar_t)) ?
++ length : (sizeof(info->role) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleRole - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleRole - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleRole - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Role = %ls", info->role);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleRole - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Role is null.");
++ info->role[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleRoleStringFromContextMethod == 0");
++ return FALSE;
++ }
++
++
++ // Get the Accessible Role String in the en_US locale
++ if (getAccessibleRoleStringFromContext_en_USMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleRoleStringFromContext_en_USMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleRole_en_US - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleRole_en_US - call to GetStringChars()", FALSE);
++ wcsncpy(info->role_en_US, stringBytes, (sizeof(info->role_en_US) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ info->role_en_US[length < (sizeof(info->role_en_US) / sizeof(wchar_t)) ?
++ length : (sizeof(info->role_en_US) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleRole_en_US - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleRole_en_US - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleRole_en_US - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Role en_US = %ls", info->role_en_US);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleRole_en_US - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Role en_US is null.");
++ info->role[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleRoleStringFromContext_en_USMethod == 0");
++ return FALSE;
++ }
++
++ // Get the Accessible States String
++ if (getAccessibleStatesStringFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleStatesStringFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleState - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleState - call to GetStringChars()", FALSE);
++ wcsncpy(info->states, stringBytes, (sizeof(info->states) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ info->states[length < (sizeof(info->states) / sizeof(wchar_t)) ?
++ length : (sizeof(info->states) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleState - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleState - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleState - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible States = %ls", info->states);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleState - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible States is null.");
++ info->states[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleStatesStringFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the Accessible States String in the en_US locale
++ if (getAccessibleStatesStringFromContext_en_USMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleStatesStringFromContext_en_USMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleState_en_US - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleState_en_US - call to GetStringChars()", FALSE);
++ wcsncpy(info->states_en_US, stringBytes, (sizeof(info->states_en_US) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ info->states_en_US[length < (sizeof(info->states_en_US) / sizeof(wchar_t)) ?
++ length : (sizeof(info->states_en_US) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleState_en_US - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleState_en_US - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleState_en_US - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible States en_US = %ls", info->states_en_US);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleState_en_US - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible States en_US is null.");
++ info->states[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleStatesStringFromContext_en_USMethod == 0");
++ return FALSE;
++ }
++
++
++ // Get the index in Parent
++ if (getAccessibleIndexInParentFromContextMethod != (jmethodID) 0) {
++ info->indexInParent = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleIndexInParentFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleIndexInParent - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Index in Parent = %d", info->indexInParent);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleIndexInParentFromContextMethod == 0");
++ return FALSE;
++ }
++
++
++ PrintDebugString("*** jniEnv: %p; accessBridgeObject: %p; AccessibleContext: %p ***",
++ jniEnv, accessBridgeObject, accessibleContext);
++
++ // Get the children count
++ if (getAccessibleChildrenCountFromContextMethod != (jmethodID) 0) {
++ info->childrenCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleChildrenCountFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleChildrenCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Children count = %d", info->childrenCount);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleChildrenCountFromContextMethod == 0");
++ return FALSE;
++ }
++
++ PrintDebugString("*** jniEnv: %p; accessBridgeObject: %p; AccessibleContext: %X ***",
++ jniEnv, accessBridgeObject, accessibleContext);
++
++
++ // Get the x coord
++ if (getAccessibleXcoordFromContextMethod != (jmethodID) 0) {
++ info->x = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleXcoordFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleXcoord - call to CallIntMethod()", FALSE);
++ PrintDebugString(" X coord = %d", info->x);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleXcoordFromContextMethod == 0");
++ return FALSE;
++ }
++
++ PrintDebugString("*** jniEnv: %X; accessBridgeObject: %X; AccessibleContext: %p ***",
++ jniEnv, accessBridgeObject, accessibleContext);
++
++
++ // Get the y coord
++ if (getAccessibleYcoordFromContextMethod != (jmethodID) 0) {
++ info->y = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleYcoordFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleYcoord - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Y coord = %d", info->y);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleYcoordFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the width
++ if (getAccessibleWidthFromContextMethod != (jmethodID) 0) {
++ info->width = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleWidthFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleWidth - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Width = %d", info->width);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleWidthFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the height
++ if (getAccessibleHeightFromContextMethod != (jmethodID) 0) {
++ info->height = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHeightFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleHeight - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Height = %d", info->height);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleHeightFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the AccessibleComponent
++ if (getAccessibleComponentFromContextMethod != (jmethodID) 0) {
++ returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleComponentFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleComponent - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" AccessibleComponent = %p", returnedJobject);
++ info->accessibleComponent = (returnedJobject != (jobject) 0 ? TRUE : FALSE);
++ jniEnv->DeleteLocalRef(returnedJobject);
++ EXCEPTION_CHECK("Getting AccessibleComponent - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleComponentFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the AccessibleAction
++ if (getAccessibleActionFromContextMethod != (jmethodID) 0) {
++ returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleActionFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleAction - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" AccessibleAction = %p", returnedJobject);
++ info->accessibleAction = (returnedJobject != (jobject) 0 ? TRUE : FALSE);
++ jniEnv->DeleteLocalRef(returnedJobject);
++ EXCEPTION_CHECK("Getting AccessibleAction - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleActionFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the AccessibleSelection
++ if (getAccessibleSelectionFromContextMethod != (jmethodID) 0) {
++ returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleSelectionFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleSelection - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" AccessibleSelection = %p", returnedJobject);
++ info->accessibleSelection = (returnedJobject != (jobject) 0 ? TRUE : FALSE);
++ jniEnv->DeleteLocalRef(returnedJobject);
++ EXCEPTION_CHECK("Getting AccessibleSelection - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleSelectionFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the AccessibleTable
++ if (getAccessibleTableFromContextMethod != (jmethodID) 0) {
++ PrintDebugString("##### Calling getAccessibleTableFromContextMethod ...");
++ returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTableFromContextMethod,
++ accessibleContext);
++ PrintDebugString("##### ... Returned from getAccessibleTableFromContextMethod");
++ EXCEPTION_CHECK("##### Getting AccessibleTable - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" ##### AccessibleTable = %p", returnedJobject);
++ if (returnedJobject != (jobject) 0) {
++ info->accessibleInterfaces |= cAccessibleTableInterface;
++ }
++ jniEnv->DeleteLocalRef(returnedJobject);
++ EXCEPTION_CHECK("##### Getting AccessibleTable - call to DeleteLocalRef()", FALSE);
++
++ /*
++ returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTableFromContextMethod,
++ AccessibleContext);
++ PrintDebugString("##### ... Returned from getAccessibleTableFromContextMethod");
++ EXCEPTION_CHECK("##### Getting AccessibleTable - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" ##### AccessibleTable = %X", returnedJobject);
++ info->accessibleTable = returnedJobject;
++ */
++
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the AccessibleText
++ if (getAccessibleTextFromContextMethod != (jmethodID) 0) {
++ returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTextFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleText - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" AccessibleText = %p", returnedJobject);
++ info->accessibleText = (returnedJobject != (jobject) 0 ? TRUE : FALSE);
++ jniEnv->DeleteLocalRef(returnedJobject);
++ EXCEPTION_CHECK("Getting AccessibleText - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTextFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the AccessibleValue
++ if (getAccessibleValueFromContextMethod != (jmethodID) 0) {
++ returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleValueFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleValue - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" AccessibleValue = %p", returnedJobject);
++ if (returnedJobject != (jobject) 0) {
++ info->accessibleInterfaces |= cAccessibleValueInterface;
++ }
++ jniEnv->DeleteLocalRef(returnedJobject);
++ EXCEPTION_CHECK("Getting AccessibleValue - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleValueFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // FIX
++ // get the AccessibleHypertext
++ if (getAccessibleHypertextMethod != (jmethodID) 0 &&
++ getAccessibleHyperlinkCountMethod != (jmethodID) 0 &&
++ getAccessibleHyperlinkMethod != (jmethodID) 0 &&
++ getAccessibleHyperlinkTextMethod != (jmethodID) 0 &&
++ getAccessibleHyperlinkStartIndexMethod != (jmethodID) 0 &&
++ getAccessibleHyperlinkEndIndexMethod != (jmethodID) 0) {
++ returnedJobject = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleHypertextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleHypertext - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" AccessibleHypertext = %p",
++ returnedJobject);
++ if (returnedJobject != (jobject) 0) {
++ info->accessibleInterfaces |= cAccessibleHypertextInterface;
++ }
++ jniEnv->DeleteLocalRef(returnedJobject);
++ EXCEPTION_CHECK("Getting AccessibleHypertext - call to DeleteLocalRef()", FALSE);
++ }
++
++ // set new accessibleInterfaces flags from old BOOL values
++ if(info->accessibleComponent)
++ info->accessibleInterfaces |= cAccessibleComponentInterface;
++ if(info->accessibleAction)
++ info->accessibleInterfaces |= cAccessibleActionInterface;
++ if(info->accessibleSelection)
++ info->accessibleInterfaces |= cAccessibleSelectionInterface;
++ if(info->accessibleText)
++ info->accessibleInterfaces |= cAccessibleTextInterface;
++ // FIX END
++
++ return TRUE;
++}
++
++/**
++ * getAccessibleChildFromContext - performs the Java method call:
++ * AccessibleContext AccessBridge.getAccessibleChildContext(AccessibleContext)
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ *
++ * Note: this call explicitly goes through the AccessBridge,
++ * so that it can keep a reference the returned jobject for the JavaVM.
++ * You must explicity call releaseJavaObject() when you are through using
++ * the AccessibleContext returned, to let the AccessBridge know it can release the
++ * object, so that the JavaVM can then garbage collect it.
++ */
++jobject
++AccessBridgeJavaEntryPoints::getAccessibleChildFromContext(jobject accessibleContext, jint childIndex) {
++ jobject returnedAccessibleContext;
++ jobject globalRef;
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleChildContext(%p, %d):",
++ accessibleContext, childIndex);
++
++ if (getAccessibleChildFromContextMethod != (jmethodID) 0) {
++ returnedAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleChildFromContextMethod,
++ accessibleContext, childIndex);
++ EXCEPTION_CHECK("Getting AccessibleChild - call to CallObjectMethod()", FALSE);
++ globalRef = jniEnv->NewGlobalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleChild - call to NewGlobalRef()", FALSE);
++ jniEnv->DeleteLocalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleChild - call to DeleteLocalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ returnedAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleChildContextMethod == 0");
++ return (jobject) 0;
++ }
++}
++
++/**
++ * getAccessibleParentFromContext - returns the AccessibleContext parent
++ *
++ */
++jobject
++AccessBridgeJavaEntryPoints::getAccessibleParentFromContext(jobject accessibleContext)
++{
++ jobject returnedAccessibleContext;
++ jobject globalRef;
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleParentFromContext(%p):", accessibleContext);
++
++ if (getAccessibleParentFromContextMethod != (jmethodID) 0) {
++ returnedAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleParentFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleParent - call to CallObjectMethod()", FALSE);
++ globalRef = jniEnv->NewGlobalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleParent - call to NewGlobalRef()", FALSE);
++ jniEnv->DeleteLocalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleParent - call to DeleteLocalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ returnedAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleParentFromContextMethod == 0");
++ return (jobject) 0;
++ }
++}
++
++
++/********** AccessibleTable routines **********************************/
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTableInfo(jobject accessibleContext,
++ AccessibleTableInfo *tableInfo) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableInfo(%p):",
++ accessibleContext);
++
++ // get the table row count
++ if (getAccessibleTableRowCountMethod != (jmethodID) 0) {
++ tableInfo->rowCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableRowCountMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("##### Getting AccessibleTableRowCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table row count = %d", tableInfo->rowCount);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleRowCountMethod == 0");
++ return FALSE;
++ }
++
++ // get the table column count
++ if (getAccessibleTableColumnCountMethod != (jmethodID) 0) {
++ tableInfo->columnCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableColumnCountMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleTableColumnCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table column count = %d", tableInfo->columnCount);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableColumnCountMethod == 0");
++ return FALSE;
++ }
++
++ // get the AccessibleTable
++ if (getAccessibleTableFromContextMethod != (jmethodID) 0) {
++ PrintDebugString("##### Calling getAccessibleTableFromContextMethod ...");
++ jobject accTable = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTableFromContextMethod,
++ accessibleContext);
++ PrintDebugString("##### ... Returned from getAccessibleTableFromContextMethod");
++ EXCEPTION_CHECK("##### Getting AccessibleTable - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(accTable);
++ EXCEPTION_CHECK("##### Getting AccessibleTable - call to NewGlobalRef()", FALSE);
++ tableInfo->accessibleTable = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### accessibleTable = %p", globalRef);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // cache the AccessibleContext
++ if (getContextFromAccessibleTableMethod != (jmethodID) 0) {
++ PrintDebugString("##### Calling getContextFromAccessibleTable Method ...");
++ jobject ac = jniEnv->CallObjectMethod(accessBridgeObject,
++ getContextFromAccessibleTableMethod,
++ accessibleContext);
++ PrintDebugString("##### ... Returned from getContextFromAccessibleTable Method");
++ EXCEPTION_CHECK("##### Getting AccessibleTable - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(ac);
++ EXCEPTION_CHECK("##### Getting AccessibleTable - call to NewGlobalRef()", FALSE);
++ tableInfo->accessibleContext = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### accessibleContext = %p", globalRef);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getContextFromAccessibleTable Method == 0");
++ return FALSE;
++ }
++
++ // FIX - set unused elements
++ tableInfo->caption = NULL;
++ tableInfo->summary = NULL;
++
++ PrintDebugString("##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableInfo succeeded");
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTableCellInfo(jobject accessibleTable, jint row, jint column,
++ AccessibleTableCellInfo *tableCellInfo) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableCellInfo(%p): row=%d, column=%d",
++ accessibleTable, row, column);
++
++ // FIX
++ ZeroMemory(tableCellInfo, sizeof(AccessibleTableCellInfo));
++ tableCellInfo->row = row;
++ tableCellInfo->column = column;
++ // FIX END
++
++ // get the table cell index
++ if (getAccessibleTableCellIndexMethod != (jmethodID) 0) {
++ tableCellInfo->index = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableCellIndexMethod,
++ accessibleTable, row, column);
++ EXCEPTION_CHECK("##### Getting AccessibleTableCellIndex - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table cell index = %d", tableCellInfo->index);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableCellIndexMethod == 0");
++ return FALSE;
++ }
++
++ // get the table cell row extent
++ if (getAccessibleTableCellRowExtentMethod != (jmethodID) 0) {
++ tableCellInfo->rowExtent = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableCellRowExtentMethod,
++ accessibleTable, row, column);
++ EXCEPTION_CHECK("##### Getting AccessibleTableCellRowExtentCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table cell row extent = %d", tableCellInfo->rowExtent);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableCellRowExtentMethod == 0");
++ return FALSE;
++ }
++
++ // get the table cell column extent
++ if (getAccessibleTableCellColumnExtentMethod != (jmethodID) 0) {
++ tableCellInfo->columnExtent = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableCellColumnExtentMethod,
++ accessibleTable, row, column);
++ EXCEPTION_CHECK("##### Getting AccessibleTableCellColumnExtentCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table cell column extent = %d", tableCellInfo->columnExtent);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableCellColumnExtentMethod == 0");
++ return FALSE;
++ }
++
++ // get whether the table cell is selected
++ if (isAccessibleTableCellSelectedMethod != (jmethodID) 0) {
++ tableCellInfo->isSelected = jniEnv->CallBooleanMethod(accessBridgeObject,
++ isAccessibleTableCellSelectedMethod,
++ accessibleTable, row, column);
++ EXCEPTION_CHECK("##### Getting isAccessibleTableCellSelected - call to CallBooleanMethod()", FALSE);
++ PrintDebugString(" ##### table cell isSelected = %d", tableCellInfo->isSelected);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or isAccessibleTableCellSelectedMethod == 0");
++ return FALSE;
++ }
++
++ // get the table cell AccessibleContext
++ if (getAccessibleTableCellAccessibleContextMethod != (jmethodID) 0) {
++ jobject tableCellAC = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTableCellAccessibleContextMethod,
++ accessibleTable, row, column);
++ EXCEPTION_CHECK("##### Getting AccessibleTableCellAccessibleContext - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(tableCellAC);
++ EXCEPTION_CHECK("##### Getting AccessibleTableCellAccessibleContext - call to NewGlobalRef()", FALSE);
++ tableCellInfo->accessibleContext = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### table cell AccessibleContext = %p", globalRef);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableCellAccessibleContextMethod == 0");
++ return FALSE;
++ }
++
++ PrintDebugString(" ##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableCellInfo succeeded");
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTableRowHeader(jobject acParent, AccessibleTableInfo *tableInfo) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableRowHeader(%p):",
++ acParent);
++
++ // get the header row count
++ if (getAccessibleTableRowHeaderRowCountMethod != (jmethodID) 0) {
++ tableInfo->rowCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableRowHeaderRowCountMethod,
++ acParent);
++ EXCEPTION_CHECK("##### Getting AccessibleTableRowHeaderRowCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table row count = %d", tableInfo->rowCount);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleRowHeaderRowCountMethod == 0");
++ return FALSE;
++ }
++
++ // get the header column count
++ if (getAccessibleTableRowHeaderColumnCountMethod != (jmethodID) 0) {
++ tableInfo->columnCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableRowHeaderColumnCountMethod,
++ acParent);
++ EXCEPTION_CHECK("Getting AccessibleTableRowHeaderColumnCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table column count = %d", tableInfo->columnCount);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableRowHeaderColumnCountMethod == 0");
++ return FALSE;
++ }
++
++ // get the header AccessibleTable
++ if (getAccessibleTableRowHeaderMethod != (jmethodID) 0) {
++ jobject accTable = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTableRowHeaderMethod,
++ acParent);
++ EXCEPTION_CHECK("##### Getting AccessibleTableRowHeader - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(accTable);
++ EXCEPTION_CHECK("##### Getting AccessibleTableRowHeader - call to NewGlobalRef()", FALSE);
++ tableInfo->accessibleTable = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### row header AccessibleTable = %p", globalRef);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableRowHeaderMethod == 0");
++ return FALSE;
++ }
++
++ // FIX - set unused elements
++ tableInfo->caption = NULL;
++ tableInfo->summary = NULL;
++ tableInfo->accessibleContext = NULL;
++
++ PrintDebugString(" ##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableRowHeader succeeded");
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTableColumnHeader(jobject acParent, AccessibleTableInfo *tableInfo) {
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableColumnHeader(%p):",
++ acParent);
++
++ // get the header row count
++ if (getAccessibleTableColumnHeaderRowCountMethod != (jmethodID) 0) {
++ tableInfo->rowCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableColumnHeaderRowCountMethod,
++ acParent);
++ EXCEPTION_CHECK("##### Getting AccessibleTableColumnHeaderRowCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table row count = %d", tableInfo->rowCount);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleColumnHeaderRowCountMethod == 0");
++ return FALSE;
++ }
++
++ // get the header column count
++ if (getAccessibleTableColumnHeaderColumnCountMethod != (jmethodID) 0) {
++ tableInfo->columnCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableColumnHeaderColumnCountMethod,
++ acParent);
++ EXCEPTION_CHECK("Getting AccessibleTableColumnHeaderColumnCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table column count = %d", tableInfo->columnCount);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableColumnHeaderColumnCountMethod == 0");
++ return FALSE;
++ }
++ // get the header AccessibleTable
++ if (getAccessibleTableColumnHeaderMethod != (jmethodID) 0) {
++ jobject accTable = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTableColumnHeaderMethod,
++ acParent);
++ EXCEPTION_CHECK("##### Getting AccessibleTableColumnHeader - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(accTable);
++ EXCEPTION_CHECK("##### Getting AccessibleTableColumnHeader - call to NewGlobalRef()", FALSE);
++ tableInfo->accessibleTable = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### column header AccessibleTable = %p", globalRef);
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableColumnHeaderMethod == 0");
++ return FALSE;
++ }
++
++ // FIX - set unused elements
++ tableInfo->caption = NULL;
++ tableInfo->summary = NULL;
++ tableInfo->accessibleContext = NULL;
++
++ PrintDebugString(" ##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableColumnHeader succeeded");
++ return TRUE;
++}
++
++jobject
++AccessBridgeJavaEntryPoints::getAccessibleTableRowDescription(jobject acParent, jint row) {
++
++ jobject returnedAccessibleContext;
++ jobject globalRef;
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableRowDescription(%p):",
++ acParent);
++
++ if (getAccessibleTableRowDescriptionMethod != (jmethodID) 0) {
++ returnedAccessibleContext = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTableRowDescriptionMethod,
++ acParent, row);
++ EXCEPTION_CHECK("Getting AccessibleTableRowDescription - call to CallObjectMethod()", FALSE);
++ globalRef = jniEnv->NewGlobalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleTableRowDescription - call to NewGlobalRef()", FALSE);
++ jniEnv->DeleteLocalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleTableRowDescription - call to DeleteLocalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ returnedAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTableRowDescriptionMethod == 0");
++ return (jobject) 0;
++ }
++}
++
++jobject
++AccessBridgeJavaEntryPoints::getAccessibleTableColumnDescription(jobject acParent, jint column) {
++
++ jobject returnedAccessibleContext;
++ jobject globalRef;
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### Calling AccessBridgeJavaEntryPoints::getAccessibleTableColumnDescription(%p):",
++ acParent);
++
++ if (getAccessibleTableColumnDescriptionMethod != (jmethodID) 0) {
++ returnedAccessibleContext = jniEnv->CallObjectMethod(
++ accessBridgeObject,
++ getAccessibleTableColumnDescriptionMethod,
++ acParent, column);
++ EXCEPTION_CHECK("Getting AccessibleTableColumnDescription - call to CallObjectMethod()", FALSE);
++ globalRef = jniEnv->NewGlobalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleTableColumnDescription - call to NewGlobalRef()", FALSE);
++ jniEnv->DeleteLocalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleTableColumnDescription - call to DeleteLocalRef()", FALSE);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ returnedAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTableColumnDescriptionMethod == 0");
++ return (jobject) 0;
++ }
++}
++
++jint
++AccessBridgeJavaEntryPoints::getAccessibleTableRowSelectionCount(jobject accessibleTable) {
++
++ jthrowable exception;
++ jint count;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleTableRowSelectionCount(%p)",
++ accessibleTable);
++
++ // Get the table row selection count
++ if (getAccessibleTableRowSelectionCountMethod != (jmethodID) 0) {
++ count = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableRowSelectionCountMethod,
++ accessibleTable);
++ EXCEPTION_CHECK("##### Getting AccessibleTableRowSelectionCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table row selection count = %d", count);
++ return count;
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableRowSelectionCountMethod == 0");
++ return 0;
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleTableRowSelectionCount failed");
++ return 0;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::isAccessibleTableRowSelected(jobject accessibleTable, jint row) {
++ jthrowable exception;
++ BOOL result;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::isAccessibleTableRowSelected(%p, %d)",
++ accessibleTable, row);
++
++ if (isAccessibleTableRowSelectedMethod != (jmethodID) 0) {
++ result = jniEnv->CallBooleanMethod(accessBridgeObject,
++ isAccessibleTableRowSelectedMethod,
++ accessibleTable, row);
++ EXCEPTION_CHECK("##### Getting isAccessibleTableRowSelected - call to CallBooleanMethod()", FALSE);
++ PrintDebugString(" ##### table row isSelected = %d", result);
++ return result;
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or isAccessibleTableRowSelectedMethod == 0");
++ return FALSE;
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::isAccessibleTableRowSelected failed");
++ return FALSE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTableRowSelections(jobject accessibleTable, jint count,
++ jint *selections) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleTableRowSelections(%p, %d %p)",
++ accessibleTable, count, selections);
++
++ if (getAccessibleTableRowSelectionsMethod == (jmethodID) 0) {
++ return FALSE;
++ }
++ // Get the table row selections
++ for (int i = 0; i < count; i++) {
++
++ selections[i] = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableRowSelectionsMethod,
++ accessibleTable,
++ i);
++ EXCEPTION_CHECK("##### Getting AccessibleTableRowSelections - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table row selection[%d] = %d", i, selections[i]);
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleTableRowSelections succeeded");
++ return TRUE;
++}
++
++
++jint
++AccessBridgeJavaEntryPoints::getAccessibleTableColumnSelectionCount(jobject accessibleTable) {
++
++ jthrowable exception;
++ jint count;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleTableColumnSelectionCount(%p)",
++ accessibleTable);
++
++ // Get the table column selection count
++ if (getAccessibleTableColumnSelectionCountMethod != (jmethodID) 0) {
++ count = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableColumnSelectionCountMethod,
++ accessibleTable);
++ EXCEPTION_CHECK("##### Getting AccessibleTableColumnSelectionCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table column selection count = %d", count);
++ return count;
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleRowCountMethod == 0");
++ return 0;
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleTableColumnSelectionCount failed");
++ return 0;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::isAccessibleTableColumnSelected(jobject accessibleTable, jint column) {
++ jthrowable exception;
++ BOOL result;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::isAccessibleTableColumnSelected(%p, %d)",
++ accessibleTable, column);
++
++ if (isAccessibleTableColumnSelectedMethod != (jmethodID) 0) {
++ result = jniEnv->CallBooleanMethod(accessBridgeObject,
++ isAccessibleTableColumnSelectedMethod,
++ accessibleTable, column);
++ EXCEPTION_CHECK("##### Getting isAccessibleTableColumnSelected - call to CallBooleanMethod()", FALSE);
++ PrintDebugString(" ##### table column isSelected = %d", result);
++ return result;
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or isAccessibleTableColumnSelectedMethod == 0");
++ return FALSE;
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::isAccessibleTableColumnSelected failed");
++ return FALSE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTableColumnSelections(jobject accessibleTable, jint count,
++ jint *selections) {
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleTableColumnSelections(%p, %d, %p)",
++ accessibleTable, count, selections);
++
++ if (getAccessibleTableColumnSelectionsMethod == (jmethodID) 0) {
++ return FALSE;
++ }
++ // Get the table column selections
++ for (int i = 0; i < count; i++) {
++
++ selections[i] = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableColumnSelectionsMethod,
++ accessibleTable,
++ i);
++ EXCEPTION_CHECK("##### Getting AccessibleTableColumnSelections - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table Column selection[%d] = %d", i, selections[i]);
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleTableColumnSelections succeeded");
++ return TRUE;
++}
++
++
++jint
++AccessBridgeJavaEntryPoints::getAccessibleTableRow(jobject accessibleTable, jint index) {
++ jthrowable exception;
++ jint result;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleTableRow(%p, index=%d)",
++ accessibleTable, index);
++
++ if (getAccessibleTableRowMethod != (jmethodID) 0) {
++ result = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableRowMethod,
++ accessibleTable, index);
++ EXCEPTION_CHECK("##### Getting AccessibleTableRow - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table row = %d", result);
++ return result;
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableRowMethod == 0");
++ return -1;
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleTableRow failed");
++ return -1;
++}
++
++jint
++AccessBridgeJavaEntryPoints::getAccessibleTableColumn(jobject accessibleTable, jint index) {
++ jthrowable exception;
++ jint result;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleTableColumn(%p, index=%d)",
++ accessibleTable, index);
++
++ if (getAccessibleTableColumnMethod != (jmethodID) 0) {
++ result = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableColumnMethod,
++ accessibleTable, index);
++ EXCEPTION_CHECK("##### Getting AccessibleTableColumn - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table column = %d", result);
++ return result;
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableColumnMethod == 0");
++ return -1;
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleTableColumn failed");
++ return -1;
++}
++
++jint
++AccessBridgeJavaEntryPoints::getAccessibleTableIndex(jobject accessibleTable, jint row, jint column) {
++ jthrowable exception;
++ jint result;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleTableIndex(%p, row=%d, col=%d)",
++ accessibleTable, row, column);
++
++ if (getAccessibleTableIndexMethod != (jmethodID) 0) {
++ result = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTableIndexMethod,
++ accessibleTable, row, column);
++ EXCEPTION_CHECK("##### Getting getAccessibleTableIndex - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### table index = %d", result);
++ return result;
++ } else {
++ PrintDebugString(" ##### Error! either env == 0 or getAccessibleTableIndexMethod == 0");
++ return -1;
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleTableIndex failed");
++ return -1;
++}
++
++/********** end AccessibleTable routines ******************************/
++
++
++/********** begin AccessibleRelationSet routines **********************/
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleRelationSet(jobject accessibleContext,
++ AccessibleRelationSetInfo *relationSet) {
++
++ jthrowable exception;
++ const wchar_t *stringBytes;
++ jsize length;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleRelationSet(%p, %p)",
++ accessibleContext, relationSet);
++
++ if (getAccessibleRelationCountMethod == (jmethodID) 0 ||
++ getAccessibleRelationKeyMethod == (jmethodID) 0 ||
++ getAccessibleRelationTargetCountMethod == (jmethodID) 0 ||
++ getAccessibleRelationTargetMethod == (jmethodID) 0) {
++ return FALSE;
++ }
++
++ // Get the relations set count
++ relationSet->relationCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleRelationCountMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("##### Getting AccessibleRelationCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### AccessibleRelation count = %d", relationSet->relationCount);
++
++
++ // Get the relation set
++ for (int i = 0; i < relationSet->relationCount && i < MAX_RELATIONS; i++) {
++
++ jstring js = (jstring)jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleRelationKeyMethod,
++ accessibleContext,
++ i);
++
++ EXCEPTION_CHECK("Getting AccessibleRelationKey - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleRelation key - call to GetStringChars()", FALSE);
++ wcsncpy(relationSet->relations[i].key, stringBytes, (sizeof(relationSet->relations[i].key ) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ relationSet->relations[i].key [length < (sizeof(relationSet->relations[i].key ) / sizeof(wchar_t)) ?
++ length : (sizeof(relationSet->relations[i].key ) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleRelation key - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleRelation key - call to ReleaseStringChars()", FALSE);
++ // jniEnv->CallVoidMethod(accessBridgeObject,
++ // decrementReferenceMethod, js);
++ //EXCEPTION_CHECK("Getting AccessibleRelation key - call to CallVoidMethod()", FALSE);
++ PrintDebugString("##### AccessibleRelation key = %ls", relationSet->relations[i].key );
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleRelation key - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" AccessibleRelation key is null.");
++ relationSet->relations[i].key [0] = (wchar_t) 0;
++ }
++
++ relationSet->relations[i].targetCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleRelationTargetCountMethod,
++ accessibleContext,
++ i);
++
++ for (int j = 0; j < relationSet->relations[i].targetCount && j < MAX_RELATION_TARGETS; j++) {
++ jobject target = jniEnv->CallObjectMethod(accessBridgeObject, getAccessibleRelationTargetMethod,
++ accessibleContext, i, j);
++ EXCEPTION_CHECK("Getting AccessibleRelationSet - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(target);
++ EXCEPTION_CHECK("Getting AccessibleRelationSet - call to NewGlobalRef()", FALSE);
++ relationSet->relations[i].targets[j] = (JOBJECT64)globalRef;
++ PrintDebugString(" relation set item: %p", globalRef);
++ }
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleRelationSet succeeded");
++ return TRUE;
++}
++
++
++/********** end AccessibleRelationSet routines ************************/
++
++
++/********** begin AccessibleHypertext routines **********************/
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleHypertext(jobject accessibleContext,
++ AccessibleHypertextInfo *hypertext) {
++
++ jthrowable exception;
++ const wchar_t *stringBytes;
++ jsize length;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleHypertext(%p, %p)",
++ accessibleContext, hypertext);
++
++ // get the AccessibleHypertext
++ jobject ht = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleHypertextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("##### Getting AccessibleHypertext - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(ht);
++ EXCEPTION_CHECK("##### Getting AccessibleHypertext - call to NewGlobalRef()", FALSE);
++ hypertext->accessibleHypertext = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### AccessibleHypertext = %p", globalRef);
++
++ if (hypertext->accessibleHypertext == 0) {
++ PrintDebugString(" ##### null AccessibleHypertext; returning FALSE");
++ return false;
++ }
++
++ // get the hyperlink count
++ hypertext->linkCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHyperlinkCountMethod,accessibleContext);
++
++ EXCEPTION_CHECK("##### Getting hyperlink count - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### hyperlink count = %d", hypertext->linkCount);
++
++
++ // get the hypertext links
++ for (int i = 0; i < hypertext->linkCount && i < MAX_HYPERLINKS; i++) {
++
++ // get the hyperlink
++ jobject hl = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleHyperlinkMethod,
++ accessibleContext,
++ i);
++ EXCEPTION_CHECK("##### Getting AccessibleHyperlink - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(hl);
++ EXCEPTION_CHECK("##### Getting AccessibleHyperlink - call to NewGlobalRef()", FALSE);
++ hypertext->links[i].accessibleHyperlink = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### AccessibleHyperlink = %p", globalRef);
++
++ // get the hyperlink text
++ jstring js = (jstring)jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleHyperlinkTextMethod,
++ hypertext->links[i].accessibleHyperlink,
++ i);
++
++ EXCEPTION_CHECK("Getting hyperlink text - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to GetStringChars()", FALSE);
++ wcsncpy(hypertext->links[i].text, stringBytes, (sizeof(hypertext->links[i].text) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ if (length >= (sizeof(hypertext->links[i].text) / sizeof(wchar_t))) {
++ length = (sizeof(hypertext->links[i].text) / sizeof(wchar_t)) - 2;
++ }
++ hypertext->links[i].text[length] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to ReleaseStringChars()", FALSE);
++ // jniEnv->CallVoidMethod(accessBridgeObject,
++ // decrementReferenceMethod, js);
++ //EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to CallVoidMethod()", FALSE);
++ PrintDebugString("##### AccessibleHyperlink text = %ls", hypertext->links[i].text );
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" AccessibleHyperlink text is null.");
++ hypertext->links[i].text[0] = (wchar_t) 0;
++ }
++
++ hypertext->links[i].startIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHyperlinkStartIndexMethod,
++ hypertext->links[i].accessibleHyperlink,
++ i);
++ EXCEPTION_CHECK("##### Getting hyperlink start index - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### hyperlink start index = %d", hypertext->links[i].startIndex);
++
++
++ hypertext->links[i].endIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHyperlinkEndIndexMethod,
++ hypertext->links[i].accessibleHyperlink,
++ i);
++ EXCEPTION_CHECK("##### Getting hyperlink end index - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### hyperlink end index = %d", hypertext->links[i].endIndex);
++
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleHypertext succeeded");
++ return TRUE;
++}
++
++/*
++ * Activates an AccessibleHyperlink
++ */
++BOOL
++AccessBridgeJavaEntryPoints::activateAccessibleHyperlink(jobject accessibleContext,
++ jobject accessibleHyperlink) {
++
++ jthrowable exception;
++ BOOL returnVal;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::activateAccessibleHyperlink(%p, %p):",
++ accessibleContext, accessibleHyperlink);
++
++ if (activateAccessibleHyperlinkMethod != (jmethodID) 0) {
++ returnVal = (BOOL) jniEnv->CallBooleanMethod(accessBridgeObject, activateAccessibleHyperlinkMethod,
++ accessibleContext, accessibleHyperlink);
++ EXCEPTION_CHECK("activateAccessibleHyperlink - call to CallBooleanMethod()", FALSE);
++ return returnVal;
++ } else {
++ PrintDebugString("\r\n Error! either jniEnv == 0 or activateAccessibleHyperlinkMethod == 0");
++ return FALSE;
++ }
++}
++
++
++/*
++ * This method is used to iterate through the hyperlinks in a component. It
++ * returns hypertext information for a component starting at hyperlink index
++ * nStartIndex. No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will
++ * be returned for each call to this method.
++ * returns FALSE on error.
++ */
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleHypertextExt(const jobject accessibleContext,
++ const jint nStartIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertext) {
++
++ jthrowable exception;
++ const wchar_t *stringBytes;
++ jsize length;
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleHypertextExt(%p, %p, startIndex = %d)",
++ accessibleContext, hypertext, nStartIndex);
++
++ // get the AccessibleHypertext
++ jobject ht = jniEnv->CallObjectMethod(accessBridgeObject, getAccessibleHypertextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("##### Getting AccessibleHypertext - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(ht);
++ EXCEPTION_CHECK("##### Getting AccessibleHypertext - call to NewGlobalRef()", FALSE);
++ hypertext->accessibleHypertext = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### AccessibleHypertext = %p", globalRef);
++ if (hypertext->accessibleHypertext == 0) {
++ PrintDebugString(" ##### null AccessibleHypertext; returning FALSE");
++ return FALSE;
++ }
++
++ // get the hyperlink count
++ hypertext->linkCount = jniEnv->CallIntMethod(accessBridgeObject, getAccessibleHyperlinkCountMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("##### Getting hyperlink count - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### hyperlink count = %d", hypertext->linkCount);
++
++ if (nStartIndex >= hypertext->linkCount) {
++ return FALSE;
++ }
++
++ // get the hypertext links
++ // NOTE: To avoid a crash when there are more than MAX_HYPERLINKS (64) links
++ // in the document, test for i < MAX_HYPERLINKS in addition to
++ // i < hypertext->linkCount
++ int bufIndex = 0;
++ for (int i = nStartIndex; (i < hypertext->linkCount) && (i < nStartIndex + MAX_HYPERLINKS); i++) {
++ PrintDebugString(" getting hyperlink %d ...", i);
++
++ // get the hyperlink
++ jobject hl = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleHyperlinkMethod,
++ hypertext->accessibleHypertext,
++ i);
++ EXCEPTION_CHECK("##### Getting AccessibleHyperlink - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(hl);
++ EXCEPTION_CHECK("##### Getting AccessibleHyperlink - call to NewGlobalRef()", FALSE);
++ hypertext->links[bufIndex].accessibleHyperlink = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### AccessibleHyperlink = %p", globalRef);
++
++ // get the hyperlink text
++ jstring js = (jstring)jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleHyperlinkTextMethod,
++ hypertext->links[bufIndex].accessibleHyperlink,
++ i);
++
++ EXCEPTION_CHECK("Getting hyperlink text - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to GetStringChars()", FALSE);
++ wcsncpy(hypertext->links[bufIndex].text, stringBytes,
++ (sizeof(hypertext->links[bufIndex].text) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ if (length >= (sizeof(hypertext->links[bufIndex].text) / sizeof(wchar_t))) {
++ length = (sizeof(hypertext->links[bufIndex].text) / sizeof(wchar_t)) - 2;
++ }
++ hypertext->links[bufIndex].text[length] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to ReleaseStringChars()", FALSE);
++ // jniEnv->CallVoidMethod(accessBridgeObject,
++ // decrementReferenceMethod, js);
++ //EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to CallVoidMethod()", FALSE);
++ PrintDebugString("##### AccessibleHyperlink text = %ls", hypertext->links[bufIndex].text );
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to DeleteLocalRef()", FALSE);
++
++ } else {
++ PrintDebugString(" AccessibleHyperlink text is null.");
++ hypertext->links[bufIndex].text[0] = (wchar_t) 0;
++ }
++
++ hypertext->links[bufIndex].startIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHyperlinkStartIndexMethod,
++ hypertext->links[bufIndex].accessibleHyperlink,
++ i);
++ EXCEPTION_CHECK("##### Getting hyperlink start index - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### hyperlink start index = %d", hypertext->links[bufIndex].startIndex);
++
++ hypertext->links[bufIndex].endIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHyperlinkEndIndexMethod,
++ hypertext->links[bufIndex].accessibleHyperlink,
++ i);
++ EXCEPTION_CHECK("##### Getting hyperlink end index - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### hyperlink end index = %d", hypertext->links[bufIndex].endIndex);
++
++ bufIndex++;
++ }
++
++ PrintDebugString(" ##### AccessBridgeJavaEntryPoints::getAccessibleHypertextExt succeeded");
++ return TRUE;
++}
++
++jint AccessBridgeJavaEntryPoints::getAccessibleHyperlinkCount(const jobject accessibleContext) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleHyperlinkCount(%X)",
++ accessibleContext);
++
++ if (getAccessibleHyperlinkCountMethod == (jmethodID)0) {
++ return -1;
++ }
++
++ // get the hyperlink count
++ jint linkCount = jniEnv->CallIntMethod(accessBridgeObject, getAccessibleHyperlinkCountMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("##### Getting hyperlink count - call to CallIntMethod()", -1);
++ PrintDebugString(" ##### hyperlink count = %d", linkCount);
++
++ return linkCount;
++}
++
++
++jint AccessBridgeJavaEntryPoints::getAccessibleHypertextLinkIndex(const jobject hypertext,
++ const jint nIndex) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleHypertextLinkIndex(%p, index = %d)",
++ hypertext, nIndex);
++
++ if (getAccessibleHypertextLinkIndexMethod == (jmethodID)0) {
++ return -1;
++ }
++
++ // get the hyperlink index
++ jint index = jniEnv->CallIntMethod(accessBridgeObject, getAccessibleHypertextLinkIndexMethod,
++ hypertext, nIndex);
++
++ EXCEPTION_CHECK("##### Getting hyperlink index - call to CallIntMethod()", -1);
++ PrintDebugString(" ##### hyperlink index = %d", index);
++
++ return index;
++}
++
++BOOL AccessBridgeJavaEntryPoints::getAccessibleHyperlink(jobject hypertext,
++ const jint index,
++ /* OUT */ AccessibleHyperlinkInfo *info) {
++
++ jthrowable exception;
++ const wchar_t *stringBytes;
++ jsize length;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleHyperlink(%p, index = %d)",
++ hypertext, index);
++
++
++ // get the hyperlink
++ jobject hl = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleHyperlinkMethod,
++ hypertext,
++ index);
++ EXCEPTION_CHECK("##### Getting AccessibleHyperlink - call to CallObjectMethod()", FALSE);
++ jobject globalRef = jniEnv->NewGlobalRef(hl);
++ EXCEPTION_CHECK("##### Getting AccessibleHyperlink - call to NewGlobalRef()", FALSE);
++ info->accessibleHyperlink = (JOBJECT64)globalRef;
++ PrintDebugString(" ##### AccessibleHyperlink = %p", globalRef);
++
++ // get the hyperlink text
++ jstring js = (jstring)jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleHyperlinkTextMethod,
++ info->accessibleHyperlink,
++ index);
++
++ EXCEPTION_CHECK("Getting hyperlink text - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to GetStringChars()", FALSE);
++ wcsncpy(info->text, stringBytes,
++ (sizeof(info->text) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ if (length >= (sizeof(info->text) / sizeof(wchar_t))) {
++ length = (sizeof(info->text) / sizeof(wchar_t)) - 2;
++ }
++ info->text[length] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to ReleaseStringChars()", FALSE);
++ // jniEnv->CallVoidMethod(accessBridgeObject,
++ // decrementReferenceMethod, js);
++ //EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to CallVoidMethod()", FALSE);
++ PrintDebugString("##### AccessibleHyperlink text = %ls", info->text );
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleHyperlink text - call to DeleteLocalRef()", FALSE);
++
++ } else {
++ PrintDebugString(" AccessibleHyperlink text is null.");
++ info->text[0] = (wchar_t) 0;
++ }
++
++ info->startIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHyperlinkStartIndexMethod,
++ info->accessibleHyperlink,
++ index);
++ EXCEPTION_CHECK("##### Getting hyperlink start index - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### hyperlink start index = %d", info->startIndex);
++
++ info->endIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHyperlinkEndIndexMethod,
++ info->accessibleHyperlink,
++ index);
++ EXCEPTION_CHECK("##### Getting hyperlink end index - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### hyperlink end index = %d", info->endIndex);
++
++ return TRUE;
++}
++
++
++/********** end AccessibleHypertext routines ************************/
++
++// Accessible Keybinding methods
++BOOL AccessBridgeJavaEntryPoints::getAccessibleKeyBindings(jobject accessibleContext,
++ AccessibleKeyBindings *keyBindings) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleKeyBindings(%p, %p)",
++ accessibleContext, keyBindings);
++
++ if (getAccessibleKeyBindingsCountMethod == (jmethodID) 0 ||
++ getAccessibleKeyBindingCharMethod == (jmethodID) 0 ||
++ getAccessibleKeyBindingModifiersMethod == (jmethodID) 0) {
++ return FALSE;
++ }
++
++ // get the key binding count
++ keyBindings->keyBindingsCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleKeyBindingsCountMethod, accessibleContext);
++
++ EXCEPTION_CHECK("##### Getting key bindings count - call to CallIntMethod()", FALSE);
++
++ PrintDebugString(" ##### key bindings count = %d", keyBindings->keyBindingsCount);
++
++ // get the key bindings
++ for (int i = 0; i < keyBindings->keyBindingsCount && i < MAX_KEY_BINDINGS; i++) {
++
++ // get the key binding character
++ keyBindings->keyBindingInfo[i].character = jniEnv->CallCharMethod(accessBridgeObject,
++ getAccessibleKeyBindingCharMethod,
++ accessibleContext,
++ i);
++ EXCEPTION_CHECK("##### Getting key binding character - call to CallCharMethod()", FALSE);
++ PrintDebugString(" ##### key binding character = %c", keyBindings->keyBindingInfo[i].character);
++ PrintDebugString(" ##### key binding character in hex = %hx", keyBindings->keyBindingInfo[i].character);
++
++ // get the key binding modifiers
++ keyBindings->keyBindingInfo[i].modifiers = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleKeyBindingModifiersMethod,
++ accessibleContext,
++ i);
++ EXCEPTION_CHECK("##### Getting key binding modifiers - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### key binding modifiers = %x", keyBindings->keyBindingInfo[i].modifiers);
++ }
++ return FALSE;
++}
++
++// AccessibleIcon methods
++BOOL AccessBridgeJavaEntryPoints::getAccessibleIcons(jobject accessibleContext,
++ AccessibleIcons *icons) {
++
++ jthrowable exception;
++ const wchar_t *stringBytes;
++ jsize length;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleIcons(%p, %p)",
++ accessibleContext, icons);
++
++ if (getAccessibleIconsCountMethod == (jmethodID) 0 ||
++ getAccessibleIconDescriptionMethod == (jmethodID) 0 ||
++ getAccessibleIconHeightMethod == (jmethodID) 0 ||
++ getAccessibleIconWidthMethod == (jmethodID) 0) {
++ PrintDebugString(" ##### missing method(s) !!!");
++ return FALSE;
++ }
++
++
++ // get the icons count
++ icons->iconsCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleIconsCountMethod, accessibleContext);
++
++ EXCEPTION_CHECK("##### Getting icons count - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### icons count = %d", icons->iconsCount);
++
++
++ // get the icons
++ for (int i = 0; i < icons->iconsCount && i < MAX_ICON_INFO; i++) {
++
++ // get the icon description
++ jstring js = (jstring)jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleIconDescriptionMethod,
++ accessibleContext,
++ i);
++
++ EXCEPTION_CHECK("Getting icon description - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleIcon description - call to GetStringChars()", FALSE);
++ wcsncpy(icons->iconInfo[i].description, stringBytes, (sizeof(icons->iconInfo[i].description) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ if (length >= (sizeof(icons->iconInfo[i].description) / sizeof(wchar_t))) {
++ length = (sizeof(icons->iconInfo[i].description) / sizeof(wchar_t)) - 2;
++ }
++ icons->iconInfo[i].description[length] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleIcon description - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleIcon description - call to ReleaseStringChars()", FALSE);
++ // jniEnv->CallVoidMethod(accessBridgeObject,
++ // decrementReferenceMethod, js);
++ //EXCEPTION_CHECK("Getting AccessibleIcon description - call to CallVoidMethod()", FALSE);
++ PrintDebugString("##### AccessibleIcon description = %ls", icons->iconInfo[i].description );
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleIcon description - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" AccessibleIcon description is null.");
++ icons->iconInfo[i].description[0] = (wchar_t) 0;
++ }
++
++
++ // get the icon height
++ icons->iconInfo[i].height = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleIconHeightMethod,
++ accessibleContext,
++ i);
++ EXCEPTION_CHECK("##### Getting icon height - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### icon height = %d", icons->iconInfo[i].height);
++
++ // get the icon width
++ icons->iconInfo[i].width = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleIconWidthMethod,
++ accessibleContext,
++ i);
++ EXCEPTION_CHECK("##### Getting icon width - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### icon width = %d", icons->iconInfo[i].width);
++ }
++ return FALSE;
++}
++
++// AccessibleActionMethods
++BOOL AccessBridgeJavaEntryPoints::getAccessibleActions(jobject accessibleContext,
++ AccessibleActions *actions) {
++
++ jthrowable exception;
++ const wchar_t *stringBytes;
++ jsize length;
++
++ PrintDebugString("\r\n##### AccessBridgeJavaEntryPoints::getAccessibleIcons(%p, %p)",
++ accessibleContext, actions);
++
++ if (getAccessibleActionsCountMethod == (jmethodID) 0 ||
++ getAccessibleActionNameMethod == (jmethodID) 0) {
++ PrintDebugString(" ##### missing method(s) !!!");
++ return FALSE;
++ }
++
++
++ // get the icons count
++ actions->actionsCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleActionsCountMethod,accessibleContext);
++
++ EXCEPTION_CHECK("##### Getting actions count - call to CallIntMethod()", FALSE);
++ PrintDebugString(" ##### key actions count = %d", actions->actionsCount);
++
++
++ // get the actions
++ for (int i = 0; i < actions->actionsCount && i < MAX_ACTION_INFO; i++) {
++
++ // get the action name
++ jstring js = (jstring)jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleActionNameMethod,
++ accessibleContext,
++ i);
++
++ EXCEPTION_CHECK("Getting Action Name - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleAction Name - call to GetStringChars()", FALSE);
++ wcsncpy(actions->actionInfo[i].name , stringBytes, (sizeof(actions->actionInfo[i].name ) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ if (length >= (sizeof(actions->actionInfo[i].name ) / sizeof(wchar_t))) {
++ length = (sizeof(actions->actionInfo[i].name ) / sizeof(wchar_t)) - 2;
++ }
++ actions->actionInfo[i].name [length] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleAction name - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleAction name - call to ReleaseStringChars()", FALSE);
++ // jniEnv->CallVoidMethod(accessBridgeObject,
++ // decrementReferenceMethod, js);
++ //EXCEPTION_CHECK("Getting AccessibleAction name - call to CallVoidMethod()", FALSE);
++ PrintDebugString("##### AccessibleAction name = %ls", actions->actionInfo[i].name );
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleAction name - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" AccessibleAction name is null.");
++ actions->actionInfo[i].name [0] = (wchar_t) 0;
++ }
++ }
++ return FALSE;
++}
++
++BOOL AccessBridgeJavaEntryPoints::doAccessibleActions(jobject accessibleContext,
++ AccessibleActionsToDo *actionsToDo,
++ jint *failure) {
++
++ jthrowable exception;
++ BOOL returnVal;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::doAccessibleActions(%p, #actions %d %s):",
++ accessibleContext,
++ actionsToDo->actionsCount,
++ actionsToDo->actions[0].name);
++
++ if (doAccessibleActionsMethod == (jmethodID) 0) {
++ *failure = 0;
++ return FALSE;
++ }
++
++ PrintDebugString("\r\n doing %d actions ...", actionsToDo->actionsCount);
++ for (int i = 0; i < actionsToDo->actionsCount && i < MAX_ACTIONS_TO_DO; i++) {
++ PrintDebugString("\r doing action %d: %s ...", i, actionsToDo->actions[i].name);
++
++ // create a Java String for the action name
++ wchar_t *actionName = (wchar_t *)actionsToDo->actions[i].name;
++ jstring javaName = jniEnv->NewString(actionName, (jsize)wcslen(actionName));
++ if (javaName == 0) {
++ PrintDebugString("\r NewString failed");
++ *failure = i;
++ return FALSE;
++ }
++
++ returnVal = (BOOL)jniEnv->CallBooleanMethod(accessBridgeObject, doAccessibleActionsMethod,
++ accessibleContext, javaName);
++ jniEnv->DeleteLocalRef(javaName);
++ EXCEPTION_CHECK("doAccessibleActions - call to CallBooleanMethod()", FALSE);
++
++ if (returnVal != TRUE) {
++ PrintDebugString("\r Action %d failed", i);
++ *failure = i;
++ return FALSE;
++ }
++ }
++ *failure = -1;
++ return TRUE;
++}
++
++
++/********** AccessibleText routines ***********************************/
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTextInfo(jobject accessibleContext,
++ AccessibleTextInfo *textInfo,
++ jint x, jint y) {
++ jthrowable exception;
++
++ // Verify the Java VM still exists and AccessibleContext is
++ // an instance of AccessibleText
++ if (verifyAccessibleText(accessibleContext) == FALSE) {
++ return FALSE;
++ }
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleTextInfo(%p, %d, %d):",
++ accessibleContext, x, y);
++
++ // Get the character count
++ if (getAccessibleCharCountFromContextMethod != (jmethodID) 0) {
++ textInfo->charCount = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleCharCountFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleCharCount - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Char count = %d", textInfo->charCount);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleCharCountFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the index of the caret
++ if (getAccessibleCaretPositionFromContextMethod != (jmethodID) 0) {
++ textInfo->caretIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleCaretPositionFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleCaretPosition - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Index at caret = %d", textInfo->caretIndex);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleCaretPositionFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the index at the given point
++ if (getAccessibleIndexAtPointFromContextMethod != (jmethodID) 0) {
++ textInfo->indexAtPoint = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleIndexAtPointFromContextMethod,
++ accessibleContext, x, y);
++ EXCEPTION_CHECK("Getting AccessibleIndexAtPoint - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Index at point = %d", textInfo->indexAtPoint);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleIndexAtPointFromContextMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTextItems(jobject accessibleContext,
++ AccessibleTextItemsInfo *textItems, jint index) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleTextItems(%p):", accessibleContext);
++
++ // Verify the Java VM still exists and AccessibleContext is
++ // an instance of AccessibleText
++ if (verifyAccessibleText(accessibleContext) == FALSE) {
++ return FALSE;
++ }
++
++ // Get the letter at index
++ if (getAccessibleLetterAtIndexFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleLetterAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleLetterAtIndex - call to CallIntMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleLetterAtIndex - call to GetStringChars()", FALSE);
++ textItems->letter = stringBytes[0];
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleLetterAtIndex - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleLetterAtIndex - call to CallVoidMethod()", FALSE);
++ PrintDebugString(" Accessible Text letter = %c", textItems->letter);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleLetterAtIndex - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Text letter is null.");
++ textItems->letter = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleLetterAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++
++ // Get the word at index
++ if (getAccessibleWordAtIndexFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleWordAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleWordAtIndex - call to CallIntMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleWordAtIndex - call to GetStringChars()", FALSE);
++ wcsncpy(textItems->word, stringBytes, (sizeof(textItems->word) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ textItems->word[length < (sizeof(textItems->word) / sizeof(wchar_t)) ?
++ length : (sizeof(textItems->word) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleWordAtIndex - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleWordAtIndex - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleWordAtIndex - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Text word = %ls", textItems->word);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleWordAtIndex - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Text word is null.");
++ textItems->word[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleWordAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the sentence at index
++ if (getAccessibleSentenceAtIndexFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleSentenceAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleSentenceAtIndex - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleSentenceAtIndex - call to GetStringChars()", FALSE);
++ wcsncpy(textItems->sentence, stringBytes, (sizeof(textItems->sentence) / sizeof(wchar_t))-2);
++ length = jniEnv->GetStringLength(js);
++
++ if (length < sizeof(textItems->sentence) / sizeof(wchar_t)) {
++ textItems->sentence[length] = (wchar_t) 0;
++ } else {
++ textItems->sentence[(sizeof(textItems->sentence) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ }
++ EXCEPTION_CHECK("Getting AccessibleSentenceAtIndex - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleSentenceAtIndex - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleSentenceAtIndex - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Text sentence = %ls", textItems->sentence);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleSentenceAtIndex - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Text sentence is null.");
++ textItems->sentence[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleSentenceAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTextSelectionInfo(jobject accessibleContext,
++ AccessibleTextSelectionInfo *selectionInfo) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleTextSelectionInfo(%p):",
++ accessibleContext);
++
++ // Verify the Java VM still exists and AccessibleContext is
++ // an instance of AccessibleText
++ if (verifyAccessibleText(accessibleContext) == FALSE) {
++ return FALSE;
++ }
++
++ // Get the selection start index
++ if (getAccessibleTextSelectionStartFromContextMethod != (jmethodID) 0) {
++ selectionInfo->selectionStartIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTextSelectionStartFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleTextSelectionStart - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Selection start = %d", selectionInfo->selectionStartIndex);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTextSelectionStartFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the selection end index
++ if (getAccessibleTextSelectionEndFromContextMethod != (jmethodID) 0) {
++ selectionInfo->selectionEndIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTextSelectionEndFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleTextSelectionEnd - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Selection end = %d", selectionInfo->selectionEndIndex);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTextSelectionEndFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the selected text
++ if (getAccessibleTextSelectedTextFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTextSelectedTextFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleTextSelectedText - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleTextSelectedText - call to GetStringChars()", FALSE);
++ wcsncpy(selectionInfo->selectedText, stringBytes, (sizeof(selectionInfo->selectedText) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ selectionInfo->selectedText[length < (sizeof(selectionInfo->selectedText) / sizeof(wchar_t)) ?
++ length : (sizeof(selectionInfo->selectedText) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleTextSelectedText - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleTextSelectedText - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleTextSelectedText - call to CallVoidMethod()", FALSE);
++ PrintDebugString(" Accessible's selected text = %s", selectionInfo->selectedText);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleTextSelectedText - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible's selected text is null.");
++ selectionInfo->selectedText[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTextSelectedTextFromContextMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTextAttributes(jobject accessibleContext, jint index, AccessibleTextAttributesInfo *attributes) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jobject AttributeSet;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleTextAttributes(%p):", accessibleContext);
++
++ // Verify the Java VM still exists and AccessibleContext is
++ // an instance of AccessibleText
++ if (verifyAccessibleText(accessibleContext) == FALSE) {
++ return FALSE;
++ }
++
++ if (accessibleContext == (jobject) 0) {
++ PrintDebugString(" passed in AccessibleContext == null! (oops)");
++
++ attributes->bold = FALSE;
++ attributes->italic = FALSE;
++ attributes->underline = FALSE;
++ attributes->strikethrough = FALSE;
++ attributes->superscript = FALSE;
++ attributes->subscript = FALSE;
++ attributes->backgroundColor[0] = (wchar_t) 0;
++ attributes->foregroundColor[0] = (wchar_t) 0;
++ attributes->fontFamily[0] = (wchar_t) 0;
++ attributes->fontSize = -1;
++ attributes->alignment = -1;
++ attributes->bidiLevel = -1;
++ attributes->firstLineIndent = -1;
++ attributes->leftIndent = -1;
++ attributes->rightIndent = -1;
++ attributes->lineSpacing = -1;
++ attributes->spaceAbove = -1;
++ attributes->spaceBelow = -1;
++ attributes->fullAttributesString[0] = (wchar_t) 0;
++
++ return (FALSE);
++ }
++
++ // Get the AttributeSet
++ if (getAccessibleAttributeSetAtIndexFromContextMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting AttributeSet at index...");
++ AttributeSet = jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleAttributeSetAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleAttributeSetAtIndex - call to CallObjectMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleAttributeSetAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // It is legal for the AttributeSet object to be null, in which case we return false!
++ if (AttributeSet == (jobject) 0) {
++ PrintDebugString(" AttributeSet returned at index is null (this is legal! - see AWT in J2SE 1.3");
++
++ attributes->bold = FALSE;
++ attributes->italic = FALSE;
++ attributes->underline = FALSE;
++ attributes->strikethrough = FALSE;
++ attributes->superscript = FALSE;
++ attributes->subscript = FALSE;
++ attributes->backgroundColor[0] = (wchar_t) 0;
++ attributes->foregroundColor[0] = (wchar_t) 0;
++ attributes->fontFamily[0] = (wchar_t) 0;
++ attributes->fontSize = -1;
++ attributes->alignment = -1;
++ attributes->bidiLevel = -1;
++ attributes->firstLineIndent = -1;
++ attributes->leftIndent = -1;
++ attributes->rightIndent = -1;
++ attributes->lineSpacing = -1;
++ attributes->spaceAbove = -1;
++ attributes->spaceBelow = -1;
++ attributes->fullAttributesString[0] = (wchar_t) 0;
++
++ return (FALSE);
++ }
++
++ // Get the bold setting
++ if (getBoldFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting bold from AttributeSet...");
++ attributes->bold = (BOOL) jniEnv->CallBooleanMethod(accessBridgeObject,
++ getBoldFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting BoldFromAttributeSet - call to CallBooleanMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getBoldFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting BoldFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting BoldFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the italic setting
++ if (getItalicFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting italic from AttributeSet...");
++ attributes->italic = (BOOL) jniEnv->CallBooleanMethod(accessBridgeObject,
++ getItalicFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting ItalicFromAttributeSet - call to CallBooleanMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getItalicdFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting ItalicFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting ItalicFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the underline setting
++ if (getUnderlineFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting underline from AttributeSet...");
++ attributes->underline = (BOOL) jniEnv->CallBooleanMethod(accessBridgeObject,
++ getUnderlineFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting UnderlineFromAttributeSet - call to CallBooleanMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getUnderlineFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting UnderlineFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting UnderlineFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the strikethrough setting
++ if (getStrikethroughFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting strikethrough from AttributeSet...");
++ attributes->strikethrough = (BOOL) jniEnv->CallBooleanMethod(accessBridgeObject,
++ getStrikethroughFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting StrikethroughFromAttributeSet - call to CallBooleanMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getStrikethroughFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting StrikethroughFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting StrikethroughFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the superscript setting
++ if (getSuperscriptFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting superscript from AttributeSet...");
++ attributes->superscript = (BOOL) jniEnv->CallBooleanMethod(accessBridgeObject,
++ getSuperscriptFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting SuperscriptFromAttributeSet - call to CallBooleanMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getSuperscripteFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting SuperscriptFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting SuperscriptFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the subscript setting
++ if (getSubscriptFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting subscript from AttributeSet...");
++ attributes->subscript = (BOOL) jniEnv->CallBooleanMethod(accessBridgeObject,
++ getSubscriptFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting SubscriptFromAttributeSet - call to CallBooleanMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getSubscriptFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting SubscriptFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting SubscriptFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the backgroundColor setting
++ if (getBackgroundColorFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting backgroundColor from AttributeSet...");
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getBackgroundColorFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting BackgroundColorFromAttributeSet - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting BackgroundColorFromAttributeSet - call to GetStringChars()", FALSE);
++ wcsncpy(attributes->backgroundColor, stringBytes, (sizeof(attributes->backgroundColor) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ attributes->backgroundColor[length < (sizeof(attributes->backgroundColor) / sizeof(wchar_t)) ?
++ length : (sizeof(attributes->backgroundColor) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting BackgroundColorFromAttributeSet - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting BackgroundColorFromAttributeSet - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting BackgroundColorFromAttributeSet - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" AttributeSet's background color = %ls", attributes->backgroundColor);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting BackgroundColorFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" AttributeSet's background color is null.");
++ attributes->backgroundColor[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getBackgroundColorFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting BackgroundColorFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting BackgroundColorFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the foregroundColor setting
++ if (getForegroundColorFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting foregroundColor from AttributeSet...");
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getForegroundColorFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting ForegroundColorFromAttributeSet - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting ForegroundColorFromAttributeSet - call to GetStringChars()", FALSE);
++ wcsncpy(attributes->foregroundColor, stringBytes, (sizeof(attributes->foregroundColor) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ attributes->foregroundColor[length < (sizeof(attributes->foregroundColor) / sizeof(wchar_t)) ?
++ length : (sizeof(attributes->foregroundColor) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting ForegroundColorFromAttributeSet - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting ForegroundColorFromAttributeSet - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting ForegroundColorFromAttributeSet - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" AttributeSet's foreground color = %ls", attributes->foregroundColor);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting ForegroundColorFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" AttributeSet's foreground color is null.");
++ attributes->foregroundColor[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getForegroundColorFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting ForegroundColorFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting ForegroundColorFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the fontFamily setting
++ if (getFontFamilyFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting fontFamily from AttributeSet...");
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getFontFamilyFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting FontFamilyFromAttributeSet - call to CallObjectMethod()", FALSE);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting FontFamilyFromAttributeSet - call to GetStringChars()", FALSE);
++ wcsncpy(attributes->fontFamily, stringBytes, (sizeof(attributes->fontFamily) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ attributes->fontFamily[length < (sizeof(attributes->fontFamily) / sizeof(wchar_t)) ?
++ length : (sizeof(attributes->fontFamily) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting FontFamilyFromAttributeSet - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting FontFamilyFromAttributeSet - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting FontFamilyFromAttributeSet - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" AttributeSet's fontFamily = %ls", attributes->fontFamily);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting FontFamilyFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" AttributeSet's fontFamily is null.");
++ attributes->backgroundColor[0] = (wchar_t) 0;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getFontFamilyFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting FontFamilyFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting FontFamilyFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the font size
++ if (getFontSizeFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting font size from AttributeSet...");
++ attributes->fontSize = jniEnv->CallIntMethod(accessBridgeObject,
++ getFontSizeFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting FontSizeFromAttributeSet - call to CallIntMethod()", FALSE);
++ PrintDebugString(" AttributeSet's font size = %d", attributes->fontSize);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAlignmentFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting FontSizeFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting FontSizeFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++
++ // Get the alignment setting
++ if (getAlignmentFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting alignment from AttributeSet...");
++ attributes->alignment = jniEnv->CallIntMethod(accessBridgeObject,
++ getAlignmentFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting AlignmentFromAttributeSet - call to CallIntMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAlignmentFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting AlignmentFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting AlignmentFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the bidiLevel setting
++ if (getBidiLevelFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting bidiLevel from AttributeSet...");
++ attributes->bidiLevel = jniEnv->CallIntMethod(accessBridgeObject,
++ getBidiLevelFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting BidiLevelFromAttributeSet - call to CallIntMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getBidiLevelFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting BidiLevelFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting BidiLevelFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the firstLineIndent setting
++ if (getFirstLineIndentFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting firstLineIndent from AttributeSet...");
++ attributes->firstLineIndent = (jfloat) jniEnv->CallFloatMethod(accessBridgeObject,
++ getFirstLineIndentFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting FirstLineIndentFromAttributeSet - call to CallIntMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getFirstLineIndentFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting FirstLineIndentFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting FirstLineIndentFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the leftIndent setting
++ if (getLeftIndentFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting leftIndent from AttributeSet...");
++ attributes->leftIndent = (jfloat) jniEnv->CallFloatMethod(accessBridgeObject,
++ getLeftIndentFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting LeftIndentFromAttributeSet - call to CallIntMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getLeftIndentFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting LeftIndentFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting LeftIndentFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the rightIndent setting
++ if (getRightIndentFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting rightIndent from AttributeSet...");
++ attributes->rightIndent = (jfloat) jniEnv->CallFloatMethod(accessBridgeObject,
++ getRightIndentFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting RightIndentFromAttributeSet - call to CallIntMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getRightIndentFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting RightIndentFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting RightIndentFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the lineSpacing setting
++ if (getLineSpacingFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting lineSpacing from AttributeSet...");
++ attributes->lineSpacing = (jfloat) jniEnv->CallFloatMethod(accessBridgeObject,
++ getLineSpacingFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting LineSpacingFromAttributeSet - call to CallIntMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getLineSpacingFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting LineSpacingFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting LineSpacingFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the spaceAbove setting
++ if (getSpaceAboveFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting spaceAbove from AttributeSet...");
++ attributes->spaceAbove = (jfloat) jniEnv->CallFloatMethod(accessBridgeObject,
++ getSpaceAboveFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting SpaceAboveFromAttributeSet - call to CallIntMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getSpaceAboveFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting SpaceAboveFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting SpaceAboveFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the spaceBelow setting
++ if (getSpaceBelowFromAttributeSetMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting spaceBelow from AttributeSet...");
++ attributes->spaceBelow = (jfloat) jniEnv->CallFloatMethod(accessBridgeObject,
++ getSpaceBelowFromAttributeSetMethod,
++ AttributeSet);
++ EXCEPTION_CHECK("Getting SpaceBelowFromAttributeSet - call to CallIntMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getSpaceBelowFromAttributeSetMethod == 0");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Getting SpaceBelowFromAttributeSet - call to CallVoidMethod()", FALSE);
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting SpaceBelowFromAttributeSet - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Release the AttributeSet object
++ if (decrementReferenceMethod != (jmethodID) 0) {
++ PrintDebugString(" Decrementing reference to AttributeSet...");
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, AttributeSet);
++ EXCEPTION_CHECK("Releasing AttributeSet object - call to CallVoidMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or accessBridgeObject == 0");
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Releasing AttributeSet object - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++
++ // Get the full attributes string at index
++ if (getAccessibleAttributesAtIndexFromContextMethod != (jmethodID) 0) {
++ PrintDebugString(" Getting full attributes string from Context...");
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleAttributesAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to GetStringChars()", FALSE);
++ wcsncpy(attributes->fullAttributesString, stringBytes, (sizeof(attributes->fullAttributesString) / sizeof(wchar_t)));
++ length = jniEnv->GetStringLength(js);
++ attributes->fullAttributesString[length < (sizeof(attributes->fullAttributesString) / sizeof(wchar_t)) ?
++ length : (sizeof(attributes->fullAttributesString) / sizeof(wchar_t))-2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Text attributes = %ls", attributes->fullAttributesString);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" Accessible Text attributes is null.");
++ attributes->fullAttributesString[0] = (wchar_t) 0;
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting AccessibleAttributesAtIndex - call to DeleteLocalRef()", FALSE);
++ return FALSE;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleAttributesAtIndexFromContextMethod == 0");
++ jniEnv->DeleteLocalRef(AttributeSet);
++ return FALSE;
++ }
++
++ jniEnv->DeleteLocalRef(AttributeSet);
++ EXCEPTION_CHECK("Getting AccessibleAttributeSetAtIndex - call to DeleteLocalRef()", FALSE);
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTextRect(jobject accessibleContext, AccessibleTextRectInfo *rectInfo, jint index) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleTextRect(%p), index = %d",
++ accessibleContext, index);
++
++ // Verify the Java VM still exists and AccessibleContext is
++ // an instance of AccessibleText
++ if (verifyAccessibleText(accessibleContext) == FALSE) {
++ return FALSE;
++ }
++
++ // Get the x coord
++ if (getAccessibleXcoordTextRectAtIndexFromContextMethod != (jmethodID) 0) {
++ rectInfo->x = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleXcoordTextRectAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleXcoordTextRect - call to CallIntMethod()", FALSE);
++ PrintDebugString(" X coord = %d", rectInfo->x);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleXcoordTextRectAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the y coord
++ if (getAccessibleYcoordTextRectAtIndexFromContextMethod != (jmethodID) 0) {
++ rectInfo->y = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleYcoordTextRectAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleYcoordTextRect - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Y coord = %d", rectInfo->y);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleYcoordTextRectAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the width
++ if (getAccessibleWidthTextRectAtIndexFromContextMethod != (jmethodID) 0) {
++ rectInfo->width = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleWidthTextRectAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleWidthTextRect - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Width = %d", rectInfo->width);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleWidthTextRectAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the height
++ if (getAccessibleHeightTextRectAtIndexFromContextMethod != (jmethodID) 0) {
++ rectInfo->height = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleHeightTextRectAtIndexFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleHeightTextRect - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Height = %d", rectInfo->height);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleHeightTextRectAtIndexFromContextMethod == 0");
++ return FALSE;
++ }
++
++ return TRUE;
++}
++
++// =====
++
++/**
++ * gets the bounding rectangle for the text caret
++ */
++BOOL
++AccessBridgeJavaEntryPoints::getCaretLocation(jobject accessibleContext, AccessibleTextRectInfo *rectInfo, jint index) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getCaretLocation(%p), index = %d",
++ accessibleContext, index);
++
++ // Verify the Java VM still exists and AccessibleContext is
++ // an instance of AccessibleText
++ if (verifyAccessibleText(accessibleContext) == FALSE) {
++ return FALSE;
++ }
++
++ // Get the x coord
++ if (getCaretLocationXMethod != (jmethodID) 0) {
++ rectInfo->x = jniEnv->CallIntMethod(accessBridgeObject,
++ getCaretLocationXMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting caret X coordinate - call to CallIntMethod()", FALSE);
++ PrintDebugString(" X coord = %d", rectInfo->x);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getCaretLocationXMethod == 0");
++ return FALSE;
++ }
++
++ // Get the y coord
++ if (getCaretLocationYMethod != (jmethodID) 0) {
++ rectInfo->y = jniEnv->CallIntMethod(accessBridgeObject,
++ getCaretLocationYMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting caret Y coordinate - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Y coord = %d", rectInfo->y);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getCaretLocationYMethod == 0");
++ return FALSE;
++ }
++
++ // Get the width
++ if (getCaretLocationWidthMethod != (jmethodID) 0) {
++ rectInfo->width = jniEnv->CallIntMethod(accessBridgeObject,
++ getCaretLocationWidthMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting caret width - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Width = %d", rectInfo->width);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getCaretLocationWidthMethod == 0");
++ return FALSE;
++ }
++
++ // Get the height
++ if (getCaretLocationHeightMethod != (jmethodID) 0) {
++ rectInfo->height = jniEnv->CallIntMethod(accessBridgeObject,
++ getCaretLocationHeightMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting caret height - call to CallIntMethod()", FALSE);
++ PrintDebugString(" Height = %d", rectInfo->height);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getCaretLocationHeightMethod == 0");
++ return FALSE;
++ }
++
++ return TRUE;
++}
++
++// =====
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTextLineBounds(jobject accessibleContext, jint index, jint *startIndex, jint *endIndex) {
++
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleTextLineBounds(%p):", accessibleContext);
++
++ // Verify the Java VM still exists and AccessibleContext is
++ // an instance of AccessibleText
++ if (verifyAccessibleText(accessibleContext) == FALSE) {
++ return FALSE;
++ }
++
++ // Get the index of the left boundary of the line containing 'index'
++ if (getAccessibleTextLineLeftBoundsFromContextMethod != (jmethodID) 0) {
++ *startIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTextLineLeftBoundsFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleTextLineLeftBounds - call to CallIntMethod()", FALSE);
++ PrintDebugString(" startIndex = %d", *startIndex);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTextLineLeftBoundsFromContextMethod == 0");
++ return FALSE;
++ }
++
++ // Get the index of the right boundary of the line containing 'index'
++ if (getAccessibleTextLineRightBoundsFromContextMethod != (jmethodID) 0) {
++ *endIndex = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleTextLineRightBoundsFromContextMethod,
++ accessibleContext, index);
++ EXCEPTION_CHECK("Getting AccessibleTextLineRightBounds - call to CallIntMethod()", FALSE);
++ PrintDebugString(" endIndex = %d", *endIndex);
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTextLineRightBoundsFromContextMethod == 0");
++ return FALSE;
++ }
++
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getAccessibleTextRange(jobject accessibleContext,
++ jint start, jint end, wchar_t *text, short len) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleTextRange(%p, %d, %d, *text, %d):", accessibleContext, start, end, len);
++
++ // Verify the Java VM still exists and AccessibleContext is
++ // an instance of AccessibleText
++ if (verifyAccessibleText(accessibleContext) == FALSE) {
++ return FALSE;
++ }
++
++ // range is inclusive
++ if (end < start) {
++ PrintDebugString(" Error! end < start!");
++ text[0] = (wchar_t) 0;
++ return FALSE;
++ }
++
++ // Get the text range within [start, end] inclusive
++ if (getAccessibleTextRangeFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getAccessibleTextRangeFromContextMethod,
++ accessibleContext, start, end);
++ EXCEPTION_CHECK("Getting AccessibleTextRange - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting AccessibleTextRange - call to GetStringChars()", FALSE);
++ wPrintDebugString(L" Accessible Text stringBytes returned from Java = %ls", stringBytes);
++ wcsncpy(text, stringBytes, len);
++ length = jniEnv->GetStringLength(js);
++ PrintDebugString(" Accessible Text stringBytes length = %d", length);
++ text[length < len ? length : len - 2] = (wchar_t) 0;
++ wPrintDebugString(L" Accessible Text 'text' after null termination = %ls", text);
++ EXCEPTION_CHECK("Getting AccessibleTextRange - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting AccessibleTextRange - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting AccessibleTextRange - call to CallVoidMethod()", FALSE);
++ wPrintDebugString(L" Accessible Text range = %ls", text);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting AccessibleTextRange - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" current Accessible Text range is null.");
++ text[0] = (wchar_t) 0;
++ return FALSE;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleTextRangeFromContextMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++/********** AccessibleValue routines ***************/
++
++BOOL
++AccessBridgeJavaEntryPoints::getCurrentAccessibleValueFromContext(jobject accessibleContext, wchar_t *value, short len) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getCurrentAccessibleValueFromContext(%p):", accessibleContext);
++
++ // Get the current Accessible Value
++ if (getCurrentAccessibleValueFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getCurrentAccessibleValueFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting CurrentAccessibleValue - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting CurrentAccessibleValue - call to GetStringChars()", FALSE);
++ wcsncpy(value, stringBytes, len);
++ length = jniEnv->GetStringLength(js);
++ value[length < len ? length : len - 2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting CurrentAccessibleValue - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting CurrentAccessibleValue - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting CurrentAccessibleValue - call to CallVoidMethod()", FALSE);
++ PrintDebugString(" current Accessible Value = %s", value);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting CurrentAccessibleValue - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" current Accessible Value is null.");
++ value[0] = (wchar_t) 0;
++ return FALSE;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getCurrentAccessibleValueFromContextMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getMaximumAccessibleValueFromContext(jobject accessibleContext, wchar_t *value, short len) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getMaximumAccessibleValueFromContext(%p):", accessibleContext);
++
++ // Get the maximum Accessible Value
++ if (getMaximumAccessibleValueFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getMaximumAccessibleValueFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting MaximumAccessibleValue - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting MaximumAccessibleValue - call to GetStringChars()", FALSE);
++ wcsncpy(value, stringBytes, len);
++ length = jniEnv->GetStringLength(js);
++ value[length < len ? length : len - 2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting MaximumAccessibleValue - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting MaximumAccessibleValue - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting MaximumAccessibleValue - call to CallVoidMethod()", FALSE);
++ PrintDebugString(" maximum Accessible Value = %s", value);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting MaximumAccessibleValue - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" maximum Accessible Value is null.");
++ value[0] = (wchar_t) 0;
++ return FALSE;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getMaximumAccessibleValueFromContextMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::getMinimumAccessibleValueFromContext(jobject accessibleContext, wchar_t *value, short len) {
++ jstring js;
++ const wchar_t *stringBytes;
++ jthrowable exception;
++ jsize length;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getMinimumAccessibleValueFromContext(%p):", accessibleContext);
++
++ // Get the mimimum Accessible Value
++ if (getMinimumAccessibleValueFromContextMethod != (jmethodID) 0) {
++ js = (jstring) jniEnv->CallObjectMethod(accessBridgeObject,
++ getMinimumAccessibleValueFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting MinimumAccessibleValue - call to CallObjectMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod(), js = %p", js);
++ if (js != (jstring) 0) {
++ stringBytes = (const wchar_t *) jniEnv->GetStringChars(js, 0);
++ EXCEPTION_CHECK("Getting MinimumAccessibleValue - call to GetStringChars()", FALSE);
++ wcsncpy(value, stringBytes, len);
++ length = jniEnv->GetStringLength(js);
++ value[length < len ? length : len - 2] = (wchar_t) 0;
++ EXCEPTION_CHECK("Getting MinimumAccessibleValue - call to GetStringLength()", FALSE);
++ jniEnv->ReleaseStringChars(js, stringBytes);
++ EXCEPTION_CHECK("Getting MinimumAccessibleValue - call to ReleaseStringChars()", FALSE);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ decrementReferenceMethod, js);
++ EXCEPTION_CHECK("Getting MinimumAccessibleValue - call to CallVoidMethod()", FALSE);
++ PrintDebugString(" mimimum Accessible Value = %s", value);
++ jniEnv->DeleteLocalRef(js);
++ EXCEPTION_CHECK("Getting MinimumAccessibleValue - call to DeleteLocalRef()", FALSE);
++ } else {
++ PrintDebugString(" mimimum Accessible Value is null.");
++ value[0] = (wchar_t) 0;
++ return FALSE;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or getMinimumAccessibleValueFromContextMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++
++/********** AccessibleSelection routines ***************/
++
++void
++AccessBridgeJavaEntryPoints::addAccessibleSelectionFromContext(jobject accessibleContext, int i) {
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::addAccessibleSelectionFromContext(%p):", accessibleContext);
++
++ // Add the child to the AccessibleSelection
++ if (addAccessibleSelectionFromContextMethod != (jmethodID) 0) {
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ addAccessibleSelectionFromContextMethod,
++ accessibleContext, i);
++ EXCEPTION_CHECK_VOID("Doing addAccessibleSelection - call to CallVoidMethod()");
++ PrintDebugString(" returned from CallObjectMethod()");
++ } else {
++ PrintDebugString(" Error! either env == 0 or addAccessibleSelectionFromContextMethod == 0");
++ }
++}
++
++void
++AccessBridgeJavaEntryPoints::clearAccessibleSelectionFromContext(jobject accessibleContext) {
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::clearAccessibleSelectionFromContext(%p):", accessibleContext);
++
++ // Clearing the Selection of the AccessibleSelection
++ if (clearAccessibleSelectionFromContextMethod != (jmethodID) 0) {
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ clearAccessibleSelectionFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK_VOID("Doing clearAccessibleSelection - call to CallVoidMethod()");
++ PrintDebugString(" returned from CallObjectMethod()");
++ } else {
++ PrintDebugString(" Error! either env == 0 or clearAccessibleSelectionFromContextMethod == 0");
++ }
++}
++
++jobject
++AccessBridgeJavaEntryPoints::getAccessibleSelectionFromContext(jobject accessibleContext, int i) {
++ jobject returnedAccessibleContext;
++ jobject globalRef;
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleSelectionFromContext(%p):", accessibleContext);
++
++ if (getAccessibleSelectionContextFromContextMethod != (jmethodID) 0) {
++ returnedAccessibleContext = jniEnv->CallObjectMethod(
++ accessBridgeObject,
++ getAccessibleSelectionContextFromContextMethod,
++ accessibleContext, i);
++ EXCEPTION_CHECK("Getting AccessibleSelectionContext - call to CallObjectMethod()", (jobject) 0);
++ globalRef = jniEnv->NewGlobalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleSelectionContext - call to NewGlobalRef()", (jobject) 0);
++ jniEnv->DeleteLocalRef(returnedAccessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleSelectionContext - call to DeleteLocalRef()", (jobject) 0);
++ PrintDebugString(" Returning - returnedAccessibleContext = %p; globalRef = %p",
++ returnedAccessibleContext, globalRef);
++ return globalRef;
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleSelectionContextFromContextMethod == 0");
++ return (jobject) 0;
++ }
++}
++
++int
++AccessBridgeJavaEntryPoints::getAccessibleSelectionCountFromContext(jobject accessibleContext) {
++ int count;
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::getAccessibleSelectionCountFromContext(%p):", accessibleContext);
++
++ // Get (& return) the # of items selected in the AccessibleSelection
++ if (getAccessibleSelectionCountFromContextMethod != (jmethodID) 0) {
++ count = jniEnv->CallIntMethod(accessBridgeObject,
++ getAccessibleSelectionCountFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK("Getting AccessibleSelectionCount - call to CallIntMethod()", -1);
++ PrintDebugString(" returned from CallObjectMethod()");
++ return count;
++ } else {
++ PrintDebugString(" Error! either env == 0 or getAccessibleSelectionCountFromContextMethod == 0");
++ return -1;
++ }
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::isAccessibleChildSelectedFromContext(jobject accessibleContext, int i) {
++ jboolean result;
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::isAccessibleChildSelectedFromContext(%p):", accessibleContext);
++
++ // Get (& return) the # of items selected in the AccessibleSelection
++ if (isAccessibleChildSelectedFromContextMethod != (jmethodID) 0) {
++ result = jniEnv->CallBooleanMethod(accessBridgeObject,
++ isAccessibleChildSelectedFromContextMethod,
++ accessibleContext, i);
++ EXCEPTION_CHECK("Doing isAccessibleChildSelected - call to CallBooleanMethod()", FALSE);
++ PrintDebugString(" returned from CallObjectMethod()");
++ if (result != 0) {
++ return TRUE;
++ }
++ } else {
++ PrintDebugString(" Error! either env == 0 or isAccessibleChildSelectedFromContextMethod == 0");
++ }
++ return FALSE;
++}
++
++
++void
++AccessBridgeJavaEntryPoints::removeAccessibleSelectionFromContext(jobject accessibleContext, int i) {
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::removeAccessibleSelectionFromContext(%p):", accessibleContext);
++
++ // Remove the i-th child from the AccessibleSelection
++ if (removeAccessibleSelectionFromContextMethod != (jmethodID) 0) {
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ removeAccessibleSelectionFromContextMethod,
++ accessibleContext, i);
++ EXCEPTION_CHECK_VOID("Doing removeAccessibleSelection - call to CallVoidMethod()");
++ PrintDebugString(" returned from CallObjectMethod()");
++ } else {
++ PrintDebugString(" Error! either env == 0 or removeAccessibleSelectionFromContextMethod == 0");
++ }
++}
++
++void
++AccessBridgeJavaEntryPoints::selectAllAccessibleSelectionFromContext(jobject accessibleContext) {
++ jthrowable exception;
++
++ PrintDebugString("\r\nCalling AccessBridgeJavaEntryPoints::selectAllAccessibleSelectionFromContext(%p):", accessibleContext);
++
++ // Select all children (if possible) of the AccessibleSelection
++ if (selectAllAccessibleSelectionFromContextMethod != (jmethodID) 0) {
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ selectAllAccessibleSelectionFromContextMethod,
++ accessibleContext);
++ EXCEPTION_CHECK_VOID("Doing selectAllAccessibleSelection - call to CallVoidMethod()");
++ PrintDebugString(" returned from CallObjectMethod()");
++ } else {
++ PrintDebugString(" Error! either env == 0 or selectAllAccessibleSelectionFromContextMethod == 0");
++ }
++}
++
++
++/********** Event Notification Registration routines ***************/
++
++BOOL
++AccessBridgeJavaEntryPoints::addJavaEventNotification(jlong type) {
++ jthrowable exception;
++
++ PrintDebugString("\r\n in AccessBridgeJavaEntryPoints::addJavaEventNotification(%016I64X);", type);
++
++ // Let AccessBridge know we want to add an event type
++ if (addJavaEventNotificationMethod != (jmethodID) 0) {
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ addJavaEventNotificationMethod, type);
++ EXCEPTION_CHECK("Doing addJavaEventNotification - call to CallVoidMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or addJavaEventNotificationMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::removeJavaEventNotification(jlong type) {
++ jthrowable exception;
++
++ PrintDebugString("\r\n in AccessBridgeJavaEntryPoints::removeJavaEventNotification(%016I64X):", type);
++
++ // Let AccessBridge know we want to remove an event type
++ if (removeJavaEventNotificationMethod != (jmethodID) 0) {
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ removeJavaEventNotificationMethod, type);
++ EXCEPTION_CHECK("Doing removeJavaEventNotification - call to CallVoidMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or removeJavaEventNotificationMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::addAccessibilityEventNotification(jlong type) {
++ jthrowable exception;
++
++ PrintDebugString("\r\n in AccessBridgeJavaEntryPoints::addAccessibilityEventNotification(%016I64X);", type);
++
++ // Let AccessBridge know we want to add an event type
++ if (addAccessibilityEventNotificationMethod != (jmethodID) 0) {
++ PrintDebugString("\r\n addAccessibilityEventNotification: calling void method: accessBridgeObject = %p", accessBridgeObject);
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ addAccessibilityEventNotificationMethod, type);
++ EXCEPTION_CHECK("Doing addAccessibilityEvent - call to CallVoidMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or addAccessibilityEventNotificationMethod == 0");
++ return FALSE;
++ }
++ PrintDebugString("\r\n addAccessibilityEventNotification: just returning true");
++ return TRUE;
++}
++
++BOOL
++AccessBridgeJavaEntryPoints::removeAccessibilityEventNotification(jlong type) {
++ jthrowable exception;
++
++ PrintDebugString("\r\n in AccessBridgeJavaEntryPoints::removeAccessibilityEventNotification(%016I64X):", type);
++
++ // Let AccessBridge know we want to remove an event type
++ if (removeAccessibilityEventNotificationMethod != (jmethodID) 0) {
++ jniEnv->CallVoidMethod(accessBridgeObject,
++ removeAccessibilityEventNotificationMethod, type);
++ EXCEPTION_CHECK("Doing removeAccessibilityEvent - call to CallVoidMethod()", FALSE);
++ } else {
++ PrintDebugString(" Error! either env == 0 or removeAccessibilityEventNotificationMethod == 0");
++ return FALSE;
++ }
++ return TRUE;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeJavaEntryPoints.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,419 @@
++/*
++ * 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. 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.
++ */
++
++/*
++ * A class to manage JNI calls into AccessBridge.java
++ */
++
++#include "AccessBridgePackages.h"
++
++#include <windows.h>
++#include <jni.h>
++
++#ifndef __AccessBridgeJavaEntryPoints_H__
++#define __AccessBridgeJavaEntryPoints_H__
++
++class AccessBridgeJavaEntryPoints {
++ JNIEnv *jniEnv;
++
++ jobject accessBridgeObject;
++
++ jclass bridgeClass;
++ jclass eventHandlerClass;
++
++ jmethodID decrementReferenceMethod;
++ jmethodID getJavaVersionPropertyMethod;
++ jmethodID getAccessBridgeVersionMethod;
++
++ jmethodID isJavaWindowMethod;
++ jmethodID isSameObjectMethod;
++ jmethodID getAccessibleContextFromHWNDMethod;
++ jmethodID getHWNDFromAccessibleContextMethod;
++
++ jmethodID getAccessibleContextAtMethod;
++ jmethodID getAccessibleContextWithFocusMethod;
++
++ jmethodID getAccessibleNameFromContextMethod;
++ jmethodID getAccessibleDescriptionFromContextMethod;
++ jmethodID getAccessibleRoleStringFromContextMethod;
++ jmethodID getAccessibleRoleStringFromContext_en_USMethod;
++ jmethodID getAccessibleStatesStringFromContextMethod;
++ jmethodID getAccessibleStatesStringFromContext_en_USMethod;
++ jmethodID getAccessibleParentFromContextMethod;
++ jmethodID getAccessibleIndexInParentFromContextMethod;
++ jmethodID getAccessibleChildrenCountFromContextMethod;
++ jmethodID getAccessibleChildFromContextMethod;
++ jmethodID getAccessibleBoundsOnScreenFromContextMethod;
++ jmethodID getAccessibleXcoordFromContextMethod;
++ jmethodID getAccessibleYcoordFromContextMethod;
++ jmethodID getAccessibleHeightFromContextMethod;
++ jmethodID getAccessibleWidthFromContextMethod;
++
++ jmethodID getAccessibleComponentFromContextMethod;
++ jmethodID getAccessibleActionFromContextMethod;
++ jmethodID getAccessibleSelectionFromContextMethod;
++ jmethodID getAccessibleTextFromContextMethod;
++ jmethodID getAccessibleValueFromContextMethod;
++
++ /* begin AccessibleTable */
++ jmethodID getAccessibleTableFromContextMethod;
++ jmethodID getAccessibleTableRowHeaderMethod;
++ jmethodID getAccessibleTableColumnHeaderMethod;
++ jmethodID getAccessibleTableRowCountMethod;
++ jmethodID getAccessibleTableColumnCountMethod;
++ jmethodID getAccessibleTableCaptionMethod;
++ jmethodID getAccessibleTableSummaryMethod;
++
++ jmethodID getContextFromAccessibleTableMethod;
++ jmethodID getAccessibleTableCellAccessibleContextMethod;
++ jmethodID getAccessibleTableCellIndexMethod;
++ jmethodID getAccessibleTableCellRowExtentMethod;
++ jmethodID getAccessibleTableCellColumnExtentMethod;
++ jmethodID isAccessibleTableCellSelectedMethod;
++
++ jmethodID getAccessibleTableRowHeaderRowCountMethod;
++ jmethodID getAccessibleTableColumnHeaderRowCountMethod;
++
++ jmethodID getAccessibleTableRowHeaderColumnCountMethod;
++ jmethodID getAccessibleTableColumnHeaderColumnCountMethod;
++
++ jmethodID getAccessibleTableRowDescriptionMethod;
++ jmethodID getAccessibleTableColumnDescriptionMethod;
++
++ jmethodID getAccessibleTableRowSelectionCountMethod;
++ jmethodID isAccessibleTableRowSelectedMethod;
++ jmethodID getAccessibleTableRowSelectionsMethod;
++
++ jmethodID getAccessibleTableColumnSelectionCountMethod;
++ jmethodID isAccessibleTableColumnSelectedMethod;
++ jmethodID getAccessibleTableColumnSelectionsMethod;
++
++ jmethodID getAccessibleTableRowMethod;
++ jmethodID getAccessibleTableColumnMethod;
++ jmethodID getAccessibleTableIndexMethod;
++
++ /* end AccessibleTable */
++
++ /* begin AccessibleRelationSet */
++
++ jmethodID getAccessibleRelationSetMethod;
++ jmethodID getAccessibleRelationCountMethod;
++ jmethodID getAccessibleRelationKeyMethod;
++ jmethodID getAccessibleRelationTargetCountMethod;
++ jmethodID getAccessibleRelationTargetMethod;
++
++ /* end AccessibleRelationSet */
++
++ // AccessibleHypertext methods
++ jmethodID getAccessibleHypertextMethod;
++ jmethodID getAccessibleHyperlinkCountMethod;
++ jmethodID getAccessibleHyperlinkTextMethod;
++ jmethodID getAccessibleHyperlinkURLMethod;
++ jmethodID getAccessibleHyperlinkStartIndexMethod;
++ jmethodID getAccessibleHyperlinkEndIndexMethod;
++ jmethodID getAccessibleHypertextLinkIndexMethod;
++ jmethodID getAccessibleHyperlinkMethod;
++ jmethodID activateAccessibleHyperlinkMethod;
++
++ // AccessibleKeyBinding
++ jmethodID getAccessibleKeyBindingsCountMethod;
++ jmethodID getAccessibleKeyBindingCharMethod;
++ jmethodID getAccessibleKeyBindingModifiersMethod;
++
++ // AccessibleIcon
++ jmethodID getAccessibleIconsCountMethod;
++ jmethodID getAccessibleIconDescriptionMethod;
++ jmethodID getAccessibleIconHeightMethod;
++ jmethodID getAccessibleIconWidthMethod;
++
++ // AccessibleAction
++ jmethodID getAccessibleActionsCountMethod;
++ jmethodID getAccessibleActionNameMethod;
++ jmethodID doAccessibleActionsMethod;
++
++ // AccessibleText
++ jmethodID getAccessibleCharCountFromContextMethod;
++ jmethodID getAccessibleCaretPositionFromContextMethod;
++ jmethodID getAccessibleIndexAtPointFromContextMethod;
++
++ jmethodID getAccessibleLetterAtIndexFromContextMethod;
++ jmethodID getAccessibleWordAtIndexFromContextMethod;
++ jmethodID getAccessibleSentenceAtIndexFromContextMethod;
++
++ jmethodID getAccessibleTextSelectionStartFromContextMethod;
++ jmethodID getAccessibleTextSelectionEndFromContextMethod;
++ jmethodID getAccessibleTextSelectedTextFromContextMethod;
++ jmethodID getAccessibleAttributesAtIndexFromContextMethod;
++ jmethodID getAccessibleAttributeSetAtIndexFromContextMethod;
++ jmethodID getAccessibleTextRectAtIndexFromContextMethod;
++ jmethodID getAccessibleXcoordTextRectAtIndexFromContextMethod;
++ jmethodID getAccessibleYcoordTextRectAtIndexFromContextMethod;
++ jmethodID getAccessibleHeightTextRectAtIndexFromContextMethod;
++ jmethodID getAccessibleWidthTextRectAtIndexFromContextMethod;
++ jmethodID getAccessibleTextLineLeftBoundsFromContextMethod;
++ jmethodID getAccessibleTextLineRightBoundsFromContextMethod;
++ jmethodID getAccessibleTextRangeFromContextMethod;
++
++ jmethodID getCurrentAccessibleValueFromContextMethod;
++ jmethodID getMaximumAccessibleValueFromContextMethod;
++ jmethodID getMinimumAccessibleValueFromContextMethod;
++
++ jmethodID addAccessibleSelectionFromContextMethod;
++ jmethodID clearAccessibleSelectionFromContextMethod;
++ jmethodID getAccessibleSelectionContextFromContextMethod;
++ jmethodID getAccessibleSelectionCountFromContextMethod;
++ jmethodID isAccessibleChildSelectedFromContextMethod;
++ jmethodID removeAccessibleSelectionFromContextMethod;
++ jmethodID selectAllAccessibleSelectionFromContextMethod;
++
++ jmethodID addJavaEventNotificationMethod;
++ jmethodID removeJavaEventNotificationMethod;
++ jmethodID addAccessibilityEventNotificationMethod;
++ jmethodID removeAccessibilityEventNotificationMethod;
++
++ jmethodID getBoldFromAttributeSetMethod;
++ jmethodID getItalicFromAttributeSetMethod;
++ jmethodID getUnderlineFromAttributeSetMethod;
++ jmethodID getStrikethroughFromAttributeSetMethod;
++ jmethodID getSuperscriptFromAttributeSetMethod;
++ jmethodID getSubscriptFromAttributeSetMethod;
++ jmethodID getBackgroundColorFromAttributeSetMethod;
++ jmethodID getForegroundColorFromAttributeSetMethod;
++ jmethodID getFontFamilyFromAttributeSetMethod;
++ jmethodID getFontSizeFromAttributeSetMethod;
++ jmethodID getAlignmentFromAttributeSetMethod;
++ jmethodID getBidiLevelFromAttributeSetMethod;
++ jmethodID getFirstLineIndentFromAttributeSetMethod;
++ jmethodID getLeftIndentFromAttributeSetMethod;
++ jmethodID getRightIndentFromAttributeSetMethod;
++ jmethodID getLineSpacingFromAttributeSetMethod;
++ jmethodID getSpaceAboveFromAttributeSetMethod;
++ jmethodID getSpaceBelowFromAttributeSetMethod;
++
++ jmethodID setTextContentsMethod;
++ jmethodID getParentWithRoleMethod;
++ jmethodID getTopLevelObjectMethod;
++ jmethodID getParentWithRoleElseRootMethod;
++ jmethodID getObjectDepthMethod;
++ jmethodID getActiveDescendentMethod;
++
++ /**
++ * Additional methods for Teton
++ */
++ jmethodID getVirtualAccessibleNameFromContextMethod; // Ben Key
++ jmethodID requestFocusMethod;
++ jmethodID selectTextRangeMethod;
++ jmethodID getTextAttributesInRangeMethod;
++ jmethodID getVisibleChildrenCountMethod;
++ jmethodID getVisibleChildMethod;
++ jmethodID setCaretPositionMethod;
++
++ jmethodID getCaretLocationMethod;
++ jmethodID getCaretLocationXMethod;
++ jmethodID getCaretLocationYMethod;
++ jmethodID getCaretLocationHeightMethod;
++ jmethodID getCaretLocationWidthMethod;
++
++public:
++ AccessBridgeJavaEntryPoints(JNIEnv *jniEnvironment, jobject bridgeObject);
++ ~AccessBridgeJavaEntryPoints();
++ BOOL BuildJavaEntryPoints();
++
++ // HWND management methods
++ BOOL isJavaWindow(jint window);
++ jobject getAccessibleContextFromHWND(jint window);
++ HWND getHWNDFromAccessibleContext(jobject accessibleContext);
++
++ // version methods
++ BOOL getVersionInfo(AccessBridgeVersionInfo *info);
++
++ // verification methods
++ BOOL verifyAccessibleText(jobject obj);
++
++ /* ===== utility methods ===== */
++ BOOL isSameObject(jobject obj1, jobject obj2);
++ BOOL setTextContents(const jobject accessibleContext, const wchar_t *text);
++ jobject getParentWithRole (const jobject accessibleContext, const wchar_t *role);
++ jobject getTopLevelObject (const jobject accessibleContext);
++ jobject getParentWithRoleElseRoot (const jobject accessibleContext, const wchar_t *role);
++ jint getObjectDepth (const jobject accessibleContext);
++ jobject getActiveDescendent (const jobject accessibleContext);
++
++ // Accessible Context methods
++ jobject getAccessibleContextAt(jint x, jint y, jobject AccessibleContext);
++ jobject getAccessibleContextWithFocus();
++ BOOL getAccessibleContextInfo(jobject AccessibleContext, AccessibleContextInfo *info);
++ jobject getAccessibleChildFromContext(jobject AccessibleContext, jint childIndex);
++ jobject getAccessibleParentFromContext(jobject AccessibleContext);
++
++ /* begin AccessibleTable methods */
++
++ BOOL getAccessibleTableInfo(jobject acParent, AccessibleTableInfo *tableInfo);
++ BOOL getAccessibleTableCellInfo(jobject accessibleTable,jint row, jint column,
++ AccessibleTableCellInfo *tableCellInfo);
++
++ BOOL getAccessibleTableRowHeader(jobject acParent, AccessibleTableInfo *tableInfo);
++ BOOL getAccessibleTableColumnHeader(jobject acParent, AccessibleTableInfo *tableInfo);
++
++ jobject getAccessibleTableRowDescription(jobject acParent, jint row);
++ jobject getAccessibleTableColumnDescription(jobject acParent, jint column);
++
++ jint getAccessibleTableRowSelectionCount(jobject accessibleTable);
++ BOOL isAccessibleTableRowSelected(jobject accessibleTable, jint row);
++ BOOL getAccessibleTableRowSelections(jobject accessibleTable, jint count, jint *selections);
++
++ jint getAccessibleTableColumnSelectionCount(jobject accessibleTable);
++ BOOL isAccessibleTableColumnSelected(jobject accessibleTable, jint column);
++ BOOL getAccessibleTableColumnSelections(jobject accessibleTable, jint count, jint *selections);
++
++ jint getAccessibleTableRow(jobject accessibleTable, jint index);
++ jint getAccessibleTableColumn(jobject accessibleTable, jint index);
++ jint getAccessibleTableIndex(jobject accessibleTable, jint row, jint column);
++
++ /* end AccessibleTable methods */
++
++ BOOL getAccessibleRelationSet(jobject accessibleContext, AccessibleRelationSetInfo *relationSetInfo);
++
++ // AccessibleHypertext methods
++ BOOL getAccessibleHypertext(jobject accessibleContext, AccessibleHypertextInfo *hyperlink);
++
++ BOOL activateAccessibleHyperlink(jobject accessibleContext, jobject accessibleHyperlink);
++
++ BOOL getAccessibleHypertextExt(const jobject accessibleContext,
++ const jint nStartIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertext);
++ jint getAccessibleHyperlinkCount(const jobject accessibleContext);
++ jint getAccessibleHypertextLinkIndex(const jobject accessibleContext,
++ const jint nIndex);
++ BOOL getAccessibleHyperlink(const jobject accessibleContext,
++ const jint nIndex,
++ /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo);
++
++ // Accessible Keybinding methods
++ BOOL getAccessibleKeyBindings(jobject accessibleContext, AccessibleKeyBindings *keyBindings);
++
++ // AccessibleIcon methods
++ BOOL getAccessibleIcons(jobject accessibleContext, AccessibleIcons *icons);
++
++ // AccessibleActionMethods
++ BOOL getAccessibleActions(jobject accessibleContext, AccessibleActions *actions);
++ BOOL doAccessibleActions(jobject accessibleContext, AccessibleActionsToDo *actionsToDo, jint *failure);
++
++ // Accessible Text methods
++ BOOL getAccessibleTextInfo(jobject AccessibleContext, AccessibleTextInfo *textInfo, jint x, jint y);
++ BOOL getAccessibleTextItems(jobject AccessibleContext, AccessibleTextItemsInfo *textItems, jint index);
++ BOOL getAccessibleTextSelectionInfo(jobject AccessibleContext, AccessibleTextSelectionInfo *selectionInfo);
++ BOOL getAccessibleTextAttributes(jobject AccessibleContext, jint index, AccessibleTextAttributesInfo *attributes);
++ BOOL getAccessibleTextRect(jobject AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);
++ BOOL getAccessibleCaretRect(jobject AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);
++ BOOL getAccessibleTextLineBounds(jobject AccessibleContext, jint index, jint *startIndex, jint *endIndex);
++ BOOL getAccessibleTextRange(jobject AccessibleContext, jint start, jint end, wchar_t *text, short len);
++
++ // Accessible Value methods
++ BOOL getCurrentAccessibleValueFromContext(jobject AccessibleContext, wchar_t *value, short len);
++ BOOL getMaximumAccessibleValueFromContext(jobject AccessibleContext, wchar_t *value, short len);
++ BOOL getMinimumAccessibleValueFromContext(jobject AccessibleContext, wchar_t *value, short len);
++
++ // Accessible Selection methods
++ void addAccessibleSelectionFromContext(jobject AccessibleContext, int i);
++ void clearAccessibleSelectionFromContext(jobject AccessibleContext);
++ jobject getAccessibleSelectionFromContext(jobject AccessibleContext, int i);
++ int getAccessibleSelectionCountFromContext(jobject AccessibleContext);
++ BOOL isAccessibleChildSelectedFromContext(jobject AccessibleContext, int i);
++ void removeAccessibleSelectionFromContext(jobject AccessibleContext, int i);
++ void selectAllAccessibleSelectionFromContext(jobject AccessibleContext);
++
++ // Event handling methods
++ BOOL addJavaEventNotification(jlong type);
++ BOOL removeJavaEventNotification(jlong type);
++ BOOL addAccessibilityEventNotification(jlong type);
++ BOOL removeAccessibilityEventNotification(jlong type);
++
++ /**
++ * Additional methods for Teton
++ */
++
++ /**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
++ * whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++ BOOL getVirtualAccessibleName(const jobject accessibleContext, wchar_t *name, int len);
++
++ /**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++ BOOL requestFocus(const jobject accessibleContext);
++
++ /**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++ BOOL selectTextRange(const jobject accessibleContext, int startIndex, int endIndex);
++
++ /**
++ * Get text attributes between two indices. The attribute list includes the text at the
++ * start index and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++ BOOL getTextAttributesInRange(const jobject accessibleContext, int startIndex, int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len);
++
++ /**
++ * Gets the number of visible children of a component. Returns -1 on error.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ int getVisibleChildrenCount(const jobject accessibleContext);
++
++ /**
++ * Gets the visible children of an AccessibleContext. Returns whether successful;
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ BOOL getVisibleChildren(const jobject accessibleContext, const int startIndex,
++ VisibleChildrenInfo *visibleChildrenInfo);
++
++ /**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++ BOOL setCaretPosition(const jobject accessibleContext, int position);
++
++ /**
++ * Gets the bounding rectangle for the text caret
++ */
++ BOOL getCaretLocation(jobject AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);
++
++};
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeJavaVMInstance.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,358 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * A class to track key JVM instance info from the AT WinAccessBridge
++ */
++
++#include "AccessBridgeDebug.h"
++#include "AccessBridgeJavaVMInstance.h"
++#include "AccessBridgeMessages.h"
++#include "AccessBridgePackages.h"
++#include "accessBridgeResource.h" // for debugging messages
++
++#include <winbase.h>
++#include <jni.h>
++
++// The initialization must only be done one time and to provide for that the initialization
++// is now done in WinAccessBridge and the CRITICAL_SECTION memory has been moved to there.
++// send memory lock
++//CRITICAL_SECTION sendMemoryIPCLock;
++extern CRITICAL_SECTION sendMemoryIPCLock;
++
++// protects the javaVMs chain while in use
++extern bool isVMInstanceChainInUse;
++
++DEBUG_CODE(extern HWND theDialogWindow);
++extern "C" {
++ DEBUG_CODE(void AppendToCallInfo(char *s));
++}
++
++
++/**
++ *
++ *
++ */
++AccessBridgeJavaVMInstance::AccessBridgeJavaVMInstance(HWND ourABWindow,
++ HWND javaABWindow,
++ long javaVMID,
++ AccessBridgeJavaVMInstance *next) {
++ goingAway = FALSE;
++ // This should be called once. Moved to WinAccessBridge c'tor
++ //InitializeCriticalSection(&sendMemoryIPCLock);
++ ourAccessBridgeWindow = ourABWindow;
++ javaAccessBridgeWindow = javaABWindow;
++ vmID = javaVMID;
++ nextJVMInstance = next;
++ memoryMappedFileMapHandle = (HANDLE) 0;
++ memoryMappedView = (char *) 0;
++ sprintf(memoryMappedFileName, "AccessBridge-%p-%p.mmf",
++ ourAccessBridgeWindow, javaAccessBridgeWindow);
++}
++
++/**
++ *
++ *
++ */
++AccessBridgeJavaVMInstance::~AccessBridgeJavaVMInstance() {
++ DEBUG_CODE(char buffer[256]);
++
++ DEBUG_CODE(AppendToCallInfo("***** in AccessBridgeJavaVMInstance::~AccessBridgeJavaVMInstance\r\n"));
++ EnterCriticalSection(&sendMemoryIPCLock);
++
++ // if IPC memory mapped file view is valid, unmap it
++ goingAway = TRUE;
++ if (memoryMappedView != (char *) 0) {
++ DEBUG_CODE(sprintf(buffer, " unmapping memoryMappedView; view = %p\r\n", memoryMappedView));
++ DEBUG_CODE(AppendToCallInfo(buffer));
++ UnmapViewOfFile(memoryMappedView);
++ memoryMappedView = (char *) 0;
++ }
++ // if IPC memory mapped file handle map is open, close it
++ if (memoryMappedFileMapHandle != (HANDLE) 0) {
++ DEBUG_CODE(sprintf(buffer, " closing memoryMappedFileMapHandle; handle = %p\r\n", memoryMappedFileMapHandle));
++ DEBUG_CODE(AppendToCallInfo(buffer));
++ CloseHandle(memoryMappedFileMapHandle);
++ memoryMappedFileMapHandle = (HANDLE) 0;
++ }
++ LeaveCriticalSection(&sendMemoryIPCLock);
++
++}
++
++/**
++ * initiateIPC - sets up the memory-mapped file to do IPC messaging
++ * 1 file is created: to handle requests for information
++ * initiated from Windows AT. The package is placed into
++ * the memory-mapped file (char *memoryMappedView),
++ * and then a special SendMessage() is sent. When the
++ * JavaDLL returns from SendMessage() processing, the
++ * data will be in memoryMappedView. The SendMessage()
++ * return value tells us if all is right with the world.
++ *
++ * The set-up proces involves creating the memory-mapped
++ * file, and handshaking with the JavaDLL so it knows
++ * about it as well.
++ *
++ */
++LRESULT
++AccessBridgeJavaVMInstance::initiateIPC() {
++ DEBUG_CODE(char debugBuf[256]);
++ DWORD errorCode;
++
++ DEBUG_CODE(AppendToCallInfo(" in AccessBridgeJavaVMInstance::initiateIPC()\r\n"));
++
++ // create Windows-initiated IPC file & map it to a ptr
++ memoryMappedFileMapHandle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL,
++ PAGE_READWRITE, 0,
++ // 8 bytes for return code
++ sizeof(WindowsInitiatedPackages) + 8,
++ memoryMappedFileName);
++ if (memoryMappedFileMapHandle == NULL) {
++ errorCode = GetLastError();
++ DEBUG_CODE(sprintf(debugBuf, " Failed to CreateFileMapping for %s, error: %X", memoryMappedFileName, errorCode));
++ DEBUG_CODE(AppendToCallInfo(debugBuf));
++ return errorCode;
++ } else {
++ DEBUG_CODE(sprintf(debugBuf, " CreateFileMapping worked - filename: %s\r\n", memoryMappedFileName));
++ DEBUG_CODE(AppendToCallInfo(debugBuf));
++ }
++
++ memoryMappedView = (char *) MapViewOfFile(memoryMappedFileMapHandle,
++ FILE_MAP_READ | FILE_MAP_WRITE,
++ 0, 0, 0);
++ if (memoryMappedView == NULL) {
++ errorCode = GetLastError();
++ DEBUG_CODE(sprintf(debugBuf, " Failed to MapViewOfFile for %s, error: %X", memoryMappedFileName, errorCode));
++ DEBUG_CODE(AppendToCallInfo(debugBuf));
++ return errorCode;
++ } else {
++ DEBUG_CODE(sprintf(debugBuf, " MapViewOfFile worked - view: %p\r\n", memoryMappedView));
++ DEBUG_CODE(AppendToCallInfo(debugBuf));
++ }
++
++
++ // write some data to the memory mapped file
++ strcpy(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_QUERY);
++
++
++ // inform the JavaDLL that we've a memory mapped file ready for it
++ char buffer[sizeof(PackageType) + sizeof(MemoryMappedFileCreatedPackage)];
++ PackageType *type = (PackageType *) buffer;
++ MemoryMappedFileCreatedPackage *pkg = (MemoryMappedFileCreatedPackage *) (buffer + sizeof(PackageType));
++ *type = cMemoryMappedFileCreatedPackage;
++ pkg->bridgeWindow = ABHandleToLong(ourAccessBridgeWindow);
++ strncpy(pkg->filename, memoryMappedFileName, cMemoryMappedNameSize);
++ sendPackage(buffer, sizeof(buffer));
++
++
++ // look for the JavaDLL's answer to see if it could read the file
++ if (strcmp(memoryMappedView, AB_MEMORY_MAPPED_FILE_OK_ANSWER) != 0) {
++ DEBUG_CODE(sprintf(debugBuf, " JavaVM failed to deal with memory mapped file %s\r\n",
++ memoryMappedFileName));
++ DEBUG_CODE(AppendToCallInfo(debugBuf));
++ return -1;
++ } else {
++ DEBUG_CODE(sprintf(debugBuf, " Success! JavaVM accpeted our file\r\n"));
++ DEBUG_CODE(AppendToCallInfo(debugBuf));
++ }
++
++ return 0;
++}
++
++// -----------------------
++
++/**
++ * sendPackage - uses SendMessage(WM_COPYDATA) to do IPC messaging
++ * with the Java AccessBridge DLL
++ *
++ * NOTE: WM_COPYDATA is only for one-way IPC; there
++ * is now way to return parameters (especially big ones)
++ * Use sendMemoryPackage() to do that!
++ */
++LRESULT
++AccessBridgeJavaVMInstance::sendPackage(char *buffer, long bufsize) {
++ COPYDATASTRUCT toCopy;
++ toCopy.dwData = 0; // 32-bits we could use for something...
++ toCopy.cbData = bufsize;
++ toCopy.lpData = buffer;
++
++ PrintDebugString("In AccessBridgeVMInstance::sendPackage");
++ PrintDebugString(" javaAccessBridgeWindow: %p", javaAccessBridgeWindow);
++ /* This was SendMessage. Normally that is a blocking call. However, if
++ * SendMessage is sent to another process, e.g. another JVM and an incoming
++ * SendMessage is pending, control will be passed to the DialogProc to handle
++ * the incoming message. A bug occurred where this allowed an AB_DLL_GOING_AWAY
++ * message to be processed deleting an AccessBridgeJavaVMInstance object in
++ * the javaVMs chain. SendMessageTimeout with SMTO_BLOCK set will prevent the
++ * calling thread from processing other requests while waiting, i.e control
++ * will not be passed to the DialogProc. Also note that PostMessage or
++ * SendNotifyMessage can't be used. Although they don't allow transfer to
++ * the DialogProc they can't be used in cases where pointers are passed. This
++ * is because the referenced memory needs to be available when the other thread
++ * gets control.
++ */
++ UINT flags = SMTO_BLOCK | SMTO_NOTIMEOUTIFNOTHUNG;
++ DWORD_PTR out; // not used
++ LRESULT lr = SendMessageTimeout( javaAccessBridgeWindow, WM_COPYDATA,
++ (WPARAM)ourAccessBridgeWindow, (LPARAM)&toCopy,
++ flags, 4000, &out );
++ return lr;
++}
++
++
++/**
++ * sendMemoryPackage - uses Memory-Mapped files to do IPC messaging
++ * with the Java AccessBridge DLL, informing the
++ * Java AccessBridge DLL via SendMessage that something
++ * is waiting for it in the shared file...
++ *
++ * In the SendMessage call, the third param (WPARAM) is
++ * the source HWND (ourAccessBridgeWindow in this case),
++ * and the fourth param (LPARAM) is the size in bytes of
++ * the package put into shared memory.
++ *
++ */
++BOOL
++AccessBridgeJavaVMInstance::sendMemoryPackage(char *buffer, long bufsize) {
++
++ // Protect against race condition where the memory mapped file is
++ // deallocated before the memory package is being sent
++ if (goingAway) {
++ return FALSE;
++ }
++ BOOL retval = FALSE;
++
++ DEBUG_CODE(char outputBuf[256]);
++ DEBUG_CODE(sprintf(outputBuf, "AccessBridgeJavaVMInstance::sendMemoryPackage(, %d)", bufsize));
++ DEBUG_CODE(AppendToCallInfo(outputBuf));
++
++ DEBUG_CODE(PackageType *type = (PackageType *) buffer);
++ DEBUG_CODE(if (*type == cGetAccessibleTextRangePackage) {)
++ DEBUG_CODE(AppendToCallInfo(" 'buffer' contains:"));
++ DEBUG_CODE(GetAccessibleTextRangePackage *pkg = (GetAccessibleTextRangePackage *) (buffer + sizeof(PackageType)));
++ DEBUG_CODE(sprintf(outputBuf, " PackageType = %X", *type));
++ DEBUG_CODE(AppendToCallInfo(outputBuf));
++ DEBUG_CODE(sprintf(outputBuf, " GetAccessibleTextRange: start = %d, end = %d, rText = %ls",
++ pkg->start, pkg->end, pkg->rText));
++ DEBUG_CODE(AppendToCallInfo(outputBuf));
++ DEBUG_CODE(})
++
++ EnterCriticalSection(&sendMemoryIPCLock);
++ {
++ // copy the package into shared memory
++ if (!goingAway) {
++ memcpy(memoryMappedView, buffer, bufsize);
++
++ DEBUG_CODE(PackageType *type = (PackageType *) memoryMappedView);
++ DEBUG_CODE(if (*type == cGetAccessibleTextItemsPackage) {)
++ DEBUG_CODE(AppendToCallInfo(" 'memoryMappedView' now contains:"));
++ DEBUG_CODE(GetAccessibleTextItemsPackage *pkg = (GetAccessibleTextItemsPackage *) (buffer + sizeof(PackageType)));
++ DEBUG_CODE(sprintf(outputBuf, " PackageType = %X", *type));
++ DEBUG_CODE(AppendToCallInfo(outputBuf));
++ DEBUG_CODE(})
++ }
++
++ if (!goingAway) {
++ // Let the recipient know there is a package waiting for them. The unset byte
++ // at end of buffer which will only be set if message is properly received
++ char *done = &memoryMappedView[bufsize];
++ *done = 0;
++
++ PrintDebugString(" javaAccessBridgeWindow: %p", javaAccessBridgeWindow);
++ // See the comment above the call to SendMessageTimeout in SendPackage method above.
++ UINT flags = SMTO_BLOCK | SMTO_NOTIMEOUTIFNOTHUNG;
++ DWORD_PTR out; // not used
++ SendMessageTimeout( javaAccessBridgeWindow, AB_MESSAGE_WAITING, (WPARAM)ourAccessBridgeWindow, (LPARAM)bufsize,
++ flags, 4000, &out );
++
++ // only succeed if message has been properly received
++ if(!goingAway) retval = (*done == 1);
++ }
++
++ // copy the package back from shared memory
++ if (!goingAway) {
++ memcpy(buffer, memoryMappedView, bufsize);
++ }
++ }
++ LeaveCriticalSection(&sendMemoryIPCLock);
++ return retval;
++}
++
++
++/**
++ * findAccessBridgeWindow - walk through linked list from where we are,
++ * return the HWND of the ABJavaVMInstance that
++ * matches the passed in vmID; no match: return 0
++ *
++ */
++HWND
++AccessBridgeJavaVMInstance::findAccessBridgeWindow(long javaVMID) {
++ PrintDebugString("In findAccessBridgeWindow");
++ // no need to recurse really
++ if (vmID == javaVMID) {
++ return javaAccessBridgeWindow;
++ } else {
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *current = nextJVMInstance;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++ if (current->vmID == javaVMID) {
++ isVMInstanceChainInUse = false;
++ return current->javaAccessBridgeWindow;
++ }
++ current = current->nextJVMInstance;
++ }
++ isVMInstanceChainInUse = false;
++ }
++ return 0;
++}
++
++/**
++ * findABJavaVMInstanceFromJavaHWND - walk through linked list from
++ * where we are. Return the
++ * AccessBridgeJavaVMInstance
++ * of the ABJavaVMInstance that
++ * matches the passed in vmID;
++ * no match: return 0
++ */
++AccessBridgeJavaVMInstance *
++AccessBridgeJavaVMInstance::findABJavaVMInstanceFromJavaHWND(HWND window) {
++ PrintDebugString("In findABJavaInstanceFromJavaHWND");
++ // no need to recurse really
++ if (javaAccessBridgeWindow == window) {
++ return this;
++ } else {
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *current = nextJVMInstance;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++ if (current->javaAccessBridgeWindow == window) {
++ isVMInstanceChainInUse = false;
++ return current;
++ }
++ current = current->nextJVMInstance;
++ }
++ }
++ isVMInstanceChainInUse = false;
++ return (AccessBridgeJavaVMInstance *) 0;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeJavaVMInstance.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,68 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * A class to track key JVM instance info from the AT WinAccessBridge
++ */
++
++#ifndef __AccessBridgeJavaVMInstance_H__
++#define __AccessBridgeJavaVMInstance_H__
++
++#include "AccessBridgePackages.h"
++
++#include <jni.h>
++#include <windows.h>
++
++/**
++ * The AccessBridgeJavaVMInstance class.
++ */
++class AccessBridgeJavaVMInstance {
++ friend class WinAccessBridge;
++
++ AccessBridgeJavaVMInstance *nextJVMInstance;
++ HWND ourAccessBridgeWindow;
++ HWND javaAccessBridgeWindow;
++ long vmID;
++
++ // IPC variables
++ HANDLE memoryMappedFileMapHandle; // handle to file map
++ char *memoryMappedView; // ptr to shared memory
++ char memoryMappedFileName[cMemoryMappedNameSize];
++ BOOL goingAway;
++
++
++public:
++ AccessBridgeJavaVMInstance(HWND ourABWindow, HWND javaABWindow,
++ long javaVMID,
++ AccessBridgeJavaVMInstance *next);
++ ~AccessBridgeJavaVMInstance();
++ LRESULT initiateIPC();
++ LRESULT sendPackage(char *buffer, long bufsize);
++ BOOL sendMemoryPackage(char *buffer, long bufsize);
++ HWND findAccessBridgeWindow(long javaVMID);
++ AccessBridgeJavaVMInstance *findABJavaVMInstanceFromJavaHWND(HWND window);
++};
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeMessageQueue.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,186 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * A class to manage queueing of messages for IPC
++ */
++
++#include "AccessBridgeDebug.h"
++#include "AccessBridgeMessageQueue.h"
++#include "AccessBridgePackages.h" // for debugging only
++#include <windows.h>
++#include <malloc.h>
++
++DEBUG_CODE(extern HWND theDialogWindow);
++extern "C" {
++ DEBUG_CODE(void AppendToCallInfo(char *s));
++}
++
++// -------------------
++
++
++AccessBridgeQueueElement::AccessBridgeQueueElement(char *buf, int size) {
++ bufsize = size;
++ next = (AccessBridgeQueueElement *) 0;
++ previous = (AccessBridgeQueueElement *) 0;
++ buffer = (char *) malloc(bufsize);
++ memcpy(buffer, buf, bufsize);
++}
++
++AccessBridgeQueueElement::~AccessBridgeQueueElement() {
++ // delete buffer;
++ free(buffer);
++}
++
++
++// -------------------
++
++
++AccessBridgeMessageQueue::AccessBridgeMessageQueue() {
++ queueLocked = FALSE;
++ queueRemoveLocked = FALSE;
++ start = (AccessBridgeQueueElement *) 0;
++ end = (AccessBridgeQueueElement *) 0;
++ size = 0;
++}
++
++AccessBridgeMessageQueue::~AccessBridgeMessageQueue() {
++ // empty queue, then exit
++}
++
++/**
++ * getEventsWaiting - gets the number of events waiting to fire
++ */
++int
++AccessBridgeMessageQueue::getEventsWaiting() {
++ return size;
++}
++
++/**
++ * add - add an element to the queue, which is locked with semaphores
++ *
++ */
++QueueReturns
++AccessBridgeMessageQueue::add(AccessBridgeQueueElement *element) {
++ PrintDebugString(" in AccessBridgeMessageQueue::add()");
++ PrintDebugString(" queue size = %d", size);
++
++ QueueReturns returnVal = cElementPushedOK;
++ if (queueLocked) {
++ PrintDebugString(" queue was locked; returning cQueueInUse!");
++ return cQueueInUse;
++ }
++ queueLocked = TRUE;
++ {
++ PrintDebugString(" adding element to queue!");
++ if (end == (AccessBridgeQueueElement *) 0) {
++ if (start == (AccessBridgeQueueElement *) 0 && size == 0) {
++ start = element;
++ end = element;
++ element->previous = (AccessBridgeQueueElement *) 0;
++ element->next = (AccessBridgeQueueElement *) 0;
++ size++;
++ } else {
++ returnVal = cQueueBroken; // bad voodo!
++ }
++ } else {
++ element->previous = end;
++ element->next = (AccessBridgeQueueElement *) 0;
++ end->next = element;
++ end = element;
++ size++;
++ }
++ }
++ queueLocked = FALSE;
++ PrintDebugString(" returning from AccessBridgeMessageQueue::add()");
++ return returnVal;
++}
++
++
++/**
++ * remove - remove an element from the queue, which is locked with semaphores
++ *
++ */
++QueueReturns
++AccessBridgeMessageQueue::remove(AccessBridgeQueueElement **element) {
++ PrintDebugString(" in AccessBridgeMessageQueue::remove()");
++ PrintDebugString(" queue size = %d", size);
++
++ QueueReturns returnVal = cMoreMessages;
++ if (queueLocked) {
++ PrintDebugString(" queue was locked; returning cQueueInUse!");
++ return cQueueInUse;
++ }
++ queueLocked = TRUE;
++ {
++ PrintDebugString(" removing element from queue!");
++ if (size > 0) {
++ if (start != (AccessBridgeQueueElement *) 0) {
++ *element = start;
++ start = start->next;
++ if (start != (AccessBridgeQueueElement *) 0) {
++ start->previous = (AccessBridgeQueueElement *) 0;
++ } else {
++ end = (AccessBridgeQueueElement *) 0;
++ if (size != 1) {
++ returnVal = cQueueBroken; // bad voodo, should only be 1 in this situation
++ }
++ }
++ size--;
++ } else {
++ returnVal = cQueueBroken; // bad voodo!
++ }
++ } else {
++ returnVal = cQueueEmpty;
++ }
++ }
++ queueLocked = FALSE;
++ PrintDebugString(" returning from AccessBridgeMessageQueue::remove()");
++ return returnVal;
++}
++
++
++/**
++ * setRemoveLock - set the state of the removeLock (TRUE or FALSE)
++ *
++ */
++QueueReturns
++AccessBridgeMessageQueue::setRemoveLock(BOOL removeLockSetting) {
++ if (queueLocked) {
++ return cQueueInUse;
++ }
++ queueRemoveLocked = removeLockSetting;
++
++ return cQueueOK;
++}
++
++/**
++ * setRemoveLock - set the state of the removeLock (TRUE or FALSE)
++ *
++ */
++BOOL
++AccessBridgeMessageQueue::getRemoveLockSetting() {
++ return queueRemoveLocked;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeMessageQueue.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * A class to manage queueing of messages for IPC
++ */
++
++#include <windows.h>
++
++#ifndef __AccessBridgeMessageQueue_H__
++#define __AccessBridgeMessageQueue_H__
++
++
++enum QueueReturns {
++ cQueueEmpty = 0,
++ cMoreMessages = 1,
++ cQueueInUse,
++ cElementPushedOK,
++ cQueueFull,
++ cQueueOK,
++ cQueueBroken // shouldn't ever happen!
++};
++
++class AccessBridgeQueueElement {
++ friend class AccessBridgeMessageQueue;
++ friend class WinAccessBridge;
++ char *buffer;
++ int bufsize;
++ AccessBridgeQueueElement *next;
++ AccessBridgeQueueElement *previous;
++
++public:
++ AccessBridgeQueueElement(char *buf, int size);
++ ~AccessBridgeQueueElement();
++};
++
++class AccessBridgeMessageQueue {
++ BOOL queueLocked;
++ BOOL queueRemoveLocked;
++ AccessBridgeQueueElement *start;
++ AccessBridgeQueueElement *end;
++ int size;
++
++public:
++ AccessBridgeMessageQueue();
++ ~AccessBridgeMessageQueue();
++
++ int getEventsWaiting();
++
++ QueueReturns add(AccessBridgeQueueElement *element);
++ QueueReturns remove(AccessBridgeQueueElement **element);
++ QueueReturns setRemoveLock(BOOL removeLockSetting);
++ BOOL getRemoveLockSetting();
++};
++
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeMessages.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,49 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * Common AccessBridge IPC message definitions
++ */
++
++#include "AccessBridgeMessages.h"
++
++
++// unique broadcast msg. IDs gotten dymanically
++
++// wParam == sourceHwnc; lParam = *vmID
++UINT theFromJavaHelloMsgID;
++// wParam == sourceHwnc; lParam unused
++UINT theFromWindowsHelloMsgID;
++
++
++BOOL initBroadcastMessageIDs() {
++ theFromJavaHelloMsgID = RegisterWindowMessage("AccessBridge-FromJava-Hello");
++ theFromWindowsHelloMsgID = RegisterWindowMessage("AccessBridge-FromWindows-Hello");
++
++ if (theFromJavaHelloMsgID == 0 || theFromWindowsHelloMsgID) {
++ return FALSE;
++ }
++ return TRUE;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeMessages.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,73 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * Common AccessBridge IPC message definitions
++ */
++
++#include <windows.h>
++#include <winuser.h>
++
++#ifndef __AccessBridgeMessages_H__
++#define __AccessBridgeMessages_H__
++
++
++// used for messages between AccessBridge dlls to manage IPC
++// In the SendMessage call, the third param (WPARAM) is
++// the source HWND (ourAccessBridgeWindow in this case),
++// and the fourth param (LPARAM) is the size in bytes of
++// the package put into shared memory.
++#define AB_MEMORY_MAPPED_FILE_SETUP (WM_USER+0x1000)
++
++// used for messages between AccessBridge dlls to manage IPC
++// In the SendMessage call, the third param (WPARAM) is
++// the source HWND (ourAccessBridgeWindow in this case),
++// and the fourth param (LPARAM) is the size in bytes of
++// the package put into shared memory.
++#define AB_MESSAGE_WAITING (WM_USER+0x1001)
++
++// used for messages from JavaDLL to itself (or perhaps later also
++// for messages from WindowsDLL to itself). Used with PostMessage,
++// it is called for deferred processing of messages to send across
++// to another DLL (or DLLs)
++#define AB_MESSAGE_QUEUED (WM_USER+0x1002)
++
++// used to let other AccessBridge DLLs know that one of the DLLs
++// they are communicating with is going away (not reversable)
++#define AB_DLL_GOING_AWAY (WM_USER+0x1003)
++
++
++// used as part of the Memory-Mapped file IPC setup. The first
++// constant is the query, the second the response, that are put
++// into the memory mapped file for reading by the opposite DLL
++// to verify that communication is working
++#define AB_MEMORY_MAPPED_FILE_OK_QUERY "OK?"
++#define AB_MEMORY_MAPPED_FILE_OK_ANSWER "OK!"
++
++
++BOOL initBroadcastMessageIDs();
++
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgePackages.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,2215 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * Header file for packages of paramaters passed between Java Accessibility
++ * and native Assistive Technologies
++ */
++
++#ifndef __AccessBridgePackages_H__
++#define __AccessBridgePackages_H__
++
++#include <jni.h>
++#include <windows.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY
++typedef jobject JOBJECT64;
++typedef HWND ABHWND64;
++#define ABHandleToLong
++#define ABLongToHandle
++#else
++typedef jlong JOBJECT64;
++typedef long ABHWND64;
++#define ABHandleToLong HandleToLong
++#define ABLongToHandle LongToHandle
++#endif
++
++#define MAX_BUFFER_SIZE 10240
++#define MAX_STRING_SIZE 1024
++#define SHORT_STRING_SIZE 256
++
++ // object types
++ typedef JOBJECT64 AccessibleContext;
++ typedef JOBJECT64 AccessibleText;
++ typedef JOBJECT64 AccessibleValue;
++ typedef JOBJECT64 AccessibleSelection;
++ typedef JOBJECT64 Java_Object;
++ typedef JOBJECT64 PropertyChangeEvent;
++ typedef JOBJECT64 FocusEvent;
++ typedef JOBJECT64 CaretEvent;
++ typedef JOBJECT64 MouseEvent;
++ typedef JOBJECT64 MenuEvent;
++ typedef JOBJECT64 AccessibleTable;
++ typedef JOBJECT64 AccessibleHyperlink;
++ typedef JOBJECT64 AccessibleHypertext;
++
++ /**
++ ******************************************************
++ * Java event types
++ ******************************************************
++ */
++
++#define cPropertyChangeEvent (jlong) 1 // 1
++#define cFocusGainedEvent (jlong) 2 // 2
++#define cFocusLostEvent (jlong) 4 // 4
++#define cCaretUpdateEvent (jlong) 8 // 8
++#define cMouseClickedEvent (jlong) 16 // 10
++#define cMouseEnteredEvent (jlong) 32 // 20
++#define cMouseExitedEvent (jlong) 64 // 40
++#define cMousePressedEvent (jlong) 128 // 80
++#define cMouseReleasedEvent (jlong) 256 // 100
++#define cMenuCanceledEvent (jlong) 512 // 200
++#define cMenuDeselectedEvent (jlong) 1024 // 400
++#define cMenuSelectedEvent (jlong) 2048 // 800
++#define cPopupMenuCanceledEvent (jlong) 4096 // 1000
++#define cPopupMenuWillBecomeInvisibleEvent (jlong) 8192 // 2000
++#define cPopupMenuWillBecomeVisibleEvent (jlong) 16384 // 4000
++#define cJavaShutdownEvent (jlong) 32768 // 8000
++
++ /**
++ ******************************************************
++ * Accessible Roles
++ * Defines all AccessibleRoles in Local.US
++ ******************************************************
++ */
++
++ /**
++ * Object is used to alert the user about something.
++ */
++#define ACCESSIBLE_ALERT L"alert"
++
++ /**
++ * The header for a column of data.
++ */
++#define ACCESSIBLE_COLUMN_HEADER L"column header"
++
++ /**
++ * Object that can be drawn into and is used to trap
++ * events.
++ * see ACCESSIBLE_FRAME
++ * see ACCESSIBLE_GLASS_PANE
++ * see ACCESSIBLE_LAYERED_PANE
++ */
++#define ACCESSIBLE_CANVAS L"canvas"
++
++ /**
++ * A list of choices the user can select from. Also optionally
++ * allows the user to enter a choice of their own.
++ */
++#define ACCESSIBLE_COMBO_BOX L"combo box"
++
++ /**
++ * An iconified internal frame in a DESKTOP_PANE.
++ * see ACCESSIBLE_DESKTOP_PANE
++ * see ACCESSIBLE_INTERNAL_FRAME
++ */
++#define ACCESSIBLE_DESKTOP_ICON L"desktop icon"
++
++ /**
++ * A frame-like object that is clipped by a desktop pane. The
++ * desktop pane, internal frame, and desktop icon objects are
++ * often used to create multiple document interfaces within an
++ * application.
++ * see ACCESSIBLE_DESKTOP_ICON
++ * see ACCESSIBLE_DESKTOP_PANE
++ * see ACCESSIBLE_FRAME
++ */
++#define ACCESSIBLE_INTERNAL_FRAME L"internal frame"
++
++ /**
++ * A pane that supports internal frames and
++ * iconified versions of those internal frames.
++ * see ACCESSIBLE_DESKTOP_ICON
++ * see ACCESSIBLE_INTERNAL_FRAME
++ */
++#define ACCESSIBLE_DESKTOP_PANE L"desktop pane"
++
++ /**
++ * A specialized pane whose primary use is inside a DIALOG
++ * see ACCESSIBLE_DIALOG
++ */
++#define ACCESSIBLE_OPTION_PANE L"option pane"
++
++ /**
++ * A top level window with no title or border.
++ * see ACCESSIBLE_FRAME
++ * see ACCESSIBLE_DIALOG
++ */
++#define ACCESSIBLE_WINDOW L"window"
++
++ /**
++ * A top level window with a title bar, border, menu bar, etc. It is
++ * often used as the primary window for an application.
++ * see ACCESSIBLE_DIALOG
++ * see ACCESSIBLE_CANVAS
++ * see ACCESSIBLE_WINDOW
++ */
++#define ACCESSIBLE_FRAME L"frame"
++
++ /**
++ * A top level window with title bar and a border. A dialog is similar
++ * to a frame, but it has fewer properties and is often used as a
++ * secondary window for an application.
++ * see ACCESSIBLE_FRAME
++ * see ACCESSIBLE_WINDOW
++ */
++#define ACCESSIBLE_DIALOG L"dialog"
++
++ /**
++ * A specialized dialog that lets the user choose a color.
++ */
++#define ACCESSIBLE_COLOR_CHOOSER L"color chooser"
++
++
++ /**
++ * A pane that allows the user to navigate through
++ * and select the contents of a directory. May be used
++ * by a file chooser.
++ * see ACCESSIBLE_FILE_CHOOSER
++ */
++#define ACCESSIBLE_DIRECTORY_PANE L"directory pane"
++
++ /**
++ * A specialized dialog that displays the files in the directory
++ * and lets the user select a file, browse a different directory,
++ * or specify a filename. May use the directory pane to show the
++ * contents of a directory.
++ * see ACCESSIBLE_DIRECTORY_PANE
++ */
++#define ACCESSIBLE_FILE_CHOOSER L"file chooser"
++
++ /**
++ * An object that fills up space in a user interface. It is often
++ * used in interfaces to tweak the spacing between components,
++ * but serves no other purpose.
++ */
++#define ACCESSIBLE_FILLER L"filler"
++
++ /**
++ * A hypertext anchor
++ */
++#define ACCESSIBLE_HYPERLINK L"hyperlink"
++
++ /**
++ * A small fixed size picture, typically used to decorate components.
++ */
++#define ACCESSIBLE_ICON L"icon"
++
++ /**
++ * An object used to present an icon or short string in an interface.
++ */
++#define ACCESSIBLE_LABEL L"label"
++
++ /**
++ * A specialized pane that has a glass pane and a layered pane as its
++ * children.
++ * see ACCESSIBLE_GLASS_PANE
++ * see ACCESSIBLE_LAYERED_PANE
++ */
++#define ACCESSIBLE_ROOT_PANE L"root pane"
++
++ /**
++ * A pane that is guaranteed to be painted on top
++ * of all panes beneath it.
++ * see ACCESSIBLE_ROOT_PANE
++ * see ACCESSIBLE_CANVAS
++ */
++#define ACCESSIBLE_GLASS_PANE L"glass pane"
++
++ /**
++ * A specialized pane that allows its children to be drawn in layers,
++ * providing a form of stacking order. This is usually the pane that
++ * holds the menu bar as well as the pane that contains most of the
++ * visual components in a window.
++ * see ACCESSIBLE_GLASS_PANE
++ * see ACCESSIBLE_ROOT_PANE
++ */
++#define ACCESSIBLE_LAYERED_PANE L"layered pane"
++
++ /**
++ * An object that presents a list of objects to the user and allows the
++ * user to select one or more of them. A list is usually contained
++ * within a scroll pane.
++ * see ACCESSIBLE_SCROLL_PANE
++ * see ACCESSIBLE_LIST_ITEM
++ */
++#define ACCESSIBLE_LIST L"list"
++
++ /**
++ * An object that presents an element in a list. A list is usually
++ * contained within a scroll pane.
++ * see ACCESSIBLE_SCROLL_PANE
++ * see ACCESSIBLE_LIST
++ */
++#define ACCESSIBLE_LIST_ITEM L"list item"
++
++ /**
++ * An object usually drawn at the top of the primary dialog box of
++ * an application that contains a list of menus the user can choose
++ * from. For example, a menu bar might contain menus for "File,"
++ * "Edit," and "Help."
++ * see ACCESSIBLE_MENU
++ * see ACCESSIBLE_POPUP_MENU
++ * see ACCESSIBLE_LAYERED_PANE
++ */
++#define ACCESSIBLE_MENU_BAR L"menu bar"
++
++ /**
++ * A temporary window that is usually used to offer the user a
++ * list of choices, and then hides when the user selects one of
++ * those choices.
++ * see ACCESSIBLE_MENU
++ * see ACCESSIBLE_MENU_ITEM
++ */
++#define ACCESSIBLE_POPUP_MENU L"popup menu"
++
++ /**
++ * An object usually found inside a menu bar that contains a list
++ * of actions the user can choose from. A menu can have any object
++ * as its children, but most often they are menu items, other menus,
++ * or rudimentary objects such as radio buttons, check boxes, or
++ * separators. For example, an application may have an "Edit" menu
++ * that contains menu items for "Cut" and "Paste."
++ * see ACCESSIBLE_MENU_BAR
++ * see ACCESSIBLE_MENU_ITEM
++ * see ACCESSIBLE_SEPARATOR
++ * see ACCESSIBLE_RADIO_BUTTON
++ * see ACCESSIBLE_CHECK_BOX
++ * see ACCESSIBLE_POPUP_MENU
++ */
++#define ACCESSIBLE_MENU L"menu"
++
++ /**
++ * An object usually contained in a menu that presents an action
++ * the user can choose. For example, the "Cut" menu item in an
++ * "Edit" menu would be an action the user can select to cut the
++ * selected area of text in a document.
++ * see ACCESSIBLE_MENU_BAR
++ * see ACCESSIBLE_SEPARATOR
++ * see ACCESSIBLE_POPUP_MENU
++ */
++#define ACCESSIBLE_MENU_ITEM L"menu item"
++
++ /**
++ * An object usually contained in a menu to provide a visual
++ * and logical separation of the contents in a menu. For example,
++ * the "File" menu of an application might contain menu items for
++ * "Open," "Close," and "Exit," and will place a separator between
++ * "Close" and "Exit" menu items.
++ * see ACCESSIBLE_MENU
++ * see ACCESSIBLE_MENU_ITEM
++ */
++#define ACCESSIBLE_SEPARATOR L"separator"
++
++ /**
++ * An object that presents a series of panels (or page tabs), one at a
++ * time, through some mechanism provided by the object. The most common
++ * mechanism is a list of tabs at the top of the panel. The children of
++ * a page tab list are all page tabs.
++ * see ACCESSIBLE_PAGE_TAB
++ */
++#define ACCESSIBLE_PAGE_TAB_LIST L"page tab list"
++
++ /**
++ * An object that is a child of a page tab list. Its sole child is
++ * the panel that is to be presented to the user when the user
++ * selects the page tab from the list of tabs in the page tab list.
++ * see ACCESSIBLE_PAGE_TAB_LIST
++ */
++#define ACCESSIBLE_PAGE_TAB L"page tab"
++
++ /**
++ * A generic container that is often used to group objects.
++ */
++#define ACCESSIBLE_PANEL L"panel"
++
++ /**
++ * An object used to indicate how much of a task has been completed.
++ */
++#define ACCESSIBLE_PROGRESS_BAR L"progress bar"
++
++ /**
++ * A text object used for passwords, or other places where the
++ * text contents is not shown visibly to the user
++ */
++#define ACCESSIBLE_PASSWORD_TEXT L"password text"
++
++ /**
++ * An object the user can manipulate to tell the application to do
++ * something.
++ * see ACCESSIBLE_CHECK_BOX
++ * see ACCESSIBLE_TOGGLE_BUTTON
++ * see ACCESSIBLE_RADIO_BUTTON
++ */
++#define ACCESSIBLE_PUSH_BUTTON L"push button"
++
++ /**
++ * A specialized push button that can be checked or unchecked, but
++ * does not provide a separate indicator for the current state.
++ * see ACCESSIBLE_PUSH_BUTTON
++ * see ACCESSIBLE_CHECK_BOX
++ * see ACCESSIBLE_RADIO_BUTTON
++ */
++#define ACCESSIBLE_TOGGLE_BUTTON L"toggle button"
++
++ /**
++ * A choice that can be checked or unchecked and provides a
++ * separate indicator for the current state.
++ * see ACCESSIBLE_PUSH_BUTTON
++ * see ACCESSIBLE_TOGGLE_BUTTON
++ * see ACCESSIBLE_RADIO_BUTTON
++ */
++#define ACCESSIBLE_CHECK_BOX L"check box"
++
++ /**
++ * A specialized check box that will cause other radio buttons in the
++ * same group to become unchecked when this one is checked.
++ * see ACCESSIBLE_PUSH_BUTTON
++ * see ACCESSIBLE_TOGGLE_BUTTON
++ * see ACCESSIBLE_CHECK_BOX
++ */
++#define ACCESSIBLE_RADIO_BUTTON L"radio button"
++
++ /**
++ * The header for a row of data.
++ */
++#define ACCESSIBLE_ROW_HEADER L"row header"
++
++ /**
++ * An object that allows a user to incrementally view a large amount
++ * of information. Its children can include scroll bars and a viewport.
++ * see ACCESSIBLE_SCROLL_BAR
++ * see ACCESSIBLE_VIEWPORT
++ */
++#define ACCESSIBLE_SCROLL_PANE L"scroll pane"
++
++ /**
++ * An object usually used to allow a user to incrementally view a
++ * large amount of data. Usually used only by a scroll pane.
++ * see ACCESSIBLE_SCROLL_PANE
++ */
++#define ACCESSIBLE_SCROLL_BAR L"scroll bar"
++
++ /**
++ * An object usually used in a scroll pane. It represents the portion
++ * of the entire data that the user can see. As the user manipulates
++ * the scroll bars, the contents of the viewport can change.
++ * see ACCESSIBLE_SCROLL_PANE
++ */
++#define ACCESSIBLE_VIEWPORT L"viewport"
++
++ /**
++ * An object that allows the user to select from a bounded range. For
++ * example, a slider might be used to select a number between 0 and 100.
++ */
++#define ACCESSIBLE_SLIDER L"slider"
++
++ /**
++ * A specialized panel that presents two other panels at the same time.
++ * Between the two panels is a divider the user can manipulate to make
++ * one panel larger and the other panel smaller.
++ */
++#define ACCESSIBLE_SPLIT_PANE L"split pane"
++
++ /**
++ * An object used to present information in terms of rows and columns.
++ * An example might include a spreadsheet application.
++ */
++#define ACCESSIBLE_TABLE L"table"
++
++ /**
++ * An object that presents text to the user. The text is usually
++ * editable by the user as opposed to a label.
++ * see ACCESSIBLE_LABEL
++ */
++#define ACCESSIBLE_TEXT L"text"
++
++ /**
++ * An object used to present hierarchical information to the user.
++ * The individual nodes in the tree can be collapsed and expanded
++ * to provide selective disclosure of the tree's contents.
++ */
++#define ACCESSIBLE_TREE L"tree"
++
++ /**
++ * A bar or palette usually composed of push buttons or toggle buttons.
++ * It is often used to provide the most frequently used functions for an
++ * application.
++ */
++#define ACCESSIBLE_TOOL_BAR L"tool bar"
++
++ /**
++ * An object that provides information about another object. The
++ * accessibleDescription property of the tool tip is often displayed
++ * to the user in a small L"help bubble" when the user causes the
++ * mouse to hover over the object associated with the tool tip.
++ */
++#define ACCESSIBLE_TOOL_TIP L"tool tip"
++
++ /**
++ * An AWT component, but nothing else is known about it.
++ * see ACCESSIBLE_SWING_COMPONENT
++ * see ACCESSIBLE_UNKNOWN
++ */
++#define ACCESSIBLE_AWT_COMPONENT L"awt component"
++
++ /**
++ * A Swing component, but nothing else is known about it.
++ * see ACCESSIBLE_AWT_COMPONENT
++ * see ACCESSIBLE_UNKNOWN
++ */
++#define ACCESSIBLE_SWING_COMPONENT L"swing component"
++
++ /**
++ * The object contains some Accessible information, but its role is
++ * not known.
++ * see ACCESSIBLE_AWT_COMPONENT
++ * see ACCESSIBLE_SWING_COMPONENT
++ */
++#define ACCESSIBLE_UNKNOWN L"unknown"
++
++ /**
++ * A STATUS_BAR is an simple component that can contain
++ * multiple labels of status information to the user.
++ */
++#define ACCESSIBLE_STATUS_BAR L"status bar"
++
++ /**
++ * A DATE_EDITOR is a component that allows users to edit
++ * java.util.Date and java.util.Time objects
++ */
++#define ACCESSIBLE_DATE_EDITOR L"date editor"
++
++ /**
++ * A SPIN_BOX is a simple spinner component and its main use
++ * is for simple numbers.
++ */
++#define ACCESSIBLE_SPIN_BOX L"spin box"
++
++ /**
++ * A FONT_CHOOSER is a component that lets the user pick various
++ * attributes for fonts.
++ */
++#define ACCESSIBLE_FONT_CHOOSER L"font chooser"
++
++ /**
++ * A GROUP_BOX is a simple container that contains a border
++ * around it and contains components inside it.
++ */
++#define ACCESSIBLE_GROUP_BOX L"group box"
++
++ /**
++ * A text header
++ */
++#define ACCESSIBLE_HEADER L"header"
++
++ /**
++ * A text footer
++ */
++#define ACCESSIBLE_FOOTER L"footer"
++
++ /**
++ * A text paragraph
++ */
++#define ACCESSIBLE_PARAGRAPH L"paragraph"
++
++ /**
++ * A ruler is an object used to measure distance
++ */
++#define ACCESSIBLE_RULER L"ruler"
++
++ /**
++ * A role indicating the object acts as a formula for
++ * calculating a value. An example is a formula in
++ * a spreadsheet cell.
++ */
++#define ACCESSIBLE_EDITBAR L"editbar"
++
++ /**
++ * A role indicating the object monitors the progress
++ * of some operation.
++ */
++#define PROGRESS_MONITOR L"progress monitor"
++
++
++ /**
++ ******************************************************
++ * Accessibility event types
++ ******************************************************
++ */
++
++#define cPropertyNameChangeEvent (jlong) 1 // 1
++#define cPropertyDescriptionChangeEvent (jlong) 2 // 2
++#define cPropertyStateChangeEvent (jlong) 4 // 4
++#define cPropertyValueChangeEvent (jlong) 8 // 8
++#define cPropertySelectionChangeEvent (jlong) 16 // 10
++#define cPropertyTextChangeEvent (jlong) 32 // 20
++#define cPropertyCaretChangeEvent (jlong) 64 // 40
++#define cPropertyVisibleDataChangeEvent (jlong) 128 // 80
++#define cPropertyChildChangeEvent (jlong) 256 // 100
++#define cPropertyActiveDescendentChangeEvent (jlong) 512 // 200
++#define cPropertyTableModelChangeEvent (jlong) 1024 // 400
++
++ /**
++ ******************************************************
++ * optional AccessibleContext interfaces
++ *
++ * This version of the bridge reuses the accessibleValue
++ * field in the AccessibleContextInfo struct to represent
++ * additional optional interfaces that are supported by
++ * the Java AccessibleContext. This is backwardly compatable
++ * because the old accessibleValue was set to the BOOL
++ * value TRUE (i.e., 1) if the AccessibleValue interface is
++ * supported.
++ ******************************************************
++ */
++
++#define cAccessibleValueInterface (jlong) 1 // 1 << 1 (TRUE)
++#define cAccessibleActionInterface (jlong) 2 // 1 << 2
++#define cAccessibleComponentInterface (jlong) 4 // 1 << 3
++#define cAccessibleSelectionInterface (jlong) 8 // 1 << 4
++#define cAccessibleTableInterface (jlong) 16 // 1 << 5
++#define cAccessibleTextInterface (jlong) 32 // 1 << 6
++#define cAccessibleHypertextInterface (jlong) 64 // 1 << 7
++
++
++ /**
++ ******************************************************
++ * Accessibility information bundles
++ ******************************************************
++ */
++
++ typedef struct AccessBridgeVersionInfoTag {
++ wchar_t VMversion[SHORT_STRING_SIZE]; // output of "java -version"
++ wchar_t bridgeJavaClassVersion[SHORT_STRING_SIZE]; // version of the AccessBridge.class
++ wchar_t bridgeJavaDLLVersion[SHORT_STRING_SIZE]; // version of JavaAccessBridge.dll
++ wchar_t bridgeWinDLLVersion[SHORT_STRING_SIZE]; // version of WindowsAccessBridge.dll
++ } AccessBridgeVersionInfo;
++
++
++ typedef struct AccessibleContextInfoTag {
++ wchar_t name[MAX_STRING_SIZE]; // the AccessibleName of the object
++ wchar_t description[MAX_STRING_SIZE]; // the AccessibleDescription of the object
++
++ wchar_t role[SHORT_STRING_SIZE]; // localized AccesibleRole string
++ wchar_t role_en_US[SHORT_STRING_SIZE]; // AccesibleRole string in the en_US locale
++ wchar_t states[SHORT_STRING_SIZE]; // localized AccesibleStateSet string (comma separated)
++ wchar_t states_en_US[SHORT_STRING_SIZE]; // AccesibleStateSet string in the en_US locale (comma separated)
++
++ jint indexInParent; // index of object in parent
++ jint childrenCount; // # of children, if any
++
++ jint x; // screen coords in pixels
++ jint y; // "
++ jint width; // pixel width of object
++ jint height; // pixel height of object
++
++ BOOL accessibleComponent; // flags for various additional
++ BOOL accessibleAction; // Java Accessibility interfaces
++ BOOL accessibleSelection; // FALSE if this object doesn't
++ BOOL accessibleText; // implement the additional interface
++ // in question
++
++ // BOOL accessibleValue; // old BOOL indicating whether AccessibleValue is supported
++ BOOL accessibleInterfaces; // new bitfield containing additional interface flags
++
++ } AccessibleContextInfo;
++
++
++
++ // AccessibleText packages
++ typedef struct AccessibleTextInfoTag {
++ jint charCount; // # of characters in this text object
++ jint caretIndex; // index of caret
++ jint indexAtPoint; // index at the passsed in point
++ } AccessibleTextInfo;
++
++ typedef struct AccessibleTextItemsInfoTag {
++ wchar_t letter;
++ wchar_t word[SHORT_STRING_SIZE];
++ wchar_t sentence[MAX_STRING_SIZE];
++ } AccessibleTextItemsInfo;
++
++ typedef struct AccessibleTextSelectionInfoTag {
++ jint selectionStartIndex;
++ jint selectionEndIndex;
++ wchar_t selectedText[MAX_STRING_SIZE];
++ } AccessibleTextSelectionInfo;
++
++ typedef struct AccessibleTextRectInfoTag {
++ jint x; // bounding rect of char at index
++ jint y; // "
++ jint width; // "
++ jint height; // "
++ } AccessibleTextRectInfo;
++
++ // standard attributes for text; note: tabstops are not supported
++ typedef struct AccessibleTextAttributesInfoTag {
++ BOOL bold;
++ BOOL italic;
++ BOOL underline;
++ BOOL strikethrough;
++ BOOL superscript;
++ BOOL subscript;
++
++ wchar_t backgroundColor[SHORT_STRING_SIZE];
++ wchar_t foregroundColor[SHORT_STRING_SIZE];
++ wchar_t fontFamily[SHORT_STRING_SIZE];
++ jint fontSize;
++
++ jint alignment;
++ jint bidiLevel;
++
++ jfloat firstLineIndent;
++ jfloat leftIndent;
++ jfloat rightIndent;
++ jfloat lineSpacing;
++ jfloat spaceAbove;
++ jfloat spaceBelow;
++
++ wchar_t fullAttributesString[MAX_STRING_SIZE];
++ } AccessibleTextAttributesInfo;
++
++ /**
++ ******************************************************
++ * IPC management typedefs
++ ******************************************************
++ */
++
++#define cMemoryMappedNameSize 255
++
++ /**
++ * sent by the WindowsDLL -> the memory-mapped file is setup
++ *
++ */
++ typedef struct MemoryMappedFileCreatedPackageTag {
++// HWND bridgeWindow; // redundant, but easier to get to here...
++ ABHWND64 bridgeWindow; // redundant, but easier to get to here...
++ char filename[cMemoryMappedNameSize];
++ } MemoryMappedFileCreatedPackage;
++
++
++
++
++ /**
++ * sent when a new JavaVM attaches to the Bridge
++ *
++ */
++ typedef struct JavaVMCreatedPackageTag {
++ ABHWND64 bridgeWindow;
++ long vmID;
++ } JavaVMCreatedPackage;
++
++ /**
++ * sent when a JavaVM detatches from the Bridge
++ *
++ */
++ typedef struct JavaVMDestroyedPackageTag {
++ ABHWND64 bridgeWindow;
++ } JavaVMDestroyedPackage;
++
++ /**
++ * sent when a new AT attaches to the Bridge
++ *
++ */
++ typedef struct WindowsATCreatedPackageTag {
++ ABHWND64 bridgeWindow;
++ } WindowsATCreatedPackage;
++
++ /**
++ * sent when an AT detatches from the Bridge
++ *
++ */
++ typedef struct WindowsATDestroyedPackageTag {
++ ABHWND64 bridgeWindow;
++ } WindowsATDestroyedPackage;
++
++
++ /**
++ * sent by JVM Bridges in response to a WindowsATCreate
++ * message; saying "howdy, welcome to the neighborhood"
++ *
++ */
++ typedef struct JavaVMPresentNotificationPackageTag {
++ ABHWND64 bridgeWindow;
++ long vmID;
++ } JavaVMPresentNotificationPackage;
++
++ /**
++ * sent by AT Bridges in response to a JavaVMCreate
++ * message; saying "howdy, welcome to the neighborhood"
++ *
++ */
++ typedef struct WindowsATPresentNotificationPackageTag {
++ ABHWND64 bridgeWindow;
++ } WindowsATPresentNotificationPackage;
++
++
++ /**
++ ******************************************************
++ * Core packages
++ ******************************************************
++ */
++
++ typedef struct ReleaseJavaObjectPackageTag {
++ long vmID;
++ JOBJECT64 object;
++ } ReleaseJavaObjectPackage;
++
++ typedef struct GetAccessBridgeVersionPackageTag {
++ long vmID; // can't get VM info w/out a VM!
++ AccessBridgeVersionInfo rVersionInfo;
++ } GetAccessBridgeVersionPackage;
++
++ typedef struct IsSameObjectPackageTag {
++ long vmID;
++ JOBJECT64 obj1;
++ JOBJECT64 obj2;
++ jboolean rResult;
++ } IsSameObjectPackage;
++
++ /**
++ ******************************************************
++ * Windows packages
++ ******************************************************
++ */
++
++ typedef struct IsJavaWindowPackageTag {
++ jint window;
++ jboolean rResult;
++ } IsJavaWindowPackage;
++
++ typedef struct GetAccessibleContextFromHWNDPackageTag {
++ jint window;
++ long rVMID;
++ JOBJECT64 rAccessibleContext;
++ } GetAccessibleContextFromHWNDPackage;
++
++ typedef struct GetHWNDFromAccessibleContextPackageTag {
++ JOBJECT64 accessibleContext;
++ ABHWND64 rHWND;
++ } GetHWNDFromAccessibleContextPackage;
++
++ /**
++******************************************************
++* AccessibleContext packages
++******************************************************
++*/
++
++ typedef struct GetAccessibleContextAtPackageTag {
++ jint x;
++ jint y;
++ long vmID;
++ JOBJECT64 AccessibleContext; // look within this AC
++ JOBJECT64 rAccessibleContext;
++ } GetAccessibleContextAtPackage;
++
++ typedef struct GetAccessibleContextWithFocusPackageTag {
++ long rVMID;
++ JOBJECT64 rAccessibleContext;
++ } GetAccessibleContextWithFocusPackage;
++
++ typedef struct GetAccessibleContextInfoPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ AccessibleContextInfo rAccessibleContextInfo;
++ } GetAccessibleContextInfoPackage;
++
++ typedef struct GetAccessibleChildFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint childIndex;
++ JOBJECT64 rAccessibleContext;
++ } GetAccessibleChildFromContextPackage;
++
++ typedef struct GetAccessibleParentFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ JOBJECT64 rAccessibleContext;
++ } GetAccessibleParentFromContextPackage;
++
++ /**
++******************************************************
++* AccessibleTable packages
++******************************************************
++*/
++
++#define MAX_TABLE_SELECTIONS 64
++
++ // table information
++ typedef struct AccessibleTableInfoTag {
++ JOBJECT64 caption; // AccesibleContext
++ JOBJECT64 summary; // AccessibleContext
++ jint rowCount;
++ jint columnCount;
++ JOBJECT64 accessibleContext;
++ JOBJECT64 accessibleTable;
++ } AccessibleTableInfo;
++
++ typedef struct GetAccessibleTableInfoPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ AccessibleTableInfo rTableInfo;
++ } GetAccessibleTableInfoPackage;
++
++ // table cell information
++ typedef struct AccessibleTableCellInfoTag {
++ JOBJECT64 accessibleContext;
++ jint index;
++ jint row;
++ jint column;
++ jint rowExtent;
++ jint columnExtent;
++ jboolean isSelected;
++ } AccessibleTableCellInfo;
++
++ typedef struct GetAccessibleTableCellInfoPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint row;
++ jint column;
++ AccessibleTableCellInfo rTableCellInfo;
++ } GetAccessibleTableCellInfoPackage;
++
++ typedef struct GetAccessibleTableRowHeaderPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ AccessibleTableInfo rTableInfo;
++ } GetAccessibleTableRowHeaderPackage;
++
++ typedef struct GetAccessibleTableColumnHeaderPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ AccessibleTableInfo rTableInfo;
++ } GetAccessibleTableColumnHeaderPackage;
++
++ typedef struct GetAccessibleTableRowDescriptionPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ jint row;
++ JOBJECT64 rAccessibleContext;
++ } GetAccessibleTableRowDescriptionPackage;
++
++ typedef struct GetAccessibleTableColumnDescriptionPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ jint column;
++ JOBJECT64 rAccessibleContext;
++ } GetAccessibleTableColumnDescriptionPackage;
++
++ typedef struct GetAccessibleTableRowSelectionCountPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint rCount;
++ } GetAccessibleTableRowSelectionCountPackage;
++
++ typedef struct IsAccessibleTableRowSelectedPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint row;
++ jboolean rResult;
++ } IsAccessibleTableRowSelectedPackage;
++
++ typedef struct GetAccessibleTableRowSelectionsPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint count;
++ jint rSelections[MAX_TABLE_SELECTIONS];
++ } GetAccessibleTableRowSelectionsPackage;
++
++ typedef struct GetAccessibleTableColumnSelectionCountPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint rCount;
++ } GetAccessibleTableColumnSelectionCountPackage;
++
++ typedef struct IsAccessibleTableColumnSelectedPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint column;
++ jboolean rResult;
++ } IsAccessibleTableColumnSelectedPackage;
++
++ typedef struct GetAccessibleTableColumnSelectionsPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint count;
++ jint rSelections[MAX_TABLE_SELECTIONS];
++ } GetAccessibleTableColumnSelectionsPackage;
++
++
++ typedef struct GetAccessibleTableRowPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint index;
++ jint rRow;
++ } GetAccessibleTableRowPackage;
++
++ typedef struct GetAccessibleTableColumnPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint index;
++ jint rColumn;
++ } GetAccessibleTableColumnPackage;
++
++ typedef struct GetAccessibleTableIndexPackageTag {
++ long vmID;
++ JOBJECT64 accessibleTable;
++ jint row;
++ jint column;
++ jint rIndex;
++ } GetAccessibleTableIndexPackage;
++
++
++ /**
++ ******************************************************
++ * AccessibleRelationSet packages
++ ******************************************************
++ */
++
++#define MAX_RELATION_TARGETS 25
++#define MAX_RELATIONS 5
++
++ typedef struct AccessibleRelationInfoTag {
++ wchar_t key[SHORT_STRING_SIZE];
++ jint targetCount;
++ JOBJECT64 targets[MAX_RELATION_TARGETS]; // AccessibleContexts
++ } AccessibleRelationInfo;
++
++ typedef struct AccessibleRelationSetInfoTag {
++ jint relationCount;
++ AccessibleRelationInfo relations[MAX_RELATIONS];
++ } AccessibleRelationSetInfo;
++
++ typedef struct GetAccessibleRelationSetPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ AccessibleRelationSetInfo rAccessibleRelationSetInfo;
++ } GetAccessibleRelationSetPackage;
++
++ /**
++ ******************************************************
++ * AccessibleHypertext packagess
++ ******************************************************
++ */
++
++#define MAX_HYPERLINKS 64 // maximum number of hyperlinks returned
++
++ // hyperlink information
++ typedef struct AccessibleHyperlinkInfoTag {
++ wchar_t text[SHORT_STRING_SIZE]; // the hyperlink text
++ jint startIndex; //index in the hypertext document where the link begins
++ jint endIndex; //index in the hypertext document where the link ends
++ JOBJECT64 accessibleHyperlink; // AccessibleHyperlink object
++ } AccessibleHyperlinkInfo;
++
++ // hypertext information
++ typedef struct AccessibleHypertextInfoTag {
++ jint linkCount; // number of hyperlinks
++ AccessibleHyperlinkInfo links[MAX_HYPERLINKS]; // the hyperlinks
++ JOBJECT64 accessibleHypertext; // AccessibleHypertext object
++ } AccessibleHypertextInfo;
++
++ // struct for sending a message to get the hypertext for an AccessibleContext
++ typedef struct GetAccessibleHypertextPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 accessibleContext; // AccessibleContext with hypertext
++ AccessibleHypertextInfo rAccessibleHypertextInfo; // returned hypertext
++ } GetAccessibleHypertextPackage;
++
++ // struct for sending an message to activate a hyperlink
++ typedef struct ActivateAccessibleHyperlinkPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 accessibleContext; // AccessibleContext containing the link
++ JOBJECT64 accessibleHyperlink; // the link to activate
++ BOOL rResult; // hyperlink activation return value
++ } ActivateAccessibleHyperlinkPackage;
++
++ // struct for sending a message to get the number of hyperlinks in a component
++ typedef struct GetAccessibleHyperlinkCountPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 accessibleContext; // AccessibleContext containing AccessibleHypertext
++ jint rLinkCount; // link count return value
++ } GetAccessibleHyperlinkCountPackage;
++
++ // struct for sending a message to get the hypertext for an AccessibleContext
++ // starting at a specified index in the document
++ typedef struct GetAccessibleHypertextExtPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 accessibleContext; // AccessibleContext with hypertext
++ jint startIndex; // start index in document
++ AccessibleHypertextInfo rAccessibleHypertextInfo; // returned hypertext
++ BOOL rSuccess; // whether call succeeded
++ } GetAccessibleHypertextExtPackage;
++
++ // struct for sending a message to get the nth hyperlink in a document;
++ // maps to AccessibleHypertext.getLink
++ typedef struct GetAccessibleHyperlinkPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 hypertext; // AccessibleHypertext
++ jint linkIndex; // hyperlink index
++ AccessibleHyperlinkInfo rAccessibleHyperlinkInfo; // returned hyperlink
++ } GetAccessibleHyperlinkPackage;
++
++ // struct for sending a message to get the index into an array
++ // of hyperlinks that is associated with a character index in a
++ // document; maps to AccessibleHypertext.getLinkIndex
++ typedef struct GetAccessibleHypertextLinkIndexPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 hypertext; // AccessibleHypertext
++ jint charIndex; // character index in document
++ jint rLinkIndex; // returned hyperlink index
++ } GetAccessibleHypertextLinkIndexPackage;
++
++ /**
++ ******************************************************
++ * Accessible Key Bindings packages
++ ******************************************************
++ */
++
++#define MAX_KEY_BINDINGS 10
++
++ // keyboard character modifiers
++#define ACCESSIBLE_SHIFT_KEYSTROKE 1
++#define ACCESSIBLE_CONTROL_KEYSTROKE 2
++#define ACCESSIBLE_META_KEYSTROKE 4
++#define ACCESSIBLE_ALT_KEYSTROKE 8
++#define ACCESSIBLE_ALT_GRAPH_KEYSTROKE 16
++#define ACCESSIBLE_BUTTON1_KEYSTROKE 32
++#define ACCESSIBLE_BUTTON2_KEYSTROKE 64
++#define ACCESSIBLE_BUTTON3_KEYSTROKE 128
++#define ACCESSIBLE_FKEY_KEYSTROKE 256 // F key pressed, character contains 1-24
++#define ACCESSIBLE_CONTROLCODE_KEYSTROKE 512 // Control code key pressed, character contains control code.
++
++// The supported control code keys are:
++#define ACCESSIBLE_VK_BACK_SPACE 8
++#define ACCESSIBLE_VK_DELETE 127
++#define ACCESSIBLE_VK_DOWN 40
++#define ACCESSIBLE_VK_END 35
++#define ACCESSIBLE_VK_HOME 36
++#define ACCESSIBLE_VK_INSERT 155
++#define ACCESSIBLE_VK_KP_DOWN 225
++#define ACCESSIBLE_VK_KP_LEFT 226
++#define ACCESSIBLE_VK_KP_RIGHT 227
++#define ACCESSIBLE_VK_KP_UP 224
++#define ACCESSIBLE_VK_LEFT 37
++#define ACCESSIBLE_VK_PAGE_DOWN 34
++#define ACCESSIBLE_VK_PAGE_UP 33
++#define ACCESSIBLE_VK_RIGHT 39
++#define ACCESSIBLE_VK_UP 38
++
++ // a key binding associates with a component
++ typedef struct AccessibleKeyBindingInfoTag {
++ jchar character; // the key character
++ jint modifiers; // the key modifiers
++ } AccessibleKeyBindingInfo;
++
++ // all of the key bindings associated with a component
++ typedef struct AccessibleKeyBindingsTag {
++ int keyBindingsCount; // number of key bindings
++ AccessibleKeyBindingInfo keyBindingInfo[MAX_KEY_BINDINGS];
++ } AccessibleKeyBindings;
++
++ // struct to get the key bindings associated with a component
++ typedef struct GetAccessibleKeyBindingsPackageTag {
++ long vmID; // the virtual machine id
++ JOBJECT64 accessibleContext; // the component
++ AccessibleKeyBindings rAccessibleKeyBindings; // the key bindings
++ } GetAccessibleKeyBindingsPackage;
++
++ /**
++******************************************************
++* AccessibleIcon packages
++******************************************************
++*/
++#define MAX_ICON_INFO 8
++
++ // an icon assocated with a component
++ typedef struct AccessibleIconInfoTag {
++ wchar_t description[SHORT_STRING_SIZE]; // icon description
++ jint height; // icon height
++ jint width; // icon width
++ } AccessibleIconInfo;
++
++ // all of the icons associated with a component
++ typedef struct AccessibleIconsTag {
++ jint iconsCount; // number of icons
++ AccessibleIconInfo iconInfo[MAX_ICON_INFO]; // the icons
++ } AccessibleIcons;
++
++ // struct to get the icons associated with a component
++ typedef struct GetAccessibleIconsPackageTag {
++ long vmID; // the virtual machine id
++ JOBJECT64 accessibleContext; // the component
++ AccessibleIcons rAccessibleIcons; // the icons
++ } GetAccessibleIconsPackage;
++
++
++ /**
++******************************************************
++* AccessibleAction packages
++******************************************************
++*/
++#define MAX_ACTION_INFO 256
++#define MAX_ACTIONS_TO_DO 32
++
++ // an action assocated with a component
++ typedef struct AccessibleActionInfoTag {
++ wchar_t name[SHORT_STRING_SIZE]; // action name
++ } AccessibleActionInfo;
++
++ // all of the actions associated with a component
++ typedef struct AccessibleActionsTag {
++ jint actionsCount; // number of actions
++ AccessibleActionInfo actionInfo[MAX_ACTION_INFO]; // the action information
++ } AccessibleActions;
++
++ // struct for requesting the actions associated with a component
++ typedef struct GetAccessibleActionsPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext; // the component
++ AccessibleActions rAccessibleActions; // the actions
++ } GetAccessibleActionsPackage;
++
++ // list of AccessibleActions to do
++ typedef struct AccessibleActionsToDoTag {
++ jint actionsCount; // number of actions to do
++ AccessibleActionInfo actions[MAX_ACTIONS_TO_DO];// the accessible actions to do
++ } AccessibleActionsToDo;
++
++ // struct for sending an message to do one or more actions
++ typedef struct DoAccessibleActionsPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 accessibleContext; // component to do the action
++ AccessibleActionsToDo actionsToDo; // the accessible actions to do
++ BOOL rResult; // action return value
++ jint failure; // index of action that failed if rResult is FALSE
++ } DoAccessibleActionsPackage;
++
++ /**
++******************************************************
++* AccessibleText packages
++******************************************************
++*/
++
++ typedef struct GetAccessibleTextInfoPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint x;
++ jint y;
++ AccessibleTextInfo rTextInfo;
++ } GetAccessibleTextInfoPackage;
++
++ typedef struct GetAccessibleTextItemsPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ AccessibleTextItemsInfo rTextItemsInfo;
++ } GetAccessibleTextItemsPackage;
++
++ typedef struct GetAccessibleTextSelectionInfoPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ AccessibleTextSelectionInfo rTextSelectionItemsInfo;
++ } GetAccessibleTextSelectionInfoPackage;
++
++ typedef struct GetAccessibleTextAttributeInfoPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ AccessibleTextAttributesInfo rAttributeInfo;
++ } GetAccessibleTextAttributeInfoPackage;
++
++ typedef struct GetAccessibleTextRectInfoPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ AccessibleTextRectInfo rTextRectInfo;
++ } GetAccessibleTextRectInfoPackage;
++
++ typedef struct GetCaretLocationPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ AccessibleTextRectInfo rTextRectInfo;
++ } GetCaretLocationPackage;
++
++ typedef struct GetAccessibleTextLineBoundsPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ jint rLineStart;
++ jint rLineEnd;
++ } GetAccessibleTextLineBoundsPackage;
++
++ typedef struct GetAccessibleTextRangePackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint start;
++ jint end;
++ wchar_t rText[MAX_BUFFER_SIZE];
++ } GetAccessibleTextRangePackage;
++
++ /**
++******************************************************
++*
++* Utility method packages
++******************************************************
++*/
++
++ typedef struct SetTextContentsPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext; // the text field
++ wchar_t text[MAX_STRING_SIZE]; // the text
++ BOOL rResult;
++ } SetTextContentsPackage;
++
++ typedef struct GetParentWithRolePackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ wchar_t role[SHORT_STRING_SIZE]; // one of Accessible Roles above
++ JOBJECT64 rAccessibleContext;
++ } GetParentWithRolePackage;
++
++ typedef struct GetTopLevelObjectPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ JOBJECT64 rAccessibleContext;
++ } GetTopLevelObjectPackage;
++
++ typedef struct GetParentWithRoleElseRootPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ wchar_t role[SHORT_STRING_SIZE]; // one of Accessible Roles above
++ JOBJECT64 rAccessibleContext;
++ } GetParentWithRoleElseRootPackage;
++
++ typedef struct GetObjectDepthPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ jint rResult;
++ } GetObjectDepthPackage;
++
++ typedef struct GetActiveDescendentPackageTag {
++ long vmID;
++ JOBJECT64 accessibleContext;
++ JOBJECT64 rAccessibleContext;
++ } GetActiveDescendentPackage;
++
++ /**
++******************************************************
++* AccessibleValue packages
++******************************************************
++*/
++
++ typedef struct GetCurrentAccessibleValueFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ wchar_t rValue[SHORT_STRING_SIZE];
++ } GetCurrentAccessibleValueFromContextPackage;
++
++ typedef struct GetMaximumAccessibleValueFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ wchar_t rValue[SHORT_STRING_SIZE];
++ } GetMaximumAccessibleValueFromContextPackage;
++
++ typedef struct GetMinimumAccessibleValueFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ wchar_t rValue[SHORT_STRING_SIZE];
++ } GetMinimumAccessibleValueFromContextPackage;
++
++
++ /**
++******************************************************
++* AccessibleSelection packages
++******************************************************
++*/
++
++ typedef struct AddAccessibleSelectionFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ } AddAccessibleSelectionFromContextPackage;
++
++ typedef struct ClearAccessibleSelectionFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ } ClearAccessibleSelectionFromContextPackage;
++
++ typedef struct GetAccessibleSelectionFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ JOBJECT64 rAccessibleContext;
++ } GetAccessibleSelectionFromContextPackage;
++
++ typedef struct GetAccessibleSelectionCountFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint rCount;
++ } GetAccessibleSelectionCountFromContextPackage;
++
++ typedef struct IsAccessibleChildSelectedFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ jboolean rResult;
++ } IsAccessibleChildSelectedFromContextPackage;
++
++ typedef struct RemoveAccessibleSelectionFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ jint index;
++ } RemoveAccessibleSelectionFromContextPackage;
++
++ typedef struct SelectAllAccessibleSelectionFromContextPackageTag {
++ long vmID;
++ JOBJECT64 AccessibleContext;
++ } SelectAllAccessibleSelectionFromContextPackage;
++
++
++ /**
++******************************************************
++* Java Event Notification Registration packages
++******************************************************
++*/
++
++ typedef struct AddJavaEventNotificationPackageTag {
++ jlong type;
++ //HWND DLLwindow;
++ ABHWND64 DLLwindow;
++ } AddJavaEventNotificationPackage;
++
++ typedef struct RemoveJavaEventNotificationPackageTag {
++ jlong type;
++ //HWND DLLwindow;
++ ABHWND64 DLLwindow;
++ } RemoveJavaEventNotificationPackage;
++
++
++ /**
++******************************************************
++* Accessibility Event Notification Registration packages
++******************************************************
++*/
++
++ typedef struct AddAccessibilityEventNotificationPackageTag {
++ jlong type;
++ //HWND DLLwindow;
++ ABHWND64 DLLwindow;
++ } AddAccessibilityEventNotificationPackage;
++
++ typedef struct RemoveAccessibilityEventNotificationPackageTag {
++ jlong type;
++ //HWND DLLwindow;
++ ABHWND64 DLLwindow;
++ } RemoveAccessibilityEventNotificationPackage;
++
++
++ /**
++******************************************************
++* Accessibility Property Change Event packages
++******************************************************
++*/
++
++ typedef struct PropertyCaretChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ jint oldPosition;
++ jint newPosition;
++ } PropertyCaretChangePackage;
++
++ typedef struct PropertyDescriptionChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ wchar_t oldDescription[SHORT_STRING_SIZE];
++ wchar_t newDescription[SHORT_STRING_SIZE];
++ } PropertyDescriptionChangePackage;
++
++ typedef struct PropertyNameChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ wchar_t oldName[SHORT_STRING_SIZE];
++ wchar_t newName[SHORT_STRING_SIZE];
++ } PropertyNameChangePackage;
++
++ typedef struct PropertySelectionChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } PropertySelectionChangePackage;
++
++ typedef struct PropertyStateChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ wchar_t oldState[SHORT_STRING_SIZE];
++ wchar_t newState[SHORT_STRING_SIZE];
++ } PropertyStateChangePackage;
++
++ typedef struct PropertyTextChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } PropertyTextChangePackage;
++
++ typedef struct PropertyValueChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ wchar_t oldValue[SHORT_STRING_SIZE];
++ wchar_t newValue[SHORT_STRING_SIZE];
++ } PropertyValueChangePackage;
++
++ typedef struct PropertyVisibleDataChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } PropertyVisibleDataChangePackage;
++
++ typedef struct PropertyChildChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ JOBJECT64 oldChildAccessibleContext;
++ JOBJECT64 newChildAccessibleContext;
++ } PropertyChildChangePackage;
++
++ typedef struct PropertyActiveDescendentChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ JOBJECT64 oldActiveDescendentAccessibleContext;
++ JOBJECT64 newActiveDescendentAccessibleContext;
++ } PropertyActiveDescendentChangePackage;
++
++
++ // String format for newValue is:
++ // "type" one of "INSERT", "UPDATE" or "DELETE"
++ // "firstRow"
++ // "lastRow"
++ // "firstColumn"
++ // "lastColumn"
++ //
++ // oldValue is currently unused
++ //
++ typedef struct PropertyTableModelChangePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ wchar_t oldValue[SHORT_STRING_SIZE];
++ wchar_t newValue[SHORT_STRING_SIZE];
++ } PropertyTableModelChangePackage;
++
++
++ /**
++******************************************************
++* Property Change Event packages
++******************************************************
++*/
++
++ /*
++ typedef struct PropertyChangePackageTag {
++ long vmID;
++ jobject Event;
++ jobject AccessibleContextSource;
++ char propertyName[SHORT_STRING_SIZE];
++ char oldValue[SHORT_STRING_SIZE]; // PropertyChangeEvent().getOldValue().toString()
++ char newValue[SHORT_STRING_SIZE]; // PropertyChangeEvent().getNewValue().toString()
++ } PropertyChangePackage;
++ */
++
++ /*
++ * Java shutdown event package
++ */
++ typedef struct JavaShutdownPackageTag {
++ long vmID;
++ } JavaShutdownPackage;
++
++
++ /**
++******************************************************
++* Focus Event packages
++******************************************************
++*/
++
++ typedef struct FocusGainedPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } FocusGainedPackage;
++
++ typedef struct FocusLostPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } FocusLostPackage;
++
++
++ /**
++******************************************************
++* Caret Event packages
++******************************************************
++*/
++
++ typedef struct CaretUpdatePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } CaretUpdatePackage;
++
++
++ /**
++******************************************************
++* Mouse Event packages
++******************************************************
++*/
++
++ typedef struct MouseClickedPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } MouseClickedPackage;
++
++ typedef struct MouseEnteredPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } MouseEnteredPackage;
++
++ typedef struct MouseExitedPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } MouseExitedPackage;
++
++ typedef struct MousePressedPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } MousePressedPackage;
++
++ typedef struct MouseReleasedPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } MouseReleasedPackage;
++
++
++ /**
++******************************************************
++* Menu/PopupMenu Event packages
++******************************************************
++*/
++
++ typedef struct MenuCanceledPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } MenuCanceledPackage;
++
++ typedef struct MenuDeselectedPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } MenuDeselectedPackage;
++
++ typedef struct MenuSelectedPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } MenuSelectedPackage;
++
++
++ typedef struct PopupMenuCanceledPackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } PopupMenuCanceledPackage;
++
++ typedef struct PopupMenuWillBecomeInvisiblePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } PopupMenuWillBecomeInvisiblePackage;
++
++ typedef struct PopupMenuWillBecomeVisiblePackageTag {
++ long vmID;
++ JOBJECT64 Event;
++ JOBJECT64 AccessibleContextSource;
++ } PopupMenuWillBecomeVisiblePackage;
++
++ /**
++******************************************************
++* Additional methods for Teton
++******************************************************
++*/
++
++ /**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
++ * whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++ typedef struct GetVirtualAccessibleNamePackageTag {
++ long vmID;
++ AccessibleContext accessibleContext;
++ wchar_t rName[MAX_STRING_SIZE];
++ int len;
++ } GetVirtualAccessibleNamePackage;
++
++ /**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++ typedef struct RequestFocusPackageTag {
++ long vmID;
++ AccessibleContext accessibleContext;
++ } RequestFocusPackage;
++
++ /**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++ typedef struct SelectTextRangePackageTag {
++ long vmID;
++ AccessibleContext accessibleContext;
++ jint startIndex;
++ jint endIndex;
++ } SelectTextRangePackage;
++
++ /**
++ * Gets the number of contiguous characters with the same attributes.
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++ typedef struct GetTextAttributesInRangePackageTag {
++ long vmID;
++ AccessibleContext accessibleContext;
++ jint startIndex; // start index (inclusive)
++ jint endIndex; // end index (inclusive)
++ AccessibleTextAttributesInfo attributes; // character attributes to match
++ short rLength; // number of contiguous characters with matching attributes
++ } GetTextAttributesInRangePackage;
++
++#define MAX_VISIBLE_CHILDREN 256
++
++ // visible children information
++ typedef struct VisibleChildenInfoTag {
++ int returnedChildrenCount; // number of children returned
++ AccessibleContext children[MAX_VISIBLE_CHILDREN]; // the visible children
++ } VisibleChildrenInfo;
++
++ // struct for sending a message to get the number of visible children
++ typedef struct GetVisibleChildrenCountPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 accessibleContext; // AccessibleContext of parent component
++ jint rChildrenCount; // visible children count return value
++ } GetVisibleChildrenCountPackage;
++
++ // struct for sending a message to get the hypertext for an AccessibleContext
++ // starting at a specified index in the document
++ typedef struct GetVisibleChildrenPackageTag {
++ long vmID; // the virtual machine ID
++ JOBJECT64 accessibleContext; // AccessibleContext of parent component
++ jint startIndex; // start index for retrieving children
++ VisibleChildrenInfo rVisibleChildrenInfo; // returned info
++ BOOL rSuccess; // whether call succeeded
++ } GetVisibleChildrenPackage;
++
++ /**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++ typedef struct SetCaretPositionPackageTag {
++ long vmID;
++ AccessibleContext accessibleContext;
++ jint position;
++ } SetCaretPositionPackage;
++
++
++ /**
++ ******************************************************
++ * Wrapping up all of the packages
++ ******************************************************
++ */
++
++ /**
++ * What is the type of this package
++ */
++ typedef enum PackageType {
++
++ cMemoryMappedFileCreatedPackage = 0x11000,
++
++ // many of these will go away...
++ cJavaVMCreatedPackage = 0x10000,
++ cJavaVMDestroyedPackage,
++ cWindowsATCreatedPackage,
++ cWindowsATDestroyedPackage,
++ cJavaVMPresentNotificationPackage,
++ cWindowsATPresentNotificationPackage,
++
++ cReleaseJavaObjectPackage = 1,
++ cGetAccessBridgeVersionPackage = 2,
++
++ cGetAccessibleContextFromHWNDPackage = 0x10,
++ cIsJavaWindowPackage,
++ cGetHWNDFromAccessibleContextPackage,
++
++ cGetAccessibleContextAtPackage = 0x100,
++ cGetAccessibleContextWithFocusPackage,
++ cGetAccessibleContextInfoPackage,
++ cGetAccessibleChildFromContextPackage,
++ cGetAccessibleParentFromContextPackage,
++ cIsSameObjectPackage,
++
++ cGetAccessibleTextInfoPackage = 0x200,
++ cGetAccessibleTextItemsPackage,
++ cGetAccessibleTextSelectionInfoPackage,
++ cGetAccessibleTextAttributeInfoPackage,
++ cGetAccessibleTextRectInfoPackage,
++ cGetAccessibleTextLineBoundsPackage,
++ cGetAccessibleTextRangePackage,
++
++ cGetCurrentAccessibleValueFromContextPackage = 0x300,
++ cGetMaximumAccessibleValueFromContextPackage,
++ cGetMinimumAccessibleValueFromContextPackage,
++
++ cAddAccessibleSelectionFromContextPackage = 0x400,
++ cClearAccessibleSelectionFromContextPackage,
++ cGetAccessibleSelectionFromContextPackage,
++ cGetAccessibleSelectionCountFromContextPackage,
++ cIsAccessibleChildSelectedFromContextPackage,
++ cRemoveAccessibleSelectionFromContextPackage,
++ cSelectAllAccessibleSelectionFromContextPackage,
++
++ cAddJavaEventNotificationPackage = 0x900,
++ cRemoveJavaEventNotificationPackage,
++ cAddAccessibilityEventNotificationPackage,
++ cRemoveAccessibilityEventNotificationPackage,
++
++ cPropertyChangePackage = 0x1000,
++
++ cJavaShutdownPackage = 0x1010,
++ cFocusGainedPackage,
++ cFocusLostPackage,
++
++ cCaretUpdatePackage = 0x1020,
++
++ cMouseClickedPackage = 0x1030,
++ cMouseEnteredPackage,
++ cMouseExitedPackage,
++ cMousePressedPackage,
++ cMouseReleasedPackage,
++
++ cMenuCanceledPackage = 0x1040,
++ cMenuDeselectedPackage,
++ cMenuSelectedPackage,
++ cPopupMenuCanceledPackage,
++ cPopupMenuWillBecomeInvisiblePackage,
++ cPopupMenuWillBecomeVisiblePackage,
++
++ cPropertyCaretChangePackage = 0x1100,
++ cPropertyDescriptionChangePackage,
++ cPropertyNameChangePackage,
++ cPropertySelectionChangePackage,
++ cPropertyStateChangePackage,
++ cPropertyTextChangePackage,
++ cPropertyValueChangePackage,
++ cPropertyVisibleDataChangePackage,
++ cPropertyChildChangePackage,
++ cPropertyActiveDescendentChangePackage,
++
++
++ // AccessibleTable
++ cGetAccessibleTableInfoPackage = 0x1200,
++ cGetAccessibleTableCellInfoPackage,
++
++ cGetAccessibleTableRowHeaderPackage,
++ cGetAccessibleTableColumnHeaderPackage,
++
++ cGetAccessibleTableRowDescriptionPackage,
++ cGetAccessibleTableColumnDescriptionPackage,
++
++ cGetAccessibleTableRowSelectionCountPackage,
++ cIsAccessibleTableRowSelectedPackage,
++ cGetAccessibleTableRowSelectionsPackage,
++
++ cGetAccessibleTableColumnSelectionCountPackage,
++ cIsAccessibleTableColumnSelectedPackage,
++ cGetAccessibleTableColumnSelectionsPackage,
++
++ cGetAccessibleTableRowPackage,
++ cGetAccessibleTableColumnPackage,
++ cGetAccessibleTableIndexPackage,
++
++ cPropertyTableModelChangePackage,
++
++
++ // AccessibleRelationSet
++ cGetAccessibleRelationSetPackage = 0x1300,
++
++ // AccessibleHypertext
++ cGetAccessibleHypertextPackage = 0x1400,
++ cActivateAccessibleHyperlinkPackage,
++ cGetAccessibleHyperlinkCountPackage,
++ cGetAccessibleHypertextExtPackage,
++ cGetAccessibleHypertextLinkIndexPackage,
++ cGetAccessibleHyperlinkPackage,
++
++ // Accessible KeyBinding, Icon and Action
++ cGetAccessibleKeyBindingsPackage = 0x1500,
++ cGetAccessibleIconsPackage,
++ cGetAccessibleActionsPackage,
++ cDoAccessibleActionsPackage,
++
++ // Utility methods
++ cSetTextContentsPackage = 0x1600,
++ cGetParentWithRolePackage,
++ cGetTopLevelObjectPackage,
++ cGetParentWithRoleElseRootPackage,
++ cGetObjectDepthPackage,
++ cGetActiveDescendentPackage,
++
++ // Additional methods for Teton
++ cGetVirtualAccessibleNamePackage = 0x1700,
++ cRequestFocusPackage,
++ cSelectTextRangePackage,
++ cGetTextAttributesInRangePackage,
++ cGetSameTextAttributesInRangePackage,
++ cGetVisibleChildrenCountPackage,
++ cGetVisibleChildrenPackage,
++ cSetCaretPositionPackage,
++ cGetCaretLocationPackage
++
++
++ } PackageType;
++
++
++ /**
++ * Union of all package contents
++ */
++ typedef union AllPackagesTag {
++
++ // Initial Rendezvous packages
++ MemoryMappedFileCreatedPackage memoryMappedFileCreatedPackage;
++
++ JavaVMCreatedPackage javaVMCreatedPackage;
++ JavaVMDestroyedPackage javaVMDestroyedPackage;
++ WindowsATCreatedPackage windowsATCreatedPackage;
++ WindowsATDestroyedPackage windowsATDestroyedPackage;
++ JavaVMPresentNotificationPackage javaVMPresentNotificationPackage;
++ WindowsATPresentNotificationPackage windowsATPresentNotificationPackage;
++
++ // Core packages
++ ReleaseJavaObjectPackage releaseJavaObject;
++ GetAccessBridgeVersionPackage getAccessBridgeVersion;
++
++ // Window packages
++ GetAccessibleContextFromHWNDPackage getAccessibleContextFromHWND;
++ GetHWNDFromAccessibleContextPackage getHWNDFromAccessibleContext;
++
++ // AccessibleContext packages
++ GetAccessibleContextAtPackage getAccessibleContextAt;
++ GetAccessibleContextWithFocusPackage getAccessibleContextWithFocus;
++ GetAccessibleContextInfoPackage getAccessibleContextInfo;
++ GetAccessibleChildFromContextPackage getAccessibleChildFromContext;
++ GetAccessibleParentFromContextPackage getAccessibleParentFromContext;
++
++ // AccessibleText packages
++ GetAccessibleTextInfoPackage getAccessibleTextInfo;
++ GetAccessibleTextItemsPackage getAccessibleTextItems;
++ GetAccessibleTextSelectionInfoPackage getAccessibleTextSelectionInfo;
++ GetAccessibleTextAttributeInfoPackage getAccessibleTextAttributeInfo;
++ GetAccessibleTextRectInfoPackage getAccessibleTextRectInfo;
++ GetAccessibleTextLineBoundsPackage getAccessibleTextLineBounds;
++ GetAccessibleTextRangePackage getAccessibleTextRange;
++
++ // AccessibleValue packages
++ GetCurrentAccessibleValueFromContextPackage getCurrentAccessibleValueFromContext;
++ GetMaximumAccessibleValueFromContextPackage getMaximumAccessibleValueFromContext;
++ GetMinimumAccessibleValueFromContextPackage getMinimumAccessibleValueFromContext;
++
++ // AccessibleSelection packages
++ AddAccessibleSelectionFromContextPackage addAccessibleSelectionFromContext;
++ ClearAccessibleSelectionFromContextPackage clearAccessibleSelectionFromContext;
++ GetAccessibleSelectionFromContextPackage getAccessibleSelectionFromContext;
++ GetAccessibleSelectionCountFromContextPackage getAccessibleSelectionCountFromContext;
++ IsAccessibleChildSelectedFromContextPackage isAccessibleChildSelectedFromContext;
++ RemoveAccessibleSelectionFromContextPackage removeAccessibleSelectionFromContext;
++ SelectAllAccessibleSelectionFromContextPackage selectAllAccessibleSelectionFromContext;
++
++ // Event Notification Registration packages
++ AddJavaEventNotificationPackage addJavaEventNotification;
++ RemoveJavaEventNotificationPackage removeJavaEventNotification;
++ AddAccessibilityEventNotificationPackage addAccessibilityEventNotification;
++ RemoveAccessibilityEventNotificationPackage removeAccessibilityEventNotification;
++
++ // Event contents packages
++ // PropertyChangePackage propertyChange;
++ PropertyCaretChangePackage propertyCaretChangePackage;
++ PropertyDescriptionChangePackage propertyDescriptionChangePackage;
++ PropertyNameChangePackage propertyNameChangePackage;
++ PropertySelectionChangePackage propertySelectionChangePackage;
++ PropertyStateChangePackage propertyStateChangePackage;
++ PropertyTextChangePackage propertyTextChangePackage;
++ PropertyValueChangePackage propertyValueChangePackage;
++ PropertyVisibleDataChangePackage propertyVisibleDataChangePackage;
++ PropertyChildChangePackage propertyChildChangePackage;
++ PropertyActiveDescendentChangePackage propertyActiveDescendentChangePackage;
++
++ PropertyTableModelChangePackage propertyTableModelChangePackage;
++
++ JavaShutdownPackage JavaShutdown;
++ FocusGainedPackage focusGained;
++ FocusLostPackage focusLost;
++
++ CaretUpdatePackage caretUpdate;
++
++ MouseClickedPackage mouseClicked;
++ MouseEnteredPackage mouseEntered;
++ MouseExitedPackage mouseExited;
++ MousePressedPackage mousePressed;
++ MouseReleasedPackage mouseReleased;
++
++ MenuCanceledPackage menuCanceled;
++ MenuDeselectedPackage menuDeselected;
++ MenuSelectedPackage menuSelected;
++ PopupMenuCanceledPackage popupMenuCanceled;
++ PopupMenuWillBecomeInvisiblePackage popupMenuWillBecomeInvisible;
++ PopupMenuWillBecomeVisiblePackage popupMenuWillBecomeVisible;
++
++ // AccessibleRelationSet
++ GetAccessibleRelationSetPackage getAccessibleRelationSet;
++
++ // AccessibleHypertext
++ GetAccessibleHypertextPackage _getAccessibleHypertext;
++ ActivateAccessibleHyperlinkPackage _activateAccessibleHyperlink;
++ GetAccessibleHyperlinkCountPackage _getAccessibleHyperlinkCount;
++ GetAccessibleHypertextExtPackage _getAccessibleHypertextExt;
++ GetAccessibleHypertextLinkIndexPackage _getAccessibleHypertextLinkIndex;
++ GetAccessibleHyperlinkPackage _getAccessibleHyperlink;
++
++ // Accessible KeyBinding, Icon and Action
++ GetAccessibleKeyBindingsPackage getAccessibleKeyBindings;
++ GetAccessibleIconsPackage getAccessibleIcons;
++ GetAccessibleActionsPackage getAccessibleActions;
++ DoAccessibleActionsPackage doAccessibleActions;
++
++ // utility methods
++ SetTextContentsPackage _setTextContents;
++ GetParentWithRolePackage _getParentWithRole;
++ GetTopLevelObjectPackage _getTopLevelObject;
++ GetParentWithRoleElseRootPackage _getParentWithRoleElseRoot;
++ GetObjectDepthPackage _getObjectDepth;
++ GetActiveDescendentPackage _getActiveDescendent;
++
++ // Additional methods for Teton
++ GetVirtualAccessibleNamePackage _getVirtualAccessibleName;
++ RequestFocusPackage _requestFocus;
++ SelectTextRangePackage _selectTextRange;
++ GetTextAttributesInRangePackage _getTextAttributesInRange;
++ GetVisibleChildrenCountPackage _getVisibleChildrenCount;
++ GetVisibleChildrenPackage _getVisibleChildren;
++ SetCaretPositionPackage _setCaretPosition;
++
++ } AllPackages;
++
++
++ /**
++ * Union of all Java-initiated package contents
++ */
++ typedef union JavaInitiatedPackagesTag {
++
++ // Initial Rendezvous packages
++ JavaVMCreatedPackage javaVMCreatedPackage;
++ JavaVMDestroyedPackage javaVMDestroyedPackage;
++ JavaVMPresentNotificationPackage javaVMPresentNotificationPackage;
++
++ // Event contents packages
++ PropertyCaretChangePackage propertyCaretChangePackage;
++ PropertyDescriptionChangePackage propertyDescriptionChangePackage;
++ PropertyNameChangePackage propertyNameChangePackage;
++ PropertySelectionChangePackage propertySelectionChangePackage;
++ PropertyStateChangePackage propertyStateChangePackage;
++ PropertyTextChangePackage propertyTextChangePackage;
++ PropertyValueChangePackage propertyValueChangePackage;
++ PropertyVisibleDataChangePackage propertyVisibleDataChangePackage;
++ PropertyChildChangePackage propertyChildChangePackage;
++ PropertyActiveDescendentChangePackage propertyActiveDescendentChangePackage;
++
++ PropertyTableModelChangePackage propertyTableModelChangePackage;
++
++ JavaShutdownPackage JavaShutdown;
++ FocusGainedPackage focusGained;
++ FocusLostPackage focusLost;
++
++ CaretUpdatePackage caretUpdate;
++
++ MouseClickedPackage mouseClicked;
++ MouseEnteredPackage mouseEntered;
++ MouseExitedPackage mouseExited;
++ MousePressedPackage mousePressed;
++ MouseReleasedPackage mouseReleased;
++
++ MenuCanceledPackage menuCanceled;
++ MenuDeselectedPackage menuDeselected;
++ MenuSelectedPackage menuSelected;
++ PopupMenuCanceledPackage popupMenuCanceled;
++ PopupMenuWillBecomeInvisiblePackage popupMenuWillBecomeInvisible;
++ PopupMenuWillBecomeVisiblePackage popupMenuWillBecomeVisible;
++
++ } JavaInitiatedPackages;
++
++
++ /**
++ * Union of all Windows-initiated package contents
++ */
++ typedef union WindowsInitiatedPackagesTag {
++
++ // Initial Rendezvous packages
++ MemoryMappedFileCreatedPackage memoryMappedFileCreatedPackage;
++
++ WindowsATCreatedPackage windowsATCreatedPackage;
++ WindowsATDestroyedPackage windowsATDestroyedPackage;
++ WindowsATPresentNotificationPackage windowsATPresentNotificationPackage;
++
++ // Core packages
++ ReleaseJavaObjectPackage releaseJavaObject;
++ GetAccessBridgeVersionPackage getAccessBridgeVersion;
++
++ // Window packages
++ GetAccessibleContextFromHWNDPackage getAccessibleContextFromHWND;
++ GetHWNDFromAccessibleContextPackage getHWNDFromAccessibleContext;
++
++ // AccessibleContext packages
++ GetAccessibleContextAtPackage getAccessibleContextAt;
++ GetAccessibleContextWithFocusPackage getAccessibleContextWithFocus;
++ GetAccessibleContextInfoPackage getAccessibleContextInfo;
++ GetAccessibleChildFromContextPackage getAccessibleChildFromContext;
++ GetAccessibleParentFromContextPackage getAccessibleParentFromContext;
++
++ // AccessibleText packages
++ GetAccessibleTextInfoPackage getAccessibleTextInfo;
++ GetAccessibleTextItemsPackage getAccessibleTextItems;
++ GetAccessibleTextSelectionInfoPackage getAccessibleTextSelectionInfo;
++ GetAccessibleTextAttributeInfoPackage getAccessibleTextAttributeInfo;
++ GetAccessibleTextRectInfoPackage getAccessibleTextRectInfo;
++ GetAccessibleTextLineBoundsPackage getAccessibleTextLineBounds;
++ GetAccessibleTextRangePackage getAccessibleTextRange;
++
++ // AccessibleValue packages
++ GetCurrentAccessibleValueFromContextPackage getCurrentAccessibleValueFromContext;
++ GetMaximumAccessibleValueFromContextPackage getMaximumAccessibleValueFromContext;
++ GetMinimumAccessibleValueFromContextPackage getMinimumAccessibleValueFromContext;
++
++ // AccessibleSelection packages
++ AddAccessibleSelectionFromContextPackage addAccessibleSelectionFromContext;
++ ClearAccessibleSelectionFromContextPackage clearAccessibleSelectionFromContext;
++ GetAccessibleSelectionFromContextPackage getAccessibleSelectionFromContext;
++ GetAccessibleSelectionCountFromContextPackage getAccessibleSelectionCountFromContext;
++ IsAccessibleChildSelectedFromContextPackage isAccessibleChildSelectedFromContext;
++ RemoveAccessibleSelectionFromContextPackage removeAccessibleSelectionFromContext;
++ SelectAllAccessibleSelectionFromContextPackage selectAllAccessibleSelectionFromContext;
++
++ // Event Notification Registration packages
++ AddJavaEventNotificationPackage addJavaEventNotification;
++ RemoveJavaEventNotificationPackage removeJavaEventNotification;
++ AddAccessibilityEventNotificationPackage addAccessibilityEventNotification;
++ RemoveAccessibilityEventNotificationPackage removeAccessibilityEventNotification;
++
++ // AccessibleTable
++ GetAccessibleTableInfoPackage _getAccessibleTableInfo;
++ GetAccessibleTableCellInfoPackage _getAccessibleTableCellInfo;
++
++ GetAccessibleTableRowHeaderPackage _getAccessibleTableRowHeader;
++ GetAccessibleTableColumnHeaderPackage _getAccessibleTableColumnHeader;
++
++ GetAccessibleTableRowDescriptionPackage _getAccessibleTableRowDescription;
++ GetAccessibleTableColumnDescriptionPackage _getAccessibleTableColumnDescription;
++
++ GetAccessibleTableRowSelectionCountPackage _getAccessibleTableRowSelectionCount;
++ IsAccessibleTableRowSelectedPackage _isAccessibleTableRowSelected;
++ GetAccessibleTableRowSelectionsPackage _getAccessibleTableRowSelections;
++
++ GetAccessibleTableColumnSelectionCountPackage _getAccessibleTableColumnSelectionCount;
++ IsAccessibleTableColumnSelectedPackage _isAccessibleTableColumnSelected;
++ GetAccessibleTableColumnSelectionsPackage _getAccessibleTableColumnSelections;
++
++ GetAccessibleTableRowPackage _getAccessibleTableRow;
++ GetAccessibleTableColumnPackage _getAccessibleTableColumn;
++ GetAccessibleTableIndexPackage _getAccessibleTableIndex;
++
++ // AccessibleRelationSet
++ GetAccessibleRelationSetPackage _getAccessibleRelationSet;
++
++ // Accessible KeyBindings, Icons and Actions
++ GetAccessibleKeyBindingsPackage _getAccessibleKeyBindings;
++ GetAccessibleIconsPackage _getAccessibleIcons;
++ GetAccessibleActionsPackage _getAccessibleActions;
++ DoAccessibleActionsPackage _doAccessibleActions;
++
++
++ IsSameObjectPackage _isSameObject;
++
++ // utility methods
++ SetTextContentsPackage _setTextContents;
++ GetParentWithRolePackage _getParentWithRole;
++ GetTopLevelObjectPackage _getTopLevelObject;
++ GetParentWithRoleElseRootPackage _getParentWithRoleElseRoot;
++ GetObjectDepthPackage _getObjectDepth;
++ GetActiveDescendentPackage _getActiveDescendent;
++
++ // Additional methods for Teton
++ GetVirtualAccessibleNamePackage _getVirtualAccessibleName;
++ RequestFocusPackage _requestFocus;
++ SelectTextRangePackage _selectTextRange;
++ GetTextAttributesInRangePackage _getTextAttributesInRange;
++ GetVisibleChildrenCountPackage _getVisibleChildrenCount;
++ GetVisibleChildrenPackage _getVisibleChildren;
++ SetCaretPositionPackage _setCaretPosition;
++
++
++ } WindowsInitiatedPackages;
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeStatusWindow.RC Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,175 @@
++//Microsoft Developer Studio generated resource script.
++//
++#include "resource.h"
++#include "accessBridgeResource.h"
++
++#define XSTR(x) STR(x)
++#define STR(x) #x
++
++#define APSTUDIO_READONLY_SYMBOLS
++/////////////////////////////////////////////////////////////////////////////
++//
++// Generated from the TEXTINCLUDE 2 resource.
++//
++#define APSTUDIO_HIDDEN_SYMBOLS
++#include "windows.h"
++#undef APSTUDIO_HIDDEN_SYMBOLS
++
++/////////////////////////////////////////////////////////////////////////////
++#undef APSTUDIO_READONLY_SYMBOLS
++
++/////////////////////////////////////////////////////////////////////////////
++// English (U.S.) resources
++
++#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
++#ifdef _WIN32
++LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
++#pragma code_page(1252)
++#endif //_WIN32
++
++/////////////////////////////////////////////////////////////////////////////
++//
++// Dialog
++//
++
++ACCESSBRIDGESTATUSWINDOW DIALOGEX 160, 78, 209, 163
++STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
++EXSTYLE WS_EX_CLIENTEDGE
++CAPTION "Access Bridge status"
++FONT 8, "MS Sans Serif", 0, 0, 0x1
++BEGIN
++ EDITTEXT cVMID,67,23,121,13,ES_READONLY
++ EDITTEXT cStatusText,40,147,162,13,ES_READONLY
++ LTEXT "Java VM ID:",IDC_STATIC,23,25,40,8
++ LTEXT "Status:",IDC_STATIC,11,149,23,8
++ EDITTEXT cWindowsID,67,39,121,13,ES_READONLY
++ LTEXT "Windows ID:",IDC_STATIC,21,41,42,8
++ EDITTEXT cCallInfo,12,65,184,75,ES_MULTILINE | ES_AUTOVSCROLL |
++ ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL
++ GROUPBOX "Call info",IDC_STATIC,4,55,197,90
++ EDITTEXT cInvokedByText,67,1,121,13,ES_READONLY
++ LTEXT "Invoked by:",IDC_STATIC,25,3,38,8
++END
++
++IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95
++STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
++CAPTION "Dialog"
++FONT 8, "MS Sans Serif"
++BEGIN
++ DEFPUSHBUTTON "OK",IDOK,129,7,50,14
++ PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
++END
++
++
++#ifdef APSTUDIO_INVOKED
++/////////////////////////////////////////////////////////////////////////////
++//
++// TEXTINCLUDE
++//
++
++1 TEXTINCLUDE DISCARDABLE
++BEGIN
++ "resource.h\0"
++END
++
++2 TEXTINCLUDE DISCARDABLE
++BEGIN
++ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
++ "#include ""windows.h""\r\n"
++ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
++ "\0"
++END
++
++3 TEXTINCLUDE DISCARDABLE
++BEGIN
++ "\r\n"
++ "\0"
++END
++
++#endif // APSTUDIO_INVOKED
++
++
++/////////////////////////////////////////////////////////////////////////////
++//
++// DESIGNINFO
++//
++
++#ifdef APSTUDIO_INVOKED
++GUIDELINES DESIGNINFO DISCARDABLE
++BEGIN
++ "ACCESSBRIDGESTATUSWINDOW", DIALOG
++ BEGIN
++ LEFTMARGIN, 4
++ RIGHTMARGIN, 202
++ BOTTOMMARGIN, 160
++ END
++
++ "IDD_DIALOG1", DIALOG
++ BEGIN
++ LEFTMARGIN, 7
++ RIGHTMARGIN, 179
++ TOPMARGIN, 7
++ BOTTOMMARGIN, 88
++ END
++END
++#endif // APSTUDIO_INVOKED
++
++
++#ifndef _MAC
++/////////////////////////////////////////////////////////////////////////////
++//
++// Version
++//
++
++VS_VERSION_INFO VERSIONINFO
++ FILEVERSION JDK_FVER
++ PRODUCTVERSION JDK_FVER
++ FILEFLAGSMASK 0x3fL
++#ifdef DEBUG
++ FILEFLAGS 0x1L
++#else
++ FILEFLAGS 0x0L
++#endif
++ FILEOS 0x40004L
++ FILETYPE JDK_FTYPE
++ FILESUBTYPE 0x0L
++BEGIN
++ BLOCK "StringFileInfo"
++ BEGIN
++ BLOCK "040904b0"
++ BEGIN
++ VALUE "Comments", "Java Access Bridge\0"
++ VALUE "CompanyName", XSTR(JDK_COMPANY) "\0"
++ VALUE "FileDescription", XSTR(JDK_COMPONENT) "\0"
++ VALUE "FileVersion", XSTR(JDK_VER) "\0"
++ VALUE "Full Version", XSTR(JDK_BUILD_ID) "\0"
++ VALUE "InternalName", XSTR(JDK_INTERNAL_NAME) "\0"
++ VALUE "LegalCopyright", XSTR(JDK_COPYRIGHT) "\0"
++ VALUE "OriginalFilename", XSTR(JDK_FNAME) "\0"
++ VALUE "ProductName", XSTR(JDK_NAME) "\0"
++ VALUE "ProductVersion", XSTR(JDK_VER) "\0"
++ END
++ END
++ BLOCK "VarFileInfo"
++ BEGIN
++ VALUE "Translation", 0x409, 1200
++ END
++END
++
++#endif // !_MAC
++
++#endif // English (U.S.) resources
++/////////////////////////////////////////////////////////////////////////////
++
++
++
++#ifndef APSTUDIO_INVOKED
++/////////////////////////////////////////////////////////////////////////////
++//
++// Generated from the TEXTINCLUDE 3 resource.
++//
++
++
++/////////////////////////////////////////////////////////////////////////////
++#endif // not APSTUDIO_INVOKED
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeWindowsEntryPoints.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,856 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * Glue routines called by Windows AT into the WindowsAccessBridge dll
++ */
++
++#include "AccessBridgeDebug.h"
++#include "AccessBridgeWindowsEntryPoints.h"
++#include "WinAccessBridge.h"
++#include "accessBridgeResource.h"
++
++#include <windows.h>
++#include <jni.h>
++
++
++extern WinAccessBridge *theWindowsAccessBridge;
++extern HWND theDialogWindow;
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++ /**
++ * Windows_run - where Windows executables will load/unload us
++ *
++ */
++ void Windows_run() {
++ // open our window
++ if (theWindowsAccessBridge != (WinAccessBridge *) 0) {
++ theWindowsAccessBridge->initWindow();
++ DEBUG_CODE(SetDlgItemText(theDialogWindow, cInvokedByText, "Windows"));
++ }
++ }
++
++ /*
++ /**
++ * Windows_shutdown - where Windows executables will load/unload us
++ *
++ *
++ void Windows_shutdown() {
++ if (theWindowsAccessBridge != (WinAccessBridge *) 0) {
++ theWindowsAccessBridge->initWindow();
++ }
++ }
++ */
++
++ /**
++ * getTopLevelHWND - returns the top-level window parent of the descendent
++ *
++ */
++ HWND getTopLevelHWND(HWND descendent) {
++ HWND hwnd;
++ if (descendent == NULL) {
++ return NULL;
++ }
++
++ if (!IsWindow(descendent)) {
++ return NULL;
++ }
++
++ hwnd = descendent;
++ for(;;) {
++ LONG style = GetWindowLong(hwnd, GWL_STYLE);
++ if ( (style & WS_CHILD) == 0 ) {
++ // found a non-child window so terminate
++ break;
++ }
++ hwnd = GetParent(hwnd);
++ }
++
++ return hwnd;
++ }
++
++ void releaseJavaObject(long vmID, JOBJECT64 object) {
++ if (theWindowsAccessBridge != 0) {
++ theWindowsAccessBridge->releaseJavaObject(vmID, object);
++ }
++ }
++
++ void getVersionInfo(long vmID, AccessBridgeVersionInfo *info) {
++ if (theWindowsAccessBridge != 0) {
++ theWindowsAccessBridge->getVersionInfo(vmID, info);
++ }
++ }
++
++
++ BOOL isJavaWindow(HWND window) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->isJavaWindow(window);
++ }
++ return FALSE;
++ }
++
++ /*
++ * Returns whether two object references refer to the same object
++ */
++ BOOL isSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2) {
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("\r\nAccessBridgeWindowsEntryPoints::isSameObject(%p %p)", obj1, obj2);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("\r\nAccessBridgeWindowsEntryPoints::isSameObject(%016I64X %016I64X)", obj1, obj2);
++#endif
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->isSameObject(vmID, obj1, obj2);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Sets a text field to the specified string. Returns whether successful
++ */
++ BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext,const wchar_t *text) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->setTextContents(vmID, accessibleContext, text);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Returns the Accessible Context of an object of the specified role that is the
++ * ancestor of a given object. If the object is of the specified role
++ * or an ancestor object of the specified role was found, returns the object's
++ * AccessibleContext.
++ * If there is no ancestor object of the specified role,
++ * returns (AccessibleContext)0.
++ */
++ AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext, const wchar_t *role) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getParentWithRole(vmID, accessibleContext, role);
++ }
++ return (AccessibleContext)0;
++ }
++
++
++ /**
++ * Returns the Accessible Context for the top level object in
++ * a Java Window. This is same Accessible Context that is obtained
++ * from GetAccessibleContextFromHWND for that window. Returns
++ * (AccessibleContext)0 on error.
++ */
++ AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getTopLevelObject(vmID, accessibleContext);
++ }
++ return (AccessibleContext)0;
++ }
++
++ /**
++ * If there is an Ancestor object of the specified role,
++ * returns the Accessible Context of the found object.
++ * Otherwise, returns the top level object for that
++ * Java Window. Returns (AccessibleContext)0 on error.
++ */
++ AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext, const wchar_t *role) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getParentWithRoleElseRoot(vmID, accessibleContext, role);
++ }
++ return (AccessibleContext)0;
++ }
++
++ /**
++ * Returns how deep in the object hierarchy a given object is.
++ * The top most object in the object hierarchy has an object depth of 0.
++ * Returns -1 on error.
++ */
++ int getObjectDepth (const long vmID, const AccessibleContext accessibleContext) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getObjectDepth(vmID, accessibleContext);
++ }
++ return -1;
++ }
++
++ /**
++ * Returns the Accessible Context of the currently ActiveDescendent of an object.
++ * Returns (AccessibleContext)0 on error.
++ */
++ AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getActiveDescendent(vmID, accessibleContext);
++ }
++ return (AccessibleContext)0;
++ }
++
++ // -------- Accessible Context methods -------------
++
++ BOOL getAccessibleContextFromHWND(HWND window, long *vmID, JOBJECT64 *AccessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleContextFromHWND(window, vmID, AccessibleContext);
++ }
++ return FALSE;
++ }
++
++ HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getHWNDFromAccessibleContext(vmID, accessibleContext);
++ }
++ return (HWND)0;
++ }
++
++ BOOL getAccessibleContextAt(long vmID, JOBJECT64 AccessibleContextParent,
++ jint x, jint y, JOBJECT64 *AccessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleContextAt(vmID, AccessibleContextParent,
++ x, y, AccessibleContext);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleContextWithFocus(HWND window, long *vmID, JOBJECT64 *AccessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleContextWithFocus(window, vmID, AccessibleContext);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleContextInfo(long vmID,
++ JOBJECT64 AccessibleContext,
++ AccessibleContextInfo *info) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleContextInfo(
++ vmID,
++ AccessibleContext,
++ info);
++ }
++ return FALSE;
++ }
++
++ JOBJECT64 getAccessibleChildFromContext(long vmID,
++ JOBJECT64 AccessibleContext,
++ jint childIndex) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleChildFromContext(
++ vmID,
++ AccessibleContext,
++ childIndex);
++ }
++ return (JOBJECT64) 0;
++ }
++
++ JOBJECT64 getAccessibleParentFromContext(long vmID,
++ JOBJECT64 AccessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleParentFromContext(
++ vmID,
++ AccessibleContext);
++ }
++ return (JOBJECT64) 0;
++ }
++
++ // -------- begin AccessibleTable routines -------------
++
++ BOOL getAccessibleTableInfo(long vmID, JOBJECT64 ac,
++ AccessibleTableInfo *tableInfo) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTableInfo(
++ vmID,
++ ac,
++ tableInfo);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTableCellInfo(long vmID, JOBJECT64 accessibleTable,
++ jint row, jint column, AccessibleTableCellInfo *tableCellInfo) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTableCellInfo(
++ vmID,
++ accessibleTable,
++ row, column, tableCellInfo);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTableRowHeader(long vmID, JOBJECT64 acParent, AccessibleTableInfo *tableInfo) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTableRowHeader(
++ vmID,
++ acParent,
++ tableInfo);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTableColumnHeader(long vmID, JOBJECT64 acParent, AccessibleTableInfo *tableInfo) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTableColumnHeader(
++ vmID,
++ acParent,
++ tableInfo);
++ }
++ return FALSE;
++ }
++
++ JOBJECT64 getAccessibleTableRowDescription(long vmID, JOBJECT64 acParent, jint row) {
++
++ if (theWindowsAccessBridge != 0) {
++ return (JOBJECT64)theWindowsAccessBridge->getAccessibleTableRowDescription(
++ vmID,
++ acParent,
++ row);
++ }
++ return (JOBJECT64)0;
++ }
++
++ JOBJECT64 getAccessibleTableColumnDescription(long vmID, JOBJECT64 acParent, jint column) {
++
++ if (theWindowsAccessBridge != 0) {
++ return (JOBJECT64)theWindowsAccessBridge->getAccessibleTableColumnDescription(
++ vmID,
++ acParent,
++ column);
++ }
++ return (JOBJECT64)0;
++ }
++
++ jint getAccessibleTableRowSelectionCount(long vmID, JOBJECT64 accessibleTable) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTableRowSelectionCount(vmID, accessibleTable);
++ }
++ return -1;
++ }
++
++ BOOL isAccessibleTableRowSelected(long vmID, JOBJECT64 accessibleTable, jint row) {
++ if (theWindowsAccessBridge != 0 ) {
++ return theWindowsAccessBridge->isAccessibleTableRowSelected(vmID, accessibleTable, row);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTableRowSelections(long vmID, JOBJECT64 accessibleTable, jint count, jint *selections) {
++ if (theWindowsAccessBridge != 0 ) {
++ return theWindowsAccessBridge->getAccessibleTableRowSelections(vmID, accessibleTable, count,
++ selections);
++ }
++ return FALSE;
++ }
++
++
++ jint getAccessibleTableColumnSelectionCount(long vmID, JOBJECT64 accessibleTable) {
++ if (theWindowsAccessBridge != 0 ) {
++ return theWindowsAccessBridge->getAccessibleTableColumnSelectionCount(vmID, accessibleTable);
++ }
++ return -1;
++ }
++
++ BOOL isAccessibleTableColumnSelected(long vmID, JOBJECT64 accessibleTable, jint column) {
++ if (theWindowsAccessBridge != 0 ) {
++ return theWindowsAccessBridge->isAccessibleTableColumnSelected(vmID, accessibleTable, column);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTableColumnSelections(long vmID, JOBJECT64 accessibleTable, jint count, jint *selections) {
++ if (theWindowsAccessBridge != 0 ) {
++ return theWindowsAccessBridge->getAccessibleTableColumnSelections(vmID, accessibleTable, count,
++ selections);
++ }
++ return FALSE;
++ }
++
++ jint getAccessibleTableRow(long vmID, JOBJECT64 accessibleTable, jint index) {
++ if (theWindowsAccessBridge != 0 ) {
++ return theWindowsAccessBridge->getAccessibleTableRow(vmID, accessibleTable, index);
++ }
++ return -1;
++ }
++
++ jint getAccessibleTableColumn(long vmID, JOBJECT64 accessibleTable, jint index) {
++ if (theWindowsAccessBridge != 0 ) {
++ return theWindowsAccessBridge->getAccessibleTableColumn(vmID, accessibleTable, index);
++ }
++ return -1;
++ }
++
++ jint getAccessibleTableIndex(long vmID, JOBJECT64 accessibleTable, jint row, jint column) {
++ if (theWindowsAccessBridge != 0 ) {
++ return theWindowsAccessBridge->getAccessibleTableIndex(vmID, accessibleTable, row, column);
++ }
++ return -1;
++ }
++
++ /* --------- end AccessibleTable routines ------- */
++
++ // --------- AccessibleRelationSet methods
++
++ BOOL getAccessibleRelationSet(long vmID, JOBJECT64 accessibleContext,
++ AccessibleRelationSetInfo *relationSetInfo) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleRelationSet(vmID, accessibleContext, relationSetInfo);
++ }
++ return FALSE;
++ }
++
++ // --------- AccessibleHypertext methods
++
++ BOOL getAccessibleHypertext(long vmID, JOBJECT64 accessibleContext,
++ AccessibleHypertextInfo *accessibleHypertextInfo) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleHypertext(vmID, accessibleContext,
++ accessibleHypertextInfo);
++ }
++ return FALSE;
++ }
++
++ BOOL activateAccessibleHyperlink(long vmID, JOBJECT64 accessibleContext, JOBJECT64 accessibleHyperlink) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->activateAccessibleHyperlink(vmID, accessibleContext,
++ accessibleHyperlink);
++ }
++ return FALSE;
++ }
++
++ jint getAccessibleHyperlinkCount(const long vmID,
++ const AccessibleContext accessibleContext) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleHyperlinkCount(vmID, accessibleContext);
++ }
++ return -1;
++ }
++
++
++ BOOL getAccessibleHypertextExt(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nStartIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertextInfo) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleHypertextExt(vmID,
++ accessibleContext,
++ nStartIndex,
++ hypertextInfo);
++ }
++ return FALSE;
++ }
++
++
++ jint getAccessibleHypertextLinkIndex(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleHypertextLinkIndex(vmID,
++ hypertext,
++ nIndex);
++ }
++ return -1;
++ }
++
++
++ BOOL getAccessibleHyperlink(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex,
++ /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleHyperlink(vmID,
++ hypertext,
++ nIndex,
++ hyperlinkInfo);
++ }
++ return FALSE;
++ }
++
++
++ /* Accessible KeyBindings, Icons and Actions */
++ BOOL getAccessibleKeyBindings(long vmID, JOBJECT64 accessibleContext, AccessibleKeyBindings *keyBindings) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleKeyBindings(vmID, accessibleContext, keyBindings);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleIcons(long vmID, JOBJECT64 accessibleContext, AccessibleIcons *icons) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleIcons(vmID, accessibleContext, icons);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleActions(long vmID, JOBJECT64 accessibleContext, AccessibleActions *actions) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleActions(vmID, accessibleContext, actions);
++ }
++ return FALSE;
++ }
++
++ BOOL doAccessibleActions(long vmID, JOBJECT64 accessibleContext, AccessibleActionsToDo *actionsToDo,
++ jint *failure) {
++
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->doAccessibleActions(vmID, accessibleContext, actionsToDo,
++ failure);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Additional methods for Teton
++ */
++
++ /**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
++ * whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++ BOOL getVirtualAccessibleName(long vmID, AccessibleContext accessibleContext, wchar_t *name, int len) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getVirtualAccessibleName(vmID, accessibleContext, name, len);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++ BOOL requestFocus(long vmID, AccessibleContext accessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->requestFocus(vmID, accessibleContext);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++ BOOL selectTextRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->selectTextRange(vmID, accessibleContext, startIndex, endIndex);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Get text attributes between two indices. The attribute list includes the text at the
++ * start index and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++ BOOL getTextAttributesInRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getTextAttributesInRange(vmID, accessibleContext,
++ startIndex, endIndex, attributes, len);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Gets the number of visible children of a component. Returns -1 on error.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ int getVisibleChildrenCount(long vmID, AccessibleContext accessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getVisibleChildrenCount(vmID, accessibleContext);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Gets the visible children of an AccessibleContext. Returns whether successful;
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ BOOL getVisibleChildren(long vmID, AccessibleContext accessibleContext, int startIndex,
++ VisibleChildrenInfo *visibleChildrenInfo) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getVisibleChildren(vmID, accessibleContext, startIndex,
++ visibleChildrenInfo);
++ }
++ return FALSE;
++ }
++
++ /**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++ BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext,
++ const int position) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->setCaretPosition(vmID, accessibleContext, position);
++ }
++ return FALSE;
++ }
++
++ // -------- Accessible Text methods -------------
++
++ BOOL getAccessibleTextInfo(long vmID, JOBJECT64 AccessibleContext,
++ AccessibleTextInfo *textInfo, jint x, jint y) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTextInfo(
++ vmID,
++ AccessibleContext,
++ textInfo, x, y);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTextItems(long vmID, JOBJECT64 AccessibleContext,
++ AccessibleTextItemsInfo *textItems, jint index) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTextItems(
++ vmID,
++ AccessibleContext,
++ textItems, index);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTextSelectionInfo(long vmID, JOBJECT64 AccessibleContext,
++ AccessibleTextSelectionInfo *selectionInfo) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTextSelectionInfo(
++ vmID,
++ AccessibleContext,
++ selectionInfo);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTextAttributes(long vmID, JOBJECT64 AccessibleContext,
++ jint index, AccessibleTextAttributesInfo *attributes) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTextAttributes(
++ vmID,
++ AccessibleContext,
++ index, attributes);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTextRect(long vmID, JOBJECT64 AccessibleContext,
++ AccessibleTextRectInfo *rectInfo, jint index) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTextRect(
++ vmID,
++ AccessibleContext,
++ rectInfo, index);
++ }
++ return FALSE;
++ }
++
++ BOOL getCaretLocation(long vmID, JOBJECT64 AccessibleContext,
++ AccessibleTextRectInfo *rectInfo, jint index) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getCaretLocation(vmID,
++ AccessibleContext,
++ rectInfo, index);
++ }
++ return FALSE;
++ }
++
++ int getEventsWaiting() {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getEventsWaiting();
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTextLineBounds(long vmID, JOBJECT64 AccessibleContext,
++ jint index, jint *startIndex, jint *endIndex) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTextLineBounds(
++ vmID,
++ AccessibleContext,
++ index, startIndex, endIndex);
++ }
++ return FALSE;
++ }
++
++ BOOL getAccessibleTextRange(long vmID, JOBJECT64 AccessibleContext,
++ jint start, jint end, wchar_t *text, short len) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleTextRange(
++ vmID,
++ AccessibleContext,
++ start, end, text, len);
++ }
++ return FALSE;
++ }
++
++
++ // -------- Accessible Value methods -------------
++
++ BOOL getCurrentAccessibleValueFromContext(long vmID, JOBJECT64 AccessibleContext,
++ wchar_t *value, short len) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getCurrentAccessibleValueFromContext(
++ vmID, AccessibleContext, value, len);
++ }
++ return FALSE;
++ }
++
++ BOOL getMaximumAccessibleValueFromContext(long vmID, JOBJECT64 AccessibleContext,
++ wchar_t *value, short len) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getMaximumAccessibleValueFromContext(
++ vmID, AccessibleContext, value, len);
++ }
++ return FALSE;
++ }
++
++ BOOL getMinimumAccessibleValueFromContext(long vmID, JOBJECT64 AccessibleContext,
++ wchar_t *value, short len) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getMinimumAccessibleValueFromContext(
++ vmID, AccessibleContext, value, len);
++ }
++ return FALSE;
++ }
++
++ // -------- Accessible Selection methods -------------
++
++ void addAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext, int i) {
++ if (theWindowsAccessBridge != 0) {
++ theWindowsAccessBridge->addAccessibleSelectionFromContext(
++ vmID, AccessibleContext, i);
++ }
++ }
++
++ void clearAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ theWindowsAccessBridge->clearAccessibleSelectionFromContext(
++ vmID, AccessibleContext);
++ }
++ }
++
++ JOBJECT64 getAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext, int i) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleSelectionFromContext(
++ vmID, AccessibleContext, i);
++ }
++ return (JOBJECT64) 0;
++ }
++
++ int getAccessibleSelectionCountFromContext(long vmID, JOBJECT64 AccessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->getAccessibleSelectionCountFromContext(
++ vmID, AccessibleContext);
++ }
++ return -1;
++ }
++
++ BOOL isAccessibleChildSelectedFromContext(long vmID, JOBJECT64 AccessibleContext, int i) {
++ if (theWindowsAccessBridge != 0) {
++ return theWindowsAccessBridge->isAccessibleChildSelectedFromContext(
++ vmID, AccessibleContext, i);
++ }
++ return FALSE;
++ }
++
++ void removeAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext, int i) {
++ if (theWindowsAccessBridge != 0) {
++ theWindowsAccessBridge->removeAccessibleSelectionFromContext(
++ vmID, AccessibleContext, i);
++ }
++ }
++
++ void selectAllAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext) {
++ if (theWindowsAccessBridge != 0) {
++ theWindowsAccessBridge->selectAllAccessibleSelectionFromContext(
++ vmID, AccessibleContext);
++ }
++ }
++
++
++ // -------- Event Handler methods -------------
++
++#define SET_EVENT_FP(function, callbackFP) \
++ void function(callbackFP fp) { \
++ if (theWindowsAccessBridge != 0) { \
++ theWindowsAccessBridge->function(fp); \
++ } \
++}
++
++ void setJavaShutdownFP(AccessBridge_JavaShutdownFP fp) {
++ if (theWindowsAccessBridge != 0) {
++ theWindowsAccessBridge->setJavaShutdownFP(fp);
++ }
++ }
++
++ SET_EVENT_FP(setPropertyChangeFP, AccessBridge_PropertyChangeFP)
++ SET_EVENT_FP(setFocusGainedFP, AccessBridge_FocusGainedFP)
++ SET_EVENT_FP(setFocusLostFP, AccessBridge_FocusLostFP)
++ SET_EVENT_FP(setCaretUpdateFP, AccessBridge_CaretUpdateFP)
++ SET_EVENT_FP(setMouseClickedFP, AccessBridge_MouseClickedFP)
++ SET_EVENT_FP(setMouseEnteredFP, AccessBridge_MouseEnteredFP)
++ SET_EVENT_FP(setMouseExitedFP, AccessBridge_MouseExitedFP)
++ SET_EVENT_FP(setMousePressedFP, AccessBridge_MousePressedFP)
++ SET_EVENT_FP(setMouseReleasedFP, AccessBridge_MouseReleasedFP)
++ SET_EVENT_FP(setMenuCanceledFP, AccessBridge_MenuCanceledFP)
++ SET_EVENT_FP(setMenuDeselectedFP, AccessBridge_MenuDeselectedFP)
++ SET_EVENT_FP(setMenuSelectedFP, AccessBridge_MenuSelectedFP)
++ SET_EVENT_FP(setPopupMenuCanceledFP, AccessBridge_PopupMenuCanceledFP)
++ SET_EVENT_FP(setPopupMenuWillBecomeInvisibleFP, AccessBridge_PopupMenuWillBecomeInvisibleFP)
++ SET_EVENT_FP(setPopupMenuWillBecomeVisibleFP, AccessBridge_PopupMenuWillBecomeVisibleFP)
++
++ SET_EVENT_FP(setPropertyNameChangeFP, AccessBridge_PropertyNameChangeFP)
++ SET_EVENT_FP(setPropertyDescriptionChangeFP, AccessBridge_PropertyDescriptionChangeFP)
++ SET_EVENT_FP(setPropertyStateChangeFP, AccessBridge_PropertyStateChangeFP)
++ SET_EVENT_FP(setPropertyValueChangeFP, AccessBridge_PropertyValueChangeFP)
++ SET_EVENT_FP(setPropertySelectionChangeFP, AccessBridge_PropertySelectionChangeFP)
++ SET_EVENT_FP(setPropertyTextChangeFP, AccessBridge_PropertyTextChangeFP)
++ SET_EVENT_FP(setPropertyCaretChangeFP, AccessBridge_PropertyCaretChangeFP)
++ SET_EVENT_FP(setPropertyVisibleDataChangeFP, AccessBridge_PropertyVisibleDataChangeFP)
++ SET_EVENT_FP(setPropertyChildChangeFP, AccessBridge_PropertyChildChangeFP)
++ SET_EVENT_FP(setPropertyActiveDescendentChangeFP, AccessBridge_PropertyActiveDescendentChangeFP)
++
++ SET_EVENT_FP(setPropertyTableModelChangeFP, AccessBridge_PropertyTableModelChangeFP)
++
++#ifdef __cplusplus
++ }
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/AccessBridgeWindowsEntryPoints.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,300 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * Glue routines called by Windows AT into the WindowsAccessBridge dll
++ */
++
++#ifndef __AccessBridgeWindowsEntryPoints_H__
++#define __AccessBridgeWindowsEntryPoints_H__
++
++#include <windows.h>
++#include <jni.h>
++
++#include "AccessBridgePackages.h"
++#include "AccessBridgeCallbacks.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++ void Windows_run();
++
++ void releaseJavaObject(long vmID, JOBJECT64 object);
++ void getVersionInfo(long vmID, AccessBridgeVersionInfo *info);
++
++ // Window related functions
++ HWND getTopLevelHWND(HWND descendent);
++ BOOL isJavaWindow(HWND window);
++ BOOL getAccessibleContextFromHWND(HWND window, long *vmID, JOBJECT64 *AccessibleContext);
++ HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accessibleContext);
++
++ // returns whether two objects are the same
++ BOOL isSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2);
++
++ // Accessible Context functions
++ BOOL getAccessibleContextAt(long vmID, JOBJECT64 AccessibleContextParent,
++ jint x, jint y, JOBJECT64 *AccessibleContext);
++ BOOL getAccessibleContextWithFocus(HWND window, long *vmID, JOBJECT64 *AccessibleContext);
++ BOOL getAccessibleContextInfo(long vmID, JOBJECT64 AccessibleContext, AccessibleContextInfo *info);
++ JOBJECT64 getAccessibleChildFromContext(long vmID, JOBJECT64 AccessibleContext, jint childIndex);
++ JOBJECT64 getAccessibleParentFromContext(long vmID, JOBJECT64 AccessibleContext);
++
++ /* begin AccessibleTable */
++ BOOL getAccessibleTableInfo(long vmID, JOBJECT64 acParent, AccessibleTableInfo *tableInfo);
++ BOOL getAccessibleTableCellInfo(long vmID, JOBJECT64 accessibleTable, jint row, jint column,
++ AccessibleTableCellInfo *tableCellInfo);
++
++ BOOL getAccessibleTableRowHeader(long vmID, JOBJECT64 acParent, AccessibleTableInfo *tableInfo);
++ BOOL getAccessibleTableColumnHeader(long vmID, JOBJECT64 acParent, AccessibleTableInfo *tableInfo);
++
++ JOBJECT64 getAccessibleTableRowDescription(long vmID, JOBJECT64 acParent, jint row);
++ JOBJECT64 getAccessibleTableColumnDescription(long vmID, JOBJECT64 acParent, jint column);
++
++ jint getAccessibleTableRowSelectionCount(long vmID, JOBJECT64 accessibleTable);
++ BOOL isAccessibleTableRowSelected(long vmID, JOBJECT64 accessibleTable, jint row);
++ BOOL getAccessibleTableRowSelections(long vmID, JOBJECT64 accessibleTable, jint count,
++ jint *selections);
++
++ jint getAccessibleTableColumnSelectionCount(long vmID, JOBJECT64 accessibleTable);
++ BOOL isAccessibleTableColumnSelected(long vmID, JOBJECT64 accessibleTable, jint column);
++ BOOL getAccessibleTableColumnSelections(long vmID, JOBJECT64 accessibleTable, jint count,
++ jint *selections);
++
++ jint getAccessibleTableRow(long vmID, JOBJECT64 accessibleTable, jint index);
++ jint getAccessibleTableColumn(long vmID, JOBJECT64 accessibleTable, jint index);
++ jint getAccessibleTableIndex(long vmID, JOBJECT64 accessibleTable, jint row, jint column);
++
++ /* end AccessibleTable */
++
++ BOOL getAccessibleRelationSet(long vmID, JOBJECT64 accessibleContext,
++ AccessibleRelationSetInfo *relationSetInfo);
++
++ // AccessibleHypertext methods
++ BOOL getAccessibleHypertext(long vmID, JOBJECT64 accessibleContext, AccessibleHypertextInfo *hypertextInfo);
++
++ BOOL activateAccessibleHyperlink(long vmID, JOBJECT64 accessibleContext, JOBJECT64 accessibleHyperlink);
++
++ jint getAccessibleHyperlinkCount(const long vmID,
++ const AccessibleContext accessibleContext);
++
++ BOOL getAccessibleHypertextExt(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nStartIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertextInfo);
++
++ jint getAccessibleHypertextLinkIndex(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex);
++
++ BOOL getAccessibleHyperlink(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex,
++ /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo);
++
++
++ /* Accessible KeyBindings, Icons and Actions */
++ BOOL getAccessibleKeyBindings(long vmID, JOBJECT64 accessibleContext,
++ AccessibleKeyBindings *keyBindings);
++
++ BOOL getAccessibleIcons(long vmID, JOBJECT64 accessibleContext,
++ AccessibleIcons *icons);
++
++ BOOL getAccessibleActions(long vmID, JOBJECT64 accessibleContext,
++ AccessibleActions *actions);
++
++ BOOL doAccessibleActions(long vmID, JOBJECT64 accessibleContext,
++ AccessibleActionsToDo *actionsToDo, jint *failure);
++
++ /* ----- Additional AccessibleHypertext methods for Teton */
++
++
++ jint getAccessibleHypertextLinkCount(const long vmID,
++ const AccessibleContext accessibleContext);
++
++ BOOL getAccessibleHypertextExt(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nStartIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertextInfo);
++
++ jint getAccessibleHypertextLinkIndex(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nIndex);
++
++ BOOL getAccessibleHyperlink(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nIndex,
++ /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo);
++
++
++ /* Additional utility methods */
++ BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text);
++
++ AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext, const wchar_t *role);
++
++ AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext);
++
++ AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext, const wchar_t *role);
++
++ int getObjectDepth (const long vmID, const AccessibleContext accessibleContext);
++
++ AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext);
++
++ /**
++ * Additional methods for Teton
++ */
++
++ /**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
++ * whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++ BOOL getVirtualAccessibleName(long vmID, AccessibleContext accessibleContext, wchar_t *name, int len);
++
++ /**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++ BOOL requestFocus(long vmID, AccessibleContext accessibleContext);
++
++ /**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++ BOOL selectTextRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex);
++
++ /**
++ * Get text attributes between two indices. The attribute list includes the text at the
++ * start index and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++ BOOL getTextAttributesInRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len);
++
++ /**
++ * Returns the number of visible children of a component. Returns -1 on error.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ int getVisibleChildrenCount(long vmID, AccessibleContext accessibleContext);
++
++ /**
++ * Gets the visible children of an AccessibleContext. Returns whether successful;
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ BOOL getVisibleChildren(long vmID, AccessibleContext accessibleContext, int startIndex,
++ VisibleChildrenInfo *visibleChildrenInfo);
++
++ /**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++ BOOL setCaretPosition(long vmID, AccessibleContext accessibleContext, int position);
++
++ /**
++ * Gets the text caret bounding rectangle
++ */
++ BOOL getCaretLocation(long vmID, JOBJECT64 AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);
++
++ // Accessible Text functions
++ BOOL getAccessibleTextInfo(long vmID, JOBJECT64 AccessibleContext, AccessibleTextInfo *textInfo, jint x, jint y);
++ BOOL getAccessibleTextItems(long vmID, JOBJECT64 AccessibleContext, AccessibleTextItemsInfo *textItems, jint index);
++ BOOL getAccessibleTextSelectionInfo(long vmID, JOBJECT64 AccessibleContext, AccessibleTextSelectionInfo *selectionInfo);
++ BOOL getAccessibleTextAttributes(long vmID, JOBJECT64 AccessibleContext, jint index, AccessibleTextAttributesInfo *attributes);
++ BOOL getAccessibleTextRect(long vmID, JOBJECT64 AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);
++ BOOL getAccessibleTextLineBounds(long vmID, JOBJECT64 AccessibleContext, jint index, jint *startIndex, jint *endIndex);
++ BOOL getAccessibleTextRange(long vmID, JOBJECT64 AccessibleContext, jint start, jint end, wchar_t *text, short len);
++
++ // Accessible Value methods
++ BOOL getCurrentAccessibleValueFromContext(long vmID,JOBJECT64 AccessibleContext, wchar_t *value, short len);
++ BOOL getMaximumAccessibleValueFromContext(long vmID,JOBJECT64 AccessibleContext, wchar_t *value, short len);
++ BOOL getMinimumAccessibleValueFromContext(long vmID,JOBJECT64 AccessibleContext, wchar_t *value, short len);
++
++ // Accessible Selection methods
++ void addAccessibleSelectionFromContext(long vmID,JOBJECT64 AccessibleContext, int i);
++ void clearAccessibleSelectionFromContext(long vmID,JOBJECT64 AccessibleContext);
++ JOBJECT64 getAccessibleSelectionFromContext(long vmID,JOBJECT64 AccessibleContext, int i);
++ int getAccessibleSelectionCountFromContext(long vmID,JOBJECT64 AccessibleContext);
++ BOOL isAccessibleChildSelectedFromContext(long vmID,JOBJECT64 AccessibleContext, int i);
++ void removeAccessibleSelectionFromContext(long vmID,JOBJECT64 AccessibleContext, int i);
++ void selectAllAccessibleSelectionFromContext(long vmID,JOBJECT64 AccessibleContext);
++
++
++ // PropertyChange Event registry routines
++ void setPropertyChangeFP(AccessBridge_PropertyChangeFP fp);
++
++ // Java application shutdown
++ void setJavaShutdownFP(AccessBridge_JavaShutdownFP fp);
++
++ // Focus Event registry routines
++ void setFocusGainedFP(AccessBridge_FocusGainedFP fp);
++ void setFocusLostFP(AccessBridge_FocusLostFP fp);
++
++ // Caret Event registry routines
++ void setCaretUpdateFP(AccessBridge_CaretUpdateFP fp);
++
++ // Mouse Event registry routines
++ void setMouseClickedFP(AccessBridge_MouseClickedFP fp);
++ void setMouseEnteredFP(AccessBridge_MouseEnteredFP fp);
++ void setMouseExitedFP(AccessBridge_MouseExitedFP fp);
++ void setMousePressedFP(AccessBridge_MousePressedFP fp);
++ void setMouseReleasedFP(AccessBridge_MouseReleasedFP fp);
++
++ // Menu/PopupMenu Event registry routines
++ void setMenuCanceledFP(AccessBridge_MenuCanceledFP fp);
++ void setMenuDeselectedFP(AccessBridge_MenuDeselectedFP fp);
++ void setMenuSelectedFP(AccessBridge_MenuSelectedFP fp);
++ void setPopupMenuCanceledFP(AccessBridge_PopupMenuCanceledFP fp);
++ void setPopupMenuWillBecomeInvisibleFP(AccessBridge_PopupMenuWillBecomeInvisibleFP fp);
++ void setPopupMenuWillBecomeVisibleFP(AccessBridge_PopupMenuWillBecomeVisibleFP fp);
++
++ // Accessibility PropertyChange Event registry routines
++ void setPropertyNameChangeFP(AccessBridge_PropertyNameChangeFP fp);
++ void setPropertyDescriptionChangeFP(AccessBridge_PropertyDescriptionChangeFP fp);
++ void setPropertyStateChangeFP(AccessBridge_PropertyStateChangeFP fp);
++ void setPropertyValueChangeFP(AccessBridge_PropertyValueChangeFP fp);
++ void setPropertySelectionChangeFP(AccessBridge_PropertySelectionChangeFP fp);
++ void setPropertyTextChangeFP(AccessBridge_PropertyTextChangeFP fp);
++ void setPropertyCaretChangeFP(AccessBridge_PropertyCaretChangeFP fp);
++ void setPropertyVisibleDataChangeFP(AccessBridge_PropertyVisibleDataChangeFP fp);
++ void setPropertyChildChangeFP(AccessBridge_PropertyChildChangeFP fp);
++ void setPropertyActiveDescendentChangeFP(AccessBridge_PropertyActiveDescendentChangeFP fp);
++
++ void setPropertyTableModelChangeFP(AccessBridge_PropertyTableModelChangeFP fp);
++
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/JAWTAccessBridge.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,144 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * A DLL which is loaded by Java applications and used to map
++ * between Java applications and native Win32 window handles.
++ */
++
++#include "com_sun_java_accessibility_AccessBridge.h" // programatically generated by JNI
++
++#include <windows.h>
++#include <stdio.h>
++
++#include <jawt.h>
++#include <win32/jawt_md.h>
++
++// ---------------------------------------------------------------------------
++
++extern "C" {
++ /**
++ * DllMain - where Windows executables will load/unload us
++ *
++ */
++ BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved) {
++
++ return TRUE;
++ }
++
++
++ /*
++ * Map a HWND to a Java component
++ *
++ * Class: com_sun_java_accessibility_AccessBridge
++ * Method: jawtGetComponentFromNativeWindowHandle
++ * Signature: (I)Ljava/awt/Component;
++ */
++ JNIEXPORT jobject JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_jawtGetComponentFromNativeWindowHandle
++ (JNIEnv *env, jobject callingObj, jint windowHandle) {
++
++ JAWT awt;
++ jboolean result;
++ jobject component = (jobject)0;
++
++ // Get the AWT
++ awt.version = JAWT_VERSION_1_4;
++ result = JAWT_GetAWT(env, &awt);
++ if (result == JNI_FALSE) {
++ return (jobject)0;
++ }
++
++ // Get the component
++ return awt.GetComponent(env, (void *)windowHandle);
++ }
++
++
++ /*
++ * Map a Java component to a HWND
++ *
++ * Class: com_sun_java_accessibility_AccessBridge
++ * Method: jawtGetNativeWindowHandleFromComponent
++ * Signature: (Ljava/awt/Component;)I
++ */
++ JNIEXPORT jint JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_jawtGetNativeWindowHandleFromComponent
++ (JNIEnv *env, jobject callingObj, jobject component)
++ {
++
++ JAWT awt;
++ JAWT_DrawingSurface* ds;
++ JAWT_DrawingSurfaceInfo* dsi;
++ JAWT_Win32DrawingSurfaceInfo* dsi_win;
++ jboolean result;
++ // jint lock;
++ jint windowHandle = -1;
++
++ // Get the AWT
++ awt.version = JAWT_VERSION_1_4;
++ result = JAWT_GetAWT(env, &awt);
++ if (result == JNI_FALSE) {
++ return -1;
++ }
++
++ // Get the drawing surface
++ ds = awt.GetDrawingSurface(env, component);
++ if (ds == NULL) {
++ return -1;
++ }
++
++ /*
++ * Should not be necessary.
++ *
++ // Lock the drawing surface
++ lock = ds->Lock(ds);
++ if ((lock & JAWT_LOCK_ERROR) != 0) {
++ return -1;
++ }
++ */
++
++ // Get the drawing surface info
++ dsi = ds->GetDrawingSurfaceInfo(ds);
++
++ // Get the platform-specific drawing info
++ dsi_win = (JAWT_Win32DrawingSurfaceInfo *)dsi->platformInfo;
++
++ // Get the window handle
++ windowHandle = (jint)dsi_win->hwnd;
++
++ // Free the drawing surface info
++ ds->FreeDrawingSurfaceInfo(dsi);
++
++ /*
++ // Unlock the drawing surface
++ ds->Unlock(ds);
++ */
++
++ // Free the drawing surface
++ awt.FreeDrawingSurface(ds);
++
++ return windowHandle;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/JAWTAccessBridge.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,49 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * @(#)JAWTAccessBridge.h 1.9 05/03/21
++ */
++
++/*
++ * A DLL which is loaded by Java applications to handle communication
++ * between Java VMs purposes of Accessbility.
++ */
++
++#include <windows.h>
++#include <jni.h>
++
++#include "AccessBridgePackages.h"
++
++#ifndef __JAWTAccessBridge_H__
++#define __JAWTAccessBridge_H__
++
++
++extern "C" {
++ BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason,
++ LPVOID lpvReserved);
++}
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/JavaAccessBridge.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,2724 @@
++/*
++ * 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. 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.
++ */
++
++/*
++ * A DLL which is loaded by Java applications to handle communication
++ * between Java VMs purposes of Accessbility.
++ */
++
++#include "AccessBridgeDebug.h"
++#include "JavaAccessBridge.h"
++#include "com_sun_java_accessibility_AccessBridge.h" // programatically generated by JNI
++#include "accessBridgeResource.h"
++#include "accessBridgeCallbacks.h"
++#include "AccessBridgeMessages.h"
++
++
++#include <windows.h>
++#include <stdio.h>
++
++// #ifdef JAWT_SUPPORT
++#include <jawt.h>
++#include <win32/jawt_md.h>
++// #endif /* JAWT_SUPPORT */
++
++JavaAccessBridge *theJavaAccessBridge;
++HWND theDialogWindow;
++
++// re-entrance lock for receiving memory messages
++CRITICAL_SECTION receiveMemoryIPCLock;
++
++
++// unique broadcast msg. IDs gotten dymanically
++extern UINT theFromJavaHelloMsgID;
++extern UINT theFromWindowsHelloMsgID;
++
++
++// ---------------------------------------------------------------------------
++
++extern "C" {
++ /**
++ * DllMain - where Windows executables will load/unload us
++ *
++ */
++ BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved) {
++
++ switch (fdwReason) {
++ case DLL_PROCESS_ATTACH:
++ InitializeCriticalSection(&receiveMemoryIPCLock);
++ theJavaAccessBridge = new JavaAccessBridge(hinstDll);
++ break;
++
++ case DLL_PROCESS_DETACH: // A Windows executable unloaded us
++ if (theJavaAccessBridge != (JavaAccessBridge *) 0) {
++ delete theJavaAccessBridge;
++ DeleteCriticalSection(&receiveMemoryIPCLock);
++ }
++ break;
++ }
++ return TRUE;
++ }
++
++ /**
++ * Open a native window (and init the wrappers we'll be using)
++ *
++ */
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_runDLL(JNIEnv *env, jobject obj) {
++ PrintDebugString("\r\nJavaAccessBridge.DLL runDLL() called");
++ theJavaAccessBridge->javaRun(env, obj);
++ }
++
++#if 0 // SetDlgItemText has caused problems with JAWS
++ /**
++ * Append debug info to dialog
++ *
++ */
++ void AppendToCallInfo(char *s) {
++ char buffer[4096];
++
++ PrintDebugString(s);
++
++ GetDlgItemText(theDialogWindow, cCallInfo, buffer, sizeof(buffer));
++ if (strlen(buffer) < (sizeof(buffer) - strlen(s))) {
++ strncat(buffer, s, sizeof(buffer));
++ SetDlgItemText(theDialogWindow, cCallInfo, buffer);
++ } else {
++ SetDlgItemText(theDialogWindow, cCallInfo, s);
++ }
++ }
++#endif
++
++
++ /**
++ * Our window proc
++ *
++ */
++ BOOL APIENTRY AccessBridgeDialogProc (HWND hDlg, UINT message, UINT wParam, LONG lParam) {
++ int command;
++ COPYDATASTRUCT *sentToUs;
++ char *package;
++ //DEBUG_CODE(char buffer[256]);
++
++ switch (message) {
++ case WM_INITDIALOG:
++ //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Initializing"));
++ break;
++
++ case WM_COMMAND:
++ command = LOWORD (wParam);
++ break;
++
++ // call from Java with data for us to deliver
++ case WM_COPYDATA:
++ if (theDialogWindow == (HWND) wParam) {
++ //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got WM_COPYDATA from ourselves"));
++ } else {
++ //DEBUG_CODE(sprintf(buffer, "Got WM_COPYDATA from HWND %p", wParam));
++ //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, buffer));
++ sentToUs = (COPYDATASTRUCT *) lParam;
++ package = (char *) sentToUs->lpData;
++ theJavaAccessBridge->processPackage(package, sentToUs->cbData);
++ }
++ break;
++
++ // call from Java with data for us retrieve from memory mapped file and deliver
++ case AB_MESSAGE_WAITING:
++ // wParam == sourceHwnd
++ // lParam == buffer size in shared memory
++ if (theDialogWindow == (HWND) wParam) {
++ //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got AB_MESSAGE_WAITING from ourselves"));
++ } else {
++ //DEBUG_CODE(sprintf(buffer, "Got AB_MESSAGE_WAITING from HWND %p", wParam));
++ //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, buffer));
++ LRESULT returnVal = theJavaAccessBridge->receiveMemoryPackage((HWND) wParam, lParam);
++ }
++ break;
++
++ // a JavaAccessBridge DLL is going away
++ case AB_DLL_GOING_AWAY:
++ // wParam == sourceHwnd
++ //DEBUG_CODE(SetDlgItemText(theDialogWindow, cStatusText, "Got AB_DLL_GOING_AWAY message"));
++ theJavaAccessBridge->WindowsATDestroyed((HWND) wParam);
++ break;
++
++ default:
++ // the Windows AT is saying "hi"!
++ // wParam == sourceHwnc; lParam unused
++ if (message == theFromWindowsHelloMsgID) {
++ // A new Windows AT just said "hi";
++ // say "hi" back so it can mate up with us
++ // otherwise don't do anything (e.g. don't set up data structures yet)
++ theJavaAccessBridge->postHelloToWindowsDLLMsg((HWND) wParam);
++ }
++ }
++ return FALSE;
++ }
++
++}
++
++
++// -----------------------------
++
++
++/**
++ * Initialize the JavaAccessBridge
++ *
++ */
++JavaAccessBridge::JavaAccessBridge(HINSTANCE hInstance) {
++ windowsInstance = hInstance;
++ ATs = (AccessBridgeATInstance *) 0;
++ initBroadcastMessageIDs(); // get the unique to us broadcast msg. IDs
++}
++
++extern DWORD JavaBridgeThreadId;
++
++/**
++ * Destroy the JavaAccessBridge
++ *
++ */
++JavaAccessBridge::~JavaAccessBridge() {
++ // inform all other AccessBridges that we're going away
++
++ PrintDebugString("\r\nin JavaAccessBridge::~JavaAccessBridge()");
++
++ // Send a shutdown message for those applications like StarOffice that do
++ // send a shutdown message themselves.
++ javaShutdown(NULL, 0);
++
++ AccessBridgeATInstance *current = ATs;
++ while (current != (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" telling %p we're going away", current->winAccessBridgeWindow);
++ SendMessage(current->winAccessBridgeWindow,
++ AB_DLL_GOING_AWAY, (WPARAM) dialogWindow, (LPARAM) 0);
++ current = current->nextATInstance;
++ }
++
++ PrintDebugString(" finished telling ATs about our demise");
++
++ if(JavaBridgeThreadId)
++ {
++ PostThreadMessage(JavaBridgeThreadId,WM_USER+1,0,0);
++ Sleep(100);
++ }
++
++ delete ATs;
++
++ PrintDebugString(" finished deleting ATs");
++ PrintDebugString("GOODBYE CRUEL WORLD...");
++}
++
++
++void
++JavaAccessBridge::javaRun(JNIEnv *env, jobject obj) {
++ MSG msg;
++
++ PrintDebugString("JavaAccessBridge::javaRun(%p, %p) called", env, obj);
++
++ if (env->GetJavaVM(&javaVM) != 0) {
++ return; // huh!?!?!
++ }
++ PrintDebugString(" -> javaVM = %p", javaVM);
++
++ if (javaVM->AttachCurrentThread((void **) &windowsThreadJNIEnv, NULL) != 0) {
++ return; // huh!?!?!
++ }
++ PrintDebugString(" -> windowsThreadJNIEnv = %p", windowsThreadJNIEnv);
++
++ javaThreadABObject = env->NewGlobalRef(obj);
++ windowsThreadABObject = windowsThreadJNIEnv->NewGlobalRef(obj);
++
++ // initialize the Java thread AccessBridge entry points
++ javaThreadEntryPoints = new AccessBridgeJavaEntryPoints(env, javaThreadABObject);
++ if (javaThreadEntryPoints->BuildJavaEntryPoints() == FALSE) {
++ return; // couldn't build our entry points; let's get out of here!
++ }
++ PrintDebugString(" all Java thread entry points successfully found.");
++
++ // initialize the Windows thread AccessBridge entry points
++ windowsThreadEntryPoints = new AccessBridgeJavaEntryPoints(windowsThreadJNIEnv,
++ windowsThreadABObject);
++ if (windowsThreadEntryPoints->BuildJavaEntryPoints() == FALSE) {
++ return; // couldn't build our entry points; let's get out of here!
++ }
++ PrintDebugString(" all Windows thread entry points successfully found.");
++
++
++ // open our window
++ if (initWindow() == TRUE) {
++ PrintDebugString(" Window created. HWND = %p", dialogWindow);
++
++ // post a broadcast msg.; let other AccessBridge DLLs know we exist
++ postHelloToWindowsDLLMsg(HWND_BROADCAST);
++
++ // do that message loop thing
++ while (GetMessage(&msg, NULL, 0, 0)) {
++ TranslateMessage(&msg);
++ DispatchMessage(&msg);
++ }
++ } else {
++ PrintDebugString(" FAILED TO CREATE WINDOW!!!");
++ }
++
++ javaVM->DetachCurrentThread();
++}
++
++/**
++ * Bring up our window; make a connection to the rest of the world
++ *
++ */
++BOOL
++JavaAccessBridge::initWindow() {
++ theDialogWindow = CreateDialog(windowsInstance,
++ "ACCESSBRIDGESTATUSWINDOW", NULL,
++ (DLGPROC) AccessBridgeDialogProc);
++
++ // If window could not be created, return "failure".
++ if (!theDialogWindow)
++ return FALSE;
++
++ dialogWindow = theDialogWindow;
++
++ // Make the window visible, update its client area, & return "success".
++ // DEBUG_CODE(ShowWindow (theDialogWindow, SW_SHOWNORMAL));
++ // DEBUG_CODE(UpdateWindow (theDialogWindow));
++
++ return TRUE;
++}
++
++
++
++// -----------------------
++
++
++/**
++ * postHelloToWindowsDLLMsg
++ * - PostMessage(theFromJavaHelloMsgID) to let one or
++ * all WindowDLLs we're here and have a vmID
++ *
++ * destHwnd is either a single hwnd or HWND_BROADCAST
++ * (former if a reply, latter if we're just born)
++ * wParam is our HWND
++ * lParam is our vmID
++ *
++ */
++void
++JavaAccessBridge::postHelloToWindowsDLLMsg(HWND destHwnd) {
++ PrintDebugString("\r\nin JavaAccessBridge::postHelloToWindowsDLLMsg");
++ PrintDebugString(" calling PostMessage(%p, %X, %p, %p)",
++ destHwnd, theFromJavaHelloMsgID, dialogWindow, javaVM);
++ PostMessage(destHwnd, theFromJavaHelloMsgID, (WPARAM) dialogWindow, (LPARAM) dialogWindow);
++}
++
++
++// -----------------------
++
++/**
++ * sendPackage - uses SendMessage(WM_COPYDATA) to do IPC messaging
++ * with the Java AccessBridge DLL
++ *
++ */
++void
++JavaAccessBridge::sendPackage(char *buffer, int bufsize, HWND destHwnd) {
++ COPYDATASTRUCT toCopy;
++ toCopy.dwData = 0; // 32-bits we could use for something...
++ toCopy.cbData = bufsize;
++ toCopy.lpData = buffer;
++
++ SendMessage(destHwnd, WM_COPYDATA, (WPARAM) dialogWindow, (LPARAM) &toCopy);
++}
++
++
++/**
++ * sendJavaEventPackage - walk through ATs, sending event messages to 'em
++ *
++ */
++void
++JavaAccessBridge::sendJavaEventPackage(char *buffer, int bufsize, long type) {
++
++ PrintDebugString("JavaAccessBridge::sendJavaEventPackage(), type = %X", type);
++
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ }
++
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ ati->sendJavaEventPackage(buffer, bufsize, type);
++ ati = ati->nextATInstance;
++ }
++}
++
++/**
++ * sendAccessibilityEventPackage - walk through ATs, sending event messages to 'em
++ *
++ */
++void
++JavaAccessBridge::sendAccessibilityEventPackage(char *buffer, int bufsize, long type) {
++
++ PrintDebugString("JavaAccessBridge::sendAccessibilityEventPackage(), type = %X", type);
++
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ }
++
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ ati->sendAccessibilityEventPackage(buffer, bufsize, type);
++ ati = ati->nextATInstance;
++ }
++}
++
++
++
++
++/**
++ * receiveMemoryPackage - uses Memory-Mapped files to do IPC messaging
++ * with the Java AccessBridge DLL, receiving the
++ * message from Java AccessBridge DLL by reading the
++ * contents of the shared memory mapped file that
++ * is used for Java-initiated messages
++ *
++ */
++BOOL
++JavaAccessBridge::receiveMemoryPackage(HWND srcWindow, long bufsize) {
++ char *IPCview;
++
++ PrintDebugString("\r\nJavaAccessBridge::receiveMemoryPackage(%p, %d)", srcWindow, bufsize);
++
++ // look-up the appropriate IPCview based on the srcHWND of the Windows AccessBridge DLL
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR! - ATs == 0 (shouldn't happen in receiveMemoryPackage()!");
++ return FALSE;
++ }
++ AccessBridgeATInstance *ati = ATs->findABATInstanceFromATHWND(srcWindow);
++ if (ati != (AccessBridgeATInstance *) 0) {
++ IPCview = (char *) ati->memoryMappedView;
++
++ // wait for the lock if someone else has it (re-entrancy)
++ EnterCriticalSection(&receiveMemoryIPCLock);
++ {
++ // set byte at end of buffer to indicate to caller that we have reached this point
++ IPCview[bufsize] = 1;
++
++ // process the package
++ processPackage(IPCview, bufsize);
++ }
++ // release re-entrance lock
++ LeaveCriticalSection(&receiveMemoryIPCLock);
++
++ return TRUE;
++
++ } else {
++ //DEBUG_CODE(AppendToCallInfo("ERROR receiving memory package: couldn't find srcWindow"));
++ PrintDebugString("ERROR receiving memory package: couldn't find srcWindow");
++ return FALSE;
++ }
++}
++
++/**
++ * processPackage - processes the output of SendMessage(WM_COPYDATA)
++ * to do IPC messaging with the Windows AccessBridge DLL
++ *
++ */
++LRESULT
++JavaAccessBridge::processPackage(char *buffer, int bufsize) {
++ PrintDebugString("\r\nProcessing package sent from Windows, bufsize = %d:", bufsize);
++
++ PackageType *type = (PackageType *) buffer;
++ LRESULT returnVal = 0;
++ PrintDebugString(" PackageType = %X:", *type);
++ jobject rAC;
++
++ switch (*type) {
++
++
++ case cMemoryMappedFileCreatedPackage:
++ // Windows is telling us it created a memory mapped file for us to use
++ // in repsonding to various information querying packages (see below)
++ PrintDebugString(" type == cMemoryMappedFileCreatedPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(MemoryMappedFileCreatedPackage))) {
++ MemoryMappedFileCreatedPackage *pkg =
++ (MemoryMappedFileCreatedPackage *) (buffer + sizeof(PackageType));
++ returnVal = MemoryMappedFileCreated((HWND)ABLongToHandle(pkg->bridgeWindow), pkg->filename);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(MemoryMappedFileCreatedPackage));
++ }
++ break;
++
++ // ------------ information querying packages ------------------
++
++ case cReleaseJavaObjectPackage:
++ PrintDebugString(" type == cReleaseJavaObjectPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(ReleaseJavaObjectPackage))) {
++ ReleaseJavaObjectPackage *pkg =
++ (ReleaseJavaObjectPackage *) (buffer + sizeof(PackageType));
++ releaseJavaObject((jobject)pkg->object);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(ReleaseJavaObjectPackage));
++ }
++ break;
++
++ case cGetAccessBridgeVersionPackage:
++ PrintDebugString(" type == cGetAccessBridgeVersionPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessBridgeVersionPackage))) {
++ GetAccessBridgeVersionPackage *pkg =
++ (GetAccessBridgeVersionPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getVersionInfo(&(pkg->rVersionInfo));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessBridgeVersionPackage));
++ }
++ break;
++
++ case cIsJavaWindowPackage:
++ PrintDebugString(" type == cIsJavaWindowPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(IsJavaWindowPackage))) {
++ IsJavaWindowPackage *pkg =
++ (IsJavaWindowPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult =
++ windowsThreadEntryPoints->isJavaWindow(pkg->window);
++ PrintDebugString(" -> returning result = %d", pkg->rResult);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(IsJavaWindowPackage));
++ }
++ break;
++
++ case cIsSameObjectPackage:
++ PrintDebugString(" type == cIsSameObjectPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(IsSameObjectPackage))) {
++ IsSameObjectPackage *pkg =
++ (IsSameObjectPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult =
++ windowsThreadEntryPoints->isSameObject((jobject)pkg->obj1, (jobject)pkg->obj2);
++ PrintDebugString(" -> returning result = %d", pkg->rResult);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(IsSameObjectPackage));
++ }
++ break;
++
++
++ case cGetAccessibleContextFromHWNDPackage:
++ PrintDebugString(" type == cGetAccessibleContextFromHWNDPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleContextFromHWNDPackage))) {
++ GetAccessibleContextFromHWNDPackage *pkg =
++ (GetAccessibleContextFromHWNDPackage *) (buffer + sizeof(PackageType));
++ rAC = windowsThreadEntryPoints->getAccessibleContextFromHWND(pkg->window);
++ pkg->rAccessibleContext = (JOBJECT64)rAC;
++ pkg->rVMID = HandleToLong(dialogWindow);
++ PrintDebugString(" -> returning AC = %p, vmID = %X", rAC, pkg->rVMID);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleContextFromHWNDPackage));
++ }
++ break;
++
++
++ case cGetHWNDFromAccessibleContextPackage:
++ PrintDebugString(" type == cGetHWNDFromAccessibleContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetHWNDFromAccessibleContextPackage))) {
++ GetHWNDFromAccessibleContextPackage *pkg =
++ (GetHWNDFromAccessibleContextPackage *) (buffer + sizeof(PackageType));
++ pkg->rHWND =
++ ABHandleToLong( windowsThreadEntryPoints->getHWNDFromAccessibleContext((jobject)pkg->accessibleContext) );
++ PrintDebugString(" -> returning HWND = %p", pkg->rHWND);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetHWNDFromAccessibleContextPackage));
++ }
++ break;
++
++
++ /* ===== utility methods ===== */
++
++ case cSetTextContentsPackage:
++ PrintDebugString(" type == cSetTextContentsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(SetTextContentsPackage))) {
++ SetTextContentsPackage *pkg =
++ (SetTextContentsPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult =
++ windowsThreadEntryPoints->setTextContents((jobject)pkg->accessibleContext, pkg->text);
++ PrintDebugString(" -> returning result = %d", pkg->rResult);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(SetTextContentsPackage));
++ }
++ break;
++
++ case cGetParentWithRolePackage:
++ if (bufsize == (sizeof(PackageType) + sizeof(GetParentWithRolePackage))) {
++ GetParentWithRolePackage *pkg =
++ (GetParentWithRolePackage *) (buffer + sizeof(PackageType));
++ rAC = windowsThreadEntryPoints->getParentWithRole((jobject)pkg->accessibleContext, pkg->role);
++ pkg->rAccessibleContext = (JOBJECT64)rAC;
++ PrintDebugString(" type == cGetParentWithRolePackage");
++ PrintDebugString(" pkg->vmID: %X", pkg->vmID);
++ PrintDebugString(" pkg->accessibleContext: %p", (jobject)pkg->accessibleContext);
++ PrintDebugString(" pkg->role: %ls", pkg->role);
++ PrintDebugString(" -> returning rAccessibleContext = %p", rAC);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetParentWithRolePackage));
++ }
++ break;
++
++ case cGetTopLevelObjectPackage:
++ PrintDebugString(" type == cGetTopLevelObjectPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetTopLevelObjectPackage))) {
++ GetTopLevelObjectPackage *pkg =
++ (GetTopLevelObjectPackage *) (buffer + sizeof(PackageType));
++ rAC = windowsThreadEntryPoints->getTopLevelObject((jobject)pkg->accessibleContext);
++ pkg->rAccessibleContext = (JOBJECT64)rAC;
++ PrintDebugString(" -> returning rAccessibleContext = %p", rAC);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetTopLevelObjectPackage));
++ }
++ break;
++
++ case cGetParentWithRoleElseRootPackage:
++ PrintDebugString(" type == cGetParentWithRoleElseRootPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetParentWithRoleElseRootPackage))) {
++ GetParentWithRoleElseRootPackage *pkg =
++ (GetParentWithRoleElseRootPackage *) (buffer + sizeof(PackageType));
++ rAC = windowsThreadEntryPoints->getParentWithRoleElseRoot((jobject)pkg->accessibleContext, pkg->role);
++ pkg->rAccessibleContext = (JOBJECT64)rAC;
++ PrintDebugString(" -> returning rAccessibleContext = %p", rAC);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetParentWithRoleElseRootPackage));
++ }
++ break;
++
++ case cGetObjectDepthPackage:
++ PrintDebugString(" type == cGetObjectDepthPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetObjectDepthPackage))) {
++ GetObjectDepthPackage *pkg =
++ (GetObjectDepthPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult =
++ windowsThreadEntryPoints->getObjectDepth((jobject)pkg->accessibleContext);
++ PrintDebugString(" -> returning rResult = %d", pkg->rResult);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetObjectDepthPackage));
++ }
++ break;
++
++ case cGetActiveDescendentPackage:
++ PrintDebugString(" type == cGetActiveDescendentPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetActiveDescendentPackage))) {
++ GetActiveDescendentPackage *pkg =
++ (GetActiveDescendentPackage *) (buffer + sizeof(PackageType));
++ rAC = windowsThreadEntryPoints->getActiveDescendent((jobject)pkg->accessibleContext);
++ pkg->rAccessibleContext = (JOBJECT64)rAC;
++ PrintDebugString(" -> returning rAccessibleContext = %p", rAC);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetActiveDescendentPackage));
++ }
++ break;
++
++ case cGetAccessibleContextAtPackage:
++ PrintDebugString(" type == cGetAccessibleContextAtPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleContextAtPackage))) {
++ GetAccessibleContextAtPackage *pkg =
++ (GetAccessibleContextAtPackage *) (buffer + sizeof(PackageType));
++ pkg->rAccessibleContext = (JOBJECT64)
++ windowsThreadEntryPoints->getAccessibleContextAt(pkg->x, pkg->y,
++ (jobject)pkg->AccessibleContext);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleContextAtPackage));
++ }
++ break;
++
++ case cGetAccessibleContextWithFocusPackage:
++ PrintDebugString(" type == cGetAccessibleContextWithFocusPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleContextWithFocusPackage))) {
++ GetAccessibleContextWithFocusPackage *pkg =
++ (GetAccessibleContextWithFocusPackage *) (buffer + sizeof(PackageType));
++ pkg->rAccessibleContext = (JOBJECT64)
++ windowsThreadEntryPoints->getAccessibleContextWithFocus();
++ pkg->rVMID = HandleToLong(dialogWindow);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleContextWithFocusPackage));
++ }
++ break;
++
++ case cGetAccessibleContextInfoPackage:
++ PrintDebugString(" type == cGetAccessibleContextInfoPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleContextInfoPackage))) {
++ GetAccessibleContextInfoPackage *pkg =
++ (GetAccessibleContextInfoPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleContextInfo(
++ (jobject)pkg->AccessibleContext, &(pkg->rAccessibleContextInfo));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleContextInfoPackage));
++ }
++ break;
++
++ case cGetAccessibleChildFromContextPackage:
++ PrintDebugString(" type == cGetAccessibleChildFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleChildFromContextPackage))) {
++ GetAccessibleChildFromContextPackage *pkg =
++ (GetAccessibleChildFromContextPackage *) (buffer + sizeof(PackageType));
++ pkg->rAccessibleContext = (JOBJECT64)windowsThreadEntryPoints->getAccessibleChildFromContext(
++ (jobject)pkg->AccessibleContext, pkg->childIndex);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleChildFromContextPackage));
++ }
++ break;
++
++ case cGetAccessibleParentFromContextPackage:
++ PrintDebugString(" type == cGetAccessibleParentFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleParentFromContextPackage))) {
++ GetAccessibleParentFromContextPackage *pkg =
++ (GetAccessibleParentFromContextPackage *) (buffer + sizeof(PackageType));
++ pkg->rAccessibleContext = (JOBJECT64)windowsThreadEntryPoints->getAccessibleParentFromContext(
++ (jobject)pkg->AccessibleContext);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleParentFromContextPackage));
++ }
++ break;
++
++ // ------------ begin AccessibleTable packages ------------------
++
++ case cGetAccessibleTableInfoPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableInfoPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableInfoPackage))) {
++ GetAccessibleTableInfoPackage *pkg =
++ (GetAccessibleTableInfoPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTableInfo((jobject)pkg->accessibleContext,
++ &(pkg->rTableInfo));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableInfoPackage));
++ }
++ break;
++
++ case cGetAccessibleTableCellInfoPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableCellInfoPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableCellInfoPackage))) {
++ GetAccessibleTableCellInfoPackage *pkg =
++ (GetAccessibleTableCellInfoPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTableCellInfo((jobject)pkg->accessibleTable, pkg->row,
++ pkg->column, &(pkg->rTableCellInfo));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableCellInfoPackage));
++ }
++ break;
++
++ case cGetAccessibleTableRowHeaderPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableRowHeaderPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableRowHeaderPackage))) {
++ GetAccessibleTableRowHeaderPackage *pkg =
++ (GetAccessibleTableRowHeaderPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTableRowHeader((jobject)pkg->accessibleContext,
++ &(pkg->rTableInfo));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableRowHeaderPackage));
++ }
++ break;
++
++ case cGetAccessibleTableColumnHeaderPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableColumnHeaderPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableColumnHeaderPackage))) {
++ GetAccessibleTableColumnHeaderPackage *pkg =
++ (GetAccessibleTableColumnHeaderPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTableColumnHeader((jobject)pkg->accessibleContext,
++ &(pkg->rTableInfo));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableColumnHeaderPackage));
++ }
++ break;
++
++
++ case cGetAccessibleTableRowDescriptionPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableRowDescriptionPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableRowDescriptionPackage))) {
++ GetAccessibleTableRowDescriptionPackage *pkg =
++ (GetAccessibleTableRowDescriptionPackage *) (buffer + sizeof(PackageType));
++ pkg->rAccessibleContext = (JOBJECT64)windowsThreadEntryPoints->getAccessibleTableRowDescription(
++ (jobject)pkg->accessibleContext, pkg->row);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableRowDescriptionPackage));
++ }
++ break;
++
++ case cGetAccessibleTableColumnDescriptionPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableColumnDescriptionPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableColumnDescriptionPackage))) {
++ GetAccessibleTableColumnDescriptionPackage *pkg =
++ (GetAccessibleTableColumnDescriptionPackage *) (buffer + sizeof(PackageType));
++ pkg->rAccessibleContext = (JOBJECT64)windowsThreadEntryPoints->getAccessibleTableColumnDescription(
++ (jobject)pkg->accessibleContext, pkg->column);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableColumnDescriptionPackage));
++ }
++ break;
++
++ case cGetAccessibleTableColumnSelectionCountPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableColumnSelectionCountPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableColumnSelectionCountPackage))) {
++ GetAccessibleTableColumnSelectionCountPackage *pkg =
++ (GetAccessibleTableColumnSelectionCountPackage *) (buffer + sizeof(PackageType));
++ pkg->rCount = windowsThreadEntryPoints->getAccessibleTableColumnSelectionCount(
++ (jobject)pkg->accessibleTable);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableColumnSelectionCountPackage));
++ }
++ break;
++
++ case cGetAccessibleTableRowSelectionCountPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableRowSelectionCountPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableRowSelectionCountPackage))) {
++ GetAccessibleTableRowSelectionCountPackage *pkg =
++ (GetAccessibleTableRowSelectionCountPackage *) (buffer + sizeof(PackageType));
++
++ pkg->rCount = windowsThreadEntryPoints->getAccessibleTableRowSelectionCount(
++ (jobject)pkg->accessibleTable);
++
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableRowSelectionCountPackage));
++ }
++ break;
++
++ case cIsAccessibleTableRowSelectedPackage:
++ PrintDebugString(" ##### type == cIsAccessibleTableRowSelectedPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(IsAccessibleTableRowSelectedPackage))) {
++ IsAccessibleTableRowSelectedPackage *pkg =
++ (IsAccessibleTableRowSelectedPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult = windowsThreadEntryPoints->isAccessibleTableRowSelected(
++ (jobject)pkg->accessibleTable, pkg->row);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(IsAccessibleTableRowSelectedPackage));
++ }
++ break;
++
++ case cIsAccessibleTableColumnSelectedPackage:
++ PrintDebugString(" ##### type == cIsAccessibleTableColumnSelectedPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(IsAccessibleTableColumnSelectedPackage))) {
++ IsAccessibleTableColumnSelectedPackage *pkg =
++ (IsAccessibleTableColumnSelectedPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult = windowsThreadEntryPoints->isAccessibleTableColumnSelected(
++ (jobject)pkg->accessibleTable, pkg->column);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(IsAccessibleTableColumnSelectedPackage));
++ }
++ break;
++
++ case cGetAccessibleTableColumnSelectionsPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableColumnSelectionsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableColumnSelectionsPackage))) {
++ GetAccessibleTableColumnSelectionsPackage *pkg =
++ (GetAccessibleTableColumnSelectionsPackage *) (buffer + sizeof(PackageType));
++ PrintDebugString(" ##### cGetAccessibleTableColumnSelectionsPackage count=%d", pkg->count);
++ windowsThreadEntryPoints->getAccessibleTableColumnSelections(
++ (jobject)pkg->accessibleTable, pkg->count, pkg->rSelections);
++
++ for (int i = 0; i < pkg->count; i++) {
++ PrintDebugString(" ##### cGetAccessibleTableColumnSelectionsPackage(%d)=%d", i, pkg->rSelections[i]);
++ }
++
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableColumnSelectionsPackage));
++ }
++ break;
++
++
++ case cGetAccessibleTableRowSelectionsPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableRowSelectionsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableRowSelectionsPackage))) {
++ GetAccessibleTableRowSelectionsPackage *pkg =
++ (GetAccessibleTableRowSelectionsPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTableRowSelections(
++ (jobject)pkg->accessibleTable, pkg->count, pkg->rSelections);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableRowSelectionsPackage));
++ }
++ break;
++
++ case cGetAccessibleTableRowPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableRowPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableRowPackage))) {
++ GetAccessibleTableRowPackage *pkg =
++ (GetAccessibleTableRowPackage *) (buffer + sizeof(PackageType));
++ pkg->rRow = windowsThreadEntryPoints->getAccessibleTableRow(
++ (jobject)pkg->accessibleTable, pkg->index);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableRowPackage));
++ }
++ break;
++
++ case cGetAccessibleTableColumnPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableColumnPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableColumnPackage))) {
++ GetAccessibleTableColumnPackage *pkg =
++ (GetAccessibleTableColumnPackage *) (buffer + sizeof(PackageType));
++ pkg->rColumn = windowsThreadEntryPoints->getAccessibleTableColumn(
++ (jobject)pkg->accessibleTable, pkg->index);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableColumnPackage));
++ }
++ break;
++
++ case cGetAccessibleTableIndexPackage:
++ PrintDebugString(" ##### type == cGetAccessibleTableIndexPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTableIndexPackage))) {
++ GetAccessibleTableIndexPackage *pkg =
++ (GetAccessibleTableIndexPackage *) (buffer + sizeof(PackageType));
++ pkg->rIndex = windowsThreadEntryPoints->getAccessibleTableIndex(
++ (jobject)pkg->accessibleTable, pkg->row, pkg->column);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTableIndexPackage));
++ }
++ break;
++
++ // ------------ end AccessibleTable packages ------------------
++
++
++ // ------------ begin AccessibleRelationSet packages ------------------
++
++ case cGetAccessibleRelationSetPackage:
++ PrintDebugString(" ##### type == cGetAccessibleRelationSetPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleRelationSetPackage))) {
++ GetAccessibleRelationSetPackage *pkg =
++ (GetAccessibleRelationSetPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleRelationSet(
++ (jobject)pkg->accessibleContext, &(pkg->rAccessibleRelationSetInfo));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleRelationSetPackage));
++ }
++ break;
++
++ // ------------ end AccessibleRelationSet packages ------------------
++
++ // ------------ begin AccessibleHypertext packages ------------------
++
++ case cGetAccessibleHypertextPackage:
++ PrintDebugString(" ##### type == cGetAccessibleHypertextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleHypertextPackage))) {
++ GetAccessibleHypertextPackage *pkg =
++ (GetAccessibleHypertextPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleHypertext(
++ (jobject)pkg->accessibleContext, &(pkg->rAccessibleHypertextInfo));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleHypertextPackage));
++ }
++ break;
++
++ case cActivateAccessibleHyperlinkPackage:
++ PrintDebugString(" ##### type == cActivateAccessibleHyperlinkPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(ActivateAccessibleHyperlinkPackage))) {
++ ActivateAccessibleHyperlinkPackage *pkg =
++ (ActivateAccessibleHyperlinkPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult = windowsThreadEntryPoints->activateAccessibleHyperlink(
++ (jobject)pkg->accessibleContext, (jobject)pkg->accessibleHyperlink);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(ActivateAccessibleHyperlinkPackage));
++ }
++ break;
++
++ case cGetAccessibleHyperlinkCountPackage:
++ PrintDebugString(" ##### type == cGetAccessibleHyperlinkCountPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleHyperlinkCountPackage))) {
++ GetAccessibleHyperlinkCountPackage *pkg =
++ (GetAccessibleHyperlinkCountPackage *) (buffer + sizeof(PackageType));
++ pkg->rLinkCount = windowsThreadEntryPoints->getAccessibleHyperlinkCount(
++ (jobject)pkg->accessibleContext);
++ PrintDebugString(" ##### processing succeeded: pkg->rLinkCount = %d", pkg->rLinkCount);
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleHyperlinkCountPackage));
++ }
++ break;
++
++ case cGetAccessibleHypertextExtPackage:
++ PrintDebugString(" ##### type == cGetAccessibleHypertextExtPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleHypertextExtPackage))) {
++ GetAccessibleHypertextExtPackage *pkg =
++ (GetAccessibleHypertextExtPackage *) (buffer + sizeof(PackageType));
++ pkg->rSuccess = windowsThreadEntryPoints->getAccessibleHypertextExt(
++ (jobject)pkg->accessibleContext, pkg->startIndex, &(pkg->rAccessibleHypertextInfo));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleHypertextExtPackage));
++ }
++ break;
++
++ case cGetAccessibleHypertextLinkIndexPackage:
++ PrintDebugString(" ##### type == cGetAccessibleHypertextLinkIndexPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleHypertextLinkIndexPackage))) {
++ GetAccessibleHypertextLinkIndexPackage *pkg =
++ (GetAccessibleHypertextLinkIndexPackage *) (buffer + sizeof(PackageType));
++ pkg->rLinkIndex = windowsThreadEntryPoints->getAccessibleHypertextLinkIndex(
++ (jobject)pkg->hypertext, pkg->charIndex);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleHypertextLinkIndexPackage));
++ }
++ break;
++
++ case cGetAccessibleHyperlinkPackage:
++ PrintDebugString(" ##### type == cGetAccessibleHyperlinkPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleHyperlinkPackage))) {
++ GetAccessibleHyperlinkPackage *pkg =
++ (GetAccessibleHyperlinkPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleHyperlink((jobject)pkg->hypertext, pkg->linkIndex,
++ &(pkg->rAccessibleHyperlinkInfo));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleHyperlinkPackage));
++ }
++ break;
++
++ // ------------ end AccessibleHypertext packages
++
++ // ------------ begin Accessible KeyBindings, Icons and Actions
++
++ case cGetAccessibleKeyBindingsPackage:
++ PrintDebugString(" ##### type == cGetAccessibleKeyBindingsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleKeyBindingsPackage))) {
++ GetAccessibleKeyBindingsPackage *pkg =
++ (GetAccessibleKeyBindingsPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleKeyBindings (
++ (jobject)pkg->accessibleContext, &(pkg->rAccessibleKeyBindings));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleKeyBindingsPackage));
++ }
++ break;
++
++ case cGetAccessibleIconsPackage:
++ PrintDebugString(" ##### type == cGetAccessibleIconsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleIconsPackage))) {
++ GetAccessibleIconsPackage *pkg =
++ (GetAccessibleIconsPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleIcons (
++ (jobject)pkg->accessibleContext, &(pkg->rAccessibleIcons));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleIconsPackage));
++ }
++ break;
++
++
++ case cGetAccessibleActionsPackage:
++ PrintDebugString(" ##### type == cGetAccessibleActionsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleActionsPackage))) {
++ GetAccessibleActionsPackage *pkg =
++ (GetAccessibleActionsPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleActions (
++ (jobject)pkg->accessibleContext, &(pkg->rAccessibleActions));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleActionsPackage));
++ }
++ break;
++
++ case cDoAccessibleActionsPackage:
++ PrintDebugString(" ##### type == cDoAccessibleActionsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(DoAccessibleActionsPackage))) {
++ DoAccessibleActionsPackage *pkg =
++ (DoAccessibleActionsPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult =
++ windowsThreadEntryPoints->doAccessibleActions((jobject)pkg->accessibleContext, &(pkg->actionsToDo),
++ &(pkg->failure));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(DoAccessibleActionsPackage));
++ }
++ break;
++
++ // ------------ begin addtional methods for Teton
++
++ case cGetVirtualAccessibleNamePackage:
++ PrintDebugString(" ##### type == GetVirtualAccessibleNamePackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetVirtualAccessibleNamePackage))) {
++ GetVirtualAccessibleNamePackage *pkg =
++ (GetVirtualAccessibleNamePackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getVirtualAccessibleName ((const jobject)pkg->accessibleContext,
++ pkg->rName,
++ pkg->len);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetVirtualAccessibleNamePackage));
++ }
++ break;
++
++ case cRequestFocusPackage:
++ PrintDebugString(" ##### type == RequestFocusPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(RequestFocusPackage))) {
++ RequestFocusPackage *pkg =
++ (RequestFocusPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->requestFocus (
++ (jobject)pkg->accessibleContext);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(RequestFocusPackage));
++ }
++ break;
++
++ case cSelectTextRangePackage:
++ PrintDebugString(" ##### type == SelectTextRangePackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(SelectTextRangePackage))) {
++ SelectTextRangePackage *pkg =
++ (SelectTextRangePackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->selectTextRange (
++ (jobject)pkg->accessibleContext, pkg->startIndex, pkg->endIndex);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(SelectTextRangePackage));
++ }
++ break;
++
++ case cGetTextAttributesInRangePackage:
++ PrintDebugString(" ##### type == GetTextAttributesInRangePackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetTextAttributesInRangePackage))) {
++ GetTextAttributesInRangePackage *pkg =
++ (GetTextAttributesInRangePackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getTextAttributesInRange (
++ (jobject)pkg->accessibleContext, pkg->startIndex, pkg->endIndex,
++ (AccessibleTextAttributesInfo *)&(pkg->attributes),
++ &(pkg->rLength));
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetTextAttributesInRangePackage));
++ }
++ break;
++
++
++ case cGetVisibleChildrenCountPackage:
++ PrintDebugString(" ##### type == GetVisibleChildrenCountPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetVisibleChildrenCountPackage))) {
++ GetVisibleChildrenCountPackage *pkg =
++ (GetVisibleChildrenCountPackage *) (buffer + sizeof(PackageType));
++ pkg->rChildrenCount = windowsThreadEntryPoints->getVisibleChildrenCount ((jobject)pkg->accessibleContext);
++
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetVisibleChildrenCountPackage));
++ }
++ break;
++
++ case cGetVisibleChildrenPackage:
++ PrintDebugString(" ##### type == GetVisibleChildrenPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetVisibleChildrenPackage))) {
++ GetVisibleChildrenPackage *pkg =
++ (GetVisibleChildrenPackage *) (buffer + sizeof(PackageType));
++ pkg->rSuccess = windowsThreadEntryPoints->getVisibleChildren ((jobject)pkg->accessibleContext,
++ pkg->startIndex,
++ &(pkg->rVisibleChildrenInfo));
++
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetVisibleChildrenPackage));
++ }
++ break;
++
++ case cSetCaretPositionPackage:
++ PrintDebugString(" ##### type == SetCaretPositionPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(SetCaretPositionPackage))) {
++ SetCaretPositionPackage *pkg =
++ (SetCaretPositionPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->setCaretPosition (
++ (jobject)pkg->accessibleContext, pkg->position);
++ PrintDebugString(" ##### processing succeeded");
++ } else {
++ PrintDebugString(" ##### processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(SetCaretPositionPackage));
++ }
++ break;
++
++ // ------------ end additional methods for Teton
++
++ // ------------ end Accessible KeyBindings, Icons and Actions
++
++ // ------------ Accessible Text packages ------------------
++
++ case cGetAccessibleTextInfoPackage:
++ PrintDebugString(" type == cGetAccessibleTextInfoPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTextInfoPackage))) {
++ GetAccessibleTextInfoPackage *pkg =
++ (GetAccessibleTextInfoPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTextInfo((jobject)pkg->AccessibleContext,
++ &(pkg->rTextInfo), pkg->x, pkg->y);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTextInfoPackage));
++ }
++ break;
++
++ case cGetAccessibleTextItemsPackage:
++ PrintDebugString(" type == cGetAccessibleTextItemsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTextItemsPackage))) {
++ GetAccessibleTextItemsPackage *pkg =
++ (GetAccessibleTextItemsPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTextItems((jobject)pkg->AccessibleContext,
++ &(pkg->rTextItemsInfo), pkg->index);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTextInfoPackage));
++ }
++ break;
++
++ case cGetAccessibleTextSelectionInfoPackage:
++ PrintDebugString(" type == cGetAccessibleTextSelectionInfoPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTextSelectionInfoPackage))) {
++ GetAccessibleTextSelectionInfoPackage *pkg =
++ (GetAccessibleTextSelectionInfoPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTextSelectionInfo(
++ (jobject)pkg->AccessibleContext, &(pkg->rTextSelectionItemsInfo));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTextSelectionInfoPackage));
++ }
++ break;
++
++ case cGetAccessibleTextAttributeInfoPackage:
++ PrintDebugString(" type == cGetAccessibleTextAttributeInfoPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTextAttributeInfoPackage))) {
++ GetAccessibleTextAttributeInfoPackage *pkg =
++ (GetAccessibleTextAttributeInfoPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTextAttributes(
++ (jobject)pkg->AccessibleContext, pkg->index, (AccessibleTextAttributesInfo *) &(pkg->rAttributeInfo));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTextAttributeInfoPackage));
++ }
++ break;
++
++ case cGetAccessibleTextRectInfoPackage:
++ PrintDebugString(" type == cGetAccessibleTextRectInfoPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTextRectInfoPackage))) {
++ GetAccessibleTextRectInfoPackage *pkg =
++ (GetAccessibleTextRectInfoPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTextRect((jobject)pkg->AccessibleContext,
++ &(pkg->rTextRectInfo), pkg->index);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTextRectInfoPackage));
++ }
++ break;
++
++ case cGetCaretLocationPackage:
++ PrintDebugString(" type == cGetCaretLocationPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetCaretLocationPackage))) {
++ GetCaretLocationPackage *pkg =
++ (GetCaretLocationPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getCaretLocation((jobject)pkg->AccessibleContext,
++ &(pkg->rTextRectInfo), pkg->index);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetCaretLocationPackage));
++ }
++ break;
++
++ case cGetAccessibleTextLineBoundsPackage:
++ PrintDebugString(" type == cGetAccessibleTextLineBoundsPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTextLineBoundsPackage))) {
++ GetAccessibleTextLineBoundsPackage *pkg =
++ (GetAccessibleTextLineBoundsPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTextLineBounds((jobject)pkg->AccessibleContext,
++ pkg->index, &(pkg->rLineStart), &(pkg->rLineEnd));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTextLineBoundsPackage));
++ }
++ break;
++
++ case cGetAccessibleTextRangePackage:
++ PrintDebugString(" type == cGetAccessibleTextRangePackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleTextRangePackage))) {
++ GetAccessibleTextRangePackage *pkg =
++ (GetAccessibleTextRangePackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getAccessibleTextRange((jobject)pkg->AccessibleContext,
++ pkg->start, pkg->end, (wchar_t *) &(pkg->rText), (sizeof(pkg->rText) / sizeof(wchar_t)));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleTextRangePackage));
++ }
++ break;
++
++
++ // ------------ Accessible Value packages ------------------
++
++ case cGetCurrentAccessibleValueFromContextPackage:
++ PrintDebugString(" type == cGetCurrentAccessibleValueFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetCurrentAccessibleValueFromContextPackage))) {
++ GetCurrentAccessibleValueFromContextPackage *pkg =
++ (GetCurrentAccessibleValueFromContextPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getCurrentAccessibleValueFromContext((jobject)pkg->AccessibleContext,
++ (wchar_t *) &(pkg->rValue), (sizeof(pkg->rValue) / sizeof(wchar_t)));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetCurrentAccessibleValueFromContextPackage));
++ }
++ break;
++
++ case cGetMaximumAccessibleValueFromContextPackage:
++ PrintDebugString(" type == cGetMaximumAccessibleValueFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetMaximumAccessibleValueFromContextPackage))) {
++ GetMaximumAccessibleValueFromContextPackage *pkg =
++ (GetMaximumAccessibleValueFromContextPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getMaximumAccessibleValueFromContext((jobject)pkg->AccessibleContext,
++ (wchar_t *) &(pkg->rValue), (sizeof(pkg->rValue) / sizeof(wchar_t)));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetMaximumAccessibleValueFromContextPackage));
++ }
++ break;
++
++ case cGetMinimumAccessibleValueFromContextPackage:
++ PrintDebugString(" type == cGetMinimumAccessibleValueFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetMinimumAccessibleValueFromContextPackage))) {
++ GetMinimumAccessibleValueFromContextPackage *pkg =
++ (GetMinimumAccessibleValueFromContextPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->getMinimumAccessibleValueFromContext((jobject)pkg->AccessibleContext,
++ (wchar_t *) &(pkg->rValue), (sizeof(pkg->rValue) / sizeof(wchar_t)));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetMinimumAccessibleValueFromContextPackage));
++ }
++ break;
++
++ // ------------ Accessible Selection packages ------------------
++
++ case cAddAccessibleSelectionFromContextPackage:
++ PrintDebugString(" type == cAddAccessibleSelectionFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(AddAccessibleSelectionFromContextPackage))) {
++ AddAccessibleSelectionFromContextPackage *pkg =
++ (AddAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->addAccessibleSelectionFromContext((jobject)pkg->AccessibleContext,
++ pkg->index);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(AddAccessibleSelectionFromContextPackage));
++ }
++ break;
++
++ case cClearAccessibleSelectionFromContextPackage:
++ PrintDebugString(" type == cClearAccessibleSelectionFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(ClearAccessibleSelectionFromContextPackage))) {
++ ClearAccessibleSelectionFromContextPackage *pkg =
++ (ClearAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->clearAccessibleSelectionFromContext((jobject)pkg->AccessibleContext);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(ClearAccessibleSelectionFromContextPackage));
++ }
++ break;
++
++ case cGetAccessibleSelectionFromContextPackage:
++ PrintDebugString(" type == cGetAccessibleSelectionFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleSelectionFromContextPackage))) {
++ GetAccessibleSelectionFromContextPackage *pkg =
++ (GetAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ pkg->rAccessibleContext = (JOBJECT64)windowsThreadEntryPoints->getAccessibleSelectionFromContext(
++ (jobject)pkg->AccessibleContext, pkg->index);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleSelectionFromContextPackage));
++ }
++ break;
++
++ case cGetAccessibleSelectionCountFromContextPackage:
++ PrintDebugString(" type == cGetAccessibleSelectionCountFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(GetAccessibleSelectionCountFromContextPackage))) {
++ GetAccessibleSelectionCountFromContextPackage *pkg =
++ (GetAccessibleSelectionCountFromContextPackage *) (buffer + sizeof(PackageType));
++ pkg->rCount = windowsThreadEntryPoints->getAccessibleSelectionCountFromContext(
++ (jobject)pkg->AccessibleContext);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(GetAccessibleSelectionCountFromContextPackage));
++ }
++ break;
++
++ case cIsAccessibleChildSelectedFromContextPackage:
++ PrintDebugString(" type == cIsAccessibleChildSelectedFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(IsAccessibleChildSelectedFromContextPackage))) {
++ IsAccessibleChildSelectedFromContextPackage *pkg =
++ (IsAccessibleChildSelectedFromContextPackage *) (buffer + sizeof(PackageType));
++ pkg->rResult = windowsThreadEntryPoints->isAccessibleChildSelectedFromContext(
++ (jobject)pkg->AccessibleContext, pkg->index);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(IsAccessibleChildSelectedFromContextPackage));
++ }
++ break;
++
++ case cRemoveAccessibleSelectionFromContextPackage:
++ PrintDebugString(" type == cRemoveAccessibleSelectionFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(RemoveAccessibleSelectionFromContextPackage))) {
++ RemoveAccessibleSelectionFromContextPackage *pkg =
++ (RemoveAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->removeAccessibleSelectionFromContext((jobject)pkg->AccessibleContext,
++ pkg->index);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(RemoveAccessibleSelectionFromContextPackage));
++ }
++ break;
++
++ case cSelectAllAccessibleSelectionFromContextPackage:
++ PrintDebugString(" type == cSelectAllAccessibleSelectionFromContextPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(SelectAllAccessibleSelectionFromContextPackage))) {
++ SelectAllAccessibleSelectionFromContextPackage *pkg =
++ (SelectAllAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ windowsThreadEntryPoints->selectAllAccessibleSelectionFromContext((jobject)pkg->AccessibleContext);
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(SelectAllAccessibleSelectionFromContextPackage));
++ }
++ break;
++
++
++ // ------------ event notification management packages ------------------
++
++ case cAddJavaEventNotificationPackage:
++ PrintDebugString(" type = cAddJavaEventNotificationPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(AddJavaEventNotificationPackage))) {
++ AddJavaEventNotificationPackage *pkg =
++ (AddJavaEventNotificationPackage *) (buffer + sizeof(PackageType));
++ addJavaEventNotification(pkg->type, (HWND)ABLongToHandle( pkg->DLLwindow ) );
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(AddJavaEventNotificationPackage));
++ }
++ break;
++
++ case cRemoveJavaEventNotificationPackage:
++ PrintDebugString(" type = cRemoveJavaEventNotificationPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(RemoveJavaEventNotificationPackage))) {
++ RemoveJavaEventNotificationPackage *pkg =
++ (RemoveJavaEventNotificationPackage *) (buffer + sizeof(PackageType));
++ removeJavaEventNotification(pkg->type, (HWND)ABLongToHandle( pkg->DLLwindow ));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(RemoveJavaEventNotificationPackage));
++ }
++ break;
++
++ case cAddAccessibilityEventNotificationPackage:
++ PrintDebugString(" type = cAddAccessibilityEventNotificationPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(AddAccessibilityEventNotificationPackage))) {
++ AddAccessibilityEventNotificationPackage *pkg =
++ (AddAccessibilityEventNotificationPackage *) (buffer + sizeof(PackageType));
++ addAccessibilityEventNotification(pkg->type, (HWND)ABLongToHandle(pkg->DLLwindow));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(AddAccessibilityEventNotificationPackage));
++ }
++ break;
++
++ case cRemoveAccessibilityEventNotificationPackage:
++ PrintDebugString(" type = cRemoveAccessibilityEventNotificationPackage");
++ if (bufsize == (sizeof(PackageType) + sizeof(RemoveAccessibilityEventNotificationPackage))) {
++ RemoveAccessibilityEventNotificationPackage *pkg =
++ (RemoveAccessibilityEventNotificationPackage *) (buffer + sizeof(PackageType));
++ removeAccessibilityEventNotification(pkg->type, (HWND)ABLongToHandle(pkg->DLLwindow));
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(RemoveAccessibilityEventNotificationPackage));
++ }
++ break;
++
++ default:
++ PrintDebugString(" processing FAILED!! -> don't know how to handle type = %X", *type);
++ returnVal = -1;
++ break;
++ }
++
++ PrintDebugString(" package processing completed");
++ return returnVal;
++}
++
++
++// -----------------------------
++
++
++/**
++ * MemoryMappedFileCreated
++ * - WindowsDLL letting us know it's created a memory-mapped file
++ * for IPC. We need to open it and write a magic string into
++ * it to let the WindowsDLL know all is OK. Also we need to
++ * set up our own data structures to communicate with the
++ * WindowsDLL
++ *
++ */
++LRESULT
++JavaAccessBridge::MemoryMappedFileCreated(HWND ATBridgeDLLWindow, char *filename) {
++ PrintDebugString(" in MemoryMappedFileCreated(%p, %s)!", ATBridgeDLLWindow, filename);
++ AccessBridgeATInstance *newAT =
++ new AccessBridgeATInstance(dialogWindow, ATBridgeDLLWindow, filename, ATs);
++ PrintDebugString(" just created a new ATInstance = %p, old = %p", newAT, ATs);
++ ATs = newAT;
++
++ LRESULT returnVal = ATs->initiateIPC();
++ if (returnVal == 0) {
++ PrintDebugString(" Successfully initiated IPC with AT!!!");
++ } else {
++ PrintDebugString(" ERROR: Failed to initiate IPC with AT!!!");
++ }
++
++ return returnVal;
++}
++
++
++/**
++ * WindowsATDestroyed - lets the JavaABDLL know a Windows AT disappeared
++ *
++ */
++void
++JavaAccessBridge::WindowsATDestroyed(HWND ATBridgeDLLWindow) {
++ PrintDebugString("\r\nin JavaAccessBridge::WindowsATDestroyed(%p)", ATBridgeDLLWindow);
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! -> ATs == 0! (shouldn't happen here)");
++ return;
++ }
++
++ AccessBridgeATInstance *currentAT = ATs;
++ AccessBridgeATInstance *previousAT = ATs;
++ if (ATs->winAccessBridgeWindow == ATBridgeDLLWindow) {
++ ATs = ATs->nextATInstance;
++ // remove event notification for this AT
++ removeJavaEventNotification(currentAT->javaEventMask, ATBridgeDLLWindow);
++ removeAccessibilityEventNotification(currentAT->accessibilityEventMask, ATBridgeDLLWindow);
++ delete currentAT;
++ PrintDebugString(" data structures successfully removed");
++ } else {
++ while (currentAT != (AccessBridgeATInstance *) NULL) {
++ if (currentAT->winAccessBridgeWindow == ATBridgeDLLWindow) {
++ previousAT->nextATInstance = currentAT->nextATInstance;
++ delete currentAT;
++ PrintDebugString(" data structures successfully removed");
++ return;
++ } else {
++ previousAT = currentAT;
++ currentAT = currentAT->nextATInstance;
++ }
++ }
++ PrintDebugString(" ERROR!! couldn't find matching data structures!");
++ }
++}
++
++
++// -----------------------------
++
++
++/**
++ * releaseJavaObject - lets the JavaVM know it can release the Java Object
++ *
++ * Note: once you have made this call, the JavaVM will garbage collect
++ * the jobject you pass in. If you later use that jobject in another
++ * call, you will cause all maner of havoc!
++ *
++ */
++void
++JavaAccessBridge::releaseJavaObject(jobject object) {
++ PrintDebugString("In JavaAccessBridge::releaseJavaObject");
++ PrintDebugString(" object X: %p", object);
++ if (windowsThreadJNIEnv != (JNIEnv *) 0) {
++ windowsThreadJNIEnv->DeleteGlobalRef(object);
++ PrintDebugString(" global reference deleted.", object);
++ } else {
++ PrintDebugString(" Error! windowsThreadJNIEnv == 0");
++ }
++}
++
++// -----------------------------
++
++/**
++ * addJavaEventNotification - this AT now wants this type of events
++ *
++ */
++void
++JavaAccessBridge::addJavaEventNotification(jlong type, HWND DLLwindow) {
++ // walk through list of ATs, find this one and add this type
++ // and, if we weren't listening for these before, ask Java for 'em
++ PrintDebugString(" adding Java event type %016I64X to HWND %p", type, DLLwindow);
++ AccessBridgeATInstance *ati = ATs;
++ long globalEventMask = 0;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->winAccessBridgeWindow == DLLwindow) {
++ ati->javaEventMask |= type;
++ PrintDebugString(" found HWND, javaEventMask now is %X", ati->javaEventMask);
++ } else {
++ globalEventMask |= ati->javaEventMask;
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" union of all Java AT event masks: %X", globalEventMask);
++ if (!(globalEventMask & type)) {
++ // no other ATs wanted this event;
++ // start getting them from Java
++ PrintDebugString(" no other AT wanted this Java event (so not registered); adding to AccessBridge.java");
++ windowsThreadEntryPoints->addJavaEventNotification(type);
++ }
++}
++
++/**
++ * removeJavaEventNotification - this AT no longer wants this type of events
++ *
++ */
++void
++JavaAccessBridge::removeJavaEventNotification(jlong type, HWND DLLwindow) {
++ // walk through list of ATs, find this one and remove this type
++ // and, if no other AT wants 'em either, tell Java we no longer want 'em
++ PrintDebugString(" removing Java event type %016I64X from HWND %p", type, DLLwindow);
++ AccessBridgeATInstance *ati = ATs;
++ long globalEventMask = 0;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->winAccessBridgeWindow == DLLwindow) {
++ ati->javaEventMask &= (0xFFFFFFFF - type);
++ PrintDebugString(" found HWND, javaEventMask now is %X", ati->javaEventMask);
++ } else {
++ globalEventMask |= ati->javaEventMask;
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" union of all Java AT event masks: %X", globalEventMask);
++ if (!(globalEventMask & type)) {
++ // no other ATs wanted this event;
++ // stop getting them from Java
++ PrintDebugString(" no other AT wanted this Java event (so can remove); removing from AccessBridge.java");
++ windowsThreadEntryPoints->removeJavaEventNotification(type);
++ }
++}
++
++
++/**
++ * addAccesibilityEventNotification - this AT now wants this type of events
++ *
++ */
++void
++JavaAccessBridge::addAccessibilityEventNotification(jlong type, HWND DLLwindow) {
++ // walk through list of ATs, find this one and add this type
++ // and, if we weren't listening for these before, ask Java for 'em
++ PrintDebugString(" adding Accesibility event type %016I64X to HWND %p", type, DLLwindow);
++ AccessBridgeATInstance *ati = ATs;
++ long globalEventMask = 0;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->winAccessBridgeWindow == DLLwindow) {
++ ati->accessibilityEventMask |= type;
++ PrintDebugString(" found HWND, accessibilityEventMask now is %X", ati->accessibilityEventMask);
++ } else {
++ globalEventMask |= ati->accessibilityEventMask;
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" union of all Accessibility AT event masks: %X", globalEventMask);
++ if (!(globalEventMask & type)) {
++ // no other ATs wanted this event;
++ // start getting them from Java
++ PrintDebugString(" no other AT wanted this Accesibility event (so not registered); adding to AccessBridge.java");
++ windowsThreadEntryPoints->addAccessibilityEventNotification(type);
++ }
++}
++
++/**
++ * removeAccesibilityEventNotification - this AT no longer wants this type of events
++ *
++ */
++void
++JavaAccessBridge::removeAccessibilityEventNotification(jlong type, HWND DLLwindow) {
++ // walk through list of ATs, find this one and remove this type
++ // and, if no other AT wants 'em either, tell Java we no longer want 'em
++ PrintDebugString(" removing Accesibility event type %016I64X from HWND %p", type, DLLwindow);
++ AccessBridgeATInstance *ati = ATs;
++ long globalEventMask = 0;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->winAccessBridgeWindow == DLLwindow) {
++ ati->accessibilityEventMask &= (0xFFFFFFFF - type);
++ PrintDebugString(" found HWND, accessibilityEventMask now is %X", ati->accessibilityEventMask);
++ } else {
++ globalEventMask |= ati->accessibilityEventMask;
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" union of all Accessibility AT event masks: %X", globalEventMask);
++ if (!(globalEventMask & type)) {
++ // no other ATs wanted this event;
++ // stop getting them from Java
++ PrintDebugString(" no other AT wanted this Accessibility event (so can remove); removing from AccessBridge.java");
++ windowsThreadEntryPoints->removeAccessibilityEventNotification(type);
++ }
++}
++
++
++
++
++/**
++ * firePropertyCaretChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyCaretChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jint oldValue, jint newValue) {
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyCaretChanged(%p, %p, %p, %p, %d, %d)",
++ env, callingObj, event,
++ source, oldValue, newValue);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ char buffer[sizeof(PackageType) + sizeof(PropertyCaretChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyCaretChangePackage *pkg = (PropertyCaretChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyCaretChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyCaretChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ pkg->oldPosition = oldValue;
++ pkg->newPosition = newValue;
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyCaretChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyCaretChange event");
++}
++
++/**
++ * firePropertyDescriptionChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyDescriptionChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue){
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyDescriptionChanged(%p, %p, %p, %p, %p, %p)",
++ env, callingObj, event,
++ source, oldValue, newValue);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ const wchar_t *stringBytes;
++ char buffer[sizeof(PackageType) + sizeof(PropertyDescriptionChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyDescriptionChangePackage *pkg = (PropertyDescriptionChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyDescriptionChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyCaretChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ if (oldValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(oldValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->oldDescription, stringBytes, (sizeof(pkg->oldDescription) / sizeof(wchar_t)));
++ env->ReleaseStringChars(oldValue, stringBytes);
++ } else {
++ wcsncpy(pkg->oldDescription, L"(null)", (sizeof(pkg->oldDescription) / sizeof(wchar_t)));
++ }
++
++ if (newValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(newValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->newDescription, stringBytes, (sizeof(pkg->newDescription) / sizeof(wchar_t)));
++ env->ReleaseStringChars(newValue, stringBytes);
++ } else {
++ wcsncpy(pkg->newDescription, L"(null)", (sizeof(pkg->newDescription) / sizeof(wchar_t)));
++ }
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyDescriptionChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyDescriptionChange event");
++}
++
++/**
++ * firePropertyNameChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyNameChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue){
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyNameChanged(%p, %p, %p, %p, %p, %p)",
++ env, callingObj, event,
++ source, oldValue, newValue);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ const wchar_t *stringBytes;
++ char buffer[sizeof(PackageType) + sizeof(PropertyNameChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyNameChangePackage *pkg = (PropertyNameChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyNameChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyNameChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ if (oldValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(oldValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->oldName, stringBytes, (sizeof(pkg->oldName) / sizeof(wchar_t)));
++ env->ReleaseStringChars(oldValue, stringBytes);
++ } else {
++ wcsncpy(pkg->oldName, L"(null)", (sizeof(pkg->oldName) / sizeof(wchar_t)));
++ }
++
++ if (newValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(newValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->newName, stringBytes, (sizeof(pkg->newName) / sizeof(wchar_t)));
++ env->ReleaseStringChars(newValue, stringBytes);
++ } else {
++ wcsncpy(pkg->newName, L"(null)", (sizeof(pkg->newName) / sizeof(wchar_t)));
++ }
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyNameChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyNameChange event");
++}
++
++
++/**
++ * firePropertySelectionChange
++ *
++ */
++void
++JavaAccessBridge::firePropertySelectionChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source) {
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertySelectionChanged(%p, %p, %p, %p)",
++ env, callingObj, event, source);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ char buffer[sizeof(PackageType) + sizeof(PropertySelectionChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertySelectionChangePackage *pkg = (PropertySelectionChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertySelectionChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertySelectionChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertySelectionChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertySelectionChange event");
++}
++
++
++/**
++ * firePropertyStateChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyStateChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue){
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyStateChanged(%p, %p, %p, %p, %p, %p)",
++ env, callingObj, event,
++ source, oldValue, newValue);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ const wchar_t *stringBytes;
++ char buffer[sizeof(PackageType) + sizeof(PropertyStateChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyStateChangePackage *pkg = (PropertyStateChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyStateChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyStateChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ if (oldValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(oldValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->oldState, stringBytes, (sizeof(pkg->oldState) / sizeof(wchar_t)));
++ env->ReleaseStringChars(oldValue, stringBytes);
++ } else {
++ wcsncpy(pkg->oldState, L"(null)", (sizeof(pkg->oldState) / sizeof(wchar_t)));
++ }
++
++ if (newValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(newValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->newState, stringBytes, (sizeof(pkg->newState) / sizeof(wchar_t)));
++ env->ReleaseStringChars(newValue, stringBytes);
++ } else {
++ wcsncpy(pkg->newState, L"(null)", (sizeof(pkg->newState) / sizeof(wchar_t)));
++ }
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyStateChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyStateChange event");
++}
++
++
++/**
++ * firePropertyTextChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyTextChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source) {
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyTextChanged(%p, %p, %p, %p)",
++ env, callingObj, event, source);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ char buffer[sizeof(PackageType) + sizeof(PropertyTextChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyTextChangePackage *pkg = (PropertyTextChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyTextChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyTextChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyTextChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyTextChange event");
++}
++
++
++/**
++ * firePropertyValueChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyValueChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue){
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyValueChanged(%p, %p, %p, %p, %p, %p)",
++ env, callingObj, event,
++ source, oldValue, newValue);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ const wchar_t *stringBytes;
++ char buffer[sizeof(PackageType) + sizeof(PropertyValueChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyValueChangePackage *pkg = (PropertyValueChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyValueChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyValueChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ if (oldValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(oldValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->oldValue, stringBytes, (sizeof(pkg->oldValue) / sizeof(wchar_t)));
++ env->ReleaseStringChars(oldValue, stringBytes);
++ } else {
++ wcsncpy(pkg->oldValue, L"(null)", (sizeof(pkg->oldValue) / sizeof(wchar_t)));
++ }
++
++ if (newValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(newValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->newValue, stringBytes, (sizeof(pkg->newValue) / sizeof(wchar_t)));
++ env->ReleaseStringChars(newValue, stringBytes);
++ } else {
++ wcsncpy(pkg->newValue, L"(null)", (sizeof(pkg->newValue) / sizeof(wchar_t)));
++ }
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyValueChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyValueChange event");
++}
++
++/**
++ * firePropertyVisibleDataChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyVisibleDataChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source) {
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyVisibleDataChanged(%p, %p, %p, %p)",
++ env, callingObj, event, source);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ char buffer[sizeof(PackageType) + sizeof(PropertyVisibleDataChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyVisibleDataChangePackage *pkg = (PropertyVisibleDataChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyVisibleDataChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyVisibleDataChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyVisibleDataChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyVisibleDataChange event");
++}
++
++
++/**
++ * firePropertyChildChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyChildChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jobject oldValue, jobject newValue){
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyChildPropertyChanged(%p, %p, %p, %p, %p, %p)",
++ env, callingObj, event,
++ source, oldValue, newValue);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ char buffer[sizeof(PackageType) + sizeof(PropertyChildChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyChildChangePackage *pkg = (PropertyChildChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyChildChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyChildChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++ pkg->oldChildAccessibleContext = (JOBJECT64)env->NewGlobalRef(oldValue);
++ pkg->newChildAccessibleContext = (JOBJECT64)env->NewGlobalRef(newValue);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++ PrintDebugString(" GlobalRef'd OldChildAC: %p", pkg->oldChildAccessibleContext);
++ PrintDebugString(" GlobalRef'd NewChildAC: %p", pkg->newChildAccessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++ PrintDebugString(" GlobalRef'd OldChildAC: %016I64X", pkg->oldChildAccessibleContext);
++ PrintDebugString(" GlobalRef'd NewChildAC: %016I64X", pkg->newChildAccessibleContext);
++#endif
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyChildChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyChildChange event");
++}
++
++
++/**
++ * firePropertyActiveDescendentChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyActiveDescendentChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jobject oldValue, jobject newValue){
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyActiveDescendentPropertyChanged(%p, %p, %p, %p, %p, %p)",
++ env, callingObj, event,
++ source, oldValue, newValue);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ char buffer[sizeof(PackageType) + sizeof(PropertyActiveDescendentChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyActiveDescendentChangePackage *pkg = (PropertyActiveDescendentChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyActiveDescendentChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyActiveDescendentChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++ pkg->oldActiveDescendentAccessibleContext = (JOBJECT64)env->NewGlobalRef(oldValue);
++ pkg->newActiveDescendentAccessibleContext = (JOBJECT64)env->NewGlobalRef(newValue);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++ PrintDebugString(" GlobalRef'd OldActiveDescendentAC: %p", pkg->oldActiveDescendentAccessibleContext);
++ PrintDebugString(" GlobalRef'd NewActiveDescendentAC: %p", pkg->newActiveDescendentAccessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++ PrintDebugString(" GlobalRef'd OldActiveDescendentAC: %016I64X", pkg->oldActiveDescendentAccessibleContext);
++ PrintDebugString(" GlobalRef'd NewActiveDescendentAC: %016I64X", pkg->newActiveDescendentAccessibleContext);
++#endif
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyActiveDescendentChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyActiveChange event");
++}
++
++/**
++ * firePropertyValueChange
++ *
++ */
++void
++JavaAccessBridge::firePropertyTableModelChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue){
++
++ PrintDebugString("\r\nJava_com_sun_java_accessibility_AccessBridge_propertyTableModelChange(%p, %p, %p, %p, %p, %p)",
++ env, callingObj, event,
++ source, oldValue, newValue);
++
++ // sanity check
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; // panic!
++ }
++
++ // common setup
++ const wchar_t *stringBytes;
++ char buffer[sizeof(PackageType) + sizeof(PropertyTableModelChangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ PropertyTableModelChangePackage *pkg = (PropertyTableModelChangePackage *) (buffer + sizeof(PackageType));
++ *type = cPropertyTableModelChangePackage;
++ pkg->vmID = (long) dialogWindow;
++
++ // make new Global Refs and send events only to those ATs that want 'em
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->accessibilityEventMask & cPropertyTableModelChangeEvent) {
++
++ PrintDebugString(" sending to AT");
++
++ // make new GlobalRefs for this AT
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(event);
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event);
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++ if (oldValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(oldValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->oldValue, stringBytes, (sizeof(pkg->oldValue) / sizeof(wchar_t)));
++ env->ReleaseStringChars(oldValue, stringBytes);
++ } else {
++ wcsncpy(pkg->oldValue, L"(null)", (sizeof(pkg->oldValue) / sizeof(wchar_t)));
++ }
++
++ if (newValue != (jstring) 0) {
++ stringBytes = (const wchar_t *) env->GetStringChars(newValue, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wcsncpy(pkg->newValue, stringBytes, (sizeof(pkg->newValue) / sizeof(wchar_t)));
++ env->ReleaseStringChars(newValue, stringBytes);
++ } else {
++ wcsncpy(pkg->newValue, L"(null)", (sizeof(pkg->newValue) / sizeof(wchar_t)));
++ }
++
++ ati->sendAccessibilityEventPackage(buffer, sizeof(buffer), cPropertyTableModelChangeEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with propertyTableModelChange event");
++}
++
++
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++#define PRINT_GLOBALREFS() \
++ PrintDebugString(" GlobalRef'd Event: %p", pkg->Event); \
++ PrintDebugString(" GlobalRef'd Source: %p", pkg->AccessibleContextSource);
++#else // JOBJECT64 is jlong (64 bit)
++#define PRINT_GLOBALREFS() \
++ PrintDebugString(" GlobalRef'd Event: %016I64X", pkg->Event); \
++ PrintDebugString(" GlobalRef'd Source: %016I64X", pkg->AccessibleContextSource);
++#endif
++
++#define FIRE_EVENT(function, packageStruct, packageConstant, eventConstant) \
++ void JavaAccessBridge::function(JNIEnv *env, jobject callingObj, \
++ jobject eventObj, jobject source) { \
++ \
++ PrintDebugString("\r\nFiring event id = %d(%p, %p, %p, %p); vmID = %X", \
++ eventConstant, env, callingObj, eventObj, source, javaVM); \
++ \
++ /* sanity check */ \
++ if (ATs == (AccessBridgeATInstance *) 0) { \
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)"); \
++ return; /* panic! */ \
++ } \
++ \
++ /* common setup */ \
++ char buffer[sizeof(PackageType) + sizeof(packageStruct)]; \
++ PackageType *type = (PackageType *) buffer; \
++ packageStruct *pkg = (packageStruct *) (buffer + sizeof(PackageType)); \
++ *type = packageConstant; \
++ pkg->vmID = (long) dialogWindow; \
++ \
++ /* make new Global Refs, send events only to those ATs that want 'em */ \
++ AccessBridgeATInstance *ati = ATs; \
++ while (ati != (AccessBridgeATInstance *) 0) { \
++ PrintDebugString("\r\njavaEventMask = %X eventConstant=%d pkg->vmID=%X", \
++ ati->javaEventMask, eventConstant, pkg->vmID ); \
++ if (ati->javaEventMask & eventConstant) { \
++ \
++ PrintDebugString(" sending to AT"); \
++ /* make new GlobalRefs for this AT */ \
++ pkg->Event = (JOBJECT64)env->NewGlobalRef(eventObj); \
++ pkg->AccessibleContextSource = (JOBJECT64)env->NewGlobalRef(source); \
++ PRINT_GLOBALREFS() \
++ \
++ ati->sendJavaEventPackage(buffer, sizeof(buffer), eventConstant); \
++ } \
++ ati = ati->nextATInstance; \
++ } \
++ PrintDebugString(" done with firing AWT event"); \
++ }
++
++ void JavaAccessBridge::javaShutdown(JNIEnv *env, jobject callingObj) {
++
++ PrintDebugString("\r\nFiring event id = %d(%p, %p); vmID = %X",
++ cJavaShutdownEvent, env, callingObj, javaVM);
++
++ /* sanity check */
++ if (ATs == (AccessBridgeATInstance *) 0) {
++ PrintDebugString(" ERROR!! ATs == 0! (shouldn't happen here!)");
++ return; /* panic! */
++ }
++
++ /* common setup */
++ char buffer[sizeof(PackageType) + sizeof(JavaShutdownPackage)];
++ PackageType *type = (PackageType *) buffer;
++ JavaShutdownPackage *pkg = (JavaShutdownPackage *) (buffer + sizeof(PackageType));
++ *type = cJavaShutdownPackage;
++ pkg->vmID = (long) dialogWindow;
++
++ /* make new Global Refs, send events only to those ATs that want 'em */
++ AccessBridgeATInstance *ati = ATs;
++ while (ati != (AccessBridgeATInstance *) 0) {
++ if (ati->javaEventMask & cJavaShutdownEvent) {
++ PrintDebugString(" sending to AT");
++ ati->sendJavaEventPackage(buffer, sizeof(buffer), cJavaShutdownEvent);
++ }
++ ati = ati->nextATInstance;
++ }
++ PrintDebugString(" done with firing AWT event");
++ }
++
++ FIRE_EVENT(fireFocusGained, FocusGainedPackage, cFocusGainedPackage, cFocusGainedEvent)
++ FIRE_EVENT(fireFocusLost, FocusLostPackage, cFocusLostPackage, cFocusLostEvent)
++ FIRE_EVENT(fireCaretUpdate, CaretUpdatePackage, cCaretUpdatePackage, cCaretUpdateEvent)
++ FIRE_EVENT(fireMouseClicked, MouseClickedPackage, cMouseClickedPackage, cMouseClickedEvent)
++ FIRE_EVENT(fireMouseEntered, MouseEnteredPackage, cMouseEnteredPackage, cMouseEnteredEvent)
++ FIRE_EVENT(fireMouseExited, MouseExitedPackage, cMouseExitedPackage, cMouseExitedEvent)
++ FIRE_EVENT(fireMousePressed, MousePressedPackage, cMousePressedPackage, cMousePressedEvent)
++ FIRE_EVENT(fireMouseReleased, MouseReleasedPackage, cMouseReleasedPackage, cMouseReleasedEvent)
++ FIRE_EVENT(fireMenuCanceled, MenuCanceledPackage, cMenuCanceledPackage, cMenuCanceledEvent)
++ FIRE_EVENT(fireMenuDeselected, MenuDeselectedPackage, cMenuDeselectedPackage, cMenuDeselectedEvent)
++ FIRE_EVENT(fireMenuSelected, MenuSelectedPackage, cMenuSelectedPackage, cMenuSelectedEvent)
++ FIRE_EVENT(firePopupMenuCanceled, PopupMenuCanceledPackage, cPopupMenuCanceledPackage, cPopupMenuCanceledEvent)
++ FIRE_EVENT(firePopupMenuWillBecomeInvisible, PopupMenuWillBecomeInvisiblePackage, cPopupMenuWillBecomeInvisiblePackage, cPopupMenuWillBecomeInvisibleEvent)
++ FIRE_EVENT(firePopupMenuWillBecomeVisible, PopupMenuWillBecomeVisiblePackage, cPopupMenuWillBecomeVisiblePackage, cPopupMenuWillBecomeVisibleEvent)
++
++
++ // -----------------------------
++
++
++extern "C" { // event stuff from AccessBridge.h, generated by JNI
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_sendDebugString(JNIEnv *env, jobject callingObj, jstring debugStr) {
++
++ const wchar_t *stringBytes;
++ stringBytes = (const wchar_t *) env->GetStringChars(debugStr, 0);
++ if (stringBytes == NULL) {
++ if (!env->ExceptionCheck()) {
++ jclass cls = env->FindClass("java/lang/OutOfMemoryError");
++ if (cls != NULL) {
++ env->ThrowNew(cls, NULL);
++ }
++ }
++ return;
++ }
++ wPrintJavaDebugString(L"AccessBridge.java: %ls", stringBytes);
++ env->ReleaseStringChars(debugStr, stringBytes);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyCaretChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jint oldValue, jint newValue) {
++ theJavaAccessBridge->firePropertyCaretChange(env, callingObj,
++ event, source,
++ oldValue, newValue);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyDescriptionChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue) {
++ theJavaAccessBridge->firePropertyDescriptionChange(env, callingObj,
++ event, source,
++ oldValue, newValue);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyNameChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue) {
++ theJavaAccessBridge->firePropertyNameChange(env, callingObj,
++ event, source,
++ oldValue, newValue);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertySelectionChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source) {
++ theJavaAccessBridge->firePropertySelectionChange(env, callingObj,
++ event, source);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyStateChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue) {
++ theJavaAccessBridge->firePropertyStateChange(env, callingObj,
++ event, source,
++ oldValue, newValue);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyTextChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source) {
++ theJavaAccessBridge->firePropertyTextChange(env, callingObj,
++ event, source);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyValueChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue) {
++ theJavaAccessBridge->firePropertyValueChange(env, callingObj,
++ event, source,
++ oldValue, newValue);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyVisibleDataChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source) {
++ theJavaAccessBridge->firePropertyVisibleDataChange(env, callingObj,
++ event, source);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyChildChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jobject oldValue, jobject newValue) {
++ theJavaAccessBridge->firePropertyChildChange(env, callingObj,
++ event, source,
++ oldValue, newValue);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyActiveDescendentChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jobject oldValue,
++ jobject newValue) {
++ theJavaAccessBridge->firePropertyActiveDescendentChange(env, callingObj,
++ event, source,
++ oldValue, newValue);
++ }
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_propertyTableModelChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue) {
++
++ theJavaAccessBridge->firePropertyTableModelChange(env, callingObj,
++ event, source,
++ oldValue, newValue);
++ }
++
++#define HANDLE_STANDARD_EVENT_FROM_JAVA(function, method) \
++ JNIEXPORT void JNICALL \
++ function(JNIEnv *env, jobject callingObj, jobject event, jobject source) { \
++ theJavaAccessBridge->method(env, callingObj, event, source); \
++ }
++
++
++ JNIEXPORT void JNICALL
++ Java_com_sun_java_accessibility_AccessBridge_javaShutdown(JNIEnv *env, jobject callingObj) {
++ theJavaAccessBridge->javaShutdown(env, callingObj);
++ }
++
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_focusGained, fireFocusGained)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_focusLost, fireFocusLost)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_caretUpdate, fireCaretUpdate)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_mouseClicked, fireMouseClicked)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_mouseEntered, fireMouseEntered)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_mouseExited, fireMouseExited)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_mousePressed, fireMousePressed)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_mouseReleased, fireMouseReleased)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_menuCanceled, fireMenuCanceled)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_menuDeselected, fireMenuDeselected)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_menuSelected, fireMenuSelected)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_popupMenuCanceled, firePopupMenuCanceled)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_popupMenuWillBecomeInvisible, firePopupMenuWillBecomeInvisible)
++ HANDLE_STANDARD_EVENT_FROM_JAVA(Java_com_sun_java_accessibility_AccessBridge_popupMenuWillBecomeVisible, firePopupMenuWillBecomeVisible)
++
++ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/JavaAccessBridge.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,167 @@
++/*
++ * 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. 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.
++ */
++
++/*
++ * A DLL which is loaded by Java applications to handle communication
++ * between Java VMs purposes of Accessbility.
++ */
++
++#include <windows.h>
++#include <jni.h>
++
++#include "AccessBridgePackages.h"
++#include "AccessBridgeATInstance.h"
++#include "AccessBridgeJavaEntryPoints.h"
++
++#ifndef __JavaAccessBridge_H__
++#define __JavaAccessBridge_H__
++
++
++extern "C" {
++ BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason,
++ LPVOID lpvReserved);
++ void AppendToCallOutput(char *s);
++ BOOL APIENTRY AccessBridgeDialogProc(HWND hDlg, UINT message,
++ UINT wParam, LONG lParam);
++}
++
++/**
++ * The JavaAccessBridge class. The core of the Windows AT AccessBridge dll
++ */
++class JavaAccessBridge {
++// for debugging
++public:
++// for debugging
++ HINSTANCE windowsInstance;
++ HWND dialogWindow;
++ AccessBridgeATInstance *ATs;
++ JavaVM *javaVM;
++ JNIEnv *windowsThreadJNIEnv; // for calls initiated from Windows
++ AccessBridgeJavaEntryPoints *javaThreadEntryPoints;
++ AccessBridgeJavaEntryPoints *windowsThreadEntryPoints;
++ jobject javaThreadABObject; // for calls initiated from Java
++ jobject windowsThreadABObject; // for calls initiated from Windows
++
++public:
++ JavaAccessBridge(HINSTANCE hInstance);
++ ~JavaAccessBridge();
++ void javaRun(JNIEnv *env, jobject obj);
++ BOOL initWindow();
++
++ // IPC with the Java AccessBridge DLL
++ void postHelloToWindowsDLLMsg(HWND destHwnd);
++ LRESULT MemoryMappedFileCreated(HWND srcHwnd, char *filename);
++
++ void sendPackage(char *buffer, int bufsize, HWND destHwnd);
++ void sendJavaEventPackage(char *buffer, int bufsize, long type);
++ void sendAccessibilityEventPackage(char *buffer, int bufsize, long type);
++ BOOL sendMemoryPackage(char *buffer, long bufsize, HWND destWindow);
++ LRESULT processPackage(char *buffer, int bufsize);
++ BOOL receiveMemoryPackage(HWND srcWindow, long bufsize);
++ void WindowsATDestroyed(HWND ATBridgeDLLWindow);
++
++ // Java VM object memory management
++ void releaseJavaObject(jobject object);
++
++ // Event handling methods
++ void addJavaEventNotification(jlong type, HWND DLLwindow);
++ void removeJavaEventNotification(jlong type, HWND DLLwindow);
++ void addAccessibilityEventNotification(jlong type, HWND DLLwindow);
++ void removeAccessibilityEventNotification(jlong type, HWND DLLwindow);
++
++ // Event firing methods
++/*
++ void firePropertyChange(JNIEnv *env, jobject callingObj,
++ jobject propertyChangeEvent,
++ jobject source, jstring propertyName,
++ jstring oldValue, jstring newValue);
++*/
++
++ void javaShutdown(JNIEnv *env, jobject callingObj);
++
++ void fireFocusGained(JNIEnv *env, jobject callingObj,
++ jobject focusEvent, jobject source);
++ void fireFocusLost(JNIEnv *env, jobject callingObj,
++ jobject focusEvent,jobject source);
++ void fireCaretUpdate(JNIEnv *env, jobject callingObj,
++ jobject caretEvent, jobject source);
++ void fireMouseClicked(JNIEnv *env, jobject callingObj,
++ jobject mouseEvent, jobject source);
++ void fireMouseEntered(JNIEnv *env, jobject callingObj,
++ jobject mouseEvent, jobject source);
++ void fireMouseExited(JNIEnv *env, jobject callingObj,
++ jobject mouseEvent, jobject source);
++ void fireMousePressed(JNIEnv *env, jobject callingObj,
++ jobject mouseEvent, jobject source);
++ void fireMouseReleased(JNIEnv *env, jobject callingObj,
++ jobject mouseEvent, jobject source);
++ void fireMenuCanceled(JNIEnv *env, jobject callingObj,
++ jobject menuEvent, jobject source);
++ void fireMenuDeselected(JNIEnv *env, jobject callingObj,
++ jobject menuEvent, jobject source);
++ void fireMenuSelected(JNIEnv *env, jobject callingObj,
++ jobject menuEvent, jobject source);
++ void firePopupMenuCanceled(JNIEnv *env, jobject callingObj,
++ jobject popupMenuEvent, jobject source);
++ void firePopupMenuWillBecomeInvisible(JNIEnv *env, jobject callingObj,
++ jobject popupMenuEvent, jobject source);
++ void firePopupMenuWillBecomeVisible(JNIEnv *env, jobject callingObj,
++ jobject popupMenuEvent, jobject source);
++
++ void firePropertyCaretChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jint oldValue, jint newValue);
++ void firePropertyDescriptionChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue);
++ void firePropertyNameChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue);
++ void firePropertySelectionChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source);
++ void firePropertyStateChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue);
++ void firePropertyTextChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source);
++ void firePropertyValueChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue);
++ void firePropertyVisibleDataChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source);
++ void firePropertyChildChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jobject oldValue, jobject newValue);
++ void firePropertyActiveDescendentChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jobject oldValue, jobject newValue);
++
++ void firePropertyTableModelChange(JNIEnv *env, jobject callingObj,
++ jobject event, jobject source,
++ jstring oldValue, jstring newValue);
++};
++
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/WinAccessBridge.DEF Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,154 @@
++;
++; Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++; 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.
++;
++;
++;LIBRARY WINDOWSACCESSBRIDGE
++
++;DESCRIPTION 'WINDOWSACCESSBRIDGE.DLL'
++HEAPSIZE 4096
++EXPORTS
++
++ addJavaEventNotification
++ removeJavaEventNotification
++ addAccessibilityEventNotification
++ removeAccessibilityEventNotification
++
++ Windows_run
++
++ getAccessibleTableInfo
++ getAccessibleTableCellInfo
++
++ getAccessibleTableRowHeader
++ getAccessibleTableColumnHeader
++
++ getAccessibleTableRowDescription
++ getAccessibleTableColumnDescription
++
++ isAccessibleTableRowSelected
++ isAccessibleTableColumnSelected
++
++ getAccessibleTableColumnSelectionCount
++ getAccessibleTableRowSelectionCount
++
++ getAccessibleTableColumnSelections
++ getAccessibleTableRowSelections
++
++ getAccessibleTableRow
++ getAccessibleTableColumn
++ getAccessibleTableIndex
++
++ getAccessibleRelationSet
++
++ getAccessibleHypertext
++ activateAccessibleHyperlink
++ getAccessibleHyperlinkCount
++ getAccessibleHypertextExt
++ getAccessibleHypertextLinkIndex
++ getAccessibleHyperlink
++
++ getAccessibleKeyBindings
++ getAccessibleIcons
++ getAccessibleActions
++ doAccessibleActions
++
++ setTextContents
++ getParentWithRole
++ getParentWithRoleElseRoot
++ getTopLevelObject
++ getObjectDepth
++ getActiveDescendent
++
++ getVirtualAccessibleName
++ requestFocus
++ selectTextRange
++ getTextAttributesInRange
++ getVisibleChildrenCount
++ getVisibleChildren
++ setCaretPosition
++ getCaretLocation
++
++ getEventsWaiting
++
++ releaseJavaObject
++ getVersionInfo
++
++ isJavaWindow
++ isSameObject
++ getAccessibleContextFromHWND
++ getHWNDFromAccessibleContext
++
++ getAccessibleContextAt
++ getAccessibleContextWithFocus
++ getAccessibleContextInfo
++ getAccessibleChildFromContext
++ getAccessibleParentFromContext
++
++ getAccessibleTextInfo
++ getAccessibleTextItems
++ getAccessibleTextSelectionInfo
++ getAccessibleTextAttributes
++ getAccessibleTextRect
++ getAccessibleTextLineBounds
++ getAccessibleTextRange
++
++ getCurrentAccessibleValueFromContext
++ getMaximumAccessibleValueFromContext
++ getMinimumAccessibleValueFromContext
++
++ addAccessibleSelectionFromContext
++ clearAccessibleSelectionFromContext
++ getAccessibleSelectionFromContext
++ getAccessibleSelectionCountFromContext
++ isAccessibleChildSelectedFromContext
++ removeAccessibleSelectionFromContext
++ selectAllAccessibleSelectionFromContext
++
++ setPropertyChangeFP
++ setJavaShutdownFP
++ setFocusGainedFP
++ setFocusLostFP
++ setCaretUpdateFP
++ setMouseClickedFP
++ setMouseEnteredFP
++ setMouseExitedFP
++ setMousePressedFP
++ setMouseReleasedFP
++ setMenuCanceledFP
++ setMenuDeselectedFP
++ setMenuSelectedFP
++ setPopupMenuCanceledFP
++ setPopupMenuWillBecomeInvisibleFP
++ setPopupMenuWillBecomeVisibleFP
++
++ setPropertyNameChangeFP
++ setPropertyDescriptionChangeFP
++ setPropertyStateChangeFP
++ setPropertyValueChangeFP
++ setPropertySelectionChangeFP
++ setPropertyTextChangeFP
++ setPropertyCaretChangeFP
++ setPropertyVisibleDataChangeFP
++ setPropertyChildChangeFP
++ setPropertyActiveDescendentChangeFP
++ setPropertyTableModelChangeFP
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/WinAccessBridge.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,3503 @@
++/*
++ * Copyright (c) 2005, 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. 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.
++ */
++
++/*
++ * A DLL which is loaded by Windows executables to handle communication
++ * between Java VMs purposes of Accessbility.
++ */
++
++#include "AccessBridgeDebug.h"
++#include "WinAccessBridge.h"
++#include "accessBridgeResource.h"
++#include "accessBridgeCallbacks.h"
++#include "AccessBridgeMessages.h"
++#include "AccessBridgeMessageQueue.h"
++
++#include <windows.h>
++#include <jni.h>
++#include <stdio.h>
++
++// send memory lock
++//
++// This lock is need to serialize access to the buffer used by sendMemoryPackage.
++// If a JVM goes away while the associated memory buffer is in use, a thread switch
++// allows a call to JavaVMDestroyed and deallocation of the memory buffer.
++CRITICAL_SECTION sendMemoryIPCLock;
++
++// registry paths to newly found JVMs that don't have the bridge installed
++char **newJVMs;
++
++WinAccessBridge *theWindowsAccessBridge;
++HWND theDialogWindow;
++
++// unique broadcast msg. IDs gotten dymanically
++extern UINT theFromJavaHelloMsgID;
++extern UINT theFromWindowsHelloMsgID;
++
++// protects the javaVMs chain while in use
++bool isVMInstanceChainInUse;
++
++/* =================================================================================== */
++
++
++
++/**
++ * Proc for "New JVM Found" dialog
++ */
++BOOL CALLBACK newJVMFoundDialogProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) {
++
++ switch (message) {
++ case WM_COMMAND:
++ // PrintDebugString(" newJVMDialogProc: LOWORD(wParam) = %d", LOWORD(wParam));
++
++ switch (LOWORD(wParam)) {
++
++ // Remind user later that a new JVM was installed
++ case cRemindThereIsNewJVM:
++ PrintDebugString(" newJVMDialogProc: cRemindThereIsNewJVM");
++ // do nothing
++ EndDialog(hwndDlg, wParam);
++ return TRUE;
++
++ // Do not remind user later that a new JVM was installed
++ /*
++ case cDoNotRemindThereIsNewJVM:
++ PrintDebugString(" newJVMDialogProc: cDoNotRemindThereIsNewJVM");
++ // remember to not remind the user there are new JVMs
++ PrintDebugString("theWindowsAccessBridge = %x", theWindowsAccessBridge);
++ if (theWindowsAccessBridge != NULL) {
++ dontRemindUser(newJVMs);
++ }
++ EndDialog(hwndDlg, wParam);
++ return TRUE;
++ */
++
++ // Run the AccessBridge installer
++ /*
++ case cInstallAccessBridge:
++ PrintDebugString(" newJVMDialogProc: cInstallAccessBridge");
++ // start the installer
++ if (theWindowsAccessBridge != NULL) {
++ startInstaller(newJVMs);
++ }
++ EndDialog(hwndDlg, wParam);
++ return TRUE;
++ */
++
++ default:
++ ;
++ }
++ default:
++ ;
++ }
++ return FALSE;
++}
++
++
++
++/* =========================================================================== */
++
++// ---------------------------------------------------------------------------
++
++extern "C" {
++ /**
++ * DllMain - where Windows executables will load/unload us
++ *
++ */
++ BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved) {
++
++ switch (fdwReason) {
++ case DLL_PROCESS_ATTACH: // A Windows executable loaded us
++ PrintDebugString("DLL_PROCESS_ATTACH");
++ theWindowsAccessBridge = new WinAccessBridge(hinstDll);
++ break;
++
++ case DLL_PROCESS_DETACH: // A Windows executable unloaded us
++ if (theWindowsAccessBridge != (WinAccessBridge *) 0) {
++ PrintDebugString("*** AccessBridgeDialogProc -> deleting theWindowsAccessBridge");
++ delete theWindowsAccessBridge;
++ }
++ break;
++ }
++
++ return(TRUE);
++ }
++
++ /**
++ * Append debug info to dialog
++ *
++ * replaced with code to send output to debug file
++ *
++ */
++ void AppendToCallInfo(char *s) {
++
++ /*
++ _CrtDbgReport(_CRT_WARN, (const char *) NULL, NULL, (const char *) NULL,
++ (const char *) "WinAccessBridge: %s", s);
++ */
++
++ char buf[1024];
++ sprintf(buf, "WinAccessBridge: %s", s);
++ OutputDebugString(buf);
++ }
++
++ /**
++ * Our window proc
++ *
++ */
++ BOOL CALLBACK AccessBridgeDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam) {
++ COPYDATASTRUCT *sentToUs;
++ char *package;
++
++ switch (message) {
++ case WM_INITDIALOG:
++ PrintDebugString("AccessBridgeDialogProc -> Initializing");
++ break;
++
++ // call from Java with data for us to deliver
++ case WM_COPYDATA:
++ if (theDialogWindow == (HWND) wParam) {
++ PrintDebugString("AccessBridgeDialogProc -> Got WM_COPYDATA from Java Bridge DLL");
++ } else {
++ PrintDebugString("AccessBridgeDialogProc -> Got WM_COPYDATA from HWND %p", wParam);
++ sentToUs = (COPYDATASTRUCT *) lParam;
++ package = (char *) sentToUs->lpData;
++ theWindowsAccessBridge->preProcessPackage(package, sentToUs->cbData);
++ }
++ break;
++
++ // message to ourselves -> de-queue messages and send 'em
++ case AB_MESSAGE_QUEUED:
++ PrintDebugString("AccessBridgeDialogProc -> Got AB_MESSAGE_QUEUED from ourselves");
++ theWindowsAccessBridge->receiveAQueuedPackage();
++ break;
++
++ // a JavaAccessBridge DLL is going away
++ //
++ // When JavaVMDestroyed is called a AccessBridgeJavaVMInstance in the
++ // javaVMs chain will be removed. If that chain is in use this will
++ // cause a crash. One way AB_DLL_GOING_AWAY can arrive is on any
++ // outgoing SendMessage call. SendMessage normally spins waiting for
++ // a response. However, if there is an incoming SendMessage, e.g. for
++ // AB_DLL_GOING_AWAY Windows will send that request to this DialogProc.
++ // One seemingly easy way to combat that is to use SendMessageTimeout
++ // with the SMTO_BLOCK flag set. However, it has been the case that
++ // even after using that technique AB_DLL_GOING_AWAY can still arrive
++ // in the middle of processing the javaVMs chain. An alternative that
++ // was tried was to use a critical section around any access ot the
++ // javaVMs chain but unfortunately the AB_DLL_GOING_AWAY message arrives
++ // on the same thread and thus the use of a critical section is ineffective.
++ // The solution then is to set a flag whenever the javaVMs chain is being
++ // used and if that flag is set at this point the message will be posted
++ // to the message queue. That would delay the destruction of the instance
++ // until the chain is not being traversed.
++ case AB_DLL_GOING_AWAY:
++ PrintDebugString("***** AccessBridgeDialogProc -> Got AB_DLL_GOING_AWAY message");
++ if (isVMInstanceChainInUse) {
++ PrintDebugString(" javaVMs chain in use, calling PostMessage");
++ PostMessage(hDlg, AB_DLL_GOING_AWAY, wParam, (LPARAM)0);
++ } else {
++ PrintDebugString(" calling javaVMDestroyed");
++ theWindowsAccessBridge->JavaVMDestroyed((HWND) wParam);
++ }
++ break;
++
++ default:
++ // the JavaVM is saying "hi"!
++ // wParam == sourceHwnd; lParam == JavaVMID
++ if (message == theFromJavaHelloMsgID) {
++ PrintDebugString("AccessBridgeDialogProc -> Got theFromJavaHelloMsgID; wParam = %p, lParam = %p", wParam, lParam);
++ theWindowsAccessBridge->rendezvousWithNewJavaDLL((HWND) wParam, (long ) lParam);
++ }
++ break;
++ }
++
++ return (FALSE);
++ }
++
++}
++
++
++
++
++// ---------------------------------------------------------------------------
++
++/**
++ * Initialize the WinAccessBridge
++ *
++ */
++WinAccessBridge::WinAccessBridge(HINSTANCE hInstance) {
++
++ PrintDebugString("WinAccessBridge ctor");
++
++ // IntializeCriticalSection should only be called once.
++ InitializeCriticalSection(&sendMemoryIPCLock);
++ windowsInstance = hInstance;
++ javaVMs = (AccessBridgeJavaVMInstance *) 0;
++ eventHandler = new AccessBridgeEventHandler();
++ messageQueue = new AccessBridgeMessageQueue();
++ initBroadcastMessageIDs(); // get the unique to us broadcast msg. IDs
++ theWindowsAccessBridge = this;
++ isVMInstanceChainInUse = false;
++
++
++ // notify the user if new JVMs are found
++ /*
++ newJVMs = (char **)malloc(MAX_NEW_JVMS_FOUND);
++ for (int i = 0; i < MAX_NEW_JVMS_FOUND; i++) {
++ newJVMs[i] = (char *)malloc(SHORT_STRING_SIZE);
++ newJVMs[i][0] = 0;
++ }
++
++ BOOL newJ2SEFound = findNewJVMs(J2SE_REG_PATH, newJVMs);
++ BOOL newJ2REFound = TRUE; // findNewJVMs(J2RE_REG_PATH, newJVMs);
++
++ if (newJ2SEFound || newJ2REFound) {
++
++ int result = DialogBox(windowsInstance,
++ "FOUNDNEWJVMDIALOG",
++ NULL,
++ (DLGPROC)newJVMFoundDialogProc);
++ if (result < 0) {
++ printError("DialogBox failed");
++ }
++
++ PrintDebugString(" FOUNDNEWJVMDIALOG: result = %d", result);
++
++ ShowWindow((HWND)result, SW_SHOW);
++ }
++ */
++
++ ShowWindow(theDialogWindow, SW_SHOW);
++}
++
++
++
++/**
++ * Destroy the WinAccessBridge
++ *
++ */
++WinAccessBridge::~WinAccessBridge() {
++ // inform all other AccessBridges that we're going away
++ // -> shut down all event listening
++ // -> release all objects held in the JVM by us
++
++ PrintDebugString("*****in WinAccessBridge::~WinAccessBridge()");
++
++ // send a broadcast msg.; let other AccessBridge DLLs know we're going away
++ AccessBridgeJavaVMInstance *current = javaVMs;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++ PrintDebugString(" telling %p we're going away", current->javaAccessBridgeWindow);
++ SendMessage(current->javaAccessBridgeWindow,
++ AB_DLL_GOING_AWAY, (WPARAM) dialogWindow, (LPARAM) 0);
++ current = current->nextJVMInstance;
++ }
++
++ PrintDebugString(" finished telling JVMs about our demise");
++
++ delete eventHandler;
++ delete messageQueue;
++ delete javaVMs;
++
++ PrintDebugString(" finished deleting eventHandler, messageQueue, and javaVMs");
++ PrintDebugString("GOODBYE CRUEL WORLD...");
++
++ DestroyWindow(theDialogWindow);
++}
++
++
++/**
++ * Bring up our window; make a connection to the rest of the world
++ *
++ */
++BOOL
++WinAccessBridge::initWindow() {
++ theDialogWindow = CreateDialog(windowsInstance,
++ "ACCESSBRIDGESTATUSWINDOW", NULL,
++ (DLGPROC) AccessBridgeDialogProc);
++
++ // If window could not be created, return "failure".
++ if (!theDialogWindow)
++ return (FALSE);
++
++ dialogWindow = theDialogWindow;
++
++ // Make the window visible, update its client area, & return "success".
++ // DEBUG_CODE(ShowWindow (theDialogWindow, SW_SHOWNORMAL));
++ // DEBUG_CODE(UpdateWindow (theDialogWindow));
++
++ // post a broadcast msg.; let other AccessBridge DLLs know we exist
++ PostMessage(HWND_BROADCAST, theFromWindowsHelloMsgID, (WPARAM) dialogWindow, (LPARAM) 0);
++
++ return (TRUE);
++}
++
++// -----------------------
++
++/**
++ * rendezvousWithNewJavaDLL
++ * - Build AccessBridgeJavaVMInstance data structure
++ * (including setting up Memory-Mapped file info)
++ *
++ */
++LRESULT
++WinAccessBridge::rendezvousWithNewJavaDLL(HWND JavaBridgeDLLwindow, long vmID) {
++ LRESULT returnVal;
++
++ PrintDebugString("in JavaAccessBridge::rendezvousWithNewJavaDLL(%p, %X)",
++ JavaBridgeDLLwindow, vmID);
++
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *newVM =
++ new AccessBridgeJavaVMInstance(dialogWindow, JavaBridgeDLLwindow, vmID, javaVMs);
++ javaVMs = newVM;
++ isVMInstanceChainInUse = false;
++
++ returnVal = javaVMs->initiateIPC();
++ if (returnVal == 0) {
++
++ // tell the newly created JavaVM what events we're interested in, if any
++ long javaEventMask = eventHandler->getJavaEventMask();
++ long accessibilityEventMask = eventHandler->getAccessibilityEventMask();
++
++ PrintDebugString(" Setting Java event mask to: %X", javaEventMask);
++
++ if (javaEventMask != 0) {
++ addJavaEventNotification(javaEventMask);
++ }
++
++ PrintDebugString(" Setting Accessibility event mask to: %X", accessibilityEventMask);
++
++ if (accessibilityEventMask != 0) {
++ addAccessibilityEventNotification(accessibilityEventMask);
++ }
++ } else {
++ PrintDebugString(" ERROR: Failed to initiate IPC with newly created JavaVM!!!");
++ return FALSE;
++ }
++
++ PrintDebugString(" Success!! We rendezvoused with the JavaDLL");
++ return returnVal;
++}
++
++// -----------------------
++
++/**
++ * sendPackage - uses SendMessage(WM_COPYDATA) to do IPC messaging
++ * with the Java AccessBridge DLL
++ *
++ * NOTE: WM_COPYDATA is only for one-way IPC; there
++ * is now way to return parameters (especially big ones)
++ * Use sendMemoryPackage() to do that!
++ */
++void
++WinAccessBridge::sendPackage(char *buffer, long bufsize, HWND destWindow) {
++ COPYDATASTRUCT toCopy;
++ toCopy.dwData = 0; // 32-bits we could use for something...
++ toCopy.cbData = bufsize;
++ toCopy.lpData = buffer;
++
++ SendMessage(destWindow, WM_COPYDATA, (WPARAM) dialogWindow, (LPARAM) &toCopy);
++}
++
++
++/**
++ * sendMemoryPackage - uses Memory-Mapped files to do IPC messaging
++ * with the Java AccessBridge DLL, informing the
++ * Java AccessBridge DLL via SendMessage that something
++ * is waiting for it in the shared file...
++ *
++ * In the SendMessage call, the third param (WPARAM) is
++ * the source HWND (theDialogWindow in this case), and
++ * the fourth param (LPARAM) is the size in bytes of
++ * the package put into shared memory.
++ *
++ */
++BOOL
++WinAccessBridge::sendMemoryPackage(char *buffer, long bufsize, HWND destWindow) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ AccessBridgeJavaVMInstance *ourABJavaVMInstance;
++ ourABJavaVMInstance = javaVMs->findABJavaVMInstanceFromJavaHWND(destWindow);
++ if (ourABJavaVMInstance != (AccessBridgeJavaVMInstance *) 0) {
++ if (!ourABJavaVMInstance->sendMemoryPackage(buffer, bufsize)) {
++ // return falue to the caller
++ memset(buffer, 0, bufsize);
++ return FALSE;
++ }
++ } else {
++ PrintDebugString("ERROR sending memory package: couldn't find destWindow");
++ return FALSE;
++ }
++ return TRUE;
++}
++
++
++/**
++ * queuePackage - put a package onto the queue for latter processing
++ *
++ */
++BOOL
++WinAccessBridge::queuePackage(char *buffer, long bufsize) {
++ PrintDebugString(" in WinAccessBridge::queuePackage(%p, %d)", buffer, bufsize);
++
++ AccessBridgeQueueElement *element = new AccessBridgeQueueElement(buffer, bufsize);
++
++ messageQueue->add(element);
++ PostMessage(dialogWindow, AB_MESSAGE_QUEUED, (WPARAM) 0, (LPARAM) 0);
++ return TRUE;
++}
++
++
++/**
++ * receiveAQueuedPackage - remove a pending packge from the queue and
++ * handle it. If the queue is busy, post a
++ * message to self to retrieve it later
++ *
++ */
++BOOL
++WinAccessBridge::receiveAQueuedPackage() {
++ AccessBridgeQueueElement *element;
++
++ PrintDebugString("in WinAccessBridge::receiveAQueuedPackage()");
++
++ // ensure against re-entrancy problems...
++ if (messageQueue->getRemoveLockSetting() == FALSE) {
++ messageQueue->setRemoveLock(TRUE);
++
++ PrintDebugString(" dequeueing message");
++
++ QueueReturns result = messageQueue->remove(&element);
++
++ PrintDebugString(" 'element->buffer' contains:");
++ DEBUG_CODE(PackageType *type = (PackageType *) element->buffer);
++ DEBUG_CODE(FocusGainedPackageTag *pkg = (FocusGainedPackageTag *) (((char *) element->buffer) + sizeof(PackageType)));
++ DEBUG_CODE(PrintDebugString(" PackageType = %X", *type));
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ DEBUG_CODE(PrintDebugString(" EventPackage: vmID = %X, event = %p, source = %p", pkg->vmID, pkg->Event, pkg->AccessibleContextSource));
++#else // JOBJECT64 is jlong (64 bit)
++ DEBUG_CODE(PrintDebugString(" EventPackage: vmID = %X, event = %016I64X, source = %016I64X", pkg->vmID, pkg->Event, pkg->AccessibleContextSource));
++#endif
++ switch (result) {
++
++ case cQueueBroken:
++ PrintDebugString(" ERROR!!! Queue seems to be broken!");
++ messageQueue->setRemoveLock(FALSE);
++ return FALSE;
++
++ case cMoreMessages:
++ case cQueueEmpty:
++ if (element != (AccessBridgeQueueElement *) 0) {
++ PrintDebugString(" found one; sending it!");
++ processPackage(element->buffer, element->bufsize);
++ delete element;
++ } else {
++ PrintDebugString(" ODD... element == 0!");
++ return FALSE;
++ }
++ break;
++
++ case cQueueInUse:
++ PrintDebugString(" Queue in use, will try again later...");
++ PostMessage(dialogWindow, AB_MESSAGE_QUEUED, (WPARAM) 0, (LPARAM) 0);
++ break;
++
++ default:
++ messageQueue->setRemoveLock(FALSE);
++ return FALSE; // should never get something we don't recognize!
++ }
++ } else {
++ PrintDebugString(" unable to dequeue message; remove lock is set");
++ PostMessage(dialogWindow, AB_MESSAGE_QUEUED, (WPARAM) 0, (LPARAM) 0); // Fix for 6995891
++ }
++
++ messageQueue->setRemoveLock(FALSE);
++ return TRUE;
++}
++
++// -----------------------
++
++/**
++ * preProcessPackage
++ * - do triage on incoming packages; queue some, deal with others
++ *
++ */
++void
++WinAccessBridge::preProcessPackage(char *buffer, long bufsize) {
++ PrintDebugString("PreProcessing package sent from Java:");
++
++ PackageType *type = (PackageType *) buffer;
++
++ switch (*type) {
++
++ PrintDebugString(" type == %X", *type);
++
++ // event packages all get queued for later handling
++ //case cPropertyChangePackage:
++ case cJavaShutdownPackage:
++ case cFocusGainedPackage:
++ case cFocusLostPackage:
++ case cCaretUpdatePackage:
++ case cMouseClickedPackage:
++ case cMouseEnteredPackage:
++ case cMouseExitedPackage:
++ case cMousePressedPackage:
++ case cMouseReleasedPackage:
++ case cMenuCanceledPackage:
++ case cMenuDeselectedPackage:
++ case cMenuSelectedPackage:
++ case cPopupMenuCanceledPackage:
++ case cPopupMenuWillBecomeInvisiblePackage:
++ case cPopupMenuWillBecomeVisiblePackage:
++
++ case cPropertyCaretChangePackage:
++ case cPropertyDescriptionChangePackage:
++ case cPropertyNameChangePackage:
++ case cPropertySelectionChangePackage:
++ case cPropertyStateChangePackage:
++ case cPropertyTextChangePackage:
++ case cPropertyValueChangePackage:
++ case cPropertyVisibleDataChangePackage:
++ case cPropertyChildChangePackage:
++ case cPropertyActiveDescendentChangePackage:
++
++ case cPropertyTableModelChangePackage:
++
++ queuePackage(buffer, bufsize);
++ break;
++
++ // perhaps there will be some other packages to process at some point... //
++
++ default:
++ PrintDebugString(" processing FAILED!! -> don't know how to handle type = %X", *type);
++ break;
++ }
++
++ PrintDebugString(" package preprocessing completed");
++}
++
++
++#define DISPATCH_EVENT_PACKAGE(packageID, eventPackage, fireEventMethod) \
++ case packageID: \
++ if (bufsize == sizeof(PackageType) + sizeof(eventPackage)) { \
++ eventPackage *pkg = \
++ (eventPackage *) (buffer + sizeof(PackageType)); \
++ PrintDebugString(" begin callback to AT, type == %X", *type); \
++ theWindowsAccessBridge->eventHandler->fireEventMethod( \
++ pkg->vmID, pkg->Event, pkg->AccessibleContextSource); \
++ PrintDebugString(" event callback complete!"); \
++ } else { \
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d", \
++ bufsize, sizeof(PackageType) + sizeof(eventPackage)); \
++ } \
++ break;
++
++#define DISPATCH_PROPERTY_CHANGE_PACKAGE(packageID, eventPackage, fireEventMethod, oldValue, newValue) \
++ case packageID: \
++ if (bufsize == sizeof(PackageType) + sizeof(eventPackage)) { \
++ eventPackage *pkg = \
++ (eventPackage *) (buffer + sizeof(PackageType)); \
++ PrintDebugString(" begin callback to AT, type == %X", *type); \
++ theWindowsAccessBridge->eventHandler->fireEventMethod( \
++ pkg->vmID, pkg->Event, pkg->AccessibleContextSource, \
++ pkg->oldValue, pkg->newValue); \
++ PrintDebugString(" event callback complete!"); \
++ } else { \
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d", \
++ bufsize, sizeof(PackageType) + sizeof(eventPackage)); \
++ } \
++ break;
++
++#define DISPATCH_PROPERTY_TABLE_MODEL_CHANGE_PACKAGE(packageID, eventPackage, fireEventMethod, oldValue, newValue) \
++ case packageID: \
++ if (bufsize == sizeof(PackageType) + sizeof(eventPackage)) { \
++ eventPackage *pkg = \
++ (eventPackage *) (buffer + sizeof(PackageType)); \
++ PrintDebugString(" begin callback to AT, type == %X", *type); \
++ theWindowsAccessBridge->eventHandler->fireEventMethod( \
++ pkg->vmID, pkg->Event, pkg->AccessibleContextSource, \
++ pkg->oldValue, pkg->newValue); \
++ PrintDebugString(" event callback complete!"); \
++ } else { \
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d", \
++ bufsize, sizeof(PackageType) + sizeof(eventPackage)); \
++ } \
++ break;
++
++/**
++ * processPackage - processes the output of SendMessage(WM_COPYDATA)
++ * to do IPC messaging with the Java AccessBridge DLL
++ *
++ */
++void
++WinAccessBridge::processPackage(char *buffer, long bufsize) {
++ PrintDebugString("WinAccessBridge::Processing package sent from Java:");
++
++ PackageType *type = (PackageType *) buffer;
++
++ switch (*type) {
++
++ PrintDebugString(" type == %X", *type);
++
++ case cJavaShutdownPackage:
++ PrintDebugString(" type == cJavaShutdownPackage");
++ if (bufsize == sizeof(PackageType) + sizeof(JavaShutdownPackage)) {
++ JavaShutdownPackage *pkg =
++ (JavaShutdownPackage *) (buffer + sizeof(PackageType));
++ theWindowsAccessBridge->eventHandler->fireJavaShutdown(pkg->vmID);
++ PrintDebugString(" event callback complete!");
++ PrintDebugString(" event fired!");
++ } else {
++ PrintDebugString(" processing FAILED!! -> bufsize = %d; expectation = %d",
++ bufsize, sizeof(PackageType) + sizeof(JavaShutdownPackage));
++ }
++ break;
++
++
++ DISPATCH_EVENT_PACKAGE(cFocusGainedPackage, FocusGainedPackage, fireFocusGained);
++ DISPATCH_EVENT_PACKAGE(cFocusLostPackage, FocusLostPackage, fireFocusLost);
++
++ DISPATCH_EVENT_PACKAGE(cCaretUpdatePackage, CaretUpdatePackage, fireCaretUpdate);
++
++ DISPATCH_EVENT_PACKAGE(cMouseClickedPackage, MouseClickedPackage, fireMouseClicked);
++ DISPATCH_EVENT_PACKAGE(cMouseEnteredPackage, MouseEnteredPackage, fireMouseEntered);
++ DISPATCH_EVENT_PACKAGE(cMouseExitedPackage, MouseExitedPackage, fireMouseExited);
++ DISPATCH_EVENT_PACKAGE(cMousePressedPackage, MousePressedPackage, fireMousePressed);
++ DISPATCH_EVENT_PACKAGE(cMouseReleasedPackage, MouseReleasedPackage, fireMouseReleased);
++
++ DISPATCH_EVENT_PACKAGE(cMenuCanceledPackage, MenuCanceledPackage, fireMenuCanceled);
++ DISPATCH_EVENT_PACKAGE(cMenuDeselectedPackage, MenuDeselectedPackage, fireMenuDeselected);
++ DISPATCH_EVENT_PACKAGE(cMenuSelectedPackage, MenuSelectedPackage, fireMenuSelected);
++ DISPATCH_EVENT_PACKAGE(cPopupMenuCanceledPackage, PopupMenuCanceledPackage, firePopupMenuCanceled);
++ DISPATCH_EVENT_PACKAGE(cPopupMenuWillBecomeInvisiblePackage, PopupMenuWillBecomeInvisiblePackage, firePopupMenuWillBecomeInvisible);
++ DISPATCH_EVENT_PACKAGE(cPopupMenuWillBecomeVisiblePackage, PopupMenuWillBecomeVisiblePackage, firePopupMenuWillBecomeVisible);
++
++ DISPATCH_PROPERTY_CHANGE_PACKAGE(cPropertyNameChangePackage,
++ PropertyNameChangePackage,
++ firePropertyNameChange, oldName, newName)
++ DISPATCH_PROPERTY_CHANGE_PACKAGE(cPropertyDescriptionChangePackage,
++ PropertyDescriptionChangePackage,
++ firePropertyDescriptionChange,
++ oldDescription, newDescription)
++ DISPATCH_PROPERTY_CHANGE_PACKAGE(cPropertyStateChangePackage,
++ PropertyStateChangePackage,
++ firePropertyStateChange, oldState, newState)
++ DISPATCH_PROPERTY_CHANGE_PACKAGE(cPropertyValueChangePackage,
++ PropertyValueChangePackage,
++ firePropertyValueChange, oldValue, newValue)
++ DISPATCH_EVENT_PACKAGE(cPropertySelectionChangePackage,
++ PropertySelectionChangePackage, firePropertySelectionChange)
++ DISPATCH_EVENT_PACKAGE(cPropertyTextChangePackage,
++ PropertyTextChangePackage, firePropertyTextChange)
++ DISPATCH_PROPERTY_CHANGE_PACKAGE(cPropertyCaretChangePackage,
++ PropertyCaretChangePackage,
++ firePropertyCaretChange, oldPosition, newPosition)
++ DISPATCH_EVENT_PACKAGE(cPropertyVisibleDataChangePackage,
++ PropertyVisibleDataChangePackage, firePropertyVisibleDataChange)
++ DISPATCH_PROPERTY_CHANGE_PACKAGE(cPropertyChildChangePackage,
++ PropertyChildChangePackage,
++ firePropertyChildChange,
++ oldChildAccessibleContext,
++ newChildAccessibleContext)
++ DISPATCH_PROPERTY_CHANGE_PACKAGE(cPropertyActiveDescendentChangePackage,
++ PropertyActiveDescendentChangePackage,
++ firePropertyActiveDescendentChange,
++ oldActiveDescendentAccessibleContext,
++ newActiveDescendentAccessibleContext)
++
++ DISPATCH_PROPERTY_TABLE_MODEL_CHANGE_PACKAGE(cPropertyTableModelChangePackage,
++ PropertyTableModelChangePackage,
++ firePropertyTableModelChange,
++ oldValue, newValue)
++
++
++ default:
++ PrintDebugString(" processing FAILED!! -> don't know how to handle type = %X", *type);
++ break;
++ }
++
++ PrintDebugString(" package processing completed");
++}
++
++
++// -----------------------------
++
++void
++WinAccessBridge::JavaVMDestroyed(HWND VMBridgeDLLWindow) {
++ PrintDebugString("***** WinAccessBridge::JavaVMDestroyed(%p)", VMBridgeDLLWindow);
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *currentVM = javaVMs;
++ AccessBridgeJavaVMInstance *previousVM = javaVMs;
++ if (javaVMs->javaAccessBridgeWindow == VMBridgeDLLWindow) {
++ javaVMs = javaVMs->nextJVMInstance;
++ delete currentVM;
++
++ PrintDebugString(" data structures successfully removed");
++
++ // [[[FIXME]]] inform Windows AT that a JVM went away,
++ // and that any jobjects it's got lying around for that JVM
++ // are now invalid
++
++ } else {
++ while (currentVM != (AccessBridgeJavaVMInstance *) 0) {
++ if (currentVM->javaAccessBridgeWindow == VMBridgeDLLWindow) {
++ previousVM->nextJVMInstance = currentVM->nextJVMInstance;
++ delete currentVM;
++
++ PrintDebugString(" data structures successfully removed");
++
++ // [[[FIXME]]] inform Windows AT that a JVM went away,
++ // and that any jobjects it's got lying around for that JVM
++ // are now invalid
++ isVMInstanceChainInUse = false;
++ return;
++ } else {
++ previousVM = currentVM;
++ currentVM = currentVM->nextJVMInstance;
++ }
++ }
++ PrintDebugString(" ERROR!! couldn't find matching data structures!");
++ }
++ isVMInstanceChainInUse = false;
++}
++
++// -----------------------
++
++/**
++ * releaseJavaObject - lets the JavaVM know it can release the Java Object
++ *
++ * Note: once you have made this call, the JavaVM will garbage collect
++ * the jobject you pass in. If you later use that jobject in another
++ * call, you will cause all maner of havoc!
++ *
++ */
++void
++WinAccessBridge::releaseJavaObject(long vmID, JOBJECT64 object) {
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::releaseJavaObject(%X, %p)", vmID, object);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::releaseJavaObject(%X, %016I64X)", vmID, object);
++#endif
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++ char buffer[sizeof(PackageType) + sizeof(ReleaseJavaObjectPackage)];
++ PackageType *type = (PackageType *) buffer;
++ ReleaseJavaObjectPackage *pkg = (ReleaseJavaObjectPackage *) (buffer + sizeof(PackageType));
++ *type = cReleaseJavaObjectPackage;
++ pkg->vmID = vmID;
++ pkg->object = object;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ sendPackage(buffer, sizeof(buffer), destABWindow); // no return values!
++ }
++}
++
++// -----------------------
++
++/**
++ * getVersionInfo - fill the AccessBridgeVersionInfo struct
++ *
++ */
++BOOL
++WinAccessBridge::getVersionInfo(long vmID, AccessBridgeVersionInfo *info) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessBridgeVersionPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessBridgeVersionPackage *pkg = (GetAccessBridgeVersionPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessBridgeVersionPackage;
++ pkg->vmID = vmID;
++
++ PrintDebugString("WinAccessBridge::getVersionInfo(%X, )", vmID);
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(info, &(pkg->rVersionInfo), sizeof(AccessBridgeVersionInfo));
++ PrintDebugString(" VMversion: %ls", info->VMversion);
++ PrintDebugString(" bridgeJavaClassVersion: %ls", info->bridgeJavaClassVersion);
++ PrintDebugString(" bridgeJavaDLLVersion: %ls", info->bridgeJavaDLLVersion);
++ PrintDebugString(" bridgeWinDLLVersion: %ls", info->bridgeWinDLLVersion);
++ return TRUE;
++ }
++ }
++ return FALSE;
++}
++
++
++/********** Window-related routines ***********************************/
++
++/**
++ * isJavaWindow - returns TRUE if the HWND is a top-level Java Window
++ *
++ * Note: just because the Windnow is a top-level Java window, that doesn't
++ * mean that it is accessible. Call getAccessibleContextFromHWND(HWND) to get the
++ * AccessibleContext, if any, for an HWND that is a Java Window.
++ *
++ */
++BOOL
++WinAccessBridge::isJavaWindow(HWND window) {
++ HWND hwnd;
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ // quick check to see if 'window' is top-level; if not, it's not interesting...
++ // [[[FIXME]]] is this for sure an OK optimization?
++ hwnd = getTopLevelHWND(window);
++ if (hwnd == (HWND) NULL) {
++ return FALSE;
++ }
++
++ PrintDebugString(" in WinAccessBridge::isJavaWindow");
++
++
++
++ char buffer[sizeof(PackageType) + sizeof(IsJavaWindowPackage)];
++ PackageType *type = (PackageType *) buffer;
++ IsJavaWindowPackage *pkg = (IsJavaWindowPackage *) (buffer + sizeof(PackageType));
++ *type = cIsJavaWindowPackage;
++ pkg->window = (jint) window;
++
++ PrintDebugString("WinAccessBridge::isJavaWindow(%p)", window);
++
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *current = javaVMs;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), current->javaAccessBridgeWindow) == TRUE) {
++ if (pkg->rResult != 0) {
++ isVMInstanceChainInUse = false;
++ return TRUE;
++ }
++ }
++ current = current->nextJVMInstance;
++ }
++ isVMInstanceChainInUse = false;
++ return FALSE;
++
++
++ /*
++ char classname[256];
++ HWND hwnd;
++
++ hwnd = getTopLevelHWND(window);
++ if (hwnd == (HWND) NULL) {
++ return FALSE;
++ }
++ GetClassName(hwnd, classname, 256);
++
++ if (strstr(classname, "AwtFrame") != 0) {
++ return TRUE;
++ } else if (strstr(classname, "AwtWindow") != 0) {
++ return TRUE;
++ } else if (strstr(classname, "AwtDialog") != 0) {
++ return TRUE;
++ }
++ */
++ // JDK 1.4 introduces new (and changes old) classnames
++ /*
++ else if (strstr(classname, "SunAwtToolkit") != 0) {
++ return TRUE;
++ } else if (strstr(classname, "javax.swing.JFrame") != 0) {
++ return TRUE;
++ }
++ */
++
++ return FALSE;
++}
++
++/**
++ * isSameObject - returns TRUE if the two object references refer to
++ * the same object. Otherwise, this method returns FALSE:
++ */
++BOOL
++WinAccessBridge::isSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::isSameObject(%p %p)", obj1, obj2);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::isSameObject(%016I64X %016I64X)", obj1, obj2);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(IsSameObjectPackage)];
++ PackageType *type = (PackageType *) buffer;
++ IsSameObjectPackage *pkg = (IsSameObjectPackage *) (buffer + sizeof(PackageType));
++ *type = cIsSameObjectPackage;
++ pkg->vmID = vmID;
++ pkg->obj1 = obj1;
++ pkg->obj2 = obj2;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(pkg->vmID);
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ if (pkg->rResult != 0) {
++ PrintDebugString(" WinAccessBridge::isSameObject returning TRUE (same object)");
++ return TRUE;
++ } else {
++ PrintDebugString(" WinAccessBridge::isSameObject returning FALSE (different object)");
++ return FALSE;
++ }
++ }
++ PrintDebugString(" WinAccessBridge::isSameObject returning FALSE (sendMemoryPackage failed)");
++ return FALSE;
++}
++
++/**
++ * FromHWND - returns the AccessibleContext jobject for the HWND
++ *
++ * Note: this routine can return null, even if the HWND is a Java Window,
++ * because the Java Window may not be accessible.
++ *
++ */
++BOOL
++WinAccessBridge::getAccessibleContextFromHWND(HWND window, long *vmID, JOBJECT64 *AccessibleContext) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleContextFromHWNDPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleContextFromHWNDPackage *pkg = (GetAccessibleContextFromHWNDPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleContextFromHWNDPackage;
++ pkg->window = (jint) window;
++
++ PrintDebugString("WinAccessBridge::getAccessibleContextFromHWND(%p, )", window);
++
++ DEBUG_CODE(pkg->rVMID = (long ) 0x01010101);
++ DEBUG_CODE(pkg->rAccessibleContext = (JOBJECT64) 0x01010101);
++
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *current = javaVMs;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++
++ if (sendMemoryPackage(buffer, sizeof(buffer), current->javaAccessBridgeWindow) == TRUE) {
++ if (pkg->rAccessibleContext != 0) {
++ *vmID = pkg->rVMID;
++ *AccessibleContext = (JOBJECT64)pkg->rAccessibleContext;
++ PrintDebugString(" current->vmID = %X", current->vmID);
++ PrintDebugString(" pkg->rVMID = %X", pkg->rVMID);
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" pkg->rAccessibleContext = %p", pkg->rAccessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" pkg->rAccessibleContext = %016I64X", pkg->rAccessibleContext);
++#endif
++ if (pkg->rVMID != current->vmID) {
++ PrintDebugString(" ERROR! getAccessibleContextFromHWND vmIDs don't match!");
++ isVMInstanceChainInUse = false;
++ return FALSE;
++ }
++ isVMInstanceChainInUse = false;
++ return TRUE;
++ }
++ }
++ current = current->nextJVMInstance;
++ }
++ isVMInstanceChainInUse = false;
++
++ // This isn't really an error; it just means that the HWND was for a non-Java
++ // window. It's also possible the HWND was for a Java window but the JVM has
++ // since been shut down and sendMemoryPackage returned FALSE.
++ PrintDebugString(" ERROR! getAccessibleContextFromHWND no matching HWND found!");
++ return FALSE;
++}
++
++/**
++ * Returns the HWND for an AccessibleContext. Returns (HWND)0 on error.
++ */
++HWND
++WinAccessBridge::getHWNDFromAccessibleContext(long vmID, JOBJECT64 accessibleContext) {
++ PrintDebugString(" in WinAccessBridge::getHWNDFromAccessibleContext");
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return (HWND)0;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetHWNDFromAccessibleContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetHWNDFromAccessibleContextPackage *pkg = (GetHWNDFromAccessibleContextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetHWNDFromAccessibleContextPackage;
++ pkg->accessibleContext = accessibleContext;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getHWNDFromAccessibleContext(%p)", accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getHWNDFromAccessibleContext(%016I64X)", accessibleContext);
++#endif
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return ((HWND)ABLongToHandle(pkg->rHWND));
++ }
++ }
++ return (HWND)0;
++}
++
++/********** AccessibleContext routines ***********************************/
++
++/**
++ * Walk through Java Windows, in front-to-back Z-order.
++ * If NULL is passed it, this function starts at the top.
++ *
++ */
++HWND
++WinAccessBridge::getNextJavaWindow(HWND previous) {
++ HWND current = previous;
++ if (current == NULL) {
++ current = GetTopWindow(NULL);
++ } else {
++ current = GetNextWindow(current, GW_HWNDNEXT);
++ }
++ while (current != NULL) {
++ if (isJavaWindow(current)) {
++ return current;
++ }
++ current = GetNextWindow(current, GW_HWNDNEXT);
++ }
++ return NULL;
++}
++
++
++/**
++ * getAccessibleContextAt - performs the Java code:
++ * Accessible a = EventQueueMonitor.getAccessibleAt(x, y);
++ * return a.getAccessibleContext();
++ *
++ * Note: this call explicitly goes through the AccessBridge,
++ * so that the AccessBridge can hide expected changes in how this functions
++ * between JDK 1.1.x w/AccessibilityUtility classes, and JDK 1.2, when some
++ * of this functionality may be built into the platform
++ *
++ */
++BOOL
++WinAccessBridge::getAccessibleContextAt(long vmID, JOBJECT64 AccessibleContextParent,
++ jint x, jint y, JOBJECT64 *AccessibleContext) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleContextAtPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleContextAtPackage *pkg = (GetAccessibleContextAtPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleContextAtPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContextParent;
++ pkg->x = x;
++ pkg->y = y;
++
++ PrintDebugString("WinAccessBridge::getAccessibleContextAt(%X, %p, %d, %c)", vmID, AccessibleContextParent, x, y);
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(pkg->vmID);
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ *AccessibleContext = pkg->rAccessibleContext;
++ return TRUE;
++ }
++
++ return FALSE;
++}
++
++
++/**
++ * getAccessibleContextWithFocus - performs the Java code:
++ * Accessible a = Translator.getAccessible(SwingEventMonitor.getComponentWithFocus());
++ * return a.getAccessibleContext();
++ *
++ * Note: this call explicitly goes through the AccessBridge,
++ * so that the AccessBridge can hide expected changes in how this functions
++ * between JDK 1.1.x w/AccessibilityUtility classes, and JDK 1.2, when some
++ * of this functionality may be built into the platform
++ *
++ */
++BOOL
++WinAccessBridge::getAccessibleContextWithFocus(HWND window, long *vmID, JOBJECT64 *AccessibleContext) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleContextWithFocusPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleContextWithFocusPackage *pkg = (GetAccessibleContextWithFocusPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleContextWithFocusPackage;
++
++ PrintDebugString("WinAccessBridge::getAccessibleContextWithFocus(%p, %X, )", window, vmID);
++ // find vmID, etc. from HWND; ask that VM for the AC w/Focus
++ HWND pkgVMID = (HWND)ABLongToHandle( pkg->rVMID ) ;
++ if (getAccessibleContextFromHWND(window, (long *)&(pkgVMID), &(pkg->rAccessibleContext)) == TRUE) {
++ HWND destABWindow = javaVMs->findAccessBridgeWindow((long)pkgVMID); // ineffecient [[[FIXME]]]
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ *vmID = pkg->rVMID;
++ *AccessibleContext = pkg->rAccessibleContext;
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++/**
++ * getAccessibleContextInfo - fills a struct with a bunch of information
++ * contained in the Java Accessibility API
++ *
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getAccessibleContextInfo(long vmID,
++ JOBJECT64 accessibleContext,
++ AccessibleContextInfo *info) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleContextInfoPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleContextInfoPackage *pkg = (GetAccessibleContextInfoPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleContextInfoPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = accessibleContext;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleContextInfo(%X, %p, )", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleContextInfo(%X, %016I64X, )", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(info, &(pkg->rAccessibleContextInfo), sizeof(AccessibleContextInfo));
++ PrintDebugString(" name: %ls", info->name);
++ PrintDebugString(" description: %ls", info->description);
++ PrintDebugString(" role: %ls", info->role);
++ PrintDebugString(" role_en_US: %ls", info->role_en_US);
++ PrintDebugString(" states: %ls", info->states);
++ PrintDebugString(" states_en_US: %ls", info->states_en_US);
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++/**
++ * getAccessibleChildFromContext - performs the Java code:
++ * Accessible child = ac.getAccessibleChild(i);
++ * return child.getAccessibleContext();
++ *
++ * Note: this call explicitly goes through the AccessBridge,
++ * so that the AccessBridge can hide expected changes in how this functions
++ * between JDK 1.1.x w/AccessibilityUtility classes, and JDK 1.2, when some
++ * of this functionality may be built into the platform
++ *
++ */
++JOBJECT64
++WinAccessBridge::getAccessibleChildFromContext(long vmID,
++ JOBJECT64 AccessibleContext,
++ jint childIndex) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return (JOBJECT64)0;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleChildFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleChildFromContextPackage *pkg = (GetAccessibleChildFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleChildFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->childIndex = childIndex;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleChildFromContext(%X, %p, %d)", vmID, AccessibleContext, childIndex);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleChildFromContext(%X, %016I64X, %d)", vmID, AccessibleContext, childIndex);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rAccessibleContext;
++ }
++ }
++
++ return (JOBJECT64) 0;
++}
++
++/**
++ * getAccessibleParentFromContext - returns the parent AccessibleContext jobject
++ *
++ * Note: this may be null, if the AccessibleContext passed in is a top-level
++ * window, then it has no parent.
++ *
++ */
++JOBJECT64
++WinAccessBridge::getAccessibleParentFromContext(long vmID,
++ JOBJECT64 AccessibleContext) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return (JOBJECT64)0;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleParentFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleParentFromContextPackage *pkg = (GetAccessibleParentFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleParentFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++
++ PrintDebugString("WinAccessBridge::getAccessibleParentFromContext(%X, %p)", vmID, AccessibleContext);
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rAccessibleContext;
++ }
++ }
++
++ return (JOBJECT64) 0;
++}
++
++/********** AccessibleTable routines ***********************************/
++
++BOOL
++WinAccessBridge::getAccessibleTableInfo(long vmID,
++ JOBJECT64 accessibleContext,
++ AccessibleTableInfo *tableInfo) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableInfo(%X, %p, %p)", vmID, accessibleContext,
++ tableInfo);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableInfo(%X, %016I64X, %p)", vmID, accessibleContext,
++ tableInfo);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableInfoPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableInfoPackage *pkg = (GetAccessibleTableInfoPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableInfoPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(tableInfo, &(pkg->rTableInfo), sizeof(AccessibleTableInfo));
++ if (pkg->rTableInfo.rowCount != -1) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableInfo succeeded");
++ return TRUE;
++ }
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableInfo failed");
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::getAccessibleTableCellInfo(long vmID, JOBJECT64 accessibleTable,
++ jint row, jint column,
++ AccessibleTableCellInfo *tableCellInfo) {
++
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableCellInfo(%X, %p, %d, %d, %p)", vmID,
++ accessibleTable, row, column, tableCellInfo);
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableCellInfoPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableCellInfoPackage *pkg = (GetAccessibleTableCellInfoPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableCellInfoPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++ pkg->row = row;
++ pkg->column = column;
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" XXXX pkg->rTableCellInfo.accessibleContext = %p", pkg->rTableCellInfo.accessibleContext);
++ memcpy(tableCellInfo, &(pkg->rTableCellInfo), sizeof(AccessibleTableCellInfo));
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableCellInfo succeeded");
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableCellInfo failed");
++ return FALSE;
++}
++
++
++BOOL
++WinAccessBridge::getAccessibleTableRowHeader(long vmID, JOBJECT64 accessibleContext, AccessibleTableInfo *tableInfo) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRowHeader(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRowHeader(%X, %016I64X)", vmID, accessibleContext);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableRowHeaderPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableRowHeaderPackage *pkg = (GetAccessibleTableRowHeaderPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableRowHeaderPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRowHeader succeeded");
++ memcpy(tableInfo, &(pkg->rTableInfo), sizeof(AccessibleTableInfo));
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRowHeader failed");
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::getAccessibleTableColumnHeader(long vmID, JOBJECT64 accessibleContext, AccessibleTableInfo *tableInfo) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumnHeader(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumnHeader(%X, %016I64X)", vmID, accessibleContext);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableColumnHeaderPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableColumnHeaderPackage *pkg = (GetAccessibleTableColumnHeaderPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableColumnHeaderPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumnHeader succeeded");
++ memcpy(tableInfo, &(pkg->rTableInfo), sizeof(AccessibleTableInfo));
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumnHeader failed");
++ return FALSE;
++}
++
++JOBJECT64
++WinAccessBridge::getAccessibleTableRowDescription(long vmID,
++ JOBJECT64 accessibleContext,
++ jint row) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRowDescription(%X, %p, %d)", vmID, accessibleContext,
++ row);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRowDescription(%X, %016I64X, %d)", vmID, accessibleContext,
++ row);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableRowDescriptionPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableRowDescriptionPackage *pkg = (GetAccessibleTableRowDescriptionPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableRowDescriptionPackage;
++ pkg->vmID = vmID;
++ pkg->row = row;
++ pkg->accessibleContext = accessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRowDescription succeeded");
++ return pkg->rAccessibleContext;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRowDescription failed");
++ return (JOBJECT64)0;
++}
++
++JOBJECT64
++WinAccessBridge::getAccessibleTableColumnDescription(long vmID,
++ JOBJECT64 accessibleContext,
++ jint column) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumnDescription(%X, %p, %d)", vmID, accessibleContext,
++ column);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumnDescription(%X, %016I64X, %d)", vmID, accessibleContext,
++ column);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableColumnDescriptionPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableColumnDescriptionPackage *pkg =
++ (GetAccessibleTableColumnDescriptionPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableColumnDescriptionPackage;
++ pkg->vmID = vmID;
++ pkg->column = column;
++ pkg->accessibleContext = accessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumnDescription succeeded");
++ return pkg->rAccessibleContext;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumnDescription failed");
++ return (JOBJECT64)0;
++}
++
++jint
++WinAccessBridge::getAccessibleTableRowSelectionCount(long vmID, JOBJECT64 accessibleTable) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRowSelectionCount(%X, %p)", vmID, accessibleTable);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRowSelectionCount(%X, %016I64X)", vmID, accessibleTable);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return 0;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableRowSelectionCountPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableRowSelectionCountPackage *pkg =
++ (GetAccessibleTableRowSelectionCountPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableRowSelectionCountPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRowSelectionCount succeeded");
++ return pkg->rCount;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRowSelectionCount failed");
++ return 0;
++}
++
++BOOL
++WinAccessBridge::isAccessibleTableRowSelected(long vmID, JOBJECT64 accessibleTable, jint row) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::isAccessibleTableRowSelected(%X, %p)", vmID, accessibleTable);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::isAccessibleTableRowSelected(%X, %016I64X)", vmID, accessibleTable);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(IsAccessibleTableRowSelectedPackage)];
++ PackageType *type = (PackageType *) buffer;
++ IsAccessibleTableRowSelectedPackage *pkg = (IsAccessibleTableRowSelectedPackage *) (buffer + sizeof(PackageType));
++ *type = cIsAccessibleTableRowSelectedPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++ pkg->row = row;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::isAccessibleTableRowSelected succeeded");
++ return pkg->rResult;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::isAccessibleTableRowSelected failed");
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::getAccessibleTableRowSelections(long vmID, JOBJECT64 accessibleTable, jint count, jint *selections) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRowSelections(%X, %p)", vmID, accessibleTable);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRowSelections(%X, %016I64X)", vmID, accessibleTable);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableRowSelectionsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableRowSelectionsPackage *pkg =
++ (GetAccessibleTableRowSelectionsPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableRowSelectionsPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++ pkg->count = count;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRowSelections succeeded");
++ memcpy(selections, pkg->rSelections, count * sizeof(jint));
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRowSelections failed");
++ return FALSE;
++}
++
++
++jint
++WinAccessBridge::getAccessibleTableColumnSelectionCount(long vmID, JOBJECT64 accessibleTable) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumnSelectionCount(%X, %p)", vmID,
++ accessibleTable);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumnSelectionCount(%X, %016I64X)", vmID,
++ accessibleTable);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableColumnSelectionCountPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableColumnSelectionCountPackage *pkg =
++ (GetAccessibleTableColumnSelectionCountPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableColumnSelectionCountPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumnSelectionCount succeeded");
++ return pkg->rCount;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumnSelectionCount failed");
++ return 0;
++}
++
++BOOL
++WinAccessBridge::isAccessibleTableColumnSelected(long vmID, JOBJECT64 accessibleTable, jint column) {
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::isAccessibleTableColumnSelected(%X, %p)", vmID, accessibleTable);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::isAccessibleTableColumnSelected(%X, %016I64X)", vmID, accessibleTable);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(IsAccessibleTableColumnSelectedPackage)];
++ PackageType *type = (PackageType *) buffer;
++ IsAccessibleTableColumnSelectedPackage *pkg = (IsAccessibleTableColumnSelectedPackage *) (buffer + sizeof(PackageType));
++ *type = cIsAccessibleTableColumnSelectedPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++ pkg->column = column;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::isAccessibleTableColumnSelected succeeded");
++ return pkg->rResult;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::isAccessibleTableColumnSelected failed");
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::getAccessibleTableColumnSelections(long vmID, JOBJECT64 accessibleTable, jint count,
++ jint *selections) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumnSelections(%X, %p)", vmID, accessibleTable);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumnSelections(%X, %016I64X)", vmID, accessibleTable);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableColumnSelectionsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableColumnSelectionsPackage *pkg =
++ (GetAccessibleTableColumnSelectionsPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableColumnSelectionsPackage;
++ pkg->vmID = vmID;
++ pkg->count = count;
++ pkg->accessibleTable = accessibleTable;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumnSelections succeeded");
++ memcpy(selections, pkg->rSelections, count * sizeof(jint));
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumnSelections failed");
++ return FALSE;
++}
++
++jint
++WinAccessBridge::getAccessibleTableRow(long vmID, JOBJECT64 accessibleTable, jint index) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRow(%X, %p, index=%d)", vmID,
++ accessibleTable, index);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableRow(%X, %016I64X, index=%d)", vmID,
++ accessibleTable, index);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableRowPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableRowPackage *pkg =
++ (GetAccessibleTableRowPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableRowPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++ pkg->index = index;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRow succeeded");
++ return pkg->rRow;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableRow failed");
++ return 0;
++}
++
++jint
++WinAccessBridge::getAccessibleTableColumn(long vmID, JOBJECT64 accessibleTable, jint index) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumn(%X, %p, index=%d)", vmID,
++ accessibleTable, index);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableColumn(%X, %016I64X, index=%d)", vmID,
++ accessibleTable, index);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableColumnPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableColumnPackage *pkg =
++ (GetAccessibleTableColumnPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableColumnPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++ pkg->index = index;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumn succeeded");
++ return pkg->rColumn;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableColumn failed");
++ return 0;
++}
++
++jint
++WinAccessBridge::getAccessibleTableIndex(long vmID, JOBJECT64 accessibleTable, jint row, jint column) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableIndex(%X, %p, row=%d, col=%d)", vmID,
++ accessibleTable, row, column);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleTableIndex(%X, %016I64X, row=%d, col=%d)", vmID,
++ accessibleTable, row, column);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTableIndexPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTableIndexPackage *pkg =
++ (GetAccessibleTableIndexPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTableIndexPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleTable = accessibleTable;
++ pkg->row = row;
++ pkg->column = column;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableIndex succeeded");
++ return pkg->rIndex;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleTableIndex failed");
++ return 0;
++}
++
++/********** end AccessibleTable routines ******************************/
++
++BOOL
++WinAccessBridge::getAccessibleRelationSet(long vmID, JOBJECT64 accessibleContext,
++ AccessibleRelationSetInfo *relationSetInfo) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleRelationSet(%X, %p, %X)", vmID,
++ accessibleContext, relationSetInfo);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleRelationSet(%X, %016I64X, %X)", vmID,
++ accessibleContext, relationSetInfo);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleRelationSetPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleRelationSetPackage *pkg = (GetAccessibleRelationSetPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleRelationSetPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### pkg->rAccessibleRelationSetInfo.relationCount = %X",
++ pkg->rAccessibleRelationSetInfo.relationCount);
++ memcpy(relationSetInfo, &(pkg->rAccessibleRelationSetInfo), sizeof(AccessibleRelationSetInfo));
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleRelationSet succeeded");
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleRelationSet failed");
++ return FALSE;
++}
++
++
++/********** AccessibleHypertext routines ***********/
++
++BOOL
++WinAccessBridge::getAccessibleHypertext(long vmID, JOBJECT64 accessibleContext,
++ AccessibleHypertextInfo *hypertextInfo) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHypertext(%X, %p, %X)", vmID,
++ accessibleContext, hypertextInfo);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHypertext(%X, %016I64X, %X)", vmID,
++ accessibleContext, hypertextInfo);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleHypertextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleHypertextPackage *pkg = (GetAccessibleHypertextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleHypertextPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(hypertextInfo, &(pkg->rAccessibleHypertextInfo), sizeof(AccessibleHypertextInfo));
++
++ PrintDebugString(" ##### hypertextInfo.linkCount = %d", hypertextInfo->linkCount);
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHypertext succeeded");
++
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHypertext failed");
++ return FALSE;
++}
++
++
++BOOL
++WinAccessBridge::activateAccessibleHyperlink(long vmID, JOBJECT64 accessibleContext,
++ JOBJECT64 accessibleHyperlink) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::activateAccessibleHyperlink(%p %p)", accessibleContext,
++ accessibleHyperlink);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::activateAccessibleHyperlink(%016I64X %016I64X)", accessibleContext,
++ accessibleHyperlink);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(ActivateAccessibleHyperlinkPackage)];
++ PackageType *type = (PackageType *) buffer;
++ ActivateAccessibleHyperlinkPackage *pkg = (ActivateAccessibleHyperlinkPackage *) (buffer + sizeof(PackageType));
++ *type = cActivateAccessibleHyperlinkPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ pkg->accessibleHyperlink = accessibleHyperlink;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(pkg->vmID);
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rResult;
++ }
++ PrintDebugString(" WinAccessBridge::activateAccessibleHyperlink returning FALSE (sendMemoryPackage failed)");
++ return FALSE;
++}
++
++/*
++ * Returns the number of hyperlinks in a component
++ * Maps to AccessibleHypertext.getLinkCount.
++ * Returns -1 on error.
++ */
++jint
++WinAccessBridge::getAccessibleHyperlinkCount(const long vmID,
++ const AccessibleContext accessibleContext) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHyperlinkCount(%X, %p)",
++ vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHyperlinkCount(%X, %016I64X)",
++ vmID, accessibleContext);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleHyperlinkCountPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleHyperlinkCountPackage *pkg = (GetAccessibleHyperlinkCountPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleHyperlinkCountPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### hypetext link count = %d", pkg->rLinkCount);
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHyperlinkCount succeeded");
++ return pkg->rLinkCount;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHyperlinkCount failed");
++ return -1;
++}
++
++/*
++ * This method is used to iterate through the hyperlinks in a component. It
++ * returns hypertext information for a component starting at hyperlink index
++ * nStartIndex. No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will
++ * be returned for each call to this method.
++ * returns FALSE on error.
++ */
++BOOL
++WinAccessBridge::getAccessibleHypertextExt(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint startIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertextInfo) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHypertextExt(%X, %p %p)", vmID,
++ accessibleContext, hypertextInfo);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHypertextExt(%X, %016I64X %p)", vmID,
++ accessibleContext, hypertextInfo);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleHypertextExtPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleHypertextExtPackage *pkg = (GetAccessibleHypertextExtPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleHypertextExtPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ pkg->startIndex = startIndex;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### pkg->rSuccess = %d", pkg->rSuccess);
++
++ memcpy(hypertextInfo, &(pkg->rAccessibleHypertextInfo), sizeof(AccessibleHypertextInfo));
++ if (pkg->rSuccess == TRUE) {
++ PrintDebugString(" ##### hypertextInfo.linkCount = %d", hypertextInfo->linkCount);
++ PrintDebugString(" ##### hypertextInfo.linkCount = %d", hypertextInfo->linkCount);
++ } else {
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHypertextExt failed");
++ }
++ return pkg->rSuccess;;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHypertextExt failed");
++ return FALSE;
++}
++
++
++/*
++ * Returns the index into an array of hyperlinks that is associated with
++ * a character index in document;
++ * Maps to AccessibleHypertext.getLinkIndex.
++ * Returns -1 on error.
++ */
++jint
++WinAccessBridge::getAccessibleHypertextLinkIndex(const long vmID,
++ const AccessibleHyperlink hypertext,
++ const jint charIndex) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHypertextLinkIndex(%X, %p)",
++ vmID, hypertext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHypertextLinkIndex(%X, %016I64X)",
++ vmID, hypertext);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleHypertextLinkIndexPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleHypertextLinkIndexPackage *pkg = (GetAccessibleHypertextLinkIndexPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleHypertextLinkIndexPackage;
++ pkg->vmID = vmID;
++ pkg->hypertext = hypertext;
++ pkg->charIndex = charIndex;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" ##### hypetext link index = %d", pkg->rLinkIndex);
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHypertextLinkIndex succeeded");
++ return pkg->rLinkIndex;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHypertextLinkIndex failed");
++ return -1;
++}
++
++/*
++ * Returns the nth hyperlink in a document.
++ * Maps to AccessibleHypertext.getLink.
++ * Returns -1 on error
++ */
++BOOL
++WinAccessBridge::getAccessibleHyperlink(const long vmID,
++ const AccessibleHyperlink hypertext,
++ const jint linkIndex,
++ /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHyperlink(%X, %p, %p)", vmID,
++ hypertext, hyperlinkInfo);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleHyperlink(%X, %016I64X, %p)", vmID,
++ hypertext, hyperlinkInfo);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleHyperlinkPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleHyperlinkPackage *pkg = (GetAccessibleHyperlinkPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleHyperlinkPackage;
++ pkg->vmID = vmID;
++ pkg->hypertext = hypertext;
++ pkg->linkIndex = linkIndex;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(hyperlinkInfo, &(pkg->rAccessibleHyperlinkInfo),
++ sizeof(AccessibleHyperlinkInfo));
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHypertext succeeded");
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleHypertext failed");
++ return FALSE;
++}
++
++
++/********** AccessibleKeyBinding routines ***********/
++
++BOOL
++WinAccessBridge::getAccessibleKeyBindings(long vmID, JOBJECT64 accessibleContext,
++ AccessibleKeyBindings *keyBindings) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleKeyBindings(%X, %p, %p)", vmID,
++ accessibleContext, keyBindings);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleKeyBindings(%X, %016I64X, %p)", vmID,
++ accessibleContext, keyBindings);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleKeyBindingsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleKeyBindingsPackage *pkg = (GetAccessibleKeyBindingsPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleKeyBindingsPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(keyBindings, &(pkg->rAccessibleKeyBindings), sizeof(AccessibleKeyBindings));
++
++ PrintDebugString(" ##### keyBindings.keyBindingsCount = %d", keyBindings->keyBindingsCount);
++ for (int i = 0; i < keyBindings->keyBindingsCount; ++i) {
++ PrintDebugString(" Key Binding # %d", i+1);
++ PrintDebugString(" Modifiers: 0x%x", keyBindings->keyBindingInfo[i].modifiers);
++ PrintDebugString(" Character (hex): 0x%x", keyBindings->keyBindingInfo[i].character);
++ PrintDebugString(" Character (wide char): %lc", keyBindings->keyBindingInfo[i].character);
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleKeyBindings succeeded");
++
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleKeyBindings failed");
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::getAccessibleIcons(long vmID, JOBJECT64 accessibleContext, AccessibleIcons *icons) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleIcons(%X, %p, %p)", vmID,
++ accessibleContext, icons);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleIcons(%X, %016I64X, %p)", vmID,
++ accessibleContext, icons);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleIconsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleIconsPackage *pkg = (GetAccessibleIconsPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleIconsPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(icons, &(pkg->rAccessibleIcons), sizeof(AccessibleIcons));
++
++ PrintDebugString(" ##### icons.iconsCount = %d", icons->iconsCount);
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleIcons succeeded");
++
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleIcons failed");
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::getAccessibleActions(long vmID, JOBJECT64 accessibleContext, AccessibleActions *actions) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("##### WinAccessBridge::getAccessibleActions(%X, %p, %p)", vmID,
++ accessibleContext, actions);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("##### WinAccessBridge::getAccessibleActions(%X, %016I64X, %p)", vmID,
++ accessibleContext, actions);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleActionsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleActionsPackage *pkg = (GetAccessibleActionsPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleActionsPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(actions, &(pkg->rAccessibleActions), sizeof(AccessibleActions));
++
++ PrintDebugString(" ##### actions.actionsCount = %d", actions->actionsCount);
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleActions succeeded");
++
++ return TRUE;
++ }
++ }
++ PrintDebugString(" ##### WinAccessBridge::getAccessibleActions failed");
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::doAccessibleActions(long vmID, JOBJECT64 accessibleContext,
++ AccessibleActionsToDo *actionsToDo, jint *failure) {
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::doAccessibleActions(%p #actions %d %ls)", accessibleContext,
++ actionsToDo->actionsCount,
++ actionsToDo->actions[0].name);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::doAccessibleActions(%016I64X #actions %d %ls)", accessibleContext,
++ actionsToDo->actionsCount,
++ actionsToDo->actions[0].name);
++#endif
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(DoAccessibleActionsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ DoAccessibleActionsPackage *pkg = (DoAccessibleActionsPackage *) (buffer + sizeof(PackageType));
++ *type = cDoAccessibleActionsPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ memcpy((void *)(&(pkg->actionsToDo)), (void *)actionsToDo, sizeof(AccessibleActionsToDo));
++ pkg->failure = -1;
++
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(pkg->vmID);
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ *failure = pkg->failure;
++ return pkg->rResult;
++ }
++ PrintDebugString(" WinAccessBridge::doAccessibleActions returning FALSE (sendMemoryPackage failed)");
++ return FALSE;
++}
++
++/* ====== Utility methods ====== */
++
++/**
++ * Sets a text field to the specified string. Returns whether successful.
++ */
++BOOL
++WinAccessBridge::setTextContents (const long vmID, const AccessibleContext accessibleContext,
++ const wchar_t *text) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(SetTextContentsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ SetTextContentsPackage *pkg = (SetTextContentsPackage *) (buffer + sizeof(PackageType));
++ *type = cSetTextContentsPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ wcsncpy(pkg->text, text, sizeof(pkg->text)/sizeof(wchar_t)); // wide character copy
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::setTextContents(%X, %016I64X %ls)", vmID, accessibleContext, text);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::setTextContents(%X, %p %ls)", vmID, accessibleContext, text);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rResult;
++ }
++ }
++ return FALSE;
++}
++
++/**
++ * Returns the Accessible Context of a Page Tab object that is the
++ * ancestor of a given object. If the object is a Page Tab object
++ * or a Page Tab ancestor object was found, returns the object
++ * AccessibleContext.
++ * If there is no ancestor object that has an Accessible Role of Page Tab,
++ * returns (AccessibleContext)0.
++ */
++AccessibleContext
++WinAccessBridge::getParentWithRole (const long vmID, const AccessibleContext accessibleContext, const wchar_t *role) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return (JOBJECT64)0;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetParentWithRolePackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetParentWithRolePackage *pkg = (GetParentWithRolePackage *) (buffer + sizeof(PackageType));
++ *type = cGetParentWithRolePackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ memcpy((void *)(&(pkg->role)), (void *)role, sizeof(pkg->role));
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getParentWithRole(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getParentWithRole(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ PrintDebugString(" pkg->vmID: %X", pkg->vmID);
++ PrintDebugString(" pkg->accessibleContext: %p", pkg->accessibleContext);
++ PrintDebugString(" pkg->role: %ls", pkg->role);
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ PrintDebugString(" pkg->rAccessibleContext: %p", pkg->rAccessibleContext);
++ return pkg->rAccessibleContext;
++ }
++ }
++ return (JOBJECT64) 0;
++}
++
++
++/**
++ * Returns the Accessible Context for the top level object in
++ * a Java Window. This is same Accessible Context that is obtained
++ * from GetAccessibleContextFromHWND for that window. Returns
++ * (AccessibleContext)0 on error.
++ */
++AccessibleContext
++WinAccessBridge::getTopLevelObject (const long vmID, const AccessibleContext accessibleContext) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return (JOBJECT64)0;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetTopLevelObjectPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetTopLevelObjectPackage *pkg = (GetTopLevelObjectPackage *) (buffer + sizeof(PackageType));
++ *type = cGetTopLevelObjectPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getTopLevelObject(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getTopLevelObject(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rAccessibleContext;
++ }
++ }
++ return (JOBJECT64) 0;
++}
++
++/**
++ * If there is an Ancestor object that has an Accessible Role of
++ * Internal Frame, returns the Accessible Context of the Internal
++ * Frame object. Otherwise, returns the top level object for that
++ * Java Window. Returns (AccessibleContext)0 on error.
++ */
++AccessibleContext
++WinAccessBridge::getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext, const wchar_t *role) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return (JOBJECT64)0;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetParentWithRoleElseRootPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetParentWithRoleElseRootPackage *pkg = (GetParentWithRoleElseRootPackage *) (buffer + sizeof(PackageType));
++ *type = cGetParentWithRoleElseRootPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ memcpy((void *)(&(pkg->role)), (void *)role, sizeof(pkg->role));
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getParentWithRoleElseRoot(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getParentWithRoleElseRoot(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rAccessibleContext;
++ }
++ }
++ return (JOBJECT64) 0;
++}
++
++/**
++ * Returns how deep in the object hierarchy a given object is.
++ * The top most object in the object hierarchy has an object depth of 0.
++ * Returns -1 on error.
++ */
++int
++WinAccessBridge::getObjectDepth (const long vmID, const AccessibleContext accessibleContext) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return -1;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetObjectDepthPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetObjectDepthPackage *pkg = (GetObjectDepthPackage *) (buffer + sizeof(PackageType));
++ *type = cGetObjectDepthPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getObjectDepth(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getObjectDepth(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rResult;
++ }
++ }
++ return -1;
++}
++
++/**
++ * Returns the Accessible Context of the currently ActiveDescendent of an object.
++ * Returns (AccessibleContext)0 on error.
++ */
++AccessibleContext
++WinAccessBridge::getActiveDescendent (const long vmID, const AccessibleContext accessibleContext) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return (JOBJECT64)0;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetActiveDescendentPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetActiveDescendentPackage *pkg = (GetActiveDescendentPackage *) (buffer + sizeof(PackageType));
++ *type = cGetActiveDescendentPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getActiveDescendent(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getActiveDescendent(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rAccessibleContext;
++ }
++ }
++ return (JOBJECT64) 0;
++}
++
++/**
++ * Additional methods for Teton
++ */
++
++/**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
++ * whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++BOOL
++WinAccessBridge::getVirtualAccessibleName(long vmID, AccessibleContext accessibleContext,
++ wchar_t *name, int len) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetVirtualAccessibleNamePackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetVirtualAccessibleNamePackage *pkg = (GetVirtualAccessibleNamePackage *) (buffer + sizeof(PackageType));
++ *type = cGetVirtualAccessibleNamePackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ size_t max = (len > sizeof(pkg->rName)) ? sizeof(pkg->rName) : len;
++ pkg->len = (int)max;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getVirtualAccessibleName(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getVirtualAccessibleName(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ wcsncpy(name, pkg->rName, max);
++ PrintDebugString(" WinAccessBridge::getVirtualAccessibleName: Virtual name = %ls", name);
++ return TRUE;
++ }
++ }
++ return FALSE;
++}
++
++/**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++BOOL
++WinAccessBridge::requestFocus(long vmID, AccessibleContext accessibleContext) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(RequestFocusPackage)];
++ PackageType *type = (PackageType *) buffer;
++ RequestFocusPackage *pkg = (RequestFocusPackage *) (buffer + sizeof(PackageType));
++ *type = cRequestFocusPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::requestFocus(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::requestFocus(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return TRUE;
++ }
++ }
++ return FALSE;
++}
++
++/**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++BOOL
++WinAccessBridge::selectTextRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(SelectTextRangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ SelectTextRangePackage *pkg = (SelectTextRangePackage *) (buffer + sizeof(PackageType));
++ *type = cSelectTextRangePackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ pkg->startIndex = startIndex;
++ pkg->endIndex = endIndex;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" WinAccessBridge::selectTextRange(%X, %p %d %d)", vmID, accessibleContext,
++ startIndex, endIndex);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" WinAccessBridge::selectTextRange(%X, %016I64X %d %d)", vmID, accessibleContext,
++ startIndex, endIndex);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return TRUE;
++ }
++ }
++ return FALSE;
++}
++
++/**
++ * Get text attributes between two indices. The attribute list includes the text at the
++ * start index and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++BOOL
++WinAccessBridge::getTextAttributesInRange(long vmID, AccessibleContext accessibleContext,
++ int startIndex, int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetTextAttributesInRangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetTextAttributesInRangePackage *pkg = (GetTextAttributesInRangePackage *) (buffer + sizeof(PackageType));
++ *type = cGetTextAttributesInRangePackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ pkg->startIndex = startIndex;
++ pkg->endIndex = endIndex;
++ memcpy(&(pkg->attributes), attributes, sizeof(AccessibleTextAttributesInfo));
++
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString(" WinAccessBridge::getTextAttributesInRange(%X, %p %d %d)", vmID, accessibleContext,
++ startIndex, endIndex);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString(" WinAccessBridge::getTextAttributesInRange(%X, %016I64X %d %d)", vmID, accessibleContext,
++ startIndex, endIndex);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ *attributes = pkg->attributes;
++ *len = pkg->rLength;
++ return TRUE;
++ }
++ }
++ return FALSE;
++}
++
++/**
++ * Gets the number of visible children of a component. Returns -1 on error.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++int
++WinAccessBridge::getVisibleChildrenCount(long vmID, AccessibleContext accessibleContext) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return -1;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetVisibleChildrenCountPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetVisibleChildrenCountPackage *pkg = (GetVisibleChildrenCountPackage *) (buffer + sizeof(PackageType));
++ *type = cGetVisibleChildrenCountPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getVisibleChildrenCount(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getVisibleChildrenCount(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rChildrenCount;
++ }
++ }
++ return -1;
++}
++
++/**
++ * Gets the visible children of an AccessibleContext. Returns whether successful;
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++BOOL
++WinAccessBridge::getVisibleChildren(long vmID, AccessibleContext accessibleContext, int startIndex,
++ VisibleChildrenInfo *visibleChildrenInfo) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetVisibleChildrenPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetVisibleChildrenPackage *pkg = (GetVisibleChildrenPackage *) (buffer + sizeof(PackageType));
++ *type = cGetVisibleChildrenPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ pkg->startIndex = startIndex;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getVisibleChildren(%X, %p)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getVisibleChildren(%X, %016I64X)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(visibleChildrenInfo, &(pkg->rVisibleChildrenInfo), sizeof(pkg->rVisibleChildrenInfo));
++ return pkg->rSuccess;
++ }
++ }
++ return FALSE;
++}
++
++/**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++BOOL
++WinAccessBridge::setCaretPosition(long vmID, AccessibleContext accessibleContext, int position) {
++
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(SetCaretPositionPackage)];
++ PackageType *type = (PackageType *) buffer;
++ SetCaretPositionPackage *pkg = (SetCaretPositionPackage *) (buffer + sizeof(PackageType));
++ *type = cSetCaretPositionPackage;
++ pkg->vmID = vmID;
++ pkg->accessibleContext = accessibleContext;
++ pkg->position = position;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::setCaretPosition(%X, %p %ls)", vmID, accessibleContext);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::setCaretPosition(%X, %016I64X %ls)", vmID, accessibleContext);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return TRUE;
++ }
++ }
++ return FALSE;
++}
++
++
++/********** AccessibleText routines ***********************************/
++
++/**
++ * getAccessibleTextInfo - fills a struct with a bunch of information
++ * contained in the Java Accessibility AccessibleText API
++ *
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getAccessibleTextInfo(long vmID,
++ JOBJECT64 AccessibleContext,
++ AccessibleTextInfo *textInfo,
++ jint x, jint y) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTextInfoPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTextInfoPackage *pkg = (GetAccessibleTextInfoPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTextInfoPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->x = x;
++ pkg->y = y;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleTextInfo(%X, %p, %p, %d, %d)", vmID, AccessibleContext, textInfo, x, y);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleTextInfo(%X, %016I64X, %p, %d, %d)", vmID, AccessibleContext, textInfo, x, y);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(textInfo, &(pkg->rTextInfo), sizeof(AccessibleTextInfo));
++ if (pkg->rTextInfo.charCount != -1) {
++ PrintDebugString(" charCount: %d", textInfo->charCount);
++ PrintDebugString(" caretIndex: %d", textInfo->caretIndex);
++ PrintDebugString(" indexAtPoint: %d", textInfo->indexAtPoint);
++ return TRUE;
++ }
++ }
++ }
++
++ return FALSE;
++}
++
++/**
++ * getAccessibleTextItems - fills a struct with letter, word, and sentence info
++ * of the AccessibleText interface at a given index
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getAccessibleTextItems(long vmID,
++ JOBJECT64 AccessibleContext,
++ AccessibleTextItemsInfo *textItems,
++ jint index) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTextItemsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTextItemsPackage *pkg = (GetAccessibleTextItemsPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTextItemsPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = index;
++ // zero things out, in case the call fails
++ pkg->rTextItemsInfo.letter = '\0';
++ pkg->rTextItemsInfo.word[0] = '\0';
++ pkg->rTextItemsInfo.sentence[0] = '\0';
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleTextItems(%X, %p, %p, %d)", vmID, AccessibleContext, textItems, index);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleTextItems(%X, %016I64X, %p, %d)", vmID, AccessibleContext, textItems, index);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(textItems, &(pkg->rTextItemsInfo), sizeof(AccessibleTextItemsInfo));
++ if (pkg->rTextItemsInfo.letter != '/0') {
++ return TRUE;
++ }
++ }
++ }
++
++ return FALSE;
++}
++
++/**
++ * getAccessibleTextSelectionInfo - returns information about the selected
++ * text of the object implementing AccessibleText
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getAccessibleTextSelectionInfo(long vmID,
++ JOBJECT64 AccessibleContext,
++ AccessibleTextSelectionInfo *selectionInfo) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTextSelectionInfoPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTextSelectionInfoPackage *pkg = (GetAccessibleTextSelectionInfoPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTextSelectionInfoPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleTextSelectionInfo(%X, %p, %p)", vmID, AccessibleContext, selectionInfo);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleTextSelectionInfo(%X, %016I64X, %p)", vmID, AccessibleContext, selectionInfo);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(selectionInfo, &(pkg->rTextSelectionItemsInfo), sizeof(AccessibleTextSelectionInfo));
++ // [[[FIXME]]] should test to see if valid info returned; return FALSE if not
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++/**
++ * getAccessibleTextAttributes - performs the Java code:
++ * ...[[[FIXME]]] fill in this comment...
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getAccessibleTextAttributes(long vmID,
++ JOBJECT64 AccessibleContext,
++ jint index,
++ AccessibleTextAttributesInfo *attributes) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTextAttributeInfoPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTextAttributeInfoPackage *pkg = (GetAccessibleTextAttributeInfoPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTextAttributeInfoPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = index;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleTextAttributes(%X, %p, %d, %p)", vmID, AccessibleContext, index, attributes);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleTextAttributes(%X, %016I64X, %d, %p)", vmID, AccessibleContext, index, attributes);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(attributes, &(pkg->rAttributeInfo), sizeof(AccessibleTextAttributesInfo));
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++/**
++ * getAccessibleTextRect - gets the text bounding rectangle
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getAccessibleTextRect(long vmID,
++ JOBJECT64 AccessibleContext,
++ AccessibleTextRectInfo *rectInfo,
++ jint index) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTextRectInfoPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTextRectInfoPackage *pkg = (GetAccessibleTextRectInfoPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTextRectInfoPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = index;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleTextRect(%X, %p, %p, %d)", vmID, AccessibleContext, rectInfo, index);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleTextRect(%X, %016I64X, %p, %d)", vmID, AccessibleContext, rectInfo, index);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(rectInfo, (&pkg->rTextRectInfo), sizeof(AccessibleTextRectInfo));
++ // [[[FIXME]]] should test to see if valid info returned; return FALSE if not
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++
++/**
++ * getAccessibleTextRect - gets the text bounding rectangle
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getCaretLocation(long vmID,
++ JOBJECT64 AccessibleContext,
++ AccessibleTextRectInfo *rectInfo,
++ jint index) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetCaretLocationPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetCaretLocationPackage *pkg = (GetCaretLocationPackage *) (buffer + sizeof(PackageType));
++ *type = cGetCaretLocationPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = index;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getCaretLocation(%X, %p, %p, %d)", vmID, AccessibleContext, rectInfo, index);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getCaretLocation(%X, %016I64X, %p, %d)", vmID, AccessibleContext, rectInfo, index);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ memcpy(rectInfo, (&pkg->rTextRectInfo), sizeof(AccessibleTextRectInfo));
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++
++/**
++ * getEventsWaiting - gets the number of events waiting to fire
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++int
++WinAccessBridge::getEventsWaiting() {
++ if(messageQueue) {
++ return(messageQueue->getEventsWaiting());
++ }
++ return(0);
++}
++
++
++/**
++ * getAccessibleTextLineBounds - gets the bounding rectangle for the text line
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getAccessibleTextLineBounds(long vmID,
++ JOBJECT64 AccessibleContext,
++ jint index, jint *startIndex, jint *endIndex) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTextLineBoundsPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTextLineBoundsPackage *pkg = (GetAccessibleTextLineBoundsPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTextLineBoundsPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = index;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleTextLineBounds(%X, %p, %d, )", vmID, AccessibleContext, index);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleTextLineBounds(%X, %016I64X, %d, )", vmID, AccessibleContext, index);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ *startIndex = pkg->rLineStart;
++ *endIndex = pkg->rLineEnd;
++ // [[[FIXME]]] should test to see if valid info returned; return FALSE if not
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++
++/**
++ * getAccessibleTextLineBounds - performs the Java code:
++ * ...[[[FIXME]]] fill in this comment...
++ *
++ * Note: if the AccessibleContext parameter is bogus, this call will blow up
++ */
++BOOL
++WinAccessBridge::getAccessibleTextRange(long vmID,
++ JOBJECT64 AccessibleContext,
++ jint start, jint end, wchar_t *text, short len) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleTextRangePackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleTextRangePackage *pkg = (GetAccessibleTextRangePackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleTextRangePackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->start = start;
++ pkg->end = end;
++
++#ifdef ACCESSBRIDGE_ARCH_LEGACY // JOBJECT64 is jobject (32 bit pointer)
++ PrintDebugString("WinAccessBridge::getAccessibleTextRange(%X, %p, %d, %d, )", vmID, AccessibleContext, start, end);
++#else // JOBJECT64 is jlong (64 bit)
++ PrintDebugString("WinAccessBridge::getAccessibleTextRange(%X, %016I64X, %d, %d, )", vmID, AccessibleContext, start, end);
++#endif
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ wcsncpy(text, pkg->rText, len);
++ // [[[FIXME]]] should test to see if valid info returned; return FALSE if not
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++
++
++
++/********** AccessibleValue routines ***************/
++
++BOOL
++WinAccessBridge::getCurrentAccessibleValueFromContext(long vmID,
++ JOBJECT64 AccessibleContext,
++ wchar_t *value, short len) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetCurrentAccessibleValueFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetCurrentAccessibleValueFromContextPackage *pkg = (GetCurrentAccessibleValueFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetCurrentAccessibleValueFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ wcsncpy(value, pkg->rValue, len);
++ // [[[FIXME]]] should test to see if valid info returned; return FALSE if not
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::getMaximumAccessibleValueFromContext(long vmID,
++ JOBJECT64 AccessibleContext,
++ wchar_t *value, short len) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetMaximumAccessibleValueFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetMaximumAccessibleValueFromContextPackage *pkg = (GetMaximumAccessibleValueFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetMaximumAccessibleValueFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ wcsncpy(value, pkg->rValue, len);
++ // [[[FIXME]]] should test to see if valid info returned; return FALSE if not
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++BOOL
++WinAccessBridge::getMinimumAccessibleValueFromContext(long vmID,
++ JOBJECT64 AccessibleContext,
++ wchar_t *value, short len) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetMinimumAccessibleValueFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetMinimumAccessibleValueFromContextPackage *pkg = (GetMinimumAccessibleValueFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetMinimumAccessibleValueFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ wcsncpy(value, pkg->rValue, len);
++ // [[[FIXME]]] should test to see if valid info returned; return FALSE if not
++ return TRUE;
++ }
++ }
++
++ return FALSE;
++}
++
++
++/********** AccessibleSelection routines ***************/
++
++void
++WinAccessBridge::addAccessibleSelectionFromContext(long vmID,
++ JOBJECT64 AccessibleContext, int i) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++ char buffer[sizeof(PackageType) + sizeof(AddAccessibleSelectionFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ AddAccessibleSelectionFromContextPackage *pkg = (AddAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cAddAccessibleSelectionFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = i;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ sendMemoryPackage(buffer, sizeof(buffer), destABWindow);
++ }
++}
++
++void
++WinAccessBridge::clearAccessibleSelectionFromContext(long vmID,
++ JOBJECT64 AccessibleContext) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++ char buffer[sizeof(PackageType) + sizeof(ClearAccessibleSelectionFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ ClearAccessibleSelectionFromContextPackage *pkg = (ClearAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cClearAccessibleSelectionFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ sendMemoryPackage(buffer, sizeof(buffer), destABWindow);
++ }
++}
++
++JOBJECT64
++WinAccessBridge::getAccessibleSelectionFromContext(long vmID,
++ JOBJECT64 AccessibleContext, int i) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return (JOBJECT64)0;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleSelectionFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleSelectionFromContextPackage *pkg = (GetAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleSelectionFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = i;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return pkg->rAccessibleContext;
++ }
++ }
++
++ return (JOBJECT64) 0;
++}
++
++int
++WinAccessBridge::getAccessibleSelectionCountFromContext(long vmID,
++ JOBJECT64 AccessibleContext) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return -1;
++ }
++ char buffer[sizeof(PackageType) + sizeof(GetAccessibleSelectionCountFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ GetAccessibleSelectionCountFromContextPackage *pkg = (GetAccessibleSelectionCountFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cGetAccessibleSelectionCountFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ return (int) pkg->rCount;
++ }
++ }
++
++ return -1;
++}
++
++BOOL
++WinAccessBridge::isAccessibleChildSelectedFromContext(long vmID,
++ JOBJECT64 AccessibleContext, int i) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return FALSE;
++ }
++ char buffer[sizeof(PackageType) + sizeof(IsAccessibleChildSelectedFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ IsAccessibleChildSelectedFromContextPackage *pkg = (IsAccessibleChildSelectedFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cIsAccessibleChildSelectedFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = i;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ if (sendMemoryPackage(buffer, sizeof(buffer), destABWindow) == TRUE) {
++ if (pkg->rResult != 0) {
++ return TRUE;
++ }
++ }
++ }
++
++ return FALSE;
++}
++
++
++void
++WinAccessBridge::removeAccessibleSelectionFromContext(long vmID,
++ JOBJECT64 AccessibleContext, int i) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++ char buffer[sizeof(PackageType) + sizeof(RemoveAccessibleSelectionFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ RemoveAccessibleSelectionFromContextPackage *pkg = (RemoveAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cRemoveAccessibleSelectionFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++ pkg->index = i;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ sendMemoryPackage(buffer, sizeof(buffer), destABWindow);
++ }
++}
++
++void
++WinAccessBridge::selectAllAccessibleSelectionFromContext(long vmID,
++ JOBJECT64 AccessibleContext) {
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++ char buffer[sizeof(PackageType) + sizeof(SelectAllAccessibleSelectionFromContextPackage)];
++ PackageType *type = (PackageType *) buffer;
++ SelectAllAccessibleSelectionFromContextPackage *pkg = (SelectAllAccessibleSelectionFromContextPackage *) (buffer + sizeof(PackageType));
++ *type = cSelectAllAccessibleSelectionFromContextPackage;
++ pkg->vmID = vmID;
++ pkg->AccessibleContext = AccessibleContext;
++
++ // need to call only the HWND/VM that contains this AC
++ HWND destABWindow = javaVMs->findAccessBridgeWindow(vmID);
++ if (destABWindow != (HWND) 0) {
++ sendMemoryPackage(buffer, sizeof(buffer), destABWindow);
++ }
++}
++
++
++/*********** Event handling methods **********************************/
++
++/**
++ * addEventNotification - tell all Java-launched AccessBridge DLLs
++ * that we want events of the specified type
++ *
++ * [[[FIXME]]] since we're just sending a long & a source window,
++ * we could use a private message rather than WM_COPYDATA
++ * (though we still may want it to be synchronous; dunno...)
++ *
++ */
++void
++WinAccessBridge::addJavaEventNotification(jlong type) {
++ PrintDebugString("WinAccessBridge::addJavaEventNotification(%016I64X)", type);
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++
++ char buffer[sizeof(PackageType) + sizeof(AddJavaEventNotificationPackage)];
++ PackageType *pkgType = (PackageType *) buffer;
++ AddJavaEventNotificationPackage *pkg = (AddJavaEventNotificationPackage *) (buffer + sizeof(PackageType));
++ *pkgType = cAddJavaEventNotificationPackage;
++ pkg->type = type;
++ pkg->DLLwindow = ABHandleToLong(dialogWindow);
++
++ PrintDebugString(" ->pkgType = %X, eventType = %016I64X, DLLwindow = %p",
++ *pkgType, pkg->type, pkg->DLLwindow);
++
++ // send addEventNotification message to all JVMs
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *current = javaVMs;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++ current->sendPackage(buffer, sizeof(buffer)); // no return values!
++ current = current->nextJVMInstance;
++ }
++ isVMInstanceChainInUse = false;
++}
++
++/**
++ * removeEventNotification - tell all Java-launched AccessBridge DLLs
++ * that we no longer want events of the
++ * specified type
++ *
++ * [[[FIXME]]] since we're just sending a long & a source window,
++ * we could use a private message rather than WM_COPYDATA
++ * (though we still may want it to be synchronous; dunno...)
++ *
++ */
++void
++WinAccessBridge::removeJavaEventNotification(jlong type) {
++ PrintDebugString("in WinAccessBridge::removeJavaEventNotification(%016I64X)", type);
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++ char buffer[sizeof(PackageType) + sizeof(RemoveJavaEventNotificationPackage)];
++ PackageType *pkgType = (PackageType *) buffer;
++ RemoveJavaEventNotificationPackage *pkg = (RemoveJavaEventNotificationPackage *) (buffer + sizeof(PackageType));
++ *pkgType = cRemoveJavaEventNotificationPackage;
++ pkg->type = type;
++ pkg->DLLwindow = ABHandleToLong(dialogWindow);
++
++ PrintDebugString(" ->pkgType = %X, eventType = %016I64X, DLLwindow = %p",
++ *pkgType, pkg->type, pkg->DLLwindow);
++
++ // send removeEventNotification message to all JVMs
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *current = javaVMs;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++ current->sendPackage(buffer, sizeof(buffer)); // no return values!
++ current = current->nextJVMInstance;
++ }
++ isVMInstanceChainInUse = false;
++}
++
++
++/*********** Event handling methods **********************************/
++
++/**
++ * addAccessibilityEventNotification - tell all Java-launched AccessBridge DLLs
++ * that we want events of the specified type
++ *
++ * [[[FIXME]]] since we're just sending a long & a source window,
++ * we could use a private message rather than WM_COPYDATA
++ * (though we still may want it to be synchronous; dunno...)
++ *
++ */
++void
++WinAccessBridge::addAccessibilityEventNotification(jlong type) {
++ PrintDebugString("in WinAccessBridge::addAccessibilityEventNotification(%016I64X)", type);
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++ char buffer[sizeof(PackageType) + sizeof(AddAccessibilityEventNotificationPackage)];
++ PackageType *pkgType = (PackageType *) buffer;
++ AddAccessibilityEventNotificationPackage *pkg = (AddAccessibilityEventNotificationPackage *) (buffer + sizeof(PackageType));
++ *pkgType = cAddAccessibilityEventNotificationPackage;
++ pkg->type = type;
++ pkg->DLLwindow = ABHandleToLong(dialogWindow);
++
++ PrintDebugString(" ->pkgType = %X, eventType = %016I64X, DLLwindow = %X",
++ *pkgType, pkg->type, pkg->DLLwindow);
++
++ // send addEventNotification message to all JVMs
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *current = javaVMs;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++ current->sendPackage(buffer, sizeof(buffer)); // no return values!
++ current = current->nextJVMInstance;
++ }
++ isVMInstanceChainInUse = false;
++}
++
++/**
++ * removeAccessibilityEventNotification - tell all Java-launched AccessBridge DLLs
++ * that we no longer want events of the
++ * specified type
++ *
++ * [[[FIXME]]] since we're just sending a long & a source window,
++ * we could use a private message rather than WM_COPYDATA
++ * (though we still may want it to be synchronous; dunno...)
++ *
++ */
++void
++WinAccessBridge::removeAccessibilityEventNotification(jlong type) {
++ PrintDebugString("in WinAccessBridge::removeAccessibilityEventNotification(%016I64X)", type);
++ if ((AccessBridgeJavaVMInstance *) 0 == javaVMs) {
++ return;
++ }
++ char buffer[sizeof(PackageType) + sizeof(RemoveAccessibilityEventNotificationPackage)];
++ PackageType *pkgType = (PackageType *) buffer;
++ RemoveAccessibilityEventNotificationPackage *pkg = (RemoveAccessibilityEventNotificationPackage *) (buffer + sizeof(PackageType));
++ *pkgType = cRemoveAccessibilityEventNotificationPackage;
++ pkg->type = type;
++ pkg->DLLwindow = ABHandleToLong(dialogWindow);
++
++ PrintDebugString(" ->pkgType = %X, eventType = %016I64X, DLLwindow = %X",
++ *pkgType, pkg->type, pkg->DLLwindow);
++
++ // send removeEventNotification message to all JVMs
++ isVMInstanceChainInUse = true;
++ AccessBridgeJavaVMInstance *current = javaVMs;
++ while (current != (AccessBridgeJavaVMInstance *) 0) {
++ current->sendPackage(buffer, sizeof(buffer)); // no return values!
++ current = current->nextJVMInstance;
++ }
++ isVMInstanceChainInUse = false;
++}
++
++
++#define CALL_SET_EVENT_FP(function, callbackFP) \
++ void WinAccessBridge::function(callbackFP fp) { \
++ eventHandler->function(fp, this); \
++ /* eventHandler calls back to winAccessBridgeDLL to set eventMask */ \
++ }
++
++ void WinAccessBridge::setJavaShutdownFP(AccessBridge_JavaShutdownFP fp) {
++ eventHandler->setJavaShutdownFP(fp, this);
++ }
++
++ CALL_SET_EVENT_FP(setPropertyChangeFP, AccessBridge_PropertyChangeFP)
++ CALL_SET_EVENT_FP(setFocusGainedFP, AccessBridge_FocusGainedFP)
++ CALL_SET_EVENT_FP(setFocusLostFP, AccessBridge_FocusLostFP)
++ CALL_SET_EVENT_FP(setCaretUpdateFP, AccessBridge_CaretUpdateFP)
++ CALL_SET_EVENT_FP(setMouseClickedFP, AccessBridge_MouseClickedFP)
++ CALL_SET_EVENT_FP(setMouseEnteredFP, AccessBridge_MouseEnteredFP)
++ CALL_SET_EVENT_FP(setMouseExitedFP, AccessBridge_MouseExitedFP)
++ CALL_SET_EVENT_FP(setMousePressedFP, AccessBridge_MousePressedFP)
++ CALL_SET_EVENT_FP(setMouseReleasedFP, AccessBridge_MouseReleasedFP)
++ CALL_SET_EVENT_FP(setMenuCanceledFP, AccessBridge_MenuCanceledFP)
++ CALL_SET_EVENT_FP(setMenuDeselectedFP, AccessBridge_MenuDeselectedFP)
++ CALL_SET_EVENT_FP(setMenuSelectedFP, AccessBridge_MenuSelectedFP)
++ CALL_SET_EVENT_FP(setPopupMenuCanceledFP, AccessBridge_PopupMenuCanceledFP)
++ CALL_SET_EVENT_FP(setPopupMenuWillBecomeInvisibleFP, AccessBridge_PopupMenuWillBecomeInvisibleFP)
++ CALL_SET_EVENT_FP(setPopupMenuWillBecomeVisibleFP, AccessBridge_PopupMenuWillBecomeVisibleFP)
++
++ CALL_SET_EVENT_FP(setPropertyNameChangeFP, AccessBridge_PropertyNameChangeFP)
++ CALL_SET_EVENT_FP(setPropertyDescriptionChangeFP, AccessBridge_PropertyDescriptionChangeFP)
++ CALL_SET_EVENT_FP(setPropertyStateChangeFP, AccessBridge_PropertyStateChangeFP)
++ CALL_SET_EVENT_FP(setPropertyValueChangeFP, AccessBridge_PropertyValueChangeFP)
++ CALL_SET_EVENT_FP(setPropertySelectionChangeFP, AccessBridge_PropertySelectionChangeFP)
++ CALL_SET_EVENT_FP(setPropertyTextChangeFP, AccessBridge_PropertyTextChangeFP)
++ CALL_SET_EVENT_FP(setPropertyCaretChangeFP, AccessBridge_PropertyCaretChangeFP)
++ CALL_SET_EVENT_FP(setPropertyVisibleDataChangeFP, AccessBridge_PropertyVisibleDataChangeFP)
++ CALL_SET_EVENT_FP(setPropertyChildChangeFP, AccessBridge_PropertyChildChangeFP)
++ CALL_SET_EVENT_FP(setPropertyActiveDescendentChangeFP, AccessBridge_PropertyActiveDescendentChangeFP)
++
++ CALL_SET_EVENT_FP(setPropertyTableModelChangeFP, AccessBridge_PropertyTableModelChangeFP)
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/WinAccessBridge.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,317 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++/*
++ * A DLL which is loaded by Windows executables to handle communication
++ * between Java VMs purposes of Accessbility.
++ */
++
++#ifndef __WinAccessBridge_H__
++#define __WinAccessBridge_H__
++
++#include <windows.h>
++#include "AccessBridgePackages.h"
++#include "AccessBridgeEventHandler.h"
++#include "AccessBridgeJavaVMInstance.h"
++#include "AccessBridgeMessageQueue.h"
++
++
++extern "C" {
++ BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason,
++ LPVOID lpvReserved);
++ void AppendToCallOutput(char *s);
++ BOOL CALLBACK AccessBridgeDialogProc(HWND hDlg, UINT message,
++ UINT wParam, LONG lParam);
++ HWND getTopLevelHWND(HWND descendent);
++}
++
++LRESULT CALLBACK WinAccessBridgeWindowProc(HWND hWnd, UINT message,
++ UINT wParam, LONG lParam);
++
++BOOL CALLBACK DeleteItemProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam);
++
++/**
++ * The WinAccessBridge class. The core of the Windows AT AccessBridge dll
++ */
++class WinAccessBridge {
++ HINSTANCE windowsInstance;
++ HWND dialogWindow;
++ AccessBridgeJavaVMInstance *javaVMs;
++ AccessBridgeEventHandler *eventHandler;
++ AccessBridgeMessageQueue *messageQueue;
++
++public:
++ WinAccessBridge(HINSTANCE hInstance);
++ ~WinAccessBridge();
++ BOOL initWindow();
++
++ HWND showWinAccessBridgeGUI(int showCommand);
++
++ // IPC with the Java AccessBridge DLL
++ LRESULT rendezvousWithNewJavaDLL(HWND JavaBridgeDLLwindow, long vmID);
++
++ void sendPackage(char *buffer, long bufsize, HWND destWindow);
++ BOOL sendMemoryPackage(char *buffer, long bufsize, HWND destWindow);
++ BOOL queuePackage(char *buffer, long bufsize);
++ BOOL receiveAQueuedPackage();
++ void preProcessPackage(char *buffer, long bufsize);
++ void processPackage(char *buffer, long bufsize);
++ void JavaVMDestroyed(HWND VMBridgeDLLWindow);
++
++ // Java VM object memory management
++ void releaseJavaObject(long vmID, JOBJECT64 object);
++
++ // Version info
++ BOOL getVersionInfo(long vmID, AccessBridgeVersionInfo *info);
++
++ // HWND management methods
++ HWND getNextJavaWindow(HWND previous);
++ BOOL isJavaWindow(HWND window);
++ BOOL getAccessibleContextFromHWND(HWND window, long *vmID, JOBJECT64 *AccessibleContext);
++ HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accessibleContext);
++
++ /* Additional utility methods */
++ BOOL isSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2);
++
++ BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text);
++
++ AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext,
++ const wchar_t *role);
++
++ AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext);
++
++ AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext,
++ const wchar_t *role);
++
++ int getObjectDepth (const long vmID, const AccessibleContext accessibleContext);
++
++ AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext);
++
++
++ // Accessible Context methods
++ BOOL getAccessibleContextAt(long vmID, JOBJECT64 AccessibleContextParent,
++ jint x, jint y, JOBJECT64 *AccessibleContext);
++ BOOL getAccessibleContextWithFocus(HWND window, long *vmID, JOBJECT64 *AccessibleContext);
++ BOOL getAccessibleContextInfo(long vmID, JOBJECT64 AccessibleContext, AccessibleContextInfo *info);
++ JOBJECT64 getAccessibleChildFromContext(long vmID, JOBJECT64 AccessibleContext, jint childIndex);
++ JOBJECT64 getAccessibleParentFromContext(long vmID, JOBJECT64 AccessibleContext);
++
++ /* begin AccessibleTable methods */
++ BOOL getAccessibleTableInfo(long vmID, JOBJECT64 acParent, AccessibleTableInfo *tableInfo);
++ BOOL getAccessibleTableCellInfo(long vmID, JOBJECT64 accessibleTable, jint row, jint column,
++ AccessibleTableCellInfo *tableCellInfo);
++
++ BOOL getAccessibleTableRowHeader(long vmID, JOBJECT64 acParent, AccessibleTableInfo *tableInfo);
++ BOOL getAccessibleTableColumnHeader(long vmID, JOBJECT64 acParent, AccessibleTableInfo *tableInfo);
++
++ JOBJECT64 getAccessibleTableRowDescription(long vmID, JOBJECT64 acParent, jint row);
++ JOBJECT64 getAccessibleTableColumnDescription(long vmID, JOBJECT64 acParent, jint column);
++
++ jint getAccessibleTableRowSelectionCount(long vmID, JOBJECT64 accessibleTable);
++ BOOL isAccessibleTableRowSelected(long vmID, JOBJECT64 accessibleTable, jint row);
++ BOOL getAccessibleTableRowSelections(long vmID, JOBJECT64 accessibleTable, jint count,
++ jint *selections);
++
++ jint getAccessibleTableColumnSelectionCount(long vmID, JOBJECT64 accessibleTable);
++ BOOL isAccessibleTableColumnSelected(long vmID, JOBJECT64 accessibleTable, jint column);
++ BOOL getAccessibleTableColumnSelections(long vmID, JOBJECT64 accessibleTable, jint count,
++ jint *selections);
++
++ jint getAccessibleTableRow(long vmID, JOBJECT64 accessibleTable, jint index);
++ jint getAccessibleTableColumn(long vmID, JOBJECT64 accessibleTable, jint index);
++ jint getAccessibleTableIndex(long vmID, JOBJECT64 accessibleTable, jint row, jint column);
++
++ /* end AccessibleTable methods */
++
++ // --------- AccessibleRelationSet methods
++ BOOL getAccessibleRelationSet(long vmID, JOBJECT64 accessibleContext, AccessibleRelationSetInfo *relationSet);
++
++ // --------- AccessibleHypertext methods
++ BOOL getAccessibleHypertext(long vmID, JOBJECT64 accessibleContext, AccessibleHypertextInfo *hypertextInfo);
++ BOOL activateAccessibleHyperlink(long vmID, JOBJECT64 accessibleContext, JOBJECT64 accessibleHyperlink);
++
++ jint getAccessibleHyperlinkCount(const long vmID,
++ const AccessibleContext accessibleContext);
++
++ BOOL getAccessibleHypertextExt(const long vmID,
++ const AccessibleContext accessibleContext,
++ const jint nStartIndex,
++ /* OUT */ AccessibleHypertextInfo *hypertextInfo);
++
++ jint getAccessibleHypertextLinkIndex(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex);
++
++ BOOL getAccessibleHyperlink(const long vmID,
++ const AccessibleHypertext hypertext,
++ const jint nIndex,
++ /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo);
++
++
++ /* Accessible KeyBindings, Icons and Actions */
++ BOOL getAccessibleKeyBindings(long vmID, JOBJECT64 accessibleContext,
++ AccessibleKeyBindings *keyBindings);
++
++ BOOL getAccessibleIcons(long vmID, JOBJECT64 accessibleContext,
++ AccessibleIcons *icons);
++
++ BOOL getAccessibleActions(long vmID, JOBJECT64 accessibleContext,
++ AccessibleActions *actions);
++
++ BOOL doAccessibleActions(long vmID, JOBJECT64 accessibleContext,
++ AccessibleActionsToDo *actionsToDo, jint *failure);
++
++
++ // Accessible Text methods
++ BOOL getAccessibleTextInfo(long vmID, JOBJECT64 AccessibleContext, AccessibleTextInfo *textInfo, jint x, jint y);
++ BOOL getAccessibleTextItems(long vmID, JOBJECT64 AccessibleContext, AccessibleTextItemsInfo *textItems, jint index);
++ BOOL getAccessibleTextSelectionInfo(long vmID, JOBJECT64 AccessibleContext, AccessibleTextSelectionInfo *selectionInfo);
++ BOOL getAccessibleTextAttributes(long vmID, JOBJECT64 AccessibleContext, jint index, AccessibleTextAttributesInfo *attributes);
++ BOOL getAccessibleTextRect(long vmID, JOBJECT64 AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);
++ BOOL getAccessibleTextLineBounds(long vmID, JOBJECT64 AccessibleContext, jint index, jint *startIndex, jint *endIndex);
++ BOOL getAccessibleTextRange(long vmID, JOBJECT64 AccessibleContext, jint start, jint end, wchar_t *text, short len);
++
++ // Accessible Value methods
++ BOOL getCurrentAccessibleValueFromContext(long vmID, JOBJECT64 AccessibleContext, wchar_t *value, short len);
++ BOOL getMaximumAccessibleValueFromContext(long vmID, JOBJECT64 AccessibleContext, wchar_t *value, short len);
++ BOOL getMinimumAccessibleValueFromContext(long vmID, JOBJECT64 AccessibleContext, wchar_t *value, short len);
++
++ // Accessible Selection methods
++ void addAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext, int i);
++ void clearAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext);
++ JOBJECT64 getAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext, int i);
++ int getAccessibleSelectionCountFromContext(long vmID, JOBJECT64 AccessibleContext);
++ BOOL isAccessibleChildSelectedFromContext(long vmID, JOBJECT64 AccessibleContext, int i);
++ void removeAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext, int i);
++ void selectAllAccessibleSelectionFromContext(long vmID, JOBJECT64 AccessibleContext);
++
++ // Event handling methods
++ void addJavaEventNotification(jlong type);
++ void removeJavaEventNotification(jlong type);
++ void addAccessibilityEventNotification(jlong type);
++ void removeAccessibilityEventNotification(jlong type);
++
++ void setPropertyChangeFP(AccessBridge_PropertyChangeFP fp);
++ void setJavaShutdownFP(AccessBridge_JavaShutdownFP fp);
++ void setFocusGainedFP(AccessBridge_FocusGainedFP fp);
++ void setFocusLostFP(AccessBridge_FocusLostFP fp);
++ void setCaretUpdateFP(AccessBridge_CaretUpdateFP fp);
++ void setMouseClickedFP(AccessBridge_MouseClickedFP fp);
++ void setMouseEnteredFP(AccessBridge_MouseEnteredFP fp);
++ void setMouseExitedFP(AccessBridge_MouseExitedFP fp);
++ void setMousePressedFP(AccessBridge_MousePressedFP fp);
++ void setMouseReleasedFP(AccessBridge_MouseReleasedFP fp);
++ void setMenuCanceledFP(AccessBridge_MenuCanceledFP fp);
++ void setMenuDeselectedFP(AccessBridge_MenuDeselectedFP fp);
++ void setMenuSelectedFP(AccessBridge_MenuSelectedFP fp);
++ void setPopupMenuCanceledFP(AccessBridge_PopupMenuCanceledFP fp);
++ void setPopupMenuWillBecomeInvisibleFP(AccessBridge_PopupMenuWillBecomeInvisibleFP fp);
++ void setPopupMenuWillBecomeVisibleFP(AccessBridge_PopupMenuWillBecomeVisibleFP fp);
++
++ void setPropertyNameChangeFP(AccessBridge_PropertyNameChangeFP fp);
++ void setPropertyDescriptionChangeFP(AccessBridge_PropertyDescriptionChangeFP fp);
++ void setPropertyStateChangeFP(AccessBridge_PropertyStateChangeFP fp);
++ void setPropertyValueChangeFP(AccessBridge_PropertyValueChangeFP fp);
++ void setPropertySelectionChangeFP(AccessBridge_PropertySelectionChangeFP fp);
++ void setPropertyTextChangeFP(AccessBridge_PropertyTextChangeFP fp);
++ void setPropertyCaretChangeFP(AccessBridge_PropertyCaretChangeFP fp);
++ void setPropertyVisibleDataChangeFP(AccessBridge_PropertyVisibleDataChangeFP fp);
++ void setPropertyChildChangeFP(AccessBridge_PropertyChildChangeFP fp);
++ void setPropertyActiveDescendentChangeFP(AccessBridge_PropertyActiveDescendentChangeFP fp);
++
++ void setPropertyTableModelChangeFP(AccessBridge_PropertyTableModelChangeFP fp);
++
++ /**
++ * Additional methods for Teton
++ */
++
++ /**
++ * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns
++ * whether successful.
++ *
++ * Bug ID 4916682 - Implement JAWS AccessibleName policy
++ */
++ BOOL getVirtualAccessibleName(long vmID, AccessibleContext accessibleContext, wchar_t *name, int len);
++
++ /**
++ * Request focus for a component. Returns whether successful;
++ *
++ * Bug ID 4944757 - requestFocus method needed
++ */
++ BOOL requestFocus(long vmID, AccessibleContext accessibleContext);
++
++ /**
++ * Selects text between two indices. Selection includes the text at the start index
++ * and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944758 - selectTextRange method needed
++ */
++ BOOL selectTextRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex);
++
++ /**
++ * Get text attributes between two indices. The attribute list includes the text at the
++ * start index and the text at the end index. Returns whether successful;
++ *
++ * Bug ID 4944761 - getTextAttributes between two indices method needed
++ */
++ BOOL getTextAttributesInRange(long vmID, AccessibleContext accessibleContext, int startIndex, int endIndex,
++ AccessibleTextAttributesInfo *attributes, short *len);
++
++ /**
++ * Gets number of visible children of a component. Returns -1 on error.
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ int getVisibleChildrenCount(long vmID, AccessibleContext accessibleContext);
++
++ /**
++ * Gets the visible children of an AccessibleContext. Returns whether successful;
++ *
++ * Bug ID 4944762- getVisibleChildren for list-like components needed
++ */
++ BOOL getVisibleChildren(long vmID, AccessibleContext accessibleContext, int startIndex,
++ VisibleChildrenInfo *visibleChildrenInfo);
++
++ /**
++ * Set the caret to a text position. Returns whether successful;
++ *
++ * Bug ID 4944770 - setCaretPosition method needed
++ */
++ BOOL setCaretPosition(long vmID, AccessibleContext accessibleContext, int position);
++
++
++ /**
++ * Gets the text caret bounding rectangle
++ */
++ BOOL getCaretLocation(long vmID, JOBJECT64 AccessibleContext, AccessibleTextRectInfo *rectInfo, jint index);
++
++ /**
++ * Gets number of events waiting in the message queue
++ */
++ int getEventsWaiting();
++
++};
++
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/accessBridgeResource.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,47 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++#define cVMID 1001
++#define cWindowsID 1002
++#define cStatusText 1003
++#define cCallInfo 1004
++#define cInvokedByText 1005
++#define IDC_STATIC -1
++
++#define cInstallAccessBridge 2001
++#define cRemindThereIsNewJVM 2005
++#define cDoNotRemindThereIsNewJVM 2005
++
++// Next default values for new objects
++//
++#ifdef APSTUDIO_INVOKED
++#ifndef APSTUDIO_READONLY_SYMBOLS
++#define _APS_NO_MFC 1
++#define _APS_NEXT_RESOURCE_VALUE 102
++#define _APS_NEXT_COMMAND_VALUE 40001
++#define _APS_NEXT_CONTROL_VALUE 1032
++#define _APS_NEXT_SYMED_VALUE 101
++#endif
++#endif
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/accessibility.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,6 @@
++#
++# Load the Java Access Bridge class into the JVM
++#
++#assistive_technologies=com.sun.java.accessibility.AccessBridge
++#screen_magnifier_present=true
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/jabswitch.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,475 @@
++/*
++ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <ctype.h>
++#include <Windows.h>
++#include <tchar.h>
++
++// This is the default buffer size used for RegQueryValue values.
++#define DEFAULT_ALLOC MAX_PATH
++// only allocate a buffer as big as MAX_ALLOC for RegQueryValue values.
++#define MAX_ALLOC 262144
++
++static LPCTSTR ACCESSIBILITY_USER_KEY =
++ _T("Software\\Microsoft\\Windows NT\\CurrentVersion\\Accessibility");
++static LPCTSTR ACCESSIBILITY_SYSTEM_KEY =
++ _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Accessibility\\Session");
++static LPCTSTR ACCESSIBILITY_CONFIG =
++ _T("Configuration");
++static LPCTSTR STR_ACCESSBRIDGE =
++ _T("oracle_javaaccessbridge");
++
++// Note: There are senarios where more than one extension can be specified on the
++// asssistive_technologies=
++// line but this code only deals with the case of
++// assistive_technologies=com.sun.java.accessibility.AccessBridge
++// assuming that if additional extensions are desired the user knows how edit the file.
++
++FILE* origFile;
++FILE* tempFile;
++
++bool isXP()
++{
++ static bool isXPFlag = false;
++ OSVERSIONINFO osvi;
++
++ // Initialize the OSVERSIONINFO structure.
++ ZeroMemory( &osvi, sizeof( osvi ) );
++ osvi.dwOSVersionInfoSize = sizeof( osvi );
++
++ GetVersionEx( &osvi );
++
++ if ( osvi.dwMajorVersion == 5 ) // For Windows XP and Windows 2000
++ isXPFlag = true;
++
++ return isXPFlag ;
++}
++
++void enableJAB() {
++ // Copy lines from orig to temp modifying the line containing
++ // assistive_technologies=
++ // There are various scenarios:
++ // 1) If the line exists exactly as
++ // #assistive_technologies=com.sun.java.accessibility.AccessBridge
++ // replace it with
++ // assistive_technologies=com.sun.java.accessibility.AccessBridge
++ // 2) else if the line exists exactly as
++ // assistive_technologies=com.sun.java.accessibility.AccessBridge
++ // use it as is
++ // 3) else if a line containing "assistive_technologies" exits
++ // a) if it's already commented out, us it as is (jab will be enabled in step 4)
++ // b) else if it's not commented out, comment it out and add a new line with
++ // assistive_technologies=com.sun.java.accessibility.AccessBridge
++ // 4) If the line doesn't exist (or case 3a), add
++ // assistive_technologies=com.sun.java.accessibility.AccessBridge
++ // Do the same for screen_magnifier_present=
++ char line[512];
++ char commentLine[512] = "#";
++ char jabLine[] = "assistive_technologies=com.sun.java.accessibility.AccessBridge\n";
++ char magLine[] = "screen_magnifier_present=true\n";
++ bool foundJabLine = false;
++ bool foundMagLine = false;
++ while (!feof(origFile)) {
++ if (fgets(line, 512, origFile) != NULL) {
++ if (_stricmp(line, "#assistive_technologies=com.sun.java.accessibility.AccessBridge\n") == 0) {
++ fputs(jabLine, tempFile);
++ foundJabLine = true;
++ } else if (_stricmp(line, jabLine) == 0) {
++ fputs(line, tempFile);
++ foundJabLine = true;
++ } else if (strstr(line, "assistive_technologies") != NULL) {
++ char* context;
++ char* firstNonSpaceChar = strtok_s(line, " ", &context);
++ if (*firstNonSpaceChar == '#') {
++ fputs(line, tempFile);
++ } else {
++ strcat_s(commentLine, line);
++ fputs(commentLine, tempFile);
++ fputs(jabLine, tempFile);
++ foundJabLine = true;
++ }
++ } else if (_stricmp(line, "#screen_magnifier_present=true\n") == 0) {
++ fputs(magLine, tempFile);
++ foundMagLine = true;
++ } else if (_stricmp(line, magLine) == 0) {
++ fputs(line, tempFile);
++ foundMagLine = true;
++ } else if (strstr(line, "screen_magnifier_present") != NULL) {
++ char* context;
++ char* firstNonSpaceChar = strtok_s(line, " ", &context);
++ if (*firstNonSpaceChar == '#') {
++ fputs(line, tempFile);
++ } else {
++ strcat_s(commentLine, line);
++ fputs(commentLine, tempFile);
++ fputs(magLine, tempFile);
++ foundMagLine = true;
++ }
++ } else {
++ fputs(line, tempFile);
++ }
++ }
++ }
++ if (!foundJabLine) {
++ fputs(jabLine, tempFile);
++ }
++ if (!foundMagLine) {
++ fputs(magLine, tempFile);
++ }
++}
++
++void disableJAB() {
++ // Copy lines from orig to temp modifying the line containing
++ // assistive_technologies=
++ // There are various scenarios:
++ // 1) If the uncommented line exists, comment it out
++ // 2) If the line exists but is preceeded by a #, nothing to do
++ // 3) If the line doesn't exist, nothing to do
++ // Do the same for screen_magnifier_present=
++ char line[512];
++ char commentLine[512];
++ while (!feof(origFile)) {
++ if (fgets(line, 512, origFile) != NULL) {
++ if (strstr(line, "assistive_technologies") != NULL) {
++ char* context;
++ char* firstNonSpaceChar = strtok_s(line, " ", &context);
++ if (*firstNonSpaceChar != '#') {
++ strcpy_s(commentLine, "#");
++ strcat_s(commentLine, line);
++ fputs(commentLine, tempFile);
++ } else {
++ fputs(line, tempFile);
++ }
++ } else if (strstr(line, "screen_magnifier_present") != NULL) {
++ char* context;
++ char* firstNonSpaceChar = strtok_s(line, " ", &context);
++ if (*firstNonSpaceChar != '#') {
++ strcpy_s(commentLine, "#");
++ strcat_s(commentLine, line);
++ fputs(commentLine, tempFile);
++ } else {
++ fputs(line, tempFile);
++ }
++ } else {
++ fputs(line, tempFile);
++ }
++ }
++ }
++}
++
++int modify(bool enable) {
++ errno_t error = 0;
++ char path[512];
++ char tempPath[512];
++ // Get the path for %USERPROFILE%
++ char *profilePath;
++ size_t len;
++ error = _dupenv_s(&profilePath, &len, "USERPROFILE" );
++ if (error) {
++ printf("Error fetching USERPROFILE.\n");
++ perror("Error");
++ return error;
++ }
++ strcpy_s(path, profilePath);
++ strcat_s(path, "\\.accessibility.properties");
++ strcpy_s(tempPath, profilePath);
++ strcat_s(tempPath, "\\.acce$$ibility.properties");
++ free(profilePath);
++ // Open the original file. If it doesn't exist and this is an enable request then create it.
++ error = fopen_s(&origFile, path, "r");
++ if (error) {
++ if (enable) {
++ error = fopen_s(&origFile, path, "w");
++ if (error) {
++ printf("Couldn't create file: %s\n", path);
++ perror("Error");
++ } else {
++ char str[100] = "assistive_technologies=com.sun.java.accessibility.AccessBridge\n";
++ strcat_s(str, "screen_magnifier_present=true\n");
++ fprintf(origFile, str);
++ fclose(origFile);
++ }
++ } else {
++ // It's OK if the file isn't there for a -disable
++ error = 0;
++ }
++ } else {
++ // open a temp file
++ error = fopen_s(&tempFile, tempPath, "w");
++ if (error) {
++ printf("Couldn't open temp file: %s\n", tempPath);
++ perror("Error");
++ return error;
++ }
++ if (enable) {
++ enableJAB();
++ } else {
++ disableJAB();
++ }
++ fclose(origFile);
++ fclose(tempFile);
++ // delete the orig file and rename the temp file
++ if (remove(path) != 0) {
++ printf("Couldn't remove file: %s\n", path);
++ perror("Error");
++ return errno;
++ }
++ if (rename(tempPath, path) != 0) {
++ printf("Couldn't rename %s to %s.\n", tempPath, path);
++ perror("Error");
++ return errno;
++ }
++ }
++ return error;
++}
++
++void printUsage() {
++ printf("\njabswitch [/enable | /disable | /version | /?]\n\n");
++ printf("Description:\n");
++ printf(" jabswitch enables or disables the Java Access Bridge.\n\n");
++ printf("Parameters:\n");
++ printf(" /enable Enable the Java Accessibility Bridge.\n");
++ printf(" /disable Disable the Java Accessibility Bridge.\n");
++ printf(" /version Display the version.\n");
++ printf(" /? Display this usage information.\n");
++ printf("\nNote:\n");
++ printf(" The Java Access Bridge can also be enabled with the\n");
++ printf(" Windows Ease of Access control panel (which can be\n");
++ printf(" activated by pressing Windows + U). The Ease of Access\n");
++ printf(" control panel has a Java Access Bridge checkbox. Please\n");
++ printf(" be aware that unchecking the checkbox has no effect and\n");
++ printf(" in order to disable the Java Access Bridge you must run\n");
++ printf(" jabswitch.exe from the command line.\n");
++}
++
++void printVersion() {
++ TCHAR executableFileName[_MAX_PATH];
++ if (!GetModuleFileName(0, executableFileName, _MAX_PATH)) {
++ printf("Unable to get executable file name.\n");
++ return;
++ }
++ DWORD nParam;
++ DWORD nVersionSize = GetFileVersionInfoSize(executableFileName, &nParam);
++ if (!nVersionSize) {
++ printf("Unable to get version info size.\n");
++ return;
++ }
++ char* pVersionData = new char[nVersionSize];
++ if (!GetFileVersionInfo(executableFileName, 0, nVersionSize, pVersionData)) {
++ printf("Unable to get version info.\n");
++ return;
++ }
++ LPVOID pVersionInfo;
++ UINT nSize;
++ if (!VerQueryValue(pVersionData, _T("\\"), &pVersionInfo, &nSize)) {
++ printf("Unable to query version value.\n");
++ return;
++ }
++ VS_FIXEDFILEINFO *pVSInfo = (VS_FIXEDFILEINFO *)pVersionInfo;
++ char versionString[100];
++ sprintf_s( versionString, "version %i.%i.%i.%i",
++ pVSInfo->dwProductVersionMS >> 16,
++ pVSInfo->dwProductVersionMS & 0xFFFF,
++ pVSInfo->dwProductVersionLS >> 16,
++ pVSInfo->dwProductVersionLS & 0xFFFF );
++ char outputString[100];
++ strcpy_s(outputString, "jabswitch ");
++ strcat_s(outputString, versionString);
++ strcat_s(outputString, "\njabswitch enables or disables the Java Access Bridge.\n");
++ printf(outputString);
++}
++
++int regEnable() {
++ HKEY hKey;
++ DWORD retval = -1;
++ LSTATUS err;
++ err = RegOpenKeyEx(HKEY_CURRENT_USER, ACCESSIBILITY_USER_KEY, NULL, KEY_READ|KEY_WRITE, &hKey);
++ if (err == ERROR_SUCCESS) {
++ DWORD dataType = REG_SZ;
++ DWORD dataLength = DEFAULT_ALLOC;
++ TCHAR dataBuffer[DEFAULT_ALLOC];
++ TCHAR *data = dataBuffer;
++ bool freeData = false;
++ err = RegQueryValueEx(hKey, ACCESSIBILITY_CONFIG, 0, &dataType, (BYTE *)data, &dataLength);
++ if (err == ERROR_MORE_DATA) {
++ if (dataLength > 0 && dataLength < MAX_ALLOC) {
++ data = new TCHAR[dataLength];
++ err = RegQueryValueEx(hKey, ACCESSIBILITY_CONFIG, 0, &dataType, (BYTE *)data, &dataLength);
++ }
++ }
++ if (err == ERROR_SUCCESS) {
++ err = _tcslwr_s(dataBuffer, DEFAULT_ALLOC);
++ if (err) {
++ return -1;
++ }
++ if (_tcsstr(dataBuffer, STR_ACCESSBRIDGE) != NULL) {
++ return 0; // This is OK, e.g. ran enable twice and the value is there.
++ } else {
++ // add oracle_javaaccessbridge to Config key for HKCU
++ dataLength = dataLength + (_tcslen(STR_ACCESSBRIDGE) + 1) * sizeof(TCHAR);
++ TCHAR *newStr = new TCHAR[dataLength];
++ if (newStr != NULL) {
++ wsprintf(newStr, L"%s,%s", dataBuffer, STR_ACCESSBRIDGE);
++ RegSetValueEx(hKey, ACCESSIBILITY_CONFIG, 0, REG_SZ, (BYTE *)newStr, dataLength);
++ }
++ }
++ }
++ RegCloseKey(hKey);
++ }
++ return err;
++}
++
++int regDeleteValue(HKEY hFamilyKey, LPCWSTR lpSubKey)
++{
++ HKEY hKey;
++ DWORD retval = -1;
++ LSTATUS err;
++ err = RegOpenKeyEx(hFamilyKey, lpSubKey, NULL, KEY_READ|KEY_WRITE|KEY_WOW64_64KEY, &hKey);
++ if (err != ERROR_SUCCESS)
++ err = RegOpenKeyEx(hFamilyKey, lpSubKey, NULL, KEY_READ|KEY_WRITE, &hKey);
++
++ if (err == ERROR_SUCCESS) {
++ DWORD dataType = REG_SZ;
++ DWORD dataLength = DEFAULT_ALLOC;
++ TCHAR dataBuffer[DEFAULT_ALLOC];
++ TCHAR searchBuffer[DEFAULT_ALLOC];
++ TCHAR *data = dataBuffer;
++ bool freeData = false;
++ err = RegQueryValueEx(hKey, ACCESSIBILITY_CONFIG, 0, &dataType, (BYTE *)data, &dataLength);
++ if (err == ERROR_MORE_DATA) {
++ if (dataLength > 0 && dataLength < MAX_ALLOC) {
++ data = new TCHAR[dataLength];
++ err = RegQueryValueEx(hKey, ACCESSIBILITY_CONFIG, 0, &dataType, (BYTE *)data, &dataLength);
++ }
++ }
++ if (err == ERROR_SUCCESS) {
++ err = _tcslwr_s(dataBuffer, DEFAULT_ALLOC);
++ if (err) {
++ return -1;
++ }
++ if (_tcsstr(dataBuffer, STR_ACCESSBRIDGE) == NULL) {
++ return 0; // This is OK, e.g. ran disable twice and the value is not there.
++ } else {
++ // remove oracle_javaaccessbridge from Config key
++ TCHAR *newStr = new TCHAR[dataLength];
++ TCHAR *nextToken;
++ LPTSTR tok, beg1 = dataBuffer;
++ bool first = true;
++ _tcscpy_s(newStr, dataLength, L"");
++ tok = _tcstok_s(beg1, L",", &nextToken);
++ while (tok != NULL) {
++ _tcscpy_s(searchBuffer, DEFAULT_ALLOC, tok);
++ err = _tcslwr_s(searchBuffer, DEFAULT_ALLOC);
++ if (err) {
++ return -1;
++ }
++ if (_tcsstr(searchBuffer, STR_ACCESSBRIDGE) == NULL) {
++ if (!first) {
++ _tcscat_s(newStr, dataLength, L",");
++ }
++ first = false;
++ _tcscat_s(newStr, dataLength, tok);
++ }
++ tok = _tcstok_s(NULL, L",", &nextToken);
++ }
++ dataLength = (_tcslen(newStr) + 1) * sizeof(TCHAR);
++ RegSetValueEx(hKey, ACCESSIBILITY_CONFIG, 0, REG_SZ, (BYTE *)newStr, dataLength);
++ }
++ }
++ RegCloseKey(hKey);
++ }
++ return err;
++}
++
++int regDisable()
++{
++ LSTATUS err;
++ // Update value for HKCU
++ err=regDeleteValue(HKEY_CURRENT_USER, ACCESSIBILITY_USER_KEY);
++ // Update value for HKLM for Session
++ TCHAR dataBuffer[DEFAULT_ALLOC];
++ DWORD dwSessionId ;
++ ProcessIdToSessionId(GetCurrentProcessId(),&dwSessionId ) ;
++ if( dwSessionId >= 0 )
++ {
++ wsprintf(dataBuffer, L"%s%d", ACCESSIBILITY_SYSTEM_KEY, dwSessionId);
++ err=regDeleteValue(HKEY_LOCAL_MACHINE, dataBuffer);
++ }
++ return err;
++}
++
++void main(int argc, char* argv[]) {
++ bool enableWasRequested = false;
++ bool disableWasRequested = false;
++ bool badParams = true;
++ int error = 0;
++ if (argc == 2) {
++ if (_stricmp(argv[1], "-?") == 0 || _stricmp(argv[1], "/?") == 0) {
++ printUsage();
++ badParams = false;
++ } else if (_stricmp(argv[1], "-version") == 0 || _stricmp(argv[1], "/version") == 0) {
++ printVersion();
++ badParams = false;
++ } else {
++ if (_stricmp(argv[1], "-enable") == 0 || _stricmp(argv[1], "/enable") == 0) {
++ badParams = false;
++ enableWasRequested = true;
++ error = modify(true);
++ if (error == 0) {
++ if( !isXP() )
++ regEnable();
++ }
++ } else if (_stricmp(argv[1], "-disable") == 0 || _stricmp(argv[1], "/disable") == 0) {
++ badParams = false;
++ disableWasRequested = true;
++ error = modify(false);
++ if (error == 0) {
++ if( !isXP() )
++ regDisable();
++ }
++ }
++ }
++ }
++ if (badParams) {
++ printUsage();
++ } else if (enableWasRequested || disableWasRequested) {
++ if (error != 0) {
++ printf("There was an error.\n\n");
++ }
++ printf("The Java Access Bridge has ");
++ if (error != 0) {
++ printf("not ");
++ }
++ printf("been ");
++ if (enableWasRequested) {
++ printf("enabled.\n");
++ } else {
++ printf("disabled.\n");
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/jabswitch.manifest Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,10 @@
++<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
++<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
++ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
++ <security>
++ <requestedPrivileges>
++ <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
++ </requestedPrivileges>
++ </security>
++ </trustInfo>
++</assembly>
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/jabswitch_manifest.rc Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,4 @@
++#define XSTR(x) STR(x)
++#define STR(x) #x
++
++1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ XSTR(JAB_MANIFEST_EMBED)
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/src/windows/native/sun/bridge/resource.h Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,42 @@
++/*
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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.
++ */
++
++//{{NO_DEPENDENCIES}}
++// Microsoft Developer Studio generated include file.
++// Used by AccessBridgeStatusWindow.RC
++//
++//#define IDB_BITMAP1 102
++
++// Next default values for new objects
++//
++#ifdef APSTUDIO_INVOKED
++#ifndef APSTUDIO_READONLY_SYMBOLS
++#define _APS_NO_MFC 1
++#define _APS_NEXT_RESOURCE_VALUE 103
++#define _APS_NEXT_COMMAND_VALUE 40001
++#define _APS_NEXT_CONTROL_VALUE 1032
++#define _APS_NEXT_SYMED_VALUE 101
++#endif
++#endif
+--- ./jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -828,7 +828,7 @@
+ return 0;
+ }
+
+- HWND hWnd = CreateWindow(L"D3DFocusWindow", L"D3DFocusWindow", 0,
++ HWND hWnd = CreateWindow(L"D3DFocusWindow", L"D3DFocusWindow", WS_POPUP,
+ mi.rcMonitor.left, mi.rcMonitor.top, 1, 1,
+ NULL, NULL, GetModuleHandle(NULL), NULL);
+ if (hWnd == 0) {
+--- ./jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c Wed Jul 01 21:53:30 2015 -0700
+@@ -169,6 +169,11 @@
+ */
+ s = strtok(override, "; ");
+ urlhost = (*env)->GetStringUTFChars(env, host, &isCopy);
++ if (urlhost == NULL) {
++ if (!(*env)->ExceptionCheck(env))
++ JNU_ThrowOutOfMemoryError(env, NULL);
++ return NULL;
++ }
+ while (s != NULL) {
+ if (strncmp(s, urlhost, strlen(s)) == 0) {
+ /**
+@@ -186,8 +191,11 @@
+ }
+
+ cproto = (*env)->GetStringUTFChars(env, proto, &isCopy);
+- if (cproto == NULL)
+- goto noproxy;
++ if (cproto == NULL) {
++ if (!(*env)->ExceptionCheck(env))
++ JNU_ThrowOutOfMemoryError(env, NULL);
++ return NULL;
++ }
+
+ /*
+ * Set default port value & proxy type from protocol.
+@@ -245,7 +253,9 @@
+ if (pport == 0)
+ pport = defport;
+ jhost = (*env)->NewStringUTF(env, phost);
++ CHECK_NULL_RETURN(jhost, NULL);
+ isa = (*env)->CallStaticObjectMethod(env, isaddr_class, isaddr_createUnresolvedID, jhost, pport);
++ CHECK_NULL_RETURN(isa, NULL);
+ proxy = (*env)->NewObject(env, proxy_class, proxy_ctrID, type_proxy, isa);
+ return proxy;
+ }
+--- ./jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -45,18 +45,28 @@
+ Java_sun_nio_ch_DatagramChannelImpl_initIDs(JNIEnv *env, jclass clazz)
+ {
+ clazz = (*env)->FindClass(env, "java/net/InetSocketAddress");
++ CHECK_NULL(clazz);
+ isa_class = (*env)->NewGlobalRef(env, clazz);
++ if (isa_class == NULL) {
++ JNU_ThrowOutOfMemoryError(env, NULL);
++ return;
++ }
+ isa_ctorID = (*env)->GetMethodID(env, clazz, "<init>",
+ "(Ljava/net/InetAddress;I)V");
++ CHECK_NULL(isa_ctorID);
+
+ clazz = (*env)->FindClass(env, "sun/nio/ch/DatagramChannelImpl");
++ CHECK_NULL(clazz);
+ dci_senderID = (*env)->GetFieldID(env, clazz, "sender",
+ "Ljava/net/SocketAddress;");
++ CHECK_NULL(dci_senderID);
+ dci_senderAddrID = (*env)->GetFieldID(env, clazz,
+ "cachedSenderInetAddress",
+ "Ljava/net/InetAddress;");
++ CHECK_NULL(dci_senderAddrID);
+ dci_senderPortID = (*env)->GetFieldID(env, clazz,
+ "cachedSenderPort", "I");
++ CHECK_NULL(dci_senderPortID);
+ }
+
+ /*
+@@ -185,17 +195,11 @@
+ if (senderAddr == NULL) {
+ jobject isa = NULL;
+ int port;
+- jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa,
+- &port);
+-
++ jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
+ if (ia != NULL) {
+ isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
+ }
+-
+- if (isa == NULL) {
+- JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
+- return IOS_THROWN;
+- }
++ CHECK_NULL_RETURN(isa, IOS_THROWN);
+
+ // update cachedSenderInetAddress/cachedSenderPort
+ (*env)->SetObjectField(env, this, dci_senderAddrID, ia);
+--- ./jdk/src/windows/native/sun/nio/ch/FileChannelImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/ch/FileChannelImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -31,6 +31,10 @@
+ #include "nio.h"
+ #include "nio_util.h"
+ #include "sun_nio_ch_FileChannelImpl.h"
++#include "java_lang_Integer.h"
++
++#include <Mswsock.h>
++#pragma comment(lib, "Mswsock.lib")
+
+ static jfieldID chan_fd; /* id for jobject 'fd' in java.io.FileChannel */
+
+@@ -174,9 +178,42 @@
+
+ JNIEXPORT jlong JNICALL
+ Java_sun_nio_ch_FileChannelImpl_transferTo0(JNIEnv *env, jobject this,
+- jint srcFD,
++ jobject srcFD,
+ jlong position, jlong count,
+- jint dstFD)
++ jobject dstFD)
+ {
+- return IOS_UNSUPPORTED;
++ const int PACKET_SIZE = 524288;
++
++ HANDLE src = (HANDLE)(handleval(env, srcFD));
++ SOCKET dst = (SOCKET)(fdval(env, dstFD));
++ DWORD chunkSize = (count > java_lang_Integer_MAX_VALUE) ?
++ java_lang_Integer_MAX_VALUE : (DWORD)count;
++ BOOL result = 0;
++
++ jlong pos = Java_sun_nio_ch_FileChannelImpl_position0(env, this, srcFD, position);
++ if (pos == IOS_THROWN) {
++ return IOS_THROWN;
++ }
++
++ result = TransmitFile(
++ dst,
++ src,
++ chunkSize,
++ PACKET_SIZE,
++ NULL,
++ NULL,
++ TF_USE_KERNEL_APC
++ );
++ if (!result) {
++ int error = WSAGetLastError();
++ if (WSAEINVAL == error && count >= 0) {
++ return IOS_UNSUPPORTED_CASE;
++ }
++ if (WSAENOTSOCK == error) {
++ return IOS_UNSUPPORTED_CASE;
++ }
++ JNU_ThrowIOExceptionWithLastError(env, "transfer failed");
++ return IOS_THROWN;
++ }
++ return chunkSize;
+ }
+--- ./jdk/src/windows/native/sun/nio/ch/FileKey.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/ch/FileKey.c Wed Jul 01 21:53:30 2015 -0700
+@@ -38,9 +38,9 @@
+ JNIEXPORT void JNICALL
+ Java_sun_nio_ch_FileKey_initIDs(JNIEnv *env, jclass clazz)
+ {
+- key_volumeSN = (*env)->GetFieldID(env, clazz, "dwVolumeSerialNumber", "J");
+- key_indexHigh = (*env)->GetFieldID(env, clazz, "nFileIndexHigh", "J");
+- key_indexLow = (*env)->GetFieldID(env, clazz, "nFileIndexLow", "J");
++ CHECK_NULL(key_volumeSN = (*env)->GetFieldID(env, clazz, "dwVolumeSerialNumber", "J"));
++ CHECK_NULL(key_indexHigh = (*env)->GetFieldID(env, clazz, "nFileIndexHigh", "J"));
++ CHECK_NULL(key_indexLow = (*env)->GetFieldID(env, clazz, "nFileIndexLow", "J"));
+ }
+
+
+--- ./jdk/src/windows/native/sun/nio/ch/IOUtil.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/ch/IOUtil.c Wed Jul 01 21:53:30 2015 -0700
+@@ -52,9 +52,9 @@
+ JNIEXPORT void JNICALL
+ Java_sun_nio_ch_IOUtil_initIDs(JNIEnv *env, jclass clazz)
+ {
+- clazz = (*env)->FindClass(env, "java/io/FileDescriptor");
+- fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I");
+- handle_fdID = (*env)->GetFieldID(env, clazz, "handle", "J");
++ CHECK_NULL(clazz = (*env)->FindClass(env, "java/io/FileDescriptor"));
++ CHECK_NULL(fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I"));
++ CHECK_NULL(handle_fdID = (*env)->GetFieldID(env, clazz, "handle", "J"));
+ }
+
+ /**************************************************************
+--- ./jdk/src/windows/native/sun/nio/ch/Iocp.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/ch/Iocp.c Wed Jul 01 21:53:30 2015 -0700
+@@ -46,16 +46,15 @@
+ jclass clazz;
+
+ clazz = (*env)->FindClass(env, "sun/nio/ch/Iocp$CompletionStatus");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ completionStatus_error = (*env)->GetFieldID(env, clazz, "error", "I");
+- if (completionStatus_error == NULL) return;
++ CHECK_NULL(completionStatus_error);
+ completionStatus_bytesTransferred = (*env)->GetFieldID(env, clazz, "bytesTransferred", "I");
+- if (completionStatus_bytesTransferred == NULL) return;
++ CHECK_NULL(completionStatus_bytesTransferred);
+ completionStatus_completionKey = (*env)->GetFieldID(env, clazz, "completionKey", "I");
+- if (completionStatus_completionKey == NULL) return;
++ CHECK_NULL(completionStatus_completionKey);
+ completionStatus_overlapped = (*env)->GetFieldID(env, clazz, "overlapped", "J");
++ CHECK_NULL(completionStatus_overlapped);
+ }
+
+ JNIEXPORT jint JNICALL
+--- ./jdk/src/windows/native/sun/nio/ch/Net.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/ch/Net.c Wed Jul 01 21:53:30 2015 -0700
+@@ -127,7 +127,7 @@
+
+ JNIEXPORT jint JNICALL
+ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6,
+- jboolean stream, jboolean reuse)
++ jboolean stream, jboolean reuse, jboolean fastLoopback)
+ {
+ SOCKET s;
+ int domain = (preferIPv6) ? AF_INET6 : AF_INET;
+@@ -152,6 +152,20 @@
+ NET_ThrowNew(env, WSAGetLastError(), "socket");
+ }
+
++ if (stream && fastLoopback) {
++ static int loopback_available = 1;
++ if (loopback_available) {
++ int rv = NET_EnableFastTcpLoopback((jint)s);
++ if (rv) {
++ if (rv == WSAEOPNOTSUPP) {
++ loopback_available = 0;
++ } else {
++ NET_ThrowNew(env, rv, "fastLoopback");
++ }
++ }
++ }
++ }
++
+ return (jint)s;
+ }
+
+--- ./jdk/src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -56,12 +56,20 @@
+ Java_sun_nio_ch_ServerSocketChannelImpl_initIDs(JNIEnv *env, jclass cls)
+ {
+ cls = (*env)->FindClass(env, "java/io/FileDescriptor");
++ CHECK_NULL(cls);
+ fd_fdID = (*env)->GetFieldID(env, cls, "fd", "I");
++ CHECK_NULL(fd_fdID);
+
+ cls = (*env)->FindClass(env, "java/net/InetSocketAddress");
++ CHECK_NULL(cls);
+ isa_class = (*env)->NewGlobalRef(env, cls);
++ if (isa_class == NULL) {
++ JNU_ThrowOutOfMemoryError(env, NULL);
++ return;
++ }
+ isa_ctorID = (*env)->GetMethodID(env, cls, "<init>",
+ "(Ljava/net/InetAddress;I)V");
++ CHECK_NULL(isa_ctorID);
+ }
+
+ JNIEXPORT void JNICALL
+@@ -97,12 +105,13 @@
+ return IOS_THROWN;
+ }
+
++ SetHandleInformation((HANDLE)(UINT_PTR)newfd, HANDLE_FLAG_INHERIT, 0);
+ (*env)->SetIntField(env, newfdo, fd_fdID, newfd);
+ remote_ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, (int *)&remote_port);
++ CHECK_NULL_RETURN(remote_ia, IOS_THROWN);
+
+- isa = (*env)->NewObject(env, isa_class, isa_ctorID,
+- remote_ia, remote_port);
++ isa = (*env)->NewObject(env, isa_class, isa_ctorID, remote_ia, remote_port);
++ CHECK_NULL_RETURN(isa, IOS_THROWN);
+ (*env)->SetObjectArrayElement(env, isaa, 0, isa);
+-
+ return 1;
+ }
+--- ./jdk/src/windows/native/sun/nio/ch/SocketChannelImpl.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/ch/SocketChannelImpl.c Wed Jul 01 21:53:30 2015 -0700
+@@ -42,8 +42,8 @@
+ JNIEXPORT void JNICALL
+ Java_sun_nio_ch_SocketChannelImpl_initIDs(JNIEnv *env, jclass cls)
+ {
+- cls = (*env)->FindClass(env, "java/net/InetAddress");
+- ia_addrID = (*env)->GetFieldID(env, cls, "address", "I");
++ CHECK_NULL(cls = (*env)->FindClass(env, "java/net/InetAddress"));
++ CHECK_NULL(ia_addrID = (*env)->GetFieldID(env, cls, "address", "I"));
+ }
+
+ jint
+--- ./jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c Wed Jul 01 21:53:30 2015 -0700
+@@ -111,65 +111,70 @@
+ HMODULE h;
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$FirstFile");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ findFirst_handle = (*env)->GetFieldID(env, clazz, "handle", "J");
++ CHECK_NULL(findFirst_handle);
+ findFirst_name = (*env)->GetFieldID(env, clazz, "name", "Ljava/lang/String;");
++ CHECK_NULL(findFirst_name);
+ findFirst_attributes = (*env)->GetFieldID(env, clazz, "attributes", "I");
++ CHECK_NULL(findFirst_attributes);
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$FirstStream");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ findStream_handle = (*env)->GetFieldID(env, clazz, "handle", "J");
++ CHECK_NULL(findStream_handle);
+ findStream_name = (*env)->GetFieldID(env, clazz, "name", "Ljava/lang/String;");
++ CHECK_NULL(findStream_name);
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$VolumeInformation");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ volumeInfo_fsName = (*env)->GetFieldID(env, clazz, "fileSystemName", "Ljava/lang/String;");
++ CHECK_NULL(volumeInfo_fsName);
+ volumeInfo_volName = (*env)->GetFieldID(env, clazz, "volumeName", "Ljava/lang/String;");
++ CHECK_NULL(volumeInfo_volName);
+ volumeInfo_volSN = (*env)->GetFieldID(env, clazz, "volumeSerialNumber", "I");
++ CHECK_NULL(volumeInfo_volSN);
+ volumeInfo_flags = (*env)->GetFieldID(env, clazz, "flags", "I");
++ CHECK_NULL(volumeInfo_flags);
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$DiskFreeSpace");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ diskSpace_bytesAvailable = (*env)->GetFieldID(env, clazz, "freeBytesAvailable", "J");
++ CHECK_NULL(diskSpace_bytesAvailable);
+ diskSpace_totalBytes = (*env)->GetFieldID(env, clazz, "totalNumberOfBytes", "J");
++ CHECK_NULL(diskSpace_totalBytes);
+ diskSpace_totalFree = (*env)->GetFieldID(env, clazz, "totalNumberOfFreeBytes", "J");
++ CHECK_NULL(diskSpace_totalFree);
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$Account");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ account_domain = (*env)->GetFieldID(env, clazz, "domain", "Ljava/lang/String;");
++ CHECK_NULL(account_domain);
+ account_name = (*env)->GetFieldID(env, clazz, "name", "Ljava/lang/String;");
++ CHECK_NULL(account_name);
+ account_use = (*env)->GetFieldID(env, clazz, "use", "I");
++ CHECK_NULL(account_use);
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$AclInformation");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ aclInfo_aceCount = (*env)->GetFieldID(env, clazz, "aceCount", "I");
++ CHECK_NULL(aclInfo_aceCount);
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$CompletionStatus");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ completionStatus_error = (*env)->GetFieldID(env, clazz, "error", "I");
++ CHECK_NULL(completionStatus_error);
+ completionStatus_bytesTransferred = (*env)->GetFieldID(env, clazz, "bytesTransferred", "I");
++ CHECK_NULL(completionStatus_bytesTransferred);
+ completionStatus_completionKey = (*env)->GetFieldID(env, clazz, "completionKey", "J");
++ CHECK_NULL(completionStatus_completionKey);
+
+ clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$BackupResult");
+- if (clazz == NULL) {
+- return;
+- }
++ CHECK_NULL(clazz);
+ backupResult_bytesTransferred = (*env)->GetFieldID(env, clazz, "bytesTransferred", "I");
++ CHECK_NULL(backupResult_bytesTransferred);
+ backupResult_context = (*env)->GetFieldID(env, clazz, "context", "J");
++ CHECK_NULL(backupResult_context);
+
+ // get handle to kernel32
+ if (GetModuleHandleExW((GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+--- ./jdk/src/windows/native/sun/security/mscapi/security.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/security/mscapi/security.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -1659,29 +1659,36 @@
+ int convertToLittleEndian(JNIEnv *env, jbyteArray source, jbyte* destination,
+ int destinationLength) {
+
+- int count = 0;
+ int sourceLength = env->GetArrayLength(source);
+
+- if (sourceLength < destinationLength) {
+- return -1;
+- }
+-
+ jbyte* sourceBytes = env->GetByteArrayElements(source, 0);
+ if (sourceBytes == NULL) {
+ return -1;
+ }
+
++ int copyLen = sourceLength;
++ if (sourceLength > destinationLength) {
++ // source might include an extra sign byte
++ if (sourceLength == destinationLength + 1 && sourceBytes[0] == 0) {
++ copyLen--;
++ } else {
++ return -1;
++ }
++ }
++
+ // Copy bytes from the end of the source array to the beginning of the
+ // destination array (until the destination array is full).
+ // This ensures that the sign byte from the source array will be excluded.
+- for (int i = 0; i < destinationLength; i++) {
+- destination[i] = sourceBytes[sourceLength - i - 1];
+- count++;
++ for (int i = 0; i < copyLen; i++) {
++ destination[i] = sourceBytes[sourceLength - 1 - i];
+ }
+- if (sourceBytes)
+- env->ReleaseByteArrayElements(source, sourceBytes, JNI_ABORT);
++ if (copyLen < destinationLength) {
++ memset(destination + copyLen, 0, destinationLength - copyLen);
++ }
+
+- return count;
++ env->ReleaseByteArrayElements(source, sourceBytes, JNI_ABORT);
++
++ return destinationLength;
+ }
+
+ /*
+--- ./jdk/src/windows/native/sun/windows/awt_Component.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/windows/awt_Component.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -3761,12 +3761,14 @@
+ void AwtComponent::OpenCandidateWindow(int x, int y)
+ {
+ UINT bits = 1;
+- RECT rc;
+- GetWindowRect(GetHWnd(), &rc);
++ POINT p = {0, 0}; // upper left corner of the client area
++ HWND hWnd = GetHWnd();
++ HWND hTop = GetTopLevelParentForWindow(hWnd);
++ ::ClientToScreen(hTop, &p);
+
+ for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
+ if ( m_bitsCandType & bits )
+- SetCandidateWindow(iCandType, x-rc.left, y-rc.top);
++ SetCandidateWindow(iCandType, x - p.x, y - p.y);
+ }
+ if (m_bitsCandType != 0) {
+ // REMIND: is there any chance GetProxyFocusOwner() returns NULL here?
+--- ./jdk/src/windows/native/sun/windows/awt_Desktop.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/windows/awt_Desktop.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -52,6 +52,7 @@
+ // 6457572: ShellExecute possibly changes FPU control word - saving it here
+ unsigned oldcontrol87 = _control87(0, 0);
+ HINSTANCE retval = ::ShellExecute(NULL, verb_c, fileOrUri_c, NULL, NULL, SW_SHOWNORMAL);
++ DWORD error = ::GetLastError();
+ _control87(oldcontrol87, 0xffffffff);
+
+ JNU_ReleaseStringPlatformChars(env, fileOrUri_j, fileOrUri_c);
+@@ -65,7 +66,7 @@
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+- (int)retval,
++ error,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR)&buffer,
+ 0,
+--- ./jdk/src/windows/native/sun/windows/awt_Frame.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/windows/awt_Frame.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1996, 2014, 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
+@@ -82,6 +82,15 @@
+ HHOOK mouseHook;
+ HHOOK modalHook;
+ };
++
++
++// Communication with plugin control
++
++// The value must be the same as in AxControl.h
++#define WM_AX_REQUEST_FOCUS_TO_EMBEDDER (WM_USER + 197)
++
++static bool SetFocusToPluginControl(HWND hwndPlugin);
++
+ /************************************************************************
+ * AwtFrame fields
+ */
+@@ -93,6 +102,7 @@
+ jmethodID AwtFrame::setExtendedStateMID;
+
+ jmethodID AwtFrame::activateEmbeddingTopLevelMID;
++jfieldID AwtFrame::isEmbeddedInIEID;
+
+ Hashtable AwtFrame::sm_BlockedThreads("AWTBlockedThreads");
+
+@@ -104,6 +114,7 @@
+ m_parentWnd = NULL;
+ menuBar = NULL;
+ m_isEmbedded = FALSE;
++ m_isEmbeddedInIE = FALSE;
+ m_isLightweight = FALSE;
+ m_ignoreWmSize = FALSE;
+ m_isMenuDropped = FALSE;
+@@ -199,6 +210,13 @@
+
+ if (isEmbedded) {
+ hwndParent = (HWND)handle;
++
++ // JDK-8056915: Handle focus communication between plugin and frame
++ frame->m_isEmbeddedInIE = IsEmbeddedInIE(hwndParent);
++ if (frame->m_isEmbeddedInIE) {
++ env->SetBooleanField(target, isEmbeddedInIEID, JNI_TRUE);
++ }
++
+ RECT rect;
+ ::GetClientRect(hwndParent, &rect);
+ //Fix for 6328675: SWT_AWT.new_Frame doesn't occupy client area under JDK6
+@@ -338,6 +356,21 @@
+ return frame;
+ }
+
++/*
++ * Returns true if the frame is embedded into Internet Explorer.
++ * The function checks the class name of the parent window of the embedded frame.
++ */
++BOOL AwtFrame::IsEmbeddedInIE(HWND hwndParent)
++{
++ const char *pluginClass = "Java Plug-in Control Window";
++ #define PARENT_CLASS_BUFFER_SIZE 64
++ char parentClass[PARENT_CLASS_BUFFER_SIZE];
++
++ return (::GetClassNameA(hwndParent, parentClass, PARENT_CLASS_BUFFER_SIZE) > 0)
++ && (strncmp(parentClass, pluginClass, PARENT_CLASS_BUFFER_SIZE) == 0);
++}
++
++
+ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, MsgRouting &mr)
+ {
+ LRESULT retValue = 0L;
+@@ -1039,6 +1072,19 @@
+ if (IsLightweightFrame()) {
+ return TRUE;
+ }
++ if (isMouseEventCause && IsEmbeddedFrame() && m_isEmbeddedInIE) {
++ HWND hwndProxy = GetProxyFocusOwner();
++ // Do nothing if this frame is focused already
++ if (::GetFocus() != hwndProxy) {
++ // Fix for JDK-8056915:
++ // If window activated with mouse, set focus to plugin control window
++ // first to preserve focus owner inside browser window
++ if (SetFocusToPluginControl(::GetParent(GetHWnd()))) {
++ return TRUE;
++ }
++ // Plugin control window is already focused, so do normal processing
++ }
++ }
+ return AwtWindow::AwtSetActiveWindow(isMouseEventCause);
+ }
+
+@@ -1818,6 +1864,10 @@
+
+ AwtFrame::activateEmbeddingTopLevelMID = env->GetMethodID(cls, "activateEmbeddingTopLevel", "()V");
+ DASSERT(AwtFrame::activateEmbeddingTopLevelMID != NULL);
++ CHECK_NULL(AwtFrame::activateEmbeddingTopLevelMID);
++
++ AwtFrame::isEmbeddedInIEID = env->GetFieldID(cls, "isEmbeddedInIE", "Z");
++ DASSERT(AwtFrame::isEmbeddedInIEID != NULL);
+
+ CATCH_BAD_ALLOC;
+ }
+@@ -1911,4 +1961,44 @@
+ CATCH_BAD_ALLOC;
+ }
+
++JNIEXPORT jboolean JNICALL
++Java_sun_awt_windows_WEmbeddedFramePeer_requestFocusToEmbedder(JNIEnv *env, jobject self)
++{
++ jboolean result = JNI_FALSE;
++
++ TRY;
++
++ AwtFrame *frame = NULL;
++
++ PDATA pData;
++ JNI_CHECK_PEER_GOTO(self, ret);
++ frame = (AwtFrame *)pData;
++
++ // JDK-8056915: During initial applet activation, set focus to plugin control window
++ HWND hwndParent = ::GetParent(frame->GetHWnd());
++
++ result = SetFocusToPluginControl(hwndParent);
++
++ CATCH_BAD_ALLOC_RET(JNI_FALSE);
++ret:
++ return result;
++}
++
+ } /* extern "C" */
++
++static bool SetFocusToPluginControl(HWND hwndPlugin)
++{
++ HWND hwndFocus = ::GetFocus();
++
++ if (hwndFocus == hwndPlugin) {
++ return false;
++ }
++
++ ::SetFocus(hwndPlugin);
++ DWORD dwError = ::GetLastError();
++ if (dwError != ERROR_SUCCESS) {
++ // If direct call failed, use a special message to set focus
++ return (::SendMessage(hwndPlugin, WM_AX_REQUEST_FOCUS_TO_EMBEDDER, 0, 0) == 0);
++ }
++ return true;
++}
+--- ./jdk/src/windows/native/sun/windows/awt_Frame.h Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/windows/awt_Frame.h Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -60,6 +60,9 @@
+ /* method id for WEmbeddedFrame.requestActivate() method */
+ static jmethodID activateEmbeddingTopLevelMID;
+
++ /* field id for WEmbeddedFrame.isEmbeddedInIE */
++ static jfieldID isEmbeddedInIEID;
++
+ AwtFrame();
+ virtual ~AwtFrame();
+
+@@ -171,6 +174,13 @@
+ /* The frame is an EmbeddedFrame. */
+ BOOL m_isEmbedded;
+
++ /* Fix for JDK-8056915:
++ The embedded frame must gain focus by setting focus to its parent. */
++ BOOL m_isEmbeddedInIE;
++
++ /* Checks whether the frame is embedded in IE */
++ static BOOL IsEmbeddedInIE(HWND hwndParent);
++
+ /* The frame is a LightweightFrame */
+ BOOL m_isLightweight;
+
+--- ./jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -310,6 +310,8 @@
+ readingMergedClauseW = new jstring[cMergedClauseW];
+ } catch (std::bad_alloc&) {
+ delete [] bndMergedClauseW;
++ delete [] bndClauseW;
++ delete [] readingClauseW;
+ throw;
+ }
+
+@@ -394,6 +396,8 @@
+ valMergedAttrW = new BYTE[cMergedAttrW];
+ } catch (std::bad_alloc&) {
+ delete [] bndMergedAttrW;
++ delete [] bndAttrW;
++ delete [] valAttrW;
+ throw;
+ }
+ bndMergedAttrW[0] = 0;
+--- ./jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp Wed Jul 01 21:53:30 2015 -0700
+@@ -709,7 +709,7 @@
+ {
+ if (tooltip == NULL) {
+ m_nid.szTip[0] = '\0';
+- } else if (lstrlen(tooltip) > TRAY_ICON_TOOLTIP_MAX_SIZE) {
++ } else if (lstrlen(tooltip) >= TRAY_ICON_TOOLTIP_MAX_SIZE) {
+ _tcsncpy(m_nid.szTip, tooltip, TRAY_ICON_TOOLTIP_MAX_SIZE);
+ m_nid.szTip[TRAY_ICON_TOOLTIP_MAX_SIZE - 1] = '\0';
+ } else {
+@@ -814,7 +814,7 @@
+ if (caption[0] == '\0') {
+ m_nid.szInfoTitle[0] = '\0';
+
+- } else if (lstrlen(caption) > TRAY_ICON_BALLOON_TITLE_MAX_SIZE) {
++ } else if (lstrlen(caption) >= TRAY_ICON_BALLOON_TITLE_MAX_SIZE) {
+
+ _tcsncpy(m_nid.szInfoTitle, caption, TRAY_ICON_BALLOON_TITLE_MAX_SIZE);
+ m_nid.szInfoTitle[TRAY_ICON_BALLOON_TITLE_MAX_SIZE - 1] = '\0';
+@@ -827,7 +827,7 @@
+ m_nid.szInfo[0] = ' ';
+ m_nid.szInfo[1] = '\0';
+
+- } else if (lstrlen(text) > TRAY_ICON_BALLOON_INFO_MAX_SIZE) {
++ } else if (lstrlen(text) >= TRAY_ICON_BALLOON_INFO_MAX_SIZE) {
+
+ _tcsncpy(m_nid.szInfo, text, TRAY_ICON_BALLOON_INFO_MAX_SIZE);
+ m_nid.szInfo[TRAY_ICON_BALLOON_INFO_MAX_SIZE - 1] = '\0';
+--- ./jdk/src/windows/resource/java.manifest Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/src/windows/resource/java.manifest Wed Jul 01 21:53:30 2015 -0700
+@@ -52,6 +52,8 @@
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <!-- Windows 8.1 -->
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
++ <!-- Windows 10 -->
++ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+ </application>
+ </compatibility>
+
+--- ./jdk/test/ProblemList.txt Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/ProblemList.txt Wed Jul 01 21:53:30 2015 -0700
+@@ -272,7 +272,4 @@
+ # Filed 6772009
+ java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
+
+-# 8051641
+-sun/util/calendar/zi/TestZoneInfo310.java generic-all
+-
+ ############################################################################
+--- ./jdk/test/TEST.ROOT Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/TEST.ROOT Wed Jul 01 21:53:30 2015 -0700
+@@ -8,7 +8,7 @@
+ othervm.dirs=java/awt java/beans java/rmi javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces sun/rmi
+
+ # Tests that cannot run concurrently
+-exclusiveAccess.dirs=java/rmi/Naming java/util/Currency java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi
++exclusiveAccess.dirs=java/rmi/Naming java/util/Currency java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi javax/rmi
+
+ # Group definitions
+ groups=TEST.groups [closed/TEST.groups]
+--- ./jdk/test/TEST.groups Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/TEST.groups Wed Jul 01 21:53:30 2015 -0700
+@@ -111,7 +111,6 @@
+
+ jdk_rmi = \
+ java/rmi \
+- javax/rmi/ssl \
+ sun/rmi
+
+ jdk_security1 = \
+@@ -195,6 +194,7 @@
+ jdk_other = \
+ java/sql \
+ javax/sql \
++ javax/rmi \
+ javax/naming \
+ javax/script \
+ javax/smartcardio \
+@@ -484,7 +484,12 @@
+ sun/security/jgss \
+ sun/security/krb5 \
+ java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java \
++ java/lang/invoke/lambda/LambdaStackTrace.java \
++ java/lang/invoke/LFCaching/LFGarbageCollectedTest.java \
++ java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java \
++ java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java \
+ java/lang/System/MacEncoding/TestFileEncoding.java \
++ java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java \
+ java/nio/channels/AsynchronousSocketChannel/Leaky.java \
+ java/security/PermissionCollection/Concurrent.java \
+ java/security/Principal/Implies.java \
+--- ./jdk/test/com/sun/corba/5036554/TestCorbaBug.sh Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/corba/5036554/TestCorbaBug.sh Wed Jul 01 21:53:30 2015 -0700
+@@ -75,13 +75,13 @@
+ mkdir bug
+
+ cp ${TESTSRC}${FS}bug.idl .
+-${TESTJAVA}${FS}bin${FS}idlj bug.idl
++${COMPILEJAVA}${FS}bin${FS}idlj bug.idl
+
+ cp ${TESTSRC}${FS}JavaBug.java bug
+
+ chmod -fR 777 bug
+
+-${TESTJAVA}${FS}bin${FS}javac -d . bug${FS}*.java
++${COMPILEJAVA}${FS}bin${FS}javac -d . bug${FS}*.java
+
+ ${TESTJAVA}${FS}bin${FS}java -cp . bug/JavaBug > test.out 2>&1
+
+--- ./jdk/test/com/sun/corba/cachedSocket/7056731.sh Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/corba/cachedSocket/7056731.sh Wed Jul 01 21:53:30 2015 -0700
+@@ -55,8 +55,8 @@
+ cp -r ${TESTSRC}${FS}*.java ${TESTSRC}${FS}Hello.idl .
+ echo "Testing...please wait"
+
+-${TESTJAVA}${FS}bin${FS}idlj -fall Hello.idl
+-${TESTJAVA}${FS}bin${FS}javac *.java HelloApp/*.java
++${COMPILEJAVA}${FS}bin${FS}idlj -fall Hello.idl
++${COMPILEJAVA}${FS}bin${FS}javac *.java HelloApp/*.java
+
+ echo "starting orbd"
+ ${TESTJAVA}${FS}bin${FS}orbd -ORBInitialPort $PORT -ORBInitialHost localhost &
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,166 @@
++/*
++ * Copyright (c) 2015, Red Hat, Inc.
++ * 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 8069072
++ * @summary Test vectors for com.sun.crypto.provider.GHASH
++ */
++import java.lang.reflect.Constructor;
++import java.lang.reflect.Method;
++import java.nio.ByteBuffer;
++
++public class TestGHASH {
++
++ private final Constructor<?> GHASH;
++ private final Method UPDATE;
++ private final Method DIGEST;
++
++ TestGHASH(String className) throws Exception {
++ Class<?> cls = Class.forName(className);
++ GHASH = cls.getDeclaredConstructor(byte[].class);
++ GHASH.setAccessible(true);
++ UPDATE = cls.getDeclaredMethod("update", byte[].class);
++ UPDATE.setAccessible(true);
++ DIGEST = cls.getDeclaredMethod("digest");
++ DIGEST.setAccessible(true);
++ }
++
++
++ private Object newGHASH(byte[] H) throws Exception {
++ return GHASH.newInstance(H);
++ }
++
++ private void updateGHASH(Object hash, byte[] data)
++ throws Exception {
++ UPDATE.invoke(hash, data);
++ }
++
++ private byte[] digestGHASH(Object hash) throws Exception {
++ return (byte[]) DIGEST.invoke(hash);
++ }
++
++ private static final String HEX_DIGITS = "0123456789abcdef";
++
++ private static String hex(byte[] bs) {
++ StringBuilder sb = new StringBuilder(2 * bs.length);
++ for (byte b : bs) {
++ sb.append(HEX_DIGITS.charAt((b >> 4) & 0xF));
++ sb.append(HEX_DIGITS.charAt(b & 0xF));
++ }
++ return sb.toString();
++ }
++
++ private static byte[] bytes(String hex) {
++ if ((hex.length() & 1) != 0) {
++ throw new AssertionError();
++ }
++ byte[] result = new byte[hex.length() / 2];
++ for (int i = 0; i < result.length; ++i) {
++ int a = HEX_DIGITS.indexOf(hex.charAt(2 * i));
++ int b = HEX_DIGITS.indexOf(hex.charAt(2 * i + 1));
++ if ((a | b) < 0) {
++ if (a < 0) {
++ throw new AssertionError(
++ "bad character " + (int) hex.charAt(2 * i));
++ }
++ throw new AssertionError(
++ "bad character " + (int) hex.charAt(2 * i + 1));
++ }
++ result[i] = (byte) ((a << 4) | b);
++ }
++ return result;
++ }
++
++ private static byte[] bytes(long L0, long L1) {
++ return ByteBuffer.allocate(16)
++ .putLong(L0)
++ .putLong(L1)
++ .array();
++ }
++
++ private void check(int testCase, String H, String A,
++ String C, String expected) throws Exception {
++ int lenA = A.length() * 4;
++ while ((A.length() % 32) != 0) {
++ A += '0';
++ }
++ int lenC = C.length() * 4;
++ while ((C.length() % 32) != 0) {
++ C += '0';
++ }
++
++ Object hash = newGHASH(bytes(H));
++ updateGHASH(hash, bytes(A));
++ updateGHASH(hash, bytes(C));
++ updateGHASH(hash, bytes(lenA, lenC));
++ byte[] digest = digestGHASH(hash);
++ String actual = hex(digest);
++ if (!expected.equals(actual)) {
++ throw new AssertionError(String.format("%d: expected %s, got %s",
++ testCase, expected, actual));
++ }
++ }
++
++ public static void main(String[] args) throws Exception {
++ TestGHASH test;
++ if (args.length == 0) {
++ test = new TestGHASH("com.sun.crypto.provider.GHASH");
++ } else {
++ test = new TestGHASH(args[0]);
++ }
++
++ // Test vectors from David A. McGrew, John Viega,
++ // "The Galois/Counter Mode of Operation (GCM)", 2005.
++ // <http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-revised-spec.pdf>
++
++ test.check(1, "66e94bd4ef8a2c3b884cfa59ca342b2e", "", "",
++ "00000000000000000000000000000000");
++ test.check(2,
++ "66e94bd4ef8a2c3b884cfa59ca342b2e", "",
++ "0388dace60b6a392f328c2b971b2fe78",
++ "f38cbb1ad69223dcc3457ae5b6b0f885");
++ test.check(3,
++ "b83b533708bf535d0aa6e52980d53b78", "",
++ "42831ec2217774244b7221b784d0d49c" +
++ "e3aa212f2c02a4e035c17e2329aca12e" +
++ "21d514b25466931c7d8f6a5aac84aa05" +
++ "1ba30b396a0aac973d58e091473f5985",
++ "7f1b32b81b820d02614f8895ac1d4eac");
++ test.check(4,
++ "b83b533708bf535d0aa6e52980d53b78",
++ "feedfacedeadbeeffeedfacedeadbeef" + "abaddad2",
++ "42831ec2217774244b7221b784d0d49c" +
++ "e3aa212f2c02a4e035c17e2329aca12e" +
++ "21d514b25466931c7d8f6a5aac84aa05" +
++ "1ba30b396a0aac973d58e091",
++ "698e57f70e6ecc7fd9463b7260a9ae5f");
++ test.check(5, "b83b533708bf535d0aa6e52980d53b78",
++ "feedfacedeadbeeffeedfacedeadbeef" + "abaddad2",
++ "61353b4c2806934a777ff51fa22a4755" +
++ "699b2a714fcdc6f83766e5f97b6c7423" +
++ "73806900e49f24b22b097544d4896b42" +
++ "4989b5e1ebac0f07c23f4598",
++ "df586bb4c249b92cb6922877e444d37b");
++ }
++}
+--- ./jdk/test/com/sun/jdi/AllLineLocations.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/AllLineLocations.java Wed Jul 01 21:53:30 2015 -0700
+@@ -27,7 +27,6 @@
+ * @summary Test ReferenceType.allLineLocations
+ * @author Gordon Hirsch
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g RefTypes.java
+ * @run build AllLineLocations
+--- ./jdk/test/com/sun/jdi/ClassesByName.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/ClassesByName.java Wed Jul 01 21:53:30 2015 -0700
+@@ -26,7 +26,6 @@
+ * @bug 4287992
+ * @author Robert Field
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run build ClassesByName
+--- ./jdk/test/com/sun/jdi/ExceptionEvents.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/ExceptionEvents.java Wed Jul 01 21:53:30 2015 -0700
+@@ -28,7 +28,6 @@
+ *
+ * @author Robert Field
+ *
+- * @library scaffold
+ * @run build TestScaffold VMConnection
+ * @run compile -g ExceptionEvents.java
+ *
+--- ./jdk/test/com/sun/jdi/FilterMatch.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/FilterMatch.java Wed Jul 01 21:53:30 2015 -0700
+@@ -28,7 +28,6 @@
+ *
+ * @author Robert Field/Jim Holmlund
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run main/othervm FilterMatch
+--- ./jdk/test/com/sun/jdi/FilterNoMatch.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/FilterNoMatch.java Wed Jul 01 21:53:30 2015 -0700
+@@ -28,7 +28,6 @@
+ *
+ * @author Robert Field/Jim Holmlund
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run main/othervm FilterNoMatch
+--- ./jdk/test/com/sun/jdi/InstanceFilter.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/InstanceFilter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -104,7 +104,10 @@
+ return;
+ }
+ if (theThis == null) {
+- // This happens when the thread has exited.
++ // This happens when the thread has exited or when a
++ // static method is called. Setting an instance
++ // filter does not prevent this event from being
++ // emitted with a this that is null.
+ methodEntryRequest.disable();
+ return;
+ }
+@@ -138,6 +141,10 @@
+ EventRequestManager mgr = vm().eventRequestManager();
+ methodEntryRequest = mgr.createMethodEntryRequest();
+ methodEntryRequest.addInstanceFilter(theInstance);
++ // Thread filter is needed to prevent MethodEntry events
++ // to be emitted by the debugee when a static method
++ // is called on any thread.
++ methodEntryRequest.addThreadFilter(bpe.thread());
+ methodEntryRequest.enable();
+
+ listenUntilVMDisconnect();
+--- ./jdk/test/com/sun/jdi/InterfaceMethodsTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/InterfaceMethodsTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -24,6 +24,7 @@
+ /**
+ * @test
+ * @bug 8031195
++ * @bug 8071657
+ * @summary JDI: Add support for static and default methods in interfaces
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+@@ -38,6 +39,7 @@
+ private static final int RESULT_A = 1;
+ private static final int RESULT_B = 1;
+ private static final int RESULT_TARGET = 1;
++
+ static interface InterfaceA {
+ static int staticMethodA() {
+ System.out.println("-InterfaceA: static interface method A-");
+@@ -202,6 +204,9 @@
+
+ // try to invoke static method B on the instance
+ testInvokePos(ifaceClass, ref, "staticMethodB", "()I", vm().mirrorOf(RESULT_A));
++
++ // try to invoke a virtual method
++ testInvokePos(ifaceClass, ref, "implementedMethod", "()I", vm().mirrorOf(RESULT_A), true);
+ }
+
+ private void testInterfaceB(ObjectReference ref) {
+@@ -302,9 +307,14 @@
+
+ private void testInvokePos(ReferenceType targetClass, ObjectReference ref, String methodName,
+ String methodSig, Value value) {
++ testInvokePos(targetClass, ref, methodName, methodSig, value, false);
++ }
++
++ private void testInvokePos(ReferenceType targetClass, ObjectReference ref, String methodName,
++ String methodSig, Value value, boolean virtual) {
+ logInvocation(ref, methodName, methodSig, targetClass);
+ try {
+- invoke(targetClass, ref, methodName, methodSig, value);
++ invoke(targetClass, ref, methodName, methodSig, value, virtual);
+ System.err.println("--- PASSED");
+ } catch (Exception e) {
+ System.err.println("--- FAILED");
+@@ -314,9 +324,14 @@
+
+ private void testInvokeNeg(ReferenceType targetClass, ObjectReference ref, String methodName,
+ String methodSig, Value value, String msg) {
++ testInvokeNeg(targetClass, ref, methodName, methodSig, value, msg, false);
++ }
++
++ private void testInvokeNeg(ReferenceType targetClass, ObjectReference ref, String methodName,
++ String methodSig, Value value, String msg, boolean virtual) {
+ logInvocation(ref, methodName, methodSig, targetClass);
+ try {
+- invoke(targetClass, ref, methodName, methodSig, value);
++ invoke(targetClass, ref, methodName, methodSig, value, virtual);
+ System.err.println("--- FAILED");
+ failure("FAILED: " + msg);
+ } catch (Exception e) {
+@@ -326,7 +341,7 @@
+ }
+
+ private void invoke(ReferenceType targetClass, ObjectReference ref, String methodName,
+- String methodSig, Value value)
++ String methodSig, Value value, boolean virtual)
+ throws Exception {
+ Method method = getMethod(targetClass, methodName, methodSig);
+ if (method == null) {
+@@ -334,10 +349,15 @@
+ }
+
+ println("Invoking " + (method.isAbstract() ? "abstract " : " ") + "method: " + method);
++ println(method.declaringType().toString());
+
+ Value returnValue = null;
+ if (ref != null) {
+- returnValue = invokeInstance(ref, method);
++ if (virtual) {
++ returnValue = invokeVirtual(ref, method);
++ } else {
++ returnValue = invokeInstance(ref, method);
++ }
+ } else {
+ returnValue = invokeStatic(targetClass, method);
+ }
+@@ -362,6 +382,10 @@
+ return ref.invokeMethod(mainThread, method, Collections.emptyList(), ObjectReference.INVOKE_NONVIRTUAL);
+ }
+
++ private Value invokeVirtual(ObjectReference ref, Method method) throws Exception {
++ return ref.invokeMethod(mainThread, method, Collections.emptyList(), 0);
++ }
++
+ private Value invokeStatic(ReferenceType refType, Method method) throws Exception {
+ if (refType instanceof ClassType) {
+ return ((ClassType)refType).invokeMethod(mainThread, method, Collections.emptyList(), ObjectReference.INVOKE_NONVIRTUAL);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/com/sun/jdi/InvokeVarArgs.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,97 @@
++/*
++ * 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 8075331
++ * @summary Verify that we can call varargs methods
++ * @run build TestScaffold VMConnection TargetAdapter TargetListener
++ * @run compile -g InvokeVarArgs.java
++ * @run driver InvokeVarArgs
++ */
++
++import com.sun.jdi.*;
++import com.sun.jdi.event.*;
++import java.util.Arrays;
++
++interface MyInterface {
++}
++
++class SomeClass implements MyInterface {
++}
++
++class InvokeVarArgsTarg {
++
++ public static void main(String args[]) {
++ new InvokeVarArgsTarg().run();
++ }
++
++ SomeClass someClass1 = new SomeClass();
++ SomeClass someClass2 = new SomeClass();
++
++ MyInterface[] array = new MyInterface[]{someClass1, someClass2};
++ SomeClass[] array2 = new SomeClass[]{someClass1, someClass2};
++
++ public void run() {
++ System.out.println("size(array) : " + size(array));
++ System.out.println("size(array2) : " + size(array2));
++ }
++
++ int size(Object... value) {
++ return value.length;
++ }
++}
++
++public class InvokeVarArgs extends TestScaffold {
++
++ public static void main(String args[]) throws Exception {
++ new InvokeVarArgs(args).startTests();
++ }
++
++ InvokeVarArgs(String args[]) throws Exception {
++ super(args);
++ }
++
++ protected void runTests() throws Exception {
++
++ BreakpointEvent bpe = startTo("InvokeVarArgsTarg", "run", "()V");
++ StackFrame frame = bpe.thread().frame(0);
++ ObjectReference targetObj = frame.thisObject();
++ ReferenceType targetType = (ReferenceType) targetObj.type();
++ Value arrayVal = targetObj.getValue(targetType.fieldByName("array"));
++ Value array2Val = targetObj.getValue(targetType.fieldByName("array2"));
++ Method sizeMethod = targetType.methodsByName("size", "([Ljava/lang/Object;)I").get(0);
++
++ IntegerValue size = (IntegerValue) targetObj.invokeMethod(bpe.thread(), sizeMethod, Arrays.asList(new Value[]{arrayVal}), 0);
++ if (size.value() != 2) {
++ throw new Exception("size(array) should be 2, but was " + size.value());
++ }
++
++ size = (IntegerValue) targetObj.invokeMethod(bpe.thread(), sizeMethod, Arrays.asList(new Value[]{array2Val}), 0);
++ if (size.value() != 2) {
++ throw new Exception("size(array2) should be 2, but was " + size.value());
++ }
++
++ listenUntilVMDisconnect();
++ }
++}
+--- ./jdk/test/com/sun/jdi/LaunchCommandLine.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/LaunchCommandLine.java Wed Jul 01 21:53:30 2015 -0700
+@@ -27,7 +27,6 @@
+ * @summary Test launcher command line construction
+ * @author Gordon Hirsch
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run build LaunchCommandLine
+--- ./jdk/test/com/sun/jdi/ModificationWatchpoints.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/ModificationWatchpoints.java Wed Jul 01 21:53:30 2015 -0700
+@@ -29,7 +29,6 @@
+ * @author Daniel Prusa (or someone in the FFJ group)
+ * @author Robert Field (modified to JDIScaffold)
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g ModificationWatchpoints.java
+ * @run main/othervm ModificationWatchpoints
+--- ./jdk/test/com/sun/jdi/NativeInstanceFilter.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/NativeInstanceFilter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -28,7 +28,6 @@
+ *
+ * @author Keith McGuigan
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @compile -XDignore.symbol.file NativeInstanceFilterTarg.java
+ * @run main/othervm NativeInstanceFilter
+--- ./jdk/test/com/sun/jdi/UnpreparedByName.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/UnpreparedByName.java Wed Jul 01 21:53:30 2015 -0700
+@@ -28,7 +28,6 @@
+ * won't be returned by classesByName.
+ * @author Robert Field
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g InnerTarg.java
+ * @run build UnpreparedByName
+--- ./jdk/test/com/sun/jdi/UnpreparedClasses.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/UnpreparedClasses.java Wed Jul 01 21:53:30 2015 -0700
+@@ -28,7 +28,6 @@
+ * loaded class list are prepared classes.
+ * @author Robert Field
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g InnerTarg.java
+ * @run build UnpreparedClasses
+--- ./jdk/test/com/sun/jdi/Vars.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/com/sun/jdi/Vars.java Wed Jul 01 21:53:30 2015 -0700
+@@ -27,7 +27,6 @@
+ *
+ * @author Robert Field
+ *
+- * @library scaffold
+ * @run build JDIScaffold VMConnection
+ * @run compile -g Vars.java
+ * @run main/othervm Vars
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/com/sun/jndi/dns/IPv6NameserverPlatformParsingTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,104 @@
++/*
++ * Copyright (c) 2015, Red Hat, Inc.
++ * 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.reflect.Field;
++import java.util.Hashtable;
++
++import javax.naming.Context;
++import javax.naming.NamingException;
++import javax.naming.spi.NamingManager;
++
++import com.sun.jndi.dns.DnsContext;
++
++/**
++ * @test
++ * @bug 6991580
++ * @summary IPv6 Nameservers in resolv.conf throws NumberFormatException
++ * @run main/manual IPv6NameserverPlatformParsingTest
++ *
++ * In order to run this test be sure to place, for example, the following
++ * snippet into your platform's {@code /etc/resolv.conf}:
++ * <pre>
++ * nameserver 127.0.0.1
++ * nameserver 2001:4860:4860::8888
++ * nameserver [::1]:5353
++ * nameserver 127.0.0.1:5353
++ * </pre>
++ *
++ * Then, run this test as manual jtreg test.
++ *
++ * @author Severin Gehwolf
++ *
++ */
++public class IPv6NameserverPlatformParsingTest {
++
++ private static boolean foundIPv6 = false;
++
++ public static void main(String[] args) {
++ Hashtable<String, String> env = new Hashtable<>();
++ env.put(Context.INITIAL_CONTEXT_FACTORY, com.sun.jndi.dns.DnsContextFactory.class.getName());
++
++ String[] servers;
++ try {
++ Context ctx = NamingManager.getInitialContext(env);
++ if (!com.sun.jndi.dns.DnsContextFactory.platformServersAvailable()) {
++ throw new RuntimeException("FAIL: no platform servers available, test does not make sense");
++ }
++ DnsContext context = (DnsContext)ctx;
++ servers = getServersFromContext(context);
++ } catch (NamingException e) {
++ throw new RuntimeException(e);
++ }
++ for (String server: servers) {
++ System.out.println("DEBUG: 'nameserver = " + server + "'");
++ if (server.indexOf(':') >= 0 && server.indexOf('.') < 0) {
++ System.out.println("DEBUG: ==> Found IPv6 address in servers list: " + server);
++ foundIPv6 = true;
++ }
++ }
++ try {
++ new com.sun.jndi.dns.DnsClient(servers, 100, 1);
++ } catch (NumberFormatException e) {
++ throw new RuntimeException("FAIL: Tried to parse non-[]-encapsulated IPv6 address.", e);
++ } catch (Exception e) {
++ throw new RuntimeException("ERROR: Something unexpected happened.");
++ }
++ if (!foundIPv6) {
++ // This is a manual test, since it requires changing /etc/resolv.conf on Linux/Unix
++ // platforms. See comment as to how to run this test.
++ throw new RuntimeException("ERROR: No IPv6 address returned from platform.");
++ }
++ System.out.println("PASS: Found IPv6 address and DnsClient parsed it correctly.");
++ }
++
++ private static String[] getServersFromContext(DnsContext context) {
++ try {
++ Field serversField = DnsContext.class.getDeclaredField("servers");
++ serversField.setAccessible(true);
++ return (String[])serversField.get(context);
++ } catch (Exception e) {
++ throw new RuntimeException(e);
++ }
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/com/sun/jndi/ldap/LdapURLOptionalFields.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (c) 2015, Red Hat, Inc.
++ * 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 8074761
++ * @summary RFC-2255 allows attribute, scope and filter to be empty.
++ */
++
++import com.sun.jndi.ldap.LdapURL;
++
++public class LdapURLOptionalFields {
++
++ private static final String[] TEST_URLS = {
++ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com",
++ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com?",
++ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com??",
++ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com???",
++ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com????"
++ };
++
++ public static void main(String[] args) throws Exception {
++ for (int i = 0; i < TEST_URLS.length; i++) {
++ String url = TEST_URLS[i];
++ checkEmptyAttributes(url);
++ }
++ }
++
++ private static void checkEmptyAttributes(String urlString) throws Exception {
++ LdapURL url = new LdapURL(urlString);
++ if (url.getAttributes() != null) {
++ throw new Exception("Expected null attributes for url: '" + urlString + "'");
++ }
++ if (url.getScope() != null) {
++ throw new Exception("Expected null scope for url: '" + urlString + "'");
++ }
++ if (url.getFilter() != null) {
++ throw new Exception("Expected null filter for url: '" + urlString + "'");
++ }
++ }
++
++}
+--- ./jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalSwapSpaceSize.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,109 +0,0 @@
+-/*
+- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+- * 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.
+- */
+-
+-/*
+- *
+- *
+- * @bug 4858522
+- * @summary Basic unit test of OperatingSystemMXBean.getTotalSwapSpaceSize()
+- * @author Steve Bohne
+- */
+-
+-/*
+- * This test tests the actual swap size on linux and solaris.
+- * The correct value should be checked manually:
+- * Solaris:
+- * 1. In a shell, enter the command: "swap -l"
+- * 2. The value (reported in blocks) is in the "blocks" column.
+- * Linux:
+- * 1. In a shell, enter the command: "cat /proc/meminfo"
+- * 2. The value (reported in bytes) is in "Swap" entry, "total" column.
+- * Windows NT/XP/2000:
+- * 1. Run Start->Accessories->System Tools->System Information.
+- * 2. The value (reported in Kbytes) is in the "Page File Space" entry
+- * Windows 98/ME:
+- * Unknown.
+- *
+- * Usage: GetTotalSwapSpaceSize <expected swap size | "sanity-only"> [trace]
+- */
+-
+-import com.sun.management.OperatingSystemMXBean;
+-import java.lang.management.*;
+-
+-public class GetTotalSwapSpaceSize {
+-
+- private static OperatingSystemMXBean mbean =
+- (com.sun.management.OperatingSystemMXBean)
+- ManagementFactory.getOperatingSystemMXBean();
+-
+- // Careful with these values.
+- // Min size for pass dynamically determined below.
+- // zero if no swap space is configured.
+- private static long min_size_for_pass = 0;
+- private static final long MAX_SIZE_FOR_PASS = Long.MAX_VALUE;
+-
+- private static boolean trace = false;
+-
+- public static void main(String args[]) throws Exception {
+- if (args.length > 1 && args[1].equals("trace")) {
+- trace = true;
+- }
+-
+- long expected_swap_size = 0;
+-
+- if (args.length < 1 || args.length > 2) {
+- throw new IllegalArgumentException("Unexpected number of args " + args.length);
+- }
+-
+-
+- long min_size = mbean.getFreeSwapSpaceSize();
+- if (min_size > 0) {
+- min_size_for_pass = min_size;
+- }
+-
+- long size = mbean.getTotalSwapSpaceSize();
+-
+- if (trace) {
+- System.out.println("Total swap space size in bytes: " + size);
+- }
+-
+- if (!args[0].matches("sanity-only")) {
+- expected_swap_size = Long.parseLong(args[0]);
+- if (size != expected_swap_size) {
+- throw new RuntimeException("Expected total swap size : " +
+- expected_swap_size +
+- " but getTotalSwapSpaceSize returned: " +
+- size);
+- }
+- }
+-
+- if (size < min_size_for_pass || size > MAX_SIZE_FOR_PASS) {
+- throw new RuntimeException("Total swap space size " +
+- "illegal value: " + size + " bytes " +
+- "(MIN = " + min_size_for_pass + "; " +
+- "MAX = " + MAX_SIZE_FOR_PASS + ")");
+- }
+-
+- System.out.println("Test passed.");
+- }
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,162 @@
++/*
++ * 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
++ * 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 4858522
++ * @summary Basic unit test of OperatingSystemMXBean.getTotalSwapSpaceSize()
++ *
++ * @library /lib/testlibrary
++ * @build TestTotalSwap jdk.testlibrary.*
++ * @run main TestTotalSwap
++ *
++ * @author Steve Bohne
++ * @author Jaroslav Bachorik
++ */
++
++/*
++ * This test tests the actual swap size on linux and solaris.
++ * The correct value should be checked manually:
++ * Solaris:
++ * 1. In a shell, enter the command: "swap -l"
++ * 2. The value (reported in blocks) is in the "blocks" column.
++ * Linux:
++ * 1. In a shell, enter the command: "cat /proc/meminfo"
++ * 2. The value (reported in bytes) is in "Swap" entry, "total" column.
++ * Windows NT/XP/2000:
++ * 1. Run Start->Accessories->System Tools->System Information.
++ * 2. The value (reported in Kbytes) is in the "Page File Space" entry
++ * Windows 98/ME:
++ * Unknown.
++ *
++ * Usage: GetTotalSwapSpaceSize <expected swap size | "sanity-only"> [trace]
++ */
++
++import com.sun.management.OperatingSystemMXBean;
++import java.lang.management.*;
++
++import jdk.testlibrary.OSInfo;
++import jdk.testlibrary.ProcessTools;
++import jdk.testlibrary.OutputAnalyzer;
++
++public class TestTotalSwap {
++
++ private static final OperatingSystemMXBean mbean =
++ (com.sun.management.OperatingSystemMXBean)
++ ManagementFactory.getOperatingSystemMXBean();
++
++ // Careful with these values.
++ // Min size for pass dynamically determined below.
++ // zero if no swap space is configured.
++ private static long min_size_for_pass = 0;
++ private static final long MAX_SIZE_FOR_PASS = Long.MAX_VALUE;
++
++ public static void main(String args[]) throws Throwable {
++
++ long expected_swap_size = getSwapSizeFromOs();
++
++ long min_size = mbean.getFreeSwapSpaceSize();
++ if (min_size > 0) {
++ min_size_for_pass = min_size;
++ }
++
++ long size = mbean.getTotalSwapSpaceSize();
++
++ System.out.println("Total swap space size in bytes: " + size);
++
++ if (expected_swap_size > -1) {
++ if (size != expected_swap_size) {
++ throw new RuntimeException("Expected total swap size : " +
++ expected_swap_size +
++ " but getTotalSwapSpaceSize returned: " +
++ size);
++ }
++ }
++
++ // sanity check
++ if (size < min_size_for_pass || size > MAX_SIZE_FOR_PASS) {
++ throw new RuntimeException("Total swap space size " +
++ "illegal value: " + size + " bytes " +
++ "(MIN = " + min_size_for_pass + "; " +
++ "MAX = " + MAX_SIZE_FOR_PASS + ")");
++ }
++
++ System.out.println("Test passed.");
++ }
++
++ private static long getSwapSizeFromOs() throws Throwable {
++ OSInfo.OSType os = OSInfo.getOSType();
++
++ switch (os) {
++ // total used free shared buffers cached
++ // Mem: 16533540864 13638467584 2895073280 534040576 1630248960 6236909568
++ // -/+ buffers/cache: 5771309056 10762231808
++ // Swap: 15999168512 0 15999168512
++
++ case LINUX: {
++ String swapSizeStr = ProcessTools.executeCommand("free", "-b")
++ .firstMatch("Swap:\\s+([0-9]+)\\s+.*", 1);
++ return Long.parseLong(swapSizeStr);
++ }
++ case SOLARIS: {
++ // swapfile dev swaplo blocks free
++ // /dev/dsk/c0t0d0s1 136,1 16 1638608 1600528
++ OutputAnalyzer out= ProcessTools.executeCommand(
++ "/usr/sbin/swap",
++ "-l"
++ );
++
++ long swapSize = 0;
++
++ for (String line : out.asLines()) {
++ if (line.contains("swapfile")) continue;
++
++ String[] vals = line.split("\\s+");
++ if (vals.length == 5) {
++ swapSize += Long.parseLong(vals[3]) * 512; // size is reported in 512b blocks
++ }
++ }
++
++ return swapSize;
++ }
++ case MACOSX: {
++ // total = 8192.00M used = 7471.11M free = 720.89M (encrypted)
++ String swapSizeStr = ProcessTools.executeCommand(
++ "/usr/sbin/sysctl",
++ "-n",
++ "vm.swapusage"
++ ).firstMatch("total\\s+=\\s+([0-9]+(\\.[0-9]+)?[Mm]?).*", 1);
++ if (swapSizeStr.toLowerCase().endsWith("m")) {
++ swapSizeStr = swapSizeStr.substring(0, swapSizeStr.length() - 1);
++ return (long)(Double.parseDouble(swapSizeStr) * 1024 * 1024); // size in MB
++ }
++ return (long)(Double.parseDouble(swapSizeStr) * 1024 * 1024);
++ }
++ default: {
++ System.err.println("Unsupported operating system: " + os);
++ }
++ }
++
++ return -1;
++ }
++}
+--- ./jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,99 +0,0 @@
+-#
+-# Copyright (c) 2005, 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
+-# @summary Tests MM getTotalSwapSpaceSize() api.
+-# @author Swamy V
+-# @bug 6252770
+-#
+-# @run build GetTotalSwapSpaceSize
+-# @run shell TestTotalSwap.sh
+-#
+-
+-#
+-# This test tests the actual swap size on linux and solaris.
+-# On windows this is just a sanity check and correct size should
+-# be checked manually:
+-#
+-# Windows NT/XP/2000:
+-# 1. Run Start->Accessories->System Tools->System Information.
+-# 2. The value (reported in Kbytes) is in the "Page File Space" entry
+-# Windows 98/ME:
+-# Unknown.
+-#
+-
+-
+-#set -x
+-
+-#Set appropriate jdk
+-#
+-
+-if [ ! -z "${TESTJAVA}" ] ; then
+- jdk="$TESTJAVA"
+-else
+- echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
+- exit 1
+-fi
+-
+-runOne()
+-{
+- echo "runOne $@"
+- $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 3
+-}
+-
+-solaris_swap_size()
+-{
+- total_swap=0
+- for i in `/usr/sbin/swap -l | awk '{print $4}' | grep -v blocks`
+- do
+- # swap -l returns size in blocks of 512 bytes.
+- total_swap=`expr $i \* 512 + $total_swap`
+- done
+-}
+-
+-# Test GetTotalSwapSpaceSize if we are running on Unix
+-total_swap=0
+-case `uname -s` in
+- SunOS )
+- solaris_swap_size
+- runOne GetTotalSwapSpaceSize $total_swap
+- ;;
+- Linux )
+- total_swap=`free -b | grep -i swap | awk '{print $2}'`
+- runOne GetTotalSwapSpaceSize $total_swap
+- ;;
+- Darwin )
+- # $ sysctl -n vm.swapusage
+- # total = 8192.00M used = 7471.11M free = 720.89M (encrypted)
+- swap=`/usr/sbin/sysctl -n vm.swapusage | awk '{ print $3 }' | awk -F . '{ print $1 }'` || exit 2
+- total_swap=`expr $swap \* 1024 \* 1024` || exit 2
+- runOne GetTotalSwapSpaceSize $total_swap
+- ;;
+- * )
+- runOne GetTotalSwapSpaceSize "sanity-only"
+- ;;
+-esac
+-
+-exit 0
+-
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/com/sun/net/httpserver/MissingTrailingSpace.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,143 @@
++/*
++ * 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 8068795
++ * @summary HttpServer missing tailing space for some response codes
++ * @author lev.priima@oracle.com
++ */
++
++import java.net.InetSocketAddress;
++import java.io.InputStreamReader;
++import java.io.IOException;
++import java.io.BufferedReader;
++import java.io.OutputStreamWriter;
++import java.io.PrintWriter;
++import java.net.Socket;
++import java.util.concurrent.ExecutorService;
++import java.util.concurrent.Executors;
++import com.sun.net.httpserver.HttpExchange;
++import com.sun.net.httpserver.HttpHandler;
++import com.sun.net.httpserver.HttpServer;
++
++public class MissingTrailingSpace {
++
++ private static final int noMsgCode = 207;
++ private static final String someContext = "/context";
++
++ public static void main(String[] args) throws Exception {
++ HttpServer server = HttpServer.create(new InetSocketAddress(0), 0);
++ try {
++ server.setExecutor(Executors.newFixedThreadPool(1));
++ server.createContext(someContext, new HttpHandler() {
++ @Override
++ public void handle(HttpExchange msg) {
++ try {
++ try {
++ msg.sendResponseHeaders(noMsgCode, -1);
++ } catch(IOException ioe) {
++ ioe.printStackTrace();
++ }
++ } finally {
++ msg.close();
++ }
++ }
++ });
++ server.start();
++ System.out.println("Server started at port "
++ + server.getAddress().getPort());
++
++ runRawSocketHttpClient("localhost", server.getAddress().getPort());
++ } finally {
++ ((ExecutorService)server.getExecutor()).shutdown();
++ server.stop(0);
++ }
++ System.out.println("Server finished.");
++ }
++
++ static void runRawSocketHttpClient(String hostname, int port)
++ throws Exception
++ {
++ Socket socket = null;
++ PrintWriter writer = null;
++ BufferedReader reader = null;
++ final String CRLF = "\r\n";
++ try {
++ socket = new Socket(hostname, port);
++ writer = new PrintWriter(new OutputStreamWriter(
++ socket.getOutputStream()));
++ System.out.println("Client connected by socket: " + socket);
++
++ writer.print("GET " + someContext + "/ HTTP/1.1" + CRLF);
++ writer.print("User-Agent: Java/"
++ + System.getProperty("java.version")
++ + CRLF);
++ writer.print("Host: " + hostname + CRLF);
++ writer.print("Accept: */*" + CRLF);
++ writer.print("Connection: keep-alive" + CRLF);
++ writer.print(CRLF); // Important, else the server will expect that
++ // there's more into the request.
++ writer.flush();
++ System.out.println("Client wrote rquest to socket: " + socket);
++
++ reader = new BufferedReader(new InputStreamReader(
++ socket.getInputStream()));
++ System.out.println("Client start reading from server:" );
++ String line = reader.readLine();
++ if ( !line.endsWith(" ") ) {
++ throw new RuntimeException("respond to unknown code "
++ + noMsgCode
++ + " doesn't return space at the end of the first header.\n"
++ + "Should be: " + "\"" + line + " \""
++ + ", but returns: " + "\"" + line + "\".");
++ }
++ for (; line != null; line = reader.readLine()) {
++ if (line.isEmpty()) {
++ break;
++ }
++ System.out.println("\"" + line + "\"");
++ }
++ System.out.println("Client finished reading from server" );
++ } finally {
++ if (reader != null)
++ try {
++ reader.close();
++ } catch (IOException logOrIgnore) {
++ logOrIgnore.printStackTrace();
++ }
++ if (writer != null) {
++ writer.close();
++ }
++ if (socket != null) {
++ try {
++ socket.close();
++ } catch (IOException logOrIgnore) {
++ logOrIgnore.printStackTrace();
++ }
++ }
++ }
++ System.out.println("Client finished." );
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,194 @@
++/*
++ * 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 8067846
++ * @summary Test for send failed notification
++ */
++
++import com.sun.nio.sctp.*;
++import java.io.IOException;
++import java.net.InetSocketAddress;
++import java.net.SocketAddress;
++import java.nio.ByteBuffer;
++import static java.lang.System.out;
++import static java.nio.ByteBuffer.*;
++
++public class SendFailed {
++
++ static final SocketAddress remoteAddress = new InetSocketAddress("127.0.0.1", 3000);
++
++ static final int[] bufferSizes =
++ { 20, 49, 50, 51, 100, 101, 1024, 1025, 4095, 4096, 4097, 8191, 8192, 8193};
++
++ void test(String[] args) throws IOException {
++ SocketAddress address = null;
++ String os = System.getProperty("os.name").toLowerCase();
++
++ if (!Util.isSCTPSupported()) {
++ out.println("SCTP protocol is not supported");
++ out.println("Test cannot be run");
++ return;
++ } else if (os.startsWith("sunos")) {
++ out.println("Test not supported on Solaris");
++ out.println("Test cannot be run");
++ return;
++ }
++
++ System.out.println("remote address: " + remoteAddress);
++ System.out.println("Note, remote address should not be up");
++
++ /* combinations with various buffer sizes, and offsets */
++ for (int send=0; send < bufferSizes.length; send++) {
++ for (int recv=0; recv < bufferSizes.length; recv++) {
++ for (boolean direct : new boolean[] {true, false})
++ runWithManyOffsets(bufferSizes[send], bufferSizes[recv], direct);
++ }
++ }
++ }
++
++ void runWithManyOffsets(int sendBufferSize, int recvBufferSize, boolean direct)
++ throws IOException
++ {
++ doTest(sendBufferSize, recvBufferSize, direct, 0);
++ doTest(sendBufferSize, recvBufferSize, direct, 1);
++ doTest(sendBufferSize, recvBufferSize, direct, 3);
++ doTest(sendBufferSize, recvBufferSize, direct, 7);
++ doTest(sendBufferSize, recvBufferSize, direct, 9);
++ doTest(sendBufferSize, recvBufferSize, direct, 13);
++ doTest(sendBufferSize, recvBufferSize, direct, 15);
++ }
++
++ void doTest(int sendBufferSize, int recvBufferSize, boolean direct, int offset)
++ throws IOException
++ {
++ debug("%n--- Testing with send size:[%d], recv size:[%d], offset:[%d] "
++ + ", direct [%s]. ", sendBufferSize, recvBufferSize, offset, direct);
++
++ try (SctpMultiChannel channel = SctpMultiChannel.open()) {
++ MessageInfo messageInfo = MessageInfo.createOutgoing(remoteAddress, 0);
++ ByteBuffer sendBuffer = filledBuffer(sendBufferSize, direct);
++
++ debug("%nAttempting to send to %s. ", remoteAddress);
++ int sent = channel.send(sendBuffer, messageInfo);
++ sendBuffer.flip();
++
++ SendFailedNotificationHandler handler =
++ new SendFailedNotificationHandler();
++ ByteBuffer recvBuffer = direct ? allocateDirect(recvBufferSize)
++ : allocate((recvBufferSize));
++ channel.receive(recvBuffer, null, handler);
++
++ // verify sent buffer received by send failed notification
++ ByteBuffer buffer = handler.getSendFailedByteBuffer();
++ check(buffer.remaining() == sent);
++ check(buffer.position() == 0);
++ check(buffer.limit() == sent);
++ assertSameContent(sendBuffer, handler.getSendFailedByteBuffer());
++ }
++ }
++
++ class SendFailedNotificationHandler extends AbstractNotificationHandler<Object>
++ {
++ /** Reference to the buffer captured in send failed notification */
++ private ByteBuffer sentBuffer;
++
++ @Override
++ public HandlerResult handleNotification(
++ Notification notification, Object attachment) {
++ fail("Unknown notification type");
++ return HandlerResult.CONTINUE;
++ }
++
++ @Override
++ public HandlerResult handleNotification(
++ AssociationChangeNotification notification, Object attachment) {
++ AssociationChangeNotification.AssocChangeEvent event = notification.event();
++ debug("%nAssociationChangeNotification");
++ debug("%n Association: %s. ", notification.association());
++ debug("%n Event: %s. ", event);
++ return HandlerResult.CONTINUE;
++ }
++
++ @Override
++ public HandlerResult handleNotification(
++ SendFailedNotification notification, Object attachment) {
++ debug("%nSendFailedNotification: %s. ", notification);
++ sentBuffer = notification.buffer();
++ return HandlerResult.RETURN;
++ }
++
++ public ByteBuffer getSendFailedByteBuffer() {
++ return sentBuffer;
++ }
++
++ @Override
++ public HandlerResult handleNotification(
++ PeerAddressChangeNotification pacn, Object attachment)
++ {
++ debug("%nPeerAddressChangeNotification: %s", pacn);
++ return HandlerResult.CONTINUE;
++ }
++
++ @Override
++ public HandlerResult handleNotification(
++ ShutdownNotification notification, Object attachment) {
++ debug("%nShutdownNotification");
++ debug("%n Association: %s. ", notification.association());
++ return HandlerResult.CONTINUE;
++ }
++ }
++
++ static ByteBuffer filledBuffer(int size, boolean direct) {
++ ByteBuffer buffer = direct ? allocateDirect(size) : allocate((size));
++ for (int i=0; i< size; i++)
++ buffer.put((byte)i);
++ buffer.flip();
++ return buffer;
++ }
++
++ static void assertSameContent(ByteBuffer bb1, ByteBuffer bb2) {
++ if (!bb1.equals(bb2))
++ throw new RuntimeException("Buffers are not equal; bb1: " + bb1 + ", bb2: " + bb2);
++ }
++
++ //--------------------- Infrastructure ---------------------------
++ boolean debug = true;
++ volatile int passed = 0, failed = 0;
++ void pass() {passed++;}
++ void fail() {failed++; Thread.dumpStack();}
++ void fail(String msg) {System.err.println(msg); fail();}
++ void unexpected(Throwable t) {failed++; t.printStackTrace();}
++ void check(boolean cond) {if (cond) pass(); else fail();}
++ void check(boolean cond, String failMessage) {if (cond) pass(); else fail(failMessage);}
++ void debug(String message, Object... args) {if(debug) { out.printf(message, args); } }
++ public static void main(String[] args) throws Throwable {
++ Class<?> k = new Object(){}.getClass().getEnclosingClass();
++ try {k.getMethod("instanceMain",String[].class)
++ .invoke( k.newInstance(), (Object) args);}
++ catch (Throwable e) {throw e.getCause();}}
++ public void instanceMain(String[] args) throws Throwable {
++ try {test(args);} catch (Throwable t) {unexpected(t);}
++ out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
++ if (failed > 0) throw new AssertionError("Some tests failed");}
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Checkbox/SetStateExcessEvent/SetStateExcessEvent.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,79 @@
++/*
++ * 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.Checkbox;
++import java.awt.CheckboxGroup;
++import java.awt.Frame;
++import java.awt.GridBagLayout;
++import java.awt.Robot;
++
++/**
++ * @test
++ * @bug 8074500
++ * @summary Checkbox.setState() call should not post ItemEvent
++ * @author Sergey Bylokhov
++ */
++public final class SetStateExcessEvent {
++
++ private static boolean failed;
++
++ public static void main(final String[] args) throws Exception {
++ final Robot robot = new Robot();
++ final CheckboxGroup group = new CheckboxGroup();
++ final Checkbox[] cbs = {new Checkbox("checkbox1", true, group),
++ new Checkbox("checkbox2", false, group),
++ new Checkbox("checkbox3", true, group),
++
++ new Checkbox("checkbox4", true),
++ new Checkbox("checkbox5", false),
++ new Checkbox("checkbox6", true)};
++ final Frame frame = new Frame();
++ frame.setLayout(new GridBagLayout());
++ try {
++ for (final Checkbox cb : cbs) {
++ cb.addItemListener(e -> {
++ failed = true;
++ });
++ }
++ for (final Checkbox cb : cbs) {
++ frame.add(cb);
++ }
++ frame.pack();
++
++ for (final Checkbox cb : cbs) {
++ cb.setState(!cb.getState());
++ }
++
++ for (final Checkbox cb : cbs) {
++ group.setSelectedCheckbox(cb);
++ }
++ robot.waitForIdle();
++ } finally {
++ frame.dispose();
++ }
++ if (failed) {
++ throw new RuntimeException("Listener should not be called");
++ }
++ System.out.println("Test passed");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Component/DimensionEncapsulation/DimensionEncapsulation.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,215 @@
++/*
++ * 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.Button;
++import java.awt.Canvas;
++import java.awt.Checkbox;
++import java.awt.Choice;
++import java.awt.Component;
++import java.awt.Dialog;
++import java.awt.Dimension;
++import java.awt.FileDialog;
++import java.awt.Frame;
++import java.awt.Label;
++import java.awt.List;
++import java.awt.Panel;
++import java.awt.ScrollPane;
++import java.awt.Scrollbar;
++import java.awt.TextArea;
++import java.awt.TextField;
++import java.awt.Window;
++import java.util.ArrayList;
++import java.util.Objects;
++
++import javax.swing.Box;
++import javax.swing.JButton;
++import javax.swing.JCheckBox;
++import javax.swing.JCheckBoxMenuItem;
++import javax.swing.JColorChooser;
++import javax.swing.JDesktopPane;
++import javax.swing.JDialog;
++import javax.swing.JEditorPane;
++import javax.swing.JFileChooser;
++import javax.swing.JFormattedTextField;
++import javax.swing.JFrame;
++import javax.swing.JInternalFrame;
++import javax.swing.JLabel;
++import javax.swing.JLayeredPane;
++import javax.swing.JMenu;
++import javax.swing.JMenuBar;
++import javax.swing.JMenuItem;
++import javax.swing.JOptionPane;
++import javax.swing.JPasswordField;
++import javax.swing.JPopupMenu;
++import javax.swing.JProgressBar;
++import javax.swing.JRadioButton;
++import javax.swing.JRadioButtonMenuItem;
++import javax.swing.JRootPane;
++import javax.swing.JScrollPane;
++import javax.swing.JSeparator;
++import javax.swing.JSlider;
++import javax.swing.JSpinner;
++import javax.swing.JSplitPane;
++import javax.swing.JTabbedPane;
++import javax.swing.JTable;
++import javax.swing.JTextArea;
++import javax.swing.JTextField;
++import javax.swing.JTextPane;
++import javax.swing.JToggleButton;
++import javax.swing.JToolBar;
++import javax.swing.JTree;
++import javax.swing.JViewport;
++import javax.swing.JWindow;
++import javax.swing.SwingUtilities;
++import javax.swing.UIManager;
++import javax.swing.UIManager.LookAndFeelInfo;
++import javax.swing.UnsupportedLookAndFeelException;
++import javax.swing.table.JTableHeader;
++
++import static javax.swing.UIManager.getInstalledLookAndFeels;
++
++/**
++ * @test
++ * @bug 6459798
++ * @author Sergey Bylokhov
++ */
++public final class DimensionEncapsulation implements Runnable {
++
++ java.util.List<Component> failures = new ArrayList<>();
++
++ public static void main(final String[] args) throws Exception {
++ for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
++ SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
++ SwingUtilities.invokeAndWait(new DimensionEncapsulation());
++ }
++ }
++
++ @Override
++ public void run() {
++ runTest(new Panel());
++ runTest(new Button());
++ runTest(new Checkbox());
++ runTest(new Canvas());
++ runTest(new Choice());
++ runTest(new Label());
++ runTest(new Scrollbar());
++ runTest(new TextArea());
++ runTest(new TextField());
++ runTest(new Dialog(new JFrame()));
++ runTest(new Frame());
++ runTest(new Window(new JFrame()));
++ runTest(new FileDialog(new JFrame()));
++ runTest(new List());
++ runTest(new ScrollPane());
++ runTest(new JFrame());
++ runTest(new JDialog(new JFrame()));
++ runTest(new JWindow(new JFrame()));
++ runTest(new JLabel("hi"));
++ runTest(new JMenu());
++ runTest(new JTree());
++ runTest(new JTable());
++ runTest(new JMenuItem());
++ runTest(new JCheckBoxMenuItem());
++ runTest(new JToggleButton());
++ runTest(new JSpinner());
++ runTest(new JSlider());
++ runTest(Box.createVerticalBox());
++ runTest(Box.createHorizontalBox());
++ runTest(new JTextField());
++ runTest(new JTextArea());
++ runTest(new JTextPane());
++ runTest(new JPasswordField());
++ runTest(new JFormattedTextField());
++ runTest(new JEditorPane());
++ runTest(new JButton());
++ runTest(new JColorChooser());
++ runTest(new JFileChooser());
++ runTest(new JCheckBox());
++ runTest(new JInternalFrame());
++ runTest(new JDesktopPane());
++ runTest(new JTableHeader());
++ runTest(new JLayeredPane());
++ runTest(new JRootPane());
++ runTest(new JMenuBar());
++ runTest(new JOptionPane());
++ runTest(new JRadioButton());
++ runTest(new JRadioButtonMenuItem());
++ runTest(new JPopupMenu());
++ //runTest(new JScrollBar()); --> don't test defines max and min in
++ // terms of preferred
++ runTest(new JScrollPane());
++ runTest(new JViewport());
++ runTest(new JSplitPane());
++ runTest(new JTabbedPane());
++ runTest(new JToolBar());
++ runTest(new JSeparator());
++ runTest(new JProgressBar());
++ if (!failures.isEmpty()) {
++ System.out.println("These classes failed");
++ for (final Component failure : failures) {
++ System.out.println(failure.getClass());
++ }
++ throw new RuntimeException("Test failed");
++ }
++ }
++
++ public void runTest(final Component c) {
++ try {
++ test(c);
++ c.setMinimumSize(new Dimension(100, 10));
++ c.setMaximumSize(new Dimension(200, 20));
++ c.setPreferredSize(new Dimension(300, 30));
++ test(c);
++ } catch (final Throwable ignored) {
++ failures.add(c);
++ }
++ }
++
++ public void test(final Component component) {
++ final Dimension psize = component.getPreferredSize();
++ psize.width += 200;
++ if (Objects.equals(psize, component.getPreferredSize())) {
++ throw new RuntimeException("PreferredSize is wrong");
++ }
++ final Dimension msize = component.getMaximumSize();
++ msize.width += 200;
++ if (Objects.equals(msize, component.getMaximumSize())) {
++ throw new RuntimeException("MaximumSize is wrong");
++ }
++ final Dimension misize = component.getMinimumSize();
++ misize.width += 200;
++ if (Objects.equals(misize, component.getMinimumSize())) {
++ throw new RuntimeException("MinimumSize is wrong");
++ }
++ }
++
++ private static void setLookAndFeel(final LookAndFeelInfo laf) {
++ try {
++ UIManager.setLookAndFeel(laf.getClassName());
++ System.out.println("LookAndFeel: " + laf.getClassName());
++ } catch (ClassNotFoundException | InstantiationException |
++ UnsupportedLookAndFeelException | IllegalAccessException e) {
++ throw new RuntimeException(e);
++ }
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Component/InsetsEncapsulation/InsetsEncapsulation.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,166 @@
++/*
++ * 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.Component;
++import java.awt.Insets;
++import java.util.ArrayList;
++import java.util.Collection;
++
++import javax.swing.Box;
++import javax.swing.JButton;
++import javax.swing.JCheckBox;
++import javax.swing.JCheckBoxMenuItem;
++import javax.swing.JColorChooser;
++import javax.swing.JComponent;
++import javax.swing.JDesktopPane;
++import javax.swing.JEditorPane;
++import javax.swing.JFileChooser;
++import javax.swing.JFormattedTextField;
++import javax.swing.JInternalFrame;
++import javax.swing.JLabel;
++import javax.swing.JLayeredPane;
++import javax.swing.JMenu;
++import javax.swing.JMenuBar;
++import javax.swing.JMenuItem;
++import javax.swing.JOptionPane;
++import javax.swing.JPasswordField;
++import javax.swing.JPopupMenu;
++import javax.swing.JProgressBar;
++import javax.swing.JRadioButton;
++import javax.swing.JRadioButtonMenuItem;
++import javax.swing.JRootPane;
++import javax.swing.JScrollBar;
++import javax.swing.JScrollPane;
++import javax.swing.JSeparator;
++import javax.swing.JSlider;
++import javax.swing.JSpinner;
++import javax.swing.JSplitPane;
++import javax.swing.JTabbedPane;
++import javax.swing.JTable;
++import javax.swing.JTextArea;
++import javax.swing.JTextField;
++import javax.swing.JTextPane;
++import javax.swing.JToggleButton;
++import javax.swing.JToolBar;
++import javax.swing.JTree;
++import javax.swing.JViewport;
++import javax.swing.SwingUtilities;
++import javax.swing.UIManager;
++import javax.swing.UnsupportedLookAndFeelException;
++import javax.swing.table.JTableHeader;
++
++import static javax.swing.UIManager.LookAndFeelInfo;
++import static javax.swing.UIManager.getInstalledLookAndFeels;
++
++/**
++ * @test
++ * @bug 6459800
++ * @author Sergey Bylokhov
++ */
++public final class InsetsEncapsulation implements Runnable {
++
++ private final Collection<Component> failures = new ArrayList<>();
++
++ public static void main(final String[] args) throws Exception {
++ for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
++ SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
++ SwingUtilities.invokeAndWait(new InsetsEncapsulation());
++ }
++ }
++
++ @Override
++ public void run() {
++ runTest(new JLabel("hi"));
++ runTest(new JMenu());
++ runTest(new JTree());
++ runTest(new JTable());
++ runTest(new JMenuItem());
++ runTest(new JCheckBoxMenuItem());
++ runTest(new JToggleButton());
++ runTest(new JSpinner());
++ runTest(new JSlider());
++ runTest(Box.createVerticalBox());
++ runTest(Box.createHorizontalBox());
++ runTest(new JTextField());
++ runTest(new JTextArea());
++ runTest(new JTextPane());
++ runTest(new JPasswordField());
++ runTest(new JFormattedTextField());
++ runTest(new JEditorPane());
++ runTest(new JButton());
++ runTest(new JColorChooser());
++ runTest(new JFileChooser());
++ runTest(new JCheckBox());
++ runTest(new JInternalFrame());
++ runTest(new JDesktopPane());
++ runTest(new JTableHeader());
++ runTest(new JLayeredPane());
++ runTest(new JRootPane());
++ runTest(new JMenuBar());
++ runTest(new JOptionPane());
++ runTest(new JRadioButton());
++ runTest(new JRadioButtonMenuItem());
++ runTest(new JPopupMenu());
++ runTest(new JScrollBar());
++ runTest(new JScrollPane());
++ runTest(new JViewport());
++ runTest(new JSplitPane());
++ runTest(new JTabbedPane());
++ runTest(new JToolBar());
++ runTest(new JSeparator());
++ runTest(new JProgressBar());
++ if (!failures.isEmpty()) {
++ System.out.println("These classes failed");
++ for (final Component failure : failures) {
++ System.out.println(failure.getClass());
++ }
++ throw new RuntimeException("Test failed");
++ }
++ }
++
++ void runTest(final JComponent component) {
++ try {
++ test(component);
++ } catch (final Throwable ignored) {
++ failures.add(component);
++ }
++ }
++
++ void test(final JComponent component) {
++ final Insets p = component.getInsets();
++ p.top += 3;
++ if (p.equals(component.getInsets())) {
++ throw new RuntimeException("Insets altered by altering Insets!");
++ }
++ }
++
++ private static void setLookAndFeel(final LookAndFeelInfo laf) {
++ try {
++ UIManager.setLookAndFeel(laf.getClassName());
++ System.out.println("LookAndFeel: " + laf.getClassName());
++ } catch (ClassNotFoundException | InstantiationException |
++ UnsupportedLookAndFeelException | IllegalAccessException e) {
++ throw new RuntimeException(e);
++ }
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,72 @@
++/*
++ * 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.Component;
++import java.awt.FlowLayout;
++import java.awt.Frame;
++import java.awt.Robot;
++
++import javax.swing.JButton;
++import javax.swing.SwingUtilities;
++
++/**
++ * @test
++ * @bug 8071306
++ * @author Sergey Bylokhov
++ */
++public final class SetEnabledPerformance {
++
++ private static Frame frame;
++
++ private static void createAndShowGUI() {
++ frame = new Frame();
++ frame.setLayout(new FlowLayout(FlowLayout.CENTER, 25, 0));
++ frame.setSize(600, 600);
++ frame.setLocationRelativeTo(null);
++ for (int i = 1; i < 10001; ++i) {
++ frame.add(new JButton("Button " + i));
++ }
++ frame.setVisible(true);
++ }
++
++ public static void main(final String[] args) throws Exception {
++ SwingUtilities.invokeAndWait(() -> createAndShowGUI());
++ final Robot robot = new Robot();
++ robot.waitForIdle();
++ robot.mouseMove(frame.getX() + 15, frame.getY() + 300);
++ robot.waitForIdle();
++ SwingUtilities.invokeAndWait(() -> {
++ long m = System.currentTimeMillis();
++ for (final Component comp : frame.getComponents()) {
++ comp.setEnabled(false);
++ }
++ m = System.currentTimeMillis() - m;
++ System.err.println("Disabled in " + m + " ms");
++ frame.dispose();
++ // we should be much faster, but leaves 1000 for the slow systems
++ if (m > 1000) {
++ throw new RuntimeException("Too slow");
++ }
++ });
++ }
++}
+\ No newline at end of file
+--- ./jdk/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,188 +0,0 @@
+-/*
+- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+- * 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 6255653
+- @summary REGRESSION: Override isLightweight() causes access violation in awt.dll
+- @author Andrei Dmitriev: area=awt-component
+- @run main StubPeerCrash
+-*/
+-
+-/*
+- * The test may not crash for several times so iteratively continue up to some limit.
+- */
+-
+-import java.awt.*;
+-import java.awt.peer.*;
+-import java.awt.event.PaintEvent;
+-import java.awt.image.ImageProducer;
+-import java.awt.image.ImageObserver;
+-import java.awt.image.ColorModel;
+-import java.awt.image.VolatileImage;
+-import java.awt.GraphicsConfiguration;
+-import sun.awt.CausedFocusEvent;
+-import sun.java2d.pipe.Region;
+-
+-public class StubPeerCrash {
+- public static int ITERATIONS = 20;
+-
+- public static void main(String []s)
+- {
+- for (int i = 0; i < ITERATIONS; i++){
+- showFrame(i);
+- }
+- }
+-
+- private static void showFrame(int i){
+- System.out.println("iteration = "+i);
+- Frame f = new Frame();
+- f.add(new AHeavyweightComponent());
+- f.setVisible(true);
+- f.setVisible(false);
+- }
+-}
+-
+-class AHeavyweightComponent extends Component {
+- private ComponentPeer peer = new StubComponentPeer();
+-
+- public AHeavyweightComponent(){
+- }
+-
+- public boolean isLightweight() {
+- return false;
+- }
+-
+- public ComponentPeer getPeer(){
+- return peer;
+- }
+-}
+-
+-class StubComponentPeer implements ComponentPeer {
+- public boolean isObscured(){return true;};
+- public boolean canDetermineObscurity(){return true;};
+- public void setVisible(boolean b){};
+- public void setEnabled(boolean b){};
+- public void paint(Graphics g){};
+- public void repaint(long tm, int x, int y, int width, int height){};
+- public void print(Graphics g){};
+- public void setBounds(int x, int y, int width, int height, int op){};
+- public void handleEvent(AWTEvent e){};
+- public void coalescePaintEvent(PaintEvent e){};
+- public Point getLocationOnScreen(){return null;};
+- public Dimension getPreferredSize(){return null;};
+- public Dimension getMinimumSize(){return null;};
+- public ColorModel getColorModel(){return null;};
+- public Toolkit getToolkit(){return null;};
+- public Graphics getGraphics(){return null;};
+- public FontMetrics getFontMetrics(Font font){return null;};
+- public void dispose(){};
+- public void setForeground(Color c){};
+- public void setBackground(Color c){};
+- public void setFont(Font f){};
+- public void updateCursorImmediately(){};
+- public boolean requestFocus(Component lightweightChild,
+- boolean temporary,
+- boolean focusedWindowChangeAllowed,
+- long time, CausedFocusEvent.Cause cause){
+- return true;
+- };
+- public boolean isFocusable(){return true;};
+-
+- public Image createImage(ImageProducer producer){return null;};
+- public Image createImage(int width, int height){return null;};
+- public VolatileImage createVolatileImage(int width, int height){return null;};
+- public boolean prepareImage(Image img, int w, int h, ImageObserver o){return true;};
+- public int checkImage(Image img, int w, int h, ImageObserver o){return 0;};
+- public GraphicsConfiguration getGraphicsConfiguration(){return null;};
+- public boolean handlesWheelScrolling(){return true;};
+- public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException{};
+- public Image getBackBuffer(){return null;};
+- public void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction){};
+- public void destroyBuffers(){};
+-
+- /**
+- * Reparents this peer to the new parent referenced by <code>newContainer</code> peer
+- * Implementation depends on toolkit and container.
+- * @param newContainer peer of the new parent container
+- * @since 1.5
+- */
+- public void reparent(ContainerPeer newContainer){};
+- /**
+- * Returns whether this peer supports reparenting to another parent withour destroying the peer
+- * @return true if appropriate reparent is supported, false otherwise
+- * @since 1.5
+- */
+- public boolean isReparentSupported(){return true;};
+-
+- /**
+- * Used by lightweight implementations to tell a ComponentPeer to layout
+- * its sub-elements. For instance, a lightweight Checkbox needs to layout
+- * the box, as well as the text label.
+- */
+- public void layout(){};
+-
+-
+- public Rectangle getBounds(){return null;};
+-
+- /**
+- * Applies the shape to the native component window.
+- * @since 1.7
+- */
+- public void applyShape(Region shape){};
+-
+- /**
+- * DEPRECATED: Replaced by getPreferredSize().
+- */
+- public Dimension preferredSize(){return null;};
+-
+- /**
+- * DEPRECATED: Replaced by getMinimumSize().
+- */
+- public Dimension minimumSize(){return null;};
+-
+- /**
+- * DEPRECATED: Replaced by setVisible(boolean).
+- */
+- public void show(){};
+-
+- /**
+- * DEPRECATED: Replaced by setVisible(boolean).
+- */
+- public void hide(){};
+-
+- /**
+- * DEPRECATED: Replaced by setEnabled(boolean).
+- */
+- public void enable(){};
+-
+- /**
+- * DEPRECATED: Replaced by setEnabled(boolean).
+- */
+- public void disable(){};
+-
+- /**
+- * DEPRECATED: Replaced by setBounds(int, int, int, int).
+- */
+- public void reshape(int x, int y, int width, int height){};
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Desktop/8064934/bug8064934.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,83 @@
++/*
++ * 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 8064934
++ * @summary Incorrect Exception message from java.awt.Desktop.open()
++ * @author Dmitry Markov
++ * @run main bug8064934
++ */
++import sun.awt.OSInfo;
++
++import java.awt.*;
++import java.io.File;
++import java.io.IOException;
++import java.security.AccessController;
++
++public class bug8064934 {
++ private static final String NO_ASSOCIATION_ERROR_MESSAGE = "Error message: No application is associated with" +
++ " the specified file for this operation.";
++
++ public static void main(String[] args) {
++ // This test is intended only for Windows
++ if (AccessController.doPrivileged(OSInfo.getOSTypeAction()) != OSInfo.OSType.WINDOWS) {
++ System.out.println("The test is for Windows platform only");
++ return;
++ }
++
++ // Test whether Desktop is supported of not
++ if (!Desktop.isDesktopSupported()) {
++ System.out.println("Desktop is not supported");
++ return;
++ }
++
++ Desktop desktop = Desktop.getDesktop();
++ // Test whether open action is supported or not
++ if (!desktop.isSupported(Desktop.Action.OPEN)) {
++ System.out.println("Desktop.Action.OPEN is not supported");
++ return;
++ }
++
++ File file = null;
++ try {
++ file = File.createTempFile("test", ".foo");
++ if (!file.exists()) {
++ throw new RuntimeException("Can not create temp file");
++ }
++ desktop.open(file);
++ } catch (IOException ioe) {
++ String errorMessage = ioe.getMessage().trim();
++ if (errorMessage != null && !errorMessage.endsWith(NO_ASSOCIATION_ERROR_MESSAGE)) {
++ throw new RuntimeException("Test FAILED! Wrong Error message: \n" +
++ "Actual " + errorMessage.substring(errorMessage.indexOf("Error message:")) + "\n" +
++ "Expected " + NO_ASSOCIATION_ERROR_MESSAGE);
++ }
++ } finally {
++ if (file != null) {
++ file.delete();
++ }
++ }
++
++ System.out.println("Test PASSED!");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Focus/8073453/AWTFocusTransitionTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,115 @@
++/*
++ * 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 8073453
++ * @summary Focus doesn't move when pressing Shift + Tab keys
++ * @author Dmitry Markov
++ * @compile AWTFocusTransitionTest.java
++ * @run main/othervm AWTFocusTransitionTest
++ */
++import sun.awt.SunToolkit;
++
++import java.awt.*;
++import java.awt.event.KeyEvent;
++
++public class AWTFocusTransitionTest {
++ private static SunToolkit toolkit;
++ private static Robot robot;
++
++ private static Frame frame;
++ private static TextField textField;
++ private static Button button;
++
++ public static void main(String[] args) throws Exception {
++ toolkit = (SunToolkit)Toolkit.getDefaultToolkit();
++ robot = new Robot();
++ robot.setAutoDelay(50);
++
++ try {
++ createAndShowGUI();
++
++ toolkit.realSync();
++
++ checkFocusOwner(textField);
++
++ robot.keyPress(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_TAB);
++ toolkit.realSync();
++
++ checkFocusOwner(button);
++
++ robot.keyPress(KeyEvent.VK_SHIFT);
++ robot.keyPress(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_SHIFT);
++ toolkit.realSync();
++
++ checkFocusOwner(textField);
++
++ robot.keyPress(KeyEvent.VK_SHIFT);
++ robot.keyPress(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_SHIFT);
++ toolkit.realSync();
++
++ checkFocusOwner(button);
++ } finally {
++ if (frame != null) {
++ frame.dispose();
++ }
++ }
++ System.out.println("Test Passed!");
++ }
++
++ private static void createAndShowGUI() {
++ frame = new Frame("AWTFocusTransitionTest");
++ frame.setSize(300, 300);
++ frame.setFocusTraversalPolicyProvider(true);
++ frame.setFocusTraversalPolicy(new DefaultFocusTraversalPolicy());
++
++ textField = new TextField();
++ button = new Button();
++
++ Panel panel = new Panel();
++ panel.setFocusTraversalPolicyProvider(true);
++ panel.setFocusTraversalPolicy(new DefaultFocusTraversalPolicy());
++
++ Panel p = new Panel();
++ p.setLayout(new GridLayout(3, 1));
++ p.add(textField);
++ p.add(button);
++ p.add(panel);
++
++ frame.add(p);
++ frame.setVisible(true);
++ }
++
++ private static void checkFocusOwner(Component component) {
++ if (component != frame.getFocusOwner()) {
++ throw new RuntimeException("Test Failed! Incorrect focus owner: " + frame.getFocusOwner() +
++ ", but expected: " + component);
++ }
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Focus/8073453/SwingFocusTransitionTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,131 @@
++/*
++ * 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 8073453
++ * @summary Focus doesn't move when pressing Shift + Tab keys
++ * @author Dmitry Markov
++ * @compile SwingFocusTransitionTest.java
++ * @run main/othervm SwingFocusTransitionTest
++ */
++import sun.awt.SunToolkit;
++
++import javax.swing.*;
++import java.awt.*;
++import java.awt.event.KeyEvent;
++
++public class SwingFocusTransitionTest {
++ private static SunToolkit toolkit;
++ private static Robot robot;
++
++ private static JFrame frame;
++ private static JTextField textField;
++ private static JButton button;
++
++ public static void main(String[] args) throws Exception {
++ toolkit = (SunToolkit)Toolkit.getDefaultToolkit();
++ robot = new Robot();
++ robot.setAutoDelay(50);
++
++ try {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ @Override
++ public void run() {
++ createAndShowGUI();
++ }
++ });
++
++ toolkit.realSync();
++
++ checkFocusOwner(textField);
++
++ robot.keyPress(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_TAB);
++ toolkit.realSync();
++
++ checkFocusOwner(button);
++
++ robot.keyPress(KeyEvent.VK_SHIFT);
++ robot.keyPress(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_SHIFT);
++ toolkit.realSync();
++
++ checkFocusOwner(textField);
++
++ robot.keyPress(KeyEvent.VK_SHIFT);
++ robot.keyPress(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_TAB);
++ robot.keyRelease(KeyEvent.VK_SHIFT);
++ toolkit.realSync();
++
++ checkFocusOwner(button);
++ } finally {
++ SwingUtilities.invokeLater(new Runnable() {
++ @Override
++ public void run() {
++ if (frame != null) {
++ frame.dispose();
++ }
++ }
++ });
++ }
++ System.out.println("Test Passed!");
++ }
++
++ private static void createAndShowGUI() {
++ frame = new JFrame("SwingFocusTransitionTest");
++ frame.setSize(300, 300);
++ frame.setFocusTraversalPolicyProvider(true);
++ frame.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy());
++
++ textField = new JTextField();
++ button = new JButton();
++
++ JPanel panel = new JPanel();
++ panel.setFocusTraversalPolicyProvider(true);
++ panel.setFocusTraversalPolicy(new DefaultFocusTraversalPolicy());
++
++ JPanel p = new JPanel();
++ p.setLayout(new GridLayout(3, 1));
++ p.add(textField);
++ p.add(button);
++ p.add(panel);
++
++ frame.add(p);
++ frame.setVisible(true);
++ }
++
++ private static void checkFocusOwner(final Component component) throws Exception {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ @Override
++ public void run() {
++ if (component != frame.getFocusOwner()) {
++ throw new RuntimeException("Test Failed! Incorrect focus owner: " + frame.getFocusOwner() +
++ ", but expected: " + component);
++ }
++ }
++ });
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/FontClass/DebugFonts.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,42 @@
++/*
++ * 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
++ * 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 4956241 80769790
++ * @summary NPE debugging fonts
++ * @run main/othervm DebugFonts
++ */
++
++import java.awt.Font;
++
++public class DebugFonts {
++
++ public static void main(String [] args) {
++ System.setProperty("sun.java2d.debugfonts", "true");
++ Font font = new Font("dialog", Font.PLAIN, 14);
++ System.out.println(font);
++ String s1 = font.getFamily();
++ String s2 = font.getFontName();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/FontClass/HelvLtOblTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,166 @@
++/*
++ * 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 8064833
++ * @summary Test correct font is obtained via family+style
++ * @run main HelvLtOblTest
++ */
++
++import javax.swing.JComponent;
++import javax.swing.JFrame;
++import javax.swing.SwingUtilities;
++import java.awt.Color;
++import java.awt.Dimension;
++import java.awt.Font;
++import java.awt.Graphics;
++import java.awt.Graphics2D;
++import java.awt.GraphicsEnvironment;
++import java.awt.RenderingHints;
++import java.awt.font.FontRenderContext;
++import java.awt.font.GlyphVector;
++import java.awt.image.BufferedImage;
++
++public class HelvLtOblTest extends JComponent {
++
++ static Font helvFont = null;
++
++ static int[] codes = { 0x23, 0x4a, 0x48, 0x3, 0x4a, 0x55, 0x42, 0x4d,
++ 0x4a, 0x44, 0x3,
++ 0x53, 0x46, 0x45, 0x3, 0x55, 0x46, 0x59, 0x55, };
++
++ static String str = "Big italic red text";
++
++ public static void main(String[] args) throws Exception {
++ String os = System.getProperty("os.name");
++ if (!os.startsWith("Mac")) {
++ return;
++ }
++ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
++ Font[] fonts = ge.getAllFonts();
++ for (int i=0; i<fonts.length; i++) {
++ if (fonts[i].getPSName().equals("Helvetica-LightOblique")) {
++ helvFont = fonts[i];
++ break;
++ }
++ }
++ if (helvFont == null) {
++ return;
++ }
++ final HelvLtOblTest test = new HelvLtOblTest();
++ SwingUtilities.invokeLater(() -> {
++ JFrame f = new JFrame();
++ f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
++ f.add("Center", test);
++ f.pack();
++ f.setVisible(true);
++ });
++ test.compareImages();
++ }
++
++ public Dimension getPreferredSize() {
++ return new Dimension(400,400);
++ }
++
++ public void paintComponent(Graphics g) {
++ super.paintComponent(g);
++ Graphics2D g2 = (Graphics2D)g;
++ FontRenderContext frc = new FontRenderContext(null, true, true);
++ Font f = helvFont.deriveFont(Font.PLAIN, 40);
++ System.out.println("font = " +f.getFontName());
++ GlyphVector gv = f.createGlyphVector(frc, codes);
++ g.setFont(f);
++ g.setColor(Color.white);
++ g.fillRect(0,0,400,400);
++ g.setColor(Color.black);
++ g2.drawGlyphVector(gv, 5,200);
++ g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
++ RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
++ g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
++ RenderingHints.VALUE_FRACTIONALMETRICS_ON);
++ g2.drawString(str, 5, 250);
++ }
++
++ void compareImages() {
++ BufferedImage bi0 = drawText(false);
++ BufferedImage bi1 = drawText(true);
++ compare(bi0, bi1);
++ }
++
++ BufferedImage drawText(boolean doGV) {
++ int w = 400;
++ int h = 50;
++ BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
++ Graphics2D g = bi.createGraphics();
++ g.setColor(Color.white);
++ g.fillRect(0,0,w,h);
++ g.setColor(Color.black);
++ Font f = helvFont.deriveFont(Font.PLAIN, 40);
++ g.setFont(f);
++ int x = 5;
++ int y = h - 10;
++ if (doGV) {
++ FontRenderContext frc = new FontRenderContext(null, true, true);
++ GlyphVector gv = f.createGlyphVector(frc, codes);
++ g.drawGlyphVector(gv, 5, y);
++ } else {
++ g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
++ RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
++ g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
++ RenderingHints.VALUE_FRACTIONALMETRICS_ON);
++ g.drawString(str, x, y);
++ }
++ return bi;
++ }
++
++ // Need to allow for minimal rounding error, so allow each component
++ // to differ by 1.
++ void compare(BufferedImage bi0, BufferedImage bi1) {
++ int wid = bi0.getWidth();
++ int hgt = bi0.getHeight();
++ for (int x=0; x<wid; x++) {
++ for (int y=0; y<hgt; y++) {
++ int rgb0 = bi0.getRGB(x, y);
++ int rgb1 = bi1.getRGB(x, y);
++ if (rgb0 == rgb1) continue;
++ int r0 = (rgb0 & 0xff0000) >> 16;
++ int r1 = (rgb1 & 0xff0000) >> 16;
++ int rdiff = r0-r1; if (rdiff<0) rdiff = -rdiff;
++ int g0 = (rgb0 & 0x00ff00) >> 8;
++ int g1 = (rgb1 & 0x00ff00) >> 8;
++ int gdiff = g0-g1; if (gdiff<0) gdiff = -gdiff;
++ int b0 = (rgb0 & 0x0000ff);
++ int b1 = (rgb1 & 0x0000ff);
++ int bdiff = b0-b1; if (bdiff<0) bdiff = -bdiff;
++ if (rdiff > 1 || gdiff > 1 || bdiff > 1) {
++ throw new RuntimeException(
++ "Images differ at x=" + x + " y="+ y + " " +
++ Integer.toHexString(rgb0) + " vs " +
++ Integer.toHexString(rgb1));
++ }
++ }
++ }
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/FullScreen/MultimonFullscreenTest/MultimonDeadlockTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,66 @@
++/*
++ * 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 8129116
++ @summary Deadlock with multimonitor fullscreen windows.
++ @run main/timeout=20 MultimonDeadlockTest
++ */
++import java.awt.*;
++import java.awt.event.WindowAdapter;
++import java.awt.event.WindowEvent;
++import java.lang.reflect.InvocationTargetException;
++
++public class MultimonDeadlockTest {
++
++ public static void main(String argv[]) {
++ final GraphicsDevice[] devices = GraphicsEnvironment
++ .getLocalGraphicsEnvironment()
++ .getScreenDevices();
++ if (devices.length < 2) {
++ System.out.println("It's a multiscreen test... skipping!");
++ return;
++ }
++
++ Frame frames[] = new Frame[devices.length];
++ try {
++ EventQueue.invokeAndWait(() -> {
++ for (int i = 0; i < devices.length; i++) {
++ frames[i] = new Frame();
++ frames[i].setSize(100, 100);
++ frames[i].setBackground(Color.BLUE);
++ devices[i].setFullScreenWindow(frames[i]);
++ }
++ });
++ Thread.sleep(5000);
++ } catch (InterruptedException | InvocationTargetException ex) {
++ } finally {
++ for (int i = 0; i < devices.length; i++) {
++ devices[i].setFullScreenWindow(null);
++ frames[i].dispose();
++ }
++ }
++
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/GraphicsEnvironment/TestDetectHeadless/TestDetectHeadless.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,32 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/*
++ * Portions Copyright (c) 2014 IBM Corporation
++ */
++
++public class TestDetectHeadless {
++ public static void main(String[] args) throws Exception {
++ Class.forName("javax.swing.plaf.basic.BasicInternalFrameTitlePane");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/GraphicsEnvironment/TestDetectHeadless/TestDetectHeadless.sh Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,57 @@
++#!/bin/sh
++
++#
++# Copyright (c) 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.
++#
++
++#
++# Portions Copyright (c) 2014 IBM Corporation
++#
++
++# @test
++# @bug 8058930 7077826
++# @summary java.awt.GraphicsEnvironment.getHeadlessProperty() does not work for AIX
++#
++# @build TestDetectHeadless
++# @run shell TestDetectHeadless.sh
++
++OS=`uname -s`
++case "$OS" in
++ Windows* | CYGWIN* | Darwin)
++ echo "Passed"; exit 0 ;;
++ * ) unset DISPLAY ;;
++esac
++
++${TESTJAVA}/bin/java ${TESTVMOPTS} \
++ -cp ${TESTCLASSES} TestDetectHeadless
++
++if [ $? -ne 0 ]; then
++ exit 1;
++fi
++
++DISPLAY=
++export DISPLAY
++
++${TESTJAVA}/bin/java ${TESTVMOPTS} \
++ -cp ${TESTCLASSES} TestDetectHeadless
++
++exit $?
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/MenuBar/RemoveHelpMenu/RemoveHelpMenu.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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.awt.Frame;
++import java.awt.Menu;
++import java.awt.MenuBar;
++
++/**
++ * @test
++ * @bug 6475361
++ * @author Sergey Bylokhov
++ */
++public final class RemoveHelpMenu {
++
++ public static void main(final String[] args) {
++ final Frame frame = new Frame("RemoveHelpMenu Test");
++ try {
++ frame.pack();
++ // peer exists
++ test1(getMenuBar(frame));
++ test2(getMenuBar(frame));
++ test3(getMenuBar(frame));
++ test4(getMenuBar(frame));
++ } finally {
++ frame.dispose();
++ }
++ // peer is null
++ test1(getMenuBar(frame));
++ test2(getMenuBar(frame));
++ test3(getMenuBar(frame));
++ test4(getMenuBar(frame));
++ }
++
++ private static MenuBar getMenuBar(final Frame frame) {
++ final MenuBar menuBar = new MenuBar();
++ frame.setMenuBar(menuBar);
++ return menuBar;
++ }
++
++ private static void checkHelpMenu(final Menu menu, final boolean expected) {
++ final boolean actual = menu.toString().contains("isHelpMenu=true");
++ if (actual != expected) {
++ throw new RuntimeException("Incorrect menu type");
++ }
++ }
++
++ private static void checkMenuCount(final MenuBar bar, final int expected) {
++ final int actual = bar.getMenuCount();
++ if (actual != expected) {
++ throw new RuntimeException("Incorrect menus count");
++ }
++ }
++
++ private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
++ if (bar.getHelpMenu() != menu) {
++ throw new RuntimeException("Wrong HelpMenu");
++ }
++ }
++
++ private static void test1(final MenuBar menuBar) {
++ checkCurrentMenu(menuBar, null);
++ checkMenuCount(menuBar, 0);
++ }
++
++ private static void test2(final MenuBar menuBar) {
++ final Menu helpMenu = new Menu("Help Menu");
++ menuBar.setHelpMenu(helpMenu);
++ checkCurrentMenu(menuBar, helpMenu);
++ checkMenuCount(menuBar, 1);
++ checkHelpMenu(helpMenu, true);
++
++ menuBar.remove(helpMenu);
++ checkCurrentMenu(menuBar, null);
++ checkMenuCount(menuBar, 0);
++ checkHelpMenu(helpMenu, false);
++ }
++
++ private static void test3(final MenuBar menuBar) {
++ final Menu helpMenu1 = new Menu("Help Menu1");
++ final Menu helpMenu2 = new Menu("Help Menu2");
++ menuBar.setHelpMenu(helpMenu1);
++ checkCurrentMenu(menuBar, helpMenu1);
++ checkMenuCount(menuBar, 1);
++ checkHelpMenu(helpMenu1, true);
++ checkHelpMenu(helpMenu2, false);
++
++ menuBar.setHelpMenu(helpMenu2);
++ checkCurrentMenu(menuBar, helpMenu2);
++ checkMenuCount(menuBar, 1);
++ checkHelpMenu(helpMenu1, false);
++ checkHelpMenu(helpMenu2, true);
++
++ menuBar.remove(helpMenu2);
++ checkCurrentMenu(menuBar, null);
++ checkMenuCount(menuBar, 0);
++ checkHelpMenu(helpMenu1, false);
++ checkHelpMenu(helpMenu2, false);
++ }
++
++ private static void test4(final MenuBar menuBar) {
++ final Menu helpMenu = new Menu("Help Menu");
++ menuBar.setHelpMenu(helpMenu);
++ checkCurrentMenu(menuBar, helpMenu);
++ checkMenuCount(menuBar, 1);
++ checkHelpMenu(helpMenu, true);
++
++ menuBar.setHelpMenu(null);
++ checkCurrentMenu(menuBar, null);
++ checkMenuCount(menuBar, 0);
++ checkHelpMenu(helpMenu, false);
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,103 @@
++/*
++ * 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.*;
++import java.awt.event.*;
++import javax.swing.*;
++/*
++ * @test
++ * @bug 8080137
++ * @summary Dragged events for extra mouse buttons (4,5,6) are not generated
++ * on JSplitPane
++ * @author alexandr.scherbatiy area=awt.event
++ * @run main MouseDraggedTest
++ */
++public class MouseDraggedTest {
++
++ private static JFrame frame;
++ private static Rectangle frameBounds;
++ private static volatile boolean mouseDragged;
++
++ public static void main(String[] args) throws Exception {
++ try {
++ Robot robot = new Robot();
++ robot.setAutoDelay(50);
++
++ SwingUtilities.invokeAndWait(MouseDraggedTest::createAndShowGUI);
++ robot.waitForIdle();
++
++ SwingUtilities.invokeAndWait(() -> frameBounds = frame.getBounds());
++ robot.waitForIdle();
++
++ for (int i = 1; i <= MouseInfo.getNumberOfButtons(); i++) {
++ testMouseDrag(i, robot);
++ }
++ } finally {
++ SwingUtilities.invokeLater(() -> {
++ if (frame != null) {
++ frame.dispose();
++ }
++ });
++ }
++ }
++
++ private static void testMouseDrag(int button, Robot robot) {
++
++ mouseDragged = false;
++ int x1 = frameBounds.x + frameBounds.width / 4;
++ int y1 = frameBounds.y + frameBounds.height / 4;
++ int x2 = frameBounds.x + frameBounds.width / 2;
++ int y2 = frameBounds.y + frameBounds.height / 2;
++
++ robot.mouseMove(x1, y1);
++ robot.waitForIdle();
++
++ int buttonMask = InputEvent.getMaskForButton(button);
++ robot.mousePress(buttonMask);
++ robot.mouseMove(x2, y2);
++ robot.mouseRelease(buttonMask);
++ robot.waitForIdle();
++
++ if (!mouseDragged) {
++ throw new RuntimeException("Mouse button " + button
++ + " is not dragged");
++ }
++ }
++
++ static void createAndShowGUI() {
++
++ frame = new JFrame();
++ frame.setSize(400, 400);
++ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
++ JPanel panel = new JPanel(new BorderLayout());
++ panel.addMouseMotionListener(new MouseAdapter() {
++
++ @Override
++ public void mouseDragged(MouseEvent e) {
++ mouseDragged = true;
++ }
++ });
++ frame.add(panel, BorderLayout.CENTER);
++ frame.setVisible(true);
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,94 @@
++/*
++ * 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 8061636
++ * @summary fix for 7079254 changes behavior of MouseListener, MouseMotionListener
++ * @library ../../regtesthelpers
++ * @build Util
++ * @author Alexander Zvegintsev
++ * @run main RemovedComponentMouseListener
++ */
++
++import java.awt.Robot;
++import java.awt.event.InputEvent;
++import java.awt.event.MouseAdapter;
++import java.awt.event.MouseEvent;
++import javax.swing.*;
++import test.java.awt.regtesthelpers.Util;
++
++public class RemovedComponentMouseListener extends JFrame {
++
++ static boolean mouseReleasedReceived;
++ static JButton button;
++
++ public RemovedComponentMouseListener() {
++ JPanel panel = new JPanel();
++ JPanel buttonPanel = new JPanel();
++ button = new JButton("Button");
++
++ setSize(300, 300);
++
++ buttonPanel.add(button);
++ panel.add(buttonPanel);
++ setContentPane(panel);
++
++ button.addMouseListener(new MouseAdapter() {
++ @Override
++ public void mousePressed(MouseEvent e) {
++ buttonPanel.remove(button);
++ panel.add(button);
++ button.revalidate();
++ button.repaint();
++ }
++
++ @Override
++ public void mouseReleased(MouseEvent e) {
++ mouseReleasedReceived = true;
++ }
++ });
++
++ setVisible(true);
++ }
++
++ public static void main(String[] args) throws Exception {
++ SwingUtilities.invokeAndWait(() -> {
++ new RemovedComponentMouseListener();
++ });
++
++ Robot r = Util.createRobot();
++ r.setAutoDelay(100);
++ r.waitForIdle();
++ Util.pointOnComp(button, r);
++
++ r.waitForIdle();
++ r.mousePress(InputEvent.BUTTON1_MASK);
++ r.waitForIdle();
++ r.mouseRelease(InputEvent.BUTTON1_MASK);
++ r.waitForIdle();
++ if (!mouseReleasedReceived) {
++ throw new RuntimeException("mouseReleased event was not received");
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Multiscreen/MultiScreenInsetsTest/MultiScreenInsetsTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,89 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/*
++ @test
++ @bug 8020443
++ @summary Frame is not created on the specified GraphicsDevice with two
++monitors
++ @author Oleg Pekhovskiy
++ @run main MultiScreenInsetsTest
++ */
++
++import java.awt.Frame;
++import java.awt.GraphicsConfiguration;
++import java.awt.GraphicsDevice;
++import java.awt.GraphicsEnvironment;
++import java.awt.Insets;
++import java.awt.Rectangle;
++import java.awt.Toolkit;
++import sun.awt.OSInfo;
++
++public class MultiScreenInsetsTest {
++ private static final int SIZE = 100;
++
++ public static void main(String[] args) throws InterruptedException {
++ OSInfo.OSType type = OSInfo.getOSType();
++ if (type != OSInfo.OSType.LINUX && type != OSInfo.OSType.SOLARIS) {
++ System.out.println("This test is for Solaris and Linux only..." +
++ "skipping!");
++ return;
++ }
++
++ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
++ GraphicsDevice[] gds = ge.getScreenDevices();
++ if (gds.length < 2) {
++ System.out.println("It's a multi-screen test... skipping!");
++ return;
++ }
++
++ for (int screen = 0; screen < gds.length; ++screen) {
++ GraphicsDevice gd = gds[screen];
++ GraphicsConfiguration gc = gd.getDefaultConfiguration();
++ Rectangle bounds = gc.getBounds();
++ Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
++
++ Frame frame = new Frame(gc);
++ frame.setLocation(bounds.x + (bounds.width - SIZE) / 2,
++ bounds.y + (bounds.height - SIZE) / 2);
++ frame.setSize(SIZE, SIZE);
++ frame.setUndecorated(true);
++ frame.setVisible(true);
++
++ // Maximize Frame to reach the struts
++ frame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
++ Thread.sleep(2000);
++
++ Rectangle frameBounds = frame.getBounds();
++ frame.dispose();
++ if (bounds.x + insets.left != frameBounds.x
++ || bounds.y + insets.top != frameBounds.y
++ || bounds.width - insets.right - insets.left != frameBounds.width
++ || bounds.height - insets.bottom - insets.top != frameBounds.height) {
++ throw new RuntimeException("Test FAILED! Wrong screen #" +
++ screen + " insets: " + insets);
++ }
++ }
++ System.out.println("Test PASSED!");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/ScrollPane/bug8077409Test.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,115 @@
++/*
++ * 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 8077409
++ @summary Drawing deviates when validate() is invoked on java.awt.ScrollPane
++ @author mikhail.cherkasov@oracle.com
++ @run main bug8077409Test
++*/
++
++
++import java.awt.*;
++import java.awt.event.*;
++
++public class bug8077409Test extends Frame {
++ ScrollPane pane;
++ MyCanvas myCanvas;
++
++ class MyCanvas extends Canvas {
++ public Dimension getPreferredSize() {
++ return new Dimension(400, 800);
++ }
++
++ public void paint(Graphics g) {
++ g.setColor(Color.BLACK);
++ g.drawLine(0, 0, 399, 0);
++ g.setColor(Color.RED);
++ g.drawLine(0, 1, 399, 1);
++ g.setColor(Color.BLUE);
++ g.drawLine(0, 2, 399, 2);
++ g.setColor(Color.GREEN);
++ g.drawLine(0, 3, 399, 3);
++ }
++
++ }
++
++ public bug8077409Test() {
++ super();
++ setLayout(new BorderLayout());
++ pane = new ScrollPane();
++
++ myCanvas = new MyCanvas();
++ pane.add(myCanvas);
++
++ add(pane, BorderLayout.CENTER);
++ setSize(320, 480);
++
++ }
++
++ @Override
++ protected void processKeyEvent(KeyEvent e) {
++ super.processKeyEvent(e);
++
++ }
++
++ public static void main(String[] args) throws AWTException, InterruptedException {
++ final bug8077409Test obj = new bug8077409Test();
++ obj.setVisible(true);
++ Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
++ @Override
++ public void eventDispatched(AWTEvent e) {
++ KeyEvent keyEvent = (KeyEvent) e;
++ if(keyEvent.getID() == KeyEvent.KEY_RELEASED) {
++ if (keyEvent.getKeyCode() == KeyEvent.VK_1) {
++ System.out.println(obj.pane.toString());
++ System.out.println("obj.myCanvas.pos: " + obj.myCanvas.getBounds());
++ System.out.println(obj.myCanvas.toString());
++ } else if (keyEvent.getKeyCode() == KeyEvent.VK_2) {
++ obj.repaint();
++ } else if (keyEvent.getKeyCode() == KeyEvent.VK_DOWN) {
++ Point scrollPosition = obj.pane.getScrollPosition();
++ scrollPosition.translate(0, 1);
++ obj.pane.setScrollPosition(scrollPosition);
++ } else if (keyEvent.getKeyCode() == KeyEvent.VK_UP) {
++ Point scrollPosition = obj.pane.getScrollPosition();
++ scrollPosition.translate(0, -1);
++ obj.pane.setScrollPosition(scrollPosition);
++ } else if (keyEvent.getKeyCode() == KeyEvent.VK_SPACE) {
++ obj.pane.validate();
++ }
++ }
++ }
++ }, AWTEvent.KEY_EVENT_MASK);
++ Point scrollPosition = obj.pane.getScrollPosition();
++ scrollPosition.translate(0, 1);
++ obj.pane.setScrollPosition(scrollPosition);
++
++ int y = obj.pane.getComponent(0).getLocation().y;
++ obj.pane.validate();
++ if(y != obj.pane.getComponent(0).getLocation().y){
++ throw new RuntimeException("Wrong position of component in ScrollPane");
++ }
++ }
++
++}
+\ No newline at end of file
+--- ./jdk/test/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -23,21 +23,24 @@
+
+ import java.awt.Color;
+ import java.awt.Dialog;
++import java.awt.Frame;
+ import java.awt.Graphics;
+ import java.awt.Graphics2D;
+ import java.awt.Panel;
+ import java.awt.Rectangle;
+ import java.awt.Robot;
+ import java.awt.SplashScreen;
++import java.awt.TextField;
+ import java.awt.Window;
++import java.awt.event.KeyEvent;
+ import java.awt.image.BufferedImage;
+ import java.io.File;
+ import javax.imageio.ImageIO;
+ import sun.java2d.SunGraphics2D;
+
+ /**
+- * test
+- * @bug 8043869
++ * @test
++ * @bug 8043869 8075244 8078082
+ * @author Alexander Scherbatiy
+ * @summary [macosx] java -splash does not honor 2x hi dpi notation for retina
+ * support
+@@ -45,6 +48,7 @@
+ * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_SPLASH 0
+ * @run main/othervm -splash:splash2 MultiResolutionSplashTest TEST_SPLASH 1
+ * @run main/othervm -splash:splash3. MultiResolutionSplashTest TEST_SPLASH 2
++ * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_FOCUS
+ */
+ public class MultiResolutionSplashTest {
+
+@@ -69,6 +73,9 @@
+ int index = Integer.parseInt(args[1]);
+ testSplash(tests[index]);
+ break;
++ case "TEST_FOCUS":
++ testFocus();
++ break;
+ default:
+ throw new RuntimeException("Unknown test: " + test);
+ }
+@@ -92,12 +99,50 @@
+ float scaleFactor = getScaleFactor();
+ Color testColor = (1 < scaleFactor) ? test.color2x : test.color1x;
+
+- if (!testColor.equals(splashScreenColor)) {
++ if (!compare(testColor, splashScreenColor)) {
+ throw new RuntimeException(
+ "Image with wrong resolution is used for splash screen!");
+ }
+ }
+
++ static void testFocus() throws Exception {
++
++ System.out.println("Focus Test!");
++ Robot robot = new Robot();
++ robot.setAutoDelay(50);
++
++ Frame frame = new Frame();
++ frame.setSize(100, 100);
++ String test = "123";
++ TextField textField = new TextField(test);
++ textField.selectAll();
++ frame.add(textField);
++ frame.setVisible(true);
++ robot.waitForIdle();
++
++ robot.keyPress(KeyEvent.VK_A);
++ robot.keyRelease(KeyEvent.VK_A);
++ robot.keyPress(KeyEvent.VK_B);
++ robot.keyRelease(KeyEvent.VK_B);
++ robot.waitForIdle();
++
++ frame.dispose();
++
++ if(!textField.getText().equals("ab")){
++ throw new RuntimeException("Focus is lost!");
++ }
++ }
++
++ static boolean compare(Color c1, Color c2){
++ return compare(c1.getRed(), c2.getRed())
++ && compare(c1.getGreen(), c2.getGreen())
++ && compare(c1.getBlue(), c2.getBlue());
++ }
++
++ static boolean compare(int n, int m){
++ return Math.abs(n - m) <= 50;
++ }
++
+ static float getScaleFactor() {
+
+ final Dialog dialog = new Dialog((Window) null);
+--- ./jdk/test/java/awt/Toolkit/BadDisplayTest/BadDisplayTest.sh Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/awt/Toolkit/BadDisplayTest/BadDisplayTest.sh Wed Jul 01 21:53:30 2015 -0700
+@@ -1,4 +1,4 @@
+-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++# 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
+@@ -21,23 +21,15 @@
+
+ ${TESTJAVA}/bin/javac -cp ${TESTSRC} -d . ${TESTSRC}/BadDisplayTest.java
+
++OS=`uname -s`
++case "$OS" in
++ Windows* | CYGWIN* | Darwin)
++ echo "Passed"; exit 0 ;;
++esac
+
+-DISPLAY=
++DISPLAY=SomeBadDisplay
+ export DISPLAY
+
+-OS=`uname -s`
+-case "$OS" in
+- SunOS )
+- ${TESTJAVA}/bin/java BadDisplayTest
+- ;;
+- Linux )
+- ${TESTJAVA}/bin/java BadDisplayTest
+- ;;
+- * )
+- echo "Unsupported System: ${OS}"
+- exit 0;
+- ;;
+-esac
++${TESTJAVA}/bin/java ${TESTVMOPTS} BadDisplayTest
+
+ exit $?
+-
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/Toolkit/GetImage/bug8078165.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,50 @@
++/*
++ * 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.*;
++import java.net.URL;
++import java.security.Permission;
++
++
++/**
++ * @test
++ * @bug 8078165
++ * @summary NPE when attempting to get image from toolkit
++ * @author Anton Nashatyrev
++ */
++public final class bug8078165 {
++
++ public static void main(final String[] args) throws Exception {
++ // Mac only
++ System.setSecurityManager(new SecurityManager() {
++ @Override
++ public void checkPermission(Permission permission) {
++ // Just allows everything
++ }
++ });
++ // The method shouldn't throw NPE
++ Toolkit.getDefaultToolkit().getImage(new URL("file://./dummyImage@2x.png"));
++ Toolkit.getDefaultToolkit().getImage("./dummyImage@2x.png");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/TrayIcon/8072769/bug8072769.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,150 @@
++/*
++ * 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 8072769
++ @summary System tray icon title freezes java
++ @author Semyon Sadetsky
++ @library ../../../../lib/testlibrary
++ @build jdk.testlibrary.OSInfo
++ @run main bug8072769
++ */
++
++import jdk.testlibrary.OSInfo;
++
++import javax.swing.*;
++import java.awt.*;
++import java.util.Arrays;
++
++public class bug8072769 {
++
++ public static void main(String[] args) throws Exception {
++ if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS) {
++ if (SystemTray.isSupported()) {
++ test();
++ } else {
++ System.out.println("SystemTray not supported. " +
++ "Test is skipped.");
++ }
++ } else {
++ System.out.println("Test will only run on Windows platform. " +
++ "Test is skipped.");
++ }
++ System.out.println("ok");
++ }
++
++ private static void test() throws Exception {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ public void run() {
++ final SystemTray tray = SystemTray.getSystemTray();
++ final TrayIcon trayIcon = new TrayIcon(icon.getImage());
++ try {
++ tray.add(trayIcon);
++ } catch (AWTException e) {
++ throw new RuntimeException(
++ "TrayIcon could not be added.");
++ }
++
++
++ try {
++ trayIcon.displayMessage(createString(63, 'A'),
++ createString(255, 'C'), TrayIcon.MessageType.ERROR);
++
++ trayIcon.setToolTip(createString(127, 'B'));
++
++ trayIcon.displayMessage(createString(64, 'A'),
++ createString(256, 'C'), TrayIcon.MessageType.ERROR);
++
++ trayIcon.setToolTip(createString(128, 'B'));
++
++ trayIcon.displayMessage(createString(65, 'A'),
++ createString(257, 'C'), TrayIcon.MessageType.ERROR);
++
++ trayIcon.setToolTip(createString(129, 'B'));
++ }
++ finally {
++ tray.remove(trayIcon);
++ }
++ }
++ });
++ }
++
++ private static String createString(int len, char letter) {
++ char[] chars = new char[len];
++ Arrays.fill(chars, letter);
++ chars[len - 2] = '=';
++ chars[len - 1] = '>';
++ return new String(chars);
++ }
++
++ private static ImageIcon icon = new ImageIcon(
++ new byte[]{71, 73, 70, 56, 57, 97, 32, 0, 35, 0, -43, 0, 0, -1, -1,
++ -1, -19, -101, 9, -18, -95, 24, -14, -76, 71, -4, -19, -46,
++ -3, -13, -31, -17, -88, 40, -12, -63, 102, -10, -51, -124,
++ -16, -82, 55, -11, -57, 117, -2, -7, -15, -7, -32, -77, -9,
++ -45, -108, -5, -26, -62, -13, -70, 86, -8, -39, -94, 83,
++ -126, -95, -8, -38, -93, -6, -26, -63, -9, -45, -109, -4,
++ -14, -32, -15, -76, 70, -12, -58, 116, -17, -89, 39, 77,
++ 121, -106, -3, -8, -17, 104, -111, -84, 126, -95, -72, 93,
++ -119, -90, -14, -70, 85, -13, -64, 101, -16, -83, 55, -109,
++ -80, -60, -7, -33, -78, -100, -84, -85, 94, -127, -104, -32,
++ -99, 39, 127, -120, -114, 83, 113, -124, -12, -9, -7, -16,
++ -16, -16, -115, 108, 45, 57, 89, 110, -50, -41, -35, 104,
++ -111, -83, 41, 65, 80, 72, 113, -116, 115, -103, -78, 88,
++ 106, 112, -82, -78, -82, -45, -38, -40, -5, -20, -48, -65,
++ -48, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, -7, 4, 0, 0, 0,
++ 0, 0, 44, 0, 0, 0, 0, 32, 0, 35, 0, 0, 6, -1, 64, -128, 112,
++ 72, 4, 16, 0, 14, -57, 2, 1, 96, 30, -117, -48, 40, -78,
++ -55, 96, 28, 28, -125, -62, 0, 96, 48, 74, -91, -116, 102,
++ 3, 97, 64, 4, 20, -25, -128, 68, -80, 16, 24, 11, 95, 98,
++ -29, -64, 72, 11, 2, 120, -68, 96, -64, 39, 116, -29, 0, 12,
++ 13, 5, 1, 3, 121, -121, -120, 9, 2, 7, 5, 15, 82, 11, 11,
++ 92, 15, 6, -120, -107, -121, 7, 2, 18, 0, 112, 80, 3, 8,
++ 104, -106, -95, 122, 88, 97, 68, 5, 11, 4, -95, 32, 8, 16,
++ 19, 16, 8, 22, -106, -114, 79, 66, 5, 2, 15, 9, -120, 22,
++ 19, 81, 21, 31, -120, 7, 6, 10, 67, 71, 4, 119, -121, 20,
++ -128, 16, -57, 120, 7, -101, -111, -58, 9, -108, 121, -55,
++ -128, 0, 16, 121, 123, -117, 67, 5, -71, 121, 30, -42, 67,
++ 23, -121, 13, 66, 14, 6, 3, -34, 120, 21, -31, 66, 26, -39,
++ 3, 6, -50, 11, -96, 120, 31, -19, 67, 30, 121, 9, 14, 0, 13,
++ 124, -121, 68, -32, 19, 98, 6, 15, 58, 71, 18, 12, -27, 97,
++ 55, 80, 68, 54, 5, 5, 24, 40, 80, 23, 96, -96, -112, 9, -39,
++ 30, 52, -112, 72, -47, 34, 0, 10, 25, -53, 37, 60, -60, 16,
++ -33, 56, 61, 16, -1, 41, -60, 83, 13, 31, -122, 60, 7, 1,
++ -48, 59, -124, 65, 3, 62, -116, 48, -5, 57, 72, -112, -18,
++ -48, 5, -103, 124, 32, -32, 37, 112, -74, -119, 98, 0, 8,
++ -31, 64, -110, 35, 38, 64, 26, 34, -92, 113, 42, 48, -45,
++ 70, -76, 24, -77, 60, 80, -91, -60, -70, -12, 76, -120, 49,
++ 92, -120, 4, -40, -116, -126, 51, 79, -80, 97, -36, 80, 89,
++ -6, 25, -91, 96, -98, 89, -99, 62, 33, -62, 32, -59, -83, 0,
++ 82, 80, 32, 1, -72, 53, 13, -113, -42, 102, -103, 54, -127,
++ 25, 84, 40, 15, -115, 40, 37, 20, 49, 34, 26, 103, 78, 29,
++ 52, 42, 88, 16, 65, 17, -94, -49, 31, 107, 97, 16, -116, 49,
++ 32, 35, -61, 6, 14, 33, 56, 68, -120, -80, -96, 11, 1, 78,
++ -31, -6, 33, 96, 48, -93, -61, -122, 21, 46, 50, -116, -10,
++ -30, -47, -117, -125, 24, 29, 94, -100, -112, 61, -94, 54,
++ -108, 20, 38, 90, -112, -128, 81, -61, 90, 16, 0, 59},
++ "try icon");
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,172 @@
++/*
++ * 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 sun.awt.image.MultiResolutionToolkitImage;
++import sun.java2d.SunGraphics2D;
++
++import javax.swing.*;
++import java.awt.*;
++import java.awt.image.BufferedImage;
++
++import static java.awt.event.InputEvent.BUTTON1_DOWN_MASK;
++
++/**
++ * @test
++ * @bug 8076106
++ * @author Hendrik Schreiber
++ * @summary [macosx] Drag image of TransferHandler does not honor
++ * MultiResolutionImage
++ * @run main MultiResolutionDragImageTest TEST_DRAG
++ */
++public class MultiResolutionDragImageTest {
++
++ private static final Color COLOR_1X = Color.BLUE;
++ private static final Color COLOR_2X = Color.RED;
++ private static JFrame frame;
++ private static JTextField field;
++ private static Point p;
++
++ public static void main(String[] args) throws Exception {
++
++ final String test = args[0];
++
++ switch (test) {
++ case "TEST_DRAG":
++ testDrag();
++ break;
++ default:
++ throw new RuntimeException("Unknown test: " + test);
++ }
++ }
++
++ private static void testDrag() throws Exception {
++
++
++ SwingUtilities.invokeAndWait(() -> {
++
++ frame = new JFrame();
++ field = new JTextField("Drag Me");
++ setupFrame(frame, field);
++ frame.setVisible(true);
++ });
++
++ final Robot robot = new Robot();
++ robot.setAutoDelay(500);
++ robot.setAutoWaitForIdle(true);
++ robot.waitForIdle();
++
++ // get mouse into position
++ SwingUtilities.invokeAndWait(() -> {
++
++ p = new Point(field.getWidth() / 2, field.getHeight() / 2);
++ SwingUtilities.convertPointToScreen(p, field);
++ });
++
++ robot.mouseMove(p.x, p.y);
++ // simulate dragging
++ robot.mousePress(BUTTON1_DOWN_MASK);
++ p.translate(10, 10);
++ robot.mouseMove(p.x, p.y);
++
++ p.translate(5, 5);
++ final Color color = robot.getPixelColor(p.x, p.y);
++ robot.mouseRelease(BUTTON1_DOWN_MASK);
++
++ SwingUtilities.invokeAndWait(frame::dispose);
++
++ final float scaleFactor = getScaleFactor();
++ final Color testColor = (1 < scaleFactor) ? COLOR_2X : COLOR_1X;
++
++ if (!similar(testColor, color)) {
++ throw new RuntimeException(
++ "TEST FAILED: Image with wrong resolution is used for drag image!");
++ }
++ System.out.println("TEST PASSED!");
++ }
++
++ private static void setupFrame(final JFrame frame, final JTextField field) {
++
++ frame.setBounds(0, 0, 50, 50);
++ frame.setLayout(new BorderLayout());
++ field.setDragEnabled(true);
++ final TransferHandler transferHandler = field.getTransferHandler();
++ transferHandler.setDragImage(createMultiResolutionImage());
++ frame.getContentPane().add(field, BorderLayout.CENTER);
++ }
++
++ private static boolean similar(Color c1, Color c2){
++ return similar(c1.getRed(), c2.getRed())
++ && similar(c1.getGreen(), c2.getGreen())
++ && similar(c1.getBlue(), c2.getBlue());
++ }
++
++ private static boolean similar(int n, int m){
++ return Math.abs(n - m) <= 80;
++ }
++
++ private static float getScaleFactor() {
++
++ final Dialog dialog = new Dialog((Window) null);
++ dialog.setSize(100, 100);
++ dialog.setModal(true);
++ final float[] scaleFactors = new float[1];
++ Panel panel = new Panel() {
++
++ @Override
++ public void paint(Graphics g) {
++ float scaleFactor = 1;
++ if (g instanceof SunGraphics2D) {
++ scaleFactor = ((SunGraphics2D) g).surfaceData.getDefaultScale();
++ }
++ scaleFactors[0] = scaleFactor;
++ dialog.setVisible(false);
++ }
++ };
++
++ dialog.add(panel);
++ dialog.setVisible(true);
++ dialog.dispose();
++
++ return scaleFactors[0];
++ }
++
++ private static Image createMultiResolutionImage() {
++
++ return new MultiResolutionToolkitImage(
++ createImage(50, COLOR_1X),
++ createImage(100, COLOR_2X)
++ );
++
++ }
++
++ private static Image createImage(final int length, final Color color) {
++
++ final BufferedImage image = new BufferedImage(length, length,
++ BufferedImage.TYPE_INT_ARGB_PRE);
++ final Graphics graphics = image.getGraphics();
++ graphics.setColor(color);
++ graphics.fillRect(0, 0, length, length);
++ graphics.dispose();
++ return image;
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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.
++ */
++
++/* @test
++ @bug 8041470
++ @summary JButtons stay pressed after they have lost focus if you use the mouse wheel
++ @author Anton Nashatyrev
++*/
++import javax.swing.*;
++import java.awt.*;
++import java.awt.event.*;
++import java.util.concurrent.CountDownLatch;
++
++public class WheelModifier {
++
++ JFrame f;
++ JButton fb;
++
++ CountDownLatch pressSema = new CountDownLatch(1);
++ CountDownLatch exitSema = new CountDownLatch(1);
++ CountDownLatch releaseSema = new CountDownLatch(1);
++ volatile CountDownLatch wheelSema;
++
++ void createGui() {
++ f = new JFrame("frame");
++ fb = new JButton("frame_button");
++ fb.addMouseListener(new MouseAdapter() {
++ @Override
++ public void mouseReleased(MouseEvent e) {
++ System.out.println("WheelModifier.mouseReleased: " + e);
++ releaseSema.countDown();
++ }
++
++ @Override
++ public void mouseEntered(MouseEvent e) {
++ System.out.println("WheelModifier.mouseEntered: " + e);
++
++ }
++
++ @Override
++ public void mouseExited(MouseEvent e) {
++ System.out.println("WheelModifier.mouseExited: " + e);
++ exitSema.countDown();
++ }
++
++ @Override
++ public void mousePressed(MouseEvent e) {
++ System.out.println("WheelModifier.mousePressed: " + e);
++ pressSema.countDown();
++ }
++
++ @Override
++ public void mouseDragged(MouseEvent e) {
++ System.out.println("WheelModifier.mouseDragged: " + e);
++ }
++ });
++
++ Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
++ @Override
++ public void eventDispatched(AWTEvent event) {
++ System.out.println("WheelModifier.mouseWheel: " + event);
++ wheelSema.countDown();
++ }
++ }, MouseEvent.MOUSE_WHEEL_EVENT_MASK);
++
++ f.setLayout(new FlowLayout());
++ f.add(fb);
++ f.setSize(200, 200);
++ f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
++ f.setVisible(true);
++ }
++
++ void run() throws Exception {
++ Robot r = new Robot();
++ r.waitForIdle();
++ System.out.println("# Started");
++
++ Point sLoc = fb.getLocationOnScreen();
++ Dimension bSize = fb.getSize();
++ r.mouseMove(sLoc.x + bSize.width / 2, sLoc.y + bSize.height / 2);
++ r.mousePress(MouseEvent.BUTTON1_MASK);
++ pressSema.await();
++ System.out.println("# Pressed");
++
++ r.mouseMove(sLoc.x + bSize.width / 2, sLoc.y + bSize.height * 2);
++ exitSema.await();
++ System.out.println("# Exited");
++
++ wheelSema = new CountDownLatch(1);
++ r.mouseWheel(1);
++ wheelSema.await();
++ System.out.println("# Wheeled 1");
++
++ wheelSema = new CountDownLatch(1);
++ r.mouseWheel(-1);
++ wheelSema.await();
++ System.out.println("# Wheeled 2");
++
++ r.mouseRelease(MouseEvent.BUTTON1_MASK);
++ releaseSema.await();
++ System.out.println("# Released!");
++ }
++
++ public static void main(String[] args) throws Exception {
++ WheelModifier test = new WheelModifier();
++
++ SwingUtilities.invokeAndWait(() -> test.createGui());
++ test.run();
++
++ System.out.println("Done.");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/geom/Path2D/Path2DCopyConstructor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,537 @@
++/*
++ * 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.Rectangle;
++import java.awt.geom.AffineTransform;
++import java.awt.geom.GeneralPath;
++import java.awt.geom.IllegalPathStateException;
++import java.awt.geom.Path2D;
++import java.awt.geom.PathIterator;
++import java.awt.geom.Point2D;
++import java.awt.geom.Rectangle2D;
++import java.util.Arrays;
++
++/**
++ * @test
++ * @bug 8076419
++ * @summary Check Path2D copy constructor (trims arrays)
++ * and constructor with zero capacity
++ * @run main Path2DCopyConstructor
++ */
++public class Path2DCopyConstructor {
++
++ private final static float EPSILON = 5e-6f;
++ private final static float FLATNESS = 1e-2f;
++
++ private final static AffineTransform at
++ = AffineTransform.getScaleInstance(1.3, 2.4);
++
++ private final static Rectangle2D.Double rect2d
++ = new Rectangle2D.Double(3.2, 4.1, 5.0, 10.0);
++
++ private final static Point2D.Double pt2d
++ = new Point2D.Double(2.0, 2.5);
++
++ public static boolean verbose;
++
++ static void log(String msg) {
++ if (verbose) {
++ System.out.println(msg);
++ }
++ }
++
++ public static void main(String argv[]) {
++ verbose = (argv.length != 0);
++
++ testEmptyDoublePaths();
++ testDoublePaths();
++
++ testEmptyFloatPaths();
++ testFloatPaths();
++
++ testEmptyGeneralPath();
++ testGeneralPath();
++ }
++
++ static void testEmptyDoublePaths() {
++ log("\n - Test(Path2D.Double[0]) ---");
++ test(() -> new Path2D.Double(Path2D.WIND_NON_ZERO, 0));
++ }
++
++ static void testDoublePaths() {
++ log("\n - Test(Path2D.Double) ---");
++ test(() -> new Path2D.Double());
++ }
++
++ static void testEmptyFloatPaths() {
++ log("\n - Test(Path2D.Float[0]) ---");
++ test(() -> new Path2D.Float(Path2D.WIND_NON_ZERO, 0));
++ }
++
++ static void testFloatPaths() {
++ log("\n - Test(Path2D.Float) ---");
++ test(() -> new Path2D.Float());
++ }
++
++ static void testEmptyGeneralPath() {
++ log("\n - Test(GeneralPath[0]) ---");
++ test(() -> new GeneralPath(Path2D.WIND_NON_ZERO, 0));
++ }
++
++ static void testGeneralPath() {
++ log("\n - Test(GeneralPath) ---");
++ test(() -> new GeneralPath());
++ }
++
++ interface PathFactory {
++ Path2D makePath();
++ }
++
++ static void test(PathFactory pf) {
++ log("\n --- test: path(empty) ---");
++ test(pf.makePath(), true);
++ log("\n\n --- test: path(addMove) ---");
++ test(addMove(pf.makePath()), false);
++ log("\n\n --- test: path(addMoveAndLines) ---");
++ test(addMoveAndLines(pf.makePath()), false);
++ log("\n\n --- test: path(addMoveAndQuads) ---");
++ test(addMoveAndQuads(pf.makePath()), false);
++ log("\n\n --- test: path(addMoveAndCubics) ---");
++ test(addMoveAndCubics(pf.makePath()), false);
++ log("\n\n --- test: path(addMoveAndClose) ---");
++ test(addMoveAndClose(pf.makePath()), false);
++ }
++
++ static Path2D addMove(Path2D p2d) {
++ p2d.moveTo(1.0, 0.5);
++ return p2d;
++ }
++
++ static Path2D addMoveAndLines(Path2D p2d) {
++ addMove(p2d);
++ addLines(p2d);
++ return p2d;
++ }
++
++ static Path2D addLines(Path2D p2d) {
++ for (int i = 0; i < 10; i++) {
++ p2d.lineTo(1.1 * i, 2.3 * i);
++ }
++ return p2d;
++ }
++
++ static Path2D addMoveAndCubics(Path2D p2d) {
++ addMove(p2d);
++ addCubics(p2d);
++ return p2d;
++ }
++
++ static Path2D addCubics(Path2D p2d) {
++ for (int i = 0; i < 10; i++) {
++ p2d.curveTo(1.1 * i, 1.2 * i, 1.3 * i, 1.4 * i, 1.5 * i, 1.6 * i);
++ }
++ return p2d;
++ }
++
++ static Path2D addMoveAndQuads(Path2D p2d) {
++ addMove(p2d);
++ addQuads(p2d);
++ return p2d;
++ }
++
++ static Path2D addQuads(Path2D p2d) {
++ for (int i = 0; i < 10; i++) {
++ p2d.quadTo(1.1 * i, 1.2 * i, 1.3 * i, 1.4 * i);
++ }
++ return p2d;
++ }
++
++ static Path2D addMoveAndClose(Path2D p2d) {
++ addMove(p2d);
++ addClose(p2d);
++ return p2d;
++ }
++
++ static Path2D addClose(Path2D p2d) {
++ p2d.closePath();
++ return p2d;
++ }
++
++ static void test(Path2D p2d, boolean isEmpty) {
++ testEqual(new Path2D.Float(p2d), p2d);
++ testEqual(new Path2D.Double(p2d), p2d);
++ testEqual(new GeneralPath(p2d), p2d);
++
++ testIterator(new Path2D.Float(p2d), p2d);
++ testIterator(new Path2D.Double(p2d), p2d);
++ testIterator((Path2D) p2d.clone(), p2d);
++
++ testFlattening(new Path2D.Float(p2d), p2d);
++ testFlattening(new Path2D.Double(p2d), p2d);
++ testFlattening((Path2D) p2d.clone(), p2d);
++
++ testAddMove(new Path2D.Float(p2d));
++ testAddMove(new Path2D.Double(p2d));
++ testAddMove((Path2D) p2d.clone());
++
++ // These should expect exception if empty
++ testAddLine(new Path2D.Float(p2d), isEmpty);
++ testAddLine(new Path2D.Double(p2d), isEmpty);
++ testAddLine((Path2D) p2d.clone(), isEmpty);
++
++ testAddQuad(new Path2D.Float(p2d), isEmpty);
++ testAddQuad(new Path2D.Double(p2d), isEmpty);
++ testAddQuad((Path2D) p2d.clone(), isEmpty);
++
++ testAddCubic(new Path2D.Float(p2d), isEmpty);
++ testAddCubic(new Path2D.Double(p2d), isEmpty);
++ testAddCubic((Path2D) p2d.clone(), isEmpty);
++
++ testAddClose(new Path2D.Float(p2d), isEmpty);
++ testAddClose(new Path2D.Double(p2d), isEmpty);
++ testAddClose((Path2D) p2d.clone(), isEmpty);
++
++ testGetBounds(new Path2D.Float(p2d), p2d);
++ testGetBounds(new Path2D.Double(p2d), p2d);
++ testGetBounds((Path2D) p2d.clone(), p2d);
++
++ testTransform(new Path2D.Float(p2d));
++ testTransform(new Path2D.Double(p2d));
++ testTransform((Path2D) p2d.clone());
++
++ testIntersect(new Path2D.Float(p2d), p2d);
++ testIntersect(new Path2D.Double(p2d), p2d);
++ testIntersect((Path2D) p2d.clone(), p2d);
++
++ testContains(new Path2D.Float(p2d), p2d);
++ testContains(new Path2D.Double(p2d), p2d);
++ testContains((Path2D) p2d.clone(), p2d);
++
++ testGetCurrentPoint(new Path2D.Float(p2d), p2d);
++ testGetCurrentPoint(new Path2D.Double(p2d), p2d);
++ testGetCurrentPoint((Path2D) p2d.clone(), p2d);
++ }
++
++ static void testEqual(Path2D pathA, Path2D pathB) {
++ final PathIterator itA = pathA.getPathIterator(null);
++ final PathIterator itB = pathB.getPathIterator(null);
++
++ float[] coordsA = new float[6];
++ float[] coordsB = new float[6];
++
++ int n = 0;
++ for (; !itA.isDone() && !itB.isDone(); itA.next(), itB.next(), n++) {
++ int typeA = itA.currentSegment(coordsA);
++ int typeB = itB.currentSegment(coordsB);
++
++ if (typeA != typeB) {
++ throw new IllegalStateException("Path-segment[" + n + "] "
++ + " type are not equals [" + typeA + "|" + typeB + "] !");
++ }
++ if (!equalsArray(coordsA, coordsB, getLength(typeA))) {
++ throw new IllegalStateException("Path-segment[" + n + "] coords"
++ + " are not equals [" + Arrays.toString(coordsA) + "|"
++ + Arrays.toString(coordsB) + "] !");
++ }
++ }
++ if (!itA.isDone() || !itB.isDone()) {
++ throw new IllegalStateException("Paths do not have same lengths !");
++ }
++ log("testEqual: " + n + " segments.");
++ }
++
++ static void testIterator(Path2D pathA, Path2D pathB) {
++ final PathIterator itA = pathA.getPathIterator(at);
++ final PathIterator itB = pathB.getPathIterator(at);
++
++ float[] coordsA = new float[6];
++ float[] coordsB = new float[6];
++
++ int n = 0;
++ for (; !itA.isDone() && !itB.isDone(); itA.next(), itB.next(), n++) {
++ int typeA = itA.currentSegment(coordsA);
++ int typeB = itB.currentSegment(coordsB);
++
++ if (typeA != typeB) {
++ throw new IllegalStateException("Path-segment[" + n + "] "
++ + "type are not equals [" + typeA + "|" + typeB + "] !");
++ }
++ // Take care of floating-point precision:
++ if (!equalsArrayEps(coordsA, coordsB, getLength(typeA))) {
++ throw new IllegalStateException("Path-segment[" + n + "] coords"
++ + " are not equals [" + Arrays.toString(coordsA) + "|"
++ + Arrays.toString(coordsB) + "] !");
++ }
++ }
++ if (!itA.isDone() || !itB.isDone()) {
++ throw new IllegalStateException("Paths do not have same lengths !");
++ }
++ log("testIterator: " + n + " segments.");
++ }
++
++ static void testFlattening(Path2D pathA, Path2D pathB) {
++ final PathIterator itA = pathA.getPathIterator(at, FLATNESS);
++ final PathIterator itB = pathB.getPathIterator(at, FLATNESS);
++
++ float[] coordsA = new float[6];
++ float[] coordsB = new float[6];
++
++ int n = 0;
++ for (; !itA.isDone() && !itB.isDone(); itA.next(), itB.next(), n++) {
++ int typeA = itA.currentSegment(coordsA);
++ int typeB = itB.currentSegment(coordsB);
++
++ if (typeA != typeB) {
++ throw new IllegalStateException("Path-segment[" + n + "] "
++ + "type are not equals [" + typeA + "|" + typeB + "] !");
++ }
++ // Take care of floating-point precision:
++ if (!equalsArrayEps(coordsA, coordsB, getLength(typeA))) {
++ throw new IllegalStateException("Path-segment[" + n + "] coords"
++ + " are not equals [" + Arrays.toString(coordsA) + "|"
++ + Arrays.toString(coordsB) + "] !");
++ }
++ }
++ if (!itA.isDone() || !itB.isDone()) {
++ throw new IllegalStateException("Paths do not have same lengths !");
++ }
++ log("testFlattening: " + n + " segments.");
++ }
++
++ static void testAddMove(Path2D pathA) {
++ addMove(pathA);
++ log("testAddMove: passed.");
++ }
++
++ static void testAddLine(Path2D pathA, boolean isEmpty) {
++ try {
++ addLines(pathA);
++ }
++ catch (IllegalPathStateException ipse) {
++ if (isEmpty) {
++ log("testAddLine: passed "
++ + "(expected IllegalPathStateException catched).");
++ return;
++ } else {
++ throw ipse;
++ }
++ }
++ if (isEmpty) {
++ throw new IllegalStateException("IllegalPathStateException not thrown !");
++ }
++ log("testAddLine: passed.");
++ }
++
++ static void testAddQuad(Path2D pathA, boolean isEmpty) {
++ try {
++ addQuads(pathA);
++ }
++ catch (IllegalPathStateException ipse) {
++ if (isEmpty) {
++ log("testAddQuad: passed "
++ + "(expected IllegalPathStateException catched).");
++ return;
++ } else {
++ throw ipse;
++ }
++ }
++ if (isEmpty) {
++ throw new IllegalStateException("IllegalPathStateException not thrown !");
++ }
++ log("testAddQuad: passed.");
++ }
++
++ static void testAddCubic(Path2D pathA, boolean isEmpty) {
++ try {
++ addCubics(pathA);
++ }
++ catch (IllegalPathStateException ipse) {
++ if (isEmpty) {
++ log("testAddCubic: passed "
++ + "(expected IllegalPathStateException catched).");
++ return;
++ } else {
++ throw ipse;
++ }
++ }
++ if (isEmpty) {
++ throw new IllegalStateException("IllegalPathStateException not thrown !");
++ }
++ log("testAddCubic: passed.");
++ }
++
++ static void testAddClose(Path2D pathA, boolean isEmpty) {
++ try {
++ addClose(pathA);
++ }
++ catch (IllegalPathStateException ipse) {
++ if (isEmpty) {
++ log("testAddClose: passed "
++ + "(expected IllegalPathStateException catched).");
++ return;
++ } else {
++ throw ipse;
++ }
++ }
++ if (isEmpty) {
++ throw new IllegalStateException("IllegalPathStateException not thrown !");
++ }
++ log("testAddClose: passed.");
++ }
++
++ static void testGetBounds(Path2D pathA, Path2D pathB) {
++ final Rectangle rA = pathA.getBounds();
++ final Rectangle rB = pathB.getBounds();
++
++ if (!rA.equals(rB)) {
++ throw new IllegalStateException("Bounds are not equals [" + rA
++ + "|" + rB + "] !");
++ }
++ final Rectangle2D r2dA = pathA.getBounds2D();
++ final Rectangle2D r2dB = pathB.getBounds2D();
++
++ if (!equalsRectangle2D(r2dA, r2dB)) {
++ throw new IllegalStateException("Bounds2D are not equals ["
++ + r2dA + "|" + r2dB + "] !");
++ }
++ log("testGetBounds: passed.");
++ }
++
++ static void testTransform(Path2D pathA) {
++ pathA.transform(at);
++ log("testTransform: passed.");
++ }
++
++ static void testIntersect(Path2D pathA, Path2D pathB) {
++ boolean resA = pathA.intersects(rect2d);
++ boolean resB = pathB.intersects(rect2d);
++ if (resA != resB) {
++ throw new IllegalStateException("Intersects(rect2d) are not equals ["
++ + resA + "|" + resB + "] !");
++ }
++ resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
++ resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
++ if (resA != resB) {
++ throw new IllegalStateException("Intersects(doubles) are not equals ["
++ + resA + "|" + resB + "] !");
++ }
++ log("testIntersect: passed.");
++ }
++
++ static void testContains(Path2D pathA, Path2D pathB) {
++ boolean resA = pathA.contains(pt2d);
++ boolean resB = pathB.contains(pt2d);
++ if (resA != resB) {
++ throw new IllegalStateException("Contains(pt) are not equals ["
++ + resA + "|" + resB + "] !");
++ }
++ resA = pathA.contains(pt2d.getX(), pt2d.getY());
++ resB = pathB.contains(pt2d.getX(), pt2d.getY());
++ if (resA != resB) {
++ throw new IllegalStateException("Contains(x,y) are not equals ["
++ + resA + "|" + resB + "] !");
++ }
++ resA = pathA.contains(rect2d);
++ resB = pathB.contains(rect2d);
++ if (resA != resB) {
++ throw new IllegalStateException("Contains(rect2d) are not equals ["
++ + resA + "|" + resB + "] !");
++ }
++ resA = pathA.contains(1.0, 2.0, 13.0, 17.0);
++ resB = pathB.contains(1.0, 2.0, 13.0, 17.0);
++ if (resA != resB) {
++ throw new IllegalStateException("Contains(doubles) are not equals ["
++ + resA + "|" + resB + "] !");
++ }
++ log("testContains: passed.");
++ }
++
++ static void testGetCurrentPoint(Path2D pathA, Path2D pathB) {
++ final Point2D ptA = pathA.getCurrentPoint();
++ final Point2D ptB = pathA.getCurrentPoint();
++ if (((ptA == null) && (ptB != null))
++ || ((ptA != null) && !ptA.equals(ptB)))
++ {
++ throw new IllegalStateException("getCurrentPoint() are not equals ["
++ + ptA + "|" + ptB + "] !");
++ }
++ log("testGetCurrentPoint: passed.");
++ }
++
++ static int getLength(int type) {
++ switch(type) {
++ case PathIterator.SEG_CUBICTO:
++ return 6;
++ case PathIterator.SEG_QUADTO:
++ return 4;
++ case PathIterator.SEG_LINETO:
++ case PathIterator.SEG_MOVETO:
++ return 2;
++ case PathIterator.SEG_CLOSE:
++ return 0;
++ default:
++ throw new IllegalStateException("Invalid type: " + type);
++ }
++ }
++
++
++ // Custom equals methods ---
++
++ public static boolean equalsArray(float[] a, float[] a2, final int len) {
++ for (int i = 0; i < len; i++) {
++ if (Float.floatToIntBits(a[i]) != Float.floatToIntBits(a2[i])) {
++ return false;
++ }
++ }
++ return true;
++ }
++
++ static boolean equalsArrayEps(float[] a, float[] a2, final int len) {
++ for (int i = 0; i < len; i++) {
++ if (!equalsEps(a[i], a2[i])) {
++ return false;
++ }
++ }
++
++ return true;
++ }
++
++ static boolean equalsRectangle2D(Rectangle2D a, Rectangle2D b) {
++ if (a == b) {
++ return true;
++ }
++ return equalsEps(a.getX(), b.getX())
++ && equalsEps(a.getY(), b.getY())
++ && equalsEps(a.getWidth(), b.getWidth())
++ && equalsEps(a.getHeight(), b.getHeight());
++ }
++
++ static boolean equalsEps(float a, float b) {
++ return (Math.abs(a - b) <= EPSILON);
++ }
++
++ static boolean equalsEps(double a, double b) {
++ return (Math.abs(a - b) <= EPSILON);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/geom/Path2D/Path2DGrow.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,188 @@
++/*
++ * 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.geom.GeneralPath;
++import java.awt.geom.Path2D;
++
++/**
++ * @test
++ * @bug 8078464
++ * @summary Check the growth algorithm (needRoom) in Path2D implementations
++ * @run main Path2DGrow
++ */
++public class Path2DGrow {
++
++ public static final int N = 1000 * 1000;
++
++ public static boolean verbose = false;
++ public static boolean force = false;
++
++ static void echo(String msg) {
++ System.out.println(msg);
++ }
++
++ static void log(String msg) {
++ if (verbose || force) {
++ echo(msg);
++ }
++ }
++
++ public static void main(String argv[]) {
++ verbose = (argv.length != 0);
++
++ testEmptyDoublePaths();
++ testDoublePaths();
++
++ testEmptyFloatPaths();
++ testFloatPaths();
++
++ testEmptyGeneralPath();
++ testGeneralPath();
++ }
++
++ static void testEmptyDoublePaths() {
++ echo("\n - Test(Path2D.Double[0]) ---");
++ test(() -> new Path2D.Double(Path2D.WIND_NON_ZERO, 0));
++ }
++
++ static void testDoublePaths() {
++ echo("\n - Test(Path2D.Double) ---");
++ test(() -> new Path2D.Double());
++ }
++
++ static void testEmptyFloatPaths() {
++ echo("\n - Test(Path2D.Float[0]) ---");
++ test(() -> new Path2D.Float(Path2D.WIND_NON_ZERO, 0));
++ }
++
++ static void testFloatPaths() {
++ echo("\n - Test(Path2D.Float) ---");
++ test(() -> new Path2D.Float());
++ }
++
++ static void testEmptyGeneralPath() {
++ echo("\n - Test(GeneralPath[0]) ---");
++ test(() -> new GeneralPath(Path2D.WIND_NON_ZERO, 0));
++ }
++
++ static void testGeneralPath() {
++ echo("\n - Test(GeneralPath) ---");
++ test(() -> new GeneralPath());
++ }
++
++ interface PathFactory {
++ Path2D makePath();
++ }
++
++ static void test(PathFactory pf) {
++ long start, end;
++
++ for (int n = 1; n <= N; n *= 10) {
++ force = (n == N);
++
++ start = System.nanoTime();
++ testAddMoves(pf.makePath(), n);
++ end = System.nanoTime();
++ log("testAddMoves[" + n + "] duration= "
++ + (1e-6 * (end - start)) + " ms.");
++
++ start = System.nanoTime();
++ testAddLines(pf.makePath(), n);
++ end = System.nanoTime();
++ log("testAddLines[" + n + "] duration= "
++ + (1e-6 * (end - start)) + " ms.");
++
++ start = System.nanoTime();
++ testAddQuads(pf.makePath(), n);
++ end = System.nanoTime();
++ log("testAddQuads[" + n + "] duration= "
++ + (1e-6 * (end - start)) + " ms.");
++
++ start = System.nanoTime();
++ testAddCubics(pf.makePath(), n);
++ end = System.nanoTime();
++ log("testAddCubics[" + n + "] duration= "
++ + (1e-6 * (end - start)) + " ms.");
++
++ start = System.nanoTime();
++ testAddMoveAndCloses(pf.makePath(), n);
++ end = System.nanoTime();
++ log("testAddMoveAndCloses[" + n + "] duration= "
++ + (1e-6 * (end - start)) + " ms.");
++ }
++ }
++
++ static void addMove(Path2D p2d, int i) {
++ p2d.moveTo(1.0 * i, 0.5 * i);
++ }
++
++ static void addLine(Path2D p2d, int i) {
++ p2d.lineTo(1.1 * i, 2.3 * i);
++ }
++
++ static void addCubic(Path2D p2d, int i) {
++ p2d.curveTo(1.1 * i, 1.2 * i, 1.3 * i, 1.4 * i, 1.5 * i, 1.6 * i);
++ }
++
++ static void addQuad(Path2D p2d, int i) {
++ p2d.quadTo(1.1 * i, 1.2 * i, 1.3 * i, 1.4 * i);
++ }
++
++ static void addClose(Path2D p2d) {
++ p2d.closePath();
++ }
++
++ static void testAddMoves(Path2D pathA, int n) {
++ for (int i = 0; i < n; i++) {
++ addMove(pathA, i);
++ }
++ }
++
++ static void testAddLines(Path2D pathA, int n) {
++ addMove(pathA, 0);
++ for (int i = 0; i < n; i++) {
++ addLine(pathA, i);
++ }
++ }
++
++ static void testAddQuads(Path2D pathA, int n) {
++ addMove(pathA, 0);
++ for (int i = 0; i < n; i++) {
++ addQuad(pathA, i);
++ }
++ }
++
++ static void testAddCubics(Path2D pathA, int n) {
++ addMove(pathA, 0);
++ for (int i = 0; i < n; i++) {
++ addCubic(pathA, i);
++ }
++ }
++
++ static void testAddMoveAndCloses(Path2D pathA, int n) {
++ for (int i = 0; i < n; i++) {
++ addMove(pathA, i);
++ addClose(pathA);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/image/BufferedImage/GetPropertyNames.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,103 @@
++/*
++ * 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.Image;
++import java.awt.image.BufferedImage;
++import java.util.Properties;
++
++import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
++
++/**
++ * @test
++ * @bug 8066132
++ * @author Sergey Bylokhov
++ */
++public final class GetPropertyNames {
++
++ static BufferedImage defaultProps = new BufferedImage(1, 1, TYPE_INT_ARGB);
++
++ public static void main(final String[] args) {
++ // default result is null
++ if (defaultProps.getPropertyNames() != null) {
++ throw new RuntimeException("PropertyNames should be null");
++ }
++ // for null properties result is null
++ final BufferedImage emptyProps = getBufferedImage(null);
++ if (emptyProps.getPropertyNames() != null) {
++ throw new RuntimeException("PropertyNames should be null");
++ }
++ // for empty properties result is null
++ final BufferedImage nullProps = getBufferedImage(new Properties());
++ if (nullProps.getPropertyNames() != null) {
++ throw new RuntimeException("PropertyNames should be null");
++ }
++ // for non-string keys result is null
++ final Properties properties = new Properties();
++ properties.put(1, 1);
++ properties.put(2, 2);
++ properties.put(3, 3);
++ final BufferedImage nonStringProps = getBufferedImage(properties);
++ if (nonStringProps.getPropertyNames() != null) {
++ throw new RuntimeException("PropertyNames should be null");
++ }
++ // for string keys result is not null
++ properties.clear();
++ properties.setProperty("1", "1");
++ properties.setProperty("2", "2");
++ validate(getBufferedImage(properties), 2);
++ // for the mix of strings and objects result is not null
++ properties.clear();
++ properties.put(1, 1);
++ properties.put(2, 2);
++ properties.put(3, 3);
++ properties.setProperty("key1", "value1");
++ properties.setProperty("key2", "value2");
++ final BufferedImage mixProps = getBufferedImage(properties);
++ validate(mixProps, 2);
++ if (!"value1".equals(mixProps.getProperty("key1"))
++ || !"value2".equals(mixProps.getProperty("key2"))) {
++ throw new RuntimeException("Wrong key-value pair");
++ }
++ }
++
++
++ private static BufferedImage getBufferedImage(final Properties properties) {
++ return new BufferedImage(defaultProps.getColorModel(),
++ defaultProps.getRaster(),
++ defaultProps.isAlphaPremultiplied(),
++ properties);
++ }
++
++ private static void validate(final BufferedImage bi, final int expected) {
++ final String[] names = bi.getPropertyNames();
++ if (names.length != expected) {
++ throw new RuntimeException("Wrong number of names");
++ }
++ for (final String name : names) {
++ final Object property = bi.getProperty(name);
++ if (property == Image.UndefinedProperty || property == null) {
++ throw new RuntimeException("Unexpected property");
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,178 @@
++/*
++ * 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.Color;
++import java.awt.Graphics2D;
++import java.awt.GraphicsConfiguration;
++import java.awt.GraphicsEnvironment;
++import java.awt.Image;
++import java.awt.Rectangle;
++import java.awt.Shape;
++import java.awt.geom.AffineTransform;
++import java.awt.image.BufferedImage;
++import java.awt.image.VolatileImage;
++import java.io.File;
++import java.io.IOException;
++
++import javax.imageio.ImageIO;
++
++import static java.awt.geom.Rectangle2D.Double;
++
++/**
++ * @test
++ * @bug 8061831
++ * @summary Tests drawing volatile image to volatile image using different
++ * clips + xor mode. Results of the blit compatibleImage to
++ * compatibleImage is used for comparison.
++ */
++public final class IncorrectClipXorModeSurface2Surface {
++
++ private static int[] SIZES = {2, 10, 100};
++ private static final Shape[] SHAPES = {
++ new Rectangle(0, 0, 0, 0),
++ new Rectangle(0, 0, 1, 1),
++ new Rectangle(0, 1, 1, 1),
++ new Rectangle(1, 0, 1, 1),
++ new Rectangle(1, 1, 1, 1),
++
++ new Double(0, 0, 0.5, 0.5),
++ new Double(0, 0.5, 0.5, 0.5),
++ new Double(0.5, 0, 0.5, 0.5),
++ new Double(0.5, 0.5, 0.5, 0.5),
++ new Double(0.25, 0.25, 0.5, 0.5),
++ new Double(0, 0.25, 1, 0.5),
++ new Double(0.25, 0, 0.5, 1),
++
++ new Double(.10, .10, .20, .20),
++ new Double(.75, .75, .20, .20),
++ new Double(.75, .10, .20, .20),
++ new Double(.10, .75, .20, .20),
++ };
++
++ public static void main(final String[] args) throws IOException {
++ GraphicsEnvironment ge = GraphicsEnvironment
++ .getLocalGraphicsEnvironment();
++ GraphicsConfiguration gc = ge.getDefaultScreenDevice()
++ .getDefaultConfiguration();
++ AffineTransform at;
++ for (int size : SIZES) {
++ at = AffineTransform.getScaleInstance(size, size);
++ for (Shape clip : SHAPES) {
++ clip = at.createTransformedShape(clip);
++ for (Shape to : SHAPES) {
++ to = at.createTransformedShape(to);
++ // Prepare test images
++ BufferedImage snapshot;
++ VolatileImage source = getVolatileImage(gc, size);
++ VolatileImage target = getVolatileImage(gc, size);
++ int attempt = 0;
++ while (true) {
++ if (++attempt > 10) {
++ throw new RuntimeException("Too many attempts: " + attempt);
++ }
++ // Prepare source images
++ source.validate(gc);
++ Graphics2D g2d = source.createGraphics();
++ g2d.setColor(Color.RED);
++ g2d.fillRect(0, 0, size, size);
++ g2d.dispose();
++ if (source.validate(gc) != VolatileImage.IMAGE_OK) {
++ continue;
++ }
++ // Prepare target images
++ target.validate(gc);
++ g2d = target.createGraphics();
++ g2d.setColor(Color.GREEN);
++ g2d.fillRect(0, 0, size, size);
++ g2d.dispose();
++ if (target.validate(gc) != VolatileImage.IMAGE_OK) {
++ continue;
++ }
++
++ draw(clip, to, source, target);
++ snapshot = target.getSnapshot();
++ if (source.contentsLost() || target.contentsLost()) {
++ continue;
++ }
++ break;
++ }
++ // Prepare gold images
++ BufferedImage goldS = getSourceGold(gc, size);
++ BufferedImage goldT = getTargetGold(gc, size);
++ draw(clip, to, goldS, goldT);
++ validate(snapshot, goldT);
++ source.flush();
++ target.flush();
++ }
++ }
++ }
++ }
++
++ private static void draw(Shape clip, Shape shape, Image from, Image to) {
++ Graphics2D g2d = (Graphics2D) to.getGraphics();
++ g2d.setXORMode(Color.BLACK);
++ g2d.setClip(clip);
++ Rectangle toBounds = shape.getBounds();
++ g2d.drawImage(from, toBounds.x, toBounds.y, toBounds.width,
++ toBounds.height, null);
++ g2d.dispose();
++ }
++
++ private static BufferedImage getSourceGold(GraphicsConfiguration gc,
++ int size) {
++ final BufferedImage bi = gc.createCompatibleImage(size, size);
++ Graphics2D g2d = bi.createGraphics();
++ g2d.setColor(Color.RED);
++ g2d.fillRect(0, 0, size, size);
++ g2d.dispose();
++ return bi;
++ }
++
++ private static BufferedImage getTargetGold(GraphicsConfiguration gc,
++ int size) {
++ BufferedImage image = gc.createCompatibleImage(size, size);
++ Graphics2D g2d = image.createGraphics();
++ g2d.setColor(Color.GREEN);
++ g2d.fillRect(0, 0, size, size);
++ g2d.dispose();
++ return image;
++ }
++
++ private static VolatileImage getVolatileImage(GraphicsConfiguration gc,
++ int size) {
++ return gc.createCompatibleVolatileImage(size, size);
++ }
++
++ private static void validate(BufferedImage bi, BufferedImage goldbi)
++ throws IOException {
++ for (int x = 0; x < bi.getWidth(); ++x) {
++ for (int y = 0; y < bi.getHeight(); ++y) {
++ if (goldbi.getRGB(x, y) != bi.getRGB(x, y)) {
++ ImageIO.write(bi, "png", new File("actual.png"));
++ ImageIO.write(goldbi, "png", new File("expected.png"));
++ throw new RuntimeException("Test failed.");
++ }
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/awt/print/PageFormat/ImageableAreaTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,264 @@
++/*
++ * 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.BorderLayout;
++import java.awt.Color;
++import java.awt.Dialog;
++import java.awt.FlowLayout;
++import java.awt.print.Printable;
++import java.awt.print.PrinterException;
++import java.awt.print.PrinterJob;
++import java.text.MessageFormat;
++import javax.print.attribute.HashPrintRequestAttributeSet;
++import javax.print.attribute.PrintRequestAttributeSet;
++import javax.print.attribute.standard.Copies;
++import javax.print.attribute.standard.DialogTypeSelection;
++import javax.print.attribute.standard.MediaPrintableArea;
++import javax.swing.JButton;
++import javax.swing.JDialog;
++import javax.swing.JFrame;
++import javax.swing.JPanel;
++import javax.swing.JTable;
++import javax.swing.JTextArea;
++import javax.swing.SwingUtilities;
++import javax.swing.table.AbstractTableModel;
++import javax.swing.table.TableModel;
++
++/**
++ * @test
++ * @bug 8044444
++ * @summary The output's 'Page-n' footer does not show completely
++ * @author Alexandr Scherbatiy
++ * @run main/manual ImageableAreaTest
++ */
++public class ImageableAreaTest {
++
++ public static void main(String[] args) throws Exception {
++ SwingUtilities.invokeAndWait(new Runnable() {
++
++ @Override
++ public void run() {
++
++ createAndShowTestDialog(
++ "1. Press the Print Table button\n"
++ + " Java print dialog should appear.\n"
++ + "2. Press the Print button on the Java Print dialog.\n"
++ + "2. Check that the page number is correctly printed.\n"
++ + "If so, press PASS, else press FAIL.",
++ "Page number is not correctly printed!",
++ ImageableAreaTest::printWithJavaPrintDialog);
++
++ createAndShowTestDialog(
++ "1. Press the Print Table button\n"
++ + " The table should be printed without the print dialog.\n"
++ + "2. Check that the page number is correctly printed.\n"
++ + "If so, press PASS, else press FAIL.",
++ "Page number is not correctly printed!",
++ ImageableAreaTest::printWithoutPrintDialog);
++
++ createAndShowTestDialog(
++ "1. Press the Print Table button\n"
++ + " Java print dialog should appear.\n"
++ + "2. Press the Print button on the Java Print dialog.\n"
++ + "3. Check that the table has about half size of the printed page\n"
++ + "If so, press PASS, else press FAIL.",
++ "Custom imageable area is not correctly printed!",
++ ImageableAreaTest::printWithCustomImageareaSize);
++ }
++ });
++ }
++
++ private static void printWithJavaPrintDialog() {
++ final JTable table = createAuthorTable(42);
++ Printable printable = table.getPrintable(
++ JTable.PrintMode.NORMAL,
++ new MessageFormat("Author Table"),
++ new MessageFormat("Page - {0}"));
++
++ PrinterJob job = PrinterJob.getPrinterJob();
++ job.setPrintable(printable);
++
++ boolean printAccepted = job.printDialog();
++ if (printAccepted) {
++ try {
++ job.print();
++ closeFrame();
++ } catch (PrinterException e) {
++ throw new RuntimeException(e);
++ }
++ }
++ }
++
++ private static void printWithoutPrintDialog() {
++
++ final JTable table = createAuthorTable(42);
++ PrintRequestAttributeSet pras
++ = new HashPrintRequestAttributeSet();
++ pras.add(new Copies(1));
++
++ try {
++
++ boolean printAccepted = table.print(JTable.PrintMode.FIT_WIDTH,
++ new MessageFormat("Author Table"),
++ new MessageFormat("Page - {0}"),
++ false, pras, false);
++
++ closeFrame();
++ if (!printAccepted) {
++ throw new RuntimeException("User cancels the printer job!");
++ }
++
++ } catch (Exception e) {
++ throw new RuntimeException(e);
++ }
++ }
++
++ private static void printWithCustomImageareaSize() {
++ final JTable table = createAuthorTable(18);
++ PrintRequestAttributeSet printAttributes = new HashPrintRequestAttributeSet();
++ printAttributes.add(DialogTypeSelection.NATIVE);
++ printAttributes.add(new Copies(1));
++ printAttributes.add(new MediaPrintableArea(
++ 0.25f, 0.25f, 8.0f, 5.0f, MediaPrintableArea.INCH));
++ Printable printable = table.getPrintable(
++ JTable.PrintMode.NORMAL,
++ new MessageFormat("Author Table"),
++ new MessageFormat("Page - {0}")
++ );
++
++ PrinterJob job = PrinterJob.getPrinterJob();
++ job.setPrintable(printable);
++
++ boolean printAccepted = job.printDialog(printAttributes);
++ if (printAccepted) {
++ try {
++ job.print(printAttributes);
++ closeFrame();
++ } catch (Exception e) {
++ throw new RuntimeException(e);
++ }
++ } else {
++ throw new RuntimeException("User cancels the printer job!");
++ }
++ }
++
++ private static JFrame frame;
++
++ private static void closeFrame() {
++ if (frame != null) {
++ frame.setVisible(false);
++ frame.dispose();
++ }
++ }
++
++ private static JTable createAuthorTable(int rows) {
++ final String[] headers = {"Book", "Title"};
++
++ final Object[][] data = new Object[rows][2];
++ for (int i = 0; i < rows; i++) {
++ int n = i + 1;
++ data[i] = new Object[]{"Book: " + n, "Title: " + n};
++ }
++
++ TableModel dataModel = new AbstractTableModel() {
++
++ public int getColumnCount() {
++ return headers.length;
++ }
++
++ public int getRowCount() {
++ return data.length;
++ }
++
++ public Object getValueAt(int row, int col) {
++ return data[row][col];
++ }
++
++ public String getColumnName(int column) {
++ return headers[column];
++ }
++
++ public Class getColumnClass(int col) {
++ return getValueAt(0, col).getClass();
++ }
++
++ public void setValueAt(Object aValue, int row, int column) {
++ data[row][column] = aValue;
++ }
++
++ public boolean isCellEditable(int row, int col) {
++ return false;
++ }
++ };
++
++ JTable table = new JTable(dataModel);
++ table.setGridColor(Color.BLUE);
++ table.setBackground(Color.WHITE);
++ table.setForeground(Color.BLACK);
++ table.setSize(600, 800);
++
++ frame = new JFrame();
++ frame.setSize(400, 600);
++ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
++ frame.add(table);
++ frame.setVisible(true);
++ return table;
++ }
++
++ private static int testCount;
++
++ private static void createAndShowTestDialog(String description,
++ String failMessage, Runnable action) {
++ final JDialog dialog = new JDialog();
++ dialog.setTitle("Test: " + (++testCount));
++ dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
++ JTextArea textArea = new JTextArea(description);
++ textArea.setEditable(false);
++ final JButton testButton = new JButton("Print Table");
++ final JButton passButton = new JButton("PASS");
++ passButton.setEnabled(false);
++ passButton.addActionListener((e) -> {
++ dialog.dispose();
++ });
++ final JButton failButton = new JButton("FAIL");
++ failButton.setEnabled(false);
++ failButton.addActionListener((e) -> {
++ throw new RuntimeException(failMessage);
++ });
++ testButton.addActionListener((e) -> {
++ testButton.setEnabled(false);
++ action.run();
++ passButton.setEnabled(true);
++ failButton.setEnabled(true);
++ });
++ JPanel mainPanel = new JPanel(new BorderLayout());
++ mainPanel.add(textArea, BorderLayout.CENTER);
++ JPanel buttonPanel = new JPanel(new FlowLayout());
++ buttonPanel.add(testButton);
++ buttonPanel.add(passButton);
++ buttonPanel.add(failButton);
++ mainPanel.add(buttonPanel, BorderLayout.SOUTH);
++ dialog.add(mainPanel);
++ dialog.pack();
++ dialog.setVisible(true);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,405 @@
++/*
++ * Copyright (c) 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 java.io.File;
++import java.io.FilePermission;
++import java.io.IOException;
++import java.lang.reflect.Field;
++import java.lang.reflect.ReflectPermission;
++import java.nio.file.Files;
++import java.nio.file.Path;
++import java.security.CodeSource;
++import java.security.Permission;
++import java.security.PermissionCollection;
++import java.security.Permissions;
++import java.security.Policy;
++import java.security.ProtectionDomain;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Collections;
++import java.util.Enumeration;
++import java.util.Iterator;
++import java.util.List;
++import java.util.PropertyPermission;
++import java.util.concurrent.atomic.AtomicBoolean;
++import java.util.concurrent.atomic.AtomicLong;
++import java.util.jar.JarEntry;
++import java.util.jar.JarFile;
++import java.util.stream.Stream;
++
++/**
++ * @test
++ * @bug 8065552
++ * @summary test that all fields returned by getDeclaredFields() can be
++ * set accessible if the right permission is granted; this test
++ * loads all the classes in the BCL, get their declared fields,
++ * and call setAccessible(false) followed by setAccessible(true);
++ * @run main/othervm FieldSetAccessibleTest UNSECURE
++ * @run main/othervm FieldSetAccessibleTest SECURE
++ *
++ * @author danielfuchs
++ */
++public class FieldSetAccessibleTest {
++
++ static final List<String> skipped = new ArrayList<>();
++ static final List<String> cantread = new ArrayList<>();
++ static final List<String> failed = new ArrayList<>();
++ static final AtomicLong classCount = new AtomicLong();
++ static final AtomicLong fieldCount = new AtomicLong();
++ static long startIndex = 0;
++ static long maxSize = Long.MAX_VALUE;
++ static long maxIndex = Long.MAX_VALUE;
++
++
++ // Test that all fields for any given class can be made accessibles
++ static void testSetFieldsAccessible(Class<?> c) {
++ for (Field f : c.getDeclaredFields()) {
++ fieldCount.incrementAndGet();
++ f.setAccessible(false);
++ f.setAccessible(true);
++ }
++ }
++
++ // Performs a series of test on the given class.
++ // At this time, we only call testSetFieldsAccessible(c)
++ public static boolean test(Class<?> c) {
++ //System.out.println(c.getName());
++ classCount.incrementAndGet();
++
++ // Call getDeclaredFields() and try to set their accessible flag.
++ testSetFieldsAccessible(c);
++
++ // add more tests here...
++
++ return c == Class.class;
++ }
++
++ // Prints a summary at the end of the test.
++ static void printSummary(long secs, long millis, long nanos) {
++ System.out.println("Tested " + fieldCount.get() + " fields of "
++ + classCount.get() + " classes in "
++ + secs + "s " + millis + "ms " + nanos + "ns");
++ }
++
++
++ /**
++ * @param args the command line arguments:
++ *
++ * SECURE|UNSECURE [startIndex (default=0)] [maxSize (default=Long.MAX_VALUE)]
++ *
++ * @throws java.lang.Exception if the test fails
++ */
++ public static void main(String[] args) throws Exception {
++ if (args == null || args.length == 0) {
++ args = new String[] {"SECURE", "0"};
++ } else if (args.length > 3) {
++ throw new RuntimeException("Expected at most one argument. Found "
++ + Arrays.asList(args));
++ }
++ try {
++ if (args.length > 1) {
++ startIndex = Long.parseLong(args[1]);
++ if (startIndex < 0) {
++ throw new IllegalArgumentException("startIndex args[1]: "
++ + startIndex);
++ }
++ }
++ if (args.length > 2) {
++ maxSize = Long.parseLong(args[2]);
++ if (maxSize <= 0) {
++ maxSize = Long.MAX_VALUE;
++ }
++ maxIndex = (Long.MAX_VALUE - startIndex) < maxSize
++ ? Long.MAX_VALUE : startIndex + maxSize;
++ }
++ TestCase.valueOf(args[0]).run();
++ } catch (OutOfMemoryError oome) {
++ System.err.println(classCount.get());
++ throw oome;
++ }
++ }
++
++ public static void run(TestCase test) {
++ System.out.println("Testing " + test);
++ test(listAllClassNames());
++ System.out.println("Passed " + test);
++ }
++
++ static Iterable<String> listAllClassNames() {
++ return new ClassNameStreamBuilder();
++ }
++
++ static void test(Iterable<String> iterable) {
++ final long start = System.nanoTime();
++ boolean classFound = false;
++ int index = 0;
++ for (String s: iterable) {
++ if (index == maxIndex) break;
++ try {
++ if (index < startIndex) continue;
++ if (test(s)) {
++ classFound = true;
++ }
++ } finally {
++ index++;
++ }
++ }
++ long elapsed = System.nanoTime() - start;
++ long secs = elapsed / 1000_000_000;
++ long millis = (elapsed % 1000_000_000) / 1000_000;
++ long nanos = elapsed % 1000_000;
++ System.out.println("Unreadable path elements: " + cantread);
++ System.out.println("Skipped path elements: " + skipped);
++ System.out.println("Failed path elements: " + failed);
++ printSummary(secs, millis, nanos);
++
++ if (!failed.isEmpty()) {
++ throw new RuntimeException("Test failed for the following classes: " + failed);
++ }
++ if (!classFound && startIndex == 0 && index < maxIndex) {
++ // this is just to verify that we have indeed parsed rt.jar
++ // (or the java.base module)
++ throw new RuntimeException("Test failed: Class.class not found...");
++ }
++ if (classCount.get() == 0 && startIndex == 0) {
++ throw new RuntimeException("Test failed: no class found?");
++ }
++ }
++
++ static boolean test(String s) {
++ try {
++ if (s.startsWith("WrapperGenerator")) {
++ System.out.println("Skipping "+ s);
++ return false;
++ }
++ final Class<?> c = Class.forName(
++ s.replace('/', '.').substring(0, s.length() - 6),
++ false,
++ null);
++ return test(c);
++ } catch (Exception t) {
++ t.printStackTrace(System.err);
++ failed.add(s);
++ } catch (NoClassDefFoundError e) {
++ e.printStackTrace(System.err);
++ failed.add(s);
++ }
++ return false;
++ }
++
++ static class ClassNameStreamBuilder implements Iterable<String>{
++ String[] bcp;
++ ClassNameStreamBuilder() {
++ bcp = System.getProperty("sun.boot.class.path").split(File.pathSeparator);
++ }
++
++ Stream<String> bcpElementToStream(String s) {
++ return s.endsWith(".jar") ? jarToStream(s) : folderToStream(s);
++ }
++
++ Stream<String> jarToStream(String jarName) {
++ File f = new File(jarName);
++ if (f.canRead() && f.isFile()) {
++ try {
++ JarFile jarFile = new JarFile(f);
++ return jarFile.stream()
++ .filter(e -> !e.isDirectory())
++ .map(JarEntry::getName)
++ .filter(s -> s.endsWith(".class"));
++ } catch(IOException x) {
++ x.printStackTrace(System.err);
++ skipped.add(jarName);
++ }
++ } else {
++ cantread.add(jarName);
++ }
++ return Collections.<String>emptyList().stream();
++ }
++
++ Stream<String> folderToStream(String folderName) {
++ final File root = new File(folderName);
++ if (root.canRead() && root.isDirectory()) {
++ final Path rootPath = root.toPath();
++ try {
++ return Files.walk(rootPath)
++ .filter(p -> p.getFileName().toString().endsWith(".class"))
++ .map(rootPath::relativize)
++ .map(p -> p.toString().replace(File.separatorChar, '/'));
++ } catch (IOException x) {
++ x.printStackTrace(System.err);
++ skipped.add(folderName);
++ }
++ } else {
++ cantread.add(folderName);
++ }
++ return Collections.<String>emptyList().stream();
++ }
++
++ public Stream<String> build() {
++ return Stream.of(bcp).flatMap(this::bcpElementToStream);
++ }
++
++ @Override
++ public Iterator<String> iterator() {
++ return build().iterator();
++ }
++ }
++
++ // Test with or without a security manager
++ public static enum TestCase {
++ UNSECURE, SECURE;
++ public void run() throws Exception {
++ System.out.println("Running test case: " + name());
++ Configure.setUp(this);
++ FieldSetAccessibleTest.run(this);
++ }
++ }
++
++ // A helper class to configure the security manager for the test,
++ // and bypass it when needed.
++ static class Configure {
++ static Policy policy = null;
++ static final ThreadLocal<AtomicBoolean> allowAll = new ThreadLocal<AtomicBoolean>() {
++ @Override
++ protected AtomicBoolean initialValue() {
++ return new AtomicBoolean(false);
++ }
++ };
++ static void setUp(TestCase test) {
++ switch (test) {
++ case SECURE:
++ if (policy == null && System.getSecurityManager() != null) {
++ throw new IllegalStateException("SecurityManager already set");
++ } else if (policy == null) {
++ policy = new SimplePolicy(TestCase.SECURE, allowAll);
++ Policy.setPolicy(policy);
++ System.setSecurityManager(new SecurityManager());
++ }
++ if (System.getSecurityManager() == null) {
++ throw new IllegalStateException("No SecurityManager.");
++ }
++ if (policy == null) {
++ throw new IllegalStateException("policy not configured");
++ }
++ break;
++ case UNSECURE:
++ if (System.getSecurityManager() != null) {
++ throw new IllegalStateException("SecurityManager already set");
++ }
++ break;
++ default:
++ throw new InternalError("No such testcase: " + test);
++ }
++ }
++ static void doPrivileged(Runnable run) {
++ allowAll.get().set(true);
++ try {
++ run.run();
++ } finally {
++ allowAll.get().set(false);
++ }
++ }
++ }
++
++ // A Helper class to build a set of permissions.
++ final static class PermissionsBuilder {
++ final Permissions perms;
++ public PermissionsBuilder() {
++ this(new Permissions());
++ }
++ public PermissionsBuilder(Permissions perms) {
++ this.perms = perms;
++ }
++ public PermissionsBuilder add(Permission p) {
++ perms.add(p);
++ return this;
++ }
++ public PermissionsBuilder addAll(PermissionCollection col) {
++ if (col != null) {
++ for (Enumeration<Permission> e = col.elements(); e.hasMoreElements(); ) {
++ perms.add(e.nextElement());
++ }
++ }
++ return this;
++ }
++ public Permissions toPermissions() {
++ final PermissionsBuilder builder = new PermissionsBuilder();
++ builder.addAll(perms);
++ return builder.perms;
++ }
++ }
++
++ // Policy for the test...
++ public static class SimplePolicy extends Policy {
++
++ final Permissions permissions;
++ final Permissions allPermissions;
++ final ThreadLocal<AtomicBoolean> allowAll;
++ public SimplePolicy(TestCase test, ThreadLocal<AtomicBoolean> allowAll) {
++ this.allowAll = allowAll;
++
++ // Permission needed by the tested code exercised in the test
++ permissions = new Permissions();
++ permissions.add(new RuntimePermission("fileSystemProvider"));
++ permissions.add(new RuntimePermission("createClassLoader"));
++ permissions.add(new RuntimePermission("closeClassLoader"));
++ permissions.add(new RuntimePermission("getClassLoader"));
++ permissions.add(new RuntimePermission("accessDeclaredMembers"));
++ permissions.add(new ReflectPermission("suppressAccessChecks"));
++ permissions.add(new PropertyPermission("*", "read"));
++ permissions.add(new FilePermission("<<ALL FILES>>", "read"));
++
++ // these are used for configuring the test itself...
++ allPermissions = new Permissions();
++ allPermissions.add(new java.security.AllPermission());
++ }
++
++ @Override
++ public boolean implies(ProtectionDomain domain, Permission permission) {
++ if (allowAll.get().get()) return allPermissions.implies(permission);
++ if (permissions.implies(permission)) return true;
++ if (permission instanceof java.lang.RuntimePermission) {
++ if (permission.getName().startsWith("accessClassInPackage.")) {
++ // add these along to the set of permission we have, when we
++ // discover that we need them.
++ permissions.add(permission);
++ return true;
++ }
++ }
++ return false;
++ }
++
++ @Override
++ public PermissionCollection getPermissions(CodeSource codesource) {
++ return new PermissionsBuilder().addAll(allowAll.get().get()
++ ? allPermissions : permissions).toPermissions();
++ }
++
++ @Override
++ public PermissionCollection getPermissions(ProtectionDomain domain) {
++ return new PermissionsBuilder().addAll(allowAll.get().get()
++ ? allPermissions : permissions).toPermissions();
++ }
++ }
++
++}
+--- ./jdk/test/java/lang/Thread/ThreadStateController.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/Thread/ThreadStateController.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -27,6 +27,8 @@
+ import java.util.concurrent.atomic.AtomicInteger;
+ import java.util.concurrent.locks.LockSupport;
+
++import jdk.testlibrary.LockFreeLogManager;
++
+ /**
+ * ThreadStateController allows a thread to request this thread to transition
+ * to a specific thread state. The {@linkplain #transitionTo request} is
+@@ -94,8 +96,12 @@
+ private static final int S_TERMINATE = 8;
+
+ // for debugging
+- private AtomicInteger iterations = new AtomicInteger();
+- private AtomicInteger interrupted = new AtomicInteger();
++ private final AtomicInteger iterations = new AtomicInteger();
++ private final AtomicInteger interrupted = new AtomicInteger();
++
++ private final LockFreeLogManager logManager = new LockFreeLogManager();
++
++ @Override
+ public void run() {
+ // this thread has started
+ while (!done) {
+@@ -119,13 +125,13 @@
+ break;
+ }
+ case S_BLOCKED: {
+- System.out.format("%d: %s is going to block (interations %d)%n",
+- getId(), getName(), iterations.get());
++ log("%d: %s is going to block (iterations %d)%n",
++ getId(), getName(), iterations.get());
+ stateChange(nextState);
+ // going to block on lock
+ synchronized (lock) {
+- System.out.format("%d: %s acquired the lock (interations %d)%n",
+- getId(), getName(), iterations.get());
++ log("%d: %s acquired the lock (iterations %d)%n",
++ getId(), getName(), iterations.get());
+ try {
+ // this thread has escaped the BLOCKED state
+ // release the lock and a short wait before continue
+@@ -139,13 +145,13 @@
+ }
+ case S_WAITING: {
+ synchronized (lock) {
+- System.out.format("%d: %s is going to waiting (interations %d interrupted %d)%n",
+- getId(), getName(), iterations.get(), interrupted.get());
++ log("%d: %s is going to waiting (iterations %d interrupted %d)%n",
++ getId(), getName(), iterations.get(), interrupted.get());
+ try {
+ stateChange(nextState);
+ lock.wait();
+- System.out.format("%d: %s wakes up from waiting (interations %d interrupted %d)%n",
+- getId(), getName(), iterations.get(), interrupted.get());
++ log("%d: %s wakes up from waiting (iterations %d interrupted %d)%n",
++ getId(), getName(), iterations.get(), interrupted.get());
+ } catch (InterruptedException e) {
+ // ignore
+ interrupted.incrementAndGet();
+@@ -155,13 +161,13 @@
+ }
+ case S_TIMED_WAITING: {
+ synchronized (lock) {
+- System.out.format("%d: %s is going to timed waiting (interations %d interrupted %d)%n",
+- getId(), getName(), iterations.get(), interrupted.get());
++ log("%d: %s is going to timed waiting (iterations %d interrupted %d)%n",
++ getId(), getName(), iterations.get(), interrupted.get());
+ try {
+ stateChange(nextState);
+ lock.wait(10000);
+- System.out.format("%d: %s wakes up from timed waiting (interations %d interrupted %d)%n",
+- getId(), getName(), iterations.get(), interrupted.get());
++ log("%d: %s wakes up from timed waiting (iterations %d interrupted %d)%n",
++ getId(), getName(), iterations.get(), interrupted.get());
+ } catch (InterruptedException e) {
+ // ignore
+ interrupted.incrementAndGet();
+@@ -170,23 +176,23 @@
+ break;
+ }
+ case S_PARKED: {
+- System.out.format("%d: %s is going to park (interations %d)%n",
+- getId(), getName(), iterations.get());
++ log("%d: %s is going to park (iterations %d)%n",
++ getId(), getName(), iterations.get());
+ stateChange(nextState);
+ LockSupport.park();
+ break;
+ }
+ case S_TIMED_PARKED: {
+- System.out.format("%d: %s is going to timed park (interations %d)%n",
+- getId(), getName(), iterations.get());
++ log("%d: %s is going to timed park (iterations %d)%n",
++ getId(), getName(), iterations.get());
+ long deadline = System.currentTimeMillis() + 10000*1000;
+ stateChange(nextState);
+ LockSupport.parkUntil(deadline);
+ break;
+ }
+ case S_SLEEPING: {
+- System.out.format("%d: %s is going to sleep (interations %d interrupted %d)%n",
+- getId(), getName(), iterations.get(), interrupted.get());
++ log("%d: %s is going to sleep (iterations %d interrupted %d)%n",
++ getId(), getName(), iterations.get(), interrupted.get());
+ try {
+ stateChange(nextState);
+ Thread.sleep(1000000);
+@@ -219,8 +225,8 @@
+ if (newState == nextState) {
+ state = nextState;
+ phaser.arrive();
+- System.out.format("%d: state change: %s %s%n",
+- getId(), toStateName(nextState), phaserToString(phaser));
++ log("%d: state change: %s %s%n",
++ getId(), toStateName(nextState), phaserToString(phaser));
+ return;
+ }
+
+@@ -270,12 +276,12 @@
+
+ private void nextState(int s) throws InterruptedException {
+ final long id = Thread.currentThread().getId();
+- System.out.format("%d: wait until the thread transitions to %s %s%n",
+- id, toStateName(s), phaserToString(phaser));
++ log("%d: wait until the thread transitions to %s %s%n",
++ id, toStateName(s), phaserToString(phaser));
+ this.newState = s;
+ int phase = phaser.arrive();
+- System.out.format("%d: awaiting party arrive %s %s%n",
+- id, toStateName(s), phaserToString(phaser));
++ log("%d: awaiting party arrive %s %s%n",
++ id, toStateName(s), phaserToString(phaser));
+ for (;;) {
+ // when this thread has changed its state before it waits or parks
+ // on a lock, a potential race might happen if it misses the notify
+@@ -301,20 +307,22 @@
+ }
+ try {
+ phaser.awaitAdvanceInterruptibly(phase, 100, TimeUnit.MILLISECONDS);
+- System.out.format("%d: arrived at %s %s%n",
+- id, toStateName(s), phaserToString(phaser));
++ log("%d: arrived at %s %s%n",
++ id, toStateName(s), phaserToString(phaser));
+ return;
+ } catch (TimeoutException ex) {
+ // this thread hasn't arrived at this phase
+- System.out.format("%d: Timeout: %s%n", id, phaser);
++ log("%d: Timeout: %s%n", id, phaser);
+ }
+ }
+ }
++
+ private String phaserToString(Phaser p) {
+ return "[phase = " + p.getPhase() +
+ " parties = " + p.getRegisteredParties() +
+ " arrived = " + p.getArrivedParties() + "]";
+ }
++
+ private String toStateName(int state) {
+ switch (state) {
+ case S_RUNNABLE:
+@@ -337,4 +345,20 @@
+ return "unknown " + state;
+ }
+ }
++
++ private void log(String msg, Object ... params) {
++ logManager.log(msg, params);
++ }
++
++ /**
++ * Waits for the controller to complete the test run and returns the
++ * generated log
++ * @return The controller log
++ * @throws InterruptedException
++ */
++ public String getLog() throws InterruptedException {
++ this.join();
++
++ return logManager.toString();
++ }
+ }
+--- ./jdk/test/java/lang/Thread/ThreadStateTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/Thread/ThreadStateTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -30,6 +30,8 @@
+ * Thread.getState().
+ *
+ * @author Mandy Chung
++ * @library /lib/testlibrary
++ * @build jdk.testlibrary.*
+ * @build ThreadStateTest ThreadStateController
+ * @run main/othervm -Xmixed ThreadStateTest
+ */
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,75 @@
++/*
++ * 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 8046246
++ * @summary Tests and benchmarks the JVMTI RedefineClasses when a
++ * single class (and its parent) contains many methods.
++ *
++ * @run build ManyMethodsBenchmarkApp ManyMethodsBenchmarkAgent
++ * @run shell MakeJAR3.sh ManyMethodsBenchmarkAgent 'Can-Retransform-Classes: true'
++ * @run main/othervm -javaagent:ManyMethodsBenchmarkAgent.jar ManyMethodsBenchmarkApp
++ */
++import java.lang.instrument.*;
++
++public class ManyMethodsBenchmarkAgent
++{
++ public static boolean fail = false;
++ public static boolean completed = false;
++ private static Instrumentation instrumentation;
++
++ public static void
++ premain( String agentArgs,
++ Instrumentation instrumentation) {
++ System.out.println("ManyMethodsBenchmarkAgent started");
++ ManyMethodsBenchmarkAgent.instrumentation = instrumentation;
++ System.out.println("ManyMethodsBenchmarkAgent finished");
++ }
++
++ static void instr() {
++ System.out.println("ManyMethodsBenchmarkAgent.instr started");
++
++ Class[] allClasses = instrumentation.getAllLoadedClasses();
++
++ for (int i = 0; i < allClasses.length; i++) {
++ Class klass = allClasses[i];
++ String name = klass.getName();
++ if (!name.equals("Base")) {
++ continue;
++ }
++ System.err.println("Instrumenting the class: " + klass);
++
++ try {
++ instrumentation.retransformClasses(klass);
++ } catch (Throwable e) {
++ System.err.println("Error: bad return from retransform: " + klass);
++ System.err.println(" ERROR: " + e);
++ fail = true;
++ }
++ }
++ completed = true;
++ System.out.println("ManyMethodsBenchmarkAgent.instr finished");
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/lang/instrument/ManyMethodsBenchmarkApp.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,141 @@
++/*
++ * Copyright 2015 Google Inc. All Rights Reserved.
++ * 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 java.io.FileWriter;
++import java.io.PrintStream;
++import java.lang.reflect.InvocationTargetException;
++import java.lang.reflect.Method;
++import java.lang.reflect.Type;
++import java.net.URL;
++import java.net.URLClassLoader;
++import java.util.Arrays;
++import java.util.List;
++import javax.tools.JavaCompiler;
++import javax.tools.StandardJavaFileManager;
++import javax.tools.ToolProvider;
++
++/**
++ * A manual benchmark of the JVMTI RedefineClasses when a
++ * single class (and its parent) contains many methods.
++ */
++public class ManyMethodsBenchmarkApp {
++ // Limit is 64k but we can not put such many as the CP limit is 32k.
++ // In practice, it means a real limit is much lower (less than 22000).
++ static final int METHOD_COUNT = 20000;
++
++ static Class<?> loadClassInNewClassLoader(String className) throws Exception {
++ URL[] urls = { new File(".").toURI().toURL() };
++ URLClassLoader ucl = new URLClassLoader(urls, null);
++ Class<?> klazz = Class.forName(className, true, ucl);
++ return klazz;
++ }
++
++ static void benchmarkClassOperations(String className) throws Exception {
++ Class<?> klazz = loadClassInNewClassLoader(className);
++
++ Method[] methods = klazz.getDeclaredMethods();
++ if (methods.length != METHOD_COUNT) {
++ throw new AssertionError("unexpected method count: " + methods.length +
++ " expected: " + METHOD_COUNT);
++ }
++
++ methods = klazz.getMethods();
++ // returned methods includes those inherited from Object
++ int objectMethodSlop = 100;
++ if (methods.length <= METHOD_COUNT ||
++ methods.length >= METHOD_COUNT + objectMethodSlop) {
++ throw new AssertionError("unexpected method count: " + methods.length);
++ }
++
++ // Invoke methods to make them appear in the constant pool cache
++ Object obj = klazz.newInstance();
++ Object[] args = new Object[0];
++ for (Method m: methods) {
++ try {
++ Class<?>[] types = m.getParameterTypes();
++ String name = m.getName();
++ // System.out.println("method: " + name + "; argno: " + types.length);
++ if (types.length == 0 && name.length() == 2 && name.startsWith("f")) {
++ m.invoke(obj, args);
++ }
++ } catch (InvocationTargetException ex) {
++ ex.printStackTrace();
++ }
++ }
++ }
++
++ public static void main(String[] args) throws Exception {
++ System.out.println("test started: ManyMethodsBenchmarkApp");
++
++ // Create source files with many methods
++ File base = new File("Base.java");
++ try (FileWriter fw = new FileWriter(base)) {
++ fw.write("public class Base {\n");
++ final int L = 10;
++ // Each of the first L methods makes calls to its own chunk of METHOD_COUNT/L methods
++ for (int k = 0; k < L; k++) {
++ fw.write(" public void f" + k + "() {\n");
++ int shift = (k == 0) ? L : 0;
++ for (int i = (k * (METHOD_COUNT/L)) + shift; i < (k + 1) * METHOD_COUNT/L; i++) {
++ fw.write(" f" + i + "();\n");
++ }
++ fw.write(" }\n");
++ }
++
++ // The rest of (METHOD_COUNT - L) methods have empty body
++ for (int i = L; i < METHOD_COUNT; i++) {
++ fw.write(" public static void f" + i + "() {}\n");
++ }
++ fw.write("}\n");
++ }
++
++ // Compile the generated source files.
++ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
++ List<File> files = Arrays.asList(new File[] { base });
++ try (StandardJavaFileManager fileManager =
++ compiler.getStandardFileManager(null, null, null)) {
++ compiler.getTask(null, fileManager, null, null, null,
++ fileManager.getJavaFileObjectsFromFiles(files))
++ .call();
++ }
++
++ benchmarkClassOperations("Base");
++
++ ManyMethodsBenchmarkAgent.instr();
++
++ // Cleanup
++ base.delete();
++ new File("Base.class").delete();
++ if (!ManyMethodsBenchmarkAgent.completed) {
++ throw new Exception("ERROR: ManyMethodsBenchmarkAgent did not complete.");
++ }
++
++ if (ManyMethodsBenchmarkAgent.fail) {
++ throw new Exception("ERROR: ManyMethodsBenchmarkAgent failed.");
++ } else {
++ System.out.println("ManyMethodsBenchmarkAgent succeeded.");
++ }
++ System.out.println("test finished: ManyMethodsBenchmarkApp");
++ }
++}
+--- ./jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2013, 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
+@@ -77,7 +77,7 @@
+
+ cat output.log
+
+-MESG="Exception"
++MESG="Test failed"
+ grep "$MESG" output.log
+ result=$?
+ if [ "$result" = 0 ]; then
+--- ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -46,12 +46,15 @@
+ * could be freed, since class redefinition didn't know about the backtraces.
+ */
+ public class RedefineMethodInBacktraceApp {
++ static boolean failed = false;
++
+ public static void main(String args[]) throws Exception {
+ System.out.println("Hello from RedefineMethodInBacktraceApp!");
+-
+ new RedefineMethodInBacktraceApp().doTest();
+
+- System.exit(0);
++ if (failed) {
++ throw new Exception("ERROR: RedefineMethodInBacktraceApp failed.");
++ }
+ }
+
+ public static CountDownLatch stop = new CountDownLatch(1);
+@@ -63,13 +66,18 @@
+ }
+
+ private void doMethodInBacktraceTest() throws Exception {
+- Throwable t = getThrowableFromMethodToRedefine();
++ Throwable t1 = getThrowableFromMethodToRedefine();
++ Throwable t2 = getThrowableFromMethodToDelete();
+
+ doRedefine(RedefineMethodInBacktraceTarget.class);
+
+ doClassUnloading();
+
+- touchRedefinedMethodInBacktrace(t);
++ System.out.println("checking backtrace for throwable from methodToRedefine");
++ touchRedefinedMethodInBacktrace(t1);
++
++ System.out.println("checking backtrace for throwable from methodToDelete");
++ touchRedefinedMethodInBacktrace(t2);
+ }
+
+ private void doMethodInBacktraceTestB() throws Exception {
+@@ -115,6 +123,10 @@
+ if (!(thrownFromMethodToRedefine instanceof RuntimeException)) {
+ throw e;
+ }
++ } catch (Exception e) {
++ e.printStackTrace();
++ System.out.println("\nTest failed: unexpected exception: " + e.toString());
++ failed = true;
+ }
+ method = null;
+ c = null;
+@@ -122,15 +134,49 @@
+ return thrownFromMethodToRedefine;
+ }
+
++ private static Throwable getThrowableFromMethodToDelete() throws Exception {
++ Class<RedefineMethodInBacktraceTarget> c =
++ RedefineMethodInBacktraceTarget.class;
++ Method method = c.getMethod("callMethodToDelete");
++
++ Throwable thrownFromMethodToDelete = null;
++ try {
++ method.invoke(null);
++ } catch (InvocationTargetException e) {
++ thrownFromMethodToDelete = e.getCause();
++ if (!(thrownFromMethodToDelete instanceof RuntimeException)) {
++ throw e;
++ }
++ } catch (Exception e) {
++ e.printStackTrace();
++ System.out.println("\nTest failed: unexpected exception: " + e.toString());
++ failed = true;
++ }
++ return thrownFromMethodToDelete;
++ }
++
++
+ private static void doClassUnloading() {
+ // This will clean out old, unused redefined methods.
+ System.gc();
+ }
+
+ private static void touchRedefinedMethodInBacktrace(Throwable throwable) {
++ throwable.printStackTrace();
+ // Make sure that we can convert the backtrace, which is referring to
+ // the redefined method, to a StrackTraceElement[] without crashing.
+- throwable.getStackTrace();
++ StackTraceElement[] stackTrace = throwable.getStackTrace();
++ for (int i = 0; i < stackTrace.length; i++) {
++ StackTraceElement frame = stackTrace[i];
++ if (frame.getClassName() == null) {
++ System.out.println("\nTest failed: trace[" + i + "].getClassName() returned null");
++ failed = true;
++ }
++ if (frame.getMethodName() == null) {
++ System.out.println("\nTest failed: trace[" + i + "].getMethodName() returned null");
++ failed = true;
++ }
++ }
+ }
+
+ private static void doRedefine(Class<?> clazz) throws Exception {
+--- ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -29,4 +29,13 @@
+ public static void methodToRedefine() {
+ throw new RuntimeException("Test exception");
+ }
++
++ public static void callMethodToDelete() {
++ methodToDelete();
++ }
++
++ private static void methodToDelete() {
++ throw new RuntimeException("Test exception in methodToDelete");
++ }
++
+ }
+--- ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -37,4 +37,16 @@
+ // ignore, test will fail
+ }
+ }
++
++ public static void callMethodToDelete() {
++ try {
++ // signal that we are here
++ RedefineMethodInBacktraceApp.called.countDown();
++
++ // wait until test is done
++ RedefineMethodInBacktraceApp.stop.await();
++ } catch (InterruptedException ex) {
++ // ignore, test will fail
++ }
++ }
+ }
+--- ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -28,4 +28,7 @@
+ public class RedefineMethodInBacktraceTargetB {
+ public static void methodToRedefine() {
+ }
++
++ public static void callMethodToDelete() {
++ }
+ }
+--- ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -29,4 +29,8 @@
+ public static void methodToRedefine() {
+ throw new RuntimeException("Test exception 2");
+ }
++
++ public static void callMethodToDelete() {
++ throw new RuntimeException("Test exception 2 in callMethodToDelete");
++ }
+ }
+--- ./jdk/test/java/lang/invoke/8022701/InvokeSeveralWays.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/8022701/InvokeSeveralWays.java Wed Jul 01 21:53:30 2015 -0700
+@@ -38,12 +38,19 @@
+ failures++;
+ } catch (InvocationTargetException e) {
+ Throwable c = e.getCause();
+- if (expected.isInstance(c))
+- System.out.println("EXPECTED: " + expected.getName() + ", "+ c);
+- else {
+- failures++;
+- System.out.println("FAIL: Unexpected wrapped exception " + c);
+- e.printStackTrace(System.out);
++ if (BootstrapMethodError.class.isInstance(c)) {
++ c = c.getCause();
++ if (expected.isInstance(c))
++ System.out.println("EXPECTED: " + expected.getName() + ", "+ c);
++ else {
++ failures++;
++ System.out.println("FAIL: Unexpected wrapped exception " + c);
++ e.printStackTrace(System.out);
++ }
++ } else {
++ failures++;
++ System.out.println("FAIL: Exception from MethodHandle invocation not wrapped in BootstrapMethodError " + c);
++ e.printStackTrace(System.out);
+ }
+ } catch (Throwable e) {
+ failures++;
+@@ -74,14 +81,19 @@
+ Invoker.invoke();
+ System.out.println("FAIL: No exception throw, probably failed to load modified bytecodes for MethodSupplier");
+ failures++;
++ } catch (BootstrapMethodError e) {
++ Throwable c = e.getCause();
++ if (expected.isInstance(c))
++ System.out.println("EXPECTED: " + expected.getName() + ", "+ c);
++ else {
++ failures++;
++ System.out.println("FAIL: Unexpected exception has been caught " + c);
++ e.printStackTrace(System.out);
++ }
+ } catch (Throwable e) {
+- if (expected.isInstance(e))
+- System.out.println("EXPECTED: " + expected.getName() + ", "+ e);
+- else {
+ failures++;
+- System.out.println("FAIL: Unexpected exception has been caught " + e);
++ System.out.println("FAIL: Exception from MethodHandle invocation not wrapped in BootstrapMethodError " + e);
+ e.printStackTrace(System.out);
+- }
+ }
+ System.out.println();
+ try {
+--- ./jdk/test/java/lang/invoke/LFCaching/LFCachingTestCase.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/LFCaching/LFCachingTestCase.java Wed Jul 01 21:53:30 2015 -0700
+@@ -77,7 +77,7 @@
+ }
+ } catch (IllegalAccessException | IllegalArgumentException |
+ SecurityException | InvocationTargetException ex) {
+- throw new Error("Unexpected exception: ", ex);
++ throw new Error("Unexpected exception", ex);
+ }
+ }
+ }
+--- ./jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -24,18 +24,20 @@
+ /*
+ * @test LFGarbageCollectedTest
+ * @bug 8046703
++ * @ignore 8078602
+ * @summary Test verifies that lambda forms are garbage collected
+ * @author kshefov
+ * @library /lib/testlibrary/jsr292 /lib/testlibrary
+- * @ignore 8057020
+ * @build TestMethods
+ * @build LambdaFormTestCase
+ * @build LFGarbageCollectedTest
+- * @run main/othervm LFGarbageCollectedTest
++ * @run main/othervm -Xmx64m -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+HeapDumpOnOutOfMemoryError -DHEAP_DUMP=false LFGarbageCollectedTest
+ */
+
+ import java.lang.invoke.MethodHandle;
++import java.lang.invoke.MethodType;
+ import java.lang.ref.PhantomReference;
++import java.lang.ref.Reference;
+ import java.lang.ref.ReferenceQueue;
+ import java.lang.reflect.InvocationTargetException;
+ import java.util.EnumSet;
+@@ -45,6 +47,7 @@
+ * Lambda forms garbage collection test class.
+ */
+ public final class LFGarbageCollectedTest extends LambdaFormTestCase {
++ private static boolean HEAP_DUMP = Boolean.getBoolean("HEAP_DUMP");
+
+ /**
+ * Constructor for a lambda forms garbage collection test case.
+@@ -56,37 +59,85 @@
+ super(testMethod);
+ }
+
++ PhantomReference ph;
++ ReferenceQueue rq = new ReferenceQueue();
++ MethodType mtype;
++ Map<String, Object> data;
++
+ @Override
+ public void doTest() {
+ try {
+- Map<String, Object> data = getTestMethod().getTestCaseData();
++ TestMethods testCase = getTestMethod();
++ data = testCase.getTestCaseData();
+ MethodHandle adapter;
+ try {
+- adapter = getTestMethod().getTestCaseMH(data, TestMethods.Kind.ONE);
++ adapter = testCase.getTestCaseMH(data, TestMethods.Kind.ONE);
+ } catch (NoSuchMethodException ex) {
+- throw new Error("Unexpected exception: ", ex);
++ throw new Error("Unexpected exception", ex);
+ }
+- Object lambdaForm = LambdaFormTestCase.INTERNAL_FORM.invoke(adapter);
++ mtype = adapter.type();
++ Object lambdaForm = INTERNAL_FORM.invoke(adapter);
+ if (lambdaForm == null) {
+ throw new Error("Unexpected error: Lambda form of the method handle is null");
+ }
+- ReferenceQueue rq = new ReferenceQueue();
+- PhantomReference ph = new PhantomReference(lambdaForm, rq);
++
++ String debugName = (String)DEBUG_NAME.get(lambdaForm);
++ if (debugName != null && debugName.startsWith("identity_")) {
++ // Ignore identity_* LambdaForms.
++ return;
++ }
++
++ ph = new PhantomReference(lambdaForm, rq);
+ lambdaForm = null;
+- data = null;
+ adapter = null;
+- for (int i = 0; i < 1000 && !ph.isEnqueued(); i++) {
+- System.gc();
+- }
+- if (!ph.isEnqueued()) {
+- throw new AssertionError("Error: Lambda form is not garbage collected");
+- }
++
++ collectLambdaForm();
+ } catch (IllegalAccessException | IllegalArgumentException |
+ InvocationTargetException ex) {
+- throw new Error("Unexpected exception: ", ex);
++ throw new Error("Unexpected exception", ex);
+ }
+ }
+
++ private void collectLambdaForm() throws IllegalAccessException {
++ // Usually, 2 System.GCs are necessary to enqueue a SoftReference.
++ System.gc();
++ System.gc();
++
++ Reference ref = null;
++ for (int i = 0; i < 10; i++) {
++ try {
++ ref = rq.remove(1000);
++ } catch (InterruptedException e) {
++ /* ignore */
++ }
++ if (ref != null) {
++ break;
++ }
++ System.gc(); // If the reference hasn't been queued yet, trigger one more GC.
++ }
++
++ if (ref == null) {
++ dumpTestData();
++ System.err.println("Method type: " + mtype);
++ System.err.println("LambdaForm: " + REF_FIELD.get(ph));
++
++ if (HEAP_DUMP) {
++ // Trigger OOM to force heap dump for post-mortem analysis.
++ val = new long[1_000_000_000];
++ }
++ throw new AssertionError("Error: LambdaForm is not garbage collected");
++ };
++ }
++
++ private void dumpTestData() {
++ System.err.println("Test case: " + getTestMethod());
++ for (String s : data.keySet()) {
++ System.err.printf("\t%20s => %s\n", s, data.get(s));
++ }
++ }
++
++ private static long[] val;
++
+ /**
+ * Main routine for lambda forms garbage collection test.
+ *
+@@ -102,7 +153,9 @@
+ TestMethods.IDENTITY,
+ TestMethods.CONSTANT,
+ TestMethods.ARRAY_ELEMENT_GETTER,
+- TestMethods.ARRAY_ELEMENT_SETTER));
++ TestMethods.ARRAY_ELEMENT_SETTER,
++ TestMethods.EXACT_INVOKER,
++ TestMethods.INVOKER));
+ LambdaFormTestCase.runTests(LFGarbageCollectedTest::new, testMethods);
+ }
+ }
+--- ./jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -35,18 +35,23 @@
+ */
+
+ import java.lang.invoke.MethodHandle;
++import java.util.Collections;
+ import java.util.EnumSet;
++import java.util.HashMap;
+ import java.util.Map;
+ import java.util.concurrent.BrokenBarrierException;
+ import java.util.concurrent.ConcurrentLinkedQueue;
+ import java.util.concurrent.CountDownLatch;
+ import java.util.concurrent.CyclicBarrier;
++import com.oracle.testlibrary.jsr292.CodeCacheOverflowProcessor;
+
+ /**
+ * Multiple threaded lambda forms caching test class.
+ */
+ public final class LFMultiThreadCachingTest extends LFCachingTestCase {
++
+ private static final TestMethods.Kind[] KINDS;
++
+ static {
+ EnumSet<TestMethods.Kind> set = EnumSet.complementOf(EnumSet.of(TestMethods.Kind.EXCEPT));
+ KINDS = set.toArray(new TestMethods.Kind[set.size()]);
+@@ -72,21 +77,50 @@
+ ConcurrentLinkedQueue<MethodHandle> adapters = new ConcurrentLinkedQueue<>();
+ CyclicBarrier begin = new CyclicBarrier(CORES);
+ CountDownLatch end = new CountDownLatch(CORES);
++ final Map<Thread, Throwable> threadUncaughtExceptions
++ = Collections.synchronizedMap(new HashMap<Thread, Throwable>(CORES));
+ for (int i = 0; i < CORES; ++i) {
+ TestMethods.Kind kind = KINDS[i % KINDS.length];
+- new Thread(() -> {
++ Thread t = new Thread(() -> {
+ try {
+ begin.await();
+ adapters.add(getTestMethod().getTestCaseMH(data, kind));
+- } catch (InterruptedException | BrokenBarrierException | IllegalAccessException | NoSuchMethodException ex) {
+- throw new Error("Unexpected exception: ", ex);
++ } catch (Throwable ex) {
++ threadUncaughtExceptions.put(Thread.currentThread(), ex);
+ } finally {
+ end.countDown();
+ }
+- }).start();
++ });
++ t.start();
+ }
+ try {
+ end.await();
++ boolean vmeThrown = false;
++ boolean nonVmeThrown = false;
++ Throwable vme = null;
++ for (Map.Entry<Thread,
++ Throwable> entry : threadUncaughtExceptions.entrySet()) {
++ Thread t = entry.getKey();
++ Throwable e = entry.getValue();
++ System.err.printf("%nA thread with name \"%s\" of %d threads"
++ + " has thrown exception:%n", t.getName(), CORES);
++ e.printStackTrace();
++ if (CodeCacheOverflowProcessor.isThrowableCausedByVME(e)) {
++ vmeThrown = true;
++ vme = e;
++ } else {
++ nonVmeThrown = true;
++ }
++ if (nonVmeThrown) {
++ throw new Error("One ore more threads have"
++ + " thrown unexpected exceptions. See log.");
++ }
++ if (vmeThrown) {
++ throw new Error("One ore more threads have"
++ + " thrown VirtualMachineError caused by"
++ + " code cache overflow. See log.", vme);
++ }
++ }
+ } catch (InterruptedException ex) {
+ throw new Error("Unexpected exception: ", ex);
+ }
+--- ./jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -62,7 +62,7 @@
+ adapter1 = getTestMethod().getTestCaseMH(data, TestMethods.Kind.ONE);
+ adapter2 = getTestMethod().getTestCaseMH(data, TestMethods.Kind.TWO);
+ } catch (NoSuchMethodException | IllegalAccessException ex) {
+- throw new Error("Unexpected exception: ", ex);
++ throw new Error("Unexpected exception", ex);
+ }
+ checkLFCaching(adapter1, adapter2);
+ }
+--- ./jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -22,10 +22,12 @@
+ */
+
+ import com.oracle.testlibrary.jsr292.Helper;
+-import com.sun.management.HotSpotDiagnosticMXBean;
+-
++import com.oracle.testlibrary.jsr292.CodeCacheOverflowProcessor;
++import java.lang.invoke.MethodHandle;
+ import java.lang.management.GarbageCollectorMXBean;
+ import java.lang.management.ManagementFactory;
++import java.lang.ref.Reference;
++import java.lang.reflect.Field;
+ import java.lang.reflect.Method;
+ import java.util.Collection;
+ import java.util.List;
+@@ -42,10 +44,6 @@
+ */
+ public abstract class LambdaFormTestCase {
+
+- private final static String METHOD_HANDLE_CLASS_NAME = "java.lang.invoke.MethodHandle";
+- private final static String INTERNAL_FORM_METHOD_NAME = "internalForm";
+- private static final double ITERATIONS_TO_CODE_CACHE_SIZE_RATIO
+- = 45 / (128.0 * 1024 * 1024);
+ private static final long TIMEOUT = Helper.IS_THOROUGH ? 0L : (long) (Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT) * 0.9);
+
+ /**
+@@ -53,6 +51,8 @@
+ * used to get a lambda form from a method handle.
+ */
+ protected final static Method INTERNAL_FORM;
++ protected final static Field DEBUG_NAME;
++ protected final static Field REF_FIELD;
+ private static final List<GarbageCollectorMXBean> gcInfo;
+
+ private static long gcCount() {
+@@ -61,27 +61,98 @@
+
+ static {
+ try {
+- Class mhClass = Class.forName(METHOD_HANDLE_CLASS_NAME);
+- INTERNAL_FORM = mhClass.getDeclaredMethod(INTERNAL_FORM_METHOD_NAME);
++ INTERNAL_FORM = MethodHandle.class.getDeclaredMethod("internalForm");
+ INTERNAL_FORM.setAccessible(true);
++
++ DEBUG_NAME = Class.forName("java.lang.invoke.LambdaForm").getDeclaredField("debugName");
++ DEBUG_NAME.setAccessible(true);
++
++ REF_FIELD = Reference.class.getDeclaredField("referent");
++ REF_FIELD.setAccessible(true);
+ } catch (Exception ex) {
+- throw new Error("Unexpected exception: ", ex);
++ throw new Error("Unexpected exception", ex);
+ }
+
+ gcInfo = ManagementFactory.getGarbageCollectorMXBeans();
+- if (gcInfo.size() == 0) {
++ if (gcInfo.size() == 0) {
+ throw new Error("No GarbageCollectorMXBeans found.");
+ }
+ }
+
+ private final TestMethods testMethod;
+- private static long totalIterations = 0L;
+- private static long doneIterations = 0L;
+- private static boolean passed = true;
+- private static int testCounter = 0;
+- private static int failCounter = 0;
+ private long gcCountAtStart;
+
++ private static class TestRun {
++
++ final Function<TestMethods, LambdaFormTestCase> ctor;
++ final Collection<TestMethods> testMethods;
++ final long totalIterations;
++ long doneIterations;
++ long testCounter;
++ long failCounter;
++ boolean passed;
++
++ TestRun(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
++ this.ctor = ctor;
++ this.testMethods = testMethods;
++ long testCaseNum = testMethods.size();
++ long iterations = Math.max(1, Helper.TEST_LIMIT / testCaseNum);
++ System.out.printf("Number of iterations according to -DtestLimit is %d (%d cases)%n",
++ iterations, iterations * testCaseNum);
++ System.out.printf("Number of iterations is set to %d (%d cases)%n",
++ iterations, iterations * testCaseNum);
++ System.out.flush();
++ totalIterations = iterations;
++ doneIterations = 0L;
++ testCounter = 0L;
++ failCounter = 0L;
++ passed = true;
++ }
++
++ Boolean doIteration() {
++ if (doneIterations >= totalIterations) {
++ return false;
++ }
++ System.err.println(String.format("Iteration %d:", doneIterations));
++ for (TestMethods testMethod : testMethods) {
++ LambdaFormTestCase testCase = ctor.apply(testMethod);
++ try {
++ System.err.printf("Tested LF caching feature"
++ + " with MethodHandles.%s method.%n",
++ testCase.getTestMethod().name);
++ Throwable t = CodeCacheOverflowProcessor
++ .runMHTest(testCase::doTest);
++ if (t != null) {
++ return false;
++ }
++ System.err.println("PASSED");
++ } catch (OutOfMemoryError oome) {
++ // Don't swallow OOME so a heap dump can be created.
++ System.err.println("FAILED");
++ throw oome;
++ } catch (Throwable t) {
++ t.printStackTrace();
++ System.err.printf("FAILED. Caused by %s%n", t.getMessage());
++ passed = false;
++ failCounter++;
++ }
++ testCounter++;
++ }
++ doneIterations++;
++ return true;
++ }
++
++ void checkPassed() {
++ if (!passed) {
++ throw new Error(String.format("%d of %d test cases FAILED! %n"
++ + "Rerun the test with the same \"-Dseed=\" option as in the log file!",
++ failCounter, testCounter));
++ } else {
++ System.err.printf("All %d test cases PASSED!%n", testCounter);
++ }
++ }
++ }
++
+ /**
+ * Test case constructor. Generates test cases with random method types for
+ * given methods form {@code j.l.i.MethodHandles} class.
+@@ -115,61 +186,15 @@
+ * @param testMethods list of test methods
+ */
+ public static void runTests(Function<TestMethods, LambdaFormTestCase> ctor, Collection<TestMethods> testMethods) {
+- long testCaseNum = testMethods.size();
+- totalIterations = Math.max(1, Helper.TEST_LIMIT / testCaseNum);
+- System.out.printf("Number of iterations according to -DtestLimit is %d (%d cases)%n",
+- totalIterations, totalIterations * testCaseNum);
+- HotSpotDiagnosticMXBean hsDiagBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
+- long codeCacheSize = Long.parseLong(
+- hsDiagBean.getVMOption("ReservedCodeCacheSize").getValue());
+- System.out.printf("Code Cache Size is %d bytes%n", codeCacheSize);
+- long iterationsByCodeCacheSize = (long) (codeCacheSize
+- * ITERATIONS_TO_CODE_CACHE_SIZE_RATIO);
+- System.out.printf("Number of iterations limited by code cache size is %d (%d cases)%n",
+- iterationsByCodeCacheSize, iterationsByCodeCacheSize * testCaseNum);
+- if (totalIterations > iterationsByCodeCacheSize) {
+- totalIterations = iterationsByCodeCacheSize;
+- }
+- System.out.printf("Number of iterations is set to %d (%d cases)%n",
+- totalIterations, totalIterations * testCaseNum);
+- System.out.flush();
+- TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d,
+- () -> {
+- if (doneIterations >= totalIterations) {
+- return false;
+- }
+- System.err.println(String.format("Iteration %d:", doneIterations));
+- for (TestMethods testMethod : testMethods) {
+- LambdaFormTestCase testCase = ctor.apply(testMethod);
+- try {
+- System.err.printf("Tested LF caching feature with MethodHandles.%s method.%n",
+- testCase.getTestMethod().name);
+- testCase.doTest();
+- System.err.println("PASSED");
+- } catch (Throwable t) {
+- t.printStackTrace();
+- System.err.println("FAILED");
+- passed = false;
+- failCounter++;
+- }
+- testCounter++;
+- }
+- doneIterations++;
+- return true;
+- });
++ LambdaFormTestCase.TestRun run
++ = new LambdaFormTestCase.TestRun(ctor, testMethods);
++ TimeLimitedRunner runner = new TimeLimitedRunner(TIMEOUT, 4.0d, run::doIteration);
+ try {
+ runner.call();
+- } catch (Throwable t) {
+- t.printStackTrace();
++ } catch (Exception ex) {
+ System.err.println("FAILED");
+- throw new Error("Unexpected error!");
++ throw new Error("Unexpected error!", ex);
+ }
+- if (!passed) {
+- throw new Error(String.format("%d of %d test cases FAILED! %n"
+- + "Rerun the test with the same \"-Dseed=\" option as in the log file!",
+- failCounter, testCounter));
+- } else {
+- System.err.println(String.format("All %d test cases PASSED!", testCounter));
+- }
++ run.checkPassed();
+ }
+ }
+--- ./jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -23,7 +23,10 @@
+ package test.java.lang.invoke.MethodHandles;
+
+ import com.oracle.testlibrary.jsr292.Helper;
++import com.oracle.testlibrary.jsr292.CodeCacheOverflowProcessor;
+ import jdk.testlibrary.Asserts;
++import jdk.testlibrary.TimeLimitedRunner;
++import jdk.testlibrary.Utils;
+
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+@@ -37,10 +40,10 @@
+ /* @test
+ * @library /lib/testlibrary/jsr292 /lib/testlibrary/
+ * @compile CatchExceptionTest.java
+- * @build jdk.testlibrary.*
+ * @run main/othervm -esa test.java.lang.invoke.MethodHandles.CatchExceptionTest
+ */
+ public class CatchExceptionTest {
++
+ private static final List<Class<?>> ARGS_CLASSES;
+ protected static final int MAX_ARITY = Helper.MAX_ARITY - 1;
+
+@@ -69,12 +72,6 @@
+ final int catchDrops) {
+ this.testCase = testCase;
+ this.dropped = catchDrops;
+- if (Helper.IS_VERBOSE) {
+- System.out.printf("CatchException::CatchException(%s, isVararg=%b " +
+- "argsCount=%d catchDrops=%d)%n",
+- testCase, isVararg, argsCount, catchDrops
+- );
+- }
+ MethodHandle thrower = testCase.thrower;
+ int throwerLen = thrower.type().parameterCount();
+ List<Class<?>> classes;
+@@ -94,21 +91,34 @@
+ }
+
+ public static void main(String[] args) throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(CatchExceptionTest::test);
++ }
++
++ public static void test() throws Throwable {
++ System.out.println("classes = " + ARGS_CLASSES);
++ TestFactory factory = new TestFactory();
++ long timeout = Helper.IS_THOROUGH ? 0L : Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT);
++ // subtract vm init time and reserve time for vm exit
++ timeout *= 0.9;
++ TimeLimitedRunner runner = new TimeLimitedRunner(timeout, 2.0d,
++ () -> {
++ CatchExceptionTest test = factory.nextTest();
++ if (test != null) {
++ test.runTest();
++ return true;
++ }
++ return false;
++ });
+ for (CatchExceptionTest test : TestFactory.MANDATORY_TEST_CASES) {
+ test.runTest();
+ }
+- TestFactory factory = new TestFactory();
+- CatchExceptionTest test;
+- while ((test = factory.nextTest()) != null ) {
+- test.runTest();
+- }
++ runner.call();
+ }
+
+ private List<Class<?>> getThrowerParams(boolean isVararg, int argsCount) {
+ return Helper.getParams(ARGS_CLASSES, isVararg, argsCount);
+ }
+
+-
+ private List<Class<?>> getCatcherParams() {
+ int catchArgc = 1 + this.argsCount - dropped;
+ List<Class<?>> result = new ArrayList<>(
+@@ -119,6 +129,13 @@
+ }
+
+ private void runTest() {
++ if (Helper.IS_VERBOSE) {
++ System.out.printf("CatchException(%s, isVararg=%b argsCount=%d "
++ + "dropped=%d)%n",
++ testCase, thrower.isVarargsCollector(),
++ argsCount, dropped);
++ }
++
+ Helper.clear();
+
+ Object[] args = Helper.randomArgs(
+@@ -172,7 +189,7 @@
+ {CatchExceptionTest.MAX_ARITY, 0},
+ {CatchExceptionTest.MAX_ARITY, CatchExceptionTest.MAX_ARITY},
+ }) {
+- MANDATORY_TEST_CASES.addAll(createTests(args[0], args[1]));
++ MANDATORY_TEST_CASES.addAll(createTests(args[0], args[1]));
+ }
+ }
+
+@@ -200,10 +217,7 @@
+ args = 1;
+ }
+
+- if (Helper.IS_VERBOSE) {
+- System.out.printf("maxArgs = %d%nmaxDrops = %d%n",
+- maxArgs, maxDrops);
+- }
++ System.out.printf("maxArgs = %d%nmaxDrops = %d%n", maxArgs, maxDrops);
+ constructorSize = TestCase.CONSTRUCTORS.size();
+ }
+
+@@ -230,8 +244,9 @@
+ }
+
+ /**
+- * @return next test from test matrix:
+- * {varArgs, noVarArgs} x TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x {1, .., maxDrops}
++ * @return next test from test matrix: {varArgs, noVarArgs} x
++ * TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x
++ * {0, .., maxDrops}
+ */
+ public CatchExceptionTest nextTest() {
+ if (constructor < constructorSize) {
+@@ -244,7 +259,7 @@
+ return null;
+ }
+ if (dropArgs <= currentMaxDrops) {
+- if (dropArgs == 1) {
++ if (dropArgs == 0) {
+ if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) {
+ ++dropArgs;
+ return createTest();
+@@ -259,8 +274,8 @@
+ }
+ }
+
+- if (args <= maxArgs) {
+- dropArgs = 1;
++ if (args < maxArgs) {
++ dropArgs = 0;
+ currentMaxDrops = Math.min(args, maxDrops);
+ ++args;
+ return createTest();
+@@ -274,17 +289,17 @@
+ TestCase.CONSTRUCTORS.get(constructor++).get(),
+ Helper.RNG.nextBoolean(), args, dropArgs);
+ } else {
+- if (isVararg) {
+- isVararg = false;
+- return new CatchExceptionTest(
+- TestCase.CONSTRUCTORS.get(constructor++).get(),
+- isVararg, args, dropArgs);
+- } else {
+- isVararg = true;
+- return new CatchExceptionTest(
+- TestCase.CONSTRUCTORS.get(constructor).get(),
+- isVararg, args, dropArgs);
+- }
++ if (isVararg) {
++ isVararg = false;
++ return new CatchExceptionTest(
++ TestCase.CONSTRUCTORS.get(constructor++).get(),
++ isVararg, args, dropArgs);
++ } else {
++ isVararg = true;
++ return new CatchExceptionTest(
++ TestCase.CONSTRUCTORS.get(constructor).get(),
++ isVararg, args, dropArgs);
++ }
+ }
+ }
+ }
+@@ -412,7 +427,7 @@
+ }
+
+ private static <T extends Throwable>
+- Object throwOrReturn(Object normal, T exception) throws T {
++ Object throwOrReturn(Object normal, T exception) throws T {
+ if (exception != null) {
+ Helper.called("throwOrReturn/throw", normal, exception);
+ throw exception;
+@@ -421,8 +436,7 @@
+ return normal;
+ }
+
+- private static <T extends Throwable>
+- Object catcher(Object o) {
++ private static <T extends Throwable> Object catcher(Object o) {
+ Helper.called("catcher", o);
+ return o;
+ }
+@@ -433,7 +447,7 @@
+
+ public MethodHandle getCatcher(List<Class<?>> classes) {
+ return MethodHandles.filterReturnValue(Helper.AS_LIST.asType(
+- MethodType.methodType(Object.class, classes)),
++ MethodType.methodType(Object.class, classes)),
+ CATCHER
+ );
+ }
+--- ./jdk/test/java/lang/invoke/MethodHandlesTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/MethodHandlesTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2009, 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
+@@ -23,6 +23,7 @@
+
+ /* @test
+ * @summary unit tests for java.lang.invoke.MethodHandles
++ * @library /lib/testlibrary /lib/testlibrary/jsr292
+ * @compile MethodHandlesTest.java remote/RemoteExample.java
+ * @run junit/othervm/timeout=2500 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies -esa test.java.lang.invoke.MethodHandlesTest
+ */
+@@ -36,6 +37,7 @@
+ import java.util.*;
+ import org.junit.*;
+ import static org.junit.Assert.*;
++import com.oracle.testlibrary.jsr292.CodeCacheOverflowProcessor;
+
+
+ /**
+@@ -499,6 +501,10 @@
+
+ @Test
+ public void testFindStatic() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindStatic0);
++ }
++
++ public void testFindStatic0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("findStatic");
+ testFindStatic(PubExample.class, void.class, "s0");
+@@ -586,6 +592,10 @@
+
+ @Test
+ public void testFindVirtual() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindVirtual0);
++ }
++
++ public void testFindVirtual0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("findVirtual");
+ testFindVirtual(Example.class, void.class, "v0");
+@@ -616,6 +626,10 @@
+
+ @Test
+ public void testFindVirtualClone() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindVirtualClone0);
++ }
++
++ public void testFindVirtualClone0() throws Throwable {
+ // test some ad hoc system methods
+ testFindVirtual(false, PUBLIC, Object.class, Object.class, "clone");
+ testFindVirtual(true, PUBLIC, Object[].class, Object.class, "clone");
+@@ -699,6 +713,10 @@
+
+ @Test
+ public void testFindSpecial() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindSpecial0);
++ }
++
++ public void testFindSpecial0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("findSpecial");
+ testFindSpecial(SubExample.class, Example.class, void.class, "v0");
+@@ -775,6 +793,10 @@
+
+ @Test
+ public void testFindConstructor() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindConstructor0);
++ }
++
++ public void testFindConstructor0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("findConstructor");
+ testFindConstructor(true, EXAMPLE, Example.class);
+@@ -818,6 +840,10 @@
+
+ @Test
+ public void testBind() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testBind0);
++ }
++
++ public void testBind0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("bind");
+ testBind(Example.class, void.class, "v0");
+@@ -879,6 +905,10 @@
+
+ @Test
+ public void testUnreflect() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testUnreflect0);
++ }
++
++ public void testUnreflect0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("unreflect");
+ testUnreflect(Example.class, true, void.class, "s0");
+@@ -985,6 +1015,10 @@
+
+ @Test
+ public void testUnreflectSpecial() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testUnreflectSpecial0);
++ }
++
++ public void testUnreflectSpecial0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("unreflectSpecial");
+ testUnreflectSpecial(Example.class, Example.class, void.class, "v0");
+@@ -1077,23 +1111,38 @@
+
+ @Test
+ public void testUnreflectGetter() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testUnreflectGetter0);
++ }
++
++ public void testUnreflectGetter0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("unreflectGetter");
+ testGetter(TEST_UNREFLECT);
+ }
++
+ @Test
+ public void testFindGetter() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindGetter0);
++ }
++
++ public void testFindGetter0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("findGetter");
+ testGetter(TEST_FIND_FIELD);
+ testGetter(TEST_FIND_FIELD | TEST_BOUND);
+ }
++
+ @Test
+ public void testFindStaticGetter() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindStaticGetter0);
++ }
++
++ public void testFindStaticGetter0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("findStaticGetter");
+ testGetter(TEST_FIND_STATIC);
+ }
++
+ public void testGetter(int testMode) throws Throwable {
+ Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
+ for (Object[] c : HasFields.CASES) {
+@@ -1287,26 +1336,40 @@
+ }
+ }
+
+-
+ @Test
+ public void testUnreflectSetter() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testUnreflectSetter0);
++ }
++
++ public void testUnreflectSetter0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("unreflectSetter");
+ testSetter(TEST_UNREFLECT);
+ }
++
+ @Test
+ public void testFindSetter() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindSetter0);
++ }
++
++ public void testFindSetter0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("findSetter");
+ testSetter(TEST_FIND_FIELD);
+ testSetter(TEST_FIND_FIELD | TEST_BOUND);
+ }
++
+ @Test
+ public void testFindStaticSetter() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFindStaticSetter0);
++ }
++
++ public void testFindStaticSetter0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("findStaticSetter");
+ testSetter(TEST_FIND_STATIC);
+ }
++
+ public void testSetter(int testMode) throws Throwable {
+ Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
+ startTest("unreflectSetter");
+@@ -1329,6 +1392,10 @@
+
+ @Test
+ public void testArrayElementGetter() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testArrayElementGetter0);
++ }
++
++ public void testArrayElementGetter0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("arrayElementGetter");
+ testArrayElementGetterSetter(false);
+@@ -1336,6 +1403,10 @@
+
+ @Test
+ public void testArrayElementSetter() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testArrayElementSetter0);
++ }
++
++ public void testArrayElementSetter0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("arrayElementSetter");
+ testArrayElementGetterSetter(true);
+@@ -1349,6 +1420,10 @@
+
+ @Test
+ public void testArrayElementErrors() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testArrayElementErrors0);
++ }
++
++ public void testArrayElementErrors0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("arrayElementErrors");
+ testArrayElementGetterSetter(false, TEST_ARRAY_NPE);
+@@ -1528,6 +1603,10 @@
+
+ @Test
+ public void testConvertArguments() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testConvertArguments0);
++ }
++
++ public void testConvertArguments0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("convertArguments");
+ testConvert(Callee.ofType(1), null, "id", int.class);
+@@ -1591,6 +1670,10 @@
+
+ @Test
+ public void testVarargsCollector() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testVarargsCollector0);
++ }
++
++ public void testVarargsCollector0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("varargsCollector");
+ MethodHandle vac0 = PRIVATE.findStatic(MethodHandlesTest.class, "called",
+@@ -1605,8 +1688,12 @@
+ }
+ }
+
+- @Test // SLOW
++ @Test // SLOW
+ public void testPermuteArguments() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testPermuteArguments0);
++ }
++
++ public void testPermuteArguments0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("permuteArguments");
+ testPermuteArguments(4, Integer.class, 2, long.class, 6);
+@@ -1744,8 +1831,12 @@
+ }
+
+
+- @Test // SLOW
++ @Test // SLOW
+ public void testSpreadArguments() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testSpreadArguments0);
++ }
++
++ public void testSpreadArguments0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("spreadArguments");
+ for (Class<?> argType : new Class<?>[]{Object.class, Integer.class, int.class}) {
+@@ -1838,8 +1929,12 @@
+ }
+ }
+
+- @Test // SLOW
++ @Test // SLOW
+ public void testAsCollector() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testAsCollector0);
++ }
++
++ public void testAsCollector0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("asCollector");
+ for (Class<?> argType : new Class<?>[]{Object.class, Integer.class, int.class}) {
+@@ -1880,8 +1975,12 @@
+ assertArrayEquals(collectedArgs, returnValue);
+ }
+
+- @Test // SLOW
++ @Test // SLOW
+ public void testInsertArguments() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testInsertArguments0);
++ }
++
++ public void testInsertArguments0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("insertArguments");
+ for (int nargs = 0; nargs < 50; nargs++) {
+@@ -1923,6 +2022,10 @@
+
+ @Test
+ public void testFilterReturnValue() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFilterReturnValue0);
++ }
++
++ public void testFilterReturnValue0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("filterReturnValue");
+ Class<?> classOfVCList = varargsList(1).invokeWithArguments(0).getClass();
+@@ -1972,6 +2075,10 @@
+
+ @Test
+ public void testFilterArguments() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFilterArguments0);
++ }
++
++ public void testFilterArguments0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("filterArguments");
+ for (int nargs = 1; nargs <= 6; nargs++) {
+@@ -2004,6 +2111,10 @@
+
+ @Test
+ public void testCollectArguments() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testCollectArguments0);
++ }
++
++ public void testCollectArguments0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("collectArguments");
+ testFoldOrCollectArguments(true);
+@@ -2011,6 +2122,10 @@
+
+ @Test
+ public void testFoldArguments() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testFoldArguments0);
++ }
++
++ public void testFoldArguments0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("foldArguments");
+ testFoldOrCollectArguments(false);
+@@ -2112,6 +2227,10 @@
+
+ @Test
+ public void testDropArguments() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testDropArguments0);
++ }
++
++ public void testDropArguments0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("dropArguments");
+ for (int nargs = 0; nargs <= 4; nargs++) {
+@@ -2143,6 +2262,10 @@
+
+ @Test // SLOW
+ public void testInvokers() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testInvokers0);
++ }
++
++ public void testInvokers0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("exactInvoker, genericInvoker, varargsInvoker, dynamicInvoker");
+ // exactInvoker, genericInvoker, varargsInvoker[0..N], dynamicInvoker
+@@ -2344,6 +2467,10 @@
+
+ @Test
+ public void testGuardWithTest() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testGuardWithTest0);
++ }
++
++ public void testGuardWithTest0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("guardWithTest");
+ for (int nargs = 0; nargs <= 50; nargs++) {
+@@ -2415,6 +2542,10 @@
+
+ @Test
+ public void testThrowException() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testThrowException0);
++ }
++
++ public void testThrowException0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("throwException");
+ testThrowException(int.class, new ClassCastException("testing"));
+@@ -2446,6 +2577,10 @@
+
+ @Test
+ public void testInterfaceCast() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testInterfaceCast0);
++ }
++
++ public void testInterfaceCast0() throws Throwable {
+ //if (CAN_SKIP_WORKING) return;
+ startTest("interfaceCast");
+ assert( (((Object)"foo") instanceof CharSequence));
+@@ -2543,6 +2678,10 @@
+
+ @Test // SLOW
+ public void testCastFailure() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testCastFailure0);
++ }
++
++ public void testCastFailure0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("testCastFailure");
+ testCastFailure("cast/argument", 11000);
+@@ -2655,6 +2794,10 @@
+
+ @Test
+ public void testUserClassInSignature() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testUserClassInSignature0);
++ }
++
++ public void testUserClassInSignature0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("testUserClassInSignature");
+ Lookup lookup = MethodHandles.lookup();
+@@ -2706,6 +2849,10 @@
+
+ @Test
+ public void testAsInterfaceInstance() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testAsInterfaceInstance0);
++ }
++
++ public void testAsInterfaceInstance0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("asInterfaceInstance");
+ Lookup lookup = MethodHandles.lookup();
+@@ -2869,6 +3016,10 @@
+
+ @Test
+ public void testRunnableProxy() throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(this::testRunnableProxy0);
++ }
++
++ public void testRunnableProxy0() throws Throwable {
+ if (CAN_SKIP_WORKING) return;
+ startTest("testRunnableProxy");
+ MethodHandles.Lookup lookup = MethodHandles.lookup();
+--- ./jdk/test/java/lang/invoke/TestCatchExceptionWithVarargs.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/TestCatchExceptionWithVarargs.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -24,9 +24,12 @@
+ /*
+ * @test
+ * @bug 8019184
++ * @library /lib/testlibrary /lib/testlibrary/jsr292
+ * @summary MethodHandles.catchException() fails when methods have 8 args + varargs
++ * @run main TestCatchExceptionWithVarargs
+ */
+
++import com.oracle.testlibrary.jsr292.CodeCacheOverflowProcessor;
+ import java.util.*;
+ import java.lang.invoke.*;
+
+@@ -68,6 +71,11 @@
+ }
+
+ public static void main(String[] args) throws Throwable {
++ CodeCacheOverflowProcessor
++ .runMHTest(TestCatchExceptionWithVarargs::test);
++ }
++
++ public static void test() throws Throwable {
+ List<Class<?>> ptypes = new LinkedList<>();
+ ptypes.add(Object[].class);
+
+--- ./jdk/test/java/lang/invoke/VarargsArrayTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/invoke/VarargsArrayTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 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
+@@ -24,14 +24,14 @@
+ package java.lang.invoke;
+
+ import sun.invoke.util.Wrapper;
+-
+ import java.util.Arrays;
+ import java.util.Collections;
++import com.oracle.testlibrary.jsr292.CodeCacheOverflowProcessor;
+
+ /* @test
+ * @summary unit tests for varargs array methods: MethodHandleInfo.varargsArray(int),
+ * MethodHandleInfo.varargsArray(Class,int) & MethodHandleInfo.varargsList(int)
+- *
++ * @library /lib/testlibrary /lib/testlibrary/jsr292
+ * @run main/bootclasspath java.lang.invoke.VarargsArrayTest
+ * @run main/bootclasspath -DVarargsArrayTest.MAX_ARITY=255 -DVarargsArrayTest.START_ARITY=250
+ * java.lang.invoke.VarargsArrayTest
+@@ -47,6 +47,10 @@
+ private static final boolean EXHAUSTIVE = Boolean.getBoolean(CLASS.getSimpleName()+".EXHAUSTIVE");
+
+ public static void main(String[] args) throws Throwable {
++ CodeCacheOverflowProcessor.runMHTest(VarargsArrayTest::test);
++ }
++
++ public static void test() throws Throwable {
+ testVarargsArray();
+ testVarargsReferenceArray();
+ testVarargsPrimitiveArray();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/lang/invoke/lambda/LambdaStackTrace.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,204 @@
++/*
++ * 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 8025636
++ * @summary Synthetic frames should be hidden in exceptions
++ * @compile -XDignore.symbol.file LUtils.java LambdaStackTrace.java
++ * @run main LambdaStackTrace
++ */
++
++import jdk.internal.org.objectweb.asm.ClassWriter;
++
++import java.io.File;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.lang.reflect.InvocationTargetException;
++import java.lang.reflect.Method;
++import java.util.ArrayList;
++
++import static jdk.internal.org.objectweb.asm.Opcodes.ACC_ABSTRACT;
++import static jdk.internal.org.objectweb.asm.Opcodes.ACC_INTERFACE;
++import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
++import static jdk.internal.org.objectweb.asm.Opcodes.V1_7;
++
++public class LambdaStackTrace {
++
++ static File classes = new File(System.getProperty("test.classes"));
++
++ public static void main(String[] args) throws Exception {
++ testBasic();
++ testBridgeMethods();
++ }
++
++ /**
++ * Test the simple case
++ */
++ private static void testBasic() throws Exception {
++ try {
++ Runnable r = () -> {
++ throw new RuntimeException();
++ };
++ r.run();
++ } catch (Exception ex) {
++ // Before 8025636 the stacktrace would look like:
++ // at LambdaStackTrace.lambda$main$0(LambdaStackTrace.java:37)
++ // at LambdaStackTrace$$Lambda$1/1937396743.run(<Unknown>:1000000)
++ // at LambdaStackTrace.testBasic(LambdaStackTrace.java:40)
++ // at ...
++ //
++ // We are verifying that the middle frame above is gone.
++
++ verifyFrames(ex.getStackTrace(),
++ "LambdaStackTrace\\..*",
++ "LambdaStackTrace.testBasic");
++ }
++ }
++
++ /**
++ * Test the more complicated case with bridge methods.
++ *
++ * We set up the following interfaces:
++ *
++ * interface Maker {
++ * Object make();
++ * }
++ * interface StringMaker extends Maker {
++ * String make();
++ * }
++ *
++ * And we will use them like so:
++ *
++ * StringMaker sm = () -> { throw new RuntimeException(); };
++ * sm.make();
++ * ((Maker)m).make();
++ *
++ * The first call is a "normal" interface call, the second will use a
++ * bridge method. In both cases the generated lambda frame should
++ * be removed from the stack trace.
++ */
++ private static void testBridgeMethods() throws Exception {
++ // setup
++ generateInterfaces();
++ compileCaller();
++
++ // test
++ StackTraceElement[] frames = call("Caller", "callStringMaker");
++ verifyFrames(frames,
++ "Caller\\..*",
++ "Caller.callStringMaker");
++
++ frames = call("Caller", "callMaker");
++ verifyFrames(frames,
++ "Caller\\..*",
++ "Caller.callMaker");
++ }
++
++ private static void generateInterfaces() throws IOException {
++ // We can't let javac compile these interfaces because in > 1.8 it will insert
++ // bridge methods into the interfaces - we want code that looks like <= 1.7,
++ // so we generate it.
++ try (FileOutputStream fw = new FileOutputStream(new File(classes, "Maker.class"))) {
++ fw.write(generateMaker());
++ }
++ try (FileOutputStream fw = new FileOutputStream(new File(classes, "StringMaker.class"))) {
++ fw.write(generateStringMaker());
++ }
++ }
++
++ private static byte[] generateMaker() {
++ // interface Maker {
++ // Object make();
++ // }
++ ClassWriter cw = new ClassWriter(0);
++ cw.visit(V1_7, ACC_INTERFACE | ACC_ABSTRACT, "Maker", null, "java/lang/Object", null);
++ cw.visitMethod(ACC_PUBLIC | ACC_ABSTRACT, "make",
++ "()Ljava/lang/Object;", null, null);
++ cw.visitEnd();
++ return cw.toByteArray();
++ }
++
++ private static byte[] generateStringMaker() {
++ // interface StringMaker extends Maker {
++ // String make();
++ // }
++ ClassWriter cw = new ClassWriter(0);
++ cw.visit(V1_7, ACC_INTERFACE | ACC_ABSTRACT, "StringMaker", null, "java/lang/Object", new String[]{"Maker"});
++ cw.visitMethod(ACC_PUBLIC | ACC_ABSTRACT, "make",
++ "()Ljava/lang/String;", null, null);
++ cw.visitEnd();
++ return cw.toByteArray();
++ }
++
++
++ static void emitCode(File f) {
++ ArrayList<String> scratch = new ArrayList<>();
++ scratch.add("public class Caller {");
++ scratch.add(" public static void callStringMaker() {");
++ scratch.add(" StringMaker sm = () -> { throw new RuntimeException(); };");
++ scratch.add(" sm.make();");
++ scratch.add(" }");
++ scratch.add(" public static void callMaker() {");
++ scratch.add(" StringMaker sm = () -> { throw new RuntimeException(); };");
++ scratch.add(" ((Maker) sm).make();"); // <-- This will call the bridge method
++ scratch.add(" }");
++ scratch.add("}");
++ LUtils.createFile(f, scratch);
++ }
++
++ static void compileCaller() {
++ File caller = new File(classes, "Caller.java");
++ emitCode(caller);
++ LUtils.compile("-cp", classes.getAbsolutePath(), "-d", classes.getAbsolutePath(), caller.getAbsolutePath());
++ }
++
++ private static void verifyFrames(StackTraceElement[] stack, String... patterns) throws Exception {
++ for (int i = 0; i < patterns.length; i++) {
++ String cm = stack[i].getClassName() + "." + stack[i].getMethodName();
++ if (!cm.matches(patterns[i])) {
++ System.err.println("Actual trace did not match expected trace at frame " + i);
++ System.err.println("Expected frame patterns:");
++ for (int j = 0; j < patterns.length; j++) {
++ System.err.println(" " + j + ": " + patterns[j]);
++ }
++ System.err.println("Actual frames:");
++ for (int j = 0; j < patterns.length; j++) {
++ System.err.println(" " + j + ": " + stack[j]);
++ }
++ throw new Exception("Incorrect stack frames found");
++ }
++ }
++ }
++
++ private static StackTraceElement[] call(String clazz, String method) throws Exception {
++ Class<?> c = Class.forName(clazz);
++ try {
++ Method m = c.getDeclaredMethod(method);
++ m.invoke(null);
++ } catch(InvocationTargetException ex) {
++ return ex.getTargetException().getStackTrace();
++ }
++ throw new Exception("Expected exception to be thrown");
++ }
++}
+--- ./jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2010, 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
+@@ -33,6 +33,9 @@
+ * @library /lib/testlibrary/
+ * @build LowMemoryTest MemoryUtil RunUtil
+ * @run main/timeout=600 LowMemoryTest
++ * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
++ * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
++ * @requires vm.opt.DisableExplicitGC != "true"
+ */
+
+ import java.lang.management.*;
+@@ -85,9 +88,15 @@
+ }
+
+ static class TestListener implements NotificationListener {
++ private boolean isRelaxed = false;
+ private int triggers = 0;
+ private final long[] count = new long[NUM_TRIGGERS * 2];
+ private final long[] usedMemory = new long[NUM_TRIGGERS * 2];
++
++ public TestListener() {
++ isRelaxed = ManagementFactory.getRuntimeMXBean().getInputArguments().contains("-XX:+UseConcMarkSweepGC");
++ }
++
+ @Override
+ public void handleNotification(Notification notif, Object handback) {
+ MemoryNotificationInfo minfo = MemoryNotificationInfo.
+@@ -97,7 +106,8 @@
+ triggers++;
+ }
+ public void checkResult() throws Exception {
+- if (triggers != NUM_TRIGGERS) {
++ if ((!isRelaxed && triggers != NUM_TRIGGERS) ||
++ (isRelaxed && triggers < NUM_TRIGGERS)) {
+ throw new RuntimeException("Unexpected number of triggers = " +
+ triggers + " but expected to be " + NUM_TRIGGERS);
+ }
+--- ./jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2010, 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
+@@ -27,21 +27,19 @@
+ * @summary Basic unit test of ThreadMXBean.getAllThreadIds()
+ * @author Alexei Guibadoulline and Mandy Chung
+ *
+- * @run build Barrier
+ * @run main/othervm AllThreadIds
+ */
+
+ import java.lang.management.*;
+-import java.util.*;
++import java.util.concurrent.Phaser;
+
+ public class AllThreadIds {
+ final static int DAEMON_THREADS = 20;
+ final static int USER_THREADS = 5;
+ final static int ALL_THREADS = DAEMON_THREADS + USER_THREADS;
+- private static volatile boolean live[] = new boolean[ALL_THREADS];
+- private static Thread allThreads[] = new Thread[ALL_THREADS];
+- private static ThreadMXBean mbean
+- = ManagementFactory.getThreadMXBean();
++ private static final boolean live[] = new boolean[ALL_THREADS];
++ private static final Thread allThreads[] = new Thread[ALL_THREADS];
++ private static final ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
+ private static boolean testFailed = false;
+ private static boolean trace = false;
+
+@@ -52,8 +50,7 @@
+ private static int curLiveThreadCount = 0;
+ private static int curPeakThreadCount = 0;
+
+- // barrier for threads communication
+- private static Barrier barrier = new Barrier(ALL_THREADS);
++ private static final Phaser startupCheck = new Phaser(ALL_THREADS + 1);
+
+ private static void printThreadList() {
+ if (!trace) return;
+@@ -124,18 +121,15 @@
+ curPeakThreadCount = mbean.getPeakThreadCount();
+ checkThreadCount(0, 0);
+
+-
+ // Start all threads and wait to be sure they all are alive
+- barrier.set(ALL_THREADS);
+ for (int i = 0; i < ALL_THREADS; i++) {
+- live[i] = true;
++ setLive(i, true);
+ allThreads[i] = new MyThread(i);
+- allThreads[i].setDaemon( (i < DAEMON_THREADS) ? true : false);
++ allThreads[i].setDaemon(i < DAEMON_THREADS);
+ allThreads[i].start();
+ }
+ // wait until all threads are started.
+- barrier.await();
+-
++ startupCheck.arriveAndAwaitAdvance();
+
+ checkThreadCount(ALL_THREADS, 0);
+ printThreadList();
+@@ -173,15 +167,14 @@
+
+ // Stop daemon threads, wait to be sure they all are dead, and check
+ // that they disappeared from getAllThreadIds() list
+- barrier.set(DAEMON_THREADS);
+ for (int i = 0; i < DAEMON_THREADS; i++) {
+- live[i] = false;
++ setLive(i, false);
+ }
+- // wait until daemon threads are terminated.
+- barrier.await();
+
+- // give chance to threads to terminate
+- pause();
++ // make sure the daemon threads are completely dead
++ joinDaemonThreads();
++
++ // and check the reported thread count
+ checkThreadCount(0, DAEMON_THREADS);
+
+ // Check mbean now
+@@ -190,11 +183,11 @@
+ for (int i = 0; i < ALL_THREADS; i++) {
+ long expectedId = allThreads[i].getId();
+ boolean found = false;
+- boolean live = (i >= DAEMON_THREADS);
++ boolean alive = (i >= DAEMON_THREADS);
+
+ if (trace) {
+ System.out.print("Looking for thread with id " + expectedId +
+- (live ? " expected alive." : " expected terminated."));
++ (alive ? " expected alive." : " expected terminated."));
+ }
+ for (int j = 0; j < list.length; j++) {
+ if (expectedId == list[j]) {
+@@ -203,11 +196,11 @@
+ }
+ }
+
+- if (live != found) {
++ if (alive != found) {
+ testFailed = true;
+ }
+ if (trace) {
+- if (live != found) {
++ if (alive != found) {
+ System.out.println(" TEST FAILED.");
+ } else {
+ System.out.println();
+@@ -216,15 +209,14 @@
+ }
+
+ // Stop all threads and wait to be sure they all are dead
+- barrier.set(ALL_THREADS - DAEMON_THREADS);
+ for (int i = DAEMON_THREADS; i < ALL_THREADS; i++) {
+- live[i] = false;
++ setLive(i, false);
+ }
+- // wait until daemon threads are terminated .
+- barrier.await();
+
+- // give chance to threads to terminate
+- pause();
++ // make sure the non-daemon threads are completely dead
++ joinNonDaemonThreads();
++
++ // and check the thread count
+ checkThreadCount(0, ALL_THREADS - DAEMON_THREADS);
+
+ if (testFailed)
+@@ -233,6 +225,30 @@
+ System.out.println("Test passed.");
+ }
+
++ private static void joinDaemonThreads() throws InterruptedException {
++ for (int i = 0; i < DAEMON_THREADS; i++) {
++ allThreads[i].join();
++ }
++ }
++
++ private static void joinNonDaemonThreads() throws InterruptedException {
++ for (int i = DAEMON_THREADS; i < ALL_THREADS; i++) {
++ allThreads[i].join();
++ }
++ }
++
++ private static void setLive(int i, boolean val) {
++ synchronized(live) {
++ live[i] = val;
++ }
++ }
++
++ private static boolean isLive(int i) {
++ synchronized(live) {
++ return live[i];
++ }
++ }
++
+ // The MyThread thread lives as long as correspondent live[i] value is true
+ private static class MyThread extends Thread {
+ int id;
+@@ -243,8 +259,8 @@
+
+ public void run() {
+ // signal started
+- barrier.signal();
+- while (live[id]) {
++ startupCheck.arrive();
++ while (isLive(id)) {
+ try {
+ sleep(100);
+ } catch (InterruptedException e) {
+@@ -253,23 +269,6 @@
+ testFailed = true;
+ }
+ }
+- // signal about to exit
+- barrier.signal();
+ }
+ }
+-
+- private static Object pauseObj = new Object();
+- private static void pause() {
+- // Enter lock a without blocking
+- synchronized (pauseObj) {
+- try {
+- // may need to tune this timeout for different platforms
+- pauseObj.wait(50);
+- } catch (Exception e) {
+- System.err.println("Unexpected exception.");
+- e.printStackTrace(System.err);
+- }
+- }
+- }
+-
+ }
+--- ./jdk/test/java/lang/management/ThreadMXBean/Locks.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/management/ThreadMXBean/Locks.java Wed Jul 01 21:53:30 2015 -0700
+@@ -29,17 +29,21 @@
+ * @author Mandy Chung
+ * @author Jaroslav Bachorik
+ *
++ * @library /lib/testlibrary
++ * @build jdk.testlibrary.*
+ * @run main/othervm Locks
+ */
+
+ import java.lang.management.*;
+ import java.util.concurrent.Phaser;
++import jdk.testlibrary.LockFreeLogManager;
+
+ public class Locks {
+ private static final Object objA = new Object();
+ private static final Object objB = new Object();
+ private static final Object objC = new Object();
+ private static final ThreadMXBean tm = ManagementFactory.getThreadMXBean();
++ private static final LockFreeLogManager logger = new LockFreeLogManager();
+
+ private static boolean testFailed = false;
+
+@@ -126,14 +130,14 @@
+ public void run() {
+ synchronized(objA) {
+ // stop here for LockBThread to hold objB
+- System.out.println("LockAThread about to block on objB");
++ log("LockAThread about to block on objB");
+ p.arriveAndAwaitAdvance(); // Phase 1 (blocking)
+ synchronized(objB) {
+ dummyCounter++;
+ };
+ }
+ p.arriveAndAwaitAdvance(); // Phase 2 (blocking)
+- System.out.println("LockAThread about to exit");
++ log("LockAThread about to exit");
+ // Make sure the current thread is not holding any lock
+ assertNoLock(this);
+ }
+@@ -147,7 +151,7 @@
+ }
+ public void run() {
+ synchronized(objB) {
+- System.out.println("LockBThread about to block on objC");
++ log("LockBThread about to block on objC");
+ p.arriveAndAwaitAdvance(); // Phase 1 (blocking)
+ // Signal main thread about to block on objC
+ synchronized(objC) {
+@@ -155,14 +159,14 @@
+ };
+ }
+ p.arriveAndAwaitAdvance(); // Phase 2 (blocking)
+- System.out.println("LockBThread about to exit");
++ log("LockBThread about to exit");
+ // Make sure the current thread is not holding any lock
+ assertNoLock(this);
+ }
+ }
+
+ private static WaitingThread waiter;
+- private static Object ready = new Object();
++ private static final Object ready = new Object();
+ private static CheckerThread checker;
+ static class WaitingThread extends Thread {
+ private final Phaser p;
+@@ -170,9 +174,10 @@
+ super("WaitingThread");
+ this.p = p;
+ }
++ @Override
+ public void run() {
+ synchronized(objC) {
+- System.out.println("WaitingThread about to wait on objC");
++ log("WaitingThread about to wait on objC");
+ try {
+ // Signal checker thread, about to wait on objC.
+ p.arriveAndAwaitAdvance(); // Phase 1 (waiting)
+@@ -183,13 +188,13 @@
+ }
+
+ // block until CheckerThread finishes checking
+- System.out.println("WaitingThread about to block on ready");
++ log("WaitingThread about to block on ready");
+ // signal checker thread that it is about acquire
+ // object ready.
+ p.arriveAndAwaitAdvance(); // Phase 2 (waiting)
+ synchronized(ready) {
+ dummyCounter++;
+- };
++ }
+ }
+ synchronized(objC) {
+ try {
+@@ -201,7 +206,7 @@
+ testFailed = true;
+ }
+ }
+- System.out.println("WaitingThread about to exit waiting on objC 2");
++ log("WaitingThread about to exit waiting on objC 2");
+ }
+ }
+ static class CheckerThread extends Thread {
+@@ -304,10 +309,10 @@
+ private static ThreadInfo findOwnerInfo(ThreadInfo[] infos, String lock)
+ throws Exception {
+ ThreadInfo ownerInfo = null;
+- for (int i = 0; i < infos.length; i++) {
+- String blockedLock = infos[i].getLockName();
++ for (ThreadInfo info : infos) {
++ String blockedLock = info.getLockName();
+ if (lock.equals(blockedLock)) {
+- long threadId = infos[i].getLockOwnerId();
++ long threadId = info.getLockOwnerId();
+ if (threadId == -1) {
+ throw new RuntimeException("TEST FAILED: " +
+ lock + " expected to have owner");
+@@ -338,14 +343,17 @@
+ throws Exception {
+ ThreadInfo ownerInfo = null;
+ // Find the thread who is blocking on lock
+- for (int i = 0; i < infos.length; i++) {
+- String blockedLock = infos[i].getLockName();
++ for (ThreadInfo info : infos) {
++ String blockedLock = info.getLockName();
+ if (lock.equals(blockedLock)) {
+- System.out.print(infos[i].getThreadName() +
+- " blocked on " + blockedLock);
+- ownerInfo = infos[i];
++ log("%s blocked on %s", info.getThreadName(), blockedLock);
++ ownerInfo = info;
+ }
+ }
++ if (ownerInfo == null) {
++ throw new RuntimeException("TEST FAILED: " +
++ "Can't retrieve ThreadInfo for the blocked thread");
++ }
+
+ long[] threads = new long[10];
+ int count = 0;
+@@ -353,14 +361,18 @@
+ while (ownerInfo != null && ownerInfo.getThreadState() == Thread.State.BLOCKED) {
+ ownerInfo = findOwnerInfo(infos, lock);
+ threads[count++] = ownerInfo.getThreadId();
+- System.out.println(" Owner = " + ownerInfo.getThreadName() +
+- " id = " + ownerInfo.getThreadId());
++ log(" Owner = %s id = %d",
++ ownerInfo.getThreadName(),
++ ownerInfo.getThreadId()
++ );
+ lock = ownerInfo.getLockName();
+- System.out.print(ownerInfo.getThreadName() + " Id = " +
+- ownerInfo.getThreadId() +
+- " blocked on " + lock);
++ log("%s Id = %d blocked on %s",
++ ownerInfo.getThreadName(),
++ ownerInfo.getThreadId(),
++ lock
++ );
+ }
+- System.out.println();
++ log("");
+
+ if (count != expectedThreads.length) {
+ throw new RuntimeException("TEST FAILED: " +
+@@ -368,10 +380,15 @@
+ }
+ for (int i = 0; i < count; i++) {
+ if (threads[i] != expectedThreads[i]) {
+- System.out.println("TEST FAILED: " +
+- "Unexpected thread in the chain " + threads[i] +
+- " expected to be " + expectedThreads[i]);
++ log("TEST FAILED: Unexpected thread in the chain %s expected to be %s",
++ threads[i],
++ expectedThreads[i]
++ );
+ }
+ }
+ }
++
++ private static void log(String format, Object ... args) {
++ logger.log(format + "%n", args);
++ }
+ }
+--- ./jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2014, 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
+@@ -34,6 +34,7 @@
+
+ import java.lang.management.*;
+ import java.util.concurrent.Phaser;
++import java.util.function.Supplier;
+
+ public class SynchronizationStatistics {
+ private static class LockerThread extends Thread {
+@@ -74,7 +75,7 @@
+ }
+
+ private static void waitForThreadState(Thread t, Thread.State state) throws InterruptedException {
+- while (!t.isInterrupted() && t.getState() != state) {
++ while (t.getState() != state) {
+ Thread.sleep(3);
+ }
+ }
+@@ -86,6 +87,8 @@
+ private static void testBlockingOnSimpleMonitor() throws Exception {
+ System.out.println("testBlockingOnSimpleMonitor");
+ final Object lock1 = new Object();
++ System.out.println("Lock1 = " + lock1);
++
+ final Phaser p = new Phaser(2);
+ LockerThread lt = newLockerThread(new Runnable() {
+ @Override
+@@ -106,16 +109,18 @@
+ synchronized(lock1) {
+ p.arriveAndAwaitAdvance(); // phase[1]
+ waitForThreadState(lt, Thread.State.BLOCKED);
+- lockName = mbean.getThreadInfo(tid).getLockName();
++ do {
++ lockName = mbean.getThreadInfo(tid).getLockName();
++ } while (lockName == null);
+ }
+
+ p.arriveAndAwaitAdvance(); // phase[2]
+- testBlocked(ti, mbean.getThreadInfo(tid), lockName, lock1);
++ testBlocked(ti, () -> mbean.getThreadInfo(tid), lockName, lock1);
+ p.arriveAndDeregister(); // phase[3]
+
+ lt.join();
+
+- System.out.println("OK");
++ printok();
+ }
+
+ /**
+@@ -128,6 +133,9 @@
+ final Object lock1 = new Object();
+ final Object lock2 = new Object();
+
++ System.out.println("Lock1 = " + lock1);
++ System.out.println("Lock2 = " + lock2);
++
+ final Phaser p = new Phaser(2);
+ LockerThread lt = newLockerThread(new Runnable() {
+ @Override
+@@ -149,31 +157,32 @@
+ lt.start();
+ long tid = lt.getId();
+ ThreadInfo ti = mbean.getThreadInfo(tid);
+- ThreadInfo ti1 = null;
+ String lockName = null;
+ synchronized(lock1) {
+ p.arriveAndAwaitAdvance(); // phase[1]
+ waitForThreadState(lt, Thread.State.BLOCKED);
+- lockName = mbean.getThreadInfo(tid).getLockName();
++ do {
++ lockName = mbean.getThreadInfo(tid).getLockName();
++ } while (lockName == null);
+ }
+ p.arriveAndAwaitAdvance(); // phase[2]
+
+- ti1 = mbean.getThreadInfo(tid);
+- testBlocked(ti, ti1, lockName, lock1);
+- ti = ti1;
++ ti = testBlocked(ti, () -> mbean.getThreadInfo(tid), lockName, lock1);
+
+ synchronized(lock2) {
+ p.arriveAndAwaitAdvance(); // phase [3]
+ waitForThreadState(lt, Thread.State.BLOCKED);
+- lockName = mbean.getThreadInfo(tid).getLockName();
++ do {
++ lockName = mbean.getThreadInfo(tid).getLockName();
++ } while (lockName == null);
+ }
+ p.arriveAndAwaitAdvance(); // phase [4]
+- testBlocked(ti, mbean.getThreadInfo(tid), lockName, lock2);
++ testBlocked(ti, () -> mbean.getThreadInfo(tid), lockName, lock2);
+ p.arriveAndDeregister();
+
+ lt.join();
+
+- System.out.println("OK");
++ printok();
+ }
+
+ /**
+@@ -209,13 +218,12 @@
+ }
+ p.arriveAndAwaitAdvance(); // phase[2]
+
+- ThreadInfo ti2 = mbean.getThreadInfo(lt.getId());
++ testWaited(ti1, () -> mbean.getThreadInfo(lt.getId()), 1);
+ p.arriveAndDeregister(); // phase[3]
+
+ lt.join();
+
+- testWaited(ti1, ti2, 1);
+- System.out.println("OK");
++ printok();
+ }
+
+ /**
+@@ -256,12 +264,12 @@
+ int phase = p.getPhase();
+ while ((p.arriveAndAwaitAdvance() - phase) < 3); // phase[2-4]
+
+- ThreadInfo ti2 = mbean.getThreadInfo(lt.getId());
++ testWaited(ti1, () -> mbean.getThreadInfo(lt.getId()), 3);
+ p.arriveAndDeregister(); // phase[5]
+
+ lt.join();
+- testWaited(ti1, ti2, 3);
+- System.out.println("OK");
++
++ printok();
+ }
+
+ /**
+@@ -331,44 +339,85 @@
+ }
+
+ p.arriveAndAwaitAdvance(); // phase[4]
+- ThreadInfo ti2 = mbean.getThreadInfo(lt.getId());
++ testWaited(ti1, () -> mbean.getThreadInfo(lt.getId()), 3);
+ p.arriveAndDeregister(); // phase[5]
+
+ lt.join();
+- testWaited(ti1, ti2, 3);
+- System.out.println("OK");
++ printok();
+ }
+
+- private static void testWaited(ThreadInfo ti1, ThreadInfo ti2, int waited) throws Error {
+- long waitCntDiff = ti2.getWaitedCount() - ti1.getWaitedCount();
+- long waitTimeDiff = ti2.getWaitedTime() - ti1.getWaitedTime();
+- if (waitCntDiff < waited) {
+- throw new Error("Unexpected diff in waited count. Expecting at least "
+- + waited + " , got " + waitCntDiff);
+- }
+- if (waitTimeDiff <= 0) {
+- throw new Error("Unexpected diff in waited time. Expecting increasing " +
+- "value, got " + waitTimeDiff + "ms");
+- }
++ private static void printok() {
++ System.out.println("OK\n");
+ }
+
+- private static void testBlocked(ThreadInfo ti1, ThreadInfo ti2,
++ private static void testWaited(ThreadInfo ti1, Supplier<ThreadInfo> ti2, int waited)
++ throws InterruptedException {
++ boolean error;
++ do {
++ error = false;
++ ThreadInfo ti = ti2.get();
++ long waitCntDiff = ti.getWaitedCount() - ti1.getWaitedCount();
++ long waitTimeDiff = ti.getWaitedTime() - ti1.getWaitedTime();
++ if (waitCntDiff < waited) {
++ System.err.println(
++ "Unexpected diff in waited count. Expecting at least "
++ + waited + " , got " + waitCntDiff
++ );
++ error = true;
++ }
++ if (waitTimeDiff <= 0) {
++ System.err.println(
++ "Unexpected diff in waited time. Expecting increasing " +
++ "value, got " + waitTimeDiff + "ms"
++ );
++ error = true;
++ }
++ if (error) {
++ System.err.println("Retrying in 20ms ...");
++ Thread.sleep(20);
++ }
++ } while (error);
++ }
++
++ private static ThreadInfo testBlocked(ThreadInfo ti1, Supplier<ThreadInfo> ti2,
+ String lockName, final Object lock)
+- throws Error {
+- long blkCntDiff = ti2.getBlockedCount() - ti1.getBlockedCount();
+- long blkTimeDiff = ti2.getBlockedTime() - ti1.getBlockedTime();
+- if (blkCntDiff < 1) {
+- throw new Error("Unexpected diff in blocked count. Expecting at least 1, " +
+- "got " + blkCntDiff);
+- }
+- if (blkTimeDiff < 0) {
+- throw new Error("Unexpected diff in blocked time. Expecting a positive " +
+- "number, got " + blkTimeDiff);
+- }
+- if (!lockName.equals(lock.toString())) {
+- throw new Error("Unexpected blocked monitor name. Expecting " +
+- lock.toString() + ", got " +
+- lockName);
+- }
++ throws InterruptedException {
++ boolean error;
++ ThreadInfo ti = null;
++ do {
++ error = false;
++ ti = ti2.get();
++ long blkCntDiff = ti.getBlockedCount() - ti1.getBlockedCount();
++ long blkTimeDiff = ti.getBlockedTime() - ti1.getBlockedTime();
++
++ System.out.println("testBlocked: [" + blkCntDiff + ", " + blkTimeDiff + ", " + lockName + "]");
++
++ if (blkCntDiff < 1) {
++ System.err.println(
++ "Unexpected diff in blocked count. Expecting at least 1, " +
++ "got " + blkCntDiff
++ );
++ error = true;
++ }
++ if (blkTimeDiff < 0) {
++ System.err.println(
++ "Unexpected diff in blocked time. Expecting a positive " +
++ "number, got " + blkTimeDiff
++ );
++ error = true;
++ }
++ if (!lockName.equals(lock.toString())) {
++ System.err.println(
++ "Unexpected blocked monitor name. Expecting " +
++ lock.toString() + ", got " + lockName
++ );
++ error = true;
++ }
++ if (error) {
++ System.err.println("Retrying in 20ms ...");
++ Thread.sleep(20);
++ }
++ } while (error);
++ return ti;
+ }
+ }
+--- ./jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 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
+@@ -31,6 +31,8 @@
+ * @author Mandy Chung
+ *
+ * @library ../../Thread
++ * @library /lib/testlibrary
++ * @build jdk.testlibrary.*
+ * @build ThreadMXBeanStateTest ThreadStateController
+ * @run main ThreadMXBeanStateTest
+ */
+@@ -44,15 +46,17 @@
+ private static final ThreadMXBean tm = ManagementFactory.getThreadMXBean();
+
+ static class Lock {
+- private String name;
++ private final String name;
+ Lock(String name) {
+ this.name = name;
+ }
++ @Override
+ public String toString() {
+ return name;
+ }
+ }
+- private static Lock globalLock = new Lock("my lock");
++
++ private static final Lock globalLock = new Lock("my lock");
+
+ public static void main(String[] argv) throws Exception {
+ // Force thread state initialization now before the test
+@@ -109,7 +113,7 @@
+ thread.checkThreadState(TERMINATED);
+
+ try {
+- thread.join();
++ System.out.println(thread.getLog());
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ System.out.println("TEST FAILED: Unexpected exception.");
+--- ./jdk/test/java/math/BigDecimal/DivideTests.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/math/BigDecimal/DivideTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -23,7 +23,7 @@
+
+ /*
+ * @test
+- * @bug 4851776 4907265 6177836 6876282
++ * @bug 4851776 4907265 6177836 6876282 8066842
+ * @summary Some tests for the divide methods.
+ * @author Joseph D. Darcy
+ */
+@@ -358,6 +358,57 @@
+ return failures;
+ }
+
++ private static int divideByOneTests() {
++ int failures = 0;
++
++ //problematic divisor: one with scale 17
++ BigDecimal one = BigDecimal.ONE.setScale(17);
++ RoundingMode rounding = RoundingMode.UNNECESSARY;
++
++ long[][] unscaledAndScale = new long[][] {
++ { Long.MAX_VALUE, 17},
++ {-Long.MAX_VALUE, 17},
++ { Long.MAX_VALUE, 0},
++ {-Long.MAX_VALUE, 0},
++ { Long.MAX_VALUE, 100},
++ {-Long.MAX_VALUE, 100}
++ };
++
++ for (long[] uas : unscaledAndScale) {
++ long unscaled = uas[0];
++ int scale = (int)uas[1];
++
++ BigDecimal noRound = null;
++ try {
++ noRound = BigDecimal.valueOf(unscaled, scale).
++ divide(one, RoundingMode.UNNECESSARY);
++ } catch (ArithmeticException e) {
++ failures++;
++ System.err.println("ArithmeticException for value " + unscaled
++ + " and scale " + scale + " without rounding");
++ }
++
++ BigDecimal roundDown = null;
++ try {
++ roundDown = BigDecimal.valueOf(unscaled, scale).
++ divide(one, RoundingMode.DOWN);
++ } catch (ArithmeticException e) {
++ failures++;
++ System.err.println("ArithmeticException for value " + unscaled
++ + " and scale " + scale + " with rounding down");
++ }
++
++ if (noRound != null && roundDown != null
++ && noRound.compareTo(roundDown) != 0) {
++ failures++;
++ System.err.println("Equality failure for value " + unscaled
++ + " and scale " + scale);
++ }
++ }
++
++ return failures;
++ }
++
+ public static void main(String argv[]) {
+ int failures = 0;
+
+@@ -366,10 +417,11 @@
+ failures += properScaleTests();
+ failures += trailingZeroTests();
+ failures += scaledRoundedDivideTests();
++ failures += divideByOneTests();
+
+ if (failures > 0) {
+ throw new RuntimeException("Incurred " + failures +
+- " failures while testing exact divide.");
++ " failures while testing division.");
+ }
+ }
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/net/ServerSocket/AcceptInheritHandle.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,147 @@
++/*
++ * 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 8067105
++ * @summary Socket returned by ServerSocket.accept() is inherited by child process on Windows
++ * @author Chris Hegarty
++ */
++
++import java.io.*;
++import java.net.*;
++import java.nio.channels.ServerSocketChannel;
++import java.util.ArrayList;
++import java.util.List;
++import java.util.concurrent.TimeUnit;
++import java.util.function.Supplier;
++
++public class AcceptInheritHandle {
++
++ enum ServerSocketProducer {
++ JAVA_NET(() -> {
++ try {
++ return new ServerSocket(); }
++ catch(IOException x) {
++ throw new UncheckedIOException(x);
++ }
++ }),
++ NIO_CHANNELS(() -> {
++ try {
++ return ServerSocketChannel.open().socket();
++ } catch (IOException x) {
++ throw new UncheckedIOException(x);
++ }
++ });
++
++ final Supplier<ServerSocket> supplier;
++ ServerSocketProducer(Supplier<ServerSocket> supplier) {
++ this.supplier = supplier;
++ }
++ Supplier<ServerSocket> supplier () { return supplier; }
++ }
++
++ static final String JAVA = System.getProperty("java.home")
++ + File.separator + "bin" + File.separator + "java";
++
++ static final String CLASSPATH = System.getProperty("java.class.path");
++
++ public static void main(String[] args) throws Exception {
++ if (args.length == 1)
++ server(ServerSocketProducer.valueOf(args[0]));
++ else
++ mainEntry();
++ }
++
++ static void mainEntry() throws Exception {
++ testJavaNetServerSocket();
++ testNioServerSocketChannel();
++ }
++
++ static void testJavaNetServerSocket() throws Exception {
++ test(ServerSocketProducer.JAVA_NET);
++ test(ServerSocketProducer.JAVA_NET, "-Djava.net.preferIPv4Stack=true");
++ }
++ static void testNioServerSocketChannel() throws Exception {
++ test(ServerSocketProducer.NIO_CHANNELS);
++ }
++
++ static void test(ServerSocketProducer ssp, String... sysProps) throws Exception {
++ System.out.println("\nStarting test for " + ssp.name());
++
++ List<String> commands = new ArrayList<>();
++ commands.add(JAVA);
++ for (String prop : sysProps)
++ commands.add(prop);
++ commands.add("-cp");
++ commands.add(CLASSPATH);
++ commands.add("AcceptInheritHandle");
++ commands.add(ssp.name());
++
++ System.out.println("Executing: "+ commands);
++ ProcessBuilder pb = new ProcessBuilder(commands);
++ pb.redirectError(ProcessBuilder.Redirect.INHERIT);
++ Process serverProcess = pb.start();
++ DataInputStream dis = new DataInputStream(serverProcess.getInputStream());
++
++ int port = dis.readInt();
++ System.out.println("Server process listening on " + port + ", connecting...");
++
++ Socket socket = new Socket("localhost", port);
++ String s = dis.readUTF();
++ System.out.println("Server process said " + s);
++
++ serverProcess.destroy();
++ serverProcess.waitFor(30, TimeUnit.SECONDS);
++ System.out.println("serverProcess exitCode:" + serverProcess.exitValue());
++
++ try {
++ socket.setSoTimeout(10 * 1000);
++ socket.getInputStream().read();
++ } catch (SocketTimeoutException x) {
++ // failed
++ throw new RuntimeException("Failed: should get reset, not " + x);
++ } catch (SocketException x) {
++ System.out.println("Expected:" + x);
++ }
++ }
++
++ static void server(ServerSocketProducer producer) throws Exception {
++ try (ServerSocket ss = producer.supplier().get()) {
++ ss.bind(new InetSocketAddress(0));
++ int port = ss.getLocalPort();
++ DataOutputStream dos = new DataOutputStream(System.out);
++ dos.writeInt(port);
++ dos.flush();
++
++ ss.accept(); // do not close
++
++ Runtime.getRuntime().exec("sleep 20");
++ Thread.sleep(3 * 1000);
++
++ dos.writeUTF("kill me!");
++ dos.flush();
++ Thread.sleep(30 * 1000);
++ }
++ }
++}
+--- ./jdk/test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java Wed Jul 01 21:53:30 2015 -0700
+@@ -24,6 +24,8 @@
+ /* @test
+ * @bug 6834246 6842687
+ * @summary Stress test connections through the loopback interface
++ * @run main StressLoopback
++ * @run main/othervm -Djdk.net.useFastTcpLoopback StressLoopback
+ */
+
+ import java.nio.ByteBuffer;
+--- ./jdk/test/java/nio/channels/FileChannel/TransferToChannel.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/nio/channels/FileChannel/TransferToChannel.java Wed Jul 01 21:53:30 2015 -0700
+@@ -24,6 +24,8 @@
+ /* @test
+ * @bug 4652496
+ * @summary Test transferTo with different target channels
++ * @run main TransferToChannel
++ * @run main/othervm -Djdk.nio.enableFastFileTransfer TransferToChannel
+ */
+
+ import java.nio.channels.FileChannel;
+--- ./jdk/test/java/nio/channels/SocketChannel/OutOfBand.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/nio/channels/SocketChannel/OutOfBand.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -58,8 +58,6 @@
+ test1(sc1, sc2);
+ test2(sc1, sc2);
+ test3(sc1, sc2);
+- test4(sc1);
+-
+ } finally {
+ if (sc1 != null) sc1.close();
+ if (sc2 != null) sc2.close();
+@@ -175,17 +173,4 @@
+
+ thr.join();
+ }
+-
+- static void test4(SocketChannel sc) throws IOException {
+- boolean blocking = sc.isBlocking();
+- sc.configureBlocking(false);
+- try {
+- sc.socket().sendUrgentData(0);
+- throw new RuntimeException("IllegalBlockingModeException expected");
+- } catch (IllegalBlockingModeException x) {
+- // expected
+- } finally {
+- sc.configureBlocking(blocking);
+- }
+- }
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/nio/channels/SocketChannel/SendUrgentData.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,205 @@
++/*
++ * 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 8071599
++ * @run main/othervm SendUrgentData
++ * @run main/othervm SendUrgentData -inline
++ * @summary Test sending of urgent data.
++ */
++
++import java.io.IOException;
++import java.net.InetSocketAddress;
++import java.net.SocketAddress;
++import java.net.SocketException;
++import java.nio.ByteBuffer;
++import java.nio.channels.ServerSocketChannel;
++import java.nio.channels.SocketChannel;
++
++public class SendUrgentData {
++
++ /**
++ * The arguments may be one of the following:
++ * <ol>
++ * <li>-server</li>
++ * <li>-client host port [-inline]</li>
++ * <li>[-inline]</li>
++ * </ol>
++ * The first option creates a standalone server, the second a standalone
++ * client, and the third a self-contained server-client pair on the
++ * local host.
++ *
++ * @param args
++ * @throws Exception
++ */
++ public static void main(String[] args) throws Exception {
++
++ ServerSocketChannelThread serverThread
++ = new ServerSocketChannelThread("SendUrgentDataServer");
++ serverThread.start();
++ boolean b = serverThread.isAlive();
++
++ String host = null;
++ int port = 0;
++ boolean inline = false;
++ if (args.length > 0 && args[0].equals("-server")) {
++ System.out.println(serverThread.getAddress());
++ Thread.currentThread().suspend();
++ } else {
++ if (args.length > 0 && args[0].equals("-client")) {
++ host = args[1];
++ port = Integer.parseInt(args[2]);
++ if (args.length > 3) {
++ inline = args[2].equals("-inline");
++ }
++ } else {
++ host = "localhost";
++ port = serverThread.getAddress().getPort();
++ if (args.length > 0) {
++ inline = args[0].equals("-inline");
++ }
++ }
++ }
++
++ System.out.println("OOB Inline : "+inline);
++
++ SocketAddress sa = new InetSocketAddress(host, port);
++
++ try (SocketChannel sc = SocketChannel.open(sa)) {
++ sc.configureBlocking(false);
++ sc.socket().setOOBInline(inline);
++
++ sc.socket().sendUrgentData(0);
++ System.out.println("wrote 1 OOB byte");
++
++ ByteBuffer bb = ByteBuffer.wrap(new byte[100 * 1000]);
++
++ int blocked = 0;
++ long total = 0;
++
++ int n;
++ do {
++ n = sc.write(bb);
++ if (n == 0) {
++ System.out.println("blocked, wrote " + total + " so far");
++ if (++blocked == 10) {
++ break;
++ }
++ Thread.sleep(100);
++ } else {
++ total += n;
++ bb.rewind();
++ }
++ } while (n > 0);
++
++ long attempted = 0;
++ while (attempted < total) {
++ bb.rewind();
++ n = sc.write(bb);
++ System.out.println("wrote " + n + " normal bytes");
++ attempted += bb.capacity();
++
++ String osName = System.getProperty("os.name").toLowerCase();
++
++ try {
++ sc.socket().sendUrgentData(0);
++ } catch (IOException ex) {
++ if (osName.contains("linux")) {
++ if (!ex.getMessage().contains("Socket buffer full")) {
++ throw new RuntimeException("Unexpected message", ex);
++ }
++ } else if (osName.contains("os x") || osName.contains("mac")) {
++ if (!ex.getMessage().equals("No buffer space available")) {
++ throw new RuntimeException("Unexpected message", ex);
++ }
++ } else if (osName.contains("windows")) {
++ if (!(ex instanceof SocketException)) {
++ throw new RuntimeException("Unexpected exception", ex);
++ } else if (!ex.getMessage().contains("Resource temporarily unavailable")) {
++ throw new RuntimeException("Unexpected message", ex);
++ }
++ } else {
++ throw new RuntimeException("Unexpected IOException", ex);
++ }
++ }
++
++ try {
++ Thread.sleep(100);
++ } catch (InterruptedException ex) {
++ // don't want to fail on this so just print trace and break
++ ex.printStackTrace();
++ break;
++ }
++ }
++ } finally {
++ serverThread.close();
++ }
++ }
++
++ static class ServerSocketChannelThread extends Thread {
++
++ private ServerSocketChannel ssc;
++
++ private ServerSocketChannelThread(String name) {
++ super(name);
++ try {
++ ssc = ServerSocketChannel.open();
++ ssc.bind(new InetSocketAddress((0)));
++ } catch (IOException ex) {
++ throw new RuntimeException(ex);
++ }
++ }
++
++ public void run() {
++ while (ssc.isOpen()) {
++ try {
++ Thread.sleep(100);
++ } catch (InterruptedException ex) {
++ throw new RuntimeException(ex);
++ }
++ }
++ try {
++ ssc.close();
++ } catch (IOException ex) {
++ throw new RuntimeException(ex);
++ }
++ System.out.println("ServerSocketChannelThread exiting ...");
++ }
++
++ public InetSocketAddress getAddress() throws IOException {
++ if (ssc == null) {
++ throw new IllegalStateException("ServerSocketChannel not created");
++ }
++
++ return (InetSocketAddress) ssc.getLocalAddress();
++ }
++
++ public void close() {
++ try {
++ ssc.close();
++ } catch (IOException ex) {
++ throw new RuntimeException(ex);
++ }
++ }
++ }
++}
+--- ./jdk/test/java/nio/charset/Charset/RegisteredCharsets.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/nio/charset/Charset/RegisteredCharsets.java Wed Jul 01 21:53:30 2015 -0700
+@@ -135,6 +135,7 @@
+ "x-IBM1122",
+ "x-IBM1123",
+ "x-IBM1124",
++ "x-IBM1166",
+ "x-IBM875",
+ "x-IBM921",
+ "x-IBM922",
+@@ -863,6 +864,14 @@
+ "1124"
+ } );
+
++ aliasCheck("x-IBM1166" ,
++ new String[] {
++ "cp1166", // JDK historical
++ "ibm1166",
++ "ibm-1166",
++ "1166"
++ } );
++
+ aliasCheck("IBM273" ,
+ new String[] {
+ "cp273", // JDK historical
+--- ./jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java Wed Jul 01 21:53:30 2015 -0700
+@@ -675,6 +675,12 @@
+ aliasTable.put("1124", "Cp1124");
+
+ // MIBenum: ????
++ aliasTable.put("ibm1166", "Cp1166");
++ aliasTable.put("ibm-1166", "Cp1166");
++ aliasTable.put("cp1166", "Cp1166");
++ aliasTable.put("1166", "Cp1166");
++
++ // MIBenum: ????
+ aliasTable.put("ibm1381", "Cp1381"); /* MDA */
+ aliasTable.put("ibm-1381", "Cp1381"); /* MDA */
+ aliasTable.put("cp1381", "Cp1381"); /* MDA */
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/security/KeyStore/TestKeystoreCompat.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,235 @@
++/*
++ * 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 8062552
++ * @run main/othervm TestKeystoreCompat
++ * @summary test compatibility mode for JKS and PKCS12 keystores
++ */
++
++import java.io.*;
++import java.security.*;
++import java.security.KeyStore.*;
++import java.security.cert.*;
++import javax.crypto.*;
++import javax.security.auth.callback.*;
++
++public class TestKeystoreCompat {
++ private static final char[] PASSWORD = "changeit".toCharArray();
++ private static final String DIR = System.getProperty("test.src", ".");
++ // This is an arbitrary X.509 certificate
++ private static final String CERT_FILE = "trusted.pem";
++
++ public static final void main(String[] args) throws Exception {
++
++ // Testing empty keystores
++
++ init("empty.jks", "JKS");
++ init("empty.jceks", "JCEKS");
++ init("empty.p12", "PKCS12");
++
++ load("empty.jks", "JKS");
++ load("empty.jceks", "JCEKS");
++ load("empty.p12", "PKCS12");
++ load("empty.p12", "JKS"); // test compatibility mode
++ load("empty.jks", "PKCS12", true); // test without compatibility mode
++ load("empty.jks", "JKS", false); // test without compatibility mode
++ load("empty.p12", "JKS", true); // test without compatibility mode
++ load("empty.p12", "PKCS12", false); // test without compatibility mode
++
++ build("empty.jks", "JKS", true);
++ build("empty.jks", "JKS", false);
++ build("empty.jceks", "JCEKS", true);
++ build("empty.jceks", "JCEKS", false);
++ build("empty.p12", "PKCS12", true);
++ build("empty.p12", "PKCS12", false);
++
++ // Testing keystores containing an X.509 certificate
++
++ X509Certificate cert = loadCertificate(CERT_FILE);
++ init("onecert.jks", "JKS", cert);
++ init("onecert.jceks", "JCEKS", cert);
++ init("onecert.p12", "PKCS12", cert);
++
++ load("onecert.jks", "JKS");
++ load("onecert.jceks", "JCEKS");
++ load("onecert.p12", "PKCS12");
++ load("onecert.p12", "JKS"); // test compatibility mode
++ load("onecert.jks", "PKCS12", true); // test without compatibility mode
++ load("onecert.jks", "JKS", false); // test without compatibility mode
++ load("onecert.p12", "JKS", true); // test without compatibility mode
++ load("onecert.p12", "PKCS12", false); // test without compatibility mode
++
++ build("onecert.jks", "JKS", true);
++ build("onecert.jks", "JKS", false);
++ build("onecert.jceks", "JCEKS", true);
++ build("onecert.jceks", "JCEKS", false);
++ build("onecert.p12", "PKCS12", true);
++ build("onecert.p12", "PKCS12", false);
++
++ // Testing keystores containing a secret key
++
++ SecretKey key = generateSecretKey("AES", 128);
++ init("onekey.jceks", "JCEKS", key);
++ init("onekey.p12", "PKCS12", key);
++
++ load("onekey.jceks", "JCEKS");
++ load("onekey.p12", "PKCS12");
++ load("onekey.p12", "JKS"); // test compatibility mode
++ load("onekey.p12", "JKS", true); // test without compatibility mode
++ load("onekey.p12", "PKCS12", false); // test without compatibility mode
++
++ build("onekey.jceks", "JCEKS", true);
++ build("onekey.jceks", "JCEKS", false);
++ build("onekey.p12", "PKCS12", true);
++ build("onekey.p12", "PKCS12", false);
++
++ System.out.println("OK.");
++ }
++
++ // Instantiate an empty keystore using the supplied keystore type
++ private static void init(String file, String type) throws Exception {
++ KeyStore ks = KeyStore.getInstance(type);
++ ks.load(null, null);
++ try (OutputStream stream = new FileOutputStream(file)) {
++ ks.store(stream, PASSWORD);
++ }
++ System.out.println("Created a " + type + " keystore named '" + file + "'");
++ }
++
++ // Instantiate a keystore using the supplied keystore type & create an entry
++ private static void init(String file, String type, X509Certificate cert)
++ throws Exception {
++ KeyStore ks = KeyStore.getInstance(type);
++ ks.load(null, null);
++ ks.setEntry("mycert", new KeyStore.TrustedCertificateEntry(cert), null);
++ try (OutputStream stream = new FileOutputStream(file)) {
++ ks.store(stream, PASSWORD);
++ }
++ System.out.println("Created a " + type + " keystore named '" + file + "'");
++ }
++
++ // Instantiate a keystore using the supplied keystore type & create an entry
++ private static void init(String file, String type, SecretKey key)
++ throws Exception {
++ KeyStore ks = KeyStore.getInstance(type);
++ ks.load(null, null);
++ ks.setEntry("mykey", new KeyStore.SecretKeyEntry(key),
++ new PasswordProtection(PASSWORD));
++ try (OutputStream stream = new FileOutputStream(file)) {
++ ks.store(stream, PASSWORD);
++ }
++ System.out.println("Created a " + type + " keystore named '" + file + "'");
++ }
++
++ // Instantiate a keystore by probing the supplied file for the keystore type
++ private static void build(String file, String type, boolean usePassword)
++ throws Exception {
++
++ Builder builder;
++ if (usePassword) {
++ builder = Builder.newInstance(type, null, new File(file),
++ new PasswordProtection(PASSWORD));
++ } else {
++ builder = Builder.newInstance(type, null, new File(file),
++ new CallbackHandlerProtection(new DummyHandler()));
++ }
++ KeyStore ks = builder.getKeyStore();
++ if (!type.equalsIgnoreCase(ks.getType())) {
++ throw new Exception("ERROR: expected a " + type + " keystore, " +
++ "got a " + ks.getType() + " keystore instead");
++ } else {
++ System.out.println("Built a " + type + " keystore named '" + file + "'");
++ }
++ }
++
++ // Load the keystore entries
++ private static void load(String file, String type) throws Exception {
++ KeyStore ks = KeyStore.getInstance(type);
++ try (InputStream stream = new FileInputStream(file)) {
++ ks.load(stream, PASSWORD);
++ }
++ if (!type.equalsIgnoreCase(ks.getType())) {
++ throw new Exception("ERROR: expected a " + type + " keystore, " +
++ "got a " + ks.getType() + " keystore instead");
++ } else {
++ System.out.println("Loaded a " + type + " keystore named '" + file + "'");
++ }
++ }
++
++ // Load the keystore entries (with compatibility mode disabled)
++ private static void load(String file, String type, boolean expectFailure)
++ throws Exception {
++ Security.setProperty("keystore.type.compat", "false");
++ try {
++ load(file, type);
++ if (expectFailure) {
++ throw new Exception("ERROR: expected load to fail but it didn't");
++ }
++ } catch (IOException e) {
++ if (expectFailure) {
++ System.out.println("Failed to load a " + type + " keystore named '" + file + "' (as expected)");
++ } else {
++ throw e;
++ }
++ } finally {
++ Security.setProperty("keystore.type.compat", "true");
++ }
++ }
++
++ // Read an X.509 certificate from the supplied file
++ private static X509Certificate loadCertificate(String certFile)
++ throws Exception {
++ X509Certificate cert = null;
++ try (FileInputStream certStream =
++ new FileInputStream(DIR + "/" + certFile)) {
++ CertificateFactory factory =
++ CertificateFactory.getInstance("X.509");
++ return (X509Certificate) factory.generateCertificate(certStream);
++ }
++ }
++
++ // Generate a secret key using the supplied algorithm name and key size
++ private static SecretKey generateSecretKey(String algorithm, int size)
++ throws NoSuchAlgorithmException {
++ KeyGenerator generator = KeyGenerator.getInstance(algorithm);
++ generator.init(size);
++ return generator.generateKey();
++ }
++
++ private static class DummyHandler implements CallbackHandler {
++ public void handle(Callback[] callbacks)
++ throws IOException, UnsupportedCallbackException {
++ System.out.println("** Callbackhandler invoked");
++ for (int i = 0; i < callbacks.length; i++) {
++ Callback cb = callbacks[i];
++ if (cb instanceof PasswordCallback) {
++ PasswordCallback pcb = (PasswordCallback)cb;
++ pcb.setPassword(PASSWORD);
++ break;
++ }
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/security/KeyStore/trusted.pem Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,29 @@
++-----BEGIN CERTIFICATE-----
++MIIF5DCCBMygAwIBAgIQGVCD3zqdD1ZMZZ/zLAPnQzANBgkqhkiG9w0BAQUFADCBvDELMAkGA1UE
++BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
++ZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBvZiB1c2UgYXQgaHR0cHM6Ly93d3cudmVyaXNpZ24uY29t
++L3JwYSAoYykxMDE2MDQGA1UEAxMtVmVyaVNpZ24gQ2xhc3MgMyBJbnRlcm5hdGlvbmFsIFNlcnZl
++ciBDQSAtIEczMB4XDTEyMDcxMDAwMDAwMFoXDTEzMDczMTIzNTk1OVowgbgxCzAJBgNVBAYTAlVT
++MRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQHFA5SZWR3b29kIFNob3JlczEbMBkGA1UEChQS
++T3JhY2xlIENvcnBvcmF0aW9uMRIwEAYDVQQLFAlHbG9iYWwgSVQxMzAxBgNVBAsUKlRlcm1zIG9m
++IHVzZSBhdCB3d3cudmVyaXNpZ24uY29tL3JwYSAoYykwNTEVMBMGA1UEAxQMKi5vcmFjbGUuY29t
++MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz/dOCGrWzPj62q0ZkF59Oj9Fli4wHAuX
++U4/S0yBXF8j6K7TKWFTQkGZt3+08KUhmLm1CE1DbbyRJT292YNXYXunNaKdABob8kaBO/NESUOEJ
++0SZh7fd0xCSJAAPiwOMrM5jLeb/dEpU6nP74Afrhu5ffvKdcvTRGguj9H2oVsisTK8Z1HsiiwcJG
++JXcrjvdCZoPU4FHvK03XZPAqPHKNSaJOrux6kRIWYjQMlmL+qDOb0nNHa6gBdi+VqqJHJHeAM677
++dcUd0jn2m2OWtUnrM3MJZQof7/z27RTdX5J8np0ChkUgm63biDgRZO7uZP0DARQ0I6lZMlrarT8/
++sct3twIDAQABo4IB4jCCAd4wFwYDVR0RBBAwDoIMKi5vcmFjbGUuY29tMAkGA1UdEwQCMAAwCwYD
++VR0PBAQDAgWgMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHFwMwKjAoBggrBgEFBQcCARYcaHR0cHM6
++Ly93d3cudmVyaXNpZ24uY29tL3JwYTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwbgYI
++KwYBBQUHAQwEYjBgoV6gXDBaMFgwVhYJaW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUS2u5KJYGDLvQ
++UjibKaxLB4shBRgwJhYkaHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nbzEuZ2lmMHIGCCsG
++AQUFBwEBBGYwZDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AudmVyaXNpZ24uY29tMDwGCCsGAQUF
++BzAChjBodHRwOi8vc3ZyaW50bC1nMy1haWEudmVyaXNpZ24uY29tL1NWUkludGxHMy5jZXIwQQYD
++VR0fBDowODA2oDSgMoYwaHR0cDovL3N2cmludGwtZzMtY3JsLnZlcmlzaWduLmNvbS9TVlJJbnRs
++RzMuY3JsMB8GA1UdIwQYMBaAFNebfNgioBX33a1fzimbWMO8RgC1MA0GCSqGSIb3DQEBBQUAA4IB
++AQAITRBlEo+qXLwCL53Db2BGnhDgnSomjne8aCmU7Yt4Kp91tzJdhNuaC/wwDuzD2dPJqzemae3s
++wKiOXrmDQZDj9NNTdkrXHnCvDR4TpOynWe3zBa0bwKnV2cIRKcv482yV53u0kALyFZbagYPwOOz3
++YJA/2SqdcDn9Ztc/ABQ1SkyXyA5j4LJdf2g7BtYrFxjy0RG6We2iM781WSB/9MCNKyHgiwd3KpLf
++urdSKLzy1elNAyt1P3UHwBIIvZ6sJIr/eeELc54Lxt6PtQCXx8qwxYTYXWPXbLgKBHdebgrmAbPK
++TfD69wysvjk6vwSHjmvaqB4R4WRcgkuT+1gxx+ve
++-----END CERTIFICATE-----
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/security/ProtectionDomain/PreserveCombinerTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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.
++ */
++
++import java.security.AccessControlContext;
++import java.security.AccessController;
++import java.security.DomainCombiner;
++import java.security.PrivilegedAction;
++import java.security.ProtectionDomain;
++import sun.misc.SharedSecrets;
++
++/*
++ * @test
++ * @bug 8064331
++ * @summary Make sure that JavaSecurityAccess.doIntersectionPrivilege()
++ * is not dropping the information about the domain combiner of
++ * the stack ACC
++ */
++
++public class PreserveCombinerTest {
++ public static void main(String[]args) throws Exception {
++ final DomainCombiner dc = new DomainCombiner() {
++ @Override
++ public ProtectionDomain[] combine(ProtectionDomain[] currentDomains, ProtectionDomain[] assignedDomains) {
++ return currentDomains; // basically a no-op
++ }
++ };
++
++ // Get an instance of the saved ACC
++ AccessControlContext saved = AccessController.getContext();
++ // Simulate the stack ACC with a DomainCombiner attached
++ AccessControlContext stack = new AccessControlContext(AccessController.getContext(), dc);
++
++ // Now try to run JavaSecurityAccess.doIntersectionPrivilege() and assert
++ // whether the DomainCombiner from the stack ACC is preserved
++ boolean ret = SharedSecrets.getJavaSecurityAccess().doIntersectionPrivilege(new PrivilegedAction<Boolean>() {
++ @Override
++ public Boolean run() {
++ return dc == AccessController.getContext().getDomainCombiner();
++ }
++ }, stack, saved);
++
++ if (!ret) {
++ System.exit(1);
++ }
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/TEST.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,3 @@
++# JDBC unit tests uses TestNG
++TestNG.dirs = .
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/BatchUpdateExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,326 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.io.ByteArrayInputStream;
++import java.io.File;
++import java.io.ObjectInputStream;
++import java.sql.BatchUpdateException;
++import java.sql.SQLException;
++import java.util.Arrays;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.SerializedBatchUpdateException;
++import util.BaseTest;
++
++public class BatchUpdateExceptionTests extends BaseTest {
++
++ private final int[] uc = {1, 2, 3};
++ private final long[] luc = {1, 2, 3};
++
++ private final String testSrcDir = System.getProperty("test.src", ".")
++ + File.separatorChar;
++
++ /**
++ * Create BatchUpdateException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ BatchUpdateException be = new BatchUpdateException(null,
++ null, errorCode, (int[]) null, null);
++ assertTrue(be.getMessage() == null && be.getSQLState() == null
++ && be.getUpdateCounts() == null && be.getCause() == null
++ && be.getLargeUpdateCounts() == null
++ && be.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create BatchUpdateException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ BatchUpdateException ex = new BatchUpdateException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getUpdateCounts() == null
++ && ex.getLargeUpdateCounts() == null);
++ }
++
++ /**
++ * Create BatchUpdateException with null Throwable
++ */
++ @Test
++ public void test2() {
++ BatchUpdateException ex = new BatchUpdateException((Throwable) null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getUpdateCounts() == null
++ && ex.getLargeUpdateCounts() == null);
++ }
++
++ /**
++ * Create BatchUpdateException with message and update counts
++ */
++ @Test
++ public void test3() {
++
++ BatchUpdateException ex = new BatchUpdateException(reason, uc);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && Arrays.equals(ex.getUpdateCounts(), uc)
++ && Arrays.equals(ex.getLargeUpdateCounts(), luc)
++ );
++ }
++
++ /**
++ * Create BatchUpdateException with update counts
++ */
++ @Test
++ public void test4() {
++ BatchUpdateException ex = new BatchUpdateException(uc);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && Arrays.equals(ex.getUpdateCounts(), uc)
++ && Arrays.equals(ex.getLargeUpdateCounts(), luc)
++ );
++ }
++
++ /**
++ * Create BatchUpdateException with Throwable and update counts
++ */
++ @Test
++ public void test5() {
++ BatchUpdateException ex = new BatchUpdateException(uc, t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0
++ && Arrays.equals(ex.getUpdateCounts(), uc)
++ && Arrays.equals(ex.getLargeUpdateCounts(), luc)
++ );
++ }
++
++ /**
++ * Create BatchUpdateException with message, Throwable, and update counts
++ */
++ @Test
++ public void test6() {
++ BatchUpdateException ex = new BatchUpdateException(reason, uc, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0
++ && Arrays.equals(ex.getUpdateCounts(), uc)
++ && Arrays.equals(ex.getLargeUpdateCounts(), luc)
++ );
++ }
++
++ /**
++ * Create BatchUpdateException with message, SQLState, Throwable, and update
++ * counts
++ */
++ @Test
++ public void test7() {
++ BatchUpdateException ex = new BatchUpdateException(reason, state, uc, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0
++ && Arrays.equals(ex.getUpdateCounts(), uc)
++ && Arrays.equals(ex.getLargeUpdateCounts(), luc)
++ );
++ }
++
++ /**
++ * Create BatchUpdateException with message, SQLState, errorCode code
++ * Throwable, and update counts
++ */
++ @Test
++ public void test8() {
++ BatchUpdateException ex = new BatchUpdateException(reason, state, errorCode,
++ uc, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode
++ && Arrays.equals(ex.getUpdateCounts(), uc)
++ && Arrays.equals(ex.getLargeUpdateCounts(), luc)
++ );
++ }
++
++ /**
++ * Create BatchUpdateException with message, SQLState, errorCode code
++ * Throwable, and long [] update counts
++ */
++ @Test
++ public void test9() {
++ BatchUpdateException ex = new BatchUpdateException(reason, state, errorCode,
++ luc, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode
++ && Arrays.equals(ex.getUpdateCounts(), uc)
++ && Arrays.equals(ex.getLargeUpdateCounts(), luc)
++ );
++ }
++
++ /**
++ * Validate that a copy of the update counts array is made
++ */
++ @Test
++ public void test10() {
++ int[] uc1 = {1, 2};
++ BatchUpdateException ex = new BatchUpdateException(uc1);
++ assertTrue(Arrays.equals(ex.getUpdateCounts(), uc1));
++ uc1[0] = 6689;
++ assertFalse(Arrays.equals(ex.getUpdateCounts(), uc1));
++ }
++
++ /**
++ * Validate that if null is specified for the update count, it is returned
++ * as null
++ */
++ @Test
++ public void test11() {
++ BatchUpdateException ex = new BatchUpdateException((int[]) null);
++ assertTrue(ex.getMessage() == null && ex.getSQLState() == null
++ && ex.getErrorCode() == 0 && ex.getUpdateCounts() == null
++ && ex.getLargeUpdateCounts() == null);
++ }
++
++ /**
++ * Serialize a BatchUpdateException and make sure you can read it back
++ * properly
++ */
++ @Test
++ public void test12() throws Exception {
++ BatchUpdateException be = new BatchUpdateException(reason, state, errorCode,
++ uc, t);
++ BatchUpdateException bue
++ = createSerializedException(be);
++ assertTrue(reason.equals(bue.getMessage())
++ && bue.getSQLState().equals(state)
++ && cause.equals(bue.getCause().toString())
++ && bue.getErrorCode() == errorCode
++ && Arrays.equals(bue.getLargeUpdateCounts(), luc)
++ && Arrays.equals(bue.getUpdateCounts(), uc));
++ }
++
++
++
++ /**
++ * De-Serialize a BatchUpdateException from JDBC 4.0 and make sure you can
++ * read it back properly
++ */
++ @Test
++ public void test13() throws Exception {
++ String reason1 = "This was the error msg";
++ String state1 = "user defined sqlState";
++ String cause1 = "java.lang.Throwable: throw 1";
++ int errorCode1 = 99999;
++ Throwable t = new Throwable("throw 1");
++ int[] uc1 = {1, 2, 21};
++ long[] luc1 = {1, 2, 21};
++
++ ObjectInputStream ois = new ObjectInputStream(
++ new ByteArrayInputStream(SerializedBatchUpdateException.DATA));
++ BatchUpdateException bue = (BatchUpdateException) ois.readObject();
++ assertTrue(reason1.equals(bue.getMessage())
++ && bue.getSQLState().equals(state1)
++ && bue.getErrorCode() == errorCode1
++ && cause1.equals(bue.getCause().toString())
++ && Arrays.equals(bue.getLargeUpdateCounts(), luc1)
++ && Arrays.equals(bue.getUpdateCounts(), uc1));
++ }
++
++ /**
++ * Serialize a BatchUpdateException with an Integer.MAX_VALUE + 1 and
++ * validate you can read it back properly
++ */
++ @Test
++ public void test14() throws Exception {
++ int[] uc1 = {Integer.MAX_VALUE, Integer.MAX_VALUE + 1};
++ long[] luc1 = {Integer.MAX_VALUE, Integer.MAX_VALUE + 1};
++ BatchUpdateException be = new BatchUpdateException(reason, state, errorCode,
++ luc1, t);
++ BatchUpdateException bue
++ = createSerializedException(be);
++ assertTrue(reason.equals(bue.getMessage())
++ && bue.getSQLState().equals(state)
++ && cause.equals(bue.getCause().toString())
++ && bue.getErrorCode() == errorCode
++ && Arrays.equals(bue.getLargeUpdateCounts(), luc1)
++ && Arrays.equals(bue.getUpdateCounts(), uc1));
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test15() {
++ BatchUpdateException ex = new BatchUpdateException("Exception 1", uc, t1);
++ BatchUpdateException ex1 = new BatchUpdateException("Exception 2", uc);
++ BatchUpdateException ex2 = new BatchUpdateException("Exception 3", uc, t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test16() {
++ BatchUpdateException ex = new BatchUpdateException("Exception 1", uc, t1);
++ BatchUpdateException ex1 = new BatchUpdateException("Exception 2", uc);
++ BatchUpdateException ex2 = new BatchUpdateException("Exception 3", uc, t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ SQLException sqe = ex;
++ int num = 0;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/DataTruncationTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,209 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.DataTruncation;
++import java.sql.SQLException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class DataTruncationTests extends BaseTest {
++
++ private final String READ_TRUNCATION = "01004";
++ private final String WRITE_TRUNCATION = "22001";
++ private final String dtReason = "Data truncation";
++ private final int dterrorCode = 0;
++ private final String[] dtmsgs = {dtReason, "cause 1", dtReason,
++ dtReason, "cause 2"};
++ private boolean onRead = false;
++ private final boolean parameter = false;
++ private final int index = 21;
++ private final int dataSize = 25;
++ private final int transferSize = 10;
++
++ /**
++ * Create DataTruncation object indicating a truncation on read
++ */
++ @Test
++ public void test() {
++ onRead = true;
++ DataTruncation e = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize);
++ assertTrue(e.getMessage().equals(dtReason)
++ && e.getSQLState().equals(READ_TRUNCATION)
++ && e.getCause() == null
++ && e.getErrorCode() == dterrorCode
++ && e.getParameter() == parameter
++ && e.getRead() == onRead
++ && e.getDataSize() == dataSize
++ && e.getTransferSize() == transferSize
++ && e.getIndex() == index);
++ }
++
++ /**
++ * Create DataTruncation object indicating a truncation on write
++ */
++ @Test
++ public void test1() {
++ onRead = false;
++ DataTruncation e = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize);
++ assertTrue(e.getMessage().equals(dtReason)
++ && e.getSQLState().equals(WRITE_TRUNCATION)
++ && e.getCause() == null
++ && e.getErrorCode() == dterrorCode
++ && e.getParameter() == parameter
++ && e.getRead() == onRead
++ && e.getDataSize() == dataSize
++ && e.getTransferSize() == transferSize
++ && e.getIndex() == index);
++ }
++
++ /**
++ * Create DataTruncation object indicating a truncation on read with a
++ * Throwable
++ */
++ @Test
++ public void test2() {
++ onRead = true;
++ DataTruncation e = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize, t);
++ assertTrue(e.getMessage().equals(dtReason)
++ && e.getSQLState().equals(READ_TRUNCATION)
++ && cause.equals(e.getCause().toString())
++ && e.getErrorCode() == dterrorCode
++ && e.getParameter() == parameter
++ && e.getRead() == onRead
++ && e.getDataSize() == dataSize
++ && e.getTransferSize() == transferSize
++ && e.getIndex() == index);
++ }
++
++ /**
++ * Create DataTruncation object indicating a truncation on read with null
++ * specified for the Throwable
++ */
++ @Test
++ public void test3() {
++ onRead = true;;
++ DataTruncation e = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize, null);
++ assertTrue(e.getMessage().equals(dtReason)
++ && e.getSQLState().equals(READ_TRUNCATION)
++ && e.getCause() == null
++ && e.getErrorCode() == dterrorCode
++ && e.getParameter() == parameter
++ && e.getRead() == onRead
++ && e.getDataSize() == dataSize
++ && e.getTransferSize() == transferSize
++ && e.getIndex() == index);
++ }
++
++ /**
++ * Create DataTruncation object indicating a truncation on read and you can
++ * pass a -1 for the index
++ */
++ @Test
++ public void test4() {
++ onRead = true;
++ int negIndex = -1;
++ DataTruncation e = new DataTruncation(negIndex, parameter, onRead,
++ dataSize, transferSize);
++ assertTrue(e.getMessage().equals(dtReason)
++ && e.getSQLState().equals(READ_TRUNCATION)
++ && e.getCause() == null
++ && e.getErrorCode() == dterrorCode
++ && e.getParameter() == parameter
++ && e.getRead() == onRead
++ && e.getDataSize() == dataSize
++ && e.getTransferSize() == transferSize
++ && e.getIndex() == negIndex);
++ }
++
++ /**
++ * Serialize a DataTruncation and make sure you can read it back properly
++ */
++ @Test
++ public void test5() throws Exception {
++ DataTruncation e = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize);
++ DataTruncation ex1 = createSerializedException(e);
++ assertTrue(e.getMessage().equals(dtReason)
++ && e.getSQLState().equals(READ_TRUNCATION)
++ && e.getCause() == null
++ && e.getErrorCode() == dterrorCode
++ && e.getParameter() == parameter
++ && e.getRead() == onRead
++ && e.getDataSize() == dataSize
++ && e.getTransferSize() == transferSize
++ && e.getIndex() == index);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct using
++ * for-each loop
++ */
++ @Test
++ public void test11() {
++ DataTruncation ex = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize, t1);
++ DataTruncation ex1 = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize);
++ DataTruncation ex2 = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize, t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(dtmsgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test12() {
++ DataTruncation ex = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize, t1);
++ DataTruncation ex1 = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize);
++ DataTruncation ex2 = new DataTruncation(index, parameter, onRead,
++ dataSize, transferSize, t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(dtmsgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(dtmsgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/DateTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,373 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.Date;
++import java.time.Instant;
++import java.time.LocalDate;
++import static org.testng.Assert.*;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class DateTests extends BaseTest {
++
++ /*
++ * Validate an IllegalArgumentException is thrown for an invalid Date string
++ */
++ @Test(dataProvider = "invalidDateValues",
++ expectedExceptions = IllegalArgumentException.class)
++ public void test(String d) throws Exception {
++ Date.valueOf(d);
++ }
++
++ /*
++ * Test that a date created from a date string is equal to the value
++ * returned from toString()
++ */
++ @Test(dataProvider = "validDateValues")
++ public void test00(String d, String expectedD) {
++ Date d1 = Date.valueOf(d);
++ Date d2 = Date.valueOf(expectedD);
++ assertTrue(d1.equals(d2) && d2.equals(d1)
++ && d1.toString().equals(expectedD), "Error d1 != d2");
++ }
++
++ /*
++ * Validate that a Date.after() returns false when same date is compared
++ */
++ @Test
++ public void test01() {
++ Date d = Date.valueOf("1961-08-30");
++ assertFalse(d.after(d), "Error d.after(d) = true");
++ }
++
++ /*
++ * Validate that a Date.after() returns true when later date is compared to
++ * earlier date
++ */
++ @Test
++ public void test2() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(System.currentTimeMillis());
++ assertTrue(d2.after(d), "Error d2.after(d) = false");
++ }
++
++ /*
++ * Validate that a Date.after() returns false when earlier date is compared
++ * to later date
++ */
++ @Test
++ public void test3() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(d.getTime());
++ assertFalse(d.after(d2), "Error d.after(d2) = true");
++ }
++
++ /*
++ * Validate that a Date.after() returns false when date compared to another
++ * date created from the original date
++ */
++ @Test
++ public void test4() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(d.getTime());
++ assertFalse(d.after(d2), "Error d.after(d2) = true");
++ assertFalse(d2.after(d), "Error d2.after(d) = true");
++ }
++
++ /*
++ * Validate that a Date.before() returns false when same date is compared
++ */
++ @Test
++ public void test5() {
++ Date d = Date.valueOf("1961-08-30");
++ assertFalse(d.before(d), "Error d.before(d) = true");
++ }
++
++ /*
++ * Validate that a Date.before() returns true when earlier date is compared
++ * to later date
++ */
++ @Test
++ public void test6() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(System.currentTimeMillis());
++ assertTrue(d.before(d2), "Error d.before(d2) = false");
++ }
++
++ /*
++ * Validate that a Date.before() returns false when later date is compared
++ * to earlier date
++ */
++ @Test
++ public void test7() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(d.getTime());
++ assertFalse(d2.before(d), "Error d2.before(d) = true");
++ }
++
++ /*
++ * Validate that a Date.before() returns false when date compared to another
++ * date created from the original date
++ */
++ @Test
++ public void test8() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(d.getTime());
++ assertFalse(d.before(d2), "Error d.before(d2) = true");
++ assertFalse(d2.before(d), "Error d2.before(d) = true");
++ }
++
++ /*
++ * Validate that a Date.compareTo returns 0 when both Date objects are the
++ * same
++ */
++ @Test
++ public void test9() {
++ Date d = Date.valueOf("1961-08-30");
++ assertTrue(d.compareTo(d) == 0, "Error d.compareTo(d) !=0");
++ }
++
++ /*
++ * Validate that a Date.compareTo returns 0 when both Date objects represent
++ * the same date
++ */
++ @Test
++ public void test10() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(d.getTime());
++ assertTrue(d.compareTo(d2) == 0, "Error d.compareTo(d2) !=0");
++ }
++
++ /*
++ * Validate that a Date.compareTo returns -1 when comparing a date to a
++ * later date
++ */
++ @Test
++ public void test11() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(System.currentTimeMillis());
++ assertTrue(d.compareTo(d2) == -1, "Error d.compareTo(d2) != -1");
++ }
++
++ /*
++ * Validate that a Date.compareTo returns 1 when comparing a date to an
++ * earlier date
++ */
++ @Test
++ public void test12() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(System.currentTimeMillis());
++ assertTrue(d2.compareTo(d) == 1, "Error d.compareTo(d2) != 1");
++ }
++
++ /*
++ * Validate that a Date made from a LocalDate are equal
++ */
++ @Test
++ public void test13() {
++ Date d = Date.valueOf("1961-08-30");
++ LocalDate ldt = d.toLocalDate();
++ Date d2 = Date.valueOf(ldt);
++ assertTrue(d.equals(d2), "Error d != d2");
++ }
++
++ /*
++ * Validate that a Date LocalDate value, made from a LocalDate are equal
++ */
++ @Test
++ public void test14() {
++ LocalDate ldt = LocalDate.now();
++ Date d = Date.valueOf(ldt);
++ assertTrue(ldt.equals(d.toLocalDate()),
++ "Error LocalDate values are not equal");
++ }
++
++ /*
++ * Validate an NPE occurs when a null LocalDate is passed to valueOf
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test15() throws Exception {
++ LocalDate ld = null;
++ Date.valueOf(ld);
++ }
++
++ /*
++ * Validate an UnsupportedOperationException occurs when toInstant() is
++ * called
++ */
++ @Test(expectedExceptions = UnsupportedOperationException.class)
++ public void test16() throws Exception {
++ Date d = Date.valueOf("1961-08-30");
++ Instant instant = d.toInstant();
++ }
++
++ /*
++ * Validate that two Date objects are equal when one is created from the
++ * toString() of the other
++ */
++ @Test
++ public void test17() {
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = Date.valueOf(d.toString());
++ assertTrue(d.equals(d2) && d2.equals(d), "Error d != d2");
++ }
++
++ /*
++ * Validate that two Date values one created using valueOf and another via a
++ * constructor are equal
++ */
++ @Test
++ public void test18() {
++
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(61, 7, 30);
++ assertTrue(d.equals(d2), "Error d != d2");
++ }
++
++ /*
++ * Validate that two Date values one created using getTime() of the other
++ * are equal
++ */
++ @Test
++ public void test19() {
++
++ Date d = Date.valueOf("1961-08-30");
++ Date d2 = new Date(d.getTime());
++ assertTrue(d.equals(d2), "Error d != d2");
++ }
++
++ /*
++ * Validate that a Date value is equal to itself
++ */
++ @Test
++ public void test20() {
++
++ Date d = Date.valueOf("1961-08-30");
++ assertTrue(d.equals(d), "Error d != d");
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling getHours
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test21() throws Exception {
++ Date d = Date.valueOf("1961-08-30");
++ d.getHours();
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling getMinutes
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test22() throws Exception {
++ Date d = Date.valueOf("1961-08-30");
++ d.getMinutes();
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling getSeconds
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test23() throws Exception {
++ Date d = Date.valueOf("1961-08-30");
++ d.getSeconds();
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling setHours
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test24() throws Exception {
++ Date d = Date.valueOf("1961-08-30");
++ d.setHours(8);
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling setMinutes
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test25() throws Exception {
++ Date d = Date.valueOf("1961-08-30");
++ d.setMinutes(0);
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling setSeconds
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test26() throws Exception {
++ Date d = Date.valueOf("1961-08-30");
++ d.setSeconds(0);
++ }
++
++ /*
++ * DataProvider used to provide Date which are not valid and are used
++ * to validate that an IllegalArgumentException will be thrown from the
++ * valueOf method
++ */
++ @DataProvider(name = "invalidDateValues")
++ private Object[][] invalidDateValues() {
++ return new Object[][]{
++ {"20009-11-01"},
++ {"09-11-01"},
++ {"-11-01"},
++ {"2009-111-01"},
++ {"2009--01"},
++ {"2009-13-01"},
++ {"2009-11-011"},
++ {"2009-11-"},
++ {"2009-11-00"},
++ {"2009-11-33"},
++ {"--"},
++ {""},
++ {null},
++ {"-"},
++ {"2009"},
++ {"2009-01"},
++ {"---"},
++ {"2009-13--1"},
++ {"1900-1-0"},
++ {"2009-01-01 10:50:01"},
++ {"1996-12-10 12:26:19.1"},
++ {"10:50:01"}
++ };
++ }
++
++ /*
++ * DataProvider used to provide Dates which are valid and are used
++ * to validate that an IllegalArgumentException will not be thrown from the
++ * valueOf method and the corect value from toString() is returned
++ */
++ @DataProvider(name = "validDateValues")
++ private Object[][] validDateValues() {
++ return new Object[][]{
++ {"2009-08-30", "2009-08-30"},
++ {"2009-01-8", "2009-01-08"},
++ {"2009-1-01", "2009-01-01"},
++ {"2009-1-1", "2009-01-01"}
++
++ };
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/DriverManagerPermissionsTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,154 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.security.AccessControlException;
++import java.security.Policy;
++import java.sql.DriverManager;
++import java.sql.SQLException;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubDriver;
++import util.TestPolicy;
++
++public class DriverManagerPermissionsTests extends BaseTest {
++
++ private static Policy policy;
++ private static SecurityManager sm;
++
++ /*
++ * Install a SecurityManager along with a base Policy to allow testNG to run
++ */
++ @BeforeClass
++ public static void setUpClass() throws Exception {
++ setPolicy(new TestPolicy());
++ System.setSecurityManager(new SecurityManager());
++ }
++
++ /*
++ * Install the original Policy and SecurityManager
++ */
++ @AfterClass
++ public static void tearDownClass() throws Exception {
++ System.setSecurityManager(sm);
++ setPolicy(policy);
++ }
++
++ /*
++ * Save off the original Policy and SecurityManager
++ */
++ public DriverManagerPermissionsTests() {
++ policy = Policy.getPolicy();
++ sm = System.getSecurityManager();
++ }
++
++ /*
++ * Validate that AccessControlException is thrown if SQLPermission("setLog")
++ * has not been granted
++ */
++ @Test(expectedExceptions = AccessControlException.class)
++ public void test() {
++ setPolicy(new TestPolicy());
++ DriverManager.setLogStream(null);
++ }
++
++ /*
++ * Validate that setLogStream succeeds if SQLPermission("setLog") has been
++ * granted
++ */
++ @Test
++ public void test1() {
++ Policy.setPolicy(new TestPolicy("setLog"));
++ DriverManager.setLogStream(null);
++ }
++
++ /*
++ * Validate that setLogStream succeeds if AllPermissions has been granted
++ */
++ @Test
++ public void test2() {
++ setPolicy(new TestPolicy("all"));
++ DriverManager.setLogStream(null);
++ }
++
++ /*
++ * Validate that AccessControlException is thrown if SQLPermission("setLog")
++ * has not been granted
++ */
++ @Test(expectedExceptions = AccessControlException.class)
++ public void test4() {
++ setPolicy(new TestPolicy());
++ DriverManager.setLogWriter(null);
++ }
++
++ /*
++ * Validate that setLogWriter succeeds if SQLPermission("setLog") has been
++ * granted
++ */
++ @Test
++ public void test5() {
++ setPolicy(new TestPolicy("setLog"));
++ DriverManager.setLogWriter(null);
++ }
++
++ /*
++ * Validate that setLogWriter succeeds if AllPermissions has been granted
++ */
++ @Test
++ public void test6() {
++ setPolicy(new TestPolicy("all"));
++ DriverManager.setLogWriter(null);
++ }
++
++ /*
++ * Validate that AccessControlException is thrown if
++ * SQLPermission("deregisterDriver") has not been granted
++ */
++ @Test(expectedExceptions = AccessControlException.class)
++ public void test7() throws SQLException {
++ setPolicy(new TestPolicy());
++ DriverManager.deregisterDriver(new StubDriver());
++ }
++
++ /*
++ * Validate that deregisterDriver succeeds if
++ * SQLPermission("deregisterDriver") has been granted
++ */
++ @Test
++ public void test8() throws SQLException {
++ setPolicy(new TestPolicy("deregisterDriver"));
++ DriverManager.deregisterDriver(new StubDriver());
++ }
++
++ /*
++ * Validate that deregisterDriver succeeds if AllPermissions has been
++ * granted
++ */
++ @Test
++ public void test9() throws SQLException {
++ setPolicy(new TestPolicy("all"));
++ DriverManager.deregisterDriver(new StubDriver());
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/DriverManagerTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,354 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.io.BufferedReader;
++import java.io.ByteArrayInputStream;
++import java.io.ByteArrayOutputStream;
++import java.io.CharArrayReader;
++import java.io.CharArrayWriter;
++import java.io.File;
++import java.io.InputStreamReader;
++import java.io.PrintStream;
++import java.io.PrintWriter;
++import java.sql.Driver;
++import java.sql.DriverManager;
++import java.sql.SQLException;
++import java.util.Properties;
++import static org.testng.Assert.*;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.AfterMethod;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import util.StubDriver;
++
++public class DriverManagerTests {
++
++ private final String StubDriverURL = "jdbc:tennis:boy";
++ private final String StubDriverDAURL = "jdbc:luckydog:tennis";
++ private final String InvalidURL = "jdbc:cardio:tennis";
++ private String[] results = {"output", "more output", "and more", "the end"};
++ private String noOutput = "should not find this";
++
++ public DriverManagerTests() {
++ }
++
++ @BeforeClass
++ public static void setUpClass() throws Exception {
++ }
++
++ @AfterClass
++ public static void tearDownClass() throws Exception {
++ }
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ removeAllDrivers();
++ }
++
++ @AfterMethod
++ public void tearDownMethod() throws Exception {
++ }
++
++ /**
++ * Utility method to remove all registered drivers
++ */
++ private static void removeAllDrivers() {
++ java.util.Enumeration e = DriverManager.getDrivers();
++ while (e.hasMoreElements()) {
++ try {
++ DriverManager.deregisterDriver((Driver) (e.nextElement()));
++ } catch (SQLException ex) {
++ System.out.print(ex.getMessage());
++ }
++ }
++ }
++
++ /**
++ * Utility method to see if a driver is registered
++ */
++ private boolean isDriverRegistered(Driver d) {
++ boolean foundDriver = false;
++ java.util.Enumeration e = DriverManager.getDrivers();
++ while (e.hasMoreElements()) {
++ if (d == (Driver) e.nextElement()) {
++ foundDriver = true;
++ break;
++ }
++ }
++ return foundDriver;
++ }
++
++ /**
++ * Validate that values set using setLoginTimeout will be returned by
++ * getLoginTimeout
++ */
++ @Test
++ public void test() {
++ int[] vals = {-1, 0, 5};
++ for (int val : vals) {
++ DriverManager.setLoginTimeout(val);
++ assertEquals(val, DriverManager.getLoginTimeout());
++ }
++ }
++
++ /**
++ * Validate that NullPointerException is thrown when null is passed to
++ * registerDriver
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test1() throws Exception {
++ Driver d = null;
++ DriverManager.registerDriver(d);
++ }
++
++ /**
++ * Validate that NullPointerException is thrown when null is passed to
++ * registerDriver
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test2() throws Exception {
++ Driver d = null;
++ DriverManager.registerDriver(d, null);
++ }
++
++ /**
++ * Validate that a null value allows for deRegisterDriver to return
++ */
++ @Test
++ public void test3() throws Exception {
++ DriverManager.deregisterDriver(null);
++
++ }
++
++ /**
++ * Validate that SQLException is thrown when there is no Driver to service
++ * the URL
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test4() throws Exception {
++ DriverManager.getConnection(InvalidURL);
++ }
++
++ /**
++ * Validate that SQLException is thrown when there is no Driver to service
++ * the URL
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test5() throws Exception {
++ DriverManager.getConnection(InvalidURL, new Properties());
++ }
++
++ /**
++ * Validate that SQLException is thrown when there is no Driver to service
++ * the URL
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test6() throws Exception {
++ DriverManager.getConnection(InvalidURL, "LuckyDog", "tennisanyone");
++ }
++
++ /**
++ * Validate that SQLException is thrown when null is passed for the URL
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test7() throws Exception {
++ DriverManager.getConnection(null);
++ }
++
++ /**
++ * Validate that SQLException is thrown when null is passed for the URL
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test8() throws Exception {
++ DriverManager.getConnection(null, new Properties());
++ }
++
++ /**
++ * Validate that SQLException is thrown when null is passed for the URL
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test9() throws Exception {
++ DriverManager.getConnection(null, "LuckyDog", "tennisanyone");
++ }
++
++ /**
++ * Validate that SQLException is thrown when there is no Driver to service
++ * the URL
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test10() throws Exception {
++ DriverManager.getDriver(InvalidURL);
++ }
++
++ /**
++ * Validate that SQLException is thrown when null is passed for the URL
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test11() throws Exception {
++ DriverManager.getDriver(null);
++ }
++
++ /**
++ * Validate that a non-null Driver is returned by getDriver when a valid URL
++ * is specified
++ */
++ @Test
++ public void test12() throws Exception {
++
++ DriverManager.registerDriver(new StubDriver());
++ assertTrue(DriverManager.getDriver(StubDriverURL) != null);
++ }
++
++ /**
++ * Validate that SQLException is thrown when the URL is not valid for any of
++ * the registered drivers
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test13() throws Exception {
++ DriverManager.registerDriver(new StubDriver());
++ DriverManager.getDriver(InvalidURL);
++ }
++
++ /**
++ * Validate that a Connection object is returned when a valid URL is
++ * specified to getConnection
++ *
++ */
++ @Test
++ public void test14() throws Exception {
++
++ DriverManager.registerDriver(new StubDriver());
++ assertTrue(
++ DriverManager.getConnection(StubDriverURL) != null);
++ assertTrue(DriverManager.getConnection(StubDriverURL,
++ "LuckyDog", "tennisanyone") != null);
++ Properties props = new Properties();
++ props.put("user", "LuckyDog");
++ props.put("password", "tennisanyone");
++ assertTrue(
++ DriverManager.getConnection(StubDriverURL,
++ props) != null);
++ }
++
++ /**
++ * Register a driver and make sure you find it via its URL. Deregister the
++ * driver and validate it is not longer registered
++ *
++ * @throws Exception
++ */
++ @Test()
++ public void test15() throws Exception {
++ DriverManager.registerDriver(new StubDriver());
++ Driver d = DriverManager.getDriver(StubDriverURL);
++ assertTrue(d != null);
++ assertTrue(isDriverRegistered(d));
++ DriverManager.deregisterDriver(d);
++ assertFalse(isDriverRegistered(d));
++ }
++
++ /**
++ * Validate that DriverAction.release is called when a driver is registered
++ * via registerDriver(Driver, DriverAction)
++ *
++ * @throws Exception
++ */
++ @Test
++ public void test16() throws Exception {
++ File file = new File(util.StubDriverDA.DriverActionCalled);
++ file.delete();
++ assertFalse(file.exists());
++ Driver d = null;
++ Class.forName("util.StubDriverDA");
++ d = DriverManager.getDriver(StubDriverDAURL);
++ DriverManager.deregisterDriver(d);
++ assertFalse(isDriverRegistered(d), "Driver is registered");
++ assertTrue(file.exists());
++ }
++
++ /**
++ * Create a PrintStream and use to send output via DriverManager.println
++ * Validate that if you disable the stream, the output sent is not present
++ */
++ @Test
++ public void tests17() throws Exception {
++ ByteArrayOutputStream os = new ByteArrayOutputStream();
++ PrintStream ps = new PrintStream(os);
++ DriverManager.setLogStream(ps);
++ assertTrue(DriverManager.getLogStream() == ps);
++
++ DriverManager.println(results[0]);
++ DriverManager.setLogStream((PrintStream) null);
++ assertTrue(DriverManager.getLogStream() == null);
++ DriverManager.println(noOutput);
++ DriverManager.setLogStream(ps);
++ DriverManager.println(results[1]);
++ DriverManager.println(results[2]);
++ DriverManager.println(results[3]);
++ DriverManager.setLogStream((PrintStream) null);
++ DriverManager.println(noOutput);
++
++ /*
++ * Check we do not get the output when the stream is disabled
++ */
++ InputStreamReader is
++ = new InputStreamReader(new ByteArrayInputStream(os.toByteArray()));
++ BufferedReader reader = new BufferedReader(is);
++ for (String result : results) {
++ assertTrue(result.equals(reader.readLine()));
++ }
++ }
++
++ /**
++ * Create a PrintWriter and use to to send output via DriverManager.println
++ * Validate that if you disable the writer, the output sent is not present
++ */
++ @Test
++ public void tests18() throws Exception {
++ CharArrayWriter cw = new CharArrayWriter();
++ PrintWriter pw = new PrintWriter(cw);
++ DriverManager.setLogWriter(pw);
++ assertTrue(DriverManager.getLogWriter() == pw);
++
++ DriverManager.println(results[0]);
++ DriverManager.setLogWriter(null);
++ assertTrue(DriverManager.getLogWriter() == null);
++ DriverManager.println(noOutput);
++ DriverManager.setLogWriter(pw);
++ DriverManager.println(results[1]);
++ DriverManager.println(results[2]);
++ DriverManager.println(results[3]);
++ DriverManager.setLogWriter(null);
++ DriverManager.println(noOutput);
++
++ /*
++ * Check we do not get the output when the stream is disabled
++ */
++ BufferedReader reader
++ = new BufferedReader(new CharArrayReader(cw.toCharArray()));
++ for (String result : results) {
++ assertTrue(result.equals(reader.readLine()));
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLClientInfoExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,227 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.ClientInfoStatus;
++import java.sql.SQLClientInfoException;
++import java.sql.SQLException;
++import java.util.HashMap;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLClientInfoExceptionTests extends BaseTest {
++
++ private final HashMap<String, ClientInfoStatus> map = new HashMap<>();
++
++ public SQLClientInfoExceptionTests() {
++ map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
++ map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
++ }
++
++ /**
++ * Create SQLClientInfoException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLClientInfoException e = new SQLClientInfoException(null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == 0
++ && e.getFailedProperties() == null);
++ }
++
++ /**
++ * Create SQLClientInfoException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLClientInfoException ex = new SQLClientInfoException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getFailedProperties() == null);
++ }
++
++ /**
++ * Create SQLClientInfoException with null Throwable
++ */
++ @Test
++ public void test2() {
++
++ SQLClientInfoException ex = new SQLClientInfoException(map, null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getFailedProperties().equals(map));
++ }
++
++ /**
++ * Create SQLClientInfoException with message
++ */
++ @Test
++ public void test3() {
++ SQLClientInfoException ex = new SQLClientInfoException(reason, map);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getFailedProperties().equals(map));
++ }
++
++ /**
++ * Create SQLClientInfoException with null Throwable
++ */
++ @Test
++ public void test4() {
++ SQLClientInfoException ex = new SQLClientInfoException(reason, map, null);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getFailedProperties().equals(map));
++ }
++
++ /**
++ * Create SQLClientInfoException with message, and SQLState
++ */
++ @Test
++ public void test5() {
++ SQLClientInfoException ex = new SQLClientInfoException(reason, state,
++ map);
++
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getFailedProperties().equals(map));
++ }
++
++ /**
++ * Create SQLClientInfoException with message, and SQLState
++ */
++ @Test
++ public void test6() {
++ SQLClientInfoException ex = new SQLClientInfoException(reason, state,
++ map, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0
++ && ex.getFailedProperties().equals(map));
++ }
++
++ /**
++ * Create SQLClientInfoException with message, SQLState, errorCode, and
++ * Throwable
++ */
++ @Test
++ public void test7() {
++ SQLClientInfoException ex = new SQLClientInfoException(reason, state,
++ errorCode, map);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode
++ && ex.getFailedProperties().equals(map));
++ }
++
++ /**
++ * Create SQLClientInfoException with message, SQLState, and error code
++ */
++ @Test
++ public void test8() {
++ SQLClientInfoException ex = new SQLClientInfoException(reason, state,
++ errorCode, map, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode
++ && ex.getFailedProperties().equals(map));
++ }
++
++ /**
++ * Serialize a SQLClientInfoException and make sure you can read it back
++ * properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLClientInfoException e = new SQLClientInfoException(reason, state,
++ errorCode, map, t);
++ SQLClientInfoException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode
++ && ex1.getFailedProperties().equals(map));
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct using
++ * for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLClientInfoException ex = new SQLClientInfoException("Exception 1",
++ map, t1);
++ SQLClientInfoException ex1 = new SQLClientInfoException("Exception 2",
++ map);
++ SQLClientInfoException ex2 = new SQLClientInfoException("Exception 3",
++ map, t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLClientInfoException ex = new SQLClientInfoException("Exception 1",
++ map, t1);
++ SQLClientInfoException ex1 = new SQLClientInfoException("Exception 2",
++ map);
++ SQLClientInfoException ex2 = new SQLClientInfoException("Exception 3",
++ map, t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLDataExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,215 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLDataException;
++import java.sql.SQLException;
++import java.sql.SQLNonTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLDataExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLDataException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLDataException e = new SQLDataException(null, null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLDataException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLDataException ex = new SQLDataException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLDataException with message
++ */
++ @Test
++ public void test2() {
++ SQLDataException ex = new SQLDataException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLDataException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLDataException ex = new SQLDataException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLDataException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLDataException ex = new SQLDataException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLDataException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLDataException ex = new SQLDataException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLDataException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLDataException ex = new SQLDataException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLDataException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLDataException ex = new SQLDataException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLDataException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLDataException ex = new SQLDataException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLDataException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLDataException ex = new SQLDataException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLDataException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLDataException e = new SQLDataException(reason, state, errorCode, t);
++ SQLDataException ex1 = createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLDataException ex = new SQLDataException("Exception 1", t1);
++ SQLDataException ex1 = new SQLDataException("Exception 2");
++ SQLDataException ex2 = new SQLDataException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLDataException ex = new SQLDataException("Exception 1", t1);
++ SQLDataException ex1 = new SQLDataException("Exception 2");
++ SQLDataException ex2 = new SQLDataException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLDataException and validate it is an instance of
++ * SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLDataException();
++ assertTrue(ex instanceof SQLNonTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,202 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLException e = new SQLException(null, null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLException ex = new SQLException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLException with message
++ */
++ @Test
++ public void test2() {
++ SQLException ex = new SQLException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLException ex = new SQLException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLException ex = new SQLException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLException ex = new SQLException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLException ex = new SQLException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLException ex = new SQLException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLException ex = new SQLException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLException ex = new SQLException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLException e = new SQLException(reason, state, errorCode, t);
++ SQLException ex1 = createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLException ex = new SQLException("Exception 1", t1);
++ SQLException ex1 = new SQLException("Exception 2");
++ SQLException ex2 = new SQLException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLException ex = new SQLException("Exception 1", t1);
++ SQLException ex1 = new SQLException("Exception 2");
++ SQLException ex2 = new SQLException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ while (ex != null) {
++ assertTrue(msgs[num++].equals(ex.getMessage()));
++ Throwable c = ex.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ ex = ex.getNextException();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLFeatureNotSupportedExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,232 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLFeatureNotSupportedException;
++import java.sql.SQLNonTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLFeatureNotSupportedExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLFeatureNotSupportedException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLFeatureNotSupportedException e =
++ new SQLFeatureNotSupportedException(null, null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with message
++ */
++ @Test
++ public void test2() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException((Throwable) null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLFeatureNotSupportedException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLFeatureNotSupportedException e =
++ new SQLFeatureNotSupportedException(reason, state, errorCode, t);
++ SQLFeatureNotSupportedException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException("Exception 1", t1);
++ SQLFeatureNotSupportedException ex1 =
++ new SQLFeatureNotSupportedException("Exception 2");
++ SQLFeatureNotSupportedException ex2 =
++ new SQLFeatureNotSupportedException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLFeatureNotSupportedException ex =
++ new SQLFeatureNotSupportedException("Exception 1", t1);
++ SQLFeatureNotSupportedException ex1 =
++ new SQLFeatureNotSupportedException("Exception 2");
++ SQLFeatureNotSupportedException ex2 =
++ new SQLFeatureNotSupportedException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLFeatureNotSupportedException and validate it is an instance of
++ * SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLFeatureNotSupportedException();
++ assertTrue(ex instanceof SQLNonTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLIntegrityConstraintViolationExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,235 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLIntegrityConstraintViolationException;
++import java.sql.SQLNonTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLIntegrityConstraintViolationExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLIntegrityConstraintViolationException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLIntegrityConstraintViolationException e =
++ new SQLIntegrityConstraintViolationException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with message
++ */
++ @Test
++ public void test2() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLIntegrityConstraintViolationException and make sure
++ * you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLIntegrityConstraintViolationException e =
++ new SQLIntegrityConstraintViolationException(reason, state, errorCode, t);
++ SQLIntegrityConstraintViolationException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException("Exception 1", t1);
++ SQLIntegrityConstraintViolationException ex1 =
++ new SQLIntegrityConstraintViolationException("Exception 2");
++ SQLIntegrityConstraintViolationException ex2 =
++ new SQLIntegrityConstraintViolationException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLIntegrityConstraintViolationException ex =
++ new SQLIntegrityConstraintViolationException("Exception 1", t1);
++ SQLIntegrityConstraintViolationException ex1 =
++ new SQLIntegrityConstraintViolationException("Exception 2");
++ SQLIntegrityConstraintViolationException ex2 =
++ new SQLIntegrityConstraintViolationException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLIntegrityConstraintViolationException and validate it is an instance of
++ * SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLIntegrityConstraintViolationException();
++ assertTrue(ex instanceof SQLNonTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLInvalidAuthorizationSpecExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,239 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLInvalidAuthorizationSpecException;
++import java.sql.SQLNonTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLInvalidAuthorizationSpecExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException and setting all objects to
++ * null
++ */
++ @Test
++ public void test() {
++ SQLInvalidAuthorizationSpecException e
++ = new SQLInvalidAuthorizationSpecException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with message
++ */
++ @Test
++ public void test2() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with message, SQLState, and
++ * error code
++ */
++ @Test
++ public void test4() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with message, SQLState,
++ * errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with message, SQLState, and
++ * Throwable
++ */
++ @Test
++ public void test6() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException((Throwable) null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLInvalidAuthorizationSpecException and make sure you can
++ * read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLInvalidAuthorizationSpecException e
++ = new SQLInvalidAuthorizationSpecException(reason, state, errorCode, t);
++ SQLInvalidAuthorizationSpecException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct using
++ * for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException("Exception 1", t1);
++ SQLInvalidAuthorizationSpecException ex1
++ = new SQLInvalidAuthorizationSpecException("Exception 2");
++ SQLInvalidAuthorizationSpecException ex2
++ = new SQLInvalidAuthorizationSpecException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLInvalidAuthorizationSpecException ex
++ = new SQLInvalidAuthorizationSpecException("Exception 1", t1);
++ SQLInvalidAuthorizationSpecException ex1
++ = new SQLInvalidAuthorizationSpecException("Exception 2");
++ SQLInvalidAuthorizationSpecException ex2
++ = new SQLInvalidAuthorizationSpecException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLInvalidAuthorizationSpecException and validate it is an
++ * instance of SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLInvalidAuthorizationSpecException();
++ assertTrue(ex instanceof SQLNonTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLNonTransientConnectionExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,235 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLNonTransientConnectionException;
++import java.sql.SQLNonTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLNonTransientConnectionExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLNonTransientConnectionException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLNonTransientConnectionException e =
++ new SQLNonTransientConnectionException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with message
++ */
++ @Test
++ public void test2() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLNonTransientConnectionException and make sure you can
++ * read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLNonTransientConnectionException e =
++ new SQLNonTransientConnectionException(reason, state, errorCode, t);
++ SQLNonTransientConnectionException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException("Exception 1", t1);
++ SQLNonTransientConnectionException ex1 =
++ new SQLNonTransientConnectionException("Exception 2");
++ SQLNonTransientConnectionException ex2 =
++ new SQLNonTransientConnectionException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLNonTransientConnectionException ex =
++ new SQLNonTransientConnectionException("Exception 1", t1);
++ SQLNonTransientConnectionException ex1 =
++ new SQLNonTransientConnectionException("Exception 2");
++ SQLNonTransientConnectionException ex2 =
++ new SQLNonTransientConnectionException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLNonTransientConnectionException and validate it is an instance of
++ * SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLNonTransientConnectionException();
++ assertTrue(ex instanceof SQLNonTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLNonTransientExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,209 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLNonTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLNonTransientExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLNonTransientException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLNonTransientException e = new SQLNonTransientException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLNonTransientException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLNonTransientException ex = new SQLNonTransientException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientException with message
++ */
++ @Test
++ public void test2() {
++ SQLNonTransientException ex = new SQLNonTransientException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLNonTransientException ex = new SQLNonTransientException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {;
++ SQLNonTransientException ex =
++ new SQLNonTransientException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLNonTransientException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLNonTransientException ex =
++ new SQLNonTransientException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLNonTransientException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLNonTransientException ex = new SQLNonTransientException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLNonTransientException ex = new SQLNonTransientException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLNonTransientException ex = new SQLNonTransientException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLNonTransientException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLNonTransientException ex = new SQLNonTransientException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLNonTransientException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLNonTransientException e =
++ new SQLNonTransientException(reason, state, errorCode, t);
++ SQLNonTransientException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLNonTransientException ex = new SQLNonTransientException("Exception 1", t1);
++ SQLNonTransientException ex1 = new SQLNonTransientException("Exception 2");
++ SQLNonTransientException ex2 = new SQLNonTransientException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLNonTransientException ex = new SQLNonTransientException("Exception 1", t1);
++ SQLNonTransientException ex1 = new SQLNonTransientException("Exception 2");
++ SQLNonTransientException ex2 = new SQLNonTransientException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLRecoverableExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,209 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLRecoverableException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLRecoverableExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLRecoverableException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLRecoverableException e = new SQLRecoverableException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLRecoverableException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLRecoverableException ex = new SQLRecoverableException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLRecoverableException with message
++ */
++ @Test
++ public void test2() {
++ SQLRecoverableException ex = new SQLRecoverableException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLRecoverableException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLRecoverableException ex = new SQLRecoverableException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLRecoverableException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLRecoverableException ex =
++ new SQLRecoverableException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLRecoverableException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLRecoverableException ex =
++ new SQLRecoverableException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLRecoverableException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLRecoverableException ex = new SQLRecoverableException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLRecoverableException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLRecoverableException ex = new SQLRecoverableException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLRecoverableException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLRecoverableException ex = new SQLRecoverableException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLRecoverableException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLRecoverableException ex = new SQLRecoverableException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLRecoverableException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLRecoverableException e =
++ new SQLRecoverableException(reason, state, errorCode, t);
++ SQLRecoverableException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLRecoverableException ex = new SQLRecoverableException("Exception 1", t1);
++ SQLRecoverableException ex1 = new SQLRecoverableException("Exception 2");
++ SQLRecoverableException ex2 = new SQLRecoverableException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLRecoverableException ex = new SQLRecoverableException("Exception 1", t1);
++ SQLRecoverableException ex1 = new SQLRecoverableException("Exception 2");
++ SQLRecoverableException ex2 = new SQLRecoverableException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLSyntaxErrorExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,221 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLNonTransientException;
++import java.sql.SQLSyntaxErrorException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLSyntaxErrorExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLSyntaxErrorException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLSyntaxErrorException e = new SQLSyntaxErrorException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with message
++ */
++ @Test
++ public void test2() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLSyntaxErrorException ex =
++ new SQLSyntaxErrorException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLSyntaxErrorException ex =
++ new SQLSyntaxErrorException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLSyntaxErrorException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLSyntaxErrorException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++
++ SQLSyntaxErrorException e =
++ new SQLSyntaxErrorException(reason, state, errorCode, t);
++ SQLSyntaxErrorException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException("Exception 1", t1);
++ SQLSyntaxErrorException ex1 = new SQLSyntaxErrorException("Exception 2");
++ SQLSyntaxErrorException ex2 = new SQLSyntaxErrorException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLSyntaxErrorException ex = new SQLSyntaxErrorException("Exception 1", t1);
++ SQLSyntaxErrorException ex1 = new SQLSyntaxErrorException("Exception 2");
++ SQLSyntaxErrorException ex2 = new SQLSyntaxErrorException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLSyntaxErrorException and validate it is an instance of
++ * SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLSyntaxErrorException();
++ assertTrue(ex instanceof SQLNonTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLTimeoutExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,218 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLTimeoutException;
++import java.sql.SQLTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLTimeoutExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLTimeoutException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLTimeoutException e = new SQLTimeoutException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTimeoutException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLTimeoutException ex = new SQLTimeoutException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTimeoutException with message
++ */
++ @Test
++ public void test2() {
++ SQLTimeoutException ex = new SQLTimeoutException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTimeoutException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLTimeoutException ex = new SQLTimeoutException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTimeoutException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLTimeoutException ex = new SQLTimeoutException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTimeoutException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLTimeoutException ex = new SQLTimeoutException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTimeoutException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLTimeoutException ex = new SQLTimeoutException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTimeoutException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLTimeoutException ex = new SQLTimeoutException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTimeoutException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLTimeoutException ex = new SQLTimeoutException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTimeoutException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLTimeoutException ex = new SQLTimeoutException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLTimeoutException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLTimeoutException e =
++ new SQLTimeoutException(reason, state, errorCode, t);
++ SQLTimeoutException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLTimeoutException ex = new SQLTimeoutException("Exception 1", t1);
++ SQLTimeoutException ex1 = new SQLTimeoutException("Exception 2");
++ SQLTimeoutException ex2 = new SQLTimeoutException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLTimeoutException ex = new SQLTimeoutException("Exception 1", t1);
++ SQLTimeoutException ex1 = new SQLTimeoutException("Exception 2");
++ SQLTimeoutException ex2 = new SQLTimeoutException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLTimeoutException and validate it is an instance of
++ * SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLTimeoutException();
++ assertTrue(ex instanceof SQLTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLTransactionRollbackExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,233 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLTransactionRollbackException;
++import java.sql.SQLTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLTransactionRollbackExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLTransactionRollbackException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLTransactionRollbackException e =
++ new SQLTransactionRollbackException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLTransactionRollbackException ex = new SQLTransactionRollbackException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with message
++ */
++ @Test
++ public void test2() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransactionRollbackException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLTransactionRollbackException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLTransactionRollbackException e =
++ new SQLTransactionRollbackException(reason, state, errorCode, t);
++ SQLTransactionRollbackException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException("Exception 1", t1);
++ SQLTransactionRollbackException ex1 =
++ new SQLTransactionRollbackException("Exception 2");
++ SQLTransactionRollbackException ex2 =
++ new SQLTransactionRollbackException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLTransactionRollbackException ex =
++ new SQLTransactionRollbackException("Exception 1", t1);
++ SQLTransactionRollbackException ex1 =
++ new SQLTransactionRollbackException("Exception 2");
++ SQLTransactionRollbackException ex2 =
++ new SQLTransactionRollbackException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLTransactionRollbackException and validate it is an instance of
++ * SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLTransactionRollbackException();
++ assertTrue(ex instanceof SQLTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLTransientConnectionExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,233 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLTransientConnectionException;
++import java.sql.SQLTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLTransientConnectionExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLTransientConnectionException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLTransientConnectionException e =
++ new SQLTransientConnectionException( null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLTransientConnectionException ex = new SQLTransientConnectionException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with message
++ */
++ @Test
++ public void test2() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {;
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientConnectionException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLTransientConnectionException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLTransientConnectionException e =
++ new SQLTransientConnectionException(reason, state, errorCode, t);
++ SQLTransientConnectionException ex1 =
++ createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException("Exception 1", t1);
++ SQLTransientConnectionException ex1 =
++ new SQLTransientConnectionException("Exception 2");
++ SQLTransientConnectionException ex2 =
++ new SQLTransientConnectionException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLTransientConnectionException ex =
++ new SQLTransientConnectionException("Exception 1", t1);
++ SQLTransientConnectionException ex1 =
++ new SQLTransientConnectionException("Exception 2");
++ SQLTransientConnectionException ex2 =
++ new SQLTransientConnectionException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Create SQLTransientConnectionException and validate it is an instance of
++ * SQLNonTransientException
++ */
++ @Test
++ public void test13() {
++ Exception ex = new SQLTransientConnectionException();
++ assertTrue(ex instanceof SQLTransientException);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLTransientExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,207 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLTransientException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLTransientExceptionTests extends BaseTest {
++
++ /**
++ * Create SQLTransientException and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLTransientException e = new SQLTransientException(null,
++ null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransientException with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLTransientException ex = new SQLTransientException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientException with message
++ */
++ @Test
++ public void test2() {
++ SQLTransientException ex = new SQLTransientException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientException with message, and SQLState
++ */
++ @Test
++ public void test3() {
++ SQLTransientException ex = new SQLTransientException(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientException with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLTransientException ex = new SQLTransientException(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransientException with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLTransientException ex =
++ new SQLTransientException(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLTransientException with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLTransientException ex = new SQLTransientException(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientException with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLTransientException ex = new SQLTransientException(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientException with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLTransientException ex = new SQLTransientException((Throwable)null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLTransientException with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLTransientException ex = new SQLTransientException(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLTransientException and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLTransientException e =
++ new SQLTransientException(reason, state, errorCode, t);
++ SQLTransientException ex1 = createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLTransientException ex = new SQLTransientException("Exception 1", t1);
++ SQLTransientException ex1 = new SQLTransientException("Exception 2");
++ SQLTransientException ex2 = new SQLTransientException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct
++ * using traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLTransientException ex = new SQLTransientException("Exception 1", t1);
++ SQLTransientException ex1 = new SQLTransientException("Exception 2");
++ SQLTransientException ex2 = new SQLTransientException("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/SQLWarningTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,249 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SQLWarningTests extends BaseTest {
++
++ private final String[] warnings = {"Warning 1", "cause 1", "Warning 2",
++ "Warning 3", "cause 2"};
++
++ /**
++ * Create SQLWarning and setting all objects to null
++ */
++ @Test
++ public void test() {
++ SQLWarning e = new SQLWarning(null, null, errorCode, null);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLWarning with no-arg constructor
++ */
++ @Test
++ public void test1() {
++ SQLWarning ex = new SQLWarning();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLWarning with message
++ */
++ @Test
++ public void test2() {
++ SQLWarning ex = new SQLWarning(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLWarning with message, and SQLState
++ */
++ @Test
++ public void test3() {
++
++ SQLWarning ex = new SQLWarning(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLWarning with message, SQLState, and error code
++ */
++ @Test
++ public void test4() {
++ SQLWarning ex = new SQLWarning(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLWarning with message, SQLState, errorCode, and Throwable
++ */
++ @Test
++ public void test5() {
++ SQLWarning ex = new SQLWarning(reason, state, errorCode, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Create SQLWarning with message, SQLState, and Throwable
++ */
++ @Test
++ public void test6() {
++ SQLWarning ex = new SQLWarning(reason, state, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLWarning with message, and Throwable
++ */
++ @Test
++ public void test7() {
++ SQLWarning ex = new SQLWarning(reason, t);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLWarning with null Throwable
++ */
++ @Test
++ public void test8() {
++ SQLWarning ex = new SQLWarning((Throwable) null);
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Create SQLWarning with Throwable
++ */
++ @Test
++ public void test9() {
++ SQLWarning ex = new SQLWarning(t);
++ assertTrue(ex.getMessage().equals(cause)
++ && ex.getSQLState() == null
++ && cause.equals(ex.getCause().toString())
++ && ex.getErrorCode() == 0);
++ }
++
++ /**
++ * Serialize a SQLWarning and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ SQLWarning e = new SQLWarning(reason, state, errorCode, t);
++ SQLWarning ex1 = createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct using
++ * for-each loop
++ */
++ @Test
++ public void test11() {
++ SQLWarning ex = new SQLWarning("Exception 1", t1);
++ SQLWarning ex1 = new SQLWarning("Exception 2");
++ SQLWarning ex2 = new SQLWarning("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned Exceptions is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test12() {
++ SQLWarning ex = new SQLWarning("Exception 1", t1);
++ SQLWarning ex1 = new SQLWarning("Exception 2");
++ SQLWarning ex2 = new SQLWarning("Exception 3", t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned SQLWarning is correct using
++ * for-each loop
++ */
++ @Test
++ public void test13() {
++ SQLWarning ex = new SQLWarning("Warning 1", t1);
++ SQLWarning ex1 = new SQLWarning("Warning 2");
++ SQLWarning ex2 = new SQLWarning("Warning 3", t2);
++ ex.setNextWarning(ex1);
++ ex.setNextWarning(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(warnings[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned SQLWarning is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test14() {
++ SQLWarning ex = new SQLWarning("Warning 1", t1);
++ SQLWarning ex1 = new SQLWarning("Warning 2");
++ SQLWarning ex2 = new SQLWarning("Warning 3", t2);
++ ex.setNextWarning(ex1);
++ ex.setNextWarning(ex2);
++ int num = 0;
++ SQLWarning sqe = ex;
++ while (sqe != null) {
++ assertTrue(warnings[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextWarning();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/TimeTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,348 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.Time;
++import java.time.LocalTime;
++import static org.testng.Assert.*;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class TimeTests extends BaseTest {
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling getYear
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test01() {
++ Time t = Time.valueOf("08:30:59");
++ t.getYear();
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling getMonth
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test02() {
++ Time t = Time.valueOf("08:30:59");
++ t.getMonth();
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling getDay
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test03() {
++ Time t = Time.valueOf("08:30:59");
++ t.getDay();
++ }
++
++ /**
++ * Validate an IllegalArgumentException is thrown for calling getDate
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test04() {
++ Time t = Time.valueOf("08:30:59");
++ t.getDate();
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling setYear
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test05() {
++ Time t = Time.valueOf("08:30:59");
++ t.setYear(8);
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling setMonth
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test06() {
++ Time t = Time.valueOf("08:30:59");
++ t.setMonth(8);
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling setDate
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test07() {
++ Time t = Time.valueOf("08:30:59");
++ t.setDate(30);
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for calling getDate
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test08() {
++ Time t = Time.valueOf("08:30:59");
++ t.getDate();
++ }
++
++ /*
++ * Validate that a Time made from a toLocalTime() LocalTime are equal
++ */
++ @Test
++ public void test09() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = Time.valueOf(t.toLocalTime());
++ assertTrue(t.equals(t2), "Error t != t2");
++ }
++
++ /*
++ * Validate that a Time LocalTime value, made from a LocalTime are equal
++ */
++ @Test
++ public void test10() {
++ LocalTime lt = LocalTime.of(8, 30, 59);
++ Time t = Time.valueOf(lt);
++ System.out.println("lt=" + lt + ",t=" + t.toLocalTime());
++ assertTrue(lt.equals(t.toLocalTime()),
++ "Error LocalTime values are not equal");
++ }
++
++ /*
++ * Validate an NPE occurs when a null LocalDate is passed to valueOf
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test11() throws Exception {
++ LocalTime ld = null;
++ Time.valueOf(ld);
++ }
++
++ /*
++ * Validate an UnsupportedOperationException occurs when toInstant() is
++ * called
++ */
++ @Test(expectedExceptions = UnsupportedOperationException.class)
++ public void test12() throws Exception {
++ Time t = new Time(System.currentTimeMillis());
++ t.toInstant();
++ }
++
++ /*
++ * Validate that two Time objects are equal when one is created from the
++ * toString() of the other and that the correct value is returned from
++ * toString()
++ */
++ @Test(dataProvider = "validTimeValues")
++ public void test13(String time, String expected) {
++ Time t1 = Time.valueOf(time);
++ Time t2 = Time.valueOf(t1.toString());
++ assertTrue(t1.equals(t2) && t2.equals(t1)
++ && t1.toString().equals(expected), "Error t1 != t2");
++ }
++
++ /*
++ * Validate that two Time values one created using valueOf and another via a
++ * constructor are equal
++ */
++ @Test
++ public void test14() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(8, 30, 59);
++ assertTrue(t.equals(t2) && t2.equals(t), "Error t != t2");
++ }
++
++ /*
++ * Validate that two Time values one created using valueOf and another via a
++ * constructor are equal
++ */
++ @Test
++ public void test15() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(t.getTime());
++ assertTrue(t.equals(t2) && t2.equals(t), "Error t != t2");
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for an invalid Time string
++ */
++ @Test(dataProvider = "invalidTimeValues",
++ expectedExceptions = IllegalArgumentException.class)
++ public void test16(String time) throws Exception {
++ Time.valueOf(time);
++ }
++
++ /*
++ * Validate that Time.after() returns false when same date is compared
++ */
++ @Test
++ public void test17() {
++ Time t = Time.valueOf("08:30:59");
++ assertFalse(t.after(t), "Error t.after(t) = true");
++ }
++
++ /*
++ * Validate that Time.after() returns true when later date is compared to
++ * earlier date
++ */
++ @Test
++ public void test18() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(System.currentTimeMillis());
++ assertTrue(t2.after(t), "Error t2.after(t) = false");
++ }
++
++ /*
++ * Validate that Time.after() returns false when earlier date is compared to
++ * itself
++ */
++ @Test
++ public void test19() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(t.getTime());
++ assertFalse(t.after(t2), "Error t.after(t2) = true");
++ assertFalse(t2.after(t), "Error t2.after(t) = true");
++ }
++
++ /*
++ * Validate that Time.before() returns false when same date is compared
++ */
++ @Test
++ public void test20() {
++ Time t = Time.valueOf("08:30:59");
++ assertFalse(t.before(t), "Error t.before(t) = true");
++ }
++
++ /*
++ * Validate that Time.before() returns true when earlier date is compared to
++ * later date
++ */
++ @Test
++ public void test21() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(System.currentTimeMillis());
++ assertTrue(t.before(t2), "Error t.before(t2) = false");
++ }
++
++ /*
++ * Validate that Time.before() returns false when earlier date is compared
++ * to itself
++ */
++ @Test
++ public void test22() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(t.getTime());
++ assertFalse(t.before(t2), "Error t.after(t2) = true");
++ assertFalse(t2.before(t), "Error t2.after(t) = true");
++ }
++
++ /*
++ * Validate that Time.compareTo returns 0 when both Date objects are the
++ * same
++ */
++ @Test
++ public void test23() {
++ Time t = Time.valueOf("08:30:59");
++ assertTrue(t.compareTo(t) == 0, "Error t.compareTo(t) !=0");
++ }
++
++ /*
++ * Validate thatTime.compareTo returns 0 when both Time objects are the same
++ */
++ @Test
++ public void test24() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(t.getTime());
++ assertTrue(t.compareTo(t2) == 0, "Error t.compareTo(t2) !=0");
++ }
++
++ /*
++ * Validate that Time.compareTo returns 1 when comparing a later Time to an
++ * earlier Time
++ */
++ @Test
++ public void test25() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(t.getTime() + 1);
++ assertTrue(t2.compareTo(t) == 1, "Error t2.compareTo(t) !=1");
++ }
++
++ /*
++ * Validate thatTime.compareTo returns 1 when comparing a later Time to an
++ * earlier Time
++ */
++ @Test
++ public void test26() {
++ Time t = Time.valueOf("08:30:59");
++ Time t2 = new Time(t.getTime() + 1);
++ assertTrue(t.compareTo(t2) == -1, "Error t.compareTo(t2) != -1");
++ }
++
++ /*
++ * DataProvider used to provide Time values which are not valid and are used
++ * to validate that an IllegalArgumentException will be thrown from the
++ * valueOf method
++ */
++ @DataProvider(name = "invalidTimeValues")
++ private Object[][] invalidTimeValues() {
++ return new Object[][]{
++ {"2009-11-01 10:50:01"},
++ {"1961-08-30 10:50:01.1"},
++ {"1961-08-30"},
++ {"00:00:00."},
++ {"10:50:0.1"},
++ {":00:00"},
++ {"00::00"},
++ {"00:00:"},
++ {"::"},
++ {" : : "},
++ {"0a:00:00"},
++ {"00:bb:00"},
++ {"00:01:cc"},
++ {"08:10:Batman"},
++ {"08:10:10:10"},
++ {"08:10"},
++ {"a:b:c"},
++ {null},
++ {"8:"}
++ };
++ }
++
++ /*
++ * DataProvider used to provide Time values which are valid and are used
++ * to validate that an IllegalArgumentException will not be thrown from the
++ * valueOf method. It also contains the expected return value from
++ * toString()
++ */
++ @DataProvider(name = "validTimeValues")
++ private Object[][] validTimeValues() {
++ return new Object[][]{
++ {"10:50:01", "10:50:01"},
++ {"01:1:1", "01:01:01"},
++ {"01:01:1", "01:01:01"},
++ {"1:01:1", "01:01:01"},
++ {"2:02:02", "02:02:02"},
++ {"2:02:2", "02:02:02"},
++ {"10:50:1", "10:50:01"},
++ {"00:00:00", "00:00:00"},
++ {"08:30:59", "08:30:59"},
++ {"9:0:1", "09:00:01"}
++ };
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/test/sql/TimestampTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,777 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.sql;
++
++import java.sql.Date;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.time.Instant;
++import java.time.LocalDateTime;
++import java.time.ZoneId;
++import java.util.Calendar;
++import java.util.TimeZone;
++import static org.testng.Assert.*;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class TimestampTests extends BaseTest {
++
++ private static TimeZone defaultTimeZone = null;
++
++ /*
++ * Need to set and use a custom TimeZone which does not
++ * observe daylight savings time for this test.
++ */
++ @BeforeClass
++ public static void setUpClass() throws Exception {
++ defaultTimeZone = TimeZone.getDefault();
++ TimeZone tzone = TimeZone.getTimeZone("GMT+01");
++ assertFalse(tzone.observesDaylightTime());
++ TimeZone.setDefault(tzone);
++ }
++
++ /*
++ * Conservatively reset the default time zone after test.
++ */
++ @AfterClass
++ public static void tearDownClass() throws Exception {
++ TimeZone.setDefault(defaultTimeZone);
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for an invalid Timestamp
++ */
++ @Test(dataProvider = "invalidTimestampValues",
++ expectedExceptions = IllegalArgumentException.class)
++ public void test(String ts) throws Exception {
++ Timestamp.valueOf(ts);
++ }
++
++ /*
++ * Validate that two Timestamp are equal when the leading 0 in seconds is
++ * omitted
++ */
++ @Test
++ public void test01() throws Exception {
++ String testTS = "2009-01-01 10:50:00";
++ String ExpectedTS = "2009-01-01 10:50:0";
++ Timestamp ts = Timestamp.valueOf(testTS);
++ Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
++ assertEquals(ts, ts2, "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate two Timestamps created from the same string are equal
++ */
++ @Test
++ public void test02() throws Exception {
++ String testTS = "2009-01-01 10:50:0";
++ Timestamp ts = Timestamp.valueOf(testTS);
++ Timestamp ts2 = Timestamp.valueOf(testTS);
++ assertEquals(ts, ts2, "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that two Timestamp values one with leading 0s for month and day
++ * equals same string without the leading 0s.
++ */
++ @Test
++ public void test03() throws Exception {
++ String testTS = "2009-1-1 10:50:0";
++ String ExpectedTS = "2009-01-01 10:50:0";
++ Timestamp ts = Timestamp.valueOf(testTS);
++ Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
++ assertEquals(ts, ts2, "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that two Timestamp values one with leading 0s for day omitted
++ * are equal
++ */
++ @Test
++ public void test04() throws Exception {
++ String testTS = "2009-01-1 10:50:0";
++ String ExpectedTS = "2009-01-01 10:50:0";
++ Timestamp ts = Timestamp.valueOf(testTS);
++ Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
++ assertEquals(ts, ts2, "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that two Timestamp values one with leading 0s for month omitted
++ * and both with leading 0s for seconds omitted are equal
++ */
++ @Test
++ public void test05() throws Exception {
++ String testTS = "2009-1-01 10:50:0";
++ String ExpectedTS = "2009-01-01 10:50:0";
++ Timestamp ts = Timestamp.valueOf(testTS);
++ Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
++ assertEquals(ts, ts2, "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that two Timestamp values one with leading 0s for month omitted
++ */
++ @Test
++ public void test06() throws Exception {
++ String testTS = "2005-1-01 10:20:50.00";
++ String ExpectedTS = "2005-01-01 10:20:50.00";
++ Timestamp ts = Timestamp.valueOf(testTS);
++ Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
++ assertEquals(ts, ts2, "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that two Timestamp values one created using valueOf and another
++ * via a constructor are equal
++ */
++ @Test
++ public void test07() {
++
++ Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.001");
++ Timestamp ts2 = new Timestamp(96, 11, 13, 14, 15, 25, 1000000);
++ assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that two Timestamp values one created using valueOf and another
++ * via a constructor are equal
++ */
++ @Test
++ public void test08() {
++ Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.001");
++ Timestamp ts2 = new Timestamp(ts1.getTime());
++ assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that two Timestamp values one created using valueOf and another
++ * via a constructor are equal
++ */
++ @Test
++ public void test09() {
++
++ Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.0");
++ Timestamp ts2 = new Timestamp(96, 11, 13, 14, 15, 25, 0);
++ assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that a Timestamp cannot be equal to null
++ */
++ @Test
++ public void test10() {
++
++ Timestamp ts1 = Timestamp.valueOf("1961-08-30 14:15:25.745634");
++ Timestamp ts2 = null;
++ assertFalse(ts1.equals(ts2), "Error ts1 == null");
++ }
++
++ /*
++ * Validate that a Timestamp is equal to another timestamp created with the
++ * using the same value but not equal to a Timestamp which is one day later
++ */
++ @Test
++ public void test11() {
++
++ Timestamp ts1 = Timestamp.valueOf("1996-12-10 12:26:19.12");
++ Timestamp ts2 = Timestamp.valueOf("1996-12-10 12:26:19.12");
++ Timestamp ts3 = Timestamp.valueOf("1996-12-11 12:24:19.12");
++ assertTrue(ts1.equals(ts2) && ts2.equals(ts1), "Error ts1 != ts2");
++ assertFalse(ts1.equals(ts3) && ts3.equals(ts1), "Error ts1 == ts3");
++
++ }
++
++ /*
++ * Validate that a Timestamp is equal to itself
++ */
++ @Test
++ public void test12() {
++ Timestamp ts1 = Timestamp.valueOf("1996-10-15 12:26:19.12");
++ assertTrue(ts1.equals(ts1), "Error ts1 != ts1");
++ }
++
++ /*
++ * Validate that two Timestamps are equal when one is created from the
++ * toString() of the other
++ */
++ @Test(dataProvider = "validTimestampValues")
++ public void test13(String ts, String expectedTS) {
++ Timestamp ts1 = Timestamp.valueOf(ts);
++ Timestamp ts2 = Timestamp.valueOf(ts1.toString());
++ assertTrue(ts1.equals(ts2) && ts2.equals(ts1)
++ && ts1.toString().equals(expectedTS), "Error ts1 != ts2");
++ }
++
++ // Before Tests
++ /*
++ * Validate that Timestamp ts1 is before Timestamp ts2
++ */
++ @Test
++ public void test14() {
++ Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
++ Timestamp ts2 = Timestamp.valueOf("1996-12-13 15:15:25.645634");
++ assertTrue(ts1.before(ts2), "Error ts1 not before ts2");
++ }
++
++ /*
++ * Validate that Timestamp ts1 is before Timestamp ts2
++ */
++ @Test
++ public void test15() {
++ Timestamp ts1 = Timestamp.valueOf("1961-08-30 14:15:25");
++ Timestamp ts2 = Timestamp.valueOf("1999-12-13 15:15:25");
++ assertTrue(ts1.before(ts2), "Error ts1 not before ts2");
++ }
++
++ /*
++ * Validate that Timestamp ts1 is before Timestamp ts2
++ */
++ @Test
++ public void test16() {
++
++ Timestamp ts1 = Timestamp.valueOf("1999-12-13 14:15:25.745634");
++ Timestamp ts2 = Timestamp.valueOf("1999-11-13 15:15:25.645634");
++ assertFalse(ts1.before(ts2), "Error ts1 before ts2");
++ }
++
++ /*
++ * Validate that a NullPointerException is thrown if a null is passed to
++ * the before method
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test17() throws Exception {
++ Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
++ ts1.before(null);
++ }
++
++ /*
++ * Validate a Timestamp cannot be before itself
++ */
++ @Test
++ public void test18() {
++ Timestamp ts1 = Timestamp.valueOf("1999-11-10 12:26:19.3456543");
++ assertFalse(ts1.before(ts1), "Error ts1 before ts1!");
++ }
++
++ /*
++ * Create 3 Timestamps and make sure the 1st is before the other two
++ * Timestamps which are each greater than the one before it
++ */
++ @Test
++ public void test19() {
++
++ Timestamp ts1 = new Timestamp(1234560000);
++ Timestamp ts2 = new Timestamp(1234567000);
++ Timestamp ts3 = new Timestamp(1234569000);
++ assertTrue(ts1.before(ts2) && ts2.before(ts3) && ts1.before(ts3));
++ }
++
++ /*
++ * Validate that Timestamp ts1 is not after Timestamp ts2
++ */
++ @Test
++ public void test20() {
++ Timestamp ts1 = Timestamp.valueOf("1999-12-13 14:15:25.745634");
++ Timestamp ts2 = Timestamp.valueOf("1999-12-13 15:15:25.645634");
++ assertFalse(ts1.after(ts2), "Error ts1 is after ts2");
++
++ }
++
++ /*
++ * Validate that Timestamp ts1 is after Timestamp ts2
++ */
++ @Test
++ public void test21() {
++ Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
++ Timestamp ts2 = Timestamp.valueOf("1996-11-13 15:15:25.645634");
++ assertTrue(ts1.after(ts2), "Error ts1 not after ts2");
++ }
++
++ /*
++ * Validate that a NullPointerException is thrown if a null is passed to the
++ * after method
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test22() throws Exception {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ ts1.after(null);
++ }
++
++ /*
++ * Validate that a Timestamp cannot be after itself
++ */
++ @Test
++ public void test23() {
++ Timestamp ts1 = Timestamp.valueOf("1999-11-10 12:26:19.3456543");
++ assertFalse(ts1.after(ts1), "Error ts1 is after itself");
++ }
++
++ /*
++ * Validate that a Timestamp after() works correctly with Timestamp created
++ * using milliseconds
++ */
++ @Test
++ public void test24() {
++
++ Timestamp ts1 = new Timestamp(1234568000);
++ Timestamp ts2 = new Timestamp(1234565000);
++ Timestamp ts3 = new Timestamp(1234562000);
++ assertTrue(ts1.after(ts2) && ts2.after(ts3) && ts1.after(ts3));
++ }
++
++ /*
++ * Validate compareTo returns 0 for Timestamps that are the same
++ */
++ @Test
++ public void test25() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ Timestamp ts2 = new Timestamp(ts1.getTime());
++ assertTrue(ts1.compareTo(ts2) == 0, "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate compareTo returns -1 for when the 1st Timestamp is earlier than
++ * the 2nd Timestamp
++ */
++ @Test
++ public void test26() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ Timestamp ts2 = new Timestamp(ts1.getTime() + 1000);
++ assertTrue(ts1.compareTo(ts2) == -1, "Error ts1 not before ts2");
++ assertTrue(ts2.compareTo(ts1) == 1, "Error ts1 is not before ts2");
++ }
++
++ /*
++ * Validate compareTo returns 1 for when the 1st Timestamp is later than the
++ * 2nd Timestamp
++ */
++ @Test
++ public void test27() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ Timestamp ts2 = new Timestamp(ts1.getTime() - 1000);
++ assertTrue(ts1.compareTo(ts2) == 1, "Error ts1 not after ts2");
++ assertTrue(ts2.compareTo(ts1) == -1, "Error ts1 not after ts2");
++ }
++
++ /*
++ * Validate compareTo returns 0 for Timestamps that are the same
++ */
++ @Test
++ public void test28() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ java.util.Date ts2 = new java.util.Date(ts1.getTime());
++ assertTrue(ts1.compareTo(ts2) == 0, "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate compareTo returns 0 for Timestamps that are the same
++ */
++ @Test
++ public void test29() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ java.util.Date d = new java.util.Date(ts1.getTime());
++ assertFalse(ts1.equals(d), "Error ts1 == d");
++ }
++
++ /*
++ * Validate compareTo returns 0 for Timestamps that are the same
++ */
++ @Test
++ public void test30() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ java.util.Date d = new Timestamp(ts1.getTime());
++ assertTrue(ts1.equals(d), "Error ts1 != d");
++ }
++
++ /*
++ * Validate equals returns false when a Date object is passed to equals
++ */
++ @Test
++ public void test31() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ Date d = new Date(ts1.getTime());
++ assertFalse(ts1.equals(d), "Error ts1 != d");
++ }
++
++ /*
++ * Validate equals returns false when a Date object is passed to equals
++ */
++ @Test
++ public void test32() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ java.util.Date d = new Date(ts1.getTime());
++ assertFalse(ts1.equals(d), "Error ts1 != d");
++ }
++
++ /*
++ * Validate equals returns false when a Time object is passed to equals
++ */
++ @Test
++ public void test33() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ Time t1 = new Time(ts1.getTime());
++ assertFalse(ts1.equals(t1), "Error ts1 == t1");
++ }
++
++ /*
++ * Validate equals returns false when a String object is passed to equals
++ */
++ @Test
++ public void test34() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ assertFalse(ts1.equals("1966-08-30 08:08:08"), "Error ts1 == a String");
++ }
++
++ /*
++ * Validate getTime() returns the same value from 2 timeStamps created by
++ */
++ @Test
++ public void test35() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ Timestamp ts2 = Timestamp.valueOf("1966-08-30 08:08:08");
++ assertTrue(ts2.getTime() == ts1.getTime(),
++ "ts1.getTime() != ts2.getTime()");
++ assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate getTime() returns the same value from 2 timeStamps when
++ * setTime() is used to specify the same value for both Timestamps
++ */
++ @Test
++ public void test36() {
++ Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
++ Timestamp ts2 = Timestamp.valueOf("1961-08-30 00:00:00");
++ ts2.setTime(ts1.getTime());
++ assertTrue(ts2.getTime() == ts1.getTime(),
++ "ts1.getTime() != ts2.getTime()");
++ assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for an invalid nanos value
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test38() throws Exception {
++ Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
++ ts1.setNanos(-1);
++
++ }
++
++ /*
++ * Validate an IllegalArgumentException is thrown for an invalid nanos value
++ */
++ @Test(expectedExceptions = IllegalArgumentException.class)
++ public void test39() throws Exception {
++ int nanos = 999999999;
++ Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
++ ts1.setNanos(nanos + 1);
++ }
++
++ /*
++ * Validate you can set nanos to 999999999
++ */
++ @Test
++ public void test40() throws Exception {
++ int nanos = 999999999;
++ Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
++ ts1.setNanos(nanos);
++ assertTrue(ts1.getNanos() == nanos, "Error Invalid Nanos value");
++ }
++
++ /*
++ * Validate you can set nanos to 0
++ */
++ @Test
++ public void test41() throws Exception {
++ int nanos = 0;
++ Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
++ ts1.setNanos(nanos);
++ assertTrue(ts1.getNanos() == nanos, "Error Invalid Nanos value");
++ }
++
++ /*
++ * Validate that a Timestamp made from a LocalDateTime are equal
++ */
++ @Test
++ public void test42() throws Exception {
++ Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
++ LocalDateTime ldt = ts1.toLocalDateTime();
++ Timestamp ts2 = Timestamp.valueOf(ldt);
++ assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that a Timestamp LocalDateTime value, made from a LocalDateTime
++ * are equal
++ */
++ @Test
++ public void test43() throws Exception {
++ LocalDateTime ldt = LocalDateTime.now();
++ Timestamp ts2 = Timestamp.valueOf(ldt);
++ assertTrue(ldt.equals(ts2.toLocalDateTime()),
++ "Error LocalDateTime values are not equal");
++ }
++
++ /*
++ * Validate an NPE occurs when a null LocalDateTime is passed to valueOF
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test44() throws Exception {
++ LocalDateTime ldt = null;
++ Timestamp.valueOf(ldt);
++ }
++
++ /*
++ * Validate that a Timestamp made from a Instant are equal
++ */
++ @Test
++ public void test45() throws Exception {
++ Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
++ Instant instant = ts1.toInstant();
++ Timestamp ts2 = Timestamp.from(instant);
++ assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
++ }
++
++ /*
++ * Validate that a Timestamp made from a Instant are equal
++ */
++ @Test
++ public void test46() throws Exception {
++ Instant instant = Instant.now();
++ Timestamp ts2 = Timestamp.from(instant);
++ assertTrue(instant.equals(ts2.toInstant()),
++ "Error Instant values do not match");
++ }
++
++ /*
++ * Validate an NPE occurs when a null instant is passed to from
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test47() throws Exception {
++ Instant instant = null;
++ Timestamp.from(instant);
++ }
++
++ // Added SQE tests
++ /*
++ * Create a Timestamp and a 2nd Timestamp that is 1 month earlier and
++ * validate that it is not before or after the original Timestamp
++ */
++ @Test
++ public void test48() {
++ Calendar cal = Calendar.getInstance();
++ Timestamp ts1 = new Timestamp(System.currentTimeMillis());
++ cal.setTimeInMillis(ts1.getTime());
++ cal.add(Calendar.MONTH, -1);
++ cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
++ Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
++ assertFalse(ts1.before(ts2) || ts2.after(ts1));
++ }
++
++ /*
++ * Create two Timestamps and validate that compareTo returns 1 to indicate
++ * the 1st Timestamp is greater than the 2nd Timestamp
++ */
++ @Test
++ public void test49() {
++ Calendar cal = Calendar.getInstance();
++ Timestamp ts1 = new Timestamp(System.currentTimeMillis());
++ cal.setTimeInMillis(ts1.getTime());
++ cal.add(Calendar.MONTH, -1);
++ cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
++ Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
++ assertTrue(ts1.compareTo(ts2) == 1);
++ }
++
++ /*
++ * Create two Timestamps and validate that the 1st Timestamp is not equal to
++ * the 2nd Timestamp but equal to itself
++ */
++ @Test
++ public void test50() {
++ Calendar cal = Calendar.getInstance();
++ Timestamp ts1 = new Timestamp(System.currentTimeMillis());
++ cal.setTimeInMillis(ts1.getTime());
++ cal.add(Calendar.MONTH, -1);
++ cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
++ Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
++ assertTrue(!ts1.equals(ts2) && ts1.equals(ts1));
++ }
++
++ /*
++ * Validate that two Timestamps are equal when one is created from the
++ * toString() of the other
++ */
++ @Test(dataProvider = "validateNanos")
++ public void test51(String ts, int nanos) {
++ Timestamp ts1 = Timestamp.valueOf(ts);
++ Timestamp ts2 = Timestamp.valueOf(ts1.toString());
++ assertTrue(ts1.getNanos() == nanos && ts1.equals(ts2),
++ "Error with Nanos");
++ }
++
++ @Test(dataProvider = "validTimestampLongValues")
++ public void test52(long value, String ts) {
++ Timestamp ts1 = new Timestamp(value);
++ assertEquals(ts1.toString(), ts, "ts1.toString() != ts");
++ }
++
++ /*
++ * DataProvider used to provide Timestamps which are not valid and are used
++ * to validate that an IllegalArgumentException will be thrown from the
++ * valueOf method
++ */
++ @DataProvider(name = "invalidTimestampValues")
++ private Object[][] invalidTimestampValues() {
++ return new Object[][]{
++ {"2009-11-01-01 10:50:01"},
++ {"aaaa-11-01-01 10:50"},
++ {"aaaa-11-01 10:50"},
++ {"1961--30 00:00:00"},
++ {"--30 00:00:00"},
++ {"-- 00:00:00"},
++ {"1961-1- 00:00:00"},
++ {"2009-11-01"},
++ {"10:50:01"},
++ {"1961-a-30 00:00:00"},
++ {"1961-01-bb 00:00:00"},
++ {"1961-08-30 00:00:00."},
++ {"1961-08-30 :00:00"},
++ {"1961-08-30 00::00"},
++ {"1961-08-30 00:00:"},
++ {"1961-08-30 ::"},
++ {"1961-08-30 0a:00:00"},
++ {"1961-08-30 00:bb:00"},
++ {"1961-08-30 00:01:cc"},
++ {"1961-08-30 00:00:00.01a"},
++ {"1961-08-30 00:00:00.a"},
++ {"1996-12-10 12:26:19.1234567890"},
++ {null}
++ };
++ }
++
++ /*
++ * DataProvider used to provide Timestamps which are valid and are used
++ * to validate that an IllegalArgumentException will not be thrown from the
++ * valueOf method and the corect value from toString() is returned
++ */
++ @DataProvider(name = "validTimestampValues")
++ private Object[][] validTimestampValues() {
++ return new Object[][]{
++ {"1961-08-30 00:00:00", "1961-08-30 00:00:00.0"},
++ {"1961-08-30 11:22:33", "1961-08-30 11:22:33.0"},
++ {"1961-8-30 00:00:00", "1961-08-30 00:00:00.0"},
++ {"1966-08-1 00:00:00", "1966-08-01 00:00:00.0"},
++ {"1996-12-10 12:26:19.1", "1996-12-10 12:26:19.1"},
++ {"1996-12-10 12:26:19.12", "1996-12-10 12:26:19.12"},
++ {"1996-12-10 12:26:19.123", "1996-12-10 12:26:19.123"},
++ {"1996-12-10 12:26:19.1234", "1996-12-10 12:26:19.1234"},
++ {"1996-12-10 12:26:19.12345", "1996-12-10 12:26:19.12345"},
++ {"1996-12-10 12:26:19.123456", "1996-12-10 12:26:19.123456"},
++ {"1996-12-10 12:26:19.1234567", "1996-12-10 12:26:19.1234567"},
++ {"1996-12-10 12:26:19.12345678", "1996-12-10 12:26:19.12345678"},
++ {"1996-12-10 12:26:19.123456789", "1996-12-10 12:26:19.123456789"},
++ {"1996-12-10 12:26:19.000000001", "1996-12-10 12:26:19.000000001"},
++ {"1996-12-10 12:26:19.000000012", "1996-12-10 12:26:19.000000012"},
++ {"1996-12-10 12:26:19.000000123", "1996-12-10 12:26:19.000000123"},
++ {"1996-12-10 12:26:19.000001234", "1996-12-10 12:26:19.000001234"},
++ {"1996-12-10 12:26:19.000012345", "1996-12-10 12:26:19.000012345"},
++ {"1996-12-10 12:26:19.000123456", "1996-12-10 12:26:19.000123456"},
++ {"1996-12-10 12:26:19.001234567", "1996-12-10 12:26:19.001234567"},
++ {"1996-12-10 12:26:19.12345678", "1996-12-10 12:26:19.12345678"},
++ {"1996-12-10 12:26:19.0", "1996-12-10 12:26:19.0"},
++ {"1996-12-10 12:26:19.01230", "1996-12-10 12:26:19.0123"}
++ };
++ }
++
++ @DataProvider(name = "validTimestampLongValues")
++ private Object[][] validTimestampLongValues() {
++ return new Object[][]{
++ {1L, "1970-01-01 01:00:00.001"},
++ {-3600*1000L - 1, "1969-12-31 23:59:59.999"},
++ {-(20000L*365*24*60*60*1000), "18018-08-28 01:00:00.0"},
++ {Timestamp.valueOf("1961-08-30 11:22:33").getTime(), "1961-08-30 11:22:33.0"},
++ {Timestamp.valueOf("1961-08-30 11:22:33.54321000").getTime(), "1961-08-30 11:22:33.543"}, // nanoprecision lost
++ {new Timestamp(114, 10, 10, 10, 10, 10, 100000000).getTime(), "2014-11-10 10:10:10.1"},
++ {new Timestamp(0, 10, 10, 10, 10, 10, 100000).getTime(), "1900-11-10 10:10:10.0"}, // nanoprecision lost
++ {new Date(114, 10, 10).getTime(), "2014-11-10 00:00:00.0"},
++ {new Date(0, 10, 10).getTime(), "1900-11-10 00:00:00.0"},
++ {LocalDateTime.of(1960, 10, 10, 10, 10, 10, 50000).atZone(ZoneId.of("America/Los_Angeles"))
++ .toInstant().toEpochMilli(), "1960-10-10 19:10:10.0"},
++
++ // millisecond timestamps wraps around at year 1, so Long.MIN_VALUE looks similar
++ // Long.MAX_VALUE, while actually representing 292278994 BCE
++ {Long.MIN_VALUE, "292278994-08-17 08:12:55.192"},
++ {Long.MAX_VALUE + 1, "292278994-08-17 08:12:55.192"},
++ {Long.MAX_VALUE, "292278994-08-17 08:12:55.807"},
++ {Long.MIN_VALUE - 1, "292278994-08-17 08:12:55.807"},
++
++ // wrap around point near 0001-01-01, test that we never get a negative year:
++ {-(1970L*365*24*60*60*1000), "0001-04-25 01:00:00.0"},
++ {-(1970L*365*24*60*60*1000 + 115*24*60*60*1000L), "0001-12-31 01:00:00.0"},
++ {-(1970L*365*24*60*60*1000 + 115*24*60*60*1000L - 23*60*60*1000L), "0001-01-01 00:00:00.0"},
++
++ {LocalDateTime.of(0, 1, 1, 10, 10, 10, 50000).atZone(ZoneId.of("America/Los_Angeles"))
++ .toInstant().toEpochMilli() - 2*24*60*60*1000L, "0001-01-01 19:03:08.0"}, // 1 BCE
++ {LocalDateTime.of(0, 1, 1, 10, 10, 10, 50000).atZone(ZoneId.of("America/Los_Angeles"))
++ .toInstant().toEpochMilli() - 3*24*60*60*1000L, "0002-12-31 19:03:08.0"} // 2 BCE
++ };
++ }
++
++ /*
++ * DataProvider used to provide Timestamp and Nanos values in order to
++ * validate that the correct Nanos value is generated from the specified
++ * Timestamp
++ */
++ @DataProvider(name = "validateNanos")
++ private Object[][] validateNanos() {
++ return new Object[][]{
++ {"1961-08-30 00:00:00", 0},
++ {"1996-12-10 12:26:19.1", 100000000},
++ {"1996-12-10 12:26:19.12", 120000000},
++ {"1996-12-10 12:26:19.123", 123000000},
++ {"1996-12-10 12:26:19.1234", 123400000},
++ {"1996-12-10 12:26:19.12345", 123450000},
++ {"1996-12-10 12:26:19.123456", 123456000},
++ {"1996-12-10 12:26:19.1234567", 123456700},
++ {"1996-12-10 12:26:19.12345678", 123456780},
++ {"1996-12-10 12:26:19.123456789", 123456789},
++ {"1996-12-10 12:26:19.000000001", 1},
++ {"1996-12-10 12:26:19.000000012", 12},
++ {"1996-12-10 12:26:19.000000123", 123},
++ {"1996-12-10 12:26:19.000001234", 1234},
++ {"1996-12-10 12:26:19.000012345", 12345},
++ {"1996-12-10 12:26:19.000123456", 123456},
++ {"1996-12-10 12:26:19.001234567", 1234567},
++ {"1996-12-10 12:26:19.012345678", 12345678},
++ {"1996-12-10 12:26:19.0", 0},
++ {"1996-12-10 12:26:19.01230", 12300000}
++ };
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/util/BaseTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,126 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.ByteArrayInputStream;
++import java.io.ByteArrayOutputStream;
++import java.io.IOException;
++import java.io.ObjectInputStream;
++import java.io.ObjectOutputStream;
++import java.security.Policy;
++import java.sql.JDBCType;
++import java.sql.SQLException;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.AfterMethod;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.DataProvider;
++
++public class BaseTest {
++
++ protected final String reason = "reason";
++ protected final String state = "SQLState";
++ protected final String cause = "java.lang.Throwable: cause";
++ protected final Throwable t = new Throwable("cause");
++ protected final Throwable t1 = new Throwable("cause 1");
++ protected final Throwable t2 = new Throwable("cause 2");
++ protected final int errorCode = 21;
++ protected final String[] msgs = {"Exception 1", "cause 1", "Exception 2",
++ "Exception 3", "cause 2"};
++
++ @BeforeClass
++ public static void setUpClass() throws Exception {
++ }
++
++ @AfterClass
++ public static void tearDownClass() throws Exception {
++ }
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ }
++
++ @AfterMethod
++ public void tearDownMethod() throws Exception {
++ }
++
++ /*
++ * Take some form of SQLException, serialize and deserialize it
++ */
++ @SuppressWarnings("unchecked")
++ protected <T extends SQLException> T
++ createSerializedException(T ex)
++ throws IOException, ClassNotFoundException {
++ return (T) serializeDeserializeObject(ex);
++ }
++
++ /*
++ * Utility method to serialize and deserialize an object
++ */
++ @SuppressWarnings("unchecked")
++ protected <T> T serializeDeserializeObject(T o)
++ throws IOException, ClassNotFoundException {
++ T o1;
++ ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
++ oos.writeObject(o);
++ }
++ try (ObjectInputStream ois
++ = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
++ o1 = (T) ois.readObject();
++ }
++ return o1;
++ }
++
++ /*
++ * Utility Method used to set the current Policy
++ */
++ protected static void setPolicy(Policy p) {
++ Policy.setPolicy(p);
++ }
++
++ /*
++ * DataProvider used to specify the value to set and check for
++ * methods using boolean values
++ */
++ @DataProvider(name = "trueFalse")
++ protected Object[][] trueFalse() {
++ return new Object[][]{
++ {true},
++ {false}
++ };
++ }
++
++ /*
++ * DataProvider used to specify the standard JDBC Types
++ */
++ @DataProvider(name = "jdbcTypes")
++ protected Object[][] jdbcTypes() {
++ Object[][] o = new Object[JDBCType.values().length][1];
++ int pos = 0;
++ for (JDBCType c : JDBCType.values()) {
++ o[pos++][0] = c.getVendorTypeNumber();
++ }
++ return o;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/util/DriverActionImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,43 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.sql.DriverAction;
++
++/**
++ * Simple implementation of DriverAction which calls back into the Driver when
++ * release is called.
++ */
++class DriverActionImpl implements DriverAction {
++
++ public DriverActionImpl(StubDriverDA d) {
++ driver = d;
++ }
++
++ private final StubDriverDA driver;
++
++ @Override
++ public void deregister() {
++ driver.release();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/util/SerializedBatchUpdateException.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,65 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++public class SerializedBatchUpdateException {
++ /**
++ * Serialized BatchUpdateException from JDBC 4.0 with the following values
++ * reason = "This was the error msg"
++ * SQLState = "user defined sqlState"
++ * vendor Code = 99999
++ * Update Counts = {1, 2, 21}
++ * cause = = "java.lang.Throwable: throw 1"
++ */
++ public static byte[] DATA = {
++ (byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1d, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x2e, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x55, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65,
++ (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x52, (byte) 0xf4, (byte) 0x73, (byte) 0xc0, (byte) 0xc1, (byte) 0x8b, (byte) 0xe, (byte) 0x5d, (byte) 0x3, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x0, (byte) 0x10, (byte) 0x6c, (byte) 0x6f, (byte) 0x6e, (byte) 0x67, (byte) 0x55, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x43, (byte) 0x6f, (byte) 0x75,
++ (byte) 0x6e, (byte) 0x74, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x4a, (byte) 0x5b, (byte) 0x0, (byte) 0xc, (byte) 0x75, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x43, (byte) 0x6f, (byte) 0x75, (byte) 0x6e, (byte) 0x74, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x49, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x15,
++ (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x2e, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x1d, (byte) 0xa1, (byte) 0xe9, (byte) 0x30, (byte) 0xdb, (byte) 0x3e, (byte) 0x75, (byte) 0xdc, (byte) 0x2, (byte) 0x0, (byte) 0x3,
++ (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x76, (byte) 0x65, (byte) 0x6e, (byte) 0x64, (byte) 0x6f, (byte) 0x72, (byte) 0x43, (byte) 0x6f, (byte) 0x64, (byte) 0x65, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
++ (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x4, (byte) 0x6e, (byte) 0x65, (byte) 0x78, (byte) 0x74, (byte) 0x74, (byte) 0x0, (byte) 0x17, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x73, (byte) 0x71, (byte) 0x6c,
++ (byte) 0x2f, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x3b, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65,
++ (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xd0, (byte) 0xfd, (byte) 0x1f, (byte) 0x3e, (byte) 0x1a, (byte) 0x3b, (byte) 0x1c, (byte) 0xc4, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x54, (byte) 0x68,
++ (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0xd5, (byte) 0xc6, (byte) 0x35, (byte) 0x27, (byte) 0x39, (byte) 0x77, (byte) 0xb8, (byte) 0xcb, (byte) 0x3, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x5, (byte) 0x63, (byte) 0x61, (byte) 0x75, (byte) 0x73, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x4c, (byte) 0x6a, (byte) 0x61,
++ (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x54, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0xd, (byte) 0x64, (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x4d, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x61,
++ (byte) 0x67, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x5b, (byte) 0x0, (byte) 0xa, (byte) 0x73, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61,
++ (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x75, (byte) 0x70, (byte) 0x70, (byte) 0x72, (byte) 0x65, (byte) 0x73, (byte) 0x73,
++ (byte) 0x65, (byte) 0x64, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x3b, (byte) 0x78,
++ (byte) 0x70, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x7, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xc, (byte) 0x74, (byte) 0x0, (byte) 0x7, (byte) 0x74, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x20, (byte) 0x31, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
++ (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x2, (byte) 0x46, (byte) 0x2a, (byte) 0x3c, (byte) 0x3c, (byte) 0xfd, (byte) 0x22, (byte) 0x39,
++ (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1b, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63,
++ (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x61, (byte) 0x9, (byte) 0xc5, (byte) 0x9a, (byte) 0x26, (byte) 0x36, (byte) 0xdd, (byte) 0x85, (byte) 0x2, (byte) 0x0, (byte) 0x4, (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x6c, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72,
++ (byte) 0x4c, (byte) 0x0, (byte) 0xe, (byte) 0x64, (byte) 0x65, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x43, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x66, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x4e, (byte) 0x61, (byte) 0x6d,
++ (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0xa, (byte) 0x6d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x23, (byte) 0x74, (byte) 0x0,
++ (byte) 0x17, (byte) 0x43, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x74, (byte) 0x0, (byte) 0x1c, (byte) 0x43, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x74,
++ (byte) 0x65, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x74, (byte) 0x0, (byte) 0x9, (byte) 0x77, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x54,
++ (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1a, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x74, (byte) 0x0, (byte) 0x4, (byte) 0x6d, (byte) 0x61, (byte) 0x69, (byte) 0x6e, (byte) 0x70, (byte) 0x78,
++ (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x54, (byte) 0x68, (byte) 0x69, (byte) 0x73, (byte) 0x20, (byte) 0x77, (byte) 0x61, (byte) 0x73, (byte) 0x20, (byte) 0x74, (byte) 0x68, (byte) 0x65, (byte) 0x20, (byte) 0x65, (byte) 0x72, (byte) 0x72, (byte) 0x6f, (byte) 0x72, (byte) 0x20, (byte) 0x6d, (byte) 0x73, (byte) 0x67, (byte) 0x75, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xe, (byte) 0x0,
++ (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x28, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e,
++ (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1a, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x16, (byte) 0x70, (byte) 0x78, (byte) 0x0, (byte) 0x1, (byte) 0x86, (byte) 0x9f, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x75, (byte) 0x73,
++ (byte) 0x65, (byte) 0x72, (byte) 0x20, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x64, (byte) 0x20, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x70, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x4a, (byte) 0x78, (byte) 0x20, (byte) 0x4, (byte) 0xb5, (byte) 0x12, (byte) 0xb1,
++ (byte) 0x75, (byte) 0x93, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0,
++ (byte) 0x0, (byte) 0x0, (byte) 0x15, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x49, (byte) 0x4d, (byte) 0xba, (byte) 0x60, (byte) 0x26, (byte) 0x76, (byte) 0xea, (byte) 0xb2, (byte) 0xa5, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0,
++ (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x15, (byte) 0x78
++ };
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/util/StubConnection.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,315 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.CallableStatement;
++import java.sql.Clob;
++import java.sql.Connection;
++import java.sql.DatabaseMetaData;
++import java.sql.NClob;
++import java.sql.PreparedStatement;
++import java.sql.SQLClientInfoException;
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import java.sql.SQLXML;
++import java.sql.Savepoint;
++import java.sql.Statement;
++import java.sql.Struct;
++import java.util.Map;
++import java.util.Properties;
++import java.util.concurrent.Executor;
++
++public class StubConnection implements Connection {
++
++ @Override
++ public Statement createStatement() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public PreparedStatement prepareStatement(String sql) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CallableStatement prepareCall(String sql) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String nativeSQL(String sql) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAutoCommit(boolean autoCommit) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getAutoCommit() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void commit() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void close() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isClosed() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public DatabaseMetaData getMetaData() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setReadOnly(boolean readOnly) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isReadOnly() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCatalog(String catalog) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCatalog() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTransactionIsolation(int level) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getTransactionIsolation() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLWarning getWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Map<String, Class<?>> getTypeMap() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setHoldability(int holdability) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getHoldability() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Savepoint setSavepoint() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Savepoint setSavepoint(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback(Savepoint savepoint) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void releaseSavepoint(Savepoint savepoint) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob createClob() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob createBlob() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob createNClob() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML createSQLXML() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isValid(int timeout) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClientInfo(String name, String value) throws SQLClientInfoException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClientInfo(Properties properties) throws SQLClientInfoException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getClientInfo(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Properties getClientInfo() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSchema(String schema) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getSchema() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void abort(Executor executor) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getNetworkTimeout() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/util/StubDriver.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,75 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.sql.Connection;
++import java.sql.Driver;
++import java.sql.DriverPropertyInfo;
++import java.sql.SQLException;
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.Properties;
++import java.util.logging.Logger;
++
++public class StubDriver implements Driver {
++
++ public StubDriver() {
++ }
++
++ @Override
++ public Connection connect(String url, Properties info) throws SQLException {
++ if (acceptsURL(url)) {
++ return new StubConnection();
++ }
++ return null;
++ }
++
++ @Override
++ public boolean acceptsURL(String url) throws SQLException {
++ return url.matches("^jdbc:tennis:.*");
++ }
++
++ @Override
++ public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMajorVersion() {
++ return 1;
++ }
++
++ @Override
++ public int getMinorVersion() {
++ return 0;
++ }
++
++ @Override
++ public boolean jdbcCompliant() {
++ return true;
++ }
++
++ @Override
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/util/StubDriverDA.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,75 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.File;
++import java.io.IOException;
++import java.sql.DriverAction;
++import java.sql.DriverManager;
++import java.sql.SQLException;
++import java.util.logging.Level;
++import java.util.logging.Logger;
++
++/**
++ * Simple java.sql.Driver stub class that registers the driver via a static
++ * block with a DriverAction Implementation
++ * @author ljanders
++ */
++public class StubDriverDA extends StubDriver {
++
++ public static final String DriverActionCalled = "DriverActionCalled.txt";
++
++ static DriverAction da;
++
++ static {
++ try {
++ DriverManager.registerDriver(new StubDriverDA(), da);
++ } catch (SQLException ex) {
++ Logger.getLogger(StubDriverDA.class.getName()).log(Level.SEVERE, null, ex);
++ }
++ }
++
++ public StubDriverDA() {
++ da = new DriverActionImpl(this);
++ }
++
++ @Override
++ public boolean acceptsURL(String url) throws SQLException {
++ return url.matches("^jdbc:luckydog:.*");
++ }
++
++ /**
++ * This method will write out a text file when called by the
++ * DriverActionImpl.release method when DriverManager.deregisterDriver
++ * is called. This is used by DriverManagerTests to validate that
++ * DriverAction.release was called
++ */
++ protected void release() {
++ File file = new File(DriverActionCalled);
++ try {
++ file.createNewFile();
++ } catch (IOException ex) {
++ throw new RuntimeException(ex);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/sql/testng/util/TestPolicy.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,142 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.FilePermission;
++import java.security.AllPermission;
++import java.security.CodeSource;
++import java.security.Permission;
++import java.security.PermissionCollection;
++import java.security.Permissions;
++import java.security.Policy;
++import java.security.ProtectionDomain;
++import java.security.SecurityPermission;
++import java.sql.SQLPermission;
++import java.util.Enumeration;
++import java.util.PropertyPermission;
++import java.util.StringJoiner;
++import java.util.logging.LoggingPermission;
++
++/*
++ * Simple Policy class that supports the required Permissions to validate the
++ * JDBC concrete classes
++ */
++public class TestPolicy extends Policy {
++
++ final PermissionCollection permissions = new Permissions();
++
++ /**
++ * Constructor which sets the minimum permissions allowing testNG to work
++ * with a SecurityManager
++ */
++ public TestPolicy() {
++ setMinimalPermissions();
++ }
++
++ /*
++ * Constructor which determines which permissions are defined for this
++ * Policy used by the JDBC tests Possible values are: all (ALLPermissions),
++ * setLog (SQLPemission("setLog"), deregisterDriver
++ * (SQLPermission("deregisterDriver") (SQLPermission("deregisterDriver"),
++ * setSyncFactory(SQLPermission(setSyncFactory), and also
++ * LoggerPermission("control", null) when setting a Level
++ *
++ * @param policy Permissions to set
++ */
++ public TestPolicy(String policy) {
++
++ switch (policy) {
++ case "all":
++ permissions.add(new AllPermission());
++ break;
++ case "setLog":
++ setMinimalPermissions();
++ permissions.add(new SQLPermission("setLog"));
++ break;
++ case "deregisterDriver":
++ setMinimalPermissions();
++ permissions.add(new SQLPermission("deregisterDriver"));
++ break;
++ case "setSyncFactory":
++ setMinimalPermissions();
++ permissions.add(new SQLPermission("setSyncFactory"));
++ break;
++ case "setSyncFactoryLogger":
++ setMinimalPermissions();
++ permissions.add(new SQLPermission("setSyncFactory"));
++ permissions.add(new LoggingPermission("control", null));
++ break;
++ default:
++ setMinimalPermissions();
++ }
++ }
++
++ /*
++ * Defines the minimal permissions required by testNG when running these
++ * tests
++ */
++ private void setMinimalPermissions() {
++ permissions.add(new SecurityPermission("getPolicy"));
++ permissions.add(new SecurityPermission("setPolicy"));
++ permissions.add(new RuntimePermission("getClassLoader"));
++ permissions.add(new RuntimePermission("setSecurityManager"));
++ permissions.add(new RuntimePermission("createSecurityManager"));
++ permissions.add(new PropertyPermission("testng.show.stack.frames",
++ "read"));
++ permissions.add(new PropertyPermission("line.separator", "read"));
++ permissions.add(new PropertyPermission("fileStringBuffer", "read"));
++ permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
++ permissions.add(new PropertyPermission("java.io.tmpdir", "read"));
++ permissions.add(new FilePermission("<<ALL FILES>>",
++ "read, write, delete"));
++ }
++
++ /*
++ * Overloaded methods from the Policy class
++ */
++ @Override
++ public String toString() {
++ StringJoiner sj = new StringJoiner("\n", "policy: ", "");
++ Enumeration<Permission> perms = permissions.elements();
++ while (perms.hasMoreElements()) {
++ sj.add(perms.nextElement().toString());
++ }
++ return sj.toString();
++
++ }
++
++ @Override
++ public PermissionCollection getPermissions(ProtectionDomain domain) {
++ return permissions;
++ }
++
++ @Override
++ public PermissionCollection getPermissions(CodeSource codesource) {
++ return permissions;
++ }
++
++ @Override
++ public boolean implies(ProtectionDomain domain, Permission perm) {
++ return permissions.implies(perm);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/text/Format/DateFormat/LocaleDateFormats.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,63 @@
++/*
++ * 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 8080774
++ * @run testng/othervm -Djava.locale.providers=JRE,CLDR LocaleDateFormats
++ * @summary This file contains tests for JRE locales date formats
++ */
++
++import java.text.DateFormat;
++import java.util.Calendar;
++import java.util.Locale;
++import static org.testng.Assert.assertEquals;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++
++public class LocaleDateFormats {
++
++ @Test(dataProvider = "dateFormats")
++ public void testDateFormat(Locale loc, int style, int year, int month, int date, String expectedString) {
++ Calendar cal = Calendar.getInstance(loc);
++ cal.set(year, month-1, date);
++ // Create date formatter based on requested style and test locale
++ DateFormat df = DateFormat.getDateInstance(style, loc);
++ // Test the date format
++ assertEquals(df.format(cal.getTime()), expectedString);
++ }
++
++ @DataProvider(name = "dateFormats" )
++ private Object[][] dateFormats() {
++ return new Object[][] {
++ //8080774
++ //Locale, Format type, year, month, date, expected result
++ {localeEnSG, DateFormat.SHORT, 2015, 5, 6, "6/5/15"},
++ {localeEnSG, DateFormat.MEDIUM, 2015, 5, 6, "6 May, 2015"},
++ {localeEnSG, DateFormat.LONG, 2015, 5, 6, "6 May, 2015"},
++ {localeEnSG, DateFormat.FULL, 2015, 5, 6, "Wednesday, 6 May, 2015"}
++ };
++ }
++ // en_SG Locale instance
++ private static final Locale localeEnSG = new Locale("en", "SG");
++}
+--- ./jdk/test/java/time/TEST.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/time/TEST.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,3 +1,4 @@
+ # Threeten test uses TestNG
+ TestNG.dirs = .
+ othervm.dirs = tck/java/time/chrono test/java/time/chrono test/java/time/format
++lib.dirs = ../../lib/testlibrary
+--- ./jdk/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -42,10 +42,17 @@
+ import java.util.Random;
+ import java.util.Set;
+ import java.util.TimeZone;
++import jdk.testlibrary.RandomFactory;
+
+ import org.testng.annotations.DataProvider;
+ import org.testng.annotations.Test;
+
++/*
++ * @test
++ * @bug 8081022
++ * @key randomness
++ */
++
+ /**
+ * Test ZoneTextPrinterParser
+ */
+@@ -59,8 +66,8 @@
+ }
+
+ public void test_printText() {
+- Random r = new Random();
+- int N = 50;
++ Random r = RandomFactory.getRandom();
++ int N = 8;
+ Locale[] locales = Locale.getAvailableLocales();
+ Set<String> zids = ZoneRulesProvider.getAvailableZoneIds();
+ ZonedDateTime zdt = ZonedDateTime.now();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/util/Arrays/TimSortStackSize2.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,174 @@
++/*
++ * 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 8072909
++ * @run main/othervm -Xms385m TimSortStackSize2 67108864
++ * @summary Test TimSort stack size on big arrays
++ * big tests not for regular execution on all platforms:
++ * run main/othervm -Xmx8g TimSortStackSize2 1073741824
++ * run main/othervm -Xmx16g TimSortStackSize2 2147483644
++ */
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Comparator;
++import java.util.List;
++import java.util.function.Consumer;
++
++public class TimSortStackSize2 {
++
++ public static void main(String[] args) {
++ int lengthOfTest = Integer.parseInt(args[0]);
++ boolean passed = doTest("TimSort", lengthOfTest,
++ (Integer [] a) -> Arrays.sort(a));
++ passed = doTest("ComparableTimSort", lengthOfTest, (Integer [] a) ->
++ Arrays.sort(a, (Object first, Object second) -> {
++ return ((Comparable<Object>)first).compareTo(second);
++ }))
++ && passed;
++ if ( !passed ){
++ throw new RuntimeException();
++ }
++ }
++
++ private static boolean doTest(final String msg, final int lengthOfTest,
++ final Consumer<Integer[]> c){
++ Integer [] a = null;
++ try {
++ a = new TimSortStackSize2(lengthOfTest).createArray();
++ long begin = System.nanoTime();
++ c.accept(a);
++ long end = System.nanoTime();
++ System.out.println(msg + " OK. Time: " + (end - begin) + "ns");
++ } catch (ArrayIndexOutOfBoundsException e){
++ System.out.println(msg + " broken:");
++ e.printStackTrace();
++ return false;
++ } finally {
++ a = null;
++ }
++ return true;
++ }
++
++ private static final int MIN_MERGE = 32;
++ private final int minRun;
++ private final int length;
++ private final List<Long> runs = new ArrayList<Long>();
++
++ public TimSortStackSize2(final int len) {
++ this.length = len;
++ minRun = minRunLength(len);
++ fillRunsJDKWorstCase();
++ }
++
++ private static int minRunLength(int n) {
++ assert n >= 0;
++ int r = 0; // Becomes 1 if any 1 bits are shifted off
++ while (n >= MIN_MERGE) {
++ r |= (n & 1);
++ n >>= 1;
++ }
++ return n + r;
++ }
++
++ /**
++ * Adds a sequence x_1, ..., x_n of run lengths to <code>runs</code> such that:<br>
++ * 1. X = x_1 + ... + x_n <br>
++ * 2. x_j >= minRun for all j <br>
++ * 3. x_1 + ... + x_{j-2} < x_j < x_1 + ... + x_{j-1} for all j <br>
++ * These conditions guarantee that TimSort merges all x_j's one by one
++ * (resulting in X) using only merges on the second-to-last element.
++ * @param X The sum of the sequence that should be added to runs.
++ */
++ private void generateJDKWrongElem(long X) {
++ for(long newTotal; X >= 2 * minRun + 1; X = newTotal) {
++ //Default strategy
++ newTotal = X / 2 + 1;
++ //Specialized strategies
++ if(3 * minRun + 3 <= X && X <= 4*minRun+1) {
++ // add x_1=MIN+1, x_2=MIN, x_3=X-newTotal to runs
++ newTotal = 2 * minRun + 1;
++ } else if (5 * minRun + 5 <= X && X <= 6 * minRun + 5) {
++ // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=X-newTotal to runs
++ newTotal = 3 * minRun + 3;
++ } else if (8 * minRun + 9 <= X && X <= 10 * minRun + 9) {
++ // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=2MIN+2, x_5=X-newTotal to runs
++ newTotal = 5 * minRun + 5;
++ } else if (13 * minRun + 15 <= X && X <= 16 * minRun + 17) {
++ // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=2MIN+2, x_5=3MIN+4, x_6=X-newTotal to runs
++ newTotal = 8 * minRun + 9;
++ }
++ runs.add(0, X - newTotal);
++ }
++ runs.add(0, X);
++ }
++
++ /**
++ * Fills <code>runs</code> with a sequence of run lengths of the form<br>
++ * Y_n x_{n,1} x_{n,2} ... x_{n,l_n} <br>
++ * Y_{n-1} x_{n-1,1} x_{n-1,2} ... x_{n-1,l_{n-1}} <br>
++ * ... <br>
++ * Y_1 x_{1,1} x_{1,2} ... x_{1,l_1}<br>
++ * The Y_i's are chosen to satisfy the invariant throughout execution,
++ * but the x_{i,j}'s are merged (by <code>TimSort.mergeCollapse</code>)
++ * into an X_i that violates the invariant.
++ * X is the sum of all run lengths that will be added to <code>runs</code>.
++ */
++ private void fillRunsJDKWorstCase() {
++ long runningTotal = 0;
++ long Y = minRun + 4;
++ long X = minRun;
++
++ while (runningTotal + Y + X <= length) {
++ runningTotal += X + Y;
++ generateJDKWrongElem(X);
++ runs.add(0, Y);
++
++ // X_{i+1} = Y_i + x_{i,1} + 1, since runs.get(1) = x_{i,1}
++ X = Y + runs.get(1) + 1;
++
++ // Y_{i+1} = X_{i+1} + Y_i + 1
++ Y += X + 1;
++ }
++
++ if (runningTotal + X <= length) {
++ runningTotal += X;
++ generateJDKWrongElem(X);
++ }
++
++ runs.add(length - runningTotal);
++ }
++
++ private Integer [] createArray() {
++ Integer [] a = new Integer[length];
++ Arrays.fill(a, 0);
++ int endRun = -1;
++ for (long len : runs) {
++ a[endRun += len] = 1;
++ }
++ a[length - 1] = 0;
++ return a;
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/util/Calendar/Bug8075548.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,108 @@
++/*
++ * 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 8075548
++ * @summary Make sure that the format form of month names are produced when there are
++ * no stand-alone ones available.
++ */
++
++import java.text.*;
++import java.util.*;
++import static java.util.Calendar.*;
++
++public class Bug8075548 {
++ static int errors = 0;
++
++ public static void main(String[] args) throws Throwable {
++ Date date = new SimpleDateFormat("yyyy-MM-dd", Locale.US).parse("2010-09-15");
++ String[][] FORMAT_PAIRS = {
++ { "LLLL", "MMMM" },
++ { "LLL", "MMM" }
++ };
++ Locale[] LOCALES = {
++ Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN, Locale.JAPANESE
++ };
++
++ for (Locale locale : LOCALES) {
++ for (String[] formats : FORMAT_PAIRS) {
++ String el = new SimpleDateFormat(formats[0], locale).format(date);
++ String em = new SimpleDateFormat(formats[1], locale).format(date);
++ if (!el.equals(em)) {
++ errors++;
++ System.err.println(locale + ": " +
++ formats[0] + " -> " + el + ", " +
++ formats[1] + " -> " + em);
++ }
++ }
++ }
++
++ // Test Calendar.getDisplayName() and .getDisplayNames().
++ for (Locale locale : LOCALES) {
++ testDisplayNames(locale, LONG_FORMAT, LONG_STANDALONE);
++ testDisplayNames(locale, SHORT_FORMAT, SHORT_STANDALONE);
++ testDisplayNames(locale, NARROW_FORMAT, NARROW_STANDALONE);
++ }
++
++ if (errors > 0) {
++ throw new RuntimeException("Failed");
++ }
++ }
++
++ private static void testDisplayNames(Locale locale, int formatStyle, int standaloneStyle) {
++ Map<String, Integer> map = new HashMap<>();
++ for (int month = JANUARY; month <= DECEMBER; month++) {
++ Calendar cal = new GregorianCalendar(2015, month, 1);
++ String format = cal.getDisplayName(MONTH, formatStyle, locale);
++ String standalone = cal.getDisplayName(MONTH, standaloneStyle, locale);
++ if (!format.equals(standalone)) {
++ System.err.println("Calendar.getDisplayName: " + (month+1) +
++ ", locale=" + locale +
++ ", format=" + format + ", standalone=" + standalone);
++ errors++;
++ }
++ if (standalone != null) {
++ map.put(standalone, month);
++ }
++ }
++ if (formatStyle == NARROW_FORMAT) {
++ // Narrow styles don't support unique names.
++ // (e.g., "J" for JANUARY, JUNE, and JULY)
++ return;
++ }
++ Calendar cal = new GregorianCalendar(2015, JANUARY, 1);
++ Map<String, Integer> mapStandalone = cal.getDisplayNames(MONTH, standaloneStyle, locale);
++ if (!map.equals(mapStandalone)) {
++ System.err.printf("Calendar.getDisplayNames: locale=%s%n map=%s%n mapStandalone=%s%n",
++ locale, map, mapStandalone);
++ errors++;
++ }
++ Map<String, Integer> mapAll = cal.getDisplayNames(MONTH, ALL_STYLES, locale);
++ if (!mapAll.entrySet().containsAll(map.entrySet())) {
++ System.err.printf("Calendar.getDisplayNames: locale=%s%n map=%s%n mapAll=%s%n",
++ locale, map, mapAll);
++ errors++;
++ }
++ }
++}
+--- ./jdk/test/java/util/Calendar/NarrowNamesTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/Calendar/NarrowNamesTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -86,7 +86,19 @@
+ "\u6728",
+ "\u91d1",
+ "\u571f");
+- testMap(THTH, MONTH, NARROW_FORMAT); // expect null
++ testMap(THTH, MONTH, NARROW_FORMAT,
++ "\u0e21.\u0e04.",
++ "\u0e01.\u0e1e.",
++ "\u0e21\u0e35.\u0e04.",
++ "\u0e40\u0e21.\u0e22.",
++ "\u0e1e.\u0e04.",
++ "\u0e21\u0e34.\u0e22", // no last dot
++ "\u0e01.\u0e04.",
++ "\u0e2a.\u0e04.",
++ "\u0e01.\u0e22.",
++ "\u0e15.\u0e04.",
++ "\u0e1e.\u0e22.",
++ "\u0e18.\u0e04.");
+ testMap(THTH, MONTH, NARROW_STANDALONE,
+ "\u0e21.\u0e04.",
+ "\u0e01.\u0e1e.",
+@@ -146,7 +158,7 @@
+ Calendar cal = Calendar.getInstance(locale);
+ Map<String, Integer> got = cal.getDisplayNames(field, style, locale);
+ if (!(expectedMap == null && got == null)
+- && !expectedMap.equals(got)) {
++ && !(expectedMap != null && expectedMap.equals(got))) {
+ System.err.printf("testMap: locale=%s, field=%d, style=%d, expected=%s, got=%s%n",
+ locale, field, style, expectedMap, got);
+ errors++;
+--- ./jdk/test/java/util/Currency/CurrencyTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/Currency/CurrencyTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -23,7 +23,7 @@
+ /*
+ * @test
+ * @bug 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531
+- * 6488442 7036905
++ * 6488442 7036905 8074350 8074351
+ * @summary Basic tests for Currency class.
+ */
+
+@@ -49,6 +49,7 @@
+ testFractionDigits();
+ testSerialization();
+ testDisplayNames();
++ testFundsCodes();
+ }
+
+ static void testCurrencyCodeValidation() {
+@@ -265,4 +266,41 @@
+ }
+ }
+
++ static void testFundsCodes() {
++ testValidCurrency("BOV");
++ testValidCurrency("CHE");
++ testValidCurrency("CHW");
++ testValidCurrency("CLF");
++ testValidCurrency("COU");
++ testValidCurrency("MXV");
++ testValidCurrency("USN");
++ testValidCurrency("UYI");
++
++ testFractionDigits("BOV", 2);
++ testFractionDigits("CHE", 2);
++ testFractionDigits("CHW", 2);
++ testFractionDigits("CLF", 4);
++ testFractionDigits("COU", 2);
++ testFractionDigits("MXV", 2);
++ testFractionDigits("USN", 2);
++ testFractionDigits("UYI", 0);
++
++ testNumericCode("BOV", 984);
++ testNumericCode("CHE", 947);
++ testNumericCode("CHW", 948);
++ testNumericCode("CLF", 990);
++ testNumericCode("COU", 970);
++ testNumericCode("MXV", 979);
++ testNumericCode("USN", 997);
++ testNumericCode("UYI", 940);
++ }
++
++ static void testNumericCode(String currencyCode, int expectedNumeric) {
++ int numeric = Currency.getInstance(currencyCode).getNumericCode();
++ if (numeric != expectedNumeric) {
++ throw new RuntimeException("Wrong numeric code for currency " +
++ currencyCode +": expected " + expectedNumeric +
++ ", got " + numeric);
++ }
++ }
+ }
+--- ./jdk/test/java/util/Currency/PropertiesTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/Currency/PropertiesTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2012, 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
+@@ -107,7 +107,7 @@
+ keys = p.stringPropertyNames();
+ Pattern propertiesPattern =
+ Pattern.compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*" +
+- "([0-3])\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
++ "(\\d+)\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" +
+ "\\d{2}:\\d{2})?");
+ for (String key: keys) {
+ String val = p.getProperty(key);
+@@ -135,14 +135,20 @@
+ // ignore this
+ continue;
+ }
++
++ String code = m.group(1);
++ int numeric = Integer.parseInt(m.group(2));
++ int fraction = Integer.parseInt(m.group(3));
++ if (fraction > 9) {
++ System.out.println("Skipping since the fraction is greater than 9");
++ continue;
++ }
++
+ Matcher mAfter = propertiesPattern.matcher(afterVal);
+ mAfter.find();
+
+- String code = m.group(1);
+ String codeAfter = mAfter.group(1);
+- int numeric = Integer.parseInt(m.group(2));
+ int numericAfter = Integer.parseInt(mAfter.group(2));
+- int fraction = Integer.parseInt(m.group(3));
+ int fractionAfter = Integer.parseInt(mAfter.group(3));
+ if (code.equals(codeAfter) &&
+ (numeric == numericAfter)&&
+--- ./jdk/test/java/util/Currency/PropertiesTest.sh Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/Currency/PropertiesTest.sh Wed Jul 01 21:53:30 2015 -0700
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+
+-# Copyright (c) 2007, 2012, 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
+@@ -23,7 +23,7 @@
+ #
+
+ # @test
+-# @bug 6332666 6863624 7180362 8003846
++# @bug 6332666 6863624 7180362 8003846 8074350 8074351
+ # @summary tests the capability of replacing the currency data with user
+ # specified currency properties file
+ # @build PropertiesTest
+--- ./jdk/test/java/util/Currency/ValidateISO4217.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/Currency/ValidateISO4217.java Wed Jul 01 21:53:30 2015 -0700
+@@ -23,6 +23,7 @@
+ /*
+ * @test
+ * @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759
++ * 8074350 8074351
+ * @summary Validate ISO 4217 data for Currency class.
+ */
+
+@@ -92,7 +93,7 @@
+
+ /* Codes that are obsolete, do not have related country */
+ static final String otherCodes =
+- "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-CLF-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-MZM-NLG-PTE-ROL-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-USN-USS-VEB-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZMK-ZWD-ZWN-ZWR";
++ "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-CHE-CHW-CLF-COU-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-MZM-NLG-PTE-ROL-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-UYI-USN-USS-VEB-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZMK-ZWD-ZWN-ZWR";
+
+ static boolean err = false;
+
+--- ./jdk/test/java/util/Currency/currency.properties Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/Currency/currency.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -1,20 +1,30 @@
+ #
+ # Test data for replacing the currency data
+ #
++
++# valid entries
++CL=CLF,990,4
++CM=IED,111,2, 2004-01-01T00:70:00
++ES=ESD,877,2
+ JP=JPZ,123,2
+-ES=ESD,877,2
++MA=MAA,555,5
++MC=MCC,555,6
++MD=MDD,555,7
++ME=MEE,555,8
++MF=MFF,555,9
++NO=EUR ,978 ,2, 2099-01-01T00:00:00
++SB=EUR,111,2, 2099-01-01T00:00:00
+ US=euR,978,2,2001-01-01T00:00:00
+-CM=IED,111,2, 2004-01-01T00:70:00
+-SB=EUR,111,2, 2099-01-01T00:00:00
+ ZZ = ZZZ , 999 , 3
+-NO=EUR ,978 ,2, 2099-01-01T00:00:00
+
+ # invalid entries
++DE=2009-01-01T00:00:00,EUR,111,2
++FM=DED,194,2,eeee-01-01T00:00:00
++FR=zzzzz.123
+ GB=123
+-FR=zzzzz.123
+-DE=2009-01-01T00:00:00,EUR,111,2
+ IE=euR,111,2,#testcomment
++MG=MGG,990,10
++MX=SSS,493,2,2001-01-01-00-00-00
++PE=EUR ,978 ,2, 20399-01-01T00:00:00
++MG=MGG,990,10
+ =euR,111,2, 2099-01-01-00-00-00
+-FM=DED,194,2,eeee-01-01T00:00:00
+-PE=EUR ,978 ,2, 20399-01-01T00:00:00
+-MX=SSS,493,2,2001-01-01-00-00-00
+--- ./jdk/test/java/util/Currency/tablea1.txt Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/Currency/tablea1.txt Wed Jul 01 21:53:30 2015 -0700
+@@ -5,7 +5,7 @@
+ #
+
+ # Version
+-FILEVERSION=1
++FILEVERSION=2
+ DATAVERSION=159
+
+ # ISO 4217 currency data
+@@ -55,7 +55,7 @@
+ CF XAF 950 0
+ TD XAF 950 0
+ CL CLP 152 0
+-#CL CLF 990 0
++#CL CLF 990 4
+ CN CNY 156 2
+ CX AUD 36 2
+ CC AUD 36 2
+@@ -265,6 +265,7 @@
+ #US USN 997 2
+ UM USD 840 2
+ UY UYU 858 2
++#UY UYI 940 0
+ UZ UZS 860 2
+ VU VUV 548 0
+ VE VEF 937 2
+--- ./jdk/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -25,6 +25,7 @@
+ */
+
+ import java.text.*;
++import java.time.format.TextStyle;
+ import java.util.*;
+ import sun.util.locale.provider.*;
+ import sun.util.resources.*;
+@@ -42,6 +43,7 @@
+ test2();
+ test3();
+ aliasTest();
++ genericFallbackTest();
+ }
+
+ void test1() {
+@@ -169,9 +171,9 @@
+ for (int style : new int[] { TimeZone.LONG, TimeZone.SHORT }) {
+ String osakaStd = tz.getDisplayName(false, style, OSAKA);
+ if (osakaStd != null) {
+- // No API for getting generic time zone names
+- String generic = TimeZoneNameUtility.retrieveGenericDisplayName(tzname,
+- style, GENERIC);
++ String generic = tz.toZoneId().getDisplayName(
++ style == TimeZone.LONG ? TextStyle.FULL : TextStyle.SHORT,
++ GENERIC);
+ String expected = "Generic " + osakaStd;
+ if (!expected.equals(generic)) {
+ throw new RuntimeException("Wrong generic name: got=\"" + generic
+@@ -230,4 +232,20 @@
+ throw new RuntimeException("Provider's localized name is not available for an alias ID: "+JAPAN+". result: "+japan+" expected: "+JST_IN_OSAKA);
+ }
+ }
++
++ /*
++ * Tests whether generic names can be retrieved through fallback.
++ * The test assumes the provider impl for OSAKA locale does NOT
++ * provide generic names.
++ */
++ final String PT = "PT"; // SHORT generic name for "America/Los_Angeles"
++ void genericFallbackTest() {
++ String generic =
++ TimeZone.getTimeZone(LATIME)
++ .toZoneId()
++ .getDisplayName(TextStyle.SHORT, OSAKA);
++ if (!PT.equals(generic)) {
++ throw new RuntimeException("Generic name fallback failed. got: "+generic);
++ }
++ }
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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.
++ */
++
++import org.testng.Assert;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++
++import java.util.ArrayList;
++import java.util.List;
++import java.util.concurrent.CompletableFuture;
++import java.util.concurrent.CompletionException;
++import java.util.concurrent.atomic.AtomicReference;
++import java.util.function.BiFunction;
++import java.util.function.Consumer;
++
++
++/**
++ * @test
++ * @bug 8068432 8072030
++ * @run testng ThenComposeExceptionTest
++ * @summary Test that CompletableFuture.thenCompose works correctly if the
++ * composing future completes exceptionally
++ */
++@Test
++public class ThenComposeExceptionTest {
++
++ static final BiFunction<CompletableFuture<String>, CompletableFuture<String>, CompletableFuture<String>>
++ THEN_COMPOSE = (f, fe) -> f.thenCompose(s -> fe);
++
++ static final BiFunction<CompletableFuture<String>, CompletableFuture<String>, CompletableFuture<String>>
++ THEN_COMPOSE_ASYNC = (f, fe) -> f.thenComposeAsync(s -> fe);
++
++ static final Consumer<CompletableFuture<String>>
++ COMPLETE_EXCEPTIONALLY = f -> f.completeExceptionally(new RuntimeException());
++
++ static final Consumer<CompletableFuture<String>>
++ NOP = f -> { };
++
++ static Object[][] actionsDataProvider;
++
++ @DataProvider(name = "actions")
++ static Object[][] actionsDataProvider() {
++ if (actionsDataProvider != null) {
++ return actionsDataProvider;
++ }
++
++ List<Object[]> data = new ArrayList<>();
++ data.add(new Object[]{"thenCompose and completeExceptionally", NOP, THEN_COMPOSE, COMPLETE_EXCEPTIONALLY});
++ data.add(new Object[]{"thenComposeAsync and completeExceptionally", NOP, THEN_COMPOSE_ASYNC, COMPLETE_EXCEPTIONALLY});
++ data.add(new Object[]{"completeExceptionally and thenCompose", COMPLETE_EXCEPTIONALLY, THEN_COMPOSE, NOP});
++ data.add(new Object[]{"completeExceptionally and thenComposeAsync", COMPLETE_EXCEPTIONALLY, THEN_COMPOSE_ASYNC, NOP});
++
++ return actionsDataProvider = data.toArray(new Object[0][]);
++ }
++
++ @Test(dataProvider = "actions")
++ public void testThenCompose(
++ String description,
++ Consumer<CompletableFuture<String>> beforeAction,
++ BiFunction<CompletableFuture<String>, CompletableFuture<String>, CompletableFuture<String>> composeFunction,
++ Consumer<CompletableFuture<String>> afterAction) throws Exception {
++ CompletableFuture<String> f = new CompletableFuture<>();
++ CompletableFuture<String> fe = new CompletableFuture<>();
++
++ // Ensure pre-composed stage is completed to trigger
++ // processing the composing future
++ f.complete("");
++
++ beforeAction.accept(fe);
++
++ CompletableFuture<String> f_thenCompose = composeFunction.apply(f, fe);
++ Assert.assertNotSame(f_thenCompose, fe, "Composed CompletableFuture returned directly");
++
++ AtomicReference<Throwable> eOnWhenComplete = new AtomicReference<>();
++ CompletableFuture<String> f_whenComplete = f_thenCompose.
++ whenComplete((r, e) -> eOnWhenComplete.set(e));
++
++ afterAction.accept(fe);
++
++ Throwable eOnJoined = null;
++ try {
++ f_thenCompose.join();
++ }
++ catch (Throwable t) {
++ eOnJoined = t;
++ }
++ Assert.assertTrue(eOnJoined instanceof CompletionException,
++ "Incorrect exception reported when joined on thenCompose: " + eOnJoined);
++
++ // Need to wait for f_whenComplete to complete to avoid
++ // race condition when updating eOnWhenComplete
++ eOnJoined = null;
++ try {
++ f_whenComplete.join();
++ } catch (Throwable t) {
++ eOnJoined = t;
++ }
++ Assert.assertTrue(eOnJoined instanceof CompletionException,
++ "Incorrect exception reported when joined on whenComplete: " + eOnJoined);
++ Assert.assertTrue(eOnWhenComplete.get() instanceof CompletionException,
++ "Incorrect exception passed to whenComplete: " + eOnWhenComplete.get());
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/util/concurrent/LinkedTransferQueue/SpliteratorTraverseAddRemoveTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,114 @@
++/*
++ * 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
++ * @run testng SpliteratorTraverseAddRemoveTest
++ * @bug 8085978
++ * @summary repeatedly traverse the queue using the spliterator while
++ * concurrently adding and removing an element to test that self-linked
++ * nodes are never erroneously reported on traversal
++ */
++
++import org.testng.Assert;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++
++import java.util.ArrayList;
++import java.util.List;
++import java.util.Queue;
++import java.util.Spliterator;
++import java.util.concurrent.CompletableFuture;
++import java.util.concurrent.LinkedTransferQueue;
++import java.util.concurrent.TimeUnit;
++import java.util.concurrent.atomic.AtomicBoolean;
++import java.util.function.Consumer;
++
++@Test
++public class SpliteratorTraverseAddRemoveTest {
++
++ static Object[] of(String desc, Consumer<Queue<?>> c) {
++ return new Object[]{desc, c};
++ }
++
++ static void assertIsString(Object e) {
++ Assert.assertTrue(e instanceof String,
++ String.format("Object instanceof %s (actual: instanceof %s)",
++ String.class.getName(),
++ e.getClass().getName()));
++ }
++
++ @DataProvider()
++ public static Object[][] spliteratorTraversers() {
++ return new Object[][]{
++ of("forEachRemaining", q -> {
++ q.spliterator().forEachRemaining(SpliteratorTraverseAddRemoveTest::assertIsString);
++ }),
++ of("tryAdvance", q -> {
++ Spliterator<?> s = q.spliterator();
++ while (s.tryAdvance(SpliteratorTraverseAddRemoveTest::assertIsString))
++ ;
++ }),
++ of("trySplit then forEachRemaining", q -> {
++ Spliterator<?> r = q.spliterator();
++
++ List<Spliterator<?>> ss = new ArrayList<>();
++ Spliterator<?> l;
++ while ((l = r.trySplit()) != null) {
++ ss.add(l);
++ }
++ ss.add(r);
++
++ ss.forEach(s -> s.forEachRemaining(SpliteratorTraverseAddRemoveTest::assertIsString));
++ }),
++ };
++ }
++
++ @Test(dataProvider = "spliteratorTraversers")
++ public void testQueue(String desc, Consumer<Queue<String>> c)
++ throws InterruptedException {
++ AtomicBoolean done = new AtomicBoolean(false);
++ Queue<String> msgs = new LinkedTransferQueue<>();
++
++ CompletableFuture<Void> traversalTask = CompletableFuture.runAsync(() -> {
++ while (!done.get()) {
++ // Traversal will fail if self-linked nodes of
++ // LinkedTransferQueue are erroneously reported
++ c.accept(msgs);
++ }
++ });
++ CompletableFuture<Void> addAndRemoveTask = CompletableFuture.runAsync(() -> {
++ while (!traversalTask.isDone()) {
++ msgs.add("msg");
++ msgs.remove("msg");
++ }
++ });
++
++ Thread.sleep(TimeUnit.SECONDS.toMillis(1));
++ done.set(true);
++
++ addAndRemoveTask.join();
++ Assert.assertTrue(traversalTask.isDone());
++ traversalTask.join();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/util/concurrent/forkjoin/SubmissionTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,49 @@
++/*
++ * 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.concurrent.ForkJoinPool;
++import java.util.concurrent.TimeUnit;
++import java.util.concurrent.atomic.AtomicBoolean;
++
++/*
++ * @test
++ * @bug 8078490
++ * @summary Test submission and execution of task without joining
++ */
++public class SubmissionTest {
++ public static void main(String[] args) throws Throwable {
++ final ForkJoinPool e = new ForkJoinPool(1);
++ final AtomicBoolean b = new AtomicBoolean();
++ final Runnable setFalse = () -> b.set(false);
++ for (int i = 0; i < 100000; i++) {
++ b.set(true);
++ e.execute(setFalse);
++ long st = System.nanoTime();
++ while (b.get()) {
++ if (System.nanoTime() - st >= TimeUnit.SECONDS.toNanos(10)) {
++ throw new RuntimeException("Submitted task failed to execute");
++ }
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/java/util/logging/HigherResolutionTimeStamps/SerializeLogRecord.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,363 @@
++/*
++ * 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.ByteArrayOutputStream;
++import java.io.IOException;
++import java.io.ObjectInputStream;
++import java.io.ObjectOutputStream;
++import java.time.ZoneId;
++import java.util.Base64;
++import java.util.Locale;
++import java.util.TimeZone;
++import java.util.logging.Level;
++import java.util.logging.LogRecord;
++import java.util.logging.SimpleFormatter;
++import java.util.regex.Matcher;
++import java.util.regex.Pattern;
++import java.util.stream.Stream;
++
++/**
++ * @test
++ * @bug 8074125
++ * @summary tests the compatibility of LogRecord serial form between
++ * JDK 8 and JDK 9. Ideally this test should be run on both platforms.
++ * (It is designed to run on both).
++ * @run main/othervm SerializeLogRecord
++ * @author danielfuchs
++ */
++public class SerializeLogRecord {
++
++ /**
++ * Serializes a log record, encode the serialized bytes in base 64, and
++ * prints pseudo java code that can be cut and pasted into this test.
++ * @param record the log record to serialize, encode in base 64, and for
++ * which test data will be generated.
++ * @return A string containing the generated pseudo java code.
++ * @throws IOException Unexpected.
++ * @throws ClassNotFoundException Unexpected.
++ */
++ public static String generate(LogRecord record) throws IOException, ClassNotFoundException {
++
++ // Format the given logRecord using the SimpleFormatter
++ SimpleFormatter formatter = new SimpleFormatter();
++ String str = formatter.format(record);
++
++ // Serialize the given LogRecord
++ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ final ObjectOutputStream oos = new ObjectOutputStream(baos);
++ oos.writeObject(record);
++ oos.flush();
++ oos.close();
++
++ // Now we're going to perform a number of smoke tests before
++ // generating the Java pseudo code.
++ //
++ // First checks that the log record can be deserialized
++ final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
++ final ObjectInputStream ois = new ObjectInputStream(bais);
++ final LogRecord record2 = (LogRecord)ois.readObject();
++
++ // Format the deserialized LogRecord using the SimpleFormatter, and
++ // check that the string representation obtained matches the string
++ // representation of the original LogRecord
++ String str2 = formatter.format(record2);
++ if (!str.equals(str2)) throw new RuntimeException("Unexpected values in deserialized object:"
++ + "\n\tExpected: " + str
++ + "\n\tRetrieved: "+str);
++
++ // Now get a Base64 string representation of the serialized bytes.
++ final String base64 = Base64.getEncoder().encodeToString(baos.toByteArray());
++
++ // Check that we can deserialize a log record from the Base64 string
++ // representation we just computed.
++ final ByteArrayInputStream bais2 = new ByteArrayInputStream(Base64.getDecoder().decode(base64));
++ final ObjectInputStream ois2 = new ObjectInputStream(bais2);
++ final LogRecord record3 = (LogRecord)ois2.readObject();
++
++ // Format the new deserialized LogRecord using the SimpleFormatter, and
++ // check that the string representation obtained matches the string
++ // representation of the original LogRecord
++ String str3 = formatter.format(record3);
++ if (!str.equals(str3)) throw new RuntimeException("Unexpected values in deserialized object:"
++ + "\n\tExpected: " + str
++ + "\n\tRetrieved: "+str);
++ //System.out.println(base64);
++ //System.out.println();
++
++ // Generates the Java Pseudo code that can be cut & pasted into
++ // this test (see Jdk8SerializedLog and Jdk9SerializedLog below)
++ final StringBuilder sb = new StringBuilder();
++ sb.append(" /**").append('\n');
++ sb.append(" * Base64 encoded string for LogRecord object.").append('\n');
++ sb.append(" * Java version: ").append(System.getProperty("java.version")).append('\n');
++ sb.append(" **/").append('\n');
++ sb.append(" final String base64 = ").append("\n ");
++ final int last = base64.length() - 1;
++ for (int i=0; i<base64.length();i++) {
++ if (i%64 == 0) sb.append("\"");
++ sb.append(base64.charAt(i));
++ if (i%64 == 63 || i == last) {
++ sb.append("\"");
++ if (i == last) sb.append(";\n");
++ else sb.append("\n + ");
++ }
++ }
++ sb.append('\n');
++ sb.append(" /**").append('\n');
++ sb.append(" * SimpleFormatter output for LogRecord object.").append('\n');
++ sb.append(" * Java version: ").append(System.getProperty("java.version")).append('\n');
++ sb.append(" **/").append('\n');
++ sb.append(" final String str = ").append("\n ");
++ sb.append("\"").append(str.replace("\n", "\\n")).append("\";\n");
++ return sb.toString();
++ }
++
++ /**
++ * An abstract class to test that a log record previously serialized on a
++ * different java version can be deserialized in the current java version.
++ * (see Jdk8SerializedLog and Jdk9SerializedLog below)
++ */
++ public static abstract class SerializedLog {
++ public abstract String getBase64();
++ public abstract String getString();
++
++ /**
++ * Deserializes the Base64 encoded string returned by {@link
++ * #getBase64()}, format the obtained LogRecord using a
++ * SimpleFormatter, and checks that the string representation obtained
++ * matches the original string representation returned by {@link
++ * #getString()}.
++ */
++ protected void dotest() {
++ try {
++ final String base64 = getBase64();
++ final ByteArrayInputStream bais =
++ new ByteArrayInputStream(Base64.getDecoder().decode(base64));
++ final ObjectInputStream ois = new ObjectInputStream(bais);
++ final LogRecord record = (LogRecord)ois.readObject();
++ final SimpleFormatter formatter = new SimpleFormatter();
++ String expected = getString();
++ String str2 = formatter.format(record);
++ check(expected, str2);
++ System.out.println(str2);
++ System.out.println("PASSED: "+this.getClass().getName()+"\n");
++ } catch (IOException | ClassNotFoundException x) {
++ throw new RuntimeException(x);
++ }
++ }
++ /**
++ * Check that the actual String representation obtained matches the
++ * expected String representation.
++ * @param expected Expected String representation, as returned by
++ * {@link #getString()}.
++ * @param actual Actual String representation obtained by formatting
++ * the LogRecord obtained by the deserialization of the
++ * bytes encoded in {@link #getBase64()}.
++ */
++ protected void check(String expected, String actual) {
++ if (!expected.equals(actual)) {
++ throw new RuntimeException(this.getClass().getName()
++ + " - Unexpected values in deserialized object:"
++ + "\n\tExpected: " + expected
++ + "\n\tRetrieved: "+ actual);
++ }
++ }
++ }
++
++ public static class Jdk8SerializedLog extends SerializedLog {
++
++ // Generated by generate() on JDK 8.
++ // --------------------------------
++ // BEGIN
++
++ /**
++ * Base64 encoded string for LogRecord object.
++ * Java version: 1.8.0_11
++ **/
++ final String base64 =
++ "rO0ABXNyABtqYXZhLnV0aWwubG9nZ2luZy5Mb2dSZWNvcmRKjVk982lRlgMACkoA"
++ + "Bm1pbGxpc0oADnNlcXVlbmNlTnVtYmVySQAIdGhyZWFkSURMAAVsZXZlbHQAGUxq"
++ + "YXZhL3V0aWwvbG9nZ2luZy9MZXZlbDtMAApsb2dnZXJOYW1ldAASTGphdmEvbGFu"
++ + "Zy9TdHJpbmc7TAAHbWVzc2FnZXEAfgACTAAScmVzb3VyY2VCdW5kbGVOYW1lcQB+"
++ + "AAJMAA9zb3VyY2VDbGFzc05hbWVxAH4AAkwAEHNvdXJjZU1ldGhvZE5hbWVxAH4A"
++ + "AkwABnRocm93bnQAFUxqYXZhL2xhbmcvVGhyb3dhYmxlO3hwAAABSjUCgo0AAAAA"
++ + "AAAAAAAAAAFzcgAXamF2YS51dGlsLmxvZ2dpbmcuTGV2ZWyOiHETUXM2kgIAA0kA"
++ + "BXZhbHVlTAAEbmFtZXEAfgACTAAScmVzb3VyY2VCdW5kbGVOYW1lcQB+AAJ4cAAA"
++ + "AyB0AARJTkZPdAAic3VuLnV0aWwubG9nZ2luZy5yZXNvdXJjZXMubG9nZ2luZ3QA"
++ + "BHRlc3R0ABFKYXZhIFZlcnNpb246IHswfXBwcHB3BgEAAAAAAXQACDEuOC4wXzEx"
++ + "eA==";
++
++ /**
++ * SimpleFormatter output for LogRecord object.
++ * Java version: 1.8.0_11
++ **/
++ final String str =
++ "Dec 10, 2014 4:22:44.621000000 PM test - INFO: Java Version: 1.8.0_11";
++ // ^^^
++ // Notice the milli second resolution above...
++
++ // END
++ // --------------------------------
++
++ @Override
++ public String getBase64() {
++ return base64;
++ }
++
++ @Override
++ public String getString() {
++ return str;
++ }
++
++ public static void test() {
++ new Jdk8SerializedLog().dotest();
++ }
++ }
++
++ public static class Jdk9SerializedLog extends SerializedLog {
++
++ // Generated by generate() on JDK 9.
++ // --------------------------------
++ // BEGIN
++
++ /**
++ * Base64 encoded string for LogRecord object.
++ * Java version: 1.9.0-internal
++ **/
++ final String base64 =
++ "rO0ABXNyABtqYXZhLnV0aWwubG9nZ2luZy5Mb2dSZWNvcmRKjVk982lRlgMAC0oA"
++ + "Bm1pbGxpc0kADm5hbm9BZGp1c3RtZW50SgAOc2VxdWVuY2VOdW1iZXJJAAh0aHJl"
++ + "YWRJREwABWxldmVsdAAZTGphdmEvdXRpbC9sb2dnaW5nL0xldmVsO0wACmxvZ2dl"
++ + "ck5hbWV0ABJMamF2YS9sYW5nL1N0cmluZztMAAdtZXNzYWdlcQB+AAJMABJyZXNv"
++ + "dXJjZUJ1bmRsZU5hbWVxAH4AAkwAD3NvdXJjZUNsYXNzTmFtZXEAfgACTAAQc291"
++ + "cmNlTWV0aG9kTmFtZXEAfgACTAAGdGhyb3dudAAVTGphdmEvbGFuZy9UaHJvd2Fi"
++ + "bGU7eHAAAAFLl3u6OAAOU/gAAAAAAAAAAAAAAAFzcgAXamF2YS51dGlsLmxvZ2dp"
++ + "bmcuTGV2ZWyOiHETUXM2kgIAA0kABXZhbHVlTAAEbmFtZXEAfgACTAAScmVzb3Vy"
++ + "Y2VCdW5kbGVOYW1lcQB+AAJ4cAAAAyB0AARJTkZPdAAic3VuLnV0aWwubG9nZ2lu"
++ + "Zy5yZXNvdXJjZXMubG9nZ2luZ3QABHRlc3R0ABFKYXZhIFZlcnNpb246IHswfXBw"
++ + "cHB3BgEAAAAAAXQADjEuOS4wLWludGVybmFseA==";
++
++ /**
++ * SimpleFormatter output for LogRecord object.
++ * Java version: 1.9.0-internal
++ **/
++ final String str =
++ "Feb 17, 2015 12:20:43.192939000 PM test - INFO: Java Version: 1.9.0-internal";
++ // ^^^
++ // Notice the micro second resolution above...
++
++ // END
++ // --------------------------------
++
++ @Override
++ public String getBase64() {
++ return base64;
++ }
++
++ @Override
++ public String getString() {
++ return str;
++ }
++
++ @Override
++ protected void check(String expected, String actual) {
++ if (System.getProperty("java.version").startsWith("1.8")) {
++ // If we are in JDK 8 and print a log record serialized in JDK 9,
++ // then we won't be able to print anything below the millisecond
++ // precision, since that hasn't been implemented in JDK 8.
++ // Therefore - we need to replace anything below millseconds by
++ // zeroes in the expected string (which was generated on JDK 9).
++ Pattern pattern = Pattern.compile("^"
++ + "(.*\\.[0-9][0-9][0-9])" // group1: everything up to milliseconds
++ + "([0-9][0-9][0-9][0-9][0-9][0-9])" // group 2: micros and nanos
++ + "(.* - .*)$"); // group three: all the rest...
++ Matcher matcher = pattern.matcher(expected);
++ if (matcher.matches()) {
++ expected = matcher.group(1) + "000000" + matcher.group(3);
++ }
++ }
++ super.check(expected, actual);
++ }
++
++ public static void test() {
++ new Jdk9SerializedLog().dotest();
++ }
++ }
++
++ public static void generate() {
++ try {
++ LogRecord record = new LogRecord(Level.INFO, "Java Version: {0}");
++ record.setLoggerName("test");
++ record.setParameters(new Object[] {System.getProperty("java.version")});
++ System.out.println(generate(record));
++ } catch (IOException | ClassNotFoundException x) {
++ throw new RuntimeException(x);
++ }
++ }
++
++ static enum TestCase { GENERATE, TESTJDK8, TESTJDK9 };
++
++ public static void main(String[] args) {
++ // Set the locale and time zone to make sure we won't depend on the
++ // test env - in particular we don't want to depend on the
++ // time zone in which the test machine might be located.
++ // So we're gong to use Locale English and Time Zone UTC for this test.
++ // (Maybe that should be Locale.ROOT?)
++ Locale.setDefault(Locale.ENGLISH);
++ TimeZone.setDefault(TimeZone.getTimeZone(ZoneId.of("UTC")));
++
++ // Set the format property to make sure we always have the nanos, and
++ // to make sure it's the same format than what we used when
++ // computing the formatted string for Jdk8SerializedLog and
++ // Jdk9SerializedLog above.
++ //
++ // If you change the formatting, then you will need to regenerate
++ // the data for Jdk8SerializedLog and Jdk9SerializedLog.
++ //
++ // To do that - just run this test on JDK 8, and cut & paste the
++ // pseudo code printed by generate() into Jdk8SerializedLog.
++ // Then run this test again on JDK 9, and cut & paste the
++ // pseudo code printed by generate() into Jdk9SerializedLog.
++ // [Note: you can pass GENERATE as single arg to main() to avoid
++ // running the actual test]
++ // Finally run the test again to check that it still passes after
++ // your modifications.
++ //
++ System.setProperty("java.util.logging.SimpleFormatter.format",
++ "%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS.%1$tN %1$Tp %2$s - %4$s: %5$s%6$s");
++
++ // If no args, then run everything....
++ if (args == null || args.length == 0) {
++ args = new String[] { "GENERATE", "TESTJDK8", "TESTJDK9" };
++ }
++
++ // Run the specified test case(s)
++ Stream.of(args).map(x -> TestCase.valueOf(x)).forEach((x) -> {
++ switch(x) {
++ case GENERATE: generate(); break;
++ case TESTJDK8: Jdk8SerializedLog.test(); break;
++ case TESTJDK9: Jdk9SerializedLog.test(); break;
++ }
++ });
++ }
++}
+--- ./jdk/test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestScenario.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestScenario.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -22,7 +22,10 @@
+ */
+ package java.util.stream;
+
++import java.util.Collections;
++import java.util.EnumSet;
+ import java.util.PrimitiveIterator;
++import java.util.Set;
+ import java.util.Spliterator;
+ import java.util.function.Consumer;
+ import java.util.function.DoubleConsumer;
+@@ -159,12 +162,50 @@
+ for (double t : pipe2.toArray())
+ b.accept(t);
+ }
+- },;
++ },
++
++ // Wrap as parallel stream + forEach synchronizing
++ PAR_STREAM_FOR_EACH(true, false) {
++ <T, S_IN extends BaseStream<T, S_IN>>
++ void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) {
++ m.apply(data.parallelStream()).forEach(e -> {
++ synchronized (data) {
++ b.accept(e);
++ }
++ });
++ }
++ },
++
++ // Wrap as parallel stream + forEach synchronizing and clear SIZED flag
++ PAR_STREAM_FOR_EACH_CLEAR_SIZED(true, false) {
++ <T, S_IN extends BaseStream<T, S_IN>>
++ void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) {
++ S_IN pipe1 = (S_IN) OpTestCase.chain(data.parallelStream(),
++ new FlagDeclaringOp(StreamOpFlag.NOT_SIZED, data.getShape()));
++ m.apply(pipe1).forEach(e -> {
++ synchronized (data) {
++ b.accept(e);
++ }
++ });
++ }
++ },
++ ;
++
++ // The set of scenarios that clean the SIZED flag
++ public static final Set<DoubleStreamTestScenario> CLEAR_SIZED_SCENARIOS = Collections.unmodifiableSet(
++ EnumSet.of(PAR_STREAM_TO_ARRAY_CLEAR_SIZED, PAR_STREAM_FOR_EACH_CLEAR_SIZED));
+
+ private boolean isParallel;
+
++ private final boolean isOrdered;
++
+ DoubleStreamTestScenario(boolean isParallel) {
++ this(isParallel, true);
++ }
++
++ DoubleStreamTestScenario(boolean isParallel, boolean isOrdered) {
+ this.isParallel = isParallel;
++ this.isOrdered = isOrdered;
+ }
+
+ public StreamShape getShape() {
+@@ -175,6 +216,10 @@
+ return isParallel;
+ }
+
++ public boolean isOrdered() {
++ return isOrdered;
++ }
++
+ public <T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
+ void run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, S_OUT> m) {
+ _run(data, (DoubleConsumer) b, (Function<S_IN, DoubleStream>) m);
+--- ./jdk/test/java/util/stream/bootlib/java/util/stream/IntStreamTestScenario.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/bootlib/java/util/stream/IntStreamTestScenario.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -22,7 +22,10 @@
+ */
+ package java.util.stream;
+
++import java.util.Collections;
++import java.util.EnumSet;
+ import java.util.PrimitiveIterator;
++import java.util.Set;
+ import java.util.Spliterator;
+ import java.util.function.Consumer;
+ import java.util.function.Function;
+@@ -160,12 +163,50 @@
+ for (int t : pipe2.toArray())
+ b.accept(t);
+ }
+- },;
++ },
+
+- private boolean isParallel;
++ // Wrap as parallel stream + forEach synchronizing
++ PAR_STREAM_FOR_EACH(true, false) {
++ <T, S_IN extends BaseStream<T, S_IN>>
++ void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) {
++ m.apply(data.parallelStream()).forEach(e -> {
++ synchronized (data) {
++ b.accept(e);
++ }
++ });
++ }
++ },
++
++ // Wrap as parallel stream + forEach synchronizing and clear SIZED flag
++ PAR_STREAM_FOR_EACH_CLEAR_SIZED(true, false) {
++ <T, S_IN extends BaseStream<T, S_IN>>
++ void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) {
++ S_IN pipe1 = (S_IN) OpTestCase.chain(data.parallelStream(),
++ new FlagDeclaringOp(StreamOpFlag.NOT_SIZED, data.getShape()));
++ m.apply(pipe1).forEach(e -> {
++ synchronized (data) {
++ b.accept(e);
++ }
++ });
++ }
++ },
++ ;
++
++ // The set of scenarios that clean the SIZED flag
++ public static final Set<IntStreamTestScenario> CLEAR_SIZED_SCENARIOS = Collections.unmodifiableSet(
++ EnumSet.of(PAR_STREAM_TO_ARRAY_CLEAR_SIZED, PAR_STREAM_FOR_EACH_CLEAR_SIZED));
++
++ private final boolean isParallel;
++
++ private final boolean isOrdered;
+
+ IntStreamTestScenario(boolean isParallel) {
++ this(isParallel, true);
++ }
++
++ IntStreamTestScenario(boolean isParallel, boolean isOrdered) {
+ this.isParallel = isParallel;
++ this.isOrdered = isOrdered;
+ }
+
+ public StreamShape getShape() {
+@@ -176,6 +217,10 @@
+ return isParallel;
+ }
+
++ public boolean isOrdered() {
++ return isOrdered;
++ }
++
+ public <T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
+ void run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, S_OUT> m) {
+ _run(data, (IntConsumer) b, (Function<S_IN, IntStream>) m);
+--- ./jdk/test/java/util/stream/bootlib/java/util/stream/LongStreamTestScenario.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/bootlib/java/util/stream/LongStreamTestScenario.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -22,7 +22,10 @@
+ */
+ package java.util.stream;
+
++import java.util.Collections;
++import java.util.EnumSet;
+ import java.util.PrimitiveIterator;
++import java.util.Set;
+ import java.util.Spliterator;
+ import java.util.function.Consumer;
+ import java.util.function.Function;
+@@ -159,12 +162,50 @@
+ for (long t : pipe2.toArray())
+ b.accept(t);
+ }
+- },;
++ },
++
++ // Wrap as parallel stream + forEach synchronizing
++ PAR_STREAM_FOR_EACH(true, false) {
++ <T, S_IN extends BaseStream<T, S_IN>>
++ void _run(TestData<T, S_IN> data, LongConsumer b, Function<S_IN, LongStream> m) {
++ m.apply(data.parallelStream()).forEach(e -> {
++ synchronized (data) {
++ b.accept(e);
++ }
++ });
++ }
++ },
++
++ // Wrap as parallel stream + forEach synchronizing and clear SIZED flag
++ PAR_STREAM_FOR_EACH_CLEAR_SIZED(true, false) {
++ <T, S_IN extends BaseStream<T, S_IN>>
++ void _run(TestData<T, S_IN> data, LongConsumer b, Function<S_IN, LongStream> m) {
++ S_IN pipe1 = (S_IN) OpTestCase.chain(data.parallelStream(),
++ new FlagDeclaringOp(StreamOpFlag.NOT_SIZED, data.getShape()));
++ m.apply(pipe1).forEach(e -> {
++ synchronized (data) {
++ b.accept(e);
++ }
++ });
++ }
++ },
++ ;
++
++ // The set of scenarios that clean the SIZED flag
++ public static final Set<LongStreamTestScenario> CLEAR_SIZED_SCENARIOS = Collections.unmodifiableSet(
++ EnumSet.of(PAR_STREAM_TO_ARRAY_CLEAR_SIZED, PAR_STREAM_FOR_EACH_CLEAR_SIZED));
+
+ private boolean isParallel;
+
++ private final boolean isOrdered;
++
+ LongStreamTestScenario(boolean isParallel) {
++ this(isParallel, true);
++ }
++
++ LongStreamTestScenario(boolean isParallel, boolean isOrdered) {
+ this.isParallel = isParallel;
++ this.isOrdered = isOrdered;
+ }
+
+ public StreamShape getShape() {
+@@ -175,6 +216,10 @@
+ return isParallel;
+ }
+
++ public boolean isOrdered() {
++ return isOrdered;
++ }
++
+ public <T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
+ void run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, S_OUT> m) {
+ _run(data, (LongConsumer) b, (Function<S_IN, LongStream>) m);
+--- ./jdk/test/java/util/stream/bootlib/java/util/stream/OpTestCase.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/bootlib/java/util/stream/OpTestCase.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -30,6 +30,7 @@
+ import java.util.Collections;
+ import java.util.EnumMap;
+ import java.util.EnumSet;
++import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.List;
+ import java.util.Map;
+@@ -91,11 +92,13 @@
+
+ boolean isParallel();
+
+- abstract <T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
++ boolean isOrdered();
++
++ <T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
+ void run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, S_OUT> m);
+ }
+
+- public <T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
++ protected <T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
+ Collection<U> exerciseOps(TestData<T, S_IN> data, Function<S_IN, S_OUT> m) {
+ return withData(data).stream(m).exercise();
+ }
+@@ -103,7 +106,7 @@
+ // Run multiple versions of exercise(), returning the result of the first, and asserting that others return the same result
+ // If the first version is s -> s.foo(), can be used with s -> s.mapToInt(i -> i).foo().mapToObj(i -> i) to test all shape variants
+ @SafeVarargs
+- public final<T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
++ protected final<T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
+ Collection<U> exerciseOpsMulti(TestData<T, S_IN> data,
+ Function<S_IN, S_OUT>... ms) {
+ Collection<U> result = null;
+@@ -121,7 +124,7 @@
+ // Run multiple versions of exercise() for an Integer stream, returning the result of the first, and asserting that others return the same result
+ // Automates the conversion between Stream<Integer> and {Int,Long,Double}Stream and back, so client sites look like you are passing the same
+ // lambda four times, but in fact they are four different lambdas since they are transforming four different kinds of streams
+- public final
++ protected final
+ Collection<Integer> exerciseOpsInt(TestData.OfRef<Integer> data,
+ Function<Stream<Integer>, Stream<Integer>> mRef,
+ Function<IntStream, IntStream> mInt,
+@@ -136,30 +139,73 @@
+ return exerciseOpsMulti(data, ms);
+ }
+
+- public <T, U, S_OUT extends BaseStream<U, S_OUT>>
++ // Run multiple versions of exercise() with multiple terminal operations for all kinds of stream, , and asserting against the expected result
++ // If the first version is s -> s.foo(), can be used with s -> s.mapToInt(i -> i).foo().mapToObj(i -> i) to test all shape variants
++ protected final<T, U, R, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
++ void exerciseTerminalOpsMulti(TestData<T, S_IN> data,
++ R expected,
++ Map<String, Function<S_IN, S_OUT>> streams,
++ Map<String, Function<S_OUT, R>> terminals) {
++ for (Map.Entry<String, Function<S_IN, S_OUT>> se : streams.entrySet()) {
++ setContext("Intermediate stream", se.getKey());
++ for (Map.Entry<String, Function<S_OUT, R>> te : terminals.entrySet()) {
++ setContext("Terminal stream", te.getKey());
++ withData(data)
++ .terminal(se.getValue(), te.getValue())
++ .expectedResult(expected)
++ .exercise();
++
++ }
++ }
++ }
++
++ // Run multiple versions of exercise() with multiple terminal operation for all kinds of stream, and asserting against the expected result
++ // Automates the conversion between Stream<Integer> and {Int,Long,Double}Stream and back, so client sites look like you are passing the same
++ // lambda four times, but in fact they are four different lambdas since they are transforming four different kinds of streams
++ protected final
++ void exerciseTerminalOpsInt(TestData<Integer, Stream<Integer>> data,
++ Collection<Integer> expected,
++ String desc,
++ Function<Stream<Integer>, Stream<Integer>> mRef,
++ Function<IntStream, IntStream> mInt,
++ Function<LongStream, LongStream> mLong,
++ Function<DoubleStream, DoubleStream> mDouble,
++ Map<String, Function<Stream<Integer>, Collection<Integer>>> terminals) {
++
++ Map<String, Function<Stream<Integer>, Stream<Integer>>> m = new HashMap<>();
++ m.put("Ref " + desc, mRef);
++ m.put("Int " + desc, s -> mInt.apply(s.mapToInt(e -> e)).mapToObj(e -> e));
++ m.put("Long " + desc, s -> mLong.apply(s.mapToLong(e -> e)).mapToObj(e -> (int) e));
++ m.put("Double " + desc, s -> mDouble.apply(s.mapToDouble(e -> e)).mapToObj(e -> (int) e));
++
++ exerciseTerminalOpsMulti(data, expected, m, terminals);
++ }
++
++
++ protected <T, U, S_OUT extends BaseStream<U, S_OUT>>
+ Collection<U> exerciseOps(Collection<T> data, Function<Stream<T>, S_OUT> m) {
+ TestData.OfRef<T> data1 = TestData.Factory.ofCollection("Collection of type " + data.getClass().getName(), data);
+ return withData(data1).stream(m).exercise();
+ }
+
+- public <T, U, S_OUT extends BaseStream<U, S_OUT>, I extends Iterable<U>>
++ protected <T, U, S_OUT extends BaseStream<U, S_OUT>, I extends Iterable<U>>
+ Collection<U> exerciseOps(Collection<T> data, Function<Stream<T>, S_OUT> m, I expected) {
+ TestData.OfRef<T> data1 = TestData.Factory.ofCollection("Collection of type " + data.getClass().getName(), data);
+ return withData(data1).stream(m).expectedResult(expected).exercise();
+ }
+
+ @SuppressWarnings("unchecked")
+- public <U, S_OUT extends BaseStream<U, S_OUT>>
++ protected <U, S_OUT extends BaseStream<U, S_OUT>>
+ Collection<U> exerciseOps(int[] data, Function<IntStream, S_OUT> m) {
+ return withData(TestData.Factory.ofArray("int array", data)).stream(m).exercise();
+ }
+
+- public Collection<Integer> exerciseOps(int[] data, Function<IntStream, IntStream> m, int[] expected) {
++ protected Collection<Integer> exerciseOps(int[] data, Function<IntStream, IntStream> m, int[] expected) {
+ TestData.OfInt data1 = TestData.Factory.ofArray("int array", data);
+ return withData(data1).stream(m).expectedResult(expected).exercise();
+ }
+
+- public <T, S_IN extends BaseStream<T, S_IN>> DataStreamBuilder<T, S_IN> withData(TestData<T, S_IN> data) {
++ protected <T, S_IN extends BaseStream<T, S_IN>> DataStreamBuilder<T, S_IN> withData(TestData<T, S_IN> data) {
+ Objects.requireNonNull(data);
+ return new DataStreamBuilder<>(data);
+ }
+@@ -325,19 +371,19 @@
+ // Build method
+
+ public Collection<U> exercise() {
+- final boolean isOrdered;
++ final boolean isStreamOrdered;
+ if (refResult == null) {
+ // Induce the reference result
+ before.accept(data);
+ S_OUT sOut = m.apply(data.stream());
+- isOrdered = StreamOpFlag.ORDERED.isKnown(((AbstractPipeline) sOut).getStreamFlags());
++ isStreamOrdered = StreamOpFlag.ORDERED.isKnown(((AbstractPipeline) sOut).getStreamFlags());
+ Node<U> refNodeResult = ((AbstractPipeline<?, U, ?>) sOut).evaluateToArrayNode(size -> (U[]) new Object[size]);
+ refResult = LambdaTestHelpers.toBoxedList(refNodeResult.spliterator());
+ after.accept(data);
+ }
+ else {
+ S_OUT sOut = m.apply(data.stream());
+- isOrdered = StreamOpFlag.ORDERED.isKnown(((AbstractPipeline) sOut).getStreamFlags());
++ isStreamOrdered = StreamOpFlag.ORDERED.isKnown(((AbstractPipeline) sOut).getStreamFlags());
+ }
+
+ List<Error> errors = new ArrayList<>();
+@@ -348,7 +394,7 @@
+ List<U> result = new ArrayList<>();
+ test.run(data, LambdaTestHelpers.<U>toBoxingConsumer(result::add), m);
+
+- Runnable asserter = () -> resultAsserter.assertResult(result, refResult, isOrdered, test.isParallel());
++ Runnable asserter = () -> resultAsserter.assertResult(result, refResult, isStreamOrdered && test.isOrdered(), test.isParallel());
+
+ if (refResult.size() > 1000) {
+ LambdaTestHelpers.launderAssertion(
+@@ -406,7 +452,7 @@
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+- static enum TerminalTestScenario implements BaseTerminalTestScenario {
++ enum TerminalTestScenario implements BaseTerminalTestScenario {
+ SINGLE_SEQUENTIAL(true, false),
+
+ SINGLE_SEQUENTIAL_SHORT_CIRCUIT(true, false) {
+@@ -546,19 +592,19 @@
+ }
+ }
+
+- public <T, R> R exerciseTerminalOps(Collection<T> data, Function<Stream<T>, R> m, R expected) {
++ protected <T, R> R exerciseTerminalOps(Collection<T> data, Function<Stream<T>, R> m, R expected) {
+ TestData.OfRef<T> data1
+ = TestData.Factory.ofCollection("Collection of type " + data.getClass().getName(), data);
+ return withData(data1).terminal(m).expectedResult(expected).exercise();
+ }
+
+- public <T, R, S_IN extends BaseStream<T, S_IN>> R
++ protected <T, R, S_IN extends BaseStream<T, S_IN>> R
+ exerciseTerminalOps(TestData<T, S_IN> data,
+ Function<S_IN, R> terminalF) {
+ return withData(data).terminal(terminalF).exercise();
+ }
+
+- public <T, U, R, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>> R
++ protected <T, U, R, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>> R
+ exerciseTerminalOps(TestData<T, S_IN> data,
+ Function<S_IN, S_OUT> streamF,
+ Function<S_OUT, R> terminalF) {
+--- ./jdk/test/java/util/stream/bootlib/java/util/stream/StreamTestScenario.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/bootlib/java/util/stream/StreamTestScenario.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -22,7 +22,10 @@
+ */
+ package java.util.stream;
+
++import java.util.Collections;
++import java.util.EnumSet;
+ import java.util.Iterator;
++import java.util.Set;
+ import java.util.Spliterator;
+ import java.util.function.Consumer;
+ import java.util.function.Function;
+@@ -173,8 +176,8 @@
+ }
+ },
+
+- // Wrap as parallel + collect
+- PAR_STREAM_COLLECT(true) {
++ // Wrap as parallel + collect to list
++ PAR_STREAM_COLLECT_TO_LIST(true) {
+ <T, U, S_IN extends BaseStream<T, S_IN>>
+ void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) {
+ for (U u : m.apply(data.parallelStream()).collect(Collectors.toList()))
+@@ -182,8 +185,8 @@
+ }
+ },
+
+- // Wrap sequential as parallel, + collect
+- STREAM_TO_PAR_STREAM_COLLECT(true) {
++ // Wrap sequential as parallel, + collect to list
++ STREAM_TO_PAR_STREAM_COLLECT_TO_LIST(true) {
+ <T, U, S_IN extends BaseStream<T, S_IN>>
+ void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) {
+ for (U u : m.apply(data.stream().parallel()).collect(Collectors.toList()))
+@@ -192,19 +195,56 @@
+ },
+
+ // Wrap parallel as sequential,, + collect
+- PAR_STREAM_TO_STREAM_COLLECT(true) {
++ PAR_STREAM_TO_STREAM_COLLECT_TO_LIST(true) {
+ <T, U, S_IN extends BaseStream<T, S_IN>>
+ void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) {
+ for (U u : m.apply(data.parallelStream().sequential()).collect(Collectors.toList()))
+ b.accept(u);
+ }
+ },
++
++ // Wrap as parallel stream + forEach synchronizing
++ PAR_STREAM_FOR_EACH(true, false) {
++ <T, U, S_IN extends BaseStream<T, S_IN>>
++ void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) {
++ m.apply(data.parallelStream()).forEach(e -> {
++ synchronized (data) {
++ b.accept(e);
++ }
++ });
++ }
++ },
++
++ // Wrap as parallel stream + forEach synchronizing and clear SIZED flag
++ PAR_STREAM_FOR_EACH_CLEAR_SIZED(true, false) {
++ <T, U, S_IN extends BaseStream<T, S_IN>>
++ void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) {
++ S_IN pipe1 = (S_IN) OpTestCase.chain(data.parallelStream(),
++ new FlagDeclaringOp(StreamOpFlag.NOT_SIZED, data.getShape()));
++ m.apply(pipe1).forEach(e -> {
++ synchronized (data) {
++ b.accept(e);
++ }
++ });
++ }
++ },
+ ;
+
+- private boolean isParallel;
++ // The set of scenarios that clean the SIZED flag
++ public static final Set<StreamTestScenario> CLEAR_SIZED_SCENARIOS = Collections.unmodifiableSet(
++ EnumSet.of(PAR_STREAM_TO_ARRAY_CLEAR_SIZED, PAR_STREAM_FOR_EACH_CLEAR_SIZED));
++
++ private final boolean isParallel;
++
++ private final boolean isOrdered;
+
+ StreamTestScenario(boolean isParallel) {
++ this(isParallel, true);
++ }
++
++ StreamTestScenario(boolean isParallel, boolean isOrdered) {
+ this.isParallel = isParallel;
++ this.isOrdered = isOrdered;
+ }
+
+ public StreamShape getShape() {
+@@ -215,6 +255,10 @@
+ return isParallel;
+ }
+
++ public boolean isOrdered() {
++ return isOrdered;
++ }
++
+ public <T, U, S_IN extends BaseStream<T, S_IN>, S_OUT extends BaseStream<U, S_OUT>>
+ void run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, S_OUT> m) {
+ _run(data, b, (Function<S_IN, Stream<U>>) m);
+--- ./jdk/test/java/util/stream/boottest/java/util/stream/FlagOpTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/boottest/java/util/stream/FlagOpTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -112,7 +112,7 @@
+ FlagDeclaringOp[] opsArray = ops.toArray(new FlagDeclaringOp[ops.size()]);
+
+ withData(data).ops(opsArray).
+- without(StreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(StreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ exercise();
+ }
+
+@@ -152,7 +152,7 @@
+
+
+ withData(data).ops(opsArray).
+- without(StreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(StreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ exercise();
+ }
+
+@@ -185,7 +185,7 @@
+ IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]);
+
+ withData(data).ops(opsArray).
+- without(StreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(StreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ exercise();
+ }
+
+@@ -221,7 +221,7 @@
+ IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]);
+
+ withData(data).ops(opsArray).
+- without(StreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(StreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ exercise();
+ }
+
+--- ./jdk/test/java/util/stream/boottest/java/util/stream/UnorderedTest.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,265 +0,0 @@
+-/*
+- * Copyright (c) 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.
+- */
+-package java.util.stream;
+-
+-import org.testng.annotations.Test;
+-
+-import java.util.Arrays;
+-import java.util.List;
+-import java.util.function.BiConsumer;
+-import java.util.function.Function;
+-import java.util.function.UnaryOperator;
+-
+-@Test
+-public class UnorderedTest extends OpTestCase {
+-
+- @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+- public void testTerminalOps(String name, TestData<Integer, Stream<Integer>> data) {
+- testTerminal(data, s -> { s.forEach(x -> { }); return 0; });
+-
+- testTerminal(data, s -> s.findAny(), (a, b) -> assertEquals(a.isPresent(), b.isPresent()));
+-
+- testTerminal(data, s -> s.anyMatch(e -> true));
+- }
+-
+-
+- private <T, R> void testTerminal(TestData<T, Stream<T>> data, Function<Stream<T>, R> terminalF) {
+- testTerminal(data, terminalF, LambdaTestHelpers::assertContentsEqual);
+- }
+-
+- static class WrappingUnaryOperator<S> implements UnaryOperator<S> {
+-
+- final boolean isLimit;
+- final UnaryOperator<S> uo;
+-
+- WrappingUnaryOperator(UnaryOperator<S> uo) {
+- this(uo, false);
+- }
+-
+- WrappingUnaryOperator(UnaryOperator<S> uo, boolean isLimit) {
+- this.uo = uo;
+- this.isLimit = isLimit;
+- }
+-
+- @Override
+- public S apply(S s) {
+- return uo.apply(s);
+- }
+- }
+-
+- static <S> WrappingUnaryOperator<S> wrap(UnaryOperator<S> uo) {
+- return new WrappingUnaryOperator<>(uo);
+- }
+-
+- static <S> WrappingUnaryOperator<S> wrap(UnaryOperator<S> uo, boolean isLimit) {
+- return new WrappingUnaryOperator<>(uo, isLimit);
+- }
+-
+- @SuppressWarnings("rawtypes")
+- private List permutationOfFunctions =
+- LambdaTestHelpers.perm(Arrays.<WrappingUnaryOperator<Stream<Object>>>asList(
+- wrap(s -> s.sorted()),
+- wrap(s -> s.distinct()),
+- wrap(s -> s.limit(5), true)
+- ));
+-
+- @SuppressWarnings("unchecked")
+- private <T, R> void testTerminal(TestData<T, Stream<T>> data,
+- Function<Stream<T>, R> terminalF,
+- BiConsumer<R, R> equalityAsserter) {
+- testTerminal(data, terminalF, equalityAsserter, permutationOfFunctions, StreamShape.REFERENCE);
+- }
+-
+- //
+-
+- @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class)
+- public void testIntTerminalOps(String name, TestData.OfInt data) {
+- testIntTerminal(data, s -> { s.forEach(x -> { }); return 0; });
+- testIntTerminal(data, s -> s.findAny(), (a, b) -> assertEquals(a.isPresent(), b.isPresent()));
+- testIntTerminal(data, s -> s.anyMatch(e -> true));
+- }
+-
+-
+- private <T, R> void testIntTerminal(TestData.OfInt data, Function<IntStream, R> terminalF) {
+- testIntTerminal(data, terminalF, LambdaTestHelpers::assertContentsEqual);
+- }
+-
+- private List<List<WrappingUnaryOperator<IntStream>>> intPermutationOfFunctions =
+- LambdaTestHelpers.perm(Arrays.asList(
+- wrap(s -> s.sorted()),
+- wrap(s -> s.distinct()),
+- wrap(s -> s.limit(5), true)
+- ));
+-
+- private <R> void testIntTerminal(TestData.OfInt data,
+- Function<IntStream, R> terminalF,
+- BiConsumer<R, R> equalityAsserter) {
+- testTerminal(data, terminalF, equalityAsserter, intPermutationOfFunctions, StreamShape.INT_VALUE);
+- }
+-
+- //
+-
+- @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
+- public void testLongTerminalOps(String name, TestData.OfLong data) {
+- testLongTerminal(data, s -> { s.forEach(x -> { }); return 0; });
+- testLongTerminal(data, s -> s.findAny(), (a, b) -> assertEquals(a.isPresent(), b.isPresent()));
+- testLongTerminal(data, s -> s.anyMatch(e -> true));
+- }
+-
+-
+- private <T, R> void testLongTerminal(TestData.OfLong data, Function<LongStream, R> terminalF) {
+- testLongTerminal(data, terminalF, LambdaTestHelpers::assertContentsEqual);
+- }
+-
+- private List<List<WrappingUnaryOperator<LongStream>>> longPermutationOfFunctions =
+- LambdaTestHelpers.perm(Arrays.asList(
+- wrap(s -> s.sorted()),
+- wrap(s -> s.distinct()),
+- wrap(s -> s.limit(5), true)
+- ));
+-
+- private <R> void testLongTerminal(TestData.OfLong data,
+- Function<LongStream, R> terminalF,
+- BiConsumer<R, R> equalityAsserter) {
+- testTerminal(data, terminalF, equalityAsserter, longPermutationOfFunctions, StreamShape.LONG_VALUE);
+- }
+-
+- //
+-
+- @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
+- public void testDoubleTerminalOps(String name, TestData.OfDouble data) {
+- testDoubleTerminal(data, s -> { s.forEach(x -> { }); return 0; });
+- testDoubleTerminal(data, s -> s.findAny(), (a, b) -> assertEquals(a.isPresent(), b.isPresent()));
+- testDoubleTerminal(data, s -> s.anyMatch(e -> true));
+- }
+-
+-
+- private <T, R> void testDoubleTerminal(TestData.OfDouble data, Function<DoubleStream, R> terminalF) {
+- testDoubleTerminal(data, terminalF, LambdaTestHelpers::assertContentsEqual);
+- }
+-
+- private List<List<WrappingUnaryOperator<DoubleStream>>> doublePermutationOfFunctions =
+- LambdaTestHelpers.perm(Arrays.asList(
+- wrap(s -> s.sorted()),
+- wrap(s -> s.distinct()),
+- wrap(s -> s.limit(5), true)
+- ));
+-
+- private <R> void testDoubleTerminal(TestData.OfDouble data,
+- Function<DoubleStream, R> terminalF,
+- BiConsumer<R, R> equalityAsserter) {
+- testTerminal(data, terminalF, equalityAsserter, doublePermutationOfFunctions, StreamShape.DOUBLE_VALUE);
+- }
+-
+- //
+-
+- private <T, S extends BaseStream<T, S>, R> void testTerminal(TestData<T, S> data,
+- Function<S, R> terminalF,
+- BiConsumer<R, R> equalityAsserter,
+- List<List<WrappingUnaryOperator<S>>> pFunctions,
+- StreamShape shape) {
+- CheckClearOrderedOp<T> checkClearOrderedOp = new CheckClearOrderedOp<>(shape);
+- for (List<WrappingUnaryOperator<S>> f : pFunctions) {
+- @SuppressWarnings("unchecked")
+- UnaryOperator<S> fi = interpose(f, (S s) -> (S) chain(s, checkClearOrderedOp));
+- withData(data).
+- terminal(fi, terminalF).
+- equalator(equalityAsserter).
+- exercise();
+- }
+-
+- CheckSetOrderedOp<T> checkSetOrderedOp = new CheckSetOrderedOp<>(shape);
+- for (List<WrappingUnaryOperator<S>> f : pFunctions) {
+- @SuppressWarnings("unchecked")
+- UnaryOperator<S> fi = interpose(f, (S s) -> (S) chain(s, checkSetOrderedOp));
+- withData(data).
+- terminal(fi, s -> terminalF.apply(s.sequential())).
+- equalator(equalityAsserter).
+- exercise();
+- }
+- }
+-
+- static class CheckClearOrderedOp<T> implements StatelessTestOp<T, T> {
+- private final StreamShape shape;
+-
+- CheckClearOrderedOp(StreamShape shape) {
+- this.shape = shape;
+- }
+-
+- @Override
+- public StreamShape outputShape() {
+- return shape;
+- }
+-
+- @Override
+- public StreamShape inputShape() {
+- return shape;
+- }
+-
+- @Override
+- public Sink<T> opWrapSink(int flags, boolean parallel, Sink<T> sink) {
+- if (parallel) {
+- assertTrue(StreamOpFlag.ORDERED.isCleared(flags));
+- }
+-
+- return sink;
+- }
+- }
+-
+- static class CheckSetOrderedOp<T> extends CheckClearOrderedOp<T> {
+-
+- CheckSetOrderedOp(StreamShape shape) {
+- super(shape);
+- }
+-
+- @Override
+- public Sink<T> opWrapSink(int flags, boolean parallel, Sink<T> sink) {
+- assertTrue(StreamOpFlag.ORDERED.isKnown(flags) || StreamOpFlag.ORDERED.isPreserved(flags));
+-
+- return sink;
+- }
+- }
+-
+- private <T, S extends BaseStream<T, S>>
+- UnaryOperator<S> interpose(List<WrappingUnaryOperator<S>> fs, UnaryOperator<S> fi) {
+- int l = -1;
+- for (int i = 0; i < fs.size(); i++) {
+- if (fs.get(i).isLimit) {
+- l = i;
+- }
+- }
+-
+- final int lastLimitIndex = l;
+- return s -> {
+- if (lastLimitIndex == -1)
+- s = fi.apply(s);
+- for (int i = 0; i < fs.size(); i++) {
+- s = fs.get(i).apply(s);
+- if (i >= lastLimitIndex) {
+- s = fi.apply(s);
+- }
+- }
+- return s;
+- };
+- }
+-}
+--- ./jdk/test/java/util/stream/test/org/openjdk/tests/java/util/SplittableRandomTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/test/org/openjdk/tests/java/util/SplittableRandomTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -192,7 +192,7 @@
+ public void testInts(TestData.OfInt data, ResultAsserter<Iterable<Integer>> ra) {
+ withData(data).
+ stream(s -> s).
+- without(IntStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(IntStreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ resultAsserter(ra).
+ exercise();
+ }
+@@ -276,7 +276,7 @@
+ public void testLongs(TestData.OfLong data, ResultAsserter<Iterable<Long>> ra) {
+ withData(data).
+ stream(s -> s).
+- without(LongStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(LongStreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ resultAsserter(ra).
+ exercise();
+ }
+@@ -360,7 +360,7 @@
+ public void testDoubles(TestData.OfDouble data, ResultAsserter<Iterable<Double>> ra) {
+ withData(data).
+ stream(s -> s).
+- without(DoubleStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(DoubleStreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ resultAsserter(ra).
+ exercise();
+ }
+--- ./jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -32,7 +32,16 @@
+ import java.util.Spliterator;
+ import java.util.Spliterators;
+ import java.util.concurrent.ThreadLocalRandom;
+-import java.util.stream.*;
++import java.util.stream.CollectorOps;
++import java.util.stream.Collectors;
++import java.util.stream.DoubleStream;
++import java.util.stream.IntStream;
++import java.util.stream.LongStream;
++import java.util.stream.OpTestCase;
++import java.util.stream.Stream;
++import java.util.stream.StreamSupport;
++import java.util.stream.StreamTestDataProvider;
++import java.util.stream.TestData;
+
+ import static java.util.stream.LambdaTestHelpers.*;
+
+@@ -67,7 +76,12 @@
+
+ @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+ public void testOp(String name, TestData.OfRef<Integer> data) {
+- Collection<Integer> result = exerciseOpsInt(data, Stream::distinct, IntStream::distinct, LongStream::distinct, DoubleStream::distinct);
++ Collection<Integer> result = exerciseOpsInt(
++ data,
++ Stream::distinct,
++ IntStream::distinct,
++ LongStream::distinct,
++ DoubleStream::distinct);
+
+ assertUnique(result);
+ assertTrue((data.size() > 0) ? result.size() > 0 : result.size() == 0);
+@@ -127,10 +141,14 @@
+
+ @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+ public void testDistinctDistinct(String name, TestData.OfRef<Integer> data) {
+- Collection<Integer> result = withData(data)
+- .stream(s -> s.distinct().distinct(), new CollectorOps.TestParallelSizedOp<>())
+- .exercise();
+- assertUnique(result);
++ Collection<Integer> result = exerciseOpsInt(
++ data,
++ s -> s.distinct().distinct(),
++ s -> s.distinct().distinct(),
++ s -> s.distinct().distinct(),
++ s -> s.distinct().distinct());
++
++ assertUnique(result);
+ }
+
+ @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+@@ -152,4 +170,31 @@
+ assertUnique(result);
+ assertSorted(result);
+ }
++
++ @Test
++ public void testStable() {
++ // Create N instances of Integer all with the same value
++ List<Integer> input = IntStream.rangeClosed(0, 1000)
++ .mapToObj(i -> new Integer(1000)) // explicit construction
++ .collect(Collectors.toList());
++ Integer expectedElement = input.get(0);
++ TestData<Integer, Stream<Integer>> data = TestData.Factory.ofCollection(
++ "1000 instances of Integer with the same value", input);
++
++ withData(data)
++ .stream(Stream::distinct)
++ .resultAsserter((actual, expected, isOrdered, isParallel) -> {
++ List<Integer> l = new ArrayList<>();
++ actual.forEach(l::add);
++
++ // Assert stability
++ // The single result element should be equal in identity to
++ // the first input element
++ assertEquals(l.size(), 1);
++ assertEquals(System.identityHashCode(l.get(0)),
++ System.identityHashCode(expectedElement));
++
++ })
++ .exercise();
++ }
+ }
+--- ./jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -181,7 +181,7 @@
+ // slice implementations
+ withData(refLongs()).
+ stream(s -> fs.apply(s)).
+- without(StreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(StreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ exercise();
+ }
+
+@@ -192,7 +192,7 @@
+ // slice implementations
+ withData(ints()).
+ stream(s -> fs.apply(s)).
+- without(IntStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(IntStreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ exercise();
+ }
+
+@@ -203,7 +203,7 @@
+ // slice implementations
+ withData(longs()).
+ stream(s -> fs.apply(s)).
+- without(LongStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(LongStreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ exercise();
+ }
+
+@@ -214,7 +214,7 @@
+ // slice implementations
+ withData(doubles()).
+ stream(s -> fs.apply(s)).
+- without(DoubleStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED).
++ without(DoubleStreamTestScenario.CLEAR_SIZED_SCENARIOS).
+ exercise();
+ }
+
+--- ./jdk/test/java/util/zip/TestExtraTime.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/java/util/zip/TestExtraTime.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -23,7 +23,7 @@
+
+ /**
+ * @test
+- * @bug 4759491 6303183 7012868 8015666 8023713
++ * @bug 4759491 6303183 7012868 8015666 8023713 8068790 8074694 8076641
+ * @summary Test ZOS and ZIS timestamp in extra field correctly
+ */
+
+@@ -40,7 +40,6 @@
+ import java.util.zip.ZipInputStream;
+ import java.util.zip.ZipOutputStream;
+
+-
+ public class TestExtraTime {
+
+ public static void main(String[] args) throws Throwable{
+@@ -69,6 +68,10 @@
+ test(mtime, atime, ctime, tz, extra);
+ }
+ }
++
++ testNullHandling();
++ testTagOnlyHandling();
++ testTimeConversions();
+ }
+
+ static void test(FileTime mtime, FileTime atime, FileTime ctime,
+@@ -154,4 +157,93 @@
+ }
+ }
+ }
++
++ static void testNullHandling() {
++ ZipEntry ze = new ZipEntry("TestExtraTime.java");
++ try {
++ ze.setLastAccessTime(null);
++ throw new RuntimeException("setLastAccessTime(null) should throw NPE");
++ } catch (NullPointerException ignored) {
++ // pass
++ }
++ try {
++ ze.setCreationTime(null);
++ throw new RuntimeException("setCreationTime(null) should throw NPE");
++ } catch (NullPointerException ignored) {
++ // pass
++ }
++ try {
++ ze.setLastModifiedTime(null);
++ throw new RuntimeException("setLastModifiedTime(null) should throw NPE");
++ } catch (NullPointerException ignored) {
++ // pass
++ }
++ }
++
++ // verify that setting and getting any time is possible as per the intent
++ // of 4759491
++ static void testTimeConversions() {
++ // Sample across the entire range
++ long step = Long.MAX_VALUE / 100L;
++ testTimeConversions(Long.MIN_VALUE, Long.MAX_VALUE - step, step);
++
++ // Samples through the near future
++ long currentTime = System.currentTimeMillis();
++ testTimeConversions(currentTime, currentTime + 1_000_000, 10_000);
++ }
++
++ static void testTimeConversions(long from, long to, long step) {
++ ZipEntry ze = new ZipEntry("TestExtraTime.java");
++ for (long time = from; time <= to; time += step) {
++ ze.setTime(time);
++ FileTime lastModifiedTime = ze.getLastModifiedTime();
++ if (lastModifiedTime.toMillis() != time) {
++ throw new RuntimeException("setTime should make getLastModifiedTime " +
++ "return the specified instant: " + time +
++ " got: " + lastModifiedTime.toMillis());
++ }
++ if (ze.getTime() != time) {
++ throw new RuntimeException("getTime after setTime, expected: " +
++ time + " got: " + ze.getTime());
++ }
++ }
++ }
++
++ static void check(ZipEntry ze, byte[] extra) {
++ if (extra != null) {
++ byte[] extra1 = ze.getExtra();
++ if (extra1 == null || extra1.length < extra.length ||
++ !Arrays.equals(Arrays.copyOfRange(extra1,
++ extra1.length - extra.length,
++ extra1.length),
++ extra)) {
++ throw new RuntimeException("Timestamp: storing extra field failed!");
++ }
++ }
++ }
++
++ static void testTagOnlyHandling() throws Throwable {
++ ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ byte[] extra = new byte[] { 0x0a, 0, 4, 0, 0, 0, 0, 0 };
++ try (ZipOutputStream zos = new ZipOutputStream(baos)) {
++ ZipEntry ze = new ZipEntry("TestExtraTime.java");
++ ze.setExtra(extra);
++ zos.putNextEntry(ze);
++ zos.write(new byte[] { 1,2 ,3, 4});
++ }
++ try (ZipInputStream zis = new ZipInputStream(
++ new ByteArrayInputStream(baos.toByteArray()))) {
++ ZipEntry ze = zis.getNextEntry();
++ check(ze, extra);
++ }
++ Path zpath = Paths.get(System.getProperty("test.dir", "."),
++ "TestExtraTime.zip");
++ Files.copy(new ByteArrayInputStream(baos.toByteArray()), zpath);
++ try (ZipFile zf = new ZipFile(zpath.toFile())) {
++ ZipEntry ze = zf.getEntry("TestExtraTime.java");
++ check(ze, extra);
++ } finally {
++ Files.delete(zpath);
++ }
++ }
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/accessibility/8069268/bug8069268.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,59 @@
++/*
++ * 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 8069268
++ @summary Tests that only one ContainerListener exists for AccessibleJComponent of JRootPane
++ @author Vivi An
++*/
++import javax.swing.*;
++import java.awt.event.*;
++import javax.accessibility.*;
++
++public class bug8069268{
++ public static void main(String[] args) throws Exception {
++ TestableRootPane rootPane = new TestableRootPane();
++
++ // Get accesibleContext and then AccessibleJComponent, call the function
++ // addPropertyChangeListener to trigger container listener to be added
++ AccessibleContext acc = rootPane.getAccessibleContext();
++ JComponent.AccessibleJComponent accJ = (JComponent.AccessibleJComponent) acc;
++ accJ.addPropertyChangeListener(null);
++
++ // Test how many container listener(s) exist(s), should only have 1
++ if (!rootPane.testContainerListener())
++ throw new RuntimeException("Failed test for bug 8069268");
++ }
++
++ private static class TestableRootPane extends JRootPane {
++ public boolean testContainerListener() {
++ boolean result = false;
++ ContainerListener[] listeners = getContainerListeners();
++ System.out.println("ContainerListener number is " + listeners.length);
++ result = (listeners.length == 1) ? true : false;
++ return result;
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/imageio/plugins/shared/CanWriteSequence.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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.
++ */
++
++import java.io.File;
++import java.io.FileOutputStream;
++import java.util.Iterator;
++
++import javax.imageio.ImageIO;
++import javax.imageio.ImageWriter;
++import javax.imageio.metadata.IIOMetadata;
++import javax.imageio.spi.IIORegistry;
++import javax.imageio.spi.ImageWriterSpi;
++import javax.imageio.stream.ImageOutputStream;
++
++/**
++ * @test
++ * @bug 4958064
++ * @author Sergey Bylokhov
++ */
++public final class CanWriteSequence {
++
++ public static void main(final String[] args) throws Exception {
++ final IIORegistry registry = IIORegistry.getDefaultInstance();
++ final Iterator<ImageWriterSpi> iter =
++ registry.getServiceProviders(ImageWriterSpi.class,
++ provider -> true, true);
++ // Validates all supported ImageWriters
++ while (iter.hasNext()) {
++ final ImageWriter writer = iter.next().createWriterInstance();
++ System.out.println("ImageWriter = " + writer);
++ test(writer);
++ }
++ System.out.println("Test passed");
++ }
++
++ private static void test(final ImageWriter writer) throws Exception {
++ final File file = File.createTempFile("temp", ".img");
++ file.deleteOnExit();
++ final FileOutputStream fos = new FileOutputStream(file);
++ final ImageOutputStream ios = ImageIO.createImageOutputStream(fos);
++ writer.setOutput(ios);
++ final IIOMetadata data = writer.getDefaultStreamMetadata(null);
++
++ if (writer.canWriteSequence()) {
++ writer.prepareWriteSequence(data);
++ } else {
++ try {
++ writer.prepareWriteSequence(data);
++ throw new RuntimeException(
++ "UnsupportedOperationException was not thrown");
++ } catch (final UnsupportedOperationException ignored) {
++ // expected
++ }
++ }
++ writer.dispose();
++ ios.close();
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/imageio/plugins/shared/WriteAfterAbort.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,212 @@
++/*
++ * 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.Color;
++import java.awt.Graphics2D;
++import java.awt.image.BufferedImage;
++import java.io.File;
++import java.io.FileNotFoundException;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.util.Iterator;
++
++import javax.imageio.ImageIO;
++import javax.imageio.ImageWriter;
++import javax.imageio.event.IIOWriteProgressListener;
++import javax.imageio.spi.IIORegistry;
++import javax.imageio.spi.ImageWriterSpi;
++import javax.imageio.stream.ImageOutputStream;
++
++import static java.awt.image.BufferedImage.TYPE_BYTE_BINARY;
++
++/**
++ * @test
++ * @bug 4952954
++ * @summary abortFlag must be cleared for every ImageWriter.write operation
++ * @author Sergey Bylokhov
++ */
++public final class WriteAfterAbort implements IIOWriteProgressListener {
++
++ private volatile boolean abortFlag = true;
++ private volatile boolean isAbortCalled;
++ private volatile boolean isCompleteCalled;
++ private volatile boolean isProgressCalled;
++ private volatile boolean isStartedCalled;
++ private static final int WIDTH = 100;
++ private static final int HEIGHT = 100;
++
++ private void test(final ImageWriter writer) throws IOException {
++ // Image initialization
++ final BufferedImage imageWrite = new BufferedImage(WIDTH, HEIGHT,
++ TYPE_BYTE_BINARY);
++ final Graphics2D g = imageWrite.createGraphics();
++ g.setColor(Color.WHITE);
++ g.fillRect(0, 0, WIDTH, HEIGHT);
++ g.dispose();
++
++ // File initialization
++ final File file = File.createTempFile("temp", ".img");
++ file.deleteOnExit();
++ final FileOutputStream fos = new SkipWriteOnAbortOutputStream(file);
++ final ImageOutputStream ios = ImageIO.createImageOutputStream(fos);
++ writer.setOutput(ios);
++ writer.addIIOWriteProgressListener(this);
++
++ // This write will be aborted, and file will not be touched
++ writer.write(imageWrite);
++ if (!isStartedCalled) {
++ throw new RuntimeException("Started should be called");
++ }
++ if (!isProgressCalled) {
++ throw new RuntimeException("Progress should be called");
++ }
++ if (!isAbortCalled) {
++ throw new RuntimeException("Abort should be called");
++ }
++ if (isCompleteCalled) {
++ throw new RuntimeException("Complete should not be called");
++ }
++ // Flush aborted data
++ ios.flush();
++
++ // This write should be completed successfully and the file should
++ // contain correct image data.
++ abortFlag = false;
++ isAbortCalled = false;
++ isCompleteCalled = false;
++ isProgressCalled = false;
++ isStartedCalled = false;
++ writer.write(imageWrite);
++
++ if (!isStartedCalled) {
++ throw new RuntimeException("Started should be called");
++ }
++ if (!isProgressCalled) {
++ throw new RuntimeException("Progress should be called");
++ }
++ if (isAbortCalled) {
++ throw new RuntimeException("Abort should not be called");
++ }
++ if (!isCompleteCalled) {
++ throw new RuntimeException("Complete should be called");
++ }
++ writer.dispose();
++ ios.close();
++
++ // Validates content of the file.
++ final BufferedImage imageRead = ImageIO.read(file);
++ for (int x = 0; x < WIDTH; ++x) {
++ for (int y = 0; y < HEIGHT; ++y) {
++ if (imageRead.getRGB(x, y) != imageWrite.getRGB(x, y)) {
++ throw new RuntimeException("Test failed.");
++ }
++ }
++ }
++ }
++
++ public static void main(final String[] args) throws IOException {
++ final IIORegistry registry = IIORegistry.getDefaultInstance();
++ final Iterator<ImageWriterSpi> iter = registry.getServiceProviders(
++ ImageWriterSpi.class, provider -> true, true);
++
++ // Validates all supported ImageWriters
++ while (iter.hasNext()) {
++ final WriteAfterAbort writeAfterAbort = new WriteAfterAbort();
++ final ImageWriter writer = iter.next().createWriterInstance();
++ System.out.println("ImageWriter = " + writer);
++ writeAfterAbort.test(writer);
++ }
++ System.out.println("Test passed");
++ }
++
++ // Callbacks
++
++ @Override
++ public void imageComplete(ImageWriter source) {
++ isCompleteCalled = true;
++ }
++
++ @Override
++ public void imageProgress(ImageWriter source, float percentageDone) {
++ isProgressCalled = true;
++ if (percentageDone > 50 && abortFlag) {
++ source.abort();
++ }
++ }
++
++ @Override
++ public void imageStarted(ImageWriter source, int imageIndex) {
++ isStartedCalled = true;
++ }
++
++ @Override
++ public void writeAborted(final ImageWriter source) {
++ isAbortCalled = true;
++ }
++
++ @Override
++ public void thumbnailComplete(ImageWriter source) {
++ }
++
++ @Override
++ public void thumbnailProgress(ImageWriter source, float percentageDone) {
++ }
++
++ @Override
++ public void thumbnailStarted(ImageWriter source, int imageIndex,
++ int thumbnailIndex) {
++ }
++
++ /**
++ * We need to skip writes on abort, because content of the file after abort
++ * is undefined.
++ */
++ private class SkipWriteOnAbortOutputStream extends FileOutputStream {
++
++ SkipWriteOnAbortOutputStream(File file) throws FileNotFoundException {
++ super(file);
++ }
++
++ @Override
++ public void write(int b) throws IOException {
++ if (!abortFlag) {
++ super.write(b);
++ }
++ }
++
++ @Override
++ public void write(byte[] b) throws IOException {
++ if (!abortFlag) {
++ super.write(b);
++ }
++ }
++
++ @Override
++ public void write(byte[] b, int off, int len) throws IOException {
++ if (!abortFlag) {
++ super.write(b, off, len);
++ }
++ }
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/imageio/stream/ShortStreamTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,127 @@
++/*
++ * 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 8074954
++ * @summary Test verifies that an IOException is triggered if input stream
++ * does not contain enough data to read a multi-byte type.
++ *
++ * @run main ShortStreamTest
++ */
++
++import javax.imageio.ImageIO;
++import javax.imageio.stream.ImageInputStream;
++import java.io.ByteArrayInputStream;
++import java.io.IOException;
++
++public class ShortStreamTest {
++ public static void main(String[] args) throws IOException {
++ TestCase[] tests = createTests();
++
++ for (TestCase t : tests) {
++ t.test();
++ }
++ }
++
++ private static abstract class TestCase {
++ abstract void testRead(ImageInputStream iis) throws IOException;
++
++ public void test() {
++ boolean gotException = false;
++
++ ImageInputStream iis = createShortStream();
++
++ try {
++ testRead(iis);
++ } catch (IOException e) {
++ e.printStackTrace(System.out);
++ gotException = true;
++ }
++
++ if (!gotException) {
++ throw new RuntimeException("Test failed.");
++ }
++ System.out.println("Test PASSED");
++ }
++ }
++
++
++ private static ImageInputStream createShortStream() {
++ try {
++ byte[] integerTestArray = new byte[] { 80 };
++ ByteArrayInputStream bais = new ByteArrayInputStream(integerTestArray);
++
++ return ImageIO.createImageInputStream(bais);
++ } catch (IOException e) {
++ return null;
++ }
++ }
++
++ private static TestCase[] createTests() {
++ return new TestCase[]{
++ new TestCase() {
++ @Override
++ void testRead(ImageInputStream iis) throws IOException {
++ iis.readInt();
++ }
++ },
++ new TestCase() {
++ @Override
++ void testRead(ImageInputStream iis) throws IOException {
++ iis.readShort();
++ }
++ },
++ new TestCase() {
++ @Override
++ void testRead(ImageInputStream iis) throws IOException {
++ iis.readDouble();
++ }
++ },
++ new TestCase() {
++ @Override
++ void testRead(ImageInputStream iis) throws IOException {
++ iis.readFloat();
++ }
++ },
++ new TestCase() {
++ @Override
++ void testRead(ImageInputStream iis) throws IOException {
++ iis.readLong();
++ }
++ },
++ new TestCase() {
++ @Override
++ void testRead(ImageInputStream iis) throws IOException {
++ iis.readUnsignedInt();
++ }
++ },
++ new TestCase() {
++ @Override
++ void testRead(ImageInputStream iis) throws IOException {
++ iis.readUnsignedShort();
++ }
++ }
++ };
++ }
++}
+--- ./jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -37,7 +37,6 @@
+
+ import java.lang.management.ManagementFactory;
+ import java.util.concurrent.atomic.AtomicInteger;
+-import javax.management.Attribute;
+ import javax.management.JMX;
+ import javax.management.MBeanServer;
+ import javax.management.Notification;
+@@ -95,18 +94,16 @@
+ monitorProxy.setInitThreshold(100);
+ monitorProxy.setGranularityPeriod(10L); // 10 ms
+ monitorProxy.setNotify(true);
++
++ final int initGetCount = observedProxy.getGetCount();
+ monitorProxy.start();
+
+- final int initGetCount = observedProxy.getGetCount();
+- int getCount = initGetCount;
+- for (int i = 0; i < 500; i++) { // 500 * 10 = 5 seconds
+- getCount = observedProxy.getGetCount();
+- if (getCount != initGetCount)
+- break;
+- Thread.sleep(10);
+- }
+- if (getCount <= initGetCount)
+- throw new Exception("Test failed: presumable deadlock");
++ System.out.println("Checking GetCount, possible deadlock if timeout.");
++ do { // 8038322. Until timeout of testing harness
++ Thread.sleep(200);
++ } while ((observedProxy.getGetCount()) == initGetCount);
++ System.out.println("Done!");
++
+ // This won't show up as a deadlock in CTRL-\ or in
+ // ThreadMXBean.findDeadlockedThreads(), because they don't
+ // see that thread A is waiting for thread B (B.join()), and
+@@ -131,10 +128,11 @@
+ };
+ mbs.addNotificationListener(monitorName, listener, null, null);
+ observedProxy.setThing(1000);
+- for (int i = 0; i < 500 && notifCount.get() == 0; i++)
+- Thread.sleep(10);
+- if (notifCount.get() == 0)
+- throw new Exception("Test failed: presumable deadlock");
++ System.out.println("Waiting notifCount.get() != 0, possible deadlock if timeout.");
++ do {
++ Thread.sleep(200);
++ } while(notifCount.get() == 0); // 8038322. Until timeout of testing harness
++ System.out.println("Done");
+ }
+
+ }
+--- ./jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2004, 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
+@@ -34,37 +34,31 @@
+ // java imports
+ //
+ import java.net.MalformedURLException;
+-import java.util.Map;
+-
+-// JMX imports
+-//
+-import javax.management.* ;
+-
+-import javax.management.remote.*;
++import javax.management.MBeanNotificationInfo;
++import javax.management.MBeanServer;
++import javax.management.MBeanServerConnection;
++import javax.management.MBeanServerFactory;
++import javax.management.Notification;
++import javax.management.NotificationBroadcasterSupport;
++import javax.management.NotificationListener;
++import javax.management.ObjectName;
++import javax.management.remote.JMXConnector;
++import javax.management.remote.JMXConnectorFactory;
++import javax.management.remote.JMXConnectorServer;
++import javax.management.remote.JMXConnectorServerFactory;
+ import javax.management.remote.JMXServiceURL;
+
+ public class NotSerializableNotifTest {
+ private static final MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer();
+ private static ObjectName emitter;
+- private static int port = 2468;
+
+ private static String[] protocols;
+
+ private static final int sentNotifs = 10;
+
+- private static double timeoutFactor = 1.0;
+- private static final double defaultTimeout = 10;
+-
+ public static void main(String[] args) throws Exception {
+ System.out.println(">>> Test to send a not serializable notification");
+
+- String timeoutVal = System.getProperty("test.timeout.factor");
+- if (timeoutVal != null) {
+- timeoutFactor = Double.parseDouble(
+- System.getProperty("test.timeout.factor")
+- );
+- }
+-
+ // IIOP fails on JDK1.4, see 5034318
+ final String v = System.getProperty("java.version");
+ float f = Float.parseFloat(v.substring(0, 3));
+@@ -77,35 +71,18 @@
+ emitter = new ObjectName("Default:name=NotificationEmitter");
+ mbeanServer.registerMBean(new NotificationEmitter(), emitter);
+
+- boolean ok = true;
+ for (int i = 0; i < protocols.length; i++) {
+- try {
+- if (!test(protocols[i])) {
+- System.out.println(">>> Test failed for " + protocols[i]);
+- ok = false;
+- } else {
+- System.out.println(">>> Test successed for " + protocols[i]);
+- }
+- } catch (Exception e) {
+- System.out.println(">>> Test failed for " + protocols[i]);
+- e.printStackTrace(System.out);
+- ok = false;
+- }
++ test(protocols[i]);
+ }
+
+- if (ok) {
+- System.out.println(">>> Test passed");
+- } else {
+- System.out.println(">>> TEST FAILED");
+- System.exit(1);
+- }
++ System.out.println(">>> Test passed");
+ }
+
+
+- private static boolean test(String proto) throws Exception {
++ private static void test(String proto) throws Exception {
+ System.out.println("\n>>> Test for protocol " + proto);
+
+- JMXServiceURL url = new JMXServiceURL(proto, null, port++);
++ JMXServiceURL url = new JMXServiceURL(proto, null, 0);
+
+ System.out.println(">>> Create a server: "+url);
+
+@@ -115,7 +92,7 @@
+ } catch (MalformedURLException e) {
+ System.out.println("System does not recognize URL: " + url +
+ "; ignoring");
+- return true;
++ return;
+ }
+
+ server.start();
+@@ -146,34 +123,17 @@
+
+ // waiting ...
+ synchronized (listener) {
+- int top = (int)Math.ceil(timeoutFactor * defaultTimeout);
+- for (int i=0; i<top; i++) {
+- if (listener.received() < sentNotifs) {
+- listener.wait(1000);
+- } else {
+- break;
+- }
++ while (listener.received() < sentNotifs) {
++ listener.wait(); // either pass or test timeout (killed by test harness)
++
+ }
+ }
+
+- // check
+- boolean ok = true;
+-
+- if (listener.received() != sentNotifs) {
+- System.out.println("Failed: received "+listener.received()+
+- " but should be "+sentNotifs);
+- ok = false;
+- } else {
+- System.out.println("The client received all notifications.");
+- }
+-
+ // clean
+ client.removeNotificationListener(emitter, listener);
+
+ conn.close();
+ server.stop();
+-
+- return ok;
+ }
+
+ //--------------------------
+--- ./jdk/test/javax/management/remote/mandatory/notif/NotificationAccessControllerTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/javax/management/remote/mandatory/notif/NotificationAccessControllerTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2005, 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
+@@ -37,6 +37,8 @@
+ import java.util.HashMap;
+ import java.util.List;
+ import java.util.Map;
++import java.util.concurrent.CopyOnWriteArrayList;
++import java.util.concurrent.Semaphore;
+ import javax.management.MBeanServer;
+ import javax.management.MBeanServerConnection;
+ import javax.management.MBeanServerFactory;
+@@ -56,10 +58,12 @@
+ public class NotificationAccessControllerTest {
+
+ public class NAC implements NotificationAccessController {
+- private boolean throwException;
++ private final boolean throwException;
+ public NAC(boolean throwException) {
+ this.throwException = throwException;
+ }
++
++ @Override
+ public void addNotificationListener(
+ String connectionId,
+ ObjectName name,
+@@ -73,9 +77,13 @@
+ if (throwException)
+ if (name.getCanonicalName().equals("domain:name=1,type=NB")
+ &&
++ subject != null
++ &&
+ subject.getPrincipals().contains(new JMXPrincipal("role")))
+ throw new SecurityException();
+ }
++
++ @Override
+ public void removeNotificationListener(
+ String connectionId,
+ ObjectName name,
+@@ -89,9 +97,13 @@
+ if (throwException)
+ if (name.getCanonicalName().equals("domain:name=2,type=NB")
+ &&
++ subject != null
++ &&
+ subject.getPrincipals().contains(new JMXPrincipal("role")))
+ throw new SecurityException();
+ }
++
++ @Override
+ public void fetchNotification(
+ String connectionId,
+ ObjectName name,
+@@ -105,13 +117,17 @@
+ echo("\tsubject: " +
+ (subject == null ? null : subject.getPrincipals()));
+ if (!throwException)
+- if (name.getCanonicalName().equals("domain:name=2,type=NB") &&
++ if (name.getCanonicalName().equals("domain:name=2,type=NB")
++ &&
++ subject != null
++ &&
+ subject.getPrincipals().contains(new JMXPrincipal("role")))
+ throw new SecurityException();
+ }
+ }
+
+ public class CustomJMXAuthenticator implements JMXAuthenticator {
++ @Override
+ public Subject authenticate(Object credentials) {
+ String role = ((String[]) credentials)[0];
+ echo("\nCreate principal with name = " + role);
+@@ -129,6 +145,7 @@
+ public static class NB
+ extends NotificationBroadcasterSupport
+ implements NBMBean {
++ @Override
+ public void emitNotification(int seqnum, ObjectName name) {
+ if (name == null) {
+ sendNotification(new Notification("nb", this, seqnum));
+@@ -139,13 +156,20 @@
+ }
+
+ public class Listener implements NotificationListener {
+- public List<Notification> notifs = new ArrayList<Notification>();
++ public final List<Notification> notifs = new CopyOnWriteArrayList<>();
++
++ private final Semaphore s;
++ public Listener(Semaphore s) {
++ this.s = s;
++ }
++ @Override
+ public void handleNotification(Notification n, Object h) {
+ echo("handleNotification:");
+ echo("\tNotification = " + n);
+ echo("\tNotification.SeqNum = " + n.getSequenceNumber());
+ echo("\tHandback = " + h);
+ notifs.add(n);
++ s.release();
+ }
+ }
+
+@@ -192,6 +216,17 @@
+ JMXConnectorServer server = null;
+ JMXConnector client = null;
+
++ /*
++ * (!enableChecks)
++ * - List must contain three notifs from sources nb1, nb2 and nb3
++ * (enableChecks && !throwException)
++ * - List must contain one notif from source nb1
++ * (enableChecks && throwException)
++ * - List must contain two notifs from sources nb2 and nb3
++ */
++ final int expected_notifs =
++ (!enableChecks ? 3 : (throwException ? 2 : 1));
++
+ // Create a new MBeanServer
+ //
+ final MBeanServer mbs = MBeanServerFactory.createMBeanServer();
+@@ -199,7 +234,7 @@
+ try {
+ // Create server environment map
+ //
+- final Map<String,Object> env = new HashMap<String,Object>();
++ final Map<String,Object> env = new HashMap<>();
+ env.put("jmx.remote.authenticator", new CustomJMXAuthenticator());
+ if (enableChecks) {
+ env.put("com.sun.jmx.remote.notification.access.controller",
+@@ -222,7 +257,7 @@
+
+ // Create server environment map
+ //
+- final Map<String,Object> cenv = new HashMap<String,Object>();
++ final Map<String,Object> cenv = new HashMap<>();
+ String[] credentials = new String[] { "role" , "password" };
+ cenv.put("jmx.remote.credentials", credentials);
+
+@@ -246,7 +281,9 @@
+
+ // Add notification listener
+ //
+- Listener li = new Listener();
++ Semaphore s = new Semaphore(0);
++
++ Listener li = new Listener(s);
+ try {
+ mbsc.addNotificationListener(nb1, li, null, null);
+ if (enableChecks && throwException) {
+@@ -263,6 +300,9 @@
+ }
+ mbsc.addNotificationListener(nb2, li, null, null);
+
++ System.out.println("\n+++ Expecting to receive " + expected_notifs +
++ " notification" + (expected_notifs > 1 ? "s" : "") +
++ " +++");
+ // Invoke the "sendNotification" method
+ //
+ mbsc.invoke(nb1, "emitNotification",
+@@ -277,7 +317,7 @@
+
+ // Wait for notifications to be emitted
+ //
+- Thread.sleep(2000);
++ s.acquire(expected_notifs);
+
+ // Remove notification listener
+ //
+@@ -303,21 +343,7 @@
+ sources.add(nb1);
+ sources.add(nb2);
+ sources.add(nb3);
+- if (!enableChecks) {
+- // List must contain three notifs from sources nb1, nb2 and nb3
+- //
+- result = checkNotifs(3, li.notifs, sources);
+- }
+- if (enableChecks && !throwException) {
+- // List must contain one notif from source nb1
+- //
+- result = checkNotifs(1, li.notifs, sources);
+- }
+- if (enableChecks && throwException) {
+- // List must contain two notifs from sources nb2 and nb3
+- //
+- result = checkNotifs(2, li.notifs, sources);
+- }
++ result = checkNotifs(expected_notifs, li.notifs, sources);
+ if (result > 0) {
+ return result;
+ }
+--- ./jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -24,7 +24,8 @@
+ /*
+ * @test
+ * @bug 6239400
+- * @summary Tests NotificationBuffer doesn't hold locks when adding listeners.
++ * @summary Tests NotificationBuffer doesn't hold locks when adding listeners,
++ * if test times out then deadlock is suspected.
+ * @author Eamonn McManus
+ * @run clean NotificationBufferDeadlockTest
+ * @run build NotificationBufferDeadlockTest
+@@ -38,6 +39,7 @@
+ import java.util.List;
+ import java.util.Set;
+ import java.util.Vector;
++import java.util.concurrent.CountDownLatch;
+ import javax.management.*;
+ import javax.management.remote.*;
+
+@@ -173,9 +175,7 @@
+ for (ObjectName name : names)
+ mbsc.invoke(name, "send", null, null);
+
+- if (!countListener.waiting(MAX_WAITING_TIME)) {
+- return "did not get " + names.size() + " notifs as expected\n";
+- }
++ countListener.waiting();
+
+ if (!sources.containsAll(names))
+ return "missing names: " + sources;
+@@ -202,13 +202,13 @@
+ }
+ };
+ t.start();
++ System.out.println("DeadlockTest-addNotificationListener waiting for the sending thread to die...");
+ try {
+- t.join(5000L);
++ t.join(); //if times out here then deadlock is suspected
++ System.out.println("DeadlockTest-addNotificationListener OK.");
+ } catch (Exception e) {
+ thisFailure = "Join exception: " + e;
+ }
+- if (t.isAlive())
+- thisFailure = "Deadlock detected";
+ }
+
+ public void send() {
+@@ -244,9 +244,9 @@
+ }
+ };
+ t.start();
+- t.join(5000);
+- if (t.isAlive())
+- failure = "Query deadlock detected";
++ System.out.println("CreateDuringQueryInvocationHandler-createMBeanIfQuery waiting for the creating thread to die...");
++ t.join(); // if times out here then deadlock is suspected
++ System.out.println("CreateDuringQueryInvocationHandler-createMBeanIfQuery OK");
+ }
+ }
+
+@@ -264,50 +264,30 @@
+
+ private static class MyListener implements NotificationListener {
+ public MyListener(int waitNB) {
+- this.waitNB= waitNB;
++ count = new CountDownLatch(waitNB);
+ }
+
+ public void handleNotification(Notification n, Object h) {
+- System.out.println("MyListener got: "+n.getSource()+" "+n.getType());
++ System.out.println("MyListener got: " + n.getSource() + " " + n.getType());
+
+- synchronized(this) {
+- if (TESTING_TYPE.equals(n.getType())) {
+- sources.add((ObjectName) n.getSource());
+-
+- if (sources.size() == waitNB) {
+- this.notifyAll();
+- }
+- }
++ if (TESTING_TYPE.equals(n.getType())) {
++ sources.add((ObjectName) n.getSource());
++ count.countDown();
+ }
+ }
+
+- public boolean waiting(long timeout) {
+- final long startTime = System.currentTimeMillis();
+- long toWait = timeout;
+-
+- synchronized(this) {
+- while(sources.size() < waitNB && toWait > 0) {
+- try {
+- this.wait(toWait);
+- } catch (InterruptedException ire) {
+- break;
+- }
+-
+- toWait = timeout -
+- (System.currentTimeMillis() - startTime);
+- }
+- }
+-
+- return sources.size() == waitNB;
++ public void waiting() throws InterruptedException {
++ System.out.println("MyListener-waiting ...");
++ count.await(); // if times out here then deadlock is suspected
++ System.out.println("MyListener-waiting done!");
+ }
+
+- private final int waitNB;
++ private final CountDownLatch count;
+ }
+
+ static String thisFailure;
+ static String failure;
+ static int nextNameIndex;
+- static final long MAX_WAITING_TIME = 10000;
+
+ private static MyListener countListener;
+ private static final List<ObjectName> sources = new Vector();
+--- ./jdk/test/javax/management/standardmbean/DeadlockTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/javax/management/standardmbean/DeadlockTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2005, 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
+@@ -24,7 +24,7 @@
+ /*
+ * @test
+ * @bug 6331746
+- * @summary Deadlock on synchronization problem
++ * @summary Test a deadlock and will be blocked forever if the deadlock is present.
+ * @author Shanliang JIANG
+ * @run main DeadlockTest
+ */
+@@ -55,43 +55,25 @@
+ BadBoy bb = new BadBoy(dt);
+ bb.start();
+
+- final long timeout = 2000;
+- long stopTime = System.currentTimeMillis() + timeout;
+- long timeToWait = timeout;
+ synchronized(bb) {
+- while(!bb.gotLock || timeToWait > 0) {
+- bb.wait(timeToWait);
+-
+- timeToWait = stopTime - System.currentTimeMillis();
++ while(!bb.gotLock) {
++ bb.wait(); // if blocked here, means failing to get lock, impossible.
+ }
+ }
+
+- if (!bb.gotLock) {
+- throw new RuntimeException("Failed to get lock, impossible!");
+- }
+-
+ System.out.println("main: The BadBay is holding the lock forever.");
+
+ System.out.println("main: Create a WorkingBoy to see blocking ...");
+ WorkingBoy wb = new WorkingBoy(dt);
+
+- stopTime = System.currentTimeMillis() + timeout;
+- timeToWait = timeout;
+-
+ synchronized(wb) {
+ wb.start();
+
+- while(!wb.done || timeToWait > 0) {
+- wb.wait(timeToWait);
+-
+- timeToWait = stopTime - System.currentTimeMillis();
++ while(!wb.done) {
++ wb.wait(); // if blocked here, the deadlock happends
+ }
+ }
+
+- if (!wb.done) {
+- throw new RuntimeException("It is blocked!");
+- }
+-
+ System.out.println("main: OK, bye bye.");
+ }
+
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/net/ssl/ciphersuites/DisabledAlgorithms.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,372 @@
++/*
++ * 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.BufferedOutputStream;
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.security.NoSuchAlgorithmException;
++import java.security.Security;
++import java.util.concurrent.TimeUnit;
++import javax.net.ssl.SSLContext;
++import javax.net.ssl.SSLHandshakeException;
++import javax.net.ssl.SSLServerSocket;
++import javax.net.ssl.SSLServerSocketFactory;
++import javax.net.ssl.SSLSocket;
++import javax.net.ssl.SSLSocketFactory;
++
++/**
++ * @test
++ * @bug 8076221
++ * @summary Check if weak cipher suites are disabled
++ * @run main/othervm DisabledAlgorithms default
++ * @run main/othervm DisabledAlgorithms empty
++ */
++public class DisabledAlgorithms {
++
++ private static final String pathToStores =
++ "../../../../sun/security/ssl/etc";
++ private static final String keyStoreFile = "keystore";
++ private static final String trustStoreFile = "truststore";
++ private static final String passwd = "passphrase";
++
++ private static final String keyFilename =
++ System.getProperty("test.src", "./") + "/" + pathToStores +
++ "/" + keyStoreFile;
++
++ private static final String trustFilename =
++ System.getProperty("test.src", "./") + "/" + pathToStores +
++ "/" + trustStoreFile;
++
++ // supported RC4 cipher suites
++ // it does not contain KRB5 cipher suites because they need a KDC
++ private static final String[] rc4_ciphersuites = new String[] {
++ "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
++ "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
++ "SSL_RSA_WITH_RC4_128_SHA",
++ "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
++ "TLS_ECDH_RSA_WITH_RC4_128_SHA",
++ "SSL_RSA_WITH_RC4_128_MD5",
++ "TLS_ECDH_anon_WITH_RC4_128_SHA",
++ "SSL_DH_anon_WITH_RC4_128_MD5"
++ };
++
++ public static void main(String[] args) throws Exception {
++ if (args.length < 1) {
++ throw new RuntimeException("No parameters specified");
++ }
++
++ System.setProperty("javax.net.ssl.keyStore", keyFilename);
++ System.setProperty("javax.net.ssl.keyStorePassword", passwd);
++ System.setProperty("javax.net.ssl.trustStore", trustFilename);
++ System.setProperty("javax.net.ssl.trustStorePassword", passwd);
++
++ switch (args[0]) {
++ case "default":
++ // use default jdk.tls.disabledAlgorithms
++ System.out.println("jdk.tls.disabledAlgorithms = "
++ + Security.getProperty("jdk.tls.disabledAlgorithms"));
++
++ // check if RC4 cipher suites can't be used by default
++ checkFailure(rc4_ciphersuites);
++ break;
++ case "empty":
++ // reset jdk.tls.disabledAlgorithms
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
++ System.out.println("jdk.tls.disabledAlgorithms = "
++ + Security.getProperty("jdk.tls.disabledAlgorithms"));
++
++ // check if RC4 cipher suites can be used
++ // if jdk.tls.disabledAlgorithms is empty
++ checkSuccess(rc4_ciphersuites);
++ break;
++ default:
++ throw new RuntimeException("Wrong parameter: " + args[0]);
++ }
++
++ System.out.println("Test passed");
++ }
++
++ /*
++ * Checks if that specified cipher suites cannot be used.
++ */
++ private static void checkFailure(String[] ciphersuites) throws Exception {
++ try (SSLServer server = SSLServer.init(ciphersuites)) {
++ startNewThread(server);
++ while (!server.isRunning()) {
++ sleep();
++ }
++
++ int port = server.getPort();
++ for (String ciphersuite : ciphersuites) {
++ try (SSLClient client = SSLClient.init(port, ciphersuite)) {
++ client.connect();
++ throw new RuntimeException("Expected SSLHandshakeException "
++ + "not thrown");
++ } catch (SSLHandshakeException e) {
++ System.out.println("Expected exception on client side: "
++ + e);
++ }
++ }
++
++ while (server.isRunning()) {
++ sleep();
++ }
++
++ if (!server.sslError()) {
++ throw new RuntimeException("Expected SSL exception "
++ + "not thrown on server side");
++ }
++ }
++
++ }
++
++ /*
++ * Checks if specified cipher suites can be used.
++ */
++ private static void checkSuccess(String[] ciphersuites) throws Exception {
++ try (SSLServer server = SSLServer.init(ciphersuites)) {
++ startNewThread(server);
++ while (!server.isRunning()) {
++ sleep();
++ }
++
++ int port = server.getPort();
++ for (String ciphersuite : ciphersuites) {
++ try (SSLClient client = SSLClient.init(port, ciphersuite)) {
++ client.connect();
++ String negotiated = client.getNegotiatedCipherSuite();
++ System.out.println("Negotiated cipher suite: "
++ + negotiated);
++ if (!negotiated.equals(ciphersuite)) {
++ throw new RuntimeException("Unexpected cipher suite: "
++ + negotiated);
++ }
++ }
++ }
++
++ server.stop();
++ while (server.isRunning()) {
++ sleep();
++ }
++
++ if (server.error()) {
++ throw new RuntimeException("Unexpected error on server side");
++ }
++ }
++
++ }
++
++ private static Thread startNewThread(SSLServer server) {
++ Thread serverThread = new Thread(server, "SSL server thread");
++ serverThread.setDaemon(true);
++ serverThread.start();
++ return serverThread;
++ }
++
++ private static void sleep() {
++ try {
++ TimeUnit.MILLISECONDS.sleep(50);
++ } catch (InterruptedException e) {
++ // do nothing
++ }
++ }
++
++ static class SSLServer implements Runnable, AutoCloseable {
++
++ private final SSLServerSocket ssocket;
++ private volatile boolean stopped = false;
++ private volatile boolean running = false;
++ private volatile boolean sslError = false;
++ private volatile boolean otherError = false;
++
++ private SSLServer(SSLServerSocket ssocket) {
++ this.ssocket = ssocket;
++ }
++
++ @Override
++ public void run() {
++ System.out.println("Server: started");
++ running = true;
++ while (!stopped) {
++ try (SSLSocket socket = (SSLSocket) ssocket.accept()) {
++ System.out.println("Server: accepted client connection");
++ InputStream in = socket.getInputStream();
++ OutputStream out = socket.getOutputStream();
++ int b = in.read();
++ if (b < 0) {
++ throw new IOException("Unexpected EOF");
++ }
++ System.out.println("Server: send data: " + b);
++ out.write(b);
++ out.flush();
++ socket.getSession().invalidate();
++ } catch (SSLHandshakeException e) {
++ System.out.println("Server: run: " + e);
++ sslError = true;
++ stopped = true;
++ } catch (IOException e) {
++ if (!stopped) {
++ System.out.println("Server: run: unexpected exception: "
++ + e);
++ e.printStackTrace();
++ otherError = true;
++ stopped = true;
++ } else {
++ System.out.println("Server: run: " + e);
++ System.out.println("The exception above occurred "
++ + "because socket was closed, "
++ + "please ignore it");
++ }
++ }
++ }
++
++ System.out.println("Server: finished");
++ running = false;
++ }
++
++ int getPort() {
++ return ssocket.getLocalPort();
++ }
++
++ String[] getEnabledCiperSuites() {
++ return ssocket.getEnabledCipherSuites();
++ }
++
++ boolean isRunning() {
++ return running;
++ }
++
++ boolean sslError() {
++ return sslError;
++ }
++
++ boolean error() {
++ return sslError || otherError;
++ }
++
++ void stop() {
++ stopped = true;
++ if (!ssocket.isClosed()) {
++ try {
++ System.out.println("Server: close socket");
++ ssocket.close();
++ } catch (IOException e) {
++ System.out.println("Server: close: " + e);
++ }
++ }
++ }
++
++ @Override
++ public void close() {
++ stop();
++ }
++
++ static SSLServer init(String[] ciphersuites)
++ throws IOException {
++ SSLServerSocketFactory ssf = (SSLServerSocketFactory)
++ SSLServerSocketFactory.getDefault();
++ SSLServerSocket ssocket = (SSLServerSocket)
++ ssf.createServerSocket(0);
++
++ if (ciphersuites != null) {
++ System.out.println("Server: enable cipher suites: "
++ + java.util.Arrays.toString(ciphersuites));
++ ssocket.setEnabledCipherSuites(ciphersuites);
++ }
++
++ return new SSLServer(ssocket);
++ }
++ }
++
++ static class SSLClient implements AutoCloseable {
++
++ private final SSLSocket socket;
++
++ private SSLClient(SSLSocket socket) {
++ this.socket = socket;
++ }
++
++ void connect() throws IOException {
++ System.out.println("Client: connect to server");
++ try (
++ BufferedInputStream bis = new BufferedInputStream(
++ socket.getInputStream());
++ BufferedOutputStream bos = new BufferedOutputStream(
++ socket.getOutputStream())) {
++ bos.write('x');
++ bos.flush();
++
++ int read = bis.read();
++ if (read < 0) {
++ throw new IOException("Client: couldn't read a response");
++ }
++ socket.getSession().invalidate();
++ }
++ }
++
++ String[] getEnabledCiperSuites() {
++ return socket.getEnabledCipherSuites();
++ }
++
++ String getNegotiatedCipherSuite() {
++ return socket.getSession().getCipherSuite();
++ }
++
++ @Override
++ public void close() throws Exception {
++ if (!socket.isClosed()) {
++ try {
++ socket.close();
++ } catch (IOException e) {
++ System.out.println("Client: close: " + e);
++ }
++ }
++ }
++
++ static SSLClient init(int port)
++ throws NoSuchAlgorithmException, IOException {
++ return init(port, null);
++ }
++
++ static SSLClient init(int port, String ciphersuite)
++ throws NoSuchAlgorithmException, IOException {
++ SSLContext context = SSLContext.getDefault();
++ SSLSocketFactory ssf = (SSLSocketFactory)
++ context.getSocketFactory();
++ SSLSocket socket = (SSLSocket) ssf.createSocket("localhost", port);
++
++ if (ciphersuite != null) {
++ System.out.println("Client: enable cipher suite: "
++ + ciphersuite);
++ socket.setEnabledCipherSuites(new String[] { ciphersuite });
++ }
++
++ return new SSLClient(socket);
++ }
++
++ }
++
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/print/PrintSEUmlauts/PrintSEUmlauts.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,120 @@
++/*
++ * Copyright (c) 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. 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.
++ */
++import java.awt.Graphics;
++import java.awt.GraphicsEnvironment;
++import java.awt.print.PageFormat;
++import java.awt.print.Printable;
++import java.io.File;
++import java.io.FileInputStream;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.nio.charset.StandardCharsets;
++import javax.print.DocFlavor;
++import javax.print.DocPrintJob;
++import javax.print.SimpleDoc;
++import javax.print.StreamPrintService;
++import javax.print.StreamPrintServiceFactory;
++import javax.print.attribute.HashDocAttributeSet;
++import javax.print.attribute.HashPrintRequestAttributeSet;
++import javax.print.event.PrintJobAdapter;
++import javax.print.event.PrintJobEvent;
++
++/*
++ * @test
++ * @bug 8067364
++ * @summary Printing to Postscript doesn't support dieresis
++ * @build PrintSEUmlauts
++ * @run main/othervm PrintSEUmlauts
++ */
++public class PrintSEUmlauts implements Printable {
++
++ public static void main(String[] args) throws Exception {
++
++ GraphicsEnvironment.getLocalGraphicsEnvironment();
++
++ DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
++ String mime = DocFlavor.BYTE_ARRAY.POSTSCRIPT.getMimeType();
++
++ StreamPrintServiceFactory[] factories =
++ StreamPrintServiceFactory.
++ lookupStreamPrintServiceFactories(flavor, mime);
++ if (factories.length == 0) {
++ System.out.println("No print service found.");
++ return;
++ }
++
++ FileOutputStream output = new FileOutputStream("out.ps");
++ StreamPrintService service = factories[0].getPrintService(output);
++
++ SimpleDoc doc =
++ new SimpleDoc(new PrintSEUmlauts(),
++ DocFlavor.SERVICE_FORMATTED.PRINTABLE,
++ new HashDocAttributeSet());
++ DocPrintJob job = service.createPrintJob();
++ job.addPrintJobListener(new PrintJobAdapter() {
++ @Override
++ public void printJobCompleted(PrintJobEvent pje) {
++ testPrintAndExit();
++ }
++ });
++
++ job.print(doc, new HashPrintRequestAttributeSet());
++ }
++
++ private static final boolean DEBUG = false;
++ private static void testPrintAndExit() {
++ String expected = "<e4> 7.44 100.0 100.0 S";
++ String content = "";
++
++ File file = new File("out.ps");
++ if (!DEBUG) {
++ file.deleteOnExit();
++ }
++
++ try (FileInputStream stream = new FileInputStream(file)) {
++ byte[] data = new byte[(int) file.length()];
++ stream.read(data);
++ content = new String(data, StandardCharsets.ISO_8859_1);
++ } catch (IOException ex) {
++ ex.printStackTrace();
++ }
++
++ if (!content.contains(expected)) {
++ System.err.println("FAIL");
++ if (DEBUG) {
++ System.err.println("printing content");
++ System.err.println(content);
++ }
++ throw new RuntimeException("Expected <e4> to represent 'ä' but not found!");
++ }
++ System.err.println("SUCCESS");
++ }
++
++ public int print(Graphics g, PageFormat pf, int pg) {
++ if (pg > 0) return NO_SUCH_PAGE;
++ g.drawString("ä", 100, 100);
++ return PAGE_EXISTS;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,143 @@
++/*
++ * 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 8068721
++ * @summary test RMI-IIOP call with ConcurrentHashMap as an argument
++ * @library /lib/testlibrary
++ * @build jdk.testlibrary.*
++ * @build Test HelloInterface HelloServer HelloClient HelloImpl _HelloImpl_Tie _HelloInterface_Stub ConcurrentHashMapTest
++ * @run main/othervm -Djava.naming.provider.url=iiop://localhost:1050 -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory ConcurrentHashMapTest
++ */
++
++
++import java.io.DataInputStream;
++import java.io.File;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.List;
++import java.util.concurrent.TimeUnit;
++import java.util.concurrent.CountDownLatch;
++import jdk.testlibrary.JDKToolFinder;
++import jdk.testlibrary.JDKToolLauncher;
++
++public class ConcurrentHashMapTest {
++
++ static final String ORBD = JDKToolFinder.getTestJDKTool("orbd");
++ static final String JAVA = JDKToolFinder.getTestJDKTool("java");
++ static final JDKToolLauncher orbdLauncher = JDKToolLauncher.createUsingTestJDK("orbd");
++ static final String CLASSPATH = System.getProperty("java.class.path");
++ static final int FIVE_SECONDS = 5000;
++
++ private static Exception clientException;
++ private static boolean exceptionInClient;
++ private static Process orbdProcess;
++ private static Process rmiServerProcess;
++
++ public static void main(String[] args) throws Exception {
++ startTestComponents();
++ stopTestComponents();
++ System.err.println("Test completed OK ");
++ }
++
++ static void startTestComponents () throws Exception {
++ startOrbd();
++ Thread.sleep(FIVE_SECONDS);
++ startRmiIiopServer();
++ Thread.sleep(FIVE_SECONDS);
++ executeRmiIiopClient();
++ }
++
++ private static void stopTestComponents() throws Exception {
++ stopRmiIiopServer();
++ stopOrbd();
++ if (exceptionInClient) {
++ throw new RuntimeException(clientException);
++ } else if (!isResponseReceived()) {
++ throw new RuntimeException("Expected Response not received");
++ }
++ }
++
++ static void startOrbd() throws Exception {
++ System.out.println("\nStarting orbd on port 1050 ");
++
++ //orbd -ORBInitialHost localhost -ORBInitialPort 1050
++ orbdLauncher.addToolArg("-ORBInitialHost").addToolArg("localhost")
++ .addToolArg("-ORBInitialPort").addToolArg("1050");
++
++ System.out.println("ConcurrentHashMapTest: Executing: " + Arrays.asList(orbdLauncher.getCommand()));
++ ProcessBuilder pb = new ProcessBuilder(orbdLauncher.getCommand());
++ pb.redirectError(ProcessBuilder.Redirect.INHERIT);
++ orbdProcess = pb.start();
++ }
++
++
++ static void startRmiIiopServer() throws Exception {
++ System.out.println("\nStarting RmiServer");
++ // java -cp .
++ // -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
++ // -Djava.naming.provider.url=iiop://localhost:1050 HelloServer
++ List<String> commands = new ArrayList<>();
++ commands.add(ConcurrentHashMapTest.JAVA);
++ commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory");
++ commands.add("-Djava.naming.provider.url=iiop://localhost:1050");
++ commands.add("-cp");
++ commands.add(ConcurrentHashMapTest.CLASSPATH);
++ commands.add("HelloServer");
++
++ System.out.println("ConcurrentHashMapTest: Executing: " + commands);
++ ProcessBuilder pb = new ProcessBuilder(commands);
++ pb.redirectError(ProcessBuilder.Redirect.INHERIT);
++ rmiServerProcess = pb.start();
++ }
++
++ static boolean isResponseReceived() {
++ return HelloClient.isResponseReceived();
++ }
++
++ static void stopRmiIiopServer() throws Exception {
++ rmiServerProcess.destroy();
++ rmiServerProcess.waitFor();
++ //rmiServerProcess.waitFor(30, TimeUnit.SECONDS);
++ System.out.println("serverProcess exitCode:"
++ + rmiServerProcess.exitValue());
++ }
++
++ static void stopOrbd() throws Exception {
++ orbdProcess.destroy();
++ orbdProcess.waitFor();
++ //orbdProcess.waitFor(30, TimeUnit.SECONDS);
++ System.out.println("orbd exitCode:"
++ + orbdProcess.exitValue());
++ }
++
++ static void executeRmiIiopClient() throws Exception {
++ try {
++ HelloClient.executeRmiClientCall();
++ } catch (Exception ex) {
++ clientException = ex;
++ exceptionInClient = true;
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/rmi/PortableRemoteObject/HelloClient.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,98 @@
++import java.rmi.RemoteException;
++import java.net.InetAddress;
++import java.net.MalformedURLException;
++import java.rmi.NotBoundException;
++import java.util.HashMap;
++import java.util.Vector;
++import java.util.concurrent.ConcurrentHashMap;
++import java.util.concurrent.locks.ReentrantLock;
++
++import javax.naming.NamingException;
++import javax.naming.InitialContext;
++import javax.naming.Context;
++import javax.naming.NameNotFoundException;
++import javax.naming.NamingException;
++import javax.rmi.PortableRemoteObject;
++
++import org.omg.CORBA.Any;
++import org.omg.CORBA.ORB;
++
++public class HelloClient implements Runnable {
++ static final int MAX_RETRY = 10;
++ static final int ONE_SECOND = 1000;
++ private static boolean responseReceived;
++
++ public static void main(String args[]) throws Exception {
++ executeRmiClientCall();
++ }
++
++ @Override
++ public void run() {
++ try {
++ executeRmiClientCall();
++ } catch (Exception e) {
++ e.printStackTrace();
++ throw new RuntimeException(e);
++ }
++ }
++
++
++ public static boolean isResponseReceived () {
++ return responseReceived;
++ }
++
++ public static void executeRmiClientCall() throws Exception {
++ Context ic;
++ Object objref;
++ HelloInterface helloSvc;
++ String response;
++ int retryCount = 0;
++
++ Test test = new Test();
++ System.out.println("HelloClient.main: enter ...");
++ while (retryCount < MAX_RETRY) {
++ try {
++ ic = new InitialContext();
++ System.out.println("HelloClient.main: HelloService lookup ...");
++ // STEP 1: Get the Object reference from the Name Service
++ // using JNDI call.
++ objref = ic.lookup("HelloService");
++ System.out.println("HelloClient: Obtained a ref. to Hello server.");
++
++ // STEP 2: Narrow the object reference to the concrete type and
++ // invoke the method.
++ helloSvc = (HelloInterface) PortableRemoteObject.narrow(objref,
++ HelloInterface.class);
++ System.out.println("HelloClient: Invoking on remote server with ConcurrentHashMap parameter");
++ ConcurrentHashMap <String, String> testConcurrentHashMap = new ConcurrentHashMap<String, String>();
++ response = helloSvc.sayHelloWithHashMap(testConcurrentHashMap);
++ System.out.println("HelloClient: Server says: " + response);
++ if (!response.contains("Hello with hashMapSize ==")) {
++ System.out.println("HelloClient: expected response not received");
++ throw new RuntimeException("Expected Response Hello with hashMapSize == 0 not received");
++ }
++ responseReceived = true;
++ break;
++ } catch (NameNotFoundException nnfEx) {
++ System.err.println("NameNotFoundException Caught .... try again");
++ retryCount++;
++ try {
++ Thread.sleep(ONE_SECOND);
++ } catch (InterruptedException e) {
++ e.printStackTrace();
++ }
++ continue;
++ } catch (Exception e) {
++ System.err.println("Exception " + e + "Caught");
++ e.printStackTrace();
++ throw new RuntimeException(e);
++ }
++ }
++ System.err.println("HelloClient terminating ");
++ try {
++ Thread.sleep(5000);
++ } catch (InterruptedException e) {
++ e.printStackTrace();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/rmi/PortableRemoteObject/HelloImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,60 @@
++import java.net.InetAddress;
++import java.rmi.RemoteException;
++import java.util.HashMap;
++import java.util.concurrent.ConcurrentHashMap;
++import java.util.concurrent.locks.ReentrantLock;
++
++import javax.rmi.PortableRemoteObject;
++
++public class HelloImpl extends PortableRemoteObject implements HelloInterface {
++ public HelloImpl() throws java.rmi.RemoteException {
++ super(); // invoke rmi linking and remote object initialization
++ }
++
++ public String sayHello(String from) throws java.rmi.RemoteException {
++ System.out.println("Hello from " + from + "!!");
++ System.out.flush();
++ String reply = "Hello from us to you " + from;
++ return reply;
++ }
++
++ @Override
++ public String sayHelloToTest(Test test) throws RemoteException {
++ return "Test says Hello";
++ }
++
++ @Override
++ public String sayHelloWithInetAddress(InetAddress ipAddr)
++ throws RemoteException {
++ String response = "Hello with InetAddress " + ipAddr.toString();
++ return response;
++ }
++
++ @Override
++ public String sayHelloWithHashMap(ConcurrentHashMap<String, String> receivedHashMap)
++ throws RemoteException {
++ int hashMapSize = 0;
++
++ hashMapSize = receivedHashMap.size();
++ String response = "Hello with hashMapSize == " + hashMapSize;
++ return response;
++ }
++
++ @Override
++ public String sayHelloWithHashMap2(HashMap<String, String> receivedHashMap)
++ throws RemoteException {
++ int hashMapSize = 0;
++
++ hashMapSize = receivedHashMap.size();
++ String response = "Hello with hashMapSize == " + hashMapSize;
++ return response;
++ }
++
++ @Override
++ public String sayHelloWithReentrantLock(ReentrantLock receivedLock)
++ throws RemoteException {
++
++ String response = "Hello with lock == " + receivedLock.isLocked();
++ return response;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/rmi/PortableRemoteObject/HelloInterface.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,14 @@
++import java.net.InetAddress;
++import java.rmi.Remote;
++import java.util.HashMap;
++import java.util.concurrent.ConcurrentHashMap;
++import java.util.concurrent.locks.ReentrantLock;
++
++public interface HelloInterface extends Remote {
++ public String sayHello( String from ) throws java.rmi.RemoteException;
++ public String sayHelloToTest( Test test ) throws java.rmi.RemoteException;
++ public String sayHelloWithInetAddress( InetAddress ipAddr ) throws java.rmi.RemoteException;
++ public String sayHelloWithHashMap(ConcurrentHashMap<String, String> hashMap ) throws java.rmi.RemoteException;
++ public String sayHelloWithHashMap2(HashMap<String, String> hashMap ) throws java.rmi.RemoteException;
++ public String sayHelloWithReentrantLock(ReentrantLock lock ) throws java.rmi.RemoteException;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/rmi/PortableRemoteObject/HelloServer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,36 @@
++import javax.naming.InitialContext;
++import javax.naming.Context;
++
++public class HelloServer {
++
++ static final int MAX_RETRY = 10;
++ static final int ONE_SECOND = 1000;
++
++ public static void main(String[] args) {
++ int retryCount = 0;
++ while (retryCount < MAX_RETRY) {
++ try {
++ //HelloServer.set("SETTING TEST ITL");
++ // Step 1: Instantiate the Hello servant
++ HelloImpl helloRef = new HelloImpl();
++
++ // Step 2: Publish the reference in the Naming Service
++ // using JNDI API
++ Context initialNamingContext = new InitialContext();
++ initialNamingContext.rebind("HelloService", helloRef);
++
++ System.out.println("Hello Server: Ready...");
++ break;
++ } catch (Exception e) {
++ System.out.println("Server initialization problem: " + e);
++ e.printStackTrace();
++ retryCount++;
++ try {
++ Thread.sleep(ONE_SECOND);
++ } catch (InterruptedException e1) {
++ e1.printStackTrace();
++ }
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/rmi/PortableRemoteObject/Test.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,6 @@
++import java.io.Serializable;
++
++
++public class Test implements Serializable {
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/rmi/PortableRemoteObject/_HelloImpl_Tie.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,128 @@
++// Tie class generated by rmic, do not edit.
++// Contents subject to change without notice.
++
++import java.io.Serializable;
++import java.net.InetAddress;
++import java.rmi.Remote;
++import java.rmi.RemoteException;
++import java.util.HashMap;
++import java.util.concurrent.ConcurrentHashMap;
++import java.util.concurrent.locks.ReentrantLock;
++import javax.rmi.CORBA.Tie;
++import javax.rmi.CORBA.Util;
++import org.omg.CORBA.BAD_OPERATION;
++import org.omg.CORBA.ORB;
++import org.omg.CORBA.SystemException;
++import org.omg.CORBA.portable.InputStream;
++import org.omg.CORBA.portable.OutputStream;
++import org.omg.CORBA.portable.ResponseHandler;
++import org.omg.CORBA.portable.UnknownException;
++import org.omg.CORBA_2_3.portable.ObjectImpl;
++
++
++public class _HelloImpl_Tie extends ObjectImpl implements Tie {
++
++ private HelloImpl target = null;
++
++ private static final String[] _type_ids = {
++ "RMI:HelloInterface:0000000000000000"
++ };
++
++ public void setTarget(Remote target) {
++ this.target = (HelloImpl) target;
++ }
++
++ public Remote getTarget() {
++ return target;
++ }
++
++ public org.omg.CORBA.Object thisObject() {
++ return this;
++ }
++
++ public void deactivate() {
++ _orb().disconnect(this);
++ _set_delegate(null);
++ target = null;
++ }
++
++ public ORB orb() {
++ return _orb();
++ }
++
++ public void orb(ORB orb) {
++ orb.connect(this);
++ }
++
++ public String[] _ids() {
++ return (String[]) _type_ids.clone();
++ }
++
++ public OutputStream _invoke(String method, InputStream _in, ResponseHandler reply) throws SystemException {
++ try {
++ org.omg.CORBA_2_3.portable.InputStream in =
++ (org.omg.CORBA_2_3.portable.InputStream) _in;
++ switch (method.length()) {
++ case 8:
++ if (method.equals("sayHello")) {
++ String arg0 = (String) in.read_value(String.class);
++ String result = target.sayHello(arg0);
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
++ out.write_value(result,String.class);
++ return out;
++ }
++ case 14:
++ if (method.equals("sayHelloToTest")) {
++ Test arg0 = (Test) in.read_value(Test.class);
++ String result = target.sayHelloToTest(arg0);
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
++ out.write_value(result,String.class);
++ return out;
++ }
++ case 19:
++ if (method.equals("sayHelloWithHashMap")) {
++ ConcurrentHashMap arg0 = (ConcurrentHashMap) in.read_value(ConcurrentHashMap.class);
++ String result = target.sayHelloWithHashMap(arg0);
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
++ out.write_value(result,String.class);
++ return out;
++ }
++ case 20:
++ if (method.equals("sayHelloWithHashMap2")) {
++ HashMap arg0 = (HashMap) in.read_value(HashMap.class);
++ String result = target.sayHelloWithHashMap2(arg0);
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
++ out.write_value(result,String.class);
++ return out;
++ }
++ case 23:
++ if (method.equals("sayHelloWithInetAddress")) {
++ InetAddress arg0 = (InetAddress) in.read_value(InetAddress.class);
++ String result = target.sayHelloWithInetAddress(arg0);
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
++ out.write_value(result,String.class);
++ return out;
++ }
++ case 25:
++ if (method.equals("sayHelloWithReentrantLock")) {
++ ReentrantLock arg0 = (ReentrantLock) in.read_value(ReentrantLock.class);
++ String result = target.sayHelloWithReentrantLock(arg0);
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
++ out.write_value(result,String.class);
++ return out;
++ }
++ }
++ throw new BAD_OPERATION();
++ } catch (SystemException ex) {
++ throw ex;
++ } catch (Throwable ex) {
++ throw new UnknownException(ex);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/rmi/PortableRemoteObject/_HelloInterface_Stub.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,272 @@
++// Stub class generated by rmic, do not edit.
++// Contents subject to change without notice.
++
++import java.io.Serializable;
++import java.net.InetAddress;
++import java.rmi.Remote;
++import java.rmi.RemoteException;
++import java.rmi.UnexpectedException;
++import java.util.HashMap;
++import java.util.concurrent.ConcurrentHashMap;
++import java.util.concurrent.locks.ReentrantLock;
++import javax.rmi.CORBA.Stub;
++import javax.rmi.CORBA.Util;
++import org.omg.CORBA.ORB;
++import org.omg.CORBA.SystemException;
++import org.omg.CORBA.portable.ApplicationException;
++import org.omg.CORBA.portable.InputStream;
++import org.omg.CORBA.portable.OutputStream;
++import org.omg.CORBA.portable.RemarshalException;
++import org.omg.CORBA.portable.ResponseHandler;
++import org.omg.CORBA.portable.ServantObject;
++
++
++public class _HelloInterface_Stub extends Stub implements HelloInterface {
++
++ private static final String[] _type_ids = {
++ "RMI:HelloInterface:0000000000000000"
++ };
++
++ public String[] _ids() {
++ return (String[]) _type_ids.clone();
++ }
++
++ public String sayHello(String arg0) throws java.rmi.RemoteException {
++ if (!Util.isLocal(this)) {
++ try {
++ org.omg.CORBA_2_3.portable.InputStream in = null;
++ try {
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream)
++ _request("sayHello", true);
++ out.write_value(arg0,String.class);
++ in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out);
++ return (String) in.read_value(String.class);
++ } catch (ApplicationException ex) {
++ in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
++ String $_id = in.read_string();
++ throw new UnexpectedException($_id);
++ } catch (RemarshalException ex) {
++ return sayHello(arg0);
++ } finally {
++ _releaseReply(in);
++ }
++ } catch (SystemException ex) {
++ throw Util.mapSystemException(ex);
++ }
++ } else {
++ ServantObject so = _servant_preinvoke("sayHello",HelloInterface.class);
++ if (so == null) {
++ return sayHello(arg0);
++ }
++ try {
++ return ((HelloInterface)so.servant).sayHello(arg0);
++ } catch (Throwable ex) {
++ Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
++ throw Util.wrapException(exCopy);
++ } finally {
++ _servant_postinvoke(so);
++ }
++ }
++ }
++
++ public String sayHelloToTest(Test arg0) throws java.rmi.RemoteException {
++ if (!Util.isLocal(this)) {
++ try {
++ org.omg.CORBA_2_3.portable.InputStream in = null;
++ try {
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream)
++ _request("sayHelloToTest", true);
++ out.write_value(arg0,Test.class);
++ in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out);
++ return (String) in.read_value(String.class);
++ } catch (ApplicationException ex) {
++ in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
++ String $_id = in.read_string();
++ throw new UnexpectedException($_id);
++ } catch (RemarshalException ex) {
++ return sayHelloToTest(arg0);
++ } finally {
++ _releaseReply(in);
++ }
++ } catch (SystemException ex) {
++ throw Util.mapSystemException(ex);
++ }
++ } else {
++ ServantObject so = _servant_preinvoke("sayHelloToTest",HelloInterface.class);
++ if (so == null) {
++ return sayHelloToTest(arg0);
++ }
++ try {
++ Test arg0Copy = (Test) Util.copyObject(arg0,_orb());
++ return ((HelloInterface)so.servant).sayHelloToTest(arg0Copy);
++ } catch (Throwable ex) {
++ Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
++ throw Util.wrapException(exCopy);
++ } finally {
++ _servant_postinvoke(so);
++ }
++ }
++ }
++
++ public String sayHelloWithInetAddress(InetAddress arg0) throws java.rmi.RemoteException {
++ if (!Util.isLocal(this)) {
++ try {
++ org.omg.CORBA_2_3.portable.InputStream in = null;
++ try {
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream)
++ _request("sayHelloWithInetAddress", true);
++ out.write_value(arg0,InetAddress.class);
++ in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out);
++ return (String) in.read_value(String.class);
++ } catch (ApplicationException ex) {
++ in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
++ String $_id = in.read_string();
++ throw new UnexpectedException($_id);
++ } catch (RemarshalException ex) {
++ return sayHelloWithInetAddress(arg0);
++ } finally {
++ _releaseReply(in);
++ }
++ } catch (SystemException ex) {
++ throw Util.mapSystemException(ex);
++ }
++ } else {
++ ServantObject so = _servant_preinvoke("sayHelloWithInetAddress",HelloInterface.class);
++ if (so == null) {
++ return sayHelloWithInetAddress(arg0);
++ }
++ try {
++ InetAddress arg0Copy = (InetAddress) Util.copyObject(arg0,_orb());
++ return ((HelloInterface)so.servant).sayHelloWithInetAddress(arg0Copy);
++ } catch (Throwable ex) {
++ Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
++ throw Util.wrapException(exCopy);
++ } finally {
++ _servant_postinvoke(so);
++ }
++ }
++ }
++
++ public String sayHelloWithHashMap(ConcurrentHashMap arg0) throws java.rmi.RemoteException {
++ if (!Util.isLocal(this)) {
++ try {
++ org.omg.CORBA_2_3.portable.InputStream in = null;
++ try {
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream)
++ _request("sayHelloWithHashMap", true);
++ out.write_value(arg0,ConcurrentHashMap.class);
++ in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out);
++ return (String) in.read_value(String.class);
++ } catch (ApplicationException ex) {
++ in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
++ String $_id = in.read_string();
++ throw new UnexpectedException($_id);
++ } catch (RemarshalException ex) {
++ return sayHelloWithHashMap(arg0);
++ } finally {
++ _releaseReply(in);
++ }
++ } catch (SystemException ex) {
++ throw Util.mapSystemException(ex);
++ }
++ } else {
++ ServantObject so = _servant_preinvoke("sayHelloWithHashMap",HelloInterface.class);
++ if (so == null) {
++ return sayHelloWithHashMap(arg0);
++ }
++ try {
++ ConcurrentHashMap arg0Copy = (ConcurrentHashMap) Util.copyObject(arg0,_orb());
++ return ((HelloInterface)so.servant).sayHelloWithHashMap(arg0Copy);
++ } catch (Throwable ex) {
++ Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
++ throw Util.wrapException(exCopy);
++ } finally {
++ _servant_postinvoke(so);
++ }
++ }
++ }
++
++ public String sayHelloWithHashMap2(HashMap arg0) throws java.rmi.RemoteException {
++ if (!Util.isLocal(this)) {
++ try {
++ org.omg.CORBA_2_3.portable.InputStream in = null;
++ try {
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream)
++ _request("sayHelloWithHashMap2", true);
++ out.write_value(arg0,HashMap.class);
++ in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out);
++ return (String) in.read_value(String.class);
++ } catch (ApplicationException ex) {
++ in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
++ String $_id = in.read_string();
++ throw new UnexpectedException($_id);
++ } catch (RemarshalException ex) {
++ return sayHelloWithHashMap2(arg0);
++ } finally {
++ _releaseReply(in);
++ }
++ } catch (SystemException ex) {
++ throw Util.mapSystemException(ex);
++ }
++ } else {
++ ServantObject so = _servant_preinvoke("sayHelloWithHashMap2",HelloInterface.class);
++ if (so == null) {
++ return sayHelloWithHashMap2(arg0);
++ }
++ try {
++ HashMap arg0Copy = (HashMap) Util.copyObject(arg0,_orb());
++ return ((HelloInterface)so.servant).sayHelloWithHashMap2(arg0Copy);
++ } catch (Throwable ex) {
++ Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
++ throw Util.wrapException(exCopy);
++ } finally {
++ _servant_postinvoke(so);
++ }
++ }
++ }
++
++ public String sayHelloWithReentrantLock(ReentrantLock arg0) throws java.rmi.RemoteException {
++ if (!Util.isLocal(this)) {
++ try {
++ org.omg.CORBA_2_3.portable.InputStream in = null;
++ try {
++ org.omg.CORBA_2_3.portable.OutputStream out =
++ (org.omg.CORBA_2_3.portable.OutputStream)
++ _request("sayHelloWithReentrantLock", true);
++ out.write_value(arg0,ReentrantLock.class);
++ in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out);
++ return (String) in.read_value(String.class);
++ } catch (ApplicationException ex) {
++ in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
++ String $_id = in.read_string();
++ throw new UnexpectedException($_id);
++ } catch (RemarshalException ex) {
++ return sayHelloWithReentrantLock(arg0);
++ } finally {
++ _releaseReply(in);
++ }
++ } catch (SystemException ex) {
++ throw Util.mapSystemException(ex);
++ }
++ } else {
++ ServantObject so = _servant_preinvoke("sayHelloWithReentrantLock",HelloInterface.class);
++ if (so == null) {
++ return sayHelloWithReentrantLock(arg0);
++ }
++ try {
++ ReentrantLock arg0Copy = (ReentrantLock) Util.copyObject(arg0,_orb());
++ return ((HelloInterface)so.servant).sayHelloWithReentrantLock(arg0Copy);
++ } catch (Throwable ex) {
++ Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
++ throw Util.wrapException(exCopy);
++ } finally {
++ _servant_postinvoke(so);
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/script/SimpleScriptContextNameChecksTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,105 @@
++/*
++ * 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 8072853
++ * @summary SimpleScriptContext used by NashornScriptEngine doesn't completely complies to the spec regarding exception throwing
++ * @run testng SimpleScriptContextNameChecksTest
++ */
++
++import java.util.List;
++import java.util.function.Consumer;
++import javax.script.*;
++import org.testng.annotations.Test;
++
++public class SimpleScriptContextNameChecksTest {
++ private List<ScriptEngineFactory> getFactories() {
++ return new ScriptEngineManager().getEngineFactories();
++ }
++
++ private void testAndExpect(Consumer<ScriptContext> c, Class<? extends RuntimeException> clazz) {
++ for (ScriptEngineFactory fac : getFactories()) {
++ ScriptContext sc = fac.getScriptEngine().getContext();
++ String name = fac.getEngineName();
++ try {
++ c.accept(sc);
++ throw new RuntimeException("no exception for " + name);
++ } catch (NullPointerException | IllegalArgumentException e) {
++ if (e.getClass() == clazz) {
++ System.out.println("got " + e + " as expected for " + name);
++ } else {
++ throw e;
++ }
++ }
++ }
++ }
++
++ private void testAndExpectIAE(Consumer<ScriptContext> c) {
++ testAndExpect(c, IllegalArgumentException.class);
++ }
++
++ private void testAndExpectNPE(Consumer<ScriptContext> c) {
++ testAndExpect(c, NullPointerException.class);
++ }
++
++ @Test
++ public void getAttributeEmptyName() {
++ testAndExpectIAE(sc -> sc.getAttribute("", ScriptContext.GLOBAL_SCOPE));
++ }
++
++ @Test
++ public void getAttributeNullName() {
++ testAndExpectNPE(sc -> sc.getAttribute(null, ScriptContext.GLOBAL_SCOPE));
++ }
++
++ @Test
++ public void removeAttributeEmptyName() {
++ testAndExpectIAE(sc -> sc.removeAttribute("", ScriptContext.GLOBAL_SCOPE));
++ }
++
++ @Test
++ public void removeAttributeNullName() {
++ testAndExpectNPE(sc -> sc.removeAttribute(null, ScriptContext.GLOBAL_SCOPE));
++ }
++
++ @Test
++ public void setAttributeEmptyName() {
++ testAndExpectIAE(sc -> sc.setAttribute("", "value", ScriptContext.GLOBAL_SCOPE));
++ }
++
++ @Test
++ public void setAttributeNullName() {
++ testAndExpectNPE(sc -> sc.setAttribute(null, "value", ScriptContext.GLOBAL_SCOPE));
++ }
++
++ @Test
++ public void getAttributesScopeEmptyName() {
++ testAndExpectIAE(sc -> sc.getAttributesScope(""));
++ }
++
++ @Test
++ public void getAttributesScopeNullName() {
++ testAndExpectNPE(sc -> sc.getAttributesScope(null));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sound/midi/Devices/InitializationHang.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,40 @@
++/*
++ * 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.Toolkit;
++
++import javax.sound.midi.MidiSystem;
++
++/**
++ * @test
++ * @bug 8068412
++ * @author Sergey Bylokhov
++ */
++public final class InitializationHang {
++
++ public static void main(final String[] argv) throws Exception {
++ MidiSystem.getReceiver();
++ Toolkit.getDefaultToolkit();
++ }
++}
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/TEST.properties Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,7 @@
++# JDBC unit tests uses TestNG
++TestNG.dirs= .
++othervm.dirs= .
++lib.dirs = /java/sql/testng
++modules = java.sql.rowset/com.sun.rowset \
++ java.sql.rowset/com.sun.rowset.internal \
++ java.sql.rowset/com.sun.rowset.providers
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/jars/badFactory/META-INF/services/javax.sql.rowset.RowSetFactory Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1 @@
++invalid.RowSetFactoryImpl
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/jars/goodFactory/META-INF/services/javax.sql.rowset.RowSetFactory Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1 @@
++util.StubRowSetFactory
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/BaseRowSetTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,444 @@
++/*
++ * Copyright (c) 2014, 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 test.rowset;
++
++import java.io.InputStream;
++import java.io.Reader;
++import java.io.StringBufferInputStream;
++import java.io.StringReader;
++import java.math.BigDecimal;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Date;
++import java.sql.Ref;
++import java.sql.SQLException;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.sql.Types;
++import java.time.LocalDate;
++import java.time.LocalDateTime;
++import java.time.LocalTime;
++import java.util.Calendar;
++import javax.sql.RowSet;
++import javax.sql.rowset.serial.SerialArray;
++import javax.sql.rowset.serial.SerialBlob;
++import javax.sql.rowset.serial.SerialClob;
++import javax.sql.rowset.serial.SerialRef;
++import static org.testng.Assert.*;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import util.StubArray;
++import util.StubBaseRowSet;
++import util.StubBlob;
++import util.StubClob;
++import util.StubRef;
++import util.TestRowSetListener;
++
++public class BaseRowSetTests extends CommonRowSetTests {
++
++ private StubBaseRowSet brs;
++
++ @Override
++ protected RowSet newInstance() throws SQLException {
++ return new StubBaseRowSet();
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyCursorMoved is called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0000(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.notifyCursorMoved();
++ assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyRowChanged is called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0001(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.notifyRowChanged();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyRowSetChanged is called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0002(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.notifyRowSetChanged();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ }
++
++ /*
++ * Create multiple RowSetListeners and validate that notifyRowSetChanged
++ * is called on all listeners
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0003(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ TestRowSetListener rsl2 = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.addRowSetListener(rsl2);
++ rs.notifyRowSetChanged();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ assertTrue(rsl2.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ }
++
++ /*
++ * Create multiple RowSetListeners and validate that notifyRowChanged
++ * is called on all listeners
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0004(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ TestRowSetListener rsl2 = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.addRowSetListener(rsl2);
++ rs.notifyRowChanged();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
++ assertTrue(rsl2.isNotified(TestRowSetListener.ROW_CHANGED));
++ }
++
++ /*
++ * Create multiple RowSetListeners and validate that notifyCursorMoved
++ * is called on all listeners
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0005(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ TestRowSetListener rsl2 = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.addRowSetListener(rsl2);
++ rs.notifyCursorMoved();
++ assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
++ assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED));
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyRowSetChanged,
++ * notifyRowChanged() and notifyCursorMoved are called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0006(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.notifyRowSetChanged();
++ rs.notifyRowChanged();
++ rs.notifyCursorMoved();
++ assertTrue(rsl.isNotified(
++ TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED
++ | TestRowSetListener.ROW_CHANGED));
++ }
++
++
++ /*
++ * Create multiple RowSetListeners and validate that notifyRowSetChanged,
++ * notifyRowChanged() and notifyCursorMoved are called on all listeners
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0007(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ TestRowSetListener rsl2 = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.addRowSetListener(rsl2);
++ rs.notifyRowSetChanged();
++ rs.notifyRowChanged();
++ rs.notifyCursorMoved();
++ assertTrue(rsl.isNotified(
++ TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED
++ | TestRowSetListener.ROW_CHANGED));
++ assertTrue(rsl2.isNotified(
++ TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED
++ | TestRowSetListener.ROW_CHANGED));
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyRowSetChanged is called,
++ * remove the listener, invoke notifyRowSetChanged again and verify the
++ * listner is not called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0008(StubBaseRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.notifyRowSetChanged();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ // Clear the flag indicating the listener has been called
++ rsl.resetFlag();
++ rs.removeRowSetListener(rsl);
++ rs.notifyRowSetChanged();
++ assertFalse(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ }
++
++ /*
++ * Set the base parameters and validate that the value set is
++ * the correct type and value
++ */
++ @Test(dataProvider = "testBaseParameters")
++ public void baseRowSetTest0009(int pos, Object o) throws Exception {
++ assertTrue(getParam(pos, o).getClass().isInstance(o));
++ assertTrue(o.equals(getParam(pos, o)));
++ }
++
++ /*
++ * Set the complex parameters and validate that the value set is
++ * the correct type
++ */
++ @Test(dataProvider = "testAdvancedParameters")
++ public void baseRowSetTest0010(int pos, Object o) throws Exception {
++ assertTrue(getParam(pos, o).getClass().isInstance(o));
++ }
++
++ /*
++ * Validate setNull specifying the supported type values
++ */
++ @Test(dataProvider = "jdbcTypes")
++ public void baseRowSetTest0011(Integer type) throws Exception {
++ brs = new StubBaseRowSet();
++ brs.setNull(1, type);
++ assertTrue(checkNullParam(1, type, null));
++ }
++
++ /*
++ * Validate setNull specifying the supported type values and that
++ * typeName is set internally
++ */
++ @Test(dataProvider = "jdbcTypes")
++ public void baseRowSetTest0012(Integer type) throws Exception {
++ brs = new StubBaseRowSet();
++ brs.setNull(1, type, "SUPERHERO");
++ assertTrue(checkNullParam(1, type, "SUPERHERO"));
++ }
++
++ /*
++ * Validate that setDate sets the specified Calendar internally
++ */
++ @Test()
++ public void baseRowSetTest0013() throws Exception {
++ Calendar cal = Calendar.getInstance();
++ brs = new StubBaseRowSet();
++ brs.setDate(1, Date.valueOf(LocalDate.now()), cal);
++ assertTrue(checkCalendarParam(1, cal));
++ }
++
++ /*
++ * Validate that setTime sets the specified Calendar internally
++ */
++ @Test()
++ public void baseRowSetTest0014() throws Exception {
++ Calendar cal = Calendar.getInstance();
++ brs = new StubBaseRowSet();
++ brs.setTime(1, Time.valueOf(LocalTime.now()), cal);
++ assertTrue(checkCalendarParam(1, cal));
++ }
++
++ /*
++ * Validate that setTimestamp sets the specified Calendar internally
++ */
++ @Test()
++ public void baseRowSetTest0015() throws Exception {
++ Calendar cal = Calendar.getInstance();
++ brs = new StubBaseRowSet();
++ brs.setTimestamp(1, Timestamp.valueOf(LocalDateTime.now()), cal);
++ assertTrue(checkCalendarParam(1, cal));
++ }
++
++ /*
++ * Validate that initParams() initializes the parameters
++ */
++ @Test(dataProvider = "rowSetType")
++ public void baseRowSetTest0016(StubBaseRowSet rs) throws Exception {
++ rs.setInt(1, 1);
++ rs.initParams();
++ assertTrue(rs.getParams().length == 0);
++ }
++
++
++ /*
++ * DataProvider used to set parameters for basic types that are supported
++ */
++ @DataProvider(name = "testBaseParameters")
++ private Object[][] testBaseParameters() throws SQLException {
++ Integer aInt = 1;
++ Long aLong = Long.MAX_VALUE;
++ Short aShort = Short.MIN_VALUE;
++ BigDecimal bd = BigDecimal.ONE;
++ Double aDouble = Double.MAX_VALUE;
++ Date aDate = Date.valueOf(LocalDate.now());
++ Time aTime = Time.valueOf(LocalTime.now());
++ Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now());
++ Calendar cal = Calendar.getInstance();
++ Boolean aBoolean = true;
++ Float aFloat = 1.5f;
++ Byte aByte = 1;
++ brs = new StubBaseRowSet();
++
++ brs.setInt(1, aInt);
++ brs.setString(2, query);
++ brs.setLong(3, aLong);
++ brs.setBoolean(4, aBoolean);
++ brs.setShort(5, aShort);
++ brs.setDouble(6, aDouble);
++ brs.setBigDecimal(7, bd);
++ brs.setFloat(8, aFloat);
++ brs.setByte(9, aByte);
++ brs.setDate(10, aDate);
++ brs.setTime(11, aTime);
++ brs.setTimestamp(12, aTimeStamp);
++ brs.setDate(13, aDate, cal);
++ brs.setTime(14, aTime, cal);
++ brs.setTimestamp(15, aTimeStamp);
++ brs.setObject(16, query);
++ brs.setObject(17, query, Types.CHAR);
++ brs.setObject(18, query, Types.CHAR, 0);
++
++ return new Object[][]{
++ {1, aInt},
++ {2, query},
++ {3, aLong},
++ {4, aBoolean},
++ {5, aShort},
++ {6, aDouble},
++ {7, bd},
++ {8, aFloat},
++ {9, aByte},
++ {10, aDate},
++ {11, aTime},
++ {12, aTimeStamp},
++ {13, aDate},
++ {14, aTime},
++ {15, aTimeStamp},
++ {16, query},
++ {17, query},
++ {18, query}
++
++ };
++ }
++
++ /*
++ * DataProvider used to set advanced parameters for types that are supported
++ */
++ @DataProvider(name = "testAdvancedParameters")
++ private Object[][] testAdvancedParameters() throws SQLException {
++
++ byte[] bytes = new byte[10];
++ Ref aRef = new SerialRef(new StubRef("INTEGER", query));
++ Array aArray = new SerialArray(new StubArray("INTEGER", new Object[1]));
++ Blob aBlob = new SerialBlob(new StubBlob());
++ Clob aClob = new SerialClob(new StubClob());
++ Reader rdr = new StringReader(query);
++ InputStream is = new StringBufferInputStream(query);;
++ brs = new StubBaseRowSet();
++ brs.setBytes(1, bytes);
++ brs.setAsciiStream(2, is, query.length());
++ brs.setRef(3, aRef);
++ brs.setArray(4, aArray);
++ brs.setBlob(5, aBlob);
++ brs.setClob(6, aClob);
++ brs.setBinaryStream(7, is, query.length());
++ brs.setUnicodeStream(8, is, query.length());
++ brs.setCharacterStream(9, rdr, query.length());
++
++ return new Object[][]{
++ {1, bytes},
++ {2, is},
++ {3, aRef},
++ {4, aArray},
++ {5, aBlob},
++ {6, aClob},
++ {7, is},
++ {8, is},
++ {9, rdr}
++ };
++ }
++
++ /*
++ * Method that returns the specified parameter instance that was set via setXXX
++ * Note non-basic types are stored as an Object[] where the 1st element
++ * is the object instnace
++ */
++ @SuppressWarnings("unchecked")
++ private <T> T getParam(int pos, T o) throws SQLException {
++ Object[] params = brs.getParams();
++ if (params[pos - 1] instanceof Object[]) {
++ Object[] param = (Object[]) params[pos - 1];
++ return (T) param[0];
++ } else {
++ return (T) params[pos - 1];
++ }
++ }
++
++ /*
++ * Utility method to validate parameters when the param is an Object[]
++ */
++ private boolean checkParam(int pos, int type, Object val) throws SQLException {
++ boolean result = false;
++ Object[] params = brs.getParams();
++ if (params[pos - 1] instanceof Object[]) {
++ Object[] param = (Object[]) params[pos - 1];
++
++ if (param[0] == null) {
++ // setNull was used
++ if (param.length == 2 && (Integer) param[1] == type) {
++ result = true;
++ } else {
++ if (param.length == 3 && (Integer) param[1] == type
++ && val.equals(param[2])) {
++ result = true;
++ }
++ }
++
++ } else if (param[0] instanceof java.util.Date) {
++ // setDate/Time/Timestamp with a Calendar object
++ if (param[1] instanceof Calendar && val.equals(param[1])) {
++ result = true;
++ }
++ }
++ }
++ return result;
++ }
++
++ /*
++ * Wrapper method for validating that a null was set and the appropriate
++ * type and typeName if applicable
++ */
++ private boolean checkNullParam(int pos, int type, String typeName) throws SQLException {
++ return checkParam(pos, type, typeName);
++ }
++
++ /*
++ * Wrapper method for validating that a Calander was set
++ */
++ private boolean checkCalendarParam(int pos, Calendar cal) throws SQLException {
++ // 2nd param is ignored when instanceof java.util.Date
++ return checkParam(pos, Types.DATE, cal);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/CommonRowSetTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1372 @@
++/*
++ * 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 test.rowset;
++
++import java.io.InputStream;
++import java.io.Reader;
++import java.math.BigDecimal;
++import java.sql.Connection;
++import java.sql.Date;
++import java.sql.ResultSet;
++import java.sql.ResultSetMetaData;
++import java.sql.RowId;
++import java.sql.SQLException;
++import java.sql.SQLFeatureNotSupportedException;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.sql.Types;
++import java.time.LocalDate;
++import java.time.LocalDateTime;
++import java.time.LocalTime;
++import java.util.ArrayList;
++import java.util.Calendar;
++import java.util.HashMap;
++import java.util.List;
++import java.util.Map;
++import javax.sql.RowSet;
++import javax.sql.rowset.BaseRowSet;
++import javax.sql.rowset.CachedRowSet;
++import javax.sql.rowset.RowSetFactory;
++import javax.sql.rowset.RowSetMetaDataImpl;
++import javax.sql.rowset.RowSetProvider;
++import org.testng.Assert;
++import static org.testng.Assert.assertNull;
++import static org.testng.Assert.assertTrue;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubBlob;
++import util.StubClob;
++import util.StubNClob;
++import util.StubSQLXML;
++
++public abstract class CommonRowSetTests extends BaseTest {
++
++ protected final String stubProvider = "util.StubSyncProvider";
++ protected final String query = "SELECT * FROM SUPERHEROS";
++ private final String url = "jdbc:derby://localhost:1527/myDB";
++ private final String dsName = "jdbc/myDB";
++ private final String user = "Bruce Wayne";
++ private final String password = "The Dark Knight";
++ protected final String COFFEE_HOUSES_TABLE = "COFFEE_HOUSES";
++ protected final String COFFEES_TABLE = "COFFEES";
++ protected final int COFFEE_HOUSES_ROWS = 14;
++ protected final int COFFEES_ROWS = 5;
++ protected final Object[] COFFEES_PRIMARY_KEYS = {1, 2, 3, 4, 5};
++ protected final Object[] COFFEE_HOUSES_PRIMARY_KEYS = {
++ 10023, 33002, 10040, 32001, 10042, 10024, 10039, 10041,
++ 33005, 33010, 10035, 10037, 10034, 32004
++ };
++
++ /*
++ * COFFEES_HOUSES Table column names
++ */
++ protected final String[] COFFEE_HOUSES_COLUMN_NAMES = {
++ "STORE_ID", "CITY", "COFFEE", "MERCH", "TOTAL"
++ };
++
++ /*
++ * COFFEES Table column names
++ */
++ protected final String[] COFFEES_COLUMN_NAMES = {
++ "COF_ID", "COF_NAME", "SUP_ID", "PRICE", "SALES", "TOTAL"
++ };
++
++ protected RowSetFactory rsf;
++
++ public CommonRowSetTests() {
++ try {
++ rsf = RowSetProvider.newFactory();
++ } catch (SQLException ex) {
++ Assert.fail(ex.getMessage());
++ }
++ }
++
++ // Create an instance of the RowSet we are using
++ protected abstract <T extends RowSet> T newInstance() throws SQLException;
++
++ //DataProvider to use for common tests
++
++ /*
++ * DataProvider used to specify the value to set and check for the
++ * methods for fetch direction
++ */
++ @DataProvider(name = "rowSetFetchDirection")
++ protected Object[][] rowSetFetchDirection() throws Exception {
++ RowSet rs = newInstance();
++ return new Object[][]{
++ {rs, ResultSet.FETCH_FORWARD},
++ {rs, ResultSet.FETCH_REVERSE},
++ {rs, ResultSet.FETCH_UNKNOWN}
++ };
++ }
++
++ /*
++ * DataProvider used to specify the value to set and check for the
++ * methods for Cursor Scroll Type
++ */
++ @DataProvider(name = "rowSetScrollTypes")
++ protected Object[][] rowSetScrollTypes() throws Exception {
++ RowSet rs = newInstance();
++
++ return new Object[][]{
++ {rs, ResultSet.TYPE_FORWARD_ONLY},
++ {rs, ResultSet.TYPE_SCROLL_INSENSITIVE},
++ {rs, ResultSet.TYPE_SCROLL_SENSITIVE}
++ };
++ }
++
++ /*
++ * DataProvider used to specify the value to set and check for
++ * methods using transaction isolation types
++ */
++ @DataProvider(name = "rowSetIsolationTypes")
++ protected Object[][] rowSetIsolationTypes() throws Exception {
++ RowSet rs = newInstance();
++
++ return new Object[][]{
++ {rs, Connection.TRANSACTION_NONE},
++ {rs, Connection.TRANSACTION_READ_COMMITTED},
++ {rs, Connection.TRANSACTION_READ_UNCOMMITTED},
++ {rs, Connection.TRANSACTION_REPEATABLE_READ},
++ {rs, Connection.TRANSACTION_SERIALIZABLE}
++ };
++ }
++
++ /*
++ * DataProvider used to specify the value to set and check for the
++ * methods for Concurrency
++ */
++ @DataProvider(name = "rowSetConcurrencyTypes")
++ protected Object[][] rowSetConcurrencyTypes() throws Exception {
++ RowSet rs = newInstance();
++ return new Object[][]{
++ {rs, ResultSet.CONCUR_READ_ONLY},
++ {rs, ResultSet.CONCUR_UPDATABLE}
++ };
++ }
++
++ /*
++ * DataProvider used to specify the value to set and check for
++ * methods using boolean values
++ */
++ @DataProvider(name = "rowSetTrueFalse")
++ protected Object[][] rowSetTrueFalse() throws Exception {
++ RowSet rs = newInstance();
++ return new Object[][]{
++ {rs, true},
++ {rs, false}
++ };
++ }
++ /*
++ * DataProvider used to specify the type of RowSet to use. We also must
++ * initialize the RowSet
++ */
++ @DataProvider(name = "rowSetType")
++ protected Object[][] rowSetType() throws Exception {
++
++ RowSet rs = newInstance();
++ return new Object[][]{
++ {rs}
++ };
++ }
++
++ /*
++ * Initializes a RowSet containing the COFFEE_HOUSES data
++ */
++ protected <T extends RowSet> T createCoffeeHousesRowSet() throws SQLException {
++ T rs = (T) newInstance();
++ initCoffeeHousesMetaData((CachedRowSet) rs);
++ createCoffeeHouseRows(rs);
++ // Make sure you are not on the insertRow
++ rs.moveToCurrentRow();
++ return rs;
++ }
++
++ /*
++ * Initializes a RowSet containing the COFFEE_HOUSES data
++ */
++ protected <T extends RowSet> T createCoffeesRowSet() throws SQLException {
++ T rs = (T) newInstance();
++ initCoffeesMetaData((CachedRowSet) rs);
++ createCoffeesRows(rs);
++ // Make sure you are not on the insertRow
++ rs.moveToCurrentRow();
++ return rs;
++ }
++
++ /*
++ * Initializes the COFFEE_HOUSES metadata
++ */
++ private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
++ RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
++ crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
++
++ /*
++ * CREATE TABLE COFFEE_HOUSES(
++ * STORE_ID Integer NOT NULL,
++ * CITY VARCHAR(32),
++ * COFFEE INTEGER NOT NULL,
++ * MERCH INTEGER NOT NULL,
++ * TOTAL INTEGER NOT NULL,
++ * PRIMARY KEY (STORE_ID))
++ */
++ rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
++ for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
++ rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
++ rsmd.setColumnLabel(i, rsmd.getColumnName(i));
++ }
++
++ rsmd.setColumnType(1, Types.INTEGER);
++ rsmd.setColumnType(2, Types.VARCHAR);
++ rsmd.setColumnType(3, Types.INTEGER);
++ rsmd.setColumnType(4, Types.INTEGER);
++ rsmd.setColumnType(5, Types.INTEGER);
++ crs.setMetaData(rsmd);
++ crs.setTableName(COFFEE_HOUSES_TABLE);
++
++ }
++
++ /*
++ * Add rows to COFFEE_HOUSES table
++ */
++ protected void createCoffeeHouseRows(RowSet rs) throws SQLException {
++
++ // insert into COFFEE_HOUSES values(10023, 'Mendocino', 3450, 2005, 5455)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10023);
++ rs.updateString(2, "Mendocino");
++ rs.updateInt(3, 3450);
++ rs.updateInt(4, 2005);
++ rs.updateInt(5, 5455);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(33002, 'Seattle', 4699, 3109, 7808)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 33002);
++ rs.updateString(2, "Seattle");
++ rs.updateInt(3, 4699);
++ rs.updateInt(4, 3109);
++ rs.updateInt(5, 7808);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(10040, 'SF', 5386, 2841, 8227)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10040);
++ rs.updateString(2, "SF");
++ rs.updateInt(3, 5386);
++ rs.updateInt(4, 2841);
++ rs.updateInt(5, 8227);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(32001, 'Portland', 3147, 3579, 6726)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 32001);
++ rs.updateString(2, "Portland");
++ rs.updateInt(3, 3147);
++ rs.updateInt(4, 3579);
++ rs.updateInt(5, 6726);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(10042, 'SF', 2863, 1874, 4710)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10042);
++ rs.updateString(2, "SF");
++ rs.updateInt(3, 2863);
++ rs.updateInt(4, 1874);
++ rs.updateInt(5, 4710);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(10024, 'Sacramento', 1987, 2341, 4328)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10024);
++ rs.updateString(2, "Sacramento");
++ rs.updateInt(3, 1987);
++ rs.updateInt(4, 2341);
++ rs.updateInt(5, 4328);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(10039, 'Carmel', 2691, 1121, 3812)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10039);
++ rs.updateString(2, "Carmel");
++ rs.updateInt(3, 2691);
++ rs.updateInt(4, 1121);
++ rs.updateInt(5, 3812);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(10041, 'LA', 1533, 1007, 2540)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10041);
++ rs.updateString(2, "LA");
++ rs.updateInt(3, 1533);
++ rs.updateInt(4, 1007);
++ rs.updateInt(5, 2540);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(33005, 'Olympia', 2733, 1550, 1550)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 33005);
++ rs.updateString(2, "Olympia");
++ rs.updateInt(3, 2733);
++ rs.updateInt(4, 1550);
++ rs.updateInt(5, 1550);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(33010, 'Seattle', 3210, 2177, 5387)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 33010);
++ rs.updateString(2, "Seattle");
++ rs.updateInt(3, 3210);
++ rs.updateInt(4, 2177);
++ rs.updateInt(5, 5387);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(10035, 'SF', 1922, 1056, 2978)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10035);
++ rs.updateString(2, "SF");
++ rs.updateInt(3, 1922);
++ rs.updateInt(4, 1056);
++ rs.updateInt(5, 2978);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(10037, 'LA', 2143, 1876, 4019)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10037);
++ rs.updateString(2, "LA");
++ rs.updateInt(3, 2143);
++ rs.updateInt(4, 1876);
++ rs.updateInt(5, 4019);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(10034, 'San_Jose', 1234, 1032, 2266)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10034);
++ rs.updateString(2, "San Jose");
++ rs.updateInt(3, 1234);
++ rs.updateInt(4, 1032);
++ rs.updateInt(5, 2266);
++ rs.insertRow();
++ // insert into COFFEE_HOUSES values(32004, 'Eugene', 1356, 1112, 2468)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 32004);
++ rs.updateString(2, "Eugene");
++ rs.updateInt(3, 1356);
++ rs.updateInt(4, 1112);
++ rs.updateInt(5, 2468);
++ rs.insertRow();
++ rs.moveToCurrentRow();
++ }
++
++ /*
++ * Initializes the COFFEES metadata
++ */
++ protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
++ RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
++ crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
++
++ /*
++ * CREATE TABLE COFFEES (
++ * COF_ID INTEGER NOT NULL,
++ * COF_NAME VARCHAR(32) NOT NULL,
++ * SUP_ID INTEGER NOT NULL,
++ * PRICE NUMBERIC(10,2 NOT NULL,
++ * SALES INTEGER NOT NULL,
++ * TOTAL INTEGER NOT NULL,
++ * PRIMARY KEY (COF_ID),
++ * FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
++ */
++ rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
++ for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
++ rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
++ rsmd.setColumnLabel(i, rsmd.getColumnName(i));
++ }
++
++ rsmd.setColumnType(1, Types.INTEGER);
++ rsmd.setColumnType(2, Types.VARCHAR);
++ rsmd.setColumnType(3, Types.INTEGER);
++ rsmd.setColumnType(4, Types.NUMERIC);
++ rsmd.setPrecision(4, 10);
++ rsmd.setScale(4, 2);
++ rsmd.setColumnType(5, Types.INTEGER);
++ rsmd.setColumnType(6, Types.INTEGER);
++ crs.setMetaData(rsmd);
++ crs.setTableName(COFFEES_TABLE);
++
++ }
++
++ /*
++ * Add rows to COFFEES table
++ */
++ protected void createCoffeesRows(RowSet rs) throws SQLException {
++
++ // insert into COFFEES values(1, 'Colombian', 101, 7.99, 0, 0)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 1);
++ rs.updateString(2, "Colombian");
++ rs.updateInt(3, 101);
++ rs.updateBigDecimal(4, BigDecimal.valueOf(7.99));
++ rs.updateInt(5, 0);
++ rs.updateInt(6, 0);
++ rs.insertRow();
++ // insert into COFFEES values(2, 'French_Roast', 49, 8.99, 0, 0)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 2);
++ rs.updateString(2, "French_Roast");
++ rs.updateInt(3, 49);
++ rs.updateBigDecimal(4, BigDecimal.valueOf(8.99));
++ rs.updateInt(5, 0);
++ rs.updateInt(6, 0);
++ rs.insertRow();
++ // insert into COFFEES values(3, 'Espresso', 150, 9.99, 0, 0)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 3);
++ rs.updateString(2, "Espresso");
++ rs.updateInt(3, 150);
++ rs.updateBigDecimal(4, BigDecimal.valueOf(9.99));
++ rs.updateInt(5, 0);
++ rs.updateInt(6, 0);
++ rs.insertRow();
++ // insert into COFFEES values(4, 'Colombian_Decaf', 101, 8.99, 0, 0)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 4);
++ rs.updateString(2, "Colombian_Decaf");
++ rs.updateInt(3, 101);
++ rs.updateBigDecimal(4, BigDecimal.valueOf(8.99));
++ rs.updateInt(5, 0);
++ rs.updateInt(6, 0);
++ rs.insertRow();
++ // insert into COFFEES values(5, 'French_Roast_Decaf', 049, 9.99, 0, 0)
++ rs.moveToInsertRow();
++ rs.updateInt(1, 5);
++ rs.updateString(2, "French_Roast_Decaf");
++ rs.updateInt(3, 49);
++ rs.updateBigDecimal(4, BigDecimal.valueOf(9.99));
++ rs.updateInt(5, 0);
++ rs.updateInt(6, 0);
++ rs.insertRow();
++
++ }
++
++
++ /*
++ * Utility method to return the Primary Keys for a RowSet. The Primary
++ * keys are assumed to be in the first column of the RowSet
++ */
++ protected Object[] getPrimaryKeys(ResultSet rs) throws SQLException {
++ List<? super Object> result = new ArrayList<>();
++ if (rs == null) {
++ return null;
++ }
++ rs.beforeFirst();
++ while (rs.next()) {
++ result.add(rs.getInt(1));
++ }
++ return result.toArray();
++ }
++
++ /*
++ * Utility method to display the RowSet and will return the row count
++ * it found
++ */
++ protected int displayResults(ResultSet rs) throws SQLException {
++ int rows = 0;
++ ResultSetMetaData rsmd = rs.getMetaData();
++ int cols = rsmd.getColumnCount();
++ if (rs != null) {
++ rs.beforeFirst();
++ while (rs.next()) {
++ rows++;
++
++ for (int i = 0; i < cols; i++) {
++ System.out.print(rs.getString(i + 1) + " ");
++ }
++ System.out.println();
++ }
++ }
++
++ return rows;
++ }
++
++
++ // Insert common tests here
++
++ /*
++ * Validate that getCommand() returns null by default
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0000(RowSet rs) {
++ assertNull(rs.getCommand());
++ }
++
++ /*
++ * Validate that getCommand() returns command specified to setCommand
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0001(RowSet rs) throws Exception {
++ rs.setCommand(query);
++ assertTrue(rs.getCommand().equals(query));
++ }
++
++
++ /*
++ * Validate that getCurrency() returns the correct default value
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0002(RowSet rs) throws Exception {
++ assertTrue(rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE);
++ }
++
++ /*
++ * Validate that getCurrency() returns the correct value
++ * after a call to setConcurrency())
++ */
++ @Test(dataProvider = "rowSetConcurrencyTypes")
++ public void commonRowSetTest0003(RowSet rs, int concurType) throws Exception {
++ rs.setConcurrency(concurType);
++ assertTrue(rs.getConcurrency() == concurType);
++ }
++
++ /*
++ * Validate that getCurrency() throws a SQLException for an invalid value
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonRowSetTest0004(RowSet rs) throws Exception {
++ rs.setConcurrency(ResultSet.CLOSE_CURSORS_AT_COMMIT);
++ }
++
++ /*
++ * Validate that getDataSourceName() returns null by default
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0005(RowSet rs) throws Exception {
++ assertTrue(rs.getDataSourceName() == null);
++ }
++
++ /*
++ * Validate that getDataSourceName() returns the value specified
++ * by setDataSourceName() and getUrl() returns null
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0006(RowSet rs) throws Exception {
++ rs.setUrl(url);
++ rs.setDataSourceName(dsName);
++ assertTrue(rs.getDataSourceName().equals(dsName));
++ assertNull(rs.getUrl());
++ }
++
++ /*
++ * Validate that setDataSourceName() throws a SQLException for an empty
++ * String specified for the data source name
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonRowSetTest0007(RowSet rs) throws Exception {
++ String dsname = "";
++ rs.setDataSourceName(dsname);
++ }
++
++ /*
++ * Validate that getEscapeProcessing() returns false by default
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0008(RowSet rs) throws Exception {
++ assertTrue(rs.getEscapeProcessing());
++ }
++
++ /*
++ * Validate that getEscapeProcessing() returns value set by
++ * setEscapeProcessing()
++ */
++ @Test(dataProvider = "rowSetTrueFalse")
++ public void commonRowSetTest0009(RowSet rs, boolean val) throws Exception {
++ rs.setEscapeProcessing(val);
++ assertTrue(rs.getEscapeProcessing() == val);
++ }
++
++ /*
++ * Validate that getFetchDirection() returns the correct default value
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0010(RowSet rs) throws Exception {
++ assertTrue(rs.getFetchDirection() == ResultSet.FETCH_FORWARD);
++ }
++
++ /*
++ * Validate that getFetchDirection() returns the value set by
++ * setFetchDirection()
++ */
++ @Test(dataProvider = "rowSetFetchDirection")
++ public void commonRowSetTest0011(RowSet rs, int direction) throws Exception {
++ rs.setFetchDirection(direction);
++ assertTrue(rs.getFetchDirection() == direction);
++ }
++
++ /*
++ * Validate that setFetchSize() throws a SQLException for an invalid value
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonRowSetTest0013(RowSet rs) throws Exception {
++ rs.setFetchSize(-1);
++ }
++
++ /*
++ * Validate that setFetchSize() throws a SQLException for a
++ * value greater than getMaxRows()
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonRowSetTest0014(RowSet rs) throws Exception {
++ rs.setMaxRows(5);
++ rs.setFetchSize(rs.getMaxRows() + 1);
++ }
++
++ /*
++ * Validate that getFetchSize() returns the correct value after
++ * setFetchSize() has been called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0015(RowSet rs) throws Exception {
++ int maxRows = 150;
++ rs.setFetchSize(0);
++ assertTrue(rs.getFetchSize() == 0);
++ rs.setFetchSize(100);
++ assertTrue(rs.getFetchSize() == 100);
++ rs.setMaxRows(maxRows);
++ rs.setFetchSize(maxRows);
++ assertTrue(rs.getFetchSize() == maxRows);
++ }
++
++ /*
++ * Validate that setMaxFieldSize() throws a SQLException for an invalid value
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonRowSetTest0016(RowSet rs) throws Exception {
++ rs.setMaxFieldSize(-1);
++ }
++
++ /*
++ * Validate that getMaxFieldSize() returns the value set by
++ * setMaxFieldSize()
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0017(RowSet rs) throws Exception {
++ rs.setMaxFieldSize(0);
++ assertTrue(rs.getMaxFieldSize() == 0);
++ rs.setMaxFieldSize(100);
++ assertTrue(rs.getMaxFieldSize() == 100);
++ rs.setMaxFieldSize(50);
++ assertTrue(rs.getMaxFieldSize() == 50);
++ }
++
++ /*
++ * Validate that isReadOnly() returns value set by
++ * setReadOnly()
++ */
++ @Test(dataProvider = "rowSetTrueFalse")
++ public void commonRowSetTest0018(RowSet rs, boolean val) throws Exception {
++ rs.setReadOnly(val);
++ assertTrue(rs.isReadOnly() == val);
++ }
++
++ /*
++ * Validate that getTransactionIsolation() returns value set by
++ * setTransactionIsolation()
++ */
++ @Test(dataProvider = "rowSetIsolationTypes")
++ public void commonRowSetTest0019(RowSet rs, int val) throws Exception {
++ rs.setTransactionIsolation(val);
++ assertTrue(rs.getTransactionIsolation() == val);
++ }
++
++ /*
++ * Validate that getType() returns value set by setType()
++ */
++ @Test(dataProvider = "rowSetScrollTypes")
++ public void commonRowSetTest0020(RowSet rs, int val) throws Exception {
++ rs.setType(val);
++ assertTrue(rs.getType() == val);
++ }
++
++ /*
++ * Validate that getEscapeProcessing() returns value set by
++ * setEscapeProcessing()
++ */
++ @Test(dataProvider = "rowSetTrueFalse")
++ public void commonRowSetTest0021(BaseRowSet rs, boolean val) throws Exception {
++ rs.setShowDeleted(val);
++ assertTrue(rs.getShowDeleted() == val);
++ }
++
++ /*
++ * Validate that getTypeMap() returns same value set by
++ * setTypeMap()
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0022(RowSet rs) throws Exception {
++ Map<String, Class<?>> map = new HashMap<>();
++ map.put("SUPERHERO", Class.forName("util.SuperHero"));
++ rs.setTypeMap(map);
++ assertTrue(rs.getTypeMap().equals(map));
++ }
++
++ /*
++ * Validate that getUsername() returns same value set by
++ * setUsername()
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0023(RowSet rs) throws Exception {
++ rs.setUsername(user);
++ assertTrue(rs.getUsername().equals(user));
++ }
++
++ /*
++ * Validate that getPassword() returns same password set by
++ * setPassword()
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0024(RowSet rs) throws Exception {
++ rs.setPassword(password);
++ assertTrue(rs.getPassword().equals(password));
++ }
++
++ /*
++ * Validate that getQueryTimeout() returns same value set by
++ * setQueryTimeout() and that 0 is a valid timeout value
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0025(RowSet rs) throws Exception {
++ int timeout = 0;
++ rs.setQueryTimeout(timeout);
++ assertTrue(rs.getQueryTimeout() == timeout);
++ }
++
++ /*
++ * Validate that getQueryTimeout() returns same value set by
++ * setQueryTimeout() and that 0 is a valid timeout value
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0026(RowSet rs) throws Exception {
++ int timeout = 10000;
++ rs.setQueryTimeout(timeout);
++ assertTrue(rs.getQueryTimeout() == timeout);
++ }
++
++ /*
++ * Validate that setQueryTimeout() throws a SQLException for a timeout
++ * value < 0
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonRowSetTest0027(RowSet rs) throws Exception {
++ rs.setQueryTimeout(-1);
++ }
++
++
++ /*
++ * Validate addRowSetListener does not throw an Exception when null is
++ * passed as the parameter
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0028(RowSet rs) throws Exception {
++ rs.addRowSetListener(null);
++ }
++
++ /*
++ * Validate removeRowSetListener does not throw an Exception when null is
++ * passed as the parameter
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0029(RowSet rs) throws Exception {
++ rs.removeRowSetListener(null);
++ }
++
++ /*
++ * Set two parameters and then validate clearParameters() will clear them
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0030(BaseRowSet rs) throws Exception {
++ rs.setInt(1, 1);
++ rs.setString(2, query);
++ assertTrue(rs.getParams().length == 2);
++ rs.clearParameters();
++ assertTrue(rs.getParams().length == 0);
++ }
++
++ /*
++ * Validate that getURL() returns same value set by
++ * setURL()
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonRowSetTest0031(RowSet rs) throws Exception {
++ rs.setUrl(url);
++ assertTrue(rs.getUrl().equals(url));
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0100(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setAsciiStream(1, is);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0101(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setAsciiStream("one", is);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0102(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setAsciiStream("one", is, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0103(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setBinaryStream(1, is);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0104(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setBinaryStream("one", is);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0105(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setBinaryStream("one", is, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0106(RowSet rs) throws Exception {
++ rs.setBigDecimal("one", BigDecimal.ONE);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0107(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setBlob(1, is);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0108(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setBlob("one", is);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0109(RowSet rs) throws Exception {
++ InputStream is = null;
++ rs.setBlob("one", is, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0110(RowSet rs) throws Exception {
++ rs.setBlob("one", new StubBlob());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0111(RowSet rs) throws Exception {
++ rs.setBoolean("one", true);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0112(RowSet rs) throws Exception {
++ byte b = 1;
++ rs.setByte("one", b);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0113(RowSet rs) throws Exception {
++ byte b = 1;
++ rs.setBytes("one", new byte[10]);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0114(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setCharacterStream("one", rdr, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0115(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setCharacterStream("one", rdr);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0116(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setCharacterStream(1, rdr);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0117(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setClob(1, rdr);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0118(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setClob("one", rdr);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0119(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setClob("one", rdr, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0120(RowSet rs) throws Exception {
++ rs.setClob("one", new StubClob());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0121(RowSet rs) throws Exception {
++ rs.setDate("one", Date.valueOf(LocalDate.now()));
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0122(RowSet rs) throws Exception {
++ rs.setDate("one", Date.valueOf(LocalDate.now()),
++ Calendar.getInstance());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0123(RowSet rs) throws Exception {
++ rs.setTime("one", Time.valueOf(LocalTime.now()));
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0124(RowSet rs) throws Exception {
++ rs.setTime("one", Time.valueOf(LocalTime.now()),
++ Calendar.getInstance());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0125(RowSet rs) throws Exception {
++ rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()));
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0126(RowSet rs) throws Exception {
++ rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()),
++ Calendar.getInstance());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0127(RowSet rs) throws Exception {
++ rs.setDouble("one", 2.0d);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0128(RowSet rs) throws Exception {
++ rs.setFloat("one", 2.0f);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0129(RowSet rs) throws Exception {
++ rs.setInt("one", 21);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0130(RowSet rs) throws Exception {
++ rs.setLong("one", 21l);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0131(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setNCharacterStream("one", rdr, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0132(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setNCharacterStream("one", rdr);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0133(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setNCharacterStream(1, rdr);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0134(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setNCharacterStream(1, rdr, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0135(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setClob("one", rdr);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0136(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setClob("one", rdr, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0137(RowSet rs) throws Exception {
++ rs.setNClob("one", new StubNClob());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0138(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setNClob(1, rdr);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0139(RowSet rs) throws Exception {
++ Reader rdr = null;
++ rs.setNClob(1, rdr, query.length());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0140(RowSet rs) throws Exception {
++ rs.setNClob(1, new StubNClob());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0141(RowSet rs) throws Exception {
++ rs.setNString(1, query);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0142(RowSet rs) throws Exception {
++ rs.setNull("one", Types.INTEGER);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0143(RowSet rs) throws Exception {
++ rs.setNull("one", Types.INTEGER, "my.type");
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0144(RowSet rs) throws Exception {
++ rs.setObject("one", query, Types.VARCHAR);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0145(RowSet rs) throws Exception {
++ rs.setObject("one", query, Types.VARCHAR, 0);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0146(RowSet rs) throws Exception {
++ rs.setObject("one", query);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0147(RowSet rs) throws Exception {
++ RowId aRowid = null;
++ rs.setRowId("one", aRowid);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0148(RowSet rs) throws Exception {
++ rs.setSQLXML("one", new StubSQLXML());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0149(RowSet rs) throws Exception {
++ rs.setSQLXML(1, new StubSQLXML());
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0150(RowSet rs) throws Exception {
++ rs.setNString(1, query);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0151(RowSet rs) throws Exception {
++ rs.setNString("one", query);
++ }
++
++ /*
++ * This method is currently not implemented in BaseRowSet and will
++ * throw a SQLFeatureNotSupportedException
++ */
++ @Test(dataProvider = "rowSetType",
++ expectedExceptions = SQLFeatureNotSupportedException.class)
++ public void commonRowSetTest0152(RowSet rs) throws Exception {
++ short val = 21;
++ rs.setShort("one", val);
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/RowSetFactoryTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,119 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset;
++
++import java.sql.SQLException;
++import javax.sql.rowset.RowSetFactory;
++import javax.sql.rowset.RowSetProvider;
++import static org.testng.Assert.*;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class RowSetFactoryTests extends BaseTest {
++
++ // RowSet implementations that we are testing for
++ private final String DEFAULT_CACHEDROWSET_CLASSNAME = "com.sun.rowset.CachedRowSetImpl";
++ private final String DEFAULT_FILTEREDROWSET_CLASSNAME = "com.sun.rowset.FileteredRowSetImpl";
++ private final String DEFAULT_JDBCROWSET_CLASSNAME = "com.sun.rowset.JdbcRowSetImpl";
++ private final String DEFAULT_JOINROWSET_CLASSNAME = "com.sun.rowset.JoinRowSetImpl";
++ private final String DEFAULT_WEBROWSET_CLASSNAME = "com.sun.rowset.WebRowSetImpl";
++ private final String STUB_FACTORY_CLASSNAME = "util.StubRowSetFactory";
++ private final String STUB_CACHEDROWSET_CLASSNAME = "util.StubCachedRowSetImpl";
++ private final String STUB_FILTEREDROWSET_CLASSNAME = "util.StubFilteredRowSetImpl";
++ private final String STUB_JDBCROWSET_CLASSNAME = "util.StubJdbcRowSetImpl";
++ private final String STUB_JOINROWSET_CLASSNAME = "util.StubJoinRowSetImpl";
++ private final String STUB_WEBROWSET_CLASSNAME = "util.StubWebRowSetImpl";
++
++
++ /*
++ * Validate that the RowSetFactory returned by RowSetProvider.newFactory()
++ * returns the correct RowSet implementations
++ */
++ @Test(dataProvider = "RowSetValues", enabled = true)
++ public void test(RowSetFactory rsf, String impl) throws SQLException {
++ validateRowSetImpl(rsf, impl);
++ }
++
++ /*
++ * Utility Method to validate the RowsetFactory returns the correct
++ * RowSet implementation
++ */
++ private void validateRowSetImpl(RowSetFactory rsf, String implName)
++ throws SQLException {
++ assertNotNull(rsf, "RowSetFactory should not be null");
++ switch (implName) {
++ case DEFAULT_CACHEDROWSET_CLASSNAME:
++ assertTrue(rsf.createCachedRowSet() instanceof com.sun.rowset.CachedRowSetImpl);
++ break;
++ case DEFAULT_FILTEREDROWSET_CLASSNAME:
++ assertTrue(rsf.createFilteredRowSet() instanceof com.sun.rowset.FilteredRowSetImpl);
++ break;
++ case DEFAULT_JDBCROWSET_CLASSNAME:
++ assertTrue(rsf.createJdbcRowSet() instanceof com.sun.rowset.JdbcRowSetImpl);
++ break;
++ case DEFAULT_JOINROWSET_CLASSNAME:
++ assertTrue(rsf.createJoinRowSet() instanceof com.sun.rowset.JoinRowSetImpl);
++ break;
++ case DEFAULT_WEBROWSET_CLASSNAME:
++ assertTrue(rsf.createWebRowSet() instanceof com.sun.rowset.WebRowSetImpl);
++ break;
++ case STUB_CACHEDROWSET_CLASSNAME:
++ assertTrue(rsf.createCachedRowSet() instanceof util.StubCachedRowSetImpl);
++ break;
++ case STUB_FILTEREDROWSET_CLASSNAME:
++ assertTrue(rsf.createFilteredRowSet() instanceof util.StubFilteredRowSetImpl);
++ break;
++ case STUB_JDBCROWSET_CLASSNAME:
++ assertTrue(rsf.createJdbcRowSet() instanceof util.StubJdbcRowSetImpl);
++ break;
++ case STUB_WEBROWSET_CLASSNAME:
++ assertTrue(rsf.createWebRowSet() instanceof util.StubWebRowSetImpl);
++ break;
++ }
++
++ }
++
++ /*
++ * DataProvider used to provide the RowSetFactory and the RowSet
++ * implementation that should be returned
++ */
++ @DataProvider(name = "RowSetValues")
++ private Object[][] RowSetValues() throws SQLException {
++ RowSetFactory rsf = RowSetProvider.newFactory();
++ RowSetFactory rsf1 = RowSetProvider.newFactory(STUB_FACTORY_CLASSNAME, null);
++ return new Object[][]{
++ {rsf, DEFAULT_CACHEDROWSET_CLASSNAME},
++ {rsf, DEFAULT_FILTEREDROWSET_CLASSNAME},
++ {rsf, DEFAULT_JDBCROWSET_CLASSNAME},
++ {rsf, DEFAULT_JOINROWSET_CLASSNAME},
++ {rsf, DEFAULT_WEBROWSET_CLASSNAME},
++ {rsf1, STUB_CACHEDROWSET_CLASSNAME},
++ {rsf1, STUB_FILTEREDROWSET_CLASSNAME},
++ {rsf1, STUB_JDBCROWSET_CLASSNAME},
++ {rsf1, STUB_JOINROWSET_CLASSNAME},
++ {rsf1, STUB_WEBROWSET_CLASSNAME}
++
++ };
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/RowSetMetaDataTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,555 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset;
++
++import java.sql.ResultSetMetaData;
++import java.sql.SQLException;
++import java.sql.Types;
++import javax.sql.RowSetMetaData;
++import javax.sql.rowset.RowSetMetaDataImpl;
++import static org.testng.Assert.*;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class RowSetMetaDataTests extends BaseTest {
++
++ // Max columns used in the tests
++ private final int MAX_COLUMNS = 5;
++ // Instance to be used within the tests
++ private RowSetMetaDataImpl rsmd;
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ rsmd = new RowSetMetaDataImpl();
++ rsmd.setColumnCount(MAX_COLUMNS);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test(Integer col) throws Exception {
++ rsmd.getCatalogName(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test01(Integer col) throws Exception {
++ rsmd.getColumnClassName(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test02(Integer col) throws Exception {
++ rsmd.getColumnDisplaySize(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test03(Integer col) throws Exception {
++ rsmd.getColumnLabel(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test04(Integer col) throws Exception {
++ rsmd.getColumnName(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test05(Integer col) throws Exception {
++ rsmd.getColumnType(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test06(Integer col) throws Exception {
++ rsmd.getColumnTypeName(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test07(Integer col) throws Exception {
++ rsmd.getPrecision(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test08(Integer col) throws Exception {
++ rsmd.getScale(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test09(Integer col) throws Exception {
++ rsmd.getSchemaName(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test10(Integer col) throws Exception {
++ rsmd.getTableName(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test11(Integer col) throws Exception {
++ rsmd.isAutoIncrement(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test12(Integer col) throws Exception {
++ rsmd.isCaseSensitive(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test13(Integer col) throws Exception {
++ rsmd.isCurrency(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test14(Integer col) throws Exception {
++ rsmd.isDefinitelyWritable(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test15(Integer col) throws Exception {
++ rsmd.isNullable(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test16(Integer col) throws Exception {
++ rsmd.isReadOnly(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test17(Integer col) throws Exception {
++ rsmd.isSearchable(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test18(Integer col) throws Exception {
++ rsmd.isSigned(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test19(Integer col) throws Exception {
++ rsmd.isWritable(col);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test20(Integer col) throws Exception {
++ rsmd.setAutoIncrement(col, true);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test21(Integer col) throws Exception {
++ rsmd.setCaseSensitive(col, true);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test22(Integer col) throws Exception {
++ rsmd.setCatalogName(col, null);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test23(Integer col) throws Exception {
++ rsmd.setColumnDisplaySize(col, 5);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test24(Integer col) throws Exception {
++ rsmd.setColumnLabel(col, "label");
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test25(Integer col) throws Exception {
++ rsmd.setColumnName(col, "F1");
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test26(Integer col) throws Exception {
++ rsmd.setColumnType(col, Types.CHAR);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test27(Integer col) throws Exception {
++ rsmd.setColumnTypeName(col, "F1");
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test28(Integer col) throws Exception {
++ rsmd.setCurrency(col, true);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test29(Integer col) throws Exception {
++ rsmd.setNullable(col, ResultSetMetaData.columnNoNulls);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test30(Integer col) throws Exception {
++ rsmd.setPrecision(col, 2);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test31(Integer col) throws Exception {
++ rsmd.setScale(col, 2);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test32(Integer col) throws Exception {
++ rsmd.setSchemaName(col, "Gotham");
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test33(Integer col) throws Exception {
++ rsmd.setSearchable(col, false);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test34(Integer col) throws Exception {
++ rsmd.setSigned(col, false);
++ }
++
++ /*
++ * Validate a SQLException is thrown for an invalid column index
++ */
++ @Test(dataProvider = "invalidColumnRanges",
++ expectedExceptions = SQLException.class)
++ public void test35(Integer col) throws Exception {
++ rsmd.setTableName(col, "SUPERHEROS");
++ }
++
++ /*
++ * Validate that the correct class name is returned for the column
++ * Note: Once setColumnClassName is added to RowSetMetaData, this
++ * method will need to change.
++ */
++ @Test(dataProvider = "columnClassNames")
++ public void test36(Integer type, String name) throws Exception {
++ rsmd.setColumnType(1, type);
++ assertTrue(rsmd.getColumnClassName(1).equals(name));
++ }
++
++ /*
++ * Validate that all of the methods are accessible and the correct value
++ * is returned for each column
++ */
++ @Test(dataProvider = "columnRanges")
++ public void test37(Integer col) throws Exception {
++ rsmd.setAutoIncrement(col, true);
++ assertTrue(rsmd.isAutoIncrement(col));
++ rsmd.setCaseSensitive(col, true);
++ assertTrue(rsmd.isCaseSensitive(col));
++ rsmd.setCatalogName(col, "Gotham");
++ assertTrue(rsmd.getCatalogName(col).equals("Gotham"));
++ rsmd.setColumnDisplaySize(col, 20);
++ assertTrue(rsmd.getColumnDisplaySize(col) == 20);
++ rsmd.setColumnLabel(col, "F1");
++ assertTrue(rsmd.getColumnLabel(col).equals("F1"));
++ rsmd.setColumnName(col, "F1");
++ assertTrue(rsmd.getColumnName(col).equals("F1"));
++ rsmd.setColumnType(col, Types.INTEGER);
++ assertTrue(rsmd.getColumnType(col) == Types.INTEGER);
++ assertTrue(rsmd.getColumnClassName(col).equals(Integer.class.getName()));
++ rsmd.setColumnTypeName(col, "INTEGER");
++ assertTrue(rsmd.getColumnTypeName(col).equals("INTEGER"));
++ rsmd.setCurrency(col, true);
++ assertTrue(rsmd.isCurrency(col));
++ rsmd.setNullable(col, ResultSetMetaData.columnNoNulls);
++ assertTrue(rsmd.isNullable(col) == ResultSetMetaData.columnNoNulls);
++ rsmd.setPrecision(col, 2);
++ assertTrue(rsmd.getPrecision(col) == 2);
++ rsmd.setScale(col, 2);
++ assertTrue(rsmd.getScale(col) == 2);
++ rsmd.setSchemaName(col, "GOTHAM");
++ assertTrue(rsmd.getSchemaName(col).equals("GOTHAM"));
++ rsmd.setSearchable(col, false);
++ assertFalse(rsmd.isSearchable(col));
++ rsmd.setSigned(col, false);
++ assertFalse(rsmd.isSigned(col));
++ rsmd.setTableName(col, "SUPERHEROS");
++ assertTrue(rsmd.getTableName(col).equals("SUPERHEROS"));
++ rsmd.isReadOnly(col);
++ rsmd.isDefinitelyWritable(col);
++ rsmd.isWritable(col);
++
++ }
++
++ /*
++ * Validate that the proper values are accepted by setNullable
++ */
++ @Test(dataProvider = "validSetNullableValues")
++ public void test38(Integer val) throws Exception {
++ rsmd.setNullable(1, val);
++ }
++
++ /*
++ * Validate that the correct type is returned for the column
++ */
++ @Test(dataProvider = "jdbcTypes")
++ public void test39(Integer type) throws Exception {
++ rsmd.setColumnType(1, type);
++ assertTrue(type == rsmd.getColumnType(1));
++ }
++
++ /*
++ * Validate that the correct value is returned from the isXXX methods
++ */
++ @Test(dataProvider = "trueFalse")
++ public void test40(Boolean b) throws Exception {
++ rsmd.setAutoIncrement(1, b);
++ rsmd.setCaseSensitive(1, b);
++ rsmd.setCurrency(1, b);
++ rsmd.setSearchable(1, b);
++ rsmd.setSigned(1, b);
++ assertTrue(rsmd.isAutoIncrement(1) == b);
++ assertTrue(rsmd.isCaseSensitive(1) == b);
++ assertTrue(rsmd.isCurrency(1) == b);
++ assertTrue(rsmd.isSearchable(1) == b);
++ assertTrue(rsmd.isSigned(1) == b);
++ }
++
++ /*
++ * Validate isWrapperFor and unwrap work correctly
++ */
++ @SuppressWarnings("unchecked")
++ @Test
++ public void test99() throws Exception {
++ RowSetMetaData rsmd1 = rsmd;
++ ResultSetMetaData rsmd2 = rsmd;
++ Class clzz = rsmd.getClass();
++ assertTrue(rsmd1.isWrapperFor(clzz));
++ assertTrue(rsmd2.isWrapperFor(clzz));
++ RowSetMetaDataImpl rsmdi = (RowSetMetaDataImpl) rsmd2.unwrap(clzz);
++
++ // False should be returned
++ assertFalse(rsmd1.isWrapperFor(this.getClass()));
++ assertFalse(rsmd2.isWrapperFor(this.getClass()));
++ }
++
++ /*
++ * DataProvider used to provide Date which are not valid and are used
++ * to validate that an IllegalArgumentException will be thrown from the
++ * valueOf method
++ */
++ @DataProvider(name = "validSetNullableValues")
++ private Object[][] validSetNullableValues() {
++ return new Object[][]{
++ {ResultSetMetaData.columnNoNulls},
++ {ResultSetMetaData.columnNullable},
++ {ResultSetMetaData.columnNullableUnknown}
++ };
++ }
++
++ /*
++ * DataProvider used to provide column indexes that are out of range so that
++ * SQLException is thrown
++ */
++ @DataProvider(name = "invalidColumnRanges")
++ private Object[][] invalidColumnRanges() {
++ return new Object[][]{
++ {-1},
++ {0},
++ {MAX_COLUMNS + 1}
++ };
++ }
++
++ /*
++ * DataProvider used to provide the valid column ranges for the
++ * RowSetMetaDataImpl object
++ */
++ @DataProvider(name = "columnRanges")
++ private Object[][] columnRanges() {
++ Object[][] o = new Object[MAX_COLUMNS][1];
++ for (int i = 1; i <= MAX_COLUMNS; i++) {
++ o[i - 1][0] = i;
++ }
++ return o;
++ }
++
++ /*
++ * DataProvider used to specify the value to set via setColumnType and
++ * the expected value to be returned from getColumnClassName
++ */
++ @DataProvider(name = "columnClassNames")
++ private Object[][] columnClassNames() {
++ return new Object[][]{
++ {Types.CHAR, "java.lang.String"},
++ {Types.NCHAR, "java.lang.String"},
++ {Types.VARCHAR, "java.lang.String"},
++ {Types.NVARCHAR, "java.lang.String"},
++ {Types.LONGVARCHAR, "java.lang.String"},
++ {Types.LONGNVARCHAR, "java.lang.String"},
++ {Types.NUMERIC, "java.math.BigDecimal"},
++ {Types.DECIMAL, "java.math.BigDecimal"},
++ {Types.BIT, "java.lang.Boolean"},
++ {Types.TINYINT, "java.lang.Byte"},
++ {Types.SMALLINT, "java.lang.Short"},
++ {Types.INTEGER, "java.lang.Integer"},
++ {Types.FLOAT, "java.lang.Double"},
++ {Types.DOUBLE, "java.lang.Double"},
++ {Types.BINARY, "byte[]"},
++ {Types.VARBINARY, "byte[]"},
++ {Types.LONGVARBINARY, "byte[]"},
++ {Types.DATE, "java.sql.Date"},
++ {Types.TIME, "java.sql.Time"},
++ {Types.TIMESTAMP, "java.sql.Timestamp"},
++ {Types.CLOB, "java.sql.Clob"},
++ {Types.BLOB, "java.sql.Blob"}
++
++ };
++
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/RowSetProviderTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,189 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset;
++
++import com.sun.rowset.RowSetFactoryImpl;
++import java.io.File;
++import java.net.URL;
++import java.net.URLClassLoader;
++import java.sql.SQLException;
++import javax.sql.rowset.RowSetFactory;
++import javax.sql.rowset.RowSetProvider;
++import static org.testng.Assert.*;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.AfterMethod;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubRowSetFactory;
++
++public class RowSetProviderTests extends BaseTest {
++
++ // Default RowSetFactory Implementation
++ private final String DEFFAULT_FACTORY_CLASSNAME = "com.sun.rowset.RowSetFactoryImpl";
++ // Stub RowSetFactory Implementation
++ private final String STUB_FACTORY_CLASSNAME = "util.StubRowSetFactory";
++ // Indicator that the factory implementation does not need to be checked
++ private final String NO_VALADATE_IMPL = "";
++ // Original System property value for javax.sql.rowset.RowSetFactory
++ private static String origFactoryProperty;
++ // Original ClassLoader
++ private static ClassLoader cl;
++ // Path to the location of the jar files used by the ServiceLoader API
++ private static String jarPath;
++
++ /*
++ * Save off the original property value for javax.sql.rowset.RowSetFactory,
++ * original classloader and define the path to the jars directory
++ */
++ @BeforeClass
++ public static void setUpClass() throws Exception {
++ origFactoryProperty = System.getProperty("javax.sql.rowset.RowSetFactory");
++ cl = Thread.currentThread().getContextClassLoader();
++ jarPath = System.getProperty("test.src", ".") + File.separatorChar
++ + "jars" + File.separatorChar;
++ }
++
++ /*
++ * Install the original javax.sql.rowset.RowSetFactory property value
++ */
++ @AfterClass
++ public static void tearDownClass() throws Exception {
++ if (origFactoryProperty != null) {
++ System.setProperty("javax.sql.rowset.RowSetFactory",
++ origFactoryProperty);
++ }
++ }
++
++ /*
++ * Clear the javax.sql.rowset.RowSetFactory property value and
++ * reset the classloader to its original value
++ */
++ @AfterMethod
++ public void tearDownMethod() throws Exception {
++ System.clearProperty("javax.sql.rowset.RowSetFactory");
++ Thread.currentThread().setContextClassLoader(cl);
++ }
++
++ /*
++ * Validate that the correct RowSetFactory is returned by newFactory().
++ */
++ @Test(dataProvider = "RowSetFactoryValues")
++ public void test(RowSetFactory rsf, String impl) throws SQLException {
++ validateProvider(rsf, impl);
++ }
++
++ /*
++ * Validate that the default RowSetFactory is returned by newFactory()
++ * when specified by the javax.sql.rowset.RowSetFactory property.
++ */
++ @Test
++ public void test01() throws SQLException {
++ System.setProperty("javax.sql.rowset.RowSetFactory",
++ DEFFAULT_FACTORY_CLASSNAME);
++ validateProvider(RowSetProvider.newFactory(), DEFFAULT_FACTORY_CLASSNAME);
++ }
++
++ /*
++ * Validate that the correct RowSetFactory is returned by newFactory()
++ * when specified by the javax.sql.rowset.RowSetFactory property.
++ */
++ @Test(enabled = true)
++ public void test02() throws SQLException {
++ System.setProperty("javax.sql.rowset.RowSetFactory", STUB_FACTORY_CLASSNAME);
++ validateProvider(RowSetProvider.newFactory(), STUB_FACTORY_CLASSNAME);
++ }
++
++ /*
++ * Validate that a SQLException is thrown by newFactory()
++ * when specified RowSetFactory specified by the
++ * javax.sql.rowset.RowSetFactory property is not valid.
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test03() throws SQLException {
++ System.setProperty("javax.sql.rowset.RowSetFactory",
++ "invalid.RowSetFactoryImpl");
++ RowSetFactory rsf = RowSetProvider.newFactory();
++ }
++
++ /*
++ * Validate that the correct RowSetFactory is returned by newFactory()
++ * when specified by the ServiceLoader API.
++ */
++ @Test
++ public void test04() throws Exception {
++ File f = new File(jarPath + "goodFactory");
++ URLClassLoader loader = new URLClassLoader(new URL[]{
++ new URL(f.toURI().toString())}, getClass().getClassLoader());
++ Thread.currentThread().setContextClassLoader(loader);
++ validateProvider(RowSetProvider.newFactory(), STUB_FACTORY_CLASSNAME);
++ }
++
++ /*
++ * Validate that a SQLException is thrown by newFactory() if the default
++ * RowSetFactory specified by the ServiceLoader API is not valid
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test05() throws Exception {
++ File f = new File(jarPath + "badFactory");
++ URLClassLoader loader = new URLClassLoader(new URL[]{
++ new URL(f.toURI().toString())}, getClass().getClassLoader());
++ Thread.currentThread().setContextClassLoader(loader);
++ RowSetProvider.newFactory();
++ }
++
++ /*
++ * Utility Method to validate that the RowsetFactory returned from
++ * RowSetProvider.newFactory() is correct
++ */
++ private void validateProvider(RowSetFactory rsf, String implName) {
++ assertNotNull(rsf, "RowSetFactory should not be null");
++ switch (implName) {
++ case DEFFAULT_FACTORY_CLASSNAME:
++ assertTrue(rsf instanceof RowSetFactoryImpl);
++ break;
++ case STUB_FACTORY_CLASSNAME:
++ assertTrue(rsf instanceof StubRowSetFactory);
++ break;
++ default:
++ }
++ }
++
++ /*
++ * DataProvider used to provide a RowSetFactory and the expected
++ * RowSetFactory implementation that should be returned
++ */
++ @DataProvider(name = "RowSetFactoryValues")
++ private Object[][] RowSetFactoryValues() throws SQLException {
++ RowSetFactory rsf = RowSetProvider.newFactory();
++ RowSetFactory rsf1 = RowSetProvider.newFactory(STUB_FACTORY_CLASSNAME, null);
++ RowSetFactory rsf2 = RowSetProvider.newFactory(DEFFAULT_FACTORY_CLASSNAME, null);
++ return new Object[][]{
++ {rsf, NO_VALADATE_IMPL},
++ {rsf, DEFFAULT_FACTORY_CLASSNAME},
++ {rsf1, STUB_FACTORY_CLASSNAME},
++ {rsf2, DEFFAULT_FACTORY_CLASSNAME}
++ };
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/RowSetWarningTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,238 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset;
++
++import java.sql.SQLException;
++import javax.sql.rowset.RowSetWarning;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class RowSetWarningTests extends BaseTest {
++
++ private final String[] warnings = {"Warning 1", "cause 1", "Warning 2",
++ "Warning 3", "cause 2"};
++
++ /*
++ * Create RowSetWarning and setting all objects to null
++ */
++ @Test
++ public void test() {
++ RowSetWarning e = new RowSetWarning(null, null, errorCode);
++ assertTrue(e.getMessage() == null && e.getSQLState() == null
++ && e.getCause() == null && e.getErrorCode() == errorCode);
++ }
++
++ /*
++ * Create RowSetWarning with no-arg constructor
++ */
++ @Test
++ public void test01() {
++ RowSetWarning ex = new RowSetWarning();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /*
++ * Create RowSetWarning with message
++ */
++ @Test
++ public void test02() {
++ RowSetWarning ex = new RowSetWarning(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /*
++ * Create RowSetWarning with message, and SQLState
++ */
++ @Test
++ public void test03() {
++
++ RowSetWarning ex = new RowSetWarning(reason, state);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /*
++ * Create RowSetWarning with message, SQLState, and error code
++ */
++ @Test
++ public void test04() {
++ RowSetWarning ex = new RowSetWarning(reason, state, errorCode);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState().equals(state)
++ && ex.getCause() == null
++ && ex.getErrorCode() == errorCode);
++ }
++
++ /*
++ * Serialize a RowSetWarning and make sure you can read it back properly
++ */
++ @Test
++ public void test05() throws Exception {
++ RowSetWarning e = new RowSetWarning(reason, state, errorCode);
++ e.initCause(t);
++ RowSetWarning ex1 = createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && cause.equals(ex1.getCause().toString())
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /*
++ * Validate that the ordering of the returned Exceptions is correct using
++ * for-each loop
++ */
++ @Test
++ public void test06() {
++ RowSetWarning ex = new RowSetWarning("Exception 1");
++ ex.initCause(t1);
++ RowSetWarning ex1 = new RowSetWarning("Exception 2");
++ RowSetWarning ex2 = new RowSetWarning("Exception 3");
++ ex2.initCause(t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /*
++ * Validate that the ordering of the returned Exceptions is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test07() {
++ RowSetWarning ex = new RowSetWarning("Exception 1");
++ ex.initCause(t1);
++ RowSetWarning ex1 = new RowSetWarning("Exception 2");
++ RowSetWarning ex2 = new RowSetWarning("Exception 3");
++ ex2.initCause(t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ SQLException sqe = ex;
++ while (sqe != null) {
++ assertTrue(msgs[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextException();
++ }
++ }
++
++ /*
++ * Validate that the ordering of the returned RowSetWarning is correct using
++ * for-each loop
++ */
++ @Test
++ public void test08() {
++ RowSetWarning ex = new RowSetWarning("Warning 1");
++ ex.initCause(t1);
++ RowSetWarning ex1 = new RowSetWarning("Warning 2");
++ RowSetWarning ex2 = new RowSetWarning("Warning 3");
++ ex2.initCause(t2);
++ ex.setNextWarning(ex1);
++ ex.setNextWarning(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(warnings[num++].equals(e.getMessage()));
++ }
++ }
++
++ /**
++ * Validate that the ordering of the returned RowSetWarning is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test09() {
++ RowSetWarning ex = new RowSetWarning("Warning 1");
++ ex.initCause(t1);
++ RowSetWarning ex1 = new RowSetWarning("Warning 2");
++ RowSetWarning ex2 = new RowSetWarning("Warning 3");
++ ex2.initCause(t2);
++ ex.setNextWarning(ex1);
++ ex.setNextWarning(ex2);
++ int num = 0;
++ RowSetWarning sqe = ex;
++ while (sqe != null) {
++ assertTrue(warnings[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextWarning();
++ }
++ }
++
++ /*
++ * Serialize a RowSetWarning and make sure you can read it back properly
++ */
++ @Test
++ public void test10() throws Exception {
++ RowSetWarning e = new RowSetWarning(reason, state, errorCode);
++ RowSetWarning ex1 = createSerializedException(e);
++ assertTrue(reason.equals(ex1.getMessage())
++ && ex1.getSQLState().equals(state)
++ && ex1.getCause() == null
++ && ex1.getErrorCode() == errorCode);
++ }
++
++ /*
++ * Serialize a RowSetWarning and make sure you can read it back properly.
++ * Validate that the ordering of the returned RowSetWarning is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test11() throws Exception {
++ RowSetWarning ex = new RowSetWarning("Warning 1");
++ ex.initCause(t1);
++ RowSetWarning ex1 = new RowSetWarning("Warning 2");
++ RowSetWarning ex2 = new RowSetWarning("Warning 3");
++ ex2.initCause(t2);
++ ex.setNextWarning(ex1);
++ ex.setNextWarning(ex2);
++ int num = 0;
++ RowSetWarning sqe = createSerializedException(ex);
++ while (sqe != null) {
++ assertTrue(warnings[num++].equals(sqe.getMessage()));
++ Throwable c = sqe.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ sqe = sqe.getNextWarning();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/cachedrowset/CachedRowSetTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * 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 test.rowset.cachedrowset;
++
++import java.sql.SQLException;
++import javax.sql.rowset.CachedRowSet;
++
++public class CachedRowSetTests extends CommonCachedRowSetTests {
++
++ @Override
++ protected CachedRowSet newInstance() throws SQLException {
++ return rsf.createCachedRowSet();
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/cachedrowset/CommonCachedRowSetTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1612 @@
++/*
++ * 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 test.rowset.cachedrowset;
++
++import java.math.BigDecimal;
++import java.sql.Array;
++import java.sql.Date;
++import java.sql.JDBCType;
++import java.sql.Ref;
++import java.sql.ResultSet;
++import java.sql.ResultSetMetaData;
++import java.sql.SQLException;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.sql.Types;
++import java.time.LocalDate;
++import java.time.LocalDateTime;
++import java.time.LocalTime;
++import java.util.Collection;
++import javax.sql.RowSet;
++import javax.sql.rowset.CachedRowSet;
++import javax.sql.rowset.RowSetMetaDataImpl;
++import javax.sql.rowset.serial.SerialRef;
++import javax.sql.rowset.spi.SyncFactory;
++import javax.sql.rowset.spi.SyncProvider;
++import javax.sql.rowset.spi.SyncProviderException;
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertFalse;
++import static org.testng.Assert.assertNull;
++import static org.testng.Assert.assertTrue;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import test.rowset.CommonRowSetTests;
++import util.StubArray;
++import util.StubRef;
++import util.StubSyncProvider;
++import util.TestRowSetListener;
++
++public abstract class CommonCachedRowSetTests extends CommonRowSetTests {
++
++ /*
++ * DATATYPES Table column names
++ */
++ private final String[] DATATYPES_COLUMN_NAMES = {"AINTEGER", "ACHAR",
++ "AVARCHAR", "ALONG", "ABOOLEAN", "ASHORT", "ADOUBLE", "ABIGDECIMAL",
++ "AREAL", "ABYTE", "ADATE", "ATIME", "ATIMESTAMP", "ABYTES", "ARRAY",
++ "AREF", "AFLOAT"};
++
++ /*
++ * Initializes a RowSet containing the DATAYPES data
++ */
++ protected <T extends RowSet> T createDataTypesRowSet() throws SQLException {
++ T rs = (T) newInstance();
++ initDataTypesMetaData((CachedRowSet) rs);
++ createDataTypesRows(rs);
++ // Make sure you are not on the insertRow
++ rs.moveToCurrentRow();
++ return rs;
++ }
++
++ //DataProviders to use for common tests
++
++ /*
++ * DataProvider that uses a RowSet with the COFFEE_HOUSES Table
++ */
++ @DataProvider(name = "rowsetUsingCoffeeHouses")
++ protected Object[][] rowsetUsingCoffeeHouses() throws Exception {
++ RowSet rs = createCoffeeHousesRowSet();
++ return new Object[][]{
++ {rs}
++ };
++ }
++
++ /*
++ * DataProvider that uses a RowSet with the COFFEES Table
++ */
++ @DataProvider(name = "rowsetUsingCoffees")
++ protected Object[][] rowsetUsingCoffees() throws Exception {
++ RowSet rs = createCoffeesRowSet();
++ return new Object[][]{
++ {rs}
++ };
++ }
++
++ /*
++ * DataProvider that uses a RowSet with the DATAYPES Table and
++ * used to validate the various supported data types
++ */
++ @DataProvider(name = "rowsetUsingDataTypes")
++ protected Object[][] rowsetUsingDataTypes() throws Exception {
++
++ CachedRowSet rs = createDataTypesRowSet();
++ return new Object[][]{
++ {rs, JDBCType.INTEGER},
++ {rs, JDBCType.CHAR},
++ {rs, JDBCType.VARCHAR},
++ {rs, JDBCType.BIGINT},
++ {rs, JDBCType.BOOLEAN},
++ {rs, JDBCType.SMALLINT},
++ {rs, JDBCType.DOUBLE},
++ {rs, JDBCType.DECIMAL},
++ {rs, JDBCType.REAL},
++ {rs, JDBCType.TINYINT},
++ {rs, JDBCType.DATE},
++ {rs, JDBCType.TIME},
++ {rs, JDBCType.TIMESTAMP},
++ {rs, JDBCType.VARBINARY},
++ {rs, JDBCType.ARRAY},
++ {rs, JDBCType.REF},
++ {rs, JDBCType.FLOAT}
++ };
++ }
++
++ /*
++ * Initializes the DATAYPES table metadata
++ */
++ protected void initDataTypesMetaData(CachedRowSet crs) throws SQLException {
++ RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
++ crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
++
++ rsmd.setColumnCount(DATATYPES_COLUMN_NAMES.length);
++
++ for (int i = 1; i <= DATATYPES_COLUMN_NAMES.length; i++) {
++ rsmd.setColumnName(i, DATATYPES_COLUMN_NAMES[i - 1]);
++ rsmd.setColumnLabel(i, rsmd.getColumnName(i));
++ }
++
++ rsmd.setColumnType(1, Types.INTEGER);
++ rsmd.setColumnType(2, Types.CHAR);
++ rsmd.setColumnType(3, Types.VARCHAR);
++ rsmd.setColumnType(4, Types.BIGINT);
++ rsmd.setColumnType(5, Types.BOOLEAN);
++ rsmd.setColumnType(6, Types.SMALLINT);
++ rsmd.setColumnType(7, Types.DOUBLE);
++ rsmd.setColumnType(8, Types.DECIMAL);
++ rsmd.setColumnType(9, Types.REAL);
++ rsmd.setColumnType(10, Types.TINYINT);
++ rsmd.setColumnType(11, Types.DATE);
++ rsmd.setColumnType(12, Types.TIME);
++ rsmd.setColumnType(13, Types.TIMESTAMP);
++ rsmd.setColumnType(14, Types.VARBINARY);
++ rsmd.setColumnType(15, Types.ARRAY);
++ rsmd.setColumnType(16, Types.REF);
++ rsmd.setColumnType(17, Types.FLOAT);
++ crs.setMetaData(rsmd);
++
++ }
++
++ /*
++ * Add rows to DATAYPES table
++ */
++ protected void createDataTypesRows(RowSet crs) throws SQLException {
++
++ Integer aInteger = 100;
++ String aChar = "Oswald Cobblepot";
++ Long aLong = Long.MAX_VALUE;
++ Short aShort = Short.MAX_VALUE;
++ Double aDouble = Double.MAX_VALUE;
++ BigDecimal aBigDecimal = BigDecimal.ONE;
++ Boolean aBoolean = false;
++ Float aFloat = Float.MAX_VALUE;
++ Byte aByte = Byte.MAX_VALUE;
++ Date aDate = Date.valueOf(LocalDate.now());
++ Time aTime = Time.valueOf(LocalTime.now());
++ Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now());
++ Array aArray = new StubArray("INTEGER", new Object[1]);
++ Ref aRef = new SerialRef(new StubRef("INTEGER", query));
++ byte[] bytes = new byte[10];
++ crs.moveToInsertRow();
++ crs.updateInt(1, aInteger);
++ crs.updateString(2, aChar);
++ crs.updateString(3, aChar);
++ crs.updateLong(4, aLong);
++ crs.updateBoolean(5, aBoolean);
++ crs.updateShort(6, aShort);
++ crs.updateDouble(7, aDouble);
++ crs.updateBigDecimal(8, aBigDecimal);
++ crs.updateFloat(9, aFloat);
++ crs.updateByte(10, aByte);
++ crs.updateDate(11, aDate);
++ crs.updateTime(12, aTime);
++ crs.updateTimestamp(13, aTimeStamp);
++ crs.updateBytes(14, bytes);
++ crs.updateArray(15, aArray);
++ crs.updateRef(16, aRef);
++ crs.updateDouble(17, aDouble);
++ crs.insertRow();
++ crs.moveToCurrentRow();
++
++ }
++
++ /*
++ * Dermine if a Row exists in a ResultSet by its primary key
++ * If the parameter deleteRow is true, delete the row and validate
++ * the RowSet indicates it is deleted
++ */
++ protected boolean findRowByPrimaryKey(RowSet rs, int id, int idPos,
++ boolean deleteRow) throws Exception {
++ boolean foundRow = false;
++ rs.beforeFirst();
++ while (rs.next()) {
++ if (rs.getInt(idPos) == id) {
++ foundRow = true;
++ if (deleteRow) {
++ rs.deleteRow();
++ // validate row is marked as deleted
++ assertTrue(rs.rowDeleted());
++ }
++ break;
++ }
++ }
++ return foundRow;
++ }
++
++ /*
++ * Wrapper method to find if a row exists within a RowSet by its primary key
++ */
++ protected boolean findRowByPrimaryKey(RowSet rs, int id, int idPos) throws Exception {
++ return findRowByPrimaryKey(rs, id, idPos, false);
++ }
++
++ /*
++ * Wrapper method to find if a row exists within a RowSet by its primary key
++ * and delete it
++ */
++ protected boolean deleteRowByPrimaryKey(RowSet rs, int id, int idPos) throws Exception {
++ return findRowByPrimaryKey(rs, id, idPos, true);
++ }
++
++ /*
++ * Utility method that compares two ResultSetMetaDataImpls for containing
++ * the same values
++ */
++ private void compareMetaData(ResultSetMetaData rsmd,
++ ResultSetMetaData rsmd1) throws SQLException {
++
++ assertEquals(rsmd1.getColumnCount(), rsmd.getColumnCount());
++ int cols = rsmd.getColumnCount();
++ for (int i = 1; i <= cols; i++) {
++ assertTrue(rsmd1.getCatalogName(i).equals(rsmd.getCatalogName(i)));
++ assertTrue(rsmd1.getColumnClassName(i).equals(rsmd.getColumnClassName(i)));
++ assertTrue(rsmd1.getColumnDisplaySize(i) == rsmd.getColumnDisplaySize(i));
++ assertTrue(rsmd1.getColumnLabel(i).equals(rsmd.getColumnLabel(i)));
++ assertTrue(rsmd1.getColumnName(i).equals(rsmd.getColumnName(i)));
++ assertTrue(rsmd1.getColumnType(i) == rsmd.getColumnType(i));
++ assertTrue(rsmd1.getPrecision(i) == rsmd.getPrecision(i));
++ assertTrue(rsmd1.getScale(i) == rsmd.getScale(i));
++ assertTrue(rsmd1.getSchemaName(i).equals(rsmd.getSchemaName(i)));
++ assertTrue(rsmd1.getTableName(i).equals(rsmd.getTableName(i)));
++ assertTrue(rsmd1.isAutoIncrement(i) == rsmd.isAutoIncrement(i));
++ assertTrue(rsmd1.isCaseSensitive(i) == rsmd.isCaseSensitive(i));
++ assertTrue(rsmd1.isCurrency(i) == rsmd.isCurrency(i));
++ assertTrue(rsmd1.isDefinitelyWritable(i) == rsmd.isDefinitelyWritable(i));
++ assertTrue(rsmd1.isNullable(i) == rsmd.isNullable(i));
++ assertTrue(rsmd1.isReadOnly(i) == rsmd.isReadOnly(i));
++ assertTrue(rsmd1.isSearchable(i) == rsmd.isSearchable(i));
++ assertTrue(rsmd1.isSigned(i) == rsmd.isSigned(i));
++ assertTrue(rsmd1.isWritable(i) == rsmd.isWritable(i));
++
++ }
++ }
++
++ /*
++ * Utility method to compare two rowsets
++ */
++ private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception {
++
++ int rows = crs.size();
++ assertTrue(rows == crs1.size());
++
++ ResultSetMetaData rsmd = crs.getMetaData();
++
++ compareMetaData(rsmd, crs1.getMetaData());
++ int cols = rsmd.getColumnCount();
++
++ for (int row = 1; row <= rows; row++) {
++ crs.absolute((row));
++ crs1.absolute(row);
++ for (int col = 1; col <= cols; col++) {
++ compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)),
++ crs, crs1, col);
++ }
++ }
++
++ }
++
++ /*
++ * Utility method to compare two columns
++ */
++ private void compareColumnValue(JDBCType type, ResultSet rs, ResultSet rs1,
++ int col) throws SQLException {
++
++ switch (type) {
++ case INTEGER:
++ assertTrue(rs.getInt(col) == rs1.getInt(col));
++ break;
++ case CHAR:
++ case VARCHAR:
++ assertTrue(rs.getString(col).equals(rs1.getString(col)));
++ break;
++ case BIGINT:
++ assertTrue(rs.getLong(col) == rs1.getLong(col));
++ break;
++ case BOOLEAN:
++ assertTrue(rs.getBoolean(col) == rs1.getBoolean(col));
++ break;
++ case SMALLINT:
++ assertTrue(rs.getShort(col) == rs1.getShort(col));
++ break;
++ case DOUBLE:
++ case FLOAT:
++ assertTrue(rs.getDouble(col) == rs1.getDouble(col));
++ break;
++ case DECIMAL:
++ assertTrue(rs.getBigDecimal(col).equals(rs1.getBigDecimal(col)));
++ break;
++ case REAL:
++ assertTrue(rs.getFloat(col) == rs1.getFloat(col));
++ break;
++ case TINYINT:
++ assertTrue(rs.getByte(col) == rs1.getByte(col));
++ break;
++ case DATE:
++ assertTrue(rs.getDate(col).equals(rs1.getDate(col)));
++ break;
++ case TIME:
++ assertTrue(rs.getTime(col).equals(rs1.getTime(col)));
++ break;
++ case TIMESTAMP:
++ assertTrue(rs.getTimestamp(col).equals(rs1.getTimestamp(col)));
++ break;
++ }
++ }
++
++ /*
++ * Validate SyncProviderException is thrown when acceptChanges is called
++ * but there is not a way to make a connection to the datasource
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SyncProviderException.class)
++ public void commonCachedRowSetTest0000(CachedRowSet rs) throws Exception {
++ rs.acceptChanges();
++ rs.close();
++ }
++
++ /*
++ * Validate SyncProviderException is thrown when acceptChanges is called
++ * when null is passed as the datasource
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SyncProviderException.class)
++ public void commonCachedRowSetTest0001(CachedRowSet rs) throws Exception {
++ rs.acceptChanges(null);
++ rs.close();
++ }
++
++ /*
++ * Validate that that RIOPtimsticProvider is the default SyncProvider
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0002(CachedRowSet rs) throws SQLException {
++ SyncProvider sp = rs.getSyncProvider();
++ assertTrue(sp instanceof com.sun.rowset.providers.RIOptimisticProvider);
++ rs.close();
++ }
++
++ /*
++ * Validate that you can specify a SyncProvider
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0003(CachedRowSet rs) throws SQLException {
++
++ // Register a provider and make sure it is avaiable
++ SyncFactory.registerProvider(stubProvider);
++ rs.setSyncProvider(stubProvider);
++ SyncProvider sp = rs.getSyncProvider();
++ assertTrue(sp instanceof StubSyncProvider);
++ SyncFactory.unregisterProvider(stubProvider);
++ rs.close();
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyRowSetChanged is called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0004(CachedRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.release();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ rs.close();
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyRowSetChanged is called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0005(CachedRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.restoreOriginal();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ rs.close();
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyRowChanged is called
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0006(RowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.moveToInsertRow();
++ rs.updateInt(1, 10024);
++ rs.updateString(2, "Sacramento");
++ rs.updateInt(3, 1987);
++ rs.updateInt(4, 2341);
++ rs.updateInt(5, 4328);
++ rs.insertRow();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
++ rs.close();
++ }
++
++ /*
++ * Create a multiple RowSetListeners and validate that notifyRowChanged,
++ * notifiyMoved is called on all listners
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0007(RowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ TestRowSetListener rsl2 = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.addRowSetListener(rsl2);
++ rs.first();
++ rs.updateInt(1, 1961);
++ rs.updateString(2, "Pittsburgh");
++ rs.updateInt(3, 1987);
++ rs.updateInt(4, 2341);
++ rs.updateInt(5, 6689);
++ rs.updateRow();
++ assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED
++ | TestRowSetListener.ROW_CHANGED));
++ assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED
++ | TestRowSetListener.ROW_CHANGED));
++ rs.close();
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyRowChanged and
++ * notifyCursorMoved are called
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0008(CachedRowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++
++ rs.first();
++ assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
++ rs.deleteRow();
++ assertTrue(
++ rsl.isNotified(TestRowSetListener.ROW_CHANGED | TestRowSetListener.CURSOR_MOVED));
++ rsl.resetFlag();
++ rs.setShowDeleted(true);
++ rs.undoDelete();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
++ rs.close();
++ }
++
++ /*
++ * Create a RowSetListener and validate that notifyCursorMoved is called
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0009(RowSet rs) throws Exception {
++ TestRowSetListener rsl = new TestRowSetListener();
++ rs.addRowSetListener(rsl);
++ rs.beforeFirst();
++ assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
++ rs.close();
++ }
++
++ /*
++ * Validate that getTableName() returns the proper values
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0010(CachedRowSet rs) throws Exception {
++ assertNull(rs.getTableName());
++ rs.setTableName(COFFEE_HOUSES_TABLE);
++ assertTrue(rs.getTableName().equals(COFFEE_HOUSES_TABLE));
++ rs.close();
++ }
++
++ /*
++ * Validate that getKeyColumns() returns the proper values
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0011(CachedRowSet rs) throws Exception {
++ int[] pkeys = {1, 3};
++ assertNull(rs.getKeyColumns());
++ rs.setKeyColumns(pkeys);
++ assertEquals(rs.getKeyColumns(), pkeys);
++ rs.close();
++ }
++
++ /*
++ * Validate that setMatchColumn throws a SQLException if the column
++ * index specified is out of range
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0012(CachedRowSet rs) throws Exception {
++ rs.setMatchColumn(-1);
++ rs.close();
++ }
++
++ /*
++ * Validate that setMatchColumn throws a SQLException if the column
++ * index specified is out of range
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0013(CachedRowSet rs) throws Exception {
++ int[] cols = {1, -1};
++ rs.setMatchColumn(cols);
++ rs.close();
++ }
++
++ /*
++ * Validate that setMatchColumn throws a SQLException if the column
++ * index specified is out of range
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0014(CachedRowSet rs) throws Exception {
++ rs.setMatchColumn((String) null);
++ rs.close();
++ }
++
++ /*
++ * Validate that setMatchColumn throws a SQLException if the column
++ * index specified is out of range
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0015(CachedRowSet rs) throws Exception {
++ String[] cols = {"ID", null};
++ rs.setMatchColumn(cols);
++ }
++
++ /*
++ * Validate that getMatchColumn returns the same value specified by
++ * setMatchColumn
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
++ public void commonCachedRowSetTest0016(CachedRowSet rs) throws Exception {
++ int[] expectedCols = {1};
++ String[] expectedColNames = {"ID"};
++ rs.setMatchColumn(1);
++ int[] actualCols = rs.getMatchColumnIndexes();
++ String[] actualColNames = rs.getMatchColumnNames();
++ for (int i = 0; i < actualCols.length; i++) {
++ System.out.println(actualCols[i]);
++ }
++ assertEquals(actualCols, expectedCols);
++ assertEquals(actualColNames, expectedColNames);
++ rs.close();
++ }
++
++ /*
++ * Validate that getMatchColumn returns the same value specified by
++ * setMatchColumn
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
++ public void commonCachedRowSetTest0017(CachedRowSet rs) throws Exception {
++ int[] expectedCols = {1};
++ String[] expectedColNames = {"ID"};
++ rs.setMatchColumn(expectedColNames[0]);
++ int[] actualCols = rs.getMatchColumnIndexes();
++ String[] actualColNames = rs.getMatchColumnNames();
++ assertEquals(actualCols, expectedCols);
++ assertEquals(actualColNames, expectedColNames);
++ rs.close();
++ }
++
++ /*
++ * Validate that getMatchColumn returns the same valid value specified by
++ * setMatchColumn
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
++ public void commonCachedRowSetTest0018(CachedRowSet rs) throws Exception {
++ int[] expectedCols = {1, 3};
++ String[] expectedColNames = {"COF_ID", "SUP_ID"};
++ rs.setMatchColumn(expectedCols);
++ int[] actualCols = rs.getMatchColumnIndexes();
++ String[] actualColNames = rs.getMatchColumnNames();
++ assertEquals(actualCols, expectedCols);
++ assertEquals(actualColNames, expectedColNames);
++ assertEquals(actualCols, expectedCols);
++ rs.close();
++ }
++
++ /*
++ * Validate that getMatchColumn returns the same valid value specified by
++ * setMatchColumn
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
++ public void commonCachedRowSetTest0019(CachedRowSet rs) throws Exception {
++ int[] expectedCols = {1, 3};
++ String[] expectedColNames = {"COF_ID", "SUP_ID"};
++ rs.setMatchColumn(expectedColNames);
++ int[] actualCols = rs.getMatchColumnIndexes();
++ String[] actualColNames = rs.getMatchColumnNames();
++ assertEquals(actualCols, expectedCols);
++ assertEquals(actualColNames, expectedColNames);
++ rs.close();
++ }
++
++ /*
++ * Validate that getMatchColumnIndexes throws a SQLException if
++ * unsetMatchColumn has been called
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0020(CachedRowSet rs) throws Exception {
++ rs.setMatchColumn(1);
++ int[] actualCols = rs.getMatchColumnIndexes();
++ assertTrue(actualCols != null);
++ rs.unsetMatchColumn(1);
++ actualCols = rs.getMatchColumnIndexes();
++ rs.close();
++ }
++
++ /*
++ * Validate that getMatchColumnNames throws a SQLException if
++ * unsetMatchColumn has been called
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0021(CachedRowSet rs) throws Exception {
++ String matchColumn = "ID";
++ rs.setMatchColumn(matchColumn);
++ String[] actualColNames = rs.getMatchColumnNames();
++ assertTrue(actualColNames != null);
++ rs.unsetMatchColumn(matchColumn);
++ actualColNames = rs.getMatchColumnNames();
++ rs.close();
++ }
++
++ /*
++ * Validate that getMatchColumnIndexes throws a SQLException if
++ * unsetMatchColumn has been called
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0022(CachedRowSet rs) throws Exception {
++ int[] expectedCols = {1, 3};
++ rs.setMatchColumn(expectedCols);
++ int[] actualCols = rs.getMatchColumnIndexes();
++ assertTrue(actualCols != null);
++ rs.unsetMatchColumn(expectedCols);
++ actualCols = rs.getMatchColumnIndexes();
++ rs.close();
++ }
++
++ /*
++ * Validate that getMatchColumnNames throws a SQLException if
++ * unsetMatchColumn has been called
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0023(CachedRowSet rs) throws Exception {
++ String[] expectedColNames = {"COF_ID", "SUP_ID"};
++ rs.setMatchColumn(expectedColNames);
++ String[] actualColNames = rs.getMatchColumnNames();
++ assertTrue(actualColNames != null);
++ rs.unsetMatchColumn(expectedColNames);
++ actualColNames = rs.getMatchColumnNames();
++ rs.close();
++ }
++
++ /*
++ * Validate size() returns the correct number of rows
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0024(CachedRowSet rs) throws Exception {
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ rs.close();
++ }
++
++ /*
++ * Validate that the correct rows are returned comparing the primary
++ * keys
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0025(RowSet rs) throws SQLException {
++ assertEquals(getPrimaryKeys(rs), COFFEE_HOUSES_PRIMARY_KEYS);
++ rs.close();
++ }
++
++ /*
++ * Delete a row within the RowSet using its primary key
++ * Validate the visibility of the row depending on the value of
++ * setShowdelete
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0026(CachedRowSet rs) throws Exception {
++ Object[] afterDelete = {
++ 10023, 33002, 10040, 32001, 10042, 10024, 10039, 10041,
++ 33005, 33010, 10037, 10034, 32004
++ };
++ int rowToDelete = 10035;
++ // All rows should be found
++ assertEquals(getPrimaryKeys(rs), COFFEE_HOUSES_PRIMARY_KEYS);
++ // Delete the row
++ assertTrue(deleteRowByPrimaryKey(rs, rowToDelete, 1));
++ // With setShowDeleted(false) which is the default,
++ // the deleted row should not be visible
++ assertFalse(findRowByPrimaryKey(rs, rowToDelete, 1));
++ assertEquals(getPrimaryKeys(rs), afterDelete);
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ // With setShowDeleted(true), the deleted row should be visible
++ rs.setShowDeleted(true);
++ assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1));
++ rs.close();
++ }
++
++ /*
++ * Validate that there is no page size by default
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0027(CachedRowSet rs) throws Exception {
++ assertTrue(rs.getPageSize() == 0);
++ rs.close();
++ }
++
++ /*
++ * Validate the value you set via setPageSize is returned by getPageSize
++ * then reset to having no limit
++ */
++ @Test(dataProvider = "rowSetType")
++ public void commonCachedRowSetTest0028(CachedRowSet rs) throws Exception {
++ int rows = 100;
++ rs.setPageSize(rows);
++ assertTrue(rows == rs.getPageSize());
++ rs.setPageSize(0);
++ assertTrue(rs.getPageSize() == 0);
++ rs.close();
++ }
++
++ /*
++ * Validate SQLException is thrown when an invalid value is specified
++ * for setPageSize
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0029(CachedRowSet rs) throws Exception {
++ rs.setPageSize(-1);
++ rs.close();
++ }
++
++ /*
++ * Validate SQLException is thrown when nextPage is called without a
++ * call to populate or execute
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0030(CachedRowSet rs) throws Exception {
++ rs.nextPage();
++ rs.close();
++ }
++
++ /*
++ * Validate SQLException is thrown when previousPage is called without a
++ * call to populate or execute
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0031(CachedRowSet rs) throws Exception {
++ rs.previousPage();
++ rs.close();
++ }
++
++
++ /*
++ * Validate SQLException is thrown when execute is called
++ * but there is not a way to make a connection to the datasource
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0032(CachedRowSet rs) throws Exception {
++ rs.execute(null);
++ rs.close();
++ }
++
++ /*
++ * Validate SQLException is thrown when execute is called
++ * but there is not a way to make a connection to the datasource
++ */
++ @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0033(CachedRowSet rs) throws Exception {
++ rs.execute();
++ rs.close();
++ }
++
++ /*
++ * Validate that toCollection(<column>) returns the proper values
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0034(CachedRowSet rs) throws Exception {
++ Object[] cities = {"Mendocino", "Seattle", "SF", "Portland", "SF",
++ "Sacramento", "Carmel", "LA", "Olympia", "Seattle", "SF",
++ "LA", "San Jose", "Eugene"};
++ rs.beforeFirst();
++ assertEquals(rs.toCollection(2).toArray(), cities);
++ assertEquals(rs.toCollection("CITY").toArray(), cities);
++ rs.close();
++ }
++
++ /*
++ * Validate that toCollection() returns the proper values
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0035(CachedRowSet rs) throws Exception {
++ Collection<?> col = rs.toCollection();
++ assertTrue(rs.size() == col.size());
++ assertTrue(rs.toCollection().containsAll(col)
++ && col.containsAll(rs.toCollection()));
++ try ( // Validate that False is returned when compared to a different RowSet;
++ CachedRowSet crs1 = createCoffeesRowSet()) {
++ assertFalse(crs1.toCollection().containsAll(col)
++ && col.containsAll(crs1.toCollection()));
++ }
++ rs.close();
++
++ }
++
++ /*
++ * Validate that createCopy() returns the proper values
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0036(CachedRowSet rs) throws Exception {
++ try (CachedRowSet crs1 = rs.createCopy()) {
++ compareRowSets(rs, crs1);
++ }
++ rs.close();
++ }
++
++ /*
++ * Validate that createCopySchema() returns the proper values
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0037(CachedRowSet rs) throws Exception {
++ try (CachedRowSet crs1 = rs.createCopySchema()) {
++ assertTrue(crs1.size() == 0);
++ compareMetaData(crs1.getMetaData(), rs.getMetaData());
++ }
++ rs.close();
++ }
++
++ /*
++ * Validate that createCopyNoConstraints() returns the proper values
++ * and getMatchColumnIndexes should throw a SQLException. This test
++ * specifies setMatchColumn(int)
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0038(CachedRowSet rs) throws Exception {
++ rs.setMatchColumn(1);
++ try (CachedRowSet crs1 = rs.createCopyNoConstraints()) {
++ assertTrue(crs1.size() == COFFEE_HOUSES_ROWS);
++ compareRowSets(rs, crs1);
++ boolean recievedSQE = false;
++ try {
++ int[] indexes = crs1.getMatchColumnIndexes();
++ } catch (SQLException e) {
++ recievedSQE = true;
++ }
++ assertTrue(recievedSQE);
++ recievedSQE = false;
++ try {
++ String[] colNames = crs1.getMatchColumnNames();
++ } catch (SQLException e) {
++ recievedSQE = true;
++ }
++ assertTrue(recievedSQE);
++ }
++ rs.close();
++ }
++
++ /*
++ * Validate that createCopyNoConstraints() returns the proper values
++ * and getMatchColumnIndexes should throw a SQLException. This test
++ * specifies setMatchColumn(String)
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0039(CachedRowSet rs) throws Exception {
++ rs.setMatchColumn("ID");
++ try (CachedRowSet crs1 = rs.createCopyNoConstraints()) {
++ assertTrue(crs1.size() == COFFEE_HOUSES_ROWS);
++ compareRowSets(rs, crs1);
++ boolean recievedSQE = false;
++ try {
++ int[] indexes = crs1.getMatchColumnIndexes();
++ } catch (SQLException e) {
++ recievedSQE = true;
++ }
++ assertTrue(recievedSQE);
++ recievedSQE = false;
++ try {
++ String[] colNames = crs1.getMatchColumnNames();
++ } catch (SQLException e) {
++ recievedSQE = true;
++ }
++ assertTrue(recievedSQE);
++ }
++ rs.close();
++ }
++
++ /*
++ * Validate that columnUpdated works with the various datatypes specifying
++ * the column index
++ */
++ @Test(dataProvider = "rowsetUsingDataTypes")
++ public void commonCachedRowSetTest0040(CachedRowSet rs, JDBCType type) throws Exception {
++ rs.beforeFirst();
++ assertTrue(rs.next());
++ switch (type) {
++ case INTEGER:
++ assertFalse(rs.columnUpdated(1));
++ rs.updateInt(1, Integer.MIN_VALUE);
++ assertTrue(rs.columnUpdated(1));
++ break;
++ case CHAR:
++ assertFalse(rs.columnUpdated(2));
++ rs.updateString(2, "foo");
++ assertTrue(rs.columnUpdated(2));
++ break;
++ case VARCHAR:
++ assertFalse(rs.columnUpdated(3));
++ rs.updateString(3, "foo");
++ assertTrue(rs.columnUpdated(3));
++ break;
++ case BIGINT:
++ assertFalse(rs.columnUpdated(4));
++ rs.updateLong(4, Long.MIN_VALUE);
++ assertTrue(rs.columnUpdated(4));
++ break;
++ case BOOLEAN:
++ assertFalse(rs.columnUpdated(5));
++ rs.updateBoolean(5, false);
++ assertTrue(rs.columnUpdated(5));
++ break;
++ case SMALLINT:
++ assertFalse(rs.columnUpdated(6));
++ rs.updateShort(6, Short.MIN_VALUE);
++ assertTrue(rs.columnUpdated(6));
++ break;
++ case DOUBLE:
++ assertFalse(rs.columnUpdated(7));
++ rs.updateDouble(7, Double.MIN_VALUE);
++ assertTrue(rs.columnUpdated(7));
++ break;
++ case DECIMAL:
++ assertFalse(rs.columnUpdated(8));
++ rs.updateBigDecimal(8, BigDecimal.TEN);
++ assertTrue(rs.columnUpdated(8));
++ break;
++ case REAL:
++ assertFalse(rs.columnUpdated(9));
++ rs.updateFloat(9, Float.MIN_VALUE);
++ assertTrue(rs.columnUpdated(9));
++ break;
++ case TINYINT:
++ assertFalse(rs.columnUpdated(10));
++ rs.updateByte(10, Byte.MIN_VALUE);
++ assertTrue(rs.columnUpdated(10));
++ break;
++ case DATE:
++ assertFalse(rs.columnUpdated(11));
++ rs.updateDate(11, Date.valueOf(LocalDate.now()));
++ assertTrue(rs.columnUpdated(11));
++ break;
++ case TIME:
++ assertFalse(rs.columnUpdated(12));
++ rs.updateTime(12, Time.valueOf(LocalTime.now()));
++ assertTrue(rs.columnUpdated(12));
++ break;
++ case TIMESTAMP:
++ assertFalse(rs.columnUpdated(13));
++ rs.updateTimestamp(13, Timestamp.valueOf(LocalDateTime.now()));
++ assertTrue(rs.columnUpdated(13));
++ break;
++ case VARBINARY:
++ assertFalse(rs.columnUpdated(14));
++ rs.updateBytes(14, new byte[1]);
++ assertTrue(rs.columnUpdated(14));
++ break;
++ case ARRAY:
++ assertFalse(rs.columnUpdated(15));
++ rs.updateArray(15, new StubArray("VARCHAR", new Object[10]));
++ assertTrue(rs.columnUpdated(15));
++ break;
++ case REF:
++ assertFalse(rs.columnUpdated(16));
++ rs.updateRef(16, new StubRef("INTEGER", query));
++ assertTrue(rs.columnUpdated(16));
++ break;
++ case FLOAT:
++ assertFalse(rs.columnUpdated(17));
++ rs.updateDouble(17, Double.MIN_NORMAL);
++ assertTrue(rs.columnUpdated(17));
++ }
++
++ }
++
++ /*
++ * Validate that columnUpdated works with the various datatypes specifying
++ * the column name
++ */
++ @Test(dataProvider = "rowsetUsingDataTypes")
++ public void commonCachedRowSetTest0041(CachedRowSet rs, JDBCType type) throws Exception {
++ rs.beforeFirst();
++ assertTrue(rs.next());
++ switch (type) {
++ case INTEGER:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[0]));
++ rs.updateInt(DATATYPES_COLUMN_NAMES[0], Integer.MIN_VALUE);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[0]));
++ break;
++ case CHAR:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[1]));
++ rs.updateString(DATATYPES_COLUMN_NAMES[1], "foo");
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[1]));
++ break;
++ case VARCHAR:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[2]));
++ rs.updateString(DATATYPES_COLUMN_NAMES[2], "foo");
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[2]));
++ break;
++ case BIGINT:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[3]));
++ rs.updateLong(DATATYPES_COLUMN_NAMES[3], Long.MIN_VALUE);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[3]));
++ break;
++ case BOOLEAN:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[4]));
++ rs.updateBoolean(DATATYPES_COLUMN_NAMES[4], false);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[4]));
++ break;
++ case SMALLINT:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[5]));
++ rs.updateShort(DATATYPES_COLUMN_NAMES[5], Short.MIN_VALUE);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[5]));
++ break;
++ case DOUBLE:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[6]));
++ rs.updateDouble(DATATYPES_COLUMN_NAMES[6], Double.MIN_VALUE);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[6]));
++ break;
++ case DECIMAL:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[7]));
++ rs.updateBigDecimal(DATATYPES_COLUMN_NAMES[7], BigDecimal.TEN);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[7]));
++ break;
++ case REAL:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[8]));
++ rs.updateFloat(DATATYPES_COLUMN_NAMES[8], Float.MIN_VALUE);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[8]));
++ break;
++ case TINYINT:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[9]));
++ rs.updateByte(DATATYPES_COLUMN_NAMES[9], Byte.MIN_VALUE);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[9]));
++ break;
++ case DATE:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[10]));
++ rs.updateDate(DATATYPES_COLUMN_NAMES[10], Date.valueOf(LocalDate.now()));
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[10]));
++ break;
++ case TIME:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[11]));
++ rs.updateTime(DATATYPES_COLUMN_NAMES[11], Time.valueOf(LocalTime.now()));
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[11]));
++ break;
++ case TIMESTAMP:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[12]));
++ rs.updateTimestamp(DATATYPES_COLUMN_NAMES[12], Timestamp.valueOf(LocalDateTime.now()));
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[12]));
++ break;
++ case VARBINARY:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[13]));
++ rs.updateBytes(DATATYPES_COLUMN_NAMES[13], new byte[1]);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[13]));
++ break;
++ case ARRAY:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[14]));
++ rs.updateArray(DATATYPES_COLUMN_NAMES[14], new StubArray("VARCHAR", new Object[10]));
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[14]));
++ break;
++ case REF:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[15]));
++ rs.updateRef(DATATYPES_COLUMN_NAMES[15], new StubRef("INTEGER", query));
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[15]));
++ break;
++ case FLOAT:
++ assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[16]));
++ rs.updateDouble(DATATYPES_COLUMN_NAMES[16], Double.MIN_NORMAL);
++ assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[16]));
++ break;
++ }
++
++ }
++
++ /*
++ * Validate isBeforeFirst(), isFirst() and first() return the correct
++ * results
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0042(RowSet rs) throws Exception {
++ assertFalse(rs.isBeforeFirst());
++ assertFalse(rs.isFirst());
++ rs.beforeFirst();
++ assertTrue(rs.isBeforeFirst());
++ assertFalse(rs.isFirst());
++ rs.next();
++ assertFalse(rs.isBeforeFirst());
++ assertTrue(rs.isFirst());
++ rs.next();
++ assertFalse(rs.isBeforeFirst());
++ assertFalse(rs.isFirst());
++ rs.first();
++ assertFalse(rs.isBeforeFirst());
++ assertTrue(rs.isFirst());
++ rs.close();
++ }
++
++ /*
++ * Validate isAfterLast(), isLast() and last() return the correct
++ * results
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0043(RowSet rs) throws Exception {
++ assertFalse(rs.isAfterLast());
++ assertFalse(rs.isLast());
++ rs.afterLast();
++ assertTrue(rs.isAfterLast());
++ assertFalse(rs.isLast());
++ rs.previous();
++ assertFalse(rs.isAfterLast());
++ assertTrue(rs.isLast());
++ rs.previous();
++ assertFalse(rs.isAfterLast());
++ assertFalse(rs.isLast());
++ rs.last();
++ assertFalse(rs.isAfterLast());
++ assertTrue(rs.isLast());
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoDelete is called on the
++ * insertRow
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0044(CachedRowSet rs) throws Exception {
++ rs.insertRow();
++ rs.undoDelete();
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoDelete is called when
++ * cursor is before the first row
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0045(CachedRowSet rs) throws Exception {
++ rs.setShowDeleted(true);
++ rs.beforeFirst();
++ rs.undoDelete();
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoDelete is called when
++ * cursor is after the last row
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0046(CachedRowSet rs) throws Exception {
++ rs.setShowDeleted(true);
++ rs.afterLast();
++ rs.undoDelete();
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoUpdate is called on the
++ * insertRow
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0047(CachedRowSet rs) throws Exception {
++ rs.insertRow();
++ rs.undoUpdate();
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoUpdate is called when
++ * cursor is before the first row
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0048(CachedRowSet rs) throws Exception {
++ rs.setShowDeleted(true);
++ rs.beforeFirst();
++ rs.undoUpdate();
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoUpdate is called when
++ * cursor is after the last row
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0049(CachedRowSet rs) throws Exception {
++ rs.setShowDeleted(true);
++ rs.afterLast();
++ rs.undoUpdate();
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoInsert is called on the
++ * insertRow
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0050(CachedRowSet rs) throws Exception {
++ rs.insertRow();
++ rs.undoInsert();
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoInsert is called when
++ * cursor is before the first row
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0051(CachedRowSet rs) throws Exception {
++ rs.setShowDeleted(true);
++ rs.beforeFirst();
++ rs.undoInsert();
++ rs.close();
++ }
++
++ /*
++ * Validate a SQLException is thrown when undoInsert is called when
++ * cursor is after the last row
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses",
++ expectedExceptions = SQLException.class)
++ public void commonCachedRowSetTest0052(CachedRowSet rs) throws Exception {
++ rs.setShowDeleted(true);
++ rs.afterLast();
++ rs.undoInsert();
++ rs.close();
++ }
++
++ /*
++ * Insert a row, then call undoInsert to roll back the insert and validate
++ * the row is not there
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0053(CachedRowSet rs) throws Exception {
++ int rowToInsert = 1961;
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ // Add new row
++ rs.moveToInsertRow();
++ rs.updateInt(1, rowToInsert);
++ rs.updateString(2, "GOTHAM");
++ rs.updateInt(3, 3450);
++ rs.updateInt(4, 2005);
++ rs.updateInt(5, 5455);
++ rs.insertRow();
++ rs.moveToCurrentRow();
++ // check that the number of rows has increased
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
++ assertTrue(findRowByPrimaryKey(rs, rowToInsert, 1));
++ rs.undoInsert();
++ // Check to make sure the row is no longer there
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ assertFalse(findRowByPrimaryKey(rs, rowToInsert, 1));
++ rs.close();
++ }
++
++ /*
++ * Insert a row, delete the row and then call undoDelete to make sure it
++ * is comes back
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0054(CachedRowSet rs) throws Exception {
++ int rowToDelete = 1961;
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ // Add new row
++ rs.moveToInsertRow();
++ rs.updateInt(1, rowToDelete);
++ rs.updateString(2, "GOTHAM");
++ rs.updateInt(3, 3450);
++ rs.updateInt(4, 2005);
++ rs.updateInt(5, 5455);
++ rs.insertRow();
++ rs.moveToCurrentRow();
++ // check that the number of rows has increased
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
++ assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1));
++ rs.absolute(COFFEE_HOUSES_ROWS + 1);
++ rs.deleteRow();
++ // Check to make sure the row is no longer there
++ //assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ assertFalse(findRowByPrimaryKey(rs, rowToDelete, 1));
++ rs.setShowDeleted(true);
++ rs.absolute(COFFEE_HOUSES_ROWS + 1);
++ rs.undoDelete();
++ // check that the row is back
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
++ assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1));
++ rs.close();
++ }
++
++ /*
++ * Insert a row, modify a field and then call undoUpdate to revert the
++ * insert
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0055(CachedRowSet rs) throws Exception {
++ int rowToInsert = 1961;
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ // Add new row
++ rs.moveToInsertRow();
++ rs.updateInt(1, rowToInsert);
++ rs.updateString(2, "GOTHAM");
++ rs.updateInt(3, 3450);
++ rs.updateInt(4, 2005);
++ rs.updateInt(5, 5455);
++ rs.insertRow();
++ rs.moveToCurrentRow();
++ // check that the number of rows has increased
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
++ assertTrue(findRowByPrimaryKey(rs, rowToInsert, 1));
++ rs.absolute(COFFEE_HOUSES_ROWS + 1);
++ // Save off the original column values
++ String f2 = rs.getString(2);
++ int f3 = rs.getInt(3);
++ rs.updateString(2, "SMALLVILLE");
++ rs.updateInt(3, 500);
++ // Validate the columns have been updated
++ assertTrue(rs.columnUpdated(2));
++ assertTrue(rs.columnUpdated(3));
++ // Undo the update and validate it has taken place
++ rs.absolute(COFFEE_HOUSES_ROWS + 1);
++ rs.undoUpdate();
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ assertFalse(findRowByPrimaryKey(rs, rowToInsert, 1));
++ rs.close();
++ }
++
++ /*
++ * Validate getOriginal returns a ResultSet which is a copy of the original
++ * RowSet
++ */
++ @Test(dataProvider = "rowsetUsingCoffees")
++ public void commonCachedRowSetTest0056(CachedRowSet rs) throws Exception {
++ String coffee = "Hazelnut";
++ int sales = 100;
++ int id = 200;
++ Object[] updatedPkeys = {1, id, 3, 4, 5};
++ // Change the coffee name and sales total for row 2 and save the
++ // previous values
++ rs.absolute(2);
++ int origId = rs.getInt(1);
++ String origCoffee = rs.getString(2);
++ int origSales = rs.getInt(5);
++ rs.updateInt(1, id);
++ rs.updateString(2, coffee);
++ rs.updateInt(5, sales);
++ // MetaData should match
++ try ( // Get the original original RowSet and validate that the changes
++ // are only made to the current, not the original
++ ResultSet rs1 = rs.getOriginal()) {
++ // MetaData should match
++ compareMetaData(rs.getMetaData(), rs1.getMetaData());
++ assertTrue(rs1.isBeforeFirst());
++ assertTrue(rs1.getConcurrency() == ResultSet.CONCUR_UPDATABLE);
++ assertTrue(rs1.getType() == ResultSet.TYPE_SCROLL_INSENSITIVE);
++ rs1.absolute(2);
++ // Check original rowset is not changed
++ assertTrue(rs1.getInt(1) == origId);
++ assertTrue(rs1.getString(2).equals(origCoffee));
++ assertTrue(rs1.getInt(5) == origSales);
++ assertEquals(getPrimaryKeys(rs1), COFFEES_PRIMARY_KEYS);
++ // Check current rowset
++ assertTrue(rs.getInt(1) == id);
++ assertTrue(rs.getString(2).equals(coffee));
++ assertTrue(rs.getInt(5) == sales);
++ assertEquals(getPrimaryKeys(rs), updatedPkeys);
++ }
++ rs.close();
++ }
++
++ /*
++ * Validate getOriginalRow returns a ResultSet which is a copy of the
++ * original row that was modified
++ */
++ @Test(dataProvider = "rowsetUsingCoffees")
++ public void commonCachedRowSetTest0057(CachedRowSet rs) throws Exception {
++ String coffee = "Hazelnut";
++ int sales = 100;
++ int id = 200;
++ Object[] updatedPkeys = {1, id, 3, 4, 5};
++ // Change the coffee name and sales total for row 2 and save the
++ // previous values
++ rs.absolute(2);
++ int origId = rs.getInt(1);
++ String origCoffee = rs.getString(2);
++ int origSales = rs.getInt(5);
++ rs.updateInt(1, id);
++ rs.updateString(2, coffee);
++ rs.updateInt(5, sales);
++ // MetaData should match
++ try ( // Get the original original row and validate that the changes
++ // are only made to the current, not the original
++ ResultSet rs1 = rs.getOriginalRow()) {
++ // MetaData should match
++ compareMetaData(rs.getMetaData(), rs1.getMetaData());
++ assertTrue(rs1.isBeforeFirst());
++ assertTrue(rs1.getConcurrency() == ResultSet.CONCUR_UPDATABLE);
++ assertTrue(rs1.getType() == ResultSet.TYPE_SCROLL_INSENSITIVE);
++ rs1.next();
++ assertTrue(rs1.isFirst() && rs1.isLast());
++ assertTrue(rs1.getRow() == 1);
++ // Check original row is not changed
++ assertTrue(rs1.getInt(1) == origId);
++ assertTrue(rs1.getString(2).equals(origCoffee));
++ assertTrue(rs1.getInt(5) == origSales);
++ // Check current row
++ assertTrue(rs.getInt(1) == id);
++ assertTrue(rs.getString(2).equals(coffee));
++ assertTrue(rs.getInt(5) == sales);
++ assertEquals(getPrimaryKeys(rs), updatedPkeys);
++ }
++ rs.close();
++ }
++
++ /*
++ * Validate that restoreOrginal will restore the RowSet to its
++ * state prior to the insert of a row
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0058(CachedRowSet rs) throws Exception {
++ int rowToInsert = 1961;
++ assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
++ try ( // Add new row
++ CachedRowSet crs1 = rsf.createCachedRowSet()) {
++ rs.beforeFirst();
++ crs1.populate(rs);
++ TestRowSetListener rsl = new TestRowSetListener();
++ crs1.addRowSetListener(rsl);
++ crs1.moveToInsertRow();
++ crs1.updateInt(1, rowToInsert);
++ crs1.updateString(2, "GOTHAM");
++ crs1.updateInt(3, 3450);
++ crs1.updateInt(4, 2005);
++ crs1.updateInt(5, 5455);
++ crs1.insertRow();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
++ crs1.moveToCurrentRow();
++ assertTrue(findRowByPrimaryKey(crs1, rowToInsert, 1));
++ // Restore back to our original state and the
++ // previously inserted row should not be there
++ rsl.resetFlag();
++ crs1.restoreOriginal();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ assertTrue(crs1.isBeforeFirst());
++ crs1.last();
++ assertFalse(crs1.rowInserted());
++ assertFalse(findRowByPrimaryKey(crs1, rowToInsert, 1));
++ }
++ rs.close();
++ }
++
++ /*
++ * Validate that restoreOrginal will restore the RowSet to its
++ * state prior to deleting a row
++ */
++ @Test(dataProvider = "rowsetUsingCoffees", enabled = true)
++ public void commonCachedRowSetTest0059(CachedRowSet rs) throws Exception {
++ int rowToDelete = 2;
++ try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
++ rs.beforeFirst();
++ crs1.populate(rs);
++ TestRowSetListener rsl = new TestRowSetListener();
++ crs1.addRowSetListener(rsl);
++ // Delete a row, the PK is also the absolute position as a List
++ // backs the RowSet
++ crs1.absolute(rowToDelete);
++ crs1.deleteRow();
++ assertTrue(crs1.rowDeleted());
++ assertFalse(findRowByPrimaryKey(crs1, rowToDelete, 1));
++ // Restore back to our original state and the
++ // previously deleted row should be there
++ rsl.resetFlag();
++ crs1.restoreOriginal();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ assertTrue(crs1.isBeforeFirst());
++ crs1.absolute(rowToDelete);
++ assertFalse(crs1.rowDeleted());
++ assertTrue(findRowByPrimaryKey(crs1, rowToDelete, 1));
++ }
++ rs.close();
++ }
++
++ /*
++ * Validate that restoreOrginal will restore the RowSet to its
++ * state prior to updating a row
++ */
++ @Test(dataProvider = "rowsetUsingCoffees", enabled = true)
++ public void commonCachedRowSetTest0060(CachedRowSet rs) throws Exception {
++ int rowToUpdate = 2;
++ String coffee = "Hazelnut";
++ try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
++ rs.beforeFirst();
++ crs1.populate(rs);
++ TestRowSetListener rsl = new TestRowSetListener();
++ crs1.addRowSetListener(rsl);
++ // Delete a row, the PK is also the absolute position as a List
++ // backs the RowSet
++ crs1.absolute(rowToUpdate);
++ String origCoffee = crs1.getString(2);
++ crs1.updateString(2, coffee);
++ assertTrue(crs1.columnUpdated(2));
++ crs1.updateRow();
++ assertTrue(crs1.rowUpdated());
++ assertFalse(origCoffee.equals(crs1.getString(2)));
++ // Restore back to our original state and the
++ // previous value for the column within the row should be there
++ rsl.resetFlag();
++ crs1.restoreOriginal();
++ assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
++ assertTrue(crs1.isBeforeFirst());
++ // absolute() is failing for some reason so need to look at this later
++ crs1.next();
++ crs1.next();
++ assertFalse(crs1.columnUpdated(2));
++ assertFalse(crs1.rowUpdated());
++ assertTrue(origCoffee.equals(crs1.getString(2)));
++ }
++ rs.close();
++ }
++
++ /*
++ * Initialize a RowSet via the populate method. Validate it matches
++ * the original ResultSet
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0061(CachedRowSet rs) throws Exception {
++ try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
++ rs.beforeFirst();
++ crs1.populate(rs);
++ compareRowSets(rs, crs1);
++ }
++ rs.close();
++ }
++
++ /*
++ * Initialize a RowSet via the populate method specifying a starting row.
++ * Validate it matches the original ResultSet starting for the specofied
++ * offset
++ */
++ @Test(dataProvider = "rowsetUsingCoffeeHouses")
++ public void commonCachedRowSetTest0062(CachedRowSet rs) throws Exception {
++ Object[] expectedRows = {
++ 32001, 10042, 10024, 10039, 10041, 33005, 33010, 10035, 10037,
++ 10034, 32004
++ };
++ int startingRow = 4;
++ try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
++ rs.beforeFirst();
++ crs1.populate(rs, startingRow);
++ assertEquals(crs1.size(), COFFEE_HOUSES_ROWS - startingRow + 1);
++ assertEquals(getPrimaryKeys(crs1), expectedRows);
++ }
++ rs.close();
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/filteredrowset/CityFilter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,100 @@
++/*
++ * 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 test.rowset.filteredrowset;
++
++import java.sql.SQLException;
++import javax.sql.RowSet;
++import javax.sql.rowset.Predicate;
++
++/*
++ * Simple implementation of Predicate which is used to filter rows based
++ * on a City.
++ */
++public class CityFilter implements Predicate {
++
++ private final String[] cities;
++ private String colName = null;
++ private int colNumber = -1;
++
++ public CityFilter(String[] cities, String colName) {
++ this.cities = cities;
++ this.colName = colName;
++ }
++
++ public CityFilter(String[] cities, int colNumber) {
++ this.cities = cities;
++ this.colNumber = colNumber;
++ }
++
++ public boolean evaluate(Object value, String colName) {
++
++ if (colName.equalsIgnoreCase(this.colName)) {
++ for (String city : cities) {
++ if (city.equalsIgnoreCase((String) value)) {
++ return true;
++ }
++ }
++ }
++ return false;
++ }
++
++ public boolean evaluate(Object value, int colNumber) {
++
++ if (colNumber == this.colNumber) {
++ for (String city : this.cities) {
++ if (city.equalsIgnoreCase((String) value)) {
++ return true;
++ }
++ }
++ }
++ return false;
++ }
++
++ public boolean evaluate(RowSet rs) {
++
++ boolean result = false;
++
++ if (rs == null) {
++ return false;
++ }
++
++ try {
++ for (String city : cities) {
++
++ String val = "";
++ if (colNumber > 0) {
++ val = (String) rs.getObject(colNumber);
++ } else if (colName != null) {
++ val = (String) rs.getObject(colName);
++ }
++
++ if (val.equalsIgnoreCase(city)) {
++ return true;
++ }
++ }
++ } catch (SQLException e) {
++ result = false;
++ }
++ return result;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/filteredrowset/FilteredRowSetTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,140 @@
++/*
++ * 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 test.rowset.filteredrowset;
++
++import java.sql.SQLException;
++import javax.sql.RowSet;
++import javax.sql.rowset.FilteredRowSet;
++import javax.sql.rowset.Predicate;
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertNull;
++import static org.testng.Assert.assertTrue;
++import org.testng.annotations.AfterMethod;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import test.rowset.webrowset.CommonWebRowSetTests;
++
++public class FilteredRowSetTests extends CommonWebRowSetTests {
++
++ private FilteredRowSet frs;
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ frs = createCoffeeHousesRowSet();
++ }
++
++ @AfterMethod
++ public void tearDownMethod() throws Exception {
++ frs.close();
++ }
++
++ protected FilteredRowSet newInstance() throws SQLException {
++ return rsf.createFilteredRowSet();
++ }
++
++ /*
++ * Validate getFilter returns null if setFilter has not been called
++ */
++ @Test
++ public void FilteredRowSetTest0000() throws SQLException {
++ assertNull(frs.getFilter());
++ }
++
++ /*
++ * Call setFilter to set a Predicate and validate that getFilter
++ * returns the correct Predicate
++ */
++ @Test
++ public void FilteredRowSetTest0001() throws SQLException {
++ Predicate p = new PrimaryKeyFilter(0, 100030, 1);
++ frs.setFilter(p);
++ assertTrue(frs.getFilter().equals(p));
++ frs.setFilter(null);
++ assertNull(frs.getFilter());
++ }
++
++ /*
++ * Validate that the correct rows are returned when a Predicate using
++ * a column index is used
++ */
++ @Test
++ public void FilteredRowSetTest0002() throws SQLException {
++ Object[] expectedKeys = {
++ 10023, 10040, 10042, 10024, 10039, 10041, 10035, 10037, 10034
++ };
++ frs.setFilter(new PrimaryKeyFilter(10000, 10999, 1));
++ assertEquals(getPrimaryKeys(frs), expectedKeys);
++ }
++
++ /*
++ * Validate that the correct rows are returned when a Predicate using
++ * a column Label is used
++ */
++ @Test
++ public void FilteredRowSetTest0003() throws SQLException {
++ Object[] expectedKeys = {
++ 10023, 10040, 10042, 10024, 10039, 10041, 10035, 10037, 10034
++ };
++ frs.setFilter(new PrimaryKeyFilter(10000, 10999, "STORE_ID"));
++ assertEquals(getPrimaryKeys(frs), expectedKeys);
++
++ }
++
++ /*
++ * Validate that the correct rows are returned when a Predicate using
++ * a column index is used
++ */
++ @Test
++ public void FilteredRowSetTest0004() throws SQLException {
++ Object[] expectedKeys = {
++ 10040, 10042, 10041, 10035, 10037
++ };
++ String[] cityArray = {"SF", "LA"};
++ frs.setFilter(new CityFilter(cityArray, 2));
++ assertEquals(getPrimaryKeys(frs), expectedKeys);
++ }
++
++ /*
++ * Validate that the correct rows are returned when a Predicate using
++ * a column Label is used
++ */
++ @Test
++ public void FilteredRowSetTest0005() throws SQLException {
++ Object[] expectedKeys = {
++ 10040, 10042, 10041, 10035, 10037
++ };
++ String[] cityArray = {"SF", "LA"};
++ frs.setFilter(new CityFilter(cityArray, "CITY"));
++ assertEquals(getPrimaryKeys(frs), expectedKeys);
++ }
++
++
++ // Tests that are common but need to be disabled due to an implementation bug
++
++
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0043(RowSet rs) throws Exception {
++ // Need to fix bug in FilteredRowSets
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/filteredrowset/PrimaryKeyFilter.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,93 @@
++/*
++ * 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 test.rowset.filteredrowset;
++
++import javax.sql.RowSet;
++import javax.sql.rowset.Predicate;
++
++/*
++ * Simple implementation of Predicate which is used to filter rows based
++ * on the Primary Key.
++ */
++public class PrimaryKeyFilter implements Predicate {
++
++ private final int lo;
++ private final int hi;
++ private String colName = null;
++ private int colNumber = -1;
++
++ public PrimaryKeyFilter(int lo, int hi, int colNumber) {
++ this.lo = lo;
++ this.hi = hi;
++ this.colNumber = colNumber;
++ }
++
++ public PrimaryKeyFilter(int lo, int hi, String colName) {
++ this.lo = lo;
++ this.hi = hi;
++ this.colName = colName;
++ }
++
++ public boolean evaluate(Object value, String columnName) {
++
++ boolean result = false;
++ if (columnName.equalsIgnoreCase(this.colName)) {
++ int columnValue = ((Integer) value);
++ result = (columnValue >= this.lo) && (columnValue <= this.hi);
++ }
++ return result;
++ }
++
++ public boolean evaluate(Object value, int columnNumber) {
++
++ boolean result = false;
++ if (this.colNumber == columnNumber) {
++ int columnValue = (Integer) value;
++ result = (columnValue >= this.lo) && (columnValue <= this.hi);
++ }
++ return result;
++ }
++
++ public boolean evaluate(RowSet rs) {
++
++ boolean result = false;
++ try {
++ int columnValue = -1;
++
++ if (this.colNumber > 0) {
++ columnValue = rs.getInt(this.colNumber);
++ } else if (this.colName != null) {
++ columnValue = rs.getInt(this.colName);
++ }
++ if ((columnValue >= this.lo) && (columnValue <= this.hi)) {
++ result = true;
++ }
++
++ } catch (Exception e) {
++ System.out.println("Error:" + e.getMessage());
++ result = false;
++ }
++ return result;
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/joinrowset/JoinRowSetTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,324 @@
++/*
++ * 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 test.rowset.joinrowset;
++
++import java.sql.SQLException;
++import java.sql.Types;
++import java.util.ArrayList;
++import java.util.List;
++import javax.sql.RowSet;
++import javax.sql.rowset.CachedRowSet;
++import javax.sql.rowset.JoinRowSet;
++import javax.sql.rowset.RowSetMetaDataImpl;
++import javax.sql.rowset.WebRowSet;
++import static org.testng.Assert.assertEquals;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import test.rowset.webrowset.CommonWebRowSetTests;
++
++public class JoinRowSetTests extends CommonWebRowSetTests {
++
++ private final String SUPPLIERS_TABLE = "SUPPLIERS";
++ // Expected COF_IDs to be found
++ private final Object[] EXPECTED = {4, 1};
++ // SUPPLIERS Primary Key to use to validate the joins
++ private final int SUP_ID = 101;
++ // Join Column between the SUPPLIERS and COFFEES table
++ private final String JOIN_COLNAME = "SUP_ID";
++ // Column index in COFFEES table which contains SUP_ID
++ private final int COFFEES_JOIN_COLUMN_INDEX = 3;
++ // Column index in SUPPLIERS table which contains SUP_ID
++ private final int SUPPLIERS_JOIN_COLUMN_INDEX = 1;
++
++ @Override
++ protected JoinRowSet newInstance() throws SQLException {
++ return rsf.createJoinRowSet();
++ }
++
++ /*
++ * Initializes the SUPPLIERS metadata
++ */
++ private void initSuppliersMetaData(CachedRowSet crs) throws SQLException {
++ RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
++
++ /*
++ * CREATE TABLE SUPPLIERS (
++ * SUP_ID INTEGER NOT NULL,
++ * SUP_NAME VARCHAR(32) NOT NULL,
++ * STREET VARCHAR(32) NOT NULL,
++ * CITY VARCHAR(32) NOT NULL,
++ * STATE CHAR(2) NOT NULL,
++ * ZIP CHAR(5) NOT NULL,
++ * PRIMARY KEY (SUP_ID))
++ */
++ rsmd.setColumnCount(6);
++ rsmd.setColumnName(1, "SUP_ID");
++ rsmd.setColumnName(2, "SUP_NAME");
++ rsmd.setColumnName(3, "STREET");
++ rsmd.setColumnName(4, "CITY");
++ rsmd.setColumnName(5, "STATE");
++ rsmd.setColumnName(6, "ZIP");
++
++ rsmd.setColumnType(1, Types.INTEGER);
++ rsmd.setColumnType(2, Types.VARCHAR);
++ rsmd.setColumnType(3, Types.VARCHAR);
++ rsmd.setColumnType(4, Types.VARCHAR);
++ rsmd.setColumnType(5, Types.CHAR);
++ rsmd.setColumnType(6, Types.CHAR);
++ crs.setMetaData(rsmd);
++ crs.setTableName(SUPPLIERS_TABLE);
++ }
++
++ /*
++ * Add rows to SUPPLIERS table
++ */
++ protected void createSuppiersRows(RowSet rs) throws SQLException {
++
++ // insert into SUPPLIERS values(49, 'Superior Coffee', '1 Party Place',
++ // 'Mendocino', 'CA', '95460')
++ rs.moveToInsertRow();
++ rs.updateInt(1, 49);
++ rs.updateString(2, "Superior Coffee");
++ rs.updateString(3, "1 Party Place");
++ rs.updateString(4, "Mendocino");
++ rs.updateString(5, "CA");
++ rs.updateString(6, "95460");
++ rs.insertRow();
++
++ // insert into SUPPLIERS values(101, 'Acme, Inc.', '99 Market Street',
++ // 'Groundsville', 'CA', '95199')
++ rs.moveToInsertRow();
++ rs.updateInt(1, 101);
++ rs.updateString(2, "Acme, Inc.");
++ rs.updateString(3, "99 Market Street");
++ rs.updateString(4, "Groundsville");
++ rs.updateString(5, "CA");
++ rs.updateString(6, "95199");
++ rs.insertRow();
++ // insert into SUPPLIERS values(150, 'The High Ground',
++ // '100 Coffee Lane', 'Meadows', 'CA', '93966')
++ rs.moveToInsertRow();
++ rs.updateInt(1, 150);
++ rs.updateString(2, "The High Ground");
++ rs.updateString(3, "100 Coffee Lane");
++ rs.updateString(4, "Meadows");
++ rs.updateString(5, "CA");
++ rs.updateString(6, "93966");
++ rs.insertRow();
++ // insert into SUPPLIERS values(456," 'Restaurant Supplies, Inc.',
++ // '200 Magnolia Street', 'Meadows', 'CA', '93966')
++ rs.moveToInsertRow();
++ rs.updateInt(1, 456);
++ rs.updateString(2, "Restaurant Supplies, Inc.");
++ rs.updateString(3, "200 Magnolia Stree");
++ rs.updateString(4, "Meadows");
++ rs.updateString(5, "CA");
++ rs.updateString(6, "93966");
++ rs.insertRow();
++ // insert into SUPPLIERS values(927, 'Professional Kitchen',
++ // '300 Daisy Avenue', 'Groundsville'," 'CA', '95199')
++ rs.moveToInsertRow();
++ rs.updateInt(1, 927);
++ rs.updateString(2, "Professional Kitchen");
++ rs.updateString(3, "300 Daisy Avenue");
++ rs.updateString(4, "Groundsville");
++ rs.updateString(5, "CA");
++ rs.updateString(6, "95199");
++ rs.insertRow();
++ }
++
++ /*
++ * DataProvider used to set parameters for basic types that are supported
++ */
++ @DataProvider(name = "createCachedRowSetsToUse")
++ private Object[][] createCachedRowSetsToUse() throws SQLException {
++ CachedRowSet crs = rsf.createCachedRowSet();
++ initCoffeesMetaData(crs);
++ createCoffeesRows(crs);
++ // Make sure you are not on the insertRow
++ crs.moveToCurrentRow();
++ CachedRowSet crs1 = rsf.createCachedRowSet();
++ initSuppliersMetaData(crs1);
++ createSuppiersRows(crs1);
++ // Make sure you are not on the insertRow
++ crs1.moveToCurrentRow();
++ return new Object[][]{
++ {crs, crs1}
++ };
++ }
++
++ /*
++ * Validate that the correct coffees are returned for SUP_ID
++ */
++ private void validateResults(final JoinRowSet jrs) throws SQLException {
++ List<Integer> results = new ArrayList<>();
++ jrs.beforeFirst();
++ while (jrs.next()) {
++ if (jrs.getInt(JOIN_COLNAME) == SUP_ID) {
++ results.add(jrs.getInt("COF_ID"));
++ }
++ }
++ assertEquals(results.toArray(), EXPECTED);
++ }
++
++ /*
++ * Join two CachedRowSets specifying a column name to join against
++ */
++ @Test(dataProvider = "createCachedRowSetsToUse")
++ public void joinRowSetTests0000(CachedRowSet crs, CachedRowSet crs1)
++ throws Exception {
++
++ try (JoinRowSet jrs = newInstance()) {
++ jrs.addRowSet(crs, JOIN_COLNAME);
++ jrs.addRowSet(crs1, JOIN_COLNAME);
++ validateResults(jrs);
++ crs.close();
++ crs1.close();
++ }
++ }
++
++ /*
++ * Join two CachedRowSets specifying a column index to join against
++ */
++ @Test(dataProvider = "createCachedRowSetsToUse")
++ public void joinRowSetTests0001(CachedRowSet crs, CachedRowSet crs1)
++ throws Exception {
++
++ try (JoinRowSet jrs = newInstance()) {
++ jrs.addRowSet(crs, COFFEES_JOIN_COLUMN_INDEX);
++ jrs.addRowSet(crs1, SUPPLIERS_JOIN_COLUMN_INDEX);
++ validateResults(jrs);
++ crs.close();
++ crs1.close();
++ }
++ }
++
++ /*
++ * Join two CachedRowSets specifying a column name to join against
++ */
++ @Test(dataProvider = "createCachedRowSetsToUse")
++ public void joinRowSetTests0002(CachedRowSet crs, CachedRowSet crs1)
++ throws Exception {
++
++ try (JoinRowSet jrs = newInstance()) {
++ RowSet[] rowsets = {crs, crs1};
++ String[] joinCols = {JOIN_COLNAME, JOIN_COLNAME};
++ jrs.addRowSet(rowsets, joinCols);
++ validateResults(jrs);
++ crs.close();
++ crs1.close();
++ }
++ }
++
++ /*
++ * Join two CachedRowSets specifying a column index to join against
++ */
++ @Test(dataProvider = "createCachedRowSetsToUse")
++ public void joinRowSetTests0003(CachedRowSet crs, CachedRowSet crs1)
++ throws Exception {
++
++ try (JoinRowSet jrs = newInstance()) {
++ RowSet[] rowsets = {crs, crs1};
++ int[] joinCols = {COFFEES_JOIN_COLUMN_INDEX,
++ SUPPLIERS_JOIN_COLUMN_INDEX};
++ jrs.addRowSet(rowsets, joinCols);
++ validateResults(jrs);
++ crs.close();
++ crs1.close();
++ }
++ }
++
++ /*
++ * Join two CachedRowSets specifying a column name to join against
++ */
++ @Test(dataProvider = "createCachedRowSetsToUse")
++ public void joinRowSetTests0005(CachedRowSet crs, CachedRowSet crs1)
++ throws Exception {
++
++ try (JoinRowSet jrs = newInstance()) {
++ crs.setMatchColumn(JOIN_COLNAME);
++ crs1.setMatchColumn(JOIN_COLNAME);
++ jrs.addRowSet(crs);
++ jrs.addRowSet(crs1);
++ validateResults(jrs);
++ crs.close();
++ crs1.close();
++ }
++ }
++
++ /*
++ * Join two CachedRowSets specifying a column index to join against
++ */
++ @Test(dataProvider = "createCachedRowSetsToUse")
++ public void joinRowSetTests0006(CachedRowSet crs, CachedRowSet crs1)
++ throws Exception {
++
++ try (JoinRowSet jrs = newInstance()) {
++ crs.setMatchColumn(COFFEES_JOIN_COLUMN_INDEX);
++ crs1.setMatchColumn(SUPPLIERS_JOIN_COLUMN_INDEX);
++
++ jrs.addRowSet(crs);
++ jrs.addRowSet(crs1);
++ validateResults(jrs);
++ crs.close();
++ crs1.close();
++ }
++ }
++
++ // Disabled tests due to bugs in JoinRowSet
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0004(CachedRowSet rs) throws Exception {
++ }
++
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0005(CachedRowSet rs) throws Exception {
++ }
++
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0008(CachedRowSet rs) throws Exception {
++ }
++
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0026(CachedRowSet rs) throws Exception {
++ }
++
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0027(CachedRowSet rs) throws Exception {
++ }
++
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0053(CachedRowSet rs) throws Exception {
++ }
++
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0054(CachedRowSet rs) throws Exception {
++ }
++
++ @Test(dataProvider = "rowSetType", enabled = false)
++ public void commonCachedRowSetTest0055(CachedRowSet rs) throws Exception {
++ }
++
++ @Test(dataProvider = "rowSetType")
++ public void WebRowSetTest0009(WebRowSet wrs1) throws Exception {
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SQLInputImplTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,211 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.net.URL;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Ref;
++import java.sql.SQLException;
++import java.sql.Struct;
++import java.util.Arrays;
++import java.util.HashMap;
++import java.util.Map;
++import javax.sql.rowset.serial.SQLInputImpl;
++import static org.testng.Assert.*;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubArray;
++import util.StubBlob;
++import util.StubClob;
++import util.StubRef;
++import util.StubStruct;
++import util.SuperHero;
++import util.TestSQLDataImpl;
++
++public class SQLInputImplTests extends BaseTest {
++
++ // Copy of the array of data type values
++ private Object[] typeValues;
++ private TestSQLDataImpl impl;
++ private Map<String, Class<?>> map ;
++ private SuperHero hero;
++ private final String sqlType = "SUPERHERO";
++
++ @BeforeMethod
++ @Override
++ public void setUpMethod() throws Exception {
++ map = new HashMap<>();
++ impl = new TestSQLDataImpl("TestSQLData");
++ typeValues = Arrays.copyOf(TestSQLDataImpl.attributes,
++ TestSQLDataImpl.attributes.length);
++ hero = new SuperHero(sqlType, "Bruce", "Wayne",
++ 1939, "Batman");
++ }
++
++ /*
++ * Validate that a SQLException is thrown if the attribute value is
++ * null
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test() throws Exception {
++ SQLInputImpl x = new SQLInputImpl(null, map);
++ }
++
++ /*
++ * Validate that a SQLException is thrown if the map value is
++ * null
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test02() throws Exception {
++ SQLInputImpl x = new SQLInputImpl(typeValues, null);
++ }
++
++ /*
++ * Read in the various datatypes via readSQL (which will exercise the
++ * various readXXX methods and validate that results are as expected
++ */
++ @Test()
++ public void test03() throws Exception {
++ impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
++ assertTrue(Arrays.equals(impl.toArray(), typeValues));
++ // Null out a field and make sure the arrays do not match
++ typeValues[2] = null;
++ assertFalse(Arrays.equals(impl.toArray(), typeValues));
++ }
++
++ /*
++ * Validate that wasNull indicates if a null was read in
++ */
++ @Test()
++ public void test04() throws Exception {
++ Object[] values = {"Hello", null, 1};
++ SQLInputImpl sqli = new SQLInputImpl(values, map);
++ String s = sqli.readString();
++ assertFalse(sqli.wasNull());
++ s = sqli.readString();
++ assertTrue(sqli.wasNull());
++ int i = sqli.readInt();
++ assertFalse(sqli.wasNull());
++ }
++
++ /*
++ * Validate that readObject returns the correct value
++ */
++ @Test()
++ public void test05() throws Exception {
++ Object[] values = {hero};
++ SQLInputImpl sqli = new SQLInputImpl(values, map);
++ Object o = sqli.readObject();
++ assertTrue(hero.equals(o));
++
++ }
++
++ /*
++ * Validate a Array can be read
++ */
++ @Test(enabled = true)
++ public void test06() throws Exception {
++ Object[] coffees = new Object[]{"Espresso", "Colombian", "French Roast",
++ "Cappuccino"};
++ Array a = new StubArray("VARCHAR", coffees);
++ Object[] values = {a};
++ SQLInputImpl sqli = new SQLInputImpl(values, map);
++ Array a2 = sqli.readArray();
++ assertTrue(Arrays.equals((Object[]) a2.getArray(), (Object[]) a.getArray()));
++ assertTrue(a.getBaseTypeName().equals(a2.getBaseTypeName()));
++ }
++
++ /*
++ * Validate a Blob can be read
++ */
++ @Test(enabled = true)
++ public void test07() throws Exception {
++ Blob b = new StubBlob();
++ Object[] values = {b};
++ SQLInputImpl sqli = new SQLInputImpl(values, map);
++ Blob b2 = sqli.readBlob();
++ assertTrue(Arrays.equals(
++ b.getBytes(1, (int) b.length()),
++ b2.getBytes(1, (int) b2.length())));
++ }
++
++ /*
++ * Validate a Clob can be read
++ */
++ @Test(enabled = true)
++ public void test08() throws Exception {
++ Clob c = new StubClob();
++ Object[] values = {c};
++ SQLInputImpl sqli = new SQLInputImpl(values, map);
++ Clob c2 = sqli.readClob();
++ assertTrue(c.getSubString(1,
++ (int) c.length()).equals(c2.getSubString(1, (int) c2.length())));
++ }
++
++ /*
++ * Validate a Ref can be read
++ */
++ @Test(enabled = true)
++ public void test09() throws Exception {
++ Ref ref = new StubRef(sqlType, hero);
++ Object[] values = {ref};
++ SQLInputImpl sqli = new SQLInputImpl(values, map);
++ Ref ref2 = sqli.readRef();
++ assertTrue(ref.getObject().equals(ref2.getObject()));
++ assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName()));
++ }
++
++ /*
++ * Validate a URL can be read
++ */
++ @Test(enabled = true)
++ public void test10() throws Exception {
++ URL u = new URL("http://www.oracle.com/");;
++ Object[] values = {u};
++ SQLInputImpl sqli = new SQLInputImpl(values, map);
++ URL u2 = sqli.readURL();
++ assertTrue(u2.equals(u));
++ assertTrue(u2.sameFile(u));
++ }
++
++ /*
++ * Validate that readObject returns the correct value when a Struct is
++ * next on the stream
++ */
++ @Test()
++ public void test11() throws Exception {
++ Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
++ "Batman"};
++ map.put(sqlType, Class.forName("util.SuperHero"));
++ Struct struct = new StubStruct(sqlType, attributes);
++ Object[] values = {struct};
++ SQLInputImpl sqli = new SQLInputImpl(values, map);
++ Object o = sqli.readObject();
++
++ assertTrue(hero.equals(o));
++
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SQLOutputImplTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,199 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.net.URL;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Ref;
++import java.sql.SQLException;
++import java.sql.Struct;
++import java.util.Arrays;
++import java.util.HashMap;
++import java.util.Map;
++import java.util.Vector;
++import javax.sql.rowset.serial.SQLInputImpl;
++import javax.sql.rowset.serial.SQLOutputImpl;
++import javax.sql.rowset.serial.SerialArray;
++import javax.sql.rowset.serial.SerialBlob;
++import javax.sql.rowset.serial.SerialClob;
++import javax.sql.rowset.serial.SerialDatalink;
++import javax.sql.rowset.serial.SerialRef;
++import javax.sql.rowset.serial.SerialStruct;
++import static org.testng.Assert.*;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubArray;
++import util.StubBlob;
++import util.StubClob;
++import util.StubRef;
++import util.StubStruct;
++import util.SuperHero;
++import util.TestSQLDataImpl;
++
++public class SQLOutputImplTests extends BaseTest {
++
++ // Copy of the array of data type values
++ private Object[] typeValues;
++ private TestSQLDataImpl impl;
++ private Map<String, Class<?>> map = new HashMap<>();
++ private Vector results;
++ private final String sqlType = "SUPERHERO";
++ private SuperHero hero;
++ private SQLOutputImpl outImpl;
++
++ @BeforeMethod
++ @Override
++ public void setUpMethod() throws Exception {
++ results = new Vector();
++ impl = new TestSQLDataImpl("TestSQLData");
++ typeValues = Arrays.copyOf(TestSQLDataImpl.attributes,
++ TestSQLDataImpl.attributes.length);
++ hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman");
++ outImpl = new SQLOutputImpl(results, map);
++ }
++
++ /*
++ * Validate that a SQLException is thrown if the attribute value is
++ * null
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test() throws Exception {
++ SQLOutputImpl x = new SQLOutputImpl(null, map);
++ }
++
++ /*
++ * Validate that a SQLException is thrown if the map value is
++ * null
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test02() throws Exception {
++ SQLOutputImpl x = new SQLOutputImpl(results, null);
++ }
++
++ /*
++ * Read in the various datatypes via readSQL (which will exercise the
++ * various readXXX methods and validate that results are as expected
++ */
++ @Test()
++ public void test03() throws Exception {
++ impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
++ impl.writeSQL(outImpl);
++ assertTrue(Arrays.equals(results.toArray(), typeValues));
++ // Null out a field and make sure the arrays do not match
++ typeValues[2] = null;
++ assertFalse(Arrays.equals(results.toArray(), typeValues));
++ }
++
++ /*
++ * Validate a Array can be written and returned
++ */
++ @Test(enabled = true)
++ public void test04() throws Exception {
++ Object[] coffees = new Object[]{"Espresso", "Colombian", "French Roast",
++ "Cappuccino"};
++ Array a = new StubArray("VARCHAR", coffees);
++ outImpl.writeArray(a);
++ SerialArray sa = (SerialArray) results.get(0);
++ assertTrue(Arrays.equals(coffees, (Object[]) sa.getArray()));
++ assertTrue(a.getBaseTypeName().equals(sa.getBaseTypeName()));
++ }
++
++ /*
++ * Validate a Blob can be written and returned
++ */
++ @Test(enabled = true)
++ public void test05() throws Exception {
++ Blob b = new StubBlob();
++ outImpl.writeBlob(b);
++ SerialBlob sb = (SerialBlob) results.get(0);
++ assertTrue(Arrays.equals(
++ b.getBytes(1, (int) b.length()),
++ sb.getBytes(1, (int) sb.length())));
++ }
++
++ /*
++ * Validate a Clob can be written and returned
++ */
++ @Test(enabled = true)
++ public void test06() throws Exception {
++ Clob c = new StubClob();
++ outImpl.writeClob(c);
++ SerialClob sc = (SerialClob) results.get(0);
++ assertTrue(c.getSubString(1,
++ (int) c.length()).equals(sc.getSubString(1, (int) sc.length())));
++ }
++
++ /*
++ * Validate a Ref can be written and returned
++ */
++ @Test(enabled = true)
++ public void test07() throws Exception {
++ Ref ref = new StubRef(sqlType, hero);
++ outImpl.writeRef(ref);
++ SerialRef sr = (SerialRef) results.get(0);
++ assertTrue(hero.equals(sr.getObject()));
++ }
++
++ /*
++ * Validate a Struct can be written and returned
++ */
++ @Test(enabled = true)
++ public void test08() throws Exception {
++ Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
++ "Batman"};
++ Struct s = new StubStruct(sqlType, attributes);
++ outImpl.writeStruct(s);
++ SerialStruct ss = (SerialStruct) results.get(0);
++ assertTrue(Arrays.equals(attributes, (Object[]) ss.getAttributes()));
++ assertTrue(sqlType.equals(ss.getSQLTypeName()));
++ }
++
++ /*
++ * Validate a DataLink can be written and returned
++ */
++ @Test(enabled = true)
++ public void test09() throws Exception {
++ URL u = new URL("http://www.oracle.com/");
++ outImpl.writeURL(u);
++ SerialDatalink sdl = (SerialDatalink) results.get(0);
++ URL u2 = sdl.getDatalink();
++ assertTrue(u2.equals(u));
++ assertTrue(u2.sameFile(u));
++ }
++
++ /*
++ * Validate an Object implementing SQLData can be written and returned
++ */
++ @Test(enabled = true)
++ public void test10() throws Exception {
++ Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
++ "Batman"};
++ outImpl.writeObject(hero);
++ SerialStruct ss = (SerialStruct) results.get(0);
++ assertTrue(Arrays.equals(attributes, (Object[]) ss.getAttributes()));
++ assertTrue(sqlType.equals(ss.getSQLTypeName()));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SerialArrayTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,236 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.sql.Array;
++import java.sql.SQLException;
++import java.util.Arrays;
++import java.util.HashMap;
++import java.util.Map;
++import javax.sql.rowset.serial.SerialArray;
++import javax.sql.rowset.serial.SerialException;
++import static org.testng.Assert.*;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubArray;
++
++public class SerialArrayTests extends BaseTest {
++
++ private Object[] coffees;
++ private final String sqlType = "VARCHAR";
++ private Array a;
++ private Map<String, Class<?>> map;
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ coffees = new Object[]{"Espresso", "Colombian", "French Roast",
++ "Cappuccino"};
++ a = new StubArray(sqlType, coffees);
++ map = new HashMap<>();
++ }
++
++ /*
++ * Validate a SerialArray can be created from an Array
++ */
++ @Test
++ public void test01() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ }
++
++ /*
++ * Validate a SQLException is thrown if the map is null
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test02() throws Exception {
++ SerialArray sa = new SerialArray(a, null);
++ }
++
++ /*
++ * Validate a SerialException is thrown when getResultSet() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test03() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.getResultSet();
++ }
++
++ /*
++ * Validate a SerialException is thrown when getResultSet() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test04() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.getResultSet(null);
++ }
++
++ /*
++ * Validate a SerialException is thrown when getResultSet() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test05() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.getResultSet(1, 1);
++ }
++
++ /*
++ * Validate a SerialException is thrown when getResultSet() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test06() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.getResultSet(1, 1, null);
++ }
++
++ /*
++ * Validate a SerialException is thrown when getArray() is invoked after
++ * free() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test07() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.free();
++ sa.getArray();
++ }
++
++ /*
++ * Validate a SerialException is thrown when getArray() is invoked after
++ * free() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test08() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.free();
++ sa.getArray(map);
++ }
++
++ /*
++ * Validate a SerialException is thrown when getArray() is invoked after
++ * free() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test09() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.free();
++ sa.getArray(1, 1, map);
++ }
++
++ /*
++ * Validate a SerialException is thrown when getArray() is invoked after
++ * free() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test10() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.free();
++ sa.getArray(1, 1);
++ }
++
++ /*
++ * Validate a SerialException is thrown when getBaseType() is invoked after
++ * free() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test11() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.free();
++ sa.getBaseType();
++ }
++
++ /*
++ * Validate a SerialException is thrown when getBaseTypeName() is invoked after
++ * free() is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test12() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ sa.free();
++ sa.getBaseTypeName();
++ }
++
++ /*
++ * Validate getArray() returns the same Object[] used to create the
++ * SerialArray
++ */
++ @Test
++ public void test13() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ Object[] o = (Object[]) sa.getArray();
++ assertTrue(Arrays.equals(o, coffees));
++ }
++
++ /*
++ * Validate getArray() returns the same Object[] used to create the
++ * SerialArray
++ */
++ @Test
++ public void test14() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ Object[] o = (Object[]) sa.getArray(map);
++ assertTrue(Arrays.equals(o, coffees));
++ }
++
++ /*
++ * Validate getArray() returns the same Object[] used to create the
++ * SerialArray
++ */
++ @Test
++ public void test15() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ Object[] o = (Object[]) sa.getArray(1, 2);
++ assertTrue(Arrays.equals(o, Arrays.copyOfRange(coffees, 1, 3)));
++ }
++
++ /*
++ * Validate getArray() returns the same Object[] used to create the
++ * SerialArray
++ */
++ @Test
++ public void test16() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ Object[] o = (Object[]) sa.getArray(1, 2, map);
++ assertTrue(Arrays.equals(o, Arrays.copyOfRange(coffees, 1, 3)));
++ }
++
++ /*
++ * clone() a SerialArray and check that it is equal to the
++ * object it was cloned from
++ */
++ @Test
++ public void test17() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ SerialArray sa1 = (SerialArray) sa.clone();
++ assertTrue(sa.equals(sa1));
++ }
++
++ /*
++ * Validate that a SerialArray that is serialized & deserialized is equal to
++ * itself
++ */
++ @Test
++ public void test18() throws Exception {
++ SerialArray sa = new SerialArray(a);
++ SerialArray sa1 = serializeDeserializeObject(sa);;
++ assertTrue(sa.equals(sa1));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SerialBlobTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,399 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.util.Arrays;
++import javax.sql.rowset.serial.SerialBlob;
++import javax.sql.rowset.serial.SerialException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubBlob;
++
++public class SerialBlobTests extends BaseTest {
++
++ // byte[] used to populate SerialBlob
++ private byte[] bytes = new byte[]{1, 2, 3, 4, 5};
++
++ /*
++ * Validate calling free() does not throw an Exception
++ */
++ @Test
++ public void test() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ }
++
++ /*
++ * Validate calling getBinaryStream() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test01() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.getBinaryStream();
++ }
++
++ /*
++ * Validate calling getBinaryStream() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test02() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.getBinaryStream(1, 5);
++ }
++
++ /*
++ * Validate calling getBytes() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test03() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.getBytes(1, 1);
++ }
++
++ /*
++ * Validate calling getLength() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test04() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.length();
++ }
++
++ /*
++ * Validate calling position() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test05() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.position(new byte[5], 1);
++ }
++
++ /*
++ * Validate calling position() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test06() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.position(new StubBlob(), 1);
++ }
++
++ /*
++ * Validate calling free() after calling setBinaryStream() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test07() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.setBinaryStream(5);
++ }
++
++ /*
++ * Validate calling free() after calling setBytes() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test08() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.setBytes(1, new byte[5]);
++ }
++
++ /*
++ * Validate calling setBytes() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test09() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.setBytes(1, new byte[10], 0, 5);
++ }
++
++ /*
++ * Validate calling truncate() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test10() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ sb.free();
++ sb.truncate(1);
++ }
++
++ /*
++ * Validate getBinaryStream returns the correct bytes
++ */
++ @Test
++ public void test11() throws Exception {
++ byte[] expected = new byte[]{1, 2, 3};
++ SerialBlob sb = new SerialBlob(bytes);
++ InputStream is = sb.getBinaryStream(1, 3);
++ for (byte b : expected) {
++ byte val = (byte) is.read();
++ assertTrue(b == val, val + " does not match " + b);
++ }
++ }
++
++ /*
++ * Validate a SerialException is thrown if pos < 0 for getBinaryStream
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test12() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ InputStream is = sb.getBinaryStream(-1, 3);
++ }
++
++ /*
++ * Validate a SerialException is thrown if pos = 0 for getBinaryStream
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test13() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ InputStream is = sb.getBinaryStream(0, 3);
++ }
++
++ /*
++ * Validate a SerialException is thrown if len > the length of the stream
++ * for getBinaryStream
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test14() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ InputStream is = sb.getBinaryStream(0, 3);
++ }
++
++ /*
++ * Validate a SerialException is thrown if length < 1
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test15() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ InputStream is = sb.getBinaryStream(1, 0);
++ }
++
++ /*
++ * Validate a SerialException is thrown if length > byte array length
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test16() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ InputStream is = sb.getBinaryStream(1, 6);
++ }
++
++ /*
++ * Validate a SerialException is thrown if pos > byte array length
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test17() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ InputStream is = sb.getBinaryStream(bytes.length + 2, 6);
++ }
++
++ /*
++ * Validate that a cloned SerializedBlob bytes match the original
++ */
++ @Test
++ public void test18() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ SerialBlob sb2 = (SerialBlob) sb.clone();
++ assertTrue(
++ Arrays.equals(sb.getBytes(1, (int) sb.length()),
++ sb2.getBytes(1, (int) sb2.length())),
++ "arrays do not match ");
++ }
++
++ /*
++ * Test clone after free has been called that the clone is not accessible
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test19() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ sb.free();
++ SerialBlob sb2 = (SerialBlob) sb.clone();
++ InputStream is = sb2.getBinaryStream(1, 3);
++ }
++
++ /*
++ * Validate that a SerialBlob that is serialized & deserialized is equal to
++ * itself
++ */
++ @Test
++ public void test20() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ SerialBlob sb2 = serializeDeserializeObject(sb);
++ assertTrue(sb.equals(sb2), "SerialBlob not equal");
++ }
++
++ /*
++ * Validate a SerialException is thrown if byte[] is used to
++ * create the SeriablBlob and setBinaryStream is called
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test21() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ sb.setBinaryStream(3);
++ }
++
++ /*
++ * Validate that setBytes will properly write a set of bytes to the
++ * specified location in the SerialBlob and the correct count is returned
++ * for bytes written
++ */
++ @Test
++ public void test22() throws Exception {
++ byte[] diff = new byte[]{7, 8, 9};
++ byte[] expected = new byte[]{1, 7, 8, 9, 5};
++ SerialBlob sb = new SerialBlob(bytes);
++ int written = sb.setBytes(2, diff);
++ assertEquals(written, diff.length);
++ assertTrue(
++ Arrays.equals(sb.getBytes(1, (int) sb.length()),
++ expected),
++ "arrays do not match ");
++ }
++
++ /*
++ * Validate that setBytes will properly write a set of bytes to the
++ * specified location in the SerialBlob and the correct count is returned
++ * for bytes written
++ */
++ @Test
++ public void test23() throws Exception {
++ int bytesToWrite = 3;
++ byte[] diff = new byte[]{7, 8, 9, 0};
++ byte[] expected = new byte[]{1, 8, 9, 0, 5};
++ SerialBlob sb = new SerialBlob(bytes);
++ int written = sb.setBytes(2, diff, 1, bytesToWrite);
++ assertEquals(written, bytesToWrite);
++ assertTrue(
++ Arrays.equals(sb.getBytes(1, (int) sb.length()),
++ expected),
++ "arrays do not match ");
++ }
++
++ /*
++ * Validate that truncate reduces the length of the SerlizedBlob to the
++ * specified value
++ */
++ @Test
++ public void test24() throws Exception {
++ SerialBlob sb = new SerialBlob(bytes);
++ sb.truncate(0);
++ assertTrue(sb.length() == 0);
++ sb = new SerialBlob(bytes);
++ sb.truncate(3);
++ assertTrue(sb.length() == 3);
++ }
++
++ /*
++ * Validate getBinaryStream returns the correct bytes
++ */
++ @Test
++ public void test25() throws Exception {
++ byte[] expected = bytes;
++ SerialBlob sb = new SerialBlob(bytes);
++ InputStream is = sb.getBinaryStream();
++ for (byte b : expected) {
++ byte val = (byte) is.read();
++ assertTrue(b == val, val + " does not match " + b);
++ }
++ }
++
++ /*
++ * Validate setBinaryStream returns an OutputStream when passed a Blob
++ */
++ @Test
++ public void test26() throws Exception {
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ OutputStream os = sb.setBinaryStream(0);
++ assertTrue(os != null);
++ }
++
++ /*
++ * Validate that position returns the correct starting location for a
++ * pattern in the SerialBlob
++ */
++ @Test
++ public void test27() throws Exception {
++ long expectedPos = 3; // starting offset is 1 vs 0
++ byte[] pattern = new byte[]{3, 4};
++ SerialBlob sb = new SerialBlob(bytes);
++ long pos = sb.position(pattern, 1);
++ assertEquals(pos, expectedPos);
++ }
++
++ /*
++ * Validate that position returns the correct starting location for a
++ * pattern in the SerialBlob
++ */
++ @Test
++ public void test28() throws Exception {
++ long expectedPos = 3; // starting offset is 1 vs 0
++ byte[] pattern = new byte[]{3, 4, 5};
++ SerialBlob sb = new SerialBlob(bytes);
++ long pos = sb.position(pattern, 2);
++ assertEquals(pos, expectedPos);
++ }
++
++ /*
++ * Validate that position returns the correct starting location for a
++ * pattern in the SerialBlob
++ */
++ @Test
++ public void test29() throws Exception {
++ long expectedPos = 2; // starting offset is 1 vs 0
++ byte[] pattern = new byte[]{4, 6};
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ long pos = sb.position(pattern, 1);
++ assertEquals(pos, expectedPos);
++ }
++
++ /*
++ * Validate that position returns the correct starting location for a
++ * pattern in the SerialBlob
++ */
++ @Test
++ public void test30() throws Exception {
++ long expectedPos = 3; // starting offset is 1 vs 0
++ byte[] pattern = new byte[]{6, 8};
++ SerialBlob sb = new SerialBlob(new StubBlob());
++ long pos = sb.position(pattern, 2);
++ assertEquals(pos, expectedPos);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SerialClobTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,499 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.io.Reader;
++import java.io.Writer;
++import javax.sql.rowset.serial.SerialClob;
++import javax.sql.rowset.serial.SerialException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubClob;
++
++public class SerialClobTests extends BaseTest {
++
++ // char[] used to populate SerialClob
++ private final char[] chars;
++
++ public SerialClobTests() {
++ this.chars = new char[]{'h', 'e', 'l', 'l', 'o', ' ', 'w',
++ 'o', 'r', 'l', 'd'};
++ }
++
++ /*
++ * Validate calling free() does not throw an Exception
++ */
++ @Test
++ public void test() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ }
++
++ /*
++ * Validate calling getCharacterStream() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test01() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.getCharacterStream();
++ }
++
++ /*
++ * Validate calling getCharacterStream() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test02() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ sc.free();
++ sc.getCharacterStream();
++ }
++
++ /*
++ * Validate calling getCharacterStream() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test03() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.getCharacterStream(1, 5);
++ }
++
++ /*
++ * Validate calling getSubString() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test04() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.getSubString(1, 1);
++ }
++
++ /*
++ * Validate calling truncate() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test05() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.truncate(1);
++ }
++
++ /*
++ * Validate calling getAsciiStream() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test06() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.getAsciiStream();
++ }
++
++ /*
++ * Validate calling length() after calling free() throws an SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test07() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.length();
++ }
++
++ /*
++ * Validate calling position() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test08() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.position("hello", 1);
++ }
++
++ /*
++ * Validate calling position() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test09() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.position(new StubClob(), 1);
++ }
++
++ /*
++ * Validate calling setAsciiStream() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test10() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.setAsciiStream(5);
++ }
++
++ /*
++ * Validate calling setCharacterStream() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test11() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.setCharacterStream(5);
++ }
++
++ /*
++ * Validate calling setString() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test12() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.setString(1, "hello");
++ }
++
++ /*
++ * Validate calling setString() after calling free() throws an
++ * SerialException
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test13() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.free();
++ sc.setString(1, "hello", 0, 5);
++ }
++
++ /*
++ * Test that SerialException is thrown if pos < 0 on a call to
++ * getCharacterStream
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test14() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ sc.getCharacterStream(-1, 5);
++ }
++
++ /*
++ * Test that SerialException is thrown if pos = 0 on a call to
++ * getCharacterStream
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test15() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ sc.getCharacterStream(0, 5);
++ }
++
++ /*
++ * Test that SerialException is thrown if pos = 0 on a call to
++ * getCharacterStream
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test16() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ sc.getCharacterStream(1, 100);
++ }
++
++ /*
++ * Test that SerialException is thrown if length = 0 on a call to
++ * getCharacterStream
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test17() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ sc.getCharacterStream(1, 0);
++ }
++
++ /*
++ * Test that SerialException is thrown if pos > length on a call to
++ * getCharacterStream
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test18() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ sc.getCharacterStream(100, 5);
++ }
++
++ /*
++ * Clone a SerialClob and check that it is equal to itself
++ */
++ @Test
++ public void test19() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ SerialClob sc1 = (SerialClob) sc.clone();
++ assertTrue(sc.equals(sc1), "SerialClobs not equal");
++ }
++
++ /*
++ * Validate that a getAsciiStream() returns an InputStream when a Clob is
++ * used to create the SerialClob
++ */
++ @Test
++ public void test20() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ InputStream is = sc.getAsciiStream();
++ assertTrue(is != null);
++ }
++
++ /*
++ * Validate that a getCharacterStream() returns an Reader when a Clob is
++ * used to create the SerialClob
++ */
++ @Test
++ public void test21() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ Reader is = sc.getCharacterStream();
++ assertTrue(is != null);
++ }
++
++ /*
++ * Validate that a getCharacterStream() returns an Reader when a char[] is
++ * used to create the SerialClob
++ */
++ @Test
++ public void test22() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ Reader is = sc.getCharacterStream();
++ assertTrue(is != null);
++ }
++
++ /*
++ * Validate that a getSubString() returns the correct value when a char[] is
++ * used to create the SerialClob
++ */
++ @Test
++ public void test23() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ String expected = "world";
++ assertEquals(expected, sc.getSubString(7, 5));
++ }
++
++ /*
++ * Validate that a getSubString() returns the correct value when a Clob is
++ * used to create the SerialClob
++ */
++ @Test
++ public void test24() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ String expected = "test string";
++ assertEquals(expected, sc.getSubString(5, 11));
++ }
++
++ /*
++ * Validate that position() returns the correct value when a Clob is used to
++ * create the SerialClob
++ */
++ @Test
++ public void test25() throws Exception {
++ long expectedPos = 5;
++ SerialClob sc = new SerialClob(new StubClob());
++ String expected = "test string";
++ long pos = sc.position(expected, 1);
++ assertEquals(expectedPos, pos);
++ }
++
++ /*
++ * Validate that position returned is -1 when an the search string is not
++ * part of the SerialClob
++ */
++ @Test
++ public void test26() throws Exception {
++ long expectedPos = -1;
++ SerialClob sc = new SerialClob(chars);
++ String expected = "test string";
++ long pos = sc.position(expected, 1);
++ assertEquals(expectedPos, pos);
++ }
++
++ /*
++ * Validate that position() returned is -1 when an the search string is not
++ * part of the SerialClob
++ */
++ @Test
++ public void test27() throws Exception {
++ long expectedPos = -1;
++ SerialClob sc = new SerialClob(new StubClob());
++ String expected = "I am Batman";
++ long pos = sc.position(expected, 2);
++ assertEquals(expectedPos, pos);
++ }
++
++ /*
++ * Validate that position() returns the correct value when a char[] is used
++ * to create the SerialClob
++ */
++ @Test
++ public void test28() throws Exception {
++ long expectedPos = 2;
++ SerialClob sc = new SerialClob(chars);
++ String expected = "ello";
++ long pos = sc.position(expected, 1);
++ assertEquals(expectedPos, pos);
++ }
++
++ /*
++ * Validate that position() returns the correct value when a SerialClob is
++ * used for the search argument
++ */
++ @Test
++ public void test29() throws Exception {
++ long expectedPos = 21;
++ String expected = "Batman";
++ String buf = "I am Joker, not the Batman, hahaha";
++ SerialClob sc = new SerialClob(expected.toCharArray());
++ SerialClob sc1 = new SerialClob(buf.toCharArray());
++ long pos = sc1.position(sc, 1);
++ assertEquals(expectedPos, pos);
++ }
++
++ /*
++ * Validate that position() returns the correct value when a SerialClob is
++ * used for the search argument
++ */
++ @Test
++ public void test30() throws Exception {
++ long expectedPos = 17;
++ String expected = "012";
++ SerialClob sc = new SerialClob(expected.toCharArray());
++ SerialClob sc1 = new SerialClob(new StubClob());
++ long pos = sc1.position(sc, 1);
++ assertEquals(expectedPos, pos);
++ }
++
++ /*
++ * Check that setString() updates the appropriate characters in the
++ * SerialClob
++ */
++ @Test
++ public void test31() throws Exception {
++ String val = "Hello, I am Bruce Wayne";
++ String val1 = "the Batman!";
++ String expected = "Hello, I am the Batman!";
++ SerialClob sc = new SerialClob(val.toCharArray());
++ int written = sc.setString(13, val1);
++ assertEquals(val1.length(), written);
++ assertTrue(expected.equals(sc.getSubString(1, (int) sc.length())));
++ }
++
++ /*
++ * Check that setString() updates the appropriate characters in the
++ * SerialClob
++ */
++ @Test(enabled = false)
++ public void test32() throws Exception {
++ int expectedWritten = 9;
++ String val = "Hi, I am Catwoman!!!!!!";
++ String val1 = "Hahaha the Joker, who are you?!";
++ String expected = "Hi, I am the Joker!";
++ SerialClob sc = new SerialClob(val.toCharArray());
++ int written = sc.setString(10, val1, 8, expectedWritten+1);
++ assertEquals(written, expectedWritten);
++
++ }
++
++ /*
++ * Check that setCharacterStream() returns a non-null Writer for an
++ * SerialClob created from a Clob
++ */
++ @Test
++ public void test33() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ Writer w = sc.setCharacterStream(1);
++ assertTrue(w != null);
++ }
++
++ /*
++ * Check that setAsciiStream() returns a non-null OutputStream for an SerialClob
++ * created from a Clob
++ */
++ @Test
++ public void test34() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ OutputStream os = sc.setAsciiStream(1);
++ assertTrue(os != null);
++ }
++
++ /*
++ * Check that truncate() truncates the length of the SerialClob to the
++ * specified size
++ */
++ @Test
++ public void test35() throws Exception {
++ SerialClob sc = new SerialClob(new StubClob());
++ sc.truncate(0);
++ assertTrue(sc.length() == 0);
++ sc = new SerialClob(chars);
++ sc.truncate(5);
++ assertTrue(sc.length() == 5);
++ }
++
++ /*
++ * Check that getCharacterStream() returns a Reader and that the char[] that
++ * was specified to create the SerialClob can be returned via the Reader
++ */
++ @Test
++ public void test36() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ Reader r = sc.getCharacterStream();
++ for (char c : chars) {
++ char val = (char) r.read();
++ assertTrue(c == val, val + " does not match " + c);
++ }
++ }
++
++ /*
++ * Check that getCharacterStream() returns a Reader and that the char[] that
++ * was specified to create the SerialClob can be returned via the Reader
++ */
++ @Test(enabled = false)
++ public void test37() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ String expected = "ello w";
++ Reader r = sc.getCharacterStream(2, 6);
++ for (char c : expected.toCharArray()) {
++ char val = (char) r.read();
++ assertTrue(c == val, val + " does not match " + c);
++ }
++ }
++
++ /*
++ * Validate that a SerialClob that is serialized & deserialized is equal to
++ * itself
++ */
++ @Test
++ public void test38() throws Exception {
++ SerialClob sc = new SerialClob(chars);
++ SerialClob sc2 = serializeDeserializeObject(sc);
++ assertTrue(sc.equals(sc2), "SerialClobs not equal");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SerialDataLinkTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,110 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.net.URL;
++import javax.sql.rowset.serial.SerialDatalink;
++import javax.sql.rowset.serial.SerialException;
++import static org.testng.Assert.*;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SerialDataLinkTests extends BaseTest {
++
++ private URL u;
++ private URL u1;
++ private SerialDatalink dl;
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ u = new URL("http://www.oracle.com/");
++ u1 = new URL("http://www.usatoday.com/");
++ dl = new SerialDatalink(u);
++ }
++
++ /*
++ * Validate that a SerialException is thrown if the URL is null
++ */
++ @Test(expectedExceptions = SerialException.class)
++ public void test() throws Exception {
++ SerialDatalink dl1 = new SerialDatalink(null);
++ }
++
++ /*
++ * Validate that getDatalink() returns the same URL used to create the
++ * SerialDatalink object
++ */
++ @Test
++ public void test01() throws Exception {
++ URL u2 = dl.getDatalink();
++ assertTrue(u2.equals(u));
++ assertTrue(u2.sameFile(u));
++ }
++
++ /*
++ * Validate that URL returned from getDatalink() differs from a URL that was
++ * not used to create the SerialDatalink
++ */
++ @Test
++ public void test02() throws Exception {
++ URL u2 = dl.getDatalink();
++ assertFalse(u2.equals(u1));
++ assertFalse(u2.sameFile(u1));
++ }
++
++ /*
++ * Create a clone of a SerialDatalink and validate that it is equal to the
++ * SerialDatalink it was cloned from
++ */
++ @Test
++ public void test03() throws Exception {
++ SerialDatalink dl2 = (SerialDatalink) dl.clone();
++ assertTrue(dl.equals(dl2));
++ SerialDatalink dl3 = new SerialDatalink(u1);
++ assertFalse(dl2.equals(dl3));
++ }
++
++ /*
++ * Validate that a SerialDatalink that is serialized & deserialized is
++ * equal to itself
++ */
++ @Test
++ public void test04() throws Exception {
++ SerialDatalink dl2 = serializeDeserializeObject(dl);
++ SerialDatalink dl3 = new SerialDatalink(u);
++ assertTrue(dl.equals(dl2));
++ assertTrue(dl3.equals(dl2));
++ }
++
++ /**
++ * Validate that a SerialDatalink that is serialized & deserialized is not equal
++ * to to a SerialDatalink created using a different URL
++ */
++ @Test
++ public void test05() throws Exception {
++ SerialDatalink dl2 = serializeDeserializeObject(dl);
++ SerialDatalink d3 = new SerialDatalink(u1);
++ assertFalse(d3.equals(dl2));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SerialExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,113 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.sql.SQLException;
++import javax.sql.rowset.serial.SerialException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SerialExceptionTests extends BaseTest {
++
++ /*
++ * Create SerialException with no-arg constructor
++ */
++ @Test
++ public void test01() {
++ SerialException ex = new SerialException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /*
++ * Create SerialException with message
++ */
++ @Test
++ public void test02() {
++ SerialException ex = new SerialException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /*
++ * Validate that the ordering of the returned Exceptions is correct using
++ * for-each loop
++ */
++ @Test
++ public void test03() {
++ SerialException ex = new SerialException("Exception 1");
++ ex.initCause(t1);
++ SerialException ex1 = new SerialException("Exception 2");
++ SerialException ex2 = new SerialException("Exception 3");
++ ex2.initCause(t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /*
++ * Validate that the ordering of the returned Exceptions is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test04() {
++ SQLException ex = new SerialException("Exception 1");
++ ex.initCause(t1);
++ SerialException ex1 = new SerialException("Exception 2");
++ SerialException ex2 = new SerialException("Exception 3");
++ ex2.initCause(t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ while (ex != null) {
++ assertTrue(msgs[num++].equals(ex.getMessage()));
++ Throwable c = ex.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ ex = ex.getNextException();
++ }
++ }
++
++ /*
++ * Serialize a SerialException and make sure you can read it back properly
++ */
++ @Test
++ public void test05() throws Exception {
++ SerialException e = new SerialException(reason);
++ SerialException ex1 = createSerializedException(e);
++ assertTrue(ex1.getMessage().equals(reason)
++ && ex1.getSQLState() == null
++ && ex1.getCause() == null
++ && ex1.getErrorCode() == 0);;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SerialJavaObjectTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,100 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.lang.reflect.Field;
++import java.util.Arrays;
++import javax.sql.rowset.RowSetMetaDataImpl;
++import javax.sql.rowset.serial.SerialException;
++import javax.sql.rowset.serial.SerialJavaObject;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SerialJavaObjectTests extends BaseTest {
++
++ /*
++ * Validate that an NPE is thrown when null is specified to create
++ * the SerialJavaObject
++ */
++ @Test(expectedExceptions = NullPointerException.class)
++ public void test() throws Exception {
++ SerialJavaObject sjo = new SerialJavaObject(null);
++ }
++
++ /*
++ * Validate that an SerialExcepion is thrown when the object specified
++ * contains public static fields
++ */
++ @Test(expectedExceptions = SerialException.class, enabled = false)
++ public void test01() throws Exception {
++ SerialJavaObject sjo = new SerialJavaObject(new RowSetMetaDataImpl());
++ }
++
++ /*
++ * Validate that an getFields()s returns the same Field[] for the object
++ * used to create the SerialJavaObject
++ */
++ @Test
++ public void test02() throws Exception {
++ SerialException e = new SerialException();
++ SerialJavaObject sjo = new SerialJavaObject(e);
++ Field[] f = e.getClass().getFields();
++ assertTrue(Arrays.equals(f, sjo.getFields()));
++ assertFalse(Arrays.equals("hello".getClass().getFields(),
++ sjo.getFields()));
++ }
++
++ /*
++ * clone() a SerialJavaObject and check that it is equal to the
++ * object it was cloned from
++ */
++ @Test
++ public void test03() throws Exception {
++ SerialJavaObject sjo = new SerialJavaObject("Hello");
++ SerialJavaObject sjo2 = (SerialJavaObject) sjo.clone();
++ assertTrue(sjo.equals(sjo2));
++ }
++
++ /**
++ * Validate that a SerialJavaObject that is serialized & deserialized is
++ * equal to itself
++ */
++ @Test
++ public void test04() throws Exception {
++ SerialJavaObject sjo = new SerialJavaObject("Hello");
++ SerialJavaObject sjo2 = serializeDeserializeObject(sjo);
++ assertTrue(sjo.equals(sjo2));
++ }
++
++ /*
++ * Validate that a getObject() returns an object used to create the
++ * SerialJavaObject
++ */
++ @Test
++ public void test05() throws Exception {
++ String s = "Hello world";
++ SerialJavaObject sjo = new SerialJavaObject(s);
++ assertTrue(s.equals(sjo.getObject()));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SerialRefTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,131 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.sql.Ref;
++import java.sql.SQLException;
++import java.util.HashMap;
++import java.util.Map;
++import javax.sql.rowset.serial.SerialRef;
++import static org.testng.Assert.*;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubRef;
++import util.SuperHero;
++
++public class SerialRefTests extends BaseTest {
++
++ private static Map<String, Class<?>> map = new HashMap<>();
++ private Ref ref;
++ private final String sqlType = "SUPERHERO";
++ private SuperHero hero;
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ map.put(sqlType, Class.forName("util.SuperHero"));
++ hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman");
++ ref = new StubRef(sqlType, hero);
++ }
++
++ /*
++ * Validate that a SQLException() is thrown if the Ref is null
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test01() throws Exception {
++ SerialRef sr = new SerialRef(null);
++ }
++
++ /*
++ * Validate that a SQLException() is thrown if the typeName is null in the
++ * Ref used to create the SerialRef
++ */
++ @Test(expectedExceptions = SQLException.class)
++ public void test02() throws Exception {
++ SerialRef sr = new SerialRef(new StubRef(null, hero));
++ }
++
++ /*
++ * Validate that getBaseTypeName() returns the same SQLType specified
++ * to create the Ref
++ */
++ @Test
++ public void test03() throws Exception {
++ SerialRef sr = new SerialRef(ref);
++ assertEquals(sr.getBaseTypeName(), sqlType);
++ }
++
++ /*
++ * Validate that getObject() returns the same object used to create the Ref
++ */
++ @Test
++ public void test04() throws Exception {
++ SerialRef sr = new SerialRef(ref);
++ assertTrue(hero.equals(sr.getObject()));
++ }
++
++ /*
++ * Validate that getObject() returns the same object used to create the Ref
++ */
++ @Test(enabled = false)
++ public void test05() throws Exception {
++ SerialRef sr = new SerialRef(ref);
++ assertTrue(hero.equals(sr.getObject(map)));
++ }
++
++ /*
++ * Validate that setObject() can be used to change the value of the object
++ * pointed to by the SerialRef
++ */
++ @Test
++ public void test06() throws Exception {
++ SerialRef sr = new SerialRef(ref);
++ assertTrue(hero.equals(sr.getObject()));
++ SuperHero h = new SuperHero(sqlType, "Dick", "Grayson", 1940, "Robin");
++ sr.setObject(h);
++ assertFalse(hero.equals(sr.getObject()));
++ }
++
++ /*
++ * clone() a SerialRef and check that it is equal to the
++ * object it was cloned from
++ */
++ @Test
++ public void test09() throws Exception {
++ SerialRef sr = new SerialRef(ref);
++ SerialRef sr1 = (SerialRef) sr.clone();
++ assertTrue(sr.equals(sr1));
++ }
++
++ /**
++ * Validate that a SerialRef that is serialized & deserialized is equal to
++ * itself for the Object & baseTypeName
++ */
++ @Test
++ public void test10() throws Exception {
++ SerialRef sr = new SerialRef(ref);
++ SerialRef sr1 = serializeDeserializeObject(sr);
++ assertTrue(sr1.getObject().equals(sr.getObject())
++ && sr1.getBaseTypeName().equals(sr.getBaseTypeName()));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/serial/SerialStructTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,140 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.serial;
++
++import java.sql.Struct;
++import java.util.Arrays;
++import java.util.HashMap;
++import java.util.Map;
++import javax.sql.rowset.serial.SerialStruct;
++import static org.testng.Assert.*;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubStruct;
++import util.SuperHero;
++
++public class SerialStructTests extends BaseTest {
++
++ private static Map<String, Class<?>> map = new HashMap<>();
++ private Object[] attributes;
++ private Struct struct;
++ private final String sqlType = "SUPERHERO";
++ private SuperHero hero;
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ attributes = new Object[]{"Bruce", "Wayne", 1939,
++ "Batman"};
++ map.put(sqlType, Class.forName("util.SuperHero"));
++ struct = new StubStruct(sqlType, attributes);
++ hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman");
++ }
++
++ /*
++ * Validate that getSQLTypeName() returns the same SQLType specified by
++ * the Struct used to create the object
++ */
++ @Test
++ public void test01() throws Exception {
++ SerialStruct ss = new SerialStruct(struct, map);
++ assertEquals(ss.getSQLTypeName(), sqlType);
++ }
++
++ /*
++ * Validate that getSQLTypeName() returns the same SQLType specified by
++ * the Struct used to create the object
++ */
++ @Test
++ public void test02() throws Exception {
++ SerialStruct ss = new SerialStruct(hero, map);
++ assertEquals(ss.getSQLTypeName(), sqlType);
++ }
++
++ /*
++ * Validate that getAttributes() returns the same attributes specified by
++ * the Struct used to create the object
++ */
++ @Test
++ public void test03() throws Exception {
++ SerialStruct ss = new SerialStruct(struct, map);
++ assertTrue(Arrays.equals(attributes,
++ ss.getAttributes()));
++ }
++
++ /*
++ * Validate that getAttributes() returns the same attributes specified by
++ * the Struct used to create the object
++ */
++ @Test
++ public void test04() throws Exception {
++ SerialStruct ss = new SerialStruct(hero, map);
++ assertTrue(Arrays.equals(attributes,
++ ss.getAttributes()));
++ }
++
++ /*
++ * Validate that getAttributes() returns the
++ same attributes specified by
++ * the Struct used to create the object
++ */
++ @Test
++ public void test05() throws Exception {
++ SerialStruct ss = new SerialStruct(struct, map);
++ assertTrue(Arrays.equals(attributes,
++ ss.getAttributes(map)));
++ }
++
++ /*
++ * Validate that getAttributes() returns the same attributes specified by
++ * the Struct used to create the object
++ */
++ @Test
++ public void test06() throws Exception {
++ SerialStruct ss = new SerialStruct(hero, map);
++ assertTrue(Arrays.equals(attributes,
++ ss.getAttributes(map)));
++ }
++
++ /*
++ * clone() a SerialStruct and check that it is equal to the
++ * object it was cloned from
++ */
++ @Test
++ public void test07() throws Exception {
++ SerialStruct ss = new SerialStruct(struct, map);
++ SerialStruct ss1 = (SerialStruct) ss.clone();
++ assertTrue(ss.equals(ss1));
++ }
++
++ /**
++ * Validate that a SerialStruct that is serialized & deserialized is equal
++ * to itself
++ */
++ @Test
++ public void test08() throws Exception {
++ SerialStruct ss = new SerialStruct(struct, map);
++ SerialStruct ss1 = serializeDeserializeObject(ss);;
++ assertTrue(ss.equals(ss1));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/spi/SyncFactoryExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,113 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.spi;
++
++import java.sql.SQLException;
++import javax.sql.rowset.spi.SyncFactoryException;
++import static org.testng.Assert.*;
++import org.testng.annotations.Test;
++import util.BaseTest;
++
++public class SyncFactoryExceptionTests extends BaseTest {
++
++ /*
++ * Create SyncFactoryException with no-arg constructor
++ */
++ @Test
++ public void test01() {
++ SyncFactoryException ex = new SyncFactoryException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /*
++ * Create SyncFactoryException with message
++ */
++ @Test
++ public void test02() {
++ SyncFactoryException ex = new SyncFactoryException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0);
++ }
++
++ /*
++ * Validate that the ordering of the returned Exceptions is correct using
++ * for-each loop
++ */
++ @Test
++ public void test03() {
++ SyncFactoryException ex = new SyncFactoryException("Exception 1");
++ ex.initCause(t1);
++ SyncFactoryException ex1 = new SyncFactoryException("Exception 2");
++ SyncFactoryException ex2 = new SyncFactoryException("Exception 3");
++ ex2.initCause(t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /*
++ * Validate that the ordering of the returned Exceptions is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test04() {
++ SQLException ex = new SyncFactoryException("Exception 1");
++ ex.initCause(t1);
++ SyncFactoryException ex1 = new SyncFactoryException("Exception 2");
++ SyncFactoryException ex2 = new SyncFactoryException("Exception 3");
++ ex2.initCause(t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ while (ex != null) {
++ assertTrue(msgs[num++].equals(ex.getMessage()));
++ Throwable c = ex.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ ex = ex.getNextException();
++ }
++ }
++
++ /*
++ * Serialize a SyncFactoryException and make sure you can read it back properly
++ */
++ @Test
++ public void test05() throws Exception {
++ SyncFactoryException e = new SyncFactoryException(reason);
++ SyncFactoryException ex1 = createSerializedException(e);
++ assertTrue(ex1.getMessage().equals(reason)
++ && ex1.getSQLState() == null
++ && ex1.getCause() == null
++ && ex1.getErrorCode() == 0);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/spi/SyncFactoryPermissionsTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,179 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.spi;
++
++import java.security.AccessControlException;
++import java.security.Policy;
++import java.util.logging.Level;
++import java.util.logging.Logger;
++import javax.naming.Context;
++import javax.sql.rowset.spi.SyncFactory;
++import javax.sql.rowset.spi.SyncFactoryException;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubContext;
++import util.TestPolicy;
++
++public class SyncFactoryPermissionsTests extends BaseTest {
++
++ Context ctx;
++ private static Policy policy;
++ private static SecurityManager sm;
++ private final Logger alogger = Logger.getLogger(this.getClass().getName());
++
++ /*
++ * Install a SeeurityManager along with a base Policy to allow testNG to run
++ */
++ @BeforeClass
++ public static void setUpClass() throws Exception {
++ setPolicy(new TestPolicy());
++ System.setSecurityManager(new SecurityManager());
++ }
++
++ /*
++ * Install the original Policy and SecurityManager
++ */
++ @AfterClass
++ public static void tearDownClass() throws Exception {
++ System.setSecurityManager(sm);
++ setPolicy(policy);
++ }
++
++ /*
++ * Initialize a Context to be used in our tests.
++ * Save off the original Policy and SecurityManager
++ */
++ public SyncFactoryPermissionsTests() {
++ policy = Policy.getPolicy();
++ sm = System.getSecurityManager();
++ ctx = new StubContext();
++ }
++
++ /*
++ * Validate that AccessControlException is thrown if
++ * SQLPermission("setSyncFactory") has not been granted
++ */
++ @Test(expectedExceptions = AccessControlException.class)
++ public void test() throws Exception {
++ setPolicy(new TestPolicy());
++ SyncFactory.setJNDIContext(ctx);
++ }
++
++ /*
++ * Validate that a SyncFactoryException is thrown if the Logger is null
++ */
++ @Test(expectedExceptions = SyncFactoryException.class)
++ public void test00() throws SyncFactoryException {
++ Logger l = SyncFactory.getLogger();
++ }
++
++ /*
++ * Validate that setJNDIContext succeeds if SQLPermission("setSyncFactory")
++ * has been granted
++ */
++ @Test
++ public void test01() throws Exception {
++ setPolicy(new TestPolicy("setSyncFactory"));
++ SyncFactory.setJNDIContext(ctx);
++ }
++
++ /*
++ * Validate that setJNDIContext succeeds if AllPermissions has been granted
++ */
++ @Test
++ public void test02() throws Exception {
++ setPolicy(new TestPolicy("all"));
++ SyncFactory.setJNDIContext(ctx);
++ }
++
++ /*
++ * Validate that AccessControlException is thrown if
++ * SQLPermission("setSyncFactory") has not been granted
++ */
++ @Test(expectedExceptions = AccessControlException.class)
++ public void test03() throws Exception {
++ setPolicy(new TestPolicy());
++ SyncFactory.setLogger(alogger);
++ }
++
++ /*
++ * Validate that setLogger succeeds if SQLPermission("setSyncFactory")
++ * has been granted
++ */
++ @Test
++ public void test04() throws Exception {
++ setPolicy(new TestPolicy("setSyncFactory"));
++ SyncFactory.setLogger(alogger);
++ }
++
++ /*
++ * Validate that setLogger succeeds if AllPermissions has been granted
++ */
++ @Test
++ public void test05() throws Exception {
++ setPolicy(new TestPolicy("all"));
++ SyncFactory.setLogger(alogger);
++ }
++
++ /*
++ * Validate that AccessControlException is thrown if
++ * SQLPermission("setSyncFactory") has not been granted
++ */
++ @Test(expectedExceptions = AccessControlException.class)
++ public void test06() throws Exception {
++ setPolicy(new TestPolicy());
++ SyncFactory.setLogger(alogger, Level.INFO);
++ }
++
++ /*
++ * Validate that AccessControlException is thrown if
++ * SQLPermission("setSyncFactory") and LoggingPermission("control", null)
++ * have not been granted
++ */
++ @Test(expectedExceptions = AccessControlException.class)
++ public void test07() throws Exception {
++ setPolicy(new TestPolicy("setSyncFactory"));
++ SyncFactory.setLogger(alogger, Level.INFO);
++ }
++
++ /*
++ * Validate that setLogger succeeds if SQLPermission("setSyncFactory")
++ * has been granted
++ */
++ @Test
++ public void test08() throws Exception {
++ setPolicy(new TestPolicy("setSyncFactoryLogger"));
++ SyncFactory.setLogger(alogger, Level.INFO);
++ }
++
++ /*
++ * Validate that setLogger succeeds if AllPermissions has been granted
++ */
++ @Test
++ public void test09() throws Exception {
++ setPolicy(new TestPolicy("all"));
++ SyncFactory.setLogger(alogger, Level.INFO);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/spi/SyncFactoryTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,220 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.spi;
++
++import com.sun.rowset.providers.RIOptimisticProvider;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Enumeration;
++import java.util.List;
++import java.util.logging.Level;
++import java.util.logging.Logger;
++import javax.naming.Context;
++import javax.sql.rowset.spi.SyncFactory;
++import javax.sql.rowset.spi.SyncFactoryException;
++import javax.sql.rowset.spi.SyncProvider;
++import static org.testng.Assert.*;
++import org.testng.annotations.BeforeMethod;
++import org.testng.annotations.Test;
++import util.PropertyStubProvider;
++import util.StubSyncProvider;
++import util.StubContext;
++
++//com.sun.jndi.ldap.LdapCtxFactory
++public class SyncFactoryTests {
++ private static String origFactory;
++
++ private final String stubProvider = "util.StubSyncProvider";
++ private final String propertyStubProvider = "util.PropertyStubProvider";
++ private final Logger alogger = Logger.getLogger(this.getClass().getName());
++ // Initial providers including those set via a property
++ List<String> initialProviders;
++ // All providers including those specifically registered
++ List<String> allProviders;
++ private Context ctx= null;
++
++ public SyncFactoryTests() {
++
++ // Add a provider via a property
++ System.setProperty("rowset.provider.classname", propertyStubProvider);
++ initialProviders = Arrays.asList(
++ "com.sun.rowset.providers.RIOptimisticProvider",
++ "com.sun.rowset.providers.RIXMLProvider",
++ propertyStubProvider);
++ allProviders = new ArrayList<>();
++ allProviders.addAll(initialProviders);
++ allProviders.add(stubProvider);
++ ctx = new StubContext();
++ }
++
++ @BeforeMethod
++ public void setUpMethod() throws Exception {
++ // Make sure the provider provider that is registered is removed
++ // before each run
++ SyncFactory.unregisterProvider(stubProvider);
++ }
++
++ /*
++ * Validate a non-null factory is returned
++ */
++ @Test
++ public void test() throws SyncFactoryException {
++ SyncFactory syncFactory = SyncFactory.getSyncFactory();
++ assertTrue(syncFactory != null);
++ }
++
++ /*
++ * Check that the correct SyncProvider is returned for the specified
++ * providerID for the provider registered via a property
++ */
++ @Test
++ public void test00() throws SyncFactoryException {
++ SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
++ assertTrue(p instanceof PropertyStubProvider);
++ }
++
++ /*
++ * Check that the correct SyncProvider is returned for the specified
++ * providerID
++ */
++ @Test
++ public void test01() throws SyncFactoryException {
++ SyncFactory.registerProvider(stubProvider);
++ SyncProvider p = SyncFactory.getInstance(stubProvider);
++ assertTrue(p instanceof StubSyncProvider);
++ }
++
++ /*
++ * Check that the Default SyncProvider is returned if an empty String is
++ * passed or if an invalid providerID is specified
++ */
++ @Test
++ public void test02() throws SyncFactoryException {
++ SyncProvider p = SyncFactory.getInstance("");
++ assertTrue(p instanceof RIOptimisticProvider);
++ // Attempt to get an invalid provider and get the default provider
++ p = SyncFactory.getInstance("util.InvalidSyncProvider");
++ assertTrue(p instanceof RIOptimisticProvider);
++ }
++
++ /*
++ * Validate that a SyncFactoryException is thrown if the ProviderID is null
++ */
++ @Test(expectedExceptions = SyncFactoryException.class)
++ public void test03() throws SyncFactoryException {
++ SyncProvider p = SyncFactory.getInstance(null);
++ }
++
++ /*
++ * Validate that a SyncFactoryException is thrown if the Logger is null
++ */
++ @Test(expectedExceptions = SyncFactoryException.class,enabled=true)
++ public void test04() throws SyncFactoryException {
++ Logger l = SyncFactory.getLogger();
++ }
++
++ /*
++ * Validate that the correct logger is returned by getLogger
++ */
++ @Test
++ public void test05() throws SyncFactoryException {
++ SyncFactory.setLogger(alogger);
++ Logger l = SyncFactory.getLogger();
++ assertTrue(l.equals(alogger));
++ }
++
++ /*
++ * Validate that the correct logger is returned by getLogger
++ */
++ @Test
++ public void test06() throws SyncFactoryException {
++ SyncFactory.setLogger(alogger, Level.INFO);
++ Logger l = SyncFactory.getLogger();
++ assertTrue(l.equals(alogger));
++ }
++
++ /*
++ * Validate that a driver that is registered is returned by
++ * getRegisteredProviders and if it is unregistered, that it is
++ * not returned by getRegisteredProviders
++ */
++ @Test
++ public void test07() throws SyncFactoryException {
++
++ // Validate that only the default providers and any specified via
++ // a System property are available
++ validateProviders(initialProviders);
++
++ // Register a provider and make sure it is avaiable
++ SyncFactory.registerProvider(stubProvider);
++ validateProviders(allProviders);
++
++ // Check that if a provider is unregistered, it does not show as
++ // registered
++ SyncFactory.unregisterProvider(stubProvider);
++ validateProviders(initialProviders);
++ }
++
++ /*
++ * Validate that setJNDIContext throws a SyncFactoryException if the
++ * context is null
++ */
++ @Test(expectedExceptions = SyncFactoryException.class, enabled=true)
++ public void test08() throws Exception {
++ SyncFactory.setJNDIContext(null);
++ }
++
++ /*
++ * Validate that setJNDIContext succeeds
++ */
++ @Test(enabled=true)
++ public void test09() throws Exception {
++ SyncFactory.setJNDIContext(ctx);
++ }
++
++ /*
++ * Utility method to validate the expected providers are regsitered
++ */
++ private void validateProviders(List<String> expectedProviders)
++ throws SyncFactoryException {
++ List<String> results = new ArrayList<>();
++ Enumeration<SyncProvider> providers = SyncFactory.getRegisteredProviders();
++
++ while (providers.hasMoreElements()) {
++ SyncProvider p = providers.nextElement();
++ results.add(p.getProviderID());
++ }
++ assertTrue(expectedProviders.containsAll(results)
++ && results.size() == expectedProviders.size());
++ }
++
++ /*
++ * Utility method to dump out SyncProvider info for a registered provider
++ */
++ private void showImpl(SyncProvider impl) {
++ System.out.println("Provider implementation:"
++ + "\nVendor: " + impl.getVendor()
++ + "\nVersion: " + impl.getVersion()
++ + "\nProviderID: " + impl.getProviderID());
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/spi/SyncProviderExceptionTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,187 @@
++/*
++ * Copyright (c) 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.
++ */
++package test.rowset.spi;
++
++import com.sun.rowset.internal.SyncResolverImpl;
++import java.sql.SQLException;
++import javax.sql.rowset.spi.SyncProviderException;
++import static org.testng.Assert.*;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++import util.BaseTest;
++import util.StubSyncResolver;
++
++public class SyncProviderExceptionTests extends BaseTest {
++ @BeforeClass
++ public static void setUpClass() throws Exception {
++ System.out.println(System.getProperty("java.naming.factory.initial"));
++ }
++
++ @AfterClass
++ public static void tearDownClass() throws Exception {
++ }
++ /*
++ * Create SyncProviderException with no-arg constructor
++ */
++ @Test
++ public void test() {
++ SyncProviderException ex = new SyncProviderException();
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getSyncResolver() instanceof SyncResolverImpl);
++ }
++
++ /*
++ * Create SyncProviderException with no-arg constructor and
++ * call setSyncResolver to indicate the SyncResolver to use
++ */
++ @Test
++ public void test01() {
++ SyncProviderException ex = new SyncProviderException();
++ ex.setSyncResolver(new StubSyncResolver());
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getSyncResolver() instanceof StubSyncResolver);
++ }
++
++ /*
++ * Create SyncProviderException with message
++ */
++ @Test
++ public void test02() {
++ SyncProviderException ex = new SyncProviderException(reason);
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getSyncResolver() instanceof SyncResolverImpl);
++ }
++
++ /*
++ * Create SyncProviderException with message and
++ * call setSyncResolver to indicate the SyncResolver to use
++ */
++ @Test
++ public void test03() {
++ SyncProviderException ex = new SyncProviderException(reason);
++ ex.setSyncResolver(new StubSyncResolver());
++
++ assertTrue(ex.getMessage().equals(reason)
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getSyncResolver() instanceof StubSyncResolver);
++ }
++
++ /*
++ * Create SyncProviderException with and specify the SyncResolver to use
++ */
++ @Test
++ public void test04() {
++ SyncProviderException ex = new SyncProviderException(new StubSyncResolver());
++ assertTrue(ex.getMessage() == null
++ && ex.getSQLState() == null
++ && ex.getCause() == null
++ && ex.getErrorCode() == 0
++ && ex.getSyncResolver() instanceof StubSyncResolver);
++ }
++
++ /*
++ * Validate that the ordering of the returned Exceptions is correct using
++ * for-each loop
++ */
++ @Test
++ public void test05() {
++ SyncProviderException ex = new SyncProviderException("Exception 1");
++ ex.initCause(t1);
++ SyncProviderException ex1 = new SyncProviderException("Exception 2");
++ SyncProviderException ex2 = new SyncProviderException("Exception 3");
++ ex2.initCause(t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ for (Throwable e : ex) {
++ assertTrue(msgs[num++].equals(e.getMessage()));
++ }
++ }
++
++ /*
++ * Validate that the ordering of the returned Exceptions is correct using
++ * traditional while loop
++ */
++ @Test
++ public void test06() {
++ SQLException ex = new SyncProviderException("Exception 1");
++ ex.initCause(t1);
++ SyncProviderException ex1 = new SyncProviderException("Exception 2");
++ SyncProviderException ex2 = new SyncProviderException("Exception 3");
++ ex2.initCause(t2);
++ ex.setNextException(ex1);
++ ex.setNextException(ex2);
++ int num = 0;
++ while (ex != null) {
++ assertTrue(msgs[num++].equals(ex.getMessage()));
++ Throwable c = ex.getCause();
++ while (c != null) {
++ assertTrue(msgs[num++].equals(c.getMessage()));
++ c = c.getCause();
++ }
++ ex = ex.getNextException();
++ }
++ }
++
++ /*
++ * Serialize a SyncProviderException and make sure you can read it back properly
++ */
++ @Test
++ public void test07() throws Exception {
++ SyncProviderException e = new SyncProviderException(reason);
++ SyncProviderException ex1 = createSerializedException(e);
++ assertTrue(ex1.getMessage().equals(reason)
++ && ex1.getSQLState() == null
++ && ex1.getCause() == null
++ && ex1.getErrorCode() == 0
++ && ex1.getSyncResolver() instanceof SyncResolverImpl, ex1.getSyncResolver().getClass().getName());
++ }
++
++ /*
++ * Serialize a SyncProviderException and make sure you can read it back properly
++ */
++ @Test
++ public void test08() throws Exception {
++ SyncProviderException e = new SyncProviderException(reason);
++ e.setSyncResolver(new StubSyncResolver());
++
++ SyncProviderException ex1 = createSerializedException(e);
++ assertTrue(ex1.getMessage().equals(reason)
++ && ex1.getSQLState() == null
++ && ex1.getCause() == null
++ && ex1.getErrorCode() == 0
++ && ex1.getSyncResolver() instanceof StubSyncResolver);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/webrowset/CommonWebRowSetTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,400 @@
++/*
++ * 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 test.rowset.webrowset;
++
++import java.io.ByteArrayInputStream;
++import java.io.ByteArrayOutputStream;
++import java.io.File;
++import java.io.FileInputStream;
++import java.io.FileReader;
++import java.io.InputStreamReader;
++import java.io.ObjectInputStream;
++import java.io.ObjectOutputStream;
++import java.io.OutputStreamWriter;
++import java.math.BigDecimal;
++import java.sql.ResultSet;
++import java.util.Arrays;
++import javax.sql.rowset.WebRowSet;
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertEqualsNoOrder;
++import static org.testng.Assert.assertFalse;
++import static org.testng.Assert.assertTrue;
++import org.testng.annotations.Test;
++import test.rowset.cachedrowset.CommonCachedRowSetTests;
++
++public abstract class CommonWebRowSetTests extends CommonCachedRowSetTests {
++
++ protected final String XMLFILEPATH = System.getProperty("test.src", ".")
++ + File.separatorChar + "xml" + File.separatorChar;
++ protected final String COFFEE_ROWS_XML = XMLFILEPATH + "COFFEE_ROWS.xml";
++ protected final String DELETED_COFFEE_ROWS_XML
++ = XMLFILEPATH + "DELETED_COFFEE_ROWS.xml";
++ protected final String MODFIED_DELETED_COFFEE_ROWS_XML
++ = XMLFILEPATH + "MODFIED_DELETED_COFFEE_ROWS.xml";
++ protected final String UPDATED_COFFEE_ROWS_XML
++ = XMLFILEPATH + "UPDATED_COFFEE_ROWS.xml";
++ protected final String INSERTED_COFFEE_ROWS_XML
++ = XMLFILEPATH + "INSERTED_COFFEE_ROWS.xml";
++ protected final String UPDATED_INSERTED_COFFEE_ROWS_XML
++ = XMLFILEPATH + "UPDATED_INSERTED_COFFEE_ROWS.xml";
++
++
++ /*
++ * Utility method to write a WebRowSet XML file via an OutputStream
++ */
++ protected ByteArrayOutputStream writeWebRowSetWithOutputStream(WebRowSet rs) throws Exception {
++ ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
++ rs.writeXml(oos);
++ }
++ return baos;
++ }
++
++ /*
++ * Utility method to write a WebRowSet XML file via an OutputStream
++ * and populating the WebRowSet via a ResultSet
++ */
++ protected ByteArrayOutputStream writeWebRowSetWithOutputStream(ResultSet rs) throws Exception {
++ ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
++ WebRowSet wrs = rsf.createWebRowSet();
++ wrs.writeXml(rs, oos);
++ }
++ return baos;
++ }
++
++
++ /*
++ * Utility method to popoulate a WebRowSet via a InputStream
++ */
++ protected WebRowSet readWebRowSetWithOInputStream(ByteArrayOutputStream baos) throws Exception {
++ WebRowSet wrs1 = rsf.createWebRowSet();
++ try (ObjectInputStream ois
++ = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
++ wrs1.readXml(ois);
++ }
++ return wrs1;
++ }
++
++ /*
++ * Utility method to write a WebRowSet XML file via an Writer
++ */
++ protected ByteArrayOutputStream writeWebRowSetWithOutputStreamWithWriter(WebRowSet rs) throws Exception {
++ ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ OutputStreamWriter osw = new OutputStreamWriter(baos);
++ rs.writeXml(osw);
++ return baos;
++ }
++
++ /*
++ * Utility method to write a WebRowSet XML file via an Writer and populating
++ * the WebRowSet via a ResultSet
++ */
++ protected ByteArrayOutputStream writeWebRowSetWithOutputStreamWithWriter(ResultSet rs) throws Exception {
++ ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ OutputStreamWriter osw = new OutputStreamWriter(baos);
++ WebRowSet wrs = rsf.createWebRowSet();
++ wrs.writeXml(rs, osw);
++ return baos;
++ }
++
++ /*
++ * Utility method to popoulate a WebRowSet via a Readar
++ */
++ protected WebRowSet readWebRowSetWithOInputStreamWithReader(ByteArrayOutputStream baos) throws Exception {
++ WebRowSet wrs1 = rsf.createWebRowSet();
++ InputStreamReader isr = new InputStreamReader(new ByteArrayInputStream(baos.toByteArray()));
++ wrs1.readXml(isr);
++ return wrs1;
++ }
++
++ /*
++ * Validate the expected Rows are contained within the RowSet
++ */
++ @Test(dataProvider = "rowsetUsingCoffees")
++ public void WebRowSetTest0000(WebRowSet wrs) throws Exception {
++ assertEquals(getPrimaryKeys(wrs), COFFEES_PRIMARY_KEYS);
++ assertEquals(wrs.size(), COFFEES_ROWS);
++ wrs.close();
++ }
++
++ /*
++ * Validate the expected Rows are contained within the RowSet
++ * populated by readXML(Reader)
++ */
++ @Test(dataProvider = "rowSetType")
++ public void WebRowSetTest0001(WebRowSet wrs1) throws Exception {
++
++ try (FileReader fr = new FileReader(COFFEE_ROWS_XML)) {
++ wrs1.readXml(fr);
++ }
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ assertEquals(wrs1.size(), COFFEES_ROWS);
++ wrs1.close();
++
++ }
++
++ /*
++ * Validate the expected Rows are contained within the RowSet
++ * populated by readXML(InputStream)
++ */
++ @Test(dataProvider = "rowSetType")
++ public void WebRowSetTest0002(WebRowSet wrs1) throws Exception {
++ try (FileInputStream fis = new FileInputStream(COFFEE_ROWS_XML)) {
++ wrs1.readXml(fis);
++ }
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ assertEquals(wrs1.size(), COFFEES_ROWS);
++ wrs1.close();
++ }
++
++ /*
++ * Write a WebRowSet via writeXML(OutputStream), read it
++ * back via readXML(InputStream) and validate the primary keys
++ * are the same
++ */
++ @Test(dataProvider = "rowsetUsingCoffees")
++ public void WebRowSetTest0003(WebRowSet wrs) throws Exception {
++ ByteArrayOutputStream baos = writeWebRowSetWithOutputStream(wrs);
++ try (WebRowSet wrs1 = readWebRowSetWithOInputStream(baos)) {
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ assertEquals(wrs1.size(), COFFEES_ROWS);
++ }
++ }
++
++ /*
++ * Write a ResultSet via writeXML(OutputStream), read it
++ * back via readXML(InputStream) and validate the primary keys
++ * are the same
++ */
++ @Test(dataProvider = "rowsetUsingCoffees")
++ public void WebRowSetTest0004(WebRowSet wrs) throws Exception {
++ ResultSet rs = wrs;
++ rs.beforeFirst();
++ ByteArrayOutputStream baos = writeWebRowSetWithOutputStream(rs);
++ try (WebRowSet wrs1 = readWebRowSetWithOInputStream(baos)) {
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ assertEquals(wrs1.size(), COFFEES_ROWS);
++ }
++ }
++
++ /*
++ * Write a WebRowSet via writeXML(Writer), read it
++ * back via readXML(Reader) and validate the primary keys
++ * are the same
++ */
++ @Test(dataProvider = "rowsetUsingCoffees")
++ public void WebRowSetTest0005(WebRowSet wrs) throws Exception {
++ ByteArrayOutputStream baos = writeWebRowSetWithOutputStreamWithWriter(wrs);
++ try (WebRowSet wrs1 = readWebRowSetWithOInputStreamWithReader(baos)) {
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ assertEquals(wrs1.size(), COFFEES_ROWS);
++ }
++ }
++
++ /*
++ * Write a WebRowSet via writeXML(Writer), read it
++ * back via readXML(Reader) and validate the primary keys
++ * are the same
++ */
++ @Test(dataProvider = "rowsetUsingCoffees")
++ public void WebRowSetTest0006(WebRowSet wrs) throws Exception {
++ ResultSet rs = wrs;
++ rs.beforeFirst();
++ ByteArrayOutputStream baos = writeWebRowSetWithOutputStreamWithWriter(rs);
++ try (WebRowSet wrs1 = readWebRowSetWithOInputStreamWithReader(baos)) {
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ assertEquals(wrs1.size(), COFFEES_ROWS);
++ }
++ }
++
++ /*
++ * Validate the expected Rows are contained within the RowSet
++ * after deleting the specified rows
++ */
++ @Test(dataProvider = "rowsetUsingCoffees", enabled = false)
++ public void WebRowSetTest0007(WebRowSet wrs) throws Exception {
++ assertEquals(getPrimaryKeys(wrs), COFFEES_PRIMARY_KEYS);
++ int[] rowsToDelete = {2, 4};
++ assertEquals(getPrimaryKeys(wrs), COFFEES_PRIMARY_KEYS);
++ for (int row : rowsToDelete) {
++ assertTrue(deleteRowByPrimaryKey(wrs, row, 1));
++ }
++
++ FileInputStream fis = new FileInputStream(MODFIED_DELETED_COFFEE_ROWS_XML);
++ try (WebRowSet wrs1 = rsf.createWebRowSet()) {
++ wrs1.readXml(fis);
++ // With setShowDeleted(false) which is the default,
++ // the deleted row should not be visible
++ for (int row : rowsToDelete) {
++ assertTrue(findRowByPrimaryKey(wrs1, row, 1));
++ }
++ assertTrue(wrs.size() == COFFEES_ROWS);
++ // With setShowDeleted(true), the deleted row should be visible
++ for (int row : rowsToDelete) {
++ assertTrue(findRowByPrimaryKey(wrs, row, 1));
++ }
++ }
++ }
++
++ /*
++ * Validate the expected Rows are contained within the RowSet
++ * that was populated by reading an xml file with all rows
++ * marked as a currentRow
++ */
++ @Test(dataProvider = "rowSetType")
++ public void WebRowSetTest0008(WebRowSet wrs1) throws Exception {
++ FileInputStream fis = new FileInputStream(COFFEE_ROWS_XML);
++ wrs1.readXml(fis);
++ assertTrue(wrs1.size() == COFFEES_ROWS);
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ // Validate that the rows are not marked as deleted, inserted or updated
++ wrs1.beforeFirst();
++ while (wrs1.next()) {
++ assertFalse(wrs1.rowDeleted());
++ assertFalse(wrs1.rowInserted());
++ assertFalse(wrs1.rowUpdated());
++ }
++ wrs1.close();
++ }
++
++ /*
++ * Read an XML file to populate a WebRowSet and validate that the rows
++ * that are marked as deleted are marked as such in the WebRowSet
++ * Also validate that they are or are not visible based on the
++ * setShowDeleted value
++ */
++ @Test(dataProvider = "rowSetType")
++ public void WebRowSetTest0009(WebRowSet wrs1) throws Exception {
++ int[] rowsToDelete = {2, 4};
++ Object[] expectedRows = {1, 3, 5};
++ FileInputStream fis = new FileInputStream(DELETED_COFFEE_ROWS_XML);
++ wrs1.readXml(fis);
++ assertTrue(wrs1.size() == COFFEES_ROWS);
++ assertEquals(getPrimaryKeys(wrs1), expectedRows);
++ // With setShowDeleted(false) which is the default,
++ // the deleted row should not be visible
++ for (int row : rowsToDelete) {
++ assertFalse(findRowByPrimaryKey(wrs1, row, 1));
++ }
++ // With setShowDeleted(true), the deleted row should be visible
++ wrs1.setShowDeleted(true);
++ for (int row : rowsToDelete) {
++ assertTrue(findRowByPrimaryKey(wrs1, row, 1));
++ }
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ wrs1.close();
++
++ }
++
++ /*
++ * Validate that the correct row in the WebRowSet that had been created
++ * from an xml file is marked as updated and contains the correct values
++ */
++ @Test(dataProvider = "rowSetType")
++ public void WebRowSetTest0010(WebRowSet wrs1) throws Exception {
++ FileInputStream fis = new FileInputStream(UPDATED_COFFEE_ROWS_XML);
++ wrs1.readXml(fis);
++ assertTrue(wrs1.size() == COFFEES_ROWS);
++ assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
++ wrs1.beforeFirst();
++ while (wrs1.next()) {
++ if (wrs1.getInt(1) == 3) {
++ assertTrue(wrs1.rowUpdated());
++ assertTrue(wrs1.getInt(5) == 21 && wrs1.getInt(6) == 69);
++ assertFalse(wrs1.rowDeleted());
++ assertFalse(wrs1.rowInserted());
++ } else {
++ assertFalse(wrs1.rowUpdated());
++ assertFalse(wrs1.rowDeleted());
++ assertFalse(wrs1.rowInserted());
++ }
++ }
++ wrs1.close();
++ }
++
++ /*
++ * Validate the correct row is marked as inserted in a WebRowSet
++ * that is read from an xml file
++ */
++ @Test(dataProvider = "rowSetType")
++ public void WebRowSetTest0011(WebRowSet wrs1) throws Exception {
++ int expectedSize = COFFEES_ROWS + 2;
++ int addedRowPK = 15;
++ int addedRowPK2 = 20;
++ Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
++ expected[expectedSize - 2] = addedRowPK;
++ expected[expectedSize - 1] = addedRowPK2;
++ FileInputStream fis = new FileInputStream(INSERTED_COFFEE_ROWS_XML);
++ wrs1.readXml(fis);
++ assertTrue(wrs1.size() == expectedSize);
++ assertEqualsNoOrder(getPrimaryKeys(wrs1), expected);
++ wrs1.beforeFirst();
++ while (wrs1.next()) {
++ if (wrs1.getInt(1) == 15 || wrs1.getInt(1) == 20) {
++ assertTrue(wrs1.rowInserted());
++ assertFalse(wrs1.rowDeleted());
++ assertFalse(wrs1.rowUpdated());
++ } else {
++ assertFalse(wrs1.rowInserted());
++ assertFalse(wrs1.rowDeleted());
++ assertFalse(wrs1.rowUpdated());
++ }
++ }
++ wrs1.close();
++ }
++
++ /*
++ * Read an xml file which contains a row that was inserted and updated
++ */
++ @Test(dataProvider = "rowSetType")
++ public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
++ int expectedSize = COFFEES_ROWS + 1;
++ int addedRowPK = 100;
++ Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
++ expected[expectedSize - 1] = addedRowPK;
++ FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
++ wrs1.readXml(fis);
++ assertTrue(wrs1.size() == expectedSize);
++ assertEquals(getPrimaryKeys(wrs1), expected);
++ wrs1.beforeFirst();
++ while (wrs1.next()) {
++ if (wrs1.getInt(1) == addedRowPK) {
++ // Row that was inserted and updated
++ assertTrue(wrs1.rowUpdated());
++ assertTrue(
++ wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
++ && wrs1.getInt(6) == 125);
++ assertFalse(wrs1.rowDeleted());
++ assertTrue(wrs1.rowInserted());
++ } else {
++ // Remaining rows should only be inserted
++ assertFalse(wrs1.rowUpdated());
++ assertFalse(wrs1.rowDeleted());
++ assertTrue(wrs1.rowInserted());
++ }
++ }
++ wrs1.close();
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/test/rowset/webrowset/WebRowSetTests.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * 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 test.rowset.webrowset;
++
++import java.sql.SQLException;
++import javax.sql.rowset.WebRowSet;
++
++public class WebRowSetTests extends CommonWebRowSetTests {
++
++ @Override
++ protected WebRowSet newInstance() throws SQLException {
++ return rsf.createWebRowSet();
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/PropertyStubProvider.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,27 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++public class PropertyStubProvider extends StubSyncProvider {
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubArray.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,99 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.sql.Array;
++import java.sql.JDBCType;
++import java.sql.ResultSet;
++import java.sql.SQLException;
++import java.util.Arrays;
++import java.util.Map;
++
++public class StubArray implements Array {
++
++ private String typeName;
++ Object[] elements;
++
++ public StubArray(String name, Object[] values) {
++ typeName = name;
++ elements = Arrays.copyOf(values, values.length);
++
++ }
++
++ @Override
++ public String getBaseTypeName() throws SQLException {
++ return typeName;
++ }
++
++ @Override
++ public int getBaseType() throws SQLException {
++ return JDBCType.valueOf(typeName).getVendorTypeNumber();
++ }
++
++ @Override
++ public Object getArray() throws SQLException {
++ return Arrays.copyOf(elements, elements.length);
++ }
++
++ @Override
++ public Object getArray(Map<String, Class<?>> map) throws SQLException {
++ return getArray();
++ }
++
++ @Override
++ public Object getArray(long index, int count) throws SQLException {
++ return getArray();
++ }
++
++ @Override
++ public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
++ return getArray();
++ }
++
++ @Override
++ public ResultSet getResultSet() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getResultSet(long index, int count) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void free() throws SQLException {
++ elements = null;
++ typeName = null;
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubBaseRowSet.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1001 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.InputStream;
++import java.io.Reader;
++import java.math.BigDecimal;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Date;
++import java.sql.NClob;
++import java.sql.Ref;
++import java.sql.ResultSetMetaData;
++import java.sql.RowId;
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import java.sql.SQLXML;
++import java.sql.Statement;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.util.Calendar;
++import java.util.Map;
++import javax.sql.RowSet;
++import javax.sql.rowset.BaseRowSet;
++
++public class StubBaseRowSet extends BaseRowSet implements RowSet {
++
++ public StubBaseRowSet() {
++ super();
++ // Must call initParams() as part of initialization
++ super.initParams();
++ }
++
++ public void notifyCursorMoved() throws SQLException {
++ super.notifyCursorMoved();
++ }
++
++ public void notifyRowChanged() throws SQLException {
++ super.notifyRowChanged();
++ }
++
++ public void notifyRowSetChanged() throws SQLException {
++ super.notifyRowSetChanged();
++ }
++
++ public void initParams() {
++ super.initParams();
++ }
++
++ // Methods required by RowSet interace, not used
++ @Override
++ public void execute() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean next() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void close() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean wasNull() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLWarning getWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCursorName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSetMetaData getMetaData() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int findColumn(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isBeforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isAfterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void beforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void afterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean first() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean last() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean absolute(int row) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean relative(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previous() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowUpdated() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowInserted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(int columnIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(int columnIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(int columnIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(int columnIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(int columnIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(int columnIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(int columnIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(int columnIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(int columnIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(int columnIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(int columnIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(String columnLabel, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(String columnLabel, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(String columnLabel, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(String columnLabel, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(String columnLabel, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(String columnLabel, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(String columnLabel, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(String columnLabel, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(String columnLabel, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(String columnLabel, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(String columnLabel, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void insertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void deleteRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void refreshRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void cancelRowUpdates() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToInsertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToCurrentRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement getStatement() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public java.net.URL getURL(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public java.net.URL getURL(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(int columnIndex, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(String columnLabel, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(int columnIndex, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(String columnLabel, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(int columnIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(String columnLabel, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getHoldability() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isClosed() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(int columnIndex, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(String columnLabel, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubBlob.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,100 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.ByteArrayOutputStream;
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.ObjectOutputStream;
++import java.io.OutputStream;
++import java.sql.Blob;
++import java.sql.SQLException;
++import java.util.Arrays;
++import java.util.logging.Level;
++import java.util.logging.Logger;
++
++public class StubBlob implements Blob {
++
++ private byte[] bytes;
++
++ public StubBlob() {
++ bytes = new byte[]{2, 4, 6, 8};
++ }
++
++ public long length() throws SQLException {
++ return bytes.length;
++ }
++
++ public byte[] getBytes(long pos, int length)
++ throws SQLException {
++ return Arrays.copyOfRange(bytes, (int) pos - 1, length);
++ }
++
++ public InputStream getBinaryStream()
++ throws SQLException {
++ return null;
++ }
++
++ public long position(byte[] pattern, long start)
++ throws SQLException {
++ return 0;
++ }
++
++ public long position(Blob pattern, long start)
++ throws SQLException {
++ return 0;
++ }
++
++ public int setBytes(long pos, byte[] bytes)
++ throws SQLException {
++ return 0;
++ }
++
++ public int setBytes(long pos, byte[] bytes, int offset, int len)
++ throws SQLException {
++ return 0;
++ }
++
++ public OutputStream setBinaryStream(long pos)
++ throws SQLException {
++ ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ ObjectOutputStream oos = null;
++ try {
++ oos = new ObjectOutputStream(baos);
++ } catch (IOException ex) {
++ Logger.getLogger(StubBlob.class.getName()).log(Level.SEVERE, null, ex);
++ }
++ return oos;
++ }
++
++ public void truncate(long len)
++ throws SQLException {
++ }
++
++ public void free() throws SQLException {
++ }
++
++ public InputStream getBinaryStream(long pos, long length) throws SQLException {
++ return null;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubCachedRowSetImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1848 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.InputStream;
++import java.io.Reader;
++import java.math.BigDecimal;
++import java.net.URL;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Connection;
++import java.sql.Date;
++import java.sql.NClob;
++import java.sql.Ref;
++import java.sql.ResultSet;
++import java.sql.ResultSetMetaData;
++import java.sql.RowId;
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import java.sql.SQLXML;
++import java.sql.Savepoint;
++import java.sql.Statement;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.util.Calendar;
++import java.util.Collection;
++import java.util.Map;
++import javax.sql.RowSet;
++import javax.sql.RowSetEvent;
++import javax.sql.RowSetListener;
++import javax.sql.RowSetMetaData;
++import javax.sql.rowset.CachedRowSet;
++import javax.sql.rowset.RowSetWarning;
++import javax.sql.rowset.spi.SyncProvider;
++import javax.sql.rowset.spi.SyncProviderException;
++
++public class StubCachedRowSetImpl implements CachedRowSet {
++
++ public StubCachedRowSetImpl() {
++ }
++
++ @Override
++ public void populate(ResultSet data) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute(Connection conn) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void acceptChanges() throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void acceptChanges(Connection con) throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void restoreOriginal() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void release() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoDelete() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoInsert() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoUpdate() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean columnUpdated(int idx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean columnUpdated(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection(int column) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection(String column) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SyncProvider getSyncProvider() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSyncProvider(String provider) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int size() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMetaData(RowSetMetaData md) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getOriginal() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getOriginalRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setOriginalRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getTableName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTableName(String tabName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getKeyColumns() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setKeyColumns(int[] keys) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSet createShared() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopy() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopySchema() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopyNoConstraints() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSetWarning getRowSetWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getShowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShowDeleted(boolean b) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void commit() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback(Savepoint s) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void populate(ResultSet rs, int startRow) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPageSize(int size) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getPageSize() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean nextPage() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previousPage() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUrl() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUrl(String url) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getDataSourceName() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDataSourceName(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUsername() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUsername(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getPassword() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPassword(String password) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getTransactionIsolation() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTransactionIsolation(int level) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Map<String, Class<?>> getTypeMap() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCommand() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCommand(String cmd) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isReadOnly() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setReadOnly(boolean value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxFieldSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxFieldSize(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxRows() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxRows(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getEscapeProcessing() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setEscapeProcessing(boolean enable) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getQueryTimeout() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setQueryTimeout(int seconds) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setType(int type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setConcurrency(int concurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int parameterIndex, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(String parameterName, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(int parameterIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(String parameterName, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(int parameterIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(String parameterName, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(int parameterIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(String parameterName, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(int parameterIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(String parameterName, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(int parameterIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(String parameterName, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(int parameterIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(String parameterName, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(int parameterIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(String parameterName, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(String parameterName, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRef(int i, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int i, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int i, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setArray(int i, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearParameters() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void removeRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(int parameterIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(String parameterName, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(int parameterIndex, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(String parameterName, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setURL(int parameterIndex, URL x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean next() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void close() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean wasNull() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLWarning getWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCursorName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSetMetaData getMetaData() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int findColumn(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isBeforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isAfterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void beforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void afterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean first() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean last() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean absolute(int row) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean relative(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previous() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchDirection(int direction) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchDirection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchSize(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getType() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getConcurrency() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowUpdated() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowInserted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(int columnIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(int columnIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(int columnIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(int columnIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(int columnIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(int columnIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(int columnIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(int columnIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(int columnIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(int columnIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(int columnIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(String columnLabel, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(String columnLabel, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(String columnLabel, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(String columnLabel, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(String columnLabel, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(String columnLabel, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(String columnLabel, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(String columnLabel, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(String columnLabel, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(String columnLabel, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(String columnLabel, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void insertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void deleteRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void refreshRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void cancelRowUpdates() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToInsertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToCurrentRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement getStatement() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(int columnIndex, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(String columnLabel, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(int columnIndex, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(String columnLabel, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(int columnIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(String columnLabel, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getHoldability() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isClosed() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(int columnIndex, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(String columnLabel, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String[] columnNames) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getMatchColumnIndexes() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String[] getMatchColumnNames() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String[] columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubClob.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,113 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.ByteArrayOutputStream;
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.ObjectOutputStream;
++import java.io.OutputStream;
++import java.io.Reader;
++import java.io.StringReader;
++import java.io.StringWriter;
++import java.io.Writer;
++import java.sql.Clob;
++import java.sql.SQLException;
++import java.util.logging.Level;
++import java.util.logging.Logger;
++
++public class StubClob implements Clob {
++
++ public String buf = "The test string 0123456789";
++
++ @Override
++ public String getSubString(long pos, int length) throws SQLException {
++ return buf;
++ }
++
++ @Override
++ public long length() throws SQLException {
++ return buf.length();
++ }
++
++ @Override
++ public Reader getCharacterStream() throws SQLException {
++ return new StringReader(buf);
++ }
++
++ @Override
++ public InputStream getAsciiStream() throws SQLException {
++ return new java.io.StringBufferInputStream(buf);
++ }
++
++ @Override
++ public int setString(long pos, String str) throws SQLException {
++ return str.length();
++ }
++
++ @Override
++ public int setString(long pos, String str, int offset, int len) throws SQLException {
++ return len;
++ }
++
++ @Override
++ public long position(String searchstr, long start) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long position(Clob searchstr, long start) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public OutputStream setAsciiStream(long pos) throws SQLException {
++ ByteArrayOutputStream baos = new ByteArrayOutputStream();
++ ObjectOutputStream oos = null;
++ try {
++ oos = new ObjectOutputStream(baos);
++ } catch (IOException ex) {
++ Logger.getLogger(StubBlob.class.getName()).log(Level.SEVERE, null, ex);
++ }
++ return oos;
++ }
++
++ @Override
++ public Writer setCharacterStream(long pos) throws SQLException {
++ return new StringWriter();
++ }
++
++ @Override
++ public void truncate(long len) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void free() throws SQLException {
++ }
++
++ @Override
++ public Reader getCharacterStream(long pos, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubContext.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,220 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.util.Hashtable;
++import javax.naming.Binding;
++import javax.naming.Context;
++import javax.naming.Name;
++import javax.naming.NameClassPair;
++import javax.naming.NameParser;
++import javax.naming.NamingEnumeration;
++import javax.naming.NamingException;
++
++@SuppressWarnings("unchecked")
++public class StubContext implements Context {
++
++ @Override
++ public Object lookup(Name name) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public Object lookup(String name) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public void bind(Name name, Object obj) throws NamingException {
++
++ }
++
++ @Override
++ public void bind(String name, Object obj) throws NamingException {
++
++ }
++
++ @Override
++ public void rebind(Name name, Object obj) throws NamingException {
++
++ }
++
++ @Override
++ public void rebind(String name, Object obj) throws NamingException {
++
++ }
++
++ @Override
++ public void unbind(Name name) throws NamingException {
++
++ }
++
++ @Override
++ public void unbind(String name) throws NamingException {
++
++ }
++
++ @Override
++ public void rename(Name oldName, Name newName) throws NamingException {
++
++ }
++
++ @Override
++ public void rename(String oldName, String newName) throws NamingException {
++
++ }
++
++ @Override
++ public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
++ return new NamingEnumerationStub();
++ }
++
++ @Override
++ public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
++ return new NamingEnumerationStub();
++ }
++
++ @Override
++ public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
++ return new NamingEnumerationStub();
++ }
++
++ @Override
++ public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
++ return new NamingEnumerationStub();
++ }
++
++ @Override
++ public void destroySubcontext(Name name) throws NamingException {
++
++ }
++
++ @Override
++ public void destroySubcontext(String name) throws NamingException {
++
++ }
++
++ @Override
++ public Context createSubcontext(Name name) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public Context createSubcontext(String name) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public Object lookupLink(Name name) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public Object lookupLink(String name) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public NameParser getNameParser(Name name) throws NamingException {
++ return new NameParserStub();
++ }
++
++ @Override
++ public NameParser getNameParser(String name) throws NamingException {
++ return new NameParserStub();
++ }
++
++ @Override
++ public Name composeName(Name name, Name prefix) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public String composeName(String name, String prefix) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public Object addToEnvironment(String propName, Object propVal) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public Object removeFromEnvironment(String propName) throws NamingException {
++ return null;
++ }
++
++ @Override
++ public Hashtable<?, ?> getEnvironment() throws NamingException {
++ return new Hashtable();
++ }
++
++ @Override
++ public void close() throws NamingException {
++
++ }
++
++ @Override
++ public String getNameInNamespace() throws NamingException {
++ return null;
++ }
++
++ class NamingEnumerationStub implements NamingEnumeration {
++
++ @Override
++ public Object next() throws NamingException {
++ return null;
++ }
++
++ @Override
++ public boolean hasMore() throws NamingException {
++ return false;
++ }
++
++ @Override
++ public void close() throws NamingException {
++
++ }
++
++ @Override
++ public boolean hasMoreElements() {
++ return false;
++ }
++
++ @Override
++ public Object nextElement() {
++ return null;
++ }
++
++ }
++
++ class NameParserStub implements NameParser {
++
++ @Override
++ public Name parse(String name) throws NamingException {
++ return null;
++ }
++
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubFilteredRowSetImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1892 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.io.Reader;
++import java.io.Writer;
++import java.math.BigDecimal;
++import java.net.URL;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Connection;
++import java.sql.Date;
++import java.sql.NClob;
++import java.sql.Ref;
++import java.sql.ResultSet;
++import java.sql.ResultSetMetaData;
++import java.sql.RowId;
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import java.sql.SQLXML;
++import java.sql.Savepoint;
++import java.sql.Statement;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.util.Calendar;
++import java.util.Collection;
++import java.util.Map;
++import javax.sql.RowSet;
++import javax.sql.RowSetEvent;
++import javax.sql.RowSetListener;
++import javax.sql.RowSetMetaData;
++import javax.sql.rowset.CachedRowSet;
++import javax.sql.rowset.FilteredRowSet;
++import javax.sql.rowset.Predicate;
++import javax.sql.rowset.RowSetWarning;
++import javax.sql.rowset.spi.SyncProvider;
++import javax.sql.rowset.spi.SyncProviderException;
++
++public class StubFilteredRowSetImpl implements FilteredRowSet {
++
++ public StubFilteredRowSetImpl() {
++ }
++
++ @Override
++ public void setFilter(Predicate p) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Predicate getFilter() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void readXml(Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void readXml(InputStream iStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(ResultSet rs, Writer writer) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(ResultSet rs, OutputStream oStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(Writer writer) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(OutputStream oStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void populate(ResultSet data) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute(Connection conn) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void acceptChanges() throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void acceptChanges(Connection con) throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void restoreOriginal() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void release() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoDelete() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoInsert() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoUpdate() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean columnUpdated(int idx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean columnUpdated(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection(int column) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection(String column) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SyncProvider getSyncProvider() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSyncProvider(String provider) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int size() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMetaData(RowSetMetaData md) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getOriginal() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getOriginalRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setOriginalRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getTableName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTableName(String tabName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getKeyColumns() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setKeyColumns(int[] keys) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSet createShared() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopy() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopySchema() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopyNoConstraints() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSetWarning getRowSetWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getShowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShowDeleted(boolean b) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void commit() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback(Savepoint s) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void populate(ResultSet rs, int startRow) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPageSize(int size) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getPageSize() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean nextPage() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previousPage() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUrl() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUrl(String url) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getDataSourceName() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDataSourceName(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUsername() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUsername(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getPassword() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPassword(String password) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getTransactionIsolation() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTransactionIsolation(int level) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Map<String, Class<?>> getTypeMap() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCommand() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCommand(String cmd) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isReadOnly() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setReadOnly(boolean value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxFieldSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxFieldSize(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxRows() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxRows(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getEscapeProcessing() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setEscapeProcessing(boolean enable) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getQueryTimeout() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setQueryTimeout(int seconds) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setType(int type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setConcurrency(int concurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int parameterIndex, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(String parameterName, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(int parameterIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(String parameterName, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(int parameterIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(String parameterName, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(int parameterIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(String parameterName, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(int parameterIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(String parameterName, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(int parameterIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(String parameterName, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(int parameterIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(String parameterName, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(int parameterIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(String parameterName, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(String parameterName, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRef(int i, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int i, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int i, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setArray(int i, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearParameters() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void removeRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(int parameterIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(String parameterName, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(int parameterIndex, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(String parameterName, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setURL(int parameterIndex, URL x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean next() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void close() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean wasNull() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLWarning getWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCursorName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSetMetaData getMetaData() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int findColumn(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isBeforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isAfterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void beforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void afterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean first() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean last() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean absolute(int row) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean relative(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previous() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchDirection(int direction) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchDirection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchSize(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getType() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getConcurrency() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowUpdated() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowInserted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(int columnIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(int columnIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(int columnIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(int columnIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(int columnIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(int columnIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(int columnIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(int columnIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(int columnIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(int columnIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(int columnIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(String columnLabel, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(String columnLabel, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(String columnLabel, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(String columnLabel, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(String columnLabel, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(String columnLabel, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(String columnLabel, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(String columnLabel, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(String columnLabel, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(String columnLabel, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(String columnLabel, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void insertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void deleteRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void refreshRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void cancelRowUpdates() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToInsertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToCurrentRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement getStatement() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(int columnIndex, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(String columnLabel, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(int columnIndex, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(String columnLabel, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(int columnIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(String columnLabel, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getHoldability() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isClosed() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(int columnIndex, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(String columnLabel, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String[] columnNames) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getMatchColumnIndexes() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String[] getMatchColumnNames() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String[] columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubJdbcRowSetImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1672 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.InputStream;
++import java.io.Reader;
++import java.math.BigDecimal;
++import java.net.URL;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Date;
++import java.sql.NClob;
++import java.sql.Ref;
++import java.sql.ResultSetMetaData;
++import java.sql.RowId;
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import java.sql.SQLXML;
++import java.sql.Savepoint;
++import java.sql.Statement;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.util.Calendar;
++import java.util.Map;
++import javax.sql.RowSetListener;
++import javax.sql.rowset.JdbcRowSet;
++import javax.sql.rowset.RowSetWarning;
++
++public class StubJdbcRowSetImpl implements JdbcRowSet {
++
++ @Override
++ public boolean getShowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShowDeleted(boolean b) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSetWarning getRowSetWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void commit() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getAutoCommit() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAutoCommit(boolean autoCommit) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback(Savepoint s) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUrl() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUrl(String url) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getDataSourceName() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDataSourceName(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUsername() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUsername(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getPassword() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPassword(String password) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getTransactionIsolation() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTransactionIsolation(int level) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Map<String, Class<?>> getTypeMap() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCommand() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCommand(String cmd) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isReadOnly() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setReadOnly(boolean value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxFieldSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxFieldSize(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxRows() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxRows(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getEscapeProcessing() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setEscapeProcessing(boolean enable) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getQueryTimeout() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setQueryTimeout(int seconds) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setType(int type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setConcurrency(int concurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int parameterIndex, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(String parameterName, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(int parameterIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(String parameterName, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(int parameterIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(String parameterName, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(int parameterIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(String parameterName, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(int parameterIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(String parameterName, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(int parameterIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(String parameterName, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(int parameterIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(String parameterName, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(int parameterIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(String parameterName, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(String parameterName, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRef(int i, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int i, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int i, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setArray(int i, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearParameters() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void removeRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(int parameterIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(String parameterName, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(int parameterIndex, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(String parameterName, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setURL(int parameterIndex, URL x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean next() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void close() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean wasNull() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLWarning getWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCursorName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSetMetaData getMetaData() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int findColumn(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isBeforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isAfterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void beforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void afterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean first() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean last() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean absolute(int row) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean relative(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previous() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchDirection(int direction) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchDirection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchSize(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getType() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getConcurrency() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowUpdated() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowInserted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(int columnIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(int columnIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(int columnIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(int columnIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(int columnIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(int columnIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(int columnIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(int columnIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(int columnIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(int columnIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(int columnIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(String columnLabel, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(String columnLabel, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(String columnLabel, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(String columnLabel, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(String columnLabel, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(String columnLabel, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(String columnLabel, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(String columnLabel, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(String columnLabel, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(String columnLabel, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(String columnLabel, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void insertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void deleteRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void refreshRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void cancelRowUpdates() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToInsertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToCurrentRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement getStatement() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(int columnIndex, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(String columnLabel, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(int columnIndex, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(String columnLabel, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(int columnIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(String columnLabel, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getHoldability() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isClosed() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(int columnIndex, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(String columnLabel, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String[] columnNames) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getMatchColumnIndexes() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String[] getMatchColumnNames() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String[] columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubJoinRowSetImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1962 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.io.Reader;
++import java.io.Writer;
++import java.math.BigDecimal;
++import java.net.URL;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Connection;
++import java.sql.Date;
++import java.sql.NClob;
++import java.sql.Ref;
++import java.sql.ResultSet;
++import java.sql.ResultSetMetaData;
++import java.sql.RowId;
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import java.sql.SQLXML;
++import java.sql.Savepoint;
++import java.sql.Statement;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.util.Calendar;
++import java.util.Collection;
++import java.util.Map;
++import javax.sql.RowSet;
++import javax.sql.RowSetEvent;
++import javax.sql.RowSetListener;
++import javax.sql.RowSetMetaData;
++import javax.sql.rowset.CachedRowSet;
++import javax.sql.rowset.JoinRowSet;
++import javax.sql.rowset.Joinable;
++import javax.sql.rowset.RowSetWarning;
++import javax.sql.rowset.spi.SyncProvider;
++import javax.sql.rowset.spi.SyncProviderException;
++
++class StubJoinRowSetImpl implements JoinRowSet {
++
++ public StubJoinRowSetImpl() {
++ }
++
++ @Override
++ public void addRowSet(Joinable rowset) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSet(RowSet rowset, int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSet(RowSet rowset, String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSet(RowSet[] rowset, int[] columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSet(RowSet[] rowset, String[] columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> getRowSets() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String[] getRowSetNames() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet toCachedRowSet() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean supportsCrossJoin() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean supportsInnerJoin() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean supportsLeftOuterJoin() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean supportsRightOuterJoin() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean supportsFullJoin() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setJoinType(int joinType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getWhereClause() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getJoinType() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void readXml(Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void readXml(InputStream iStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(ResultSet rs, Writer writer) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(ResultSet rs, OutputStream oStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(Writer writer) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(OutputStream oStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void populate(ResultSet data) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute(Connection conn) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void acceptChanges() throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void acceptChanges(Connection con) throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void restoreOriginal() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void release() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoDelete() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoInsert() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoUpdate() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean columnUpdated(int idx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean columnUpdated(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection(int column) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection(String column) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SyncProvider getSyncProvider() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSyncProvider(String provider) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int size() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMetaData(RowSetMetaData md) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getOriginal() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getOriginalRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setOriginalRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getTableName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTableName(String tabName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getKeyColumns() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setKeyColumns(int[] keys) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSet createShared() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopy() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopySchema() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopyNoConstraints() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSetWarning getRowSetWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getShowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShowDeleted(boolean b) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void commit() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback(Savepoint s) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void populate(ResultSet rs, int startRow) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPageSize(int size) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getPageSize() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean nextPage() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previousPage() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUrl() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUrl(String url) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getDataSourceName() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDataSourceName(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUsername() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUsername(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getPassword() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPassword(String password) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getTransactionIsolation() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTransactionIsolation(int level) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Map<String, Class<?>> getTypeMap() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCommand() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCommand(String cmd) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isReadOnly() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setReadOnly(boolean value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxFieldSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxFieldSize(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxRows() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxRows(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getEscapeProcessing() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setEscapeProcessing(boolean enable) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getQueryTimeout() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setQueryTimeout(int seconds) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setType(int type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setConcurrency(int concurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int parameterIndex, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(String parameterName, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(int parameterIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(String parameterName, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(int parameterIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(String parameterName, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(int parameterIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(String parameterName, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(int parameterIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(String parameterName, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(int parameterIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(String parameterName, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(int parameterIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(String parameterName, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(int parameterIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(String parameterName, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(String parameterName, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRef(int i, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int i, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int i, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setArray(int i, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearParameters() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void removeRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(int parameterIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(String parameterName, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(int parameterIndex, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(String parameterName, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setURL(int parameterIndex, URL x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean next() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void close() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean wasNull() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLWarning getWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCursorName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSetMetaData getMetaData() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int findColumn(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isBeforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isAfterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void beforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void afterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean first() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean last() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean absolute(int row) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean relative(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previous() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchDirection(int direction) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchDirection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchSize(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getType() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getConcurrency() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowUpdated() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowInserted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(int columnIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(int columnIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(int columnIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(int columnIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(int columnIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(int columnIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(int columnIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(int columnIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(int columnIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(int columnIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(int columnIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(String columnLabel, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(String columnLabel, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(String columnLabel, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(String columnLabel, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(String columnLabel, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(String columnLabel, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(String columnLabel, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(String columnLabel, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(String columnLabel, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(String columnLabel, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(String columnLabel, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void insertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void deleteRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void refreshRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void cancelRowUpdates() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToInsertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToCurrentRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement getStatement() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(int columnIndex, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(String columnLabel, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(int columnIndex, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(String columnLabel, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(int columnIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(String columnLabel, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getHoldability() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isClosed() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(int columnIndex, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(String columnLabel, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String[] columnNames) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getMatchColumnIndexes() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String[] getMatchColumnNames() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String[] columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubNClob.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,29 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.sql.NClob;
++
++public class StubNClob extends StubClob implements NClob {
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubRef.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,60 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.Serializable;
++import java.sql.Ref;
++import java.sql.SQLException;
++import java.util.Map;
++
++public class StubRef implements Ref, Serializable {
++
++ private final String baseTypeName;
++ private Object obj;
++
++ public StubRef(String type, Object o) {
++ baseTypeName = type;
++ obj = o;
++ }
++
++ @Override
++ public String getBaseTypeName() throws SQLException {
++ return baseTypeName;
++ }
++
++ @Override
++ public Object getObject(Map<String, Class<?>> map) throws SQLException {
++ return obj;
++ }
++
++ @Override
++ public Object getObject() throws SQLException {
++ return getObject(null);
++ }
++
++ @Override
++ public void setObject(Object value) throws SQLException {
++ obj = value;
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubRowId.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,34 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.sql.RowId;
++
++public class StubRowId implements RowId {
++
++ @Override
++ public byte[] getBytes() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubRowSetFactory.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,60 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.sql.SQLException;
++import javax.sql.rowset.CachedRowSet;
++import javax.sql.rowset.FilteredRowSet;
++import javax.sql.rowset.JdbcRowSet;
++import javax.sql.rowset.JoinRowSet;
++import javax.sql.rowset.RowSetFactory;
++import javax.sql.rowset.WebRowSet;
++
++public class StubRowSetFactory implements RowSetFactory {
++
++ @Override
++ public CachedRowSet createCachedRowSet() throws SQLException {
++ return new StubCachedRowSetImpl();
++ }
++
++ @Override
++ public FilteredRowSet createFilteredRowSet() throws SQLException {
++ return new StubFilteredRowSetImpl();
++ }
++
++ @Override
++ public JdbcRowSet createJdbcRowSet() throws SQLException {
++ return new StubJdbcRowSetImpl();
++ }
++
++ @Override
++ public JoinRowSet createJoinRowSet() throws SQLException {
++ return new StubJoinRowSetImpl();
++ }
++
++ @Override
++ public WebRowSet createWebRowSet() throws SQLException {
++ return new StubWebRowSetImpl();
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubSQLXML.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,81 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.io.Reader;
++import java.io.Writer;
++import java.sql.SQLException;
++import java.sql.SQLXML;
++import javax.xml.transform.Result;
++import javax.xml.transform.Source;
++
++public class StubSQLXML implements SQLXML{
++
++ @Override
++ public void free() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public OutputStream setBinaryStream() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Writer setCharacterStream() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T extends Result> T setResult(Class<T> resultClass) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubStruct.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,55 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.sql.SQLException;
++import java.sql.Struct;
++import java.util.Arrays;
++import java.util.Map;
++
++public class StubStruct implements Struct {
++
++ private final String type;
++ private final Object[] attribs;
++
++ public StubStruct(String type, Object[] o) {
++ this.type = type;
++ this.attribs = Arrays.copyOf(o, o.length);
++ }
++
++ @Override
++ public String getSQLTypeName() throws SQLException {
++ return type;
++ }
++
++ @Override
++ public Object[] getAttributes() throws SQLException {
++ return attribs;
++ }
++
++ @Override
++ public Object[] getAttributes(Map<String, Class<?>> map) throws SQLException {
++ return attribs;
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubSyncProvider.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,92 @@
++/*
++ * Copyright (c) 2014, 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 util;
++
++import javax.sql.RowSetReader;
++import javax.sql.RowSetWriter;
++import javax.sql.rowset.spi.SyncProvider;
++import javax.sql.rowset.spi.SyncProviderException;
++
++public class StubSyncProvider extends SyncProvider {
++
++ /**
++ * The unique provider identifier.
++ */
++ private String providerID = "util.StubSyncProvider";
++
++ /**
++ * The vendor name of this SyncProvider implementation
++ */
++ private String vendorName = "Oracle Corporation";
++
++ /**
++ * The version number of this SyncProvider implementation
++ */
++ private String versionNumber = "1.0";
++
++ @Override
++ public String getProviderID() {
++ return providerID;
++ }
++
++ @Override
++ public RowSetReader getRowSetReader() {
++ return null;
++ }
++
++ @Override
++ public RowSetWriter getRowSetWriter() {
++ return null;
++ }
++
++ @Override
++ public int getProviderGrade() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDataSourceLock(int datasource_lock) throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getDataSourceLock() throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int supportsUpdatableView() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getVersion() {
++ return versionNumber;
++ }
++
++ @Override
++ public String getVendor() {
++ return vendorName;
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubSyncResolver.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1616 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.InputStream;
++import java.io.Reader;
++import java.io.Serializable;
++import java.math.BigDecimal;
++import java.net.URL;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Date;
++import java.sql.NClob;
++import java.sql.Ref;
++import java.sql.ResultSetMetaData;
++import java.sql.RowId;
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import java.sql.SQLXML;
++import java.sql.Statement;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.util.Calendar;
++import java.util.Map;
++import javax.sql.RowSetListener;
++import javax.sql.rowset.spi.SyncResolver;
++
++public class StubSyncResolver implements SyncResolver, Serializable {
++
++ @Override
++ public int getStatus() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getConflictValue(int index) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getConflictValue(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setResolvedValue(int index, Object obj) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setResolvedValue(String columnName, Object obj) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean nextConflict() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previousConflict() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUrl() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUrl(String url) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getDataSourceName() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDataSourceName(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUsername() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUsername(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getPassword() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPassword(String password) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getTransactionIsolation() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTransactionIsolation(int level) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Map<String, Class<?>> getTypeMap() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCommand() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCommand(String cmd) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isReadOnly() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setReadOnly(boolean value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxFieldSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxFieldSize(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxRows() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxRows(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getEscapeProcessing() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setEscapeProcessing(boolean enable) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getQueryTimeout() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setQueryTimeout(int seconds) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setType(int type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setConcurrency(int concurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int parameterIndex, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(String parameterName, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(int parameterIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(String parameterName, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(int parameterIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(String parameterName, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(int parameterIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(String parameterName, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(int parameterIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(String parameterName, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(int parameterIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(String parameterName, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(int parameterIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(String parameterName, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(int parameterIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(String parameterName, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(String parameterName, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRef(int i, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int i, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int i, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setArray(int i, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearParameters() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void removeRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(int parameterIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(String parameterName, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(int parameterIndex, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(String parameterName, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setURL(int parameterIndex, URL x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean next() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void close() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean wasNull() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLWarning getWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCursorName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSetMetaData getMetaData() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int findColumn(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isBeforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isAfterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void beforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void afterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean first() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean last() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean absolute(int row) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean relative(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previous() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchDirection(int direction) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchDirection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchSize(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getType() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getConcurrency() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowUpdated() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowInserted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(int columnIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(int columnIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(int columnIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(int columnIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(int columnIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(int columnIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(int columnIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(int columnIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(int columnIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(int columnIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(int columnIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(String columnLabel, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(String columnLabel, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(String columnLabel, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(String columnLabel, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(String columnLabel, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(String columnLabel, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(String columnLabel, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(String columnLabel, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(String columnLabel, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(String columnLabel, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(String columnLabel, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void insertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void deleteRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void refreshRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void cancelRowUpdates() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToInsertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToCurrentRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement getStatement() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(int columnIndex, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(String columnLabel, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(int columnIndex, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(String columnLabel, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(int columnIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(String columnLabel, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getHoldability() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isClosed() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(int columnIndex, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(String columnLabel, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/StubWebRowSetImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,1879 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.io.Reader;
++import java.io.Writer;
++import java.math.BigDecimal;
++import java.net.URL;
++import java.sql.Array;
++import java.sql.Blob;
++import java.sql.Clob;
++import java.sql.Connection;
++import java.sql.Date;
++import java.sql.NClob;
++import java.sql.Ref;
++import java.sql.ResultSet;
++import java.sql.ResultSetMetaData;
++import java.sql.RowId;
++import java.sql.SQLException;
++import java.sql.SQLWarning;
++import java.sql.SQLXML;
++import java.sql.Savepoint;
++import java.sql.Statement;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.util.Calendar;
++import java.util.Collection;
++import java.util.Map;
++import javax.sql.RowSet;
++import javax.sql.RowSetEvent;
++import javax.sql.RowSetListener;
++import javax.sql.RowSetMetaData;
++import javax.sql.rowset.CachedRowSet;
++import javax.sql.rowset.RowSetWarning;
++import javax.sql.rowset.WebRowSet;
++import javax.sql.rowset.spi.SyncProvider;
++import javax.sql.rowset.spi.SyncProviderException;
++
++public class StubWebRowSetImpl implements WebRowSet {
++
++ @Override
++ public void readXml(Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void readXml(InputStream iStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(ResultSet rs, Writer writer) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(ResultSet rs, OutputStream oStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(Writer writer) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void writeXml(OutputStream oStream) throws SQLException, IOException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void populate(ResultSet data) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute(Connection conn) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void acceptChanges() throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void acceptChanges(Connection con) throws SyncProviderException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void restoreOriginal() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void release() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoDelete() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoInsert() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void undoUpdate() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean columnUpdated(int idx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean columnUpdated(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection(int column) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Collection<?> toCollection(String column) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SyncProvider getSyncProvider() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSyncProvider(String provider) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int size() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMetaData(RowSetMetaData md) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getOriginal() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSet getOriginalRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setOriginalRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getTableName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTableName(String tabName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getKeyColumns() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setKeyColumns(int[] keys) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSet createShared() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopy() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopySchema() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public CachedRowSet createCopyNoConstraints() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowSetWarning getRowSetWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getShowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShowDeleted(boolean b) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void commit() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rollback(Savepoint s) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void populate(ResultSet rs, int startRow) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPageSize(int size) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getPageSize() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean nextPage() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previousPage() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUrl() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUrl(String url) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getDataSourceName() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDataSourceName(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getUsername() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setUsername(String name) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getPassword() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setPassword(String password) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getTransactionIsolation() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTransactionIsolation(int level) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Map<String, Class<?>> getTypeMap() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCommand() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCommand(String cmd) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isReadOnly() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setReadOnly(boolean value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxFieldSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxFieldSize(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getMaxRows() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMaxRows(int max) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getEscapeProcessing() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setEscapeProcessing(boolean enable) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getQueryTimeout() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setQueryTimeout(int seconds) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setType(int type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setConcurrency(int concurrency) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int parameterIndex, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBoolean(String parameterName, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(int parameterIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setByte(String parameterName, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(int parameterIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setShort(String parameterName, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(int parameterIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setInt(String parameterName, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(int parameterIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setLong(String parameterName, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(int parameterIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFloat(String parameterName, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(int parameterIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDouble(String parameterName, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(int parameterIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setString(String parameterName, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(int parameterIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBytes(String parameterName, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(String parameterName, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setObject(int parameterIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRef(int i, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int i, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int i, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setArray(int i, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearParameters() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void execute() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void addRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void removeRowSetListener(RowSetListener listener) {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(int parameterIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setRowId(String parameterName, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(int parameterIndex, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNString(String parameterName, String value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNCharacterStream(String parameterName, Reader value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(String parameterName, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, NClob value) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setNClob(int parameterIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setURL(int parameterIndex, URL x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean next() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void close() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean wasNull() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean getBoolean(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte getByte(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public short getShort(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getInt(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public long getLong(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public float getFloat(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public double getDouble(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public byte[] getBytes(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getAsciiStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getUnicodeStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public InputStream getBinaryStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLWarning getWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void clearWarnings() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getCursorName() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public ResultSetMetaData getMetaData() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int findColumn(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isBeforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isAfterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void beforeFirst() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void afterLast() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean first() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean last() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean absolute(int row) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean relative(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean previous() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchDirection(int direction) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchDirection() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setFetchSize(int rows) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getFetchSize() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getType() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getConcurrency() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowUpdated() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowInserted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean rowDeleted() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(int columnIndex, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(int columnIndex, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(int columnIndex, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(int columnIndex, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(int columnIndex, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(int columnIndex, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(int columnIndex, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(int columnIndex, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(int columnIndex, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(int columnIndex, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(int columnIndex, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(int columnIndex, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNull(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBoolean(String columnLabel, boolean x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateByte(String columnLabel, byte x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateShort(String columnLabel, short x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateInt(String columnLabel, int x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateLong(String columnLabel, long x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateFloat(String columnLabel, float x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDouble(String columnLabel, double x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateString(String columnLabel, String x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBytes(String columnLabel, byte[] x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateDate(String columnLabel, Date x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTime(String columnLabel, Time x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateObject(String columnLabel, Object x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void insertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void deleteRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void refreshRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void cancelRowUpdates() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToInsertRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void moveToCurrentRow() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Statement getStatement() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Ref getRef(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Blob getBlob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Clob getClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Array getArray(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Date getDate(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Time getTime(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public URL getURL(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(int columnIndex, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRef(String columnLabel, Ref x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, Blob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Clob x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(int columnIndex, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateArray(String columnLabel, Array x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public RowId getRowId(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(int columnIndex, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateRowId(String columnLabel, RowId x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int getHoldability() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isClosed() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(int columnIndex, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNString(String columnLabel, String nString) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public NClob getNClob(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public SQLXML getSQLXML(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String getNString(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(int columnIndex) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public Reader getNCharacterStream(String columnLabel) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(int columnIndex, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void updateNClob(String columnLabel, Reader reader) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void setMatchColumn(String[] columnNames) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public int[] getMatchColumnIndexes() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public String[] getMatchColumnNames() throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int columnIdx) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(int[] columnIdxes) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ @Override
++ public void unsetMatchColumn(String[] columnName) throws SQLException {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/SuperHero.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,110 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.io.Serializable;
++import java.sql.SQLData;
++import java.sql.SQLException;
++import java.sql.SQLInput;
++import java.sql.SQLOutput;
++
++public class SuperHero implements SQLData, Serializable {
++
++ private String first;
++ private String last;
++ private String type = "SUPERHERO";
++ private Integer firstYear;
++ private String secretIdentity;
++
++ public SuperHero() {
++
++ }
++
++ public SuperHero(String sqlType, String fname, String lname, Integer year,
++ String identity) {
++ first = fname;
++ last = lname;
++ type = sqlType;
++ firstYear = year;
++ secretIdentity = identity;
++ }
++
++ @Override
++ public String getSQLTypeName() throws SQLException {
++ return type;
++ }
++
++ @Override
++ public void readSQL(SQLInput stream, String typeName) throws SQLException {
++ first = stream.readString();
++ last = stream.readString();
++ firstYear = stream.readInt();
++ secretIdentity = stream.readString();
++ }
++
++ @Override
++ public void writeSQL(SQLOutput stream) throws SQLException {
++ stream.writeString(first);
++ stream.writeString(last);
++ stream.writeInt(firstYear);
++ stream.writeString(secretIdentity);
++ }
++
++ @Override
++ public String toString() {
++ return "[ name =" + first + " " + last + " "
++ + firstYear + " " + secretIdentity + " ]";
++ }
++
++ public void setIdentity(String identity) {
++ secretIdentity = identity;
++ }
++
++ public String getIdentity() {
++ return secretIdentity;
++ }
++
++ @Override
++ public boolean equals(Object obj) {
++ if (this == obj) {
++ return true;
++ }
++ if (obj instanceof SuperHero) {
++ SuperHero ss = (SuperHero) obj;
++ return first.equals(ss.first) && last.equals(ss.last)
++ && firstYear.equals(ss.firstYear)
++ && type.equals(ss.type)
++ && secretIdentity.equals(ss.secretIdentity);
++ }
++ return false;
++ }
++
++ @Override
++ public int hashCode() {
++ return ((31 + first.hashCode()) * 31) * 31
++ + ((31 + last.hashCode()) * 31) * 31
++ + ((31 + firstYear.hashCode()) * 31) * 31
++ + ((31 + type.hashCode()) * 31) * 31
++ + secretIdentity.hashCode();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/TestRowSetListener.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,64 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import javax.sql.RowSetEvent;
++import javax.sql.RowSetListener;
++
++public class TestRowSetListener implements RowSetListener {
++
++ // Flags to indicate which listener events should have been notified
++ public final static int ROWSET_CHANGED = 1;
++ public final static int ROW_CHANGED = 2;
++ public final static int CURSOR_MOVED = 4;
++ private int flag;
++
++ @Override
++ public void rowSetChanged(RowSetEvent event) {
++ flag |= ROWSET_CHANGED;
++ }
++
++ @Override
++ public void rowChanged(RowSetEvent event) {
++ flag |= ROW_CHANGED;
++ }
++
++ @Override
++ public void cursorMoved(RowSetEvent event) {
++ flag |= CURSOR_MOVED;
++ }
++
++ /*
++ * Clear the flag indicating which events we were notified for
++ */
++ public void resetFlag() {
++ flag = 0;
++ }
++
++ /*
++ * Method used to validate that the correct event was notified
++ */
++ public boolean isNotified( int val) {
++ return flag == val;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/util/TestSQLDataImpl.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,125 @@
++/*
++ * Copyright (c) 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.
++ */
++package util;
++
++import java.math.BigDecimal;
++import java.sql.Date;
++import java.sql.SQLData;
++import java.sql.SQLException;
++import java.sql.SQLInput;
++import java.sql.SQLOutput;
++import java.sql.Time;
++import java.sql.Timestamp;
++import java.time.LocalDate;
++import java.time.LocalDateTime;
++import java.time.LocalTime;
++import java.util.Arrays;
++
++public class TestSQLDataImpl implements SQLData {
++
++ private final int stringPos = 0;
++ private final int datePos = 1;
++ private final int timePos = 2;
++ private final int timestampPos = 3;
++ private final int intPos = 4;
++ private final int longPos = 5;
++ private final int shortPos = 6;
++ private final int bigDecimalPos = 7;
++ private final int doublePos = 8;
++ private final int booleanPos = 9;
++ private final int floatPos = 10;
++ private final int bytePos = 11;
++ private final int bytesPos = 12;
++ private final int MAX_TYPES = bytesPos + 1;
++ private final Object[] types = new Object[MAX_TYPES];
++
++ private final static byte[] b = {1, 2, 3};
++
++ // attributes entries must line up with the ordering of the reading and
++ // writing of the fields in readSQL and writeSQL
++ public final static Object[] attributes = {"The Dark Knight",
++ Date.valueOf(LocalDate.now()), Time.valueOf(LocalTime.now()),
++ Timestamp.valueOf(LocalDateTime.now()), Integer.MAX_VALUE,
++ Long.MAX_VALUE, Short.MIN_VALUE, BigDecimal.ONE,
++ Double.MAX_VALUE, true, 1.5f, Byte.MAX_VALUE, b};
++
++ private String sqlType;
++
++ public TestSQLDataImpl(String type) {
++ sqlType = type;
++ }
++
++ @Override
++ public String getSQLTypeName() throws SQLException {
++ return sqlType;
++ }
++
++ @Override
++ public void readSQL(SQLInput stream, String typeName) throws SQLException {
++
++ sqlType = typeName;
++ types[stringPos] = stream.readString();
++ types[datePos] = stream.readDate();
++ types[timePos] = stream.readTime();
++ types[timestampPos] = stream.readTimestamp();
++ types[intPos] = stream.readInt();
++ types[longPos] = stream.readLong();
++ types[shortPos] = stream.readShort();
++ types[bigDecimalPos] = stream.readBigDecimal();
++ types[doublePos] = stream.readDouble();
++ types[booleanPos] = stream.readBoolean();
++ types[floatPos] = stream.readFloat();
++ types[bytePos] = stream.readByte();
++ types[bytesPos] = stream.readBytes();
++ }
++
++ @Override
++ public void writeSQL(SQLOutput stream) throws SQLException {
++
++ stream.writeString((String) types[stringPos]);
++ stream.writeDate((Date) types[datePos]);
++ stream.writeTime((Time) types[timePos]);
++ stream.writeTimestamp((Timestamp) types[timestampPos]);
++ stream.writeInt((Integer) types[intPos]);
++ stream.writeLong((Long) types[longPos]);
++ stream.writeShort((Short) types[shortPos]);
++ stream.writeBigDecimal((BigDecimal) types[bigDecimalPos]);
++ stream.writeDouble((Double) types[doublePos]);
++ stream.writeBoolean((Boolean) types[booleanPos]);
++ stream.writeFloat((Float) types[floatPos]);
++ stream.writeByte((Byte) types[bytePos]);
++ stream.writeBytes((byte[]) types[bytesPos]);
++ }
++
++ public Object[] toArray() {
++
++ Object[] result = Arrays.copyOf(types, types.length);
++ return result;
++ }
++
++ @Override
++ public String toString() {
++ return "[" + sqlType + " " + types + "]";
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/xml/COFFEE_ROWS.xml Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,191 @@
++<?xml version="1.0"?>
++<webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
++ <properties>
++ <command><null/></command>
++ <concurrency>1008</concurrency>
++ <datasource><null/></datasource>
++ <escape-processing>true</escape-processing>
++ <fetch-direction>1000</fetch-direction>
++ <fetch-size>0</fetch-size>
++ <isolation-level>2</isolation-level>
++ <key-columns>
++ </key-columns>
++ <map>
++ </map>
++ <max-field-size>0</max-field-size>
++ <max-rows>0</max-rows>
++ <query-timeout>0</query-timeout>
++ <read-only>true</read-only>
++ <rowset-type>ResultSet.TYPE_SCROLL_INSENSITIVE</rowset-type>
++ <show-deleted>false</show-deleted>
++ <table-name>COFFEES</table-name>
++ <url><null/></url>
++ <sync-provider>
++ <sync-provider-name>com.sun.rowset.providers.RIOptimisticProvider</sync-provider-name>
++ <sync-provider-vendor>Oracle Corporation</sync-provider-vendor>
++ <sync-provider-version>1.0</sync-provider-version>
++ <sync-provider-grade>2</sync-provider-grade>
++ <data-source-lock>1</data-source-lock>
++ </sync-provider>
++ </properties>
++ <metadata>
++ <column-count>6</column-count>
++ <column-definition>
++ <column-index>1</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>COF_NAME</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>2</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SUP_ID</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>12</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>3</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>PRICE</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>4</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SALES</column-name>
++ <schema-name></schema-name>
++ <column-precision>10</column-precision>
++ <column-scale>2</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>2</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>5</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>TOTAL</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>6</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name><null/></column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ </metadata>
++ <data>
++ <currentRow>
++ <columnValue>1</columnValue>
++ <columnValue>Colombian</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>7.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>2</columnValue>
++ <columnValue>French_Roast</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>3</columnValue>
++ <columnValue>Espresso</columnValue>
++ <columnValue>150</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>4</columnValue>
++ <columnValue>Colombian_Decaf</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>5</columnValue>
++ <columnValue>French_Roast_Decaf</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ </data>
++</webRowSet>
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/xml/DELETED_COFFEE_ROWS.xml Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,191 @@
++<?xml version="1.0"?>
++<webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
++ <properties>
++ <command>SELECT * FROM COFFEES</command>
++ <concurrency>1008</concurrency>
++ <datasource><null/></datasource>
++ <escape-processing>true</escape-processing>
++ <fetch-direction>1000</fetch-direction>
++ <fetch-size>0</fetch-size>
++ <isolation-level>2</isolation-level>
++ <key-columns>
++ </key-columns>
++ <map>
++ </map>
++ <max-field-size>0</max-field-size>
++ <max-rows>0</max-rows>
++ <query-timeout>0</query-timeout>
++ <read-only>true</read-only>
++ <rowset-type>ResultSet.TYPE_SCROLL_INSENSITIVE</rowset-type>
++ <show-deleted>false</show-deleted>
++ <table-name>COFFEES</table-name>
++ <url>jdbc:derby://localhost:1527/testDB;create=true</url>
++ <sync-provider>
++ <sync-provider-name>com.sun.rowset.providers.RIOptimisticProvider</sync-provider-name>
++ <sync-provider-vendor>Oracle Corporation</sync-provider-vendor>
++ <sync-provider-version>1.0</sync-provider-version>
++ <sync-provider-grade>2</sync-provider-grade>
++ <data-source-lock>1</data-source-lock>
++ </sync-provider>
++ </properties>
++ <metadata>
++ <column-count>6</column-count>
++ <column-definition>
++ <column-index>1</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>COF_NAME</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>2</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SUP_ID</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>12</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>3</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>PRICE</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>4</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SALES</column-name>
++ <schema-name></schema-name>
++ <column-precision>10</column-precision>
++ <column-scale>2</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>2</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>5</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>TOTAL</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>6</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name><null/></column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ </metadata>
++ <data>
++ <currentRow>
++ <columnValue>1</columnValue>
++ <columnValue>Colombian</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>7.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <deleteRow>
++ <columnValue>2</columnValue>
++ <columnValue>French_Roast</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </deleteRow>
++ <currentRow>
++ <columnValue>3</columnValue>
++ <columnValue>Espresso</columnValue>
++ <columnValue>150</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <deleteRow>
++ <columnValue>4</columnValue>
++ <columnValue>Colombian_Decaf</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </deleteRow>
++ <currentRow>
++ <columnValue>5</columnValue>
++ <columnValue>French_Roast_Decaf</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ </data>
++</webRowSet>
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/xml/INSERTED_COFFEE_ROWS.xml Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,207 @@
++<?xml version="1.0"?>
++<webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
++ <properties>
++ <command><null/></command>
++ <concurrency>1008</concurrency>
++ <datasource><null/></datasource>
++ <escape-processing>true</escape-processing>
++ <fetch-direction>1000</fetch-direction>
++ <fetch-size>0</fetch-size>
++ <isolation-level>2</isolation-level>
++ <key-columns>
++ </key-columns>
++ <map>
++ </map>
++ <max-field-size>0</max-field-size>
++ <max-rows>0</max-rows>
++ <query-timeout>0</query-timeout>
++ <read-only>true</read-only>
++ <rowset-type>ResultSet.TYPE_SCROLL_INSENSITIVE</rowset-type>
++ <show-deleted>false</show-deleted>
++ <table-name>COFFEES</table-name>
++ <url><null/></url>
++ <sync-provider>
++ <sync-provider-name>com.sun.rowset.providers.RIOptimisticProvider</sync-provider-name>
++ <sync-provider-vendor>Oracle Corporation</sync-provider-vendor>
++ <sync-provider-version>1.0</sync-provider-version>
++ <sync-provider-grade>2</sync-provider-grade>
++ <data-source-lock>1</data-source-lock>
++ </sync-provider>
++ </properties>
++ <metadata>
++ <column-count>6</column-count>
++ <column-definition>
++ <column-index>1</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>COF_NAME</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>2</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SUP_ID</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>12</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>3</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>PRICE</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>4</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SALES</column-name>
++ <schema-name></schema-name>
++ <column-precision>10</column-precision>
++ <column-scale>2</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>2</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>5</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>TOTAL</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>6</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name><null/></column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ </metadata>
++ <data>
++ <currentRow>
++ <columnValue>1</columnValue>
++ <columnValue>Colombian</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>7.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>2</columnValue>
++ <columnValue>French_Roast</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>3</columnValue>
++ <columnValue>Espresso</columnValue>
++ <columnValue>150</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>4</columnValue>
++ <columnValue>Colombian_Decaf</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <insertRow>
++ <columnValue>15</columnValue>
++ <columnValue>Hazelnut</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <insertRow>
++ <columnValue>20</columnValue>
++ <columnValue>French Vanilla</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <currentRow>
++ <columnValue>5</columnValue>
++ <columnValue>French_Roast_Decaf</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ </data>
++</webRowSet>
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/xml/MODFIED_DELETED_COFFEE_ROWS.xml Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,191 @@
++<?xml version="1.0"?>
++<webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
++ <properties>
++ <command><null/></command>
++ <concurrency>1008</concurrency>
++ <datasource><null/></datasource>
++ <escape-processing>true</escape-processing>
++ <fetch-direction>1000</fetch-direction>
++ <fetch-size>0</fetch-size>
++ <isolation-level>2</isolation-level>
++ <key-columns>
++ </key-columns>
++ <map>
++ </map>
++ <max-field-size>0</max-field-size>
++ <max-rows>0</max-rows>
++ <query-timeout>0</query-timeout>
++ <read-only>true</read-only>
++ <rowset-type>ResultSet.TYPE_SCROLL_INSENSITIVE</rowset-type>
++ <show-deleted>false</show-deleted>
++ <table-name>COFFEES</table-name>
++ <url><null/></url>
++ <sync-provider>
++ <sync-provider-name>com.sun.rowset.providers.RIOptimisticProvider</sync-provider-name>
++ <sync-provider-vendor>Oracle Corporation</sync-provider-vendor>
++ <sync-provider-version>1.0</sync-provider-version>
++ <sync-provider-grade>2</sync-provider-grade>
++ <data-source-lock>1</data-source-lock>
++ </sync-provider>
++ </properties>
++ <metadata>
++ <column-count>6</column-count>
++ <column-definition>
++ <column-index>1</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>COF_NAME</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>2</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SUP_ID</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>12</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>3</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>PRICE</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>4</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SALES</column-name>
++ <schema-name></schema-name>
++ <column-precision>10</column-precision>
++ <column-scale>2</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>2</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>5</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>TOTAL</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>6</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name><null/></column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ </metadata>
++ <data>
++ <insertRow>
++ <columnValue>1</columnValue>
++ <columnValue>Colombian</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>7.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <modifyRow>
++ <columnValue>2</columnValue>
++ <columnValue>French_Roast</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </modifyRow>
++ <insertRow>
++ <columnValue>3</columnValue>
++ <columnValue>Espresso</columnValue>
++ <columnValue>150</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <modifyRow>
++ <columnValue>4</columnValue>
++ <columnValue>Colombian_Decaf</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </modifyRow>
++ <insertRow>
++ <columnValue>5</columnValue>
++ <columnValue>French_Roast_Decaf</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ </data>
++</webRowSet>
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/xml/UPDATED_COFFEE_ROWS.xml Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,193 @@
++<?xml version="1.0"?>
++<webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
++ <properties>
++ <command>SELECT * FROM COFFEES</command>
++ <concurrency>1008</concurrency>
++ <datasource><null/></datasource>
++ <escape-processing>true</escape-processing>
++ <fetch-direction>1000</fetch-direction>
++ <fetch-size>0</fetch-size>
++ <isolation-level>2</isolation-level>
++ <key-columns>
++ </key-columns>
++ <map>
++ </map>
++ <max-field-size>0</max-field-size>
++ <max-rows>0</max-rows>
++ <query-timeout>0</query-timeout>
++ <read-only>true</read-only>
++ <rowset-type>ResultSet.TYPE_SCROLL_INSENSITIVE</rowset-type>
++ <show-deleted>false</show-deleted>
++ <table-name>COFFEES</table-name>
++ <url>jdbc:derby://localhost:1527/testDB;create=true</url>
++ <sync-provider>
++ <sync-provider-name>com.sun.rowset.providers.RIOptimisticProvider</sync-provider-name>
++ <sync-provider-vendor>Oracle Corporation</sync-provider-vendor>
++ <sync-provider-version>1.0</sync-provider-version>
++ <sync-provider-grade>2</sync-provider-grade>
++ <data-source-lock>1</data-source-lock>
++ </sync-provider>
++ </properties>
++ <metadata>
++ <column-count>6</column-count>
++ <column-definition>
++ <column-index>1</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>COF_NAME</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>2</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SUP_ID</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>12</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>3</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>PRICE</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>4</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SALES</column-name>
++ <schema-name></schema-name>
++ <column-precision>10</column-precision>
++ <column-scale>2</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>2</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>5</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>TOTAL</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>6</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name><null/></column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ </metadata>
++ <data>
++ <currentRow>
++ <columnValue>1</columnValue>
++ <columnValue>Colombian</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>7.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>2</columnValue>
++ <columnValue>French_Roast</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>3</columnValue>
++ <columnValue>Espresso</columnValue>
++ <columnValue>150</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <updateRow>21</updateRow>
++ <columnValue>0</columnValue>
++ <updateRow>69</updateRow>
++ </currentRow>
++ <currentRow>
++ <columnValue>4</columnValue>
++ <columnValue>Colombian_Decaf</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ <currentRow>
++ <columnValue>5</columnValue>
++ <columnValue>French_Roast_Decaf</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </currentRow>
++ </data>
++</webRowSet>
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/sql/testng/xml/UPDATED_INSERTED_COFFEE_ROWS.xml Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,201 @@
++<?xml version="1.0"?>
++<webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
++ <properties>
++ <command><null/></command>
++ <concurrency>1008</concurrency>
++ <datasource><null/></datasource>
++ <escape-processing>true</escape-processing>
++ <fetch-direction>1000</fetch-direction>
++ <fetch-size>0</fetch-size>
++ <isolation-level>2</isolation-level>
++ <key-columns>
++ </key-columns>
++ <map>
++ </map>
++ <max-field-size>0</max-field-size>
++ <max-rows>0</max-rows>
++ <query-timeout>0</query-timeout>
++ <read-only>true</read-only>
++ <rowset-type>ResultSet.TYPE_SCROLL_INSENSITIVE</rowset-type>
++ <show-deleted>false</show-deleted>
++ <table-name>COFFEES</table-name>
++ <url><null/></url>
++ <sync-provider>
++ <sync-provider-name>com.sun.rowset.providers.RIOptimisticProvider</sync-provider-name>
++ <sync-provider-vendor>Oracle Corporation</sync-provider-vendor>
++ <sync-provider-version>1.0</sync-provider-version>
++ <sync-provider-grade>2</sync-provider-grade>
++ <data-source-lock>1</data-source-lock>
++ </sync-provider>
++ </properties>
++ <metadata>
++ <column-count>6</column-count>
++ <column-definition>
++ <column-index>1</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>COF_NAME</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>2</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SUP_ID</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>12</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>3</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>PRICE</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>4</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>SALES</column-name>
++ <schema-name></schema-name>
++ <column-precision>10</column-precision>
++ <column-scale>2</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>2</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>5</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name>TOTAL</column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ <column-definition>
++ <column-index>6</column-index>
++ <auto-increment>false</auto-increment>
++ <case-sensitive>false</case-sensitive>
++ <currency>false</currency>
++ <nullable>0</nullable>
++ <signed>false</signed>
++ <searchable>false</searchable>
++ <column-display-size>0</column-display-size>
++ <column-label><null/></column-label>
++ <column-name><null/></column-name>
++ <schema-name></schema-name>
++ <column-precision>0</column-precision>
++ <column-scale>0</column-scale>
++ <table-name></table-name>
++ <catalog-name></catalog-name>
++ <column-type>4</column-type>
++ <column-type-name><null/></column-type-name>
++ </column-definition>
++ </metadata>
++ <data>
++ <insertRow>
++ <columnValue>1</columnValue>
++ <columnValue>Colombian</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>7.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <insertRow>
++ <columnValue>2</columnValue>
++ <columnValue>French_Roast</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <insertRow>
++ <columnValue>3</columnValue>
++ <columnValue>Espresso</columnValue>
++ <columnValue>150</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <insertRow>
++ <columnValue>4</columnValue>
++ <columnValue>Colombian_Decaf</columnValue>
++ <columnValue>101</columnValue>
++ <columnValue>8.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <insertRow>
++ <columnValue>5</columnValue>
++ <columnValue>French_Roast_Decaf</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>9.99</columnValue>
++ <columnValue>0</columnValue>
++ <columnValue>0</columnValue>
++ </insertRow>
++ <insertRow>
++ <columnValue>100</columnValue>
++ <columnValue>Mocha</columnValue>
++ <columnValue>49</columnValue>
++ <columnValue>9.99</columnValue>
++ <updateRow>12.99</updateRow>
++ <columnValue>20</columnValue>
++ <columnValue>35</columnValue>
++ <updateRow>125</updateRow>
++ </insertRow>
++ </data>
++</webRowSet>
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/AbstractButton/AnimatedIcon/AnimatedIcon.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,76 @@
++/*
++ * 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.image.BufferedImage;
++import java.awt.image.ImageObserver;
++
++import javax.swing.ImageIcon;
++import javax.swing.JButton;
++import javax.swing.SwingUtilities;
++
++import static java.awt.image.BufferedImage.TYPE_INT_RGB;
++
++/**
++ * @test
++ * @bug 6573305
++ * @summary Animated icon should animate when the JButton is pressed.
++ * @author Sergey Bylokhov
++ */
++public final class AnimatedIcon {
++
++ public static void main(final String[] args) throws Exception {
++ SwingUtilities.invokeAndWait(() -> {
++ final BufferedImage bi = new BufferedImage(1, 1, TYPE_INT_RGB);
++ final ImageIcon icon = new ImageIcon(bi);
++ final JButton button = new JButton(icon);
++ // Default icon is set => imageUpdate should return true for it
++ isAnimated(bi, button);
++ button.getModel().setPressed(true);
++ button.getModel().setArmed(true);
++ isAnimated(bi, button);
++ button.getModel().setPressed(false);
++ button.getModel().setArmed(false);
++ button.getModel().setSelected(true);
++ isAnimated(bi, button);
++ button.getModel().setSelected(false);
++ button.getModel().setRollover(true);
++ button.setRolloverEnabled(true);
++ isAnimated(bi, button);
++ button.getModel().setSelected(true);
++ isAnimated(bi, button);
++ // Default icon is not set => imageUpdate should return true for
++ // other icons if any
++ button.setIcon(null);
++ button.setPressedIcon(icon);
++ button.getModel().setPressed(true);
++ button.getModel().setArmed(true);
++ isAnimated(bi, button);
++ });
++ }
++
++ private static void isAnimated(BufferedImage bi, JButton button) {
++ if (!button.imageUpdate(bi, ImageObserver.SOMEBITS, 0, 0, 1, 1)) {
++ throw new RuntimeException();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JComboBox/8033069/bug8033069NoScrollBar.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,182 @@
++/*
++ * 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.AWTException;
++import java.awt.Dimension;
++import java.awt.GridLayout;
++import java.awt.Point;
++import java.awt.Robot;
++import java.awt.event.InputEvent;
++import javax.swing.JComboBox;
++import javax.swing.JFrame;
++import javax.swing.JPanel;
++import javax.swing.SwingUtilities;
++import javax.swing.UIManager;
++import javax.swing.UIManager.LookAndFeelInfo;
++import javax.swing.UnsupportedLookAndFeelException;
++
++/* @test
++ * @bug 8033069
++ * @summary Checks that JComboBox popup does not close when mouse wheel is
++ * rotated over combo box and over its popup. The case where popup
++ * has no scroll bar.
++ * @library ../../regtesthelpers
++ * @build Util
++ * @run main bug8033069NoScrollBar
++ * @author Alexey Ivanov
++ */
++public class bug8033069NoScrollBar implements Runnable {
++
++ private static final String[] NO_SCROLL_ITEMS = new String[] {
++ "A", "B", "C", "D", "E", "F"
++ };
++
++ private final Robot robot;
++
++ private final String[] items;
++
++ private JFrame frame;
++ private JComboBox cb1;
++ private JComboBox cb2;
++
++ public static void main(String[] args) throws Exception {
++ iterateLookAndFeels(new bug8033069NoScrollBar(NO_SCROLL_ITEMS));
++ }
++
++ protected static void iterateLookAndFeels(final bug8033069NoScrollBar test) throws Exception {
++ LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
++ for (LookAndFeelInfo info : lafInfo) {
++ try {
++ UIManager.setLookAndFeel(info.getClassName());
++ System.out.println("Look and Feel: " + info.getClassName());
++ test.runTest();
++ } catch (UnsupportedLookAndFeelException e) {
++ System.out.println("Skipping unsupported LaF: " + info);
++ }
++ }
++ }
++
++ public bug8033069NoScrollBar(String[] items) throws AWTException {
++ this.items = items;
++
++ robot = new Robot();
++ robot.setAutoDelay(200);
++ }
++
++ private void setupUI() {
++ frame = new JFrame();
++ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
++
++ cb1 = new JComboBox<>(items);
++ cb2 = new JComboBox<>(items);
++ JPanel panel = new JPanel(new GridLayout(1, 2));
++ panel.add(cb1);
++ panel.add(cb2);
++
++ frame.add(panel);
++
++ frame.pack();
++ frame.setVisible(true);
++ }
++
++ public void runTest() throws Exception {
++ try {
++ SwingUtilities.invokeAndWait(this);
++
++ robot.waitForIdle();
++ assertFalse("cb1 popup is visible",
++ Util.invokeOnEDT(cb1::isPopupVisible));
++
++ // Move mouse pointer to the center of the fist combo box
++ Point p = cb1.getLocationOnScreen();
++ Dimension d = cb1.getSize();
++ robot.mouseMove(p.x + d.width / 2, p.y + d.height / 2);
++ // Click it to open popup
++ robot.mousePress(InputEvent.BUTTON1_MASK);
++ robot.mouseRelease(InputEvent.BUTTON1_MASK);
++
++ robot.waitForIdle();
++ assertTrue("cb1 popup is not visible",
++ Util.invokeOnEDT(cb1::isPopupVisible));
++
++ robot.mouseWheel(1);
++ robot.waitForIdle();
++ assertTrue("cb1 popup is not visible after mouse wheel up on combo box",
++ Util.invokeOnEDT(cb1::isPopupVisible));
++
++ robot.mouseWheel(-1);
++ robot.waitForIdle();
++ assertTrue("cb1 popup is not visible after mouse wheel down on combo box",
++ Util.invokeOnEDT(cb1::isPopupVisible));
++
++ // Move mouse down on the popup
++ robot.mouseMove(p.x + d.width / 2, p.y + d.height * 3);
++
++ robot.mouseWheel(1);
++ robot.waitForIdle();
++ assertTrue("cb1 popup is not visible after mouse wheel up on popup",
++ Util.invokeOnEDT(cb1::isPopupVisible));
++
++ robot.mouseWheel(-1);
++ robot.waitForIdle();
++ assertTrue("cb1 popup is not visible after mouse wheel down on popup",
++ Util.invokeOnEDT(cb1::isPopupVisible));
++
++
++ // Move mouse pointer to the center of the second combo box
++ p = cb2.getLocationOnScreen();
++ d = cb2.getSize();
++ robot.mouseMove(p.x + d.width / 2, p.y + d.height / 2);
++
++ robot.mouseWheel(1);
++ robot.waitForIdle();
++ assertFalse("cb1 popup is visible after mouse wheel up on cb2",
++ Util.invokeOnEDT(cb1::isPopupVisible));
++ } finally {
++ if (frame != null) {
++ frame.dispose();
++ }
++ }
++
++ System.out.println("Test passed");
++ }
++
++ @Override
++ public void run() {
++ setupUI();
++ }
++
++ private static void assertTrue(String message, boolean value) {
++ assertEquals(message, true, value);
++ }
++
++ private static void assertFalse(String message, boolean value) {
++ assertEquals(message, false, value);
++ }
++
++ private static void assertEquals(String message, boolean expected, boolean actual) {
++ if (expected != actual) {
++ throw new RuntimeException(message);
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JComboBox/8033069/bug8033069ScrollBar.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,52 @@
++/*
++ * 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.AWTException;
++
++/* @test
++ * @bug 8033069
++ * @summary Checks that JComboBox popup does not close when mouse wheel is
++ * rotated over combo box and over its popup. The case where
++ * popup has scroll bar.
++ * @library ../../regtesthelpers
++ * @build Util
++ * @run main bug8033069ScrollBar
++ * @author Alexey Ivanov
++ */
++public class bug8033069ScrollBar extends bug8033069NoScrollBar {
++
++ private static final String[] SCROLL_ITEMS = new String[] {
++ "A", "B", "C", "D", "E", "F",
++ "G", "H", "I", "J", "K", "L",
++ "M", "N", "O", "P", "Q", "R"
++ };
++
++ public static void main(String[] args) throws Exception {
++ iterateLookAndFeels(new bug8033069ScrollBar(SCROLL_ITEMS));
++ }
++
++ public bug8033069ScrollBar(String[] items) throws AWTException {
++ super(items);
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JFileChooser/8080628/bug8080628.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,100 @@
++/*
++ * 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.Locale;
++import javax.swing.SwingUtilities;
++import javax.swing.UIManager;
++import javax.swing.UIManager.LookAndFeelInfo;
++
++import sun.swing.SwingUtilities2;
++
++/*
++ * @test
++ * @bug 8080628
++ * @summary No mnemonics on Open and Save buttons in JFileChooser.
++ * @author Alexey Ivanov
++ * @run main bug8080628
++ */
++public class bug8080628 {
++ public static final String[] MNEMONIC_KEYS = new String[] {
++ "FileChooser.saveButtonMnemonic",
++ "FileChooser.openButtonMnemonic",
++ "FileChooser.cancelButtonMnemonic",
++ "FileChooser.directoryOpenButtonMnemonic"
++ };
++
++ public static final Locale[] LOCALES = new Locale[] {
++ new Locale("en"),
++ new Locale("de"),
++ new Locale("es"),
++ new Locale("fr"),
++ new Locale("it"),
++ new Locale("ja"),
++ new Locale("ko"),
++ new Locale("pt", "BR"),
++ new Locale("sv"),
++ new Locale("zh", "CN"),
++ new Locale("zh", "TW")
++ };
++
++ private static volatile Exception exception;
++
++ public static void main(String[] args) throws Exception {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ @Override
++ public void run() {
++ runTest();
++ }
++ });
++
++ if (exception != null) {
++ throw exception;
++ }
++ }
++
++ private static void runTest() {
++ try {
++ LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
++ for (LookAndFeelInfo info : lafInfo) {
++ UIManager.setLookAndFeel(info.getClassName());
++
++ for (Locale locale : LOCALES) {
++ for (String key : MNEMONIC_KEYS) {
++ int mnemonic = SwingUtilities2.getUIDefaultsInt(key, locale);
++ if (mnemonic != 0) {
++ throw new RuntimeException("No mnemonic expected (" + mnemonic + ") " +
++ "for '" + key + "' " +
++ "in locale '" + locale + "' " +
++ "in Look-and-Feel '"
++ + UIManager.getLookAndFeel().getClass().getName() + "'");
++ }
++ }
++ }
++ }
++ System.out.println("Test passed");
++ } catch (Exception e) {
++ exception = e;
++ }
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JMenu/8071705/bug8071705.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,207 @@
++/*
++ * 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 8071705
++ * @summary Java application menu misbehaves when running multiple screen stacked vertically
++ * @build bug8071705
++ * @run main/othervm bug8071705
++ */
++
++import java.awt.Dimension;
++import java.awt.GraphicsConfiguration;
++import java.awt.GraphicsDevice;
++import java.awt.GraphicsEnvironment;
++import java.awt.Point;
++import java.awt.Rectangle;
++import java.awt.Toolkit;
++import java.awt.event.ComponentAdapter;
++import java.awt.event.ComponentEvent;
++import java.awt.event.KeyEvent;
++import java.util.concurrent.CountDownLatch;
++
++import javax.swing.JFrame;
++import javax.swing.JMenu;
++import javax.swing.JMenuBar;
++import javax.swing.JMenuItem;
++import javax.swing.JPopupMenu;
++import javax.swing.SwingUtilities;
++import javax.swing.UIManager;
++
++public class bug8071705 {
++
++ public static void main(String[] args) throws Exception {
++
++ final CountDownLatch latch = new CountDownLatch(1);
++ final boolean [] result = new boolean[1];
++
++ SwingUtilities.invokeLater(new Runnable() {
++ @Override
++ public void run() {
++ JFrame frame = createGUI();
++ GraphicsDevice[] devices = checkScreens();
++
++ // check if we have more than one and if they are stacked
++ // vertically
++ GraphicsDevice device = checkConfigs(devices);
++ if (device == null) {
++ // just pass the test
++ frame.dispose();
++ result[0] = true;
++ latch.countDown();
++ } else {
++ FrameListener listener =
++ new FrameListener(device, latch, result);
++ frame.addComponentListener(listener);
++ frame.setVisible(true);
++ }
++ }
++ });
++
++ latch.await();
++
++ if (result[0] == false) {
++ throw new RuntimeException("popup menu rendered in wrong position");
++ }
++
++ System.out.println("OK");
++ }
++
++ private static GraphicsDevice[] checkScreens() {
++ GraphicsEnvironment ge =
++ GraphicsEnvironment.getLocalGraphicsEnvironment();
++ return ge.getScreenDevices();
++ }
++
++ private static JFrame createGUI() {
++ JMenuBar menuBar = new JMenuBar();
++ JMenu menu = new JMenu("Some menu");
++ menuBar.add(menu);
++
++ for (int i = 0; i < 10; i++) {
++ menu.add(new JMenuItem("Some menu #" + i));
++ }
++
++ JFrame frame = new JFrame();
++ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
++ frame.setMinimumSize(new Dimension(200, 200));
++ frame.setJMenuBar(menuBar);
++ return frame;
++ }
++
++ private static GraphicsDevice checkConfigs(GraphicsDevice[] devices) {
++
++ GraphicsDevice correctDevice = null;
++ if (devices.length < 2) {
++ return correctDevice;
++ }
++
++ Toolkit toolkit = Toolkit.getDefaultToolkit();
++ Rectangle screenBounds = new Rectangle(toolkit.getScreenSize());
++ int halfScreen = screenBounds.height/2;
++
++ for(int i = 0; i < devices.length; i++) {
++ if(devices[i].getType() == GraphicsDevice.TYPE_RASTER_SCREEN) {
++ GraphicsConfiguration conf =
++ devices[i].getDefaultConfiguration();
++ Rectangle bounds = conf.getBounds();
++ if (bounds.y >= halfScreen) {
++ // found
++ correctDevice = devices[i];
++ break;
++ }
++ }
++ }
++ return correctDevice;
++ }
++
++ private static class FrameListener extends ComponentAdapter {
++
++ private GraphicsDevice device;
++ private CountDownLatch latch;
++ private boolean [] result;
++ public FrameListener(GraphicsDevice device,
++ CountDownLatch latch,
++ boolean [] result)
++ {
++ this.device = device;
++ this.latch = latch;
++ this.result = result;
++ }
++
++ @Override
++ public void componentShown(ComponentEvent e) {
++ JFrame frame = (JFrame) e.getComponent();
++
++ runActualTest(device, latch, frame, result);
++
++ frame.setVisible(false);
++ frame.dispose();
++ latch.countDown();
++ }
++ }
++
++ private static Rectangle setLocation(JFrame frame, GraphicsDevice device) {
++ GraphicsConfiguration conf = device.getDefaultConfiguration();
++ Rectangle bounds = conf.getBounds();
++
++ // put just below half screen
++ int x = bounds.x + bounds.width/2;
++ int y = bounds.y + bounds.height/2;
++ frame.setLocation(x, y);
++
++ return bounds;
++ }
++
++ private static void runActualTest(GraphicsDevice device,
++ CountDownLatch latch,
++ JFrame frame,
++ boolean [] result)
++ {
++ Rectangle screenBounds = setLocation(frame, device);
++ JMenu menu = frame.getJMenuBar().getMenu(0);
++ menu.doClick();
++
++ Point location = menu.getLocationOnScreen();
++ JPopupMenu pm = menu.getPopupMenu();
++ Dimension pmSize = pm.getSize();
++
++ int yOffset = UIManager.getInt("Menu.submenuPopupOffsetY");
++ int height = location.y + yOffset + pmSize.height + menu.getHeight();
++ int available = screenBounds.y + screenBounds.height - height;
++ if (available > 0) {
++ Point origin = pm.getLocationOnScreen();
++ if (origin.y < location.y) {
++ // growing upward, wrong!
++ result[0] = false;
++ } else {
++ // growing downward, ok!
++ result[0] = true;
++ }
++ } else {
++ // there is no space, growing upward would be ok, so we pass
++ result[0] = true;
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JMenu/8072900/WrongSelectionOnMouseOver.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,198 @@
++/*
++ * 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 8072900
++@summary Mouse events are captured by the wrong menu in OS X
++@author Anton Nashatyrev
++@run main WrongSelectionOnMouseOver
++*/
++
++import javax.swing.*;
++import javax.swing.event.MenuEvent;
++import javax.swing.event.MenuListener;
++import java.awt.*;
++import java.awt.event.MouseAdapter;
++import java.awt.event.MouseEvent;
++import java.util.concurrent.CountDownLatch;
++import java.util.concurrent.TimeUnit;
++
++import static javax.swing.UIManager.getInstalledLookAndFeels;
++
++public class WrongSelectionOnMouseOver implements Runnable {
++
++ CountDownLatch firstMenuSelected = new CountDownLatch(1);
++ CountDownLatch secondMenuMouseEntered = new CountDownLatch(1);
++ CountDownLatch secondMenuSelected = new CountDownLatch(1);
++
++ JMenu m1, m2;
++
++ private UIManager.LookAndFeelInfo laf;
++ JFrame frame1;
++ JFrame frame2;
++
++ public WrongSelectionOnMouseOver(UIManager.LookAndFeelInfo laf) throws Exception {
++ this.laf = laf;
++ }
++
++ private void createUI() throws Exception {
++ System.out.println("Testing UI: " + laf);
++ UIManager.setLookAndFeel(laf.getClassName());
++
++ {
++ frame1 = new JFrame("Frame1");
++ JMenuBar mb = new JMenuBar();
++ m1 = new JMenu("File");
++ JMenuItem i1 = new JMenuItem("Save");
++ JMenuItem i2 = new JMenuItem("Load");
++
++ m1.addMenuListener(new MenuListener() {
++ @Override
++ public void menuSelected(MenuEvent e) {
++ firstMenuSelected.countDown();
++ System.out.println("Menu1: menuSelected");
++ }
++
++ @Override
++ public void menuDeselected(MenuEvent e) {
++ System.out.println("Menu1: menuDeselected");
++ }
++
++ @Override
++ public void menuCanceled(MenuEvent e) {
++ System.out.println("Menu1: menuCanceled");
++ }
++ });
++
++ frame1.setJMenuBar(mb);
++ mb.add(m1);
++ m1.add(i1);
++ m1.add(i2);
++
++ frame1.setLayout(new FlowLayout());
++ frame1.setBounds(200, 200, 200, 200);
++
++ frame1.setVisible(true);
++ }
++
++ {
++ frame2 = new JFrame("Frame2");
++ JMenuBar mb = new JMenuBar();
++ m2 = new JMenu("File");
++ JMenuItem i1 = new JMenuItem("Save");
++ JMenuItem i2 = new JMenuItem("Load");
++
++ m2.addMouseListener(new MouseAdapter() {
++ @Override
++ public void mouseEntered(MouseEvent e) {
++ secondMenuMouseEntered.countDown();
++ System.out.println("WrongSelectionOnMouseOver.mouseEntered");
++ }
++ });
++
++ m2.addMenuListener(new MenuListener() {
++ @Override
++ public void menuSelected(MenuEvent e) {
++ secondMenuSelected.countDown();
++ System.out.println("Menu2: menuSelected");
++ }
++
++ @Override
++ public void menuDeselected(MenuEvent e) {
++ System.out.println("Menu2: menuDeselected");
++ }
++
++ @Override
++ public void menuCanceled(MenuEvent e) {
++ System.out.println("Menu2: menuCanceled");
++ }
++ });
++
++ frame2.setJMenuBar(mb);
++ mb.add(m2);
++ m2.add(i1);
++ m2.add(i2);
++
++ frame2.setLayout(new FlowLayout());
++ frame2.setBounds(400, 200, 200, 200);
++
++ frame2.setVisible(true);
++ }
++ }
++
++ public void disposeUI() {
++ frame1.dispose();
++ frame2.dispose();
++ }
++
++ @Override
++ public void run() {
++ try {
++ if (frame1 == null) {
++ createUI();
++ } else {
++ disposeUI();
++ }
++ } catch (Exception e) {
++ throw new RuntimeException(e);
++ }
++ }
++
++ public void test() throws Exception {
++ Robot robot = new Robot();
++ robot.setAutoDelay(100);
++
++ robot.waitForIdle();
++
++ robot.mouseMove((int) m1.getLocationOnScreen().getX() + 5,
++ (int) m1.getLocationOnScreen().getY() + 5);
++ robot.mousePress(MouseEvent.BUTTON1_MASK);
++ robot.mouseRelease(MouseEvent.BUTTON1_MASK);
++
++ if (!firstMenuSelected.await(5, TimeUnit.SECONDS)) {
++ throw new RuntimeException("Menu has not been selected.");
++ };
++
++ robot.mouseMove((int) m2.getLocationOnScreen().getX() + 5,
++ (int) m2.getLocationOnScreen().getY() + 5);
++
++ if (!secondMenuMouseEntered.await(5, TimeUnit.SECONDS)) {
++ throw new RuntimeException("MouseEntered event missed for the second menu");
++ };
++
++ if (secondMenuSelected.await(1, TimeUnit.SECONDS)) {
++ throw new RuntimeException("The second menu has been selected");
++ };
++ }
++
++ public static void main(final String[] args) throws Exception {
++ for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) {
++ WrongSelectionOnMouseOver test = new WrongSelectionOnMouseOver(laf);
++ SwingUtilities.invokeAndWait(test);
++ test.test();
++ SwingUtilities.invokeAndWait(test);
++ }
++ System.out.println("Test passed");
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JMenuBar/MisplacedBorder/MisplacedBorder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,135 @@
++/*
++ * 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.Color;
++import java.awt.Graphics2D;
++import java.awt.image.BufferedImage;
++import java.io.File;
++import java.io.IOException;
++
++import javax.imageio.ImageIO;
++import javax.swing.JFrame;
++import javax.swing.JMenu;
++import javax.swing.JMenuBar;
++import javax.swing.SwingUtilities;
++import javax.swing.UIManager;
++import javax.swing.UnsupportedLookAndFeelException;
++
++import static java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE;
++import static javax.swing.UIManager.getInstalledLookAndFeels;
++
++/**
++ * @test
++ * @bug 8073795
++ * @summary JMenuBar has incorrect border when the window is on retina display.
++ * @author Sergey Bylokhov
++ * @run main/othervm MisplacedBorder
++ * @run main/othervm -Dswing.metalTheme=steel MisplacedBorder
++ */
++public final class MisplacedBorder implements Runnable {
++
++ public static final int W = 400;
++ public static final int H = 400;
++
++ public static void main(final String[] args) throws Exception {
++ for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) {
++ SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
++ SwingUtilities.invokeAndWait(new MisplacedBorder());
++ }
++ System.out.println("Test passed");
++ }
++
++ @Override
++ public void run() {
++ final JMenuBar menubar = new JMenuBar();
++ menubar.add(new JMenu(""));
++ menubar.add(new JMenu(""));
++ final JFrame frame = new JFrame();
++ frame.setUndecorated(true);
++ frame.setJMenuBar(menubar);
++ frame.setSize(W / 3, H / 3);
++ frame.setLocationRelativeTo(null);
++ frame.setVisible(true);
++
++ // draw menu bar using standard order.
++ final BufferedImage bi1 = step1(menubar);
++
++ // draw menu border on top of the menu bar, nothing should be changed.
++ final BufferedImage bi2 = step2(menubar);
++ frame.dispose();
++
++ for (int x = 0; x < W; ++x) {
++ for (int y = 0; y < H; ++y) {
++ if (bi1.getRGB(x, y) != bi2.getRGB(x, y)) {
++ try {
++ ImageIO.write(bi1, "png", new File("image1.png"));
++ ImageIO.write(bi2, "png", new File("image2.png"));
++ } catch (IOException e) {
++ e.printStackTrace();
++ }
++ throw new RuntimeException("Failed: wrong color");
++ }
++ }
++ }
++ }
++
++ /**
++ * Draws standard JMenuBar.
++ */
++ private BufferedImage step1(final JMenuBar menubar) {
++ final BufferedImage bi1 = new BufferedImage(W, H, TYPE_INT_ARGB_PRE);
++ final Graphics2D g2d = bi1.createGraphics();
++ g2d.scale(2, 2);
++ g2d.setColor(Color.RED);
++ g2d.fillRect(0, 0, W, H);
++ menubar.paintAll(g2d);
++ g2d.dispose();
++ return bi1;
++ }
++
++ /**
++ * Draws standard JMenuBar and border on top of it.
++ */
++ private BufferedImage step2(final JMenuBar menubar) {
++ final BufferedImage bi2 = new BufferedImage(W, H, TYPE_INT_ARGB_PRE);
++ final Graphics2D g2d2 = bi2.createGraphics();
++ g2d2.scale(2, 2);
++ g2d2.setColor(Color.RED);
++ g2d2.fillRect(0, 0, W, H);
++ menubar.paintAll(g2d2);
++ menubar.getBorder().paintBorder(menubar, g2d2, menubar.getX(), menubar
++ .getX(), menubar.getWidth(), menubar.getHeight());
++ g2d2.dispose();
++ return bi2;
++ }
++
++ private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) {
++ try {
++ UIManager.setLookAndFeel(laf.getClassName());
++ System.out.println("LookAndFeel: " + laf.getClassName());
++ } catch (ClassNotFoundException | InstantiationException |
++ UnsupportedLookAndFeelException | IllegalAccessException e) {
++ throw new RuntimeException(e);
++ }
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JRadioButton/8075609/bug8075609.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,115 @@
++/*
++ * 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
++ * @library ../../regtesthelpers
++ * @build Util
++ * @bug 8075609
++ * @summary IllegalArgumentException when transferring focus from JRadioButton using tab
++ * @author Vivi An
++ * @run main bug8075609
++ */
++
++import javax.swing.*;
++import javax.swing.event.*;
++import java.awt.event.*;
++import java.awt.*;
++import sun.awt.SunToolkit;
++
++public class bug8075609 {
++ private static Robot robot;
++ private static SunToolkit toolkit;
++ private static JTextField textField;
++
++ public static void main(String args[]) throws Throwable {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ public void run() {
++ createAndShowGUI();
++ }
++ });
++
++ robot = new Robot();
++ Thread.sleep(100);
++
++ robot.setAutoDelay(100);
++ toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
++
++ // Radio button group tab key test
++ runTest1();
++ }
++
++ private static void createAndShowGUI() {
++ JFrame mainFrame = new JFrame("Bug 8075609 - 1 test");
++
++ JPanel rootPanel = new JPanel();
++ rootPanel.setLayout(new BorderLayout());
++
++ JPanel formPanel = new JPanel();
++ formPanel.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy());
++ formPanel.setFocusCycleRoot(true);
++
++ JRadioButton option1 = new JRadioButton("Option 1", true);
++ JRadioButton option2 = new JRadioButton("Option 2");
++
++ ButtonGroup radioButtonGroup = new ButtonGroup();
++ radioButtonGroup.add(option1);
++ radioButtonGroup.add(option2);
++
++ formPanel.add(option1);
++ formPanel.add(option2);
++ textField = new JTextField("Another focusable component");
++ formPanel.add(textField);
++
++ rootPanel.add(formPanel, BorderLayout.CENTER);
++
++ JButton okButton = new JButton("OK");
++ rootPanel.add(okButton, BorderLayout.SOUTH);
++
++ mainFrame.add(rootPanel);
++ mainFrame.pack();
++ mainFrame.setVisible(true);
++ mainFrame.toFront();
++ }
++
++ // Radio button Group as a single component when traversing through tab key
++ private static void runTest1() throws Exception{
++ hitKey(robot, KeyEvent.VK_TAB);
++
++ robot.setAutoDelay(1000 );
++ SwingUtilities.invokeAndWait(new Runnable() {
++ public void run() {
++ if (textField.hasFocus()) {
++ System.out.println("Radio Button Group Go To Next Component through Tab Key failed");
++ throw new RuntimeException("Focus is not on textField as Expected");
++ }
++ }
++ });
++ }
++
++ private static void hitKey(Robot robot, int keycode) {
++ robot.keyPress(keycode);
++ robot.keyRelease(keycode);
++ toolkit.realSync();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JScrollPane/8033000/bug8033000.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,160 @@
++/*
++ * 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.BorderLayout;
++import java.awt.Point;
++import java.awt.Robot;
++import java.awt.event.KeyEvent;
++import javax.swing.JFrame;
++import javax.swing.JPanel;
++import javax.swing.JScrollPane;
++import javax.swing.JTextArea;
++import javax.swing.SwingUtilities;
++import javax.swing.UIManager;
++import sun.awt.OSInfo;
++
++/**
++ * @test
++ * @bug 8033000
++ * @author Alexander Scherbatiy
++ * @summary No Horizontal Mouse Wheel Support In BasicScrollPaneUI
++ * @run main bug8033000
++ */
++public class bug8033000 {
++
++ private static JScrollPane scrollPane;
++ private static JTextArea textArea;
++ private static Point point;
++ private static final int delta;
++
++ static {
++ delta = OSInfo.getOSType().equals(OSInfo.OSType.MACOSX) ? -30 : 30;
++ }
++
++ public static void main(String[] args) throws Exception {
++
++ Robot robot = new Robot();
++ robot.setAutoDelay(50);
++
++ SwingUtilities.invokeAndWait(bug8033000::createAndShowGUI);
++ robot.waitForIdle();
++
++ SwingUtilities.invokeAndWait(() -> {
++ Point locationOnScreen = scrollPane.getLocationOnScreen();
++ point = new Point(
++ locationOnScreen.x + scrollPane.getWidth() / 2,
++ locationOnScreen.y + scrollPane.getHeight() / 2);
++ });
++
++ robot.mouseMove(point.x, point.y);
++ robot.waitForIdle();
++
++ // vertical scroll bar is enabled
++ initScrollPane(true, false);
++ robot.waitForIdle();
++ robot.mouseWheel(delta);
++ robot.waitForIdle();
++ checkScrollPane(true);
++
++ // vertical scroll bar is enabled + shift
++ initScrollPane(true, false);
++ robot.waitForIdle();
++ robot.keyPress(KeyEvent.VK_SHIFT);
++ robot.mouseWheel(delta);
++ robot.keyRelease(KeyEvent.VK_SHIFT);
++ robot.waitForIdle();
++ checkScrollPane(true);
++
++ // horizontal scroll bar is enabled
++ initScrollPane(false, true);
++ robot.waitForIdle();
++ robot.mouseWheel(delta);
++ robot.waitForIdle();
++ checkScrollPane(false);
++
++ // horizontal scroll bar is enabled + shift
++ initScrollPane(false, true);
++ robot.waitForIdle();
++ robot.keyPress(KeyEvent.VK_SHIFT);
++ robot.mouseWheel(delta);
++ robot.keyRelease(KeyEvent.VK_SHIFT);
++ robot.waitForIdle();
++ checkScrollPane(false);
++
++ // both scroll bars are enabled
++ initScrollPane(true, true);
++ robot.waitForIdle();
++ robot.mouseWheel(delta);
++ robot.waitForIdle();
++ checkScrollPane(true);
++
++ // both scroll bars are enabled + shift
++ initScrollPane(true, true);
++ robot.waitForIdle();
++ robot.keyPress(KeyEvent.VK_SHIFT);
++ robot.mouseWheel(delta);
++ robot.keyRelease(KeyEvent.VK_SHIFT);
++ robot.waitForIdle();
++ checkScrollPane(false);
++ }
++
++ static void initScrollPane(boolean vVisible, boolean hVisible) throws Exception {
++ SwingUtilities.invokeAndWait(() -> {
++ scrollPane.getVerticalScrollBar().setValue(0);
++ scrollPane.getHorizontalScrollBar().setValue(0);
++
++ textArea.setRows(vVisible ? 100 : 1);
++ textArea.setColumns(hVisible ? 100 : 1);
++ scrollPane.getVerticalScrollBar().setVisible(vVisible);
++ scrollPane.getHorizontalScrollBar().setVisible(hVisible);
++ });
++ }
++
++ static void checkScrollPane(boolean verticalScrolled) throws Exception {
++ SwingUtilities.invokeAndWait(() -> {
++
++ if (verticalScrolled) {
++ if (scrollPane.getVerticalScrollBar().getValue() == 0
++ || scrollPane.getHorizontalScrollBar().getValue() != 0) {
++ throw new RuntimeException("Wrong vertical scrolling!");
++ }
++ } else {
++ if (scrollPane.getVerticalScrollBar().getValue() != 0
++ || scrollPane.getHorizontalScrollBar().getValue() == 0) {
++ throw new RuntimeException("Wrong horizontal scrolling!");
++ }
++ }
++ });
++ }
++
++ static void createAndShowGUI() {
++ JFrame frame = new JFrame();
++ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
++ frame.setSize(300, 300);
++ textArea = new JTextArea("Hello World!");
++ scrollPane = new JScrollPane(textArea);
++ JPanel panel = new JPanel(new BorderLayout());
++ panel.add(scrollPane, BorderLayout.CENTER);
++ frame.getContentPane().add(panel);
++ frame.setVisible(true);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JTextArea/TextViewOOM/TextViewOOM.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,95 @@
++/*
++ * 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.EventQueue;
++
++import javax.swing.JFrame;
++import javax.swing.JScrollPane;
++import javax.swing.JTextArea;
++
++/**
++ * @test
++ * @bug 8072775
++ * @run main/othervm -Xmx80m TextViewOOM
++ */
++public class TextViewOOM {
++
++ private static JFrame frame;
++ private static JTextArea ta;
++ private static final String STRING = "\uDC00\uD802\uDFFF";
++ private static final int N = 5000;
++
++ private static void createAndShowGUI() {
++ frame = new JFrame();
++ final JScrollPane jScrollPane1 = new JScrollPane();
++ ta = new JTextArea();
++
++ ta.setEditable(false);
++ ta.setColumns(20);
++ ta.setRows(5);
++ jScrollPane1.setViewportView(ta);
++ frame.add(ta);
++
++ frame.pack();
++ frame.setLocationRelativeTo(null);
++ frame.setVisible(true);
++ }
++
++ public static void main(final String[] args) throws Exception {
++ /* Create and display the form */
++ EventQueue.invokeAndWait(TextViewOOM::createAndShowGUI);
++ for (int i = 0; i < 10; i++) {
++ System.gc();
++ Thread.sleep(1000);
++ }
++ long mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
++ System.err.println("Memory before creating the text: "+mem);
++ final StringBuilder sb = new StringBuilder(N * STRING.length());
++ for (int i = 0; i < N; i++) {
++ sb.append(STRING);
++ }
++ for (int i = 0; i < 10; i++) {
++ System.gc();
++ Thread.sleep(1000);
++ }
++ mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
++ System.err.println("Memory after creating the text: "+mem);
++
++ EventQueue.invokeAndWait(() -> {
++ ta.setText(sb.toString());
++ for (int i = 0; i < 10; i++) {
++ System.gc();
++ try {Thread.sleep(200);} catch (InterruptedException iex) {}
++ }
++ long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
++ System.err.println("Memory after setting the text: " + mem1);
++ });
++ for (int i = 0; i < 10; i++) {
++ System.gc();
++ Thread.sleep(1000);
++ }
++ mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
++ System.err.println("Final memory after everything: " + mem);
++ EventQueue.invokeAndWait(frame::dispose);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/JTree/8072676/TreeClipTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,97 @@
++/*
++ * 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.*;
++import java.awt.image.BufferedImage;
++import java.io.File;
++import java.io.IOException;
++import javax.imageio.ImageIO;
++import javax.swing.*;
++import javax.swing.tree.DefaultMutableTreeNode;
++import javax.swing.tree.DefaultTreeModel;
++
++/*
++ * @test
++ * @bug 8072676
++ * @summary Checks if the tree painter doesn't expand existing clip
++ * @author Anton Nashatyrev
++ */
++public class TreeClipTest {
++
++ static boolean passed = true;
++
++ static boolean checkImage(BufferedImage img, int clipY) {
++ for (int y = clipY; y < img.getHeight(); y++) {
++ for (int x = 0; x < img.getWidth(); x++) {
++ if ((img.getRGB(x,y) & 0xFFFFFF) != 0xFFFFFF) {
++ return false;
++ }
++ }
++ }
++ return true;
++ }
++
++ public static void main(String[] args) throws Exception {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ @Override
++ public void run() {
++ DefaultMutableTreeNode root = new DefaultMutableTreeNode("JTree");
++ DefaultMutableTreeNode parent;
++
++ parent = new DefaultMutableTreeNode("colors");
++ root.add(parent);
++ parent.add(new DefaultMutableTreeNode("blue"));
++ DefaultTreeModel model = new DefaultTreeModel(root);
++ JTree tree = new JTree(model);
++
++ BufferedImage img = new BufferedImage(50, 50, BufferedImage.TYPE_INT_ARGB);
++ for (int clipY = 1; clipY < 50; clipY++) {
++ Graphics2D ig = img.createGraphics();
++ ig.setColor(Color.WHITE);
++ ig.fillRect(0,0,1000, 1000);
++ tree.setSize(200,200);
++ ig.setClip(0,0,1000,clipY);
++ tree.paint(ig);
++ ig.dispose();
++
++ if (!checkImage(img, clipY)) {
++ System.err.println("Failed with clipY=" + clipY);
++ passed = false;
++ try {
++ ImageIO.write(img, "PNG", new File("failedResult.png"));
++ } catch (IOException e) {
++ e.printStackTrace();
++ }
++ return;
++ }
++ }
++ }
++ });
++
++ if (!passed) {
++ throw new RuntimeException("Test failed.");
++ } else {
++ System.out.println("Passed.");
++ }
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/RepaintManager/DisplayListenerLeak/DisplayListenerLeak.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,82 @@
++/*
++ * 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.BorderLayout;
++import java.awt.Dimension;
++import java.awt.EventQueue;
++import java.awt.GraphicsEnvironment;
++
++import javax.swing.JFrame;
++import javax.swing.JLabel;
++
++import sun.java2d.SunGraphicsEnvironment;
++
++/**
++ * @test
++ * @bug 8041654
++ * @run main/othervm -Xmx80m DisplayListenerLeak
++ */
++public final class DisplayListenerLeak {
++
++ private static JFrame frame;
++ private volatile static boolean failed = false;
++
++ private static void createAndShowGUI() {
++ Thread.currentThread().setUncaughtExceptionHandler((t, e) -> {
++ e.printStackTrace();
++ failed = true;
++ });
++ frame = new JFrame();
++ JLabel emptyLabel = new JLabel("");
++ emptyLabel.setPreferredSize(new Dimension(600, 400));
++ frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
++ frame.pack();
++ frame.setVisible(true);
++ }
++
++ public static void main(final String[] args) throws Exception {
++ GraphicsEnvironment ge =
++ GraphicsEnvironment.getLocalGraphicsEnvironment();
++ if (!(ge instanceof SunGraphicsEnvironment)) {
++ return;
++ }
++ EventQueue.invokeAndWait(() -> createAndShowGUI());
++ SunGraphicsEnvironment sge = (SunGraphicsEnvironment) ge;
++ final long startTime = System.nanoTime();
++ while (!failed) {
++ if (System.nanoTime() - startTime > 60_000_000_000L) {
++ break;
++ }
++ System.gc(); // clear all weak references
++ EventQueue.invokeAndWait(() -> {
++ frame.setSize(frame.getHeight(), frame.getWidth());
++ frame.pack();
++ });
++ EventQueue.invokeAndWait(sge::displayChanged);
++ }
++ EventQueue.invokeAndWait(frame::dispose);
++ if (failed) {
++ throw new RuntimeException();
++ }
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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.
++ */
++
++import java.awt.Graphics;
++import java.awt.Graphics2D;
++import java.awt.Robot;
++import java.awt.image.BufferedImage;
++import java.io.File;
++
++import javax.imageio.ImageIO;
++import javax.swing.JFrame;
++import javax.swing.JLabel;
++import javax.swing.SwingUtilities;
++
++import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
++
++/**
++ * @test
++ * @bug 8015085
++ * @summary Shortening via " ... " is broken for Strings containing a combining
++ * diaeresis.
++ * @author Sergey Bylokhov
++ */
++public class TestBadBreak {
++
++ static JFrame frame;
++ static Robot robot;
++ static final String withCombiningDiaeresis = "123p://.aaaaaaaaaaaaaaaaaaaaaa.123/a\u0308" ;
++ static final String withoutCombiningDiaeresis = "123p://.aaaaaaaaaaaaaaaaaaaaaa.123/\u00E4" ;
++
++ public static void main(final String[] args) throws Exception {
++ robot = new Robot();
++ final BufferedImage bi1 = new BufferedImage(200, 90, TYPE_INT_ARGB);
++ final BufferedImage bi2 = new BufferedImage(200, 90, TYPE_INT_ARGB);
++ test(withCombiningDiaeresis, bi1);
++ test(withoutCombiningDiaeresis, bi2);
++ for (int x = 0; x < bi1.getWidth(); ++x) {
++ for (int y = 0; y < bi1.getHeight(); ++y) {
++ if (bi1.getRGB(x, y) != bi2.getRGB(x, y)) {
++ ImageIO.write(bi1, "png", new File("image1.png"));
++ ImageIO.write(bi2, "png", new File("image2.png"));
++ throw new RuntimeException("Wrong color");
++ }
++ }
++ }
++ }
++
++ private static void test(final String text, final BufferedImage i1)
++ throws Exception {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ @Override
++ public void run() {
++ frame = new JFrame();
++ final JLabel label = new JLabel(text) {
++ @Override
++ protected void paintComponent(Graphics g) {
++ Graphics2D g2d = i1.createGraphics();
++ super.paintComponent(g2d);
++ g2d.dispose();
++ }
++ };
++ frame.getContentPane().add(label);
++ frame.setBounds(200, 200, 200, 90);
++ }
++ });
++ robot.waitForIdle();
++ SwingUtilities.invokeAndWait(() -> frame.setVisible(true));
++ robot.waitForIdle();
++ SwingUtilities.invokeAndWait(frame::dispose);
++ robot.waitForIdle();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/UIDefaults/7180976/Pending.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,50 @@
++/*
++ * Copyright (c) 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 javax.swing.SwingUtilities;
++import javax.swing.UIManager;
++
++/**
++ * @test
++ * @bug 7180976
++ * @author Sergey Bylokhov
++ */
++public final class Pending implements Runnable {
++
++ private static volatile boolean passed;
++
++ public static void main(final String[] args) throws Exception {
++ SwingUtilities.invokeLater(new Pending());
++ Thread.sleep(10000);
++ if (!passed) {
++ throw new RuntimeException("Test failed");
++ }
++ }
++
++ @Override
++ public void run() {
++ UIManager.put("foobar", "Pending");
++ UIManager.get("foobar");
++ passed = true;
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/plaf/aqua/CustomComboBoxFocusTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,327 @@
++/*
++ * 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 8073001
++ @summary Test verifies that combo box with custom editor renders
++ focus ring around arrow button correctly.
++ @run main CustomComboBoxFocusTest
++*/
++
++import java.awt.AWTException;
++import java.awt.Component;
++import java.awt.GridLayout;
++import java.awt.Point;
++import java.awt.Rectangle;
++import java.awt.Robot;
++import java.awt.event.ActionListener;
++import java.awt.event.FocusEvent;
++import java.awt.event.FocusListener;
++import java.awt.image.BufferedImage;
++import java.io.File;
++import java.io.IOException;
++import java.lang.reflect.InvocationTargetException;
++import java.util.concurrent.CountDownLatch;
++import javax.imageio.ImageIO;
++import javax.swing.ComboBoxEditor;
++import javax.swing.JComboBox;
++import javax.swing.JFrame;
++import javax.swing.JLabel;
++import javax.swing.JPanel;
++import javax.swing.JTextField;
++import javax.swing.SwingUtilities;
++
++public class CustomComboBoxFocusTest {
++
++ private static CustomComboBoxFocusTest test = null;
++
++ public static void main(String[] args) {
++
++ try {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ public void run() {
++ test = new CustomComboBoxFocusTest();
++ }
++ });
++ } catch (InterruptedException | InvocationTargetException e ) {
++ throw new RuntimeException("Test failed.", e);
++ }
++
++ SwingUtilities.invokeLater(test.init);
++
++ try {
++ System.out.println("Wait for screenshots...");
++ test.testDone.await();
++ } catch (InterruptedException e) {
++ throw new RuntimeException("Test failed.", e);
++ }
++ System.out.println("Compare screenshots...");
++ if (!test.match()) {
++ throw new RuntimeException("Test failed.");
++ }
++ System.out.println("Test passed.");
++ }
++
++ private final JComboBox<String> ref = new JComboBox<String>() {
++ public String toString() {
++ return "reference";
++ }
++ };
++
++ private final JComboBox<String> custom = new JComboBox<String>() {
++ public String toString() {
++ return "custom";
++ }
++ };
++
++ private final JFrame frame;
++
++ private CountDownLatch testDone = new CountDownLatch(1);
++
++ private Robot robot;
++
++ public CustomComboBoxFocusTest() {
++ frame = new JFrame(System.getProperty("java.version"));
++
++ try {
++ robot = new Robot(frame.getGraphicsConfiguration().getDevice());
++
++ } catch (AWTException e) {
++ throw new RuntimeException("Test failed.", e);
++ }
++ }
++
++ private boolean match() {
++ final BufferedImage a = captureRef.img;
++ final BufferedImage b = captureCustom.img;
++
++ final int w = Math.min(a.getWidth(), b.getWidth());
++ final int h = Math.min(a.getHeight(), b.getHeight());
++
++ for (int y = 0; y < h; y++) {
++ for (int x = 0; x < w; x++) {
++ if (a.getRGB(x, y) != b.getRGB(x, y)) {
++ return false;
++ }
++ }
++ }
++ return true;
++ }
++
++ private JComboBox<String> getReference() {
++ return ref;
++ }
++
++ private JComboBox<String> getCustom() {
++ return custom;
++ }
++
++ private JFrame getFrame() {
++ return frame;
++ }
++
++ private static abstract class Step implements Runnable {
++ final public void run() {
++ doStep();
++
++ final Step next = nextStep();
++
++ if (next != null) {
++ SwingUtilities.invokeLater(next);
++ }
++ }
++
++ public abstract void doStep();
++
++ public abstract Step nextStep();
++ }
++
++ private final Step init = new Step() {
++ public void doStep() {
++ final JFrame f = getFrame();
++
++ final JPanel p = new JPanel(new GridLayout(4, 1, 20, 20));
++
++ JComboBox<String> r = getReference();
++ r.setEditable(true);
++ r.addItem("One");
++
++ JComboBox<String> c = getCustom();
++ c.setEditable(true);
++ c.addItem("One");
++ final ComboBoxEditor e = new ComboBoxEditor() {
++ private JTextField text = new JTextField();
++
++ @Override
++ public Component getEditorComponent() {
++ return this.text;
++ }
++
++ @Override
++ public void setItem(Object o) {
++ text.setText(o == null ? "" : o.toString());
++ }
++
++ @Override
++ public Object getItem() {
++ return text.getText();
++ }
++
++ @Override
++ public void selectAll() {
++ text.selectAll();
++ }
++
++ @Override
++ public void addActionListener(ActionListener actionListener) {
++ text.addActionListener(actionListener);
++ }
++
++ @Override
++ public void removeActionListener(ActionListener actionListener) {
++ text.removeActionListener(actionListener);
++ }
++ };
++ c.setEditor(e);
++
++ p.add(new JLabel("Reference"));
++ p.add(r);
++ p.add(c);
++ p.add(new JLabel("Custom"));
++
++ f.add(p);
++
++ f.pack();
++ f.setVisible(true);
++ }
++
++ public Step nextStep() {
++ return focusRef;
++ }
++ };
++
++ private class FocusStep extends Step {
++ private final JComboBox<String> target;
++ private final Step focusHandler;
++ private final Step next;
++
++ public FocusStep(JComboBox<String> t, Step h, Step n) {
++ target = t;
++ focusHandler = h;
++ next = n;
++ }
++
++ public void doStep() {
++ System.out.println("Request focus on " + target);
++ final Component c = target.getEditor().getEditorComponent();
++
++ c.addFocusListener(new FocusListener() {
++ @Override
++ public void focusGained(FocusEvent e) {
++ SwingUtilities.invokeLater(focusHandler);
++ }
++
++ @Override
++ public void focusLost(FocusEvent e) {
++
++ }
++ });
++
++ c.requestFocus();
++
++ }
++
++ public Step nextStep() {
++ return next;
++ }
++ }
++
++
++ private class CaptureStep extends Step {
++ private final JComboBox<String> target;
++ private BufferedImage img;
++ private String fname;
++ private final Step next;
++
++ private final int timeout = 2000;
++
++ public CaptureStep(JComboBox<String> t, String name, Step n) {
++ target = t;
++ next = n;
++ fname = name;
++ }
++
++ public void doStep() {
++ try {
++ Thread.sleep(timeout);
++ } catch (InterruptedException e) {
++ }
++ System.out.println("Capture sceeenshot of " + target);
++
++ Rectangle bounds = target.getBounds();
++ Point p = target.getLocationOnScreen();
++ System.out.println("Target bounds: " + bounds);
++ System.out.println("Target location: " + p);
++
++ bounds.x = p.x;
++ bounds.y = p.y;
++
++ img = robot.createScreenCapture(bounds);
++
++ try {
++ ImageIO.write(img, "PNG", new File(fname + ".png"));
++ } catch (IOException ioe) {
++ ioe.printStackTrace();
++ }
++
++ }
++
++ public Step nextStep() {
++ return next;
++ }
++ }
++
++ private final Step done = new Step() {
++ public void doStep() {
++ JFrame f = getFrame();
++ if (f != null) {
++ f.dispose();
++ }
++ System.out.println("Done");
++
++ testDone.countDown();
++ }
++
++ public Step nextStep() {
++ return null;
++ }
++ };
++
++ private final CaptureStep captureCustom = new CaptureStep(getCustom(), "cb_custom", done);
++
++ private final FocusStep focusCustom = new FocusStep(getCustom(), captureCustom, null);
++
++ private final CaptureStep captureRef = new CaptureStep(getReference(), "cb_ref", focusCustom);
++
++ private final FocusStep focusRef = new FocusStep(getReference(), captureRef, null);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,59 @@
++/*
++ * 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 8056151
++ @summary Switching to GTK L&F on-the-fly leads to X Window System error RenderBadPicture
++ @run main/othervm -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel -Dsun.java2d.xrender=T RenderBadPictureCrash
++ */
++
++import java.awt.Color;
++import java.lang.reflect.InvocationTargetException;
++import javax.swing.JFrame;
++import javax.swing.SwingUtilities;
++
++import javax.swing.UIManager;
++
++public class RenderBadPictureCrash {
++
++ public static void main(String[] args) throws InterruptedException, InvocationTargetException {
++ SwingUtilities.invokeAndWait(() -> {
++ JFrame f = new JFrame();
++ f.setUndecorated(true);
++ f.setBackground(new Color(0, 0, 0, 0));
++ f.setSize(200, 300);
++ f.setVisible(true);
++
++ try {
++ UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
++ } catch (Exception e) {
++ System.err.println(e);
++ System.err.println("Could not set GTKLookAndFeel, skipping this test");
++ } finally {
++ f.dispose();
++ }
++ });
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/plaf/nimbus/8041642/bug8041642.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,95 @@
++/*
++ * 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 8041642
++ @summary Incorrect paint of JProgressBar in Nimbus LF
++ @author Semyon Sadetsky
++*/
++
++import javax.swing.*;
++import java.awt.*;
++
++public class bug8041642 {
++
++ private static JFrame frame;
++ private static Point point;
++ private static JProgressBar bar;
++
++ public static void main(String[] args) throws Exception {
++ for (UIManager.LookAndFeelInfo info : UIManager
++ .getInstalledLookAndFeels()) {
++ if ("Nimbus".equals(info.getName())) {
++ try {
++ UIManager.setLookAndFeel(info.getClassName());
++ } catch (Exception ex) {
++ }
++ break;
++ }
++ }
++ try {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ public void run() {
++ frame = new JFrame();
++ frame.setUndecorated(true);
++ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
++ setup(frame);
++ }
++ });
++ SwingUtilities.invokeAndWait(new Runnable() {
++ @Override
++ public void run() {
++ point = bar.getLocationOnScreen();
++ }
++ });
++ final Robot robot = new Robot();
++ Color color = robot.getPixelColor(point.x + 1, point.y + 7);
++ System.out.println(color);
++ if (color.getGreen() < 150 || color.getBlue() > 30 ||
++ color.getRed() > 200) {
++ throw new RuntimeException("Bar padding color should be green");
++ }
++
++ } finally {
++ SwingUtilities.invokeAndWait(new Runnable() {
++ @Override
++ public void run() {
++ //frame.dispose();
++ }
++ });
++ }
++
++ System.out.println("ok");
++ }
++
++ static void setup(JFrame frame) {
++ bar = new JProgressBar();
++ bar.setBackground(Color.WHITE);
++ bar.setValue(2);
++ frame.getContentPane().add(bar, BorderLayout.NORTH);
++ frame.getContentPane().setBackground(Color.GREEN);
++ frame.setSize(200, 150);
++ frame.setLocation(100, 100);
++ frame.setVisible(true);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/swing/text/html/parser/8074956/bug8074956.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,47 @@
++/*
++ * 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 javax.swing.text.html.parser.ContentModel;
++import javax.swing.text.html.parser.DTD;
++import javax.swing.text.html.parser.Element;
++
++/*
++ * @test
++ * @bug 8074956
++ * @author Alexey Ivanov
++ * @summary Tests correct handling of additional HTML elements in ContentModel
++ * @run main bug8074956
++ */
++public class bug8074956 {
++ public static void main(String[] args) throws Exception {
++ final DTD html32 = DTD.getDTD("html32");
++ ContentModel contentModel = new ContentModel('&', new ContentModel());
++
++ Element elem1 = html32.getElement("html-element");
++ contentModel.first(elem1);
++
++ Element elem2 = html32.getElement("test-element");
++ // Shouldn't throw ArrayIndexOutOfBoundsException
++ contentModel.first(elem2);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/xml/bind/jxc/8046817/GenerateEnumSchema.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,118 @@
++/*
++ * Copyright (c) 2014, 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 8046817 8073357 8076139
++ * @summary schemagen fails to generate xsd for enum types.
++ * Check that order of Enum values is preserved.
++ * @library /lib/testlibrary
++ * @run testng/othervm GenerateEnumSchema
++ */
++import java.io.BufferedReader;
++import java.io.IOException;
++import java.io.InputStreamReader;
++import java.nio.file.Files;
++import java.nio.file.Path;
++import java.nio.file.Paths;
++import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
++import java.util.Arrays;
++import java.util.regex.Pattern;
++import java.util.stream.Collectors;
++import jdk.testlibrary.JDKToolLauncher;
++import org.testng.Assert;
++import org.testng.annotations.BeforeTest;
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++
++public class GenerateEnumSchema {
++
++ @DataProvider
++ //test case name, input file for schemagen, regexp for checking schema content
++ public static Object[][] schemagenGenerationData() {
++ return new Object[][] {
++ {"Class", "TestClassType.java",
++ ".+?name=\"testClassType\".+"},
++ {"Enum", "TestEnumType.java",
++ ".+?FIRST.+?ONE.+?TWO.+?THREE.+?FOUR.+?FIVE.+?SIX.+?LAST.+"},
++ };
++ }
++
++ @BeforeTest
++ public void setUp() throws IOException {
++ //Create test directory inside scratch
++ testWorkDir = Paths.get(System.getProperty("user.dir", "."))
++ .resolve("GenerateEnumSchema");
++ testSrcDir = Paths.get(System.getProperty("test.src", "."));
++ //Create test work directory inside scratch directory
++ Files.createDirectory(testWorkDir);
++ }
++
++ @Test(dataProvider="schemagenGenerationData")
++ public void schemangenGenerationTestCase(String shortTestName,
++ String inputFileName, String regexp) throws IOException {
++ //Create test case directory
++ Path testCaseDir = testWorkDir.resolve(shortTestName);
++ Files.createDirectories(testCaseDir);
++ //Copy java source from test.src to the test case dir
++ Files.copy(testSrcDir.resolve(inputFileName), testCaseDir.resolve(inputFileName), REPLACE_EXISTING);
++ //Run schemagen
++ runSchemaGen(inputFileName, testCaseDir);
++ //Check if schema file generated
++ Assert.assertTrue(Files.exists(testCaseDir.resolve(SCHEMA_FILE)));
++ //Read schema content from file
++ String content = Files.lines(testCaseDir.resolve(SCHEMA_FILE)).collect(Collectors.joining(""));
++ System.out.println("Generated schema: " + content);
++ //Check if schema contains expected content
++ Assert.assertTrue(Pattern.matches(regexp, content));
++ }
++
++ private static void runSchemaGen(String classFile, Path runDir) {
++ try {
++ JDKToolLauncher sgl = JDKToolLauncher.createUsingTestJDK("schemagen");
++ sgl.addToolArg(classFile);
++ System.out.println("Executing: " + Arrays.asList(sgl.getCommand()));
++ ProcessBuilder pb = new ProcessBuilder(sgl.getCommand());
++ pb.directory(runDir.toFile());
++ pb.redirectErrorStream(true);
++ pb.inheritIO();
++ Process p = pb.start();
++ int result = p.waitFor();
++ p.destroy();
++ if (result != 0) {
++ throw new RuntimeException("schemagen failed");
++ }
++ } catch (IOException | InterruptedException e) {
++ System.err.println("Can't run schemagen tool. Exception:");
++ e.printStackTrace(System.err);
++ throw new RuntimeException("Error launching schemagen tool");
++ }
++ }
++
++ //schemagen tool output file name
++ private static final String SCHEMA_FILE = "schema1.xsd";
++ //Test working directory
++ Path testWorkDir;
++ //Directory with test src
++ Path testSrcDir;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/xml/bind/jxc/8046817/TestClassType.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,29 @@
++/*
++ * Copyright (c) 2014, 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 javax.xml.bind.annotation.XmlType;
++
++@XmlType
++public class TestClassType {
++ public int a;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/xml/bind/jxc/8046817/TestEnumType.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,29 @@
++/*
++ * Copyright (c) 2014, 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 javax.xml.bind.annotation.XmlEnum;
++
++@XmlEnum(String.class)
++public enum TestEnumType {
++ FIRST, ONE, TWO, THREE, FOUR, FIVE, SIX, LAST
++}
+--- ./jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java Wed Jul 01 21:53:30 2015 -0700
+@@ -26,8 +26,9 @@
+ public class TestFunc {
+
+ public static String test(Node node) {
+- String s = node.getTextContent();
+- return s;
++ String textContent = node.getTextContent();
++ String nodeValue = node.getNodeValue();
++ return textContent + ":" + nodeValue;
+ }
+
+ }
+--- ./jdk/test/javax/xml/jaxp/common/8032908/XSLT.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/javax/xml/jaxp/common/8032908/XSLT.java Wed Jul 01 21:53:30 2015 -0700
+@@ -23,9 +23,10 @@
+
+ /**
+ * @test
+- * @bug 8032908
++ * @bug 8032908 8081392
+ * @summary Test if Node.getTextContent() function correctly returns children
+- * content
++ * content and also check that Node.getNodeValue() returns null value for
++ * Element nodes
+ * @compile TestFunc.java XSLT.java
+ * @run main/othervm XSLT
+ */
+@@ -40,7 +41,7 @@
+
+ static final String XMLTOTRANSFORM = "/in.xml";
+ static final String XSLTRANSFORMER = "/test.xsl";
+- static final String EXPECTEDRESULT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>ABCDEFG";
++ static final String EXPECTEDRESULT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>ABCDEFG:null";
+
+ public static void main(String[] args) throws TransformerException {
+ ByteArrayOutputStream resStream = new ByteArrayOutputStream();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/xml/jaxp/testng/parse/jdk7156085/UTF8ReaderBug.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,64 @@
++/*
++ * Copyright 2014 Google, Inc. All Rights Reserved.
++ * 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 parse.jdk7156085;
++
++import java.io.ByteArrayInputStream;
++import java.io.IOException;
++import javax.xml.parsers.SAXParser;
++import javax.xml.parsers.SAXParserFactory;
++import org.xml.sax.InputSource;
++import org.xml.sax.helpers.DefaultHandler;
++import org.testng.annotations.Test;
++
++/**
++ * JDK-7156085: ArrayIndexOutOfBoundsException throws in UTF8Reader of SAXParser
++ * https://bugs.openjdk.java.net/browse/JDK-7156085
++ *
++ * XERCESJ-1257: buffer overflow in UTF8Reader for characters out of BMP
++ * https://issues.apache.org/jira/browse/XERCESJ-1257
++ */
++public class UTF8ReaderBug {
++ @Test
++ public void shouldAcceptSupplementaryCharacters() throws Throwable {
++ StringBuilder b = new StringBuilder("<xml>");
++ for(int i = 5; i < 8223; i++) {
++ b.append(' ');
++ }
++ // Add surrogate characters which overflow the buffer. This shows the need to place an
++ // overflow check at --
++ // com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:544)
++ b.append("\uD835\uDC37");
++ b.append("</xml>");
++ sendToParser(b.toString());
++ }
++
++ private static void sendToParser(String b) throws Throwable {
++ byte[] input = b.getBytes("UTF-8");
++ ByteArrayInputStream in = new ByteArrayInputStream(input);
++
++ SAXParserFactory spf = SAXParserFactory.newInstance();
++ SAXParser p = spf.newSAXParser();
++ p.parse(new InputSource(in), new DefaultHandler());
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/xml/jaxp/transform/8062518/DocumentExtFunc.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,32 @@
++/*
++ * 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 org.w3c.dom.Node;
++import org.w3c.dom.NodeList;
++
++public class DocumentExtFunc {
++
++ public static String test(NodeList list) {
++ Node node = list.item(0);
++ return "[" + node.getNodeName() + ":" + node.getTextContent() + "]";
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/javax/xml/jaxp/transform/8062518/XSLTFunctionsTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,128 @@
++/*
++ * 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 8062518
++ * @summary This class contains tests for XSLT functions
++ * @compile DocumentExtFunc.java
++ * @run testng/othervm XSLTFunctionsTest
++ */
++
++import java.io.StringReader;
++import java.io.StringWriter;
++
++import javax.xml.transform.Source;
++import javax.xml.transform.Transformer;
++import javax.xml.transform.TransformerException;
++import javax.xml.transform.TransformerFactory;
++import javax.xml.transform.URIResolver;
++import javax.xml.transform.stream.StreamResult;
++import javax.xml.transform.stream.StreamSource;
++
++import org.testng.annotations.DataProvider;
++import org.testng.annotations.Test;
++import static org.testng.Assert.assertEquals;
++
++public class XSLTFunctionsTest {
++
++ /**
++ * bug 8062518
++ * Verifies that a reference to the DTM created by XSLT document function is
++ * actually read from the DTM by an extension function.
++ * @param xml Content of xml file to process
++ * @param xsl stylesheet content that loads external document {@code externalDoc}
++ * with XSLT 'document' function and then reads it with
++ * DocumentExtFunc.test() function
++ * @param externalDoc Content of the external xml document
++ * @param expectedResult Expected transformation result
++ **/
++ @Test(dataProvider = "document")
++ public void testDocument(final String xml, final String xsl,
++ final String externalDoc, final String expectedResult) throws Exception {
++ // Prepare sources for transormation
++ Source src = new StreamSource(new StringReader(xml));
++ Source xslsrc = new StreamSource(new StringReader(xsl));
++
++ // Create factory and transformer
++ TransformerFactory tf = TransformerFactory.newInstance();
++ Transformer t = tf.newTransformer( xslsrc );
++ t.setErrorListener(tf.getErrorListener());
++
++ // Set URI Resolver to return the newly constructed xml
++ // stream source object from xml test string
++ t.setURIResolver(new URIResolver() {
++ @Override
++ public Source resolve(String href, String base)
++ throws TransformerException {
++ if (href.contains("externalDoc")) {
++ return new StreamSource(new StringReader(externalDoc));
++ } else {
++ return new StreamSource(new StringReader(xml));
++ }
++ }
++ });
++
++ // Prepare output stream
++ StringWriter xmlResultString = new StringWriter();
++ StreamResult xmlResultStream = new StreamResult(xmlResultString);
++
++ //Transform the xml
++ t.transform(src, xmlResultStream);
++
++ // If the document can't be accessed and the bug is in place then
++ // reported exception will be thrown during transformation
++ System.out.println("Transformation result:"+xmlResultString.toString().trim());
++
++ // Check the result - it should contain two (node name, node values) entries -
++ // one for original document, another for a document created with
++ // call to 'document' function
++ assertEquals(xmlResultString.toString().trim(), expectedResult);
++ }
++
++ @DataProvider(name = "document")
++ public static Object[][] documentTestData() {
++ return new Object[][] {
++ {documentTestXml, documentTestXsl, documentTestExternalDoc, documentTesteExpectedResult},
++ };
++ }
++
++ static final String documentTestXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>Doc</Test>";
++
++ static final String documentTestExternalDoc = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>External Doc</Test>";
++
++ static final String documentTestXsl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
++ + "<xsl:transform version=\"1.0\""
++ + " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" "
++ + " xmlns:cfunc=\"http://xml.apache.org/xalan/java/\">"
++ + "<xsl:template match=\"/\">"
++ + "<xsl:element name=\"root\">"
++ + "<xsl:variable name=\"other_doc\" select=\"document(&#39;externalDoc&#39;)\"/>"
++ + "<!-- Source -->"
++ + "<xsl:value-of select=\"cfunc:DocumentExtFunc.test(/Test)\"/>"
++ + "<!-- document() -->"
++ + "<xsl:value-of select=\"cfunc:DocumentExtFunc.test($other_doc/Test)\"/>"
++ + "</xsl:element></xsl:template></xsl:transform>";
++
++ static final String documentTesteExpectedResult = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
++ + "<root>[Test:Doc][Test:External Doc]</root>";
++}
+--- ./jdk/test/javax/xml/ws/8046817/GenerateEnumSchema.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,160 +0,0 @@
+-/*
+- * Copyright (c) 2014, 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 8046817 8073357
+- * @summary schemagen fails to generate xsd for enum types.
+- * Check that order of Enum values is preserved.
+- * @run main/othervm GenerateEnumSchema
+- */
+-import java.io.BufferedReader;
+-import java.io.File;
+-import java.io.IOException;
+-import java.io.InputStreamReader;
+-import java.nio.file.Files;
+-import java.nio.file.Paths;
+-import java.util.stream.Collectors;
+-
+-public class GenerateEnumSchema {
+-
+- private static final String SCHEMA_OUTPUT_FILENAME = "schema1.xsd";
+- private static final File schemaOutputFile = new File(SCHEMA_OUTPUT_FILENAME);
+- private static final String[] expectedEnums = {
+- "\"FIRST\"", "\"ONE\"", "\"TWO\"", "\"THREE\"",
+- "\"FOUR\"", "\"FIVE\"", "\"SIX\"", "\"LAST\""};
+- private static String schemaContent = "";
+-
+- public static void main(String[] args) throws Exception {
+-
+- //Check schema generation for class type
+- runSchemaGen("TestClassType.java");
+- checkIfSchemaGenerated();
+- readSchemaContent();
+- checkSchemaContent("<xs:complexType name=\"testClassType\">");
+- checkSchemaContent("<xs:element name=\"a\" type=\"xs:int\"/>");
+-
+- //Check schema generation for enum type
+- runSchemaGen("TestEnumType.java");
+- checkIfSchemaGenerated();
+- readSchemaContent();
+- //Check if Enum type schema is generated
+- checkSchemaContent("<xs:simpleType name=\"testEnumType\">");
+- //Check the sequence of enum values order
+- checkEnumOrder();
+- schemaOutputFile.delete();
+- }
+-
+- // Check if schema file successfully generated by schemagen
+- private static void checkIfSchemaGenerated() {
+- if (!schemaOutputFile.exists()) {
+- throw new RuntimeException("FAIL:" + SCHEMA_OUTPUT_FILENAME + " was not generated by schemagen tool");
+- }
+- }
+-
+- //Read schema content from file
+- private static void readSchemaContent() throws Exception {
+- schemaContent = Files.lines(schemaOutputFile.toPath()).collect(Collectors.joining(""));
+- }
+-
+- // Check if schema file contains specific string
+- private static void checkSchemaContent(String expContent) {
+- System.out.print("Check if generated schema contains '" + expContent + "' string: ");
+- if (schemaContent.contains(expContent)) {
+- System.out.println("OK");
+- return;
+- }
+- System.out.println("FAIL");
+- throw new RuntimeException("The '" + expContent + "' is not found in generated schema");
+- }
+-
+- // Check if the generated schema contains all enum constants
+- // and their order is preserved
+- private static void checkEnumOrder() throws Exception {
+- int prevElem = -1;
+- for (String elem : expectedEnums) {
+- int curElem = schemaContent.indexOf(elem);
+- System.out.println(elem + " position = " + curElem);
+- if (curElem < prevElem) {
+- throw new RuntimeException("FAIL: Enum values order is incorrect or " + elem + " element is not found");
+- }
+- prevElem = curElem;
+- }
+- }
+-
+- private static String getClassFilePath(String filename) {
+- String testSrc = System.getProperty("test.src");
+- if (testSrc == null) {
+- testSrc = ".";
+- }
+- return Paths.get(testSrc).resolve(filename).toString();
+- }
+-
+- private static String getSchemagen() {
+- String javaHome = System.getProperty("java.home");
+- if (javaHome.endsWith("jre")) {
+- javaHome = new File(javaHome).getParent();
+- }
+- String schemagen = javaHome + File.separator + "bin" + File.separator + "schemagen";
+- if (System.getProperty("os.name").startsWith("Windows")) {
+- schemagen = schemagen.concat(".exe");
+- }
+- return schemagen;
+- }
+-
+- private static void logOutput(Process p) throws IOException {
+- BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
+- String s = r.readLine();
+- while (s != null) {
+- System.out.println(s.trim());
+- s = r.readLine();
+- }
+- }
+-
+- private static void runSchemaGen(String classFile) {
+- String schemagen = getSchemagen();
+-
+- try {
+- System.out.println("Call to schemagen: " + schemagen + " " + classFile);
+- String[] schemagen_args = {
+- schemagen,
+- getClassFilePath(classFile)
+- };
+-
+- ProcessBuilder pb = new ProcessBuilder(schemagen_args);
+- pb.redirectErrorStream(true);
+- Process p = pb.start();
+- logOutput(p);
+- int result = p.waitFor();
+- p.destroy();
+-
+- if (result != 0) {
+- throw new RuntimeException("schemagen failed");
+- }
+- } catch (IOException | InterruptedException e) {
+- System.err.println("Can't run schemagen tool. Exception:");
+- e.printStackTrace(System.err);
+- throw new RuntimeException("Error launching schemagen tool");
+- }
+- }
+-}
+--- ./jdk/test/javax/xml/ws/8046817/TestClassType.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,29 +0,0 @@
+-/*
+- * Copyright (c) 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 javax.xml.bind.annotation.XmlType;
+-
+-@XmlType
+-public class TestClassType {
+- public int a;
+-}
+--- ./jdk/test/javax/xml/ws/8046817/TestEnumType.java Tue Jun 02 13:49:09 2015 +0300
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,29 +0,0 @@
+-/*
+- * Copyright (c) 2014, 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 javax.xml.bind.annotation.XmlEnum;
+-
+-@XmlEnum(String.class)
+-public enum TestEnumType {
+- FIRST, ONE, TWO, THREE, FOUR, FIVE, SIX, LAST
+-}
+--- ./jdk/test/jdk/net/Sockets/Test.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/jdk/net/Sockets/Test.java Wed Jul 01 21:53:30 2015 -0700
+@@ -23,8 +23,9 @@
+
+ /*
+ * @test
+- * @bug 8032808
++ * @bug 8032808 8072384
+ * @run main/othervm -Xcheck:jni Test
++ * @run main/othervm -Xcheck:jni -Djava.net.preferIPv4Stack=true Test
+ * @run main/othervm/policy=policy.fail -Xcheck:jni Test fail
+ * @run main/othervm/policy=policy.success -Xcheck:jni Test success
+ */
+@@ -100,6 +101,10 @@
+ System.out.println ("Set SO_RCVBUF to 5000\ngetting returns: ");
+ System.out.println (Sockets.getOption(s, StandardSocketOptions.SO_RCVBUF));
+
++ Sockets.setOption(ss, StandardSocketOptions.IP_TOS, 128);
++ System.out.println ("Setting TOS to 128\ngetting returns: ");
++ System.out.println (Sockets.getOption(ss, StandardSocketOptions.IP_TOS));
++
+ try {
+ Sockets.setOption(ss, StandardSocketOptions.TCP_NODELAY, true);
+ throw new RuntimeException("TCP_NODELAY should not be supported for ServerSocket");
+--- ./jdk/test/lib/testlibrary/AssertsTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/lib/testlibrary/AssertsTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -25,6 +25,7 @@
+
+ /* @test
+ * @summary Tests the different assertions in the Assert class
++ * @library /testlibrary
+ */
+ public class AssertsTest {
+ private static class Foo implements Comparable<Foo> {
+--- ./jdk/test/lib/testlibrary/OutputAnalyzerReportingTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/lib/testlibrary/OutputAnalyzerReportingTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -27,6 +27,7 @@
+ * @summary Test the OutputAnalyzer reporting functionality,
+ * such as printing additional diagnostic info
+ * (exit code, stdout, stderr, command line, etc.)
++ * @library /testlibrary
+ */
+
+ import java.io.ByteArrayOutputStream;
+--- ./jdk/test/lib/testlibrary/OutputAnalyzerTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/lib/testlibrary/OutputAnalyzerTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -24,6 +24,7 @@
+ /*
+ * @test
+ * @summary Test the OutputAnalyzer utility class
++ * @library /testlibrary
+ */
+
+ import jdk.testlibrary.OutputAnalyzer;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/lib/testlibrary/jdk/testlibrary/LockFreeLogManager.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,90 @@
++/*
++ * Copyright (c) 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.
++ */
++
++package jdk.testlibrary;
++
++import java.util.Collection;
++import java.util.Formatter;
++import java.util.Map;
++import java.util.concurrent.ConcurrentHashMap;
++import java.util.concurrent.ConcurrentLinkedQueue;
++import java.util.concurrent.atomic.AtomicInteger;
++import java.util.stream.Collectors;
++
++/**
++ * A log manager designed specifically to allow collecting ordered log messages
++ * in a multi-threaded environment without involving any kind of locking.
++ * <p>
++ * It is particularly useful in situations when one needs to assert various
++ * details about the tested thread state or the locks it hold while also wanting
++ * to produce diagnostic log messages.
++ * <p>
++ * The log manager does not provide any guarantees about the completness of the
++ * logs written from different threads - it is up to the caller to make sure
++ * {@code toString()} method is called only when all the activity has ceased
++ * and the per-thread logs contain all the necessary data.
++ *
++ * @author Jaroslav Bachorik
++ **/
++public class LockFreeLogManager {
++ private final AtomicInteger logCntr = new AtomicInteger(0);
++ private final Collection<Map<Integer, String>> allRecords = new ConcurrentLinkedQueue<>();
++ private final ThreadLocal<Map<Integer, String>> records = new ThreadLocal<Map<Integer, String>>() {
++ @Override
++ protected Map<Integer, String> initialValue() {
++ Map<Integer, String> m = new ConcurrentHashMap<>();
++ allRecords.add(m);
++ return m;
++ }
++
++ };
++
++ /**
++ * Log a message
++ * @param format Message format
++ * @param params Message parameters
++ */
++ public void log(String format, Object ... params) {
++ int id = logCntr.getAndIncrement();
++ try (Formatter formatter = new Formatter()) {
++ records.get().put(id, formatter.format(format, params).toString());
++ }
++ }
++
++ /**
++ * Will generate an aggregated log of chronologically ordered messages.
++ * <p>
++ * Make sure that you call this method only when all the related threads
++ * have finished; otherwise you might get incomplete data.
++ *
++ * @return An aggregated log of chronologically ordered messages
++ */
++ @Override
++ public String toString() {
++ return allRecords.stream()
++ .flatMap(m->m.entrySet().stream())
++ .sorted((l, r)->l.getKey().compareTo(r.getKey()))
++ .map(e->e.getValue())
++ .collect(Collectors.joining());
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/lib/testlibrary/jdk/testlibrary/OSInfo.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,191 @@
++/*
++ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.testlibrary;
++
++import java.security.PrivilegedAction;
++import java.util.HashMap;
++import java.util.Map;
++
++import static jdk.testlibrary.OSInfo.OSType.*;
++
++/**
++ * @author Pavel Porvatov
++ * copied to testlibrary by yan
++ */
++public class OSInfo {
++ public static enum OSType {
++ WINDOWS,
++ LINUX,
++ SOLARIS,
++ MACOSX,
++ UNKNOWN
++ }
++
++ /*
++ The map windowsVersionMap must contain all windows version constants except WINDOWS_UNKNOWN,
++ and so the method getWindowsVersion() will return the constant for known OS.
++ It allows compare objects by "==" instead of "equals".
++ */
++ public static final WindowsVersion WINDOWS_UNKNOWN = new WindowsVersion(-1, -1);
++ public static final WindowsVersion WINDOWS_95 = new WindowsVersion(4, 0);
++ public static final WindowsVersion WINDOWS_98 = new WindowsVersion(4, 10);
++ public static final WindowsVersion WINDOWS_ME = new WindowsVersion(4, 90);
++ public static final WindowsVersion WINDOWS_2000 = new WindowsVersion(5, 0);
++ public static final WindowsVersion WINDOWS_XP = new WindowsVersion(5, 1);
++ public static final WindowsVersion WINDOWS_2003 = new WindowsVersion(5, 2);
++ public static final WindowsVersion WINDOWS_VISTA = new WindowsVersion(6, 0);
++
++ private static final String OS_NAME = "os.name";
++ private static final String OS_VERSION = "os.version";
++
++ private final static Map<String, WindowsVersion> windowsVersionMap = new HashMap<String, OSInfo.WindowsVersion>();
++
++ static {
++ windowsVersionMap.put(WINDOWS_95.toString(), WINDOWS_95);
++ windowsVersionMap.put(WINDOWS_98.toString(), WINDOWS_98);
++ windowsVersionMap.put(WINDOWS_ME.toString(), WINDOWS_ME);
++ windowsVersionMap.put(WINDOWS_2000.toString(), WINDOWS_2000);
++ windowsVersionMap.put(WINDOWS_XP.toString(), WINDOWS_XP);
++ windowsVersionMap.put(WINDOWS_2003.toString(), WINDOWS_2003);
++ windowsVersionMap.put(WINDOWS_VISTA.toString(), WINDOWS_VISTA);
++ }
++
++ private static final PrivilegedAction<OSType> osTypeAction = new PrivilegedAction<OSType>() {
++ public OSType run() {
++ return getOSType();
++ }
++ };
++
++ private OSInfo() {
++ // Don't allow to create instances
++ }
++
++ /**
++ * Returns type of operating system.
++ */
++ public static OSType getOSType() throws SecurityException {
++ String osName = System.getProperty(OS_NAME);
++
++ if (osName != null) {
++ if (osName.contains("Windows")) {
++ return WINDOWS;
++ }
++
++ if (osName.contains("Linux")) {
++ return LINUX;
++ }
++
++ if (osName.contains("Solaris") || osName.contains("SunOS")) {
++ return SOLARIS;
++ }
++
++ if (osName.contains("OS X")) {
++ return MACOSX;
++ }
++
++ // determine another OS here
++ }
++
++ return UNKNOWN;
++ }
++
++ public static PrivilegedAction<OSType> getOSTypeAction() {
++ return osTypeAction;
++ }
++
++ public static WindowsVersion getWindowsVersion() throws SecurityException {
++ String osVersion = System.getProperty(OS_VERSION);
++
++ if (osVersion == null) {
++ return WINDOWS_UNKNOWN;
++ }
++
++ synchronized (windowsVersionMap) {
++ WindowsVersion result = windowsVersionMap.get(osVersion);
++
++ if (result == null) {
++ // Try parse version and put object into windowsVersionMap
++ String[] arr = osVersion.split("\\.");
++
++ if (arr.length == 2) {
++ try {
++ result = new WindowsVersion(Integer.parseInt(arr[0]), Integer.parseInt(arr[1]));
++ } catch (NumberFormatException e) {
++ return WINDOWS_UNKNOWN;
++ }
++ } else {
++ return WINDOWS_UNKNOWN;
++ }
++
++ windowsVersionMap.put(osVersion, result);
++ }
++
++ return result;
++ }
++ }
++
++ public static class WindowsVersion implements Comparable<WindowsVersion> {
++ private final int major;
++
++ private final int minor;
++
++ private WindowsVersion(int major, int minor) {
++ this.major = major;
++ this.minor = minor;
++ }
++
++ public int getMajor() {
++ return major;
++ }
++
++ public int getMinor() {
++ return minor;
++ }
++
++ public int compareTo(WindowsVersion o) {
++ int result = major - o.getMajor();
++
++ if (result == 0) {
++ result = minor - o.getMinor();
++ }
++
++ return result;
++ }
++
++ public boolean equals(Object obj) {
++ return obj instanceof WindowsVersion && compareTo((WindowsVersion) obj) == 0;
++ }
++
++ public int hashCode() {
++ return 31 * major + minor;
++ }
++
++ public String toString() {
++ return major + "." + minor;
++ }
++ }
++}
++
+--- ./jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -24,6 +24,8 @@
+ package jdk.testlibrary;
+
+ import java.io.IOException;
++import java.util.ArrayList;
++import java.util.List;
+ import java.util.regex.Matcher;
+ import java.util.regex.Pattern;
+
+@@ -394,4 +396,23 @@
+ public int getExitValue() {
+ return exitValue;
+ }
++
++ /**
++ * Get the contents of the output buffer (stdout and stderr) as list of strings.
++ * Output will be split by system property 'line.separator'.
++ *
++ * @return Contents of the output buffer as list of strings
++ */
++ public List<String> asLines() {
++ return asLines(getOutput());
++ }
++
++ private List<String> asLines(String buffer) {
++ List<String> l = new ArrayList<>();
++ String[] a = buffer.split(Utils.NEW_LINE);
++ for (String string : a) {
++ l.add(string);
++ }
++ return l;
++ }
+ }
+--- ./jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -31,6 +31,7 @@
+ import java.lang.reflect.Field;
+ import java.lang.reflect.Method;
+ import java.util.ArrayList;
++import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.concurrent.CountDownLatch;
+ import java.util.Map;
+@@ -41,6 +42,7 @@
+ import java.util.concurrent.TimeoutException;
+ import java.util.function.Predicate;
+ import java.util.function.Consumer;
++import java.util.stream.Collectors;
+
+ import sun.management.VMManagement;
+
+@@ -374,4 +376,40 @@
+ }
+ return cmd.toString().trim();
+ }
++
++ /**
++ * Executes a process, waits for it to finish, prints the process output
++ * to stdout, and returns the process output.
++ *
++ * The process will have exited before this method returns.
++ *
++ * @param cmds The command line to execute.
++ * @return The {@linkplain OutputAnalyzer} instance wrapping the process.
++ */
++ public static OutputAnalyzer executeCommand(String... cmds)
++ throws Throwable {
++ String cmdLine = Arrays.stream(cmds).collect(Collectors.joining(" "));
++ System.out.println("Command line: [" + cmdLine + "]");
++ OutputAnalyzer analyzer = ProcessTools.executeProcess(cmds);
++ System.out.println(analyzer.getOutput());
++ return analyzer;
++ }
++
++ /**
++ * Executes a process, waits for it to finish, prints the process output
++ * to stdout and returns the process output.
++ *
++ * The process will have exited before this method returns.
++ *
++ * @param pb The ProcessBuilder to execute.
++ * @return The {@linkplain OutputAnalyzer} instance wrapping the process.
++ */
++ public static OutputAnalyzer executeCommand(ProcessBuilder pb)
++ throws Throwable {
++ String cmdLine = pb.command().stream().collect(Collectors.joining(" "));
++ System.out.println("Command line: [" + cmdLine + "]");
++ OutputAnalyzer analyzer = ProcessTools.executeProcess(pb);
++ System.out.println(analyzer.getOutput());
++ return analyzer;
++ }
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/lib/testlibrary/jdk/testlibrary/RandomFactory.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,103 @@
++/*
++ * 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 jdk.testlibrary;
++
++import java.util.Random;
++import java.util.SplittableRandom;
++
++/**
++ * Factory class which generates and prints to STDOUT a long-valued seed
++ * for use in initializing a PRNG. An instance of {@code Random} or
++ * {@code SplittableRandom} may likewise be obtained.
++ */
++public class RandomFactory {
++ /**
++ * Attempt to obtain the seed from the value of the "seed" property.
++ * @return The seed or {@code null} if the "seed" property was not set or
++ * could not be parsed.
++ */
++ private static Long getSystemSeed() {
++ Long seed = null;
++ try {
++ // note that Long.valueOf(null) also throws a
++ // NumberFormatException so if the property is undefined this
++ // will still work correctly
++ seed = Long.valueOf(System.getProperty("seed"));
++ } catch (NumberFormatException e) {
++ // do nothing: seed is still null
++ }
++
++ return seed;
++ }
++
++ /**
++ * Obtain a seed from an independent PRNG.
++ *
++ * @return A random seed.
++ */
++ private static long getRandomSeed() {
++ return new Random().nextLong();
++ }
++
++ /**
++ * Obtain and print to STDOUT a seed appropriate for initializing a PRNG.
++ * If the system property "seed" is set and has value which may be correctly
++ * parsed it is used, otherwise a seed is generated using an independent
++ * PRNG.
++ *
++ * @return The seed.
++ */
++ public static long getSeed() {
++ Long seed = getSystemSeed();
++ if (seed == null) {
++ seed = getRandomSeed();
++ }
++ System.out.println("Seed from RandomFactory = "+seed+"L");
++ return seed;
++ }
++
++ /**
++ * Obtain and print to STDOUT a seed and use it to initialize a new
++ * {@code Random} instance which is returned. If the system
++ * property "seed" is set and has value which may be correctly parsed it
++ * is used, otherwise a seed is generated using an independent PRNG.
++ *
++ * @return The {@code Random} instance.
++ */
++ public static Random getRandom() {
++ return new Random(getSeed());
++ }
++
++ /**
++ * Obtain and print to STDOUT a seed and use it to initialize a new
++ * {@code SplittableRandom} instance which is returned. If the system
++ * property "seed" is set and has value which may be correctly parsed it
++ * is used, otherwise a seed is generated using an independent PRNG.
++ *
++ * @return The {@code SplittableRandom} instance.
++ */
++ public static SplittableRandom getSplittableRandom() {
++ return new SplittableRandom(getSeed());
++ }
++}
+--- ./jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/lib/testlibrary/jdk/testlibrary/Utils.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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,7 @@
+ import java.util.regex.Pattern;
+ import java.util.regex.Matcher;
+ import java.util.concurrent.TimeUnit;
++import java.util.function.Function;
+
+ /**
+ * Common library for various test helper functions.
+@@ -276,4 +277,38 @@
+ public static long adjustTimeout(long tOut) {
+ return Math.round(tOut * Utils.TIMEOUT_FACTOR);
+ }
++
++ /**
++ * Interface same as java.lang.Runnable but with
++ * method {@code run()} able to throw any Throwable.
++ */
++ public static interface ThrowingRunnable {
++ void run() throws Throwable;
++ }
++
++ /**
++ * Filters out an exception that may be thrown by the given
++ * test according to the given filter.
++ *
++ * @param test - method that is invoked and checked for exception.
++ * @param filter - function that checks if the thrown exception matches
++ * criteria given in the filter's implementation.
++ * @return - exception that matches the filter if it has been thrown or
++ * {@code null} otherwise.
++ * @throws Throwable - if test has thrown an exception that does not
++ * match the filter.
++ */
++ public static Throwable filterException(ThrowingRunnable test,
++ Function<Throwable, Boolean> filter) throws Throwable {
++ try {
++ test.run();
++ } catch (Throwable t) {
++ if (filter.apply(t)) {
++ return t;
++ } else {
++ throw t;
++ }
++ }
++ return null;
++ }
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/lib/testlibrary/jsr292/com/oracle/testlibrary/jsr292/CodeCacheOverflowProcessor.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,79 @@
++/*
++ * 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 com.oracle.testlibrary.jsr292;
++
++import jdk.testlibrary.Utils;
++
++/**
++ * Helper class used to catch and process VirtualMachineError with message "Out
++ * of space in CodeCache". Some JSR292 tests run out of code cache size, so code
++ * cache overflows and VME is thrown. This VME is considered as non-critical in
++ * some JSR292 tests, so it should be processed to prevent test failure.
++ */
++public class CodeCacheOverflowProcessor {
++
++ /**
++ * Checks if an instance of Throwable is caused by VirtualMachineError with
++ * message "Out of space in CodeCache". May be used as filter in method
++ * {@code jdk.testlibrary.Utils.filterException}.
++ *
++ * @param t - Throwable to check.
++ * @return true if Throwable is caused by VME, false otherwise.
++ */
++ public static Boolean isThrowableCausedByVME(Throwable t) {
++ Throwable causeOfT = t;
++ do {
++ if (causeOfT instanceof VirtualMachineError
++ && causeOfT.getMessage().matches(".*[Oo]ut of space"
++ + " in CodeCache.*")) {
++ return true;
++ }
++ causeOfT = causeOfT != null ? causeOfT.getCause() : null;
++ } while (causeOfT != null && causeOfT != t);
++ return false;
++ }
++
++ /**
++ * Checks if the given test throws an exception caused by
++ * VirtualMachineError with message "Out of space in CodeCache", and, if VME
++ * takes place, processes it so that no exception is thrown, and prints its
++ * stack trace. If test throws exception not caused by VME, this method just
++ * re-throws this exception.
++ *
++ * @param test - test to check for and process VirtualMachineError.
++ * @return - an exception caused by VME or null
++ * if test has thrown no exception.
++ * @throws Throwable - if test has thrown an exception
++ * that is not caused by VME.
++ */
++ public static Throwable runMHTest(Utils.ThrowingRunnable test) throws Throwable {
++ Throwable t = Utils.filterException(test::run,
++ CodeCacheOverflowProcessor::isThrowableCausedByVME);
++ if (t != null) {
++ System.err.printf("%nNon-critical exception caught becuse of"
++ + " code cache size is not enough to run all test cases.%n%n");
++ t.printStackTrace();
++ }
++ return t;
++ }
++}
+--- ./jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -43,8 +43,6 @@
+
+ import sun.management.AgentConfigurationError;
+
+-import java.security.Security;
+-
+ import util.TestLogger;
+
+ /**
+@@ -135,8 +133,6 @@
+ "com.sun.management.jmxremote.ssl.enabled.protocols";
+ public static final String SSL_NEED_CLIENT_AUTH =
+ "com.sun.management.jmxremote.ssl.need.client.auth";
+- public static final String SSL_CLIENT_ENABLED_CIPHER_SUITES =
+- "javax.rmi.ssl.client.enabledCipherSuites";
+ }
+
+ /**
+@@ -438,7 +434,7 @@
+ }
+
+
+- private void setSslProperties(String clientEnabledCipherSuites) {
++ private void setSslProperties() {
+ final String defaultKeyStore =
+ getDefaultStoreName(DefaultValues.KEYSTORE);
+ final String defaultTrustStore =
+@@ -469,13 +465,6 @@
+ System.setProperty(PropertyNames.TRUSTSTORE_PASSWD,trustword);
+ log.trace("setSslProperties",
+ PropertyNames.TRUSTSTORE_PASSWD+"="+trustword);
+-
+- if (clientEnabledCipherSuites != null) {
+- System.setProperty("javax.rmi.ssl.client.enabledCipherSuites",
+- clientEnabledCipherSuites);
+- } else {
+- System.clearProperty("javax.rmi.ssl.client.enabledCipherSuites");
+- }
+ }
+
+ private void checkSslConfiguration() {
+@@ -528,10 +517,7 @@
+ PropertyNames.SSL_ENABLED_PROTOCOLS + "=" +
+ sslProtocols);
+
+- if (useSsl) {
+- setSslProperties(props.getProperty(
+- PropertyNames.SSL_CLIENT_ENABLED_CIPHER_SUITES));
+- }
++ if (useSsl) setSslProperties();
+ } catch (Exception x) {
+ System.out.println("Failed to setup SSL configuration: " + x);
+ log.debug("checkSslConfiguration",x);
+@@ -885,8 +871,6 @@
+ * exit(1) if the test fails.
+ **/
+ public static void main(String args[]) throws Exception {
+- Security.setProperty("jdk.tls.disabledAlgorithms", "");
+-
+ setupBasePort();
+ RmiBootstrapTest manager = new RmiBootstrapTest();
+ try {
+--- ./jdk/test/sun/management/jmxremote/bootstrap/management_ssltest07_ok.properties.in Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/management/jmxremote/bootstrap/management_ssltest07_ok.properties.in Wed Jul 01 21:53:30 2015 -0700
+@@ -2,4 +2,3 @@
+ com.sun.management.jmxremote.ssl.enabled.protocols=SSLv2Hello,SSLv3,TLSv1
+ com.sun.management.jmxremote.ssl.need.client.auth=true
+ com.sun.management.jmxremote.authenticate=false
+-javax.rmi.ssl.client.enabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_MD5
+--- ./jdk/test/sun/management/jmxremote/bootstrap/management_ssltest11_ok.properties.in Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/management/jmxremote/bootstrap/management_ssltest11_ok.properties.in Wed Jul 01 21:53:30 2015 -0700
+@@ -3,4 +3,3 @@
+ com.sun.management.jmxremote.ssl.need.client.auth=true
+ com.sun.management.jmxremote.ssl.config.file=@TEST-SRC@/jmxremote_ssltest11_ok.ssl
+ com.sun.management.jmxremote.authenticate=false
+-javax.rmi.ssl.client.enabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_MD5
+--- ./jdk/test/sun/nio/cs/CheckHistoricalNames.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/nio/cs/CheckHistoricalNames.java Wed Jul 01 21:53:30 2015 -0700
+@@ -196,6 +196,7 @@
+ checkMappedName("IBM1122", "Cp1122");
+ checkMappedName("IBM1123", "Cp1123");
+ checkMappedName("IBM1124", "Cp1124");
++ checkMappedName("IBM1166", "Cp1166");
+ checkMappedName("IBM01140", "Cp1140");
+ checkMappedName("IBM01141", "Cp1141");
+ checkMappedName("IBM01142", "Cp1142");
+--- ./jdk/test/sun/nio/cs/TestStringCoding.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/nio/cs/TestStringCoding.java Wed Jul 01 21:53:30 2015 -0700
+@@ -22,7 +22,7 @@
+ */
+
+ /* @test
+- @bug 6636323 6636319 7040220 7096080 7183053
++ @bug 6636323 6636319 7040220 7096080 7183053 8080248
+ @summary Test if StringCoding and NIO result have the same de/encoding result
+ * @run main/othervm/timeout=2000 TestStringCoding
+ */
+@@ -199,6 +199,17 @@
+ */
+ }
+
++ //encode mappable surrogates for hkscs
++ if (cs.name().equals("Big5-HKSCS") || cs.name().equals("x-MS950-HKSCS")) {
++ String str = "ab\uD840\uDD0Ccd";
++ byte[] expected = new byte[] {(byte)'a', (byte)'b',
++ (byte)0x88, (byte)0x45, (byte)'c', (byte)'d' };
++ if (!Arrays.equals(str.getBytes(cs.name()), expected) ||
++ !Arrays.equals(str.getBytes(cs), expected)) {
++ throw new RuntimeException("encode(surrogates) failed -> "
++ + cs.name());
++ }
++ }
+ }
+
+ static class PermissiveSecurityManger extends SecurityManager {
+--- ./jdk/test/sun/security/ec/TestEC.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ec/TestEC.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2009, 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
+@@ -59,11 +59,6 @@
+ public class TestEC {
+
+ public static void main(String[] args) throws Exception {
+- // reset security properties to make sure that the algorithms
+- // and keys used in this test are not disabled.
+- Security.setProperty("jdk.tls.disabledAlgorithms", "");
+- Security.setProperty("jdk.certpath.disabledAlgorithms", "");
+-
+ ProvidersSnapshot snapshot = ProvidersSnapshot.create();
+ try {
+ main0(args);
+@@ -73,6 +68,10 @@
+ }
+
+ public static void main0(String[] args) throws Exception {
++ // reset the security property to make sure that the algorithms
++ // and keys used in this test are not disabled.
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
++
+ Provider p = Security.getProvider("SunEC");
+
+ if (p == null) {
+--- ./jdk/test/sun/security/krb5/ConfPlusProp.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/krb5/ConfPlusProp.java Wed Jul 01 21:53:30 2015 -0700
+@@ -35,6 +35,12 @@
+ public class ConfPlusProp {
+ Config config;
+ public static void main(String[] args) throws Exception {
++ if (System.getenv("USERDNSDOMAIN") != null ||
++ System.getenv("LOGONSERVER") != null) {
++ System.out.println(
++ "Looks like a Windows machine in a domain. Skip test.");
++ return;
++ }
+ new ConfPlusProp().run();
+ }
+
+@@ -90,23 +96,8 @@
+ check("R2", "old");
+ check("R3", null);
+
+- int version = System.getProperty("java.version").charAt(2) - '0';
+- System.out.println("JDK version is " + version);
+-
+- // Zero-config is supported since 1.7
+- if (version >= 7) {
+- // Point to a non-existing file
+- System.setProperty("java.security.krb5.conf", "i-am-not-a file");
+- refresh();
+-
+- // Default realm might come from DNS
+- //checkDefaultRealm(null);
+- check("R1", null);
+- check("R2", null);
+- check("R3", null);
+- if (config.get("libdefaults", "forwardable") != null) {
+- throw new Exception("Extra config error");
+- }
++ if (config.get("libdefaults", "forwardable") != null) {
++ throw new Exception("Extra config error");
+ }
+
+ // Add prop
+@@ -136,14 +127,6 @@
+ check("R2", "k2");
+ check("R3", "k2");
+
+- // Point to a non-existing file
+- System.setProperty("java.security.krb5.conf", "i-am-not-a file");
+- refresh();
+-
+- checkDefaultRealm("R2");
+- check("R1", "k2");
+- check("R2", "k2");
+- check("R3", "k2");
+ if (config.get("libdefaults", "forwardable") != null) {
+ throw new Exception("Extra config error");
+ }
+--- ./jdk/test/sun/security/krb5/DnsFallback.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/krb5/DnsFallback.java Wed Jul 01 21:53:30 2015 -0700
+@@ -22,8 +22,7 @@
+ */
+ /*
+ * @test
+- * @bug 6673164
+- * @bug 6552334
++ * @bug 6673164 6552334 8077102
+ * @run main/othervm DnsFallback
+ * @summary fix dns_fallback parse error, and use dns by default
+ */
+@@ -35,47 +34,66 @@
+ public class DnsFallback {
+
+ static Method useDNS_Realm;
++ static Method useDNS_KDC;
+
+ public static void main(String[] args) throws Exception {
+
+ useDNS_Realm = Config.class.getDeclaredMethod("useDNS_Realm");
+ useDNS_Realm.setAccessible(true);
++ useDNS_KDC = Config.class.getDeclaredMethod("useDNS_KDC");
++ useDNS_KDC.setAccessible(true);
+
+
+ // for 6673164
+- check("true", "true", true);
+- check("false", "true", false);
+- check("true", "false", true);
+- check("false", "false", false);
+- check("true", null, true);
+- check("false", null, false);
+- check(null, "true", true);
+- check(null, "false", false);
++ check("true", "true", true, true);
++ check("false", "true", false, false);
++ check("true", "false", true, true);
++ check("false", "false", false, false);
++ check("true", null, true, true);
++ check("false", null, false, false);
++ check(null, "true", true, true);
++ check(null, "false", false, false);
+
+- // for 6552334
+- check(null, null, true);
++ // for 6552334, no longer true
++ //check(null, null, true, true);
++
++ // 8077102
++ check(null, null, false, true);
+ }
+
+- static void check(String realm, String fallback, boolean output)
++ /**
++ * Sets and checks.
++ *
++ * @param u dns_lookup_XXX value set, none if null
++ * @param f dns_fallback value set, none if null
++ * @param r expected useDNS_Realm
++ * @param k expected useDNS_KDC
++ */
++ static void check(String u, String f, boolean r, boolean k)
+ throws Exception {
+
+ try (PrintStream ps =
+ new PrintStream(new FileOutputStream("dnsfallback.conf"))) {
+ ps.println("[libdefaults]\n");
+- if (realm != null) {
+- ps.println("dns_lookup_realm=" + realm);
++ if (u != null) {
++ ps.println("dns_lookup_realm=" + u);
++ ps.println("dns_lookup_kdc=" + u);
+ }
+- if (fallback != null) {
+- ps.println("dns_fallback=" + fallback);
++ if (f != null) {
++ ps.println("dns_fallback=" + f);
+ }
+ }
+
+ System.setProperty("java.security.krb5.conf", "dnsfallback.conf");
+ Config.refresh();
+- System.out.println("Testing " + realm + ", " + fallback + ", " + output);
++ System.out.println("Testing " + u + ", " + f + ", " + r + ", " + k);
+
+- if (!useDNS_Realm.invoke(Config.getInstance()).equals(output)) {
+- throw new Exception("Fail");
++ if (!useDNS_Realm.invoke(Config.getInstance()).equals(r)) {
++ throw new Exception("useDNS_Realm Fail");
++ }
++
++ if (!useDNS_KDC.invoke(Config.getInstance()).equals(k)) {
++ throw new Exception("useDNS_KDC Fail");
+ }
+ }
+ }
+--- ./jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java Wed Jul 01 21:53:30 2015 -0700
+@@ -40,16 +40,28 @@
+ import java.io.File;
+ import java.io.FileOutputStream;
+ import java.io.IOException;
++import java.io.InputStream;
+ import java.io.InputStreamReader;
+ import java.net.HttpURLConnection;
+ import java.net.InetSocketAddress;
+ import java.net.PasswordAuthentication;
+ import java.net.Proxy;
+ import java.net.URL;
+-import java.security.PrivilegedExceptionAction;
++import java.net.URLConnection;
++import java.security.*;
+ import java.util.HashMap;
+ import java.util.Map;
+ import javax.security.auth.Subject;
++import javax.security.auth.callback.Callback;
++import javax.security.auth.callback.CallbackHandler;
++import javax.security.auth.callback.NameCallback;
++import javax.security.auth.callback.PasswordCallback;
++import javax.security.auth.callback.UnsupportedCallbackException;
++import javax.security.auth.login.AppConfigurationEntry;
++import javax.security.auth.login.Configuration;
++import javax.security.auth.login.LoginContext;
++import javax.security.auth.login.LoginException;
++import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
+ import org.ietf.jgss.GSSContext;
+ import org.ietf.jgss.GSSCredential;
+ import org.ietf.jgss.GSSManager;
+@@ -191,7 +203,7 @@
+ proxyUrl = new URL("http://nosuchplace/a/b/c");
+
+ try {
+- Exception e1 = null, e2 = null;
++ Exception e1 = null, e2 = null, e3 = null;
+ try {
+ test6578647();
+ } catch (Exception e) {
+@@ -204,7 +216,14 @@
+ e2 = e;
+ e.printStackTrace();
+ }
+- if (e1 != null || e2 != null) {
++ try {
++ test8077155();
++ } catch (Exception e) {
++ e3 = e;
++ e.printStackTrace();
++ }
++
++ if (e1 != null || e2 != null || e3 != null) {
+ throw new RuntimeException("Test error");
+ }
+ } finally {
+@@ -248,6 +267,121 @@
+ }
+ }
+
++ static void testConnect() {
++ InputStream inputStream = null;
++ try {
++ URL url = webUrl;
++
++ URLConnection conn = url.openConnection();
++ conn.connect();
++ inputStream = conn.getInputStream();
++ byte[] b = new byte[inputStream.available()];
++ for (int j = 0; j < b.length; j++) {
++ b[j] = (byte) inputStream.read();
++ }
++ String s = new String(b);
++ System.out.println("Length: " + s.length());
++ System.out.println(s);
++ } catch (Exception ex) {
++ throw new RuntimeException(ex);
++ } finally {
++ if (inputStream != null) {
++ try {
++ inputStream.close();
++ } catch (IOException e) {
++ e.printStackTrace();
++ }
++ }
++ }
++ }
++
++ static void test8077155() throws Exception {
++ final String username = WEB_USER;
++ final char[] password = WEB_PASS;
++
++ SecurityManager security = new SecurityManager();
++ Policy.setPolicy(new SecurityPolicy());
++ System.setSecurityManager(security);
++
++ CallbackHandler callback = new CallbackHandler() {
++ @Override
++ public void handle(Callback[] pCallbacks) throws IOException, UnsupportedCallbackException {
++ for (Callback cb : pCallbacks) {
++ if (cb instanceof NameCallback) {
++ NameCallback ncb = (NameCallback)cb;
++ ncb.setName(username);
++
++ } else if (cb instanceof PasswordCallback) {
++ PasswordCallback pwdcb = (PasswordCallback) cb;
++ pwdcb.setPassword(password);
++ }
++ }
++ }
++
++ };
++
++ final String jaasConfigName = "oracle.test.kerberos.login";
++ final String krb5LoginModule = "com.sun.security.auth.module.Krb5LoginModule";
++
++ Configuration loginConfig = new Configuration() {
++ @Override
++ public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
++ if (! jaasConfigName.equals(name)) {
++ return new AppConfigurationEntry[0];
++ }
++
++ Map<String, String> options = new HashMap<String, String>();
++ options.put("useTicketCache", Boolean.FALSE.toString());
++ options.put("useKeyTab", Boolean.FALSE.toString());
++
++ return new AppConfigurationEntry[] {
++ new AppConfigurationEntry(krb5LoginModule,
++ LoginModuleControlFlag.REQUIRED,
++ options)
++ };
++ }
++ };
++
++ // oracle context/subject/login
++ LoginContext context = null;
++ try {
++ context = new LoginContext("oracle.test.kerberos.login", null, callback, loginConfig);
++ context.login();
++
++ } catch (LoginException ex) {
++ ex.printStackTrace();
++ throw new RuntimeException(ex);
++ }
++
++
++ Subject subject = context.getSubject();
++
++ final PrivilegedExceptionAction<Object> test_action = new PrivilegedExceptionAction<Object>() {
++ public Object run() throws Exception {
++ testConnect();
++ return null;
++ }
++ };
++
++ System.err.println("\n\nExpecting to succeed when executing with the the logged in subject.");
++
++ try {
++ Subject.doAs(subject, test_action);
++ System.err.println("\n\nConnection succeed when executing with the the logged in subject.");
++ } catch (PrivilegedActionException e) {
++ System.err.println("\n\nFailure unexpected when executing with the the logged in subject.");
++ e.printStackTrace();
++ throw new RuntimeException("Failed to login as subject");
++ }
++
++ try {
++ System.err.println("\n\nExpecting to fail when running with the current user's login.");
++ testConnect();
++ } catch (Exception ex) {
++ System.err.println("\nConnect failed when running with the current user's login:\n" + ex.getMessage());
++ }
++ }
++
+ /**
+ * Creates and starts an HTTP or proxy server that requires
+ * Negotiate authentication.
+@@ -360,3 +494,22 @@
+ }
+ }
+ }
++
++class SecurityPolicy extends Policy {
++
++ private static Permissions perms;
++
++ public SecurityPolicy() {
++ super();
++ if (perms == null) {
++ perms = new Permissions();
++ perms.add(new AllPermission());
++ }
++ }
++
++ @Override
++ public PermissionCollection getPermissions(CodeSource codesource) {
++ return perms;
++ }
++
++}
+--- ./jdk/test/sun/security/krb5/auto/SSL.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/krb5/auto/SSL.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2009, 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
+@@ -39,11 +39,10 @@
+ * @run main/othervm SSL TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5
+ */
+ import java.io.*;
+-import java.net.InetAddress;
+-import java.security.AccessControlException;
+ import java.security.Permission;
+ import javax.net.ssl.*;
+ import java.security.Principal;
++import java.security.Security;
+ import java.util.Date;
+ import java.util.List;
+ import java.util.ArrayList;
+@@ -82,6 +81,9 @@
+ }
+
+ public static void main(String[] args) throws Exception {
++ // reset the security property to make sure that the algorithms
++ // and keys used in this test are not disabled.
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
+
+ krb5Cipher = args[0];
+
+--- ./jdk/test/sun/security/krb5/config/DNS.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/krb5/config/DNS.java Wed Jul 01 21:53:30 2015 -0700
+@@ -23,12 +23,22 @@
+
+ // See dns.sh.
+ import sun.security.krb5.Config;
++import sun.security.krb5.KrbException;
+
+ public class DNS {
+ public static void main(String[] args) throws Exception {
+ System.setProperty("java.security.krb5.conf",
+- System.getProperty("test.src", ".") +"/nothing.conf");
++ System.getProperty("test.src", ".") +"/no-such-file.conf");
+ Config config = Config.getInstance();
++ try {
++ String r = config.getDefaultRealm();
++ throw new Exception("What? There is a default realm " + r + "?");
++ } catch (KrbException ke) {
++ ke.printStackTrace();
++ if (ke.getCause() != null) {
++ throw new Exception("There should be no cause. Won't try DNS");
++ }
++ }
+ String kdcs = config.getKDCList("X");
+ if (!kdcs.equals("a.com.:88 b.com.:99") &&
+ !kdcs.equals("a.com. b.com.:99")) {
+--- ./jdk/test/sun/security/krb5/confplusprop.conf Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/krb5/confplusprop.conf Wed Jul 01 21:53:30 2015 -0700
+@@ -1,7 +1,7 @@
+ [libdefaults]
+ default_realm = R1
+ forwardable = well
+-dns_lookup_realm = false
++dns_lookup_kdc = false
+
+ [realms]
+ R1 = {
+--- ./jdk/test/sun/security/krb5/confplusprop2.conf Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/krb5/confplusprop2.conf Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ [libdefaults]
+-dns_lookup_realm = false
++dns_lookup_kdc = false
+
+ [realms]
+ R1 = {
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/sun/security/mscapi/SmallPrimeExponentP.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,75 @@
++/*
++ * 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 sun.security.tools.keytool.CertAndKeyGen;
++import sun.security.x509.X500Name;
++
++import java.security.KeyStore;
++import java.security.SecureRandom;
++import java.security.cert.X509Certificate;
++import java.security.interfaces.RSAPrivateCrtKey;
++import java.util.HashSet;
++import java.util.Set;
++
++/*
++ * @test
++ * @bug 8023546
++ * @summary sun/security/mscapi/ShortRSAKey1024.sh fails intermittently
++ */
++public class SmallPrimeExponentP {
++
++ public static void main(String argv[]) throws Exception {
++
++ String osName = System.getProperty("os.name");
++ if (!osName.startsWith("Windows")) {
++ System.out.println("Not windows");
++ return;
++ }
++ KeyStore ks = KeyStore.getInstance("Windows-MY");
++ ks.load(null, null);
++ CertAndKeyGen ckg = new CertAndKeyGen("RSA", "SHA1withRSA");
++ ckg.setRandom(new SecureRandom());
++ boolean see63 = false, see65 = false;
++ while (!see63 || !see65) {
++ ckg.generate(1024);
++ RSAPrivateCrtKey k = (RSAPrivateCrtKey) ckg.getPrivateKey();
++ int len = k.getPrimeExponentP().toByteArray().length;
++ if (len == 63 || len == 65) {
++ if (len == 63) {
++ if (see63) continue;
++ else see63 = true;
++ }
++ if (len == 65) {
++ if (see65) continue;
++ else see65 = true;
++ }
++ System.err.print(len);
++ ks.setKeyEntry("anything", k, null, new X509Certificate[]{
++ ckg.getSelfCertificate(new X500Name("CN=Me"), 1000)
++ });
++ }
++ System.err.print('.');
++ }
++ ks.store(null, null);
++ }
++}
+--- ./jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java Wed Jul 01 21:53:30 2015 -0700
+@@ -22,8 +22,8 @@
+ */
+ /**
+ * @test
+- * @bug 6581254 6986789 7196009
+- * @summary Allow '~', '+' and quoted paths in config file
++ * @bug 6581254 6986789 7196009 8062170
++ * @summary Allow '~', '+', and quoted paths in config file
+ * @author Valerie Peng
+ */
+
+@@ -34,7 +34,7 @@
+ public class ConfigShortPath {
+
+ private static final String[] configNames = {
+- "csp.cfg", "cspPlus.cfg", "cspQuotedPath.cfg"
++ "csp.cfg", "cspPlus.cfg", "cspSpace.cfg", "cspQuotedPath.cfg"
+ };
+
+ public static void main(String[] args) throws Exception {
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/sun/security/pkcs11/Provider/cspSpace.cfg Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,5 @@
++showInfo = false
++name = test
++library = C:\pki DLL\x64\acpkcs211.dll
++
++
+--- ./jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2012, 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
+@@ -27,6 +27,7 @@
+ * @summary Verify that the RSA KeyPairGenerator works
+ * @author Andreas Sterbenz
+ * @library ..
++ * @run main/othervm TestKeyPairGenerator
+ */
+
+ import java.io.*;
+--- ./jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -28,7 +28,7 @@
+
+ /*
+ * @test
+- * @bug 6405536
++ * @bug 6405536 8080102
+ * @summary Verify that all ciphersuites work (incl. ECC using NSS crypto)
+ * @author Andreas Sterbenz
+ * @library ..
+@@ -43,20 +43,35 @@
+ private static String[] cmdArgs;
+
+ public static void main(String[] args) throws Exception {
+- // reset security properties to make sure that the algorithms
++ // reset the security property to make sure that the algorithms
+ // and keys used in this test are not disabled.
+ Security.setProperty("jdk.tls.disabledAlgorithms", "");
+- Security.setProperty("jdk.certpath.disabledAlgorithms", "");
+
+ cmdArgs = args;
+ main(new ClientJSSEServerJSSE());
++ // now test without SunEC Provider
++ System.setProperty("testWithoutSunEC", "true");
++ main(new ClientJSSEServerJSSE());
++
+ }
+
+ public void main(Provider p) throws Exception {
++ String testWithoutSunEC = System.getProperty("testWithoutSunEC");
+ if (p.getService("KeyFactory", "EC") == null) {
+ System.out.println("Provider does not support EC, skipping");
+ return;
+ }
++
++
++ if (testWithoutSunEC != null) {
++ Provider sunec = Security.getProvider("SunEC");
++ if (sunec == null) {
++ System.out.println("SunEC provider not present. Skipping test");
++ return;
++ }
++ Security.removeProvider(sunec.getName());
++ }
++
+ Providers.setAt(p, 1);
+ CipherTest.main(new JSSEFactory(), cmdArgs);
+ Security.removeProvider(p.getName());
+--- ./jdk/test/sun/security/pkcs12/StoreSecretKeyTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/pkcs12/StoreSecretKeyTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -23,12 +23,14 @@
+
+ /*
+ * @test
+- * @bug 8005408
++ * @bug 8005408 8079129
+ * @summary KeyStore API enhancements
+ */
+
+ import java.io.*;
+ import java.security.*;
++import java.security.cert.*;
++import java.security.cert.Certificate;
+ import java.util.*;
+ import javax.crypto.*;
+ import javax.crypto.spec.*;
+@@ -39,7 +41,9 @@
+ private final static String DIR = System.getProperty("test.src", ".");
+ private static final char[] PASSWORD = "passphrase".toCharArray();
+ private static final String KEYSTORE = "keystore.p12";
+- private static final String ALIAS = "my secret key";
++ private static final String CERT = DIR + "/trusted.pem";
++ private static final String ALIAS = "my trusted cert";
++ private static final String ALIAS2 = "my secret key";
+
+ public static void main(String[] args) throws Exception {
+
+@@ -56,8 +60,13 @@
+ KeyStore keystore = KeyStore.getInstance("PKCS12");
+ keystore.load(null, null);
+
+- // Set entry
++ // Set trusted certificate entry
++ Certificate cert = loadCertificate(CERT);
+ keystore.setEntry(ALIAS,
++ new KeyStore.TrustedCertificateEntry(cert), null);
++
++ // Set secret key entry
++ keystore.setEntry(ALIAS2,
+ new KeyStore.SecretKeyEntry(generateSecretKey("AES", 128)),
+ new KeyStore.PasswordProtection(PASSWORD));
+
+@@ -73,7 +82,7 @@
+ " entries");
+ }
+
+- KeyStore.Entry entry = keystore.getEntry(ALIAS,
++ KeyStore.Entry entry = keystore.getEntry(ALIAS2,
+ new KeyStore.PasswordProtection(PASSWORD));
+ System.out.println("Retrieved entry: " + entry);
+
+@@ -101,4 +110,14 @@
+ generator.init(size);
+ return generator.generateKey();
+ }
++
++ private static Certificate loadCertificate(String certFile)
++ throws Exception {
++ X509Certificate cert = null;
++ try (FileInputStream certStream = new FileInputStream(certFile)) {
++ CertificateFactory factory =
++ CertificateFactory.getInstance("X.509");
++ return factory.generateCertificate(certStream);
++ }
++ }
+ }
+--- ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/CipherSuiteOrder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/CipherSuiteOrder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2011, 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
+@@ -34,7 +34,7 @@
+ */
+
+ import java.io.*;
+-import java.net.*;
++import java.security.Security;
+ import javax.net.ssl.*;
+
+ public class CipherSuiteOrder {
+@@ -196,6 +196,10 @@
+ volatile Exception clientException = null;
+
+ public static void main(String[] args) throws Exception {
++ // reset the security property to make sure that the algorithms
++ // and keys used in this test are not disabled.
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
++
+ String keyFilename =
+ System.getProperty("test.src", "./") + "/" + pathToStores +
+ "/" + keyStoreFile;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/LengthCheckTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,814 @@
++/*
++ * 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 8044860
++ * @summary Vectors and fixed length fields should be verified
++ * for allowed sizes.
++ * @run main/othervm LengthCheckTest
++ */
++
++/**
++ * A SSLEngine usage example which simplifies the presentation
++ * by removing the I/O and multi-threading concerns.
++ *
++ * The test creates two SSLEngines, simulating a client and server.
++ * The "transport" layer consists two byte buffers: think of them
++ * as directly connected pipes.
++ *
++ * Note, this is a *very* simple example: real code will be much more
++ * involved. For example, different threading and I/O models could be
++ * used, transport mechanisms could close unexpectedly, and so on.
++ *
++ * When this application runs, notice that several messages
++ * (wrap/unwrap) pass before any application data is consumed or
++ * produced. (For more information, please see the SSL/TLS
++ * specifications.) There may several steps for a successful handshake,
++ * so it's typical to see the following series of operations:
++ *
++ * client server message
++ * ====== ====== =======
++ * wrap() ... ClientHello
++ * ... unwrap() ClientHello
++ * ... wrap() ServerHello/Certificate
++ * unwrap() ... ServerHello/Certificate
++ * wrap() ... ClientKeyExchange
++ * wrap() ... ChangeCipherSpec
++ * wrap() ... Finished
++ * ... unwrap() ClientKeyExchange
++ * ... unwrap() ChangeCipherSpec
++ * ... unwrap() Finished
++ * ... wrap() ChangeCipherSpec
++ * ... wrap() Finished
++ * unwrap() ... ChangeCipherSpec
++ * unwrap() ... Finished
++ */
++
++import javax.net.ssl.*;
++import javax.net.ssl.SSLEngineResult.*;
++import java.io.*;
++import java.security.*;
++import java.nio.*;
++import java.util.List;
++import java.util.ArrayList;
++import sun.security.ssl.ProtocolVersion;
++
++public class LengthCheckTest {
++
++ /*
++ * Enables logging of the SSLEngine operations.
++ */
++ private static final boolean logging = true;
++
++ /*
++ * Enables the JSSE system debugging system property:
++ *
++ * -Djavax.net.debug=all
++ *
++ * This gives a lot of low-level information about operations underway,
++ * including specific handshake messages, and might be best examined
++ * after gaining some familiarity with this application.
++ */
++ private static final boolean debug = false;
++ private static final boolean dumpBufs = true;
++
++ private final SSLContext sslc;
++
++ private SSLEngine clientEngine; // client Engine
++ private ByteBuffer clientOut; // write side of clientEngine
++ private ByteBuffer clientIn; // read side of clientEngine
++
++ private SSLEngine serverEngine; // server Engine
++ private ByteBuffer serverOut; // write side of serverEngine
++ private ByteBuffer serverIn; // read side of serverEngine
++
++ private HandshakeTest handshakeTest;
++
++ /*
++ * For data transport, this example uses local ByteBuffers. This
++ * isn't really useful, but the purpose of this example is to show
++ * SSLEngine concepts, not how to do network transport.
++ */
++ private ByteBuffer cTOs; // "reliable" transport client->server
++ private ByteBuffer sTOc; // "reliable" transport server->client
++
++ /*
++ * The following is to set up the keystores.
++ */
++ private static final String pathToStores = "/../../../../../../../etc";
++ private static final String keyStoreFile = "keystore";
++ private static final String trustStoreFile = "truststore";
++ private static final String passwd = "passphrase";
++
++ private static final String keyFilename =
++ System.getProperty("test.src", ".") + "/" + pathToStores +
++ "/" + keyStoreFile;
++ private static final String trustFilename =
++ System.getProperty("test.src", ".") + "/" + pathToStores +
++ "/" + trustStoreFile;
++
++ // Define a few basic TLS record and message types we might need
++ private static final int TLS_RECTYPE_CCS = 0x14;
++ private static final int TLS_RECTYPE_ALERT = 0x15;
++ private static final int TLS_RECTYPE_HANDSHAKE = 0x16;
++ private static final int TLS_RECTYPE_APPDATA = 0x17;
++
++ private static final int TLS_HS_HELLO_REQUEST = 0x00;
++ private static final int TLS_HS_CLIENT_HELLO = 0x01;
++ private static final int TLS_HS_SERVER_HELLO = 0x02;
++ private static final int TLS_HS_CERTIFICATE = 0x0B;
++ private static final int TLS_HS_SERVER_KEY_EXCHG = 0x0C;
++ private static final int TLS_HS_CERT_REQUEST = 0x0D;
++ private static final int TLS_HS_SERVER_HELLO_DONE = 0x0E;
++ private static final int TLS_HS_CERT_VERIFY = 0x0F;
++ private static final int TLS_HS_CLIENT_KEY_EXCHG = 0x10;
++ private static final int TLS_HS_FINISHED = 0x14;
++
++ // We're not going to define all the alert types in TLS, just
++ // the ones we think we'll need to reference by name.
++ private static final int TLS_ALERT_LVL_WARNING = 0x01;
++ private static final int TLS_ALERT_LVL_FATAL = 0x02;
++
++ private static final int TLS_ALERT_UNEXPECTED_MSG = 0x0A;
++ private static final int TLS_ALERT_HANDSHAKE_FAILURE = 0x28;
++ private static final int TLS_ALERT_INTERNAL_ERROR = 0x50;
++
++ public interface HandshakeTest {
++ void execTest() throws Exception;
++ }
++
++ public final HandshakeTest servSendLongID = new HandshakeTest() {
++ @Override
++ public void execTest() throws Exception {
++ boolean gotException = false;
++ SSLEngineResult clientResult; // results from client's last op
++ SSLEngineResult serverResult; // results from server's last op
++
++ log("\n==== Test: Client receives 64-byte session ID ====");
++
++ // Send Client Hello
++ clientResult = clientEngine.wrap(clientOut, cTOs);
++ log("client wrap: ", clientResult);
++ runDelegatedTasks(clientResult, clientEngine);
++ cTOs.flip();
++ dumpByteBuffer("CLIENT-TO-SERVER", cTOs);
++
++ // Server consumes Client Hello
++ serverResult = serverEngine.unwrap(cTOs, serverIn);
++ log("server unwrap: ", serverResult);
++ runDelegatedTasks(serverResult, serverEngine);
++ cTOs.compact();
++
++ // Server generates ServerHello/Cert/Done record
++ serverResult = serverEngine.wrap(serverOut, sTOc);
++ log("server wrap: ", serverResult);
++ runDelegatedTasks(serverResult, serverEngine);
++ sTOc.flip();
++
++ // Intercept the ServerHello messages and instead send
++ // one that has a 64-byte session ID.
++ if (isTlsMessage(sTOc, TLS_RECTYPE_HANDSHAKE,
++ TLS_HS_SERVER_HELLO)) {
++ ArrayList<ByteBuffer> recList = splitRecord(sTOc);
++
++ // Use the original ServerHello as a template to craft one
++ // with a longer-than-allowed session ID.
++ ByteBuffer servHelloBuf =
++ createEvilServerHello(recList.get(0), 64);
++
++ recList.set(0, servHelloBuf);
++
++ // Now send each ByteBuffer (each being a complete
++ // TLS record) into the client-side unwrap.
++ for (ByteBuffer bBuf : recList) {
++ dumpByteBuffer("SERVER-TO-CLIENT", bBuf);
++ try {
++ clientResult = clientEngine.unwrap(bBuf, clientIn);
++ } catch (SSLProtocolException e) {
++ log("Received expected SSLProtocolException: " + e);
++ gotException = true;
++ }
++ log("client unwrap: ", clientResult);
++ runDelegatedTasks(clientResult, clientEngine);
++ }
++ } else {
++ dumpByteBuffer("SERVER-TO-CLIENT", sTOc);
++ log("client unwrap: ", clientResult);
++ runDelegatedTasks(clientResult, clientEngine);
++ }
++ sTOc.compact();
++
++ // The Client should now send a TLS Alert
++ clientResult = clientEngine.wrap(clientOut, cTOs);
++ log("client wrap: ", clientResult);
++ runDelegatedTasks(clientResult, clientEngine);
++ cTOs.flip();
++ dumpByteBuffer("CLIENT-TO-SERVER", cTOs);
++
++ // At this point we can verify that both an exception
++ // was thrown and the proper action (a TLS alert) was
++ // sent back to the server.
++ if (gotException == false ||
++ !isTlsMessage(cTOs, TLS_RECTYPE_ALERT, TLS_ALERT_LVL_FATAL,
++ TLS_ALERT_INTERNAL_ERROR)) {
++ throw new SSLException(
++ "Client failed to throw Alert:fatal:internal_error");
++ }
++ }
++ };
++
++ public final HandshakeTest clientSendLongID = new HandshakeTest() {
++ @Override
++ public void execTest() throws Exception {
++ boolean gotException = false;
++ SSLEngineResult clientResult; // results from client's last op
++ SSLEngineResult serverResult; // results from server's last op
++
++ log("\n==== Test: Server receives 64-byte session ID ====");
++
++ // Send Client Hello
++ ByteBuffer evilClientHello = createEvilClientHello(64);
++ dumpByteBuffer("CLIENT-TO-SERVER", evilClientHello);
++
++ try {
++ // Server consumes Client Hello
++ serverResult = serverEngine.unwrap(evilClientHello, serverIn);
++ log("server unwrap: ", serverResult);
++ runDelegatedTasks(serverResult, serverEngine);
++ evilClientHello.compact();
++
++ // Under normal circumstances this should be a ServerHello
++ // But should throw an exception instead due to the invalid
++ // session ID.
++ serverResult = serverEngine.wrap(serverOut, sTOc);
++ log("server wrap: ", serverResult);
++ runDelegatedTasks(serverResult, serverEngine);
++ sTOc.flip();
++ dumpByteBuffer("SERVER-TO-CLIENT", sTOc);
++ } catch (SSLProtocolException ssle) {
++ log("Received expected SSLProtocolException: " + ssle);
++ gotException = true;
++ }
++
++ // We expect to see the server generate an alert here
++ serverResult = serverEngine.wrap(serverOut, sTOc);
++ log("server wrap: ", serverResult);
++ runDelegatedTasks(serverResult, serverEngine);
++ sTOc.flip();
++ dumpByteBuffer("SERVER-TO-CLIENT", sTOc);
++
++ // At this point we can verify that both an exception
++ // was thrown and the proper action (a TLS alert) was
++ // sent back to the client.
++ if (gotException == false ||
++ !isTlsMessage(sTOc, TLS_RECTYPE_ALERT, TLS_ALERT_LVL_FATAL,
++ TLS_ALERT_INTERNAL_ERROR)) {
++ throw new SSLException(
++ "Server failed to throw Alert:fatal:internal_error");
++ }
++ }
++ };
++
++
++ /*
++ * Main entry point for this test.
++ */
++ public static void main(String args[]) throws Exception {
++ List<LengthCheckTest> ccsTests = new ArrayList<>();
++
++ if (debug) {
++ System.setProperty("javax.net.debug", "ssl");
++ }
++
++ ccsTests.add(new LengthCheckTest("ServSendLongID"));
++ ccsTests.add(new LengthCheckTest("ClientSendLongID"));
++
++ for (LengthCheckTest test : ccsTests) {
++ test.runTest();
++ }
++
++ System.out.println("Test Passed.");
++ }
++
++ /*
++ * Create an initialized SSLContext to use for these tests.
++ */
++ public LengthCheckTest(String testName) throws Exception {
++
++ KeyStore ks = KeyStore.getInstance("JKS");
++ KeyStore ts = KeyStore.getInstance("JKS");
++
++ char[] passphrase = "passphrase".toCharArray();
++
++ ks.load(new FileInputStream(keyFilename), passphrase);
++ ts.load(new FileInputStream(trustFilename), passphrase);
++
++ KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
++ kmf.init(ks, passphrase);
++
++ TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
++ tmf.init(ts);
++
++ SSLContext sslCtx = SSLContext.getInstance("TLS");
++
++ sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
++
++ sslc = sslCtx;
++
++ switch (testName) {
++ case "ServSendLongID":
++ handshakeTest = servSendLongID;
++ break;
++ case "ClientSendLongID":
++ handshakeTest = clientSendLongID;
++ break;
++ default:
++ throw new IllegalArgumentException("Unknown test name: " +
++ testName);
++ }
++ }
++
++ /*
++ * Run the test.
++ *
++ * Sit in a tight loop, both engines calling wrap/unwrap regardless
++ * of whether data is available or not. We do this until both engines
++ * report back they are closed.
++ *
++ * The main loop handles all of the I/O phases of the SSLEngine's
++ * lifetime:
++ *
++ * initial handshaking
++ * application data transfer
++ * engine closing
++ *
++ * One could easily separate these phases into separate
++ * sections of code.
++ */
++ private void runTest() throws Exception {
++ boolean dataDone = false;
++
++ createSSLEngines();
++ createBuffers();
++
++ handshakeTest.execTest();
++ }
++
++ /*
++ * Using the SSLContext created during object creation,
++ * create/configure the SSLEngines we'll use for this test.
++ */
++ private void createSSLEngines() throws Exception {
++ /*
++ * Configure the serverEngine to act as a server in the SSL/TLS
++ * handshake. Also, require SSL client authentication.
++ */
++ serverEngine = sslc.createSSLEngine();
++ serverEngine.setUseClientMode(false);
++ serverEngine.setNeedClientAuth(false);
++
++ /*
++ * Similar to above, but using client mode instead.
++ */
++ clientEngine = sslc.createSSLEngine("client", 80);
++ clientEngine.setUseClientMode(true);
++
++ // In order to make a test that will be backwards compatible
++ // going back to JDK 5, force the handshake to be TLS 1.0 and
++ // use one of the older cipher suites.
++ clientEngine.setEnabledProtocols(new String[]{"TLSv1"});
++ clientEngine.setEnabledCipherSuites(
++ new String[]{"TLS_RSA_WITH_AES_128_CBC_SHA"});
++ }
++
++ /*
++ * Create and size the buffers appropriately.
++ */
++ private void createBuffers() {
++
++ /*
++ * We'll assume the buffer sizes are the same
++ * between client and server.
++ */
++ SSLSession session = clientEngine.getSession();
++ int appBufferMax = session.getApplicationBufferSize();
++ int netBufferMax = session.getPacketBufferSize();
++
++ /*
++ * We'll make the input buffers a bit bigger than the max needed
++ * size, so that unwrap()s following a successful data transfer
++ * won't generate BUFFER_OVERFLOWS.
++ *
++ * We'll use a mix of direct and indirect ByteBuffers for
++ * tutorial purposes only. In reality, only use direct
++ * ByteBuffers when they give a clear performance enhancement.
++ */
++ clientIn = ByteBuffer.allocate(appBufferMax + 50);
++ serverIn = ByteBuffer.allocate(appBufferMax + 50);
++
++ cTOs = ByteBuffer.allocateDirect(netBufferMax);
++ sTOc = ByteBuffer.allocateDirect(netBufferMax);
++
++ clientOut = ByteBuffer.wrap("Hi Server, I'm Client".getBytes());
++ serverOut = ByteBuffer.wrap("Hello Client, I'm Server".getBytes());
++ }
++
++ /*
++ * If the result indicates that we have outstanding tasks to do,
++ * go ahead and run them in this thread.
++ */
++ private static void runDelegatedTasks(SSLEngineResult result,
++ SSLEngine engine) throws Exception {
++
++ if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) {
++ Runnable runnable;
++ while ((runnable = engine.getDelegatedTask()) != null) {
++ log("\trunning delegated task...");
++ runnable.run();
++ }
++ HandshakeStatus hsStatus = engine.getHandshakeStatus();
++ if (hsStatus == HandshakeStatus.NEED_TASK) {
++ throw new Exception(
++ "handshake shouldn't need additional tasks");
++ }
++ log("\tnew HandshakeStatus: " + hsStatus);
++ }
++ }
++
++ private static boolean isEngineClosed(SSLEngine engine) {
++ return (engine.isOutboundDone() && engine.isInboundDone());
++ }
++
++ /*
++ * Simple check to make sure everything came across as expected.
++ */
++ private static void checkTransfer(ByteBuffer a, ByteBuffer b)
++ throws Exception {
++ a.flip();
++ b.flip();
++
++ if (!a.equals(b)) {
++ throw new Exception("Data didn't transfer cleanly");
++ } else {
++ log("\tData transferred cleanly");
++ }
++
++ a.position(a.limit());
++ b.position(b.limit());
++ a.limit(a.capacity());
++ b.limit(b.capacity());
++ }
++
++ /*
++ * Logging code
++ */
++ private static boolean resultOnce = true;
++
++ private static void log(String str, SSLEngineResult result) {
++ if (!logging) {
++ return;
++ }
++ if (resultOnce) {
++ resultOnce = false;
++ System.out.println("The format of the SSLEngineResult is: \n" +
++ "\t\"getStatus() / getHandshakeStatus()\" +\n" +
++ "\t\"bytesConsumed() / bytesProduced()\"\n");
++ }
++ HandshakeStatus hsStatus = result.getHandshakeStatus();
++ log(str +
++ result.getStatus() + "/" + hsStatus + ", " +
++ result.bytesConsumed() + "/" + result.bytesProduced() +
++ " bytes");
++ if (hsStatus == HandshakeStatus.FINISHED) {
++ log("\t...ready for application data");
++ }
++ }
++
++ private static void log(String str) {
++ if (logging) {
++ System.out.println(str);
++ }
++ }
++
++ /**
++ * Split a record consisting of multiple TLS handshake messages
++ * into individual TLS records, each one in a ByteBuffer of its own.
++ *
++ * @param tlsRecord A ByteBuffer containing the tls record data.
++ * The position of the buffer should be at the first byte
++ * in the TLS record data.
++ *
++ * @return An ArrayList consisting of one or more ByteBuffers. Each
++ * ByteBuffer will contain a single TLS record with one message.
++ * That message will be taken from the input record. The order
++ * of the messages in the ArrayList will be the same as they
++ * were in the input record.
++ */
++ private ArrayList<ByteBuffer> splitRecord(ByteBuffer tlsRecord) {
++ SSLSession session = clientEngine.getSession();
++ int netBufferMax = session.getPacketBufferSize();
++ ArrayList<ByteBuffer> recordList = new ArrayList<>();
++
++ if (tlsRecord.hasRemaining()) {
++ int type = Byte.toUnsignedInt(tlsRecord.get());
++ byte ver_major = tlsRecord.get();
++ byte ver_minor = tlsRecord.get();
++ int recLen = Short.toUnsignedInt(tlsRecord.getShort());
++ byte[] newMsgData = null;
++ while (tlsRecord.hasRemaining()) {
++ ByteBuffer newRecord = ByteBuffer.allocateDirect(netBufferMax);
++ switch (type) {
++ case TLS_RECTYPE_CCS:
++ case TLS_RECTYPE_ALERT:
++ case TLS_RECTYPE_APPDATA:
++ // None of our tests have multiple non-handshake
++ // messages coalesced into a single record.
++ break;
++ case TLS_RECTYPE_HANDSHAKE:
++ newMsgData = getHandshakeMessage(tlsRecord);
++ break;
++ }
++
++ // Put a new TLS record on the destination ByteBuffer
++ newRecord.put((byte)type);
++ newRecord.put(ver_major);
++ newRecord.put(ver_minor);
++ newRecord.putShort((short)newMsgData.length);
++
++ // Now add the message content itself and attach to the
++ // returned ArrayList
++ newRecord.put(newMsgData);
++ newRecord.flip();
++ recordList.add(newRecord);
++ }
++ }
++
++ return recordList;
++ }
++
++ private static ByteBuffer createEvilClientHello(int sessIdLen) {
++ ByteBuffer newRecord = ByteBuffer.allocateDirect(4096);
++
++ // Lengths will initially be place holders until we determine the
++ // finished length of the ByteBuffer. Then we'll go back and scribble
++ // in the correct lengths.
++
++ newRecord.put((byte)TLS_RECTYPE_HANDSHAKE); // Record type
++ newRecord.putShort((short)0x0301); // Protocol (TLS 1.0)
++ newRecord.putShort((short)0); // Length place holder
++
++ newRecord.putInt(TLS_HS_CLIENT_HELLO << 24); // HS type and length
++ newRecord.putShort((short)0x0301);
++ newRecord.putInt((int)(System.currentTimeMillis() / 1000));
++ SecureRandom sr = new SecureRandom();
++ byte[] randBuf = new byte[28];
++ sr.nextBytes(randBuf);
++ newRecord.put(randBuf); // Client Random
++ newRecord.put((byte)sessIdLen); // Session ID length
++ if (sessIdLen > 0) {
++ byte[] sessId = new byte[sessIdLen];
++ sr.nextBytes(sessId);
++ newRecord.put(sessId); // Session ID
++ }
++ newRecord.putShort((short)2); // 2 bytes of ciphers
++ newRecord.putShort((short)0x002F); // TLS_RSA_AES_CBC_SHA
++ newRecord.putShort((short)0x0100); // only null compression
++ newRecord.putShort((short)5); // 5 bytes of extensions
++ newRecord.putShort((short)0xFF01); // Renegotiation info
++ newRecord.putShort((short)1);
++ newRecord.put((byte)0); // No reneg info exts
++
++ // Go back and fill in the correct length values for the record
++ // and handshake message headers.
++ int recordLength = newRecord.position();
++ newRecord.putShort(3, (short)(recordLength - 5));
++ int newTypeAndLen = (newRecord.getInt(5) & 0xFF000000) |
++ ((recordLength - 9) & 0x00FFFFFF);
++ newRecord.putInt(5, newTypeAndLen);
++
++ newRecord.flip();
++ return newRecord;
++ }
++
++ private static ByteBuffer createEvilServerHello(ByteBuffer origHello,
++ int newSessIdLen) {
++ if (newSessIdLen < 0 || newSessIdLen > Byte.MAX_VALUE) {
++ throw new RuntimeException("Length must be 0 <= X <= 127");
++ }
++
++ ByteBuffer newRecord = ByteBuffer.allocateDirect(4096);
++ // Copy the bytes from the old hello to the new up to the session ID
++ // field. We will go back later and fill in a new length field in
++ // the record header. This includes the record header (5 bytes), the
++ // Handshake message header (4 bytes), protocol version (2 bytes),
++ // and the random (32 bytes).
++ ByteBuffer scratchBuffer = origHello.slice();
++ scratchBuffer.limit(43);
++ newRecord.put(scratchBuffer);
++
++ // Advance the position in the originial hello buffer past the
++ // session ID.
++ origHello.position(43);
++ int origIDLen = Byte.toUnsignedInt(origHello.get());
++ if (origIDLen > 0) {
++ // Skip over the session ID
++ origHello.position(origHello.position() + origIDLen);
++ }
++
++ // Now add our own sessionID to the new record
++ SecureRandom sr = new SecureRandom();
++ byte[] sessId = new byte[newSessIdLen];
++ sr.nextBytes(sessId);
++ newRecord.put((byte)newSessIdLen);
++ newRecord.put(sessId);
++
++ // Create another slice in the original buffer, based on the position
++ // past the session ID. Copy the remaining bytes into the new
++ // hello buffer. Then go back and fix up the length
++ newRecord.put(origHello.slice());
++
++ // Go back and fill in the correct length values for the record
++ // and handshake message headers.
++ int recordLength = newRecord.position();
++ newRecord.putShort(3, (short)(recordLength - 5));
++ int newTypeAndLen = (newRecord.getInt(5) & 0xFF000000) |
++ ((recordLength - 9) & 0x00FFFFFF);
++ newRecord.putInt(5, newTypeAndLen);
++
++ newRecord.flip();
++ return newRecord;
++ }
++
++ /**
++ * Look at an incoming TLS record and see if it is the desired
++ * record type, and where appropriate the correct subtype.
++ *
++ * @param srcRecord The input TLS record to be evaluated. This
++ * method will only look at the leading message if multiple
++ * TLS handshake messages are coalesced into a single record.
++ * @param reqRecType The requested TLS record type
++ * @param recParams Zero or more integer sub type fields. For CCS
++ * and ApplicationData, no params are used. For handshake records,
++ * one value corresponding to the HandshakeType is required.
++ * For Alerts, two values corresponding to AlertLevel and
++ * AlertDescription are necessary.
++ *
++ * @return true if the proper handshake message is the first one
++ * in the input record, false otherwise.
++ */
++ private boolean isTlsMessage(ByteBuffer srcRecord, int reqRecType,
++ int... recParams) {
++ boolean foundMsg = false;
++
++ if (srcRecord.hasRemaining()) {
++ srcRecord.mark();
++
++ // Grab the fields from the TLS Record
++ int recordType = Byte.toUnsignedInt(srcRecord.get());
++ byte ver_major = srcRecord.get();
++ byte ver_minor = srcRecord.get();
++ int recLen = Short.toUnsignedInt(srcRecord.getShort());
++
++ if (recordType == reqRecType) {
++ // For any zero-length recParams, making sure the requested
++ // type is sufficient.
++ if (recParams.length == 0) {
++ foundMsg = true;
++ } else {
++ switch (recordType) {
++ case TLS_RECTYPE_CCS:
++ case TLS_RECTYPE_APPDATA:
++ // We really shouldn't find ourselves here, but
++ // if someone asked for these types and had more
++ // recParams we can ignore them.
++ foundMsg = true;
++ break;
++ case TLS_RECTYPE_ALERT:
++ // Needs two params, AlertLevel and AlertDescription
++ if (recParams.length != 2) {
++ throw new RuntimeException(
++ "Test for Alert requires level and desc.");
++ } else {
++ int level = Byte.toUnsignedInt(srcRecord.get());
++ int desc = Byte.toUnsignedInt(srcRecord.get());
++ if (level == recParams[0] &&
++ desc == recParams[1]) {
++ foundMsg = true;
++ }
++ }
++ break;
++ case TLS_RECTYPE_HANDSHAKE:
++ // Needs one parameter, HandshakeType
++ if (recParams.length != 1) {
++ throw new RuntimeException(
++ "Test for Handshake requires only HS type");
++ } else {
++ // Go into the first handhshake message in the
++ // record and grab the handshake message header.
++ // All we need to do is parse out the leading
++ // byte.
++ int msgHdr = srcRecord.getInt();
++ int msgType = (msgHdr >> 24) & 0x000000FF;
++ if (msgType == recParams[0]) {
++ foundMsg = true;
++ }
++ }
++ break;
++ }
++ }
++ }
++
++ srcRecord.reset();
++ }
++
++ return foundMsg;
++ }
++
++ private byte[] getHandshakeMessage(ByteBuffer srcRecord) {
++ // At the start of this routine, the position should be lined up
++ // at the first byte of a handshake message. Mark this location
++ // so we can return to it after reading the type and length.
++ srcRecord.mark();
++ int msgHdr = srcRecord.getInt();
++ int type = (msgHdr >> 24) & 0x000000FF;
++ int length = msgHdr & 0x00FFFFFF;
++
++ // Create a byte array that has enough space for the handshake
++ // message header and body.
++ byte[] data = new byte[length + 4];
++ srcRecord.reset();
++ srcRecord.get(data, 0, length + 4);
++
++ return (data);
++ }
++
++ /**
++ * Hex-dumps a ByteBuffer to stdout.
++ */
++ private static void dumpByteBuffer(String header, ByteBuffer bBuf) {
++ if (dumpBufs == false) {
++ return;
++ }
++
++ int bufLen = bBuf.remaining();
++ if (bufLen > 0) {
++ bBuf.mark();
++
++ // We expect the position of the buffer to be at the
++ // beginning of a TLS record. Get the type, version and length.
++ int type = Byte.toUnsignedInt(bBuf.get());
++ int ver_major = Byte.toUnsignedInt(bBuf.get());
++ int ver_minor = Byte.toUnsignedInt(bBuf.get());
++ int recLen = Short.toUnsignedInt(bBuf.getShort());
++ ProtocolVersion pv = ProtocolVersion.valueOf(ver_major, ver_minor);
++
++ log("===== " + header + " (" + tlsRecType(type) + " / " +
++ pv + " / " + bufLen + " bytes) =====");
++ bBuf.reset();
++ for (int i = 0; i < bufLen; i++) {
++ if (i != 0 && i % 16 == 0) {
++ System.out.print("\n");
++ }
++ System.out.format("%02X ", bBuf.get(i));
++ }
++ log("\n===============================================");
++ bBuf.reset();
++ }
++ }
++
++ private static String tlsRecType(int type) {
++ switch (type) {
++ case 20:
++ return "Change Cipher Spec";
++ case 21:
++ return "Alert";
++ case 22:
++ return "Handshake";
++ case 23:
++ return "Application Data";
++ default:
++ return ("Unknown (" + type + ")");
++ }
++ }
++}
+--- ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java Wed Jul 01 21:53:30 2015 -0700
+@@ -100,13 +100,12 @@
+ import javax.net.ssl.SSLEngineResult.*;
+ import java.io.*;
+ import java.nio.*;
+-import java.security.Security;
+ import java.security.KeyStore;
+ import java.security.KeyFactory;
++import java.security.Security;
+ import java.security.cert.Certificate;
+ import java.security.cert.CertificateFactory;
+ import java.security.spec.PKCS8EncodedKeySpec;
+-import java.security.spec.*;
+ import java.security.interfaces.*;
+ import java.util.Base64;
+
+@@ -378,10 +377,9 @@
+ }
+
+ public static void main(String args[]) throws Exception {
+- // reset security properties to make sure that the algorithms
++ // reset the security property to make sure that the algorithms
+ // and keys used in this test are not disabled.
+ Security.setProperty("jdk.tls.disabledAlgorithms", "");
+- Security.setProperty("jdk.certpath.disabledAlgorithms", "");
+
+ if (args.length != 4) {
+ System.out.println(
+--- ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/AnonCipherWithWantClientAuth.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ServerHandshaker/AnonCipherWithWantClientAuth.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2001, 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
+@@ -21,11 +21,6 @@
+ * questions.
+ */
+
+-//
+-// SunJSSE does not support dynamic system properties, no way to re-use
+-// system properties in samevm/agentvm mode.
+-//
+-
+ /*
+ * @test
+ * @bug 4392475
+@@ -39,7 +34,6 @@
+ import java.io.*;
+ import java.net.*;
+ import javax.net.ssl.*;
+-import java.security.Security;
+
+ public class AnonCipherWithWantClientAuth {
+
+@@ -162,11 +156,6 @@
+ volatile Exception clientException = null;
+
+ public static void main(String[] args) throws Exception {
+- // reset security properties to make sure that the algorithms
+- // and keys used in this test are not disabled.
+- Security.setProperty("jdk.tls.disabledAlgorithms", "");
+- Security.setProperty("jdk.certpath.disabledAlgorithms", "");
+-
+ String keyFilename =
+ System.getProperty("test.src", "./") + "/" + pathToStores +
+ "/" + keyStoreFile;
+--- ./jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/CheckStatus.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/CheckStatus.java Wed Jul 01 21:53:30 2015 -0700
+@@ -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
+@@ -622,6 +622,9 @@
+ }
+
+ public static void main(String args[]) throws Exception {
++ // reset the security property to make sure that the algorithms
++ // and keys used in this test are not disabled.
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
+
+ CheckStatus cs;
+
+--- ./jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/ConnectionTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/ConnectionTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -33,6 +33,8 @@
+ * The code could certainly be tightened up a lot.
+ *
+ * @author Brad Wetmore
++ *
++ * @run main/othervm ConnectionTest
+ */
+
+ import javax.net.ssl.*;
+@@ -79,9 +81,6 @@
+ ssle1.setEnabledCipherSuites(new String [] {
+ "SSL_RSA_WITH_RC4_128_MD5"});
+
+- ssle2.setEnabledCipherSuites(new String [] {
+- "SSL_RSA_WITH_RC4_128_MD5"});
+-
+ createBuffers();
+ }
+
+@@ -672,6 +671,10 @@
+ }
+
+ public static void main(String args[]) throws Exception {
++ // reset the security property to make sure that the algorithms
++ // and keys used in this test are not disabled.
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
++
+ ConnectionTest ct = new ConnectionTest();
+ ct.test();
+ }
+--- ./jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargeBufs.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargeBufs.java Wed Jul 01 21:53:30 2015 -0700
+@@ -92,7 +92,6 @@
+ createSSLEngines();
+
+ System.out.println("Using " + cipher);
+- ssle1.setEnabledCipherSuites(new String [] { cipher });
+ ssle2.setEnabledCipherSuites(new String [] { cipher });
+
+ createBuffers();
+@@ -180,6 +179,9 @@
+ }
+
+ public static void main(String args[]) throws Exception {
++ // reset the security property to make sure that the algorithms
++ // and keys used in this test are not disabled.
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
+
+ LargeBufs test;
+
+--- ./jdk/test/sun/security/ssl/javax/net/ssl/SSLParameters/UseCipherSuitesOrder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/javax/net/ssl/SSLParameters/UseCipherSuitesOrder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -31,11 +31,11 @@
+ * @bug 7188657
+ * @summary There should be a way to reorder the JSSE ciphers
+ * @run main/othervm UseCipherSuitesOrder
+- * TLS_RSA_WITH_AES_128_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA
++ * TLS_RSA_WITH_AES_128_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA
+ */
+
+ import java.io.*;
+-import java.net.*;
++import java.security.Security;
+ import javax.net.ssl.*;
+ import java.util.Arrays;
+
+@@ -195,6 +195,10 @@
+ volatile Exception clientException = null;
+
+ public static void main(String[] args) throws Exception {
++ // reset the security property to make sure that the algorithms
++ // and keys used in this test are not disabled.
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
++
+ // parse the arguments
+ parseArguments(args);
+
+--- ./jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java Wed Jul 01 21:53:30 2015 -0700
+@@ -36,7 +36,7 @@
+ */
+
+ import java.io.*;
+-import java.net.*;
++import java.security.Security;
+ import javax.net.ssl.*;
+
+ public class GenericStreamCipher {
+@@ -93,10 +93,6 @@
+ SSLServerSocket sslServerSocket =
+ (SSLServerSocket) sslssf.createServerSocket(serverPort);
+
+- // enable a stream cipher
+- sslServerSocket.setEnabledCipherSuites(
+- new String[] {"SSL_RSA_WITH_RC4_128_MD5"});
+-
+ serverPort = sslServerSocket.getLocalPort();
+
+ /*
+@@ -164,6 +160,10 @@
+ volatile Exception clientException = null;
+
+ public static void main(String[] args) throws Exception {
++ // reset the security property to make sure that the algorithms
++ // and keys used in this test are not disabled.
++ Security.setProperty("jdk.tls.disabledAlgorithms", "");
++
+ String keyFilename =
+ System.getProperty("test.src", ".") + "/" + pathToStores +
+ "/" + keyStoreFile;
+--- ./jdk/test/sun/security/ssl/sanity/ciphersuites/CipherSuitesInOrder.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/sanity/ciphersuites/CipherSuitesInOrder.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -93,6 +93,13 @@
+ "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
+ "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
+
++ "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
++ "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
++ "SSL_RSA_WITH_RC4_128_SHA",
++ "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
++ "TLS_ECDH_RSA_WITH_RC4_128_SHA",
++ "SSL_RSA_WITH_RC4_128_MD5",
++
+ "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
+
+ "TLS_DH_anon_WITH_AES_256_GCM_SHA384",
+@@ -106,16 +113,8 @@
+ "TLS_DH_anon_WITH_AES_128_CBC_SHA",
+ "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
+ "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
+-
+- "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+- "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
+- "SSL_RSA_WITH_RC4_128_SHA",
+- "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
+- "TLS_ECDH_RSA_WITH_RC4_128_SHA",
+- "SSL_RSA_WITH_RC4_128_MD5",
+ "TLS_ECDH_anon_WITH_RC4_128_SHA",
+ "SSL_DH_anon_WITH_RC4_128_MD5",
+-
+ "SSL_RSA_WITH_DES_CBC_SHA",
+ "SSL_DHE_RSA_WITH_DES_CBC_SHA",
+ "SSL_DHE_DSS_WITH_DES_CBC_SHA",
+--- ./jdk/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 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
+@@ -34,10 +34,9 @@
+ public class ClientJSSEServerJSSE {
+
+ public static void main(String[] args) throws Exception {
+- // reset security properties to make sure that the algorithms
++ // reset the security property to make sure that the algorithms
+ // and keys used in this test are not disabled.
+ Security.setProperty("jdk.tls.disabledAlgorithms", "");
+- Security.setProperty("jdk.certpath.disabledAlgorithms", "");
+
+ CipherTest.main(new JSSEFactory(), args);
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/sun/security/tools/keytool/ExportPrivateKeyNoPwd.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,57 @@
++/*
++ * Copyright (c) 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 java.security.*;
++
++/*
++ * Export a private key from the named keychain entry without supplying a
++ * password. See JDK-8062264.
++ *
++ * NOTE: Keychain access controls must already have been lowered to permit
++ * the target entry to be accessed.
++ */
++public class ExportPrivateKeyNoPwd {
++
++ public static final void main(String[] args) throws Exception {
++
++ if (args.length != 1) {
++ throw new Exception(
++ "ExportPrivateKeyNoPwd: must supply name of a keystore entry");
++ }
++ String alias = args[0];
++
++ KeyStore ks = KeyStore.getInstance("KeychainStore");
++ System.out.println("ExportPrivateKeyNoPwd: loading keychains...");
++ ks.load(null, null);
++
++ System.out.println("ExportPrivateKeyNoPwd: exporting key...");
++ Key key = ks.getKey(alias, null);
++ if (key instanceof PrivateKey) {
++ System.out.println("ExportPrivateKeyNoPwd: exported " +
++ key.getAlgorithm() + " private key from '" + alias + "'");
++ } else {
++ throw new Exception("Error exporting private key from keychain");
++ }
++ }
++}
++
+--- ./jdk/test/sun/security/tools/keytool/ListKeychainStore.sh Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/security/tools/keytool/ListKeychainStore.sh Wed Jul 01 21:53:30 2015 -0700
+@@ -22,7 +22,7 @@
+ #
+
+ # @test
+-# @bug 7133495 8041740
++# @bug 7133495 8041740 8062264
+ # @summary [macosx] KeyChain KeyStore implementation retrieves only one private key entry
+
+ if [ "${TESTJAVA}" = "" ] ; then
+@@ -30,6 +30,9 @@
+ TESTJAVA=`dirname $JAVAC_CMD`/..
+ fi
+
++if [ "${TESTSRC}" = "" ] ; then
++ TESTSRC="."
++fi
+ if [ "${TESTCLASSES}" = "" ] ; then
+ TESTCLASSES=`pwd`
+ fi
+@@ -59,10 +62,6 @@
+ COUNT=`$KEYTOOL -list | grep PrivateKeyEntry | wc -l`
+ echo "Found $COUNT private key entries in the Keychain keystores"
+
+-if [ $COUNT -gt 1 ]; then
+- exit 0
+-fi
+-
+ # Create a temporary PKCS12 keystore containing 3 public/private keypairs
+
+ RESULT=`$CLEANUP_P12`
+@@ -107,8 +106,9 @@
+ echo "Unlocked the temporary keychain"
+
+ # Import the keypairs from the PKCS12 keystore into the keychain
++# (The '-A' option is used to lower the temporary keychain's access controls)
+
+-security import $TEMPORARY_P12 -k $TEMPORARY_KC -f pkcs12 -P $PWD
++security import $TEMPORARY_P12 -k $TEMPORARY_KC -f pkcs12 -P $PWD -A
+ if [ $? -ne 0 ]; then
+ echo "Error: cannot import keypairs from PKCS12 keystore into the keychain"
+ RESULT=`$CLEANUP_P12`
+@@ -128,26 +128,39 @@
+
+ # Recount the number of private key entries in the Keychain keystores
+
+-COUNT=`$KEYTOOL -list | grep PrivateKeyEntry | wc -l`
+-echo "Found $COUNT private key entries in the Keychain keystore"
+-if [ $COUNT -lt 3 ]; then
+- echo "Error: expected >2 private key entries in the Keychain keystores"
++RECOUNT=`$KEYTOOL -list | grep PrivateKeyEntry | wc -l`
++echo "Found $RECOUNT private key entries in the Keychain keystore"
++if [ $RECOUNT -lt `expr $COUNT + 3` ]; then
++ echo "Error: expected >$COUNT private key entries in the Keychain keystores"
+ RESULT=`$CLEANUP_P12`
+ RESULT=`$CLEANUP_KC`
+ exit 5
+ fi
+
++# Export a private key from the keychain (without supplying a password)
++# Access controls have already been lowered (see 'security import ... -A' above)
++
++${TESTJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/ExportPrivateKeyNoPwd.java || exit 6
++echo | ${TESTJAVA}/bin/java ${TESTVMOPTS} ExportPrivateKeyNoPwd x
++if [ $? -ne 0 ]; then
++ echo "Error exporting private key from the temporary keychain"
++ RESULT=`$CLEANUP_P12`
++ RESULT=`$CLEANUP_KC`
++ exit 6
++fi
++echo "Exported a private key from the temporary keychain"
++
+ RESULT=`$CLEANUP_P12`
+ if [ $? -ne 0 ]; then
+ echo "Error: cannot remove the temporary PKCS12 keystore"
+- exit 6
++ exit 7
+ fi
+ echo "Removed the temporary PKCS12 keystore"
+
+ RESULT=`$CLEANUP_KC`
+ if [ $? -ne 0 ]; then
+ echo "Error: cannot remove the temporary keychain"
+- exit 7
++ exit 8
+ fi
+ echo "Removed the temporary keychain"
+
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/sun/text/resources/Format/Bug8074791.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,69 @@
++/*
++ * 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 8074791
++ * @summary Make sure that Finnish month names are correct in formatted text.
++ */
++
++import java.text.DateFormat;
++import java.text.SimpleDateFormat;
++import java.util.Date;
++import java.util.GregorianCalendar;
++import java.util.Locale;
++import static java.text.DateFormat.*;
++import static java.util.Calendar.JANUARY;
++
++public class Bug8074791 {
++ private static Locale FINNISH = new Locale("fi");
++ private static String JAN_FORMAT = "tammikuuta";
++ private static String JAN_STANDALONE = "tammikuu";
++
++ public static void main(String[] arg) {
++ int errors = 0;
++
++ DateFormat df = DateFormat.getDateInstance(LONG, FINNISH);
++ Date jan20 = new GregorianCalendar(2015, JANUARY, 20).getTime();
++ String str = df.format(jan20).toString();
++ // Extract the month name (locale data dependent)
++ String month = str.replaceAll(".+\\s([a-z]+)\\s\\d+$", "$1");
++ if (!month.equals(JAN_FORMAT)) {
++ errors++;
++ System.err.println("wrong format month name: got '" + month
++ + "', expected '" + JAN_FORMAT + "'");
++ }
++
++ SimpleDateFormat sdf = new SimpleDateFormat("LLLL", FINNISH); // stand-alone month name
++ month = sdf.format(jan20);
++ if (!month.equals(JAN_STANDALONE)) {
++ errors++;
++ System.err.println("wrong stand-alone month name: got '" + month
++ + "', expected '" + JAN_STANDALONE + "'");
++ }
++
++ if (errors > 0) {
++ throw new RuntimeException();
++ }
++ }
++}
+--- ./jdk/test/sun/text/resources/LocaleData Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/text/resources/LocaleData Wed Jul 01 21:53:30 2015 -0700
+@@ -5417,11 +5417,13 @@
+ FormatData/en_SG/TimePatterns/1=h:mm:ss a z
+ FormatData/en_SG/TimePatterns/2=h:mm:ss a
+ FormatData/en_SG/TimePatterns/3=h:mm a
+-FormatData/en_SG/DatePatterns/0=EEEE, MMMM d, yyyy
+-FormatData/en_SG/DatePatterns/1=MMMM d, yyyy
+-FormatData/en_SG/DatePatterns/2=MMM d, yyyy
+-FormatData/en_SG/DatePatterns/3=M/d/yy
+ FormatData/en_SG/DateTimePatterns/0={1} {0}
++# bug# 8080774
++# Day should precede month for all date formats in en_SG - CLDR 27.0.0
++FormatData/en_SG/DatePatterns/0=EEEE, d MMMM, yyyy
++FormatData/en_SG/DatePatterns/1=d MMMM, yyyy
++FormatData/en_SG/DatePatterns/2=d MMM, yyyy
++FormatData/en_SG/DatePatterns/3=d/M/yy
+ # Use approved data
+ FormatData/ms/Eras/0=BCE
+ FormatData/ms/Eras/1=CE
+@@ -8276,3 +8278,12 @@
+ FormatData/zh/MonthNarrows/10=11
+ FormatData/zh/MonthNarrows/11=12
+ FormatData/zh/MonthNarrows/12=
++
++# bug #8074791
++FormatData/fi/DatePatterns/0=d. MMMM yyyy
++FormatData/fi/DatePatterns/1=d. MMMM yyyy
++FormatData/fi/DatePatterns/2=d.M.yyyy
++FormatData/fi/DatePatterns/3=d.M.yyyy
++
++# bug #8075173
++FormatData/de/standalone.MonthAbbreviations/2=M\u00e4r
+--- ./jdk/test/sun/text/resources/LocaleDataTest.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/text/resources/LocaleDataTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2007, 2014, 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
+@@ -36,7 +36,7 @@
+ * 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
+ * 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509
+ * 7114053 7074882 7040556 8013836 8021121 6192407 6931564 8027695 7090826
+- * 8017142 8037343 8055222 8042126
++ * 8017142 8037343 8055222 8042126 8074791 8075173 8080774
+ * @summary Verify locale data
+ *
+ */
+--- ./jdk/test/sun/util/calendar/zi/Rule.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/util/calendar/zi/Rule.java Wed Jul 01 21:53:30 2015 -0700
+@@ -126,6 +126,14 @@
+ });
+ rules.clear();
+ for (int i = 0; i < n; i++) {
++ if (i != 0 && recs[i -1].getSave() == recs[i].getSave()) {
++ // we have two recs back to back with same saving for the same year.
++ if (recs[i].isLastRule()) {
++ continue;
++ } else if (recs[i - 1].isLastRule()) {
++ rules.remove(rules.size() - 1);
++ }
++ }
+ rules.add(recs[i]);
+ }
+ return rules;
+--- ./jdk/test/sun/util/calendar/zi/tzdata/VERSION Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/util/calendar/zi/tzdata/VERSION Wed Jul 01 21:53:30 2015 -0700
+@@ -21,4 +21,4 @@
+ # or visit www.oracle.com if you need additional information or have any
+ # questions.
+ #
+-tzdata2015d
++tzdata2015e
+--- ./jdk/test/sun/util/calendar/zi/tzdata/africa Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/util/calendar/zi/tzdata/africa Wed Jul 01 21:53:30 2015 -0700
+@@ -361,9 +361,10 @@
+ # time this summer, and carry out studies on the possibility of canceling the
+ # practice altogether in future years."
+ #
+-# From Paul Eggert (2015-04-20):
+-# For now, assume DST will be canceled. Any resumption would likely
+-# use different rules anyway.
++# From Paul Eggert (2015-04-24):
++# Yesterday the office of Egyptian President El-Sisi announced his
++# decision to abandon DST permanently. See Ahram Online 2015-04-24.
++# http://english.ahram.org.eg/NewsContent/1/64/128509/Egypt/Politics-/Sisi-cancels-daylight-saving-time-in-Egypt.aspx
+
+ Rule Egypt 2008 only - Aug lastThu 24:00 0 -
+ Rule Egypt 2009 only - Aug 20 24:00 0 -
+@@ -810,20 +811,41 @@
+ # will resume again at 02:00 on Saturday, August 2, 2014....
+ # http://www.mmsp.gov.ma/fr/actualites.aspx?id=586
+
+-# From Paul Eggert (2014-06-05):
+-# For now, guess that later spring and fall transitions will use 2014's rules,
++# From Milamber (2015-06-08):
++# (Google Translation) The hour will thus be delayed 60 minutes
++# Sunday, June 14 at 3:00, the ministry said in a statement, adding
++# that the time will be advanced again 60 minutes Sunday, July 19,
++# 2015 at 2:00. The move comes under 2.12.126 Decree of 26 Jumada I
++# 1433 (18 April 2012) and the decision of the Head of Government of
++# 16 N. 3-29-15 Chaaban 1435 (4 June 2015).
++# Source (french):
++# http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
++#
++# From Milamber (2015-06-09):
++# http://www.mmsp.gov.ma/fr/actualites.aspx?id=863
++#
++# From Michael Deckers (2015-06-09):
++# [The gov.ma announcement] would (probably) make the switch on 2015-07-19 go
++# from 03:00 to 04:00 rather than from 02:00 to 03:00, as in the patch....
++# I think the patch is correct and the quoted text is wrong; the text in
++# <http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
++# with the patch.
++
++# From Paul Eggert (2015-06-08):
++# For now, guess that later spring and fall transitions will use 2015's rules,
+ # and guess that Morocco will switch to standard time at 03:00 the last
+-# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after
+-# Ramadan. To implement this, transition dates for 2015 through 2037 were
++# Sunday before Ramadan, and back to DST at 02:00 the first Sunday after
++# Ramadan. To implement this, transition dates for 2016 through 2037 were
+ # determined by running the following program under GNU Emacs 24.3, with the
+ # results integrated by hand into the table below.
+-# (let ((islamic-year 1436))
++# (let ((islamic-year 1437))
++# (require 'cal-islam)
+ # (while (< islamic-year 1460)
+ # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
+ # (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
+-# (saturday 6))
+-# (while (/= saturday (mod (setq a (1- a)) 7)))
+-# (while (/= saturday (mod b 7))
++# (sunday 0))
++# (while (/= sunday (mod (setq a (1- a)) 7)))
++# (while (/= sunday (mod b 7))
+ # (setq b (1+ b)))
+ # (setq a (calendar-gregorian-from-absolute a))
+ # (setq b (calendar-gregorian-from-absolute b))
+@@ -867,32 +889,30 @@
+ Rule Morocco 2013 only - Jul 7 3:00 0 -
+ Rule Morocco 2013 only - Aug 10 2:00 1:00 S
+ Rule Morocco 2013 max - Oct lastSun 3:00 0 -
+-Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S
++Rule Morocco 2014 2021 - Mar lastSun 2:00 1:00 S
+ Rule Morocco 2014 only - Jun 28 3:00 0 -
+ Rule Morocco 2014 only - Aug 2 2:00 1:00 S
+-Rule Morocco 2015 only - Jun 13 3:00 0 -
+-Rule Morocco 2015 only - Jul 18 2:00 1:00 S
+-Rule Morocco 2016 only - Jun 4 3:00 0 -
+-Rule Morocco 2016 only - Jul 9 2:00 1:00 S
+-Rule Morocco 2017 only - May 20 3:00 0 -
+-Rule Morocco 2017 only - Jul 1 2:00 1:00 S
+-Rule Morocco 2018 only - May 12 3:00 0 -
+-Rule Morocco 2018 only - Jun 16 2:00 1:00 S
+-Rule Morocco 2019 only - May 4 3:00 0 -
+-Rule Morocco 2019 only - Jun 8 2:00 1:00 S
+-Rule Morocco 2020 only - Apr 18 3:00 0 -
+-Rule Morocco 2020 only - May 30 2:00 1:00 S
+-Rule Morocco 2021 only - Apr 10 3:00 0 -
+-Rule Morocco 2021 only - May 15 2:00 1:00 S
+-Rule Morocco 2022 only - Apr 2 3:00 0 -
+-Rule Morocco 2022 only - May 7 2:00 1:00 S
+-Rule Morocco 2023 only - Apr 22 2:00 1:00 S
+-Rule Morocco 2024 only - Apr 13 2:00 1:00 S
+-Rule Morocco 2025 only - Apr 5 2:00 1:00 S
++Rule Morocco 2015 only - Jun 14 3:00 0 -
++Rule Morocco 2015 only - Jul 19 2:00 1:00 S
++Rule Morocco 2016 only - Jun 5 3:00 0 -
++Rule Morocco 2016 only - Jul 10 2:00 1:00 S
++Rule Morocco 2017 only - May 21 3:00 0 -
++Rule Morocco 2017 only - Jul 2 2:00 1:00 S
++Rule Morocco 2018 only - May 13 3:00 0 -
++Rule Morocco 2018 only - Jun 17 2:00 1:00 S
++Rule Morocco 2019 only - May 5 3:00 0 -
++Rule Morocco 2019 only - Jun 9 2:00 1:00 S
++Rule Morocco 2020 only - Apr 19 3:00 0 -
++Rule Morocco 2020 only - May 24 2:00 1:00 S
++Rule Morocco 2021 only - Apr 11 3:00 0 -
++Rule Morocco 2021 only - May 16 2:00 1:00 S
++Rule Morocco 2022 only - May 8 2:00 1:00 S
++Rule Morocco 2023 only - Apr 23 2:00 1:00 S
++Rule Morocco 2024 only - Apr 14 2:00 1:00 S
++Rule Morocco 2025 only - Apr 6 2:00 1:00 S
+ Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S
+-Rule Morocco 2035 only - Oct 27 3:00 0 -
+-Rule Morocco 2036 only - Oct 18 3:00 0 -
+-Rule Morocco 2037 only - Oct 10 3:00 0 -
++Rule Morocco 2036 only - Oct 19 3:00 0 -
++Rule Morocco 2037 only - Oct 4 3:00 0 -
+
+ # Zone NAME GMTOFF RULES FORMAT [UNTIL]
+ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
+--- ./jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab Wed Jul 01 21:53:30 2015 -0700
+@@ -26,11 +26,10 @@
+ # This file is in the public domain, so clarified as of
+ # 2009-05-17 by Arthur David Olson.
+ #
+-# From Paul Eggert (2014-07-18):
++# From Paul Eggert (2015-05-02):
+ # This file contains a table of two-letter country codes. Columns are
+ # separated by a single tab. Lines beginning with '#' are comments.
+-# Although all text currently uses ASCII encoding, this is planned to
+-# change to UTF-8 soon. The columns of the table are as follows:
++# All text uses UTF-8 encoding. The columns of the table are as follows:
+ #
+ # 1. ISO 3166-1 alpha-2 country code, current as of
+ # ISO 3166-1 Newsletter VI-16 (2013-07-11). See: Updates on ISO 3166
+@@ -61,7 +60,7 @@
+ AT Austria
+ AU Australia
+ AW Aruba
+-AX Aaland Islands
++AX Ã…land Islands
+ AZ Azerbaijan
+ BA Bosnia & Herzegovina
+ BB Barbados
+@@ -90,7 +89,7 @@
+ CF Central African Rep.
+ CG Congo (Rep.)
+ CH Switzerland
+-CI Cote d'Ivoire
++CI Côte d'Ivoire
+ CK Cook Islands
+ CL Chile
+ CM Cameroon
+@@ -234,7 +233,7 @@
+ PW Palau
+ PY Paraguay
+ QA Qatar
+-RE Reunion
++RE Réunion
+ RO Romania
+ RS Serbia
+ RU Russia
+--- ./jdk/test/sun/util/calendar/zi/tzdata/northamerica Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/util/calendar/zi/tzdata/northamerica Wed Jul 01 21:53:30 2015 -0700
+@@ -2684,7 +2684,17 @@
+ -4:00 US A%sT
+
+ # Cayman Is
+-# See America/Panama.
++
++# From Paul Eggert (2015-05-15):
++# The Cayman government has decided to introduce DST in 2016, the idea being
++# to keep in sync with New York. The legislation hasn't passed but the change
++# seems quite likely. See: Meade B. Cayman 27.
++# http://www.cayman27.com.ky/2015/05/15/clock-ticks-toward-daylight-saving-time-in-cayman
++
++Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
++ -5:07:11 - KMT 1912 Feb # Kingston Mean Time
++ -5:00 - EST 2016
++ -5:00 US E%sT
+
+ # Costa Rica
+
+@@ -3207,7 +3217,6 @@
+ Zone America/Panama -5:18:08 - LMT 1890
+ -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time
+ -5:00 - EST
+-Link America/Panama America/Cayman
+
+ # Puerto Rico
+ # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
+--- ./jdk/test/sun/util/calendar/zi/tzdata/southamerica Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/sun/util/calendar/zi/tzdata/southamerica Wed Jul 01 21:53:30 2015 -0700
+@@ -53,7 +53,7 @@
+ # I suggest the use of _Summer time_ instead of the more cumbersome
+ # _daylight-saving time_. _Summer time_ seems to be in general use
+ # in Europe and South America.
+-# -- E O Cutler, _New York Times_ (1937-02-14), quoted in
++# -- E O Cutler, _New York Times_ (1937-02-14), quoted in
+ # H L Mencken, _The American Language: Supplement I_ (1960), p 466
+ #
+ # Earlier editions of these tables also used the North American style
+--- ./jdk/test/tools/launcher/Arrrghs.java Tue Jun 02 13:49:09 2015 +0300
++++ ./jdk/test/tools/launcher/Arrrghs.java Wed Jul 01 21:53:30 2015 -0700
+@@ -24,7 +24,7 @@
+ /**
+ * @test
+ * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938
+- * 6894719 6968053 7151434 7146424 8007333
++ * 6894719 6968053 7151434 7146424 8007333 8077822
+ * @summary Argument parsing validation.
+ * @compile -XDignore.symbol.file Arrrghs.java
+ * @run main/othervm Arrrghs
+@@ -431,6 +431,16 @@
+ throw new RuntimeException("Error: compiling java wildcards");
+ }
+
++ // test if javac (the command) can compile *.java with a vmoption
++ tr = doExec(javacCmd, "-cp", ".",
++ "-J-showversion", "-J-Dsomeproperty=foo",
++ libDir.getName() + File.separator + "*.java");
++ if (!tr.isOK()) {
++ System.out.println(tr);
++ throw new RuntimeException("Error: compiling java wildcards with vmoptions");
++ }
++
++
+ // use the jar cmd to create jars using the ? wildcard
+ File jarFoo = new File(libDir, "Foo.jar");
+ tr = doExec(jarCmd, "cvf", jarFoo.getAbsolutePath(), "lib" + File.separator + "F?o.class");
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./jdk/test/tools/pack200/DefaultTimeZoneTest.java Wed Jul 01 21:53:30 2015 -0700
+@@ -0,0 +1,159 @@
++/*
++ * 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.File;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.io.OutputStream;
++import java.util.TimeZone;
++import java.util.concurrent.CountDownLatch;
++import java.util.jar.JarFile;
++import java.util.jar.JarOutputStream;
++import java.util.jar.Pack200;
++
++/*
++ * @test
++ * @bug 8066985
++ * @summary multithreading packing/unpacking files can result in Timezone set to UTC
++ * @compile -XDignore.symbol.file Utils.java DefaultTimeZoneTest.java
++ * @run main/othervm DefaultTimeZoneTest
++ * @author mcherkas
++ */
++
++
++public class DefaultTimeZoneTest {
++
++ private static final TimeZone tz = TimeZone.getTimeZone("Europe/Moscow");
++ private static final int INIT_THREAD_COUNT = Math.min(4, Runtime.getRuntime().availableProcessors());
++ private static final int MAX_THREAD_COUNT = 4 * INIT_THREAD_COUNT;
++ private static final long MINUTE = 60 * 1000;
++
++ private static class NoOpOutputStream extends OutputStream {
++ @Override
++ public void write(int b) throws IOException {
++ // no op
++ }
++ }
++
++ static class PackAction implements Runnable {
++ private Pack200.Packer packer = Pack200.newPacker();
++ private JarFile jarFile;
++
++ PackAction() throws IOException {
++ jarFile = new JarFile(new File("golden.jar"));
++ }
++
++ @Override
++ public void run() {
++ try {
++ packer.pack(jarFile, new NoOpOutputStream());
++ } catch (IOException e) {
++ throw new RuntimeException(e);
++ }
++ }
++ }
++
++ static class UnpackAction implements Runnable {
++ private Pack200.Unpacker unpacker = Pack200.newUnpacker();
++ private JarOutputStream jos;
++ private File packedJar = new File("golden.pack");
++
++ UnpackAction() throws IOException {
++ jos = new JarOutputStream(new NoOpOutputStream());
++ }
++
++ @Override
++ public void run() {
++ try {
++ unpacker.unpack(packedJar, jos);
++ } catch (IOException e) {
++ throw new RuntimeException(e);
++ } finally {
++ try {
++ jos.close();
++ } catch (IOException e) {
++ throw new RuntimeException(e);
++ }
++ }
++ }
++ };
++
++ public static void test(final Class<? extends Runnable> runnableClass) throws InterruptedException {
++ for (int i = INIT_THREAD_COUNT; i <= MAX_THREAD_COUNT; i*=2) {
++ final CountDownLatch startLatch = new CountDownLatch(i);
++ final CountDownLatch doneLatch = new CountDownLatch(i);
++ for (int j = 0; j < i; j++) {
++ new Thread() {
++ @Override
++ public void run() {
++ try {
++ Runnable r = runnableClass.newInstance();
++ startLatch.countDown();
++ startLatch.await();
++ r.run();
++ } catch (Exception e) {
++ throw new RuntimeException(e);
++ } finally {
++ doneLatch.countDown();
++ }
++ }
++ }.start();
++ }
++ doneLatch.await();
++
++ if(!TimeZone.getDefault().equals(tz)) {
++ throw new RuntimeException("FAIL: default time zone was changed");
++ }
++ }
++ }
++
++ public static void main(String args[]) throws IOException, InterruptedException {
++ TimeZone.setDefault(tz);
++
++ // make a local copy of our test file
++ File srcFile = Utils.locateJar("golden.jar");
++ final File goldenFile = new File("golden.jar");
++ Utils.copyFile(srcFile, goldenFile);
++
++ // created packed file
++ final JarFile goldenJarFile = new JarFile(goldenFile);
++ final File packFile = new File("golden.pack");
++ Utils.pack(goldenJarFile, packFile);
++
++ // before test let's unpack golden pack to warm up
++ // a native unpacker. That allow us to avoid JDK-8080438
++ UnpackAction unpackAction = new UnpackAction();
++ unpackAction.run();
++
++ long startTime = System.currentTimeMillis();
++ while(System.currentTimeMillis() - startTime < MINUTE) {
++ // test packer
++ test(PackAction.class);
++
++ // test unpacker
++ test(UnpackAction.class);
++ }
++
++ Utils.cleanup();
++ }
++}
+--- ./langtools/.hgtags Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/.hgtags Wed Jul 01 21:54:20 2015 -0700
+@@ -352,7 +352,6 @@
+ 7a34ec7bb1c831e82ac88da578a028572b676260 jdk8u31-b13
+ b813a76f10911ac8db2c775e52b29f36ab0005f4 jdk8u31-b31
+ 8dc0c7e42d90c9f323582b742a7f228bad57b124 jdk8u31-b32
+-f75e26a5c3acc1ca9f5035dbfc4a40710d354dff jdk8u31-b33
+ d231957fe3103e790465fcf058fb8cb33bbc4c4e jdk8u40-b00
+ bf89a471779d13a9407f7d1c86f7716258bc4aa6 jdk8u40-b01
+ 0b6cc4ea670f5d17b56c088f202869bdbb80a5ce jdk8u40-b02
+@@ -381,8 +380,6 @@
+ 991141080b2078e67179ff307a5051e59431762c jdk8u40-b25
+ 2904142783dd0a9e12195a84c7dcdb3d8278b1b1 jdk8u40-b26
+ 83eca922346e27ec42645e9630c04fbaec5eaf0f jdk8u40-b27
+-d727ca30ce3c1b97ed9acd7380f8e4cf41813ffa jdk8u40-b31
+-cc9fc1abb5aeffe2b6123c392a5c602a0ba75368 jdk8u40-b32
+ dbae37f50c43453f7d6f22d96adc8b5b6cd1e90d jdk8u45-b00
+ 244e6dc772877dfae6286530f58e11a210a48a3c jdk8u45-b01
+ 401ec76887623a29d3f868f9f9b18b42838d2e92 jdk8u45-b02
+@@ -398,22 +395,26 @@
+ 4f89bbda7b4532b9f6eeee8c41b7a3b38570ae93 jdk8u45-b12
+ 5ce022bca792453a7efedaed419a9d763d7a9fc3 jdk8u45-b13
+ 847af465a5425e2caa1f1d7a09efec3b3f31b323 jdk8u45-b14
+-ebe1e9d17713e45d157b48b9a31c5c2d077c7970 jdk8u45-b15
+-10fae8059bb210df1624b827a3895ccc455e3c64 jdk8u45-b31
+-e0b8d79bef0c01d77453579b1d36e926892c774b jdk8u45-b32
+-ac1c3ae884633c2ec3881816977023fc44919c66 jdk8u51-b00
+-565167bf31eab083c306dfe11c947e59f4f4ee72 jdk8u51-b01
+-2078bad2444c509a63a539f3bbe1db0f36513c9e jdk8u51-b02
+-30124dd95dc07edf3340c98d5af2a5a254b233b5 jdk8u51-b03
+-9cb46d0c0d5932f1e52f1f06f015a9a5c1190bc2 jdk8u51-b04
+-412ac274e12075e1a774f9b971ce019bcc2e1435 jdk8u51-b05
+-7c65f509ca37c7b45c9762841cc280f572686c70 jdk8u51-b06
+-b40a953cbc4dbcd87e56b9f9e006ab048d0deaa1 jdk8u51-b07
+-858a7fc598d0baa0949a525fadfe912efd15b459 jdk8u51-b08
+-90def0a14f4ad8c99fcda34f2745b6158823e21c jdk8u51-b09
+-417f734de62d74c69e3a8465340bfb3aca60151a jdk8u51-b10
+-8ac1243890d4f427a32320b81ae1be38f81f0c62 jdk8u51-b11
+-f65c2fc549b5e9184da67e3a4f81260c27a88010 jdk8u51-b12
+-3836d67a94a92befedd97064358270c6f0760e5c jdk8u51-b13
+-f3a44c7deac2b23a53f0fd35b22a5d9181291616 jdk8u51-b14
+-f77e8d012e8d6ee3432515ad68dd4f630dd08d56 jdk8u51-b15
++0c514d1fd006fc79d35b670de10c370c8d559db7 jdk8u60-b00
++0ba07c272e33c93377a5d7ed98b9de873cc91980 jdk8u60-b01
++387cf62ce7895dd5e067aaa51faa93d5c078583e jdk8u60-b02
++e59ced856c92d542b6ea11a3a76e2f0a1ffae17a jdk8u60-b03
++27bb4c63fd70483bb63a6d830c595e691bf28a34 jdk8u60-b04
++fc98314cff57ce33bfe3093441804ee0a3446622 jdk8u60-b05
++44d168f9ad16609062e359ee70c6699ec4525b45 jdk8u60-b06
++39b47ffeb7780407561c0b189c3b3ab497868518 jdk8u60-b07
++e5b93c508212e0db2301cc25f5ada882367d1d9b jdk8u60-b08
++76adee5ad278e33675fdd236179fa83f20de5cc3 jdk8u60-b09
++ba758e1ffa6960266e5c619b7771ca779ee5d148 jdk8u60-b10
++ac218cf56d8ba365ba341132933629c10dbfcc06 jdk8u60-b11
++84eb517777335f079ba16c1fa49e7c36f0c444aa jdk8u60-b12
++9df2a728410bb8603d0cc39bdebed8fa93430cb2 jdk8u60-b13
++a136ed2f3041e48f340d891208cc8ac0171a7816 jdk8u60-b14
++248db113703a917fd38b637d384848a5e458ebcc jdk8u60-b15
++ecb7e46b820f293bb644f92bc1af3ede53bceced jdk8u60-b16
++87dcdc1fd75bf827c8a4596b183de7ea73cb75e1 jdk8u60-b17
++e7e42c79861ea1ab7495de5f238c01f98035a8a8 jdk8u60-b18
++0366d7f1faa12ed35694571c151524e0847f05ff jdk8u60-b19
++976523f1d5626bdb6dd47883e2734614b64a5e61 jdk8u60-b20
++97328f3e2aa2c713931edf471270a1208980b963 jdk8u60-b21
++d1febf79ce5ea41fb4b818ffd3589cf923e6de5f jdk8u60-b22
+--- ./langtools/THIRD_PARTY_README Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/THIRD_PARTY_README Wed Jul 01 21:54:20 2015 -0700
+@@ -1140,37 +1140,6 @@
+
+ --------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to JSON, which may be included
+-with JRE 8 & JDK 8.
+-
+---- begin of LICENSE ---
+-
+-Copyright (c) 2002 JSON.org
+-
+-Permission is hereby granted, free of charge, to any person obtaining a copy
+-of this software and associated documentation files (the "Software"), to deal
+-in the Software without restriction, including without limitation the rights
+-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-copies of the Software, and to permit persons to whom the Software is
+-furnished to do so, subject to the following conditions:
+-
+-The above copyright notice and this permission notice shall be included in all
+-copies or substantial portions of the Software.
+-
+-The Software shall be used for Good, not Evil.
+-
+-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-SOFTWARE.
+-
+---- end of LICENSE ---
+-
+--------------------------------------------------------------------------------
+-
+ %% This notice is provided with respect to Kerberos functionality, which
+ which may be included with JRE 8, JDK 8, and OpenJDK 8.
+
+@@ -1250,7 +1219,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libpng 1.6.16, which may be
++%% This notice is provided with respect to libpng 1.6.16, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1370,7 +1339,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libungif 4.1.3, which may be
++%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1399,13 +1368,13 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to Little CMS 2.5, which may be
++%% This notice is provided with respect to Little CMS 2.7, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+
+ Little CMS
+-Copyright (c) 1998-2011 Marti Maria Saguer
++Copyright (c) 1998-2015 Marti Maria Saguer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+--- ./langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Wed Jul 01 21:54:20 2015 -0700
+@@ -113,7 +113,7 @@
+ Content captionSpan;
+ Content span;
+ if (type.isDefaultTab()) {
+- captionSpan = HtmlTree.SPAN(new StringContent(type.text()));
++ captionSpan = HtmlTree.SPAN(configuration.getResource(type.resourceKey()));
+ span = HtmlTree.SPAN(type.tabId(),
+ HtmlStyle.activeTableTab, captionSpan);
+ } else {
+@@ -136,7 +136,7 @@
+ */
+ public Content getMethodTypeLinks(MethodTypes methodType) {
+ String jsShow = "javascript:show(" + methodType.value() +");";
+- HtmlTree link = HtmlTree.A(jsShow, new StringContent(methodType.text()));
++ HtmlTree link = HtmlTree.A(jsShow, configuration.getResource(methodType.resourceKey()));
+ return link;
+ }
+
+--- ./langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Wed Jul 01 21:54:20 2015 -0700
+@@ -471,10 +471,10 @@
+ for (Map.Entry<String,Integer> entry : typeMap.entrySet()) {
+ vars.append(sep);
+ sep = ",";
+- vars.append("\"");
+- vars.append(entry.getKey());
+- vars.append("\":");
+- vars.append(entry.getValue());
++ vars.append("\"")
++ .append(entry.getKey())
++ .append("\":")
++ .append(entry.getValue());
+ }
+ vars.append("};").append(DocletConstants.NL);
+ sep = "";
+@@ -482,11 +482,19 @@
+ for (MethodTypes entry : methodTypes) {
+ vars.append(sep);
+ sep = ",";
+- vars.append(entry.value()).append(":");
+- vars.append("[").append("\"").append(entry.tabId());
+- vars.append("\"").append(sep).append("\"").append(entry.text()).append("\"]");
++ vars.append(entry.value())
++ .append(":")
++ .append("[")
++ .append("\"")
++ .append(entry.tabId())
++ .append("\"")
++ .append(sep)
++ .append("\"")
++ .append(configuration.getText(entry.resourceKey()))
++ .append("\"]");
+ }
+- vars.append("};").append(DocletConstants.NL);
++ vars.append("};")
++ .append(DocletConstants.NL);
+ addStyles(HtmlStyle.altColor, vars);
+ addStyles(HtmlStyle.rowColor, vars);
+ addStyles(HtmlStyle.tableTab, vars);
+--- ./langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Wed Jul 01 21:54:20 2015 -0700
+@@ -150,6 +150,13 @@
+ doclet.Constructors=Constructors
+ doclet.methods=methods
+ doclet.Methods=Methods
++doclet.All_Methods=All Methods
++doclet.Static_Methods=Static Methods
++doclet.Instance_Methods=Instance Methods
++doclet.Abstract_Methods=Abstract Methods
++doclet.Concrete_Methods=Concrete Methods
++doclet.Default_Methods=Default Methods
++doclet.Deprecated_Methods=Deprecated Methods
+ doclet.annotation_type_optional_members=optional elements
+ doclet.Annotation_Type_Optional_Members=Optional Elements
+ doclet.annotation_type_required_members=required elements
+--- ./langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Wed Jul 01 21:54:20 2015 -0700
+@@ -463,7 +463,6 @@
+ .useSummary td, .constantsSummary td, .deprecatedSummary td {
+ text-align:left;
+ padding:0px 0px 12px 10px;
+- width:100%;
+ }
+ th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th,
+ td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{
+@@ -488,6 +487,7 @@
+ font-size:13px;
+ }
+ .overviewSummary td.colFirst, .overviewSummary th.colFirst,
++.useSummary td.colFirst, .useSummary th.colFirst,
+ .overviewSummary td.colOne, .overviewSummary th.colOne,
+ .memberSummary td.colFirst, .memberSummary th.colFirst,
+ .memberSummary td.colOne, .memberSummary th.colOne,
+--- ./langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -31,22 +31,22 @@
+ * @author Bhavesh Patel
+ */
+ public enum MethodTypes {
+- ALL(0xffff, "All Methods", "t0", true),
+- STATIC(0x1, "Static Methods", "t1", false),
+- INSTANCE(0x2, "Instance Methods", "t2", false),
+- ABSTRACT(0x4, "Abstract Methods", "t3", false),
+- CONCRETE(0x8, "Concrete Methods", "t4", false),
+- DEFAULT(0x10, "Default Methods", "t5", false),
+- DEPRECATED(0x20, "Deprecated Methods", "t6", false);
++ ALL(0xffff, "doclet.All_Methods", "t0", true),
++ STATIC(0x1, "doclet.Static_Methods", "t1", false),
++ INSTANCE(0x2, "doclet.Instance_Methods", "t2", false),
++ ABSTRACT(0x4, "doclet.Abstract_Methods", "t3", false),
++ CONCRETE(0x8, "doclet.Concrete_Methods", "t4", false),
++ DEFAULT(0x10, "doclet.Default_Methods", "t5", false),
++ DEPRECATED(0x20, "doclet.Deprecated_Methods", "t6", false);
+
+ private final int value;
+- private final String text;
++ private final String resourceKey;
+ private final String tabId;
+ private final boolean isDefaultTab;
+
+- MethodTypes(int v, String t, String id, boolean dt) {
++ MethodTypes(int v, String k, String id, boolean dt) {
+ this.value = v;
+- this.text = t;
++ this.resourceKey = k;
+ this.tabId = id;
+ this.isDefaultTab = dt;
+ }
+@@ -55,8 +55,8 @@
+ return value;
+ }
+
+- public String text() {
+- return text;
++ public String resourceKey() {
++ return resourceKey;
+ }
+
+ public String tabId() {
+--- ./langtools/src/share/classes/com/sun/tools/javac/code/Scope.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/code/Scope.java Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -241,12 +241,16 @@
+ listeners = listeners.prepend(sl);
+ }
+
+- /** Remove symbol from this scope. Used when an inner class
+- * attribute tells us that the class isn't a package member.
++ /** Remove symbol from this scope.
+ */
+- public void remove(Symbol sym) {
++ public void remove(final Symbol sym) {
+ Assert.check(shared == 0);
+- Entry e = lookup(sym.name);
++ Entry e = lookup(sym.name, new Filter<Symbol>() {
++ @Override
++ public boolean accepts(Symbol candidate) {
++ return candidate == sym;
++ }
++ });
+ if (e.scope == null) return;
+
+ // remove e from table and shadowed list;
+--- ./langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1153,6 +1153,16 @@
+ public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
+ return v.visitClassSymbol(this, p);
+ }
++
++ public void markAbstractIfNeeded(Types types) {
++ if (types.enter.getEnv(this) != null &&
++ (flags() & ENUM) != 0 && types.supertype(type).tsym == types.syms.enumSym &&
++ (flags() & (FINAL | ABSTRACT)) == 0) {
++ if (types.firstUnimplementedAbstract(this) != null)
++ // add the ABSTRACT flag to an enum
++ flags_field |= ABSTRACT;
++ }
++ }
+ }
+
+
+--- ./langtools/src/share/classes/com/sun/tools/javac/code/Types.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/code/Types.java Wed Jul 01 21:54:20 2015 -0700
+@@ -47,6 +47,7 @@
+ import com.sun.tools.javac.util.*;
+ import static com.sun.tools.javac.code.BoundKind.*;
+ import static com.sun.tools.javac.code.Flags.*;
++import static com.sun.tools.javac.code.Kinds.MTH;
+ import static com.sun.tools.javac.code.Scope.*;
+ import static com.sun.tools.javac.code.Symbol.*;
+ import static com.sun.tools.javac.code.Type.*;
+@@ -85,6 +86,7 @@
+ final boolean allowBoxing;
+ final boolean allowCovariantReturns;
+ final boolean allowObjectToPrimitiveCast;
++ final boolean allowDefaultMethods;
+ final ClassReader reader;
+ final Check chk;
+ final Enter enter;
+@@ -111,6 +113,7 @@
+ allowBoxing = source.allowBoxing();
+ allowCovariantReturns = source.allowCovariantReturns();
+ allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast();
++ allowDefaultMethods = source.allowDefaultMethods();
+ reader = ClassReader.instance(context);
+ chk = Check.instance(context);
+ enter = Enter.instance(context);
+@@ -2691,77 +2694,154 @@
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="compute transitive closure of all members in given site">
+- class MembersClosureCache extends SimpleVisitor<CompoundScope, Boolean> {
+-
+- private WeakHashMap<TypeSymbol, Entry> _map =
+- new WeakHashMap<TypeSymbol, Entry>();
+-
+- class Entry {
+- final boolean skipInterfaces;
+- final CompoundScope compoundScope;
+-
+- public Entry(boolean skipInterfaces, CompoundScope compoundScope) {
+- this.skipInterfaces = skipInterfaces;
+- this.compoundScope = compoundScope;
++ class MembersClosureCache extends SimpleVisitor<Scope.CompoundScope, Void> {
++
++ private Map<TypeSymbol, CompoundScope> _map = new HashMap<>();
++
++ Set<TypeSymbol> seenTypes = new HashSet<>();
++
++ class MembersScope extends CompoundScope {
++
++ CompoundScope scope;
++
++ public MembersScope(CompoundScope scope) {
++ super(scope.owner);
++ this.scope = scope;
+ }
+
+- boolean matches(boolean skipInterfaces) {
+- return this.skipInterfaces == skipInterfaces;
++ Filter<Symbol> combine(final Filter<Symbol> sf) {
++ return new Filter<Symbol>() {
++ @Override
++ public boolean accepts(Symbol s) {
++ return !s.owner.isInterface() && (sf == null || sf.accepts(s));
++ }
++ };
++ }
++
++ @Override
++ public Iterable<Symbol> getElements(Filter<Symbol> sf) {
++ return scope.getElements(combine(sf));
++ }
++
++ @Override
++ public Iterable<Symbol> getElementsByName(Name name, Filter<Symbol> sf) {
++ return scope.getElementsByName(name, combine(sf));
++ }
++
++ @Override
++ public int getMark() {
++ return scope.getMark();
+ }
+ }
+
+- List<TypeSymbol> seenTypes = List.nil();
++ CompoundScope nilScope;
+
+ /** members closure visitor methods **/
+
+- public CompoundScope visitType(Type t, Boolean skipInterface) {
+- return null;
++ public CompoundScope visitType(Type t, Void _unused) {
++ if (nilScope == null) {
++ nilScope = new CompoundScope(syms.noSymbol);
++ }
++ return nilScope;
+ }
+
+ @Override
+- public CompoundScope visitClassType(ClassType t, Boolean skipInterface) {
+- if (seenTypes.contains(t.tsym)) {
++ public CompoundScope visitClassType(ClassType t, Void _unused) {
++ if (!seenTypes.add(t.tsym)) {
+ //this is possible when an interface is implemented in multiple
+- //superclasses, or when a classs hierarchy is circular - in such
++ //superclasses, or when a class hierarchy is circular - in such
+ //cases we don't need to recurse (empty scope is returned)
+ return new CompoundScope(t.tsym);
+ }
+ try {
+- seenTypes = seenTypes.prepend(t.tsym);
++ seenTypes.add(t.tsym);
+ ClassSymbol csym = (ClassSymbol)t.tsym;
+- Entry e = _map.get(csym);
+- if (e == null || !e.matches(skipInterface)) {
+- CompoundScope membersClosure = new CompoundScope(csym);
+- if (!skipInterface) {
+- for (Type i : interfaces(t)) {
+- membersClosure.addSubScope(visit(i, skipInterface));
++ CompoundScope membersClosure = _map.get(csym);
++ if (membersClosure == null) {
++ membersClosure = new CompoundScope(csym);
++ for (Type i : interfaces(t)) {
++ membersClosure.addSubScope(visit(i, null));
++ }
++ membersClosure.addSubScope(visit(supertype(t), null));
++ membersClosure.addSubScope(csym.members());
++ _map.put(csym, membersClosure);
++ }
++ return membersClosure;
++ }
++ finally {
++ seenTypes.remove(t.tsym);
++ }
++ }
++
++ @Override
++ public CompoundScope visitTypeVar(TypeVar t, Void _unused) {
++ return visit(t.getUpperBound(), null);
++ }
++ }
++
++ private MembersClosureCache membersCache = new MembersClosureCache();
++
++ public CompoundScope membersClosure(Type site, boolean skipInterface) {
++ CompoundScope cs = membersCache.visit(site, null);
++ if (cs == null)
++ Assert.error("type " + site);
++ return skipInterface ? membersCache.new MembersScope(cs) : cs;
++ }
++ // </editor-fold>
++
++
++ /** Return first abstract member of class `sym'.
++ */
++ public MethodSymbol firstUnimplementedAbstract(ClassSymbol sym) {
++ try {
++ return firstUnimplementedAbstractImpl(sym, sym);
++ } catch (CompletionFailure ex) {
++ chk.completionError(enter.getEnv(sym).tree.pos(), ex);
++ return null;
++ }
++ }
++ //where:
++ private MethodSymbol firstUnimplementedAbstractImpl(ClassSymbol impl, ClassSymbol c) {
++ MethodSymbol undef = null;
++ // Do not bother to search in classes that are not abstract,
++ // since they cannot have abstract members.
++ if (c == impl || (c.flags() & (ABSTRACT | INTERFACE)) != 0) {
++ Scope s = c.members();
++ for (Scope.Entry e = s.elems;
++ undef == null && e != null;
++ e = e.sibling) {
++ if (e.sym.kind == MTH &&
++ (e.sym.flags() & (ABSTRACT|IPROXY|DEFAULT)) == ABSTRACT) {
++ MethodSymbol absmeth = (MethodSymbol)e.sym;
++ MethodSymbol implmeth = absmeth.implementation(impl, this, true);
++ if (implmeth == null || implmeth == absmeth) {
++ //look for default implementations
++ if (allowDefaultMethods) {
++ MethodSymbol prov = interfaceCandidates(impl.type, absmeth).head;
++ if (prov != null && prov.overrides(absmeth, impl, this, true)) {
++ implmeth = prov;
++ }
++ }
++ }
++ if (implmeth == null || implmeth == absmeth) {
++ undef = absmeth;
+ }
+ }
+- membersClosure.addSubScope(visit(supertype(t), skipInterface));
+- membersClosure.addSubScope(csym.members());
+- e = new Entry(skipInterface, membersClosure);
+- _map.put(csym, e);
+ }
+- return e.compoundScope;
++ if (undef == null) {
++ Type st = supertype(c.type);
++ if (st.hasTag(CLASS))
++ undef = firstUnimplementedAbstractImpl(impl, (ClassSymbol)st.tsym);
++ }
++ for (List<Type> l = interfaces(c.type);
++ undef == null && l.nonEmpty();
++ l = l.tail) {
++ undef = firstUnimplementedAbstractImpl(impl, (ClassSymbol)l.head.tsym);
++ }
+ }
+- finally {
+- seenTypes = seenTypes.tail;
+- }
++ return undef;
+ }
+
+- @Override
+- public CompoundScope visitTypeVar(TypeVar t, Boolean skipInterface) {
+- return visit(t.getUpperBound(), skipInterface);
+- }
+- }
+-
+- private MembersClosureCache membersCache = new MembersClosureCache();
+-
+- public CompoundScope membersClosure(Type site, boolean skipInterface) {
+- return membersCache.visit(site, skipInterface);
+- }
+- // </editor-fold>
+-
+
+ //where
+ public List<MethodSymbol> interfaceCandidates(Type site, MethodSymbol ms) {
+--- ./langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Wed Jul 01 21:54:20 2015 -0700
+@@ -825,9 +825,18 @@
+ }
+
+ public void visitClassDef(JCClassDecl tree) {
+- // Local classes have not been entered yet, so we need to do it now:
+- if ((env.info.scope.owner.kind & (VAR | MTH)) != 0)
++ // Local and anonymous classes have not been entered yet, so we need to
++ // do it now.
++ if ((env.info.scope.owner.kind & (VAR | MTH)) != 0) {
+ enter.classEnter(tree, env);
++ } else {
++ // If this class declaration is part of a class level annotation,
++ // as in @MyAnno(new Object() {}) class MyClass {}, enter it in
++ // order to simplify later steps and allow for sensible error
++ // messages.
++ if (env.tree.hasTag(NEWCLASS) && TreeInfo.isInAnnotation(env, tree))
++ enter.classEnter(tree, env);
++ }
+
+ ClassSymbol c = tree.sym;
+ if (c == null) {
+@@ -4269,6 +4278,8 @@
+ chk.validate(tree.implementing, env);
+ }
+
++ c.markAbstractIfNeeded(types);
++
+ // If this is a non-abstract class, check that it has no abstract
+ // methods or unimplemented methods of an implemented interface.
+ if ((c.flags() & (ABSTRACT | INTERFACE)) == 0) {
+--- ./langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Wed Jul 01 21:54:20 2015 -0700
+@@ -2049,70 +2049,15 @@
+ * @param c The class.
+ */
+ void checkAllDefined(DiagnosticPosition pos, ClassSymbol c) {
+- try {
+- MethodSymbol undef = firstUndef(c, c);
+- if (undef != null) {
+- if ((c.flags() & ENUM) != 0 &&
+- types.supertype(c.type).tsym == syms.enumSym &&
+- (c.flags() & FINAL) == 0) {
+- // add the ABSTRACT flag to an enum
+- c.flags_field |= ABSTRACT;
+- } else {
+- MethodSymbol undef1 =
+- new MethodSymbol(undef.flags(), undef.name,
+- types.memberType(c.type, undef), undef.owner);
+- log.error(pos, "does.not.override.abstract",
+- c, undef1, undef1.location());
+- }
+- }
+- } catch (CompletionFailure ex) {
+- completionError(pos, ex);
++ MethodSymbol undef = types.firstUnimplementedAbstract(c);
++ if (undef != null) {
++ MethodSymbol undef1 =
++ new MethodSymbol(undef.flags(), undef.name,
++ types.memberType(c.type, undef), undef.owner);
++ log.error(pos, "does.not.override.abstract",
++ c, undef1, undef1.location());
+ }
+ }
+-//where
+- /** Return first abstract member of class `c' that is not defined
+- * in `impl', null if there is none.
+- */
+- private MethodSymbol firstUndef(ClassSymbol impl, ClassSymbol c) {
+- MethodSymbol undef = null;
+- // Do not bother to search in classes that are not abstract,
+- // since they cannot have abstract members.
+- if (c == impl || (c.flags() & (ABSTRACT | INTERFACE)) != 0) {
+- Scope s = c.members();
+- for (Scope.Entry e = s.elems;
+- undef == null && e != null;
+- e = e.sibling) {
+- if (e.sym.kind == MTH &&
+- (e.sym.flags() & (ABSTRACT|IPROXY|DEFAULT)) == ABSTRACT) {
+- MethodSymbol absmeth = (MethodSymbol)e.sym;
+- MethodSymbol implmeth = absmeth.implementation(impl, types, true);
+- if (implmeth == null || implmeth == absmeth) {
+- //look for default implementations
+- if (allowDefaultMethods) {
+- MethodSymbol prov = types.interfaceCandidates(impl.type, absmeth).head;
+- if (prov != null && prov.overrides(absmeth, impl, types, true)) {
+- implmeth = prov;
+- }
+- }
+- }
+- if (implmeth == null || implmeth == absmeth) {
+- undef = absmeth;
+- }
+- }
+- }
+- if (undef == null) {
+- Type st = types.supertype(c.type);
+- if (st.hasTag(CLASS))
+- undef = firstUndef(impl, (ClassSymbol)st.tsym);
+- }
+- for (List<Type> l = types.interfaces(c.type);
+- undef == null && l.nonEmpty();
+- l = l.tail) {
+- undef = firstUndef(impl, (ClassSymbol)l.head.tsym);
+- }
+- }
+- return undef;
+- }
+
+ void checkNonCyclicDecl(JCClassDecl tree) {
+ CycleChecker cc = new CycleChecker();
+--- ./langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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
+@@ -224,7 +224,8 @@
+ DeferredStuckPolicy deferredStuckPolicy;
+ if (resultInfo.pt.hasTag(NONE) || resultInfo.pt.isErroneous()) {
+ deferredStuckPolicy = dummyStuckPolicy;
+- } else if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE) {
++ } else if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE ||
++ resultInfo.checkContext.deferredAttrContext().insideOverloadPhase()) {
+ deferredStuckPolicy = new OverloadStuckPolicy(resultInfo, this);
+ } else {
+ deferredStuckPolicy = new CheckStuckPolicy(resultInfo, this);
+@@ -1255,6 +1256,9 @@
+ return isSimpleReceiver(((JCAnnotatedType)rec).underlyingType);
+ case APPLY:
+ return true;
++ case NEWCLASS:
++ JCNewClass nc = (JCNewClass) rec;
++ return nc.encl == null && nc.def == null && !TreeInfo.isDiamond(nc);
+ default:
+ return false;
+ }
+@@ -1309,17 +1313,24 @@
+ Type site;
+
+ if (rec != null) {
+- if (rec.hasTag(APPLY)) {
+- Symbol recSym = quicklyResolveMethod(env, (JCMethodInvocation) rec);
+- if (recSym == null)
+- return null;
+- Symbol resolvedReturnType =
+- analyzeCandidateMethods(recSym, syms.errSymbol, returnSymbolAnalyzer);
+- if (resolvedReturnType == null)
+- return null;
+- site = resolvedReturnType.type;
+- } else {
+- site = attribSpeculative(rec, env, attr.unknownTypeExprInfo).type;
++ switch (rec.getTag()) {
++ case APPLY:
++ Symbol recSym = quicklyResolveMethod(env, (JCMethodInvocation) rec);
++ if (recSym == null)
++ return null;
++ Symbol resolvedReturnType =
++ analyzeCandidateMethods(recSym, syms.errSymbol, returnSymbolAnalyzer);
++ if (resolvedReturnType == null)
++ return null;
++ site = resolvedReturnType.type;
++ break;
++ case NEWCLASS:
++ JCNewClass nc = (JCNewClass) rec;
++ site = attribSpeculative(nc.clazz, env, attr.unknownTypeExprInfo).type;
++ break;
++ default:
++ site = attribSpeculative(rec, env, attr.unknownTypeExprInfo).type;
++ break;
+ }
+ } else {
+ site = env.enclClass.sym.type;
+--- ./langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -353,17 +353,17 @@
+ this.tree = tree;
+ }
+
+- void resolveJump(JCTree tree) {
++ void resolveJump() {
+ //do nothing
+ }
+ }
+
+- abstract void markDead(JCTree tree);
++ abstract void markDead();
+
+ /** Record an outward transfer of control. */
+- void recordExit(JCTree tree, P pe) {
++ void recordExit(P pe) {
+ pendingExits.append(pe);
+- markDead(tree);
++ markDead();
+ }
+
+ /** Resolve all jumps of this statement. */
+@@ -377,7 +377,7 @@
+ P exit = exits.head;
+ if (exit.tree.hasTag(jk.treeTag) &&
+ jk.getTarget(exit.tree) == tree) {
+- exit.resolveJump(tree);
++ exit.resolveJump();
+ resolved = true;
+ } else {
+ pendingExits.append(exit);
+@@ -420,7 +420,7 @@
+ private boolean alive;
+
+ @Override
+- void markDead(JCTree tree) {
++ void markDead() {
+ alive = false;
+ }
+
+@@ -464,7 +464,7 @@
+ ListBuffer<PendingExit> pendingExitsPrev = pendingExits;
+ Lint lintPrev = lint;
+
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ lint = lint.augment(tree.sym);
+
+ try {
+@@ -513,7 +513,7 @@
+ log.error(TreeInfo.diagEndPos(tree.body), "missing.ret.stmt");
+
+ List<PendingExit> exits = pendingExits.toList();
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ while (exits.nonEmpty()) {
+ PendingExit exit = exits.head;
+ exits = exits.tail;
+@@ -542,7 +542,7 @@
+
+ public void visitDoLoop(JCDoWhileLoop tree) {
+ ListBuffer<PendingExit> prevPendingExits = pendingExits;
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ scanStat(tree.body);
+ alive |= resolveContinues(tree);
+ scan(tree.cond);
+@@ -552,7 +552,7 @@
+
+ public void visitWhileLoop(JCWhileLoop tree) {
+ ListBuffer<PendingExit> prevPendingExits = pendingExits;
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ scan(tree.cond);
+ alive = !tree.cond.type.isFalse();
+ scanStat(tree.body);
+@@ -564,7 +564,7 @@
+ public void visitForLoop(JCForLoop tree) {
+ ListBuffer<PendingExit> prevPendingExits = pendingExits;
+ scanStats(tree.init);
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ if (tree.cond != null) {
+ scan(tree.cond);
+ alive = !tree.cond.type.isFalse();
+@@ -582,7 +582,7 @@
+ visitVarDef(tree.var);
+ ListBuffer<PendingExit> prevPendingExits = pendingExits;
+ scan(tree.expr);
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ scanStat(tree.body);
+ alive |= resolveContinues(tree);
+ resolveBreaks(tree, prevPendingExits);
+@@ -591,14 +591,14 @@
+
+ public void visitLabelled(JCLabeledStatement tree) {
+ ListBuffer<PendingExit> prevPendingExits = pendingExits;
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ scanStat(tree.body);
+ alive |= resolveBreaks(tree, prevPendingExits);
+ }
+
+ public void visitSwitch(JCSwitch tree) {
+ ListBuffer<PendingExit> prevPendingExits = pendingExits;
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ scan(tree.selector);
+ boolean hasDefault = false;
+ for (List<JCCase> l = tree.cases; l.nonEmpty(); l = l.tail) {
+@@ -625,7 +625,7 @@
+
+ public void visitTry(JCTry tree) {
+ ListBuffer<PendingExit> prevPendingExits = pendingExits;
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ for (JCTree resource : tree.resources) {
+ if (resource instanceof JCVariableDecl) {
+ JCVariableDecl vdecl = (JCVariableDecl) resource;
+@@ -688,21 +688,21 @@
+ }
+
+ public void visitBreak(JCBreak tree) {
+- recordExit(tree, new PendingExit(tree));
++ recordExit(new PendingExit(tree));
+ }
+
+ public void visitContinue(JCContinue tree) {
+- recordExit(tree, new PendingExit(tree));
++ recordExit(new PendingExit(tree));
+ }
+
+ public void visitReturn(JCReturn tree) {
+ scan(tree.expr);
+- recordExit(tree, new PendingExit(tree));
++ recordExit(new PendingExit(tree));
+ }
+
+ public void visitThrow(JCThrow tree) {
+ scan(tree.expr);
+- markDead(tree);
++ markDead();
+ }
+
+ public void visitApply(JCMethodInvocation tree) {
+@@ -756,7 +756,7 @@
+ try {
+ attrEnv = env;
+ Flow.this.make = make;
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ alive = true;
+ scan(tree);
+ } finally {
+@@ -803,7 +803,7 @@
+ }
+
+ @Override
+- void markDead(JCTree tree) {
++ void markDead() {
+ //do nothing
+ }
+
+@@ -1201,16 +1201,16 @@
+ }
+
+ public void visitBreak(JCBreak tree) {
+- recordExit(tree, new FlowPendingExit(tree, null));
++ recordExit(new FlowPendingExit(tree, null));
+ }
+
+ public void visitContinue(JCContinue tree) {
+- recordExit(tree, new FlowPendingExit(tree, null));
++ recordExit(new FlowPendingExit(tree, null));
+ }
+
+ public void visitReturn(JCReturn tree) {
+ scan(tree.expr);
+- recordExit(tree, new FlowPendingExit(tree, null));
++ recordExit(new FlowPendingExit(tree, null));
+ }
+
+ public void visitThrow(JCThrow tree) {
+@@ -1228,7 +1228,7 @@
+ else {
+ markThrown(tree, tree.expr.type);
+ }
+- markDead(tree);
++ markDead();
+ }
+
+ public void visitApply(JCMethodInvocation tree) {
+@@ -1379,12 +1379,10 @@
+ * effectively-final local variables/parameters.
+ */
+
+- public abstract class AbstractAssignAnalyzer<P extends AbstractAssignAnalyzer<P>.AbstractAssignPendingExit>
+- extends BaseAnalyzer<P> {
+-
++ public class AssignAnalyzer extends BaseAnalyzer<AssignAnalyzer.AssignPendingExit> {
+ /** The set of definitely assigned variables.
+ */
+- protected Bits inits;
++ final Bits inits;
+
+ /** The set of definitely unassigned variables.
+ */
+@@ -1432,20 +1430,20 @@
+ */
+ Scope unrefdResources;
+
+- /** Set when processing a loop body the second time for DU analysis. */
++ /** Modified when processing a loop body the second time for DU analysis. */
+ FlowKind flowKind = FlowKind.NORMAL;
+
+- /** The starting position of the analysed tree */
++ /** The starting position of the analyzed tree */
+ int startPos;
+
+- public class AbstractAssignPendingExit extends BaseAnalyzer.PendingExit {
++ public class AssignPendingExit extends BaseAnalyzer.PendingExit {
+
+ final Bits inits;
+ final Bits uninits;
+ final Bits exit_inits = new Bits(true);
+ final Bits exit_uninits = new Bits(true);
+
+- public AbstractAssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
++ public AssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
+ super(tree);
+ this.inits = inits;
+ this.uninits = uninits;
+@@ -1454,13 +1452,13 @@
+ }
+
+ @Override
+- public void resolveJump(JCTree tree) {
++ void resolveJump() {
+ inits.andSet(exit_inits);
+ uninits.andSet(exit_uninits);
+ }
+ }
+
+- public AbstractAssignAnalyzer() {
++ public AssignAnalyzer() {
+ this.inits = new Bits();
+ uninits = new Bits();
+ uninitsTry = new Bits();
+@@ -1473,7 +1471,7 @@
+ private boolean isInitialConstructor = false;
+
+ @Override
+- protected void markDead(JCTree tree) {
++ void markDead() {
+ if (!isInitialConstructor) {
+ inits.inclRange(returnadr, nextadr);
+ } else {
+@@ -1520,35 +1518,41 @@
+ }
+ sym.adr = nextadr;
+ vardecls[nextadr] = varDecl;
+- exclVarFromInits(varDecl, nextadr);
++ inits.excl(nextadr);
+ uninits.incl(nextadr);
+ nextadr++;
+ }
+
+- protected void exclVarFromInits(JCTree tree, int adr) {
+- inits.excl(adr);
+- }
+-
+- protected void assignToInits(JCTree tree, Bits bits) {
+- inits.assign(bits);
+- }
+-
+- protected void andSetInits(JCTree tree, Bits bits) {
+- inits.andSet(bits);
+- }
+-
+- protected void orSetInits(JCTree tree, Bits bits) {
+- inits.orSet(bits);
+- }
+-
+ /** Record an initialization of a trackable variable.
+ */
+ void letInit(DiagnosticPosition pos, VarSymbol sym) {
+ if (sym.adr >= firstadr && trackable(sym)) {
+- if (uninits.isMember(sym.adr)) {
+- uninit(sym);
++ if ((sym.flags() & EFFECTIVELY_FINAL) != 0) {
++ if (!uninits.isMember(sym.adr)) {
++ //assignment targeting an effectively final variable
++ //makes the variable lose its status of effectively final
++ //if the variable is _not_ definitively unassigned
++ sym.flags_field &= ~EFFECTIVELY_FINAL;
++ } else {
++ uninit(sym);
++ }
++ } else if ((sym.flags() & FINAL) != 0) {
++ if ((sym.flags() & PARAMETER) != 0) {
++ if ((sym.flags() & UNION) != 0) { //multi-catch parameter
++ log.error(pos, "multicatch.parameter.may.not.be.assigned", sym);
++ } else {
++ log.error(pos, "final.parameter.may.not.be.assigned",
++ sym);
++ }
++ } else if (!uninits.isMember(sym.adr)) {
++ log.error(pos, flowKind.errKey, sym);
++ } else {
++ uninit(sym);
++ }
+ }
+ inits.incl(sym.adr);
++ } else if ((sym.flags() & FINAL) != 0) {
++ log.error(pos, "var.might.already.be.assigned", sym);
+ }
+ }
+ //where
+@@ -1583,7 +1587,14 @@
+ checkInit(pos, sym, "var.might.not.have.been.initialized");
+ }
+
+- void checkInit(DiagnosticPosition pos, VarSymbol sym, String errkey) {}
++ void checkInit(DiagnosticPosition pos, VarSymbol sym, String errkey) {
++ if ((sym.adr >= firstadr || sym.owner.kind != TYP) &&
++ trackable(sym) &&
++ !inits.isMember(sym.adr)) {
++ log.error(pos, errkey, sym);
++ inits.incl(sym.adr);
++ }
++ }
+
+ /** Utility method to reset several Bits instances.
+ */
+@@ -1607,7 +1618,7 @@
+
+ /** Merge (intersect) inits/uninits from WhenTrue/WhenFalse sets.
+ */
+- protected void merge(JCTree tree) {
++ protected void merge() {
+ inits.assign(initsWhenFalse.andSet(initsWhenTrue));
+ uninits.assign(uninitsWhenFalse.andSet(uninitsWhenTrue));
+ }
+@@ -1623,7 +1634,7 @@
+ if (tree != null) {
+ scan(tree);
+ if (inits.isReset()) {
+- merge(tree);
++ merge();
+ }
+ }
+ }
+@@ -1641,7 +1652,7 @@
+ */
+ void scanCond(JCTree tree) {
+ if (tree.type.isFalse()) {
+- if (inits.isReset()) merge(tree);
++ if (inits.isReset()) merge();
+ initsWhenTrue.assign(inits);
+ initsWhenTrue.inclRange(firstadr, nextadr);
+ uninitsWhenTrue.assign(uninits);
+@@ -1649,7 +1660,7 @@
+ initsWhenFalse.assign(inits);
+ uninitsWhenFalse.assign(uninits);
+ } else if (tree.type.isTrue()) {
+- if (inits.isReset()) merge(tree);
++ if (inits.isReset()) merge();
+ initsWhenFalse.assign(inits);
+ initsWhenFalse.inclRange(firstadr, nextadr);
+ uninitsWhenFalse.assign(uninits);
+@@ -1668,173 +1679,202 @@
+
+ /* ------------ Visitor methods for various sorts of trees -------------*/
+
+- @Override
+ public void visitClassDef(JCClassDecl tree) {
+ if (tree.sym == null) {
+ return;
+ }
+
+- JCClassDecl classDefPrev = classDef;
+- int firstadrPrev = firstadr;
+- int nextadrPrev = nextadr;
+- ListBuffer<P> pendingExitsPrev = pendingExits;
++ Lint lintPrev = lint;
++ lint = lint.augment(tree.sym);
++ try {
++ if (tree.sym == null) {
++ return;
++ }
+
+- pendingExits = new ListBuffer<P>();
+- if (tree.name != names.empty) {
+- firstadr = nextadr;
+- }
+- classDef = tree;
+- try {
+- // define all the static fields
+- for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+- if (l.head.hasTag(VARDEF)) {
+- JCVariableDecl def = (JCVariableDecl)l.head;
+- if ((def.mods.flags & STATIC) != 0) {
+- VarSymbol sym = def.sym;
+- if (trackable(sym)) {
+- newVar(def);
++ JCClassDecl classDefPrev = classDef;
++ int firstadrPrev = firstadr;
++ int nextadrPrev = nextadr;
++ ListBuffer<AssignPendingExit> pendingExitsPrev = pendingExits;
++
++ pendingExits = new ListBuffer<>();
++ if (tree.name != names.empty) {
++ firstadr = nextadr;
++ }
++ classDef = tree;
++ try {
++ // define all the static fields
++ for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
++ if (l.head.hasTag(VARDEF)) {
++ JCVariableDecl def = (JCVariableDecl)l.head;
++ if ((def.mods.flags & STATIC) != 0) {
++ VarSymbol sym = def.sym;
++ if (trackable(sym)) {
++ newVar(def);
++ }
+ }
+ }
+ }
+- }
+
+- // process all the static initializers
+- for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+- if (!l.head.hasTag(METHODDEF) &&
+- (TreeInfo.flags(l.head) & STATIC) != 0) {
+- scan(l.head);
++ // process all the static initializers
++ for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
++ if (!l.head.hasTag(METHODDEF) &&
++ (TreeInfo.flags(l.head) & STATIC) != 0) {
++ scan(l.head);
++ }
+ }
+- }
+
+- // define all the instance fields
+- for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+- if (l.head.hasTag(VARDEF)) {
+- JCVariableDecl def = (JCVariableDecl)l.head;
+- if ((def.mods.flags & STATIC) == 0) {
+- VarSymbol sym = def.sym;
+- if (trackable(sym)) {
+- newVar(def);
++ // define all the instance fields
++ for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
++ if (l.head.hasTag(VARDEF)) {
++ JCVariableDecl def = (JCVariableDecl)l.head;
++ if ((def.mods.flags & STATIC) == 0) {
++ VarSymbol sym = def.sym;
++ if (trackable(sym)) {
++ newVar(def);
++ }
+ }
+ }
+ }
+- }
++ // process all the instance initializers
++ for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
++ if (!l.head.hasTag(METHODDEF) &&
++ (TreeInfo.flags(l.head) & STATIC) == 0) {
++ scan(l.head);
++ }
++ }
+
+- // process all the instance initializers
+- for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+- if (!l.head.hasTag(METHODDEF) &&
+- (TreeInfo.flags(l.head) & STATIC) == 0) {
+- scan(l.head);
++ // process all the methods
++ for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
++ if (l.head.hasTag(METHODDEF)) {
++ scan(l.head);
++ }
+ }
+- }
+-
+- // process all the methods
+- for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) {
+- if (l.head.hasTag(METHODDEF)) {
+- scan(l.head);
+- }
++ } finally {
++ pendingExits = pendingExitsPrev;
++ nextadr = nextadrPrev;
++ firstadr = firstadrPrev;
++ classDef = classDefPrev;
+ }
+ } finally {
+- pendingExits = pendingExitsPrev;
+- nextadr = nextadrPrev;
+- firstadr = firstadrPrev;
+- classDef = classDefPrev;
++ lint = lintPrev;
+ }
+ }
+
+- @Override
+ public void visitMethodDef(JCMethodDecl tree) {
+ if (tree.body == null) {
+ return;
+ }
+- /* Ignore synthetic methods, except for translated lambda methods.
++
++ /* MemberEnter can generate synthetic methods ignore them
+ */
+- if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
++ if ((tree.sym.flags() & SYNTHETIC) != 0) {
+ return;
+ }
+
+- final Bits initsPrev = new Bits(inits);
+- final Bits uninitsPrev = new Bits(uninits);
+- int nextadrPrev = nextadr;
+- int firstadrPrev = firstadr;
+- int returnadrPrev = returnadr;
++ Lint lintPrev = lint;
++ lint = lint.augment(tree.sym);
++ try {
++ if (tree.body == null) {
++ return;
++ }
++ /* Ignore synthetic methods, except for translated lambda methods.
++ */
++ if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
++ return;
++ }
+
+- Assert.check(pendingExits.isEmpty());
+- boolean lastInitialConstructor = isInitialConstructor;
+- try {
+- isInitialConstructor = TreeInfo.isInitialConstructor(tree);
++ final Bits initsPrev = new Bits(inits);
++ final Bits uninitsPrev = new Bits(uninits);
++ int nextadrPrev = nextadr;
++ int firstadrPrev = firstadr;
++ int returnadrPrev = returnadr;
+
+- if (!isInitialConstructor) {
+- firstadr = nextadr;
+- }
+- for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
+- JCVariableDecl def = l.head;
+- scan(def);
+- Assert.check((def.sym.flags() & PARAMETER) != 0, "Method parameter without PARAMETER flag");
+- /* If we are executing the code from Gen, then there can be
+- * synthetic or mandated variables, ignore them.
+- */
+- initParam(def);
+- }
+- // else we are in an instance initializer block;
+- // leave caught unchanged.
+- scan(tree.body);
++ Assert.check(pendingExits.isEmpty());
++ boolean lastInitialConstructor = isInitialConstructor;
++ try {
++ isInitialConstructor = TreeInfo.isInitialConstructor(tree);
+
+- if (isInitialConstructor) {
+- boolean isSynthesized = (tree.sym.flags() &
+- GENERATEDCONSTR) != 0;
+- for (int i = firstadr; i < nextadr; i++) {
+- JCVariableDecl vardecl = vardecls[i];
+- VarSymbol var = vardecl.sym;
+- if (var.owner == classDef.sym) {
+- // choose the diagnostic position based on whether
+- // the ctor is default(synthesized) or not
+- if (isSynthesized) {
+- checkInit(TreeInfo.diagnosticPositionFor(var, vardecl),
+- var, "var.not.initialized.in.default.constructor");
+- } else {
+- checkInit(TreeInfo.diagEndPos(tree.body), var);
++ if (!isInitialConstructor) {
++ firstadr = nextadr;
++ }
++ for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
++ JCVariableDecl def = l.head;
++ scan(def);
++ Assert.check((def.sym.flags() & PARAMETER) != 0, "Method parameter without PARAMETER flag");
++ /* If we are executing the code from Gen, then there can be
++ * synthetic or mandated variables, ignore them.
++ */
++ initParam(def);
++ }
++ // else we are in an instance initializer block;
++ // leave caught unchanged.
++ scan(tree.body);
++
++ if (isInitialConstructor) {
++ boolean isSynthesized = (tree.sym.flags() &
++ GENERATEDCONSTR) != 0;
++ for (int i = firstadr; i < nextadr; i++) {
++ JCVariableDecl vardecl = vardecls[i];
++ VarSymbol var = vardecl.sym;
++ if (var.owner == classDef.sym) {
++ // choose the diagnostic position based on whether
++ // the ctor is default(synthesized) or not
++ if (isSynthesized) {
++ checkInit(TreeInfo.diagnosticPositionFor(var, vardecl),
++ var, "var.not.initialized.in.default.constructor");
++ } else {
++ checkInit(TreeInfo.diagEndPos(tree.body), var);
++ }
+ }
+ }
+ }
+- }
+- List<P> exits = pendingExits.toList();
+- pendingExits = new ListBuffer<>();
+- while (exits.nonEmpty()) {
+- P exit = exits.head;
+- exits = exits.tail;
+- Assert.check(exit.tree.hasTag(RETURN), exit.tree);
+- if (isInitialConstructor) {
+- assignToInits(exit.tree, exit.exit_inits);
+- for (int i = firstadr; i < nextadr; i++) {
+- checkInit(exit.tree.pos(), vardecls[i].sym);
++ List<AssignPendingExit> exits = pendingExits.toList();
++ pendingExits = new ListBuffer<>();
++ while (exits.nonEmpty()) {
++ AssignPendingExit exit = exits.head;
++ exits = exits.tail;
++ Assert.check(exit.tree.hasTag(RETURN), exit.tree);
++ if (isInitialConstructor) {
++ inits.assign(exit.exit_inits);
++ for (int i = firstadr; i < nextadr; i++) {
++ checkInit(exit.tree.pos(), vardecls[i].sym);
++ }
+ }
+ }
++ } finally {
++ inits.assign(initsPrev);
++ uninits.assign(uninitsPrev);
++ nextadr = nextadrPrev;
++ firstadr = firstadrPrev;
++ returnadr = returnadrPrev;
++ isInitialConstructor = lastInitialConstructor;
+ }
+ } finally {
+- assignToInits(tree, initsPrev);
+- uninits.assign(uninitsPrev);
+- nextadr = nextadrPrev;
+- firstadr = firstadrPrev;
+- returnadr = returnadrPrev;
+- isInitialConstructor = lastInitialConstructor;
++ lint = lintPrev;
+ }
+ }
+
+ protected void initParam(JCVariableDecl def) {
+ inits.incl(def.sym.adr);
+ uninits.excl(def.sym.adr);
+- }
++ }
+
+ public void visitVarDef(JCVariableDecl tree) {
+- boolean track = trackable(tree.sym);
+- if (track && tree.sym.owner.kind == MTH) {
+- newVar(tree);
+- }
+- if (tree.init != null) {
+- scanExpr(tree.init);
+- if (track) {
+- letInit(tree.pos(), tree.sym);
++ Lint lintPrev = lint;
++ lint = lint.augment(tree.sym);
++ try{
++ boolean track = trackable(tree.sym);
++ if (track && tree.sym.owner.kind == MTH) {
++ newVar(tree);
+ }
++ if (tree.init != null) {
++ scanExpr(tree.init);
++ if (track) {
++ letInit(tree.pos(), tree.sym);
++ }
++ }
++ } finally {
++ lint = lintPrev;
+ }
+ }
+
+@@ -1844,18 +1884,14 @@
+ nextadr = nextadrPrev;
+ }
+
+- int getLogNumberOfErrors() {
+- return 0;
+- }
+-
+ public void visitDoLoop(JCDoWhileLoop tree) {
+- ListBuffer<P> prevPendingExits = pendingExits;
++ ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
+ FlowKind prevFlowKind = flowKind;
+ flowKind = FlowKind.NORMAL;
+ final Bits initsSkip = new Bits(true);
+ final Bits uninitsSkip = new Bits(true);
+- pendingExits = new ListBuffer<P>();
+- int prevErrors = getLogNumberOfErrors();
++ pendingExits = new ListBuffer<>();
++ int prevErrors = log.nerrors;
+ do {
+ final Bits uninitsEntry = new Bits(uninits);
+ uninitsEntry.excludeFrom(nextadr);
+@@ -1866,28 +1902,28 @@
+ initsSkip.assign(initsWhenFalse);
+ uninitsSkip.assign(uninitsWhenFalse);
+ }
+- if (getLogNumberOfErrors() != prevErrors ||
++ if (log.nerrors != prevErrors ||
+ flowKind.isFinal() ||
+ new Bits(uninitsEntry).diffSet(uninitsWhenTrue).nextBit(firstadr)==-1)
+ break;
+- assignToInits(tree.cond, initsWhenTrue);
++ inits.assign(initsWhenTrue);
+ uninits.assign(uninitsEntry.andSet(uninitsWhenTrue));
+ flowKind = FlowKind.SPECULATIVE_LOOP;
+ } while (true);
+ flowKind = prevFlowKind;
+- assignToInits(tree, initsSkip);
++ inits.assign(initsSkip);
+ uninits.assign(uninitsSkip);
+ resolveBreaks(tree, prevPendingExits);
+ }
+
+ public void visitWhileLoop(JCWhileLoop tree) {
+- ListBuffer<P> prevPendingExits = pendingExits;
++ ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
+ FlowKind prevFlowKind = flowKind;
+ flowKind = FlowKind.NORMAL;
+ final Bits initsSkip = new Bits(true);
+ final Bits uninitsSkip = new Bits(true);
+ pendingExits = new ListBuffer<>();
+- int prevErrors = getLogNumberOfErrors();
++ int prevErrors = log.nerrors;
+ final Bits uninitsEntry = new Bits(uninits);
+ uninitsEntry.excludeFrom(nextadr);
+ do {
+@@ -1896,11 +1932,11 @@
+ initsSkip.assign(initsWhenFalse) ;
+ uninitsSkip.assign(uninitsWhenFalse);
+ }
+- assignToInits(tree, initsWhenTrue);
++ inits.assign(initsWhenTrue);
+ uninits.assign(uninitsWhenTrue);
+ scan(tree.body);
+ resolveContinues(tree);
+- if (getLogNumberOfErrors() != prevErrors ||
++ if (log.nerrors != prevErrors ||
+ flowKind.isFinal() ||
+ new Bits(uninitsEntry).diffSet(uninits).nextBit(firstadr) == -1) {
+ break;
+@@ -1911,21 +1947,21 @@
+ flowKind = prevFlowKind;
+ //a variable is DA/DU after the while statement, if it's DA/DU assuming the
+ //branch is not taken AND if it's DA/DU before any break statement
+- assignToInits(tree.body, initsSkip);
++ inits.assign(initsSkip);
+ uninits.assign(uninitsSkip);
+ resolveBreaks(tree, prevPendingExits);
+ }
+
+ public void visitForLoop(JCForLoop tree) {
+- ListBuffer<P> prevPendingExits = pendingExits;
++ ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
+ FlowKind prevFlowKind = flowKind;
+ flowKind = FlowKind.NORMAL;
+ int nextadrPrev = nextadr;
+ scan(tree.init);
+ final Bits initsSkip = new Bits(true);
+ final Bits uninitsSkip = new Bits(true);
+- pendingExits = new ListBuffer<P>();
+- int prevErrors = getLogNumberOfErrors();
++ pendingExits = new ListBuffer<>();
++ int prevErrors = log.nerrors;
+ do {
+ final Bits uninitsEntry = new Bits(uninits);
+ uninitsEntry.excludeFrom(nextadr);
+@@ -1935,7 +1971,7 @@
+ initsSkip.assign(initsWhenFalse);
+ uninitsSkip.assign(uninitsWhenFalse);
+ }
+- assignToInits(tree.body, initsWhenTrue);
++ inits.assign(initsWhenTrue);
+ uninits.assign(uninitsWhenTrue);
+ } else if (!flowKind.isFinal()) {
+ initsSkip.assign(inits);
+@@ -1946,7 +1982,7 @@
+ scan(tree.body);
+ resolveContinues(tree);
+ scan(tree.step);
+- if (getLogNumberOfErrors() != prevErrors ||
++ if (log.nerrors != prevErrors ||
+ flowKind.isFinal() ||
+ new Bits(uninitsEntry).diffSet(uninits).nextBit(firstadr) == -1)
+ break;
+@@ -1956,7 +1992,7 @@
+ flowKind = prevFlowKind;
+ //a variable is DA/DU after a for loop, if it's DA/DU assuming the
+ //branch is not taken AND if it's DA/DU before any break statement
+- assignToInits(tree.body, initsSkip);
++ inits.assign(initsSkip);
+ uninits.assign(uninitsSkip);
+ resolveBreaks(tree, prevPendingExits);
+ nextadr = nextadrPrev;
+@@ -1965,7 +2001,7 @@
+ public void visitForeachLoop(JCEnhancedForLoop tree) {
+ visitVarDef(tree.var);
+
+- ListBuffer<P> prevPendingExits = pendingExits;
++ ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
+ FlowKind prevFlowKind = flowKind;
+ flowKind = FlowKind.NORMAL;
+ int nextadrPrev = nextadr;
+@@ -1974,14 +2010,14 @@
+ final Bits uninitsStart = new Bits(uninits);
+
+ letInit(tree.pos(), tree.var.sym);
+- pendingExits = new ListBuffer<P>();
+- int prevErrors = getLogNumberOfErrors();
++ pendingExits = new ListBuffer<>();
++ int prevErrors = log.nerrors;
+ do {
+ final Bits uninitsEntry = new Bits(uninits);
+ uninitsEntry.excludeFrom(nextadr);
+ scan(tree.body);
+ resolveContinues(tree);
+- if (getLogNumberOfErrors() != prevErrors ||
++ if (log.nerrors != prevErrors ||
+ flowKind.isFinal() ||
+ new Bits(uninitsEntry).diffSet(uninits).nextBit(firstadr) == -1)
+ break;
+@@ -1989,21 +2025,21 @@
+ flowKind = FlowKind.SPECULATIVE_LOOP;
+ } while (true);
+ flowKind = prevFlowKind;
+- assignToInits(tree.body, initsStart);
++ inits.assign(initsStart);
+ uninits.assign(uninitsStart.andSet(uninits));
+ resolveBreaks(tree, prevPendingExits);
+ nextadr = nextadrPrev;
+ }
+
+ public void visitLabelled(JCLabeledStatement tree) {
+- ListBuffer<P> prevPendingExits = pendingExits;
+- pendingExits = new ListBuffer<P>();
++ ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
++ pendingExits = new ListBuffer<>();
+ scan(tree.body);
+ resolveBreaks(tree, prevPendingExits);
+ }
+
+ public void visitSwitch(JCSwitch tree) {
+- ListBuffer<P> prevPendingExits = pendingExits;
++ ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
+ pendingExits = new ListBuffer<>();
+ int nextadrPrev = nextadr;
+ scanExpr(tree.selector);
+@@ -2011,7 +2047,7 @@
+ final Bits uninitsSwitch = new Bits(uninits);
+ boolean hasDefault = false;
+ for (List<JCCase> l = tree.cases; l.nonEmpty(); l = l.tail) {
+- assignToInits(l.head, initsSwitch);
++ inits.assign(initsSwitch);
+ uninits.assign(uninits.andSet(uninitsSwitch));
+ JCCase c = l.head;
+ if (c.pat == null) {
+@@ -2020,19 +2056,19 @@
+ scanExpr(c.pat);
+ }
+ if (hasDefault) {
+- assignToInits(null, initsSwitch);
++ inits.assign(initsSwitch);
+ uninits.assign(uninits.andSet(uninitsSwitch));
+ }
+ scan(c.stats);
+ addVars(c.stats, initsSwitch, uninitsSwitch);
+ if (!hasDefault) {
+- assignToInits(l.head.stats.last(), initsSwitch);
++ inits.assign(initsSwitch);
+ uninits.assign(uninits.andSet(uninitsSwitch));
+ }
+ // Warn about fall-through if lint switch fallthrough enabled.
+ }
+ if (!hasDefault) {
+- andSetInits(null, initsSwitch);
++ inits.andSet(initsSwitch);
+ }
+ resolveBreaks(tree, prevPendingExits);
+ nextadr = nextadrPrev;
+@@ -2051,16 +2087,10 @@
+ }
+ }
+
+- boolean isEnabled(Lint.LintCategory lc) {
+- return false;
+- }
+-
+- void reportWarning(Lint.LintCategory lc, DiagnosticPosition pos, String key, Object ... args) {}
+-
+ public void visitTry(JCTry tree) {
+ ListBuffer<JCVariableDecl> resourceVarDecls = new ListBuffer<>();
+ final Bits uninitsTryPrev = new Bits(uninitsTry);
+- ListBuffer<P> prevPendingExits = pendingExits;
++ ListBuffer<AssignPendingExit> prevPendingExits = pendingExits;
+ pendingExits = new ListBuffer<>();
+ final Bits initsTry = new Bits(inits);
+ uninitsTry.assign(uninits);
+@@ -2083,10 +2113,10 @@
+ int nextadrCatch = nextadr;
+
+ if (!resourceVarDecls.isEmpty() &&
+- isEnabled(Lint.LintCategory.TRY)) {
++ lint.isEnabled(Lint.LintCategory.TRY)) {
+ for (JCVariableDecl resVar : resourceVarDecls) {
+ if (unrefdResources.includes(resVar.sym)) {
+- reportWarning(Lint.LintCategory.TRY, resVar.pos(),
++ log.warning(Lint.LintCategory.TRY, resVar.pos(),
+ "try.resource.not.referenced", resVar.sym);
+ unrefdResources.remove(resVar.sym);
+ }
+@@ -2102,7 +2132,7 @@
+
+ for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) {
+ JCVariableDecl param = l.head.param;
+- assignToInits(tree.body, initsCatchPrev);
++ inits.assign(initsCatchPrev);
+ uninits.assign(uninitsCatchPrev);
+ scan(param);
+ /* If this is a TWR and we are executing the code from Gen,
+@@ -2115,9 +2145,9 @@
+ nextadr = nextadrCatch;
+ }
+ if (tree.finalizer != null) {
+- assignToInits(tree.finalizer, initsTry);
++ inits.assign(initsTry);
+ uninits.assign(uninitsTry);
+- ListBuffer<P> exits = pendingExits;
++ ListBuffer<AssignPendingExit> exits = pendingExits;
+ pendingExits = prevPendingExits;
+ scan(tree.finalizer);
+ if (!tree.finallyCanCompleteNormally) {
+@@ -2127,19 +2157,19 @@
+ // FIX: this doesn't preserve source order of exits in catch
+ // versus finally!
+ while (exits.nonEmpty()) {
+- P exit = exits.next();
++ AssignPendingExit exit = exits.next();
+ if (exit.exit_inits != null) {
+ exit.exit_inits.orSet(inits);
+ exit.exit_uninits.andSet(uninits);
+ }
+ pendingExits.append(exit);
+ }
+- orSetInits(tree, initsEnd);
++ inits.orSet(initsEnd);
+ }
+ } else {
+- assignToInits(tree, initsEnd);
++ inits.assign(initsEnd);
+ uninits.assign(uninitsEnd);
+- ListBuffer<P> exits = pendingExits;
++ ListBuffer<AssignPendingExit> exits = pendingExits;
+ pendingExits = prevPendingExits;
+ while (exits.nonEmpty()) pendingExits.append(exits.next());
+ }
+@@ -2150,7 +2180,7 @@
+ scanCond(tree.cond);
+ final Bits initsBeforeElse = new Bits(initsWhenFalse);
+ final Bits uninitsBeforeElse = new Bits(uninitsWhenFalse);
+- assignToInits(tree.cond, initsWhenTrue);
++ inits.assign(initsWhenTrue);
+ uninits.assign(uninitsWhenTrue);
+ if (tree.truepart.type.hasTag(BOOLEAN) &&
+ tree.falsepart.type.hasTag(BOOLEAN)) {
+@@ -2163,7 +2193,7 @@
+ final Bits initsAfterThenWhenFalse = new Bits(initsWhenFalse);
+ final Bits uninitsAfterThenWhenTrue = new Bits(uninitsWhenTrue);
+ final Bits uninitsAfterThenWhenFalse = new Bits(uninitsWhenFalse);
+- assignToInits(tree.truepart, initsBeforeElse);
++ inits.assign(initsBeforeElse);
+ uninits.assign(uninitsBeforeElse);
+ scanCond(tree.falsepart);
+ initsWhenTrue.andSet(initsAfterThenWhenTrue);
+@@ -2174,10 +2204,10 @@
+ scanExpr(tree.truepart);
+ final Bits initsAfterThen = new Bits(inits);
+ final Bits uninitsAfterThen = new Bits(uninits);
+- assignToInits(tree.truepart, initsBeforeElse);
++ inits.assign(initsBeforeElse);
+ uninits.assign(uninitsBeforeElse);
+ scanExpr(tree.falsepart);
+- andSetInits(tree.falsepart, initsAfterThen);
++ inits.andSet(initsAfterThen);
+ uninits.andSet(uninitsAfterThen);
+ }
+ }
+@@ -2186,46 +2216,42 @@
+ scanCond(tree.cond);
+ final Bits initsBeforeElse = new Bits(initsWhenFalse);
+ final Bits uninitsBeforeElse = new Bits(uninitsWhenFalse);
+- assignToInits(tree.cond, initsWhenTrue);
++ inits.assign(initsWhenTrue);
+ uninits.assign(uninitsWhenTrue);
+ scan(tree.thenpart);
+ if (tree.elsepart != null) {
+ final Bits initsAfterThen = new Bits(inits);
+ final Bits uninitsAfterThen = new Bits(uninits);
+- assignToInits(tree.thenpart, initsBeforeElse);
++ inits.assign(initsBeforeElse);
+ uninits.assign(uninitsBeforeElse);
+ scan(tree.elsepart);
+- andSetInits(tree.elsepart, initsAfterThen);
++ inits.andSet(initsAfterThen);
+ uninits.andSet(uninitsAfterThen);
+ } else {
+- andSetInits(tree.thenpart, initsBeforeElse);
++ inits.andSet(initsBeforeElse);
+ uninits.andSet(uninitsBeforeElse);
+ }
+ }
+
+- protected P createNewPendingExit(JCTree tree, Bits inits, Bits uninits) {
+- return null;
+- }
+-
+ @Override
+ public void visitBreak(JCBreak tree) {
+- recordExit(tree, createNewPendingExit(tree, inits, uninits));
++ recordExit(new AssignPendingExit(tree, inits, uninits));
+ }
+
+ @Override
+ public void visitContinue(JCContinue tree) {
+- recordExit(tree, createNewPendingExit(tree, inits, uninits));
++ recordExit(new AssignPendingExit(tree, inits, uninits));
+ }
+
+ @Override
+ public void visitReturn(JCReturn tree) {
+ scanExpr(tree.expr);
+- recordExit(tree, createNewPendingExit(tree, inits, uninits));
++ recordExit(new AssignPendingExit(tree, inits, uninits));
+ }
+
+ public void visitThrow(JCThrow tree) {
+ scanExpr(tree.expr);
+- markDead(tree.expr);
++ markDead();
+ }
+
+ public void visitApply(JCMethodInvocation tree) {
+@@ -2244,10 +2270,10 @@
+ final Bits prevUninits = new Bits(uninits);
+ final Bits prevInits = new Bits(inits);
+ int returnadrPrev = returnadr;
+- ListBuffer<P> prevPending = pendingExits;
++ ListBuffer<AssignPendingExit> prevPending = pendingExits;
+ try {
+ returnadr = nextadr;
+- pendingExits = new ListBuffer<P>();
++ pendingExits = new ListBuffer<>();
+ for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
+ JCVariableDecl def = l.head;
+ scan(def);
+@@ -2263,7 +2289,7 @@
+ finally {
+ returnadr = returnadrPrev;
+ uninits.assign(prevUninits);
+- assignToInits(tree, prevInits);
++ inits.assign(prevInits);
+ pendingExits = prevPending;
+ }
+ }
+@@ -2279,11 +2305,11 @@
+ scanCond(tree.cond);
+ uninitsExit.andSet(uninitsWhenTrue);
+ if (tree.detail != null) {
+- assignToInits(tree, initsWhenFalse);
++ inits.assign(initsWhenFalse);
+ uninits.assign(uninitsWhenFalse);
+ scanExpr(tree.detail);
+ }
+- assignToInits(tree, initsExit);
++ inits.assign(initsExit);
+ uninits.assign(uninitsExit);
+ }
+
+@@ -2351,7 +2377,7 @@
+ scanCond(tree.lhs);
+ final Bits initsWhenFalseLeft = new Bits(initsWhenFalse);
+ final Bits uninitsWhenFalseLeft = new Bits(uninitsWhenFalse);
+- assignToInits(tree.lhs, initsWhenTrue);
++ inits.assign(initsWhenTrue);
+ uninits.assign(uninitsWhenTrue);
+ scanCond(tree.rhs);
+ initsWhenFalse.andSet(initsWhenFalseLeft);
+@@ -2361,7 +2387,7 @@
+ scanCond(tree.lhs);
+ final Bits initsWhenTrueLeft = new Bits(initsWhenTrue);
+ final Bits uninitsWhenTrueLeft = new Bits(uninitsWhenTrue);
+- assignToInits(tree.lhs, initsWhenFalse);
++ inits.assign(initsWhenFalse);
+ uninits.assign(uninitsWhenFalse);
+ scanCond(tree.rhs);
+ initsWhenTrue.andSet(initsWhenTrueLeft);
+@@ -2436,136 +2462,6 @@
+ }
+ }
+
+- public class AssignAnalyzer extends AbstractAssignAnalyzer<AssignAnalyzer.AssignPendingExit> {
+-
+- public class AssignPendingExit extends AbstractAssignAnalyzer<AssignPendingExit>.AbstractAssignPendingExit {
+-
+- public AssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
+- super(tree, inits, uninits);
+- }
+- }
+-
+- @Override
+- protected AssignPendingExit createNewPendingExit(JCTree tree,
+- Bits inits, Bits uninits) {
+- return new AssignPendingExit(tree, inits, uninits);
+- }
+-
+- /** Record an initialization of a trackable variable.
+- */
+- @Override
+- void letInit(DiagnosticPosition pos, VarSymbol sym) {
+- if (sym.adr >= firstadr && trackable(sym)) {
+- if ((sym.flags() & EFFECTIVELY_FINAL) != 0) {
+- if (!uninits.isMember(sym.adr)) {
+- //assignment targeting an effectively final variable
+- //makes the variable lose its status of effectively final
+- //if the variable is _not_ definitively unassigned
+- sym.flags_field &= ~EFFECTIVELY_FINAL;
+- } else {
+- uninit(sym);
+- }
+- }
+- else if ((sym.flags() & FINAL) != 0) {
+- if ((sym.flags() & PARAMETER) != 0) {
+- if ((sym.flags() & UNION) != 0) { //multi-catch parameter
+- log.error(pos, "multicatch.parameter.may.not.be.assigned", sym);
+- }
+- else {
+- log.error(pos, "final.parameter.may.not.be.assigned",
+- sym);
+- }
+- } else if (!uninits.isMember(sym.adr)) {
+- log.error(pos, flowKind.errKey, sym);
+- } else {
+- uninit(sym);
+- }
+- }
+- inits.incl(sym.adr);
+- } else if ((sym.flags() & FINAL) != 0) {
+- log.error(pos, "var.might.already.be.assigned", sym);
+- }
+- }
+-
+- @Override
+- void checkInit(DiagnosticPosition pos, VarSymbol sym, String errkey) {
+- if ((sym.adr >= firstadr || sym.owner.kind != TYP) &&
+- trackable(sym) &&
+- !inits.isMember(sym.adr)) {
+- log.error(pos, errkey, sym);
+- inits.incl(sym.adr);
+- }
+- }
+-
+- @Override
+- void reportWarning(Lint.LintCategory lc, DiagnosticPosition pos,
+- String key, Object ... args) {
+- log.warning(lc, pos, key, args);
+- }
+-
+- @Override
+- int getLogNumberOfErrors() {
+- return log.nerrors;
+- }
+-
+- @Override
+- boolean isEnabled(Lint.LintCategory lc) {
+- return lint.isEnabled(lc);
+- }
+-
+- @Override
+- public void visitClassDef(JCClassDecl tree) {
+- if (tree.sym == null) {
+- return;
+- }
+-
+- Lint lintPrev = lint;
+- lint = lint.augment(tree.sym);
+- try {
+- super.visitClassDef(tree);
+- } finally {
+- lint = lintPrev;
+- }
+- }
+-
+- @Override
+- public void visitMethodDef(JCMethodDecl tree) {
+- if (tree.body == null) {
+- return;
+- }
+-
+- /* MemberEnter can generate synthetic methods ignore them
+- */
+- if ((tree.sym.flags() & SYNTHETIC) != 0) {
+- return;
+- }
+-
+- Lint lintPrev = lint;
+- lint = lint.augment(tree.sym);
+- try {
+- super.visitMethodDef(tree);
+- } finally {
+- lint = lintPrev;
+- }
+- }
+-
+- @Override
+- public void visitVarDef(JCVariableDecl tree) {
+- if (tree.init == null) {
+- super.visitVarDef(tree);
+- } else {
+- Lint lintPrev = lint;
+- lint = lint.augment(tree.sym);
+- try{
+- super.visitVarDef(tree);
+- } finally {
+- lint = lintPrev;
+- }
+- }
+- }
+-
+- }
+-
+ /**
+ * This pass implements the last step of the dataflow analysis, namely
+ * the effectively-final analysis check. This checks that every local variable
+@@ -2578,7 +2474,7 @@
+ JCTree currentTree; //local class or lambda
+
+ @Override
+- void markDead(JCTree tree) {
++ void markDead() {
+ //do nothing
+ }
+
+@@ -2715,7 +2611,7 @@
+ try {
+ attrEnv = env;
+ Flow.this.make = make;
+- pendingExits = new ListBuffer<PendingExit>();
++ pendingExits = new ListBuffer<>();
+ scan(tree);
+ } finally {
+ pendingExits = null;
+--- ./langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Wed Jul 01 21:54:20 2015 -0700
+@@ -315,11 +315,9 @@
+ for (Type aLowerBound : from.getBounds(InferenceBound.LOWER)) {
+ for (Type anotherLowerBound : from.getBounds(InferenceBound.LOWER)) {
+ if (aLowerBound != anotherLowerBound &&
+- commonSuperWithDiffParameterization(aLowerBound, anotherLowerBound)) {
+- /* self comment check if any lower bound may be and undetVar,
+- * in that case the result of this call may be a false positive.
+- * Should this be restricted to non free types?
+- */
++ !inferenceContext.free(aLowerBound) &&
++ !inferenceContext.free(anotherLowerBound) &&
++ commonSuperWithDiffParameterization(aLowerBound, anotherLowerBound)) {
+ return generateReferenceToTargetConstraint(tree, from, to,
+ resultInfo, inferenceContext);
+ }
+--- ./langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Wed Jul 01 21:54:20 2015 -0700
+@@ -265,7 +265,7 @@
+ @Override
+ public void visitLambda(JCLambda tree) {
+ LambdaTranslationContext localContext = (LambdaTranslationContext)context;
+- MethodSymbol sym = (MethodSymbol)localContext.translatedSym;
++ MethodSymbol sym = localContext.translatedSym;
+ MethodType lambdaType = (MethodType) sym.type;
+
+ {
+@@ -1755,7 +1755,7 @@
+ Map<LambdaSymbolKind, Map<Symbol, Symbol>> translatedSymbols;
+
+ /** the synthetic symbol for the method hoisting the translated lambda */
+- Symbol translatedSym;
++ MethodSymbol translatedSym;
+
+ List<JCVariableDecl> syntheticParams;
+
+@@ -1883,7 +1883,7 @@
+ * Translate a symbol of a given kind into something suitable for the
+ * synthetic lambda body
+ */
+- Symbol translate(Name name, final Symbol sym, LambdaSymbolKind skind) {
++ Symbol translate(final Symbol sym, LambdaSymbolKind skind) {
+ Symbol ret;
+ switch (skind) {
+ case CAPTURED_THIS:
+@@ -1891,7 +1891,7 @@
+ break;
+ case TYPE_VAR:
+ // Just erase the type var
+- ret = new VarSymbol(sym.flags(), name,
++ ret = new VarSymbol(sym.flags(), sym.name,
+ types.erasure(sym.type), sym.owner);
+
+ /* this information should also be kept for LVT generation at Gen
+@@ -1900,7 +1900,7 @@
+ ((VarSymbol)ret).pos = ((VarSymbol)sym).pos;
+ break;
+ case CAPTURED_VAR:
+- ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym) {
++ ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, sym.name, types.erasure(sym.type), translatedSym) {
+ @Override
+ public Symbol baseSymbol() {
+ //keep mapping with original captured symbol
+@@ -1909,16 +1909,16 @@
+ };
+ break;
+ case LOCAL_VAR:
+- ret = new VarSymbol(sym.flags() & FINAL, name, sym.type, translatedSym);
++ ret = new VarSymbol(sym.flags() & FINAL, sym.name, sym.type, translatedSym);
+ ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
+ break;
+ case PARAM:
+- ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, name, types.erasure(sym.type), translatedSym);
++ ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, sym.name, types.erasure(sym.type), translatedSym);
+ ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
+ break;
+ default:
+- ret = makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym);
+- ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
++ Assert.error(skind.name());
++ throw new AssertionError();
+ }
+ if (ret != sym) {
+ ret.setDeclarationAttributes(sym.getRawAttributes());
+@@ -1929,27 +1929,8 @@
+
+ void addSymbol(Symbol sym, LambdaSymbolKind skind) {
+ Map<Symbol, Symbol> transMap = getSymbolMap(skind);
+- Name preferredName;
+- switch (skind) {
+- case CAPTURED_THIS:
+- preferredName = names.fromString("encl$" + transMap.size());
+- break;
+- case CAPTURED_VAR:
+- preferredName = names.fromString("cap$" + transMap.size());
+- break;
+- case LOCAL_VAR:
+- preferredName = sym.name;
+- break;
+- case PARAM:
+- preferredName = sym.name;
+- break;
+- case TYPE_VAR:
+- preferredName = sym.name;
+- break;
+- default: throw new AssertionError();
+- }
+ if (!transMap.containsKey(sym)) {
+- transMap.put(sym, translate(preferredName, sym, skind));
++ transMap.put(sym, translate(sym, skind));
+ }
+ }
+
+@@ -1997,6 +1978,7 @@
+
+ //compute synthetic params
+ ListBuffer<JCVariableDecl> params = new ListBuffer<>();
++ ListBuffer<VarSymbol> parameterSymbols = new ListBuffer<>();
+
+ // The signature of the method is augmented with the following
+ // synthetic parameters:
+@@ -2005,19 +1987,16 @@
+ // 2) enclosing locals captured by the lambda expression
+ for (Symbol thisSym : getSymbolMap(CAPTURED_VAR).values()) {
+ params.append(make.VarDef((VarSymbol) thisSym, null));
+- }
+- if (methodReferenceReceiver != null) {
+- params.append(make.VarDef(
+- make.Modifiers(PARAMETER|FINAL),
+- names.fromString("$rcvr$"),
+- make.Type(methodReferenceReceiver.type),
+- null));
++ parameterSymbols.append((VarSymbol) thisSym);
+ }
+ for (Symbol thisSym : getSymbolMap(PARAM).values()) {
+ params.append(make.VarDef((VarSymbol) thisSym, null));
++ parameterSymbols.append((VarSymbol) thisSym);
+ }
+ syntheticParams = params.toList();
+
++ translatedSym.params = parameterSymbols.toList();
++
+ // Compute and set the lambda name
+ translatedSym.name = isSerializable()
+ ? serializedLambdaName()
+--- ./langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java Wed Jul 01 21:54:20 2015 -0700
+@@ -2540,7 +2540,7 @@
+ currentMethodSym = currentMethodSymPrev;
+
+ // Return empty block {} as a placeholder for an inner class.
+- result = make_at(tree.pos()).Block(0, List.<JCStatement>nil());
++ result = make_at(tree.pos()).Block(SYNTHETIC, List.<JCStatement>nil());
+ }
+
+ /** Translate an enum class. */
+--- ./langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Wed Jul 01 21:54:20 2015 -0700
+@@ -271,7 +271,7 @@
+ * the one of its outer environment
+ */
+ protected static boolean isStatic(Env<AttrContext> env) {
+- return env.info.staticLevel > env.outer.info.staticLevel;
++ return env.outer != null && env.info.staticLevel > env.outer.info.staticLevel;
+ }
+
+ /** An environment is an "initializer" if it is a constructor or
+@@ -836,20 +836,19 @@
+ List<Type> formals,
+ Warner warn) {
+ super.argumentsAcceptable(env, deferredAttrContext, argtypes, formals, warn);
+- //should we expand formals?
++ // should we check varargs element type accessibility?
+ if (deferredAttrContext.phase.isVarargsRequired()) {
+- Type typeToCheck = null;
+- if (!checkVarargsAccessAfterResolution) {
+- typeToCheck = types.elemtype(formals.last());
+- } else if (deferredAttrContext.mode == AttrMode.CHECK) {
+- typeToCheck = types.erasure(types.elemtype(formals.last()));
+- }
+- if (typeToCheck != null) {
+- varargsAccessible(env, typeToCheck, deferredAttrContext.inferenceContext);
++ if (deferredAttrContext.mode == AttrMode.CHECK || !checkVarargsAccessAfterResolution) {
++ varargsAccessible(env, types.elemtype(formals.last()), deferredAttrContext.inferenceContext);
+ }
+ }
+ }
+
++ /**
++ * Test that the runtime array element type corresponding to 't' is accessible. 't' should be the
++ * varargs element type of either the method invocation type signature (after inference completes)
++ * or the method declaration signature (before inference completes).
++ */
+ private void varargsAccessible(final Env<AttrContext> env, final Type t, final InferenceContext inferenceContext) {
+ if (inferenceContext.free(t)) {
+ inferenceContext.addFreeTypeListener(List.of(t), new FreeTypeListener() {
+@@ -859,7 +858,7 @@
+ }
+ });
+ } else {
+- if (!isAccessible(env, t)) {
++ if (!isAccessible(env, types.erasure(t))) {
+ Symbol location = env.enclClass.sym;
+ reportMC(env.tree, MethodCheckDiag.INACCESSIBLE_VARARGS, inferenceContext, t, Kinds.kindName(location), location);
+ }
+@@ -4087,7 +4086,7 @@
+ s : new MethodSymbol(
+ s.flags(),
+ s.name,
+- types.createMethodTypeWithThrown(mt, allThrown),
++ types.createMethodTypeWithThrown(s.type, allThrown),
+ s.owner);
+ }
+ }
+--- ./langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -1779,15 +1779,17 @@
+ // The method wasn't found: emit a warning and recover
+ JavaFileObject prevSource = log.useSource(requestingOwner.classfile);
+ try {
+- if (failure == null) {
+- log.warning("annotation.method.not.found",
+- container,
+- name);
+- } else {
+- log.warning("annotation.method.not.found.reason",
+- container,
+- name,
+- failure.getDetailValue());//diagnostic, if present
++ if (lintClassfile) {
++ if (failure == null) {
++ log.warning("annotation.method.not.found",
++ container,
++ name);
++ } else {
++ log.warning("annotation.method.not.found.reason",
++ container,
++ name,
++ failure.getDetailValue()); //diagnostic, if present
++ }
+ }
+ } finally {
+ log.useSource(prevSource);
+--- ./langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -1027,6 +1027,7 @@
+ l.nonEmpty();
+ l = l.tail) {
+ ClassSymbol inner = l.head;
++ inner.markAbstractIfNeeded(types);
+ char flags = (char) adjustFlags(inner.flags_field);
+ if ((flags & INTERFACE) != 0) flags |= ABSTRACT; // Interfaces are always ABSTRACT
+ if (inner.name.isEmpty()) flags &= ~FINAL; // Anonymous class: unset FINAL flag
+@@ -1186,7 +1187,7 @@
+ Assert.check(r.start_pc >= 0
+ && r.start_pc <= code.cp);
+ databuf.appendChar(r.start_pc);
+- Assert.check(r.length >= 0
++ Assert.check(r.length > 0
+ && (r.start_pc + r.length) <= code.cp);
+ databuf.appendChar(r.length);
+ VarSymbol sym = var.sym;
+--- ./langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -182,8 +182,6 @@
+
+ final MethodSymbol meth;
+
+- final LVTRanges lvtRanges;
+-
+ /** Construct a code object, given the settings of the fatcode,
+ * debugging info switches and the CharacterRangeTable.
+ */
+@@ -196,8 +194,7 @@
+ CRTable crt,
+ Symtab syms,
+ Types types,
+- Pool pool,
+- LVTRanges lvtRanges) {
++ Pool pool) {
+ this.meth = meth;
+ this.fatcode = fatcode;
+ this.lineMap = lineMap;
+@@ -219,7 +216,6 @@
+ state = new State();
+ lvar = new LocalVar[20];
+ this.pool = pool;
+- this.lvtRanges = lvtRanges;
+ }
+
+
+@@ -1193,7 +1189,9 @@
+ public int entryPoint(State state) {
+ int pc = curCP();
+ alive = true;
+- this.state = state.dup();
++ State newState = state.dup();
++ setDefined(newState.defined);
++ this.state = newState;
+ Assert.check(state.stacksize <= max_stack);
+ if (debugCode) System.err.println("entry point " + state);
+ pendingStackMap = needStackMap;
+@@ -1206,7 +1204,9 @@
+ public int entryPoint(State state, Type pushed) {
+ int pc = curCP();
+ alive = true;
+- this.state = state.dup();
++ State newState = state.dup();
++ setDefined(newState.defined);
++ this.state = newState;
+ Assert.check(state.stacksize <= max_stack);
+ this.state.push(pushed);
+ if (debugCode) System.err.println("entry point " + state);
+@@ -2008,27 +2008,6 @@
+ state.defined.excl(adr);
+ }
+
+-
+- public void closeAliveRanges(JCTree tree) {
+- closeAliveRanges(tree, cp);
+- }
+-
+- public void closeAliveRanges(JCTree tree, int closingCP) {
+- List<VarSymbol> locals = lvtRanges.getVars(meth, tree);
+- for (LocalVar localVar: lvar) {
+- for (VarSymbol aliveLocal : locals) {
+- if (localVar != null) {
+- if (localVar.sym == aliveLocal && localVar.lastRange() != null) {
+- char length = (char)(closingCP - localVar.lastRange().start_pc);
+- if (length < Character.MAX_VALUE) {
+- localVar.closeRange(length);
+- }
+- }
+- }
+- }
+- }
+- }
+-
+ void adjustAliveRanges(int oldCP, int delta) {
+ for (LocalVar localVar: lvar) {
+ if (localVar != null) {
+@@ -2193,7 +2172,11 @@
+ boolean keepLocalVariables = varDebugInfo ||
+ (var.sym.isExceptionParameter() && var.sym.hasTypeAnnotations());
+ if (!keepLocalVariables) return;
+- if ((var.sym.flags() & Flags.SYNTHETIC) != 0) return;
++ //don't keep synthetic vars, unless they are lambda method parameters
++ boolean ignoredSyntheticVar = (var.sym.flags() & Flags.SYNTHETIC) != 0 &&
++ ((var.sym.owner.flags() & Flags.LAMBDA_METHOD) == 0 ||
++ (var.sym.flags() & Flags.PARAMETER) == 0);
++ if (ignoredSyntheticVar) return;
+ if (varBuffer == null)
+ varBuffer = new LocalVar[20];
+ else
+--- ./langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -101,10 +101,6 @@
+ */
+ private Pool pool;
+
+- /** LVTRanges info.
+- */
+- private LVTRanges lvtRanges;
+-
+ private final boolean typeAnnoAsserts;
+
+ protected Gen(Context context) {
+@@ -137,9 +133,6 @@
+ options.isUnset(G_CUSTOM)
+ ? options.isSet(G)
+ : options.isSet(G_CUSTOM, "vars");
+- if (varDebugInfo) {
+- lvtRanges = LVTRanges.instance(context);
+- }
+ genCrt = options.isSet(XJCOV);
+ debugCode = options.isSet("debugcode");
+ allowInvokedynamic = target.hasInvokedynamic() || options.isSet("invokedynamic");
+@@ -493,7 +486,7 @@
+ JCBlock block = (JCBlock)def;
+ if ((block.flags & STATIC) != 0)
+ clinitCode.append(block);
+- else
++ else if ((block.flags & SYNTHETIC) == 0)
+ initCode.append(block);
+ break;
+ case METHODDEF:
+@@ -521,6 +514,10 @@
+ clinitTAs.addAll(getAndRemoveNonFieldTAs(sym));
+ } else {
+ checkStringConstant(vdef.init.pos(), sym.getConstValue());
++ /* if the init contains a reference to an external class, add it to the
++ * constant's pool
++ */
++ vdef.init.accept(classReferenceVisitor);
+ }
+ }
+ break;
+@@ -1103,8 +1100,7 @@
+ : null,
+ syms,
+ types,
+- pool,
+- varDebugInfo ? lvtRanges : null);
++ pool);
+ items = new Items(pool, code, syms, types);
+ if (code.debugCode) {
+ System.err.println(meth + " for body " + tree);
+@@ -1207,30 +1203,14 @@
+ Chain loopDone = c.jumpFalse();
+ code.resolve(c.trueJumps);
+ genStat(body, loopEnv, CRT_STATEMENT | CRT_FLOW_TARGET);
+- if (varDebugInfo) {
+- checkLoopLocalVarRangeEnding(loop, body,
+- LoopLocalVarRangeEndingPoint.BEFORE_STEPS);
+- }
+ code.resolve(loopEnv.info.cont);
+ genStats(step, loopEnv);
+- if (varDebugInfo) {
+- checkLoopLocalVarRangeEnding(loop, body,
+- LoopLocalVarRangeEndingPoint.AFTER_STEPS);
+- }
+ code.resolve(code.branch(goto_), startpc);
+ code.resolve(loopDone);
+ } else {
+ genStat(body, loopEnv, CRT_STATEMENT | CRT_FLOW_TARGET);
+- if (varDebugInfo) {
+- checkLoopLocalVarRangeEnding(loop, body,
+- LoopLocalVarRangeEndingPoint.BEFORE_STEPS);
+- }
+ code.resolve(loopEnv.info.cont);
+ genStats(step, loopEnv);
+- if (varDebugInfo) {
+- checkLoopLocalVarRangeEnding(loop, body,
+- LoopLocalVarRangeEndingPoint.AFTER_STEPS);
+- }
+ CondItem c;
+ if (cond != null) {
+ code.statBegin(cond.pos);
+@@ -1247,44 +1227,6 @@
+ }
+ }
+
+- private enum LoopLocalVarRangeEndingPoint {
+- BEFORE_STEPS,
+- AFTER_STEPS,
+- }
+-
+- /**
+- * Checks whether we have reached an alive range ending point for local
+- * variables after a loop.
+- *
+- * Local variables alive range ending point for loops varies depending
+- * on the loop type. The range can be closed before or after the code
+- * for the steps sentences has been generated.
+- *
+- * - While loops has no steps so in that case the range is closed just
+- * after the body of the loop.
+- *
+- * - For-like loops may have steps so as long as the steps sentences
+- * can possibly contain non-synthetic local variables, the alive range
+- * for local variables must be closed after the steps in this case.
+- */
+- private void checkLoopLocalVarRangeEnding(JCTree loop, JCTree body,
+- LoopLocalVarRangeEndingPoint endingPoint) {
+- if (varDebugInfo && lvtRanges.containsKey(code.meth, body)) {
+- switch (endingPoint) {
+- case BEFORE_STEPS:
+- if (!loop.hasTag(FORLOOP)) {
+- code.closeAliveRanges(body);
+- }
+- break;
+- case AFTER_STEPS:
+- if (loop.hasTag(FORLOOP)) {
+- code.closeAliveRanges(body);
+- }
+- break;
+- }
+- }
+- }
+-
+ public void visitForeachLoop(JCEnhancedForLoop tree) {
+ throw new AssertionError(); // should have been removed by Lower.
+ }
+@@ -1398,9 +1340,6 @@
+
+ // Generate code for the statements in this case.
+ genStats(c.stats, switchEnv, CRT_FLOW_TARGET);
+- if (varDebugInfo && lvtRanges.containsKey(code.meth, c.stats.last())) {
+- code.closeAliveRanges(c.stats.last());
+- }
+ }
+
+ // Resolve all breaks.
+@@ -1557,9 +1496,6 @@
+ genFinalizer(env);
+ code.statBegin(TreeInfo.endPos(env.tree));
+ Chain exitChain = code.branch(goto_);
+- if (varDebugInfo && lvtRanges.containsKey(code.meth, body)) {
+- code.closeAliveRanges(body);
+- }
+ endFinalizerGap(env);
+ if (startpc != endpc) for (List<JCCatch> l = catchers; l.nonEmpty(); l = l.tail) {
+ // start off with exception on stack
+@@ -1815,17 +1751,11 @@
+ code.resolve(c.trueJumps);
+ genStat(tree.thenpart, env, CRT_STATEMENT | CRT_FLOW_TARGET);
+ thenExit = code.branch(goto_);
+- if (varDebugInfo && lvtRanges.containsKey(code.meth, tree.thenpart)) {
+- code.closeAliveRanges(tree.thenpart, code.cp);
+- }
+ }
+ if (elseChain != null) {
+ code.resolve(elseChain);
+ if (tree.elsepart != null) {
+ genStat(tree.elsepart, env,CRT_STATEMENT | CRT_FLOW_TARGET);
+- if (varDebugInfo && lvtRanges.containsKey(code.meth, tree.elsepart)) {
+- code.closeAliveRanges(tree.elsepart);
+- }
+ }
+ }
+ code.resolve(thenExit);
+@@ -2505,25 +2435,18 @@
+ && !allowGenerics // no Miranda methods available with generics
+ )
+ implementInterfaceMethods(c);
+- cdef.defs = normalizeDefs(cdef.defs, c);
+ c.pool = pool;
+ pool.reset();
++ /* method normalizeDefs() can add references to external classes into the constant pool
++ * so it should be called after pool.reset()
++ */
++ cdef.defs = normalizeDefs(cdef.defs, c);
+ generateReferencesToPrunedTree(c, pool);
+ Env<GenContext> localEnv =
+ new Env<GenContext>(cdef, new GenContext());
+ localEnv.toplevel = env.toplevel;
+ localEnv.enclClass = cdef;
+
+- /* We must not analyze synthetic methods
+- */
+- if (varDebugInfo && (cdef.sym.flags() & SYNTHETIC) == 0) {
+- try {
+- new LVTAssignAnalyzer().analyzeTree(localEnv);
+- } catch (Throwable e) {
+- throw e;
+- }
+- }
+-
+ for (List<JCTree> l = cdef.defs; l.nonEmpty(); l = l.tail) {
+ genDef(l.head, localEnv);
+ }
+@@ -2609,282 +2532,4 @@
+ }
+ }
+
+- class LVTAssignAnalyzer
+- extends Flow.AbstractAssignAnalyzer<LVTAssignAnalyzer.LVTAssignPendingExit> {
+-
+- final LVTBits lvtInits;
+-
+- /* This class is anchored to a context dependent tree. The tree can
+- * vary inside the same instruction for example in the switch instruction
+- * the same FlowBits instance can be anchored to the whole tree, or
+- * to a given case. The aim is to always anchor the bits to the tree
+- * capable of closing a DA range.
+- */
+- class LVTBits extends Bits {
+-
+- JCTree currentTree;
+- private int[] oldBits = null;
+- BitsState stateBeforeOp;
+-
+- @Override
+- public void clear() {
+- generalOp(null, -1, BitsOpKind.CLEAR);
+- }
+-
+- @Override
+- protected void internalReset() {
+- super.internalReset();
+- oldBits = null;
+- }
+-
+- @Override
+- public Bits assign(Bits someBits) {
+- // bits can be null
+- oldBits = bits;
+- stateBeforeOp = currentState;
+- super.assign(someBits);
+- changed();
+- return this;
+- }
+-
+- @Override
+- public void excludeFrom(int start) {
+- generalOp(null, start, BitsOpKind.EXCL_RANGE);
+- }
+-
+- @Override
+- public void excl(int x) {
+- Assert.check(x >= 0);
+- generalOp(null, x, BitsOpKind.EXCL_BIT);
+- }
+-
+- @Override
+- public Bits andSet(Bits xs) {
+- return generalOp(xs, -1, BitsOpKind.AND_SET);
+- }
+-
+- @Override
+- public Bits orSet(Bits xs) {
+- return generalOp(xs, -1, BitsOpKind.OR_SET);
+- }
+-
+- @Override
+- public Bits diffSet(Bits xs) {
+- return generalOp(xs, -1, BitsOpKind.DIFF_SET);
+- }
+-
+- @Override
+- public Bits xorSet(Bits xs) {
+- return generalOp(xs, -1, BitsOpKind.XOR_SET);
+- }
+-
+- private Bits generalOp(Bits xs, int i, BitsOpKind opKind) {
+- Assert.check(currentState != BitsState.UNKNOWN);
+- oldBits = dupBits();
+- stateBeforeOp = currentState;
+- switch (opKind) {
+- case AND_SET:
+- super.andSet(xs);
+- break;
+- case OR_SET:
+- super.orSet(xs);
+- break;
+- case XOR_SET:
+- super.xorSet(xs);
+- break;
+- case DIFF_SET:
+- super.diffSet(xs);
+- break;
+- case CLEAR:
+- super.clear();
+- break;
+- case EXCL_BIT:
+- super.excl(i);
+- break;
+- case EXCL_RANGE:
+- super.excludeFrom(i);
+- break;
+- }
+- changed();
+- return this;
+- }
+-
+- /* The tree we need to anchor the bits instance to.
+- */
+- LVTBits at(JCTree tree) {
+- this.currentTree = tree;
+- return this;
+- }
+-
+- /* If the instance should be changed but the tree is not a closing
+- * tree then a reset is needed or the former tree can mistakingly be
+- * used.
+- */
+- LVTBits resetTree() {
+- this.currentTree = null;
+- return this;
+- }
+-
+- /** This method will be called after any operation that causes a change to
+- * the bits. Subclasses can thus override it in order to extract information
+- * from the changes produced to the bits by the given operation.
+- */
+- public void changed() {
+- if (currentTree != null &&
+- stateBeforeOp != BitsState.UNKNOWN &&
+- trackTree(currentTree)) {
+- List<VarSymbol> locals = lvtRanges
+- .getVars(currentMethod, currentTree);
+- locals = locals != null ?
+- locals : List.<VarSymbol>nil();
+- for (JCVariableDecl vardecl : vardecls) {
+- //once the first is null, the rest will be so.
+- if (vardecl == null) {
+- break;
+- }
+- if (trackVar(vardecl.sym) && bitChanged(vardecl.sym.adr)) {
+- locals = locals.prepend(vardecl.sym);
+- }
+- }
+- if (!locals.isEmpty()) {
+- lvtRanges.setEntry(currentMethod,
+- currentTree, locals);
+- }
+- }
+- }
+-
+- boolean bitChanged(int x) {
+- boolean isMemberOfBits = isMember(x);
+- int[] tmp = bits;
+- bits = oldBits;
+- boolean isMemberOfOldBits = isMember(x);
+- bits = tmp;
+- return (!isMemberOfBits && isMemberOfOldBits);
+- }
+-
+- boolean trackVar(VarSymbol var) {
+- return (var.owner.kind == MTH &&
+- (var.flags() & PARAMETER) == 0 &&
+- trackable(var));
+- }
+-
+- boolean trackTree(JCTree tree) {
+- switch (tree.getTag()) {
+- // of course a method closes the alive range of a local variable.
+- case METHODDEF:
+- // for while loops we want only the body
+- case WHILELOOP:
+- return false;
+- }
+- return true;
+- }
+-
+- }
+-
+- public class LVTAssignPendingExit extends
+- Flow.AbstractAssignAnalyzer<LVTAssignPendingExit>.AbstractAssignPendingExit {
+-
+- LVTAssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
+- super(tree, inits, uninits);
+- }
+-
+- @Override
+- public void resolveJump(JCTree tree) {
+- lvtInits.at(tree);
+- super.resolveJump(tree);
+- }
+- }
+-
+- private LVTAssignAnalyzer() {
+- flow.super();
+- lvtInits = new LVTBits();
+- inits = lvtInits;
+- }
+-
+- @Override
+- protected void markDead(JCTree tree) {
+- lvtInits.at(tree).inclRange(returnadr, nextadr);
+- super.markDead(tree);
+- }
+-
+- @Override
+- protected void merge(JCTree tree) {
+- lvtInits.at(tree);
+- super.merge(tree);
+- }
+-
+- boolean isSyntheticOrMandated(Symbol sym) {
+- return (sym.flags() & (SYNTHETIC | MANDATED)) != 0;
+- }
+-
+- @Override
+- protected boolean trackable(VarSymbol sym) {
+- if (isSyntheticOrMandated(sym)) {
+- //fast check to avoid tracking synthetic or mandated variables
+- return false;
+- }
+- return super.trackable(sym);
+- }
+-
+- @Override
+- protected void initParam(JCVariableDecl def) {
+- if (!isSyntheticOrMandated(def.sym)) {
+- super.initParam(def);
+- }
+- }
+-
+- @Override
+- protected void assignToInits(JCTree tree, Bits bits) {
+- lvtInits.at(tree);
+- lvtInits.assign(bits);
+- }
+-
+- @Override
+- protected void andSetInits(JCTree tree, Bits bits) {
+- lvtInits.at(tree);
+- lvtInits.andSet(bits);
+- }
+-
+- @Override
+- protected void orSetInits(JCTree tree, Bits bits) {
+- lvtInits.at(tree);
+- lvtInits.orSet(bits);
+- }
+-
+- @Override
+- protected void exclVarFromInits(JCTree tree, int adr) {
+- lvtInits.at(tree);
+- lvtInits.excl(adr);
+- }
+-
+- @Override
+- protected LVTAssignPendingExit createNewPendingExit(JCTree tree, Bits inits, Bits uninits) {
+- return new LVTAssignPendingExit(tree, inits, uninits);
+- }
+-
+- MethodSymbol currentMethod;
+-
+- @Override
+- public void visitMethodDef(JCMethodDecl tree) {
+- if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0
+- && (tree.sym.flags() & LAMBDA_METHOD) == 0) {
+- return;
+- }
+- if (tree.name.equals(names.clinit)) {
+- return;
+- }
+- boolean enumClass = (tree.sym.owner.flags() & ENUM) != 0;
+- if (enumClass &&
+- (tree.name.equals(names.valueOf) ||
+- tree.name.equals(names.values) ||
+- tree.name.equals(names.init))) {
+- return;
+- }
+- currentMethod = tree.sym;
+-
+- super.visitMethodDef(tree);
+- }
+-
+- }
+-
+ }
+--- ./langtools/src/share/classes/com/sun/tools/javac/jvm/LVTRanges.java Mon Jun 01 11:44:19 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,129 +0,0 @@
+-/*
+- * Copyright (c) 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. 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 com.sun.tools.javac.jvm;
+-
+-import java.util.Map;
+-import java.util.Map.Entry;
+-import java.util.WeakHashMap;
+-
+-import com.sun.tools.javac.code.Symbol.MethodSymbol;
+-import com.sun.tools.javac.code.Symbol.VarSymbol;
+-import com.sun.tools.javac.tree.JCTree;
+-import com.sun.tools.javac.util.Context;
+-import com.sun.tools.javac.util.List;
+-
+-/** This class contains a one to many relation between a tree and a set of variables.
+- * The relation implies that the given tree closes the DA (definite assignment)
+- * range for the set of variables.
+- *
+- * <p><b>This is NOT part of any supported API.
+- * If you write code that depends on this, you do so at your own risk.
+- * This code and its internal interfaces are subject to change or
+- * deletion without notice.</b>
+- */
+-public class LVTRanges {
+- /** The context key for the LVT ranges. */
+- protected static final Context.Key<LVTRanges> lvtRangesKey = new Context.Key<>();
+-
+- /** Get the LVTRanges instance for this context. */
+- public static LVTRanges instance(Context context) {
+- LVTRanges instance = context.get(lvtRangesKey);
+- if (instance == null) {
+- instance = new LVTRanges(context);
+- }
+- return instance;
+- }
+-
+- private static final long serialVersionUID = 1812267524140424433L;
+-
+- protected Context context;
+-
+- protected Map<MethodSymbol, Map<JCTree, List<VarSymbol>>>
+- aliveRangeClosingTrees = new WeakHashMap<>();
+-
+- public LVTRanges(Context context) {
+- this.context = context;
+- context.put(lvtRangesKey, this);
+- }
+-
+- public List<VarSymbol> getVars(MethodSymbol method, JCTree tree) {
+- Map<JCTree, List<VarSymbol>> varMap = aliveRangeClosingTrees.get(method);
+- return (varMap != null) ? varMap.get(tree) : null;
+- }
+-
+- public boolean containsKey(MethodSymbol method, JCTree tree) {
+- Map<JCTree, List<VarSymbol>> varMap = aliveRangeClosingTrees.get(method);
+- if (varMap == null) {
+- return false;
+- }
+- return varMap.containsKey(tree);
+- }
+-
+- public void setEntry(MethodSymbol method, JCTree tree, List<VarSymbol> vars) {
+- Map<JCTree, List<VarSymbol>> varMap = aliveRangeClosingTrees.get(method);
+- if (varMap != null) {
+- varMap.put(tree, vars);
+- } else {
+- varMap = new WeakHashMap<>();
+- varMap.put(tree, vars);
+- aliveRangeClosingTrees.put(method, varMap);
+- }
+- }
+-
+- public List<VarSymbol> removeEntry(MethodSymbol method, JCTree tree) {
+- Map<JCTree, List<VarSymbol>> varMap = aliveRangeClosingTrees.get(method);
+- if (varMap != null) {
+- List<VarSymbol> result = varMap.remove(tree);
+- if (varMap.isEmpty()) {
+- aliveRangeClosingTrees.remove(method);
+- }
+- return result;
+- }
+- return null;
+- }
+-
+- /* This method should be used for debugging LVT related issues.
+- */
+- @Override
+- public String toString() {
+- String result = "";
+- for (Entry<MethodSymbol, Map<JCTree, List<VarSymbol>>> mainEntry: aliveRangeClosingTrees.entrySet()) {
+- result += "Method: \n" + mainEntry.getKey().flatName() + "\n";
+- int i = 1;
+- for (Entry<JCTree, List<VarSymbol>> treeEntry: mainEntry.getValue().entrySet()) {
+- result += " Tree " + i + ": \n" + treeEntry.getKey().toString() + "\n";
+- result += " Variables closed:\n";
+- for (VarSymbol var: treeEntry.getValue()) {
+- result += " " + var.toString();
+- }
+- result += "\n";
+- i++;
+- }
+- }
+- return result;
+- }
+-
+-}
+--- ./langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Wed Jul 01 21:54:20 2015 -0700
+@@ -2720,7 +2720,7 @@
+ } else {
+ JCExpression t = term(EXPR | TYPE);
+ if ((lastmode & TYPE) != 0 && LAX_IDENTIFIER.accepts(token.kind)) {
+- return variableDeclarators(modifiersOpt(), t, stats).toList();
++ return variableDeclarators(mods(pos, 0, List.<JCAnnotation>nil()), t, stats).toList();
+ } else if ((lastmode & TYPE) != 0 && token.kind == COLON) {
+ error(pos, "bad.initializer", "for-loop");
+ return List.of((JCStatement)F.at(pos).VarDef(null, null, t, null));
+@@ -2829,16 +2829,20 @@
+ default: break;
+ }
+
+- /* A modifiers tree with no modifier tokens or annotations
+- * has no text position. */
+- if ((flags & (Flags.ModifierFlags | Flags.ANNOTATION)) == 0 && annotations.isEmpty())
+- pos = Position.NOPOS;
+-
+- JCModifiers mods = F.at(pos).Modifiers(flags, annotations.toList());
+- if (pos != Position.NOPOS)
+- storeEnd(mods, S.prevToken().endPos);
+- return mods;
++ return mods(pos, flags, annotations.toList());
+ }
++ //where
++ JCModifiers mods(int pos, long flags, List<JCAnnotation> annotations) {
++ /* A modifiers tree with no modifier tokens or annotations
++ * has no text position. */
++ if ((flags & (Flags.ModifierFlags | Flags.ANNOTATION)) == 0 && annotations.isEmpty())
++ pos = Position.NOPOS;
++
++ JCModifiers mods = F.at(pos).Modifiers(flags, annotations);
++ if (pos != Position.NOPOS)
++ storeEnd(mods, S.prevToken().endPos);
++ return mods;
++ }
+
+ /** Annotation = "@" Qualident [ "(" AnnotationFieldValues ")" ]
+ *
+--- ./langtools/src/share/classes/com/sun/tools/javac/resources/javac.properties Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/resources/javac.properties Wed Jul 01 21:54:20 2015 -0700
+@@ -232,8 +232,8 @@
+
+ javac.msg.bug=\
+ An exception has occurred in the compiler ({0}). \
+-Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) \
+-after checking the Bug Parade for duplicates. \
++Please file a bug at the Java Bug Database (http://bugreport.java.com/bugreport/) \
++after checking the database for duplicates. \
+ Include your program and the following diagnostic in your report. Thank you.
+
+ javac.msg.io=\
+--- ./langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -133,7 +133,7 @@
+
+ javac.msg.usage.nonstandard.footer=\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002
+
+-javac.msg.bug=\u30B3\u30F3\u30D1\u30A4\u30E9\u3067\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F({0})\u3002Bug Parade\u3067\u91CD\u8907\u304C\u306A\u3044\u304B\u3092\u3054\u78BA\u8A8D\u306E\u3046\u3048\u3001Java Developer Connection (http://java.sun.com/webapps/bugreport)\u3067bug\u306E\u767B\u9332\u3092\u304A\u9858\u3044\u3044\u305F\u3057\u307E\u3059\u3002\u30EC\u30DD\u30FC\u30C8\u306B\u306F\u3001\u305D\u306E\u30D7\u30ED\u30B0\u30E9\u30E0\u3068\u4E0B\u8A18\u306E\u8A3A\u65AD\u5185\u5BB9\u3092\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u3054\u5354\u529B\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002
++javac.msg.bug=\u30B3\u30F3\u30D1\u30A4\u30E9\u3067\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F({0})\u3002\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3067\u91CD\u8907\u304C\u306A\u3044\u304B\u3092\u3054\u78BA\u8A8D\u306E\u3046\u3048\u3001Java Bug Database (http://bugreport.java.com/bugreport/)\u3067bug\u306E\u767B\u9332\u3092\u304A\u9858\u3044\u3044\u305F\u3057\u307E\u3059\u3002\u30EC\u30DD\u30FC\u30C8\u306B\u306F\u3001\u305D\u306E\u30D7\u30ED\u30B0\u30E9\u30E0\u3068\u4E0B\u8A18\u306E\u8A3A\u65AD\u5185\u5BB9\u3092\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u3054\u5354\u529B\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002
+
+ javac.msg.io=\n\n\u5165\u51FA\u529B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
+
+--- ./langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -133,7 +133,7 @@
+
+ javac.msg.usage.nonstandard.footer=\u8FD9\u4E9B\u9009\u9879\u90FD\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002
+
+-javac.msg.bug=\u7F16\u8BD1\u5668 ({0}) \u4E2D\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\u3002 \u5982\u679C\u5728 Bug Parade \u4E2D\u6CA1\u6709\u627E\u5230\u8BE5\u9519\u8BEF, \u8BF7\u5728 Java Developer Connection (http://java.sun.com/webapps/bugreport) \u4E2D\u5EFA\u7ACB Bug\u3002\u8BF7\u5728\u62A5\u544A\u4E2D\u9644\u4E0A\u60A8\u7684\u7A0B\u5E8F\u548C\u4EE5\u4E0B\u8BCA\u65AD\u4FE1\u606F\u3002\u8C22\u8C22\u3002
++javac.msg.bug=\u7F16\u8BD1\u5668 ({0}) \u4E2D\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\u3002\u5982\u679C\u5728 Java Bug Database (http://bugreport.java.com/bugreport/) \u4E2D\u6CA1\u6709\u627E\u5230\u8BE5\u9519\u8BEF, \u8BF7\u5728\u8BE5\u6570\u636E\u5E93\u4E2D\u5EFA\u7ACB Bug\u3002\u8BF7\u5728\u62A5\u544A\u4E2D\u9644\u4E0A\u60A8\u7684\u7A0B\u5E8F\u548C\u4EE5\u4E0B\u8BCA\u65AD\u4FE1\u606F\u3002\u8C22\u8C22\u3002
+
+ javac.msg.io=\n\n\u53D1\u751F\u8F93\u5165/\u8F93\u51FA\u9519\u8BEF\u3002\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605\u4EE5\u4E0B\u5806\u6808\u8DDF\u8E2A\u3002\n
+
+--- ./langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Wed Jul 01 21:54:20 2015 -0700
+@@ -28,6 +28,7 @@
+
+
+ import com.sun.source.tree.Tree;
++import com.sun.source.util.TreePath;
+ import com.sun.tools.javac.code.*;
+ import com.sun.tools.javac.comp.AttrContext;
+ import com.sun.tools.javac.comp.Env;
+@@ -351,6 +352,18 @@
+ return (lit.typetag == BOT);
+ }
+
++ /** Return true iff this tree is a child of some annotation. */
++ public static boolean isInAnnotation(Env<?> env, JCTree tree) {
++ TreePath tp = TreePath.getPath(env.toplevel, tree);
++ if (tp != null) {
++ for (Tree t : tp) {
++ if (t.getKind() == Tree.Kind.ANNOTATION)
++ return true;
++ }
++ }
++ return false;
++ }
++
+ public static String getCommentText(Env<?> env, JCTree tree) {
+ DocCommentTable docComments = (tree.hasTag(JCTree.Tag.TOPLEVEL))
+ ? ((JCCompilationUnit) tree).docComments
+--- ./langtools/src/share/classes/com/sun/tools/javac/util/Bits.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/javac/util/Bits.java Wed Jul 01 21:54:20 2015 -0700
+@@ -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
+@@ -84,20 +84,6 @@
+
+ }
+
+- public enum BitsOpKind {
+- INIT,
+- CLEAR,
+- INCL_BIT,
+- EXCL_BIT,
+- ASSIGN,
+- AND_SET,
+- OR_SET,
+- DIFF_SET,
+- XOR_SET,
+- INCL_RANGE,
+- EXCL_RANGE,
+- }
+-
+ private final static int wordlen = 32;
+ private final static int wordshift = 5;
+ private final static int wordmask = wordlen - 1;
+--- ./langtools/src/share/classes/com/sun/tools/jdeps/Analyzer.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/jdeps/Analyzer.java Wed Jul 01 21:54:20 2015 -0700
+@@ -223,7 +223,7 @@
+ Archive targetArchive = findArchive(t);
+ if (filter.accepts(o, archive, t, targetArchive)) {
+ addDep(o, t);
+- if (!requires.contains(targetArchive)) {
++ if (archive != targetArchive && !requires.contains(targetArchive)) {
+ requires.add(targetArchive);
+ }
+ }
+--- ./langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java Wed Jul 01 21:54:20 2015 -0700
+@@ -489,9 +489,11 @@
+
+ List<Archive> archives = new ArrayList<>();
+ Deque<String> roots = new LinkedList<>();
++ List<Path> paths = new ArrayList<>();
+ for (String s : classes) {
+ Path p = Paths.get(s);
+ if (Files.exists(p)) {
++ paths.add(p);
+ archives.add(Archive.getInstance(p));
+ } else {
+ if (isValidClassName(s)) {
+@@ -504,7 +506,7 @@
+ sourceLocations.addAll(archives);
+
+ List<Archive> classpaths = new ArrayList<>(); // for class file lookup
+- classpaths.addAll(getClassPathArchives(options.classpath));
++ classpaths.addAll(getClassPathArchives(options.classpath, paths));
+ if (options.includePattern != null) {
+ archives.addAll(classpaths);
+ }
+@@ -545,6 +547,9 @@
+ deque.add(cn);
+ }
+ a.addClass(d.getOrigin(), d.getTarget());
++ } else {
++ // ensure that the parsed class is added the archive
++ a.addClass(d.getOrigin());
+ }
+ }
+ for (String name : a.reader().skippedEntries()) {
+@@ -592,6 +597,9 @@
+ if (!doneClasses.contains(cn) && !deque.contains(cn)) {
+ deque.add(cn);
+ }
++ } else {
++ // ensure that the parsed class is added the archive
++ a.addClass(d.getOrigin());
+ }
+ }
+ }
+@@ -743,36 +751,52 @@
+ }
+ }
+
+- private List<Archive> getClassPathArchives(String paths) throws IOException {
++ /*
++ * Returns the list of Archive specified in cpaths and not included
++ * initialArchives
++ */
++ private List<Archive> getClassPathArchives(String cpaths, List<Path> initialArchives)
++ throws IOException
++ {
+ List<Archive> result = new ArrayList<>();
+- if (paths.isEmpty()) {
++ if (cpaths.isEmpty()) {
+ return result;
+ }
+- for (String p : paths.split(File.pathSeparator)) {
++
++ List<Path> paths = new ArrayList<>();
++ for (String p : cpaths.split(File.pathSeparator)) {
+ if (p.length() > 0) {
+- List<Path> files = new ArrayList<>();
+ // wildcard to parse all JAR files e.g. -classpath dir/*
+ int i = p.lastIndexOf(".*");
+ if (i > 0) {
+ Path dir = Paths.get(p.substring(0, i));
+ try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.jar")) {
+ for (Path entry : stream) {
+- files.add(entry);
++ paths.add(entry);
+ }
+ }
+ } else {
+- files.add(Paths.get(p));
+- }
+- for (Path f : files) {
+- if (Files.exists(f)) {
+- result.add(Archive.getInstance(f));
+- }
++ paths.add(Paths.get(p));
+ }
+ }
+ }
++ for (Path p : paths) {
++ if (Files.exists(p) && !hasSameFile(initialArchives, p)) {
++ result.add(Archive.getInstance(p));
++ }
++ }
+ return result;
+ }
+
++ private boolean hasSameFile(List<Path> paths, Path p2) throws IOException {
++ for (Path p1 : paths) {
++ if (Files.isSameFile(p1, p2)) {
++ return true;
++ }
++ }
++ return false;
++ }
++
+ class RawOutputFormatter implements Analyzer.Visitor {
+ private final PrintWriter writer;
+ private String pkg = "";
+--- ./langtools/src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java Wed Jul 01 21:54:20 2015 -0700
+@@ -46,7 +46,7 @@
+ */
+ class PlatformClassPath {
+ private static final List<String> NON_PLATFORM_JARFILES =
+- Arrays.asList("alt-rt.jar", "jfxrt.jar", "ant-javafx.jar", "javafx-mx.jar");
++ Arrays.asList("alt-rt.jar", "ant-javafx.jar", "javafx-mx.jar");
+ private static final List<Archive> javaHomeArchives = init();
+
+ static List<Archive> getArchives() {
+@@ -124,6 +124,14 @@
+ */
+ static class JDKArchive extends Archive {
+ private static List<String> PROFILE_JARS = Arrays.asList("rt.jar", "jce.jar");
++ // Workaround: The following packages are not annotated as jdk.Exported
++ private static List<String> EXPORTED_PACKAGES = Arrays.asList(
++ "javax.jnlp",
++ "org.w3c.dom.css",
++ "org.w3c.dom.html",
++ "org.w3c.dom.stylesheets",
++ "org.w3c.dom.xpath"
++ );
+ public static boolean isProfileArchive(Archive archive) {
+ if (archive instanceof JDKArchive) {
+ return PROFILE_JARS.contains(archive.getName());
+@@ -155,7 +163,11 @@
+ * Tests if a given package name is exported.
+ */
+ public boolean isExportedPackage(String pn) {
+- if (Profile.getProfile(pn) != null || "javax.jnlp".equals(pn)) {
++ if (Profile.getProfile(pn) != null) {
++ return true;
++ }
++ // special case for JavaFX and APIs that are not annotated with @jdk.Exported)
++ if (EXPORTED_PACKAGES.contains(pn) || pn.startsWith("javafx.")) {
+ return true;
+ }
+ return exportedPackages.containsKey(pn) ? exportedPackages.get(pn) : false;
+--- ./langtools/test/Makefile Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/Makefile Wed Jul 01 21:54:20 2015 -0700
+@@ -21,7 +21,6 @@
+ ifeq ($(OSNAME), SunOS)
+ SLASH_JAVA = /java
+ PLATFORM = solaris
+- JT_PLATFORM = solaris
+ ARCH = $(shell uname -p)
+ ifeq ($(ARCH), i386)
+ ARCH=i586
+@@ -30,7 +29,6 @@
+ ifeq ($(OSNAME), Linux)
+ SLASH_JAVA = /java
+ PLATFORM = linux
+- JT_PLATFORM = linux
+ ARCH = $(shell uname -m)
+ ifeq ($(ARCH), i386)
+ ARCH=i586
+@@ -38,7 +36,6 @@
+ endif
+ ifeq ($(OSNAME), Darwin)
+ PLATFORM = bsd
+- JT_PLATFORM = linux
+ ARCH = $(shell uname -m)
+ ifeq ($(ARCH), i386)
+ ARCH=i586
+@@ -55,7 +52,6 @@
+
+ ifeq ($(PLATFORM), windows)
+ SLASH_JAVA = J:
+- JT_PLATFORM = win32
+ ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
+ ARCH=ia64
+ else
+@@ -93,8 +89,8 @@
+ else
+ JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
+ endif
+-JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg
+-JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff
++JTREG = $(JTREG_HOME)/bin/jtreg
++JTDIFF = $(JTREG_HOME)/bin/jtdiff
+
+ # Default JCK to run
+ ifdef JPRT_JCK_HOME
+--- ./langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -23,7 +23,7 @@
+
+ /*
+ * @test
+- * @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549
++ * @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461
+ * @summary Run tests on doclet stylesheet.
+ * @author jamieh
+ * @library ../lib/
+@@ -34,7 +34,7 @@
+ public class TestStylesheet extends JavadocTester {
+
+ //Test information.
+- private static final String BUG_ID = "4494033-7028815-7052425-8007338";
++ private static final String BUG_ID = "4494033-7028815-7052425-8007338-8072461";
+
+ //Javadoc arguments.
+ private static final String[] ARGS = new String[] {
+@@ -123,6 +123,23 @@
+ "}"},
+ {BUG_ID + FS + "stylesheet.css",
+ "@import url('resources/fonts/dejavu.css');"},
++ // Test the formatting styles for proper content display in use and constant values pages.
++ {BUG_ID + FS + "stylesheet.css",
++ ".overviewSummary td.colFirst, .overviewSummary th.colFirst," + NL +
++ ".useSummary td.colFirst, .useSummary th.colFirst," + NL +
++ ".overviewSummary td.colOne, .overviewSummary th.colOne," + NL +
++ ".memberSummary td.colFirst, .memberSummary th.colFirst," + NL +
++ ".memberSummary td.colOne, .memberSummary th.colOne," + NL +
++ ".typeSummary td.colFirst{" + NL +
++ " width:25%;" + NL +
++ " vertical-align:top;" + NL +
++ "}"},
++ {BUG_ID + FS + "stylesheet.css",
++ ".overviewSummary td, .memberSummary td, .typeSummary td," + NL +
++ ".useSummary td, .constantsSummary td, .deprecatedSummary td {" + NL +
++ " text-align:left;" + NL +
++ " padding:0px 0px 12px 10px;" + NL +
++ "}"},
+ // Test whether a link to the stylesheet file is inserted properly
+ // in the class documentation.
+ {BUG_ID + FS + "pkg" + FS + "A.html",
+--- ./langtools/test/tools/javac/7153958/CPoolRefClassContainingInlinedCts.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/7153958/CPoolRefClassContainingInlinedCts.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, 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,9 +25,9 @@
+
+ /*
+ * @test
+- * @bug 7153958
++ * @bug 7153958 8073372
+ * @summary add constant pool reference to class containing inlined constants
+- * @compile pkg/ClassToBeStaticallyImported.java CPoolRefClassContainingInlinedCts.java
++ * @compile pkg/ClassToBeStaticallyImportedA.java pkg/ClassToBeStaticallyImportedB.java CPoolRefClassContainingInlinedCts.java
+ * @run main CPoolRefClassContainingInlinedCts
+ */
+
+@@ -38,7 +38,8 @@
+ import java.io.File;
+ import java.io.IOException;
+
+-import static pkg.ClassToBeStaticallyImported.staticField;
++import static pkg.ClassToBeStaticallyImportedA.staticFieldA;
++import static pkg.ClassToBeStaticallyImportedB.staticFieldB;
+
+ public class CPoolRefClassContainingInlinedCts {
+
+@@ -54,10 +55,14 @@
+
+ void checkClassName(String className) {
+ switch (className) {
+- case "SimpleAssignClass" : case "BinaryExpClass":
+- case "UnaryExpClass" : case "CastClass":
+- case "ParensClass" : case "CondClass":
+- case "IfClass" : case "pkg/ClassToBeStaticallyImported":
++ case "SimpleAssignClassA" : case "BinaryExpClassA":
++ case "UnaryExpClassA" : case "CastClassA":
++ case "ParensClassA" : case "CondClassA":
++ case "IfClassA" : case "pkg/ClassToBeStaticallyImportedA":
++ case "SimpleAssignClassB" : case "BinaryExpClassB":
++ case "UnaryExpClassB" : case "CastClassB":
++ case "ParensClassB" : case "CondClassB":
++ case "IfClassB" : case "pkg/ClassToBeStaticallyImportedB":
+ numberOfReferencedClassesToBeChecked++;
+ }
+ }
+@@ -76,59 +81,111 @@
+ }
+ i += cpInfo.size();
+ }
+- if (numberOfReferencedClassesToBeChecked != 8) {
++ if (numberOfReferencedClassesToBeChecked != 16) {
+ throw new AssertionError("Class reference missing in the constant pool");
+ }
+ }
+
+- private int assign = SimpleAssignClass.x;
+- private int binary = BinaryExpClass.x + 1;
+- private int unary = -UnaryExpClass.x;
+- private int cast = (int)CastClass.x;
+- private int parens = (ParensClass.x);
+- private int cond = (CondClass.x == 1) ? 1 : 2;
+- private static int ifConstant;
+- private static int importStatic;
++ private int assignA = SimpleAssignClassA.x;
++ private int binaryA = BinaryExpClassA.x + 1;
++ private int unaryA = -UnaryExpClassA.x;
++ private int castA = (int)CastClassA.x;
++ private int parensA = (ParensClassA.x);
++ private int condA = (CondClassA.x == 1) ? 1 : 2;
++ private static int ifConstantA;
++ private static int importStaticA;
+ static {
+- if (IfClass.x == 1) {
+- ifConstant = 1;
++ if (IfClassA.x == 1) {
++ ifConstantA = 1;
+ } else {
+- ifConstant = 2;
++ ifConstantA = 2;
+ }
+ }
+ static {
+- if (staticField == 1) {
+- importStatic = 1;
++ if (staticFieldA == 1) {
++ importStaticA = 1;
+ } else {
+- importStatic = 2;
++ importStaticA = 2;
++ }
++ }
++
++ // now as final constants
++ private static final int assignB = SimpleAssignClassB.x;
++ private static final int binaryB = BinaryExpClassB.x + 1;
++ private static final int unaryB = -UnaryExpClassB.x;
++ private static final int castB = (int)CastClassB.x;
++ private static final int parensB = (ParensClassB.x);
++ private static final int condB = (CondClassB.x == 1) ? 1 : 2;
++ private static final int ifConstantB;
++ private static final int importStaticB;
++ static {
++ if (IfClassB.x == 1) {
++ ifConstantB = 1;
++ } else {
++ ifConstantB = 2;
++ }
++ }
++ static {
++ if (staticFieldB == 1) {
++ importStaticB = 1;
++ } else {
++ importStaticB = 2;
+ }
+ }
+ }
+
+-class SimpleAssignClass {
++class SimpleAssignClassA {
+ public static final int x = 1;
+ }
+
+-class BinaryExpClass {
++class SimpleAssignClassB {
+ public static final int x = 1;
+ }
+
+-class UnaryExpClass {
++class BinaryExpClassA {
+ public static final int x = 1;
+ }
+
+-class CastClass {
++class BinaryExpClassB {
+ public static final int x = 1;
+ }
+
+-class ParensClass {
++class UnaryExpClassA {
+ public static final int x = 1;
+ }
+
+-class CondClass {
++class UnaryExpClassB {
+ public static final int x = 1;
+ }
+
+-class IfClass {
++class CastClassA {
+ public static final int x = 1;
+ }
++
++class CastClassB {
++ public static final int x = 1;
++}
++
++class ParensClassA {
++ public static final int x = 1;
++}
++
++class ParensClassB {
++ public static final int x = 1;
++}
++
++class CondClassA {
++ public static final int x = 1;
++}
++
++class CondClassB {
++ public static final int x = 1;
++}
++
++class IfClassA {
++ public static final int x = 1;
++}
++
++class IfClassB {
++ public static final int x = 1;
++}
+--- ./langtools/test/tools/javac/7153958/pkg/ClassToBeStaticallyImported.java Mon Jun 01 11:44:19 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,29 +0,0 @@
+-/*
+- * Copyright (c) 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. 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 pkg;
+-
+-public class ClassToBeStaticallyImported {
+- public static final int staticField = 1;
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/7153958/pkg/ClassToBeStaticallyImportedA.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,29 @@
++/*
++ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++package pkg;
++
++public class ClassToBeStaticallyImportedA {
++ public static final int staticFieldA = 1;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/7153958/pkg/ClassToBeStaticallyImportedB.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,29 @@
++/*
++ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++package pkg;
++
++public class ClassToBeStaticallyImportedB {
++ public static final int staticFieldB = 1;
++}
+--- ./langtools/test/tools/javac/MethodParameters/ClassFileVisitor.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/MethodParameters/ClassFileVisitor.java Wed Jul 01 21:54:20 2015 -0700
+@@ -147,6 +147,7 @@
+ public int mAttrs;
+ public int mNumParams;
+ public boolean mSynthetic;
++ public boolean mIsLambda;
+ public boolean mIsConstructor;
+ public boolean mIsClinit;
+ public boolean mIsBridge;
+@@ -165,6 +166,7 @@
+ mIsClinit = mName.equals("<clinit>");
+ prefix = cname + "." + mName + "() - ";
+ mIsBridge = method.access_flags.is(AccessFlags.ACC_BRIDGE);
++ mIsLambda = mSynthetic && mName.startsWith("lambda$");
+
+ if (mIsClinit) {
+ sb = new StringBuilder(); // Discard output
+@@ -225,7 +227,7 @@
+
+ // IMPL: Whether MethodParameters attributes will be generated
+ // for some synthetics is unresolved. For now, assume no.
+- if (mSynthetic) {
++ if (mSynthetic && !mIsLambda) {
+ warn(prefix + "synthetic has MethodParameter attribute");
+ }
+
+@@ -349,10 +351,12 @@
+ } else if (isEnum && mNumParams == 1 && index == 0 && mName.equals("valueOf")) {
+ expect = "name";
+ allowMandated = true;
+- } else if (mIsBridge) {
++ } else if (mIsBridge || mIsLambda) {
+ allowSynthetic = true;
+ /* you can't expect an special name for bridges' parameters.
+- * The name of the original parameters are now copied.
++ * The name of the original parameters are now copied. Likewise
++ * for a method encoding the lambda expression, names are derived
++ * from source lambda's parameters and captured enclosing locals.
+ */
+ expect = null;
+ }
+--- ./langtools/test/tools/javac/MethodParameters/LambdaTest.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/MethodParameters/LambdaTest.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -23,7 +23,7 @@
+
+ /*
+ * @test
+- * @bug 8006582
++ * @bug 8006582 8037546
+ * @summary javac should generate method parameters correctly.
+ * @build Tester
+ * @compile -parameters LambdaTest.java
+@@ -31,8 +31,8 @@
+ */
+
+ /**
+- * Parameter names are not recorded for lambdas. This test verifies
+- * that there are no MethodParameters attribute for lambdas.
++ * Post https://bugs.openjdk.java.net/browse/JDK-8037546, this test verifies
++ * that MethodParameters attribute for lambdas are emitted properly.
+ */
+ class LambdaTest {
+
+--- ./langtools/test/tools/javac/MethodParameters/LambdaTest.out Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/MethodParameters/LambdaTest.out Wed Jul 01 21:54:20 2015 -0700
+@@ -1,7 +1,7 @@
+ class LambdaTest --
+ LambdaTest.<init>()
+ LambdaTest.foo(i)
+-LambdaTest.lambda$static$1(arg0)/*synthetic*/
+-LambdaTest.lambda$null$0(arg0, arg1)/*synthetic*/
++LambdaTest.lambda$static$1(x1/*synthetic*/)/*synthetic*/
++LambdaTest.lambda$null$0(final x1/*synthetic*/, x2/*synthetic*/)/*synthetic*/
+ static interface LambdaTest$I -- inner
+ LambdaTest$I.m(x)
+--- ./langtools/test/tools/javac/MethodParameters/ReflectionVisitor.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/MethodParameters/ReflectionVisitor.java Wed Jul 01 21:54:20 2015 -0700
+@@ -277,7 +277,7 @@
+ param = "final " + param;
+ }
+ sb.append(sep).append(param);
+- if (!m.isBridge() && !expect.equals(param)) {
++ if (!m.isBridge() && !m.getName().startsWith("lambda$") && !expect.equals(param)) {
+ error(prefix + "param[" + i + "]='"
+ + param + "' expected '" + expect + "'");
+ break;
+--- ./langtools/test/tools/javac/annotations/6214965/T6214965.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/annotations/6214965/T6214965.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -23,9 +23,10 @@
+
+ /**
+ * @test
+- * @bug 6214965 6365854
++ * @bug 6214965 6365854 8068639
+ * @summary Compiler crash on redefing nested annotation types
+ * @compile CompilerAnnotationTest.java CompilerAnnotationTest2.java
+ * @compile CompilerAnnotationTest2bad.java
+- * @compile/ref=T6214965.out -XDrawDiagnostics CompilerAnnotationTest2bad.java
++ * @compile/ref=T6214965.out -XDrawDiagnostics -Xlint:classfile CompilerAnnotationTest2bad.java
++ * @compile -Werror CompilerAnnotationTest2bad.java
+ */
+--- ./langtools/test/tools/javac/annotations/6365854/T6365854.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/annotations/6365854/T6365854.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
++ * 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
+@@ -23,7 +23,7 @@
+
+ /**
+ * @test
+- * @bug 6365854
++ * @bug 6365854 8068639
+ * @summary javac crashes when compiling against an annotated class
+ * @compile TestAnnotation.java TestCore.java
+ * @clean test.annotation.TestAnnotation
+@@ -33,11 +33,11 @@
+ *
+ * @compile TestAnnotation.java TestCore.java
+ * @clean test.annotation.TestAnnotation
+- * @compile/ref=test1.out -XDrawDiagnostics T6365854.java
++ * @compile/ref=test1.out -XDrawDiagnostics -Xlint:classfile T6365854.java
+ * @run main T6365854
+- * @compile/ref=test2.out -XDrawDiagnostics evolve/TestAnnotation.java T6365854.java
++ * @compile/ref=test2.out -XDrawDiagnostics -Xlint:classfile evolve/TestAnnotation.java T6365854.java
+ * @run main T6365854
+- * @compile/ref=test2.out -XDrawDiagnostics T6365854.java
++ * @compile/ref=test2.out -XDrawDiagnostics -Xlint:classfile T6365854.java
+ * @run main T6365854
+ */
+
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/annotations/neg/AnonSubclass.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,13 @@
++/*
++ * @test /nodynamiccopyright/
++ * @bug 8028389
++ * @summary javac should output a proper error message when given something
++ * like new Object(){} as annotation argument.
++ *
++ * @compile/fail/ref=AnonSubclass.out -XDrawDiagnostics AnonSubclass.java
++ */
++
++@AnonSubclass(new Object(){})
++@interface AnonSubclass {
++ String value();
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/annotations/neg/AnonSubclass.out Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,2 @@
++AnonSubclass.java:10:15: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.anonymous.class: java.lang.Object, java.lang.String)
++1 error
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/annotations/neg/pkg/AnonSubclassOnPkg.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,28 @@
++/*
++ * Copyright (c) 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.
++ */
++
++package pkg;
++
++@interface AnonSubclassOnPkg {
++ String value();
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/annotations/neg/pkg/package-info.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,12 @@
++/*
++ * @test /nodynamiccopyright/
++ * @bug 8028389
++ * @summary javac should output a proper error message when given something
++ * like new Object(){} as annotation argument.
++ *
++ * @compile AnonSubclassOnPkg.java
++ * @compile/fail/ref=package-info.out -XDrawDiagnostics package-info.java
++ */
++
++@AnonSubclassOnPkg(new Object(){})
++package pkg;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/annotations/neg/pkg/package-info.out Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,2 @@
++package-info.java:11:20: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.anonymous.class: java.lang.Object, java.lang.String)
++1 error
+--- ./langtools/test/tools/javac/annotations/typeAnnotations/classfile/TestAnonInnerClasses.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/annotations/typeAnnotations/classfile/TestAnonInnerClasses.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 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
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/classfiles/InnerClasses/T8068517.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,126 @@
++/*
++ * 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 8068517
++ * @summary Verify that nested enums have correct abstract flag in the InnerClasses attribute.
++ * @library /tools/javac/lib
++ * @build ToolBox T8068517
++ * @run main T8068517
++ */
++
++import com.sun.tools.javac.util.Assert;
++import java.io.File;
++import java.nio.file.Files;
++import java.util.Arrays;
++import java.util.List;
++import java.util.stream.Collectors;
++import java.util.stream.Stream;
++import javax.tools.JavaCompiler;
++import javax.tools.ToolProvider;
++
++public class T8068517 {
++
++ public static void main(String[] args) throws Exception {
++ new T8068517().run();
++ }
++
++ void run() throws Exception {
++ runTest("class A {\n" +
++ " enum AInner implements Runnable {\n" +
++ " A {\n" +
++ " public void run() {}\n" +
++ " };\n" +
++ " }\n" +
++ "}\n",
++ "class B {\n" +
++ " A.AInner a;\n" +
++ "}");
++ runTest("class A {\n" +
++ " enum AInner implements Runnable {\n" +
++ " A {\n" +
++ " public void run() {}\n" +
++ " };\n" +
++ " }\n" +
++ " AInner aInner;\n" +
++ "}\n",
++ "class B {\n" +
++ " void test(A a) {;\n" +
++ " switch (a.aInner) {\n" +
++ " case A: break;\n" +
++ " }\n" +
++ " };\n" +
++ "}");
++ runTest("class A {\n" +
++ " enum AInner implements Runnable {\n" +
++ " A {\n" +
++ " public void run() {}\n" +
++ " };\n" +
++ " }\n" +
++ " AInner aInner;\n" +
++ "}\n",
++ "class B {\n" +
++ " void test(A a) {;\n" +
++ " System.err.println(a.aInner.toString());\n" +
++ " };\n" +
++ "}");
++ runTest("class A {\n" +
++ " enum AInner implements Runnable {\n" +
++ " A {\n" +
++ " public void run() {}\n" +
++ " };\n" +
++ " }\n" +
++ " AInner aInner() {\n" +
++ " return null;\n" +
++ " }\n" +
++ "}\n",
++ "class B {\n" +
++ " void test(A a) {;\n" +
++ " System.err.println(a.aInner().toString());\n" +
++ " };\n" +
++ "}");
++ }
++
++ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
++ int testN = 0;
++
++ void runTest(String aJava, String bJava) throws Exception {
++ File testClasses = new File(System.getProperty("test.classes"));
++ File target1 = new File(testClasses, "T8068517s" + testN++);
++ doCompile(target1, aJava, bJava);
++ File target2 = new File(testClasses, "T8068517s" + testN++);
++ doCompile(target2, bJava, aJava);
++
++ Assert.check(Arrays.equals(Files.readAllBytes(new File(target1, "B.class").toPath()),
++ Files.readAllBytes(new File(target2, "B.class").toPath())));
++ }
++
++ void doCompile(File target, String... sources) throws Exception {
++ target.mkdirs();
++ List<String> options = Arrays.asList("-d", target.getAbsolutePath());
++ List<ToolBox.JavaSource> files = Stream.of(sources)
++ .map(ToolBox.JavaSource::new)
++ .collect(Collectors.toList());
++ compiler.getTask(null, null, null, options, null, files).call();
++ }
++}
+--- ./langtools/test/tools/javac/diags/examples/MrefInferAndExplicitParams.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/diags/examples/MrefInferAndExplicitParams.java Wed Jul 01 21:54:20 2015 -0700
+@@ -8,7 +8,7 @@
+ *
+ * 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
++ * 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).
+ *
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/enum/8069181/T8069181.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,45 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++/*
++ * @test
++ * @bug 8069181
++ * @summary java.lang.AssertionError when compiling JDK 1.4 code in JDK 8
++ *
++ * @compile -source 1.4 T8069181.java
++ */
++import java.util.Enumeration;
++import java.util.Hashtable;
++class T8069181 {
++ void test() {
++ Hashtable hTable = new Hashtable();
++ hTable.put("hello", "value");
++ for (Enumeration enum = hTable.keys();;){
++ if(!enum.hasMoreElements())
++ break;
++ enum.nextElement();
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/expression/DeeplyChainedNonPolyExpressionTest.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,178 @@
++/*
++ * 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 8079613
++ * @summary Ensure that compiler ascertains a class of patently non-poly expressions as such
++ * @run main/timeout=10 DeeplyChainedNonPolyExpressionTest
++ */
++
++public class DeeplyChainedNonPolyExpressionTest {
++ static class JSO {
++
++ JSO put(String s, Object y) {
++ return null;
++ }
++
++ JSO put(java.lang.String x, java.util.Collection<String> y) {
++ return null;
++ }
++
++ JSO put(java.lang.String x, int y) {
++ return null;
++ }
++
++ JSO put(java.lang.String x, long y) {
++ return null;
++ }
++
++ JSO put(java.lang.String x, double y) {
++ return null;
++ }
++
++ JSO put(java.lang.String x, java.util.Map<String, String> y) {
++ return null;
++ }
++
++ JSO put(java.lang.String x, boolean y) {
++ return null;
++ }
++ }
++
++ static class JSA {
++
++ JSA put(Object o) {
++ return null;
++ }
++
++ JSA put(int i, Object x) {
++ return null;
++ }
++
++ JSA put(boolean x) {
++ return null;
++ }
++
++ JSA put(int x) {
++ return null;
++ }
++
++ JSA put(int i, int x) {
++ return null;
++ }
++
++ JSA put(int x, boolean y) {
++ return null;
++ }
++
++ JSA put(int i, long x) {
++ return null;
++ }
++
++ JSA put(long x) {
++ return null;
++ }
++
++ JSA put(java.util.Collection<String> x) {
++ return null;
++ }
++
++ JSA put(int i, java.util.Collection<String> x) {
++ return null;
++ }
++
++ JSA put(int i, java.util.Map<String, String> x) {
++ return null;
++ }
++
++ JSA put(java.util.Map<String, String> x) {
++ return null;
++ }
++
++ JSA put(int i, double x) {
++ return null;
++ }
++
++ JSA put(double x) {
++ return null;
++ }
++ }
++
++ public static void main(String [] args) {
++ }
++ public static void foo() {
++ new JSO()
++ .put("s", new JSA())
++ .put("s", new JSA())
++ .put("s", new JSO()
++ .put("s", new JSO()
++ .put("s", new JSA().put("s"))
++ .put("s", new JSA())
++ .put("s", new JSO()
++ .put("s", new JSO()
++ .put("s", new JSA().put("s").put("s"))
++ .put("s", new JSA())
++ .put("s", new JSO()
++ .put("s", new JSO()
++ .put("s", new JSA().put("s").put("s").put("s")
++ .put("s").put("s").put("s")
++ .put("s").put("s"))
++ .put("s", new JSA())
++ .put("s", new JSO()
++ .put("s", new JSO()
++ .put("s", new JSA().put("s"))
++ .put("s", new JSA())
++ )
++ )
++ )
++ )
++ )
++ .put("s", new JSO()
++ .put("s", new JSA().put("s"))
++ .put("s", new JSA())
++ .put("s", new JSO()
++ .put("s", new JSO()
++ .put("s", new JSA().put("s").put("s"))
++ .put("s", new JSA())
++ .put("s", new JSO()
++ .put("s", new JSO()
++ .put("s", new JSA().put("s").put("s").put("s")
++ .put("s").put("s").put("s")
++ .put("s").put("s"))
++ .put("s", new JSA())
++ .put("s", new JSO()
++ .put("s", new JSO()
++ .put("s", new JSA().put("s"))
++ .put("s", new JSA()))
++ )
++ )
++ )
++ )
++ )
++ )
++ )
++ )
++ );
++ }
++}
+--- ./langtools/test/tools/javac/flow/LVTHarness.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/flow/LVTHarness.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2013, 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
+@@ -23,7 +23,7 @@
+
+ /*
+ * @test
+- * @bug 7047734 8027660 8037937 8047719 8058708
++ * @bug 7047734 8027660 8037937 8047719 8058708 8064857
+ * @summary The LVT is not generated correctly during some try/catch scenarios
+ * javac crash while creating LVT entry for a local variable defined in
+ * an inner block
+@@ -144,7 +144,7 @@
+ }
+
+ void checkMethod(ConstantPool constantPool, Method method, AliveRanges ranges)
+- throws InvalidIndex, UnexpectedEntry {
++ throws InvalidIndex, UnexpectedEntry, ConstantPoolException {
+ Code_attribute code = (Code_attribute) method.attributes.get(Attribute.Code);
+ LocalVariableTable_attribute lvt =
+ (LocalVariableTable_attribute) (code.attributes.get(Attribute.LocalVariableTable));
+@@ -166,7 +166,7 @@
+ }
+
+ if (i < infoFromRanges.size()) {
+- error(infoFromLVT, infoFromRanges);
++ error(infoFromLVT, infoFromRanges, method.getName(constantPool).toString());
+ }
+ }
+
+@@ -202,9 +202,10 @@
+ return sb.toString();
+ }
+
+- protected void error(List<String> infoFromLVT, List<String> infoFromRanges) {
++ protected void error(List<String> infoFromLVT, List<String> infoFromRanges, String methodName) {
+ nerrors++;
+ System.err.printf("Error occurred while checking file: %s\n", jfo.getName());
++ System.err.printf("at method: %s\n", methodName);
+ System.err.println("The range info from the annotations is");
+ printStringListToErrOutput(infoFromRanges);
+ System.err.println();
+--- ./langtools/test/tools/javac/flow/tests/TestCaseFor.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/flow/tests/TestCaseFor.java Wed Jul 01 21:54:20 2015 -0700
+@@ -2,7 +2,7 @@
+
+ public class TestCaseFor {
+
+- @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=8)
++ @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=11)
+ @AliveRange(varName="o", bytecodeStart=24, bytecodeLength=1)
+ void m1(String[] args) {
+ Object o;
+@@ -13,7 +13,7 @@
+ o = "";
+ }
+
+- @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=8)
++ @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=11)
+ @AliveRange(varName="o", bytecodeStart=24, bytecodeLength=1)
+ void m2(String[] args) {
+ Object o;
+--- ./langtools/test/tools/javac/flow/tests/TestCaseForEach.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/flow/tests/TestCaseForEach.java Wed Jul 01 21:54:20 2015 -0700
+@@ -2,7 +2,7 @@
+
+ public class TestCaseForEach {
+
+- @AliveRange(varName="o", bytecodeStart=25, bytecodeLength=8)
++ @AliveRange(varName="o", bytecodeStart=25, bytecodeLength=11)
+ @AliveRange(varName="o", bytecodeStart=39, bytecodeLength=1)
+ void m(String[] args) {
+ Object o;
+--- ./langtools/test/tools/javac/flow/tests/TestCaseIfElse.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/flow/tests/TestCaseIfElse.java Wed Jul 01 21:54:20 2015 -0700
+@@ -60,4 +60,19 @@
+ }
+ return null;
+ }
++
++ @AliveRange(varName="i", bytecodeStart=6, bytecodeLength=2)
++ int m4(boolean flag) {
++ int i;
++ label:
++ {
++ if (flag) {
++ i = 1;
++ } else {
++ break label;
++ }
++ return i;
++ }
++ return -1;
++ }
+ }
+--- ./langtools/test/tools/javac/flow/tests/TestCaseSwitch.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/flow/tests/TestCaseSwitch.java Wed Jul 01 21:54:20 2015 -0700
+@@ -81,4 +81,26 @@
+ o = "finish";
+ }
+
++ @AliveRange(varName="oCache", bytecodeStart=30, bytecodeLength=6)
++ @AliveRange(varName="cache", bytecodeStart=41, bytecodeLength=3)
++ @AliveRange(varName="cache", bytecodeStart=54, bytecodeLength=2)
++ @AliveRange(varName="service", bytecodeStart=39, bytecodeLength=5)
++ Object m4(int i) {
++ Object cache;
++ switch (i) {
++ case 0:
++ Object oCache = null;
++ if (oCache != null) {
++ return oCache;
++ }
++ case 1:
++ Object service = null;
++ cache = null;
++ break;
++ default:
++ throw new AssertionError("");
++ }
++ return cache;
++ }
++
+ }
+--- ./langtools/test/tools/javac/flow/tests/TestCaseTry.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/flow/tests/TestCaseTry.java Wed Jul 01 21:54:20 2015 -0700
+@@ -17,7 +17,8 @@
+ }
+
+ @AliveRange(varName="o", bytecodeStart=3, bytecodeLength=16)
+- @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=23)
++ @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=8)
++ @AliveRange(varName="o", bytecodeStart=35, bytecodeLength=11)
+ void m1() {
+ Object o;
+ try {
+@@ -33,7 +34,8 @@
+ }
+
+ @AliveRange(varName="o", bytecodeStart=3, bytecodeLength=16)
+- @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=31)
++ @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=16)
++ @AliveRange(varName="o", bytecodeStart=43, bytecodeLength=11)
+ void m2() {
+ Object o;
+ try {
+@@ -51,7 +53,8 @@
+ }
+
+ @AliveRange(varName="o", bytecodeStart=22, bytecodeLength=38)
+- @AliveRange(varName="o", bytecodeStart=103, bytecodeLength=8)
++ @AliveRange(varName="o", bytecodeStart=103, bytecodeLength=3)
++ @AliveRange(varName="o", bytecodeStart=110, bytecodeLength=1)
+ void m3() {
+ Object o;
+ try (BufferedReader br =
+--- ./langtools/test/tools/javac/flow/tests/TestCaseWhile.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/flow/tests/TestCaseWhile.java Wed Jul 01 21:54:20 2015 -0700
+@@ -2,7 +2,7 @@
+
+ public class TestCaseWhile {
+
+- @AliveRange(varName="o", bytecodeStart=9, bytecodeLength=5)
++ @AliveRange(varName="o", bytecodeStart=9, bytecodeLength=8)
+ @AliveRange(varName="o", bytecodeStart=20, bytecodeLength=1)
+ void m(String[] args) {
+ Object o;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/generics/8064803/T8064803.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,53 @@
++/*
++ * Copyright (c) 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. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++/*
++ * @test
++ * @bug 8064803
++ * @summary Javac erroneously uses instantiated signatures when merging abstract most-specific methods
++ */
++public class T8064803 {
++ interface ParentA<T> {
++ T process() throws Exception;
++ }
++
++ interface ParentB<T> {
++ T process() throws Exception;
++ }
++
++ interface Child<T> extends ParentA<T>, ParentB<T> { }
++
++ static class ChildImpl<T> implements Child<T> {
++ @Override
++ public T process() {
++ return null;
++ }
++ }
++
++ public static void main(String[] args) throws Exception {
++ Child<String> child = new ChildImpl<String>();
++ child.process();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/generics/inference/8055963/T8055963.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,41 @@
++/*
++ * Copyright (c) 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. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++/**
++ * @test
++ * @bug 8055963
++ * @summary Inference failure with nested invocation
++ * @compile T8055963.java
++ */
++class T8055963 {
++
++ static class C<T> {}
++
++ <T> T choose(T first, T second) { return null; }
++
++ void test() {
++ C<String> cs = choose(new C<String>(), new C<>());
++ }
++}
+--- ./langtools/test/tools/javac/lambda/8016177/T8016177g.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/lambda/8016177/T8016177g.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,6 +1,6 @@
+ /*
+ * @test /nodynamiccopyright/
+- * @bug 8016081 8016178
++ * @bug 8016081 8016178 8069545
+ * @summary structural most specific and stuckness
+ * @compile/fail/ref=T8016177g.out -XDrawDiagnostics T8016177g.java
+ */
+--- ./langtools/test/tools/javac/lambda/8016177/T8016177g.out Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/lambda/8016177/T8016177g.out Wed Jul 01 21:54:20 2015 -0700
+@@ -1,2 +1,3 @@
+-T8016177g.java:35:20: compiler.err.prob.found.req: (compiler.misc.possible.loss.of.precision: double, int)
+-1 error
++T8016177g.java:34:14: compiler.err.cant.apply.symbol: kindname.method, print, java.lang.String, Test.Person, kindname.class, Test, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: Test.Person, java.lang.String,java.lang.Object))
++T8016177g.java:35:20: compiler.err.cant.apply.symbol: kindname.method, abs, int, java.lang.Double, kindname.class, Test, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , R, int))
++2 errors
+--- ./langtools/test/tools/javac/lambda/8023389/T8023389.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/lambda/8023389/T8023389.java Wed Jul 01 21:54:20 2015 -0700
+@@ -8,7 +8,7 @@
+ *
+ * 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
++ * 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).
+ *
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/lambda/8068399/T8068399.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,119 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++/*
++ * @test
++ * @bug 8068399
++ * @summary structural most specific and stuckness
++ */
++
++import java.util.function.Function;
++import java.util.stream.IntStream;
++import java.util.stream.Stream;
++
++public class T8068399 {
++
++ public static class Spectrum {
++ public double[] getEnergy() {
++ return new double[0];
++ }
++ }
++
++ protected Spectrum spectrum;
++
++ public static class Ref<T> {
++
++ T value;
++
++ public Ref() {
++ }
++
++ public Ref(T value) {
++ this.value = value;
++ }
++
++ public boolean isNull() {
++ return value == null;
++ }
++
++ public T get() {
++ return value;
++ }
++
++ public void set(T value) {
++ this.value = value;
++ }
++ }
++
++ public static <T>T maxKey(Stream<T> stream, Function<T, Double> function) {
++ Ref<Double> max = new Ref<>();
++ Ref<T> index = new Ref<>();
++ stream.forEach(v -> {
++ Double value = function.apply(v);
++
++ if (max.isNull() || value > max.get()) {
++ max.set(value);
++ index.set(v);
++ }
++ });
++
++ return index.get();
++ }
++
++ public static int interpolate(int x, int x0, int x1, int y0, int y1) {
++ return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
++ }
++
++ public static double interpolate(double x, double x0, double x1, double y0, double y1) {
++ return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
++ }
++
++ protected int getXByFrequency(double frequency) {
++ return (int) Math.round(interpolate(frequency,
++ getMinSpectrumCoord(),
++ getMaxSpectrumCoord(),
++ 0, getWidth()));
++ }
++
++ private int getWidth() {
++ return 0;
++ }
++
++ private double getMaxSpectrumCoord() {
++ return 0;
++ }
++
++ private double getMinSpectrumCoord() {
++ return 0;
++ }
++
++ void foo() {
++ int maxBpmIndex = 0;
++ int xcur = getXByFrequency(maxKey(IntStream.range(0, maxBpmIndex).boxed(),
++ i -> Math.abs(spectrum.getEnergy()[i])));
++ }
++
++ public static void main(String [] args) {
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/lambda/8068430/T8068430.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,46 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++/*
++ * @test
++ * @bug 8068430
++ * @summary structural most specific and stuckness
++ */
++
++import java.util.HashMap;
++import java.util.Map;
++
++public class T8068430 {
++ public static void main(String[] args) {
++ Map<Integer, String> mp = new HashMap<>();
++ mp.put(1, "a");
++ mp.put(2, "b");
++ mp.put(3, "c");
++ mp.put(4, "d");
++ System.out.println(mp.entrySet().stream().reduce(0,
++ (i, e) -> i + e.getKey(),
++ (i1, i2) -> i1 + i2));
++ }
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/lambda/8071432/T8071432.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,50 @@
++/*
++ * @test /nodynamiccopyright/
++ * @bug 8071432
++ * @summary structural most specific and stuckness
++ * @compile/fail/ref=T8071432.out -XDrawDiagnostics T8071432.java
++ */
++
++import java.util.Arrays;
++import java.util.Collection;
++
++class T8071432 {
++
++ static class Point {
++
++ private double x, y;
++
++ public Point(double x, double y) {
++ this.x = x;
++ this.y = y;
++ }
++
++ public double getX() {
++ return x;
++ }
++
++ public double getY() {
++ return y;
++ }
++
++ public double distance(Point p) {
++ return Math.sqrt((this.x - p.x) * (this.x - p.x) +
++ (this.y - p.y) * (this.y - p.y));
++ }
++
++ public double distance() {
++ return Math.sqrt(this.x * this.x + this.y * this.y);
++ }
++
++ public String toString() {
++ return "(" + x + ":" + y + ")";
++ }
++ }
++
++ public static void main(String[] args) {
++ Collection<Point> c = Arrays.asList(new Point(1.0, 0.1));
++ System.out.println("------- 1 ---------------");
++ System.out.println(c.stream().reduce(0.0,
++ (s, p) -> s += p.distance(), (d1, d2) -> 0));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/lambda/8071432/T8071432.out Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,3 @@
++T8071432.java:47:45: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: int, java.lang.Double)))
++T8071432.java:47:27: compiler.err.cant.apply.symbol: kindname.method, println, java.lang.Object, <any>, kindname.class, java.io.PrintStream, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: int, java.lang.Double))))
++2 errors
+--- ./langtools/test/tools/javac/lambda/LambdaExprLeadsToMissingClassFilesTest.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/lambda/LambdaExprLeadsToMissingClassFilesTest.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.
++ * 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
+--- ./langtools/test/tools/javac/lambda/LocalVariableTable.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/lambda/LocalVariableTable.java Wed Jul 01 21:54:20 2015 -0700
+@@ -23,7 +23,7 @@
+
+ /*
+ * @test
+- * @bug 8025998 8026749
++ * @bug 8025998 8026749 8054220 8058227
+ * @summary Missing LV table in lambda bodies
+ * @compile -g LocalVariableTable.java
+ * @run main LocalVariableTable
+@@ -183,7 +183,7 @@
+ Run1 r = (a) -> { int x = a; };
+ }
+
+- @Expect({ "a", "x" })
++ @Expect({ "a", "x", "v" })
+ static class Lambda_Args1_Local1_Captured1 {
+ void m() {
+ int v = 0;
+@@ -191,7 +191,7 @@
+ }
+ }
+
+- @Expect({ "a1", "a2", "x1", "x2", "this" })
++ @Expect({ "a1", "a2", "x1", "x2", "this", "v1", "v2" })
+ static class Lambda_Args2_Local2_Captured2_this {
+ int v;
+ void m() {
+@@ -204,7 +204,7 @@
+ }
+ }
+
+- @Expect({ "e" })
++ @Expect({ "e", "c" })
+ static class Lambda_Try_Catch {
+ private static Runnable asUncheckedRunnable(Closeable c) {
+ return () -> {
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/linenumbers/NestedLineNumberTest.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,81 @@
++/*
++ * Copyright (c) 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. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++/*
++ * @test
++ * @bug 8061778
++ * @summary Wrong LineNumberTable for default constructors
++ */
++
++import com.sun.tools.classfile.ClassFile;
++import com.sun.tools.classfile.ConstantPoolException;
++import com.sun.tools.classfile.Method;
++import com.sun.tools.classfile.Attribute;
++import com.sun.tools.classfile.Code_attribute;
++import com.sun.tools.classfile.LineNumberTable_attribute;
++import com.sun.tools.classfile.LineNumberTable_attribute.Entry;
++
++import java.io.IOException;
++
++public class NestedLineNumberTest {
++
++ public static void main(String[] args) throws Exception {
++ Entry[] lines = findEntries();
++ if (lines == null || lines.length != 1) {
++ int found = lines == null ? 0 : lines.length;
++ error(String.format("LineNumberTable contains wrong number of entries - expected %d, found %d", 1, found));
++ }
++
++ int line = lines[0].line_number;
++ if (line != 78) {
++ error(String.format("LineNumberTable contains wrong line number - expected %d, found %d", 78, line));
++ }
++ }
++
++ static Entry[] findEntries() throws IOException, ConstantPoolException {
++ ClassFile self = ClassFile.read(NestedLineNumberTest.Test.class.getResourceAsStream("NestedLineNumberTest$Test.class"));
++ for (Method m : self.methods) {
++ if ("<init>".equals(m.getName(self.constant_pool))) {
++ Code_attribute code_attribute = (Code_attribute)m.attributes.get(Attribute.Code);
++ for (Attribute at : code_attribute.attributes) {
++ if (Attribute.LineNumberTable.equals(at.getName(self.constant_pool))) {
++ return ((LineNumberTable_attribute)at).line_number_table;
++ }
++ }
++ }
++ }
++ return null;
++ }
++
++ static void error(String msg) {
++ throw new AssertionError(msg);
++ }
++
++ // The default constructor in this class should get only one LineNumberTable entry,
++ // pointing to the first line of the declaration of class Test.
++ static class Test {
++ static class Empty { }
++ }
++}
+--- ./langtools/test/tools/javac/resolve/tests/PrimitiveVsReferenceSamePhase.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/javac/resolve/tests/PrimitiveVsReferenceSamePhase.java Wed Jul 01 21:54:20 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 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
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/scope/RemoveSymbolTest.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,77 @@
++/*
++ * 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 8080842
++ * @summary Ensure Scope impl can cope with remove() when a field and method share the name.
++ * @run main RemoveSymbolTest
++ */
++
++import java.util.Iterator;
++import java.util.LinkedList;
++
++public class RemoveSymbolTest<W> implements Iterable<W> {
++ static class Widget {
++ private String name;
++ Widget(String s) { name = s; }
++ @Override public String toString() { return name; }
++ }
++
++ private LinkedList<W> data;
++ // Instantiate an Iterable instance using a Lambda expression.
++ // Causes ClassFormatError if a local variable of type Widget is named after one of the methods.
++ private final Iterable<W> myIterator1 = () -> new Iterator<W>() {
++ private W hasNext = null;
++ private int index = 0;
++ @Override public boolean hasNext() { return index < data.size(); }
++ @Override public W next() { return data.get(index++); }
++ };
++
++ // Instantiate an Iterable instance using an anonymous class.
++ // Always works fine regardless of the name of the local variable.
++ private final Iterable<W> myIterator2 =
++ new Iterable<W>() {
++ @Override
++ public Iterator<W> iterator() {
++ return new Iterator<W>() {
++ private W hasNext = null;
++ private int index = 0;
++ @Override public boolean hasNext() { return index < data.size(); }
++ @Override public W next() { return data.get(index++); }
++ };
++ }
++ };
++ public RemoveSymbolTest() { data = new LinkedList<>(); }
++ public void add(W e) { data.add(e); }
++ @Override public String toString() { return data.toString(); }
++ @Override public Iterator<W> iterator() { return myIterator1.iterator(); }
++ public static void main(String[] args) {
++ RemoveSymbolTest<Widget> widgets = new RemoveSymbolTest<>();
++ widgets.add(new Widget("W1"));
++ widgets.add(new Widget("W2"));
++ widgets.add(new Widget("W3"));
++ System.out.println(".foreach() call: ");
++ widgets.forEach(w -> System.out.println(w + " "));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/scope/RemoveSymbolUnitTest.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,95 @@
++/*
++ * 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 8080842
++ * @summary Ensure Scope impl can cope with remove() when a field and method share the name.
++ */
++
++import com.sun.tools.javac.util.*;
++import com.sun.tools.javac.code.*;
++import com.sun.tools.javac.code.Scope.*;
++import com.sun.tools.javac.code.Symbol.*;
++import com.sun.tools.javac.file.JavacFileManager;
++
++public class RemoveSymbolUnitTest {
++
++ Context context;
++ Names names;
++ Symtab symtab;
++
++ public static void main(String... args) throws Exception {
++ new RemoveSymbolUnitTest().run();
++ }
++
++ public void run() {
++ context = new Context();
++ JavacFileManager.preRegister(context); // required by ClassReader which is required by Symtab
++ names = Names.instance(context);
++ symtab = Symtab.instance(context);
++
++ Name hasNext = names.fromString("hasNext");
++ ClassSymbol clazz = new ClassSymbol(0,
++ names.fromString("X"),
++ Type.noType,
++ symtab.unnamedPackage);
++
++ VarSymbol v = new VarSymbol(0, hasNext, Type.noType, clazz);
++ MethodSymbol m = new MethodSymbol(0, hasNext, Type.noType, clazz);
++
++ // Try enter and remove in different shuffled combinations.
++ // working with fresh scope each time.
++ Scope cs = new Scope(clazz);
++ cs.enter(v);
++ cs.enter(m);
++ cs.remove(v);
++ Symbol s = cs.lookup(hasNext).sym;
++ if (s != m)
++ throw new AssertionError("Wrong symbol");
++
++ cs = new Scope(clazz);
++ cs.enter(m);
++ cs.enter(v);
++ cs.remove(v);
++ s = cs.lookup(hasNext).sym;
++ if (s != m)
++ throw new AssertionError("Wrong symbol");
++
++ cs = new Scope(clazz);
++ cs.enter(v);
++ cs.enter(m);
++ cs.remove(m);
++ s = cs.lookup(hasNext).sym;
++ if (s != v)
++ throw new AssertionError("Wrong symbol");
++
++ cs = new Scope(clazz);
++ cs.enter(m);
++ cs.enter(v);
++ cs.remove(m);
++ s = cs.lookup(hasNext).sym;
++ if (s != v)
++ throw new AssertionError("Wrong symbol");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/types/ScopeListenerTest.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,82 @@
++/*
++ * 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 8039262
++ * @summary Ensure that using Types.membersClosure does not increase the number of listeners on the
++ * class's members Scope.
++ */
++
++import com.sun.tools.javac.code.Scope;
++import com.sun.tools.javac.code.Symbol;
++import com.sun.tools.javac.code.Symtab;
++import com.sun.tools.javac.code.Types;
++import com.sun.tools.javac.file.JavacFileManager;
++import com.sun.tools.javac.util.Context;
++import com.sun.tools.javac.util.Names;
++import java.lang.reflect.Field;
++import java.util.Collection;
++
++public class ScopeListenerTest {
++
++ public static void main(String[] args) throws Exception {
++ new ScopeListenerTest().run();
++ }
++
++ void run() throws Exception {
++ Context context = new Context();
++ JavacFileManager.preRegister(context);
++ Types types = Types.instance(context);
++ Symtab syms = Symtab.instance(context);
++ Names names = Names.instance(context);
++ types.membersClosure(syms.stringType, true);
++ types.membersClosure(syms.stringType, false);
++
++ Field listenersField = Scope.class.getDeclaredField("listeners");
++
++ listenersField.setAccessible(true);
++
++ int listenerCount =
++ ((Collection) listenersField.get(syms.stringType.tsym.members())).size();
++
++ for (int i = 0; i < 100; i++) {
++ types.membersClosure(syms.stringType, true);
++ types.membersClosure(syms.stringType, false);
++ }
++
++ int newListenerCount
++ = ((Collection) listenersField.get(syms.stringType.tsym.members())).size();
++
++ if (listenerCount != newListenerCount) {
++ throw new AssertionError("Orig listener count: " + listenerCount +
++ "; new listener count: " + newListenerCount);
++ }
++
++ for (Symbol s : types.membersClosure(syms.stringType, true).getElements())
++ ;
++ for (Symbol s : types.membersClosure(syms.stringType, false).getElementsByName(names.fromString("substring")))
++ ;
++ }
++
++}
+--- ./langtools/test/tools/javac/varargs/T8049075/VarargsAndWildcardParameterizedTypeTest.java Mon Jun 01 11:44:19 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,40 +0,0 @@
+-/*
+- * Copyright (c) 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.
+- */
+-
+-/*
+- * @test
+- * @bug 8049075
+- * @summary javac, wildcards and generic vararg method invocation not accepted
+- * @compile VarargsAndWildcardParameterizedTypeTest.java
+- */
+-
+-class VarargsAndWildcardParameterizedTypeTest {
+- interface I<T> {
+- String m(T... t);
+- }
+-
+- void m() {
+- I<? super Integer> i = null;
+- i.m(Integer.valueOf(1), Integer.valueOf(1));
+- }
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/varargs/access/OtherPackage.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,36 @@
++/*
++ * 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.
++ */
++
++/*
++ * Auxiliary file for VarargsInferredPrivateType
++ */
++
++package otherpackage;
++
++public class OtherPackage {
++ public static Private getPrivate() {
++ return new Private();
++ }
++
++ private static class Private {}
++}
+\ No newline at end of file
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,42 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/*
++ * @test
++ * @bug 8049075
++ * @summary javac, wildcards and generic vararg method invocation not accepted
++ * @compile VarargsAndWildcardParameterizedTypeTest.java
++ * @compile -source 8 VarargsAndWildcardParameterizedTypeTest.java
++ * @compile -source 7 VarargsAndWildcardParameterizedTypeTest.java
++ */
++
++class VarargsAndWildcardParameterizedTypeTest {
++ interface I<T> {
++ String m(T... t);
++ }
++
++ void m() {
++ I<? super Integer> i = null;
++ i.m(Integer.valueOf(1), Integer.valueOf(1));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest2.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,45 @@
++/*
++ * 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 8075520
++ * @summary Varargs access check mishandles capture variables
++ * @compile VarargsAndWildcardParameterizedTypeTest2.java
++ * @compile -source 8 VarargsAndWildcardParameterizedTypeTest2.java
++ * @compile -source 7 VarargsAndWildcardParameterizedTypeTest2.java
++ */
++
++class VarargsAndWildcardParameterizedTypeTest2 {
++ interface I {
++ <T> void m(T... t);
++ }
++
++ interface Box<T> {
++ T get();
++ }
++
++ void m(I i, Box<? extends Number> b) {
++ i.m(b.get());
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest3.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,43 @@
++/*
++ * 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 8075520
++ * @summary Varargs access check mishandles capture variables
++ * @compile VarargsAndWildcardParameterizedTypeTest3.java
++ * @compile -source 8 VarargsAndWildcardParameterizedTypeTest3.java
++ * @compile -source 7 VarargsAndWildcardParameterizedTypeTest3.java
++ */
++
++class VarargsAndWildcardParameterizedTypeTest2 {
++ interface I {
++ <T> void m(Box<? extends T> iter, T... t);
++ }
++
++ interface Box<T> {}
++
++ void m(I i, Box<? extends Number> b) {
++ i.m(b);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest4.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,43 @@
++/*
++ * 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 8075520
++ * @summary Varargs access check mishandles capture variables
++ * @compile VarargsAndWildcardParameterizedTypeTest4.java
++ * @compile -source 8 VarargsAndWildcardParameterizedTypeTest4.java
++ * @compile -source 7 VarargsAndWildcardParameterizedTypeTest4.java
++ */
++
++class VarargsAndWildcardParameterizedTypeTest2 {
++ interface I {
++ <T> void m(Box<T> iter, T... t);
++ }
++
++ interface Box<T> {}
++
++ void m(I i, Box<? extends Number> b) {
++ i.m(b);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/varargs/access/VarargsInferredPrivateType-source7.out Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,4 @@
++VarargsInferredPrivateType.java:16:10: compiler.err.cant.apply.symbol: kindname.method, m, T[], otherpackage.OtherPackage.Private, kindname.interface, VarargsInferredPrivateType.I, (compiler.misc.inaccessible.varargs.type: otherpackage.OtherPackage.Private, kindname.class, VarargsInferredPrivateType)
++- compiler.note.unchecked.filename: VarargsInferredPrivateType.java
++- compiler.note.unchecked.recompile
++1 error
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/varargs/access/VarargsInferredPrivateType.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,18 @@
++/*
++ * @test /nodynamiccopyright/
++ * @bug 8077786
++ * @summary Check varargs access against inferred signature
++ * @compile/fail/ref=VarargsInferredPrivateType.out -nowarn -XDrawDiagnostics VarargsInferredPrivateType.java OtherPackage.java
++ * @compile/fail/ref=VarargsInferredPrivateType.out -source 8 -nowarn -XDrawDiagnostics VarargsInferredPrivateType.java OtherPackage.java
++ * @compile/fail/ref=VarargsInferredPrivateType-source7.out -source 7 -nowarn -XDrawDiagnostics VarargsInferredPrivateType.java OtherPackage.java
++ */
++
++class VarargsInferredPrivateType {
++ interface I {
++ <T> void m(T... t);
++ }
++
++ void m(I i) {
++ i.m(otherpackage.OtherPackage.getPrivate());
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/javac/varargs/access/VarargsInferredPrivateType.out Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,4 @@
++VarargsInferredPrivateType.java:16:12: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: otherpackage.OtherPackage.Private, kindname.class, VarargsInferredPrivateType)
++- compiler.note.unchecked.filename: VarargsInferredPrivateType.java
++- compiler.note.unchecked.recompile
++1 error
+--- ./langtools/test/tools/jdeps/APIDeps.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/jdeps/APIDeps.java Wed Jul 01 21:54:20 2015 -0700
+@@ -90,8 +90,9 @@
+ new String[] {"-classpath", testDir.getPath(), "-verbose:class", "-filter:none", "-P"});
+ test(new File(mDir, "Gee.class"),
+ new String[] {"g.G", "sun.misc.Lock", "com.sun.tools.classfile.ClassFile",
+- "com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree"},
+- new String[] {testDirBasename, "JDK internal API", "compact3", ""},
++ "com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree",
++ "org.w3c.dom.css.CSSValue"},
++ new String[] {testDirBasename, "JDK internal API", "compact2", "compact3", ""},
+ new String[] {"-classpath", testDir.getPath(), "-verbose", "-P"});
+
+ // -jdkinternals
+--- ./langtools/test/tools/jdeps/Basic.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/jdeps/Basic.java Wed Jul 01 21:54:20 2015 -0700
+@@ -23,9 +23,9 @@
+
+ /*
+ * @test
+- * @bug 8003562 8005428 8015912 8027481 8048063
++ * @bug 8003562 8005428 8015912 8027481 8048063 8068937
+ * @summary Basic tests for jdeps tool
+- * @build Test p.Foo p.Bar javax.activity.NotCompactProfile
++ * @build Test p.Foo p.Bar p.C p.SubClass q.Gee javax.activity.NotCompactProfile
+ * @run main Basic
+ */
+
+@@ -111,6 +111,19 @@
+ new String[] {"compact1"},
+ new String[] {"-verbose:package", "-e", "java\\.lang\\..*"});
+
++ // parse p.C, p.SubClass and q.*
++ // p.SubClass have no dependency other than p.C
++ // q.Gee depends on p.SubClass that should be found
++ test(testDir,
++ new String[] {"java.lang", "p"},
++ new String[] {"compact1", testDir.getName()},
++ new String[] {"-include", "p.C|p.SubClass|q\\..*"});
++ test(testDir,
++ new String[] {"java.lang", "p"},
++ new String[] {"compact1", testDir.getName()},
++ new String[] {"-classpath", testDir.getPath(), "-include", "p.C|p.SubClass|q\\..*"});
++
++
+ // test -classpath and -include options
+ test(null,
+ new String[] {"java.lang", "java.util", "java.lang.management",
+--- ./langtools/test/tools/jdeps/m/Gee.java Mon Jun 01 11:44:19 2015 -0700
++++ ./langtools/test/tools/jdeps/m/Gee.java Wed Jul 01 21:54:20 2015 -0700
+@@ -29,4 +29,5 @@
+ public com.sun.tools.classfile.ClassFile cf; // @jdk.Exported(false)
+ public com.sun.source.tree.BinaryTree tree; // @jdk.Exported
+ public com.sun.management.ThreadMXBean mxbean; // @jdk.Exported on package-info
++ public org.w3c.dom.css.CSSValue value; // special case
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/jdeps/p/C.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,30 @@
++/*
++ * 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 p;
++
++public class C {
++ public String name() {
++ return "C";
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/jdeps/p/SubClass.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,28 @@
++/*
++ * 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 p;
++
++// SubClass only references types in package p
++public class SubClass extends C {
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./langtools/test/tools/jdeps/q/Gee.java Wed Jul 01 21:54:20 2015 -0700
+@@ -0,0 +1,27 @@
++/*
++ * 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 q;
++
++public class Gee extends p.SubClass {
++}
+--- ./nashorn/.hgtags Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/.hgtags Wed Jul 01 21:54:30 2015 -0700
+@@ -340,7 +340,6 @@
+ ec36fa3b35eb00f053d624ae837579c6b8e446ac jdk8u31-b13
+ 34a64e22b81bd78cf29603a80ff1f4cfc1694df8 jdk8u31-b31
+ d2b5784a3452a4fd9d1ccfefe93ee2d36662842c jdk8u31-b32
+-c6dd08613a440ed8d0f1b14b85911d6f3826e1d4 jdk8u31-b33
+ f2925491b61b22ac42f8c30ee9c6723ffa401a4c jdk8u40-b00
+ 62468d841b842769d875bd97d10370585c296eb7 jdk8u40-b01
+ b476c69c820ac1e05071f4de5abab8e2dff80e87 jdk8u40-b02
+@@ -369,8 +368,6 @@
+ fb7b6c2b95c5661f15e8e747a63ec6d95d49fe46 jdk8u40-b25
+ b142a2d8e35e54abb08a7ded1dbfb5d7ce534c93 jdk8u40-b26
+ c2dd88e89edc85b1bcb731d3296d0fcec1b78447 jdk8u40-b27
+-e05552220ba82e465a1abfee90224b5b247e37bc jdk8u40-b31
+-e1cc0fe0fd50fc4582e729897d7095ffce0f97ad jdk8u40-b32
+ 05a3614ed5276e5db2a73cce918be04b1a2922fb jdk8u45-b00
+ 21ec16eb7e6346c78b4fa67ccd6d2a9c58f0b696 jdk8u45-b01
+ 37b3ef9a07323afd2556d6837824db154cccc874 jdk8u45-b02
+@@ -386,22 +383,26 @@
+ 9b9fee0f99cd07fba62abaafe705665a5ab89067 jdk8u45-b12
+ 6fda38586f73de706ecde311711a587ac49d51d8 jdk8u45-b13
+ d5477c6d1678547a9338707adc4b81d35c280454 jdk8u45-b14
+-ea15c34524408bbd2fa2886e5ec5d7995d8e236a jdk8u45-b15
+-d1c1e084430027bffb5bbb1b288660fbdb86627b jdk8u45-b31
+-67dc09b4965989a65a97e0bfec73338cd4763f2a jdk8u45-b32
+-2d1c01990ebd896f81f511aabf1e53cbe1fda11f jdk8u51-b00
+-4323de82a85c378b08e24601b8f3cec6aafda6f4 jdk8u51-b01
+-5ee412753fa08a1e9fa15221c4253886e822a94e jdk8u51-b02
+-a6d6f7cf488c1e57df9e9f724547c0e0eae2ad9e jdk8u51-b03
+-7512eafda1f90fbf6837dd29ae7585b19b9fbe3a jdk8u51-b04
+-04aae4de5c5e2b1c51725a7181afa0085a78d7ee jdk8u51-b05
+-a03caffca13caafe4e0a14b5c6cee333bdfce67c jdk8u51-b06
+-8814ac4bd7bc1cf87b40f036dc306185343ddb76 jdk8u51-b07
+-7fa927b4a47ab76204ec2befe3b8f52336c0a291 jdk8u51-b08
+-77cee35f987167f6e97cc8f2b09349e743e7a9e7 jdk8u51-b09
+-1480e27e4af65e809c1a5cc0310616c2c68392f2 jdk8u51-b10
+-6e95b9bb2f67d4a77d28e5aa3c07281fc8424823 jdk8u51-b11
+-bf2fe867628bf323262377f8312c85f440a9b246 jdk8u51-b12
+-1ecbb6d582a6ccf9e0f6e359a925155c8c580bac jdk8u51-b13
+-e9d85a30fd08425904a400add72212a010381aa8 jdk8u51-b14
+-4cbc78843829b3f6de43b3c056565834008419a6 jdk8u51-b15
++6ec61d2494283fbaca6df227f1a5b45487dc1ca7 jdk8u60-b00
++af290f203369ecf8e67b89c4a3a8df0bf535230e jdk8u60-b01
++39e0c14d45c3fee93a29993f1415b3393d03483f jdk8u60-b02
++323f54e277dfcea814a32fa4b6b36876db18181f jdk8u60-b03
++b0b90d6c5265f45cee7fde968e15f8f272b5b24b jdk8u60-b04
++6f44964fbab316de02d58436be846b5e92813426 jdk8u60-b05
++4b7613f08fd3a6e738bc048d280630756d3593cd jdk8u60-b06
++80966e5cc384fb8c67938c0e05e2b990116d3f4c jdk8u60-b07
++e024db176497a3655f7c9d1d86571df74707ba62 jdk8u60-b08
++1f73439a45bf9cdb73ece75b2c935980657b10d4 jdk8u60-b09
++7aaa64363e1a632ab113b459c46a8ce0c32e4738 jdk8u60-b10
++f6f2d944a863be7d22ca7eac904b6d967abb6b39 jdk8u60-b11
++d03eb34e4b84296f4ce98a78f6c75c07218a678d jdk8u60-b12
++3628ab9fdbc0c58b9d97bc3cd5f3f7680d9785ff jdk8u60-b13
++24e7c53c5716bb52a3f33614b47b72cc134823c9 jdk8u60-b14
++78fcf7f0eac8ffa474518b315bdf84a1dbd6e76d jdk8u60-b15
++bf44ade6c2c2e697ccbc1e57f3eac870908614e6 jdk8u60-b16
++ff7052ce0f6b655d726cd0f77e9a5f8313361889 jdk8u60-b17
++0b5c0f02a0b79ae0aa97520d65e5b520af8f1b2a jdk8u60-b18
++3780124b6dbb100c2c4af2759b8f0e12a8bf1c4c jdk8u60-b19
++46a3d8588ad227dc390d84dfc0f89b9291395a36 jdk8u60-b20
++7475a2bd3c012f7dfd0532a344eb7efca56ac6e6 jdk8u60-b21
++9ed906919b5d92067edcdd966a3f413fca0f70ab jdk8u60-b22
+--- ./nashorn/README Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/README Wed Jul 01 21:54:30 2015 -0700
+@@ -72,14 +72,11 @@
+ - Running tests
+
+ Nashorn tests are TestNG based. Running tests requires downloading the
+-TestNG library and placing its jar file into the lib subdirectory:
++TestNG library and placing its jar file into the test/lib subdirectory. This is
++done automatically when executing the "ant externals" command to get external
++test suites (see below).
+
+- # download and install TestNG
+- wget http://testng.org/testng-x.y.z.zip
+- unzip testng-x.y.z.zip
+- cp testng-x.y.z/testng-x.y.z.jar test/lib/testng.jar
+-
+-After that, you can run the tests using:
++Once TestNG is properly installed, you can run the tests using:
+ cd make
+ ant clean test
+
+--- ./nashorn/THIRD_PARTY_README Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/THIRD_PARTY_README Wed Jul 01 21:54:30 2015 -0700
+@@ -1140,37 +1140,6 @@
+
+ --------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to JSON, which may be included
+-with JRE 8 & JDK 8.
+-
+---- begin of LICENSE ---
+-
+-Copyright (c) 2002 JSON.org
+-
+-Permission is hereby granted, free of charge, to any person obtaining a copy
+-of this software and associated documentation files (the "Software"), to deal
+-in the Software without restriction, including without limitation the rights
+-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-copies of the Software, and to permit persons to whom the Software is
+-furnished to do so, subject to the following conditions:
+-
+-The above copyright notice and this permission notice shall be included in all
+-copies or substantial portions of the Software.
+-
+-The Software shall be used for Good, not Evil.
+-
+-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-SOFTWARE.
+-
+---- end of LICENSE ---
+-
+--------------------------------------------------------------------------------
+-
+ %% This notice is provided with respect to Kerberos functionality, which
+ which may be included with JRE 8, JDK 8, and OpenJDK 8.
+
+@@ -1250,7 +1219,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libpng 1.6.16, which may be
++%% This notice is provided with respect to libpng 1.6.16, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1370,7 +1339,7 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to libungif 4.1.3, which may be
++%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+@@ -1399,13 +1368,13 @@
+
+ -------------------------------------------------------------------------------
+
+-%% This notice is provided with respect to Little CMS 2.5, which may be
++%% This notice is provided with respect to Little CMS 2.7, which may be
+ included with JRE 8, JDK 8, and OpenJDK 8.
+
+ --- begin of LICENSE ---
+
+ Little CMS
+-Copyright (c) 1998-2011 Marti Maria Saguer
++Copyright (c) 1998-2015 Marti Maria Saguer
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+--- ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -152,6 +152,7 @@
+ }
+
+ if (constructor != null) {
++ initPrototype(mi);
+ final int arity = constructor.getArity();
+ if (arity != MemberInfo.DEFAULT_ARITY) {
+ mi.loadThis();
+@@ -193,6 +194,7 @@
+ }
+
+ private void initFunctionFields(final MethodGenerator mi) {
++ assert memberCount > 0;
+ for (final MemberInfo memInfo : scriptClassInfo.getMembers()) {
+ if (!memInfo.isConstructorFunction()) {
+ continue;
+@@ -204,37 +206,39 @@
+ }
+
+ private void initDataFields(final MethodGenerator mi) {
+- for (final MemberInfo memInfo : scriptClassInfo.getMembers()) {
+- if (!memInfo.isConstructorProperty() || memInfo.isFinal()) {
+- continue;
+- }
+- final Object value = memInfo.getValue();
+- if (value != null) {
+- mi.loadThis();
+- mi.loadLiteral(value);
+- mi.putField(className, memInfo.getJavaName(), memInfo.getJavaDesc());
+- } else if (!memInfo.getInitClass().isEmpty()) {
+- final String clazz = memInfo.getInitClass();
+- mi.loadThis();
+- mi.newObject(clazz);
+- mi.dup();
+- mi.invokeSpecial(clazz, INIT, DEFAULT_INIT_DESC);
+- mi.putField(className, memInfo.getJavaName(), memInfo.getJavaDesc());
+- }
++ assert memberCount > 0;
++ for (final MemberInfo memInfo : scriptClassInfo.getMembers()) {
++ if (!memInfo.isConstructorProperty() || memInfo.isFinal()) {
++ continue;
++ }
++ final Object value = memInfo.getValue();
++ if (value != null) {
++ mi.loadThis();
++ mi.loadLiteral(value);
++ mi.putField(className, memInfo.getJavaName(), memInfo.getJavaDesc());
++ } else if (!memInfo.getInitClass().isEmpty()) {
++ final String clazz = memInfo.getInitClass();
++ mi.loadThis();
++ mi.newObject(clazz);
++ mi.dup();
++ mi.invokeSpecial(clazz, INIT, DEFAULT_INIT_DESC);
++ mi.putField(className, memInfo.getJavaName(), memInfo.getJavaDesc());
++ }
+ }
++ }
+
+- if (constructor != null) {
+- mi.loadThis();
+- final String protoName = scriptClassInfo.getPrototypeClassName();
+- mi.newObject(protoName);
+- mi.dup();
+- mi.invokeSpecial(protoName, INIT, DEFAULT_INIT_DESC);
+- mi.dup();
+- mi.loadThis();
+- mi.invokeStatic(PROTOTYPEOBJECT_TYPE, PROTOTYPEOBJECT_SETCONSTRUCTOR,
+- PROTOTYPEOBJECT_SETCONSTRUCTOR_DESC);
+- mi.invokeVirtual(SCRIPTFUNCTION_TYPE, SCRIPTFUNCTION_SETPROTOTYPE, SCRIPTFUNCTION_SETPROTOTYPE_DESC);
+- }
++ private void initPrototype(final MethodGenerator mi) {
++ assert constructor != null;
++ mi.loadThis();
++ final String protoName = scriptClassInfo.getPrototypeClassName();
++ mi.newObject(protoName);
++ mi.dup();
++ mi.invokeSpecial(protoName, INIT, DEFAULT_INIT_DESC);
++ mi.dup();
++ mi.loadThis();
++ mi.invokeStatic(PROTOTYPEOBJECT_TYPE, PROTOTYPEOBJECT_SETCONSTRUCTOR,
++ PROTOTYPEOBJECT_SETCONSTRUCTOR_DESC);
++ mi.invokeVirtual(SCRIPTFUNCTION_TYPE, SCRIPTFUNCTION_SETPROTOTYPE, SCRIPTFUNCTION_SETPROTOTYPE_DESC);
+ }
+
+ /**
+--- ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/Main.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/Main.java Wed Jul 01 21:54:30 2015 -0700
+@@ -134,7 +134,7 @@
+ String simpleName = inFile.getName();
+ simpleName = simpleName.substring(0, simpleName.indexOf(".class"));
+
+- if (sci.getPrototypeMemberCount() > 0) {
++ if (sci.isPrototypeNeeded()) {
+ // generate prototype class
+ final PrototypeGenerator protGen = new PrototypeGenerator(sci);
+ buf = protGen.getClassBytes();
+@@ -146,7 +146,7 @@
+ }
+ }
+
+- if (sci.getConstructorMemberCount() > 0 || sci.getConstructor() != null) {
++ if (sci.isConstructorNeeded()) {
+ // generate constructor class
+ final ConstructorGenerator consGen = new ConstructorGenerator(sci);
+ buf = consGen.getClassBytes();
+--- ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -124,8 +124,6 @@
+ if (memberCount > 0) {
+ // call "super(map$)"
+ mi.getStatic(className, PROPERTYMAP_FIELD_NAME, PROPERTYMAP_DESC);
+- // make sure we use duplicated PropertyMap so that original map
+- // stays intact and so can be used for many global.
+ mi.invokeSpecial(PROTOTYPEOBJECT_TYPE, INIT, SCRIPTOBJECT_INIT_DESC);
+ // initialize Function type fields
+ initFunctionFields(mi);
+--- ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java Wed Jul 01 21:54:30 2015 -0700
+@@ -126,10 +126,42 @@
+ return Collections.unmodifiableList(res);
+ }
+
++ boolean isConstructorNeeded() {
++ // Constructor class generation is needed if we one or
++ // more constructor properties are defined or @Constructor
++ // is defined in the class.
++ for (final MemberInfo memInfo : members) {
++ if (memInfo.getKind() == Kind.CONSTRUCTOR ||
++ memInfo.getWhere() == Where.CONSTRUCTOR) {
++ return true;
++ }
++ }
++ return false;
++ }
++
++ boolean isPrototypeNeeded() {
++ // Prototype class generation is needed if we have atleast one
++ // prototype property or @Constructor defined in the class.
++ for (final MemberInfo memInfo : members) {
++ if (memInfo.getWhere() == Where.PROTOTYPE || memInfo.isConstructor()) {
++ return true;
++ }
++ }
++ return false;
++ }
++
+ int getPrototypeMemberCount() {
+ int count = 0;
+ for (final MemberInfo memInfo : members) {
+- if (memInfo.getWhere() == Where.PROTOTYPE || memInfo.isConstructor()) {
++ switch (memInfo.getKind()) {
++ case SETTER:
++ case SPECIALIZED_FUNCTION:
++ // SETTER was counted when GETTER was encountered.
++ // SPECIALIZED_FUNCTION was counted as FUNCTION already.
++ continue;
++ }
++
++ if (memInfo.getWhere() == Where.PROTOTYPE) {
+ count++;
+ }
+ }
+@@ -139,6 +171,16 @@
+ int getConstructorMemberCount() {
+ int count = 0;
+ for (final MemberInfo memInfo : members) {
++ switch (memInfo.getKind()) {
++ case CONSTRUCTOR:
++ case SETTER:
++ case SPECIALIZED_FUNCTION:
++ // SETTER was counted when GETTER was encountered.
++ // Constructor and constructor SpecializedFunctions
++ // are not added as members and so not counted.
++ continue;
++ }
++
+ if (memInfo.getWhere() == Where.CONSTRUCTOR) {
+ count++;
+ }
+@@ -149,6 +191,14 @@
+ int getInstancePropertyCount() {
+ int count = 0;
+ for (final MemberInfo memInfo : members) {
++ switch (memInfo.getKind()) {
++ case SETTER:
++ case SPECIALIZED_FUNCTION:
++ // SETTER was counted when GETTER was encountered.
++ // SPECIALIZED_FUNCTION was counted as FUNCTION already.
++ continue;
++ }
++
+ if (memInfo.getWhere() == Where.INSTANCE) {
+ count++;
+ }
+--- ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfoCollector.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfoCollector.java Wed Jul 01 21:54:30 2015 -0700
+@@ -288,9 +288,7 @@
+ where = Where.PROTOTYPE;
+ break;
+ case SPECIALIZED_FUNCTION:
+- if (isSpecializedConstructor) {
+- where = Where.CONSTRUCTOR;
+- }
++ where = isSpecializedConstructor? Where.CONSTRUCTOR : Where.PROTOTYPE;
+ //fallthru
+ default:
+ break;
+--- ./nashorn/docs/DEVELOPER_README Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/docs/DEVELOPER_README Wed Jul 01 21:54:30 2015 -0700
+@@ -63,16 +63,19 @@
+ See the description of the codegen logger below.
+
+
+-SYSTEM PROPERTY: -Dnashorn.fields.objects
++SYSTEM PROPERTY: -Dnashorn.fields.objects, -Dnashorn.fields.dual
+
+-When this property is true, Nashorn will only use object fields for
+-AccessorProperties. This means that primitive values must be boxed
+-when stored in a field, which is significantly slower than using
+-primitive fields.
++When the nashorn.fields.objects property is true, Nashorn will always
++use object fields for AccessorProperties, requiring boxing for all
++primitive property values. When nashorn.fields.dual is set, Nashorn
++will always use dual long/object fields, which allows primitives to be
++stored without boxing. When neither system property is set, Nashorn
++chooses a setting depending on the optimistic types setting (dual
++fields when optimistic types are enabled, object-only fields otherwise).
+
+-By default, Nashorn uses dual object and long fields. Ints are
+-represented as the 32 low bits of the long fields. Doubles are
+-represented as the doubleToLongBits of their value. This way a
++With dual fields, Nashorn uses long fields to store primitive values.
++Ints are represented as the 32 low bits of the long fields. Doubles
++are represented as the doubleToLongBits of their value. This way a
+ single field can be used for all primitive types. Packing and
+ unpacking doubles to their bit representation is intrinsified by
+ the JVM and extremely fast.
+--- ./nashorn/make/build.xml Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/make/build.xml Wed Jul 01 21:54:30 2015 -0700
+@@ -1,7 +1,7 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+- Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2010, 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
+@@ -189,7 +189,7 @@
+ <mkdir dir="${fxshell.classes.dir}"/>
+ <javac srcdir="${fxshell.dir}"
+ destdir="${fxshell.classes.dir}"
+- classpath="${dist.jar}:${javac.classpath}"
++ classpath="${dist.jar}${path.separator}${javac.classpath}"
+ debug="${javac.debug}"
+ encoding="${javac.encoding}"
+ includeantruntime="false">
+@@ -210,7 +210,7 @@
+ </target>
+
+ <target name="javadoc" depends="jar">
+- <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="src/overview.html"
++ <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="${src.dir}/overview.html"
+ extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
+ additionalparam="-quiet" failonerror="true">
+ <classpath>
+@@ -282,12 +282,12 @@
+ <fileset dir="${test.src.dir}/META-INF/services/"/>
+ </copy>
+
+- <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/resources">
+- <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/resources"/>
++ <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/test/resources">
++ <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/test/resources"/>
+ </copy>
+
+- <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/resources">
+- <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/resources"/>
++ <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/test/resources">
++ <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/test/resources"/>
+ </copy>
+
+ <!-- tests that check nashorn internals and internal API -->
+@@ -388,19 +388,19 @@
+ </target>
+
+ <target name="check-testng" unless="testng.available">
+- <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under test/lib directory."/>
++ <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under ${test.lib} directory."/>
+ </target>
+
+ <!-- only to be invoked as dependency of "test" target -->
+ <target name="-test-classes-all" depends="jar" unless="test.class">
+ <fileset id="test.classes" dir="${build.test.classes.dir}">
+- <include name="**/api/javaaccess/*Test.class"/>
+- <include name="**/api/scripting/*Test.class"/>
+- <include name="**/codegen/*Test.class"/>
+- <include name="**/parser/*Test.class"/>
+- <include name="**/runtime/*Test.class"/>
+- <include name="**/runtime/regexp/*Test.class"/>
+- <include name="**/runtime/regexp/joni/*Test.class"/>
++ <include name="**/api/javaaccess/test/*Test.class"/>
++ <include name="**/api/scripting/test/*Test.class"/>
++ <include name="**/codegen/test/*Test.class"/>
++ <include name="**/parser/test/*Test.class"/>
++ <include name="**/runtime/test/*Test.class"/>
++ <include name="**/runtime/regexp/test/*Test.class"/>
++ <include name="**/runtime/regexp/joni/test/*Test.class"/>
+ <include name="**/framework/*Test.class"/>
+ </fileset>
+ </target>
+@@ -460,7 +460,7 @@
+ </testng>
+ </target>
+
+- <target name="test" depends="test-pessimistic, test-optimistic"/>
++ <target name="test" depends="get-testng, javadoc, test-pessimistic, test-optimistic"/>
+
+ <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+ <echo message="Running test suite in OPTIMISTIC mode..."/>
+@@ -490,7 +490,7 @@
+ <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy testng.jar, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar under test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
+ </target>
+
+- <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
++ <target name="testjfx" depends="jar, get-testng, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
+ <fileset id="test.classes" dir="${build.test.classes.dir}">
+ <include name="**/framework/*Test.class"/>
+ </fileset>
+@@ -518,7 +518,7 @@
+ </testng>
+ </target>
+
+- <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
++ <target name="testmarkdown" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+ <fileset id="test.classes" dir="${build.test.classes.dir}">
+ <include name="**/framework/*Test.class"/>
+ </fileset>
+@@ -537,7 +537,7 @@
+ </testng>
+ </target>
+
+- <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
++ <target name="test262" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+ <fileset id="test.classes" dir="${build.test.classes.dir}">
+ <include name="**/framework/*Test.class"/>
+ </fileset>
+@@ -561,7 +561,7 @@
+
+ <target name="test262parallel" depends="test262-parallel"/>
+
+- <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
++ <target name="test262-parallel" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+ <!-- use just build.test.classes.dir to avoid referring to TestNG -->
+ <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
+ <jvmarg line="${ext.class.path}"/>
+@@ -580,7 +580,7 @@
+
+ <target name="testparallel" depends="test-parallel"/>
+
+- <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
++ <target name="test-parallel" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+ <!-- use just build.test.classes.dir to avoid referring to TestNG -->
+ <java classname="${parallel.test.runner}" dir="${basedir}"
+ failonerror="true"
+@@ -685,7 +685,7 @@
+ </target>
+
+ <!-- get all external test scripts -->
+- <target name="externals" depends="init, check-external-tests, get-test262, get-octane, get-sunspider">
++ <target name="externals" depends="init, check-external-tests, get-test262, get-octane, get-sunspider, get-testng">
+ <!-- make external test dir -->
+ <mkdir dir="${test.external.dir}"/>
+
+@@ -710,8 +710,8 @@
+
+ <!-- showdown -->
+ <mkdir dir="${test.external.dir}/showdown"/>
+- <get src="https://raw.github.com/coreyti/showdown/master/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
+- <get src="https://raw.github.com/coreyti/showdown/master/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
++ <get src="https://raw.githubusercontent.com/showdownjs/showdown/0.5.4/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
++ <get src="https://raw.githubusercontent.com/showdownjs/showdown/0.5.4/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
+
+ </target>
+
+@@ -721,12 +721,20 @@
+ <!-- run all perf tests -->
+ <target name="perf" depends="externals, update-externals, sunspider, octane"/>
+
+- <!-- run all tests -->
+- <target name="exit-if-no-testng" depends="init, check-testng" unless="${testng.available}">
+- <fail message="Exiting.."/>
++ <!-- download and install testng.jar -->
++ <target name="get-testng" depends="prepare" unless="testng.available">
++ <get src="http://testng.org/testng-6.8.zip" dest="${test.lib}" skipexisting="true" ignoreerrors="true"/>
++ <unzip src="${test.lib}${file.separator}testng-6.8.zip" dest="${test.lib}">
++ <patternset>
++ <include name="testng-6.8/testng-6.8.jar"/>
++ </patternset>
++ </unzip>
++ <move file="${test.lib}${file.separator}testng-6.8${file.separator}testng-6.8.jar" tofile="${test.lib}${file.separator}testng.jar"/>
++ <delete dir="${test.lib}${file.separator}testng-6.8"/>
+ </target>
+
+- <target name="alltests" depends="exit-if-no-testng, externals, update-externals, test, test262parallel, perf"/>
++ <!-- run all tests -->
++ <target name="alltests" depends="get-testng, externals, update-externals, test, test262parallel, testmarkdown, perf"/>
+
+ <import file="build-benchmark.xml"/>
+
+--- ./nashorn/make/project.properties Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/make/project.properties Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2010, 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
+@@ -77,8 +77,11 @@
+ # configuration for java flight recorder
+ run.test.jvmargs.jfr=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128
+
++# test library location
++test.lib=${basedir}${file.separator}test${file.separator}lib
++
+ # jars refererred
+-file.reference.testng.jar=test/lib/testng.jar
++file.reference.testng.jar=${test.lib}${file.separator}testng.jar
+
+ # Set testng verbose level
+ # From TestNG docs: "the verbosity level (0 to 10 where 10 is most detailed)
+@@ -105,8 +108,8 @@
+ javac.classpath=\
+ ${build.classes.dir}
+ javac.test.classpath=\
+- ${build.classes.dir}:\
+- ${build.test.classes.dir}:\
++ ${build.classes.dir}${path.separator}\
++ ${build.test.classes.dir}${path.separator}\
+ ${file.reference.testng.jar}
+
+ meta.inf.dir=${src.dir}/META-INF
+@@ -237,9 +240,9 @@
+ -fx \
+ ${test.script.dir}${file.separator}jfx.js
+
+-file.reference.jemmyfx.jar=test${file.separator}lib${file.separator}JemmyFX.jar
+-file.reference.jemmycore.jar=test${file.separator}lib${file.separator}JemmyCore.jar
+-file.reference.jemmyawtinput.jar=test${file.separator}lib${file.separator}JemmyAWTInput.jar
++file.reference.jemmyfx.jar=${test.lib}${file.separator}JemmyFX.jar
++file.reference.jemmycore.jar=${test.lib}${file.separator}JemmyCore.jar
++file.reference.jemmyawtinput.jar=${test.lib}${file.separator}JemmyAWTInput.jar
+ file.reference.jfxrt.jar=${java.home}${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar
+ testjfx.run.test.classpath=\
+ ${file.reference.jemmyfx.jar}${path.separator}\
+@@ -253,8 +256,8 @@
+ testjfx-test-sys-prop.test.fork.jvm.options=${run.test.jvmargs.main} -Xmx${run.test.xmx} -cp ${testjfx.run.test.classpath}
+
+ run.test.classpath=\
+- ${file.reference.testng.jar}:\
+- ${nashorn.internal.tests.jar}:\
++ ${file.reference.testng.jar}${path.separator}\
++ ${nashorn.internal.tests.jar}${path.separator}\
+ ${nashorn.api.tests.jar}
+
+ src.dir=src
+@@ -330,6 +333,8 @@
+
+ # VM options for script tests with @fork option
+ test-sys-prop.test.fork.jvm.options=${run.test.jvmargs.main} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -cp ${run.test.classpath}
++# VM options for no-security script tests with @fork option - same as above but without jvmsecurityargs
++test-sys-prop-no-security.test.fork.jvm.options=${run.test.jvmargs.main} -Xmx${run.test.xmx} -cp ${run.test.classpath}
+
+ # path of rhino.jar for benchmarks
+ rhino.dir=
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/autoimports.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,163 @@
++# autoimports script requires -scripting mode
++
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++/*
++ * It is tedious to import Java classes used in a script. Sometimes it is easier
++ * use simple names of java classes and have a script auto import Java classes.
++ * You can load this script at the start of an interactive jjs session or at the
++ * start of your script. This script defines a __noSuchProperty__ hook to auto
++ * import Java classes as needed and when they are referred to for the first time
++ * in your script. You can also call the "autoimports" function to print script
++ * statements that you need to use in your script, i.e., have the function generate
++ * a script to import Java classes used by your script so far. After running your
++ * script, you can call autoimports to get the exact Java imports you need and replace
++ * the autoimports load with the generated import statements (to avoid costly init of
++ * the autoimports script).
++ */
++
++(function() {
++ var ArrayList = Java.type("java.util.ArrayList");
++ var HashMap = Java.type("java.util.HashMap");
++ var JarFile = Java.type("java.util.jar.JarFile");
++ var File = Java.type("java.io.File");
++ var Files = Java.type("java.nio.file.Files");
++ var FileSystems = Java.type("java.nio.file.FileSystems");
++ var System = Java.type("java.lang.System");
++ var URI = Java.type("java.net.URI");
++
++ // initialize a class to package map by iterating all
++ // classes available in the system by walking through "jrt fs"
++
++ var clsToPkg = new HashMap();
++
++ // locate rt.jar from sun.boot.class.path
++ function findRtJar() {
++ var paths = System.getProperty("sun.boot.class.path").split(File.pathSeparator);
++ for each (var p in paths) {
++ if (p.endsWith("rt.jar") && new File(p).exists()) {
++ return p;
++ }
++ }
++ }
++
++
++ function addToClsToPkg(c, p) {
++ if (clsToPkg.containsKey(c)) {
++ var val = clsToPkg.get(c);
++ if (val instanceof ArrayList) {
++ val.add(p);
++ } else {
++ var al = new ArrayList();
++ al.add(val);
++ al.add(p);
++ clsToPkg.put(c, al);
++ }
++ } else {
++ clsToPkg.put(c, p);
++ }
++ }
++
++ // handle collision and allow user to choose package
++ function getPkgOfCls(c) {
++ var val = clsToPkg.get(c);
++ if (val instanceof ArrayList) {
++ var count = 1;
++ print("Multiple matches for " + c + ", choose package:");
++ for each (var v in val) {
++ print(count + ". " + v);
++ count++;
++ }
++ var choice = parseInt(readLine());
++ if (isNaN(choice) || choice < 1 || choice > val.size()) {
++ print("invalid choice: " + choice);
++ return undefined;
++ }
++ return val.get(choice - 1);
++ } else {
++ return val;
++ }
++ }
++
++ var rtJar = findRtJar();
++ var stream = new JarFile(rtJar).stream();
++ try {
++ stream.forEach(
++ function(entry) {
++ var str = entry.name;
++ if (str.endsWith(".class")) {
++ if (str.startsWith("java") ||
++ str.startsWith("javax") ||
++ str.startsWith("org")) {
++ var lastIdx = str.lastIndexOf('/');
++ if (lastIdx != -1) {
++ var pkg = str.substring(0, lastIdx).replaceAll('/', '.');
++ var cls = str.substring(lastIdx + 1, str.lastIndexOf(".class"));
++ addToClsToPkg(cls, pkg);
++ }
++ }
++ }
++ });
++ } finally {
++ stream.close();
++ }
++
++ var imports = new ArrayList();
++ var global = this;
++ var oldNoSuchProp = global.__noSuchProperty__;
++ this.__noSuchProperty__ = function(name) {
++ 'use strict';
++
++ if (clsToPkg.containsKey(name)) {
++ var pkg = getPkgOfCls(name);
++ if (pkg) {
++ var clsName = pkg + "." + name;
++ imports.add("var " + name + " = Java.type('" + clsName + "');");
++ return global[name] = Java.type(clsName);
++ }
++ } else if (typeof oldNoSuchProp == 'function') {
++ return oldNoSuchProp.call(this, name);
++ }
++
++ if (typeof this == 'undefined') {
++ throw new ReferenceError(name);
++ } else {
++ return undefined;
++ }
++ }
++
++ this.autoimports = function() {
++ for each (var im in imports) {
++ print(im);
++ }
++ }
++})();
+--- ./nashorn/samples/browser_dom.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/samples/browser_dom.js Wed Jul 01 21:54:30 2015 -0700
+@@ -1,4 +1,4 @@
+-#// Usage: jjs -fx browser.js
++#// Usage: jjs -fx browser_dom.js
+
+ /*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+@@ -32,7 +32,7 @@
+ */
+
+ if (!$OPTIONS._fx) {
+- print("Usage: jjs -fx browser.js");
++ print("Usage: jjs -fx browser_dom.js");
+ exit(1);
+ }
+
+@@ -40,7 +40,6 @@
+ var ChangeListener = Java.type("javafx.beans.value.ChangeListener");
+ var Scene = Java.type("javafx.scene.Scene");
+ var WebView = Java.type("javafx.scene.web.WebView");
+-var EventListener = Java.type("org.w3c.dom.events.EventListener");
+
+ // JavaFX start method
+ function start(stage) {
+@@ -74,10 +73,10 @@
+ var btn = document.createElement("button");
+ var n = 0;
+ // attach a button handler - nashorn function!
+- btn.onclick = new EventListener(function() {
++ btn.onclick = function() {
+ n++; print("You clicked " + n + " time(s)");
+ print("you clicked OK " + wv.engine.executeScript("okCount"));
+- });
++ };
+ // attach text to button
+ var t = document.createTextNode("Click Me!");
+ btn.appendChild(t);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/console.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,134 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++/**
++ * Simple Web Console-like support for Nashorn. In addition to
++ * Web console object methods, this console add methods of
++ * java.io.Console as well. Note:not all web console methods are
++ * implemented but useful subset is implemented.
++ *
++ * See also: https://developer.mozilla.org/en/docs/Web/API/console
++ */
++
++
++if (typeof console == 'undefined') {
++
++(function() {
++ var LocalDateTime = Java.type("java.time.LocalDateTime");
++ var System = Java.type("java.lang.System");
++ var jconsole = System.console();
++
++ // add a new global variable called "console"
++ this.console = {
++ };
++
++ function addConsoleMethods() {
++ // expose methods of java.io.Console as an extension
++ var placeholder = "-*-";
++ // put a placeholder for each name from java.lang.Object
++ var objMethods = Object.bindProperties({}, new java.lang.Object());
++ for (var m in objMethods) {
++ console[m] = placeholder;
++ }
++
++ // bind only the methods of java.io.Console
++ // This bind will skip java.lang.Object methods as console
++ // has properties of same name.
++ Object.bindProperties(console, jconsole);
++
++ // Now, delete java.lang.Object methods
++ for (var m in console) {
++ if (console[m] == placeholder) {
++ delete console[m];
++ }
++ }
++ }
++
++ addConsoleMethods();
++
++ function consoleLog(type, msg) {
++ // print type of message, then time.
++ jconsole.format("%s [%s] ", type, LocalDateTime.now().toString());
++ if (typeof msg == 'string') {
++ jconsole.format(msg + "\n", Array.prototype.slice.call(arguments, 2));
++ } else {
++ // simple space separated values and newline at the end
++ var arr = Array.prototype.slice.call(arguments, 1);
++ jconsole.format("%s\n", arr.join(" "));
++ }
++ }
++
++ console.toString = function() "[object Console]";
++
++ // web console functions
++
++ console.assert = function(expr) {
++ if (! expr) {
++ arguments[0] = "Assertion Failed:";
++ consoleLog.apply(console, arguments);
++ // now, stack trace at the end
++ jconsole.format("%s\n", new Error().stack);
++ }
++ };
++
++ // dummy clear to avoid error!
++ console.clear = function() {};
++
++ var counter = {
++ get: function(label) {
++ if (! this[label]) {
++ return this[label] = 1;
++ } else {
++ return ++this[label];
++ }
++ }
++ };
++
++ // counter
++ console.count = function(label) {
++ label = label? String(label) : "<no label>";
++ jconsole.format("%s: %d\n",label, counter.get(label).intValue());
++ }
++
++ // logging
++ console.error = consoleLog.bind(jconsole, "ERROR");
++ console.info = consoleLog.bind(jconsole, "INFO");
++ console.log = console.info;
++ console.debug = console.log;
++ console.warn = consoleLog.bind(jconsole, "WARNING");
++
++ // print stack trace
++ console.trace = function() {
++ jconsole.format("%s\n", new Error().stack);
++ };
++})();
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/consoleuse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,55 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++load(__DIR__ + "console.js");
++
++console.log("consoleuse.js started!");
++
++function func() {
++ console.count("func");
++}
++
++
++func();
++func();
++func();
++func();
++
++// java.io.Console method
++console.readPassword("passworld please: ");
++console.error("Big error: %s!", "you revealed your password!");
++console.warn("You've done this %d times", 345);
++console.assert(arguments.length != 0, "no arguments!");
++
++// java.io.Console methods
++var str = console.readLine("enter something: ");
++console.printf("you entered: %s\n", str);
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/dateconversion.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,73 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++// Converting between #javascript Date and #java8 LocalDateTime with #nashorn
++
++// JavaScript Date with current time
++var d = new Date();
++print(d);
++
++// Java 8 java.time classes used
++var Instant = java.time.Instant;
++var LocalDateTime = java.time.LocalDateTime;
++var ZoneId = java.time.ZoneId;
++
++// Date.prototype.getTime
++
++// getTime() method returns the numeric value corresponding to the time
++// for the specified date according to universal time. The value returned
++// by the getTime() method is the number of milliseconds since 1 January 1970 00:00:00 UTC.
++// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime
++
++// Java Instant.ofEpochMilli to convert time in milliseconds to Instant object
++// https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html#ofEpochMilli-long-
++
++var instant = Instant.ofEpochMilli(d.getTime());
++
++// Instant to LocalDateTime using LocalDateTime.ofInstant
++// https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#ofInstant-java.time.Instant-java.time.ZoneId-
++
++var ldt = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
++print(ldt);
++
++// converting a LocalDateTime to JavaScript Date
++// convert LocalDateTime to Instant first
++// https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#atZone-java.time.ZoneId-
++
++var instant = ldt.atZone(ZoneId.systemDefault()).toInstant();
++
++// instant to to epoch milliseconds
++// https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html#toEpochMilli--
++// and then to JavaScript Date from time in milliseconds
++// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date
++
++var d1 = new Date(instant.toEpochMilli());
++print(d1);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/exec.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,50 @@
++# exec script requires -scripting mode
++
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++// The $EXEC builtin function can be used to run external commands:
++$EXEC("ls")
++$EXEC("ls -la")
++
++// It can also be given a string to use as stdin:
++$EXEC("cat", "Hello, world!")
++
++// Additional arguments can be passed after the stdin argument, as an array of
++// strings, or a sequence of varargs:
++$EXEC("ls", "" /* no stdin */, "-l", "-a")
++$EXEC("ls", "" /* no stdin */, ["-l", "-a"])
++
++// Output of running external commands is returned from $EXEC:
++print($EXEC("ls"))
++
++// apply on $EXEC
++print($EXEC.apply(this, ["ls"]));
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/getclassnpe.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,122 @@
++#// Usage: jjs getclassnpe.js -- <directory>
++
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++/*
++ * java.lang.Object.getClass() is sometimes used to do null check. This
++ * obfuscating Object.getClass() check relies on non-related intrinsic
++ * performance, which is potentially not available everywhere.
++ * See also http://cr.openjdk.java.net/~shade/scratch/NullChecks.java
++ * This nashorn script checks for such uses in your .java files in the
++ * given directory (recursively).
++ */
++
++if (arguments.length == 0) {
++ print("Usage: jjs getclassnpe.js -- <directory>");
++ exit(1);
++}
++
++// Java types used
++var File = Java.type("java.io.File");
++var Files = Java.type("java.nio.file.Files");
++var StringArray = Java.type("java.lang.String[]");
++var ToolProvider = Java.type("javax.tools.ToolProvider");
++var MethodInvocationTree = Java.type("com.sun.source.tree.MethodInvocationTree");
++var TreeScanner = Java.type("com.sun.source.util.TreeScanner");
++
++// parse a specific .java file to check if it uses
++// Object.getClass() for null check.
++function checkGetClassNPE() {
++ // get the system compiler tool
++ var compiler = ToolProvider.systemJavaCompiler;
++ // get standard file manager
++ var fileMgr = compiler.getStandardFileManager(null, null, null);
++ // Using Java.to convert script array (arguments) to a Java String[]
++ var compUnits = fileMgr.getJavaFileObjects(
++ Java.to(arguments, StringArray));
++ // create a new compilation task
++ var task = compiler.getTask(null, fileMgr, null, null, null, compUnits);
++ // subclass SimpleTreeVisitor - to check for obj.getClass(); statements
++ var GetClassNPEChecker = Java.extend(TreeScanner);
++
++ var visitor = new GetClassNPEChecker() {
++ lineMap: null,
++ sourceFile: null,
++
++ // save compilation unit details for reporting
++ visitCompilationUnit: function(node, p) {
++ this.sourceFile = node.sourceFile;
++ this.lineMap = node.lineMap;
++ return Java.super(visitor).visitCompilationUnit(node, p);
++ },
++
++ // look for "foo.getClass();" expression statements
++ visitExpressionStatement: function(node, p) {
++ var expr = node.expression;
++ if (expr instanceof MethodInvocationTree) {
++ var name = String(expr.methodSelect.identifier);
++
++ // will match any "getClass" call with zero arguments!
++ if (name == "getClass" && expr.arguments.size() == 0) {
++ print(this.sourceFile.getName()
++ + " @ "
++ + this.lineMap.getLineNumber(node.pos)
++ + ":"
++ + this.lineMap.getColumnNumber(node.pos));
++
++ print("\t", node);
++ }
++ }
++ }
++ }
++
++ for each (var cu in task.parse()) {
++ cu.accept(visitor, null);
++ }
++}
++
++// for each ".java" file in the directory (recursively)
++function main(dir) {
++ Files.walk(dir.toPath()).
++ forEach(function(p) {
++ var name = p.toFile().absolutePath;
++ if (name.endsWith(".java")) {
++ try {
++ checkGetClassNPE(p.toFile().getAbsolutePath());
++ } catch (e) {
++ print(e);
++ }
++ }
++ });
++}
++
++main(new File(arguments[0]));
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/javahelp.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,67 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++// script helpers to print meta info on Java instances and classes
++
++// print instance methods info on a Java object or static methods info of a Java class
++function methods(jobj) {
++ if (! Java.isJavaObject(jobj)) {
++ throw new TypeError("not a Java object");
++ }
++
++ var isStatic = Java.isType(jobj);
++ var obj = Object.bindProperties({}, jobj);
++ for each (var i in obj) {
++ if (Java.isJavaMethod(i)) {
++ var str = String(i);
++ var idx = str.indexOf(' ');
++ var overloaded = str.substring(0, idx).endsWith("OverloadedDynamicMethod");
++ var lastIdx = isStatic? str.lastIndexOf('] on') : str.lastIndexOf(']');
++ print(str.substring(idx + 1, lastIdx) + (overloaded? "*" : ""))
++ }
++ }
++}
++
++// print instance field names of a Java object or static field names of a Java class
++function fields(jobj) {
++ if (! Java.isJavaObject(jobj)) {
++ throw new TypeError("not a Java object");
++ }
++
++ var obj = Object.bindProperties({}, jobj);
++ for (var i in obj) {
++ if (! Java.isJavaMethod(obj[i])) {
++ print(i);
++ }
++ }
++}
++
++undefined;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/jd.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,94 @@
++#// Usage: jjs -cp <asmtools.jar> jd.js -- <classname> [jdis|jdec]
++
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++// javap-like disassembler/decoder tool that disassembles/decodes
++// java classes but with OpenJDK AsmTools disassembler/decoder syntax.
++// You need to build asmtool.jar from OpenJDK codetools project
++// specify it with -cp option.
++
++// See also https://wiki.openjdk.java.net/display/CodeTools/AsmTools
++
++function usage() {
++ print("Usage: jjs -cp <asmtools.jar> jd.js -- <classname> [jdis|jdec]");
++ exit(1);
++}
++
++if (arguments.length == 0) {
++ usage();
++}
++
++// argument handling
++// convert to internal class name
++var className = arguments[0].replaceAll('\\.', '/');
++var tool;
++if (arguments.length > 1) {
++ tool = arguments[1];
++ switch (tool) {
++ case 'jdis':
++ case 'jdec':
++ break;
++ default:
++ usage();
++ }
++} else {
++ tool = "jdis"; // default tool
++}
++
++// Java classes used
++var AsmTools = Java.type("org.openjdk.asmtools.Main");
++var Files = Java.type("java.nio.file.Files");
++var StandardCopyOption = Java.type("java.nio.file.StandardCopyOption");
++
++// retrive input stream for .class bytes
++var cl = AsmTools.class.classLoader;
++var res = cl.getResource(className + ".class");
++
++if (res) {
++ var is = res.openStream();
++ var tmpPath;
++ try {
++ // copy the content of the .class to a temp file
++ tmpPath = Files.createTempFile("asmtools-", ".class");
++ // mark as delete-on-exit
++ tmpPath.toFile().deleteOnExit();
++ Files.copy(is, tmpPath, [ StandardCopyOption.REPLACE_EXISTING ]);
++ } finally {
++ is.close();
++ }
++
++ // invoke asmtools Main
++ AsmTools.main([ tool, tmpPath.toString() ]);
++} else {
++ print("no such class: " + arguments[0]);
++ exit(1);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/secondssince.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,43 @@
++# usage: jjs secondssince.js
++
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++// Number of seconds elapsed since the specified Instance #nashorn #javascript #java
++// Input date and time in ISO 8601 format
++// Example: 2001-01-01T00:00:00Z for 1 Jan 2001, 0 GMT
++
++var Instant = java.time.Instant;
++var ChronoUnit = java.time.temporal.ChronoUnit;
++print("Enter date time:");
++var sec = Instant.parse(readLine()).
++ until(Instant.now(), ChronoUnit.SECONDS);
++print(sec);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/showenv.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,82 @@
++#// Usage: jjs -fx showenv.js
++
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++if (!$OPTIONS._fx) {
++ print("Usage: jjs -fx showenv.js");
++ exit(1);
++}
++
++// This script displays environment entries as a HTML table.
++// Demonstrates heredoc to generate HTML content and display
++// using JavaFX WebView.
++
++// JavaFX classes used
++var Scene = Java.type("javafx.scene.Scene");
++var WebView = Java.type("javafx.scene.web.WebView");
++
++// JavaFX start method
++function start(stage) {
++ start.title = "Your Environment";
++ var wv = new WebView();
++ var envrows = "";
++ for (var i in $ENV) {
++ envrows += <<TBL
++<tr>
++<td>
++${i}
++</td>
++<td>
++${$ENV[i]}
++</td>
++</tr>
++TBL
++ }
++
++ wv.engine.loadContent(<<EOF
++<html>
++<head>
++<title>
++Your Environment
++</title>
++</head>
++<body>
++<h1>Your Environment</h1>
++<table border="1">
++${envrows}
++</table>
++</body>
++</html>
++EOF, "text/html");
++ stage.scene = new Scene(wv, 750, 500);
++ stage.show();
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/showsysprops.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,84 @@
++#// Usage: jjs -fx showsysprops.js
++
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++if (!$OPTIONS._fx) {
++ print("Usage: jjs -fx showsysprops.js");
++ exit(1);
++}
++
++// This script displays System properties as a HTML table.
++// Demonstrates heredoc to generate HTML content and display
++// using JavaFX WebView.
++
++// JavaFX, Java classes used
++var Scene = Java.type("javafx.scene.Scene");
++var System = Java.type("java.lang.System");
++var WebView = Java.type("javafx.scene.web.WebView");
++
++// JavaFX start method
++function start(stage) {
++ start.title = "Your System Properties";
++ var wv = new WebView();
++ var sysproprows = "";
++ var sysprops = System.properties;
++ for (var i in sysprops) {
++ sysproprows += <<TBL
++<tr>
++<td>
++${i}
++</td>
++<td>
++${sysprops[i]}
++</td>
++</tr>
++TBL
++ }
++
++ wv.engine.loadContent(<<EOF
++<html>
++<head>
++<title>
++Your System Properties
++</title>
++</head>
++<body>
++<h1>Your System Properties</h1>
++<table border="1">
++${sysproprows}
++</table>
++</body>
++</html>
++EOF, "text/html");
++ stage.scene = new Scene(wv, 750, 500);
++ stage.show();
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/time_color.fx Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,89 @@
++#// Usage: jjs -fx time_color.js [-- true/false]
++
++/*
++ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++// A simple javafx program that changes background color
++// of scene based on current time value (once per sec).
++// inspired by http://whatcolourisit.scn9a.org/
++
++if (!$OPTIONS._fx) {
++ print("Usage: jjs -fx time_color.js");
++ print(" jjs -fx time_color.js -- true");
++ exit(1);
++}
++
++// JavaFX classes used
++var Color = Java.type("javafx.scene.paint.Color");
++var Group = Java.type("javafx.scene.Group");
++var Label = Java.type("javafx.scene.control.Label");
++var Platform = Java.type("javafx.application.Platform");
++var Scene = Java.type("javafx.scene.Scene");
++var Timer = Java.type("java.util.Timer");
++
++// execute function periodically once per given time in millisec
++function setInterval(func, ms) {
++ // New timer, run as daemon so the application can quit
++ var timer = new Timer("setInterval", true);
++ timer.schedule(function() Platform.runLater(func), ms, ms);
++ return timer;
++}
++
++// do you want to flip hour/min/sec for RGB?
++var flip = arguments.length > 0? "true".equals(arguments[0]) : false;
++
++// JavaFX start method
++function start(stage) {
++ start.title = "Time Color";
++ var root = new Group();
++ var label = new Label("time");
++ label.textFill = Color.WHITE;
++ root.children.add(label);
++ stage.scene = new Scene(root, 700, 500);
++
++ setInterval(function() {
++ var d = new Date();
++ var hours = d.getHours();
++ var mins = d.getMinutes();
++ var secs = d.getSeconds();
++
++ if (hours < 10) hours = "0" + hours;
++ if (mins < 10) mins = "0" + mins;
++ if (secs < 10) secs = "0" + secs;
++
++ var hex = flip?
++ "#" + secs + mins + hours : "#" + hours + mins + secs;
++ label.text = "Color: " + hex;
++ stage.scene.fill = Color.web(hex);
++ }, 1000);
++
++ stage.show();
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/undefined_call.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,48 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++// Nashorn extension: __noSuchMethod__
++// See also: https://wiki.openjdk.java.net/display/Nashorn/Nashorn+extensions#Nashornextensions-__noSuchMethod__
++
++Object.prototype.__noSuchMethod__ = function(name) {
++ print(name + " function is not defined in " + this);
++
++ // Nashorn extension: stack property
++ // gives stack trace as a string
++ print(new Error().stack);
++}
++
++function func(obj) {
++ obj.foo();
++}
++
++func({});
++func(this);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/samples/unzip.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++/*
++ * Simple unzip tool using #nashorn and #java
++ * zip fs file system interface.
++ */
++
++if (arguments.length == 0) {
++ print("Usage: jjs zipfs.js -- <.zip/.jar file> [out dir]");
++ exit(1);
++}
++
++var File = Java.type("java.io.File");
++// output directory where zip is extracted
++var outDir = arguments[1];
++if (!outDir) {
++ outDir = ".";
++} else {
++ if (! new File(outDir).isDirectory()) {
++ print(outDir + " directory does not exist!");
++ exit(1);
++ }
++}
++
++var Files = Java.type("java.nio.file.Files");
++var FileSystems = Java.type("java.nio.file.FileSystems");
++var Paths = Java.type("java.nio.file.Paths");
++
++var zipfile = Paths.get(arguments[0])
++var fs = FileSystems.newFileSystem(zipfile, null);
++var root = fs.rootDirectories[0];
++
++// walk root and handle each Path
++Files.walk(root).forEach(
++ function(p) {
++ var outPath = outDir +
++ p.toString().replace('/', File.separatorChar);
++ print(outPath);
++ if (Files.isDirectory(p)) {
++ // create directories as needed
++ new File(outPath).mkdirs();
++ } else {
++ // copy a 'file' resource
++ Files.copy(p, new File(outPath).toPath());
++ }
++ }
++);
++
++// done
++fs.close();
+--- ./nashorn/src/jdk/internal/dynalink/DynamicLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/DynamicLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -88,6 +88,7 @@
+ import java.lang.invoke.MethodType;
+ import java.lang.invoke.MutableCallSite;
+ import java.util.List;
++import java.util.Objects;
+ import jdk.internal.dynalink.linker.GuardedInvocation;
+ import jdk.internal.dynalink.linker.GuardingDynamicLinker;
+ import jdk.internal.dynalink.linker.LinkRequest;
+@@ -98,10 +99,12 @@
+ import jdk.internal.dynalink.support.RuntimeContextLinkRequestImpl;
+
+ /**
+- * The linker for {@link RelinkableCallSite} objects. Users of it (scripting frameworks and language runtimes) have to
+- * create a linker using the {@link DynamicLinkerFactory} and invoke its link method from the invokedynamic bootstrap
+- * methods to set the target of all the call sites in the code they generate. Usual usage would be to create one class
+- * per language runtime to contain one linker instance as:
++ * The linker for {@link RelinkableCallSite} objects. Users of it (scripting
++ * frameworks and language runtimes) have to create a linker using the
++ * {@link DynamicLinkerFactory} and invoke its link method from the invokedynamic
++ * bootstrap methods to set the target of all the call sites in the code they
++ * generate. Usual usage would be to create one class per language runtime to
++ * contain one linker instance as:
+ *
+ * <pre>
+ * class MyLanguageRuntime {
+@@ -122,19 +125,27 @@
+ *
+ * Note how there are three components you will need to provide here:
+ * <ul>
+- * <li>You're expected to provide a {@link GuardingDynamicLinker} for your own language. If your runtime doesn't
+- * have its own language and/or object model (i.e. it's a generic scripting shell), you don't need to implement a
+- * dynamic linker; you would simply not invoke the {@code setPrioritizedLinker} method on the factory, or even better,
+- * simply use {@link DefaultBootstrapper}.</li>
+- * <li>The performance of the programs can depend on your choice of the class to represent call sites. The above
+- * example used {@link MonomorphicCallSite}, but you might want to use {@link ChainedCallSite} instead. You'll need to
+- * experiment and decide what fits your language runtime the best. You can subclass either of these or roll your own if
+- * you need to.</li>
+- * <li>You also need to provide {@link CallSiteDescriptor}s to your call sites. They are immutable objects that contain
+- * all the information about the call site: the class performing the lookups, the name of the method being invoked, and
+- * the method signature. The library has a default {@link CallSiteDescriptorFactory} for descriptors that you can use,
+- * or you can create your own descriptor classes, especially if you need to add further information (values passed in
++ *
++ * <li>You're expected to provide a {@link GuardingDynamicLinker} for your own
++ * language. If your runtime doesn't have its own language and/or object model
++ * (i.e., it's a generic scripting shell), you don't need to implement a dynamic
++ * linker; you would simply not invoke the {@code setPrioritizedLinker} method
++ * on the factory, or even better, simply use {@link DefaultBootstrapper}.</li>
++ *
++ * <li>The performance of the programs can depend on your choice of the class to
++ * represent call sites. The above example used {@link MonomorphicCallSite}, but
++ * you might want to use {@link ChainedCallSite} instead. You'll need to
++ * experiment and decide what fits your language runtime the best. You can
++ * subclass either of these or roll your own if you need to.</li>
++ *
++ * <li>You also need to provide {@link CallSiteDescriptor}s to your call sites.
++ * They are immutable objects that contain all the information about the call
++ * site: the class performing the lookups, the name of the method being invoked,
++ * and the method signature. The library has a default {@link CallSiteDescriptorFactory}
++ * for descriptors that you can use, or you can create your own descriptor
++ * classes, especially if you need to add further information (values passed in
+ * additional parameters to the bootstrap method) to them.</li>
++ *
+ * </ul>
+ *
+ * @author Attila Szegedi
+@@ -175,11 +186,15 @@
+ }
+
+ /**
+- * Links an invokedynamic call site. It will install a method handle into the call site that invokes the relinking
+- * mechanism of this linker. Next time the call site is invoked, it will be linked for the actual arguments it was
+- * invoked with.
++ * Links an invokedynamic call site. It will install a method handle into
++ * the call site that invokes the relinking mechanism of this linker. Next
++ * time the call site is invoked, it will be linked for the actual arguments
++ * it was invoked with.
+ *
++ * @param <T> the particular subclass of {@link RelinkableCallSite} for
++ * which to create a link.
+ * @param callSite the call site to link.
++ *
+ * @return the callSite, for easy call chaining.
+ */
+ public <T extends RelinkableCallSite> T link(final T callSite) {
+@@ -188,10 +203,13 @@
+ }
+
+ /**
+- * Returns the object representing the lower level linker services of this class that are normally exposed to
+- * individual language-specific linkers. While as a user of this class you normally only care about the
+- * {@link #link(RelinkableCallSite)} method, in certain circumstances you might want to use the lower level services
+- * directly; either to lookup specific method handles, to access the type converters, and so on.
++ * Returns the object representing the lower level linker services of this
++ * class that are normally exposed to individual language-specific linkers.
++ * While as a user of this class you normally only care about the
++ * {@link #link(RelinkableCallSite)} method, in certain circumstances you
++ * might want to use the lower level services directly; either to lookup
++ * specific method handles, to access the type converters, and so on.
++ *
+ * @return the object representing the linker services of this class.
+ */
+ public LinkerServices getLinkerServices() {
+@@ -217,7 +235,9 @@
+ *
+ * @param callSite the call site itself
+ * @param arguments arguments to the invocation
++ *
+ * @return return the method handle for the invocation
++ *
+ * @throws Exception rethrows any exception thrown by the linkers
+ */
+ @SuppressWarnings("unused")
+@@ -252,7 +272,7 @@
+ // Make sure we filter the invocation before linking it into the call site. This is typically used to match the
+ // return type of the invocation to the call site.
+ guardedInvocation = prelinkFilter.filter(guardedInvocation, linkRequest, linkerServices);
+- guardedInvocation.getClass(); // null pointer check
++ Objects.requireNonNull(guardedInvocation);
+
+ int newRelinkCount = relinkCount;
+ // Note that the short-circuited "&&" evaluation below ensures we'll increment the relinkCount until
+@@ -271,11 +291,15 @@
+ }
+
+ /**
+- * Returns a stack trace element describing the location of the call site currently being linked on the current
+- * thread. The operation internally creates a Throwable object and inspects its stack trace, so it's potentially
+- * expensive. The recommended usage for it is in writing diagnostics code.
+- * @return a stack trace element describing the location of the call site currently being linked, or null if it is
+- * not invoked while a call site is being linked.
++ * Returns a stack trace element describing the location of the call site
++ * currently being linked on the current thread. The operation internally
++ * creates a Throwable object and inspects its stack trace, so it's
++ * potentially expensive. The recommended usage for it is in writing
++ * diagnostics code.
++ *
++ * @return a stack trace element describing the location of the call site
++ * currently being linked, or null if it is not invoked while a call
++ * site is being linked.
+ */
+ public static StackTraceElement getLinkedCallSiteLocation() {
+ final StackTraceElement[] trace = new Throwable().getStackTrace();
+@@ -289,8 +313,10 @@
+ }
+
+ /**
+- * Deprecated because of not precise name.
++ * Deprecated because of imprecise name.
++ *
+ * @deprecated Use {@link #getLinkedCallSiteLocation()} instead.
++ *
+ * @return see non-deprecated method
+ */
+ @Deprecated
+@@ -299,20 +325,26 @@
+ }
+
+ /**
+- * Returns true if the frame represents {@code MethodHandleNatives.linkCallSite()}, the frame immediately on top of
+- * the call site frame when the call site is being linked for the first time.
++ * Returns {@code true} if the frame represents {@code MethodHandleNatives.linkCallSite()},
++ * the frame immediately on top of the call site frame when the call site is
++ * being linked for the first time.
++ *
+ * @param frame the frame
+- * @return true if this frame represents {@code MethodHandleNatives.linkCallSite()}
++ *
++ * @return {@code true} if this frame represents {@code MethodHandleNatives.linkCallSite()}.
+ */
+ private static boolean isInitialLinkFrame(final StackTraceElement frame) {
+ return testFrame(frame, INITIAL_LINK_METHOD_NAME, INITIAL_LINK_CLASS_NAME);
+ }
+
+ /**
+- * Returns true if the frame represents {@code DynamicLinker.relink()}, the frame immediately on top of the call
+- * site frame when the call site is being relinked (linked for second and subsequent times).
++ * Returns {@code true} if the frame represents {@code DynamicLinker.relink()},
++ * the frame immediately on top of the call site frame when the call site is
++ * being relinked (linked for second and subsequent times).
++ *
+ * @param frame the frame
+- * @return true if this frame represents {@code DynamicLinker.relink()}
++ *
++ * @return {@code true} if this frame represents {@code DynamicLinker.relink()}.
+ */
+ private static boolean isRelinkFrame(final StackTraceElement frame) {
+ return testFrame(frame, RELINK_METHOD_NAME, CLASS_NAME);
+--- ./nashorn/src/jdk/internal/dynalink/DynamicLinkerFactory.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/DynamicLinkerFactory.java Wed Jul 01 21:54:30 2015 -0700
+@@ -97,6 +97,8 @@
+ import jdk.internal.dynalink.linker.GuardingDynamicLinker;
+ import jdk.internal.dynalink.linker.GuardingTypeConverterFactory;
+ import jdk.internal.dynalink.linker.LinkRequest;
++import jdk.internal.dynalink.linker.LinkerServices;
++import jdk.internal.dynalink.linker.MethodHandleTransformer;
+ import jdk.internal.dynalink.linker.MethodTypeConversionStrategy;
+ import jdk.internal.dynalink.support.AutoDiscovery;
+ import jdk.internal.dynalink.support.BottomGuardingDynamicLinker;
+@@ -132,6 +134,7 @@
+ private int unstableRelinkThreshold = DEFAULT_UNSTABLE_RELINK_THRESHOLD;
+ private GuardedInvocationFilter prelinkFilter;
+ private MethodTypeConversionStrategy autoConversionStrategy;
++ private MethodHandleTransformer internalObjectsFilter;
+
+ /**
+ * Sets the class loader for automatic discovery of available linkers. If not set explicitly, then the thread
+@@ -284,6 +287,15 @@
+ }
+
+ /**
++ * Sets a method handle transformer that is supposed to act as the implementation of this linker factory's linkers'
++ * services {@link LinkerServices#filterInternalObjects(java.lang.invoke.MethodHandle)} method.
++ * @param internalObjectsFilter a method handle transformer filtering out internal objects, or null.
++ */
++ public void setInternalObjectsFilter(final MethodHandleTransformer internalObjectsFilter) {
++ this.internalObjectsFilter = internalObjectsFilter;
++ }
++
++ /**
+ * Creates a new dynamic linker consisting of all the prioritized, autodiscovered, and fallback linkers as well as
+ * the pre-link filter.
+ *
+@@ -350,8 +362,8 @@
+ }
+
+ return new DynamicLinker(new LinkerServicesImpl(new TypeConverterFactory(typeConverters,
+- autoConversionStrategy), composite), prelinkFilter, runtimeContextArgCount, syncOnRelink,
+- unstableRelinkThreshold);
++ autoConversionStrategy), composite, internalObjectsFilter), prelinkFilter, runtimeContextArgCount,
++ syncOnRelink, unstableRelinkThreshold);
+ }
+
+ private static ClassLoader getThreadContextClassLoader() {
+--- ./nashorn/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -570,7 +570,7 @@
+ private static final MethodHandle CONSTANT_NULL_DROP_ANNOTATED_METHOD = MethodHandles.dropArguments(
+ MethodHandles.constant(Object.class, null), 0, AnnotatedDynamicMethod.class);
+ private static final MethodHandle GET_ANNOTATED_METHOD = privateLookup.findVirtual(AnnotatedDynamicMethod.class,
+- "getTarget", MethodType.methodType(MethodHandle.class, MethodHandles.Lookup.class));
++ "getTarget", MethodType.methodType(MethodHandle.class, MethodHandles.Lookup.class, LinkerServices.class));
+ private static final MethodHandle GETTER_INVOKER = MethodHandles.invoker(MethodType.methodType(Object.class, Object.class));
+
+ private GuardedInvocationComponent getPropertyGetter(final CallSiteDescriptor callSiteDescriptor,
+@@ -593,7 +593,7 @@
+ final MethodHandle typedGetter = linkerServices.asType(getPropertyGetterHandle, type.changeReturnType(
+ AnnotatedDynamicMethod.class));
+ final MethodHandle callSiteBoundMethodGetter = MethodHandles.insertArguments(
+- GET_ANNOTATED_METHOD, 1, callSiteDescriptor.getLookup());
++ GET_ANNOTATED_METHOD, 1, callSiteDescriptor.getLookup(), linkerServices);
+ final MethodHandle callSiteBoundInvoker = MethodHandles.filterArguments(GETTER_INVOKER, 0,
+ callSiteBoundMethodGetter);
+ // Object(AnnotatedDynamicMethod, Object)->Object(AnnotatedDynamicMethod, T0)
+@@ -873,8 +873,8 @@
+ }
+
+ @SuppressWarnings("unused")
+- MethodHandle getTarget(final MethodHandles.Lookup lookup) {
+- final MethodHandle inv = method.getTarget(lookup);
++ MethodHandle getTarget(final MethodHandles.Lookup lookup, final LinkerServices linkerServices) {
++ final MethodHandle inv = linkerServices.filterInternalObjects(method.getTarget(lookup));
+ assert inv != null;
+ return inv;
+ }
+--- ./nashorn/src/jdk/internal/dynalink/beans/BeanLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/beans/BeanLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -165,6 +165,10 @@
+ private static MethodHandle LIST_GUARD = Guards.getInstanceOfGuard(List.class);
+ private static MethodHandle MAP_GUARD = Guards.getInstanceOfGuard(Map.class);
+
++ private enum CollectionType {
++ ARRAY, LIST, MAP
++ };
++
+ private GuardedInvocationComponent getElementGetter(final CallSiteDescriptor callSiteDescriptor,
+ final LinkerServices linkerServices, final List<String> operations) throws Exception {
+ final MethodType callSiteType = callSiteDescriptor.getMethodType();
+@@ -178,27 +182,27 @@
+ // Note that for arrays and lists, using LinkerServices.asType() will ensure that any language specific linkers
+ // in use will get a chance to perform any (if there's any) implicit conversion to integer for the indices.
+ final GuardedInvocationComponent gic;
+- final boolean isMap;
++ final CollectionType collectionType;
+ if(declaredType.isArray()) {
+- gic = new GuardedInvocationComponent(MethodHandles.arrayElementGetter(declaredType));
+- isMap = false;
++ gic = createInternalFilteredGuardedInvocationComponent(MethodHandles.arrayElementGetter(declaredType), linkerServices);
++ collectionType = CollectionType.ARRAY;
+ } else if(List.class.isAssignableFrom(declaredType)) {
+- gic = new GuardedInvocationComponent(GET_LIST_ELEMENT);
+- isMap = false;
++ gic = createInternalFilteredGuardedInvocationComponent(GET_LIST_ELEMENT, linkerServices);
++ collectionType = CollectionType.LIST;
+ } else if(Map.class.isAssignableFrom(declaredType)) {
+- gic = new GuardedInvocationComponent(GET_MAP_ELEMENT);
+- isMap = true;
++ gic = createInternalFilteredGuardedInvocationComponent(GET_MAP_ELEMENT, linkerServices);
++ collectionType = CollectionType.MAP;
+ } else if(clazz.isArray()) {
+- gic = getClassGuardedInvocationComponent(MethodHandles.arrayElementGetter(clazz), callSiteType);
+- isMap = false;
++ gic = getClassGuardedInvocationComponent(linkerServices.filterInternalObjects(MethodHandles.arrayElementGetter(clazz)), callSiteType);
++ collectionType = CollectionType.ARRAY;
+ } else if(List.class.isAssignableFrom(clazz)) {
+- gic = new GuardedInvocationComponent(GET_LIST_ELEMENT, Guards.asType(LIST_GUARD, callSiteType), List.class,
+- ValidationType.INSTANCE_OF);
+- isMap = false;
++ gic = createInternalFilteredGuardedInvocationComponent(GET_LIST_ELEMENT, Guards.asType(LIST_GUARD, callSiteType), List.class, ValidationType.INSTANCE_OF,
++ linkerServices);
++ collectionType = CollectionType.LIST;
+ } else if(Map.class.isAssignableFrom(clazz)) {
+- gic = new GuardedInvocationComponent(GET_MAP_ELEMENT, Guards.asType(MAP_GUARD, callSiteType), Map.class,
+- ValidationType.INSTANCE_OF);
+- isMap = true;
++ gic = createInternalFilteredGuardedInvocationComponent(GET_MAP_ELEMENT, Guards.asType(MAP_GUARD, callSiteType), Map.class, ValidationType.INSTANCE_OF,
++ linkerServices);
++ collectionType = CollectionType.MAP;
+ } else {
+ // Can't retrieve elements for objects that are neither arrays, nor list, nor maps.
+ return nextComponent;
+@@ -208,7 +212,7 @@
+ final String fixedKey = getFixedKey(callSiteDescriptor);
+ // Convert the key to a number if we're working with a list or array
+ final Object typedFixedKey;
+- if(!isMap && fixedKey != null) {
++ if(collectionType != CollectionType.MAP && fixedKey != null) {
+ typedFixedKey = convertKeyToInteger(fixedKey, linkerServices);
+ if(typedFixedKey == null) {
+ // key is not numeric, it can never succeed
+@@ -227,15 +231,21 @@
+ }
+
+ final MethodHandle checkGuard;
+- if(invocation == GET_LIST_ELEMENT) {
++ switch(collectionType) {
++ case LIST:
+ checkGuard = convertArgToInt(RANGE_CHECK_LIST, linkerServices, callSiteDescriptor);
+- } else if(invocation == GET_MAP_ELEMENT) {
++ break;
++ case MAP:
+ // TODO: A more complex solution could be devised for maps, one where we do a get() first, and fold it
+ // into a GWT that tests if it returned null, and if it did, do another GWT with containsKey()
+ // that returns constant null (on true), or falls back to next component (on false)
+- checkGuard = CONTAINS_MAP;
+- } else {
++ checkGuard = linkerServices.filterInternalObjects(CONTAINS_MAP);
++ break;
++ case ARRAY:
+ checkGuard = convertArgToInt(RANGE_CHECK_ARRAY, linkerServices, callSiteDescriptor);
++ break;
++ default:
++ throw new AssertionError();
+ }
+ final MethodPair matchedInvocations = matchReturnTypes(binder.bind(invocation),
+ nextComponent.getGuardedInvocation().getInvocation());
+@@ -243,6 +253,18 @@
+ gic.getValidatorClass(), gic.getValidationType());
+ }
+
++ private static GuardedInvocationComponent createInternalFilteredGuardedInvocationComponent(
++ final MethodHandle invocation, final LinkerServices linkerServices) {
++ return new GuardedInvocationComponent(linkerServices.filterInternalObjects(invocation));
++ }
++
++ private static GuardedInvocationComponent createInternalFilteredGuardedInvocationComponent(
++ final MethodHandle invocation, final MethodHandle guard, final Class<?> validatorClass,
++ final ValidationType validationType, final LinkerServices linkerServices) {
++ return new GuardedInvocationComponent(linkerServices.filterInternalObjects(invocation), guard,
++ validatorClass, validationType);
++ }
++
+ private static String getFixedKey(final CallSiteDescriptor callSiteDescriptor) {
+ return callSiteDescriptor.getNameTokenCount() == 2 ? null : callSiteDescriptor.getNameToken(
+ CallSiteDescriptor.NAME_OPERAND);
+@@ -381,37 +403,38 @@
+ // dealing with an array, or a list or map, but hey...
+ // Note that for arrays and lists, using LinkerServices.asType() will ensure that any language specific linkers
+ // in use will get a chance to perform any (if there's any) implicit conversion to integer for the indices.
+- final boolean isMap;
++ final CollectionType collectionType;
+ if(declaredType.isArray()) {
+- gic = new GuardedInvocationComponent(MethodHandles.arrayElementSetter(declaredType));
+- isMap = false;
++ gic = createInternalFilteredGuardedInvocationComponent(MethodHandles.arrayElementSetter(declaredType), linkerServices);
++ collectionType = CollectionType.ARRAY;
+ } else if(List.class.isAssignableFrom(declaredType)) {
+- gic = new GuardedInvocationComponent(SET_LIST_ELEMENT);
+- isMap = false;
++ gic = createInternalFilteredGuardedInvocationComponent(SET_LIST_ELEMENT, linkerServices);
++ collectionType = CollectionType.LIST;
+ } else if(Map.class.isAssignableFrom(declaredType)) {
+- gic = new GuardedInvocationComponent(PUT_MAP_ELEMENT);
+- isMap = true;
++ gic = createInternalFilteredGuardedInvocationComponent(PUT_MAP_ELEMENT, linkerServices);
++ collectionType = CollectionType.MAP;
+ } else if(clazz.isArray()) {
+- gic = getClassGuardedInvocationComponent(MethodHandles.arrayElementSetter(clazz), callSiteType);
+- isMap = false;
++ gic = getClassGuardedInvocationComponent(linkerServices.filterInternalObjects(
++ MethodHandles.arrayElementSetter(clazz)), callSiteType);
++ collectionType = CollectionType.ARRAY;
+ } else if(List.class.isAssignableFrom(clazz)) {
+- gic = new GuardedInvocationComponent(SET_LIST_ELEMENT, Guards.asType(LIST_GUARD, callSiteType), List.class,
+- ValidationType.INSTANCE_OF);
+- isMap = false;
++ gic = createInternalFilteredGuardedInvocationComponent(SET_LIST_ELEMENT, Guards.asType(LIST_GUARD, callSiteType), List.class, ValidationType.INSTANCE_OF,
++ linkerServices);
++ collectionType = CollectionType.LIST;
+ } else if(Map.class.isAssignableFrom(clazz)) {
+- gic = new GuardedInvocationComponent(PUT_MAP_ELEMENT, Guards.asType(MAP_GUARD, callSiteType), Map.class,
+- ValidationType.INSTANCE_OF);
+- isMap = true;
++ gic = createInternalFilteredGuardedInvocationComponent(PUT_MAP_ELEMENT, Guards.asType(MAP_GUARD, callSiteType),
++ Map.class, ValidationType.INSTANCE_OF, linkerServices);
++ collectionType = CollectionType.MAP;
+ } else {
+ // Can't set elements for objects that are neither arrays, nor list, nor maps.
+ gic = null;
+- isMap = false;
++ collectionType = null;
+ }
+
+ // In contrast to, say, getElementGetter, we only compute the nextComponent if the target object is not a map,
+ // as maps will always succeed in setting the element and will never need to fall back to the next component
+ // operation.
+- final GuardedInvocationComponent nextComponent = isMap ? null : getGuardedInvocationComponent(
++ final GuardedInvocationComponent nextComponent = collectionType == CollectionType.MAP ? null : getGuardedInvocationComponent(
+ callSiteDescriptor, linkerServices, operations);
+ if(gic == null) {
+ return nextComponent;
+@@ -421,7 +444,7 @@
+ final String fixedKey = getFixedKey(callSiteDescriptor);
+ // Convert the key to a number if we're working with a list or array
+ final Object typedFixedKey;
+- if(!isMap && fixedKey != null) {
++ if(collectionType != CollectionType.MAP && fixedKey != null) {
+ typedFixedKey = convertKeyToInteger(fixedKey, linkerServices);
+ if(typedFixedKey == null) {
+ // key is not numeric, it can never succeed
+@@ -439,7 +462,8 @@
+ return gic.replaceInvocation(binder.bind(invocation));
+ }
+
+- final MethodHandle checkGuard = convertArgToInt(invocation == SET_LIST_ELEMENT ? RANGE_CHECK_LIST :
++ assert collectionType == CollectionType.LIST || collectionType == CollectionType.ARRAY;
++ final MethodHandle checkGuard = convertArgToInt(collectionType == CollectionType.LIST ? RANGE_CHECK_LIST :
+ RANGE_CHECK_ARRAY, linkerServices, callSiteDescriptor);
+ final MethodPair matchedInvocations = matchReturnTypes(binder.bind(invocation),
+ nextComponent.getGuardedInvocation().getInvocation());
+--- ./nashorn/src/jdk/internal/dynalink/beans/OverloadedMethod.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/beans/OverloadedMethod.java Wed Jul 01 21:54:30 2015 -0700
+@@ -139,7 +139,8 @@
+ final MethodHandle bound = SELECT_METHOD.bindTo(this);
+ final MethodHandle collecting = SingleDynamicMethod.collectArguments(bound, argNum).asType(
+ callSiteType.changeReturnType(MethodHandle.class));
+- invoker = MethodHandles.foldArguments(MethodHandles.exactInvoker(this.callSiteType), collecting);
++ invoker = linkerServices.asTypeLosslessReturn(MethodHandles.foldArguments(
++ MethodHandles.exactInvoker(this.callSiteType), collecting), callSiteType);
+ }
+
+ MethodHandle getInvoker() {
+--- ./nashorn/src/jdk/internal/dynalink/beans/SingleDynamicMethod.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/beans/SingleDynamicMethod.java Wed Jul 01 21:54:30 2015 -0700
+@@ -165,10 +165,11 @@
+ * @return the adapted method handle.
+ */
+ static MethodHandle getInvocation(final MethodHandle target, final MethodType callSiteType, final LinkerServices linkerServices) {
+- final MethodType methodType = target.type();
++ final MethodHandle filteredTarget = linkerServices.filterInternalObjects(target);
++ final MethodType methodType = filteredTarget.type();
+ final int paramsLen = methodType.parameterCount();
+ final boolean varArgs = target.isVarargsCollector();
+- final MethodHandle fixTarget = varArgs ? target.asFixedArity() : target;
++ final MethodHandle fixTarget = varArgs ? filteredTarget.asFixedArity() : filteredTarget;
+ final int fixParamsLen = varArgs ? paramsLen - 1 : paramsLen;
+ final int argsLen = callSiteType.parameterCount();
+ if(argsLen < fixParamsLen) {
+@@ -204,7 +205,7 @@
+ if(varArgType.isAssignableFrom(callSiteLastArgType)) {
+ // Call site signature guarantees we'll always be passed a single compatible array; just link directly
+ // to the method, introducing necessary conversions. Also, preserve it being a variable arity method.
+- return createConvertingInvocation(target, linkerServices, callSiteType).asVarargsCollector(
++ return createConvertingInvocation(filteredTarget, linkerServices, callSiteType).asVarargsCollector(
+ callSiteLastArgType);
+ }
+
+--- ./nashorn/src/jdk/internal/dynalink/beans/StaticClass.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/beans/StaticClass.java Wed Jul 01 21:54:30 2015 -0700
+@@ -84,6 +84,7 @@
+ package jdk.internal.dynalink.beans;
+
+ import java.io.Serializable;
++import java.util.Objects;
+
+ /**
+ * Object that represents the static facet of a class (its static methods, properties, and fields, as well as
+@@ -106,8 +107,7 @@
+ private final Class<?> clazz;
+
+ /*private*/ StaticClass(final Class<?> clazz) {
+- clazz.getClass(); // NPE check
+- this.clazz = clazz;
++ this.clazz = Objects.requireNonNull(clazz);
+ }
+
+ /**
+--- ./nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java Wed Jul 01 21:54:30 2015 -0700
+@@ -91,6 +91,7 @@
+ import java.lang.invoke.SwitchPoint;
+ import java.lang.invoke.WrongMethodTypeException;
+ import java.util.List;
++import java.util.Objects;
+ import jdk.internal.dynalink.CallSiteDescriptor;
+ import jdk.internal.dynalink.support.Guards;
+
+@@ -170,8 +171,7 @@
+ * @throws NullPointerException if invocation is null.
+ */
+ public GuardedInvocation(final MethodHandle invocation, final MethodHandle guard, final SwitchPoint switchPoint, final Class<? extends Throwable> exception) {
+- invocation.getClass(); // NPE check
+- this.invocation = invocation;
++ this.invocation = Objects.requireNonNull(invocation);
+ this.guard = guard;
+ this.switchPoints = switchPoint == null ? null : new SwitchPoint[] { switchPoint };
+ this.exception = exception;
+@@ -190,8 +190,7 @@
+ * @throws NullPointerException if invocation is null.
+ */
+ public GuardedInvocation(final MethodHandle invocation, final MethodHandle guard, final SwitchPoint[] switchPoints, final Class<? extends Throwable> exception) {
+- invocation.getClass(); // NPE check
+- this.invocation = invocation;
++ this.invocation = Objects.requireNonNull(invocation);
+ this.guard = guard;
+ this.switchPoints = switchPoints == null ? null : switchPoints.clone();
+ this.exception = exception;
+--- ./nashorn/src/jdk/internal/dynalink/linker/LinkerServices.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/linker/LinkerServices.java Wed Jul 01 21:54:30 2015 -0700
+@@ -181,6 +181,15 @@
+ public Comparison compareConversion(Class<?> sourceType, Class<?> targetType1, Class<?> targetType2);
+
+ /**
++ * Modifies the method handle so that any parameters that can receive potentially internal language runtime objects
++ * will have a filter added on them to prevent them from escaping, potentially by wrapping them.
++ * It can also potentially add an unwrapping filter to the return value.
++ * @param target the target method handle
++ * @return a method handle with parameters and/or return type potentially filtered for wrapping and unwrapping.
++ */
++ public MethodHandle filterInternalObjects(final MethodHandle target);
++
++ /**
+ * If we could just use Java 8 constructs, then {@code asTypeSafeReturn} would be a method with default
+ * implementation. Since we can't do that, we extract common default implementations into this static class.
+ */
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/src/jdk/internal/dynalink/linker/MethodHandleTransformer.java Wed Jul 01 21:54:30 2015 -0700
+@@ -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. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file, and Oracle licenses the original version of this file under the BSD
++ * license:
++ */
++/*
++ Copyright 2009-2015 Attila Szegedi
++
++ Licensed under both the Apache License, Version 2.0 (the "Apache License")
++ and the BSD License (the "BSD License"), with licensee being free to
++ choose either of the two at their discretion.
++
++ You may not use this file except in compliance with either the Apache
++ License or the BSD License.
++
++ If you choose to use this file in compliance with the Apache License, the
++ following notice applies to you:
++
++ You may obtain a copy of the Apache License at
++
++ http://www.apache.org/licenses/LICENSE-2.0
++
++ Unless required by applicable law or agreed to in writing, software
++ distributed under the License is distributed on an "AS IS" BASIS,
++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
++ implied. See the License for the specific language governing
++ permissions and limitations under the License.
++
++ If you choose to use this file in compliance with the BSD License, the
++ following notice applies to you:
++
++ Redistribution and use in source and binary forms, with or without
++ modification, are permitted provided that the following conditions are
++ met:
++ * Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++ * Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in the
++ documentation and/or other materials provided with the distribution.
++ * Neither the name of the copyright holder nor the names of
++ contributors may be used to endorse or promote products derived from
++ this software without specific prior written permission.
++
++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
++ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
++ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
++ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++package jdk.internal.dynalink.linker;
++
++import java.lang.invoke.MethodHandle;
++
++/**
++ * A generic interface describing operations that transform method handles.
++ */
++public interface MethodHandleTransformer {
++ /**
++ * Transforms a method handle.
++ * @param target the method handle being transformed.
++ * @return transformed method handle.
++ */
++ public MethodHandle transform(final MethodHandle target);
++}
+--- ./nashorn/src/jdk/internal/dynalink/support/CallSiteDescriptorFactory.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/support/CallSiteDescriptorFactory.java Wed Jul 01 21:54:30 2015 -0700
+@@ -91,6 +91,7 @@
+ import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.List;
++import java.util.Objects;
+ import java.util.StringTokenizer;
+ import java.util.WeakHashMap;
+ import jdk.internal.dynalink.CallSiteDescriptor;
+@@ -123,9 +124,9 @@
+ * in fact return a weakly-referenced canonical instance.
+ */
+ public static CallSiteDescriptor create(final Lookup lookup, final String name, final MethodType methodType) {
+- name.getClass(); // NPE check
+- methodType.getClass(); // NPE check
+- lookup.getClass(); // NPE check
++ Objects.requireNonNull(name);
++ Objects.requireNonNull(methodType);
++ Objects.requireNonNull(lookup);
+ final String[] tokenizedName = tokenizeName(name);
+ if(isPublicLookup(lookup)) {
+ return getCanonicalPublicDescriptor(createPublicCallSiteDescriptor(tokenizedName, methodType));
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/src/jdk/internal/dynalink/support/DefaultInternalObjectFilter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,177 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file, and Oracle licenses the original version of this file under the BSD
++ * license:
++ */
++/*
++ Copyright 2009-2015 Attila Szegedi
++
++ Licensed under both the Apache License, Version 2.0 (the "Apache License")
++ and the BSD License (the "BSD License"), with licensee being free to
++ choose either of the two at their discretion.
++
++ You may not use this file except in compliance with either the Apache
++ License or the BSD License.
++
++ If you choose to use this file in compliance with the Apache License, the
++ following notice applies to you:
++
++ You may obtain a copy of the Apache License at
++
++ http://www.apache.org/licenses/LICENSE-2.0
++
++ Unless required by applicable law or agreed to in writing, software
++ distributed under the License is distributed on an "AS IS" BASIS,
++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
++ implied. See the License for the specific language governing
++ permissions and limitations under the License.
++
++ If you choose to use this file in compliance with the BSD License, the
++ following notice applies to you:
++
++ Redistribution and use in source and binary forms, with or without
++ modification, are permitted provided that the following conditions are
++ met:
++ * Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++ * Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in the
++ documentation and/or other materials provided with the distribution.
++ * Neither the name of the copyright holder nor the names of
++ contributors may be used to endorse or promote products derived from
++ this software without specific prior written permission.
++
++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
++ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
++ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
++ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++package jdk.internal.dynalink.support;
++
++import java.lang.invoke.MethodHandle;
++import java.lang.invoke.MethodHandles;
++import java.lang.invoke.MethodType;
++import jdk.internal.dynalink.DynamicLinkerFactory;
++import jdk.internal.dynalink.linker.MethodHandleTransformer;
++
++/**
++ * Default implementation for a {@link DynamicLinkerFactory#setInternalObjectsFilter(MethodHandleTransformer)}.
++ * Given a method handle of {@code Object(Object)} type for filtering parameter and another one of the same type for
++ * filtering return values, applies them to passed method handles where their parameter types and/or return value types
++ * are declared to be {@link Object}.
++ */
++public class DefaultInternalObjectFilter implements MethodHandleTransformer {
++ private static final MethodHandle FILTER_VARARGS = new Lookup(MethodHandles.lookup()).findStatic(
++ DefaultInternalObjectFilter.class, "filterVarArgs", MethodType.methodType(Object[].class, MethodHandle.class, Object[].class));
++
++ private final MethodHandle parameterFilter;
++ private final MethodHandle returnFilter;
++ private final MethodHandle varArgFilter;
++
++ /**
++ * Creates a new filter.
++ * @param parameterFilter the filter for method parameters. Must be of type {@code Object(Object)}, or null.
++ * @param returnFilter the filter for return values. Must be of type {@code Object(Object)}, or null.
++ * @throws IllegalArgumentException if one or both filters are not of the expected type.
++ */
++ public DefaultInternalObjectFilter(final MethodHandle parameterFilter, final MethodHandle returnFilter) {
++ this.parameterFilter = checkHandle(parameterFilter, "parameterFilter");
++ this.returnFilter = checkHandle(returnFilter, "returnFilter");
++ this.varArgFilter = parameterFilter == null ? null : FILTER_VARARGS.bindTo(parameterFilter);
++ }
++
++ @Override
++ public MethodHandle transform(final MethodHandle target) {
++ assert target != null;
++ MethodHandle[] filters = null;
++ final MethodType type = target.type();
++ final boolean isVarArg = target.isVarargsCollector();
++ final int paramCount = type.parameterCount();
++ final MethodHandle paramsFiltered;
++ // Filter parameters
++ if (parameterFilter != null) {
++ int firstFilter = -1;
++ // Ignore receiver, start from argument 1
++ for(int i = 1; i < paramCount; ++i) {
++ final Class<?> paramType = type.parameterType(i);
++ final boolean filterVarArg = isVarArg && i == paramCount - 1 && paramType == Object[].class;
++ if (filterVarArg || paramType == Object.class) {
++ if (filters == null) {
++ firstFilter = i;
++ filters = new MethodHandle[paramCount - firstFilter];
++ }
++ filters[i - firstFilter] = filterVarArg ? varArgFilter : parameterFilter;
++ }
++ }
++ paramsFiltered = filters != null ? MethodHandles.filterArguments(target, firstFilter, filters) : target;
++ } else {
++ paramsFiltered = target;
++ }
++ // Filter return value if needed
++ final MethodHandle returnFiltered = returnFilter != null && type.returnType() == Object.class ? MethodHandles.filterReturnValue(paramsFiltered, returnFilter) : paramsFiltered;
++ // Preserve varargs collector state
++ return isVarArg && !returnFiltered.isVarargsCollector() ? returnFiltered.asVarargsCollector(type.parameterType(paramCount - 1)) : returnFiltered;
++
++ }
++
++ private static MethodHandle checkHandle(final MethodHandle handle, final String handleKind) {
++ if (handle != null) {
++ final MethodType objectObjectType = MethodType.methodType(Object.class, Object.class);
++ if (!handle.type().equals(objectObjectType)) {
++ throw new IllegalArgumentException("Method type for " + handleKind + " must be " + objectObjectType);
++ }
++ }
++ return handle;
++ }
++
++ @SuppressWarnings("unused")
++ private static Object[] filterVarArgs(final MethodHandle parameterFilter, final Object[] args) throws Throwable {
++ Object[] newArgs = null;
++ for(int i = 0; i < args.length; ++i) {
++ final Object arg = args[i];
++ final Object newArg = parameterFilter.invokeExact(arg);
++ if (arg != newArg) {
++ if (newArgs == null) {
++ newArgs = args.clone();
++ }
++ newArgs[i] = newArg;
++ }
++ }
++ return newArgs == null ? args : newArgs;
++ }
++}
+--- ./nashorn/src/jdk/internal/dynalink/support/LinkerServicesImpl.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/internal/dynalink/support/LinkerServicesImpl.java Wed Jul 01 21:54:30 2015 -0700
+@@ -90,6 +90,7 @@
+ import jdk.internal.dynalink.linker.GuardingDynamicLinker;
+ import jdk.internal.dynalink.linker.LinkRequest;
+ import jdk.internal.dynalink.linker.LinkerServices;
++import jdk.internal.dynalink.linker.MethodHandleTransformer;
+
+ /**
+ * Default implementation of the {@link LinkerServices} interface.
+@@ -103,17 +104,21 @@
+
+ private final TypeConverterFactory typeConverterFactory;
+ private final GuardingDynamicLinker topLevelLinker;
++ private final MethodHandleTransformer internalObjectsFilter;
+
+ /**
+ * Creates a new linker services object.
+ *
+ * @param typeConverterFactory the type converter factory exposed by the services.
+ * @param topLevelLinker the top level linker used by the services.
++ * @param internalObjectsFilter a method handle transformer that is supposed to act as the implementation of this
++ * services' {@link #filterInternalObjects(java.lang.invoke.MethodHandle)} method.
+ */
+ public LinkerServicesImpl(final TypeConverterFactory typeConverterFactory,
+- final GuardingDynamicLinker topLevelLinker) {
++ final GuardingDynamicLinker topLevelLinker, final MethodHandleTransformer internalObjectsFilter) {
+ this.typeConverterFactory = typeConverterFactory;
+ this.topLevelLinker = topLevelLinker;
++ this.internalObjectsFilter = internalObjectsFilter;
+ }
+
+ @Override
+@@ -152,6 +157,11 @@
+ }
+ }
+
++ @Override
++ public MethodHandle filterInternalObjects(final MethodHandle target) {
++ return internalObjectsFilter != null ? internalObjectsFilter.transform(target) : target;
++ }
++
+ /**
+ * Returns the currently processed link request, or null if the method is invoked outside of the linking process.
+ * @return the currently processed link request, or null.
+--- ./nashorn/src/jdk/nashorn/api/scripting/AbstractJSObject.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/AbstractJSObject.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,6 +28,8 @@
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Set;
++import jdk.nashorn.internal.runtime.JSONListAdapter;
++import jdk.nashorn.internal.runtime.JSType;
+
+ /**
+ * This is the base class for nashorn ScriptObjectMirror class.
+@@ -36,7 +38,10 @@
+ * treat objects of such classes just like nashorn script objects. Usual nashorn
+ * operations like obj[i], obj.foo, obj.func(), delete obj.foo will be glued
+ * to appropriate method call of this class.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ public abstract class AbstractJSObject implements JSObject {
+ /**
+ * Call this object as a JavaScript function. This is equivalent to
+@@ -158,9 +163,8 @@
+ * @return set of property names
+ */
+ @Override
+- @SuppressWarnings("unchecked")
+ public Set<String> keySet() {
+- return Collections.EMPTY_SET;
++ return Collections.emptySet();
+ }
+
+ /**
+@@ -169,9 +173,8 @@
+ * @return set of property values.
+ */
+ @Override
+- @SuppressWarnings("unchecked")
+ public Collection<Object> values() {
+- return Collections.EMPTY_SET;
++ return Collections.emptySet();
+ }
+
+ // JavaScript instanceof check
+@@ -246,9 +249,43 @@
+ * Returns this object's numeric value.
+ *
+ * @return this object's numeric value.
++ * @deprecated use {@link #getDefaultValue(Class)} with {@link Number} hint instead.
+ */
+- @Override
++ @Override @Deprecated
+ public double toNumber() {
+- return Double.NaN;
++ return JSType.toNumber(JSType.toPrimitive(this, Number.class));
++ }
++
++ /**
++ * Implements this object's {@code [[DefaultValue]]} method. The default implementation follows ECMAScript 5.1
++ * section 8.6.2 but subclasses are free to provide their own implementations.
++ *
++ * @param hint the type hint. Should be either {@code null}, {@code Number.class} or {@code String.class}.
++ * @return this object's default value.
++ * @throws UnsupportedOperationException if the conversion can't be performed. The engine will convert this
++ * exception into a JavaScript {@code TypeError}.
++ */
++ public Object getDefaultValue(final Class<?> hint) {
++ return DefaultValueImpl.getDefaultValue(this, hint);
++ }
++
++ /**
++ * When passed an {@link AbstractJSObject}, invokes its {@link #getDefaultValue(Class)} method. When passed any
++ * other {@link JSObject}, it will obtain its {@code [[DefaultValue]]} method as per ECMAScript 5.1 section
++ * 8.6.2.
++ *
++ * @param jsobj the {@link JSObject} whose {@code [[DefaultValue]]} is obtained.
++ * @param hint the type hint. Should be either {@code null}, {@code Number.class} or {@code String.class}.
++ * @return this object's default value.
++ * @throws UnsupportedOperationException if the conversion can't be performed. The engine will convert this
++ * exception into a JavaScript {@code TypeError}.
++ */
++ public static Object getDefaultValue(final JSObject jsobj, final Class<?> hint) {
++ if (jsobj instanceof AbstractJSObject) {
++ return ((AbstractJSObject)jsobj).getDefaultValue(hint);
++ } else if (jsobj instanceof JSONListAdapter) {
++ return ((JSONListAdapter)jsobj).getDefaultValue(hint);
++ }
++ return DefaultValueImpl.getDefaultValue(jsobj, hint);
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/api/scripting/ClassFilter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/ClassFilter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,7 +28,10 @@
+ * Class filter (optional) to be used by nashorn script engine.
+ * jsr-223 program embedding nashorn script can set ClassFilter instance
+ * to be used when an engine instance is created.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ public interface ClassFilter {
+ /**
+ * Should the Java class of the specified name be exposed to scripts?
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/src/jdk/nashorn/api/scripting/DefaultValueImpl.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,55 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.api.scripting;
++
++import jdk.nashorn.internal.runtime.JSType;
++
++/**
++ * Default implementation of {@link JSObject#getDefaultValue(Class)}. Isolated into a separate class mostly so
++ * that we can have private static instances of function name arrays, something we couldn't declare without it
++ * being visible in {@link JSObject} interface.
++ */
++class DefaultValueImpl {
++ private static final String[] DEFAULT_VALUE_FNS_NUMBER = new String[] { "valueOf", "toString" };
++ private static final String[] DEFAULT_VALUE_FNS_STRING = new String[] { "toString", "valueOf" };
++
++ static Object getDefaultValue(final JSObject jsobj, final Class<?> hint) throws UnsupportedOperationException {
++ final boolean isNumber = hint == null || hint == Number.class;
++ for(final String methodName: isNumber ? DEFAULT_VALUE_FNS_NUMBER : DEFAULT_VALUE_FNS_STRING) {
++ final Object objMember = jsobj.getMember(methodName);
++ if (objMember instanceof JSObject) {
++ final JSObject member = (JSObject)objMember;
++ if (member.isFunction()) {
++ final Object value = member.call(jsobj);
++ if (JSType.isPrimitive(value)) {
++ return value;
++ }
++ }
++ }
++ }
++ throw new UnsupportedOperationException(isNumber ? "cannot.get.default.number" : "cannot.get.default.string");
++ }
++}
+--- ./nashorn/src/jdk/nashorn/api/scripting/JSObject.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/JSObject.java Wed Jul 01 21:54:30 2015 -0700
+@@ -33,7 +33,10 @@
+ * treat objects of such classes just like nashorn script objects. Usual nashorn
+ * operations like obj[i], obj.foo, obj.func(), delete obj.foo will be glued
+ * to appropriate method call of this interface.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ public interface JSObject {
+ /**
+ * Call this object as a JavaScript function. This is equivalent to
+@@ -183,6 +186,8 @@
+ * Returns this object's numeric value.
+ *
+ * @return this object's numeric value.
++ * @deprecated use {@link AbstractJSObject#getDefaultValue(JSObject, Class)} with {@link Number} hint instead.
+ */
++ @Deprecated
+ public double toNumber();
+ }
+--- ./nashorn/src/jdk/nashorn/api/scripting/NashornException.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/NashornException.java Wed Jul 01 21:54:30 2015 -0700
+@@ -41,7 +41,10 @@
+ * script object or Java access to script object properties via java.util.Map
+ * interface. In these cases, user code will get an instance of this or
+ * implementation defined subclass.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ @SuppressWarnings("serial")
+ public abstract class NashornException extends RuntimeException {
+ // script file name
+--- ./nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java Wed Jul 01 21:54:30 2015 -0700
+@@ -39,6 +39,7 @@
+ import java.security.ProtectionDomain;
+ import java.text.MessageFormat;
+ import java.util.Locale;
++import java.util.Objects;
+ import java.util.ResourceBundle;
+ import javax.script.AbstractScriptEngine;
+ import javax.script.Bindings;
+@@ -65,8 +66,10 @@
+ * {@link NashornScriptEngineFactory#getScriptEngine()}. Note that this engine implements the {@link Compilable} and
+ * {@link Invocable} interfaces, allowing for efficient precompilation and repeated execution of scripts.
+ * @see NashornScriptEngineFactory
++ *
++ * @since 1.8u40
+ */
+-
++@jdk.Exported
+ public final class NashornScriptEngine extends AbstractScriptEngine implements Compilable, Invocable {
+ /**
+ * Key used to associate Nashorn global object mirror with arbitrary Bindings instance.
+@@ -351,14 +354,13 @@
+ }
+ }, CREATE_GLOBAL_ACC_CTXT);
+
+- nashornContext.initGlobal(newGlobal, this);
+- newGlobal.setScriptContext(ctxt);
++ nashornContext.initGlobal(newGlobal, this, ctxt);
+
+ return newGlobal;
+ }
+
+ private Object invokeImpl(final Object selfObject, final String name, final Object... args) throws ScriptException, NoSuchMethodException {
+- name.getClass(); // null check
++ Objects.requireNonNull(name);
+ assert !(selfObject instanceof ScriptObject) : "raw ScriptObject not expected here";
+
+ Global invokeGlobal = null;
+@@ -401,7 +403,7 @@
+ return evalImpl(script, ctxt, getNashornGlobalFrom(ctxt));
+ }
+
+- private static Object evalImpl(final Context.MultiGlobalCompiledScript mgcs, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
++ private Object evalImpl(final Context.MultiGlobalCompiledScript mgcs, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
+ final Global oldGlobal = Context.getGlobal();
+ final boolean globalChanged = (oldGlobal != ctxtGlobal);
+ try {
+@@ -410,8 +412,13 @@
+ }
+
+ final ScriptFunction script = mgcs.getFunction(ctxtGlobal);
++ final ScriptContext oldCtxt = ctxtGlobal.getScriptContext();
+ ctxtGlobal.setScriptContext(ctxt);
+- return ScriptObjectMirror.translateUndefined(ScriptObjectMirror.wrap(ScriptRuntime.apply(script, ctxtGlobal), ctxtGlobal));
++ try {
++ return ScriptObjectMirror.translateUndefined(ScriptObjectMirror.wrap(ScriptRuntime.apply(script, ctxtGlobal), ctxtGlobal));
++ } finally {
++ ctxtGlobal.setScriptContext(oldCtxt);
++ }
+ } catch (final Exception e) {
+ throwAsScriptException(e, ctxtGlobal);
+ throw new AssertionError("should not reach here");
+@@ -422,7 +429,7 @@
+ }
+ }
+
+- private static Object evalImpl(final ScriptFunction script, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
++ private Object evalImpl(final ScriptFunction script, final ScriptContext ctxt, final Global ctxtGlobal) throws ScriptException {
+ if (script == null) {
+ return null;
+ }
+@@ -433,8 +440,13 @@
+ Context.setGlobal(ctxtGlobal);
+ }
+
++ final ScriptContext oldCtxt = ctxtGlobal.getScriptContext();
+ ctxtGlobal.setScriptContext(ctxt);
+- return ScriptObjectMirror.translateUndefined(ScriptObjectMirror.wrap(ScriptRuntime.apply(script, ctxtGlobal), ctxtGlobal));
++ try {
++ return ScriptObjectMirror.translateUndefined(ScriptObjectMirror.wrap(ScriptRuntime.apply(script, ctxtGlobal), ctxtGlobal));
++ } finally {
++ ctxtGlobal.setScriptContext(oldCtxt);
++ }
+ } catch (final Exception e) {
+ throwAsScriptException(e, ctxtGlobal);
+ throw new AssertionError("should not reach here");
+--- ./nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,6 +28,7 @@
+ import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.List;
++import java.util.Objects;
+ import javax.script.ScriptEngine;
+ import javax.script.ScriptEngineFactory;
+ import jdk.nashorn.internal.runtime.Context;
+@@ -44,7 +45,10 @@
+ * </ul>
+ * Programs executing in engines created using {@link #getScriptEngine(String[])} will have the passed arguments
+ * accessible as a global variable named {@code "arguments"}.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ public final class NashornScriptEngineFactory implements ScriptEngineFactory {
+ @Override
+ public String getEngineName() {
+@@ -120,7 +124,7 @@
+ // used to execute scripts concurrently on multiple threads.
+ return null;
+ default:
+- throw new IllegalArgumentException("Invalid key");
++ return null;
+ }
+ }
+
+@@ -174,8 +178,7 @@
+ * denies {@code RuntimePermission("nashorn.setConfig")}
+ */
+ public ScriptEngine getScriptEngine(final ClassFilter classFilter) {
+- classFilter.getClass(); // null check
+- return newEngine(DEFAULT_OPTIONS, getAppClassLoader(), classFilter);
++ return newEngine(DEFAULT_OPTIONS, getAppClassLoader(), Objects.requireNonNull(classFilter));
+ }
+
+ /**
+@@ -189,8 +192,7 @@
+ * denies {@code RuntimePermission("nashorn.setConfig")}
+ */
+ public ScriptEngine getScriptEngine(final String... args) {
+- args.getClass(); // null check
+- return newEngine(args, getAppClassLoader(), null);
++ return newEngine(Objects.requireNonNull(args), getAppClassLoader(), null);
+ }
+
+ /**
+@@ -205,8 +207,7 @@
+ * denies {@code RuntimePermission("nashorn.setConfig")}
+ */
+ public ScriptEngine getScriptEngine(final String[] args, final ClassLoader appLoader) {
+- args.getClass(); // null check
+- return newEngine(args, appLoader, null);
++ return newEngine(Objects.requireNonNull(args), appLoader, null);
+ }
+
+ /**
+@@ -222,9 +223,7 @@
+ * denies {@code RuntimePermission("nashorn.setConfig")}
+ */
+ public ScriptEngine getScriptEngine(final String[] args, final ClassLoader appLoader, final ClassFilter classFilter) {
+- args.getClass(); // null check
+- classFilter.getClass(); // null check
+- return newEngine(args, appLoader, classFilter);
++ return newEngine(Objects.requireNonNull(args), appLoader, Objects.requireNonNull(classFilter));
+ }
+
+ private ScriptEngine newEngine(final String[] args, final ClassLoader appLoader, final ClassFilter classFilter) {
+--- ./nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java Wed Jul 01 21:54:30 2015 -0700
+@@ -39,12 +39,15 @@
+ import java.util.LinkedHashSet;
+ import java.util.List;
+ import java.util.Map;
++import java.util.Objects;
+ import java.util.Set;
+ import java.util.concurrent.Callable;
+ import javax.script.Bindings;
+ import jdk.nashorn.internal.objects.Global;
+ import jdk.nashorn.internal.runtime.ConsString;
+ import jdk.nashorn.internal.runtime.Context;
++import jdk.nashorn.internal.runtime.ECMAException;
++import jdk.nashorn.internal.runtime.JSONListAdapter;
+ import jdk.nashorn.internal.runtime.JSType;
+ import jdk.nashorn.internal.runtime.ScriptFunction;
+ import jdk.nashorn.internal.runtime.ScriptObject;
+@@ -54,7 +57,10 @@
+
+ /**
+ * Mirror object that wraps a given Nashorn Script object.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ public final class ScriptObjectMirror extends AbstractJSObject implements Bindings {
+ private static AccessControlContext getContextAccCtxt() {
+ final Permissions perms = new Permissions();
+@@ -67,6 +73,7 @@
+ private final ScriptObject sobj;
+ private final Global global;
+ private final boolean strict;
++ private final boolean jsonCompatible;
+
+ @Override
+ public boolean equals(final Object other) {
+@@ -105,9 +112,9 @@
+ }
+
+ if (sobj instanceof ScriptFunction) {
+- final Object[] modArgs = globalChanged? wrapArray(args, oldGlobal) : args;
+- final Object self = globalChanged? wrap(thiz, oldGlobal) : thiz;
+- return wrap(ScriptRuntime.apply((ScriptFunction)sobj, unwrap(self, global), unwrapArray(modArgs, global)), global);
++ final Object[] modArgs = globalChanged? wrapArrayLikeMe(args, oldGlobal) : args;
++ final Object self = globalChanged? wrapLikeMe(thiz, oldGlobal) : thiz;
++ return wrapLikeMe(ScriptRuntime.apply((ScriptFunction)sobj, unwrap(self, global), unwrapArray(modArgs, global)));
+ }
+
+ throw new RuntimeException("not a function: " + toString());
+@@ -135,8 +142,8 @@
+ }
+
+ if (sobj instanceof ScriptFunction) {
+- final Object[] modArgs = globalChanged? wrapArray(args, oldGlobal) : args;
+- return wrap(ScriptRuntime.construct((ScriptFunction)sobj, unwrapArray(modArgs, global)), global);
++ final Object[] modArgs = globalChanged? wrapArrayLikeMe(args, oldGlobal) : args;
++ return wrapLikeMe(ScriptRuntime.construct((ScriptFunction)sobj, unwrapArray(modArgs, global)));
+ }
+
+ throw new RuntimeException("not a constructor: " + toString());
+@@ -165,7 +172,7 @@
+ return Context.getContext();
+ }
+ }, GET_CONTEXT_ACC_CTXT);
+- return wrap(context.eval(global, s, sobj, null, false), global);
++ return wrapLikeMe(context.eval(global, s, sobj, null));
+ }
+ });
+ }
+@@ -177,7 +184,7 @@
+ * @return return value of function
+ */
+ public Object callMember(final String functionName, final Object... args) {
+- functionName.getClass(); // null check
++ Objects.requireNonNull(functionName);
+ final Global oldGlobal = Context.getGlobal();
+ final boolean globalChanged = (oldGlobal != global);
+
+@@ -188,8 +195,8 @@
+
+ final Object val = sobj.get(functionName);
+ if (val instanceof ScriptFunction) {
+- final Object[] modArgs = globalChanged? wrapArray(args, oldGlobal) : args;
+- return wrap(ScriptRuntime.apply((ScriptFunction)val, sobj, unwrapArray(modArgs, global)), global);
++ final Object[] modArgs = globalChanged? wrapArrayLikeMe(args, oldGlobal) : args;
++ return wrapLikeMe(ScriptRuntime.apply((ScriptFunction)val, sobj, unwrapArray(modArgs, global)));
+ } else if (val instanceof JSObject && ((JSObject)val).isFunction()) {
+ return ((JSObject)val).call(sobj, args);
+ }
+@@ -210,10 +217,10 @@
+
+ @Override
+ public Object getMember(final String name) {
+- name.getClass();
++ Objects.requireNonNull(name);
+ return inGlobal(new Callable<Object>() {
+ @Override public Object call() {
+- return wrap(sobj.get(name), global);
++ return wrapLikeMe(sobj.get(name));
+ }
+ });
+ }
+@@ -222,14 +229,14 @@
+ public Object getSlot(final int index) {
+ return inGlobal(new Callable<Object>() {
+ @Override public Object call() {
+- return wrap(sobj.get(index), global);
++ return wrapLikeMe(sobj.get(index));
+ }
+ });
+ }
+
+ @Override
+ public boolean hasMember(final String name) {
+- name.getClass();
++ Objects.requireNonNull(name);
+ return inGlobal(new Callable<Boolean>() {
+ @Override public Boolean call() {
+ return sobj.has(name);
+@@ -248,14 +255,12 @@
+
+ @Override
+ public void removeMember(final String name) {
+- name.getClass();
+- remove(name);
++ remove(Objects.requireNonNull(name));
+ }
+
+ @Override
+ public void setMember(final String name, final Object value) {
+- name.getClass();
+- put(name, value);
++ put(Objects.requireNonNull(name), value);
+ }
+
+ @Override
+@@ -337,9 +342,10 @@
+
+ @Override
+ public boolean containsKey(final Object key) {
++ checkKey(key);
+ return inGlobal(new Callable<Boolean>() {
+ @Override public Boolean call() {
+- return sobj.containsKey(unwrap(key, global));
++ return sobj.containsKey(key);
+ }
+ });
+ }
+@@ -362,7 +368,7 @@
+
+ while (iter.hasNext()) {
+ final String key = iter.next();
+- final Object value = translateUndefined(wrap(sobj.get(key), global));
++ final Object value = translateUndefined(wrapLikeMe(sobj.get(key)));
+ entries.add(new AbstractMap.SimpleImmutableEntry<>(key, value));
+ }
+
+@@ -373,9 +379,10 @@
+
+ @Override
+ public Object get(final Object key) {
++ checkKey(key);
+ return inGlobal(new Callable<Object>() {
+ @Override public Object call() {
+- return translateUndefined(wrap(sobj.get(key), global));
++ return translateUndefined(wrapLikeMe(sobj.get(key)));
+ }
+ });
+ }
+@@ -407,26 +414,30 @@
+
+ @Override
+ public Object put(final String key, final Object value) {
++ checkKey(key);
+ final ScriptObject oldGlobal = Context.getGlobal();
+ final boolean globalChanged = (oldGlobal != global);
+ return inGlobal(new Callable<Object>() {
+ @Override public Object call() {
+- final Object modValue = globalChanged? wrap(value, oldGlobal) : value;
+- return translateUndefined(wrap(sobj.put(key, unwrap(modValue, global), strict), global));
++ final Object modValue = globalChanged? wrapLikeMe(value, oldGlobal) : value;
++ return translateUndefined(wrapLikeMe(sobj.put(key, unwrap(modValue, global), strict)));
+ }
+ });
+ }
+
+ @Override
+ public void putAll(final Map<? extends String, ? extends Object> map) {
++ Objects.requireNonNull(map);
+ final ScriptObject oldGlobal = Context.getGlobal();
+ final boolean globalChanged = (oldGlobal != global);
+ inGlobal(new Callable<Object>() {
+ @Override public Object call() {
+ for (final Map.Entry<? extends String, ? extends Object> entry : map.entrySet()) {
+ final Object value = entry.getValue();
+- final Object modValue = globalChanged? wrap(value, oldGlobal) : value;
+- sobj.set(entry.getKey(), unwrap(modValue, global), getCallSiteFlags());
++ final Object modValue = globalChanged? wrapLikeMe(value, oldGlobal) : value;
++ final String key = entry.getKey();
++ checkKey(key);
++ sobj.set(key, unwrap(modValue, global), getCallSiteFlags());
+ }
+ return null;
+ }
+@@ -435,9 +446,10 @@
+
+ @Override
+ public Object remove(final Object key) {
++ checkKey(key);
+ return inGlobal(new Callable<Object>() {
+ @Override public Object call() {
+- return wrap(sobj.remove(unwrap(key, global), strict), global);
++ return translateUndefined(wrapLikeMe(sobj.remove(key, strict)));
+ }
+ });
+ }
+@@ -474,7 +486,7 @@
+ final Iterator<Object> iter = sobj.valueIterator();
+
+ while (iter.hasNext()) {
+- values.add(translateUndefined(wrap(iter.next(), global)));
++ values.add(translateUndefined(wrapLikeMe(iter.next())));
+ }
+
+ return Collections.unmodifiableList(values);
+@@ -491,7 +503,7 @@
+ public Object getProto() {
+ return inGlobal(new Callable<Object>() {
+ @Override public Object call() {
+- return wrap(sobj.getProto(), global);
++ return wrapLikeMe(sobj.getProto());
+ }
+ });
+ }
+@@ -520,7 +532,7 @@
+ public Object getOwnPropertyDescriptor(final String key) {
+ return inGlobal(new Callable<Object>() {
+ @Override public Object call() {
+- return wrap(sobj.getOwnPropertyDescriptor(key), global);
++ return wrapLikeMe(sobj.getOwnPropertyDescriptor(key));
+ }
+ });
+ }
+@@ -626,7 +638,7 @@
+ }
+
+ /**
+- * Utilitity to convert this script object to the given type.
++ * Utility to convert this script object to the given type.
+ *
+ * @param <T> destination type to convert to
+ * @param type destination type to convert to
+@@ -649,16 +661,76 @@
+ * @return wrapped/converted object
+ */
+ public static Object wrap(final Object obj, final Object homeGlobal) {
++ return wrap(obj, homeGlobal, false);
++ }
++
++ /**
++ * Make a script object mirror on given object if needed. Also converts ConsString instances to Strings. The
++ * created wrapper will implement the Java {@code List} interface if {@code obj} is a JavaScript
++ * {@code Array} object; this is compatible with Java JSON libraries expectations. Arrays retrieved through its
++ * properties (transitively) will also implement the list interface.
++ *
++ * @param obj object to be wrapped/converted
++ * @param homeGlobal global to which this object belongs. Not used for ConsStrings.
++ * @return wrapped/converted object
++ */
++ public static Object wrapAsJSONCompatible(final Object obj, final Object homeGlobal) {
++ return wrap(obj, homeGlobal, true);
++ }
++
++ /**
++ * Make a script object mirror on given object if needed. Also converts ConsString instances to Strings.
++ *
++ * @param obj object to be wrapped/converted
++ * @param homeGlobal global to which this object belongs. Not used for ConsStrings.
++ * @param jsonCompatible if true, the created wrapper will implement the Java {@code List} interface if
++ * {@code obj} is a JavaScript {@code Array} object. Arrays retrieved through its properties (transitively)
++ * will also implement the list interface.
++ * @return wrapped/converted object
++ */
++ private static Object wrap(final Object obj, final Object homeGlobal, final boolean jsonCompatible) {
+ if(obj instanceof ScriptObject) {
+- return homeGlobal instanceof Global ? new ScriptObjectMirror((ScriptObject)obj, (Global)homeGlobal) : obj;
+- }
+- if(obj instanceof ConsString) {
++ if (!(homeGlobal instanceof Global)) {
++ return obj;
++ }
++ final ScriptObject sobj = (ScriptObject)obj;
++ final Global global = (Global)homeGlobal;
++ final ScriptObjectMirror mirror = new ScriptObjectMirror(sobj, global, jsonCompatible);
++ if (jsonCompatible && sobj.isArray()) {
++ return new JSONListAdapter(mirror, global);
++ }
++ return mirror;
++ } else if(obj instanceof ConsString) {
+ return obj.toString();
++ } else if (jsonCompatible && obj instanceof ScriptObjectMirror) {
++ // Since choosing JSON compatible representation is an explicit decision on user's part, if we're asked to
++ // wrap a mirror that was not JSON compatible, explicitly create its compatible counterpart following the
++ // principle of least surprise.
++ return ((ScriptObjectMirror)obj).asJSONCompatible();
+ }
+ return obj;
+ }
+
+ /**
++ * Wraps the passed object with the same jsonCompatible flag as this mirror.
++ * @param obj the object
++ * @param homeGlobal the object's home global.
++ * @return a wrapper for the object.
++ */
++ private Object wrapLikeMe(final Object obj, final Object homeGlobal) {
++ return wrap(obj, homeGlobal, jsonCompatible);
++ }
++
++ /**
++ * Wraps the passed object with the same home global and jsonCompatible flag as this mirror.
++ * @param obj the object
++ * @return a wrapper for the object.
++ */
++ private Object wrapLikeMe(final Object obj) {
++ return wrapLikeMe(obj, global);
++ }
++
++ /**
+ * Unwrap a script object mirror if needed.
+ *
+ * @param obj object to be unwrapped
+@@ -669,6 +741,8 @@
+ if (obj instanceof ScriptObjectMirror) {
+ final ScriptObjectMirror mirror = (ScriptObjectMirror)obj;
+ return (mirror.global == homeGlobal)? mirror.sobj : obj;
++ } else if (obj instanceof JSONListAdapter) {
++ return ((JSONListAdapter)obj).unwrap(homeGlobal);
+ }
+
+ return obj;
+@@ -682,6 +756,10 @@
+ * @return wrapped array
+ */
+ public static Object[] wrapArray(final Object[] args, final Object homeGlobal) {
++ return wrapArray(args, homeGlobal, false);
++ }
++
++ private static Object[] wrapArray(final Object[] args, final Object homeGlobal, final boolean jsonCompatible) {
+ if (args == null || args.length == 0) {
+ return args;
+ }
+@@ -689,12 +767,16 @@
+ final Object[] newArgs = new Object[args.length];
+ int index = 0;
+ for (final Object obj : args) {
+- newArgs[index] = wrap(obj, homeGlobal);
++ newArgs[index] = wrap(obj, homeGlobal, jsonCompatible);
+ index++;
+ }
+ return newArgs;
+ }
+
++ private Object[] wrapArrayLikeMe(final Object[] args, final Object homeGlobal) {
++ return wrapArray(args, homeGlobal, jsonCompatible);
++ }
++
+ /**
+ * Unwrap an array of script object mirrors if needed.
+ *
+@@ -736,12 +818,17 @@
+ // package-privates below this.
+
+ ScriptObjectMirror(final ScriptObject sobj, final Global global) {
++ this(sobj, global, false);
++ }
++
++ private ScriptObjectMirror(final ScriptObject sobj, final Global global, final boolean jsonCompatible) {
+ assert sobj != null : "ScriptObjectMirror on null!";
+ assert global != null : "home Global is null";
+
+ this.sobj = sobj;
+ this.global = global;
+ this.strict = global.isStrictContext();
++ this.jsonCompatible = jsonCompatible;
+ }
+
+ // accessors for script engine
+@@ -783,7 +870,25 @@
+ }
+ }
+
+- @Override
++ /**
++ * Ensures the key is not null, empty string, or a non-String object. The contract of the {@link Bindings}
++ * interface requires that these are not accepted as keys.
++ * @param key the key to check
++ * @throws NullPointerException if key is null
++ * @throws ClassCastException if key is not a String
++ * @throws IllegalArgumentException if key is empty string
++ */
++ private static void checkKey(final Object key) {
++ Objects.requireNonNull(key, "key can not be null");
++
++ if (!(key instanceof String)) {
++ throw new ClassCastException("key should be a String. It is " + key.getClass().getName() + " instead.");
++ } else if (((String)key).length() == 0) {
++ throw new IllegalArgumentException("key can not be empty");
++ }
++ }
++
++ @Override @Deprecated
+ public double toNumber() {
+ return inGlobal(new Callable<Double>() {
+ @Override public Double call() {
+@@ -791,4 +896,28 @@
+ }
+ });
+ }
++
++ @Override
++ public Object getDefaultValue(final Class<?> hint) {
++ return inGlobal(new Callable<Object>() {
++ @Override public Object call() {
++ try {
++ return sobj.getDefaultValue(hint);
++ } catch (final ECMAException e) {
++ // We're catching ECMAException (likely TypeError), and translating it to
++ // UnsupportedOperationException. This in turn will be translated into TypeError of the
++ // caller's Global by JSType#toPrimitive(JSObject,Class) therefore ensuring that it's
++ // recognized as "instanceof TypeError" in the caller.
++ throw new UnsupportedOperationException(e.getMessage(), e);
++ }
++ }
++ });
++ }
++
++ private ScriptObjectMirror asJSONCompatible() {
++ if (this.jsonCompatible) {
++ return this;
++ }
++ return new ScriptObjectMirror(sobj, global, true);
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/api/scripting/ScriptUtils.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/ScriptUtils.java Wed Jul 01 21:54:30 2015 -0700
+@@ -38,7 +38,10 @@
+
+ /**
+ * Utilities that are to be called from script code.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ public final class ScriptUtils {
+ private ScriptUtils() {}
+
+--- ./nashorn/src/jdk/nashorn/api/scripting/URLReader.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/URLReader.java Wed Jul 01 21:54:30 2015 -0700
+@@ -30,12 +30,16 @@
+ import java.io.Reader;
+ import java.net.URL;
+ import java.nio.charset.Charset;
++import java.util.Objects;
+ import jdk.nashorn.internal.runtime.Source;
+
+ /**
+ * A Reader that reads from a URL. Used to make sure that the reader
+ * reads content from given URL and can be trusted to do so.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ public final class URLReader extends Reader {
+ // underlying URL
+ private final URL url;
+@@ -74,9 +78,7 @@
+ * @throws NullPointerException if url is null
+ */
+ public URLReader(final URL url, final Charset cs) {
+- // null check
+- url.getClass();
+- this.url = url;
++ this.url = Objects.requireNonNull(url);
+ this.cs = cs;
+ }
+
+--- ./nashorn/src/jdk/nashorn/api/scripting/package-info.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/api/scripting/package-info.java Wed Jul 01 21:54:30 2015 -0700
+@@ -35,5 +35,8 @@
+ * interfaces, allowing for efficient pre-compilation and repeated execution of scripts. In addition,
+ * this package provides nashorn specific extension classes, interfaces and methods. See
+ * {@link jdk.nashorn.api.scripting.NashornScriptEngineFactory} for further details.
++ *
++ * @since 1.8u40
+ */
++@jdk.Exported
+ package jdk.nashorn.api.scripting;
+--- ./nashorn/src/jdk/nashorn/internal/codegen/AssignSymbols.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/AssignSymbols.java Wed Jul 01 21:54:30 2015 -0700
+@@ -84,6 +84,7 @@
+ import jdk.nashorn.internal.ir.VarNode;
+ import jdk.nashorn.internal.ir.WithNode;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
++import jdk.nashorn.internal.parser.TokenType;
+ import jdk.nashorn.internal.runtime.Context;
+ import jdk.nashorn.internal.runtime.ECMAErrors;
+ import jdk.nashorn.internal.runtime.ErrorManager;
+@@ -135,15 +136,11 @@
+ functionNode.compilerConstant(SCOPE).setNeedsSlot(false);
+ }
+ // Named function expressions that end up not referencing themselves won't need a local slot for the self symbol.
+- if(!functionNode.isDeclared() && !functionNode.usesSelfSymbol() && !functionNode.isAnonymous()) {
++ if(functionNode.isNamedFunctionExpression() && !functionNode.usesSelfSymbol()) {
+ final Symbol selfSymbol = functionNode.getBody().getExistingSymbol(functionNode.getIdent().getName());
+- if(selfSymbol != null) {
+- if(selfSymbol.isFunctionSelf()) {
+- selfSymbol.setNeedsSlot(false);
+- selfSymbol.clearFlag(Symbol.IS_VAR);
+- }
+- } else {
+- assert functionNode.isProgram();
++ if(selfSymbol != null && selfSymbol.isFunctionSelf()) {
++ selfSymbol.setNeedsSlot(false);
++ selfSymbol.clearFlag(Symbol.IS_VAR);
+ }
+ }
+ return functionNode;
+@@ -490,20 +487,31 @@
+ final Block body = lc.getCurrentBlock();
+
+ initFunctionWideVariables(functionNode, body);
++ acceptDeclarations(functionNode, body);
++ defineFunctionSelfSymbol(functionNode, body);
++ }
+
+- if (!functionNode.isProgram() && !functionNode.isDeclared() && !functionNode.isAnonymous()) {
+- // It's neither declared nor program - it's a function expression then; assign it a self-symbol unless it's
+- // anonymous.
+- final String name = functionNode.getIdent().getName();
+- assert name != null;
+- assert body.getExistingSymbol(name) == null;
+- defineSymbol(body, name, functionNode, IS_VAR | IS_FUNCTION_SELF | HAS_OBJECT_VALUE);
+- if(functionNode.allVarsInScope()) { // basically, has deep eval
+- lc.setFlag(functionNode, FunctionNode.USES_SELF_SYMBOL);
+- }
++ private void defineFunctionSelfSymbol(final FunctionNode functionNode, final Block body) {
++ // Function self-symbol is only declared as a local variable for named function expressions. Declared functions
++ // don't need it as they are local variables in their declaring scope.
++ if (!functionNode.isNamedFunctionExpression()) {
++ return;
+ }
+
+- acceptDeclarations(functionNode, body);
++ final String name = functionNode.getIdent().getName();
++ assert name != null; // As it's a named function expression.
++
++ if (body.getExistingSymbol(name) != null) {
++ // Body already has a declaration for the name. It's either a parameter "function x(x)" or a
++ // top-level variable "function x() { ... var x; ... }".
++ return;
++ }
++
++ defineSymbol(body, name, functionNode, IS_VAR | IS_FUNCTION_SELF | HAS_OBJECT_VALUE);
++ if(functionNode.allVarsInScope()) { // basically, has deep eval
++ // We must conservatively presume that eval'd code can dynamically use the function symbol.
++ lc.setFlag(functionNode, FunctionNode.USES_SELF_SYMBOL);
++ }
+ }
+
+ @Override
+@@ -705,25 +713,12 @@
+ return definingFn == function;
+ }
+
+- private void checkConstAssignment(final IdentNode ident) {
+- // Check for reassignment of constant
+- final Symbol symbol = ident.getSymbol();
+- if (symbol.isConst()) {
+- throwParserException(ECMAErrors.getMessage("syntax.error.assign.constant", symbol.getName()), ident);
+- }
+- }
+-
+ @Override
+ public Node leaveBinaryNode(final BinaryNode binaryNode) {
+- if (binaryNode.isAssignment() && binaryNode.lhs() instanceof IdentNode) {
+- checkConstAssignment((IdentNode) binaryNode.lhs());
++ if (binaryNode.isTokenType(TokenType.ASSIGN)) {
++ return leaveASSIGN(binaryNode);
+ }
+- switch (binaryNode.tokenType()) {
+- case ASSIGN:
+- return leaveASSIGN(binaryNode);
+- default:
+- return super.leaveBinaryNode(binaryNode);
+- }
++ return super.leaveBinaryNode(binaryNode);
+ }
+
+ private Node leaveASSIGN(final BinaryNode binaryNode) {
+@@ -744,9 +739,6 @@
+
+ @Override
+ public Node leaveUnaryNode(final UnaryNode unaryNode) {
+- if (unaryNode.isAssignment() && unaryNode.getExpression() instanceof IdentNode) {
+- checkConstAssignment((IdentNode) unaryNode.getExpression());
+- }
+ switch (unaryNode.tokenType()) {
+ case DELETE:
+ return leaveDELETE(unaryNode);
+@@ -919,9 +911,7 @@
+ @Override
+ public Node leaveTryNode(final TryNode tryNode) {
+ tryNode.setException(exceptionSymbol());
+- if (tryNode.getFinallyBody() != null) {
+- tryNode.setFinallyCatchAll(exceptionSymbol());
+- }
++ assert tryNode.getFinallyBody() == null;
+
+ end(tryNode);
+
+--- ./nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java Wed Jul 01 21:54:30 2015 -0700
+@@ -31,6 +31,7 @@
+ import static jdk.nashorn.internal.codegen.Condition.LE;
+ import static jdk.nashorn.internal.codegen.Condition.LT;
+ import static jdk.nashorn.internal.codegen.Condition.NE;
++import static jdk.nashorn.internal.parser.TokenType.NOT;
+
+ import jdk.nashorn.internal.ir.BinaryNode;
+ import jdk.nashorn.internal.ir.Expression;
+@@ -57,21 +58,11 @@
+ }
+
+ private void branchOptimizer(final UnaryNode unaryNode, final Label label, final boolean state) {
+- final Expression rhs = unaryNode.getExpression();
+-
+- switch (unaryNode.tokenType()) {
+- case NOT:
+- branchOptimizer(rhs, label, !state);
+- return;
+- default:
+- if (unaryNode.getType().isBoolean()) {
+- branchOptimizer(rhs, label, state);
+- return;
+- }
+- break;
++ if (unaryNode.isTokenType(NOT)) {
++ branchOptimizer(unaryNode.getExpression(), label, !state);
++ } else {
++ loadTestAndJump(unaryNode, label, state);
+ }
+-
+- loadTestAndJump(unaryNode, label, state);
+ }
+
+ private void branchOptimizer(final BinaryNode binaryNode, final Label label, final boolean state) {
+@@ -105,33 +96,33 @@
+
+ case EQ:
+ case EQ_STRICT:
+- codegen.loadBinaryOperands(binaryNode);
++ codegen.loadComparisonOperands(binaryNode);
+ method.conditionalJump(state ? EQ : NE, true, label);
+ return;
+
+ case NE:
+ case NE_STRICT:
+- codegen.loadBinaryOperands(binaryNode);
++ codegen.loadComparisonOperands(binaryNode);
+ method.conditionalJump(state ? NE : EQ, true, label);
+ return;
+
+ case GE:
+- codegen.loadBinaryOperands(binaryNode);
++ codegen.loadComparisonOperands(binaryNode);
+ method.conditionalJump(state ? GE : LT, false, label);
+ return;
+
+ case GT:
+- codegen.loadBinaryOperands(binaryNode);
++ codegen.loadComparisonOperands(binaryNode);
+ method.conditionalJump(state ? GT : LE, false, label);
+ return;
+
+ case LE:
+- codegen.loadBinaryOperands(binaryNode);
++ codegen.loadComparisonOperands(binaryNode);
+ method.conditionalJump(state ? LE : GT, true, label);
+ return;
+
+ case LT:
+- codegen.loadBinaryOperands(binaryNode);
++ codegen.loadComparisonOperands(binaryNode);
+ method.conditionalJump(state ? LT : GE, true, label);
+ return;
+
+--- ./nashorn/src/jdk/nashorn/internal/codegen/ClassEmitter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/ClassEmitter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -100,14 +100,10 @@
+ * There is also a very nice debug interface that can emit formatted
+ * bytecodes that have been written. This is enabled by setting the
+ * environment "nashorn.codegen.debug" to true, or --log=codegen:{@literal <level>}
+- * <p>
+- * A ClassEmitter implements an Emitter - i.e. it needs to have
+- * well defined start and end calls for whatever it is generating. Assertions
+- * detect if this is not true
+ *
+ * @see Compiler
+ */
+-public class ClassEmitter implements Emitter {
++public class ClassEmitter {
+ /** Default flags for class generation - public class */
+ private static final EnumSet<Flag> DEFAULT_METHOD_FLAGS = EnumSet.of(Flag.PUBLIC);
+
+@@ -147,7 +143,7 @@
+
+ /**
+ * Constructor - only used internally in this class as it breaks
+- * abstraction towards ASM or other code generator below
++ * abstraction towards ASM or other code generator below.
+ *
+ * @param env script environment
+ * @param cw ASM classwriter
+@@ -160,7 +156,8 @@
+ }
+
+ /**
+- * Return the method names encountered
++ * Return the method names encountered.
++ *
+ * @return method names
+ */
+ public Set<String> getMethodNames() {
+@@ -168,12 +165,13 @@
+ }
+
+ /**
+- * Constructor
++ * Constructor.
+ *
+ * @param env script environment
+ * @param className name of class to weave
+ * @param superClassName super class name for class
+- * @param interfaceNames names of interfaces implemented by this class, or null if none
++ * @param interfaceNames names of interfaces implemented by this class, or
++ * {@code null} if none
+ */
+ ClassEmitter(final Context context, final String className, final String superClassName, final String... interfaceNames) {
+ this(context, new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS));
+@@ -181,7 +179,7 @@
+ }
+
+ /**
+- * Constructor from the compiler
++ * Constructor from the compiler.
+ *
+ * @param env Script environment
+ * @param sourceName Source name
+@@ -220,7 +218,6 @@
+ }
+
+ /**
+- * Returns the name of the compile unit class name.
+ * @return the name of the compile unit class name.
+ */
+ String getUnitClassName() {
+@@ -228,7 +225,8 @@
+ }
+
+ /**
+- * Get the method count, including init and clinit methods
++ * Get the method count, including init and clinit methods.
++ *
+ * @return method count
+ */
+ public int getMethodCount() {
+@@ -236,7 +234,8 @@
+ }
+
+ /**
+- * Get the clinit count
++ * Get the clinit count.
++ *
+ * @return clinit count
+ */
+ public int getClinitCount() {
+@@ -244,7 +243,8 @@
+ }
+
+ /**
+- * Get the init count
++ * Get the init count.
++ *
+ * @return init count
+ */
+ public int getInitCount() {
+@@ -252,7 +252,8 @@
+ }
+
+ /**
+- * Get the field count
++ * Get the field count.
++ *
+ * @return field count
+ */
+ public int getFieldCount() {
+@@ -263,6 +264,7 @@
+ * Convert a binary name to a package/class name.
+ *
+ * @param name Binary name.
++ *
+ * @return Package/class name.
+ */
+ private static String pathName(final String name) {
+@@ -271,6 +273,7 @@
+
+ /**
+ * Define the static fields common in all scripts.
++ *
+ * @param strictMode Should we generate this method in strict mode
+ */
+ private void defineCommonStatics(final boolean strictMode) {
+@@ -287,8 +290,8 @@
+ }
+
+ /**
+- * Define static utilities common needed in scripts. These are per compile unit
+- * and therefore have to be defined here and not in code gen.
++ * Define static utilities common needed in scripts. These are per compile
++ * unit and therefore have to be defined here and not in code gen.
+ */
+ private void defineCommonUtilities() {
+ assert unitClassName != null;
+@@ -336,7 +339,9 @@
+ }
+
+ /**
+- * Constructs a primitive specific method for getting the ith entry from the constants table as an array.
++ * Constructs a primitive specific method for getting the ith entry from the
++ * constants table as an array.
++ *
+ * @param clazz Array class.
+ */
+ private void defineGetArrayMethod(final Class<?> clazz) {
+@@ -359,7 +364,9 @@
+
+ /**
+ * Generate the name of a get array from constant pool method.
++ *
+ * @param clazz Name of array class.
++ *
+ * @return Method name.
+ */
+ static String getArrayMethodName(final Class<?> clazz) {
+@@ -369,6 +376,7 @@
+
+ /**
+ * Ensure a get constant method is issued for the class.
++ *
+ * @param clazz Class of constant.
+ */
+ void needGetConstantMethod(final Class<?> clazz) {
+@@ -376,12 +384,12 @@
+ }
+
+ /**
+- * Inspect class name and decide whether we are generating a ScriptObject class
++ * Inspect class name and decide whether we are generating a ScriptObject class.
+ *
+ * @param scriptPrefix the script class prefix for the current script
+ * @param type the type to check
+ *
+- * @return true if type is ScriptObject
++ * @return {@code true} if type is ScriptObject
+ */
+ private static boolean isScriptObject(final String scriptPrefix, final String type) {
+ if (type.startsWith(scriptPrefix)) {
+@@ -396,19 +404,15 @@
+ }
+
+ /**
+- * Call at beginning of class emission
+- * @see Emitter
++ * Call at beginning of class emission.
+ */
+- @Override
+ public void begin() {
+ classStarted = true;
+ }
+
+ /**
+- * Call at end of class emission
+- * @see Emitter
++ * Call at end of class emission.
+ */
+- @Override
+ public void end() {
+ assert classStarted : "class not started for " + unitClassName;
+
+@@ -431,7 +435,9 @@
+
+ /**
+ * Disassemble an array of byte code.
++ *
+ * @param bytecode byte array representing bytecode
++ *
+ * @return disassembly as human readable string
+ */
+ static String disassemble(final byte[] bytecode) {
+@@ -453,7 +459,7 @@
+ }
+
+ /**
+- * Call back from MethodEmitter for method start
++ * Call back from MethodEmitter for method start.
+ *
+ * @see MethodEmitter
+ *
+@@ -465,7 +471,7 @@
+ }
+
+ /**
+- * Call back from MethodEmitter for method end
++ * Call back from MethodEmitter for method end.
+ *
+ * @see MethodEmitter
+ *
+@@ -477,7 +483,7 @@
+ }
+
+ /**
+- * Add a new method to the class - defaults to public method
++ * Add a new method to the class - defaults to public method.
+ *
+ * @param methodName name of method
+ * @param rtype return type of the method
+@@ -490,7 +496,7 @@
+ }
+
+ /**
+- * Add a new method to the class - defaults to public method
++ * Add a new method to the class - defaults to public method.
+ *
+ * @param methodFlags access flags for the method
+ * @param methodName name of method
+@@ -506,7 +512,7 @@
+ }
+
+ /**
+- * Add a new method to the class - defaults to public method
++ * Add a new method to the class - defaults to public method.
+ *
+ * @param methodName name of method
+ * @param descriptor descriptor of method
+@@ -518,7 +524,7 @@
+ }
+
+ /**
+- * Add a new method to the class - defaults to public method
++ * Add a new method to the class - defaults to public method.
+ *
+ * @param methodFlags access flags for the method
+ * @param methodName name of method
+@@ -533,9 +539,10 @@
+ }
+
+ /**
+- * Add a new method to the class, representing a function node
++ * Add a new method to the class, representing a function node.
+ *
+ * @param functionNode the function node to generate a method for
++ *
+ * @return method emitter to use for weaving this method
+ */
+ MethodEmitter method(final FunctionNode functionNode) {
+@@ -553,9 +560,11 @@
+ }
+
+ /**
+- * Add a new method to the class, representing a rest-of version of the function node
++ * Add a new method to the class, representing a rest-of version of the
++ * function node.
+ *
+ * @param functionNode the function node to generate a method for
++ *
+ * @return method emitter to use for weaving this method
+ */
+ MethodEmitter restOfMethod(final FunctionNode functionNode) {
+@@ -573,7 +582,7 @@
+
+
+ /**
+- * Start generating the <clinit> method in the class
++ * Start generating the <clinit> method in the class.
+ *
+ * @return method emitter to use for weaving <clinit>
+ */
+@@ -583,7 +592,7 @@
+ }
+
+ /**
+- * Start generating an <init>()V method in the class
++ * Start generating an <init>()V method in the class.
+ *
+ * @return method emitter to use for weaving <init>()V
+ */
+@@ -593,7 +602,7 @@
+ }
+
+ /**
+- * Start generating an <init>()V method in the class
++ * Start generating an <init>()V method in the class.
+ *
+ * @param ptypes parameter types for constructor
+ * @return method emitter to use for weaving <init>()V
+@@ -604,7 +613,7 @@
+ }
+
+ /**
+- * Start generating an <init>(...)V method in the class
++ * Start generating an <init>(...)V method in the class.
+ *
+ * @param flags access flags for the constructor
+ * @param ptypes parameter types for the constructor
+@@ -617,7 +626,7 @@
+ }
+
+ /**
+- * Add a field to the class, initialized to a value
++ * Add a field to the class, initialized to a value.
+ *
+ * @param fieldFlags flags, e.g. should it be static or public etc
+ * @param fieldName name of field
+@@ -632,7 +641,7 @@
+ }
+
+ /**
+- * Add a field to the class
++ * Add a field to the class.
+ *
+ * @param fieldFlags access flags for the field
+ * @param fieldName name of field
+@@ -645,7 +654,7 @@
+ }
+
+ /**
+- * Add a field to the class - defaults to public
++ * Add a field to the class - defaults to public.
+ *
+ * @param fieldName name of field
+ * @param fieldType type of field
+@@ -658,7 +667,8 @@
+ * Return a bytecode array from this ClassEmitter. The ClassEmitter must
+ * have been ended (having its end function called) for this to work.
+ *
+- * @return byte code array for generated class, null if class generation hasn't been ended with {@link ClassEmitter#end()}
++ * @return byte code array for generated class, {@code null} if class
++ * generation hasn't been ended with {@link ClassEmitter#end()}.
+ */
+ byte[] toByteArray() {
+ assert classEnded;
+@@ -670,13 +680,9 @@
+ }
+
+ /**
+- * Abstraction for flags used in class emission
+- *
+- * We provide abstraction separating these from the underlying bytecode
+- * emitter.
+- *
+- * Flags are provided for method handles, protection levels, static/virtual
+- * fields/methods.
++ * Abstraction for flags used in class emission. We provide abstraction
++ * separating these from the underlying bytecode emitter. Flags are provided
++ * for method handles, protection levels, static/virtual fields/methods.
+ */
+ static enum Flag {
+ /** method handle with static access */
+@@ -714,10 +720,12 @@
+ }
+
+ /**
+- * Return the corresponding ASM flag value for an enum set of flags
++ * Return the corresponding ASM flag value for an enum set of flags.
+ *
+ * @param flags enum set of flags
+- * @return an integer value representing the flags intrinsic values or:ed together
++ *
++ * @return an integer value representing the flags intrinsic values
++ * or:ed together
+ */
+ static int getValue(final EnumSet<Flag> flags) {
+ int v = 0;
+--- ./nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -38,13 +38,11 @@
+ import static jdk.nashorn.internal.codegen.CompilerConstants.SPLIT_PREFIX;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.THIS;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.VARARGS;
+-import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.interfaceCallNoLookup;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.methodDescriptor;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.staticCallNoLookup;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.typeDescriptor;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup;
+-import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
+ import static jdk.nashorn.internal.ir.Symbol.HAS_SLOT;
+ import static jdk.nashorn.internal.ir.Symbol.IS_INTERNAL;
+ import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
+@@ -86,7 +84,6 @@
+ import jdk.nashorn.internal.ir.Block;
+ import jdk.nashorn.internal.ir.BlockStatement;
+ import jdk.nashorn.internal.ir.BreakNode;
+-import jdk.nashorn.internal.ir.BreakableNode;
+ import jdk.nashorn.internal.ir.CallNode;
+ import jdk.nashorn.internal.ir.CaseNode;
+ import jdk.nashorn.internal.ir.CatchNode;
+@@ -103,6 +100,7 @@
+ import jdk.nashorn.internal.ir.IndexNode;
+ import jdk.nashorn.internal.ir.JoinPredecessorExpression;
+ import jdk.nashorn.internal.ir.JumpStatement;
++import jdk.nashorn.internal.ir.JumpToInlinedFinally;
+ import jdk.nashorn.internal.ir.LabelNode;
+ import jdk.nashorn.internal.ir.LexicalContext;
+ import jdk.nashorn.internal.ir.LexicalContextNode;
+@@ -176,8 +174,7 @@
+ * This quickly became apparent when the code generator was generalized to work
+ * with all types, and not just numbers or objects.
+ * <p>
+- * The CodeGenerator visits nodes only once, tags them as resolved and emits
+- * bytecode for them.
++ * The CodeGenerator visits nodes only once and emits bytecode for them.
+ */
+ @Logger(name="codegen")
+ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContext> implements Loggable {
+@@ -186,9 +183,6 @@
+
+ private static final String GLOBAL_OBJECT = Type.getInternalName(Global.class);
+
+- private static final String SCRIPTFUNCTION_IMPL_NAME = Type.getInternalName(ScriptFunctionImpl.class);
+- private static final Type SCRIPTFUNCTION_IMPL_TYPE = Type.typeFor(ScriptFunction.class);
+-
+ private static final Call CREATE_REWRITE_EXCEPTION = CompilerConstants.staticCallNoLookup(RewriteException.class,
+ "create", RewriteException.class, UnwarrantedOptimismException.class, Object[].class, String[].class);
+ private static final Call CREATE_REWRITE_EXCEPTION_REST_OF = CompilerConstants.staticCallNoLookup(RewriteException.class,
+@@ -201,6 +195,17 @@
+ private static final Call ENSURE_NUMBER = CompilerConstants.staticCallNoLookup(OptimisticReturnFilters.class,
+ "ensureNumber", double.class, Object.class, int.class);
+
++ private static final Call CREATE_FUNCTION_OBJECT = CompilerConstants.staticCallNoLookup(ScriptFunctionImpl.class,
++ "create", ScriptFunction.class, Object[].class, int.class, ScriptObject.class);
++ private static final Call CREATE_FUNCTION_OBJECT_NO_SCOPE = CompilerConstants.staticCallNoLookup(ScriptFunctionImpl.class,
++ "create", ScriptFunction.class, Object[].class, int.class);
++
++ private static final Call TO_NUMBER_FOR_EQ = CompilerConstants.staticCallNoLookup(JSType.class,
++ "toNumberForEq", double.class, Object.class);
++ private static final Call TO_NUMBER_FOR_STRICT_EQ = CompilerConstants.staticCallNoLookup(JSType.class,
++ "toNumberForStrictEq", double.class, Object.class);
++
++
+ private static final Class<?> ITERATOR_CLASS = Iterator.class;
+ static {
+ assert ITERATOR_CLASS == CompilerConstants.ITERATOR_PREFIX.type();
+@@ -291,6 +296,20 @@
+ }
+
+ /**
++ * Gets the flags for a scope call site.
++ * @param symbol a scope symbol
++ * @return the correct flags for the scope call site
++ */
++ private int getScopeCallSiteFlags(final Symbol symbol) {
++ assert symbol.isScope();
++ final int flags = getCallSiteFlags() | CALLSITE_SCOPE;
++ if (isEvalCode() && symbol.isGlobal()) {
++ return flags; // Don't set fast-scope flag on non-declared globals in eval code - see JDK-8077955.
++ }
++ return isFastScope(symbol) ? flags | CALLSITE_FAST_SCOPE : flags;
++ }
++
++ /**
+ * Are we generating code for 'eval' code?
+ * @return true if currently compiled code is 'eval' code.
+ */
+@@ -299,6 +318,14 @@
+ }
+
+ /**
++ * Are we using dual primitive/object field representation?
++ * @return true if using dual field representation, false for object-only fields
++ */
++ boolean useDualFields() {
++ return compiler.getContext().useDualFields();
++ }
++
++ /**
+ * Load an identity node
+ *
+ * @param identNode an identity node to load
+@@ -319,7 +346,7 @@
+ }
+
+ assert identNode.getSymbol().isScope() : identNode + " is not in scope!";
+- final int flags = CALLSITE_SCOPE | getCallSiteFlags();
++ final int flags = getScopeCallSiteFlags(symbol);
+ if (isFastScope(symbol)) {
+ // Only generate shared scope getter for fast-scope symbols so we know we can dial in correct scope.
+ if (symbol.getUseCount() > SharedScopeCall.FAST_SCOPE_GET_THRESHOLD && !isOptimisticOrRestOf()) {
+@@ -342,8 +369,14 @@
+ // This is called the temporal dead zone (TDZ). See https://gist.github.com/rwaldron/f0807a758aa03bcdd58a
+ private void checkTemporalDeadZone(final IdentNode identNode) {
+ if (identNode.isDead()) {
+- method.load(identNode.getSymbol().getName());
+- method.invoke(ScriptRuntime.THROW_REFERENCE_ERROR);
++ method.load(identNode.getSymbol().getName()).invoke(ScriptRuntime.THROW_REFERENCE_ERROR);
++ }
++ }
++
++ // Runtime check for assignment to ES6 const
++ private void checkAssignTarget(final Expression expression) {
++ if (expression instanceof IdentNode && ((IdentNode)expression).getSymbol().isConst()) {
++ method.load(((IdentNode)expression).getSymbol().getName()).invoke(ScriptRuntime.THROW_CONST_TYPE_ERROR);
+ }
+ }
+
+@@ -437,7 +470,7 @@
+ } else {
+ method.load(-1);
+ }
+- return lc.getScopeGet(unit, symbol, valueType, flags | CALLSITE_FAST_SCOPE).generateInvoke(method);
++ return lc.getScopeGet(unit, symbol, valueType, flags).generateInvoke(method);
+ }
+
+ private class LoadScopeVar extends OptimisticOperation {
+@@ -475,7 +508,7 @@
+
+ private class LoadFastScopeVar extends LoadScopeVar {
+ LoadFastScopeVar(final IdentNode identNode, final TypeBounds resultBounds, final int flags) {
+- super(identNode, resultBounds, flags | CALLSITE_FAST_SCOPE);
++ super(identNode, resultBounds, flags);
+ }
+
+ @Override
+@@ -486,7 +519,7 @@
+
+ private MethodEmitter storeFastScopeVar(final Symbol symbol, final int flags) {
+ loadFastScopeProto(symbol, true);
+- method.dynamicSet(symbol.getName(), flags | CALLSITE_FAST_SCOPE, false);
++ method.dynamicSet(symbol.getName(), flags, false);
+ return method;
+ }
+
+@@ -611,6 +644,104 @@
+ return method;
+ }
+
++ /**
++ * Similar to {@link #loadBinaryOperands(BinaryNode)} but used specifically for loading operands of
++ * relational and equality comparison operators where at least one argument is non-object. (When both
++ * arguments are objects, we use {@link ScriptRuntime#EQ(Object, Object)}, {@link ScriptRuntime#LT(Object, Object)}
++ * etc. methods instead. Additionally, {@code ScriptRuntime} methods are used for strict (in)equality comparison
++ * of a boolean to anything that isn't a boolean.) This method handles the special case where one argument
++ * is an object and another is a primitive. Naively, these could also be delegated to {@code ScriptRuntime} methods
++ * by boxing the primitive. However, in all such cases the comparison is performed on numeric values, so it is
++ * possible to strength-reduce the operation by taking the number value of the object argument instead and
++ * comparing that to the primitive value ("primitive" will always be int, long, double, or boolean, and booleans
++ * compare as ints in these cases, so they're essentially numbers too). This method will emit code for loading
++ * arguments for such strength-reduced comparison. When both arguments are primitives, it just delegates to
++ * {@link #loadBinaryOperands(BinaryNode)}.
++ *
++ * @param cmp the comparison operation for which the operands need to be loaded on stack.
++ * @return the current method emitter.
++ */
++ MethodEmitter loadComparisonOperands(final BinaryNode cmp) {
++ final Expression lhs = cmp.lhs();
++ final Expression rhs = cmp.rhs();
++ final Type lhsType = lhs.getType();
++ final Type rhsType = rhs.getType();
++
++ // Only used when not both are object, for that we have ScriptRuntime.LT etc.
++ assert !(lhsType.isObject() && rhsType.isObject());
++
++ if (lhsType.isObject() || rhsType.isObject()) {
++ // We can reorder CONVERT LEFT and LOAD RIGHT only if either the left is a primitive, or the right
++ // is a local. This is more strict than loadBinaryNode reorder criteria, as it can allow JS primitive
++ // types too (notably: String is a JS primitive, but not a JVM primitive). We disallow String otherwise
++ // we would prematurely convert it to number when comparing to an optimistic expression, e.g. in
++ // "Hello" === String("Hello") the RHS starts out as an optimistic-int function call. If we allowed
++ // reordering, we'd end up with ToNumber("Hello") === {I%}String("Hello") that is obviously incorrect.
++ final boolean canReorder = lhsType.isPrimitive() || rhs.isLocal();
++ // If reordering is allowed, and we're using a relational operator (that is, <, <=, >, >=) and not an
++ // (in)equality operator, then we encourage combining of LOAD and CONVERT into a single operation.
++ // This is because relational operators' semantics prescribes vanilla ToNumber() conversion, while
++ // (in)equality operators need the specialized JSType.toNumberFor[Strict]Equals. E.g. in the code snippet
++ // "i < obj.size" (where i is primitive and obj.size is statically an object), ".size" will thus be allowed
++ // to compile as:
++ // invokedynamic dyn:getProp|getElem|getMethod:size(Object;)D
++ // instead of the more costly:
++ // invokedynamic dyn:getProp|getElem|getMethod:size(Object;)Object
++ // invokestatic JSType.toNumber(Object)D
++ // Note also that even if this is allowed, we're only using it on operands that are non-optimistic, as
++ // otherwise the logic for determining effective optimistic-ness would turn an optimistic double return
++ // into a freely coercible one, which would be wrong.
++ final boolean canCombineLoadAndConvert = canReorder && cmp.isRelational();
++
++ // LOAD LEFT
++ loadExpression(lhs, canCombineLoadAndConvert && !lhs.isOptimistic() ? TypeBounds.NUMBER : TypeBounds.UNBOUNDED);
++
++ final Type lhsLoadedType = method.peekType();
++ final TokenType tt = cmp.tokenType();
++ if (canReorder) {
++ // Can reorder CONVERT LEFT and LOAD RIGHT
++ emitObjectToNumberComparisonConversion(method, tt);
++ loadExpression(rhs, canCombineLoadAndConvert && !rhs.isOptimistic() ? TypeBounds.NUMBER : TypeBounds.UNBOUNDED);
++ } else {
++ // Can't reorder CONVERT LEFT and LOAD RIGHT
++ loadExpression(rhs, TypeBounds.UNBOUNDED);
++ if (lhsLoadedType != Type.NUMBER) {
++ method.swap();
++ emitObjectToNumberComparisonConversion(method, tt);
++ method.swap();
++ }
++ }
++
++ // CONVERT RIGHT
++ emitObjectToNumberComparisonConversion(method, tt);
++ return method;
++ }
++ // For primitive operands, just don't do anything special.
++ return loadBinaryOperands(cmp);
++ }
++
++ private static void emitObjectToNumberComparisonConversion(final MethodEmitter method, final TokenType tt) {
++ switch(tt) {
++ case EQ:
++ case NE:
++ if (method.peekType().isObject()) {
++ TO_NUMBER_FOR_EQ.invoke(method);
++ return;
++ }
++ break;
++ case EQ_STRICT:
++ case NE_STRICT:
++ if (method.peekType().isObject()) {
++ TO_NUMBER_FOR_STRICT_EQ.invoke(method);
++ return;
++ }
++ break;
++ default:
++ break;
++ }
++ method.convert(Type.NUMBER);
++ }
++
+ private static final Type undefinedToNumber(final Type type) {
+ return type == Type.UNDEFINED ? Type.NUMBER : type;
+ }
+@@ -621,6 +752,7 @@
+
+ static final TypeBounds UNBOUNDED = new TypeBounds(Type.UNKNOWN, Type.OBJECT);
+ static final TypeBounds INT = exact(Type.INT);
++ static final TypeBounds NUMBER = exact(Type.NUMBER);
+ static final TypeBounds OBJECT = exact(Type.OBJECT);
+ static final TypeBounds BOOLEAN = exact(Type.BOOLEAN);
+
+@@ -724,7 +856,7 @@
+ */
+ final CodeGenerator codegen = this;
+
+- final Node currentDiscard = codegen.lc.getCurrentDiscard();
++ final boolean isCurrentDiscard = codegen.lc.isCurrentDiscard(expr);
+ expr.accept(new NodeOperatorVisitor<LexicalContext>(new LexicalContext()) {
+ @Override
+ public boolean enterIdentNode(final IdentNode identNode) {
+@@ -786,72 +918,84 @@
+
+ @Override
+ public boolean enterASSIGN(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_ADD(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_ADD(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_BIT_AND(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_BIT_AND(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_BIT_OR(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_BIT_OR(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_BIT_XOR(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_BIT_XOR(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_DIV(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_DIV(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_MOD(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_MOD(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_MUL(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_MUL(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_SAR(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_SAR(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_SHL(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_SHL(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_SHR(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_SHR(binaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterASSIGN_SUB(final BinaryNode binaryNode) {
++ checkAssignTarget(binaryNode.lhs());
+ loadASSIGN_SUB(binaryNode);
+ return false;
+ }
+@@ -1061,13 +1205,14 @@
+
+ @Override
+ public boolean enterDECINC(final UnaryNode unaryNode) {
++ checkAssignTarget(unaryNode.getExpression());
+ loadDECINC(unaryNode);
+ return false;
+ }
+
+ @Override
+ public boolean enterJoinPredecessorExpression(final JoinPredecessorExpression joinExpr) {
+- loadExpression(joinExpr.getExpression(), resultBounds);
++ loadMaybeDiscard(joinExpr, joinExpr.getExpression(), resultBounds);
+ return false;
+ }
+
+@@ -1084,7 +1229,7 @@
+ throw new AssertionError(otherNode.getClass().getName());
+ }
+ });
+- if(currentDiscard != expr) {
++ if(!isCurrentDiscard) {
+ coerceStackTop(resultBounds);
+ }
+ return method;
+@@ -1109,7 +1254,14 @@
+
+ @Override
+ public boolean enterBlock(final Block block) {
+- method.label(block.getEntryLabel());
++ final Label entryLabel = block.getEntryLabel();
++ if (entryLabel.isBreakTarget()) {
++ // Entry label is a break target only for an inlined finally block.
++ assert !method.isReachable();
++ method.breakLabel(entryLabel, lc.getUsedSlotCount());
++ } else {
++ method.label(entryLabel);
++ }
+ if(!method.isReachable()) {
+ return false;
+ }
+@@ -1122,7 +1274,7 @@
+ return true;
+ }
+
+- private boolean useOptimisticTypes() {
++ boolean useOptimisticTypes() {
+ return !lc.inSplitNode() && compiler.useOptimisticTypes();
+ }
+
+@@ -1239,6 +1391,11 @@
+ return enterJumpStatement(breakNode);
+ }
+
++ @Override
++ public boolean enterJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) {
++ return enterJumpStatement(jumpToInlinedFinally);
++ }
++
+ private boolean enterJumpStatement(final JumpStatement jump) {
+ if(!method.isReachable()) {
+ return false;
+@@ -1246,9 +1403,8 @@
+ enterStatement(jump);
+
+ method.beforeJoinPoint(jump);
+- final BreakableNode target = jump.getTarget(lc);
+- popScopesUntil(target);
+- final Label targetLabel = jump.getTargetLabel(target);
++ popScopesUntil(jump.getPopScopeLimit(lc));
++ final Label targetLabel = jump.getTargetLabel(lc);
+ targetLabel.markAsBreakTarget();
+ method._goto(targetLabel);
+
+@@ -1283,7 +1439,6 @@
+ private MethodEmitter sharedScopeCall(final IdentNode identNode, final int flags) {
+ final Symbol symbol = identNode.getSymbol();
+ final boolean isFastScope = isFastScope(symbol);
+- final int scopeCallFlags = flags | (isFastScope ? CALLSITE_FAST_SCOPE : 0);
+ new OptimisticOperation(callNode, resultBounds) {
+ @Override
+ void loadStack() {
+@@ -1306,7 +1461,7 @@
+ // As shared scope calls are only used in non-optimistic compilation, we switch from using
+ // TypeBounds to just a single definitive type, resultBounds.widest.
+ final SharedScopeCall scopeCall = codegenLexicalContext.getScopeCall(unit, symbol,
+- identNode.getType(), resultBounds.widest, paramTypes, scopeCallFlags);
++ identNode.getType(), resultBounds.widest, paramTypes, flags);
+ scopeCall.generateInvoke(method);
+ }
+ }.emit();
+@@ -1407,7 +1562,7 @@
+ final Symbol symbol = node.getSymbol();
+
+ if (symbol.isScope()) {
+- final int flags = getCallSiteFlags() | CALLSITE_SCOPE;
++ final int flags = getScopeCallSiteFlags(symbol);
+ final int useCount = symbol.getUseCount();
+
+ // Threshold for generating shared scope callsite is lower for fast scope symbols because we know
+@@ -1558,11 +1713,7 @@
+
+ @Override
+ public boolean enterEmptyNode(final EmptyNode emptyNode) {
+- if(!method.isReachable()) {
+- return false;
+- }
+- enterStatement(emptyNode);
+-
++ // Don't even record the line number, it's irrelevant as there's no code.
+ return false;
+ }
+
+@@ -1760,10 +1911,10 @@
+ //this symbol will be put fielded, we can't initialize it as undefined with a known type
+ @Override
+ public Class<?> getValueType() {
+- if (OBJECT_FIELDS_ONLY || value == null || paramType == null) {
++ if (!useDualFields() || value == null || paramType == null || paramType.isBoolean()) {
+ return Object.class;
+ }
+- return paramType.isBoolean() ? Object.class : paramType.getTypeClass();
++ return paramType.getTypeClass();
+ }
+ });
+ }
+@@ -2242,7 +2393,6 @@
+ } else {
+ methodEmitter.loadConstants().load(index).arrayload();
+ if (object instanceof ArrayData) {
+- // avoid cast to non-public ArrayData subclass
+ methodEmitter.checkcast(ArrayData.class);
+ methodEmitter.invoke(virtualCallNoLookup(ArrayData.class, "copy", ArrayData.class));
+ } else if (cls != Object.class) {
+@@ -2251,6 +2401,10 @@
+ }
+ }
+
++ private void loadConstantsAndIndex(final Object object, final MethodEmitter methodEmitter) {
++ methodEmitter.loadConstants().load(compiler.getConstantData().add(object));
++ }
++
+ // literal values
+ private void loadLiteral(final LiteralNode<?> node, final TypeBounds resultBounds) {
+ final Object value = node.getValue();
+@@ -2416,7 +2570,7 @@
+
+ //for literals, a value of null means object type, i.e. the value null or getter setter function
+ //(I think)
+- final Class<?> valueType = (OBJECT_FIELDS_ONLY || value == null || value.getType().isBoolean()) ? Object.class : value.getType().getTypeClass();
++ final Class<?> valueType = (!useDualFields() || value == null || value.getType().isBoolean()) ? Object.class : value.getType().getTypeClass();
+ tuples.add(new MapTuple<Expression>(key, symbol, Type.typeFor(valueType), value) {
+ @Override
+ public Class<?> getValueType() {
+@@ -2488,8 +2642,6 @@
+ }
+ enterStatement(returnNode);
+
+- method.registerReturn();
+-
+ final Type returnType = lc.getCurrentFunction().getReturnType();
+
+ final Expression expression = returnNode.getExpression();
+@@ -2722,25 +2874,18 @@
+ newRuntimeNode = runtimeNode;
+ }
+
+- new OptimisticOperation(newRuntimeNode, TypeBounds.UNBOUNDED) {
+- @Override
+- void loadStack() {
+- for (final Expression arg : args) {
+- loadExpression(arg, TypeBounds.OBJECT);
+- }
+- }
+- @Override
+- void consumeStack() {
+- method.invokestatic(
+- CompilerConstants.className(ScriptRuntime.class),
+- newRuntimeNode.getRequest().toString(),
+- new FunctionSignature(
+- false,
+- false,
+- newRuntimeNode.getType(),
+- args.size()).toString());
+- }
+- }.emit();
++ for (final Expression arg : args) {
++ loadExpression(arg, TypeBounds.OBJECT);
++ }
++
++ method.invokestatic(
++ CompilerConstants.className(ScriptRuntime.class),
++ newRuntimeNode.getRequest().toString(),
++ new FunctionSignature(
++ false,
++ false,
++ newRuntimeNode.getType(),
++ args.size()).toString());
+
+ method.convert(newRuntimeNode.getType());
+ }
+@@ -3049,6 +3194,14 @@
+ if (method.isReachable()) {
+ method._goto(skip);
+ }
++
++ for (final Block inlinedFinally : tryNode.getInlinedFinallies()) {
++ TryNode.getLabelledInlinedFinallyBlock(inlinedFinally).accept(this);
++ // All inlined finallies end with a jump or a return
++ assert !method.isReachable();
++ }
++
++
+ method._catch(recovery);
+ method.store(vmException, EXCEPTION_TYPE);
+
+@@ -3099,6 +3252,7 @@
+ if (isConditionalCatch) {
+ loadExpressionAsBoolean(exceptionCondition);
+ nextCatch = new Label("next_catch");
++ nextCatch.markAsBreakTarget();
+ method.ifeq(nextCatch);
+ } else {
+ nextCatch = null;
+@@ -3107,15 +3261,14 @@
+ catchBody.accept(this);
+ leaveBlock(catchBlock);
+ lc.pop(catchBlock);
+- if(method.isReachable()) {
+- method._goto(afterCatch);
+- }
+ if(nextCatch != null) {
+- method.label(nextCatch);
+- }
+- }
+-
+- assert !method.isReachable();
++ if(method.isReachable()) {
++ method._goto(afterCatch);
++ }
++ method.breakLabel(nextCatch, lc.getUsedSlotCount());
++ }
++ }
++
+ // afterCatch could be the same as skip, except that we need to establish that the vmException is dead.
+ method.label(afterCatch);
+ if(method.isReachable()) {
+@@ -3124,6 +3277,8 @@
+ method.label(skip);
+
+ // Finally body is always inlined elsewhere so it doesn't need to be emitted
++ assert tryNode.getFinallyBody() == null;
++
+ return false;
+ }
+
+@@ -3143,7 +3298,7 @@
+ // block scoped variables need a DECLARE flag to signal end of temporal dead zone (TDZ)
+ method.loadCompilerConstant(SCOPE);
+ method.loadUndefined(Type.OBJECT);
+- final int flags = CALLSITE_SCOPE | getCallSiteFlags() | (varNode.isBlockScoped() ? CALLSITE_DECLARE : 0);
++ final int flags = getScopeCallSiteFlags(identSymbol) | (varNode.isBlockScoped() ? CALLSITE_DECLARE : 0);
+ assert isFastScope(identSymbol);
+ storeFastScopeVar(identSymbol, flags);
+ }
+@@ -3160,7 +3315,7 @@
+ if (needsScope) {
+ loadExpressionUnbounded(init);
+ // block scoped variables need a DECLARE flag to signal end of temporal dead zone (TDZ)
+- final int flags = CALLSITE_SCOPE | getCallSiteFlags() | (varNode.isBlockScoped() ? CALLSITE_DECLARE : 0);
++ final int flags = getScopeCallSiteFlags(identSymbol) | (varNode.isBlockScoped() ? CALLSITE_DECLARE : 0);
+ if (isFastScope(identSymbol)) {
+ storeFastScopeVar(identSymbol, flags);
+ } else {
+@@ -3506,7 +3661,7 @@
+ // TODO: move checks for discarding to actual expression load code (e.g. as we do with void). That way we might
+ // be able to eliminate even more checks.
+ if(expr instanceof PrimitiveLiteralNode | isLocalVariable(expr)) {
+- assert lc.getCurrentDiscard() != expr;
++ assert !lc.isCurrentDiscard(expr);
+ // Don't bother evaluating expressions without side effects. Typical usage is "void 0" for reliably generating
+ // undefined.
+ return;
+@@ -3514,11 +3669,37 @@
+
+ lc.pushDiscard(expr);
+ loadExpression(expr, TypeBounds.UNBOUNDED);
+- if (lc.getCurrentDiscard() == expr) {
++ if (lc.popDiscardIfCurrent(expr)) {
+ assert !expr.isAssignment();
+ // NOTE: if we had a way to load with type void, we could avoid popping
+ method.pop();
+- lc.popDiscard();
++ }
++ }
++
++ /**
++ * Loads the expression with the specified type bounds, but if the parent expression is the current discard,
++ * then instead loads and discards the expression.
++ * @param parent the parent expression that's tested for being the current discard
++ * @param expr the expression that's either normally loaded or discard-loaded
++ * @param resultBounds result bounds for when loading the expression normally
++ */
++ private void loadMaybeDiscard(final Expression parent, final Expression expr, final TypeBounds resultBounds) {
++ loadMaybeDiscard(lc.popDiscardIfCurrent(parent), expr, resultBounds);
++ }
++
++ /**
++ * Loads the expression with the specified type bounds, or loads and discards the expression, depending on the
++ * value of the discard flag. Useful as a helper for expressions with control flow where you often can't combine
++ * testing for being the current discard and loading the subexpressions.
++ * @param discard if true, the expression is loaded and discarded
++ * @param expr the expression that's either normally loaded or discard-loaded
++ * @param resultBounds result bounds for when loading the expression normally
++ */
++ private void loadMaybeDiscard(final boolean discard, final Expression expr, final TypeBounds resultBounds) {
++ if (discard) {
++ loadAndDiscard(expr);
++ } else {
++ loadExpression(expr, resultBounds);
+ }
+ }
+
+@@ -3575,9 +3756,7 @@
+
+ public void loadVOID(final UnaryNode unaryNode, final TypeBounds resultBounds) {
+ loadAndDiscard(unaryNode.getExpression());
+- if(lc.getCurrentDiscard() == unaryNode) {
+- lc.popDiscard();
+- } else {
++ if (!lc.popDiscardIfCurrent(unaryNode)) {
+ method.loadUndefined(resultBounds.widest);
+ }
+ }
+@@ -3610,16 +3789,22 @@
+ private void loadAND_OR(final BinaryNode binaryNode, final TypeBounds resultBounds, final boolean isAnd) {
+ final Type narrowestOperandType = Type.widestReturnType(binaryNode.lhs().getType(), binaryNode.rhs().getType());
+
++ final boolean isCurrentDiscard = lc.popDiscardIfCurrent(binaryNode);
++
+ final Label skip = new Label("skip");
+ if(narrowestOperandType == Type.BOOLEAN) {
+ // optimize all-boolean logical expressions
+ final Label onTrue = new Label("andor_true");
+ emitBranch(binaryNode, onTrue, true);
+- method.load(false);
+- method._goto(skip);
+- method.label(onTrue);
+- method.load(true);
+- method.label(skip);
++ if (isCurrentDiscard) {
++ method.label(onTrue);
++ } else {
++ method.load(false);
++ method._goto(skip);
++ method.label(onTrue);
++ method.load(true);
++ method.label(skip);
++ }
+ return;
+ }
+
+@@ -3628,7 +3813,11 @@
+ final boolean lhsConvert = LocalVariableConversion.hasLiveConversion(lhs);
+ final Label evalRhs = lhsConvert ? new Label("eval_rhs") : null;
+
+- loadExpression(lhs, outBounds).dup().convert(Type.BOOLEAN);
++ loadExpression(lhs, outBounds);
++ if (!isCurrentDiscard) {
++ method.dup();
++ }
++ method.convert(Type.BOOLEAN);
+ if (isAnd) {
+ if(lhsConvert) {
+ method.ifne(evalRhs);
+@@ -3647,9 +3836,11 @@
+ method.label(evalRhs);
+ }
+
+- method.pop();
++ if (!isCurrentDiscard) {
++ method.pop();
++ }
+ final JoinPredecessorExpression rhs = (JoinPredecessorExpression)binaryNode.rhs();
+- loadExpression(rhs, outBounds);
++ loadMaybeDiscard(isCurrentDiscard, rhs, outBounds);
+ method.beforeJoinPoint(rhs);
+ method.label(skip);
+ }
+@@ -3671,9 +3862,8 @@
+ // Detect dead assignments
+ if(lhs instanceof IdentNode) {
+ final Symbol symbol = ((IdentNode)lhs).getSymbol();
+- if(!symbol.isScope() && !symbol.hasSlotFor(rhsType) && lc.getCurrentDiscard() == binaryNode) {
++ if(!symbol.isScope() && !symbol.hasSlotFor(rhsType) && lc.popDiscardIfCurrent(binaryNode)) {
+ loadAndDiscard(rhs);
+- lc.popDiscard();
+ method.markDeadLocalVariable(symbol);
+ return;
+ }
+@@ -3927,11 +4117,11 @@
+
+ private void loadCOMMARIGHT(final BinaryNode binaryNode, final TypeBounds resultBounds) {
+ loadAndDiscard(binaryNode.lhs());
+- loadExpression(binaryNode.rhs(), resultBounds);
++ loadMaybeDiscard(binaryNode, binaryNode.rhs(), resultBounds);
+ }
+
+ private void loadCOMMALEFT(final BinaryNode binaryNode, final TypeBounds resultBounds) {
+- loadExpression(binaryNode.lhs(), resultBounds);
++ loadMaybeDiscard(binaryNode, binaryNode.lhs(), resultBounds);
+ loadAndDiscard(binaryNode.rhs());
+ }
+
+@@ -3945,8 +4135,7 @@
+ }
+
+ private void loadCmp(final BinaryNode binaryNode, final Condition cond) {
+- assert comparisonOperandsArePrimitive(binaryNode) : binaryNode;
+- loadBinaryOperands(binaryNode);
++ loadComparisonOperands(binaryNode);
+
+ final Label trueLabel = new Label("trueLabel");
+ final Label afterLabel = new Label("skip");
+@@ -3960,11 +4149,6 @@
+ method.label(afterLabel);
+ }
+
+- private static boolean comparisonOperandsArePrimitive(final BinaryNode binaryNode) {
+- final Type widest = Type.widest(binaryNode.lhs().getType(), binaryNode.rhs().getType());
+- return widest.isNumeric() || widest.isBoolean();
+- }
+-
+ private void loadMOD(final BinaryNode binaryNode, final TypeBounds resultBounds) {
+ new BinaryArith() {
+ @Override
+@@ -4037,13 +4221,14 @@
+
+ emitBranch(test, falseLabel, false);
+
+- loadExpression(trueExpr.getExpression(), outBounds);
+- assert Type.generic(method.peekType()) == outBounds.narrowest;
++ final boolean isCurrentDiscard = lc.popDiscardIfCurrent(ternaryNode);
++ loadMaybeDiscard(isCurrentDiscard, trueExpr.getExpression(), outBounds);
++ assert isCurrentDiscard || Type.generic(method.peekType()) == outBounds.narrowest;
+ method.beforeJoinPoint(trueExpr);
+ method._goto(exitLabel);
+ method.label(falseLabel);
+- loadExpression(falseExpr.getExpression(), outBounds);
+- assert Type.generic(method.peekType()) == outBounds.narrowest;
++ loadMaybeDiscard(isCurrentDiscard, falseExpr.getExpression(), outBounds);
++ assert isCurrentDiscard || Type.generic(method.peekType()) == outBounds.narrowest;
+ method.beforeJoinPoint(falseExpr);
+ method.label(exitLabel);
+ }
+@@ -4229,9 +4414,8 @@
+
+ // store the result that "lives on" after the op, e.g. "i" in i++ postfix.
+ protected void storeNonDiscard() {
+- if (lc.getCurrentDiscard() == assignNode) {
++ if (lc.popDiscardIfCurrent(assignNode)) {
+ assert assignNode.isAssignment();
+- lc.popDiscard();
+ return;
+ }
+
+@@ -4264,7 +4448,7 @@
+ final Symbol symbol = node.getSymbol();
+ assert symbol != null;
+ if (symbol.isScope()) {
+- final int flags = CALLSITE_SCOPE | getCallSiteFlags();
++ final int flags = getScopeCallSiteFlags(symbol);
+ if (isFastScope(symbol)) {
+ storeFastScopeVar(symbol, flags);
+ } else {
+@@ -4322,21 +4506,19 @@
+ final RecompilableScriptFunctionData data = compiler.getScriptFunctionData(functionNode.getId());
+
+ if (functionNode.isProgram() && !compiler.isOnDemandCompilation()) {
+- final CompileUnit fnUnit = functionNode.getCompileUnit();
+- final MethodEmitter createFunction = fnUnit.getClassEmitter().method(
++ final MethodEmitter createFunction = functionNode.getCompileUnit().getClassEmitter().method(
+ EnumSet.of(Flag.PUBLIC, Flag.STATIC), CREATE_PROGRAM_FUNCTION.symbolName(),
+ ScriptFunction.class, ScriptObject.class);
+ createFunction.begin();
+- createFunction._new(SCRIPTFUNCTION_IMPL_NAME, SCRIPTFUNCTION_IMPL_TYPE).dup();
+- loadConstant(data, fnUnit, createFunction);
++ loadConstantsAndIndex(data, createFunction);
+ createFunction.load(SCOPE_TYPE, 0);
+- createFunction.invoke(constructorNoLookup(SCRIPTFUNCTION_IMPL_NAME, RecompilableScriptFunctionData.class, ScriptObject.class));
++ createFunction.invoke(CREATE_FUNCTION_OBJECT);
+ createFunction._return();
+ createFunction.end();
+ }
+
+ if (addInitializer && !compiler.isOnDemandCompilation()) {
+- compiler.addFunctionInitializer(data, functionNode);
++ functionNode.getCompileUnit().addFunctionInitializer(data, functionNode);
+ }
+
+ // We don't emit a ScriptFunction on stack for the outermost compiled function (as there's no code being
+@@ -4345,15 +4527,14 @@
+ return;
+ }
+
+- method._new(SCRIPTFUNCTION_IMPL_NAME, SCRIPTFUNCTION_IMPL_TYPE).dup();
+- loadConstant(data);
++ loadConstantsAndIndex(data, method);
+
+ if (functionNode.needsParentScope()) {
+ method.loadCompilerConstant(SCOPE);
++ method.invoke(CREATE_FUNCTION_OBJECT);
+ } else {
+- method.loadNull();
+- }
+- method.invoke(constructorNoLookup(SCRIPTFUNCTION_IMPL_NAME, RecompilableScriptFunctionData.class, ScriptObject.class));
++ method.invoke(CREATE_FUNCTION_OBJECT_NO_SCOPE);
++ }
+ }
+
+ // calls on Global class.
+--- ./nashorn/src/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java Wed Jul 01 21:54:30 2015 -0700
+@@ -34,6 +34,7 @@
+ import jdk.nashorn.internal.IntDeque;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.Block;
++import jdk.nashorn.internal.ir.Expression;
+ import jdk.nashorn.internal.ir.FunctionNode;
+ import jdk.nashorn.internal.ir.LexicalContext;
+ import jdk.nashorn.internal.ir.LexicalContextNode;
+@@ -59,9 +60,11 @@
+ /** Method emitter stack - every time we start a sub method (e.g. a split) we push one */
+ private final Deque<MethodEmitter> methodEmitters = new ArrayDeque<>();
+
+- /** The discard stack - whenever we enter a discard node we keep track of its return value status -
+- * i.e. should we keep it or throw it away */
+- private final Deque<Node> discard = new ArrayDeque<>();
++ /** The discard stack - whenever we evaluate an expression that will be discarded, we push it on this stack. Various
++ * implementations of expression code emitter can choose to emit code that'll discard the expression themselves, or
++ * ignore it in which case CodeGenerator.loadAndDiscard() will explicitly emit a pop instruction. */
++ private final Deque<Expression> discard = new ArrayDeque<>();
++
+
+ private final Deque<Map<String, Collection<Label>>> unwarrantedOptimismHandlers = new ArrayDeque<>();
+ private final Deque<StringBuilder> slotTypesDescriptors = new ArrayDeque<>();
+@@ -74,7 +77,7 @@
+ /** size of next free slot vector */
+ private int nextFreeSlotsSize;
+
+- private boolean isWithBoundary(final LexicalContextNode node) {
++ private boolean isWithBoundary(final Object node) {
+ return node instanceof Block && !isEmpty() && peek() instanceof WithNode;
+ }
+
+@@ -102,7 +105,7 @@
+ }
+
+ @Override
+- public <T extends LexicalContextNode> T pop(final T node) {
++ public <T extends Node> T pop(final T node) {
+ final T popped = super.pop(node);
+ if (isWithBoundary(node)) {
+ dynamicScopeCount--;
+@@ -270,16 +273,20 @@
+ }
+ }
+
+- void pushDiscard(final Node node) {
+- discard.push(node);
++ void pushDiscard(final Expression expr) {
++ discard.push(expr);
+ }
+
+- Node popDiscard() {
+- return discard.pop();
++ boolean popDiscardIfCurrent(final Expression expr) {
++ if (isCurrentDiscard(expr)) {
++ discard.pop();
++ return true;
++ }
++ return false;
+ }
+
+- Node getCurrentDiscard() {
+- return discard.peek();
++ boolean isCurrentDiscard(final Expression expr) {
++ return discard.peek() == expr;
+ }
+
+ int quickSlot(final Type type) {
+--- ./nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java Wed Jul 01 21:54:30 2015 -0700
+@@ -57,7 +57,6 @@
+ import jdk.nashorn.internal.ir.debug.PrintVisitor;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+ import jdk.nashorn.internal.runtime.CodeInstaller;
+-import jdk.nashorn.internal.runtime.FunctionInitializer;
+ import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData;
+ import jdk.nashorn.internal.runtime.ScriptEnvironment;
+ import jdk.nashorn.internal.runtime.logging.DebugLogger;
+@@ -364,7 +363,7 @@
+ //partial code generation
+ final FunctionNode newFunctionNode = transformFunction(fn, new ReplaceCompileUnits() {
+ @Override
+- CompileUnit getReplacement(CompileUnit original) {
++ CompileUnit getReplacement(final CompileUnit original) {
+ return map.get(original);
+ }
+
+@@ -581,18 +580,7 @@
+ continue;
+ }
+ unit.setCode(installedClasses.get(unit.getUnitClassName()));
+- }
+-
+- if (!compiler.isOnDemandCompilation()) {
+- // Initialize functions
+- final Map<Integer, FunctionInitializer> initializers = compiler.getFunctionInitializers();
+- if (initializers != null) {
+- for (final Entry<Integer, FunctionInitializer> entry : initializers.entrySet()) {
+- final FunctionInitializer initializer = entry.getValue();
+- initializer.setCode(installedClasses.get(initializer.getClassName()));
+- compiler.getScriptFunctionData(entry.getKey()).initializeCode(initializer);
+- }
+- }
++ unit.initializeFunctionsCode();
+ }
+
+ if (log.isEnabled()) {
+--- ./nashorn/src/jdk/nashorn/internal/codegen/CompileUnit.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/CompileUnit.java Wed Jul 01 21:54:30 2015 -0700
+@@ -26,9 +26,16 @@
+ package jdk.nashorn.internal.codegen;
+
+ import java.io.Serializable;
++import java.util.Collection;
++import java.util.Collections;
++import java.util.IdentityHashMap;
++import java.util.Map;
++import java.util.Objects;
+ import java.util.Set;
+ import java.util.TreeSet;
+ import jdk.nashorn.internal.ir.CompileUnitHolder;
++import jdk.nashorn.internal.ir.FunctionNode;
++import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData;
+
+ /**
+ * Used to track split class compilation. Note that instances of the class are serializable, but all fields are
+@@ -49,6 +56,8 @@
+
+ private transient Class<?> clazz;
+
++ private transient Map<FunctionNode, RecompilableScriptFunctionData> functions = new IdentityHashMap<>();
++
+ private transient boolean isUsed;
+
+ private static int emittedUnitCount;
+@@ -113,13 +122,38 @@
+ * @param clazz class with code for this compile unit
+ */
+ void setCode(final Class<?> clazz) {
+- clazz.getClass(); // null check
+- this.clazz = clazz;
++ this.clazz = Objects.requireNonNull(clazz);
+ // Revisit this - refactor to avoid null-ed out non-final fields
+ // null out emitter
+ this.classEmitter = null;
+ }
+
++ void addFunctionInitializer(final RecompilableScriptFunctionData data, final FunctionNode functionNode) {
++ functions.put(functionNode, data);
++ }
++
++ /**
++ * Returns true if this compile unit is responsible for initializing the specified function data with specified
++ * function node.
++ * @param data the function data to check
++ * @param functionNode the function node to check
++ * @return true if this unit is responsible for initializing the function data with the function node, otherwise
++ * false
++ */
++ public boolean isInitializing(final RecompilableScriptFunctionData data, final FunctionNode functionNode) {
++ return functions.get(functionNode) == data;
++ }
++
++ void initializeFunctionsCode() {
++ for(final Map.Entry<FunctionNode, RecompilableScriptFunctionData> entry : functions.entrySet()) {
++ entry.getValue().initializeCode(entry.getKey());
++ }
++ }
++
++ Collection<FunctionNode> getFunctionNodes() {
++ return Collections.unmodifiableCollection(functions.keySet());
++ }
++
+ /**
+ * Add weight to this compile unit
+ * @param w weight to add
+--- ./nashorn/src/jdk/nashorn/internal/codegen/Compiler.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/Compiler.java Wed Jul 01 21:54:30 2015 -0700
+@@ -103,7 +103,7 @@
+
+ private final CodeInstaller<ScriptEnvironment> installer;
+
+- /** logger for compiler, trampolines, splits and related code generation events
++ /** logger for compiler, trampolines and related code generation events
+ * that affect classes */
+ private final DebugLogger log;
+
+@@ -565,7 +565,7 @@
+ * @return a copy of this compiler's current mapping of invalidated optimistic program points to their types.
+ */
+ public Map<Integer, Type> getInvalidatedProgramPoints() {
+- return invalidatedProgramPoints == null ? null : new TreeMap<>(invalidatedProgramPoints);
++ return invalidatedProgramPoints.isEmpty() ? null : new TreeMap<>(invalidatedProgramPoints);
+ }
+
+ TypeMap getTypeMap() {
+@@ -704,21 +704,6 @@
+ return sb.toString();
+ }
+
+- Map<Integer, FunctionInitializer> functionInitializers;
+-
+- void addFunctionInitializer(final RecompilableScriptFunctionData functionData, final FunctionNode functionNode) {
+- if (functionInitializers == null) {
+- functionInitializers = new HashMap<>();
+- }
+- if (!functionInitializers.containsKey(functionData)) {
+- functionInitializers.put(functionData.getFunctionNodeId(), new FunctionInitializer(functionNode));
+- }
+- }
+-
+- Map<Integer, FunctionInitializer> getFunctionInitializers() {
+- return functionInitializers;
+- }
+-
+ /**
+ * Persist current compilation with the given {@code cacheKey}.
+ * @param cacheKey cache key
+@@ -726,15 +711,17 @@
+ */
+ public void persistClassInfo(final String cacheKey, final FunctionNode functionNode) {
+ if (cacheKey != null && env._persistent_cache) {
+- Map<Integer, FunctionInitializer> initializers;
+ // If this is an on-demand compilation create a function initializer for the function being compiled.
+ // Otherwise use function initializer map generated by codegen.
+- if (functionInitializers == null) {
+- initializers = new HashMap<>();
+- final FunctionInitializer initializer = new FunctionInitializer(functionNode, getInvalidatedProgramPoints());
+- initializers.put(functionNode.getId(), initializer);
++ Map<Integer, FunctionInitializer> initializers = new HashMap<>();
++ if (isOnDemandCompilation()) {
++ initializers.put(functionNode.getId(), new FunctionInitializer(functionNode, getInvalidatedProgramPoints()));
+ } else {
+- initializers = functionInitializers;
++ for (final CompileUnit compileUnit : getCompileUnits()) {
++ for (final FunctionNode fn : compileUnit.getFunctionNodes()) {
++ initializers.put(fn.getId(), new FunctionInitializer(fn));
++ }
++ }
+ }
+ final String mainClassName = getFirstCompileUnit().getUnitClassName();
+ installer.storeScript(cacheKey, source, mainClassName, bytecode, initializers, constantData.toArray(), compilationId);
+--- ./nashorn/src/jdk/nashorn/internal/codegen/CompilerConstants.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/CompilerConstants.java Wed Jul 01 21:54:30 2015 -0700
+@@ -149,8 +149,11 @@
+ /** Arguments parameter in scope object constructors; in slot 3 when present */
+ INIT_ARGUMENTS(null, 3),
+
+- /** prefix for all ScriptObject subclasses with fields, @see ObjectGenerator */
+- JS_OBJECT_PREFIX("JO"),
++ /** prefix for all ScriptObject subclasses with dual object/primitive fields, see {@link ObjectClassGenerator} */
++ JS_OBJECT_DUAL_FIELD_PREFIX("JD"),
++
++ /** prefix for all ScriptObject subclasses with object fields only, see {@link ObjectClassGenerator} */
++ JS_OBJECT_SINGLE_FIELD_PREFIX("JO"),
+
+ /** name for allocate method in JO objects */
+ ALLOCATE("allocate"),
+--- ./nashorn/src/jdk/nashorn/internal/codegen/Emitter.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,49 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.codegen;
+-
+-/**
+- * Interface for anything that interacts with a low level bytecode
+- * generation module, for example ASM.
+- * <p>
+- * This is pretty generic, i.e. it can be a ClassEmitter, MethodEmitter
+- * or potentially even more fine grained stuff.
+- *
+- */
+-public interface Emitter {
+-
+- /**
+- * Register the start of emission for this CodeEmitter
+- */
+- public void begin();
+-
+- /**
+- * Register the end of emission for this CodeEmitter.
+- * This is typically required before generated code can
+- * be requested from it
+- */
+- public void end();
+-}
+--- ./nashorn/src/jdk/nashorn/internal/codegen/FieldObjectCreator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/FieldObjectCreator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -127,6 +127,8 @@
+ method.invoke(constructorNoLookup(className, PropertyMap.class));
+ }
+
++ helpOptimisticRecognizeDuplicateIdentity(method);
++
+ // Set values.
+ final Iterator<MapTuple<T>> iter = tuples.iterator();
+
+@@ -136,6 +138,7 @@
+ //if we didn't load, we need an array property
+ if (tuple.symbol != null && tuple.value != null) {
+ final int index = getArrayIndex(tuple.key);
++ method.dup();
+ if (!isValidArrayIndex(index)) {
+ putField(method, tuple.key, tuple.symbol.getFieldIndex(), tuple);
+ } else {
+@@ -151,7 +154,7 @@
+ @Override
+ protected PropertyMap makeMap() {
+ assert propertyMap == null : "property map already initialized";
+- propertyMap = newMapCreator(fieldObjectClass).makeFieldMap(hasArguments(), fieldCount, paddedFieldCount, evalCode);
++ propertyMap = newMapCreator(fieldObjectClass).makeFieldMap(hasArguments(), codegen.useDualFields(), fieldCount, paddedFieldCount, evalCode);
+ return propertyMap;
+ }
+
+@@ -164,9 +167,7 @@
+ * @param tuple Tuple to store.
+ */
+ private void putField(final MethodEmitter method, final String key, final int fieldIndex, final MapTuple<T> tuple) {
+- method.dup();
+-
+- final Type fieldType = tuple.isPrimitive() ? PRIMITIVE_FIELD_TYPE : Type.OBJECT;
++ final Type fieldType = codegen.useDualFields() && tuple.isPrimitive() ? PRIMITIVE_FIELD_TYPE : Type.OBJECT;
+ final String fieldClass = getClassName();
+ final String fieldName = getFieldName(fieldIndex, fieldType);
+ final String fieldDesc = typeDescriptor(fieldType.getTypeClass());
+@@ -187,7 +188,6 @@
+ * @param tuple Tuple to store.
+ */
+ private void putSlot(final MethodEmitter method, final long index, final MapTuple<T> tuple) {
+- method.dup();
+ if (JSType.isRepresentableAsInt(index)) {
+ method.load((int)index);
+ } else {
+@@ -202,8 +202,8 @@
+ */
+ private void findClass() {
+ fieldObjectClassName = isScope() ?
+- ObjectClassGenerator.getClassName(fieldCount, paramCount) :
+- ObjectClassGenerator.getClassName(paddedFieldCount);
++ ObjectClassGenerator.getClassName(fieldCount, paramCount, codegen.useDualFields()) :
++ ObjectClassGenerator.getClassName(paddedFieldCount, codegen.useDualFields());
+
+ try {
+ this.fieldObjectClass = Context.forStructureClass(Compiler.binaryName(fieldObjectClassName));
+--- ./nashorn/src/jdk/nashorn/internal/codegen/FindScopeDepths.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/FindScopeDepths.java Wed Jul 01 21:54:30 2015 -0700
+@@ -32,7 +32,6 @@
+ import java.util.Iterator;
+ import java.util.Map;
+ import java.util.Set;
+-import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor;
+ import jdk.nashorn.internal.ir.Block;
+ import jdk.nashorn.internal.ir.FunctionNode;
+ import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
+@@ -208,7 +207,7 @@
+ final RecompilableScriptFunctionData data = new RecompilableScriptFunctionData(
+ newFunctionNode,
+ compiler.getCodeInstaller(),
+- new AllocatorDescriptor(newFunctionNode.getThisProperties()),
++ ObjectClassGenerator.createAllocationStrategy(newFunctionNode.getThisProperties(), compiler.getContext().useDualFields()),
+ nestedFunctions,
+ externalSymbolDepths.get(fnId),
+ internalSymbols.get(fnId),
+--- ./nashorn/src/jdk/nashorn/internal/codegen/Label.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/Label.java Wed Jul 01 21:54:30 2015 -0700
+@@ -333,7 +333,7 @@
+ * @param slot the slot written to
+ * @param onlySymbolLiveValue if true, this is the symbol's only live value, and other values of the symbol
+ * should be marked dead
+- * @param Type the type written to the slot
++ * @param type the type written to the slot
+ */
+ void onLocalStore(final Type type, final int slot, final boolean onlySymbolLiveValue) {
+ if(onlySymbolLiveValue) {
+--- ./nashorn/src/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -40,34 +40,38 @@
+ import java.util.List;
+ import java.util.Map;
+ import java.util.Set;
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.AccessNode;
+-import jdk.nashorn.internal.ir.BaseNode;
+ import jdk.nashorn.internal.ir.BinaryNode;
+ import jdk.nashorn.internal.ir.Block;
+ import jdk.nashorn.internal.ir.BreakNode;
+ import jdk.nashorn.internal.ir.BreakableNode;
++import jdk.nashorn.internal.ir.CallNode;
+ import jdk.nashorn.internal.ir.CaseNode;
+ import jdk.nashorn.internal.ir.CatchNode;
+ import jdk.nashorn.internal.ir.ContinueNode;
+ import jdk.nashorn.internal.ir.Expression;
++import jdk.nashorn.internal.ir.ExpressionStatement;
+ import jdk.nashorn.internal.ir.ForNode;
+ import jdk.nashorn.internal.ir.FunctionNode;
+ import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
++import jdk.nashorn.internal.ir.GetSplitState;
+ import jdk.nashorn.internal.ir.IdentNode;
+ import jdk.nashorn.internal.ir.IfNode;
+ import jdk.nashorn.internal.ir.IndexNode;
+ import jdk.nashorn.internal.ir.JoinPredecessor;
+ import jdk.nashorn.internal.ir.JoinPredecessorExpression;
+ import jdk.nashorn.internal.ir.JumpStatement;
++import jdk.nashorn.internal.ir.JumpToInlinedFinally;
+ import jdk.nashorn.internal.ir.LabelNode;
+ import jdk.nashorn.internal.ir.LexicalContext;
+ import jdk.nashorn.internal.ir.LexicalContextNode;
+ import jdk.nashorn.internal.ir.LiteralNode;
++import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
+ import jdk.nashorn.internal.ir.LocalVariableConversion;
+ import jdk.nashorn.internal.ir.LoopNode;
+ import jdk.nashorn.internal.ir.Node;
++import jdk.nashorn.internal.ir.ObjectNode;
+ import jdk.nashorn.internal.ir.PropertyNode;
+ import jdk.nashorn.internal.ir.ReturnNode;
+ import jdk.nashorn.internal.ir.RuntimeNode;
+@@ -82,6 +86,7 @@
+ import jdk.nashorn.internal.ir.UnaryNode;
+ import jdk.nashorn.internal.ir.VarNode;
+ import jdk.nashorn.internal.ir.WhileNode;
++import jdk.nashorn.internal.ir.WithNode;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+ import jdk.nashorn.internal.parser.TokenType;
+
+@@ -131,8 +136,44 @@
+ OBJECT(Type.OBJECT);
+
+ private final Type type;
++ private final TypeHolderExpression typeExpression;
++
+ private LvarType(final Type type) {
+ this.type = type;
++ this.typeExpression = new TypeHolderExpression(type);
++ }
++ }
++
++ /**
++ * A bogus Expression subclass that only reports its type. Used to interrogate BinaryNode and UnaryNode about their
++ * types by creating temporary copies of them and replacing their operands with instances of these. An alternative
++ * solution would be to add BinaryNode.getType(Type lhsType, Type rhsType) and UnaryNode.getType(Type exprType)
++ * methods. For the time being though, this is easier to implement and is in fact fairly clean. It does result in
++ * generation of higher number of temporary short lived nodes, though.
++ */
++ private static class TypeHolderExpression extends Expression {
++ private static final long serialVersionUID = 1L;
++
++ private final Type type;
++
++ TypeHolderExpression(final Type type) {
++ super(0L, 0, 0);
++ this.type = type;
++ }
++
++ @Override
++ public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
++ throw new AssertionError();
++ }
++
++ @Override
++ public Type getType() {
++ return type;
++ }
++
++ @Override
++ public void toString(final StringBuilder sb, final boolean printType) {
++ throw new AssertionError();
+ }
+ }
+
+@@ -165,7 +206,6 @@
+ // continuations (since RewriteException's byteCodeSlots carries an array and not a name-value map).
+
+ symbolIsConverted(symbol, branchLvarType, targetType);
+- //symbolIsUsed(symbol, branchLvarType);
+ return new LocalVariableConversion(symbol, branchLvarType.type, targetType.type, next);
+ }
+
+@@ -188,7 +228,7 @@
+ for(final Symbol symbol: commonSymbols) {
+ final LvarType type1 = types1.get(symbol);
+ final LvarType type2 = types2.get(symbol);
+- final LvarType widest = widestLvarType(type1, type2);
++ final LvarType widest = widestLvarType(type1, type2);
+ if(widest != type1 && matches1) {
+ matches1 = false;
+ if(!matches2) {
+@@ -201,7 +241,7 @@
+ union = cloneMap(types2);
+ }
+ }
+- if(!(matches1 || matches2) && union != null) { //remove overly enthusiastic "union can be null" warning
++ if(!(matches1 || matches2)) {
+ assert union != null;
+ union.put(symbol, widest);
+ }
+@@ -359,6 +399,8 @@
+ // allocates a new map. Immutability of maps allows for cheap snapshots by just keeping the reference to the current
+ // value.
+ private Map<Symbol, LvarType> localVariableTypes = new IdentityHashMap<>();
++ // Stack for evaluated expression types.
++ private final Deque<LvarType> typeStack = new ArrayDeque<>();
+
+ // Whether the current point in the AST is reachable code
+ private boolean reachable = true;
+@@ -375,8 +417,6 @@
+ private final Map<IdentNode, LvarType> identifierLvarTypes = new IdentityHashMap<>();
+ private final Map<Symbol, SymbolConversions> symbolConversions = new IdentityHashMap<>();
+
+- private SymbolToType symbolToType = new SymbolToType();
+-
+ // Stack of open labels for starts of catch blocks, one for every currently traversed try block; for inserting
+ // control flow edges to them. Note that we currently don't insert actual control flow edges, but instead edges that
+ // help us with type calculations. This means that some operations that can result in an exception being thrown
+@@ -400,62 +440,56 @@
+ private void doesNotContinueSequentially() {
+ reachable = false;
+ localVariableTypes = Collections.emptyMap();
++ assertTypeStackIsEmpty();
+ }
+
++ private boolean pushExpressionType(final Expression expr) {
++ typeStack.push(toLvarType(expr.getType()));
++ return false;
++ }
++
++ @Override
++ public boolean enterAccessNode(final AccessNode accessNode) {
++ visitExpression(accessNode.getBase());
++ return pushExpressionType(accessNode);
++ }
+
+ @Override
+ public boolean enterBinaryNode(final BinaryNode binaryNode) {
+ // NOTE: regardless of operator's lexical associativity, lhs is always evaluated first.
+ final Expression lhs = binaryNode.lhs();
+- final boolean isAssignment = binaryNode.isAssignment();
+- LvarType lhsTypeOnLoad = null;
+- if(isAssignment) {
+- if(lhs instanceof BaseNode) {
+- ((BaseNode)lhs).getBase().accept(this);
+- if(lhs instanceof IndexNode) {
+- ((IndexNode)lhs).getIndex().accept(this);
+- } else {
+- assert lhs instanceof AccessNode;
+- }
+- } else {
+- assert lhs instanceof IdentNode;
+- if(binaryNode.isSelfModifying()) {
+- final IdentNode ident = ((IdentNode)lhs);
+- ident.accept(this);
+- // Self-assignment can cause a change in the type of the variable. For purposes of evaluating
+- // the type of the operation, we must use its type as it was when it was loaded. If we didn't
+- // do this, some awkward expressions would end up being calculated incorrectly, e.g.
+- // "var x; x += x = 0;". In this case we have undefined+int so the result type is double (NaN).
+- // However, if we used the type of "x" on LHS after we evaluated RHS, we'd see int+int, so the
+- // result type would be either optimistic int or pessimistic long, which would be wrong.
+- lhsTypeOnLoad = getLocalVariableTypeIfBytecode(ident.getSymbol());
+- }
+- }
++ final LvarType lhsType;
++ if (!(lhs instanceof IdentNode && binaryNode.isTokenType(TokenType.ASSIGN))) {
++ lhsType = visitExpression(lhs);
+ } else {
+- lhs.accept(this);
++ // Can't visit IdentNode on LHS of a simple assignment, as visits imply use, and this is def.
++ // The type is irrelevant, as only RHS is used to determine the type anyway.
++ lhsType = LvarType.UNDEFINED;
+ }
+
+ final boolean isLogical = binaryNode.isLogical();
+- assert !(isAssignment && isLogical); // there are no logical assignment operators in JS
+ final Label joinLabel = isLogical ? new Label("") : null;
+ if(isLogical) {
+ jumpToLabel((JoinPredecessor)lhs, joinLabel);
+ }
+
+ final Expression rhs = binaryNode.rhs();
+- rhs.accept(this);
++ final LvarType rhsType = visitExpression(rhs);
+ if(isLogical) {
+ jumpToLabel((JoinPredecessor)rhs, joinLabel);
+ }
+ joinOnLabel(joinLabel);
+
+- if(isAssignment && lhs instanceof IdentNode) {
++ final LvarType type = toLvarType(binaryNode.setOperands(lhsType.typeExpression, rhsType.typeExpression).getType());
++
++ if(binaryNode.isAssignment() && lhs instanceof IdentNode) {
+ if(binaryNode.isSelfModifying()) {
+- onSelfAssignment((IdentNode)lhs, binaryNode, lhsTypeOnLoad);
++ onSelfAssignment((IdentNode)lhs, type);
+ } else {
+- onAssignment((IdentNode)lhs, rhs);
++ onAssignment((IdentNode)lhs, type);
+ }
+ }
++ typeStack.push(type);
+ return false;
+ }
+
+@@ -475,6 +509,17 @@
+ }
+
+ @Override
++ public boolean enterCallNode(final CallNode callNode) {
++ visitExpression(callNode.getFunction());
++ visitExpressions(callNode.getArgs());
++ final CallNode.EvalArgs evalArgs = callNode.getEvalArgs();
++ if (evalArgs != null) {
++ visitExpressions(evalArgs.getArgs());
++ }
++ return pushExpressionType(callNode);
++ }
++
++ @Override
+ public boolean enterContinueNode(final ContinueNode continueNode) {
+ return enterJumpStatement(continueNode);
+ }
+@@ -483,8 +528,8 @@
+ if(!reachable) {
+ return false;
+ }
+- final BreakableNode target = jump.getTarget(lc);
+- jumpToLabel(jump, jump.getTargetLabel(target), getBreakTargetTypes(target));
++ assertTypeStackIsEmpty();
++ jumpToLabel(jump, jump.getTargetLabel(lc), getBreakTargetTypes(jump.getPopScopeLimit(lc)));
+ doesNotContinueSequentially();
+ return false;
+ }
+@@ -495,6 +540,7 @@
+ }
+
+ private void enterDoWhileLoop(final WhileNode loopNode) {
++ assertTypeStackIsEmpty();
+ final JoinPredecessorExpression test = loopNode.getTest();
+ final Block body = loopNode.getBody();
+ final Label continueLabel = loopNode.getContinueLabel();
+@@ -512,7 +558,7 @@
+ if(!reachable) {
+ break;
+ }
+- test.accept(this);
++ visitExpressionOnEmptyStack(test);
+ jumpToLabel(test, breakLabel);
+ if(isAlwaysFalse(test)) {
+ break;
+@@ -535,6 +581,45 @@
+ }
+
+ @Override
++ public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
++ if (reachable) {
++ visitExpressionOnEmptyStack(expressionStatement.getExpression());
++ }
++ return false;
++ }
++
++ private void assertTypeStackIsEmpty() {
++ assert typeStack.isEmpty();
++ }
++
++ @Override
++ protected Node leaveDefault(final Node node) {
++ assert !(node instanceof Expression); // All expressions were handled
++ assert !(node instanceof Statement) || typeStack.isEmpty(); // No statements leave with a non-empty stack
++ return node;
++ }
++
++ private LvarType visitExpressionOnEmptyStack(final Expression expr) {
++ assertTypeStackIsEmpty();
++ return visitExpression(expr);
++ }
++
++ private LvarType visitExpression(final Expression expr) {
++ final int stackSize = typeStack.size();
++ expr.accept(this);
++ assert typeStack.size() == stackSize + 1;
++ return typeStack.pop();
++ }
++
++ private void visitExpressions(final List<Expression> exprs) {
++ for(final Expression expr: exprs) {
++ if (expr != null) {
++ visitExpression(expr);
++ }
++ }
++ }
++
++ @Override
+ public boolean enterForNode(final ForNode forNode) {
+ if(!reachable) {
+ return false;
+@@ -543,7 +628,7 @@
+ final Expression init = forNode.getInit();
+ if(forNode.isForIn()) {
+ final JoinPredecessorExpression iterable = forNode.getModify();
+- iterable.accept(this);
++ visitExpression(iterable);
+ enterTestFirstLoop(forNode, null, init,
+ // If we're iterating over property names, and we can discern from the runtime environment
+ // of the compilation that the object being iterated over must use strings for property
+@@ -552,16 +637,18 @@
+ !compiler.useOptimisticTypes() || (!forNode.isForEach() && compiler.hasStringPropertyIterator(iterable.getExpression())));
+ } else {
+ if(init != null) {
+- init.accept(this);
++ visitExpressionOnEmptyStack(init);
+ }
+ enterTestFirstLoop(forNode, forNode.getModify(), null, false);
+ }
++ assertTypeStackIsEmpty();
+ return false;
+ }
+
+ @Override
+ public boolean enterFunctionNode(final FunctionNode functionNode) {
+ if(alreadyEnteredTopLevelFunction) {
++ typeStack.push(LvarType.OBJECT);
+ return false;
+ }
+ int pos = 0;
+@@ -603,76 +690,136 @@
+ }
+
+ @Override
++ public boolean enterGetSplitState(final GetSplitState getSplitState) {
++ return pushExpressionType(getSplitState);
++ }
++
++ @Override
+ public boolean enterIdentNode(final IdentNode identNode) {
+ final Symbol symbol = identNode.getSymbol();
+ if(symbol.isBytecodeLocal()) {
+ symbolIsUsed(symbol);
+- setIdentifierLvarType(identNode, getLocalVariableType(symbol));
++ final LvarType type = getLocalVariableType(symbol);
++ setIdentifierLvarType(identNode, type);
++ typeStack.push(type);
++ } else {
++ pushExpressionType(identNode);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean enterIfNode(final IfNode ifNode) {
++ processIfNode(ifNode);
++ return false;
++ }
++
++ private void processIfNode(final IfNode ifNode) {
+ if(!reachable) {
+- return false;
++ return;
+ }
+
+ final Expression test = ifNode.getTest();
+ final Block pass = ifNode.getPass();
+ final Block fail = ifNode.getFail();
+
+- test.accept(this);
++ visitExpressionOnEmptyStack(test);
+
+- final Map<Symbol, LvarType> afterTestLvarTypes = localVariableTypes;
+- if(!isAlwaysFalse(test)) {
++ final Map<Symbol, LvarType> passLvarTypes;
++ final boolean reachableFromPass;
++ final boolean isTestAlwaysTrue = isAlwaysTrue(test);
++ if(isAlwaysFalse(test)) {
++ passLvarTypes = null;
++ reachableFromPass = false;
++ } else {
++ final Map<Symbol, LvarType> afterTestLvarTypes = localVariableTypes;
+ pass.accept(this);
+- }
+- final Map<Symbol, LvarType> passLvarTypes = localVariableTypes;
+- final boolean reachableFromPass = reachable;
+-
+- reachable = true;
+- localVariableTypes = afterTestLvarTypes;
+- if(!isAlwaysTrue(test) && fail != null) {
+- fail.accept(this);
+- final boolean reachableFromFail = reachable;
+- reachable |= reachableFromPass;
+- if(!reachable) {
+- return false;
++ assertTypeStackIsEmpty();
++ if (isTestAlwaysTrue) {
++ return;
+ }
+-
+- if(reachableFromFail) {
+- if(reachableFromPass) {
+- final Map<Symbol, LvarType> failLvarTypes = localVariableTypes;
+- localVariableTypes = getUnionTypes(passLvarTypes, failLvarTypes);
+- setConversion(pass, passLvarTypes, localVariableTypes);
+- setConversion(fail, failLvarTypes, localVariableTypes);
+- }
+- return false;
+- }
++ passLvarTypes = localVariableTypes;
++ reachableFromPass = reachable;
++ localVariableTypes = afterTestLvarTypes;
++ reachable = true;
+ }
+
+- if(reachableFromPass) {
+- localVariableTypes = getUnionTypes(afterTestLvarTypes, passLvarTypes);
+- // IfNode itself is associated with conversions that might need to be performed after the test if there's no
+- // else branch. E.g.
+- // if(x = 1, cond) { x = 1.0 } must widen "x = 1" to a double.
+- setConversion(pass, passLvarTypes, localVariableTypes);
+- setConversion(ifNode, afterTestLvarTypes, localVariableTypes);
+- } else {
+- localVariableTypes = afterTestLvarTypes;
++ // If we get here, then we need to consider the case where pass block is not executed
++ assert !isTestAlwaysTrue;
++
++ if (fail != null) {
++ fail.accept(this);
++ assertTypeStackIsEmpty();
+ }
+
++ if(reachable) {
++ if(reachableFromPass) {
++ final Map<Symbol, LvarType> failLvarTypes = localVariableTypes;
++ localVariableTypes = getUnionTypes(passLvarTypes, failLvarTypes);
++ setConversion(pass, passLvarTypes, localVariableTypes);
++ // IfNode itself is associated with conversions that might need to be performed after the test if
++ // there's no else branch. E.g.
++ // if(x = 1, cond) { x = 1.0 } must widen "x = 1" to a double.
++ setConversion(fail != null ? fail : ifNode, failLvarTypes, localVariableTypes);
++ }
++ } else if (reachableFromPass) {
++ assert passLvarTypes != null;
++ localVariableTypes = passLvarTypes;
++ reachable = true;
++ }
++ }
++
++ @Override
++ public boolean enterIndexNode(final IndexNode indexNode) {
++ visitExpression(indexNode.getBase());
++ visitExpression(indexNode.getIndex());
++ return pushExpressionType(indexNode);
++ }
++
++ @Override
++ public boolean enterJoinPredecessorExpression(final JoinPredecessorExpression joinExpr) {
++ final Expression expr = joinExpr.getExpression();
++ if (expr != null) {
++ expr.accept(this);
++ } else {
++ typeStack.push(LvarType.UNDEFINED);
++ }
+ return false;
+ }
+
+ @Override
++ public boolean enterJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) {
++ return enterJumpStatement(jumpToInlinedFinally);
++ }
++
++ @Override
++ public boolean enterLiteralNode(final LiteralNode<?> literalNode) {
++ if (literalNode instanceof ArrayLiteralNode) {
++ final List<Expression> expressions = ((ArrayLiteralNode)literalNode).getElementExpressions();
++ if (expressions != null) {
++ visitExpressions(expressions);
++ }
++ }
++ pushExpressionType(literalNode);
++ return false;
++ }
++
++ @Override
++ public boolean enterObjectNode(final ObjectNode objectNode) {
++ for(final PropertyNode propertyNode: objectNode.getElements()) {
++ // Avoid falsely adding property keys to the control flow graph
++ final Expression value = propertyNode.getValue();
++ if (value != null) {
++ visitExpression(value);
++ }
++ }
++ return pushExpressionType(objectNode);
++ }
++
++ @Override
+ public boolean enterPropertyNode(final PropertyNode propertyNode) {
+- // Avoid falsely adding property keys to the control flow graph
+- if(propertyNode.getValue() != null) {
+- propertyNode.getValue().accept(this);
+- }
+- return false;
++ // Property nodes are only accessible through object literals, and we handled that case above
++ throw new AssertionError();
+ }
+
+ @Override
+@@ -684,9 +831,9 @@
+ final Expression returnExpr = returnNode.getExpression();
+ final Type returnExprType;
+ if(returnExpr != null) {
+- returnExpr.accept(this);
+- returnExprType = getType(returnExpr);
++ returnExprType = visitExpressionOnEmptyStack(returnExpr).type;
+ } else {
++ assertTypeStackIsEmpty();
+ returnExprType = Type.UNDEFINED;
+ }
+ returnType = Type.widestReturnType(returnType, returnExprType);
+@@ -695,6 +842,12 @@
+ }
+
+ @Override
++ public boolean enterRuntimeNode(final RuntimeNode runtimeNode) {
++ visitExpressions(runtimeNode.getArgs());
++ return pushExpressionType(runtimeNode);
++ }
++
++ @Override
+ public boolean enterSplitReturn(final SplitReturn splitReturn) {
+ doesNotContinueSequentially();
+ return false;
+@@ -706,8 +859,7 @@
+ return false;
+ }
+
+- final Expression expr = switchNode.getExpression();
+- expr.accept(this);
++ visitExpressionOnEmptyStack(switchNode.getExpression());
+
+ final List<CaseNode> cases = switchNode.getCases();
+ if(cases.isEmpty()) {
+@@ -724,7 +876,7 @@
+ for(final CaseNode caseNode: cases) {
+ final Expression test = caseNode.getTest();
+ if(!isInteger && test != null) {
+- test.accept(this);
++ visitExpressionOnEmptyStack(test);
+ if(!tagUsed) {
+ symbolIsUsed(switchNode.getTag(), LvarType.OBJECT);
+ tagUsed = true;
+@@ -769,29 +921,42 @@
+ final Expression trueExpr = ternaryNode.getTrueExpression();
+ final Expression falseExpr = ternaryNode.getFalseExpression();
+
+- test.accept(this);
++ visitExpression(test);
+
+ final Map<Symbol, LvarType> testExitLvarTypes = localVariableTypes;
++ final LvarType trueType;
+ if(!isAlwaysFalse(test)) {
+- trueExpr.accept(this);
++ trueType = visitExpression(trueExpr);
++ } else {
++ trueType = null;
+ }
+ final Map<Symbol, LvarType> trueExitLvarTypes = localVariableTypes;
+ localVariableTypes = testExitLvarTypes;
++ final LvarType falseType;
+ if(!isAlwaysTrue(test)) {
+- falseExpr.accept(this);
++ falseType = visitExpression(falseExpr);
++ } else {
++ falseType = null;
+ }
+ final Map<Symbol, LvarType> falseExitLvarTypes = localVariableTypes;
+ localVariableTypes = getUnionTypes(trueExitLvarTypes, falseExitLvarTypes);
+ setConversion((JoinPredecessor)trueExpr, trueExitLvarTypes, localVariableTypes);
+ setConversion((JoinPredecessor)falseExpr, falseExitLvarTypes, localVariableTypes);
++
++ typeStack.push(trueType != null ? falseType != null ? widestLvarType(trueType, falseType) : trueType : assertNotNull(falseType));
+ return false;
+ }
+
++ private static <T> T assertNotNull(final T t) {
++ assert t != null;
++ return t;
++ }
++
+ private void enterTestFirstLoop(final LoopNode loopNode, final JoinPredecessorExpression modify,
+ final Expression iteratorValues, final boolean iteratorValuesAreObject) {
+ final JoinPredecessorExpression test = loopNode.getTest();
+ if(isAlwaysFalse(test)) {
+- test.accept(this);
++ visitExpressionOnEmptyStack(test);
+ return;
+ }
+
+@@ -804,7 +969,7 @@
+ jumpToLabel(loopNode, repeatLabel, beforeLoopTypes);
+ final Map<Symbol, LvarType> beforeRepeatTypes = localVariableTypes;
+ if(test != null) {
+- test.accept(this);
++ visitExpressionOnEmptyStack(test);
+ }
+ if(!isAlwaysTrue(test)) {
+ jumpToLabel(test, breakLabel);
+@@ -827,7 +992,7 @@
+ break;
+ }
+ if(modify != null) {
+- modify.accept(this);
++ visitExpressionOnEmptyStack(modify);
+ jumpToLabel(modify, repeatLabel);
+ joinOnLabel(repeatLabel);
+ }
+@@ -853,7 +1018,7 @@
+ return false;
+ }
+
+- throwNode.getExpression().accept(this);
++ visitExpressionOnEmptyStack(throwNode.getExpression());
+ jumpToCatchBlock(throwNode);
+ doesNotContinueSequentially();
+ return false;
+@@ -886,13 +1051,24 @@
+ }
+ doesNotContinueSequentially();
+
++ for (final Block inlinedFinally : tryNode.getInlinedFinallies()) {
++ final Block finallyBody = TryNode.getLabelledInlinedFinallyBlock(inlinedFinally);
++ joinOnLabel(finallyBody.getEntryLabel());
++ // NOTE: the jump to inlined finally can end up in dead code, so it is not necessarily reachable.
++ if (reachable) {
++ finallyBody.accept(this);
++ // All inlined finallies end with a jump or a return
++ assert !reachable;
++ }
++ }
++
+ joinOnLabel(catchLabel);
+ for(final CatchNode catchNode: tryNode.getCatches()) {
+ final IdentNode exception = catchNode.getException();
+ onAssignment(exception, LvarType.OBJECT);
+ final Expression condition = catchNode.getExceptionCondition();
+ if(condition != null) {
+- condition.accept(this);
++ visitExpression(condition);
+ }
+ final Map<Symbol, LvarType> afterConditionTypes = localVariableTypes;
+ final Block catchBody = catchNode.getBody();
+@@ -927,14 +1103,11 @@
+ @Override
+ public boolean enterUnaryNode(final UnaryNode unaryNode) {
+ final Expression expr = unaryNode.getExpression();
+- expr.accept(this);
+-
+- if(unaryNode.isSelfModifying()) {
+- if(expr instanceof IdentNode) {
+- final IdentNode ident = (IdentNode)expr;
+- onSelfAssignment(ident, unaryNode, getLocalVariableTypeIfBytecode(ident.getSymbol()));
+- }
++ final LvarType unaryType = toLvarType(unaryNode.setExpression(visitExpression(expr).typeExpression).getType());
++ if(unaryNode.isSelfModifying() && expr instanceof IdentNode) {
++ onSelfAssignment((IdentNode)expr, unaryType);
+ }
++ typeStack.push(unaryType);
+ return false;
+ }
+
+@@ -945,8 +1118,7 @@
+ }
+ final Expression init = varNode.getInit();
+ if(init != null) {
+- init.accept(this);
+- onAssignment(varNode.getName(), init);
++ onAssignment(varNode.getName(), visitExpression(init));
+ }
+ return false;
+ }
+@@ -964,7 +1136,16 @@
+ return false;
+ }
+
+- private Map<Symbol, LvarType> getBreakTargetTypes(final BreakableNode target) {
++ @Override
++ public boolean enterWithNode(final WithNode withNode) {
++ if (reachable) {
++ visitExpression(withNode.getExpression());
++ withNode.getBody().accept(this);
++ }
++ return false;
++ };
++
++ private Map<Symbol, LvarType> getBreakTargetTypes(final LexicalContextNode target) {
+ // Remove symbols defined in the the blocks that are being broken out of.
+ Map<Symbol, LvarType> types = localVariableTypes;
+ for(final Iterator<LexicalContextNode> it = lc.getAllNodes(); it.hasNext();) {
+@@ -1002,18 +1183,6 @@
+ }
+
+ /**
+- * Gets the type for a local variable if it is a bytecode local, otherwise null. Can be used in circumstances where
+- * the type is irrelevant if the symbol is not a bytecode local. Note that for bytecode locals, it delegates to
+- * {@link #getLocalVariableType(Symbol)}, so it will still assert that the type for such variable is already
+- * defined (that is, not null).
+- * @param symbol the symbol representing the variable.
+- * @return the current variable type, if it is a bytecode local, otherwise null.
+- */
+- private LvarType getLocalVariableTypeIfBytecode(final Symbol symbol) {
+- return symbol.isBytecodeLocal() ? getLocalVariableType(symbol) : null;
+- }
+-
+- /**
+ * Gets the type for a variable represented by a symbol, or null if the type is not know. This is the least strict
+ * of all local variable type getters, and as such its use is discouraged except in initialization scenarios (where
+ * a just-defined symbol might still be null).
+@@ -1154,6 +1323,7 @@
+ */
+ private void leaveBreakable(final BreakableNode breakable) {
+ joinOnLabel(breakable.getBreakLabel());
++ assertTypeStackIsEmpty();
+ }
+
+ @Override
+@@ -1193,8 +1363,6 @@
+ final Expression lhs = binaryNode.lhs();
+ final Expression rhs = binaryNode.rhs();
+
+- Type cmpWidest = Type.widest(lhs.getType(), rhs.getType());
+- boolean newRuntimeNode = false, finalized = false;
+ final TokenType tt = binaryNode.tokenType();
+ switch (tt) {
+ case EQ_STRICT:
+@@ -1207,14 +1375,12 @@
+ }
+ // Specialize comparison of boolean with non-boolean
+ if (lhs.getType().isBoolean() != rhs.getType().isBoolean()) {
+- newRuntimeNode = true;
+- cmpWidest = Type.OBJECT;
+- finalized = true;
++ return new RuntimeNode(binaryNode);
+ }
+ // fallthrough
+ default:
+- if (newRuntimeNode || cmpWidest.isObject()) {
+- return new RuntimeNode(binaryNode).setIsFinal(finalized);
++ if (lhs.getType().isObject() && rhs.getType().isObject()) {
++ return new RuntimeNode(binaryNode);
+ }
+ }
+ } else if(binaryNode.isOptimisticUndecidedType()) {
+@@ -1230,7 +1396,11 @@
+ if(node instanceof JoinPredecessor) {
+ final JoinPredecessor original = joinPredecessors.pop();
+ assert original.getClass() == node.getClass() : original.getClass().getName() + "!=" + node.getClass().getName();
+- return (Node)setLocalVariableConversion(original, (JoinPredecessor)node);
++ final JoinPredecessor newNode = setLocalVariableConversion(original, (JoinPredecessor)node);
++ if (newNode instanceof LexicalContextNode) {
++ lc.replace((LexicalContextNode)node, (LexicalContextNode)newNode);
++ }
++ return (Node)newNode;
+ }
+ return node;
+ }
+@@ -1329,10 +1499,6 @@
+ return conv == null || !conv.isLive();
+ }
+
+- private void onAssignment(final IdentNode identNode, final Expression rhs) {
+- onAssignment(identNode, toLvarType(getType(rhs)));
+- }
+-
+ private void onAssignment(final IdentNode identNode, final LvarType type) {
+ final Symbol symbol = identNode.getSymbol();
+ assert symbol != null : identNode.getName();
+@@ -1400,13 +1566,12 @@
+ jumpToCatchBlock(identNode);
+ }
+
+- private void onSelfAssignment(final IdentNode identNode, final Expression assignment, final LvarType typeOnLoad) {
++ private void onSelfAssignment(final IdentNode identNode, final LvarType type) {
+ final Symbol symbol = identNode.getSymbol();
+ assert symbol != null : identNode.getName();
+ if(!symbol.isBytecodeLocal()) {
+ return;
+ }
+- final LvarType type = toLvarType(getType(assignment, symbol, typeOnLoad.type));
+ // Self-assignment never produce either a boolean or undefined
+ assert type != null && type != LvarType.UNDEFINED && type != LvarType.BOOLEAN;
+ setType(symbol, type);
+@@ -1466,7 +1631,6 @@
+ * @param symbol the symbol representing the variable
+ * @param type the type
+ */
+- @SuppressWarnings("unused")
+ private void setType(final Symbol symbol, final LvarType type) {
+ if(getLocalVariableTypeOrNull(symbol) == type) {
+ return;
+@@ -1486,77 +1650,4 @@
+ private void symbolIsUsed(final Symbol symbol) {
+ symbolIsUsed(symbol, getLocalVariableType(symbol));
+ }
+-
+- /**
+- * Gets the type of the expression, dependent on the current types of the local variables.
+- *
+- * @param expr the expression
+- * @return the current type of the expression dependent on the current types of the local variables.
+- */
+- private Type getType(final Expression expr) {
+- return expr.getType(getSymbolToType());
+- }
+-
+- /**
+- * Returns a function object from symbols to their types, used by the expressions to evaluate their type.
+- * {@link BinaryNode} specifically uses identity of the function to cache type calculations. This method makes
+- * sure to return the same function object while the local variable types don't change, and create a new function
+- * object if the local variable types have been changed.
+- * @return a function object representing a mapping from symbols to their types.
+- */
+- private Function<Symbol, Type> getSymbolToType() {
+- if(symbolToType.isStale()) {
+- symbolToType = new SymbolToType();
+- }
+- return symbolToType;
+- }
+-
+- private class SymbolToType implements Function<Symbol, Type> {
+- private final Object boundTypes = localVariableTypes;
+- @Override
+- public Type apply(final Symbol t) {
+- return getLocalVariableType(t).type;
+- }
+-
+- boolean isStale() {
+- return boundTypes != localVariableTypes;
+- }
+- }
+-
+- /**
+- * Gets the type of the expression, dependent on the current types of the local variables and a single overridden
+- * symbol type. Used by type calculation on compound operators to ensure the type of the LHS at the time it was
+- * loaded (which can potentially be different after RHS evaluation, e.g. "var x; x += x = 0;") is preserved for
+- * the calculation.
+- *
+- * @param expr the expression
+- * @param overriddenSymbol the overridden symbol
+- * @param overriddenType the overridden type
+- * @return the current type of the expression dependent on the current types of the local variables and the single
+- * potentially overridden type.
+- */
+- private Type getType(final Expression expr, final Symbol overriddenSymbol, final Type overriddenType) {
+- return expr.getType(getSymbolToType(overriddenSymbol, overriddenType));
+- }
+-
+- private Function<Symbol, Type> getSymbolToType(final Symbol overriddenSymbol, final Type overriddenType) {
+- return getLocalVariableType(overriddenSymbol).type == overriddenType ? getSymbolToType() :
+- new SymbolToTypeOverride(overriddenSymbol, overriddenType);
+- }
+-
+- private class SymbolToTypeOverride implements Function<Symbol, Type> {
+- private final Function<Symbol, Type> originalSymbolToType = getSymbolToType();
+- private final Symbol overriddenSymbol;
+- private final Type overriddenType;
+-
+- SymbolToTypeOverride(final Symbol overriddenSymbol, final Type overriddenType) {
+- this.overriddenSymbol = overriddenSymbol;
+- this.overriddenType = overriddenType;
+- }
+-
+- @Override
+- public Type apply(final Symbol symbol) {
+- return symbol == overriddenSymbol ? overriddenType : originalSymbolToType.apply(symbol);
+- }
+- }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/codegen/Lower.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/Lower.java Wed Jul 01 21:54:30 2015 -0700
+@@ -56,9 +56,11 @@
+ import jdk.nashorn.internal.ir.IfNode;
+ import jdk.nashorn.internal.ir.IndexNode;
+ import jdk.nashorn.internal.ir.JumpStatement;
++import jdk.nashorn.internal.ir.JumpToInlinedFinally;
+ import jdk.nashorn.internal.ir.LabelNode;
+ import jdk.nashorn.internal.ir.LexicalContext;
+ import jdk.nashorn.internal.ir.LiteralNode;
++import jdk.nashorn.internal.ir.LiteralNode.PrimitiveLiteralNode;
+ import jdk.nashorn.internal.ir.LoopNode;
+ import jdk.nashorn.internal.ir.Node;
+ import jdk.nashorn.internal.ir.ReturnNode;
+@@ -115,7 +117,7 @@
+ for (final Statement statement : statements) {
+ if (!terminated) {
+ newStatements.add(statement);
+- if (statement.isTerminal() || statement instanceof BreakNode || statement instanceof ContinueNode) { //TODO hasGoto? But some Loops are hasGoto too - why?
++ if (statement.isTerminal() || statement instanceof JumpStatement) { //TODO hasGoto? But some Loops are hasGoto too - why?
+ terminated = true;
+ }
+ } else {
+@@ -183,6 +185,12 @@
+ }
+
+ @Override
++ public boolean enterJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) {
++ addStatement(jumpToInlinedFinally);
++ return false;
++ }
++
++ @Override
+ public boolean enterEmptyNode(final EmptyNode emptyNode) {
+ return false;
+ }
+@@ -192,7 +200,7 @@
+ final String name = getConstantPropertyName(indexNode.getIndex());
+ if (name != null) {
+ // If index node is a constant property name convert index node to access node.
+- assert Token.descType(indexNode.getToken()) == TokenType.LBRACKET;
++ assert indexNode.isIndex();
+ return new AccessNode(indexNode.getToken(), indexNode.getFinish(), indexNode.getBase(), name);
+ }
+ return super.leaveIndexNode(indexNode);
+@@ -318,8 +326,9 @@
+ return addStatement(throwNode); //ThrowNodes are always terminal, marked as such in constructor
+ }
+
+- private static Node ensureUniqueNamesIn(final Node node) {
+- return node.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
++ @SuppressWarnings("unchecked")
++ private static <T extends Node> T ensureUniqueNamesIn(final T node) {
++ return (T)node.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
+ @Override
+ public Node leaveFunctionNode(final FunctionNode functionNode) {
+ final String name = functionNode.getName();
+@@ -333,15 +342,15 @@
+ });
+ }
+
+- private static List<Statement> copyFinally(final Block finallyBody) {
++ private static Block createFinallyBlock(final Block finallyBody) {
+ final List<Statement> newStatements = new ArrayList<>();
+ for (final Statement statement : finallyBody.getStatements()) {
+- newStatements.add((Statement)ensureUniqueNamesIn(statement));
++ newStatements.add(statement);
+ if (statement.hasTerminalFlags()) {
+- return newStatements;
++ break;
+ }
+ }
+- return newStatements;
++ return finallyBody.setStatements(null, newStatements);
+ }
+
+ private Block catchAllBlock(final TryNode tryNode) {
+@@ -367,28 +376,24 @@
+ return new IdentNode(functionNode.getToken(), functionNode.getFinish(), cc.symbolName());
+ }
+
+- private static boolean isTerminal(final List<Statement> statements) {
+- return !statements.isEmpty() && statements.get(statements.size() - 1).hasTerminalFlags();
++ private static boolean isTerminalFinally(final Block finallyBlock) {
++ return finallyBlock.getLastStatement().hasTerminalFlags();
+ }
+
+ /**
+ * Splice finally code into all endpoints of a trynode
+ * @param tryNode the try node
+- * @param rethrows list of rethrowing throw nodes from synthetic catch blocks
++ * @param rethrow the rethrowing throw nodes from the synthetic catch block
+ * @param finallyBody the code in the original finally block
+ * @return new try node after splicing finally code (same if nop)
+ */
+- private Node spliceFinally(final TryNode tryNode, final List<ThrowNode> rethrows, final Block finallyBody) {
++ private TryNode spliceFinally(final TryNode tryNode, final ThrowNode rethrow, final Block finallyBody) {
+ assert tryNode.getFinallyBody() == null;
+
++ final Block finallyBlock = createFinallyBlock(finallyBody);
++ final ArrayList<Block> inlinedFinallies = new ArrayList<>();
++ final FunctionNode fn = lc.getCurrentFunction();
+ final TryNode newTryNode = (TryNode)tryNode.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
+- final List<Node> insideTry = new ArrayList<>();
+-
+- @Override
+- public boolean enterDefault(final Node node) {
+- insideTry.add(node);
+- return true;
+- }
+
+ @Override
+ public boolean enterFunctionNode(final FunctionNode functionNode) {
+@@ -398,12 +403,8 @@
+
+ @Override
+ public Node leaveThrowNode(final ThrowNode throwNode) {
+- if (rethrows.contains(throwNode)) {
+- final List<Statement> newStatements = copyFinally(finallyBody);
+- if (!isTerminal(newStatements)) {
+- newStatements.add(throwNode);
+- }
+- return BlockStatement.createReplacement(throwNode, newStatements);
++ if (rethrow == throwNode) {
++ return new BlockStatement(prependFinally(finallyBlock, throwNode));
+ }
+ return throwNode;
+ }
+@@ -419,58 +420,94 @@
+ }
+
+ private Node leaveJumpStatement(final JumpStatement jump) {
+- return copy(jump, (Node)jump.getTarget(Lower.this.lc));
++ // NOTE: leaveJumpToInlinedFinally deliberately does not delegate to this method, only break and
++ // continue are edited. JTIF nodes should not be changed, rather the surroundings of
++ // break/continue/return that were moved into the inlined finally block itself will be changed.
++
++ // If this visitor's lc doesn't find the target of the jump, it means it's external to the try block.
++ if (jump.getTarget(lc) == null) {
++ return createJumpToInlinedFinally(fn, inlinedFinallies, prependFinally(finallyBlock, jump));
++ }
++ return jump;
+ }
+
+ @Override
+ public Node leaveReturnNode(final ReturnNode returnNode) {
+- final Expression expr = returnNode.getExpression();
+- final List<Statement> newStatements = new ArrayList<>();
+-
+- final Expression resultNode;
+- if (expr != null) {
+- //we need to evaluate the result of the return in case it is complex while
+- //still in the try block, store it in a result value and return it afterwards
+- resultNode = new IdentNode(Lower.this.compilerConstant(RETURN));
+- newStatements.add(new ExpressionStatement(returnNode.getLineNumber(), returnNode.getToken(), returnNode.getFinish(), new BinaryNode(Token.recast(returnNode.getToken(), TokenType.ASSIGN), resultNode, expr)));
++ final Expression expr = returnNode.getExpression();
++ if (isTerminalFinally(finallyBlock)) {
++ if (expr == null) {
++ // Terminal finally; no return expression.
++ return createJumpToInlinedFinally(fn, inlinedFinallies, ensureUniqueNamesIn(finallyBlock));
++ }
++ // Terminal finally; has a return expression.
++ final List<Statement> newStatements = new ArrayList<>(2);
++ final int retLineNumber = returnNode.getLineNumber();
++ final long retToken = returnNode.getToken();
++ // Expression is evaluated for side effects.
++ newStatements.add(new ExpressionStatement(retLineNumber, retToken, returnNode.getFinish(), expr));
++ newStatements.add(createJumpToInlinedFinally(fn, inlinedFinallies, ensureUniqueNamesIn(finallyBlock)));
++ return new BlockStatement(retLineNumber, new Block(retToken, finallyBlock.getFinish(), newStatements));
++ } else if (expr == null || expr instanceof PrimitiveLiteralNode<?> || (expr instanceof IdentNode && RETURN.symbolName().equals(((IdentNode)expr).getName()))) {
++ // Nonterminal finally; no return expression, or returns a primitive literal, or returns :return.
++ // Just move the return expression into the finally block.
++ return createJumpToInlinedFinally(fn, inlinedFinallies, prependFinally(finallyBlock, returnNode));
+ } else {
+- resultNode = null;
++ // We need to evaluate the result of the return in case it is complex while still in the try block,
++ // store it in :return, and return it afterwards.
++ final List<Statement> newStatements = new ArrayList<>();
++ final int retLineNumber = returnNode.getLineNumber();
++ final long retToken = returnNode.getToken();
++ final int retFinish = returnNode.getFinish();
++ final Expression resultNode = new IdentNode(expr.getToken(), expr.getFinish(), RETURN.symbolName());
++ // ":return = <expr>;"
++ newStatements.add(new ExpressionStatement(retLineNumber, retToken, retFinish, new BinaryNode(Token.recast(returnNode.getToken(), TokenType.ASSIGN), resultNode, expr)));
++ // inline finally and end it with "return :return;"
++ newStatements.add(createJumpToInlinedFinally(fn, inlinedFinallies, prependFinally(finallyBlock, returnNode.setExpression(resultNode))));
++ return new BlockStatement(retLineNumber, new Block(retToken, retFinish, newStatements));
+ }
+-
+- newStatements.addAll(copyFinally(finallyBody));
+- if (!isTerminal(newStatements)) {
+- newStatements.add(expr == null ? returnNode : returnNode.setExpression(resultNode));
+- }
+-
+- return BlockStatement.createReplacement(returnNode, lc.getCurrentBlock().getFinish(), newStatements);
+- }
+-
+- private Node copy(final Statement endpoint, final Node targetNode) {
+- if (!insideTry.contains(targetNode)) {
+- final List<Statement> newStatements = copyFinally(finallyBody);
+- if (!isTerminal(newStatements)) {
+- newStatements.add(endpoint);
+- }
+- return BlockStatement.createReplacement(endpoint, tryNode.getFinish(), newStatements);
+- }
+- return endpoint;
+ }
+ });
+-
+- addStatement(newTryNode);
+- for (final Node statement : finallyBody.getStatements()) {
+- addStatement((Statement)statement);
+- }
++ addStatement(inlinedFinallies.isEmpty() ? newTryNode : newTryNode.setInlinedFinallies(lc, inlinedFinallies));
++ // TODO: if finallyStatement is terminal, we could just have sites of inlined finallies jump here.
++ addStatement(new BlockStatement(finallyBlock));
+
+ return newTryNode;
+ }
+
++ private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
++ final String labelName = fn.uniqueName(":finally");
++ final long token = finallyBlock.getToken();
++ final int finish = finallyBlock.getFinish();
++ inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
++ token, finish, labelName, finallyBlock)));
++ return new JumpToInlinedFinally(labelName);
++ }
++
++ private static Block prependFinally(final Block finallyBlock, final Statement statement) {
++ final Block inlinedFinally = ensureUniqueNamesIn(finallyBlock);
++ if (isTerminalFinally(finallyBlock)) {
++ return inlinedFinally;
++ }
++ final List<Statement> stmts = inlinedFinally.getStatements();
++ final List<Statement> newStmts = new ArrayList<>(stmts.size() + 1);
++ newStmts.addAll(stmts);
++ newStmts.add(statement);
++ return new Block(inlinedFinally.getToken(), statement.getFinish(), newStmts);
++ }
++
+ @Override
+ public Node leaveTryNode(final TryNode tryNode) {
+ final Block finallyBody = tryNode.getFinallyBody();
++ TryNode newTryNode = tryNode.setFinallyBody(lc, null);
+
+- if (finallyBody == null) {
+- return addStatement(ensureUnconditionalCatch(tryNode));
++ // No finally or empty finally
++ if (finallyBody == null || finallyBody.getStatementCount() == 0) {
++ final List<CatchNode> catches = newTryNode.getCatches();
++ if (catches == null || catches.isEmpty()) {
++ // A completely degenerate try block: empty finally, no catches. Replace it with try body.
++ return addStatement(new BlockStatement(tryNode.getBody()));
++ }
++ return addStatement(ensureUnconditionalCatch(newTryNode));
+ }
+
+ /*
+@@ -496,11 +533,9 @@
+ * now splice in finally code wherever needed
+ *
+ */
+- TryNode newTryNode;
+-
+ final Block catchAll = catchAllBlock(tryNode);
+
+- final List<ThrowNode> rethrows = new ArrayList<>();
++ final List<ThrowNode> rethrows = new ArrayList<>(1);
+ catchAll.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
+ @Override
+ public boolean enterThrowNode(final ThrowNode throwNode) {
+@@ -510,20 +545,18 @@
+ });
+ assert rethrows.size() == 1;
+
+- if (tryNode.getCatchBlocks().isEmpty()) {
+- newTryNode = tryNode.setFinallyBody(null);
+- } else {
+- final Block outerBody = new Block(tryNode.getToken(), tryNode.getFinish(), ensureUnconditionalCatch(tryNode.setFinallyBody(null)));
+- newTryNode = tryNode.setBody(outerBody).setCatchBlocks(null);
++ if (!tryNode.getCatchBlocks().isEmpty()) {
++ final Block outerBody = new Block(newTryNode.getToken(), newTryNode.getFinish(), ensureUnconditionalCatch(newTryNode));
++ newTryNode = newTryNode.setBody(lc, outerBody).setCatchBlocks(lc, null);
+ }
+
+- newTryNode = newTryNode.setCatchBlocks(Arrays.asList(catchAll)).setFinallyBody(null);
++ newTryNode = newTryNode.setCatchBlocks(lc, Arrays.asList(catchAll));
+
+ /*
+ * Now that the transform is done, we have to go into the try and splice
+ * the finally block in front of any statement that is outside the try
+ */
+- return spliceFinally(newTryNode, rethrows, finallyBody);
++ return (TryNode)lc.replace(tryNode, spliceFinally(newTryNode, rethrows.get(0), finallyBody));
+ }
+
+ private TryNode ensureUnconditionalCatch(final TryNode tryNode) {
+@@ -535,7 +568,7 @@
+ final List<Block> newCatchBlocks = new ArrayList<>(tryNode.getCatchBlocks());
+
+ newCatchBlocks.add(catchAllBlock(tryNode));
+- return tryNode.setCatchBlocks(newCatchBlocks);
++ return tryNode.setCatchBlocks(lc, newCatchBlocks);
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -68,17 +68,17 @@
+ * @param evalCode is this property map created for 'eval' code?
+ * @return New map populated with accessor properties.
+ */
+- PropertyMap makeFieldMap(final boolean hasArguments, final int fieldCount, final int fieldMaximum, final boolean evalCode) {
++ PropertyMap makeFieldMap(final boolean hasArguments, final boolean dualFields, final int fieldCount, final int fieldMaximum, final boolean evalCode) {
+ final List<Property> properties = new ArrayList<>();
+ assert tuples != null;
+
+ for (final MapTuple<T> tuple : tuples) {
+ final String key = tuple.key;
+ final Symbol symbol = tuple.symbol;
+- final Class<?> initialType = tuple.getValueType();
++ final Class<?> initialType = dualFields ? tuple.getValueType() : Object.class;
+
+ if (symbol != null && !isValidArrayIndex(getArrayIndex(key))) {
+- final int flags = getPropertyFlags(symbol, hasArguments, evalCode);
++ final int flags = getPropertyFlags(symbol, hasArguments, evalCode, dualFields);
+ final Property property = new AccessorProperty(
+ key,
+ flags,
+@@ -92,7 +92,7 @@
+ return PropertyMap.newMap(properties, structure.getName(), fieldCount, fieldMaximum, 0);
+ }
+
+- PropertyMap makeSpillMap(final boolean hasArguments) {
++ PropertyMap makeSpillMap(final boolean hasArguments, final boolean dualFields) {
+ final List<Property> properties = new ArrayList<>();
+ int spillIndex = 0;
+ assert tuples != null;
+@@ -100,15 +100,16 @@
+ for (final MapTuple<T> tuple : tuples) {
+ final String key = tuple.key;
+ final Symbol symbol = tuple.symbol;
++ final Class<?> initialType = dualFields ? tuple.getValueType() : Object.class;
+
+- //TODO initial type is object here no matter what. Is that right?
+ if (symbol != null && !isValidArrayIndex(getArrayIndex(key))) {
+- final int flags = getPropertyFlags(symbol, hasArguments, false);
++ final int flags = getPropertyFlags(symbol, hasArguments, false, dualFields);
+ properties.add(
+ new SpillProperty(
+ key,
+ flags,
+- spillIndex++));
++ spillIndex++,
++ initialType));
+ }
+ }
+
+@@ -123,7 +124,7 @@
+ *
+ * @return flags to use for fields
+ */
+- static int getPropertyFlags(final Symbol symbol, final boolean hasArguments, final boolean evalCode) {
++ static int getPropertyFlags(final Symbol symbol, final boolean hasArguments, final boolean evalCode, final boolean dualFields) {
+ int flags = 0;
+
+ if (symbol.isParam()) {
+@@ -161,6 +162,10 @@
+ flags |= Property.NEEDS_DECLARATION;
+ }
+
++ if (dualFields) {
++ flags |= Property.DUAL_FIELDS;
++ }
++
+ return flags;
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/codegen/MapTuple.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/MapTuple.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,8 +25,6 @@
+
+ package jdk.nashorn.internal.codegen;
+
+-import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
+-
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.Symbol;
+
+@@ -52,11 +50,11 @@
+ }
+
+ public Class<?> getValueType() {
+- return OBJECT_FIELDS_ONLY ? Object.class : null; //until proven otherwise we are undefined, see NASHORN-592 int.class;
++ return null; //until proven otherwise we are undefined, see NASHORN-592 int.class;
+ }
+
+ boolean isPrimitive() {
+- return !OBJECT_FIELDS_ONLY && getValueType().isPrimitive() && getValueType() != boolean.class;
++ return getValueType() != null && getValueType().isPrimitive() && getValueType() != boolean.class;
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -94,7 +94,6 @@
+ import jdk.nashorn.internal.ir.JoinPredecessor;
+ import jdk.nashorn.internal.ir.LiteralNode;
+ import jdk.nashorn.internal.ir.LocalVariableConversion;
+-import jdk.nashorn.internal.ir.RuntimeNode;
+ import jdk.nashorn.internal.ir.Symbol;
+ import jdk.nashorn.internal.ir.TryNode;
+ import jdk.nashorn.internal.objects.Global;
+@@ -125,7 +124,7 @@
+ * all generated bytecode and labels to stderr, for easier debugging,
+ * including bytecode stack contents
+ */
+-public class MethodEmitter implements Emitter {
++public class MethodEmitter {
+ /** The ASM MethodVisitor we are plugged into */
+ private final MethodVisitor method;
+
+@@ -138,9 +137,6 @@
+ /** Current type stack for current evaluation */
+ private Label.Stack stack;
+
+- /** Check whether this emitter ever has a function return point */
+- private boolean hasReturn;
+-
+ private boolean preventUndefinedLoad;
+
+ /**
+@@ -175,9 +171,6 @@
+ /** Bootstrap for normal indy:s */
+ private static final Handle LINKERBOOTSTRAP = new Handle(H_INVOKESTATIC, Bootstrap.BOOTSTRAP.className(), Bootstrap.BOOTSTRAP.name(), Bootstrap.BOOTSTRAP.descriptor());
+
+- /** Bootstrap for runtime node indy:s */
+- private static final Handle RUNTIMEBOOTSTRAP = new Handle(H_INVOKESTATIC, RuntimeCallSite.BOOTSTRAP.className(), RuntimeCallSite.BOOTSTRAP.name(), RuntimeCallSite.BOOTSTRAP.descriptor());
+-
+ /** Bootstrap for array populators */
+ private static final Handle POPULATE_ARRAY_BOOTSTRAP = new Handle(H_INVOKESTATIC, RewriteException.BOOTSTRAP.className(), RewriteException.BOOTSTRAP.name(), RewriteException.BOOTSTRAP.descriptor());
+
+@@ -212,9 +205,7 @@
+
+ /**
+ * Begin a method
+- * @see Emitter
+ */
+- @Override
+ public void begin() {
+ classEmitter.beginMethod(this);
+ newStack();
+@@ -223,9 +214,7 @@
+
+ /**
+ * End a method
+- * @see Emitter
+ */
+- @Override
+ public void end() {
+ method.visitMaxs(0, 0);
+ method.visitEnd();
+@@ -1592,7 +1581,7 @@
+ /**
+ * Abstraction for performing a conditional jump of any type
+ *
+- * @see MethodEmitter.Condition
++ * @see Condition
+ *
+ * @param cond the condition to test
+ * @param trueLabel the destination label is condition is true
+@@ -1620,15 +1609,6 @@
+ }
+ }
+
+- MethodEmitter registerReturn() {
+- setHasReturn();
+- return this;
+- }
+-
+- void setHasReturn() {
+- this.hasReturn = true;
+- }
+-
+ /**
+ * Perform a non void return, popping the type from the stack
+ *
+@@ -2189,25 +2169,6 @@
+ }
+
+ /**
+- * Generate a dynamic call for a runtime node
+- *
+- * @param name tag for the invoke dynamic for this runtime node
+- * @param returnType return type
+- * @param request RuntimeNode request
+- *
+- * @return the method emitter
+- */
+- MethodEmitter dynamicRuntimeCall(final String name, final Type returnType, final RuntimeNode.Request request) {
+- debug("dynamic_runtime_call", name, "args=", request.getArity(), "returnType=", returnType);
+- final String signature = getDynamicSignature(returnType, request.getArity());
+- debug(" signature", signature);
+- method.visitInvokeDynamicInsn(name, signature, RUNTIMEBOOTSTRAP);
+- pushType(returnType);
+-
+- return this;
+- }
+-
+- /**
+ * Generate dynamic getter. Pop scope from stack. Push result
+ *
+ * @param valueType type of the value to set
+@@ -2218,6 +2179,10 @@
+ * @return the method emitter
+ */
+ MethodEmitter dynamicGet(final Type valueType, final String name, final int flags, final boolean isMethod, final boolean isIndex) {
++ if (name.length() > LARGE_STRING_THRESHOLD) { // use getIndex for extremely long names
++ return load(name).dynamicGetIndex(valueType, flags, isMethod);
++ }
++
+ debug("dynamic_get", name, valueType, getProgramPoint(flags));
+
+ Type type = valueType;
+@@ -2243,8 +2208,13 @@
+ * @param isIndex is this an index operation?
+ */
+ void dynamicSet(final String name, final int flags, final boolean isIndex) {
+- assert !isOptimistic(flags);
+- debug("dynamic_set", name, peekType());
++ if (name.length() > LARGE_STRING_THRESHOLD) { // use setIndex for extremely long names
++ load(name).swap().dynamicSetIndex(flags);
++ return;
++ }
++
++ assert !isOptimistic(flags);
++ debug("dynamic_set", name, peekType());
+
+ Type type = peekType();
+ if (type.isObject() || type.isBoolean()) { //promote strings to objects etc
+@@ -2739,10 +2709,6 @@
+ this.functionNode = functionNode;
+ }
+
+- boolean hasReturn() {
+- return hasReturn;
+- }
+-
+ /**
+ * Invoke to enforce assertions preventing load from a local variable slot that's known to not have been written to.
+ * Used by CodeGenerator, as it strictly enforces tracking of stores. Simpler uses of MethodEmitter, e.g. those
+--- ./nashorn/src/jdk/nashorn/internal/codegen/Namespace.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/Namespace.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,6 +25,8 @@
+
+ package jdk.nashorn.internal.codegen;
+
++import static jdk.nashorn.internal.codegen.MethodEmitter.LARGE_STRING_THRESHOLD;
++
+ import java.util.HashMap;
+
+ /**
+@@ -66,27 +68,28 @@
+ }
+
+ /**
+- * Create a uniqueName name in the namespace in the form base$n where n varies
+- * .
++ * Create a uniqueName name in the namespace in the form base$n where n varies.
++ * Also truncates very long names that would otherwise break ASM.
++ *
+ * @param base Base of name. Base will be returned if uniqueName.
+- *
+ * @return Generated uniqueName name.
+ */
+ public String uniqueName(final String base) {
++ final String truncatedBase = base.length() > LARGE_STRING_THRESHOLD ? base.substring(0, LARGE_STRING_THRESHOLD) : base;
+ for (Namespace namespace = this; namespace != null; namespace = namespace.getParent()) {
+ final HashMap<String, Integer> namespaceDirectory = namespace.directory;
+- final Integer counter = namespaceDirectory.get(base);
++ final Integer counter = namespaceDirectory.get(truncatedBase);
+
+ if (counter != null) {
+ final int count = counter + 1;
+- namespaceDirectory.put(base, count);
+- return base + '-' + count;
++ namespaceDirectory.put(truncatedBase, count);
++ return truncatedBase + '-' + count;
+ }
+ }
+
+- directory.put(base, 0);
++ directory.put(truncatedBase, 0);
+
+- return base;
++ return truncatedBase;
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -31,7 +31,8 @@
+ import static jdk.nashorn.internal.codegen.CompilerConstants.INIT_MAP;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.INIT_SCOPE;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.JAVA_THIS;
+-import static jdk.nashorn.internal.codegen.CompilerConstants.JS_OBJECT_PREFIX;
++import static jdk.nashorn.internal.codegen.CompilerConstants.JS_OBJECT_DUAL_FIELD_PREFIX;
++import static jdk.nashorn.internal.codegen.CompilerConstants.JS_OBJECT_SINGLE_FIELD_PREFIX;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.className;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup;
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
+@@ -56,6 +57,7 @@
+ import jdk.nashorn.internal.codegen.ClassEmitter.Flag;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.runtime.AccessorProperty;
++import jdk.nashorn.internal.runtime.AllocationStrategy;
+ import jdk.nashorn.internal.runtime.Context;
+ import jdk.nashorn.internal.runtime.FunctionScope;
+ import jdk.nashorn.internal.runtime.JSType;
+@@ -98,18 +100,10 @@
+ */
+ private final DebugLogger log;
+
+- /**
+- * Should the runtime only use java.lang.Object slots for fields? If this is false, the representation
+- * will be a primitive 64-bit long value used for all primitives and a java.lang.Object for references.
+- * This introduces a larger number of method handles in the system, as we need to have different getters
+- * and setters for the different fields.
+- *
+- * This is engineered to plug into the TaggedArray implementation, when it's done.
+- */
+- public static final boolean OBJECT_FIELDS_ONLY = Options.getBooleanProperty("nashorn.fields.objects");
+-
+- /** The field types in the system */
+- private static final List<Type> FIELD_TYPES = new LinkedList<>();
++ /** Field types for object-only fields */
++ private static final Type[] FIELD_TYPES_OBJECT = new Type[] { Type.OBJECT };
++ /** Field types for dual primitive/object fields */
++ private static final Type[] FIELD_TYPES_DUAL = new Type[] { Type.LONG, Type.OBJECT };
+
+ /** What type is the primitive type in dual representation */
+ public static final Type PRIMITIVE_FIELD_TYPE = Type.LONG;
+@@ -117,33 +111,27 @@
+ private static final MethodHandle GET_DIFFERENT = findOwnMH("getDifferent", Object.class, Object.class, Class.class, MethodHandle.class, MethodHandle.class, int.class);
+ private static final MethodHandle GET_DIFFERENT_UNDEFINED = findOwnMH("getDifferentUndefined", Object.class, int.class);
+
+- /**
+- * The list of field types that we support - one type creates one field. This is currently either
+- * LONG + OBJECT or just OBJECT for classic mode.
+- */
+- static {
+- if (!OBJECT_FIELDS_ONLY) {
+- FIELD_TYPES.add(PRIMITIVE_FIELD_TYPE);
+- }
+- FIELD_TYPES.add(Type.OBJECT);
+- }
+ private static boolean initialized = false;
+
+ /** The context */
+ private final Context context;
+
++ private final boolean dualFields;
++
+ /**
+ * Constructor
+ *
+ * @param context a context
++ * @param dualFields whether to use dual fields representation
+ */
+- public ObjectClassGenerator(final Context context) {
++ public ObjectClassGenerator(final Context context, final boolean dualFields) {
+ this.context = context;
++ this.dualFields = dualFields;
+ assert context != null;
+ this.log = initLogger(context);
+ if (!initialized) {
+ initialized = true;
+- if (OBJECT_FIELDS_ONLY) {
++ if (!dualFields) {
+ log.warning("Running with object fields only - this is a deprecated configuration.");
+ }
+ }
+@@ -175,16 +163,30 @@
+ throw new AssertionError("cannot pack" + n);
+ }
+
++ private static String getPrefixName(final boolean dualFields) {
++ return dualFields ? JS_OBJECT_DUAL_FIELD_PREFIX.symbolName() : JS_OBJECT_SINGLE_FIELD_PREFIX.symbolName();
++ }
++
++ private static String getPrefixName(final String className) {
++ if (className.startsWith(JS_OBJECT_DUAL_FIELD_PREFIX.symbolName())) {
++ return getPrefixName(true);
++ } else if (className.startsWith(JS_OBJECT_SINGLE_FIELD_PREFIX.symbolName())) {
++ return getPrefixName(false);
++ }
++ throw new AssertionError("Not a structure class: " + className);
++ }
++
+ /**
+ * Returns the class name for JavaScript objects with fieldCount fields.
+ *
+ * @param fieldCount Number of fields to allocate.
+- *
++ * @param dualFields whether to use dual fields representation
+ * @return The class name.
+ */
+- public static String getClassName(final int fieldCount) {
+- return fieldCount != 0 ? SCRIPTS_PACKAGE + '/' + JS_OBJECT_PREFIX.symbolName() + fieldCount :
+- SCRIPTS_PACKAGE + '/' + JS_OBJECT_PREFIX.symbolName();
++ public static String getClassName(final int fieldCount, final boolean dualFields) {
++ final String prefix = getPrefixName(dualFields);
++ return fieldCount != 0 ? SCRIPTS_PACKAGE + '/' + prefix + fieldCount :
++ SCRIPTS_PACKAGE + '/' + prefix;
+ }
+
+ /**
+@@ -193,22 +195,23 @@
+ *
+ * @param fieldCount Number of fields to allocate.
+ * @param paramCount Number of parameters to allocate
+- *
++ * @param dualFields whether to use dual fields representation
+ * @return The class name.
+ */
+- public static String getClassName(final int fieldCount, final int paramCount) {
+- return SCRIPTS_PACKAGE + '/' + JS_OBJECT_PREFIX.symbolName() + fieldCount + SCOPE_MARKER + paramCount;
++ public static String getClassName(final int fieldCount, final int paramCount, final boolean dualFields) {
++ return SCRIPTS_PACKAGE + '/' + getPrefixName(dualFields) + fieldCount + SCOPE_MARKER + paramCount;
+ }
+
+ /**
+ * Returns the number of fields in the JavaScript scope class. Its name had to be generated using either
+- * {@link #getClassName(int)} or {@link #getClassName(int, int)}.
++ * {@link #getClassName(int, boolean)} or {@link #getClassName(int, int, boolean)}.
+ * @param clazz the JavaScript scope class.
+ * @return the number of fields in the scope class.
+ */
+ public static int getFieldCount(final Class<?> clazz) {
+ final String name = clazz.getSimpleName();
+- final String prefix = JS_OBJECT_PREFIX.symbolName();
++ final String prefix = getPrefixName(name);
++
+ if (prefix.equals(name)) {
+ return 0;
+ }
+@@ -237,8 +240,8 @@
+ * @param className name of class
+ * @param fieldNames fields to initialize to undefined, where applicable
+ */
+- private static void initializeToUndefined(final MethodEmitter init, final String className, final List<String> fieldNames) {
+- if (!OBJECT_FIELDS_ONLY) {
++ private void initializeToUndefined(final MethodEmitter init, final String className, final List<String> fieldNames) {
++ if (dualFields) {
+ // no need to initialize anything to undefined in the dual field world
+ // - then we have a constant getter for undefined for any unknown type
+ return;
+@@ -291,7 +294,7 @@
+ * @return Byte codes for generated class.
+ */
+ public byte[] generate(final int fieldCount) {
+- final String className = getClassName(fieldCount);
++ final String className = getClassName(fieldCount, dualFields);
+ final String superName = className(ScriptObject.class);
+ final ClassEmitter classEmitter = newClassEmitter(className, superName);
+
+@@ -321,7 +324,7 @@
+ * @return Byte codes for generated class.
+ */
+ public byte[] generate(final int fieldCount, final int paramCount) {
+- final String className = getClassName(fieldCount, paramCount);
++ final String className = getClassName(fieldCount, paramCount, dualFields);
+ final String superName = className(FunctionScope.class);
+ final ClassEmitter classEmitter = newClassEmitter(className, superName);
+ final List<String> initFields = addFields(classEmitter, fieldCount);
+@@ -352,11 +355,11 @@
+ *
+ * @return List fields that need to be initialized.
+ */
+- private static List<String> addFields(final ClassEmitter classEmitter, final int fieldCount) {
++ private List<String> addFields(final ClassEmitter classEmitter, final int fieldCount) {
+ final List<String> initFields = new LinkedList<>();
+-
++ final Type[] fieldTypes = dualFields ? FIELD_TYPES_DUAL : FIELD_TYPES_OBJECT;
+ for (int i = 0; i < fieldCount; i++) {
+- for (final Type type : FIELD_TYPES) {
++ for (final Type type : fieldTypes) {
+ final String fieldName = getFieldName(i, type);
+ classEmitter.field(fieldName, type.getTypeClass());
+
+@@ -532,13 +535,10 @@
+ private static MethodHandle getterForType(final Class<?> forType, final MethodHandle primitiveGetter, final MethodHandle objectGetter) {
+ switch (getAccessorTypeIndex(forType)) {
+ case TYPE_INT_INDEX:
+- assert !OBJECT_FIELDS_ONLY : "this can only happen with dual fields";
+ return MH.explicitCastArguments(primitiveGetter, primitiveGetter.type().changeReturnType(int.class));
+ case TYPE_LONG_INDEX:
+- assert !OBJECT_FIELDS_ONLY : "this can only happen with dual fields";
+ return primitiveGetter;
+ case TYPE_DOUBLE_INDEX:
+- assert !OBJECT_FIELDS_ONLY : "this can only happen with dual fields";
+ return MH.filterReturnValue(primitiveGetter, UNPACK_DOUBLE);
+ case TYPE_OBJECT_INDEX:
+ return objectGetter;
+@@ -556,7 +556,7 @@
+ final boolean isPrimitiveStorage = forType != null && forType.isPrimitive();
+
+ //which is the primordial getter
+- final MethodHandle getter = OBJECT_FIELDS_ONLY ? objectGetter : isPrimitiveStorage ? primitiveGetter : objectGetter;
++ final MethodHandle getter = primitiveGetter == null ? objectGetter : isPrimitiveStorage ? primitiveGetter : objectGetter;
+
+ if (forType == null) {
+ if (isOptimistic) {
+@@ -579,8 +579,7 @@
+ return MH.dropArguments(GET_UNDEFINED.get(ti), 0, Object.class);
+ }
+
+- assert forType != null;
+- assert !OBJECT_FIELDS_ONLY || forType == Object.class : forType;
++ assert primitiveGetter != null || forType == Object.class : forType;
+
+ if (isOptimistic) {
+ if (fti < ti) {
+@@ -634,8 +633,6 @@
+ return tgetter;
+ }
+
+- assert !OBJECT_FIELDS_ONLY;
+- //final MethodType pmt = primitiveGetter.type();
+ assert primitiveGetter != null;
+ final MethodType tgetterType = tgetter.type();
+ switch (fti) {
+@@ -726,7 +723,7 @@
+ final int fti = getAccessorTypeIndex(forType);
+ final int ti = getAccessorTypeIndex(type);
+
+- if (fti == TYPE_OBJECT_INDEX || OBJECT_FIELDS_ONLY) {
++ if (fti == TYPE_OBJECT_INDEX || primitiveSetter == null) {
+ if (ti == TYPE_OBJECT_INDEX) {
+ return objectSetter;
+ }
+@@ -734,8 +731,6 @@
+ return MH.asType(objectSetter, objectSetter.type().changeParameterType(1, type));
+ }
+
+- assert !OBJECT_FIELDS_ONLY;
+-
+ final MethodType pmt = primitiveSetter.type();
+
+ switch (fti) {
+@@ -826,44 +821,13 @@
+ }
+
+ /**
+- * Describes the allocator class name and property map for a constructor function with the specified
++ * Creates the allocator class name and property map for a constructor function with the specified
+ * number of "this" properties that it initializes.
+- *
++ * @param thisProperties number of properties assigned to "this"
++ * @return the allocation strategy
+ */
+- public static class AllocatorDescriptor {
+- private final String allocatorClassName;
+- private final PropertyMap allocatorMap;
+-
+- /**
+- * Creates a new allocator descriptor
+- * @param thisProperties the number of "this" properties that the function initializes
+- */
+- public AllocatorDescriptor(final int thisProperties) {
+- final int paddedFieldCount = getPaddedFieldCount(thisProperties);
+- this.allocatorClassName = Compiler.binaryName(getClassName(paddedFieldCount));
+- this.allocatorMap = PropertyMap.newMap(null, allocatorClassName, 0, paddedFieldCount, 0);
+- }
+-
+- /**
+- * Returns the name of the class that the function allocates
+- * @return the name of the class that the function allocates
+- */
+- public String getAllocatorClassName() {
+- return allocatorClassName;
+- }
+-
+- /**
+- * Returns the allocator map for the function.
+- * @return the allocator map for the function.
+- */
+- public PropertyMap getAllocatorMap() {
+- return allocatorMap;
+- }
+-
+- @Override
+- public String toString() {
+- return "AllocatorDescriptor[allocatorClassName=" + allocatorClassName + ", allocatorMap.size=" +
+- allocatorMap.size() + "]";
+- }
++ static AllocationStrategy createAllocationStrategy(final int thisProperties, final boolean dualFields) {
++ final int paddedFieldCount = getPaddedFieldCount(thisProperties);
++ return new AllocationStrategy(paddedFieldCount, dualFields);
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/codegen/ObjectCreator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/ObjectCreator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -134,7 +134,7 @@
+
+ MethodEmitter loadTuple(final MethodEmitter method, final MapTuple<T> tuple, final boolean pack) {
+ loadValue(tuple.value, tuple.type);
+- if (pack && tuple.isPrimitive()) {
++ if (pack && codegen.useDualFields() && tuple.isPrimitive()) {
+ method.pack();
+ } else {
+ method.convert(Type.OBJECT);
+@@ -146,4 +146,28 @@
+ return loadTuple(method, tuple, true);
+ }
+
++ /**
++ * If using optimistic typing, let the code generator realize that the newly created object on the stack
++ * when DUP-ed will be the same value. Basically: {NEW, DUP, INVOKESPECIAL init, DUP} will leave a stack
++ * load specification {unknown, unknown} on stack (that is "there's two values on the stack, but neither
++ * comes from a known local load"). If there's an optimistic operation in the literal initializer,
++ * OptimisticOperation.storeStack will allocate two temporary locals for it and store them as
++ * {ASTORE 4, ASTORE 3}. If we instead do {NEW, DUP, INVOKESPECIAL init, ASTORE 3, ALOAD 3, DUP} we end up
++ * with stack load specification {ALOAD 3, ALOAD 3} (as DUP can track that the value it duplicated came
++ * from a local load), so if/when a continuation needs to be recreated from it, it'll be
++ * able to emit ALOAD 3, ALOAD 3 to recreate the stack. If we didn't do this, deoptimization within an
++ * object literal initialization could in rare cases cause an incompatible change in the shape of the
++ * local variable table for the temporaries, e.g. in the following snippet where a variable is reassigned
++ * to a wider type in an object initializer:
++ * <code>var m = 1; var obj = {p0: m, p1: m = "foo", p2: m}</code>
++ * @param method the current method emitter.
++ */
++ void helpOptimisticRecognizeDuplicateIdentity(final MethodEmitter method) {
++ if (codegen.useOptimisticTypes()) {
++ final Type objectType = method.peekType();
++ final int tempSlot = method.defineTemporaryLocalVariable(objectType.getSlots());
++ method.storeHidden(objectType, tempSlot);
++ method.load(objectType, tempSlot);
++ }
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java Wed Jul 01 21:54:30 2015 -0700
+@@ -61,7 +61,7 @@
+ import jdk.nashorn.internal.runtime.options.Options;
+
+ /**
+- * Static utility that encapsulates persistence of type information for functions compiled with optimistic
++ * <p>Static utility that encapsulates persistence of type information for functions compiled with optimistic
+ * typing. With this feature enabled, when a JavaScript function is recompiled because it gets deoptimized,
+ * the type information for deoptimization is stored in a cache file. If the same function is compiled in a
+ * subsequent JVM invocation, the type information is used for initial compilation, thus allowing the system
+@@ -77,6 +77,7 @@
+ * {@code nashorn.typeInfo.cleanupDelaySeconds} system property. You can also specify the word
+ * {@code unlimited} as the value for {@code nashorn.typeInfo.maxFiles} in which case the type info cache is
+ * allowed to grow without limits.
++ * </p>
+ */
+ public final class OptimisticTypesPersistence {
+ // Default is 0, for disabling the feature when not specified. A reasonable default when enabled is
+--- ./nashorn/src/jdk/nashorn/internal/codegen/RuntimeCallSite.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,683 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.codegen;
+-
+-import static jdk.nashorn.internal.codegen.CompilerConstants.staticCallNoLookup;
+-import static jdk.nashorn.internal.codegen.types.Type.BOOLEAN;
+-import static jdk.nashorn.internal.codegen.types.Type.INT;
+-import static jdk.nashorn.internal.lookup.Lookup.MH;
+-
+-import java.lang.invoke.CallSite;
+-import java.lang.invoke.MethodHandle;
+-import java.lang.invoke.MethodHandles;
+-import java.lang.invoke.MethodType;
+-import java.lang.invoke.MutableCallSite;
+-import java.util.HashMap;
+-import java.util.Map;
+-import jdk.nashorn.internal.codegen.CompilerConstants.Call;
+-import jdk.nashorn.internal.codegen.types.Type;
+-import jdk.nashorn.internal.ir.RuntimeNode;
+-import jdk.nashorn.internal.ir.RuntimeNode.Request;
+-import jdk.nashorn.internal.lookup.Lookup;
+-import jdk.nashorn.internal.runtime.ScriptRuntime;
+-import jdk.nashorn.internal.runtime.linker.Bootstrap;
+-
+-/**
+- * Optimistic call site that assumes its Object arguments to be of a boxed type.
+- * Gradually reverts to wider boxed types if the assumption for the RuntimeNode
+- * is proven wrong. Finally reverts to the generic ScriptRuntime method.
+- *
+- * This is used from the CodeGenerator when we have a runtime node, but 1 or more
+- * primitive arguments. This class generated appropriate specializations, for example
+- * {@code Object a === int b} is a good idea to specialize to {@code ((Integer)a).intValue() == b}
+- * surrounded by catch blocks that will try less narrow specializations
+- */
+-public final class RuntimeCallSite extends MutableCallSite {
+- static final Call BOOTSTRAP = staticCallNoLookup(Bootstrap.class, "runtimeBootstrap", CallSite.class, MethodHandles.Lookup.class, String.class, MethodType.class);
+-
+- private static final MethodHandle NEXT = findOwnMH_V("next", MethodHandle.class, String.class);
+-
+- private final RuntimeNode.Request request;
+-
+- /**
+- * A specialized runtime node, i.e. on where we know at least one more specific type than object
+- */
+- static final class SpecializedRuntimeNode {
+- private static final char REQUEST_SEPARATOR = ':';
+-
+- private final RuntimeNode.Request request;
+-
+- private final Type[] parameterTypes;
+-
+- private final Type returnType;
+-
+- /**
+- * Constructor.
+- *
+- * @param request runtime node request to specialize
+- * @param parameterTypes parameter types of the call site
+- * @param returnType return type of the call site
+- */
+- SpecializedRuntimeNode(final RuntimeNode.Request request, final Type[] parameterTypes, final Type returnType) {
+- this.request = request;
+- this.parameterTypes = parameterTypes;
+- this.returnType = returnType;
+- }
+-
+- /**
+- * The first type to try to use for this generated runtime node
+- *
+- * @return a type
+- */
+- public Type firstTypeGuess() {
+- Type widest = Type.UNKNOWN;
+- for (final Type type : parameterTypes) {
+- if (type.isObject()) {
+- continue;
+- }
+- widest = Type.widest(type, widest);
+- }
+- widest = Type.widest(widest, firstTypeGuessForObject(request));
+-
+- return widest;
+- }
+-
+- private static Type firstTypeGuessForObject(final Request request) {
+- switch (request) {
+- case ADD:
+- return INT;
+- default:
+- return BOOLEAN;
+- }
+- }
+-
+- Request getRequest() {
+- return request;
+- }
+-
+- Type[] getParameterTypes() {
+- return parameterTypes;
+- }
+-
+- Type getReturnType() {
+- return returnType;
+- }
+-
+- private static char descFor(final Type type) {
+- if (type.isObject()) {
+- return 'O';
+- }
+- return type.getDescriptor().charAt(0);
+- }
+-
+- @Override
+- public boolean equals(final Object other) {
+- if (other instanceof SpecializedRuntimeNode) {
+- final SpecializedRuntimeNode otherNode = (SpecializedRuntimeNode)other;
+-
+- if (!otherNode.getReturnType().equals(getReturnType())) {
+- return false;
+- }
+-
+- if (getParameterTypes().length != otherNode.getParameterTypes().length) {
+- return false;
+- }
+-
+- for (int i = 0; i < getParameterTypes().length; i++) {
+- if (!Type.areEquivalent(getParameterTypes()[i], otherNode.getParameterTypes()[i])) {
+- return false;
+- }
+- }
+-
+- return otherNode.getRequest().equals(getRequest());
+- }
+-
+- return false;
+- }
+-
+- @Override
+- public int hashCode() {
+- int hashCode = getRequest().toString().hashCode();
+- hashCode ^= getReturnType().hashCode();
+- for (final Type type : getParameterTypes()) {
+- hashCode ^= type.hashCode();
+- }
+- return hashCode;
+- }
+-
+- @Override
+- public String toString() {
+- final StringBuilder sb = new StringBuilder();
+- sb.append(getRequest().toString());
+- sb.append(REQUEST_SEPARATOR);
+- sb.append(descFor(getReturnType()));
+-
+- for (final Type type : getParameterTypes()) {
+- sb.append(descFor(type));
+- }
+-
+- return sb.toString();
+- }
+-
+- String getName(final Type extraType) {
+- return toString() + "_" + descFor(extraType);
+- }
+-
+- String getInitialName() {
+- return getName(firstTypeGuess());
+- }
+- }
+-
+-
+- /**
+- * Constructor
+- *
+- * @param type method type for call site
+- * @param name name of runtime call
+- */
+- public RuntimeCallSite(final MethodType type, final String name) {
+- super(type);
+- this.request = Request.valueOf(name.substring(0, name.indexOf(SpecializedRuntimeNode.REQUEST_SEPARATOR)));
+- setTarget(makeMethod(name));
+- }
+-
+- private String nextName(final String requestName) {
+- if (requestName.equals(request.toString())) {
+- return null;
+- }
+-
+- final char[] c = requestName.toCharArray();
+- final int last = c.length - 1;
+-
+- if (c[last - 1] != '_') {
+- return null;
+- }
+-
+- switch (c[last]) {
+- case 'Z':
+- c[last] = 'I';
+- break;
+- case 'I':
+- c[last] = 'J';
+- break;
+- case 'J':
+- c[last] = 'D';
+- break;
+- case 'D':
+- default:
+- return request.toString();
+- }
+-
+- return new String(c);
+- }
+-
+- private boolean isSpecialized(final String requestName) {
+- return nextName(requestName) != null;
+- }
+-
+- private MethodHandle makeMethod(final String requestName) {
+- MethodHandle mh;
+-
+- if (isSpecialized(requestName)) {
+- final Class<?> boxedType;
+- final Class<?> primitiveType;
+-
+- switch (requestName.charAt(requestName.length() - 1)) {
+- case 'Z':
+- boxedType = Boolean.class;
+- primitiveType = int.class;
+- break;
+- case 'I':
+- boxedType = Integer.class;
+- primitiveType = int.class;
+- break;
+- case 'J':
+- boxedType = Long.class;
+- primitiveType = long.class;
+- break;
+- case 'D':
+- boxedType = Number.class;
+- primitiveType = double.class;
+- break;
+- default:
+- throw new RuntimeException("should not reach here");
+- }
+-
+- final boolean isStrictCmp = (request == Request.EQ_STRICT || request == Request.NE_STRICT);
+-
+- if (isStrictCmp &&
+- (boxedType != Boolean.class &&
+- (type().parameterType(0) == boolean.class ||
+- type().parameterType(1) == boolean.class))) {
+- // number and boolean are never strictly equal, e.g. 0 !== false
+- mh = MH.dropArguments(MH.constant(boolean.class, request == Request.NE_STRICT), 0, type().parameterArray());
+- } else {
+- mh = METHODS.get(request.nonStrictName() + primitiveType.getSimpleName());
+- // unbox objects
+-
+- for (int i = 0; i < type().parameterCount(); i++) {
+- if (!type().parameterType(i).isPrimitive()) {
+- mh = MH.filterArguments(mh, i, UNBOX.get(boxedType));
+- }
+- }
+-
+- mh = Lookup.filterReturnType(mh, type().returnType());
+- mh = MH.explicitCastArguments(mh, type());
+- }
+-
+- final MethodHandle fallback = MH.foldArguments(MethodHandles.exactInvoker(type()), MH.insertArguments(NEXT, 0, this, requestName));
+-
+- MethodHandle guard;
+- if (type().parameterType(0).isPrimitive()) {
+- guard = MH.insertArguments(
+- MH.dropArguments(CHECKCAST, 1, type().parameterType(0)), 0, boxedType);
+- } else if (type().parameterType(1).isPrimitive()) {
+- guard = MH.insertArguments(
+- MH.dropArguments(CHECKCAST, 2, type().parameterType(1)), 0, boxedType);
+- } else {
+- assert !type().parameterType(0).isPrimitive() && !type().parameterType(1).isPrimitive();
+- guard = MH.insertArguments(CHECKCAST2, 0, boxedType);
+- }
+-
+- if (request == Request.ADD && boxedType == Integer.class) {
+- // int add needs additional overflow check
+- MethodHandle addcheck = ADDCHECK;
+- for (int i = 0; i < type().parameterCount(); i++) {
+- if (!type().parameterType(i).isPrimitive()) {
+- addcheck = MH.filterArguments(addcheck, i, UNBOX.get(boxedType));
+- }
+- }
+- addcheck = MH.explicitCastArguments(addcheck, type().changeReturnType(boolean.class));
+- guard = MH.guardWithTest(upcastGuard(guard), addcheck,
+- MH.dropArguments(MH.constant(boolean.class, false), 0, type().parameterArray()));
+- }
+-
+- return MH.guardWithTest(upcastGuard(guard), mh, fallback);
+- }
+-
+- // generic fallback
+- return MH.explicitCastArguments(Lookup.filterReturnType(GENERIC_METHODS.get(request.name()), type().returnType()), type());
+- }
+-
+- private MethodHandle upcastGuard(final MethodHandle guard) {
+- return MH.asType(guard, type().changeReturnType(boolean.class));
+- }
+-
+- /**
+- * This is public just so that the generated specialization code can
+- * use it to get the next wider typed method
+- *
+- * Do not call directly
+- *
+- * @param name current name (with type) of runtime call at the call site
+- * @return next wider specialization method for this RuntimeCallSite
+- */
+- public MethodHandle next(final String name) {
+- final MethodHandle next = makeMethod(nextName(name));
+- setTarget(next);
+- return next;
+- }
+-
+- /** Method cache */
+- private static final Map<String, MethodHandle> METHODS;
+-
+- /** Generic method cache */
+- private static final Map<String, MethodHandle> GENERIC_METHODS;
+-
+- /** Unbox cache */
+- private static final Map<Class<?>, MethodHandle> UNBOX;
+-
+- private static final MethodHandle CHECKCAST = findOwnMH_S("checkcast", boolean.class, Class.class, Object.class);
+- private static final MethodHandle CHECKCAST2 = findOwnMH_S("checkcast", boolean.class, Class.class, Object.class, Object.class);
+- private static final MethodHandle ADDCHECK = findOwnMH_S("ADDcheck", boolean.class, int.class, int.class);
+-
+- /**
+- * Build maps of correct boxing operations
+- */
+- static {
+- UNBOX = new HashMap<>();
+- UNBOX.put(Boolean.class, findOwnMH_S("unboxZ", int.class, Object.class));
+- UNBOX.put(Integer.class, findOwnMH_S("unboxI", int.class, Object.class));
+- UNBOX.put(Long.class, findOwnMH_S("unboxJ", long.class, Object.class));
+- UNBOX.put(Number.class, findOwnMH_S("unboxD", double.class, Object.class));
+-
+- METHODS = new HashMap<>();
+-
+- for (final Request req : Request.values()) {
+- if (req.canSpecialize()) {
+- if (req.name().endsWith("_STRICT")) {
+- continue;
+- }
+-
+- final boolean isCmp = Request.isComparison(req);
+-
+- METHODS.put(req.name() + "int", findOwnMH_S(req.name(), (isCmp ? boolean.class : int.class), int.class, int.class));
+- METHODS.put(req.name() + "long", findOwnMH_S(req.name(), (isCmp ? boolean.class : long.class), long.class, long.class));
+- METHODS.put(req.name() + "double", findOwnMH_S(req.name(), (isCmp ? boolean.class : double.class), double.class, double.class));
+- }
+- }
+-
+- GENERIC_METHODS = new HashMap<>();
+- for (final Request req : Request.values()) {
+- if (req.canSpecialize()) {
+- GENERIC_METHODS.put(req.name(), MH.findStatic(MethodHandles.lookup(), ScriptRuntime.class, req.name(),
+- MH.type(req.getReturnType().getTypeClass(), Object.class, Object.class)));
+- }
+- }
+- }
+-
+- /**
+- * Specialized version of != operator for two int arguments. Do not call directly.
+- * @param a int
+- * @param b int
+- * @return a != b
+- */
+- public static boolean NE(final int a, final int b) {
+- return a != b;
+- }
+-
+- /**
+- * Specialized version of != operator for two double arguments. Do not call directly.
+- * @param a double
+- * @param b double
+- * @return a != b
+- */
+- public static boolean NE(final double a, final double b) {
+- return a != b;
+- }
+-
+- /**
+- * Specialized version of != operator for two long arguments. Do not call directly.
+- * @param a long
+- * @param b long
+- * @return a != b
+- */
+- public static boolean NE(final long a, final long b) {
+- return a != b;
+- }
+-
+- /**
+- * Specialized version of == operator for two int arguments. Do not call directly.
+- * @param a int
+- * @param b int
+- * @return a == b
+- */
+- public static boolean EQ(final int a, final int b) {
+- return a == b;
+- }
+-
+- /**
+- * Specialized version of == operator for two double arguments. Do not call directly.
+- * @param a double
+- * @param b double
+- * @return a == b
+- */
+- public static boolean EQ(final double a, final double b) {
+- return a == b;
+- }
+-
+- /**
+- * Specialized version of == operator for two long arguments. Do not call directly.
+- * @param a long
+- * @param b long
+- * @return a == b
+- */
+- public static boolean EQ(final long a, final long b) {
+- return a == b;
+- }
+-
+- /**
+- * Specialized version of {@literal <} operator for two int arguments. Do not call directly.
+- * @param a int
+- * @param b int
+- * @return a {@code <} b
+- */
+- public static boolean LT(final int a, final int b) {
+- return a < b;
+- }
+-
+- /**
+- * Specialized version of {@literal <} operator for two double arguments. Do not call directly.
+- * @param a double
+- * @param b double
+- * @return a {@literal <} b
+- */
+- public static boolean LT(final double a, final double b) {
+- return a < b;
+- }
+-
+- /**
+- * Specialized version of {@literal <} operator for two long arguments. Do not call directly.
+- * @param a long
+- * @param b long
+- * @return a {@literal <} b
+- */
+- public static boolean LT(final long a, final long b) {
+- return a < b;
+- }
+-
+- /**
+- * Specialized version of {@literal <=} operator for two int arguments. Do not call directly.
+- * @param a int
+- * @param b int
+- * @return a {@literal <=} b
+- */
+- public static boolean LE(final int a, final int b) {
+- return a <= b;
+- }
+-
+- /**
+- * Specialized version of {@literal <=} operator for two double arguments. Do not call directly.
+- * @param a double
+- * @param b double
+- * @return a {@literal <=} b
+- */
+- public static boolean LE(final double a, final double b) {
+- return a <= b;
+- }
+-
+- /**
+- * Specialized version of {@literal <=} operator for two long arguments. Do not call directly.
+- * @param a long
+- * @param b long
+- * @return a {@literal <=} b
+- */
+- public static boolean LE(final long a, final long b) {
+- return a <= b;
+- }
+-
+- /**
+- * Specialized version of {@literal >} operator for two int arguments. Do not call directly.
+- * @param a int
+- * @param b int
+- * @return a {@literal >} b
+- */
+- public static boolean GT(final int a, final int b) {
+- return a > b;
+- }
+-
+- /**
+- * Specialized version of {@literal >} operator for two double arguments. Do not call directly.
+- * @param a double
+- * @param b double
+- * @return a {@literal >} b
+- */
+- public static boolean GT(final double a, final double b) {
+- return a > b;
+- }
+-
+- /**
+- * Specialized version of {@literal >} operator for two long arguments. Do not call directly.
+- * @param a long
+- * @param b long
+- * @return a {@literal >} b
+- */
+- public static boolean GT(final long a, final long b) {
+- return a > b;
+- }
+-
+- /**
+- * Specialized version of {@literal >=} operator for two int arguments. Do not call directly.
+- * @param a int
+- * @param b int
+- * @return a {@literal >=} b
+- */
+- public static boolean GE(final int a, final int b) {
+- return a >= b;
+- }
+-
+- /**
+- * Specialized version of {@literal >=} operator for two double arguments. Do not call directly.
+- * @param a double
+- * @param b double
+- * @return a {@literal >=} b
+- */
+- public static boolean GE(final double a, final double b) {
+- return a >= b;
+- }
+-
+- /**
+- * Specialized version of {@literal >=} operator for two long arguments. Do not call directly.
+- * @param a long
+- * @param b long
+- * @return a {@code >=} b
+- */
+- public static boolean GE(final long a, final long b) {
+- return a >= b;
+- }
+-
+- /**
+- * Specialized version of + operator for two int arguments. Do not call directly.
+- * @param a int
+- * @param b int
+- * @return a + b
+- */
+- public static int ADD(final int a, final int b) {
+- return a + b;
+- }
+-
+- /**
+- * Specialized version of + operator for two long arguments. Do not call directly.
+- * @param a long
+- * @param b long
+- * @return a + b
+- */
+- public static long ADD(final long a, final long b) {
+- return a + b;
+- }
+-
+- /**
+- * Specialized version of + operator for two double arguments. Do not call directly.
+- * @param a double
+- * @param b double
+- * @return a + b
+- */
+- public static double ADD(final double a, final double b) {
+- return a + b;
+- }
+-
+- /**
+- * Check that ints are addition compatible, i.e. their sum is equal to the sum
+- * of them cast to long. Otherwise the addition will overflow. Do not call directly.
+- *
+- * @param a int
+- * @param b int
+- *
+- * @return true if addition does not overflow
+- */
+- public static boolean ADDcheck(final int a, final int b) {
+- return (a + b == (long)a + (long)b);
+- }
+-
+- /**
+- * Checkcast used for specialized ops. Do not call directly
+- *
+- * @param type to to check against
+- * @param obj object to check for type
+- *
+- * @return true if type check holds
+- */
+- public static boolean checkcast(final Class<?> type, final Object obj) {
+- return type.isInstance(obj);
+- }
+-
+- /**
+- * Checkcast used for specialized ops. Do not call directly
+- *
+- * @param type type to check against
+- * @param objA first object to check against type
+- * @param objB second object to check against type
+- *
+- * @return true if type check holds for both objects
+- */
+- public static boolean checkcast(final Class<?> type, final Object objA, final Object objB) {
+- return type.isInstance(objA) && type.isInstance(objB);
+- }
+-
+- /**
+- * Unbox a java.lang.Boolean. Do not call directly
+- * @param obj object to cast to int and unbox
+- * @return an int value for the boolean, 1 is true, 0 is false
+- */
+- public static int unboxZ(final Object obj) {
+- return (boolean)obj ? 1 : 0;
+- }
+-
+- /**
+- * Unbox a java.lang.Integer. Do not call directly
+- * @param obj object to cast to int and unbox
+- * @return an int
+- */
+- public static int unboxI(final Object obj) {
+- return (int)obj;
+- }
+-
+- /**
+- * Unbox a java.lang.Long. Do not call directly
+- * @param obj object to cast to long and unbox
+- * @return a long
+- */
+- public static long unboxJ(final Object obj) {
+- return (long)obj;
+- }
+-
+- /**
+- * Unbox a java.lang.Number. Do not call directly
+- * @param obj object to cast to Number and unbox
+- * @return a double
+- */
+- public static double unboxD(final Object obj) {
+- return ((Number)obj).doubleValue();
+- }
+-
+- private static MethodHandle findOwnMH_S(final String name, final Class<?> rtype, final Class<?>... types) {
+- return MH.findStatic(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
+- }
+-
+- private static MethodHandle findOwnMH_V(final String name, final Class<?> rtype, final Class<?>... types) {
+- return MH.findVirtual(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
+- }
+-}
+--- ./nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,7 +27,6 @@
+
+ import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup;
+-import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
+
+ import java.util.LinkedHashSet;
+ import java.util.List;
+@@ -42,6 +41,7 @@
+ import jdk.nashorn.internal.runtime.ScriptRuntime;
+ import jdk.nashorn.internal.runtime.arrays.ArrayData;
+ import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
++import jdk.nashorn.internal.scripts.JD;
+ import jdk.nashorn.internal.scripts.JO;
+
+ /**
+@@ -65,10 +65,13 @@
+ assert !isScope() : "spill scope objects are not currently supported";
+
+ final int length = tuples.size();
+- final long[] jpresetValues = new long[ScriptObject.spillAllocationLength(length)];
+- final Object[] opresetValues = new Object[ScriptObject.spillAllocationLength(length)];
++ final boolean dualFields = codegen.useDualFields();
++ final int spillLength = ScriptObject.spillAllocationLength(length);
++ final long[] jpresetValues = dualFields ? new long[spillLength] : null;
++ final Object[] opresetValues = new Object[spillLength];
+ final Set<Integer> postsetValues = new LinkedHashSet<>();
+ final int callSiteFlags = codegen.getCallSiteFlags();
++ final Class<?> objectClass = dualFields ? JD.class : JO.class;
+ ArrayData arrayData = ArrayData.allocate(ScriptRuntime.EMPTY_ARRAY);
+
+ // Compute constant property values
+@@ -88,9 +91,9 @@
+ final Property property = propertyMap.findProperty(key);
+ if (property != null) {
+ // normal property key
+- property.setType(JSType.unboxedFieldType(constantValue));
++ property.setType(dualFields ? JSType.unboxedFieldType(constantValue) : Object.class);
+ final int slot = property.getSlot();
+- if (!OBJECT_FIELDS_ONLY && constantValue instanceof Number) {
++ if (dualFields && constantValue instanceof Number) {
+ jpresetValues[slot] = ObjectClassGenerator.pack((Number)constantValue);
+ } else {
+ opresetValues[slot] = constantValue;
+@@ -127,40 +130,23 @@
+ pos++;
+ }
+
+- //assert postsetValues.isEmpty() : "test me " + postsetValues;
+-
+ // create object and invoke constructor
+- method._new(JO.class).dup();
++ method._new(objectClass).dup();
+ codegen.loadConstant(propertyMap);
+
+- //load primitive values to j spill array
+- codegen.loadConstant(jpresetValues);
+- for (final int i : postsetValues) {
+- final MapTuple<Expression> tuple = tuples.get(i);
+- final Property property = propertyMap.findProperty(tuple.key);
+- if (property != null && tuple.isPrimitive()) {
+- method.dup();
+- method.load(property.getSlot());
+- loadTuple(method, tuple);
+- method.arraystore();
+- }
++ // load primitive value spill array
++ if (dualFields) {
++ codegen.loadConstant(jpresetValues);
++ } else {
++ method.loadNull();
+ }
++ // load object value spill array
++ codegen.loadConstant(opresetValues);
+
+- //load object values to o spill array
+- codegen.loadConstant(opresetValues);
+- for (final int i : postsetValues) {
+- final MapTuple<Expression> tuple = tuples.get(i);
+- final Property property = propertyMap.findProperty(tuple.key);
+- if (property != null && !tuple.isPrimitive()) {
+- method.dup();
+- method.load(property.getSlot());
+- loadTuple(method, tuple);
+- method.arraystore();
+- }
+- }
++ // instantiate the script object with spill objects
++ method.invoke(constructorNoLookup(objectClass, PropertyMap.class, long[].class, Object[].class));
+
+- //instantiate the script object with spill objects
+- method.invoke(constructorNoLookup(JO.class, PropertyMap.class, long[].class, Object[].class));
++ helpOptimisticRecognizeDuplicateIdentity(method);
+
+ // Set prefix array data if any
+ if (arrayData.length() > 0) {
+@@ -169,10 +155,10 @@
+ method.invoke(virtualCallNoLookup(ScriptObject.class, "setArray", void.class, ArrayData.class));
+ }
+
+- // set postfix
++ // set postfix values
+ for (final int i : postsetValues) {
+- final MapTuple<Expression> tuple = tuples.get(i);
+- final Property property = propertyMap.findProperty(tuple.key);
++ final MapTuple<Expression> tuple = tuples.get(i);
++ final Property property = propertyMap.findProperty(tuple.key);
+ if (property == null) {
+ final int index = ArrayIndex.getArrayIndex(tuple.key);
+ assert ArrayIndex.isValidArrayIndex(index);
+@@ -181,6 +167,10 @@
+ //method.println("putting " + tuple + " into arraydata");
+ loadTuple(method, tuple);
+ method.dynamicSetIndex(callSiteFlags);
++ } else {
++ method.dup();
++ loadTuple(method, tuple);
++ method.dynamicSet(property.getKey(), codegen.getCallSiteFlags(), false);
+ }
+ }
+ }
+@@ -188,7 +178,9 @@
+ @Override
+ protected PropertyMap makeMap() {
+ assert propertyMap == null : "property map already initialized";
+- propertyMap = new MapCreator<>(JO.class, tuples).makeSpillMap(false);
++ final boolean dualFields = codegen.useDualFields();
++ final Class<? extends ScriptObject> clazz = dualFields ? JD.class : JO.class;
++ propertyMap = new MapCreator<>(clazz, tuples).makeSpillMap(false, codegen.useDualFields());
+ return propertyMap;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/codegen/SplitIntoFunctions.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/SplitIntoFunctions.java Wed Jul 01 21:54:30 2015 -0700
+@@ -51,6 +51,7 @@
+ import jdk.nashorn.internal.ir.IdentNode;
+ import jdk.nashorn.internal.ir.IfNode;
+ import jdk.nashorn.internal.ir.JumpStatement;
++import jdk.nashorn.internal.ir.JumpToInlinedFinally;
+ import jdk.nashorn.internal.ir.LiteralNode;
+ import jdk.nashorn.internal.ir.Node;
+ import jdk.nashorn.internal.ir.ReturnNode;
+@@ -100,7 +101,7 @@
+ public SplitIntoFunctions(final Compiler compiler) {
+ super(new BlockLexicalContext() {
+ @Override
+- protected Block afterSetStatements(Block block) {
++ protected Block afterSetStatements(final Block block) {
+ for(Statement stmt: block.getStatements()) {
+ assert !(stmt instanceof SplitNode);
+ }
+@@ -300,7 +301,7 @@
+ }
+
+ @Override
+- public boolean enterVarNode(VarNode varNode) {
++ public boolean enterVarNode(final VarNode varNode) {
+ if (!inSplitNode()) {
+ return super.enterVarNode(varNode);
+ }
+@@ -355,6 +356,11 @@
+ return leaveJumpNode(continueNode);
+ }
+
++ @Override
++ public Node leaveJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) {
++ return leaveJumpNode(jumpToInlinedFinally);
++ }
++
+ private JumpStatement leaveJumpNode(final JumpStatement jump) {
+ if (inSplitNode()) {
+ final SplitState splitState = getCurrentSplitState();
+--- ./nashorn/src/jdk/nashorn/internal/codegen/Splitter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/Splitter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -42,13 +42,17 @@
+ import jdk.nashorn.internal.ir.SplitNode;
+ import jdk.nashorn.internal.ir.Statement;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
++import jdk.nashorn.internal.runtime.Context;
+ import jdk.nashorn.internal.runtime.logging.DebugLogger;
++import jdk.nashorn.internal.runtime.logging.Loggable;
++import jdk.nashorn.internal.runtime.logging.Logger;
+ import jdk.nashorn.internal.runtime.options.Options;
+
+ /**
+ * Split the IR into smaller compile units.
+ */
+-final class Splitter extends NodeVisitor<LexicalContext> {
++@Logger(name="splitter")
++final class Splitter extends NodeVisitor<LexicalContext> implements Loggable {
+ /** Current compiler. */
+ private final Compiler compiler;
+
+@@ -78,7 +82,17 @@
+ this.compiler = compiler;
+ this.outermost = functionNode;
+ this.outermostCompileUnit = outermostCompileUnit;
+- this.log = compiler.getLogger();
++ this.log = initLogger(compiler.getContext());
++ }
++
++ @Override
++ public DebugLogger initLogger(final Context context) {
++ return context.getLogger(this.getClass());
++ }
++
++ @Override
++ public DebugLogger getLogger() {
++ return log;
+ }
+
+ /**
+@@ -89,7 +103,7 @@
+ FunctionNode split(final FunctionNode fn, final boolean top) {
+ FunctionNode functionNode = fn;
+
+- log.finest("Initiating split of '", functionNode.getName(), "'");
++ log.fine("Initiating split of '", functionNode.getName(), "'");
+
+ long weight = WeighNodes.weigh(functionNode);
+
+@@ -98,7 +112,7 @@
+ assert lc.isEmpty() : "LexicalContext not empty";
+
+ if (weight >= SPLIT_THRESHOLD) {
+- log.finest("Splitting '", functionNode.getName(), "' as its weight ", weight, " exceeds split threshold ", SPLIT_THRESHOLD);
++ log.info("Splitting '", functionNode.getName(), "' as its weight ", weight, " exceeds split threshold ", SPLIT_THRESHOLD);
+ functionNode = (FunctionNode)functionNode.accept(this);
+
+ if (functionNode.isSplit()) {
+--- ./nashorn/src/jdk/nashorn/internal/codegen/TypeEvaluator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/TypeEvaluator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -227,7 +227,8 @@
+ // gradually introduce them as needed. An easy one would be to do the same for .call(this) idiom.
+ final CallNode callExpr = (CallNode)expr;
+ final Expression fnExpr = callExpr.getFunction();
+- if (fnExpr instanceof FunctionNode) {
++ // Skip evaluation if running with eager compilation as we may violate constraints in RecompilableScriptFunctionData
++ if (fnExpr instanceof FunctionNode && compiler.getContext().getEnv()._lazy_compilation) {
+ final FunctionNode fn = (FunctionNode)fnExpr;
+ if (callExpr.getArgs().isEmpty()) {
+ final RecompilableScriptFunctionData data = compiler.getScriptFunctionData(fn.getId());
+--- ./nashorn/src/jdk/nashorn/internal/codegen/WeighNodes.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/WeighNodes.java Wed Jul 01 21:54:30 2015 -0700
+@@ -40,6 +40,7 @@
+ import jdk.nashorn.internal.ir.IdentNode;
+ import jdk.nashorn.internal.ir.IfNode;
+ import jdk.nashorn.internal.ir.IndexNode;
++import jdk.nashorn.internal.ir.JumpToInlinedFinally;
+ import jdk.nashorn.internal.ir.LexicalContext;
+ import jdk.nashorn.internal.ir.LiteralNode;
+ import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
+@@ -197,6 +198,12 @@
+ return indexNode;
+ }
+
++ @Override
++ public Node leaveJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) {
++ weight += BREAK_WEIGHT;
++ return jumpToInlinedFinally;
++ }
++
+ @SuppressWarnings("rawtypes")
+ @Override
+ public boolean enterLiteralNode(final LiteralNode literalNode) {
+--- ./nashorn/src/jdk/nashorn/internal/codegen/types/BooleanType.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/codegen/types/BooleanType.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,28 +1,3 @@
+-/*
+- * Copyright (c) 2010, 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. 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.
+- */
+-
+ /*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+--- ./nashorn/src/jdk/nashorn/internal/ir/AccessNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/AccessNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,8 +28,6 @@
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+-import jdk.nashorn.internal.parser.Token;
+-import jdk.nashorn.internal.parser.TokenType;
+
+ /**
+ * IR representation of a property access (period operator.)
+@@ -103,14 +101,6 @@
+ return property;
+ }
+
+- /**
+- * Return true if this node represents an index operation normally represented as {@link IndexNode}.
+- * @return true if an index access.
+- */
+- public boolean isIndex() {
+- return Token.descType(getToken()) == TokenType.LBRACKET;
+- }
+-
+ private AccessNode setBase(final Expression base) {
+ if (this.base == base) {
+ return this;
+--- ./nashorn/src/jdk/nashorn/internal/ir/BaseNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/BaseNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,9 +27,9 @@
+
+ import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
+
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
++import jdk.nashorn.internal.parser.TokenType;
+
+ /**
+ * IR base for accessing/indexing nodes.
+@@ -98,7 +98,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return type == null ? getMostPessimisticType() : type;
+ }
+
+@@ -123,6 +123,14 @@
+ }
+
+ /**
++ * Return true if this node represents an index operation normally represented as {@link IndexNode}.
++ * @return true if an index access.
++ */
++ public boolean isIndex() {
++ return isTokenType(TokenType.LBRACKET);
++ }
++
++ /**
+ * Mark this node as being the callee operand of a {@link CallNode}.
+ * @return a base node identical to this one in all aspects except with its function flag set.
+ */
+--- ./nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -31,7 +31,6 @@
+ import java.util.Collections;
+ import java.util.HashSet;
+ import java.util.Set;
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Ignore;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+@@ -57,9 +56,7 @@
+ private final int programPoint;
+
+ private final Type type;
+-
+ private transient Type cachedType;
+- private transient Object cachedTypeFunction;
+
+ @Ignore
+ private static final Set<TokenType> CAN_OVERFLOW =
+@@ -101,7 +98,7 @@
+ }
+
+ /**
+- * Returns true if the node is a comparison operation.
++ * Returns true if the node is a comparison operation (either equality, inequality, or relational).
+ * @return true if the node is a comparison operation.
+ */
+ public boolean isComparison() {
+@@ -121,6 +118,22 @@
+ }
+
+ /**
++ * Returns true if the node is a relational operation (less than (or equals), greater than (or equals)).
++ * @return true if the node is a relational operation.
++ */
++ public boolean isRelational() {
++ switch (tokenType()) {
++ case LT:
++ case GT:
++ case LE:
++ case GE:
++ return true;
++ default:
++ return false;
++ }
++ }
++
++ /**
+ * Returns true if the node is a logical operation.
+ * @return true if the node is a logical operation.
+ */
+@@ -143,24 +156,6 @@
+ }
+ }
+
+- private static final Function<Symbol, Type> UNKNOWN_LOCALS = new Function<Symbol, Type>() {
+- @Override
+- public Type apply(final Symbol t) {
+- return null;
+- }
+- };
+-
+- /**
+- * Return the widest possible type for this operation. This is used for compile time
+- * static type inference
+- *
+- * @return Type
+- */
+- @Override
+- public Type getWidestOperationType() {
+- return getWidestOperationType(UNKNOWN_LOCALS);
+- }
+-
+ /**
+ * Return the widest possible operand type for this operation.
+ *
+@@ -181,14 +176,15 @@
+ }
+ }
+
+- private Type getWidestOperationType(final Function<Symbol, Type> localVariableTypes) {
++ @Override
++ public Type getWidestOperationType() {
+ switch (tokenType()) {
+ case ADD:
+ case ASSIGN_ADD: {
+ // Compare this logic to decideType(Type, Type); it's similar, but it handles the optimistic type
+ // calculation case while this handles the conservative case.
+- final Type lhsType = lhs.getType(localVariableTypes);
+- final Type rhsType = rhs.getType(localVariableTypes);
++ final Type lhsType = lhs.getType();
++ final Type rhsType = rhs.getType();
+ if(lhsType == Type.BOOLEAN && rhsType == Type.BOOLEAN) {
+ // Will always fit in an int, as the value range is [0, 1, 2]. If we didn't treat them specially here,
+ // they'd end up being treated as generic INT operands and their sum would be conservatively considered
+@@ -238,8 +234,8 @@
+ case SUB:
+ case ASSIGN_MUL:
+ case ASSIGN_SUB: {
+- final Type lhsType = lhs.getType(localVariableTypes);
+- final Type rhsType = rhs.getType(localVariableTypes);
++ final Type lhsType = lhs.getType();
++ final Type rhsType = rhs.getType();
+ if(lhsType == Type.BOOLEAN && rhsType == Type.BOOLEAN) {
+ return Type.INT;
+ }
+@@ -253,20 +249,20 @@
+ return Type.UNDEFINED;
+ }
+ case ASSIGN: {
+- return rhs.getType(localVariableTypes);
++ return rhs.getType();
+ }
+ case INSTANCEOF: {
+ return Type.BOOLEAN;
+ }
+ case COMMALEFT: {
+- return lhs.getType(localVariableTypes);
++ return lhs.getType();
+ }
+ case COMMARIGHT: {
+- return rhs.getType(localVariableTypes);
++ return rhs.getType();
+ }
+ case AND:
+ case OR:{
+- return Type.widestReturnType(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes));
++ return Type.widestReturnType(lhs.getType(), rhs.getType());
+ }
+ default:
+ if (isComparison()) {
+@@ -316,7 +312,7 @@
+
+ @Override
+ public boolean isSelfModifying() {
+- return isAssignment() && tokenType() != TokenType.ASSIGN;
++ return isAssignment() && !isTokenType(TokenType.ASSIGN);
+ }
+
+ @Override
+@@ -487,7 +483,7 @@
+
+ /**
+ * Set the right hand side expression for this node
+- * @param rhs new left hand side expression
++ * @param rhs new right hand side expression
+ * @return a node equivalent to this one except for the requested change.
+ */
+ public BinaryNode setRHS(final Expression rhs) {
+@@ -497,6 +493,19 @@
+ return new BinaryNode(this, lhs, rhs, type, programPoint);
+ }
+
++ /**
++ * Set both the left and the right hand side expression for this node
++ * @param lhs new left hand side expression
++ * @param rhs new left hand side expression
++ * @return a node equivalent to this one except for the requested change.
++ */
++ public BinaryNode setOperands(final Expression lhs, final Expression rhs) {
++ if (this.lhs == lhs && this.rhs == rhs) {
++ return this;
++ }
++ return new BinaryNode(this, lhs, rhs, type, programPoint);
++ }
++
+ @Override
+ public int getProgramPoint() {
+ return programPoint;
+@@ -520,7 +529,7 @@
+ final TokenType tokenType = tokenType();
+ if(tokenType == TokenType.ADD || tokenType == TokenType.ASSIGN_ADD) {
+ return OPTIMISTIC_UNDECIDED_TYPE;
+- } else if (CAN_OVERFLOW.contains(tokenType())) {
++ } else if (CAN_OVERFLOW.contains(tokenType)) {
+ return Type.INT;
+ }
+ return getMostPessimisticType();
+@@ -541,24 +550,22 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
+- if(localVariableTypes == cachedTypeFunction) {
+- return cachedType;
++ public Type getType() {
++ if (cachedType == null) {
++ cachedType = getTypeUncached();
+ }
+- cachedType = getTypeUncached(localVariableTypes);
+- cachedTypeFunction = localVariableTypes;
+ return cachedType;
+ }
+
+- private Type getTypeUncached(final Function<Symbol, Type> localVariableTypes) {
++ private Type getTypeUncached() {
+ if(type == OPTIMISTIC_UNDECIDED_TYPE) {
+- return decideType(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes));
++ return decideType(lhs.getType(), rhs.getType());
+ }
+- final Type widest = getWidestOperationType(localVariableTypes);
++ final Type widest = getWidestOperationType();
+ if(type == null) {
+ return widest;
+ }
+- return Type.narrowest(widest, Type.widest(type, Type.widest(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes))));
++ return Type.narrowest(widest, Type.widest(type, Type.widest(lhs.getType(), rhs.getType())));
+ }
+
+ private static Type decideType(final Type lhsType, final Type rhsType) {
+--- ./nashorn/src/jdk/nashorn/internal/ir/Block.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/Block.java Wed Jul 01 21:54:30 2015 -0700
+@@ -298,6 +298,14 @@
+ }
+
+ /**
++ * Returns the last statement in the block.
++ * @return the last statement in the block, or null if the block has no statements.
++ */
++ public Statement getLastStatement() {
++ return statements.isEmpty() ? null : statements.get(statements.size() - 1);
++ }
++
++ /**
+ * Reset the statement list for this block
+ *
+ * @param lc lexical context
+--- ./nashorn/src/jdk/nashorn/internal/ir/BlockLexicalContext.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/BlockLexicalContext.java Wed Jul 01 21:54:30 2015 -0700
+@@ -74,7 +74,7 @@
+
+ @SuppressWarnings("unchecked")
+ @Override
+- public <T extends LexicalContextNode> T pop(final T node) {
++ public <T extends Node> T pop(final T node) {
+ T expected = node;
+ if (node instanceof Block) {
+ final List<Statement> newStatements = popStatements();
+--- ./nashorn/src/jdk/nashorn/internal/ir/BlockStatement.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/BlockStatement.java Wed Jul 01 21:54:30 2015 -0700
+@@ -40,6 +40,15 @@
+ /**
+ * Constructor
+ *
++ * @param block the block to execute
++ */
++ public BlockStatement(final Block block) {
++ this(block.getFirstStatementLineNumber(), block);
++ }
++
++ /**
++ * Constructor
++ *
+ * @param lineNumber line number
+ * @param block the block to execute
+ */
+--- ./nashorn/src/jdk/nashorn/internal/ir/BreakNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/BreakNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -77,7 +77,7 @@
+ }
+
+ @Override
+- public Label getTargetLabel(final BreakableNode target) {
++ Label getTargetLabel(final BreakableNode target) {
+ return target.getBreakLabel();
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/ir/CallNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/CallNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -30,7 +30,6 @@
+ import java.io.Serializable;
+ import java.util.Collections;
+ import java.util.List;
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Ignore;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+@@ -154,7 +153,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return optimisticType == null ? Type.OBJECT : optimisticType;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/ir/ContinueNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/ContinueNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -78,7 +78,7 @@
+ }
+
+ @Override
+- public Label getTargetLabel(final BreakableNode target) {
++ Label getTargetLabel(final BreakableNode target) {
+ return ((LoopNode)target).getContinueLabel();
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/ir/Expression.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/Expression.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,7 +25,6 @@
+
+ package jdk.nashorn.internal.ir;
+
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
+
+@@ -39,14 +38,7 @@
+
+ static final String OPT_IDENTIFIER = "%";
+
+- private static final Function<Symbol, Type> UNKNOWN_LOCALS = new Function<Symbol, Type>() {
+- @Override
+- public Type apply(final Symbol t) {
+- return null;
+- }
+- };
+-
+- Expression(final long token, final int start, final int finish) {
++ protected Expression(final long token, final int start, final int finish) {
+ super(token, start, finish);
+ }
+
+@@ -63,18 +55,7 @@
+ *
+ * @return the type of the expression.
+ */
+- public final Type getType() {
+- return getType(UNKNOWN_LOCALS);
+- }
+-
+- /**
+- * Returns the type of the expression under the specified symbol-to-type mapping. By default delegates to
+- * {@link #getType()} but expressions whose type depends on their subexpressions' types and expressions whose type
+- * depends on symbol type ({@link IdentNode}) will have a special implementation.
+- * @param localVariableTypes a mapping from symbols to their types, used for type calculation.
+- * @return the type of the expression under the specified symbol-to-type mapping.
+- */
+- public abstract Type getType(final Function<Symbol, Type> localVariableTypes);
++ public abstract Type getType();
+
+ /**
+ * Returns {@code true} if this expression depends exclusively on state that is constant
+--- ./nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -36,7 +36,6 @@
+ import java.util.EnumSet;
+ import java.util.Iterator;
+ import java.util.List;
+-import java.util.function.Function;
+ import jdk.nashorn.internal.AssertsEnabled;
+ import jdk.nashorn.internal.codegen.CompileUnit;
+ import jdk.nashorn.internal.codegen.Compiler;
+@@ -1142,8 +1141,17 @@
+ return getFlag(USES_SELF_SYMBOL);
+ }
+
++ /**
++ * Returns true if this is a named function expression (that is, it isn't a declared function, it isn't an
++ * anonymous function expression, and it isn't a program).
++ * @return true if this is a named function expression
++ */
++ public boolean isNamedFunctionExpression() {
++ return !getFlag(IS_PROGRAM | IS_ANONYMOUS | IS_DECLARED);
++ }
++
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return FUNCTION_TYPE;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/ir/GetSplitState.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/GetSplitState.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,7 +25,6 @@
+
+ package jdk.nashorn.internal.ir;
+
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.CompilerConstants;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+@@ -47,7 +46,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return Type.INT;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/ir/IdentNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/IdentNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -30,7 +30,6 @@
+ import static jdk.nashorn.internal.codegen.CompilerConstants.__LINE__;
+ import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
+
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+@@ -118,14 +117,13 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ if(type != null) {
+ return type;
+ } else if(symbol != null && symbol.isScope()) {
+ return Type.OBJECT;
+ }
+- final Type symbolType = localVariableTypes.apply(symbol);
+- return symbolType == null ? Type.UNDEFINED : symbolType;
++ return Type.UNDEFINED;
+ }
+
+ /**
+--- ./nashorn/src/jdk/nashorn/internal/ir/JoinPredecessorExpression.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/JoinPredecessorExpression.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,7 +25,6 @@
+
+ package jdk.nashorn.internal.ir;
+
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+@@ -71,8 +70,8 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
+- return expression.getType(localVariableTypes);
++ public Type getType() {
++ return expression.getType();
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/ir/JumpStatement.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/JumpStatement.java Wed Jul 01 21:54:30 2015 -0700
+@@ -101,7 +101,26 @@
+ * @throws ClassCastException if invoked on the kind of breakable node that this jump statement is not prepared to
+ * handle.
+ */
+- public abstract Label getTargetLabel(final BreakableNode target);
++ abstract Label getTargetLabel(final BreakableNode target);
++
++ /**
++ * Returns the label this jump statement targets.
++ * @param lc the lexical context
++ * @return the label this jump statement targets.
++ */
++ public Label getTargetLabel(final LexicalContext lc) {
++ return getTargetLabel(getTarget(lc));
++ }
++
++ /**
++ * Returns the limit node for popping scopes when this jump statement is effected.
++ * @param lc the current lexical context
++ * @return the limit node for popping scopes when this jump statement is effected.
++ */
++ public LexicalContextNode getPopScopeLimit(final LexicalContext lc) {
++ // In most cases (break and continue) this is equal to the target.
++ return getTarget(lc);
++ }
+
+ @Override
+ public JumpStatement setLocalVariableConversion(final LexicalContext lc, final LocalVariableConversion conversion) {
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/src/jdk/nashorn/internal/ir/JumpToInlinedFinally.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,90 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.internal.ir;
++
++import java.util.Objects;
++import jdk.nashorn.internal.codegen.Label;
++import jdk.nashorn.internal.ir.annotations.Immutable;
++import jdk.nashorn.internal.ir.visitor.NodeVisitor;
++
++/**
++ * IR representation for synthetic jump into an inlined finally statement.
++ */
++@Immutable
++public final class JumpToInlinedFinally extends JumpStatement {
++ private static final long serialVersionUID = 1L;
++
++ /**
++ * Constructor
++ *
++ * @param labelName label name for inlined finally block
++ */
++ public JumpToInlinedFinally(final String labelName) {
++ super(NO_LINE_NUMBER, NO_TOKEN, NO_FINISH, Objects.requireNonNull(labelName));
++ }
++
++ private JumpToInlinedFinally(final JumpToInlinedFinally breakNode, final LocalVariableConversion conversion) {
++ super(breakNode, conversion);
++ }
++
++ @Override
++ public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
++ if (visitor.enterJumpToInlinedFinally(this)) {
++ return visitor.leaveJumpToInlinedFinally(this);
++ }
++
++ return this;
++ }
++
++ @Override
++ JumpStatement createNewJumpStatement(final LocalVariableConversion conversion) {
++ return new JumpToInlinedFinally(this, conversion);
++ }
++
++ @Override
++ String getStatementName() {
++ return ":jumpToInlinedFinally";
++ }
++
++ @Override
++ public Block getTarget(final LexicalContext lc) {
++ return lc.getInlinedFinally(getLabelName());
++ }
++
++ @Override
++ public TryNode getPopScopeLimit(final LexicalContext lc) {
++ // Returns the try node to which this jump's target belongs. This will make scope popping also pop the scope
++ // for the body of the try block, if it needs scope.
++ return lc.getTryNodeForInlinedFinally(getLabelName());
++ }
++
++ @Override
++ Label getTargetLabel(final BreakableNode target) {
++ assert target != null;
++ // We're jumping to the entry of the inlined finally block
++ return ((Block)target).getEntryLabel();
++ }
++}
+--- ./nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -31,11 +31,13 @@
+ import jdk.nashorn.internal.runtime.Source;
+
+ /**
+- * A class that tracks the current lexical context of node visitation as a stack of {@link Block} nodes. Has special
+- * methods to retrieve useful subsets of the context.
++ * A class that tracks the current lexical context of node visitation as a stack
++ * of {@link Block} nodes. Has special methods to retrieve useful subsets of the
++ * context.
+ *
+- * This is implemented with a primitive array and a stack pointer, because it really makes a difference
+- * performance wise. None of the collection classes were optimal
++ * This is implemented with a primitive array and a stack pointer, because it
++ * really makes a difference performance-wise. None of the collection classes
++ * were optimal.
+ */
+ public class LexicalContext {
+ private LexicalContextNode[] stack;
+@@ -79,6 +81,7 @@
+ * {@link Block#NEEDS_SCOPE} because it atomically also sets the
+ * {@link FunctionNode#HAS_SCOPE_BLOCK} flag on the block's containing
+ * function.
++ *
+ * @param block the block that needs to be marked as creating a scope.
+ */
+ public void setBlockNeedsScope(final Block block) {
+@@ -97,8 +100,10 @@
+ }
+
+ /**
+- * Get the flags for a lexical context node on the stack
++ * Get the flags for a lexical context node on the stack.
++ *
+ * @param node node
++ *
+ * @return the flags for the node
+ */
+ public int getFlags(final LexicalContextNode node) {
+@@ -112,8 +117,10 @@
+
+ /**
+ * Get the function body of a function node on the lexical context
+- * stack. This will trigger an assertion if node isn't present
++ * stack. This will trigger an assertion if node isn't present.
++ *
+ * @param functionNode function node
++ *
+ * @return body of function node
+ */
+ public Block getFunctionBody(final FunctionNode functionNode) {
+@@ -126,15 +133,16 @@
+ }
+
+ /**
+- * Return all nodes in the LexicalContext
+- * @return all nodes
++ * @return all nodes in the LexicalContext.
+ */
+ public Iterator<LexicalContextNode> getAllNodes() {
+ return new NodeIterator<>(LexicalContextNode.class);
+ }
+
+ /**
+- * Returns the outermost function in this context. It is either the program, or a lazily compiled function.
++ * Returns the outermost function in this context. It is either the program,
++ * or a lazily compiled function.
++ *
+ * @return the outermost function in this context.
+ */
+ public FunctionNode getOutermostFunction() {
+@@ -142,8 +150,12 @@
+ }
+
+ /**
+- * Pushes a new block on top of the context, making it the innermost open block.
++ * Pushes a new block on top of the context, making it the innermost open
++ * block.
++ *
++ * @param <T> the type of the new node
+ * @param node the new node
++ *
+ * @return the node that was pushed
+ */
+ public <T extends LexicalContextNode> T push(final T node) {
+@@ -168,29 +180,32 @@
+
+ /**
+ * Is the context empty?
+- * @return true if empty
++ *
++ * @return {@code true} if empty
+ */
+ public boolean isEmpty() {
+ return sp == 0;
+ }
+
+ /**
+- * The depth of the lexical context
+- * @return depth
++ * @return the depth of the lexical context.
+ */
+ public int size() {
+ return sp;
+ }
+
+ /**
+- * Pops the innermost block off the context and all nodes that has been contributed
+- * since it was put there
++ * Pops the innermost block off the context and all nodes that has been
++ * contributed since it was put there.
+ *
+- * @param node the node expected to be popped, used to detect unbalanced pushes/pops
++ * @param <T> the type of the node to be popped
++ * @param node the node expected to be popped, used to detect unbalanced
++ * pushes/pops
++ *
+ * @return the node that was popped
+ */
+ @SuppressWarnings("unchecked")
+- public <T extends LexicalContextNode> T pop(final T node) {
++ public <T extends Node> T pop(final T node) {
+ --sp;
+ final LexicalContextNode popped = stack[sp];
+ stack[sp] = null;
+@@ -202,11 +217,17 @@
+ }
+
+ /**
+- * Explicitly apply flags to the topmost element on the stack. This is only valid to use from a
+- * {@code NodeVisitor.leaveXxx()} method and only on the node being exited at the time. It is not mandatory to use,
+- * as {@link #pop(LexicalContextNode)} will apply the flags automatically, but this method can be used to apply them
+- * during the {@code leaveXxx()} method in case its logic depends on the value of the flags.
+- * @param node the node to apply the flags to. Must be the topmost node on the stack.
++ * Explicitly apply flags to the topmost element on the stack. This is only
++ * valid to use from a {@code NodeVisitor.leaveXxx()} method and only on the
++ * node being exited at the time. It is not mandatory to use, as
++ * {@link #pop(Node)} will apply the flags automatically, but this method
++ * can be used to apply them during the {@code leaveXxx()} method in case
++ * its logic depends on the value of the flags.
++ *
++ * @param <T> the type of the node to apply the flags to.
++ * @param node the node to apply the flags to. Must be the topmost node on
++ * the stack.
++ *
+ * @return the passed in node, or a modified node (if any flags were modified)
+ */
+ public <T extends LexicalContextNode & Flags<T>> T applyTopFlags(final T node) {
+@@ -215,7 +236,8 @@
+ }
+
+ /**
+- * Return the top element in the context
++ * Return the top element in the context.
++ *
+ * @return the node that was pushed last
+ */
+ public LexicalContextNode peek() {
+@@ -223,9 +245,11 @@
+ }
+
+ /**
+- * Check if a node is in the lexical context
++ * Check if a node is in the lexical context.
++ *
+ * @param node node to check for
+- * @return true if in the context
++ *
++ * @return {@code true} if in the context
+ */
+ public boolean contains(final LexicalContextNode node) {
+ for (int i = 0; i < sp; i++) {
+@@ -242,6 +266,7 @@
+ *
+ * @param oldNode old node
+ * @param newNode new node
++ *
+ * @return the new node
+ */
+ public LexicalContextNode replace(final LexicalContextNode oldNode, final LexicalContextNode newNode) {
+@@ -256,7 +281,9 @@
+ }
+
+ /**
+- * Returns an iterator over all blocks in the context, with the top block (innermost lexical context) first.
++ * Returns an iterator over all blocks in the context, with the top block
++ * (innermost lexical context) first.
++ *
+ * @return an iterator over all blocks in the context.
+ */
+ public Iterator<Block> getBlocks() {
+@@ -264,7 +291,9 @@
+ }
+
+ /**
+- * Returns an iterator over all functions in the context, with the top (innermost open) function first.
++ * Returns an iterator over all functions in the context, with the top
++ * (innermost open) function first.
++ *
+ * @return an iterator over all functions in the context.
+ */
+ public Iterator<FunctionNode> getFunctions() {
+@@ -273,6 +302,7 @@
+
+ /**
+ * Get the parent block for the current lexical context block
++ *
+ * @return parent block
+ */
+ public Block getParentBlock() {
+@@ -283,7 +313,9 @@
+
+ /**
+ * Gets the label node of the current block.
+- * @return the label node of the current block, if it is labeled. Otherwise returns null.
++ *
++ * @return the label node of the current block, if it is labeled. Otherwise
++ * returns {@code null}.
+ */
+ public LabelNode getCurrentBlockLabelNode() {
+ assert stack[sp - 1] instanceof Block;
+@@ -294,21 +326,12 @@
+ return parent instanceof LabelNode ? (LabelNode)parent : null;
+ }
+
+-
+- /*
+- public FunctionNode getProgram() {
+- final Iterator<FunctionNode> iter = getFunctions();
+- FunctionNode last = null;
+- while (iter.hasNext()) {
+- last = iter.next();
+- }
+- assert last != null;
+- return last;
+- }*/
+-
+ /**
+- * Returns an iterator over all ancestors block of the given block, with its parent block first.
++ * Returns an iterator over all ancestors block of the given block, with its
++ * parent block first.
++ *
+ * @param block the block whose ancestors are returned
++ *
+ * @return an iterator over all ancestors block of the given block.
+ */
+ public Iterator<Block> getAncestorBlocks(final Block block) {
+@@ -323,8 +346,11 @@
+ }
+
+ /**
+- * Returns an iterator over a block and all its ancestors blocks, with the block first.
++ * Returns an iterator over a block and all its ancestors blocks, with the
++ * block first.
++ *
+ * @param block the block that is the starting point of the iteration.
++ *
+ * @return an iterator over a block and all its ancestors.
+ */
+ public Iterator<Block> getBlocks(final Block block) {
+@@ -352,7 +378,9 @@
+
+ /**
+ * Get the function for this block.
++ *
+ * @param block block for which to get function
++ *
+ * @return function for block
+ */
+ public FunctionNode getFunction(final Block block) {
+@@ -373,7 +401,6 @@
+ }
+
+ /**
+- * Returns the innermost block in the context.
+ * @return the innermost block in the context.
+ */
+ public Block getCurrentBlock() {
+@@ -381,7 +408,6 @@
+ }
+
+ /**
+- * Returns the innermost function in the context.
+ * @return the innermost function in the context.
+ */
+ public FunctionNode getCurrentFunction() {
+@@ -394,9 +420,12 @@
+ }
+
+ /**
+- * Get the block in which a symbol is defined
++ * Get the block in which a symbol is defined.
++ *
+ * @param symbol symbol
+- * @return block in which the symbol is defined, assert if no such block in context
++ *
++ * @return block in which the symbol is defined, assert if no such block in
++ * context.
+ */
+ public Block getDefiningBlock(final Symbol symbol) {
+ final String name = symbol.getName();
+@@ -410,9 +439,12 @@
+ }
+
+ /**
+- * Get the function in which a symbol is defined
++ * Get the function in which a symbol is defined.
++ *
+ * @param symbol symbol
+- * @return function node in which this symbol is defined, assert if no such symbol exists in context
++ *
++ * @return function node in which this symbol is defined, assert if no such
++ * symbol exists in context.
+ */
+ public FunctionNode getDefiningFunction(final Symbol symbol) {
+ final String name = symbol.getName();
+@@ -433,7 +465,8 @@
+
+ /**
+ * Is the topmost lexical context element a function body?
+- * @return true if function body
++ *
++ * @return {@code true} if function body.
+ */
+ public boolean isFunctionBody() {
+ return getParentBlock() == null;
+@@ -441,16 +474,20 @@
+
+ /**
+ * Is the topmost lexical context element body of a SplitNode?
+- * @return true if it's the body of a split node.
++ *
++ * @return {@code true} if it's the body of a split node.
+ */
+ public boolean isSplitBody() {
+ return sp >= 2 && stack[sp - 1] instanceof Block && stack[sp - 2] instanceof SplitNode;
+ }
+
+ /**
+- * Get the parent function for a function in the lexical context
++ * Get the parent function for a function in the lexical context.
++ *
+ * @param functionNode function for which to get parent
+- * @return parent function of functionNode or null if none (e.g. if functionNode is the program)
++ *
++ * @return parent function of functionNode or {@code null} if none (e.g., if
++ * functionNode is the program).
+ */
+ public FunctionNode getParentFunction(final FunctionNode functionNode) {
+ final Iterator<FunctionNode> iter = new NodeIterator<>(FunctionNode.class);
+@@ -465,12 +502,16 @@
+ }
+
+ /**
+- * Count the number of scopes until a given node. Note that this method is solely used to figure out the number of
+- * scopes that need to be explicitly popped in order to perform a break or continue jump within the current bytecode
+- * method. For this reason, the method returns 0 if it encounters a {@code SplitNode} between the current location
+- * and the break/continue target.
+- * @param until node to stop counting at. Must be within the current function
+- * @return number of with scopes encountered in the context
++ * Count the number of scopes until a given node. Note that this method is
++ * solely used to figure out the number of scopes that need to be explicitly
++ * popped in order to perform a break or continue jump within the current
++ * bytecode method. For this reason, the method returns 0 if it encounters a
++ * {@code SplitNode} between the current location and the break/continue
++ * target.
++ *
++ * @param until node to stop counting at. Must be within the current function.
++ *
++ * @return number of with scopes encountered in the context.
+ */
+ public int getScopeNestingLevelTo(final LexicalContextNode until) {
+ assert until != null;
+@@ -500,16 +541,17 @@
+ }
+
+ /**
+- * Check whether the lexical context is currently inside a loop
+- * @return true if inside a loop
++ * Check whether the lexical context is currently inside a loop.
++ *
++ * @return {@code true} if inside a loop
+ */
+ public boolean inLoop() {
+ return getCurrentLoop() != null;
+ }
+
+ /**
+- * Returns the loop header of the current loop, or null if not inside a loop
+- * @return loop header
++ * @return the loop header of the current loop, or {@code null} if not
++ * inside a loop.
+ */
+ public LoopNode getCurrentLoop() {
+ final Iterator<LoopNode> iter = new NodeIterator<>(LoopNode.class, getCurrentFunction());
+@@ -518,9 +560,12 @@
+
+ /**
+ * Find the breakable node corresponding to this label.
+- * @param labelName name of the label to search for. If null, the closest breakable node will be returned
+- * unconditionally, e.g. a while loop with no label
+- * @return closest breakable node
++ *
++ * @param labelName name of the label to search for. If {@code null}, the
++ * closest breakable node will be returned unconditionally, e.g., a
++ * while loop with no label.
++ *
++ * @return closest breakable node.
+ */
+ public BreakableNode getBreakable(final String labelName) {
+ if (labelName != null) {
+@@ -544,9 +589,12 @@
+
+ /**
+ * Find the continue target node corresponding to this label.
+- * @param labelName label name to search for. If null the closest loop node will be returned unconditionally, e.g. a
+- * while loop with no label
+- * @return closest continue target node
++ *
++ * @param labelName label name to search for. If {@code null} the closest
++ * loop node will be returned unconditionally, e.g., a while loop
++ * with no label.
++ *
++ * @return closest continue target node.
+ */
+ public LoopNode getContinueTo(final String labelName) {
+ if (labelName != null) {
+@@ -565,9 +613,45 @@
+ }
+
+ /**
+- * Check the lexical context for a given label node by name
+- * @param name name of the label
+- * @return LabelNode if found, null otherwise
++ * Find the inlined finally block node corresponding to this label.
++ *
++ * @param labelName label name to search for. Must not be {@code null}.
++ *
++ * @return closest inlined finally block with the given label.
++ */
++ public Block getInlinedFinally(final String labelName) {
++ for (final NodeIterator<TryNode> iter = new NodeIterator<>(TryNode.class); iter.hasNext(); ) {
++ final Block inlinedFinally = iter.next().getInlinedFinally(labelName);
++ if (inlinedFinally != null) {
++ return inlinedFinally;
++ }
++ }
++ return null;
++ }
++
++ /**
++ * Find the try node for an inlined finally block corresponding to this label.
++ *
++ * @param labelName label name to search for. Must not be {@code null}.
++ *
++ * @return the try node to which the labelled inlined finally block belongs.
++ */
++ public TryNode getTryNodeForInlinedFinally(final String labelName) {
++ for (final NodeIterator<TryNode> iter = new NodeIterator<>(TryNode.class); iter.hasNext(); ) {
++ final TryNode tryNode = iter.next();
++ if (tryNode.getInlinedFinally(labelName) != null) {
++ return tryNode;
++ }
++ }
++ return null;
++ }
++
++ /**
++ * Check the lexical context for a given label node by name.
++ *
++ * @param name name of the label.
++ *
++ * @return LabelNode if found, {@code null} otherwise.
+ */
+ public LabelNode findLabel(final String name) {
+ for (final Iterator<LabelNode> iter = new NodeIterator<>(LabelNode.class, getCurrentFunction()); iter.hasNext(); ) {
+@@ -580,10 +664,13 @@
+ }
+
+ /**
+- * Checks whether a given target is a jump destination that lies outside a given split node
+- * @param splitNode the split node
+- * @param target the target node
+- * @return true if target resides outside the split node
++ * Checks whether a given target is a jump destination that lies outside a
++ * given split node.
++ *
++ * @param splitNode the split node.
++ * @param target the target node.
++ *
++ * @return {@code true} if target resides outside the split node.
+ */
+ public boolean isExternalTarget(final SplitNode splitNode, final BreakableNode target) {
+ for (int i = sp; i-- > 0;) {
+@@ -592,14 +679,22 @@
+ return true;
+ } else if (next == target) {
+ return false;
++ } else if (next instanceof TryNode) {
++ for(final Block inlinedFinally: ((TryNode)next).getInlinedFinallies()) {
++ if (TryNode.getLabelledInlinedFinallyBlock(inlinedFinally) == target) {
++ return false;
++ }
++ }
+ }
+ }
+ throw new AssertionError(target + " was expected in lexical context " + LexicalContext.this + " but wasn't");
+ }
+
+ /**
+- * Checks whether the current context is inside a switch statement without explicit blocks (curly braces).
+- * @return true if in unprotected switch statement
++ * Checks whether the current context is inside a switch statement without
++ * explicit blocks (curly braces).
++ *
++ * @return {@code true} if in unprotected switch statement.
+ */
+ public boolean inUnprotectedSwitchContext() {
+ for (int i = sp; i > 0; i--) {
+--- ./nashorn/src/jdk/nashorn/internal/ir/LexicalContextNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/LexicalContextNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -54,8 +54,8 @@
+ static Node accept(final LexicalContextNode node, final NodeVisitor<? extends LexicalContext> visitor) {
+ final LexicalContext lc = visitor.getLexicalContext();
+ lc.push(node);
+- final LexicalContextNode newNode = (LexicalContextNode)node.accept(lc, visitor);
+- return (Node)lc.pop(newNode);
++ final Node newNode = node.accept(lc, visitor);
++ return lc.pop(newNode);
+ }
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -29,7 +29,6 @@
+ import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.List;
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.CompileUnit;
+ import jdk.nashorn.internal.codegen.types.ArrayType;
+ import jdk.nashorn.internal.codegen.types.Type;
+@@ -109,7 +108,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return Type.typeFor(value.getClass());
+ }
+
+@@ -164,16 +163,6 @@
+ }
+
+ /**
+- * Get the array value of the node
+- *
+- * @return the array value
+- */
+- public Node[] getArray() {
+- assert false : "not an array node";
+- return null;
+- }
+-
+- /**
+ * Fetch String value of node.
+ *
+ * @return String value of node.
+@@ -325,7 +314,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return Type.BOOLEAN;
+ }
+
+@@ -389,7 +378,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return type;
+ }
+
+@@ -519,7 +508,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return Type.OBJECT;
+ }
+
+@@ -589,7 +578,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return Type.OBJECT;
+ }
+
+@@ -840,9 +829,13 @@
+ this.units = units;
+ }
+
+- @Override
+- public Node[] getArray() {
+- return value;
++ /**
++ * Returns a list of array element expressions. Note that empty array elements manifest themselves as
++ * null.
++ * @return a list of array element expressions.
++ */
++ public List<Expression> getElementExpressions() {
++ return Collections.unmodifiableList(Arrays.asList(value));
+ }
+
+ /**
+@@ -879,7 +872,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return Type.typeFor(NativeArray.class);
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/ir/Node.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/Node.java Wed Jul 01 21:54:30 2015 -0700
+@@ -220,26 +220,28 @@
+ }
+
+ /**
+- * Return token tokenType from a token descriptor.
++ * Returns this node's token's type. If you want to check for the node having a specific token type,
++ * consider using {@link #isTokenType(TokenType)} instead.
+ *
+- * @return Type of token.
++ * @return type of token.
+ */
+ public TokenType tokenType() {
+ return Token.descType(token);
+ }
+
+ /**
+- * Test token tokenType.
++ * Tests if this node has the specific token type.
+ *
+- * @param type a type to check this token against
++ * @param type a token type to check this node's token type against
+ * @return true if token types match.
+ */
+ public boolean isTokenType(final TokenType type) {
+- return Token.descType(token) == type;
++ return tokenType() == type;
+ }
+
+ /**
+- * Get the token for this location
++ * Get the token for this node. If you want to retrieve the token's type, consider using
++ * {@link #tokenType()} or {@link #isTokenType(TokenType)} instead.
+ * @return the token
+ */
+ public long getToken() {
+--- ./nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,7 +27,6 @@
+
+ import java.util.Collections;
+ import java.util.List;
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+@@ -69,7 +68,7 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return Type.OBJECT;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/ir/OptimisticLexicalContext.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/OptimisticLexicalContext.java Wed Jul 01 21:54:30 2015 -0700
+@@ -115,7 +115,7 @@
+ }
+
+ @Override
+- public <T extends LexicalContextNode> T pop(final T node) {
++ public <T extends Node> T pop(final T node) {
+ final T popped = super.pop(node);
+ if (isEnabled) {
+ if(node instanceof FunctionNode) {
+--- ./nashorn/src/jdk/nashorn/internal/ir/RuntimeNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/RuntimeNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,12 +25,9 @@
+
+ package jdk.nashorn.internal.ir;
+
+-import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
+-
+ import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.List;
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+@@ -40,7 +37,7 @@
+ * IR representation for a runtime call.
+ */
+ @Immutable
+-public class RuntimeNode extends Expression implements Optimistic {
++public class RuntimeNode extends Expression {
+ private static final long serialVersionUID = 1L;
+
+ /**
+@@ -334,11 +331,6 @@
+ /** Call arguments. */
+ private final List<Expression> args;
+
+- /** is final - i.e. may not be removed again, lower in the code pipeline */
+- private final boolean isFinal;
+-
+- private final int programPoint;
+-
+ /**
+ * Constructor
+ *
+@@ -352,17 +344,13 @@
+
+ this.request = request;
+ this.args = args;
+- this.isFinal = false;
+- this.programPoint = INVALID_PROGRAM_POINT;
+ }
+
+- private RuntimeNode(final RuntimeNode runtimeNode, final Request request, final boolean isFinal, final List<Expression> args, final int programPoint) {
++ private RuntimeNode(final RuntimeNode runtimeNode, final Request request, final List<Expression> args) {
+ super(runtimeNode);
+
+ this.request = request;
+ this.args = args;
+- this.isFinal = isFinal;
+- this.programPoint = programPoint;
+ }
+
+ /**
+@@ -400,8 +388,6 @@
+
+ this.request = request;
+ this.args = args;
+- this.isFinal = false;
+- this.programPoint = parent instanceof Optimistic ? ((Optimistic)parent).getProgramPoint() : INVALID_PROGRAM_POINT;
+ }
+
+ /**
+@@ -429,38 +415,17 @@
+ * @return new runtime node or same if same request
+ */
+ public RuntimeNode setRequest(final Request request) {
+- if (this.request == request) {
+- return this;
+- }
+- return new RuntimeNode(this, request, isFinal, args, programPoint);
+- }
+-
+-
+- /**
+- * Is this node final - i.e. it can never be replaced with other nodes again
+- * @return true if final
+- */
+- public boolean isFinal() {
+- return isFinal;
+- }
+-
+- /**
+- * Flag this node as final - i.e it may never be replaced with other nodes again
+- * @param isFinal is the node final, i.e. can not be removed and replaced by a less generic one later in codegen
+- * @return same runtime node if already final, otherwise a new one
+- */
+- public RuntimeNode setIsFinal(final boolean isFinal) {
+- if (this.isFinal == isFinal) {
++ if (this.request == request) {
+ return this;
+ }
+- return new RuntimeNode(this, request, isFinal, args, programPoint);
+- }
++ return new RuntimeNode(this, request, args);
++ }
+
+ /**
+ * Return type for the ReferenceNode
+ */
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
++ public Type getType() {
+ return request.getReturnType();
+ }
+
+@@ -511,7 +476,7 @@
+ if (this.args == args) {
+ return this;
+ }
+- return new RuntimeNode(this, request, isFinal, args, programPoint);
++ return new RuntimeNode(this, request, args);
+ }
+
+ /**
+@@ -537,39 +502,4 @@
+ }
+ return true;
+ }
+-
+-//TODO these are blank for now:
+-
+- @Override
+- public int getProgramPoint() {
+- return programPoint;
+- }
+-
+- @Override
+- public RuntimeNode setProgramPoint(final int programPoint) {
+- if(this.programPoint == programPoint) {
+- return this;
+- }
+- return new RuntimeNode(this, request, isFinal, args, programPoint);
+- }
+-
+- @Override
+- public boolean canBeOptimistic() {
+- return false;
+- }
+-
+- @Override
+- public Type getMostOptimisticType() {
+- return getType();
+- }
+-
+- @Override
+- public Type getMostPessimisticType() {
+- return getType();
+- }
+-
+- @Override
+- public RuntimeNode setType(final Type type) {
+- return this;
+- }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/ir/SplitReturn.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/SplitReturn.java Wed Jul 01 21:54:30 2015 -0700
+@@ -54,7 +54,7 @@
+ }
+
+ @Override
+- public void toString(StringBuilder sb, boolean printType) {
++ public void toString(final StringBuilder sb, final boolean printType) {
+ sb.append(":splitreturn;");
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,7 +25,6 @@
+
+ package jdk.nashorn.internal.ir;
+
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+@@ -122,8 +121,8 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
+- return Type.widestReturnType(getTrueExpression().getType(localVariableTypes), getFalseExpression().getType(localVariableTypes));
++ public Type getType() {
++ return Type.widestReturnType(getTrueExpression().getType(), getFalseExpression().getType());
+ }
+
+
+--- ./nashorn/src/jdk/nashorn/internal/ir/TryNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/TryNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,7 +27,9 @@
+
+ import java.util.ArrayList;
+ import java.util.Collections;
++import java.util.HashSet;
+ import java.util.List;
++import java.util.Set;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+@@ -35,7 +37,7 @@
+ * IR representation of a TRY statement.
+ */
+ @Immutable
+-public final class TryNode extends Statement implements JoinPredecessor {
++public final class TryNode extends LexicalContextStatement implements JoinPredecessor {
+ private static final long serialVersionUID = 1L;
+
+ /** Try statements. */
+@@ -47,12 +49,24 @@
+ /** Finally clause. */
+ private final Block finallyBody;
+
++ /**
++ * List of inlined finally blocks. The structure of every inlined finally is:
++ * Block(LabelNode(label, Block(finally-statements, (JumpStatement|ReturnNode)?))).
++ * That is, the block has a single LabelNode statement with the label and a block containing the
++ * statements of the inlined finally block with the jump or return statement appended (if the finally
++ * block was not terminal; the original jump/return is simply ignored if the finally block itself
++ * terminates). The reason for this somewhat strange arrangement is that we didn't want to create a
++ * separate class for the (label, BlockStatement pair) but rather reused the already available LabelNode.
++ * However, if we simply used List&lt;LabelNode&gt; without wrapping the label nodes in an additional Block,
++ * that would've thrown off visitors relying on BlockLexicalContext -- same reason why we never use
++ * Statement as the type of bodies of e.g. IfNode, WhileNode etc. but rather blockify them even when they're
++ * single statements.
++ */
++ private final List<Block> inlinedFinallies;
++
+ /** Exception symbol. */
+ private Symbol exception;
+
+- /** Catchall exception for finally expansion, where applicable */
+- private Symbol finallyCatchAll;
+-
+ private final LocalVariableConversion conversion;
+
+ /**
+@@ -71,21 +85,23 @@
+ this.catchBlocks = catchBlocks;
+ this.finallyBody = finallyBody;
+ this.conversion = null;
++ this.inlinedFinallies = Collections.emptyList();
+ }
+
+- private TryNode(final TryNode tryNode, final Block body, final List<Block> catchBlocks, final Block finallyBody, final LocalVariableConversion conversion) {
++ private TryNode(final TryNode tryNode, final Block body, final List<Block> catchBlocks, final Block finallyBody, final LocalVariableConversion conversion, final List<Block> inlinedFinallies) {
+ super(tryNode);
+ this.body = body;
+ this.catchBlocks = catchBlocks;
+ this.finallyBody = finallyBody;
+ this.conversion = conversion;
++ this.inlinedFinallies = inlinedFinallies;
+ this.exception = tryNode.exception;
+ }
+
+ @Override
+ public Node ensureUniqueLabels(final LexicalContext lc) {
+ //try nodes are never in lex context
+- return new TryNode(this, body, catchBlocks, finallyBody, conversion);
++ return new TryNode(this, body, catchBlocks, finallyBody, conversion, inlinedFinallies);
+ }
+
+ @Override
+@@ -106,16 +122,16 @@
+ * @param visitor IR navigating visitor.
+ */
+ @Override
+- public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
++ public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
+ if (visitor.enterTryNode(this)) {
+ // Need to do finallybody first for termination analysis. TODO still necessary?
+ final Block newFinallyBody = finallyBody == null ? null : (Block)finallyBody.accept(visitor);
+ final Block newBody = (Block)body.accept(visitor);
+ return visitor.leaveTryNode(
+- setBody(newBody).
+- setFinallyBody(newFinallyBody).
+- setCatchBlocks(Node.accept(visitor, catchBlocks)).
+- setFinallyCatchAll(finallyCatchAll));
++ setBody(lc, newBody).
++ setFinallyBody(lc, newFinallyBody).
++ setCatchBlocks(lc, Node.accept(visitor, catchBlocks)).
++ setInlinedFinallies(lc, Node.accept(visitor, inlinedFinallies)));
+ }
+
+ return this;
+@@ -136,14 +152,15 @@
+
+ /**
+ * Reset the body of this try block
++ * @param lc current lexical context
+ * @param body new body
+ * @return new TryNode or same if unchanged
+ */
+- public TryNode setBody(final Block body) {
++ public TryNode setBody(final LexicalContext lc, final Block body) {
+ if (this.body == body) {
+ return this;
+ }
+- return new TryNode(this, body, catchBlocks, finallyBody, conversion);
++ return Node.replaceInLexicalContext(lc, this, new TryNode(this, body, catchBlocks, finallyBody, conversion, inlinedFinallies));
+ }
+
+ /**
+@@ -172,14 +189,15 @@
+
+ /**
+ * Set the catch blocks of this try
++ * @param lc current lexical context
+ * @param catchBlocks list of catch blocks
+ * @return new TryNode or same if unchanged
+ */
+- public TryNode setCatchBlocks(final List<Block> catchBlocks) {
++ public TryNode setCatchBlocks(final LexicalContext lc, final List<Block> catchBlocks) {
+ if (this.catchBlocks == catchBlocks) {
+ return this;
+ }
+- return new TryNode(this, body, catchBlocks, finallyBody, conversion);
++ return Node.replaceInLexicalContext(lc, this, new TryNode(this, body, catchBlocks, finallyBody, conversion, inlinedFinallies));
+ }
+
+ /**
+@@ -200,27 +218,6 @@
+ }
+
+ /**
+- * Get the catch all symbol for this try block
+- * @return catch all symbol
+- */
+- public Symbol getFinallyCatchAll() {
+- return this.finallyCatchAll;
+- }
+-
+- /**
+- * If a finally block exists, the synthetic catchall needs another symbol to
+- * store its throwable
+- * @param finallyCatchAll a symbol for the finally catch all exception
+- * @return new TryNode or same if unchanged
+- *
+- * TODO can this still be stateful?
+- */
+- public TryNode setFinallyCatchAll(final Symbol finallyCatchAll) {
+- this.finallyCatchAll = finallyCatchAll;
+- return this;
+- }
+-
+- /**
+ * Get the body of the finally clause for this try
+ * @return finally body, or null if no finally
+ */
+@@ -229,15 +226,87 @@
+ }
+
+ /**
++ * Get the inlined finally block with the given label name. This returns the actual finally block in the
++ * {@link LabelNode}, not the outer wrapper block for the {@link LabelNode}.
++ * @param labelName the name of the inlined finally's label
++ * @return the requested finally block, or null if no finally block's label matches the name.
++ */
++ public Block getInlinedFinally(final String labelName) {
++ for(final Block inlinedFinally: inlinedFinallies) {
++ final LabelNode labelNode = getInlinedFinallyLabelNode(inlinedFinally);
++ if (labelNode.getLabelName().equals(labelName)) {
++ return labelNode.getBody();
++ }
++ }
++ return null;
++ }
++
++ private static LabelNode getInlinedFinallyLabelNode(final Block inlinedFinally) {
++ return (LabelNode)inlinedFinally.getStatements().get(0);
++ }
++
++ /**
++ * Given an outer wrapper block for the {@link LabelNode} as returned by {@link #getInlinedFinallies()},
++ * returns its actual inlined finally block.
++ * @param inlinedFinally the outer block for inlined finally, as returned as an element of
++ * {@link #getInlinedFinallies()}.
++ * @return the block contained in the {@link LabelNode} contained in the passed block.
++ */
++ public static Block getLabelledInlinedFinallyBlock(final Block inlinedFinally) {
++ return getInlinedFinallyLabelNode(inlinedFinally).getBody();
++ }
++
++ /**
++ * Returns a list of inlined finally blocks. Note that this returns a list of {@link Block}s such that each one of
++ * them has a single {@link LabelNode}, which in turn contains the label name for the finally block and the
++ * actual finally block. To safely extract the actual finally block, use
++ * {@link #getLabelledInlinedFinallyBlock(Block)}.
++ * @return a list of inlined finally blocks.
++ */
++ public List<Block> getInlinedFinallies() {
++ return Collections.unmodifiableList(inlinedFinallies);
++ }
++
++ /**
+ * Set the finally body of this try
++ * @param lc current lexical context
+ * @param finallyBody new finally body
+ * @return new TryNode or same if unchanged
+ */
+- public TryNode setFinallyBody(final Block finallyBody) {
++ public TryNode setFinallyBody(final LexicalContext lc, final Block finallyBody) {
+ if (this.finallyBody == finallyBody) {
+ return this;
+ }
+- return new TryNode(this, body, catchBlocks, finallyBody, conversion);
++ return Node.replaceInLexicalContext(lc, this, new TryNode(this, body, catchBlocks, finallyBody, conversion, inlinedFinallies));
++ }
++
++ /**
++ * Set the inlined finally blocks of this try. Each element should be a block with a single statement that is a
++ * {@link LabelNode} with a unique label, and the block within the label node should contain the actual inlined
++ * finally block.
++ * @param lc current lexical context
++ * @param inlinedFinallies list of inlined finally blocks
++ * @return new TryNode or same if unchanged
++ */
++ public TryNode setInlinedFinallies(final LexicalContext lc, final List<Block> inlinedFinallies) {
++ if (this.inlinedFinallies == inlinedFinallies) {
++ return this;
++ }
++ assert checkInlinedFinallies(inlinedFinallies);
++ return Node.replaceInLexicalContext(lc, this, new TryNode(this, body, catchBlocks, finallyBody, conversion, inlinedFinallies));
++ }
++
++ private static boolean checkInlinedFinallies(final List<Block> inlinedFinallies) {
++ if (!inlinedFinallies.isEmpty()) {
++ final Set<String> labels = new HashSet<>();
++ for (final Block inlinedFinally : inlinedFinallies) {
++ final List<Statement> stmts = inlinedFinally.getStatements();
++ assert stmts.size() == 1;
++ final LabelNode ln = getInlinedFinallyLabelNode(inlinedFinally);
++ assert labels.add(ln.getLabelName()); // unique label
++ }
++ }
++ return true;
+ }
+
+ @Override
+@@ -245,7 +314,7 @@
+ if(this.conversion == conversion) {
+ return this;
+ }
+- return new TryNode(this, body, catchBlocks, finallyBody, conversion);
++ return new TryNode(this, body, catchBlocks, finallyBody, conversion, inlinedFinallies);
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -33,7 +33,6 @@
+ import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.List;
+-import java.util.function.Function;
+ import jdk.nashorn.internal.codegen.types.Type;
+ import jdk.nashorn.internal.ir.annotations.Ignore;
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+@@ -123,23 +122,11 @@
+ return isAssignment();
+ }
+
+- private static final Function<Symbol, Type> UNKNOWN_LOCALS = new Function<Symbol, Type>() {
+- @Override
+- public Type apply(final Symbol t) {
+- return null;
+- }
+- };
+-
+-
+ @Override
+ public Type getWidestOperationType() {
+- return getWidestOperationType(UNKNOWN_LOCALS);
+- }
+-
+- private Type getWidestOperationType(final Function<Symbol, Type> localVariableTypes) {
+ switch (tokenType()) {
+ case ADD:
+- final Type operandType = getExpression().getType(localVariableTypes);
++ final Type operandType = getExpression().getType();
+ if(operandType == Type.BOOLEAN) {
+ return Type.INT;
+ } else if(operandType.isObject()) {
+@@ -326,12 +313,12 @@
+ }
+
+ @Override
+- public Type getType(final Function<Symbol, Type> localVariableTypes) {
+- final Type widest = getWidestOperationType(localVariableTypes);
++ public Type getType() {
++ final Type widest = getWidestOperationType();
+ if(type == null) {
+ return widest;
+ }
+- return Type.narrowest(widest, Type.widest(type, expression.getType(localVariableTypes)));
++ return Type.narrowest(widest, Type.widest(type, expression.getType()));
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/ir/VarNode.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/VarNode.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,7 +27,6 @@
+
+ import jdk.nashorn.internal.ir.annotations.Immutable;
+ import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+-import jdk.nashorn.internal.parser.Token;
+
+ /**
+ * Node represents a var/let declaration.
+@@ -182,7 +181,7 @@
+
+ @Override
+ public void toString(final StringBuilder sb, final boolean printType) {
+- sb.append(Token.descType(getToken()).getName()).append(' ');
++ sb.append(tokenType().getName()).append(' ');
+ name.toString(sb, printType);
+
+ if (init != null) {
+--- ./nashorn/src/jdk/nashorn/internal/ir/debug/JSONWriter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/debug/JSONWriter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,7 +28,6 @@
+ import static jdk.nashorn.internal.runtime.Source.sourceFor;
+
+ import java.util.ArrayList;
+-import java.util.Arrays;
+ import java.util.List;
+ import jdk.nashorn.internal.ir.AccessNode;
+ import jdk.nashorn.internal.ir.BinaryNode;
+@@ -553,8 +552,7 @@
+ type("ArrayExpression");
+ comma();
+
+- final Node[] value = literalNode.getArray();
+- array("elements", Arrays.asList(value));
++ array("elements", ((LiteralNode.ArrayLiteralNode)literalNode).getElementExpressions());
+ } else {
+ type("Literal");
+ comma();
+--- ./nashorn/src/jdk/nashorn/internal/ir/debug/NashornTextifier.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/debug/NashornTextifier.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -1109,7 +1109,7 @@
+ }
+ final String ex = catches.get(node);
+ if (ex != null) {
+- sb.append("*** CATCH: ").append(ex).append(" ***\n");
++ sb.append("*** CATCH: ").append(ex).append(" ***\\l");
+ }
+ sb.append(c);
+ sb.append("\"]\n");
+--- ./nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -38,6 +38,7 @@
+ import java.util.LinkedList;
+ import java.util.List;
+ import java.util.Map;
++import java.util.Objects;
+
+ /**
+ * Contains utility methods for calculating the memory usage of objects. It
+@@ -150,7 +151,7 @@
+ * @param memoryLayoutSpecification a description of the JVM memory layout.
+ */
+ public ObjectSizeCalculator(final MemoryLayoutSpecification memoryLayoutSpecification) {
+- memoryLayoutSpecification.getClass();
++ Objects.requireNonNull(memoryLayoutSpecification);
+ arrayHeaderSize = memoryLayoutSpecification.getArrayHeaderSize();
+ objectHeaderSize = memoryLayoutSpecification.getObjectHeaderSize();
+ objectPadding = memoryLayoutSpecification.getObjectPadding();
+--- ./nashorn/src/jdk/nashorn/internal/ir/debug/PrintVisitor.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/debug/PrintVisitor.java Wed Jul 01 21:54:30 2015 -0700
+@@ -391,6 +391,9 @@
+ finallyBody.accept(this);
+ }
+
++ for (final Block inlinedFinally : tryNode.getInlinedFinallies()) {
++ inlinedFinally.accept(this);
++ }
+ return false;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/ir/visitor/NodeVisitor.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/ir/visitor/NodeVisitor.java Wed Jul 01 21:54:30 2015 -0700
+@@ -43,6 +43,7 @@
+ import jdk.nashorn.internal.ir.IfNode;
+ import jdk.nashorn.internal.ir.IndexNode;
+ import jdk.nashorn.internal.ir.JoinPredecessorExpression;
++import jdk.nashorn.internal.ir.JumpToInlinedFinally;
+ import jdk.nashorn.internal.ir.LabelNode;
+ import jdk.nashorn.internal.ir.LexicalContext;
+ import jdk.nashorn.internal.ir.LiteralNode;
+@@ -473,6 +474,26 @@
+ }
+
+ /**
++ * Callback for entering a JumpToInlinedFinally
++ *
++ * @param jumpToInlinedFinally the node
++ * @return true if traversal should continue and node children be traversed, false otherwise
++ */
++ public boolean enterJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) {
++ return enterDefault(jumpToInlinedFinally);
++ }
++
++ /**
++ * Callback for leaving a JumpToInlinedFinally
++ *
++ * @param jumpToInlinedFinally the node
++ * @return processed node, which will replace the original one, or the original node
++ */
++ public Node leaveJumpToInlinedFinally(final JumpToInlinedFinally jumpToInlinedFinally) {
++ return leaveDefault(jumpToInlinedFinally);
++ }
++
++ /**
+ * Callback for entering a LabelNode
+ *
+ * @param labelNode the node
+--- ./nashorn/src/jdk/nashorn/internal/lookup/MethodHandleFactory.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/lookup/MethodHandleFactory.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,6 +25,8 @@
+
+ package jdk.nashorn.internal.lookup;
+
++import static jdk.nashorn.internal.runtime.JSType.isString;
++
+ import java.io.ByteArrayOutputStream;
+ import java.io.PrintStream;
+ import java.lang.invoke.MethodHandle;
+@@ -36,7 +38,6 @@
+ import java.util.Arrays;
+ import java.util.List;
+ import java.util.logging.Level;
+-import jdk.nashorn.internal.runtime.ConsString;
+ import jdk.nashorn.internal.runtime.Context;
+ import jdk.nashorn.internal.runtime.Debug;
+ import jdk.nashorn.internal.runtime.ScriptObject;
+@@ -343,7 +344,7 @@
+ final Object d = data[i];
+ if (d == null) {
+ sb.append("<null> ");
+- } else if (d instanceof String || d instanceof ConsString) {
++ } else if (isString(d)) {
+ sb.append(d.toString());
+ sb.append(' ');
+ } else if (d.getClass().isArray()) {
+--- ./nashorn/src/jdk/nashorn/internal/objects/Global.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/Global.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,6 +28,7 @@
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.referenceError;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
++import static jdk.nashorn.internal.runtime.JSType.isString;
+ import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
+
+ import java.io.IOException;
+@@ -41,6 +42,7 @@
+ import java.util.Arrays;
+ import java.util.List;
+ import java.util.Map;
++import java.util.Objects;
+ import java.util.concurrent.Callable;
+ import java.util.concurrent.ConcurrentHashMap;
+ import javax.script.ScriptContext;
+@@ -52,11 +54,13 @@
+ import jdk.nashorn.api.scripting.ScriptObjectMirror;
+ import jdk.nashorn.internal.lookup.Lookup;
+ import jdk.nashorn.internal.objects.annotations.Attribute;
++import jdk.nashorn.internal.objects.annotations.Getter;
+ import jdk.nashorn.internal.objects.annotations.Property;
+ import jdk.nashorn.internal.objects.annotations.ScriptClass;
+-import jdk.nashorn.internal.runtime.ConsString;
++import jdk.nashorn.internal.objects.annotations.Setter;
+ import jdk.nashorn.internal.runtime.Context;
+ import jdk.nashorn.internal.runtime.ECMAErrors;
++import jdk.nashorn.internal.runtime.FindProperty;
+ import jdk.nashorn.internal.runtime.GlobalConstants;
+ import jdk.nashorn.internal.runtime.GlobalFunctions;
+ import jdk.nashorn.internal.runtime.JSType;
+@@ -75,18 +79,23 @@
+ import jdk.nashorn.internal.runtime.linker.InvokeByName;
+ import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor;
+ import jdk.nashorn.internal.runtime.regexp.RegExpResult;
++import jdk.nashorn.internal.scripts.JD;
+ import jdk.nashorn.internal.scripts.JO;
++import jdk.nashorn.tools.ShellFunctions;
+
+ /**
+ * Representation of global scope.
+ */
+ @ScriptClass("Global")
+-public final class Global extends ScriptObject implements Scope {
++public final class Global extends Scope {
+ // Placeholder value used in place of a location property (__FILE__, __DIR__, __LINE__)
+ private static final Object LOCATION_PROPERTY_PLACEHOLDER = new Object();
+ private final InvokeByName TO_STRING = new InvokeByName("toString", ScriptObject.class);
+ private final InvokeByName VALUE_OF = new InvokeByName("valueOf", ScriptObject.class);
+
++ // placeholder value for lazily initialized global objects
++ private static final Object LAZY_SENTINEL = new Object();
++
+ /**
+ * Optimistic builtin names that require switchpoint invalidation
+ * upon assignment. Overly conservative, but works for now, to avoid
+@@ -211,21 +220,117 @@
+ @Property(name = "Number", attributes = Attribute.NOT_ENUMERABLE)
+ public volatile Object number;
+
+- /** ECMA 15.1.4.7 Date constructor */
+- @Property(name = "Date", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object date;
+-
+- /** ECMA 15.1.4.8 RegExp constructor */
+- @Property(name = "RegExp", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object regexp;
+-
+- /** ECMA 15.12 - The JSON object */
+- @Property(name = "JSON", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object json;
+-
+- /** Nashorn extension: global.JSAdapter */
+- @Property(name = "JSAdapter", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object jsadapter;
++ /**
++ * Getter for ECMA 15.1.4.7 Date property
++ *
++ * @param self self reference
++ * @return Date property value
++ */
++ @Getter(name = "Date", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getDate(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.date == LAZY_SENTINEL) {
++ global.date = global.getBuiltinDate();
++ }
++ return global.date;
++ }
++
++ /**
++ * Setter for ECMA 15.1.4.7 Date property
++ *
++ * @param self self reference
++ * @param value value for the Date property
++ */
++ @Setter(name = "Date", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setDate(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.date = value;
++ }
++
++ private volatile Object date = LAZY_SENTINEL;
++
++ /**
++ * Getter for ECMA 15.1.4.8 RegExp property
++ *
++ * @param self self reference
++ * @return RegExp property value
++ */
++ @Getter(name = "RegExp", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getRegExp(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.regexp == LAZY_SENTINEL) {
++ global.regexp = global.getBuiltinRegExp();
++ }
++ return global.regexp;
++ }
++
++ /**
++ * Setter for ECMA 15.1.4.8 RegExp property
++ *
++ * @param self self reference
++ * @param value value for the RegExp property
++ */
++ @Setter(name = "RegExp", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setRegExp(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.regexp = value;
++ }
++
++ private volatile Object regexp = LAZY_SENTINEL;
++
++ /**
++ * Getter for ECMA 15.12 - The JSON property
++ * @param self self reference
++ * @return the value of JSON property
++ */
++ @Getter(name = "JSON", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getJSON(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.json == LAZY_SENTINEL) {
++ global.json = global.getBuiltinJSON();
++ }
++ return global.json;
++ }
++
++ /**
++ * Setter for ECMA 15.12 - The JSON property
++ * @param self self reference
++ * @param value value for the JSON property
++ */
++ @Setter(name = "JSON", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setJSON(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.json = value;
++ }
++
++ private volatile Object json = LAZY_SENTINEL;
++
++ /**
++ * Getter for Nashorn extension: global.JSAdapter
++ * @param self self reference
++ * @return value of the JSAdapter property
++ */
++ @Getter(name = "JSAdapter", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getJSAdapter(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.jsadapter == LAZY_SENTINEL) {
++ global.jsadapter = global.getBuiltinJSAdapter();
++ }
++ return global.jsadapter;
++ }
++
++ /**
++ * Setter for Nashorn extension: global.JSAdapter
++ * @param self self reference
++ * @param value value for the JSAdapter property
++ */
++ @Setter(name = "JSAdapter", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setJSAdapter(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.jsadapter = value;
++ }
++
++ private volatile Object jsadapter = LAZY_SENTINEL;
+
+ /** ECMA 15.8 - The Math object */
+ @Property(name = "Math", attributes = Attribute.NOT_ENUMERABLE)
+@@ -235,13 +340,60 @@
+ @Property(name = "Error", attributes = Attribute.NOT_ENUMERABLE)
+ public volatile Object error;
+
+- /** EvalError object */
+- @Property(name = "EvalError", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object evalError;
+-
+- /** RangeError object */
+- @Property(name = "RangeError", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object rangeError;
++ /**
++ * Getter for the EvalError property
++ * @param self self reference
++ * @return the value of EvalError property
++ */
++ @Getter(name = "EvalError", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getEvalError(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.evalError == LAZY_SENTINEL) {
++ global.evalError = global.getBuiltinEvalError();
++ }
++ return global.evalError;
++ }
++
++ /**
++ * Setter for the EvalError property
++ * @param self self reference
++ * @param value value of the EvalError property
++ */
++ @Setter(name = "EvalError", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setEvalError(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.evalError = value;
++ }
++
++ private volatile Object evalError = LAZY_SENTINEL;
++
++ /**
++ * Getter for the RangeError property.
++ * @param self self reference
++ * @return the value of RangeError property
++ */
++ @Getter(name = "RangeError", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getRangeError(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.rangeError == LAZY_SENTINEL) {
++ global.rangeError = global.getBuiltinRangeError();
++ }
++ return global.rangeError;
++ }
++
++
++ /**
++ * Setter for the RangeError property.
++ * @param self self reference
++ * @param value value for the RangeError property
++ */
++ @Setter(name = "RangeError", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setRangeError(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.rangeError = value;
++ }
++
++ private volatile Object rangeError = LAZY_SENTINEL;
+
+ /** ReferenceError object */
+ @Property(name = "ReferenceError", attributes = Attribute.NOT_ENUMERABLE)
+@@ -255,53 +407,340 @@
+ @Property(name = "TypeError", attributes = Attribute.NOT_ENUMERABLE)
+ public volatile Object typeError;
+
+- /** URIError object */
+- @Property(name = "URIError", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object uriError;
+-
+- /** ArrayBuffer object */
+- @Property(name = "ArrayBuffer", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object arrayBuffer;
+-
+- /** DataView object */
+- @Property(name = "DataView", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object dataView;
+-
+- /** TypedArray (int8) */
+- @Property(name = "Int8Array", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object int8Array;
+-
+- /** TypedArray (uint8) */
+- @Property(name = "Uint8Array", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object uint8Array;
+-
+- /** TypedArray (uint8) - Clamped */
+- @Property(name = "Uint8ClampedArray", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object uint8ClampedArray;
+-
+- /** TypedArray (int16) */
+- @Property(name = "Int16Array", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object int16Array;
+-
+- /** TypedArray (uint16) */
+- @Property(name = "Uint16Array", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object uint16Array;
+-
+- /** TypedArray (int32) */
+- @Property(name = "Int32Array", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object int32Array;
+-
+- /** TypedArray (uint32) */
+- @Property(name = "Uint32Array", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object uint32Array;
+-
+- /** TypedArray (float32) */
+- @Property(name = "Float32Array", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object float32Array;
+-
+- /** TypedArray (float64) */
+- @Property(name = "Float64Array", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object float64Array;
++ /**
++ * Getter for the URIError property.
++ * @param self self reference
++ * @return the value of URIError property
++ */
++ @Getter(name = "URIError", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getURIError(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.uriError == LAZY_SENTINEL) {
++ global.uriError = global.getBuiltinURIError();
++ }
++ return global.uriError;
++ }
++
++ /**
++ * Setter for the URIError property.
++ * @param self self reference
++ * @param value value for the URIError property
++ */
++ @Setter(name = "URIError", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setURIError(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.uriError = value;
++ }
++
++ private volatile Object uriError = LAZY_SENTINEL;
++
++ /**
++ * Getter for the ArrayBuffer property.
++ * @param self self reference
++ * @return the value of the ArrayBuffer property
++ */
++ @Getter(name = "ArrayBuffer", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getArrayBuffer(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.arrayBuffer == LAZY_SENTINEL) {
++ global.arrayBuffer = global.getBuiltinArrayBuffer();
++ }
++ return global.arrayBuffer;
++ }
++
++ /**
++ * Setter for the ArrayBuffer property.
++ * @param self self reference
++ * @param value value of the ArrayBuffer property
++ */
++ @Setter(name = "ArrayBuffer", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setArrayBuffer(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.arrayBuffer = value;
++ }
++
++ private volatile Object arrayBuffer;
++
++ /**
++ * Getter for the DataView property.
++ * @param self self reference
++ * @return the value of the DataView property
++ */
++ @Getter(name = "DataView", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getDataView(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.dataView == LAZY_SENTINEL) {
++ global.dataView = global.getBuiltinDataView();
++ }
++ return global.dataView;
++ }
++
++
++ /**
++ * Setter for the DataView property.
++ * @param self self reference
++ * @param value value of the DataView property
++ */
++ @Setter(name = "DataView", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setDataView(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.dataView = value;
++ }
++
++ private volatile Object dataView;
++
++ /**
++ * Getter for the Int8Array property.
++ * @param self self reference
++ * @return the value of the Int8Array property.
++ */
++ @Getter(name = "Int8Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getInt8Array(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.int8Array == LAZY_SENTINEL) {
++ global.int8Array = global.getBuiltinInt8Array();
++ }
++ return global.int8Array;
++ }
++
++ /**
++ * Setter for the Int8Array property.
++ * @param self self reference
++ * @param value value of the Int8Array property
++ */
++ @Setter(name = "Int8Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setInt8Array(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.int8Array = value;
++ }
++
++ private volatile Object int8Array;
++
++ /**
++ * Getter for the Uin8Array property.
++ * @param self self reference
++ * @return the value of the Uint8Array property
++ */
++ @Getter(name = "Uint8Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getUint8Array(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.uint8Array == LAZY_SENTINEL) {
++ global.uint8Array = global.getBuiltinUint8Array();
++ }
++ return global.uint8Array;
++ }
++
++ /**
++ * Setter for the Uin8Array property.
++ * @param self self reference
++ * @param value value of the Uin8Array property
++ */
++ @Setter(name = "Uint8Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setUint8Array(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.uint8Array = value;
++ }
++
++ private volatile Object uint8Array;
++
++ /**
++ * Getter for the Uint8ClampedArray property.
++ * @param self self reference
++ * @return the value of the Uint8ClampedArray property
++ */
++ @Getter(name = "Uint8ClampedArray", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getUint8ClampedArray(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.uint8ClampedArray == LAZY_SENTINEL) {
++ global.uint8ClampedArray = global.getBuiltinUint8ClampedArray();
++ }
++ return global.uint8ClampedArray;
++ }
++
++ /**
++ * Setter for the Uint8ClampedArray property.
++ * @param self self reference
++ * @param value value of the Uint8ClampedArray property
++ */
++ @Setter(name = "Uint8ClampedArray", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setUint8ClampedArray(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.uint8ClampedArray = value;
++ }
++
++ private volatile Object uint8ClampedArray;
++
++ /**
++ * Getter for the Int16Array property.
++ * @param self self reference
++ * @return the value of the Int16Array property
++ */
++ @Getter(name = "Int16Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getInt16Array(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.int16Array == LAZY_SENTINEL) {
++ global.int16Array = global.getBuiltinInt16Array();
++ }
++ return global.int16Array;
++ }
++
++ /**
++ * Setter for the Int16Array property.
++ * @param self self reference
++ * @param value value of the Int16Array property
++ */
++ @Setter(name = "Int16Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setInt16Array(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.int16Array = value;
++ }
++
++ private volatile Object int16Array;
++
++ /**
++ * Getter for the Uint16Array property.
++ * @param self self reference
++ * @return the value of the Uint16Array property
++ */
++ @Getter(name = "Uint16Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getUint16Array(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.uint16Array == LAZY_SENTINEL) {
++ global.uint16Array = global.getBuiltinUint16Array();
++ }
++ return global.uint16Array;
++ }
++
++ /**
++ * Setter for the Uint16Array property.
++ * @param self self reference
++ * @param value value of the Uint16Array property
++ */
++ @Setter(name = "Uint16Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setUint16Array(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.uint16Array = value;
++ }
++
++ private volatile Object uint16Array;
++
++ /**
++ * Getter for the Int32Array property.
++ *
++ * @param self self reference
++ * @return the value of the Int32Array property
++ */
++ @Getter(name = "Int32Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getInt32Array(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.int32Array == LAZY_SENTINEL) {
++ global.int32Array = global.getBuiltinInt32Array();
++ }
++ return global.int32Array;
++ }
++
++
++ /**
++ * Setter for the Int32Array property.
++ *
++ * @param self self reference
++ * @param value value of the Int32Array property
++ */
++ @Setter(name = "Int32Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setInt32Array(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.int32Array = value;
++ }
++
++ private volatile Object int32Array;
++
++ /**
++ * Getter of the Uint32Array property.
++ *
++ * @param self self reference
++ * @return the value of the Uint32Array property
++ */
++ @Getter(name = "Uint32Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getUint32Array(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.uint32Array == LAZY_SENTINEL) {
++ global.uint32Array = global.getBuiltinUint32Array();
++ }
++ return global.uint32Array;
++ }
++
++
++ /**
++ * Setter of the Uint32Array property.
++ *
++ * @param self self reference
++ * @param value value of the Uint32Array property
++ */
++ @Setter(name = "Uint32Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setUint32Array(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.uint32Array = value;
++ }
++
++ private volatile Object uint32Array;
++
++ /**
++ * Getter for the Float32Array property.
++ *
++ * @param self self reference
++ * @return the value of the Float32Array property
++ */
++ @Getter(name = "Float32Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getFloat32Array(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.float32Array == LAZY_SENTINEL) {
++ global.float32Array = global.getBuiltinFloat32Array();
++ }
++ return global.float32Array;
++ }
++
++ /**
++ * Setter for the Float32Array property.
++ *
++ * @param self self reference
++ * @param value value of the Float32Array property
++ */
++ @Setter(name = "Float32Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setFloat32Array(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.float32Array = value;
++ }
++
++ private volatile Object float32Array;
++
++ /**
++ * Getter for the Float64Array property.
++ *
++ * @param self self reference
++ * @return the value of the Float64Array property
++ */
++ @Getter(name = "Float64Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getFloat64Array(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.float64Array == LAZY_SENTINEL) {
++ global.float64Array = global.getBuiltinFloat64Array();
++ }
++ return global.float64Array;
++ }
++
++ /**
++ * Setter for the Float64Array property.
++ *
++ * @param self self reference
++ * @param value value of the Float64Array property
++ */
++ @Setter(name = "Float64Array", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setFloat64Array(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.float64Array = value;
++ }
++
++ private volatile Object float64Array;
+
+ /** Nashorn extension: Java access - global.Packages */
+ @Property(name = "Packages", attributes = Attribute.NOT_ENUMERABLE)
+@@ -331,13 +770,63 @@
+ @Property(attributes = Attribute.NOT_ENUMERABLE)
+ public volatile Object org;
+
+- /** Nashorn extension: Java access - global.javaImporter */
+- @Property(name = "JavaImporter", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object javaImporter;
+-
+- /** Nashorn extension: global.Java Object constructor. */
+- @Property(name = "Java", attributes = Attribute.NOT_ENUMERABLE)
+- public volatile Object javaApi;
++ /**
++ * Getter for the Nashorn extension: Java access - global.javaImporter.
++ *
++ * @param self self reference
++ * @return the value of the JavaImporter property
++ */
++ @Getter(name = "JavaImporter", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getJavaImporter(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.javaImporter == LAZY_SENTINEL) {
++ global.javaImporter = global.getBuiltinJavaImporter();
++ }
++ return global.javaImporter;
++ }
++
++ /**
++ * Setter for the Nashorn extension: Java access - global.javaImporter.
++ *
++ * @param self self reference
++ * @param value value of the JavaImporter property
++ */
++ @Setter(name = "JavaImporter", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setJavaImporter(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.javaImporter = value;
++ }
++
++ private volatile Object javaImporter;
++
++ /**
++ * Getter for the Nashorn extension: global.Java property.
++ *
++ * @param self self reference
++ * @return the value of the Java property
++ */
++ @Getter(name = "Java", attributes = Attribute.NOT_ENUMERABLE)
++ public static Object getJavaApi(final Object self) {
++ final Global global = Global.instanceFrom(self);
++ if (global.javaApi == LAZY_SENTINEL) {
++ global.javaApi = global.getBuiltinJavaApi();
++ }
++ return global.javaApi;
++ }
++
++ /**
++ * Setter for the Nashorn extension: global.Java property.
++ *
++ * @param self self reference
++ * @param value value of the Java property
++ */
++ @Setter(name = "Java", attributes = Attribute.NOT_ENUMERABLE)
++ public static void setJavaApi(final Object self, final Object value) {
++ final Global global = Global.instanceFrom(self);
++ global.javaApi = value;
++ }
++
++ private volatile Object javaApi;
+
+ /** Nashorn extension: current script's file name */
+ @Property(name = "__FILE__", attributes = Attribute.NON_ENUMERABLE_CONSTANT)
+@@ -351,11 +840,19 @@
+ @Property(name = "__LINE__", attributes = Attribute.NON_ENUMERABLE_CONSTANT)
+ public final Object __LINE__ = LOCATION_PROPERTY_PLACEHOLDER;
+
++ private volatile NativeDate DEFAULT_DATE;
++
+ /** Used as Date.prototype's default value */
+- public NativeDate DEFAULT_DATE;
++ NativeDate getDefaultDate() {
++ return DEFAULT_DATE;
++ }
++
++ private volatile NativeRegExp DEFAULT_REGEXP;
+
+ /** Used as RegExp.prototype's default value */
+- public NativeRegExp DEFAULT_REGEXP;
++ NativeRegExp getDefaultRegExp() {
++ return DEFAULT_REGEXP;
++ }
+
+ /*
+ * Built-in constructor objects: Even if user changes dynamic values of
+@@ -409,9 +906,6 @@
+ */
+ private ScriptFunction typeErrorThrower;
+
+- // Flag to indicate that a split method issued a return statement
+- private int splitState = -1;
+-
+ // Used to store the last RegExp result to support deprecated RegExp constructor properties
+ private RegExpResult lastRegExpResult;
+
+@@ -422,7 +916,7 @@
+ private static final MethodHandle LOAD = findOwnMH_S("load", Object.class, Object.class, Object.class);
+ private static final MethodHandle LOAD_WITH_NEW_GLOBAL = findOwnMH_S("loadWithNewGlobal", Object.class, Object.class, Object[].class);
+ private static final MethodHandle EXIT = findOwnMH_S("exit", Object.class, Object.class, Object.class);
+- private static final MethodHandle LEXICAL_SCOPE_FILTER = findOwnMH_S("lexicalScopeFilter", Object.class, Object.class);
++ private static final MethodHandle LEXICAL_SCOPE_FILTER = findOwnMH_S("lexicalScopeFilter", Object.class, Object.class);
+
+ // initialized by nasgen
+ private static PropertyMap $nasgenmap$;
+@@ -431,9 +925,11 @@
+ private final Context context;
+
+ // current ScriptContext to use - can be null.
+- private ScriptContext scontext;
++ private ThreadLocal<ScriptContext> scontext;
+ // current ScriptEngine associated - can be null.
+ private ScriptEngine engine;
++ // initial ScriptContext - can be null
++ private volatile ScriptContext initscontext;
+
+ // ES6 global lexical scope.
+ private final LexicalScope lexicalScope;
+@@ -443,10 +939,25 @@
+
+ /**
+ * Set the current script context
+- * @param scontext script context
++ * @param ctxt script context
+ */
+- public void setScriptContext(final ScriptContext scontext) {
+- this.scontext = scontext;
++ public void setScriptContext(final ScriptContext ctxt) {
++ assert scontext != null;
++ scontext.set(ctxt);
++ }
++
++ /**
++ * Get the current script context
++ * @return current script context
++ */
++ public ScriptContext getScriptContext() {
++ assert scontext != null;
++ return scontext.get();
++ }
++
++ private ScriptContext currentContext() {
++ final ScriptContext sc = scontext != null? scontext.get() : null;
++ return sc == null? initscontext : sc;
+ }
+
+ @Override
+@@ -454,6 +965,11 @@
+ return context;
+ }
+
++ @Override
++ protected boolean useDualFields() {
++ return context.useDualFields();
++ }
++
+ // performs initialization checks for Global constructor and returns the
+ // PropertyMap, if everything is fine.
+ private static PropertyMap checkAndGetMap(final Context context) {
+@@ -463,8 +979,7 @@
+ sm.checkPermission(new RuntimePermission(Context.NASHORN_CREATE_GLOBAL));
+ }
+
+- // null check on context
+- context.getClass();
++ Objects.requireNonNull(context);
+
+ return $nasgenmap$;
+ }
+@@ -477,7 +992,6 @@
+ public Global(final Context context) {
+ super(checkAndGetMap(context));
+ this.context = context;
+- this.setIsScope();
+ this.lexicalScope = context.getEnv()._es6 ? new LexicalScope(this) : null;
+ }
+
+@@ -487,9 +1001,7 @@
+ * @return the global singleton
+ */
+ public static Global instance() {
+- final Global global = Context.getGlobal();
+- global.getClass(); // null check
+- return global;
++ return Objects.requireNonNull(Context.getGlobal());
+ }
+
+ private static Global instanceFrom(final Object self) {
+@@ -554,17 +1066,21 @@
+ * as well as our extension builtin objects like "Java", "JSAdapter" as properties
+ * of the global scope object.
+ *
+- * @param engine ScriptEngine to initialize
++ * @param eng ScriptEngine to initialize
++ * @param ctxt ScriptContext to initialize
+ */
+- @SuppressWarnings("hiding")
+- public void initBuiltinObjects(final ScriptEngine engine) {
++ public void initBuiltinObjects(final ScriptEngine eng, final ScriptContext ctxt) {
+ if (this.builtinObject != null) {
+ // already initialized, just return
+ return;
+ }
+
+- this.engine = engine;
+- init(engine);
++ this.engine = eng;
++ this.initscontext = ctxt;
++ if (this.engine != null) {
++ this.scontext = new ThreadLocal<>();
++ }
++ init(eng);
+ }
+
+ /**
+@@ -578,16 +1094,18 @@
+ return new NativeBoolean((Boolean)obj, this);
+ } else if (obj instanceof Number) {
+ return new NativeNumber(((Number)obj).doubleValue(), this);
+- } else if (obj instanceof String || obj instanceof ConsString) {
++ } else if (isString(obj)) {
+ return new NativeString((CharSequence)obj, this);
+ } else if (obj instanceof Object[]) { // extension
+- return new NativeArray((Object[])obj);
++ return new NativeArray(ArrayData.allocate((Object[])obj), this);
+ } else if (obj instanceof double[]) { // extension
+- return new NativeArray((double[])obj);
++ return new NativeArray(ArrayData.allocate((double[])obj), this);
+ } else if (obj instanceof long[]) {
+- return new NativeArray((long[])obj);
++ return new NativeArray(ArrayData.allocate((long[])obj), this);
+ } else if (obj instanceof int[]) {
+- return new NativeArray((int[])obj);
++ return new NativeArray(ArrayData.allocate((int[]) obj), this);
++ } else if (obj instanceof ArrayData) {
++ return new NativeArray((ArrayData) obj, this);
+ } else {
+ // FIXME: more special cases? Map? List?
+ return obj;
+@@ -603,7 +1121,7 @@
+ * @return guarded invocation
+ */
+ public static GuardedInvocation primitiveLookup(final LinkRequest request, final Object self) {
+- if (self instanceof String || self instanceof ConsString) {
++ if (isString(self)) {
+ return NativeString.lookupPrimitive(request, self);
+ } else if (self instanceof Number) {
+ return NativeNumber.lookupPrimitive(request, self);
+@@ -620,7 +1138,7 @@
+ * @return method handle to create wrapper objects for primitive receiver
+ */
+ public static MethodHandle getPrimitiveWrapFilter(final Object self) {
+- if (self instanceof String || self instanceof ConsString) {
++ if (isString(self)) {
+ return NativeString.WRAPFILTER;
+ } else if (self instanceof Number) {
+ return NativeNumber.WRAPFILTER;
+@@ -637,7 +1155,7 @@
+ * @return the new ScriptObject
+ */
+ public ScriptObject newObject() {
+- return new JO(getObjectPrototype(), JO.getInitialMap());
++ return useDualFields() ? new JD(getObjectPrototype()) : new JO(getObjectPrototype());
+ }
+
+ /**
+@@ -890,7 +1408,7 @@
+ */
+ public static Object __noSuchProperty__(final Object self, final Object name) {
+ final Global global = Global.instance();
+- final ScriptContext sctxt = global.scontext;
++ final ScriptContext sctxt = global.currentContext();
+ final String nameStr = name.toString();
+
+ if (sctxt != null) {
+@@ -929,7 +1447,7 @@
+ * @return the result of eval
+ */
+ public static Object eval(final Object self, final Object str) {
+- return directEval(self, str, UNDEFINED, UNDEFINED, false);
++ return directEval(self, str, Global.instanceFrom(self), UNDEFINED, false);
+ }
+
+ /**
+@@ -939,18 +1457,18 @@
+ * @param str Evaluated code
+ * @param callThis "this" to be passed to the evaluated code
+ * @param location location of the eval call
+- * @param strict is eval called a strict mode code?
++ * @param strict is eval called from a strict mode code?
+ *
+ * @return the return value of the eval
+ *
+ * This is directly invoked from generated when eval(code) is called in user code
+ */
+ public static Object directEval(final Object self, final Object str, final Object callThis, final Object location, final boolean strict) {
+- if (!(str instanceof String || str instanceof ConsString)) {
++ if (!isString(str)) {
+ return str;
+ }
+ final Global global = Global.instanceFrom(self);
+- final ScriptObject scope = self instanceof ScriptObject ? (ScriptObject)self : global;
++ final ScriptObject scope = self instanceof ScriptObject && ((ScriptObject)self).isScope() ? (ScriptObject)self : global;
+
+ return global.getContext().eval(scope, str.toString(), callThis, location, strict, true);
+ }
+@@ -980,26 +1498,53 @@
+ }
+
+ /**
+- * Global load implementation - Nashorn extension
++ * Global load implementation - Nashorn extension.
+ *
+- * @param self scope
+- * @param source source to load
++ * <p>
++ * load builtin loads the given script. Script source can be a URL or a File
++ * or a script object with name and script properties. Evaluated code gets
++ * global object "this" and uses global object as scope for evaluation.
++ * </p>
++ * <p>
++ * If self is undefined or null or global, then global object is used
++ * as scope as well as "this" for the evaluated code. If self is any other
++ * object, then it is indirect load call. With indirect load call, the
++ * properties of scope are available to evaluated script as variables. Also,
++ * global scope properties are accessible. Any var, function definition in
++ * evaluated script goes into an object that is not accessible to user scripts.
++ * </p>
++ * Thus the indirect load call is equivalent to the following:
++ * <pre>
++ * <code>
++ * (function (scope, source) {
++ * with(scope) {
++ * eval(&lt;script_from_source&gt;);
++ * }
++ * })(self, source);
++ * </code>
++ * </pre>
+ *
+- * @return result of load (undefined)
++ * @param self scope to use for the script evaluation
++ * @param source script source
++ *
++ * @return result of load (may be undefined)
+ *
+ * @throws IOException if source could not be read
+ */
+ public static Object load(final Object self, final Object source) throws IOException {
+ final Global global = Global.instanceFrom(self);
+- final ScriptObject scope = self instanceof ScriptObject ? (ScriptObject)self : global;
+- return global.getContext().load(scope, source);
++ return global.getContext().load(self, source);
+ }
+
+ /**
+- * Global loadWithNewGlobal implementation - Nashorn extension
++ * Global loadWithNewGlobal implementation - Nashorn extension.
+ *
+- * @param self scope
+- * @param args from plus (optional) arguments to be passed to the loaded script
++ * loadWithNewGlobal builtin loads the given script from a URL or a File
++ * or a script object with name and script properties. Evaluated code gets
++ * new global object "this" and uses that new global object as scope for evaluation.
++ *
++ * @param self self This value is ignored by this function
++ * @param args optional arguments to be passed to the loaded script
+ *
+ * @return result of load (may be undefined)
+ *
+@@ -1029,14 +1574,19 @@
+ }
+
+ // builtin prototype accessors
++
++ /**
++ * Get the builtin Object prototype.
++ * @return the object prototype.
++ */
++ public ScriptObject getObjectPrototype() {
++ return ScriptFunction.getPrototype(builtinObject);
++ }
++
+ ScriptObject getFunctionPrototype() {
+ return ScriptFunction.getPrototype(builtinFunction);
+ }
+
+- ScriptObject getObjectPrototype() {
+- return ScriptFunction.getPrototype(builtinObject);
+- }
+-
+ ScriptObject getArrayPrototype() {
+ return ScriptFunction.getPrototype(builtinArray);
+ }
+@@ -1050,11 +1600,11 @@
+ }
+
+ ScriptObject getDatePrototype() {
+- return ScriptFunction.getPrototype(builtinDate);
++ return ScriptFunction.getPrototype(getBuiltinDate());
+ }
+
+ ScriptObject getRegExpPrototype() {
+- return ScriptFunction.getPrototype(builtinRegExp);
++ return ScriptFunction.getPrototype(getBuiltinRegExp());
+ }
+
+ ScriptObject getStringPrototype() {
+@@ -1066,11 +1616,11 @@
+ }
+
+ ScriptObject getEvalErrorPrototype() {
+- return ScriptFunction.getPrototype(builtinEvalError);
++ return ScriptFunction.getPrototype(getBuiltinEvalError());
+ }
+
+ ScriptObject getRangeErrorPrototype() {
+- return ScriptFunction.getPrototype(builtinRangeError);
++ return ScriptFunction.getPrototype(getBuiltinRangeError());
+ }
+
+ ScriptObject getReferenceErrorPrototype() {
+@@ -1086,59 +1636,136 @@
+ }
+
+ ScriptObject getURIErrorPrototype() {
+- return ScriptFunction.getPrototype(builtinURIError);
++ return ScriptFunction.getPrototype(getBuiltinURIError());
+ }
+
+ ScriptObject getJavaImporterPrototype() {
+- return ScriptFunction.getPrototype(builtinJavaImporter);
++ return ScriptFunction.getPrototype(getBuiltinJavaImporter());
+ }
+
+ ScriptObject getJSAdapterPrototype() {
+- return ScriptFunction.getPrototype(builtinJSAdapter);
++ return ScriptFunction.getPrototype(getBuiltinJSAdapter());
+ }
+
++ private synchronized ScriptFunction getBuiltinArrayBuffer() {
++ if (this.builtinArrayBuffer == null) {
++ this.builtinArrayBuffer = initConstructorAndSwitchPoint("ArrayBuffer", ScriptFunction.class);
++ }
++ return this.builtinArrayBuffer;
++ }
++
+ ScriptObject getArrayBufferPrototype() {
+- return ScriptFunction.getPrototype(builtinArrayBuffer);
++ return ScriptFunction.getPrototype(getBuiltinArrayBuffer());
+ }
+
++ private synchronized ScriptFunction getBuiltinDataView() {
++ if (this.builtinDataView == null) {
++ this.builtinDataView = initConstructorAndSwitchPoint("DataView", ScriptFunction.class);
++ }
++ return this.builtinDataView;
++ }
++
+ ScriptObject getDataViewPrototype() {
+- return ScriptFunction.getPrototype(builtinDataView);
++ return ScriptFunction.getPrototype(getBuiltinDataView());
+ }
+
++ private synchronized ScriptFunction getBuiltinInt8Array() {
++ if (this.builtinInt8Array == null) {
++ this.builtinInt8Array = initConstructorAndSwitchPoint("Int8Array", ScriptFunction.class);
++ }
++ return this.builtinInt8Array;
++ }
++
+ ScriptObject getInt8ArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinInt8Array);
++ return ScriptFunction.getPrototype(getBuiltinInt8Array());
+ }
+
++ private synchronized ScriptFunction getBuiltinUint8Array() {
++ if (this.builtinUint8Array == null) {
++ this.builtinUint8Array = initConstructorAndSwitchPoint("Uint8Array", ScriptFunction.class);
++ }
++ return this.builtinUint8Array;
++ }
++
+ ScriptObject getUint8ArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinUint8Array);
++ return ScriptFunction.getPrototype(getBuiltinUint8Array());
+ }
+
++ private synchronized ScriptFunction getBuiltinUint8ClampedArray() {
++ if (this.builtinUint8ClampedArray == null) {
++ this.builtinUint8ClampedArray = initConstructorAndSwitchPoint("Uint8ClampedArray", ScriptFunction.class);
++ }
++ return this.builtinUint8ClampedArray;
++ }
++
+ ScriptObject getUint8ClampedArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinUint8ClampedArray);
++ return ScriptFunction.getPrototype(getBuiltinUint8ClampedArray());
+ }
+
++ private synchronized ScriptFunction getBuiltinInt16Array() {
++ if (this.builtinInt16Array == null) {
++ this.builtinInt16Array = initConstructorAndSwitchPoint("Int16Array", ScriptFunction.class);
++ }
++ return this.builtinInt16Array;
++ }
++
+ ScriptObject getInt16ArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinInt16Array);
++ return ScriptFunction.getPrototype(getBuiltinInt16Array());
+ }
+
++ private synchronized ScriptFunction getBuiltinUint16Array() {
++ if (this.builtinUint16Array == null) {
++ this.builtinUint16Array = initConstructorAndSwitchPoint("Uint16Array", ScriptFunction.class);
++ }
++ return this.builtinUint16Array;
++ }
++
+ ScriptObject getUint16ArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinUint16Array);
++ return ScriptFunction.getPrototype(getBuiltinUint16Array());
+ }
+
++ private synchronized ScriptFunction getBuiltinInt32Array() {
++ if (this.builtinInt32Array == null) {
++ this.builtinInt32Array = initConstructorAndSwitchPoint("Int32Array", ScriptFunction.class);
++ }
++ return this.builtinInt32Array;
++ }
++
+ ScriptObject getInt32ArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinInt32Array);
++ return ScriptFunction.getPrototype(getBuiltinInt32Array());
+ }
+
++ private synchronized ScriptFunction getBuiltinUint32Array() {
++ if (this.builtinUint32Array == null) {
++ this.builtinUint32Array = initConstructorAndSwitchPoint("Uint32Array", ScriptFunction.class);
++ }
++ return this.builtinUint32Array;
++ }
++
+ ScriptObject getUint32ArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinUint32Array);
++ return ScriptFunction.getPrototype(getBuiltinUint32Array());
+ }
+
++ private synchronized ScriptFunction getBuiltinFloat32Array() {
++ if (this.builtinFloat32Array == null) {
++ this.builtinFloat32Array = initConstructorAndSwitchPoint("Float32Array", ScriptFunction.class);
++ }
++ return this.builtinFloat32Array;
++ }
++
+ ScriptObject getFloat32ArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinFloat32Array);
++ return ScriptFunction.getPrototype(getBuiltinFloat32Array());
+ }
+
++ private synchronized ScriptFunction getBuiltinFloat64Array() {
++ if (this.builtinFloat64Array == null) {
++ this.builtinFloat64Array = initConstructorAndSwitchPoint("Float64Array", ScriptFunction.class);
++ }
++ return this.builtinFloat64Array;
++ }
++
+ ScriptObject getFloat64ArrayPrototype() {
+- return ScriptFunction.getPrototype(builtinFloat64Array);
++ return ScriptFunction.getPrototype(getBuiltinFloat64Array());
+ }
+
+ private ScriptFunction getBuiltinArray() {
+@@ -1173,8 +1800,14 @@
+ return instance._boolean == instance.getBuiltinBoolean();
+ }
+
+- private ScriptFunction getBuiltinDate() {
+- return builtinDate;
++ private synchronized ScriptFunction getBuiltinDate() {
++ if (this.builtinDate == null) {
++ this.builtinDate = initConstructorAndSwitchPoint("Date", ScriptFunction.class);
++ final ScriptObject dateProto = ScriptFunction.getPrototype(builtinDate);
++ // initialize default date
++ this.DEFAULT_DATE = new NativeDate(NaN, dateProto);
++ }
++ return this.builtinDate;
+ }
+
+ /**
+@@ -1184,7 +1817,7 @@
+ */
+ public static boolean isBuiltinDate() {
+ final Global instance = Global.instance();
+- return instance.date == instance.getBuiltinDate();
++ return instance.date == LAZY_SENTINEL || instance.date == instance.getBuiltinDate();
+ }
+
+ private ScriptFunction getBuiltinError() {
+@@ -1201,8 +1834,11 @@
+ return instance.error == instance.getBuiltinError();
+ }
+
+- private ScriptFunction getBuiltinEvalError() {
+- return builtinEvalError;
++ private synchronized ScriptFunction getBuiltinEvalError() {
++ if (this.builtinEvalError == null) {
++ this.builtinEvalError = initErrorSubtype("EvalError", getErrorPrototype());
++ }
++ return this.builtinEvalError;
+ }
+
+ /**
+@@ -1212,7 +1848,7 @@
+ */
+ public static boolean isBuiltinEvalError() {
+ final Global instance = Global.instance();
+- return instance.evalError == instance.getBuiltinEvalError();
++ return instance.evalError == LAZY_SENTINEL || instance.evalError == instance.getBuiltinEvalError();
+ }
+
+ private ScriptFunction getBuiltinFunction() {
+@@ -1263,7 +1899,10 @@
+ return isBuiltinFunctionProperty("call");
+ }
+
+- private ScriptFunction getBuiltinJSAdapter() {
++ private synchronized ScriptFunction getBuiltinJSAdapter() {
++ if (this.builtinJSAdapter == null) {
++ this.builtinJSAdapter = initConstructorAndSwitchPoint("JSAdapter", ScriptFunction.class);
++ }
+ return builtinJSAdapter;
+ }
+
+@@ -1274,11 +1913,14 @@
+ */
+ public static boolean isBuiltinJSAdapter() {
+ final Global instance = Global.instance();
+- return instance.jsadapter == instance.getBuiltinJSAdapter();
++ return instance.jsadapter == LAZY_SENTINEL || instance.jsadapter == instance.getBuiltinJSAdapter();
+ }
+
+- private ScriptObject getBuiltinJSON() {
+- return builtinJSON;
++ private synchronized ScriptObject getBuiltinJSON() {
++ if (this.builtinJSON == null) {
++ this.builtinJSON = initConstructorAndSwitchPoint("JSON", ScriptObject.class);
++ }
++ return this.builtinJSON;
+ }
+
+ /**
+@@ -1288,7 +1930,7 @@
+ */
+ public static boolean isBuiltinJSON() {
+ final Global instance = Global.instance();
+- return instance.json == instance.getBuiltinJSON();
++ return instance.json == LAZY_SENTINEL || instance.json == instance.getBuiltinJSON();
+ }
+
+ private ScriptObject getBuiltinJava() {
+@@ -1319,8 +1961,18 @@
+ return instance.javax == instance.getBuiltinJavax();
+ }
+
+- private ScriptObject getBuiltinJavaImporter() {
+- return builtinJavaImporter;
++ private synchronized ScriptFunction getBuiltinJavaImporter() {
++ if (this.builtinJavaImporter == null) {
++ this.builtinJavaImporter = initConstructor("JavaImporter", ScriptFunction.class);
++ }
++ return this.builtinJavaImporter;
++ }
++
++ private synchronized ScriptObject getBuiltinJavaApi() {
++ if (this.builtinJavaApi == null) {
++ this.builtinJavaApi = initConstructor("Java", ScriptObject.class);
++ }
++ return this.builtinJavaApi;
+ }
+
+ /**
+@@ -1330,11 +1982,7 @@
+ */
+ public static boolean isBuiltinJavaImporter() {
+ final Global instance = Global.instance();
+- return instance.javaImporter == instance.getBuiltinJavaImporter();
+- }
+-
+- private ScriptObject getBuiltinMath() {
+- return builtinMath;
++ return instance.javaImporter == LAZY_SENTINEL || instance.javaImporter == instance.getBuiltinJavaImporter();
+ }
+
+ /**
+@@ -1344,7 +1992,7 @@
+ */
+ public static boolean isBuiltinMath() {
+ final Global instance = Global.instance();
+- return instance.math == instance.getBuiltinMath();
++ return instance.math == instance.builtinMath;
+ }
+
+ private ScriptFunction getBuiltinNumber() {
+@@ -1389,7 +2037,10 @@
+ return instance.packages == instance.getBuiltinPackages();
+ }
+
+- private ScriptFunction getBuiltinRangeError() {
++ private synchronized ScriptFunction getBuiltinRangeError() {
++ if (this.builtinRangeError == null) {
++ this.builtinRangeError = initErrorSubtype("RangeError", getErrorPrototype());
++ }
+ return builtinRangeError;
+ }
+
+@@ -1400,10 +2051,10 @@
+ */
+ public static boolean isBuiltinRangeError() {
+ final Global instance = Global.instance();
+- return instance.rangeError == instance.getBuiltinRangeError();
++ return instance.rangeError == LAZY_SENTINEL || instance.rangeError == instance.getBuiltinRangeError();
+ }
+
+- private ScriptFunction getBuiltinReferenceError() {
++ private synchronized ScriptFunction getBuiltinReferenceError() {
+ return builtinReferenceError;
+ }
+
+@@ -1417,7 +2068,16 @@
+ return instance.referenceError == instance.getBuiltinReferenceError();
+ }
+
+- private ScriptFunction getBuiltinRegExp() {
++ private synchronized ScriptFunction getBuiltinRegExp() {
++ if (this.builtinRegExp == null) {
++ this.builtinRegExp = initConstructorAndSwitchPoint("RegExp", ScriptFunction.class);
++ final ScriptObject regExpProto = ScriptFunction.getPrototype(builtinRegExp);
++ // initialize default regexp object
++ this.DEFAULT_REGEXP = new NativeRegExp("(?:)", "", this, regExpProto);
++ // RegExp.prototype should behave like a RegExp object. So copy the
++ // properties.
++ regExpProto.addBoundProperties(DEFAULT_REGEXP);
++ }
+ return builtinRegExp;
+ }
+
+@@ -1428,7 +2088,7 @@
+ */
+ public static boolean isBuiltinRegExp() {
+ final Global instance = Global.instance();
+- return instance.regexp == instance.getBuiltinRegExp();
++ return instance.regexp == LAZY_SENTINEL || instance.regexp == instance.getBuiltinRegExp();
+ }
+
+ private ScriptFunction getBuiltinString() {
+@@ -1473,8 +2133,11 @@
+ return instance.typeError == instance.getBuiltinTypeError();
+ }
+
+- private ScriptFunction getBuiltinURIError() {
+- return builtinURIError;
++ private synchronized ScriptFunction getBuiltinURIError() {
++ if (this.builtinURIError == null) {
++ this.builtinURIError = initErrorSubtype("URIError", getErrorPrototype());
++ }
++ return this.builtinURIError;
+ }
+
+ /**
+@@ -1484,7 +2147,7 @@
+ */
+ public static boolean isBuiltinURIError() {
+ final Global instance = Global.instance();
+- return instance.uriError == instance.getBuiltinURIError();
++ return instance.uriError == LAZY_SENTINEL || instance.uriError == instance.getBuiltinURIError();
+ }
+
+ @Override
+@@ -1688,26 +2351,6 @@
+ }
+
+ /**
+- * Get the current split state.
+- *
+- * @return current split state
+- */
+- @Override
+- public int getSplitState() {
+- return splitState;
+- }
+-
+- /**
+- * Set the current split state.
+- *
+- * @param state current split state
+- */
+- @Override
+- public void setSplitState(final int state) {
+- splitState = state;
+- }
+-
+- /**
+ * Return the ES6 global scope for lexically declared bindings.
+ * @return the ES6 lexical global scope.
+ */
+@@ -1719,13 +2362,13 @@
+ @Override
+ public void addBoundProperties(final ScriptObject source, final jdk.nashorn.internal.runtime.Property[] properties) {
+ PropertyMap ownMap = getMap();
+- LexicalScope lexicalScope = null;
++ LexicalScope lexScope = null;
+ PropertyMap lexicalMap = null;
+ boolean hasLexicalDefinitions = false;
+
+ if (context.getEnv()._es6) {
+- lexicalScope = (LexicalScope) getLexicalScope();
+- lexicalMap = lexicalScope.getMap();
++ lexScope = (LexicalScope) getLexicalScope();
++ lexicalMap = lexScope.getMap();
+
+ for (final jdk.nashorn.internal.runtime.Property property : properties) {
+ if (property.isLexicalBinding()) {
+@@ -1745,8 +2388,8 @@
+
+ for (final jdk.nashorn.internal.runtime.Property property : properties) {
+ if (property.isLexicalBinding()) {
+- assert lexicalScope != null;
+- lexicalMap = lexicalScope.addBoundProperty(lexicalMap, source, property);
++ assert lexScope != null;
++ lexicalMap = lexScope.addBoundProperty(lexicalMap, source, property);
+
+ if (ownMap.findProperty(property.getKey()) != null) {
+ // If property exists in the global object invalidate any global constant call sites.
+@@ -1760,7 +2403,8 @@
+ setMap(ownMap);
+
+ if (hasLexicalDefinitions) {
+- lexicalScope.setMap(lexicalMap);
++ assert lexScope != null;
++ lexScope.setMap(lexicalMap);
+ invalidateLexicalSwitchPoint();
+ }
+ }
+@@ -1791,6 +2435,17 @@
+ }
+
+ @Override
++ protected FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
++ if (lexicalScope != null && start != this && start.isScope()) {
++ final FindProperty find = lexicalScope.findProperty(key, false);
++ if (find != null) {
++ return find;
++ }
++ }
++ return super.findProperty(key, deep, start);
++ }
++
++ @Override
+ public GuardedInvocation findSetMethod(final CallSiteDescriptor desc, final LinkRequest request) {
+ final boolean isScope = NashornCallSiteDescriptor.isScope(desc);
+
+@@ -1810,6 +2465,17 @@
+ return invocation;
+ }
+
++ /**
++ * Adds jjs shell interactive mode builtin functions to global scope.
++ */
++ public void addShellBuiltins() {
++ Object value = ScriptFunctionImpl.makeFunction("input", ShellFunctions.INPUT);
++ addOwnProperty("input", Attribute.NOT_ENUMERABLE, value);
++
++ value = ScriptFunctionImpl.makeFunction("evalinput", ShellFunctions.EVALINPUT);
++ addOwnProperty("evalinput", Attribute.NOT_ENUMERABLE, value);
++ }
++
+ private synchronized SwitchPoint getLexicalScopeSwitchPoint() {
+ SwitchPoint switchPoint = lexicalScopeSwitchPoint;
+ if (switchPoint == null || switchPoint.hasBeenInvalidated()) {
+@@ -1841,7 +2507,7 @@
+ }
+
+ @SuppressWarnings("hiding")
+- private void init(final ScriptEngine engine) {
++ private void init(final ScriptEngine eng) {
+ assert Context.getGlobal() == this : "this global is not set as current";
+
+ final ScriptEnvironment env = getContext().getEnv();
+@@ -1886,13 +2552,9 @@
+ // built-in constructors
+ this.builtinArray = initConstructorAndSwitchPoint("Array", ScriptFunction.class);
+ this.builtinBoolean = initConstructorAndSwitchPoint("Boolean", ScriptFunction.class);
+- this.builtinDate = initConstructorAndSwitchPoint("Date", ScriptFunction.class);
+- this.builtinJSON = initConstructorAndSwitchPoint("JSON", ScriptObject.class);
+- this.builtinJSAdapter = initConstructorAndSwitchPoint("JSAdapter", ScriptFunction.class);
++ this.builtinNumber = initConstructorAndSwitchPoint("Number", ScriptFunction.class);
++ this.builtinString = initConstructorAndSwitchPoint("String", ScriptFunction.class);
+ this.builtinMath = initConstructorAndSwitchPoint("Math", ScriptObject.class);
+- this.builtinNumber = initConstructorAndSwitchPoint("Number", ScriptFunction.class);
+- this.builtinRegExp = initConstructorAndSwitchPoint("RegExp", ScriptFunction.class);
+- this.builtinString = initConstructorAndSwitchPoint("String", ScriptFunction.class);
+
+ // initialize String.prototype.length to 0
+ // add String.prototype.length
+@@ -1903,26 +2565,28 @@
+ final ScriptObject arrayPrototype = getArrayPrototype();
+ arrayPrototype.setIsArray();
+
+- this.DEFAULT_DATE = new NativeDate(Double.NaN, this);
+-
+- // initialize default regexp object
+- this.DEFAULT_REGEXP = new NativeRegExp("(?:)", this);
+-
+- // RegExp.prototype should behave like a RegExp object. So copy the
+- // properties.
+- final ScriptObject regExpProto = getRegExpPrototype();
+- regExpProto.addBoundProperties(DEFAULT_REGEXP);
+-
+ // Error stuff
+ initErrorObjects();
+
+ // java access
+ if (! env._no_java) {
++ this.javaApi = LAZY_SENTINEL;
++ this.javaImporter = LAZY_SENTINEL;
+ initJavaAccess();
+ }
+
+ if (! env._no_typed_arrays) {
+- initTypedArray();
++ this.arrayBuffer = LAZY_SENTINEL;
++ this.dataView = LAZY_SENTINEL;
++ this.int8Array = LAZY_SENTINEL;
++ this.uint8Array = LAZY_SENTINEL;
++ this.uint8ClampedArray = LAZY_SENTINEL;
++ this.int16Array = LAZY_SENTINEL;
++ this.uint16Array = LAZY_SENTINEL;
++ this.int32Array = LAZY_SENTINEL;
++ this.uint32Array = LAZY_SENTINEL;
++ this.float32Array = LAZY_SENTINEL;
++ this.float64Array = LAZY_SENTINEL;
+ }
+
+ if (env._scripting) {
+@@ -1959,7 +2623,7 @@
+ addOwnProperty("$ARG", Attribute.NOT_ENUMERABLE, arguments);
+ }
+
+- if (engine != null) {
++ if (eng != null) {
+ // default file name
+ addOwnProperty(ScriptEngine.FILENAME, Attribute.NOT_ENUMERABLE, null);
+ // __noSuchProperty__ hook for ScriptContext search of missing variables
+@@ -1996,12 +2660,9 @@
+
+ tagBuiltinProperties("Error", builtinError);
+
+- this.builtinEvalError = initErrorSubtype("EvalError", errorProto);
+- this.builtinRangeError = initErrorSubtype("RangeError", errorProto);
+ this.builtinReferenceError = initErrorSubtype("ReferenceError", errorProto);
+ this.builtinSyntaxError = initErrorSubtype("SyntaxError", errorProto);
+ this.builtinTypeError = initErrorSubtype("TypeError", errorProto);
+- this.builtinURIError = initErrorSubtype("URIError", errorProto);
+ }
+
+ private ScriptFunction initErrorSubtype(final String name, final ScriptObject errorProto) {
+@@ -2023,8 +2684,6 @@
+ this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
+ this.builtinJavax = new NativeJavaPackage("javax", objectProto);
+ this.builtinOrg = new NativeJavaPackage("org", objectProto);
+- this.builtinJavaImporter = initConstructor("JavaImporter", ScriptFunction.class);
+- this.builtinJavaApi = initConstructor("Java", ScriptObject.class);
+ }
+
+ private void initScripting(final ScriptEnvironment scriptEnv) {
+@@ -2055,6 +2714,14 @@
+ // Retrieve current state of ENV variables.
+ final ScriptObject env = newObject();
+ env.putAll(System.getenv(), scriptEnv._strict);
++
++ // Some platforms, e.g., Windows, do not define the PWD environment
++ // variable, so that the $ENV.PWD property needs to be explicitly
++ // set.
++ if (!env.containsKey(ScriptingFunctions.PWD_NAME)) {
++ env.put(ScriptingFunctions.PWD_NAME, System.getProperty("user.dir"), scriptEnv._strict);
++ }
++
+ addOwnProperty(ScriptingFunctions.ENV_NAME, Attribute.NOT_ENUMERABLE, env);
+ } else {
+ addOwnProperty(ScriptingFunctions.ENV_NAME, Attribute.NOT_ENUMERABLE, UNDEFINED);
+@@ -2076,60 +2743,25 @@
+ }
+ }
+
+- private void initTypedArray() {
+- this.builtinArrayBuffer = initConstructorAndSwitchPoint("ArrayBuffer", ScriptFunction.class);
+- this.builtinDataView = initConstructorAndSwitchPoint("DataView", ScriptFunction.class);
+- this.builtinInt8Array = initConstructorAndSwitchPoint("Int8Array", ScriptFunction.class);
+- this.builtinUint8Array = initConstructorAndSwitchPoint("Uint8Array", ScriptFunction.class);
+- this.builtinUint8ClampedArray = initConstructorAndSwitchPoint("Uint8ClampedArray", ScriptFunction.class);
+- this.builtinInt16Array = initConstructorAndSwitchPoint("Int16Array", ScriptFunction.class);
+- this.builtinUint16Array = initConstructorAndSwitchPoint("Uint16Array", ScriptFunction.class);
+- this.builtinInt32Array = initConstructorAndSwitchPoint("Int32Array", ScriptFunction.class);
+- this.builtinUint32Array = initConstructorAndSwitchPoint("Uint32Array", ScriptFunction.class);
+- this.builtinFloat32Array = initConstructorAndSwitchPoint("Float32Array", ScriptFunction.class);
+- this.builtinFloat64Array = initConstructorAndSwitchPoint("Float64Array", ScriptFunction.class);
+-
+- }
+-
+ private void copyBuiltins() {
+ this.array = this.builtinArray;
+ this._boolean = this.builtinBoolean;
+- this.date = this.builtinDate;
+ this.error = this.builtinError;
+- this.evalError = this.builtinEvalError;
+ this.function = this.builtinFunction;
+- this.jsadapter = this.builtinJSAdapter;
+- this.json = this.builtinJSON;
+ this.com = this.builtinCom;
+ this.edu = this.builtinEdu;
+ this.java = this.builtinJava;
+ this.javafx = this.builtinJavafx;
+ this.javax = this.builtinJavax;
+ this.org = this.builtinOrg;
+- this.javaImporter = this.builtinJavaImporter;
+- this.javaApi = this.builtinJavaApi;
+ this.math = this.builtinMath;
+ this.number = this.builtinNumber;
+ this.object = this.builtinObject;
+ this.packages = this.builtinPackages;
+- this.rangeError = this.builtinRangeError;
+ this.referenceError = this.builtinReferenceError;
+- this.regexp = this.builtinRegExp;
+ this.string = this.builtinString;
+ this.syntaxError = this.builtinSyntaxError;
+ this.typeError = this.builtinTypeError;
+- this.uriError = this.builtinURIError;
+- this.arrayBuffer = this.builtinArrayBuffer;
+- this.dataView = this.builtinDataView;
+- this.int8Array = this.builtinInt8Array;
+- this.uint8Array = this.builtinUint8Array;
+- this.uint8ClampedArray = this.builtinUint8ClampedArray;
+- this.int16Array = this.builtinInt16Array;
+- this.uint16Array = this.builtinUint16Array;
+- this.int32Array = this.builtinInt32Array;
+- this.uint32Array = this.builtinUint32Array;
+- this.float32Array = this.builtinFloat32Array;
+- this.float64Array = this.builtinFloat64Array;
+ }
+
+ private void initDebug() {
+@@ -2137,8 +2769,9 @@
+ }
+
+ private Object printImpl(final boolean newLine, final Object... objects) {
++ final ScriptContext sc = currentContext();
+ @SuppressWarnings("resource")
+- final PrintWriter out = scontext != null? new PrintWriter(scontext.getWriter()) : getContext().getEnv().getOut();
++ final PrintWriter out = sc != null? new PrintWriter(sc.getWriter()) : getContext().getEnv().getOut();
+ final StringBuilder sb = new StringBuilder();
+
+ for (final Object obj : objects) {
+@@ -2351,8 +2984,8 @@
+ */
+ private static class LexicalScope extends ScriptObject {
+
+- LexicalScope(final ScriptObject proto) {
+- super(proto, PropertyMap.newMap());
++ LexicalScope(final Global global) {
++ super(global, PropertyMap.newMap());
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeArray.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeArray.java Wed Jul 01 21:54:30 2015 -0700
+@@ -120,9 +120,6 @@
+ this(ArrayData.allocate(array.length));
+
+ ArrayData arrayData = this.getArray();
+- if (array.length > 0) {
+- arrayData.ensure(array.length - 1);
+- }
+
+ for (int index = 0; index < array.length; index++) {
+ final Object value = array[index];
+@@ -275,7 +272,7 @@
+ final PropertyDescriptor newLenDesc = desc;
+
+ // Step 3c and 3d - get new length and convert to long
+- final long newLen = NativeArray.validLength(newLenDesc.getValue(), true);
++ final long newLen = NativeArray.validLength(newLenDesc.getValue());
+
+ // Step 3e
+ newLenDesc.setValue(newLen);
+@@ -348,8 +345,8 @@
+ final PropertyDescriptor oldLenDesc = (PropertyDescriptor) super.getOwnPropertyDescriptor("length");
+
+ // Step 2
+- // get old length and convert to long
+- final long oldLen = NativeArray.validLength(oldLenDesc.getValue(), true);
++ // get old length and convert to long. Always a Long/Uint32 but we take the safe road.
++ final long oldLen = JSType.toUint32(oldLenDesc.getValue());
+
+ // Step 3
+ if ("length".equals(key)) {
+@@ -471,7 +468,7 @@
+ @Setter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
+ public static void length(final Object self, final Object length) {
+ if (isArray(self)) {
+- ((ScriptObject)self).setLength(validLength(length, true));
++ ((ScriptObject)self).setLength(validLength(length));
+ }
+ }
+
+@@ -495,18 +492,13 @@
+ length(self, length); // Same as instance setter but we can't make nasgen use the same method for prototype
+ }
+
+- static long validLength(final Object length, final boolean reject) {
++ static long validLength(final Object length) {
++ // ES5 15.4.5.1, steps 3.c and 3.d require two ToNumber conversions here
+ final double doubleLength = JSType.toNumber(length);
+- if (!Double.isNaN(doubleLength) && JSType.isRepresentableAsLong(doubleLength)) {
+- final long len = (long) doubleLength;
+- if (len >= 0 && len <= JSType.MAX_UINT) {
+- return len;
+- }
+- }
+- if (reject) {
++ if (doubleLength != JSType.toUint32(length)) {
+ throw rangeError("inappropriate.array.length", ScriptRuntime.safeToString(length));
+ }
+- return -1;
++ return (long) doubleLength;
+ }
+
+ /**
+@@ -1236,31 +1228,41 @@
+ final List<Object> list = Arrays.asList(array);
+ final Object cmpThis = cmp == null || cmp.isStrict() ? ScriptRuntime.UNDEFINED : Global.instance();
+
+- Collections.sort(list, new Comparator<Object>() {
+- private final MethodHandle call_cmp = getCALL_CMP();
+- @Override
+- public int compare(final Object x, final Object y) {
+- if (x == ScriptRuntime.UNDEFINED && y == ScriptRuntime.UNDEFINED) {
+- return 0;
+- } else if (x == ScriptRuntime.UNDEFINED) {
+- return 1;
+- } else if (y == ScriptRuntime.UNDEFINED) {
+- return -1;
++ try {
++ Collections.sort(list, new Comparator<Object>() {
++ private final MethodHandle call_cmp = getCALL_CMP();
++ @Override
++ public int compare(final Object x, final Object y) {
++ if (x == ScriptRuntime.UNDEFINED && y == ScriptRuntime.UNDEFINED) {
++ return 0;
++ } else if (x == ScriptRuntime.UNDEFINED) {
++ return 1;
++ } else if (y == ScriptRuntime.UNDEFINED) {
++ return -1;
++ }
++
++ if (cmp != null) {
++ try {
++ return (int)Math.signum((double)call_cmp.invokeExact(cmp, cmpThis, x, y));
++ } catch (final RuntimeException | Error e) {
++ throw e;
++ } catch (final Throwable t) {
++ throw new RuntimeException(t);
++ }
++ }
++
++ return JSType.toString(x).compareTo(JSType.toString(y));
+ }
++ });
++ } catch (final IllegalArgumentException iae) {
++ // Collections.sort throws IllegalArgumentException when
++ // Comparison method violates its general contract
+
+- if (cmp != null) {
+- try {
+- return (int)Math.signum((double)call_cmp.invokeExact(cmp, cmpThis, x, y));
+- } catch (final RuntimeException | Error e) {
+- throw e;
+- } catch (final Throwable t) {
+- throw new RuntimeException(t);
+- }
+- }
+-
+- return JSType.toString(x).compareTo(JSType.toString(y));
+- }
+- });
++ // See ECMA spec 15.4.4.11 Array.prototype.sort (comparefn).
++ // If "comparefn" is not undefined and is not a consistent
++ // comparison function for the elements of this array, the
++ // behaviour of sort is implementation-defined.
++ }
+
+ return list.toArray(new Object[array.length]);
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeArrayBuffer.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeArrayBuffer.java Wed Jul 01 21:54:30 2015 -0700
+@@ -101,7 +101,7 @@
+ }
+
+ if (args.length == 0) {
+- throw new RuntimeException("missing length argument");
++ return new NativeArrayBuffer(0);
+ }
+
+ return new NativeArrayBuffer(JSType.toInt32(args[0]));
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeDate.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeDate.java Wed Jul 01 21:54:30 2015 -0700
+@@ -30,6 +30,7 @@
+ import static java.lang.Double.isNaN;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.rangeError;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
++
+ import java.util.Locale;
+ import java.util.TimeZone;
+ import java.util.concurrent.Callable;
+@@ -40,7 +41,6 @@
+ import jdk.nashorn.internal.objects.annotations.SpecializedFunction;
+ import jdk.nashorn.internal.objects.annotations.Where;
+ import jdk.nashorn.internal.parser.DateParser;
+-import jdk.nashorn.internal.runtime.ConsString;
+ import jdk.nashorn.internal.runtime.JSType;
+ import jdk.nashorn.internal.runtime.PropertyMap;
+ import jdk.nashorn.internal.runtime.ScriptEnvironment;
+@@ -121,6 +121,10 @@
+ this.timezone = env._timezone;
+ }
+
++ NativeDate(final double time, final ScriptObject proto) {
++ this(time, proto, $nasgenmap$);
++ }
++
+ NativeDate(final double time, final Global global) {
+ this(time, global.getDatePrototype(), $nasgenmap$);
+ }
+@@ -183,7 +187,7 @@
+ case 1:
+ double num;
+ final Object arg = JSType.toPrimitive(args[0]);
+- if (arg instanceof String || arg instanceof ConsString) {
++ if (JSType.isString(arg)) {
+ num = parseDateString(arg.toString());
+ } else {
+ num = timeClip(JSType.toNumber(args[0]));
+@@ -1276,7 +1280,7 @@
+ if (self instanceof NativeDate) {
+ return (NativeDate)self;
+ } else if (self != null && self == Global.instance().getDatePrototype()) {
+- return Global.instance().DEFAULT_DATE;
++ return Global.instance().getDefaultDate();
+ } else {
+ throw typeError("not.a.date", ScriptRuntime.safeToString(self));
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java Wed Jul 01 21:54:30 2015 -0700
+@@ -37,6 +37,7 @@
+ import jdk.nashorn.internal.runtime.JSType;
+ import jdk.nashorn.internal.runtime.PropertyListeners;
+ import jdk.nashorn.internal.runtime.PropertyMap;
++import jdk.nashorn.internal.runtime.Scope;
+ import jdk.nashorn.internal.runtime.ScriptFunction;
+ import jdk.nashorn.internal.runtime.ScriptObject;
+ import jdk.nashorn.internal.runtime.ScriptRuntime;
+@@ -245,7 +246,7 @@
+ final PrintWriter out = Context.getCurrentErr();
+
+ out.println("ScriptObject count " + ScriptObject.getCount());
+- out.println("Scope count " + ScriptObject.getScopeCount());
++ out.println("Scope count " + Scope.getCount());
+ out.println("ScriptObject listeners added " + PropertyListeners.getListenersAdded());
+ out.println("ScriptObject listeners removed " + PropertyListeners.getListenersRemoved());
+ out.println("ScriptFunction constructor calls " + ScriptFunction.getConstructorCount());
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeFloat32Array.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeFloat32Array.java Wed Jul 01 21:54:30 2015 -0700
+@@ -114,12 +114,11 @@
+
+ private void setElem(final int index, final double elem) {
+ try {
+- nb.put(index, (float)elem);
++ if (index < nb.limit()) {
++ nb.put(index, (float) elem);
++ }
+ } catch (final IndexOutOfBoundsException e) {
+- //swallow valid array indexes. it's ok.
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeFloat64Array.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeFloat64Array.java Wed Jul 01 21:54:30 2015 -0700
+@@ -114,12 +114,11 @@
+
+ private void setElem(final int index, final double elem) {
+ try {
+- nb.put(index, elem);
++ if (index < nb.limit()) {
++ nb.put(index, elem);
++ }
+ } catch (final IndexOutOfBoundsException e) {
+- //swallow valid array indexes. it's ok.
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeFunction.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeFunction.java Wed Jul 01 21:54:30 2015 -0700
+@@ -279,8 +279,8 @@
+ sb.append("})");
+
+ final Global global = Global.instance();
+-
+- return (ScriptFunction)Global.directEval(global, sb.toString(), global, "<function>", global.isStrictContext());
++ final Context context = global.getContext();
++ return (ScriptFunction)context.eval(global, sb.toString(), global, "<function>");
+ }
+
+ private static void checkFunctionParameters(final String params) {
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeInt16Array.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeInt16Array.java Wed Jul 01 21:54:30 2015 -0700
+@@ -115,12 +115,11 @@
+
+ private void setElem(final int index, final int elem) {
+ try {
+- nb.put(index, (short)elem);
++ if (index < nb.limit()) {
++ nb.put(index, (short) elem);
++ }
+ } catch (final IndexOutOfBoundsException e) {
+- //swallow valid array indexes. it's ok.
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeInt32Array.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeInt32Array.java Wed Jul 01 21:54:30 2015 -0700
+@@ -104,11 +104,11 @@
+
+ private void setElem(final int index, final int elem) {
+ try {
+- nb.put(index, elem);
+- } catch (final IndexOutOfBoundsException e) {
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ if (index < nb.limit()) {
++ nb.put(index, elem);
++ }
++ } catch (final IndexOutOfBoundsException e) {
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeInt8Array.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeInt8Array.java Wed Jul 01 21:54:30 2015 -0700
+@@ -113,12 +113,11 @@
+
+ private void setElem(final int index, final int elem) {
+ try {
+- nb.put(index, (byte)elem);
++ if (index < nb.limit()) {
++ nb.put(index, (byte) elem);
++ }
+ } catch (final IndexOutOfBoundsException e) {
+- //swallow valid array indexes. it's ok.
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -160,7 +160,7 @@
+ }
+
+ private static ScriptObject wrapAdaptee(final ScriptObject adaptee) {
+- return new JO(adaptee, JO.getInitialMap());
++ return new JO(adaptee);
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeJSON.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeJSON.java Wed Jul 01 21:54:30 2015 -0700
+@@ -181,7 +181,7 @@
+ }
+ gap = sb.toString();
+ }
+- } else if (modSpace instanceof String || modSpace instanceof ConsString) {
++ } else if (JSType.isString(modSpace)) {
+ final String str = modSpace.toString();
+ gap = str.substring(0, Math.min(10, str.length()));
+ } else {
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeJava.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeJava.java Wed Jul 01 21:54:30 2015 -0700
+@@ -33,10 +33,12 @@
+ import java.util.Collection;
+ import java.util.Deque;
+ import java.util.List;
++import java.util.Map;
++import java.util.Queue;
+ import jdk.internal.dynalink.beans.StaticClass;
+ import jdk.internal.dynalink.support.TypeUtilities;
+ import jdk.nashorn.api.scripting.JSObject;
+-import jdk.nashorn.api.scripting.ScriptUtils;
++import jdk.nashorn.api.scripting.ScriptObjectMirror;
+ import jdk.nashorn.internal.objects.annotations.Attribute;
+ import jdk.nashorn.internal.objects.annotations.Function;
+ import jdk.nashorn.internal.objects.annotations.ScriptClass;
+@@ -339,7 +341,8 @@
+
+ /**
+ * Given a script object and a Java type, converts the script object into the desired Java type. Currently it
+- * performs shallow creation of Java arrays, as well as wrapping of objects in Lists and Dequeues. Example:
++ * performs shallow creation of Java arrays, as well as wrapping of objects in Lists, Dequeues, Queues,
++ * and Collections. Example:
+ * <pre>
+ * var anArray = [1, "13", false]
+ * var javaIntArray = Java.to(anArray, "int[]")
+@@ -353,9 +356,10 @@
+ * object to create. Can not be null. If undefined, a "default" conversion is presumed (allowing the argument to be
+ * omitted).
+ * @return a Java object whose value corresponds to the original script object's value. Specifically, for array
+- * target types, returns a Java array of the same type with contents converted to the array's component type. Does
+- * not recursively convert for multidimensional arrays. For {@link List} or {@link Deque}, returns a live wrapper
+- * around the object, see {@link ListAdapter} for details. Returns null if obj is null.
++ * target types, returns a Java array of the same type with contents converted to the array's component type.
++ * Converts recursively when the target type is multidimensional array. For {@link List}, {@link Deque},
++ * {@link Queue}, or {@link Collection}, returns a live wrapper around the object, see {@link ListAdapter} for
++ * details. Returns null if obj is null.
+ * @throws ClassNotFoundException if the class described by objType is not found
+ */
+ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
+@@ -385,7 +389,7 @@
+ return JSType.toJavaArray(obj, targetClass.getComponentType());
+ }
+
+- if(targetClass == List.class || targetClass == Deque.class) {
++ if (targetClass == List.class || targetClass == Deque.class || targetClass == Queue.class || targetClass == Collection.class) {
+ return ListAdapter.create(obj);
+ }
+
+@@ -654,4 +658,20 @@
+ public static Object _super(final Object self, final Object adapter) {
+ return Bootstrap.createSuperAdapter(adapter);
+ }
++
++ /**
++ * Returns an object that is compatible with Java JSON libraries expectations; namely, that if it itself, or any
++ * object transitively reachable through it is a JavaScript array, then such objects will be exposed as
++ * {@link JSObject} that also implements the {@link List} interface for exposing the array elements. An explicit
++ * API is required as otherwise Nashorn exposes all objects externally as {@link JSObject}s that also implement the
++ * {@link Map} interface instead. By using this method, arrays will be exposed as {@link List}s and all other
++ * objects as {@link Map}s.
++ * @param self not used
++ * @param obj the object to be exposed in a Java JSON library compatible manner.
++ * @return a wrapper around the object that will enforce Java JSON library compatible exposure.
++ */
++ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
++ public static Object asJSONCompatible(final Object self, final Object obj) {
++ return ScriptObjectMirror.wrapAsJSONCompatible(obj, Context.getGlobal());
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeObject.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeObject.java Wed Jul 01 21:54:30 2015 -0700
+@@ -499,7 +499,7 @@
+ final Object obj = JSType.toScriptObject(self);
+ if (obj instanceof ScriptObject) {
+ final InvokeByName toStringInvoker = getTO_STRING();
+- final ScriptObject sobj = (ScriptObject)self;
++ final ScriptObject sobj = (ScriptObject)obj;
+ try {
+ final Object toString = toStringInvoker.getGetter().invokeExact(sobj);
+
+@@ -765,7 +765,7 @@
+ continue;
+ }
+ properties.add(AccessorProperty.create(methodName, Property.NOT_WRITABLE, getBoundBeanMethodGetter(source,
+- method), null));
++ method), Lookup.EMPTY_SETTER));
+ }
+ for(final String propertyName: propertyNames) {
+ MethodHandle getter;
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java Wed Jul 01 21:54:30 2015 -0700
+@@ -78,8 +78,8 @@
+ this.globalObject = global;
+ }
+
+- NativeRegExp(final String input, final String flagString, final Global global) {
+- this(global);
++ NativeRegExp(final String input, final String flagString, final Global global, final ScriptObject proto) {
++ super(proto, $nasgenmap$);
+ try {
+ this.regexp = RegExpFactory.create(input, flagString);
+ } catch (final ParserException e) {
+@@ -87,8 +87,12 @@
+ e.throwAsEcmaException();
+ throw new AssertionError(); //guard against null warnings below
+ }
++ this.globalObject = global;
++ this.setLastIndex(0);
++ }
+
+- this.setLastIndex(0);
++ NativeRegExp(final String input, final String flagString, final Global global) {
++ this(input, flagString, global, global.getRegExpPrototype());
+ }
+
+ NativeRegExp(final String input, final String flagString) {
+@@ -928,7 +932,7 @@
+ if (self instanceof NativeRegExp) {
+ return (NativeRegExp)self;
+ } else if (self != null && self == Global.instance().getRegExpPrototype()) {
+- return Global.instance().DEFAULT_REGEXP;
++ return Global.instance().getDefaultRegExp();
+ } else {
+ throw typeError("not.a.regexp", ScriptRuntime.safeToString(self));
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java Wed Jul 01 21:54:30 2015 -0700
+@@ -88,7 +88,7 @@
+ @Setter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
+ public static void length(final Object self, final Object length) {
+ if (self instanceof ScriptObject) {
+- ((ScriptObject)self).setLength(NativeArray.validLength(length, true));
++ ((ScriptObject)self).setLength(NativeArray.validLength(length));
+ }
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeString.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeString.java Wed Jul 01 21:54:30 2015 -0700
+@@ -90,7 +90,7 @@
+
+ private NativeString(final CharSequence value, final ScriptObject proto, final PropertyMap map) {
+ super(proto, map);
+- assert value instanceof String || value instanceof ConsString;
++ assert JSType.isString(value);
+ this.value = value;
+ }
+
+@@ -155,7 +155,7 @@
+ final Object self = request.getReceiver();
+ final Class<?> returnType = desc.getMethodType().returnType();
+
+- if (returnType == Object.class && (self instanceof String || self instanceof ConsString)) {
++ if (returnType == Object.class && JSType.isString(self)) {
+ try {
+ return new GuardedInvocation(MH.findStatic(MethodHandles.lookup(), NativeString.class, "get", desc.getMethodType()), NashornGuards.getInstanceOf2Guard(String.class, ConsString.class));
+ } catch (final LookupException e) {
+@@ -1312,7 +1312,7 @@
+ }
+
+ private static CharSequence getCharSequence(final Object self) {
+- if (self instanceof String || self instanceof ConsString) {
++ if (JSType.isString(self)) {
+ return (CharSequence)self;
+ } else if (self instanceof NativeString) {
+ return ((NativeString)self).getValue();
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeUint16Array.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeUint16Array.java Wed Jul 01 21:54:30 2015 -0700
+@@ -104,12 +104,11 @@
+
+ private void setElem(final int index, final int elem) {
+ try {
+- nb.put(index, (char)elem);
++ if (index < nb.limit()) {
++ nb.put(index, (char) elem);
++ }
+ } catch (final IndexOutOfBoundsException e) {
+- //swallow valid array indexes. it's ok.
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeUint32Array.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeUint32Array.java Wed Jul 01 21:54:30 2015 -0700
+@@ -113,12 +113,11 @@
+
+ private void setElem(final int index, final int elem) {
+ try {
+- nb.put(index, elem);
++ if (index < nb.limit()) {
++ nb.put(index, elem);
++ }
+ } catch (final IndexOutOfBoundsException e) {
+- //swallow valid array indexes. it's ok.
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeUint8Array.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeUint8Array.java Wed Jul 01 21:54:30 2015 -0700
+@@ -104,12 +104,11 @@
+
+ private void setElem(final int index, final int elem) {
+ try {
+- nb.put(index, (byte)elem);
++ if (index < nb.limit()) {
++ nb.put(index, (byte) elem);
++ }
+ } catch (final IndexOutOfBoundsException e) {
+- //swallow valid array indexes. it's ok.
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java Wed Jul 01 21:54:30 2015 -0700
+@@ -133,18 +133,17 @@
+
+ private void setElem(final int index, final int elem) {
+ try {
+- final byte clamped;
+- if ((elem & 0xffff_ff00) == 0) {
+- clamped = (byte)elem;
+- } else {
+- clamped = elem < 0 ? 0 : (byte)0xff;
++ if (index < nb.limit()) {
++ final byte clamped;
++ if ((elem & 0xffff_ff00) == 0) {
++ clamped = (byte) elem;
++ } else {
++ clamped = elem < 0 ? 0 : (byte) 0xff;
++ }
++ nb.put(index, clamped);
+ }
+- nb.put(index, clamped);
+ } catch (final IndexOutOfBoundsException e) {
+- //swallow valid array indexes. it's ok.
+- if (index < 0) {
+- throw new ClassCastException();
+- }
++ throw new ClassCastException();
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java Wed Jul 01 21:54:30 2015 -0700
+@@ -118,13 +118,26 @@
+ }
+
+ /**
+- * Constructor called by (compiler) generated code for {@link ScriptObject}s.
++ * Factory method called by compiler generated code for functions that need parent scope.
+ *
+- * @param data static function data
+- * @param scope scope object
++ * @param constants the generated class' constant array
++ * @param index the index of the {@code RecompilableScriptFunctionData} object in the constants array.
++ * @param scope the parent scope object
++ * @return a newly created function object
+ */
+- public ScriptFunctionImpl(final RecompilableScriptFunctionData data, final ScriptObject scope) {
+- this(data, scope, Global.instance());
++ public static ScriptFunction create(final Object[] constants, final int index, final ScriptObject scope) {
++ return new ScriptFunctionImpl((RecompilableScriptFunctionData)constants[index], scope, Global.instance());
++ }
++
++ /**
++ * Factory method called by compiler generated code for functions that don't need parent scope.
++ *
++ * @param constants the generated class' constant array
++ * @param index the index of the {@code RecompilableScriptFunctionData} object in the constants array.
++ * @return a newly created function object
++ */
++ public static ScriptFunction create(final Object[] constants, final int index) {
++ return create(constants, index, null);
+ }
+
+ /**
+@@ -292,7 +305,7 @@
+ final ScriptFunction typeErrorThrower = global.getTypeErrorThrower();
+ if (findProperty("arguments", true) != null) {
+ initUserAccessors("arguments", Property.NOT_CONFIGURABLE | Property.NOT_ENUMERABLE, typeErrorThrower, typeErrorThrower);
+- }
++ }
+ if (findProperty("caller", true) != null) {
+ initUserAccessors("caller", Property.NOT_CONFIGURABLE | Property.NOT_ENUMERABLE, typeErrorThrower, typeErrorThrower);
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/annotations/Constructor.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/annotations/Constructor.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -37,13 +37,15 @@
+ @Target(ElementType.METHOD)
+ public @interface Constructor {
+ /**
+- * Name of the constructor function. If empty, the name is inferred.
++ * @return the name of the constructor function. If empty, the name is
++ * inferred.
+ */
+ public String name() default "";
+
+ /**
+- * The arity of the function. By default computed from the method signature.
+- * Note that -1 means varargs. So, -2 is used as invalid arity.
++ * @return the arity of the function. By default computed from the method
++ * signature. Note that -1 means varargs. So, -2 is used as invalid
++ * arity.
+ */
+ public int arity() default -2;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/annotations/Function.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/annotations/Function.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -41,22 +41,23 @@
+ @Target(ElementType.METHOD)
+ public @interface Function {
+ /**
+- * Name of the property. If empty, the name is inferred.
++ * @return the name of the property. If empty, the name is inferred.
+ */
+ public String name() default "";
+
+ /**
+- * Attribute flags for this function.
++ * @return the attribute flags for this function.
+ */
+ public int attributes() default DEFAULT_ATTRIBUTES;
+
+ /**
+- * The arity of the function. By default computed from the method signature
++ * @return the arity of the function. By default computed from the method
++ * signature.
+ */
+ public int arity() default -2;
+
+ /**
+- * where this function lives
++ * @return where this function lives.
+ */
+ public Where where() default Where.PROTOTYPE;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/annotations/Getter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/annotations/Getter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -39,17 +39,17 @@
+ @Target(ElementType.METHOD)
+ public @interface Getter {
+ /**
+- * Name of the property. If empty, the name is inferred.
++ * @return the name of the property. If empty, the name is inferred.
+ */
+ public String name() default "";
+
+ /**
+- * Attribute flags for this setter.
++ * @return the attribute flags for this setter.
+ */
+ public int attributes() default DEFAULT_ATTRIBUTES;
+
+ /**
+- * Where this getter lives?
++ * @return where this getter lives.
+ */
+ public Where where() default Where.INSTANCE;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/annotations/ScriptClass.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/annotations/ScriptClass.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -37,8 +37,8 @@
+ @Target(ElementType.TYPE)
+ public @interface ScriptClass {
+ /**
+- * Name of the script class. By default, the name is derived from
+- * the Java class name.
++ * @return the name of the script class. By default, the name is derived
++ * from the Java class name.
+ */
+ public String value() default "";
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/annotations/Setter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/annotations/Setter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -39,17 +39,17 @@
+ @Target(ElementType.METHOD)
+ public @interface Setter {
+ /**
+- * Name of the script property. If empty, the name is inferred.
++ * @return the name of the script property. If empty, the name is inferred.
+ */
+ public String name() default "";
+
+ /**
+- * Attribute flags for this setter.
++ * @return the attribute flags for this setter.
+ */
+ public int attributes() default DEFAULT_ATTRIBUTES;
+
+ /**
+- * Where this setter lives?
++ * @return where this setter lives.
+ */
+ public Where where() default Where.INSTANCE;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/objects/annotations/SpecializedFunction.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/objects/annotations/SpecializedFunction.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -33,10 +33,11 @@
+ import jdk.internal.dynalink.CallSiteDescriptor;
+ import jdk.internal.dynalink.linker.LinkRequest;
+ import jdk.nashorn.internal.runtime.ScriptFunction;
++import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
+
+ /**
+ * The SpecializedFunction annotation is used to flag more type specific
+- * functions than the standard one in the native objects
++ * functions than the standard one in the native objects.
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.METHOD)
+@@ -45,23 +46,23 @@
+ /**
+ * Functionality for testing if we are allowed to link a specialized
+ * function the first time we encounter it. Then the guard will handle the
+- * rest of the invocations
++ * rest of the invocations.
+ *
+- * This is the same for all callsites in Nashorn, the first time callsite is
++ * This is the same for all callsites in Nashorn; the first time a callsite is
+ * linked, we have to manually check that the linkage is OK. Even if we add
+ * a guard and it fails upon the first try, this is not good enough.
+- * (Symmetrical to how it works everywhere else in the Nashorn runtime).
++ * (Symmetrical to how it works everywhere else in the Nashorn runtime.)
+ *
+ * Here we abstract out a few of the most common link guard checks.
+ */
+ public static abstract class LinkLogic {
+ /**
+- * Empty link logic instance - this is the default
++ * Empty link logic instance - this is the default.
+ * "no special linking or runtime guard behavior"
+ */
+ public static final LinkLogic EMPTY_INSTANCE = new Empty();
+
+- /** Empty link logic class - allow all linking, no guards */
++ /** Empty link logic class - allow all linking, no guards. */
+ private static final class Empty extends LinkLogic {
+ @Override
+ public boolean canLink(final Object self, final CallSiteDescriptor desc, final LinkRequest request) {
+@@ -75,7 +76,8 @@
+ }
+
+ /**
+- * Get the class representing the empty link logic
++ * Get the class representing the empty link logic.
++ *
+ * @return class representing empty link logic
+ */
+ public static Class<? extends LinkLogic> getEmptyLinkLogicClass() {
+@@ -83,31 +85,31 @@
+ }
+
+ /**
+- * Should this callsite relink when an exception is thrown
++ * Should this callsite relink when an exception is thrown?
+ *
+- * @return the relink exception, or null if none
++ * @return the relink exception, or {@code null} if none
+ */
+ public Class<? extends Throwable> getRelinkException() {
+ return null;
+ }
+
+ /**
+- * Is this link logic class empty - i.e. no special linking logic
+- * supplied
++ * Is this link logic class empty - i.e., no special linking logic
++ * supplied?
+ *
+ * @param clazz class to check
+ *
+- * @return true if this link logic is empty
++ * @return {@code true} if this link logic is empty
+ */
+ public static boolean isEmpty(final Class<? extends LinkLogic> clazz) {
+ return clazz == Empty.class;
+ }
+
+ /**
+- * Is this link logic instance empty - i.e. no special linking logic
+- * supplied
++ * Is this link logic instance empty - i.e., no special linking logic
++ * supplied?
+ *
+- * @return true if this link logic instance is empty
++ * @return {@code true} if this link logic instance is empty
+ */
+ public boolean isEmpty() {
+ return false;
+@@ -121,7 +123,7 @@
+ * @param desc callsite descriptor
+ * @param request link request
+ *
+- * @return true if we can link this callsite at this time
++ * @return {@code true} if we can link this callsite at this time
+ */
+ public abstract boolean canLink(final Object self, final CallSiteDescriptor desc, final LinkRequest request);
+
+@@ -131,7 +133,7 @@
+ *
+ * @param self receiver
+ *
+- * @return true if a guard is to be woven into the callsite
++ * @return {@code true} if a guard is to be woven into the callsite
+ */
+ public boolean needsGuard(final Object self) {
+ return true;
+@@ -139,13 +141,13 @@
+
+ /**
+ * Given a callsite, and optional arguments, do we need an extra guard
+- * for specialization to go through - this guard can be a function of
+- * the arguments too
++ * for specialization to go through? This guard can be a function of
++ * the arguments too.
+ *
+ * @param self receiver
+ * @param args arguments
+ *
+- * @return true if a guard is to be woven into the callsite
++ * @return {@code true} if a guard is to be woven into the callsite
+ */
+ public boolean needsGuard(final Object self, final Object... args) {
+ return true;
+@@ -169,9 +171,9 @@
+ * @param self receiver
+ * @param desc callsite descriptor
+ * @param request link request
+-
+- * @return true if we can link, false otherwise - that means we have to
+- * pick a non specialized target
++ *
++ * @return {@code true} if we can link, {@code false} otherwise - that
++ * means we have to pick a non specialized target
+ */
+ public boolean checkLinkable(final Object self, final CallSiteDescriptor desc, final LinkRequest request) {
+ // check the link guard, if it says we can link, go ahead
+@@ -180,11 +182,11 @@
+ }
+
+ /**
+- * name override for return value polymorphism, for example we can't have
++ * Name override for return value polymorphism, for example we can't have
+ * pop(V)I and pop(V)D in the same Java class, so they need to be named,
+- * e.g. popInt(V)I and popDouble(V)D for disambiguation, however, their
++ * e.g., popInt(V)I and popDouble(V)D for disambiguation, however, their
+ * names still need to resolve to "pop" to JavaScript so we can still
+- * specialize on return values and so that the linker can find them
++ * specialize on return values and so that the linker can find them.
+ *
+ * @return name, "" means no override, use the Java function name, e.g.
+ * "push"
+@@ -199,16 +201,18 @@
+ Class<?> linkLogic() default LinkLogic.Empty.class;
+
+ /**
+- * Is this a specialized constructor?
++ * @return whether this is a specialized constructor.
+ */
+ boolean isConstructor() default false;
+
+ /**
+- * Can this function throw UnwarrantedOptimismExceptions? This works just
+- * like the normal functions, but we need the function to be
++ * Can this function throw {@link UnwarrantedOptimismException}s? This works
++ * just like the normal functions, but we need the function to be
+ * immutable/non-state modifying, as we can't generate continuations for
+ * native code. Luckily a lot of the methods we want to specialize have this
+- * property
++ * property.
++ *
++ * @return whether this function can throw {@link UnwarrantedOptimismException}.
+ */
+ boolean isOptimistic() default false;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/parser/AbstractParser.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/parser/AbstractParser.java Wed Jul 01 21:54:30 2015 -0700
+@@ -459,6 +459,19 @@
+ if (kind == TokenKind.KEYWORD || kind == TokenKind.FUTURE || kind == TokenKind.FUTURESTRICT) {
+ return true;
+ }
++
++ // only literals allowed are null, false and true
++ if (kind == TokenKind.LITERAL) {
++ switch (type) {
++ case FALSE:
++ case NULL:
++ case TRUE:
++ return true;
++ default:
++ return false;
++ }
++ }
++
+ // Fake out identifier.
+ final long identToken = Token.recast(token, IDENT);
+ // Get IDENT.
+--- ./nashorn/src/jdk/nashorn/internal/parser/JSONParser.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/parser/JSONParser.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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,43 +25,69 @@
+
+ package jdk.nashorn.internal.parser;
+
+-import static jdk.nashorn.internal.parser.TokenType.COLON;
+-import static jdk.nashorn.internal.parser.TokenType.COMMARIGHT;
+-import static jdk.nashorn.internal.parser.TokenType.EOF;
+-import static jdk.nashorn.internal.parser.TokenType.ESCSTRING;
+-import static jdk.nashorn.internal.parser.TokenType.RBRACE;
+-import static jdk.nashorn.internal.parser.TokenType.RBRACKET;
+-import static jdk.nashorn.internal.parser.TokenType.STRING;
+ import java.util.ArrayList;
+ import java.util.List;
+-import jdk.nashorn.internal.ir.Expression;
+-import jdk.nashorn.internal.ir.LiteralNode;
+-import jdk.nashorn.internal.ir.Node;
+-import jdk.nashorn.internal.ir.ObjectNode;
+-import jdk.nashorn.internal.ir.PropertyNode;
+-import jdk.nashorn.internal.ir.UnaryNode;
++import jdk.nashorn.internal.codegen.ObjectClassGenerator;
++import jdk.nashorn.internal.objects.Global;
++import jdk.nashorn.internal.runtime.ECMAErrors;
+ import jdk.nashorn.internal.runtime.ErrorManager;
++import jdk.nashorn.internal.runtime.JSErrorType;
++import jdk.nashorn.internal.runtime.JSType;
++import jdk.nashorn.internal.runtime.ParserException;
++import jdk.nashorn.internal.runtime.Property;
++import jdk.nashorn.internal.runtime.PropertyMap;
++import jdk.nashorn.internal.runtime.ScriptObject;
+ import jdk.nashorn.internal.runtime.Source;
++import jdk.nashorn.internal.runtime.SpillProperty;
++import jdk.nashorn.internal.runtime.arrays.ArrayData;
++import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
++import jdk.nashorn.internal.scripts.JD;
++import jdk.nashorn.internal.scripts.JO;
++
++import static jdk.nashorn.internal.parser.TokenType.STRING;
+
+ /**
+- * Parses JSON text and returns the corresponding IR node. This is derived from the objectLiteral production of the main parser.
++ * Parses JSON text and returns the corresponding IR node. This is derived from
++ * the objectLiteral production of the main parser.
+ *
+ * See: 15.12.1.2 The JSON Syntactic Grammar
+ */
+-public class JSONParser extends AbstractParser {
++public class JSONParser {
++
++ final private String source;
++ final private Global global;
++ final private boolean dualFields;
++ final int length;
++ int pos = 0;
++
++ private static final int EOF = -1;
++
++ private static final String TRUE = "true";
++ private static final String FALSE = "false";
++ private static final String NULL = "null";
++
++ private static final int STATE_EMPTY = 0;
++ private static final int STATE_ELEMENT_PARSED = 1;
++ private static final int STATE_COMMA_PARSED = 2;
+
+ /**
+- * Constructor
+- * @param source the source
+- * @param errors the error manager
++ * Constructor.
++ *
++ * @param source the source
++ * @param global the global object
++ * @param dualFields whether the parser should regard dual field representation
+ */
+- public JSONParser(final Source source, final ErrorManager errors) {
+- super(source, errors, false, 0);
++ public JSONParser(final String source, final Global global, final boolean dualFields) {
++ this.source = source;
++ this.global = global;
++ this.length = source.length();
++ this.dualFields = dualFields;
+ }
+
+ /**
+- * Implementation of the Quote(value) operation as defined in the ECMA script spec
+- * It wraps a String value in double quotes and escapes characters within in
++ * Implementation of the Quote(value) operation as defined in the ECMAscript
++ * spec. It wraps a String value in double quotes and escapes characters
++ * within.
+ *
+ * @param value string to quote
+ *
+@@ -114,329 +140,413 @@
+ }
+
+ /**
+- * Public parsed method - start lexing a new token stream for
+- * a JSON script
++ * Public parse method. Parse a string into a JSON object.
+ *
+- * @return the JSON literal
++ * @return the parsed JSON Object
+ */
+- public Node parse() {
+- stream = new TokenStream();
+-
+- lexer = new Lexer(source, stream) {
+-
+- @Override
+- protected boolean skipComments() {
+- return false;
+- }
+-
+- @Override
+- protected boolean isStringDelimiter(final char ch) {
+- return ch == '\"';
+- }
+-
+- // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONWhiteSpace
+- @Override
+- protected boolean isWhitespace(final char ch) {
+- return Lexer.isJsonWhitespace(ch);
+- }
+-
+- @Override
+- protected boolean isEOL(final char ch) {
+- return Lexer.isJsonEOL(ch);
+- }
+-
+- // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONNumber
+- @Override
+- protected void scanNumber() {
+- // Record beginning of number.
+- final int startPosition = position;
+- // Assume value is a decimal.
+- TokenType valueType = TokenType.DECIMAL;
+-
+- // floating point can't start with a "." with no leading digit before
+- if (ch0 == '.') {
+- error(Lexer.message("json.invalid.number"), STRING, position, limit);
+- }
+-
+- // First digit of number.
+- final int digit = convertDigit(ch0, 10);
+-
+- // skip first digit
+- skip(1);
+-
+- if (digit != 0) {
+- // Skip over remaining digits.
+- while (convertDigit(ch0, 10) != -1) {
+- skip(1);
+- }
+- }
+-
+- if (ch0 == '.' || ch0 == 'E' || ch0 == 'e') {
+- // Must be a double.
+- if (ch0 == '.') {
+- // Skip period.
+- skip(1);
+-
+- boolean mantissa = false;
+- // Skip mantissa.
+- while (convertDigit(ch0, 10) != -1) {
+- mantissa = true;
+- skip(1);
+- }
+-
+- if (! mantissa) {
+- // no digit after "."
+- error(Lexer.message("json.invalid.number"), STRING, position, limit);
+- }
+- }
+-
+- // Detect exponent.
+- if (ch0 == 'E' || ch0 == 'e') {
+- // Skip E.
+- skip(1);
+- // Detect and skip exponent sign.
+- if (ch0 == '+' || ch0 == '-') {
+- skip(1);
+- }
+- boolean exponent = false;
+- // Skip exponent.
+- while (convertDigit(ch0, 10) != -1) {
+- exponent = true;
+- skip(1);
+- }
+-
+- if (! exponent) {
+- // no digit after "E"
+- error(Lexer.message("json.invalid.number"), STRING, position, limit);
+- }
+- }
+-
+- valueType = TokenType.FLOATING;
+- }
+-
+- // Add number token.
+- add(valueType, startPosition);
+- }
+-
+- // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONEscapeCharacter
+- @Override
+- protected boolean isEscapeCharacter(final char ch) {
+- switch (ch) {
+- case '"':
+- case '/':
+- case '\\':
+- case 'b':
+- case 'f':
+- case 'n':
+- case 'r':
+- case 't':
+- // could be unicode escape
+- case 'u':
+- return true;
+- default:
+- return false;
+- }
+- }
+- };
+-
+- k = -1;
+-
+- next();
+-
+- final Node resultNode = jsonLiteral();
+- expect(EOF);
+-
+- return resultNode;
++ public Object parse() {
++ final Object value = parseLiteral();
++ skipWhiteSpace();
++ if (pos < length) {
++ throw expectedError(pos, "eof", toString(peek()));
++ }
++ return value;
+ }
+
+- @SuppressWarnings("fallthrough")
+- private LiteralNode<?> getStringLiteral() {
+- final LiteralNode<?> literal = getLiteral();
+- final String str = (String)literal.getValue();
++ private Object parseLiteral() {
++ skipWhiteSpace();
+
+- for (int i = 0; i < str.length(); i++) {
+- final char ch = str.charAt(i);
+- switch (ch) {
++ final int c = peek();
++ if (c == EOF) {
++ throw expectedError(pos, "json literal", "eof");
++ }
++ switch (c) {
++ case '{':
++ return parseObject();
++ case '[':
++ return parseArray();
++ case '"':
++ return parseString();
++ case 'f':
++ return parseKeyword(FALSE, Boolean.FALSE);
++ case 't':
++ return parseKeyword(TRUE, Boolean.TRUE);
++ case 'n':
++ return parseKeyword(NULL, null);
++ default:
++ if (isDigit(c) || c == '-') {
++ return parseNumber();
++ } else if (c == '.') {
++ throw numberError(pos);
++ } else {
++ throw expectedError(pos, "json literal", toString(c));
++ }
++ }
++ }
++
++ private Object parseObject() {
++ PropertyMap propertyMap = dualFields ? JD.getInitialMap() : JO.getInitialMap();
++ ArrayData arrayData = ArrayData.EMPTY_ARRAY;
++ final ArrayList<Object> values = new ArrayList<>();
++ int state = STATE_EMPTY;
++
++ assert peek() == '{';
++ pos++;
++
++ while (pos < length) {
++ skipWhiteSpace();
++ final int c = peek();
++
++ switch (c) {
++ case '"':
++ if (state == STATE_ELEMENT_PARSED) {
++ throw expectedError(pos - 1, ", or }", toString(c));
++ }
++ final String id = parseString();
++ expectColon();
++ final Object value = parseLiteral();
++ final int index = ArrayIndex.getArrayIndex(id);
++ if (ArrayIndex.isValidArrayIndex(index)) {
++ arrayData = addArrayElement(arrayData, index, value);
++ } else {
++ propertyMap = addObjectProperty(propertyMap, values, id, value);
++ }
++ state = STATE_ELEMENT_PARSED;
++ break;
++ case ',':
++ if (state != STATE_ELEMENT_PARSED) {
++ throw error(AbstractParser.message("trailing.comma.in.json"), pos);
++ }
++ state = STATE_COMMA_PARSED;
++ pos++;
++ break;
++ case '}':
++ if (state == STATE_COMMA_PARSED) {
++ throw error(AbstractParser.message("trailing.comma.in.json"), pos);
++ }
++ pos++;
++ return createObject(propertyMap, values, arrayData);
+ default:
+- if (ch > 0x001f) {
+- break;
+- }
+- case '"':
+- case '\\':
+- throw error(AbstractParser.message("unexpected.token", str));
++ throw expectedError(pos, ", or }", toString(c));
++ }
++ }
++ throw expectedError(pos, ", or }", "eof");
++ }
++
++ private static ArrayData addArrayElement(final ArrayData arrayData, final int index, final Object value) {
++ final long oldLength = arrayData.length();
++ final long longIndex = ArrayIndex.toLongIndex(index);
++ ArrayData newArrayData = arrayData;
++ if (longIndex >= oldLength) {
++ newArrayData = newArrayData.ensure(longIndex);
++ if (longIndex > oldLength) {
++ newArrayData = newArrayData.delete(oldLength, longIndex - 1);
++ }
++ }
++ return newArrayData.set(index, value, false);
++ }
++
++ private PropertyMap addObjectProperty(final PropertyMap propertyMap, final List<Object> values,
++ final String id, final Object value) {
++ final Property oldProperty = propertyMap.findProperty(id);
++ final PropertyMap newMap;
++ final Class<?> type;
++ final int flags;
++ if (dualFields) {
++ type = getType(value);
++ flags = Property.DUAL_FIELDS;
++ } else {
++ type = Object.class;
++ flags = 0;
++ }
++
++ if (oldProperty != null) {
++ values.set(oldProperty.getSlot(), value);
++ newMap = propertyMap.replaceProperty(oldProperty, new SpillProperty(id, flags, oldProperty.getSlot(), type));;
++ } else {
++ values.add(value);
++ newMap = propertyMap.addProperty(new SpillProperty(id, flags, propertyMap.size(), type));
++ }
++
++ return newMap;
++ }
++
++ private Object createObject(final PropertyMap propertyMap, final List<Object> values, final ArrayData arrayData) {
++ final long[] primitiveSpill = dualFields ? new long[values.size()] : null;
++ final Object[] objectSpill = new Object[values.size()];
++
++ for (final Property property : propertyMap.getProperties()) {
++ if (!dualFields || property.getType() == Object.class) {
++ objectSpill[property.getSlot()] = values.get(property.getSlot());
++ } else {
++ primitiveSpill[property.getSlot()] = ObjectClassGenerator.pack((Number) values.get(property.getSlot()));
+ }
+ }
+
+- return literal;
++ final ScriptObject object = dualFields ?
++ new JD(propertyMap, primitiveSpill, objectSpill) : new JO(propertyMap, null, objectSpill);
++ object.setInitialProto(global.getObjectPrototype());
++ object.setArray(arrayData);
++ return object;
+ }
+
+- /**
+- * Parse a JSON literal from the token stream
+- * @return the JSON literal as a Node
+- */
+- private Expression jsonLiteral() {
+- final long literalToken = token;
+-
+- switch (type) {
+- case STRING:
+- return getStringLiteral();
+- case ESCSTRING:
+- case DECIMAL:
+- case FLOATING:
+- return getLiteral();
+- case FALSE:
+- next();
+- return LiteralNode.newInstance(literalToken, finish, false);
+- case TRUE:
+- next();
+- return LiteralNode.newInstance(literalToken, finish, true);
+- case NULL:
+- next();
+- return LiteralNode.newInstance(literalToken, finish);
+- case LBRACKET:
+- return arrayLiteral();
+- case LBRACE:
+- return objectLiteral();
+- /*
+- * A.8.1 JSON Lexical Grammar
+- *
+- * JSONNumber :: See 15.12.1.1
+- * -opt DecimalIntegerLiteral JSONFractionopt ExponentPartopt
+- */
+- case SUB:
+- next();
+-
+- final long realToken = token;
+- final Object value = getValue();
+-
+- if (value instanceof Number) {
+- next();
+- return new UnaryNode(literalToken, LiteralNode.newInstance(realToken, finish, (Number)value));
+- }
+-
+- throw error(AbstractParser.message("expected", "number", type.getNameOrType()));
+- default:
+- break;
++ private static Class<?> getType(final Object value) {
++ if (value instanceof Integer) {
++ return int.class;
++ } else if (value instanceof Long) {
++ return long.class;
++ } else if (value instanceof Double) {
++ return double.class;
++ } else {
++ return Object.class;
+ }
+-
+- throw error(AbstractParser.message("expected", "json literal", type.getNameOrType()));
+ }
+
+- /**
+- * Parse an array literal from the token stream
+- * @return the array literal as a Node
+- */
+- private LiteralNode<Expression[]> arrayLiteral() {
+- // Unlike JavaScript array literals, elison is not permitted in JSON.
++ private void expectColon() {
++ skipWhiteSpace();
++ final int n = next();
++ if (n != ':') {
++ throw expectedError(pos - 1, ":", toString(n));
++ }
++ }
+
+- // Capture LBRACKET token.
+- final long arrayToken = token;
+- // LBRACKET tested in caller.
+- next();
++ private Object parseArray() {
++ ArrayData arrayData = ArrayData.EMPTY_ARRAY;
++ int state = STATE_EMPTY;
+
+- LiteralNode<Expression[]> result = null;
+- // Prepare to accummulating elements.
+- final List<Expression> elements = new ArrayList<>();
++ assert peek() == '[';
++ pos++;
+
+-loop:
+- while (true) {
+- switch (type) {
+- case RBRACKET:
+- next();
+- result = LiteralNode.newInstance(arrayToken, finish, elements);
+- break loop;
++ while (pos < length) {
++ skipWhiteSpace();
++ final int c = peek();
+
+- case COMMARIGHT:
+- next();
+- // check for trailing comma - not allowed in JSON
+- if (type == RBRACKET) {
+- throw error(AbstractParser.message("trailing.comma.in.json", type.getNameOrType()));
++ switch (c) {
++ case ',':
++ if (state != STATE_ELEMENT_PARSED) {
++ throw error(AbstractParser.message("trailing.comma.in.json"), pos);
+ }
++ state = STATE_COMMA_PARSED;
++ pos++;
+ break;
+-
++ case ']':
++ if (state == STATE_COMMA_PARSED) {
++ throw error(AbstractParser.message("trailing.comma.in.json"), pos);
++ }
++ pos++;
++ return global.wrapAsObject(arrayData);
+ default:
+- // Add expression element.
+- elements.add(jsonLiteral());
+- // Comma between array elements is mandatory in JSON.
+- if (type != COMMARIGHT && type != RBRACKET) {
+- throw error(AbstractParser.message("expected", ", or ]", type.getNameOrType()));
++ if (state == STATE_ELEMENT_PARSED) {
++ throw expectedError(pos, ", or ]", toString(c));
+ }
++ final long index = arrayData.length();
++ arrayData = arrayData.ensure(index).set((int) index, parseLiteral(), true);
++ state = STATE_ELEMENT_PARSED;
+ break;
+ }
+ }
+
+- return result;
++ throw expectedError(pos, ", or ]", "eof");
+ }
+
+- /**
+- * Parse an object literal from the token stream
+- * @return the object literal as a Node
+- */
+- private ObjectNode objectLiteral() {
+- // Capture LBRACE token.
+- final long objectToken = token;
+- // LBRACE tested in caller.
+- next();
++ private String parseString() {
++ // String buffer is only instantiated if string contains escape sequences.
++ int start = ++pos;
++ StringBuilder sb = null;
+
+- // Prepare to accumulate elements.
+- final List<PropertyNode> elements = new ArrayList<>();
++ while (pos < length) {
++ final int c = next();
++ if (c <= 0x1f) {
++ // Characters < 0x1f are not allowed in JSON strings.
++ throw syntaxError(pos, "String contains control character");
+
+- // Create a block for the object literal.
+-loop:
+- while (true) {
+- switch (type) {
+- case RBRACE:
+- next();
+- break loop;
++ } else if (c == '\\') {
++ if (sb == null) {
++ sb = new StringBuilder(pos - start + 16);
++ }
++ sb.append(source, start, pos - 1);
++ sb.append(parseEscapeSequence());
++ start = pos;
+
+- case COMMARIGHT:
+- next();
+- // check for trailing comma - not allowed in JSON
+- if (type == RBRACE) {
+- throw error(AbstractParser.message("trailing.comma.in.json", type.getNameOrType()));
++ } else if (c == '"') {
++ if (sb != null) {
++ sb.append(source, start, pos - 1);
++ return sb.toString();
+ }
+- break;
+-
+- default:
+- // Get and add the next property.
+- final PropertyNode property = propertyAssignment();
+- elements.add(property);
+-
+- // Comma between property assigments is mandatory in JSON.
+- if (type != RBRACE && type != COMMARIGHT) {
+- throw error(AbstractParser.message("expected", ", or }", type.getNameOrType()));
+- }
+- break;
++ return source.substring(start, pos - 1);
+ }
+ }
+
+- // Construct new object literal.
+- return new ObjectNode(objectToken, finish, elements);
++ throw error(Lexer.message("missing.close.quote"), pos, length);
+ }
+
+- /**
+- * Parse a property assignment from the token stream
+- * @return the property assignment as a Node
+- */
+- private PropertyNode propertyAssignment() {
+- // Capture firstToken.
+- final long propertyToken = token;
+- LiteralNode<?> name = null;
++ private char parseEscapeSequence() {
++ final int c = next();
++ switch (c) {
++ case '"':
++ return '"';
++ case '\\':
++ return '\\';
++ case '/':
++ return '/';
++ case 'b':
++ return '\b';
++ case 'f':
++ return '\f';
++ case 'n':
++ return '\n';
++ case 'r':
++ return '\r';
++ case 't':
++ return '\t';
++ case 'u':
++ return parseUnicodeEscape();
++ default:
++ throw error(Lexer.message("invalid.escape.char"), pos - 1, length);
++ }
++ }
+
+- if (type == STRING) {
+- name = getStringLiteral();
+- } else if (type == ESCSTRING) {
+- name = getLiteral();
++ private char parseUnicodeEscape() {
++ return (char) (parseHexDigit() << 12 | parseHexDigit() << 8 | parseHexDigit() << 4 | parseHexDigit());
++ }
++
++ private int parseHexDigit() {
++ final int c = next();
++ if (c >= '0' && c <= '9') {
++ return c - '0';
++ } else if (c >= 'A' && c <= 'F') {
++ return c + 10 - 'A';
++ } else if (c >= 'a' && c <= 'f') {
++ return c + 10 - 'a';
++ }
++ throw error(Lexer.message("invalid.hex"), pos - 1, length);
++ }
++
++ private boolean isDigit(final int c) {
++ return c >= '0' && c <= '9';
++ }
++
++ private void skipDigits() {
++ while (pos < length) {
++ final int c = peek();
++ if (!isDigit(c)) {
++ break;
++ }
++ pos++;
++ }
++ }
++
++ private Number parseNumber() {
++ final int start = pos;
++ int c = next();
++
++ if (c == '-') {
++ c = next();
++ }
++ if (!isDigit(c)) {
++ throw numberError(start);
++ }
++ // no more digits allowed after 0
++ if (c != '0') {
++ skipDigits();
+ }
+
+- if (name != null) {
+- expect(COLON);
+- final Expression value = jsonLiteral();
+- return new PropertyNode(propertyToken, value.getFinish(), name, value, null, null);
++ // fraction
++ if (peek() == '.') {
++ pos++;
++ if (!isDigit(next())) {
++ throw numberError(pos - 1);
++ }
++ skipDigits();
+ }
+
+- // Raise an error.
+- throw error(AbstractParser.message("expected", "string", type.getNameOrType()));
++ // exponent
++ c = peek();
++ if (c == 'e' || c == 'E') {
++ pos++;
++ c = next();
++ if (c == '-' || c == '+') {
++ c = next();
++ }
++ if (!isDigit(c)) {
++ throw numberError(pos - 1);
++ }
++ skipDigits();
++ }
++
++ final double d = Double.parseDouble(source.substring(start, pos));
++ if (JSType.isRepresentableAsInt(d)) {
++ return (int) d;
++ } else if (JSType.isRepresentableAsLong(d)) {
++ return (long) d;
++ }
++ return d;
+ }
+
++ private Object parseKeyword(final String keyword, final Object value) {
++ if (!source.regionMatches(pos, keyword, 0, keyword.length())) {
++ throw expectedError(pos, "json literal", "ident");
++ }
++ pos += keyword.length();
++ return value;
++ }
++
++ private int peek() {
++ if (pos >= length) {
++ return -1;
++ }
++ return source.charAt(pos);
++ }
++
++ private int next() {
++ final int next = peek();
++ pos++;
++ return next;
++ }
++
++ private void skipWhiteSpace() {
++ while (pos < length) {
++ switch (peek()) {
++ case '\t':
++ case '\r':
++ case '\n':
++ case ' ':
++ pos++;
++ break;
++ default:
++ return;
++ }
++ }
++ }
++
++ private static String toString(final int c) {
++ return c == EOF ? "eof" : String.valueOf((char) c);
++ }
++
++ ParserException error(final String message, final int start, final int length) throws ParserException {
++ final long token = Token.toDesc(STRING, start, length);
++ final int pos = Token.descPosition(token);
++ final Source src = Source.sourceFor("<json>", source);
++ final int lineNum = src.getLine(pos);
++ final int columnNum = src.getColumn(pos);
++ final String formatted = ErrorManager.format(message, src, lineNum, columnNum, token);
++ return new ParserException(JSErrorType.SYNTAX_ERROR, formatted, src, lineNum, columnNum, token);
++ }
++
++ private ParserException error(final String message, final int start) {
++ return error(message, start, length);
++ }
++
++ private ParserException numberError(final int start) {
++ return error(Lexer.message("json.invalid.number"), start);
++ }
++
++ private ParserException expectedError(final int start, final String expected, final String found) {
++ return error(AbstractParser.message("expected", expected, found), start);
++ }
++
++ private ParserException syntaxError(final int start, final String reason) {
++ final String message = ECMAErrors.getMessage("syntax.error.invalid.json", reason);
++ return error(message, start);
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/parser/Lexer.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/parser/Lexer.java Wed Jul 01 21:54:30 2015 -0700
+@@ -93,9 +93,6 @@
+ private static final String SPACETAB = " \t"; // ASCII space and tab
+ private static final String LFCR = "\n\r"; // line feed and carriage return (ctrl-m)
+
+- private static final String JSON_WHITESPACE_EOL = LFCR;
+- private static final String JSON_WHITESPACE = SPACETAB + LFCR;
+-
+ private static final String JAVASCRIPT_WHITESPACE_EOL =
+ LFCR +
+ "\u2028" + // line separator
+@@ -385,24 +382,6 @@
+ }
+
+ /**
+- * Test whether a char is valid JSON whitespace
+- * @param ch a char
+- * @return true if valid JSON whitespace
+- */
+- public static boolean isJsonWhitespace(final char ch) {
+- return JSON_WHITESPACE.indexOf(ch) != -1;
+- }
+-
+- /**
+- * Test whether a char is valid JSON end of line
+- * @param ch a char
+- * @return true if valid JSON end of line
+- */
+- public static boolean isJsonEOL(final char ch) {
+- return JSON_WHITESPACE_EOL.indexOf(ch) != -1;
+- }
+-
+- /**
+ * Test if char is a string delimiter, e.g. '\' or '"'. Also scans exec
+ * strings ('`') in scripting mode.
+ * @param ch a char
+--- ./nashorn/src/jdk/nashorn/internal/parser/Parser.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/parser/Parser.java Wed Jul 01 21:54:30 2015 -0700
+@@ -607,7 +607,7 @@
+ * @return whether the ident can be used as L-value
+ */
+ private static boolean checkIdentLValue(final IdentNode ident) {
+- return Token.descType(ident.getToken()).getKind() != TokenKind.KEYWORD;
++ return ident.tokenType().getKind() != TokenKind.KEYWORD;
+ }
+
+ /**
+@@ -2635,8 +2635,12 @@
+ name = getIdent();
+ verifyStrictIdent(name, "function name");
+ } else if (isStatement) {
+- // Nashorn extension: anonymous function statements
+- if (env._no_syntax_extensions) {
++ // Nashorn extension: anonymous function statements.
++ // Do not allow anonymous function statement if extensions
++ // are now allowed. But if we are reparsing then anon function
++ // statement is possible - because it was used as function
++ // expression in surrounding code.
++ if (env._no_syntax_extensions && reparsedFunction == null) {
+ expect(IDENT);
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/parser/TokenType.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/parser/TokenType.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -222,9 +222,11 @@
+
+ /**
+ * Determines if the token has greater precedence than other.
++ *
+ * @param other Compare token.
+ * @param isLeft Is to the left of the other.
+- * @return True if greater precedence.
++ *
++ * @return {@code true} if greater precedence.
+ */
+ public boolean needsParens(final TokenType other, final boolean isLeft) {
+ return other.precedence != 0 &&
+@@ -234,16 +236,16 @@
+
+ /**
+ * Determines if the type is a valid operator.
+- * @param noIn TRUE if IN operator should be ignored.
+- * @return TRUE if valid operator.
++ *
++ * @param noIn {@code true} if IN operator should be ignored.
++ *
++ * @return {@code true} if valid operator.
+ */
+ public boolean isOperator(final boolean noIn) {
+ return kind == BINARY && (!noIn || this != IN) && precedence != 0;
+ }
+
+- /**
+- * Accessors.
+- */
++
+ public int getLength() {
+ assert name != null : "Token name not set";
+ return name.length();
+--- ./nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,7 +25,6 @@
+
+ package jdk.nashorn.internal.runtime;
+
+-import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
+ import static jdk.nashorn.internal.codegen.ObjectClassGenerator.PRIMITIVE_FIELD_TYPE;
+ import static jdk.nashorn.internal.codegen.ObjectClassGenerator.createGetter;
+ import static jdk.nashorn.internal.codegen.ObjectClassGenerator.createSetter;
+@@ -98,7 +97,7 @@
+ objectSetters[i] = MH.asType(MH.setter(LOOKUP, structure, fieldName, typeClass), Lookup.SET_OBJECT_TYPE);
+ }
+
+- if (!OBJECT_FIELDS_ONLY) {
++ if (!StructureLoader.isSingleFieldStructure(structure.getName())) {
+ for (int i = 0; i < fieldCount; i++) {
+ final String fieldNamePrimitive = getFieldName(i, PRIMITIVE_FIELD_TYPE);
+ final Class<?> typeClass = PRIMITIVE_FIELD_TYPE.getTypeClass();
+@@ -211,7 +210,7 @@
+ * @param setter the property setter or null if non writable, non configurable
+ */
+ private AccessorProperty(final String key, final int flags, final int slot, final MethodHandle getter, final MethodHandle setter) {
+- super(key, flags | IS_BUILTIN | (getter.type().returnType().isPrimitive() ? IS_NASGEN_PRIMITIVE : 0), slot);
++ super(key, flags | IS_BUILTIN | DUAL_FIELDS | (getter.type().returnType().isPrimitive() ? IS_NASGEN_PRIMITIVE : 0), slot);
+ assert !isSpill();
+
+ // we don't need to prep the setters these will never be invalidated as this is a nasgen
+@@ -221,18 +220,15 @@
+ final Class<?> setterType = setter == null ? null : setter.type().parameterType(1);
+
+ assert setterType == null || setterType == getterType;
+- if (OBJECT_FIELDS_ONLY) {
++
++ if (getterType == int.class || getterType == long.class) {
++ primitiveGetter = MH.asType(getter, Lookup.GET_PRIMITIVE_TYPE);
++ primitiveSetter = setter == null ? null : MH.asType(setter, Lookup.SET_PRIMITIVE_TYPE);
++ } else if (getterType == double.class) {
++ primitiveGetter = MH.asType(MH.filterReturnValue(getter, ObjectClassGenerator.PACK_DOUBLE), Lookup.GET_PRIMITIVE_TYPE);
++ primitiveSetter = setter == null ? null : MH.asType(MH.filterArguments(setter, 1, ObjectClassGenerator.UNPACK_DOUBLE), Lookup.SET_PRIMITIVE_TYPE);
++ } else {
+ primitiveGetter = primitiveSetter = null;
+- } else {
+- if (getterType == int.class || getterType == long.class) {
+- primitiveGetter = MH.asType(getter, Lookup.GET_PRIMITIVE_TYPE);
+- primitiveSetter = setter == null ? null : MH.asType(setter, Lookup.SET_PRIMITIVE_TYPE);
+- } else if (getterType == double.class) {
+- primitiveGetter = MH.asType(MH.filterReturnValue(getter, ObjectClassGenerator.PACK_DOUBLE), Lookup.GET_PRIMITIVE_TYPE);
+- primitiveSetter = setter == null ? null : MH.asType(MH.filterArguments(setter, 1, ObjectClassGenerator.UNPACK_DOUBLE), Lookup.SET_PRIMITIVE_TYPE);
+- } else {
+- primitiveGetter = primitiveSetter = null;
+- }
+ }
+
+ assert primitiveGetter == null || primitiveGetter.type() == Lookup.GET_PRIMITIVE_TYPE : primitiveGetter + "!=" + Lookup.GET_PRIMITIVE_TYPE;
+@@ -241,7 +237,7 @@
+ objectGetter = getter.type() != Lookup.GET_OBJECT_TYPE ? MH.asType(getter, Lookup.GET_OBJECT_TYPE) : getter;
+ objectSetter = setter != null && setter.type() != Lookup.SET_OBJECT_TYPE ? MH.asType(setter, Lookup.SET_OBJECT_TYPE) : setter;
+
+- setType(OBJECT_FIELDS_ONLY ? Object.class : getterType);
++ setType(getterType);
+ }
+
+ /**
+@@ -282,6 +278,9 @@
+ objectSetter = gs.objectSetters[slot];
+ primitiveSetter = gs.primitiveSetters[slot];
+ }
++
++ // Always use dual fields except for single field structures
++ assert hasDualFields() != StructureLoader.isSingleFieldStructure(structure.getName());
+ }
+
+ /**
+@@ -310,7 +309,7 @@
+ */
+ public AccessorProperty(final String key, final int flags, final Class<?> structure, final int slot, final Class<?> initialType) {
+ this(key, flags, structure, slot);
+- setType(OBJECT_FIELDS_ONLY ? Object.class : initialType);
++ setType(hasDualFields() ? initialType : Object.class);
+ }
+
+ /**
+@@ -347,7 +346,7 @@
+ * @param initialValue initial value
+ */
+ protected final void setInitialValue(final ScriptObject owner, final Object initialValue) {
+- setType(JSType.unboxedFieldType(initialValue));
++ setType(hasDualFields() ? JSType.unboxedFieldType(initialValue) : Object.class);
+ if (initialValue instanceof Integer) {
+ invokeSetter(owner, ((Integer)initialValue).intValue());
+ } else if (initialValue instanceof Long) {
+@@ -363,7 +362,7 @@
+ * Initialize the type of a property
+ */
+ protected final void initializeType() {
+- setType(OBJECT_FIELDS_ONLY ? Object.class : null);
++ setType(!hasDualFields() ? Object.class : null);
+ }
+
+ private void readObject(final ObjectInputStream s) throws IOException, ClassNotFoundException {
+@@ -670,7 +669,7 @@
+
+ @Override
+ public final boolean canChangeType() {
+- if (OBJECT_FIELDS_ONLY) {
++ if (!hasDualFields()) {
+ return false;
+ }
+ // Return true for currently undefined even if non-writable/configurable to allow initialization of ES6 CONST.
+--- ./nashorn/src/jdk/nashorn/internal/runtime/AllocationStrategy.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/AllocationStrategy.java Wed Jul 01 21:54:30 2015 -0700
+@@ -29,55 +29,57 @@
+ import java.io.Serializable;
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
++import jdk.nashorn.internal.codegen.Compiler;
+ import jdk.nashorn.internal.codegen.CompilerConstants;
+-import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor;
++import jdk.nashorn.internal.codegen.ObjectClassGenerator;
+
+ /**
+- * Encapsulates the allocation strategy for a function when used as a constructor. Basically the same as
+- * {@link AllocatorDescriptor}, but with an additionally cached resolved method handle. There is also a
+- * canonical default allocation strategy for functions that don't assign any "this" properties (vast majority
+- * of all functions), therefore saving some storage space in {@link RecompilableScriptFunctionData} that would
+- * otherwise be lost to identical tuples of (map, className, handle) fields.
++ * Encapsulates the allocation strategy for a function when used as a constructor.
+ */
+-final class AllocationStrategy implements Serializable {
++final public class AllocationStrategy implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
+
+- private static final AllocationStrategy DEFAULT_STRATEGY = new AllocationStrategy(new AllocatorDescriptor(0));
++ /** Number of fields in the allocated object */
++ private final int fieldCount;
+
+- /** Allocator map from allocator descriptor */
+- private final PropertyMap allocatorMap;
++ /** Whether to use dual field representation */
++ private final boolean dualFields;
+
+ /** Name of class where allocator function resides */
+- private final String allocatorClassName;
++ private transient String allocatorClassName;
+
+ /** lazily generated allocator */
+ private transient MethodHandle allocator;
+
+- private AllocationStrategy(final AllocatorDescriptor desc) {
+- this.allocatorMap = desc.getAllocatorMap();
+- // These classes get loaded, so an interned variant of their name is most likely around anyway.
+- this.allocatorClassName = desc.getAllocatorClassName().intern();
++ /**
++ * Construct an allocation strategy with the given map and class name.
++ * @param fieldCount number of fields in the allocated object
++ * @param dualFields whether to use dual field representation
++ */
++ public AllocationStrategy(final int fieldCount, final boolean dualFields) {
++ this.fieldCount = fieldCount;
++ this.dualFields = dualFields;
+ }
+
+- private boolean matches(final AllocatorDescriptor desc) {
+- return desc.getAllocatorMap().size() == allocatorMap.size() &&
+- desc.getAllocatorClassName().equals(allocatorClassName);
+- }
+-
+- static AllocationStrategy get(final AllocatorDescriptor desc) {
+- return DEFAULT_STRATEGY.matches(desc) ? DEFAULT_STRATEGY : new AllocationStrategy(desc);
++ private String getAllocatorClassName() {
++ if (allocatorClassName == null) {
++ // These classes get loaded, so an interned variant of their name is most likely around anyway.
++ allocatorClassName = Compiler.binaryName(ObjectClassGenerator.getClassName(fieldCount, dualFields)).intern();
++ }
++ return allocatorClassName;
+ }
+
+ PropertyMap getAllocatorMap() {
+- return allocatorMap;
++ // Create a new map for each function instance
++ return PropertyMap.newMap(null, getAllocatorClassName(), 0, fieldCount, 0);
+ }
+
+ ScriptObject allocate(final PropertyMap map) {
+ try {
+ if (allocator == null) {
+- allocator = MH.findStatic(LOOKUP, Context.forStructureClass(allocatorClassName),
++ allocator = MH.findStatic(LOOKUP, Context.forStructureClass(getAllocatorClassName()),
+ CompilerConstants.ALLOCATE.symbolName(), MH.type(ScriptObject.class, PropertyMap.class));
+ }
+ return (ScriptObject)allocator.invokeExact(map);
+@@ -88,17 +90,8 @@
+ }
+ }
+
+- private Object readResolve() {
+- if(allocatorMap.size() == DEFAULT_STRATEGY.allocatorMap.size() &&
+- allocatorClassName.equals(DEFAULT_STRATEGY.allocatorClassName)) {
+- return DEFAULT_STRATEGY;
+- }
+- return this;
+- }
+-
+ @Override
+ public String toString() {
+- return "AllocationStrategy[allocatorClassName=" + allocatorClassName + ", allocatorMap.size=" +
+- allocatorMap.size() + "]";
++ return "AllocationStrategy[fieldCount=" + fieldCount + "]";
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/CodeInstaller.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/CodeInstaller.java Wed Jul 01 21:54:30 2015 -0700
+@@ -86,7 +86,7 @@
+ * @param source the script source
+ * @param mainClassName the main class name
+ * @param classBytes map of class names to class bytes
+- * @param initializers compilation id -> FunctionInitializer map
++ * @param initializers compilation id -&gt; FunctionInitializer map
+ * @param constants constants array
+ * @param compilationId compilation id
+ */
+--- ./nashorn/src/jdk/nashorn/internal/runtime/CodeStore.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/CodeStore.java Wed Jul 01 21:54:30 2015 -0700
+@@ -189,7 +189,7 @@
+ * @param paramTypes parameter types
+ * @return a string representing the function
+ */
+- public static String getCacheKey(final int functionId, final Type[] paramTypes) {
++ public static String getCacheKey(final Object functionId, final Type[] paramTypes) {
+ final StringBuilder b = new StringBuilder().append(functionId);
+ if(paramTypes != null && paramTypes.length > 0) {
+ b.append('-');
+@@ -275,7 +275,7 @@
+
+ @Override
+ public StoredScript load(final Source source, final String functionKey) {
+- if (source.getLength() < minSize) {
++ if (belowThreshold(source)) {
+ return null;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/runtime/CompiledFunction.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/CompiledFunction.java Wed Jul 01 21:54:30 2015 -0700
+@@ -528,8 +528,9 @@
+
+ final int fnParamCountNoCallee = fnParamCount - thisThisIndex;
+ final int minParams = Math.min(csParamCount - 1, fnParamCountNoCallee); // callSiteType always has callee, so subtract 1
+- // We must match all incoming parameters, except "this". Starting from 1 to skip "this".
+- for(int i = 1; i < minParams; ++i) {
++ // We must match all incoming parameters, including "this". "this" will usually be Object, but there
++ // are exceptions, e.g. when calling functions with primitive "this" in strict mode or through call/apply.
++ for(int i = 0; i < minParams; ++i) {
+ final Type fnType = Type.typeFor(type.parameterType(i + thisThisIndex));
+ final Type csType = csIsVarArg ? Type.OBJECT : Type.typeFor(other.parameterType(i + 1));
+ if(!fnType.isEquivalentTo(csType)) {
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ConsString.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ConsString.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,6 +25,8 @@
+
+ package jdk.nashorn.internal.runtime;
+
++import static jdk.nashorn.internal.runtime.JSType.isString;
++
+ import java.util.ArrayDeque;
+ import java.util.Deque;
+
+@@ -52,8 +54,8 @@
+ * @param right right char sequence
+ */
+ public ConsString(final CharSequence left, final CharSequence right) {
+- assert left instanceof String || left instanceof ConsString;
+- assert right instanceof String || right instanceof ConsString;
++ assert isString(left);
++ assert isString(right);
+ this.left = left;
+ this.right = right;
+ length = left.length() + right.length();
+--- ./nashorn/src/jdk/nashorn/internal/runtime/Context.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/Context.java Wed Jul 01 21:54:30 2015 -0700
+@@ -60,11 +60,13 @@
+ import java.util.HashMap;
+ import java.util.LinkedHashMap;
+ import java.util.Map;
++import java.util.Objects;
+ import java.util.concurrent.atomic.AtomicLong;
+ import java.util.concurrent.atomic.AtomicReference;
+ import java.util.function.Consumer;
+ import java.util.function.Supplier;
+ import java.util.logging.Level;
++import javax.script.ScriptContext;
+ import javax.script.ScriptEngine;
+ import jdk.internal.org.objectweb.asm.ClassReader;
+ import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
+@@ -130,6 +132,23 @@
+ private static MethodType CREATE_PROGRAM_FUNCTION_TYPE = MethodType.methodType(ScriptFunction.class, ScriptObject.class);
+
+ /**
++ * Should scripts use only object slots for fields, or dual long/object slots? The default
++ * behaviour is to couple this to optimistic types, using dual representation if optimistic types are enabled
++ * and single field representation otherwise. This can be overridden by setting either the "nashorn.fields.objects"
++ * or "nashorn.fields.dual" system property.
++ */
++ private final FieldMode fieldMode;
++
++ private static enum FieldMode {
++ /** Value for automatic field representation depending on optimistic types setting */
++ AUTO,
++ /** Value for object field representation regardless of optimistic types setting */
++ OBJECTS,
++ /** Value for dual primitive/object field representation regardless of optimistic types setting */
++ DUAL
++ }
++
++ /**
+ * Keeps track of which builtin prototypes and properties have been relinked
+ * Currently we are conservative and associate the name of a builtin class with all
+ * its properties, so it's enough to invalidate a property to break all assumptions
+@@ -433,7 +452,7 @@
+ * @param appLoader application class loader
+ */
+ public Context(final Options options, final ErrorManager errors, final ClassLoader appLoader) {
+- this(options, errors, appLoader, (ClassFilter)null);
++ this(options, errors, appLoader, null);
+ }
+
+ /**
+@@ -521,6 +540,14 @@
+ getErr().println("nashorn full version " + Version.fullVersion());
+ }
+
++ if (Options.getBooleanProperty("nashorn.fields.dual")) {
++ fieldMode = FieldMode.DUAL;
++ } else if (Options.getBooleanProperty("nashorn.fields.objects")) {
++ fieldMode = FieldMode.OBJECTS;
++ } else {
++ fieldMode = FieldMode.AUTO;
++ }
++
+ initLoggers();
+ }
+
+@@ -575,6 +602,14 @@
+ }
+
+ /**
++ * Should scripts compiled by this context use dual field representation?
++ * @return true if using dual fields, false for object-only fields
++ */
++ public boolean useDualFields() {
++ return fieldMode == FieldMode.DUAL || (fieldMode == FieldMode.AUTO && env._optimistic_types);
++ }
++
++ /**
+ * Get the PropertyMap of the current global scope
+ * @return the property map of the current global scope
+ */
+@@ -633,12 +668,11 @@
+ * @param string Evaluated code as a String
+ * @param callThis "this" to be passed to the evaluated code
+ * @param location location of the eval call
+- * @param strict is this {@code eval} call from a strict mode code?
+ * @return the return value of the {@code eval}
+ */
+ public Object eval(final ScriptObject initialScope, final String string,
+- final Object callThis, final Object location, final boolean strict) {
+- return eval(initialScope, string, callThis, location, strict, false);
++ final Object callThis, final Object location) {
++ return eval(initialScope, string, callThis, location, false, false);
+ }
+
+ /**
+@@ -657,14 +691,16 @@
+ final Object callThis, final Object location, final boolean strict, final boolean evalCall) {
+ final String file = location == UNDEFINED || location == null ? "<eval>" : location.toString();
+ final Source source = sourceFor(file, string, evalCall);
+- final boolean directEval = location != UNDEFINED; // is this direct 'eval' call or indirectly invoked eval?
++ // is this direct 'eval' builtin call?
++ final boolean directEval = evalCall && (location != UNDEFINED);
+ final Global global = Context.getGlobal();
+ ScriptObject scope = initialScope;
+
+ // ECMA section 10.1.1 point 2 says eval code is strict if it begins
+ // with "use strict" directive or eval direct call itself is made
+ // from from strict mode code. We are passed with caller's strict mode.
+- boolean strictFlag = directEval && strict;
++ // Nashorn extension: any 'eval' is unconditionally strict when -strict is specified.
++ boolean strictFlag = strict || this._strict;
+
+ Class<?> clazz = null;
+ try {
+@@ -688,29 +724,26 @@
+ // In strict mode, eval does not instantiate variables and functions
+ // in the caller's environment. A new environment is created!
+ if (strictFlag) {
+- // Create a new scope object
+- final ScriptObject strictEvalScope = global.newObject();
+-
+- // bless it as a "scope"
+- strictEvalScope.setIsScope();
+-
+- // set given scope to be it's proto so that eval can still
+- // access caller environment vars in the new environment.
+- strictEvalScope.setProto(scope);
+- scope = strictEvalScope;
++ // Create a new scope object with given scope as its prototype
++ scope = newScope(scope);
+ }
+
+ final ScriptFunction func = getProgramFunction(clazz, scope);
+ Object evalThis;
+ if (directEval) {
+- evalThis = callThis instanceof ScriptObject || strictFlag ? callThis : global;
++ evalThis = (callThis != UNDEFINED && callThis != null) || strictFlag ? callThis : global;
+ } else {
+- evalThis = global;
++ // either indirect evalCall or non-eval (Function, engine.eval, ScriptObjectMirror.eval..)
++ evalThis = callThis;
+ }
+
+ return ScriptRuntime.apply(func, evalThis);
+ }
+
++ private static ScriptObject newScope(final ScriptObject callerScope) {
++ return new Scope(callerScope, PropertyMap.newMap(Scope.class));
++ }
++
+ private static Source loadInternal(final String srcStr, final String prefix, final String resourcePath) {
+ if (srcStr.startsWith(prefix)) {
+ final String resource = resourcePath + srcStr.substring(prefix.length());
+@@ -744,7 +777,7 @@
+ *
+ * @throws IOException if source cannot be found or loaded
+ */
+- public Object load(final ScriptObject scope, final Object from) throws IOException {
++ public Object load(final Object scope, final Object from) throws IOException {
+ final Object src = from instanceof ConsString ? from.toString() : from;
+ Source source = null;
+
+@@ -796,7 +829,42 @@
+ }
+
+ if (source != null) {
+- return evaluateSource(source, scope, scope);
++ if (scope instanceof ScriptObject && ((ScriptObject)scope).isScope()) {
++ final ScriptObject sobj = (ScriptObject)scope;
++ // passed object is a script object
++ // Global is the only user accessible scope ScriptObject
++ assert sobj.isGlobal() : "non-Global scope object!!";
++ return evaluateSource(source, sobj, sobj);
++ } else if (scope == null || scope == UNDEFINED) {
++ // undefined or null scope. Use current global instance.
++ final Global global = getGlobal();
++ return evaluateSource(source, global, global);
++ } else {
++ /*
++ * Arbitrary object passed for scope.
++ * Indirect load that is equivalent to:
++ *
++ * (function(scope, source) {
++ * with (scope) {
++ * eval(<script_from_source>);
++ * }
++ * })(scope, source);
++ */
++ final Global global = getGlobal();
++ // Create a new object. This is where all declarations
++ // (var, function) from the evaluated code go.
++ // make global to be its __proto__ so that global
++ // definitions are accessible to the evaluated code.
++ final ScriptObject evalScope = newScope(global);
++
++ // finally, make a WithObject around user supplied scope object
++ // so that it's properties are accessible as variables.
++ final ScriptObject withObj = ScriptRuntime.openWith(evalScope, scope);
++
++ // evaluate given source with 'withObj' as scope
++ // but use global object as "this".
++ return evaluateSource(source, withObj, global);
++ }
+ }
+
+ throw typeError("cant.load.script", ScriptRuntime.safeToString(from));
+@@ -904,7 +972,7 @@
+ * @throw SecurityException if not accessible
+ */
+ private static void checkPackageAccess(final SecurityManager sm, final String fullName) {
+- sm.getClass(); // null check
++ Objects.requireNonNull(sm);
+ final int index = fullName.lastIndexOf('.');
+ if (index != -1) {
+ final String pkgName = fullName.substring(0, index);
+@@ -1061,16 +1129,17 @@
+ *
+ * @param global the global
+ * @param engine the associated ScriptEngine instance, can be null
++ * @param ctxt the initial ScriptContext, can be null
+ * @return the initialized global scope object.
+ */
+- public Global initGlobal(final Global global, final ScriptEngine engine) {
++ public Global initGlobal(final Global global, final ScriptEngine engine, final ScriptContext ctxt) {
+ // Need only minimal global object, if we are just compiling.
+ if (!env._compile_only) {
+ final Global oldGlobal = Context.getGlobal();
+ try {
+ Context.setGlobal(global);
+ // initialize global scope with builtin global objects
+- global.initBuiltinObjects(engine);
++ global.initBuiltinObjects(engine, ctxt);
+ } finally {
+ Context.setGlobal(oldGlobal);
+ }
+@@ -1086,7 +1155,7 @@
+ * @return the initialized global scope object.
+ */
+ public Global initGlobal(final Global global) {
+- return initGlobal(global, null);
++ return initGlobal(global, null, null);
+ }
+
+ /**
+@@ -1194,16 +1263,21 @@
+
+ StoredScript storedScript = null;
+ FunctionNode functionNode = null;
+- // We only use the code store here if optimistic types are disabled. With optimistic types, initial compilation
+- // just creates a thin wrapper, and actual code is stored per function in RecompilableScriptFunctionData.
+- final boolean useCodeStore = codeStore != null && !env._parse_only && !env._optimistic_types;
+- final String cacheKey = useCodeStore ? CodeStore.getCacheKey(0, null) : null;
++ // Don't use code store if optimistic types is enabled but lazy compilation is not.
++ // This would store a full script compilation with many wrong optimistic assumptions that would
++ // do more harm than good on later runs with both optimistic types and lazy compilation enabled.
++ final boolean useCodeStore = codeStore != null && !env._parse_only && (!env._optimistic_types || env._lazy_compilation);
++ final String cacheKey = useCodeStore ? CodeStore.getCacheKey("script", null) : null;
+
+ if (useCodeStore) {
+ storedScript = codeStore.load(source, cacheKey);
+ }
+
+ if (storedScript == null) {
++ if (env._dest_dir != null) {
++ source.dump(env._dest_dir);
++ }
++
+ functionNode = new Parser(env, source, errMan, strict, getLogger(Parser.class)).parse();
+
+ if (errMan.hasErrors()) {
+@@ -1247,7 +1321,7 @@
+ compiler.persistClassInfo(cacheKey, compiledFunction);
+ } else {
+ Compiler.updateCompilationId(storedScript.getCompilationId());
+- script = install(storedScript, source, installer);
++ script = storedScript.installScript(source, installer);
+ }
+
+ cacheClass(source, script);
+@@ -1269,51 +1343,6 @@
+ }
+
+ /**
+- * Install a previously compiled class from the code cache.
+- *
+- * @param storedScript cached script containing class bytes and constants
+- * @return main script class
+- */
+- private static Class<?> install(final StoredScript storedScript, final Source source, final CodeInstaller<ScriptEnvironment> installer) {
+-
+- final Map<String, Class<?>> installedClasses = new HashMap<>();
+- final Map<String, byte[]> classBytes = storedScript.getClassBytes();
+- final Object[] constants = storedScript.getConstants();
+- final String mainClassName = storedScript.getMainClassName();
+- final byte[] mainClassBytes = classBytes.get(mainClassName);
+- final Class<?> mainClass = installer.install(mainClassName, mainClassBytes);
+- final Map<Integer, FunctionInitializer> initializers = storedScript.getInitializers();
+-
+- installedClasses.put(mainClassName, mainClass);
+-
+- for (final Map.Entry<String, byte[]> entry : classBytes.entrySet()) {
+- final String className = entry.getKey();
+- if (className.equals(mainClassName)) {
+- continue;
+- }
+- final byte[] code = entry.getValue();
+-
+- installedClasses.put(className, installer.install(className, code));
+- }
+-
+- installer.initialize(installedClasses.values(), source, constants);
+-
+- for (final Object constant : constants) {
+- if (constant instanceof RecompilableScriptFunctionData) {
+- final RecompilableScriptFunctionData data = (RecompilableScriptFunctionData) constant;
+- data.initTransients(source, installer);
+- final FunctionInitializer initializer = initializers.get(data.getFunctionNodeId());
+- if (initializer != null) {
+- initializer.setCode(installedClasses.get(initializer.getClassName()));
+- data.initializeCode(initializer);
+- }
+- }
+- }
+-
+- return mainClass;
+- }
+-
+- /**
+ * Cache for compiled script classes.
+ */
+ @SuppressWarnings("serial")
+--- ./nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java Wed Jul 01 21:54:30 2015 -0700
+@@ -156,7 +156,7 @@
+ final Context context = global.getContext();
+
+ try {
+- return context.eval(initialScope, string, callThis, ScriptRuntime.UNDEFINED, false);
++ return context.eval(initialScope, string, callThis, ScriptRuntime.UNDEFINED);
+ } catch (final Throwable ex) {
+ return returnException ? ex : null;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ErrorManager.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ErrorManager.java Wed Jul 01 21:54:30 2015 -0700
+@@ -113,7 +113,7 @@
+
+ // Pointer to column.
+ for (int i = 0; i < column; i++) {
+- if (sourceLine.charAt(i) == '\t') {
++ if (i < sourceLine.length() && sourceLine.charAt(i) == '\t') {
+ sb.append('\t');
+ } else {
+ sb.append(' ');
+--- ./nashorn/src/jdk/nashorn/internal/runtime/FunctionInitializer.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/FunctionInitializer.java Wed Jul 01 21:54:30 2015 -0700
+@@ -60,17 +60,6 @@
+ }
+
+ /**
+- * Copy constructor.
+- *
+- * @param init original initializer
+- */
+- FunctionInitializer(final FunctionInitializer init) {
+- this.className = init.getClassName();
+- this.methodType = init.getMethodType();
+- this.flags = init.getFlags();
+- }
+-
+- /**
+ * Constructor.
+ *
+ * @param functionNode the function node
+@@ -130,7 +119,7 @@
+ * Set the class implementing the function
+ * @param code the class
+ */
+- public void setCode(final Class<?> code) {
++ void setCode(final Class<?> code) {
+ // Make sure code has not been set and has expected class name
+ if (this.code != null) {
+ throw new IllegalStateException("code already set");
+--- ./nashorn/src/jdk/nashorn/internal/runtime/FunctionScope.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/FunctionScope.java Wed Jul 01 21:54:30 2015 -0700
+@@ -35,17 +35,12 @@
+ *
+ * The constructor of this class is responsible for any function prologue
+ * involving the scope.
+- *
+- * TODO see NASHORN-715.
+ */
+-public class FunctionScope extends ScriptObject implements Scope {
++public class FunctionScope extends Scope {
+
+ /** Area to store scope arguments. (public for access from scripts.) */
+ public final ScriptObject arguments;
+
+- /** Flag to indicate that a split method issued a return statement */
+- private int splitState = -1;
+-
+ /**
+ * Constructor
+ *
+@@ -56,7 +51,6 @@
+ public FunctionScope(final PropertyMap map, final ScriptObject callerScope, final ScriptObject arguments) {
+ super(callerScope, map);
+ this.arguments = arguments;
+- setIsScope();
+ }
+
+ /**
+@@ -68,7 +62,6 @@
+ public FunctionScope(final PropertyMap map, final ScriptObject callerScope) {
+ super(callerScope, map);
+ this.arguments = null;
+- setIsScope();
+ }
+
+ /**
+@@ -82,23 +75,4 @@
+ super(map, primitiveSpill, objectSpill);
+ this.arguments = null;
+ }
+-
+-
+- /**
+- * Get the current split state.
+- * @return current split state
+- */
+- @Override
+- public int getSplitState() {
+- return splitState;
+- }
+-
+- /**
+- * Set the current split state.
+- * @param state current split state
+- */
+- @Override
+- public void setSplitState(final int state) {
+- splitState = state;
+- }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/JSONFunctions.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/JSONFunctions.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,19 +25,11 @@
+
+ package jdk.nashorn.internal.runtime;
+
+-import static jdk.nashorn.internal.runtime.Source.sourceFor;
+-
+ import java.lang.invoke.MethodHandle;
+ import java.util.Iterator;
+ import java.util.concurrent.Callable;
+-import jdk.nashorn.internal.ir.LiteralNode;
+-import jdk.nashorn.internal.ir.Node;
+-import jdk.nashorn.internal.ir.ObjectNode;
+-import jdk.nashorn.internal.ir.PropertyNode;
+-import jdk.nashorn.internal.ir.UnaryNode;
+ import jdk.nashorn.internal.objects.Global;
+ import jdk.nashorn.internal.parser.JSONParser;
+-import jdk.nashorn.internal.parser.TokenType;
+ import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
+ import jdk.nashorn.internal.runtime.linker.Bootstrap;
+
+@@ -78,20 +70,19 @@
+ * @return Object representation of JSON text given
+ */
+ public static Object parse(final Object text, final Object reviver) {
+- final String str = JSType.toString(text);
+- final JSONParser parser = new JSONParser(sourceFor("<json>", str), new Context.ThrowErrorManager());
+-
+- Node node;
++ final String str = JSType.toString(text);
++ final Global global = Context.getGlobal();
++ final boolean dualFields = ((ScriptObject) global).useDualFields();
++ final JSONParser parser = new JSONParser(str, global, dualFields);
++ final Object value;
+
+ try {
+- node = parser.parse();
++ value = parser.parse();
+ } catch (final ParserException e) {
+ throw ECMAErrors.syntaxError(e, "invalid.json", e.getMessage());
+ }
+
+- final Global global = Context.getGlobal();
+- final Object unfiltered = convertNode(global, node);
+- return applyReviver(global, unfiltered, reviver);
++ return applyReviver(global, value, reviver);
+ }
+
+ // -- Internals only below this point
+@@ -137,61 +128,6 @@
+ }
+ }
+
+- // Converts IR node to runtime value
+- private static Object convertNode(final Global global, final Node node) {
+- if (node instanceof LiteralNode) {
+- // check for array literal
+- if (node.tokenType() == TokenType.ARRAY) {
+- assert node instanceof LiteralNode.ArrayLiteralNode;
+- final Node[] elements = ((LiteralNode.ArrayLiteralNode)node).getValue();
+-
+- // NOTE: We cannot use LiteralNode.isNumericArray() here as that
+- // method uses symbols of element nodes. Since we don't do lower
+- // pass, there won't be any symbols!
+- if (isNumericArray(elements)) {
+- final double[] values = new double[elements.length];
+- int index = 0;
+-
+- for (final Node elem : elements) {
+- values[index++] = JSType.toNumber(convertNode(global, elem));
+- }
+- return global.wrapAsObject(values);
+- }
+-
+- final Object[] values = new Object[elements.length];
+- int index = 0;
+-
+- for (final Node elem : elements) {
+- values[index++] = convertNode(global, elem);
+- }
+-
+- return global.wrapAsObject(values);
+- }
+-
+- return ((LiteralNode<?>)node).getValue();
+-
+- } else if (node instanceof ObjectNode) {
+- final ObjectNode objNode = (ObjectNode) node;
+- final ScriptObject object = global.newObject();
+-
+- for (final PropertyNode pNode: objNode.getElements()) {
+- final Node valueNode = pNode.getValue();
+-
+- final String name = pNode.getKeyName();
+- final Object value = convertNode(global, valueNode);
+- setPropertyValue(object, name, value);
+- }
+-
+- return object;
+- } else if (node instanceof UnaryNode) {
+- // UnaryNode used only to represent negative number JSON value
+- final UnaryNode unaryNode = (UnaryNode)node;
+- return -((LiteralNode<?>)unaryNode.getExpression()).getNumber();
+- } else {
+- return null;
+- }
+- }
+-
+ // add a new property if does not exist already, or else set old property
+ private static void setPropertyValue(final ScriptObject sobj, final String name, final Object value) {
+ final int index = ArrayIndex.getArrayIndex(name);
+@@ -207,14 +143,4 @@
+ }
+ }
+
+- // does the given IR node represent a numeric array?
+- private static boolean isNumericArray(final Node[] values) {
+- for (final Node node : values) {
+- if (node instanceof LiteralNode && ((LiteralNode<?>)node).getValue() instanceof Number) {
+- continue;
+- }
+- return false;
+- }
+- return true;
+- }
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/src/jdk/nashorn/internal/runtime/JSONListAdapter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,169 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.internal.runtime;
++
++import java.util.Collection;
++import java.util.List;
++import java.util.Set;
++import jdk.nashorn.api.scripting.AbstractJSObject;
++import jdk.nashorn.api.scripting.JSObject;
++import jdk.nashorn.api.scripting.ScriptObjectMirror;
++import jdk.nashorn.internal.objects.Global;
++
++/**
++ * A {@link ListAdapter} that also implements {@link JSObject}. Named {@code JSONListAdapter} as it is used as a
++ * {@code JSObject} implementing the {@link List} interface, which is the expected interface to be implemented by
++ * JSON-parsed arrays when they are handled in Java. We aren't implementing {@link JSObject} on {@link ListAdapter}
++ * directly since that'd have implications for other uses of list adapter (e.g. interferences of JSObject default
++ * value calculation vs. List's {@code toString()} etc.)
++ */
++public final class JSONListAdapter extends ListAdapter implements JSObject {
++ /**
++ * Creates a new JSON list adapter.
++ * @param obj the underlying object being exposed as a list.
++ * @param global the home global of the underlying object.
++ */
++ public JSONListAdapter(final JSObject obj, final Global global) {
++ super(obj, global);
++ }
++
++ /**
++ * Unwraps this adapter into its underlying non-JSObject representative.
++ * @param homeGlobal the home global for unwrapping
++ * @return either the unwrapped object or this if it should not be unwrapped in the specified global.
++ */
++ public Object unwrap(final Object homeGlobal) {
++ final Object unwrapped = ScriptObjectMirror.unwrap(obj, homeGlobal);
++ return unwrapped != obj ? unwrapped : this;
++ }
++
++ @Override
++ public Object call(final Object thiz, final Object... args) {
++ return obj.call(thiz, args);
++ }
++
++ @Override
++ public Object newObject(final Object... args) {
++ return obj.newObject(args);
++ }
++
++ @Override
++ public Object eval(final String s) {
++ return obj.eval(s);
++ }
++
++ @Override
++ public Object getMember(final String name) {
++ return obj.getMember(name);
++ }
++
++ @Override
++ public Object getSlot(final int index) {
++ return obj.getSlot(index);
++ }
++
++ @Override
++ public boolean hasMember(final String name) {
++ return obj.hasMember(name);
++ }
++
++ @Override
++ public boolean hasSlot(final int slot) {
++ return obj.hasSlot(slot);
++ }
++
++ @Override
++ public void removeMember(final String name) {
++ obj.removeMember(name);
++ }
++
++ @Override
++ public void setMember(final String name, final Object value) {
++ obj.setMember(name, value);
++ }
++
++ @Override
++ public void setSlot(final int index, final Object value) {
++ obj.setSlot(index, value);
++ }
++
++ @Override
++ public Set<String> keySet() {
++ return obj.keySet();
++ }
++
++ @Override
++ public Collection<Object> values() {
++ return obj.values();
++ }
++
++ @Override
++ public boolean isInstance(final Object instance) {
++ return obj.isInstance(instance);
++ }
++
++ @Override
++ public boolean isInstanceOf(final Object clazz) {
++ return obj.isInstanceOf(clazz);
++ }
++
++ @Override
++ public String getClassName() {
++ return obj.getClassName();
++ }
++
++ @Override
++ public boolean isFunction() {
++ return obj.isFunction();
++ }
++
++ @Override
++ public boolean isStrictFunction() {
++ return obj.isStrictFunction();
++ }
++
++ @Override
++ public boolean isArray() {
++ return obj.isArray();
++ }
++
++ @Override @Deprecated
++ public double toNumber() {
++ return obj.toNumber();
++ }
++
++ /**
++ * Implements this object's {@code [[DefaultValue]]} method by returning its wrapped object's {@code [[DefaultValue]]}.
++ *
++ * @param hint the type hint. Should be either {@code null}, {@code Number.class} or {@code String.class}.
++ * @return the wrapped object's default value.
++ * @throws UnsupportedOperationException if the conversion can't be performed. The engine will convert this
++ * exception into a JavaScript {@code TypeError}.
++ */
++ public Object getDefaultValue(final Class<?> hint) {
++ return AbstractJSObject.getDefaultValue(obj, hint);
++ }
++}
+--- ./nashorn/src/jdk/nashorn/internal/runtime/JSObjectListAdapter.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,56 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime;
+-
+-import jdk.nashorn.api.scripting.JSObject;
+-
+-/**
+- * A ListAdapter that can wraps a JSObject.
+- */
+-public final class JSObjectListAdapter extends ListAdapter {
+- /**
+- * Creates a new list wrapper for the specified JSObject.
+- * @param obj JSOcript the object to wrap
+- */
+- public JSObjectListAdapter(final JSObject obj) {
+- super(obj);
+- }
+-
+- @Override
+- public int size() {
+- return JSType.toInt32(((JSObject)obj).getMember("length"));
+- }
+-
+- @Override
+- protected Object getAt(final int index) {
+- return ((JSObject)obj).getSlot(index);
+- }
+-
+- @Override
+- protected void setAt(final int index, final Object element) {
+- ((JSObject)obj).setSlot(index, element);
+- }
+-}
+--- ./nashorn/src/jdk/nashorn/internal/runtime/JSType.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/JSType.java Wed Jul 01 21:54:30 2015 -0700
+@@ -26,17 +26,17 @@
+ package jdk.nashorn.internal.runtime;
+
+ import static jdk.nashorn.internal.codegen.CompilerConstants.staticCall;
+-import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
++
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+ import java.lang.reflect.Array;
+ import java.util.Arrays;
+ import java.util.Collections;
+-import java.util.Deque;
+ import java.util.List;
+ import jdk.internal.dynalink.beans.StaticClass;
++import jdk.nashorn.api.scripting.AbstractJSObject;
+ import jdk.nashorn.api.scripting.JSObject;
+ import jdk.nashorn.internal.codegen.CompilerConstants.Call;
+ import jdk.nashorn.internal.codegen.types.Type;
+@@ -180,10 +180,10 @@
+ /** Div exact wrapper for potentially integer division that turns into float point */
+ public static final Call DIV_EXACT_LONG = staticCall(JSTYPE_LOOKUP, JSType.class, "divExact", long.class, long.class, long.class, int.class);
+
+- /** Div zero wrapper for long division that handles (0/0) >>> 0 == 0 */
++ /** Div zero wrapper for long division that handles (0/0) &gt;&gt;&gt; 0 == 0 */
+ public static final Call DIV_ZERO_LONG = staticCall(JSTYPE_LOOKUP, JSType.class, "divZero", long.class, long.class, long.class);
+
+- /** Mod zero wrapper for long division that handles (0%0) >>> 0 == 0 */
++ /** Mod zero wrapper for long division that handles (0%0) &gt;&gt;&gt; 0 == 0 */
+ public static final Call REM_ZERO_LONG = staticCall(JSTYPE_LOOKUP, JSType.class, "remZero", long.class, long.class, long.class);
+
+ /** Mod exact wrapper for potentially integer remainders that turns into float point */
+@@ -201,16 +201,9 @@
+ /** Method handle to convert a JS Object to a Java array. */
+ public static final Call TO_JAVA_ARRAY = staticCall(JSTYPE_LOOKUP, JSType.class, "toJavaArray", Object.class, Object.class, Class.class);
+
+- /** Method handle to convert a JS Object to a Java List. */
+- public static final Call TO_JAVA_LIST = staticCall(JSTYPE_LOOKUP, JSType.class, "toJavaList", List.class, Object.class);
+-
+- /** Method handle to convert a JS Object to a Java deque. */
+- public static final Call TO_JAVA_DEQUE = staticCall(JSTYPE_LOOKUP, JSType.class, "toJavaDeque", Deque.class, Object.class);
+-
+ /** Method handle for void returns. */
+ public static final Call VOID_RETURN = staticCall(JSTYPE_LOOKUP, JSType.class, "voidReturn", void.class);
+
+-
+ /**
+ * The list of available accessor types in width order. This order is used for type guesses narrow{@literal ->} wide
+ * in the dual--fields world
+@@ -311,7 +304,7 @@
+ return JSType.BOOLEAN;
+ }
+
+- if (obj instanceof String || obj instanceof ConsString) {
++ if (isString(obj)) {
+ return JSType.STRING;
+ }
+
+@@ -349,7 +342,7 @@
+ return JSType.BOOLEAN;
+ }
+
+- if (obj instanceof String || obj instanceof ConsString) {
++ if (isString(obj)) {
+ return JSType.STRING;
+ }
+
+@@ -455,8 +448,7 @@
+ obj == ScriptRuntime.UNDEFINED ||
+ obj instanceof Boolean ||
+ obj instanceof Number ||
+- obj instanceof String ||
+- obj instanceof ConsString;
++ isString(obj);
+ }
+
+ /**
+@@ -480,17 +472,47 @@
+ * @return the primitive form of the object
+ */
+ public static Object toPrimitive(final Object obj, final Class<?> hint) {
+- return obj instanceof ScriptObject ? toPrimitive((ScriptObject)obj, hint) : obj;
++ if (obj instanceof ScriptObject) {
++ return toPrimitive((ScriptObject)obj, hint);
++ } else if (isPrimitive(obj)) {
++ return obj;
++ } else if (obj instanceof JSObject) {
++ return toPrimitive((JSObject)obj, hint);
++ } else if (obj instanceof StaticClass) {
++ final String name = ((StaticClass)obj).getRepresentedClass().getName();
++ return new StringBuilder(12 + name.length()).append("[JavaClass ").append(name).append(']').toString();
++ }
++ return obj.toString();
+ }
+
+ private static Object toPrimitive(final ScriptObject sobj, final Class<?> hint) {
+- final Object result = sobj.getDefaultValue(hint);
++ return requirePrimitive(sobj.getDefaultValue(hint));
++ }
+
++ private static Object requirePrimitive(final Object result) {
+ if (!isPrimitive(result)) {
+ throw typeError("bad.default.value", result.toString());
+ }
++ return result;
++ }
+
+- return result;
++ /**
++ * Primitive converter for a {@link JSObject} including type hint. Invokes
++ * {@link AbstractJSObject#getDefaultValue(JSObject, Class)} and translates any thrown
++ * {@link UnsupportedOperationException} to an ECMAScript {@code TypeError}.
++ * See ECMA 9.1 ToPrimitive
++ *
++ * @param jsobj a JSObject
++ * @param hint a type hint
++ *
++ * @return the primitive form of the JSObject
++ */
++ public static Object toPrimitive(final JSObject jsobj, final Class<?> hint) {
++ try {
++ return requirePrimitive(AbstractJSObject.getDefaultValue(jsobj, hint));
++ } catch (final UnsupportedOperationException e) {
++ throw new ECMAException(Context.getGlobal().newTypeError(e.getMessage()), e);
++ }
+ }
+
+ /**
+@@ -547,7 +569,7 @@
+ return num != 0 && !Double.isNaN(num);
+ }
+
+- if (obj instanceof String || obj instanceof ConsString) {
++ if (isString(obj)) {
+ return ((CharSequence)obj).length() > 0;
+ }
+
+@@ -598,6 +620,15 @@
+ }
+
+ /**
++ * Returns true if object represents a primitive JavaScript string value.
++ * @param obj the object
++ * @return true if the object represents a primitive JavaScript string value.
++ */
++ public static boolean isString(final Object obj) {
++ return obj instanceof String || obj instanceof ConsString;
++ }
++
++ /**
+ * JavaScript compliant conversion of integer to String
+ *
+ * @param num an integer
+@@ -723,6 +754,48 @@
+ return toNumberGeneric(obj);
+ }
+
++ /**
++ * Converts an object for a comparison with a number. Almost identical to {@link #toNumber(Object)} but
++ * converts {@code null} to {@code NaN} instead of zero, so it won't compare equal to zero.
++ *
++ * @param obj an object
++ *
++ * @return a number
++ */
++ public static double toNumberForEq(final Object obj) {
++ return obj == null ? Double.NaN : toNumber(obj);
++ }
++
++ /**
++ * Converts an object for strict comparison with a number. Returns {@code NaN} for any object that is not
++ * a {@link Number}, so only boxed numerics can compare strictly equal to numbers.
++ *
++ * @param obj an object
++ *
++ * @return a number
++ */
++ public static double toNumberForStrictEq(final Object obj) {
++ if (obj instanceof Double) {
++ return (Double)obj;
++ }
++ if (obj instanceof Number) {
++ return ((Number)obj).doubleValue();
++ }
++ return Double.NaN;
++ }
++
++
++ /**
++ * JavaScript compliant conversion of Boolean to number
++ * See ECMA 9.3 ToNumber
++ *
++ * @param b a boolean
++ *
++ * @return JS numeric value of the boolean: 1.0 or 0.0
++ */
++ public static double toNumber(final Boolean b) {
++ return b ? 1d : +0d;
++ }
+
+ /**
+ * JavaScript compliant conversion of Object to number
+@@ -853,11 +926,15 @@
+ if (start + 1 < end && f == '0' && Character.toLowerCase(str.charAt(start + 1)) == 'x') {
+ //decode hex string
+ value = parseRadix(str.toCharArray(), start + 2, end, 16);
++ } else if (f == 'I' && end - start == 8 && str.regionMatches(start, "Infinity", 0, 8)) {
++ return negative ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
+ } else {
+- // Fast (no NumberFormatException) path to NaN for non-numeric strings. We allow those starting with "I" or
+- // "N" to allow for parsing "NaN" and "Infinity" correctly.
+- if ((f < '0' || f > '9') && f != '.' && f != 'I' && f != 'N') {
+- return Double.NaN;
++ // Fast (no NumberFormatException) path to NaN for non-numeric strings.
++ for (int i = start; i < end; i++) {
++ f = str.charAt(i);
++ if ((f < '0' || f > '9') && f != '.' && f != 'e' && f != 'E' && f != '+' && f != '-') {
++ return Double.NaN;
++ }
+ }
+ try {
+ value = Double.parseDouble(str.substring(start, end));
+@@ -1268,24 +1345,6 @@
+ }
+
+ /**
+- * Converts a JavaScript object to a Java List. See {@link ListAdapter} for details.
+- * @param obj the object to convert. Can be any array-like object.
+- * @return a List that is live-backed by the JavaScript object.
+- */
+- public static List<?> toJavaList(final Object obj) {
+- return ListAdapter.create(obj);
+- }
+-
+- /**
+- * Converts a JavaScript object to a Java Deque. See {@link ListAdapter} for details.
+- * @param obj the object to convert. Can be any array-like object.
+- * @return a Deque that is live-backed by the JavaScript object.
+- */
+- public static Deque<?> toJavaDeque(final Object obj) {
+- return ListAdapter.create(obj);
+- }
+-
+- /**
+ * Check if an object is null or undefined
+ *
+ * @param obj object to check
+@@ -1301,6 +1360,10 @@
+ return (String)obj;
+ }
+
++ if (obj instanceof ConsString) {
++ return obj.toString();
++ }
++
+ if (obj instanceof Number) {
+ return toString(((Number)obj).doubleValue());
+ }
+@@ -1313,23 +1376,19 @@
+ return "null";
+ }
+
+- if (obj instanceof ScriptObject) {
+- if (safe) {
+- final ScriptObject sobj = (ScriptObject)obj;
+- final Global gobj = Context.getGlobal();
+- return gobj.isError(sobj) ?
+- ECMAException.safeToString(sobj) :
+- sobj.safeToString();
+- }
+-
+- return toString(toPrimitive(obj, String.class));
++ if (obj instanceof Boolean) {
++ return obj.toString();
+ }
+
+- if (obj instanceof StaticClass) {
+- return "[JavaClass " + ((StaticClass)obj).getRepresentedClass().getName() + "]";
++ if (safe && obj instanceof ScriptObject) {
++ final ScriptObject sobj = (ScriptObject)obj;
++ final Global gobj = Context.getGlobal();
++ return gobj.isError(sobj) ?
++ ECMAException.safeToString(sobj) :
++ sobj.safeToString();
+ }
+
+- return obj.toString();
++ return toString(toPrimitive(obj, String.class));
+ }
+
+ // trim from left for JS whitespaces.
+@@ -1822,18 +1881,18 @@
+ }
+
+ if (obj instanceof Boolean) {
+- return (Boolean)obj ? 1 : +0.0;
++ return toNumber((Boolean)obj);
+ }
+
+ if (obj instanceof ScriptObject) {
+ return toNumber((ScriptObject)obj);
+ }
+
+- if (obj instanceof JSObject) {
+- return ((JSObject)obj).toNumber();
++ if (obj instanceof Undefined) {
++ return Double.NaN;
+ }
+
+- return Double.NaN;
++ return toNumber(toPrimitive(obj, Number.class));
+ }
+
+ private static Object invoke(final MethodHandle mh, final Object arg) {
+@@ -1888,10 +1947,6 @@
+ * @return primive type or Object.class if not primitive
+ */
+ public static Class<?> unboxedFieldType(final Object o) {
+- if (OBJECT_FIELDS_ONLY) {
+- return Object.class;
+- }
+-
+ if (o == null) {
+ return Object.class;
+ } else if (o.getClass() == Integer.class) {
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,17 +25,19 @@
+
+ package jdk.nashorn.internal.runtime;
+
++import java.lang.invoke.MethodHandle;
+ import java.util.AbstractList;
+ import java.util.Deque;
+ import java.util.Iterator;
+ import java.util.ListIterator;
+ import java.util.NoSuchElementException;
++import java.util.Objects;
+ import java.util.RandomAccess;
+ import java.util.concurrent.Callable;
+ import jdk.nashorn.api.scripting.JSObject;
+ import jdk.nashorn.api.scripting.ScriptObjectMirror;
++import jdk.nashorn.internal.objects.Global;
+ import jdk.nashorn.internal.runtime.linker.Bootstrap;
+-import jdk.nashorn.internal.runtime.linker.InvokeByName;
+
+ /**
+ * An adapter that can wrap any ECMAScript Array-like object (that adheres to the array rules for the property
+@@ -50,82 +52,43 @@
+ * operations respectively, while {@link #addLast(Object)} and {@link #removeLast()} will translate to {@code push} and
+ * {@code pop}.
+ */
+-public abstract class ListAdapter extends AbstractList<Object> implements RandomAccess, Deque<Object> {
+- // These add to the back and front of the list
+- private static final Object PUSH = new Object();
+- private static InvokeByName getPUSH() {
+- return Context.getGlobal().getInvokeByName(PUSH,
+- new Callable<InvokeByName>() {
+- @Override
+- public InvokeByName call() {
+- return new InvokeByName("push", Object.class, void.class, Object.class);
+- }
+- });
+- }
++public class ListAdapter extends AbstractList<Object> implements RandomAccess, Deque<Object> {
++ // Invoker creator for methods that add to the start or end of the list: PUSH and UNSHIFT. Takes fn, this, and value, returns void.
++ private static final Callable<MethodHandle> ADD_INVOKER_CREATOR = invokerCreator(void.class, Object.class, JSObject.class, Object.class);
+
++ // PUSH adds to the start of the list
++ private static final Object PUSH = new Object();
++ // UNSHIFT adds to the end of the list
+ private static final Object UNSHIFT = new Object();
+- private static InvokeByName getUNSHIFT() {
+- return Context.getGlobal().getInvokeByName(UNSHIFT,
+- new Callable<InvokeByName>() {
+- @Override
+- public InvokeByName call() {
+- return new InvokeByName("unshift", Object.class, void.class, Object.class);
+- }
+- });
+- }
+
+- // These remove from the back and front of the list
++ // Invoker creator for methods that remove from the tail or head of the list: POP and SHIFT. Takes fn, this, returns Object.
++ private static final Callable<MethodHandle> REMOVE_INVOKER_CREATOR = invokerCreator(Object.class, Object.class, JSObject.class);
++
++ // POP removes from the start of the list
+ private static final Object POP = new Object();
+- private static InvokeByName getPOP() {
+- return Context.getGlobal().getInvokeByName(POP,
+- new Callable<InvokeByName>() {
+- @Override
+- public InvokeByName call() {
+- return new InvokeByName("pop", Object.class, Object.class);
+- }
+- });
+- }
++ // SHIFT removes from the end of the list
++ private static final Object SHIFT = new Object();
+
+- private static final Object SHIFT = new Object();
+- private static InvokeByName getSHIFT() {
+- return Context.getGlobal().getInvokeByName(SHIFT,
+- new Callable<InvokeByName>() {
+- @Override
+- public InvokeByName call() {
+- return new InvokeByName("shift", Object.class, Object.class);
+- }
+- });
+- }
++ // SPLICE can be used to add a value in the middle of the list.
++ private static final Object SPLICE_ADD = new Object();
++ private static final Callable<MethodHandle> SPLICE_ADD_INVOKER_CREATOR = invokerCreator(void.class, Object.class, JSObject.class, int.class, int.class, Object.class);
+
+- // These insert and remove in the middle of the list
+- private static final Object SPLICE_ADD = new Object();
+- private static InvokeByName getSPLICE_ADD() {
+- return Context.getGlobal().getInvokeByName(SPLICE_ADD,
+- new Callable<InvokeByName>() {
+- @Override
+- public InvokeByName call() {
+- return new InvokeByName("splice", Object.class, void.class, int.class, int.class, Object.class);
+- }
+- });
+- }
+-
++ // SPLICE can also be used to remove values from the middle of the list.
+ private static final Object SPLICE_REMOVE = new Object();
+- private static InvokeByName getSPLICE_REMOVE() {
+- return Context.getGlobal().getInvokeByName(SPLICE_REMOVE,
+- new Callable<InvokeByName>() {
+- @Override
+- public InvokeByName call() {
+- return new InvokeByName("splice", Object.class, void.class, int.class, int.class);
+- }
+- });
+- }
++ private static final Callable<MethodHandle> SPLICE_REMOVE_INVOKER_CREATOR = invokerCreator(void.class, Object.class, JSObject.class, int.class, int.class);
+
+ /** wrapped object */
+- protected final Object obj;
++ final JSObject obj;
++ private final Global global;
+
+ // allow subclasses only in this package
+- ListAdapter(final Object obj) {
++ ListAdapter(final JSObject obj, final Global global) {
++ if (global == null) {
++ throw new IllegalStateException(ECMAErrors.getMessage("list.adapter.null.global"));
++ }
++
+ this.obj = obj;
++ this.global = global;
+ }
+
+ /**
+@@ -135,14 +98,17 @@
+ * @return A ListAdapter wrapper object
+ */
+ public static ListAdapter create(final Object obj) {
++ final Global global = Context.getGlobal();
++ return new ListAdapter(getJSObject(obj, global), global);
++ }
++
++ private static JSObject getJSObject(final Object obj, final Global global) {
+ if (obj instanceof ScriptObject) {
+- final Object mirror = ScriptObjectMirror.wrap(obj, Context.getGlobal());
+- return new JSObjectListAdapter((JSObject)mirror);
++ return (JSObject)ScriptObjectMirror.wrap(obj, global);
+ } else if (obj instanceof JSObject) {
+- return new JSObjectListAdapter((JSObject)obj);
+- } else {
+- throw new IllegalArgumentException("ScriptObject or JSObject expected");
++ return (JSObject)obj;
+ }
++ throw new IllegalArgumentException("ScriptObject or JSObject expected");
+ }
+
+ @Override
+@@ -151,28 +117,18 @@
+ return getAt(index);
+ }
+
+- /**
+- * Get object at an index
+- * @param index index in list
+- * @return object
+- */
+- protected abstract Object getAt(final int index);
++ private Object getAt(final int index) {
++ return obj.getSlot(index);
++ }
+
+ @Override
+ public Object set(final int index, final Object element) {
+ checkRange(index);
+ final Object prevValue = getAt(index);
+- setAt(index, element);
++ obj.setSlot(index, element);
+ return prevValue;
+ }
+
+- /**
+- * Set object at an index
+- * @param index index in list
+- * @param element element
+- */
+- protected abstract void setAt(final int index, final Object element);
+-
+ private void checkRange(final int index) {
+ if(index < 0 || index >= size()) {
+ throw invalidIndex(index);
+@@ -180,6 +136,11 @@
+ }
+
+ @Override
++ public int size() {
++ return JSType.toInt32(obj.getMember("length"));
++ }
++
++ @Override
+ public final void push(final Object e) {
+ addFirst(e);
+ }
+@@ -193,10 +154,7 @@
+ @Override
+ public final void addFirst(final Object e) {
+ try {
+- final InvokeByName unshiftInvoker = getUNSHIFT();
+- final Object fn = unshiftInvoker.getGetter().invokeExact(obj);
+- checkFunction(fn, unshiftInvoker);
+- unshiftInvoker.getInvoker().invokeExact(fn, obj, e);
++ getDynamicInvoker(UNSHIFT, ADD_INVOKER_CREATOR).invokeExact(getFunction("unshift"), obj, e);
+ } catch(RuntimeException | Error ex) {
+ throw ex;
+ } catch(final Throwable t) {
+@@ -207,10 +165,7 @@
+ @Override
+ public final void addLast(final Object e) {
+ try {
+- final InvokeByName pushInvoker = getPUSH();
+- final Object fn = pushInvoker.getGetter().invokeExact(obj);
+- checkFunction(fn, pushInvoker);
+- pushInvoker.getInvoker().invokeExact(fn, obj, e);
++ getDynamicInvoker(PUSH, ADD_INVOKER_CREATOR).invokeExact(getFunction("push"), obj, e);
+ } catch(RuntimeException | Error ex) {
+ throw ex;
+ } catch(final Throwable t) {
+@@ -228,10 +183,7 @@
+ } else {
+ final int size = size();
+ if(index < size) {
+- final InvokeByName spliceAddInvoker = getSPLICE_ADD();
+- final Object fn = spliceAddInvoker.getGetter().invokeExact(obj);
+- checkFunction(fn, spliceAddInvoker);
+- spliceAddInvoker.getInvoker().invokeExact(fn, obj, index, 0, e);
++ getDynamicInvoker(SPLICE_ADD, SPLICE_ADD_INVOKER_CREATOR).invokeExact(obj.getMember("splice"), obj, index, 0, e);
+ } else if(index == size) {
+ addLast(e);
+ } else {
+@@ -244,10 +196,12 @@
+ throw new RuntimeException(t);
+ }
+ }
+- private static void checkFunction(final Object fn, final InvokeByName invoke) {
++ private Object getFunction(final String name) {
++ final Object fn = obj.getMember(name);
+ if(!(Bootstrap.isCallable(fn))) {
+- throw new UnsupportedOperationException("The script object doesn't have a function named " + invoke.getName());
++ throw new UnsupportedOperationException("The script object doesn't have a function named " + name);
+ }
++ return fn;
+ }
+
+ private static IndexOutOfBoundsException invalidIndex(final int index) {
+@@ -321,10 +275,7 @@
+
+ private Object invokeShift() {
+ try {
+- final InvokeByName shiftInvoker = getSHIFT();
+- final Object fn = shiftInvoker.getGetter().invokeExact(obj);
+- checkFunction(fn, shiftInvoker);
+- return shiftInvoker.getInvoker().invokeExact(fn, obj);
++ return getDynamicInvoker(SHIFT, REMOVE_INVOKER_CREATOR).invokeExact(getFunction("shift"), obj);
+ } catch(RuntimeException | Error ex) {
+ throw ex;
+ } catch(final Throwable t) {
+@@ -334,10 +285,7 @@
+
+ private Object invokePop() {
+ try {
+- final InvokeByName popInvoker = getPOP();
+- final Object fn = popInvoker.getGetter().invokeExact(obj);
+- checkFunction(fn, popInvoker);
+- return popInvoker.getInvoker().invokeExact(fn, obj);
++ return getDynamicInvoker(POP, REMOVE_INVOKER_CREATOR).invokeExact(getFunction("pop"), obj);
+ } catch(RuntimeException | Error ex) {
+ throw ex;
+ } catch(final Throwable t) {
+@@ -352,10 +300,7 @@
+
+ private void invokeSpliceRemove(final int fromIndex, final int count) {
+ try {
+- final InvokeByName spliceRemoveInvoker = getSPLICE_REMOVE();
+- final Object fn = spliceRemoveInvoker.getGetter().invokeExact(obj);
+- checkFunction(fn, spliceRemoveInvoker);
+- spliceRemoveInvoker.getInvoker().invokeExact(fn, obj, fromIndex, count);
++ getDynamicInvoker(SPLICE_REMOVE, SPLICE_REMOVE_INVOKER_CREATOR).invokeExact(getFunction("splice"), obj, fromIndex, count);
+ } catch(RuntimeException | Error ex) {
+ throw ex;
+ } catch(final Throwable t) {
+@@ -443,12 +388,24 @@
+
+ private static boolean removeOccurrence(final Object o, final Iterator<Object> it) {
+ while(it.hasNext()) {
+- final Object e = it.next();
+- if(o == null ? e == null : o.equals(e)) {
++ if(Objects.equals(o, it.next())) {
+ it.remove();
+ return true;
+ }
+ }
+ return false;
+ }
++
++ private static Callable<MethodHandle> invokerCreator(final Class<?> rtype, final Class<?>... ptypes) {
++ return new Callable<MethodHandle>() {
++ @Override
++ public MethodHandle call() {
++ return Bootstrap.createDynamicInvoker("dyn:call", rtype, ptypes);
++ }
++ };
++ }
++
++ private MethodHandle getDynamicInvoker(final Object key, final Callable<MethodHandle> creator) {
++ return global.getDynamicInvoker(key, creator);
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/Property.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/Property.java Wed Jul 01 21:54:30 2015 -0700
+@@ -96,6 +96,9 @@
+ /** Is this property an ES6 lexical binding? */
+ public static final int IS_LEXICAL_BINDING = 1 << 10;
+
++ /** Does this property support dual field representation? */
++ public static final int DUAL_FIELDS = 1 << 11;
++
+ /** Property key. */
+ private final String key;
+
+@@ -286,7 +289,7 @@
+ * @return true if parameter
+ */
+ public boolean isParameter() {
+- return (flags & IS_PARAMETER) == IS_PARAMETER;
++ return (flags & IS_PARAMETER) != 0;
+ }
+
+ /**
+@@ -294,7 +297,7 @@
+ * @return true if has arguments
+ */
+ public boolean hasArguments() {
+- return (flags & HAS_ARGUMENTS) == HAS_ARGUMENTS;
++ return (flags & HAS_ARGUMENTS) != 0;
+ }
+
+ /**
+@@ -316,7 +319,7 @@
+ * @return true if this is a bound property
+ */
+ public boolean isBound() {
+- return (flags & IS_BOUND) == IS_BOUND;
++ return (flags & IS_BOUND) != 0;
+ }
+
+ /**
+@@ -325,7 +328,7 @@
+ * @return true if this is a block-scoped variable
+ */
+ public boolean needsDeclaration() {
+- return (flags & NEEDS_DECLARATION) == NEEDS_DECLARATION;
++ return (flags & NEEDS_DECLARATION) != 0;
+ }
+
+ /**
+@@ -346,16 +349,6 @@
+ }
+
+ /**
+- * Check if a flag is set for a property
+- * @param property property
+- * @param flag flag to check
+- * @return true if flag is set
+- */
+- public static boolean checkFlag(final Property property, final int flag) {
+- return (property.getFlags() & flag) == flag;
+- }
+-
+- /**
+ * Get the flags for this property
+ * @return property flags
+ */
+@@ -364,16 +357,6 @@
+ }
+
+ /**
+- * Get the modify flags for this property. The modify flags are the ECMA 8.6.1
+- * flags that decide if the Property is writable, configurable and/or enumerable.
+- *
+- * @return modify flags for property
+- */
+- public int getModifyFlags() {
+- return flags & MODIFY_MASK;
+- }
+-
+- /**
+ * Remove property flags from the property. Properties are immutable here,
+ * so any property change that results in a smaller flag set results in the
+ * property being cloned. Use only the return value
+@@ -715,7 +698,7 @@
+ * @return whether this property is a function declaration or not.
+ */
+ public boolean isFunctionDeclaration() {
+- return (flags & IS_FUNCTION_DECLARATION) == IS_FUNCTION_DECLARATION;
++ return (flags & IS_FUNCTION_DECLARATION) != 0;
+ }
+
+ /**
+@@ -723,6 +706,14 @@
+ * @return true if this property represents a lexical binding.
+ */
+ public boolean isLexicalBinding() {
+- return (flags & IS_LEXICAL_BINDING) == IS_LEXICAL_BINDING;
++ return (flags & IS_LEXICAL_BINDING) != 0;
++ }
++
++ /**
++ * Does this property support dual fields for both primitive and object values?
++ * @return true if supports dual fields
++ */
++ public boolean hasDualFields() {
++ return (flags & DUAL_FIELDS) != 0;
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java Wed Jul 01 21:54:30 2015 -0700
+@@ -199,12 +199,21 @@
+ }
+
+ /**
++ * Return a sharable empty map for the given object class.
++ * @param clazz the base object class
++ * @return New empty {@link PropertyMap}.
++ */
++ public static PropertyMap newMap(final Class<? extends ScriptObject> clazz) {
++ return new PropertyMap(EMPTY_HASHMAP, clazz.getName(), 0, 0, 0, false);
++ }
++
++ /**
+ * Return a sharable empty map.
+ *
+ * @return New empty {@link PropertyMap}.
+ */
+ public static PropertyMap newMap() {
+- return new PropertyMap(EMPTY_HASHMAP, JO.class.getName(), 0, 0, 0, false);
++ return newMap(JO.class);
+ }
+
+ /**
+@@ -330,12 +339,15 @@
+ * Indicate that proto itself has changed in hierarchy somewhere.
+ */
+ synchronized void invalidateAllProtoGetSwitchPoints() {
+- if (protoGetSwitches != null && !protoGetSwitches.isEmpty()) {
+- if (Context.DEBUG) {
+- protoInvalidations += protoGetSwitches.size();
++ if (protoGetSwitches != null) {
++ final int size = protoGetSwitches.size();
++ if (size > 0) {
++ if (Context.DEBUG) {
++ protoInvalidations += size;
++ }
++ SwitchPoint.invalidateAll(protoGetSwitches.values().toArray(new SwitchPoint[size]));
++ protoGetSwitches.clear();
+ }
+- SwitchPoint.invalidateAll(protoGetSwitches.values().toArray(new SwitchPoint[protoGetSwitches.values().size()]));
+- protoGetSwitches.clear();
+ }
+ }
+
+@@ -375,7 +387,8 @@
+ }
+ }
+
+- // Update the free slots bitmap for a property that has been deleted and/or added.
++ // Update the free slots bitmap for a property that has been deleted and/or added. This method is not synchronized
++ // as it is always invoked on a newly created instance.
+ private void updateFreeSlots(final Property oldProperty, final Property newProperty) {
+ // Free slots bitset is possibly shared with parent map, so we must clone it before making modifications.
+ boolean freeSlotsCloned = false;
+@@ -425,7 +438,7 @@
+ *
+ * @return New {@link PropertyMap} with {@link Property} added.
+ */
+- public PropertyMap addProperty(final Property property) {
++ public synchronized PropertyMap addProperty(final Property property) {
+ if (listeners != null) {
+ listeners.propertyAdded(property);
+ }
+@@ -434,9 +447,9 @@
+ if (newMap == null) {
+ final PropertyHashMap newProperties = properties.immutableAdd(property);
+ newMap = new PropertyMap(this, newProperties);
+- addToHistory(property, newMap);
+ newMap.updateFlagsAndBoundaries(property);
+ newMap.updateFreeSlots(null, property);
++ addToHistory(property, newMap);
+ }
+
+ return newMap;
+@@ -449,7 +462,7 @@
+ *
+ * @return New {@link PropertyMap} with {@link Property} removed or {@code null} if not found.
+ */
+- public PropertyMap deleteProperty(final Property property) {
++ public synchronized PropertyMap deleteProperty(final Property property) {
+ if (listeners != null) {
+ listeners.propertyDeleted(property);
+ }
+@@ -486,7 +499,7 @@
+ *
+ * @return New {@link PropertyMap} with {@link Property} replaced.
+ */
+- PropertyMap replaceProperty(final Property oldProperty, final Property newProperty) {
++ public PropertyMap replaceProperty(final Property oldProperty, final Property newProperty) {
+ if (listeners != null) {
+ listeners.propertyModified(oldProperty, newProperty);
+ }
+@@ -881,8 +894,7 @@
+ * @param newProto New prototype object to replace oldProto.
+ * @return New {@link PropertyMap} with prototype changed.
+ */
+- public PropertyMap changeProto(final ScriptObject newProto) {
+-
++ public synchronized PropertyMap changeProto(final ScriptObject newProto) {
+ final PropertyMap nextMap = checkProtoHistory(newProto);
+ if (nextMap != null) {
+ return nextMap;
+--- ./nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -32,7 +32,6 @@
+ import java.lang.invoke.MethodType;
+ import java.util.Collection;
+ import java.util.Collections;
+-import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.Map;
+ import java.util.Set;
+@@ -43,7 +42,6 @@
+ import jdk.nashorn.internal.codegen.CompilerConstants;
+ import jdk.nashorn.internal.codegen.FunctionSignature;
+ import jdk.nashorn.internal.codegen.Namespace;
+-import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor;
+ import jdk.nashorn.internal.codegen.OptimisticTypesPersistence;
+ import jdk.nashorn.internal.codegen.TypeMap;
+ import jdk.nashorn.internal.codegen.types.Type;
+@@ -126,7 +124,7 @@
+ *
+ * @param functionNode functionNode that represents this function code
+ * @param installer installer for code regeneration versions of this function
+- * @param allocationDescriptor descriptor for the allocation behavior when this function is used as a constructor
++ * @param allocationStrategy strategy for the allocation behavior when this function is used as a constructor
+ * @param nestedFunctions nested function map
+ * @param externalScopeDepths external scope depths
+ * @param internalSymbols internal symbols to method, defined in its scope
+@@ -135,7 +133,7 @@
+ public RecompilableScriptFunctionData(
+ final FunctionNode functionNode,
+ final CodeInstaller<ScriptEnvironment> installer,
+- final AllocatorDescriptor allocationDescriptor,
++ final AllocationStrategy allocationStrategy,
+ final Map<Integer, RecompilableScriptFunctionData> nestedFunctions,
+ final Map<String, Integer> externalScopeDepths,
+ final Set<String> internalSymbols,
+@@ -153,7 +151,7 @@
+ this.endParserState = functionNode.getEndParserState();
+ this.token = tokenFor(functionNode);
+ this.installer = installer;
+- this.allocationStrategy = AllocationStrategy.get(allocationDescriptor);
++ this.allocationStrategy = allocationStrategy;
+ this.nestedFunctions = smallMap(nestedFunctions);
+ this.externalScopeDepths = smallMap(externalScopeDepths);
+ this.internalSymbols = smallSet(new HashSet<>(internalSymbols));
+@@ -344,6 +342,9 @@
+ if (functionNode.isVarArg()) {
+ flags |= IS_VARIABLE_ARITY;
+ }
++ if (functionNode.getKind() == FunctionNode.Kind.GETTER || functionNode.getKind() == FunctionNode.Kind.SETTER) {
++ flags |= IS_PROPERTY_ACCESSOR;
++ }
+ return flags;
+ }
+
+@@ -384,7 +385,7 @@
+ parser.setReparsedFunction(this);
+
+ final FunctionNode program = parser.parse(CompilerConstants.PROGRAM.symbolName(), descPosition,
+- Token.descLength(token), true);
++ Token.descLength(token), isPropertyAccessor());
+ // Parser generates a program AST even if we're recompiling a single function, so when we are only
+ // recompiling a single function, extract it from the program.
+ return (isProgram() ? program : extractFunctionFromScript(program)).setName(null, functionName);
+@@ -493,7 +494,7 @@
+ log.info("Parameter type specialization of '", functionName, "' signature: ", actualCallSiteType);
+ }
+
+- final boolean persistentCache = usePersistentCodeCache() && persist;
++ final boolean persistentCache = persist && usePersistentCodeCache();
+ String cacheKey = null;
+ if (persistentCache) {
+ final TypeMap typeMap = typeMap(actualCallSiteType);
+@@ -504,7 +505,7 @@
+
+ if (script != null) {
+ Compiler.updateCompilationId(script.getCompilationId());
+- return installStoredScript(script, newInstaller);
++ return script.installFunction(this, newInstaller);
+ }
+ }
+
+@@ -519,59 +520,8 @@
+ return new FunctionInitializer(compiledFn, compiler.getInvalidatedProgramPoints());
+ }
+
+- private static Map<String, Class<?>> installStoredScriptClasses(final StoredScript script, final CodeInstaller<ScriptEnvironment> installer) {
+- final Map<String, Class<?>> installedClasses = new HashMap<>();
+- final Map<String, byte[]> classBytes = script.getClassBytes();
+- final String mainClassName = script.getMainClassName();
+- final byte[] mainClassBytes = classBytes.get(mainClassName);
+-
+- final Class<?> mainClass = installer.install(mainClassName, mainClassBytes);
+-
+- installedClasses.put(mainClassName, mainClass);
+-
+- for (final Map.Entry<String, byte[]> entry : classBytes.entrySet()) {
+- final String className = entry.getKey();
+- final byte[] bytecode = entry.getValue();
+-
+- if (className.equals(mainClassName)) {
+- continue;
+- }
+-
+- installedClasses.put(className, installer.install(className, bytecode));
+- }
+- return installedClasses;
+- }
+-
+- /**
+- * Install this script using the given {@code installer}.
+- *
+- * @param script the compiled script
+- * @return the function initializer
+- */
+- private FunctionInitializer installStoredScript(final StoredScript script, final CodeInstaller<ScriptEnvironment> newInstaller) {
+- final Map<String, Class<?>> installedClasses = installStoredScriptClasses(script, newInstaller);
+-
+- final Map<Integer, FunctionInitializer> initializers = script.getInitializers();
+- assert initializers != null;
+- assert initializers.size() == 1;
+- final FunctionInitializer initializer = initializers.values().iterator().next();
+-
+- final Object[] constants = script.getConstants();
+- for (int i = 0; i < constants.length; i++) {
+- if (constants[i] instanceof RecompilableScriptFunctionData) {
+- // replace deserialized function data with the ones we already have
+- constants[i] = getScriptFunctionData(((RecompilableScriptFunctionData) constants[i]).getFunctionNodeId());
+- }
+- }
+-
+- newInstaller.initialize(installedClasses.values(), source, constants);
+- initializer.setCode(installedClasses.get(initializer.getClassName()));
+- return initializer;
+- }
+-
+ boolean usePersistentCodeCache() {
+- final ScriptEnvironment env = installer.getOwner();
+- return env._persistent_cache && env._optimistic_types;
++ return installer != null && installer.getOwner()._persistent_cache;
+ }
+
+ private MethodType explicitParams(final MethodType callSiteType) {
+@@ -646,13 +596,21 @@
+ * by the compiler internals in Nashorn and is public for implementation reasons only. Attempting to invoke it
+ * externally will result in an exception.
+ *
+- * @param initializer FunctionInitializer for this data
++ * @param functionNode FunctionNode for this data
+ */
+- public void initializeCode(final FunctionInitializer initializer) {
++ public void initializeCode(final FunctionNode functionNode) {
+ // Since the method is public, we double-check that we aren't invoked with an inappropriate compile unit.
+- if(!code.isEmpty()) {
++ if (!code.isEmpty() || functionNode.getId() != functionNodeId || !functionNode.getCompileUnit().isInitializing(this, functionNode)) {
+ throw new IllegalStateException(name);
+ }
++ addCode(lookup(functionNode), null, null, functionNode.getFlags());
++ }
++
++ /**
++ * Initializes this function with the given function code initializer.
++ * @param initializer function code initializer
++ */
++ void initializeCode(final FunctionInitializer initializer) {
+ addCode(lookup(initializer, true), null, null, initializer.getFlags());
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/runtime/Scope.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/Scope.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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,30 +25,105 @@
+
+ package jdk.nashorn.internal.runtime;
+
+-import static jdk.nashorn.internal.codegen.CompilerConstants.interfaceCallNoLookup;
++import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup;
+
+ import jdk.nashorn.internal.codegen.CompilerConstants;
+
+ /**
+- * Interface implemented by {@link ScriptObject}s that act as scope.
++ * A {@link ScriptObject} subclass for objects that act as scope.
+ */
+-public interface Scope {
++public class Scope extends ScriptObject {
++
++ /* This is used to store return state of split functions. */
++ private int splitState = -1;
++
++ /** This is updated only in debug mode - counts number of {@code ScriptObject} instances created that are scope */
++ private static int count;
+
+ /** Method handle that points to {@link Scope#getSplitState}. */
+- public static final CompilerConstants.Call GET_SPLIT_STATE = interfaceCallNoLookup(Scope.class, "getSplitState", int.class);
++ public static final CompilerConstants.Call GET_SPLIT_STATE = virtualCallNoLookup(Scope.class, "getSplitState", int.class);
++ /** Method handle that points to {@link Scope#setSplitState(int)}. */
++ public static final CompilerConstants.Call SET_SPLIT_STATE = virtualCallNoLookup(Scope.class, "setSplitState", void.class, int.class);
+
+- /** Method handle that points to {@link Scope#setSplitState(int)}. */
+- public static final CompilerConstants.Call SET_SPLIT_STATE = interfaceCallNoLookup(Scope.class, "setSplitState", void.class, int.class);
++ /**
++ * Constructor
++ *
++ * @param map initial property map
++ */
++ public Scope(final PropertyMap map) {
++ super(map);
++ if (Context.DEBUG) {
++ count++;
++ }
++ }
++
++ /**
++ * Constructor
++ *
++ * @param proto parent scope
++ * @param map initial property map
++ */
++ public Scope(final ScriptObject proto, final PropertyMap map) {
++ super(proto, map);
++ if (Context.DEBUG) {
++ count++;
++ }
++ }
++
++ /**
++ * Constructor
++ *
++ * @param map property map
++ * @param primitiveSpill primitive spill array
++ * @param objectSpill reference spill array
++ */
++ public Scope(final PropertyMap map, final long[] primitiveSpill, final Object[] objectSpill) {
++ super(map, primitiveSpill, objectSpill);
++ if (Context.DEBUG) {
++ count++;
++ }
++ }
++
++ @Override
++ public boolean isScope() {
++ return true;
++ }
++
++ @Override
++ boolean hasWithScope() {
++ for (ScriptObject obj = this; obj != null; obj = obj.getProto()) {
++ if (obj instanceof WithObject) {
++ return true;
++ }
++ }
++ return false;
++ }
+
+ /**
+ * Get the scope's split method state.
+- * @return the current state
++ *
++ * @return current split state
+ */
+- public int getSplitState();
++ public int getSplitState() {
++ return splitState;
++ }
+
+ /**
+ * Set the scope's split method state.
+- * @param state the new state.
++ *
++ * @param state current split state
+ */
+- public void setSplitState(int state);
++ public void setSplitState(final int state) {
++ splitState = state;
++ }
++
++ /**
++ * Get number of {@code Scope} instances created. If not running in debug
++ * mode this is always 0.
++ *
++ * @return number of scope ScriptObjects created
++ */
++ public static int getScopeCount() {
++ return count;
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java Wed Jul 01 21:54:30 2015 -0700
+@@ -73,7 +73,7 @@
+ /** Generate line number table in class files */
+ public final boolean _debug_lines;
+
+- /** Package to which generated class files are added */
++ /** Directory in which source files and generated class files are dumped */
+ public final String _dest_dir;
+
+ /** Display stack trace upon error, default is false */
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java Wed Jul 01 21:54:30 2015 -0700
+@@ -143,7 +143,6 @@
+
+ this.data = data;
+ this.scope = scope;
+- this.allocatorMap = data.getAllocatorMap();
+ }
+
+ @Override
+@@ -253,7 +252,7 @@
+
+ assert !isBoundFunction(); // allocate never invoked on bound functions
+
+- final ScriptObject object = data.allocate(allocatorMap);
++ final ScriptObject object = data.allocate(getAllocatorMap());
+
+ if (object != null) {
+ final Object prototype = getPrototype();
+@@ -269,6 +268,13 @@
+ return object;
+ }
+
++ private PropertyMap getAllocatorMap() {
++ if (allocatorMap == null) {
++ allocatorMap = data.getAllocatorMap();
++ }
++ return allocatorMap;
++ }
++
+ /**
+ * Return Object.prototype - used by "allocate"
+ * @return Object.prototype
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,6 +28,7 @@
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
+ import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
++
+ import java.io.IOException;
+ import java.io.ObjectInputStream;
+ import java.io.Serializable;
+@@ -79,24 +80,24 @@
+ private static final MethodHandle BIND_VAR_ARGS = findOwnMH("bindVarArgs", Object[].class, Object[].class, Object[].class);
+
+ /** Is this a strict mode function? */
+- public static final int IS_STRICT = 1 << 0;
++ public static final int IS_STRICT = 1 << 0;
+ /** Is this a built-in function? */
+- public static final int IS_BUILTIN = 1 << 1;
++ public static final int IS_BUILTIN = 1 << 1;
+ /** Is this a constructor function? */
+- public static final int IS_CONSTRUCTOR = 1 << 2;
++ public static final int IS_CONSTRUCTOR = 1 << 2;
+ /** Does this function expect a callee argument? */
+- public static final int NEEDS_CALLEE = 1 << 3;
++ public static final int NEEDS_CALLEE = 1 << 3;
+ /** Does this function make use of the this-object argument? */
+- public static final int USES_THIS = 1 << 4;
++ public static final int USES_THIS = 1 << 4;
+ /** Is this a variable arity function? */
+- public static final int IS_VARIABLE_ARITY = 1 << 5;
++ public static final int IS_VARIABLE_ARITY = 1 << 5;
++ /** Is this a object literal property getter or setter? */
++ public static final int IS_PROPERTY_ACCESSOR = 1 << 6;
+
+ /** Flag for strict or built-in functions */
+ public static final int IS_STRICT_OR_BUILTIN = IS_STRICT | IS_BUILTIN;
+ /** Flag for built-in constructors */
+ public static final int IS_BUILTIN_CONSTRUCTOR = IS_BUILTIN | IS_CONSTRUCTOR;
+- /** Flag for strict constructors */
+- public static final int IS_STRICT_CONSTRUCTOR = IS_STRICT | IS_CONSTRUCTOR;
+
+ private static final long serialVersionUID = 4252901245508769114L;
+
+@@ -121,6 +122,10 @@
+ return (flags & IS_VARIABLE_ARITY) != 0;
+ }
+
++ final boolean isPropertyAccessor() {
++ return (flags & IS_PROPERTY_ACCESSOR) != 0;
++ }
++
+ /**
+ * Used from e.g. Native*$Constructors as an explicit call. TODO - make arity immutable and final
+ * @param arity new arity
+@@ -456,8 +461,7 @@
+ }
+
+ static boolean isPrimitiveThis(final Object obj) {
+- return obj instanceof String || obj instanceof ConsString ||
+- obj instanceof Number || obj instanceof Boolean;
++ return JSType.isString(obj) || obj instanceof Number || obj instanceof Boolean;
+ }
+
+ /**
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java Wed Jul 01 21:54:30 2015 -0700
+@@ -26,6 +26,7 @@
+ package jdk.nashorn.internal.runtime;
+
+ import java.security.CodeSource;
++import java.util.Objects;
+
+ /**
+ * Responsible for loading script generated classes.
+@@ -69,8 +70,6 @@
+ * @return Installed class.
+ */
+ synchronized Class<?> installClass(final String name, final byte[] data, final CodeSource cs) {
+- // null check
+- cs.getClass();
+- return defineClass(name, data, 0, data.length, cs);
++ return defineClass(name, data, 0, data.length, Objects.requireNonNull(cs));
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,7 +28,6 @@
+ import static jdk.nashorn.internal.codegen.CompilerConstants.staticCallNoLookup;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCall;
+ import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup;
+-import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.referenceError;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
+@@ -110,20 +109,17 @@
+ /** Search fall back routine name for "no such property" */
+ public static final String NO_SUCH_PROPERTY_NAME = "__noSuchProperty__";
+
+- /** Per ScriptObject flag - is this a scope object? */
+- public static final int IS_SCOPE = 1 << 0;
+-
+ /** Per ScriptObject flag - is this an array object? */
+- public static final int IS_ARRAY = 1 << 1;
++ public static final int IS_ARRAY = 1 << 0;
+
+ /** Per ScriptObject flag - is this an arguments object? */
+- public static final int IS_ARGUMENTS = 1 << 2;
++ public static final int IS_ARGUMENTS = 1 << 1;
+
+ /** Is length property not-writable? */
+- public static final int IS_LENGTH_NOT_WRITABLE = 1 << 3;
++ public static final int IS_LENGTH_NOT_WRITABLE = 1 << 2;
+
+ /** Is this a builtin object? */
+- public static final int IS_BUILTIN = 1 << 4;
++ public static final int IS_BUILTIN = 1 << 3;
+
+ /**
+ * Spill growth rate - by how many elements does {@link ScriptObject#primitiveSpill} and
+@@ -146,12 +142,6 @@
+ /** Area for reference properties added to object after instantiation, see {@link AccessorProperty} */
+ protected Object[] objectSpill;
+
+- /**
+- * Number of elements in the spill. This may be less than the spill array lengths, if not all of
+- * the allocated memory is in use
+- */
+- private int spillLength;
+-
+ /** Indexed array data. */
+ private ArrayData arrayData;
+
+@@ -171,12 +161,6 @@
+ /** Method handle for getting the array data */
+ public static final Call GET_ARRAY = virtualCall(MethodHandles.lookup(), ScriptObject.class, "getArray", ArrayData.class);
+
+- /** Method handle for getting the property map - debugging purposes */
+- public static final Call GET_MAP = virtualCall(MethodHandles.lookup(), ScriptObject.class, "getMap", PropertyMap.class);
+-
+- /** Method handle for setting the array data */
+- public static final Call SET_ARRAY = virtualCall(MethodHandles.lookup(), ScriptObject.class, "setArray", void.class, ArrayData.class);
+-
+ /** Method handle for getting a function argument at a given index. Used from MapCreator */
+ public static final Call GET_ARGUMENT = virtualCall(MethodHandles.lookup(), ScriptObject.class, "getArgument", Object.class, int.class);
+
+@@ -259,8 +243,7 @@
+ this(map);
+ this.primitiveSpill = primitiveSpill;
+ this.objectSpill = objectSpill;
+- assert primitiveSpill.length == objectSpill.length : " primitive spill pool size is not the same length as object spill pool size";
+- this.spillLength = spillAllocationLength(primitiveSpill.length);
++ assert primitiveSpill == null || primitiveSpill.length == objectSpill.length : " primitive spill pool size is not the same length as object spill pool size";
+ }
+
+ /**
+@@ -410,14 +393,6 @@
+ }
+
+ /**
+- * ECMA 8.10.3 IsGenericDescriptor ( Desc )
+- * @return true if this has a descriptor describing an {@link AccessorPropertyDescriptor} or {@link DataPropertyDescriptor}
+- */
+- public final boolean isGenericDescriptor() {
+- return isAccessorDescriptor() || isDataDescriptor();
+- }
+-
+- /**
+ * ECMA 8.10.5 ToPropertyDescriptor ( Obj )
+ *
+ * @return property descriptor
+@@ -722,8 +697,12 @@
+ public void defineOwnProperty(final int index, final Object value) {
+ assert isValidArrayIndex(index) : "invalid array index";
+ final long longIndex = ArrayIndex.toLongIndex(index);
+- doesNotHaveEnsureDelete(longIndex, getArray().length(), false);
+- setArray(getArray().ensure(longIndex).set(index,value, false));
++ final long oldLength = getArray().length();
++ if (longIndex >= oldLength) {
++ setArray(getArray().ensure(longIndex));
++ doesNotHaveEnsureDelete(longIndex, oldLength, false);
++ }
++ setArray(getArray().set(index, value, false));
+ }
+
+ private void checkIntegerKey(final String key) {
+@@ -808,7 +787,7 @@
+ *
+ * @return FindPropertyData or null if not found.
+ */
+- FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
++ protected FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
+
+ final PropertyMap selfMap = getMap();
+ final Property property = selfMap.findProperty(key);
+@@ -972,10 +951,10 @@
+ * @param setter setter for {@link UserAccessorProperty}, null if not present or N/A
+ */
+ protected final void initUserAccessors(final String key, final int propertyFlags, final ScriptFunction getter, final ScriptFunction setter) {
+- final int slot = spillLength;
+- ensureSpillSize(spillLength); //arguments=slot0, caller=slot0
++ final PropertyMap oldMap = getMap();
++ final int slot = oldMap.getFreeSpillSlot();
++ ensureSpillSize(slot);
+ objectSpill[slot] = new UserAccessorProperty.Accessors(getter, setter);
+- final PropertyMap oldMap = getMap();
+ Property newProperty;
+ PropertyMap newMap;
+ do {
+@@ -1002,19 +981,12 @@
+ final int slot = uc.getSlot();
+
+ assert uc.getLocalType() == Object.class;
+- if (slot >= spillLength) {
+- uc.setAccessors(this, getMap(), new UserAccessorProperty.Accessors(getter, setter));
+- } else {
+- final UserAccessorProperty.Accessors gs = uc.getAccessors(this); //this crashes
+- if (gs == null) {
+- uc.setAccessors(this, getMap(), new UserAccessorProperty.Accessors(getter, setter));
+- } else {
+- //reuse existing getter setter for speed
+- gs.set(getter, setter);
+- if (uc.getFlags() == propertyFlags) {
+- return oldProperty;
+- }
+- }
++ final UserAccessorProperty.Accessors gs = uc.getAccessors(this); //this crashes
++ assert gs != null;
++ //reuse existing getter setter for speed
++ gs.set(getter, setter);
++ if (uc.getFlags() == propertyFlags) {
++ return oldProperty;
+ }
+ newProperty = new UserAccessorProperty(uc.getKey(), propertyFlags, slot);
+ } else {
+@@ -1647,23 +1619,12 @@
+ return getMap().isFrozen();
+ }
+
+-
+- /**
+- * Flag this ScriptObject as scope
+- */
+- public final void setIsScope() {
+- if (Context.DEBUG) {
+- scopeCount++;
+- }
+- flags |= IS_SCOPE;
+- }
+-
+ /**
+ * Check whether this ScriptObject is scope
+ * @return true if scope
+ */
+- public final boolean isScope() {
+- return (flags & IS_SCOPE) != 0;
++ public boolean isScope() {
++ return false;
+ }
+
+ /**
+@@ -1938,14 +1899,7 @@
+ * Test whether this object contains in its prototype chain or is itself a with-object.
+ * @return true if a with-object was found
+ */
+- final boolean hasWithScope() {
+- if (isScope()) {
+- for (ScriptObject obj = this; obj != null; obj = obj.getProto()) {
+- if (obj instanceof WithObject) {
+- return true;
+- }
+- }
+- }
++ boolean hasWithScope() {
+ return false;
+ }
+
+@@ -2049,8 +2003,6 @@
+ protoSwitchPoint = null;
+ }
+
+- assert OBJECT_FIELDS_ONLY || guard != null : "we always need a map guard here";
+-
+ final GuardedInvocation inv = new GuardedInvocation(mh, guard, protoSwitchPoint, exception);
+ return inv.addSwitchPoint(findBuiltinSwitchPoint(name));
+ }
+@@ -2527,13 +2479,14 @@
+
+ /**
+ * Add a spill property for the given key.
+- * @param key Property key.
+- * @param propertyFlags Property flags.
++ * @param key Property key.
++ * @param flags Property flags.
+ * @return Added property.
+ */
+- private Property addSpillProperty(final String key, final int propertyFlags, final Object value, final boolean hasInitialValue) {
++ private Property addSpillProperty(final String key, final int flags, final Object value, final boolean hasInitialValue) {
+ final PropertyMap propertyMap = getMap();
+ final int fieldSlot = propertyMap.getFreeFieldSlot();
++ final int propertyFlags = flags | (useDualFields() ? Property.DUAL_FIELDS : 0);
+
+ Property property;
+ if (fieldSlot > -1) {
+@@ -2558,7 +2511,7 @@
+ * @return Setter method handle.
+ */
+ MethodHandle addSpill(final Class<?> type, final String key) {
+- return addSpillProperty(key, 0, null, false).getSetter(OBJECT_FIELDS_ONLY ? Object.class : type, getMap());
++ return addSpillProperty(key, 0, null, false).getSetter(type, getMap());
+ }
+
+ /**
+@@ -2600,7 +2553,7 @@
+ final int callCount = callType.parameterCount();
+
+ final boolean isCalleeVarArg = parameterCount > 0 && methodType.parameterType(parameterCount - 1).isArray();
+- final boolean isCallerVarArg = callerVarArg != null ? callerVarArg.booleanValue() : callCount > 0 &&
++ final boolean isCallerVarArg = callerVarArg != null ? callerVarArg : callCount > 0 &&
+ callType.parameterType(callCount - 1).isArray();
+
+ if (isCalleeVarArg) {
+@@ -2645,9 +2598,9 @@
+ final int spreadArgs = mh.type().parameterCount() - callSiteParamCount + 1;
+ return MH.filterArguments(
+ MH.asSpreader(
+- mh,
+- Object[].class,
+- spreadArgs),
++ mh,
++ Object[].class,
++ spreadArgs),
+ callSiteParamCount - 1,
+ MH.insertArguments(
+ TRUNCATINGFILTER,
+@@ -3735,24 +3688,32 @@
+ return uc;
+ }
+
++ /**
++ * Returns {@code true} if properties for this object should use dual field mode, {@code false} otherwise.
++ * @return {@code true} if dual fields should be used.
++ */
++ protected boolean useDualFields() {
++ return !StructureLoader.isSingleFieldStructure(getClass().getName());
++ }
++
+ Object ensureSpillSize(final int slot) {
+- if (slot < spillLength) {
++ final int oldLength = objectSpill == null ? 0 : objectSpill.length;
++ if (slot < oldLength) {
+ return this;
+ }
+ final int newLength = alignUp(slot + 1, SPILL_RATE);
+ final Object[] newObjectSpill = new Object[newLength];
+- final long[] newPrimitiveSpill = OBJECT_FIELDS_ONLY ? null : new long[newLength];
++ final long[] newPrimitiveSpill = useDualFields() ? new long[newLength] : null;
+
+ if (objectSpill != null) {
+- System.arraycopy(objectSpill, 0, newObjectSpill, 0, spillLength);
+- if (!OBJECT_FIELDS_ONLY) {
+- System.arraycopy(primitiveSpill, 0, newPrimitiveSpill, 0, spillLength);
++ System.arraycopy(objectSpill, 0, newObjectSpill, 0, oldLength);
++ if (primitiveSpill != null && newPrimitiveSpill != null) {
++ System.arraycopy(primitiveSpill, 0, newPrimitiveSpill, 0, oldLength);
+ }
+ }
+
+ this.primitiveSpill = newPrimitiveSpill;
+ this.objectSpill = newObjectSpill;
+- this.spillLength = newLength;
+
+ return this;
+ }
+@@ -3827,9 +3788,6 @@
+ /** This is updated only in debug mode - counts number of {@code ScriptObject} instances created */
+ private static int count;
+
+- /** This is updated only in debug mode - counts number of {@code ScriptObject} instances created that are scope */
+- private static int scopeCount;
+-
+ /**
+ * Get number of {@code ScriptObject} instances created. If not running in debug
+ * mode this is always 0
+@@ -3839,15 +3797,4 @@
+ public static int getCount() {
+ return count;
+ }
+-
+- /**
+- * Get number of scope {@code ScriptObject} instances created. If not running in debug
+- * mode this is always 0
+- *
+- * @return number of scope ScriptObjects created
+- */
+- public static int getScopeCount() {
+- return scopeCount;
+- }
+-
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java Wed Jul 01 21:54:30 2015 -0700
+@@ -32,6 +32,8 @@
+ import static jdk.nashorn.internal.runtime.ECMAErrors.syntaxError;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
+ import static jdk.nashorn.internal.runtime.JSType.isRepresentableAsInt;
++import static jdk.nashorn.internal.runtime.JSType.isString;
++
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+ import java.lang.invoke.SwitchPoint;
+@@ -55,7 +57,6 @@
+ import jdk.nashorn.internal.parser.Lexer;
+ import jdk.nashorn.internal.runtime.linker.Bootstrap;
+
+-
+ /**
+ * Utilities to be called by JavaScript runtime API and generated classes.
+ */
+@@ -114,6 +115,11 @@
+ public static final Call THROW_REFERENCE_ERROR = staticCall(MethodHandles.lookup(), ScriptRuntime.class, "throwReferenceError", void.class, String.class);
+
+ /**
++ * Throws a reference error for an undefined variable.
++ */
++ public static final Call THROW_CONST_TYPE_ERROR = staticCall(MethodHandles.lookup(), ScriptRuntime.class, "throwConstTypeError", void.class, String.class);
++
++ /**
+ * Used to invalidate builtin names, e.g "Function" mapping to all properties in Function.prototype and Function.prototype itself.
+ */
+ public static final Call INVALIDATE_RESERVED_BUILTIN_NAME = staticCallNoLookup(ScriptRuntime.class, "invalidateReservedBuiltinName", void.class, String.class);
+@@ -367,9 +373,9 @@
+ * @return prototype object after merge
+ */
+ public static ScriptObject mergeScope(final ScriptObject scope) {
+- final ScriptObject global = scope.getProto();
+- global.addBoundProperties(scope);
+- return global;
++ final ScriptObject parentScope = scope.getProto();
++ parentScope.addBoundProperties(scope);
++ return parentScope;
+ }
+
+ /**
+@@ -402,6 +408,15 @@
+ }
+
+ /**
++ * Throws a type error for an assignment to a const.
++ *
++ * @param name the const name
++ */
++ public static void throwConstTypeError(final String name) {
++ throw typeError("assign.constant", name);
++ }
++
++ /**
+ * Call a script function as a constructor with given args.
+ *
+ * @param target ScriptFunction object.
+@@ -521,8 +536,6 @@
+
+ /**
+ * ECMA 11.6.1 - The addition operator (+) - generic implementation
+- * Compiler specializes using {@link jdk.nashorn.internal.codegen.RuntimeCallSite}
+- * if any type information is available for any of the operands
+ *
+ * @param x first term
+ * @param y second term
+@@ -549,8 +562,7 @@
+ final Object xPrim = JSType.toPrimitive(x);
+ final Object yPrim = JSType.toPrimitive(y);
+
+- if (xPrim instanceof String || yPrim instanceof String
+- || xPrim instanceof ConsString || yPrim instanceof ConsString) {
++ if (isString(xPrim) || isString(yPrim)) {
+ try {
+ return new ConsString(JSType.toCharSequence(xPrim), JSType.toCharSequence(yPrim));
+ } catch (final IllegalArgumentException iae) {
+@@ -720,7 +732,7 @@
+ return true;
+ }
+ if (x instanceof ScriptObject && y instanceof ScriptObject) {
+- return x == y;
++ return false; // x != y
+ }
+ if (x instanceof ScriptObjectMirror || y instanceof ScriptObjectMirror) {
+ return ScriptObjectMirror.identical(x, y);
+@@ -784,37 +796,55 @@
+ * @return true if they're equal
+ */
+ private static boolean equalDifferentTypeValues(final Object x, final Object y, final JSType xType, final JSType yType) {
+- if (xType == JSType.UNDEFINED && yType == JSType.NULL || xType == JSType.NULL && yType == JSType.UNDEFINED) {
++ if (isUndefinedAndNull(xType, yType) || isUndefinedAndNull(yType, xType)) {
+ return true;
+- }
+-
+- if (xType == JSType.NUMBER && yType == JSType.STRING) {
+- return equals(x, JSType.toNumber(y));
+- }
+-
+- if (xType == JSType.STRING && yType == JSType.NUMBER) {
+- return equals(JSType.toNumber(x), y);
+- }
+-
+- if (xType == JSType.BOOLEAN) {
+- return equals(JSType.toNumber(x), y);
+- }
+-
+- if (yType == JSType.BOOLEAN) {
+- return equals(x, JSType.toNumber(y));
+- }
+-
+- if ((xType == JSType.STRING || xType == JSType.NUMBER) && y instanceof ScriptObject) {
+- return equals(x, JSType.toPrimitive(y));
+- }
+-
+- if (x instanceof ScriptObject && (yType == JSType.STRING || yType == JSType.NUMBER)) {
+- return equals(JSType.toPrimitive(x), y);
++ } else if (isNumberAndString(xType, yType)) {
++ return equalNumberToString(x, y);
++ } else if (isNumberAndString(yType, xType)) {
++ // Can reverse order as both are primitives
++ return equalNumberToString(y, x);
++ } else if (xType == JSType.BOOLEAN) {
++ return equalBooleanToAny(x, y);
++ } else if (yType == JSType.BOOLEAN) {
++ // Can reverse order as y is primitive
++ return equalBooleanToAny(y, x);
++ } else if (isNumberOrStringAndObject(xType, yType)) {
++ return equalNumberOrStringToObject(x, y);
++ } else if (isNumberOrStringAndObject(yType, xType)) {
++ // Can reverse order as y is primitive
++ return equalNumberOrStringToObject(y, x);
+ }
+
+ return false;
+ }
+
++ private static boolean isUndefinedAndNull(final JSType xType, final JSType yType) {
++ return xType == JSType.UNDEFINED && yType == JSType.NULL;
++ }
++
++ private static boolean isNumberAndString(final JSType xType, final JSType yType) {
++ return xType == JSType.NUMBER && yType == JSType.STRING;
++ }
++
++ private static boolean isNumberOrStringAndObject(final JSType xType, final JSType yType) {
++ return (xType == JSType.NUMBER || xType == JSType.STRING) && yType == JSType.OBJECT;
++ }
++
++ private static boolean equalNumberToString(final Object num, final Object str) {
++ // Specification says comparing a number to string should be done as "equals(num, JSType.toNumber(str))". We
++ // can short circuit it to this as we know that "num" is a number, so it'll end up being a number-number
++ // comparison.
++ return ((Number)num).doubleValue() == JSType.toNumber(str.toString());
++ }
++
++ private static boolean equalBooleanToAny(final Object bool, final Object any) {
++ return equals(JSType.toNumber((Boolean)bool), any);
++ }
++
++ private static boolean equalNumberOrStringToObject(final Object numOrStr, final Object any) {
++ return equals(numOrStr, JSType.toPrimitive(any));
++ }
++
+ /**
+ * ECMA 11.9.4 - The strict equal operator (===) - generic implementation
+ *
+@@ -921,8 +951,15 @@
+ * @return true if x is less than y
+ */
+ public static boolean LT(final Object x, final Object y) {
+- final Object value = lessThan(x, y, true);
+- return value == UNDEFINED ? false : (Boolean)value;
++ final Object px = JSType.toPrimitive(x, Number.class);
++ final Object py = JSType.toPrimitive(y, Number.class);
++
++ return areBothString(px, py) ? px.toString().compareTo(py.toString()) < 0 :
++ JSType.toNumber(px) < JSType.toNumber(py);
++ }
++
++ private static boolean areBothString(final Object x, final Object y) {
++ return isString(x) && isString(y);
+ }
+
+ /**
+@@ -934,8 +971,11 @@
+ * @return true if x is greater than y
+ */
+ public static boolean GT(final Object x, final Object y) {
+- final Object value = lessThan(y, x, false);
+- return value == UNDEFINED ? false : (Boolean)value;
++ final Object px = JSType.toPrimitive(x, Number.class);
++ final Object py = JSType.toPrimitive(y, Number.class);
++
++ return areBothString(px, py) ? px.toString().compareTo(py.toString()) > 0 :
++ JSType.toNumber(px) > JSType.toNumber(py);
+ }
+
+ /**
+@@ -947,8 +987,11 @@
+ * @return true if x is less than or equal to y
+ */
+ public static boolean LE(final Object x, final Object y) {
+- final Object value = lessThan(y, x, false);
+- return !(Boolean.TRUE.equals(value) || value == UNDEFINED);
++ final Object px = JSType.toPrimitive(x, Number.class);
++ final Object py = JSType.toPrimitive(y, Number.class);
++
++ return areBothString(px, py) ? px.toString().compareTo(py.toString()) <= 0 :
++ JSType.toNumber(px) <= JSType.toNumber(py);
+ }
+
+ /**
+@@ -960,48 +1003,11 @@
+ * @return true if x is greater than or equal to y
+ */
+ public static boolean GE(final Object x, final Object y) {
+- final Object value = lessThan(x, y, true);
+- return !(Boolean.TRUE.equals(value) || value == UNDEFINED);
+- }
++ final Object px = JSType.toPrimitive(x, Number.class);
++ final Object py = JSType.toPrimitive(y, Number.class);
+
+- /** ECMA 11.8.5 The Abstract Relational Comparison Algorithm */
+- private static Object lessThan(final Object x, final Object y, final boolean leftFirst) {
+- Object px, py;
+-
+- //support e.g. x < y should throw exception correctly if x or y are not numeric
+- if (leftFirst) {
+- px = JSType.toPrimitive(x, Number.class);
+- py = JSType.toPrimitive(y, Number.class);
+- } else {
+- py = JSType.toPrimitive(y, Number.class);
+- px = JSType.toPrimitive(x, Number.class);
+- }
+-
+- if (JSType.ofNoFunction(px) == JSType.STRING && JSType.ofNoFunction(py) == JSType.STRING) {
+- // May be String or ConsString
+- return px.toString().compareTo(py.toString()) < 0;
+- }
+-
+- final double nx = JSType.toNumber(px);
+- final double ny = JSType.toNumber(py);
+-
+- if (Double.isNaN(nx) || Double.isNaN(ny)) {
+- return UNDEFINED;
+- }
+-
+- if (nx == ny) {
+- return false;
+- }
+-
+- if (nx > 0 && ny > 0 && Double.isInfinite(nx) && Double.isInfinite(ny)) {
+- return false;
+- }
+-
+- if (nx < 0 && ny < 0 && Double.isInfinite(nx) && Double.isInfinite(ny)) {
+- return false;
+- }
+-
+- return nx < ny;
++ return areBothString(px, py) ? px.toString().compareTo(py.toString()) >= 0 :
++ JSType.toNumber(px) >= JSType.toNumber(py);
+ }
+
+ /**
+@@ -1014,9 +1020,7 @@
+ final Context context = Context.getContextTrusted();
+ final SwitchPoint sp = context.getBuiltinSwitchPoint(name);
+ assert sp != null;
+- if (sp != null) {
+- context.getLogger(ApplySpecialization.class).info("Overwrote special name '" + name +"' - invalidating switchpoint");
+- SwitchPoint.invalidateAll(new SwitchPoint[] { sp });
+- }
++ context.getLogger(ApplySpecialization.class).info("Overwrote special name '" + name +"' - invalidating switchpoint");
++ SwitchPoint.invalidateAll(new SwitchPoint[] { sp });
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -34,10 +34,15 @@
+ import java.io.IOException;
+ import java.io.InputStreamReader;
+ import java.io.OutputStreamWriter;
++import java.io.StreamTokenizer;
++import java.io.StringReader;
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.List;
+ import java.util.Map;
+-import java.util.StringTokenizer;
++import jdk.nashorn.internal.objects.NativeArray;
+
+ /**
+ * Global functions supported only in scripting mode.
+@@ -51,7 +56,7 @@
+ public static final MethodHandle READFULLY = findOwnMH("readFully", Object.class, Object.class, Object.class);
+
+ /** Handle to implementation of {@link ScriptingFunctions#exec} - Nashorn extension */
+- public static final MethodHandle EXEC = findOwnMH("exec", Object.class, Object.class, Object.class, Object.class);
++ public static final MethodHandle EXEC = findOwnMH("exec", Object.class, Object.class, Object[].class);
+
+ /** EXEC name - special property used by $EXEC API. */
+ public static final String EXEC_NAME = "$EXEC";
+@@ -68,7 +73,8 @@
+ /** Names of special properties used by $ENV API. */
+ public static final String ENV_NAME = "$ENV";
+
+- private static final String PWD_NAME = "PWD";
++ /** Name of the environment variable for the current working directory. */
++ public static final String PWD_NAME = "PWD";
+
+ private ScriptingFunctions() {
+ }
+@@ -107,7 +113,7 @@
+
+ if (file instanceof File) {
+ f = (File)file;
+- } else if (file instanceof String || file instanceof ConsString) {
++ } else if (JSType.isString(file)) {
+ f = new java.io.File(((CharSequence)file).toString());
+ }
+
+@@ -122,26 +128,32 @@
+ * Nashorn extension: exec a string in a separate process.
+ *
+ * @param self self reference
+- * @param string string to execute
+- * @param input input
++ * @param args string to execute, input and additional arguments, to be appended to {@code string}. Additional arguments can be passed as
++ * either one JavaScript array, whose elements will be converted to strings; or as a sequence of
++ * varargs, each of which will be converted to a string.
+ *
+ * @return output string from the request
++ *
+ * @throws IOException if any stream access fails
+ * @throws InterruptedException if execution is interrupted
+ */
+- public static Object exec(final Object self, final Object string, final Object input) throws IOException, InterruptedException {
++ public static Object exec(final Object self, final Object... args) throws IOException, InterruptedException {
+ // Current global is need to fetch additional inputs and for additional results.
+ final ScriptObject global = Context.getGlobal();
+-
+- // Break exec string into tokens.
+- final StringTokenizer tokenizer = new StringTokenizer(JSType.toString(string));
+- final String[] cmdArray = new String[tokenizer.countTokens()];
+- for (int i = 0; tokenizer.hasMoreTokens(); i++) {
+- cmdArray[i] = tokenizer.nextToken();
++ final Object string = args.length > 0? args[0] : UNDEFINED;
++ final Object input = args.length > 1? args[1] : UNDEFINED;
++ final Object[] argv = (args.length > 2)? Arrays.copyOfRange(args, 2, args.length) : ScriptRuntime.EMPTY_ARRAY;
++ // Assemble command line, process additional arguments.
++ final List<String> cmdLine = tokenizeString(JSType.toString(string));
++ final Object[] additionalArgs = argv.length == 1 && argv[0] instanceof NativeArray ?
++ ((NativeArray) argv[0]).asObjectArray() :
++ argv;
++ for (Object arg : additionalArgs) {
++ cmdLine.add(JSType.toString(arg));
+ }
+
+ // Set up initial process.
+- final ProcessBuilder processBuilder = new ProcessBuilder(cmdArray);
++ final ProcessBuilder processBuilder = new ProcessBuilder(cmdLine);
+
+ // Current ENV property state.
+ final Object env = global.get(ENV_NAME);
+@@ -239,4 +251,42 @@
+ private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
+ return MH.findStatic(MethodHandles.lookup(), ScriptingFunctions.class, name, MH.type(rtype, types));
+ }
++
++ /**
++ * Break a string into tokens, honoring quoted arguments and escaped spaces.
++ *
++ * @param str a {@link String} to tokenize.
++ * @return a {@link List} of {@link String}s representing the tokens that
++ * constitute the string.
++ * @throws IOException in case {@link StreamTokenizer#nextToken()} raises it.
++ */
++ public static List<String> tokenizeString(final String str) throws IOException {
++ final StreamTokenizer tokenizer = new StreamTokenizer(new StringReader(str));
++ tokenizer.resetSyntax();
++ tokenizer.wordChars(0, 255);
++ tokenizer.whitespaceChars(0, ' ');
++ tokenizer.commentChar('#');
++ tokenizer.quoteChar('"');
++ tokenizer.quoteChar('\'');
++ final List<String> tokenList = new ArrayList<>();
++ final StringBuilder toAppend = new StringBuilder();
++ while (tokenizer.nextToken() != StreamTokenizer.TT_EOF) {
++ final String s = tokenizer.sval;
++ // The tokenizer understands about honoring quoted strings and recognizes
++ // them as one token that possibly contains multiple space-separated words.
++ // It does not recognize quoted spaces, though, and will split after the
++ // escaping \ character. This is handled here.
++ if (s.endsWith("\\")) {
++ // omit trailing \, append space instead
++ toAppend.append(s.substring(0, s.length() - 1)).append(' ');
++ } else {
++ tokenList.add(toAppend.append(s).toString());
++ toAppend.setLength(0);
++ }
++ }
++ if (toAppend.length() != 0) {
++ tokenList.add(toAppend.toString());
++ }
++ return tokenList;
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -232,14 +232,18 @@
+ }
+
+ private SetMethod createNewFieldSetter(final SwitchPoint builtinSwitchPoint) {
+- return createNewSetter(new AccessorProperty(getName(), 0, sobj.getClass(), getMap().getFreeFieldSlot(), type), builtinSwitchPoint);
++ return createNewSetter(new AccessorProperty(getName(), getFlags(sobj), sobj.getClass(), getMap().getFreeFieldSlot(), type), builtinSwitchPoint);
+ }
+
+ private SetMethod createNewSpillPropertySetter(final SwitchPoint builtinSwitchPoint) {
+- return createNewSetter(new SpillProperty(getName(), 0, getMap().getFreeSpillSlot(), type), builtinSwitchPoint);
++ return createNewSetter(new SpillProperty(getName(), getFlags(sobj), getMap().getFreeSpillSlot(), type), builtinSwitchPoint);
+ }
+
+ private PropertyMap getNewMap(final Property property) {
+ return getMap().addProperty(property);
+ }
++
++ private static int getFlags(final ScriptObject scriptObject) {
++ return scriptObject.useDualFields() ? Property.DUAL_FIELDS : 0;
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/Source.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/Source.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,9 +28,11 @@
+ import java.io.ByteArrayOutputStream;
+ import java.io.File;
+ import java.io.FileNotFoundException;
++import java.io.FileOutputStream;
+ import java.io.IOError;
+ import java.io.IOException;
+ import java.io.InputStream;
++import java.io.PrintWriter;
+ import java.io.Reader;
+ import java.lang.ref.WeakReference;
+ import java.net.MalformedURLException;
+@@ -44,6 +46,7 @@
+ import java.nio.file.Paths;
+ import java.security.MessageDigest;
+ import java.security.NoSuchAlgorithmException;
++import java.time.LocalDateTime;
+ import java.util.Arrays;
+ import java.util.Base64;
+ import java.util.Objects;
+@@ -907,14 +910,16 @@
+ start = 2;
+ cs = StandardCharsets.UTF_16BE;
+ } else if (bytes.length > 1 && bytes[0] == (byte) 0xFF && bytes[1] == (byte) 0xFE) {
+- start = 2;
+- cs = StandardCharsets.UTF_16LE;
++ if (bytes.length > 3 && bytes[2] == 0 && bytes[3] == 0) {
++ start = 4;
++ cs = Charset.forName("UTF-32LE");
++ } else {
++ start = 2;
++ cs = StandardCharsets.UTF_16LE;
++ }
+ } else if (bytes.length > 2 && bytes[0] == (byte) 0xEF && bytes[1] == (byte) 0xBB && bytes[2] == (byte) 0xBF) {
+ start = 3;
+ cs = StandardCharsets.UTF_8;
+- } else if (bytes.length > 3 && bytes[0] == (byte) 0xFF && bytes[1] == (byte) 0xFE && bytes[2] == 0 && bytes[3] == 0) {
+- start = 4;
+- cs = Charset.forName("UTF-32LE");
+ } else if (bytes.length > 3 && bytes[0] == 0 && bytes[1] == 0 && bytes[2] == (byte) 0xFE && bytes[3] == (byte) 0xFF) {
+ start = 4;
+ cs = Charset.forName("UTF-32BE");
+@@ -965,4 +970,39 @@
+ public DebugLogger getLogger() {
+ return initLogger(Context.getContextTrusted());
+ }
++
++ private File dumpFile(final String dir) {
++ final URL u = getURL();
++ final StringBuilder buf = new StringBuilder();
++ // make it unique by prefixing current date & time
++ buf.append(LocalDateTime.now().toString());
++ buf.append('_');
++ if (u != null) {
++ // make it a safe file name
++ buf.append(u.toString()
++ .replace('/', '_')
++ .replace('\\', '_'));
++ } else {
++ buf.append(getName());
++ }
++
++ return new File(dir, buf.toString());
++ }
++
++ void dump(final String dir) {
++ final File file = dumpFile(dir);
++ try (final FileOutputStream fos = new FileOutputStream(file)) {
++ final PrintWriter pw = new PrintWriter(fos);
++ pw.print(data.toString());
++ pw.flush();
++ } catch (final IOException ioExp) {
++ debug("Skipping source dump for " +
++ name +
++ ": " +
++ ECMAErrors.getMessage(
++ "io.error.cant.write",
++ dir.toString() +
++ " : " + ioExp.toString()));
++ }
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/SpillProperty.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/SpillProperty.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,7 +25,6 @@
+
+ package jdk.nashorn.internal.runtime;
+
+-import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
+
+ import java.lang.invoke.MethodHandle;
+@@ -139,11 +138,11 @@
+ }
+ }
+
+- private static MethodHandle primitiveGetter(final int slot) {
+- return OBJECT_FIELDS_ONLY ? null : Accessors.getCached(slot, true, true);
++ private static MethodHandle primitiveGetter(final int slot, final int flags) {
++ return (flags & DUAL_FIELDS) == DUAL_FIELDS ? Accessors.getCached(slot, true, true) : null;
+ }
+- private static MethodHandle primitiveSetter(final int slot) {
+- return OBJECT_FIELDS_ONLY ? null : Accessors.getCached(slot, true, false);
++ private static MethodHandle primitiveSetter(final int slot, final int flags) {
++ return (flags & DUAL_FIELDS) == DUAL_FIELDS ? Accessors.getCached(slot, true, false) : null;
+ }
+ private static MethodHandle objectGetter(final int slot) {
+ return Accessors.getCached(slot, false, true);
+@@ -160,13 +159,19 @@
+ * @param slot spill slot
+ */
+ public SpillProperty(final String key, final int flags, final int slot) {
+- super(key, flags, slot, primitiveGetter(slot), primitiveSetter(slot), objectGetter(slot), objectSetter(slot));
+- assert !OBJECT_FIELDS_ONLY || getLocalType() == Object.class;
++ super(key, flags, slot, primitiveGetter(slot, flags), primitiveSetter(slot, flags), objectGetter(slot), objectSetter(slot));
+ }
+
+- SpillProperty(final String key, final int flags, final int slot, final Class<?> initialType) {
++ /**
++ * Constructor for spill properties with an initial type.
++ * @param key the property key
++ * @param flags the property flags
++ * @param slot spill slot
++ * @param initialType initial type
++ */
++ public SpillProperty(final String key, final int flags, final int slot, final Class<?> initialType) {
+ this(key, flags, slot);
+- setType(OBJECT_FIELDS_ONLY ? Object.class : initialType);
++ setType(hasDualFields() ? initialType : Object.class);
+ }
+
+ SpillProperty(final String key, final int flags, final int slot, final ScriptObject owner, final Object initialValue) {
+@@ -209,8 +214,8 @@
+ @Override
+ void initMethodHandles(final Class<?> structure) {
+ final int slot = getSlot();
+- primitiveGetter = primitiveGetter(slot);
+- primitiveSetter = primitiveSetter(slot);
++ primitiveGetter = primitiveGetter(slot, getFlags());
++ primitiveSetter = primitiveSetter(slot, getFlags());
+ objectGetter = objectGetter(slot);
+ objectSetter = objectSetter(slot);
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/StoredScript.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/StoredScript.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,7 +27,7 @@
+
+ import java.io.Serializable;
+ import java.util.Arrays;
+-import java.util.LinkedHashMap;
++import java.util.HashMap;
+ import java.util.Map;
+
+ /**
+@@ -58,7 +58,7 @@
+ * @param compilationId compilation id
+ * @param mainClassName main class name
+ * @param classBytes map of class names to class bytes
+- * @param initializers initializer map, id -> FunctionInitializer
++ * @param initializers initializer map, id -&gt; FunctionInitializer
+ * @param constants constants array
+ */
+ public StoredScript(final int compilationId, final String mainClassName, final Map<String, byte[]> classBytes, final Map<Integer, FunctionInitializer> initializers, final Object[] constants) {
+@@ -77,44 +77,70 @@
+ return compilationId;
+ }
+
+- /**
+- * Returns the main class name.
+- * @return the main class name
+- */
+- public String getMainClassName() {
+- return mainClassName;
++ private Map<String, Class<?>> installClasses(final Source source, final CodeInstaller<ScriptEnvironment> installer) {
++ final Map<String, Class<?>> installedClasses = new HashMap<>();
++ final byte[] mainClassBytes = classBytes.get(mainClassName);
++ final Class<?> mainClass = installer.install(mainClassName, mainClassBytes);
++
++ installedClasses.put(mainClassName, mainClass);
++
++ for (final Map.Entry<String, byte[]> entry : classBytes.entrySet()) {
++ final String className = entry.getKey();
++
++ if (!className.equals(mainClassName)) {
++ installedClasses.put(className, installer.install(className, entry.getValue()));
++ }
++ }
++
++ installer.initialize(installedClasses.values(), source, constants);
++ return installedClasses;
++ }
++
++ FunctionInitializer installFunction(final RecompilableScriptFunctionData data, final CodeInstaller<ScriptEnvironment> installer) {
++ final Map<String, Class<?>> installedClasses = installClasses(data.getSource(), installer);
++
++ assert initializers != null;
++ assert initializers.size() == 1;
++ final FunctionInitializer initializer = initializers.values().iterator().next();
++
++ for (int i = 0; i < constants.length; i++) {
++ if (constants[i] instanceof RecompilableScriptFunctionData) {
++ // replace deserialized function data with the ones we already have
++ final RecompilableScriptFunctionData newData = data.getScriptFunctionData(((RecompilableScriptFunctionData) constants[i]).getFunctionNodeId());
++ assert newData != null;
++ newData.initTransients(data.getSource(), installer);
++ constants[i] = newData;
++ }
++ }
++
++ initializer.setCode(installedClasses.get(initializer.getClassName()));
++ return initializer;
+ }
+
+ /**
+- * Returns a map of class names to class bytes.
+- * @return map of class bytes
++ * Install as script.
++ *
++ * @param source the source
++ * @param installer the installer
++ * @return main script class
+ */
+- public Map<String, byte[]> getClassBytes() {
+- final Map<String, byte[]> clonedMap = new LinkedHashMap<>();
+- for (final Map.Entry<String, byte[]> entry : classBytes.entrySet()) {
+- clonedMap.put(entry.getKey(), entry.getValue().clone());
++ Class<?> installScript(final Source source, final CodeInstaller<ScriptEnvironment> installer) {
++
++ final Map<String, Class<?>> installedClasses = installClasses(source, installer);
++
++ for (final Object constant : constants) {
++ if (constant instanceof RecompilableScriptFunctionData) {
++ final RecompilableScriptFunctionData data = (RecompilableScriptFunctionData) constant;
++ data.initTransients(source, installer);
++ final FunctionInitializer initializer = initializers.get(data.getFunctionNodeId());
++ if (initializer != null) {
++ initializer.setCode(installedClasses.get(initializer.getClassName()));
++ data.initializeCode(initializer);
++ }
++ }
+ }
+- return clonedMap;
+- }
+
+- /**
+- * Returns the constants array.
+- * @return constants array
+- */
+- public Object[] getConstants() {
+- return constants.clone();
+- }
+-
+- /**
+- * Returns the function initializers map.
+- * @return The initializers map.
+- */
+- public Map<Integer, FunctionInitializer> getInitializers() {
+- final Map<Integer, FunctionInitializer> clonedMap = new LinkedHashMap<>();
+- for (final Map.Entry<Integer, FunctionInitializer> entry : initializers.entrySet()) {
+- clonedMap.put(entry.getKey(), new FunctionInitializer(entry.getValue()));
+- }
+- return clonedMap;
++ return installedClasses.get(mainClassName);
+ }
+
+ @Override
+--- ./nashorn/src/jdk/nashorn/internal/runtime/StructureLoader.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/StructureLoader.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,7 +27,8 @@
+
+ import static jdk.nashorn.internal.codegen.Compiler.SCRIPTS_PACKAGE;
+ import static jdk.nashorn.internal.codegen.Compiler.binaryName;
+-import static jdk.nashorn.internal.codegen.CompilerConstants.JS_OBJECT_PREFIX;
++import static jdk.nashorn.internal.codegen.CompilerConstants.JS_OBJECT_DUAL_FIELD_PREFIX;
++import static jdk.nashorn.internal.codegen.CompilerConstants.JS_OBJECT_SINGLE_FIELD_PREFIX;
+
+ import java.security.ProtectionDomain;
+ import jdk.nashorn.internal.codegen.ObjectClassGenerator;
+@@ -36,7 +37,8 @@
+ * Responsible for on the fly construction of structure classes.
+ */
+ final class StructureLoader extends NashornLoader {
+- private static final String JS_OBJECT_PREFIX_EXTERNAL = binaryName(SCRIPTS_PACKAGE) + '.' + JS_OBJECT_PREFIX.symbolName();
++ private static final String SINGLE_FIELD_PREFIX = binaryName(SCRIPTS_PACKAGE) + '.' + JS_OBJECT_SINGLE_FIELD_PREFIX.symbolName();
++ private static final String DUAL_FIELD_PREFIX = binaryName(SCRIPTS_PACKAGE) + '.' + JS_OBJECT_DUAL_FIELD_PREFIX.symbolName();
+
+ /**
+ * Constructor.
+@@ -45,14 +47,39 @@
+ super(parent);
+ }
+
++ /**
++ * Returns true if the class name represents a structure object with dual primitive/object fields.
++ * @param name a class name
++ * @return true if a dual field structure class
++ */
++ private static boolean isDualFieldStructure(final String name) {
++ return name.startsWith(DUAL_FIELD_PREFIX);
++ }
++
++ /**
++ * Returns true if the class name represents a structure object with single object-only fields.
++ * @param name a class name
++ * @return true if a single field structure class
++ */
++ static boolean isSingleFieldStructure(final String name) {
++ return name.startsWith(SINGLE_FIELD_PREFIX);
++ }
++
++ /**
++ * Returns true if the class name represents a Nashorn structure object.
++ * @param name a class name
++ * @return true if a structure class
++ */
+ static boolean isStructureClass(final String name) {
+- return name.startsWith(JS_OBJECT_PREFIX_EXTERNAL);
++ return isDualFieldStructure(name) || isSingleFieldStructure(name);
+ }
+
+ @Override
+ protected Class<?> findClass(final String name) throws ClassNotFoundException {
+- if (isStructureClass(name)) {
+- return generateClass(name, name.substring(JS_OBJECT_PREFIX_EXTERNAL.length()));
++ if (isDualFieldStructure(name)) {
++ return generateClass(name, name.substring(DUAL_FIELD_PREFIX.length()), true);
++ } else if (isSingleFieldStructure(name)) {
++ return generateClass(name, name.substring(SINGLE_FIELD_PREFIX.length()), false);
+ }
+ return super.findClass(name);
+ }
+@@ -63,10 +90,10 @@
+ * @param descriptor Layout descriptor.
+ * @return Generated class.
+ */
+- private Class<?> generateClass(final String name, final String descriptor) {
++ private Class<?> generateClass(final String name, final String descriptor, final boolean dualFields) {
+ final Context context = Context.getContextTrusted();
+
+- final byte[] code = new ObjectClassGenerator(context).generate(descriptor);
++ final byte[] code = new ObjectClassGenerator(context, dualFields).generate(descriptor);
+ return defineClass(name, code, 0, code.length, new ProtectionDomain(null, getPermissions(null)));
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/WithObject.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/WithObject.java Wed Jul 01 21:54:30 2015 -0700
+@@ -44,7 +44,7 @@
+ * This class supports the handling of scope in a with body.
+ *
+ */
+-public final class WithObject extends ScriptObject implements Scope {
++public final class WithObject extends Scope {
+ private static final MethodHandle WITHEXPRESSIONGUARD = findOwnMH("withExpressionGuard", boolean.class, Object.class, PropertyMap.class, SwitchPoint.class);
+ private static final MethodHandle WITHEXPRESSIONFILTER = findOwnMH("withFilterExpression", Object.class, Object.class);
+ private static final MethodHandle WITHSCOPEFILTER = findOwnMH("withFilterScope", Object.class, Object.class);
+@@ -62,7 +62,6 @@
+ */
+ WithObject(final ScriptObject scope, final ScriptObject expression) {
+ super(scope, null);
+- setIsScope();
+ this.expression = expression;
+ }
+
+@@ -198,7 +197,7 @@
+ * @return FindPropertyData or null if not found.
+ */
+ @Override
+- FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
++ protected FindProperty findProperty(final String key, final boolean deep, final ScriptObject start) {
+ // We call findProperty on 'expression' with 'expression' itself as start parameter.
+ // This way in ScriptObject.setObject we can tell the property is from a 'with' expression
+ // (as opposed from another non-scope object in the proto chain such as Object.prototype).
+@@ -224,29 +223,33 @@
+
+ @Override
+ public void setSplitState(final int state) {
+- getNonWithParent().setSplitState(state);
++ ((Scope) getNonWithParent()).setSplitState(state);
+ }
+
+ @Override
+ public int getSplitState() {
+- return getNonWithParent().getSplitState();
++ return ((Scope) getNonWithParent()).getSplitState();
++ }
++
++ @Override
++ public void addBoundProperties(final ScriptObject source, final Property[] properties) {
++ // Declared variables in nested eval go to first normal (non-with) parent scope.
++ getNonWithParent().addBoundProperties(source, properties);
+ }
+
+ /**
+ * Get first parent scope that is not an instance of WithObject.
+ */
+- private Scope getNonWithParent() {
+- ScriptObject proto = getParentScope();
++ private ScriptObject getNonWithParent() {
++ ScriptObject proto = getProto();
+
+ while (proto != null && proto instanceof WithObject) {
+- proto = ((WithObject)proto).getParentScope();
++ proto = proto.getProto();
+ }
+
+- assert proto instanceof Scope : "with scope without parent scope";
+- return (Scope) proto;
++ return proto;
+ }
+
+-
+ private static GuardedInvocation fixReceiverType(final GuardedInvocation link, final MethodHandle filter) {
+ // The receiver may be an Object or a ScriptObject.
+ final MethodType invType = link.getInvocation().type();
+@@ -380,14 +383,6 @@
+ return expression;
+ }
+
+- /**
+- * Get the parent scope for this {@code WithObject}
+- * @return the parent scope
+- */
+- public ScriptObject getParentScope() {
+- return getProto();
+- }
+-
+ private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
+ return MH.findStatic(MethodHandles.lookup(), WithObject.class, name, MH.type(rtype, types));
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -26,6 +26,7 @@
+ package jdk.nashorn.internal.runtime.arrays;
+
+ import static jdk.nashorn.internal.codegen.CompilerConstants.staticCall;
++
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+ import java.lang.reflect.Array;
+@@ -117,7 +118,7 @@
+ return new SparseArrayData(this, safeIndex + 1);
+ }
+ //known to fit in int
+- return toRealArrayData((int)safeIndex).ensure(safeIndex);
++ return toRealArrayData((int)safeIndex);
+ }
+ return this;
+ }
+@@ -275,7 +276,7 @@
+ /**
+ * Align an array size up to the nearest array chunk size
+ * @param size size required
+- * @return size given, always >= size
++ * @return size given, always &gt;= size
+ */
+ protected final static int alignUp(final int size) {
+ return size + CHUNK_SIZE - 1 & ~(CHUNK_SIZE - 1);
+@@ -496,7 +497,9 @@
+ public abstract ArrayData shiftRight(final int by);
+
+ /**
+- * Ensure that the given index exists and won't fail subsequent
++ * Ensure that the given index exists and won't fail in a subsequent access.
++ * If {@code safeIndex} is equal or greater than the current length the length is
++ * updated to {@code safeIndex + 1}.
+ *
+ * @param safeIndex the index to ensure wont go out of bounds
+ * @return new array data (or same)
+@@ -761,39 +764,6 @@
+ }
+
+ /**
+- * Push an array of items to the end of the array
+- *
+- * @param strict are we in strict mode
+- * @param item the item
+- * @return new array data (or same)
+- */
+- public ArrayData push(final boolean strict, final double item) {
+- return push(strict, item);
+- }
+-
+- /**
+- * Push an array of items to the end of the array
+- *
+- * @param strict are we in strict mode
+- * @param item the item
+- * @return new array data (or same)
+- */
+- public ArrayData push(final boolean strict, final long item) {
+- return push(strict, item);
+- }
+-
+- /**
+- * Push an array of items to the end of the array
+- *
+- * @param strict are we in strict mode
+- * @param item the item
+- * @return new array data (or same)
+- */
+- public ArrayData push(final boolean strict, final int item) {
+- return push(strict, item);
+- }
+-
+- /**
+ * Pop an element from the end of the array
+ *
+ * @return the popped element
+--- ./nashorn/src/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -57,7 +57,7 @@
+ }
+
+ /**
+- * Check if we can put one more element at the end of this continous
++ * Check if we can put one more element at the end of this continuous
+ * array without reallocating, or if we are overwriting an already
+ * allocated element
+ *
+--- ./nashorn/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -26,6 +26,7 @@
+ package jdk.nashorn.internal.runtime.arrays;
+
+ import static jdk.nashorn.internal.codegen.CompilerConstants.specialCall;
++
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+ import java.util.Arrays;
+@@ -181,14 +182,13 @@
+
+ @Override
+ public ArrayData convert(final Class<?> type) {
+- if (type == Integer.class) {
++ if (type == Integer.class || type == Byte.class || type == Short.class) {
+ return this;
+ } else if (type == Long.class) {
+ return convertToLong();
+- } else if (type == Double.class) {
++ } else if (type == Double.class || type == Float.class) {
+ return convertToDouble();
+ } else {
+- assert type == null || (!Number.class.isAssignableFrom(type) && !type.isPrimitive());
+ return convertToObject();
+ }
+ }
+@@ -220,7 +220,9 @@
+ final int newLength = ArrayData.nextSize((int)safeIndex);
+ array = Arrays.copyOf(array, newLength);
+ }
+- setLength(safeIndex + 1);
++ if (safeIndex >= length()) {
++ setLength(safeIndex + 1);
++ }
+ return this;
+ }
+
+@@ -343,17 +345,6 @@
+ }
+
+ @Override
+- public final ArrayData push(final boolean strict, final int item) {
+- final long len = length();
+- final ArrayData newData = ensure(len);
+- if (newData == this) {
+- array[(int)len] = item;
+- return this;
+- }
+- return newData.set((int)len, item, strict);
+- }
+-
+- @Override
+ public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+ final long oldLength = length();
+ final long newLength = oldLength - removed + added;
+--- ./nashorn/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,6 +27,7 @@
+
+ import static jdk.nashorn.internal.codegen.CompilerConstants.specialCall;
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
++
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+ import java.util.Arrays;
+@@ -119,11 +120,11 @@
+
+ @Override
+ public ContinuousArrayData convert(final Class<?> type) {
+- if (type == Integer.class || type == Long.class) {
++ if (type == Integer.class || type == Long.class || type == Byte.class || type == Short.class) {
+ return this;
+ }
+ final int len = (int)length();
+- if (type == Double.class) {
++ if (type == Double.class || type == Float.class) {
+ return new NumberArrayData(toDoubleArray(), len);
+ }
+ return new ObjectArrayData(toObjectArray(false), len);
+@@ -156,7 +157,9 @@
+ final int newLength = ArrayData.nextSize((int)safeIndex);
+ array = Arrays.copyOf(array, newLength);
+ }
+- setLength(safeIndex + 1);
++ if (safeIndex >= length()) {
++ setLength(safeIndex + 1);
++ }
+ return this;
+ }
+
+@@ -168,7 +171,8 @@
+
+ @Override
+ public ArrayData set(final int index, final Object value, final boolean strict) {
+- if (value instanceof Long || value instanceof Integer) {
++ if (value instanceof Long || value instanceof Integer ||
++ value instanceof Byte || value instanceof Short) {
+ return set(index, ((Number)value).longValue(), strict);
+ } else if (value == ScriptRuntime.UNDEFINED) {
+ return new UndefinedArrayFilter(this).set(index, value, strict);
+@@ -303,17 +307,6 @@
+ }
+
+ @Override
+- public final ArrayData push(final boolean strict, final long item) {
+- final long len = length();
+- final ArrayData newData = ensure(len);
+- if (newData == this) {
+- array[(int)len] = item;
+- return this;
+- }
+- return newData.set((int)len, item, strict);
+- }
+-
+- @Override
+ public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+ final long oldLength = length();
+ final long newLength = oldLength - removed + added;
+--- ./nashorn/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -28,6 +28,8 @@
+ import static jdk.nashorn.internal.codegen.CompilerConstants.specialCall;
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
+ import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
++
++import jdk.internal.dynalink.support.TypeUtilities;
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+ import java.util.Arrays;
+@@ -103,9 +105,14 @@
+ return super.asArrayOfType(componentType);
+ }
+
++ private static boolean canWiden(final Class<?> type) {
++ return TypeUtilities.isWrapperType(type) &&
++ type != Boolean.class && type != Character.class;
++ }
++
+ @Override
+ public ContinuousArrayData convert(final Class<?> type) {
+- if (type != Double.class && type != Integer.class && type != Long.class) {
++ if (! canWiden(type)) {
+ final int len = (int)length();
+ return new ObjectArrayData(toObjectArray(false), len);
+ }
+@@ -138,7 +145,9 @@
+ final int newLength = ArrayData.nextSize((int)safeIndex);
+ array = Arrays.copyOf(array, newLength); //todo fill with nan or never accessed?
+ }
+- setLength(safeIndex + 1);
++ if (safeIndex >= length()) {
++ setLength(safeIndex + 1);
++ }
+ return this;
+
+ }
+@@ -151,7 +160,7 @@
+
+ @Override
+ public ArrayData set(final int index, final Object value, final boolean strict) {
+- if (value instanceof Double || value instanceof Integer || value instanceof Long) {
++ if (value instanceof Double || (value != null && canWiden(value.getClass()))) {
+ return set(index, ((Number)value).doubleValue(), strict);
+ } else if (value == UNDEFINED) {
+ return new UndefinedArrayFilter(this).set(index, value, strict);
+@@ -277,17 +286,6 @@
+ }
+
+ @Override
+- public final ArrayData push(final boolean strict, final double item) {
+- final long len = length();
+- final ArrayData newData = ensure(len);
+- if (newData == this) {
+- array[(int)len] = item;
+- return this;
+- }
+- return newData.set((int)len, item, strict);
+- }
+-
+- @Override
+ public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+ final long oldLength = length();
+ final long newLength = oldLength - removed + added;
+--- ./nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -123,7 +123,9 @@
+ final int newLength = ArrayData.nextSize((int)safeIndex);
+ array = Arrays.copyOf(array, newLength); //fill with undefined or OK? TODO
+ }
+- setLength(safeIndex + 1);
++ if (safeIndex >= length()) {
++ setLength(safeIndex + 1);
++ }
+ return this;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java Wed Jul 01 21:54:30 2015 -0700
+@@ -135,10 +135,17 @@
+
+ @Override
+ public ArrayData ensure(final long safeIndex) {
++ // Usually #ensure only needs to be called if safeIndex is greater or equal current length.
++ // SparseArrayData is an exception as an index smaller than our current length may still
++ // exceed the underlying ArrayData's capacity. Because of this, SparseArrayData invokes
++ // its ensure method internally in various places where other ArrayData subclasses don't,
++ // making it safe for outside uses to only call ensure(safeIndex) if safeIndex >= length.
+ if (safeIndex < maxDenseLength && underlying.length() <= safeIndex) {
+ underlying = underlying.ensure(safeIndex);
+ }
+- setLength(Math.max(safeIndex + 1, length()));
++ if (safeIndex >= length()) {
++ setLength(safeIndex + 1);
++ }
+ return this;
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/AdaptationResult.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/AdaptationResult.java Wed Jul 01 21:54:30 2015 -0700
+@@ -48,28 +48,25 @@
+ ERROR_NO_ACCESSIBLE_CONSTRUCTOR,
+ ERROR_MULTIPLE_SUPERCLASSES,
+ ERROR_NO_COMMON_LOADER,
+- ERROR_FINAL_FINALIZER
++ ERROR_FINAL_FINALIZER,
++ ERROR_OTHER
+ }
+
+ static final AdaptationResult SUCCESSFUL_RESULT = new AdaptationResult(Outcome.SUCCESS, "");
+
+ private final Outcome outcome;
+- private final String classList;
++ private final String[] messageArgs;
+
+- AdaptationResult(final Outcome outcome, final String classList) {
++ AdaptationResult(final Outcome outcome, final String... messageArgs) {
+ this.outcome = outcome;
+- this.classList = classList;
++ this.messageArgs = messageArgs;
+ }
+
+ Outcome getOutcome() {
+ return outcome;
+ }
+
+- String getClassList() {
+- return classList;
+- }
+-
+ ECMAException typeError() {
+- return ECMAErrors.typeError("extend." + outcome, classList);
++ return ECMAErrors.typeError("extend." + outcome, messageArgs);
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/Bootstrap.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/Bootstrap.java Wed Jul 01 21:54:30 2015 -0700
+@@ -48,7 +48,6 @@
+ import jdk.nashorn.api.scripting.JSObject;
+ import jdk.nashorn.internal.codegen.CompilerConstants.Call;
+ import jdk.nashorn.internal.codegen.ObjectClassGenerator;
+-import jdk.nashorn.internal.codegen.RuntimeCallSite;
+ import jdk.nashorn.internal.lookup.MethodHandleFactory;
+ import jdk.nashorn.internal.lookup.MethodHandleFunctionality;
+ import jdk.nashorn.internal.objects.ScriptFunctionImpl;
+@@ -75,17 +74,16 @@
+ * of object fields only, it is fine. However, with dual fields, in order to get
+ * performance on benchmarks with a lot of object instantiation and then field
+ * reassignment, it can take slightly more relinks to become stable with type
+- * changes swapping out an entire proprety map and making a map guard fail.
+- * Therefore the relink threshold is set to 16 for dual fields (now the default).
+- * This doesn't seem to have any other negative performance implication.
++ * changes swapping out an entire property map and making a map guard fail.
++ * Since we need to set this value statically it must work with possibly changing
++ * optimistic types and dual fields settings. A higher value does not seem to have
++ * any other negative performance implication when running with object-only fields,
++ * so we choose a higher value here.
+ *
+ * See for example octane.gbemu, run with --log=fields:warning to study
+ * megamorphic behavior
+ */
+- private static final int NASHORN_DEFAULT_UNSTABLE_RELINK_THRESHOLD =
+- ObjectClassGenerator.OBJECT_FIELDS_ONLY ?
+- 8 :
+- 16;
++ private static final int NASHORN_DEFAULT_UNSTABLE_RELINK_THRESHOLD = 16;
+
+ // do not create me!!
+ private Bootstrap() {
+@@ -119,6 +117,7 @@
+ return unboxReturnType(target, newType);
+ }
+ });
++ factory.setInternalObjectsFilter(NashornBeansLinker.createHiddenObjectFilter());
+ final int relinkThreshold = Options.getIntProperty("nashorn.unstable.relink.threshold", NASHORN_DEFAULT_UNSTABLE_RELINK_THRESHOLD);
+ if (relinkThreshold > -1) {
+ factory.setUnstableRelinkThreshold(relinkThreshold);
+@@ -209,19 +208,6 @@
+ }
+
+ /**
+- * Bootstrapper for a specialized Runtime call
+- *
+- * @param lookup lookup
+- * @param initialName initial name for callsite
+- * @param type method type for call site
+- *
+- * @return callsite for a runtime node
+- */
+- public static CallSite runtimeBootstrap(final MethodHandles.Lookup lookup, final String initialName, final MethodType type) {
+- return new RuntimeCallSite(type, initialName);
+- }
+-
+- /**
+ * Boostrapper for math calls that may overflow
+ * @param lookup lookup
+ * @param name name of operation
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/BoundCallableLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/BoundCallableLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -99,7 +99,7 @@
+ MethodType newMethodType = descriptor.getMethodType().changeParameterType(0, callable.getClass());
+ if (isCall) {
+ // R(callable.class, T1, ...) => R(callable.class, boundThis.class, ...)
+- newMethodType = newMethodType.changeParameterType(1, boundThis.getClass());
++ newMethodType = newMethodType.changeParameterType(1, boundThis == null? Object.class : boundThis.getClass());
+ }
+ // R(callable.class[, boundThis.class], T2, ...) => R(callable.class[, boundThis.class], boundArg0.class, ..., boundArgn.class, T2, ...)
+ for(int i = boundArgs.length; i-- > 0;) {
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/BrowserJSObjectLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/BrowserJSObjectLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,11 +25,13 @@
+
+ package jdk.nashorn.internal.runtime.linker;
+
++import static jdk.nashorn.internal.runtime.JSType.isString;
++import static jdk.nashorn.internal.runtime.linker.BrowserJSObjectLinker.JSObjectHandles.JSOBJECT_CALL;
+ import static jdk.nashorn.internal.runtime.linker.BrowserJSObjectLinker.JSObjectHandles.JSOBJECT_GETMEMBER;
+ import static jdk.nashorn.internal.runtime.linker.BrowserJSObjectLinker.JSObjectHandles.JSOBJECT_GETSLOT;
+ import static jdk.nashorn.internal.runtime.linker.BrowserJSObjectLinker.JSObjectHandles.JSOBJECT_SETMEMBER;
+ import static jdk.nashorn.internal.runtime.linker.BrowserJSObjectLinker.JSObjectHandles.JSOBJECT_SETSLOT;
+-import static jdk.nashorn.internal.runtime.linker.BrowserJSObjectLinker.JSObjectHandles.JSOBJECT_CALL;
++
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+ import jdk.internal.dynalink.CallSiteDescriptor;
+@@ -110,20 +112,21 @@
+ private GuardedInvocation lookup(final CallSiteDescriptor desc, final LinkRequest request, final LinkerServices linkerServices) throws Exception {
+ final String operator = CallSiteDescriptorFactory.tokenizeOperators(desc).get(0);
+ final int c = desc.getNameTokenCount();
++ GuardedInvocation inv;
++ try {
++ inv = nashornBeansLinker.getGuardedInvocation(request, linkerServices);
++ } catch (Throwable th) {
++ inv = null;
++ }
+
+ switch (operator) {
+ case "getProp":
+ case "getElem":
+ case "getMethod":
+- if (c > 2) {
+- return findGetMethod(desc);
+- }
+- // For indexed get, we want GuardedInvocation from beans linker and pass it.
+- // BrowserJSObjectLinker.get uses this fallback getter for explicit signature method access.
+- return findGetIndexMethod(nashornBeansLinker.getGuardedInvocation(request, linkerServices));
++ return c > 2? findGetMethod(desc, inv) : findGetIndexMethod(inv);
+ case "setProp":
+ case "setElem":
+- return c > 2 ? findSetMethod(desc) : findSetIndexMethod();
++ return c > 2? findSetMethod(desc, inv) : findSetIndexMethod();
+ case "call":
+ return findCallMethod(desc);
+ default:
+@@ -131,7 +134,10 @@
+ }
+ }
+
+- private static GuardedInvocation findGetMethod(final CallSiteDescriptor desc) {
++ private static GuardedInvocation findGetMethod(final CallSiteDescriptor desc, final GuardedInvocation inv) {
++ if (inv != null) {
++ return inv;
++ }
+ final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
+ final MethodHandle getter = MH.insertArguments(JSOBJECT_GETMEMBER, 1, name);
+ return new GuardedInvocation(getter, IS_JSOBJECT_GUARD);
+@@ -142,7 +148,10 @@
+ return inv.replaceMethods(getter, inv.getGuard());
+ }
+
+- private static GuardedInvocation findSetMethod(final CallSiteDescriptor desc) {
++ private static GuardedInvocation findSetMethod(final CallSiteDescriptor desc, final GuardedInvocation inv) {
++ if (inv != null) {
++ return inv;
++ }
+ final MethodHandle getter = MH.insertArguments(JSOBJECT_SETMEMBER, 1, desc.getNameToken(2));
+ return new GuardedInvocation(getter, IS_JSOBJECT_GUARD);
+ }
+@@ -170,12 +179,12 @@
+ if (index > -1) {
+ return JSOBJECT_GETSLOT.invokeExact(jsobj, index);
+ }
+- } else if (key instanceof String) {
+- final String name = (String)key;
++ } else if (isString(key)) {
++ final String name = key.toString();
+ if (name.indexOf('(') != -1) {
+- return fallback.invokeExact(jsobj, key);
++ return fallback.invokeExact(jsobj, (Object) name);
+ }
+- return JSOBJECT_GETMEMBER.invokeExact(jsobj, (String)key);
++ return JSOBJECT_GETMEMBER.invokeExact(jsobj, name);
+ }
+ return null;
+ }
+@@ -186,8 +195,8 @@
+ JSOBJECT_SETSLOT.invokeExact(jsobj, (int)key, value);
+ } else if (key instanceof Number) {
+ JSOBJECT_SETSLOT.invokeExact(jsobj, getIndex((Number)key), value);
+- } else if (key instanceof String) {
+- JSOBJECT_SETMEMBER.invokeExact(jsobj, (String)key, value);
++ } else if (isString(key)) {
++ JSOBJECT_SETMEMBER.invokeExact(jsobj, key.toString(), value);
+ }
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,16 +25,14 @@
+
+ package jdk.nashorn.internal.runtime.linker;
+
++import static jdk.nashorn.internal.runtime.JSType.isString;
++
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+-import java.lang.invoke.MethodType;
+-import java.util.HashMap;
+ import java.util.Map;
+ import javax.script.Bindings;
+ import jdk.internal.dynalink.CallSiteDescriptor;
+ import jdk.internal.dynalink.linker.GuardedInvocation;
+-import jdk.internal.dynalink.linker.GuardedTypeConversion;
+-import jdk.internal.dynalink.linker.GuardingTypeConverterFactory;
+ import jdk.internal.dynalink.linker.LinkRequest;
+ import jdk.internal.dynalink.linker.LinkerServices;
+ import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
+@@ -48,7 +46,7 @@
+ * A Dynalink linker to handle web browser built-in JS (DOM etc.) objects as well
+ * as ScriptObjects from other Nashorn contexts.
+ */
+-final class JSObjectLinker implements TypeBasedGuardingDynamicLinker, GuardingTypeConverterFactory {
++final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
+ private final NashornBeansLinker nashornBeansLinker;
+
+ JSObjectLinker(final NashornBeansLinker nashornBeansLinker) {
+@@ -94,22 +92,6 @@
+ return Bootstrap.asTypeSafeReturn(inv, linkerServices, desc);
+ }
+
+- @Override
+- public GuardedTypeConversion convertToType(final Class<?> sourceType, final Class<?> targetType) throws Exception {
+- final boolean sourceIsAlwaysJSObject = JSObject.class.isAssignableFrom(sourceType);
+- if(!sourceIsAlwaysJSObject && !sourceType.isAssignableFrom(JSObject.class)) {
+- return null;
+- }
+-
+- final MethodHandle converter = CONVERTERS.get(targetType);
+- if(converter == null) {
+- return null;
+- }
+-
+- return new GuardedTypeConversion(new GuardedInvocation(converter, sourceIsAlwaysJSObject ? null : IS_JSOBJECT_GUARD).asType(MethodType.methodType(targetType, sourceType)), true);
+- }
+-
+-
+ private GuardedInvocation lookup(final CallSiteDescriptor desc, final LinkRequest request, final LinkerServices linkerServices) throws Exception {
+ final String operator = CallSiteDescriptorFactory.tokenizeOperators(desc).get(0);
+ final int c = desc.getNameTokenCount();
+@@ -185,11 +167,11 @@
+ if (index > -1) {
+ return ((JSObject)jsobj).getSlot(index);
+ }
+- } else if (key instanceof String) {
+- final String name = (String)key;
++ } else if (isString(key)) {
++ final String name = key.toString();
+ // get with method name and signature. delegate it to beans linker!
+ if (name.indexOf('(') != -1) {
+- return fallback.invokeExact(jsobj, key);
++ return fallback.invokeExact(jsobj, (Object) name);
+ }
+ return ((JSObject)jsobj).getMember(name);
+ }
+@@ -202,30 +184,11 @@
+ ((JSObject)jsobj).setSlot((Integer)key, value);
+ } else if (key instanceof Number) {
+ ((JSObject)jsobj).setSlot(getIndex((Number)key), value);
+- } else if (key instanceof String) {
+- ((JSObject)jsobj).setMember((String)key, value);
++ } else if (isString(key)) {
++ ((JSObject)jsobj).setMember(key.toString(), value);
+ }
+ }
+
+- @SuppressWarnings("unused")
+- private static int toInt32(final JSObject obj) {
+- return JSType.toInt32(toNumber(obj));
+- }
+-
+- @SuppressWarnings("unused")
+- private static long toLong(final JSObject obj) {
+- return JSType.toLong(toNumber(obj));
+- }
+-
+- private static double toNumber(final JSObject obj) {
+- return obj == null ? 0 : obj.toNumber();
+- }
+-
+- @SuppressWarnings("unused")
+- private static boolean toBoolean(final JSObject obj) {
+- return obj != null;
+- }
+-
+ private static int getIndex(final Number n) {
+ final double value = n.doubleValue();
+ return JSType.isRepresentableAsInt(value) ? (int)value : -1;
+@@ -260,14 +223,6 @@
+ private static final MethodHandle JSOBJECT_CALL_TO_APPLY = findOwnMH_S("callToApply", Object.class, MethodHandle.class, JSObject.class, Object.class, Object[].class);
+ private static final MethodHandle JSOBJECT_NEW = findJSObjectMH_V("newObject", Object.class, Object[].class);
+
+- private static final Map<Class<?>, MethodHandle> CONVERTERS = new HashMap<>();
+- static {
+- CONVERTERS.put(boolean.class, findOwnMH_S("toBoolean", boolean.class, JSObject.class));
+- CONVERTERS.put(int.class, findOwnMH_S("toInt32", int.class, JSObject.class));
+- CONVERTERS.put(long.class, findOwnMH_S("toLong", long.class, JSObject.class));
+- CONVERTERS.put(double.class, findOwnMH_S("toNumber", double.class, JSObject.class));
+- }
+-
+ private static MethodHandle findJSObjectMH_V(final String name, final Class<?> rtype, final Class<?>... types) {
+ return MH.findVirtual(MethodHandles.lookup(), JSObject.class, name, MH.type(rtype, types));
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java Wed Jul 01 21:54:30 2015 -0700
+@@ -106,7 +106,9 @@
+ * <li>
+ * If the adapter being generated can have class-level overrides, constructors taking same arguments as the superclass
+ * constructors are created. These constructors simply delegate to the superclass constructor. They are simply used to
+- * create instances of the adapter class, with no instance-level overrides, as they don't have them.
++ * create instances of the adapter class, with no instance-level overrides, as they don't have them. If the original
++ * class' constructor was variable arity, the adapter constructor will also be variable arity. Protected constructors
++ * are exposed as public.
+ * </li>
+ * </ul>
+ * </p><p>
+@@ -190,7 +192,6 @@
+ private static final int MAX_GENERATED_TYPE_NAME_LENGTH = 255;
+
+ private static final String CLASS_INIT = "<clinit>";
+- static final String CONVERTER_INIT = "<converter-init>";
+
+ // Method name prefix for invoking super-methods
+ static final String SUPER_PREFIX = "super$";
+@@ -494,7 +495,8 @@
+ final Type[] argTypes = originalCtorType.getArgumentTypes();
+
+ // All constructors must be public, even if in the superclass they were protected.
+- final InstructionAdapter mv = new InstructionAdapter(cw.visitMethod(ACC_PUBLIC, INIT,
++ final InstructionAdapter mv = new InstructionAdapter(cw.visitMethod(ACC_PUBLIC |
++ (ctor.isVarArgs() ? ACC_VARARGS : 0), INIT,
+ Type.getMethodDescriptor(originalCtorType.getReturnType(), argTypes), null, null));
+
+ mv.visitCode();
+@@ -543,7 +545,8 @@
+ System.arraycopy(originalArgTypes, 0, newArgTypes, 0, argLen);
+
+ // All constructors must be public, even if in the superclass they were protected.
+- // Existing super constructor <init>(this, args...) triggers generating <init>(this, scriptObj, args...).
++ // Existing super constructor <init>(this, args...) triggers generating <init>(this, args..., scriptObj).
++ // Any variable arity constructors become fixed-arity with explicit array arguments.
+ final InstructionAdapter mv = new InstructionAdapter(cw.visitMethod(ACC_PUBLIC, INIT,
+ Type.getMethodDescriptor(originalCtorType.getReturnType(), newArgTypes), null, null));
+
+@@ -593,7 +596,7 @@
+ if (! fromFunction) {
+ newArgTypes[argLen] = OBJECT_TYPE;
+ final InstructionAdapter mv2 = new InstructionAdapter(cw.visitMethod(ACC_PUBLIC, INIT,
+- Type.getMethodDescriptor(originalCtorType.getReturnType(), newArgTypes), null, null));
++ Type.getMethodDescriptor(originalCtorType.getReturnType(), newArgTypes), null, null));
+ generateOverridingConstructorWithObjectParam(mv2, ctor, originalCtorType.getDescriptor());
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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
+@@ -54,23 +54,28 @@
+ import jdk.nashorn.internal.runtime.ScriptObject;
+
+ /**
+- * <p>A factory class that generates adapter classes. Adapter classes allow implementation of Java interfaces and
+- * extending of Java classes from JavaScript. For every combination of a superclass to extend and interfaces to
+- * implement (collectively: "original types"), exactly one adapter class is generated that extends the specified
+- * superclass and implements the specified interfaces. (But see the discussion of class-based overrides for exceptions.)
+- * </p><p>
+- * The adapter class is generated in a new secure class loader that inherits Nashorn's protection domain, and has either
+- * one of the original types' class loader or the Nashorn's class loader as its parent - the parent class loader
+- * is chosen so that all the original types and the Nashorn core classes are visible from it (as the adapter will have
+- * constant pool references to ScriptObject and ScriptFunction classes). In case none of the candidate class loaders has
+- * visibility of all the required types, an error is thrown. The class uses {@link JavaAdapterBytecodeGenerator} to
+- * generate the adapter class itself; see its documentation for details about the generated class.
+- * </p><p>
+- * You normally don't use this class directly, but rather either create adapters from script using
+- * {@link jdk.nashorn.internal.objects.NativeJava#extend(Object, Object...)}, using the {@code new} operator on abstract classes and interfaces (see
+- * {@link jdk.nashorn.internal.objects.NativeJava#type(Object, Object)}), or implicitly when passing script functions to Java methods expecting SAM
+- * types.
+- * </p>
++ * A factory class that generates adapter classes. Adapter classes allow
++ * implementation of Java interfaces and extending of Java classes from
++ * JavaScript. For every combination of a superclass to extend and interfaces to
++ * implement (collectively: "original types"), exactly one adapter class is
++ * generated that extends the specified superclass and implements the specified
++ * interfaces. (But see the discussion of class-based overrides for exceptions.)
++ * <p>
++ * The adapter class is generated in a new secure class loader that inherits
++ * Nashorn's protection domain, and has either one of the original types' class
++ * loader or the Nashorn's class loader as its parent - the parent class loader
++ * is chosen so that all the original types and the Nashorn core classes are
++ * visible from it (as the adapter will have constant pool references to
++ * ScriptObject and ScriptFunction classes). In case none of the candidate class
++ * loaders has visibility of all the required types, an error is thrown. The
++ * class uses {@link JavaAdapterBytecodeGenerator} to generate the adapter class
++ * itself; see its documentation for details about the generated class.
++ * <p>
++ * You normally don't use this class directly, but rather either create adapters
++ * from script using {@link jdk.nashorn.internal.objects.NativeJava#extend(Object, Object...)},
++ * using the {@code new} operator on abstract classes and interfaces (see
++ * {@link jdk.nashorn.internal.objects.NativeJava#type(Object, Object)}), or
++ * implicitly when passing script functions to Java methods expecting SAM types.
+ */
+
+ @SuppressWarnings("javadoc")
+@@ -93,25 +98,39 @@
+ };
+
+ /**
+- * Returns an adapter class for the specified original types. The adapter class extends/implements the original
+- * class/interfaces.
+- * @param types the original types. The caller must pass at least one Java type representing either a public
+- * interface or a non-final public class with at least one public or protected constructor. If more than one type is
+- * specified, at most one can be a class and the rest have to be interfaces. The class can be in any position in the
+- * array. Invoking the method twice with exactly the same types in the same order will return the same adapter
+- * class, any reordering of types or even addition or removal of redundant types (i.e. interfaces that other types
+- * in the list already implement/extend, or {@code java.lang.Object} in a list of types consisting purely of
+- * interfaces) will result in a different adapter class, even though those adapter classes are functionally
+- * identical; we deliberately don't want to incur the additional processing cost of canonicalizing type lists.
+- * @param classOverrides a JavaScript object with functions serving as the class-level overrides and
+- * implementations. These overrides are defined for all instances of the class, and can be further overridden on a
+- * per-instance basis by passing additional objects in the constructor.
+- * @param lookup the lookup object identifying the caller class. The generated adapter class will have the
+- * protection domain of the caller class iff the lookup object is full-strength, otherwise it will be completely
+- * unprivileged.
+- * @return an adapter class. See this class' documentation for details on the generated adapter class.
+- * @throws ECMAException with a TypeError if the adapter class can not be generated because the original class is
+- * final, non-public, or has no public or protected constructors.
++ * Returns an adapter class for the specified original types. The adapter
++ * class extends/implements the original class/interfaces.
++ *
++ * @param types the original types. The caller must pass at least one Java
++ * type representing either a public interface or a non-final public
++ * class with at least one public or protected constructor. If more
++ * than one type is specified, at most one can be a class and the
++ * rest have to be interfaces. The class can be in any position in
++ * the array. Invoking the method twice with exactly the same types
++ * in the same order will return the same adapter class, any
++ * reordering of types or even addition or removal of redundant types
++ * (i.e., interfaces that other types in the list already
++ * implement/extend, or {@code java.lang.Object} in a list of types
++ * consisting purely of interfaces) will result in a different
++ * adapter class, even though those adapter classes are functionally
++ * identical; we deliberately don't want to incur the additional
++ * processing cost of canonicalizing type lists.
++ * @param classOverrides a JavaScript object with functions serving as the
++ * class-level overrides and implementations. These overrides are
++ * defined for all instances of the class, and can be further
++ * overridden on a per-instance basis by passing additional objects
++ * in the constructor.
++ * @param lookup the lookup object identifying the caller class. The
++ * generated adapter class will have the protection domain of the
++ * caller class iff the lookup object is full-strength, otherwise it
++ * will be completely unprivileged.
++ *
++ * @return an adapter class. See this class' documentation for details on
++ * the generated adapter class.
++ *
++ * @throws ECMAException with a TypeError if the adapter class can not be
++ * generated because the original class is final, non-public, or has
++ * no public or protected constructors.
+ */
+ public static StaticClass getAdapterClassFor(final Class<?>[] types, final ScriptObject classOverrides, final MethodHandles.Lookup lookup) {
+ return getAdapterClassFor(types, classOverrides, getProtectionDomain(lookup));
+@@ -148,15 +167,23 @@
+ }
+
+ /**
+- * Returns a method handle representing a constructor that takes a single argument of the source type (which,
+- * really, should be one of {@link ScriptObject}, {@link ScriptFunction}, or {@link Object}, and returns an instance
+- * of the adapter for the target type. Used to implement the function autoconverters as well as the Nashorn's
+- * JSR-223 script engine's {@code getInterface()} method.
+- * @param sourceType the source type; should be either {@link ScriptObject}, {@link ScriptFunction}, or
+- * {@link Object}. In case of {@code Object}, it will return a method handle that dispatches to either the script
+- * object or function constructor at invocation based on the actual argument.
++ * Returns a method handle representing a constructor that takes a single
++ * argument of the source type (which, really, should be one of {@link ScriptObject},
++ * {@link ScriptFunction}, or {@link Object}, and returns an instance of the
++ * adapter for the target type. Used to implement the function autoconverters
++ * as well as the Nashorn JSR-223 script engine's {@code getInterface()}
++ * method.
++ *
++ * @param sourceType the source type; should be either {@link ScriptObject},
++ * {@link ScriptFunction}, or {@link Object}. In case of {@code Object},
++ * it will return a method handle that dispatches to either the script
++ * object or function constructor at invocation based on the actual
++ * argument.
+ * @param targetType the target type, for which adapter instances will be created
++ * @param lookup method handle lookup to use
++ *
+ * @return the constructor method handle.
++ *
+ * @throws Exception if anything goes wrong
+ */
+ public static MethodHandle getConstructor(final Class<?> sourceType, final Class<?> targetType, final MethodHandles.Lookup lookup) throws Exception {
+@@ -168,13 +195,18 @@
+ }
+
+ /**
+- * Returns whether an instance of the specified class/interface can be generated from a ScriptFunction. Returns true
+- * iff: the adapter for the class/interface can be created, it is abstract (this includes interfaces), it has at
+- * least one abstract method, all the abstract methods share the same name, and it has a public or protected default
+- * constructor. Note that invoking this class will most likely result in the adapter class being defined in the JVM
+- * if it hasn't been already.
++ * Returns whether an instance of the specified class/interface can be
++ * generated from a ScriptFunction. Returns {@code true} iff: the adapter
++ * for the class/interface can be created, it is abstract (this includes
++ * interfaces), it has at least one abstract method, all the abstract
++ * methods share the same name, and it has a public or protected default
++ * constructor. Note that invoking this class will most likely result in the
++ * adapter class being defined in the JVM if it hasn't been already.
++ *
+ * @param clazz the inspected class
+- * @return true iff an instance of the specified class/interface can be generated from a ScriptFunction.
++ *
++ * @return {@code true} iff an instance of the specified class/interface can
++ * be generated from a ScriptFunction.
+ */
+ static boolean isAutoConvertibleFromFunction(final Class<?> clazz) {
+ return getAdapterInfo(new Class<?>[] { clazz }).autoConvertibleFromFunction;
+@@ -184,7 +216,7 @@
+ final ClassAndLoader definingClassAndLoader = ClassAndLoader.getDefiningClassAndLoader(types);
+
+ final Map<List<Class<?>>, AdapterInfo> adapterInfoMap = ADAPTER_INFO_MAPS.get(definingClassAndLoader.getRepresentativeClass());
+- final List<Class<?>> typeList = types.length == 1 ? getSingletonClassList(types[0]) : Arrays.asList(types.clone());
++ final List<Class<?>> typeList = types.length == 1 ? Collections.<Class<?>>singletonList(types[0]) : Arrays.asList(types.clone());
+ AdapterInfo adapterInfo;
+ synchronized(adapterInfoMap) {
+ adapterInfo = adapterInfoMap.get(typeList);
+@@ -196,14 +228,11 @@
+ return adapterInfo;
+ }
+
+- @SuppressWarnings({ "unchecked", "rawtypes" })
+- private static List<Class<?>> getSingletonClassList(final Class<?> clazz) {
+- return (List)Collections.singletonList(clazz);
+- }
+-
+ /**
+ * For a given class, create its adapter class and associated info.
++ *
+ * @param type the class for which the adapter is created
++ *
+ * @return the adapter info for the class.
+ */
+ private static AdapterInfo createAdapterInfo(final Class<?>[] types, final ClassAndLoader definingClassAndLoader) {
+@@ -241,6 +270,8 @@
+ return new AdapterInfo(effectiveSuperClass, interfaces, definingClassAndLoader);
+ } catch (final AdaptationException e) {
+ return new AdapterInfo(e.getAdaptationResult());
++ } catch (final RuntimeException e) {
++ return new AdapterInfo(new AdaptationResult(AdaptationResult.Outcome.ERROR_OTHER, Arrays.toString(types), e.toString()));
+ }
+ }
+ }, CREATE_ADAPTER_INFO_ACC_CTXT);
+@@ -314,11 +345,14 @@
+ }
+
+ /**
+- * Choose between the passed class loader and the class loader that defines the ScriptObject class, based on which
+- * of the two can see the classes in both.
+- * @param classAndLoader the loader and a representative class from it that will be used to add the generated
+- * adapter to its ADAPTER_INFO_MAPS.
++ * Choose between the passed class loader and the class loader that defines the
++ * ScriptObject class, based on which of the two can see the classes in both.
++ *
++ * @param classAndLoader the loader and a representative class from it that will
++ * be used to add the generated adapter to its ADAPTER_INFO_MAPS.
++ *
+ * @return the class loader that sees both the specified class and Nashorn classes.
++ *
+ * @throws IllegalStateException if no such class loader is found.
+ */
+ private static ClassLoader findCommonLoader(final ClassAndLoader classAndLoader) throws AdaptationException {
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/JavaArgumentConverters.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/JavaArgumentConverters.java Wed Jul 01 21:54:30 2015 -0700
+@@ -27,6 +27,7 @@
+
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
+ import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
++import static jdk.nashorn.internal.runtime.JSType.isString;
+ import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
+
+ import java.lang.invoke.MethodHandle;
+@@ -78,7 +79,7 @@
+ }
+
+ if (obj == UNDEFINED) {
+- // NOTE: same reasoning for FindBugs NP_BOOLEAN_RETURN_NUL warning as in the preceding comment.
++ // NOTE: same reasoning for FindBugs NP_BOOLEAN_RETURN_NULL warning as in the preceding comment.
+ return null;
+ }
+
+@@ -87,7 +88,7 @@
+ return num != 0 && !Double.isNaN(num);
+ }
+
+- if (obj instanceof String || obj instanceof ConsString) {
++ if (isString(obj)) {
+ return ((CharSequence) obj).length() > 0;
+ }
+
+@@ -207,7 +208,7 @@
+ return f.longValue();
+ } else if (obj instanceof Number) {
+ return ((Number)obj).longValue();
+- } else if (obj instanceof String || obj instanceof ConsString) {
++ } else if (isString(obj)) {
+ return JSType.toLong(obj);
+ } else if (obj instanceof Boolean) {
+ return (Boolean)obj ? 1L : 0L;
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/JavaSuperAdapter.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/JavaSuperAdapter.java Wed Jul 01 21:54:30 2015 -0700
+@@ -25,6 +25,8 @@
+
+ package jdk.nashorn.internal.runtime.linker;
+
++import java.util.Objects;
++
+ /**
+ * Represents a an adapter for invoking superclass methods on an adapter instance generated by
+ * {@code JavaAdapterBytecodeGenerator}. Note that objects of this class are just wrappers around the adapter instances,
+@@ -34,8 +36,7 @@
+ private final Object adapter;
+
+ JavaSuperAdapter(final Object adapter) {
+- adapter.getClass(); // NPE check
+- this.adapter = adapter;
++ this.adapter = Objects.requireNonNull(adapter);
+ }
+
+ public Object getAdapter() {
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornBeansLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornBeansLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -40,10 +40,11 @@
+ import jdk.internal.dynalink.linker.GuardingDynamicLinker;
+ import jdk.internal.dynalink.linker.LinkRequest;
+ import jdk.internal.dynalink.linker.LinkerServices;
++import jdk.internal.dynalink.linker.MethodHandleTransformer;
++import jdk.internal.dynalink.support.DefaultInternalObjectFilter;
+ import jdk.internal.dynalink.support.Guards;
+ import jdk.internal.dynalink.support.Lookup;
+ import jdk.nashorn.api.scripting.ScriptUtils;
+-import jdk.nashorn.internal.objects.NativeArray;
+ import jdk.nashorn.internal.runtime.ConsString;
+ import jdk.nashorn.internal.runtime.Context;
+ import jdk.nashorn.internal.runtime.ScriptObject;
+@@ -52,10 +53,14 @@
+
+ /**
+ * This linker delegates to a {@code BeansLinker} but passes it a special linker services object that has a modified
+- * {@code asType} method that will ensure that we never pass internal engine objects that should not be externally
+- * observable (currently ConsString and ScriptObject) to Java APIs, but rather that we flatten it into a String. We can't just add
+- * this functionality as custom converters via {@code GuaardingTypeConverterFactory}, since they are not consulted when
+- * the target method handle parameter signature is {@code Object}.
++ * {@code compareConversion} method that favors conversion of {@link ConsString} to either {@link String} or
++ * {@link CharSequence}. It also provides a {@link #createHiddenObjectFilter()} method for use with bootstrap that will
++ * ensure that we never pass internal engine objects that should not be externally observable (currently ConsString and
++ * ScriptObject) to Java APIs, but rather that we flatten it into a String. We can't just add this functionality as
++ * custom converters via {@code GuaardingTypeConverterFactory}, since they are not consulted when
++ * the target method handle parameter signature is {@code Object}. This linker also makes sure that primitive
++ * {@link String} operations can be invoked on a {@link ConsString}, and allows invocation of objects implementing
++ * the {@link FunctionalInterface} attribute.
+ */
+ public class NashornBeansLinker implements GuardingDynamicLinker {
+ // System property to control whether to wrap ScriptObject->ScriptObjectMirror for
+@@ -63,16 +68,12 @@
+ private static final boolean MIRROR_ALWAYS = Options.getBooleanProperty("nashorn.mirror.always", true);
+
+ private static final MethodHandle EXPORT_ARGUMENT;
+- private static final MethodHandle EXPORT_NATIVE_ARRAY;
+- private static final MethodHandle EXPORT_SCRIPT_OBJECT;
+ private static final MethodHandle IMPORT_RESULT;
+ private static final MethodHandle FILTER_CONSSTRING;
+
+ static {
+ final Lookup lookup = new Lookup(MethodHandles.lookup());
+ EXPORT_ARGUMENT = lookup.findOwnStatic("exportArgument", Object.class, Object.class);
+- EXPORT_NATIVE_ARRAY = lookup.findOwnStatic("exportNativeArray", Object.class, NativeArray.class);
+- EXPORT_SCRIPT_OBJECT = lookup.findOwnStatic("exportScriptObject", Object.class, ScriptObject.class);
+ IMPORT_RESULT = lookup.findOwnStatic("importResult", Object.class, Object.class);
+ FILTER_CONSSTRING = lookup.findOwnStatic("consStringFilter", Object.class, Object.class);
+ }
+@@ -115,9 +116,10 @@
+ }
+ return new GuardedInvocation(
+ // drop 'thiz' passed from the script.
+- MH.dropArguments(desc.getLookup().unreflect(m), 1, callType.parameterType(1)),
+- Guards.getInstanceOfGuard(m.getDeclaringClass())).asTypeSafeReturn(
+- new NashornBeansLinkerServices(linkerServices), callType);
++ MH.dropArguments(linkerServices.filterInternalObjects(desc.getLookup().unreflect(m)), 1,
++ callType.parameterType(1)), Guards.getInstanceOfGuard(
++ m.getDeclaringClass())).asTypeSafeReturn(
++ new NashornBeansLinkerServices(linkerServices), callType);
+ }
+ }
+ return getGuardedInvocation(beansLinker, linkRequest, linkerServices);
+@@ -141,21 +143,6 @@
+ return exportArgument(arg, MIRROR_ALWAYS);
+ }
+
+- @SuppressWarnings("unused")
+- private static Object exportNativeArray(final NativeArray arg) {
+- return exportArgument(arg, MIRROR_ALWAYS);
+- }
+-
+- @SuppressWarnings("unused")
+- private static Object exportScriptObject(final ScriptObject arg) {
+- return exportArgument(arg, MIRROR_ALWAYS);
+- }
+-
+- @SuppressWarnings("unused")
+- private static Object exportScriptArray(final NativeArray arg) {
+- return exportArgument(arg, MIRROR_ALWAYS);
+- }
+-
+ static Object exportArgument(final Object arg, final boolean mirrorAlways) {
+ if (arg instanceof ConsString) {
+ return arg.toString();
+@@ -208,6 +195,10 @@
+ return FUNCTIONAL_IFACE_METHOD.get(clazz);
+ }
+
++ static MethodHandleTransformer createHiddenObjectFilter() {
++ return new DefaultInternalObjectFilter(EXPORT_ARGUMENT, MIRROR_ALWAYS ? IMPORT_RESULT : null);
++ }
++
+ private static class NashornBeansLinkerServices implements LinkerServices {
+ private final LinkerServices linkerServices;
+
+@@ -217,50 +208,7 @@
+
+ @Override
+ public MethodHandle asType(final MethodHandle handle, final MethodType fromType) {
+- final MethodType handleType = handle.type();
+- final int paramCount = handleType.parameterCount();
+- assert fromType.parameterCount() == handleType.parameterCount();
+-
+- MethodType newFromType = fromType;
+- MethodHandle[] filters = null;
+- for(int i = 0; i < paramCount; ++i) {
+- final MethodHandle filter = argConversionFilter(handleType.parameterType(i), fromType.parameterType(i));
+- if (filter != null) {
+- if (filters == null) {
+- filters = new MethodHandle[paramCount];
+- }
+- // "erase" specific type with Object type or else we'll get filter mismatch
+- newFromType = newFromType.changeParameterType(i, Object.class);
+- filters[i] = filter;
+- }
+- }
+-
+- final MethodHandle typed = linkerServices.asType(handle, newFromType);
+- MethodHandle result = filters != null ? MethodHandles.filterArguments(typed, 0, filters) : typed;
+- // Filter Object typed return value for possible ScriptObjectMirror. We convert
+- // ScriptObjectMirror as ScriptObject (if it is mirror from current global).
+- if (MIRROR_ALWAYS && areBothObjects(handleType.returnType(), fromType.returnType())) {
+- result = MethodHandles.filterReturnValue(result, IMPORT_RESULT);
+- }
+-
+- return result;
+- }
+-
+- private static MethodHandle argConversionFilter(final Class<?> handleType, final Class<?> fromType) {
+- if (handleType == Object.class) {
+- if (fromType == Object.class) {
+- return EXPORT_ARGUMENT;
+- } else if (fromType == NativeArray.class) {
+- return EXPORT_NATIVE_ARRAY;
+- } else if (fromType == ScriptObject.class) {
+- return EXPORT_SCRIPT_OBJECT;
+- }
+- }
+- return null;
+- }
+-
+- private static boolean areBothObjects(final Class<?> handleType, final Class<?> fromType) {
+- return handleType == Object.class && fromType == Object.class;
++ return linkerServices.asType(handle, fromType);
+ }
+
+ @Override
+@@ -296,5 +244,10 @@
+ }
+ return linkerServices.compareConversion(sourceType, targetType1, targetType2);
+ }
++
++ @Override
++ public MethodHandle filterInternalObjects(final MethodHandle target) {
++ return linkerServices.filterInternalObjects(target);
++ }
+ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornBottomLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornBottomLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -86,6 +86,9 @@
+ final String operator = desc.getFirstOperator();
+ switch (operator) {
+ case "new":
++ if(BeansLinker.isDynamicConstructor(self)) {
++ throw typeError("no.constructor.matches.args", ScriptRuntime.safeToString(self));
++ }
+ if(BeansLinker.isDynamicMethod(self)) {
+ throw typeError("method.not.constructor", ScriptRuntime.safeToString(self));
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornGuards.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornGuards.java Wed Jul 01 21:54:30 2015 -0700
+@@ -33,7 +33,6 @@
+ import jdk.internal.dynalink.CallSiteDescriptor;
+ import jdk.internal.dynalink.linker.LinkRequest;
+ import jdk.nashorn.api.scripting.JSObject;
+-import jdk.nashorn.internal.codegen.ObjectClassGenerator;
+ import jdk.nashorn.internal.objects.Global;
+ import jdk.nashorn.internal.runtime.Property;
+ import jdk.nashorn.internal.runtime.PropertyMap;
+@@ -123,7 +122,7 @@
+ */
+ static boolean needsGuard(final Property property, final CallSiteDescriptor desc) {
+ return property == null || property.isConfigurable()
+- || property.isBound() || !ObjectClassGenerator.OBJECT_FIELDS_ONLY
++ || property.isBound() || property.hasDualFields()
+ || !NashornCallSiteDescriptor.isFastScope(desc) || property.canChangeType();
+ }
+
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -29,13 +29,15 @@
+
+ import java.lang.invoke.MethodHandle;
+ import java.lang.invoke.MethodHandles;
+-import java.lang.invoke.MethodHandles.Lookup;
++import java.lang.invoke.MethodType;
+ import java.lang.reflect.Modifier;
+ import java.security.AccessController;
+ import java.security.PrivilegedAction;
++import java.util.Collection;
+ import java.util.Deque;
+ import java.util.List;
+ import java.util.Map;
++import java.util.Queue;
+ import javax.script.Bindings;
+ import jdk.internal.dynalink.CallSiteDescriptor;
+ import jdk.internal.dynalink.linker.ConversionComparator;
+@@ -47,11 +49,13 @@
+ import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
+ import jdk.internal.dynalink.support.Guards;
+ import jdk.internal.dynalink.support.LinkerServicesImpl;
++import jdk.internal.dynalink.support.Lookup;
+ import jdk.nashorn.api.scripting.JSObject;
+ import jdk.nashorn.api.scripting.ScriptObjectMirror;
+ import jdk.nashorn.api.scripting.ScriptUtils;
+ import jdk.nashorn.internal.objects.NativeArray;
+ import jdk.nashorn.internal.runtime.JSType;
++import jdk.nashorn.internal.runtime.ListAdapter;
+ import jdk.nashorn.internal.runtime.ScriptFunction;
+ import jdk.nashorn.internal.runtime.ScriptObject;
+ import jdk.nashorn.internal.runtime.Undefined;
+@@ -167,7 +171,7 @@
+ return null;
+ }
+
+- private static Lookup getCurrentLookup() {
++ private static java.lang.invoke.MethodHandles.Lookup getCurrentLookup() {
+ final LinkRequest currentRequest = AccessController.doPrivileged(new PrivilegedAction<LinkRequest>() {
+ @Override
+ public LinkRequest run() {
+@@ -179,12 +183,12 @@
+
+ /**
+ * Returns a guarded invocation that converts from a source type that is NativeArray to a Java array or List or
+- * Deque type.
++ * Queue or Deque or Collection type.
+ * @param sourceType the source type (presumably NativeArray a superclass of it)
+- * @param targetType the target type (presumably an array type, or List or Deque)
++ * @param targetType the target type (presumably an array type, or List or Queue, or Deque, or Collection)
+ * @return a guarded invocation that converts from the source type to the target type. null is returned if
+ * either the source type is neither NativeArray, nor a superclass of it, or if the target type is not an array
+- * type, List, or Deque.
++ * type, List, Queue, Deque, or Collection.
+ */
+ private static GuardedInvocation getArrayConverter(final Class<?> sourceType, final Class<?> targetType) {
+ final boolean isSourceTypeNativeArray = sourceType == NativeArray.class;
+@@ -195,12 +199,14 @@
+ final MethodHandle guard = isSourceTypeGeneric ? IS_NATIVE_ARRAY : null;
+ if(targetType.isArray()) {
+ return new GuardedInvocation(ARRAY_CONVERTERS.get(targetType), guard);
+- }
+- if(targetType == List.class) {
+- return new GuardedInvocation(JSType.TO_JAVA_LIST.methodHandle(), guard);
+- }
+- if(targetType == Deque.class) {
+- return new GuardedInvocation(JSType.TO_JAVA_DEQUE.methodHandle(), guard);
++ } else if(targetType == List.class) {
++ return new GuardedInvocation(TO_LIST, guard);
++ } else if(targetType == Deque.class) {
++ return new GuardedInvocation(TO_DEQUE, guard);
++ } else if(targetType == Queue.class) {
++ return new GuardedInvocation(TO_QUEUE, guard);
++ } else if(targetType == Collection.class) {
++ return new GuardedInvocation(TO_COLLECTION, guard);
+ }
+ }
+ return null;
+@@ -216,10 +222,11 @@
+ // Could've also used (targetType.isAssignableFrom(ScriptObjectMirror.class) && targetType != Object.class) but
+ // it's probably better to explicitly spell out the supported target types
+ if (targetType == Map.class || targetType == Bindings.class || targetType == JSObject.class || targetType == ScriptObjectMirror.class) {
+- if(ScriptObject.class.isAssignableFrom(sourceType)) {
++ if (ScriptObject.class.isAssignableFrom(sourceType)) {
+ return new GuardedInvocation(CREATE_MIRROR);
++ } else if (sourceType.isAssignableFrom(ScriptObject.class) || sourceType.isInterface()) {
++ return new GuardedInvocation(CREATE_MIRROR, IS_SCRIPT_OBJECT);
+ }
+- return new GuardedInvocation(CREATE_MIRROR, IS_SCRIPT_OBJECT);
+ }
+ return null;
+ }
+@@ -285,6 +292,23 @@
+ private static final MethodHandle IS_NASHORN_OR_UNDEFINED_TYPE = findOwnMH("isNashornTypeOrUndefined", Boolean.TYPE, Object.class);
+ private static final MethodHandle CREATE_MIRROR = findOwnMH("createMirror", Object.class, Object.class);
+
++ private static final MethodHandle TO_COLLECTION;
++ private static final MethodHandle TO_DEQUE;
++ private static final MethodHandle TO_LIST;
++ private static final MethodHandle TO_QUEUE;
++ static {
++ final MethodHandle listAdapterCreate = new Lookup(MethodHandles.lookup()).findStatic(
++ ListAdapter.class, "create", MethodType.methodType(ListAdapter.class, Object.class));
++ TO_COLLECTION = asReturning(listAdapterCreate, Collection.class);
++ TO_DEQUE = asReturning(listAdapterCreate, Deque.class);
++ TO_LIST = asReturning(listAdapterCreate, List.class);
++ TO_QUEUE = asReturning(listAdapterCreate, Queue.class);
++ }
++
++ private static MethodHandle asReturning(final MethodHandle mh, final Class<?> nrtype) {
++ return mh.asType(mh.type().changeReturnType(nrtype));
++ }
++
+ @SuppressWarnings("unused")
+ private static boolean isNashornTypeOrUndefined(final Object obj) {
+ return obj instanceof ScriptObject || obj instanceof Undefined;
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornPrimitiveLinker.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/NashornPrimitiveLinker.java Wed Jul 01 21:54:30 2015 -0700
+@@ -39,6 +39,7 @@
+ import jdk.internal.dynalink.support.TypeUtilities;
+ import jdk.nashorn.internal.objects.Global;
+ import jdk.nashorn.internal.runtime.ConsString;
++import jdk.nashorn.internal.runtime.JSType;
+ import jdk.nashorn.internal.runtime.ScriptRuntime;
+
+ /**
+@@ -170,7 +171,7 @@
+
+ @SuppressWarnings("unused")
+ private static boolean isJavaScriptPrimitive(final Object o) {
+- return o instanceof String || o instanceof Boolean || o instanceof Number || o instanceof ConsString || o == null;
++ return JSType.isString(o) || o instanceof Boolean || o instanceof Number || o == null;
+ }
+
+ private static final MethodHandle GUARD_PRIMITIVE = findOwnMH("isJavaScriptPrimitive", boolean.class, Object.class);
+--- ./nashorn/src/jdk/nashorn/internal/runtime/linker/PrimitiveLookup.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/linker/PrimitiveLookup.java Wed Jul 01 21:54:30 2015 -0700
+@@ -26,17 +26,23 @@
+ package jdk.nashorn.internal.runtime.linker;
+
+ import static jdk.nashorn.internal.lookup.Lookup.MH;
++import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
++
+ import java.lang.invoke.MethodHandle;
++import java.lang.invoke.MethodHandles;
+ import java.lang.invoke.MethodType;
+ import java.lang.invoke.SwitchPoint;
+ import jdk.internal.dynalink.CallSiteDescriptor;
+ import jdk.internal.dynalink.linker.GuardedInvocation;
+ import jdk.internal.dynalink.linker.LinkRequest;
++import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
+ import jdk.internal.dynalink.support.Guards;
+ import jdk.nashorn.internal.runtime.Context;
+ import jdk.nashorn.internal.runtime.FindProperty;
+ import jdk.nashorn.internal.runtime.GlobalConstants;
++import jdk.nashorn.internal.runtime.JSType;
+ import jdk.nashorn.internal.runtime.ScriptObject;
++import jdk.nashorn.internal.runtime.ScriptRuntime;
+ import jdk.nashorn.internal.runtime.UserAccessorProperty;
+
+ /**
+@@ -46,6 +52,11 @@
+ */
+ public final class PrimitiveLookup {
+
++ /** Method handle to link setters on primitive base. See ES5 8.7.2. */
++ private static final MethodHandle PRIMITIVE_SETTER = findOwnMH("primitiveSetter",
++ MH.type(void.class, ScriptObject.class, Object.class, Object.class, boolean.class, Object.class));
++
++
+ private PrimitiveLookup() {
+ }
+
+@@ -87,40 +98,58 @@
+ final ScriptObject wrappedReceiver, final MethodHandle wrapFilter,
+ final MethodHandle protoFilter) {
+ final CallSiteDescriptor desc = request.getCallSiteDescriptor();
++ final String name;
++ final FindProperty find;
+
+- //checks whether the property name is hard-coded in the call-site (i.e. a getProp vs a getElem, or setProp vs setElem)
+- //if it is we can make assumptions on the property: that if it is not defined on primitive wrapper itself it never will be.
+- //so in that case we can skip creation of primitive wrapper and start our search with the prototype.
+ if (desc.getNameTokenCount() > 2) {
+- final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
+- final FindProperty find = wrappedReceiver.findProperty(name, true);
++ name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
++ find = wrappedReceiver.findProperty(name, true);
++ } else {
++ name = null;
++ find = null;
++ }
+
+- if (find == null) {
+- // Give up early, give chance to BeanLinker and NashornBottomLinker to deal with it.
+- return null;
+- }
++ final String firstOp = CallSiteDescriptorFactory.tokenizeOperators(desc).get(0);
+
+- final SwitchPoint sp = find.getProperty().getBuiltinSwitchPoint(); //can use this instead of proto filter
+- if (sp instanceof Context.BuiltinSwitchPoint && !sp.hasBeenInvalidated()) {
+- return new GuardedInvocation(GlobalConstants.staticConstantGetter(find.getObjectValue()), guard, sp, null);
+- }
++ switch (firstOp) {
++ case "getProp":
++ case "getElem":
++ case "getMethod":
++ //checks whether the property name is hard-coded in the call-site (i.e. a getProp vs a getElem, or setProp vs setElem)
++ //if it is we can make assumptions on the property: that if it is not defined on primitive wrapper itself it never will be.
++ //so in that case we can skip creation of primitive wrapper and start our search with the prototype.
++ if (name != null) {
++ if (find == null) {
++ // Give up early, give chance to BeanLinker and NashornBottomLinker to deal with it.
++ return null;
++ }
+
+- if (find.isInherited() && !(find.getProperty() instanceof UserAccessorProperty)) {
+- // If property is found in the prototype object bind the method handle directly to
+- // the proto filter instead of going through wrapper instantiation below.
+- final ScriptObject proto = wrappedReceiver.getProto();
+- final GuardedInvocation link = proto.lookup(desc, request);
++ final SwitchPoint sp = find.getProperty().getBuiltinSwitchPoint(); //can use this instead of proto filter
++ if (sp instanceof Context.BuiltinSwitchPoint && !sp.hasBeenInvalidated()) {
++ return new GuardedInvocation(GlobalConstants.staticConstantGetter(find.getObjectValue()), guard, sp, null);
++ }
+
+- if (link != null) {
+- final MethodHandle invocation = link.getInvocation(); //this contains the builtin switchpoint
++ if (find.isInherited() && !(find.getProperty() instanceof UserAccessorProperty)) {
++ // If property is found in the prototype object bind the method handle directly to
++ // the proto filter instead of going through wrapper instantiation below.
++ final ScriptObject proto = wrappedReceiver.getProto();
++ final GuardedInvocation link = proto.lookup(desc, request);
+
+- final MethodHandle adaptedInvocation = MH.asType(invocation, invocation.type().changeParameterType(0, Object.class));
+- final MethodHandle method = MH.filterArguments(adaptedInvocation, 0, protoFilter);
+- final MethodHandle protoGuard = MH.filterArguments(link.getGuard(), 0, protoFilter);
+-
+- return new GuardedInvocation(method, NashornGuards.combineGuards(guard, protoGuard));
++ if (link != null) {
++ final MethodHandle invocation = link.getInvocation(); //this contains the builtin switchpoint
++ final MethodHandle adaptedInvocation = MH.asType(invocation, invocation.type().changeParameterType(0, Object.class));
++ final MethodHandle method = MH.filterArguments(adaptedInvocation, 0, protoFilter);
++ final MethodHandle protoGuard = MH.filterArguments(link.getGuard(), 0, protoFilter);
++ return new GuardedInvocation(method, NashornGuards.combineGuards(guard, protoGuard));
++ }
+ }
+ }
++ break;
++ case "setProp":
++ case "setElem":
++ return getPrimitiveSetter(name, guard, wrapFilter, NashornCallSiteDescriptor.isStrict(desc));
++ default:
++ break;
+ }
+
+ final GuardedInvocation link = wrappedReceiver.lookup(desc, request);
+@@ -138,4 +167,41 @@
+
+ return null;
+ }
++
++ private static GuardedInvocation getPrimitiveSetter(final String name, final MethodHandle guard,
++ final MethodHandle wrapFilter, final boolean isStrict) {
++ MethodHandle filter = MH.asType(wrapFilter, wrapFilter.type().changeReturnType(ScriptObject.class));
++ final MethodHandle target;
++
++ if (name == null) {
++ filter = MH.dropArguments(filter, 1, Object.class, Object.class);
++ target = MH.insertArguments(PRIMITIVE_SETTER, 3, isStrict);
++ } else {
++ filter = MH.dropArguments(filter, 1, Object.class);
++ target = MH.insertArguments(PRIMITIVE_SETTER, 2, name, isStrict);
++ }
++
++ return new GuardedInvocation(MH.foldArguments(target, filter), guard);
++ }
++
++
++ @SuppressWarnings("unused")
++ private static void primitiveSetter(final ScriptObject wrappedSelf, final Object self, final Object key,
++ final boolean strict, final Object value) {
++ // See ES5.1 8.7.2 PutValue (V, W)
++ final String name = JSType.toString(key);
++ final FindProperty find = wrappedSelf.findProperty(name, true);
++ if (find == null || !(find.getProperty() instanceof UserAccessorProperty) || !find.getProperty().isWritable()) {
++ if (strict) {
++ throw typeError("property.not.writable", name, ScriptRuntime.safeToString(self));
++ }
++ return;
++ }
++ // property found and is a UserAccessorProperty
++ find.setValue(value, strict);
++ }
++
++ private static MethodHandle findOwnMH(final String name, final MethodType type) {
++ return MH.findStatic(MethodHandles.lookup(), PrimitiveLookup.class, name, type);
++ }
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/options/Options.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/options/Options.java Wed Jul 01 21:54:30 2015 -0700
+@@ -42,6 +42,7 @@
+ import java.util.Locale;
+ import java.util.Map;
+ import java.util.MissingResourceException;
++import java.util.Objects;
+ import java.util.PropertyPermission;
+ import java.util.ResourceBundle;
+ import java.util.StringTokenizer;
+@@ -135,6 +136,12 @@
+ return options.toString();
+ }
+
++ private static void checkPropertyName(final String name) {
++ if (! Objects.requireNonNull(name).startsWith("nashorn.")) {
++ throw new IllegalArgumentException(name);
++ }
++ }
++
+ /**
+ * Convenience function for getting system properties in a safe way
+
+@@ -143,11 +150,7 @@
+ * @return true if set to true, default value if unset or set to false
+ */
+ public static boolean getBooleanProperty(final String name, final Boolean defValue) {
+- name.getClass(); // null check
+- if (!name.startsWith("nashorn.")) {
+- throw new IllegalArgumentException(name);
+- }
+-
++ checkPropertyName(name);
+ return AccessController.doPrivileged(
+ new PrivilegedAction<Boolean>() {
+ @Override
+@@ -184,11 +187,7 @@
+ * @return string property if set or default value
+ */
+ public static String getStringProperty(final String name, final String defValue) {
+- name.getClass(); // null check
+- if (! name.startsWith("nashorn.")) {
+- throw new IllegalArgumentException(name);
+- }
+-
++ checkPropertyName(name);
+ return AccessController.doPrivileged(
+ new PrivilegedAction<String>() {
+ @Override
+@@ -211,11 +210,7 @@
+ * @return integer property if set or default value
+ */
+ public static int getIntProperty(final String name, final int defValue) {
+- name.getClass(); // null check
+- if (! name.startsWith("nashorn.")) {
+- throw new IllegalArgumentException(name);
+- }
+-
++ checkPropertyName(name);
+ return AccessController.doPrivileged(
+ new PrivilegedAction<Integer>() {
+ @Override
+@@ -423,9 +418,17 @@
+ public void process(final String[] args) {
+ final LinkedList<String> argList = new LinkedList<>();
+ addSystemProperties(NASHORN_ARGS_PREPEND_PROPERTY, argList);
++ processArgList(argList);
++ assert argList.isEmpty();
+ Collections.addAll(argList, args);
++ processArgList(argList);
++ assert argList.isEmpty();
+ addSystemProperties(NASHORN_ARGS_PROPERTY, argList);
++ processArgList(argList);
++ assert argList.isEmpty();
++ }
+
++ private void processArgList(final LinkedList<String> argList) {
+ while (!argList.isEmpty()) {
+ final String arg = argList.remove(0);
+
+--- ./nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java Wed Jul 01 21:54:30 2015 -0700
+@@ -26,7 +26,7 @@
+ package jdk.nashorn.internal.runtime.regexp;
+
+ import java.util.Collections;
+-import java.util.Set;
++import java.util.Map;
+ import java.util.WeakHashMap;
+ import jdk.nashorn.internal.runtime.ParserException;
+ import jdk.nashorn.internal.runtime.options.Options;
+@@ -45,11 +45,10 @@
+ /** Weak cache of already validated regexps - when reparsing, we don't, for example
+ * need to recompile (reverify) all regexps that have previously been parsed by this
+ * RegExpFactory in a previous compilation. This saves significant time in e.g. avatar
+- * startup */
+- private static final Set<String> VALID_CACHE_SET =
+- Collections.newSetFromMap(
+- Collections.synchronizedMap(
+- new WeakHashMap<String, Boolean>()));
++ * startup
++ */
++ private static final Map<String, RegExp> REGEXP_CACHE =
++ Collections.synchronizedMap(new WeakHashMap<String, RegExp>());
+
+ static {
+ final String impl = Options.getStringProperty("nashorn.regexp.impl", JONI);
+@@ -87,7 +86,13 @@
+ * @throws ParserException if invalid source or flags
+ */
+ public static RegExp create(final String pattern, final String flags) {
+- return instance.compile(pattern, flags);
++ final String key = pattern + "/" + flags;
++ RegExp regexp = REGEXP_CACHE.get(key);
++ if (regexp == null) {
++ regexp = instance.compile(pattern, flags);
++ REGEXP_CACHE.put(key, regexp);
++ }
++ return regexp;
+ }
+
+ /**
+@@ -98,11 +103,8 @@
+ *
+ * @throws ParserException if invalid source or flags
+ */
+- // @SuppressWarnings({"unused"})
+ public static void validate(final String pattern, final String flags) throws ParserException {
+- if (VALID_CACHE_SET.add(pattern + flags)) {
+- instance.compile(pattern, flags);
+- }
++ create(pattern, flags);
+ }
+
+ /**
+--- ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java Wed Jul 01 21:54:30 2015 -0700
+@@ -145,9 +145,6 @@
+ case TargetInfo.IS_EMPTY_MEM:
+ addOpcode(OPCode.NULL_CHECK_END_MEMST);
+ break;
+- case TargetInfo.IS_EMPTY_REC:
+- addOpcode(OPCode.NULL_CHECK_END_MEMST_PUSH);
+- break;
+ default:
+ break;
+ } // switch
+--- ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java Wed Jul 01 21:54:30 2015 -0700
+@@ -183,7 +183,6 @@
+ case OPCode.NULL_CHECK_START: opNullCheckStart(); continue;
+ case OPCode.NULL_CHECK_END: opNullCheckEnd(); continue;
+ case OPCode.NULL_CHECK_END_MEMST: opNullCheckEndMemST(); continue;
+- case OPCode.NULL_CHECK_END_MEMST_PUSH: opNullCheckEndMemSTPush(); continue;
+
+ case OPCode.JUMP: opJump(); continue;
+ case OPCode.PUSH: opPush(); continue;
+@@ -1025,29 +1024,6 @@
+ }
+ }
+
+- // USE_SUBEXP_CALL
+- private void opNullCheckEndMemSTPush() {
+- final int mem = code[ip++]; /* mem: null check id */
+-
+- int isNull;
+- if (Config.USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT) {
+- isNull = nullCheckMemStRec(mem, s);
+- } else {
+- isNull = nullCheckRec(mem, s);
+- }
+-
+- if (isNull != 0) {
+- if (Config.DEBUG_MATCH) {
+- Config.log.println("NULL_CHECK_END_MEMST_PUSH: skip id:" + mem + ", s:" + s);
+- }
+-
+- if (isNull == -1) {opFail(); return;}
+- nullCheckFound();
+- } else {
+- pushNullCheckEnd(mem);
+- }
+- }
+-
+ private void opJump() {
+ ip += code[ip] + 1;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java Wed Jul 01 21:54:30 2015 -0700
+@@ -229,6 +229,11 @@
+
+ /**
+ * @see <a href="http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt">http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt</a>
++ *
++ * @param code code
++ * @param ctype ctype
++ *
++ * @return isCodeCType
+ */
+ public static boolean isCodeCType(final int code, final int ctype) {
+ int type;
+--- ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java Wed Jul 01 21:54:30 2015 -0700
+@@ -19,7 +19,6 @@
+ */
+ package jdk.nashorn.internal.runtime.regexp.joni;
+
+-import static jdk.nashorn.internal.runtime.regexp.joni.BitStatus.bsAt;
+ import java.lang.ref.WeakReference;
+ import jdk.nashorn.internal.runtime.regexp.joni.constants.StackPopLevel;
+ import jdk.nashorn.internal.runtime.regexp.joni.constants.StackType;
+@@ -369,118 +368,9 @@
+ }
+ }
+
+- protected final int nullCheckRec(final int id, final int s) {
+- int level = 0;
+- int k = stk;
+- while (true) {
+- k--;
+- final StackEntry e = stack[k];
+-
+- if (e.type == NULL_CHECK_START) {
+- if (e.getNullCheckNum() == id) {
+- if (level == 0) {
+- return e.getNullCheckPStr() == s ? 1 : 0;
+- }
+- level--;
+- }
+- } else if (e.type == NULL_CHECK_END) {
+- level++;
+- }
+- }
+- }
+-
+ protected final int nullCheckMemSt(final int id, final int s) {
+- int k = stk;
+- int isNull;
+- while (true) {
+- k--;
+- StackEntry e = stack[k];
+-
+- if (e.type == NULL_CHECK_START) {
+- if (e.getNullCheckNum() == id) {
+- if (e.getNullCheckPStr() != s) {
+- isNull = 0;
+- break;
+- }
+- int endp;
+- isNull = 1;
+- while (k < stk) {
+- if (e.type == MEM_START) {
+- if (e.getMemEnd() == INVALID_INDEX) {
+- isNull = 0;
+- break;
+- }
+- if (bsAt(regex.btMemEnd, e.getMemNum())) {
+- endp = stack[e.getMemEnd()].getMemPStr();
+- } else {
+- endp = e.getMemEnd();
+- }
+- if (stack[e.getMemStart()].getMemPStr() != endp) {
+- isNull = 0;
+- break;
+- } else if (endp != s) {
+- isNull = -1; /* empty, but position changed */
+- }
+- }
+- k++;
+- e = stack[k]; // !!
+- }
+- break;
+- }
+- }
+- }
+- return isNull;
+- }
+-
+- protected final int nullCheckMemStRec(final int id, final int s) {
+- int level = 0;
+- int k = stk;
+- int isNull;
+- while (true) {
+- k--;
+- StackEntry e = stack[k];
+-
+- if (e.type == NULL_CHECK_START) {
+- if (e.getNullCheckNum() == id) {
+- if (level == 0) {
+- if (e.getNullCheckPStr() != s) {
+- isNull = 0;
+- break;
+- }
+- int endp;
+- isNull = 1;
+- while (k < stk) {
+- if (e.type == MEM_START) {
+- if (e.getMemEnd() == INVALID_INDEX) {
+- isNull = 0;
+- break;
+- }
+- if (bsAt(regex.btMemEnd, e.getMemNum())) {
+- endp = stack[e.getMemEnd()].getMemPStr();
+- } else {
+- endp = e.getMemEnd();
+- }
+- if (stack[e.getMemStart()].getMemPStr() != endp) {
+- isNull = 0;
+- break;
+- } else if (endp != s) {
+- isNull = -1; /* empty, but position changed */
+- }
+- }
+- k++;
+- e = stack[k];
+- }
+- break;
+- }
+- level--;
+- }
+- } else if (e.type == NULL_CHECK_END) {
+- if (e.getNullCheckNum() == id) {
+- level++;
+- }
+- }
+- }
+- return isNull;
++ // Return -1 here to cause operation to fail
++ return -nullCheck(id, s);
+ }
+
+ protected final int getRepeat(final int id) {
+--- ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Syntax.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Syntax.java Wed Jul 01 21:54:30 2015 -0700
+@@ -57,10 +57,10 @@
+ }
+ }
+
+- /**
+- * OP
+- *
+- */
++ //
++ // OP
++ //
++
+ protected boolean isOp(final int opm) {
+ return (op & opm) != 0;
+ }
+@@ -189,11 +189,10 @@
+ return isOp(OP_ESC_X_BRACE_HEX8);
+ }
+
++ //
++ // OP2
++ //
+
+- /**
+- * OP
+- *
+- */
+ protected boolean isOp2(final int opm) {
+ return (op2 & opm) != 0;
+ }
+@@ -278,10 +277,10 @@
+ return isOp2(OP2_INEFFECTIVE_ESCAPE);
+ }
+
+- /**
+- * BEHAVIOR
+- *
+- */
++ //
++ // BEHAVIOR
++ //
++
+ protected boolean isBehavior(final int bvm) {
+ return (behavior & bvm) != 0;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/constants/TargetInfo.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/constants/TargetInfo.java Wed Jul 01 21:54:30 2015 -0700
+@@ -24,5 +24,4 @@
+ final int ISNOT_EMPTY = 0;
+ final int IS_EMPTY = 1;
+ final int IS_EMPTY_MEM = 2;
+- final int IS_EMPTY_REC = 3;
+ }
+--- ./nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties Wed Jul 01 21:54:30 2015 -0700
+@@ -121,7 +121,7 @@
+ type.error.cannot.get.default.number=Cannot get default number value
+ type.error.cant.apply.with.to.null=Cannot apply "with" to null
+ type.error.cant.apply.with.to.undefined=Cannot apply "with" to undefined
+-type.error.cant.apply.with.to.non.scriptobject=Cannot apply "with" to non script object
++type.error.cant.apply.with.to.non.scriptobject=Cannot apply "with" to non script object. Consider using "with(Object.bindProperties('{'}, nonScriptObject))".
+ type.error.in.with.non.object=Right hand side of "in" cannot be non-Object, found {0}
+ type.error.prototype.not.an.object="prototype" of {0} is not an Object, it is {1}
+ type.error.cant.load.script=Cannot load script from {0}
+@@ -141,8 +141,10 @@
+ type.error.extend.ERROR_MULTIPLE_SUPERCLASSES=Can not extend multiple classes {0}. At most one of the specified types can be a class, the rest must all be interfaces.
+ type.error.extend.ERROR_NO_COMMON_LOADER=Can not find a common class loader for ScriptObject and {0}.
+ type.error.extend.ERROR_FINAL_FINALIZER=Can not extend class because {0} has a final finalize method.
++type.error.extend.ERROR_OTHER=Can not extend/implement {0} because of {1}
+ type.error.no.constructor.matches.args=Can not construct {0} with the passed arguments; they do not match any of its constructor signatures.
+ type.error.no.method.matches.args=Can not invoke method {0} with the passed arguments; they do not match any of its method signatures.
++type.error.no.constructor.matches.args=Can not create new object with constructor {0} with the passed arguments; they do not match any of its method signatures.
+ type.error.method.not.constructor=Java method {0} cannot be used as a constructor.
+ type.error.env.not.object=$ENV must be an Object.
+ type.error.unsupported.java.to.type=Unsupported Java.to target type {0}.
+@@ -166,11 +168,10 @@
+ syntax.error.invalid.json=Invalid JSON: {0}
+ syntax.error.strict.cant.delete=cannot delete "{0}" in strict mode
+ syntax.error.redeclare.variable=Variable "{0}" has already been declared
+-syntax.error.assign.constant=Assignment to constant "{0}"
+ syntax.error.unprotected.switch.declaration=Unsupported {0} declaration in unprotected switch statement
+
+ io.error.cant.write=cannot write "{0}"
+ config.error.no.dest=no destination directory supplied
+
+ uri.error.bad.uri=Bad URI "{0}" near offset {1}
+-
++list.adapter.null.global=Attempted to create the adapter from outside a JavaScript execution context.
+--- ./nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties Wed Jul 01 21:54:30 2015 -0700
+@@ -114,7 +114,7 @@
+ short_name="-d", \
+ is_undocumented=true, \
+ params="<path>", \
+- desc="specify a destination directory to dump class files.", \
++ desc="specify a destination directory to dump source and class files.", \
+ type=String \
+ }
+
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/src/jdk/nashorn/internal/scripts/JD.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,88 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.internal.scripts;
++
++import jdk.nashorn.internal.runtime.PropertyMap;
++import jdk.nashorn.internal.runtime.ScriptObject;
++
++/**
++ * Empty object class for dual primitive-object fields.
++ */
++public class JD extends ScriptObject {
++
++ private static final PropertyMap map$ = PropertyMap.newMap(JD.class);
++
++ /**
++ * Returns the initial property map to be used.
++ * @return the initial property map.
++ */
++ public static PropertyMap getInitialMap() {
++ return map$;
++ }
++
++ /**
++ * Constructor given an initial property map
++ *
++ * @param map the property map
++ */
++ public JD(final PropertyMap map) {
++ super(map);
++ }
++
++ /**
++ * Constructor given an initial prototype and the default initial property map.
++ *
++ * @param proto the prototype object
++ */
++ public JD(final ScriptObject proto) {
++ super(proto, getInitialMap());
++ }
++
++ /**
++ * Constructor that takes a pre-initialized spill pool. Used by
++ * {@link jdk.nashorn.internal.codegen.SpillObjectCreator} and
++ * {@link jdk.nashorn.internal.parser.JSONParser} for initializing object literals
++ *
++ * @param map property map
++ * @param primitiveSpill primitive spill pool
++ * @param objectSpill reference spill pool
++ */
++ public JD(final PropertyMap map, final long[] primitiveSpill, final Object[] objectSpill) {
++ super(map, primitiveSpill, objectSpill);
++ }
++
++ /**
++ * A method handle of this method is passed to the ScriptFunction constructor.
++ *
++ * @param map the property map to use for allocatorMap
++ *
++ * @return newly allocated ScriptObject
++ */
++ public static ScriptObject allocate(final PropertyMap map) {
++ return new JD(map);
++ }
++}
++
+--- ./nashorn/src/jdk/nashorn/internal/scripts/JO.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/internal/scripts/JO.java Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2010, 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,16 +25,15 @@
+
+ package jdk.nashorn.internal.scripts;
+
+-import jdk.nashorn.internal.codegen.SpillObjectCreator;
+ import jdk.nashorn.internal.runtime.PropertyMap;
+ import jdk.nashorn.internal.runtime.ScriptObject;
+
+ /**
+- * Empty object class.
++ * Empty object class for object-only fields.
+ */
+ public class JO extends ScriptObject {
+
+- private static final PropertyMap map$ = PropertyMap.newMap();
++ private static final PropertyMap map$ = PropertyMap.newMap(JO.class);
+
+ /**
+ * Returns the initial property map to be used.
+@@ -54,18 +53,18 @@
+ }
+
+ /**
+- * Constructor given an initial prototype and an initial property map.
++ * Constructor given an initial prototype and the default initial property map.
+ *
+ * @param proto the prototype object
+- * @param map the property map
+ */
+- public JO(final ScriptObject proto, final PropertyMap map) {
+- super(proto, map);
++ public JO(final ScriptObject proto) {
++ super(proto, getInitialMap());
+ }
+
+ /**
+- * Constructor that takes a pre-initialized spill pool. Used for
+- * by {@link SpillObjectCreator} for intializing object literals
++ * Constructor that takes a pre-initialized spill pool. Used by
++ * {@link jdk.nashorn.internal.codegen.SpillObjectCreator} and
++ * {@link jdk.nashorn.internal.parser.JSONParser} for initializing object literals
+ *
+ * @param map property map
+ * @param primitiveSpill primitive spill pool
+@@ -86,3 +85,4 @@
+ return new JO(map);
+ }
+ }
++
+--- ./nashorn/src/jdk/nashorn/tools/Shell.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/src/jdk/nashorn/tools/Shell.java Wed Jul 01 21:54:30 2015 -0700
+@@ -109,7 +109,10 @@
+ */
+ public static void main(final String[] args) {
+ try {
+- System.exit(main(System.in, System.out, System.err, args));
++ final int exitCode = main(System.in, System.out, System.err, args);
++ if (exitCode != SUCCESS) {
++ System.exit(exitCode);
++ }
+ } catch (final IOException e) {
+ System.err.println(e); //bootstrapping, Context.err may not exist
+ System.exit(IO_ERROR);
+@@ -414,18 +417,7 @@
+ Context.setGlobal(global);
+ }
+
+- // initialize with "shell.js" script
+- try {
+- final Source source = sourceFor("<shell.js>", Shell.class.getResource("resources/shell.js"));
+- context.eval(global, source.getString(), global, "<shell.js>", false);
+- } catch (final Exception e) {
+- err.println(e);
+- if (env._dump_on_error) {
+- e.printStackTrace(err);
+- }
+-
+- return INTERNAL_ERROR;
+- }
++ global.addShellBuiltins();
+
+ while (true) {
+ err.print(prompt);
+@@ -447,7 +439,7 @@
+ }
+
+ try {
+- final Object res = context.eval(global, source, global, "<shell>", env._strict);
++ final Object res = context.eval(global, source, global, "<shell>");
+ if (res != ScriptRuntime.UNDEFINED) {
+ err.println(JSType.toString(res));
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/src/jdk/nashorn/tools/ShellFunctions.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,104 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.tools;
++
++import static jdk.nashorn.internal.lookup.Lookup.MH;
++import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
++
++import java.io.BufferedReader;
++import java.io.File;
++import java.io.IOException;
++import java.io.InputStreamReader;
++import java.io.OutputStreamWriter;
++import java.lang.invoke.MethodHandle;
++import java.lang.invoke.MethodHandles;
++import jdk.nashorn.internal.runtime.JSType;
++import jdk.nashorn.internal.objects.Global;
++
++/**
++ * Global functions supported only in shell interactive mode.
++ */
++public final class ShellFunctions {
++
++ /** Handle to implementation of {@link ShellFunctions#input} - Nashorn extension */
++ public static final MethodHandle INPUT = findOwnMH("input", Object.class, Object.class, Object.class, Object.class);
++
++ /** Handle to implementation of {@link ShellFunctions#evalinput} - Nashorn extension */
++ public static final MethodHandle EVALINPUT = findOwnMH("evalinput", Object.class, Object.class, Object.class, Object.class);
++
++ private ShellFunctions() {
++ }
++
++ /**
++ * Nashorn extension: global.input (shell-interactive-mode-only)
++ * Read one or more lines of input from the standard input till the
++ * given end marker is seen in standard input.
++ *
++ * @param self self reference
++ * @param endMarker String used as end marker for input
++ * @param prompt String used as input prompt
++ *
++ * @return line that was read
++ *
++ * @throws IOException if an exception occurs
++ */
++ public static Object input(final Object self, final Object endMarker, final Object prompt) throws IOException {
++ final String endMarkerStr = (endMarker != UNDEFINED)? JSType.toString(endMarker) : "";
++ final String promptStr = (prompt != UNDEFINED)? JSType.toString(prompt) : ">> ";
++ final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
++ final StringBuilder buf = new StringBuilder();
++ while (true) {
++ System.out.print(promptStr);
++ final String line = reader.readLine();
++ if (line == null || line.equals(endMarkerStr)) {
++ break;
++ }
++ buf.append(line);
++ buf.append('\n');
++ }
++ return buf.toString();
++ }
++
++ /**
++ * Nashorn extension: Reads zero or more lines from standard input and
++ * evaluates the concatenated string as code
++ *
++ * @param self self reference
++ * @param endMarker String used as end marker for input
++ * @param prompt String used as input prompt
++ *
++ * @return output from evaluating the script
++ *
++ * @throws IOException if an exception occurs
++ */
++ public static Object evalinput(final Object self, final Object endMarker, final Object prompt) throws IOException {
++ return Global.eval(self, input(self, endMarker, prompt));
++ }
++
++ private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
++ return MH.findStatic(MethodHandles.lookup(), ShellFunctions.class, name, MH.type(rtype, types));
++ }
++}
+--- ./nashorn/src/jdk/nashorn/tools/resources/shell.js Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,83 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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.
+- */
+-
+-/*
+- * Initialization script for shell when running in interactive mode.
+- */
+-
+-/**
+- * Reads zero or more lines from standard input and returns concatenated string
+- *
+- * @param endMarker marker string that signals end of input
+- * @param prompt prompt printed for each line
+- */
+-Object.defineProperty(this, "input", {
+- value: function input(endMarker, prompt) {
+- if (!endMarker) {
+- endMarker = "";
+- }
+-
+- if (!prompt) {
+- prompt = " >> ";
+- }
+-
+- var imports = new JavaImporter(java.io, java.lang);
+- var str = "";
+- with (imports) {
+- var reader = new BufferedReader(new InputStreamReader(System['in']));
+- var line;
+- while (true) {
+- System.out.print(prompt);
+- line = reader.readLine();
+- if (line == null || line == endMarker) {
+- break;
+- }
+- str += line + "\n";
+- }
+- }
+-
+- return str;
+- },
+- enumerable: false,
+- writable: true,
+- configurable: true
+-});
+-
+-
+-/**
+- * Reads zero or more lines from standard input and evaluates the concatenated
+- * string as code
+- *
+- * @param endMarker marker string that signals end of input
+- * @param prompt prompt printed for each line
+- */
+-Object.defineProperty(this, "evalinput", {
+- value: function evalinput(endMarker, prompt) {
+- var code = input(endMarker, prompt);
+- // make sure everything is evaluated in global scope!
+- return this.eval(code);
+- },
+- enumerable: false,
+- writable: true,
+- configurable: true
+-});
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/examples/json-parser-micro.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,315 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * - Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * - Neither the name of Oracle nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++function bench() {
++ var start = Date.now();
++ for (var i = 0; i < 2000; i++) {
++ JSON.parse(String(json));
++ }
++ print("1000 iterations in", Date.now() - start, "millis");
++}
++
++var json = '[\
++ {\
++ "_id": "54ca34171d3ade49782294c8",\
++ "index": 0,\
++ "guid": "ed0e74d5-ac63-47b6-8938-1750abab5770",\
++ "isActive": false,\
++ "balance": "$1,996.19",\
++ "picture": "http://placehold.it/32x32",\
++ "age": 39,\
++ "eyeColor": "green",\
++ "name": "Rose Graham",\
++ "gender": "male",\
++ "company": "PRIMORDIA",\
++ "email": "rosegraham@primordia.com",\
++ "phone": "+1 (985) 600-3551",\
++ "address": "364 Melba Court, Succasunna, Texas, 8393",\
++ "about": "Sunt commodo cillum occaecat velit eu eiusmod ex eiusmod sunt deserunt nulla proident incididunt. Incididunt ullamco Lorem elit do culpa esse do ex dolor aliquip labore. Ullamco velit laboris incididunt dolor. Nostrud dolor sint pariatur fugiat ullamco exercitation. Eu laboris do cupidatat eiusmod incididunt mollit occaecat voluptate.",\
++ "registered": "2014-03-13T12:05:14 -01:00",\
++ "latitude": 18.55665,\
++ "longitude": 81.641001,\
++ "tags": [\
++ "sint",\
++ "Lorem",\
++ "veniam",\
++ "quis",\
++ "proident",\
++ "consectetur",\
++ "consequat"\
++ ],\
++ "friends": [\
++ {\
++ "id": 0,\
++ "name": "Evangelina Morgan"\
++ },\
++ {\
++ "id": 1,\
++ "name": "Saunders Snyder"\
++ },\
++ {\
++ "id": 2,\
++ "name": "Walker Wood"\
++ }\
++ ],\
++ "greeting": "Hello, Rose Graham! You have 1 unread messages.",\
++ "favoriteFruit": "strawberry"\
++ },\
++ {\
++ "_id": "54ca34176790c4c60fcae085",\
++ "index": 1,\
++ "guid": "9dc42e4c-b58f-4d92-a2ee-968d2b627d92",\
++ "isActive": true,\
++ "balance": "$3,832.97",\
++ "picture": "http://placehold.it/32x32",\
++ "age": 40,\
++ "eyeColor": "brown",\
++ "name": "Delaney Cherry",\
++ "gender": "male",\
++ "company": "INJOY",\
++ "email": "delaneycherry@injoy.com",\
++ "phone": "+1 (807) 463-2295",\
++ "address": "470 Hale Avenue, Mulberry, District Of Columbia, 5455",\
++ "about": "Deserunt sit cupidatat elit Lorem excepteur ex. Magna officia minim cupidatat nulla enim deserunt. Amet ex in tempor commodo consequat non ad qui elit cupidatat esse labore sint.",\
++ "registered": "2014-03-27T23:06:33 -01:00",\
++ "latitude": -4.984238,\
++ "longitude": 116.039285,\
++ "tags": [\
++ "minim",\
++ "velit",\
++ "aute",\
++ "minim",\
++ "id",\
++ "enim",\
++ "enim"\
++ ],\
++ "friends": [\
++ {\
++ "id": 0,\
++ "name": "Barrera Flowers"\
++ },\
++ {\
++ "id": 1,\
++ "name": "Leann Larson"\
++ },\
++ {\
++ "id": 2,\
++ "name": "Latoya Petty"\
++ }\
++ ],\
++ "greeting": "Hello, Delaney Cherry! You have 2 unread messages.",\
++ "favoriteFruit": "strawberry"\
++ },\
++ {\
++ "_id": "54ca3417920666f00c54bfc4",\
++ "index": 2,\
++ "guid": "f91e08f8-1598-49bc-a08b-bb48f0cc1751",\
++ "isActive": true,\
++ "balance": "$2,932.84",\
++ "picture": "http://placehold.it/32x32",\
++ "age": 28,\
++ "eyeColor": "brown",\
++ "name": "Mosley Hammond",\
++ "gender": "male",\
++ "company": "AQUACINE",\
++ "email": "mosleyhammond@aquacine.com",\
++ "phone": "+1 (836) 598-2591",\
++ "address": "879 Columbia Place, Seymour, Montana, 4897",\
++ "about": "Sunt laborum incididunt et elit in deserunt deserunt irure enim ea qui non. Minim nisi sint aute veniam reprehenderit veniam reprehenderit. Elit enim eu voluptate eu cupidatat nulla ea incididunt exercitation voluptate ut aliquip excepteur ipsum. Consequat anim fugiat irure Lorem anim consectetur est.",\
++ "registered": "2014-07-27T05:05:58 -02:00",\
++ "latitude": -43.608015,\
++ "longitude": -38.33894,\
++ "tags": [\
++ "proident",\
++ "incididunt",\
++ "eiusmod",\
++ "anim",\
++ "consectetur",\
++ "qui",\
++ "excepteur"\
++ ],\
++ "friends": [\
++ {\
++ "id": 0,\
++ "name": "Hanson Davidson"\
++ },\
++ {\
++ "id": 1,\
++ "name": "Autumn Kaufman"\
++ },\
++ {\
++ "id": 2,\
++ "name": "Tammy Foley"\
++ }\
++ ],\
++ "greeting": "Hello, Mosley Hammond! You have 4 unread messages.",\
++ "favoriteFruit": "apple"\
++ },\
++ {\
++ "_id": "54ca341753b67572a2b04935",\
++ "index": 3,\
++ "guid": "3377416b-43a2-4f9e-ada3-2479e13b44b8",\
++ "isActive": false,\
++ "balance": "$3,821.54",\
++ "picture": "http://placehold.it/32x32",\
++ "age": 31,\
++ "eyeColor": "green",\
++ "name": "Mueller Barrett",\
++ "gender": "male",\
++ "company": "GROK",\
++ "email": "muellerbarrett@grok.com",\
++ "phone": "+1 (890) 535-2834",\
++ "address": "571 Norwood Avenue, Westwood, Arkansas, 2164",\
++ "about": "Occaecat est sunt commodo ut ex excepteur elit nulla velit minim commodo commodo esse. Lorem quis eu minim consectetur. Cupidatat cupidatat consequat sit eu ex non quis nulla veniam sint enim excepteur. Consequat minim duis do do minim fugiat minim elit laborum ut velit. Occaecat laboris veniam sint reprehenderit.",\
++ "registered": "2014-07-18T17:15:35 -02:00",\
++ "latitude": 10.746577,\
++ "longitude": -160.266041,\
++ "tags": [\
++ "reprehenderit",\
++ "veniam",\
++ "sint",\
++ "commodo",\
++ "exercitation",\
++ "cillum",\
++ "sunt"\
++ ],\
++ "friends": [\
++ {\
++ "id": 0,\
++ "name": "Summers Finch"\
++ },\
++ {\
++ "id": 1,\
++ "name": "Tracie Mcdaniel"\
++ },\
++ {\
++ "id": 2,\
++ "name": "Ayers Patrick"\
++ }\
++ ],\
++ "greeting": "Hello, Mueller Barrett! You have 7 unread messages.",\
++ "favoriteFruit": "apple"\
++ },\
++ {\
++ "_id": "54ca34172775ab9615db0d1d",\
++ "index": 4,\
++ "guid": "a3102a3e-3f08-4df3-b5b5-62eff985d5ca",\
++ "isActive": true,\
++ "balance": "$3,962.27",\
++ "picture": "http://placehold.it/32x32",\
++ "age": 34,\
++ "eyeColor": "green",\
++ "name": "Patrick Foster",\
++ "gender": "male",\
++ "company": "QUAREX",\
++ "email": "patrickfoster@quarex.com",\
++ "phone": "+1 (805) 577-2362",\
++ "address": "640 Richards Street, Roberts, American Samoa, 5530",\
++ "about": "Aute occaecat occaecat ad eiusmod esse aliqua ullamco minim. Exercitation aute ut ex nostrud deserunt laboris officia amet enim do. Cillum officia laborum occaecat eiusmod reprehenderit ex et aliqua minim elit ex aliqua mollit. Occaecat dolor in fugiat laboris aliquip nisi ad voluptate duis eiusmod ad do.",\
++ "registered": "2014-07-22T16:45:35 -02:00",\
++ "latitude": 6.609025,\
++ "longitude": -5.357026,\
++ "tags": [\
++ "ea",\
++ "ut",\
++ "excepteur",\
++ "enim",\
++ "ad",\
++ "non",\
++ "sit"\
++ ],\
++ "friends": [\
++ {\
++ "id": 0,\
++ "name": "Duncan Lewis"\
++ },\
++ {\
++ "id": 1,\
++ "name": "Alyce Benton"\
++ },\
++ {\
++ "id": 2,\
++ "name": "Angelique Larsen"\
++ }\
++ ],\
++ "greeting": "Hello, Patrick Foster! You have 1 unread messages.",\
++ "favoriteFruit": "strawberry"\
++ },\
++ {\
++ "_id": "54ca3417a190f26fef815f6d",\
++ "index": 5,\
++ "guid": "c09663dd-bb0e-45a4-960c-232c0e8a9486",\
++ "isActive": false,\
++ "balance": "$1,871.12",\
++ "picture": "http://placehold.it/32x32",\
++ "age": 20,\
++ "eyeColor": "blue",\
++ "name": "Foreman Chaney",\
++ "gender": "male",\
++ "company": "DEMINIMUM",\
++ "email": "foremanchaney@deminimum.com",\
++ "phone": "+1 (966) 523-2182",\
++ "address": "960 Granite Street, Sunnyside, Tennessee, 1097",\
++ "about": "Adipisicing nisi qui id sit incididunt aute exercitation veniam consequat ipsum sit irure. Aute officia commodo Lorem consequat. Labore exercitation consequat voluptate deserunt consequat do est fugiat nisi eu dolor minim id ea.",\
++ "registered": "2015-01-21T00:18:00 -01:00",\
++ "latitude": -69.841726,\
++ "longitude": 121.809383,\
++ "tags": [\
++ "laboris",\
++ "sunt",\
++ "exercitation",\
++ "enim",\
++ "anim",\
++ "excepteur",\
++ "tempor"\
++ ],\
++ "friends": [\
++ {\
++ "id": 0,\
++ "name": "Espinoza Johnston"\
++ },\
++ {\
++ "id": 1,\
++ "name": "Doreen Holder"\
++ },\
++ {\
++ "id": 2,\
++ "name": "William Ellison"\
++ }\
++ ],\
++ "greeting": "Hello, Foreman Chaney! You have 5 unread messages.",\
++ "favoriteFruit": "strawberry"\
++ }\
++]';
++
++for (var i = 0; i < 100; i++) {
++ bench();
++}
+--- ./nashorn/test/script/basic/8024180/with_java_object.js.EXPECTED Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/8024180/with_java_object.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -1,1 +1,1 @@
+-TypeError: Cannot apply "with" to non script object
++TypeError: Cannot apply "with" to non script object. Consider using "with(Object.bindProperties({}, nonScriptObject))".
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8007456.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8007456: Nashorn test framework argument does not handle quoted strings
++ *
++ * @test
++ * @argument "hello world"
++ * @argument "This has spaces"
++ * @run
++ */
++
++print(arguments.length);
++print(arguments[0]);
++print(arguments[1]);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8007456.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,3 @@
++2
++hello world
++This has spaces
+--- ./nashorn/test/script/basic/JDK-8023026.js.EXPECTED Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/JDK-8023026.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -26,7 +26,7 @@
+ reduceRight 15 1
+ right sum 16
+ squared 1,9,25,49
+-iterating on [object Array]
++iterating on 2,4,6,8
+ forEach 2
+ forEach 4
+ forEach 6
+--- ./nashorn/test/script/basic/JDK-8024847.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/JDK-8024847.js Wed Jul 01 21:54:30 2015 -0700
+@@ -102,7 +102,18 @@
+ print(jlist);
+
+ var obj = new JSObject() {
+- toNumber: function() { return 42; }
++ getMember: function(name) {
++ if (name == "valueOf") {
++ return new JSObject() {
++ isFunction: function() {
++ return true;
++ },
++ call: function(thiz) {
++ return 42;
++ }
++ };
++ }
++ }
+ };
+
+ print(32 + obj);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8035712.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,282 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8035712: Restore some of the RuntimeCallSite specializations
++ *
++ * @test
++ * @run
++ */
++
++if ((typeof Assert) == "undefined") {
++ Assert = {
++ assertTrue: function(x) { if(!x) { throw "expected true" } },
++ assertFalse: function(x) { if(x) { throw "expected false" } },
++ };
++}
++
++function nop() {}
++
++function EQ(x, y) {
++ // Exercise normal evaluation
++ Assert.assertTrue (x == y);
++ Assert.assertTrue (y == x);
++ Assert.assertFalse(x != y);
++ Assert.assertFalse(y != x);
++ // Exercise the branch optimizer
++ if (x == y) { nop(); } else { Assert.fail(); }
++ if (y == x) { nop(); } else { Assert.fail(); }
++ if (x != y) { Assert.fail(); } else { nop(); }
++ if (y != x) { Assert.fail(); } else { nop(); }
++}
++
++function NE(x, y) {
++ // Exercise normal evaluation
++ Assert.assertTrue (x != y);
++ Assert.assertTrue (y != x);
++ Assert.assertFalse(x == y);
++ Assert.assertFalse(y == x);
++ // Exercise the branch optimizer
++ if (x != y) { nop(); } else { Assert.fail(); }
++ if (y != x) { nop(); } else { Assert.fail(); }
++ if (x == y) { Assert.fail(); } else { nop(); }
++ if (y == x) { Assert.fail(); } else { nop(); }
++}
++
++function STRICT_EQ(x, y) {
++ // Exercise normal evaluation
++ Assert.assertTrue (x === y);
++ Assert.assertTrue (y === x);
++ Assert.assertFalse(x !== y);
++ Assert.assertFalse(y !== x);
++ // Exercise the branch optimizer
++ if (x === y) { nop(); } else { Assert.fail(); }
++ if (y === x) { nop(); } else { Assert.fail(); }
++ if (x !== y) { Assert.fail(); } else { nop(); }
++ if (y !== x) { Assert.fail(); } else { nop(); }
++}
++
++function STRICT_NE(x, y) {
++ // Exercise normal evaluation
++ Assert.assertTrue (x !== y);
++ Assert.assertTrue (y !== x);
++ Assert.assertFalse(x === y);
++ Assert.assertFalse(y === x);
++ // Exercise the branch optimizer
++ if (x !== y) { nop(); } else { Assert.fail(); }
++ if (y !== x) { nop(); } else { Assert.fail(); }
++ if (x === y) { Assert.fail(); } else { nop(); }
++ if (y === x) { Assert.fail(); } else { nop(); }
++}
++
++function cmpToAnyNumber(cmp, value) {
++ cmp(1, value);
++ cmp(4294967296, value);
++ cmp(1.2, value);
++ cmp(Infinity, value);
++ cmp(-Infinity, value);
++ cmp(1/Infinity, value);
++ cmp(0, value);
++ cmp(-0, value);
++ cmp(true, value);
++ cmp(false, value);
++}
++
++function notEqualToAnyNumber(value) {
++ cmpToAnyNumber(NE, value);
++ cmpToAnyNumber(STRICT_NE, value);
++}
++
++notEqualToAnyNumber(null);
++notEqualToAnyNumber(void 0);
++notEqualToAnyNumber("abc");
++notEqualToAnyNumber({});
++notEqualToAnyNumber(["xyz"]);
++
++function objectWithPrimitiveFunctionNotEqualToAnyNumber(fnName) {
++ var obj = {
++ count: 0
++ };
++ obj[fnName] = function() { this.count++; return "foo"; };
++ notEqualToAnyNumber(obj);
++ // Every NE will invoke it 8 times; cmpToAnyNumber has 10 comparisons
++ // STRICT_NE doesn't invoke toString.
++ Assert.assertTrue(80 === obj.count);
++}
++objectWithPrimitiveFunctionNotEqualToAnyNumber("valueOf");
++objectWithPrimitiveFunctionNotEqualToAnyNumber("toString");
++
++function objectEqualButNotStrictlyEqual(val, obj) {
++ EQ(val, obj);
++ STRICT_NE(val, obj);
++}
++
++function numberEqualButNotStrictlyEqualToObject(num, obj) {
++ objectEqualButNotStrictlyEqual(num, obj);
++ objectEqualButNotStrictlyEqual(num, [obj]);
++ objectEqualButNotStrictlyEqual(num, [[obj]]);
++}
++
++function numberEqualButNotStrictlyEqualToZeroObjects(num) {
++ numberEqualButNotStrictlyEqualToObject(num, [0]);
++ numberEqualButNotStrictlyEqualToObject(num, "");
++ numberEqualButNotStrictlyEqualToObject(num, []);
++ numberEqualButNotStrictlyEqualToObject(num, "0");
++}
++
++numberEqualButNotStrictlyEqualToZeroObjects(0);
++numberEqualButNotStrictlyEqualToZeroObjects(1/Infinity);
++numberEqualButNotStrictlyEqualToZeroObjects(false);
++
++function numberEqualButNotStrictlyEqualToObjectEquivalent(num) {
++ var str = String(num);
++ objectEqualButNotStrictlyEqual(num, str);
++ objectEqualButNotStrictlyEqual(num, { valueOf: function() { return str }});
++ objectEqualButNotStrictlyEqual(num, { toString: function() { return str }});
++ objectEqualButNotStrictlyEqual(num, { valueOf: function() { return num }});
++ objectEqualButNotStrictlyEqual(num, { toString: function() { return num }});
++}
++
++numberEqualButNotStrictlyEqualToObjectEquivalent(1);
++numberEqualButNotStrictlyEqualToObjectEquivalent(4294967296);
++numberEqualButNotStrictlyEqualToObjectEquivalent(1.2);
++numberEqualButNotStrictlyEqualToObjectEquivalent(Infinity);
++numberEqualButNotStrictlyEqualToObjectEquivalent(-Infinity);
++numberEqualButNotStrictlyEqualToObjectEquivalent(1/Infinity);
++numberEqualButNotStrictlyEqualToObjectEquivalent(0);
++numberEqualButNotStrictlyEqualToObjectEquivalent(-0);
++
++STRICT_EQ(1, new java.lang.Integer(1));
++STRICT_EQ(1, new java.lang.Double(1));
++STRICT_EQ(1.2, new java.lang.Double(1.2));
++
++function LE(x, y) {
++ // Exercise normal evaluation
++ Assert.assertTrue(x <= y);
++ Assert.assertTrue(y >= x);
++ Assert.assertFalse(x > y);
++ Assert.assertFalse(x < y);
++ // Exercise the branch optimizer
++ if (x <= y) { nop(); } else { Assert.fail(); }
++ if (y >= x) { nop(); } else { Assert.fail(); }
++ if (x > y) { Assert.fail(); } else { nop(); }
++ if (y < x) { Assert.fail(); } else { nop(); }
++}
++
++function mutuallyLessThanOrEqual(x, y) {
++ LE(x, y);
++ LE(y, x);
++}
++
++mutuallyLessThanOrEqual(0, null);
++mutuallyLessThanOrEqual(false, null);
++mutuallyLessThanOrEqual(1/Infinity, null);
++
++function mutuallyLessThanEqualToObjectWithValue(num, val) {
++ mutuallyLessThanOrEqual(num, { valueOf: function() { return val } });
++ mutuallyLessThanOrEqual(num, { toString: function() { return val } });
++}
++
++mutuallyLessThanEqualToObjectWithValue(false, 0);
++mutuallyLessThanEqualToObjectWithValue(false, "");
++
++mutuallyLessThanEqualToObjectWithValue(true, 1);
++mutuallyLessThanEqualToObjectWithValue(true, "1");
++
++function lessThanEqualToObjectEquivalent(num) {
++ var str = String(num);
++ mutuallyLessThanOrEqual(num, str);
++ mutuallyLessThanEqualToObjectWithValue(num, num);
++ mutuallyLessThanEqualToObjectWithValue(num, str);
++}
++
++lessThanEqualToObjectEquivalent(1);
++lessThanEqualToObjectEquivalent(4294967296);
++lessThanEqualToObjectEquivalent(1.2);
++lessThanEqualToObjectEquivalent(Infinity);
++lessThanEqualToObjectEquivalent(-Infinity);
++lessThanEqualToObjectEquivalent(1/Infinity);
++lessThanEqualToObjectEquivalent(0);
++lessThanEqualToObjectEquivalent(-0);
++
++function INCOMPARABLE(x, y) {
++ // Exercise normal evaluation
++ Assert.assertFalse(x < y);
++ Assert.assertFalse(x > y);
++ Assert.assertFalse(x <= y);
++ Assert.assertFalse(x >= y);
++ Assert.assertFalse(y < x);
++ Assert.assertFalse(y > x);
++ Assert.assertFalse(y <= x);
++ Assert.assertFalse(y >= x);
++ // Exercise the branch optimizer
++ if (x < y) { Assert.fail(); } else { nop(); }
++ if (x > y) { Assert.fail(); } else { nop(); }
++ if (x <= y) { Assert.fail(); } else { nop(); }
++ if (x >= y) { Assert.fail(); } else { nop(); }
++ if (y < x) { Assert.fail(); } else { nop(); }
++ if (y > x) { Assert.fail(); } else { nop(); }
++ if (y <= x) { Assert.fail(); } else { nop(); }
++ if (y >= x) { Assert.fail(); } else { nop(); }
++}
++
++function isIncomparable(value) {
++ cmpToAnyNumber(INCOMPARABLE, value);
++}
++
++isIncomparable(void 0);
++isIncomparable({ valueOf: function() { return NaN }});
++isIncomparable({ toString: function() { return NaN }});
++
++// Force ScriptRuntime.LT(Object, Object) etc. comparisons
++function cmpObj(fn, x, y) {
++ fn({valueOf: function() { return x }}, {valueOf: function() { return y }});
++}
++
++function LT(x, y) {
++ Assert.assertTrue(x < y);
++ Assert.assertTrue(y > x);
++ Assert.assertFalse(x >= y);
++ Assert.assertFalse(y <= x);
++}
++
++cmpObj(LT, 1, 2);
++cmpObj(LT, 1, "2");
++cmpObj(LT, "1", 2);
++cmpObj(LT, "a", "b");
++cmpObj(LT, -Infinity, 0);
++cmpObj(LT, 0, Infinity);
++cmpObj(LT, -Infinity, Infinity);
++cmpObj(INCOMPARABLE, 1, NaN);
++cmpObj(INCOMPARABLE, NaN, NaN);
++cmpObj(INCOMPARABLE, "boo", NaN);
++cmpObj(INCOMPARABLE, 1, "boo"); // boo number value will be NaN
++
++// Test that a comparison call site can deoptimize from (int, int) to (object, object)
++(function(){
++ var x = [1, 2, "a"];
++ var y = [2, "3", "b"];
++ for(var i = 0; i < 3; ++i) {
++ Assert.assertTrue(x[i] < y[i]);
++ }
++})();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8047365.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,39 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8047365: Very long function names break codegen
++ *
++ * @test
++ * @run
++ */
++
++// string of length 131071, twice the limit of UTF8 strings in ASM
++var longId = Array(0x20000).join("a");
++print(longId.length);
++
++eval("function " + longId + "(){ print('hello world'); }");
++eval("print(typeof " + longId + ")");
++eval("print(" + longId + ".name === longId)");
++eval("print(/a+/.exec(" + longId + ".toString())[0] === longId)");
++eval(longId + "()");
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8047365.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,5 @@
++131071
++function
++true
++true
++hello world
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8053905.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,38 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8053905: Eager code generation fails for earley boyer with split threshold set to 1000
++ *
++ * @test
++ * @runif external.octane
++ * @fork
++ * @option -Dnashorn.compiler.splitter.threshold=1000
++ * @option -scripting
++ * @option --lazy-compilation=false
++ */
++
++var fn = __DIR__ + 'compile-octane.js';
++arguments.push("earley-boyer"); // run only earley-boyer
++var url = new java.io.File(fn).toURL();
++load(url);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8053905.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,2 @@
++Compiling 'earley-boyer'...
++Done.
+--- ./nashorn/test/script/basic/JDK-8055762.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/JDK-8055762.js Wed Jul 01 21:54:30 2015 -0700
+@@ -74,9 +74,12 @@
+ }
+ };
+
++ var a = "a";
+ print(obj["foo"]);
++ print(obj[a + "bc"]);
+ print(obj[2]);
+ obj.bar = 23;
++ obj[a + "bc"] = 23;
+ obj[3] = 23;
+ obj.func("hello");
+ }
+--- ./nashorn/test/script/basic/JDK-8055762.js.EXPECTED Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/JDK-8055762.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -1,5 +1,7 @@
+ FOO
++ABC
+ 0
+ bar set to 23
++abc set to 23
+ [3] set to 23
+ func called with hello
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8062141.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,91 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8062141: Various performance issues parsing JSON
++ *
++ * @test
++ * @run
++ */
++
++function testJson(json) {
++ try {
++ print(JSON.stringify(JSON.parse(json)));
++ } catch (error) {
++ print(error);
++ }
++}
++
++testJson('"\\u003f"');
++testJson('"\\u0"');
++testJson('"\\u0"');
++testJson('"\\u00"');
++testJson('"\\u003"');
++testJson('"\\u003x"');
++testJson('"\\"');
++testJson('"');
++testJson('+1');
++testJson('-1');
++testJson('1.');
++testJson('.1');
++testJson('01');
++testJson('1e');
++testJson('1e0');
++testJson('1a');
++testJson('1e+');
++testJson('1e-');
++testJson('0.0e+0');
++testJson('0.0e-0');
++testJson('[]');
++testJson('[ 1 ]');
++testJson('[1,]');
++testJson('[ 1 , 2 ]');
++testJson('[1, 2');
++testJson('{}');
++testJson('{ "a" : "b" }');
++testJson('{ "a" : "b" ');
++testJson('{ "a" : }');
++testJson('true');
++testJson('tru');
++testJson('true1');
++testJson('false');
++testJson('fals');
++testJson('falser');
++testJson('null');
++testJson('nul');
++testJson('null0');
++testJson('{} 0');
++testJson('{} a');
++testJson('[] 0');
++testJson('[] a');
++testJson('1 0');
++testJson('1 a');
++testJson('["a":true]');
++testJson('{"a",truer}');
++testJson('{"a":truer}');
++testJson('[1, 2, 3]');
++testJson('[9223372036854774000, 9223372036854775000, 9223372036854776000]');
++testJson('[1.1, 1.2, 1.3]');
++testJson('[1, 1.2, 9223372036854776000, null, true]');
++testJson('{ "a" : "string" , "b": 1 , "c" : 1.2 , "d" : 9223372036854776000 , "e" : null , "f" : true }');
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8062141.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,120 @@
++"?"
++SyntaxError: Invalid JSON: <json>:1:4 Invalid hex digit
++"\u0"
++ ^
++SyntaxError: Invalid JSON: <json>:1:4 Invalid hex digit
++"\u0"
++ ^
++SyntaxError: Invalid JSON: <json>:1:5 Invalid hex digit
++"\u00"
++ ^
++SyntaxError: Invalid JSON: <json>:1:6 Invalid hex digit
++"\u003"
++ ^
++SyntaxError: Invalid JSON: <json>:1:6 Invalid hex digit
++"\u003x"
++ ^
++SyntaxError: Invalid JSON: <json>:1:3 Missing close quote
++"\"
++ ^
++SyntaxError: Invalid JSON: <json>:1:1 Missing close quote
++"
++ ^
++SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found +
+++1
++^
++-1
++SyntaxError: Invalid JSON: <json>:1:2 Invalid JSON number format
++1.
++ ^
++SyntaxError: Invalid JSON: <json>:1:0 Invalid JSON number format
++.1
++^
++SyntaxError: Invalid JSON: <json>:1:1 Expected eof but found 1
++01
++ ^
++SyntaxError: Invalid JSON: <json>:1:2 Invalid JSON number format
++1e
++ ^
++1
++SyntaxError: Invalid JSON: <json>:1:1 Expected eof but found a
++1a
++ ^
++SyntaxError: Invalid JSON: <json>:1:3 Invalid JSON number format
++1e+
++ ^
++SyntaxError: Invalid JSON: <json>:1:3 Invalid JSON number format
++1e-
++ ^
++0
++0
++[]
++[1]
++SyntaxError: Invalid JSON: <json>:1:3 Trailing comma is not allowed in JSON
++[1,]
++ ^
++[1,2]
++SyntaxError: Invalid JSON: <json>:1:5 Expected , or ] but found eof
++[1, 2
++ ^
++{}
++{"a":"b"}
++SyntaxError: Invalid JSON: <json>:1:12 Expected , or } but found eof
++{ "a" : "b"
++ ^
++SyntaxError: Invalid JSON: <json>:1:8 Expected json literal but found }
++{ "a" : }
++ ^
++true
++SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found ident
++tru
++^
++SyntaxError: Invalid JSON: <json>:1:4 Expected eof but found 1
++true1
++ ^
++false
++SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found ident
++fals
++^
++SyntaxError: Invalid JSON: <json>:1:5 Expected eof but found r
++falser
++ ^
++null
++SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found ident
++nul
++^
++SyntaxError: Invalid JSON: <json>:1:4 Expected eof but found 0
++null0
++ ^
++SyntaxError: Invalid JSON: <json>:1:3 Expected eof but found 0
++{} 0
++ ^
++SyntaxError: Invalid JSON: <json>:1:3 Expected eof but found a
++{} a
++ ^
++SyntaxError: Invalid JSON: <json>:1:3 Expected eof but found 0
++[] 0
++ ^
++SyntaxError: Invalid JSON: <json>:1:3 Expected eof but found a
++[] a
++ ^
++SyntaxError: Invalid JSON: <json>:1:2 Expected eof but found 0
++1 0
++ ^
++SyntaxError: Invalid JSON: <json>:1:2 Expected eof but found a
++1 a
++ ^
++SyntaxError: Invalid JSON: <json>:1:4 Expected , or ] but found :
++["a":true]
++ ^
++SyntaxError: Invalid JSON: <json>:1:4 Expected : but found ,
++{"a",truer}
++ ^
++SyntaxError: Invalid JSON: <json>:1:9 Expected , or } but found r
++{"a":truer}
++ ^
++[1,2,3]
++[9223372036854773800,9223372036854774800,9223372036854776000]
++[1.1,1.2,1.3]
++[1,1.2,9223372036854776000,null,true]
++{"a":"string","b":1,"c":1.2,"d":9223372036854776000,"e":null,"f":true}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066214.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,49 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/**
++ * JDK-8066214: Fuzzing bug: Object.prototype.toLocaleString(0)
++ *
++ * @test
++ * @run
++ */
++
++function test(func) {
++ print(func.call(0));
++ print(func.call("abc"));
++ print(func.call(true));
++ try {
++ print(func.call(undefined));
++ } catch (e) {
++ print(e);
++ }
++ try {
++ print(func.call(null));
++ } catch (e) {
++ print(e);
++ }
++}
++
++test(Object.prototype.toLocaleString);
++test(Object.prototype.toString);
++test(Object.prototype.valueOf);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066214.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,15 @@
++0
++abc
++true
++TypeError: undefined is not an Object
++TypeError: null is not an Object
++[object Number]
++[object String]
++[object Boolean]
++[object Undefined]
++[object Null]
++0
++abc
++true
++TypeError: undefined is not an Object
++TypeError: null is not an Object
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066215.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,46 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8066215: Fuzzing bug: length valueOf bug
++ *
++ * @test
++ * @run
++ */
++
++function defineLength(arr, length) {
++ Object.defineProperty(arr, "length", {
++ value: {
++ valueOf: function() {
++ print("value retrieved: " + length);
++ return length;
++ }
++ }
++ });
++ print("done: " + arr.length + ", " + typeof arr.length);
++}
++
++var a = [];
++defineLength(a, 3);
++defineLength(a, 6);
++defineLength(a, 3);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066215.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,9 @@
++value retrieved: 3
++value retrieved: 3
++done: 3, number
++value retrieved: 6
++value retrieved: 6
++done: 6, number
++value retrieved: 3
++value retrieved: 3
++done: 3, number
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066220.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,38 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8066220: Fuzzing bug: MethodHandle bug (Object,Object) != (boolean)Object
++ *
++ * @test
++ * @run
++ */
++
++
++function f() {}
++// Call f with primitive this first, then as constructor
++f.call(1);
++new f();
++
++// Same as above in strict mode
++eval('"use strict"; function e() { print(typeof this); } e.call(1); new e();');
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066220.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,2 @@
++number
++object
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066222.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/**
++ * JDK-8066222: too strong assertion on function expression names
++ *
++ * @test
++ * @run
++ */
++
++// Has to print "SUCCESS"
++(function x (x){print(x)})("SUCCESS");
++
++// Has to print "undefined" and "1", not the function source in any case.
++(function x(){print(x); var x=1; print(x)})();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066222.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,3 @@
++SUCCESS
++undefined
++1
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066226.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,132 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/**
++ *
++ JDK-8066226: Fuzzing bug: parameter counts differ in TypeConverterFactory
++ *
++ * @test
++ * @run
++ */
++
++Object.defineProperty(Object.prototype, "accessor", {
++ set: function(value) {
++ print("Setting accessor on " + this + " to " + value);
++ }
++});
++
++Object.defineProperty(Object.prototype, "getterOnly", {
++ get: function() {
++ return 1;
++ }
++});
++
++function set(o) {
++ print("set(" + o + ")");
++ o.foo = 1;
++ o.constructor = 1;
++ o.accessor = 1;
++ o.getterOnly = 1;
++ print();
++}
++
++function setStrict(o) {
++ "use strict";
++ print("setStrict(" + o + ")")
++ try {
++ o.foo = 1;
++ } catch (e) {
++ print(e);
++ }
++ try {
++ o.constructor = 1;
++ } catch (e) {
++ print(e);
++ }
++ try {
++ o.accessor = 1;
++ } catch (e) {
++ print(e);
++ }
++ try {
++ o.getterOnly = 1;
++ } catch (e) {
++ print(e);
++ }
++ print();
++}
++
++function setAttr(o, id) {
++ print("setAttr(" + o + ", " + id + ")")
++ o[id] = 1;
++ print();
++}
++
++function setAttrStrict(o, id) {
++ "use strict";
++ print("setAttrStrict(" + o + ", " + id + ")")
++ try {
++ o[id] = 1;
++ } catch (e) {
++ print(e);
++ }
++ print();
++}
++
++set(1);
++set("str");
++set(true);
++set({});
++set([]);
++
++setStrict(1);
++setStrict("str");
++setStrict(true);
++setStrict({});
++setStrict([]);
++
++setAttr(1, "foo");
++setAttr(1, "constructor");
++setAttr(1, "accessor");
++setAttr(1, "getterOnly");
++setAttr("str", "foo");
++setAttr("str", "constructor");
++setAttr("str", "accessor");
++setAttr("str", "getterOnly");
++setAttr(true, "foo");
++setAttr(true, "constructor");
++setAttr(true, "accessor");
++setAttr(true, "getterOnly");
++
++setAttrStrict(1, "foo");
++setAttrStrict(1, "constructor");
++setAttrStrict(1, "accessor");
++setAttrStrict(1, "getterOnly");
++setAttrStrict("str", "foo");
++setAttrStrict("str", "constructor");
++setAttrStrict("str", "accessor");
++setAttrStrict("str", "getterOnly");
++setAttrStrict(true, "foo");
++setAttrStrict(true, "constructor");
++setAttrStrict(true, "accessor");
++setAttrStrict(true, "getterOnly");
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066226.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,104 @@
++set(1)
++Setting accessor on 1 to 1
++
++set(str)
++Setting accessor on str to 1
++
++set(true)
++Setting accessor on true to 1
++
++set([object Object])
++Setting accessor on [object Object] to 1
++
++set()
++Setting accessor on to 1
++
++setStrict(1)
++TypeError: "foo" is not a writable property of 1
++TypeError: "constructor" is not a writable property of 1
++Setting accessor on 1 to 1
++TypeError: Cannot set property "getterOnly" of [object Object] that has only a getter
++
++setStrict(str)
++TypeError: "foo" is not a writable property of str
++TypeError: "constructor" is not a writable property of str
++Setting accessor on str to 1
++TypeError: Cannot set property "getterOnly" of [object Object] that has only a getter
++
++setStrict(true)
++TypeError: "foo" is not a writable property of true
++TypeError: "constructor" is not a writable property of true
++Setting accessor on true to 1
++TypeError: Cannot set property "getterOnly" of [object Object] that has only a getter
++
++setStrict([object Object])
++Setting accessor on [object Object] to 1
++TypeError: Cannot set property "getterOnly" of [object Object] that has only a getter
++
++setStrict()
++Setting accessor on to 1
++TypeError: Cannot set property "getterOnly" of [object Array] that has only a getter
++
++setAttr(1, foo)
++
++setAttr(1, constructor)
++
++setAttr(1, accessor)
++Setting accessor on 1 to 1
++
++setAttr(1, getterOnly)
++
++setAttr(str, foo)
++
++setAttr(str, constructor)
++
++setAttr(str, accessor)
++Setting accessor on str to 1
++
++setAttr(str, getterOnly)
++
++setAttr(true, foo)
++
++setAttr(true, constructor)
++
++setAttr(true, accessor)
++Setting accessor on true to 1
++
++setAttr(true, getterOnly)
++
++setAttrStrict(1, foo)
++TypeError: "foo" is not a writable property of 1
++
++setAttrStrict(1, constructor)
++TypeError: "constructor" is not a writable property of 1
++
++setAttrStrict(1, accessor)
++Setting accessor on 1 to 1
++
++setAttrStrict(1, getterOnly)
++TypeError: Cannot set property "getterOnly" of [object Object] that has only a getter
++
++setAttrStrict(str, foo)
++TypeError: "foo" is not a writable property of str
++
++setAttrStrict(str, constructor)
++TypeError: "constructor" is not a writable property of str
++
++setAttrStrict(str, accessor)
++Setting accessor on str to 1
++
++setAttrStrict(str, getterOnly)
++TypeError: Cannot set property "getterOnly" of [object Object] that has only a getter
++
++setAttrStrict(true, foo)
++TypeError: "foo" is not a writable property of true
++
++setAttrStrict(true, constructor)
++TypeError: "constructor" is not a writable property of true
++
++setAttrStrict(true, accessor)
++Setting accessor on true to 1
++
++setAttrStrict(true, getterOnly)
++TypeError: Cannot set property "getterOnly" of [object Object] that has only a getter
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066232.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,38 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/**
++ * JDK-8066232: problem with conditional catch compilation
++ *
++ * @test
++ * @run
++ */
++
++(function () {
++ try {
++ x;
++ } catch(e if 1) {
++ }
++})()
++
++print("SUCCESS");
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066232.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,1 @@
++SUCCESS
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066237.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,38 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8066237: Fuzzing bug: Parser error on optimistic recompilation
++ *
++ * @test
++ * @run
++ */
++
++try {
++ (function() {
++ eval("get, a")
++ })();
++ fail("should have thrown");
++} catch (e) {
++ Assert.assertTrue(e.name === "ReferenceError");
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8066407.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,48 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8066407: Function with same body not reparsed after SyntaxError
++ *
++ * @test
++ * @run
++ */
++
++function testFunction(body) {
++ try {
++ Function(body);
++ Assert.fail("Should have thrown");
++ } catch (e) {
++ Assert.assertEquals(e.name, "SyntaxError");
++ count++;
++ }
++
++}
++
++var count = 0;
++
++testFunction("/a/r");
++testFunction("/a/r");
++testFunction("/a/r");
++
++Assert.assertTrue(count === 3);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8067139.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,92 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/**
++ * JDK-8067139: Finally blocks inlined incorrectly
++ *
++ * @test
++ * @run
++ */
++
++// Test case for JDK-8067139
++// as well as for JDK-8030198 which is a duplicate.
++(function(){
++ var catchCount = 0;
++ try {
++ (function (){
++ try {
++ return;
++ } catch(x) {
++ ++catchCount;
++ } finally {
++ throw 0;
++ }
++ })();
++ Assert.fail(); // must throw
++ } catch(e) {
++ Assert.assertEquals(e, 0); // threw 0
++ Assert.assertEquals(catchCount, 0); // inner catch never executed
++ }
++})();
++
++// Test case for JDK-8048862 which is a duplicate of this bug
++var ret = (function(o) {
++ try{
++ with(o) {
++ return x;
++ }
++ } finally {
++ try {
++ return x;
++ } catch(e) {
++ Assert.assertTrue(e instanceof ReferenceError);
++ return 2;
++ }
++ }
++})({x: 1});
++Assert.assertEquals(ret, 2); // executed the catch block
++
++// Test cases for JDK-8066231 that is a duplicate of this bug
++// Case 1
++(function (){ try { Object; } catch(x if x >>>=0) { throw x2; } finally { } })();
++// Case 2
++try {
++ (function (){ try { return; } catch(x) { return x ^= 0; } finally { throw 0; } })();
++ Assert.fail();
++} catch(e) {
++ Assert.assertEquals(e, 0); // threw 0
++}
++// Case 3
++try {
++ (function (){ try { return; } catch(x) { return x ^= Object; } finally { throw Object; } })();
++ Assert.fail();
++} catch(e) {
++ Assert.assertEquals(e, Object); // threw Object
++}
++// Case from comment
++try {
++ (function () { try { Object } catch(x) { (x=y); return; } finally { throw Object; } })();
++ Assert.fail();
++} catch(e) {
++ Assert.assertEquals(e, Object); // threw Object
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8067774.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,37 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/**
++ * JDK-8067774: Use a stack of types when calculating local variable types
++ *
++ * @test
++ * @run
++ */
++
++print((function (p) {
++ var a, b;
++
++ a = p ? ((b = 1), b) : 0;
++
++ return a;
++})(true));
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8067774.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,1 @@
++1
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8068580.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,42 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/**
++ * JDK-8068580: make JavaAdapterFactory.isAutoConvertibleFromFunction more robust
++ *
++ * @test
++ * @run
++ */
++
++var BigAbstract = Java.type("jdk.nashorn.test.models.BigAbstract")
++try {
++ new BigAbstract({});
++} catch (e) {
++ Assert.assertTrue(e instanceof TypeError);
++ Assert.assertEquals(e.message, "Can not extend/implement [class jdk.nashorn.test.models.BigAbstract] because of java.lang.RuntimeException: Method code too large!");
++}
++try {
++ BigAbstract.accept(function() { });
++} catch (e) {
++ Assert.assertSame(e.class, java.lang.ClassCastException.class);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8068872.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,34 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8068872: Nashorn JSON.parse drops numeric keys
++ *
++ * @test
++ * @run
++ */
++
++print(JSON.stringify(JSON.parse('{"3": 1, "5": "a"}')));
++print(JSON.stringify(JSON.parse('{"5": 1, "3": "a"}')));
++print(JSON.stringify(JSON.parse('{"0": 1, "4294967294": "a"}')));
++print(JSON.stringify(JSON.parse('{"4294967294": 1, "0": "a"}')));
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8068872.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,4 @@
++{"3":1,"5":"a"}
++{"3":"a","5":1}
++{"0":1,"4294967294":"a"}
++{"0":"a","4294967294":1}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8068985.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,51 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8068985: Wrong 'this' bound to eval call within a function when caller's 'this' is a Java object
++ *
++ * @test
++ * @run
++ */
++
++function func(arg) {
++ (function() { print(eval('this')); }).call(arg);
++}
++
++// primitives
++func(undefined);
++func(null);
++func(34.23);
++func("hello");
++func(false);
++
++// script objects
++func(this);
++func({});
++func({ toString: function() { return "foo" } });
++
++// java objects
++func(new java.util.Vector());
++var m = new java.util.HashMap();
++m.put("foo", "bar");
++func(m);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8068985.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,10 @@
++[object global]
++[object global]
++34.23
++hello
++false
++[object global]
++[object Object]
++foo
++[]
++{foo=bar}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8071928.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,57 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8071928: Instance properties with getters returning wrong values
++ *
++ * @test
++ * @run
++ */
++
++
++var types = {};
++
++function Type() {}
++
++Type.prototype.getName = function() {
++ return this._name;
++};
++
++function defineType(init) {
++ return Object.create(Type.prototype, {
++ _name: { get: function() { return init.name; } }
++ });
++}
++
++types.A = defineType({ name: 'A' });
++types.B = defineType({ name: 'B' });
++types.C = defineType({ name: 'C' });
++types.D = defineType({ name: 'D' });
++
++var keys = Object.keys(types);
++for (var i = 0; i < keys.length; i++) {
++ var t = types[keys[i]];
++ if (t.getName() != keys[i]) {
++ throw 'wrong name for ' + keys[i] + ': ' + t.getName();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8072426.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,164 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8072426: Can't compare Java objects to strings or numbers
++ *
++ * @test
++ * @run
++ */
++
++Assert.assertTrue(java.math.RoundingMode.UP == "UP");
++
++var JSObject = Java.type("jdk.nashorn.api.scripting.JSObject");
++
++// Adds an "isFunction" member to the JSObject that returns the specified value
++function addIsFunction(isFunction, obj) {
++ obj.isFunction = function() {
++ return isFunction;
++ };
++ return obj;
++}
++
++function makeJSObjectConstantFunction(value) {
++ return new JSObject(addIsFunction(true, {
++ call: function() {
++ return value;
++ }
++ }));
++}
++
++function makeJSObjectWithMembers(mapping) {
++ return new JSObject({
++ getMember: function(name) {
++ Assert.assertTrue(mapping.hasOwnProperty(name));
++ return mapping[name];
++ },
++ toNumber: function() {
++ // toNumber no longer invoked
++ Assert.fail();
++ }
++ });
++}
++
++// Test JSObjectLinker toInt32/toLong/toNumber
++function testNumericJSObject(kind, value) {
++ var obj = makeJSObjectWithMembers({
++ valueOf: makeJSObjectConstantFunction(value)
++ });
++
++ if (kind === "double") {
++ // There's no assertEquals(double actual, double expected). There's only
++ // assertEquals(double actual, double expected, double delta).
++ Assert["assertEquals(double,double,double)"](value, obj, 0);
++ } else {
++ Assert["assertEquals(" + kind + ", " + kind + ")"](value, obj);
++ }
++ Assert.assertTrue(value == Number(obj));
++}
++testNumericJSObject("int", 42);
++testNumericJSObject("long", 4294967296);
++testNumericJSObject("double", 1.2);
++
++// Test fallback from toNumber to toString for numeric conversion when toNumber doesn't exist
++(function() {
++ var obj = makeJSObjectWithMembers({
++ valueOf: null, // Explicitly no valueOf
++ toString: makeJSObjectConstantFunction("123")
++ });
++ Assert["assertEquals(int,int)"](123, obj);
++})();
++
++// Test fallback from toNumber to toString for numeric conversion when toNumber isn't a callable
++(function() {
++ var obj = makeJSObjectWithMembers({
++ valueOf: new JSObject(addIsFunction(false, {})),
++ toString: makeJSObjectConstantFunction("124")
++ });
++ Assert["assertEquals(int,int)"](124, obj);
++})();
++
++// Test fallback from toNumber to toString for numeric conversion when toNumber returns a non-primitive
++(function() {
++ var obj = makeJSObjectWithMembers({
++ valueOf: makeJSObjectConstantFunction({}),
++ toString: makeJSObjectConstantFunction("125")
++ });
++ Assert["assertEquals(int,int)"](125, obj);
++})();
++
++// Test TypeError from toNumber to toString when both return a non-primitive
++(function() {
++ var obj = makeJSObjectWithMembers({
++ valueOf: makeJSObjectConstantFunction({}),
++ toString: makeJSObjectConstantFunction({})
++ });
++ try {
++ Number(obj);
++ Assert.fail(); // must throw
++ } catch(e) {
++ Assert.assertTrue(e instanceof TypeError);
++ }
++})();
++
++// Test toString for string conversion
++(function() {
++ var obj = makeJSObjectWithMembers({
++ toString: makeJSObjectConstantFunction("Hello")
++ });
++ Assert.assertTrue("Hello" === String(obj));
++ Assert["assertEquals(String,String)"]("Hello", obj);
++})();
++
++// Test fallback from toString to valueOf for string conversion when toString doesn't exist
++(function() {
++ var obj = makeJSObjectWithMembers({
++ toString: null,
++ valueOf: makeJSObjectConstantFunction("Hello1")
++ });
++ Assert.assertTrue("Hello1" === String(obj));
++ Assert["assertEquals(String,String)"]("Hello1", obj);
++})();
++
++// Test fallback from toString to valueOf for string conversion when toString is not callable
++(function() {
++ var obj = makeJSObjectWithMembers({
++ toString: new JSObject(addIsFunction(false, {})),
++ valueOf: makeJSObjectConstantFunction("Hello2")
++ });
++ Assert["assertEquals(String,String)"]("Hello2", obj);
++})();
++
++// Test fallback from toString to valueOf for string conversion when toString returns non-primitive
++(function() {
++ var obj = makeJSObjectWithMembers({
++ toString: makeJSObjectConstantFunction({}),
++ valueOf: makeJSObjectConstantFunction("Hello3")
++ });
++ Assert["assertEquals(String,String)"]("Hello3", obj);
++})();
++
++// Test toBoolean for JSObject
++(function() {
++ Assert["assertEquals(boolean,boolean)"](true, new JSObject({}));
++})();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8072596.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,69 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8072596: Arrays.asList results in ClassCastException with a JS array
++ *
++ * @test
++ * @run
++ */
++var arr = java.util.Arrays.asList("hello world".split(' '));
++// We split it into a list of two elements: [hello, world]
++Assert.assertTrue(arr instanceof java.util.List);
++Assert.assertEquals(arr.length, 2);
++Assert.assertEquals(arr[0], "hello");
++Assert.assertEquals(arr[1], "world");
++
++var Jdk8072596TestSubject = Java.type("jdk.nashorn.test.models.Jdk8072596TestSubject");
++var testSubject = new Jdk8072596TestSubject({bar: 0});
++testSubject.test1(true, {foo: 1}, {bar: 2});
++testSubject.test2(true, {foo: 1}, {bar: 2}, {baz: 3}, {bing: 4});
++var h = "h";
++var ello = "ello";
++testSubject.test3(true, {foo: 5}, /* ConsString, why not */ h + ello, [6, 7], 8);
++Jdk8072596TestSubject.test4({foo: 9});
++
++// Test wrapping setters arguments and unwrapping getters return values on list.
++var list = new java.util.ArrayList();
++list.add(null);
++var obj0 = {valueOf: function() { return 0; }};
++var obj1 = {foo: 10};
++list[obj0] = obj1;
++testSubject.testListHasWrappedObject(list);
++// NOTE: can't use Assert.assertSame(obj1, list[obj0]), as the arguments would end up being wrapped...
++Assert.assertTrue(obj1 === list[obj0]);
++
++// Test wrapping setters arguments and unwrapping getters return values on array.
++var arr2 = new (Java.type("java.lang.Object[]"))(1);
++var obj2 = {bar: 11};
++arr2[obj0] = obj2;
++testSubject.testArrayHasWrappedObject(arr2);
++Assert.assertTrue(obj2 === arr2[obj0]);
++
++// Test wrapping setters index and arguments and getters index, and unwrapping getters return values on map.
++// Since ScriptObjectMirror.equals() uses underlying ScriptObject identity, using them as map keys works.
++var map = new java.util.HashMap();
++var obj3 = {bar: 12};
++map[obj0] = obj3;
++testSubject.testMapHasWrappedObject(map, obj0);
++Assert.assertTrue(obj3 === map[obj0]);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8073846.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,54 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8073846: Javascript for-in loop returned extra keys
++ *
++ * @test
++ * @run
++ */
++
++var obj = {};
++
++var list = [
++ '2100000',
++ '420000',
++ '430000'
++];
++
++for (var i = 0; i < list.length; i++) {
++ if (obj[list[i]]) print("duplicate: " + list[i]);
++ obj[list[i]] = 'obj' + list[i]
++}
++
++var count = 0;
++for (var a in obj) {
++ count++;
++ if ('obj' + a !== obj[a]) {
++ throw 'wrong key or value: ' + a + ', ' + obj[a];
++ }
++}
++
++if (count !== 3) {
++ throw 'wrong entry count: ' + count;
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8073868.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,45 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8073868: Regex matching causes java.lang.ArrayIndexOutOfBoundsException: 64
++ *
++ * @test
++ * @run
++ */
++
++function test(input) {
++ var comma = input.indexOf(",");
++ Assert.assertEquals(/([^\s]+),(.*)+/.exec(input)[0], input.trimLeft());
++ Assert.assertEquals(/([^\s]+),(.*)+/.exec(input)[1], input.substring(0, comma).trimLeft());
++ Assert.assertEquals(/([^\s]+),(.*)+/.exec(input)[2], input.substring(comma + 1));
++ Assert.assertEquals(/(.*)+/.exec(input)[0], input);
++ Assert.assertEquals(/(.*)+/.exec(input)[1], input);
++}
++
++test(" xxxx, xxx xxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ");
++test(" xxxx, xxx xxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ");
++test("x, xxxxxxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ");
++
++Assert.assertEquals(/(?:\1a|())*/.exec("a")[0], "a");
++Assert.assertEquals(/(?:\1a|())*/.exec("a")[1], undefined);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8074021.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,41 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8074021: Indirect eval fails when used as an element of an array or as a property of an object
++ *
++ * @test
++ * @run
++ */
++
++var obj = { foo: eval };
++Assert.assertTrue(obj.foo("typeof(print) == 'function'"));
++Assert.assertTrue(obj.foo("RegExp instanceof Function"));
++Assert.assertEquals(obj.foo("String(new Array(2, 4, 3))"), "2,4,3");
++obj.foo("print('hello')");
++
++var args = [ eval ];
++Assert.assertTrue(args[0]("typeof(print) == 'function'"));
++Assert.assertTrue(args[0]("RegExp instanceof Function"));
++Assert.assertEquals(args[0]("String(new Array(2, 4, 3))"), "2,4,3");
++args[0]("print('hello')");
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8074021.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,2 @@
++hello
++hello
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8074545.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,1038 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8074545: Undefined object values in object literals with spill properties
++ *
++ * @test
++ * @run
++ */
++
++var obj = {
++ "p0": { "x" : 0 },
++ "p1": { "x" : 1 },
++ "p2": { "x" : 2 },
++ "p3": { "x" : 3 },
++ "p4": { "x" : 4 },
++ "p5": { "x" : 5 },
++ "p6": { "x" : 6 },
++ "p7": { "x" : 7 },
++ "p8": { "x" : 8 },
++ "p9": { "x" : 9 },
++ "p10": { "x" : 10 },
++ "p11": { "x" : 11 },
++ "p12": { "x" : 12 },
++ "p13": { "x" : 13 },
++ "p14": { "x" : 14 },
++ "p15": { "x" : 15 },
++ "p16": { "x" : 16 },
++ "p17": { "x" : 17 },
++ "p18": { "x" : 18 },
++ "p19": { "x" : 19 },
++ "p20": { "x" : 20 },
++ "p21": { "x" : 21 },
++ "p22": { "x" : 22 },
++ "p23": { "x" : 23 },
++ "p24": { "x" : 24 },
++ "p25": { "x" : 25 },
++ "p26": { "x" : 26 },
++ "p27": { "x" : 27 },
++ "p28": { "x" : 28 },
++ "p29": { "x" : 29 },
++ "p30": { "x" : 30 },
++ "p31": { "x" : 31 },
++ "p32": { "x" : 32 },
++ "p33": { "x" : 33 },
++ "p34": { "x" : 34 },
++ "p35": { "x" : 35 },
++ "p36": { "x" : 36 },
++ "p37": { "x" : 37 },
++ "p38": { "x" : 38 },
++ "p39": { "x" : 39 },
++ "p40": { "x" : 40 },
++ "p41": { "x" : 41 },
++ "p42": { "x" : 42 },
++ "p43": { "x" : 43 },
++ "p44": { "x" : 44 },
++ "p45": { "x" : 45 },
++ "p46": { "x" : 46 },
++ "p47": { "x" : 47 },
++ "p48": { "x" : 48 },
++ "p49": { "x" : 49 },
++ "p50": { "x" : 50 },
++ "p51": { "x" : 51 },
++ "p52": { "x" : 52 },
++ "p53": { "x" : 53 },
++ "p54": { "x" : 54 },
++ "p55": { "x" : 55 },
++ "p56": { "x" : 56 },
++ "p57": { "x" : 57 },
++ "p58": { "x" : 58 },
++ "p59": { "x" : 59 },
++ "p60": { "x" : 60 },
++ "p61": { "x" : 61 },
++ "p62": { "x" : 62 },
++ "p63": { "x" : 63 },
++ "p64": { "x" : 64 },
++ "p65": { "x" : 65 },
++ "p66": { "x" : 66 },
++ "p67": { "x" : 67 },
++ "p68": { "x" : 68 },
++ "p69": { "x" : 69 },
++ "p70": { "x" : 70 },
++ "p71": { "x" : 71 },
++ "p72": { "x" : 72 },
++ "p73": { "x" : 73 },
++ "p74": { "x" : 74 },
++ "p75": { "x" : 75 },
++ "p76": { "x" : 76 },
++ "p77": { "x" : 77 },
++ "p78": { "x" : 78 },
++ "p79": { "x" : 79 },
++ "p80": { "x" : 80 },
++ "p81": { "x" : 81 },
++ "p82": { "x" : 82 },
++ "p83": { "x" : 83 },
++ "p84": { "x" : 84 },
++ "p85": { "x" : 85 },
++ "p86": { "x" : 86 },
++ "p87": { "x" : 87 },
++ "p88": { "x" : 88 },
++ "p89": { "x" : 89 },
++ "p90": { "x" : 90 },
++ "p91": { "x" : 91 },
++ "p92": { "x" : 92 },
++ "p93": { "x" : 93 },
++ "p94": { "x" : 94 },
++ "p95": { "x" : 95 },
++ "p96": { "x" : 96 },
++ "p97": { "x" : 97 },
++ "p98": { "x" : 98 },
++ "p99": { "x" : 99 },
++ "p100": { "x" : 100 },
++ "p101": { "x" : 101 },
++ "p102": { "x" : 102 },
++ "p103": { "x" : 103 },
++ "p104": { "x" : 104 },
++ "p105": { "x" : 105 },
++ "p106": { "x" : 106 },
++ "p107": { "x" : 107 },
++ "p108": { "x" : 108 },
++ "p109": { "x" : 109 },
++ "p110": { "x" : 110 },
++ "p111": { "x" : 111 },
++ "p112": { "x" : 112 },
++ "p113": { "x" : 113 },
++ "p114": { "x" : 114 },
++ "p115": { "x" : 115 },
++ "p116": { "x" : 116 },
++ "p117": { "x" : 117 },
++ "p118": { "x" : 118 },
++ "p119": { "x" : 119 },
++ "p120": { "x" : 120 },
++ "p121": { "x" : 121 },
++ "p122": { "x" : 122 },
++ "p123": { "x" : 123 },
++ "p124": { "x" : 124 },
++ "p125": { "x" : 125 },
++ "p126": { "x" : 126 },
++ "p127": { "x" : 127 },
++ "p128": { "x" : 128 },
++ "p129": { "x" : 129 },
++ "p130": { "x" : 130 },
++ "p131": { "x" : 131 },
++ "p132": { "x" : 132 },
++ "p133": { "x" : 133 },
++ "p134": { "x" : 134 },
++ "p135": { "x" : 135 },
++ "p136": { "x" : 136 },
++ "p137": { "x" : 137 },
++ "p138": { "x" : 138 },
++ "p139": { "x" : 139 },
++ "p140": { "x" : 140 },
++ "p141": { "x" : 141 },
++ "p142": { "x" : 142 },
++ "p143": { "x" : 143 },
++ "p144": { "x" : 144 },
++ "p145": { "x" : 145 },
++ "p146": { "x" : 146 },
++ "p147": { "x" : 147 },
++ "p148": { "x" : 148 },
++ "p149": { "x" : 149 },
++ "p150": { "x" : 150 },
++ "p151": { "x" : 151 },
++ "p152": { "x" : 152 },
++ "p153": { "x" : 153 },
++ "p154": { "x" : 154 },
++ "p155": { "x" : 155 },
++ "p156": { "x" : 156 },
++ "p157": { "x" : 157 },
++ "p158": { "x" : 158 },
++ "p159": { "x" : 159 },
++ "p160": { "x" : 160 },
++ "p161": { "x" : 161 },
++ "p162": { "x" : 162 },
++ "p163": { "x" : 163 },
++ "p164": { "x" : 164 },
++ "p165": { "x" : 165 },
++ "p166": { "x" : 166 },
++ "p167": { "x" : 167 },
++ "p168": { "x" : 168 },
++ "p169": { "x" : 169 },
++ "p170": { "x" : 170 },
++ "p171": { "x" : 171 },
++ "p172": { "x" : 172 },
++ "p173": { "x" : 173 },
++ "p174": { "x" : 174 },
++ "p175": { "x" : 175 },
++ "p176": { "x" : 176 },
++ "p177": { "x" : 177 },
++ "p178": { "x" : 178 },
++ "p179": { "x" : 179 },
++ "p180": { "x" : 180 },
++ "p181": { "x" : 181 },
++ "p182": { "x" : 182 },
++ "p183": { "x" : 183 },
++ "p184": { "x" : 184 },
++ "p185": { "x" : 185 },
++ "p186": { "x" : 186 },
++ "p187": { "x" : 187 },
++ "p188": { "x" : 188 },
++ "p189": { "x" : 189 },
++ "p190": { "x" : 190 },
++ "p191": { "x" : 191 },
++ "p192": { "x" : 192 },
++ "p193": { "x" : 193 },
++ "p194": { "x" : 194 },
++ "p195": { "x" : 195 },
++ "p196": { "x" : 196 },
++ "p197": { "x" : 197 },
++ "p198": { "x" : 198 },
++ "p199": { "x" : 199 },
++ "p200": { "x" : 200 },
++ "p201": { "x" : 201 },
++ "p202": { "x" : 202 },
++ "p203": { "x" : 203 },
++ "p204": { "x" : 204 },
++ "p205": { "x" : 205 },
++ "p206": { "x" : 206 },
++ "p207": { "x" : 207 },
++ "p208": { "x" : 208 },
++ "p209": { "x" : 209 },
++ "p210": { "x" : 210 },
++ "p211": { "x" : 211 },
++ "p212": { "x" : 212 },
++ "p213": { "x" : 213 },
++ "p214": { "x" : 214 },
++ "p215": { "x" : 215 },
++ "p216": { "x" : 216 },
++ "p217": { "x" : 217 },
++ "p218": { "x" : 218 },
++ "p219": { "x" : 219 },
++ "p220": { "x" : 220 },
++ "p221": { "x" : 221 },
++ "p222": { "x" : 222 },
++ "p223": { "x" : 223 },
++ "p224": { "x" : 224 },
++ "p225": { "x" : 225 },
++ "p226": { "x" : 226 },
++ "p227": { "x" : 227 },
++ "p228": { "x" : 228 },
++ "p229": { "x" : 229 },
++ "p230": { "x" : 230 },
++ "p231": { "x" : 231 },
++ "p232": { "x" : 232 },
++ "p233": { "x" : 233 },
++ "p234": { "x" : 234 },
++ "p235": { "x" : 235 },
++ "p236": { "x" : 236 },
++ "p237": { "x" : 237 },
++ "p238": { "x" : 238 },
++ "p239": { "x" : 239 },
++ "p240": { "x" : 240 },
++ "p241": { "x" : 241 },
++ "p242": { "x" : 242 },
++ "p243": { "x" : 243 },
++ "p244": { "x" : 244 },
++ "p245": { "x" : 245 },
++ "p246": { "x" : 246 },
++ "p247": { "x" : 247 },
++ "p248": { "x" : 248 },
++ "p249": { "x" : 249 },
++ "p250": { "x" : 250 },
++ "p251": { "x" : 251 },
++ "p252": { "x" : 252 },
++ "p253": { "x" : 253 },
++ "p254": { "x" : 254 },
++ "p255": { "x" : 255 },
++ "p256": { "x" : 256 },
++ "p257": { "x" : 257 },
++ "p258": { "x" : 258 },
++ "p259": { "x" : 259 },
++ "p260": { "x" : 260 },
++ "p261": { "x" : 261 },
++ "p262": { "x" : 262 },
++ "p263": { "x" : 263 },
++ "p264": { "x" : 264 },
++ "p265": { "x" : 265 },
++ "p266": { "x" : 266 },
++ "p267": { "x" : 267 },
++ "p268": { "x" : 268 },
++ "p269": { "x" : 269 },
++ "p270": { "x" : 270 },
++ "p271": { "x" : 271 },
++ "p272": { "x" : 272 },
++ "p273": { "x" : 273 },
++ "p274": { "x" : 274 },
++ "p275": { "x" : 275 },
++ "p276": { "x" : 276 },
++ "p277": { "x" : 277 },
++ "p278": { "x" : 278 },
++ "p279": { "x" : 279 },
++ "p280": { "x" : 280 },
++ "p281": { "x" : 281 },
++ "p282": { "x" : 282 },
++ "p283": { "x" : 283 },
++ "p284": { "x" : 284 },
++ "p285": { "x" : 285 },
++ "p286": { "x" : 286 },
++ "p287": { "x" : 287 },
++ "p288": { "x" : 288 },
++ "p289": { "x" : 289 },
++ "p290": { "x" : 290 },
++ "p291": { "x" : 291 },
++ "p292": { "x" : 292 },
++ "p293": { "x" : 293 },
++ "p294": { "x" : 294 },
++ "p295": { "x" : 295 },
++ "p296": { "x" : 296 },
++ "p297": { "x" : 297 },
++ "p298": { "x" : 298 },
++ "p299": { "x" : 299 },
++ "p300": { "x" : 300 },
++ "p301": { "x" : 301 },
++ "p302": { "x" : 302 },
++ "p303": { "x" : 303 },
++ "p304": { "x" : 304 },
++ "p305": { "x" : 305 },
++ "p306": { "x" : 306 },
++ "p307": { "x" : 307 },
++ "p308": { "x" : 308 },
++ "p309": { "x" : 309 },
++ "p310": { "x" : 310 },
++ "p311": { "x" : 311 },
++ "p312": { "x" : 312 },
++ "p313": { "x" : 313 },
++ "p314": { "x" : 314 },
++ "p315": { "x" : 315 },
++ "p316": { "x" : 316 },
++ "p317": { "x" : 317 },
++ "p318": { "x" : 318 },
++ "p319": { "x" : 319 },
++ "p320": { "x" : 320 },
++ "p321": { "x" : 321 },
++ "p322": { "x" : 322 },
++ "p323": { "x" : 323 },
++ "p324": { "x" : 324 },
++ "p325": { "x" : 325 },
++ "p326": { "x" : 326 },
++ "p327": { "x" : 327 },
++ "p328": { "x" : 328 },
++ "p329": { "x" : 329 },
++ "p330": { "x" : 330 },
++ "p331": { "x" : 331 },
++ "p332": { "x" : 332 },
++ "p333": { "x" : 333 },
++ "p334": { "x" : 334 },
++ "p335": { "x" : 335 },
++ "p336": { "x" : 336 },
++ "p337": { "x" : 337 },
++ "p338": { "x" : 338 },
++ "p339": { "x" : 339 },
++ "p340": { "x" : 340 },
++ "p341": { "x" : 341 },
++ "p342": { "x" : 342 },
++ "p343": { "x" : 343 },
++ "p344": { "x" : 344 },
++ "p345": { "x" : 345 },
++ "p346": { "x" : 346 },
++ "p347": { "x" : 347 },
++ "p348": { "x" : 348 },
++ "p349": { "x" : 349 },
++ "p350": { "x" : 350 },
++ "p351": { "x" : 351 },
++ "p352": { "x" : 352 },
++ "p353": { "x" : 353 },
++ "p354": { "x" : 354 },
++ "p355": { "x" : 355 },
++ "p356": { "x" : 356 },
++ "p357": { "x" : 357 },
++ "p358": { "x" : 358 },
++ "p359": { "x" : 359 },
++ "p360": { "x" : 360 },
++ "p361": { "x" : 361 },
++ "p362": { "x" : 362 },
++ "p363": { "x" : 363 },
++ "p364": { "x" : 364 },
++ "p365": { "x" : 365 },
++ "p366": { "x" : 366 },
++ "p367": { "x" : 367 },
++ "p368": { "x" : 368 },
++ "p369": { "x" : 369 },
++ "p370": { "x" : 370 },
++ "p371": { "x" : 371 },
++ "p372": { "x" : 372 },
++ "p373": { "x" : 373 },
++ "p374": { "x" : 374 },
++ "p375": { "x" : 375 },
++ "p376": { "x" : 376 },
++ "p377": { "x" : 377 },
++ "p378": { "x" : 378 },
++ "p379": { "x" : 379 },
++ "p380": { "x" : 380 },
++ "p381": { "x" : 381 },
++ "p382": { "x" : 382 },
++ "p383": { "x" : 383 },
++ "p384": { "x" : 384 },
++ "p385": { "x" : 385 },
++ "p386": { "x" : 386 },
++ "p387": { "x" : 387 },
++ "p388": { "x" : 388 },
++ "p389": { "x" : 389 },
++ "p390": { "x" : 390 },
++ "p391": { "x" : 391 },
++ "p392": { "x" : 392 },
++ "p393": { "x" : 393 },
++ "p394": { "x" : 394 },
++ "p395": { "x" : 395 },
++ "p396": { "x" : 396 },
++ "p397": { "x" : 397 },
++ "p398": { "x" : 398 },
++ "p399": { "x" : 399 },
++ "p400": { "x" : 400 },
++ "p401": { "x" : 401 },
++ "p402": { "x" : 402 },
++ "p403": { "x" : 403 },
++ "p404": { "x" : 404 },
++ "p405": { "x" : 405 },
++ "p406": { "x" : 406 },
++ "p407": { "x" : 407 },
++ "p408": { "x" : 408 },
++ "p409": { "x" : 409 },
++ "p410": { "x" : 410 },
++ "p411": { "x" : 411 },
++ "p412": { "x" : 412 },
++ "p413": { "x" : 413 },
++ "p414": { "x" : 414 },
++ "p415": { "x" : 415 },
++ "p416": { "x" : 416 },
++ "p417": { "x" : 417 },
++ "p418": { "x" : 418 },
++ "p419": { "x" : 419 },
++ "p420": { "x" : 420 },
++ "p421": { "x" : 421 },
++ "p422": { "x" : 422 },
++ "p423": { "x" : 423 },
++ "p424": { "x" : 424 },
++ "p425": { "x" : 425 },
++ "p426": { "x" : 426 },
++ "p427": { "x" : 427 },
++ "p428": { "x" : 428 },
++ "p429": { "x" : 429 },
++ "p430": { "x" : 430 },
++ "p431": { "x" : 431 },
++ "p432": { "x" : 432 },
++ "p433": { "x" : 433 },
++ "p434": { "x" : 434 },
++ "p435": { "x" : 435 },
++ "p436": { "x" : 436 },
++ "p437": { "x" : 437 },
++ "p438": { "x" : 438 },
++ "p439": { "x" : 439 },
++ "p440": { "x" : 440 },
++ "p441": { "x" : 441 },
++ "p442": { "x" : 442 },
++ "p443": { "x" : 443 },
++ "p444": { "x" : 444 },
++ "p445": { "x" : 445 },
++ "p446": { "x" : 446 },
++ "p447": { "x" : 447 },
++ "p448": { "x" : 448 },
++ "p449": { "x" : 449 },
++ "p450": { "x" : 450 },
++ "p451": { "x" : 451 },
++ "p452": { "x" : 452 },
++ "p453": { "x" : 453 },
++ "p454": { "x" : 454 },
++ "p455": { "x" : 455 },
++ "p456": { "x" : 456 },
++ "p457": { "x" : 457 },
++ "p458": { "x" : 458 },
++ "p459": { "x" : 459 },
++ "p460": { "x" : 460 },
++ "p461": { "x" : 461 },
++ "p462": { "x" : 462 },
++ "p463": { "x" : 463 },
++ "p464": { "x" : 464 },
++ "p465": { "x" : 465 },
++ "p466": { "x" : 466 },
++ "p467": { "x" : 467 },
++ "p468": { "x" : 468 },
++ "p469": { "x" : 469 },
++ "p470": { "x" : 470 },
++ "p471": { "x" : 471 },
++ "p472": { "x" : 472 },
++ "p473": { "x" : 473 },
++ "p474": { "x" : 474 },
++ "p475": { "x" : 475 },
++ "p476": { "x" : 476 },
++ "p477": { "x" : 477 },
++ "p478": { "x" : 478 },
++ "p479": { "x" : 479 },
++ "p480": { "x" : 480 },
++ "p481": { "x" : 481 },
++ "p482": { "x" : 482 },
++ "p483": { "x" : 483 },
++ "p484": { "x" : 484 },
++ "p485": { "x" : 485 },
++ "p486": { "x" : 486 },
++ "p487": { "x" : 487 },
++ "p488": { "x" : 488 },
++ "p489": { "x" : 489 },
++ "p490": { "x" : 490 },
++ "p491": { "x" : 491 },
++ "p492": { "x" : 492 },
++ "p493": { "x" : 493 },
++ "p494": { "x" : 494 },
++ "p495": { "x" : 495 },
++ "p496": { "x" : 496 },
++ "p497": { "x" : 497 },
++ "p498": { "x" : 498 },
++ "p499": { "x" : 499 },
++ "p500": { "x" : 500 },
++ "p501": { "x" : 501 },
++ "p502": { "x" : 502 },
++ "p503": { "x" : 503 },
++ "p504": { "x" : 504 },
++ "p505": { "x" : 505 },
++ "p506": { "x" : 506 },
++ "p507": { "x" : 507 },
++ "p508": { "x" : 508 },
++ "p509": { "x" : 509 },
++ "p510": { "x" : 510 },
++ "p511": { "x" : 511 },
++ "p512": { "x" : 512 },
++ "p513": { "x" : 513 },
++ "p514": { "x" : 514 },
++ "p515": { "x" : 515 },
++ "p516": { "x" : 516 },
++ "p517": { "x" : 517 },
++ "p518": { "x" : 518 },
++ "p519": { "x" : 519 },
++ "p520": { "x" : 520 },
++ "p521": { "x" : 521 },
++ "p522": { "x" : 522 },
++ "p523": { "x" : 523 },
++ "p524": { "x" : 524 },
++ "p525": { "x" : 525 },
++ "p526": { "x" : 526 },
++ "p527": { "x" : 527 },
++ "p528": { "x" : 528 },
++ "p529": { "x" : 529 },
++ "p530": { "x" : 530 },
++ "p531": { "x" : 531 },
++ "p532": { "x" : 532 },
++ "p533": { "x" : 533 },
++ "p534": { "x" : 534 },
++ "p535": { "x" : 535 },
++ "p536": { "x" : 536 },
++ "p537": { "x" : 537 },
++ "p538": { "x" : 538 },
++ "p539": { "x" : 539 },
++ "p540": { "x" : 540 },
++ "p541": { "x" : 541 },
++ "p542": { "x" : 542 },
++ "p543": { "x" : 543 },
++ "p544": { "x" : 544 },
++ "p545": { "x" : 545 },
++ "p546": { "x" : 546 },
++ "p547": { "x" : 547 },
++ "p548": { "x" : 548 },
++ "p549": { "x" : 549 },
++ "p550": { "x" : 550 },
++ "p551": { "x" : 551 },
++ "p552": { "x" : 552 },
++ "p553": { "x" : 553 },
++ "p554": { "x" : 554 },
++ "p555": { "x" : 555 },
++ "p556": { "x" : 556 },
++ "p557": { "x" : 557 },
++ "p558": { "x" : 558 },
++ "p559": { "x" : 559 },
++ "p560": { "x" : 560 },
++ "p561": { "x" : 561 },
++ "p562": { "x" : 562 },
++ "p563": { "x" : 563 },
++ "p564": { "x" : 564 },
++ "p565": { "x" : 565 },
++ "p566": { "x" : 566 },
++ "p567": { "x" : 567 },
++ "p568": { "x" : 568 },
++ "p569": { "x" : 569 },
++ "p570": { "x" : 570 },
++ "p571": { "x" : 571 },
++ "p572": { "x" : 572 },
++ "p573": { "x" : 573 },
++ "p574": { "x" : 574 },
++ "p575": { "x" : 575 },
++ "p576": { "x" : 576 },
++ "p577": { "x" : 577 },
++ "p578": { "x" : 578 },
++ "p579": { "x" : 579 },
++ "p580": { "x" : 580 },
++ "p581": { "x" : 581 },
++ "p582": { "x" : 582 },
++ "p583": { "x" : 583 },
++ "p584": { "x" : 584 },
++ "p585": { "x" : 585 },
++ "p586": { "x" : 586 },
++ "p587": { "x" : 587 },
++ "p588": { "x" : 588 },
++ "p589": { "x" : 589 },
++ "p590": { "x" : 590 },
++ "p591": { "x" : 591 },
++ "p592": { "x" : 592 },
++ "p593": { "x" : 593 },
++ "p594": { "x" : 594 },
++ "p595": { "x" : 595 },
++ "p596": { "x" : 596 },
++ "p597": { "x" : 597 },
++ "p598": { "x" : 598 },
++ "p599": { "x" : 599 },
++ "p600": { "x" : 600 },
++ "p601": { "x" : 601 },
++ "p602": { "x" : 602 },
++ "p603": { "x" : 603 },
++ "p604": { "x" : 604 },
++ "p605": { "x" : 605 },
++ "p606": { "x" : 606 },
++ "p607": { "x" : 607 },
++ "p608": { "x" : 608 },
++ "p609": { "x" : 609 },
++ "p610": { "x" : 610 },
++ "p611": { "x" : 611 },
++ "p612": { "x" : 612 },
++ "p613": { "x" : 613 },
++ "p614": { "x" : 614 },
++ "p615": { "x" : 615 },
++ "p616": { "x" : 616 },
++ "p617": { "x" : 617 },
++ "p618": { "x" : 618 },
++ "p619": { "x" : 619 },
++ "p620": { "x" : 620 },
++ "p621": { "x" : 621 },
++ "p622": { "x" : 622 },
++ "p623": { "x" : 623 },
++ "p624": { "x" : 624 },
++ "p625": { "x" : 625 },
++ "p626": { "x" : 626 },
++ "p627": { "x" : 627 },
++ "p628": { "x" : 628 },
++ "p629": { "x" : 629 },
++ "p630": { "x" : 630 },
++ "p631": { "x" : 631 },
++ "p632": { "x" : 632 },
++ "p633": { "x" : 633 },
++ "p634": { "x" : 634 },
++ "p635": { "x" : 635 },
++ "p636": { "x" : 636 },
++ "p637": { "x" : 637 },
++ "p638": { "x" : 638 },
++ "p639": { "x" : 639 },
++ "p640": { "x" : 640 },
++ "p641": { "x" : 641 },
++ "p642": { "x" : 642 },
++ "p643": { "x" : 643 },
++ "p644": { "x" : 644 },
++ "p645": { "x" : 645 },
++ "p646": { "x" : 646 },
++ "p647": { "x" : 647 },
++ "p648": { "x" : 648 },
++ "p649": { "x" : 649 },
++ "p650": { "x" : 650 },
++ "p651": { "x" : 651 },
++ "p652": { "x" : 652 },
++ "p653": { "x" : 653 },
++ "p654": { "x" : 654 },
++ "p655": { "x" : 655 },
++ "p656": { "x" : 656 },
++ "p657": { "x" : 657 },
++ "p658": { "x" : 658 },
++ "p659": { "x" : 659 },
++ "p660": { "x" : 660 },
++ "p661": { "x" : 661 },
++ "p662": { "x" : 662 },
++ "p663": { "x" : 663 },
++ "p664": { "x" : 664 },
++ "p665": { "x" : 665 },
++ "p666": { "x" : 666 },
++ "p667": { "x" : 667 },
++ "p668": { "x" : 668 },
++ "p669": { "x" : 669 },
++ "p670": { "x" : 670 },
++ "p671": { "x" : 671 },
++ "p672": { "x" : 672 },
++ "p673": { "x" : 673 },
++ "p674": { "x" : 674 },
++ "p675": { "x" : 675 },
++ "p676": { "x" : 676 },
++ "p677": { "x" : 677 },
++ "p678": { "x" : 678 },
++ "p679": { "x" : 679 },
++ "p680": { "x" : 680 },
++ "p681": { "x" : 681 },
++ "p682": { "x" : 682 },
++ "p683": { "x" : 683 },
++ "p684": { "x" : 684 },
++ "p685": { "x" : 685 },
++ "p686": { "x" : 686 },
++ "p687": { "x" : 687 },
++ "p688": { "x" : 688 },
++ "p689": { "x" : 689 },
++ "p690": { "x" : 690 },
++ "p691": { "x" : 691 },
++ "p692": { "x" : 692 },
++ "p693": { "x" : 693 },
++ "p694": { "x" : 694 },
++ "p695": { "x" : 695 },
++ "p696": { "x" : 696 },
++ "p697": { "x" : 697 },
++ "p698": { "x" : 698 },
++ "p699": { "x" : 699 },
++ "p700": { "x" : 700 },
++ "p701": { "x" : 701 },
++ "p702": { "x" : 702 },
++ "p703": { "x" : 703 },
++ "p704": { "x" : 704 },
++ "p705": { "x" : 705 },
++ "p706": { "x" : 706 },
++ "p707": { "x" : 707 },
++ "p708": { "x" : 708 },
++ "p709": { "x" : 709 },
++ "p710": { "x" : 710 },
++ "p711": { "x" : 711 },
++ "p712": { "x" : 712 },
++ "p713": { "x" : 713 },
++ "p714": { "x" : 714 },
++ "p715": { "x" : 715 },
++ "p716": { "x" : 716 },
++ "p717": { "x" : 717 },
++ "p718": { "x" : 718 },
++ "p719": { "x" : 719 },
++ "p720": { "x" : 720 },
++ "p721": { "x" : 721 },
++ "p722": { "x" : 722 },
++ "p723": { "x" : 723 },
++ "p724": { "x" : 724 },
++ "p725": { "x" : 725 },
++ "p726": { "x" : 726 },
++ "p727": { "x" : 727 },
++ "p728": { "x" : 728 },
++ "p729": { "x" : 729 },
++ "p730": { "x" : 730 },
++ "p731": { "x" : 731 },
++ "p732": { "x" : 732 },
++ "p733": { "x" : 733 },
++ "p734": { "x" : 734 },
++ "p735": { "x" : 735 },
++ "p736": { "x" : 736 },
++ "p737": { "x" : 737 },
++ "p738": { "x" : 738 },
++ "p739": { "x" : 739 },
++ "p740": { "x" : 740 },
++ "p741": { "x" : 741 },
++ "p742": { "x" : 742 },
++ "p743": { "x" : 743 },
++ "p744": { "x" : 744 },
++ "p745": { "x" : 745 },
++ "p746": { "x" : 746 },
++ "p747": { "x" : 747 },
++ "p748": { "x" : 748 },
++ "p749": { "x" : 749 },
++ "p750": { "x" : 750 },
++ "p751": { "x" : 751 },
++ "p752": { "x" : 752 },
++ "p753": { "x" : 753 },
++ "p754": { "x" : 754 },
++ "p755": { "x" : 755 },
++ "p756": { "x" : 756 },
++ "p757": { "x" : 757 },
++ "p758": { "x" : 758 },
++ "p759": { "x" : 759 },
++ "p760": { "x" : 760 },
++ "p761": { "x" : 761 },
++ "p762": { "x" : 762 },
++ "p763": { "x" : 763 },
++ "p764": { "x" : 764 },
++ "p765": { "x" : 765 },
++ "p766": { "x" : 766 },
++ "p767": { "x" : 767 },
++ "p768": { "x" : 768 },
++ "p769": { "x" : 769 },
++ "p770": { "x" : 770 },
++ "p771": { "x" : 771 },
++ "p772": { "x" : 772 },
++ "p773": { "x" : 773 },
++ "p774": { "x" : 774 },
++ "p775": { "x" : 775 },
++ "p776": { "x" : 776 },
++ "p777": { "x" : 777 },
++ "p778": { "x" : 778 },
++ "p779": { "x" : 779 },
++ "p780": { "x" : 780 },
++ "p781": { "x" : 781 },
++ "p782": { "x" : 782 },
++ "p783": { "x" : 783 },
++ "p784": { "x" : 784 },
++ "p785": { "x" : 785 },
++ "p786": { "x" : 786 },
++ "p787": { "x" : 787 },
++ "p788": { "x" : 788 },
++ "p789": { "x" : 789 },
++ "p790": { "x" : 790 },
++ "p791": { "x" : 791 },
++ "p792": { "x" : 792 },
++ "p793": { "x" : 793 },
++ "p794": { "x" : 794 },
++ "p795": { "x" : 795 },
++ "p796": { "x" : 796 },
++ "p797": { "x" : 797 },
++ "p798": { "x" : 798 },
++ "p799": { "x" : 799 },
++ "p800": { "x" : 800 },
++ "p801": { "x" : 801 },
++ "p802": { "x" : 802 },
++ "p803": { "x" : 803 },
++ "p804": { "x" : 804 },
++ "p805": { "x" : 805 },
++ "p806": { "x" : 806 },
++ "p807": { "x" : 807 },
++ "p808": { "x" : 808 },
++ "p809": { "x" : 809 },
++ "p810": { "x" : 810 },
++ "p811": { "x" : 811 },
++ "p812": { "x" : 812 },
++ "p813": { "x" : 813 },
++ "p814": { "x" : 814 },
++ "p815": { "x" : 815 },
++ "p816": { "x" : 816 },
++ "p817": { "x" : 817 },
++ "p818": { "x" : 818 },
++ "p819": { "x" : 819 },
++ "p820": { "x" : 820 },
++ "p821": { "x" : 821 },
++ "p822": { "x" : 822 },
++ "p823": { "x" : 823 },
++ "p824": { "x" : 824 },
++ "p825": { "x" : 825 },
++ "p826": { "x" : 826 },
++ "p827": { "x" : 827 },
++ "p828": { "x" : 828 },
++ "p829": { "x" : 829 },
++ "p830": { "x" : 830 },
++ "p831": { "x" : 831 },
++ "p832": { "x" : 832 },
++ "p833": { "x" : 833 },
++ "p834": { "x" : 834 },
++ "p835": { "x" : 835 },
++ "p836": { "x" : 836 },
++ "p837": { "x" : 837 },
++ "p838": { "x" : 838 },
++ "p839": { "x" : 839 },
++ "p840": { "x" : 840 },
++ "p841": { "x" : 841 },
++ "p842": { "x" : 842 },
++ "p843": { "x" : 843 },
++ "p844": { "x" : 844 },
++ "p845": { "x" : 845 },
++ "p846": { "x" : 846 },
++ "p847": { "x" : 847 },
++ "p848": { "x" : 848 },
++ "p849": { "x" : 849 },
++ "p850": { "x" : 850 },
++ "p851": { "x" : 851 },
++ "p852": { "x" : 852 },
++ "p853": { "x" : 853 },
++ "p854": { "x" : 854 },
++ "p855": { "x" : 855 },
++ "p856": { "x" : 856 },
++ "p857": { "x" : 857 },
++ "p858": { "x" : 858 },
++ "p859": { "x" : 859 },
++ "p860": { "x" : 860 },
++ "p861": { "x" : 861 },
++ "p862": { "x" : 862 },
++ "p863": { "x" : 863 },
++ "p864": { "x" : 864 },
++ "p865": { "x" : 865 },
++ "p866": { "x" : 866 },
++ "p867": { "x" : 867 },
++ "p868": { "x" : 868 },
++ "p869": { "x" : 869 },
++ "p870": { "x" : 870 },
++ "p871": { "x" : 871 },
++ "p872": { "x" : 872 },
++ "p873": { "x" : 873 },
++ "p874": { "x" : 874 },
++ "p875": { "x" : 875 },
++ "p876": { "x" : 876 },
++ "p877": { "x" : 877 },
++ "p878": { "x" : 878 },
++ "p879": { "x" : 879 },
++ "p880": { "x" : 880 },
++ "p881": { "x" : 881 },
++ "p882": { "x" : 882 },
++ "p883": { "x" : 883 },
++ "p884": { "x" : 884 },
++ "p885": { "x" : 885 },
++ "p886": { "x" : 886 },
++ "p887": { "x" : 887 },
++ "p888": { "x" : 888 },
++ "p889": { "x" : 889 },
++ "p890": { "x" : 890 },
++ "p891": { "x" : 891 },
++ "p892": { "x" : 892 },
++ "p893": { "x" : 893 },
++ "p894": { "x" : 894 },
++ "p895": { "x" : 895 },
++ "p896": { "x" : 896 },
++ "p897": { "x" : 897 },
++ "p898": { "x" : 898 },
++ "p899": { "x" : 899 },
++ "p900": { "x" : 900 },
++ "p901": { "x" : 901 },
++ "p902": { "x" : 902 },
++ "p903": { "x" : 903 },
++ "p904": { "x" : 904 },
++ "p905": { "x" : 905 },
++ "p906": { "x" : 906 },
++ "p907": { "x" : 907 },
++ "p908": { "x" : 908 },
++ "p909": { "x" : 909 },
++ "p910": { "x" : 910 },
++ "p911": { "x" : 911 },
++ "p912": { "x" : 912 },
++ "p913": { "x" : 913 },
++ "p914": { "x" : 914 },
++ "p915": { "x" : 915 },
++ "p916": { "x" : 916 },
++ "p917": { "x" : 917 },
++ "p918": { "x" : 918 },
++ "p919": { "x" : 919 },
++ "p920": { "x" : 920 },
++ "p921": { "x" : 921 },
++ "p922": { "x" : 922 },
++ "p923": { "x" : 923 },
++ "p924": { "x" : 924 },
++ "p925": { "x" : 925 },
++ "p926": { "x" : 926 },
++ "p927": { "x" : 927 },
++ "p928": { "x" : 928 },
++ "p929": { "x" : 929 },
++ "p930": { "x" : 930 },
++ "p931": { "x" : 931 },
++ "p932": { "x" : 932 },
++ "p933": { "x" : 933 },
++ "p934": { "x" : 934 },
++ "p935": { "x" : 935 },
++ "p936": { "x" : 936 },
++ "p937": { "x" : 937 },
++ "p938": { "x" : 938 },
++ "p939": { "x" : 939 },
++ "p940": { "x" : 940 },
++ "p941": { "x" : 941 },
++ "p942": { "x" : 942 },
++ "p943": { "x" : 943 },
++ "p944": { "x" : 944 },
++ "p945": { "x" : 945 },
++ "p946": { "x" : 946 },
++ "p947": { "x" : 947 },
++ "p948": { "x" : 948 },
++ "p949": { "x" : 949 },
++ "p950": { "x" : 950 },
++ "p951": { "x" : 951 },
++ "p952": { "x" : 952 },
++ "p953": { "x" : 953 },
++ "p954": { "x" : 954 },
++ "p955": { "x" : 955 },
++ "p956": { "x" : 956 },
++ "p957": { "x" : 957 },
++ "p958": { "x" : 958 },
++ "p959": { "x" : 959 },
++ "p960": { "x" : 960 },
++ "p961": { "x" : 961 },
++ "p962": { "x" : 962 },
++ "p963": { "x" : 963 },
++ "p964": { "x" : 964 },
++ "p965": { "x" : 965 },
++ "p966": { "x" : 966 },
++ "p967": { "x" : 967 },
++ "p968": { "x" : 968 },
++ "p969": { "x" : 969 },
++ "p970": { "x" : 970 },
++ "p971": { "x" : 971 },
++ "p972": { "x" : 972 },
++ "p973": { "x" : 973 },
++ "p974": { "x" : 974 },
++ "p975": { "x" : 975 },
++ "p976": { "x" : 976 },
++ "p977": { "x" : 977 },
++ "p978": { "x" : 978 },
++ "p979": { "x" : 979 },
++ "p980": { "x" : 980 },
++ "p981": { "x" : 981 },
++ "p982": { "x" : 982 },
++ "p983": { "x" : 983 },
++ "p984": { "x" : 984 },
++ "p985": { "x" : 985 },
++ "p986": { "x" : 986 },
++ "p987": { "x" : 987 },
++ "p988": { "x" : 988 },
++ "p989": { "x" : 989 },
++ "p990": { "x" : 990 },
++ "p991": { "x" : 991 },
++ "p992": { "x" : 992 },
++ "p993": { "x" : 993 },
++ "p994": { "x" : 994 },
++ "p995": { "x" : 995 },
++ "p996": { "x" : 996 },
++ "p997": { "x" : 997 },
++ "p998": { "x" : 998 },
++ "p999": { "x" : 999 }
++};
++
++for (var i = 0; i < 1000; i++) {
++ var value = obj["p" + i];
++ Assert.assertTrue(typeof value === "object");
++ Assert.assertTrue(value.x === i);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8074556.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,52 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8074556: Functions should not share allocator maps
++ *
++ * @test
++ * @run
++ */
++
++function A () {
++ return this;
++}
++
++function B() {
++ return this;
++}
++
++A.prototype.x = "x";
++A.prototype.y = "y";
++B.prototype.y = "y"; // same properties but different order
++B.prototype.x = "x";
++
++function test(o) {
++ Assert.assertEquals(o.x, "x");
++ Assert.assertEquals(o.y, "y");
++}
++
++test(new A());
++test(new B());
++test(new A());
++test(new B());
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8074687.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,60 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8074687: Add tests for JSON parsing of numeric keys
++ *
++ * @test
++ * @run
++ */
++
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {} }')), '{"0":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1 }')), '{"0":1}');
++
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "65503": {} }')), '{"65503":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "65503": 1 }')), '{"65503":1}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {}, "65503": {} }')), '{"0":{},"65503":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1, "65503": 1 }')), '{"0":1,"65503":1}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "65503": {}, "0": {} }')), '{"0":{},"65503":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "65503": 1, "0": 1 }')), '{"0":1,"65503":1}');
++
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "4294967295": {} }')), '{"4294967295":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "4294967295": 1 }')), '{"4294967295":1}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {}, "4294967295": {} }')), '{"0":{},"4294967295":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1, "4294967295": 1 }')), '{"0":1,"4294967295":1}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "4294967295": {}, "0": {} }')), '{"0":{},"4294967295":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "4294967295": 1, "0": 1 }')), '{"0":1,"4294967295":1}');
++
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "100": {} }')), '{"100":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "100": 1 }')), '{"100":1}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {}, "100": {} }')), '{"0":{},"100":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1, "100": 1 }')), '{"0":1,"100":1}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "100": {}, "0": {} }')), '{"0":{},"100":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "100": 1, "0": 1 }')), '{"0":1,"100":1}');
++
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "-100": {} }')), '{"-100":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "-100": 1 }')), '{"-100":1}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": {}, "-100": {} }')), '{"0":{},"-100":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "0": 1, "-100": 1 }')), '{"0":1,"-100":1}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "-100": {}, "0": {} }')), '{"0":{},"-100":{}}');
++Assert.assertEquals(JSON.stringify(JSON.parse('{ "-100": 1, "0": 1 }')), '{"0":1,"-100":1}');
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8074693.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,74 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8074693: Different instances of same function use same allocator map
++ *
++ * @test
++ * @run
++ */
++
++var lib = {};
++
++lib.mixin = function(target, source) {
++ for (var p in source) {
++ if (source.hasOwnProperty(p) && !target.hasOwnProperty(p)) {
++ target.prototype[p] = source[p];
++ }
++ }
++};
++
++lib.declare = function(def) {
++ var className = def.name;
++
++ lib[className] = function() {
++ this.init.apply(this, arguments);
++ };
++
++ lib.mixin(lib[className], def.members);
++};
++
++
++lib.declare({
++ name: "ClassA",
++ members: {
++ init : function () {
++ print("init A called");
++ }
++ }
++});
++
++lib.declare({
++ name: "ClassB",
++ members: {
++ util : function () {
++ print("util called")
++ },
++ init : function() {
++ print("init B called");
++ }
++ }
++});
++
++var objA = new lib.ClassA();
++var objB = new lib.ClassB();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8074693.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,2 @@
++init A called
++init B called
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8075090.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,72 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8075090: Add tests for the basic failure of try/finally compilation
++ *
++ * @test
++ * @run
++ */
++
++(function() {
++ var finallyExpected = false;
++ try {
++ for(var i = 0; i < 2; ++i) {
++ if(i == 1) {
++ continue;
++ }
++ }
++ finallyExpected = true;
++ } finally {
++ Assert.assertTrue(finallyExpected);
++ }
++})();
++
++(function() {
++ var finallyExpected = false;
++ try {
++ for(var i = 0; i < 2; ++i) {
++ if(i == 1) {
++ break;
++ }
++ }
++ finallyExpected = true;
++ } finally {
++ Assert.assertTrue(finallyExpected);
++ }
++})();
++
++(function() {
++ var finallyExpected = false;
++ try {
++ L1: {
++ if ((function(){return true})()) {
++ break L1;
++ }
++ Assert.fail(); // unreachable
++ }
++ finallyExpected = true;
++ } finally {
++ Assert.assertTrue(finallyExpected);
++ }
++})();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8075927.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,38 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8075927: toNumber(String) accepts illegal characters
++ *
++ * @test
++ * @run
++ */
++
++Assert.assertTrue(isNaN(Number("-123d")));
++Assert.assertTrue(isNaN(Number("-123f")));
++Assert.assertTrue(Number(" 123 ") === 123);
++Assert.assertTrue(Number(" -123 ") === -123);
++Assert.assertEquals(Number(" Infinity "), Infinity);
++Assert.assertEquals(Number(" +Infinity "), Infinity);
++Assert.assertEquals(Number(" -Infinity "), -Infinity);
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8077955.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,52 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8077955: Undeclared globals in eval code should not be handled as fast scope
++ *
++ * @test
++ * @run
++ * @fork
++ * @option -Dnashorn.fields.objects
++ */
++
++var m = new javax.script.ScriptEngineManager();
++var e = m.getEngineByName('js');
++
++// leave the whitespace - need both eval("e") at same column for this test!
++
++e.eval('function f(e) { eval("e") } f()');
++e.eval('function f() { var e = 33; eval("e") } f()');
++
++function f() {
++ Function.call.call(function x() { eval("x") }); eval("x")
++}
++
++try {
++ f();
++ fail("Should have thrown ReferenceError");
++} catch (e) {
++ if (! (e instanceof ReferenceError)) {
++ fail("ReferenceError expected but got " + e);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8078612_eager_1a.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8078612: Persistent code cache should support more configurations
++ *
++ * @test
++ * @runif external.prototype
++ * @option -pcc
++ * @option --lazy-compilation=false
++ * @option -Dnashorn.persistent.code.cache=build/nashorn_code_cache
++ * @fork
++ */
++
++load(__DIR__ + 'prototype.js');
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8078612_eager_1a.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,1 @@
++parsed and compiled ok prototype.js
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8078612_eager_1b.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8078612: Persistent code cache should support more configurations
++ *
++ * @test
++ * @runif external.prototype
++ * @option -pcc
++ * @option --lazy-compilation=false
++ * @option -Dnashorn.persistent.code.cache=build/nashorn_code_cache
++ * @fork
++ */
++
++load(__DIR__ + 'prototype.js');
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8078612_eager_1b.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,1 @@
++parsed and compiled ok prototype.js
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8078612_eager_2a.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8078612: Persistent code cache should support more configurations
++ *
++ * @test
++ * @runif external.yui
++ * @option -pcc
++ * @option --lazy-compilation=false
++ * @option -Dnashorn.persistent.code.cache=build/nashorn_code_cache
++ * @fork
++ */
++
++load(__DIR__ + 'yui.js');
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8078612_eager_2a.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,2 @@
++parsed and compiled ok yui-min.js
++parsed and compiled ok yui.js
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8078612_eager_2b.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8078612: Persistent code cache should support more configurations
++ *
++ * @test
++ * @runif external.yui
++ * @option -pcc
++ * @option --lazy-compilation=false
++ * @option -Dnashorn.persistent.code.cache=build/nashorn_code_cache
++ * @fork
++ */
++
++load(__DIR__ + 'yui.js');
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8078612_eager_2b.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,2 @@
++parsed and compiled ok yui-min.js
++parsed and compiled ok yui.js
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8079145.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,89 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8079145: jdk.nashorn.internal.runtime.arrays.IntArrayData.convert assertion
++ *
++ * @test
++ * @fork
++ * @option -Dnashorn.debug=true
++ * @run
++ */
++
++var Byte = java.lang.Byte;
++var Short = java.lang.Short;
++var Integer = java.lang.Integer;
++var Long = java.lang.Long;
++var Float = java.lang.Float;
++var Double = java.lang.Double;
++var Character = java.lang.Character;
++
++function checkWiden(arr, value, name) {
++ switch (typeof value) {
++ case 'object':
++ case 'undefined':
++ print(name + ": check widen for " + value);
++ break;
++ default:
++ print(name + ": check widen for " + value +
++ " [" + Debug.getClass(value) + "]");
++ }
++
++ arr[0] = value;
++}
++
++function checkIntWiden(value) {
++ checkWiden([34], value, "int array");
++}
++
++function checkLongWiden(value) {
++ checkWiden([Integer.MAX_VALUE + 1], value, "long array");
++}
++
++function checkNumberWiden(value) {
++ checkWiden([Math.PI], value, "number array");
++}
++
++function checkObjectWiden(value) {
++ checkWiden([null], value, "object array");
++}
++
++var values = [{}, null, undefined, false, true, new Byte(34),
++ new Integer(344454), new Long(454545), new Long(Integer.MAX_VALUE + 1),
++ new Float(34.3), new Double(Math.PI), new Character('s')];
++
++for each (var v in values) {
++ checkIntWiden(v);
++}
++
++for each (var v in values) {
++ checkLongWiden(v);
++}
++
++for each (var v in values) {
++ checkNumberWiden(v);
++}
++
++for each (var v in values) {
++ checkObjectWiden(v);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8079145.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,48 @@
++int array: check widen for [object Object]
++int array: check widen for null
++int array: check widen for undefined
++int array: check widen for false [class java.lang.Boolean]
++int array: check widen for true [class java.lang.Boolean]
++int array: check widen for 34 [class java.lang.Byte]
++int array: check widen for 344454 [class java.lang.Integer]
++int array: check widen for 454545 [class java.lang.Long]
++int array: check widen for 2147483648 [class java.lang.Long]
++int array: check widen for 34.29999923706055 [class java.lang.Float]
++int array: check widen for 3.141592653589793 [class java.lang.Double]
++int array: check widen for s
++long array: check widen for [object Object]
++long array: check widen for null
++long array: check widen for undefined
++long array: check widen for false [class java.lang.Boolean]
++long array: check widen for true [class java.lang.Boolean]
++long array: check widen for 34 [class java.lang.Byte]
++long array: check widen for 344454 [class java.lang.Integer]
++long array: check widen for 454545 [class java.lang.Long]
++long array: check widen for 2147483648 [class java.lang.Long]
++long array: check widen for 34.29999923706055 [class java.lang.Float]
++long array: check widen for 3.141592653589793 [class java.lang.Double]
++long array: check widen for s
++number array: check widen for [object Object]
++number array: check widen for null
++number array: check widen for undefined
++number array: check widen for false [class java.lang.Boolean]
++number array: check widen for true [class java.lang.Boolean]
++number array: check widen for 34 [class java.lang.Byte]
++number array: check widen for 344454 [class java.lang.Integer]
++number array: check widen for 454545 [class java.lang.Long]
++number array: check widen for 2147483648 [class java.lang.Long]
++number array: check widen for 34.29999923706055 [class java.lang.Float]
++number array: check widen for 3.141592653589793 [class java.lang.Double]
++number array: check widen for s
++object array: check widen for [object Object]
++object array: check widen for null
++object array: check widen for undefined
++object array: check widen for false [class java.lang.Boolean]
++object array: check widen for true [class java.lang.Boolean]
++object array: check widen for 34 [class java.lang.Byte]
++object array: check widen for 344454 [class java.lang.Integer]
++object array: check widen for 454545 [class java.lang.Long]
++object array: check widen for 2147483648 [class java.lang.Long]
++object array: check widen for 34.29999923706055 [class java.lang.Float]
++object array: check widen for 3.141592653589793 [class java.lang.Double]
++object array: check widen for s
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8079269.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,312 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8079269: Optimistic rewrite in object literal causes ArrayIndexOutOfBoundsException
++ *
++ * @test
++ * @run
++ */
++
++// m must be in scope so it's accessed with optimistic getters on scope
++var m = 1;
++
++(function() {
++ return {
++ p0: m,
++ p1: m = "foo",
++ p2: m
++ }
++})();
++
++var n = 1;
++
++// Test the spill object creator too
++(function() {
++ return {
++ p0: n,
++ p1: n = "foo",
++ p2: n,
++ p3: n,
++ p4: n,
++ p5: n,
++ p6: n,
++ p7: n,
++ p8: n,
++ p9: n,
++ p10: n,
++ p11: n,
++ p12: n,
++ p13: n,
++ p14: n,
++ p15: n,
++ p16: n,
++ p17: n,
++ p18: n,
++ p19: n,
++ p20: n,
++ p21: n,
++ p22: n,
++ p23: n,
++ p24: n,
++ p25: n,
++ p26: n,
++ p27: n,
++ p28: n,
++ p29: n,
++ p30: n,
++ p31: n,
++ p32: n,
++ p33: n,
++ p34: n,
++ p35: n,
++ p36: n,
++ p37: n,
++ p38: n,
++ p39: n,
++ p40: n,
++ p41: n,
++ p42: n,
++ p43: n,
++ p44: n,
++ p45: n,
++ p46: n,
++ p47: n,
++ p48: n,
++ p49: n,
++ p50: n,
++ p51: n,
++ p52: n,
++ p53: n,
++ p54: n,
++ p55: n,
++ p56: n,
++ p57: n,
++ p58: n,
++ p59: n,
++ p60: n,
++ p61: n,
++ p62: n,
++ p63: n,
++ p64: n,
++ p65: n,
++ p66: n,
++ p67: n,
++ p68: n,
++ p69: n,
++ p70: n,
++ p71: n,
++ p72: n,
++ p73: n,
++ p74: n,
++ p75: n,
++ p76: n,
++ p77: n,
++ p78: n,
++ p79: n,
++ p80: n,
++ p81: n,
++ p82: n,
++ p83: n,
++ p84: n,
++ p85: n,
++ p86: n,
++ p87: n,
++ p88: n,
++ p89: n,
++ p90: n,
++ p91: n,
++ p92: n,
++ p93: n,
++ p94: n,
++ p95: n,
++ p96: n,
++ p97: n,
++ p98: n,
++ p99: n,
++ p100: n,
++ p101: n,
++ p102: n,
++ p103: n,
++ p104: n,
++ p105: n,
++ p106: n,
++ p107: n,
++ p108: n,
++ p109: n,
++ p110: n,
++ p111: n,
++ p112: n,
++ p113: n,
++ p114: n,
++ p115: n,
++ p116: n,
++ p117: n,
++ p118: n,
++ p119: n,
++ p120: n,
++ p121: n,
++ p122: n,
++ p123: n,
++ p124: n,
++ p125: n,
++ p126: n,
++ p127: n,
++ p128: n,
++ p129: n,
++ p130: n,
++ p131: n,
++ p132: n,
++ p133: n,
++ p134: n,
++ p135: n,
++ p136: n,
++ p137: n,
++ p138: n,
++ p139: n,
++ p140: n,
++ p141: n,
++ p142: n,
++ p143: n,
++ p144: n,
++ p145: n,
++ p146: n,
++ p147: n,
++ p148: n,
++ p149: n,
++ p150: n,
++ p151: n,
++ p152: n,
++ p153: n,
++ p154: n,
++ p155: n,
++ p156: n,
++ p157: n,
++ p158: n,
++ p159: n,
++ p160: n,
++ p161: n,
++ p162: n,
++ p163: n,
++ p164: n,
++ p165: n,
++ p166: n,
++ p167: n,
++ p168: n,
++ p169: n,
++ p170: n,
++ p171: n,
++ p172: n,
++ p173: n,
++ p174: n,
++ p175: n,
++ p176: n,
++ p177: n,
++ p178: n,
++ p179: n,
++ p180: n,
++ p181: n,
++ p182: n,
++ p183: n,
++ p184: n,
++ p185: n,
++ p186: n,
++ p187: n,
++ p188: n,
++ p189: n,
++ p190: n,
++ p191: n,
++ p192: n,
++ p193: n,
++ p194: n,
++ p195: n,
++ p196: n,
++ p197: n,
++ p198: n,
++ p199: n,
++ p200: n,
++ p201: n,
++ p202: n,
++ p203: n,
++ p204: n,
++ p205: n,
++ p206: n,
++ p207: n,
++ p208: n,
++ p209: n,
++ p210: n,
++ p211: n,
++ p212: n,
++ p213: n,
++ p214: n,
++ p215: n,
++ p216: n,
++ p217: n,
++ p218: n,
++ p219: n,
++ p220: n,
++ p221: n,
++ p222: n,
++ p223: n,
++ p224: n,
++ p225: n,
++ p226: n,
++ p227: n,
++ p228: n,
++ p229: n,
++ p230: n,
++ p231: n,
++ p232: n,
++ p233: n,
++ p234: n,
++ p235: n,
++ p236: n,
++ p237: n,
++ p238: n,
++ p239: n,
++ p240: n,
++ p241: n,
++ p242: n,
++ p243: n,
++ p244: n,
++ p245: n,
++ p246: n,
++ p247: n,
++ p248: n,
++ p249: n,
++ p250: n,
++ p251: n,
++ p252: n,
++ p253: n,
++ p254: n,
++ p255: n,
++ p256: n,
++ p257: n,
++ p258: n,
++ p259: n
++ }
++})();
++
++// No output; as long as it completes without
++// ArrayIndexOutOfBoundsException in the OSR continuation handler, it's
++// a success.
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8079424.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,50 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8079424: code generator for discarded boolean logical operation has an extra pop
++ *
++ * @test
++ * @run
++ */
++
++// If the compiler manages to compile all of these, the test passes.
++void (true && true);
++void (true && false);
++void (false && true);
++void (false && false);
++
++void (true || true);
++void (true || false);
++void (false || true);
++void (false || false);
++
++void (1 && 1);
++void (1 && 0);
++void (0 && 1);
++void (0 && 0);
++
++void (1 || 1);
++void (1 || 0);
++void (0 || 1);
++void (0 || 0);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8079470.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,44 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8079470: Misleading error message when explicit signature constructor is called with wrong arguments
++ *
++ * @test
++ * @run
++ */
++
++
++var File = Java.type("java.io.File");
++try {
++ var f = new File['(String,String)']();
++} catch (e) {
++ print(e);
++}
++
++var Color = java.awt["Color(int,int,int)"]
++try {
++ var c = new Color(255, 255)
++} catch (e) {
++ print(e);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8079470.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,2 @@
++TypeError: Can not create new object with constructor [jdk.internal.dynalink.beans.SimpleDynamicMethod File java.io.File.java.io.File(String,String)] with the passed arguments; they do not match any of its method signatures.
++TypeError: Can not create new object with constructor [jdk.internal.dynalink.beans.SimpleDynamicMethod Color java.awt.Color.java.awt.Color(int,int,int)] with the passed arguments; they do not match any of its method signatures.
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8080182.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,46 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8080182: Array.prototype.sort throws IAE on inconsistent comparison
++ *
++ * @test
++ * @run
++ */
++
++function Random() {
++ this.toString = function() {
++ return (Math.random() * 100).toString();
++ }
++}
++
++for (var i = 0; i < 100; ++i) {
++ var arr = [];
++
++ for (var j = 0; j < 64; ++j) {
++ arr[j] = new Random();
++ }
++
++ // no IllegalArgumentException expected!
++ arr.sort();
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8080848.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,37 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8080848: delete of bound Java method property results in crash
++ *
++ * @test
++ * @run
++ */
++
++var obj = Object.bindProperties({}, new java.io.File("."));
++
++delete obj.wait;
++
++if (typeof obj.wait != 'undefined') {
++ throw new Error("obj.wait was not deleted");
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8081156.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,46 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8081156: jjs "nashorn.args" system property is not effective when script arguments are passed
++ *
++ * @test
++ * @fork
++ * @option -Dnashorn.args=-strict
++ * @argument foo
++ * @argument bar
++ * @run
++ */
++
++try {
++ x = 14;
++ throw new Error("should have thrown ReferenceError");
++} catch (e) {
++ if (! (e instanceof ReferenceError)) {
++ throw e;
++ }
++}
++
++Assert.assertTrue(arguments.length == 2);
++Assert.assertTrue(arguments[0] == "foo");
++Assert.assertTrue(arguments[1] == "bar");
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8085802.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8085802: Nashorn -nse option causes parse error on anonymous function definition
++ *
++ * @test
++ * @run
++ * @option -nse
++ */
++
++// even with -nse passed, the following should run fine
++// because anonymous function is used as expression here
++
++(function (){})()
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8087211.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,63 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8087211: Indirect evals should be strict with -strict option
++ *
++ * @test
++ * @run
++ * @option -strict
++ */
++
++var global = this;
++
++try {
++ // indirect eval call.
++ global.eval("x = 34;");
++ throw new Error("should have thrown ReferenceError");
++} catch (e if e instanceof ReferenceError) {
++}
++
++
++function teststrict() {
++ "use strict";
++ // strict caller, indirect eval.
++ global.eval('public = 1;');
++}
++
++try {
++ teststrict();
++ throw new Error("should have thrown SyntaxError");
++} catch (e if e instanceof SyntaxError) {
++}
++
++function testnonstrict() {
++ // non strict caller, indirect eval.
++ global.eval('public = 1;');
++}
++
++try {
++ testnonstrict();
++ throw new Error("should have thrown SyntaxError");
++} catch (e if e instanceof SyntaxError) {
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8087211_2.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,50 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8087211: Indirect evals should be strict with -strict option
++ * Make sure without -strict option, indirect evals are not strict.
++ *
++ * @test
++ * @run
++ */
++
++var global = this;
++
++// indirect eval call.
++global.eval("x = 34;");
++
++function teststrict() {
++ "use strict";
++ // strict caller, indirect eval.
++ global.eval('public = 1;');
++}
++
++teststrict();
++
++function testnonstrict() {
++ // non strict caller, indirect eval.
++ global.eval('public = 1;');
++}
++
++testnonstrict();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8098546.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,44 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8098546: eval within a 'with' leaks definitions into global scope
++ *
++ * @test
++ * @run
++ */
++
++function func() {
++ var obj = { foo: 344 };
++ with (obj) {
++ eval("var x = foo + 3");
++ }
++ Assert.assertTrue(obj.x === undefined);
++ Assert.assertTrue(x === 347);
++}
++
++func();
++
++// x should be undefined here
++Assert.assertTrue(typeof x === "undefined");
++
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8098578.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,107 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8098578: Global scope is not accessible with indirect load call
++ *
++ * @test
++ * @run
++ */
++
++var obj = { foo: 343 };
++var global = this;
++var x = 434;
++
++// indirect load call
++var res = load.call(obj, {
++ name: "t.js",
++ // global is accessible. All declarations go into
++ // intermediate inaccessible scope. "this" is global
++ // User's passed object's properties are accessible
++ // as variables.
++ script: "foo -= 300; var bar = x; Assert.assertTrue(bar == 434); function func() {}; this"
++})
++
++// 'this' for the evaluated code is global
++Assert.assertTrue(res === global);
++
++// properties of passed object are accessible in evaluated code
++Assert.assertTrue(obj.foo == 43);
++
++// vars, functions definined in evaluated code don't go into passed object
++Assert.assertTrue(typeof obj.bar == "undefined");
++Assert.assertTrue(typeof obj.func == "undefined");
++
++// vars, functions definined in evaluated code don't go leak into global
++Assert.assertTrue(typeof bar == "undefined");
++Assert.assertTrue(typeof func == "undefined");
++Assert.assertTrue(typeof foo == "undefined");
++
++var res = load.call(undefined, {
++ name: "t1.js",
++ // still global is accessible and 'this' is global
++ script: "Assert.assertTrue(x == 434); this"
++});
++
++// indirect load with 'undefined' this is same as as direct load
++// or load on global itself.
++Assert.assertTrue(res === global);
++
++// indirect load with 'undefined' this is same as as direct load
++// or load on global itself.
++var res = load.call(null, {
++ name: "t2.js",
++ // still global is accessible and 'this' is global
++ script: "Assert.assertTrue(x == 434); this"
++});
++Assert.assertTrue(res === global);
++
++// indirect load with mirror object
++var mirror = loadWithNewGlobal({
++ name: "t3.js",
++ script: "({ foo: 'hello', x: Math.PI })"
++});
++
++var res = load.call(mirror, {
++ name: "t4.js",
++ script: "Assert.assertTrue(foo == 'hello'); Assert.assertTrue(x == Math.PI); this"
++});
++Assert.assertTrue(res === global);
++
++// indirect load on non-script object, non-mirror results in TypeError
++function tryLoad(obj) {
++ try {
++ load.call(obj, {
++ name: "t5.js", script: "this"
++ });
++ throw new Error("should thrown TypeError for: " + obj);
++ } catch (e if TypeError) {}
++}
++
++tryLoad("hello");
++tryLoad(Math.E);
++tryLoad(true);
++tryLoad(false);
++
++// indirect load of a large script
++load.call({}, __DIR__ + "JDK-8098807-payload.js");
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8098807-payload.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,157 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8098807: Strict eval throws ClassCastException with large scripts
++ *
++ * @subtest
++ */
++
++function f() {}
++
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
++f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8098807.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,36 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8098807: Strict eval throws ClassCastException with large scripts
++ *
++ * @test
++ * @run
++ * @option -scripting
++ */
++
++"use strict";
++
++var path = __DIR__ + "JDK-8098807-payload.js"
++var source = readFully(path);
++eval(source);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/basic/JDK-8129410.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,39 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8129410: Java adapters with class-level overrides should preserve variable arity constructors
++ *
++ * @test
++ * @run
++ */
++
++var VarArgConstructor = Java.type("jdk.nashorn.test.models.VarArgConstructor");
++var VarArgConstructorExtended = Java.extend(VarArgConstructor, {});
++
++// If the fix didn't work we wouldn't even get past the constructor invocation
++// as it'd complain there's no matching arity constructor.
++var newExtended = new VarArgConstructorExtended(1, true, "a", "b");
++
++// Assert the expected constructor was invoked.
++Assert.assertEquals("vararg", newExtended.indicator);
+--- ./nashorn/test/script/basic/NASHORN-623.js.EXPECTED Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/NASHORN-623.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -1,3 +1,3 @@
+-SyntaxError: Invalid JSON: <json>:1:12 Expected number but found ident
++SyntaxError: Invalid JSON: <json>:1:11 Invalid JSON number format
+ { "test" : -xxx }
+- ^
++ ^
+--- ./nashorn/test/script/basic/compile-octane-splitter.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/compile-octane-splitter.js Wed Jul 01 21:54:30 2015 -0700
+@@ -29,11 +29,10 @@
+ * forever, so make this test future safe, we specify them explicitly
+ *
+ * @test
++ * @runif external.octane
+ * @fork
++ * @option -scripting
+ * @option -Dnashorn.compiler.splitter.threshold=1000
+- * @fork
+- * @runif external.octane
+- * @option -scripting
+ * @option -Dnashorn.typeInfo.disabled=true
+ * @option --class-cache-size=0
+ * @option --persistent-code-cache=false
+--- ./nashorn/test/script/basic/es6/const-reassign.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/es6/const-reassign.js Wed Jul 01 21:54:30 2015 -0700
+@@ -31,144 +31,147 @@
+ "use strict";
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x = 1;\n');
++ const x = 2;
++ x = 1;
++ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x++;\n');
++ const x = 2;
++ x++;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x--;\n');
++ const x = 2;
++ x--;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- '++x;\n');
++ const x = 2;
++ ++x;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- '--x;\n');
++ const x = 2;
++ --x;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x += 1;\n');
++ const x = 2;
++ x += 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x *= 1;\n');
++ const x = 2;
++ x *= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x /= 1;\n');
++ const x = 2;
++ x /= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x %= 1;\n');
++ const x = 2;
++ x %= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x |= 1;\n');
++ const x = 2;
++ x |= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x &= 1;\n');
++ const x = 2;
++ x &= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x ^= 1;\n');
++ const x = 2;
++ x ^= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x <<= 1;\n');
++ const x = 2;
++ x <<= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x >>= 1;\n');
++ const x = 2;
++ x >>= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'x >>>= 1;\n');
++ const x = 2;
++ x >>>= 1;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
+
+ try {
+- eval('"use strict";\n' +
+- 'const x = 2;\n' +
+- 'delete x;\n');
++ const x = 2;
++ delete x;
+ fail("const assignment didn't throw");
+ } catch (e) {
+- print(e.name);
++ print(e);
+ }
++
++const c = 1;
++
++try {
++ c = 2;
++ fail("const assignment didn't throw");
++} catch (e) {
++ print(e);
++}
++
++(function() {
++ try {
++ c = 2;
++ fail("const assignment didn't throw");
++ } catch (e) {
++ print(e);
++ }
++})();
+--- ./nashorn/test/script/basic/es6/const-reassign.js.EXPECTED Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/es6/const-reassign.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -1,16 +1,18 @@
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
+-SyntaxError
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++TypeError: Assignment to constant "x"
++SyntaxError: cannot delete "x" in strict mode
++TypeError: Assignment to constant "c"
++TypeError: Assignment to constant "c"
+--- ./nashorn/test/script/basic/es6/let-eval.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/es6/let-eval.js Wed Jul 01 21:54:30 2015 -0700
+@@ -96,3 +96,9 @@
+ f();
+
+ print(typeof a, typeof b, typeof c, typeof x, typeof z);
++
++let v = 1;
++eval("print('v: ' + v); v = 2; print ('v: ' + v);");
++print("this.v: " + this.v);
++print("v: " + v);
++
+--- ./nashorn/test/script/basic/es6/let-eval.js.EXPECTED Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/es6/let-eval.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -14,3 +14,7 @@
+ 2 1 0
+ 2 1 0 undefined
+ undefined undefined undefined undefined undefined
++v: 1
++v: 2
++this.v: undefined
++v: 2
+--- ./nashorn/test/script/basic/es6/let_const_reuse.js.EXPECTED Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/es6/let_const_reuse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -1,8 +1,4 @@
+ ReferenceError: "a" is not defined
+-SyntaxError: test/script/basic/es6/let_const_reuse.js#35:9<eval>:3:8 Assignment to constant "a"
+- a--
+- ^
+-SyntaxError: test/script/basic/es6/let_const_reuse.js#35:9<eval>:3:8 Assignment to constant "a"
+- a--
+- ^
++TypeError: Assignment to constant "a"
++TypeError: Assignment to constant "a"
+ ReferenceError: "a" is not defined
+--- ./nashorn/test/script/basic/typedarrays.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/basic/typedarrays.js Wed Jul 01 21:54:30 2015 -0700
+@@ -28,6 +28,17 @@
+ * @run
+ */
+
++//JDK-8066217, constructor for arraybuffer not behaving as per spec
++function checkLength(ab, l) {
++ if (ab.byteLength != l) {
++ throw "length error: " + ab.byteLength + " != " + l;
++ }
++}
++checkLength(new ArrayBuffer(), 0);
++checkLength(new ArrayBuffer(0), 0);
++checkLength(new ArrayBuffer(1024), 1024);
++checkLength(new ArrayBuffer(1,2,3), 1);
++checkLength(new ArrayBuffer([17]), 17);
+
+ var typeDefinitions = [
+ Int8Array,
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/JDK-8098847.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,33 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8098847: obj."prop" and obj.'prop' should result in SyntaxError
++ *
++ * @test/compile-error
++ */
++
++var obj = { "prop": 45 };
++
++obj."prop" = "hello";
++obj.'prop' = "hello";
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/JDK-8098847.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,6 @@
++test/script/error/JDK-8098847.js:32:5 Expected ident but found prop
++obj."prop" = "hello";
++ ^
++test/script/error/JDK-8098847.js:33:5 Expected ident but found prop
++obj.'prop' = "hello";
++ ^
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/anon_func_stat_nse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,31 @@
++/*
++ * 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.
++ */
++
++/**
++ * Anonymous function statement should result in error in -nse
++ *
++ * @option -nse
++ * @test/compile-error
++ */
++
++function() {}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/anon_func_stat_nse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,3 @@
++test/script/error/anon_func_stat_nse.js:31:8 Expected ident but found (
++function() {}
++ ^
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/backquote_string_nse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,32 @@
++/*
++ * 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.
++ */
++
++/**
++ * Backquote string should result in error with -nse even with -scripting
++ *
++ * @option -nse
++ * @option -scripting
++ * @test/compile-error
++ */
++
++`ls -l`;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/backquote_string_nse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,3 @@
++test/script/error/backquote_string_nse.js:32:0 Expected an operand but found error
++`ls -l`;
++^
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/conditional_catch_nse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,34 @@
++/*
++ * 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.
++ */
++
++/**
++ * conditional catch should result in error with -nse
++ *
++ * @option -nse
++ * @test/compile-error
++ */
++
++try {
++ func();
++} catch (e if e instanceof ReferenceError) {
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/conditional_catch_nse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,6 @@
++test/script/error/conditional_catch_nse.js:33:11 Expected ) but found if
++} catch (e if e instanceof ReferenceError) {
++ ^
++test/script/error/conditional_catch_nse.js:34:0 Expected eof but found }
++}
++^
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/expr_closure_nse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,31 @@
++/*
++ * 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.
++ */
++
++/**
++ * Expression closures should result in error with -nse
++ *
++ * @option -nse
++ * @test/compile-error
++ */
++
++function square(x) x*x;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/expr_closure_nse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,3 @@
++test/script/error/expr_closure_nse.js:31:19 Expected { but found x
++function square(x) x*x;
++ ^
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/for_each_nse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,33 @@
++/*
++ * 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.
++ */
++
++/**
++ * for..each should result in error with -nse
++ *
++ * @option -nse
++ * @test/compile-error
++ */
++
++for each (var x in [3, 454, 4]) {
++ print(x);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/for_each_nse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,6 @@
++test/script/error/for_each_nse.js:31:4 Expected ( but found each
++for each (var x in [3, 454, 4]) {
++ ^
++test/script/error/for_each_nse.js:33:0 Expected eof but found }
++}
++^
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/hash_comment_nse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,32 @@
++/*
++ * 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.
++ */
++
++/**
++ * Hash comment should result in error with -nse even with -scripting
++ *
++ * @option -nse
++ * @option -scripting
++ * @test/compile-error
++ */
++
++# this is a comment
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/hash_comment_nse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,3 @@
++test/script/error/hash_comment_nse.js:32:0 Expected an operand but found error
++# this is a comment
++^
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/heredoc_nse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,35 @@
++/*
++ * 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.
++ */
++
++/**
++ * Heredoc string should result in error with -nse even with -scripting
++ *
++ * @option -nse
++ * @option -scripting
++ * @test/compile-error
++ */
++
++var str = <<EOF
++This is a multiple line string
++inside a heredoc
++EOF;
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/heredoc_nse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,9 @@
++test/script/error/heredoc_nse.js:32:10 Expected an operand but found <<
++var str = <<EOF
++ ^
++test/script/error/heredoc_nse.js:33:5 Expected ; but found is
++This is a multiple line string
++ ^
++test/script/error/heredoc_nse.js:34:7 Expected ; but found a
++inside a heredoc
++ ^
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/object_literal_in_new_nse.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,33 @@
++/*
++ * 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.
++ */
++
++/**
++ * Object literal outside 'new' should result in error in -nse
++ *
++ * @option -nse
++ * @test/compile-error
++ */
++
++var r = new java.lang.Runnable() {
++ run: function() { print("hello"); }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/error/object_literal_in_new_nse.js.EXPECTED Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,9 @@
++test/script/error/object_literal_in_new_nse.js:31:33 Expected ; but found {
++var r = new java.lang.Runnable() {
++ ^
++test/script/error/object_literal_in_new_nse.js:32:15 Expected ident but found (
++ run: function() { print("hello"); }
++ ^
++test/script/error/object_literal_in_new_nse.js:32:36 Expected eof but found }
++ run: function() { print("hello"); }
++ ^
+--- ./nashorn/test/script/nosecurity/JDK-8050964.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/nosecurity/JDK-8050964.js Wed Jul 01 21:54:30 2015 -0700
+@@ -47,7 +47,7 @@
+ }
+
+ var javahome = System.getProperty("java.home");
+-var jdepsPath = javahome + "/../bin/jdeps".replaceAll(/\//g, File.separater);
++var jdepsPath = javahome + "/../bin/jdeps".replace(/\//g, File.separator);
+
+ // run jdep on nashorn.jar - only summary but print profile info
+ $ENV.PWD=System.getProperty("user.dir") // to avoid RE on Cygwin
+--- ./nashorn/test/script/nosecurity/JDK-8055034.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/nosecurity/JDK-8055034.js Wed Jul 01 21:54:30 2015 -0700
+@@ -48,7 +48,7 @@
+ // we want to use nashorn.jar passed and not the one that comes with JRE
+ var jjsCmd = javahome + "/../bin/jjs";
+ jjsCmd += " -J-Djava.ext.dirs=" + nashornJarDir;
+-jjsCmd = jjsCmd.toString().replaceAll(/\//g, File.separater);
++jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
+ $ENV.PWD=System.getProperty("user.dir") // to avoid RE on Cygwin
+ $EXEC(jjsCmd, "var x = Object.create(null);\nx;\nprint('PASSED');\nexit(0)");
+
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/nosecurity/JDK-8067215.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,104 @@
++/*
++ * Copyright (c) 2010, 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.
++ */
++
++/**
++ * JDK-8067215: Disable dual fields when not using optimistic types
++ *
++ * @test
++ * @run
++ * @option -Dnashorn.debug=true
++ * @fork
++ */
++
++var intType = Java.type("int");
++var doubleType = Java.type("double");
++var longType = Java.type("long");
++var objectType = Java.type("java.lang.Object");
++
++var Context = Java.type("jdk.nashorn.internal.runtime.Context");
++var JSType = Java.type("jdk.nashorn.internal.runtime.JSType");
++
++var context = Context.getContext();
++var dualFields = context.useDualFields();
++var optimisticTypes = context.getEnv()._optimistic_types;
++
++if (dualFields != optimisticTypes) {
++ throw new Error("Wrong dual fields setting");
++}
++
++function testMap(obj) {
++ obj.x = "foo";
++ obj["y"] = 0;
++ Object.defineProperty(obj, "z", {value: 0.5});
++ var map = Debug.map(obj);
++ for (var key in obj) {
++ var prop = map.findProperty(key);
++ if (prop.hasDualFields() !== dualFields) {
++ throw new Error("Wrong property flags: " + prop);
++ }
++ if (prop.getType() != getExpectedType(obj[key])) {
++ throw new Error("Wrong property type: " + prop.getType() + " // " + getExpectedType(obj[key]));
++
++ }
++ }
++}
++
++function getExpectedType(value) {
++ if (!dualFields) {
++ return objectType.class;
++ }
++ if (JSType.isRepresentableAsInt(value)) {
++ return intType.class;
++ }
++ if (JSType.isRepresentableAsLong(value)) {
++ return longType.class;
++ }
++ if (JSType.isNumber(value)) {
++ return doubleType.class;
++ }
++ return objectType.class;
++}
++
++var o = {
++ a: 1,
++ b: 2.5,
++ c: 0x10000000000,
++ d: true
++};
++
++function C() {
++ this.a = 1;
++ this.b = 2.5;
++ this.c = 0x10000000000;
++ this.d = true;
++}
++
++var a = 1;
++var b = 2.5;
++var c = 0x10000000000;
++var d = true;
++
++testMap(o);
++testMap(new C());
++testMap(JSON.parse('{ "a": 1, "b": 2.5, "c": 1099511627776, "d": true }'));
++testMap(this);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/nosecurity/JDK-8078049.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,553 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8078049: Nashorn crashes when attempting to start the new tsc.js compiler for TypeScript
++ *
++ * @test
++ * @run
++ * @fork
++ * @option -Dnashorn.debug=true
++ */
++
++var m = 1;
++
++var fields = {
++ p0: { code: 0, category: m },
++ p1: { code: 1, category: m },
++ p2: { code: 2, category: m }
++};
++
++var spill = {
++ p0: { code: 0, category: m },
++ p1: { code: 1, category: m },
++ p2: { code: 2, category: m },
++ p3: { code: 3, category: m },
++ p4: { code: 4, category: m },
++ p5: { code: 5, category: m },
++ p6: { code: 6, category: m },
++ p7: { code: 7, category: m },
++ p8: { code: 8, category: m },
++ p9: { code: 9, category: m },
++ p10: { code: 10, category: m },
++ p11: { code: 11, category: m },
++ p12: { code: 12, category: m },
++ p13: { code: 13, category: m },
++ p14: { code: 14, category: m },
++ p15: { code: 15, category: m },
++ p16: { code: 16, category: m },
++ p17: { code: 17, category: m },
++ p18: { code: 18, category: m },
++ p19: { code: 19, category: m },
++ p20: { code: 20, category: m },
++ p21: { code: 21, category: m },
++ p22: { code: 22, category: m },
++ p23: { code: 23, category: m },
++ p24: { code: 24, category: m },
++ p25: { code: 25, category: m },
++ p26: { code: 26, category: m },
++ p27: { code: 27, category: m },
++ p28: { code: 28, category: m },
++ p29: { code: 29, category: m },
++ p30: { code: 30, category: m },
++ p31: { code: 31, category: m },
++ p32: { code: 32, category: m },
++ p33: { code: 33, category: m },
++ p34: { code: 34, category: m },
++ p35: { code: 35, category: m },
++ p36: { code: 36, category: m },
++ p37: { code: 37, category: m },
++ p38: { code: 38, category: m },
++ p39: { code: 39, category: m },
++ p40: { code: 40, category: m },
++ p41: { code: 41, category: m },
++ p42: { code: 42, category: m },
++ p43: { code: 43, category: m },
++ p44: { code: 44, category: m },
++ p45: { code: 45, category: m },
++ p46: { code: 46, category: m },
++ p47: { code: 47, category: m },
++ p48: { code: 48, category: m },
++ p49: { code: 49, category: m },
++ p50: { code: 50, category: m },
++ p51: { code: 51, category: m },
++ p52: { code: 52, category: m },
++ p53: { code: 53, category: m },
++ p54: { code: 54, category: m },
++ p55: { code: 55, category: m },
++ p56: { code: 56, category: m },
++ p57: { code: 57, category: m },
++ p58: { code: 58, category: m },
++ p59: { code: 59, category: m },
++ p60: { code: 60, category: m },
++ p61: { code: 61, category: m },
++ p62: { code: 62, category: m },
++ p63: { code: 63, category: m },
++ p64: { code: 64, category: m },
++ p65: { code: 65, category: m },
++ p66: { code: 66, category: m },
++ p67: { code: 67, category: m },
++ p68: { code: 68, category: m },
++ p69: { code: 69, category: m },
++ p70: { code: 70, category: m },
++ p71: { code: 71, category: m },
++ p72: { code: 72, category: m },
++ p73: { code: 73, category: m },
++ p74: { code: 74, category: m },
++ p75: { code: 75, category: m },
++ p76: { code: 76, category: m },
++ p77: { code: 77, category: m },
++ p78: { code: 78, category: m },
++ p79: { code: 79, category: m },
++ p80: { code: 80, category: m },
++ p81: { code: 81, category: m },
++ p82: { code: 82, category: m },
++ p83: { code: 83, category: m },
++ p84: { code: 84, category: m },
++ p85: { code: 85, category: m },
++ p86: { code: 86, category: m },
++ p87: { code: 87, category: m },
++ p88: { code: 88, category: m },
++ p89: { code: 89, category: m },
++ p90: { code: 90, category: m },
++ p91: { code: 91, category: m },
++ p92: { code: 92, category: m },
++ p93: { code: 93, category: m },
++ p94: { code: 94, category: m },
++ p95: { code: 95, category: m },
++ p96: { code: 96, category: m },
++ p97: { code: 97, category: m },
++ p98: { code: 98, category: m },
++ p99: { code: 99, category: m },
++ p100: { code: 100, category: m },
++ p101: { code: 101, category: m },
++ p102: { code: 102, category: m },
++ p103: { code: 103, category: m },
++ p104: { code: 104, category: m },
++ p105: { code: 105, category: m },
++ p106: { code: 106, category: m },
++ p107: { code: 107, category: m },
++ p108: { code: 108, category: m },
++ p109: { code: 109, category: m },
++ p110: { code: 110, category: m },
++ p111: { code: 111, category: m },
++ p112: { code: 112, category: m },
++ p113: { code: 113, category: m },
++ p114: { code: 114, category: m },
++ p115: { code: 115, category: m },
++ p116: { code: 116, category: m },
++ p117: { code: 117, category: m },
++ p118: { code: 118, category: m },
++ p119: { code: 119, category: m },
++ p120: { code: 120, category: m },
++ p121: { code: 121, category: m },
++ p122: { code: 122, category: m },
++ p123: { code: 123, category: m },
++ p124: { code: 124, category: m },
++ p125: { code: 125, category: m },
++ p126: { code: 126, category: m },
++ p127: { code: 127, category: m },
++ p128: { code: 128, category: m },
++ p129: { code: 129, category: m },
++ p130: { code: 130, category: m },
++ p131: { code: 131, category: m },
++ p132: { code: 132, category: m },
++ p133: { code: 133, category: m },
++ p134: { code: 134, category: m },
++ p135: { code: 135, category: m },
++ p136: { code: 136, category: m },
++ p137: { code: 137, category: m },
++ p138: { code: 138, category: m },
++ p139: { code: 139, category: m },
++ p140: { code: 140, category: m },
++ p141: { code: 141, category: m },
++ p142: { code: 142, category: m },
++ p143: { code: 143, category: m },
++ p144: { code: 144, category: m },
++ p145: { code: 145, category: m },
++ p146: { code: 146, category: m },
++ p147: { code: 147, category: m },
++ p148: { code: 148, category: m },
++ p149: { code: 149, category: m },
++ p150: { code: 150, category: m },
++ p151: { code: 151, category: m },
++ p152: { code: 152, category: m },
++ p153: { code: 153, category: m },
++ p154: { code: 154, category: m },
++ p155: { code: 155, category: m },
++ p156: { code: 156, category: m },
++ p157: { code: 157, category: m },
++ p158: { code: 158, category: m },
++ p159: { code: 159, category: m },
++ p160: { code: 160, category: m },
++ p161: { code: 161, category: m },
++ p162: { code: 162, category: m },
++ p163: { code: 163, category: m },
++ p164: { code: 164, category: m },
++ p165: { code: 165, category: m },
++ p166: { code: 166, category: m },
++ p167: { code: 167, category: m },
++ p168: { code: 168, category: m },
++ p169: { code: 169, category: m },
++ p170: { code: 170, category: m },
++ p171: { code: 171, category: m },
++ p172: { code: 172, category: m },
++ p173: { code: 173, category: m },
++ p174: { code: 174, category: m },
++ p175: { code: 175, category: m },
++ p176: { code: 176, category: m },
++ p177: { code: 177, category: m },
++ p178: { code: 178, category: m },
++ p179: { code: 179, category: m },
++ p180: { code: 180, category: m },
++ p181: { code: 181, category: m },
++ p182: { code: 182, category: m },
++ p183: { code: 183, category: m },
++ p184: { code: 184, category: m },
++ p185: { code: 185, category: m },
++ p186: { code: 186, category: m },
++ p187: { code: 187, category: m },
++ p188: { code: 188, category: m },
++ p189: { code: 189, category: m },
++ p190: { code: 190, category: m },
++ p191: { code: 191, category: m },
++ p192: { code: 192, category: m },
++ p193: { code: 193, category: m },
++ p194: { code: 194, category: m },
++ p195: { code: 195, category: m },
++ p196: { code: 196, category: m },
++ p197: { code: 197, category: m },
++ p198: { code: 198, category: m },
++ p199: { code: 199, category: m },
++ p200: { code: 200, category: m },
++ p201: { code: 201, category: m },
++ p202: { code: 202, category: m },
++ p203: { code: 203, category: m },
++ p204: { code: 204, category: m },
++ p205: { code: 205, category: m },
++ p206: { code: 206, category: m },
++ p207: { code: 207, category: m },
++ p208: { code: 208, category: m },
++ p209: { code: 209, category: m },
++ p210: { code: 210, category: m },
++ p211: { code: 211, category: m },
++ p212: { code: 212, category: m },
++ p213: { code: 213, category: m },
++ p214: { code: 214, category: m },
++ p215: { code: 215, category: m },
++ p216: { code: 216, category: m },
++ p217: { code: 217, category: m },
++ p218: { code: 218, category: m },
++ p219: { code: 219, category: m },
++ p220: { code: 220, category: m },
++ p221: { code: 221, category: m },
++ p222: { code: 222, category: m },
++ p223: { code: 223, category: m },
++ p224: { code: 224, category: m },
++ p225: { code: 225, category: m },
++ p226: { code: 226, category: m },
++ p227: { code: 227, category: m },
++ p228: { code: 228, category: m },
++ p229: { code: 229, category: m },
++ p230: { code: 230, category: m },
++ p231: { code: 231, category: m },
++ p232: { code: 232, category: m },
++ p233: { code: 233, category: m },
++ p234: { code: 234, category: m },
++ p235: { code: 235, category: m },
++ p236: { code: 236, category: m },
++ p237: { code: 237, category: m },
++ p238: { code: 238, category: m },
++ p239: { code: 239, category: m },
++ p240: { code: 240, category: m },
++ p241: { code: 241, category: m },
++ p242: { code: 242, category: m },
++ p243: { code: 243, category: m },
++ p244: { code: 244, category: m },
++ p245: { code: 245, category: m },
++ p246: { code: 246, category: m },
++ p247: { code: 247, category: m },
++ p248: { code: 248, category: m },
++ p249: { code: 249, category: m },
++ p250: { code: 250, category: m },
++ p251: { code: 251, category: m },
++ p252: { code: 252, category: m },
++ p253: { code: 253, category: m },
++ p254: { code: 254, category: m },
++ p255: { code: 255, category: m },
++ p256: { code: 256, category: m },
++ p257: { code: 257, category: m },
++ p258: { code: 258, category: m },
++ p259: { code: 259, category: m },
++ p260: { code: 260, category: m },
++ p261: { code: 261, category: m },
++ p262: { code: 262, category: m },
++ p263: { code: 263, category: m },
++ p264: { code: 264, category: m },
++ p265: { code: 265, category: m },
++ p266: { code: 266, category: m },
++ p267: { code: 267, category: m },
++ p268: { code: 268, category: m },
++ p269: { code: 269, category: m },
++ p270: { code: 270, category: m },
++ p271: { code: 271, category: m },
++ p272: { code: 272, category: m },
++ p273: { code: 273, category: m },
++ p274: { code: 274, category: m },
++ p275: { code: 275, category: m },
++ p276: { code: 276, category: m },
++ p277: { code: 277, category: m },
++ p278: { code: 278, category: m },
++ p279: { code: 279, category: m },
++ p280: { code: 280, category: m },
++ p281: { code: 281, category: m },
++ p282: { code: 282, category: m },
++ p283: { code: 283, category: m },
++ p284: { code: 284, category: m },
++ p285: { code: 285, category: m },
++ p286: { code: 286, category: m },
++ p287: { code: 287, category: m },
++ p288: { code: 288, category: m },
++ p289: { code: 289, category: m },
++ p290: { code: 290, category: m },
++ p291: { code: 291, category: m },
++ p292: { code: 292, category: m },
++ p293: { code: 293, category: m },
++ p294: { code: 294, category: m },
++ p295: { code: 295, category: m },
++ p296: { code: 296, category: m },
++ p297: { code: 297, category: m },
++ p298: { code: 298, category: m },
++ p299: { code: 299, category: m },
++ p300: { code: 300, category: m },
++ p301: { code: 301, category: m },
++ p302: { code: 302, category: m },
++ p303: { code: 303, category: m },
++ p304: { code: 304, category: m },
++ p305: { code: 305, category: m },
++ p306: { code: 306, category: m },
++ p307: { code: 307, category: m },
++ p308: { code: 308, category: m },
++ p309: { code: 309, category: m },
++ p310: { code: 310, category: m },
++ p311: { code: 311, category: m },
++ p312: { code: 312, category: m },
++ p313: { code: 313, category: m },
++ p314: { code: 314, category: m },
++ p315: { code: 315, category: m },
++ p316: { code: 316, category: m },
++ p317: { code: 317, category: m },
++ p318: { code: 318, category: m },
++ p319: { code: 319, category: m },
++ p320: { code: 320, category: m },
++ p321: { code: 321, category: m },
++ p322: { code: 322, category: m },
++ p323: { code: 323, category: m },
++ p324: { code: 324, category: m },
++ p325: { code: 325, category: m },
++ p326: { code: 326, category: m },
++ p327: { code: 327, category: m },
++ p328: { code: 328, category: m },
++ p329: { code: 329, category: m },
++ p330: { code: 330, category: m },
++ p331: { code: 331, category: m },
++ p332: { code: 332, category: m },
++ p333: { code: 333, category: m },
++ p334: { code: 334, category: m },
++ p335: { code: 335, category: m },
++ p336: { code: 336, category: m },
++ p337: { code: 337, category: m },
++ p338: { code: 338, category: m },
++ p339: { code: 339, category: m },
++ p340: { code: 340, category: m },
++ p341: { code: 341, category: m },
++ p342: { code: 342, category: m },
++ p343: { code: 343, category: m },
++ p344: { code: 344, category: m },
++ p345: { code: 345, category: m },
++ p346: { code: 346, category: m },
++ p347: { code: 347, category: m },
++ p348: { code: 348, category: m },
++ p349: { code: 349, category: m },
++ p350: { code: 350, category: m },
++ p351: { code: 351, category: m },
++ p352: { code: 352, category: m },
++ p353: { code: 353, category: m },
++ p354: { code: 354, category: m },
++ p355: { code: 355, category: m },
++ p356: { code: 356, category: m },
++ p357: { code: 357, category: m },
++ p358: { code: 358, category: m },
++ p359: { code: 359, category: m },
++ p360: { code: 360, category: m },
++ p361: { code: 361, category: m },
++ p362: { code: 362, category: m },
++ p363: { code: 363, category: m },
++ p364: { code: 364, category: m },
++ p365: { code: 365, category: m },
++ p366: { code: 366, category: m },
++ p367: { code: 367, category: m },
++ p368: { code: 368, category: m },
++ p369: { code: 369, category: m },
++ p370: { code: 370, category: m },
++ p371: { code: 371, category: m },
++ p372: { code: 372, category: m },
++ p373: { code: 373, category: m },
++ p374: { code: 374, category: m },
++ p375: { code: 375, category: m },
++ p376: { code: 376, category: m },
++ p377: { code: 377, category: m },
++ p378: { code: 378, category: m },
++ p379: { code: 379, category: m },
++ p380: { code: 380, category: m },
++ p381: { code: 381, category: m },
++ p382: { code: 382, category: m },
++ p383: { code: 383, category: m },
++ p384: { code: 384, category: m },
++ p385: { code: 385, category: m },
++ p386: { code: 386, category: m },
++ p387: { code: 387, category: m },
++ p388: { code: 388, category: m },
++ p389: { code: 389, category: m },
++ p390: { code: 390, category: m },
++ p391: { code: 391, category: m },
++ p392: { code: 392, category: m },
++ p393: { code: 393, category: m },
++ p394: { code: 394, category: m },
++ p395: { code: 395, category: m },
++ p396: { code: 396, category: m },
++ p397: { code: 397, category: m },
++ p398: { code: 398, category: m },
++ p399: { code: 399, category: m },
++ p400: { code: 400, category: m },
++ p401: { code: 401, category: m },
++ p402: { code: 402, category: m },
++ p403: { code: 403, category: m },
++ p404: { code: 404, category: m },
++ p405: { code: 405, category: m },
++ p406: { code: 406, category: m },
++ p407: { code: 407, category: m },
++ p408: { code: 408, category: m },
++ p409: { code: 409, category: m },
++ p410: { code: 410, category: m },
++ p411: { code: 411, category: m },
++ p412: { code: 412, category: m },
++ p413: { code: 413, category: m },
++ p414: { code: 414, category: m },
++ p415: { code: 415, category: m },
++ p416: { code: 416, category: m },
++ p417: { code: 417, category: m },
++ p418: { code: 418, category: m },
++ p419: { code: 419, category: m },
++ p420: { code: 420, category: m },
++ p421: { code: 421, category: m },
++ p422: { code: 422, category: m },
++ p423: { code: 423, category: m },
++ p424: { code: 424, category: m },
++ p425: { code: 425, category: m },
++ p426: { code: 426, category: m },
++ p427: { code: 427, category: m },
++ p428: { code: 428, category: m },
++ p429: { code: 429, category: m },
++ p430: { code: 430, category: m },
++ p431: { code: 431, category: m },
++ p432: { code: 432, category: m },
++ p433: { code: 433, category: m },
++ p434: { code: 434, category: m },
++ p435: { code: 435, category: m },
++ p436: { code: 436, category: m },
++ p437: { code: 437, category: m },
++ p438: { code: 438, category: m },
++ p439: { code: 439, category: m },
++ p440: { code: 440, category: m },
++ p441: { code: 441, category: m },
++ p442: { code: 442, category: m },
++ p443: { code: 443, category: m },
++ p444: { code: 444, category: m },
++ p445: { code: 445, category: m },
++ p446: { code: 446, category: m },
++ p447: { code: 447, category: m },
++ p448: { code: 448, category: m },
++ p449: { code: 449, category: m },
++ p450: { code: 450, category: m },
++ p451: { code: 451, category: m },
++ p452: { code: 452, category: m },
++ p453: { code: 453, category: m },
++ p454: { code: 454, category: m },
++ p455: { code: 455, category: m },
++ p456: { code: 456, category: m },
++ p457: { code: 457, category: m },
++ p458: { code: 458, category: m },
++ p459: { code: 459, category: m },
++ p460: { code: 460, category: m },
++ p461: { code: 461, category: m },
++ p462: { code: 462, category: m },
++ p463: { code: 463, category: m },
++ p464: { code: 464, category: m },
++ p465: { code: 465, category: m },
++ p466: { code: 466, category: m },
++ p467: { code: 467, category: m },
++ p468: { code: 468, category: m },
++ p469: { code: 469, category: m },
++ p470: { code: 470, category: m },
++ p471: { code: 471, category: m },
++ p472: { code: 472, category: m },
++ p473: { code: 473, category: m },
++ p474: { code: 474, category: m },
++ p475: { code: 475, category: m },
++ p476: { code: 476, category: m },
++ p477: { code: 477, category: m },
++ p478: { code: 478, category: m },
++ p479: { code: 479, category: m },
++ p480: { code: 480, category: m },
++ p481: { code: 481, category: m },
++ p482: { code: 482, category: m },
++ p483: { code: 483, category: m },
++ p484: { code: 484, category: m },
++ p485: { code: 485, category: m },
++ p486: { code: 486, category: m },
++ p487: { code: 487, category: m },
++ p488: { code: 488, category: m },
++ p489: { code: 489, category: m },
++ p490: { code: 490, category: m },
++ p491: { code: 491, category: m },
++ p492: { code: 492, category: m },
++ p493: { code: 493, category: m },
++ p494: { code: 494, category: m },
++ p495: { code: 495, category: m },
++ p496: { code: 496, category: m },
++ p497: { code: 497, category: m },
++ p498: { code: 498, category: m },
++ p499: { code: 499, category: m }
++};
++
++var AccessorProperty = Java.type("jdk.nashorn.internal.runtime.AccessorProperty");
++var SpillProperty = Java.type("jdk.nashorn.internal.runtime.SpillProperty");
++
++Assert.assertTrue(Object.keys(fields).length === 3);
++Assert.assertTrue(Debug.map(fields).findProperty("p0").getClass() === AccessorProperty.class);
++Assert.assertTrue(Debug.map(fields).findProperty("p2").getClass() === AccessorProperty.class);
++
++Assert.assertTrue(Object.keys(spill).length === 500);
++Assert.assertTrue(Debug.map(spill).findProperty("p0").getClass() === SpillProperty.class);
++Assert.assertTrue(Debug.map(spill).findProperty("p499").getClass() === SpillProperty.class);
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/nosecurity/JDK-8080087.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,38 @@
++/*
++ * 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.
++ */
++
++/**
++ * JDK-8080087: Nashorn $ENV.PWD is originally undefined
++ *
++ * This is to ensure that $ENV.PWD is correctly set on Windows as well as on all
++ * other platforms.
++ *
++ * @test
++ * @option -scripting
++ * @run
++ */
++
++if (typeof($ENV.PWD) === 'undefined') {
++ fail('$ENV.PWD is undefined')
++}
++
+--- ./nashorn/test/script/sandbox/interfaceimpl.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/sandbox/interfaceimpl.js Wed Jul 01 21:54:30 2015 -0700
+@@ -29,8 +29,8 @@
+ * @security
+ */
+
+-var Window = Java.type("jdk.nashorn.api.scripting.Window");
+-var WindowEventHandler = Java.type("jdk.nashorn.api.scripting.WindowEventHandler");
++var Window = Java.type("jdk.nashorn.api.scripting.test.Window");
++var WindowEventHandler = Java.type("jdk.nashorn.api.scripting.test.WindowEventHandler");
+
+ var w = new Window();
+
+--- ./nashorn/test/script/trusted/JDK-8025629.js Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/script/trusted/JDK-8025629.js Wed Jul 01 21:54:30 2015 -0700
+@@ -28,6 +28,6 @@
+ * @run
+ */
+
+-load("classpath:jdk/nashorn/internal/runtime/resources/load_test.js")
++load("classpath:jdk/nashorn/internal/runtime/test/resources/load_test.js")
+
+ Assert.assertEquals(loadedFunc("hello"), "HELLO");
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/script/trusted/JDK-8067854.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,39 @@
++/*
++ * Copyright (c) 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.
++ */
++
++/**
++ * JDK-8067854: bound java static method throws NPE when 'null' is used for this argument
++ *
++ * @test
++ * @run
++ */
++
++getProp = java.lang.System.getProperty;
++
++// bind this and an argument. "null" for this as getProperty is a
++// static method of java.lang.System
++getHome = Function.prototype.bind.call(getProp, null, "java.home");
++
++if (getHome() != getProp("java.home")) {
++ fail("getHome() failed to get java.home");
++}
+--- ./nashorn/test/src/META-INF/services/java.sql.Driver Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/src/META-INF/services/java.sql.Driver Wed Jul 01 21:54:30 2015 -0700
+@@ -1,1 +1,1 @@
+-jdk.nashorn.api.NashornSQLDriver
++jdk.nashorn.api.test.NashornSQLDriver
+--- ./nashorn/test/src/jdk/internal/dynalink/beans/CallerSensitiveTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,37 +0,0 @@
+-/*
+- * Copyright (c) 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. 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.internal.dynalink.beans;
+-
+-import jdk.nashorn.test.models.ClassLoaderAware;
+-import org.testng.annotations.Test;
+-
+-@SuppressWarnings("javadoc")
+-public class CallerSensitiveTest {
+- @Test
+- public void testCallerSensitive() {
+- BeansLinker.getLinkerForClass(ClassLoaderAware.class);
+- }
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/internal/dynalink/beans/test/CallerSensitiveTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,38 @@
++/*
++ * Copyright (c) 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. 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.internal.dynalink.beans.test;
++
++import jdk.internal.dynalink.beans.BeansLinker;
++import jdk.nashorn.test.models.ClassLoaderAware;
++import org.testng.annotations.Test;
++
++@SuppressWarnings("javadoc")
++public class CallerSensitiveTest {
++ @Test
++ public void testCallerSensitive() {
++ BeansLinker.getLinkerForClass(ClassLoaderAware.class);
++ }
++}
+--- ./nashorn/test/src/jdk/nashorn/api/NashornSQLDriver.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,84 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api;
+-
+-import java.sql.Connection;
+-import java.sql.Driver;
+-import java.sql.DriverManager;
+-import java.sql.DriverPropertyInfo;
+-import java.sql.SQLException;
+-import java.sql.SQLFeatureNotSupportedException;
+-import java.util.Properties;
+-import java.util.logging.Logger;
+-
+-/**
+- * A dummy SQL driver for testing purpose.
+- */
+-public final class NashornSQLDriver implements Driver {
+- static {
+- try {
+- DriverManager.registerDriver(new NashornSQLDriver(), null);
+- } catch (final SQLException se) {
+- throw new RuntimeException(se);
+- }
+- }
+-
+- @Override
+- public boolean acceptsURL(final String url) {
+- return url.startsWith("jdbc:nashorn:");
+- }
+-
+- @Override
+- public Connection connect(final String url, final Properties info) {
+- throw new UnsupportedOperationException("I am a dummy!!");
+- }
+-
+- @Override
+- public int getMajorVersion() {
+- return -1;
+- }
+-
+- @Override
+- public int getMinorVersion() {
+- return -1;
+- }
+-
+- @Override
+- public DriverPropertyInfo[] getPropertyInfo(final String url, final Properties info) {
+- return new DriverPropertyInfo[0];
+- }
+-
+- @Override
+- public boolean jdbcCompliant() {
+- // no way!
+- return false;
+- }
+-
+- @Override
+- public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+- throw new SQLFeatureNotSupportedException();
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/ArrayConversionTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,235 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import static org.testng.AssertJUnit.assertEquals;
+-import static org.testng.AssertJUnit.assertFalse;
+-import static org.testng.AssertJUnit.assertNull;
+-import static org.testng.AssertJUnit.assertTrue;
+-import java.util.Arrays;
+-import java.util.List;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.TestNG;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-@SuppressWarnings("javadoc")
+-public class ArrayConversionTest {
+- private static ScriptEngine e = null;
+-
+- public static void main(final String[] args) {
+- TestNG.main(args);
+- }
+-
+- @BeforeClass
+- public static void setUpClass() {
+- e = new ScriptEngineManager().getEngineByName("nashorn");
+- }
+-
+- @AfterClass
+- public static void tearDownClass() {
+- e = null;
+- }
+-
+- @Test
+- public void testIntArrays() throws ScriptException {
+- runTest("assertNullIntArray", "null");
+- runTest("assertEmptyIntArray", "[]");
+- runTest("assertSingle42IntArray", "[42]");
+- runTest("assertSingle42IntArray", "['42']");
+- runTest("assertIntArrayConversions", "[false, true, NaN, Infinity, -Infinity, 0.4, 0.6, null, undefined, [], {}, [1], [1, 2]]");
+- }
+-
+- @Test
+- public void testIntIntArrays() throws ScriptException {
+- runTest("assertNullIntIntArray", "null");
+- runTest("assertEmptyIntIntArray", "[]");
+- runTest("assertSingleEmptyIntIntArray", "[[]]");
+- runTest("assertSingleNullIntIntArray", "[null]");
+- runTest("assertLargeIntIntArray", "[[false], [1], [2, 3], [4, 5, 6], ['7', {valueOf: function() { return 8 }}]]");
+- }
+-
+- @Test
+- public void testObjectObjectArrays() throws ScriptException {
+- runTest("assertLargeObjectObjectArray", "[[false], [1], ['foo', 42.3], [{x: 17}]]");
+- }
+-
+- @Test
+- public void testBooleanArrays() throws ScriptException {
+- runTest("assertBooleanArrayConversions", "[false, true, '', 'false', 0, 1, 0.4, 0.6, {}, [], [false], [true], NaN, Infinity, null, undefined]");
+- }
+-
+- @Test
+- public void testArrayAmbiguity() throws ScriptException {
+- runTest("x", "'abc'");
+- runTest("x", "['foo', 'bar']");
+- }
+-
+- @Test
+- public void testListArrays() throws ScriptException {
+- runTest("assertListArray", "[['foo', 'bar'], ['apple', 'orange']]");
+- }
+-
+- @Test
+- public void testVarArgs() throws ScriptException {
+- // Sole NativeArray in vararg position becomes vararg array itself
+- runTest("assertVarArg_42_17", "[42, 17]");
+- // NativeArray in vararg position becomes an argument if there are more arguments
+- runTest("assertVarArg_array_17", "[42], 18");
+- // Only NativeArray is converted to vararg array, other objects (e.g. a function) aren't
+- runTest("assertVarArg_function", "function() { return 'Hello' }");
+- }
+-
+- private static void runTest(final String testMethodName, final String argument) throws ScriptException {
+- e.eval("Java.type('" + ArrayConversionTest.class.getName() + "')." + testMethodName + "(" + argument + ")");
+- }
+-
+- public static void assertNullIntArray(final int[] array) {
+- assertNull(array);
+- }
+-
+- public static void assertNullIntIntArray(final int[][] array) {
+- assertNull(array);
+- }
+-
+- public static void assertEmptyIntArray(final int[] array) {
+- assertEquals(0, array.length);
+- }
+-
+- public static void assertSingle42IntArray(final int[] array) {
+- assertEquals(1, array.length);
+- assertEquals(42, array[0]);
+- }
+-
+-
+- public static void assertIntArrayConversions(final int[] array) {
+- assertEquals(13, array.length);
+- assertEquals(0, array[0]); // false
+- assertEquals(1, array[1]); // true
+- assertEquals(0, array[2]); // NaN
+- assertEquals(0, array[3]); // Infinity
+- assertEquals(0, array[4]); // -Infinity
+- assertEquals(0, array[5]); // 0.4
+- assertEquals(0, array[6]); // 0.6 - floor, not round
+- assertEquals(0, array[7]); // null
+- assertEquals(0, array[8]); // undefined
+- assertEquals(0, array[9]); // []
+- assertEquals(0, array[10]); // {}
+- assertEquals(1, array[11]); // [1]
+- assertEquals(0, array[12]); // [1, 2]
+- }
+-
+- public static void assertEmptyIntIntArray(final int[][] array) {
+- assertEquals(0, array.length);
+- }
+-
+- public static void assertSingleEmptyIntIntArray(final int[][] array) {
+- assertEquals(1, array.length);
+- assertTrue(Arrays.equals(new int[0], array[0]));
+- }
+-
+- public static void assertSingleNullIntIntArray(final int[][] array) {
+- assertEquals(1, array.length);
+- assertNull(null, array[0]);
+- }
+-
+- public static void assertLargeIntIntArray(final int[][] array) {
+- assertEquals(5, array.length);
+- assertTrue(Arrays.equals(new int[] { 0 }, array[0]));
+- assertTrue(Arrays.equals(new int[] { 1 }, array[1]));
+- assertTrue(Arrays.equals(new int[] { 2, 3 }, array[2]));
+- assertTrue(Arrays.equals(new int[] { 4, 5, 6 }, array[3]));
+- assertTrue(Arrays.equals(new int[] { 7, 8 }, array[4]));
+- }
+-
+- public static void assertLargeObjectObjectArray(final Object[][] array) throws ScriptException {
+- assertEquals(4, array.length);
+- assertTrue(Arrays.equals(new Object[] { Boolean.FALSE }, array[0]));
+- assertTrue(Arrays.equals(new Object[] { 1 }, array[1]));
+- assertTrue(Arrays.equals(new Object[] { "foo", 42.3d }, array[2]));
+- assertEquals(1, array[3].length);
+- e.getBindings(ScriptContext.ENGINE_SCOPE).put("obj", array[3][0]);
+- assertEquals(17, e.eval("obj.x"));
+- }
+-
+- public static void assertBooleanArrayConversions(final boolean[] array) {
+- assertEquals(16, array.length);
+- assertFalse(array[0]); // false
+- assertTrue(array[1]); // true
+- assertFalse(array[2]); // ''
+- assertTrue(array[3]); // 'false' (yep, every non-empty string converts to true)
+- assertFalse(array[4]); // 0
+- assertTrue(array[5]); // 1
+- assertTrue(array[6]); // 0.4
+- assertTrue(array[7]); // 0.6
+- assertTrue(array[8]); // {}
+- assertTrue(array[9]); // []
+- assertTrue(array[10]); // [false]
+- assertTrue(array[11]); // [true]
+- assertFalse(array[12]); // NaN
+- assertTrue(array[13]); // Infinity
+- assertFalse(array[14]); // null
+- assertFalse(array[15]); // undefined
+- }
+-
+- public static void assertListArray(final List<?>[] array) {
+- assertEquals(2, array.length);
+- assertEquals(Arrays.asList("foo", "bar"), array[0]);
+- assertEquals(Arrays.asList("apple", "orange"), array[1]);
+- }
+-
+- public static void assertVarArg_42_17(final Object... args) {
+- assertEquals(2, args.length);
+- assertEquals(42, ((Number)args[0]).intValue());
+- assertEquals(17, ((Number)args[1]).intValue());
+- }
+-
+- public static void assertVarArg_array_17(final Object... args) throws ScriptException {
+- assertEquals(2, args.length);
+- e.getBindings(ScriptContext.ENGINE_SCOPE).put("arr", args[0]);
+- assertTrue((Boolean)e.eval("arr instanceof Array && arr.length == 1 && arr[0] == 42"));
+- assertEquals(18, ((Number)args[1]).intValue());
+- }
+-
+- public static void assertVarArg_function(final Object... args) throws ScriptException {
+- assertEquals(1, args.length);
+- e.getBindings(ScriptContext.ENGINE_SCOPE).put("fn", args[0]);
+- assertEquals("Hello", e.eval("fn()"));
+- }
+-
+-
+-
+- public static void x(final String y) {
+- assertEquals("abc", y);
+- }
+- public static void x(final String[] y) {
+- assertTrue(Arrays.equals(new String[] { "foo", "bar"}, y));
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,219 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import static org.testng.AssertJUnit.assertEquals;
+-import static org.testng.AssertJUnit.assertTrue;
+-import java.util.Arrays;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.TestNG;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-/**
+- * @test
+- * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.BooleanAccessTest
+- * @run testng/othervm jdk.nashorn.api.javaaccess.BooleanAccessTest
+- */
+-@SuppressWarnings("javadoc")
+-public class BooleanAccessTest {
+-
+- private static ScriptEngine e = null;
+- private static SharedObject o = null;
+-
+- public static void main(final String[] args) {
+- TestNG.main(args);
+- }
+-
+- @BeforeClass
+- public static void setUpClass() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- e = m.getEngineByName("nashorn");
+- o = new SharedObject();
+- e.put("o", o);
+- e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;");
+- }
+-
+- @AfterClass
+- public static void tearDownClass() {
+- e = null;
+- o = null;
+- }
+-
+- @Test
+- public void accessFieldBoolean() throws ScriptException {
+- e.eval("var p_boolean = o.publicBoolean;");
+- assertEquals(o.publicBoolean, e.get("p_boolean"));
+- assertEquals("boolean", e.eval("typeof p_boolean;"));
+- e.eval("o.publicBoolean = false;");
+- assertEquals(false, o.publicBoolean);
+- }
+-
+- @Test
+- public void accessFieldBooleanArray() throws ScriptException {
+- e.eval("var p_boolean_array = o.publicBooleanArray;");
+- assertEquals(o.publicBooleanArray[0], e.eval("o.publicBooleanArray[0]"));
+- assertTrue(Arrays.equals(o.publicBooleanArray, (boolean[])e.get("p_boolean_array")));
+- e.eval("var t_boolean_arr = new (Java.type(\"boolean[]\"))(3);" +
+- "t_boolean_arr[0] = true;" +
+- "t_boolean_arr[1] = false;" +
+- "t_boolean_arr[2] = false;" +
+- "o.publicBooleanArray = t_boolean_arr;");
+- assertTrue(Arrays.equals(new boolean[] { true, false, false }, o.publicBooleanArray));
+- e.eval("o.publicBooleanArray[0] = false;");
+- assertEquals(false, o.publicBooleanArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFieldBoolean() throws ScriptException {
+- e.eval("var ps_boolean = SharedObject.publicStaticBoolean;");
+- assertEquals(SharedObject.publicStaticBoolean, e.get("ps_boolean"));
+- assertEquals("boolean", e.eval("typeof ps_boolean;"));
+- e.eval("SharedObject.publicStaticBoolean = false;");
+- assertEquals(false, SharedObject.publicStaticBoolean);
+- }
+-
+- @Test
+- public void accessStaticFieldBooleanArray() throws ScriptException {
+- e.eval("var ps_boolean_array = SharedObject.publicStaticBooleanArray;");
+- assertEquals(SharedObject.publicStaticBooleanArray[0], e.eval("SharedObject.publicStaticBooleanArray[0]"));
+- assertTrue(Arrays.equals(SharedObject.publicStaticBooleanArray, (boolean[])e.get("ps_boolean_array")));
+- e.eval("var ts_boolean_arr = new (Java.type(\"boolean[]\"))(3);" +
+- "ts_boolean_arr[0] = true;" +
+- "ts_boolean_arr[1] = false;" +
+- "ts_boolean_arr[2] = true;" +
+- "SharedObject.publicStaticBooleanArray = ts_boolean_arr;");
+- assertTrue(Arrays.equals(new boolean[] { true, false, true }, SharedObject.publicStaticBooleanArray));
+- e.eval("SharedObject.publicStaticBooleanArray[0] = false;");
+- assertEquals(false, SharedObject.publicStaticBooleanArray[0]);
+- }
+-
+- @Test
+- public void accessFinalFieldBoolean() throws ScriptException {
+- e.eval("var pf_boolean = o.publicFinalBoolean;");
+- assertEquals(o.publicFinalBoolean, e.get("pf_boolean"));
+- assertEquals("boolean", e.eval("typeof pf_boolean;"));
+- e.eval("o.publicFinalBoolean = false;");
+- assertEquals(true, o.publicFinalBoolean);
+- }
+-
+- @Test
+- public void accessFinalFieldBooleanArray() throws ScriptException {
+- e.eval("var pf_boolean_array = o.publicFinalBooleanArray;");
+- assertEquals(o.publicFinalBooleanArray[0], e.eval("o.publicFinalBooleanArray[0]"));
+- assertTrue(Arrays.equals(o.publicFinalBooleanArray, (boolean[])e.get("pf_boolean_array")));
+- e.eval("var tf_boolean_arr = new (Java.type(\"boolean[]\"))(3);" +
+- "tf_boolean_arr[0] = false;" +
+- "tf_boolean_arr[1] = false;" +
+- "tf_boolean_arr[2] = true;" +
+- "o.publicOFinalbjectArray = tf_boolean_arr;");
+- assertTrue(Arrays.equals(new boolean[] { false, false, true, false }, o.publicFinalBooleanArray));
+- e.eval("o.publicFinalBooleanArray[0] = true;");
+- assertEquals(true, o.publicFinalBooleanArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldBoolean() throws ScriptException {
+- e.eval("var psf_boolean = SharedObject.publicStaticFinalBoolean;");
+- assertEquals(SharedObject.publicStaticFinalBoolean, e.get("psf_boolean"));
+- assertEquals("boolean", e.eval("typeof psf_boolean;"));
+- e.eval("SharedObject.publicStaticFinalBoolean = false;");
+- assertEquals(true, SharedObject.publicStaticFinalBoolean);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldBooleanArray() throws ScriptException {
+- e.eval("var psf_boolean_array = SharedObject.publicStaticFinalBooleanArray;");
+- assertEquals(SharedObject.publicStaticFinalBooleanArray[0], e.eval("SharedObject.publicStaticFinalBooleanArray[0]"));
+- assertTrue(Arrays.equals(SharedObject.publicStaticFinalBooleanArray, (boolean[])e.get("psf_boolean_array")));
+- e.eval("var tsf_boolean_arr = new (Java.type(\"boolean[]\"))(3);" +
+- "tsf_boolean_arr[0] = false;" +
+- "tsf_boolean_arr[1] = true;" +
+- "tsf_boolean_arr[2] = false;" +
+- "SharedObject.publicStaticFinalBooleanArray = tsf_boolean_arr;");
+- assertTrue(Arrays.equals(new boolean[] { false, true, false, false }, SharedObject.publicStaticFinalBooleanArray));
+- e.eval("SharedObject.publicStaticFinalBooleanArray[0] = true;");
+- assertEquals(true, SharedObject.publicStaticFinalBooleanArray[0]);
+- }
+-
+- @Test
+- public void accessFieldBooleanBoxing() throws ScriptException {
+- e.eval("var p_boolean_box = o.publicBooleanBox;");
+- assertEquals(o.publicBooleanBox, e.get("p_boolean_box"));
+- assertEquals("boolean", e.eval("typeof p_boolean_box;"));
+- e.eval("o.publicBooleanBox = false;");
+- assertEquals(false, (boolean)o.publicBooleanBox);
+- }
+-
+- @Test
+- public void accessStaticFieldBooleanBoxing() throws ScriptException {
+- e.eval("var ps_boolean_box = SharedObject.publicStaticBooleanBox;");
+- assertEquals(SharedObject.publicStaticBooleanBox, e.get("ps_boolean_box"));
+- assertEquals("boolean", e.eval("typeof ps_boolean_box;"));
+- e.eval("SharedObject.publicStaticBooleanBox = false;");
+- assertEquals(false, (boolean)SharedObject.publicStaticBooleanBox);
+- }
+-
+- @Test
+- public void accessFinalFieldBooleanBoxing() throws ScriptException {
+- e.eval("var pf_boolean_box = o.publicFinalBooleanBox;");
+- assertEquals(o.publicFinalBooleanBox, e.get("pf_boolean_box"));
+- assertEquals("boolean", e.eval("typeof pf_boolean_box;"));
+- e.eval("o.publicFinalBooleanBox = false;");
+- assertEquals(true, (boolean)o.publicFinalBooleanBox);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldBooleanBoxing() throws ScriptException {
+- e.eval("var psf_boolean_box = SharedObject.publicStaticFinalBooleanBox;");
+- assertEquals(SharedObject.publicStaticFinalBooleanBox, e.get("psf_boolean_box"));
+- assertEquals("boolean", e.eval("typeof psf_boolean_box;"));
+- e.eval("SharedObject.publicStaticFinalBooleanBox = false;");
+- assertEquals(true, (boolean)SharedObject.publicStaticFinalBooleanBox);
+- }
+-
+- @Test
+- public void accessVolatileField() throws ScriptException {
+- e.eval("var pv_boolean = o.volatileBoolean;");
+- assertEquals(o.volatileBoolean, e.get("pv_boolean"));
+- assertEquals("boolean", e.eval("typeof pv_boolean;"));
+- e.eval("o.volatileBoolean = false;");
+- assertEquals(false, o.volatileBoolean);
+- }
+-
+- @Test
+- public void accessTransientField() throws ScriptException {
+- e.eval("var pt_boolean = o.transientBoolean;");
+- assertEquals(o.transientBoolean, e.get("pt_boolean"));
+- assertEquals("boolean", e.eval("typeof pt_boolean;"));
+- e.eval("o.transientBoolean = false;");
+- assertEquals(false, o.transientBoolean);
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/ConsStringTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,99 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import static org.testng.AssertJUnit.assertEquals;
+-import java.util.HashMap;
+-import java.util.Map;
+-import javax.script.Bindings;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import jdk.nashorn.api.scripting.JSObject;
+-import org.testng.TestNG;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-@SuppressWarnings("javadoc")
+-public class ConsStringTest {
+- private static ScriptEngine e = null;
+-
+- public static void main(final String[] args) {
+- TestNG.main(args);
+- }
+-
+- @BeforeClass
+- public static void setUpClass() {
+- e = new ScriptEngineManager().getEngineByName("nashorn");
+- }
+-
+- @AfterClass
+- public static void tearDownClass() {
+- e = null;
+- }
+-
+- @Test
+- public void testConsStringFlattening() throws ScriptException {
+- final Bindings b = e.getBindings(ScriptContext.ENGINE_SCOPE);
+- final Map<Object, Object> m = new HashMap<>();
+- b.put("m", m);
+- e.eval("var x = 'f'; x += 'oo'; var y = 'b'; y += 'ar'; m.put(x, y)");
+- assertEquals("bar", m.get("foo"));
+- }
+-
+- @Test
+- public void testConsStringFromMirror() throws ScriptException {
+- final Bindings b = e.getBindings(ScriptContext.ENGINE_SCOPE);
+- //final Map<Object, Object> m = new HashMap<>();
+- e.eval("var x = 'f'; x += 'oo'; var obj = {x: x};");
+- assertEquals("foo", ((JSObject)b.get("obj")).getMember("x"));
+- }
+-
+- @Test
+- public void testArrayConsString() throws ScriptException {
+- final Bindings b = e.getBindings(ScriptContext.ENGINE_SCOPE);
+- final ArrayHolder h = new ArrayHolder();
+- b.put("h", h);
+- e.eval("var x = 'f'; x += 'oo'; h.array = [x];");
+- assertEquals(1, h.array.length);
+- assertEquals("foo", h.array[0]);
+- }
+-
+-
+- public static class ArrayHolder {
+- private Object[] array;
+-
+- public void setArray(final Object[] array) {
+- this.array = array;
+- }
+-
+- public Object[] getArray() {
+- return array;
+- }
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,466 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import static org.testng.AssertJUnit.assertEquals;
+-import static org.testng.AssertJUnit.assertTrue;
+-import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
+-import java.util.Arrays;
+-import java.util.Calendar;
+-import java.util.Locale;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.TestNG;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-/**
+- * @test
+- * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.MethodAccessTest
+- * @run testng/othervm jdk.nashorn.api.javaaccess.MethodAccessTest
+- */
+-@SuppressWarnings("javadoc")
+-public class MethodAccessTest {
+-
+- private static ScriptEngine e = null;
+- private static SharedObject o = null;
+-
+- public static void main(final String[] args) {
+- TestNG.main(args);
+- }
+-
+- @BeforeClass
+- public static void setUpClass() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- e = m.getEngineByName("nashorn");
+- o = new SharedObject();
+- o.setEngine(e);
+- e.put("o", o);
+- e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;");
+- e.eval("var Person = Packages.jdk.nashorn.api.javaaccess.Person;");
+- }
+-
+- @AfterClass
+- public static void tearDownClass() {
+- e = null;
+- o = null;
+- }
+-
+- @Test
+- public void accessMethodthrowsCheckedException() throws ScriptException {
+- e.eval("try {" +
+- " var a = java.lang.Long.parseLong('foo');" +
+- "} catch(e) {" +
+- " var isThrown = true;" +
+- " var isNumberException = e instanceof java.lang.NumberFormatException;" +
+- "} finally {" +
+- " var isFinalized = true;" +
+- "}");
+- assertEquals("Exception thrown", true, e.get("isThrown"));
+- assertEquals("Finally called", true, e.get("isFinalized"));
+- assertEquals("Type is NumberFormatException", true, e.get("isNumberException"));
+- }
+-
+- @Test
+- public void accessMethodthrowsUnCheckedException() throws ScriptException {
+- e.eval("try {" +
+- " var a = java.lang.String.valueOf(null);" +
+- "} catch(e) {" +
+- " var isThrown = true;" +
+- " var isNumberException = e instanceof java.lang.NullPointerException;" +
+- "} finally {" +
+- " var isFinalized = true;" +
+- "}");
+- assertEquals(true, e.get("isThrown"));
+- assertEquals(true, e.get("isFinalized"));
+- assertEquals(true, e.get("isNumberException"));
+- }
+-
+- @Test
+- public void accessMethodStartsThread() throws ScriptException {
+- e.eval("o.methodStartsThread();");
+- assertEquals(false, o.isFinished);
+- }
+-
+- @Test
+- public void accessStaticMethod() throws ScriptException {
+- assertEquals(10, e.eval("java.lang.Math.abs(-10);"));
+- }
+-
+- @Test
+- public void accessSynchronousMethod() throws ScriptException {
+- e.eval("var v = new java.util.Vector();" + "v.add(10);" + "v.add(20);" + "v.add(30);");
+- assertEquals(10, e.eval("v[0]"));
+- assertEquals(20, e.eval("v[1]"));
+- assertEquals(30, e.eval("v[2]"));
+- assertEquals(3, e.eval("v.size()"));
+- }
+-
+- @Test
+- public void accessStaticSynchronousMethod() throws ScriptException {
+- e.eval("var locales = java.util.Calendar.getAvailableLocales();");
+- final Locale[] locales = (Locale[])e.get("locales");
+- assertEquals(locales.length, Calendar.getAvailableLocales().length);
+- }
+-
+- @Test
+- public void accessNativeMethod() throws ScriptException {
+- assertEquals(4.0, e.eval("java.lang.StrictMath.log10(10000);"));
+- }
+-
+- @Test
+- public void accessConstructorOfAbstractClass() throws ScriptException {
+- e.eval("try {" +
+- " var a = new java.util.AbstractList();" +
+- " print('fail');" +
+- "} catch(e) {" +
+- " var isThrown = true;" +
+- "}");
+- assertEquals(true, e.get("isThrown"));
+- }
+-
+- @Test
+- public void accessMethodVoid() throws ScriptException {
+- o.isAccessed = false;
+- e.eval("o.voidMethod();");
+- assertTrue(o.isAccessed);
+- }
+-
+- @Test
+- public void accessMethodBoolean() throws ScriptException {
+- assertEquals(true, e.eval("o.booleanMethod(false);"));
+- assertEquals(false, e.eval("o.booleanMethod(true);"));
+- assertEquals(false, e.eval("o.booleanMethod('false');"));
+- assertEquals(true, e.eval("o.booleanMethod('');"));
+- assertEquals(true, e.eval("o.booleanMethod(0);"));
+- }
+-
+- @Test
+- public void accessMethodInt() throws ScriptException {
+- assertEquals(0, e.eval("o.intMethod(0);"));
+- assertEquals(-200, e.eval("o.intMethod(-100);"));
+- assertEquals(0, e.eval("o.intMethod('0');"));
+- assertEquals(-200, e.eval("o.intMethod('-100');"));
+- }
+-
+- @Test
+- public void accessMethodLong() throws ScriptException {
+- assertEquals((long)0, e.eval("o.longMethod(0);"));
+- assertEquals((long)400, e.eval("o.longMethod(200);"));
+- assertEquals((long) 0, e.eval("o.longMethod('0');"));
+- assertEquals((long) 400, e.eval("o.longMethod('200');"));
+- }
+-
+- @Test
+- public void accessMethodByte() throws ScriptException {
+- assertEquals((byte) 0, e.eval("o.byteMethod(0);"));
+- assertEquals((byte) 10, e.eval("o.byteMethod(5);"));
+- assertEquals((byte) 0, e.eval("o.byteMethod('0');"));
+- assertEquals((byte) 10, e.eval("o.byteMethod('5');"));
+- }
+-
+- @Test
+- public void accessMethodShort() throws ScriptException {
+- assertEquals((short)0, e.eval("o.shortMethod(0);"));
+- assertEquals((short)8000, e.eval("o.shortMethod(4000);"));
+- assertEquals((short) 0, e.eval("o.shortMethod('0');"));
+- assertEquals((short) 8000, e.eval("o.shortMethod('4000');"));
+- }
+-
+- @Test
+- public void accessMethodChar() throws ScriptException {
+- assertEquals('A', e.eval("o.charMethod('a');"));
+- assertEquals('Z', e.eval("o.charMethod('z');"));
+- assertEquals(o.charMethod((char)0), e.eval("o.charMethod(0);"));
+- assertEquals(o.charMethod((char)3150), e.eval("o.charMethod(3150);"));
+- }
+-
+- @Test
+- public void accessMethodFloat() throws ScriptException {
+- assertEquals(0.0f, e.eval("o.floatMethod(0.0);"));
+- assertEquals(4.2f, e.eval("o.floatMethod(2.1);"));
+- assertEquals(0.0f, e.eval("o.floatMethod('0.0');"));
+- assertEquals(4.2f, e.eval("o.floatMethod('2.1');"));
+- }
+-
+- @Test
+- public void accessMethodDouble() throws ScriptException {
+- assertEquals(0.0, e.eval("o.doubleMethod(0.0);"));
+- assertEquals(14.0, e.eval("o.doubleMethod(7.0);"));
+- assertEquals(0.0, e.eval("o.doubleMethod('0.0');"));
+- assertEquals(14.0, e.eval("o.doubleMethod('7.0');"));
+- }
+-
+- @Test
+- public void accessMethodBooleanBoxing() throws ScriptException {
+- assertEquals(Boolean.TRUE, e.eval("o.booleanBoxingMethod(java.lang.Boolean.FALSE);"));
+- assertEquals(Boolean.FALSE, e.eval("o.booleanBoxingMethod(java.lang.Boolean.TRUE);"));
+- assertEquals(Boolean.TRUE, e.eval("o.booleanBoxingMethod('');"));
+- assertEquals(Boolean.FALSE, e.eval("o.booleanBoxingMethod('false');"));
+- }
+-
+- @Test
+- public void accessMethodIntBoxing() throws ScriptException {
+- assertEquals(0, e.eval("o.intBoxingMethod(0);"));
+- assertEquals(-200, e.eval("o.intBoxingMethod(-100);"));
+- assertTrue((int)e.eval("(new java.lang.Integer(2)).compareTo(10.0)") < 0);
+- }
+-
+- @Test
+- public void accessMethodLongBoxing() throws ScriptException {
+- assertEquals((long) 0, e.eval("o.longBoxingMethod(0);"));
+- assertEquals((long) 400, e.eval("o.longBoxingMethod(200);"));
+- assertTrue((int)e.eval("(new java.lang.Long(2)).compareTo(10.0)") < 0);
+- }
+-
+- @Test
+- public void accessMethodByteBoxing() throws ScriptException {
+- assertEquals((byte) 0, e.eval("o.byteBoxingMethod(0);"));
+- assertEquals((byte) 10, e.eval("o.byteBoxingMethod(5);"));
+- assertTrue((int)e.eval("(new java.lang.Byte(2)).compareTo(10.0)") < 0);
+- }
+-
+- @Test
+- public void accessMethodShortBoxing() throws ScriptException {
+- assertEquals((short) 0, e.eval("o.shortBoxingMethod(0);"));
+- assertEquals((short) 8000, e.eval("o.shortBoxingMethod(4000);"));
+- assertTrue((int)e.eval("(new java.lang.Short(2)).compareTo(10.0)") < 0);
+- }
+-
+- @Test
+- public void accessMethodCharBoxing() throws ScriptException {
+- assertEquals('A', e.eval("o.charBoxingMethod('a');"));
+- assertEquals('Z', e.eval("o.charBoxingMethod('z');"));
+- assertTrue((int)e.eval("(new java.lang.Character(2)).compareTo(10)") < 0);
+- }
+-
+- @Test
+- public void accessMethodFloatBoxing() throws ScriptException {
+- assertEquals(0.0f, e.eval("o.floatBoxingMethod(0.0);"));
+- assertEquals(4.2f, e.eval("o.floatBoxingMethod(2.1);"));
+- assertTrue((int)e.eval("(new java.lang.Float(2.0)).compareTo(10.0)") < 0);
+- }
+-
+- @Test
+- public void accessMethodDoubleBoxing() throws ScriptException {
+- assertEquals(0.0, e.eval("o.doubleBoxingMethod(0.0);"));
+- assertEquals(14.0, e.eval("o.doubleBoxingMethod(7.0);"));
+- assertTrue((int)e.eval("(new java.lang.Double(2)).compareTo(10.0)") < 0);
+- }
+-
+- @Test
+- public void accessMethodString() throws ScriptException {
+- assertEquals("", e.eval("o.stringMethod('');"));
+- assertEquals("abcabc", e.eval("o.stringMethod('abc');"));
+- }
+-
+- @Test
+- public void accessMethodObject() throws ScriptException {
+- e.put("so", new Person(5));
+- e.eval("var rso = o.objectMethod(so);");
+- assertEquals(new Person(10), e.get("rso"));
+- }
+-
+- @Test
+- public void accessMethodBooleanArray() throws ScriptException {
+- assertTrue(Arrays.equals(o.booleanArrayMethod(o.publicBooleanArray), (boolean[])e.eval("o.booleanArrayMethod(o.publicBooleanArray);")));
+- }
+-
+- @Test
+- public void accessMethodIntArray() throws ScriptException {
+- assertArrayEquals(o.intArrayMethod(o.publicIntArray), (int[])e.eval("o.intArrayMethod(o.publicIntArray);"));
+- }
+-
+- @Test
+- public void accessMethodLongArray() throws ScriptException {
+- assertArrayEquals(o.longArrayMethod(o.publicLongArray), (long[])e.eval("o.longArrayMethod(o.publicLongArray);"));
+- }
+-
+- @Test
+- public void accessMethodByteArray() throws ScriptException {
+- assertArrayEquals(o.byteArrayMethod(o.publicByteArray), (byte[])e.eval("o.byteArrayMethod(o.publicByteArray);"));
+- }
+-
+- @Test
+- public void accessMethodShortArray() throws ScriptException {
+- assertArrayEquals(o.shortArrayMethod(o.publicShortArray), (short[])e.eval("o.shortArrayMethod(o.publicShortArray);"));
+- }
+-
+- @Test
+- public void accessMethodCharArray() throws ScriptException {
+- assertArrayEquals(o.charArrayMethod(o.publicCharArray), (char[])e.eval("o.charArrayMethod(o.publicCharArray);"));
+- }
+-
+- @Test
+- public void accessMethodFloatArray() throws ScriptException {
+- assertArrayEquals(o.floatArrayMethod(o.publicFloatArray), (float[])e.eval("o.floatArrayMethod(o.publicFloatArray);"), 1e-10f);
+- }
+-
+- @Test
+- public void accessMethodDoubleArray() throws ScriptException {
+- assertArrayEquals(o.doubleArrayMethod(o.publicDoubleArray), (double[])e.eval("o.doubleArrayMethod(o.publicDoubleArray);"), 1e-10);
+- }
+-
+- @Test
+- public void accessMethodStringArray() throws ScriptException {
+- assertArrayEquals(o.stringArrayMethod(o.publicStringArray), (String[])e.eval("o.stringArrayMethod(o.publicStringArray);"));
+- }
+-
+- @Test
+- public void accessMethodObjectArray() throws ScriptException {
+- assertArrayEquals(o.objectArrayMethod(o.publicObjectArray), (Person[])e.eval("o.objectArrayMethod(o.publicObjectArray);"));
+- }
+-
+- @Test
+- public void accessDefaultConstructor() throws ScriptException {
+- e.eval("var dc = new Packages.jdk.nashorn.api.javaaccess.Person()");
+- assertEquals(new Person(), e.get("dc"));
+- }
+-
+- @Test
+- public void accessCustomConstructor() throws ScriptException {
+- e.eval("var cc = new Packages.jdk.nashorn.api.javaaccess.Person(17)");
+- assertEquals(new Person(17), e.get("cc"));
+- }
+-
+- @Test
+- public void accessMethod2PrimitiveParams() throws ScriptException {
+- assertEquals(o.twoParamMethod(50, 40.0), e.eval("o.twoParamMethod(50,40);"));
+- }
+-
+- @Test
+- public void accessMethod3PrimitiveParams() throws ScriptException {
+- assertEquals(o.threeParamMethod((short)10, 20L, 'b'), e.eval("o.threeParamMethod(10,20,'b');"));
+- }
+-
+- @Test
+- public void accessMethod2ObjectParams() throws ScriptException {
+- assertArrayEquals(new Person[] { new Person(200), new Person(300) }, (Person[])e.eval("o.twoObjectParamMethod(new Person(300),new Person(200));"));
+- }
+-
+- @Test
+- public void accessMethod3ObjectParams() throws ScriptException {
+- assertArrayEquals(new Person[] { new Person(3), new Person(2), new Person(1) }, (Person[])e.eval("o.threeObjectParamMethod(new Person(1),new Person(2),new Person(3));"));
+- }
+-
+- @Test
+- public void accessMethod8ObjectParams() throws ScriptException {
+- assertArrayEquals(new Person[] { new Person(8), new Person(7), new Person(6), new Person(5), new Person(4), new Person(3), new Person(2), new Person(1) }, (Person[])e.eval("o.eightObjectParamMethod(new Person(1),new Person(2),new Person(3)," + "new Person(4),new Person(5),new Person(6),new Person(7),new Person(8));"));
+- }
+-
+- @Test
+- public void accessMethod9ObjectParams() throws ScriptException {
+- assertArrayEquals(new Person[] { new Person(9), new Person(8), new Person(7), new Person(6), new Person(5), new Person(4), new Person(3), new Person(2), new Person(1) }, (Person[])e.eval("o.nineObjectParamMethod(new Person(1),new Person(2),new Person(3)," + "new Person(4),new Person(5),new Person(6)," + "new Person(7),new Person(8),new Person(9));"));
+- }
+-
+- @Test
+- public void accessMethodObjectEllipsis() throws ScriptException {
+- assertArrayEquals(new Person[] { new Person(9), new Person(8), new Person(7), new Person(6), new Person(5), new Person(4), new Person(3), new Person(2), new Person(1) }, (Person[])e.eval("o.methodObjectEllipsis(new Person(1),new Person(2),new Person(3)," + "new Person(4),new Person(5),new Person(6)," + "new Person(7),new Person(8),new Person(9));"));
+- assertArrayEquals(new Person[] {}, (Person[])e.eval("o.methodObjectEllipsis()"));
+- assertArrayEquals(new Person[] { new Person(9) }, (Person[])e.eval("o.methodObjectEllipsis(new Person(9))"));
+- }
+-
+- @Test
+- public void accessMethodPrimitiveEllipsis() throws ScriptException {
+- assertArrayEquals(new Person[] { new Person(1), new Person(3), new Person(2) }, (Person[])e.eval("o.methodPrimitiveEllipsis(1,3,2);"));
+- assertArrayEquals(new Person[] {}, (Person[])e.eval("o.methodPrimitiveEllipsis();"));
+- assertArrayEquals(o.methodPrimitiveEllipsis(9, 8, 7, 6, 5, 4, 3, 2, 1), (Person[])e.eval("o.methodPrimitiveEllipsis(9,8,7,6,5,4,3,2,1);"));
+- }
+-
+- @Test
+- public void accessMethodMixedEllipsis() throws ScriptException {
+- assertArrayEquals(new Object[] { new Person(1), 12, "hello", true }, (Object[])e.eval("o.methodMixedEllipsis(new Person(1),12,'hello',true);"));
+- assertArrayEquals(new Object[] {}, (Object[])e.eval("o.methodMixedEllipsis();"));
+- }
+-
+- @Test
+- public void accessMethodObjectWithEllipsis() throws ScriptException {
+- assertArrayEquals(new Object[] { "hello", 12, 15, 16 }, (Object[])e.eval("o.methodObjectWithEllipsis('hello',12,15,16);"));
+- assertArrayEquals(new Object[] { "hello" }, (Object[])e.eval("o.methodObjectWithEllipsis('hello');"));
+- }
+-
+- @Test
+- public void accessMethodPrimitiveWithEllipsis() throws ScriptException {
+- assertArrayEquals(new Object[] { 14, 12L, 15L, 16L }, (Object[])e.eval("o.methodPrimitiveWithEllipsis(14,12,15,16);"));
+- assertArrayEquals(new Object[] { 12 }, (Object[])e.eval("o.methodPrimitiveWithEllipsis(12);"));
+- }
+-
+- @Test
+- public void accessMethodMixedWithEllipsis() throws ScriptException {
+- assertArrayEquals(new Object[] { "Hello", 10, true, -100500, 80d }, (Object[])e.eval("o.methodMixedWithEllipsis('Hello', 10, true, -100500,80.0);"));
+- assertArrayEquals(new Object[] { "Nashorn", 15 }, (Object[])e.eval("o.methodMixedWithEllipsis('Nashorn',15);"));
+- }
+-
+- @Test
+- public void accessMethodOverloaded() throws ScriptException {
+- assertEquals(0, e.eval("o.overloadedMethod(0);"));
+- assertEquals(2000, e.eval("o.overloadedMethod(1000);"));
+- assertEquals(2, e.eval("o.overloadedMethod('10');"));
+- assertEquals(7, e.eval("o.overloadedMethod('Nashorn');"));
+- assertEquals(4, e.eval("o.overloadedMethod('true');"));
+- assertEquals(1, e.eval("o.overloadedMethod(true);"));
+- assertEquals(0, e.eval("o.overloadedMethod(false);"));
+- assertEquals(44, e.eval("o.overloadedMethod(new Person(22));"));
+- assertEquals(0, e.eval("o.overloadedMethod(new Person());"));
+- }
+-
+- @Test
+- public void accessMethodDoubleVSintOverloaded() throws ScriptException {
+- assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(0.0);"));
+- assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(1000.0);"));
+- assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(0.01);"));
+- assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(100.02);"));
+- assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(0);"));
+- assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(1000);"));
+- }
+-
+- @Test
+- public void accessJavaMethodIntFromJSFromJavaFromJS() throws ScriptException {
+- e.eval("function secondLevelMethodInt(a) {"
+- + "return o.thirdLevelMethodInt(a);"
+- + "}");
+- assertEquals(50, e.eval("o.firstLevelMethodInt(10);"));
+- }
+-
+- @Test
+- public void accessJavaMethodIntegerFromJSFromJavaFromJS() throws ScriptException {
+- e.eval("function secondLevelMethodInteger(a) {"
+- + "return o.thirdLevelMethodInteger(a);"
+- + "}");
+- assertEquals(100, e.eval("o.firstLevelMethodInteger(10);"));
+- }
+-
+- @Test
+- public void accessJavaMethodObjectFromJSFromJavaFromJS() throws ScriptException {
+- e.eval("function secondLevelMethodObject(p) {"
+- + "return o.thirdLevelMethodObject(p);"
+- + "}");
+- assertEquals(new Person(100), e.eval("o.firstLevelMethodObject(new Person(10));"));
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,789 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import static org.testng.AssertJUnit.assertEquals;
+-import static org.testng.AssertJUnit.assertTrue;
+-import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.TestNG;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-/**
+- * @test
+- * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.NumberAccessTest
+- * @run testng/othervm jdk.nashorn.api.javaaccess.NumberAccessTest
+- */
+-@SuppressWarnings("javadoc")
+-public class NumberAccessTest {
+-
+- private static ScriptEngine e;
+- private static SharedObject o;
+-
+- public static void main(final String[] args) {
+- TestNG.main(args);
+- }
+-
+- @BeforeClass
+- public static void setUpClass() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- e = m.getEngineByName("nashorn");
+- o = new SharedObject();
+- e.put("o", o);
+- e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;");
+- }
+-
+- @AfterClass
+- public static void tearDownClass() {
+- e = null;
+- o = null;
+- }
+-
+- // --------------------------------long
+- // tests------------------------------------
+- @Test
+- public void accessFieldLong() throws ScriptException {
+- e.eval("var p_long = o.publicLong;");
+- assertEquals(o.publicLong, e.get("p_long"));
+- e.eval("o.publicLong = 12;");
+- assertEquals(12, o.publicLong);
+- }
+-
+- @Test
+- public void accessFieldLongArray() throws ScriptException {
+- e.eval("var p_long_array = o.publicLongArray;");
+- assertEquals(o.publicLongArray[0], e.eval("o.publicLongArray[0];"));
+- assertArrayEquals(o.publicLongArray, (long[])e.get("p_long_array"));
+- e.eval("var t_long_arr = new (Java.type(\"long[]\"))(3);" +
+- "t_long_arr[0] = -189009;" +
+- "t_long_arr[1] = 456;" +
+- "t_long_arr[2] = 600000001;" +
+- "o.publicLongArray = t_long_arr;");
+- // e.eval("o.publicIntArray = [-189009,456,600000001];");
+- assertArrayEquals(new long[] { -189009, 456, 600000001 }, o.publicLongArray);
+- e.eval("o.publicLongArray[0] = 10;");
+- assertEquals(10, o.publicLongArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFieldLong() throws ScriptException {
+- e.eval("var ps_long = SharedObject.publicStaticLong;");
+- assertEquals(SharedObject.publicStaticLong, e.get("ps_long"));
+- e.eval("SharedObject.publicStaticLong = 120;");
+- assertEquals(120, SharedObject.publicStaticLong);
+- }
+-
+- @Test
+- public void accessStaticFieldLongArray() throws ScriptException {
+- e.eval("var ps_long_array = SharedObject.publicStaticLongArray;");
+- assertEquals(SharedObject.publicStaticLongArray[0], e.eval("SharedObject.publicStaticLongArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticLongArray, (long[])e.get("ps_long_array"));
+- e.eval("var ts_long_arr = new (Java.type(\"long[]\"))(3);" +
+- "ts_long_arr[0] = -189009;" +
+- "ts_long_arr[1] = 456;" +
+- "ts_long_arr[2] = 600000001;" +
+- "SharedObject.publicStaticLongArray = ts_long_arr;");
+- // e.eval("o.publicIntArray = [-189009,456,600000001];");
+- assertArrayEquals(new long[] { -189009, 456, 600000001 }, SharedObject.publicStaticLongArray);
+- e.eval("SharedObject.publicStaticLongArray[0] = 10;");
+- assertEquals(10, SharedObject.publicStaticLongArray[0]);
+- }
+-
+- @Test
+- public void accessFinalFieldLong() throws ScriptException {
+- e.eval("var pf_long = o.publicFinalLong;");
+- assertEquals(o.publicFinalLong, e.get("pf_long"));
+- e.eval("o.publicFinalLong = 120;");
+- assertEquals(13353333333333333L, o.publicFinalLong);
+- }
+-
+- @Test
+- public void accessFinalFieldLongArray() throws ScriptException {
+- e.eval("var pf_long_array = o.publicFinalLongArray;");
+- assertEquals(o.publicFinalLongArray[0], e.eval("o.publicFinalLongArray[0];"));
+- assertArrayEquals(o.publicFinalLongArray, (long[])e.get("pf_long_array"));
+- e.eval("var tf_long_arr = new (Java.type(\"long[]\"))(3);" +
+- "tf_long_arr[0] = -189009;" +
+- "tf_long_arr[1] = 456;" +
+- "tf_long_arr[2] = 600000001;" +
+- "o.publicFinalLongArray = tf_long_arr;");
+- // e.eval("o.publicIntArray = [-189009,456,600000001];");
+- assertArrayEquals(new long[] { 1901733333333L, -2247355555L, 3977377777L }, o.publicFinalLongArray);
+- e.eval("o.publicFinalLongArray[0] = 10;");
+- assertEquals(10, o.publicFinalLongArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldLong() throws ScriptException {
+- e.eval("var psf_long = SharedObject.publicStaticFinalLong;");
+- assertEquals(SharedObject.publicStaticFinalLong, e.get("psf_long"));
+- e.eval("SharedObject.publicStaticFinalLong = 120;");
+- assertEquals(8333333333333L, SharedObject.publicStaticFinalLong);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldLongArray() throws ScriptException {
+- e.eval("var psf_long_array = SharedObject.publicStaticFinalLongArray;");
+- assertEquals(SharedObject.publicStaticFinalLongArray[0], e.eval("SharedObject.publicStaticFinalLongArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticFinalLongArray, (long[])e.get("psf_long_array"));
+- e.eval("var tsf_long_arr = new (Java.type(\"long[]\"))(3);" +
+- "tsf_long_arr[0] = -189009;" +
+- "tsf_long_arr[1] = 456;" +
+- "tsf_long_arr[2] = 600000001;" +
+- "SharedObject.publicStaticFinalLongArray = tsf_long_arr;");
+- // e.eval("o.publicIntArray = [-189009,456,600000001];");
+- assertArrayEquals(new long[] { 19017383333L, -2247358L, 39773787L }, SharedObject.publicStaticFinalLongArray);
+- e.eval("SharedObject.publicStaticFinalLongArray[0] = 10;");
+- assertEquals(10, SharedObject.publicStaticFinalLongArray[0]);
+- }
+-
+- // --------------------------------int
+- // tests------------------------------------
+- @Test
+- public void accessFieldInt() throws ScriptException {
+- e.eval("var p_int = o.publicInt;");
+- assertEquals(o.publicInt, e.get("p_int"));
+- e.eval("o.publicInt = 14;");
+- assertEquals(14, o.publicInt);
+- }
+-
+- @Test
+- public void accessFieldIntArray() throws ScriptException {
+- e.eval("var p_int_array = o.publicIntArray;");
+- assertEquals(o.publicIntArray[0], e.eval("o.publicIntArray[0];"));
+- assertArrayEquals(o.publicIntArray, (int[])e.get("p_int_array"));
+- e.eval("var t_int_arr = new (Java.type(\"int[]\"))(3);" +
+- "t_int_arr[0] = 4;" +
+- "t_int_arr[1] = 5;" +
+- "t_int_arr[2] = 6;" +
+- "o.publicIntArray = t_int_arr;");
+- assertArrayEquals(new int[] { 4, 5, 6 }, o.publicIntArray);
+- e.eval("o.publicIntArray[0] = 100;");
+- assertEquals(100, o.publicIntArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFieldInt() throws ScriptException {
+- e.eval("var ps_int = SharedObject.publicStaticInt;");
+- assertEquals(SharedObject.publicStaticInt, e.get("ps_int"));
+- e.eval("SharedObject.publicStaticInt = 140;");
+- assertEquals(140, SharedObject.publicStaticInt);
+- }
+-
+- @Test
+- public void accessStaticFieldIntArray() throws ScriptException {
+- e.eval("var ps_int_array = SharedObject.publicStaticIntArray;");
+- assertEquals(SharedObject.publicStaticIntArray[0], e.eval("SharedObject.publicStaticIntArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticIntArray, (int[])e.get("ps_int_array"));
+- e.eval("var ts_int_arr = new (Java.type(\"int[]\"))(3);" +
+- "ts_int_arr[0] = 4;" +
+- "ts_int_arr[1] = 5;" +
+- "ts_int_arr[2] = 6;" +
+- "SharedObject.publicStaticIntArray = ts_int_arr;");
+- assertArrayEquals(new int[] { 4, 5, 6 }, SharedObject.publicStaticIntArray);
+- e.eval("SharedObject.publicStaticIntArray[0] = 100;");
+- assertEquals(100, SharedObject.publicStaticIntArray[0]);
+- }
+-
+- @Test
+- public void accessFinalFieldInt() throws ScriptException {
+- e.eval("var pf_int = o.publicFinalInt;");
+- assertEquals(o.publicFinalInt, e.get("pf_int"));
+-
+- e.eval("o.publicFinalInt = 10;");
+- assertEquals(20712023, o.publicFinalInt);
+- }
+-
+- @Test
+- public void accessFinalFieldIntArray() throws ScriptException {
+- e.eval("var pf_int_array = o.publicFinalIntArray;");
+- assertEquals(o.publicFinalIntArray[0], e.eval("o.publicFinalIntArray[0];"));
+- assertArrayEquals(o.publicFinalIntArray, (int[])e.get("pf_int_array"));
+- e.eval("var tf_int_arr = new (Java.type(\"int[]\"))(3);" +
+- "tf_int_arr[0] = 4;" +
+- "tf_int_arr[1] = 5;" +
+- "tf_int_arr[2] = 6;" +
+- "o.publicFinalIntArray = tf_int_arr;");
+- assertArrayEquals(new int[] { 50, 80, 130, 210, 340 }, o.publicFinalIntArray);
+- e.eval("o.publicFinalIntArray[0] = 100;");
+- assertEquals(100, o.publicFinalIntArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldInt() throws ScriptException {
+- e.eval("var psf_int = SharedObject.publicStaticFinalInt;");
+- assertEquals(SharedObject.publicStaticFinalInt, e.get("psf_int"));
+- e.eval("SharedObject.publicStaticFinalInt = 140;");
+- assertEquals(207182023, SharedObject.publicStaticFinalInt);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldIntArray() throws ScriptException {
+- e.eval("var psf_int_array = SharedObject.publicStaticFinalIntArray;");
+- assertEquals(SharedObject.publicStaticFinalIntArray[0], e.eval("SharedObject.publicStaticFinalIntArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticFinalIntArray, (int[])e.get("psf_int_array"));
+- e.eval("var tsf_int_arr = new (Java.type(\"int[]\"))(3);" +
+- "tsf_int_arr[0] = 4;" +
+- "tsf_int_arr[1] = 5;" +
+- "tsf_int_arr[2] = 6;" +
+- "SharedObject.publicStaticFinalIntArray = tsf_int_arr;");
+- assertArrayEquals(new int[] { 1308, 210, 340 }, SharedObject.publicStaticFinalIntArray);
+- e.eval("SharedObject.publicStaticFinalIntArray[0] = 100;");
+- assertEquals(100, SharedObject.publicStaticFinalIntArray[0]);
+- }
+-
+- // --------------------------------byte
+- // tests------------------------------------
+- @Test
+- public void accessFieldByte() throws ScriptException {
+- e.eval("var p_byte = o.publicByte;");
+- assertEquals((double)o.publicByte, ((Number)e.get("p_byte")).doubleValue());
+- e.eval("o.publicByte = 16;");
+- assertEquals(16, o.publicByte);
+- }
+-
+- @Test
+- public void accessFieldByteArray() throws ScriptException {
+- e.eval("var p_byte_array = o.publicByteArray;");
+- assertEquals(o.publicByteArray[0], e.eval("o.publicByteArray[0];"));
+- assertArrayEquals(o.publicByteArray, (byte[])e.get("p_byte_array"));
+- e.eval("var t_byte_arr = new (Java.type(\"byte[]\"))(3);" +
+- "t_byte_arr[0] = -18;" +
+- "t_byte_arr[1] = 56;" +
+- "t_byte_arr[2] = 60;" +
+- "o.publicByteArray = t_byte_arr;");
+- assertArrayEquals(new byte[] { -18, 56, 60 }, o.publicByteArray);
+- e.eval("o.publicByteArray[0] = 100;");
+- assertEquals(100, o.publicByteArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFieldByte() throws ScriptException {
+- e.eval("var ps_byte = SharedObject.publicStaticByte;");
+- assertEquals((double)SharedObject.publicStaticByte, ((Number)e.get("ps_byte")).doubleValue());
+- e.eval("SharedObject.publicStaticByte = 16;");
+- assertEquals(16, SharedObject.publicStaticByte);
+- }
+-
+- @Test
+- public void accessStaticFieldByteArray() throws ScriptException {
+- e.eval("var ps_byte_array = SharedObject.publicStaticByteArray;");
+- assertEquals(SharedObject.publicStaticByteArray[0], e.eval("SharedObject.publicStaticByteArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticByteArray, (byte[])e.get("ps_byte_array"));
+- e.eval("var ts_byte_arr = new (Java.type(\"byte[]\"))(3);" +
+- "ts_byte_arr[0] = -18;" +
+- "ts_byte_arr[1] = 56;" +
+- "ts_byte_arr[2] = 60;" +
+- "SharedObject.publicStaticByteArray = ts_byte_arr;");
+- assertArrayEquals(new byte[] { -18, 56, 60 }, SharedObject.publicStaticByteArray);
+- e.eval("SharedObject.publicStaticByteArray[0] = -90;");
+- assertEquals(-90, SharedObject.publicStaticByteArray[0]);
+- }
+-
+- @Test
+- public void accessFinalFieldByte() throws ScriptException {
+- e.eval("var pf_byte = o.publicFinalByte;");
+- assertEquals((double)o.publicFinalByte, ((Number)e.get("pf_byte")).doubleValue());
+- e.eval("o.publicFinalByte = 16;");
+- assertEquals(-7, o.publicFinalByte);
+- }
+-
+- @Test
+- public void accessFinalFieldByteArray() throws ScriptException {
+- e.eval("var pf_byte_array = o.publicFinalByteArray;");
+- assertEquals(o.publicFinalByteArray[0], e.eval("o.publicFinalByteArray[0];"));
+- assertArrayEquals(o.publicFinalByteArray, (byte[])e.get("pf_byte_array"));
+- e.eval("var tf_byte_arr = new (Java.type(\"byte[]\"))(3);" +
+- "tf_byte_arr[0] = -18;" +
+- "tf_byte_arr[1] = 56;" +
+- "tf_byte_arr[2] = 60;" +
+- "o.publicFinalByteArray = tf_byte_arr;");
+- assertArrayEquals(new byte[] { 1, 3, 6, 17, -128 }, o.publicFinalByteArray);
+- e.eval("o.publicFinalByteArray[0] = -90;");
+- assertEquals(-90, o.publicFinalByteArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldByte() throws ScriptException {
+- e.eval("var psf_byte = SharedObject.publicStaticFinalByte;");
+- assertEquals((double)SharedObject.publicStaticFinalByte, ((Number)e.get("psf_byte")).doubleValue());
+- e.eval("SharedObject.publicStaticFinalByte = 16;");
+- assertEquals(-70, SharedObject.publicStaticFinalByte);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldByteArray() throws ScriptException {
+- e.eval("var psf_byte_array = SharedObject.publicStaticFinalByteArray;");
+- assertEquals(SharedObject.publicStaticFinalByteArray[0], e.eval("SharedObject.publicStaticFinalByteArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticFinalByteArray, (byte[])e.get("psf_byte_array"));
+- e.eval("var tsf_byte_arr = new (Java.type(\"byte[]\"))(3);" +
+- "tsf_byte_arr[0] = -18;" +
+- "tsf_byte_arr[1] = 56;" +
+- "tsf_byte_arr[2] = 60;" +
+- "SharedObject.publicStaticFinalByteArray = tsf_byte_arr;");
+- assertArrayEquals(new byte[] { 17, -128, 81 }, SharedObject.publicStaticFinalByteArray);
+- e.eval("SharedObject.publicStaticFinalByteArray[0] = -90;");
+- assertEquals(-90, SharedObject.publicStaticFinalByteArray[0]);
+- }
+-
+- // --------------------------------short
+- // tests------------------------------------
+- @Test
+- public void accessFieldShort() throws ScriptException {
+- e.eval("var p_short = o.publicShort;");
+- assertEquals((double)o.publicShort, ((Number)e.get("p_short")).doubleValue());
+- e.eval("o.publicShort = 18;");
+- assertEquals(18, o.publicShort);
+- }
+-
+- @Test
+- public void accessFieldShortArray() throws ScriptException {
+- e.eval("var p_short_array = o.publicShortArray;");
+- assertEquals(o.publicShortArray[0], e.eval("o.publicShortArray[0];"));
+- assertArrayEquals(o.publicShortArray, (short[])e.get("p_short_array"));
+- e.eval("var t_short_arr = new (Java.type(\"short[]\"))(3);" +
+- "t_short_arr[0] = 90;" +
+- "t_short_arr[1] = 5;" +
+- "t_short_arr[2] = -6000;" +
+- "o.publicShortArray = t_short_arr;");
+- assertArrayEquals(new short[] { 90, 5, -6000 }, o.publicShortArray);
+- e.eval("o.publicShortArray[0] = -1000;");
+- assertEquals(-1000, o.publicShortArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFieldShort() throws ScriptException {
+- e.eval("var ps_short = SharedObject.publicStaticShort;");
+- assertEquals((double)SharedObject.publicStaticShort, ((Number)e.get("ps_short")).doubleValue());
+- e.eval("SharedObject.publicStaticShort = 180;");
+- assertEquals(180, SharedObject.publicStaticShort);
+- }
+-
+- @Test
+- public void accessStaticFieldShortArray() throws ScriptException {
+- e.eval("var ps_short_array = SharedObject.publicStaticShortArray;");
+- assertEquals(SharedObject.publicStaticShortArray[0], e.eval("SharedObject.publicStaticShortArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticShortArray, (short[])e.get("ps_short_array"));
+- e.eval("var ts_short_arr = new (Java.type(\"short[]\"))(3);" +
+- "ts_short_arr[0] = 90;" +
+- "ts_short_arr[1] = 5;" +
+- "ts_short_arr[2] = -6000;" +
+- "SharedObject.publicStaticShortArray = ts_short_arr;");
+- assertArrayEquals(new short[] { 90, 5, -6000 }, SharedObject.publicStaticShortArray);
+- e.eval("SharedObject.publicStaticShortArray[0] = -1000;");
+- assertEquals(-1000, SharedObject.publicStaticShortArray[0]);
+- }
+-
+- @Test
+- public void accessFinalFieldShort() throws ScriptException {
+- e.eval("var pf_short = o.publicFinalShort;");
+- assertEquals((double)o.publicFinalShort, ((Number)e.get("pf_short")).doubleValue());
+- e.eval("o.publicFinalShort = 180;");
+- assertEquals(31220, o.publicFinalShort);
+- }
+-
+- @Test
+- public void accessFinalFieldShortArray() throws ScriptException {
+- e.eval("var pf_short_array = o.publicFinalShortArray;");
+- assertEquals(o.publicFinalShortArray[0], e.eval("o.publicFinalShortArray[0];"));
+- assertArrayEquals(o.publicFinalShortArray, (short[])e.get("pf_short_array"));
+- e.eval("var tf_short_arr = new (Java.type(\"short[]\"))(3);" +
+- "tf_short_arr[0] = 90;" +
+- "tf_short_arr[1] = 5;" +
+- "tf_short_arr[2] = -6000;" +
+- "o.publicFinalShortArray = tf_short_arr;");
+- assertArrayEquals(new short[] { 12240, 9200, -17289, 1200, 12 }, o.publicFinalShortArray);
+- e.eval("o.publicFinalShortArray[0] = -1000;");
+- assertEquals(-1000, o.publicFinalShortArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldShort() throws ScriptException {
+- e.eval("var psf_short = SharedObject.publicStaticFinalShort;");
+- assertEquals((double)SharedObject.publicStaticFinalShort, ((Number)e.get("psf_short")).doubleValue());
+- e.eval("SharedObject.publicStaticFinalShort = 180;");
+- assertEquals(8888, SharedObject.publicStaticFinalShort);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldShortArray() throws ScriptException {
+- e.eval("var psf_short_array = SharedObject.publicStaticFinalShortArray;");
+- assertEquals(SharedObject.publicStaticFinalShortArray[0], e.eval("SharedObject.publicStaticFinalShortArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticFinalShortArray, (short[])e.get("psf_short_array"));
+- e.eval("var tsf_short_arr = new (Java.type(\"short[]\"))(3);" +
+- "tsf_short_arr[0] = 90;" +
+- "tsf_short_arr[1] = 5;" +
+- "tsf_short_arr[2] = -6000;" +
+- "SharedObject.publicStaticFinalShortArray = tsf_short_arr;");
+- assertArrayEquals(new short[] { 8240, 9280, -1289, 120, 812 }, SharedObject.publicStaticFinalShortArray);
+- e.eval("SharedObject.publicStaticFinalShortArray[0] = -1000;");
+- assertEquals(-1000, SharedObject.publicStaticFinalShortArray[0]);
+- }
+-
+- // --------------------------------char
+- // tests------------------------------------
+- @Test
+- public void accessFieldChar() throws ScriptException {
+- e.eval("var p_char = o.publicChar;");
+- assertEquals(o.publicChar, e.get("p_char"));
+- e.eval("o.publicChar = 'S';");
+- assertEquals('S', o.publicChar);
+- e.eval("o.publicChar = 10;");
+- assertEquals(10, o.publicChar);
+- e.eval("try {"
+- + " o.publicChar = 'Big string';" +
+- "} catch(e) {" +
+- " var isThrown = true;" +
+- "}");
+- assertEquals("Exception thrown", true, e.get("isThrown"));
+- assertEquals(10, o.publicChar);
+- }
+-
+- @Test
+- public void accessFieldCharArray() throws ScriptException {
+- e.eval("var p_char_array = o.publicCharArray;");
+- assertEquals(o.publicCharArray[0], e.eval("o.publicCharArray[0];"));
+- assertArrayEquals(o.publicCharArray, (char[])e.get("p_char_array"));
+- e.eval("var t_char_arr = new (Java.type(\"char[]\"))(3);" +
+- "t_char_arr[0] = 'F';" +
+- "t_char_arr[1] = 'o';" +
+- "t_char_arr[2] = 'o';" +
+- "o.publicCharArray = t_char_arr;");
+- assertArrayEquals("Foo".toCharArray(), o.publicCharArray);
+- e.eval("o.publicCharArray[0] = 'Z';");
+- assertEquals('Z', o.publicCharArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFieldChar() throws ScriptException {
+- e.eval("var ps_char = SharedObject.publicStaticChar;");
+- assertEquals(SharedObject.publicStaticChar, e.get("ps_char"));
+- e.eval("SharedObject.publicStaticChar = 'Z';");
+- assertEquals('Z', SharedObject.publicStaticChar);
+- }
+-
+- @Test
+- public void accessStaticFieldCharArray() throws ScriptException {
+- e.eval("var ps_char_array = SharedObject.publicStaticCharArray;");
+- assertEquals(SharedObject.publicStaticCharArray[0], e.eval("SharedObject.publicStaticCharArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticCharArray, (char[])e.get("ps_char_array"));
+- e.eval("var ts_char_arr = new (Java.type(\"char[]\"))(3);" +
+- "ts_char_arr[0] = 'G';" +
+- "ts_char_arr[1] = 'o';" +
+- "ts_char_arr[2] = 'o';" +
+- "SharedObject.publicStaticCharArray = ts_char_arr;");
+- assertArrayEquals("Goo".toCharArray(), SharedObject.publicStaticCharArray);
+- e.eval("SharedObject.publicStaticCharArray[0] = 'Z';");
+- assertEquals('Z', SharedObject.publicStaticCharArray[0]);
+- }
+-
+- @Test
+- public void accessFinalFieldChar() throws ScriptException {
+- e.eval("var pf_char = o.publicFinalChar;");
+- assertEquals(o.publicFinalChar, e.get("pf_char"));
+- e.eval("o.publicFinalChar = 'S';");
+- assertEquals('E', o.publicFinalChar);
+- }
+-
+- @Test
+- public void accessFinalCharArray() throws ScriptException {
+- e.eval("var pf_char_array = o.publicFinalCharArray;");
+- assertEquals(o.publicFinalCharArray[0], e.eval("o.publicFinalCharArray[0];"));
+- assertArrayEquals(o.publicFinalCharArray, (char[])e.get("pf_char_array"));
+- e.eval("var tf_char_arr = new (Java.type(\"char[]\"))(3);" +
+- "tf_char_arr[0] = 'F';" +
+- "tf_char_arr[1] = 'o';" +
+- "tf_char_arr[2] = 'o';" +
+- "o.publicFinalCharArray = tf_char_arr;");
+- assertArrayEquals("Nashorn hello".toCharArray(), o.publicFinalCharArray);
+- e.eval("o.publicFinalCharArray[0] = 'Z';");
+- assertEquals('Z', o.publicFinalCharArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldChar() throws ScriptException {
+- e.eval("var psf_char = SharedObject.publicStaticFinalChar;");
+- assertEquals(SharedObject.publicStaticFinalChar, e.get("psf_char"));
+- e.eval("SharedObject.publicStaticFinalChar = 'Z';");
+- assertEquals('K', SharedObject.publicStaticFinalChar);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldCharArray() throws ScriptException {
+- e.eval("var psf_char_array = SharedObject.publicStaticFinalCharArray;");
+- assertEquals(SharedObject.publicStaticFinalCharArray[0], e.eval("SharedObject.publicStaticFinalCharArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticFinalCharArray, (char[])e.get("psf_char_array"));
+- e.eval("var tsf_char_arr = new (Java.type(\"char[]\"))(3);" +
+- "tsf_char_arr[0] = 'Z';" +
+- "tsf_char_arr[1] = 'o';" +
+- "tsf_char_arr[2] = 'o';" +
+- "SharedObject.publicStaticFinalCharArray = tsf_char_arr;");
+- assertArrayEquals("StaticString".toCharArray(), SharedObject.publicStaticFinalCharArray);
+- e.eval("SharedObject.publicStaticFinalCharArray[0] = 'Z';");
+- assertEquals('Z', SharedObject.publicStaticFinalCharArray[0]);
+- }
+-
+- // --------------------------------float
+- // tests------------------------------------
+- @Test
+- public void accessFieldFloat() throws ScriptException {
+- e.eval("var p_float = o.publicFloat;");
+- assertEquals((double)o.publicFloat, ((Number)e.get("p_float")).doubleValue());
+- o.publicFloat = 0.0f / 0.0f;
+- assertEquals(true, e.eval("isNaN(o.publicFloat)"));
+- o.publicFloat = 1.0f / 0.0f;
+- assertEquals(true, e.eval("Number.POSITIVE_INFINITY === o.publicFloat"));
+- o.publicFloat = -1.0f / 0.0f;
+- assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === o.publicFloat"));
+- e.eval("o.publicFloat = 20;");
+- assertEquals(20, o.publicFloat, 1e-10);
+- e.eval("o.publicFloat = 0.0/0.0;");
+- assertTrue(Float.isNaN(o.publicFloat));
+- e.eval("o.publicFloat = 1.0/0.0;");
+- assertEquals(Float.floatToIntBits(Float.POSITIVE_INFINITY), Float.floatToIntBits(o.publicFloat));
+- e.eval("o.publicFloat = -1.0/0.0;");
+- assertEquals(Float.NEGATIVE_INFINITY, o.publicFloat, 1e-10);
+- }
+-
+- @Test
+- public void accessFieldFloatArray() throws ScriptException {
+- e.eval("var p_float_array = o.publicFloatArray;");
+- assertEquals(o.publicFloatArray[0], e.eval("o.publicFloatArray[0];"));
+- assertArrayEquals(o.publicFloatArray, (float[])e.get("p_float_array"), 1e-10f);
+- e.eval("var t_float_arr = new (Java.type(\"float[]\"))(3);" +
+- "t_float_arr[0] = 9.0;" +
+- "t_float_arr[1] = 5.12345;" +
+- "t_float_arr[2] = -60.03;" +
+- "o.publicFloatArray = t_float_arr;");
+- assertArrayEquals(new float[] { 9.0f, 5.12345f, -60.03f }, o.publicFloatArray, 1e-10f);
+- e.eval("o.publicFloatArray[0] = -513.2;");
+- assertArrayEquals(new float[] { -513.2f, 5.12345f, -60.03f }, o.publicFloatArray, 1e-10f);
+- }
+-
+- @Test
+- public void accessStaticFieldFloat() throws ScriptException {
+- e.eval("var ps_float = SharedObject.publicStaticFloat;");
+- assertEquals((double)SharedObject.publicStaticFloat, ((Number)e.get("ps_float")).doubleValue());
+- SharedObject.publicStaticFloat = 0.0f / 0.0f;
+- assertEquals(true, e.eval("isNaN(SharedObject.publicStaticFloat)"));
+- SharedObject.publicStaticFloat = 1.0f / 0.0f;
+- assertEquals(true, e.eval("Number.POSITIVE_INFINITY === SharedObject.publicStaticFloat"));
+- SharedObject.publicStaticFloat = -1.0f / 0.0f;
+- assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === SharedObject.publicStaticFloat"));
+- e.eval("SharedObject.publicStaticFloat = 20.0;");
+- assertEquals(20.0f, SharedObject.publicStaticFloat, 1e-10);
+- e.eval("SharedObject.publicStaticFloat = 0.0/0.0;");
+- assertTrue(Float.isNaN(SharedObject.publicStaticFloat));
+- e.eval("SharedObject.publicStaticFloat = 1.0/0.0;");
+- assertEquals(Float.floatToIntBits(Float.POSITIVE_INFINITY), Float.floatToIntBits(SharedObject.publicStaticFloat));
+- e.eval("SharedObject.publicStaticFloat = -1.0/0.0;");
+- assertEquals(Float.floatToIntBits(Float.NEGATIVE_INFINITY), Float.floatToIntBits(SharedObject.publicStaticFloat));
+- }
+-
+- @Test
+- public void accessStaticFieldFloatArray() throws ScriptException {
+- e.eval("var ps_float_array = SharedObject.publicStaticFloatArray;");
+- assertEquals(SharedObject.publicStaticFloatArray[0], e.eval("SharedObject.publicStaticFloatArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticFloatArray, (float[])e.get("ps_float_array"), 1e-10f);
+- e.eval("var ts_float_arr = new (Java.type(\"float[]\"))(3);" +
+- "ts_float_arr[0] = 9.0;" +
+- "ts_float_arr[1] = 5.12345;" +
+- "ts_float_arr[2] = -60.03;" +
+- "SharedObject.publicStaticFloatArray = ts_float_arr;");
+- assertArrayEquals(new float[] { 9.0f, 5.12345f, -60.03f }, SharedObject.publicStaticFloatArray, 1e-10f);
+- e.eval("SharedObject.publicStaticFloatArray[0] = -513.2;");
+- assertArrayEquals(new float[] { -513.2f, 5.12345f, -60.03f }, SharedObject.publicStaticFloatArray, 1e-10f);
+- }
+-
+- @Test
+- public void accessFinalFloat() throws ScriptException {
+- e.eval("var pf_float = o.publicFinalFloat;");
+- assertEquals((double)o.publicFinalFloat, ((Number)e.get("pf_float")).doubleValue());
+- e.eval("o.publicFinalFloat = 20.0;");
+- assertEquals(7.72e8f, o.publicFinalFloat, 1e-10);
+- }
+-
+- @Test
+- public void accessFinalFloatArray() throws ScriptException {
+- e.eval("var pf_float_array = o.publicFinalFloatArray;");
+- assertEquals(o.publicFinalFloatArray[0], e.eval("o.publicFinalFloatArray[0];"));
+- assertArrayEquals(o.publicFinalFloatArray, (float[])e.get("pf_float_array"), 1e-10f);
+- e.eval("var tf_float_arr = new (Java.type(\"float[]\"))(3);" +
+- "tf_float_arr[0] = 9.0;" +
+- "tf_float_arr[1] = 5.12345;" +
+- "tf_float_arr[2] = -60.03;" +
+- "o.publicFinalFloatArray = tf_float_arr;");
+- assertArrayEquals(new float[] { -131.012f, 189.32f, -31.32e8f, 3.72f }, o.publicFinalFloatArray, 1e-10f);
+- e.eval("o.publicFinalFloatArray[0] = -513.2;");
+- assertEquals(-513.2f, o.publicFinalFloatArray[0], 1e-10f);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldFloat() throws ScriptException {
+- e.eval("var psf_float = SharedObject.publicStaticFinalFloat;");
+- assertEquals((double)SharedObject.publicStaticFinalFloat, ((Number)e.get("psf_float")).doubleValue());
+- e.eval("SharedObject.publicStaticFinalFloat = 20.0;");
+- assertEquals(0.72e8f, SharedObject.publicStaticFinalFloat, 1e-10);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldFloatArray() throws ScriptException {
+- e.eval("var psf_float_array = SharedObject.publicStaticFinalFloatArray;");
+- assertEquals(SharedObject.publicStaticFinalFloatArray[0], e.eval("SharedObject.publicStaticFinalFloatArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticFinalFloatArray, (float[])e.get("psf_float_array"), 1e-10f);
+- e.eval("var tsf_float_arr = new (Java.type(\"float[]\"))(3);" +
+- "tsf_float_arr[0] = 9.0;" +
+- "tsf_float_arr[1] = 5.12345;" +
+- "tsf_float_arr[2] = -60.03;" +
+- "SharedObject.publicStaticFinalFloatArray = tsf_float_arr;");
+- assertArrayEquals(new float[] { -8131.012f, 9.32f, -138.32e8f, 0.72f }, SharedObject.publicStaticFinalFloatArray, 1e-10f);
+- e.eval("SharedObject.publicStaticFinalFloatArray[0] = -513.2;");
+- assertEquals(-513.2f, SharedObject.publicStaticFinalFloatArray[0], 1e-10f);
+- }
+-
+- // --------------------------------double
+- // tests------------------------------------
+- @Test
+- public void accessFieldDouble() throws ScriptException {
+- e.eval("var p_double = o.publicDouble;");
+- assertEquals(o.publicDouble, e.get("p_double"));
+- o.publicDouble = 0.0 / 0.0;
+- assertEquals(true, e.eval("isNaN(o.publicDouble)"));
+- o.publicDouble = 1.0 / 0.0;
+- assertEquals(true, e.eval("Number.POSITIVE_INFINITY === o.publicDouble"));
+- o.publicDouble = -1.0 / 0.0;
+- assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === o.publicDouble"));
+- e.eval("o.publicDouble = 30;");
+- assertEquals(Double.doubleToLongBits(30.0), Double.doubleToLongBits(o.publicDouble));
+- e.eval("o.publicDouble = 0.0/0.0;");
+- assertTrue(Double.isNaN(o.publicDouble));
+- e.eval("o.publicDouble = 1.0/0.0;");
+- assertEquals(Double.doubleToLongBits(Double.POSITIVE_INFINITY), Double.doubleToLongBits(o.publicDouble));
+- e.eval("o.publicDouble = -1.0/0.0;");
+- assertEquals(Double.doubleToLongBits(Double.NEGATIVE_INFINITY), Double.doubleToLongBits(o.publicDouble));
+- }
+-
+- @Test
+- public void accessFieldDoubleArrayRead() throws ScriptException {
+- e.eval("var p_double_array = o.publicDoubleArray;");
+- assertEquals(o.publicDoubleArray[0], e.eval("o.publicDoubleArray[0];"));
+- assertArrayEquals(o.publicDoubleArray, (double[])e.get("p_double_array"), 1e-10);
+- e.eval("var t_double_arr = new (Java.type(\"double[]\"))(3);" +
+- "t_double_arr[0] = 9e10;" +
+- "t_double_arr[1] = 0.677777;" +
+- "t_double_arr[2] = -0.0000001;" +
+- "o.publicDoubleArray = t_double_arr;");
+- assertArrayEquals(new double[] { 9e10, 0.677777, -0.0000001 }, o.publicDoubleArray, 1e-10f);
+- e.eval("o.publicDoubleArray[0] = -5.2e10;");
+- assertEquals(-5.2e10, o.publicDoubleArray[0], 1e-10f);
+- }
+-
+- @Test
+- public void accessStaticFieldDouble() throws ScriptException {
+- e.eval("var ps_double = SharedObject.publicStaticDouble;");
+- assertEquals(SharedObject.publicStaticDouble, e.get("ps_double"));
+- SharedObject.publicStaticDouble = 0.0 / 0.0;
+- assertEquals(true, e.eval("isNaN(SharedObject.publicStaticDouble)"));
+- SharedObject.publicStaticDouble = 1.0 / 0.0;
+- assertEquals(true, e.eval("Number.POSITIVE_INFINITY === SharedObject.publicStaticDouble"));
+- SharedObject.publicStaticDouble = -1.0 / 0.0;
+- assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === SharedObject.publicStaticDouble"));
+- e.eval("SharedObject.publicStaticDouble = 40.0;");
+- assertEquals(Double.doubleToLongBits(40.0), Double.doubleToLongBits(SharedObject.publicStaticDouble));
+- e.eval("SharedObject.publicStaticDouble = 0.0/0.0;");
+- assertTrue(Double.isNaN(SharedObject.publicStaticDouble));
+- e.eval("SharedObject.publicStaticDouble = 1.0/0.0;");
+- assertEquals(Double.doubleToLongBits(Double.POSITIVE_INFINITY), Double.doubleToLongBits(SharedObject.publicStaticDouble));
+- e.eval("SharedObject.publicStaticDouble = -1.0/0.0;");
+- assertEquals(Double.doubleToLongBits(Double.NEGATIVE_INFINITY), Double.doubleToLongBits(SharedObject.publicStaticDouble));
+- }
+-
+- @Test
+- public void accessStaticFieldDoubleArrayRead() throws ScriptException {
+- e.eval("var ps_double_array = SharedObject.publicStaticDoubleArray;");
+- assertEquals(SharedObject.publicStaticDoubleArray[0], e.eval("SharedObject.publicStaticDoubleArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticDoubleArray, (double[])e.get("ps_double_array"), 1e-10);
+- e.eval("var ts_double_arr = new (Java.type(\"double[]\"))(3);" +
+- "ts_double_arr[0] = 9e10;" +
+- "ts_double_arr[1] = 0.677777;" +
+- "ts_double_arr[2] = -0.0000001;" +
+- "SharedObject.publicStaticDoubleArray = ts_double_arr;");
+- assertArrayEquals(new double[] { 9e10, 0.677777, -0.0000001 }, SharedObject.publicStaticDoubleArray, 1e-10f);
+- e.eval("SharedObject.publicStaticDoubleArray[0] = -5.2e10;");
+- assertEquals(-5.2e10, SharedObject.publicStaticDoubleArray[0], 1e-10f);
+- }
+-
+- @Test
+- public void accessFinalFieldDouble() throws ScriptException {
+- e.eval("var pf_double = o.publicFinalDouble;");
+- assertEquals(o.publicFinalDouble, e.get("pf_double"));
+- e.eval("o.publicFinalDouble = 30.0;");
+- assertEquals(Double.doubleToLongBits(1.3412e20), Double.doubleToLongBits(o.publicFinalDouble));
+- }
+-
+- @Test
+- public void accessFinalFieldDoubleArrayRead() throws ScriptException {
+- e.eval("var pf_double_array = o.publicFinalDoubleArray;");
+- assertEquals(o.publicFinalDoubleArray[0], e.eval("o.publicFinalDoubleArray[0];"));
+- assertArrayEquals(o.publicFinalDoubleArray, (double[])e.get("pf_double_array"), 1e-10);
+- e.eval("var tf_double_arr = new (Java.type(\"double[]\"))(3);" +
+- "tf_double_arr[0] = 9e10;" +
+- "tf_double_arr[1] = 0.677777;" +
+- "tf_double_arr[2] = -0.0000001;" +
+- "o.publicFinalDoubleArray = tf_double_arr;");
+- assertArrayEquals(new double[] { 0.725e80, 0.12e10, 8e-3, 1.00077 }, o.publicFinalDoubleArray, 1e-10f);
+- e.eval("o.publicFinalDoubleArray[0] = -5.2e10;");
+- assertEquals(-5.2e10, o.publicFinalDoubleArray[0], 1e-10f);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldDouble() throws ScriptException {
+- e.eval("var psf_double = SharedObject.publicStaticFinalDouble;");
+- assertEquals(SharedObject.publicStaticFinalDouble, e.get("psf_double"));
+- e.eval("SharedObject.publicStaticFinalDouble = 40.0;");
+- assertEquals(Double.doubleToLongBits(1.8e12), Double.doubleToLongBits(SharedObject.publicStaticFinalDouble));
+- }
+-
+- @Test
+- public void accessStaticFinalFieldDoubleArrayRead() throws ScriptException {
+- e.eval("var psf_double_array = SharedObject.publicStaticFinalDoubleArray;");
+- assertEquals(SharedObject.publicStaticFinalDoubleArray[0], e.eval("SharedObject.publicStaticFinalDoubleArray[0];"));
+- assertArrayEquals(SharedObject.publicStaticFinalDoubleArray, (double[])e.get("psf_double_array"), 1e-10);
+- e.eval("var tsf_double_arr = new (Java.type(\"double[]\"))(3);" +
+- "tsf_double_arr[0] = 9e10;" +
+- "tsf_double_arr[1] = 0.677777;" +
+- "tsf_double_arr[2] = -0.0000001;" +
+- "SharedObject.publicStaticFinalDoubleArray = tsf_double_arr;");
+- assertArrayEquals(new double[] { 8.725e80, 0.82e10, 18e-3, 1.08077 }, SharedObject.publicStaticFinalDoubleArray, 1e-10f);
+- e.eval("SharedObject.publicStaticFinalDoubleArray[0] = -5.2e10;");
+- assertEquals(-5.2e10, SharedObject.publicStaticFinalDoubleArray[0], 1e-10f);
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/NumberBoxingTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,365 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import static org.testng.AssertJUnit.assertEquals;
+-import static org.testng.AssertJUnit.assertTrue;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.TestNG;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-/**
+- * @test
+- * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.NumberBoxingTest
+- * @run testng/othervm jdk.nashorn.api.javaaccess.NumberBoxingTest
+- */
+-@SuppressWarnings("javadoc")
+-public class NumberBoxingTest {
+-
+- private static ScriptEngine e;
+- private static SharedObject o;
+-
+- public static void main(final String[] args) {
+- TestNG.main(args);
+- }
+-
+- @BeforeClass
+- public static void setUpClass() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- e = m.getEngineByName("nashorn");
+- o = new SharedObject();
+- e.put("o", o);
+- e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;");
+- }
+-
+- @AfterClass
+- public static void tearDownClass() {
+- e = null;
+- o = null;
+- }
+-
+- // --------------------------------long
+- // tests------------------------------------
+- @Test
+- public void accessFieldLongBoxing() throws ScriptException {
+- e.eval("var p_long = o.publicLongBox;");
+- assertEquals(o.publicLongBox, e.get("p_long"));
+- e.eval("o.publicLongBox = 12;");
+- assertEquals(Long.valueOf(12), o.publicLongBox);
+- }
+-
+- @Test
+- public void accessStaticFieldLongBoxing() throws ScriptException {
+- e.eval("var ps_long = SharedObject.publicStaticLongBox;");
+- assertEquals(SharedObject.publicStaticLongBox, e.get("ps_long"));
+- e.eval("SharedObject.publicStaticLongBox = 120;");
+- assertEquals(120L, SharedObject.publicStaticLongBox.longValue());
+- }
+-
+- @Test
+- public void accessFinalFieldLongBoxing() throws ScriptException {
+- e.eval("var pf_long = o.publicFinalLongBox;");
+- assertEquals(o.publicFinalLongBox, e.get("pf_long"));
+- e.eval("o.publicFinalLongBox = 120;");
+- assertEquals(Long.valueOf(9377333334L), o.publicFinalLongBox);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldLongBoxing() throws ScriptException {
+- e.eval("var psf_long = SharedObject.publicStaticFinalLong;");
+- assertEquals(SharedObject.publicStaticFinalLong, e.get("psf_long"));
+- e.eval("SharedObject.publicStaticFinalLong = 120;");
+- assertEquals(8333333333333L, SharedObject.publicStaticFinalLong);
+- }
+-
+- // --------------------------------int
+- // tests------------------------------------
+- @Test
+- public void accessFieldIntBoxing() throws ScriptException {
+- e.eval("var p_int = o.publicIntBox;");
+- assertEquals(o.publicIntBox, e.get("p_int"));
+- e.eval("o.publicIntBox = 14;");
+- assertEquals(Integer.valueOf(14), o.publicIntBox);
+- }
+-
+- @Test
+- public void accessStaticFieldIntBoxing() throws ScriptException {
+- e.eval("var ps_int = SharedObject.publicStaticInt;");
+- assertEquals(SharedObject.publicStaticInt, e.get("ps_int"));
+- e.eval("SharedObject.publicStaticInt = 140;");
+- assertEquals(140, SharedObject.publicStaticInt);
+- }
+-
+- @Test
+- public void accessFinalFieldIntBoxing() throws ScriptException {
+- e.eval("var pf_int = o.publicFinalIntBox;");
+- assertEquals(o.publicFinalIntBox, e.get("pf_int"));
+- e.eval("o.publicFinalIntBox = 10;");
+- assertEquals(Integer.valueOf(207512301), o.publicFinalIntBox);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldIntBoxing() throws ScriptException {
+- e.eval("var psf_int = SharedObject.publicStaticFinalInt;");
+- assertEquals(SharedObject.publicStaticFinalInt, e.get("psf_int"));
+- e.eval("SharedObject.publicStaticFinalInt = 140;");
+- assertEquals(207182023, SharedObject.publicStaticFinalInt);
+- }
+-
+- // --------------------------------byte
+- // tests------------------------------------
+- @Test
+- public void accessFieldByteBoxing() throws ScriptException {
+- e.eval("var p_byte = o.publicByteBox;");
+- assertEqualsDouble(o.publicByteBox, "p_byte");
+- e.eval("o.publicByteBox = 16;");
+- assertEquals(Byte.valueOf((byte)16), o.publicByteBox);
+- }
+-
+- @Test
+- public void accessStaticFieldByteBoxing() throws ScriptException {
+- e.eval("var ps_byte = SharedObject.publicStaticByte;");
+- assertEqualsDouble(SharedObject.publicStaticByte, "ps_byte");
+- e.eval("SharedObject.publicStaticByte = 16;");
+- assertEquals(16, SharedObject.publicStaticByte);
+- }
+-
+- @Test
+- public void accessFinalFieldByteBoxing() throws ScriptException {
+- e.eval("var pf_byte = o.publicFinalByteBox;");
+- assertEqualsDouble(o.publicFinalByteBox, "pf_byte");
+- e.eval("o.publicFinalByteBox = 16;");
+- assertEquals(Byte.valueOf((byte)19), o.publicFinalByteBox);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldByteBoxing() throws ScriptException {
+- e.eval("var psf_byte = SharedObject.publicStaticFinalByte;");
+- assertEqualsDouble(SharedObject.publicStaticFinalByte, "psf_byte");
+- e.eval("SharedObject.publicStaticFinalByte = 16;");
+- assertEquals(-70, SharedObject.publicStaticFinalByte);
+- }
+-
+- // --------------------------------short
+- // tests------------------------------------
+- @Test
+- public void accessFieldShortBoxing() throws ScriptException {
+- e.eval("var p_short = o.publicShortBox;");
+- assertEqualsDouble(o.publicShortBox, "p_short");
+- e.eval("o.publicShortBox = 18;");
+- assertEquals(Short.valueOf((short)18), o.publicShortBox);
+- }
+-
+- private static void assertEqualsDouble(final Number n, final String name) {
+- assertEquals(n.doubleValue(), ((Number)e.get(name)).doubleValue());
+- }
+-
+- @Test
+- public void accessStaticFieldShortBoxing() throws ScriptException {
+- e.eval("var ps_short = SharedObject.publicStaticShort;");
+- assertEqualsDouble(SharedObject.publicStaticShort, "ps_short");
+- e.eval("SharedObject.publicStaticShort = 180;");
+- assertEquals(180, SharedObject.publicStaticShort);
+- }
+-
+- @Test
+- public void accessFinalFieldShortBoxing() throws ScriptException {
+- e.eval("var pf_short = o.publicFinalShortBox;");
+- assertEqualsDouble(o.publicFinalShortBox, "pf_short");
+- e.eval("o.publicFinalShortBox = 180;");
+- assertEquals(Short.valueOf((short)-26777), o.publicFinalShortBox);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldShortBoxing() throws ScriptException {
+- e.eval("var psf_short = SharedObject.publicStaticFinalShort;");
+- assertEqualsDouble(SharedObject.publicStaticFinalShort, "psf_short");
+- e.eval("SharedObject.publicStaticFinalShort = 180;");
+- assertEquals(8888, SharedObject.publicStaticFinalShort);
+- }
+-
+- // --------------------------------char
+- // tests------------------------------------
+- @Test
+- public void accessFieldCharBoxing() throws ScriptException {
+- e.eval("var p_char = o.publicCharBox;");
+- assertEquals(o.publicCharBox, e.get("p_char"));
+- e.eval("o.publicCharBox = 'S';");
+- assertEquals(Character.valueOf('S'), o.publicCharBox);
+- e.eval("try {" +
+- " o.publicCharBox = 'Big string';" +
+- "} catch(e) {" +
+- " var isThrown = true;" +
+- "}");
+- assertEquals("Exception thrown", true, e.get("isThrown"));
+- assertEquals(Character.valueOf('S'), o.publicCharBox);
+- }
+-
+- @Test
+- public void accessStaticFieldCharBoxing() throws ScriptException {
+- e.eval("var ps_char = SharedObject.publicStaticChar;");
+- assertEquals(SharedObject.publicStaticChar, e.get("ps_char"));
+- e.eval("SharedObject.publicStaticChar = 'Z';");
+- assertEquals('Z', SharedObject.publicStaticChar);
+- }
+-
+- @Test
+- public void accessFinalFieldCharBoxing() throws ScriptException {
+- e.eval("var pf_char = o.publicFinalCharBox;");
+- assertEquals(o.publicFinalCharBox, e.get("pf_char"));
+- e.eval("o.publicFinalCharBox = 'S';");
+- assertEquals(Character.valueOf('F'), o.publicFinalCharBox);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldCharBoxing() throws ScriptException {
+- e.eval("var psf_char = SharedObject.publicStaticFinalChar;");
+- assertEquals(SharedObject.publicStaticFinalChar, e.get("psf_char"));
+- e.eval("SharedObject.publicStaticFinalChar = 'Z';");
+- assertEquals('K', SharedObject.publicStaticFinalChar);
+- }
+-
+- // --------------------------------float
+- // tests------------------------------------
+- @Test
+- public void accessFieldFloatBoxing() throws ScriptException {
+- e.eval("var p_float = o.publicFloatBox;");
+- assertEqualsDouble(o.publicFloatBox, "p_float");
+- o.publicFloatBox = 0.0f / 0.0f;
+- assertEquals(true, e.eval("isNaN(o.publicFloatBox)"));
+- o.publicFloatBox = 1.0f / 0.0f;
+- assertEquals(true, e.eval("Number.POSITIVE_INFINITY === o.publicFloatBox"));
+- o.publicFloatBox = -1.0f / 0.0f;
+- assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === o.publicFloatBox"));
+- e.eval("o.publicFloatBox = 20;");
+- assertEquals(20, o.publicFloatBox, 1e-10);
+- e.eval("o.publicFloatBox = 0.0/0.0;");
+- assertTrue(Float.isNaN(o.publicFloatBox));
+- e.eval("o.publicFloatBox = 1.0/0.0;");
+- assertEquals(Float.floatToIntBits(Float.POSITIVE_INFINITY), Float.floatToIntBits(o.publicFloatBox));
+- e.eval("o.publicFloatBox = -1.0/0.0;");
+- assertEquals(Float.NEGATIVE_INFINITY, o.publicFloatBox, 1e-10);
+- }
+-
+- @Test
+- public void accessStaticFieldFloatBoxing() throws ScriptException {
+- e.eval("var ps_float = SharedObject.publicStaticFloat;");
+- assertEqualsDouble(SharedObject.publicStaticFloat, "ps_float");
+- SharedObject.publicStaticFloat = 0.0f / 0.0f;
+- assertEquals(true, e.eval("isNaN(SharedObject.publicStaticFloat)"));
+- SharedObject.publicStaticFloat = 1.0f / 0.0f;
+- assertEquals(true, e.eval("Number.POSITIVE_INFINITY === SharedObject.publicStaticFloat"));
+- SharedObject.publicStaticFloat = -1.0f / 0.0f;
+- assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === SharedObject.publicStaticFloat"));
+- e.eval("SharedObject.publicStaticFloat = 20.0;");
+- assertEquals(20.0f, SharedObject.publicStaticFloat, 1e-10);
+- e.eval("SharedObject.publicStaticFloat = 0.0/0.0;");
+- assertTrue(Float.isNaN(SharedObject.publicStaticFloat));
+- e.eval("SharedObject.publicStaticFloat = 1.0/0.0;");
+- assertEquals(Float.floatToIntBits(Float.POSITIVE_INFINITY), Float.floatToIntBits(SharedObject.publicStaticFloat));
+- e.eval("SharedObject.publicStaticFloat = -1.0/0.0;");
+- assertEquals(Float.floatToIntBits(Float.NEGATIVE_INFINITY), Float.floatToIntBits(SharedObject.publicStaticFloat));
+- }
+-
+- @Test
+- public void accessFinalFloatBoxing() throws ScriptException {
+- e.eval("var pf_float = o.publicFinalFloatBox;");
+- assertEqualsDouble(o.publicFinalFloatBox, "pf_float");
+- e.eval("o.publicFinalFloatBox = 20.0;");
+- assertEquals(1.372e4f, o.publicFinalFloatBox, 1e-10);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldFloatBoxing() throws ScriptException {
+- e.eval("var psf_float = SharedObject.publicStaticFinalFloat;");
+- assertEqualsDouble(SharedObject.publicStaticFinalFloat, "psf_float");
+- e.eval("SharedObject.publicStaticFinalFloat = 20.0;");
+- assertEquals(0.72e8f, SharedObject.publicStaticFinalFloat, 1e-10);
+- }
+-
+- // --------------------------------double
+- // tests------------------------------------
+- @Test
+- public void accessFieldDoubleBoxing() throws ScriptException {
+- e.eval("var p_double = o.publicDoubleBox;");
+- assertEquals(o.publicDoubleBox, e.get("p_double"));
+- o.publicDoubleBox = 0.0 / 0.0;
+- assertEquals(true, e.eval("isNaN(o.publicDoubleBox)"));
+- o.publicDoubleBox = 1.0 / 0.0;
+- assertEquals(true, e.eval("Number.POSITIVE_INFINITY === o.publicDoubleBox"));
+- o.publicDoubleBox = -1.0 / 0.0;
+- assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === o.publicDoubleBox"));
+- e.eval("o.publicDoubleBox = 30;");
+- assertEquals(Double.doubleToLongBits(30.0), Double.doubleToLongBits(o.publicDoubleBox));
+- e.eval("o.publicDoubleBox = 0.0/0.0;");
+- assertTrue(Double.isNaN(o.publicDoubleBox));
+- e.eval("o.publicDoubleBox = 1.0/0.0;");
+- assertEquals(Double.doubleToLongBits(Double.POSITIVE_INFINITY), Double.doubleToLongBits(o.publicDoubleBox));
+- e.eval("o.publicDoubleBox = -1.0/0.0;");
+- assertEquals(Double.doubleToLongBits(Double.NEGATIVE_INFINITY), Double.doubleToLongBits(o.publicDoubleBox));
+- }
+-
+- @Test
+- public void accessStaticFieldDoubleBoxing() throws ScriptException {
+- e.eval("var ps_double = SharedObject.publicStaticDouble;");
+- assertEquals(SharedObject.publicStaticDouble, e.get("ps_double"));
+- SharedObject.publicStaticDouble = 0.0 / 0.0;
+- assertEquals(true, e.eval("isNaN(SharedObject.publicStaticDouble)"));
+- SharedObject.publicStaticDouble = 1.0 / 0.0;
+- assertEquals(true, e.eval("Number.POSITIVE_INFINITY === SharedObject.publicStaticDouble"));
+- SharedObject.publicStaticDouble = -1.0 / 0.0;
+- assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === SharedObject.publicStaticDouble"));
+- e.eval("SharedObject.publicStaticDouble = 40.0;");
+- assertEquals(Double.doubleToLongBits(40.0), Double.doubleToLongBits(SharedObject.publicStaticDouble));
+- e.eval("SharedObject.publicStaticDouble = 0.0/0.0;");
+- assertTrue(Double.isNaN(SharedObject.publicStaticDouble));
+- e.eval("SharedObject.publicStaticDouble = 1.0/0.0;");
+- assertEquals(Double.doubleToLongBits(Double.POSITIVE_INFINITY), Double.doubleToLongBits(SharedObject.publicStaticDouble));
+- e.eval("SharedObject.publicStaticDouble = -1.0/0.0;");
+- assertEquals(Double.doubleToLongBits(Double.NEGATIVE_INFINITY), Double.doubleToLongBits(SharedObject.publicStaticDouble));
+- }
+-
+- @Test
+- public void accessFinalFieldDoubleBoxing() throws ScriptException {
+- e.eval("var pf_double = o.publicFinalDoubleBox;");
+- assertEquals(o.publicFinalDoubleBox, e.get("pf_double"));
+- e.eval("o.publicFinalDoubleBox = 30.0;");
+- assertEquals(Double.doubleToLongBits(1.412e-12), Double.doubleToLongBits(o.publicFinalDoubleBox));
+- }
+-
+- @Test
+- public void accessStaticFinalFieldDoubleBoxing() throws ScriptException {
+- e.eval("var psf_double = SharedObject.publicStaticFinalDouble;");
+- assertEquals(SharedObject.publicStaticFinalDouble, e.get("psf_double"));
+- e.eval("SharedObject.publicStaticFinalDouble = 40.0;");
+- assertEquals(Double.doubleToLongBits(1.8e12), Double.doubleToLongBits(SharedObject.publicStaticFinalDouble));
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,165 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import static org.testng.AssertJUnit.assertEquals;
+-import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.TestNG;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-/**
+- * @test
+- * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.ObjectAccessTest
+- * @run testng/othervm jdk.nashorn.api.javaaccess.ObjectAccessTest
+- */
+-@SuppressWarnings("javadoc")
+-public class ObjectAccessTest {
+-
+- private static ScriptEngine e = null;
+- private static SharedObject o = null;
+-
+- public static void main(final String[] args) {
+- TestNG.main(args);
+- }
+-
+- @BeforeClass
+- public static void setUpClass() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- e = m.getEngineByName("nashorn");
+- o = new SharedObject();
+- e.put("o", o);
+- e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;");
+- e.eval("var Person = Packages.jdk.nashorn.api.javaaccess.Person;");
+- }
+-
+- @AfterClass
+- public static void tearDownClass() {
+- e = null;
+- o = null;
+- }
+-
+- @Test
+- public void accessFieldObject() throws ScriptException {
+- e.eval("var p_object = o.publicObject;");
+- assertEquals(o.publicObject, e.get("p_object"));
+- assertEquals("object", e.eval("typeof p_object;"));
+- e.eval("o.publicObject = new Person(14);");
+- assertEquals(new Person(14), o.publicObject);
+- }
+-
+- @Test
+- public void accessFieldObjectArray() throws ScriptException {
+- e.eval("var p_object_array = o.publicObjectArray;");
+- assertEquals(o.publicObjectArray[0], e.eval("o.publicObjectArray[0]"));
+- assertArrayEquals(o.publicObjectArray, (Object[])e.get("p_object_array"));
+- e.eval("var t_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.Person[]\"))(3);" +
+- "t_object_arr[0] = new Person(100);" +
+- "t_object_arr[1] = new Person(120);" +
+- "t_object_arr[2] = new Person(140);" +
+- "o.publicObjectArray = t_object_arr;");
+- assertArrayEquals(new Person[] { new Person(100), new Person(120), new Person(140) }, o.publicObjectArray);
+- e.eval("o.publicObjectArray[0] = new Person(10);");
+- assertEquals(new Person(10), o.publicObjectArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFieldObject() throws ScriptException {
+- e.eval("var ps_object = SharedObject.publicStaticObject;");
+- assertEquals(SharedObject.publicStaticObject, e.get("ps_object"));
+- assertEquals("object", e.eval("typeof ps_object;"));
+- e.eval("SharedObject.publicStaticObject = new Person(16);");
+- assertEquals(new Person(16), SharedObject.publicStaticObject);
+- }
+-
+- @Test
+- public void accessStaticFieldObjectArray() throws ScriptException {
+- e.eval("var ps_object_array = SharedObject.publicStaticObjectArray;");
+- assertEquals(SharedObject.publicStaticObjectArray[0], e.eval("SharedObject.publicStaticObjectArray[0]"));
+- assertArrayEquals(SharedObject.publicStaticObjectArray, (Object[])e.get("ps_object_array"));
+- e.eval("var ts_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.Person[]\"))(3);" +
+- "ts_object_arr[0] = new Person(100);" +
+- "ts_object_arr[1] = new Person(120);" +
+- "ts_object_arr[2] = new Person(140);" +
+- "SharedObject.publicStaticObjectArray = ts_object_arr;");
+- assertArrayEquals(new Person[] { new Person(100), new Person(120), new Person(140) }, SharedObject.publicStaticObjectArray);
+- e.eval("SharedObject.publicStaticObjectArray[0] = new Person(10);");
+- assertEquals(new Person(10), SharedObject.publicStaticObjectArray[0]);
+- }
+-
+- @Test
+- public void accessFinalFieldObject() throws ScriptException {
+- e.eval("var pf_object = o.publicFinalObject;");
+- assertEquals(o.publicFinalObject, e.get("pf_object"));
+- assertEquals("object", e.eval("typeof pf_object;"));
+- e.eval("o.publicFinalObject = new Person(-999);");
+- assertEquals(new Person(1024), o.publicFinalObject);
+- }
+-
+- @Test
+- public void accessFinalFieldObjectArray() throws ScriptException {
+- e.eval("var pf_object_array = o.publicFinalObjectArray;");
+- assertEquals(o.publicFinalObjectArray[0], e.eval("o.publicFinalObjectArray[0]"));
+- assertArrayEquals(o.publicFinalObjectArray, (Object[])e.get("pf_object_array"));
+- e.eval("var tf_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.Person[]\"))(3);" +
+- "tf_object_arr[0] = new Person(100);" +
+- "tf_object_arr[1] = new Person(120);" +
+- "tf_object_arr[2] = new Person(140);" +
+- "o.publicOFinalbjectArray = tf_object_arr;");
+- assertArrayEquals(new Person[] { new Person(-900), new Person(1000), new Person(180) }, o.publicFinalObjectArray);
+- e.eval("o.publicFinalObjectArray[0] = new Person(10);");
+- assertEquals(new Person(10), o.publicFinalObjectArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldObject() throws ScriptException {
+- e.eval("var psf_object = SharedObject.publicStaticFinalObject;");
+- assertEquals(SharedObject.publicStaticFinalObject, e.get("psf_object"));
+- assertEquals("object", e.eval("typeof psf_object;"));
+- e.eval("SharedObject.publicStaticFinalObject = new Person(6);");
+- assertEquals(new Person(2048), SharedObject.publicStaticFinalObject);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldObjectArray() throws ScriptException {
+- e.eval("var psf_object_array = SharedObject.publicStaticFinalObjectArray;");
+- assertEquals(SharedObject.publicStaticFinalObjectArray[0], e.eval("SharedObject.publicStaticFinalObjectArray[0]"));
+- assertArrayEquals(SharedObject.publicStaticFinalObjectArray, (Object[])e.get("psf_object_array"));
+- e.eval("var tsf_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.Person[]\"))(3);" +
+- "tsf_object_arr[0] = new Person(100);" +
+- "tsf_object_arr[1] = new Person(120);" +
+- "tsf_object_arr[2] = new Person(140);" +
+- "SharedObject.publicStaticFinalObjectArray = tsf_object_arr;");
+- assertArrayEquals(new Person[] { new Person(-9), new Person(110), new Person(Integer.MAX_VALUE) }, SharedObject.publicStaticFinalObjectArray);
+- e.eval("SharedObject.publicStaticFinalObjectArray[0] = new Person(90);");
+- assertEquals(new Person(90), SharedObject.publicStaticFinalObjectArray[0]);
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/Person.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,59 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-@SuppressWarnings("javadoc")
+-public class Person {
+-
+- public int id = 0;
+-
+- public Person() {
+- }
+-
+- public Person(final int code) {
+- this.id = code;
+- }
+-
+- @Override
+- public boolean equals(final Object obj) {
+- if (obj != null && obj instanceof Person) {
+- final Person o = (Person)obj;
+- return this.id == o.id;
+- }
+- return false;
+- }
+-
+- @Override
+- public int hashCode() {
+- return id;
+- }
+-
+- @Override
+- public String toString() {
+- return "Person(" + id + ")";
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/SharedObject.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,467 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import javax.script.Invocable;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptException;
+-
+-@SuppressWarnings("javadoc")
+-public class SharedObject {
+-
+- // Public fields
+- public String publicString = "PublicString";
+- public String[] publicStringArray = { "ArrayString[0]", "ArrayString[1]", "ArrayString[2]", "ArrayString[3]" };
+- public Person publicObject = new Person(256);
+- public Person[] publicObjectArray = { new Person(4), new Person(-422), new Person(14) };
+- public boolean publicBoolean = true;
+- public boolean[] publicBooleanArray = { true, false, false, true };
+- public Boolean publicBooleanBox = true;
+- public long publicLong = 933333333333333333L;
+- public long[] publicLongArray = { 99012333333333L, -124355555L, 89777777777L };
+- public Long publicLongBox = 9333333333L;
+- public int publicInt = 2076543123;
+- public int[] publicIntArray = { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 };
+- public Integer publicIntBox = 20765123;
+- public byte publicByte = -128;
+- public byte[] publicByteArray = { 1, 2, 4, 8, 16, 32, 64, 127, -128 };
+- public Byte publicByteBox = 127;
+- public short publicShort = 32000;
+- public short[] publicShortArray = { 3240, 8900, -16789, 1, 12 };
+- public Short publicShortBox = Short.MIN_VALUE;
+- public float publicFloat = 0.7f;
+- public float[] publicFloatArray = { -32.01f, 89.3f, -1.3e8f, 3.1f };
+- public Float publicFloatBox = 1.377e4f;
+- public double publicDouble = 1.34e20;
+- public double[] publicDoubleArray = { 0.75e80, 8e-43, 1.000077, 0.123e10 };
+- public Double publicDoubleBox = 1.4e-19;
+- public char publicChar = 'A';
+- public char[] publicCharArray = "Hello Nashorn".toCharArray();
+- public Character publicCharBox = 'B';
+- // Public static fields
+- public static String publicStaticString = "PublicStaticString";
+- public static String[] publicStaticStringArray = { "StaticArrayString[0]", "StaticArrayString[1]", "StaticArrayString[2]", "StaticArrayString[3]" };
+- public static Person publicStaticObject = new Person(512);
+- public static Person[] publicStaticObjectArray = { new Person(40), new Person(-22), new Person(18) };
+- public static boolean publicStaticBoolean = true;
+- public static boolean[] publicStaticBooleanArray = { false, false, false, true };
+- public static Boolean publicStaticBooleanBox = true;
+- public static long publicStaticLong = 13333333333333333L;
+- public static long[] publicStaticLongArray = { 19012333333333L, -224355555L, 39777777777L };
+- public static Long publicStaticLongBox = 9333333334L;
+- public static int publicStaticInt = 207654323;
+- public static int[] publicStaticIntArray = { 5, 8, 13, 21, 34 };
+- public static Integer publicStaticIntBox = 2075123;
+- public static byte publicStaticByte = -12;
+- public static byte[] publicStaticByteArray = { 16, 32, 64, 127, -128 };
+- public static Byte publicStaticByteBox = 17;
+- public static short publicStaticShort = 320;
+- public static short[] publicStaticShortArray = { 1240, 900, -1789, 100, 12 };
+- public static Short publicStaticShortBox = -16777;
+- public static float publicStaticFloat = 7.7e8f;
+- public static float[] publicStaticFloatArray = { -131.01f, 189.3f, -31.3e8f, 3.7f };
+- public static Float publicStaticFloatBox = 1.37e4f;
+- public static double publicStaticDouble = 1.341e20;
+- public static double[] publicStaticDoubleArray = { 0.75e80, 0.123e10, 8e-43, 1.000077 };
+- public static Double publicStaticDoubleBox = 1.41e-12;
+- public static char publicStaticChar = 'C';
+- public static char[] publicStaticCharArray = "Nashorn".toCharArray();
+- public static Character publicStaticCharBox = 'D';
+- // Public final fields
+- public final String publicFinalString = "PublicFinalString";
+- public final String[] publicFinalStringArray = { "FinalArrayString[0]", "FinalArrayString[1]", "FinalArrayString[2]", "FinalArrayString[3]" };
+- public final Person publicFinalObject = new Person(1024);
+- public final Person[] publicFinalObjectArray = { new Person(-900), new Person(1000), new Person(180) };
+- public final boolean publicFinalBoolean = true;
+- public final boolean[] publicFinalBooleanArray = { false, false, true, false };
+- public final Boolean publicFinalBooleanBox = true;
+- public final long publicFinalLong = 13353333333333333L;
+- public final long[] publicFinalLongArray = { 1901733333333L, -2247355555L, 3977377777L };
+- public final Long publicFinalLongBox = 9377333334L;
+- public final int publicFinalInt = 20712023;
+- public final int[] publicFinalIntArray = { 50, 80, 130, 210, 340 };
+- public final Integer publicFinalIntBox = 207512301;
+- public final byte publicFinalByte = -7;
+- public final byte[] publicFinalByteArray = { 1, 3, 6, 17, -128 };
+- public final Byte publicFinalByteBox = 19;
+- public final short publicFinalShort = 31220;
+- public final short[] publicFinalShortArray = { 12240, 9200, -17289, 1200, 12 };
+- public final Short publicFinalShortBox = -26777;
+- public final float publicFinalFloat = 7.72e8f;
+- public final float[] publicFinalFloatArray = { -131.012f, 189.32f, -31.32e8f, 3.72f };
+- public final Float publicFinalFloatBox = 1.372e4f;
+- public final double publicFinalDouble = 1.3412e20;
+- public final double[] publicFinalDoubleArray = { 0.725e80, 0.12e10, 8e-3, 1.00077 };
+- public final Double publicFinalDoubleBox = 1.412e-12;
+- public final char publicFinalChar = 'E';
+- public final char[] publicFinalCharArray = "Nashorn hello".toCharArray();
+- public final Character publicFinalCharBox = 'F';
+- // Public static final fields
+- public static final String publicStaticFinalString = "PublicStaticFinalString";
+- public static final String[] publicStaticFinalStringArray = { "StaticFinalArrayString[0]", "StaticFinalArrayString[1]", "StaticFinalArrayString[2]", "StaticFinalArrayString[3]" };
+- public static final Person publicStaticFinalObject = new Person(2048);
+- public static final Person[] publicStaticFinalObjectArray = { new Person(-9), new Person(110), new Person(Integer.MAX_VALUE) };
+- public static final boolean publicStaticFinalBoolean = true;
+- public static final boolean[] publicStaticFinalBooleanArray = { false, true, false, false };
+- public static final Boolean publicStaticFinalBooleanBox = true;
+- public static final long publicStaticFinalLong = 8333333333333L;
+- public static final long[] publicStaticFinalLongArray = { 19017383333L, -2247358L, 39773787L };
+- public static final Long publicStaticFinalLongBox = 9377388334L;
+- public static final int publicStaticFinalInt = 207182023;
+- public static final int[] publicStaticFinalIntArray = { 1308, 210, 340 };
+- public static final Integer publicStaticFinalIntBox = 2078301;
+- public static final byte publicStaticFinalByte = -70;
+- public static final byte[] publicStaticFinalByteArray = { 17, -128, 81 };
+- public static final Byte publicStaticFinalByteBox = 91;
+- public static final short publicStaticFinalShort = 8888;
+- public static final short[] publicStaticFinalShortArray = { 8240, 9280, -1289, 120, 812 };
+- public static final Short publicStaticFinalShortBox = -26;
+- public static final float publicStaticFinalFloat = 0.72e8f;
+- public static final float[] publicStaticFinalFloatArray = { -8131.012f, 9.32f, -138.32e8f, 0.72f };
+- public static final Float publicStaticFinalFloatBox = 1.2e4f;
+- public static final double publicStaticFinalDouble = 1.8e12;
+- public static final double[] publicStaticFinalDoubleArray = { 8.725e80, 0.82e10, 18e-3, 1.08077 };
+- public static final Double publicStaticFinalDoubleBox = 1.5612e-13;
+- public static final char publicStaticFinalChar = 'K';
+- public static final char[] publicStaticFinalCharArray = "StaticString".toCharArray();
+- public static final Character publicStaticFinalCharBox = 'L';
+-
+- // Special vars
+- public volatile boolean volatileBoolean = true;
+- public transient boolean transientBoolean = true;
+-
+- // For methods testing
+- public boolean isAccessed = false;
+- public volatile boolean isFinished = false;
+-
+- private ScriptEngine engine;
+-
+- public ScriptEngine getEngine() {
+- return engine;
+- }
+-
+- public void setEngine(final ScriptEngine engine) {
+- this.engine = engine;
+- }
+-
+- public void voidMethod() {
+- isAccessed = true;
+- }
+-
+- public boolean booleanMethod(final boolean arg) {
+- return !arg;
+- }
+-
+- public Boolean booleanBoxingMethod(final Boolean arg) {
+- return !arg.booleanValue();
+- }
+-
+- public boolean[] booleanArrayMethod(final boolean arg[]) {
+- final boolean[] res = new boolean[arg.length];
+- for (int i = 0; i < arg.length; i++) {
+- res[i] = !arg[i];
+- }
+- return res;
+- }
+-
+- public int intMethod(final int arg) {
+- return arg + arg;
+- }
+-
+- public Integer intBoxingMethod(final Integer arg) {
+- return arg + arg;
+- }
+-
+- public int[] intArrayMethod(final int arg[]) {
+- final int[] res = new int[arg.length];
+- for (int i = 0; i < arg.length; i++) {
+- res[i] = arg[i] * 2;
+- }
+- return res;
+- }
+-
+- public long longMethod(final long arg) {
+- return arg + arg;
+- }
+-
+- public Long longBoxingMethod(final Long arg) {
+- return arg + arg;
+- }
+-
+- public long[] longArrayMethod(final long[] arg) {
+- final long[] res = new long[arg.length];
+- for (int i = 0; i < arg.length; i++) {
+- res[i] = arg[i] * 2;
+- }
+- return res;
+- }
+-
+- public byte byteMethod(final byte arg) {
+- return (byte)(arg + arg);
+- }
+-
+- public Byte byteBoxingMethod(final Byte arg) {
+- return (byte)(arg + arg);
+- }
+-
+- public byte[] byteArrayMethod(final byte[] arg) {
+- final byte[] res = new byte[arg.length];
+- for (int i = 0; i < arg.length; i++) {
+- res[i] = (byte)(arg[i] * 2);
+- }
+- return res;
+- }
+-
+- public char charMethod(final char arg) {
+- return Character.toUpperCase(arg);
+- }
+-
+- public Character charBoxingMethod(final Character arg) {
+- return Character.toUpperCase(arg);
+- }
+-
+- public char[] charArrayMethod(final char[] arg) {
+- final char[] res = new char[arg.length];
+- for (int i = 0; i < arg.length; i++) {
+- res[i] = Character.toUpperCase(arg[i]);
+- }
+- return res;
+- }
+-
+- public short shortMethod(final short arg) {
+- return (short)(arg + arg);
+- }
+-
+- public Short shortBoxingMethod(final Short arg) {
+- return (short)(arg + arg);
+- }
+-
+- public short[] shortArrayMethod(final short[] arg) {
+- final short[] res = new short[arg.length];
+- for (int i = 0; i < arg.length; i++) {
+- res[i] = (short)(arg[i] * 2);
+- }
+- return res;
+- }
+-
+- public float floatMethod(final float arg) {
+- return arg + arg;
+- }
+-
+- public Float floatBoxingMethod(final Float arg) {
+- return arg + arg;
+- }
+-
+- public float[] floatArrayMethod(final float[] arg) {
+- final float[] res = new float[arg.length];
+- for (int i = 0; i < arg.length; i++) {
+- res[i] = arg[i] * 2;
+- }
+- return res;
+- }
+-
+- public double doubleMethod(final double arg) {
+- return arg + arg;
+- }
+-
+- public Double doubleBoxingMethod(final Double arg) {
+- return arg + arg;
+- }
+-
+- public double[] doubleArrayMethod(final double[] arg) {
+- final double[] res = new double[arg.length];
+- for (int i = 0; i < arg.length; i++) {
+- res[i] = arg[i] * 2;
+- }
+- return res;
+- }
+-
+- public String stringMethod(final String str) {
+- return str + str;
+- }
+-
+- public String[] stringArrayMethod(final String[] arr) {
+- final int l = arr.length;
+- final String[] res = new String[l];
+- for (int i = 0; i < l; i++) {
+- res[i] = arr[l - i - 1];
+- }
+- return res;
+- }
+-
+- public Person[] objectArrayMethod(final Person[] arr) {
+- final Person[] res = new Person[arr.length];
+- for (int i = 0; i < arr.length; i++) {
+- res[i] = new Person(i + 100);
+- }
+- return res;
+- }
+-
+- public Person objectMethod(final Person t) {
+- t.id *= 2;
+- return t;
+- }
+-
+- public int twoParamMethod(final long l, final double d) {
+- return (int)(l + d);
+- }
+-
+- public int threeParamMethod(final short s, final long l, final char c) {
+- return (int)(s + l + c);
+- }
+-
+- public Person[] twoObjectParamMethod(final Person arg1, final Person arg2) {
+- return new Person[] { arg2, arg1 };
+- }
+-
+- public Person[] threeObjectParamMethod(final Person arg1, final Person arg2, final Person arg3) {
+- return new Person[] { arg3, arg2, arg1 };
+- }
+-
+- public Person[] eightObjectParamMethod(final Person arg1, final Person arg2, final Person arg3, final Person arg4, final Person arg5, final Person arg6, final Person arg7, final Person arg8) {
+- return new Person[] { arg8, arg7, arg6, arg5, arg4, arg3, arg2, arg1 };
+- }
+-
+- public Person[] nineObjectParamMethod(final Person arg1, final Person arg2, final Person arg3, final Person arg4, final Person arg5, final Person arg6, final Person arg7, final Person arg8, final Person arg9) {
+- return new Person[] { arg9, arg8, arg7, arg6, arg5, arg4, arg3, arg2, arg1 };
+- }
+-
+- public Person[] methodObjectEllipsis(final Person... args) {
+- final int l = args.length;
+- final Person[] res = new Person[l];
+- for (int i = 0; i < l; i++) {
+- res[i] = args[l - i - 1];
+- }
+- return res;
+- }
+-
+- public Person[] methodPrimitiveEllipsis(final int... args) {
+- final int l = args.length;
+- final Person[] res = new Person[l];
+- for (int i = 0; i < l; i++) {
+- res[i] = new Person(args[i]);
+- }
+- return res;
+- }
+-
+- public Object[] methodMixedEllipsis(final Object... args) {
+- return args;
+- }
+-
+- public Object[] methodObjectWithEllipsis(final String arg, final int... args) {
+- final Object[] res = new Object[args.length + 1];
+- res[0] = arg;
+- for (int i = 0; i < args.length; i++) {
+- res[i + 1] = args[i];
+- }
+- return res;
+- }
+-
+- public Object[] methodPrimitiveWithEllipsis(final int arg, final long... args) {
+- final Object[] res = new Object[args.length + 1];
+- res[0] = arg;
+- for (int i = 0; i < args.length; i++) {
+- res[i + 1] = args[i];
+- }
+- return res;
+- }
+-
+- public Object[] methodMixedWithEllipsis(final String arg1, final int arg2, final Object... args) {
+- final Object[] res = new Object[args.length + 2];
+- res[0] = arg1;
+- res[1] = arg2;
+- System.arraycopy(args, 0, res, 2, args.length);
+- return res;
+- }
+-
+- public void methodStartsThread() {
+- isFinished = false;
+-
+- final Thread t = new Thread(new Runnable() {
+- @Override
+- public void run() {
+- try {
+- Thread.sleep(1000);
+- isFinished = true;
+- } catch (final InterruptedException e) {
+- e.printStackTrace();
+- }
+- }
+- });
+-
+- t.start();
+- }
+-
+- public String overloadedMethodDoubleVSint(final int arg) {
+- return "int";
+- }
+-
+- public String overloadedMethodDoubleVSint(final double arg) {
+- return "double";
+- }
+-
+- public int overloadedMethod(final int arg) {
+- return arg*2;
+- }
+-
+- public int overloadedMethod(final String arg) {
+- return arg.length();
+- }
+-
+- public int overloadedMethod(final boolean arg) {
+- return (arg) ? 1 : 0;
+- }
+-
+- public int overloadedMethod(final Person arg) {
+- return arg.id*2;
+- }
+-
+- public int firstLevelMethodInt(final int arg) throws ScriptException, NoSuchMethodException {
+- return (int) ((Invocable)engine).invokeFunction("secondLevelMethodInt", arg);
+- }
+-
+- public int thirdLevelMethodInt(final int arg) {
+- return arg*5;
+- }
+-
+- public int firstLevelMethodInteger(final Integer arg) throws ScriptException, NoSuchMethodException {
+- return (int) ((Invocable)engine).invokeFunction("secondLevelMethodInteger", arg);
+- }
+-
+- public int thirdLevelMethodInteger(final Integer arg) {
+- return arg*10;
+- }
+-
+- public Person firstLevelMethodObject(final Person p) throws ScriptException, NoSuchMethodException {
+- return (Person) ((Invocable)engine).invokeFunction("secondLevelMethodObject", p);
+- }
+-
+- public Person thirdLevelMethodObject(final Person p) {
+- p.id *= 10;
+- return p;
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,168 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess;
+-
+-import static org.testng.AssertJUnit.assertEquals;
+-import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.TestNG;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-/**
+- * @test
+- * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.StringAccessTest
+- * @run testng/othervm jdk.nashorn.api.javaaccess.StringAccessTest
+- */
+-@SuppressWarnings("javadoc")
+-public class StringAccessTest {
+-
+- private static ScriptEngine e = null;
+- private static SharedObject o = null;
+-
+- public static void main(final String[] args) {
+- TestNG.main(args);
+- }
+-
+- @BeforeClass
+- public static void setUpClass() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- e = m.getEngineByName("nashorn");
+- o = new SharedObject();
+- e.put("o", o);
+- e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;");
+- }
+-
+- @AfterClass
+- public static void tearDownClass() {
+- e = null;
+- o = null;
+- }
+-
+- @Test
+- public void accessFieldString() throws ScriptException {
+- e.eval("var p_string = o.publicString;");
+- assertEquals(o.publicString, e.get("p_string"));
+- assertEquals("string", e.eval("typeof p_string;"));
+- e.eval("o.publicString = 'changedString';");
+- assertEquals("changedString", o.publicString);
+- }
+-
+- @Test
+- public void accessFieldStringArray() throws ScriptException {
+- e.eval("var p_string_array = o.publicStringArray;");
+- assertEquals(o.publicStringArray[0], e.eval("o.publicStringArray[0]"));
+- assertArrayEquals(o.publicStringArray, (String[])e.get("p_string_array"));
+- e.eval("var t_string_arr = new (Java.type(\"java.lang.String[]\"))(3);" +
+- "t_string_arr[0] = 'abc';" +
+- "t_string_arr[1] = '123';" +
+- "t_string_arr[2] = 'xyzzzz';" +
+- "o.publicStringArray = t_string_arr;");
+- assertArrayEquals(new String[] { "abc", "123", "xyzzzz" }, o.publicStringArray);
+- e.eval("o.publicStringArray[0] = 'nashorn';");
+- assertEquals("nashorn", o.publicStringArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFieldString() throws ScriptException {
+- e.eval("var ps_string = SharedObject.publicStaticString;");
+- assertEquals(SharedObject.publicStaticString, e.get("ps_string"));
+- assertEquals("string", e.eval("typeof ps_string;"));
+- e.eval("SharedObject.publicStaticString = 'changedString';");
+- assertEquals("changedString", SharedObject.publicStaticString);
+- }
+-
+- @Test
+- public void accessStaticFieldStringArray() throws ScriptException {
+- e.eval("var ps_string_array = SharedObject.publicStaticStringArray;");
+- assertEquals(SharedObject.publicStaticStringArray[0], e.eval("SharedObject.publicStaticStringArray[0]"));
+- assertArrayEquals(SharedObject.publicStaticStringArray, (String[])e.get("ps_string_array"));
+- e.eval("var ts_string_arr = new (Java.type(\"java.lang.String[]\"))(3);" +
+- "ts_string_arr[0] = 'abc';" +
+- "ts_string_arr[1] = '123';" +
+- "ts_string_arr[2] = 'xyzzzz';" +
+- "SharedObject.publicStaticStringArray = ts_string_arr;");
+- assertArrayEquals(new String[] { "abc", "123", "xyzzzz" }, SharedObject.publicStaticStringArray);
+- e.eval("SharedObject.publicStaticStringArray[0] = 'nashorn';");
+- assertEquals("nashorn", SharedObject.publicStaticStringArray[0]);
+- }
+-
+- @Test
+- public void accessFinalFieldString() throws ScriptException {
+- e.eval("var pf_string = o.publicFinalString;");
+- assertEquals(o.publicFinalString, e.get("pf_string"));
+- assertEquals("string", e.eval("typeof pf_string;"));
+- e.eval("o.publicFinalString = 'changedString';");
+- assertEquals("PublicFinalString", o.publicFinalString);
+- }
+-
+- @Test
+- public void accessFinalFieldStringArray() throws ScriptException {
+- e.eval("var pf_string_array = o.publicFinalStringArray;");
+- assertEquals(o.publicFinalStringArray[0], e.eval("o.publicFinalStringArray[0]"));
+- assertArrayEquals(o.publicFinalStringArray, (String[])e.get("pf_string_array"));
+- e.eval("var tf_string_arr = new (Java.type(\"java.lang.String[]\"))(3);" +
+- "tf_string_arr[0] = 'abc';" +
+- "tf_string_arr[1] = '123';" +
+- "tf_string_arr[2] = 'xyzzzz';" +
+- "o.publicFinalStringArray = tf_string_arr;");
+- assertArrayEquals(new String[] { "FinalArrayString[0]", "FinalArrayString[1]", "FinalArrayString[2]", "FinalArrayString[3]" }, o.publicFinalStringArray);
+- e.eval("o.publicFinalStringArray[0] = 'nashorn';");
+- assertEquals("nashorn", o.publicFinalStringArray[0]);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldString() throws ScriptException {
+- e.eval("var psf_string = SharedObject.publicStaticFinalString;");
+- assertEquals(SharedObject.publicStaticFinalString, e.get("psf_string"));
+- assertEquals("string", e.eval("typeof psf_string;"));
+- e.eval("SharedObject.publicStaticFinalString = 'changedString';");
+- assertEquals("PublicStaticFinalString", SharedObject.publicStaticFinalString);
+- }
+-
+- @Test
+- public void accessStaticFinalFieldStringArray() throws ScriptException {
+- e.eval("var psf_string_array = SharedObject.publicStaticFinalStringArray;");
+- assertEquals(SharedObject.publicStaticFinalStringArray[0], e.eval("SharedObject.publicStaticFinalStringArray[0]"));
+- assertArrayEquals(SharedObject.publicStaticFinalStringArray, (String[])e.get("psf_string_array"));
+- e.eval("var tsf_string_arr = new (Java.type(\"java.lang.String[]\"))(3);" +
+- "tsf_string_arr[0] = 'abc';" +
+- "tsf_string_arr[1] = '123';" +
+- "tsf_string_arr[2] = 'xyzzzz';" +
+- "SharedObject.publicStaticFinalStringArray = tsf_string_arr;");
+- assertArrayEquals(new String[] { "StaticFinalArrayString[0]",
+- "StaticFinalArrayString[1]",
+- "StaticFinalArrayString[2]",
+- "StaticFinalArrayString[3]" },
+- SharedObject.publicStaticFinalStringArray);
+- e.eval("SharedObject.publicStaticFinalStringArray[0] = 'nashorn';");
+- assertEquals("nashorn", SharedObject.publicStaticFinalStringArray[0]);
+- }
+-
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/ArrayConversionTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,235 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import static org.testng.AssertJUnit.assertEquals;
++import static org.testng.AssertJUnit.assertFalse;
++import static org.testng.AssertJUnit.assertNull;
++import static org.testng.AssertJUnit.assertTrue;
++import java.util.Arrays;
++import java.util.List;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import org.testng.TestNG;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++@SuppressWarnings("javadoc")
++public class ArrayConversionTest {
++ private static ScriptEngine e = null;
++
++ public static void main(final String[] args) {
++ TestNG.main(args);
++ }
++
++ @BeforeClass
++ public static void setUpClass() {
++ e = new ScriptEngineManager().getEngineByName("nashorn");
++ }
++
++ @AfterClass
++ public static void tearDownClass() {
++ e = null;
++ }
++
++ @Test
++ public void testIntArrays() throws ScriptException {
++ runTest("assertNullIntArray", "null");
++ runTest("assertEmptyIntArray", "[]");
++ runTest("assertSingle42IntArray", "[42]");
++ runTest("assertSingle42IntArray", "['42']");
++ runTest("assertIntArrayConversions", "[false, true, NaN, Infinity, -Infinity, 0.4, 0.6, null, undefined, [], {}, [1], [1, 2]]");
++ }
++
++ @Test
++ public void testIntIntArrays() throws ScriptException {
++ runTest("assertNullIntIntArray", "null");
++ runTest("assertEmptyIntIntArray", "[]");
++ runTest("assertSingleEmptyIntIntArray", "[[]]");
++ runTest("assertSingleNullIntIntArray", "[null]");
++ runTest("assertLargeIntIntArray", "[[false], [1], [2, 3], [4, 5, 6], ['7', {valueOf: function() { return 8 }}]]");
++ }
++
++ @Test
++ public void testObjectObjectArrays() throws ScriptException {
++ runTest("assertLargeObjectObjectArray", "[[false], [1], ['foo', 42.3], [{x: 17}]]");
++ }
++
++ @Test
++ public void testBooleanArrays() throws ScriptException {
++ runTest("assertBooleanArrayConversions", "[false, true, '', 'false', 0, 1, 0.4, 0.6, {}, [], [false], [true], NaN, Infinity, null, undefined]");
++ }
++
++ @Test
++ public void testArrayAmbiguity() throws ScriptException {
++ runTest("x", "'abc'");
++ runTest("x", "['foo', 'bar']");
++ }
++
++ @Test
++ public void testListArrays() throws ScriptException {
++ runTest("assertListArray", "[['foo', 'bar'], ['apple', 'orange']]");
++ }
++
++ @Test
++ public void testVarArgs() throws ScriptException {
++ // Sole NativeArray in vararg position becomes vararg array itself
++ runTest("assertVarArg_42_17", "[42, 17]");
++ // NativeArray in vararg position becomes an argument if there are more arguments
++ runTest("assertVarArg_array_17", "[42], 18");
++ // Only NativeArray is converted to vararg array, other objects (e.g. a function) aren't
++ runTest("assertVarArg_function", "function() { return 'Hello' }");
++ }
++
++ private static void runTest(final String testMethodName, final String argument) throws ScriptException {
++ e.eval("Java.type('" + ArrayConversionTest.class.getName() + "')." + testMethodName + "(" + argument + ")");
++ }
++
++ public static void assertNullIntArray(final int[] array) {
++ assertNull(array);
++ }
++
++ public static void assertNullIntIntArray(final int[][] array) {
++ assertNull(array);
++ }
++
++ public static void assertEmptyIntArray(final int[] array) {
++ assertEquals(0, array.length);
++ }
++
++ public static void assertSingle42IntArray(final int[] array) {
++ assertEquals(1, array.length);
++ assertEquals(42, array[0]);
++ }
++
++
++ public static void assertIntArrayConversions(final int[] array) {
++ assertEquals(13, array.length);
++ assertEquals(0, array[0]); // false
++ assertEquals(1, array[1]); // true
++ assertEquals(0, array[2]); // NaN
++ assertEquals(0, array[3]); // Infinity
++ assertEquals(0, array[4]); // -Infinity
++ assertEquals(0, array[5]); // 0.4
++ assertEquals(0, array[6]); // 0.6 - floor, not round
++ assertEquals(0, array[7]); // null
++ assertEquals(0, array[8]); // undefined
++ assertEquals(0, array[9]); // []
++ assertEquals(0, array[10]); // {}
++ assertEquals(1, array[11]); // [1]
++ assertEquals(0, array[12]); // [1, 2]
++ }
++
++ public static void assertEmptyIntIntArray(final int[][] array) {
++ assertEquals(0, array.length);
++ }
++
++ public static void assertSingleEmptyIntIntArray(final int[][] array) {
++ assertEquals(1, array.length);
++ assertTrue(Arrays.equals(new int[0], array[0]));
++ }
++
++ public static void assertSingleNullIntIntArray(final int[][] array) {
++ assertEquals(1, array.length);
++ assertNull(null, array[0]);
++ }
++
++ public static void assertLargeIntIntArray(final int[][] array) {
++ assertEquals(5, array.length);
++ assertTrue(Arrays.equals(new int[] { 0 }, array[0]));
++ assertTrue(Arrays.equals(new int[] { 1 }, array[1]));
++ assertTrue(Arrays.equals(new int[] { 2, 3 }, array[2]));
++ assertTrue(Arrays.equals(new int[] { 4, 5, 6 }, array[3]));
++ assertTrue(Arrays.equals(new int[] { 7, 8 }, array[4]));
++ }
++
++ public static void assertLargeObjectObjectArray(final Object[][] array) throws ScriptException {
++ assertEquals(4, array.length);
++ assertTrue(Arrays.equals(new Object[] { Boolean.FALSE }, array[0]));
++ assertTrue(Arrays.equals(new Object[] { 1 }, array[1]));
++ assertTrue(Arrays.equals(new Object[] { "foo", 42.3d }, array[2]));
++ assertEquals(1, array[3].length);
++ e.getBindings(ScriptContext.ENGINE_SCOPE).put("obj", array[3][0]);
++ assertEquals(17, e.eval("obj.x"));
++ }
++
++ public static void assertBooleanArrayConversions(final boolean[] array) {
++ assertEquals(16, array.length);
++ assertFalse(array[0]); // false
++ assertTrue(array[1]); // true
++ assertFalse(array[2]); // ''
++ assertTrue(array[3]); // 'false' (yep, every non-empty string converts to true)
++ assertFalse(array[4]); // 0
++ assertTrue(array[5]); // 1
++ assertTrue(array[6]); // 0.4
++ assertTrue(array[7]); // 0.6
++ assertTrue(array[8]); // {}
++ assertTrue(array[9]); // []
++ assertTrue(array[10]); // [false]
++ assertTrue(array[11]); // [true]
++ assertFalse(array[12]); // NaN
++ assertTrue(array[13]); // Infinity
++ assertFalse(array[14]); // null
++ assertFalse(array[15]); // undefined
++ }
++
++ public static void assertListArray(final List<?>[] array) {
++ assertEquals(2, array.length);
++ assertEquals(Arrays.asList("foo", "bar"), array[0]);
++ assertEquals(Arrays.asList("apple", "orange"), array[1]);
++ }
++
++ public static void assertVarArg_42_17(final Object... args) {
++ assertEquals(2, args.length);
++ assertEquals(42, ((Number)args[0]).intValue());
++ assertEquals(17, ((Number)args[1]).intValue());
++ }
++
++ public static void assertVarArg_array_17(final Object... args) throws ScriptException {
++ assertEquals(2, args.length);
++ e.getBindings(ScriptContext.ENGINE_SCOPE).put("arr", args[0]);
++ assertTrue((Boolean)e.eval("arr instanceof Array && arr.length == 1 && arr[0] == 42"));
++ assertEquals(18, ((Number)args[1]).intValue());
++ }
++
++ public static void assertVarArg_function(final Object... args) throws ScriptException {
++ assertEquals(1, args.length);
++ e.getBindings(ScriptContext.ENGINE_SCOPE).put("fn", args[0]);
++ assertEquals("Hello", e.eval("fn()"));
++ }
++
++
++
++ public static void x(final String y) {
++ assertEquals("abc", y);
++ }
++ public static void x(final String[] y) {
++ assertTrue(Arrays.equals(new String[] { "foo", "bar"}, y));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/BooleanAccessTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,219 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import static org.testng.AssertJUnit.assertEquals;
++import static org.testng.AssertJUnit.assertTrue;
++import java.util.Arrays;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import org.testng.TestNG;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++/**
++ * @test
++ * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.BooleanAccessTest
++ * @run testng/othervm jdk.nashorn.api.javaaccess.test.BooleanAccessTest
++ */
++@SuppressWarnings("javadoc")
++public class BooleanAccessTest {
++
++ private static ScriptEngine e = null;
++ private static SharedObject o = null;
++
++ public static void main(final String[] args) {
++ TestNG.main(args);
++ }
++
++ @BeforeClass
++ public static void setUpClass() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ e = m.getEngineByName("nashorn");
++ o = new SharedObject();
++ e.put("o", o);
++ e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
++ }
++
++ @AfterClass
++ public static void tearDownClass() {
++ e = null;
++ o = null;
++ }
++
++ @Test
++ public void accessFieldBoolean() throws ScriptException {
++ e.eval("var p_boolean = o.publicBoolean;");
++ assertEquals(o.publicBoolean, e.get("p_boolean"));
++ assertEquals("boolean", e.eval("typeof p_boolean;"));
++ e.eval("o.publicBoolean = false;");
++ assertEquals(false, o.publicBoolean);
++ }
++
++ @Test
++ public void accessFieldBooleanArray() throws ScriptException {
++ e.eval("var p_boolean_array = o.publicBooleanArray;");
++ assertEquals(o.publicBooleanArray[0], e.eval("o.publicBooleanArray[0]"));
++ assertTrue(Arrays.equals(o.publicBooleanArray, (boolean[])e.get("p_boolean_array")));
++ e.eval("var t_boolean_arr = new (Java.type(\"boolean[]\"))(3);" +
++ "t_boolean_arr[0] = true;" +
++ "t_boolean_arr[1] = false;" +
++ "t_boolean_arr[2] = false;" +
++ "o.publicBooleanArray = t_boolean_arr;");
++ assertTrue(Arrays.equals(new boolean[] { true, false, false }, o.publicBooleanArray));
++ e.eval("o.publicBooleanArray[0] = false;");
++ assertEquals(false, o.publicBooleanArray[0]);
++ }
++
++ @Test
++ public void accessStaticFieldBoolean() throws ScriptException {
++ e.eval("var ps_boolean = SharedObject.publicStaticBoolean;");
++ assertEquals(SharedObject.publicStaticBoolean, e.get("ps_boolean"));
++ assertEquals("boolean", e.eval("typeof ps_boolean;"));
++ e.eval("SharedObject.publicStaticBoolean = false;");
++ assertEquals(false, SharedObject.publicStaticBoolean);
++ }
++
++ @Test
++ public void accessStaticFieldBooleanArray() throws ScriptException {
++ e.eval("var ps_boolean_array = SharedObject.publicStaticBooleanArray;");
++ assertEquals(SharedObject.publicStaticBooleanArray[0], e.eval("SharedObject.publicStaticBooleanArray[0]"));
++ assertTrue(Arrays.equals(SharedObject.publicStaticBooleanArray, (boolean[])e.get("ps_boolean_array")));
++ e.eval("var ts_boolean_arr = new (Java.type(\"boolean[]\"))(3);" +
++ "ts_boolean_arr[0] = true;" +
++ "ts_boolean_arr[1] = false;" +
++ "ts_boolean_arr[2] = true;" +
++ "SharedObject.publicStaticBooleanArray = ts_boolean_arr;");
++ assertTrue(Arrays.equals(new boolean[] { true, false, true }, SharedObject.publicStaticBooleanArray));
++ e.eval("SharedObject.publicStaticBooleanArray[0] = false;");
++ assertEquals(false, SharedObject.publicStaticBooleanArray[0]);
++ }
++
++ @Test
++ public void accessFinalFieldBoolean() throws ScriptException {
++ e.eval("var pf_boolean = o.publicFinalBoolean;");
++ assertEquals(o.publicFinalBoolean, e.get("pf_boolean"));
++ assertEquals("boolean", e.eval("typeof pf_boolean;"));
++ e.eval("o.publicFinalBoolean = false;");
++ assertEquals(true, o.publicFinalBoolean);
++ }
++
++ @Test
++ public void accessFinalFieldBooleanArray() throws ScriptException {
++ e.eval("var pf_boolean_array = o.publicFinalBooleanArray;");
++ assertEquals(o.publicFinalBooleanArray[0], e.eval("o.publicFinalBooleanArray[0]"));
++ assertTrue(Arrays.equals(o.publicFinalBooleanArray, (boolean[])e.get("pf_boolean_array")));
++ e.eval("var tf_boolean_arr = new (Java.type(\"boolean[]\"))(3);" +
++ "tf_boolean_arr[0] = false;" +
++ "tf_boolean_arr[1] = false;" +
++ "tf_boolean_arr[2] = true;" +
++ "o.publicOFinalbjectArray = tf_boolean_arr;");
++ assertTrue(Arrays.equals(new boolean[] { false, false, true, false }, o.publicFinalBooleanArray));
++ e.eval("o.publicFinalBooleanArray[0] = true;");
++ assertEquals(true, o.publicFinalBooleanArray[0]);
++ }
++
++ @Test
++ public void accessStaticFinalFieldBoolean() throws ScriptException {
++ e.eval("var psf_boolean = SharedObject.publicStaticFinalBoolean;");
++ assertEquals(SharedObject.publicStaticFinalBoolean, e.get("psf_boolean"));
++ assertEquals("boolean", e.eval("typeof psf_boolean;"));
++ e.eval("SharedObject.publicStaticFinalBoolean = false;");
++ assertEquals(true, SharedObject.publicStaticFinalBoolean);
++ }
++
++ @Test
++ public void accessStaticFinalFieldBooleanArray() throws ScriptException {
++ e.eval("var psf_boolean_array = SharedObject.publicStaticFinalBooleanArray;");
++ assertEquals(SharedObject.publicStaticFinalBooleanArray[0], e.eval("SharedObject.publicStaticFinalBooleanArray[0]"));
++ assertTrue(Arrays.equals(SharedObject.publicStaticFinalBooleanArray, (boolean[])e.get("psf_boolean_array")));
++ e.eval("var tsf_boolean_arr = new (Java.type(\"boolean[]\"))(3);" +
++ "tsf_boolean_arr[0] = false;" +
++ "tsf_boolean_arr[1] = true;" +
++ "tsf_boolean_arr[2] = false;" +
++ "SharedObject.publicStaticFinalBooleanArray = tsf_boolean_arr;");
++ assertTrue(Arrays.equals(new boolean[] { false, true, false, false }, SharedObject.publicStaticFinalBooleanArray));
++ e.eval("SharedObject.publicStaticFinalBooleanArray[0] = true;");
++ assertEquals(true, SharedObject.publicStaticFinalBooleanArray[0]);
++ }
++
++ @Test
++ public void accessFieldBooleanBoxing() throws ScriptException {
++ e.eval("var p_boolean_box = o.publicBooleanBox;");
++ assertEquals(o.publicBooleanBox, e.get("p_boolean_box"));
++ assertEquals("boolean", e.eval("typeof p_boolean_box;"));
++ e.eval("o.publicBooleanBox = false;");
++ assertEquals(false, (boolean)o.publicBooleanBox);
++ }
++
++ @Test
++ public void accessStaticFieldBooleanBoxing() throws ScriptException {
++ e.eval("var ps_boolean_box = SharedObject.publicStaticBooleanBox;");
++ assertEquals(SharedObject.publicStaticBooleanBox, e.get("ps_boolean_box"));
++ assertEquals("boolean", e.eval("typeof ps_boolean_box;"));
++ e.eval("SharedObject.publicStaticBooleanBox = false;");
++ assertEquals(false, (boolean)SharedObject.publicStaticBooleanBox);
++ }
++
++ @Test
++ public void accessFinalFieldBooleanBoxing() throws ScriptException {
++ e.eval("var pf_boolean_box = o.publicFinalBooleanBox;");
++ assertEquals(o.publicFinalBooleanBox, e.get("pf_boolean_box"));
++ assertEquals("boolean", e.eval("typeof pf_boolean_box;"));
++ e.eval("o.publicFinalBooleanBox = false;");
++ assertEquals(true, (boolean)o.publicFinalBooleanBox);
++ }
++
++ @Test
++ public void accessStaticFinalFieldBooleanBoxing() throws ScriptException {
++ e.eval("var psf_boolean_box = SharedObject.publicStaticFinalBooleanBox;");
++ assertEquals(SharedObject.publicStaticFinalBooleanBox, e.get("psf_boolean_box"));
++ assertEquals("boolean", e.eval("typeof psf_boolean_box;"));
++ e.eval("SharedObject.publicStaticFinalBooleanBox = false;");
++ assertEquals(true, (boolean)SharedObject.publicStaticFinalBooleanBox);
++ }
++
++ @Test
++ public void accessVolatileField() throws ScriptException {
++ e.eval("var pv_boolean = o.volatileBoolean;");
++ assertEquals(o.volatileBoolean, e.get("pv_boolean"));
++ assertEquals("boolean", e.eval("typeof pv_boolean;"));
++ e.eval("o.volatileBoolean = false;");
++ assertEquals(false, o.volatileBoolean);
++ }
++
++ @Test
++ public void accessTransientField() throws ScriptException {
++ e.eval("var pt_boolean = o.transientBoolean;");
++ assertEquals(o.transientBoolean, e.get("pt_boolean"));
++ assertEquals("boolean", e.eval("typeof pt_boolean;"));
++ e.eval("o.transientBoolean = false;");
++ assertEquals(false, o.transientBoolean);
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/ConsStringTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,99 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import static org.testng.AssertJUnit.assertEquals;
++import java.util.HashMap;
++import java.util.Map;
++import javax.script.Bindings;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import jdk.nashorn.api.scripting.JSObject;
++import org.testng.TestNG;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++@SuppressWarnings("javadoc")
++public class ConsStringTest {
++ private static ScriptEngine e = null;
++
++ public static void main(final String[] args) {
++ TestNG.main(args);
++ }
++
++ @BeforeClass
++ public static void setUpClass() {
++ e = new ScriptEngineManager().getEngineByName("nashorn");
++ }
++
++ @AfterClass
++ public static void tearDownClass() {
++ e = null;
++ }
++
++ @Test
++ public void testConsStringFlattening() throws ScriptException {
++ final Bindings b = e.getBindings(ScriptContext.ENGINE_SCOPE);
++ final Map<Object, Object> m = new HashMap<>();
++ b.put("m", m);
++ e.eval("var x = 'f'; x += 'oo'; var y = 'b'; y += 'ar'; m.put(x, y)");
++ assertEquals("bar", m.get("foo"));
++ }
++
++ @Test
++ public void testConsStringFromMirror() throws ScriptException {
++ final Bindings b = e.getBindings(ScriptContext.ENGINE_SCOPE);
++ //final Map<Object, Object> m = new HashMap<>();
++ e.eval("var x = 'f'; x += 'oo'; var obj = {x: x};");
++ assertEquals("foo", ((JSObject)b.get("obj")).getMember("x"));
++ }
++
++ @Test
++ public void testArrayConsString() throws ScriptException {
++ final Bindings b = e.getBindings(ScriptContext.ENGINE_SCOPE);
++ final ArrayHolder h = new ArrayHolder();
++ b.put("h", h);
++ e.eval("var x = 'f'; x += 'oo'; h.array = [x];");
++ assertEquals(1, h.array.length);
++ assertEquals("foo", h.array[0]);
++ }
++
++
++ public static class ArrayHolder {
++ private Object[] array;
++
++ public void setArray(final Object[] array) {
++ this.array = array;
++ }
++
++ public Object[] getArray() {
++ return array;
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/MethodAccessTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,466 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import static org.testng.AssertJUnit.assertEquals;
++import static org.testng.AssertJUnit.assertTrue;
++import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
++import java.util.Arrays;
++import java.util.Calendar;
++import java.util.Locale;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import org.testng.TestNG;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++/**
++ * @test
++ * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.MethodAccessTest
++ * @run testng/othervm jdk.nashorn.api.javaaccess.test.MethodAccessTest
++ */
++@SuppressWarnings("javadoc")
++public class MethodAccessTest {
++
++ private static ScriptEngine e = null;
++ private static SharedObject o = null;
++
++ public static void main(final String[] args) {
++ TestNG.main(args);
++ }
++
++ @BeforeClass
++ public static void setUpClass() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ e = m.getEngineByName("nashorn");
++ o = new SharedObject();
++ o.setEngine(e);
++ e.put("o", o);
++ e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
++ e.eval("var Person = Packages.jdk.nashorn.api.javaaccess.test.Person;");
++ }
++
++ @AfterClass
++ public static void tearDownClass() {
++ e = null;
++ o = null;
++ }
++
++ @Test
++ public void accessMethodthrowsCheckedException() throws ScriptException {
++ e.eval("try {" +
++ " var a = java.lang.Long.parseLong('foo');" +
++ "} catch(e) {" +
++ " var isThrown = true;" +
++ " var isNumberException = e instanceof java.lang.NumberFormatException;" +
++ "} finally {" +
++ " var isFinalized = true;" +
++ "}");
++ assertEquals("Exception thrown", true, e.get("isThrown"));
++ assertEquals("Finally called", true, e.get("isFinalized"));
++ assertEquals("Type is NumberFormatException", true, e.get("isNumberException"));
++ }
++
++ @Test
++ public void accessMethodthrowsUnCheckedException() throws ScriptException {
++ e.eval("try {" +
++ " var a = java.lang.String.valueOf(null);" +
++ "} catch(e) {" +
++ " var isThrown = true;" +
++ " var isNumberException = e instanceof java.lang.NullPointerException;" +
++ "} finally {" +
++ " var isFinalized = true;" +
++ "}");
++ assertEquals(true, e.get("isThrown"));
++ assertEquals(true, e.get("isFinalized"));
++ assertEquals(true, e.get("isNumberException"));
++ }
++
++ @Test
++ public void accessMethodStartsThread() throws ScriptException {
++ e.eval("o.methodStartsThread();");
++ assertEquals(false, o.isFinished);
++ }
++
++ @Test
++ public void accessStaticMethod() throws ScriptException {
++ assertEquals(10, e.eval("java.lang.Math.abs(-10);"));
++ }
++
++ @Test
++ public void accessSynchronousMethod() throws ScriptException {
++ e.eval("var v = new java.util.Vector();" + "v.add(10);" + "v.add(20);" + "v.add(30);");
++ assertEquals(10, e.eval("v[0]"));
++ assertEquals(20, e.eval("v[1]"));
++ assertEquals(30, e.eval("v[2]"));
++ assertEquals(3, e.eval("v.size()"));
++ }
++
++ @Test
++ public void accessStaticSynchronousMethod() throws ScriptException {
++ e.eval("var locales = java.util.Calendar.getAvailableLocales();");
++ final Locale[] locales = (Locale[])e.get("locales");
++ assertEquals(locales.length, Calendar.getAvailableLocales().length);
++ }
++
++ @Test
++ public void accessNativeMethod() throws ScriptException {
++ assertEquals(4.0, e.eval("java.lang.StrictMath.log10(10000);"));
++ }
++
++ @Test
++ public void accessConstructorOfAbstractClass() throws ScriptException {
++ e.eval("try {" +
++ " var a = new java.util.AbstractList();" +
++ " print('fail');" +
++ "} catch(e) {" +
++ " var isThrown = true;" +
++ "}");
++ assertEquals(true, e.get("isThrown"));
++ }
++
++ @Test
++ public void accessMethodVoid() throws ScriptException {
++ o.isAccessed = false;
++ e.eval("o.voidMethod();");
++ assertTrue(o.isAccessed);
++ }
++
++ @Test
++ public void accessMethodBoolean() throws ScriptException {
++ assertEquals(true, e.eval("o.booleanMethod(false);"));
++ assertEquals(false, e.eval("o.booleanMethod(true);"));
++ assertEquals(false, e.eval("o.booleanMethod('false');"));
++ assertEquals(true, e.eval("o.booleanMethod('');"));
++ assertEquals(true, e.eval("o.booleanMethod(0);"));
++ }
++
++ @Test
++ public void accessMethodInt() throws ScriptException {
++ assertEquals(0, e.eval("o.intMethod(0);"));
++ assertEquals(-200, e.eval("o.intMethod(-100);"));
++ assertEquals(0, e.eval("o.intMethod('0');"));
++ assertEquals(-200, e.eval("o.intMethod('-100');"));
++ }
++
++ @Test
++ public void accessMethodLong() throws ScriptException {
++ assertEquals((long)0, e.eval("o.longMethod(0);"));
++ assertEquals((long)400, e.eval("o.longMethod(200);"));
++ assertEquals((long) 0, e.eval("o.longMethod('0');"));
++ assertEquals((long) 400, e.eval("o.longMethod('200');"));
++ }
++
++ @Test
++ public void accessMethodByte() throws ScriptException {
++ assertEquals((byte) 0, e.eval("o.byteMethod(0);"));
++ assertEquals((byte) 10, e.eval("o.byteMethod(5);"));
++ assertEquals((byte) 0, e.eval("o.byteMethod('0');"));
++ assertEquals((byte) 10, e.eval("o.byteMethod('5');"));
++ }
++
++ @Test
++ public void accessMethodShort() throws ScriptException {
++ assertEquals((short)0, e.eval("o.shortMethod(0);"));
++ assertEquals((short)8000, e.eval("o.shortMethod(4000);"));
++ assertEquals((short) 0, e.eval("o.shortMethod('0');"));
++ assertEquals((short) 8000, e.eval("o.shortMethod('4000');"));
++ }
++
++ @Test
++ public void accessMethodChar() throws ScriptException {
++ assertEquals('A', e.eval("o.charMethod('a');"));
++ assertEquals('Z', e.eval("o.charMethod('z');"));
++ assertEquals(o.charMethod((char)0), e.eval("o.charMethod(0);"));
++ assertEquals(o.charMethod((char)3150), e.eval("o.charMethod(3150);"));
++ }
++
++ @Test
++ public void accessMethodFloat() throws ScriptException {
++ assertEquals(0.0f, e.eval("o.floatMethod(0.0);"));
++ assertEquals(4.2f, e.eval("o.floatMethod(2.1);"));
++ assertEquals(0.0f, e.eval("o.floatMethod('0.0');"));
++ assertEquals(4.2f, e.eval("o.floatMethod('2.1');"));
++ }
++
++ @Test
++ public void accessMethodDouble() throws ScriptException {
++ assertEquals(0.0, e.eval("o.doubleMethod(0.0);"));
++ assertEquals(14.0, e.eval("o.doubleMethod(7.0);"));
++ assertEquals(0.0, e.eval("o.doubleMethod('0.0');"));
++ assertEquals(14.0, e.eval("o.doubleMethod('7.0');"));
++ }
++
++ @Test
++ public void accessMethodBooleanBoxing() throws ScriptException {
++ assertEquals(Boolean.TRUE, e.eval("o.booleanBoxingMethod(java.lang.Boolean.FALSE);"));
++ assertEquals(Boolean.FALSE, e.eval("o.booleanBoxingMethod(java.lang.Boolean.TRUE);"));
++ assertEquals(Boolean.TRUE, e.eval("o.booleanBoxingMethod('');"));
++ assertEquals(Boolean.FALSE, e.eval("o.booleanBoxingMethod('false');"));
++ }
++
++ @Test
++ public void accessMethodIntBoxing() throws ScriptException {
++ assertEquals(0, e.eval("o.intBoxingMethod(0);"));
++ assertEquals(-200, e.eval("o.intBoxingMethod(-100);"));
++ assertTrue((int)e.eval("(new java.lang.Integer(2)).compareTo(10.0)") < 0);
++ }
++
++ @Test
++ public void accessMethodLongBoxing() throws ScriptException {
++ assertEquals((long) 0, e.eval("o.longBoxingMethod(0);"));
++ assertEquals((long) 400, e.eval("o.longBoxingMethod(200);"));
++ assertTrue((int)e.eval("(new java.lang.Long(2)).compareTo(10.0)") < 0);
++ }
++
++ @Test
++ public void accessMethodByteBoxing() throws ScriptException {
++ assertEquals((byte) 0, e.eval("o.byteBoxingMethod(0);"));
++ assertEquals((byte) 10, e.eval("o.byteBoxingMethod(5);"));
++ assertTrue((int)e.eval("(new java.lang.Byte(2)).compareTo(10.0)") < 0);
++ }
++
++ @Test
++ public void accessMethodShortBoxing() throws ScriptException {
++ assertEquals((short) 0, e.eval("o.shortBoxingMethod(0);"));
++ assertEquals((short) 8000, e.eval("o.shortBoxingMethod(4000);"));
++ assertTrue((int)e.eval("(new java.lang.Short(2)).compareTo(10.0)") < 0);
++ }
++
++ @Test
++ public void accessMethodCharBoxing() throws ScriptException {
++ assertEquals('A', e.eval("o.charBoxingMethod('a');"));
++ assertEquals('Z', e.eval("o.charBoxingMethod('z');"));
++ assertTrue((int)e.eval("(new java.lang.Character(2)).compareTo(10)") < 0);
++ }
++
++ @Test
++ public void accessMethodFloatBoxing() throws ScriptException {
++ assertEquals(0.0f, e.eval("o.floatBoxingMethod(0.0);"));
++ assertEquals(4.2f, e.eval("o.floatBoxingMethod(2.1);"));
++ assertTrue((int)e.eval("(new java.lang.Float(2.0)).compareTo(10.0)") < 0);
++ }
++
++ @Test
++ public void accessMethodDoubleBoxing() throws ScriptException {
++ assertEquals(0.0, e.eval("o.doubleBoxingMethod(0.0);"));
++ assertEquals(14.0, e.eval("o.doubleBoxingMethod(7.0);"));
++ assertTrue((int)e.eval("(new java.lang.Double(2)).compareTo(10.0)") < 0);
++ }
++
++ @Test
++ public void accessMethodString() throws ScriptException {
++ assertEquals("", e.eval("o.stringMethod('');"));
++ assertEquals("abcabc", e.eval("o.stringMethod('abc');"));
++ }
++
++ @Test
++ public void accessMethodObject() throws ScriptException {
++ e.put("so", new Person(5));
++ e.eval("var rso = o.objectMethod(so);");
++ assertEquals(new Person(10), e.get("rso"));
++ }
++
++ @Test
++ public void accessMethodBooleanArray() throws ScriptException {
++ assertTrue(Arrays.equals(o.booleanArrayMethod(o.publicBooleanArray), (boolean[])e.eval("o.booleanArrayMethod(o.publicBooleanArray);")));
++ }
++
++ @Test
++ public void accessMethodIntArray() throws ScriptException {
++ assertArrayEquals(o.intArrayMethod(o.publicIntArray), (int[])e.eval("o.intArrayMethod(o.publicIntArray);"));
++ }
++
++ @Test
++ public void accessMethodLongArray() throws ScriptException {
++ assertArrayEquals(o.longArrayMethod(o.publicLongArray), (long[])e.eval("o.longArrayMethod(o.publicLongArray);"));
++ }
++
++ @Test
++ public void accessMethodByteArray() throws ScriptException {
++ assertArrayEquals(o.byteArrayMethod(o.publicByteArray), (byte[])e.eval("o.byteArrayMethod(o.publicByteArray);"));
++ }
++
++ @Test
++ public void accessMethodShortArray() throws ScriptException {
++ assertArrayEquals(o.shortArrayMethod(o.publicShortArray), (short[])e.eval("o.shortArrayMethod(o.publicShortArray);"));
++ }
++
++ @Test
++ public void accessMethodCharArray() throws ScriptException {
++ assertArrayEquals(o.charArrayMethod(o.publicCharArray), (char[])e.eval("o.charArrayMethod(o.publicCharArray);"));
++ }
++
++ @Test
++ public void accessMethodFloatArray() throws ScriptException {
++ assertArrayEquals(o.floatArrayMethod(o.publicFloatArray), (float[])e.eval("o.floatArrayMethod(o.publicFloatArray);"), 1e-10f);
++ }
++
++ @Test
++ public void accessMethodDoubleArray() throws ScriptException {
++ assertArrayEquals(o.doubleArrayMethod(o.publicDoubleArray), (double[])e.eval("o.doubleArrayMethod(o.publicDoubleArray);"), 1e-10);
++ }
++
++ @Test
++ public void accessMethodStringArray() throws ScriptException {
++ assertArrayEquals(o.stringArrayMethod(o.publicStringArray), (String[])e.eval("o.stringArrayMethod(o.publicStringArray);"));
++ }
++
++ @Test
++ public void accessMethodObjectArray() throws ScriptException {
++ assertArrayEquals(o.objectArrayMethod(o.publicObjectArray), (Person[])e.eval("o.objectArrayMethod(o.publicObjectArray);"));
++ }
++
++ @Test
++ public void accessDefaultConstructor() throws ScriptException {
++ e.eval("var dc = new Packages.jdk.nashorn.api.javaaccess.test.Person()");
++ assertEquals(new Person(), e.get("dc"));
++ }
++
++ @Test
++ public void accessCustomConstructor() throws ScriptException {
++ e.eval("var cc = new Packages.jdk.nashorn.api.javaaccess.test.Person(17)");
++ assertEquals(new Person(17), e.get("cc"));
++ }
++
++ @Test
++ public void accessMethod2PrimitiveParams() throws ScriptException {
++ assertEquals(o.twoParamMethod(50, 40.0), e.eval("o.twoParamMethod(50,40);"));
++ }
++
++ @Test
++ public void accessMethod3PrimitiveParams() throws ScriptException {
++ assertEquals(o.threeParamMethod((short)10, 20L, 'b'), e.eval("o.threeParamMethod(10,20,'b');"));
++ }
++
++ @Test
++ public void accessMethod2ObjectParams() throws ScriptException {
++ assertArrayEquals(new Person[] { new Person(200), new Person(300) }, (Person[])e.eval("o.twoObjectParamMethod(new Person(300),new Person(200));"));
++ }
++
++ @Test
++ public void accessMethod3ObjectParams() throws ScriptException {
++ assertArrayEquals(new Person[] { new Person(3), new Person(2), new Person(1) }, (Person[])e.eval("o.threeObjectParamMethod(new Person(1),new Person(2),new Person(3));"));
++ }
++
++ @Test
++ public void accessMethod8ObjectParams() throws ScriptException {
++ assertArrayEquals(new Person[] { new Person(8), new Person(7), new Person(6), new Person(5), new Person(4), new Person(3), new Person(2), new Person(1) }, (Person[])e.eval("o.eightObjectParamMethod(new Person(1),new Person(2),new Person(3)," + "new Person(4),new Person(5),new Person(6),new Person(7),new Person(8));"));
++ }
++
++ @Test
++ public void accessMethod9ObjectParams() throws ScriptException {
++ assertArrayEquals(new Person[] { new Person(9), new Person(8), new Person(7), new Person(6), new Person(5), new Person(4), new Person(3), new Person(2), new Person(1) }, (Person[])e.eval("o.nineObjectParamMethod(new Person(1),new Person(2),new Person(3)," + "new Person(4),new Person(5),new Person(6)," + "new Person(7),new Person(8),new Person(9));"));
++ }
++
++ @Test
++ public void accessMethodObjectEllipsis() throws ScriptException {
++ assertArrayEquals(new Person[] { new Person(9), new Person(8), new Person(7), new Person(6), new Person(5), new Person(4), new Person(3), new Person(2), new Person(1) }, (Person[])e.eval("o.methodObjectEllipsis(new Person(1),new Person(2),new Person(3)," + "new Person(4),new Person(5),new Person(6)," + "new Person(7),new Person(8),new Person(9));"));
++ assertArrayEquals(new Person[] {}, (Person[])e.eval("o.methodObjectEllipsis()"));
++ assertArrayEquals(new Person[] { new Person(9) }, (Person[])e.eval("o.methodObjectEllipsis(new Person(9))"));
++ }
++
++ @Test
++ public void accessMethodPrimitiveEllipsis() throws ScriptException {
++ assertArrayEquals(new Person[] { new Person(1), new Person(3), new Person(2) }, (Person[])e.eval("o.methodPrimitiveEllipsis(1,3,2);"));
++ assertArrayEquals(new Person[] {}, (Person[])e.eval("o.methodPrimitiveEllipsis();"));
++ assertArrayEquals(o.methodPrimitiveEllipsis(9, 8, 7, 6, 5, 4, 3, 2, 1), (Person[])e.eval("o.methodPrimitiveEllipsis(9,8,7,6,5,4,3,2,1);"));
++ }
++
++ @Test
++ public void accessMethodMixedEllipsis() throws ScriptException {
++ assertArrayEquals(new Object[] { new Person(1), 12, "hello", true }, (Object[])e.eval("o.methodMixedEllipsis(new Person(1),12,'hello',true);"));
++ assertArrayEquals(new Object[] {}, (Object[])e.eval("o.methodMixedEllipsis();"));
++ }
++
++ @Test
++ public void accessMethodObjectWithEllipsis() throws ScriptException {
++ assertArrayEquals(new Object[] { "hello", 12, 15, 16 }, (Object[])e.eval("o.methodObjectWithEllipsis('hello',12,15,16);"));
++ assertArrayEquals(new Object[] { "hello" }, (Object[])e.eval("o.methodObjectWithEllipsis('hello');"));
++ }
++
++ @Test
++ public void accessMethodPrimitiveWithEllipsis() throws ScriptException {
++ assertArrayEquals(new Object[] { 14, 12L, 15L, 16L }, (Object[])e.eval("o.methodPrimitiveWithEllipsis(14,12,15,16);"));
++ assertArrayEquals(new Object[] { 12 }, (Object[])e.eval("o.methodPrimitiveWithEllipsis(12);"));
++ }
++
++ @Test
++ public void accessMethodMixedWithEllipsis() throws ScriptException {
++ assertArrayEquals(new Object[] { "Hello", 10, true, -100500, 80d }, (Object[])e.eval("o.methodMixedWithEllipsis('Hello', 10, true, -100500,80.0);"));
++ assertArrayEquals(new Object[] { "Nashorn", 15 }, (Object[])e.eval("o.methodMixedWithEllipsis('Nashorn',15);"));
++ }
++
++ @Test
++ public void accessMethodOverloaded() throws ScriptException {
++ assertEquals(0, e.eval("o.overloadedMethod(0);"));
++ assertEquals(2000, e.eval("o.overloadedMethod(1000);"));
++ assertEquals(2, e.eval("o.overloadedMethod('10');"));
++ assertEquals(7, e.eval("o.overloadedMethod('Nashorn');"));
++ assertEquals(4, e.eval("o.overloadedMethod('true');"));
++ assertEquals(1, e.eval("o.overloadedMethod(true);"));
++ assertEquals(0, e.eval("o.overloadedMethod(false);"));
++ assertEquals(44, e.eval("o.overloadedMethod(new Person(22));"));
++ assertEquals(0, e.eval("o.overloadedMethod(new Person());"));
++ }
++
++ @Test
++ public void accessMethodDoubleVSintOverloaded() throws ScriptException {
++ assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(0.0);"));
++ assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(1000.0);"));
++ assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(0.01);"));
++ assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(100.02);"));
++ assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(0);"));
++ assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(1000);"));
++ }
++
++ @Test
++ public void accessJavaMethodIntFromJSFromJavaFromJS() throws ScriptException {
++ e.eval("function secondLevelMethodInt(a) {"
++ + "return o.thirdLevelMethodInt(a);"
++ + "}");
++ assertEquals(50, e.eval("o.firstLevelMethodInt(10);"));
++ }
++
++ @Test
++ public void accessJavaMethodIntegerFromJSFromJavaFromJS() throws ScriptException {
++ e.eval("function secondLevelMethodInteger(a) {"
++ + "return o.thirdLevelMethodInteger(a);"
++ + "}");
++ assertEquals(100, e.eval("o.firstLevelMethodInteger(10);"));
++ }
++
++ @Test
++ public void accessJavaMethodObjectFromJSFromJavaFromJS() throws ScriptException {
++ e.eval("function secondLevelMethodObject(p) {"
++ + "return o.thirdLevelMethodObject(p);"
++ + "}");
++ assertEquals(new Person(100), e.eval("o.firstLevelMethodObject(new Person(10));"));
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/NumberAccessTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,789 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import static org.testng.AssertJUnit.assertEquals;
++import static org.testng.AssertJUnit.assertTrue;
++import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import org.testng.TestNG;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++/**
++ * @test
++ * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.NumberAccessTest
++ * @run testng/othervm jdk.nashorn.api.javaaccess.test.NumberAccessTest
++ */
++@SuppressWarnings("javadoc")
++public class NumberAccessTest {
++
++ private static ScriptEngine e;
++ private static SharedObject o;
++
++ public static void main(final String[] args) {
++ TestNG.main(args);
++ }
++
++ @BeforeClass
++ public static void setUpClass() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ e = m.getEngineByName("nashorn");
++ o = new SharedObject();
++ e.put("o", o);
++ e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
++ }
++
++ @AfterClass
++ public static void tearDownClass() {
++ e = null;
++ o = null;
++ }
++
++ // --------------------------------long
++ // tests------------------------------------
++ @Test
++ public void accessFieldLong() throws ScriptException {
++ e.eval("var p_long = o.publicLong;");
++ assertEquals(o.publicLong, e.get("p_long"));
++ e.eval("o.publicLong = 12;");
++ assertEquals(12, o.publicLong);
++ }
++
++ @Test
++ public void accessFieldLongArray() throws ScriptException {
++ e.eval("var p_long_array = o.publicLongArray;");
++ assertEquals(o.publicLongArray[0], e.eval("o.publicLongArray[0];"));
++ assertArrayEquals(o.publicLongArray, (long[])e.get("p_long_array"));
++ e.eval("var t_long_arr = new (Java.type(\"long[]\"))(3);" +
++ "t_long_arr[0] = -189009;" +
++ "t_long_arr[1] = 456;" +
++ "t_long_arr[2] = 600000001;" +
++ "o.publicLongArray = t_long_arr;");
++ // e.eval("o.publicIntArray = [-189009,456,600000001];");
++ assertArrayEquals(new long[] { -189009, 456, 600000001 }, o.publicLongArray);
++ e.eval("o.publicLongArray[0] = 10;");
++ assertEquals(10, o.publicLongArray[0]);
++ }
++
++ @Test
++ public void accessStaticFieldLong() throws ScriptException {
++ e.eval("var ps_long = SharedObject.publicStaticLong;");
++ assertEquals(SharedObject.publicStaticLong, e.get("ps_long"));
++ e.eval("SharedObject.publicStaticLong = 120;");
++ assertEquals(120, SharedObject.publicStaticLong);
++ }
++
++ @Test
++ public void accessStaticFieldLongArray() throws ScriptException {
++ e.eval("var ps_long_array = SharedObject.publicStaticLongArray;");
++ assertEquals(SharedObject.publicStaticLongArray[0], e.eval("SharedObject.publicStaticLongArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticLongArray, (long[])e.get("ps_long_array"));
++ e.eval("var ts_long_arr = new (Java.type(\"long[]\"))(3);" +
++ "ts_long_arr[0] = -189009;" +
++ "ts_long_arr[1] = 456;" +
++ "ts_long_arr[2] = 600000001;" +
++ "SharedObject.publicStaticLongArray = ts_long_arr;");
++ // e.eval("o.publicIntArray = [-189009,456,600000001];");
++ assertArrayEquals(new long[] { -189009, 456, 600000001 }, SharedObject.publicStaticLongArray);
++ e.eval("SharedObject.publicStaticLongArray[0] = 10;");
++ assertEquals(10, SharedObject.publicStaticLongArray[0]);
++ }
++
++ @Test
++ public void accessFinalFieldLong() throws ScriptException {
++ e.eval("var pf_long = o.publicFinalLong;");
++ assertEquals(o.publicFinalLong, e.get("pf_long"));
++ e.eval("o.publicFinalLong = 120;");
++ assertEquals(13353333333333333L, o.publicFinalLong);
++ }
++
++ @Test
++ public void accessFinalFieldLongArray() throws ScriptException {
++ e.eval("var pf_long_array = o.publicFinalLongArray;");
++ assertEquals(o.publicFinalLongArray[0], e.eval("o.publicFinalLongArray[0];"));
++ assertArrayEquals(o.publicFinalLongArray, (long[])e.get("pf_long_array"));
++ e.eval("var tf_long_arr = new (Java.type(\"long[]\"))(3);" +
++ "tf_long_arr[0] = -189009;" +
++ "tf_long_arr[1] = 456;" +
++ "tf_long_arr[2] = 600000001;" +
++ "o.publicFinalLongArray = tf_long_arr;");
++ // e.eval("o.publicIntArray = [-189009,456,600000001];");
++ assertArrayEquals(new long[] { 1901733333333L, -2247355555L, 3977377777L }, o.publicFinalLongArray);
++ e.eval("o.publicFinalLongArray[0] = 10;");
++ assertEquals(10, o.publicFinalLongArray[0]);
++ }
++
++ @Test
++ public void accessStaticFinalFieldLong() throws ScriptException {
++ e.eval("var psf_long = SharedObject.publicStaticFinalLong;");
++ assertEquals(SharedObject.publicStaticFinalLong, e.get("psf_long"));
++ e.eval("SharedObject.publicStaticFinalLong = 120;");
++ assertEquals(8333333333333L, SharedObject.publicStaticFinalLong);
++ }
++
++ @Test
++ public void accessStaticFinalFieldLongArray() throws ScriptException {
++ e.eval("var psf_long_array = SharedObject.publicStaticFinalLongArray;");
++ assertEquals(SharedObject.publicStaticFinalLongArray[0], e.eval("SharedObject.publicStaticFinalLongArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticFinalLongArray, (long[])e.get("psf_long_array"));
++ e.eval("var tsf_long_arr = new (Java.type(\"long[]\"))(3);" +
++ "tsf_long_arr[0] = -189009;" +
++ "tsf_long_arr[1] = 456;" +
++ "tsf_long_arr[2] = 600000001;" +
++ "SharedObject.publicStaticFinalLongArray = tsf_long_arr;");
++ // e.eval("o.publicIntArray = [-189009,456,600000001];");
++ assertArrayEquals(new long[] { 19017383333L, -2247358L, 39773787L }, SharedObject.publicStaticFinalLongArray);
++ e.eval("SharedObject.publicStaticFinalLongArray[0] = 10;");
++ assertEquals(10, SharedObject.publicStaticFinalLongArray[0]);
++ }
++
++ // --------------------------------int
++ // tests------------------------------------
++ @Test
++ public void accessFieldInt() throws ScriptException {
++ e.eval("var p_int = o.publicInt;");
++ assertEquals(o.publicInt, e.get("p_int"));
++ e.eval("o.publicInt = 14;");
++ assertEquals(14, o.publicInt);
++ }
++
++ @Test
++ public void accessFieldIntArray() throws ScriptException {
++ e.eval("var p_int_array = o.publicIntArray;");
++ assertEquals(o.publicIntArray[0], e.eval("o.publicIntArray[0];"));
++ assertArrayEquals(o.publicIntArray, (int[])e.get("p_int_array"));
++ e.eval("var t_int_arr = new (Java.type(\"int[]\"))(3);" +
++ "t_int_arr[0] = 4;" +
++ "t_int_arr[1] = 5;" +
++ "t_int_arr[2] = 6;" +
++ "o.publicIntArray = t_int_arr;");
++ assertArrayEquals(new int[] { 4, 5, 6 }, o.publicIntArray);
++ e.eval("o.publicIntArray[0] = 100;");
++ assertEquals(100, o.publicIntArray[0]);
++ }
++
++ @Test
++ public void accessStaticFieldInt() throws ScriptException {
++ e.eval("var ps_int = SharedObject.publicStaticInt;");
++ assertEquals(SharedObject.publicStaticInt, e.get("ps_int"));
++ e.eval("SharedObject.publicStaticInt = 140;");
++ assertEquals(140, SharedObject.publicStaticInt);
++ }
++
++ @Test
++ public void accessStaticFieldIntArray() throws ScriptException {
++ e.eval("var ps_int_array = SharedObject.publicStaticIntArray;");
++ assertEquals(SharedObject.publicStaticIntArray[0], e.eval("SharedObject.publicStaticIntArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticIntArray, (int[])e.get("ps_int_array"));
++ e.eval("var ts_int_arr = new (Java.type(\"int[]\"))(3);" +
++ "ts_int_arr[0] = 4;" +
++ "ts_int_arr[1] = 5;" +
++ "ts_int_arr[2] = 6;" +
++ "SharedObject.publicStaticIntArray = ts_int_arr;");
++ assertArrayEquals(new int[] { 4, 5, 6 }, SharedObject.publicStaticIntArray);
++ e.eval("SharedObject.publicStaticIntArray[0] = 100;");
++ assertEquals(100, SharedObject.publicStaticIntArray[0]);
++ }
++
++ @Test
++ public void accessFinalFieldInt() throws ScriptException {
++ e.eval("var pf_int = o.publicFinalInt;");
++ assertEquals(o.publicFinalInt, e.get("pf_int"));
++
++ e.eval("o.publicFinalInt = 10;");
++ assertEquals(20712023, o.publicFinalInt);
++ }
++
++ @Test
++ public void accessFinalFieldIntArray() throws ScriptException {
++ e.eval("var pf_int_array = o.publicFinalIntArray;");
++ assertEquals(o.publicFinalIntArray[0], e.eval("o.publicFinalIntArray[0];"));
++ assertArrayEquals(o.publicFinalIntArray, (int[])e.get("pf_int_array"));
++ e.eval("var tf_int_arr = new (Java.type(\"int[]\"))(3);" +
++ "tf_int_arr[0] = 4;" +
++ "tf_int_arr[1] = 5;" +
++ "tf_int_arr[2] = 6;" +
++ "o.publicFinalIntArray = tf_int_arr;");
++ assertArrayEquals(new int[] { 50, 80, 130, 210, 340 }, o.publicFinalIntArray);
++ e.eval("o.publicFinalIntArray[0] = 100;");
++ assertEquals(100, o.publicFinalIntArray[0]);
++ }
++
++ @Test
++ public void accessStaticFinalFieldInt() throws ScriptException {
++ e.eval("var psf_int = SharedObject.publicStaticFinalInt;");
++ assertEquals(SharedObject.publicStaticFinalInt, e.get("psf_int"));
++ e.eval("SharedObject.publicStaticFinalInt = 140;");
++ assertEquals(207182023, SharedObject.publicStaticFinalInt);
++ }
++
++ @Test
++ public void accessStaticFinalFieldIntArray() throws ScriptException {
++ e.eval("var psf_int_array = SharedObject.publicStaticFinalIntArray;");
++ assertEquals(SharedObject.publicStaticFinalIntArray[0], e.eval("SharedObject.publicStaticFinalIntArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticFinalIntArray, (int[])e.get("psf_int_array"));
++ e.eval("var tsf_int_arr = new (Java.type(\"int[]\"))(3);" +
++ "tsf_int_arr[0] = 4;" +
++ "tsf_int_arr[1] = 5;" +
++ "tsf_int_arr[2] = 6;" +
++ "SharedObject.publicStaticFinalIntArray = tsf_int_arr;");
++ assertArrayEquals(new int[] { 1308, 210, 340 }, SharedObject.publicStaticFinalIntArray);
++ e.eval("SharedObject.publicStaticFinalIntArray[0] = 100;");
++ assertEquals(100, SharedObject.publicStaticFinalIntArray[0]);
++ }
++
++ // --------------------------------byte
++ // tests------------------------------------
++ @Test
++ public void accessFieldByte() throws ScriptException {
++ e.eval("var p_byte = o.publicByte;");
++ assertEquals((double)o.publicByte, ((Number)e.get("p_byte")).doubleValue());
++ e.eval("o.publicByte = 16;");
++ assertEquals(16, o.publicByte);
++ }
++
++ @Test
++ public void accessFieldByteArray() throws ScriptException {
++ e.eval("var p_byte_array = o.publicByteArray;");
++ assertEquals(o.publicByteArray[0], e.eval("o.publicByteArray[0];"));
++ assertArrayEquals(o.publicByteArray, (byte[])e.get("p_byte_array"));
++ e.eval("var t_byte_arr = new (Java.type(\"byte[]\"))(3);" +
++ "t_byte_arr[0] = -18;" +
++ "t_byte_arr[1] = 56;" +
++ "t_byte_arr[2] = 60;" +
++ "o.publicByteArray = t_byte_arr;");
++ assertArrayEquals(new byte[] { -18, 56, 60 }, o.publicByteArray);
++ e.eval("o.publicByteArray[0] = 100;");
++ assertEquals(100, o.publicByteArray[0]);
++ }
++
++ @Test
++ public void accessStaticFieldByte() throws ScriptException {
++ e.eval("var ps_byte = SharedObject.publicStaticByte;");
++ assertEquals((double)SharedObject.publicStaticByte, ((Number)e.get("ps_byte")).doubleValue());
++ e.eval("SharedObject.publicStaticByte = 16;");
++ assertEquals(16, SharedObject.publicStaticByte);
++ }
++
++ @Test
++ public void accessStaticFieldByteArray() throws ScriptException {
++ e.eval("var ps_byte_array = SharedObject.publicStaticByteArray;");
++ assertEquals(SharedObject.publicStaticByteArray[0], e.eval("SharedObject.publicStaticByteArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticByteArray, (byte[])e.get("ps_byte_array"));
++ e.eval("var ts_byte_arr = new (Java.type(\"byte[]\"))(3);" +
++ "ts_byte_arr[0] = -18;" +
++ "ts_byte_arr[1] = 56;" +
++ "ts_byte_arr[2] = 60;" +
++ "SharedObject.publicStaticByteArray = ts_byte_arr;");
++ assertArrayEquals(new byte[] { -18, 56, 60 }, SharedObject.publicStaticByteArray);
++ e.eval("SharedObject.publicStaticByteArray[0] = -90;");
++ assertEquals(-90, SharedObject.publicStaticByteArray[0]);
++ }
++
++ @Test
++ public void accessFinalFieldByte() throws ScriptException {
++ e.eval("var pf_byte = o.publicFinalByte;");
++ assertEquals((double)o.publicFinalByte, ((Number)e.get("pf_byte")).doubleValue());
++ e.eval("o.publicFinalByte = 16;");
++ assertEquals(-7, o.publicFinalByte);
++ }
++
++ @Test
++ public void accessFinalFieldByteArray() throws ScriptException {
++ e.eval("var pf_byte_array = o.publicFinalByteArray;");
++ assertEquals(o.publicFinalByteArray[0], e.eval("o.publicFinalByteArray[0];"));
++ assertArrayEquals(o.publicFinalByteArray, (byte[])e.get("pf_byte_array"));
++ e.eval("var tf_byte_arr = new (Java.type(\"byte[]\"))(3);" +
++ "tf_byte_arr[0] = -18;" +
++ "tf_byte_arr[1] = 56;" +
++ "tf_byte_arr[2] = 60;" +
++ "o.publicFinalByteArray = tf_byte_arr;");
++ assertArrayEquals(new byte[] { 1, 3, 6, 17, -128 }, o.publicFinalByteArray);
++ e.eval("o.publicFinalByteArray[0] = -90;");
++ assertEquals(-90, o.publicFinalByteArray[0]);
++ }
++
++ @Test
++ public void accessStaticFinalFieldByte() throws ScriptException {
++ e.eval("var psf_byte = SharedObject.publicStaticFinalByte;");
++ assertEquals((double)SharedObject.publicStaticFinalByte, ((Number)e.get("psf_byte")).doubleValue());
++ e.eval("SharedObject.publicStaticFinalByte = 16;");
++ assertEquals(-70, SharedObject.publicStaticFinalByte);
++ }
++
++ @Test
++ public void accessStaticFinalFieldByteArray() throws ScriptException {
++ e.eval("var psf_byte_array = SharedObject.publicStaticFinalByteArray;");
++ assertEquals(SharedObject.publicStaticFinalByteArray[0], e.eval("SharedObject.publicStaticFinalByteArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticFinalByteArray, (byte[])e.get("psf_byte_array"));
++ e.eval("var tsf_byte_arr = new (Java.type(\"byte[]\"))(3);" +
++ "tsf_byte_arr[0] = -18;" +
++ "tsf_byte_arr[1] = 56;" +
++ "tsf_byte_arr[2] = 60;" +
++ "SharedObject.publicStaticFinalByteArray = tsf_byte_arr;");
++ assertArrayEquals(new byte[] { 17, -128, 81 }, SharedObject.publicStaticFinalByteArray);
++ e.eval("SharedObject.publicStaticFinalByteArray[0] = -90;");
++ assertEquals(-90, SharedObject.publicStaticFinalByteArray[0]);
++ }
++
++ // --------------------------------short
++ // tests------------------------------------
++ @Test
++ public void accessFieldShort() throws ScriptException {
++ e.eval("var p_short = o.publicShort;");
++ assertEquals((double)o.publicShort, ((Number)e.get("p_short")).doubleValue());
++ e.eval("o.publicShort = 18;");
++ assertEquals(18, o.publicShort);
++ }
++
++ @Test
++ public void accessFieldShortArray() throws ScriptException {
++ e.eval("var p_short_array = o.publicShortArray;");
++ assertEquals(o.publicShortArray[0], e.eval("o.publicShortArray[0];"));
++ assertArrayEquals(o.publicShortArray, (short[])e.get("p_short_array"));
++ e.eval("var t_short_arr = new (Java.type(\"short[]\"))(3);" +
++ "t_short_arr[0] = 90;" +
++ "t_short_arr[1] = 5;" +
++ "t_short_arr[2] = -6000;" +
++ "o.publicShortArray = t_short_arr;");
++ assertArrayEquals(new short[] { 90, 5, -6000 }, o.publicShortArray);
++ e.eval("o.publicShortArray[0] = -1000;");
++ assertEquals(-1000, o.publicShortArray[0]);
++ }
++
++ @Test
++ public void accessStaticFieldShort() throws ScriptException {
++ e.eval("var ps_short = SharedObject.publicStaticShort;");
++ assertEquals((double)SharedObject.publicStaticShort, ((Number)e.get("ps_short")).doubleValue());
++ e.eval("SharedObject.publicStaticShort = 180;");
++ assertEquals(180, SharedObject.publicStaticShort);
++ }
++
++ @Test
++ public void accessStaticFieldShortArray() throws ScriptException {
++ e.eval("var ps_short_array = SharedObject.publicStaticShortArray;");
++ assertEquals(SharedObject.publicStaticShortArray[0], e.eval("SharedObject.publicStaticShortArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticShortArray, (short[])e.get("ps_short_array"));
++ e.eval("var ts_short_arr = new (Java.type(\"short[]\"))(3);" +
++ "ts_short_arr[0] = 90;" +
++ "ts_short_arr[1] = 5;" +
++ "ts_short_arr[2] = -6000;" +
++ "SharedObject.publicStaticShortArray = ts_short_arr;");
++ assertArrayEquals(new short[] { 90, 5, -6000 }, SharedObject.publicStaticShortArray);
++ e.eval("SharedObject.publicStaticShortArray[0] = -1000;");
++ assertEquals(-1000, SharedObject.publicStaticShortArray[0]);
++ }
++
++ @Test
++ public void accessFinalFieldShort() throws ScriptException {
++ e.eval("var pf_short = o.publicFinalShort;");
++ assertEquals((double)o.publicFinalShort, ((Number)e.get("pf_short")).doubleValue());
++ e.eval("o.publicFinalShort = 180;");
++ assertEquals(31220, o.publicFinalShort);
++ }
++
++ @Test
++ public void accessFinalFieldShortArray() throws ScriptException {
++ e.eval("var pf_short_array = o.publicFinalShortArray;");
++ assertEquals(o.publicFinalShortArray[0], e.eval("o.publicFinalShortArray[0];"));
++ assertArrayEquals(o.publicFinalShortArray, (short[])e.get("pf_short_array"));
++ e.eval("var tf_short_arr = new (Java.type(\"short[]\"))(3);" +
++ "tf_short_arr[0] = 90;" +
++ "tf_short_arr[1] = 5;" +
++ "tf_short_arr[2] = -6000;" +
++ "o.publicFinalShortArray = tf_short_arr;");
++ assertArrayEquals(new short[] { 12240, 9200, -17289, 1200, 12 }, o.publicFinalShortArray);
++ e.eval("o.publicFinalShortArray[0] = -1000;");
++ assertEquals(-1000, o.publicFinalShortArray[0]);
++ }
++
++ @Test
++ public void accessStaticFinalFieldShort() throws ScriptException {
++ e.eval("var psf_short = SharedObject.publicStaticFinalShort;");
++ assertEquals((double)SharedObject.publicStaticFinalShort, ((Number)e.get("psf_short")).doubleValue());
++ e.eval("SharedObject.publicStaticFinalShort = 180;");
++ assertEquals(8888, SharedObject.publicStaticFinalShort);
++ }
++
++ @Test
++ public void accessStaticFinalFieldShortArray() throws ScriptException {
++ e.eval("var psf_short_array = SharedObject.publicStaticFinalShortArray;");
++ assertEquals(SharedObject.publicStaticFinalShortArray[0], e.eval("SharedObject.publicStaticFinalShortArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticFinalShortArray, (short[])e.get("psf_short_array"));
++ e.eval("var tsf_short_arr = new (Java.type(\"short[]\"))(3);" +
++ "tsf_short_arr[0] = 90;" +
++ "tsf_short_arr[1] = 5;" +
++ "tsf_short_arr[2] = -6000;" +
++ "SharedObject.publicStaticFinalShortArray = tsf_short_arr;");
++ assertArrayEquals(new short[] { 8240, 9280, -1289, 120, 812 }, SharedObject.publicStaticFinalShortArray);
++ e.eval("SharedObject.publicStaticFinalShortArray[0] = -1000;");
++ assertEquals(-1000, SharedObject.publicStaticFinalShortArray[0]);
++ }
++
++ // --------------------------------char
++ // tests------------------------------------
++ @Test
++ public void accessFieldChar() throws ScriptException {
++ e.eval("var p_char = o.publicChar;");
++ assertEquals(o.publicChar, e.get("p_char"));
++ e.eval("o.publicChar = 'S';");
++ assertEquals('S', o.publicChar);
++ e.eval("o.publicChar = 10;");
++ assertEquals(10, o.publicChar);
++ e.eval("try {"
++ + " o.publicChar = 'Big string';" +
++ "} catch(e) {" +
++ " var isThrown = true;" +
++ "}");
++ assertEquals("Exception thrown", true, e.get("isThrown"));
++ assertEquals(10, o.publicChar);
++ }
++
++ @Test
++ public void accessFieldCharArray() throws ScriptException {
++ e.eval("var p_char_array = o.publicCharArray;");
++ assertEquals(o.publicCharArray[0], e.eval("o.publicCharArray[0];"));
++ assertArrayEquals(o.publicCharArray, (char[])e.get("p_char_array"));
++ e.eval("var t_char_arr = new (Java.type(\"char[]\"))(3);" +
++ "t_char_arr[0] = 'F';" +
++ "t_char_arr[1] = 'o';" +
++ "t_char_arr[2] = 'o';" +
++ "o.publicCharArray = t_char_arr;");
++ assertArrayEquals("Foo".toCharArray(), o.publicCharArray);
++ e.eval("o.publicCharArray[0] = 'Z';");
++ assertEquals('Z', o.publicCharArray[0]);
++ }
++
++ @Test
++ public void accessStaticFieldChar() throws ScriptException {
++ e.eval("var ps_char = SharedObject.publicStaticChar;");
++ assertEquals(SharedObject.publicStaticChar, e.get("ps_char"));
++ e.eval("SharedObject.publicStaticChar = 'Z';");
++ assertEquals('Z', SharedObject.publicStaticChar);
++ }
++
++ @Test
++ public void accessStaticFieldCharArray() throws ScriptException {
++ e.eval("var ps_char_array = SharedObject.publicStaticCharArray;");
++ assertEquals(SharedObject.publicStaticCharArray[0], e.eval("SharedObject.publicStaticCharArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticCharArray, (char[])e.get("ps_char_array"));
++ e.eval("var ts_char_arr = new (Java.type(\"char[]\"))(3);" +
++ "ts_char_arr[0] = 'G';" +
++ "ts_char_arr[1] = 'o';" +
++ "ts_char_arr[2] = 'o';" +
++ "SharedObject.publicStaticCharArray = ts_char_arr;");
++ assertArrayEquals("Goo".toCharArray(), SharedObject.publicStaticCharArray);
++ e.eval("SharedObject.publicStaticCharArray[0] = 'Z';");
++ assertEquals('Z', SharedObject.publicStaticCharArray[0]);
++ }
++
++ @Test
++ public void accessFinalFieldChar() throws ScriptException {
++ e.eval("var pf_char = o.publicFinalChar;");
++ assertEquals(o.publicFinalChar, e.get("pf_char"));
++ e.eval("o.publicFinalChar = 'S';");
++ assertEquals('E', o.publicFinalChar);
++ }
++
++ @Test
++ public void accessFinalCharArray() throws ScriptException {
++ e.eval("var pf_char_array = o.publicFinalCharArray;");
++ assertEquals(o.publicFinalCharArray[0], e.eval("o.publicFinalCharArray[0];"));
++ assertArrayEquals(o.publicFinalCharArray, (char[])e.get("pf_char_array"));
++ e.eval("var tf_char_arr = new (Java.type(\"char[]\"))(3);" +
++ "tf_char_arr[0] = 'F';" +
++ "tf_char_arr[1] = 'o';" +
++ "tf_char_arr[2] = 'o';" +
++ "o.publicFinalCharArray = tf_char_arr;");
++ assertArrayEquals("Nashorn hello".toCharArray(), o.publicFinalCharArray);
++ e.eval("o.publicFinalCharArray[0] = 'Z';");
++ assertEquals('Z', o.publicFinalCharArray[0]);
++ }
++
++ @Test
++ public void accessStaticFinalFieldChar() throws ScriptException {
++ e.eval("var psf_char = SharedObject.publicStaticFinalChar;");
++ assertEquals(SharedObject.publicStaticFinalChar, e.get("psf_char"));
++ e.eval("SharedObject.publicStaticFinalChar = 'Z';");
++ assertEquals('K', SharedObject.publicStaticFinalChar);
++ }
++
++ @Test
++ public void accessStaticFinalFieldCharArray() throws ScriptException {
++ e.eval("var psf_char_array = SharedObject.publicStaticFinalCharArray;");
++ assertEquals(SharedObject.publicStaticFinalCharArray[0], e.eval("SharedObject.publicStaticFinalCharArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticFinalCharArray, (char[])e.get("psf_char_array"));
++ e.eval("var tsf_char_arr = new (Java.type(\"char[]\"))(3);" +
++ "tsf_char_arr[0] = 'Z';" +
++ "tsf_char_arr[1] = 'o';" +
++ "tsf_char_arr[2] = 'o';" +
++ "SharedObject.publicStaticFinalCharArray = tsf_char_arr;");
++ assertArrayEquals("StaticString".toCharArray(), SharedObject.publicStaticFinalCharArray);
++ e.eval("SharedObject.publicStaticFinalCharArray[0] = 'Z';");
++ assertEquals('Z', SharedObject.publicStaticFinalCharArray[0]);
++ }
++
++ // --------------------------------float
++ // tests------------------------------------
++ @Test
++ public void accessFieldFloat() throws ScriptException {
++ e.eval("var p_float = o.publicFloat;");
++ assertEquals((double)o.publicFloat, ((Number)e.get("p_float")).doubleValue());
++ o.publicFloat = 0.0f / 0.0f;
++ assertEquals(true, e.eval("isNaN(o.publicFloat)"));
++ o.publicFloat = 1.0f / 0.0f;
++ assertEquals(true, e.eval("Number.POSITIVE_INFINITY === o.publicFloat"));
++ o.publicFloat = -1.0f / 0.0f;
++ assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === o.publicFloat"));
++ e.eval("o.publicFloat = 20;");
++ assertEquals(20, o.publicFloat, 1e-10);
++ e.eval("o.publicFloat = 0.0/0.0;");
++ assertTrue(Float.isNaN(o.publicFloat));
++ e.eval("o.publicFloat = 1.0/0.0;");
++ assertEquals(Float.floatToIntBits(Float.POSITIVE_INFINITY), Float.floatToIntBits(o.publicFloat));
++ e.eval("o.publicFloat = -1.0/0.0;");
++ assertEquals(Float.NEGATIVE_INFINITY, o.publicFloat, 1e-10);
++ }
++
++ @Test
++ public void accessFieldFloatArray() throws ScriptException {
++ e.eval("var p_float_array = o.publicFloatArray;");
++ assertEquals(o.publicFloatArray[0], e.eval("o.publicFloatArray[0];"));
++ assertArrayEquals(o.publicFloatArray, (float[])e.get("p_float_array"), 1e-10f);
++ e.eval("var t_float_arr = new (Java.type(\"float[]\"))(3);" +
++ "t_float_arr[0] = 9.0;" +
++ "t_float_arr[1] = 5.12345;" +
++ "t_float_arr[2] = -60.03;" +
++ "o.publicFloatArray = t_float_arr;");
++ assertArrayEquals(new float[] { 9.0f, 5.12345f, -60.03f }, o.publicFloatArray, 1e-10f);
++ e.eval("o.publicFloatArray[0] = -513.2;");
++ assertArrayEquals(new float[] { -513.2f, 5.12345f, -60.03f }, o.publicFloatArray, 1e-10f);
++ }
++
++ @Test
++ public void accessStaticFieldFloat() throws ScriptException {
++ e.eval("var ps_float = SharedObject.publicStaticFloat;");
++ assertEquals((double)SharedObject.publicStaticFloat, ((Number)e.get("ps_float")).doubleValue());
++ SharedObject.publicStaticFloat = 0.0f / 0.0f;
++ assertEquals(true, e.eval("isNaN(SharedObject.publicStaticFloat)"));
++ SharedObject.publicStaticFloat = 1.0f / 0.0f;
++ assertEquals(true, e.eval("Number.POSITIVE_INFINITY === SharedObject.publicStaticFloat"));
++ SharedObject.publicStaticFloat = -1.0f / 0.0f;
++ assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === SharedObject.publicStaticFloat"));
++ e.eval("SharedObject.publicStaticFloat = 20.0;");
++ assertEquals(20.0f, SharedObject.publicStaticFloat, 1e-10);
++ e.eval("SharedObject.publicStaticFloat = 0.0/0.0;");
++ assertTrue(Float.isNaN(SharedObject.publicStaticFloat));
++ e.eval("SharedObject.publicStaticFloat = 1.0/0.0;");
++ assertEquals(Float.floatToIntBits(Float.POSITIVE_INFINITY), Float.floatToIntBits(SharedObject.publicStaticFloat));
++ e.eval("SharedObject.publicStaticFloat = -1.0/0.0;");
++ assertEquals(Float.floatToIntBits(Float.NEGATIVE_INFINITY), Float.floatToIntBits(SharedObject.publicStaticFloat));
++ }
++
++ @Test
++ public void accessStaticFieldFloatArray() throws ScriptException {
++ e.eval("var ps_float_array = SharedObject.publicStaticFloatArray;");
++ assertEquals(SharedObject.publicStaticFloatArray[0], e.eval("SharedObject.publicStaticFloatArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticFloatArray, (float[])e.get("ps_float_array"), 1e-10f);
++ e.eval("var ts_float_arr = new (Java.type(\"float[]\"))(3);" +
++ "ts_float_arr[0] = 9.0;" +
++ "ts_float_arr[1] = 5.12345;" +
++ "ts_float_arr[2] = -60.03;" +
++ "SharedObject.publicStaticFloatArray = ts_float_arr;");
++ assertArrayEquals(new float[] { 9.0f, 5.12345f, -60.03f }, SharedObject.publicStaticFloatArray, 1e-10f);
++ e.eval("SharedObject.publicStaticFloatArray[0] = -513.2;");
++ assertArrayEquals(new float[] { -513.2f, 5.12345f, -60.03f }, SharedObject.publicStaticFloatArray, 1e-10f);
++ }
++
++ @Test
++ public void accessFinalFloat() throws ScriptException {
++ e.eval("var pf_float = o.publicFinalFloat;");
++ assertEquals((double)o.publicFinalFloat, ((Number)e.get("pf_float")).doubleValue());
++ e.eval("o.publicFinalFloat = 20.0;");
++ assertEquals(7.72e8f, o.publicFinalFloat, 1e-10);
++ }
++
++ @Test
++ public void accessFinalFloatArray() throws ScriptException {
++ e.eval("var pf_float_array = o.publicFinalFloatArray;");
++ assertEquals(o.publicFinalFloatArray[0], e.eval("o.publicFinalFloatArray[0];"));
++ assertArrayEquals(o.publicFinalFloatArray, (float[])e.get("pf_float_array"), 1e-10f);
++ e.eval("var tf_float_arr = new (Java.type(\"float[]\"))(3);" +
++ "tf_float_arr[0] = 9.0;" +
++ "tf_float_arr[1] = 5.12345;" +
++ "tf_float_arr[2] = -60.03;" +
++ "o.publicFinalFloatArray = tf_float_arr;");
++ assertArrayEquals(new float[] { -131.012f, 189.32f, -31.32e8f, 3.72f }, o.publicFinalFloatArray, 1e-10f);
++ e.eval("o.publicFinalFloatArray[0] = -513.2;");
++ assertEquals(-513.2f, o.publicFinalFloatArray[0], 1e-10f);
++ }
++
++ @Test
++ public void accessStaticFinalFieldFloat() throws ScriptException {
++ e.eval("var psf_float = SharedObject.publicStaticFinalFloat;");
++ assertEquals((double)SharedObject.publicStaticFinalFloat, ((Number)e.get("psf_float")).doubleValue());
++ e.eval("SharedObject.publicStaticFinalFloat = 20.0;");
++ assertEquals(0.72e8f, SharedObject.publicStaticFinalFloat, 1e-10);
++ }
++
++ @Test
++ public void accessStaticFinalFieldFloatArray() throws ScriptException {
++ e.eval("var psf_float_array = SharedObject.publicStaticFinalFloatArray;");
++ assertEquals(SharedObject.publicStaticFinalFloatArray[0], e.eval("SharedObject.publicStaticFinalFloatArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticFinalFloatArray, (float[])e.get("psf_float_array"), 1e-10f);
++ e.eval("var tsf_float_arr = new (Java.type(\"float[]\"))(3);" +
++ "tsf_float_arr[0] = 9.0;" +
++ "tsf_float_arr[1] = 5.12345;" +
++ "tsf_float_arr[2] = -60.03;" +
++ "SharedObject.publicStaticFinalFloatArray = tsf_float_arr;");
++ assertArrayEquals(new float[] { -8131.012f, 9.32f, -138.32e8f, 0.72f }, SharedObject.publicStaticFinalFloatArray, 1e-10f);
++ e.eval("SharedObject.publicStaticFinalFloatArray[0] = -513.2;");
++ assertEquals(-513.2f, SharedObject.publicStaticFinalFloatArray[0], 1e-10f);
++ }
++
++ // --------------------------------double
++ // tests------------------------------------
++ @Test
++ public void accessFieldDouble() throws ScriptException {
++ e.eval("var p_double = o.publicDouble;");
++ assertEquals(o.publicDouble, e.get("p_double"));
++ o.publicDouble = 0.0 / 0.0;
++ assertEquals(true, e.eval("isNaN(o.publicDouble)"));
++ o.publicDouble = 1.0 / 0.0;
++ assertEquals(true, e.eval("Number.POSITIVE_INFINITY === o.publicDouble"));
++ o.publicDouble = -1.0 / 0.0;
++ assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === o.publicDouble"));
++ e.eval("o.publicDouble = 30;");
++ assertEquals(Double.doubleToLongBits(30.0), Double.doubleToLongBits(o.publicDouble));
++ e.eval("o.publicDouble = 0.0/0.0;");
++ assertTrue(Double.isNaN(o.publicDouble));
++ e.eval("o.publicDouble = 1.0/0.0;");
++ assertEquals(Double.doubleToLongBits(Double.POSITIVE_INFINITY), Double.doubleToLongBits(o.publicDouble));
++ e.eval("o.publicDouble = -1.0/0.0;");
++ assertEquals(Double.doubleToLongBits(Double.NEGATIVE_INFINITY), Double.doubleToLongBits(o.publicDouble));
++ }
++
++ @Test
++ public void accessFieldDoubleArrayRead() throws ScriptException {
++ e.eval("var p_double_array = o.publicDoubleArray;");
++ assertEquals(o.publicDoubleArray[0], e.eval("o.publicDoubleArray[0];"));
++ assertArrayEquals(o.publicDoubleArray, (double[])e.get("p_double_array"), 1e-10);
++ e.eval("var t_double_arr = new (Java.type(\"double[]\"))(3);" +
++ "t_double_arr[0] = 9e10;" +
++ "t_double_arr[1] = 0.677777;" +
++ "t_double_arr[2] = -0.0000001;" +
++ "o.publicDoubleArray = t_double_arr;");
++ assertArrayEquals(new double[] { 9e10, 0.677777, -0.0000001 }, o.publicDoubleArray, 1e-10f);
++ e.eval("o.publicDoubleArray[0] = -5.2e10;");
++ assertEquals(-5.2e10, o.publicDoubleArray[0], 1e-10f);
++ }
++
++ @Test
++ public void accessStaticFieldDouble() throws ScriptException {
++ e.eval("var ps_double = SharedObject.publicStaticDouble;");
++ assertEquals(SharedObject.publicStaticDouble, e.get("ps_double"));
++ SharedObject.publicStaticDouble = 0.0 / 0.0;
++ assertEquals(true, e.eval("isNaN(SharedObject.publicStaticDouble)"));
++ SharedObject.publicStaticDouble = 1.0 / 0.0;
++ assertEquals(true, e.eval("Number.POSITIVE_INFINITY === SharedObject.publicStaticDouble"));
++ SharedObject.publicStaticDouble = -1.0 / 0.0;
++ assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === SharedObject.publicStaticDouble"));
++ e.eval("SharedObject.publicStaticDouble = 40.0;");
++ assertEquals(Double.doubleToLongBits(40.0), Double.doubleToLongBits(SharedObject.publicStaticDouble));
++ e.eval("SharedObject.publicStaticDouble = 0.0/0.0;");
++ assertTrue(Double.isNaN(SharedObject.publicStaticDouble));
++ e.eval("SharedObject.publicStaticDouble = 1.0/0.0;");
++ assertEquals(Double.doubleToLongBits(Double.POSITIVE_INFINITY), Double.doubleToLongBits(SharedObject.publicStaticDouble));
++ e.eval("SharedObject.publicStaticDouble = -1.0/0.0;");
++ assertEquals(Double.doubleToLongBits(Double.NEGATIVE_INFINITY), Double.doubleToLongBits(SharedObject.publicStaticDouble));
++ }
++
++ @Test
++ public void accessStaticFieldDoubleArrayRead() throws ScriptException {
++ e.eval("var ps_double_array = SharedObject.publicStaticDoubleArray;");
++ assertEquals(SharedObject.publicStaticDoubleArray[0], e.eval("SharedObject.publicStaticDoubleArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticDoubleArray, (double[])e.get("ps_double_array"), 1e-10);
++ e.eval("var ts_double_arr = new (Java.type(\"double[]\"))(3);" +
++ "ts_double_arr[0] = 9e10;" +
++ "ts_double_arr[1] = 0.677777;" +
++ "ts_double_arr[2] = -0.0000001;" +
++ "SharedObject.publicStaticDoubleArray = ts_double_arr;");
++ assertArrayEquals(new double[] { 9e10, 0.677777, -0.0000001 }, SharedObject.publicStaticDoubleArray, 1e-10f);
++ e.eval("SharedObject.publicStaticDoubleArray[0] = -5.2e10;");
++ assertEquals(-5.2e10, SharedObject.publicStaticDoubleArray[0], 1e-10f);
++ }
++
++ @Test
++ public void accessFinalFieldDouble() throws ScriptException {
++ e.eval("var pf_double = o.publicFinalDouble;");
++ assertEquals(o.publicFinalDouble, e.get("pf_double"));
++ e.eval("o.publicFinalDouble = 30.0;");
++ assertEquals(Double.doubleToLongBits(1.3412e20), Double.doubleToLongBits(o.publicFinalDouble));
++ }
++
++ @Test
++ public void accessFinalFieldDoubleArrayRead() throws ScriptException {
++ e.eval("var pf_double_array = o.publicFinalDoubleArray;");
++ assertEquals(o.publicFinalDoubleArray[0], e.eval("o.publicFinalDoubleArray[0];"));
++ assertArrayEquals(o.publicFinalDoubleArray, (double[])e.get("pf_double_array"), 1e-10);
++ e.eval("var tf_double_arr = new (Java.type(\"double[]\"))(3);" +
++ "tf_double_arr[0] = 9e10;" +
++ "tf_double_arr[1] = 0.677777;" +
++ "tf_double_arr[2] = -0.0000001;" +
++ "o.publicFinalDoubleArray = tf_double_arr;");
++ assertArrayEquals(new double[] { 0.725e80, 0.12e10, 8e-3, 1.00077 }, o.publicFinalDoubleArray, 1e-10f);
++ e.eval("o.publicFinalDoubleArray[0] = -5.2e10;");
++ assertEquals(-5.2e10, o.publicFinalDoubleArray[0], 1e-10f);
++ }
++
++ @Test
++ public void accessStaticFinalFieldDouble() throws ScriptException {
++ e.eval("var psf_double = SharedObject.publicStaticFinalDouble;");
++ assertEquals(SharedObject.publicStaticFinalDouble, e.get("psf_double"));
++ e.eval("SharedObject.publicStaticFinalDouble = 40.0;");
++ assertEquals(Double.doubleToLongBits(1.8e12), Double.doubleToLongBits(SharedObject.publicStaticFinalDouble));
++ }
++
++ @Test
++ public void accessStaticFinalFieldDoubleArrayRead() throws ScriptException {
++ e.eval("var psf_double_array = SharedObject.publicStaticFinalDoubleArray;");
++ assertEquals(SharedObject.publicStaticFinalDoubleArray[0], e.eval("SharedObject.publicStaticFinalDoubleArray[0];"));
++ assertArrayEquals(SharedObject.publicStaticFinalDoubleArray, (double[])e.get("psf_double_array"), 1e-10);
++ e.eval("var tsf_double_arr = new (Java.type(\"double[]\"))(3);" +
++ "tsf_double_arr[0] = 9e10;" +
++ "tsf_double_arr[1] = 0.677777;" +
++ "tsf_double_arr[2] = -0.0000001;" +
++ "SharedObject.publicStaticFinalDoubleArray = tsf_double_arr;");
++ assertArrayEquals(new double[] { 8.725e80, 0.82e10, 18e-3, 1.08077 }, SharedObject.publicStaticFinalDoubleArray, 1e-10f);
++ e.eval("SharedObject.publicStaticFinalDoubleArray[0] = -5.2e10;");
++ assertEquals(-5.2e10, SharedObject.publicStaticFinalDoubleArray[0], 1e-10f);
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/NumberBoxingTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,365 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import static org.testng.AssertJUnit.assertEquals;
++import static org.testng.AssertJUnit.assertTrue;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import org.testng.TestNG;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++/**
++ * @test
++ * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.NumberBoxingTest
++ * @run testng/othervm jdk.nashorn.api.javaaccess.test.NumberBoxingTest
++ */
++@SuppressWarnings("javadoc")
++public class NumberBoxingTest {
++
++ private static ScriptEngine e;
++ private static SharedObject o;
++
++ public static void main(final String[] args) {
++ TestNG.main(args);
++ }
++
++ @BeforeClass
++ public static void setUpClass() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ e = m.getEngineByName("nashorn");
++ o = new SharedObject();
++ e.put("o", o);
++ e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
++ }
++
++ @AfterClass
++ public static void tearDownClass() {
++ e = null;
++ o = null;
++ }
++
++ // --------------------------------long
++ // tests------------------------------------
++ @Test
++ public void accessFieldLongBoxing() throws ScriptException {
++ e.eval("var p_long = o.publicLongBox;");
++ assertEquals(o.publicLongBox, e.get("p_long"));
++ e.eval("o.publicLongBox = 12;");
++ assertEquals(Long.valueOf(12), o.publicLongBox);
++ }
++
++ @Test
++ public void accessStaticFieldLongBoxing() throws ScriptException {
++ e.eval("var ps_long = SharedObject.publicStaticLongBox;");
++ assertEquals(SharedObject.publicStaticLongBox, e.get("ps_long"));
++ e.eval("SharedObject.publicStaticLongBox = 120;");
++ assertEquals(120L, SharedObject.publicStaticLongBox.longValue());
++ }
++
++ @Test
++ public void accessFinalFieldLongBoxing() throws ScriptException {
++ e.eval("var pf_long = o.publicFinalLongBox;");
++ assertEquals(o.publicFinalLongBox, e.get("pf_long"));
++ e.eval("o.publicFinalLongBox = 120;");
++ assertEquals(Long.valueOf(9377333334L), o.publicFinalLongBox);
++ }
++
++ @Test
++ public void accessStaticFinalFieldLongBoxing() throws ScriptException {
++ e.eval("var psf_long = SharedObject.publicStaticFinalLong;");
++ assertEquals(SharedObject.publicStaticFinalLong, e.get("psf_long"));
++ e.eval("SharedObject.publicStaticFinalLong = 120;");
++ assertEquals(8333333333333L, SharedObject.publicStaticFinalLong);
++ }
++
++ // --------------------------------int
++ // tests------------------------------------
++ @Test
++ public void accessFieldIntBoxing() throws ScriptException {
++ e.eval("var p_int = o.publicIntBox;");
++ assertEquals(o.publicIntBox, e.get("p_int"));
++ e.eval("o.publicIntBox = 14;");
++ assertEquals(Integer.valueOf(14), o.publicIntBox);
++ }
++
++ @Test
++ public void accessStaticFieldIntBoxing() throws ScriptException {
++ e.eval("var ps_int = SharedObject.publicStaticInt;");
++ assertEquals(SharedObject.publicStaticInt, e.get("ps_int"));
++ e.eval("SharedObject.publicStaticInt = 140;");
++ assertEquals(140, SharedObject.publicStaticInt);
++ }
++
++ @Test
++ public void accessFinalFieldIntBoxing() throws ScriptException {
++ e.eval("var pf_int = o.publicFinalIntBox;");
++ assertEquals(o.publicFinalIntBox, e.get("pf_int"));
++ e.eval("o.publicFinalIntBox = 10;");
++ assertEquals(Integer.valueOf(207512301), o.publicFinalIntBox);
++ }
++
++ @Test
++ public void accessStaticFinalFieldIntBoxing() throws ScriptException {
++ e.eval("var psf_int = SharedObject.publicStaticFinalInt;");
++ assertEquals(SharedObject.publicStaticFinalInt, e.get("psf_int"));
++ e.eval("SharedObject.publicStaticFinalInt = 140;");
++ assertEquals(207182023, SharedObject.publicStaticFinalInt);
++ }
++
++ // --------------------------------byte
++ // tests------------------------------------
++ @Test
++ public void accessFieldByteBoxing() throws ScriptException {
++ e.eval("var p_byte = o.publicByteBox;");
++ assertEqualsDouble(o.publicByteBox, "p_byte");
++ e.eval("o.publicByteBox = 16;");
++ assertEquals(Byte.valueOf((byte)16), o.publicByteBox);
++ }
++
++ @Test
++ public void accessStaticFieldByteBoxing() throws ScriptException {
++ e.eval("var ps_byte = SharedObject.publicStaticByte;");
++ assertEqualsDouble(SharedObject.publicStaticByte, "ps_byte");
++ e.eval("SharedObject.publicStaticByte = 16;");
++ assertEquals(16, SharedObject.publicStaticByte);
++ }
++
++ @Test
++ public void accessFinalFieldByteBoxing() throws ScriptException {
++ e.eval("var pf_byte = o.publicFinalByteBox;");
++ assertEqualsDouble(o.publicFinalByteBox, "pf_byte");
++ e.eval("o.publicFinalByteBox = 16;");
++ assertEquals(Byte.valueOf((byte)19), o.publicFinalByteBox);
++ }
++
++ @Test
++ public void accessStaticFinalFieldByteBoxing() throws ScriptException {
++ e.eval("var psf_byte = SharedObject.publicStaticFinalByte;");
++ assertEqualsDouble(SharedObject.publicStaticFinalByte, "psf_byte");
++ e.eval("SharedObject.publicStaticFinalByte = 16;");
++ assertEquals(-70, SharedObject.publicStaticFinalByte);
++ }
++
++ // --------------------------------short
++ // tests------------------------------------
++ @Test
++ public void accessFieldShortBoxing() throws ScriptException {
++ e.eval("var p_short = o.publicShortBox;");
++ assertEqualsDouble(o.publicShortBox, "p_short");
++ e.eval("o.publicShortBox = 18;");
++ assertEquals(Short.valueOf((short)18), o.publicShortBox);
++ }
++
++ private static void assertEqualsDouble(final Number n, final String name) {
++ assertEquals(n.doubleValue(), ((Number)e.get(name)).doubleValue());
++ }
++
++ @Test
++ public void accessStaticFieldShortBoxing() throws ScriptException {
++ e.eval("var ps_short = SharedObject.publicStaticShort;");
++ assertEqualsDouble(SharedObject.publicStaticShort, "ps_short");
++ e.eval("SharedObject.publicStaticShort = 180;");
++ assertEquals(180, SharedObject.publicStaticShort);
++ }
++
++ @Test
++ public void accessFinalFieldShortBoxing() throws ScriptException {
++ e.eval("var pf_short = o.publicFinalShortBox;");
++ assertEqualsDouble(o.publicFinalShortBox, "pf_short");
++ e.eval("o.publicFinalShortBox = 180;");
++ assertEquals(Short.valueOf((short)-26777), o.publicFinalShortBox);
++ }
++
++ @Test
++ public void accessStaticFinalFieldShortBoxing() throws ScriptException {
++ e.eval("var psf_short = SharedObject.publicStaticFinalShort;");
++ assertEqualsDouble(SharedObject.publicStaticFinalShort, "psf_short");
++ e.eval("SharedObject.publicStaticFinalShort = 180;");
++ assertEquals(8888, SharedObject.publicStaticFinalShort);
++ }
++
++ // --------------------------------char
++ // tests------------------------------------
++ @Test
++ public void accessFieldCharBoxing() throws ScriptException {
++ e.eval("var p_char = o.publicCharBox;");
++ assertEquals(o.publicCharBox, e.get("p_char"));
++ e.eval("o.publicCharBox = 'S';");
++ assertEquals(Character.valueOf('S'), o.publicCharBox);
++ e.eval("try {" +
++ " o.publicCharBox = 'Big string';" +
++ "} catch(e) {" +
++ " var isThrown = true;" +
++ "}");
++ assertEquals("Exception thrown", true, e.get("isThrown"));
++ assertEquals(Character.valueOf('S'), o.publicCharBox);
++ }
++
++ @Test
++ public void accessStaticFieldCharBoxing() throws ScriptException {
++ e.eval("var ps_char = SharedObject.publicStaticChar;");
++ assertEquals(SharedObject.publicStaticChar, e.get("ps_char"));
++ e.eval("SharedObject.publicStaticChar = 'Z';");
++ assertEquals('Z', SharedObject.publicStaticChar);
++ }
++
++ @Test
++ public void accessFinalFieldCharBoxing() throws ScriptException {
++ e.eval("var pf_char = o.publicFinalCharBox;");
++ assertEquals(o.publicFinalCharBox, e.get("pf_char"));
++ e.eval("o.publicFinalCharBox = 'S';");
++ assertEquals(Character.valueOf('F'), o.publicFinalCharBox);
++ }
++
++ @Test
++ public void accessStaticFinalFieldCharBoxing() throws ScriptException {
++ e.eval("var psf_char = SharedObject.publicStaticFinalChar;");
++ assertEquals(SharedObject.publicStaticFinalChar, e.get("psf_char"));
++ e.eval("SharedObject.publicStaticFinalChar = 'Z';");
++ assertEquals('K', SharedObject.publicStaticFinalChar);
++ }
++
++ // --------------------------------float
++ // tests------------------------------------
++ @Test
++ public void accessFieldFloatBoxing() throws ScriptException {
++ e.eval("var p_float = o.publicFloatBox;");
++ assertEqualsDouble(o.publicFloatBox, "p_float");
++ o.publicFloatBox = 0.0f / 0.0f;
++ assertEquals(true, e.eval("isNaN(o.publicFloatBox)"));
++ o.publicFloatBox = 1.0f / 0.0f;
++ assertEquals(true, e.eval("Number.POSITIVE_INFINITY === o.publicFloatBox"));
++ o.publicFloatBox = -1.0f / 0.0f;
++ assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === o.publicFloatBox"));
++ e.eval("o.publicFloatBox = 20;");
++ assertEquals(20, o.publicFloatBox, 1e-10);
++ e.eval("o.publicFloatBox = 0.0/0.0;");
++ assertTrue(Float.isNaN(o.publicFloatBox));
++ e.eval("o.publicFloatBox = 1.0/0.0;");
++ assertEquals(Float.floatToIntBits(Float.POSITIVE_INFINITY), Float.floatToIntBits(o.publicFloatBox));
++ e.eval("o.publicFloatBox = -1.0/0.0;");
++ assertEquals(Float.NEGATIVE_INFINITY, o.publicFloatBox, 1e-10);
++ }
++
++ @Test
++ public void accessStaticFieldFloatBoxing() throws ScriptException {
++ e.eval("var ps_float = SharedObject.publicStaticFloat;");
++ assertEqualsDouble(SharedObject.publicStaticFloat, "ps_float");
++ SharedObject.publicStaticFloat = 0.0f / 0.0f;
++ assertEquals(true, e.eval("isNaN(SharedObject.publicStaticFloat)"));
++ SharedObject.publicStaticFloat = 1.0f / 0.0f;
++ assertEquals(true, e.eval("Number.POSITIVE_INFINITY === SharedObject.publicStaticFloat"));
++ SharedObject.publicStaticFloat = -1.0f / 0.0f;
++ assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === SharedObject.publicStaticFloat"));
++ e.eval("SharedObject.publicStaticFloat = 20.0;");
++ assertEquals(20.0f, SharedObject.publicStaticFloat, 1e-10);
++ e.eval("SharedObject.publicStaticFloat = 0.0/0.0;");
++ assertTrue(Float.isNaN(SharedObject.publicStaticFloat));
++ e.eval("SharedObject.publicStaticFloat = 1.0/0.0;");
++ assertEquals(Float.floatToIntBits(Float.POSITIVE_INFINITY), Float.floatToIntBits(SharedObject.publicStaticFloat));
++ e.eval("SharedObject.publicStaticFloat = -1.0/0.0;");
++ assertEquals(Float.floatToIntBits(Float.NEGATIVE_INFINITY), Float.floatToIntBits(SharedObject.publicStaticFloat));
++ }
++
++ @Test
++ public void accessFinalFloatBoxing() throws ScriptException {
++ e.eval("var pf_float = o.publicFinalFloatBox;");
++ assertEqualsDouble(o.publicFinalFloatBox, "pf_float");
++ e.eval("o.publicFinalFloatBox = 20.0;");
++ assertEquals(1.372e4f, o.publicFinalFloatBox, 1e-10);
++ }
++
++ @Test
++ public void accessStaticFinalFieldFloatBoxing() throws ScriptException {
++ e.eval("var psf_float = SharedObject.publicStaticFinalFloat;");
++ assertEqualsDouble(SharedObject.publicStaticFinalFloat, "psf_float");
++ e.eval("SharedObject.publicStaticFinalFloat = 20.0;");
++ assertEquals(0.72e8f, SharedObject.publicStaticFinalFloat, 1e-10);
++ }
++
++ // --------------------------------double
++ // tests------------------------------------
++ @Test
++ public void accessFieldDoubleBoxing() throws ScriptException {
++ e.eval("var p_double = o.publicDoubleBox;");
++ assertEquals(o.publicDoubleBox, e.get("p_double"));
++ o.publicDoubleBox = 0.0 / 0.0;
++ assertEquals(true, e.eval("isNaN(o.publicDoubleBox)"));
++ o.publicDoubleBox = 1.0 / 0.0;
++ assertEquals(true, e.eval("Number.POSITIVE_INFINITY === o.publicDoubleBox"));
++ o.publicDoubleBox = -1.0 / 0.0;
++ assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === o.publicDoubleBox"));
++ e.eval("o.publicDoubleBox = 30;");
++ assertEquals(Double.doubleToLongBits(30.0), Double.doubleToLongBits(o.publicDoubleBox));
++ e.eval("o.publicDoubleBox = 0.0/0.0;");
++ assertTrue(Double.isNaN(o.publicDoubleBox));
++ e.eval("o.publicDoubleBox = 1.0/0.0;");
++ assertEquals(Double.doubleToLongBits(Double.POSITIVE_INFINITY), Double.doubleToLongBits(o.publicDoubleBox));
++ e.eval("o.publicDoubleBox = -1.0/0.0;");
++ assertEquals(Double.doubleToLongBits(Double.NEGATIVE_INFINITY), Double.doubleToLongBits(o.publicDoubleBox));
++ }
++
++ @Test
++ public void accessStaticFieldDoubleBoxing() throws ScriptException {
++ e.eval("var ps_double = SharedObject.publicStaticDouble;");
++ assertEquals(SharedObject.publicStaticDouble, e.get("ps_double"));
++ SharedObject.publicStaticDouble = 0.0 / 0.0;
++ assertEquals(true, e.eval("isNaN(SharedObject.publicStaticDouble)"));
++ SharedObject.publicStaticDouble = 1.0 / 0.0;
++ assertEquals(true, e.eval("Number.POSITIVE_INFINITY === SharedObject.publicStaticDouble"));
++ SharedObject.publicStaticDouble = -1.0 / 0.0;
++ assertEquals(true, e.eval("Number.NEGATIVE_INFINITY === SharedObject.publicStaticDouble"));
++ e.eval("SharedObject.publicStaticDouble = 40.0;");
++ assertEquals(Double.doubleToLongBits(40.0), Double.doubleToLongBits(SharedObject.publicStaticDouble));
++ e.eval("SharedObject.publicStaticDouble = 0.0/0.0;");
++ assertTrue(Double.isNaN(SharedObject.publicStaticDouble));
++ e.eval("SharedObject.publicStaticDouble = 1.0/0.0;");
++ assertEquals(Double.doubleToLongBits(Double.POSITIVE_INFINITY), Double.doubleToLongBits(SharedObject.publicStaticDouble));
++ e.eval("SharedObject.publicStaticDouble = -1.0/0.0;");
++ assertEquals(Double.doubleToLongBits(Double.NEGATIVE_INFINITY), Double.doubleToLongBits(SharedObject.publicStaticDouble));
++ }
++
++ @Test
++ public void accessFinalFieldDoubleBoxing() throws ScriptException {
++ e.eval("var pf_double = o.publicFinalDoubleBox;");
++ assertEquals(o.publicFinalDoubleBox, e.get("pf_double"));
++ e.eval("o.publicFinalDoubleBox = 30.0;");
++ assertEquals(Double.doubleToLongBits(1.412e-12), Double.doubleToLongBits(o.publicFinalDoubleBox));
++ }
++
++ @Test
++ public void accessStaticFinalFieldDoubleBoxing() throws ScriptException {
++ e.eval("var psf_double = SharedObject.publicStaticFinalDouble;");
++ assertEquals(SharedObject.publicStaticFinalDouble, e.get("psf_double"));
++ e.eval("SharedObject.publicStaticFinalDouble = 40.0;");
++ assertEquals(Double.doubleToLongBits(1.8e12), Double.doubleToLongBits(SharedObject.publicStaticFinalDouble));
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/ObjectAccessTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,165 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import static org.testng.AssertJUnit.assertEquals;
++import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import org.testng.TestNG;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++/**
++ * @test
++ * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.ObjectAccessTest
++ * @run testng/othervm jdk.nashorn.api.javaaccess.test.ObjectAccessTest
++ */
++@SuppressWarnings("javadoc")
++public class ObjectAccessTest {
++
++ private static ScriptEngine e = null;
++ private static SharedObject o = null;
++
++ public static void main(final String[] args) {
++ TestNG.main(args);
++ }
++
++ @BeforeClass
++ public static void setUpClass() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ e = m.getEngineByName("nashorn");
++ o = new SharedObject();
++ e.put("o", o);
++ e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
++ e.eval("var Person = Packages.jdk.nashorn.api.javaaccess.test.Person;");
++ }
++
++ @AfterClass
++ public static void tearDownClass() {
++ e = null;
++ o = null;
++ }
++
++ @Test
++ public void accessFieldObject() throws ScriptException {
++ e.eval("var p_object = o.publicObject;");
++ assertEquals(o.publicObject, e.get("p_object"));
++ assertEquals("object", e.eval("typeof p_object;"));
++ e.eval("o.publicObject = new Person(14);");
++ assertEquals(new Person(14), o.publicObject);
++ }
++
++ @Test
++ public void accessFieldObjectArray() throws ScriptException {
++ e.eval("var p_object_array = o.publicObjectArray;");
++ assertEquals(o.publicObjectArray[0], e.eval("o.publicObjectArray[0]"));
++ assertArrayEquals(o.publicObjectArray, (Object[])e.get("p_object_array"));
++ e.eval("var t_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.test.Person[]\"))(3);" +
++ "t_object_arr[0] = new Person(100);" +
++ "t_object_arr[1] = new Person(120);" +
++ "t_object_arr[2] = new Person(140);" +
++ "o.publicObjectArray = t_object_arr;");
++ assertArrayEquals(new Person[] { new Person(100), new Person(120), new Person(140) }, o.publicObjectArray);
++ e.eval("o.publicObjectArray[0] = new Person(10);");
++ assertEquals(new Person(10), o.publicObjectArray[0]);
++ }
++
++ @Test
++ public void accessStaticFieldObject() throws ScriptException {
++ e.eval("var ps_object = SharedObject.publicStaticObject;");
++ assertEquals(SharedObject.publicStaticObject, e.get("ps_object"));
++ assertEquals("object", e.eval("typeof ps_object;"));
++ e.eval("SharedObject.publicStaticObject = new Person(16);");
++ assertEquals(new Person(16), SharedObject.publicStaticObject);
++ }
++
++ @Test
++ public void accessStaticFieldObjectArray() throws ScriptException {
++ e.eval("var ps_object_array = SharedObject.publicStaticObjectArray;");
++ assertEquals(SharedObject.publicStaticObjectArray[0], e.eval("SharedObject.publicStaticObjectArray[0]"));
++ assertArrayEquals(SharedObject.publicStaticObjectArray, (Object[])e.get("ps_object_array"));
++ e.eval("var ts_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.test.Person[]\"))(3);" +
++ "ts_object_arr[0] = new Person(100);" +
++ "ts_object_arr[1] = new Person(120);" +
++ "ts_object_arr[2] = new Person(140);" +
++ "SharedObject.publicStaticObjectArray = ts_object_arr;");
++ assertArrayEquals(new Person[] { new Person(100), new Person(120), new Person(140) }, SharedObject.publicStaticObjectArray);
++ e.eval("SharedObject.publicStaticObjectArray[0] = new Person(10);");
++ assertEquals(new Person(10), SharedObject.publicStaticObjectArray[0]);
++ }
++
++ @Test
++ public void accessFinalFieldObject() throws ScriptException {
++ e.eval("var pf_object = o.publicFinalObject;");
++ assertEquals(o.publicFinalObject, e.get("pf_object"));
++ assertEquals("object", e.eval("typeof pf_object;"));
++ e.eval("o.publicFinalObject = new Person(-999);");
++ assertEquals(new Person(1024), o.publicFinalObject);
++ }
++
++ @Test
++ public void accessFinalFieldObjectArray() throws ScriptException {
++ e.eval("var pf_object_array = o.publicFinalObjectArray;");
++ assertEquals(o.publicFinalObjectArray[0], e.eval("o.publicFinalObjectArray[0]"));
++ assertArrayEquals(o.publicFinalObjectArray, (Object[])e.get("pf_object_array"));
++ e.eval("var tf_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.test.Person[]\"))(3);" +
++ "tf_object_arr[0] = new Person(100);" +
++ "tf_object_arr[1] = new Person(120);" +
++ "tf_object_arr[2] = new Person(140);" +
++ "o.publicOFinalbjectArray = tf_object_arr;");
++ assertArrayEquals(new Person[] { new Person(-900), new Person(1000), new Person(180) }, o.publicFinalObjectArray);
++ e.eval("o.publicFinalObjectArray[0] = new Person(10);");
++ assertEquals(new Person(10), o.publicFinalObjectArray[0]);
++ }
++
++ @Test
++ public void accessStaticFinalFieldObject() throws ScriptException {
++ e.eval("var psf_object = SharedObject.publicStaticFinalObject;");
++ assertEquals(SharedObject.publicStaticFinalObject, e.get("psf_object"));
++ assertEquals("object", e.eval("typeof psf_object;"));
++ e.eval("SharedObject.publicStaticFinalObject = new Person(6);");
++ assertEquals(new Person(2048), SharedObject.publicStaticFinalObject);
++ }
++
++ @Test
++ public void accessStaticFinalFieldObjectArray() throws ScriptException {
++ e.eval("var psf_object_array = SharedObject.publicStaticFinalObjectArray;");
++ assertEquals(SharedObject.publicStaticFinalObjectArray[0], e.eval("SharedObject.publicStaticFinalObjectArray[0]"));
++ assertArrayEquals(SharedObject.publicStaticFinalObjectArray, (Object[])e.get("psf_object_array"));
++ e.eval("var tsf_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.test.Person[]\"))(3);" +
++ "tsf_object_arr[0] = new Person(100);" +
++ "tsf_object_arr[1] = new Person(120);" +
++ "tsf_object_arr[2] = new Person(140);" +
++ "SharedObject.publicStaticFinalObjectArray = tsf_object_arr;");
++ assertArrayEquals(new Person[] { new Person(-9), new Person(110), new Person(Integer.MAX_VALUE) }, SharedObject.publicStaticFinalObjectArray);
++ e.eval("SharedObject.publicStaticFinalObjectArray[0] = new Person(90);");
++ assertEquals(new Person(90), SharedObject.publicStaticFinalObjectArray[0]);
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/Person.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,59 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++@SuppressWarnings("javadoc")
++public class Person {
++
++ public int id = 0;
++
++ public Person() {
++ }
++
++ public Person(final int code) {
++ this.id = code;
++ }
++
++ @Override
++ public boolean equals(final Object obj) {
++ if (obj != null && obj instanceof Person) {
++ final Person o = (Person)obj;
++ return this.id == o.id;
++ }
++ return false;
++ }
++
++ @Override
++ public int hashCode() {
++ return id;
++ }
++
++ @Override
++ public String toString() {
++ return "Person(" + id + ")";
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/SharedObject.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,467 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import javax.script.Invocable;
++import javax.script.ScriptEngine;
++import javax.script.ScriptException;
++
++@SuppressWarnings("javadoc")
++public class SharedObject {
++
++ // Public fields
++ public String publicString = "PublicString";
++ public String[] publicStringArray = { "ArrayString[0]", "ArrayString[1]", "ArrayString[2]", "ArrayString[3]" };
++ public Person publicObject = new Person(256);
++ public Person[] publicObjectArray = { new Person(4), new Person(-422), new Person(14) };
++ public boolean publicBoolean = true;
++ public boolean[] publicBooleanArray = { true, false, false, true };
++ public Boolean publicBooleanBox = true;
++ public long publicLong = 933333333333333333L;
++ public long[] publicLongArray = { 99012333333333L, -124355555L, 89777777777L };
++ public Long publicLongBox = 9333333333L;
++ public int publicInt = 2076543123;
++ public int[] publicIntArray = { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 };
++ public Integer publicIntBox = 20765123;
++ public byte publicByte = -128;
++ public byte[] publicByteArray = { 1, 2, 4, 8, 16, 32, 64, 127, -128 };
++ public Byte publicByteBox = 127;
++ public short publicShort = 32000;
++ public short[] publicShortArray = { 3240, 8900, -16789, 1, 12 };
++ public Short publicShortBox = Short.MIN_VALUE;
++ public float publicFloat = 0.7f;
++ public float[] publicFloatArray = { -32.01f, 89.3f, -1.3e8f, 3.1f };
++ public Float publicFloatBox = 1.377e4f;
++ public double publicDouble = 1.34e20;
++ public double[] publicDoubleArray = { 0.75e80, 8e-43, 1.000077, 0.123e10 };
++ public Double publicDoubleBox = 1.4e-19;
++ public char publicChar = 'A';
++ public char[] publicCharArray = "Hello Nashorn".toCharArray();
++ public Character publicCharBox = 'B';
++ // Public static fields
++ public static String publicStaticString = "PublicStaticString";
++ public static String[] publicStaticStringArray = { "StaticArrayString[0]", "StaticArrayString[1]", "StaticArrayString[2]", "StaticArrayString[3]" };
++ public static Person publicStaticObject = new Person(512);
++ public static Person[] publicStaticObjectArray = { new Person(40), new Person(-22), new Person(18) };
++ public static boolean publicStaticBoolean = true;
++ public static boolean[] publicStaticBooleanArray = { false, false, false, true };
++ public static Boolean publicStaticBooleanBox = true;
++ public static long publicStaticLong = 13333333333333333L;
++ public static long[] publicStaticLongArray = { 19012333333333L, -224355555L, 39777777777L };
++ public static Long publicStaticLongBox = 9333333334L;
++ public static int publicStaticInt = 207654323;
++ public static int[] publicStaticIntArray = { 5, 8, 13, 21, 34 };
++ public static Integer publicStaticIntBox = 2075123;
++ public static byte publicStaticByte = -12;
++ public static byte[] publicStaticByteArray = { 16, 32, 64, 127, -128 };
++ public static Byte publicStaticByteBox = 17;
++ public static short publicStaticShort = 320;
++ public static short[] publicStaticShortArray = { 1240, 900, -1789, 100, 12 };
++ public static Short publicStaticShortBox = -16777;
++ public static float publicStaticFloat = 7.7e8f;
++ public static float[] publicStaticFloatArray = { -131.01f, 189.3f, -31.3e8f, 3.7f };
++ public static Float publicStaticFloatBox = 1.37e4f;
++ public static double publicStaticDouble = 1.341e20;
++ public static double[] publicStaticDoubleArray = { 0.75e80, 0.123e10, 8e-43, 1.000077 };
++ public static Double publicStaticDoubleBox = 1.41e-12;
++ public static char publicStaticChar = 'C';
++ public static char[] publicStaticCharArray = "Nashorn".toCharArray();
++ public static Character publicStaticCharBox = 'D';
++ // Public final fields
++ public final String publicFinalString = "PublicFinalString";
++ public final String[] publicFinalStringArray = { "FinalArrayString[0]", "FinalArrayString[1]", "FinalArrayString[2]", "FinalArrayString[3]" };
++ public final Person publicFinalObject = new Person(1024);
++ public final Person[] publicFinalObjectArray = { new Person(-900), new Person(1000), new Person(180) };
++ public final boolean publicFinalBoolean = true;
++ public final boolean[] publicFinalBooleanArray = { false, false, true, false };
++ public final Boolean publicFinalBooleanBox = true;
++ public final long publicFinalLong = 13353333333333333L;
++ public final long[] publicFinalLongArray = { 1901733333333L, -2247355555L, 3977377777L };
++ public final Long publicFinalLongBox = 9377333334L;
++ public final int publicFinalInt = 20712023;
++ public final int[] publicFinalIntArray = { 50, 80, 130, 210, 340 };
++ public final Integer publicFinalIntBox = 207512301;
++ public final byte publicFinalByte = -7;
++ public final byte[] publicFinalByteArray = { 1, 3, 6, 17, -128 };
++ public final Byte publicFinalByteBox = 19;
++ public final short publicFinalShort = 31220;
++ public final short[] publicFinalShortArray = { 12240, 9200, -17289, 1200, 12 };
++ public final Short publicFinalShortBox = -26777;
++ public final float publicFinalFloat = 7.72e8f;
++ public final float[] publicFinalFloatArray = { -131.012f, 189.32f, -31.32e8f, 3.72f };
++ public final Float publicFinalFloatBox = 1.372e4f;
++ public final double publicFinalDouble = 1.3412e20;
++ public final double[] publicFinalDoubleArray = { 0.725e80, 0.12e10, 8e-3, 1.00077 };
++ public final Double publicFinalDoubleBox = 1.412e-12;
++ public final char publicFinalChar = 'E';
++ public final char[] publicFinalCharArray = "Nashorn hello".toCharArray();
++ public final Character publicFinalCharBox = 'F';
++ // Public static final fields
++ public static final String publicStaticFinalString = "PublicStaticFinalString";
++ public static final String[] publicStaticFinalStringArray = { "StaticFinalArrayString[0]", "StaticFinalArrayString[1]", "StaticFinalArrayString[2]", "StaticFinalArrayString[3]" };
++ public static final Person publicStaticFinalObject = new Person(2048);
++ public static final Person[] publicStaticFinalObjectArray = { new Person(-9), new Person(110), new Person(Integer.MAX_VALUE) };
++ public static final boolean publicStaticFinalBoolean = true;
++ public static final boolean[] publicStaticFinalBooleanArray = { false, true, false, false };
++ public static final Boolean publicStaticFinalBooleanBox = true;
++ public static final long publicStaticFinalLong = 8333333333333L;
++ public static final long[] publicStaticFinalLongArray = { 19017383333L, -2247358L, 39773787L };
++ public static final Long publicStaticFinalLongBox = 9377388334L;
++ public static final int publicStaticFinalInt = 207182023;
++ public static final int[] publicStaticFinalIntArray = { 1308, 210, 340 };
++ public static final Integer publicStaticFinalIntBox = 2078301;
++ public static final byte publicStaticFinalByte = -70;
++ public static final byte[] publicStaticFinalByteArray = { 17, -128, 81 };
++ public static final Byte publicStaticFinalByteBox = 91;
++ public static final short publicStaticFinalShort = 8888;
++ public static final short[] publicStaticFinalShortArray = { 8240, 9280, -1289, 120, 812 };
++ public static final Short publicStaticFinalShortBox = -26;
++ public static final float publicStaticFinalFloat = 0.72e8f;
++ public static final float[] publicStaticFinalFloatArray = { -8131.012f, 9.32f, -138.32e8f, 0.72f };
++ public static final Float publicStaticFinalFloatBox = 1.2e4f;
++ public static final double publicStaticFinalDouble = 1.8e12;
++ public static final double[] publicStaticFinalDoubleArray = { 8.725e80, 0.82e10, 18e-3, 1.08077 };
++ public static final Double publicStaticFinalDoubleBox = 1.5612e-13;
++ public static final char publicStaticFinalChar = 'K';
++ public static final char[] publicStaticFinalCharArray = "StaticString".toCharArray();
++ public static final Character publicStaticFinalCharBox = 'L';
++
++ // Special vars
++ public volatile boolean volatileBoolean = true;
++ public transient boolean transientBoolean = true;
++
++ // For methods testing
++ public boolean isAccessed = false;
++ public volatile boolean isFinished = false;
++
++ private ScriptEngine engine;
++
++ public ScriptEngine getEngine() {
++ return engine;
++ }
++
++ public void setEngine(final ScriptEngine engine) {
++ this.engine = engine;
++ }
++
++ public void voidMethod() {
++ isAccessed = true;
++ }
++
++ public boolean booleanMethod(final boolean arg) {
++ return !arg;
++ }
++
++ public Boolean booleanBoxingMethod(final Boolean arg) {
++ return !arg.booleanValue();
++ }
++
++ public boolean[] booleanArrayMethod(final boolean arg[]) {
++ final boolean[] res = new boolean[arg.length];
++ for (int i = 0; i < arg.length; i++) {
++ res[i] = !arg[i];
++ }
++ return res;
++ }
++
++ public int intMethod(final int arg) {
++ return arg + arg;
++ }
++
++ public Integer intBoxingMethod(final Integer arg) {
++ return arg + arg;
++ }
++
++ public int[] intArrayMethod(final int arg[]) {
++ final int[] res = new int[arg.length];
++ for (int i = 0; i < arg.length; i++) {
++ res[i] = arg[i] * 2;
++ }
++ return res;
++ }
++
++ public long longMethod(final long arg) {
++ return arg + arg;
++ }
++
++ public Long longBoxingMethod(final Long arg) {
++ return arg + arg;
++ }
++
++ public long[] longArrayMethod(final long[] arg) {
++ final long[] res = new long[arg.length];
++ for (int i = 0; i < arg.length; i++) {
++ res[i] = arg[i] * 2;
++ }
++ return res;
++ }
++
++ public byte byteMethod(final byte arg) {
++ return (byte)(arg + arg);
++ }
++
++ public Byte byteBoxingMethod(final Byte arg) {
++ return (byte)(arg + arg);
++ }
++
++ public byte[] byteArrayMethod(final byte[] arg) {
++ final byte[] res = new byte[arg.length];
++ for (int i = 0; i < arg.length; i++) {
++ res[i] = (byte)(arg[i] * 2);
++ }
++ return res;
++ }
++
++ public char charMethod(final char arg) {
++ return Character.toUpperCase(arg);
++ }
++
++ public Character charBoxingMethod(final Character arg) {
++ return Character.toUpperCase(arg);
++ }
++
++ public char[] charArrayMethod(final char[] arg) {
++ final char[] res = new char[arg.length];
++ for (int i = 0; i < arg.length; i++) {
++ res[i] = Character.toUpperCase(arg[i]);
++ }
++ return res;
++ }
++
++ public short shortMethod(final short arg) {
++ return (short)(arg + arg);
++ }
++
++ public Short shortBoxingMethod(final Short arg) {
++ return (short)(arg + arg);
++ }
++
++ public short[] shortArrayMethod(final short[] arg) {
++ final short[] res = new short[arg.length];
++ for (int i = 0; i < arg.length; i++) {
++ res[i] = (short)(arg[i] * 2);
++ }
++ return res;
++ }
++
++ public float floatMethod(final float arg) {
++ return arg + arg;
++ }
++
++ public Float floatBoxingMethod(final Float arg) {
++ return arg + arg;
++ }
++
++ public float[] floatArrayMethod(final float[] arg) {
++ final float[] res = new float[arg.length];
++ for (int i = 0; i < arg.length; i++) {
++ res[i] = arg[i] * 2;
++ }
++ return res;
++ }
++
++ public double doubleMethod(final double arg) {
++ return arg + arg;
++ }
++
++ public Double doubleBoxingMethod(final Double arg) {
++ return arg + arg;
++ }
++
++ public double[] doubleArrayMethod(final double[] arg) {
++ final double[] res = new double[arg.length];
++ for (int i = 0; i < arg.length; i++) {
++ res[i] = arg[i] * 2;
++ }
++ return res;
++ }
++
++ public String stringMethod(final String str) {
++ return str + str;
++ }
++
++ public String[] stringArrayMethod(final String[] arr) {
++ final int l = arr.length;
++ final String[] res = new String[l];
++ for (int i = 0; i < l; i++) {
++ res[i] = arr[l - i - 1];
++ }
++ return res;
++ }
++
++ public Person[] objectArrayMethod(final Person[] arr) {
++ final Person[] res = new Person[arr.length];
++ for (int i = 0; i < arr.length; i++) {
++ res[i] = new Person(i + 100);
++ }
++ return res;
++ }
++
++ public Person objectMethod(final Person t) {
++ t.id *= 2;
++ return t;
++ }
++
++ public int twoParamMethod(final long l, final double d) {
++ return (int)(l + d);
++ }
++
++ public int threeParamMethod(final short s, final long l, final char c) {
++ return (int)(s + l + c);
++ }
++
++ public Person[] twoObjectParamMethod(final Person arg1, final Person arg2) {
++ return new Person[] { arg2, arg1 };
++ }
++
++ public Person[] threeObjectParamMethod(final Person arg1, final Person arg2, final Person arg3) {
++ return new Person[] { arg3, arg2, arg1 };
++ }
++
++ public Person[] eightObjectParamMethod(final Person arg1, final Person arg2, final Person arg3, final Person arg4, final Person arg5, final Person arg6, final Person arg7, final Person arg8) {
++ return new Person[] { arg8, arg7, arg6, arg5, arg4, arg3, arg2, arg1 };
++ }
++
++ public Person[] nineObjectParamMethod(final Person arg1, final Person arg2, final Person arg3, final Person arg4, final Person arg5, final Person arg6, final Person arg7, final Person arg8, final Person arg9) {
++ return new Person[] { arg9, arg8, arg7, arg6, arg5, arg4, arg3, arg2, arg1 };
++ }
++
++ public Person[] methodObjectEllipsis(final Person... args) {
++ final int l = args.length;
++ final Person[] res = new Person[l];
++ for (int i = 0; i < l; i++) {
++ res[i] = args[l - i - 1];
++ }
++ return res;
++ }
++
++ public Person[] methodPrimitiveEllipsis(final int... args) {
++ final int l = args.length;
++ final Person[] res = new Person[l];
++ for (int i = 0; i < l; i++) {
++ res[i] = new Person(args[i]);
++ }
++ return res;
++ }
++
++ public Object[] methodMixedEllipsis(final Object... args) {
++ return args;
++ }
++
++ public Object[] methodObjectWithEllipsis(final String arg, final int... args) {
++ final Object[] res = new Object[args.length + 1];
++ res[0] = arg;
++ for (int i = 0; i < args.length; i++) {
++ res[i + 1] = args[i];
++ }
++ return res;
++ }
++
++ public Object[] methodPrimitiveWithEllipsis(final int arg, final long... args) {
++ final Object[] res = new Object[args.length + 1];
++ res[0] = arg;
++ for (int i = 0; i < args.length; i++) {
++ res[i + 1] = args[i];
++ }
++ return res;
++ }
++
++ public Object[] methodMixedWithEllipsis(final String arg1, final int arg2, final Object... args) {
++ final Object[] res = new Object[args.length + 2];
++ res[0] = arg1;
++ res[1] = arg2;
++ System.arraycopy(args, 0, res, 2, args.length);
++ return res;
++ }
++
++ public void methodStartsThread() {
++ isFinished = false;
++
++ final Thread t = new Thread(new Runnable() {
++ @Override
++ public void run() {
++ try {
++ Thread.sleep(1000);
++ isFinished = true;
++ } catch (final InterruptedException e) {
++ e.printStackTrace();
++ }
++ }
++ });
++
++ t.start();
++ }
++
++ public String overloadedMethodDoubleVSint(final int arg) {
++ return "int";
++ }
++
++ public String overloadedMethodDoubleVSint(final double arg) {
++ return "double";
++ }
++
++ public int overloadedMethod(final int arg) {
++ return arg*2;
++ }
++
++ public int overloadedMethod(final String arg) {
++ return arg.length();
++ }
++
++ public int overloadedMethod(final boolean arg) {
++ return (arg) ? 1 : 0;
++ }
++
++ public int overloadedMethod(final Person arg) {
++ return arg.id*2;
++ }
++
++ public int firstLevelMethodInt(final int arg) throws ScriptException, NoSuchMethodException {
++ return (int) ((Invocable)engine).invokeFunction("secondLevelMethodInt", arg);
++ }
++
++ public int thirdLevelMethodInt(final int arg) {
++ return arg*5;
++ }
++
++ public int firstLevelMethodInteger(final Integer arg) throws ScriptException, NoSuchMethodException {
++ return (int) ((Invocable)engine).invokeFunction("secondLevelMethodInteger", arg);
++ }
++
++ public int thirdLevelMethodInteger(final Integer arg) {
++ return arg*10;
++ }
++
++ public Person firstLevelMethodObject(final Person p) throws ScriptException, NoSuchMethodException {
++ return (Person) ((Invocable)engine).invokeFunction("secondLevelMethodObject", p);
++ }
++
++ public Person thirdLevelMethodObject(final Person p) {
++ p.id *= 10;
++ return p;
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/javaaccess/test/StringAccessTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,168 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.javaaccess.test;
++
++import static org.testng.AssertJUnit.assertEquals;
++import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import org.testng.TestNG;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++/**
++ * @test
++ * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.StringAccessTest
++ * @run testng/othervm jdk.nashorn.api.javaaccess.test.StringAccessTest
++ */
++@SuppressWarnings("javadoc")
++public class StringAccessTest {
++
++ private static ScriptEngine e = null;
++ private static SharedObject o = null;
++
++ public static void main(final String[] args) {
++ TestNG.main(args);
++ }
++
++ @BeforeClass
++ public static void setUpClass() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ e = m.getEngineByName("nashorn");
++ o = new SharedObject();
++ e.put("o", o);
++ e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
++ }
++
++ @AfterClass
++ public static void tearDownClass() {
++ e = null;
++ o = null;
++ }
++
++ @Test
++ public void accessFieldString() throws ScriptException {
++ e.eval("var p_string = o.publicString;");
++ assertEquals(o.publicString, e.get("p_string"));
++ assertEquals("string", e.eval("typeof p_string;"));
++ e.eval("o.publicString = 'changedString';");
++ assertEquals("changedString", o.publicString);
++ }
++
++ @Test
++ public void accessFieldStringArray() throws ScriptException {
++ e.eval("var p_string_array = o.publicStringArray;");
++ assertEquals(o.publicStringArray[0], e.eval("o.publicStringArray[0]"));
++ assertArrayEquals(o.publicStringArray, (String[])e.get("p_string_array"));
++ e.eval("var t_string_arr = new (Java.type(\"java.lang.String[]\"))(3);" +
++ "t_string_arr[0] = 'abc';" +
++ "t_string_arr[1] = '123';" +
++ "t_string_arr[2] = 'xyzzzz';" +
++ "o.publicStringArray = t_string_arr;");
++ assertArrayEquals(new String[] { "abc", "123", "xyzzzz" }, o.publicStringArray);
++ e.eval("o.publicStringArray[0] = 'nashorn';");
++ assertEquals("nashorn", o.publicStringArray[0]);
++ }
++
++ @Test
++ public void accessStaticFieldString() throws ScriptException {
++ e.eval("var ps_string = SharedObject.publicStaticString;");
++ assertEquals(SharedObject.publicStaticString, e.get("ps_string"));
++ assertEquals("string", e.eval("typeof ps_string;"));
++ e.eval("SharedObject.publicStaticString = 'changedString';");
++ assertEquals("changedString", SharedObject.publicStaticString);
++ }
++
++ @Test
++ public void accessStaticFieldStringArray() throws ScriptException {
++ e.eval("var ps_string_array = SharedObject.publicStaticStringArray;");
++ assertEquals(SharedObject.publicStaticStringArray[0], e.eval("SharedObject.publicStaticStringArray[0]"));
++ assertArrayEquals(SharedObject.publicStaticStringArray, (String[])e.get("ps_string_array"));
++ e.eval("var ts_string_arr = new (Java.type(\"java.lang.String[]\"))(3);" +
++ "ts_string_arr[0] = 'abc';" +
++ "ts_string_arr[1] = '123';" +
++ "ts_string_arr[2] = 'xyzzzz';" +
++ "SharedObject.publicStaticStringArray = ts_string_arr;");
++ assertArrayEquals(new String[] { "abc", "123", "xyzzzz" }, SharedObject.publicStaticStringArray);
++ e.eval("SharedObject.publicStaticStringArray[0] = 'nashorn';");
++ assertEquals("nashorn", SharedObject.publicStaticStringArray[0]);
++ }
++
++ @Test
++ public void accessFinalFieldString() throws ScriptException {
++ e.eval("var pf_string = o.publicFinalString;");
++ assertEquals(o.publicFinalString, e.get("pf_string"));
++ assertEquals("string", e.eval("typeof pf_string;"));
++ e.eval("o.publicFinalString = 'changedString';");
++ assertEquals("PublicFinalString", o.publicFinalString);
++ }
++
++ @Test
++ public void accessFinalFieldStringArray() throws ScriptException {
++ e.eval("var pf_string_array = o.publicFinalStringArray;");
++ assertEquals(o.publicFinalStringArray[0], e.eval("o.publicFinalStringArray[0]"));
++ assertArrayEquals(o.publicFinalStringArray, (String[])e.get("pf_string_array"));
++ e.eval("var tf_string_arr = new (Java.type(\"java.lang.String[]\"))(3);" +
++ "tf_string_arr[0] = 'abc';" +
++ "tf_string_arr[1] = '123';" +
++ "tf_string_arr[2] = 'xyzzzz';" +
++ "o.publicFinalStringArray = tf_string_arr;");
++ assertArrayEquals(new String[] { "FinalArrayString[0]", "FinalArrayString[1]", "FinalArrayString[2]", "FinalArrayString[3]" }, o.publicFinalStringArray);
++ e.eval("o.publicFinalStringArray[0] = 'nashorn';");
++ assertEquals("nashorn", o.publicFinalStringArray[0]);
++ }
++
++ @Test
++ public void accessStaticFinalFieldString() throws ScriptException {
++ e.eval("var psf_string = SharedObject.publicStaticFinalString;");
++ assertEquals(SharedObject.publicStaticFinalString, e.get("psf_string"));
++ assertEquals("string", e.eval("typeof psf_string;"));
++ e.eval("SharedObject.publicStaticFinalString = 'changedString';");
++ assertEquals("PublicStaticFinalString", SharedObject.publicStaticFinalString);
++ }
++
++ @Test
++ public void accessStaticFinalFieldStringArray() throws ScriptException {
++ e.eval("var psf_string_array = SharedObject.publicStaticFinalStringArray;");
++ assertEquals(SharedObject.publicStaticFinalStringArray[0], e.eval("SharedObject.publicStaticFinalStringArray[0]"));
++ assertArrayEquals(SharedObject.publicStaticFinalStringArray, (String[])e.get("psf_string_array"));
++ e.eval("var tsf_string_arr = new (Java.type(\"java.lang.String[]\"))(3);" +
++ "tsf_string_arr[0] = 'abc';" +
++ "tsf_string_arr[1] = '123';" +
++ "tsf_string_arr[2] = 'xyzzzz';" +
++ "SharedObject.publicStaticFinalStringArray = tsf_string_arr;");
++ assertArrayEquals(new String[] { "StaticFinalArrayString[0]",
++ "StaticFinalArrayString[1]",
++ "StaticFinalArrayString[2]",
++ "StaticFinalArrayString[3]" },
++ SharedObject.publicStaticFinalStringArray);
++ e.eval("SharedObject.publicStaticFinalStringArray[0] = 'nashorn';");
++ assertEquals("nashorn", SharedObject.publicStaticFinalStringArray[0]);
++ }
++
++}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/InvocableTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,539 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.fail;
+-import java.util.Objects;
+-import java.util.function.Function;
+-import javax.script.Invocable;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import javax.script.SimpleScriptContext;
+-import org.testng.Assert;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests for javax.script.Invocable implementation of nashorn.
+- */
+-@SuppressWarnings("javadoc")
+-public class InvocableTest {
+-
+- private static void log(final String msg) {
+- org.testng.Reporter.log(msg, true);
+- }
+-
+- @Test
+- public void invokeMethodTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- e.eval("var Example = function() { this.hello = function() { return 'Hello World!'; };}; myExample = new Example();");
+- final Object obj = e.get("myExample");
+- final Object res = ((Invocable) e).invokeMethod(obj, "hello");
+- assertEquals(res, "Hello World!");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- /**
+- * Check that we can call invokeMethod on an object that we got by
+- * evaluating script with different Context set.
+- */
+- public void invokeMethodDifferentContextTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- // define an object with method on it
+- final Object obj = e.eval("({ hello: function() { return 'Hello World!'; } })");
+-
+- final ScriptContext ctxt = new SimpleScriptContext();
+- ctxt.setBindings(e.createBindings(), ScriptContext.ENGINE_SCOPE);
+- e.setContext(ctxt);
+-
+- // invoke 'func' on obj - but with current script context changed
+- final Object res = ((Invocable) e).invokeMethod(obj, "hello");
+- assertEquals(res, "Hello World!");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- /**
+- * Check that invokeMethod throws NPE on null method name.
+- */
+- public void invokeMethodNullNameTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- final Object obj = e.eval("({})");
+- ((Invocable) e).invokeMethod(obj, null);
+- fail("should have thrown NPE");
+- } catch (final Exception exp) {
+- if (!(exp instanceof NullPointerException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that invokeMethod throws NoSuchMethodException on missing method.
+- */
+- public void invokeMethodMissingTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- final Object obj = e.eval("({})");
+- ((Invocable) e).invokeMethod(obj, "nonExistentMethod");
+- fail("should have thrown NoSuchMethodException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof NoSuchMethodException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that calling method on non-script object 'thiz' results in
+- * IllegalArgumentException.
+- */
+- public void invokeMethodNonScriptObjectThizTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- ((Invocable) e).invokeMethod(new Object(), "toString");
+- fail("should have thrown IllegalArgumentException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof IllegalArgumentException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that calling method on null 'thiz' results in
+- * IllegalArgumentException.
+- */
+- public void invokeMethodNullThizTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- ((Invocable) e).invokeMethod(null, "toString");
+- fail("should have thrown IllegalArgumentException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof IllegalArgumentException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that calling method on mirror created by another engine results in
+- * IllegalArgumentException.
+- */
+- public void invokeMethodMixEnginesTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine engine1 = m.getEngineByName("nashorn");
+- final ScriptEngine engine2 = m.getEngineByName("nashorn");
+-
+- try {
+- final Object obj = engine1.eval("({ run: function() {} })");
+- // pass object from engine1 to engine2 as 'thiz' for invokeMethod
+- ((Invocable) engine2).invokeMethod(obj, "run");
+- fail("should have thrown IllegalArgumentException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof IllegalArgumentException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- public void getInterfaceTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Invocable inv = (Invocable) e;
+-
+- // try to get interface from global functions
+- try {
+- e.eval("function run() { print('run'); };");
+- final Runnable runnable = inv.getInterface(Runnable.class);
+- runnable.run();
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+-
+- // try interface on specific script object
+- try {
+- e.eval("var obj = { run: function() { print('run from obj'); } };");
+- final Object obj = e.get("obj");
+- final Runnable runnable = inv.getInterface(obj, Runnable.class);
+- runnable.run();
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- public interface Foo {
+-
+- public void bar();
+- }
+-
+- public interface Foo2 extends Foo {
+-
+- public void bar2();
+- }
+-
+- @Test
+- public void getInterfaceMissingTest() {
+- final ScriptEngineManager manager = new ScriptEngineManager();
+- final ScriptEngine engine = manager.getEngineByName("nashorn");
+-
+- // don't define any function.
+- try {
+- engine.eval("");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+-
+- Runnable runnable = ((Invocable) engine).getInterface(Runnable.class);
+- if (runnable != null) {
+- fail("runnable is not null!");
+- }
+-
+- // now define "run"
+- try {
+- engine.eval("function run() { print('this is run function'); }");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- runnable = ((Invocable) engine).getInterface(Runnable.class);
+- // should not return null now!
+- runnable.run();
+-
+- // define only one method of "Foo2"
+- try {
+- engine.eval("function bar() { print('bar function'); }");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+-
+- Foo2 foo2 = ((Invocable) engine).getInterface(Foo2.class);
+- if (foo2 != null) {
+- throw new RuntimeException("foo2 is not null!");
+- }
+-
+- // now define other method of "Foo2"
+- try {
+- engine.eval("function bar2() { print('bar2 function'); }");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- foo2 = ((Invocable) engine).getInterface(Foo2.class);
+- foo2.bar();
+- foo2.bar2();
+- }
+-
+- @Test
+- /**
+- * Try passing non-interface Class object for interface implementation.
+- */
+- public void getNonInterfaceGetInterfaceTest() {
+- final ScriptEngineManager manager = new ScriptEngineManager();
+- final ScriptEngine engine = manager.getEngineByName("nashorn");
+- try {
+- log(Objects.toString(((Invocable) engine).getInterface(Object.class)));
+- fail("Should have thrown IllegalArgumentException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof IllegalArgumentException)) {
+- fail("IllegalArgumentException expected, got " + exp);
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that we can get interface out of a script object even after
+- * switching to use different ScriptContext.
+- */
+- public void getInterfaceDifferentContext() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- final Object obj = e.eval("({ run: function() { } })");
+-
+- // change script context
+- final ScriptContext ctxt = new SimpleScriptContext();
+- ctxt.setBindings(e.createBindings(), ScriptContext.ENGINE_SCOPE);
+- e.setContext(ctxt);
+-
+- final Runnable r = ((Invocable) e).getInterface(obj, Runnable.class);
+- r.run();
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- /**
+- * Check that getInterface on non-script object 'thiz' results in
+- * IllegalArgumentException.
+- */
+- public void getInterfaceNonScriptObjectThizTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- ((Invocable) e).getInterface(new Object(), Runnable.class);
+- fail("should have thrown IllegalArgumentException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof IllegalArgumentException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that getInterface on null 'thiz' results in
+- * IllegalArgumentException.
+- */
+- public void getInterfaceNullThizTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- ((Invocable) e).getInterface(null, Runnable.class);
+- fail("should have thrown IllegalArgumentException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof IllegalArgumentException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that calling getInterface on mirror created by another engine
+- * results in IllegalArgumentException.
+- */
+- public void getInterfaceMixEnginesTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine engine1 = m.getEngineByName("nashorn");
+- final ScriptEngine engine2 = m.getEngineByName("nashorn");
+-
+- try {
+- final Object obj = engine1.eval("({ run: function() {} })");
+- // pass object from engine1 to engine2 as 'thiz' for getInterface
+- ((Invocable) engine2).getInterface(obj, Runnable.class);
+- fail("should have thrown IllegalArgumentException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof IllegalArgumentException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * check that null function name results in NPE.
+- */
+- public void invokeFunctionNullNameTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- ((Invocable)e).invokeFunction(null);
+- fail("should have thrown NPE");
+- } catch (final Exception exp) {
+- if (!(exp instanceof NullPointerException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that attempt to call missing function results in
+- * NoSuchMethodException.
+- */
+- public void invokeFunctionMissingTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- ((Invocable)e).invokeFunction("NonExistentFunc");
+- fail("should have thrown NoSuchMethodException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof NoSuchMethodException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- /**
+- * Check that invokeFunction calls functions only from current context's
+- * Bindings.
+- */
+- public void invokeFunctionDifferentContextTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- // define an object with method on it
+- e.eval("function hello() { return 'Hello World!'; }");
+- final ScriptContext ctxt = new SimpleScriptContext();
+- ctxt.setBindings(e.createBindings(), ScriptContext.ENGINE_SCOPE);
+- // change engine's current context
+- e.setContext(ctxt);
+-
+- ((Invocable) e).invokeFunction("hello"); // no 'hello' in new context!
+- fail("should have thrown NoSuchMethodException");
+- } catch (final Exception exp) {
+- if (!(exp instanceof NoSuchMethodException)) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- public void invokeFunctionExceptionTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("function func() { throw new TypeError(); }");
+- } catch (final Throwable t) {
+- t.printStackTrace();
+- fail(t.getMessage());
+- }
+-
+- try {
+- ((Invocable) e).invokeFunction("func");
+- fail("should have thrown exception");
+- } catch (final ScriptException se) {
+- // ECMA TypeError property wrapped as a ScriptException
+- log("got " + se + " as expected");
+- } catch (final Throwable t) {
+- t.printStackTrace();
+- fail(t.getMessage());
+- }
+- }
+-
+- @Test
+- public void invokeMethodExceptionTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("var sobj = {}; sobj.foo = function func() { throw new TypeError(); }");
+- } catch (final Throwable t) {
+- t.printStackTrace();
+- fail(t.getMessage());
+- }
+-
+- try {
+- final Object sobj = e.get("sobj");
+- ((Invocable) e).invokeMethod(sobj, "foo");
+- fail("should have thrown exception");
+- } catch (final ScriptException se) {
+- // ECMA TypeError property wrapped as a ScriptException
+- log("got " + se + " as expected");
+- } catch (final Throwable t) {
+- t.printStackTrace();
+- fail(t.getMessage());
+- }
+- }
+-
+- @Test
+- /**
+- * Tests whether invocation of a JavaScript method through a variable arity
+- * Java method will pass the vararg array. Both non-vararg and vararg
+- * JavaScript methods are tested.
+- *
+- * @throws ScriptException
+- */
+- public void variableArityInterfaceTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.eval(
+- "function test1(i, strings) {"
+- + " return 'i == ' + i + ', strings instanceof java.lang.String[] == ' + (strings instanceof Java.type('java.lang.String[]')) + ', strings == ' + java.util.Arrays.toString(strings)"
+- + "}"
+- + "function test2() {"
+- + " return 'arguments[0] == ' + arguments[0] + ', arguments[1] instanceof java.lang.String[] == ' + (arguments[1] instanceof Java.type('java.lang.String[]')) + ', arguments[1] == ' + java.util.Arrays.toString(arguments[1])"
+- + "}");
+- final VariableArityTestInterface itf = ((Invocable) e).getInterface(VariableArityTestInterface.class);
+- Assert.assertEquals(itf.test1(42, "a", "b"), "i == 42, strings instanceof java.lang.String[] == true, strings == [a, b]");
+- Assert.assertEquals(itf.test2(44, "c", "d", "e"), "arguments[0] == 44, arguments[1] instanceof java.lang.String[] == true, arguments[1] == [c, d, e]");
+- }
+-
+- @Test
+- public void defaultMethodTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Invocable inv = (Invocable) e;
+-
+- final Object obj = e.eval("({ apply: function(arg) { return arg.toUpperCase(); }})");
+- @SuppressWarnings("unchecked")
+- final Function<String, String> func = inv.getInterface(obj, Function.class);
+- assertEquals(func.apply("hello"), "HELLO");
+- }
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/JSONCompatibleTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,117 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.api.scripting;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertTrue;
++
++import java.util.Arrays;
++import java.util.List;
++import java.util.Map;
++import javax.script.ScriptEngine;
++import javax.script.ScriptException;
++import org.testng.Assert;
++import org.testng.annotations.Test;
++
++public class JSONCompatibleTest {
++
++ /**
++ * Wrap a top-level array as a list.
++ */
++ @Test
++ public void testWrapArray() throws ScriptException {
++ final ScriptEngine engine = new NashornScriptEngineFactory().getScriptEngine();
++ final Object val = engine.eval("Java.asJSONCompatible([1, 2, 3])");
++ assertEquals(asList(val), Arrays.asList(1, 2, 3));
++ }
++
++ /**
++ * Wrap an embedded array as a list.
++ */
++ @Test
++ public void testWrapObjectWithArray() throws ScriptException {
++ final ScriptEngine engine = new NashornScriptEngineFactory().getScriptEngine();
++ final Object val = engine.eval("Java.asJSONCompatible({x: [1, 2, 3]})");
++ assertEquals(asList(asMap(val).get("x")), Arrays.asList(1, 2, 3));
++ }
++
++ /**
++ * Check it all works transitively several more levels down.
++ */
++ @Test
++ public void testDeepWrapping() throws ScriptException {
++ final ScriptEngine engine = new NashornScriptEngineFactory().getScriptEngine();
++ final Object val = engine.eval("Java.asJSONCompatible({x: [1, {y: [2, {z: [3]}]}, [4, 5]]})");
++ final Map<String, Object> root = asMap(val);
++ final List<Object> x = asList(root.get("x"));
++ assertEquals(x.get(0), 1);
++ final Map<String, Object> x1 = asMap(x.get(1));
++ final List<Object> y = asList(x1.get("y"));
++ assertEquals(y.get(0), 2);
++ final Map<String, Object> y1 = asMap(y.get(1));
++ assertEquals(asList(y1.get("z")), Arrays.asList(3));
++ assertEquals(asList(x.get(2)), Arrays.asList(4, 5));
++ }
++
++ /**
++ * Ensure that the old behaviour (every object is a Map) is unchanged.
++ */
++ @Test
++ public void testNonWrapping() throws ScriptException {
++ final ScriptEngine engine = new NashornScriptEngineFactory().getScriptEngine();
++ final Object val = engine.eval("({x: [1, {y: [2, {z: [3]}]}, [4, 5]]})");
++ final Map<String, Object> root = asMap(val);
++ final Map<String, Object> x = asMap(root.get("x"));
++ assertEquals(x.get("0"), 1);
++ final Map<String, Object> x1 = asMap(x.get("1"));
++ final Map<String, Object> y = asMap(x1.get("y"));
++ assertEquals(y.get("0"), 2);
++ final Map<String, Object> y1 = asMap(y.get("1"));
++ final Map<String, Object> z = asMap(y1.get("z"));
++ assertEquals(z.get("0"), 3);
++ final Map<String, Object> x2 = asMap(x.get("2"));
++ assertEquals(x2.get("0"), 4);
++ assertEquals(x2.get("1"), 5);
++ }
++
++ @SuppressWarnings("unchecked")
++ private static List<Object> asList(final Object obj) {
++ assertJSObject(obj);
++ Assert.assertTrue(obj instanceof List);
++ return (List)obj;
++ }
++
++ @SuppressWarnings("unchecked")
++ private static Map<String, Object> asMap(final Object obj) {
++ assertJSObject(obj);
++ Assert.assertTrue(obj instanceof Map);
++ return (Map)obj;
++ }
++
++ private static void assertJSObject(final Object obj) {
++ assertTrue(obj instanceof JSObject);
++ }
++}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/MultipleEngineTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,52 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Test that we can create multiple, independent script engines and use those
+- * independently.
+- *
+- * @test
+- * @run testng jdk.nashorn.api.scripting.MultipleEngineTest
+- */
+-@SuppressWarnings("javadoc")
+-public class MultipleEngineTest {
+- @Test
+- public void createAndUseManyEngine() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+-
+- final ScriptEngine e1 = m.getEngineByName("nashorn");
+- e1.eval("var x = 33; print(x);");
+-
+- final ScriptEngine e2 = m.getEngineByName("nashorn");
+- e2.eval("try { print(x) } catch(e) { print(e); }");
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/PluggableJSObjectTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,259 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertFalse;
+-import static org.testng.Assert.fail;
+-
+-import java.nio.IntBuffer;
+-import java.util.Collection;
+-import java.util.HashMap;
+-import java.util.LinkedHashMap;
+-import java.util.Set;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests for pluggable external impls. of jdk.nashorn.api.scripting.JSObject.
+- *
+- * JDK-8024615: Refactor ScriptObjectMirror and JSObject to support external
+- * JSObject implementations.
+- */
+-@SuppressWarnings("javadoc")
+-public class PluggableJSObjectTest {
+- public static class MapWrapperObject extends AbstractJSObject {
+- private final HashMap<String, Object> map = new LinkedHashMap<>();
+-
+- public HashMap<String, Object> getMap() {
+- return map;
+- }
+-
+- @Override
+- public Object getMember(final String name) {
+- return map.get(name);
+- }
+-
+- @Override
+- public void setMember(final String name, final Object value) {
+- map.put(name, value);
+- }
+-
+- @Override
+- public boolean hasMember(final String name) {
+- return map.containsKey(name);
+- }
+-
+- @Override
+- public void removeMember(final String name) {
+- map.remove(name);
+- }
+-
+- @Override
+- public Set<String> keySet() {
+- return map.keySet();
+- }
+-
+- @Override
+- public Collection<Object> values() {
+- return map.values();
+- }
+- }
+-
+- @Test
+- // Named property access on a JSObject
+- public void namedAccessTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- final MapWrapperObject obj = new MapWrapperObject();
+- e.put("obj", obj);
+- obj.getMap().put("foo", "bar");
+-
+- // property-like access on MapWrapperObject objects
+- assertEquals(e.eval("obj.foo"), "bar");
+- e.eval("obj.foo = 'hello'");
+- assertEquals(e.eval("'foo' in obj"), Boolean.TRUE);
+- assertEquals(e.eval("obj.foo"), "hello");
+- assertEquals(obj.getMap().get("foo"), "hello");
+- e.eval("delete obj.foo");
+- assertFalse(obj.getMap().containsKey("foo"));
+- assertEquals(e.eval("'foo' in obj"), Boolean.FALSE);
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- public static class BufferObject extends AbstractJSObject {
+- private final IntBuffer buf;
+-
+- public BufferObject(final int size) {
+- buf = IntBuffer.allocate(size);
+- }
+-
+- public IntBuffer getBuffer() {
+- return buf;
+- }
+-
+- @Override
+- public Object getMember(final String name) {
+- return name.equals("length")? buf.capacity() : null;
+- }
+-
+- @Override
+- public boolean hasSlot(final int i) {
+- return i > -1 && i < buf.capacity();
+- }
+-
+- @Override
+- public Object getSlot(final int i) {
+- return buf.get(i);
+- }
+-
+- @Override
+- public void setSlot(final int i, final Object value) {
+- buf.put(i, ((Number)value).intValue());
+- }
+-
+- @Override
+- public boolean isArray() {
+- return true;
+- }
+- }
+-
+- @Test
+- // array-like indexed access for a JSObject
+- public void indexedAccessTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- final BufferObject buf = new BufferObject(2);
+- e.put("buf", buf);
+-
+- // array-like access on BufferObject objects
+- assertEquals(e.eval("buf.length"), buf.getBuffer().capacity());
+- e.eval("buf[0] = 23");
+- assertEquals(buf.getBuffer().get(0), 23);
+- assertEquals(e.eval("buf[0]"), 23);
+- assertEquals(e.eval("buf[1]"), 0);
+- buf.getBuffer().put(1, 42);
+- assertEquals(e.eval("buf[1]"), 42);
+- assertEquals(e.eval("Array.isArray(buf)"), Boolean.TRUE);
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- public static class Adder extends AbstractJSObject {
+- @Override
+- public Object call(final Object thiz, final Object... args) {
+- double res = 0.0;
+- for (final Object arg : args) {
+- res += ((Number)arg).doubleValue();
+- }
+- return res;
+- }
+-
+- @Override
+- public boolean isFunction() {
+- return true;
+- }
+- }
+-
+- @Test
+- // a callable JSObject
+- public void callableJSObjectTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.put("sum", new Adder());
+- // check callability of Adder objects
+- assertEquals(e.eval("typeof sum"), "function");
+- assertEquals(((Number)e.eval("sum(1, 2, 3, 4, 5)")).intValue(), 15);
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- public static class Factory extends AbstractJSObject {
+- @SuppressWarnings("unused")
+- @Override
+- public Object newObject(final Object... args) {
+- return new HashMap<Object, Object>();
+- }
+-
+- @Override
+- public boolean isFunction() {
+- return true;
+- }
+- }
+-
+- @Test
+- // a factory JSObject
+- public void factoryJSObjectTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.put("Factory", new Factory());
+-
+- // check new on Factory
+- assertEquals(e.eval("typeof Factory"), "function");
+- assertEquals(e.eval("typeof new Factory()"), "object");
+- assertEquals(e.eval("(new Factory()) instanceof java.util.Map"), Boolean.TRUE);
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- // iteration tests
+- public void iteratingJSObjectTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- final MapWrapperObject obj = new MapWrapperObject();
+- obj.setMember("foo", "hello");
+- obj.setMember("bar", "world");
+- e.put("obj", obj);
+-
+- // check for..in
+- Object val = e.eval("var str = ''; for (i in obj) str += i; str");
+- assertEquals(val.toString(), "foobar");
+-
+- // check for..each..in
+- val = e.eval("var str = ''; for each (i in obj) str += i; str");
+- assertEquals(val.toString(), "helloworld");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/ScopeTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,709 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertNotNull;
+-import static org.testng.Assert.assertTrue;
+-import static org.testng.Assert.fail;
+-import javax.script.Bindings;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import javax.script.SimpleBindings;
+-import javax.script.SimpleScriptContext;
+-import org.testng.Assert;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests for jsr223 Bindings "scope" (engine, global scopes)
+- */
+-@SuppressWarnings("javadoc")
+-public class ScopeTest {
+-
+- @Test
+- public void createBindingsTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- b.put("foo", 42.0);
+- Object res = null;
+- try {
+- res = e.eval("foo == 42.0", b);
+- } catch (final ScriptException | NullPointerException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+-
+- assertEquals(res, Boolean.TRUE);
+- }
+-
+- @Test
+- public void engineScopeTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings engineScope = e.getBindings(ScriptContext.ENGINE_SCOPE);
+-
+- // check few ECMA standard built-in global properties
+- assertNotNull(engineScope.get("Object"));
+- assertNotNull(engineScope.get("TypeError"));
+- assertNotNull(engineScope.get("eval"));
+-
+- // can access via ScriptEngine.get as well
+- assertNotNull(e.get("Object"));
+- assertNotNull(e.get("TypeError"));
+- assertNotNull(e.get("eval"));
+-
+- // Access by either way should return same object
+- assertEquals(engineScope.get("Array"), e.get("Array"));
+- assertEquals(engineScope.get("EvalError"), e.get("EvalError"));
+- assertEquals(engineScope.get("undefined"), e.get("undefined"));
+-
+- // try exposing a new variable from scope
+- engineScope.put("myVar", "foo");
+- try {
+- assertEquals(e.eval("myVar"), "foo");
+- } catch (final ScriptException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+-
+- // update "myVar" in script an check the value from scope
+- try {
+- e.eval("myVar = 'nashorn';");
+- } catch (final ScriptException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+-
+- // now check modified value from scope and engine
+- assertEquals(engineScope.get("myVar"), "nashorn");
+- assertEquals(e.get("myVar"), "nashorn");
+- }
+-
+- @Test
+- public void multiGlobalTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- try {
+- final Object obj1 = e.eval("Object");
+- final Object obj2 = e.eval("Object", newCtxt);
+- Assert.assertNotEquals(obj1, obj2);
+- Assert.assertNotNull(obj1);
+- Assert.assertNotNull(obj2);
+- Assert.assertEquals(obj1.toString(), obj2.toString());
+-
+- e.eval("x = 'hello'");
+- e.eval("x = 'world'", newCtxt);
+- Object x1 = e.getContext().getAttribute("x");
+- Object x2 = newCtxt.getAttribute("x");
+- Assert.assertNotEquals(x1, x2);
+- Assert.assertEquals(x1, "hello");
+- Assert.assertEquals(x2, "world");
+-
+- x1 = e.eval("x");
+- x2 = e.eval("x", newCtxt);
+- Assert.assertNotEquals(x1, x2);
+- Assert.assertEquals(x1, "hello");
+- Assert.assertEquals(x2, "world");
+-
+- final ScriptContext origCtxt = e.getContext();
+- e.setContext(newCtxt);
+- e.eval("y = new Object()");
+- e.eval("y = new Object()", origCtxt);
+-
+- final Object y1 = origCtxt.getAttribute("y");
+- final Object y2 = newCtxt.getAttribute("y");
+- Assert.assertNotEquals(y1, y2);
+- final Object yeval1 = e.eval("y");
+- final Object yeval2 = e.eval("y", origCtxt);
+- Assert.assertNotEquals(yeval1, yeval2);
+- Assert.assertEquals("[object Object]", y1.toString());
+- Assert.assertEquals("[object Object]", y2.toString());
+- } catch (final ScriptException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+- }
+-
+- @Test
+- public void userEngineScopeBindingsTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.eval("function func() {}");
+-
+- final ScriptContext newContext = new SimpleScriptContext();
+- newContext.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);
+- // we are using a new bindings - so it should have 'func' defined
+- final Object value = e.eval("typeof func", newContext);
+- assertTrue(value.equals("undefined"));
+- }
+-
+- @Test
+- public void userEngineScopeBindingsNoLeakTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final ScriptContext newContext = new SimpleScriptContext();
+- newContext.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);
+- e.eval("function foo() {}", newContext);
+-
+- // in the default context's ENGINE_SCOPE, 'foo' shouldn't exist
+- assertTrue(e.eval("typeof foo").equals("undefined"));
+- }
+-
+- @Test
+- public void userEngineScopeBindingsRetentionTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final ScriptContext newContext = new SimpleScriptContext();
+- newContext.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);
+- e.eval("function foo() {}", newContext);
+-
+- // definition retained with user's ENGINE_SCOPE Binding
+- assertTrue(e.eval("typeof foo", newContext).equals("function"));
+-
+- final Bindings oldBindings = newContext.getBindings(ScriptContext.ENGINE_SCOPE);
+- // but not in another ENGINE_SCOPE binding
+- newContext.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);
+- assertTrue(e.eval("typeof foo", newContext).equals("undefined"));
+-
+- // restore ENGINE_SCOPE and check again
+- newContext.setBindings(oldBindings, ScriptContext.ENGINE_SCOPE);
+- assertTrue(e.eval("typeof foo", newContext).equals("function"));
+- }
+-
+- @Test
+- // check that engine.js definitions are visible in all new global instances
+- public void checkBuiltinsInNewBindingsTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- // check default global instance has engine.js definitions
+- final Bindings g = (Bindings) e.eval("this");
+- Object value = g.get("__noSuchProperty__");
+- assertTrue(value instanceof ScriptObjectMirror && ((ScriptObjectMirror)value).isFunction());
+- value = g.get("print");
+- assertTrue(value instanceof ScriptObjectMirror && ((ScriptObjectMirror)value).isFunction());
+-
+- // check new global instance created has engine.js definitions
+- final Bindings b = e.createBindings();
+- value = b.get("__noSuchProperty__");
+- assertTrue(value instanceof ScriptObjectMirror && ((ScriptObjectMirror)value).isFunction());
+- value = b.get("print");
+- assertTrue(value instanceof ScriptObjectMirror && ((ScriptObjectMirror)value).isFunction());
+-
+- // put a mapping into GLOBAL_SCOPE
+- final Bindings globalScope = e.getContext().getBindings(ScriptContext.GLOBAL_SCOPE);
+- globalScope.put("x", "hello");
+-
+- // GLOBAL_SCOPE mapping should be visible from default ScriptContext eval
+- assertTrue(e.eval("x").equals("hello"));
+-
+- final ScriptContext ctx = new SimpleScriptContext();
+- ctx.setBindings(globalScope, ScriptContext.GLOBAL_SCOPE);
+- ctx.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- // GLOBAL_SCOPE mapping should be visible from non-default ScriptContext eval
+- assertTrue(e.eval("x", ctx).equals("hello"));
+-
+- // try some arbitray Bindings for ENGINE_SCOPE
+- final Bindings sb = new SimpleBindings();
+- ctx.setBindings(sb, ScriptContext.ENGINE_SCOPE);
+-
+- // GLOBAL_SCOPE mapping should be visible from non-default ScriptContext eval
+- assertTrue(e.eval("x", ctx).equals("hello"));
+-
+- // engine.js builtins are still defined even with arbitrary Bindings
+- assertTrue(e.eval("typeof print", ctx).equals("function"));
+- assertTrue(e.eval("typeof __noSuchProperty__", ctx).equals("function"));
+-
+- // ENGINE_SCOPE definition should 'hide' GLOBAL_SCOPE definition
+- sb.put("x", "newX");
+- assertTrue(e.eval("x", ctx).equals("newX"));
+- }
+-
+- /**
+- * Test multi-threaded access to defined global variables for shared script classes with multiple globals.
+- */
+- @Test
+- public static void multiThreadedVarTest() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+- final String sharedScript = "foo";
+-
+- assertEquals(e.eval("var foo = 'original context';", origContext), null);
+- assertEquals(e.eval("var foo = 'new context';", newCtxt), null);
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- assertEquals(e.eval("var foo = 'newer context';", newCtxt), null);
+- final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
+-
+- t3.start();
+- t4.start();
+- t3.join();
+- t4.join();
+-
+- assertEquals(e.eval(sharedScript), "original context");
+- assertEquals(e.eval(sharedScript, newCtxt), "newer context");
+- }
+-
+- /**
+- * Test multi-threaded access to undefined global variables for shared script classes with multiple globals.
+- */
+- @Test
+- public static void multiThreadedGlobalTest() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- assertEquals(e.eval("foo = 'original context';", origContext), "original context");
+- assertEquals(e.eval("foo = 'new context';", newCtxt), "new context");
+- final String sharedScript = "foo";
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- final Object obj3 = e.eval("delete foo; foo = 'newer context';", newCtxt);
+- assertEquals(obj3, "newer context");
+- final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
+-
+- t3.start();
+- t4.start();
+- t3.join();
+- t4.join();
+-
+- Assert.assertEquals(e.eval(sharedScript), "original context");
+- Assert.assertEquals(e.eval(sharedScript, newCtxt), "newer context");
+- }
+-
+- /**
+- * Test multi-threaded access using the postfix ++ operator for shared script classes with multiple globals.
+- */
+- @Test
+- public static void multiThreadedIncTest() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- assertEquals(e.eval("var x = 0;", origContext), null);
+- assertEquals(e.eval("var x = 2;", newCtxt), null);
+- final String sharedScript = "x++;";
+-
+- final Thread t1 = new Thread(new Runnable() {
+- @Override
+- public void run() {
+- try {
+- for (int i = 0; i < 1000; i++) {
+- assertEquals(e.eval(sharedScript, origContext), (double)i);
+- }
+- } catch (final ScriptException se) {
+- fail(se.toString());
+- }
+- }
+- });
+- final Thread t2 = new Thread(new Runnable() {
+- @Override
+- public void run() {
+- try {
+- for (int i = 2; i < 1000; i++) {
+- assertEquals(e.eval(sharedScript, newCtxt), (double)i);
+- }
+- } catch (final ScriptException se) {
+- fail(se.toString());
+- }
+- }
+- });
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+- }
+-
+- /**
+- * Test multi-threaded access to primitive prototype properties for shared script classes with multiple globals.
+- */
+- @Test
+- public static void multiThreadedPrimitiveTest() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- final Object obj1 = e.eval("String.prototype.foo = 'original context';", origContext);
+- final Object obj2 = e.eval("String.prototype.foo = 'new context';", newCtxt);
+- assertEquals(obj1, "original context");
+- assertEquals(obj2, "new context");
+- final String sharedScript = "''.foo";
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- final Object obj3 = e.eval("delete String.prototype.foo; Object.prototype.foo = 'newer context';", newCtxt);
+- assertEquals(obj3, "newer context");
+- final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
+-
+- t3.start();
+- t4.start();
+- t3.join();
+- t4.join();
+-
+- Assert.assertEquals(e.eval(sharedScript), "original context");
+- Assert.assertEquals(e.eval(sharedScript, newCtxt), "newer context");
+- }
+-
+-
+- /**
+- * Test multi-threaded access to prototype user accessor properties for shared script classes with multiple globals.
+- */
+- @Test
+- public static void multiThreadedAccessorTest() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- e.eval("Object.defineProperty(Object.prototype, 'foo', { get: function() 'original context' })", origContext);
+- e.eval("Object.defineProperty(Object.prototype, 'foo', { get: function() 'new context', configurable: true })", newCtxt);
+- final String sharedScript = "({}).foo";
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- final Object obj3 = e.eval("delete Object.prototype.foo; Object.prototype.foo = 'newer context';", newCtxt);
+- assertEquals(obj3, "newer context");
+- final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
+-
+- t3.start();
+- t4.start();
+- t3.join();
+- t4.join();
+- }
+-
+- /**
+- * Test multi-threaded access to primitive prototype user accessor properties for shared script classes with multiple globals.
+- */
+- @Test
+- public static void multiThreadedPrimitiveAccessorTest() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- e.eval("Object.defineProperty(String.prototype, 'foo', { get: function() 'original context' })", origContext);
+- e.eval("Object.defineProperty(String.prototype, 'foo', { get: function() 'new context' })", newCtxt);
+- final String sharedScript = "''.foo";
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- final Object obj3 = e.eval("delete String.prototype.foo; Object.prototype.foo = 'newer context';", newCtxt);
+- assertEquals(obj3, "newer context");
+- final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
+-
+- t3.start();
+- t4.start();
+- t3.join();
+- t4.join();
+- }
+-
+- /**
+- * Test multi-threaded scope function invocation for shared script classes with multiple globals.
+- */
+- @Test
+- public static void multiThreadedFunctionTest() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- e.eval(new URLReader(ScopeTest.class.getResource("resources/func.js")), origContext);
+- assertEquals(origContext.getAttribute("scopeVar"), 1);
+- assertEquals(e.eval("scopeTest()"), 1);
+-
+- e.eval(new URLReader(ScopeTest.class.getResource("resources/func.js")), newCtxt);
+- assertEquals(newCtxt.getAttribute("scopeVar"), 1);
+- assertEquals(e.eval("scopeTest();", newCtxt), 1);
+-
+- assertEquals(e.eval("scopeVar = 3;", newCtxt), 3);
+- assertEquals(newCtxt.getAttribute("scopeVar"), 3);
+-
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, "scopeTest()", 1, 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, "scopeTest()", 3, 1000));
+-
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- }
+-
+- /**
+- * Test multi-threaded access to global getters and setters for shared script classes with multiple globals.
+- */
+- @Test
+- public static void getterSetterTest() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+- final String sharedScript = "accessor1";
+-
+- e.eval(new URLReader(ScopeTest.class.getResource("resources/gettersetter.js")), origContext);
+- assertEquals(e.eval("accessor1 = 1;"), 1);
+- assertEquals(e.eval(sharedScript), 1);
+-
+- e.eval(new URLReader(ScopeTest.class.getResource("resources/gettersetter.js")), newCtxt);
+- assertEquals(e.eval("accessor1 = 2;", newCtxt), 2);
+- assertEquals(e.eval(sharedScript, newCtxt), 2);
+-
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, 1, 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, 2, 1000));
+-
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- assertEquals(e.eval(sharedScript), 1);
+- assertEquals(e.eval(sharedScript, newCtxt), 2);
+- assertEquals(e.eval("v"), 1);
+- assertEquals(e.eval("v", newCtxt), 2);
+- }
+-
+- /**
+- * Test multi-threaded access to global getters and setters for shared script classes with multiple globals.
+- */
+- @Test
+- public static void getterSetter2Test() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+- final String sharedScript = "accessor2";
+-
+- e.eval(new URLReader(ScopeTest.class.getResource("resources/gettersetter.js")), origContext);
+- assertEquals(e.eval("accessor2 = 1;"), 1);
+- assertEquals(e.eval(sharedScript), 1);
+-
+- e.eval(new URLReader(ScopeTest.class.getResource("resources/gettersetter.js")), newCtxt);
+- assertEquals(e.eval("accessor2 = 2;", newCtxt), 2);
+- assertEquals(e.eval(sharedScript, newCtxt), 2);
+-
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, 1, 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, 2, 1000));
+-
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- assertEquals(e.eval(sharedScript), 1);
+- assertEquals(e.eval(sharedScript, newCtxt), 2);
+- assertEquals(e.eval("x"), 1);
+- assertEquals(e.eval("x", newCtxt), 2);
+- }
+-
+- // @bug 8058422: Users should be able to overwrite "context" and "engine" variables
+- @Test
+- public static void contextOverwriteTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = new SimpleBindings();
+- b.put("context", "hello");
+- b.put("foo", 32);
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+- e.setContext(newCtxt);
+- assertEquals(e.eval("context"), "hello");
+- assertEquals(((Number)e.eval("foo")).intValue(), 32);
+- }
+-
+- // @bug 8058422: Users should be able to overwrite "context" and "engine" variables
+- @Test
+- public static void contextOverwriteInScriptTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.put("foo", 32);
+-
+- assertEquals(((Number)e.eval("foo")).intValue(), 32);
+- assertEquals(e.eval("context = 'bar'"), "bar");
+- assertEquals(((Number)e.eval("foo")).intValue(), 32);
+- }
+-
+- // @bug 8058422: Users should be able to overwrite "context" and "engine" variables
+- @Test
+- public static void engineOverwriteTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Bindings b = new SimpleBindings();
+- b.put("engine", "hello");
+- b.put("foo", 32);
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+- e.setContext(newCtxt);
+- assertEquals(e.eval("engine"), "hello");
+- assertEquals(((Number)e.eval("foo")).intValue(), 32);
+- }
+-
+- // @bug 8058422: Users should be able to overwrite "context" and "engine" variables
+- @Test
+- public static void engineOverwriteInScriptTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.put("foo", 32);
+-
+- assertEquals(((Number)e.eval("foo")).intValue(), 32);
+- assertEquals(e.eval("engine = 'bar'"), "bar");
+- assertEquals(((Number)e.eval("foo")).intValue(), 32);
+- }
+-
+- // @bug 8044750: megamorphic getter for scope objects does not call __noSuchProperty__ hook
+- @Test
+- public static void testMegamorphicGetInGlobal() throws Exception {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine engine = m.getEngineByName("nashorn");
+- final String script = "foo";
+- // "foo" is megamorphic because of different global scopes.
+- // Make sure ScriptContext variable search works even after
+- // it becomes megamorphic.
+- for (int index = 0; index < 25; index++) {
+- final Bindings bindings = new SimpleBindings();
+- bindings.put("foo", index);
+- final Number value = (Number)engine.eval(script, bindings);
+- assertEquals(index, value.intValue());
+- }
+- }
+-
+- /**
+- * Test "slow" scopes involving {@code with} and {@code eval} statements for shared script classes with multiple globals.
+- * @throws ScriptException
+- * @throws InterruptedException
+- */
+- @Test
+- public static void testSlowScope() throws ScriptException, InterruptedException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- for (int i = 0; i < 100; i++) {
+- final Bindings b = e.createBindings();
+- final ScriptContext ctxt = new SimpleScriptContext();
+- ctxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+-
+- e.eval(new URLReader(ScopeTest.class.getResource("resources/witheval.js")), ctxt);
+- assertEquals(e.eval("a", ctxt), 1);
+- assertEquals(b.get("a"), 1);
+- assertEquals(e.eval("b", ctxt), 3);
+- assertEquals(b.get("b"), 3);
+- assertEquals(e.eval("c", ctxt), 10);
+- assertEquals(b.get("c"), 10);
+- }
+- }
+-
+- private static class ScriptRunner implements Runnable {
+-
+- final ScriptEngine engine;
+- final ScriptContext context;
+- final String source;
+- final Object expected;
+- final int iterations;
+-
+- ScriptRunner(final ScriptEngine engine, final ScriptContext context, final String source, final Object expected, final int iterations) {
+- this.engine = engine;
+- this.context = context;
+- this.source = source;
+- this.expected = expected;
+- this.iterations = iterations;
+- }
+-
+- @Override
+- public void run() {
+- try {
+- for (int i = 0; i < iterations; i++) {
+- assertEquals(engine.eval(source, context), expected);
+- }
+- } catch (final ScriptException se) {
+- throw new RuntimeException(se);
+- }
+- }
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineSecurityTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,311 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-import static org.testng.Assert.fail;
+-import java.lang.reflect.InvocationHandler;
+-import java.lang.reflect.Method;
+-import java.lang.reflect.Proxy;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.annotations.Test;
+-
+-/**
+- * jsr223 tests for security access checks.
+- */
+-@SuppressWarnings("javadoc")
+-public class ScriptEngineSecurityTest {
+-
+- private static void log(final String msg) {
+- org.testng.Reporter.log(msg, true);
+- }
+-
+- @Test
+- public void securityPackagesTest() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("var v = Packages.sun.misc.Unsafe;");
+- fail("should have thrown SecurityException");
+- } catch (final Exception exp) {
+- if (exp instanceof SecurityException) {
+- log("got " + exp + " as expected");
+- } else {
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- public void securityJavaTypeTest() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("var v = Java.type('sun.misc.Unsafe');");
+- fail("should have thrown SecurityException");
+- } catch (final Exception exp) {
+- if (exp instanceof SecurityException) {
+- log("got " + exp + " as expected");
+- } else {
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- public void securityClassForNameTest() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("var v = java.lang.Class.forName('sun.misc.Unsafe');");
+- fail("should have thrown SecurityException");
+- } catch (final Exception exp) {
+- if (exp instanceof SecurityException) {
+- log("got " + exp + " as expected");
+- } else {
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- public void securitySystemExit() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("java.lang.System.exit(0);");
+- fail("should have thrown SecurityException");
+- } catch (final Exception exp) {
+- if (exp instanceof SecurityException) {
+- log("got " + exp + " as expected");
+- } else {
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+-
+- @Test
+- public void securitySystemExitFromFinalizerThread() throws ScriptException {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.eval("var o = Java.extend(Java.type('javax.imageio.spi.ServiceRegistry'), { deregisterAll: this.exit.bind(null, 1234)});\n" +
+- "new o(new java.util.ArrayList().iterator())");
+- System.gc();
+- System.runFinalization();
+- // NOTE: this test just exits the VM if it fails.
+- }
+-
+- @Test
+- public void securitySystemLoadLibrary() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("java.lang.System.loadLibrary('foo');");
+- fail("should have thrown SecurityException");
+- } catch (final Exception exp) {
+- if (exp instanceof SecurityException) {
+- log("got " + exp + " as expected");
+- } else {
+- fail(exp.getMessage());
+- }
+- }
+- }
+-
+- // @bug 8032948: Nashorn linkages awry
+- @SuppressWarnings("serial")
+- public static class FakeProxy extends Proxy {
+- public FakeProxy(final InvocationHandler ih) {
+- super(ih);
+- }
+-
+- public static Class<?> makeProxyClass(final ClassLoader cl, final Class<?>... ifaces) {
+- return Proxy.getProxyClass(cl, ifaces);
+- }
+- }
+-
+- @Test
+- public void fakeProxySubclassAccessCheckTest() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- e.put("name", ScriptEngineSecurityTest.class.getName());
+- e.put("cl", ScriptEngineSecurityTest.class.getClassLoader());
+- e.put("intfs", new Class[] { Runnable.class });
+-
+- final String getClass = "Java.type(name + '$FakeProxy').getProxyClass(cl, intfs);";
+-
+- // Should not be able to call static methods of Proxy via fake subclass
+- try {
+- e.eval(getClass);
+- fail("should have thrown SecurityException");
+- } catch (final Exception exp) {
+- if (! (exp instanceof SecurityException)) {
+- fail("SecurityException expected, got " + exp);
+- }
+- }
+- }
+-
+- @Test
+- public void fakeProxySubclassAccessCheckTest2() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- e.put("name", ScriptEngineSecurityTest.class.getName());
+- e.put("cl", ScriptEngineSecurityTest.class.getClassLoader());
+- e.put("intfs", new Class[] { Runnable.class });
+-
+- final String getClass = "Java.type(name + '$FakeProxy').makeProxyClass(cl, intfs);";
+-
+- // Should not be able to call static methods of Proxy via fake subclass
+- try {
+- e.eval(getClass);
+- fail("should have thrown SecurityException");
+- } catch (final Exception exp) {
+- if (! (exp instanceof SecurityException)) {
+- fail("SecurityException expected, got " + exp);
+- }
+- }
+- }
+-
+- @Test
+- public static void proxyStaticAccessCheckTest() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Runnable r = (Runnable)Proxy.newProxyInstance(
+- ScriptEngineTest.class.getClassLoader(),
+- new Class[] { Runnable.class },
+- new InvocationHandler() {
+- @Override
+- public Object invoke(final Object p, final Method mtd, final Object[] a) {
+- return null;
+- }
+- });
+-
+- e.put("rc", r.getClass());
+- e.put("cl", ScriptEngineSecurityTest.class.getClassLoader());
+- e.put("intfs", new Class[] { Runnable.class });
+-
+- // make sure static methods of Proxy is not accessible via subclass
+- try {
+- e.eval("rc.static.getProxyClass(cl, intfs)");
+- fail("Should have thrown SecurityException");
+- } catch (final Exception exp) {
+- if (! (exp instanceof SecurityException)) {
+- fail("SecurityException expected, got " + exp);
+- }
+- }
+- }
+-
+-
+- @Test
+- public void nashornConfigSecurityTest() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- try {
+- fac.getScriptEngine(new ClassFilter() {
+- @Override
+- public boolean exposeToScripts(final String name) {
+- return true;
+- }
+- });
+- fail("SecurityException should have been thrown");
+- } catch (final SecurityException e) {
+- //empty
+- }
+- }
+-
+- @Test
+- public void nashornConfigSecurityTest2() {
+- if (System.getSecurityManager() == null) {
+- // pass vacuously
+- return;
+- }
+-
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- try {
+- fac.getScriptEngine(new String[0], null, new ClassFilter() {
+- @Override
+- public boolean exposeToScripts(final String name) {
+- return true;
+- }
+- });
+- fail("SecurityException should have been thrown");
+- } catch (final SecurityException e) {
+- //empty
+- }
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,724 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertNotNull;
+-import static org.testng.Assert.assertTrue;
+-import static org.testng.Assert.fail;
+-
+-import java.io.StringReader;
+-import java.io.StringWriter;
+-import java.lang.reflect.InvocationHandler;
+-import java.lang.reflect.Method;
+-import java.lang.reflect.Proxy;
+-import java.util.concurrent.Callable;
+-import java.util.concurrent.atomic.AtomicBoolean;
+-import java.util.function.Consumer;
+-import java.util.function.Function;
+-import javax.script.Compilable;
+-import javax.script.CompiledScript;
+-import javax.script.Invocable;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineFactory;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import javax.script.SimpleScriptContext;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests for JSR-223 script engine for Nashorn.
+- *
+- * @test
+- * @build jdk.nashorn.api.scripting.Window jdk.nashorn.api.scripting.WindowEventHandler jdk.nashorn.api.scripting.VariableArityTestInterface jdk.nashorn.api.scripting.ScriptEngineTest
+- * @run testng/othervm jdk.nashorn.api.scripting.ScriptEngineTest
+- */
+-@SuppressWarnings("javadoc")
+-public class ScriptEngineTest {
+-
+- private static void log(final String msg) {
+- org.testng.Reporter.log(msg, true);
+- }
+-
+- @Test
+- public void argumentsTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- final String[] args = new String[] { "hello", "world" };
+- try {
+- e.put("arguments", args);
+- final Object arg0 = e.eval("arguments[0]");
+- final Object arg1 = e.eval("arguments[1]");
+- assertEquals(args[0], arg0);
+- assertEquals(args[1], arg1);
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void argumentsWithTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- final String[] args = new String[] { "hello", "world" };
+- try {
+- e.put("arguments", args);
+- final Object arg0 = e.eval("var imports = new JavaImporter(java.io); " +
+- " with(imports) { arguments[0] }");
+- final Object arg1 = e.eval("var imports = new JavaImporter(java.util, java.io); " +
+- " with(imports) { arguments[1] }");
+- assertEquals(args[0], arg0);
+- assertEquals(args[1], arg1);
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void argumentsEmptyTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- assertEquals(e.eval("arguments instanceof Array"), true);
+- assertEquals(e.eval("arguments.length == 0"), true);
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void factoryTests() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- assertNotNull(e);
+-
+- final ScriptEngineFactory fac = e.getFactory();
+-
+- assertEquals(fac.getLanguageName(), "ECMAScript");
+- assertEquals(fac.getParameter(ScriptEngine.NAME), "javascript");
+- assertEquals(fac.getLanguageVersion(), "ECMA - 262 Edition 5.1");
+- assertEquals(fac.getEngineName(), "Oracle Nashorn");
+- assertEquals(fac.getOutputStatement("context"), "print(context)");
+- assertEquals(fac.getProgram("print('hello')", "print('world')"), "print('hello');print('world');");
+- assertEquals(fac.getParameter(ScriptEngine.NAME), "javascript");
+-
+- boolean seenJS = false;
+- for (final String ext : fac.getExtensions()) {
+- if (ext.equals("js")) {
+- seenJS = true;
+- }
+- }
+-
+- assertEquals(seenJS, true);
+- final String str = fac.getMethodCallSyntax("obj", "foo", "x");
+- assertEquals(str, "obj.foo(x)");
+-
+- boolean seenNashorn = false, seenJavaScript = false, seenECMAScript = false;
+- for (final String name : fac.getNames()) {
+- switch (name) {
+- case "nashorn": seenNashorn = true; break;
+- case "javascript": seenJavaScript = true; break;
+- case "ECMAScript": seenECMAScript = true; break;
+- default:
+- break;
+- }
+- }
+-
+- assertTrue(seenNashorn);
+- assertTrue(seenJavaScript);
+- assertTrue(seenECMAScript);
+-
+- boolean seenAppJS = false, seenAppECMA = false, seenTextJS = false, seenTextECMA = false;
+- for (final String mime : fac.getMimeTypes()) {
+- switch (mime) {
+- case "application/javascript": seenAppJS = true; break;
+- case "application/ecmascript": seenAppECMA = true; break;
+- case "text/javascript": seenTextJS = true; break;
+- case "text/ecmascript": seenTextECMA = true; break;
+- default:
+- break;
+- }
+- }
+-
+- assertTrue(seenAppJS);
+- assertTrue(seenAppECMA);
+- assertTrue(seenTextJS);
+- assertTrue(seenTextECMA);
+- }
+-
+- @Test
+- public void evalTests() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.put(ScriptEngine.FILENAME, "myfile.js");
+-
+- try {
+- e.eval("print('hello')");
+- } catch (final ScriptException se) {
+- fail(se.getMessage());
+- }
+- try {
+- e.eval("print('hello)");
+- fail("script exception expected");
+- } catch (final ScriptException se) {
+- assertEquals(se.getLineNumber(), 1);
+- assertEquals(se.getColumnNumber(), 13);
+- assertEquals(se.getFileName(), "myfile.js");
+- // se.printStackTrace();
+- }
+-
+- try {
+- Object obj = e.eval("34 + 41");
+- assertTrue(34.0 + 41.0 == ((Number)obj).doubleValue());
+- obj = e.eval("x = 5");
+- assertTrue(5.0 == ((Number)obj).doubleValue());
+- } catch (final ScriptException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+- }
+-
+- @Test
+- public void compileTests() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- CompiledScript script = null;
+-
+- try {
+- script = ((Compilable)e).compile("print('hello')");
+- } catch (final ScriptException se) {
+- fail(se.getMessage());
+- }
+-
+- try {
+- script.eval();
+- } catch (final ScriptException | NullPointerException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+-
+- // try to compile from a Reader
+- try {
+- script = ((Compilable)e).compile(new StringReader("print('world')"));
+- } catch (final ScriptException se) {
+- fail(se.getMessage());
+- }
+-
+- try {
+- script.eval();
+- } catch (final ScriptException | NullPointerException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+- }
+-
+- @Test
+- public void compileAndEvalInDiffContextTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine engine = m.getEngineByName("js");
+- final Compilable compilable = (Compilable) engine;
+- final CompiledScript compiledScript = compilable.compile("foo");
+- final ScriptContext ctxt = new SimpleScriptContext();
+- ctxt.setAttribute("foo", "hello", ScriptContext.ENGINE_SCOPE);
+- assertEquals(compiledScript.eval(ctxt), "hello");
+- }
+-
+- @Test
+- public void accessGlobalTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- e.eval("var x = 'hello'");
+- assertEquals(e.get("x"), "hello");
+- } catch (final ScriptException exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void exposeGlobalTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- e.put("y", "foo");
+- e.eval("print(y)");
+- } catch (final ScriptException exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void putGlobalFunctionTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- e.put("callable", new Callable<String>() {
+- @Override
+- public String call() throws Exception {
+- return "callable was called";
+- }
+- });
+-
+- try {
+- e.eval("print(callable.call())");
+- } catch (final ScriptException exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void windowAlertTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Window window = new Window();
+-
+- try {
+- e.put("window", window);
+- e.eval("print(window.alert)");
+- e.eval("window.alert('calling window.alert...')");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void windowLocationTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Window window = new Window();
+-
+- try {
+- e.put("window", window);
+- e.eval("print(window.location)");
+- final Object locationValue = e.eval("window.getLocation()");
+- assertEquals(locationValue, "http://localhost:8080/window");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void windowItemTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Window window = new Window();
+-
+- try {
+- e.put("window", window);
+- final String item1 = (String)e.eval("window.item(65535)");
+- assertEquals(item1, "ffff");
+- final String item2 = (String)e.eval("window.item(255)");
+- assertEquals(item2, "ff");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void windowEventTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Window window = new Window();
+-
+- try {
+- e.put("window", window);
+- e.eval("window.onload = function() { print('window load event fired'); return true }");
+- assertTrue((Boolean)e.eval("window.onload.loaded()"));
+- final WindowEventHandler handler = window.getOnload();
+- assertNotNull(handler);
+- assertTrue(handler.loaded());
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void throwTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.put(ScriptEngine.FILENAME, "throwtest.js");
+-
+- try {
+- e.eval("throw 'foo'");
+- } catch (final ScriptException exp) {
+- log(exp.getMessage());
+- assertEquals(exp.getMessage(), "foo in throwtest.js at line number 1 at column number 0");
+- assertEquals(exp.getFileName(), "throwtest.js");
+- assertEquals(exp.getLineNumber(), 1);
+- }
+- }
+-
+- @Test
+- public void setTimeoutTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final Window window = new Window();
+-
+- try {
+- final Class<?> setTimeoutParamTypes[] = { Window.class, String.class, int.class };
+- final Method setTimeout = Window.class.getDeclaredMethod("setTimeout", setTimeoutParamTypes);
+- assertNotNull(setTimeout);
+- e.put("window", window);
+- e.eval("window.setTimeout('foo()', 100)");
+-
+- // try to make setTimeout global
+- e.put("setTimeout", setTimeout);
+- // TODO: java.lang.ClassCastException: required class
+- // java.lang.Integer but encountered class java.lang.Double
+- // e.eval("setTimeout('foo2()', 200)");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void setWriterTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final StringWriter sw = new StringWriter();
+- e.getContext().setWriter(sw);
+-
+- try {
+- e.eval("print('hello world')");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- assertEquals(sw.toString(), println("hello world"));
+- }
+-
+- @Test
+- public void redefineEchoTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- try {
+- e.eval("var echo = {}; if (typeof echo !== 'object') { throw 'echo is a '+typeof echo; }");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+- @Test
+- public void noEnumerablePropertiesTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("for (i in this) { throw 'found property: ' + i }");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void noRefErrorForGlobalThisAccessTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("this.foo");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void refErrorForUndeclaredAccessTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("try { print(foo); throw 'no ref error' } catch (e) { if (!(e instanceof ReferenceError)) throw e; }");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void typeErrorForGlobalThisCallTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("try { this.foo() } catch(e) { if (! (e instanceof TypeError)) throw 'no type error' }");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void refErrorForUndeclaredCallTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("try { foo() } catch(e) { if (! (e instanceof ReferenceError)) throw 'no ref error' }");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- // check that print function prints arg followed by newline char
+- public void printTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final StringWriter sw = new StringWriter();
+- e.getContext().setWriter(sw);
+- try {
+- e.eval("print('hello')");
+- } catch (final Throwable t) {
+- t.printStackTrace();
+- fail(t.getMessage());
+- }
+-
+- assertEquals(sw.toString(), println("hello"));
+- }
+-
+- @Test
+- // check that print prints all arguments (more than one)
+- public void printManyTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final StringWriter sw = new StringWriter();
+- e.getContext().setWriter(sw);
+- try {
+- e.eval("print(34, true, 'hello')");
+- } catch (final Throwable t) {
+- t.printStackTrace();
+- fail(t.getMessage());
+- }
+-
+- assertEquals(sw.toString(), println("34 true hello"));
+- }
+-
+- @Test
+- public void scriptObjectAutoConversionTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.eval("obj = { foo: 'hello' }");
+- e.put("Window", e.eval("Packages.jdk.nashorn.api.scripting.Window"));
+- assertEquals(e.eval("Window.funcJSObject(obj)"), "hello");
+- assertEquals(e.eval("Window.funcScriptObjectMirror(obj)"), "hello");
+- assertEquals(e.eval("Window.funcMap(obj)"), "hello");
+- assertEquals(e.eval("Window.funcJSObject(obj)"), "hello");
+- }
+-
+- // @bug 8032948: Nashorn linkages awry
+- @Test
+- public void checkProxyAccess() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final boolean[] reached = new boolean[1];
+- final Runnable r = (Runnable)Proxy.newProxyInstance(
+- ScriptEngineTest.class.getClassLoader(),
+- new Class[] { Runnable.class },
+- new InvocationHandler() {
+- @Override
+- public Object invoke(final Object p, final Method mtd, final Object[] a) {
+- reached[0] = true;
+- return null;
+- }
+- });
+-
+- e.put("r", r);
+- e.eval("r.run()");
+-
+- assertTrue(reached[0]);
+- }
+-
+- // properties that can be read by any code
+- private static String[] propNames = {
+- "java.version",
+- "java.vendor",
+- "java.vendor.url",
+- "java.class.version",
+- "os.name",
+- "os.version",
+- "os.arch",
+- "file.separator",
+- "path.separator",
+- "line.separator",
+- "java.specification.version",
+- "java.specification.vendor",
+- "java.specification.name",
+- "java.vm.specification.version",
+- "java.vm.specification.vendor",
+- "java.vm.specification.name",
+- "java.vm.version",
+- "java.vm.vendor",
+- "java.vm.name"
+- };
+-
+- // @bug 8033924: Default permissions are not given for eval code
+- @Test
+- public void checkPropertyReadPermissions() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- for (final String name : propNames) {
+- checkProperty(e, name);
+- }
+- }
+-
+- // @bug 8046013: TypeError: Cannot apply "with" to non script object
+- @Test
+- public void withOnMirrorTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- final Object obj = e.eval("({ foo: 'hello'})");
+- final Object[] arr = new Object[1];
+- arr[0] = obj;
+- e.put("arr", arr);
+- final Object res = e.eval("var res; with(arr[0]) { res = foo; }; res");
+- assertEquals(res, "hello");
+- }
+-
+- // @bug 8054223: Nashorn: AssertionError when use __DIR__ and ScriptEngine.eval()
+- @Test
+- public void check__DIR__Test() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- e.eval("__DIR__");
+- }
+-
+- // @bug 8050432:javax.script.filename variable should not be enumerable
+- // with nashorn engine's ENGINE_SCOPE bindings
+- @Test
+- public void enumerableGlobalsTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- e.put(ScriptEngine.FILENAME, "test");
+- final Object enumerable = e.eval(
+- "Object.getOwnPropertyDescriptor(this, " +
+- " 'javax.script.filename').enumerable");
+- assertEquals(enumerable, Boolean.FALSE);
+- }
+-
+- public static class Context {
+- private Object myobj;
+-
+- public void set(final Object o) {
+- myobj = o;
+- }
+-
+- public Object get() {
+- return myobj;
+- }
+- }
+-
+- // @bug 8050977: Java8 Javascript Nashorn exception:
+- // no current Global instance for nashorn
+- @Test
+- public void currentGlobalMissingTest() throws Exception {
+- final ScriptEngineManager manager = new ScriptEngineManager();
+- final ScriptEngine e = manager.getEngineByName("nashorn");
+-
+- final Context ctx = new Context();
+- e.put("ctx", ctx);
+- e.eval("var obj = { foo: function(str) { return str.toUpperCase() } }");
+- e.eval("ctx.set(obj)");
+- final Invocable inv = (Invocable)e;
+- assertEquals("HELLO", inv.invokeMethod(ctx.get(), "foo", "hello"));
+- // try object literal
+- e.eval("ctx.set({ bar: function(str) { return str.toLowerCase() } })");
+- assertEquals("hello", inv.invokeMethod(ctx.get(), "bar", "HELLO"));
+- // try array literal
+- e.eval("var arr = [ 'hello', 'world' ]");
+- e.eval("ctx.set(arr)");
+- assertEquals("helloworld", inv.invokeMethod(ctx.get(), "join", ""));
+- }
+-
+- // @bug JDK-8068889: ConsString arguments to a functional interface wasn't converted to string.
+- @Test
+- public void functionalInterfaceStringTest() throws Exception {
+- final ScriptEngineManager manager = new ScriptEngineManager();
+- final ScriptEngine e = manager.getEngineByName("nashorn");
+- final AtomicBoolean invoked = new AtomicBoolean(false);
+- e.put("f", new Function<String, String>() {
+- @Override
+- public String apply(String t) {
+- invoked.set(true);
+- return t;
+- }
+- });
+- assertEquals(e.eval("var x = 'a'; x += 'b'; f(x)"), "ab");
+- assertTrue(invoked.get());
+- }
+-
+- // @bug JDK-8068889: ScriptObject arguments to a functional interface wasn't converted to a mirror.
+- @Test
+- public void functionalInterfaceObjectTest() throws Exception {
+- final ScriptEngineManager manager = new ScriptEngineManager();
+- final ScriptEngine e = manager.getEngineByName("nashorn");
+- final AtomicBoolean invoked = new AtomicBoolean(false);
+- e.put("c", new Consumer<Object>() {
+- @Override
+- public void accept(Object t) {
+- assertTrue(t instanceof ScriptObjectMirror);
+- assertEquals(((ScriptObjectMirror)t).get("a"), "xyz");
+- invoked.set(true);
+- }
+- });
+- e.eval("var x = 'xy'; x += 'z';c({a:x})");
+- assertTrue(invoked.get());
+- }
+-
+- private static void checkProperty(final ScriptEngine e, final String name)
+- throws ScriptException {
+- final String value = System.getProperty(name);
+- e.put("name", name);
+- assertEquals(value, e.eval("java.lang.System.getProperty(name)"));
+- }
+-
+- private static final String LINE_SEPARATOR = System.getProperty("line.separator");
+-
+- // Returns String that would be the result of calling PrintWriter.println
+- // of the given String. (This is to handle platform specific newline).
+- private static String println(final String str) {
+- return str + LINE_SEPARATOR;
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/ScriptObjectMirrorTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,387 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertFalse;
+-import static org.testng.Assert.assertTrue;
+-import static org.testng.Assert.fail;
+-
+-import java.nio.ByteBuffer;
+-import java.util.HashMap;
+-import java.util.List;
+-import java.util.Map;
+-import java.util.function.Function;
+-import javax.script.Bindings;
+-import javax.script.Invocable;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests to check jdk.nashorn.api.scripting.ScriptObjectMirror API.
+- */
+-@SuppressWarnings("javadoc")
+-public class ScriptObjectMirrorTest {
+-
+- @SuppressWarnings("unchecked")
+- @Test
+- public void reflectionTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+-
+- e.eval("var obj = { x: 344, y: 'nashorn' }");
+-
+- int count = 0;
+- Map<Object, Object> map = (Map<Object, Object>) e.get("obj");
+- assertFalse(map.isEmpty());
+- assertTrue(map.keySet().contains("x"));
+- assertTrue(map.containsKey("x"));
+- assertTrue(map.values().contains("nashorn"));
+- assertTrue(map.containsValue("nashorn"));
+- for (final Map.Entry<?, ?> ex : map.entrySet()) {
+- final Object key = ex.getKey();
+- if (key.equals("x")) {
+- assertTrue(344 == ((Number) ex.getValue()).doubleValue());
+- count++;
+- } else if (key.equals("y")) {
+- assertEquals(ex.getValue(), "nashorn");
+- count++;
+- }
+- }
+- assertEquals(2, count);
+- assertEquals(2, map.size());
+-
+- // add property
+- map.put("z", "hello");
+- assertEquals(e.eval("obj.z"), "hello");
+- assertEquals(map.get("z"), "hello");
+- assertTrue(map.keySet().contains("z"));
+- assertTrue(map.containsKey("z"));
+- assertTrue(map.values().contains("hello"));
+- assertTrue(map.containsValue("hello"));
+- assertEquals(map.size(), 3);
+-
+- final Map<Object, Object> newMap = new HashMap<>();
+- newMap.put("foo", 23.0);
+- newMap.put("bar", true);
+- map.putAll(newMap);
+-
+- assertEquals(e.eval("obj.foo"), 23.0);
+- assertEquals(e.eval("obj.bar"), true);
+-
+- // remove using map method
+- map.remove("foo");
+- assertEquals(e.eval("typeof obj.foo"), "undefined");
+-
+- count = 0;
+- e.eval("var arr = [ true, 'hello' ]");
+- map = (Map<Object, Object>) e.get("arr");
+- assertFalse(map.isEmpty());
+- assertTrue(map.containsKey("length"));
+- assertTrue(map.containsValue("hello"));
+- for (final Map.Entry<?, ?> ex : map.entrySet()) {
+- final Object key = ex.getKey();
+- if (key.equals("0")) {
+- assertEquals(ex.getValue(), Boolean.TRUE);
+- count++;
+- } else if (key.equals("1")) {
+- assertEquals(ex.getValue(), "hello");
+- count++;
+- }
+- }
+- assertEquals(count, 2);
+- assertEquals(map.size(), 2);
+-
+- // add element
+- map.put("2", "world");
+- assertEquals(map.get("2"), "world");
+- assertEquals(map.size(), 3);
+-
+- // remove all
+- map.clear();
+- assertTrue(map.isEmpty());
+- assertEquals(e.eval("typeof arr[0]"), "undefined");
+- assertEquals(e.eval("typeof arr[1]"), "undefined");
+- assertEquals(e.eval("typeof arr[2]"), "undefined");
+- }
+-
+- @Test
+- public void jsobjectTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- e.eval("var obj = { '1': 'world', func: function() { return this.bar; }, bar: 'hello' }");
+- final ScriptObjectMirror obj = (ScriptObjectMirror) e.get("obj");
+-
+- // try basic get on existing properties
+- if (!obj.getMember("bar").equals("hello")) {
+- fail("obj.bar != 'hello'");
+- }
+-
+- if (!obj.getSlot(1).equals("world")) {
+- fail("obj[1] != 'world'");
+- }
+-
+- if (!obj.callMember("func", new Object[0]).equals("hello")) {
+- fail("obj.func() != 'hello'");
+- }
+-
+- // try setting properties
+- obj.setMember("bar", "new-bar");
+- obj.setSlot(1, "new-element-1");
+- if (!obj.getMember("bar").equals("new-bar")) {
+- fail("obj.bar != 'new-bar'");
+- }
+-
+- if (!obj.getSlot(1).equals("new-element-1")) {
+- fail("obj[1] != 'new-element-1'");
+- }
+-
+- // try adding properties
+- obj.setMember("prop", "prop-value");
+- obj.setSlot(12, "element-12");
+- if (!obj.getMember("prop").equals("prop-value")) {
+- fail("obj.prop != 'prop-value'");
+- }
+-
+- if (!obj.getSlot(12).equals("element-12")) {
+- fail("obj[12] != 'element-12'");
+- }
+-
+- // delete properties
+- obj.removeMember("prop");
+- if ("prop-value".equals(obj.getMember("prop"))) {
+- fail("obj.prop is not deleted!");
+- }
+-
+- // Simple eval tests
+- assertEquals(obj.eval("typeof Object"), "function");
+- assertEquals(obj.eval("'nashorn'.substring(3)"), "horn");
+- } catch (final Exception exp) {
+- exp.printStackTrace();
+- fail(exp.getMessage());
+- }
+- }
+-
+- @Test
+- public void scriptObjectMirrorToStringTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- try {
+- final Object obj = e.eval("new TypeError('wrong type')");
+- assertEquals(obj.toString(), "TypeError: wrong type", "toString returns wrong value");
+- } catch (final Throwable t) {
+- t.printStackTrace();
+- fail(t.getMessage());
+- }
+-
+- try {
+- final Object obj = e.eval("function func() { print('hello'); }");
+- assertEquals(obj.toString(), "function func() { print('hello'); }", "toString returns wrong value");
+- } catch (final Throwable t) {
+- t.printStackTrace();
+- fail(t.getMessage());
+- }
+- }
+-
+- @Test
+- public void mirrorNewObjectGlobalFunctionTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final ScriptEngine e2 = m.getEngineByName("nashorn");
+-
+- e.eval("function func() {}");
+- e2.put("foo", e.get("func"));
+- final ScriptObjectMirror e2global = (ScriptObjectMirror)e2.eval("this");
+- final Object newObj = ((ScriptObjectMirror)e2global.getMember("foo")).newObject();
+- assertTrue(newObj instanceof ScriptObjectMirror);
+- }
+-
+- @Test
+- public void mirrorNewObjectInstanceFunctionTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final ScriptEngine e2 = m.getEngineByName("nashorn");
+-
+- e.eval("function func() {}");
+- e2.put("func", e.get("func"));
+- final ScriptObjectMirror e2obj = (ScriptObjectMirror)e2.eval("({ foo: func })");
+- final Object newObj = ((ScriptObjectMirror)e2obj.getMember("foo")).newObject();
+- assertTrue(newObj instanceof ScriptObjectMirror);
+- }
+-
+- @Test
+- public void indexPropertiesExternalBufferTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final ScriptObjectMirror obj = (ScriptObjectMirror)e.eval("var obj = {}; obj");
+- final ByteBuffer buf = ByteBuffer.allocate(5);
+- int i;
+- for (i = 0; i < 5; i++) {
+- buf.put(i, (byte)(i+10));
+- }
+- obj.setIndexedPropertiesToExternalArrayData(buf);
+-
+- for (i = 0; i < 5; i++) {
+- assertEquals((byte)(i+10), ((Number)e.eval("obj[" + i + "]")).byteValue());
+- }
+-
+- e.eval("for (i = 0; i < 5; i++) obj[i] = 0");
+- for (i = 0; i < 5; i++) {
+- assertEquals((byte)0, ((Number)e.eval("obj[" + i + "]")).byteValue());
+- assertEquals((byte)0, buf.get(i));
+- }
+- }
+-
+- @Test
+- public void conversionTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- final ScriptObjectMirror arr = (ScriptObjectMirror)e.eval("[33, 45, 23]");
+- final int[] intArr = arr.to(int[].class);
+- assertEquals(intArr[0], 33);
+- assertEquals(intArr[1], 45);
+- assertEquals(intArr[2], 23);
+-
+- final List<?> list = arr.to(List.class);
+- assertEquals(list.get(0), 33);
+- assertEquals(list.get(1), 45);
+- assertEquals(list.get(2), 23);
+-
+- ScriptObjectMirror obj = (ScriptObjectMirror)e.eval(
+- "({ valueOf: function() { return 42 } })");
+- assertEquals(Double.valueOf(42.0), obj.to(Double.class));
+-
+- obj = (ScriptObjectMirror)e.eval(
+- "({ toString: function() { return 'foo' } })");
+- assertEquals("foo", obj.to(String.class));
+- }
+-
+- // @bug 8044000: Access to undefined property yields "null" instead of "undefined"
+- @Test
+- public void mapScriptObjectMirrorCallsiteTest() throws ScriptException {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine engine = m.getEngineByName("nashorn");
+- final String TEST_SCRIPT = "typeof obj.foo";
+-
+- final Bindings global = engine.getContext().getBindings(ScriptContext.ENGINE_SCOPE);
+- engine.eval("var obj = java.util.Collections.emptyMap()");
+- // this will drive callsite "obj.foo" of TEST_SCRIPT
+- // to use "obj instanceof Map" as it's guard
+- engine.eval(TEST_SCRIPT, global);
+- // redefine 'obj' to be a script object
+- engine.eval("obj = {}");
+-
+- final Bindings newGlobal = engine.createBindings();
+- // transfer 'obj' from default global to new global
+- // new global will get a ScriptObjectMirror wrapping 'obj'
+- newGlobal.put("obj", global.get("obj"));
+-
+- // Every ScriptObjectMirror is a Map! If callsite "obj.foo"
+- // does not see the new 'obj' is a ScriptObjectMirror, it'll
+- // continue to use Map's get("obj.foo") instead of ScriptObjectMirror's
+- // getMember("obj.foo") - thereby getting null instead of undefined
+- assertEquals("undefined", engine.eval(TEST_SCRIPT, newGlobal));
+- }
+-
+- public interface MirrorCheckExample {
+- Object test1(Object arg);
+- Object test2(Object arg);
+- boolean compare(Object o1, Object o2);
+- }
+-
+- // @bug 8053910: ScriptObjectMirror causing havoc with Invocation interface
+- @Test
+- public void checkMirrorToObject() throws Exception {
+- final ScriptEngineManager engineManager = new ScriptEngineManager();
+- final ScriptEngine engine = engineManager.getEngineByName("nashorn");
+- final Invocable invocable = (Invocable)engine;
+-
+- engine.eval("function test1(arg) { return { arg: arg }; }");
+- engine.eval("function test2(arg) { return arg; }");
+- engine.eval("function compare(arg1, arg2) { return arg1 == arg2; }");
+-
+- final Map<String, Object> map = new HashMap<>();
+- map.put("option", true);
+-
+- final MirrorCheckExample example = invocable.getInterface(MirrorCheckExample.class);
+-
+- final Object value1 = invocable.invokeFunction("test1", map);
+- final Object value2 = example.test1(map);
+- final Object value3 = invocable.invokeFunction("test2", value2);
+- final Object value4 = example.test2(value2);
+-
+- // check that Object type argument receives a ScriptObjectMirror
+- // when ScriptObject is passed
+- assertEquals(ScriptObjectMirror.class, value1.getClass());
+- assertEquals(ScriptObjectMirror.class, value2.getClass());
+- assertEquals(ScriptObjectMirror.class, value3.getClass());
+- assertEquals(ScriptObjectMirror.class, value4.getClass());
+- assertTrue((boolean)invocable.invokeFunction("compare", value1, value1));
+- assertTrue(example.compare(value1, value1));
+- assertTrue((boolean)invocable.invokeFunction("compare", value3, value4));
+- assertTrue(example.compare(value3, value4));
+- }
+-
+- // @bug 8053910: ScriptObjectMirror causing havoc with Invocation interface
+- @Test
+- public void mirrorUnwrapInterfaceMethod() throws Exception {
+- final ScriptEngineManager engineManager = new ScriptEngineManager();
+- final ScriptEngine engine = engineManager.getEngineByName("nashorn");
+- final Invocable invocable = (Invocable)engine;
+- engine.eval("function apply(obj) { " +
+- " return obj instanceof Packages.jdk.nashorn.api.scripting.ScriptObjectMirror; " +
+- "}");
+- @SuppressWarnings("unchecked")
+- final Function<Object,Object> func = invocable.getInterface(Function.class);
+- assertFalse((boolean)func.apply(engine.eval("({ x: 2 })")));
+- }
+-
+- // @bug 8055687: Wrong "this" passed to JSObject.eval call
+- @Test
+- public void checkThisForJSObjectEval() throws Exception {
+- final ScriptEngineManager engineManager = new ScriptEngineManager();
+- final ScriptEngine e = engineManager.getEngineByName("nashorn");
+- final JSObject jsobj = (JSObject)e.eval("({foo: 23, bar: 'hello' })");
+- assertEquals(((Number)jsobj.eval("this.foo")).intValue(), 23);
+- assertEquals(jsobj.eval("this.bar"), "hello");
+- assertEquals(jsobj.eval("String(this)"), "[object Object]");
+- final Object global = e.eval("this");
+- assertFalse(global.equals(jsobj.eval("this")));
+- }
+-
+- @Test
+- public void topLevelAnonFuncStatement() throws Exception {
+- final ScriptEngineManager engineManager = new ScriptEngineManager();
+- final ScriptEngine e = engineManager.getEngineByName("nashorn");
+- final JSObject func = (JSObject)e.eval("function(x) { return x + ' world' }");
+- assertTrue(func.isFunction());
+- assertEquals(func.call(e.eval("this"), "hello"), "hello world");
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/VariableArityTestInterface.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,32 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-@SuppressWarnings("javadoc")
+-public interface VariableArityTestInterface {
+- public String test1(int i, String... strings);
+- public String test2(int i, String... strings);
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/Window.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,86 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-import java.util.Map;
+-import javax.script.Bindings;
+-
+-@SuppressWarnings("javadoc")
+-public class Window {
+-
+- private String location = "http://localhost:8080/window";
+-
+- private WindowEventHandler onload = null;
+-
+- public void alert(final String message) {
+- System.out.println("alert: " + message);
+- }
+-
+- public String getLocation() {
+- return location;
+- }
+-
+- public void setLocation(final String location) {
+- this.location = location;
+- }
+-
+- public String item(final int index) {
+- return Integer.toHexString(index);
+- }
+-
+- public WindowEventHandler getOnload() {
+- return onload;
+- }
+-
+- public void setOnload(final WindowEventHandler onload) {
+- this.onload = onload;
+- }
+-
+- public static int setTimeout(final Window self, final String code, final int delay) {
+- return self.setTimeout(code, delay);
+- }
+-
+- public int setTimeout(final String code, final int delay) {
+- System.out.println("window.setTimeout: " + delay + ", code: " + code);
+- return 0;
+- }
+-
+- public static Object funcJSObject(final JSObject jsobj) {
+- return jsobj.getMember("foo");
+- }
+-
+- public static Object funcScriptObjectMirror(final ScriptObjectMirror sobj) {
+- return sobj.get("foo");
+- }
+-
+- public static Object funcMap(final Map<?,?> map) {
+- return map.get("foo");
+- }
+-
+- public static Object funcBindings(final Bindings bindings) {
+- return bindings.get("foo");
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/WindowEventHandler.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,31 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.api.scripting;
+-
+-@SuppressWarnings("javadoc")
+-public interface WindowEventHandler {
+- public boolean loaded();
+-}
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/resources/func.js Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,42 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-// This script is loaded from jdk.nashorn.api.scripting.ScopeTest to test script class sharing and reuse.
+-
+-var scopeVar = 1;
+-var global = this;
+-undefGlobal = this;
+-
+-function scopeTest() {
+- if (this !== global) {
+- throw new Error("this !== global");
+- }
+- if (this !== undefGlobal) {
+- throw new Error("this !== undefinedGlobal")
+- }
+- return scopeVar;
+-}
+-
+-scopeTest();
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/resources/gettersetter.js Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,38 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-// This script is loaded from jdk.nashorn.api.scripting.ScopeTest to test script class sharing and reuse.
+-
+-var v;
+-
+-Object.defineProperty(this, "accessor1", {
+- get: function() { return v; },
+- set: function(n) { v = n; }
+-});
+-
+-Object.defineProperty(this, "accessor2", {
+- get: function() { return x; },
+- set: function(n) { x = n; }
+-});
+--- ./nashorn/test/src/jdk/nashorn/api/scripting/resources/witheval.js Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,60 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-// This script is loaded from jdk.nashorn.api.scripting.ScopeTest to test script class sharing and reuse.
+-
+-var a;
+-
+-function outer(p, e) {
+- eval(e);
+- with(p) {
+- function inner() {
+- a = 1;
+- c = 10;
+- if (a !== 1) {
+- throw new Error("a !== 1");
+- }
+- if (b !== 3) {
+- throw new Error("b !== 3");
+- }
+- if (c !== 10) {
+- throw new Error("c !== 10");
+- }
+- }
+- inner();
+- }
+-}
+-
+-outer({}, "b = 3;");
+-
+-if (a !== 1) {
+- throw new Error("a !== 1");
+-}
+-if (b !== 3) {
+- throw new Error("b !== 3");
+-}
+-if (c !== 10) {
+- throw new Error("c !== 10");
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/InvocableTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,539 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.fail;
++import java.util.Objects;
++import java.util.function.Function;
++import javax.script.Invocable;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import javax.script.SimpleScriptContext;
++import org.testng.Assert;
++import org.testng.annotations.Test;
++
++/**
++ * Tests for javax.script.Invocable implementation of nashorn.
++ */
++@SuppressWarnings("javadoc")
++public class InvocableTest {
++
++ private static void log(final String msg) {
++ org.testng.Reporter.log(msg, true);
++ }
++
++ @Test
++ public void invokeMethodTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ e.eval("var Example = function() { this.hello = function() { return 'Hello World!'; };}; myExample = new Example();");
++ final Object obj = e.get("myExample");
++ final Object res = ((Invocable) e).invokeMethod(obj, "hello");
++ assertEquals(res, "Hello World!");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ /**
++ * Check that we can call invokeMethod on an object that we got by
++ * evaluating script with different Context set.
++ */
++ public void invokeMethodDifferentContextTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ // define an object with method on it
++ final Object obj = e.eval("({ hello: function() { return 'Hello World!'; } })");
++
++ final ScriptContext ctxt = new SimpleScriptContext();
++ ctxt.setBindings(e.createBindings(), ScriptContext.ENGINE_SCOPE);
++ e.setContext(ctxt);
++
++ // invoke 'func' on obj - but with current script context changed
++ final Object res = ((Invocable) e).invokeMethod(obj, "hello");
++ assertEquals(res, "Hello World!");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ /**
++ * Check that invokeMethod throws NPE on null method name.
++ */
++ public void invokeMethodNullNameTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ final Object obj = e.eval("({})");
++ ((Invocable) e).invokeMethod(obj, null);
++ fail("should have thrown NPE");
++ } catch (final Exception exp) {
++ if (!(exp instanceof NullPointerException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that invokeMethod throws NoSuchMethodException on missing method.
++ */
++ public void invokeMethodMissingTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ final Object obj = e.eval("({})");
++ ((Invocable) e).invokeMethod(obj, "nonExistentMethod");
++ fail("should have thrown NoSuchMethodException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof NoSuchMethodException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that calling method on non-script object 'thiz' results in
++ * IllegalArgumentException.
++ */
++ public void invokeMethodNonScriptObjectThizTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ ((Invocable) e).invokeMethod(new Object(), "toString");
++ fail("should have thrown IllegalArgumentException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof IllegalArgumentException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that calling method on null 'thiz' results in
++ * IllegalArgumentException.
++ */
++ public void invokeMethodNullThizTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ ((Invocable) e).invokeMethod(null, "toString");
++ fail("should have thrown IllegalArgumentException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof IllegalArgumentException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that calling method on mirror created by another engine results in
++ * IllegalArgumentException.
++ */
++ public void invokeMethodMixEnginesTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine engine1 = m.getEngineByName("nashorn");
++ final ScriptEngine engine2 = m.getEngineByName("nashorn");
++
++ try {
++ final Object obj = engine1.eval("({ run: function() {} })");
++ // pass object from engine1 to engine2 as 'thiz' for invokeMethod
++ ((Invocable) engine2).invokeMethod(obj, "run");
++ fail("should have thrown IllegalArgumentException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof IllegalArgumentException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ public void getInterfaceTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Invocable inv = (Invocable) e;
++
++ // try to get interface from global functions
++ try {
++ e.eval("function run() { print('run'); };");
++ final Runnable runnable = inv.getInterface(Runnable.class);
++ runnable.run();
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++
++ // try interface on specific script object
++ try {
++ e.eval("var obj = { run: function() { print('run from obj'); } };");
++ final Object obj = e.get("obj");
++ final Runnable runnable = inv.getInterface(obj, Runnable.class);
++ runnable.run();
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ public interface Foo {
++
++ public void bar();
++ }
++
++ public interface Foo2 extends Foo {
++
++ public void bar2();
++ }
++
++ @Test
++ public void getInterfaceMissingTest() {
++ final ScriptEngineManager manager = new ScriptEngineManager();
++ final ScriptEngine engine = manager.getEngineByName("nashorn");
++
++ // don't define any function.
++ try {
++ engine.eval("");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++
++ Runnable runnable = ((Invocable) engine).getInterface(Runnable.class);
++ if (runnable != null) {
++ fail("runnable is not null!");
++ }
++
++ // now define "run"
++ try {
++ engine.eval("function run() { print('this is run function'); }");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ runnable = ((Invocable) engine).getInterface(Runnable.class);
++ // should not return null now!
++ runnable.run();
++
++ // define only one method of "Foo2"
++ try {
++ engine.eval("function bar() { print('bar function'); }");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++
++ Foo2 foo2 = ((Invocable) engine).getInterface(Foo2.class);
++ if (foo2 != null) {
++ throw new RuntimeException("foo2 is not null!");
++ }
++
++ // now define other method of "Foo2"
++ try {
++ engine.eval("function bar2() { print('bar2 function'); }");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ foo2 = ((Invocable) engine).getInterface(Foo2.class);
++ foo2.bar();
++ foo2.bar2();
++ }
++
++ @Test
++ /**
++ * Try passing non-interface Class object for interface implementation.
++ */
++ public void getNonInterfaceGetInterfaceTest() {
++ final ScriptEngineManager manager = new ScriptEngineManager();
++ final ScriptEngine engine = manager.getEngineByName("nashorn");
++ try {
++ log(Objects.toString(((Invocable) engine).getInterface(Object.class)));
++ fail("Should have thrown IllegalArgumentException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof IllegalArgumentException)) {
++ fail("IllegalArgumentException expected, got " + exp);
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that we can get interface out of a script object even after
++ * switching to use different ScriptContext.
++ */
++ public void getInterfaceDifferentContext() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ final Object obj = e.eval("({ run: function() { } })");
++
++ // change script context
++ final ScriptContext ctxt = new SimpleScriptContext();
++ ctxt.setBindings(e.createBindings(), ScriptContext.ENGINE_SCOPE);
++ e.setContext(ctxt);
++
++ final Runnable r = ((Invocable) e).getInterface(obj, Runnable.class);
++ r.run();
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ /**
++ * Check that getInterface on non-script object 'thiz' results in
++ * IllegalArgumentException.
++ */
++ public void getInterfaceNonScriptObjectThizTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ ((Invocable) e).getInterface(new Object(), Runnable.class);
++ fail("should have thrown IllegalArgumentException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof IllegalArgumentException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that getInterface on null 'thiz' results in
++ * IllegalArgumentException.
++ */
++ public void getInterfaceNullThizTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ ((Invocable) e).getInterface(null, Runnable.class);
++ fail("should have thrown IllegalArgumentException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof IllegalArgumentException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that calling getInterface on mirror created by another engine
++ * results in IllegalArgumentException.
++ */
++ public void getInterfaceMixEnginesTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine engine1 = m.getEngineByName("nashorn");
++ final ScriptEngine engine2 = m.getEngineByName("nashorn");
++
++ try {
++ final Object obj = engine1.eval("({ run: function() {} })");
++ // pass object from engine1 to engine2 as 'thiz' for getInterface
++ ((Invocable) engine2).getInterface(obj, Runnable.class);
++ fail("should have thrown IllegalArgumentException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof IllegalArgumentException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * check that null function name results in NPE.
++ */
++ public void invokeFunctionNullNameTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ ((Invocable)e).invokeFunction(null);
++ fail("should have thrown NPE");
++ } catch (final Exception exp) {
++ if (!(exp instanceof NullPointerException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that attempt to call missing function results in
++ * NoSuchMethodException.
++ */
++ public void invokeFunctionMissingTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ ((Invocable)e).invokeFunction("NonExistentFunc");
++ fail("should have thrown NoSuchMethodException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof NoSuchMethodException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ /**
++ * Check that invokeFunction calls functions only from current context's
++ * Bindings.
++ */
++ public void invokeFunctionDifferentContextTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ // define an object with method on it
++ e.eval("function hello() { return 'Hello World!'; }");
++ final ScriptContext ctxt = new SimpleScriptContext();
++ ctxt.setBindings(e.createBindings(), ScriptContext.ENGINE_SCOPE);
++ // change engine's current context
++ e.setContext(ctxt);
++
++ ((Invocable) e).invokeFunction("hello"); // no 'hello' in new context!
++ fail("should have thrown NoSuchMethodException");
++ } catch (final Exception exp) {
++ if (!(exp instanceof NoSuchMethodException)) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ public void invokeFunctionExceptionTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("function func() { throw new TypeError(); }");
++ } catch (final Throwable t) {
++ t.printStackTrace();
++ fail(t.getMessage());
++ }
++
++ try {
++ ((Invocable) e).invokeFunction("func");
++ fail("should have thrown exception");
++ } catch (final ScriptException se) {
++ // ECMA TypeError property wrapped as a ScriptException
++ log("got " + se + " as expected");
++ } catch (final Throwable t) {
++ t.printStackTrace();
++ fail(t.getMessage());
++ }
++ }
++
++ @Test
++ public void invokeMethodExceptionTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("var sobj = {}; sobj.foo = function func() { throw new TypeError(); }");
++ } catch (final Throwable t) {
++ t.printStackTrace();
++ fail(t.getMessage());
++ }
++
++ try {
++ final Object sobj = e.get("sobj");
++ ((Invocable) e).invokeMethod(sobj, "foo");
++ fail("should have thrown exception");
++ } catch (final ScriptException se) {
++ // ECMA TypeError property wrapped as a ScriptException
++ log("got " + se + " as expected");
++ } catch (final Throwable t) {
++ t.printStackTrace();
++ fail(t.getMessage());
++ }
++ }
++
++ @Test
++ /**
++ * Tests whether invocation of a JavaScript method through a variable arity
++ * Java method will pass the vararg array. Both non-vararg and vararg
++ * JavaScript methods are tested.
++ *
++ * @throws ScriptException
++ */
++ public void variableArityInterfaceTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.eval(
++ "function test1(i, strings) {"
++ + " return 'i == ' + i + ', strings instanceof java.lang.String[] == ' + (strings instanceof Java.type('java.lang.String[]')) + ', strings == ' + java.util.Arrays.toString(strings)"
++ + "}"
++ + "function test2() {"
++ + " return 'arguments[0] == ' + arguments[0] + ', arguments[1] instanceof java.lang.String[] == ' + (arguments[1] instanceof Java.type('java.lang.String[]')) + ', arguments[1] == ' + java.util.Arrays.toString(arguments[1])"
++ + "}");
++ final VariableArityTestInterface itf = ((Invocable) e).getInterface(VariableArityTestInterface.class);
++ Assert.assertEquals(itf.test1(42, "a", "b"), "i == 42, strings instanceof java.lang.String[] == true, strings == [a, b]");
++ Assert.assertEquals(itf.test2(44, "c", "d", "e"), "arguments[0] == 44, arguments[1] instanceof java.lang.String[] == true, arguments[1] == [c, d, e]");
++ }
++
++ @Test
++ public void defaultMethodTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Invocable inv = (Invocable) e;
++
++ final Object obj = e.eval("({ apply: function(arg) { return arg.toUpperCase(); }})");
++ @SuppressWarnings("unchecked")
++ final Function<String, String> func = inv.getInterface(obj, Function.class);
++ assertEquals(func.apply("hello"), "HELLO");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/MultipleEngineTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,52 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import org.testng.annotations.Test;
++
++/**
++ * Test that we can create multiple, independent script engines and use those
++ * independently.
++ *
++ * @test
++ * @run testng jdk.nashorn.api.scripting.test.MultipleEngineTest
++ */
++@SuppressWarnings("javadoc")
++public class MultipleEngineTest {
++ @Test
++ public void createAndUseManyEngine() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++
++ final ScriptEngine e1 = m.getEngineByName("nashorn");
++ e1.eval("var x = 33; print(x);");
++
++ final ScriptEngine e2 = m.getEngineByName("nashorn");
++ e2.eval("try { print(x) } catch(e) { print(e); }");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/PluggableJSObjectTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,289 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertFalse;
++import static org.testng.Assert.fail;
++
++import java.nio.IntBuffer;
++import java.util.Collection;
++import java.util.HashMap;
++import java.util.LinkedHashMap;
++import java.util.Set;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import jdk.nashorn.api.scripting.AbstractJSObject;
++import org.testng.annotations.Test;
++
++/**
++ * Tests for pluggable external impls. of jdk.nashorn.api.scripting.JSObject.
++ *
++ * JDK-8024615: Refactor ScriptObjectMirror and JSObject to support external
++ * JSObject implementations.
++ */
++@SuppressWarnings("javadoc")
++public class PluggableJSObjectTest {
++ public static class MapWrapperObject extends AbstractJSObject {
++ private final HashMap<String, Object> map = new LinkedHashMap<>();
++
++ public HashMap<String, Object> getMap() {
++ return map;
++ }
++
++ @Override
++ public Object getMember(final String name) {
++ return map.get(name);
++ }
++
++ @Override
++ public void setMember(final String name, final Object value) {
++ map.put(name, value);
++ }
++
++ @Override
++ public boolean hasMember(final String name) {
++ return map.containsKey(name);
++ }
++
++ @Override
++ public void removeMember(final String name) {
++ map.remove(name);
++ }
++
++ @Override
++ public Set<String> keySet() {
++ return map.keySet();
++ }
++
++ @Override
++ public Collection<Object> values() {
++ return map.values();
++ }
++ }
++
++ @Test
++ // Named property access on a JSObject
++ public void namedAccessTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ final MapWrapperObject obj = new MapWrapperObject();
++ e.put("obj", obj);
++ obj.getMap().put("foo", "bar");
++
++ // property-like access on MapWrapperObject objects
++ assertEquals(e.eval("obj.foo"), "bar");
++ e.eval("obj.foo = 'hello'");
++ assertEquals(e.eval("'foo' in obj"), Boolean.TRUE);
++ assertEquals(e.eval("obj.foo"), "hello");
++ assertEquals(obj.getMap().get("foo"), "hello");
++ e.eval("delete obj.foo");
++ assertFalse(obj.getMap().containsKey("foo"));
++ assertEquals(e.eval("'foo' in obj"), Boolean.FALSE);
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ // @bug 8062030: Nashorn bug retrieving array property after key string concatenation
++ @Test
++ // ConsString attribute access on a JSObject
++ public void consStringTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ final MapWrapperObject obj = new MapWrapperObject();
++ e.put("obj", obj);
++ e.put("f", "f");
++ e.eval("obj[f + 'oo'] = 'bar';");
++
++ assertEquals(obj.getMap().get("foo"), "bar");
++ assertEquals(e.eval("obj[f + 'oo']"), "bar");
++ assertEquals(e.eval("obj['foo']"), "bar");
++ assertEquals(e.eval("f + 'oo' in obj"), Boolean.TRUE);
++ assertEquals(e.eval("'foo' in obj"), Boolean.TRUE);
++ e.eval("delete obj[f + 'oo']");
++ assertFalse(obj.getMap().containsKey("foo"));
++ assertEquals(e.eval("obj[f + 'oo']"), null);
++ assertEquals(e.eval("obj['foo']"), null);
++ assertEquals(e.eval("f + 'oo' in obj"), Boolean.FALSE);
++ assertEquals(e.eval("'foo' in obj"), Boolean.FALSE);
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ public static class BufferObject extends AbstractJSObject {
++ private final IntBuffer buf;
++
++ public BufferObject(final int size) {
++ buf = IntBuffer.allocate(size);
++ }
++
++ public IntBuffer getBuffer() {
++ return buf;
++ }
++
++ @Override
++ public Object getMember(final String name) {
++ return name.equals("length")? buf.capacity() : null;
++ }
++
++ @Override
++ public boolean hasSlot(final int i) {
++ return i > -1 && i < buf.capacity();
++ }
++
++ @Override
++ public Object getSlot(final int i) {
++ return buf.get(i);
++ }
++
++ @Override
++ public void setSlot(final int i, final Object value) {
++ buf.put(i, ((Number)value).intValue());
++ }
++
++ @Override
++ public boolean isArray() {
++ return true;
++ }
++ }
++
++ @Test
++ // array-like indexed access for a JSObject
++ public void indexedAccessTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ final BufferObject buf = new BufferObject(2);
++ e.put("buf", buf);
++
++ // array-like access on BufferObject objects
++ assertEquals(e.eval("buf.length"), buf.getBuffer().capacity());
++ e.eval("buf[0] = 23");
++ assertEquals(buf.getBuffer().get(0), 23);
++ assertEquals(e.eval("buf[0]"), 23);
++ assertEquals(e.eval("buf[1]"), 0);
++ buf.getBuffer().put(1, 42);
++ assertEquals(e.eval("buf[1]"), 42);
++ assertEquals(e.eval("Array.isArray(buf)"), Boolean.TRUE);
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ public static class Adder extends AbstractJSObject {
++ @Override
++ public Object call(final Object thiz, final Object... args) {
++ double res = 0.0;
++ for (final Object arg : args) {
++ res += ((Number)arg).doubleValue();
++ }
++ return res;
++ }
++
++ @Override
++ public boolean isFunction() {
++ return true;
++ }
++ }
++
++ @Test
++ // a callable JSObject
++ public void callableJSObjectTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.put("sum", new Adder());
++ // check callability of Adder objects
++ assertEquals(e.eval("typeof sum"), "function");
++ assertEquals(((Number)e.eval("sum(1, 2, 3, 4, 5)")).intValue(), 15);
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ public static class Factory extends AbstractJSObject {
++ @SuppressWarnings("unused")
++ @Override
++ public Object newObject(final Object... args) {
++ return new HashMap<Object, Object>();
++ }
++
++ @Override
++ public boolean isFunction() {
++ return true;
++ }
++ }
++
++ @Test
++ // a factory JSObject
++ public void factoryJSObjectTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.put("Factory", new Factory());
++
++ // check new on Factory
++ assertEquals(e.eval("typeof Factory"), "function");
++ assertEquals(e.eval("typeof new Factory()"), "object");
++ assertEquals(e.eval("(new Factory()) instanceof java.util.Map"), Boolean.TRUE);
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ // iteration tests
++ public void iteratingJSObjectTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ final MapWrapperObject obj = new MapWrapperObject();
++ obj.setMember("foo", "hello");
++ obj.setMember("bar", "world");
++ e.put("obj", obj);
++
++ // check for..in
++ Object val = e.eval("var str = ''; for (i in obj) str += i; str");
++ assertEquals(val.toString(), "foobar");
++
++ // check for..each..in
++ val = e.eval("var str = ''; for each (i in obj) str += i; str");
++ assertEquals(val.toString(), "helloworld");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/ScopeTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,823 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertNotNull;
++import static org.testng.Assert.assertTrue;
++import static org.testng.Assert.fail;
++import javax.script.Bindings;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineFactory;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import javax.script.SimpleBindings;
++import javax.script.SimpleScriptContext;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import jdk.nashorn.api.scripting.ScriptObjectMirror;
++import jdk.nashorn.api.scripting.URLReader;
++import org.testng.Assert;
++import org.testng.annotations.Test;
++
++/**
++ * Tests for jsr223 Bindings "scope" (engine, global scopes)
++ */
++@SuppressWarnings("javadoc")
++public class ScopeTest {
++
++ @Test
++ public void createBindingsTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ b.put("foo", 42.0);
++ Object res = null;
++ try {
++ res = e.eval("foo == 42.0", b);
++ } catch (final ScriptException | NullPointerException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++
++ assertEquals(res, Boolean.TRUE);
++ }
++
++ @Test
++ public void engineScopeTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings engineScope = e.getBindings(ScriptContext.ENGINE_SCOPE);
++
++ // check few ECMA standard built-in global properties
++ assertNotNull(engineScope.get("Object"));
++ assertNotNull(engineScope.get("TypeError"));
++ assertNotNull(engineScope.get("eval"));
++
++ // can access via ScriptEngine.get as well
++ assertNotNull(e.get("Object"));
++ assertNotNull(e.get("TypeError"));
++ assertNotNull(e.get("eval"));
++
++ // Access by either way should return same object
++ assertEquals(engineScope.get("Array"), e.get("Array"));
++ assertEquals(engineScope.get("EvalError"), e.get("EvalError"));
++ assertEquals(engineScope.get("undefined"), e.get("undefined"));
++
++ // try exposing a new variable from scope
++ engineScope.put("myVar", "foo");
++ try {
++ assertEquals(e.eval("myVar"), "foo");
++ } catch (final ScriptException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++
++ // update "myVar" in script an check the value from scope
++ try {
++ e.eval("myVar = 'nashorn';");
++ } catch (final ScriptException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++
++ // now check modified value from scope and engine
++ assertEquals(engineScope.get("myVar"), "nashorn");
++ assertEquals(e.get("myVar"), "nashorn");
++ }
++
++ @Test
++ public void multiGlobalTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ try {
++ final Object obj1 = e.eval("Object");
++ final Object obj2 = e.eval("Object", newCtxt);
++ Assert.assertNotEquals(obj1, obj2);
++ Assert.assertNotNull(obj1);
++ Assert.assertNotNull(obj2);
++ Assert.assertEquals(obj1.toString(), obj2.toString());
++
++ e.eval("x = 'hello'");
++ e.eval("x = 'world'", newCtxt);
++ Object x1 = e.getContext().getAttribute("x");
++ Object x2 = newCtxt.getAttribute("x");
++ Assert.assertNotEquals(x1, x2);
++ Assert.assertEquals(x1, "hello");
++ Assert.assertEquals(x2, "world");
++
++ x1 = e.eval("x");
++ x2 = e.eval("x", newCtxt);
++ Assert.assertNotEquals(x1, x2);
++ Assert.assertEquals(x1, "hello");
++ Assert.assertEquals(x2, "world");
++
++ final ScriptContext origCtxt = e.getContext();
++ e.setContext(newCtxt);
++ e.eval("y = new Object()");
++ e.eval("y = new Object()", origCtxt);
++
++ final Object y1 = origCtxt.getAttribute("y");
++ final Object y2 = newCtxt.getAttribute("y");
++ Assert.assertNotEquals(y1, y2);
++ final Object yeval1 = e.eval("y");
++ final Object yeval2 = e.eval("y", origCtxt);
++ Assert.assertNotEquals(yeval1, yeval2);
++ Assert.assertEquals("[object Object]", y1.toString());
++ Assert.assertEquals("[object Object]", y2.toString());
++ } catch (final ScriptException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++ }
++
++ @Test
++ public void userEngineScopeBindingsTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.eval("function func() {}");
++
++ final ScriptContext newContext = new SimpleScriptContext();
++ newContext.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);
++ // we are using a new bindings - so it should have 'func' defined
++ final Object value = e.eval("typeof func", newContext);
++ assertTrue(value.equals("undefined"));
++ }
++
++ @Test
++ public void userEngineScopeBindingsNoLeakTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final ScriptContext newContext = new SimpleScriptContext();
++ newContext.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);
++ e.eval("function foo() {}", newContext);
++
++ // in the default context's ENGINE_SCOPE, 'foo' shouldn't exist
++ assertTrue(e.eval("typeof foo").equals("undefined"));
++ }
++
++ @Test
++ public void userEngineScopeBindingsRetentionTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final ScriptContext newContext = new SimpleScriptContext();
++ newContext.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);
++ e.eval("function foo() {}", newContext);
++
++ // definition retained with user's ENGINE_SCOPE Binding
++ assertTrue(e.eval("typeof foo", newContext).equals("function"));
++
++ final Bindings oldBindings = newContext.getBindings(ScriptContext.ENGINE_SCOPE);
++ // but not in another ENGINE_SCOPE binding
++ newContext.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);
++ assertTrue(e.eval("typeof foo", newContext).equals("undefined"));
++
++ // restore ENGINE_SCOPE and check again
++ newContext.setBindings(oldBindings, ScriptContext.ENGINE_SCOPE);
++ assertTrue(e.eval("typeof foo", newContext).equals("function"));
++ }
++
++ @Test
++ // check that engine.js definitions are visible in all new global instances
++ public void checkBuiltinsInNewBindingsTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ // check default global instance has engine.js definitions
++ final Bindings g = (Bindings) e.eval("this");
++ Object value = g.get("__noSuchProperty__");
++ assertTrue(value instanceof ScriptObjectMirror && ((ScriptObjectMirror)value).isFunction());
++ value = g.get("print");
++ assertTrue(value instanceof ScriptObjectMirror && ((ScriptObjectMirror)value).isFunction());
++
++ // check new global instance created has engine.js definitions
++ final Bindings b = e.createBindings();
++ value = b.get("__noSuchProperty__");
++ assertTrue(value instanceof ScriptObjectMirror && ((ScriptObjectMirror)value).isFunction());
++ value = b.get("print");
++ assertTrue(value instanceof ScriptObjectMirror && ((ScriptObjectMirror)value).isFunction());
++
++ // put a mapping into GLOBAL_SCOPE
++ final Bindings globalScope = e.getContext().getBindings(ScriptContext.GLOBAL_SCOPE);
++ globalScope.put("x", "hello");
++
++ // GLOBAL_SCOPE mapping should be visible from default ScriptContext eval
++ assertTrue(e.eval("x").equals("hello"));
++
++ final ScriptContext ctx = new SimpleScriptContext();
++ ctx.setBindings(globalScope, ScriptContext.GLOBAL_SCOPE);
++ ctx.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ // GLOBAL_SCOPE mapping should be visible from non-default ScriptContext eval
++ assertTrue(e.eval("x", ctx).equals("hello"));
++
++ // try some arbitray Bindings for ENGINE_SCOPE
++ final Bindings sb = new SimpleBindings();
++ ctx.setBindings(sb, ScriptContext.ENGINE_SCOPE);
++
++ // GLOBAL_SCOPE mapping should be visible from non-default ScriptContext eval
++ assertTrue(e.eval("x", ctx).equals("hello"));
++
++ // engine.js builtins are still defined even with arbitrary Bindings
++ assertTrue(e.eval("typeof print", ctx).equals("function"));
++ assertTrue(e.eval("typeof __noSuchProperty__", ctx).equals("function"));
++
++ // ENGINE_SCOPE definition should 'hide' GLOBAL_SCOPE definition
++ sb.put("x", "newX");
++ assertTrue(e.eval("x", ctx).equals("newX"));
++ }
++
++ /**
++ * Test multi-threaded access to defined global variables for shared script classes with multiple globals.
++ */
++ @Test
++ public static void multiThreadedVarTest() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++ final String sharedScript = "foo";
++
++ assertEquals(e.eval("var foo = 'original context';", origContext), null);
++ assertEquals(e.eval("var foo = 'new context';", newCtxt), null);
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ assertEquals(e.eval("var foo = 'newer context';", newCtxt), null);
++ final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
++
++ t3.start();
++ t4.start();
++ t3.join();
++ t4.join();
++
++ assertEquals(e.eval(sharedScript), "original context");
++ assertEquals(e.eval(sharedScript, newCtxt), "newer context");
++ }
++
++ /**
++ * Test multi-threaded access to undefined global variables for shared script classes with multiple globals.
++ */
++ @Test
++ public static void multiThreadedGlobalTest() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ assertEquals(e.eval("foo = 'original context';", origContext), "original context");
++ assertEquals(e.eval("foo = 'new context';", newCtxt), "new context");
++ final String sharedScript = "foo";
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ final Object obj3 = e.eval("delete foo; foo = 'newer context';", newCtxt);
++ assertEquals(obj3, "newer context");
++ final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
++
++ t3.start();
++ t4.start();
++ t3.join();
++ t4.join();
++
++ Assert.assertEquals(e.eval(sharedScript), "original context");
++ Assert.assertEquals(e.eval(sharedScript, newCtxt), "newer context");
++ }
++
++ /**
++ * Test multi-threaded access using the postfix ++ operator for shared script classes with multiple globals.
++ */
++ @Test
++ public static void multiThreadedIncTest() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ assertEquals(e.eval("var x = 0;", origContext), null);
++ assertEquals(e.eval("var x = 2;", newCtxt), null);
++ final String sharedScript = "x++;";
++
++ final Thread t1 = new Thread(new Runnable() {
++ @Override
++ public void run() {
++ try {
++ for (int i = 0; i < 1000; i++) {
++ assertEquals(e.eval(sharedScript, origContext), (double)i);
++ }
++ } catch (final ScriptException se) {
++ fail(se.toString());
++ }
++ }
++ });
++ final Thread t2 = new Thread(new Runnable() {
++ @Override
++ public void run() {
++ try {
++ for (int i = 2; i < 1000; i++) {
++ assertEquals(e.eval(sharedScript, newCtxt), (double)i);
++ }
++ } catch (final ScriptException se) {
++ fail(se.toString());
++ }
++ }
++ });
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++ }
++
++ /**
++ * Test multi-threaded access to primitive prototype properties for shared script classes with multiple globals.
++ */
++ @Test
++ public static void multiThreadedPrimitiveTest() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ final Object obj1 = e.eval("String.prototype.foo = 'original context';", origContext);
++ final Object obj2 = e.eval("String.prototype.foo = 'new context';", newCtxt);
++ assertEquals(obj1, "original context");
++ assertEquals(obj2, "new context");
++ final String sharedScript = "''.foo";
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ final Object obj3 = e.eval("delete String.prototype.foo; Object.prototype.foo = 'newer context';", newCtxt);
++ assertEquals(obj3, "newer context");
++ final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
++
++ t3.start();
++ t4.start();
++ t3.join();
++ t4.join();
++
++ Assert.assertEquals(e.eval(sharedScript), "original context");
++ Assert.assertEquals(e.eval(sharedScript, newCtxt), "newer context");
++ }
++
++
++ /**
++ * Test multi-threaded access to prototype user accessor properties for shared script classes with multiple globals.
++ */
++ @Test
++ public static void multiThreadedAccessorTest() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ e.eval("Object.defineProperty(Object.prototype, 'foo', { get: function() 'original context' })", origContext);
++ e.eval("Object.defineProperty(Object.prototype, 'foo', { get: function() 'new context', configurable: true })", newCtxt);
++ final String sharedScript = "({}).foo";
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ final Object obj3 = e.eval("delete Object.prototype.foo; Object.prototype.foo = 'newer context';", newCtxt);
++ assertEquals(obj3, "newer context");
++ final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
++
++ t3.start();
++ t4.start();
++ t3.join();
++ t4.join();
++ }
++
++ /**
++ * Test multi-threaded access to primitive prototype user accessor properties for shared script classes with multiple globals.
++ */
++ @Test
++ public static void multiThreadedPrimitiveAccessorTest() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ e.eval("Object.defineProperty(String.prototype, 'foo', { get: function() 'original context' })", origContext);
++ e.eval("Object.defineProperty(String.prototype, 'foo', { get: function() 'new context' })", newCtxt);
++ final String sharedScript = "''.foo";
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ final Object obj3 = e.eval("delete String.prototype.foo; Object.prototype.foo = 'newer context';", newCtxt);
++ assertEquals(obj3, "newer context");
++ final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
++
++ t3.start();
++ t4.start();
++ t3.join();
++ t4.join();
++ }
++
++ /**
++ * Test multi-threaded scope function invocation for shared script classes with multiple globals.
++ */
++ @Test
++ public static void multiThreadedFunctionTest() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ e.eval(new URLReader(ScopeTest.class.getResource("resources/func.js")), origContext);
++ assertEquals(origContext.getAttribute("scopeVar"), 1);
++ assertEquals(e.eval("scopeTest()"), 1);
++
++ e.eval(new URLReader(ScopeTest.class.getResource("resources/func.js")), newCtxt);
++ assertEquals(newCtxt.getAttribute("scopeVar"), 1);
++ assertEquals(e.eval("scopeTest();", newCtxt), 1);
++
++ assertEquals(e.eval("scopeVar = 3;", newCtxt), 3);
++ assertEquals(newCtxt.getAttribute("scopeVar"), 3);
++
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, "scopeTest()", 1, 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, "scopeTest()", 3, 1000));
++
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ }
++
++ /**
++ * Test multi-threaded access to global getters and setters for shared script classes with multiple globals.
++ */
++ @Test
++ public static void getterSetterTest() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++ final String sharedScript = "accessor1";
++
++ e.eval(new URLReader(ScopeTest.class.getResource("resources/gettersetter.js")), origContext);
++ assertEquals(e.eval("accessor1 = 1;"), 1);
++ assertEquals(e.eval(sharedScript), 1);
++
++ e.eval(new URLReader(ScopeTest.class.getResource("resources/gettersetter.js")), newCtxt);
++ assertEquals(e.eval("accessor1 = 2;", newCtxt), 2);
++ assertEquals(e.eval(sharedScript, newCtxt), 2);
++
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, 1, 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, 2, 1000));
++
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ assertEquals(e.eval(sharedScript), 1);
++ assertEquals(e.eval(sharedScript, newCtxt), 2);
++ assertEquals(e.eval("v"), 1);
++ assertEquals(e.eval("v", newCtxt), 2);
++ }
++
++ /**
++ * Test multi-threaded access to global getters and setters for shared script classes with multiple globals.
++ */
++ @Test
++ public static void getterSetter2Test() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++ final String sharedScript = "accessor2";
++
++ e.eval(new URLReader(ScopeTest.class.getResource("resources/gettersetter.js")), origContext);
++ assertEquals(e.eval("accessor2 = 1;"), 1);
++ assertEquals(e.eval(sharedScript), 1);
++
++ e.eval(new URLReader(ScopeTest.class.getResource("resources/gettersetter.js")), newCtxt);
++ assertEquals(e.eval("accessor2 = 2;", newCtxt), 2);
++ assertEquals(e.eval(sharedScript, newCtxt), 2);
++
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, 1, 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, 2, 1000));
++
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ assertEquals(e.eval(sharedScript), 1);
++ assertEquals(e.eval(sharedScript, newCtxt), 2);
++ assertEquals(e.eval("x"), 1);
++ assertEquals(e.eval("x", newCtxt), 2);
++ }
++
++ // @bug 8058422: Users should be able to overwrite "context" and "engine" variables
++ @Test
++ public static void contextOverwriteTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = new SimpleBindings();
++ b.put("context", "hello");
++ b.put("foo", 32);
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++ e.setContext(newCtxt);
++ assertEquals(e.eval("context"), "hello");
++ assertEquals(((Number)e.eval("foo")).intValue(), 32);
++ }
++
++ // @bug 8058422: Users should be able to overwrite "context" and "engine" variables
++ @Test
++ public static void contextOverwriteInScriptTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.put("foo", 32);
++
++ assertEquals(((Number)e.eval("foo")).intValue(), 32);
++ assertEquals(e.eval("context = 'bar'"), "bar");
++ assertEquals(((Number)e.eval("foo")).intValue(), 32);
++ }
++
++ // @bug 8058422: Users should be able to overwrite "context" and "engine" variables
++ @Test
++ public static void engineOverwriteTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Bindings b = new SimpleBindings();
++ b.put("engine", "hello");
++ b.put("foo", 32);
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++ e.setContext(newCtxt);
++ assertEquals(e.eval("engine"), "hello");
++ assertEquals(((Number)e.eval("foo")).intValue(), 32);
++ }
++
++ // @bug 8058422: Users should be able to overwrite "context" and "engine" variables
++ @Test
++ public static void engineOverwriteInScriptTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.put("foo", 32);
++
++ assertEquals(((Number)e.eval("foo")).intValue(), 32);
++ assertEquals(e.eval("engine = 'bar'"), "bar");
++ assertEquals(((Number)e.eval("foo")).intValue(), 32);
++ }
++
++ // @bug 8044750: megamorphic getter for scope objects does not call __noSuchProperty__ hook
++ @Test
++ public static void testMegamorphicGetInGlobal() throws Exception {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine engine = m.getEngineByName("nashorn");
++ final String script = "foo";
++ // "foo" is megamorphic because of different global scopes.
++ // Make sure ScriptContext variable search works even after
++ // it becomes megamorphic.
++ for (int index = 0; index < 25; index++) {
++ final Bindings bindings = new SimpleBindings();
++ bindings.put("foo", index);
++ final Number value = (Number)engine.eval(script, bindings);
++ assertEquals(index, value.intValue());
++ }
++ }
++
++ /**
++ * Test "slow" scopes involving {@code with} and {@code eval} statements for shared script classes with multiple globals.
++ * @throws ScriptException
++ * @throws InterruptedException
++ */
++ @Test
++ public static void testSlowScope() throws ScriptException, InterruptedException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ for (int i = 0; i < 100; i++) {
++ final Bindings b = e.createBindings();
++ final ScriptContext ctxt = new SimpleScriptContext();
++ ctxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++
++ e.eval(new URLReader(ScopeTest.class.getResource("resources/witheval.js")), ctxt);
++ assertEquals(e.eval("a", ctxt), 1);
++ assertEquals(b.get("a"), 1);
++ assertEquals(e.eval("b", ctxt), 3);
++ assertEquals(b.get("b"), 3);
++ assertEquals(e.eval("c", ctxt), 10);
++ assertEquals(b.get("c"), 10);
++ }
++ }
++
++ private static class ScriptRunner implements Runnable {
++
++ final ScriptEngine engine;
++ final ScriptContext context;
++ final String source;
++ final Object expected;
++ final int iterations;
++
++ ScriptRunner(final ScriptEngine engine, final ScriptContext context, final String source, final Object expected, final int iterations) {
++ this.engine = engine;
++ this.context = context;
++ this.source = source;
++ this.expected = expected;
++ this.iterations = iterations;
++ }
++
++ @Override
++ public void run() {
++ try {
++ for (int i = 0; i < iterations; i++) {
++ assertEquals(engine.eval(source, context), expected);
++ }
++ } catch (final ScriptException se) {
++ throw new RuntimeException(se);
++ }
++ }
++ }
++
++ // @bug 8071678: NashornScriptEngine returns javax.script.ScriptContext instance
++ // with get/setAttribute methods insonsistent for GLOBAL_SCOPE
++ @Test
++ public void testGlobalScopeSearch() throws Exception {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final ScriptContext c = e.getContext();
++ c.setAttribute("name1234", "value", ScriptContext.GLOBAL_SCOPE);
++ assertEquals(c.getAttribute("name1234"), "value");
++ assertEquals(c.getAttributesScope("name1234"),
++ ScriptContext.GLOBAL_SCOPE);
++ }
++
++ // @bug 8071594: NashornScriptEngine returns javax.script.ScriptContext instance
++ // which doesn't completely conform to the spec regarding exceptions throwing
++ @Test
++ public void testScriptContext_NPE_IAE() throws Exception {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final ScriptContext c = e.getContext();
++ try {
++ c.getAttribute("");
++ throw new AssertionError("should have thrown IAE");
++ } catch (IllegalArgumentException iae1) {}
++
++ try {
++ c.getAttribute(null);
++ throw new AssertionError("should have thrown NPE");
++ } catch (NullPointerException npe1) {}
++
++ try {
++ c.getAttribute("", ScriptContext.ENGINE_SCOPE);
++ throw new AssertionError("should have thrown IAE");
++ } catch (IllegalArgumentException iae2) {}
++
++ try {
++ c.getAttribute(null, ScriptContext.ENGINE_SCOPE);
++ throw new AssertionError("should have thrown NPE");
++ } catch (NullPointerException npe2) {}
++
++ try {
++ c.removeAttribute("", ScriptContext.ENGINE_SCOPE);
++ throw new AssertionError("should have thrown IAE");
++ } catch (IllegalArgumentException iae3) {}
++
++ try {
++ c.removeAttribute(null, ScriptContext.ENGINE_SCOPE);
++ throw new AssertionError("should have thrown NPE");
++ } catch (NullPointerException npe3) {}
++
++ try {
++ c.setAttribute("", "value", ScriptContext.ENGINE_SCOPE);
++ throw new AssertionError("should have thrown IAE");
++ } catch (IllegalArgumentException iae4) {}
++
++ try {
++ c.setAttribute(null, "value", ScriptContext.ENGINE_SCOPE);
++ throw new AssertionError("should have thrown NPE");
++ } catch (NullPointerException npe4) {}
++
++ try {
++ c.getAttributesScope("");
++ throw new AssertionError("should have thrown IAE");
++ } catch (IllegalArgumentException iae5) {}
++
++ try {
++ c.getAttributesScope(null);
++ throw new AssertionError("should have thrown NPE");
++ } catch (NullPointerException npe5) {}
++ }
++
++ public static class RecursiveEval {
++ private final ScriptEngineFactory factory = new NashornScriptEngineFactory();
++ private final ScriptEngine engine = factory.getScriptEngine();
++ private final Bindings engineBindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);
++
++ public void program() throws ScriptException {
++ ScriptContext sc = new SimpleScriptContext();
++ Bindings global = new SimpleBindings();
++ sc.setBindings(global, ScriptContext.GLOBAL_SCOPE);
++ sc.setBindings(engineBindings, ScriptContext.ENGINE_SCOPE);
++ global.put("text", "programText");
++ String value = engine.eval("text", sc).toString();
++ Assert.assertEquals(value, "programText");
++ engine.put("program", this);
++ engine.eval("program.method()");
++ // eval again from here!
++ value = engine.eval("text", sc).toString();
++ Assert.assertEquals(value, "programText");
++ }
++
++ public void method() throws ScriptException {
++ // a context with a new global bindings, same engine bindings
++ final ScriptContext sc = new SimpleScriptContext();
++ final Bindings global = new SimpleBindings();
++ sc.setBindings(global, ScriptContext.GLOBAL_SCOPE);
++ sc.setBindings(engineBindings, ScriptContext.ENGINE_SCOPE);
++ global.put("text", "methodText");
++ String value = engine.eval("text", sc).toString();
++ Assert.assertEquals(value, "methodText");
++ }
++ }
++
++ // @bug 8081609: engine.eval call from a java method which
++ // was called from a previous engine.eval results in wrong
++ // ScriptContext being used.
++ @Test
++ public void recursiveEvalCallScriptContextTest() throws ScriptException {
++ new RecursiveEval().program();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptEngineSecurityTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,313 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++import static org.testng.Assert.fail;
++import java.lang.reflect.InvocationHandler;
++import java.lang.reflect.Method;
++import java.lang.reflect.Proxy;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import jdk.nashorn.api.scripting.ClassFilter;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import org.testng.annotations.Test;
++
++/**
++ * jsr223 tests for security access checks.
++ */
++@SuppressWarnings("javadoc")
++public class ScriptEngineSecurityTest {
++
++ private static void log(final String msg) {
++ org.testng.Reporter.log(msg, true);
++ }
++
++ @Test
++ public void securityPackagesTest() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("var v = Packages.sun.misc.Unsafe;");
++ fail("should have thrown SecurityException");
++ } catch (final Exception exp) {
++ if (exp instanceof SecurityException) {
++ log("got " + exp + " as expected");
++ } else {
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ public void securityJavaTypeTest() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("var v = Java.type('sun.misc.Unsafe');");
++ fail("should have thrown SecurityException");
++ } catch (final Exception exp) {
++ if (exp instanceof SecurityException) {
++ log("got " + exp + " as expected");
++ } else {
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ public void securityClassForNameTest() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("var v = java.lang.Class.forName('sun.misc.Unsafe');");
++ fail("should have thrown SecurityException");
++ } catch (final Exception exp) {
++ if (exp instanceof SecurityException) {
++ log("got " + exp + " as expected");
++ } else {
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ @Test
++ public void securitySystemExit() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("java.lang.System.exit(0);");
++ fail("should have thrown SecurityException");
++ } catch (final Exception exp) {
++ if (exp instanceof SecurityException) {
++ log("got " + exp + " as expected");
++ } else {
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++
++ @Test
++ public void securitySystemExitFromFinalizerThread() throws ScriptException {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.eval("var o = Java.extend(Java.type('javax.imageio.spi.ServiceRegistry'), { deregisterAll: this.exit.bind(null, 1234)});\n" +
++ "new o(new java.util.ArrayList().iterator())");
++ System.gc();
++ System.runFinalization();
++ // NOTE: this test just exits the VM if it fails.
++ }
++
++ @Test
++ public void securitySystemLoadLibrary() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("java.lang.System.loadLibrary('foo');");
++ fail("should have thrown SecurityException");
++ } catch (final Exception exp) {
++ if (exp instanceof SecurityException) {
++ log("got " + exp + " as expected");
++ } else {
++ fail(exp.getMessage());
++ }
++ }
++ }
++
++ // @bug 8032948: Nashorn linkages awry
++ @SuppressWarnings("serial")
++ public static class FakeProxy extends Proxy {
++ public FakeProxy(final InvocationHandler ih) {
++ super(ih);
++ }
++
++ public static Class<?> makeProxyClass(final ClassLoader cl, final Class<?>... ifaces) {
++ return Proxy.getProxyClass(cl, ifaces);
++ }
++ }
++
++ @Test
++ public void fakeProxySubclassAccessCheckTest() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ e.put("name", ScriptEngineSecurityTest.class.getName());
++ e.put("cl", ScriptEngineSecurityTest.class.getClassLoader());
++ e.put("intfs", new Class[] { Runnable.class });
++
++ final String getClass = "Java.type(name + '$FakeProxy').getProxyClass(cl, intfs);";
++
++ // Should not be able to call static methods of Proxy via fake subclass
++ try {
++ e.eval(getClass);
++ fail("should have thrown SecurityException");
++ } catch (final Exception exp) {
++ if (! (exp instanceof SecurityException)) {
++ fail("SecurityException expected, got " + exp);
++ }
++ }
++ }
++
++ @Test
++ public void fakeProxySubclassAccessCheckTest2() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ e.put("name", ScriptEngineSecurityTest.class.getName());
++ e.put("cl", ScriptEngineSecurityTest.class.getClassLoader());
++ e.put("intfs", new Class[] { Runnable.class });
++
++ final String getClass = "Java.type(name + '$FakeProxy').makeProxyClass(cl, intfs);";
++
++ // Should not be able to call static methods of Proxy via fake subclass
++ try {
++ e.eval(getClass);
++ fail("should have thrown SecurityException");
++ } catch (final Exception exp) {
++ if (! (exp instanceof SecurityException)) {
++ fail("SecurityException expected, got " + exp);
++ }
++ }
++ }
++
++ @Test
++ public static void proxyStaticAccessCheckTest() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Runnable r = (Runnable)Proxy.newProxyInstance(
++ ScriptEngineTest.class.getClassLoader(),
++ new Class[] { Runnable.class },
++ new InvocationHandler() {
++ @Override
++ public Object invoke(final Object p, final Method mtd, final Object[] a) {
++ return null;
++ }
++ });
++
++ e.put("rc", r.getClass());
++ e.put("cl", ScriptEngineSecurityTest.class.getClassLoader());
++ e.put("intfs", new Class[] { Runnable.class });
++
++ // make sure static methods of Proxy is not accessible via subclass
++ try {
++ e.eval("rc.static.getProxyClass(cl, intfs)");
++ fail("Should have thrown SecurityException");
++ } catch (final Exception exp) {
++ if (! (exp instanceof SecurityException)) {
++ fail("SecurityException expected, got " + exp);
++ }
++ }
++ }
++
++
++ @Test
++ public void nashornConfigSecurityTest() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ try {
++ fac.getScriptEngine(new ClassFilter() {
++ @Override
++ public boolean exposeToScripts(final String name) {
++ return true;
++ }
++ });
++ fail("SecurityException should have been thrown");
++ } catch (final SecurityException e) {
++ //empty
++ }
++ }
++
++ @Test
++ public void nashornConfigSecurityTest2() {
++ if (System.getSecurityManager() == null) {
++ // pass vacuously
++ return;
++ }
++
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ try {
++ fac.getScriptEngine(new String[0], null, new ClassFilter() {
++ @Override
++ public boolean exposeToScripts(final String name) {
++ return true;
++ }
++ });
++ fail("SecurityException should have been thrown");
++ } catch (final SecurityException e) {
++ //empty
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptEngineTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,881 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertNotNull;
++import static org.testng.Assert.assertNull;
++import static org.testng.Assert.assertTrue;
++import static org.testng.Assert.fail;
++
++import java.io.StringReader;
++import java.io.StringWriter;
++import java.lang.reflect.InvocationHandler;
++import java.lang.reflect.Method;
++import java.lang.reflect.Proxy;
++import java.util.Collections;
++import java.util.concurrent.Callable;
++import java.util.concurrent.atomic.AtomicBoolean;
++import java.util.function.Consumer;
++import java.util.function.Function;
++import javax.script.Bindings;
++import javax.script.Compilable;
++import javax.script.CompiledScript;
++import javax.script.Invocable;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineFactory;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import javax.script.SimpleScriptContext;
++import jdk.nashorn.api.scripting.ScriptObjectMirror;
++import org.testng.annotations.Test;
++
++/**
++ * Tests for JSR-223 script engine for Nashorn.
++ *
++ * @test
++ * @build jdk.nashorn.api.scripting.test.Window jdk.nashorn.api.scripting.test.WindowEventHandler jdk.nashorn.api.scripting.test.VariableArityTestInterface jdk.nashorn.api.scripting.test.ScriptEngineTest
++ * @run testng/othervm jdk.nashorn.api.scripting.test.ScriptEngineTest
++ */
++@SuppressWarnings("javadoc")
++public class ScriptEngineTest {
++
++ private static void log(final String msg) {
++ org.testng.Reporter.log(msg, true);
++ }
++
++ @Test
++ public void argumentsTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ final String[] args = new String[] { "hello", "world" };
++ try {
++ e.put("arguments", args);
++ final Object arg0 = e.eval("arguments[0]");
++ final Object arg1 = e.eval("arguments[1]");
++ assertEquals(args[0], arg0);
++ assertEquals(args[1], arg1);
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void argumentsWithTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ final String[] args = new String[] { "hello", "world" };
++ try {
++ e.put("arguments", args);
++ final Object arg0 = e.eval("var imports = new JavaImporter(java.io); " +
++ " with(imports) { arguments[0] }");
++ final Object arg1 = e.eval("var imports = new JavaImporter(java.util, java.io); " +
++ " with(imports) { arguments[1] }");
++ assertEquals(args[0], arg0);
++ assertEquals(args[1], arg1);
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void argumentsEmptyTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ assertEquals(e.eval("arguments instanceof Array"), true);
++ assertEquals(e.eval("arguments.length == 0"), true);
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void factoryTests() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ assertNotNull(e);
++
++ final ScriptEngineFactory fac = e.getFactory();
++
++ assertEquals(fac.getLanguageName(), "ECMAScript");
++ assertEquals(fac.getParameter(ScriptEngine.NAME), "javascript");
++ assertEquals(fac.getLanguageVersion(), "ECMA - 262 Edition 5.1");
++ assertEquals(fac.getEngineName(), "Oracle Nashorn");
++ assertEquals(fac.getOutputStatement("context"), "print(context)");
++ assertEquals(fac.getProgram("print('hello')", "print('world')"), "print('hello');print('world');");
++ assertEquals(fac.getParameter(ScriptEngine.NAME), "javascript");
++
++ boolean seenJS = false;
++ for (final String ext : fac.getExtensions()) {
++ if (ext.equals("js")) {
++ seenJS = true;
++ }
++ }
++
++ assertEquals(seenJS, true);
++ final String str = fac.getMethodCallSyntax("obj", "foo", "x");
++ assertEquals(str, "obj.foo(x)");
++
++ boolean seenNashorn = false, seenJavaScript = false, seenECMAScript = false;
++ for (final String name : fac.getNames()) {
++ switch (name) {
++ case "nashorn": seenNashorn = true; break;
++ case "javascript": seenJavaScript = true; break;
++ case "ECMAScript": seenECMAScript = true; break;
++ default:
++ break;
++ }
++ }
++
++ assertTrue(seenNashorn);
++ assertTrue(seenJavaScript);
++ assertTrue(seenECMAScript);
++
++ boolean seenAppJS = false, seenAppECMA = false, seenTextJS = false, seenTextECMA = false;
++ for (final String mime : fac.getMimeTypes()) {
++ switch (mime) {
++ case "application/javascript": seenAppJS = true; break;
++ case "application/ecmascript": seenAppECMA = true; break;
++ case "text/javascript": seenTextJS = true; break;
++ case "text/ecmascript": seenTextECMA = true; break;
++ default:
++ break;
++ }
++ }
++
++ assertTrue(seenAppJS);
++ assertTrue(seenAppECMA);
++ assertTrue(seenTextJS);
++ assertTrue(seenTextECMA);
++ }
++
++ @Test
++ public void evalTests() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.put(ScriptEngine.FILENAME, "myfile.js");
++
++ try {
++ e.eval("print('hello')");
++ } catch (final ScriptException se) {
++ fail(se.getMessage());
++ }
++ try {
++ e.eval("print('hello)");
++ fail("script exception expected");
++ } catch (final ScriptException se) {
++ assertEquals(se.getLineNumber(), 1);
++ assertEquals(se.getColumnNumber(), 13);
++ assertEquals(se.getFileName(), "myfile.js");
++ // se.printStackTrace();
++ }
++
++ try {
++ Object obj = e.eval("34 + 41");
++ assertTrue(34.0 + 41.0 == ((Number)obj).doubleValue());
++ obj = e.eval("x = 5");
++ assertTrue(5.0 == ((Number)obj).doubleValue());
++ } catch (final ScriptException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++ }
++
++ @Test
++ public void compileTests() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ CompiledScript script = null;
++
++ try {
++ script = ((Compilable)e).compile("print('hello')");
++ } catch (final ScriptException se) {
++ fail(se.getMessage());
++ }
++
++ try {
++ script.eval();
++ } catch (final ScriptException | NullPointerException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++
++ // try to compile from a Reader
++ try {
++ script = ((Compilable)e).compile(new StringReader("print('world')"));
++ } catch (final ScriptException se) {
++ fail(se.getMessage());
++ }
++
++ try {
++ script.eval();
++ } catch (final ScriptException | NullPointerException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++ }
++
++ @Test
++ public void compileAndEvalInDiffContextTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine engine = m.getEngineByName("js");
++ final Compilable compilable = (Compilable) engine;
++ final CompiledScript compiledScript = compilable.compile("foo");
++ final ScriptContext ctxt = new SimpleScriptContext();
++ ctxt.setAttribute("foo", "hello", ScriptContext.ENGINE_SCOPE);
++ assertEquals(compiledScript.eval(ctxt), "hello");
++ }
++
++ @Test
++ public void accessGlobalTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ e.eval("var x = 'hello'");
++ assertEquals(e.get("x"), "hello");
++ } catch (final ScriptException exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void exposeGlobalTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ e.put("y", "foo");
++ e.eval("print(y)");
++ } catch (final ScriptException exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void putGlobalFunctionTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ e.put("callable", new Callable<String>() {
++ @Override
++ public String call() throws Exception {
++ return "callable was called";
++ }
++ });
++
++ try {
++ e.eval("print(callable.call())");
++ } catch (final ScriptException exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void windowAlertTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Window window = new Window();
++
++ try {
++ e.put("window", window);
++ e.eval("print(window.alert)");
++ e.eval("window.alert('calling window.alert...')");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void windowLocationTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Window window = new Window();
++
++ try {
++ e.put("window", window);
++ e.eval("print(window.location)");
++ final Object locationValue = e.eval("window.getLocation()");
++ assertEquals(locationValue, "http://localhost:8080/window");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void windowItemTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Window window = new Window();
++
++ try {
++ e.put("window", window);
++ final String item1 = (String)e.eval("window.item(65535)");
++ assertEquals(item1, "ffff");
++ final String item2 = (String)e.eval("window.item(255)");
++ assertEquals(item2, "ff");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void windowEventTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Window window = new Window();
++
++ try {
++ e.put("window", window);
++ e.eval("window.onload = function() { print('window load event fired'); return true }");
++ assertTrue((Boolean)e.eval("window.onload.loaded()"));
++ final WindowEventHandler handler = window.getOnload();
++ assertNotNull(handler);
++ assertTrue(handler.loaded());
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void throwTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.put(ScriptEngine.FILENAME, "throwtest.js");
++
++ try {
++ e.eval("throw 'foo'");
++ } catch (final ScriptException exp) {
++ log(exp.getMessage());
++ assertEquals(exp.getMessage(), "foo in throwtest.js at line number 1 at column number 0");
++ assertEquals(exp.getFileName(), "throwtest.js");
++ assertEquals(exp.getLineNumber(), 1);
++ }
++ }
++
++ @Test
++ public void setTimeoutTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final Window window = new Window();
++
++ try {
++ final Class<?> setTimeoutParamTypes[] = { Window.class, String.class, int.class };
++ final Method setTimeout = Window.class.getDeclaredMethod("setTimeout", setTimeoutParamTypes);
++ assertNotNull(setTimeout);
++ e.put("window", window);
++ e.eval("window.setTimeout('foo()', 100)");
++
++ // try to make setTimeout global
++ e.put("setTimeout", setTimeout);
++ // TODO: java.lang.ClassCastException: required class
++ // java.lang.Integer but encountered class java.lang.Double
++ // e.eval("setTimeout('foo2()', 200)");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void setWriterTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final StringWriter sw = new StringWriter();
++ e.getContext().setWriter(sw);
++
++ try {
++ e.eval("print('hello world')");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ assertEquals(sw.toString(), println("hello world"));
++ }
++
++ @Test
++ public void redefineEchoTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ try {
++ e.eval("var echo = {}; if (typeof echo !== 'object') { throw 'echo is a '+typeof echo; }");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++ @Test
++ public void noEnumerablePropertiesTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("for (i in this) { throw 'found property: ' + i }");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void noRefErrorForGlobalThisAccessTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("this.foo");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void refErrorForUndeclaredAccessTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("try { print(foo); throw 'no ref error' } catch (e) { if (!(e instanceof ReferenceError)) throw e; }");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void typeErrorForGlobalThisCallTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("try { this.foo() } catch(e) { if (! (e instanceof TypeError)) throw 'no type error' }");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void refErrorForUndeclaredCallTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("try { foo() } catch(e) { if (! (e instanceof ReferenceError)) throw 'no ref error' }");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ // check that print function prints arg followed by newline char
++ public void printTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final StringWriter sw = new StringWriter();
++ e.getContext().setWriter(sw);
++ try {
++ e.eval("print('hello')");
++ } catch (final Throwable t) {
++ t.printStackTrace();
++ fail(t.getMessage());
++ }
++
++ assertEquals(sw.toString(), println("hello"));
++ }
++
++ @Test
++ // check that print prints all arguments (more than one)
++ public void printManyTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final StringWriter sw = new StringWriter();
++ e.getContext().setWriter(sw);
++ try {
++ e.eval("print(34, true, 'hello')");
++ } catch (final Throwable t) {
++ t.printStackTrace();
++ fail(t.getMessage());
++ }
++
++ assertEquals(sw.toString(), println("34 true hello"));
++ }
++
++ @Test
++ public void scriptObjectAutoConversionTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.eval("obj = { foo: 'hello' }");
++ e.put("Window", e.eval("Packages.jdk.nashorn.api.scripting.test.Window"));
++ assertEquals(e.eval("Window.funcJSObject(obj)"), "hello");
++ assertEquals(e.eval("Window.funcScriptObjectMirror(obj)"), "hello");
++ assertEquals(e.eval("Window.funcMap(obj)"), "hello");
++ assertEquals(e.eval("Window.funcJSObject(obj)"), "hello");
++ }
++
++ // @bug 8032948: Nashorn linkages awry
++ @Test
++ public void checkProxyAccess() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final boolean[] reached = new boolean[1];
++ final Runnable r = (Runnable)Proxy.newProxyInstance(
++ ScriptEngineTest.class.getClassLoader(),
++ new Class[] { Runnable.class },
++ new InvocationHandler() {
++ @Override
++ public Object invoke(final Object p, final Method mtd, final Object[] a) {
++ reached[0] = true;
++ return null;
++ }
++ });
++
++ e.put("r", r);
++ e.eval("r.run()");
++
++ assertTrue(reached[0]);
++ }
++
++ // properties that can be read by any code
++ private static String[] propNames = {
++ "java.version",
++ "java.vendor",
++ "java.vendor.url",
++ "java.class.version",
++ "os.name",
++ "os.version",
++ "os.arch",
++ "file.separator",
++ "path.separator",
++ "line.separator",
++ "java.specification.version",
++ "java.specification.vendor",
++ "java.specification.name",
++ "java.vm.specification.version",
++ "java.vm.specification.vendor",
++ "java.vm.specification.name",
++ "java.vm.version",
++ "java.vm.vendor",
++ "java.vm.name"
++ };
++
++ // @bug 8033924: Default permissions are not given for eval code
++ @Test
++ public void checkPropertyReadPermissions() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ for (final String name : propNames) {
++ checkProperty(e, name);
++ }
++ }
++
++ // @bug 8046013: TypeError: Cannot apply "with" to non script object
++ @Test
++ public void withOnMirrorTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ final Object obj = e.eval("({ foo: 'hello'})");
++ final Object[] arr = new Object[1];
++ arr[0] = obj;
++ e.put("arr", arr);
++ final Object res = e.eval("var res; with(arr[0]) { res = foo; }; res");
++ assertEquals(res, "hello");
++ }
++
++ // @bug 8054223: Nashorn: AssertionError when use __DIR__ and ScriptEngine.eval()
++ @Test
++ public void check__DIR__Test() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ e.eval("__DIR__");
++ }
++
++ // @bug 8050432:javax.script.filename variable should not be enumerable
++ // with nashorn engine's ENGINE_SCOPE bindings
++ @Test
++ public void enumerableGlobalsTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ e.put(ScriptEngine.FILENAME, "test");
++ final Object enumerable = e.eval(
++ "Object.getOwnPropertyDescriptor(this, " +
++ " 'javax.script.filename').enumerable");
++ assertEquals(enumerable, Boolean.FALSE);
++ }
++
++ public static class Context {
++ private Object myobj;
++
++ public void set(final Object o) {
++ myobj = o;
++ }
++
++ public Object get() {
++ return myobj;
++ }
++ }
++
++ // @bug 8050977: Java8 Javascript Nashorn exception:
++ // no current Global instance for nashorn
++ @Test
++ public void currentGlobalMissingTest() throws Exception {
++ final ScriptEngineManager manager = new ScriptEngineManager();
++ final ScriptEngine e = manager.getEngineByName("nashorn");
++
++ final Context ctx = new Context();
++ e.put("ctx", ctx);
++ e.eval("var obj = { foo: function(str) { return str.toUpperCase() } }");
++ e.eval("ctx.set(obj)");
++ final Invocable inv = (Invocable)e;
++ assertEquals("HELLO", inv.invokeMethod(ctx.get(), "foo", "hello"));
++ // try object literal
++ e.eval("ctx.set({ bar: function(str) { return str.toLowerCase() } })");
++ assertEquals("hello", inv.invokeMethod(ctx.get(), "bar", "HELLO"));
++ // try array literal
++ e.eval("var arr = [ 'hello', 'world' ]");
++ e.eval("ctx.set(arr)");
++ assertEquals("helloworld", inv.invokeMethod(ctx.get(), "join", ""));
++ }
++
++ // @bug 8068524: NashornScriptEngineFactory.getParameter() throws IAE
++ // for an unknown key, doesn't conform to the general spec
++ @Test
++ public void getParameterInvalidKeyTest() throws Exception {
++ final ScriptEngineManager manager = new ScriptEngineManager();
++ final ScriptEngine e = manager.getEngineByName("nashorn");
++ // no exception expected here!
++ Object value = e.getFactory().getParameter("no value assigned to this key");
++ assertNull(value);
++ }
++
++ // @bug JDK-8068889: ConsString arguments to a functional interface wasn't converted to string.
++ @Test
++ public void functionalInterfaceStringTest() throws Exception {
++ final ScriptEngineManager manager = new ScriptEngineManager();
++ final ScriptEngine e = manager.getEngineByName("nashorn");
++ final AtomicBoolean invoked = new AtomicBoolean(false);
++ e.put("f", new Function<String, String>() {
++ @Override
++ public String apply(String t) {
++ invoked.set(true);
++ return t;
++ }
++ });
++ assertEquals(e.eval("var x = 'a'; x += 'b'; f(x)"), "ab");
++ assertTrue(invoked.get());
++ }
++
++ // @bug JDK-8068889: ScriptObject arguments to a functional interface wasn't converted to a mirror.
++ @Test
++ public void functionalInterfaceObjectTest() throws Exception {
++ final ScriptEngineManager manager = new ScriptEngineManager();
++ final ScriptEngine e = manager.getEngineByName("nashorn");
++ final AtomicBoolean invoked = new AtomicBoolean(false);
++ e.put("c", new Consumer<Object>() {
++ @Override
++ public void accept(Object t) {
++ assertTrue(t instanceof ScriptObjectMirror);
++ assertEquals(((ScriptObjectMirror)t).get("a"), "xyz");
++ invoked.set(true);
++ }
++ });
++ e.eval("var x = 'xy'; x += 'z';c({a:x})");
++ assertTrue(invoked.get());
++ }
++
++ @Test
++ public void testLengthOnArrayLikeObjects() throws Exception {
++ final ScriptEngine e = new ScriptEngineManager().getEngineByName("nashorn");
++ final Object val = e.eval("var arr = { length: 1, 0: 1}; arr.length");
++
++ assertTrue(Number.class.isAssignableFrom(val.getClass()));
++ assertTrue(((Number)val).intValue() == 1);
++ }
++
++ // @bug JDK-8068603: NashornScriptEngine.put/get() impls don't conform to NPE, IAE spec assertions
++ @Test
++ public void illegalBindingsValuesTest() throws Exception {
++ final ScriptEngineManager manager = new ScriptEngineManager();
++ final ScriptEngine e = manager.getEngineByName("nashorn");
++
++ try {
++ e.put(null, "null-value");
++ fail();
++ } catch (NullPointerException x) {
++ // expected
++ }
++
++ try {
++ e.put("", "empty-value");
++ fail();
++ } catch (IllegalArgumentException x) {
++ // expected
++ }
++
++ final Bindings b = e.getBindings(ScriptContext.ENGINE_SCOPE);
++ assertTrue(b instanceof ScriptObjectMirror);
++
++ try {
++ b.put(null, "null-value");
++ fail();
++ } catch (NullPointerException x) {
++ // expected
++ }
++
++ try {
++ b.put("", "empty-value");
++ fail();
++ } catch (IllegalArgumentException x) {
++ // expected
++ }
++
++ try {
++ b.get(null);
++ fail();
++ } catch (NullPointerException x) {
++ // expected
++ }
++
++ try {
++ b.get("");
++ fail();
++ } catch (IllegalArgumentException x) {
++ // expected
++ }
++
++ try {
++ b.get(1);
++ fail();
++ } catch (ClassCastException x) {
++ // expected
++ }
++
++ try {
++ b.remove(null);
++ fail();
++ } catch (NullPointerException x) {
++ // expected
++ }
++
++ try {
++ b.remove("");
++ fail();
++ } catch (IllegalArgumentException x) {
++ // expected
++ }
++
++ try {
++ b.remove(1);
++ fail();
++ } catch (ClassCastException x) {
++ // expected
++ }
++
++ try {
++ b.containsKey(null);
++ fail();
++ } catch (NullPointerException x) {
++ // expected
++ }
++
++ try {
++ b.containsKey("");
++ fail();
++ } catch (IllegalArgumentException x) {
++ // expected
++ }
++
++ try {
++ b.containsKey(1);
++ fail();
++ } catch (ClassCastException x) {
++ // expected
++ }
++
++ try {
++ b.putAll(null);
++ fail();
++ } catch (NullPointerException x) {
++ // expected
++ }
++
++ try {
++ b.putAll(Collections.singletonMap((String)null, "null-value"));
++ fail();
++ } catch (NullPointerException x) {
++ // expected
++ }
++
++ try {
++ b.putAll(Collections.singletonMap("", "empty-value"));
++ fail();
++ } catch (IllegalArgumentException x) {
++ // expected
++ }
++ }
++
++ // @bug 8071989: NashornScriptEngine returns javax.script.ScriptContext instance
++ // with insonsistent get/remove methods behavior for undefined attributes
++ @Test
++ public void testScriptContextGetRemoveUndefined() throws Exception {
++ final ScriptEngineManager manager = new ScriptEngineManager();
++ final ScriptEngine e = manager.getEngineByName("nashorn");
++ final ScriptContext ctx = e.getContext();
++ assertNull(ctx.getAttribute("undefinedname", ScriptContext.ENGINE_SCOPE));
++ assertNull(ctx.removeAttribute("undefinedname", ScriptContext.ENGINE_SCOPE));
++ }
++
++ private static void checkProperty(final ScriptEngine e, final String name)
++ throws ScriptException {
++ final String value = System.getProperty(name);
++ e.put("name", name);
++ assertEquals(value, e.eval("java.lang.System.getProperty(name)"));
++ }
++
++ private static final String LINE_SEPARATOR = System.getProperty("line.separator");
++
++ // Returns String that would be the result of calling PrintWriter.println
++ // of the given String. (This is to handle platform specific newline).
++ private static String println(final String str) {
++ return str + LINE_SEPARATOR;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,389 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertFalse;
++import static org.testng.Assert.assertTrue;
++import static org.testng.Assert.fail;
++
++import java.nio.ByteBuffer;
++import java.util.HashMap;
++import java.util.List;
++import java.util.Map;
++import java.util.function.Function;
++import javax.script.Bindings;
++import javax.script.Invocable;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import jdk.nashorn.api.scripting.JSObject;
++import jdk.nashorn.api.scripting.ScriptObjectMirror;
++import org.testng.annotations.Test;
++
++/**
++ * Tests to check jdk.nashorn.api.scripting.ScriptObjectMirror API.
++ */
++@SuppressWarnings("javadoc")
++public class ScriptObjectMirrorTest {
++
++ @SuppressWarnings("unchecked")
++ @Test
++ public void reflectionTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++
++ e.eval("var obj = { x: 344, y: 'nashorn' }");
++
++ int count = 0;
++ Map<Object, Object> map = (Map<Object, Object>) e.get("obj");
++ assertFalse(map.isEmpty());
++ assertTrue(map.keySet().contains("x"));
++ assertTrue(map.containsKey("x"));
++ assertTrue(map.values().contains("nashorn"));
++ assertTrue(map.containsValue("nashorn"));
++ for (final Map.Entry<?, ?> ex : map.entrySet()) {
++ final Object key = ex.getKey();
++ if (key.equals("x")) {
++ assertTrue(344 == ((Number) ex.getValue()).doubleValue());
++ count++;
++ } else if (key.equals("y")) {
++ assertEquals(ex.getValue(), "nashorn");
++ count++;
++ }
++ }
++ assertEquals(2, count);
++ assertEquals(2, map.size());
++
++ // add property
++ map.put("z", "hello");
++ assertEquals(e.eval("obj.z"), "hello");
++ assertEquals(map.get("z"), "hello");
++ assertTrue(map.keySet().contains("z"));
++ assertTrue(map.containsKey("z"));
++ assertTrue(map.values().contains("hello"));
++ assertTrue(map.containsValue("hello"));
++ assertEquals(map.size(), 3);
++
++ final Map<Object, Object> newMap = new HashMap<>();
++ newMap.put("foo", 23.0);
++ newMap.put("bar", true);
++ map.putAll(newMap);
++
++ assertEquals(e.eval("obj.foo"), 23.0);
++ assertEquals(e.eval("obj.bar"), true);
++
++ // remove using map method
++ map.remove("foo");
++ assertEquals(e.eval("typeof obj.foo"), "undefined");
++
++ count = 0;
++ e.eval("var arr = [ true, 'hello' ]");
++ map = (Map<Object, Object>) e.get("arr");
++ assertFalse(map.isEmpty());
++ assertTrue(map.containsKey("length"));
++ assertTrue(map.containsValue("hello"));
++ for (final Map.Entry<?, ?> ex : map.entrySet()) {
++ final Object key = ex.getKey();
++ if (key.equals("0")) {
++ assertEquals(ex.getValue(), Boolean.TRUE);
++ count++;
++ } else if (key.equals("1")) {
++ assertEquals(ex.getValue(), "hello");
++ count++;
++ }
++ }
++ assertEquals(count, 2);
++ assertEquals(map.size(), 2);
++
++ // add element
++ map.put("2", "world");
++ assertEquals(map.get("2"), "world");
++ assertEquals(map.size(), 3);
++
++ // remove all
++ map.clear();
++ assertTrue(map.isEmpty());
++ assertEquals(e.eval("typeof arr[0]"), "undefined");
++ assertEquals(e.eval("typeof arr[1]"), "undefined");
++ assertEquals(e.eval("typeof arr[2]"), "undefined");
++ }
++
++ @Test
++ public void jsobjectTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ e.eval("var obj = { '1': 'world', func: function() { return this.bar; }, bar: 'hello' }");
++ final ScriptObjectMirror obj = (ScriptObjectMirror) e.get("obj");
++
++ // try basic get on existing properties
++ if (!obj.getMember("bar").equals("hello")) {
++ fail("obj.bar != 'hello'");
++ }
++
++ if (!obj.getSlot(1).equals("world")) {
++ fail("obj[1] != 'world'");
++ }
++
++ if (!obj.callMember("func", new Object[0]).equals("hello")) {
++ fail("obj.func() != 'hello'");
++ }
++
++ // try setting properties
++ obj.setMember("bar", "new-bar");
++ obj.setSlot(1, "new-element-1");
++ if (!obj.getMember("bar").equals("new-bar")) {
++ fail("obj.bar != 'new-bar'");
++ }
++
++ if (!obj.getSlot(1).equals("new-element-1")) {
++ fail("obj[1] != 'new-element-1'");
++ }
++
++ // try adding properties
++ obj.setMember("prop", "prop-value");
++ obj.setSlot(12, "element-12");
++ if (!obj.getMember("prop").equals("prop-value")) {
++ fail("obj.prop != 'prop-value'");
++ }
++
++ if (!obj.getSlot(12).equals("element-12")) {
++ fail("obj[12] != 'element-12'");
++ }
++
++ // delete properties
++ obj.removeMember("prop");
++ if ("prop-value".equals(obj.getMember("prop"))) {
++ fail("obj.prop is not deleted!");
++ }
++
++ // Simple eval tests
++ assertEquals(obj.eval("typeof Object"), "function");
++ assertEquals(obj.eval("'nashorn'.substring(3)"), "horn");
++ } catch (final Exception exp) {
++ exp.printStackTrace();
++ fail(exp.getMessage());
++ }
++ }
++
++ @Test
++ public void scriptObjectMirrorToStringTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ try {
++ final Object obj = e.eval("new TypeError('wrong type')");
++ assertEquals(obj.toString(), "TypeError: wrong type", "toString returns wrong value");
++ } catch (final Throwable t) {
++ t.printStackTrace();
++ fail(t.getMessage());
++ }
++
++ try {
++ final Object obj = e.eval("function func() { print('hello'); }");
++ assertEquals(obj.toString(), "function func() { print('hello'); }", "toString returns wrong value");
++ } catch (final Throwable t) {
++ t.printStackTrace();
++ fail(t.getMessage());
++ }
++ }
++
++ @Test
++ public void mirrorNewObjectGlobalFunctionTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final ScriptEngine e2 = m.getEngineByName("nashorn");
++
++ e.eval("function func() {}");
++ e2.put("foo", e.get("func"));
++ final ScriptObjectMirror e2global = (ScriptObjectMirror)e2.eval("this");
++ final Object newObj = ((ScriptObjectMirror)e2global.getMember("foo")).newObject();
++ assertTrue(newObj instanceof ScriptObjectMirror);
++ }
++
++ @Test
++ public void mirrorNewObjectInstanceFunctionTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final ScriptEngine e2 = m.getEngineByName("nashorn");
++
++ e.eval("function func() {}");
++ e2.put("func", e.get("func"));
++ final ScriptObjectMirror e2obj = (ScriptObjectMirror)e2.eval("({ foo: func })");
++ final Object newObj = ((ScriptObjectMirror)e2obj.getMember("foo")).newObject();
++ assertTrue(newObj instanceof ScriptObjectMirror);
++ }
++
++ @Test
++ public void indexPropertiesExternalBufferTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final ScriptObjectMirror obj = (ScriptObjectMirror)e.eval("var obj = {}; obj");
++ final ByteBuffer buf = ByteBuffer.allocate(5);
++ int i;
++ for (i = 0; i < 5; i++) {
++ buf.put(i, (byte)(i+10));
++ }
++ obj.setIndexedPropertiesToExternalArrayData(buf);
++
++ for (i = 0; i < 5; i++) {
++ assertEquals((byte)(i+10), ((Number)e.eval("obj[" + i + "]")).byteValue());
++ }
++
++ e.eval("for (i = 0; i < 5; i++) obj[i] = 0");
++ for (i = 0; i < 5; i++) {
++ assertEquals((byte)0, ((Number)e.eval("obj[" + i + "]")).byteValue());
++ assertEquals((byte)0, buf.get(i));
++ }
++ }
++
++ @Test
++ public void conversionTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ final ScriptObjectMirror arr = (ScriptObjectMirror)e.eval("[33, 45, 23]");
++ final int[] intArr = arr.to(int[].class);
++ assertEquals(intArr[0], 33);
++ assertEquals(intArr[1], 45);
++ assertEquals(intArr[2], 23);
++
++ final List<?> list = arr.to(List.class);
++ assertEquals(list.get(0), 33);
++ assertEquals(list.get(1), 45);
++ assertEquals(list.get(2), 23);
++
++ ScriptObjectMirror obj = (ScriptObjectMirror)e.eval(
++ "({ valueOf: function() { return 42 } })");
++ assertEquals(Double.valueOf(42.0), obj.to(Double.class));
++
++ obj = (ScriptObjectMirror)e.eval(
++ "({ toString: function() { return 'foo' } })");
++ assertEquals("foo", obj.to(String.class));
++ }
++
++ // @bug 8044000: Access to undefined property yields "null" instead of "undefined"
++ @Test
++ public void mapScriptObjectMirrorCallsiteTest() throws ScriptException {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine engine = m.getEngineByName("nashorn");
++ final String TEST_SCRIPT = "typeof obj.foo";
++
++ final Bindings global = engine.getContext().getBindings(ScriptContext.ENGINE_SCOPE);
++ engine.eval("var obj = java.util.Collections.emptyMap()");
++ // this will drive callsite "obj.foo" of TEST_SCRIPT
++ // to use "obj instanceof Map" as it's guard
++ engine.eval(TEST_SCRIPT, global);
++ // redefine 'obj' to be a script object
++ engine.eval("obj = {}");
++
++ final Bindings newGlobal = engine.createBindings();
++ // transfer 'obj' from default global to new global
++ // new global will get a ScriptObjectMirror wrapping 'obj'
++ newGlobal.put("obj", global.get("obj"));
++
++ // Every ScriptObjectMirror is a Map! If callsite "obj.foo"
++ // does not see the new 'obj' is a ScriptObjectMirror, it'll
++ // continue to use Map's get("obj.foo") instead of ScriptObjectMirror's
++ // getMember("obj.foo") - thereby getting null instead of undefined
++ assertEquals("undefined", engine.eval(TEST_SCRIPT, newGlobal));
++ }
++
++ public interface MirrorCheckExample {
++ Object test1(Object arg);
++ Object test2(Object arg);
++ boolean compare(Object o1, Object o2);
++ }
++
++ // @bug 8053910: ScriptObjectMirror causing havoc with Invocation interface
++ @Test
++ public void checkMirrorToObject() throws Exception {
++ final ScriptEngineManager engineManager = new ScriptEngineManager();
++ final ScriptEngine engine = engineManager.getEngineByName("nashorn");
++ final Invocable invocable = (Invocable)engine;
++
++ engine.eval("function test1(arg) { return { arg: arg }; }");
++ engine.eval("function test2(arg) { return arg; }");
++ engine.eval("function compare(arg1, arg2) { return arg1 == arg2; }");
++
++ final Map<String, Object> map = new HashMap<>();
++ map.put("option", true);
++
++ final MirrorCheckExample example = invocable.getInterface(MirrorCheckExample.class);
++
++ final Object value1 = invocable.invokeFunction("test1", map);
++ final Object value2 = example.test1(map);
++ final Object value3 = invocable.invokeFunction("test2", value2);
++ final Object value4 = example.test2(value2);
++
++ // check that Object type argument receives a ScriptObjectMirror
++ // when ScriptObject is passed
++ assertEquals(ScriptObjectMirror.class, value1.getClass());
++ assertEquals(ScriptObjectMirror.class, value2.getClass());
++ assertEquals(ScriptObjectMirror.class, value3.getClass());
++ assertEquals(ScriptObjectMirror.class, value4.getClass());
++ assertTrue((boolean)invocable.invokeFunction("compare", value1, value1));
++ assertTrue(example.compare(value1, value1));
++ assertTrue((boolean)invocable.invokeFunction("compare", value3, value4));
++ assertTrue(example.compare(value3, value4));
++ }
++
++ // @bug 8053910: ScriptObjectMirror causing havoc with Invocation interface
++ @Test
++ public void mirrorUnwrapInterfaceMethod() throws Exception {
++ final ScriptEngineManager engineManager = new ScriptEngineManager();
++ final ScriptEngine engine = engineManager.getEngineByName("nashorn");
++ final Invocable invocable = (Invocable)engine;
++ engine.eval("function apply(obj) { " +
++ " return obj instanceof Packages.jdk.nashorn.api.scripting.ScriptObjectMirror; " +
++ "}");
++ @SuppressWarnings("unchecked")
++ final Function<Object,Object> func = invocable.getInterface(Function.class);
++ assertFalse((boolean)func.apply(engine.eval("({ x: 2 })")));
++ }
++
++ // @bug 8055687: Wrong "this" passed to JSObject.eval call
++ @Test
++ public void checkThisForJSObjectEval() throws Exception {
++ final ScriptEngineManager engineManager = new ScriptEngineManager();
++ final ScriptEngine e = engineManager.getEngineByName("nashorn");
++ final JSObject jsobj = (JSObject)e.eval("({foo: 23, bar: 'hello' })");
++ assertEquals(((Number)jsobj.eval("this.foo")).intValue(), 23);
++ assertEquals(jsobj.eval("this.bar"), "hello");
++ assertEquals(jsobj.eval("String(this)"), "[object Object]");
++ final Object global = e.eval("this");
++ assertFalse(global.equals(jsobj.eval("this")));
++ }
++
++ @Test
++ public void topLevelAnonFuncStatement() throws Exception {
++ final ScriptEngineManager engineManager = new ScriptEngineManager();
++ final ScriptEngine e = engineManager.getEngineByName("nashorn");
++ final JSObject func = (JSObject)e.eval("function(x) { return x + ' world' }");
++ assertTrue(func.isFunction());
++ assertEquals(func.call(e.eval("this"), "hello"), "hello world");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/VariableArityTestInterface.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,32 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++@SuppressWarnings("javadoc")
++public interface VariableArityTestInterface {
++ public String test1(int i, String... strings);
++ public String test2(int i, String... strings);
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/Window.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,88 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++import java.util.Map;
++import javax.script.Bindings;
++import jdk.nashorn.api.scripting.JSObject;
++import jdk.nashorn.api.scripting.ScriptObjectMirror;
++
++@SuppressWarnings("javadoc")
++public class Window {
++
++ private String location = "http://localhost:8080/window";
++
++ private WindowEventHandler onload = null;
++
++ public void alert(final String message) {
++ System.out.println("alert: " + message);
++ }
++
++ public String getLocation() {
++ return location;
++ }
++
++ public void setLocation(final String location) {
++ this.location = location;
++ }
++
++ public String item(final int index) {
++ return Integer.toHexString(index);
++ }
++
++ public WindowEventHandler getOnload() {
++ return onload;
++ }
++
++ public void setOnload(final WindowEventHandler onload) {
++ this.onload = onload;
++ }
++
++ public static int setTimeout(final Window self, final String code, final int delay) {
++ return self.setTimeout(code, delay);
++ }
++
++ public int setTimeout(final String code, final int delay) {
++ System.out.println("window.setTimeout: " + delay + ", code: " + code);
++ return 0;
++ }
++
++ public static Object funcJSObject(final JSObject jsobj) {
++ return jsobj.getMember("foo");
++ }
++
++ public static Object funcScriptObjectMirror(final ScriptObjectMirror sobj) {
++ return sobj.get("foo");
++ }
++
++ public static Object funcMap(final Map<?,?> map) {
++ return map.get("foo");
++ }
++
++ public static Object funcBindings(final Bindings bindings) {
++ return bindings.get("foo");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/WindowEventHandler.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,31 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.scripting.test;
++
++@SuppressWarnings("javadoc")
++public interface WindowEventHandler {
++ public boolean loaded();
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/resources/func.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,42 @@
++/*
++ * Copyright (c) 2010, 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. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++// This script is loaded from jdk.nashorn.api.scripting.ScopeTest to test script class sharing and reuse.
++
++var scopeVar = 1;
++var global = this;
++undefGlobal = this;
++
++function scopeTest() {
++ if (this !== global) {
++ throw new Error("this !== global");
++ }
++ if (this !== undefGlobal) {
++ throw new Error("this !== undefinedGlobal")
++ }
++ return scopeVar;
++}
++
++scopeTest();
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/resources/gettersetter.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,38 @@
++/*
++ * Copyright (c) 2010, 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. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++// This script is loaded from jdk.nashorn.api.scripting.ScopeTest to test script class sharing and reuse.
++
++var v;
++
++Object.defineProperty(this, "accessor1", {
++ get: function() { return v; },
++ set: function(n) { v = n; }
++});
++
++Object.defineProperty(this, "accessor2", {
++ get: function() { return x; },
++ set: function(n) { x = n; }
++});
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/scripting/test/resources/witheval.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,60 @@
++/*
++ * Copyright (c) 2010, 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. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++// This script is loaded from jdk.nashorn.api.scripting.ScopeTest to test script class sharing and reuse.
++
++var a;
++
++function outer(p, e) {
++ eval(e);
++ with(p) {
++ function inner() {
++ a = 1;
++ c = 10;
++ if (a !== 1) {
++ throw new Error("a !== 1");
++ }
++ if (b !== 3) {
++ throw new Error("b !== 3");
++ }
++ if (c !== 10) {
++ throw new Error("c !== 10");
++ }
++ }
++ inner();
++ }
++}
++
++outer({}, "b = 3;");
++
++if (a !== 1) {
++ throw new Error("a !== 1");
++}
++if (b !== 3) {
++ throw new Error("b !== 3");
++}
++if (c !== 10) {
++ throw new Error("c !== 10");
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/api/test/NashornSQLDriver.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,84 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.api.test;
++
++import java.sql.Connection;
++import java.sql.Driver;
++import java.sql.DriverManager;
++import java.sql.DriverPropertyInfo;
++import java.sql.SQLException;
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.Properties;
++import java.util.logging.Logger;
++
++/**
++ * A dummy SQL driver for testing purpose.
++ */
++public final class NashornSQLDriver implements Driver {
++ static {
++ try {
++ DriverManager.registerDriver(new NashornSQLDriver(), null);
++ } catch (final SQLException se) {
++ throw new RuntimeException(se);
++ }
++ }
++
++ @Override
++ public boolean acceptsURL(final String url) {
++ return url.startsWith("jdbc:nashorn:");
++ }
++
++ @Override
++ public Connection connect(final String url, final Properties info) {
++ throw new UnsupportedOperationException("I am a dummy!!");
++ }
++
++ @Override
++ public int getMajorVersion() {
++ return -1;
++ }
++
++ @Override
++ public int getMinorVersion() {
++ return -1;
++ }
++
++ @Override
++ public DriverPropertyInfo[] getPropertyInfo(final String url, final Properties info) {
++ return new DriverPropertyInfo[0];
++ }
++
++ @Override
++ public boolean jdbcCompliant() {
++ // no way!
++ return false;
++ }
++
++ @Override
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ throw new SQLFeatureNotSupportedException();
++ }
++}
+--- ./nashorn/test/src/jdk/nashorn/internal/codegen/CompilerTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,209 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.codegen;
+-
+-import static jdk.nashorn.internal.runtime.Source.readFully;
+-import static jdk.nashorn.internal.runtime.Source.sourceFor;
+-import java.io.File;
+-import java.io.PrintWriter;
+-import java.io.StringWriter;
+-import jdk.nashorn.internal.objects.Global;
+-import jdk.nashorn.internal.runtime.Context;
+-import jdk.nashorn.internal.runtime.ErrorManager;
+-import jdk.nashorn.internal.runtime.ScriptFunction;
+-import jdk.nashorn.internal.runtime.Source;
+-import jdk.nashorn.internal.runtime.options.Options;
+-import org.testng.Assert;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests to check Nashorn JS compiler - just compiler and not execution of scripts.
+- */
+-@SuppressWarnings("javadoc")
+-public class CompilerTest {
+- private static final boolean VERBOSE = Boolean.valueOf(System.getProperty("compilertest.verbose"));
+- private static final boolean TEST262 = Boolean.valueOf(System.getProperty("compilertest.test262"));
+- private static final String TEST_BASIC_DIR = System.getProperty("test.basic.dir");
+- private static final String TEST_NODE_DIR = System.getProperty("test.node.dir");
+- private static final String TEST262_SUITE_DIR = System.getProperty("test262.suite.dir");
+-
+- interface TestFilter {
+- public boolean exclude(File file, String content);
+- }
+-
+- private static void log(final String msg) {
+- org.testng.Reporter.log(msg, true);
+- }
+-
+- private Context context;
+- private Global global;
+-
+- @BeforeClass
+- public void setupTest() {
+- final Options options = new Options("nashorn");
+- options.set("anon.functions", true);
+- options.set("compile.only", true);
+- options.set("print.ast", true);
+- options.set("print.parse", true);
+- options.set("scripting", true);
+- options.set("const.as.var", true);
+- options.set("verify.code", true);
+-
+- final ErrorManager errors = new ErrorManager() {
+- @Override
+- public void error(final String msg) {
+- log(msg);
+- }
+- };
+-
+- final StringWriter sw = new StringWriter();
+- final PrintWriter pw = new PrintWriter(sw);
+- this.context = new Context(options, errors, pw, pw, Thread.currentThread().getContextClassLoader());
+- this.global = context.createGlobal();
+- }
+-
+- @AfterClass
+- public void tearDownTest() {
+- this.context = null;
+- this.global = null;
+- }
+-
+- @Test
+- public void compileAllTests() {
+- if (TEST262) {
+- compileTestSet(new File(TEST262_SUITE_DIR), new TestFilter() {
+- @Override
+- public boolean exclude(final File file, final String content) {
+- return content != null && content.contains("@negative");
+- }
+- });
+- }
+- compileTestSet(new File(TEST_BASIC_DIR), new TestFilter() {
+- @Override
+- public boolean exclude(final File file, final String content) {
+- return file.getName().equals("es6");
+- }
+- });
+- compileTestSet(new File(TEST_NODE_DIR, "node"), null);
+- compileTestSet(new File(TEST_NODE_DIR, "src"), null);
+- }
+-
+- private void compileTestSet(final File testSetDir, final TestFilter filter) {
+- passed = 0;
+- failed = 0;
+- skipped = 0;
+- if (! testSetDir.isDirectory()) {
+- log("WARNING: " + testSetDir + " not found or not a directory");
+- return;
+- }
+- log(testSetDir.getAbsolutePath());
+- compileJSDirectory(testSetDir, filter);
+-
+- log(testSetDir + " compile done!");
+- log("compile ok: " + passed);
+- log("compile failed: " + failed);
+- log("compile skipped: " + skipped);
+- if (failed != 0) {
+- Assert.fail(failed + " tests failed to compile in " + testSetDir.getAbsolutePath());
+- }
+- }
+-
+- // number of scripts that compiled fine
+- private int passed;
+- // number of scripts resulting in compile failure
+- private int failed;
+- // scripts that were skipped - all tests with @negative are
+- // skipped for now.
+- private int skipped;
+-
+- private void compileJSDirectory(final File dir, final TestFilter filter) {
+- if (filter != null && filter.exclude(dir, null)) {
+- return;
+- }
+- for (final File f : dir.listFiles()) {
+- if (f.isDirectory()) {
+- compileJSDirectory(f, filter);
+- } else if (f.getName().endsWith(".js")) {
+- compileJSFile(f, filter);
+- }
+- }
+- }
+-
+- private void compileJSFile(final File file, final TestFilter filter) {
+- if (VERBOSE) {
+- log("Begin compiling " + file.getAbsolutePath());
+- }
+-
+- final Global oldGlobal = Context.getGlobal();
+- final boolean globalChanged = (oldGlobal != global);
+-
+- try {
+- final char[] buffer = readFully(file);
+- boolean excluded = false;
+-
+- if (filter != null) {
+- final String content = new String(buffer);
+- excluded = filter.exclude(file, content);
+- }
+-
+- if (excluded) {
+- if (VERBOSE) {
+- log("Skipping " + file.getAbsolutePath());
+- }
+- skipped++;
+- return;
+- }
+-
+- if (globalChanged) {
+- Context.setGlobal(global);
+- }
+- final Source source = sourceFor(file.getAbsolutePath(), buffer);
+- final ScriptFunction script = context.compileScript(source, global);
+- if (script == null || context.getErrorManager().getNumberOfErrors() > 0) {
+- log("Compile failed: " + file.getAbsolutePath());
+- failed++;
+- } else {
+- passed++;
+- }
+- } catch (final Throwable t) {
+- log("Compile failed: " + file.getAbsolutePath() + " : " + t);
+- if (VERBOSE) {
+- t.printStackTrace(System.out);
+- }
+- failed++;
+- } finally {
+- if (globalChanged) {
+- Context.setGlobal(oldGlobal);
+- }
+- }
+-
+- if (VERBOSE) {
+- log("Done compiling " + file.getAbsolutePath());
+- }
+- }
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/codegen/test/CompilerTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,209 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.codegen.test;
++
++import static jdk.nashorn.internal.runtime.Source.readFully;
++import static jdk.nashorn.internal.runtime.Source.sourceFor;
++import java.io.File;
++import java.io.PrintWriter;
++import java.io.StringWriter;
++import jdk.nashorn.internal.objects.Global;
++import jdk.nashorn.internal.runtime.Context;
++import jdk.nashorn.internal.runtime.ErrorManager;
++import jdk.nashorn.internal.runtime.ScriptFunction;
++import jdk.nashorn.internal.runtime.Source;
++import jdk.nashorn.internal.runtime.options.Options;
++import org.testng.Assert;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++/**
++ * Tests to check Nashorn JS compiler - just compiler and not execution of scripts.
++ */
++@SuppressWarnings("javadoc")
++public class CompilerTest {
++ private static final boolean VERBOSE = Boolean.valueOf(System.getProperty("compilertest.verbose"));
++ private static final boolean TEST262 = Boolean.valueOf(System.getProperty("compilertest.test262"));
++ private static final String TEST_BASIC_DIR = System.getProperty("test.basic.dir");
++ private static final String TEST_NODE_DIR = System.getProperty("test.node.dir");
++ private static final String TEST262_SUITE_DIR = System.getProperty("test262.suite.dir");
++
++ interface TestFilter {
++ public boolean exclude(File file, String content);
++ }
++
++ private static void log(final String msg) {
++ org.testng.Reporter.log(msg, true);
++ }
++
++ private Context context;
++ private Global global;
++
++ @BeforeClass
++ public void setupTest() {
++ final Options options = new Options("nashorn");
++ options.set("anon.functions", true);
++ options.set("compile.only", true);
++ options.set("print.ast", true);
++ options.set("print.parse", true);
++ options.set("scripting", true);
++ options.set("const.as.var", true);
++ options.set("verify.code", true);
++
++ final ErrorManager errors = new ErrorManager() {
++ @Override
++ public void error(final String msg) {
++ log(msg);
++ }
++ };
++
++ final StringWriter sw = new StringWriter();
++ final PrintWriter pw = new PrintWriter(sw);
++ this.context = new Context(options, errors, pw, pw, Thread.currentThread().getContextClassLoader());
++ this.global = context.createGlobal();
++ }
++
++ @AfterClass
++ public void tearDownTest() {
++ this.context = null;
++ this.global = null;
++ }
++
++ @Test
++ public void compileAllTests() {
++ if (TEST262) {
++ compileTestSet(new File(TEST262_SUITE_DIR), new TestFilter() {
++ @Override
++ public boolean exclude(final File file, final String content) {
++ return content != null && content.contains("@negative");
++ }
++ });
++ }
++ compileTestSet(new File(TEST_BASIC_DIR), new TestFilter() {
++ @Override
++ public boolean exclude(final File file, final String content) {
++ return file.getName().equals("es6");
++ }
++ });
++ compileTestSet(new File(TEST_NODE_DIR, "node"), null);
++ compileTestSet(new File(TEST_NODE_DIR, "src"), null);
++ }
++
++ private void compileTestSet(final File testSetDir, final TestFilter filter) {
++ passed = 0;
++ failed = 0;
++ skipped = 0;
++ if (! testSetDir.isDirectory()) {
++ log("WARNING: " + testSetDir + " not found or not a directory");
++ return;
++ }
++ log(testSetDir.getAbsolutePath());
++ compileJSDirectory(testSetDir, filter);
++
++ log(testSetDir + " compile done!");
++ log("compile ok: " + passed);
++ log("compile failed: " + failed);
++ log("compile skipped: " + skipped);
++ if (failed != 0) {
++ Assert.fail(failed + " tests failed to compile in " + testSetDir.getAbsolutePath());
++ }
++ }
++
++ // number of scripts that compiled fine
++ private int passed;
++ // number of scripts resulting in compile failure
++ private int failed;
++ // scripts that were skipped - all tests with @negative are
++ // skipped for now.
++ private int skipped;
++
++ private void compileJSDirectory(final File dir, final TestFilter filter) {
++ if (filter != null && filter.exclude(dir, null)) {
++ return;
++ }
++ for (final File f : dir.listFiles()) {
++ if (f.isDirectory()) {
++ compileJSDirectory(f, filter);
++ } else if (f.getName().endsWith(".js")) {
++ compileJSFile(f, filter);
++ }
++ }
++ }
++
++ private void compileJSFile(final File file, final TestFilter filter) {
++ if (VERBOSE) {
++ log("Begin compiling " + file.getAbsolutePath());
++ }
++
++ final Global oldGlobal = Context.getGlobal();
++ final boolean globalChanged = (oldGlobal != global);
++
++ try {
++ final char[] buffer = readFully(file);
++ boolean excluded = false;
++
++ if (filter != null) {
++ final String content = new String(buffer);
++ excluded = filter.exclude(file, content);
++ }
++
++ if (excluded) {
++ if (VERBOSE) {
++ log("Skipping " + file.getAbsolutePath());
++ }
++ skipped++;
++ return;
++ }
++
++ if (globalChanged) {
++ Context.setGlobal(global);
++ }
++ final Source source = sourceFor(file.getAbsolutePath(), buffer);
++ final ScriptFunction script = context.compileScript(source, global);
++ if (script == null || context.getErrorManager().getNumberOfErrors() > 0) {
++ log("Compile failed: " + file.getAbsolutePath());
++ failed++;
++ } else {
++ passed++;
++ }
++ } catch (final Throwable t) {
++ log("Compile failed: " + file.getAbsolutePath() + " : " + t);
++ if (VERBOSE) {
++ t.printStackTrace(System.out);
++ }
++ failed++;
++ } finally {
++ if (globalChanged) {
++ Context.setGlobal(oldGlobal);
++ }
++ }
++
++ if (VERBOSE) {
++ log("Done compiling " + file.getAbsolutePath());
++ }
++ }
++}
+--- ./nashorn/test/src/jdk/nashorn/internal/parser/ParserTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,189 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.parser;
+-
+-import static jdk.nashorn.internal.runtime.Source.readFully;
+-import static jdk.nashorn.internal.runtime.Source.sourceFor;
+-import java.io.File;
+-import jdk.nashorn.internal.runtime.Context;
+-import jdk.nashorn.internal.runtime.ErrorManager;
+-import jdk.nashorn.internal.runtime.Source;
+-import jdk.nashorn.internal.runtime.options.Options;
+-import org.testng.Assert;
+-import org.testng.annotations.AfterClass;
+-import org.testng.annotations.BeforeClass;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Run tests to check Nashorn's parser.
+- */
+-@SuppressWarnings("javadoc")
+-public class ParserTest {
+- private static final boolean VERBOSE = Boolean.valueOf(System.getProperty("parsertest.verbose"));
+- private static final boolean TEST262 = Boolean.valueOf(System.getProperty("parsertest.test262"));
+-
+- private static final String TEST_BASIC_DIR = System.getProperty("test.basic.dir");
+- private static final String TEST262_SUITE_DIR = System.getProperty("test262.suite.dir");
+-
+-
+- interface TestFilter {
+- public boolean exclude(File file, String content);
+- }
+-
+- private static void log(final String msg) {
+- org.testng.Reporter.log(msg, true);
+- }
+-
+- private Context context;
+-
+- @BeforeClass
+- public void setupTest() {
+- final Options options = new Options("nashorn");
+- options.set("anon.functions", true);
+- options.set("parse.only", true);
+- options.set("scripting", true);
+- options.set("const.as.var", true);
+-
+- final ErrorManager errors = new ErrorManager();
+- this.context = new Context(options, errors, Thread.currentThread().getContextClassLoader());
+- }
+-
+- @AfterClass
+- public void tearDownTest() {
+- this.context = null;
+- }
+-
+- @Test
+- public void parseAllTests() {
+- if (TEST262) {
+- parseTestSet(TEST262_SUITE_DIR, new TestFilter() {
+- @Override
+- public boolean exclude(final File file, final String content) {
+- return content != null && content.contains("@negative");
+- }
+- });
+- }
+- parseTestSet(TEST_BASIC_DIR, new TestFilter() {
+- @Override
+- public boolean exclude(final File file, final String content) {
+- return file.getName().equals("es6");
+- }
+- });
+- }
+-
+- private void parseTestSet(final String testSet, final TestFilter filter) {
+- passed = 0;
+- failed = 0;
+- skipped = 0;
+-
+- final File testSetDir = new File(testSet);
+- if (! testSetDir.isDirectory()) {
+- log("WARNING: " + testSetDir + " not found or not a directory");
+- return;
+- }
+- log(testSetDir.getAbsolutePath());
+- parseJSDirectory(testSetDir, filter);
+-
+- log(testSet + " parse done!");
+- log("parse ok: " + passed);
+- log("parse failed: " + failed);
+- log("parse skipped: " + skipped);
+- if (failed != 0) {
+- Assert.fail(failed + " tests failed to compile in " + testSetDir.getAbsolutePath());
+- }
+- }
+-
+- // number of scripts that parsed fine
+- private int passed;
+- // number of scripts resulting in parse failure
+- private int failed;
+- // scripts that were skipped - all tests with @negative are
+- // skipped for now.
+- private int skipped;
+-
+- private void parseJSDirectory(final File dir, final TestFilter filter) {
+- if (filter != null && filter.exclude(dir, null)) {
+- return;
+- }
+- for (final File f : dir.listFiles()) {
+- if (f.isDirectory()) {
+- parseJSDirectory(f, filter);
+- } else if (f.getName().endsWith(".js")) {
+- parseJSFile(f, filter);
+- }
+- }
+- }
+-
+- private void parseJSFile(final File file, final TestFilter filter) {
+- if (VERBOSE) {
+- log("Begin parsing " + file.getAbsolutePath());
+- }
+-
+- try {
+- final char[] buffer = readFully(file);
+- boolean excluded = false;
+- if (filter != null) {
+- final String content = new String(buffer);
+- excluded = filter.exclude(file, content);
+- }
+-
+- if (excluded) {
+- if (VERBOSE) {
+- log("Skipping " + file.getAbsolutePath());
+- }
+- skipped++;
+- return;
+- }
+-
+- final ErrorManager errors = new ErrorManager() {
+- @Override
+- public void error(final String msg) {
+- log(msg);
+- }
+- };
+- errors.setLimit(0);
+- final Source source = sourceFor(file.getAbsolutePath(), buffer);
+- new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse();
+- if (errors.getNumberOfErrors() > 0) {
+- log("Parse failed: " + file.getAbsolutePath());
+- failed++;
+- } else {
+- passed++;
+- }
+- } catch (final Throwable exp) {
+- exp.printStackTrace();
+- log("Parse failed: " + file.getAbsolutePath() + " : " + exp);
+- if (VERBOSE) {
+- exp.printStackTrace(System.out);
+- }
+- failed++;
+- }
+-
+- if (VERBOSE) {
+- log("Done parsing " + file.getAbsolutePath());
+- }
+- }
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/parser/test/ParserTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,190 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.parser.test;
++
++import static jdk.nashorn.internal.runtime.Source.readFully;
++import static jdk.nashorn.internal.runtime.Source.sourceFor;
++import java.io.File;
++import jdk.nashorn.internal.parser.Parser;
++import jdk.nashorn.internal.runtime.Context;
++import jdk.nashorn.internal.runtime.ErrorManager;
++import jdk.nashorn.internal.runtime.Source;
++import jdk.nashorn.internal.runtime.options.Options;
++import org.testng.Assert;
++import org.testng.annotations.AfterClass;
++import org.testng.annotations.BeforeClass;
++import org.testng.annotations.Test;
++
++/**
++ * Run tests to check Nashorn's parser.
++ */
++@SuppressWarnings("javadoc")
++public class ParserTest {
++ private static final boolean VERBOSE = Boolean.valueOf(System.getProperty("parsertest.verbose"));
++ private static final boolean TEST262 = Boolean.valueOf(System.getProperty("parsertest.test262"));
++
++ private static final String TEST_BASIC_DIR = System.getProperty("test.basic.dir");
++ private static final String TEST262_SUITE_DIR = System.getProperty("test262.suite.dir");
++
++
++ interface TestFilter {
++ public boolean exclude(File file, String content);
++ }
++
++ private static void log(final String msg) {
++ org.testng.Reporter.log(msg, true);
++ }
++
++ private Context context;
++
++ @BeforeClass
++ public void setupTest() {
++ final Options options = new Options("nashorn");
++ options.set("anon.functions", true);
++ options.set("parse.only", true);
++ options.set("scripting", true);
++ options.set("const.as.var", true);
++
++ final ErrorManager errors = new ErrorManager();
++ this.context = new Context(options, errors, Thread.currentThread().getContextClassLoader());
++ }
++
++ @AfterClass
++ public void tearDownTest() {
++ this.context = null;
++ }
++
++ @Test
++ public void parseAllTests() {
++ if (TEST262) {
++ parseTestSet(TEST262_SUITE_DIR, new TestFilter() {
++ @Override
++ public boolean exclude(final File file, final String content) {
++ return content != null && content.contains("@negative");
++ }
++ });
++ }
++ parseTestSet(TEST_BASIC_DIR, new TestFilter() {
++ @Override
++ public boolean exclude(final File file, final String content) {
++ return file.getName().equals("es6");
++ }
++ });
++ }
++
++ private void parseTestSet(final String testSet, final TestFilter filter) {
++ passed = 0;
++ failed = 0;
++ skipped = 0;
++
++ final File testSetDir = new File(testSet);
++ if (! testSetDir.isDirectory()) {
++ log("WARNING: " + testSetDir + " not found or not a directory");
++ return;
++ }
++ log(testSetDir.getAbsolutePath());
++ parseJSDirectory(testSetDir, filter);
++
++ log(testSet + " parse done!");
++ log("parse ok: " + passed);
++ log("parse failed: " + failed);
++ log("parse skipped: " + skipped);
++ if (failed != 0) {
++ Assert.fail(failed + " tests failed to compile in " + testSetDir.getAbsolutePath());
++ }
++ }
++
++ // number of scripts that parsed fine
++ private int passed;
++ // number of scripts resulting in parse failure
++ private int failed;
++ // scripts that were skipped - all tests with @negative are
++ // skipped for now.
++ private int skipped;
++
++ private void parseJSDirectory(final File dir, final TestFilter filter) {
++ if (filter != null && filter.exclude(dir, null)) {
++ return;
++ }
++ for (final File f : dir.listFiles()) {
++ if (f.isDirectory()) {
++ parseJSDirectory(f, filter);
++ } else if (f.getName().endsWith(".js")) {
++ parseJSFile(f, filter);
++ }
++ }
++ }
++
++ private void parseJSFile(final File file, final TestFilter filter) {
++ if (VERBOSE) {
++ log("Begin parsing " + file.getAbsolutePath());
++ }
++
++ try {
++ final char[] buffer = readFully(file);
++ boolean excluded = false;
++ if (filter != null) {
++ final String content = new String(buffer);
++ excluded = filter.exclude(file, content);
++ }
++
++ if (excluded) {
++ if (VERBOSE) {
++ log("Skipping " + file.getAbsolutePath());
++ }
++ skipped++;
++ return;
++ }
++
++ final ErrorManager errors = new ErrorManager() {
++ @Override
++ public void error(final String msg) {
++ log(msg);
++ }
++ };
++ errors.setLimit(0);
++ final Source source = sourceFor(file.getAbsolutePath(), buffer);
++ new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse();
++ if (errors.getNumberOfErrors() > 0) {
++ log("Parse failed: " + file.getAbsolutePath());
++ failed++;
++ } else {
++ passed++;
++ }
++ } catch (final Throwable exp) {
++ exp.printStackTrace();
++ log("Parse failed: " + file.getAbsolutePath() + " : " + exp);
++ if (VERBOSE) {
++ exp.printStackTrace(System.out);
++ }
++ failed++;
++ }
++
++ if (VERBOSE) {
++ log("Done parsing " + file.getAbsolutePath());
++ }
++ }
++}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/ClassFilterTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,185 +0,0 @@
+-/*
+- * Copyright (c) 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. 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.nashorn.internal.runtime;
+-
+-import static org.testng.Assert.fail;
+-import java.io.File;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptException;
+-import jdk.nashorn.api.scripting.ClassFilter;
+-import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+-import jdk.nashorn.api.scripting.URLReader;
+-import jdk.nashorn.internal.test.framework.TestFinder;
+-import org.testng.annotations.Test;
+-
+-@SuppressWarnings("javadoc")
+-public class ClassFilterTest {
+- private static final String NASHORN_CODE_CACHE = "nashorn.persistent.code.cache";
+- private static final String CLASSFILTER_CODE_CACHE = "build/classfilter_nashorn_code_cache";
+-
+- // @Test
+- // This test takes too much time for basic "ant clean test" run.
+- // Given that "allow-all-java-classes" is equivalent to no java class
+- // filter and external tests don't access any java, not sure if this
+- // test contributes much. We need faster "ant clean test" cycle for
+- // developers.
+- public void runExternalJsTest() {
+- final String[] paths = new String[]{
+- "test/script/basic/compile-octane.js",
+- "test/script/basic/jquery.js",
+- "test/script/basic/prototype.js",
+- "test/script/basic/runsunspider.js",
+- "test/script/basic/underscore.js",
+- "test/script/basic/yui.js",
+- "test/script/basic/run-octane.js"
+- };
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- for (final String path : paths) {
+- final ScriptEngine engine = factory.getScriptEngine(new String[]{"-scripting"}, getClass().getClassLoader(), getClassFilter());
+- try {
+- engine.eval(new URLReader(new File(path).toURI().toURL()));
+- } catch (final Exception e) {
+- fail("Script " + path + " fails with exception :" + e.getMessage());
+- }
+- }
+- }
+-
+- @Test
+- public void noJavaOptionTest() {
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- final ScriptEngine engine = factory.getScriptEngine(new String[]{"--no-java"}, getClass().getClassLoader(), getClassFilter());
+- try {
+- engine.eval("var str = Java.type('java.lang.String');");
+- fail("TypeError should have been thrown");
+- } catch (final ScriptException e) {
+- //emtpy
+- }
+- }
+-
+- @Test
+- public void securityTest() {
+- if (System.getSecurityManager() == null) {
+- return;
+- }
+-
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- final ScriptEngine engine = factory.getScriptEngine(getClassFilter());
+- try {
+- engine.eval("var thread = Java.type('sun.misc.Unsafe')");
+- fail("SecurityException should have been thrown");
+- } catch (final Exception e) {
+- //empty
+- }
+- try {
+- engine.eval("var thread = new sun.misc.Unsafe()");
+- fail("SecurityException should have been thrown");
+- } catch (final Exception e) {
+- //empty
+- }
+- try {
+- engine.eval("var thread = Java.extend(sun.misc.Unsafe, {})");
+- fail("TypeError should have been thrown");
+- } catch (final Exception e) {
+- //empty
+- }
+- try {
+- engine.eval("java.lang.System.exit(0)");
+- fail("SecurityException should have been thrown");
+- } catch (final Exception e) {
+- //empty
+- }
+-
+- }
+-
+- @Test
+- public void persistentCacheTest() {
+- final String oldCodeCache = System.getProperty(NASHORN_CODE_CACHE);
+- System.setProperty(NASHORN_CODE_CACHE, CLASSFILTER_CODE_CACHE);
+- try {
+- persistentCacheTestImpl();
+- } finally {
+- if (oldCodeCache != null) {
+- System.setProperty(NASHORN_CODE_CACHE, oldCodeCache);
+- }
+- }
+- }
+-
+- private void persistentCacheTestImpl() {
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- final ScriptEngine engine = factory.getScriptEngine(
+- TestFinder.addExplicitOptimisticTypes(new String[]{"--persistent-code-cache", "--optimistic-types=true"}),
+- getClass().getClassLoader(),
+- getClassFilter()
+- );
+- final String testScript = "var a = Java.type('java.lang.String');" + generateCodeForPersistentStore();
+- try {
+- engine.eval(testScript);
+- } catch (final ScriptException exc) {
+- fail(exc.getMessage());
+- }
+- final ScriptEngine engineSafe = factory.getScriptEngine(
+- TestFinder.addExplicitOptimisticTypes(new String[]{"--persistent-code-cache", "--optimistic-types=true"}),
+- getClass().getClassLoader(),
+- new ClassFilter() {
+- @Override
+- public boolean exposeToScripts(final String s) {
+- return false;
+- }
+- }
+- );
+- try {
+- engineSafe.eval(testScript);
+- fail("ClassNotFoundException should have been thrown");
+- } catch (final Exception exc) {
+- if (!(exc.getCause() instanceof ClassNotFoundException)) {
+- fail("ClassNotFoundException expected, got " + exc.getClass());
+- }
+- }
+- }
+-
+- private static String generateCodeForPersistentStore() {
+- final StringBuilder stringBuilder = new StringBuilder();
+- for (int i=0; i < 100; i++) {
+- stringBuilder.append("function i")
+- .append(i)
+- .append("(y, z) { var x")
+- .append(i)
+- .append(" = ")
+- .append(i)
+- .append(";}");
+- }
+- return stringBuilder.toString();
+- }
+-
+- private static ClassFilter getClassFilter() {
+- return new ClassFilter() {
+- @Override
+- public boolean exposeToScripts(final String s) {
+- return true;
+- }
+- };
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/CodeStoreAndPathTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,188 +0,0 @@
+-/*
+- * Copyright (c) 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. 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.nashorn.internal.runtime;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertFalse;
+-import java.io.File;
+-import java.io.IOException;
+-import java.nio.file.DirectoryStream;
+-import java.nio.file.FileSystems;
+-import java.nio.file.Files;
+-import java.nio.file.Path;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptException;
+-import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+-import org.testng.annotations.Test;
+-
+-/**
+- * @test
+- * @bug 8039185 8039403
+- * @summary Test for persistent code cache and path handling
+- * @run testng jdk.nashorn.internal.runtime.CodeStoreAndPathTest
+- */
+-@SuppressWarnings("javadoc")
+-public class CodeStoreAndPathTest {
+-
+- final String code1 = "var code1; var x = 'Hello Script'; var x1 = 'Hello Script'; "
+- + "var x2 = 'Hello Script'; var x3 = 'Hello Script'; "
+- + "var x4 = 'Hello Script'; var x5 = 'Hello Script';"
+- + "var x6 = 'Hello Script'; var x7 = 'Hello Script'; "
+- + "var x8 = 'Hello Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';"
+- + "function f() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
+- + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
+- + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';}"
+- + "function g() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
+- + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
+- + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';}"
+- + "function h() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
+- + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
+- + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';}"
+- + "function i() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
+- + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
+- + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';}";
+- final String code2 = "var code2; var x = 'Hello Script'; var x1 = 'Hello Script'; "
+- + "var x2 = 'Hello Script'; var x3 = 'Hello Script'; "
+- + "var x4 = 'Hello Script'; var x5 = 'Hello Script';"
+- + "var x6 = 'Hello Script'; var x7 = 'Hello Script'; "
+- + "var x8 = 'Hello Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';"
+- + "function f() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
+- + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
+- + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';}"
+- + "function g() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
+- + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
+- + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';}"
+- + "function h() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
+- + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
+- + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';}"
+- + "function i() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
+- + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
+- + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
+- + "var x10 = 'Hello Script';}";
+- // Script size < Default minimum size for storing a compiled script class
+- final String code3 = "var code3; var x = 'Hello Script'; var x1 = 'Hello Script'; ";
+- final String codeCache = "build/nashorn_code_cache";
+- final String oldUserDir = System.getProperty("user.dir");
+-
+- private static final String[] ENGINE_OPTIONS_OPT = new String[]{"--persistent-code-cache", "--optimistic-types=true"};
+- private static final String[] ENGINE_OPTIONS_NOOPT = new String[]{"--persistent-code-cache", "--optimistic-types=false"};
+-
+- @Test
+- public void pathHandlingTest() {
+- System.setProperty("nashorn.persistent.code.cache", codeCache);
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+-
+- fac.getScriptEngine(ENGINE_OPTIONS_NOOPT);
+-
+- final Path expectedCodeCachePath = FileSystems.getDefault().getPath(oldUserDir + File.separator + codeCache);
+- final Path actualCodeCachePath = FileSystems.getDefault().getPath(System.getProperty(
+- "nashorn.persistent.code.cache")).toAbsolutePath();
+- // Check that nashorn code cache is created in current working directory
+- assertEquals(actualCodeCachePath, expectedCodeCachePath);
+- // Check that code cache dir exists and it's not empty
+- final File file = new File(actualCodeCachePath.toUri());
+- assertFalse(!file.isDirectory(), "No code cache directory was created!");
+- assertFalse(file.list().length == 0, "Code cache directory is empty!");
+- }
+-
+- @Test
+- public void changeUserDirTest() throws ScriptException, IOException {
+- System.setProperty("nashorn.persistent.code.cache", codeCache);
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- final ScriptEngine e = fac.getScriptEngine(ENGINE_OPTIONS_NOOPT);
+- final Path codeCachePath = getCodeCachePath(false);
+- final String newUserDir = "build/newUserDir";
+- // Now changing current working directory
+- System.setProperty("user.dir", System.getProperty("user.dir") + File.separator + newUserDir);
+- try {
+- // Check that a new compiled script is stored in existing code cache
+- e.eval(code1);
+- final DirectoryStream<Path> stream = Files.newDirectoryStream(codeCachePath);
+- checkCompiledScripts(stream, 1);
+- // Setting to default current working dir
+- } finally {
+- System.setProperty("user.dir", oldUserDir);
+- }
+- }
+-
+- @Test
+- public void codeCacheTest() throws ScriptException, IOException {
+- System.setProperty("nashorn.persistent.code.cache", codeCache);
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- final ScriptEngine e = fac.getScriptEngine(ENGINE_OPTIONS_NOOPT);
+- final Path codeCachePath = getCodeCachePath(false);
+- e.eval(code1);
+- e.eval(code2);
+- e.eval(code3);// less than minimum size for storing
+- // adding code1 and code2.
+- final DirectoryStream<Path> stream = Files.newDirectoryStream(codeCachePath);
+- checkCompiledScripts(stream, 2);
+- }
+-
+- @Test
+- public void codeCacheTestOpt() throws ScriptException, IOException {
+- System.setProperty("nashorn.persistent.code.cache", codeCache);
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- final ScriptEngine e = fac.getScriptEngine(ENGINE_OPTIONS_OPT);
+- final Path codeCachePath = getCodeCachePath(true);
+- e.eval(code1);
+- e.eval(code2);
+- e.eval(code3);// less than minimum size for storing
+- // adding code1 and code2.
+- final DirectoryStream<Path> stream = Files.newDirectoryStream(codeCachePath);
+- checkCompiledScripts(stream, 2);
+- }
+-
+- private static Path getCodeCachePath(final boolean optimistic) {
+- final String codeCache = System.getProperty("nashorn.persistent.code.cache");
+- final Path codeCachePath = FileSystems.getDefault().getPath(codeCache).toAbsolutePath();
+- final String[] files = codeCachePath.toFile().list();
+- for (final String file : files) {
+- if (file.endsWith("_opt") == optimistic) {
+- return codeCachePath.resolve(file);
+- }
+- }
+- throw new AssertionError("Code cache path not found");
+- }
+-
+- private static void checkCompiledScripts(final DirectoryStream<Path> stream, final int numberOfScripts) throws IOException {
+- int n = numberOfScripts;
+- for (@SuppressWarnings("unused") final Path file : stream) {
+- n--;
+- }
+- stream.close();
+- assertEquals(n, 0);
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/ConsStringTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,131 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime;
+-
+-import static org.testng.Assert.assertEquals;
+-
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests for JSType methods.
+- *
+- * @test
+- * @run testng jdk.nashorn.internal.runtime.ConsStringTest
+- */
+-public class ConsStringTest {
+-
+- /**
+- * Test toString conversion
+- */
+- @Test
+- public void testConsStringToString() {
+- final ConsString cs1 = new ConsString("b", "c");
+- final ConsString cs2 = new ConsString("d", "e");
+- final ConsString cs3 = new ConsString(cs1, cs2);
+- final ConsString cs4 = new ConsString(cs3, "f");
+- final ConsString cs5 = new ConsString("a", cs4);
+- assertEquals(cs5.toString(), "abcdef");
+- assertEquals(cs4.toString(), "bcdef");
+- assertEquals(cs3.toString(), "bcde");
+- assertEquals(cs2.toString(), "de");
+- assertEquals(cs1.toString(), "bc");
+- // ConsStrings should be flattened now
+- assertEquals(cs1.getComponents()[0], "bc");
+- assertEquals(cs1.getComponents()[1], "");
+- assertEquals(cs2.getComponents()[0], "de");
+- assertEquals(cs2.getComponents()[1], "");
+- assertEquals(cs3.getComponents()[0], "bcde");
+- assertEquals(cs3.getComponents()[1], "");
+- assertEquals(cs4.getComponents()[0], "bcdef");
+- assertEquals(cs4.getComponents()[1], "");
+- assertEquals(cs5.getComponents()[0], "abcdef");
+- assertEquals(cs5.getComponents()[1], "");
+- }
+-
+- /**
+- * Test charAt
+- */
+- @Test
+- public void testConsStringCharAt() {
+- final ConsString cs1 = new ConsString("b", "c");
+- final ConsString cs2 = new ConsString("d", "e");
+- final ConsString cs3 = new ConsString(cs1, cs2);
+- final ConsString cs4 = new ConsString(cs3, "f");
+- final ConsString cs5 = new ConsString("a", cs4);
+- assertEquals(cs1.charAt(1), 'c');
+- assertEquals(cs2.charAt(0), 'd');
+- assertEquals(cs3.charAt(3), 'e');
+- assertEquals(cs4.charAt(1), 'c');
+- assertEquals(cs5.charAt(2), 'c');
+- // ConsStrings should be flattened now
+- assertEquals(cs1.getComponents()[0], "bc");
+- assertEquals(cs1.getComponents()[1], "");
+- assertEquals(cs2.getComponents()[0], "de");
+- assertEquals(cs2.getComponents()[1], "");
+- assertEquals(cs3.getComponents()[0], "bcde");
+- assertEquals(cs3.getComponents()[1], "");
+- assertEquals(cs4.getComponents()[0], "bcdef");
+- assertEquals(cs4.getComponents()[1], "");
+- assertEquals(cs5.getComponents()[0], "abcdef");
+- assertEquals(cs5.getComponents()[1], "");
+- }
+-
+-
+- /**
+- * Test flattening of top-level and internal ConsStrings
+- */
+- @Test
+- public void testConsStringFlattening() {
+- final ConsString cs1 = new ConsString("b", "c");
+- final ConsString cs2 = new ConsString("d", "e");
+- final ConsString cs3 = new ConsString(cs1, cs2);
+- final ConsString cs4 = new ConsString(cs3, "f");
+-
+- final ConsString cs5 = new ConsString("a", cs4);
+- // top-level ConsString should not yet be flattened
+- assert(cs5.getComponents()[0] == "a");
+- assert(cs5.getComponents()[1] == cs4);
+- assertEquals(cs5.toString(), "abcdef");
+- // top-level ConsString should be flattened
+- assertEquals(cs5.getComponents()[0], "abcdef");
+- assertEquals(cs5.getComponents()[1], "");
+- // internal ConsString should not yet be flattened after first traversal
+- assertEquals(cs4.getComponents()[0], cs3);
+- assertEquals(cs4.getComponents()[1], "f");
+-
+- final ConsString cs6 = new ConsString("a", cs4);
+- // top-level ConsString should not yet be flattened
+- assertEquals(cs6.getComponents()[0], "a");
+- assertEquals(cs6.getComponents()[1], cs4);
+- assertEquals(cs6.toString(), "abcdef");
+- // top-level ConsString should be flattened
+- assertEquals(cs6.getComponents()[0], "abcdef");
+- assertEquals(cs6.getComponents()[1], "");
+- // internal ConsString should have been flattened after second traversal
+- assertEquals(cs4.getComponents()[0], "bcdef");
+- assertEquals(cs4.getComponents()[1], "");
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/ContextTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,138 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime;
+-
+-import static jdk.nashorn.internal.runtime.Source.sourceFor;
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertTrue;
+-import static org.testng.Assert.fail;
+-import java.util.Map;
+-import jdk.nashorn.internal.objects.Global;
+-import jdk.nashorn.internal.runtime.options.Options;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Basic Context API tests.
+- *
+- * @test
+- * @run testng jdk.nashorn.internal.runtime.ContextTest
+- */
+-@SuppressWarnings("javadoc")
+-public class ContextTest {
+- // basic context eval test
+- @Test
+- public void evalTest() {
+- final Options options = new Options("");
+- final ErrorManager errors = new ErrorManager();
+- final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
+- final Global oldGlobal = Context.getGlobal();
+- Context.setGlobal(cx.createGlobal());
+- try {
+- String code = "22 + 10";
+- assertTrue(32.0 == ((Number)(eval(cx, "<evalTest>", code))).doubleValue());
+-
+- code = "obj = { js: 'nashorn' }; obj.js";
+- assertEquals(eval(cx, "<evalTest2>", code), "nashorn");
+- } finally {
+- Context.setGlobal(oldGlobal);
+- }
+- }
+-
+- // Make sure trying to compile an invalid script returns null - see JDK-8046215.
+- @Test
+- public void compileErrorTest() {
+- final Options options = new Options("");
+- final ErrorManager errors = new ErrorManager();
+- final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
+- final Global oldGlobal = Context.getGlobal();
+- Context.setGlobal(cx.createGlobal());
+- try {
+- final ScriptFunction script = cx.compileScript(sourceFor("<evalCompileErrorTest>", "*/"), Context.getGlobal());
+- if (script != null) {
+- fail("Invalid script compiled without errors");
+- }
+- if (errors.getNumberOfErrors() != 1) {
+- fail("Wrong number of errors: " + errors.getNumberOfErrors());
+- }
+- } finally {
+- Context.setGlobal(oldGlobal);
+- }
+- }
+-
+- // basic check for JS reflection access - java.util.Map-like access on ScriptObject
+- @Test
+- public void reflectionTest() {
+- final Options options = new Options("");
+- final ErrorManager errors = new ErrorManager();
+- final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
+- final boolean strict = cx.getEnv()._strict;
+- final Global oldGlobal = Context.getGlobal();
+- Context.setGlobal(cx.createGlobal());
+-
+- try {
+- final String code = "var obj = { x: 344, y: 42 }";
+- eval(cx, "<reflectionTest>", code);
+-
+- final Object obj = Context.getGlobal().get("obj");
+-
+- assertTrue(obj instanceof ScriptObject);
+-
+- final ScriptObject sobj = (ScriptObject)obj;
+- int count = 0;
+- for (final Map.Entry<?, ?> ex : sobj.entrySet()) {
+- final Object key = ex.getKey();
+- if (key.equals("x")) {
+- assertTrue(ex.getValue() instanceof Number);
+- assertTrue(344.0 == ((Number)ex.getValue()).doubleValue());
+-
+- count++;
+- } else if (key.equals("y")) {
+- assertTrue(ex.getValue() instanceof Number);
+- assertTrue(42.0 == ((Number)ex.getValue()).doubleValue());
+-
+- count++;
+- }
+- }
+- assertEquals(count, 2);
+- assertEquals(sobj.size(), 2);
+-
+- // add property
+- sobj.put("zee", "hello", strict);
+- assertEquals(sobj.get("zee"), "hello");
+- assertEquals(sobj.size(), 3);
+-
+- } finally {
+- Context.setGlobal(oldGlobal);
+- }
+- }
+-
+- private static Object eval(final Context cx, final String name, final String code) {
+- final Source source = sourceFor(name, code);
+- final ScriptObject global = Context.getGlobal();
+- final ScriptFunction func = cx.compileScript(source, global);
+- return func != null ? ScriptRuntime.apply(func, global) : null;
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/ExceptionsNotSerializable.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,77 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.fail;
+-import java.io.ByteArrayOutputStream;
+-import java.io.IOException;
+-import java.io.NotSerializableException;
+-import java.io.ObjectOutputStream;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptException;
+-import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+-import org.testng.annotations.Test;
+-
+-/**
+- * JDK-8044518: Ensure exceptions related to optimistic recompilation are not serializable
+- *
+- * @test
+- * @run testng jdk.nashorn.internal.runtime.ExceptionsNotSerializable
+- */
+-@SuppressWarnings("javadoc")
+-public class ExceptionsNotSerializable {
+- @Test
+- public void rewriteExceptionNotSerializable() throws ScriptException {
+- // NOTE: we must create a RewriteException in a context of a Nashorn engine, as it uses Global.newIntance()
+- // internally.
+- final ScriptEngine e = new NashornScriptEngineFactory().getScriptEngine();
+- e.put("f", new Runnable() {
+- @Override
+- public void run() {
+- tryToSerialize(RewriteException.create(null, new Object[0], new String[0]));
+- }
+- });
+- e.eval("f()");
+- }
+-
+- @Test
+- public void unwarrantedOptimismExceptionNotSerializable() {
+- tryToSerialize(new UnwarrantedOptimismException(new Double(1.0), 128));
+- }
+-
+- private static void tryToSerialize(final Object obj) {
+- try {
+- new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(obj);
+- fail();
+- } catch (final NotSerializableException e) {
+- assertEquals(e.getMessage(), obj.getClass().getName());
+- } catch (final IOException e) {
+- fail("", e);
+- }
+-
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/JSTypeTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,193 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertFalse;
+-import static org.testng.Assert.assertTrue;
+-
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests for JSType methods.
+- *
+- * @test
+- * @run testng jdk.nashorn.internal.runtime.JSTypeTest
+- */
+-public class JSTypeTest {
+- /**
+- * Test of isPrimitive method, of class Runtime.
+- */
+- @Test
+- public void testIsPrimitive() {
+- assertTrue(JSType.isPrimitive(null));
+- assertTrue(JSType.isPrimitive(ScriptRuntime.UNDEFINED));
+- assertTrue(JSType.isPrimitive(Double.NaN));
+- assertTrue(JSType.isPrimitive(Double.NEGATIVE_INFINITY));
+- assertTrue(JSType.isPrimitive(Double.POSITIVE_INFINITY));
+- assertTrue(JSType.isPrimitive(0.0));
+- assertTrue(JSType.isPrimitive(3.14));
+- assertTrue(JSType.isPrimitive("hello"));
+- assertTrue(JSType.isPrimitive(""));
+- assertFalse(JSType.isPrimitive(new Object()));
+- }
+-
+- /**
+- * Test of toBoolean method, of class Runtime.
+- */
+- @Test
+- public void testToBoolean() {
+- assertFalse(JSType.toBoolean(ScriptRuntime.UNDEFINED));
+- assertFalse(JSType.toBoolean(null));
+- assertFalse(JSType.toBoolean(Boolean.FALSE));
+- assertTrue(JSType.toBoolean(Boolean.TRUE));
+- assertFalse(JSType.toBoolean(-0.0));
+- assertFalse(JSType.toBoolean(0.0));
+- assertFalse(JSType.toBoolean(Double.NaN));
+- assertTrue(JSType.toBoolean(3.14));
+- assertFalse(JSType.toBoolean(""));
+- assertTrue(JSType.toBoolean("javascript"));
+- assertTrue(JSType.toBoolean(new Object()));
+- }
+-
+- /**
+- * Test of toNumber method, of class Runtime.
+- */
+- @Test
+- public void testToNumber_Object() {
+- assertTrue(Double.isNaN(JSType.toNumber(ScriptRuntime.UNDEFINED)));
+- assertEquals(JSType.toNumber((Object)null), 0.0, 0.0);
+- assertEquals(JSType.toNumber(Boolean.TRUE), 1.0, 0.0);
+- assertEquals(JSType.toNumber(Boolean.FALSE), 0.0, 0.0);
+- assertEquals(JSType.toNumber(3.14), 3.14, 0.0);
+- // FIXME: add more assertions for specific String to number cases
+- // FIXME: add case for Object type (JSObject with getDefaultValue)
+- }
+-
+- /**
+- * Test of toString method, of class Runtime.
+- */
+- @Test
+- public void testToString_Object() {
+- assertEquals(JSType.toString(ScriptRuntime.UNDEFINED), "undefined");
+- assertEquals(JSType.toString(null), "null");
+- assertEquals(JSType.toString(Boolean.TRUE), "true");
+- assertEquals(JSType.toString(Boolean.FALSE), "false");
+- assertEquals(JSType.toString(""), "");
+- assertEquals(JSType.toString("nashorn"), "nashorn");
+- assertEquals(JSType.toString(Double.NaN), "NaN");
+- assertEquals(JSType.toString(Double.POSITIVE_INFINITY), "Infinity");
+- assertEquals(JSType.toString(Double.NEGATIVE_INFINITY), "-Infinity");
+- assertEquals(JSType.toString(0.0), "0");
+- // FIXME: add more number-to-string test cases
+- // FIXME: add case for Object type (JSObject with getDefaultValue)
+- }
+-
+- /**
+- * Test of JSType.toUint32(double)
+- */
+- @Test
+- public void testToUint32() {
+- assertEquals(JSType.toUint32(+0.0), 0);
+- assertEquals(JSType.toUint32(-0.0), 0);
+- assertEquals(JSType.toUint32(Double.NaN), 0);
+- assertEquals(JSType.toUint32(Double.POSITIVE_INFINITY), 0);
+- assertEquals(JSType.toUint32(Double.NEGATIVE_INFINITY), 0);
+- assertEquals(JSType.toUint32(9223372036854775807.0d), 0);
+- assertEquals(JSType.toUint32(-9223372036854775807.0d), 0);
+- assertEquals(JSType.toUint32(1099511627776.0d), 0);
+- assertEquals(JSType.toUint32(-1099511627776.0d), 0);
+- assertEquals(JSType.toUint32(4294967295.0d), 4294967295l);
+- assertEquals(JSType.toUint32(4294967296.0d), 0);
+- assertEquals(JSType.toUint32(4294967297.0d), 1);
+- assertEquals(JSType.toUint32(-4294967295.0d), 1);
+- assertEquals(JSType.toUint32(-4294967296.0d), 0);
+- assertEquals(JSType.toUint32(-4294967297.0d), 4294967295l);
+- assertEquals(JSType.toUint32(4294967295.6d), 4294967295l);
+- assertEquals(JSType.toUint32(4294967296.6d), 0);
+- assertEquals(JSType.toUint32(4294967297.6d), 1);
+- assertEquals(JSType.toUint32(-4294967295.6d), 1);
+- assertEquals(JSType.toUint32(-4294967296.6d), 0);
+- assertEquals(JSType.toUint32(-4294967297.6d), 4294967295l);
+- }
+-
+- /**
+- * Test of JSType.toInt32(double)
+- */
+- @Test
+- public void testToInt32() {
+- assertEquals(JSType.toInt32(+0.0), 0);
+- assertEquals(JSType.toInt32(-0.0), 0);
+- assertEquals(JSType.toInt32(Double.NaN), 0);
+- assertEquals(JSType.toInt32(Double.POSITIVE_INFINITY), 0);
+- assertEquals(JSType.toInt32(Double.NEGATIVE_INFINITY), 0);
+- assertEquals(JSType.toInt32(9223372036854775807.0d), 0);
+- assertEquals(JSType.toInt32(-9223372036854775807.0d), 0);
+- assertEquals(JSType.toInt32(1099511627776.0d), 0);
+- assertEquals(JSType.toInt32(-1099511627776.0d), 0);
+- assertEquals(JSType.toInt32(4294967295.0d), -1);
+- assertEquals(JSType.toInt32(4294967296.0d), 0);
+- assertEquals(JSType.toInt32(4294967297.0d), 1);
+- assertEquals(JSType.toInt32(-4294967295.0d), 1);
+- assertEquals(JSType.toInt32(-4294967296.0d), 0);
+- assertEquals(JSType.toInt32(-4294967297.d), -1);
+- assertEquals(JSType.toInt32(4294967295.6d), -1);
+- assertEquals(JSType.toInt32(4294967296.6d), 0);
+- assertEquals(JSType.toInt32(4294967297.6d), 1);
+- assertEquals(JSType.toInt32(-4294967295.6d), 1);
+- assertEquals(JSType.toInt32(-4294967296.6d), 0);
+- assertEquals(JSType.toInt32(-4294967297.6d), -1);
+- }
+-
+- /**
+- * Test of JSType.toUint16(double)
+- */
+- @Test
+- public void testToUint16() {
+- assertEquals(JSType.toUint16(+0.0), 0);
+- assertEquals(JSType.toUint16(-0.0), 0);
+- assertEquals(JSType.toUint16(Double.NaN), 0);
+- assertEquals(JSType.toUint16(Double.POSITIVE_INFINITY), 0);
+- assertEquals(JSType.toUint16(Double.NEGATIVE_INFINITY), 0);
+- assertEquals(JSType.toUint16(9223372036854775807.0d), 0);
+- assertEquals(JSType.toUint16(-9223372036854775807.0d), 0);
+- assertEquals(JSType.toUint16(1099511627776.0d), 0);
+- assertEquals(JSType.toUint16(-1099511627776.0d), 0);
+- assertEquals(JSType.toUint16(4294967295.0d), 65535);
+- assertEquals(JSType.toUint16(4294967296.0d), 0);
+- assertEquals(JSType.toUint16(4294967297.0d), 1);
+- assertEquals(JSType.toUint16(-4294967295.0d), 1);
+- assertEquals(JSType.toUint16(-4294967296.0d), 0);
+- assertEquals(JSType.toUint16(-4294967297.0d), 65535);
+- assertEquals(JSType.toUint16(4294967295.6d), 65535);
+- assertEquals(JSType.toUint16(4294967296.6d), 0);
+- assertEquals(JSType.toUint16(4294967297.6d), 1);
+- assertEquals(JSType.toUint16(-4294967295.6d), 1);
+- assertEquals(JSType.toUint16(-4294967296.6d), 0);
+- assertEquals(JSType.toUint16(-4294967297.6d), 65535);
+- }
+-
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/LexicalBindingTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,212 +0,0 @@
+-/*
+- * Copyright (c) 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. 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.nashorn.internal.runtime;
+-
+-import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+-import org.testng.annotations.Test;
+-
+-import javax.script.Bindings;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptException;
+-import javax.script.SimpleScriptContext;
+-
+-import static org.testng.Assert.assertEquals;
+-
+-/**
+- * Top-level lexical binding tests.
+- *
+- * @test
+- * @run testng jdk.nashorn.internal.runtime.LexicalBindingTest
+- */
+-@SuppressWarnings("javadoc")
+-public class LexicalBindingTest {
+-
+- final static String LANGUAGE_ES6 = "--language=es6";
+- final static int NUMBER_OF_CONTEXTS = 20;
+- final static int MEGAMORPHIC_LOOP_COUNT = 20;
+-
+- /**
+- * Test access to global var-declared variables for shared script classes with multiple globals.
+- */
+- @Test
+- public static void megamorphicVarTest() throws ScriptException, InterruptedException {
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- final ScriptEngine e = factory.getScriptEngine();
+- final ScriptContext[] contexts = new ScriptContext[NUMBER_OF_CONTEXTS];
+- final String sharedScript = "foo";
+-
+-
+- for (int i = 0; i < NUMBER_OF_CONTEXTS; i++) {
+- final ScriptContext context = contexts[i] = new SimpleScriptContext();
+- final Bindings b = e.createBindings();
+- context.setBindings(b, ScriptContext.ENGINE_SCOPE);
+- assertEquals(e.eval("var foo = '" + i + "';", context), null);
+- }
+-
+- for (int i = 0; i < NUMBER_OF_CONTEXTS; i++) {
+- final ScriptContext context = contexts[i];
+- assertEquals(e.eval(sharedScript, context), String.valueOf(i));
+- }
+- }
+-
+- /**
+- * Test access to global lexically declared variables for shared script classes with multiple globals.
+- */
+- @Test
+- public static void megamorphicMultiGlobalLetTest() throws ScriptException, InterruptedException {
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- final ScriptEngine e = factory.getScriptEngine(LANGUAGE_ES6);
+- final ScriptContext[] contexts = new ScriptContext[NUMBER_OF_CONTEXTS];
+- final String sharedScript = "foo";
+-
+-
+- for (int i = 0; i < NUMBER_OF_CONTEXTS; i++) {
+- final ScriptContext context = contexts[i] = new SimpleScriptContext();
+- final Bindings b = e.createBindings();
+- context.setBindings(b, ScriptContext.ENGINE_SCOPE);
+- assertEquals(e.eval("let foo = '" + i + "';", context), null);
+- }
+-
+- for (int i = 0; i < NUMBER_OF_CONTEXTS; i++) {
+- final ScriptContext context = contexts[i];
+- assertEquals(e.eval(sharedScript, context), String.valueOf(i));
+- }
+- }
+-
+-
+- /**
+- * Test access to global lexically declared variables for shared script classes with single global.
+- */
+- @Test
+- public static void megamorphicSingleGlobalLetTest() throws ScriptException, InterruptedException {
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- final ScriptEngine e = factory.getScriptEngine(LANGUAGE_ES6);
+- final String sharedGetterScript = "foo";
+- final String sharedSetterScript = "foo = 1";
+-
+- for (int i = 0; i < MEGAMORPHIC_LOOP_COUNT; i++) {
+- assertEquals(e.eval(sharedSetterScript), 1);
+- assertEquals(e.eval(sharedGetterScript), 1);
+- assertEquals(e.eval("delete foo; a" + i + " = 1; foo = " + i + ";"), i);
+- assertEquals(e.eval(sharedGetterScript), i);
+- }
+-
+- assertEquals(e.eval("let foo = 'foo';"), null);
+- assertEquals(e.eval(sharedGetterScript), "foo");
+- assertEquals(e.eval(sharedSetterScript), 1);
+- assertEquals(e.eval(sharedGetterScript), 1);
+- assertEquals(e.eval("this.foo"), MEGAMORPHIC_LOOP_COUNT - 1);
+- }
+-
+- /**
+- * Test access to global lexically declared variables for shared script classes with single global.
+- */
+- @Test
+- public static void megamorphicInheritedGlobalLetTest() throws ScriptException, InterruptedException {
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- final ScriptEngine e = factory.getScriptEngine(LANGUAGE_ES6);
+- final String sharedGetterScript = "foo";
+- final String sharedSetterScript = "foo = 1";
+-
+- for (int i = 0; i < MEGAMORPHIC_LOOP_COUNT; i++) {
+- assertEquals(e.eval(sharedSetterScript), 1);
+- assertEquals(e.eval(sharedGetterScript), 1);
+- assertEquals(e.eval("delete foo; a" + i + " = 1; Object.prototype.foo = " + i + ";"), i);
+- assertEquals(e.eval(sharedGetterScript), i);
+- }
+-
+- assertEquals(e.eval("let foo = 'foo';"), null);
+- assertEquals(e.eval(sharedGetterScript), "foo");
+- assertEquals(e.eval(sharedSetterScript), 1);
+- assertEquals(e.eval(sharedGetterScript), 1);
+- assertEquals(e.eval("this.foo"), MEGAMORPHIC_LOOP_COUNT - 1);
+- }
+-
+- /**
+- * Test multi-threaded access to global lexically declared variables for shared script classes with multiple globals.
+- */
+- @Test
+- public static void multiThreadedLetTest() throws ScriptException, InterruptedException {
+- final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+- final ScriptEngine e = factory.getScriptEngine(LANGUAGE_ES6);
+- final Bindings b = e.createBindings();
+- final ScriptContext origContext = e.getContext();
+- final ScriptContext newCtxt = new SimpleScriptContext();
+- newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
+- final String sharedScript = "foo";
+-
+- assertEquals(e.eval("let foo = 'original context';", origContext), null);
+- assertEquals(e.eval("let foo = 'new context';", newCtxt), null);
+-
+- final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
+- t1.start();
+- t2.start();
+- t1.join();
+- t2.join();
+-
+- assertEquals(e.eval("foo = 'newer context';", newCtxt), "newer context");
+- final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
+- final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
+-
+- t3.start();
+- t4.start();
+- t3.join();
+- t4.join();
+-
+- assertEquals(e.eval(sharedScript), "original context");
+- assertEquals(e.eval(sharedScript, newCtxt), "newer context");
+- }
+-
+- private static class ScriptRunner implements Runnable {
+-
+- final ScriptEngine engine;
+- final ScriptContext context;
+- final String source;
+- final Object expected;
+- final int iterations;
+-
+- ScriptRunner(final ScriptEngine engine, final ScriptContext context, final String source, final Object expected, final int iterations) {
+- this.engine = engine;
+- this.context = context;
+- this.source = source;
+- this.expected = expected;
+- this.iterations = iterations;
+- }
+-
+- @Override
+- public void run() {
+- try {
+- for (int i = 0; i < iterations; i++) {
+- assertEquals(engine.eval(source, context), expected);
+- }
+- } catch (final ScriptException se) {
+- throw new RuntimeException(se);
+- }
+- }
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/NoPersistenceCachingTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,140 +0,0 @@
+-/*
+- * Copyright (c) 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. 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.nashorn.internal.runtime;
+-
+-import static org.testng.Assert.fail;
+-import java.io.ByteArrayOutputStream;
+-import java.io.PrintStream;
+-import java.util.regex.Matcher;
+-import java.util.regex.Pattern;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineFactory;
+-import javax.script.ScriptEngineManager;
+-import javax.script.SimpleScriptContext;
+-import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+-import org.testng.annotations.AfterTest;
+-import org.testng.annotations.BeforeTest;
+-import org.testng.annotations.Test;
+-
+-/**
+- * @test
+- * @bug 8037378
+- * @summary Sanity tests for no persistence caching
+- * @run testng/othervm jdk.nashorn.internal.runtime.NoPersistenceCachingTest
+- */
+-@SuppressWarnings("javadoc")
+-public class NoPersistenceCachingTest {
+-
+- private ScriptEngine engine;
+- private ScriptContext context1, context2, context3;
+- private ByteArrayOutputStream stderr;
+- private PrintStream prevStderr;
+-
+- @BeforeTest
+- public void setupTest() {
+- stderr = new ByteArrayOutputStream();
+- prevStderr = System.err;
+- System.setErr(new PrintStream(stderr));
+- NashornScriptEngineFactory nashornFactory = null;
+- final ScriptEngineManager sm = new ScriptEngineManager();
+- for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
+- if (fac instanceof NashornScriptEngineFactory) {
+- nashornFactory = (NashornScriptEngineFactory) fac;
+- break;
+- }
+- }
+- if (nashornFactory == null) {
+- fail("Cannot find nashorn factory!");
+- }
+- // fine is enough for cache hits, finest produces way too much information
+- // TODO this should be ported to use the RuntimeEvents instead of screen scraping
+- // logs, as obviously this is very brittle
+- final String[] options = new String[]{"--log=compiler:fine"};
+- engine = nashornFactory.getScriptEngine(options);
+- context1 = engine.getContext();
+- context2 = new SimpleScriptContext();
+- context2.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
+- context3 = new SimpleScriptContext();
+- context3.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
+- }
+-
+- @AfterTest
+- public void setErrTest() {
+- System.setErr(prevStderr);
+- }
+-
+- public void runTest(final int numberOfContext, final String expectedOutputPattern,
+- final int expectedPatternOccurrence) {
+-
+- try {
+- switch (numberOfContext) {
+- case 2:
+- final String scriptTwoContexts = "print('HelloTwoContexts')";
+- engine.eval(scriptTwoContexts, context1);
+- engine.eval(scriptTwoContexts, context2);
+- break;
+- case 3:
+- final String scriptThreeContexts = "print('HelloThreeContexts')";
+- engine.eval(scriptThreeContexts, context1);
+- engine.eval(scriptThreeContexts, context2);
+- engine.eval(scriptThreeContexts, context3);
+- break;
+- default:
+- break;
+- }
+- } catch (final Exception se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+- final Pattern deoptimizing = Pattern.compile(expectedOutputPattern);
+- final Matcher matcher = deoptimizing.matcher(stderr.toString());
+- int matches = 0;
+- while (matcher.find()) {
+- matches++;
+- }
+- if (matches != expectedPatternOccurrence) {
+- fail("Number of cache hit is not correct, expected: "
+- + expectedPatternOccurrence + " and found: " + matches + "\n"
+- + stderr);
+- }
+- stderr.reset();
+- }
+-
+- private static String getCodeCachePattern() {
+- return ("\\[compiler\\]\\sCode\\scache\\shit\\sfor\\s<eval>\\savoiding\\srecompile.");
+- }
+-
+- @Test
+- public void twoContextTest() {
+- runTest(2, getCodeCachePattern(), 1);
+-
+- }
+-
+- @Test
+- public void threeContextTest() {
+- runTest(3, getCodeCachePattern(), 2);
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/SourceTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,124 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime;
+-
+-import static jdk.nashorn.internal.runtime.Source.sourceFor;
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertTrue;
+-import static org.testng.Assert.fail;
+-import java.io.File;
+-import java.io.IOException;
+-import java.io.InputStreamReader;
+-import java.io.Reader;
+-import java.net.URL;
+-import java.util.Arrays;
+-import jdk.nashorn.api.scripting.URLReader;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests different Source representations.
+- */
+-@SuppressWarnings("javadoc")
+-public class SourceTest {
+-
+- final private static String SOURCE_NAME = "source.js";
+- final private static String SOURCE_STRING = "var x = 1;";
+- final private static char[] SOURCE_CHARS = SOURCE_STRING.toCharArray();
+- final private static String RESOURCE_PATH = "resources/load_test.js";
+- final private static File SOURCE_FILE = new File("build/test/classes/jdk/nashorn/internal/runtime/" + RESOURCE_PATH);
+- final private static URL SOURCE_URL = SourceTest.class.getResource(RESOURCE_PATH);
+-
+-
+- @Test
+- public void testStringSource() {
+- testSources(sourceFor(SOURCE_NAME, SOURCE_STRING), sourceFor(SOURCE_NAME, SOURCE_STRING));
+- testSources(sourceFor(SOURCE_NAME, SOURCE_STRING), sourceFor(SOURCE_NAME, SOURCE_CHARS));
+- }
+-
+- @Test
+- public void testCharArraySource() {
+- testSources(sourceFor(SOURCE_NAME, SOURCE_CHARS), sourceFor(SOURCE_NAME, SOURCE_CHARS));
+- testSources(sourceFor(SOURCE_NAME, SOURCE_CHARS), sourceFor(SOURCE_NAME, SOURCE_STRING));
+- }
+-
+- @Test
+- public void testURLSource() {
+- try {
+- testSources(sourceFor(SOURCE_NAME, SOURCE_URL), sourceFor(SOURCE_NAME, SOURCE_URL));
+- testSources(sourceFor(SOURCE_NAME, SOURCE_URL), sourceFor(SOURCE_NAME, new URLReader(SOURCE_URL)));
+-
+- } catch (final IOException e) {
+- fail(e.toString());
+- }
+- }
+-
+- @Test
+- public void testURLReaderSource() {
+- try {
+- System.err.println(SourceTest.class.getResource(""));
+- testSources(sourceFor(SOURCE_NAME, new URLReader(SOURCE_URL)), sourceFor(SOURCE_NAME, new URLReader(SOURCE_URL)));
+- testSources(sourceFor(SOURCE_NAME, new URLReader(SOURCE_URL)), sourceFor(SOURCE_NAME, SOURCE_URL));
+- } catch (final IOException e) {
+- fail(e.toString());
+- }
+- }
+-
+- @Test
+- public void testReaderSource() {
+- try {
+- testSources(sourceFor(SOURCE_NAME, getReader(RESOURCE_PATH)), sourceFor(SOURCE_NAME, getReader(RESOURCE_PATH)));
+- } catch (final IOException e) {
+- fail(e.toString());
+- }
+- }
+-
+- @Test
+- public void testFileSource() {
+- try {
+- testSources(sourceFor(SOURCE_NAME, SOURCE_FILE), sourceFor(SOURCE_NAME, SOURCE_FILE));
+- } catch (final IOException e) {
+- fail(e.toString());
+- }
+- }
+-
+- private static Reader getReader(final String path) {
+- return new InputStreamReader(SourceTest.class.getResourceAsStream(path));
+- }
+-
+- private static void testSources(final Source source1, final Source source2) {
+- final char[] chars1 = source1.getContent();
+- final char[] chars2 = source2.getContent();
+- final String str1 = source1.getString();
+- final String str2 = source2.getString();
+- assertTrue(Arrays.equals(chars1, chars2));
+- assertEquals(str1, str2);
+- assertEquals(source1.hashCode(), source2.hashCode());
+- assertTrue(source1.equals(source2));
+- assertTrue(Arrays.equals(source1.getContent(), str1.toCharArray()));
+- assertTrue(Arrays.equals(source1.getContent(), chars1));
+- assertTrue(Arrays.equals(source1.getContent(), source2.getContent()));
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,362 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertTrue;
+-import static org.testng.Assert.fail;
+-import javax.script.ScriptContext;
+-import javax.script.ScriptEngine;
+-import javax.script.ScriptEngineFactory;
+-import javax.script.ScriptEngineManager;
+-import javax.script.ScriptException;
+-import javax.script.SimpleScriptContext;
+-import jdk.nashorn.api.scripting.ClassFilter;
+-import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+-import org.testng.annotations.Test;
+-
+-/**
+- * Tests for trusted client usage of nashorn script engine factory extension API
+- */
+-@SuppressWarnings("javadoc")
+-public class TrustedScriptEngineTest {
+- @Test
+- public void versionTest() {
+- final ScriptEngineManager m = new ScriptEngineManager();
+- final ScriptEngine e = m.getEngineByName("nashorn");
+- assertEquals(e.getFactory().getEngineVersion(), Version.version());
+- }
+-
+- private static class MyClassLoader extends ClassLoader {
+- // to check if script engine uses the specified class loader
+- private final boolean[] reached = new boolean[1];
+-
+- @Override
+- protected Class<?> findClass(final String name) throws ClassNotFoundException {
+- // flag that it reached here
+- reached[0] = true;
+- return super.findClass(name);
+- }
+-
+- public boolean reached() {
+- return reached[0];
+- }
+- }
+-
+- // These are for "private" extension API of NashornScriptEngineFactory that
+- // accepts a ClassLoader and/or command line options.
+-
+- @Test
+- public void factoryClassLoaderTest() {
+- final ScriptEngineManager sm = new ScriptEngineManager();
+- for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
+- if (fac instanceof NashornScriptEngineFactory) {
+- final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
+- final MyClassLoader loader = new MyClassLoader();
+- // set the classloader as app class loader
+- final ScriptEngine e = nfac.getScriptEngine(loader);
+- try {
+- e.eval("Packages.foo");
+- // check that the class loader was attempted
+- assertTrue(loader.reached(), "did not reach class loader!");
+- } catch (final ScriptException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+- return;
+- }
+- }
+-
+- fail("Cannot find nashorn factory!");
+- }
+-
+- @Test
+- public void factoryClassLoaderAndOptionsTest() {
+- final ScriptEngineManager sm = new ScriptEngineManager();
+- for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
+- if (fac instanceof NashornScriptEngineFactory) {
+- final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
+- final String[] options = new String[] { "-strict" };
+- final MyClassLoader loader = new MyClassLoader();
+- // set the classloader as app class loader
+- final ScriptEngine e = nfac.getScriptEngine(options, loader);
+- try {
+- e.eval("Packages.foo");
+- // check that the class loader was attempted
+- assertTrue(loader.reached(), "did not reach class loader!");
+- } catch (final ScriptException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+-
+- try {
+- // strict mode - delete of a var should throw SyntaxError
+- e.eval("var d = 2; delete d;");
+- } catch (final ScriptException se) {
+- // check that the error message contains "SyntaxError"
+- assertTrue(se.getMessage().contains("SyntaxError"));
+- }
+-
+- return;
+- }
+- }
+-
+- fail("Cannot find nashorn factory!");
+- }
+-
+- @Test
+- public void factoryOptionsTest() {
+- final ScriptEngineManager sm = new ScriptEngineManager();
+- for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
+- if (fac instanceof NashornScriptEngineFactory) {
+- final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
+- // specify --no-syntax-extensions flag
+- final String[] options = new String[] { "--no-syntax-extensions" };
+- final ScriptEngine e = nfac.getScriptEngine(options);
+- try {
+- // try nashorn specific extension
+- e.eval("var f = funtion(x) 2*x;");
+- fail("should have thrown exception!");
+- } catch (final Exception ex) {
+- //empty
+- }
+- return;
+- }
+- }
+-
+- fail("Cannot find nashorn factory!");
+- }
+-
+- @Test
+- /**
+- * Test repeated evals with --loader-per-compile=false
+- * We used to get "class redefinition error".
+- */
+- public void noLoaderPerCompilerTest() {
+- final ScriptEngineManager sm = new ScriptEngineManager();
+- for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
+- if (fac instanceof NashornScriptEngineFactory) {
+- final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
+- final String[] options = new String[] { "--loader-per-compile=false" };
+- final ScriptEngine e = nfac.getScriptEngine(options);
+- try {
+- e.eval("2 + 3");
+- e.eval("4 + 4");
+- } catch (final ScriptException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+- return;
+- }
+- }
+- fail("Cannot find nashorn factory!");
+- }
+-
+- @Test
+- /**
+- * Test that we can use same script name in repeated evals with --loader-per-compile=false
+- * We used to get "class redefinition error" as name was derived from script name.
+- */
+- public void noLoaderPerCompilerWithSameNameTest() {
+- final ScriptEngineManager sm = new ScriptEngineManager();
+- for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
+- if (fac instanceof NashornScriptEngineFactory) {
+- final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
+- final String[] options = new String[] { "--loader-per-compile=false" };
+- final ScriptEngine e = nfac.getScriptEngine(options);
+- e.put(ScriptEngine.FILENAME, "test.js");
+- try {
+- e.eval("2 + 3");
+- e.eval("4 + 4");
+- } catch (final ScriptException se) {
+- se.printStackTrace();
+- fail(se.getMessage());
+- }
+- return;
+- }
+- }
+- fail("Cannot find nashorn factory!");
+- }
+-
+- @Test
+- public void globalPerEngineTest() throws ScriptException {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- final String[] options = new String[] { "--global-per-engine" };
+- final ScriptEngine e = fac.getScriptEngine(options);
+-
+- e.eval("function foo() {}");
+-
+- final ScriptContext newCtx = new SimpleScriptContext();
+- newCtx.setBindings(e.createBindings(), ScriptContext.ENGINE_SCOPE);
+-
+- // all global definitions shared and so 'foo' should be
+- // visible in new Bindings as well.
+- assertTrue(e.eval("typeof foo", newCtx).equals("function"));
+-
+- e.eval("function bar() {}", newCtx);
+-
+- // bar should be visible in default context
+- assertTrue(e.eval("typeof bar").equals("function"));
+- }
+-
+- @Test
+- public void classFilterTest() throws ScriptException {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- final ScriptEngine e = fac.getScriptEngine(new ClassFilter() {
+- @Override
+- public boolean exposeToScripts(final String fullName) {
+- // don't allow anything that is not "java."
+- return fullName.startsWith("java.");
+- }
+- });
+-
+- assertEquals(e.eval("typeof javax.script.ScriptEngine"), "object");
+- assertEquals(e.eval("typeof java.util.Vector"), "function");
+-
+- try {
+- e.eval("Java.type('javax.script.ScriptContext')");
+- fail("should not reach here");
+- } catch (final ScriptException | RuntimeException se) {
+- if (! (se.getCause() instanceof ClassNotFoundException)) {
+- fail("ClassNotFoundException expected");
+- }
+- }
+- }
+-
+- @Test
+- public void classFilterTest2() throws ScriptException {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- final ScriptEngine e = fac.getScriptEngine(new String[0], Thread.currentThread().getContextClassLoader(),
+- new ClassFilter() {
+- @Override
+- public boolean exposeToScripts(final String fullName) {
+- // don't allow anything that is not "java."
+- return fullName.startsWith("java.");
+- }
+- });
+-
+- assertEquals(e.eval("typeof javax.script.ScriptEngine"), "object");
+- assertEquals(e.eval("typeof java.util.Vector"), "function");
+-
+- try {
+- e.eval("Java.type('javax.script.ScriptContext')");
+- fail("should not reach here");
+- } catch (final ScriptException | RuntimeException se) {
+- if (! (se.getCause() instanceof ClassNotFoundException)) {
+- fail("ClassNotFoundException expected");
+- }
+- }
+- }
+-
+- @Test
+- public void nullClassFilterTest() {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- try {
+- fac.getScriptEngine((ClassFilter)null);
+- fail("should have thrown NPE");
+- } catch (final NullPointerException e) {
+- //empty
+- }
+- }
+-
+- @Test
+- public void nullClassFilterTest2() {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- try {
+- fac.getScriptEngine(new String[0], null, null);
+- fail("should have thrown NPE");
+- } catch (final NullPointerException e) {
+- //empty
+- }
+- }
+-
+- @Test
+- public void nullArgsTest() {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- try {
+- fac.getScriptEngine((String[])null);
+- fail("should have thrown NPE");
+- } catch (final NullPointerException e) {
+- //empty
+- }
+- }
+-
+- @Test
+- public void nullArgsTest2() {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- try {
+- fac.getScriptEngine(null, null, new ClassFilter() {
+- @Override
+- public boolean exposeToScripts(final String name) {
+- return true;
+- }
+- });
+- fail("should have thrown NPE");
+- } catch (final NullPointerException e) {
+- //empty
+- }
+- }
+-
+- @Test
+- public void nashornSwallowsConstKeyword() throws Exception {
+- final NashornScriptEngineFactory f = new NashornScriptEngineFactory();
+- final String[] args = new String[] { "--const-as-var" };
+- final ScriptEngine engine = f.getScriptEngine(args);
+-
+- final Object ret = engine.eval(""
+- + "(function() {\n"
+- + " const x = 10;\n"
+- + " return x;\n"
+- + "})();"
+- );
+- assertEquals(ret, 10, "Parsed and executed OK");
+- }
+-
+- @Test
+- public void evalDefaultFileNameTest() throws ScriptException {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- final ScriptEngine engine = fac.getScriptEngine(new String[] { "--verify-code=true" });
+- // default FILENAME being "<eval>" make sure generated code bytecode verifies.
+- engine.eval("var a = 3;");
+- }
+-
+- @Test
+- public void evalFileNameWithSpecialCharsTest() throws ScriptException {
+- final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
+- final ScriptEngine engine = fac.getScriptEngine(new String[] { "--verify-code=true" });
+- final ScriptContext ctxt = new SimpleScriptContext();
+- // use file name with "dangerous" chars.
+- ctxt.setAttribute(ScriptEngine.FILENAME, "<myscript>", ScriptContext.ENGINE_SCOPE);
+- engine.eval("var a = 3;");
+- ctxt.setAttribute(ScriptEngine.FILENAME, "[myscript]", ScriptContext.ENGINE_SCOPE);
+- engine.eval("var h = 'hello';");
+- ctxt.setAttribute(ScriptEngine.FILENAME, ";/\\$.", ScriptContext.ENGINE_SCOPE);
+- engine.eval("var foo = 'world';");
+- // name used by jjs shell tool for the interactive mode
+- ctxt.setAttribute(ScriptEngine.FILENAME, "<shell>", ScriptContext.ENGINE_SCOPE);
+- engine.eval("var foo = 'world';");
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/regexp/JdkRegExpTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,60 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.regexp;
+-
+-import static org.testng.Assert.assertEquals;
+-import static org.testng.Assert.assertNotNull;
+-import static org.testng.Assert.assertTrue;
+-
+-import org.testng.annotations.Test;
+-
+-/**
+- * Basic tests for the JDK based RegExp implementation.
+- *
+- * @test
+- * @run testng jdk.nashorn.internal.runtime.regexp.JdkRegExpTest
+- */
+-public class JdkRegExpTest {
+-
+- /**
+- * Compile a regular expression using the JDK implementation
+- */
+- @Test
+- public void testMatcher() {
+- final RegExp regexp = new RegExpFactory().compile("f(o)o", "");
+- final RegExpMatcher matcher = regexp.match("foo");
+- assertNotNull(matcher);
+- assertTrue(matcher.search(0));
+- assertEquals(matcher.getInput(), "foo");
+- assertEquals(matcher.groupCount(), 1);
+- assertEquals(matcher.group(), "foo");
+- assertEquals(matcher.start(), 0);
+- assertEquals(matcher.end(), 3);
+- assertEquals(matcher.group(1), "o");
+- assertEquals(matcher.start(1), 1);
+- assertEquals(matcher.end(1), 2);
+- }
+-}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/regexp/joni/JoniTest.java Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,50 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.regexp.joni;
+-
+-import org.testng.annotations.Test;
+-
+-/**
+- * Joni coverage tests
+- *
+- * @test
+- * @run testng jdk.nashorn.internal.runtime.regexp.joni.JoniTest
+- */
+-@SuppressWarnings("javadoc")
+-public class JoniTest {
+-
+- @Test
+- public void testDump() {
+- new Regex("^a{3,}(.*)[z]++\\s\\1x$").dumpTree();
+- new Regex("^a{3,}(.*)[z]++\\s\\1x$").dumpByteCode();
+- new Regex("(abc){4,}{2,5}").dumpTree();
+- new Regex("(abc){4,}{2,5}").dumpByteCode();
+- new Regex("aaa|aa|bbbb|ccc").dumpTree();
+- new Regex("aaa|aa|bbbb|ccc").dumpByteCode();
+- new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpTree();
+- new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpByteCode();
+- }
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/regexp/joni/test/JoniTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,51 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.regexp.joni.test;
++
++import jdk.nashorn.internal.runtime.regexp.joni.Regex;
++import org.testng.annotations.Test;
++
++/**
++ * Joni coverage tests
++ *
++ * @test
++ * @run testng jdk.nashorn.internal.runtime.regexp.joni.test.JoniTest
++ */
++@SuppressWarnings("javadoc")
++public class JoniTest {
++
++ @Test
++ public void testDump() {
++ new Regex("^a{3,}(.*)[z]++\\s\\1x$").dumpTree();
++ new Regex("^a{3,}(.*)[z]++\\s\\1x$").dumpByteCode();
++ new Regex("(abc){4,}{2,5}").dumpTree();
++ new Regex("(abc){4,}{2,5}").dumpByteCode();
++ new Regex("aaa|aa|bbbb|ccc").dumpTree();
++ new Regex("aaa|aa|bbbb|ccc").dumpByteCode();
++ new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpTree();
++ new Regex("(?:ZFVR.(\\d+\\.\\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))").dumpByteCode();
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/regexp/test/JdkRegExpTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,63 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.regexp.test;
++
++import jdk.nashorn.internal.runtime.regexp.RegExp;
++import jdk.nashorn.internal.runtime.regexp.RegExpFactory;
++import jdk.nashorn.internal.runtime.regexp.RegExpMatcher;
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertNotNull;
++import static org.testng.Assert.assertTrue;
++
++import org.testng.annotations.Test;
++
++/**
++ * Basic tests for the JDK based RegExp implementation.
++ *
++ * @test
++ * @run testng jdk.nashorn.internal.runtime.regexp.test.JdkRegExpTest
++ */
++public class JdkRegExpTest {
++
++ /**
++ * Compile a regular expression using the JDK implementation
++ */
++ @Test
++ public void testMatcher() {
++ final RegExp regexp = new RegExpFactory().compile("f(o)o", "");
++ final RegExpMatcher matcher = regexp.match("foo");
++ assertNotNull(matcher);
++ assertTrue(matcher.search(0));
++ assertEquals(matcher.getInput(), "foo");
++ assertEquals(matcher.groupCount(), 1);
++ assertEquals(matcher.group(), "foo");
++ assertEquals(matcher.start(), 0);
++ assertEquals(matcher.end(), 3);
++ assertEquals(matcher.group(1), "o");
++ assertEquals(matcher.start(1), 1);
++ assertEquals(matcher.end(1), 2);
++ }
++}
+--- ./nashorn/test/src/jdk/nashorn/internal/runtime/resources/load_test.js Mon Jun 01 11:44:30 2015 -0700
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,28 +0,0 @@
+-/*
+- * Copyright (c) 2010, 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. 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.
+- */
+-
+-function loadedFunc(arg) {
+- return arg.toUpperCase();
+-}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/AddAndRemoveOnListAdapterOutsideOfJavaScriptContextTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,102 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.internal.runtime.test;
++
++import static org.testng.Assert.assertEquals;
++
++import java.util.Arrays;
++import java.util.Deque;
++import java.util.List;
++import javax.script.ScriptEngine;
++import javax.script.ScriptException;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import org.testng.annotations.Test;
++
++/**
++ * @bug 8081204
++ * @summary adding and removing elements to a ListAdapter outside of JS context should work.
++ */
++@SuppressWarnings("javadoc")
++public class AddAndRemoveOnListAdapterOutsideOfJavaScriptContextTest {
++
++ @SuppressWarnings("unchecked")
++ private static <T> T getListAdapter() throws ScriptException {
++ final ScriptEngine engine = new NashornScriptEngineFactory().getScriptEngine();
++ return (T)engine.eval("Java.to([1, 2, 3, 4], 'java.util.List')");
++ }
++
++ @Test
++ public void testInvokePush() throws ScriptException {
++ final Deque<Object> l = getListAdapter();
++ l.addLast(5);
++ assertEquals(l.size(), 5);
++ assertEquals(l.getLast(), 5);
++ assertEquals(l.getFirst(), 1);
++ }
++
++ @Test
++ public void testPop() throws ScriptException {
++ final Deque<Object> l = getListAdapter();
++ assertEquals(l.removeLast(), 4);
++ assertEquals(l.size(), 3);
++ assertEquals(l.getLast(), 3);
++ }
++
++ @Test
++ public void testUnshift() throws ScriptException {
++ final Deque<Object> l = getListAdapter();
++ l.addFirst(0);
++ assertEquals(l.getFirst(), 0);
++ assertEquals(l.getLast(), 4);
++ assertEquals(l.size(), 5);
++ }
++
++ @Test
++ public void testShift() throws ScriptException {
++ final Deque<Object> l = getListAdapter();
++ l.removeFirst();
++ assertEquals(l.getFirst(), 2);
++ assertEquals(l.getLast(), 4);
++ assertEquals(l.size(), 3);
++ }
++
++ @Test
++ public void testSpliceAdd() throws ScriptException {
++ final List<Object> l = getListAdapter();
++ assertEquals(l, Arrays.asList(1, 2, 3, 4));
++ l.add(2, "foo");
++ assertEquals(l, Arrays.asList(1, 2, "foo", 3, 4));
++ }
++
++
++ @Test
++ public void testSpliceRemove() throws ScriptException {
++ final List<Object> l = getListAdapter();
++ assertEquals(l, Arrays.asList(1, 2, 3, 4));
++ l.remove(2);
++ assertEquals(l, Arrays.asList(1, 2, 4));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/ClassFilterTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,185 @@
++/*
++ * Copyright (c) 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. 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.nashorn.internal.runtime.test;
++
++import static org.testng.Assert.fail;
++import java.io.File;
++import javax.script.ScriptEngine;
++import javax.script.ScriptException;
++import jdk.nashorn.api.scripting.ClassFilter;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import jdk.nashorn.api.scripting.URLReader;
++import jdk.nashorn.internal.test.framework.TestFinder;
++import org.testng.annotations.Test;
++
++@SuppressWarnings("javadoc")
++public class ClassFilterTest {
++ private static final String NASHORN_CODE_CACHE = "nashorn.persistent.code.cache";
++ private static final String CLASSFILTER_CODE_CACHE = "build/classfilter_nashorn_code_cache";
++
++ // @Test
++ // This test takes too much time for basic "ant clean test" run.
++ // Given that "allow-all-java-classes" is equivalent to no java class
++ // filter and external tests don't access any java, not sure if this
++ // test contributes much. We need faster "ant clean test" cycle for
++ // developers.
++ public void runExternalJsTest() {
++ final String[] paths = new String[]{
++ "test/script/basic/compile-octane.js",
++ "test/script/basic/jquery.js",
++ "test/script/basic/prototype.js",
++ "test/script/basic/runsunspider.js",
++ "test/script/basic/underscore.js",
++ "test/script/basic/yui.js",
++ "test/script/basic/run-octane.js"
++ };
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ for (final String path : paths) {
++ final ScriptEngine engine = factory.getScriptEngine(new String[]{"-scripting"}, getClass().getClassLoader(), getClassFilter());
++ try {
++ engine.eval(new URLReader(new File(path).toURI().toURL()));
++ } catch (final Exception e) {
++ fail("Script " + path + " fails with exception :" + e.getMessage());
++ }
++ }
++ }
++
++ @Test
++ public void noJavaOptionTest() {
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ final ScriptEngine engine = factory.getScriptEngine(new String[]{"--no-java"}, getClass().getClassLoader(), getClassFilter());
++ try {
++ engine.eval("var str = Java.type('java.lang.String');");
++ fail("TypeError should have been thrown");
++ } catch (final ScriptException e) {
++ //emtpy
++ }
++ }
++
++ @Test
++ public void securityTest() {
++ if (System.getSecurityManager() == null) {
++ return;
++ }
++
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ final ScriptEngine engine = factory.getScriptEngine(getClassFilter());
++ try {
++ engine.eval("var thread = Java.type('sun.misc.Unsafe')");
++ fail("SecurityException should have been thrown");
++ } catch (final Exception e) {
++ //empty
++ }
++ try {
++ engine.eval("var thread = new sun.misc.Unsafe()");
++ fail("SecurityException should have been thrown");
++ } catch (final Exception e) {
++ //empty
++ }
++ try {
++ engine.eval("var thread = Java.extend(sun.misc.Unsafe, {})");
++ fail("TypeError should have been thrown");
++ } catch (final Exception e) {
++ //empty
++ }
++ try {
++ engine.eval("java.lang.System.exit(0)");
++ fail("SecurityException should have been thrown");
++ } catch (final Exception e) {
++ //empty
++ }
++
++ }
++
++ @Test
++ public void persistentCacheTest() {
++ final String oldCodeCache = System.getProperty(NASHORN_CODE_CACHE);
++ System.setProperty(NASHORN_CODE_CACHE, CLASSFILTER_CODE_CACHE);
++ try {
++ persistentCacheTestImpl();
++ } finally {
++ if (oldCodeCache != null) {
++ System.setProperty(NASHORN_CODE_CACHE, oldCodeCache);
++ }
++ }
++ }
++
++ private void persistentCacheTestImpl() {
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ final ScriptEngine engine = factory.getScriptEngine(
++ TestFinder.addExplicitOptimisticTypes(new String[]{"--persistent-code-cache", "--optimistic-types=true"}),
++ getClass().getClassLoader(),
++ getClassFilter()
++ );
++ final String testScript = "var a = Java.type('java.lang.String');" + generateCodeForPersistentStore();
++ try {
++ engine.eval(testScript);
++ } catch (final ScriptException exc) {
++ fail(exc.getMessage());
++ }
++ final ScriptEngine engineSafe = factory.getScriptEngine(
++ TestFinder.addExplicitOptimisticTypes(new String[]{"--persistent-code-cache", "--optimistic-types=true"}),
++ getClass().getClassLoader(),
++ new ClassFilter() {
++ @Override
++ public boolean exposeToScripts(final String s) {
++ return false;
++ }
++ }
++ );
++ try {
++ engineSafe.eval(testScript);
++ fail("ClassNotFoundException should have been thrown");
++ } catch (final Exception exc) {
++ if (!(exc.getCause() instanceof ClassNotFoundException)) {
++ fail("ClassNotFoundException expected, got " + exc.getClass());
++ }
++ }
++ }
++
++ private static String generateCodeForPersistentStore() {
++ final StringBuilder stringBuilder = new StringBuilder();
++ for (int i=0; i < 100; i++) {
++ stringBuilder.append("function i")
++ .append(i)
++ .append("(y, z) { var x")
++ .append(i)
++ .append(" = ")
++ .append(i)
++ .append(";}");
++ }
++ return stringBuilder.toString();
++ }
++
++ private static ClassFilter getClassFilter() {
++ return new ClassFilter() {
++ @Override
++ public boolean exposeToScripts(final String s) {
++ return true;
++ }
++ };
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/CodeStoreAndPathTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,189 @@
++/*
++ * Copyright (c) 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. 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.nashorn.internal.runtime.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertFalse;
++import java.io.File;
++import java.io.IOException;
++import java.nio.file.DirectoryStream;
++import java.nio.file.FileSystems;
++import java.nio.file.Files;
++import java.nio.file.Path;
++import javax.script.ScriptEngine;
++import javax.script.ScriptException;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import org.testng.annotations.Test;
++
++/**
++ * @ignore Fails with jtreg, but passes with ant test run. Ignore for now.
++ * @test
++ * @bug 8039185 8039403
++ * @summary Test for persistent code cache and path handling
++ * @run testng jdk.nashorn.internal.runtime.test.CodeStoreAndPathTest
++ */
++@SuppressWarnings("javadoc")
++public class CodeStoreAndPathTest {
++
++ final String code1 = "var code1; var x = 'Hello Script'; var x1 = 'Hello Script'; "
++ + "var x2 = 'Hello Script'; var x3 = 'Hello Script'; "
++ + "var x4 = 'Hello Script'; var x5 = 'Hello Script';"
++ + "var x6 = 'Hello Script'; var x7 = 'Hello Script'; "
++ + "var x8 = 'Hello Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';"
++ + "function f() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
++ + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
++ + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';}"
++ + "function g() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
++ + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
++ + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';}"
++ + "function h() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
++ + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
++ + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';}"
++ + "function i() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
++ + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
++ + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';}";
++ final String code2 = "var code2; var x = 'Hello Script'; var x1 = 'Hello Script'; "
++ + "var x2 = 'Hello Script'; var x3 = 'Hello Script'; "
++ + "var x4 = 'Hello Script'; var x5 = 'Hello Script';"
++ + "var x6 = 'Hello Script'; var x7 = 'Hello Script'; "
++ + "var x8 = 'Hello Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';"
++ + "function f() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
++ + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
++ + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';}"
++ + "function g() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
++ + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
++ + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';}"
++ + "function h() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
++ + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
++ + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';}"
++ + "function i() {x ='Bye Script'; x1 ='Bye Script'; x2='Bye Script';"
++ + "x3='Bye Script'; x4='Bye Script'; x5='Bye Script'; x6='Bye Script';"
++ + "x7='Bye Script'; x8='Bye Script'; var x9 = 'Hello Script'; "
++ + "var x10 = 'Hello Script';}";
++ // Script size < Default minimum size for storing a compiled script class
++ final String code3 = "var code3; var x = 'Hello Script'; var x1 = 'Hello Script'; ";
++ final String codeCache = "build/nashorn_code_cache";
++ final String oldUserDir = System.getProperty("user.dir");
++
++ private static final String[] ENGINE_OPTIONS_OPT = new String[]{"--persistent-code-cache", "--optimistic-types=true"};
++ private static final String[] ENGINE_OPTIONS_NOOPT = new String[]{"--persistent-code-cache", "--optimistic-types=false"};
++
++ @Test
++ public void pathHandlingTest() {
++ System.setProperty("nashorn.persistent.code.cache", codeCache);
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++
++ fac.getScriptEngine(ENGINE_OPTIONS_NOOPT);
++
++ final Path expectedCodeCachePath = FileSystems.getDefault().getPath(oldUserDir + File.separator + codeCache);
++ final Path actualCodeCachePath = FileSystems.getDefault().getPath(System.getProperty(
++ "nashorn.persistent.code.cache")).toAbsolutePath();
++ // Check that nashorn code cache is created in current working directory
++ assertEquals(actualCodeCachePath, expectedCodeCachePath);
++ // Check that code cache dir exists and it's not empty
++ final File file = new File(actualCodeCachePath.toUri());
++ assertFalse(!file.isDirectory(), "No code cache directory was created!");
++ assertFalse(file.list().length == 0, "Code cache directory is empty!");
++ }
++
++ @Test
++ public void changeUserDirTest() throws ScriptException, IOException {
++ System.setProperty("nashorn.persistent.code.cache", codeCache);
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ final ScriptEngine e = fac.getScriptEngine(ENGINE_OPTIONS_NOOPT);
++ final Path codeCachePath = getCodeCachePath(false);
++ final String newUserDir = "build/newUserDir";
++ // Now changing current working directory
++ System.setProperty("user.dir", System.getProperty("user.dir") + File.separator + newUserDir);
++ try {
++ // Check that a new compiled script is stored in existing code cache
++ e.eval(code1);
++ final DirectoryStream<Path> stream = Files.newDirectoryStream(codeCachePath);
++ checkCompiledScripts(stream, 1);
++ // Setting to default current working dir
++ } finally {
++ System.setProperty("user.dir", oldUserDir);
++ }
++ }
++
++ @Test
++ public void codeCacheTest() throws ScriptException, IOException {
++ System.setProperty("nashorn.persistent.code.cache", codeCache);
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ final ScriptEngine e = fac.getScriptEngine(ENGINE_OPTIONS_NOOPT);
++ final Path codeCachePath = getCodeCachePath(false);
++ e.eval(code1);
++ e.eval(code2);
++ e.eval(code3);// less than minimum size for storing
++ // adding code1 and code2.
++ final DirectoryStream<Path> stream = Files.newDirectoryStream(codeCachePath);
++ checkCompiledScripts(stream, 2);
++ }
++
++ @Test
++ public void codeCacheTestOpt() throws ScriptException, IOException {
++ System.setProperty("nashorn.persistent.code.cache", codeCache);
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ final ScriptEngine e = fac.getScriptEngine(ENGINE_OPTIONS_OPT);
++ final Path codeCachePath = getCodeCachePath(true);
++ e.eval(code1);
++ e.eval(code2);
++ e.eval(code3);// less than minimum size for storing
++ // adding code1 and code2.
++ final DirectoryStream<Path> stream = Files.newDirectoryStream(codeCachePath);
++ checkCompiledScripts(stream, 4);
++ }
++
++ private static Path getCodeCachePath(final boolean optimistic) {
++ final String codeCache = System.getProperty("nashorn.persistent.code.cache");
++ final Path codeCachePath = FileSystems.getDefault().getPath(codeCache).toAbsolutePath();
++ final String[] files = codeCachePath.toFile().list();
++ for (final String file : files) {
++ if (file.endsWith("_opt") == optimistic) {
++ return codeCachePath.resolve(file);
++ }
++ }
++ throw new AssertionError("Code cache path not found");
++ }
++
++ private static void checkCompiledScripts(final DirectoryStream<Path> stream, final int numberOfScripts) throws IOException {
++ int n = numberOfScripts;
++ for (@SuppressWarnings("unused") final Path file : stream) {
++ n--;
++ }
++ stream.close();
++ assertEquals(n, 0);
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/ConsStringTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,132 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.test;
++
++import jdk.nashorn.internal.runtime.ConsString;
++import static org.testng.Assert.assertEquals;
++
++import org.testng.annotations.Test;
++
++/**
++ * Tests for JSType methods.
++ *
++ * @test
++ * @run testng jdk.nashorn.internal.runtime.test.ConsStringTest
++ */
++public class ConsStringTest {
++
++ /**
++ * Test toString conversion
++ */
++ @Test
++ public void testConsStringToString() {
++ final ConsString cs1 = new ConsString("b", "c");
++ final ConsString cs2 = new ConsString("d", "e");
++ final ConsString cs3 = new ConsString(cs1, cs2);
++ final ConsString cs4 = new ConsString(cs3, "f");
++ final ConsString cs5 = new ConsString("a", cs4);
++ assertEquals(cs5.toString(), "abcdef");
++ assertEquals(cs4.toString(), "bcdef");
++ assertEquals(cs3.toString(), "bcde");
++ assertEquals(cs2.toString(), "de");
++ assertEquals(cs1.toString(), "bc");
++ // ConsStrings should be flattened now
++ assertEquals(cs1.getComponents()[0], "bc");
++ assertEquals(cs1.getComponents()[1], "");
++ assertEquals(cs2.getComponents()[0], "de");
++ assertEquals(cs2.getComponents()[1], "");
++ assertEquals(cs3.getComponents()[0], "bcde");
++ assertEquals(cs3.getComponents()[1], "");
++ assertEquals(cs4.getComponents()[0], "bcdef");
++ assertEquals(cs4.getComponents()[1], "");
++ assertEquals(cs5.getComponents()[0], "abcdef");
++ assertEquals(cs5.getComponents()[1], "");
++ }
++
++ /**
++ * Test charAt
++ */
++ @Test
++ public void testConsStringCharAt() {
++ final ConsString cs1 = new ConsString("b", "c");
++ final ConsString cs2 = new ConsString("d", "e");
++ final ConsString cs3 = new ConsString(cs1, cs2);
++ final ConsString cs4 = new ConsString(cs3, "f");
++ final ConsString cs5 = new ConsString("a", cs4);
++ assertEquals(cs1.charAt(1), 'c');
++ assertEquals(cs2.charAt(0), 'd');
++ assertEquals(cs3.charAt(3), 'e');
++ assertEquals(cs4.charAt(1), 'c');
++ assertEquals(cs5.charAt(2), 'c');
++ // ConsStrings should be flattened now
++ assertEquals(cs1.getComponents()[0], "bc");
++ assertEquals(cs1.getComponents()[1], "");
++ assertEquals(cs2.getComponents()[0], "de");
++ assertEquals(cs2.getComponents()[1], "");
++ assertEquals(cs3.getComponents()[0], "bcde");
++ assertEquals(cs3.getComponents()[1], "");
++ assertEquals(cs4.getComponents()[0], "bcdef");
++ assertEquals(cs4.getComponents()[1], "");
++ assertEquals(cs5.getComponents()[0], "abcdef");
++ assertEquals(cs5.getComponents()[1], "");
++ }
++
++
++ /**
++ * Test flattening of top-level and internal ConsStrings
++ */
++ @Test
++ public void testConsStringFlattening() {
++ final ConsString cs1 = new ConsString("b", "c");
++ final ConsString cs2 = new ConsString("d", "e");
++ final ConsString cs3 = new ConsString(cs1, cs2);
++ final ConsString cs4 = new ConsString(cs3, "f");
++
++ final ConsString cs5 = new ConsString("a", cs4);
++ // top-level ConsString should not yet be flattened
++ assert(cs5.getComponents()[0] == "a");
++ assert(cs5.getComponents()[1] == cs4);
++ assertEquals(cs5.toString(), "abcdef");
++ // top-level ConsString should be flattened
++ assertEquals(cs5.getComponents()[0], "abcdef");
++ assertEquals(cs5.getComponents()[1], "");
++ // internal ConsString should not yet be flattened after first traversal
++ assertEquals(cs4.getComponents()[0], cs3);
++ assertEquals(cs4.getComponents()[1], "f");
++
++ final ConsString cs6 = new ConsString("a", cs4);
++ // top-level ConsString should not yet be flattened
++ assertEquals(cs6.getComponents()[0], "a");
++ assertEquals(cs6.getComponents()[1], cs4);
++ assertEquals(cs6.toString(), "abcdef");
++ // top-level ConsString should be flattened
++ assertEquals(cs6.getComponents()[0], "abcdef");
++ assertEquals(cs6.getComponents()[1], "");
++ // internal ConsString should have been flattened after second traversal
++ assertEquals(cs4.getComponents()[0], "bcdef");
++ assertEquals(cs4.getComponents()[1], "");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/ContextTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,144 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.test;
++
++import static jdk.nashorn.internal.runtime.Source.sourceFor;
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertTrue;
++import static org.testng.Assert.fail;
++import java.util.Map;
++import jdk.nashorn.internal.objects.Global;
++import jdk.nashorn.internal.runtime.Context;
++import jdk.nashorn.internal.runtime.ErrorManager;
++import jdk.nashorn.internal.runtime.ScriptFunction;
++import jdk.nashorn.internal.runtime.ScriptObject;
++import jdk.nashorn.internal.runtime.ScriptRuntime;
++import jdk.nashorn.internal.runtime.Source;
++import jdk.nashorn.internal.runtime.options.Options;
++import org.testng.annotations.Test;
++
++/**
++ * Basic Context API tests.
++ *
++ * @test
++ * @run testng jdk.nashorn.internal.runtime.test.ContextTest
++ */
++@SuppressWarnings("javadoc")
++public class ContextTest {
++ // basic context eval test
++ @Test
++ public void evalTest() {
++ final Options options = new Options("");
++ final ErrorManager errors = new ErrorManager();
++ final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
++ final Global oldGlobal = Context.getGlobal();
++ Context.setGlobal(cx.createGlobal());
++ try {
++ String code = "22 + 10";
++ assertTrue(32.0 == ((Number)(eval(cx, "<evalTest>", code))).doubleValue());
++
++ code = "obj = { js: 'nashorn' }; obj.js";
++ assertEquals(eval(cx, "<evalTest2>", code), "nashorn");
++ } finally {
++ Context.setGlobal(oldGlobal);
++ }
++ }
++
++ // Make sure trying to compile an invalid script returns null - see JDK-8046215.
++ @Test
++ public void compileErrorTest() {
++ final Options options = new Options("");
++ final ErrorManager errors = new ErrorManager();
++ final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
++ final Global oldGlobal = Context.getGlobal();
++ Context.setGlobal(cx.createGlobal());
++ try {
++ final ScriptFunction script = cx.compileScript(sourceFor("<evalCompileErrorTest>", "*/"), Context.getGlobal());
++ if (script != null) {
++ fail("Invalid script compiled without errors");
++ }
++ if (errors.getNumberOfErrors() != 1) {
++ fail("Wrong number of errors: " + errors.getNumberOfErrors());
++ }
++ } finally {
++ Context.setGlobal(oldGlobal);
++ }
++ }
++
++ // basic check for JS reflection access - java.util.Map-like access on ScriptObject
++ @Test
++ public void reflectionTest() {
++ final Options options = new Options("");
++ final ErrorManager errors = new ErrorManager();
++ final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
++ final boolean strict = cx.getEnv()._strict;
++ final Global oldGlobal = Context.getGlobal();
++ Context.setGlobal(cx.createGlobal());
++
++ try {
++ final String code = "var obj = { x: 344, y: 42 }";
++ eval(cx, "<reflectionTest>", code);
++
++ final Object obj = Context.getGlobal().get("obj");
++
++ assertTrue(obj instanceof ScriptObject);
++
++ final ScriptObject sobj = (ScriptObject)obj;
++ int count = 0;
++ for (final Map.Entry<?, ?> ex : sobj.entrySet()) {
++ final Object key = ex.getKey();
++ if (key.equals("x")) {
++ assertTrue(ex.getValue() instanceof Number);
++ assertTrue(344.0 == ((Number)ex.getValue()).doubleValue());
++
++ count++;
++ } else if (key.equals("y")) {
++ assertTrue(ex.getValue() instanceof Number);
++ assertTrue(42.0 == ((Number)ex.getValue()).doubleValue());
++
++ count++;
++ }
++ }
++ assertEquals(count, 2);
++ assertEquals(sobj.size(), 2);
++
++ // add property
++ sobj.put("zee", "hello", strict);
++ assertEquals(sobj.get("zee"), "hello");
++ assertEquals(sobj.size(), 3);
++
++ } finally {
++ Context.setGlobal(oldGlobal);
++ }
++ }
++
++ private static Object eval(final Context cx, final String name, final String code) {
++ final Source source = sourceFor(name, code);
++ final ScriptObject global = Context.getGlobal();
++ final ScriptFunction func = cx.compileScript(source, global);
++ return func != null ? ScriptRuntime.apply(func, global) : null;
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/ExceptionsNotSerializable.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.fail;
++import java.io.ByteArrayOutputStream;
++import java.io.IOException;
++import java.io.NotSerializableException;
++import java.io.ObjectOutputStream;
++import javax.script.ScriptEngine;
++import javax.script.ScriptException;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import jdk.nashorn.internal.runtime.RewriteException;
++import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
++import org.testng.annotations.Test;
++
++/**
++ * JDK-8044518: Ensure exceptions related to optimistic recompilation are not serializable
++ *
++ * @test
++ * @run testng jdk.nashorn.internal.runtime.test.ExceptionsNotSerializable
++ */
++@SuppressWarnings("javadoc")
++public class ExceptionsNotSerializable {
++ @Test
++ public void rewriteExceptionNotSerializable() throws ScriptException {
++ // NOTE: we must create a RewriteException in a context of a Nashorn engine, as it uses Global.newIntance()
++ // internally.
++ final ScriptEngine e = new NashornScriptEngineFactory().getScriptEngine();
++ e.put("f", new Runnable() {
++ @Override
++ public void run() {
++ tryToSerialize(RewriteException.create(null, new Object[0], new String[0]));
++ }
++ });
++ e.eval("f()");
++ }
++
++ @Test
++ public void unwarrantedOptimismExceptionNotSerializable() {
++ tryToSerialize(new UnwarrantedOptimismException(new Double(1.0), 128));
++ }
++
++ private static void tryToSerialize(final Object obj) {
++ try {
++ new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(obj);
++ fail();
++ } catch (final NotSerializableException e) {
++ assertEquals(e.getMessage(), obj.getClass().getName());
++ } catch (final IOException e) {
++ fail("", e);
++ }
++
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/JDK_8078414_Test.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,99 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.internal.runtime.test;
++
++import static org.testng.Assert.assertFalse;
++import static org.testng.Assert.assertTrue;
++
++import java.util.Map;
++import javax.script.Bindings;
++import jdk.nashorn.api.scripting.JSObject;
++import jdk.nashorn.api.scripting.ScriptObjectMirror;
++import jdk.nashorn.internal.objects.NativeArray;
++import jdk.nashorn.internal.runtime.ScriptObject;
++import jdk.nashorn.internal.runtime.linker.Bootstrap;
++import org.testng.annotations.Test;
++
++/**
++ * @test
++ * @bug 8078414
++ * @summary Test that arbitrary classes can't be converted to mirror's superclasses/interfaces.
++ * @run testng jdk.nashorn.internal.runtime.test.JDK_8078414_Test
++ */
++public class JDK_8078414_Test {
++ @Test
++ public void testCanNotConvertArbitraryClassToMirror() {
++ assertCanNotConvert(Double.class, Map.class);
++ assertCanNotConvert(Double.class, Bindings.class);
++ assertCanNotConvert(Double.class, JSObject.class);
++ assertCanNotConvert(Double.class, ScriptObjectMirror.class);
++ }
++
++ @Test
++ public void testCanConvertObjectToMirror() {
++ assertCanConvertToMirror(Object.class);
++ }
++
++ @Test
++ public void testCanConvertScriptObjectToMirror() {
++ assertCanConvertToMirror(ScriptObject.class);
++ }
++
++ @Test
++ public void testCanConvertScriptObjectSubclassToMirror() {
++ assertCanConvertToMirror(NativeArray.class);
++ }
++
++ @Test
++ public void testCanConvertArbitraryInterfaceToMirror() {
++ // We allow arbitrary interface classes, depending on what implements them, to end up being
++ // convertible to ScriptObjectMirror, as an implementation can theoretically pass an
++ // "instanceof ScriptObject" guard.
++ assertCanConvertToMirror(TestInterface.class);
++ }
++
++ public static interface TestInterface {
++ }
++
++ private static boolean canConvert(final Class<?> from, final Class<?> to) {
++ return Bootstrap.getLinkerServices().canConvert(from, to);
++ }
++
++ private static void assertCanConvert(final Class<?> from, final Class<?> to) {
++ assertTrue(canConvert(from, to));
++ }
++
++ private static void assertCanNotConvert(final Class<?> from, final Class<?> to) {
++ assertFalse(canConvert(from, to));
++ }
++
++ private static void assertCanConvertToMirror(final Class<?> from) {
++ assertCanConvert(from, Map.class);
++ assertCanConvert(from, Bindings.class);
++ assertCanConvert(from, JSObject.class);
++ assertCanConvert(from, ScriptObjectMirror.class);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/JDK_8081015_Test.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,74 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.internal.runtime.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertNull;
++
++import java.util.Collection;
++import java.util.Queue;
++import javax.script.ScriptEngine;
++import javax.script.ScriptException;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import jdk.nashorn.test.models.JDK_8081015_TestModel;
++import org.testng.annotations.Test;
++
++/**
++ * @bug 8081015
++ * @summary Test that native arrays get converted to {@link Queue} and {@link Collection}.
++ */
++@SuppressWarnings("javadoc")
++public class JDK_8081015_Test {
++ @Test
++ public void testConvertToCollection() throws ScriptException {
++ test("receiveCollection");
++ }
++
++ @Test
++ public void testConvertToDeque() throws ScriptException {
++ test("receiveDeque");
++ }
++
++ @Test
++ public void testConvertToList() throws ScriptException {
++ test("receiveList");
++ }
++
++ @Test
++ public void testConvertToQueue() throws ScriptException {
++ test("receiveQueue");
++ }
++
++ private static void test(final String methodName) throws ScriptException {
++ final ScriptEngine engine = new NashornScriptEngineFactory().getScriptEngine();
++ final JDK_8081015_TestModel model = new JDK_8081015_TestModel();
++ engine.put("test", model);
++
++ assertNull(model.getLastInvoked());
++ engine.eval("test." + methodName + "([1, 2, 3.3, 'foo'])");
++ assertEquals(model.getLastInvoked(), methodName );
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/JSTypeTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,195 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.test;
++
++import jdk.nashorn.internal.runtime.JSType;
++import jdk.nashorn.internal.runtime.ScriptRuntime;
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertFalse;
++import static org.testng.Assert.assertTrue;
++
++import org.testng.annotations.Test;
++
++/**
++ * Tests for JSType methods.
++ *
++ * @test
++ * @run testng jdk.nashorn.internal.runtime.test.JSTypeTest
++ */
++public class JSTypeTest {
++ /**
++ * Test of isPrimitive method, of class Runtime.
++ */
++ @Test
++ public void testIsPrimitive() {
++ assertTrue(JSType.isPrimitive(null));
++ assertTrue(JSType.isPrimitive(ScriptRuntime.UNDEFINED));
++ assertTrue(JSType.isPrimitive(Double.NaN));
++ assertTrue(JSType.isPrimitive(Double.NEGATIVE_INFINITY));
++ assertTrue(JSType.isPrimitive(Double.POSITIVE_INFINITY));
++ assertTrue(JSType.isPrimitive(0.0));
++ assertTrue(JSType.isPrimitive(3.14));
++ assertTrue(JSType.isPrimitive("hello"));
++ assertTrue(JSType.isPrimitive(""));
++ assertFalse(JSType.isPrimitive(new Object()));
++ }
++
++ /**
++ * Test of toBoolean method, of class Runtime.
++ */
++ @Test
++ public void testToBoolean() {
++ assertFalse(JSType.toBoolean(ScriptRuntime.UNDEFINED));
++ assertFalse(JSType.toBoolean(null));
++ assertFalse(JSType.toBoolean(Boolean.FALSE));
++ assertTrue(JSType.toBoolean(Boolean.TRUE));
++ assertFalse(JSType.toBoolean(-0.0));
++ assertFalse(JSType.toBoolean(0.0));
++ assertFalse(JSType.toBoolean(Double.NaN));
++ assertTrue(JSType.toBoolean(3.14));
++ assertFalse(JSType.toBoolean(""));
++ assertTrue(JSType.toBoolean("javascript"));
++ assertTrue(JSType.toBoolean(new Object()));
++ }
++
++ /**
++ * Test of toNumber method, of class Runtime.
++ */
++ @Test
++ public void testToNumber_Object() {
++ assertTrue(Double.isNaN(JSType.toNumber(ScriptRuntime.UNDEFINED)));
++ assertEquals(JSType.toNumber((Object)null), 0.0, 0.0);
++ assertEquals(JSType.toNumber(Boolean.TRUE), 1.0, 0.0);
++ assertEquals(JSType.toNumber(Boolean.FALSE), 0.0, 0.0);
++ assertEquals(JSType.toNumber(3.14), 3.14, 0.0);
++ // FIXME: add more assertions for specific String to number cases
++ // FIXME: add case for Object type (JSObject with getDefaultValue)
++ }
++
++ /**
++ * Test of toString method, of class Runtime.
++ */
++ @Test
++ public void testToString_Object() {
++ assertEquals(JSType.toString(ScriptRuntime.UNDEFINED), "undefined");
++ assertEquals(JSType.toString(null), "null");
++ assertEquals(JSType.toString(Boolean.TRUE), "true");
++ assertEquals(JSType.toString(Boolean.FALSE), "false");
++ assertEquals(JSType.toString(""), "");
++ assertEquals(JSType.toString("nashorn"), "nashorn");
++ assertEquals(JSType.toString(Double.NaN), "NaN");
++ assertEquals(JSType.toString(Double.POSITIVE_INFINITY), "Infinity");
++ assertEquals(JSType.toString(Double.NEGATIVE_INFINITY), "-Infinity");
++ assertEquals(JSType.toString(0.0), "0");
++ // FIXME: add more number-to-string test cases
++ // FIXME: add case for Object type (JSObject with getDefaultValue)
++ }
++
++ /**
++ * Test of JSType.toUint32(double)
++ */
++ @Test
++ public void testToUint32() {
++ assertEquals(JSType.toUint32(+0.0), 0);
++ assertEquals(JSType.toUint32(-0.0), 0);
++ assertEquals(JSType.toUint32(Double.NaN), 0);
++ assertEquals(JSType.toUint32(Double.POSITIVE_INFINITY), 0);
++ assertEquals(JSType.toUint32(Double.NEGATIVE_INFINITY), 0);
++ assertEquals(JSType.toUint32(9223372036854775807.0d), 0);
++ assertEquals(JSType.toUint32(-9223372036854775807.0d), 0);
++ assertEquals(JSType.toUint32(1099511627776.0d), 0);
++ assertEquals(JSType.toUint32(-1099511627776.0d), 0);
++ assertEquals(JSType.toUint32(4294967295.0d), 4294967295l);
++ assertEquals(JSType.toUint32(4294967296.0d), 0);
++ assertEquals(JSType.toUint32(4294967297.0d), 1);
++ assertEquals(JSType.toUint32(-4294967295.0d), 1);
++ assertEquals(JSType.toUint32(-4294967296.0d), 0);
++ assertEquals(JSType.toUint32(-4294967297.0d), 4294967295l);
++ assertEquals(JSType.toUint32(4294967295.6d), 4294967295l);
++ assertEquals(JSType.toUint32(4294967296.6d), 0);
++ assertEquals(JSType.toUint32(4294967297.6d), 1);
++ assertEquals(JSType.toUint32(-4294967295.6d), 1);
++ assertEquals(JSType.toUint32(-4294967296.6d), 0);
++ assertEquals(JSType.toUint32(-4294967297.6d), 4294967295l);
++ }
++
++ /**
++ * Test of JSType.toInt32(double)
++ */
++ @Test
++ public void testToInt32() {
++ assertEquals(JSType.toInt32(+0.0), 0);
++ assertEquals(JSType.toInt32(-0.0), 0);
++ assertEquals(JSType.toInt32(Double.NaN), 0);
++ assertEquals(JSType.toInt32(Double.POSITIVE_INFINITY), 0);
++ assertEquals(JSType.toInt32(Double.NEGATIVE_INFINITY), 0);
++ assertEquals(JSType.toInt32(9223372036854775807.0d), 0);
++ assertEquals(JSType.toInt32(-9223372036854775807.0d), 0);
++ assertEquals(JSType.toInt32(1099511627776.0d), 0);
++ assertEquals(JSType.toInt32(-1099511627776.0d), 0);
++ assertEquals(JSType.toInt32(4294967295.0d), -1);
++ assertEquals(JSType.toInt32(4294967296.0d), 0);
++ assertEquals(JSType.toInt32(4294967297.0d), 1);
++ assertEquals(JSType.toInt32(-4294967295.0d), 1);
++ assertEquals(JSType.toInt32(-4294967296.0d), 0);
++ assertEquals(JSType.toInt32(-4294967297.d), -1);
++ assertEquals(JSType.toInt32(4294967295.6d), -1);
++ assertEquals(JSType.toInt32(4294967296.6d), 0);
++ assertEquals(JSType.toInt32(4294967297.6d), 1);
++ assertEquals(JSType.toInt32(-4294967295.6d), 1);
++ assertEquals(JSType.toInt32(-4294967296.6d), 0);
++ assertEquals(JSType.toInt32(-4294967297.6d), -1);
++ }
++
++ /**
++ * Test of JSType.toUint16(double)
++ */
++ @Test
++ public void testToUint16() {
++ assertEquals(JSType.toUint16(+0.0), 0);
++ assertEquals(JSType.toUint16(-0.0), 0);
++ assertEquals(JSType.toUint16(Double.NaN), 0);
++ assertEquals(JSType.toUint16(Double.POSITIVE_INFINITY), 0);
++ assertEquals(JSType.toUint16(Double.NEGATIVE_INFINITY), 0);
++ assertEquals(JSType.toUint16(9223372036854775807.0d), 0);
++ assertEquals(JSType.toUint16(-9223372036854775807.0d), 0);
++ assertEquals(JSType.toUint16(1099511627776.0d), 0);
++ assertEquals(JSType.toUint16(-1099511627776.0d), 0);
++ assertEquals(JSType.toUint16(4294967295.0d), 65535);
++ assertEquals(JSType.toUint16(4294967296.0d), 0);
++ assertEquals(JSType.toUint16(4294967297.0d), 1);
++ assertEquals(JSType.toUint16(-4294967295.0d), 1);
++ assertEquals(JSType.toUint16(-4294967296.0d), 0);
++ assertEquals(JSType.toUint16(-4294967297.0d), 65535);
++ assertEquals(JSType.toUint16(4294967295.6d), 65535);
++ assertEquals(JSType.toUint16(4294967296.6d), 0);
++ assertEquals(JSType.toUint16(4294967297.6d), 1);
++ assertEquals(JSType.toUint16(-4294967295.6d), 1);
++ assertEquals(JSType.toUint16(-4294967296.6d), 0);
++ assertEquals(JSType.toUint16(-4294967297.6d), 65535);
++ }
++
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/LexicalBindingTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,212 @@
++/*
++ * Copyright (c) 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. 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.nashorn.internal.runtime.test;
++
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import org.testng.annotations.Test;
++
++import javax.script.Bindings;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptException;
++import javax.script.SimpleScriptContext;
++
++import static org.testng.Assert.assertEquals;
++
++/**
++ * Top-level lexical binding tests.
++ *
++ * @test
++ * @run testng jdk.nashorn.internal.runtime.test.LexicalBindingTest
++ */
++@SuppressWarnings("javadoc")
++public class LexicalBindingTest {
++
++ final static String LANGUAGE_ES6 = "--language=es6";
++ final static int NUMBER_OF_CONTEXTS = 20;
++ final static int MEGAMORPHIC_LOOP_COUNT = 20;
++
++ /**
++ * Test access to global var-declared variables for shared script classes with multiple globals.
++ */
++ @Test
++ public static void megamorphicVarTest() throws ScriptException, InterruptedException {
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ final ScriptEngine e = factory.getScriptEngine();
++ final ScriptContext[] contexts = new ScriptContext[NUMBER_OF_CONTEXTS];
++ final String sharedScript = "foo";
++
++
++ for (int i = 0; i < NUMBER_OF_CONTEXTS; i++) {
++ final ScriptContext context = contexts[i] = new SimpleScriptContext();
++ final Bindings b = e.createBindings();
++ context.setBindings(b, ScriptContext.ENGINE_SCOPE);
++ assertEquals(e.eval("var foo = '" + i + "';", context), null);
++ }
++
++ for (int i = 0; i < NUMBER_OF_CONTEXTS; i++) {
++ final ScriptContext context = contexts[i];
++ assertEquals(e.eval(sharedScript, context), String.valueOf(i));
++ }
++ }
++
++ /**
++ * Test access to global lexically declared variables for shared script classes with multiple globals.
++ */
++ @Test
++ public static void megamorphicMultiGlobalLetTest() throws ScriptException, InterruptedException {
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ final ScriptEngine e = factory.getScriptEngine(LANGUAGE_ES6);
++ final ScriptContext[] contexts = new ScriptContext[NUMBER_OF_CONTEXTS];
++ final String sharedScript = "foo";
++
++
++ for (int i = 0; i < NUMBER_OF_CONTEXTS; i++) {
++ final ScriptContext context = contexts[i] = new SimpleScriptContext();
++ final Bindings b = e.createBindings();
++ context.setBindings(b, ScriptContext.ENGINE_SCOPE);
++ assertEquals(e.eval("let foo = '" + i + "';", context), null);
++ }
++
++ for (int i = 0; i < NUMBER_OF_CONTEXTS; i++) {
++ final ScriptContext context = contexts[i];
++ assertEquals(e.eval(sharedScript, context), String.valueOf(i));
++ }
++ }
++
++
++ /**
++ * Test access to global lexically declared variables for shared script classes with single global.
++ */
++ @Test
++ public static void megamorphicSingleGlobalLetTest() throws ScriptException, InterruptedException {
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ final ScriptEngine e = factory.getScriptEngine(LANGUAGE_ES6);
++ final String sharedGetterScript = "foo";
++ final String sharedSetterScript = "foo = 1";
++
++ for (int i = 0; i < MEGAMORPHIC_LOOP_COUNT; i++) {
++ assertEquals(e.eval(sharedSetterScript), 1);
++ assertEquals(e.eval(sharedGetterScript), 1);
++ assertEquals(e.eval("delete foo; a" + i + " = 1; foo = " + i + ";"), i);
++ assertEquals(e.eval(sharedGetterScript), i);
++ }
++
++ assertEquals(e.eval("let foo = 'foo';"), null);
++ assertEquals(e.eval(sharedGetterScript), "foo");
++ assertEquals(e.eval(sharedSetterScript), 1);
++ assertEquals(e.eval(sharedGetterScript), 1);
++ assertEquals(e.eval("this.foo"), MEGAMORPHIC_LOOP_COUNT - 1);
++ }
++
++ /**
++ * Test access to global lexically declared variables for shared script classes with single global.
++ */
++ @Test
++ public static void megamorphicInheritedGlobalLetTest() throws ScriptException, InterruptedException {
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ final ScriptEngine e = factory.getScriptEngine(LANGUAGE_ES6);
++ final String sharedGetterScript = "foo";
++ final String sharedSetterScript = "foo = 1";
++
++ for (int i = 0; i < MEGAMORPHIC_LOOP_COUNT; i++) {
++ assertEquals(e.eval(sharedSetterScript), 1);
++ assertEquals(e.eval(sharedGetterScript), 1);
++ assertEquals(e.eval("delete foo; a" + i + " = 1; Object.prototype.foo = " + i + ";"), i);
++ assertEquals(e.eval(sharedGetterScript), i);
++ }
++
++ assertEquals(e.eval("let foo = 'foo';"), null);
++ assertEquals(e.eval(sharedGetterScript), "foo");
++ assertEquals(e.eval(sharedSetterScript), 1);
++ assertEquals(e.eval(sharedGetterScript), 1);
++ assertEquals(e.eval("this.foo"), MEGAMORPHIC_LOOP_COUNT - 1);
++ }
++
++ /**
++ * Test multi-threaded access to global lexically declared variables for shared script classes with multiple globals.
++ */
++ @Test
++ public static void multiThreadedLetTest() throws ScriptException, InterruptedException {
++ final NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
++ final ScriptEngine e = factory.getScriptEngine(LANGUAGE_ES6);
++ final Bindings b = e.createBindings();
++ final ScriptContext origContext = e.getContext();
++ final ScriptContext newCtxt = new SimpleScriptContext();
++ newCtxt.setBindings(b, ScriptContext.ENGINE_SCOPE);
++ final String sharedScript = "foo";
++
++ assertEquals(e.eval("let foo = 'original context';", origContext), null);
++ assertEquals(e.eval("let foo = 'new context';", newCtxt), null);
++
++ final Thread t1 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t2 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "new context", 1000));
++ t1.start();
++ t2.start();
++ t1.join();
++ t2.join();
++
++ assertEquals(e.eval("foo = 'newer context';", newCtxt), "newer context");
++ final Thread t3 = new Thread(new ScriptRunner(e, origContext, sharedScript, "original context", 1000));
++ final Thread t4 = new Thread(new ScriptRunner(e, newCtxt, sharedScript, "newer context", 1000));
++
++ t3.start();
++ t4.start();
++ t3.join();
++ t4.join();
++
++ assertEquals(e.eval(sharedScript), "original context");
++ assertEquals(e.eval(sharedScript, newCtxt), "newer context");
++ }
++
++ private static class ScriptRunner implements Runnable {
++
++ final ScriptEngine engine;
++ final ScriptContext context;
++ final String source;
++ final Object expected;
++ final int iterations;
++
++ ScriptRunner(final ScriptEngine engine, final ScriptContext context, final String source, final Object expected, final int iterations) {
++ this.engine = engine;
++ this.context = context;
++ this.source = source;
++ this.expected = expected;
++ this.iterations = iterations;
++ }
++
++ @Override
++ public void run() {
++ try {
++ for (int i = 0; i < iterations; i++) {
++ assertEquals(engine.eval(source, context), expected);
++ }
++ } catch (final ScriptException se) {
++ throw new RuntimeException(se);
++ }
++ }
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/NoPersistenceCachingTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,140 @@
++/*
++ * Copyright (c) 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. 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.nashorn.internal.runtime.test;
++
++import static org.testng.Assert.fail;
++import java.io.ByteArrayOutputStream;
++import java.io.PrintStream;
++import java.util.regex.Matcher;
++import java.util.regex.Pattern;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineFactory;
++import javax.script.ScriptEngineManager;
++import javax.script.SimpleScriptContext;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import org.testng.annotations.AfterTest;
++import org.testng.annotations.BeforeTest;
++import org.testng.annotations.Test;
++
++/**
++ * @test
++ * @bug 8037378
++ * @summary Sanity tests for no persistence caching
++ * @run testng/othervm jdk.nashorn.internal.runtime.test.NoPersistenceCachingTest
++ */
++@SuppressWarnings("javadoc")
++public class NoPersistenceCachingTest {
++
++ private ScriptEngine engine;
++ private ScriptContext context1, context2, context3;
++ private ByteArrayOutputStream stderr;
++ private PrintStream prevStderr;
++
++ @BeforeTest
++ public void setupTest() {
++ stderr = new ByteArrayOutputStream();
++ prevStderr = System.err;
++ System.setErr(new PrintStream(stderr));
++ NashornScriptEngineFactory nashornFactory = null;
++ final ScriptEngineManager sm = new ScriptEngineManager();
++ for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
++ if (fac instanceof NashornScriptEngineFactory) {
++ nashornFactory = (NashornScriptEngineFactory) fac;
++ break;
++ }
++ }
++ if (nashornFactory == null) {
++ fail("Cannot find nashorn factory!");
++ }
++ // fine is enough for cache hits, finest produces way too much information
++ // TODO this should be ported to use the RuntimeEvents instead of screen scraping
++ // logs, as obviously this is very brittle
++ final String[] options = new String[]{"--log=compiler:fine"};
++ engine = nashornFactory.getScriptEngine(options);
++ context1 = engine.getContext();
++ context2 = new SimpleScriptContext();
++ context2.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
++ context3 = new SimpleScriptContext();
++ context3.setBindings(engine.createBindings(), ScriptContext.ENGINE_SCOPE);
++ }
++
++ @AfterTest
++ public void setErrTest() {
++ System.setErr(prevStderr);
++ }
++
++ public void runTest(final int numberOfContext, final String expectedOutputPattern,
++ final int expectedPatternOccurrence) {
++
++ try {
++ switch (numberOfContext) {
++ case 2:
++ final String scriptTwoContexts = "print('HelloTwoContexts')";
++ engine.eval(scriptTwoContexts, context1);
++ engine.eval(scriptTwoContexts, context2);
++ break;
++ case 3:
++ final String scriptThreeContexts = "print('HelloThreeContexts')";
++ engine.eval(scriptThreeContexts, context1);
++ engine.eval(scriptThreeContexts, context2);
++ engine.eval(scriptThreeContexts, context3);
++ break;
++ default:
++ break;
++ }
++ } catch (final Exception se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++ final Pattern deoptimizing = Pattern.compile(expectedOutputPattern);
++ final Matcher matcher = deoptimizing.matcher(stderr.toString());
++ int matches = 0;
++ while (matcher.find()) {
++ matches++;
++ }
++ if (matches != expectedPatternOccurrence) {
++ fail("Number of cache hit is not correct, expected: "
++ + expectedPatternOccurrence + " and found: " + matches + "\n"
++ + stderr);
++ }
++ stderr.reset();
++ }
++
++ private static String getCodeCachePattern() {
++ return ("\\[compiler\\]\\sCode\\scache\\shit\\sfor\\s<eval>\\savoiding\\srecompile.");
++ }
++
++ @Test
++ public void twoContextTest() {
++ runTest(2, getCodeCachePattern(), 1);
++
++ }
++
++ @Test
++ public void threeContextTest() {
++ runTest(3, getCodeCachePattern(), 2);
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/SourceTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,125 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.test;
++
++import static jdk.nashorn.internal.runtime.Source.sourceFor;
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertTrue;
++import static org.testng.Assert.fail;
++import java.io.File;
++import java.io.IOException;
++import java.io.InputStreamReader;
++import java.io.Reader;
++import java.net.URL;
++import java.util.Arrays;
++import jdk.nashorn.api.scripting.URLReader;
++import jdk.nashorn.internal.runtime.Source;
++import org.testng.annotations.Test;
++
++/**
++ * Tests different Source representations.
++ */
++@SuppressWarnings("javadoc")
++public class SourceTest {
++
++ final private static String SOURCE_NAME = "source.js";
++ final private static String SOURCE_STRING = "var x = 1;";
++ final private static char[] SOURCE_CHARS = SOURCE_STRING.toCharArray();
++ final private static String RESOURCE_PATH = "resources/load_test.js";
++ final private static File SOURCE_FILE = new File("build/test/classes/jdk/nashorn/internal/runtime/test/" + RESOURCE_PATH);
++ final private static URL SOURCE_URL = SourceTest.class.getResource(RESOURCE_PATH);
++
++
++ @Test
++ public void testStringSource() {
++ testSources(sourceFor(SOURCE_NAME, SOURCE_STRING), sourceFor(SOURCE_NAME, SOURCE_STRING));
++ testSources(sourceFor(SOURCE_NAME, SOURCE_STRING), sourceFor(SOURCE_NAME, SOURCE_CHARS));
++ }
++
++ @Test
++ public void testCharArraySource() {
++ testSources(sourceFor(SOURCE_NAME, SOURCE_CHARS), sourceFor(SOURCE_NAME, SOURCE_CHARS));
++ testSources(sourceFor(SOURCE_NAME, SOURCE_CHARS), sourceFor(SOURCE_NAME, SOURCE_STRING));
++ }
++
++ @Test
++ public void testURLSource() {
++ try {
++ testSources(sourceFor(SOURCE_NAME, SOURCE_URL), sourceFor(SOURCE_NAME, SOURCE_URL));
++ testSources(sourceFor(SOURCE_NAME, SOURCE_URL), sourceFor(SOURCE_NAME, new URLReader(SOURCE_URL)));
++
++ } catch (final IOException e) {
++ fail(e.toString());
++ }
++ }
++
++ @Test
++ public void testURLReaderSource() {
++ try {
++ System.err.println(SourceTest.class.getResource(""));
++ testSources(sourceFor(SOURCE_NAME, new URLReader(SOURCE_URL)), sourceFor(SOURCE_NAME, new URLReader(SOURCE_URL)));
++ testSources(sourceFor(SOURCE_NAME, new URLReader(SOURCE_URL)), sourceFor(SOURCE_NAME, SOURCE_URL));
++ } catch (final IOException e) {
++ fail(e.toString());
++ }
++ }
++
++ @Test
++ public void testReaderSource() {
++ try {
++ testSources(sourceFor(SOURCE_NAME, getReader(RESOURCE_PATH)), sourceFor(SOURCE_NAME, getReader(RESOURCE_PATH)));
++ } catch (final IOException e) {
++ fail(e.toString());
++ }
++ }
++
++ @Test
++ public void testFileSource() {
++ try {
++ testSources(sourceFor(SOURCE_NAME, SOURCE_FILE), sourceFor(SOURCE_NAME, SOURCE_FILE));
++ } catch (final IOException e) {
++ fail(e.toString());
++ }
++ }
++
++ private static Reader getReader(final String path) {
++ return new InputStreamReader(SourceTest.class.getResourceAsStream(path));
++ }
++
++ private static void testSources(final Source source1, final Source source2) {
++ final char[] chars1 = source1.getContent();
++ final char[] chars2 = source2.getContent();
++ final String str1 = source1.getString();
++ final String str2 = source2.getString();
++ assertTrue(Arrays.equals(chars1, chars2));
++ assertEquals(str1, str2);
++ assertEquals(source1.hashCode(), source2.hashCode());
++ assertTrue(source1.equals(source2));
++ assertTrue(Arrays.equals(source1.getContent(), str1.toCharArray()));
++ assertTrue(Arrays.equals(source1.getContent(), chars1));
++ assertTrue(Arrays.equals(source1.getContent(), source2.getContent()));
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/TrustedScriptEngineTest.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,363 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.internal.runtime.test;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertTrue;
++import static org.testng.Assert.fail;
++import javax.script.ScriptContext;
++import javax.script.ScriptEngine;
++import javax.script.ScriptEngineFactory;
++import javax.script.ScriptEngineManager;
++import javax.script.ScriptException;
++import javax.script.SimpleScriptContext;
++import jdk.nashorn.api.scripting.ClassFilter;
++import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
++import jdk.nashorn.internal.runtime.Version;
++import org.testng.annotations.Test;
++
++/**
++ * Tests for trusted client usage of nashorn script engine factory extension API
++ */
++@SuppressWarnings("javadoc")
++public class TrustedScriptEngineTest {
++ @Test
++ public void versionTest() {
++ final ScriptEngineManager m = new ScriptEngineManager();
++ final ScriptEngine e = m.getEngineByName("nashorn");
++ assertEquals(e.getFactory().getEngineVersion(), Version.version());
++ }
++
++ private static class MyClassLoader extends ClassLoader {
++ // to check if script engine uses the specified class loader
++ private final boolean[] reached = new boolean[1];
++
++ @Override
++ protected Class<?> findClass(final String name) throws ClassNotFoundException {
++ // flag that it reached here
++ reached[0] = true;
++ return super.findClass(name);
++ }
++
++ public boolean reached() {
++ return reached[0];
++ }
++ }
++
++ // These are for "private" extension API of NashornScriptEngineFactory that
++ // accepts a ClassLoader and/or command line options.
++
++ @Test
++ public void factoryClassLoaderTest() {
++ final ScriptEngineManager sm = new ScriptEngineManager();
++ for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
++ if (fac instanceof NashornScriptEngineFactory) {
++ final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
++ final MyClassLoader loader = new MyClassLoader();
++ // set the classloader as app class loader
++ final ScriptEngine e = nfac.getScriptEngine(loader);
++ try {
++ e.eval("Packages.foo");
++ // check that the class loader was attempted
++ assertTrue(loader.reached(), "did not reach class loader!");
++ } catch (final ScriptException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++ return;
++ }
++ }
++
++ fail("Cannot find nashorn factory!");
++ }
++
++ @Test
++ public void factoryClassLoaderAndOptionsTest() {
++ final ScriptEngineManager sm = new ScriptEngineManager();
++ for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
++ if (fac instanceof NashornScriptEngineFactory) {
++ final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
++ final String[] options = new String[] { "-strict" };
++ final MyClassLoader loader = new MyClassLoader();
++ // set the classloader as app class loader
++ final ScriptEngine e = nfac.getScriptEngine(options, loader);
++ try {
++ e.eval("Packages.foo");
++ // check that the class loader was attempted
++ assertTrue(loader.reached(), "did not reach class loader!");
++ } catch (final ScriptException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++
++ try {
++ // strict mode - delete of a var should throw SyntaxError
++ e.eval("var d = 2; delete d;");
++ } catch (final ScriptException se) {
++ // check that the error message contains "SyntaxError"
++ assertTrue(se.getMessage().contains("SyntaxError"));
++ }
++
++ return;
++ }
++ }
++
++ fail("Cannot find nashorn factory!");
++ }
++
++ @Test
++ public void factoryOptionsTest() {
++ final ScriptEngineManager sm = new ScriptEngineManager();
++ for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
++ if (fac instanceof NashornScriptEngineFactory) {
++ final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
++ // specify --no-syntax-extensions flag
++ final String[] options = new String[] { "--no-syntax-extensions" };
++ final ScriptEngine e = nfac.getScriptEngine(options);
++ try {
++ // try nashorn specific extension
++ e.eval("var f = funtion(x) 2*x;");
++ fail("should have thrown exception!");
++ } catch (final Exception ex) {
++ //empty
++ }
++ return;
++ }
++ }
++
++ fail("Cannot find nashorn factory!");
++ }
++
++ @Test
++ /**
++ * Test repeated evals with --loader-per-compile=false
++ * We used to get "class redefinition error".
++ */
++ public void noLoaderPerCompilerTest() {
++ final ScriptEngineManager sm = new ScriptEngineManager();
++ for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
++ if (fac instanceof NashornScriptEngineFactory) {
++ final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
++ final String[] options = new String[] { "--loader-per-compile=false" };
++ final ScriptEngine e = nfac.getScriptEngine(options);
++ try {
++ e.eval("2 + 3");
++ e.eval("4 + 4");
++ } catch (final ScriptException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++ return;
++ }
++ }
++ fail("Cannot find nashorn factory!");
++ }
++
++ @Test
++ /**
++ * Test that we can use same script name in repeated evals with --loader-per-compile=false
++ * We used to get "class redefinition error" as name was derived from script name.
++ */
++ public void noLoaderPerCompilerWithSameNameTest() {
++ final ScriptEngineManager sm = new ScriptEngineManager();
++ for (final ScriptEngineFactory fac : sm.getEngineFactories()) {
++ if (fac instanceof NashornScriptEngineFactory) {
++ final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
++ final String[] options = new String[] { "--loader-per-compile=false" };
++ final ScriptEngine e = nfac.getScriptEngine(options);
++ e.put(ScriptEngine.FILENAME, "test.js");
++ try {
++ e.eval("2 + 3");
++ e.eval("4 + 4");
++ } catch (final ScriptException se) {
++ se.printStackTrace();
++ fail(se.getMessage());
++ }
++ return;
++ }
++ }
++ fail("Cannot find nashorn factory!");
++ }
++
++ @Test
++ public void globalPerEngineTest() throws ScriptException {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ final String[] options = new String[] { "--global-per-engine" };
++ final ScriptEngine e = fac.getScriptEngine(options);
++
++ e.eval("function foo() {}");
++
++ final ScriptContext newCtx = new SimpleScriptContext();
++ newCtx.setBindings(e.createBindings(), ScriptContext.ENGINE_SCOPE);
++
++ // all global definitions shared and so 'foo' should be
++ // visible in new Bindings as well.
++ assertTrue(e.eval("typeof foo", newCtx).equals("function"));
++
++ e.eval("function bar() {}", newCtx);
++
++ // bar should be visible in default context
++ assertTrue(e.eval("typeof bar").equals("function"));
++ }
++
++ @Test
++ public void classFilterTest() throws ScriptException {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ final ScriptEngine e = fac.getScriptEngine(new ClassFilter() {
++ @Override
++ public boolean exposeToScripts(final String fullName) {
++ // don't allow anything that is not "java."
++ return fullName.startsWith("java.");
++ }
++ });
++
++ assertEquals(e.eval("typeof javax.script.ScriptEngine"), "object");
++ assertEquals(e.eval("typeof java.util.Vector"), "function");
++
++ try {
++ e.eval("Java.type('javax.script.ScriptContext')");
++ fail("should not reach here");
++ } catch (final ScriptException | RuntimeException se) {
++ if (! (se.getCause() instanceof ClassNotFoundException)) {
++ fail("ClassNotFoundException expected");
++ }
++ }
++ }
++
++ @Test
++ public void classFilterTest2() throws ScriptException {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ final ScriptEngine e = fac.getScriptEngine(new String[0], Thread.currentThread().getContextClassLoader(),
++ new ClassFilter() {
++ @Override
++ public boolean exposeToScripts(final String fullName) {
++ // don't allow anything that is not "java."
++ return fullName.startsWith("java.");
++ }
++ });
++
++ assertEquals(e.eval("typeof javax.script.ScriptEngine"), "object");
++ assertEquals(e.eval("typeof java.util.Vector"), "function");
++
++ try {
++ e.eval("Java.type('javax.script.ScriptContext')");
++ fail("should not reach here");
++ } catch (final ScriptException | RuntimeException se) {
++ if (! (se.getCause() instanceof ClassNotFoundException)) {
++ fail("ClassNotFoundException expected");
++ }
++ }
++ }
++
++ @Test
++ public void nullClassFilterTest() {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ try {
++ fac.getScriptEngine((ClassFilter)null);
++ fail("should have thrown NPE");
++ } catch (final NullPointerException e) {
++ //empty
++ }
++ }
++
++ @Test
++ public void nullClassFilterTest2() {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ try {
++ fac.getScriptEngine(new String[0], null, null);
++ fail("should have thrown NPE");
++ } catch (final NullPointerException e) {
++ //empty
++ }
++ }
++
++ @Test
++ public void nullArgsTest() {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ try {
++ fac.getScriptEngine((String[])null);
++ fail("should have thrown NPE");
++ } catch (final NullPointerException e) {
++ //empty
++ }
++ }
++
++ @Test
++ public void nullArgsTest2() {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ try {
++ fac.getScriptEngine(null, null, new ClassFilter() {
++ @Override
++ public boolean exposeToScripts(final String name) {
++ return true;
++ }
++ });
++ fail("should have thrown NPE");
++ } catch (final NullPointerException e) {
++ //empty
++ }
++ }
++
++ @Test
++ public void nashornSwallowsConstKeyword() throws Exception {
++ final NashornScriptEngineFactory f = new NashornScriptEngineFactory();
++ final String[] args = new String[] { "--const-as-var" };
++ final ScriptEngine engine = f.getScriptEngine(args);
++
++ final Object ret = engine.eval(""
++ + "(function() {\n"
++ + " const x = 10;\n"
++ + " return x;\n"
++ + "})();"
++ );
++ assertEquals(ret, 10, "Parsed and executed OK");
++ }
++
++ @Test
++ public void evalDefaultFileNameTest() throws ScriptException {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ final ScriptEngine engine = fac.getScriptEngine(new String[] { "--verify-code=true" });
++ // default FILENAME being "<eval>" make sure generated code bytecode verifies.
++ engine.eval("var a = 3;");
++ }
++
++ @Test
++ public void evalFileNameWithSpecialCharsTest() throws ScriptException {
++ final NashornScriptEngineFactory fac = new NashornScriptEngineFactory();
++ final ScriptEngine engine = fac.getScriptEngine(new String[] { "--verify-code=true" });
++ final ScriptContext ctxt = new SimpleScriptContext();
++ // use file name with "dangerous" chars.
++ ctxt.setAttribute(ScriptEngine.FILENAME, "<myscript>", ScriptContext.ENGINE_SCOPE);
++ engine.eval("var a = 3;");
++ ctxt.setAttribute(ScriptEngine.FILENAME, "[myscript]", ScriptContext.ENGINE_SCOPE);
++ engine.eval("var h = 'hello';");
++ ctxt.setAttribute(ScriptEngine.FILENAME, ";/\\$.", ScriptContext.ENGINE_SCOPE);
++ engine.eval("var foo = 'world';");
++ // name used by jjs shell tool for the interactive mode
++ ctxt.setAttribute(ScriptEngine.FILENAME, "<shell>", ScriptContext.ENGINE_SCOPE);
++ engine.eval("var foo = 'world';");
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/internal/runtime/test/resources/load_test.js Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,28 @@
++/*
++ * Copyright (c) 2010, 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. 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.
++ */
++
++function loadedFunc(arg) {
++ return arg.toUpperCase();
++}
+--- ./nashorn/test/src/jdk/nashorn/internal/test/framework/TestFinder.java Mon Jun 01 11:44:30 2015 -0700
++++ ./nashorn/test/src/jdk/nashorn/internal/test/framework/TestFinder.java Wed Jul 01 21:54:30 2015 -0700
+@@ -22,7 +22,6 @@
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+-
+ package jdk.nashorn.internal.test.framework;
+
+ import static jdk.nashorn.internal.test.framework.TestConfig.OPTIONS_CHECK_COMPILE_MSG;
+@@ -61,14 +60,15 @@
+ import java.util.EnumSet;
+ import java.util.HashMap;
+ import java.util.HashSet;
++import java.util.Iterator;
+ import java.util.List;
+ import java.util.Map;
+-import java.util.Scanner;
+ import java.util.Set;
+ import javax.xml.xpath.XPath;
+ import javax.xml.xpath.XPathConstants;
+ import javax.xml.xpath.XPathExpressionException;
+ import javax.xml.xpath.XPathFactory;
++import jdk.nashorn.internal.runtime.ScriptingFunctions;
+ import org.w3c.dom.NodeList;
+ import org.xml.sax.InputSource;
+
+@@ -78,28 +78,33 @@
+ */
+ @SuppressWarnings("javadoc")
+ public final class TestFinder {
+- private TestFinder() {}
++
++ private TestFinder() {
++ }
+
+ interface TestFactory<T> {
++
+ // 'test' instance type is decided by the client.
++
+ T createTest(final String framework, final File testFile, final List<String> engineOptions, final Map<String, String> testOptions, final List<String> arguments);
++
+ // place to log messages from TestFinder
++
+ void log(String mg);
+ }
+
+-
+ // finds all tests from configuration and calls TestFactory to create 'test' instance for each script test found
+ static <T> void findAllTests(final List<T> tests, final Set<String> orphans, final TestFactory<T> testFactory) throws Exception {
+ final String framework = System.getProperty(TEST_JS_FRAMEWORK);
+ final String testList = System.getProperty(TEST_JS_LIST);
+ final String failedTestFileName = System.getProperty(TEST_FAILED_LIST_FILE);
+- if(failedTestFileName != null) {
++ if (failedTestFileName != null) {
+ final File failedTestFile = new File(failedTestFileName);
+- if(failedTestFile.exists() && failedTestFile.length() > 0L) {
+- try(final BufferedReader r = new BufferedReader(new FileReader(failedTestFile))) {
+- for(;;) {
++ if (failedTestFile.exists() && failedTestFile.length() > 0L) {
++ try (final BufferedReader r = new BufferedReader(new FileReader(failedTestFile))) {
++ for (;;) {
+ final String testFileName = r.readLine();
+- if(testFileName == null) {
++ if (testFileName == null) {
+ break;
+ }
+ handleOneTest(framework, new File(testFileName).toPath(), tests, orphans, testFactory);
+@@ -151,7 +156,7 @@
+ final Exception[] exceptions = new Exception[1];
+ final List<String> excludedActualTests = new ArrayList<>();
+
+- if (! dir.toFile().isDirectory()) {
++ if (!dir.toFile().isDirectory()) {
+ factory.log("WARNING: " + dir + " not found or not a directory");
+ }
+
+@@ -219,27 +224,28 @@
+
+ boolean explicitOptimistic = false;
+
+- try (Scanner scanner = new Scanner(testFile)) {
+- while (scanner.hasNext()) {
+- // TODO: Scan for /ref=file qualifiers, etc, to determine run
+- // behavior
+- String token = scanner.next();
+- if (token.startsWith("/*")) {
+- inComment = true;
+- } else if (token.endsWith(("*/"))) {
+- inComment = false;
+- } else if (!inComment) {
+- continue;
+- }
++ String allContent = new String(Files.readAllBytes(testFile));
++ Iterator<String> scanner = ScriptingFunctions.tokenizeString(allContent).iterator();
++ while (scanner.hasNext()) {
++ // TODO: Scan for /ref=file qualifiers, etc, to determine run
++ // behavior
++ String token = scanner.next();
++ if (token.startsWith("/*")) {
++ inComment = true;
++ } else if (token.endsWith(("*/"))) {
++ inComment = false;
++ } else if (!inComment) {
++ continue;
++ }
+
+- // remove whitespace and trailing semicolons, if any
+- // (trailing semicolons are found in some sputnik tests)
+- token = token.trim();
+- final int semicolon = token.indexOf(';');
+- if (semicolon > 0) {
+- token = token.substring(0, semicolon);
+- }
+- switch (token) {
++ // remove whitespace and trailing semicolons, if any
++ // (trailing semicolons are found in some sputnik tests)
++ token = token.trim();
++ final int semicolon = token.indexOf(';');
++ if (semicolon > 0) {
++ token = token.substring(0, semicolon);
++ }
++ switch (token) {
+ case "@test":
+ isTest = true;
+ break;
+@@ -308,24 +314,21 @@
+ break;
+ default:
+ break;
+- }
++ }
+
+- // negative tests are expected to fail at runtime only
+- // for those tests that are expected to fail at compile time,
+- // add @test/compile-error
+- if (token.equals("@negative") || token.equals("@strict_mode_negative")) {
+- shouldRun = true;
+- runFailure = true;
+- }
++ // negative tests are expected to fail at runtime only
++ // for those tests that are expected to fail at compile time,
++ // add @test/compile-error
++ if (token.equals("@negative") || token.equals("@strict_mode_negative")) {
++ shouldRun = true;
++ runFailure = true;
++ }
+
+- if (token.equals("@strict_mode") || token.equals("@strict_mode_negative") || token.equals("@onlyStrict") || token.equals("@noStrict")) {
+- if (!strictModeEnabled()) {
+- return;
+- }
++ if (token.equals("@strict_mode") || token.equals("@strict_mode_negative") || token.equals("@onlyStrict") || token.equals("@noStrict")) {
++ if (!strictModeEnabled()) {
++ return;
+ }
+ }
+- } catch (final Exception ignored) {
+- return;
+ }
+
+ if (isTest) {
+@@ -369,8 +372,8 @@
+ private static final boolean OPTIMISTIC_OVERRIDE = true;
+
+ /**
+- * Check if there is an optimistic override, that disables the default
+- * false optimistic types and sets them to true, for testing purposes
++ * Check if there is an optimistic override, that disables the default false
++ * optimistic types and sets them to true, for testing purposes
+ *
+ * @return true if optimistic type override has been set by test suite
+ */
+@@ -379,10 +382,9 @@
+ }
+
+ /**
+- * Add an optimistic-types=true option to an argument list if this
+- * is set to override the default false. Add an optimistic-types=true
+- * options to an argument list if this is set to override the default
+- * true
++ * Add an optimistic-types=true option to an argument list if this is set to
++ * override the default false. Add an optimistic-types=true options to an
++ * argument list if this is set to override the default true
+ *
+ * @args new argument list array
+ */
+@@ -396,8 +398,8 @@
+ }
+
+ /**
+- * Add an optimistic-types=true option to an argument list if this
+- * is set to override the default false
++ * Add an optimistic-types=true option to an argument list if this is set to
++ * override the default false
+ *
+ * @args argument list
+ */
+@@ -438,7 +440,7 @@
+
+ private static void loadExcludesFile(final String testExcludesFile, final Set<String> testExcludeSet) throws XPathExpressionException {
+ final XPath xpath = XPathFactory.newInstance().newXPath();
+- final NodeList testIds = (NodeList)xpath.evaluate("/excludeList/test/@id", new InputSource(testExcludesFile), XPathConstants.NODESET);
++ final NodeList testIds = (NodeList) xpath.evaluate("/excludeList/test/@id", new InputSource(testExcludesFile), XPathConstants.NODESET);
+ for (int i = testIds.getLength() - 1; i >= 0; i--) {
+ testExcludeSet.add(testIds.item(i).getNodeValue());
+ }
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/test/models/BigAbstract.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,4709 @@
++/*
++ * Copyright (c) 2010, 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. 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.nashorn.test.models;
++
++public abstract class BigAbstract {
++ public static void accept(BigAbstract ba) {
++ }
++
++ public abstract void f0();
++ public abstract void f1();
++ public abstract void f2();
++ public abstract void f3();
++ public abstract void f4();
++ public abstract void f5();
++ public abstract void f6();
++ public abstract void f7();
++ public abstract void f8();
++ public abstract void f9();
++ public abstract void f10();
++ public abstract void f11();
++ public abstract void f12();
++ public abstract void f13();
++ public abstract void f14();
++ public abstract void f15();
++ public abstract void f16();
++ public abstract void f17();
++ public abstract void f18();
++ public abstract void f19();
++ public abstract void f20();
++ public abstract void f21();
++ public abstract void f22();
++ public abstract void f23();
++ public abstract void f24();
++ public abstract void f25();
++ public abstract void f26();
++ public abstract void f27();
++ public abstract void f28();
++ public abstract void f29();
++ public abstract void f30();
++ public abstract void f31();
++ public abstract void f32();
++ public abstract void f33();
++ public abstract void f34();
++ public abstract void f35();
++ public abstract void f36();
++ public abstract void f37();
++ public abstract void f38();
++ public abstract void f39();
++ public abstract void f40();
++ public abstract void f41();
++ public abstract void f42();
++ public abstract void f43();
++ public abstract void f44();
++ public abstract void f45();
++ public abstract void f46();
++ public abstract void f47();
++ public abstract void f48();
++ public abstract void f49();
++ public abstract void f50();
++ public abstract void f51();
++ public abstract void f52();
++ public abstract void f53();
++ public abstract void f54();
++ public abstract void f55();
++ public abstract void f56();
++ public abstract void f57();
++ public abstract void f58();
++ public abstract void f59();
++ public abstract void f60();
++ public abstract void f61();
++ public abstract void f62();
++ public abstract void f63();
++ public abstract void f64();
++ public abstract void f65();
++ public abstract void f66();
++ public abstract void f67();
++ public abstract void f68();
++ public abstract void f69();
++ public abstract void f70();
++ public abstract void f71();
++ public abstract void f72();
++ public abstract void f73();
++ public abstract void f74();
++ public abstract void f75();
++ public abstract void f76();
++ public abstract void f77();
++ public abstract void f78();
++ public abstract void f79();
++ public abstract void f80();
++ public abstract void f81();
++ public abstract void f82();
++ public abstract void f83();
++ public abstract void f84();
++ public abstract void f85();
++ public abstract void f86();
++ public abstract void f87();
++ public abstract void f88();
++ public abstract void f89();
++ public abstract void f90();
++ public abstract void f91();
++ public abstract void f92();
++ public abstract void f93();
++ public abstract void f94();
++ public abstract void f95();
++ public abstract void f96();
++ public abstract void f97();
++ public abstract void f98();
++ public abstract void f99();
++ public abstract void f100();
++ public abstract void f101();
++ public abstract void f102();
++ public abstract void f103();
++ public abstract void f104();
++ public abstract void f105();
++ public abstract void f106();
++ public abstract void f107();
++ public abstract void f108();
++ public abstract void f109();
++ public abstract void f110();
++ public abstract void f111();
++ public abstract void f112();
++ public abstract void f113();
++ public abstract void f114();
++ public abstract void f115();
++ public abstract void f116();
++ public abstract void f117();
++ public abstract void f118();
++ public abstract void f119();
++ public abstract void f120();
++ public abstract void f121();
++ public abstract void f122();
++ public abstract void f123();
++ public abstract void f124();
++ public abstract void f125();
++ public abstract void f126();
++ public abstract void f127();
++ public abstract void f128();
++ public abstract void f129();
++ public abstract void f130();
++ public abstract void f131();
++ public abstract void f132();
++ public abstract void f133();
++ public abstract void f134();
++ public abstract void f135();
++ public abstract void f136();
++ public abstract void f137();
++ public abstract void f138();
++ public abstract void f139();
++ public abstract void f140();
++ public abstract void f141();
++ public abstract void f142();
++ public abstract void f143();
++ public abstract void f144();
++ public abstract void f145();
++ public abstract void f146();
++ public abstract void f147();
++ public abstract void f148();
++ public abstract void f149();
++ public abstract void f150();
++ public abstract void f151();
++ public abstract void f152();
++ public abstract void f153();
++ public abstract void f154();
++ public abstract void f155();
++ public abstract void f156();
++ public abstract void f157();
++ public abstract void f158();
++ public abstract void f159();
++ public abstract void f160();
++ public abstract void f161();
++ public abstract void f162();
++ public abstract void f163();
++ public abstract void f164();
++ public abstract void f165();
++ public abstract void f166();
++ public abstract void f167();
++ public abstract void f168();
++ public abstract void f169();
++ public abstract void f170();
++ public abstract void f171();
++ public abstract void f172();
++ public abstract void f173();
++ public abstract void f174();
++ public abstract void f175();
++ public abstract void f176();
++ public abstract void f177();
++ public abstract void f178();
++ public abstract void f179();
++ public abstract void f180();
++ public abstract void f181();
++ public abstract void f182();
++ public abstract void f183();
++ public abstract void f184();
++ public abstract void f185();
++ public abstract void f186();
++ public abstract void f187();
++ public abstract void f188();
++ public abstract void f189();
++ public abstract void f190();
++ public abstract void f191();
++ public abstract void f192();
++ public abstract void f193();
++ public abstract void f194();
++ public abstract void f195();
++ public abstract void f196();
++ public abstract void f197();
++ public abstract void f198();
++ public abstract void f199();
++ public abstract void f200();
++ public abstract void f201();
++ public abstract void f202();
++ public abstract void f203();
++ public abstract void f204();
++ public abstract void f205();
++ public abstract void f206();
++ public abstract void f207();
++ public abstract void f208();
++ public abstract void f209();
++ public abstract void f210();
++ public abstract void f211();
++ public abstract void f212();
++ public abstract void f213();
++ public abstract void f214();
++ public abstract void f215();
++ public abstract void f216();
++ public abstract void f217();
++ public abstract void f218();
++ public abstract void f219();
++ public abstract void f220();
++ public abstract void f221();
++ public abstract void f222();
++ public abstract void f223();
++ public abstract void f224();
++ public abstract void f225();
++ public abstract void f226();
++ public abstract void f227();
++ public abstract void f228();
++ public abstract void f229();
++ public abstract void f230();
++ public abstract void f231();
++ public abstract void f232();
++ public abstract void f233();
++ public abstract void f234();
++ public abstract void f235();
++ public abstract void f236();
++ public abstract void f237();
++ public abstract void f238();
++ public abstract void f239();
++ public abstract void f240();
++ public abstract void f241();
++ public abstract void f242();
++ public abstract void f243();
++ public abstract void f244();
++ public abstract void f245();
++ public abstract void f246();
++ public abstract void f247();
++ public abstract void f248();
++ public abstract void f249();
++ public abstract void f250();
++ public abstract void f251();
++ public abstract void f252();
++ public abstract void f253();
++ public abstract void f254();
++ public abstract void f255();
++ public abstract void f256();
++ public abstract void f257();
++ public abstract void f258();
++ public abstract void f259();
++ public abstract void f260();
++ public abstract void f261();
++ public abstract void f262();
++ public abstract void f263();
++ public abstract void f264();
++ public abstract void f265();
++ public abstract void f266();
++ public abstract void f267();
++ public abstract void f268();
++ public abstract void f269();
++ public abstract void f270();
++ public abstract void f271();
++ public abstract void f272();
++ public abstract void f273();
++ public abstract void f274();
++ public abstract void f275();
++ public abstract void f276();
++ public abstract void f277();
++ public abstract void f278();
++ public abstract void f279();
++ public abstract void f280();
++ public abstract void f281();
++ public abstract void f282();
++ public abstract void f283();
++ public abstract void f284();
++ public abstract void f285();
++ public abstract void f286();
++ public abstract void f287();
++ public abstract void f288();
++ public abstract void f289();
++ public abstract void f290();
++ public abstract void f291();
++ public abstract void f292();
++ public abstract void f293();
++ public abstract void f294();
++ public abstract void f295();
++ public abstract void f296();
++ public abstract void f297();
++ public abstract void f298();
++ public abstract void f299();
++ public abstract void f300();
++ public abstract void f301();
++ public abstract void f302();
++ public abstract void f303();
++ public abstract void f304();
++ public abstract void f305();
++ public abstract void f306();
++ public abstract void f307();
++ public abstract void f308();
++ public abstract void f309();
++ public abstract void f310();
++ public abstract void f311();
++ public abstract void f312();
++ public abstract void f313();
++ public abstract void f314();
++ public abstract void f315();
++ public abstract void f316();
++ public abstract void f317();
++ public abstract void f318();
++ public abstract void f319();
++ public abstract void f320();
++ public abstract void f321();
++ public abstract void f322();
++ public abstract void f323();
++ public abstract void f324();
++ public abstract void f325();
++ public abstract void f326();
++ public abstract void f327();
++ public abstract void f328();
++ public abstract void f329();
++ public abstract void f330();
++ public abstract void f331();
++ public abstract void f332();
++ public abstract void f333();
++ public abstract void f334();
++ public abstract void f335();
++ public abstract void f336();
++ public abstract void f337();
++ public abstract void f338();
++ public abstract void f339();
++ public abstract void f340();
++ public abstract void f341();
++ public abstract void f342();
++ public abstract void f343();
++ public abstract void f344();
++ public abstract void f345();
++ public abstract void f346();
++ public abstract void f347();
++ public abstract void f348();
++ public abstract void f349();
++ public abstract void f350();
++ public abstract void f351();
++ public abstract void f352();
++ public abstract void f353();
++ public abstract void f354();
++ public abstract void f355();
++ public abstract void f356();
++ public abstract void f357();
++ public abstract void f358();
++ public abstract void f359();
++ public abstract void f360();
++ public abstract void f361();
++ public abstract void f362();
++ public abstract void f363();
++ public abstract void f364();
++ public abstract void f365();
++ public abstract void f366();
++ public abstract void f367();
++ public abstract void f368();
++ public abstract void f369();
++ public abstract void f370();
++ public abstract void f371();
++ public abstract void f372();
++ public abstract void f373();
++ public abstract void f374();
++ public abstract void f375();
++ public abstract void f376();
++ public abstract void f377();
++ public abstract void f378();
++ public abstract void f379();
++ public abstract void f380();
++ public abstract void f381();
++ public abstract void f382();
++ public abstract void f383();
++ public abstract void f384();
++ public abstract void f385();
++ public abstract void f386();
++ public abstract void f387();
++ public abstract void f388();
++ public abstract void f389();
++ public abstract void f390();
++ public abstract void f391();
++ public abstract void f392();
++ public abstract void f393();
++ public abstract void f394();
++ public abstract void f395();
++ public abstract void f396();
++ public abstract void f397();
++ public abstract void f398();
++ public abstract void f399();
++ public abstract void f400();
++ public abstract void f401();
++ public abstract void f402();
++ public abstract void f403();
++ public abstract void f404();
++ public abstract void f405();
++ public abstract void f406();
++ public abstract void f407();
++ public abstract void f408();
++ public abstract void f409();
++ public abstract void f410();
++ public abstract void f411();
++ public abstract void f412();
++ public abstract void f413();
++ public abstract void f414();
++ public abstract void f415();
++ public abstract void f416();
++ public abstract void f417();
++ public abstract void f418();
++ public abstract void f419();
++ public abstract void f420();
++ public abstract void f421();
++ public abstract void f422();
++ public abstract void f423();
++ public abstract void f424();
++ public abstract void f425();
++ public abstract void f426();
++ public abstract void f427();
++ public abstract void f428();
++ public abstract void f429();
++ public abstract void f430();
++ public abstract void f431();
++ public abstract void f432();
++ public abstract void f433();
++ public abstract void f434();
++ public abstract void f435();
++ public abstract void f436();
++ public abstract void f437();
++ public abstract void f438();
++ public abstract void f439();
++ public abstract void f440();
++ public abstract void f441();
++ public abstract void f442();
++ public abstract void f443();
++ public abstract void f444();
++ public abstract void f445();
++ public abstract void f446();
++ public abstract void f447();
++ public abstract void f448();
++ public abstract void f449();
++ public abstract void f450();
++ public abstract void f451();
++ public abstract void f452();
++ public abstract void f453();
++ public abstract void f454();
++ public abstract void f455();
++ public abstract void f456();
++ public abstract void f457();
++ public abstract void f458();
++ public abstract void f459();
++ public abstract void f460();
++ public abstract void f461();
++ public abstract void f462();
++ public abstract void f463();
++ public abstract void f464();
++ public abstract void f465();
++ public abstract void f466();
++ public abstract void f467();
++ public abstract void f468();
++ public abstract void f469();
++ public abstract void f470();
++ public abstract void f471();
++ public abstract void f472();
++ public abstract void f473();
++ public abstract void f474();
++ public abstract void f475();
++ public abstract void f476();
++ public abstract void f477();
++ public abstract void f478();
++ public abstract void f479();
++ public abstract void f480();
++ public abstract void f481();
++ public abstract void f482();
++ public abstract void f483();
++ public abstract void f484();
++ public abstract void f485();
++ public abstract void f486();
++ public abstract void f487();
++ public abstract void f488();
++ public abstract void f489();
++ public abstract void f490();
++ public abstract void f491();
++ public abstract void f492();
++ public abstract void f493();
++ public abstract void f494();
++ public abstract void f495();
++ public abstract void f496();
++ public abstract void f497();
++ public abstract void f498();
++ public abstract void f499();
++ public abstract void f500();
++ public abstract void f501();
++ public abstract void f502();
++ public abstract void f503();
++ public abstract void f504();
++ public abstract void f505();
++ public abstract void f506();
++ public abstract void f507();
++ public abstract void f508();
++ public abstract void f509();
++ public abstract void f510();
++ public abstract void f511();
++ public abstract void f512();
++ public abstract void f513();
++ public abstract void f514();
++ public abstract void f515();
++ public abstract void f516();
++ public abstract void f517();
++ public abstract void f518();
++ public abstract void f519();
++ public abstract void f520();
++ public abstract void f521();
++ public abstract void f522();
++ public abstract void f523();
++ public abstract void f524();
++ public abstract void f525();
++ public abstract void f526();
++ public abstract void f527();
++ public abstract void f528();
++ public abstract void f529();
++ public abstract void f530();
++ public abstract void f531();
++ public abstract void f532();
++ public abstract void f533();
++ public abstract void f534();
++ public abstract void f535();
++ public abstract void f536();
++ public abstract void f537();
++ public abstract void f538();
++ public abstract void f539();
++ public abstract void f540();
++ public abstract void f541();
++ public abstract void f542();
++ public abstract void f543();
++ public abstract void f544();
++ public abstract void f545();
++ public abstract void f546();
++ public abstract void f547();
++ public abstract void f548();
++ public abstract void f549();
++ public abstract void f550();
++ public abstract void f551();
++ public abstract void f552();
++ public abstract void f553();
++ public abstract void f554();
++ public abstract void f555();
++ public abstract void f556();
++ public abstract void f557();
++ public abstract void f558();
++ public abstract void f559();
++ public abstract void f560();
++ public abstract void f561();
++ public abstract void f562();
++ public abstract void f563();
++ public abstract void f564();
++ public abstract void f565();
++ public abstract void f566();
++ public abstract void f567();
++ public abstract void f568();
++ public abstract void f569();
++ public abstract void f570();
++ public abstract void f571();
++ public abstract void f572();
++ public abstract void f573();
++ public abstract void f574();
++ public abstract void f575();
++ public abstract void f576();
++ public abstract void f577();
++ public abstract void f578();
++ public abstract void f579();
++ public abstract void f580();
++ public abstract void f581();
++ public abstract void f582();
++ public abstract void f583();
++ public abstract void f584();
++ public abstract void f585();
++ public abstract void f586();
++ public abstract void f587();
++ public abstract void f588();
++ public abstract void f589();
++ public abstract void f590();
++ public abstract void f591();
++ public abstract void f592();
++ public abstract void f593();
++ public abstract void f594();
++ public abstract void f595();
++ public abstract void f596();
++ public abstract void f597();
++ public abstract void f598();
++ public abstract void f599();
++ public abstract void f600();
++ public abstract void f601();
++ public abstract void f602();
++ public abstract void f603();
++ public abstract void f604();
++ public abstract void f605();
++ public abstract void f606();
++ public abstract void f607();
++ public abstract void f608();
++ public abstract void f609();
++ public abstract void f610();
++ public abstract void f611();
++ public abstract void f612();
++ public abstract void f613();
++ public abstract void f614();
++ public abstract void f615();
++ public abstract void f616();
++ public abstract void f617();
++ public abstract void f618();
++ public abstract void f619();
++ public abstract void f620();
++ public abstract void f621();
++ public abstract void f622();
++ public abstract void f623();
++ public abstract void f624();
++ public abstract void f625();
++ public abstract void f626();
++ public abstract void f627();
++ public abstract void f628();
++ public abstract void f629();
++ public abstract void f630();
++ public abstract void f631();
++ public abstract void f632();
++ public abstract void f633();
++ public abstract void f634();
++ public abstract void f635();
++ public abstract void f636();
++ public abstract void f637();
++ public abstract void f638();
++ public abstract void f639();
++ public abstract void f640();
++ public abstract void f641();
++ public abstract void f642();
++ public abstract void f643();
++ public abstract void f644();
++ public abstract void f645();
++ public abstract void f646();
++ public abstract void f647();
++ public abstract void f648();
++ public abstract void f649();
++ public abstract void f650();
++ public abstract void f651();
++ public abstract void f652();
++ public abstract void f653();
++ public abstract void f654();
++ public abstract void f655();
++ public abstract void f656();
++ public abstract void f657();
++ public abstract void f658();
++ public abstract void f659();
++ public abstract void f660();
++ public abstract void f661();
++ public abstract void f662();
++ public abstract void f663();
++ public abstract void f664();
++ public abstract void f665();
++ public abstract void f666();
++ public abstract void f667();
++ public abstract void f668();
++ public abstract void f669();
++ public abstract void f670();
++ public abstract void f671();
++ public abstract void f672();
++ public abstract void f673();
++ public abstract void f674();
++ public abstract void f675();
++ public abstract void f676();
++ public abstract void f677();
++ public abstract void f678();
++ public abstract void f679();
++ public abstract void f680();
++ public abstract void f681();
++ public abstract void f682();
++ public abstract void f683();
++ public abstract void f684();
++ public abstract void f685();
++ public abstract void f686();
++ public abstract void f687();
++ public abstract void f688();
++ public abstract void f689();
++ public abstract void f690();
++ public abstract void f691();
++ public abstract void f692();
++ public abstract void f693();
++ public abstract void f694();
++ public abstract void f695();
++ public abstract void f696();
++ public abstract void f697();
++ public abstract void f698();
++ public abstract void f699();
++ public abstract void f700();
++ public abstract void f701();
++ public abstract void f702();
++ public abstract void f703();
++ public abstract void f704();
++ public abstract void f705();
++ public abstract void f706();
++ public abstract void f707();
++ public abstract void f708();
++ public abstract void f709();
++ public abstract void f710();
++ public abstract void f711();
++ public abstract void f712();
++ public abstract void f713();
++ public abstract void f714();
++ public abstract void f715();
++ public abstract void f716();
++ public abstract void f717();
++ public abstract void f718();
++ public abstract void f719();
++ public abstract void f720();
++ public abstract void f721();
++ public abstract void f722();
++ public abstract void f723();
++ public abstract void f724();
++ public abstract void f725();
++ public abstract void f726();
++ public abstract void f727();
++ public abstract void f728();
++ public abstract void f729();
++ public abstract void f730();
++ public abstract void f731();
++ public abstract void f732();
++ public abstract void f733();
++ public abstract void f734();
++ public abstract void f735();
++ public abstract void f736();
++ public abstract void f737();
++ public abstract void f738();
++ public abstract void f739();
++ public abstract void f740();
++ public abstract void f741();
++ public abstract void f742();
++ public abstract void f743();
++ public abstract void f744();
++ public abstract void f745();
++ public abstract void f746();
++ public abstract void f747();
++ public abstract void f748();
++ public abstract void f749();
++ public abstract void f750();
++ public abstract void f751();
++ public abstract void f752();
++ public abstract void f753();
++ public abstract void f754();
++ public abstract void f755();
++ public abstract void f756();
++ public abstract void f757();
++ public abstract void f758();
++ public abstract void f759();
++ public abstract void f760();
++ public abstract void f761();
++ public abstract void f762();
++ public abstract void f763();
++ public abstract void f764();
++ public abstract void f765();
++ public abstract void f766();
++ public abstract void f767();
++ public abstract void f768();
++ public abstract void f769();
++ public abstract void f770();
++ public abstract void f771();
++ public abstract void f772();
++ public abstract void f773();
++ public abstract void f774();
++ public abstract void f775();
++ public abstract void f776();
++ public abstract void f777();
++ public abstract void f778();
++ public abstract void f779();
++ public abstract void f780();
++ public abstract void f781();
++ public abstract void f782();
++ public abstract void f783();
++ public abstract void f784();
++ public abstract void f785();
++ public abstract void f786();
++ public abstract void f787();
++ public abstract void f788();
++ public abstract void f789();
++ public abstract void f790();
++ public abstract void f791();
++ public abstract void f792();
++ public abstract void f793();
++ public abstract void f794();
++ public abstract void f795();
++ public abstract void f796();
++ public abstract void f797();
++ public abstract void f798();
++ public abstract void f799();
++ public abstract void f800();
++ public abstract void f801();
++ public abstract void f802();
++ public abstract void f803();
++ public abstract void f804();
++ public abstract void f805();
++ public abstract void f806();
++ public abstract void f807();
++ public abstract void f808();
++ public abstract void f809();
++ public abstract void f810();
++ public abstract void f811();
++ public abstract void f812();
++ public abstract void f813();
++ public abstract void f814();
++ public abstract void f815();
++ public abstract void f816();
++ public abstract void f817();
++ public abstract void f818();
++ public abstract void f819();
++ public abstract void f820();
++ public abstract void f821();
++ public abstract void f822();
++ public abstract void f823();
++ public abstract void f824();
++ public abstract void f825();
++ public abstract void f826();
++ public abstract void f827();
++ public abstract void f828();
++ public abstract void f829();
++ public abstract void f830();
++ public abstract void f831();
++ public abstract void f832();
++ public abstract void f833();
++ public abstract void f834();
++ public abstract void f835();
++ public abstract void f836();
++ public abstract void f837();
++ public abstract void f838();
++ public abstract void f839();
++ public abstract void f840();
++ public abstract void f841();
++ public abstract void f842();
++ public abstract void f843();
++ public abstract void f844();
++ public abstract void f845();
++ public abstract void f846();
++ public abstract void f847();
++ public abstract void f848();
++ public abstract void f849();
++ public abstract void f850();
++ public abstract void f851();
++ public abstract void f852();
++ public abstract void f853();
++ public abstract void f854();
++ public abstract void f855();
++ public abstract void f856();
++ public abstract void f857();
++ public abstract void f858();
++ public abstract void f859();
++ public abstract void f860();
++ public abstract void f861();
++ public abstract void f862();
++ public abstract void f863();
++ public abstract void f864();
++ public abstract void f865();
++ public abstract void f866();
++ public abstract void f867();
++ public abstract void f868();
++ public abstract void f869();
++ public abstract void f870();
++ public abstract void f871();
++ public abstract void f872();
++ public abstract void f873();
++ public abstract void f874();
++ public abstract void f875();
++ public abstract void f876();
++ public abstract void f877();
++ public abstract void f878();
++ public abstract void f879();
++ public abstract void f880();
++ public abstract void f881();
++ public abstract void f882();
++ public abstract void f883();
++ public abstract void f884();
++ public abstract void f885();
++ public abstract void f886();
++ public abstract void f887();
++ public abstract void f888();
++ public abstract void f889();
++ public abstract void f890();
++ public abstract void f891();
++ public abstract void f892();
++ public abstract void f893();
++ public abstract void f894();
++ public abstract void f895();
++ public abstract void f896();
++ public abstract void f897();
++ public abstract void f898();
++ public abstract void f899();
++ public abstract void f900();
++ public abstract void f901();
++ public abstract void f902();
++ public abstract void f903();
++ public abstract void f904();
++ public abstract void f905();
++ public abstract void f906();
++ public abstract void f907();
++ public abstract void f908();
++ public abstract void f909();
++ public abstract void f910();
++ public abstract void f911();
++ public abstract void f912();
++ public abstract void f913();
++ public abstract void f914();
++ public abstract void f915();
++ public abstract void f916();
++ public abstract void f917();
++ public abstract void f918();
++ public abstract void f919();
++ public abstract void f920();
++ public abstract void f921();
++ public abstract void f922();
++ public abstract void f923();
++ public abstract void f924();
++ public abstract void f925();
++ public abstract void f926();
++ public abstract void f927();
++ public abstract void f928();
++ public abstract void f929();
++ public abstract void f930();
++ public abstract void f931();
++ public abstract void f932();
++ public abstract void f933();
++ public abstract void f934();
++ public abstract void f935();
++ public abstract void f936();
++ public abstract void f937();
++ public abstract void f938();
++ public abstract void f939();
++ public abstract void f940();
++ public abstract void f941();
++ public abstract void f942();
++ public abstract void f943();
++ public abstract void f944();
++ public abstract void f945();
++ public abstract void f946();
++ public abstract void f947();
++ public abstract void f948();
++ public abstract void f949();
++ public abstract void f950();
++ public abstract void f951();
++ public abstract void f952();
++ public abstract void f953();
++ public abstract void f954();
++ public abstract void f955();
++ public abstract void f956();
++ public abstract void f957();
++ public abstract void f958();
++ public abstract void f959();
++ public abstract void f960();
++ public abstract void f961();
++ public abstract void f962();
++ public abstract void f963();
++ public abstract void f964();
++ public abstract void f965();
++ public abstract void f966();
++ public abstract void f967();
++ public abstract void f968();
++ public abstract void f969();
++ public abstract void f970();
++ public abstract void f971();
++ public abstract void f972();
++ public abstract void f973();
++ public abstract void f974();
++ public abstract void f975();
++ public abstract void f976();
++ public abstract void f977();
++ public abstract void f978();
++ public abstract void f979();
++ public abstract void f980();
++ public abstract void f981();
++ public abstract void f982();
++ public abstract void f983();
++ public abstract void f984();
++ public abstract void f985();
++ public abstract void f986();
++ public abstract void f987();
++ public abstract void f988();
++ public abstract void f989();
++ public abstract void f990();
++ public abstract void f991();
++ public abstract void f992();
++ public abstract void f993();
++ public abstract void f994();
++ public abstract void f995();
++ public abstract void f996();
++ public abstract void f997();
++ public abstract void f998();
++ public abstract void f999();
++ public abstract void f1000();
++ public abstract void f1001();
++ public abstract void f1002();
++ public abstract void f1003();
++ public abstract void f1004();
++ public abstract void f1005();
++ public abstract void f1006();
++ public abstract void f1007();
++ public abstract void f1008();
++ public abstract void f1009();
++ public abstract void f1010();
++ public abstract void f1011();
++ public abstract void f1012();
++ public abstract void f1013();
++ public abstract void f1014();
++ public abstract void f1015();
++ public abstract void f1016();
++ public abstract void f1017();
++ public abstract void f1018();
++ public abstract void f1019();
++ public abstract void f1020();
++ public abstract void f1021();
++ public abstract void f1022();
++ public abstract void f1023();
++ public abstract void f1024();
++ public abstract void f1025();
++ public abstract void f1026();
++ public abstract void f1027();
++ public abstract void f1028();
++ public abstract void f1029();
++ public abstract void f1030();
++ public abstract void f1031();
++ public abstract void f1032();
++ public abstract void f1033();
++ public abstract void f1034();
++ public abstract void f1035();
++ public abstract void f1036();
++ public abstract void f1037();
++ public abstract void f1038();
++ public abstract void f1039();
++ public abstract void f1040();
++ public abstract void f1041();
++ public abstract void f1042();
++ public abstract void f1043();
++ public abstract void f1044();
++ public abstract void f1045();
++ public abstract void f1046();
++ public abstract void f1047();
++ public abstract void f1048();
++ public abstract void f1049();
++ public abstract void f1050();
++ public abstract void f1051();
++ public abstract void f1052();
++ public abstract void f1053();
++ public abstract void f1054();
++ public abstract void f1055();
++ public abstract void f1056();
++ public abstract void f1057();
++ public abstract void f1058();
++ public abstract void f1059();
++ public abstract void f1060();
++ public abstract void f1061();
++ public abstract void f1062();
++ public abstract void f1063();
++ public abstract void f1064();
++ public abstract void f1065();
++ public abstract void f1066();
++ public abstract void f1067();
++ public abstract void f1068();
++ public abstract void f1069();
++ public abstract void f1070();
++ public abstract void f1071();
++ public abstract void f1072();
++ public abstract void f1073();
++ public abstract void f1074();
++ public abstract void f1075();
++ public abstract void f1076();
++ public abstract void f1077();
++ public abstract void f1078();
++ public abstract void f1079();
++ public abstract void f1080();
++ public abstract void f1081();
++ public abstract void f1082();
++ public abstract void f1083();
++ public abstract void f1084();
++ public abstract void f1085();
++ public abstract void f1086();
++ public abstract void f1087();
++ public abstract void f1088();
++ public abstract void f1089();
++ public abstract void f1090();
++ public abstract void f1091();
++ public abstract void f1092();
++ public abstract void f1093();
++ public abstract void f1094();
++ public abstract void f1095();
++ public abstract void f1096();
++ public abstract void f1097();
++ public abstract void f1098();
++ public abstract void f1099();
++ public abstract void f1100();
++ public abstract void f1101();
++ public abstract void f1102();
++ public abstract void f1103();
++ public abstract void f1104();
++ public abstract void f1105();
++ public abstract void f1106();
++ public abstract void f1107();
++ public abstract void f1108();
++ public abstract void f1109();
++ public abstract void f1110();
++ public abstract void f1111();
++ public abstract void f1112();
++ public abstract void f1113();
++ public abstract void f1114();
++ public abstract void f1115();
++ public abstract void f1116();
++ public abstract void f1117();
++ public abstract void f1118();
++ public abstract void f1119();
++ public abstract void f1120();
++ public abstract void f1121();
++ public abstract void f1122();
++ public abstract void f1123();
++ public abstract void f1124();
++ public abstract void f1125();
++ public abstract void f1126();
++ public abstract void f1127();
++ public abstract void f1128();
++ public abstract void f1129();
++ public abstract void f1130();
++ public abstract void f1131();
++ public abstract void f1132();
++ public abstract void f1133();
++ public abstract void f1134();
++ public abstract void f1135();
++ public abstract void f1136();
++ public abstract void f1137();
++ public abstract void f1138();
++ public abstract void f1139();
++ public abstract void f1140();
++ public abstract void f1141();
++ public abstract void f1142();
++ public abstract void f1143();
++ public abstract void f1144();
++ public abstract void f1145();
++ public abstract void f1146();
++ public abstract void f1147();
++ public abstract void f1148();
++ public abstract void f1149();
++ public abstract void f1150();
++ public abstract void f1151();
++ public abstract void f1152();
++ public abstract void f1153();
++ public abstract void f1154();
++ public abstract void f1155();
++ public abstract void f1156();
++ public abstract void f1157();
++ public abstract void f1158();
++ public abstract void f1159();
++ public abstract void f1160();
++ public abstract void f1161();
++ public abstract void f1162();
++ public abstract void f1163();
++ public abstract void f1164();
++ public abstract void f1165();
++ public abstract void f1166();
++ public abstract void f1167();
++ public abstract void f1168();
++ public abstract void f1169();
++ public abstract void f1170();
++ public abstract void f1171();
++ public abstract void f1172();
++ public abstract void f1173();
++ public abstract void f1174();
++ public abstract void f1175();
++ public abstract void f1176();
++ public abstract void f1177();
++ public abstract void f1178();
++ public abstract void f1179();
++ public abstract void f1180();
++ public abstract void f1181();
++ public abstract void f1182();
++ public abstract void f1183();
++ public abstract void f1184();
++ public abstract void f1185();
++ public abstract void f1186();
++ public abstract void f1187();
++ public abstract void f1188();
++ public abstract void f1189();
++ public abstract void f1190();
++ public abstract void f1191();
++ public abstract void f1192();
++ public abstract void f1193();
++ public abstract void f1194();
++ public abstract void f1195();
++ public abstract void f1196();
++ public abstract void f1197();
++ public abstract void f1198();
++ public abstract void f1199();
++ public abstract void f1200();
++ public abstract void f1201();
++ public abstract void f1202();
++ public abstract void f1203();
++ public abstract void f1204();
++ public abstract void f1205();
++ public abstract void f1206();
++ public abstract void f1207();
++ public abstract void f1208();
++ public abstract void f1209();
++ public abstract void f1210();
++ public abstract void f1211();
++ public abstract void f1212();
++ public abstract void f1213();
++ public abstract void f1214();
++ public abstract void f1215();
++ public abstract void f1216();
++ public abstract void f1217();
++ public abstract void f1218();
++ public abstract void f1219();
++ public abstract void f1220();
++ public abstract void f1221();
++ public abstract void f1222();
++ public abstract void f1223();
++ public abstract void f1224();
++ public abstract void f1225();
++ public abstract void f1226();
++ public abstract void f1227();
++ public abstract void f1228();
++ public abstract void f1229();
++ public abstract void f1230();
++ public abstract void f1231();
++ public abstract void f1232();
++ public abstract void f1233();
++ public abstract void f1234();
++ public abstract void f1235();
++ public abstract void f1236();
++ public abstract void f1237();
++ public abstract void f1238();
++ public abstract void f1239();
++ public abstract void f1240();
++ public abstract void f1241();
++ public abstract void f1242();
++ public abstract void f1243();
++ public abstract void f1244();
++ public abstract void f1245();
++ public abstract void f1246();
++ public abstract void f1247();
++ public abstract void f1248();
++ public abstract void f1249();
++ public abstract void f1250();
++ public abstract void f1251();
++ public abstract void f1252();
++ public abstract void f1253();
++ public abstract void f1254();
++ public abstract void f1255();
++ public abstract void f1256();
++ public abstract void f1257();
++ public abstract void f1258();
++ public abstract void f1259();
++ public abstract void f1260();
++ public abstract void f1261();
++ public abstract void f1262();
++ public abstract void f1263();
++ public abstract void f1264();
++ public abstract void f1265();
++ public abstract void f1266();
++ public abstract void f1267();
++ public abstract void f1268();
++ public abstract void f1269();
++ public abstract void f1270();
++ public abstract void f1271();
++ public abstract void f1272();
++ public abstract void f1273();
++ public abstract void f1274();
++ public abstract void f1275();
++ public abstract void f1276();
++ public abstract void f1277();
++ public abstract void f1278();
++ public abstract void f1279();
++ public abstract void f1280();
++ public abstract void f1281();
++ public abstract void f1282();
++ public abstract void f1283();
++ public abstract void f1284();
++ public abstract void f1285();
++ public abstract void f1286();
++ public abstract void f1287();
++ public abstract void f1288();
++ public abstract void f1289();
++ public abstract void f1290();
++ public abstract void f1291();
++ public abstract void f1292();
++ public abstract void f1293();
++ public abstract void f1294();
++ public abstract void f1295();
++ public abstract void f1296();
++ public abstract void f1297();
++ public abstract void f1298();
++ public abstract void f1299();
++ public abstract void f1300();
++ public abstract void f1301();
++ public abstract void f1302();
++ public abstract void f1303();
++ public abstract void f1304();
++ public abstract void f1305();
++ public abstract void f1306();
++ public abstract void f1307();
++ public abstract void f1308();
++ public abstract void f1309();
++ public abstract void f1310();
++ public abstract void f1311();
++ public abstract void f1312();
++ public abstract void f1313();
++ public abstract void f1314();
++ public abstract void f1315();
++ public abstract void f1316();
++ public abstract void f1317();
++ public abstract void f1318();
++ public abstract void f1319();
++ public abstract void f1320();
++ public abstract void f1321();
++ public abstract void f1322();
++ public abstract void f1323();
++ public abstract void f1324();
++ public abstract void f1325();
++ public abstract void f1326();
++ public abstract void f1327();
++ public abstract void f1328();
++ public abstract void f1329();
++ public abstract void f1330();
++ public abstract void f1331();
++ public abstract void f1332();
++ public abstract void f1333();
++ public abstract void f1334();
++ public abstract void f1335();
++ public abstract void f1336();
++ public abstract void f1337();
++ public abstract void f1338();
++ public abstract void f1339();
++ public abstract void f1340();
++ public abstract void f1341();
++ public abstract void f1342();
++ public abstract void f1343();
++ public abstract void f1344();
++ public abstract void f1345();
++ public abstract void f1346();
++ public abstract void f1347();
++ public abstract void f1348();
++ public abstract void f1349();
++ public abstract void f1350();
++ public abstract void f1351();
++ public abstract void f1352();
++ public abstract void f1353();
++ public abstract void f1354();
++ public abstract void f1355();
++ public abstract void f1356();
++ public abstract void f1357();
++ public abstract void f1358();
++ public abstract void f1359();
++ public abstract void f1360();
++ public abstract void f1361();
++ public abstract void f1362();
++ public abstract void f1363();
++ public abstract void f1364();
++ public abstract void f1365();
++ public abstract void f1366();
++ public abstract void f1367();
++ public abstract void f1368();
++ public abstract void f1369();
++ public abstract void f1370();
++ public abstract void f1371();
++ public abstract void f1372();
++ public abstract void f1373();
++ public abstract void f1374();
++ public abstract void f1375();
++ public abstract void f1376();
++ public abstract void f1377();
++ public abstract void f1378();
++ public abstract void f1379();
++ public abstract void f1380();
++ public abstract void f1381();
++ public abstract void f1382();
++ public abstract void f1383();
++ public abstract void f1384();
++ public abstract void f1385();
++ public abstract void f1386();
++ public abstract void f1387();
++ public abstract void f1388();
++ public abstract void f1389();
++ public abstract void f1390();
++ public abstract void f1391();
++ public abstract void f1392();
++ public abstract void f1393();
++ public abstract void f1394();
++ public abstract void f1395();
++ public abstract void f1396();
++ public abstract void f1397();
++ public abstract void f1398();
++ public abstract void f1399();
++ public abstract void f1400();
++ public abstract void f1401();
++ public abstract void f1402();
++ public abstract void f1403();
++ public abstract void f1404();
++ public abstract void f1405();
++ public abstract void f1406();
++ public abstract void f1407();
++ public abstract void f1408();
++ public abstract void f1409();
++ public abstract void f1410();
++ public abstract void f1411();
++ public abstract void f1412();
++ public abstract void f1413();
++ public abstract void f1414();
++ public abstract void f1415();
++ public abstract void f1416();
++ public abstract void f1417();
++ public abstract void f1418();
++ public abstract void f1419();
++ public abstract void f1420();
++ public abstract void f1421();
++ public abstract void f1422();
++ public abstract void f1423();
++ public abstract void f1424();
++ public abstract void f1425();
++ public abstract void f1426();
++ public abstract void f1427();
++ public abstract void f1428();
++ public abstract void f1429();
++ public abstract void f1430();
++ public abstract void f1431();
++ public abstract void f1432();
++ public abstract void f1433();
++ public abstract void f1434();
++ public abstract void f1435();
++ public abstract void f1436();
++ public abstract void f1437();
++ public abstract void f1438();
++ public abstract void f1439();
++ public abstract void f1440();
++ public abstract void f1441();
++ public abstract void f1442();
++ public abstract void f1443();
++ public abstract void f1444();
++ public abstract void f1445();
++ public abstract void f1446();
++ public abstract void f1447();
++ public abstract void f1448();
++ public abstract void f1449();
++ public abstract void f1450();
++ public abstract void f1451();
++ public abstract void f1452();
++ public abstract void f1453();
++ public abstract void f1454();
++ public abstract void f1455();
++ public abstract void f1456();
++ public abstract void f1457();
++ public abstract void f1458();
++ public abstract void f1459();
++ public abstract void f1460();
++ public abstract void f1461();
++ public abstract void f1462();
++ public abstract void f1463();
++ public abstract void f1464();
++ public abstract void f1465();
++ public abstract void f1466();
++ public abstract void f1467();
++ public abstract void f1468();
++ public abstract void f1469();
++ public abstract void f1470();
++ public abstract void f1471();
++ public abstract void f1472();
++ public abstract void f1473();
++ public abstract void f1474();
++ public abstract void f1475();
++ public abstract void f1476();
++ public abstract void f1477();
++ public abstract void f1478();
++ public abstract void f1479();
++ public abstract void f1480();
++ public abstract void f1481();
++ public abstract void f1482();
++ public abstract void f1483();
++ public abstract void f1484();
++ public abstract void f1485();
++ public abstract void f1486();
++ public abstract void f1487();
++ public abstract void f1488();
++ public abstract void f1489();
++ public abstract void f1490();
++ public abstract void f1491();
++ public abstract void f1492();
++ public abstract void f1493();
++ public abstract void f1494();
++ public abstract void f1495();
++ public abstract void f1496();
++ public abstract void f1497();
++ public abstract void f1498();
++ public abstract void f1499();
++ public abstract void f1500();
++ public abstract void f1501();
++ public abstract void f1502();
++ public abstract void f1503();
++ public abstract void f1504();
++ public abstract void f1505();
++ public abstract void f1506();
++ public abstract void f1507();
++ public abstract void f1508();
++ public abstract void f1509();
++ public abstract void f1510();
++ public abstract void f1511();
++ public abstract void f1512();
++ public abstract void f1513();
++ public abstract void f1514();
++ public abstract void f1515();
++ public abstract void f1516();
++ public abstract void f1517();
++ public abstract void f1518();
++ public abstract void f1519();
++ public abstract void f1520();
++ public abstract void f1521();
++ public abstract void f1522();
++ public abstract void f1523();
++ public abstract void f1524();
++ public abstract void f1525();
++ public abstract void f1526();
++ public abstract void f1527();
++ public abstract void f1528();
++ public abstract void f1529();
++ public abstract void f1530();
++ public abstract void f1531();
++ public abstract void f1532();
++ public abstract void f1533();
++ public abstract void f1534();
++ public abstract void f1535();
++ public abstract void f1536();
++ public abstract void f1537();
++ public abstract void f1538();
++ public abstract void f1539();
++ public abstract void f1540();
++ public abstract void f1541();
++ public abstract void f1542();
++ public abstract void f1543();
++ public abstract void f1544();
++ public abstract void f1545();
++ public abstract void f1546();
++ public abstract void f1547();
++ public abstract void f1548();
++ public abstract void f1549();
++ public abstract void f1550();
++ public abstract void f1551();
++ public abstract void f1552();
++ public abstract void f1553();
++ public abstract void f1554();
++ public abstract void f1555();
++ public abstract void f1556();
++ public abstract void f1557();
++ public abstract void f1558();
++ public abstract void f1559();
++ public abstract void f1560();
++ public abstract void f1561();
++ public abstract void f1562();
++ public abstract void f1563();
++ public abstract void f1564();
++ public abstract void f1565();
++ public abstract void f1566();
++ public abstract void f1567();
++ public abstract void f1568();
++ public abstract void f1569();
++ public abstract void f1570();
++ public abstract void f1571();
++ public abstract void f1572();
++ public abstract void f1573();
++ public abstract void f1574();
++ public abstract void f1575();
++ public abstract void f1576();
++ public abstract void f1577();
++ public abstract void f1578();
++ public abstract void f1579();
++ public abstract void f1580();
++ public abstract void f1581();
++ public abstract void f1582();
++ public abstract void f1583();
++ public abstract void f1584();
++ public abstract void f1585();
++ public abstract void f1586();
++ public abstract void f1587();
++ public abstract void f1588();
++ public abstract void f1589();
++ public abstract void f1590();
++ public abstract void f1591();
++ public abstract void f1592();
++ public abstract void f1593();
++ public abstract void f1594();
++ public abstract void f1595();
++ public abstract void f1596();
++ public abstract void f1597();
++ public abstract void f1598();
++ public abstract void f1599();
++ public abstract void f1600();
++ public abstract void f1601();
++ public abstract void f1602();
++ public abstract void f1603();
++ public abstract void f1604();
++ public abstract void f1605();
++ public abstract void f1606();
++ public abstract void f1607();
++ public abstract void f1608();
++ public abstract void f1609();
++ public abstract void f1610();
++ public abstract void f1611();
++ public abstract void f1612();
++ public abstract void f1613();
++ public abstract void f1614();
++ public abstract void f1615();
++ public abstract void f1616();
++ public abstract void f1617();
++ public abstract void f1618();
++ public abstract void f1619();
++ public abstract void f1620();
++ public abstract void f1621();
++ public abstract void f1622();
++ public abstract void f1623();
++ public abstract void f1624();
++ public abstract void f1625();
++ public abstract void f1626();
++ public abstract void f1627();
++ public abstract void f1628();
++ public abstract void f1629();
++ public abstract void f1630();
++ public abstract void f1631();
++ public abstract void f1632();
++ public abstract void f1633();
++ public abstract void f1634();
++ public abstract void f1635();
++ public abstract void f1636();
++ public abstract void f1637();
++ public abstract void f1638();
++ public abstract void f1639();
++ public abstract void f1640();
++ public abstract void f1641();
++ public abstract void f1642();
++ public abstract void f1643();
++ public abstract void f1644();
++ public abstract void f1645();
++ public abstract void f1646();
++ public abstract void f1647();
++ public abstract void f1648();
++ public abstract void f1649();
++ public abstract void f1650();
++ public abstract void f1651();
++ public abstract void f1652();
++ public abstract void f1653();
++ public abstract void f1654();
++ public abstract void f1655();
++ public abstract void f1656();
++ public abstract void f1657();
++ public abstract void f1658();
++ public abstract void f1659();
++ public abstract void f1660();
++ public abstract void f1661();
++ public abstract void f1662();
++ public abstract void f1663();
++ public abstract void f1664();
++ public abstract void f1665();
++ public abstract void f1666();
++ public abstract void f1667();
++ public abstract void f1668();
++ public abstract void f1669();
++ public abstract void f1670();
++ public abstract void f1671();
++ public abstract void f1672();
++ public abstract void f1673();
++ public abstract void f1674();
++ public abstract void f1675();
++ public abstract void f1676();
++ public abstract void f1677();
++ public abstract void f1678();
++ public abstract void f1679();
++ public abstract void f1680();
++ public abstract void f1681();
++ public abstract void f1682();
++ public abstract void f1683();
++ public abstract void f1684();
++ public abstract void f1685();
++ public abstract void f1686();
++ public abstract void f1687();
++ public abstract void f1688();
++ public abstract void f1689();
++ public abstract void f1690();
++ public abstract void f1691();
++ public abstract void f1692();
++ public abstract void f1693();
++ public abstract void f1694();
++ public abstract void f1695();
++ public abstract void f1696();
++ public abstract void f1697();
++ public abstract void f1698();
++ public abstract void f1699();
++ public abstract void f1700();
++ public abstract void f1701();
++ public abstract void f1702();
++ public abstract void f1703();
++ public abstract void f1704();
++ public abstract void f1705();
++ public abstract void f1706();
++ public abstract void f1707();
++ public abstract void f1708();
++ public abstract void f1709();
++ public abstract void f1710();
++ public abstract void f1711();
++ public abstract void f1712();
++ public abstract void f1713();
++ public abstract void f1714();
++ public abstract void f1715();
++ public abstract void f1716();
++ public abstract void f1717();
++ public abstract void f1718();
++ public abstract void f1719();
++ public abstract void f1720();
++ public abstract void f1721();
++ public abstract void f1722();
++ public abstract void f1723();
++ public abstract void f1724();
++ public abstract void f1725();
++ public abstract void f1726();
++ public abstract void f1727();
++ public abstract void f1728();
++ public abstract void f1729();
++ public abstract void f1730();
++ public abstract void f1731();
++ public abstract void f1732();
++ public abstract void f1733();
++ public abstract void f1734();
++ public abstract void f1735();
++ public abstract void f1736();
++ public abstract void f1737();
++ public abstract void f1738();
++ public abstract void f1739();
++ public abstract void f1740();
++ public abstract void f1741();
++ public abstract void f1742();
++ public abstract void f1743();
++ public abstract void f1744();
++ public abstract void f1745();
++ public abstract void f1746();
++ public abstract void f1747();
++ public abstract void f1748();
++ public abstract void f1749();
++ public abstract void f1750();
++ public abstract void f1751();
++ public abstract void f1752();
++ public abstract void f1753();
++ public abstract void f1754();
++ public abstract void f1755();
++ public abstract void f1756();
++ public abstract void f1757();
++ public abstract void f1758();
++ public abstract void f1759();
++ public abstract void f1760();
++ public abstract void f1761();
++ public abstract void f1762();
++ public abstract void f1763();
++ public abstract void f1764();
++ public abstract void f1765();
++ public abstract void f1766();
++ public abstract void f1767();
++ public abstract void f1768();
++ public abstract void f1769();
++ public abstract void f1770();
++ public abstract void f1771();
++ public abstract void f1772();
++ public abstract void f1773();
++ public abstract void f1774();
++ public abstract void f1775();
++ public abstract void f1776();
++ public abstract void f1777();
++ public abstract void f1778();
++ public abstract void f1779();
++ public abstract void f1780();
++ public abstract void f1781();
++ public abstract void f1782();
++ public abstract void f1783();
++ public abstract void f1784();
++ public abstract void f1785();
++ public abstract void f1786();
++ public abstract void f1787();
++ public abstract void f1788();
++ public abstract void f1789();
++ public abstract void f1790();
++ public abstract void f1791();
++ public abstract void f1792();
++ public abstract void f1793();
++ public abstract void f1794();
++ public abstract void f1795();
++ public abstract void f1796();
++ public abstract void f1797();
++ public abstract void f1798();
++ public abstract void f1799();
++ public abstract void f1800();
++ public abstract void f1801();
++ public abstract void f1802();
++ public abstract void f1803();
++ public abstract void f1804();
++ public abstract void f1805();
++ public abstract void f1806();
++ public abstract void f1807();
++ public abstract void f1808();
++ public abstract void f1809();
++ public abstract void f1810();
++ public abstract void f1811();
++ public abstract void f1812();
++ public abstract void f1813();
++ public abstract void f1814();
++ public abstract void f1815();
++ public abstract void f1816();
++ public abstract void f1817();
++ public abstract void f1818();
++ public abstract void f1819();
++ public abstract void f1820();
++ public abstract void f1821();
++ public abstract void f1822();
++ public abstract void f1823();
++ public abstract void f1824();
++ public abstract void f1825();
++ public abstract void f1826();
++ public abstract void f1827();
++ public abstract void f1828();
++ public abstract void f1829();
++ public abstract void f1830();
++ public abstract void f1831();
++ public abstract void f1832();
++ public abstract void f1833();
++ public abstract void f1834();
++ public abstract void f1835();
++ public abstract void f1836();
++ public abstract void f1837();
++ public abstract void f1838();
++ public abstract void f1839();
++ public abstract void f1840();
++ public abstract void f1841();
++ public abstract void f1842();
++ public abstract void f1843();
++ public abstract void f1844();
++ public abstract void f1845();
++ public abstract void f1846();
++ public abstract void f1847();
++ public abstract void f1848();
++ public abstract void f1849();
++ public abstract void f1850();
++ public abstract void f1851();
++ public abstract void f1852();
++ public abstract void f1853();
++ public abstract void f1854();
++ public abstract void f1855();
++ public abstract void f1856();
++ public abstract void f1857();
++ public abstract void f1858();
++ public abstract void f1859();
++ public abstract void f1860();
++ public abstract void f1861();
++ public abstract void f1862();
++ public abstract void f1863();
++ public abstract void f1864();
++ public abstract void f1865();
++ public abstract void f1866();
++ public abstract void f1867();
++ public abstract void f1868();
++ public abstract void f1869();
++ public abstract void f1870();
++ public abstract void f1871();
++ public abstract void f1872();
++ public abstract void f1873();
++ public abstract void f1874();
++ public abstract void f1875();
++ public abstract void f1876();
++ public abstract void f1877();
++ public abstract void f1878();
++ public abstract void f1879();
++ public abstract void f1880();
++ public abstract void f1881();
++ public abstract void f1882();
++ public abstract void f1883();
++ public abstract void f1884();
++ public abstract void f1885();
++ public abstract void f1886();
++ public abstract void f1887();
++ public abstract void f1888();
++ public abstract void f1889();
++ public abstract void f1890();
++ public abstract void f1891();
++ public abstract void f1892();
++ public abstract void f1893();
++ public abstract void f1894();
++ public abstract void f1895();
++ public abstract void f1896();
++ public abstract void f1897();
++ public abstract void f1898();
++ public abstract void f1899();
++ public abstract void f1900();
++ public abstract void f1901();
++ public abstract void f1902();
++ public abstract void f1903();
++ public abstract void f1904();
++ public abstract void f1905();
++ public abstract void f1906();
++ public abstract void f1907();
++ public abstract void f1908();
++ public abstract void f1909();
++ public abstract void f1910();
++ public abstract void f1911();
++ public abstract void f1912();
++ public abstract void f1913();
++ public abstract void f1914();
++ public abstract void f1915();
++ public abstract void f1916();
++ public abstract void f1917();
++ public abstract void f1918();
++ public abstract void f1919();
++ public abstract void f1920();
++ public abstract void f1921();
++ public abstract void f1922();
++ public abstract void f1923();
++ public abstract void f1924();
++ public abstract void f1925();
++ public abstract void f1926();
++ public abstract void f1927();
++ public abstract void f1928();
++ public abstract void f1929();
++ public abstract void f1930();
++ public abstract void f1931();
++ public abstract void f1932();
++ public abstract void f1933();
++ public abstract void f1934();
++ public abstract void f1935();
++ public abstract void f1936();
++ public abstract void f1937();
++ public abstract void f1938();
++ public abstract void f1939();
++ public abstract void f1940();
++ public abstract void f1941();
++ public abstract void f1942();
++ public abstract void f1943();
++ public abstract void f1944();
++ public abstract void f1945();
++ public abstract void f1946();
++ public abstract void f1947();
++ public abstract void f1948();
++ public abstract void f1949();
++ public abstract void f1950();
++ public abstract void f1951();
++ public abstract void f1952();
++ public abstract void f1953();
++ public abstract void f1954();
++ public abstract void f1955();
++ public abstract void f1956();
++ public abstract void f1957();
++ public abstract void f1958();
++ public abstract void f1959();
++ public abstract void f1960();
++ public abstract void f1961();
++ public abstract void f1962();
++ public abstract void f1963();
++ public abstract void f1964();
++ public abstract void f1965();
++ public abstract void f1966();
++ public abstract void f1967();
++ public abstract void f1968();
++ public abstract void f1969();
++ public abstract void f1970();
++ public abstract void f1971();
++ public abstract void f1972();
++ public abstract void f1973();
++ public abstract void f1974();
++ public abstract void f1975();
++ public abstract void f1976();
++ public abstract void f1977();
++ public abstract void f1978();
++ public abstract void f1979();
++ public abstract void f1980();
++ public abstract void f1981();
++ public abstract void f1982();
++ public abstract void f1983();
++ public abstract void f1984();
++ public abstract void f1985();
++ public abstract void f1986();
++ public abstract void f1987();
++ public abstract void f1988();
++ public abstract void f1989();
++ public abstract void f1990();
++ public abstract void f1991();
++ public abstract void f1992();
++ public abstract void f1993();
++ public abstract void f1994();
++ public abstract void f1995();
++ public abstract void f1996();
++ public abstract void f1997();
++ public abstract void f1998();
++ public abstract void f1999();
++ public abstract void f2000();
++ public abstract void f2001();
++ public abstract void f2002();
++ public abstract void f2003();
++ public abstract void f2004();
++ public abstract void f2005();
++ public abstract void f2006();
++ public abstract void f2007();
++ public abstract void f2008();
++ public abstract void f2009();
++ public abstract void f2010();
++ public abstract void f2011();
++ public abstract void f2012();
++ public abstract void f2013();
++ public abstract void f2014();
++ public abstract void f2015();
++ public abstract void f2016();
++ public abstract void f2017();
++ public abstract void f2018();
++ public abstract void f2019();
++ public abstract void f2020();
++ public abstract void f2021();
++ public abstract void f2022();
++ public abstract void f2023();
++ public abstract void f2024();
++ public abstract void f2025();
++ public abstract void f2026();
++ public abstract void f2027();
++ public abstract void f2028();
++ public abstract void f2029();
++ public abstract void f2030();
++ public abstract void f2031();
++ public abstract void f2032();
++ public abstract void f2033();
++ public abstract void f2034();
++ public abstract void f2035();
++ public abstract void f2036();
++ public abstract void f2037();
++ public abstract void f2038();
++ public abstract void f2039();
++ public abstract void f2040();
++ public abstract void f2041();
++ public abstract void f2042();
++ public abstract void f2043();
++ public abstract void f2044();
++ public abstract void f2045();
++ public abstract void f2046();
++ public abstract void f2047();
++ public abstract void f2048();
++ public abstract void f2049();
++ public abstract void f2050();
++ public abstract void f2051();
++ public abstract void f2052();
++ public abstract void f2053();
++ public abstract void f2054();
++ public abstract void f2055();
++ public abstract void f2056();
++ public abstract void f2057();
++ public abstract void f2058();
++ public abstract void f2059();
++ public abstract void f2060();
++ public abstract void f2061();
++ public abstract void f2062();
++ public abstract void f2063();
++ public abstract void f2064();
++ public abstract void f2065();
++ public abstract void f2066();
++ public abstract void f2067();
++ public abstract void f2068();
++ public abstract void f2069();
++ public abstract void f2070();
++ public abstract void f2071();
++ public abstract void f2072();
++ public abstract void f2073();
++ public abstract void f2074();
++ public abstract void f2075();
++ public abstract void f2076();
++ public abstract void f2077();
++ public abstract void f2078();
++ public abstract void f2079();
++ public abstract void f2080();
++ public abstract void f2081();
++ public abstract void f2082();
++ public abstract void f2083();
++ public abstract void f2084();
++ public abstract void f2085();
++ public abstract void f2086();
++ public abstract void f2087();
++ public abstract void f2088();
++ public abstract void f2089();
++ public abstract void f2090();
++ public abstract void f2091();
++ public abstract void f2092();
++ public abstract void f2093();
++ public abstract void f2094();
++ public abstract void f2095();
++ public abstract void f2096();
++ public abstract void f2097();
++ public abstract void f2098();
++ public abstract void f2099();
++ public abstract void f2100();
++ public abstract void f2101();
++ public abstract void f2102();
++ public abstract void f2103();
++ public abstract void f2104();
++ public abstract void f2105();
++ public abstract void f2106();
++ public abstract void f2107();
++ public abstract void f2108();
++ public abstract void f2109();
++ public abstract void f2110();
++ public abstract void f2111();
++ public abstract void f2112();
++ public abstract void f2113();
++ public abstract void f2114();
++ public abstract void f2115();
++ public abstract void f2116();
++ public abstract void f2117();
++ public abstract void f2118();
++ public abstract void f2119();
++ public abstract void f2120();
++ public abstract void f2121();
++ public abstract void f2122();
++ public abstract void f2123();
++ public abstract void f2124();
++ public abstract void f2125();
++ public abstract void f2126();
++ public abstract void f2127();
++ public abstract void f2128();
++ public abstract void f2129();
++ public abstract void f2130();
++ public abstract void f2131();
++ public abstract void f2132();
++ public abstract void f2133();
++ public abstract void f2134();
++ public abstract void f2135();
++ public abstract void f2136();
++ public abstract void f2137();
++ public abstract void f2138();
++ public abstract void f2139();
++ public abstract void f2140();
++ public abstract void f2141();
++ public abstract void f2142();
++ public abstract void f2143();
++ public abstract void f2144();
++ public abstract void f2145();
++ public abstract void f2146();
++ public abstract void f2147();
++ public abstract void f2148();
++ public abstract void f2149();
++ public abstract void f2150();
++ public abstract void f2151();
++ public abstract void f2152();
++ public abstract void f2153();
++ public abstract void f2154();
++ public abstract void f2155();
++ public abstract void f2156();
++ public abstract void f2157();
++ public abstract void f2158();
++ public abstract void f2159();
++ public abstract void f2160();
++ public abstract void f2161();
++ public abstract void f2162();
++ public abstract void f2163();
++ public abstract void f2164();
++ public abstract void f2165();
++ public abstract void f2166();
++ public abstract void f2167();
++ public abstract void f2168();
++ public abstract void f2169();
++ public abstract void f2170();
++ public abstract void f2171();
++ public abstract void f2172();
++ public abstract void f2173();
++ public abstract void f2174();
++ public abstract void f2175();
++ public abstract void f2176();
++ public abstract void f2177();
++ public abstract void f2178();
++ public abstract void f2179();
++ public abstract void f2180();
++ public abstract void f2181();
++ public abstract void f2182();
++ public abstract void f2183();
++ public abstract void f2184();
++ public abstract void f2185();
++ public abstract void f2186();
++ public abstract void f2187();
++ public abstract void f2188();
++ public abstract void f2189();
++ public abstract void f2190();
++ public abstract void f2191();
++ public abstract void f2192();
++ public abstract void f2193();
++ public abstract void f2194();
++ public abstract void f2195();
++ public abstract void f2196();
++ public abstract void f2197();
++ public abstract void f2198();
++ public abstract void f2199();
++ public abstract void f2200();
++ public abstract void f2201();
++ public abstract void f2202();
++ public abstract void f2203();
++ public abstract void f2204();
++ public abstract void f2205();
++ public abstract void f2206();
++ public abstract void f2207();
++ public abstract void f2208();
++ public abstract void f2209();
++ public abstract void f2210();
++ public abstract void f2211();
++ public abstract void f2212();
++ public abstract void f2213();
++ public abstract void f2214();
++ public abstract void f2215();
++ public abstract void f2216();
++ public abstract void f2217();
++ public abstract void f2218();
++ public abstract void f2219();
++ public abstract void f2220();
++ public abstract void f2221();
++ public abstract void f2222();
++ public abstract void f2223();
++ public abstract void f2224();
++ public abstract void f2225();
++ public abstract void f2226();
++ public abstract void f2227();
++ public abstract void f2228();
++ public abstract void f2229();
++ public abstract void f2230();
++ public abstract void f2231();
++ public abstract void f2232();
++ public abstract void f2233();
++ public abstract void f2234();
++ public abstract void f2235();
++ public abstract void f2236();
++ public abstract void f2237();
++ public abstract void f2238();
++ public abstract void f2239();
++ public abstract void f2240();
++ public abstract void f2241();
++ public abstract void f2242();
++ public abstract void f2243();
++ public abstract void f2244();
++ public abstract void f2245();
++ public abstract void f2246();
++ public abstract void f2247();
++ public abstract void f2248();
++ public abstract void f2249();
++ public abstract void f2250();
++ public abstract void f2251();
++ public abstract void f2252();
++ public abstract void f2253();
++ public abstract void f2254();
++ public abstract void f2255();
++ public abstract void f2256();
++ public abstract void f2257();
++ public abstract void f2258();
++ public abstract void f2259();
++ public abstract void f2260();
++ public abstract void f2261();
++ public abstract void f2262();
++ public abstract void f2263();
++ public abstract void f2264();
++ public abstract void f2265();
++ public abstract void f2266();
++ public abstract void f2267();
++ public abstract void f2268();
++ public abstract void f2269();
++ public abstract void f2270();
++ public abstract void f2271();
++ public abstract void f2272();
++ public abstract void f2273();
++ public abstract void f2274();
++ public abstract void f2275();
++ public abstract void f2276();
++ public abstract void f2277();
++ public abstract void f2278();
++ public abstract void f2279();
++ public abstract void f2280();
++ public abstract void f2281();
++ public abstract void f2282();
++ public abstract void f2283();
++ public abstract void f2284();
++ public abstract void f2285();
++ public abstract void f2286();
++ public abstract void f2287();
++ public abstract void f2288();
++ public abstract void f2289();
++ public abstract void f2290();
++ public abstract void f2291();
++ public abstract void f2292();
++ public abstract void f2293();
++ public abstract void f2294();
++ public abstract void f2295();
++ public abstract void f2296();
++ public abstract void f2297();
++ public abstract void f2298();
++ public abstract void f2299();
++ public abstract void f2300();
++ public abstract void f2301();
++ public abstract void f2302();
++ public abstract void f2303();
++ public abstract void f2304();
++ public abstract void f2305();
++ public abstract void f2306();
++ public abstract void f2307();
++ public abstract void f2308();
++ public abstract void f2309();
++ public abstract void f2310();
++ public abstract void f2311();
++ public abstract void f2312();
++ public abstract void f2313();
++ public abstract void f2314();
++ public abstract void f2315();
++ public abstract void f2316();
++ public abstract void f2317();
++ public abstract void f2318();
++ public abstract void f2319();
++ public abstract void f2320();
++ public abstract void f2321();
++ public abstract void f2322();
++ public abstract void f2323();
++ public abstract void f2324();
++ public abstract void f2325();
++ public abstract void f2326();
++ public abstract void f2327();
++ public abstract void f2328();
++ public abstract void f2329();
++ public abstract void f2330();
++ public abstract void f2331();
++ public abstract void f2332();
++ public abstract void f2333();
++ public abstract void f2334();
++ public abstract void f2335();
++ public abstract void f2336();
++ public abstract void f2337();
++ public abstract void f2338();
++ public abstract void f2339();
++ public abstract void f2340();
++ public abstract void f2341();
++ public abstract void f2342();
++ public abstract void f2343();
++ public abstract void f2344();
++ public abstract void f2345();
++ public abstract void f2346();
++ public abstract void f2347();
++ public abstract void f2348();
++ public abstract void f2349();
++ public abstract void f2350();
++ public abstract void f2351();
++ public abstract void f2352();
++ public abstract void f2353();
++ public abstract void f2354();
++ public abstract void f2355();
++ public abstract void f2356();
++ public abstract void f2357();
++ public abstract void f2358();
++ public abstract void f2359();
++ public abstract void f2360();
++ public abstract void f2361();
++ public abstract void f2362();
++ public abstract void f2363();
++ public abstract void f2364();
++ public abstract void f2365();
++ public abstract void f2366();
++ public abstract void f2367();
++ public abstract void f2368();
++ public abstract void f2369();
++ public abstract void f2370();
++ public abstract void f2371();
++ public abstract void f2372();
++ public abstract void f2373();
++ public abstract void f2374();
++ public abstract void f2375();
++ public abstract void f2376();
++ public abstract void f2377();
++ public abstract void f2378();
++ public abstract void f2379();
++ public abstract void f2380();
++ public abstract void f2381();
++ public abstract void f2382();
++ public abstract void f2383();
++ public abstract void f2384();
++ public abstract void f2385();
++ public abstract void f2386();
++ public abstract void f2387();
++ public abstract void f2388();
++ public abstract void f2389();
++ public abstract void f2390();
++ public abstract void f2391();
++ public abstract void f2392();
++ public abstract void f2393();
++ public abstract void f2394();
++ public abstract void f2395();
++ public abstract void f2396();
++ public abstract void f2397();
++ public abstract void f2398();
++ public abstract void f2399();
++ public abstract void f2400();
++ public abstract void f2401();
++ public abstract void f2402();
++ public abstract void f2403();
++ public abstract void f2404();
++ public abstract void f2405();
++ public abstract void f2406();
++ public abstract void f2407();
++ public abstract void f2408();
++ public abstract void f2409();
++ public abstract void f2410();
++ public abstract void f2411();
++ public abstract void f2412();
++ public abstract void f2413();
++ public abstract void f2414();
++ public abstract void f2415();
++ public abstract void f2416();
++ public abstract void f2417();
++ public abstract void f2418();
++ public abstract void f2419();
++ public abstract void f2420();
++ public abstract void f2421();
++ public abstract void f2422();
++ public abstract void f2423();
++ public abstract void f2424();
++ public abstract void f2425();
++ public abstract void f2426();
++ public abstract void f2427();
++ public abstract void f2428();
++ public abstract void f2429();
++ public abstract void f2430();
++ public abstract void f2431();
++ public abstract void f2432();
++ public abstract void f2433();
++ public abstract void f2434();
++ public abstract void f2435();
++ public abstract void f2436();
++ public abstract void f2437();
++ public abstract void f2438();
++ public abstract void f2439();
++ public abstract void f2440();
++ public abstract void f2441();
++ public abstract void f2442();
++ public abstract void f2443();
++ public abstract void f2444();
++ public abstract void f2445();
++ public abstract void f2446();
++ public abstract void f2447();
++ public abstract void f2448();
++ public abstract void f2449();
++ public abstract void f2450();
++ public abstract void f2451();
++ public abstract void f2452();
++ public abstract void f2453();
++ public abstract void f2454();
++ public abstract void f2455();
++ public abstract void f2456();
++ public abstract void f2457();
++ public abstract void f2458();
++ public abstract void f2459();
++ public abstract void f2460();
++ public abstract void f2461();
++ public abstract void f2462();
++ public abstract void f2463();
++ public abstract void f2464();
++ public abstract void f2465();
++ public abstract void f2466();
++ public abstract void f2467();
++ public abstract void f2468();
++ public abstract void f2469();
++ public abstract void f2470();
++ public abstract void f2471();
++ public abstract void f2472();
++ public abstract void f2473();
++ public abstract void f2474();
++ public abstract void f2475();
++ public abstract void f2476();
++ public abstract void f2477();
++ public abstract void f2478();
++ public abstract void f2479();
++ public abstract void f2480();
++ public abstract void f2481();
++ public abstract void f2482();
++ public abstract void f2483();
++ public abstract void f2484();
++ public abstract void f2485();
++ public abstract void f2486();
++ public abstract void f2487();
++ public abstract void f2488();
++ public abstract void f2489();
++ public abstract void f2490();
++ public abstract void f2491();
++ public abstract void f2492();
++ public abstract void f2493();
++ public abstract void f2494();
++ public abstract void f2495();
++ public abstract void f2496();
++ public abstract void f2497();
++ public abstract void f2498();
++ public abstract void f2499();
++ public abstract void f2500();
++ public abstract void f2501();
++ public abstract void f2502();
++ public abstract void f2503();
++ public abstract void f2504();
++ public abstract void f2505();
++ public abstract void f2506();
++ public abstract void f2507();
++ public abstract void f2508();
++ public abstract void f2509();
++ public abstract void f2510();
++ public abstract void f2511();
++ public abstract void f2512();
++ public abstract void f2513();
++ public abstract void f2514();
++ public abstract void f2515();
++ public abstract void f2516();
++ public abstract void f2517();
++ public abstract void f2518();
++ public abstract void f2519();
++ public abstract void f2520();
++ public abstract void f2521();
++ public abstract void f2522();
++ public abstract void f2523();
++ public abstract void f2524();
++ public abstract void f2525();
++ public abstract void f2526();
++ public abstract void f2527();
++ public abstract void f2528();
++ public abstract void f2529();
++ public abstract void f2530();
++ public abstract void f2531();
++ public abstract void f2532();
++ public abstract void f2533();
++ public abstract void f2534();
++ public abstract void f2535();
++ public abstract void f2536();
++ public abstract void f2537();
++ public abstract void f2538();
++ public abstract void f2539();
++ public abstract void f2540();
++ public abstract void f2541();
++ public abstract void f2542();
++ public abstract void f2543();
++ public abstract void f2544();
++ public abstract void f2545();
++ public abstract void f2546();
++ public abstract void f2547();
++ public abstract void f2548();
++ public abstract void f2549();
++ public abstract void f2550();
++ public abstract void f2551();
++ public abstract void f2552();
++ public abstract void f2553();
++ public abstract void f2554();
++ public abstract void f2555();
++ public abstract void f2556();
++ public abstract void f2557();
++ public abstract void f2558();
++ public abstract void f2559();
++ public abstract void f2560();
++ public abstract void f2561();
++ public abstract void f2562();
++ public abstract void f2563();
++ public abstract void f2564();
++ public abstract void f2565();
++ public abstract void f2566();
++ public abstract void f2567();
++ public abstract void f2568();
++ public abstract void f2569();
++ public abstract void f2570();
++ public abstract void f2571();
++ public abstract void f2572();
++ public abstract void f2573();
++ public abstract void f2574();
++ public abstract void f2575();
++ public abstract void f2576();
++ public abstract void f2577();
++ public abstract void f2578();
++ public abstract void f2579();
++ public abstract void f2580();
++ public abstract void f2581();
++ public abstract void f2582();
++ public abstract void f2583();
++ public abstract void f2584();
++ public abstract void f2585();
++ public abstract void f2586();
++ public abstract void f2587();
++ public abstract void f2588();
++ public abstract void f2589();
++ public abstract void f2590();
++ public abstract void f2591();
++ public abstract void f2592();
++ public abstract void f2593();
++ public abstract void f2594();
++ public abstract void f2595();
++ public abstract void f2596();
++ public abstract void f2597();
++ public abstract void f2598();
++ public abstract void f2599();
++ public abstract void f2600();
++ public abstract void f2601();
++ public abstract void f2602();
++ public abstract void f2603();
++ public abstract void f2604();
++ public abstract void f2605();
++ public abstract void f2606();
++ public abstract void f2607();
++ public abstract void f2608();
++ public abstract void f2609();
++ public abstract void f2610();
++ public abstract void f2611();
++ public abstract void f2612();
++ public abstract void f2613();
++ public abstract void f2614();
++ public abstract void f2615();
++ public abstract void f2616();
++ public abstract void f2617();
++ public abstract void f2618();
++ public abstract void f2619();
++ public abstract void f2620();
++ public abstract void f2621();
++ public abstract void f2622();
++ public abstract void f2623();
++ public abstract void f2624();
++ public abstract void f2625();
++ public abstract void f2626();
++ public abstract void f2627();
++ public abstract void f2628();
++ public abstract void f2629();
++ public abstract void f2630();
++ public abstract void f2631();
++ public abstract void f2632();
++ public abstract void f2633();
++ public abstract void f2634();
++ public abstract void f2635();
++ public abstract void f2636();
++ public abstract void f2637();
++ public abstract void f2638();
++ public abstract void f2639();
++ public abstract void f2640();
++ public abstract void f2641();
++ public abstract void f2642();
++ public abstract void f2643();
++ public abstract void f2644();
++ public abstract void f2645();
++ public abstract void f2646();
++ public abstract void f2647();
++ public abstract void f2648();
++ public abstract void f2649();
++ public abstract void f2650();
++ public abstract void f2651();
++ public abstract void f2652();
++ public abstract void f2653();
++ public abstract void f2654();
++ public abstract void f2655();
++ public abstract void f2656();
++ public abstract void f2657();
++ public abstract void f2658();
++ public abstract void f2659();
++ public abstract void f2660();
++ public abstract void f2661();
++ public abstract void f2662();
++ public abstract void f2663();
++ public abstract void f2664();
++ public abstract void f2665();
++ public abstract void f2666();
++ public abstract void f2667();
++ public abstract void f2668();
++ public abstract void f2669();
++ public abstract void f2670();
++ public abstract void f2671();
++ public abstract void f2672();
++ public abstract void f2673();
++ public abstract void f2674();
++ public abstract void f2675();
++ public abstract void f2676();
++ public abstract void f2677();
++ public abstract void f2678();
++ public abstract void f2679();
++ public abstract void f2680();
++ public abstract void f2681();
++ public abstract void f2682();
++ public abstract void f2683();
++ public abstract void f2684();
++ public abstract void f2685();
++ public abstract void f2686();
++ public abstract void f2687();
++ public abstract void f2688();
++ public abstract void f2689();
++ public abstract void f2690();
++ public abstract void f2691();
++ public abstract void f2692();
++ public abstract void f2693();
++ public abstract void f2694();
++ public abstract void f2695();
++ public abstract void f2696();
++ public abstract void f2697();
++ public abstract void f2698();
++ public abstract void f2699();
++ public abstract void f2700();
++ public abstract void f2701();
++ public abstract void f2702();
++ public abstract void f2703();
++ public abstract void f2704();
++ public abstract void f2705();
++ public abstract void f2706();
++ public abstract void f2707();
++ public abstract void f2708();
++ public abstract void f2709();
++ public abstract void f2710();
++ public abstract void f2711();
++ public abstract void f2712();
++ public abstract void f2713();
++ public abstract void f2714();
++ public abstract void f2715();
++ public abstract void f2716();
++ public abstract void f2717();
++ public abstract void f2718();
++ public abstract void f2719();
++ public abstract void f2720();
++ public abstract void f2721();
++ public abstract void f2722();
++ public abstract void f2723();
++ public abstract void f2724();
++ public abstract void f2725();
++ public abstract void f2726();
++ public abstract void f2727();
++ public abstract void f2728();
++ public abstract void f2729();
++ public abstract void f2730();
++ public abstract void f2731();
++ public abstract void f2732();
++ public abstract void f2733();
++ public abstract void f2734();
++ public abstract void f2735();
++ public abstract void f2736();
++ public abstract void f2737();
++ public abstract void f2738();
++ public abstract void f2739();
++ public abstract void f2740();
++ public abstract void f2741();
++ public abstract void f2742();
++ public abstract void f2743();
++ public abstract void f2744();
++ public abstract void f2745();
++ public abstract void f2746();
++ public abstract void f2747();
++ public abstract void f2748();
++ public abstract void f2749();
++ public abstract void f2750();
++ public abstract void f2751();
++ public abstract void f2752();
++ public abstract void f2753();
++ public abstract void f2754();
++ public abstract void f2755();
++ public abstract void f2756();
++ public abstract void f2757();
++ public abstract void f2758();
++ public abstract void f2759();
++ public abstract void f2760();
++ public abstract void f2761();
++ public abstract void f2762();
++ public abstract void f2763();
++ public abstract void f2764();
++ public abstract void f2765();
++ public abstract void f2766();
++ public abstract void f2767();
++ public abstract void f2768();
++ public abstract void f2769();
++ public abstract void f2770();
++ public abstract void f2771();
++ public abstract void f2772();
++ public abstract void f2773();
++ public abstract void f2774();
++ public abstract void f2775();
++ public abstract void f2776();
++ public abstract void f2777();
++ public abstract void f2778();
++ public abstract void f2779();
++ public abstract void f2780();
++ public abstract void f2781();
++ public abstract void f2782();
++ public abstract void f2783();
++ public abstract void f2784();
++ public abstract void f2785();
++ public abstract void f2786();
++ public abstract void f2787();
++ public abstract void f2788();
++ public abstract void f2789();
++ public abstract void f2790();
++ public abstract void f2791();
++ public abstract void f2792();
++ public abstract void f2793();
++ public abstract void f2794();
++ public abstract void f2795();
++ public abstract void f2796();
++ public abstract void f2797();
++ public abstract void f2798();
++ public abstract void f2799();
++ public abstract void f2800();
++ public abstract void f2801();
++ public abstract void f2802();
++ public abstract void f2803();
++ public abstract void f2804();
++ public abstract void f2805();
++ public abstract void f2806();
++ public abstract void f2807();
++ public abstract void f2808();
++ public abstract void f2809();
++ public abstract void f2810();
++ public abstract void f2811();
++ public abstract void f2812();
++ public abstract void f2813();
++ public abstract void f2814();
++ public abstract void f2815();
++ public abstract void f2816();
++ public abstract void f2817();
++ public abstract void f2818();
++ public abstract void f2819();
++ public abstract void f2820();
++ public abstract void f2821();
++ public abstract void f2822();
++ public abstract void f2823();
++ public abstract void f2824();
++ public abstract void f2825();
++ public abstract void f2826();
++ public abstract void f2827();
++ public abstract void f2828();
++ public abstract void f2829();
++ public abstract void f2830();
++ public abstract void f2831();
++ public abstract void f2832();
++ public abstract void f2833();
++ public abstract void f2834();
++ public abstract void f2835();
++ public abstract void f2836();
++ public abstract void f2837();
++ public abstract void f2838();
++ public abstract void f2839();
++ public abstract void f2840();
++ public abstract void f2841();
++ public abstract void f2842();
++ public abstract void f2843();
++ public abstract void f2844();
++ public abstract void f2845();
++ public abstract void f2846();
++ public abstract void f2847();
++ public abstract void f2848();
++ public abstract void f2849();
++ public abstract void f2850();
++ public abstract void f2851();
++ public abstract void f2852();
++ public abstract void f2853();
++ public abstract void f2854();
++ public abstract void f2855();
++ public abstract void f2856();
++ public abstract void f2857();
++ public abstract void f2858();
++ public abstract void f2859();
++ public abstract void f2860();
++ public abstract void f2861();
++ public abstract void f2862();
++ public abstract void f2863();
++ public abstract void f2864();
++ public abstract void f2865();
++ public abstract void f2866();
++ public abstract void f2867();
++ public abstract void f2868();
++ public abstract void f2869();
++ public abstract void f2870();
++ public abstract void f2871();
++ public abstract void f2872();
++ public abstract void f2873();
++ public abstract void f2874();
++ public abstract void f2875();
++ public abstract void f2876();
++ public abstract void f2877();
++ public abstract void f2878();
++ public abstract void f2879();
++ public abstract void f2880();
++ public abstract void f2881();
++ public abstract void f2882();
++ public abstract void f2883();
++ public abstract void f2884();
++ public abstract void f2885();
++ public abstract void f2886();
++ public abstract void f2887();
++ public abstract void f2888();
++ public abstract void f2889();
++ public abstract void f2890();
++ public abstract void f2891();
++ public abstract void f2892();
++ public abstract void f2893();
++ public abstract void f2894();
++ public abstract void f2895();
++ public abstract void f2896();
++ public abstract void f2897();
++ public abstract void f2898();
++ public abstract void f2899();
++ public abstract void f2900();
++ public abstract void f2901();
++ public abstract void f2902();
++ public abstract void f2903();
++ public abstract void f2904();
++ public abstract void f2905();
++ public abstract void f2906();
++ public abstract void f2907();
++ public abstract void f2908();
++ public abstract void f2909();
++ public abstract void f2910();
++ public abstract void f2911();
++ public abstract void f2912();
++ public abstract void f2913();
++ public abstract void f2914();
++ public abstract void f2915();
++ public abstract void f2916();
++ public abstract void f2917();
++ public abstract void f2918();
++ public abstract void f2919();
++ public abstract void f2920();
++ public abstract void f2921();
++ public abstract void f2922();
++ public abstract void f2923();
++ public abstract void f2924();
++ public abstract void f2925();
++ public abstract void f2926();
++ public abstract void f2927();
++ public abstract void f2928();
++ public abstract void f2929();
++ public abstract void f2930();
++ public abstract void f2931();
++ public abstract void f2932();
++ public abstract void f2933();
++ public abstract void f2934();
++ public abstract void f2935();
++ public abstract void f2936();
++ public abstract void f2937();
++ public abstract void f2938();
++ public abstract void f2939();
++ public abstract void f2940();
++ public abstract void f2941();
++ public abstract void f2942();
++ public abstract void f2943();
++ public abstract void f2944();
++ public abstract void f2945();
++ public abstract void f2946();
++ public abstract void f2947();
++ public abstract void f2948();
++ public abstract void f2949();
++ public abstract void f2950();
++ public abstract void f2951();
++ public abstract void f2952();
++ public abstract void f2953();
++ public abstract void f2954();
++ public abstract void f2955();
++ public abstract void f2956();
++ public abstract void f2957();
++ public abstract void f2958();
++ public abstract void f2959();
++ public abstract void f2960();
++ public abstract void f2961();
++ public abstract void f2962();
++ public abstract void f2963();
++ public abstract void f2964();
++ public abstract void f2965();
++ public abstract void f2966();
++ public abstract void f2967();
++ public abstract void f2968();
++ public abstract void f2969();
++ public abstract void f2970();
++ public abstract void f2971();
++ public abstract void f2972();
++ public abstract void f2973();
++ public abstract void f2974();
++ public abstract void f2975();
++ public abstract void f2976();
++ public abstract void f2977();
++ public abstract void f2978();
++ public abstract void f2979();
++ public abstract void f2980();
++ public abstract void f2981();
++ public abstract void f2982();
++ public abstract void f2983();
++ public abstract void f2984();
++ public abstract void f2985();
++ public abstract void f2986();
++ public abstract void f2987();
++ public abstract void f2988();
++ public abstract void f2989();
++ public abstract void f2990();
++ public abstract void f2991();
++ public abstract void f2992();
++ public abstract void f2993();
++ public abstract void f2994();
++ public abstract void f2995();
++ public abstract void f2996();
++ public abstract void f2997();
++ public abstract void f2998();
++ public abstract void f2999();
++ public abstract void f3000();
++ public abstract void f3001();
++ public abstract void f3002();
++ public abstract void f3003();
++ public abstract void f3004();
++ public abstract void f3005();
++ public abstract void f3006();
++ public abstract void f3007();
++ public abstract void f3008();
++ public abstract void f3009();
++ public abstract void f3010();
++ public abstract void f3011();
++ public abstract void f3012();
++ public abstract void f3013();
++ public abstract void f3014();
++ public abstract void f3015();
++ public abstract void f3016();
++ public abstract void f3017();
++ public abstract void f3018();
++ public abstract void f3019();
++ public abstract void f3020();
++ public abstract void f3021();
++ public abstract void f3022();
++ public abstract void f3023();
++ public abstract void f3024();
++ public abstract void f3025();
++ public abstract void f3026();
++ public abstract void f3027();
++ public abstract void f3028();
++ public abstract void f3029();
++ public abstract void f3030();
++ public abstract void f3031();
++ public abstract void f3032();
++ public abstract void f3033();
++ public abstract void f3034();
++ public abstract void f3035();
++ public abstract void f3036();
++ public abstract void f3037();
++ public abstract void f3038();
++ public abstract void f3039();
++ public abstract void f3040();
++ public abstract void f3041();
++ public abstract void f3042();
++ public abstract void f3043();
++ public abstract void f3044();
++ public abstract void f3045();
++ public abstract void f3046();
++ public abstract void f3047();
++ public abstract void f3048();
++ public abstract void f3049();
++ public abstract void f3050();
++ public abstract void f3051();
++ public abstract void f3052();
++ public abstract void f3053();
++ public abstract void f3054();
++ public abstract void f3055();
++ public abstract void f3056();
++ public abstract void f3057();
++ public abstract void f3058();
++ public abstract void f3059();
++ public abstract void f3060();
++ public abstract void f3061();
++ public abstract void f3062();
++ public abstract void f3063();
++ public abstract void f3064();
++ public abstract void f3065();
++ public abstract void f3066();
++ public abstract void f3067();
++ public abstract void f3068();
++ public abstract void f3069();
++ public abstract void f3070();
++ public abstract void f3071();
++ public abstract void f3072();
++ public abstract void f3073();
++ public abstract void f3074();
++ public abstract void f3075();
++ public abstract void f3076();
++ public abstract void f3077();
++ public abstract void f3078();
++ public abstract void f3079();
++ public abstract void f3080();
++ public abstract void f3081();
++ public abstract void f3082();
++ public abstract void f3083();
++ public abstract void f3084();
++ public abstract void f3085();
++ public abstract void f3086();
++ public abstract void f3087();
++ public abstract void f3088();
++ public abstract void f3089();
++ public abstract void f3090();
++ public abstract void f3091();
++ public abstract void f3092();
++ public abstract void f3093();
++ public abstract void f3094();
++ public abstract void f3095();
++ public abstract void f3096();
++ public abstract void f3097();
++ public abstract void f3098();
++ public abstract void f3099();
++ public abstract void f3100();
++ public abstract void f3101();
++ public abstract void f3102();
++ public abstract void f3103();
++ public abstract void f3104();
++ public abstract void f3105();
++ public abstract void f3106();
++ public abstract void f3107();
++ public abstract void f3108();
++ public abstract void f3109();
++ public abstract void f3110();
++ public abstract void f3111();
++ public abstract void f3112();
++ public abstract void f3113();
++ public abstract void f3114();
++ public abstract void f3115();
++ public abstract void f3116();
++ public abstract void f3117();
++ public abstract void f3118();
++ public abstract void f3119();
++ public abstract void f3120();
++ public abstract void f3121();
++ public abstract void f3122();
++ public abstract void f3123();
++ public abstract void f3124();
++ public abstract void f3125();
++ public abstract void f3126();
++ public abstract void f3127();
++ public abstract void f3128();
++ public abstract void f3129();
++ public abstract void f3130();
++ public abstract void f3131();
++ public abstract void f3132();
++ public abstract void f3133();
++ public abstract void f3134();
++ public abstract void f3135();
++ public abstract void f3136();
++ public abstract void f3137();
++ public abstract void f3138();
++ public abstract void f3139();
++ public abstract void f3140();
++ public abstract void f3141();
++ public abstract void f3142();
++ public abstract void f3143();
++ public abstract void f3144();
++ public abstract void f3145();
++ public abstract void f3146();
++ public abstract void f3147();
++ public abstract void f3148();
++ public abstract void f3149();
++ public abstract void f3150();
++ public abstract void f3151();
++ public abstract void f3152();
++ public abstract void f3153();
++ public abstract void f3154();
++ public abstract void f3155();
++ public abstract void f3156();
++ public abstract void f3157();
++ public abstract void f3158();
++ public abstract void f3159();
++ public abstract void f3160();
++ public abstract void f3161();
++ public abstract void f3162();
++ public abstract void f3163();
++ public abstract void f3164();
++ public abstract void f3165();
++ public abstract void f3166();
++ public abstract void f3167();
++ public abstract void f3168();
++ public abstract void f3169();
++ public abstract void f3170();
++ public abstract void f3171();
++ public abstract void f3172();
++ public abstract void f3173();
++ public abstract void f3174();
++ public abstract void f3175();
++ public abstract void f3176();
++ public abstract void f3177();
++ public abstract void f3178();
++ public abstract void f3179();
++ public abstract void f3180();
++ public abstract void f3181();
++ public abstract void f3182();
++ public abstract void f3183();
++ public abstract void f3184();
++ public abstract void f3185();
++ public abstract void f3186();
++ public abstract void f3187();
++ public abstract void f3188();
++ public abstract void f3189();
++ public abstract void f3190();
++ public abstract void f3191();
++ public abstract void f3192();
++ public abstract void f3193();
++ public abstract void f3194();
++ public abstract void f3195();
++ public abstract void f3196();
++ public abstract void f3197();
++ public abstract void f3198();
++ public abstract void f3199();
++ public abstract void f3200();
++ public abstract void f3201();
++ public abstract void f3202();
++ public abstract void f3203();
++ public abstract void f3204();
++ public abstract void f3205();
++ public abstract void f3206();
++ public abstract void f3207();
++ public abstract void f3208();
++ public abstract void f3209();
++ public abstract void f3210();
++ public abstract void f3211();
++ public abstract void f3212();
++ public abstract void f3213();
++ public abstract void f3214();
++ public abstract void f3215();
++ public abstract void f3216();
++ public abstract void f3217();
++ public abstract void f3218();
++ public abstract void f3219();
++ public abstract void f3220();
++ public abstract void f3221();
++ public abstract void f3222();
++ public abstract void f3223();
++ public abstract void f3224();
++ public abstract void f3225();
++ public abstract void f3226();
++ public abstract void f3227();
++ public abstract void f3228();
++ public abstract void f3229();
++ public abstract void f3230();
++ public abstract void f3231();
++ public abstract void f3232();
++ public abstract void f3233();
++ public abstract void f3234();
++ public abstract void f3235();
++ public abstract void f3236();
++ public abstract void f3237();
++ public abstract void f3238();
++ public abstract void f3239();
++ public abstract void f3240();
++ public abstract void f3241();
++ public abstract void f3242();
++ public abstract void f3243();
++ public abstract void f3244();
++ public abstract void f3245();
++ public abstract void f3246();
++ public abstract void f3247();
++ public abstract void f3248();
++ public abstract void f3249();
++ public abstract void f3250();
++ public abstract void f3251();
++ public abstract void f3252();
++ public abstract void f3253();
++ public abstract void f3254();
++ public abstract void f3255();
++ public abstract void f3256();
++ public abstract void f3257();
++ public abstract void f3258();
++ public abstract void f3259();
++ public abstract void f3260();
++ public abstract void f3261();
++ public abstract void f3262();
++ public abstract void f3263();
++ public abstract void f3264();
++ public abstract void f3265();
++ public abstract void f3266();
++ public abstract void f3267();
++ public abstract void f3268();
++ public abstract void f3269();
++ public abstract void f3270();
++ public abstract void f3271();
++ public abstract void f3272();
++ public abstract void f3273();
++ public abstract void f3274();
++ public abstract void f3275();
++ public abstract void f3276();
++ public abstract void f3277();
++ public abstract void f3278();
++ public abstract void f3279();
++ public abstract void f3280();
++ public abstract void f3281();
++ public abstract void f3282();
++ public abstract void f3283();
++ public abstract void f3284();
++ public abstract void f3285();
++ public abstract void f3286();
++ public abstract void f3287();
++ public abstract void f3288();
++ public abstract void f3289();
++ public abstract void f3290();
++ public abstract void f3291();
++ public abstract void f3292();
++ public abstract void f3293();
++ public abstract void f3294();
++ public abstract void f3295();
++ public abstract void f3296();
++ public abstract void f3297();
++ public abstract void f3298();
++ public abstract void f3299();
++ public abstract void f3300();
++ public abstract void f3301();
++ public abstract void f3302();
++ public abstract void f3303();
++ public abstract void f3304();
++ public abstract void f3305();
++ public abstract void f3306();
++ public abstract void f3307();
++ public abstract void f3308();
++ public abstract void f3309();
++ public abstract void f3310();
++ public abstract void f3311();
++ public abstract void f3312();
++ public abstract void f3313();
++ public abstract void f3314();
++ public abstract void f3315();
++ public abstract void f3316();
++ public abstract void f3317();
++ public abstract void f3318();
++ public abstract void f3319();
++ public abstract void f3320();
++ public abstract void f3321();
++ public abstract void f3322();
++ public abstract void f3323();
++ public abstract void f3324();
++ public abstract void f3325();
++ public abstract void f3326();
++ public abstract void f3327();
++ public abstract void f3328();
++ public abstract void f3329();
++ public abstract void f3330();
++ public abstract void f3331();
++ public abstract void f3332();
++ public abstract void f3333();
++ public abstract void f3334();
++ public abstract void f3335();
++ public abstract void f3336();
++ public abstract void f3337();
++ public abstract void f3338();
++ public abstract void f3339();
++ public abstract void f3340();
++ public abstract void f3341();
++ public abstract void f3342();
++ public abstract void f3343();
++ public abstract void f3344();
++ public abstract void f3345();
++ public abstract void f3346();
++ public abstract void f3347();
++ public abstract void f3348();
++ public abstract void f3349();
++ public abstract void f3350();
++ public abstract void f3351();
++ public abstract void f3352();
++ public abstract void f3353();
++ public abstract void f3354();
++ public abstract void f3355();
++ public abstract void f3356();
++ public abstract void f3357();
++ public abstract void f3358();
++ public abstract void f3359();
++ public abstract void f3360();
++ public abstract void f3361();
++ public abstract void f3362();
++ public abstract void f3363();
++ public abstract void f3364();
++ public abstract void f3365();
++ public abstract void f3366();
++ public abstract void f3367();
++ public abstract void f3368();
++ public abstract void f3369();
++ public abstract void f3370();
++ public abstract void f3371();
++ public abstract void f3372();
++ public abstract void f3373();
++ public abstract void f3374();
++ public abstract void f3375();
++ public abstract void f3376();
++ public abstract void f3377();
++ public abstract void f3378();
++ public abstract void f3379();
++ public abstract void f3380();
++ public abstract void f3381();
++ public abstract void f3382();
++ public abstract void f3383();
++ public abstract void f3384();
++ public abstract void f3385();
++ public abstract void f3386();
++ public abstract void f3387();
++ public abstract void f3388();
++ public abstract void f3389();
++ public abstract void f3390();
++ public abstract void f3391();
++ public abstract void f3392();
++ public abstract void f3393();
++ public abstract void f3394();
++ public abstract void f3395();
++ public abstract void f3396();
++ public abstract void f3397();
++ public abstract void f3398();
++ public abstract void f3399();
++ public abstract void f3400();
++ public abstract void f3401();
++ public abstract void f3402();
++ public abstract void f3403();
++ public abstract void f3404();
++ public abstract void f3405();
++ public abstract void f3406();
++ public abstract void f3407();
++ public abstract void f3408();
++ public abstract void f3409();
++ public abstract void f3410();
++ public abstract void f3411();
++ public abstract void f3412();
++ public abstract void f3413();
++ public abstract void f3414();
++ public abstract void f3415();
++ public abstract void f3416();
++ public abstract void f3417();
++ public abstract void f3418();
++ public abstract void f3419();
++ public abstract void f3420();
++ public abstract void f3421();
++ public abstract void f3422();
++ public abstract void f3423();
++ public abstract void f3424();
++ public abstract void f3425();
++ public abstract void f3426();
++ public abstract void f3427();
++ public abstract void f3428();
++ public abstract void f3429();
++ public abstract void f3430();
++ public abstract void f3431();
++ public abstract void f3432();
++ public abstract void f3433();
++ public abstract void f3434();
++ public abstract void f3435();
++ public abstract void f3436();
++ public abstract void f3437();
++ public abstract void f3438();
++ public abstract void f3439();
++ public abstract void f3440();
++ public abstract void f3441();
++ public abstract void f3442();
++ public abstract void f3443();
++ public abstract void f3444();
++ public abstract void f3445();
++ public abstract void f3446();
++ public abstract void f3447();
++ public abstract void f3448();
++ public abstract void f3449();
++ public abstract void f3450();
++ public abstract void f3451();
++ public abstract void f3452();
++ public abstract void f3453();
++ public abstract void f3454();
++ public abstract void f3455();
++ public abstract void f3456();
++ public abstract void f3457();
++ public abstract void f3458();
++ public abstract void f3459();
++ public abstract void f3460();
++ public abstract void f3461();
++ public abstract void f3462();
++ public abstract void f3463();
++ public abstract void f3464();
++ public abstract void f3465();
++ public abstract void f3466();
++ public abstract void f3467();
++ public abstract void f3468();
++ public abstract void f3469();
++ public abstract void f3470();
++ public abstract void f3471();
++ public abstract void f3472();
++ public abstract void f3473();
++ public abstract void f3474();
++ public abstract void f3475();
++ public abstract void f3476();
++ public abstract void f3477();
++ public abstract void f3478();
++ public abstract void f3479();
++ public abstract void f3480();
++ public abstract void f3481();
++ public abstract void f3482();
++ public abstract void f3483();
++ public abstract void f3484();
++ public abstract void f3485();
++ public abstract void f3486();
++ public abstract void f3487();
++ public abstract void f3488();
++ public abstract void f3489();
++ public abstract void f3490();
++ public abstract void f3491();
++ public abstract void f3492();
++ public abstract void f3493();
++ public abstract void f3494();
++ public abstract void f3495();
++ public abstract void f3496();
++ public abstract void f3497();
++ public abstract void f3498();
++ public abstract void f3499();
++ public abstract void f3500();
++ public abstract void f3501();
++ public abstract void f3502();
++ public abstract void f3503();
++ public abstract void f3504();
++ public abstract void f3505();
++ public abstract void f3506();
++ public abstract void f3507();
++ public abstract void f3508();
++ public abstract void f3509();
++ public abstract void f3510();
++ public abstract void f3511();
++ public abstract void f3512();
++ public abstract void f3513();
++ public abstract void f3514();
++ public abstract void f3515();
++ public abstract void f3516();
++ public abstract void f3517();
++ public abstract void f3518();
++ public abstract void f3519();
++ public abstract void f3520();
++ public abstract void f3521();
++ public abstract void f3522();
++ public abstract void f3523();
++ public abstract void f3524();
++ public abstract void f3525();
++ public abstract void f3526();
++ public abstract void f3527();
++ public abstract void f3528();
++ public abstract void f3529();
++ public abstract void f3530();
++ public abstract void f3531();
++ public abstract void f3532();
++ public abstract void f3533();
++ public abstract void f3534();
++ public abstract void f3535();
++ public abstract void f3536();
++ public abstract void f3537();
++ public abstract void f3538();
++ public abstract void f3539();
++ public abstract void f3540();
++ public abstract void f3541();
++ public abstract void f3542();
++ public abstract void f3543();
++ public abstract void f3544();
++ public abstract void f3545();
++ public abstract void f3546();
++ public abstract void f3547();
++ public abstract void f3548();
++ public abstract void f3549();
++ public abstract void f3550();
++ public abstract void f3551();
++ public abstract void f3552();
++ public abstract void f3553();
++ public abstract void f3554();
++ public abstract void f3555();
++ public abstract void f3556();
++ public abstract void f3557();
++ public abstract void f3558();
++ public abstract void f3559();
++ public abstract void f3560();
++ public abstract void f3561();
++ public abstract void f3562();
++ public abstract void f3563();
++ public abstract void f3564();
++ public abstract void f3565();
++ public abstract void f3566();
++ public abstract void f3567();
++ public abstract void f3568();
++ public abstract void f3569();
++ public abstract void f3570();
++ public abstract void f3571();
++ public abstract void f3572();
++ public abstract void f3573();
++ public abstract void f3574();
++ public abstract void f3575();
++ public abstract void f3576();
++ public abstract void f3577();
++ public abstract void f3578();
++ public abstract void f3579();
++ public abstract void f3580();
++ public abstract void f3581();
++ public abstract void f3582();
++ public abstract void f3583();
++ public abstract void f3584();
++ public abstract void f3585();
++ public abstract void f3586();
++ public abstract void f3587();
++ public abstract void f3588();
++ public abstract void f3589();
++ public abstract void f3590();
++ public abstract void f3591();
++ public abstract void f3592();
++ public abstract void f3593();
++ public abstract void f3594();
++ public abstract void f3595();
++ public abstract void f3596();
++ public abstract void f3597();
++ public abstract void f3598();
++ public abstract void f3599();
++ public abstract void f3600();
++ public abstract void f3601();
++ public abstract void f3602();
++ public abstract void f3603();
++ public abstract void f3604();
++ public abstract void f3605();
++ public abstract void f3606();
++ public abstract void f3607();
++ public abstract void f3608();
++ public abstract void f3609();
++ public abstract void f3610();
++ public abstract void f3611();
++ public abstract void f3612();
++ public abstract void f3613();
++ public abstract void f3614();
++ public abstract void f3615();
++ public abstract void f3616();
++ public abstract void f3617();
++ public abstract void f3618();
++ public abstract void f3619();
++ public abstract void f3620();
++ public abstract void f3621();
++ public abstract void f3622();
++ public abstract void f3623();
++ public abstract void f3624();
++ public abstract void f3625();
++ public abstract void f3626();
++ public abstract void f3627();
++ public abstract void f3628();
++ public abstract void f3629();
++ public abstract void f3630();
++ public abstract void f3631();
++ public abstract void f3632();
++ public abstract void f3633();
++ public abstract void f3634();
++ public abstract void f3635();
++ public abstract void f3636();
++ public abstract void f3637();
++ public abstract void f3638();
++ public abstract void f3639();
++ public abstract void f3640();
++ public abstract void f3641();
++ public abstract void f3642();
++ public abstract void f3643();
++ public abstract void f3644();
++ public abstract void f3645();
++ public abstract void f3646();
++ public abstract void f3647();
++ public abstract void f3648();
++ public abstract void f3649();
++ public abstract void f3650();
++ public abstract void f3651();
++ public abstract void f3652();
++ public abstract void f3653();
++ public abstract void f3654();
++ public abstract void f3655();
++ public abstract void f3656();
++ public abstract void f3657();
++ public abstract void f3658();
++ public abstract void f3659();
++ public abstract void f3660();
++ public abstract void f3661();
++ public abstract void f3662();
++ public abstract void f3663();
++ public abstract void f3664();
++ public abstract void f3665();
++ public abstract void f3666();
++ public abstract void f3667();
++ public abstract void f3668();
++ public abstract void f3669();
++ public abstract void f3670();
++ public abstract void f3671();
++ public abstract void f3672();
++ public abstract void f3673();
++ public abstract void f3674();
++ public abstract void f3675();
++ public abstract void f3676();
++ public abstract void f3677();
++ public abstract void f3678();
++ public abstract void f3679();
++ public abstract void f3680();
++ public abstract void f3681();
++ public abstract void f3682();
++ public abstract void f3683();
++ public abstract void f3684();
++ public abstract void f3685();
++ public abstract void f3686();
++ public abstract void f3687();
++ public abstract void f3688();
++ public abstract void f3689();
++ public abstract void f3690();
++ public abstract void f3691();
++ public abstract void f3692();
++ public abstract void f3693();
++ public abstract void f3694();
++ public abstract void f3695();
++ public abstract void f3696();
++ public abstract void f3697();
++ public abstract void f3698();
++ public abstract void f3699();
++ public abstract void f3700();
++ public abstract void f3701();
++ public abstract void f3702();
++ public abstract void f3703();
++ public abstract void f3704();
++ public abstract void f3705();
++ public abstract void f3706();
++ public abstract void f3707();
++ public abstract void f3708();
++ public abstract void f3709();
++ public abstract void f3710();
++ public abstract void f3711();
++ public abstract void f3712();
++ public abstract void f3713();
++ public abstract void f3714();
++ public abstract void f3715();
++ public abstract void f3716();
++ public abstract void f3717();
++ public abstract void f3718();
++ public abstract void f3719();
++ public abstract void f3720();
++ public abstract void f3721();
++ public abstract void f3722();
++ public abstract void f3723();
++ public abstract void f3724();
++ public abstract void f3725();
++ public abstract void f3726();
++ public abstract void f3727();
++ public abstract void f3728();
++ public abstract void f3729();
++ public abstract void f3730();
++ public abstract void f3731();
++ public abstract void f3732();
++ public abstract void f3733();
++ public abstract void f3734();
++ public abstract void f3735();
++ public abstract void f3736();
++ public abstract void f3737();
++ public abstract void f3738();
++ public abstract void f3739();
++ public abstract void f3740();
++ public abstract void f3741();
++ public abstract void f3742();
++ public abstract void f3743();
++ public abstract void f3744();
++ public abstract void f3745();
++ public abstract void f3746();
++ public abstract void f3747();
++ public abstract void f3748();
++ public abstract void f3749();
++ public abstract void f3750();
++ public abstract void f3751();
++ public abstract void f3752();
++ public abstract void f3753();
++ public abstract void f3754();
++ public abstract void f3755();
++ public abstract void f3756();
++ public abstract void f3757();
++ public abstract void f3758();
++ public abstract void f3759();
++ public abstract void f3760();
++ public abstract void f3761();
++ public abstract void f3762();
++ public abstract void f3763();
++ public abstract void f3764();
++ public abstract void f3765();
++ public abstract void f3766();
++ public abstract void f3767();
++ public abstract void f3768();
++ public abstract void f3769();
++ public abstract void f3770();
++ public abstract void f3771();
++ public abstract void f3772();
++ public abstract void f3773();
++ public abstract void f3774();
++ public abstract void f3775();
++ public abstract void f3776();
++ public abstract void f3777();
++ public abstract void f3778();
++ public abstract void f3779();
++ public abstract void f3780();
++ public abstract void f3781();
++ public abstract void f3782();
++ public abstract void f3783();
++ public abstract void f3784();
++ public abstract void f3785();
++ public abstract void f3786();
++ public abstract void f3787();
++ public abstract void f3788();
++ public abstract void f3789();
++ public abstract void f3790();
++ public abstract void f3791();
++ public abstract void f3792();
++ public abstract void f3793();
++ public abstract void f3794();
++ public abstract void f3795();
++ public abstract void f3796();
++ public abstract void f3797();
++ public abstract void f3798();
++ public abstract void f3799();
++ public abstract void f3800();
++ public abstract void f3801();
++ public abstract void f3802();
++ public abstract void f3803();
++ public abstract void f3804();
++ public abstract void f3805();
++ public abstract void f3806();
++ public abstract void f3807();
++ public abstract void f3808();
++ public abstract void f3809();
++ public abstract void f3810();
++ public abstract void f3811();
++ public abstract void f3812();
++ public abstract void f3813();
++ public abstract void f3814();
++ public abstract void f3815();
++ public abstract void f3816();
++ public abstract void f3817();
++ public abstract void f3818();
++ public abstract void f3819();
++ public abstract void f3820();
++ public abstract void f3821();
++ public abstract void f3822();
++ public abstract void f3823();
++ public abstract void f3824();
++ public abstract void f3825();
++ public abstract void f3826();
++ public abstract void f3827();
++ public abstract void f3828();
++ public abstract void f3829();
++ public abstract void f3830();
++ public abstract void f3831();
++ public abstract void f3832();
++ public abstract void f3833();
++ public abstract void f3834();
++ public abstract void f3835();
++ public abstract void f3836();
++ public abstract void f3837();
++ public abstract void f3838();
++ public abstract void f3839();
++ public abstract void f3840();
++ public abstract void f3841();
++ public abstract void f3842();
++ public abstract void f3843();
++ public abstract void f3844();
++ public abstract void f3845();
++ public abstract void f3846();
++ public abstract void f3847();
++ public abstract void f3848();
++ public abstract void f3849();
++ public abstract void f3850();
++ public abstract void f3851();
++ public abstract void f3852();
++ public abstract void f3853();
++ public abstract void f3854();
++ public abstract void f3855();
++ public abstract void f3856();
++ public abstract void f3857();
++ public abstract void f3858();
++ public abstract void f3859();
++ public abstract void f3860();
++ public abstract void f3861();
++ public abstract void f3862();
++ public abstract void f3863();
++ public abstract void f3864();
++ public abstract void f3865();
++ public abstract void f3866();
++ public abstract void f3867();
++ public abstract void f3868();
++ public abstract void f3869();
++ public abstract void f3870();
++ public abstract void f3871();
++ public abstract void f3872();
++ public abstract void f3873();
++ public abstract void f3874();
++ public abstract void f3875();
++ public abstract void f3876();
++ public abstract void f3877();
++ public abstract void f3878();
++ public abstract void f3879();
++ public abstract void f3880();
++ public abstract void f3881();
++ public abstract void f3882();
++ public abstract void f3883();
++ public abstract void f3884();
++ public abstract void f3885();
++ public abstract void f3886();
++ public abstract void f3887();
++ public abstract void f3888();
++ public abstract void f3889();
++ public abstract void f3890();
++ public abstract void f3891();
++ public abstract void f3892();
++ public abstract void f3893();
++ public abstract void f3894();
++ public abstract void f3895();
++ public abstract void f3896();
++ public abstract void f3897();
++ public abstract void f3898();
++ public abstract void f3899();
++ public abstract void f3900();
++ public abstract void f3901();
++ public abstract void f3902();
++ public abstract void f3903();
++ public abstract void f3904();
++ public abstract void f3905();
++ public abstract void f3906();
++ public abstract void f3907();
++ public abstract void f3908();
++ public abstract void f3909();
++ public abstract void f3910();
++ public abstract void f3911();
++ public abstract void f3912();
++ public abstract void f3913();
++ public abstract void f3914();
++ public abstract void f3915();
++ public abstract void f3916();
++ public abstract void f3917();
++ public abstract void f3918();
++ public abstract void f3919();
++ public abstract void f3920();
++ public abstract void f3921();
++ public abstract void f3922();
++ public abstract void f3923();
++ public abstract void f3924();
++ public abstract void f3925();
++ public abstract void f3926();
++ public abstract void f3927();
++ public abstract void f3928();
++ public abstract void f3929();
++ public abstract void f3930();
++ public abstract void f3931();
++ public abstract void f3932();
++ public abstract void f3933();
++ public abstract void f3934();
++ public abstract void f3935();
++ public abstract void f3936();
++ public abstract void f3937();
++ public abstract void f3938();
++ public abstract void f3939();
++ public abstract void f3940();
++ public abstract void f3941();
++ public abstract void f3942();
++ public abstract void f3943();
++ public abstract void f3944();
++ public abstract void f3945();
++ public abstract void f3946();
++ public abstract void f3947();
++ public abstract void f3948();
++ public abstract void f3949();
++ public abstract void f3950();
++ public abstract void f3951();
++ public abstract void f3952();
++ public abstract void f3953();
++ public abstract void f3954();
++ public abstract void f3955();
++ public abstract void f3956();
++ public abstract void f3957();
++ public abstract void f3958();
++ public abstract void f3959();
++ public abstract void f3960();
++ public abstract void f3961();
++ public abstract void f3962();
++ public abstract void f3963();
++ public abstract void f3964();
++ public abstract void f3965();
++ public abstract void f3966();
++ public abstract void f3967();
++ public abstract void f3968();
++ public abstract void f3969();
++ public abstract void f3970();
++ public abstract void f3971();
++ public abstract void f3972();
++ public abstract void f3973();
++ public abstract void f3974();
++ public abstract void f3975();
++ public abstract void f3976();
++ public abstract void f3977();
++ public abstract void f3978();
++ public abstract void f3979();
++ public abstract void f3980();
++ public abstract void f3981();
++ public abstract void f3982();
++ public abstract void f3983();
++ public abstract void f3984();
++ public abstract void f3985();
++ public abstract void f3986();
++ public abstract void f3987();
++ public abstract void f3988();
++ public abstract void f3989();
++ public abstract void f3990();
++ public abstract void f3991();
++ public abstract void f3992();
++ public abstract void f3993();
++ public abstract void f3994();
++ public abstract void f3995();
++ public abstract void f3996();
++ public abstract void f3997();
++ public abstract void f3998();
++ public abstract void f3999();
++ public abstract void f4000();
++ public abstract void f4001();
++ public abstract void f4002();
++ public abstract void f4003();
++ public abstract void f4004();
++ public abstract void f4005();
++ public abstract void f4006();
++ public abstract void f4007();
++ public abstract void f4008();
++ public abstract void f4009();
++ public abstract void f4010();
++ public abstract void f4011();
++ public abstract void f4012();
++ public abstract void f4013();
++ public abstract void f4014();
++ public abstract void f4015();
++ public abstract void f4016();
++ public abstract void f4017();
++ public abstract void f4018();
++ public abstract void f4019();
++ public abstract void f4020();
++ public abstract void f4021();
++ public abstract void f4022();
++ public abstract void f4023();
++ public abstract void f4024();
++ public abstract void f4025();
++ public abstract void f4026();
++ public abstract void f4027();
++ public abstract void f4028();
++ public abstract void f4029();
++ public abstract void f4030();
++ public abstract void f4031();
++ public abstract void f4032();
++ public abstract void f4033();
++ public abstract void f4034();
++ public abstract void f4035();
++ public abstract void f4036();
++ public abstract void f4037();
++ public abstract void f4038();
++ public abstract void f4039();
++ public abstract void f4040();
++ public abstract void f4041();
++ public abstract void f4042();
++ public abstract void f4043();
++ public abstract void f4044();
++ public abstract void f4045();
++ public abstract void f4046();
++ public abstract void f4047();
++ public abstract void f4048();
++ public abstract void f4049();
++ public abstract void f4050();
++ public abstract void f4051();
++ public abstract void f4052();
++ public abstract void f4053();
++ public abstract void f4054();
++ public abstract void f4055();
++ public abstract void f4056();
++ public abstract void f4057();
++ public abstract void f4058();
++ public abstract void f4059();
++ public abstract void f4060();
++ public abstract void f4061();
++ public abstract void f4062();
++ public abstract void f4063();
++ public abstract void f4064();
++ public abstract void f4065();
++ public abstract void f4066();
++ public abstract void f4067();
++ public abstract void f4068();
++ public abstract void f4069();
++ public abstract void f4070();
++ public abstract void f4071();
++ public abstract void f4072();
++ public abstract void f4073();
++ public abstract void f4074();
++ public abstract void f4075();
++ public abstract void f4076();
++ public abstract void f4077();
++ public abstract void f4078();
++ public abstract void f4079();
++ public abstract void f4080();
++ public abstract void f4081();
++ public abstract void f4082();
++ public abstract void f4083();
++ public abstract void f4084();
++ public abstract void f4085();
++ public abstract void f4086();
++ public abstract void f4087();
++ public abstract void f4088();
++ public abstract void f4089();
++ public abstract void f4090();
++ public abstract void f4091();
++ public abstract void f4092();
++ public abstract void f4093();
++ public abstract void f4094();
++ public abstract void f4095();
++ public abstract void f4096();
++ public abstract void f4097();
++ public abstract void f4098();
++ public abstract void f4099();
++ public abstract void f4100();
++ public abstract void f4101();
++ public abstract void f4102();
++ public abstract void f4103();
++ public abstract void f4104();
++ public abstract void f4105();
++ public abstract void f4106();
++ public abstract void f4107();
++ public abstract void f4108();
++ public abstract void f4109();
++ public abstract void f4110();
++ public abstract void f4111();
++ public abstract void f4112();
++ public abstract void f4113();
++ public abstract void f4114();
++ public abstract void f4115();
++ public abstract void f4116();
++ public abstract void f4117();
++ public abstract void f4118();
++ public abstract void f4119();
++ public abstract void f4120();
++ public abstract void f4121();
++ public abstract void f4122();
++ public abstract void f4123();
++ public abstract void f4124();
++ public abstract void f4125();
++ public abstract void f4126();
++ public abstract void f4127();
++ public abstract void f4128();
++ public abstract void f4129();
++ public abstract void f4130();
++ public abstract void f4131();
++ public abstract void f4132();
++ public abstract void f4133();
++ public abstract void f4134();
++ public abstract void f4135();
++ public abstract void f4136();
++ public abstract void f4137();
++ public abstract void f4138();
++ public abstract void f4139();
++ public abstract void f4140();
++ public abstract void f4141();
++ public abstract void f4142();
++ public abstract void f4143();
++ public abstract void f4144();
++ public abstract void f4145();
++ public abstract void f4146();
++ public abstract void f4147();
++ public abstract void f4148();
++ public abstract void f4149();
++ public abstract void f4150();
++ public abstract void f4151();
++ public abstract void f4152();
++ public abstract void f4153();
++ public abstract void f4154();
++ public abstract void f4155();
++ public abstract void f4156();
++ public abstract void f4157();
++ public abstract void f4158();
++ public abstract void f4159();
++ public abstract void f4160();
++ public abstract void f4161();
++ public abstract void f4162();
++ public abstract void f4163();
++ public abstract void f4164();
++ public abstract void f4165();
++ public abstract void f4166();
++ public abstract void f4167();
++ public abstract void f4168();
++ public abstract void f4169();
++ public abstract void f4170();
++ public abstract void f4171();
++ public abstract void f4172();
++ public abstract void f4173();
++ public abstract void f4174();
++ public abstract void f4175();
++ public abstract void f4176();
++ public abstract void f4177();
++ public abstract void f4178();
++ public abstract void f4179();
++ public abstract void f4180();
++ public abstract void f4181();
++ public abstract void f4182();
++ public abstract void f4183();
++ public abstract void f4184();
++ public abstract void f4185();
++ public abstract void f4186();
++ public abstract void f4187();
++ public abstract void f4188();
++ public abstract void f4189();
++ public abstract void f4190();
++ public abstract void f4191();
++ public abstract void f4192();
++ public abstract void f4193();
++ public abstract void f4194();
++ public abstract void f4195();
++ public abstract void f4196();
++ public abstract void f4197();
++ public abstract void f4198();
++ public abstract void f4199();
++ public abstract void f4200();
++ public abstract void f4201();
++ public abstract void f4202();
++ public abstract void f4203();
++ public abstract void f4204();
++ public abstract void f4205();
++ public abstract void f4206();
++ public abstract void f4207();
++ public abstract void f4208();
++ public abstract void f4209();
++ public abstract void f4210();
++ public abstract void f4211();
++ public abstract void f4212();
++ public abstract void f4213();
++ public abstract void f4214();
++ public abstract void f4215();
++ public abstract void f4216();
++ public abstract void f4217();
++ public abstract void f4218();
++ public abstract void f4219();
++ public abstract void f4220();
++ public abstract void f4221();
++ public abstract void f4222();
++ public abstract void f4223();
++ public abstract void f4224();
++ public abstract void f4225();
++ public abstract void f4226();
++ public abstract void f4227();
++ public abstract void f4228();
++ public abstract void f4229();
++ public abstract void f4230();
++ public abstract void f4231();
++ public abstract void f4232();
++ public abstract void f4233();
++ public abstract void f4234();
++ public abstract void f4235();
++ public abstract void f4236();
++ public abstract void f4237();
++ public abstract void f4238();
++ public abstract void f4239();
++ public abstract void f4240();
++ public abstract void f4241();
++ public abstract void f4242();
++ public abstract void f4243();
++ public abstract void f4244();
++ public abstract void f4245();
++ public abstract void f4246();
++ public abstract void f4247();
++ public abstract void f4248();
++ public abstract void f4249();
++ public abstract void f4250();
++ public abstract void f4251();
++ public abstract void f4252();
++ public abstract void f4253();
++ public abstract void f4254();
++ public abstract void f4255();
++ public abstract void f4256();
++ public abstract void f4257();
++ public abstract void f4258();
++ public abstract void f4259();
++ public abstract void f4260();
++ public abstract void f4261();
++ public abstract void f4262();
++ public abstract void f4263();
++ public abstract void f4264();
++ public abstract void f4265();
++ public abstract void f4266();
++ public abstract void f4267();
++ public abstract void f4268();
++ public abstract void f4269();
++ public abstract void f4270();
++ public abstract void f4271();
++ public abstract void f4272();
++ public abstract void f4273();
++ public abstract void f4274();
++ public abstract void f4275();
++ public abstract void f4276();
++ public abstract void f4277();
++ public abstract void f4278();
++ public abstract void f4279();
++ public abstract void f4280();
++ public abstract void f4281();
++ public abstract void f4282();
++ public abstract void f4283();
++ public abstract void f4284();
++ public abstract void f4285();
++ public abstract void f4286();
++ public abstract void f4287();
++ public abstract void f4288();
++ public abstract void f4289();
++ public abstract void f4290();
++ public abstract void f4291();
++ public abstract void f4292();
++ public abstract void f4293();
++ public abstract void f4294();
++ public abstract void f4295();
++ public abstract void f4296();
++ public abstract void f4297();
++ public abstract void f4298();
++ public abstract void f4299();
++ public abstract void f4300();
++ public abstract void f4301();
++ public abstract void f4302();
++ public abstract void f4303();
++ public abstract void f4304();
++ public abstract void f4305();
++ public abstract void f4306();
++ public abstract void f4307();
++ public abstract void f4308();
++ public abstract void f4309();
++ public abstract void f4310();
++ public abstract void f4311();
++ public abstract void f4312();
++ public abstract void f4313();
++ public abstract void f4314();
++ public abstract void f4315();
++ public abstract void f4316();
++ public abstract void f4317();
++ public abstract void f4318();
++ public abstract void f4319();
++ public abstract void f4320();
++ public abstract void f4321();
++ public abstract void f4322();
++ public abstract void f4323();
++ public abstract void f4324();
++ public abstract void f4325();
++ public abstract void f4326();
++ public abstract void f4327();
++ public abstract void f4328();
++ public abstract void f4329();
++ public abstract void f4330();
++ public abstract void f4331();
++ public abstract void f4332();
++ public abstract void f4333();
++ public abstract void f4334();
++ public abstract void f4335();
++ public abstract void f4336();
++ public abstract void f4337();
++ public abstract void f4338();
++ public abstract void f4339();
++ public abstract void f4340();
++ public abstract void f4341();
++ public abstract void f4342();
++ public abstract void f4343();
++ public abstract void f4344();
++ public abstract void f4345();
++ public abstract void f4346();
++ public abstract void f4347();
++ public abstract void f4348();
++ public abstract void f4349();
++ public abstract void f4350();
++ public abstract void f4351();
++ public abstract void f4352();
++ public abstract void f4353();
++ public abstract void f4354();
++ public abstract void f4355();
++ public abstract void f4356();
++ public abstract void f4357();
++ public abstract void f4358();
++ public abstract void f4359();
++ public abstract void f4360();
++ public abstract void f4361();
++ public abstract void f4362();
++ public abstract void f4363();
++ public abstract void f4364();
++ public abstract void f4365();
++ public abstract void f4366();
++ public abstract void f4367();
++ public abstract void f4368();
++ public abstract void f4369();
++ public abstract void f4370();
++ public abstract void f4371();
++ public abstract void f4372();
++ public abstract void f4373();
++ public abstract void f4374();
++ public abstract void f4375();
++ public abstract void f4376();
++ public abstract void f4377();
++ public abstract void f4378();
++ public abstract void f4379();
++ public abstract void f4380();
++ public abstract void f4381();
++ public abstract void f4382();
++ public abstract void f4383();
++ public abstract void f4384();
++ public abstract void f4385();
++ public abstract void f4386();
++ public abstract void f4387();
++ public abstract void f4388();
++ public abstract void f4389();
++ public abstract void f4390();
++ public abstract void f4391();
++ public abstract void f4392();
++ public abstract void f4393();
++ public abstract void f4394();
++ public abstract void f4395();
++ public abstract void f4396();
++ public abstract void f4397();
++ public abstract void f4398();
++ public abstract void f4399();
++ public abstract void f4400();
++ public abstract void f4401();
++ public abstract void f4402();
++ public abstract void f4403();
++ public abstract void f4404();
++ public abstract void f4405();
++ public abstract void f4406();
++ public abstract void f4407();
++ public abstract void f4408();
++ public abstract void f4409();
++ public abstract void f4410();
++ public abstract void f4411();
++ public abstract void f4412();
++ public abstract void f4413();
++ public abstract void f4414();
++ public abstract void f4415();
++ public abstract void f4416();
++ public abstract void f4417();
++ public abstract void f4418();
++ public abstract void f4419();
++ public abstract void f4420();
++ public abstract void f4421();
++ public abstract void f4422();
++ public abstract void f4423();
++ public abstract void f4424();
++ public abstract void f4425();
++ public abstract void f4426();
++ public abstract void f4427();
++ public abstract void f4428();
++ public abstract void f4429();
++ public abstract void f4430();
++ public abstract void f4431();
++ public abstract void f4432();
++ public abstract void f4433();
++ public abstract void f4434();
++ public abstract void f4435();
++ public abstract void f4436();
++ public abstract void f4437();
++ public abstract void f4438();
++ public abstract void f4439();
++ public abstract void f4440();
++ public abstract void f4441();
++ public abstract void f4442();
++ public abstract void f4443();
++ public abstract void f4444();
++ public abstract void f4445();
++ public abstract void f4446();
++ public abstract void f4447();
++ public abstract void f4448();
++ public abstract void f4449();
++ public abstract void f4450();
++ public abstract void f4451();
++ public abstract void f4452();
++ public abstract void f4453();
++ public abstract void f4454();
++ public abstract void f4455();
++ public abstract void f4456();
++ public abstract void f4457();
++ public abstract void f4458();
++ public abstract void f4459();
++ public abstract void f4460();
++ public abstract void f4461();
++ public abstract void f4462();
++ public abstract void f4463();
++ public abstract void f4464();
++ public abstract void f4465();
++ public abstract void f4466();
++ public abstract void f4467();
++ public abstract void f4468();
++ public abstract void f4469();
++ public abstract void f4470();
++ public abstract void f4471();
++ public abstract void f4472();
++ public abstract void f4473();
++ public abstract void f4474();
++ public abstract void f4475();
++ public abstract void f4476();
++ public abstract void f4477();
++ public abstract void f4478();
++ public abstract void f4479();
++ public abstract void f4480();
++ public abstract void f4481();
++ public abstract void f4482();
++ public abstract void f4483();
++ public abstract void f4484();
++ public abstract void f4485();
++ public abstract void f4486();
++ public abstract void f4487();
++ public abstract void f4488();
++ public abstract void f4489();
++ public abstract void f4490();
++ public abstract void f4491();
++ public abstract void f4492();
++ public abstract void f4493();
++ public abstract void f4494();
++ public abstract void f4495();
++ public abstract void f4496();
++ public abstract void f4497();
++ public abstract void f4498();
++ public abstract void f4499();
++ public abstract void f4500();
++ public abstract void f4501();
++ public abstract void f4502();
++ public abstract void f4503();
++ public abstract void f4504();
++ public abstract void f4505();
++ public abstract void f4506();
++ public abstract void f4507();
++ public abstract void f4508();
++ public abstract void f4509();
++ public abstract void f4510();
++ public abstract void f4511();
++ public abstract void f4512();
++ public abstract void f4513();
++ public abstract void f4514();
++ public abstract void f4515();
++ public abstract void f4516();
++ public abstract void f4517();
++ public abstract void f4518();
++ public abstract void f4519();
++ public abstract void f4520();
++ public abstract void f4521();
++ public abstract void f4522();
++ public abstract void f4523();
++ public abstract void f4524();
++ public abstract void f4525();
++ public abstract void f4526();
++ public abstract void f4527();
++ public abstract void f4528();
++ public abstract void f4529();
++ public abstract void f4530();
++ public abstract void f4531();
++ public abstract void f4532();
++ public abstract void f4533();
++ public abstract void f4534();
++ public abstract void f4535();
++ public abstract void f4536();
++ public abstract void f4537();
++ public abstract void f4538();
++ public abstract void f4539();
++ public abstract void f4540();
++ public abstract void f4541();
++ public abstract void f4542();
++ public abstract void f4543();
++ public abstract void f4544();
++ public abstract void f4545();
++ public abstract void f4546();
++ public abstract void f4547();
++ public abstract void f4548();
++ public abstract void f4549();
++ public abstract void f4550();
++ public abstract void f4551();
++ public abstract void f4552();
++ public abstract void f4553();
++ public abstract void f4554();
++ public abstract void f4555();
++ public abstract void f4556();
++ public abstract void f4557();
++ public abstract void f4558();
++ public abstract void f4559();
++ public abstract void f4560();
++ public abstract void f4561();
++ public abstract void f4562();
++ public abstract void f4563();
++ public abstract void f4564();
++ public abstract void f4565();
++ public abstract void f4566();
++ public abstract void f4567();
++ public abstract void f4568();
++ public abstract void f4569();
++ public abstract void f4570();
++ public abstract void f4571();
++ public abstract void f4572();
++ public abstract void f4573();
++ public abstract void f4574();
++ public abstract void f4575();
++ public abstract void f4576();
++ public abstract void f4577();
++ public abstract void f4578();
++ public abstract void f4579();
++ public abstract void f4580();
++ public abstract void f4581();
++ public abstract void f4582();
++ public abstract void f4583();
++ public abstract void f4584();
++ public abstract void f4585();
++ public abstract void f4586();
++ public abstract void f4587();
++ public abstract void f4588();
++ public abstract void f4589();
++ public abstract void f4590();
++ public abstract void f4591();
++ public abstract void f4592();
++ public abstract void f4593();
++ public abstract void f4594();
++ public abstract void f4595();
++ public abstract void f4596();
++ public abstract void f4597();
++ public abstract void f4598();
++ public abstract void f4599();
++ public abstract void f4600();
++ public abstract void f4601();
++ public abstract void f4602();
++ public abstract void f4603();
++ public abstract void f4604();
++ public abstract void f4605();
++ public abstract void f4606();
++ public abstract void f4607();
++ public abstract void f4608();
++ public abstract void f4609();
++ public abstract void f4610();
++ public abstract void f4611();
++ public abstract void f4612();
++ public abstract void f4613();
++ public abstract void f4614();
++ public abstract void f4615();
++ public abstract void f4616();
++ public abstract void f4617();
++ public abstract void f4618();
++ public abstract void f4619();
++ public abstract void f4620();
++ public abstract void f4621();
++ public abstract void f4622();
++ public abstract void f4623();
++ public abstract void f4624();
++ public abstract void f4625();
++ public abstract void f4626();
++ public abstract void f4627();
++ public abstract void f4628();
++ public abstract void f4629();
++ public abstract void f4630();
++ public abstract void f4631();
++ public abstract void f4632();
++ public abstract void f4633();
++ public abstract void f4634();
++ public abstract void f4635();
++ public abstract void f4636();
++ public abstract void f4637();
++ public abstract void f4638();
++ public abstract void f4639();
++ public abstract void f4640();
++ public abstract void f4641();
++ public abstract void f4642();
++ public abstract void f4643();
++ public abstract void f4644();
++ public abstract void f4645();
++ public abstract void f4646();
++ public abstract void f4647();
++ public abstract void f4648();
++ public abstract void f4649();
++ public abstract void f4650();
++ public abstract void f4651();
++ public abstract void f4652();
++ public abstract void f4653();
++ public abstract void f4654();
++ public abstract void f4655();
++ public abstract void f4656();
++ public abstract void f4657();
++ public abstract void f4658();
++ public abstract void f4659();
++ public abstract void f4660();
++ public abstract void f4661();
++ public abstract void f4662();
++ public abstract void f4663();
++ public abstract void f4664();
++ public abstract void f4665();
++ public abstract void f4666();
++ public abstract void f4667();
++ public abstract void f4668();
++ public abstract void f4669();
++ public abstract void f4670();
++ public abstract void f4671();
++ public abstract void f4672();
++ public abstract void f4673();
++ public abstract void f4674();
++ public abstract void f4675();
++ public abstract void f4676();
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/test/models/JDK_8081015_TestModel.java Wed Jul 01 21:54:30 2015 -0700
+@@ -0,0 +1,73 @@
++/*
++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package jdk.nashorn.test.models;
++
++import static org.testng.Assert.assertEquals;
++import static org.testng.Assert.assertFalse;
++
++import java.util.Collection;
++import java.util.Deque;
++import java.util.Iterator;
++import java.util.List;
++import java.util.Queue;
++
++@SuppressWarnings("javadoc")
++public class JDK_8081015_TestModel {
++ private String lastInvoked;
++
++ public void receiveCollection(final Collection<Object> c) {
++ lastInvoked = "receiveCollection";
++ walkCollection(c);
++ }
++
++ public void receiveDeque(final Deque<Object> d) {
++ lastInvoked = "receiveDeque";
++ walkCollection(d);
++ }
++
++ public void receiveList(final List<Object> l) {
++ lastInvoked = "receiveList";
++ walkCollection(l);
++ }
++
++ public void receiveQueue(final Queue<Object> q) {
++ lastInvoked = "receiveQueue";
++ walkCollection(q);
++ }
++
++ public String getLastInvoked() {
++ return lastInvoked;
++ }
++
++ private static void walkCollection(final Collection<Object> c) {
++ final Iterator<Object> it = c.iterator();
++ assertEquals(it.next(), Integer.valueOf(1));
++ assertEquals(it.next(), Integer.valueOf(2));
++ assertEquals(it.next(), Double.valueOf(3.3));
++ assertEquals(it.next(), "foo");
++ assertFalse(it.hasNext());
++ }
++}
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ ./nashorn/test/src/jdk/nashorn/test/models/Jdk8072596TestSubject.java Wed Jul 01 21:54:30 2015 -0700
+@@ -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. 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.nashorn.test.models;
++
++import java.util.List;
++import java.util.Map;
++import jdk.nashorn.api.scripting.ScriptObjectMirror;
++import jdk.nashorn.internal.runtime.ScriptObject;
++import org.testng.Assert;
++
++public class Jdk8072596TestSubject {
++
++ public Jdk8072596TestSubject(final Object x) {
++ Assert.assertTrue(x instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)x).get("bar"), 0);
++ }
++
++ // Test having to wrap some arguments but not others
++ public void test1(final String x, final Object y, final ScriptObject w) {
++ Assert.assertEquals(x, "true");
++
++ Assert.assertTrue(y instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)y).get("foo"), 1);
++
++ Assert.assertEquals(w.get("bar"), 2);
++ }
++
++ // Test having to wrap some arguments but not others, and a vararg array
++ public void test2(String x, final Object y, final ScriptObject w, final Object... z) {
++ test1(x, y, w);
++
++ Assert.assertEquals(z.length, 2);
++
++ Assert.assertTrue(z[0] instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)z[0]).get("baz"), 3);
++
++ Assert.assertTrue(z[1] instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)z[1]).get("bing"), 4);
++ }
++
++ // Test mixed (wrappable and non-wrappable) elements in a vararg array
++ public void test3(final Object... z) {
++ Assert.assertEquals(z.length, 5);
++
++ Assert.assertEquals(z[0], true);
++
++ Assert.assertTrue(z[1] instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)z[1]).get("foo"), 5);
++
++ Assert.assertEquals(z[2], "hello");
++
++ Assert.assertTrue(z[3] instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)z[3]).getSlot(0), 6);
++ Assert.assertEquals(((ScriptObjectMirror)z[3]).getSlot(1), 7);
++
++ Assert.assertEquals(z[4], 8);
++ }
++
++ // test wrapping the first argument of a static method
++ public static void test4(final Object x) {
++ Assert.assertTrue(x instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)x).get("foo"), 9);
++ }
++
++ public void testListHasWrappedObject(final List<?> l) {
++ Assert.assertEquals(l.size(), 1);
++ Assert.assertTrue(l.get(0) instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)l.get(0)).get("foo"), 10);
++ }
++
++ public void testArrayHasWrappedObject(final Object[] a) {
++ Assert.assertEquals(a.length, 1);
++ Assert.assertTrue(a[0] instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)a[0]).get("bar"), 11);
++ }
++
++ public void testMapHasWrappedObject(final Map<?, ?> m, final Object key) {
++ Assert.assertEquals(m.size(), 1);
++ Assert.assertTrue(key instanceof ScriptObjectMirror);
++ Assert.assertTrue(m.get(key) instanceof ScriptObjectMirror);
++ Assert.assertEquals(((ScriptObjectMirror)m.get(key)).get("bar"), 12);
++ }
++}